linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mac80211: add hw configuration for max ampdu buffer size
@ 2011-01-12 12:40 coelho
  2011-01-12 12:40 ` [PATCH 2/2] wl12xx: add hw configuration for max supported AMDPU size coelho
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: coelho @ 2011-01-12 12:40 UTC (permalink / raw)
  To: linux-wireless; +Cc: juuso.oikarinen

From: Luciano Coelho <coelho@ti.com>

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>
---
 include/net/mac80211.h |    4 ++++
 net/mac80211/agg-rx.c  |    3 +++
 net/mac80211/main.c    |    1 +
 3 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 5b3fd5a..1341d82 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1143,6 +1143,9 @@ 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.
  */
 struct ieee80211_hw {
 	struct ieee80211_conf conf;
@@ -1161,6 +1164,7 @@ struct ieee80211_hw {
 	u8 max_rates;
 	u8 max_report_rates;
 	u8 max_rate_tries;
+	u8 max_rx_aggregation_subframes;
 };
 
 /**
diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c
index f138b19..002db5e 100644
--- a/net/mac80211/agg-rx.c
+++ b/net/mac80211/agg-rx.c
@@ -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);
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 485d36b..1c507c6 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -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;
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] wl12xx: add hw configuration for max supported AMDPU size
  2011-01-12 12:40 [PATCH 1/2] mac80211: add hw configuration for max ampdu buffer size coelho
@ 2011-01-12 12:40 ` coelho
  2011-01-12 12:43 ` [PATCH 1/2] mac80211: add hw configuration for max ampdu buffer size Luciano Coelho
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: coelho @ 2011-01-12 12:40 UTC (permalink / raw)
  To: linux-wireless; +Cc: juuso.oikarinen

From: Luciano Coelho <coelho@ti.com>

The wl12xx chips do the AMDPU aggregation work in the firmware, but it
supports a maximum of 8 frames per block.  Configure the mac80211 hw
structure accordingly.

Signed-off-by: Luciano Coelho <coelho@ti.com>
---
 drivers/net/wireless/wl12xx/main.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 67732ea..463d6bf 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -3178,6 +3178,8 @@ int wl1271_init_ieee80211(struct wl1271 *wl)
 
 	wl->hw->sta_data_size = sizeof(struct wl1271_station);
 
+	wl->hw->max_rx_aggregation_subframes = 8;
+
 	return 0;
 }
 EXPORT_SYMBOL_GPL(wl1271_init_ieee80211);
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] mac80211: add hw configuration for max ampdu buffer size
  2011-01-12 12:40 [PATCH 1/2] mac80211: add hw configuration for max ampdu buffer size coelho
  2011-01-12 12:40 ` [PATCH 2/2] wl12xx: add hw configuration for max supported AMDPU size coelho
@ 2011-01-12 12:43 ` Luciano Coelho
  2011-01-12 12:46 ` Johannes Berg
  2011-01-12 12:57 ` Juuso Oikarinen
  3 siblings, 0 replies; 8+ messages in thread
From: Luciano Coelho @ 2011-01-12 12:43 UTC (permalink / raw)
  To: linux-wireless@vger.kernel.org; +Cc: juuso.oikarinen@nokia.com

On Wed, 2011-01-12 at 13:40 +0100, Coelho, Luciano wrote:
> From: Luciano Coelho <coelho@ti.com>
> 
> 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>
> ---

This has not been tested, so it should probably have been sent as RFC.
Juuso is testing it at the moment (I think ;).


-- 
Cheers,
Luca.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] mac80211: add hw configuration for max ampdu buffer size
  2011-01-12 12:40 [PATCH 1/2] mac80211: add hw configuration for max ampdu buffer size coelho
  2011-01-12 12:40 ` [PATCH 2/2] wl12xx: add hw configuration for max supported AMDPU size coelho
  2011-01-12 12:43 ` [PATCH 1/2] mac80211: add hw configuration for max ampdu buffer size Luciano Coelho
@ 2011-01-12 12:46 ` Johannes Berg
  2011-01-12 13:04   ` Luciano Coelho
  2011-01-12 12:57 ` Juuso Oikarinen
  3 siblings, 1 reply; 8+ messages in thread
From: Johannes Berg @ 2011-01-12 12:46 UTC (permalink / raw)
  To: coelho; +Cc: linux-wireless, juuso.oikarinen

On Wed, 2011-01-12 at 14:40 +0200, coelho@ti.com wrote:
> From: Luciano Coelho <coelho@ti.com>
> 
> 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>
> ---
>  include/net/mac80211.h |    4 ++++
>  net/mac80211/agg-rx.c  |    3 +++
>  net/mac80211/main.c    |    1 +
>  3 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/include/net/mac80211.h b/include/net/mac80211.h
> index 5b3fd5a..1341d82 100644
> --- a/include/net/mac80211.h
> +++ b/include/net/mac80211.h
> @@ -1143,6 +1143,9 @@ 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." maybe?

