blob: cd6f10c8aeb3f2d505e3c23759b08d6d57bafd27 [file] [log] [blame]
Vishwanatha Subbanna5fba7a62016-09-01 14:06:07 +05301#include <cstdio>
2#include <string>
Adriana Kobylak8e30f2a2015-10-20 10:23:51 -05003#include <arpa/inet.h>
Vishwanatha Subbanna5fba7a62016-09-01 14:06:07 +05304#include <systemd/sd-bus.h>
5#include <mapper.h>
6#include <chrono>
Tom Joseph6f7deaa2017-06-30 19:03:54 +05307#include "selutility.hpp"
Chris Austen41a4b312015-10-25 03:45:42 -05008#include "storagehandler.h"
9#include "storageaddsel.h"
Tom Joseph8f4a2aa2017-06-30 19:12:49 +053010#include "utils.hpp"
Patrick Williams37af7332016-09-02 21:21:42 -050011#include "host-ipmid/ipmid-api.h"
Tom Josepha4953392017-06-30 19:09:47 +053012#include <experimental/filesystem>
Tom Joseph6f7deaa2017-06-30 19:03:54 +053013#include <phosphor-logging/log.hpp>
14#include <sdbusplus/server.hpp>
15#include "xyz/openbmc_project/Common/error.hpp"
Chris Austen41a4b312015-10-25 03:45:42 -050016
Chris Austenb4f5b922015-10-13 12:44:43 -050017void register_netfn_storage_functions() __attribute__((constructor));
18
19
20unsigned int g_sel_time = 0xFFFFFFFF;
Nan Li36c0cb62016-03-31 11:16:08 +080021extern unsigned short g_sel_reserve;
Chris Austenb4f5b922015-10-13 12:44:43 -050022
Vishwanatha Subbanna5fba7a62016-09-01 14:06:07 +053023constexpr auto time_manager_intf = "org.openbmc.TimeManager";
24constexpr auto time_manager_obj = "/org/openbmc/TimeManager";
25
Tom Joseph6f7deaa2017-06-30 19:03:54 +053026namespace cache
27{
28 /*
29 * This cache contains the object paths of the logging entries sorted in the
30 * order of the filename(numeric order). The cache is initialized by
31 * invoking readLoggingObjectPaths with the cache as the parameter. The
32 * cache is invoked in the execution of the Get SEL info and Delete SEL
33 * entry command. The Get SEL Info command is typically invoked before the
34 * Get SEL entry command, so the cache is utilized for responding to Get SEL
35 * entry command. The cache is invalidated by clearing after Delete SEL
36 * entry and Clear SEL command.
37 */
38 ipmi::sel::ObjectPaths paths;
39
40} // namespace objectPathsCache
41
42using InternalFailure =
43 sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure;
44using namespace phosphor::logging;
45
Adriana Kobylak8e30f2a2015-10-20 10:23:51 -050046ipmi_ret_t ipmi_storage_wildcard(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
47 ipmi_request_t request, ipmi_response_t response,
Chris Austenb4f5b922015-10-13 12:44:43 -050048 ipmi_data_len_t data_len, ipmi_context_t context)
49{
50 printf("Handling STORAGE WILDCARD Netfn:[0x%X], Cmd:[0x%X]\n",netfn, cmd);
51 // Status code.
Nan Li70aa8d92016-08-29 00:11:10 +080052 ipmi_ret_t rc = IPMI_CC_INVALID;
Chris Austenb4f5b922015-10-13 12:44:43 -050053 *data_len = 0;
54 return rc;
55}
56
Tom Joseph6f7deaa2017-06-30 19:03:54 +053057ipmi_ret_t getSELInfo(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
58 ipmi_request_t request, ipmi_response_t response,
59 ipmi_data_len_t data_len, ipmi_context_t context)
60{
61 std::vector<uint8_t> outPayload(sizeof(ipmi::sel::GetSELInfoResponse));
62 auto responseData = reinterpret_cast<ipmi::sel::GetSELInfoResponse*>
63 (outPayload.data());
64
65 responseData->selVersion = ipmi::sel::selVersion;
66 // Last erase timestamp is not available from log manager.
67 responseData->eraseTimeStamp = ipmi::sel::invalidTimeStamp;
68 responseData->operationSupport = ipmi::sel::operationSupport;
69
70 ipmi::sel::readLoggingObjectPaths(cache::paths);
71 responseData->entries = 0;
72 responseData->addTimeStamp = ipmi::sel::invalidTimeStamp;
73
74 if (!cache::paths.empty())
75 {
76 responseData->entries = static_cast<uint16_t>(cache::paths.size());
77
78 try
79 {
80 responseData->addTimeStamp = static_cast<uint32_t>(
81 (ipmi::sel::getEntryTimeStamp(cache::paths.back())
82 .count()));
83 }
84 catch (InternalFailure& e)
85 {
86 }
87 catch (const std::runtime_error& e)
88 {
89 log<level::ERR>(e.what());
90 }
91 }
92
93 memcpy(response, outPayload.data(), outPayload.size());
94 *data_len = outPayload.size();
95
96 return IPMI_CC_OK;
97}
98
Tom Josepha4953392017-06-30 19:09:47 +053099ipmi_ret_t getSELEntry(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
100 ipmi_request_t request, ipmi_response_t response,
101 ipmi_data_len_t data_len, ipmi_context_t context)
102{
103 auto requestData = reinterpret_cast<const ipmi::sel::GetSELEntryRequest*>
104 (request);
105
106 if (requestData->reservationID != 0)
107 {
108 if (g_sel_reserve != requestData->reservationID)
109 {
110 *data_len = 0;
111 return IPMI_CC_INVALID_RESERVATION_ID;
112 }
113 }
114
115 if (cache::paths.empty())
116 {
117 *data_len = 0;
118 return IPMI_CC_SENSOR_INVALID;
119 }
120
121 ipmi::sel::ObjectPaths::const_iterator iter;
122
123 // Check for the requested SEL Entry.
124 if (requestData->selRecordID == ipmi::sel::firstEntry)
125 {
126 iter = cache::paths.begin();
127 }
128 else if (requestData->selRecordID == ipmi::sel::lastEntry)
129 {
130 iter = cache::paths.end();
131 }
132 else
133 {
134 std::string objPath = std::string(ipmi::sel::logBasePath) + "/" +
135 std::to_string(requestData->selRecordID);
136
137 iter = std::find(cache::paths.begin(), cache::paths.end(), objPath);
138 if (iter == cache::paths.end())
139 {
140 *data_len = 0;
141 return IPMI_CC_SENSOR_INVALID;
142 }
143 }
144
145 ipmi::sel::GetSELEntryResponse record {};
146
147 // Convert the log entry into SEL record.
148 try
149 {
150 record = ipmi::sel::convertLogEntrytoSEL(*iter);
151 }
152 catch (InternalFailure& e)
153 {
154 *data_len = 0;
155 return IPMI_CC_UNSPECIFIED_ERROR;
156 }
157 catch (const std::runtime_error& e)
158 {
159 log<level::ERR>(e.what());
160 *data_len = 0;
161 return IPMI_CC_UNSPECIFIED_ERROR;
162 }
163
164
165 // Identify the next SEL record ID
166 if(iter != cache::paths.end())
167 {
168 ++iter;
169 if (iter == cache::paths.end())
170 {
171 record.nextRecordID = ipmi::sel::lastEntry;
172 }
173 else
174 {
175 namespace fs = std::experimental::filesystem;
176 fs::path path(*iter);
177 record.nextRecordID = static_cast<uint16_t>
178 (std::stoul(std::string(path.filename().c_str())));
179 }
180 }
181 else
182 {
183 record.nextRecordID = ipmi::sel::lastEntry;
184 }
185
186 if (requestData->readLength == ipmi::sel::entireRecord)
187 {
188 memcpy(response, &record, sizeof(record));
189 *data_len = sizeof(record);
190 }
191 else
192 {
193 if (requestData->offset >= ipmi::sel::selRecordSize ||
194 requestData->readLength > ipmi::sel::selRecordSize)
195 {
196 *data_len = 0;
197 return IPMI_CC_INVALID_FIELD_REQUEST;
198 }
199
200 auto diff = ipmi::sel::selRecordSize - requestData->offset;
201 auto readLength = std::min(diff,
202 static_cast<int>(requestData->readLength));
203
204 memcpy(response, &record.nextRecordID, sizeof(record.nextRecordID));
205 memcpy(static_cast<uint8_t*>(response) + sizeof(record.nextRecordID),
206 &record.recordID + requestData->offset, readLength);
207 *data_len = sizeof(record.nextRecordID) + readLength;
208 }
209
210 return IPMI_CC_OK;
211}
212
Tom Joseph8f4a2aa2017-06-30 19:12:49 +0530213ipmi_ret_t deleteSELEntry(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
214 ipmi_request_t request, ipmi_response_t response,
215 ipmi_data_len_t data_len, ipmi_context_t context)
216{
217 namespace fs = std::experimental::filesystem;
218 auto requestData = reinterpret_cast<const ipmi::sel::DeleteSELEntryRequest*>
219 (request);
220
221 if (g_sel_reserve != requestData->reservationID)
222 {
223 *data_len = 0;
224 return IPMI_CC_INVALID_RESERVATION_ID;
225 }
226
227 ipmi::sel::readLoggingObjectPaths(cache::paths);
228
229 if (cache::paths.empty())
230 {
231 *data_len = 0;
232 return IPMI_CC_SENSOR_INVALID;
233 }
234
235 ipmi::sel::ObjectPaths::const_iterator iter;
236 uint16_t delRecordID = 0;
237
238 if (requestData->selRecordID == ipmi::sel::firstEntry)
239 {
240 iter = cache::paths.begin();
241 fs::path path(*iter);
242 delRecordID = static_cast<uint16_t>
243 (std::stoul(std::string(path.filename().c_str())));
244 }
245 else if (requestData->selRecordID == ipmi::sel::lastEntry)
246 {
247 iter = cache::paths.end();
248 fs::path path(*iter);
249 delRecordID = static_cast<uint16_t>
250 (std::stoul(std::string(path.filename().c_str())));
251 }
252 else
253 {
254 std::string objPath = std::string(ipmi::sel::logBasePath) + "/" +
255 std::to_string(requestData->selRecordID);
256
257 iter = std::find(cache::paths.begin(), cache::paths.end(), objPath);
258 if (iter == cache::paths.end())
259 {
260 *data_len = 0;
261 return IPMI_CC_SENSOR_INVALID;
262 }
263 delRecordID = requestData->selRecordID;
264 }
265
266 sdbusplus::bus::bus bus{ipmid_get_sd_bus_connection()};
267 std::string service;
268
269 try
270 {
271 service = ipmi::getService(bus, ipmi::sel::logDeleteIntf, *iter);
272 }
273 catch (const std::runtime_error& e)
274 {
275 log<level::ERR>(e.what());
276 *data_len = 0;
277 return IPMI_CC_UNSPECIFIED_ERROR;
278 }
279
280 auto methodCall = bus.new_method_call(service.c_str(),
281 (*iter).c_str(),
282 ipmi::sel::logDeleteIntf,
283 "Delete");
284 auto reply = bus.call(methodCall);
285 if (reply.is_method_error())
286 {
287 *data_len = 0;
288 return IPMI_CC_UNSPECIFIED_ERROR;
289 }
290
291 // Invalidate the cache of dbus entry objects.
292 cache::paths.clear();
293 memcpy(response, &delRecordID, sizeof(delRecordID));
294 *data_len = sizeof(delRecordID);
295
296 return IPMI_CC_OK;
297}
298
Adriana Kobylak8e30f2a2015-10-20 10:23:51 -0500299ipmi_ret_t ipmi_storage_get_sel_time(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
300 ipmi_request_t request, ipmi_response_t response,
301 ipmi_data_len_t data_len, ipmi_context_t context)
302{
Vishwanatha Subbanna5fba7a62016-09-01 14:06:07 +0530303 using namespace std::chrono;
304
305 char *time_provider = nullptr;
306 const char* time_in_str = nullptr;
307 uint64_t host_time_usec = 0;
308 uint32_t resp = 0;
Adriana Kobylak8e30f2a2015-10-20 10:23:51 -0500309 ipmi_ret_t rc = IPMI_CC_OK;
Chris Austenb4f5b922015-10-13 12:44:43 -0500310
Vishwanatha Subbanna5fba7a62016-09-01 14:06:07 +0530311 sd_bus_message *reply = nullptr;
312 sd_bus_error bus_error = SD_BUS_ERROR_NULL;
Adriana Kobylak8e30f2a2015-10-20 10:23:51 -0500313
314 printf("IPMI Handling GET-SEL-TIME\n");
315
Vishwanatha Subbanna5fba7a62016-09-01 14:06:07 +0530316 auto bus = ipmid_get_sd_bus_connection();
317
318 auto rct = mapper_get_service(bus, time_manager_obj, &time_provider);
319 if (rct < 0) {
320 printf("Error [%s] getting bus name for time provider\n",
321 strerror(-rct));
322 rc = IPMI_CC_UNSPECIFIED_ERROR;
323 goto finish;
324 }
325
326 rct = sd_bus_call_method(bus,
327 time_provider,
328 time_manager_obj,
329 time_manager_intf,
330 "GetTime",
331 &bus_error,
332 &reply,
333 "s",
334 "host");
335 if (rct < 0) {
336 printf("Error [%s] getting time\n", strerror(-rct));
337 rc = IPMI_CC_UNSPECIFIED_ERROR;
338 goto finish;
339 }
340
341 rct = sd_bus_message_read(reply, "sx", &time_in_str, &host_time_usec);
342 if (rct < 0) {
343 fprintf(stderr, "Error [%s] parsing get-time response\n",
344 strerror(-rct));
345 rc = IPMI_CC_UNSPECIFIED_ERROR;
346 goto finish;
347 }
348
349 // Time is really long int but IPMI wants just uint32. This works okay until
350 // the number of seconds since 1970 overflows uint32 size.. Still a whole
351 // lot of time here to even think about that.
352 resp = duration_cast<seconds>(microseconds(host_time_usec)).count();
353 resp = htole32(resp);
354 printf("Host Time read:[%s] :: [%d]\n", time_in_str, resp);
355
Adriana Kobylak8e30f2a2015-10-20 10:23:51 -0500356 // From the IPMI Spec 2.0, response should be a 32-bit value
357 *data_len = sizeof(resp);
358
359 // Pack the actual response
360 memcpy(response, &resp, *data_len);
361
Vishwanatha Subbanna5fba7a62016-09-01 14:06:07 +0530362finish:
363 sd_bus_error_free(&bus_error);
364 reply = sd_bus_message_unref(reply);
365 free(time_provider);
Adriana Kobylak8e30f2a2015-10-20 10:23:51 -0500366 return rc;
367}
368
369ipmi_ret_t ipmi_storage_set_sel_time(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
370 ipmi_request_t request, ipmi_response_t response,
Chris Austenb4f5b922015-10-13 12:44:43 -0500371 ipmi_data_len_t data_len, ipmi_context_t context)
372{
Vishwanatha Subbanna5fba7a62016-09-01 14:06:07 +0530373 char *time_provider = nullptr;
374 int time_rc = 0;
375 ipmi_ret_t rc = IPMI_CC_OK;
376
377 sd_bus_message *reply = nullptr;
378 sd_bus_error bus_error = SD_BUS_ERROR_NULL;
379
Norman James82330442015-11-19 16:53:26 -0600380 uint32_t* secs = (uint32_t*)request;
Vishwanatha Subbanna5fba7a62016-09-01 14:06:07 +0530381 *data_len = 0;
Chris Austenb4f5b922015-10-13 12:44:43 -0500382
383 printf("Handling Set-SEL-Time:[0x%X], Cmd:[0x%X]\n",netfn, cmd);
Norman James82330442015-11-19 16:53:26 -0600384 printf("Data: 0x%X]\n",*secs);
Chris Austenb4f5b922015-10-13 12:44:43 -0500385
Vishwanatha Subbanna5fba7a62016-09-01 14:06:07 +0530386 auto bus = ipmid_get_sd_bus_connection();
Norman James82330442015-11-19 16:53:26 -0600387
Vishwanatha Subbanna5fba7a62016-09-01 14:06:07 +0530388 auto rct = mapper_get_service(bus, time_manager_obj, &time_provider);
389 if (rct < 0) {
390 printf("Error [%s] getting bus name for time provider\n",
391 strerror(-rct));
392 rc = IPMI_CC_UNSPECIFIED_ERROR;
393 goto finish;
Norman James82330442015-11-19 16:53:26 -0600394 }
Vishwanatha Subbanna5fba7a62016-09-01 14:06:07 +0530395
396 rct = sd_bus_call_method(bus,
397 time_provider,
398 time_manager_obj,
399 time_manager_intf,
400 "SetTime",
401 &bus_error,
402 &reply,
403 "ss",
404 "host",
405 std::to_string(le32toh(*secs)).c_str());
406
407 if (rct < 0) {
408 printf("Error [%s] setting time\n", strerror(-rct));
409 rc = IPMI_CC_UNSPECIFIED_ERROR;
410 goto finish;
411 }
412
413 rct = sd_bus_message_read(reply, "i", &time_rc);
414 if (rct < 0) {
415 fprintf(stderr, "Error [%s] parsing set-time response\n",
416 strerror(-rct));
417 rc = IPMI_CC_UNSPECIFIED_ERROR;
418 goto finish;
419 }
420
421 if (time_rc < 0) {
422 printf("Error setting time.");
Norman James82330442015-11-19 16:53:26 -0600423 rc = IPMI_CC_UNSPECIFIED_ERROR;
424 }
Vishwanatha Subbanna5fba7a62016-09-01 14:06:07 +0530425
426finish:
427 sd_bus_error_free(&bus_error);
428 reply = sd_bus_message_unref(reply);
429 free(time_provider);
Chris Austenb4f5b922015-10-13 12:44:43 -0500430 return rc;
431}
432
Adriana Kobylak8e30f2a2015-10-20 10:23:51 -0500433ipmi_ret_t ipmi_storage_reserve_sel(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
434 ipmi_request_t request, ipmi_response_t response,
Chris Austenb4f5b922015-10-13 12:44:43 -0500435 ipmi_data_len_t data_len, ipmi_context_t context)
436{
Chris Austenb4f5b922015-10-13 12:44:43 -0500437 ipmi_ret_t rc = IPMI_CC_OK;
438
Nan Li36c0cb62016-03-31 11:16:08 +0800439 // IPMI spec, Reservation ID, the value simply increases against each execution of reserve_sel command.
440 if( ++g_sel_reserve == 0)
441 g_sel_reserve = 1;
Chris Austenb4f5b922015-10-13 12:44:43 -0500442
Nan Li36c0cb62016-03-31 11:16:08 +0800443 printf("IPMI Handling RESERVE-SEL 0x%04x\n", g_sel_reserve);
Chris Austen41a4b312015-10-25 03:45:42 -0500444
Chris Austenb4f5b922015-10-13 12:44:43 -0500445 *data_len = sizeof(g_sel_reserve);
446
447 // Pack the actual response
448 memcpy(response, &g_sel_reserve, *data_len);
449
450 return rc;
451}
452
Adriana Kobylak8e30f2a2015-10-20 10:23:51 -0500453ipmi_ret_t ipmi_storage_add_sel(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
454 ipmi_request_t request, ipmi_response_t response,
Chris Austenb4f5b922015-10-13 12:44:43 -0500455 ipmi_data_len_t data_len, ipmi_context_t context)
456{
457
458 ipmi_ret_t rc = IPMI_CC_OK;
Chris Austen41a4b312015-10-25 03:45:42 -0500459 ipmi_add_sel_request_t *p = (ipmi_add_sel_request_t*) request;
460 uint16_t recordid;
Chris Austenb4f5b922015-10-13 12:44:43 -0500461
Chris Austen313d95b2015-10-31 12:55:30 -0500462 recordid = ((uint16_t)p->eventdata[1] << 8) | p->eventdata[2];
Chris Austen41a4b312015-10-25 03:45:42 -0500463
464 printf("IPMI Handling ADD-SEL for record 0x%04x\n", recordid);
Chris Austenb4f5b922015-10-13 12:44:43 -0500465
466 *data_len = sizeof(g_sel_reserve);
467
468 // Pack the actual response
Chris Austen7cc33322015-11-11 00:20:22 -0600469 memcpy(response, &p->eventdata[1], 2);
Chris Austenb4f5b922015-10-13 12:44:43 -0500470
Chris Austen41a4b312015-10-25 03:45:42 -0500471 send_esel(recordid);
Chris Austenb4f5b922015-10-13 12:44:43 -0500472
473 return rc;
474}
475
476
477
478void register_netfn_storage_functions()
479{
Tom05732372016-09-06 17:21:23 +0530480 // <Wildcard Command>
Chris Austenb4f5b922015-10-13 12:44:43 -0500481 printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_STORAGE, IPMI_CMD_WILDCARD);
Tom05732372016-09-06 17:21:23 +0530482 ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_WILDCARD, NULL, ipmi_storage_wildcard,
483 PRIVILEGE_USER);
Chris Austenb4f5b922015-10-13 12:44:43 -0500484
Tom Joseph6f7deaa2017-06-30 19:03:54 +0530485 // <Get SEL Info>
486 printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_STORAGE, IPMI_CMD_GET_SEL_INFO);
487 ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_GET_SEL_INFO, NULL, getSELInfo,
488 PRIVILEGE_USER);
489
Tom05732372016-09-06 17:21:23 +0530490 // <Get SEL Time>
Adriana Kobylak8e30f2a2015-10-20 10:23:51 -0500491 printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_STORAGE, IPMI_CMD_GET_SEL_TIME);
Tom05732372016-09-06 17:21:23 +0530492 ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_GET_SEL_TIME, NULL, ipmi_storage_get_sel_time,
493 PRIVILEGE_USER);
Adriana Kobylak8e30f2a2015-10-20 10:23:51 -0500494
Tom05732372016-09-06 17:21:23 +0530495 // <Set SEL Time>
Chris Austenb4f5b922015-10-13 12:44:43 -0500496 printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_STORAGE, IPMI_CMD_SET_SEL_TIME);
Tom05732372016-09-06 17:21:23 +0530497 ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_SET_SEL_TIME, NULL, ipmi_storage_set_sel_time,
498 PRIVILEGE_OPERATOR);
Chris Austenb4f5b922015-10-13 12:44:43 -0500499
Tom05732372016-09-06 17:21:23 +0530500 // <Reserve SEL>
Chris Austenb4f5b922015-10-13 12:44:43 -0500501 printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_STORAGE, IPMI_CMD_RESERVE_SEL);
Tom05732372016-09-06 17:21:23 +0530502 ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_RESERVE_SEL, NULL, ipmi_storage_reserve_sel,
503 PRIVILEGE_USER);
Chris Austenb4f5b922015-10-13 12:44:43 -0500504
Tom Josepha4953392017-06-30 19:09:47 +0530505 // <Get SEL Entry>
506 printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_STORAGE, IPMI_CMD_GET_SEL_ENTRY);
507 ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_GET_SEL_ENTRY, NULL, getSELEntry,
508 PRIVILEGE_USER);
509
Tom Joseph8f4a2aa2017-06-30 19:12:49 +0530510 // <Delete SEL Entry>
511 printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_STORAGE, IPMI_CMD_DELETE_SEL);
512 ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_DELETE_SEL, NULL, deleteSELEntry,
513 PRIVILEGE_OPERATOR);
514
Tom05732372016-09-06 17:21:23 +0530515 // <Add SEL Entry>
Chris Austenb4f5b922015-10-13 12:44:43 -0500516 printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_STORAGE, IPMI_CMD_ADD_SEL);
Tom05732372016-09-06 17:21:23 +0530517 ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_ADD_SEL, NULL, ipmi_storage_add_sel,
518 PRIVILEGE_OPERATOR);
Chris Austenb4f5b922015-10-13 12:44:43 -0500519 return;
520}
521