Skip to content

Commit a8fd6f1

Browse files
author
Chris Austen
committed
Remove ipmi fru support from libapphandler
The new code will come from a different repo
1 parent 5fc6492 commit a8fd6f1

File tree

2 files changed

+0
-70
lines changed

2 files changed

+0
-70
lines changed

storagehandler.C

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -64,72 +64,6 @@ ipmi_ret_t ipmi_storage_set_sel_time(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
6464
return rc;
6565
}
6666

67-
struct write_fru_data_t {
68-
uint8_t frunum;
69-
uint8_t offsetls;
70-
uint8_t offsetms;
71-
uint8_t data;
72-
} __attribute__ ((packed)) ;
73-
74-
ipmi_ret_t ipmi_storage_write_fru_data(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
75-
ipmi_request_t request, ipmi_response_t response,
76-
ipmi_data_len_t data_len, ipmi_context_t context)
77-
{
78-
write_fru_data_t *reqptr = (write_fru_data_t*) request;
79-
FILE *fp;
80-
char string[16];
81-
short offset = 0;
82-
uint16_t rlen;
83-
ipmi_ret_t rc = IPMI_CC_OK;
84-
char iocmd[4];
85-
86-
sprintf(string, "%s%02x", "/tmp/fru", reqptr->frunum);
87-
88-
offset = ((uint16_t)reqptr->offsetms) << 8 | reqptr->offsetls;
89-
90-
91-
// Length is the number of request bytes minus the header itself.
92-
// The header contains an extra byte to indicate the start of
93-
// the data (so didn't need to worry about word/byte boundaries)
94-
// hence the -1...
95-
rlen = ((uint16_t)*data_len) - (sizeof(write_fru_data_t)-1);
96-
97-
98-
printf("IPMI WRITE-FRU-DATA for %s Offset = %d Length = %d\n",
99-
string, offset, rlen);
100-
101-
102-
// I was thinking "ab+" but it appears it doesn't
103-
// do what fseek asks. Modify to rb+ and fseek
104-
// works great...
105-
if (offset == 0) {
106-
strcpy(iocmd, "wb");
107-
} else {
108-
strcpy(iocmd, "rb+");
109-
}
110-
111-
if ((fp = fopen(string, iocmd)) != NULL) {
112-
fseek(fp, offset, SEEK_SET);
113-
fwrite(&reqptr->data,rlen,1,fp);
114-
fclose(fp);
115-
} else {
116-
fprintf(stderr, "Error trying to write to fru file %s\n",string);
117-
ipmi_ret_t rc = IPMI_CC_INVALID;
118-
}
119-
120-
121-
// TODO : Here is where some validation code could determine if the
122-
// fru data is a legitimate FRU record (not just a partial). Once
123-
// the record is valid the code should call a parser routine to call
124-
// the various methods updating interesting properties. Perhaps
125-
// thinigs like Model#, Serial#, DIMM Size, etc
126-
127-
128-
*data_len = 0;
129-
130-
return rc;
131-
}
132-
13367
ipmi_ret_t ipmi_storage_get_sel_info(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
13468
ipmi_request_t request, ipmi_response_t response,
13569
ipmi_data_len_t data_len, ipmi_context_t context)
@@ -211,9 +145,6 @@ void register_netfn_storage_functions()
211145
printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_STORAGE, IPMI_CMD_SET_SEL_TIME);
212146
ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_SET_SEL_TIME, NULL, ipmi_storage_set_sel_time);
213147

214-
printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_STORAGE, IPMI_CMD_WRITE_FRU_DATA);
215-
ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_WRITE_FRU_DATA, NULL, ipmi_storage_write_fru_data);
216-
217148
printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_STORAGE, IPMI_CMD_GET_SEL_INFO);
218149
ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_GET_SEL_INFO, NULL, ipmi_storage_get_sel_info);
219150

storagehandler.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
enum ipmi_netfn_storage_cmds
66
{
77
// Get capability bits
8-
IPMI_CMD_WRITE_FRU_DATA = 0x12,
98
IPMI_CMD_GET_SEL_INFO = 0x40,
109
IPMI_CMD_RESERVE_SEL = 0x42,
1110
IPMI_CMD_ADD_SEL = 0x44,

0 commit comments

Comments
 (0)