2015-04-20 19:52:21

by Grumbach, Emmanuel

[permalink] [raw]
Subject: [PATCH] mac80211: Disable U-APSD if connected to a SISO AP

From: Avri Altman <[email protected]>

This concerns a bugy behavior of some APs, that advertise themselves
falsely as supporting U-APSD, but they don't which affects throughput.
It was detected in iPhones, but recently also with some Netgear models.
Those devices also advertise their capabilities as SISO, so use that
and disable U-APSD if connected to a SISO AP.

Signed-off-by: Avri Altman <[email protected]>
Signed-off-by: Emmanuel Grumbach <[email protected]>
---
net/mac80211/scan.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)

diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 7bb6a93..400ff62 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -42,6 +42,7 @@ void ieee80211_rx_bss_put(struct ieee80211_local *local,
static bool is_uapsd_supported(struct ieee802_11_elems *elems)
{
u8 qos_info;
+ int i;

if (elems->wmm_info && elems->wmm_info_len == 7
&& elems->wmm_info[5] == 1)
@@ -53,6 +54,22 @@ static bool is_uapsd_supported(struct ieee802_11_elems *elems)
/* no valid wmm information or parameter element found */
return false;

+ /*
+ * if the AP does not advertise MIMO capabilities -
+ * disable U-APSD. iPhones, among others, advertise themselves
+ * as U-APSD capable when they aren't. Avoid connecting to
+ * those devices in U-APSD enabled.
+ */
+ if (elems->parse_error || !elems->ht_cap_elem)
+ goto mimo;
+
+ for (i = 1; i < 4; i++) {
+ if (elems->ht_cap_elem->mcs.rx_mask[i])
+ goto mimo;
+ }
+ return false;
+
+mimo:
return qos_info & IEEE80211_WMM_IE_AP_QOSINFO_UAPSD;
}

--
2.1.0



2015-04-22 07:37:06

by Eliad Peller

[permalink] [raw]
Subject: Re: [PATCH] mac80211: Disable U-APSD if connected to a SISO AP

On Mon, Apr 20, 2015 at 10:52 PM, Emmanuel Grumbach
<[email protected]> wrote:
> From: Avri Altman <[email protected]>
>
> This concerns a bugy behavior of some APs, that advertise themselves
> falsely as supporting U-APSD, but they don't which affects throughput.
> It was detected in iPhones, but recently also with some Netgear models.
> Those devices also advertise their capabilities as SISO, so use that
> and disable U-APSD if connected to a SISO AP.
>
> Signed-off-by: Avri Altman <[email protected]>
> Signed-off-by: Emmanuel Grumbach <[email protected]>
> ---
[...]

> static bool is_uapsd_supported(struct ieee802_11_elems *elems)
> {
> u8 qos_info;
> + int i;
>
> if (elems->wmm_info && elems->wmm_info_len == 7
> && elems->wmm_info[5] == 1)
> @@ -53,6 +54,22 @@ static bool is_uapsd_supported(struct ieee802_11_elems *elems)
> /* no valid wmm information or parameter element found */
> return false;
>
> + /*
> + * if the AP does not advertise MIMO capabilities -
> + * disable U-APSD. iPhones, among others, advertise themselves
> + * as U-APSD capable when they aren't. Avoid connecting to
> + * those devices in U-APSD enabled.
> + */
> + if (elems->parse_error || !elems->ht_cap_elem)
> + goto mimo;
> +
> + for (i = 1; i < 4; i++) {
> + if (elems->ht_cap_elem->mcs.rx_mask[i])
> + goto mimo;
> + }
> + return false;
> +
> +mimo:
> return qos_info & IEEE80211_WMM_IE_AP_QOSINFO_UAPSD;
> }
this is pretty confusing, as MIMO really has nothing to do with uapsd.
i guess this is only some heuristics for "incompatible ap". better
move it into a new function with a name indicating that this is only a
workaround.
this will also improve the function flow, which became a bit weird
with this patch.

Eliad.