2011-01-12 12:40:40

by Luciano Coelho

[permalink] [raw]
Subject: [PATCH 1/2] mac80211: add hw configuration for max ampdu buffer size

From: Luciano Coelho <[email protected]>

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 <[email protected]>
---
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



2011-01-12 12:43:03

by Luciano Coelho

[permalink] [raw]
Subject: Re: [PATCH 1/2] mac80211: add hw configuration for max ampdu buffer size

On Wed, 2011-01-12 at 13:40 +0100, Coelho, Luciano wrote:
> From: Luciano Coelho <[email protected]>
>
> 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 <[email protected]>
> ---

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.


2011-01-12 12:57:35

by Juuso Oikarinen

[permalink] [raw]
Subject: Re: [PATCH 1/2] mac80211: add hw configuration for max ampdu buffer size

On Wed, 2011-01-12 at 14:40 +0200, ext [email protected] wrote:
> From: Luciano Coelho <[email protected]>
>
> 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 <[email protected]>
> ---

Tested-by: Juuso Oikarinen <[email protected]>

-Juuso


2011-01-12 12:40:39

by Luciano Coelho

[permalink] [raw]
Subject: [PATCH 2/2] wl12xx: add hw configuration for max supported AMDPU size

From: Luciano Coelho <[email protected]>

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 <[email protected]>
---
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


2011-01-12 13:05:00

by Luciano Coelho

[permalink] [raw]
Subject: Re: [PATCH 1/2] mac80211: add hw configuration for max ampdu buffer size

On Wed, 2011-01-12 at 13:57 +0100, Juuso Oikarinen wrote:
> On Wed, 2011-01-12 at 14:40 +0200, ext [email protected] wrote:
> > From: Luciano Coelho <[email protected]>
> >
> > 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 <[email protected]>
> > ---
>
> Tested-by: Juuso Oikarinen <[email protected]>

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

--
Cheers,
Luca.


2011-01-12 13:04:30

by Luciano Coelho

[permalink] [raw]
Subject: Re: [PATCH 1/2] mac80211: add hw configuration for max ampdu buffer size

On Wed, 2011-01-12 at 13:46 +0100, Johannes Berg wrote:
> On Wed, 2011-01-12 at 14:40 +0200, [email protected] wrote:
> > From: Luciano Coelho <[email protected]>
> >
> > 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 <[email protected]>
> > ---
> > 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.


2011-01-12 12:46:05

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH 1/2] mac80211: add hw configuration for max ampdu buffer size

On Wed, 2011-01-12 at 14:40 +0200, [email protected] wrote:
> From: Luciano Coelho <[email protected]>
>
> 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 <[email protected]>
> ---
> 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


2011-02-03 10:30:47

by Juuso Oikarinen

[permalink] [raw]
Subject: Re: [PATCH 1/2] mac80211: add hw configuration for max ampdu buffer size

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 [email protected] wrote:
> > > From: Luciano Coelho <[email protected]>
> > >
> > > 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 <[email protected]>
> > > ---
> >
> > Tested-by: Juuso Oikarinen <[email protected]>
>
> Thanks a lot for testing this for me, Juuso! I owe you one beer...
> hrmmm... coke!
>

Yeah, vanilla-coke even ;)

-Juuso