blob: 781f6ba6dffd92dbc9053e38d3b04fda8b55a99a [file] [log] [blame]
Jia, Chunhuia835eaa2018-09-05 09:00:41 +08001/*
2// Copyright (c) 2018 Intel Corporation
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15*/
16
Jason M. Bills64796042018-10-03 16:51:55 -070017#include "xyz/openbmc_project/Common/error.hpp"
18
Jia, Chunhuia835eaa2018-09-05 09:00:41 +080019#include <host-ipmid/ipmid-api.h>
20
21#include <array>
Jason M. Bills64796042018-10-03 16:51:55 -070022#include <commandutils.hpp>
Jia, Chunhuia835eaa2018-09-05 09:00:41 +080023#include <iostream>
24#include <oemcommands.hpp>
Jason M. Bills3f7c5e42018-10-03 14:00:41 -070025#include <phosphor-ipmi-host/utils.hpp>
Jia, Chunhuia835eaa2018-09-05 09:00:41 +080026#include <phosphor-logging/log.hpp>
27#include <sdbusplus/bus.hpp>
Jia, Chunhuia835eaa2018-09-05 09:00:41 +080028#include <string>
29#include <vector>
Jia, Chunhuia835eaa2018-09-05 09:00:41 +080030
31namespace ipmi
32{
Jason M. Bills64796042018-10-03 16:51:55 -070033static void registerOEMFunctions() __attribute__((constructor));
34sdbusplus::bus::bus dbus(ipmid_get_sd_bus_connection()); // from ipmid-api.h
35static constexpr size_t maxFRUStringLength = 0x3F;
Jia, Chunhuia835eaa2018-09-05 09:00:41 +080036
37// return code: 0 successful
38int8_t getChassisSerialNumber(sdbusplus::bus::bus& bus, std::string& serial)
39{
40 std::string objpath = "/xyz/openbmc_project/FruDevice";
41 std::string intf = "xyz.openbmc_project.FruDeviceManager";
42 std::string service = getService(bus, intf, objpath);
43 ObjectValueTree valueTree = getManagedObjects(bus, service, "/");
44 if (valueTree.empty())
45 {
46 phosphor::logging::log<phosphor::logging::level::ERR>(
47 "No object implements interface",
48 phosphor::logging::entry("INTF=%s", intf.c_str()));
49 return -1;
50 }
51
Jason M. Bills64796042018-10-03 16:51:55 -070052 for (const auto& item : valueTree)
Jia, Chunhuia835eaa2018-09-05 09:00:41 +080053 {
54 auto interface = item.second.find("xyz.openbmc_project.FruDevice");
55 if (interface == item.second.end())
56 {
57 continue;
58 }
59
60 auto property = interface->second.find("CHASSIS_SERIAL_NUMBER");
61 if (property == interface->second.end())
62 {
63 continue;
64 }
65
66 try
67 {
68 Value variant = property->second;
Jason M. Bills64796042018-10-03 16:51:55 -070069 std::string& result =
70 sdbusplus::message::variant_ns::get<std::string>(variant);
71 if (result.size() > maxFRUStringLength)
Jia, Chunhuia835eaa2018-09-05 09:00:41 +080072 {
73 phosphor::logging::log<phosphor::logging::level::ERR>(
74 "FRU serial number exceed maximum length");
Jia, Chunhuia835eaa2018-09-05 09:00:41 +080075 return -1;
76 }
Jason M. Bills64796042018-10-03 16:51:55 -070077 serial = result;
Jia, Chunhuia835eaa2018-09-05 09:00:41 +080078 return 0;
79 }
Jason M. Bills64796042018-10-03 16:51:55 -070080 catch (sdbusplus::message::variant_ns::bad_variant_access& e)
Jia, Chunhuia835eaa2018-09-05 09:00:41 +080081 {
Jason M. Bills64796042018-10-03 16:51:55 -070082 phosphor::logging::log<phosphor::logging::level::ERR>(e.what());
Jia, Chunhuia835eaa2018-09-05 09:00:41 +080083 return -1;
84 }
85 }
86 return -1;
87}
Jason M. Bills64796042018-10-03 16:51:55 -070088
Jia, Chunhuia835eaa2018-09-05 09:00:41 +080089ipmi_ret_t ipmiOEMWildcard(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
90 ipmi_request_t request, ipmi_response_t response,
Jason M. Bills64796042018-10-03 16:51:55 -070091 ipmi_data_len_t dataLen, ipmi_context_t context)
Jia, Chunhuia835eaa2018-09-05 09:00:41 +080092{
Jason M. Bills64796042018-10-03 16:51:55 -070093 printCommand(+netfn, +cmd);
Jia, Chunhuia835eaa2018-09-05 09:00:41 +080094 // Status code.
95 ipmi_ret_t rc = IPMI_CC_INVALID;
Jason M. Bills64796042018-10-03 16:51:55 -070096 *dataLen = 0;
Jia, Chunhuia835eaa2018-09-05 09:00:41 +080097 return rc;
98}
99
100// Returns the Chassis Identifier (serial #)
101ipmi_ret_t ipmiOEMGetChassisIdentifier(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
102 ipmi_request_t request,
103 ipmi_response_t response,
Jason M. Bills64796042018-10-03 16:51:55 -0700104 ipmi_data_len_t dataLen,
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800105 ipmi_context_t context)
106{
107 std::string serial;
Jason M. Bills64796042018-10-03 16:51:55 -0700108 if (*dataLen != 0) // invalid request if there are extra parameters
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800109 {
Jason M. Bills64796042018-10-03 16:51:55 -0700110 *dataLen = 0;
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800111 return IPMI_CC_REQ_DATA_LEN_INVALID;
112 }
Jason M. Bills64796042018-10-03 16:51:55 -0700113 if (getChassisSerialNumber(dbus, serial) == 0)
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800114 {
Jason M. Bills64796042018-10-03 16:51:55 -0700115 *dataLen = serial.size(); // length will never exceed response length
116 // as it is checked in getChassisSerialNumber
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800117 char* resp = static_cast<char*>(response);
Jason M. Bills64796042018-10-03 16:51:55 -0700118 serial.copy(resp, *dataLen);
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800119 return IPMI_CC_OK;
120 }
Jason M. Bills64796042018-10-03 16:51:55 -0700121 *dataLen = 0;
122 return IPMI_CC_RESPONSE_ERROR;
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800123}
124
125ipmi_ret_t ipmiOEMSetSystemGUID(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
126 ipmi_request_t request,
127 ipmi_response_t response,
Jason M. Bills64796042018-10-03 16:51:55 -0700128 ipmi_data_len_t dataLen, ipmi_context_t context)
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800129{
130 static constexpr size_t safeBufferLength = 50;
131 char buf[safeBufferLength] = {0};
132 GUIDData* Data = reinterpret_cast<GUIDData*>(request);
133
Jason M. Bills64796042018-10-03 16:51:55 -0700134 if (*dataLen != sizeof(GUIDData)) // 16bytes
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800135 {
Jason M. Bills64796042018-10-03 16:51:55 -0700136 *dataLen = 0;
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800137 return IPMI_CC_REQ_DATA_LEN_INVALID;
138 }
139
Jason M. Bills64796042018-10-03 16:51:55 -0700140 *dataLen = 0;
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800141
142 snprintf(
143 buf, safeBufferLength,
144 "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
145 Data->timeLow4, Data->timeLow3, Data->timeLow2, Data->timeLow1,
146 Data->timeMid2, Data->timeMid1, Data->timeHigh2, Data->timeHigh1,
147 Data->clock2, Data->clock1, Data->node6, Data->node5, Data->node4,
148 Data->node3, Data->node2, Data->node1);
149 // UUID is in RFC4122 format. Ex: 61a39523-78f2-11e5-9862-e6402cfc3223
150 std::string guid = buf;
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800151
152 std::string objpath = "/xyz/openbmc_project/control/host0/systemGUID";
153 std::string intf = "xyz.openbmc_project.Common.UUID";
Jason M. Bills64796042018-10-03 16:51:55 -0700154 std::string service = getService(dbus, intf, objpath);
155 setDbusProperty(dbus, service, objpath, intf, "UUID", guid);
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800156 return IPMI_CC_OK;
157}
158
159ipmi_ret_t ipmiOEMSetBIOSID(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
160 ipmi_request_t request, ipmi_response_t response,
161 ipmi_data_len_t dataLen, ipmi_context_t context)
162{
163 DeviceInfo* data = reinterpret_cast<DeviceInfo*>(request);
164
Jason M. Bills64796042018-10-03 16:51:55 -0700165 if ((*dataLen < 2) || (*dataLen != (1 + data->biosIDLength)))
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800166 {
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800167 *dataLen = 0;
168 return IPMI_CC_REQ_DATA_LEN_INVALID;
169 }
Jason M. Bills64796042018-10-03 16:51:55 -0700170 std::string idString((char*)data->biosId, data->biosIDLength);
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800171
Jason M. Bills64796042018-10-03 16:51:55 -0700172 std::string service = getService(dbus, biosIntf, biosObjPath);
173 setDbusProperty(dbus, service, biosObjPath, biosIntf, biosProp, idString);
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800174 uint8_t* bytesWritten = static_cast<uint8_t*>(response);
175 *bytesWritten =
Jason M. Bills64796042018-10-03 16:51:55 -0700176 data->biosIDLength; // how many bytes are written into storage
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800177 *dataLen = 1;
178 return IPMI_CC_OK;
179}
180
181ipmi_ret_t ipmiOEMGetDeviceInfo(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
182 ipmi_request_t request,
183 ipmi_response_t response,
184 ipmi_data_len_t dataLen, ipmi_context_t context)
185{
186 GetOemDeviceInfoReq* req = reinterpret_cast<GetOemDeviceInfoReq*>(request);
187 GetOemDeviceInfoRes* res = reinterpret_cast<GetOemDeviceInfoRes*>(response);
188
189 if (*dataLen == 0)
190 {
Jason M. Bills64796042018-10-03 16:51:55 -0700191 *dataLen = 0;
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800192 return IPMI_CC_REQ_DATA_LEN_INVALID;
193 }
194
195 size_t reqDataLen = *dataLen;
196 *dataLen = 0;
Jason M. Bills64796042018-10-03 16:51:55 -0700197 if (req->entityType > static_cast<uint8_t>(OEMDevEntityType::sdrVer))
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800198 {
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800199 return IPMI_CC_INVALID_FIELD_REQUEST;
200 }
201
202 // handle OEM command items
Jason M. Bills64796042018-10-03 16:51:55 -0700203 switch (OEMDevEntityType(req->entityType))
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800204 {
205 case OEMDevEntityType::biosId:
206 {
207 if (sizeof(GetOemDeviceInfoReq) != reqDataLen)
208 {
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800209 return IPMI_CC_REQ_DATA_LEN_INVALID;
210 }
211
Jason M. Bills64796042018-10-03 16:51:55 -0700212 std::string service = getService(dbus, biosIntf, biosObjPath);
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800213 try
214 {
Jason M. Bills64796042018-10-03 16:51:55 -0700215 Value variant = getDbusProperty(dbus, service, biosObjPath,
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800216 biosIntf, biosProp);
Jason M. Bills64796042018-10-03 16:51:55 -0700217 std::string& idString =
218 sdbusplus::message::variant_ns::get<std::string>(variant);
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800219 if (req->offset >= idString.size())
220 {
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800221 return IPMI_CC_PARM_OUT_OF_RANGE;
222 }
Jason M. Bills64796042018-10-03 16:51:55 -0700223 size_t length = 0;
224 if (req->countToRead > (idString.size() - req->offset))
225 {
226 length = idString.size() - req->offset;
227 }
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800228 else
229 {
Jason M. Bills64796042018-10-03 16:51:55 -0700230 length = req->countToRead;
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800231 }
Jason M. Bills64796042018-10-03 16:51:55 -0700232 std::copy(idString.begin() + req->offset, idString.end(),
233 res->data);
234 res->resDatalen = length;
235 *dataLen = res->resDatalen + 1;
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800236 }
Jason M. Bills64796042018-10-03 16:51:55 -0700237 catch (sdbusplus::message::variant_ns::bad_variant_access& e)
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800238 {
Jason M. Bills64796042018-10-03 16:51:55 -0700239 phosphor::logging::log<phosphor::logging::level::ERR>(e.what());
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800240 return IPMI_CC_UNSPECIFIED_ERROR;
241 }
242 }
243 break;
244
245 case OEMDevEntityType::devVer:
246 case OEMDevEntityType::sdrVer:
247 // TODO:
248 return IPMI_CC_ILLEGAL_COMMAND;
249 default:
250 return IPMI_CC_INVALID_FIELD_REQUEST;
251 }
252 return IPMI_CC_OK;
253}
254
255ipmi_ret_t ipmiOEMGetAICFRU(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
256 ipmi_request_t request, ipmi_response_t response,
257 ipmi_data_len_t dataLen, ipmi_context_t context)
258{
259 if (*dataLen != 0)
260 {
Jason M. Bills64796042018-10-03 16:51:55 -0700261 *dataLen = 0;
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800262 return IPMI_CC_REQ_DATA_LEN_INVALID;
263 }
264
265 *dataLen = 1;
266 uint8_t* res = reinterpret_cast<uint8_t*>(response);
267 // temporary fix. We don't support AIC FRU now. Just tell BIOS that no
268 // AIC is available so that BIOS will not timeout repeatly which leads to
269 // slow booting.
270 *res = 0; // Byte1=Count of SlotPosition/FruID records.
271 return IPMI_CC_OK;
272}
273
Jason M. Bills64796042018-10-03 16:51:55 -0700274ipmi_ret_t ipmiOEMGetPowerRestoreDelay(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
275 ipmi_request_t request,
276 ipmi_response_t response,
277 ipmi_data_len_t dataLen,
278 ipmi_context_t context)
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800279{
Jason M. Bills64796042018-10-03 16:51:55 -0700280 GetPowerRestoreDelayRes* resp =
281 reinterpret_cast<GetPowerRestoreDelayRes*>(response);
282
283 if (*dataLen != 0)
284 {
285 *dataLen = 0;
286 return IPMI_CC_REQ_DATA_LEN_INVALID;
287 }
288
289 std::string service =
290 getService(dbus, powerRestoreDelayIntf, powerRestoreDelayObjPath);
291 Value variant =
292 getDbusProperty(dbus, service, powerRestoreDelayObjPath,
293 powerRestoreDelayIntf, powerRestoreDelayProp);
294
295 uint16_t delay = sdbusplus::message::variant_ns::get<uint16_t>(variant);
296 resp->byteLSB = delay;
297 resp->byteMSB = delay >> 8;
298
299 *dataLen = sizeof(GetPowerRestoreDelayRes);
300
301 return IPMI_CC_OK;
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800302}
303
Jason M. Bills64796042018-10-03 16:51:55 -0700304ipmi_ret_t ipmiOEMSetPowerRestoreDelay(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
305 ipmi_request_t request,
306 ipmi_response_t response,
307 ipmi_data_len_t dataLen,
308 ipmi_context_t context)
309{
310 SetPowerRestoreDelayReq* data =
311 reinterpret_cast<SetPowerRestoreDelayReq*>(request);
312 uint16_t delay = 0;
313
314 if (*dataLen != sizeof(SetPowerRestoreDelayReq))
315 {
316 *dataLen = 0;
317 return IPMI_CC_REQ_DATA_LEN_INVALID;
318 }
319 delay = data->byteMSB;
320 delay = (delay << 8) | data->byteLSB;
321 std::string service =
322 getService(dbus, powerRestoreDelayIntf, powerRestoreDelayObjPath);
323 setDbusProperty(dbus, service, powerRestoreDelayObjPath,
324 powerRestoreDelayIntf, powerRestoreDelayProp, delay);
325 *dataLen = 0;
326
327 return IPMI_CC_OK;
328}
329
330ipmi_ret_t ipmiOEMGetProcessorErrConfig(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
331 ipmi_request_t request,
332 ipmi_response_t response,
333 ipmi_data_len_t dataLen,
334 ipmi_context_t context)
335{
336 GetProcessorErrConfigRes* resp =
337 reinterpret_cast<GetProcessorErrConfigRes*>(response);
338
339 if (*dataLen != 0)
340 {
341 *dataLen = 0;
342 return IPMI_CC_REQ_DATA_LEN_INVALID;
343 }
344
345 std::string service =
346 getService(dbus, processorErrConfigIntf, processorErrConfigObjPath);
347 Value variant = getDbusProperty(dbus, service, processorErrConfigObjPath,
348 processorErrConfigIntf, "ResetCfg");
349 resp->resetCfg = sdbusplus::message::variant_ns::get<uint8_t>(variant);
350
351 std::vector<uint8_t> caterrStatus;
352
353 auto method =
354 dbus.new_method_call(service.c_str(), processorErrConfigObjPath,
355 "org.freedesktop.DBus.Properties", "Get");
356
357 method.append(processorErrConfigIntf, "CATERRStatus");
358
359 try
360 {
361 auto reply = dbus.call(method);
362 reply.read(caterrStatus);
363 }
364 catch (sdbusplus::exception_t&)
365 {
366 phosphor::logging::log<phosphor::logging::level::DEBUG>(
367 "ipmiOEMGetProcessorErrConfig: error on dbus",
368 phosphor::logging::entry("PRORPERTY=CATERRStatus"),
369 phosphor::logging::entry("PATH=%s", processorErrConfigObjPath),
370 phosphor::logging::entry("INTERFACE=%s", processorErrConfigIntf));
371 return IPMI_CC_UNSPECIFIED_ERROR;
372 }
373
374 size_t len =
375 maxCPUNum <= caterrStatus.size() ? maxCPUNum : caterrStatus.size();
376 caterrStatus.resize(len);
377 std::copy(caterrStatus.begin(), caterrStatus.end(), resp->caterrStatus);
378 *dataLen = sizeof(GetProcessorErrConfigRes);
379
380 return IPMI_CC_OK;
381}
382
383ipmi_ret_t ipmiOEMSetProcessorErrConfig(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
384 ipmi_request_t request,
385 ipmi_response_t response,
386 ipmi_data_len_t dataLen,
387 ipmi_context_t context)
388{
389 SetProcessorErrConfigReq* req =
390 reinterpret_cast<SetProcessorErrConfigReq*>(request);
391
392 if (*dataLen != sizeof(SetProcessorErrConfigReq))
393 {
394 *dataLen = 0;
395 return IPMI_CC_REQ_DATA_LEN_INVALID;
396 }
397 std::string service =
398 getService(dbus, processorErrConfigIntf, processorErrConfigObjPath);
399 setDbusProperty(dbus, service, processorErrConfigObjPath,
400 processorErrConfigIntf, "ResetCfg", req->resetCfg);
401
402 setDbusProperty(dbus, service, processorErrConfigObjPath,
403 processorErrConfigIntf, "ResetErrorOccurrenceCounts",
404 req->resetErrorOccurrenceCounts);
405 *dataLen = 0;
406
407 return IPMI_CC_OK;
408}
409
410static void registerOEMFunctions(void)
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800411{
412 phosphor::logging::log<phosphor::logging::level::INFO>(
413 "Registering OEM commands");
Jason M. Bills64796042018-10-03 16:51:55 -0700414 ipmiPrintAndRegister(netfnIntcOEMGeneral, IPMI_CMD_WILDCARD, NULL,
415 ipmiOEMWildcard,
416 PRIVILEGE_USER); // wildcard default handler
417 ipmiPrintAndRegister(netfunIntelAppOEM, IPMI_CMD_WILDCARD, NULL,
418 ipmiOEMWildcard,
419 PRIVILEGE_USER); // wildcard default handler
420 ipmiPrintAndRegister(
421 netfnIntcOEMGeneral,
422 static_cast<ipmi_cmd_t>(
423 IPMINetfnIntelOEMGeneralCmd::cmdGetChassisIdentifier),
424 NULL, ipmiOEMGetChassisIdentifier,
425 PRIVILEGE_USER); // get chassis identifier
426 ipmiPrintAndRegister(
427 netfnIntcOEMGeneral,
428 static_cast<ipmi_cmd_t>(IPMINetfnIntelOEMGeneralCmd::cmdSetSystemGUID),
429 NULL, ipmiOEMSetSystemGUID,
430 PRIVILEGE_ADMIN); // set system guid
431 ipmiPrintAndRegister(
432 netfnIntcOEMGeneral,
433 static_cast<ipmi_cmd_t>(IPMINetfnIntelOEMGeneralCmd::cmdSetBIOSID),
434 NULL, ipmiOEMSetBIOSID, PRIVILEGE_ADMIN);
435 ipmiPrintAndRegister(netfnIntcOEMGeneral,
436 static_cast<ipmi_cmd_t>(
437 IPMINetfnIntelOEMGeneralCmd::cmdGetOEMDeviceInfo),
438 NULL, ipmiOEMGetDeviceInfo, PRIVILEGE_USER);
439 ipmiPrintAndRegister(
440 netfnIntcOEMGeneral,
441 static_cast<ipmi_cmd_t>(
442 IPMINetfnIntelOEMGeneralCmd::cmdGetAICSlotFRUIDSlotPosRecords),
443 NULL, ipmiOEMGetAICFRU, PRIVILEGE_USER);
444 ipmiPrintAndRegister(
445 netfnIntcOEMGeneral,
446 static_cast<ipmi_cmd_t>(
447 IPMINetfnIntelOEMGeneralCmd::cmdSetPowerRestoreDelay),
448 NULL, ipmiOEMSetPowerRestoreDelay, PRIVILEGE_OPERATOR);
449 ipmiPrintAndRegister(
450 netfnIntcOEMGeneral,
451 static_cast<ipmi_cmd_t>(
452 IPMINetfnIntelOEMGeneralCmd::cmdGetPowerRestoreDelay),
453 NULL, ipmiOEMGetPowerRestoreDelay, PRIVILEGE_USER);
454 ipmiPrintAndRegister(
455 netfnIntcOEMGeneral,
456 static_cast<ipmi_cmd_t>(
457 IPMINetfnIntelOEMGeneralCmd::cmdGetProcessorErrConfig),
458 NULL, ipmiOEMGetProcessorErrConfig, PRIVILEGE_USER);
459 ipmiPrintAndRegister(
460 netfnIntcOEMGeneral,
461 static_cast<ipmi_cmd_t>(
462 IPMINetfnIntelOEMGeneralCmd::cmdSetProcessorErrConfig),
463 NULL, ipmiOEMSetProcessorErrConfig, PRIVILEGE_ADMIN);
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800464 return;
465}
466
467} // namespace ipmi