ieee80211: bump IEEE80211_MAX_AMPDU_BUF to support HE
authorJohannes Berg <johannes.berg@intel.com>
Mon, 18 Jun 2018 20:39:29 +0000 (22:39 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 18 Jun 2018 20:39:39 +0000 (22:39 +0200)
Bump the IEEE80211_MAX_AMPDU_BUF size to 0x100 for HE support
and - for now - use IEEE80211_MAX_AMPDU_BUF_HT everywhere.

This is derived from my internal patch, parts of which Luca
had sent upstream.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/realtek/rtlwifi/base.c
drivers/staging/rtl8188eu/include/wifi.h
drivers/staging/rtl8712/wifi.h
drivers/staging/rtl8723bs/include/wifi.h
drivers/staging/rtlwifi/base.c
include/linux/ieee80211.h
net/mac80211/agg-rx.c
net/mac80211/agg-tx.c
net/mac80211/ht.c
net/mac80211/main.c

index 39c817eddd78e9cf736fbbd440c6617867afad20..31bd6f714052c8fdff09e73b4bf0d5a50959b197 100644 (file)
@@ -1904,7 +1904,7 @@ void rtl_rx_ampdu_apply(struct rtl_priv *rtlpriv)
                 reject_agg, ctrl_agg_size, agg_size);
 
        rtlpriv->hw->max_rx_aggregation_subframes =
-               (ctrl_agg_size ? agg_size : IEEE80211_MAX_AMPDU_BUF);
+               (ctrl_agg_size ? agg_size : IEEE80211_MAX_AMPDU_BUF_HT);
 }
 EXPORT_SYMBOL(rtl_rx_ampdu_apply);
 
