mac80211: add hw configuration for max ampdu buffer size
authorLuciano Coelho <coelho@ti.com>
Wed, 12 Jan 2011 13:26:30 +0000 (15:26 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 19 Jan 2011 16:36:09 +0000 (11:36 -0500)
Some devices don't support the maximum AMDPU buffer size of 64, so we
need to add an option to configure this in the hardware configuration.
This value will be used in the ADDBA response instead of the value
suggested in the request, if the latter is greater than the max
supported.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Tested-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
include/net/mac80211.h
net/mac80211/agg-rx.c
net/mac80211/main.c

index 62c0ce2..d024fc5 100644 (file)
@@ -1147,6 +1147,13 @@ enum ieee80211_hw_flags {
  * @napi_weight: weight used for NAPI polling.  You must specify an
  *     appropriate value here if a napi_poll operation is provided
  *     by your driver.
+
+ * @max_rx_aggregation_subframes: maximum buffer size (number of
+ *     sub-frames) to be used for A-MPDU block ack receiver
+ *     aggregation.
+ *     This is only relevant if the device has restrictions on the
+ *     number of subframes, if it relies on mac80211 to do reordering
+ *     it shouldn't be set.
  */
 struct ieee80211_hw {
        struct ieee80211_conf conf;
@@ -1165,6 +1172,7 @@ struct ieee80211_hw {
        u8 max_rates;
        u8 max_report_rates;
        u8 max_rate_tries;
+       u8 max_rx_aggregation_subframes;
 };
 
 /**
index f138b19..002db5e 100644 (file)
@@ -239,6 +239,9 @@ void ieee80211_process_addba_request(struct ieee80211_local *local,
                buf_size = buf_size << sband->ht_cap.ampdu_factor;
        }
 
+       /* make sure the size doesn't exceed the maximum supported by the hw */
+       if (buf_size > local->hw.max_rx_aggregation_subframes)
+               buf_size = local->hw.max_rx_aggregation_subframes;
 
        /* examine state machine */
        mutex_lock(&sta->ampdu_mlme.mtx);
index 485d36b..1c507c6 100644 (file)
@@ -552,6 +552,7 @@ struct ieee80211_hw *ieee80211_alloc_hw(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.conf.long_frame_max_tx_count = wiphy->retry_long;
        local->hw.conf.short_frame_max_tx_count = wiphy->retry_short;
        local->user_power_level = -1;