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 | |
srikanta mondal | 36b3a87 | 2020-03-17 22:20:47 +0000 | [diff] [blame^] | 241 | ipmi::Cc Bridging::handleIpmbChannel(ipmi::Context::ptr ctx, |
| 242 | const uint8_t tracking, |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 243 | const std::vector<uint8_t> &msgData, |
| 244 | std::vector<uint8_t> &rspData) |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 245 | { |
Yong Li | edbb408 | 2020-03-06 17:38:25 +0800 | [diff] [blame] | 246 | ipmi::Manufacturing mtm; |
| 247 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 248 | size_t msgLen = msgData.size(); |
| 249 | if ((msgLen < ipmbMinFrameLength) || (msgLen > ipmbMaxFrameLength)) |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 250 | { |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 251 | phosphor::logging::log<phosphor::logging::level::INFO>( |
| 252 | "handleIpmbChannel, IPMB data length is invalid"); |
| 253 | return ipmi::ccReqDataLenInvalid; |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 254 | } |
| 255 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 256 | auto sendMsgReqData = reinterpret_cast<const ipmbHeader *>(msgData.data()); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 257 | // TODO: check privilege lvl. Bridging to ME requires Administrator lvl |
| 258 | |
| 259 | // allow bridging to ME only |
| 260 | if (sendMsgReqData->Header.Req.address != ipmbMeSlaveAddress) |
| 261 | { |
| 262 | phosphor::logging::log<phosphor::logging::level::INFO>( |
| 263 | "handleIpmbChannel, IPMB address invalid"); |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 264 | return ipmi::ccParmOutOfRange; |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 265 | } |
| 266 | |
Richard Marian Thomaiyar | e646a25 | 2019-11-20 22:54:03 +0530 | [diff] [blame] | 267 | constexpr uint8_t shiftLUN = 2; |
Yong Li | edbb408 | 2020-03-06 17:38:25 +0800 | [diff] [blame] | 268 | if (mtm.getMfgMode() == ipmi::SpecialMode::none) |
Richard Marian Thomaiyar | e646a25 | 2019-11-20 22:54:03 +0530 | [diff] [blame] | 269 | { |
Yong Li | edbb408 | 2020-03-06 17:38:25 +0800 | [diff] [blame] | 270 | if (!isMeCmdAllowed((sendMsgReqData->Header.Req.rsNetFnLUN >> shiftLUN), |
| 271 | sendMsgReqData->Header.Req.cmd)) |
| 272 | { |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 273 | constexpr ipmi::Cc ccCmdNotSupportedInPresentState = 0xD5; |
| 274 | return ccCmdNotSupportedInPresentState; |
Yong Li | edbb408 | 2020-03-06 17:38:25 +0800 | [diff] [blame] | 275 | } |
Richard Marian Thomaiyar | e646a25 | 2019-11-20 22:54:03 +0530 | [diff] [blame] | 276 | } |
| 277 | |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 278 | // check allowed modes |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 279 | if (tracking != modeNoTracking && tracking != modeTrackRequest) |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 280 | { |
| 281 | phosphor::logging::log<phosphor::logging::level::INFO>( |
| 282 | "handleIpmbChannel, mode not supported"); |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 283 | return ipmi::ccParmOutOfRange; |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 284 | } |
| 285 | |
| 286 | // check if request contains valid IPMB frame |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 287 | if (!isFrameValid(sendMsgReqData, msgLen)) |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 288 | { |
| 289 | phosphor::logging::log<phosphor::logging::level::INFO>( |
| 290 | "handleIpmbChannel, IPMB frame invalid"); |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 291 | return ipmi::ccParmOutOfRange; |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 292 | } |
| 293 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 294 | auto ipmbRequest = IpmbRequest(sendMsgReqData, msgLen); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 295 | |
srikanta mondal | 36b3a87 | 2020-03-17 22:20:47 +0000 | [diff] [blame^] | 296 | typedef std::tuple<int, uint8_t, uint8_t, uint8_t, uint8_t, |
| 297 | std::vector<uint8_t>> |
| 298 | IPMBResponse; |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 299 | |
| 300 | // send request to IPMB |
srikanta mondal | 36b3a87 | 2020-03-17 22:20:47 +0000 | [diff] [blame^] | 301 | boost::system::error_code ec; |
| 302 | auto ipmbResponse = ctx->bus->yield_method_call<IPMBResponse>( |
| 303 | ctx->yield, ec, ipmbBus, ipmbObj, ipmbIntf, "sendRequest", |
| 304 | ipmbMeChannelNum, ipmbRequest.netFn, ipmbRequest.rqLun, ipmbRequest.cmd, |
| 305 | ipmbRequest.data); |
| 306 | if (ec) |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 307 | { |
| 308 | phosphor::logging::log<phosphor::logging::level::ERR>( |
| 309 | "handleIpmbChannel, dbus call exception"); |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 310 | return ipmi::ccUnspecifiedError; |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 311 | } |
| 312 | |
| 313 | std::vector<uint8_t> dataReceived(0); |
| 314 | int status = -1; |
| 315 | uint8_t netFn = 0, lun = 0, cmd = 0, cc = 0; |
| 316 | |
| 317 | std::tie(status, netFn, lun, cmd, cc, dataReceived) = ipmbResponse; |
| 318 | |
| 319 | auto respReceived = |
| 320 | IpmbResponse(ipmbRequest.rqSA, netFn, lun, ipmbRequest.address, |
| 321 | ipmbRequest.seq, lun, cmd, cc, dataReceived); |
| 322 | |
| 323 | // check IPMB layer status |
| 324 | if (status) |
| 325 | { |
| 326 | phosphor::logging::log<phosphor::logging::level::WARNING>( |
| 327 | "handleIpmbChannel, ipmb returned non zero status"); |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 328 | return ipmi::ccResponseError; |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 329 | } |
| 330 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 331 | switch (tracking) |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 332 | { |
| 333 | case modeNoTracking: |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 334 | { |
| 335 | if (getResponseQueueSize() == responseQueueMaxSize) |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 336 | { |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 337 | return ipmi::ccBusy; |
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 | insertMessageInQueue(respReceived); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 340 | break; |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 341 | } |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 342 | case modeTrackRequest: |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 343 | { |
| 344 | size_t dataLength = 0; |
| 345 | respReceived.ipmbToi2cConstruct(rspData.data(), &dataLength); |
| 346 | // resizing the rspData to its correct length |
| 347 | rspData.resize(dataLength); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 348 | break; |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 349 | } |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 350 | default: |
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 | phosphor::logging::log<phosphor::logging::level::INFO>( |
| 353 | "handleIpmbChannel, mode not supported"); |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 354 | return ipmi::ccParmOutOfRange; |
| 355 | } |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 356 | } |
| 357 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 358 | return ipmi::ccSuccess; |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 359 | } |
| 360 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 361 | void Bridging::insertMessageInQueue(IpmbResponse msg) |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 362 | { |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 363 | responseQueue.insert(responseQueue.end(), std::move(msg)); |
| 364 | } |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 365 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 366 | void Bridging::eraseMessageFromQueue() |
| 367 | { |
| 368 | responseQueue.erase(responseQueue.begin()); |
| 369 | } |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 370 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 371 | IpmbResponse Bridging::getMessageFromQueue() |
| 372 | { |
| 373 | return responseQueue.front(); |
| 374 | } |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 375 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 376 | /** |
| 377 | * @brief This command is used for bridging ipmi message between channels. |
| 378 | * @param channelNumber - channel number to send message to |
| 379 | * @param authenticationEnabled - authentication. |
| 380 | * @param encryptionEnabled - encryption |
| 381 | * @param Tracking - track request |
| 382 | * @param msg - message data |
| 383 | * |
| 384 | * @return IPMI completion code plus response data on success. |
| 385 | * - rspData - response data |
| 386 | **/ |
| 387 | ipmi::RspType<std::vector<uint8_t> // responseData |
| 388 | > |
srikanta mondal | 36b3a87 | 2020-03-17 22:20:47 +0000 | [diff] [blame^] | 389 | ipmiAppSendMessage(ipmi::Context::ptr ctx, const uint4_t channelNumber, |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 390 | const bool authenticationEnabled, |
| 391 | const bool encryptionEnabled, const uint2_t tracking, |
| 392 | ipmi::message::Payload &msg) |
| 393 | { |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 394 | // check message fields: |
| 395 | // encryption not supported |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 396 | if (encryptionEnabled) |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 397 | { |
| 398 | phosphor::logging::log<phosphor::logging::level::INFO>( |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 399 | "ipmiAppSendMessage, encryption not supported"); |
| 400 | return ipmi::responseParmOutOfRange(); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 401 | } |
| 402 | |
| 403 | // authentication not supported |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 404 | if (authenticationEnabled) |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 405 | { |
| 406 | phosphor::logging::log<phosphor::logging::level::INFO>( |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 407 | "ipmiAppSendMessage, authentication not supported"); |
| 408 | return ipmi::responseParmOutOfRange(); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 409 | } |
| 410 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 411 | ipmi::Cc returnVal; |
| 412 | std::vector<uint8_t> rspData(ipmbMaxFrameLength); |
| 413 | size_t dataLength = 0; |
| 414 | std::vector<uint8_t> unpackMsg; |
| 415 | |
| 416 | auto channelNo = static_cast<const uint8_t>(channelNumber); |
| 417 | // Get the channel number |
| 418 | switch (channelNo) |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 419 | { |
| 420 | // we only handle ipmb for now |
| 421 | case targetChannelIpmb: |
| 422 | case targetChannelOtherLan: |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 423 | if (msg.unpack(unpackMsg) || !msg.fullyUnpacked()) |
| 424 | { |
| 425 | return ipmi::responseReqDataLenInvalid(); |
| 426 | } |
| 427 | |
| 428 | returnVal = bridging.handleIpmbChannel( |
srikanta mondal | 36b3a87 | 2020-03-17 22:20:47 +0000 | [diff] [blame^] | 429 | ctx, static_cast<const uint8_t>(tracking), unpackMsg, rspData); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 430 | break; |
| 431 | // fall through to default |
| 432 | case targetChannelIcmb10: |
| 433 | case targetChannelIcmb09: |
| 434 | case targetChannelLan: |
| 435 | case targetChannelSerialModem: |
| 436 | case targetChannelPciSmbus: |
| 437 | case targetChannelSmbus10: |
| 438 | case targetChannelSmbus20: |
| 439 | case targetChannelSystemInterface: |
| 440 | default: |
| 441 | phosphor::logging::log<phosphor::logging::level::INFO>( |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 442 | "ipmiAppSendMessage, TargetChannel invalid"); |
| 443 | return ipmi::responseParmOutOfRange(); |
| 444 | } |
| 445 | if (returnVal != ipmi::ccSuccess) |
| 446 | { |
| 447 | return ipmi::response(returnVal); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 448 | } |
| 449 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 450 | return ipmi::responseSuccess(rspData); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 451 | } |
| 452 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 453 | /** |
| 454 | * @brief This command is used to Get data from the receive message queue. |
| 455 | * This command should be executed executed via system interface only. |
| 456 | * |
| 457 | * @return IPMI completion code plus response data on success. |
| 458 | * - channelNumber |
| 459 | * - messageData |
| 460 | **/ |
| 461 | |
| 462 | ipmi::RspType<uint8_t, // channelNumber |
| 463 | std::vector<uint8_t> // messageData |
| 464 | > |
| 465 | ipmiAppGetMessage() |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 466 | { |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 467 | uint8_t channelData = 0; |
| 468 | std::vector<uint8_t> res(ipmbMaxFrameLength); |
| 469 | size_t dataLength = 0; |
| 470 | |
| 471 | if (!bridging.getResponseQueueSize()) |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 472 | { |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 473 | constexpr ipmi::Cc ipmiGetMessageCmdDataNotAvailable = 0x80; |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 474 | phosphor::logging::log<phosphor::logging::level::INFO>( |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 475 | "ipmiAppGetMessage, no data available"); |
| 476 | return ipmi::response(ipmiGetMessageCmdDataNotAvailable); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 477 | } |
| 478 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 479 | // channel number set. |
| 480 | channelData |= static_cast<uint8_t>(targetChannelSystemInterface) & 0x0F; |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 481 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 482 | // Priviledge level set. |
| 483 | channelData |= SYSTEM_INTERFACE & 0xF0; |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 484 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 485 | // Get the first message from queue |
| 486 | auto respQueueItem = bridging.getMessageFromQueue(); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 487 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 488 | // construct response data. |
| 489 | respQueueItem.ipmbToi2cConstruct(res.data(), &dataLength); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 490 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 491 | // Remove the message from queue |
| 492 | bridging.eraseMessageFromQueue(); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 493 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 494 | // resizing the rspData to its correct length |
| 495 | res.resize(dataLength); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 496 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 497 | return ipmi::responseSuccess(channelData, res); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 498 | } |
| 499 | |
Yong Li | c3580e9 | 2019-08-15 14:36:47 +0800 | [diff] [blame] | 500 | std::size_t Bridging::getResponseQueueSize() |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 501 | { |
Yong Li | c3580e9 | 2019-08-15 14:36:47 +0800 | [diff] [blame] | 502 | return responseQueue.size(); |
| 503 | } |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 504 | |
Yong Li | c3580e9 | 2019-08-15 14:36:47 +0800 | [diff] [blame] | 505 | /** |
| 506 | @brief This command is used to retrive present message available states. |
| 507 | |
| 508 | @return IPMI completion code plus Flags as response data on success. |
| 509 | **/ |
| 510 | ipmi::RspType<std::bitset<8>> ipmiAppGetMessageFlags() |
| 511 | { |
| 512 | std::bitset<8> getMsgFlagsRes; |
| 513 | |
jayaprakash Mutyala | 5ba4687 | 2019-11-20 00:02:48 +0000 | [diff] [blame] | 514 | // set event message buffer bit |
| 515 | if (!eventMessageBufferFlag) |
| 516 | { |
| 517 | getMsgFlagsRes.set(getMsgFlagEventMessageBit); |
| 518 | } |
| 519 | else |
| 520 | { |
| 521 | getMsgFlagsRes.reset(getMsgFlagEventMessageBit); |
| 522 | } |
Yong Li | c3580e9 | 2019-08-15 14:36:47 +0800 | [diff] [blame] | 523 | |
| 524 | // set message fields |
| 525 | if (bridging.getResponseQueueSize() > 0) |
| 526 | { |
| 527 | getMsgFlagsRes.set(getMsgFlagReceiveMessageBit); |
| 528 | } |
| 529 | else |
| 530 | { |
| 531 | getMsgFlagsRes.reset(getMsgFlagReceiveMessageBit); |
| 532 | } |
| 533 | |
| 534 | try |
| 535 | { |
| 536 | std::shared_ptr<sdbusplus::asio::connection> dbus = getSdBus(); |
| 537 | ipmi::Value variant = ipmi::getDbusProperty( |
| 538 | *dbus, wdtService, wdtObjPath, wdtInterface, wdtInterruptFlagProp); |
| 539 | if (std::get<bool>(variant)) |
| 540 | { |
| 541 | getMsgFlagsRes.set(getMsgFlagWatchdogPreTimeOutBit); |
| 542 | } |
| 543 | } |
| 544 | catch (sdbusplus::exception::SdBusError &e) |
| 545 | { |
| 546 | phosphor::logging::log<phosphor::logging::level::ERR>( |
| 547 | "ipmiAppGetMessageFlags, dbus call exception"); |
| 548 | return ipmi::responseUnspecifiedError(); |
| 549 | } |
| 550 | |
| 551 | return ipmi::responseSuccess(getMsgFlagsRes); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 552 | } |
| 553 | |
jayaprakash Mutyala | 405f54a | 2019-10-18 18:23:27 +0000 | [diff] [blame] | 554 | /** @brief This command is used to flush unread data from the receive |
| 555 | * message queue |
| 556 | * @param receiveMessage - clear receive message queue |
| 557 | * @param eventMsgBufFull - clear event message buffer full |
| 558 | * @param reserved2 - reserved bit |
| 559 | * @param watchdogTimeout - clear watchdog pre-timeout interrupt flag |
| 560 | * @param reserved1 - reserved bit |
| 561 | * @param oem0 - clear OEM 0 data |
| 562 | * @param oem1 - clear OEM 1 data |
| 563 | * @param oem2 - clear OEM 2 data |
| 564 | |
| 565 | * @return IPMI completion code on success |
| 566 | */ |
| 567 | ipmi::RspType<> ipmiAppClearMessageFlags(bool receiveMessage, |
| 568 | bool eventMsgBufFull, bool reserved2, |
| 569 | bool watchdogTimeout, bool reserved1, |
| 570 | bool oem0, bool oem1, bool oem2) |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 571 | { |
jayaprakash Mutyala | 405f54a | 2019-10-18 18:23:27 +0000 | [diff] [blame] | 572 | if (reserved1 || reserved2) |
| 573 | { |
| 574 | return ipmi::responseInvalidFieldRequest(); |
| 575 | } |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 576 | |
jayaprakash Mutyala | 405f54a | 2019-10-18 18:23:27 +0000 | [diff] [blame] | 577 | if (receiveMessage) |
| 578 | { |
| 579 | bridging.clearResponseQueue(); |
| 580 | } |
jayaprakash Mutyala | 5ba4687 | 2019-11-20 00:02:48 +0000 | [diff] [blame] | 581 | |
| 582 | if (eventMessageBufferFlag != true && eventMsgBufFull == true) |
| 583 | { |
| 584 | eventMessageBufferFlag = true; |
| 585 | } |
| 586 | |
jayaprakash Mutyala | 43539cb | 2019-11-25 12:37:27 +0000 | [diff] [blame] | 587 | try |
| 588 | { |
| 589 | std::shared_ptr<sdbusplus::asio::connection> dbus = getSdBus(); |
| 590 | ipmi::setDbusProperty(*dbus, wdtService, wdtObjPath, wdtInterface, |
| 591 | wdtInterruptFlagProp, false); |
| 592 | } |
| 593 | catch (const sdbusplus::exception::SdBusError &e) |
| 594 | { |
| 595 | phosphor::logging::log<phosphor::logging::level::ERR>( |
| 596 | "ipmiAppClearMessageFlags: can't Clear/Set " |
| 597 | "PreTimeoutInterruptOccurFlag"); |
| 598 | return ipmi::responseUnspecifiedError(); |
| 599 | } |
| 600 | |
jayaprakash Mutyala | 405f54a | 2019-10-18 18:23:27 +0000 | [diff] [blame] | 601 | return ipmi::responseSuccess(); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 602 | } |
| 603 | |
jayaprakash Mutyala | 5ba4687 | 2019-11-20 00:02:48 +0000 | [diff] [blame] | 604 | using systemEventType = std::tuple< |
| 605 | uint16_t, // Generator ID |
| 606 | uint32_t, // Timestamp |
| 607 | uint8_t, // Sensor Type |
| 608 | uint8_t, // EvM Rev |
| 609 | uint8_t, // Sensor Number |
| 610 | uint7_t, // Event Type |
| 611 | bool, // Event Direction |
| 612 | std::array<uint8_t, intel_oem::ipmi::sel::systemEventSize>>; // Event Data |
| 613 | using oemTsEventType = std::tuple< |
| 614 | uint32_t, // Timestamp |
| 615 | std::array<uint8_t, intel_oem::ipmi::sel::oemTsEventSize>>; // Event Data |
| 616 | using oemEventType = |
| 617 | std::array<uint8_t, intel_oem::ipmi::sel::oemEventSize>; // Event Data |
| 618 | |
| 619 | /** @brief implements of Read event message buffer command |
| 620 | * |
| 621 | * @returns IPMI completion code plus response data |
| 622 | * - recordID - SEL Record ID |
| 623 | * - recordType - Record Type |
| 624 | * - generatorID - Generator ID |
| 625 | * - timeStamp - Timestamp |
| 626 | * - sensorType - Sensor Type |
| 627 | * - eventMsgFormatRev - Event Message format version |
| 628 | * - sensorNumber - Sensor Number |
| 629 | * - eventType - Event Type |
| 630 | * - eventDir - Event Direction |
| 631 | * - eventData - Event Data field |
| 632 | */ |
| 633 | ipmi::RspType<uint16_t, // Record ID |
| 634 | uint8_t, // Record Type |
| 635 | std::variant<systemEventType, oemTsEventType, |
| 636 | oemEventType>> // Record Content |
| 637 | ipmiAppReadEventMessageBuffer() |
| 638 | { |
| 639 | uint16_t recordId = |
| 640 | static_cast<uint16_t>(0x5555); // recordId: 0x55 << 8 | 0x55 |
| 641 | uint16_t generatorId = |
| 642 | static_cast<uint16_t>(0xA741); // generatorId: 0xA7 << 8 | 0x41 |
| 643 | constexpr uint8_t recordType = 0xC0; |
| 644 | constexpr uint8_t eventMsgFormatRev = 0x3A; |
| 645 | constexpr uint8_t sensorNumber = 0xFF; |
| 646 | |
| 647 | // TODO need to be implemented. |
| 648 | std::array<uint8_t, intel_oem::ipmi::sel::systemEventSize> eventData{}; |
| 649 | // All '0xFF' since unused. |
| 650 | eventData.fill(0xFF); |
| 651 | |
| 652 | // Set the event message buffer flag |
| 653 | eventMessageBufferFlag = true; |
| 654 | |
| 655 | return ipmi::responseSuccess( |
| 656 | recordId, recordType, |
| 657 | systemEventType{generatorId, 0, 0, eventMsgFormatRev, sensorNumber, |
| 658 | static_cast<uint7_t>(0), false, eventData}); |
| 659 | } |
| 660 | |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 661 | static void register_bridging_functions() __attribute__((constructor)); |
| 662 | static void register_bridging_functions() |
| 663 | { |
jayaprakash Mutyala | 405f54a | 2019-10-18 18:23:27 +0000 | [diff] [blame] | 664 | ipmi::registerHandler(ipmi::prioOemBase, ipmi::netFnApp, |
| 665 | ipmi::app::cmdClearMessageFlags, |
| 666 | ipmi::Privilege::User, ipmiAppClearMessageFlags); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 667 | |
Yong Li | c3580e9 | 2019-08-15 14:36:47 +0800 | [diff] [blame] | 668 | ipmi::registerHandler(ipmi::prioOemBase, ipmi::netFnApp, |
| 669 | ipmi::app::cmdGetMessageFlags, ipmi::Privilege::User, |
| 670 | ipmiAppGetMessageFlags); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 671 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 672 | ipmi::registerHandler(ipmi::prioOemBase, ipmi::netFnApp, |
| 673 | ipmi::app::cmdGetMessage, ipmi::Privilege::User, |
| 674 | ipmiAppGetMessage); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 675 | |
Deepak Kumar Sahu | 24d2d56 | 2019-07-14 16:05:19 +0000 | [diff] [blame] | 676 | ipmi::registerHandler(ipmi::prioOemBase, ipmi::netFnApp, |
| 677 | ipmi::app::cmdSendMessage, ipmi::Privilege::User, |
| 678 | ipmiAppSendMessage); |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 679 | |
jayaprakash Mutyala | 5ba4687 | 2019-11-20 00:02:48 +0000 | [diff] [blame] | 680 | ipmi::registerHandler(ipmi::prioOemBase, ipmi::netFnApp, |
| 681 | ipmi::app::cmdReadEventMessageBuffer, |
| 682 | ipmi::Privilege::User, ipmiAppReadEventMessageBuffer); |
| 683 | |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 684 | return; |
| 685 | } |