johannes


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] mac80211: add hw configuration for max ampdu buffer size
  2011-01-12 12:40 [PATCH 1/2] mac80211: add hw configuration for max ampdu buffer size coelho
                   ` (2 preceding siblings ...)
  2011-01-12 12:46 ` Johannes Berg
@ 2011-01-12 12:57 ` Juuso Oikarinen
  2011-01-12 13:05   ` Luciano Coelho
  3 siblings, 1 reply; 8+ messages in thread
From: Juuso Oikarinen @ 2011-01-12 12:57 UTC (permalink / raw)
  To: ext coelho@ti.com; +Cc: linux-wireless

On Wed, 2011-01-12 at 14:40 +0200, ext coelho@ti.com wrote:
> From: Luciano Coelho <coelho@ti.com>
> 
> 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>

-Juuso


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] mac80211: add hw configuration for max ampdu buffer size
  2011-01-12 12:46 ` Johannes Berg
@ 2011-01-12 13:04   ` Luciano Coelho
  0 siblings, 0 replies; 8+ messages in thread
From: Luciano Coelho @ 2011-01-12 13:04 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless@vger.kernel.org, juuso.oikarinen@nokia.com

On Wed, 2011-01-12 at 13:46 +0100, Johannes Berg wrote:
> On Wed, 2011-01-12 at 14:40 +0200, coelho@ti.com wrote:
> > From: Luciano Coelho <coelho@ti.com>
> > 
> > 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>
> > ---
> >  include/net/mac80211.h |    4 ++++
> >  net/mac80211/agg-rx.c  |    3 +++
> >  net/mac80211/main.c    |    1 +
> >  3 files changed, 8 insertions(+), 0 deletions(-)
> > 
> > diff --git a/include/net/mac80211.h b/include/net/mac80211.h
> > index 5b3fd5a..1341d82 100644
> > --- a/include/net/mac80211.h
> > +++ b/include/net/mac80211.h
> > @@ -1143,6 +1143,9 @@ 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." maybe?

Yes, this makes it clearer.  Thanks! I'll add it.

-- 
Cheers,
Luca.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] mac80211: add hw configuration for max ampdu buffer size
  2011-01-12 12:57 ` Juuso Oikarinen
@ 2011-01-12 13:05   ` Luciano Coelho
  2011-01-12 13:10     ` Juuso Oikarinen
  0 siblings, 1 reply; 8+ messages in thread
From: Luciano Coelho @ 2011-01-12 13:05 UTC (permalink / raw)
  To: Juuso Oikarinen; +Cc: linux-wireless@vger.kernel.org

On Wed, 2011-01-12 at 13:57 +0100, Juuso Oikarinen wrote:
> On Wed, 2011-01-12 at 14:40 +0200, ext coelho@ti.com wrote:
> > From: Luciano Coelho <coelho@ti.com>
> > 
> > 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>

Thanks a lot for testing this for me, Juuso! I owe you one beer...
hrmmm... coke!

-- 
Cheers,
Luca.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] mac80211: add hw configuration for max ampdu buffer size
  2011-01-12 13:05   ` Luciano Coelho
@ 2011-01-12 13:10     ` Juuso Oikarinen
  0 siblings, 0 replies; 8+ messages in thread
From: Juuso Oikarinen @ 2011-01-12 13:10 UTC (permalink / raw)
  To: ext Luciano Coelho; +Cc: linux-wireless@vger.kernel.org

On Wed, 2011-01-12 at 15:05 +0200, ext Luciano Coelho wrote:
> On Wed, 2011-01-12 at 13:57 +0100, Juuso Oikarinen wrote:
> > On Wed, 2011-01-12 at 14:40 +0200, ext coelho@ti.com wrote:
> > > From: Luciano Coelho <coelho@ti.com>
> > > 
> > > 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>
> 
> Thanks a lot for testing this for me, Juuso! I owe you one beer...
> hrmmm... coke!
> 

Yeah, vanilla-coke even ;)

-Juuso


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-02-03 10:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-12 12:40 [PATCH 1/2] mac80211: add hw configuration for max ampdu buffer size coelho
2011-01-12 12:40 ` [PATCH 2/2] wl12xx: add hw configuration for max supported AMDPU size coelho
2011-01-12 12:43 ` [PATCH 1/2] mac80211: add hw configuration for max ampdu buffer size Luciano Coelho
2011-01-12 12:46 ` Johannes Berg
2011-01-12 13:04   ` Luciano Coelho
2011-01-12 12:57 ` Juuso Oikarinen
2011-01-12 13:05   ` Luciano Coelho
2011-01-12 13:10     ` Juuso Oikarinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).