BACKPORT: nl80211: modify TID-config API

Make some changes to the TID-config API:
 * use u16 in nl80211 (only, and restrict to using 8 bits for now),
   to avoid issues in the future if we ever want to use higher TIDs.
 * reject empty TIDs mask (via netlink policy)
 * change feature advertising to not use extended feature flags but
   have own mechanism for this, which simplifies the code
 * fix all variable names from 'tid' to 'tids' since it's a mask
 * change to cfg80211_ name prefixes, not ieee80211_
 * fix some minor docs/spelling things.

Bug: 154782456
Change-Id: Ia234d464b3f914cdeab82f540e018855be580dce
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit 3710a8a6284f58a78ba4fe9c4b6672207636a223)
Signed-off-by: Vamsi Krishna <vamsin@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Johannes Berg 2020-02-24 11:34:25 +01:00 • committed by Greg Kroah-Hartman
commit dc58762f12
5 changed files with 121 additions and 94 deletions

View file

@ -267,20 +267,22 @@
/**
* DOC: TID configuration
*
* TID configuration support can be advertised by drivers by setting
* @NL80211_EXT_FEATURE_PER_TID_* and/or @NL80211_EXT_FEATURE_PER_STA_* config
* mentioned in &enum nl80211_tid_config_attr.
* Needed configuration parameters are mentioned in
* &enum nl80211_tid_config_attr and it will be passed using
* %NL80211_CMD_SET_TID_CONFIG through %NL80211_ATTR_TID_CONFIG.
* If the configuration needs to be applied for specific peer then MAC address
* of the peer needs to be passed in %NL80211_ATT_MAC, otherwise the
* TID config support can be checked in the %NL80211_ATTR_TID_CONFIG
* attribute given in wiphy capabilities.
*
* The necessary configuration parameters are mentioned in
* &enum nl80211_tid_config_attr and it will be passed to the
* %NL80211_CMD_SET_TID_CONFIG command in %NL80211_ATTR_TID_CONFIG.
*
* If the configuration needs to be applied for specific peer then the MAC
* address of the peer needs to be passed in %NL80211_ATTR_MAC, otherwise the
* configuration will be applied for all the connected peers in the vif except
* the peer which has peer specific configuration for the TID.
* And the peer specific configuration will be overridden if
* %NL80211_TID_CONFIG_ATTR_OVERRIDE flag is set.
* All this configurations are valid only for STA's current connection
* i.e. the configurations will be reset to default when the STA connects back
* any peers that have peer specific configuration for the TID by default; if
* the %NL80211_TID_CONFIG_ATTR_OVERRIDE flag is set, peer specific values
* will be overwritten.
*
* All this configuration is valid only for STA's current connection
* i.e. the configuration will be reset to default when the STA connects back
* after disconnection/roaming, and this configuration will be cleared when
* the interface goes down.
*/
@ -2428,7 +2430,9 @@ enum nl80211_commands {
* advertised for a specific interface type.
*
* @NL80211_ATTR_TID_CONFIG: TID specific configuration in a
* nested attribute with &enum nl80211_tid_config_attr sub-attributes.
* nested attribute with &enum nl80211_tid_config_attr sub-attributes;
* on output (in wiphy attributes) it contains only the feature sub-
* attributes.
*
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
* @NL80211_ATTR_MAX: highest attribute number currently defined
@ -4751,20 +4755,29 @@ enum nl80211_tid_config {
};
/* enum nl80211_tid_config_attr - TID specific configuration.
* @NL80211_TID_CONFIG_ATTR_PAD: pad attribute for 64-bit values
* @NL80211_TID_CONFIG_ATTR_VIF_SUPP: a bitmap (u64) of attributes supported
* for per-vif configuration; doesn't list the ones that are generic
* (%NL80211_TID_CONFIG_ATTR_TIDS, %NL80211_TID_CONFIG_ATTR_OVERRIDE).
* @NL80211_TID_CONFIG_ATTR_PEER_SUPP: same as the previous per-vif one, but
* per peer instead.
* @NL80211_TID_CONFIG_ATTR_OVERRIDE: flag attribue, if no peer
* is selected, if set indicates that the new configuration overrides
* all previous peer configurations, otherwise previous peer specific
* configurations should be left untouched. If peer is selected then
* it will reset particular TID configuration of that peer and it will
* not accept other TID config attributes along with peer.
* @NL80211_TID_CONFIG_ATTR_TIDS: a bitmask value of TIDs(bit 0 to 7)
* Its type is u8.
* @NL80211_TID_CONFIG_ATTR_TIDS: a bitmask value of TIDs (bit 0 to 7)
* Its type is u16.
* @NL80211_TID_CONFIG_ATTR_NOACK: Configure ack policy for the TID.
* specified in %NL80211_TID_CONFIG_ATTR_TID. see %enum nl80211_tid_config.
* Its type is u8.
*/
enum nl80211_tid_config_attr {
__NL80211_TID_CONFIG_ATTR_INVALID,
NL80211_TID_CONFIG_ATTR_PAD,
NL80211_TID_CONFIG_ATTR_VIF_SUPP,
NL80211_TID_CONFIG_ATTR_PEER_SUPP,
NL80211_TID_CONFIG_ATTR_OVERRIDE,
NL80211_TID_CONFIG_ATTR_TIDS,
NL80211_TID_CONFIG_ATTR_NOACK,
@ -5588,10 +5601,6 @@ enum nl80211_feature_flags {
* @NL80211_EXT_FEATURE_VLAN_OFFLOAD: The driver supports a single netdev
* with VLAN tagged frames and separate VLAN-specific netdevs added using
* vconfig similarly to the Ethernet case.
* @NL80211_EXT_FEATURE_PER_TID_NOACK_CONFIG: Driver supports per TID NoAck
* policy functionality.
* @NL80211_EXT_FEATURE_PER_STA_NOACK_CONFIG: Driver supports STA specific NoAck
* policy functionality.
*
* @NL80211_EXT_FEATURE_BEACON_PROTECTION: The driver supports Beacon protection
* and can receive key configuration for BIGTK using key indexes 6 and 7.
@ -5644,8 +5653,6 @@ enum nl80211_ext_feature_index {
NL80211_EXT_FEATURE_VLAN_OFFLOAD,
NL80211_EXT_FEATURE_AQL,
NL80211_EXT_FEATURE_BEACON_PROTECTION,
NL80211_EXT_FEATURE_PER_TID_NOACK_CONFIG,
NL80211_EXT_FEATURE_PER_STA_NOACK_CONFIG,
/* add new features before the definition below */
NUM_NL80211_EXT_FEATURES,