Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright Samuel Mendoza-Jonas, IBM Corporation 2018.
0003  *
0004  * This program is free software; you can redistribute it and/or modify
0005  * it under the terms of the GNU General Public License as published by
0006  * the Free Software Foundation; either version 2 of the License, or
0007  * (at your option) any later version.
0008  */
0009 
0010 #ifndef __UAPI_NCSI_NETLINK_H__
0011 #define __UAPI_NCSI_NETLINK_H__
0012 
0013 /**
0014  * enum ncsi_nl_commands - supported NCSI commands
0015  *
0016  * @NCSI_CMD_UNSPEC: unspecified command to catch errors
0017  * @NCSI_CMD_PKG_INFO: list package and channel attributes. Requires
0018  *  NCSI_ATTR_IFINDEX. If NCSI_ATTR_PACKAGE_ID is specified returns the
0019  *  specific package and its channels - otherwise a dump request returns
0020  *  all packages and their associated channels.
0021  * @NCSI_CMD_SET_INTERFACE: set preferred package and channel combination.
0022  *  Requires NCSI_ATTR_IFINDEX and the preferred NCSI_ATTR_PACKAGE_ID and
0023  *  optionally the preferred NCSI_ATTR_CHANNEL_ID.
0024  * @NCSI_CMD_CLEAR_INTERFACE: clear any preferred package/channel combination.
0025  *  Requires NCSI_ATTR_IFINDEX.
0026  * @NCSI_CMD_SEND_CMD: send NC-SI command to network card.
0027  *  Requires NCSI_ATTR_IFINDEX, NCSI_ATTR_PACKAGE_ID
0028  *  and NCSI_ATTR_CHANNEL_ID.
0029  * @NCSI_CMD_SET_PACKAGE_MASK: set a whitelist of allowed packages.
0030  *  Requires NCSI_ATTR_IFINDEX and NCSI_ATTR_PACKAGE_MASK.
0031  * @NCSI_CMD_SET_CHANNEL_MASK: set a whitelist of allowed channels.
0032  *  Requires NCSI_ATTR_IFINDEX, NCSI_ATTR_PACKAGE_ID, and
0033  *  NCSI_ATTR_CHANNEL_MASK. If NCSI_ATTR_CHANNEL_ID is present it sets
0034  *  the primary channel.
0035  * @NCSI_CMD_MAX: highest command number
0036  */
0037 enum ncsi_nl_commands {
0038     NCSI_CMD_UNSPEC,
0039     NCSI_CMD_PKG_INFO,
0040     NCSI_CMD_SET_INTERFACE,
0041     NCSI_CMD_CLEAR_INTERFACE,
0042     NCSI_CMD_SEND_CMD,
0043     NCSI_CMD_SET_PACKAGE_MASK,
0044     NCSI_CMD_SET_CHANNEL_MASK,
0045 
0046     __NCSI_CMD_AFTER_LAST,
0047     NCSI_CMD_MAX = __NCSI_CMD_AFTER_LAST - 1
0048 };
0049 
0050 /**
0051  * enum ncsi_nl_attrs - General NCSI netlink attributes
0052  *
0053  * @NCSI_ATTR_UNSPEC: unspecified attributes to catch errors
0054  * @NCSI_ATTR_IFINDEX: ifindex of network device using NCSI
0055  * @NCSI_ATTR_PACKAGE_LIST: nested array of NCSI_PKG_ATTR attributes
0056  * @NCSI_ATTR_PACKAGE_ID: package ID
0057  * @NCSI_ATTR_CHANNEL_ID: channel ID
0058  * @NCSI_ATTR_DATA: command payload
0059  * @NCSI_ATTR_MULTI_FLAG: flag to signal that multi-mode should be enabled with
0060  *  NCSI_CMD_SET_PACKAGE_MASK or NCSI_CMD_SET_CHANNEL_MASK.
0061  * @NCSI_ATTR_PACKAGE_MASK: 32-bit mask of allowed packages.
0062  * @NCSI_ATTR_CHANNEL_MASK: 32-bit mask of allowed channels.
0063  * @NCSI_ATTR_MAX: highest attribute number
0064  */
0065 enum ncsi_nl_attrs {
0066     NCSI_ATTR_UNSPEC,
0067     NCSI_ATTR_IFINDEX,
0068     NCSI_ATTR_PACKAGE_LIST,
0069     NCSI_ATTR_PACKAGE_ID,
0070     NCSI_ATTR_CHANNEL_ID,
0071     NCSI_ATTR_DATA,
0072     NCSI_ATTR_MULTI_FLAG,
0073     NCSI_ATTR_PACKAGE_MASK,
0074     NCSI_ATTR_CHANNEL_MASK,
0075 
0076     __NCSI_ATTR_AFTER_LAST,
0077     NCSI_ATTR_MAX = __NCSI_ATTR_AFTER_LAST - 1
0078 };
0079 
0080 /**
0081  * enum ncsi_nl_pkg_attrs - NCSI netlink package-specific attributes
0082  *
0083  * @NCSI_PKG_ATTR_UNSPEC: unspecified attributes to catch errors
0084  * @NCSI_PKG_ATTR: nested array of package attributes
0085  * @NCSI_PKG_ATTR_ID: package ID
0086  * @NCSI_PKG_ATTR_FORCED: flag signifying a package has been set as preferred
0087  * @NCSI_PKG_ATTR_CHANNEL_LIST: nested array of NCSI_CHANNEL_ATTR attributes
0088  * @NCSI_PKG_ATTR_MAX: highest attribute number
0089  */
0090 enum ncsi_nl_pkg_attrs {
0091     NCSI_PKG_ATTR_UNSPEC,
0092     NCSI_PKG_ATTR,
0093     NCSI_PKG_ATTR_ID,
0094     NCSI_PKG_ATTR_FORCED,
0095     NCSI_PKG_ATTR_CHANNEL_LIST,
0096 
0097     __NCSI_PKG_ATTR_AFTER_LAST,
0098     NCSI_PKG_ATTR_MAX = __NCSI_PKG_ATTR_AFTER_LAST - 1
0099 };
0100 
0101 /**
0102  * enum ncsi_nl_channel_attrs - NCSI netlink channel-specific attributes
0103  *
0104  * @NCSI_CHANNEL_ATTR_UNSPEC: unspecified attributes to catch errors
0105  * @NCSI_CHANNEL_ATTR: nested array of channel attributes
0106  * @NCSI_CHANNEL_ATTR_ID: channel ID
0107  * @NCSI_CHANNEL_ATTR_VERSION_MAJOR: channel major version number
0108  * @NCSI_CHANNEL_ATTR_VERSION_MINOR: channel minor version number
0109  * @NCSI_CHANNEL_ATTR_VERSION_STR: channel version string
0110  * @NCSI_CHANNEL_ATTR_LINK_STATE: channel link state flags
0111  * @NCSI_CHANNEL_ATTR_ACTIVE: channels with this flag are in
0112  *  NCSI_CHANNEL_ACTIVE state
0113  * @NCSI_CHANNEL_ATTR_FORCED: flag signifying a channel has been set as
0114  *  preferred
0115  * @NCSI_CHANNEL_ATTR_VLAN_LIST: nested array of NCSI_CHANNEL_ATTR_VLAN_IDs
0116  * @NCSI_CHANNEL_ATTR_VLAN_ID: VLAN ID being filtered on this channel
0117  * @NCSI_CHANNEL_ATTR_MAX: highest attribute number
0118  */
0119 enum ncsi_nl_channel_attrs {
0120     NCSI_CHANNEL_ATTR_UNSPEC,
0121     NCSI_CHANNEL_ATTR,
0122     NCSI_CHANNEL_ATTR_ID,
0123     NCSI_CHANNEL_ATTR_VERSION_MAJOR,
0124     NCSI_CHANNEL_ATTR_VERSION_MINOR,
0125     NCSI_CHANNEL_ATTR_VERSION_STR,
0126     NCSI_CHANNEL_ATTR_LINK_STATE,
0127     NCSI_CHANNEL_ATTR_ACTIVE,
0128     NCSI_CHANNEL_ATTR_FORCED,
0129     NCSI_CHANNEL_ATTR_VLAN_LIST,
0130     NCSI_CHANNEL_ATTR_VLAN_ID,
0131 
0132     __NCSI_CHANNEL_ATTR_AFTER_LAST,
0133     NCSI_CHANNEL_ATTR_MAX = __NCSI_CHANNEL_ATTR_AFTER_LAST - 1
0134 };
0135 
0136 #endif /* __UAPI_NCSI_NETLINK_H__ */