Eddie James | fa1f5c0 | 2020-09-17 15:12:46 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <span> |
| 4 | |
Ratan Gupta | bbe4579 | 2018-03-23 00:22:55 +0530 | [diff] [blame] | 5 | namespace phosphor |
| 6 | { |
| 7 | namespace network |
| 8 | { |
| 9 | namespace ncsi |
| 10 | { |
| 11 | |
Ratan Gupta | ed5d7ff | 2018-03-23 00:27:52 +0530 | [diff] [blame] | 12 | constexpr auto DEFAULT_VALUE = -1; |
| 13 | constexpr auto NONE = 0; |
| 14 | |
Ratan Gupta | bbe4579 | 2018-03-23 00:22:55 +0530 | [diff] [blame] | 15 | /* @brief This function will ask underlying NCSI driver |
Eddie James | fa1f5c0 | 2020-09-17 15:12:46 -0500 | [diff] [blame] | 16 | * to send an OEM command (command type 0x50) with |
| 17 | * the specified payload as the OEM data. |
| 18 | * This function talks with the NCSI driver over |
| 19 | * netlink messages. |
| 20 | * @param[in] ifindex - Interface Index. |
| 21 | * @param[in] package - NCSI Package. |
| 22 | * @param[in] channel - Channel number with in the package. |
Johnathan Mantey | 1ebea28 | 2024-02-15 10:26:06 -0800 | [diff] [blame] | 23 | * @param[in] opcode - NCSI Send Command sub-operation |
Eddie James | fa1f5c0 | 2020-09-17 15:12:46 -0500 | [diff] [blame] | 24 | * @param[in] payload - OEM data to send. |
| 25 | * @returns 0 on success and negative value for failure. |
| 26 | */ |
Johnathan Mantey | 1ebea28 | 2024-02-15 10:26:06 -0800 | [diff] [blame] | 27 | int sendOemCommand(int ifindex, int package, int channel, int opcode, |
Eddie James | fa1f5c0 | 2020-09-17 15:12:46 -0500 | [diff] [blame] | 28 | std::span<const unsigned char> payload); |
| 29 | |
| 30 | /* @brief This function will ask underlying NCSI driver |
Ratan Gupta | bbe4579 | 2018-03-23 00:22:55 +0530 | [diff] [blame] | 31 | * to set a specific package or package/channel |
| 32 | * combination as the preferred choice. |
| 33 | * This function talks with the NCSI driver over |
| 34 | * netlink messages. |
| 35 | * @param[in] ifindex - Interface Index. |
| 36 | * @param[in] package - NCSI Package. |
| 37 | * @param[in] channel - Channel number with in the package. |
| 38 | * @returns 0 on success and negative value for failure. |
| 39 | */ |
| 40 | int setChannel(int ifindex, int package, int channel); |
| 41 | |
| 42 | /* @brief This function will ask underlying NCSI driver |
| 43 | * to clear any preferred setting from the given |
| 44 | * interface. |
| 45 | * This function talks with the NCSI driver over |
| 46 | * netlink messages. |
| 47 | * @param[in] ifindex - Interface Index. |
| 48 | * @returns 0 on success and negative value for failure. |
| 49 | */ |
| 50 | int clearInterface(int ifindex); |
| 51 | |
Ratan Gupta | aac603e | 2018-03-23 00:25:54 +0530 | [diff] [blame] | 52 | /* @brief This function is used to dump all the info |
| 53 | * of the package and the channels underlying |
| 54 | * the package. |
| 55 | * @param[in] ifindex - Interface Index. |
| 56 | * @param[in] package - NCSI Package. |
| 57 | * @returns 0 on success and negative value for failure. |
| 58 | */ |
| 59 | int getInfo(int ifindex, int package); |
| 60 | |
Johnathan Mantey | 5a45606 | 2024-02-15 08:45:08 -0800 | [diff] [blame] | 61 | /* @brief This function assigns a mask controlling responses to AEN from a |
| 62 | * package. |
| 63 | * @param[in] ifindex - Interface Index. |
| 64 | * @param[in] mask - A 32-bit mask integer |
| 65 | * @returns 0 on success and negative value for failure. |
| 66 | */ |
| 67 | int setPackageMask(int ifindex, unsigned int mask); |
| 68 | |
| 69 | /* @brief This function sets the AEN mask for the channels inside the selected |
| 70 | * package. |
| 71 | * @param[in] ifindex - Interface Index. |
| 72 | * @param[in] package - NCSI Package. |
| 73 | * @param[in] mask - A 32-bit mask integer |
| 74 | * @returns 0 on success and negative value for failure. |
| 75 | */ |
| 76 | int setChannelMask(int ifindex, int package, unsigned int mask); |
| 77 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 78 | } // namespace ncsi |
| 79 | } // namespace network |
| 80 | } // namespace phosphor |