mac80211: allow the driver to advertise A-MSDU within A-MPDU Rx support
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Sat, 15 Aug 2015 19:39:51 +0000 (22:39 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 22 Sep 2015 13:21:24 +0000 (15:21 +0200)
Drivers may be interested in receiving A-MSDU within A-MDPU.
Not all the devices may be able to do so, make it configurable.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/net/mac80211.h
net/mac80211/agg-rx.c
net/mac80211/debugfs.c

index f28cbc0988ebcb7f3f5d94bcfd7da23e37ac850d..d62d6f41548bd0e4ed60d9039fc3fa7c5e73d771 100644 (file)
@@ -1897,6 +1897,9 @@ struct ieee80211_txq {
  * @IEEE80211_HW_TDLS_WIDER_BW: The device/driver supports wider bandwidth
  *     than then BSS bandwidth for a TDLS link on the base channel.
  *
+ * @IEEE80211_HW_SUPPORTS_AMSDU_IN_AMPDU: The driver supports receiving A-MSDUs
+ *     within A-MPDU.
+ *
  * @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays
  */
 enum ieee80211_hw_flags {
@@ -1930,6 +1933,7 @@ enum ieee80211_hw_flags {
        IEEE80211_HW_SUPPORTS_CLONED_SKBS,
        IEEE80211_HW_SINGLE_SCAN_ON_ALL_BANDS,
        IEEE80211_HW_TDLS_WIDER_BW,
+       IEEE80211_HW_SUPPORTS_AMSDU_IN_AMPDU,
 
        /* keep last, obviously */
        NUM_IEEE80211_HW_FLAGS
index 6ebe8611eca56da6ec55c63d84c502b85ab3c150..10ad4ac1fa0ba8ebd04e793595fab47d326194ce 100644 (file)
@@ -189,6 +189,7 @@ static void ieee80211_send_addba_resp(struct ieee80211_sub_if_data *sdata, u8 *d
        struct ieee80211_local *local = sdata->local;
        struct sk_buff *skb;
        struct ieee80211_mgmt *mgmt;
+       bool amsdu = ieee80211_hw_check(&local->hw, SUPPORTS_AMSDU_IN_AMPDU);
        u16 capab;
 
        skb = dev_alloc_skb(sizeof(*mgmt) + local->hw.extra_tx_headroom);
@@ -217,7 +218,8 @@ static void ieee80211_send_addba_resp(struct ieee80211_sub_if_data *sdata, u8 *d
        mgmt->u.action.u.addba_resp.action_code = WLAN_ACTION_ADDBA_RESP;
        mgmt->u.action.u.addba_resp.dialog_token = dialog_token;
 
-       capab = (u16)(policy << 1);     /* bit 1 aggregation policy */
+       capab = (u16)(amsdu << 0);      /* bit 0 A-MSDU support */
+       capab |= (u16)(policy << 1);    /* bit 1 aggregation policy */
        capab |= (u16)(tid << 2);       /* bit 5:2 TID number */
        capab |= (u16)(buf_size << 6);  /* bit 15:6 max size of aggregation */
 
index ced6bf3be8d6cf5d3d9fc80b6c46f48c4e567aef..41726fd4bb789a2b1ae574845e2fe05e05425860 100644 (file)
@@ -123,6 +123,7 @@ static const char *hw_flag_names[NUM_IEEE80211_HW_FLAGS + 1] = {
        FLAG(SUPPORTS_CLONED_SKBS),
        FLAG(SINGLE_SCAN_ON_ALL_BANDS),
        FLAG(TDLS_WIDER_BW),
+       FLAG(SUPPORTS_AMSDU_IN_AMPDU),
 
        /* keep last for the build bug below */
        (void *)0x1