Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
Yong Li | c3580e9 | 2019-08-15 14:36:47 +0800 | [diff] [blame] | 17 | #include <bitset> |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 18 | #include <bridgingcommands.hpp> |
| 19 | #include <cstring> |
Vernon Mauery | 15419dd | 2019-05-24 09:40:30 -0700 | [diff] [blame] | 20 | #include <ipmid/api.hpp> |
Yong Li | c3580e9 | 2019-08-15 14:36:47 +0800 | [diff] [blame] | 21 | #include <ipmid/utils.hpp> |
Yong Li | edbb408 | 2020-03-06 17:38:25 +0800 | [diff] [blame] | 22 | #include <manufacturingcommands.hpp> |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 23 | #include <phosphor-logging/log.hpp> |
| 24 | #include <sdbusplus/bus.hpp> |
| 25 | #include <sdbusplus/bus/match.hpp> |
| 26 | #include <sdbusplus/message.hpp> |
jayaprakash Mutyala | 5ba4687 | 2019-11-20 00:02:48 +0000 | [diff] [blame] | 27 | #include <storagecommands.hpp> |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 28 | #include <vector> |
| 29 | |
Yong Li | c3580e9 | 2019-08-15 14:36:47 +0800 | [diff] [blame] | 30 | static constexpr const char *wdtService = "xyz.openbmc_project.Watchdog"; |
| 31 | static constexpr const char *wdtInterface = |
| 32 | "xyz.openbmc_project.State.Watchdog"; |
| 33 | static constexpr const char *wdtObjPath = "/xyz/openbmc_project/watchdog/host0"; |
| 34 | static constexpr const char *wdtInterruptFlagProp = |
| 35 | "PreTimeoutInterruptOccurFlag"; |
| 36 | |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 37 | static constexpr const char *ipmbBus = "xyz.openbmc_project.Ipmi.Channel.Ipmb"; |
| 38 | static constexpr const char *ipmbObj = "/xyz/openbmc_project/Ipmi/Channel/Ipmb"; |
| 39 | static constexpr const char *ipmbIntf = "org.openbmc.Ipmb"; |
| 40 | |
| 41 | static Bridging bridging; |
jayaprakash Mutyala | 5ba4687 | 2019-11-20 00:02:48 +0000 | [diff] [blame] | 42 | static bool eventMessageBufferFlag = false; |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 43 | |
jayaprakash Mutyala | 405f54a | 2019-10-18 18:23:27 +0000 | [diff] [blame] | 44 | void Bridging::clearResponseQueue() |
| 45 | { |
| 46 | responseQueue.clear(); |
| 47 | } |
| 48 | |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 49 | /** |
| 50 | * @brief utils for checksum |
| 51 | */ |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 52 | static bool ipmbChecksumValidate(const uint8_t *data, uint8_t length) |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 53 | { |
| 54 | if (data == nullptr) |
| 55 | { |
| 56 | return false; |
| 57 | } |
| 58 | |
| 59 | uint8_t checksum = 0; |
| 60 | |
| 61 | for (uint8_t idx = 0; idx < length; idx++) |
| 62 | { |
| 63 | checksum += data[idx]; |
| 64 | } |
| 65 | |
| 66 | if (0 == checksum) |
| 67 | { |
| 68 | return true; |
| 69 | } |
| 70 | |
| 71 | return false; |
| 72 | } |
| 73 | |
| 74 | static uint8_t ipmbChecksumCompute(uint8_t *data, uint8_t length) |
| 75 | { |
| 76 | if (data == nullptr) |
| 77 | { |
| 78 | return 0; |
| 79 | } |
| 80 | |
| 81 | uint8_t checksum = 0; |
| 82 | |
| 83 | for (uint8_t idx = 0; idx < length; idx++) |
| 84 | { |
| 85 | checksum += data[idx]; |
| 86 | } |
| 87 | |
| 88 | checksum = (~checksum) + 1; |
| 89 | return checksum; |
| 90 | } |
| 91 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 92 | static inline bool |
| 93 | ipmbConnectionHeaderChecksumValidate(const ipmbHeader *ipmbHeader) |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 94 | { |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 95 | return ipmbChecksumValidate(reinterpret_cast<const uint8_t *>(ipmbHeader), |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 96 | ipmbConnectionHeaderLength); |
| 97 | } |
| 98 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 99 | static inline bool ipmbDataChecksumValidate(const ipmbHeader *ipmbHeader, |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 100 | uint8_t length) |
| 101 | { |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 102 | return ipmbChecksumValidate((reinterpret_cast<const uint8_t *>(ipmbHeader) + |
| 103 | ipmbConnectionHeaderLength), |
| 104 | (length - ipmbConnectionHeaderLength)); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 105 | } |
| 106 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 107 | static bool isFrameValid(const ipmbHeader *frame, uint8_t length) |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 108 | { |
| 109 | if ((length < ipmbMinFrameLength) || (length > ipmbMaxFrameLength)) |
| 110 | { |
| 111 | return false; |
| 112 | } |
| 113 | |
| 114 | if (false == ipmbConnectionHeaderChecksumValidate(frame)) |
| 115 | { |
| 116 | return false; |
| 117 | } |
| 118 | |
| 119 | if (false == ipmbDataChecksumValidate(frame, length)) |
| 120 | { |
| 121 | return false; |
| 122 | } |
| 123 | |
| 124 | return true; |
| 125 | } |
| 126 | |
| 127 | IpmbRequest::IpmbRequest(const ipmbHeader *ipmbBuffer, size_t bufferLength) |
| 128 | { |
| 129 | address = ipmbBuffer->Header.Req.address; |
| 130 | netFn = ipmbNetFnGet(ipmbBuffer->Header.Req.rsNetFnLUN); |
| 131 | rsLun = ipmbLunFromNetFnLunGet(ipmbBuffer->Header.Req.rsNetFnLUN); |
| 132 | rqSA = ipmbBuffer->Header.Req.rqSA; |
| 133 | seq = ipmbSeqGet(ipmbBuffer->Header.Req.rqSeqLUN); |
| 134 | rqLun = ipmbLunFromSeqLunGet(ipmbBuffer->Header.Req.rqSeqLUN); |
| 135 | cmd = ipmbBuffer->Header.Req.cmd; |
| 136 | |
| 137 | size_t dataLength = |
| 138 | bufferLength - (ipmbConnectionHeaderLength + |
| 139 | ipmbRequestDataHeaderLength + ipmbChecksumSize); |
| 140 | |
| 141 | if (dataLength > 0) |
| 142 | { |
| 143 | data.insert(data.end(), ipmbBuffer->Header.Req.data, |
| 144 | &ipmbBuffer->Header.Req.data[dataLength]); |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | IpmbResponse::IpmbResponse(uint8_t address, uint8_t netFn, uint8_t rqLun, |
| 149 | uint8_t rsSA, uint8_t seq, uint8_t rsLun, |
| 150 | uint8_t cmd, uint8_t completionCode, |
| 151 | std::vector<uint8_t> &inputData) : |
| 152 | address(address), |
| 153 | netFn(netFn), rqLun(rqLun), rsSA(rsSA), seq(seq), rsLun(rsLun), cmd(cmd), |
| 154 | completionCode(completionCode) |
| 155 | { |
| 156 | data.reserve(ipmbMaxDataSize); |
| 157 | |
| 158 | if (inputData.size() > 0) |
| 159 | { |
| 160 | data = std::move(inputData); |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | void IpmbResponse::ipmbToi2cConstruct(uint8_t *buffer, size_t *bufferLength) |
| 165 | { |
| 166 | ipmbHeader *ipmbBuffer = (ipmbHeader *)buffer; |
| 167 | |
| 168 | ipmbBuffer->Header.Resp.address = address; |
| 169 | ipmbBuffer->Header.Resp.rqNetFnLUN = ipmbNetFnLunSet(netFn, rqLun); |
| 170 | ipmbBuffer->Header.Resp.rsSA = rsSA; |
| 171 | ipmbBuffer->Header.Resp.rsSeqLUN = ipmbSeqLunSet(seq, rsLun); |
| 172 | ipmbBuffer->Header.Resp.cmd = cmd; |
| 173 | ipmbBuffer->Header.Resp.completionCode = completionCode; |
| 174 | |
| 175 | ipmbBuffer->Header.Resp.checksum1 = ipmbChecksumCompute( |
| 176 | buffer, ipmbConnectionHeaderLength - ipmbChecksumSize); |
| 177 | |
| 178 | if (data.size() > 0) |
| 179 | { |
| 180 | std::copy( |
| 181 | data.begin(), data.end(), |
| 182 | &buffer[ipmbConnectionHeaderLength + ipmbResponseDataHeaderLength]); |
| 183 | } |
| 184 | |
| 185 | *bufferLength = data.size() + ipmbResponseDataHeaderLength + |
| 186 | ipmbConnectionHeaderLength + ipmbChecksumSize; |
| 187 | |
| 188 | buffer[*bufferLength - ipmbChecksumSize] = |
| 189 | ipmbChecksumCompute(&buffer[ipmbChecksum2StartOffset], |
| 190 | (ipmbResponseDataHeaderLength + data.size())); |
| 191 | } |
| 192 | |
| 193 | void IpmbRequest::prepareRequest(sdbusplus::message::message &mesg) |
| 194 | { |
| 195 | mesg.append(ipmbMeChannelNum, netFn, rqLun, cmd, data); |
| 196 | } |
| 197 | |
Richard Marian Thomaiyar | e646a25 | 2019-11-20 22:54:03 +0530 | [diff] [blame] | 198 | static constexpr unsigned int makeCmdKey(unsigned int netFn, unsigned int cmd) |
| 199 | { |
| 200 | return (netFn << 8) | cmd; |
| 201 | } |
| 202 | |
| 203 | static constexpr bool isMeCmdAllowed(uint8_t netFn, uint8_t cmd) |
| 204 | { |
| 205 | constexpr uint8_t netFnMeOEM = 0x2E; |
Yong Li | edbb408 | 2020-03-06 17:38:25 +0800 | [diff] [blame] | 206 | constexpr uint8_t netFnMeOEMGeneral = 0x3E; |
Richard Marian Thomaiyar | e646a25 | 2019-11-20 22:54:03 +0530 | [diff] [blame] | 207 | constexpr uint8_t cmdMeOemSendRawPeci = 0x40; |
| 208 | constexpr uint8_t cmdMeOemAggSendRawPeci = 0x41; |
| 209 | constexpr uint8_t cmdMeOemCpuPkgConfWrite = 0x43; |
| 210 | constexpr uint8_t cmdMeOemCpuPciConfWrite = 0x45; |
| 211 | constexpr uint8_t cmdMeOemReadMemSmbus = 0x47; |
| 212 | constexpr uint8_t cmdMeOemWriteMemSmbus = 0x48; |
| 213 | constexpr uint8_t cmdMeOemSlotIpmb = 0x51; |
| 214 | constexpr uint8_t cmdMeOemSlotI2cMasterWriteRead = 0x52; |
| 215 | constexpr uint8_t cmdMeOemSendRawPmbus = 0xD9; |
| 216 | constexpr uint8_t cmdMeOemUnlockMeRegion = 0xE7; |
| 217 | constexpr uint8_t cmdMeOemAggSendRawPmbus = 0xEC; |
| 218 | |
| 219 | switch (makeCmdKey(netFn, cmd)) |
| 220 | { |
| 221 | // Restrict ME Master write command |
| 222 | case makeCmdKey(ipmi::netFnApp, ipmi::app::cmdMasterWriteRead): |
| 223 | // Restrict ME OEM commands |
| 224 | case makeCmdKey(netFnMeOEM, cmdMeOemSendRawPeci): |
| 225 | case makeCmdKey(netFnMeOEM, cmdMeOemAggSendRawPeci): |
| 226 | case makeCmdKey(netFnMeOEM, cmdMeOemCpuPkgConfWrite): |
| 227 | case makeCmdKey(netFnMeOEM, cmdMeOemCpuPciConfWrite): |
| 228 | case makeCmdKey(netFnMeOEM, cmdMeOemReadMemSmbus): |
| 229 | case makeCmdKey(netFnMeOEM, cmdMeOemWriteMemSmbus): |
Yong Li | edbb408 | 2020-03-06 17:38:25 +0800 | [diff] [blame] | 230 | case makeCmdKey(netFnMeOEMGeneral, cmdMeOemSlotIpmb): |
| 231 | case makeCmdKey(netFnMeOEMGeneral, cmdMeOemSlotI2cMasterWriteRead): |
Richard Marian Thomaiyar | e646a25 | 2019-11-20 22:54:03 +0530 | [diff] [blame] | 232 | case makeCmdKey(netFnMeOEM, cmdMeOemSendRawPmbus): |
| 233 | case makeCmdKey(netFnMeOEM, cmdMeOemUnlockMeRegion): |
| 234 | case makeCmdKey(netFnMeOEM, cmdMeOemAggSendRawPmbus): |
| 235 | return false; |
| 236 | default: |
| 237 | return true; |
| 238 | } |
| 239 | } |
| 240 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 241 | ipmi::Cc Bridging::handleIpmbChannel(const uint8_t tracking, |
| 242 | const std::vector<uint8_t> &msgData, |
| 243 | std::vector<uint8_t> &rspData) |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 244 | { |
Yong Li | edbb408 | 2020-03-06 17:38:25 +0800 | [diff] [blame] | 245 | ipmi::Manufacturing mtm; |
| 246 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 247 | size_t msgLen = msgData.size(); |
| 248 | if ((msgLen < ipmbMinFrameLength) || (msgLen > ipmbMaxFrameLength)) |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 249 | { |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 250 | phosphor::logging::log<phosphor::logging::level::INFO>( |
| 251 | "handleIpmbChannel, IPMB data length is invalid"); |
| 252 | return ipmi::ccReqDataLenInvalid; |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 253 | } |
| 254 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 255 | auto sendMsgReqData = reinterpret_cast<const ipmbHeader *>(msgData.data()); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 256 | // TODO: check privilege lvl. Bridging to ME requires Administrator lvl |
| 257 | |
| 258 | // allow bridging to ME only |
| 259 | if (sendMsgReqData->Header.Req.address != ipmbMeSlaveAddress) |
| 260 | { |
| 261 | phosphor::logging::log<phosphor::logging::level::INFO>( |
| 262 | "handleIpmbChannel, IPMB address invalid"); |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 263 | return ipmi::ccParmOutOfRange; |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 264 | } |
| 265 | |
Richard Marian Thomaiyar | e646a25 | 2019-11-20 22:54:03 +0530 | [diff] [blame] | 266 | constexpr uint8_t shiftLUN = 2; |
Yong Li | edbb408 | 2020-03-06 17:38:25 +0800 | [diff] [blame] | 267 | if (mtm.getMfgMode() == ipmi::SpecialMode::none) |
Richard Marian Thomaiyar | e646a25 | 2019-11-20 22:54:03 +0530 | [diff] [blame] | 268 | { |
Yong Li | edbb408 | 2020-03-06 17:38:25 +0800 | [diff] [blame] | 269 | if (!isMeCmdAllowed((sendMsgReqData->Header.Req.rsNetFnLUN >> shiftLUN), |
| 270 | sendMsgReqData->Header.Req.cmd)) |
| 271 | { |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 272 | constexpr ipmi::Cc ccCmdNotSupportedInPresentState = 0xD5; |
| 273 | return ccCmdNotSupportedInPresentState; |
Yong Li | edbb408 | 2020-03-06 17:38:25 +0800 | [diff] [blame] | 274 | } |
Richard Marian Thomaiyar | e646a25 | 2019-11-20 22:54:03 +0530 | [diff] [blame] | 275 | } |
| 276 | |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 277 | // check allowed modes |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 278 | if (tracking != modeNoTracking && tracking != modeTrackRequest) |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 279 | { |
| 280 | phosphor::logging::log<phosphor::logging::level::INFO>( |
| 281 | "handleIpmbChannel, mode not supported"); |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 282 | return ipmi::ccParmOutOfRange; |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 283 | } |
| 284 | |
| 285 | // check if request contains valid IPMB frame |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 286 | if (!isFrameValid(sendMsgReqData, msgLen)) |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 287 | { |
| 288 | phosphor::logging::log<phosphor::logging::level::INFO>( |
| 289 | "handleIpmbChannel, IPMB frame invalid"); |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 290 | return ipmi::ccParmOutOfRange; |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 291 | } |
| 292 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 293 | auto ipmbRequest = IpmbRequest(sendMsgReqData, msgLen); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 294 | |
| 295 | std::tuple<int, uint8_t, uint8_t, uint8_t, uint8_t, std::vector<uint8_t>> |
| 296 | ipmbResponse; |
| 297 | |
| 298 | // send request to IPMB |
| 299 | try |
| 300 | { |
Vernon Mauery | 15419dd | 2019-05-24 09:40:30 -0700 | [diff] [blame] | 301 | std::shared_ptr<sdbusplus::asio::connection> dbus = getSdBus(); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 302 | auto mesg = |
Vernon Mauery | 15419dd | 2019-05-24 09:40:30 -0700 | [diff] [blame] | 303 | dbus->new_method_call(ipmbBus, ipmbObj, ipmbIntf, "sendRequest"); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 304 | ipmbRequest.prepareRequest(mesg); |
Vernon Mauery | 15419dd | 2019-05-24 09:40:30 -0700 | [diff] [blame] | 305 | auto ret = dbus->call(mesg); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 306 | ret.read(ipmbResponse); |
| 307 | } |
| 308 | catch (sdbusplus::exception::SdBusError &e) |
| 309 | { |
| 310 | phosphor::logging::log<phosphor::logging::level::ERR>( |
| 311 | "handleIpmbChannel, dbus call exception"); |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 312 | return ipmi::ccUnspecifiedError; |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 313 | } |
| 314 | |
| 315 | std::vector<uint8_t> dataReceived(0); |
| 316 | int status = -1; |
| 317 | uint8_t netFn = 0, lun = 0, cmd = 0, cc = 0; |
| 318 | |
| 319 | std::tie(status, netFn, lun, cmd, cc, dataReceived) = ipmbResponse; |
| 320 | |
| 321 | auto respReceived = |
| 322 | IpmbResponse(ipmbRequest.rqSA, netFn, lun, ipmbRequest.address, |
| 323 | ipmbRequest.seq, lun, cmd, cc, dataReceived); |
| 324 | |
| 325 | // check IPMB layer status |
| 326 | if (status) |
| 327 | { |
| 328 | phosphor::logging::log<phosphor::logging::level::WARNING>( |
| 329 | "handleIpmbChannel, ipmb returned non zero status"); |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 330 | return ipmi::ccResponseError; |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 331 | } |
| 332 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 333 | switch (tracking) |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 334 | { |
| 335 | case modeNoTracking: |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 336 | { |
| 337 | if (getResponseQueueSize() == responseQueueMaxSize) |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 338 | { |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 339 | return ipmi::ccBusy; |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 340 | } |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 341 | insertMessageInQueue(respReceived); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 342 | break; |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 343 | } |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 344 | case modeTrackRequest: |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 345 | { |
| 346 | size_t dataLength = 0; |
| 347 | respReceived.ipmbToi2cConstruct(rspData.data(), &dataLength); |
| 348 | // resizing the rspData to its correct length |
| 349 | rspData.resize(dataLength); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 350 | break; |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 351 | } |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 352 | default: |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 353 | { |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 354 | phosphor::logging::log<phosphor::logging::level::INFO>( |
| 355 | "handleIpmbChannel, mode not supported"); |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 356 | return ipmi::ccParmOutOfRange; |
| 357 | } |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 358 | } |
| 359 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 360 | return ipmi::ccSuccess; |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 361 | } |
| 362 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 363 | void Bridging::insertMessageInQueue(IpmbResponse msg) |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 364 | { |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 365 | responseQueue.insert(responseQueue.end(), std::move(msg)); |
| 366 | } |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 367 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 368 | void Bridging::eraseMessageFromQueue() |
| 369 | { |
| 370 | responseQueue.erase(responseQueue.begin()); |
| 371 | } |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 372 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 373 | IpmbResponse Bridging::getMessageFromQueue() |
| 374 | { |
| 375 | return responseQueue.front(); |
| 376 | } |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 377 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 378 | /** |
| 379 | * @brief This command is used for bridging ipmi message between channels. |
| 380 | * @param channelNumber - channel number to send message to |
| 381 | * @param authenticationEnabled - authentication. |
| 382 | * @param encryptionEnabled - encryption |
| 383 | * @param Tracking - track request |
| 384 | * @param msg - message data |
| 385 | * |
| 386 | * @return IPMI completion code plus response data on success. |
| 387 | * - rspData - response data |
| 388 | **/ |
| 389 | ipmi::RspType<std::vector<uint8_t> // responseData |
| 390 | > |
| 391 | ipmiAppSendMessage(const uint4_t channelNumber, |
| 392 | const bool authenticationEnabled, |
| 393 | const bool encryptionEnabled, const uint2_t tracking, |
| 394 | ipmi::message::Payload &msg) |
| 395 | { |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 396 | // check message fields: |
| 397 | // encryption not supported |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 398 | if (encryptionEnabled) |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 399 | { |
| 400 | phosphor::logging::log<phosphor::logging::level::INFO>( |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 401 | "ipmiAppSendMessage, encryption not supported"); |
| 402 | return ipmi::responseParmOutOfRange(); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 403 | } |
| 404 | |
| 405 | // authentication not supported |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 406 | if (authenticationEnabled) |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 407 | { |
| 408 | phosphor::logging::log<phosphor::logging::level::INFO>( |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 409 | "ipmiAppSendMessage, authentication not supported"); |
| 410 | return ipmi::responseParmOutOfRange(); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 411 | } |
| 412 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 413 | ipmi::Cc returnVal; |
| 414 | std::vector<uint8_t> rspData(ipmbMaxFrameLength); |
| 415 | size_t dataLength = 0; |
| 416 | std::vector<uint8_t> unpackMsg; |
| 417 | |
| 418 | auto channelNo = static_cast<const uint8_t>(channelNumber); |
| 419 | // Get the channel number |
| 420 | switch (channelNo) |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 421 | { |
| 422 | // we only handle ipmb for now |
| 423 | case targetChannelIpmb: |
| 424 | case targetChannelOtherLan: |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 425 | if (msg.unpack(unpackMsg) || !msg.fullyUnpacked()) |
| 426 | { |
| 427 | return ipmi::responseReqDataLenInvalid(); |
| 428 | } |
| 429 | |
| 430 | returnVal = bridging.handleIpmbChannel( |
| 431 | static_cast<const uint8_t>(tracking), unpackMsg, rspData); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 432 | break; |
| 433 | // fall through to default |
| 434 | case targetChannelIcmb10: |
| 435 | case targetChannelIcmb09: |
| 436 | case targetChannelLan: |
| 437 | case targetChannelSerialModem: |
| 438 | case targetChannelPciSmbus: |
| 439 | case targetChannelSmbus10: |
| 440 | case targetChannelSmbus20: |
| 441 | case targetChannelSystemInterface: |
| 442 | default: |
| 443 | phosphor::logging::log<phosphor::logging::level::INFO>( |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 444 | "ipmiAppSendMessage, TargetChannel invalid"); |
| 445 | return ipmi::responseParmOutOfRange(); |
| 446 | } |
| 447 | if (returnVal != ipmi::ccSuccess) |
| 448 | { |
| 449 | return ipmi::response(returnVal); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 450 | } |
| 451 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 452 | return ipmi::responseSuccess(rspData); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 453 | } |
| 454 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 455 | /** |
| 456 | * @brief This command is used to Get data from the receive message queue. |
| 457 | * This command should be executed executed via system interface only. |
| 458 | * |
| 459 | * @return IPMI completion code plus response data on success. |
| 460 | * - channelNumber |
| 461 | * - messageData |
| 462 | **/ |
| 463 | |
| 464 | ipmi::RspType<uint8_t, // channelNumber |
| 465 | std::vector<uint8_t> // messageData |
| 466 | > |
| 467 | ipmiAppGetMessage() |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 468 | { |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 469 | uint8_t channelData = 0; |
| 470 | std::vector<uint8_t> res(ipmbMaxFrameLength); |
| 471 | size_t dataLength = 0; |
| 472 | |
| 473 | if (!bridging.getResponseQueueSize()) |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 474 | { |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 475 | constexpr ipmi::Cc ipmiGetMessageCmdDataNotAvailable = 0x80; |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 476 | phosphor::logging::log<phosphor::logging::level::INFO>( |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 477 | "ipmiAppGetMessage, no data available"); |
| 478 | return ipmi::response(ipmiGetMessageCmdDataNotAvailable); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 479 | } |
| 480 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 481 | // channel number set. |
| 482 | channelData |= static_cast<uint8_t>(targetChannelSystemInterface) & 0x0F; |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 483 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 484 | // Priviledge level set. |
| 485 | channelData |= SYSTEM_INTERFACE & 0xF0; |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 486 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 487 | // Get the first message from queue |
| 488 | auto respQueueItem = bridging.getMessageFromQueue(); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 489 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 490 | // construct response data. |
| 491 | respQueueItem.ipmbToi2cConstruct(res.data(), &dataLength); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 492 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 493 | // Remove the message from queue |
| 494 | bridging.eraseMessageFromQueue(); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 495 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 496 | // resizing the rspData to its correct length |
| 497 | res.resize(dataLength); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 498 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 499 | return ipmi::responseSuccess(channelData, res); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 500 | } |
| 501 | |
Yong Li | c3580e9 | 2019-08-15 14:36:47 +0800 | [diff] [blame] | 502 | std::size_t Bridging::getResponseQueueSize() |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 503 | { |
Yong Li | c3580e9 | 2019-08-15 14:36:47 +0800 | [diff] [blame] | 504 | return responseQueue.size(); |
| 505 | } |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 506 | |
Yong Li | c3580e9 | 2019-08-15 14:36:47 +0800 | [diff] [blame] | 507 | /** |
| 508 | @brief This command is used to retrive present message available states. |
| 509 | |
| 510 | @return IPMI completion code plus Flags as response data on success. |
| 511 | **/ |
| 512 | ipmi::RspType<std::bitset<8>> ipmiAppGetMessageFlags() |
| 513 | { |
| 514 | std::bitset<8> getMsgFlagsRes; |
| 515 | |
jayaprakash Mutyala | 5ba4687 | 2019-11-20 00:02:48 +0000 | [diff] [blame] | 516 | // set event message buffer bit |
| 517 | if (!eventMessageBufferFlag) |
| 518 | { |
| 519 | getMsgFlagsRes.set(getMsgFlagEventMessageBit); |
| 520 | } |
| 521 | else |
| 522 | { |
| 523 | getMsgFlagsRes.reset(getMsgFlagEventMessageBit); |
| 524 | } |
Yong Li | c3580e9 | 2019-08-15 14:36:47 +0800 | [diff] [blame] | 525 | |
| 526 | // set message fields |
| 527 | if (bridging.getResponseQueueSize() > 0) |
| 528 | { |
| 529 | getMsgFlagsRes.set(getMsgFlagReceiveMessageBit); |
| 530 | } |
| 531 | else |
| 532 | { |
| 533 | getMsgFlagsRes.reset(getMsgFlagReceiveMessageBit); |
| 534 | } |
| 535 | |
| 536 | try |
| 537 | { |
| 538 | std::shared_ptr<sdbusplus::asio::connection> dbus = getSdBus(); |
| 539 | ipmi::Value variant = ipmi::getDbusProperty( |
| 540 | *dbus, wdtService, wdtObjPath, wdtInterface, wdtInterruptFlagProp); |
| 541 | if (std::get<bool>(variant)) |
| 542 | { |
| 543 | getMsgFlagsRes.set(getMsgFlagWatchdogPreTimeOutBit); |
| 544 | } |
| 545 | } |
| 546 | catch (sdbusplus::exception::SdBusError &e) |
| 547 | { |
| 548 | phosphor::logging::log<phosphor::logging::level::ERR>( |
| 549 | "ipmiAppGetMessageFlags, dbus call exception"); |
| 550 | return ipmi::responseUnspecifiedError(); |
| 551 | } |
| 552 | |
| 553 | return ipmi::responseSuccess(getMsgFlagsRes); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 554 | } |
| 555 | |
jayaprakash Mutyala | 405f54a | 2019-10-18 18:23:27 +0000 | [diff] [blame] | 556 | /** @brief This command is used to flush unread data from the receive |
| 557 | * message queue |
| 558 | * @param receiveMessage - clear receive message queue |
| 559 | * @param eventMsgBufFull - clear event message buffer full |
| 560 | * @param reserved2 - reserved bit |
| 561 | * @param watchdogTimeout - clear watchdog pre-timeout interrupt flag |
| 562 | * @param reserved1 - reserved bit |
| 563 | * @param oem0 - clear OEM 0 data |
| 564 | * @param oem1 - clear OEM 1 data |
| 565 | * @param oem2 - clear OEM 2 data |
| 566 | |
| 567 | * @return IPMI completion code on success |
| 568 | */ |
| 569 | ipmi::RspType<> ipmiAppClearMessageFlags(bool receiveMessage, |
| 570 | bool eventMsgBufFull, bool reserved2, |
| 571 | bool watchdogTimeout, bool reserved1, |
| 572 | bool oem0, bool oem1, bool oem2) |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 573 | { |
jayaprakash Mutyala | 405f54a | 2019-10-18 18:23:27 +0000 | [diff] [blame] | 574 | if (reserved1 || reserved2) |
| 575 | { |
| 576 | return ipmi::responseInvalidFieldRequest(); |
| 577 | } |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 578 | |
jayaprakash Mutyala | 405f54a | 2019-10-18 18:23:27 +0000 | [diff] [blame] | 579 | if (receiveMessage) |
| 580 | { |
| 581 | bridging.clearResponseQueue(); |
| 582 | } |
jayaprakash Mutyala | 5ba4687 | 2019-11-20 00:02:48 +0000 | [diff] [blame] | 583 | |
| 584 | if (eventMessageBufferFlag != true && eventMsgBufFull == true) |
| 585 | { |
| 586 | eventMessageBufferFlag = true; |
| 587 | } |
| 588 | |
jayaprakash Mutyala | 43539cb | 2019-11-25 12:37:27 +0000 | [diff] [blame] | 589 | try |
| 590 | { |
| 591 | std::shared_ptr<sdbusplus::asio::connection> dbus = getSdBus(); |
| 592 | ipmi::setDbusProperty(*dbus, wdtService, wdtObjPath, wdtInterface, |
| 593 | wdtInterruptFlagProp, false); |
| 594 | } |
| 595 | catch (const sdbusplus::exception::SdBusError &e) |
| 596 | { |
| 597 | phosphor::logging::log<phosphor::logging::level::ERR>( |
| 598 | "ipmiAppClearMessageFlags: can't Clear/Set " |
| 599 | "PreTimeoutInterruptOccurFlag"); |
| 600 | return ipmi::responseUnspecifiedError(); |
| 601 | } |
| 602 | |
jayaprakash Mutyala | 405f54a | 2019-10-18 18:23:27 +0000 | [diff] [blame] | 603 | return ipmi::responseSuccess(); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 604 | } |
| 605 | |
jayaprakash Mutyala | 5ba4687 | 2019-11-20 00:02:48 +0000 | [diff] [blame] | 606 | using systemEventType = std::tuple< |
| 607 | uint16_t, // Generator ID |
| 608 | uint32_t, // Timestamp |
| 609 | uint8_t, // Sensor Type |
| 610 | uint8_t, // EvM Rev |
| 611 | uint8_t, // Sensor Number |
| 612 | uint7_t, // Event Type |
| 613 | bool, // Event Direction |
| 614 | std::array<uint8_t, intel_oem::ipmi::sel::systemEventSize>>; // Event Data |
| 615 | using oemTsEventType = std::tuple< |
| 616 | uint32_t, // Timestamp |
| 617 | std::array<uint8_t, intel_oem::ipmi::sel::oemTsEventSize>>; // Event Data |
| 618 | using oemEventType = |
| 619 | std::array<uint8_t, intel_oem::ipmi::sel::oemEventSize>; // Event Data |
| 620 | |
| 621 | /** @brief implements of Read event message buffer command |
| 622 | * |
| 623 | * @returns IPMI completion code plus response data |
| 624 | * - recordID - SEL Record ID |
| 625 | * - recordType - Record Type |
| 626 | * - generatorID - Generator ID |
| 627 | * - timeStamp - Timestamp |
| 628 | * - sensorType - Sensor Type |
| 629 | * - eventMsgFormatRev - Event Message format version |
| 630 | * - sensorNumber - Sensor Number |
| 631 | * - eventType - Event Type |
| 632 | * - eventDir - Event Direction |
| 633 | * - eventData - Event Data field |
| 634 | */ |
| 635 | ipmi::RspType<uint16_t, // Record ID |
| 636 | uint8_t, // Record Type |
| 637 | std::variant<systemEventType, oemTsEventType, |
| 638 | oemEventType>> // Record Content |
| 639 | ipmiAppReadEventMessageBuffer() |
| 640 | { |
| 641 | uint16_t recordId = |
| 642 | static_cast<uint16_t>(0x5555); // recordId: 0x55 << 8 | 0x55 |
| 643 | uint16_t generatorId = |
| 644 | static_cast<uint16_t>(0xA741); // generatorId: 0xA7 << 8 | 0x41 |
| 645 | constexpr uint8_t recordType = 0xC0; |
| 646 | constexpr uint8_t eventMsgFormatRev = 0x3A; |
| 647 | constexpr uint8_t sensorNumber = 0xFF; |
| 648 | |
| 649 | // TODO need to be implemented. |
| 650 | std::array<uint8_t, intel_oem::ipmi::sel::systemEventSize> eventData{}; |
| 651 | // All '0xFF' since unused. |
| 652 | eventData.fill(0xFF); |
| 653 | |
| 654 | // Set the event message buffer flag |
| 655 | eventMessageBufferFlag = true; |
| 656 | |
| 657 | return ipmi::responseSuccess( |
| 658 | recordId, recordType, |
| 659 | systemEventType{generatorId, 0, 0, eventMsgFormatRev, sensorNumber, |
| 660 | static_cast<uint7_t>(0), false, eventData}); |
| 661 | } |
| 662 | |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 663 | static void register_bridging_functions() __attribute__((constructor)); |
| 664 | static void register_bridging_functions() |
| 665 | { |
jayaprakash Mutyala | 405f54a | 2019-10-18 18:23:27 +0000 | [diff] [blame] | 666 | ipmi::registerHandler(ipmi::prioOemBase, ipmi::netFnApp, |
| 667 | ipmi::app::cmdClearMessageFlags, |
| 668 | ipmi::Privilege::User, ipmiAppClearMessageFlags); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 669 | |
Yong Li | c3580e9 | 2019-08-15 14:36:47 +0800 | [diff] [blame] | 670 | ipmi::registerHandler(ipmi::prioOemBase, ipmi::netFnApp, |
| 671 | ipmi::app::cmdGetMessageFlags, ipmi::Privilege::User, |
| 672 | ipmiAppGetMessageFlags); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 673 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 674 | ipmi::registerHandler(ipmi::prioOemBase, ipmi::netFnApp, |
| 675 | ipmi::app::cmdGetMessage, ipmi::Privilege::User, |
| 676 | ipmiAppGetMessage); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 677 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame^] | 678 | ipmi::registerHandler(ipmi::prioOemBase, ipmi::netFnApp, |
| 679 | ipmi::app::cmdSendMessage, ipmi::Privilege::User, |
| 680 | ipmiAppSendMessage); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 681 | |
jayaprakash Mutyala | 5ba4687 | 2019-11-20 00:02:48 +0000 | [diff] [blame] | 682 | ipmi::registerHandler(ipmi::prioOemBase, ipmi::netFnApp, |
| 683 | ipmi::app::cmdReadEventMessageBuffer, |
| 684 | ipmi::Privilege::User, ipmiAppReadEventMessageBuffer); |
| 685 | |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 686 | return; |
| 687 | } |