blob: 769f9ff0a7831c85ec9059745dee660db3fa26b5 [file] [log] [blame]
AppaRao Puli071f3f22018-05-24 16:45:30 +05301/*
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
AppaRao Puli071f3f22018-05-24 16:45:30 +053017#include "apphandler.hpp"
18#include "channel_layer.hpp"
19
NITIN SHARMA89e4bf22019-05-02 13:03:58 +000020#include <ipmid/api.hpp>
AppaRao Puli071f3f22018-05-24 16:45:30 +053021#include <phosphor-logging/log.hpp>
22#include <regex>
23
24using namespace phosphor::logging;
25
26namespace ipmi
27{
28
NITIN SHARMA89e4bf22019-05-02 13:03:58 +000029/** @brief implements the set channel access command
30 * @ param ctx - context pointer
31 * @ param channel - channel number
32 * @ param reserved - skip 4 bits
33 * @ param accessMode - access mode for IPMI messaging
34 * @ param usrAuth - user level authentication (enable/disable)
35 * @ param msgAuth - per message authentication (enable/disable)
36 * @ param alertDisabled - PEF alerting (enable/disable)
37 * @ param chanAccess - channel access
38 * @ param channelPrivLimit - channel privilege limit
39 * @ param reserved - skip 3 bits
40 * @ param channelPrivMode - channel priviledge mode
41 *
42 * @ returns IPMI completion code
43 **/
44RspType<> ipmiSetChannelAccess(Context::ptr ctx, uint4_t channel,
45 uint4_t reserved1, uint3_t accessMode,
46 bool usrAuth, bool msgAuth, bool alertDisabled,
47 uint2_t chanAccess, uint4_t channelPrivLimit,
48 uint2_t reserved2, uint2_t channelPrivMode)
AppaRao Puli071f3f22018-05-24 16:45:30 +053049{
jayaprakash Mutyala0e2dbee2019-12-26 13:03:04 +000050 if (reserved1 || reserved2 ||
51 !isValidPrivLimit(static_cast<uint8_t>(channelPrivLimit)))
AppaRao Puli071f3f22018-05-24 16:45:30 +053052 {
Richard Marian Thomaiyaref024012019-01-29 11:06:39 +053053 log<level::DEBUG>("Set channel access - Invalid field in request");
NITIN SHARMA89e4bf22019-05-02 13:03:58 +000054 return responseInvalidFieldRequest();
AppaRao Puli071f3f22018-05-24 16:45:30 +053055 }
56
jayaprakash Mutyala0e2dbee2019-12-26 13:03:04 +000057 const uint8_t chNum =
58 convertCurrentChannelNum(static_cast<uint8_t>(channel), ctx->channel);
59 if ((getChannelSessionSupport(chNum) == EChannelSessSupported::none) ||
60 (!isValidChannel(chNum)))
AppaRao Puli071f3f22018-05-24 16:45:30 +053061 {
62 log<level::DEBUG>("Set channel access - No support on channel");
anil kumar appanaddb1f442019-07-04 18:07:27 +000063 return response(ccActionNotSupportedForChannel);
AppaRao Puli071f3f22018-05-24 16:45:30 +053064 }
65
66 ChannelAccess chActData;
67 ChannelAccess chNVData;
68 uint8_t setActFlag = 0;
69 uint8_t setNVFlag = 0;
NITIN SHARMA89e4bf22019-05-02 13:03:58 +000070 Cc compCode;
AppaRao Puli071f3f22018-05-24 16:45:30 +053071
NITIN SHARMA89e4bf22019-05-02 13:03:58 +000072 // cannot static cast directly from uint2_t to enum; must go via int
73 uint8_t channelAccessAction = static_cast<uint8_t>(chanAccess);
74 switch (static_cast<EChannelActionType>(channelAccessAction))
AppaRao Puli071f3f22018-05-24 16:45:30 +053075 {
76 case doNotSet:
AppaRao Puli071f3f22018-05-24 16:45:30 +053077 break;
78 case nvData:
NITIN SHARMA89e4bf22019-05-02 13:03:58 +000079 chNVData.accessMode = static_cast<uint8_t>(accessMode);
80 chNVData.userAuthDisabled = usrAuth;
81 chNVData.perMsgAuthDisabled = msgAuth;
82 chNVData.alertingDisabled = alertDisabled;
AppaRao Puli071f3f22018-05-24 16:45:30 +053083 setNVFlag |= (setAccessMode | setUserAuthEnabled |
84 setMsgAuthEnabled | setAlertingEnabled);
85 break;
NITIN SHARMA89e4bf22019-05-02 13:03:58 +000086
AppaRao Puli071f3f22018-05-24 16:45:30 +053087 case activeData:
NITIN SHARMA89e4bf22019-05-02 13:03:58 +000088 chActData.accessMode = static_cast<uint8_t>(accessMode);
89 chActData.userAuthDisabled = usrAuth;
90 chActData.perMsgAuthDisabled = msgAuth;
91 chActData.alertingDisabled = alertDisabled;
AppaRao Puli071f3f22018-05-24 16:45:30 +053092 setActFlag |= (setAccessMode | setUserAuthEnabled |
93 setMsgAuthEnabled | setAlertingEnabled);
94 break;
NITIN SHARMA89e4bf22019-05-02 13:03:58 +000095
AppaRao Puli071f3f22018-05-24 16:45:30 +053096 case reserved:
97 default:
98 log<level::DEBUG>("Set channel access - Invalid access set mode");
jayaprakash Mutyala0e2dbee2019-12-26 13:03:04 +000099 return response(ccAccessModeNotSupportedForChannel);
AppaRao Puli071f3f22018-05-24 16:45:30 +0530100 }
101
NITIN SHARMA89e4bf22019-05-02 13:03:58 +0000102 // cannot static cast directly from uint2_t to enum; must go via int
103 uint8_t channelPrivAction = static_cast<uint8_t>(channelPrivMode);
104 switch (static_cast<EChannelActionType>(channelPrivAction))
AppaRao Puli071f3f22018-05-24 16:45:30 +0530105 {
106 case doNotSet:
AppaRao Puli071f3f22018-05-24 16:45:30 +0530107 break;
108 case nvData:
NITIN SHARMA89e4bf22019-05-02 13:03:58 +0000109 chNVData.privLimit = static_cast<uint8_t>(channelPrivLimit);
AppaRao Puli071f3f22018-05-24 16:45:30 +0530110 setNVFlag |= setPrivLimit;
111 break;
112 case activeData:
NITIN SHARMA89e4bf22019-05-02 13:03:58 +0000113 chActData.privLimit = static_cast<uint8_t>(channelPrivLimit);
114
AppaRao Puli071f3f22018-05-24 16:45:30 +0530115 setActFlag |= setPrivLimit;
116 break;
117 case reserved:
118 default:
119 log<level::DEBUG>("Set channel access - Invalid access priv mode");
jayaprakash Mutyala0e2dbee2019-12-26 13:03:04 +0000120 return response(ccAccessModeNotSupportedForChannel);
AppaRao Puli071f3f22018-05-24 16:45:30 +0530121 }
122
123 if (setNVFlag != 0)
124 {
125 compCode = setChannelAccessPersistData(chNum, chNVData, setNVFlag);
NITIN SHARMAb541a5a2019-07-18 12:46:59 +0000126 if (compCode != ccSuccess)
AppaRao Puli071f3f22018-05-24 16:45:30 +0530127 {
128 log<level::DEBUG>("Set channel access - Failed to set access data");
NITIN SHARMA89e4bf22019-05-02 13:03:58 +0000129 return response(compCode);
AppaRao Puli071f3f22018-05-24 16:45:30 +0530130 }
131 }
132
133 if (setActFlag != 0)
134 {
135 compCode = setChannelAccessData(chNum, chActData, setActFlag);
NITIN SHARMAb541a5a2019-07-18 12:46:59 +0000136 if (compCode != ccSuccess)
AppaRao Puli071f3f22018-05-24 16:45:30 +0530137 {
138 log<level::DEBUG>("Set channel access - Failed to set access data");
NITIN SHARMA89e4bf22019-05-02 13:03:58 +0000139 return response(compCode);
AppaRao Puli071f3f22018-05-24 16:45:30 +0530140 }
141 }
142
NITIN SHARMA89e4bf22019-05-02 13:03:58 +0000143 return responseSuccess();
AppaRao Puli071f3f22018-05-24 16:45:30 +0530144}
145
Richard Marian Thomaiyarbc5e9ba2019-05-07 13:32:48 +0530146/** @brief implements the get channel access command
147 * @ param ctx - context pointer
148 * @ param channel - channel number
149 * @ param reserved1 - skip 4 bits
150 * @ param reserved2 - skip 6 bits
151 * @ param accessMode - get access mode
152 *
153 * @returns ipmi completion code plus response data
154 * - accessMode - get access mode
155 * - usrAuthDisabled - user level authentication status
156 * - msgAuthDisabled - message level authentication status
157 * - alertDisabled - alerting status
158 * - reserved - skip 2 bits
159 * - privLimit - channel privilege limit
160 * - reserved - skip 4 bits
161 * */
162ipmi ::RspType<uint3_t, // access mode,
163 bool, // user authentication status,
164 bool, // message authentication status,
165 bool, // alerting status,
166 uint2_t, // reserved,
167
168 uint4_t, // channel privilege,
169 uint4_t // reserved
170 >
171 ipmiGetChannelAccess(Context::ptr ctx, uint4_t channel, uint4_t reserved1,
172 uint6_t reserved2, uint2_t accessSetMode)
AppaRao Puli071f3f22018-05-24 16:45:30 +0530173{
jayaprakash Mutyala0e2dbee2019-12-26 13:03:04 +0000174 if (reserved1 || reserved2)
AppaRao Puli071f3f22018-05-24 16:45:30 +0530175 {
Richard Marian Thomaiyaref024012019-01-29 11:06:39 +0530176 log<level::DEBUG>("Get channel access - Invalid field in request");
Richard Marian Thomaiyarbc5e9ba2019-05-07 13:32:48 +0530177 return responseInvalidFieldRequest();
AppaRao Puli071f3f22018-05-24 16:45:30 +0530178 }
179
William A. Kennington III7a0e5df2021-05-19 13:31:29 -0700180 if ((types::enum_cast<EChannelActionType>(accessSetMode) == doNotSet) ||
181 (types::enum_cast<EChannelActionType>(accessSetMode) == reserved))
AppaRao Puli071f3f22018-05-24 16:45:30 +0530182 {
183 log<level::DEBUG>("Get channel access - Invalid Access mode");
AppaRao Pulic4f4f7a2020-07-13 16:43:59 +0530184 return responseInvalidFieldRequest();
AppaRao Puli071f3f22018-05-24 16:45:30 +0530185 }
186
jayaprakash Mutyala0e2dbee2019-12-26 13:03:04 +0000187 const uint8_t chNum =
188 convertCurrentChannelNum(static_cast<uint8_t>(channel), ctx->channel);
189
190 if ((getChannelSessionSupport(chNum) == EChannelSessSupported::none) ||
191 (!isValidChannel(chNum)))
AppaRao Puli071f3f22018-05-24 16:45:30 +0530192 {
193 log<level::DEBUG>("Get channel access - No support on channel");
anil kumar appanaddb1f442019-07-04 18:07:27 +0000194 return response(ccActionNotSupportedForChannel);
AppaRao Puli071f3f22018-05-24 16:45:30 +0530195 }
196
AppaRao Puli071f3f22018-05-24 16:45:30 +0530197 ChannelAccess chAccess;
AppaRao Puli071f3f22018-05-24 16:45:30 +0530198
Richard Marian Thomaiyarbc5e9ba2019-05-07 13:32:48 +0530199 Cc compCode;
200
William A. Kennington III7a0e5df2021-05-19 13:31:29 -0700201 if (types::enum_cast<EChannelActionType>(accessSetMode) == nvData)
AppaRao Puli071f3f22018-05-24 16:45:30 +0530202 {
203 compCode = getChannelAccessPersistData(chNum, chAccess);
204 }
William A. Kennington III7a0e5df2021-05-19 13:31:29 -0700205 else if (types::enum_cast<EChannelActionType>(accessSetMode) == activeData)
AppaRao Puli071f3f22018-05-24 16:45:30 +0530206 {
207 compCode = getChannelAccessData(chNum, chAccess);
208 }
209
NITIN SHARMAb541a5a2019-07-18 12:46:59 +0000210 if (compCode != ccSuccess)
AppaRao Puli071f3f22018-05-24 16:45:30 +0530211 {
Richard Marian Thomaiyarbc5e9ba2019-05-07 13:32:48 +0530212 return response(compCode);
AppaRao Puli071f3f22018-05-24 16:45:30 +0530213 }
214
Richard Marian Thomaiyarbc5e9ba2019-05-07 13:32:48 +0530215 constexpr uint2_t reservedOut1 = 0;
216 constexpr uint4_t reservedOut2 = 0;
AppaRao Puli071f3f22018-05-24 16:45:30 +0530217
Richard Marian Thomaiyarbc5e9ba2019-05-07 13:32:48 +0530218 return responseSuccess(
William A. Kennington III7a0e5df2021-05-19 13:31:29 -0700219 types::enum_cast<uint3_t>(chAccess.accessMode),
220 chAccess.userAuthDisabled, chAccess.perMsgAuthDisabled,
221 chAccess.alertingDisabled, reservedOut1,
222 types::enum_cast<uint4_t>(chAccess.privLimit), reservedOut2);
AppaRao Puli071f3f22018-05-24 16:45:30 +0530223}
224
Vernon Mauery6f1e9782019-05-02 16:31:07 -0700225/** @brief implements the get channel info command
226 * @ param ctx - context pointer
227 * @ param channel - channel number
228 * @ param reserved - skip 4 bits
229 *
230 * @returns ipmi completion code plus response data
231 * - chNum - the channel number for this request
232 * - mediumType - see Table 6-3, Channel Medium Type Numbers
233 * - protocolType - Table 6-2, Channel Protocol Type Numbers
234 * - activeSessionCount - number of active sessions
235 * - sessionType - channel support for sessions
236 * - vendorId - vendor for this channel protocol (IPMI - 7154)
237 * - auxChInfo - auxiliary info for channel
238 * */
239RspType<uint4_t, // chNum
240 uint4_t, // reserved
241 uint7_t, // mediumType
242 bool, // reserved
243 uint5_t, // protocolType
244 uint3_t, // reserved
245 uint6_t, // activeSessionCount
246 uint2_t, // sessionType
247 uint24_t, // Vendor IANA
248 uint16_t // aux info
249 >
250 ipmiGetChannelInfo(Context::ptr ctx, uint4_t channel, uint4_t reserved)
AppaRao Puli071f3f22018-05-24 16:45:30 +0530251{
jayaprakash Mutyala0e2dbee2019-12-26 13:03:04 +0000252 if (reserved)
AppaRao Puli071f3f22018-05-24 16:45:30 +0530253 {
Vernon Mauery6f1e9782019-05-02 16:31:07 -0700254 log<level::DEBUG>("Get channel access - Invalid field in request");
255 return responseInvalidFieldRequest();
AppaRao Puli071f3f22018-05-24 16:45:30 +0530256 }
257
jayaprakash Mutyala0e2dbee2019-12-26 13:03:04 +0000258 uint8_t chNum =
259 convertCurrentChannelNum(static_cast<uint8_t>(channel), ctx->channel);
260 if (!isValidChannel(chNum))
261 {
262 log<level::DEBUG>("Get channel Info - No support on channel");
Jayaprakash Mutyalaafd12b42020-07-07 01:06:57 +0000263 return responseInvalidFieldRequest();
jayaprakash Mutyala0e2dbee2019-12-26 13:03:04 +0000264 }
265
AppaRao Puli071f3f22018-05-24 16:45:30 +0530266 ChannelInfo chInfo;
Vernon Mauery6f1e9782019-05-02 16:31:07 -0700267 Cc compCode = getChannelInfo(chNum, chInfo);
268 if (compCode != ccSuccess)
AppaRao Puli071f3f22018-05-24 16:45:30 +0530269 {
Vernon Mauery6f1e9782019-05-02 16:31:07 -0700270 log<level::ERR>("Failed to get channel info",
271 entry("CHANNEL=%x", chNum),
272 entry("ERRNO=%x", compCode));
273 return response(compCode);
AppaRao Puli071f3f22018-05-24 16:45:30 +0530274 }
275
Vernon Mauery6f1e9782019-05-02 16:31:07 -0700276 constexpr uint4_t reserved1 = 0;
277 constexpr bool reserved2 = false;
278 constexpr uint3_t reserved3 = 0;
279 uint8_t mediumType = chInfo.mediumType;
280 uint8_t protocolType = chInfo.protocolType;
281 uint2_t sessionType = chInfo.sessionSupported;
282 uint6_t activeSessionCount = getChannelActiveSessions(chNum);
AppaRao Puli071f3f22018-05-24 16:45:30 +0530283 // IPMI Spec: The IPMI Enterprise Number is: 7154 (decimal)
Vernon Mauery6f1e9782019-05-02 16:31:07 -0700284 constexpr uint24_t vendorId = 7154;
285 constexpr uint16_t auxChInfo = 0;
AppaRao Puli071f3f22018-05-24 16:45:30 +0530286
Vernon Mauery6f1e9782019-05-02 16:31:07 -0700287 return responseSuccess(chNum, reserved1, mediumType, reserved2,
288 protocolType, reserved3, activeSessionCount,
289 sessionType, vendorId, auxChInfo);
AppaRao Puli071f3f22018-05-24 16:45:30 +0530290}
291
Vernon Maueryf6092892019-05-02 16:35:10 -0700292namespace
Saravanan Palanisamyb5a0f162019-03-04 18:34:44 +0530293{
Vernon Maueryf6092892019-05-02 16:35:10 -0700294constexpr uint16_t standardPayloadBit(PayloadType p)
295{
296 return (1 << static_cast<size_t>(p));
297}
Saravanan Palanisamyb5a0f162019-03-04 18:34:44 +0530298
Vernon Maueryf6092892019-05-02 16:35:10 -0700299constexpr uint16_t sessionPayloadBit(PayloadType p)
300{
301 constexpr size_t sessionShift =
302 static_cast<size_t>(PayloadType::OPEN_SESSION_REQUEST);
303 return ((1 << static_cast<size_t>(p)) >> sessionShift);
304}
305} // namespace
Saravanan Palanisamyb5a0f162019-03-04 18:34:44 +0530306
Vernon Maueryf6092892019-05-02 16:35:10 -0700307/** @brief implements get channel payload support command
308 * @ param ctx - ipmi context pointer
309 * @ param chNum - channel number
310 * @ param reserved - skip 4 bits
311 *
312 * @ returns IPMI completion code plus response data
313 * - stdPayloadType - bitmask of supported standard payload types
314 * - sessSetupPayloadType - bitmask of supported session setup payload types
315 * - OEMPayloadType - bitmask of supported OEM payload types
316 * - reserved - 2 bytes of 0
317 **/
318RspType<uint16_t, // stdPayloadType
319 uint16_t, // sessSetupPayloadType
320 uint16_t, // OEMPayloadType
321 uint16_t // reserved
322 >
323 ipmiGetChannelPayloadSupport(Context::ptr ctx, uint4_t channel,
324 uint4_t reserved)
325{
326 uint8_t chNum =
327 convertCurrentChannelNum(static_cast<uint8_t>(channel), ctx->channel);
jayaprakash Mutyala0e2dbee2019-12-26 13:03:04 +0000328
329 if (!doesDeviceExist(chNum) || !isValidChannel(chNum) || reserved)
Saravanan Palanisamyb5a0f162019-03-04 18:34:44 +0530330 {
jayaprakash Mutyala0e2dbee2019-12-26 13:03:04 +0000331 log<level::DEBUG>("Get channel payload - Invalid field in request");
Vernon Maueryf6092892019-05-02 16:35:10 -0700332 return responseInvalidFieldRequest();
Saravanan Palanisamyb5a0f162019-03-04 18:34:44 +0530333 }
334
335 // Session support is available in active LAN channels.
jayaprakash Mutyala0e2dbee2019-12-26 13:03:04 +0000336 if (getChannelSessionSupport(chNum) == EChannelSessSupported::none)
Saravanan Palanisamyb5a0f162019-03-04 18:34:44 +0530337 {
jayaprakash Mutyala0e2dbee2019-12-26 13:03:04 +0000338 log<level::DEBUG>("Get channel payload - No support on channel");
339 return response(ccActionNotSupportedForChannel);
Saravanan Palanisamyb5a0f162019-03-04 18:34:44 +0530340 }
Vernon Maueryf6092892019-05-02 16:35:10 -0700341 constexpr uint16_t stdPayloadType = standardPayloadBit(PayloadType::IPMI) |
342 standardPayloadBit(PayloadType::SOL);
343 constexpr uint16_t sessSetupPayloadType =
344 sessionPayloadBit(PayloadType::OPEN_SESSION_REQUEST) |
345 sessionPayloadBit(PayloadType::OPEN_SESSION_RESPONSE) |
346 sessionPayloadBit(PayloadType::RAKP1) |
347 sessionPayloadBit(PayloadType::RAKP2) |
348 sessionPayloadBit(PayloadType::RAKP3) |
349 sessionPayloadBit(PayloadType::RAKP4);
350 constexpr uint16_t OEMPayloadType = 0;
351 constexpr uint16_t rspRsvd = 0;
352 return responseSuccess(stdPayloadType, sessSetupPayloadType, OEMPayloadType,
353 rspRsvd);
Saravanan Palanisamyb5a0f162019-03-04 18:34:44 +0530354}
355
Ayushi Smriti6fd812d2019-04-12 18:51:31 +0000356/** @brief implements the get channel payload version command
357 * @param ctx - IPMI context pointer (for channel)
358 * @param chNum - channel number to get info about
359 * @param reserved - skip 4 bits
360 * @param payloadTypeNum - to get payload type info
361
362 * @returns IPMI completion code plus response data
363 * - formatVersion - BCD encoded format version info
364 */
365
366RspType<uint8_t> // formatVersion
367 ipmiGetChannelPayloadVersion(Context::ptr ctx, uint4_t chNum,
368 uint4_t reserved, uint8_t payloadTypeNum)
369{
370 uint8_t channel =
371 convertCurrentChannelNum(static_cast<uint8_t>(chNum), ctx->channel);
Manoj Ashok271d9c22021-07-22 23:21:31 +0530372 constexpr uint8_t payloadTypeNotSupported = 0x80;
Ayushi Smriti6fd812d2019-04-12 18:51:31 +0000373
jayaprakash Mutyala0e2dbee2019-12-26 13:03:04 +0000374 if (reserved || !isValidChannel(channel))
Ayushi Smriti6fd812d2019-04-12 18:51:31 +0000375 {
jayaprakash Mutyala0e2dbee2019-12-26 13:03:04 +0000376 log<level::DEBUG>(
377 "Get channel payload version - Invalid field in request");
Ayushi Smriti6fd812d2019-04-12 18:51:31 +0000378 return responseInvalidFieldRequest();
379 }
380
jayaprakash Mutyala0e2dbee2019-12-26 13:03:04 +0000381 if (getChannelSessionSupport(channel) == EChannelSessSupported::none)
382 {
383 log<level::DEBUG>(
384 "Get channel payload version - No support on channel");
Manoj Ashok271d9c22021-07-22 23:21:31 +0530385 return response(payloadTypeNotSupported);
jayaprakash Mutyala0e2dbee2019-12-26 13:03:04 +0000386 }
387
Ayushi Smriti6fd812d2019-04-12 18:51:31 +0000388 if (!isValidPayloadType(static_cast<PayloadType>(payloadTypeNum)))
389 {
jayaprakash Mutyala0e2dbee2019-12-26 13:03:04 +0000390 log<level::ERR>(
391 "Get channel payload version - Payload type unavailable");
Ayushi Smriti6fd812d2019-04-12 18:51:31 +0000392
Ayushi Smriti6fd812d2019-04-12 18:51:31 +0000393 return response(payloadTypeNotSupported);
394 }
395
396 // BCD encoded version representation - 1.0
397 constexpr uint8_t formatVersion = 0x10;
398
399 return responseSuccess(formatVersion);
400}
401
William A. Kennington III343d0612018-12-10 15:56:24 -0800402void registerChannelFunctions() __attribute__((constructor));
AppaRao Puli071f3f22018-05-24 16:45:30 +0530403void registerChannelFunctions()
404{
405 ipmiChannelInit();
406
NITIN SHARMA89e4bf22019-05-02 13:03:58 +0000407 registerHandler(prioOpenBmcBase, netFnApp, app::cmdSetChannelAccess,
408 Privilege::Admin, ipmiSetChannelAccess);
AppaRao Puli071f3f22018-05-24 16:45:30 +0530409
Richard Marian Thomaiyarbc5e9ba2019-05-07 13:32:48 +0530410 registerHandler(prioOpenBmcBase, netFnApp, app::cmdGetChannelAccess,
411 Privilege::User, ipmiGetChannelAccess);
AppaRao Puli071f3f22018-05-24 16:45:30 +0530412
Vernon Mauery6f1e9782019-05-02 16:31:07 -0700413 registerHandler(prioOpenBmcBase, netFnApp, app::cmdGetChannelInfoCommand,
414 Privilege::User, ipmiGetChannelInfo);
Saravanan Palanisamyb5a0f162019-03-04 18:34:44 +0530415
Vernon Maueryf6092892019-05-02 16:35:10 -0700416 registerHandler(prioOpenBmcBase, netFnApp, app::cmdGetChannelPayloadSupport,
417 Privilege::User, ipmiGetChannelPayloadSupport);
Ayushi Smriti6fd812d2019-04-12 18:51:31 +0000418
419 registerHandler(prioOpenBmcBase, netFnApp, app::cmdGetChannelPayloadVersion,
420 Privilege::User, ipmiGetChannelPayloadVersion);
AppaRao Puli071f3f22018-05-24 16:45:30 +0530421}
422
423} // namespace ipmi