/* * Copyright (c) 2007 Dell Inc */ #ifndef IPMI_DELLOEM_H #define IPMI_DELLOEM_H #if HAVE_CONFIG_H # include #endif #pragma pack(1) // #include // #include #define MIN(a,b) ((a) < (b) ? (a) : (b)) #define MAX(a,b) ((a) > (b) ? (a) : (b)) // IPMI 2.0 command for system information #define IPMI_SET_SYS_INFO 0x58 #define IPMI_GET_SYS_INFO 0x59 /*power managment command*/ #define IPMI_CMD_GET_POWER_MANAGMENT_INFO 0x9c #define IPMI_CMD_CLEAR_POWER_MANAGMENT_INFO 0x9d // Dell selector for LCD control - get and set unless specified #define IPMI_DELL_LCD_STRING_SELECTOR 0xC1 // RW get/set the user string #define IPMI_DELL_LCD_CONFIG_SELECTOR 0xC2 // RW set to user/default/none #define IPMI_DELL_LCD_GET_CAPS_SELECTOR 0xCF // RO use when available #define IPMI_DELL_LCD_STRINGEX_SELECTOR 0xD0 // RW get/set the user string use first when available #define IPMI_DELL_PLATFORM_MODEL_NAME_SELECTOR 0xD1 // LCD string when config set to default. // Dell defines for picking which string to use #define IPMI_DELL_LCD_CONFIG_USER_DEFINED 0x00 // use string set by user #define IPMI_DELL_LCD_CONFIG_DEFAULT 0x01 // use platform model name #define IPMI_DELL_LCD_CONFIG_NONE 0x02 // blank // Not on all Dell servers. If there, use it. typedef struct _tag_ipmi_dell_lcd_caps { uint8_t parm_rev; // 0x11 for IPMI 2.0 uint8_t char_set; // always 1 for printable ASCII 0x20-0x7E uint8_t number_lines; // 0-4, 1 for 9G. 10G tbd uint8_t max_chars[4]; // 62 for triathlon, 0 if not present (glacier) // [0] is max chars for line 1 } IPMI_DELL_LCD_CAPS; #define IPMI_DELL_LCD_STRING_LENGTH_MAX 62 // Valid for 9G. Glacier ??. #define IPMI_DELL_LCD_STRING1_SIZE 14 #define IPMI_DELL_LCD_STRINGN_SIZE 16 #define IPMI_DELL_SYSINFO_HOST_NAME 0x02 #define IPMI_DELL_SYSINFO_ASSET_TAG 0xC4 #define IPMI_DELL_SYSINFO_ASSET_TAG_LENGTH 10 #define IPMI_DELL_SYSINFO_SERVICE_TAG 0xC5 #define IPMI_DELL_SYSINFO_SERVICE_TAG_LENGTH 7 #define IPMI_DELL_SYSINFO_OS_NAME 0x04 #define IPMI_DELL_SYSINFO_BIOS_VERSION 0x01 /* sel print options*/ #define SEL_PRINT_ALL 0 #define SEL_PRINT_FIRST 1 #define SEL_PRINT_LAST 2 /* SDR structure constants */ #define MAX_SDR_SIZE 64 #define MAX_SDR_ENTRIES 300 /* BIB field type definitions */ #define BIB_TYPE_BIOS_VERSION 0x00 #define BIB_TYPE_SERVICE_TAG 0x01 #define BIB_TYPE_ASSET_TAG 0x02 #define BIB_TYPE_PDRODUCT_MODEL 0x1A typedef struct _tag_ipmi_dell_lcd_string { uint8_t parm_rev; // 0x11 for IPMI 2.0 uint8_t data_block_selector; // 16-byte data block number to access, 0 based. union { struct { uint8_t encoding : 4; // 0 is printable ASCII 7-bit uint8_t length; // 0 to max chars from lcd caps uint8_t data[IPMI_DELL_LCD_STRING1_SIZE]; // not zero terminated. } selector_0_string; uint8_t selector_n_data[IPMI_DELL_LCD_STRINGN_SIZE]; } lcd_string; } IPMI_DELL_LCD_STRING; // Only found on servers with more than 1 line. Use if available. typedef struct _tag_ipmi_dell_lcd_stringex { uint8_t parm_rev; // 0x11 for IPMI 2.0 uint8_t line_number; // LCD line number 1 to 4 uint8_t data_block_selector; // 16-byte data block number to access, 0 based. union { struct { uint8_t encoding : 4; // 0 is printable ASCII 7-bit uint8_t length; // 0 to max chars from lcd caps uint8_t data[IPMI_DELL_LCD_STRING1_SIZE]; // not zero terminated. } selector_0_string; uint8_t selector_n_data[IPMI_DELL_LCD_STRINGN_SIZE]; } lcd_string; } IPMI_DELL_LCD_STRINGEX; typedef struct _tag_ipmi_dell_asset_tag { uint8_t parm_rev; // 0x11 for IPMI 2.0 uint8_t length; uint8_t tag[10]; } IPMI_DELL_TAG; typedef struct _ipmi_power_monitor { uint32_t cumStartTime; uint32_t cumReading; uint32_t maxPeakStartTime; uint32_t ampPeakTime; uint16_t ampReading; uint32_t wattPeakTime; uint16_t wattReading; }IPMI_POWER_MONITOR; int ipmi_delloem_main(struct ipmi_intf * intf, int argc, char ** argv); #endif /*IPMI_DELLOEM_H*/