@@ -64,72 +64,6 @@ ipmi_ret_t ipmi_storage_set_sel_time(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
64
64
return rc ;
65
65
}
66
66
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
-
133
67
ipmi_ret_t ipmi_storage_get_sel_info (ipmi_netfn_t netfn , ipmi_cmd_t cmd ,
134
68
ipmi_request_t request , ipmi_response_t response ,
135
69
ipmi_data_len_t data_len , ipmi_context_t context )
@@ -211,9 +145,6 @@ void register_netfn_storage_functions()
211
145
printf ("Registering NetFn:[0x%X], Cmd:[0x%X]\n" ,NETFUN_STORAGE , IPMI_CMD_SET_SEL_TIME );
212
146
ipmi_register_callback (NETFUN_STORAGE , IPMI_CMD_SET_SEL_TIME , NULL , ipmi_storage_set_sel_time );
213
147
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
-
217
148
printf ("Registering NetFn:[0x%X], Cmd:[0x%X]\n" ,NETFUN_STORAGE , IPMI_CMD_GET_SEL_INFO );
218
149
ipmi_register_callback (NETFUN_STORAGE , IPMI_CMD_GET_SEL_INFO , NULL , ipmi_storage_get_sel_info );
219
150
0 commit comments