brintos

brintos / linux-shallow public Read only

0
0
Text · 4.7 KiB · a3f87c5 Raw
137 lines · c
1/*2 * Copyright Samuel Mendoza-Jonas, IBM Corporation 2018.3 *4 * This program is free software; you can redistribute it and/or modify5 * it under the terms of the GNU General Public License as published by6 * the Free Software Foundation; either version 2 of the License, or7 * (at your option) any later version.8 */9 10#ifndef __UAPI_NCSI_NETLINK_H__11#define __UAPI_NCSI_NETLINK_H__12 13/**14 * enum ncsi_nl_commands - supported NCSI commands15 *16 * @NCSI_CMD_UNSPEC: unspecified command to catch errors17 * @NCSI_CMD_PKG_INFO: list package and channel attributes. Requires18 *	NCSI_ATTR_IFINDEX. If NCSI_ATTR_PACKAGE_ID is specified returns the19 *	specific package and its channels - otherwise a dump request returns20 *	all packages and their associated channels.21 * @NCSI_CMD_SET_INTERFACE: set preferred package and channel combination.22 *	Requires NCSI_ATTR_IFINDEX and the preferred NCSI_ATTR_PACKAGE_ID and23 *	optionally the preferred NCSI_ATTR_CHANNEL_ID.24 * @NCSI_CMD_CLEAR_INTERFACE: clear any preferred package/channel combination.25 *	Requires NCSI_ATTR_IFINDEX.26 * @NCSI_CMD_SEND_CMD: send NC-SI command to network card.27 *	Requires NCSI_ATTR_IFINDEX, NCSI_ATTR_PACKAGE_ID28 *	and NCSI_ATTR_CHANNEL_ID.29 * @NCSI_CMD_SET_PACKAGE_MASK: set a whitelist of allowed packages.30 *	Requires NCSI_ATTR_IFINDEX and NCSI_ATTR_PACKAGE_MASK.31 * @NCSI_CMD_SET_CHANNEL_MASK: set a whitelist of allowed channels.32 *	Requires NCSI_ATTR_IFINDEX, NCSI_ATTR_PACKAGE_ID, and33 *	NCSI_ATTR_CHANNEL_MASK. If NCSI_ATTR_CHANNEL_ID is present it sets34 *	the primary channel.35 * @NCSI_CMD_MAX: highest command number36 */37enum ncsi_nl_commands {38	NCSI_CMD_UNSPEC,39	NCSI_CMD_PKG_INFO,40	NCSI_CMD_SET_INTERFACE,41	NCSI_CMD_CLEAR_INTERFACE,42	NCSI_CMD_SEND_CMD,43	NCSI_CMD_SET_PACKAGE_MASK,44	NCSI_CMD_SET_CHANNEL_MASK,45 46	__NCSI_CMD_AFTER_LAST,47	NCSI_CMD_MAX = __NCSI_CMD_AFTER_LAST - 148};49 50/**51 * enum ncsi_nl_attrs - General NCSI netlink attributes52 *53 * @NCSI_ATTR_UNSPEC: unspecified attributes to catch errors54 * @NCSI_ATTR_IFINDEX: ifindex of network device using NCSI55 * @NCSI_ATTR_PACKAGE_LIST: nested array of NCSI_PKG_ATTR attributes56 * @NCSI_ATTR_PACKAGE_ID: package ID57 * @NCSI_ATTR_CHANNEL_ID: channel ID58 * @NCSI_ATTR_DATA: command payload59 * @NCSI_ATTR_MULTI_FLAG: flag to signal that multi-mode should be enabled with60 *	NCSI_CMD_SET_PACKAGE_MASK or NCSI_CMD_SET_CHANNEL_MASK.61 * @NCSI_ATTR_PACKAGE_MASK: 32-bit mask of allowed packages.62 * @NCSI_ATTR_CHANNEL_MASK: 32-bit mask of allowed channels.63 * @NCSI_ATTR_MAX: highest attribute number64 */65enum ncsi_nl_attrs {66	NCSI_ATTR_UNSPEC,67	NCSI_ATTR_IFINDEX,68	NCSI_ATTR_PACKAGE_LIST,69	NCSI_ATTR_PACKAGE_ID,70	NCSI_ATTR_CHANNEL_ID,71	NCSI_ATTR_DATA,72	NCSI_ATTR_MULTI_FLAG,73	NCSI_ATTR_PACKAGE_MASK,74	NCSI_ATTR_CHANNEL_MASK,75 76	__NCSI_ATTR_AFTER_LAST,77	NCSI_ATTR_MAX = __NCSI_ATTR_AFTER_LAST - 178};79 80/**81 * enum ncsi_nl_pkg_attrs - NCSI netlink package-specific attributes82 *83 * @NCSI_PKG_ATTR_UNSPEC: unspecified attributes to catch errors84 * @NCSI_PKG_ATTR: nested array of package attributes85 * @NCSI_PKG_ATTR_ID: package ID86 * @NCSI_PKG_ATTR_FORCED: flag signifying a package has been set as preferred87 * @NCSI_PKG_ATTR_CHANNEL_LIST: nested array of NCSI_CHANNEL_ATTR attributes88 * @NCSI_PKG_ATTR_MAX: highest attribute number89 */90enum ncsi_nl_pkg_attrs {91	NCSI_PKG_ATTR_UNSPEC,92	NCSI_PKG_ATTR,93	NCSI_PKG_ATTR_ID,94	NCSI_PKG_ATTR_FORCED,95	NCSI_PKG_ATTR_CHANNEL_LIST,96 97	__NCSI_PKG_ATTR_AFTER_LAST,98	NCSI_PKG_ATTR_MAX = __NCSI_PKG_ATTR_AFTER_LAST - 199};100 101/**102 * enum ncsi_nl_channel_attrs - NCSI netlink channel-specific attributes103 *104 * @NCSI_CHANNEL_ATTR_UNSPEC: unspecified attributes to catch errors105 * @NCSI_CHANNEL_ATTR: nested array of channel attributes106 * @NCSI_CHANNEL_ATTR_ID: channel ID107 * @NCSI_CHANNEL_ATTR_VERSION_MAJOR: channel major version number108 * @NCSI_CHANNEL_ATTR_VERSION_MINOR: channel minor version number109 * @NCSI_CHANNEL_ATTR_VERSION_STR: channel version string110 * @NCSI_CHANNEL_ATTR_LINK_STATE: channel link state flags111 * @NCSI_CHANNEL_ATTR_ACTIVE: channels with this flag are in112 *	NCSI_CHANNEL_ACTIVE state113 * @NCSI_CHANNEL_ATTR_FORCED: flag signifying a channel has been set as114 *	preferred115 * @NCSI_CHANNEL_ATTR_VLAN_LIST: nested array of NCSI_CHANNEL_ATTR_VLAN_IDs116 * @NCSI_CHANNEL_ATTR_VLAN_ID: VLAN ID being filtered on this channel117 * @NCSI_CHANNEL_ATTR_MAX: highest attribute number118 */119enum ncsi_nl_channel_attrs {120	NCSI_CHANNEL_ATTR_UNSPEC,121	NCSI_CHANNEL_ATTR,122	NCSI_CHANNEL_ATTR_ID,123	NCSI_CHANNEL_ATTR_VERSION_MAJOR,124	NCSI_CHANNEL_ATTR_VERSION_MINOR,125	NCSI_CHANNEL_ATTR_VERSION_STR,126	NCSI_CHANNEL_ATTR_LINK_STATE,127	NCSI_CHANNEL_ATTR_ACTIVE,128	NCSI_CHANNEL_ATTR_FORCED,129	NCSI_CHANNEL_ATTR_VLAN_LIST,130	NCSI_CHANNEL_ATTR_VLAN_ID,131 132	__NCSI_CHANNEL_ATTR_AFTER_LAST,133	NCSI_CHANNEL_ATTR_MAX = __NCSI_CHANNEL_ATTR_AFTER_LAST - 1134};135 136#endif /* __UAPI_NCSI_NETLINK_H__ */137