ID: 85 - Supermicro memory ECC error display

Commit adds ipmi_get_oem_id() function.
This commit is contained in:
Zdenek Styblik 2013-12-17 04:53:20 +00:00
parent c9e047c334
commit 3a852a8849
2 changed files with 30 additions and 0 deletions

View File

@ -99,6 +99,7 @@ void printbuf(const uint8_t * buf, int len, const char * desc);
uint8_t ipmi_csum(uint8_t * d, int s); uint8_t ipmi_csum(uint8_t * d, int s);
FILE * ipmi_open_file(const char * file, int rw); FILE * ipmi_open_file(const char * file, int rw);
void ipmi_start_daemon(struct ipmi_intf *intf); void ipmi_start_daemon(struct ipmi_intf *intf);
uint16_t ipmi_get_oem_id(struct ipmi_intf *intf);
#define ipmi_open_file_read(file) ipmi_open_file(file, 0) #define ipmi_open_file_read(file) ipmi_open_file(file, 0)
#define ipmi_open_file_write(file) ipmi_open_file(file, 1) #define ipmi_open_file_write(file) ipmi_open_file(file, 1)

View File

@ -756,3 +756,32 @@ is_ipmi_user_id(const char *argv_ptr, uint8_t *ipmi_uid_ptr)
IPMI_UID_MIN, IPMI_UID_MAX); IPMI_UID_MIN, IPMI_UID_MAX);
return (-1); return (-1);
} }
uint16_t
ipmi_get_oem_id(struct ipmi_intf *intf)
{
/* Execute a Get Board ID command to determine the board */
struct ipmi_rs *rsp;
struct ipmi_rq req;
uint16_t oem_id;
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_TSOL;
req.msg.cmd = 0x21;
req.msg.data_len = 0;
rsp = intf->sendrecv(intf, &req);
if (rsp == NULL) {
lprintf(LOG_ERR, "Get Board ID command failed");
return 0;
}
if (rsp->ccode > 0) {
lprintf(LOG_ERR, "Get Board ID command failed: %#x %s",
rsp->ccode, val2str(rsp->ccode, completion_code_vals));
return 0;
}
oem_id = rsp->data[0] | (rsp->data[1] << 8);
lprintf(LOG_DEBUG,"Board ID: %x", oem_id);
return oem_id;
}