From a8fd6f10a5f8f8f1970785b351e4efe6e2ff726b Mon Sep 17 00:00:00 2001 From: Chris Austen Date: Sat, 31 Oct 2015 14:09:10 -0500 Subject: Remove ipmi fru support from libapphandler The new code will come from a different repo --- storagehandler.C | 69 -------------------------------------------------------- storagehandler.h | 1 - 2 files changed, 70 deletions(-) diff --git a/storagehandler.C b/storagehandler.C index 359e53f..aa80730 100644 --- a/storagehandler.C +++ b/storagehandler.C @@ -64,72 +64,6 @@ ipmi_ret_t ipmi_storage_set_sel_time(ipmi_netfn_t netfn, ipmi_cmd_t cmd, return rc; } -struct write_fru_data_t { - uint8_t frunum; - uint8_t offsetls; - uint8_t offsetms; - uint8_t data; -} __attribute__ ((packed)) ; - -ipmi_ret_t ipmi_storage_write_fru_data(ipmi_netfn_t netfn, ipmi_cmd_t cmd, - ipmi_request_t request, ipmi_response_t response, - ipmi_data_len_t data_len, ipmi_context_t context) -{ - write_fru_data_t *reqptr = (write_fru_data_t*) request; - FILE *fp; - char string[16]; - short offset = 0; - uint16_t rlen; - ipmi_ret_t rc = IPMI_CC_OK; - char iocmd[4]; - - sprintf(string, "%s%02x", "/tmp/fru", reqptr->frunum); - - offset = ((uint16_t)reqptr->offsetms) << 8 | reqptr->offsetls; - - - // Length is the number of request bytes minus the header itself. - // The header contains an extra byte to indicate the start of - // the data (so didn't need to worry about word/byte boundaries) - // hence the -1... - rlen = ((uint16_t)*data_len) - (sizeof(write_fru_data_t)-1); - - - printf("IPMI WRITE-FRU-DATA for %s Offset = %d Length = %d\n", - string, offset, rlen); - - - // I was thinking "ab+" but it appears it doesn't - // do what fseek asks. Modify to rb+ and fseek - // works great... - if (offset == 0) { - strcpy(iocmd, "wb"); - } else { - strcpy(iocmd, "rb+"); - } - - if ((fp = fopen(string, iocmd)) != NULL) { - fseek(fp, offset, SEEK_SET); - fwrite(&reqptr->data,rlen,1,fp); - fclose(fp); - } else { - fprintf(stderr, "Error trying to write to fru file %s\n",string); - ipmi_ret_t rc = IPMI_CC_INVALID; - } - - - // TODO : Here is where some validation code could determine if the - // fru data is a legitimate FRU record (not just a partial). Once - // the record is valid the code should call a parser routine to call - // the various methods updating interesting properties. Perhaps - // thinigs like Model#, Serial#, DIMM Size, etc - - - *data_len = 0; - - return rc; -} - ipmi_ret_t ipmi_storage_get_sel_info(ipmi_netfn_t netfn, ipmi_cmd_t cmd, ipmi_request_t request, ipmi_response_t response, ipmi_data_len_t data_len, ipmi_context_t context) @@ -211,9 +145,6 @@ void register_netfn_storage_functions() printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_STORAGE, IPMI_CMD_SET_SEL_TIME); ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_SET_SEL_TIME, NULL, ipmi_storage_set_sel_time); - printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_STORAGE, IPMI_CMD_WRITE_FRU_DATA); - ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_WRITE_FRU_DATA, NULL, ipmi_storage_write_fru_data); - printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_STORAGE, IPMI_CMD_GET_SEL_INFO); ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_GET_SEL_INFO, NULL, ipmi_storage_get_sel_info); diff --git a/storagehandler.h b/storagehandler.h index 7abefd5..174da06 100644 --- a/storagehandler.h +++ b/storagehandler.h @@ -5,7 +5,6 @@ enum ipmi_netfn_storage_cmds { // Get capability bits - IPMI_CMD_WRITE_FRU_DATA = 0x12, IPMI_CMD_GET_SEL_INFO = 0x40, IPMI_CMD_RESERVE_SEL = 0x42, IPMI_CMD_ADD_SEL = 0x44, -- cgit v1.2.1