Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cfg80211: make WMM TSPEC support flag an nl80211 feature flag

During the review of the corresponding wpa_supplicant patches we
noticed that the only way for it to detect that this functionality
is supported currently is to check for the command support. This
can be misleading though, as the command was also designed to, in
the future, support pure 802.11 TSPECs.

Expose the WMM-TSPEC feature flag to nl80211 so later we can also
expose an 802.11-TSPEC feature flag (if needed) to differentiate
the two cases.

Note: this change isn't needed in 3.18 as there's no driver there
yet that supports the functionality at all.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>

+12 -13
+1 -5
include/net/cfg80211.h
··· 2646 2646 * @WIPHY_FLAG_SUPPORTS_5_10_MHZ: Device supports 5 MHz and 10 MHz channels. 2647 2647 * @WIPHY_FLAG_HAS_CHANNEL_SWITCH: Device supports channel switch in 2648 2648 * beaconing mode (AP, IBSS, Mesh, ...). 2649 - * @WIPHY_FLAG_SUPPORTS_WMM_ADMISSION: the device supports setting up WMM 2650 - * TSPEC sessions (TID aka TSID 0-7) with the NL80211_CMD_ADD_TX_TS 2651 - * command. Standard IEEE 802.11 TSPEC setup is not yet supported, it 2652 - * needs to be able to handle Block-Ack agreements and other things. 2653 2649 */ 2654 2650 enum wiphy_flags { 2655 - WIPHY_FLAG_SUPPORTS_WMM_ADMISSION = BIT(0), 2651 + /* use hole at 0 */ 2656 2652 /* use hole at 1 */ 2657 2653 /* use hole at 2 */ 2658 2654 WIPHY_FLAG_NETNS_OK = BIT(3),
+5
include/uapi/linux/nl80211.h
··· 4052 4052 * multiplexing powersave, ie. can turn off all but one chain 4053 4053 * and then wake the rest up as required after, for example, 4054 4054 * rts/cts handshake. 4055 + * @NL80211_FEATURE_SUPPORTS_WMM_ADMISSION: the device supports setting up WMM 4056 + * TSPEC sessions (TID aka TSID 0-7) with the %NL80211_CMD_ADD_TX_TS 4057 + * command. Standard IEEE 802.11 TSPEC setup is not yet supported, it 4058 + * needs to be able to handle Block-Ack agreements and other things. 4055 4059 */ 4056 4060 enum nl80211_feature_flags { 4057 4061 NL80211_FEATURE_SK_TX_STATUS = 1 << 0, ··· 4084 4080 NL80211_FEATURE_ACKTO_ESTIMATION = 1 << 23, 4085 4081 NL80211_FEATURE_STATIC_SMPS = 1 << 24, 4086 4082 NL80211_FEATURE_DYNAMIC_SMPS = 1 << 25, 4083 + NL80211_FEATURE_SUPPORTS_WMM_ADMISSION = 1 << 26, 4087 4084 }; 4088 4085 4089 4086 /**
+6 -8
net/wireless/nl80211.c
··· 1514 1514 if (rdev->wiphy.flags & WIPHY_FLAG_HAS_CHANNEL_SWITCH) 1515 1515 CMD(channel_switch, CHANNEL_SWITCH); 1516 1516 CMD(set_qos_map, SET_QOS_MAP); 1517 - if (rdev->wiphy.flags & 1518 - WIPHY_FLAG_SUPPORTS_WMM_ADMISSION) 1517 + if (rdev->wiphy.features & 1518 + NL80211_FEATURE_SUPPORTS_WMM_ADMISSION) 1519 1519 CMD(add_tx_ts, ADD_TX_TS); 1520 1520 } 1521 1521 /* add into the if now */ ··· 9557 9557 u16 admitted_time = 0; 9558 9558 int err; 9559 9559 9560 - if (!(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_WMM_ADMISSION)) 9560 + if (!(rdev->wiphy.features & NL80211_FEATURE_SUPPORTS_WMM_ADMISSION)) 9561 9561 return -EOPNOTSUPP; 9562 9562 9563 9563 if (!info->attrs[NL80211_ATTR_TSID] || !info->attrs[NL80211_ATTR_MAC] || ··· 9573 9573 return -EINVAL; 9574 9574 9575 9575 /* WMM uses TIDs 0-7 even for TSPEC */ 9576 - if (tsid < IEEE80211_FIRST_TSPEC_TSID) { 9577 - if (!(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_WMM_ADMISSION)) 9578 - return -EINVAL; 9579 - } else { 9576 + if (tsid >= IEEE80211_FIRST_TSPEC_TSID) { 9580 9577 /* TODO: handle 802.11 TSPEC/admission control 9581 - * need more attributes for that (e.g. BA session requirement) 9578 + * need more attributes for that (e.g. BA session requirement); 9579 + * change the WMM adminssion test above to allow both then 9582 9580 */ 9583 9581 return -EINVAL; 9584 9582 }