blob: 750f0f1e5dbed5434967d3e5c6905ba4e944e9b4 [file] [log] [blame]
Eddie Jamesfa1f5c02020-09-17 15:12:46 -05001#pragma once
2
3#include <span>
4
Ratan Guptabbe45792018-03-23 00:22:55 +05305namespace phosphor
6{
7namespace network
8{
9namespace ncsi
10{
11
Ratan Guptaed5d7ff2018-03-23 00:27:52 +053012constexpr auto DEFAULT_VALUE = -1;
13constexpr auto NONE = 0;
14
Ratan Guptabbe45792018-03-23 00:22:55 +053015/* @brief This function will ask underlying NCSI driver
Eddie Jamesfa1f5c02020-09-17 15:12:46 -050016 * 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 Mantey1ebea282024-02-15 10:26:06 -080023 * @param[in] opcode - NCSI Send Command sub-operation
Eddie Jamesfa1f5c02020-09-17 15:12:46 -050024 * @param[in] payload - OEM data to send.
25 * @returns 0 on success and negative value for failure.
26 */
Johnathan Mantey1ebea282024-02-15 10:26:06 -080027int sendOemCommand(int ifindex, int package, int channel, int opcode,
Eddie Jamesfa1f5c02020-09-17 15:12:46 -050028 std::span<const unsigned char> payload);
29
30/* @brief This function will ask underlying NCSI driver
Ratan Guptabbe45792018-03-23 00:22:55 +053031 * 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 */
40int 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 */
50int clearInterface(int ifindex);
51
Ratan Guptaaac603e2018-03-23 00:25:54 +053052/* @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 */
59int getInfo(int ifindex, int package);
60
Gunnar Mills57d9c502018-09-14 14:42:34 -050061} // namespace ncsi
62} // namespace network
63} // namespace phosphor