blob: eaa076dc9404cc689d4e4c46b812ad4ccd29c21d [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.
23 * @param[in] payload - OEM data to send.
24 * @returns 0 on success and negative value for failure.
25 */
26int sendOemCommand(int ifindex, int package, int channel,
27 std::span<const unsigned char> payload);
28
29/* @brief This function will ask underlying NCSI driver
Ratan Guptabbe45792018-03-23 00:22:55 +053030 * to set a specific package or package/channel
31 * combination as the preferred choice.
32 * This function talks with the NCSI driver over
33 * netlink messages.
34 * @param[in] ifindex - Interface Index.
35 * @param[in] package - NCSI Package.
36 * @param[in] channel - Channel number with in the package.
37 * @returns 0 on success and negative value for failure.
38 */
39int setChannel(int ifindex, int package, int channel);
40
41/* @brief This function will ask underlying NCSI driver
42 * to clear any preferred setting from the given
43 * interface.
44 * This function talks with the NCSI driver over
45 * netlink messages.
46 * @param[in] ifindex - Interface Index.
47 * @returns 0 on success and negative value for failure.
48 */
49int clearInterface(int ifindex);
50
Ratan Guptaaac603e2018-03-23 00:25:54 +053051/* @brief This function is used to dump all the info
52 * of the package and the channels underlying
53 * the package.
54 * @param[in] ifindex - Interface Index.
55 * @param[in] package - NCSI Package.
56 * @returns 0 on success and negative value for failure.
57 */
58int getInfo(int ifindex, int package);
59
Gunnar Mills57d9c502018-09-14 14:42:34 -050060} // namespace ncsi
61} // namespace network
62} // namespace phosphor