mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 18:47:22 +00:00
added read/write support and PICMG ekey support
This commit is contained in:
parent
89f6d591e0
commit
6514de2b13
@ -66,7 +66,7 @@ enum {
|
|||||||
|
|
||||||
struct fru_info {
|
struct fru_info {
|
||||||
uint16_t size;
|
uint16_t size;
|
||||||
uint8_t access : 1;
|
uint8_t access:1;
|
||||||
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
struct fru_header {
|
struct fru_header {
|
||||||
@ -86,8 +86,8 @@ struct fru_area_chassis {
|
|||||||
uint8_t area_ver;
|
uint8_t area_ver;
|
||||||
uint8_t type;
|
uint8_t type;
|
||||||
uint16_t area_len;
|
uint16_t area_len;
|
||||||
char * part;
|
char *part;
|
||||||
char * serial;
|
char *serial;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct fru_area_board {
|
struct fru_area_board {
|
||||||
@ -95,24 +95,24 @@ struct fru_area_board {
|
|||||||
uint8_t lang;
|
uint8_t lang;
|
||||||
uint16_t area_len;
|
uint16_t area_len;
|
||||||
uint32_t mfg_date_time;
|
uint32_t mfg_date_time;
|
||||||
char * mfg;
|
char *mfg;
|
||||||
char * prod;
|
char *prod;
|
||||||
char * serial;
|
char *serial;
|
||||||
char * part;
|
char *part;
|
||||||
char * fru;
|
char *fru;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct fru_area_product {
|
struct fru_area_product {
|
||||||
uint8_t area_ver;
|
uint8_t area_ver;
|
||||||
uint8_t lang;
|
uint8_t lang;
|
||||||
uint16_t area_len;
|
uint16_t area_len;
|
||||||
char * mfg;
|
char *mfg;
|
||||||
char * name;
|
char *name;
|
||||||
char * part;
|
char *part;
|
||||||
char * version;
|
char *version;
|
||||||
char * serial;
|
char *serial;
|
||||||
char * asset;
|
char *asset;
|
||||||
char * fru;
|
char *fru;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct fru_multirec_header {
|
struct fru_multirec_header {
|
||||||
@ -134,8 +134,8 @@ struct fru_multirec_powersupply {
|
|||||||
#if WORDS_BIGENDIAN
|
#if WORDS_BIGENDIAN
|
||||||
uint16_t capacity;
|
uint16_t capacity;
|
||||||
#else
|
#else
|
||||||
uint16_t capacity : 12;
|
uint16_t capacity:12;
|
||||||
uint16_t __reserved1 : 4;
|
uint16_t __reserved1:4;
|
||||||
#endif
|
#endif
|
||||||
uint16_t peak_va;
|
uint16_t peak_va;
|
||||||
uint8_t inrush_current;
|
uint8_t inrush_current;
|
||||||
@ -148,45 +148,44 @@ struct fru_multirec_powersupply {
|
|||||||
uint8_t highend_freq;
|
uint8_t highend_freq;
|
||||||
uint8_t dropout_tolerance;
|
uint8_t dropout_tolerance;
|
||||||
#if WORDS_BIGENDIAN
|
#if WORDS_BIGENDIAN
|
||||||
uint8_t __reserved2 : 3;
|
uint8_t __reserved2:3;
|
||||||
uint8_t tach : 1;
|
uint8_t tach:1;
|
||||||
uint8_t hotswap : 1;
|
uint8_t hotswap:1;
|
||||||
uint8_t autoswitch : 1;
|
uint8_t autoswitch:1;
|
||||||
uint8_t pfc : 1;
|
uint8_t pfc:1;
|
||||||
uint8_t predictive_fail : 1;
|
uint8_t predictive_fail:1;
|
||||||
#else
|
#else
|
||||||
uint8_t predictive_fail : 1;
|
uint8_t predictive_fail:1;
|
||||||
uint8_t pfc : 1;
|
uint8_t pfc:1;
|
||||||
uint8_t autoswitch : 1;
|
uint8_t autoswitch:1;
|
||||||
uint8_t hotswap : 1;
|
uint8_t hotswap:1;
|
||||||
uint8_t tach : 1;
|
uint8_t tach:1;
|
||||||
uint8_t __reserved2 : 3;
|
uint8_t __reserved2:3;
|
||||||
#endif
|
#endif
|
||||||
uint16_t peak_cap_ht;
|
uint16_t peak_cap_ht;
|
||||||
#if WORDS_BIGENDIAN
|
#if WORDS_BIGENDIAN
|
||||||
uint8_t combined_voltage1 : 4;
|
uint8_t combined_voltage1:4;
|
||||||
uint8_t combined_voltage2 : 4;
|
uint8_t combined_voltage2:4;
|
||||||
#else
|
#else
|
||||||
uint8_t combined_voltage2 : 4;
|
uint8_t combined_voltage2:4;
|
||||||
uint8_t combined_voltage1 : 4;
|
uint8_t combined_voltage1:4;
|
||||||
#endif
|
#endif
|
||||||
uint16_t combined_capacity;
|
uint16_t combined_capacity;
|
||||||
uint8_t rps_threshold;
|
uint8_t rps_threshold;
|
||||||
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
static const char * combined_voltage_desc[] __attribute__((unused)) = {
|
static const char *combined_voltage_desc[] __attribute__ ((unused)) = {
|
||||||
"12 V", "-12 V", "5 V", "3.3 V"
|
"12 V", "-12 V", "5 V", "3.3 V"};
|
||||||
};
|
|
||||||
|
|
||||||
struct fru_multirec_dcoutput {
|
struct fru_multirec_dcoutput {
|
||||||
#if WORDS_BIGENDIAN
|
#if WORDS_BIGENDIAN
|
||||||
uint8_t standby : 1;
|
uint8_t standby:1;
|
||||||
uint8_t __reserved : 3;
|
uint8_t __reserved:3;
|
||||||
uint8_t output_number : 4;
|
uint8_t output_number:4;
|
||||||
#else
|
#else
|
||||||
uint8_t output_number : 4;
|
uint8_t output_number:4;
|
||||||
uint8_t __reserved : 3;
|
uint8_t __reserved:3;
|
||||||
uint8_t standby : 1;
|
uint8_t standby:1;
|
||||||
#endif
|
#endif
|
||||||
short nominal_voltage;
|
short nominal_voltage;
|
||||||
short max_neg_dev;
|
short max_neg_dev;
|
||||||
@ -198,11 +197,11 @@ struct fru_multirec_dcoutput {
|
|||||||
|
|
||||||
struct fru_multirec_dcload {
|
struct fru_multirec_dcload {
|
||||||
#if WORDS_BIGENDIAN
|
#if WORDS_BIGENDIAN
|
||||||
uint8_t __reserved : 4;
|
uint8_t __reserved:4;
|
||||||
uint8_t output_number : 4;
|
uint8_t output_number:4;
|
||||||
#else
|
#else
|
||||||
uint8_t output_number : 4;
|
uint8_t output_number:4;
|
||||||
uint8_t __reserved : 4;
|
uint8_t __reserved:4;
|
||||||
#endif
|
#endif
|
||||||
short nominal_voltage;
|
short nominal_voltage;
|
||||||
short min_voltage;
|
short min_voltage;
|
||||||
@ -214,17 +213,17 @@ struct fru_multirec_dcload {
|
|||||||
|
|
||||||
struct fru_multirec_picmgext_header {
|
struct fru_multirec_picmgext_header {
|
||||||
unsigned char mfg_id[3];
|
unsigned char mfg_id[3];
|
||||||
#define FRU_PICMG_BACKPLANE_P2P 0x04
|
#define FRU_PICMG_BACKPLANE_P2P 0x04
|
||||||
#define FRU_PICMG_ADDRESS_TABLE 0x10
|
#define FRU_PICMG_ADDRESS_TABLE 0x10
|
||||||
#define FRU_PICMG_SHELF_POWER_DIST 0x11
|
#define FRU_PICMG_SHELF_POWER_DIST 0x11
|
||||||
#define FRU_PICMG_SHELF_ACTIVATION 0x12
|
#define FRU_PICMG_SHELF_ACTIVATION 0x12
|
||||||
#define FRU_PICMG_SHMC_IP_CONN 0x13
|
#define FRU_PICMG_SHMC_IP_CONN 0x13
|
||||||
#define FRU_PICMG_BOARD_P2P 0x14
|
#define FRU_PICMG_BOARD_P2P 0x14
|
||||||
#define FRU_AMC_CURRENT 0x16
|
#define FRU_AMC_CURRENT 0x16
|
||||||
#define FRU_AMC_ACTIVATION 0x17
|
#define FRU_AMC_ACTIVATION 0x17
|
||||||
#define FRU_AMC_CARRIER_P2P 0x18
|
#define FRU_AMC_CARRIER_P2P 0x18
|
||||||
#define FRU_AMC_P2P 0x19
|
#define FRU_AMC_P2P 0x19
|
||||||
#define FRU_AMC_CARRIER_INFO 0x1a
|
#define FRU_AMC_CARRIER_INFO 0x1a
|
||||||
unsigned char record_id;
|
unsigned char record_id;
|
||||||
unsigned char record_version;
|
unsigned char record_version;
|
||||||
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
||||||
@ -235,39 +234,39 @@ struct fru_picmgext_guid {
|
|||||||
|
|
||||||
struct fru_picmgext_link_desc {
|
struct fru_picmgext_link_desc {
|
||||||
#ifndef WORDS_BIGENDIAN
|
#ifndef WORDS_BIGENDIAN
|
||||||
unsigned int designator : 12;
|
unsigned int designator:12;
|
||||||
#define FRU_PICMGEXT_LINK_TYPE_BASE 0x01
|
#define FRU_PICMGEXT_LINK_TYPE_BASE 0x01
|
||||||
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET 0x02
|
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET 0x02
|
||||||
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND 0x03
|
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND 0x03
|
||||||
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR 0x04
|
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR 0x04
|
||||||
#define FRU_PICMGEXT_LINK_TYPE_PCIE 0x05
|
#define FRU_PICMGEXT_LINK_TYPE_PCIE 0x05
|
||||||
unsigned int type : 8;
|
unsigned int type:8;
|
||||||
unsigned int ext : 4;
|
unsigned int ext:4;
|
||||||
unsigned int grouping : 8;
|
unsigned int grouping:8;
|
||||||
#else
|
#else
|
||||||
unsigned int grouping : 8;
|
unsigned int grouping:8;
|
||||||
unsigned int ext : 4;
|
unsigned int ext:4;
|
||||||
#define FRU_PICMGEXT_LINK_TYPE_BASE 0x01
|
#define FRU_PICMGEXT_LINK_TYPE_BASE 0x01
|
||||||
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET 0x02
|
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET 0x02
|
||||||
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND 0x03
|
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND 0x03
|
||||||
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR 0x04
|
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR 0x04
|
||||||
#define FRU_PICMGEXT_LINK_TYPE_PCIE 0x05
|
#define FRU_PICMGEXT_LINK_TYPE_PCIE 0x05
|
||||||
unsigned int type : 8;
|
unsigned int type:8;
|
||||||
unsigned int designator : 12;
|
unsigned int designator:12;
|
||||||
#endif
|
#endif
|
||||||
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
struct fru_picmgext_chn_desc {
|
struct fru_picmgext_chn_desc {
|
||||||
#ifndef WORDS_BIGENDIAN
|
#ifndef WORDS_BIGENDIAN
|
||||||
unsigned char remote_slot : 8;
|
unsigned char remote_slot:8;
|
||||||
unsigned char remote_chn : 5;
|
unsigned char remote_chn:5;
|
||||||
unsigned char local_chn : 5;
|
unsigned char local_chn:5;
|
||||||
unsigned char : 6;
|
unsigned char:6;
|
||||||
#else
|
#else
|
||||||
unsigned char : 6;
|
unsigned char:6;
|
||||||
unsigned char local_chn : 5;
|
unsigned char local_chn:5;
|
||||||
unsigned char remote_chn : 5;
|
unsigned char remote_chn:5;
|
||||||
unsigned char remote_slot : 8;
|
unsigned char remote_slot:8;
|
||||||
#endif
|
#endif
|
||||||
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
@ -277,7 +276,6 @@ struct fru_picmgext_slot_desc {
|
|||||||
unsigned char chn_count;
|
unsigned char chn_count;
|
||||||
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
|
|
||||||
#define FRU_PICMGEXT_DESIGN_IF_BASE 0x00
|
#define FRU_PICMGEXT_DESIGN_IF_BASE 0x00
|
||||||
#define FRU_PICMGEXT_DESIGN_IF_FABRIC 0x01
|
#define FRU_PICMGEXT_DESIGN_IF_FABRIC 0x01
|
||||||
#define FRU_PICMGEXT_DESIGN_IF_UPDATE_CHANNEL 0x02
|
#define FRU_PICMGEXT_DESIGN_IF_UPDATE_CHANNEL 0x02
|
||||||
@ -297,30 +295,28 @@ struct fru_picmgext_carrier_p2p_record {
|
|||||||
struct fru_picmgext_carrier_p2p_descriptor {
|
struct fru_picmgext_carrier_p2p_descriptor {
|
||||||
#ifndef WORDS_BIGENDIAN
|
#ifndef WORDS_BIGENDIAN
|
||||||
unsigned char remote_resource_id;
|
unsigned char remote_resource_id;
|
||||||
unsigned short remote_port : 5;
|
unsigned short remote_port:5;
|
||||||
unsigned short local_port : 5;
|
unsigned short local_port:5;
|
||||||
unsigned short reserved : 6;
|
unsigned short reserved:6;
|
||||||
#else
|
#else
|
||||||
unsigned short reserved : 6;
|
unsigned short reserved:6;
|
||||||
unsigned short local_port : 5;
|
unsigned short local_port:5;
|
||||||
unsigned short remote_port : 5;
|
unsigned short remote_port:5;
|
||||||
unsigned char remote_resource_id;
|
unsigned char remote_resource_id;
|
||||||
#endif
|
#endif
|
||||||
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
|
static const char *chassis_type_desc[] __attribute__ ((unused)) = {
|
||||||
static const char * chassis_type_desc[] __attribute__((unused)) = {
|
"Unspecified", "Other", "Unknown",
|
||||||
"Unspecified", "Other", "Unknown",
|
|
||||||
"Desktop", "Low Profile Desktop", "Pizza Box",
|
"Desktop", "Low Profile Desktop", "Pizza Box",
|
||||||
"Mini Tower", "Tower",
|
"Mini Tower", "Tower",
|
||||||
"Portable", "LapTop", "Notebook", "Hand Held", "Docking Station",
|
"Portable", "LapTop", "Notebook", "Hand Held",
|
||||||
"All in One", "Sub Notebook", "Space-saving", "Lunch Box",
|
"Docking Station", "All in One", "Sub Notebook",
|
||||||
"Main Server Chassis", "Expansion Chassis", "SubChassis",
|
"Space-saving", "Lunch Box", "Main Server Chassis",
|
||||||
"Bus Expansion Chassis", "Peripheral Chassis", "RAID Chassis",
|
"Expansion Chassis", "SubChassis", "Bus Expansion Chassis",
|
||||||
"Rack Mount Chassis"
|
"Peripheral Chassis", "RAID Chassis", "Rack Mount Chassis"};
|
||||||
};
|
|
||||||
|
|
||||||
int ipmi_fru_main(struct ipmi_intf * intf, int argc, char ** argv);
|
int ipmi_fru_main(struct ipmi_intf *intf, int argc, char **argv);
|
||||||
int ipmi_fru_print(struct ipmi_intf * intf, struct sdr_record_fru_locator * fru);
|
int ipmi_fru_print(struct ipmi_intf *intf, struct sdr_record_fru_locator *fru);
|
||||||
|
|
||||||
#endif /* IPMI_FRU_H */
|
#endif /* IPMI_FRU_H */
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user