aboutsummaryrefslogtreecommitdiffstats
path: root/com32/gplinclude/dmi/dmi_memory.h
blob: 4d0ad442baa7c2b9f64bc990e983c11d8c4da088 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/* ----------------------------------------------------------------------- *
 *
 *   Copyright 2009 Erwan Velu - All Rights Reserved
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
 *   Boston MA 02111-1307, USA; either version 2 of the License, or
 *   (at your option) any later version; incorporated herein by reference.
 *
 * ----------------------------------------------------------------------- */

#ifndef DMI_MEMORY_H
#define DMI_MEMORY_H

#define MEMORY_MANUFACTURER_SIZE	32
#define MEMORY_ERROR_SIZE		16
#define MEMORY_TOTAL_WIDTH_SIZE		16
#define MEMORY_DATA_WIDTH_SIZE		16
#define MEMORY_SIZE_SIZE		32
#define MEMORY_FORM_FACTOR_SIZE		32
#define MEMORY_DEVICE_SET_SIZE		32
#define MEMORY_DEVICE_LOCATOR_SIZE	32
#define MEMORY_BANK_LOCATOR_SIZE	32
#define MEMORY_TYPE_SIZE		32
#define MEMORY_TYPE_DETAIL_SIZE		16
#define MEMORY_SPEED_SIZE		16
#define MEMORY_SERIAL_SIZE		16
#define MEMORY_ASSET_TAG_SIZE		16
#define MEMORY_PART_NUMBER_SIZE		16

typedef struct {
    char manufacturer[MEMORY_MANUFACTURER_SIZE];
    char error[MEMORY_ERROR_SIZE];
    char total_width[MEMORY_TOTAL_WIDTH_SIZE];
    char data_width[MEMORY_DATA_WIDTH_SIZE];
    char size[MEMORY_SIZE_SIZE];
    char form_factor[MEMORY_FORM_FACTOR_SIZE];
    char device_set[MEMORY_DEVICE_SET_SIZE];
    char device_locator[MEMORY_DEVICE_LOCATOR_SIZE];
    char bank_locator[MEMORY_BANK_LOCATOR_SIZE];
    char type[MEMORY_TYPE_SIZE];
    char type_detail[MEMORY_TYPE_DETAIL_SIZE];
    char speed[MEMORY_SPEED_SIZE];
    char serial[MEMORY_SERIAL_SIZE];
    char asset_tag[MEMORY_ASSET_TAG_SIZE];
    char part_number[MEMORY_PART_NUMBER_SIZE];
/* The filled field have to be set to true when the dmitable implement that item */
    bool filled;
} s_memory;

typedef struct {
    char socket_designation[8];
    char bank_connections[8];
    char speed[8];
    char type[48];
    char installed_size[48];
    char enabled_size[48];
    char error_status[8];
    bool filled;
} s_memory_module;

void dmi_memory_array_error_handle(uint16_t code, char *array);
void dmi_memory_device_width(uint16_t code, char *width);
void dmi_memory_device_size(uint16_t code, char *size);
const char *dmi_memory_device_form_factor(uint8_t code);
void dmi_memory_device_set(uint8_t code, char *set);
const char *dmi_memory_device_type(uint8_t code);
void dmi_memory_device_type_detail(uint16_t code, char *type_detail, int sizeof_type_detail);
void dmi_memory_device_speed(uint16_t code, char *speed);

void dmi_memory_module_connections(uint8_t, char *, int);
void dmi_memory_module_speed(uint8_t, char *);
void dmi_memory_module_types(uint16_t, const char *, char *, int);
void dmi_memory_module_size(uint8_t, char *, int);
void dmi_memory_module_error(uint8_t, const char *, char *);
#endif