index 084a246eec19f8f457eb4dbafb53f0e3129347f3..6790b7c8cfb14f2e7a142dc6d4ec2b5dd3392634 100644 (file)
@@ -575,7 +575,6 @@ enum ht_cap_ampdu_factor {
  * According to IEEE802.11n spec size varies from 8K to 64K (in powers of 2)
  */
 #define IEEE80211_MIN_AMPDU_BUF 0x8
-#define IEEE80211_MAX_AMPDU_BUF 0x40
 
 
 #define OP_MODE_PURE                    0
index 0ed2f44ab4e958e0cb095081ccd13932cd09b284..00a4302e9983f985a6355302b151f69efb7572ec 100644 (file)
@@ -574,7 +574,6 @@ struct ieee80211_ht_addt_info {
  * According to IEEE802.11n spec size varies from 8K to 64K (in powers of 2)
  */
 #define IEEE80211_MIN_AMPDU_BUF 0x8
-#define IEEE80211_MAX_AMPDU_BUF 0x40
 
 
 /* Spatial Multiplexing Power Save Modes */
index 08bc79840b2373ce798fb31eae59bef70f0bbe7d..559bf2606fb7d932e20bac388de8c124f944a7a7 100644 (file)
@@ -799,7 +799,6 @@ enum HT_CAP_AMPDU_FACTOR {
  * According to IEEE802.11n spec size varies from 8K to 64K (in powers of 2)
  */
 #define IEEE80211_MIN_AMPDU_BUF 0x8
-#define IEEE80211_MAX_AMPDU_BUF 0x40
 
 
 /* Spatial Multiplexing Power Save Modes */
index e46e47d93d7d1f087e5fc1a80349f3e3b0637f67..094827c1879a656850613b501f2300777fc435e2 100644 (file)
@@ -1838,7 +1838,7 @@ void rtl_rx_ampdu_apply(struct rtl_priv *rtlpriv)
                 reject_agg, ctrl_agg_size, agg_size);
 
        rtlpriv->hw->max_rx_aggregation_subframes =
-               (ctrl_agg_size ? agg_size : IEEE80211_MAX_AMPDU_BUF);
+               (ctrl_agg_size ? agg_size : IEEE80211_MAX_AMPDU_BUF_HT);
 }
 
 /*********************************************************
index e6a6503bfa33c0a23761b175176ce6f06ebe541c..9c03a7d5e400df9f2853c60c9816c150c447d937 100644 (file)
@@ -1433,11 +1433,13 @@ struct ieee80211_ht_operation {
 #define IEEE80211_DELBA_PARAM_INITIATOR_MASK 0x0800
 
 /*
- * A-PMDU buffer sizes
- * According to IEEE802.11n spec size varies from 8K to 64K (in powers of 2)
+ * A-MPDU buffer sizes
+ * According to HT size varies from 8 to 64 frames
+ * HE adds the ability to have up to 256 frames.
  */
-#define IEEE80211_MIN_AMPDU_BUF 0x8
-#define IEEE80211_MAX_AMPDU_BUF 0x40
+#define IEEE80211_MIN_AMPDU_BUF                0x8
+#define IEEE80211_MAX_AMPDU_BUF_HT     0x40
+#define IEEE80211_MAX_AMPDU_BUF                0x100
 
 
 /* Spatial Multiplexing Power Save Modes (for capability) */
index e83c19d4c292e46fce243f60fdf77557096c2af6..3ffd853b483f8295ea9db62b70f0ae7da4c06a96 100644 (file)
@@ -274,7 +274,7 @@ void ___ieee80211_start_rx_ba_session(struct sta_info *sta,
        /* XXX: check own ht delayed BA capability?? */
        if (((ba_policy != 1) &&
             (!(sta->sta.ht_cap.cap & IEEE80211_HT_CAP_DELAY_BA))) ||
-           (buf_size > IEEE80211_MAX_AMPDU_BUF)) {
+           (buf_size > IEEE80211_MAX_AMPDU_BUF_HT)) {
                status = WLAN_STATUS_INVALID_QOS_PARAM;
                ht_dbg_ratelimited(sta->sdata,
                                   "AddBA Req with bad params from %pM on tid %u. policy %d, buffer size %d\n",
@@ -283,7 +283,7 @@ void ___ieee80211_start_rx_ba_session(struct sta_info *sta,
        }
        /* determine default buffer size */
        if (buf_size == 0)
-               buf_size = IEEE80211_MAX_AMPDU_BUF;
+               buf_size = IEEE80211_MAX_AMPDU_BUF_HT;
 
        /* make sure the size doesn't exceed the maximum supported by the hw */
        if (buf_size > sta->sta.max_rx_aggregation_subframes)
index ac4295296514365ad1972ddc22754be1cdb8384a..86c6bc0432babfc5c2d52e985ea87c4ea938a5b6 100644 (file)
@@ -514,7 +514,7 @@ void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
        /* send AddBA request */
        ieee80211_send_addba_request(sdata, sta->sta.addr, tid,
                                     tid_tx->dialog_token, params.ssn,
-                                    IEEE80211_MAX_AMPDU_BUF,
+                                    IEEE80211_MAX_AMPDU_BUF_HT,
                                     tid_tx->timeout);
 }
 
index 26a7ba3b698f1e94598350d3e03dd319d6ef10e2..f849ea814993f34d34e9485f6681659c4408d6c9 100644 (file)
@@ -352,7 +352,7 @@ void ieee80211_ba_session_work(struct work_struct *work)
                    test_and_clear_bit(tid,
                                       sta->ampdu_mlme.tid_rx_manage_offl))
                        ___ieee80211_start_rx_ba_session(sta, 0, 0, 0, 1, tid,
-                                                        IEEE80211_MAX_AMPDU_BUF,
+                                                        IEEE80211_MAX_AMPDU_BUF_HT,
                                                         false, true);
 
                if (test_and_clear_bit(tid + IEEE80211_NUM_TIDS,
index a6f8e3a646d4275503589c5f6da7c2a196501434..070f77862014e33f4ce24ce0d8540c7cc7717907 100644 (file)
@@ -597,8 +597,8 @@ struct ieee80211_hw *ieee80211_alloc_hw_nm(size_t priv_data_len,
        local->hw.queues = 1;
        local->hw.max_rates = 1;
        local->hw.max_report_rates = 0;
-       local->hw.max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF;
-       local->hw.max_tx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF;
+       local->hw.max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_HT;
+       local->hw.max_tx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_HT;
        local->hw.offchannel_tx_hw_queue = IEEE80211_INVAL_HW_QUEUE;
        local->hw.conf.long_frame_max_tx_count = wiphy->retry_long;
        local->hw.conf.short_frame_max_tx_count = wiphy->retry_short;