diff mbox

mac80211: Disable U-APSD if connected to a SISO AP

Message ID 1429559536-22907-1-git-send-email-emmanuel.grumbach@intel.com (mailing list archive)
State Changes Requested
Delegated to: Johannes Berg
Headers show

Commit Message

Emmanuel Grumbach April 20, 2015, 7:52 p.m. UTC
From: Avri Altman <avri.altman@intel.com>

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 <avri.altman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 net/mac80211/scan.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

Comments

Eliad Peller April 22, 2015, 7:37 a.m. UTC | #1
On Mon, Apr 20, 2015 at 10:52 PM, Emmanuel Grumbach
<emmanuel.grumbach@intel.com> wrote:
> From: Avri Altman <avri.altman@intel.com>
>
> 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 <avri.altman@intel.com>
> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
> ---
[...]

>  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.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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;
 }