mac80211: add support for parsing ADDBA_EXT IEs
authorJohn Crispin <john@phrozen.org>
Sat, 13 Jul 2019 16:36:41 +0000 (18:36 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 26 Jul 2019 11:32:07 +0000 (13:32 +0200)
ADDBA_EXT IEs can be used to negotiate the BA fragmentation level.

Signed-off-by: John Crispin <john@phrozen.org>
Link: https://lore.kernel.org/r/20190713163642.18491-2-john@phrozen.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/linux/ieee80211.h
net/mac80211/ieee80211_i.h
net/mac80211/util.c

index 8511fadc09354c601bf7d8e862d5be78406197f5..f36144eda5d6992510d063a985f553b5aeb8fc47 100644 (file)
@@ -881,6 +881,14 @@ struct ieee80211_tpc_report_ie {
        u8 link_margin;
 } __packed;
 
+#define IEEE80211_ADDBA_EXT_FRAG_LEVEL_MASK    GENMASK(2, 1)
+#define IEEE80211_ADDBA_EXT_FRAG_LEVEL_SHIFT   1
+#define IEEE80211_ADDBA_EXT_NO_FRAG            BIT(0)
+
+struct ieee80211_addba_ext_ie {
+       u8 data;
+} __packed;
+
 struct ieee80211_mgmt {
        __le16 frame_control;
        __le16 duration;
index 004e2e3adb88b1f483c393fc32932e6b4b960d59..c67da3575e741d84ee849bdffe3cc011fe636245 100644 (file)
@@ -1506,6 +1506,7 @@ struct ieee802_11_elems {
        u8 max_bssid_indicator;
        u8 dtim_count;
        u8 dtim_period;
+       const struct ieee80211_addba_ext_ie *addba_ext_ie;
 
        /* length of them, respectively */
        u8 ext_capab_len;
index 1b224fa27367fbf4ce7cc7385eb27f8051081704..3441558ef2d252b39b57f20b9fdffd9f29c84c76 100644 (file)
@@ -1200,6 +1200,13 @@ _ieee802_11_parse_elems_crc(const u8 *start, size_t len, bool action,
 
                        elems->cisco_dtpc_elem = pos;
                        break;
+               case WLAN_EID_ADDBA_EXT:
+                       if (elen != sizeof(struct ieee80211_addba_ext_ie)) {
+                               elem_parse_failed = true;
+                               break;
+                       }
+                       elems->addba_ext_ie = (void *)pos;
+                       break;
                case WLAN_EID_TIMEOUT_INTERVAL:
                        if (elen >= sizeof(struct ieee80211_timeout_interval_ie))
                                elems->timeout_int = (void *)pos;