diff mbox

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

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

Commit Message

Emmanuel Grumbach June 10, 2015, 1:49 p.m. UTC
From: Avri Altman <avri.altman@intel.com>

There are a few APs our there that advertise U-APSD
capabilities but don't implement it right which leads to
poor traffic. These APs don't support MIMO or don't even
support HT. Use this heuristic to detect them and disable
U-APSD accordingly.

Signed-off-by: Avri Altman <avri.altman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 net/mac80211/scan.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

Comments

Julian Calaby June 11, 2015, 3:55 a.m. UTC | #1
Hi Emmanuel / Avri,

On Wed, Jun 10, 2015 at 11:49 PM, Emmanuel Grumbach
<emmanuel.grumbach@intel.com> wrote:
> From: Avri Altman <avri.altman@intel.com>
>
> There are a few APs our there that advertise U-APSD
> capabilities but don't implement it right which leads to
> poor traffic. These APs don't support MIMO or don't even
> support HT. Use this heuristic to detect them and disable
> U-APSD accordingly.
>
> Signed-off-by: Avri Altman <avri.altman@intel.com>
> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
> ---
>  net/mac80211/scan.c | 25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
>
> diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
> index 7bb6a93..3791c8a 100644
> --- a/net/mac80211/scan.c
> +++ b/net/mac80211/scan.c
> @@ -39,6 +39,28 @@ void ieee80211_rx_bss_put(struct ieee80211_local *local,
>                          container_of((void *)bss, struct cfg80211_bss, priv));
>  }
>
> +/*
> + * An incompatible AP workaround:
> + * 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.
> + */
> +static bool broken_uapsd_workarounds(struct ieee802_11_elems *elems)

Would a better name for this function be something like
is_uapsd_broken()? We're not actually working around anything here,
just checking whether it's broken or not.

Thanks,
Altman, Avri June 11, 2015, 5:29 a.m. UTC | #2
-----Original Message-----
From: Julian Calaby [mailto:julian.calaby@gmail.com] 

Sent: Thursday, June 11, 2015 6:55 AM
To: Grumbach, Emmanuel
Cc: Johannes Berg; linux-wireless; Altman, Avri
Subject: Re: [PATCH] mac80211: Disable U-APSD if connected to a SISO or non-HT AP

Hi Emmanuel / Avri,

On Wed, Jun 10, 2015 at 11:49 PM, Emmanuel Grumbach
<emmanuel.grumbach@intel.com> wrote:
> From: Avri Altman <avri.altman@intel.com>

>

> There are a few APs our there that advertise U-APSD

> capabilities but don't implement it right which leads to

> poor traffic. These APs don't support MIMO or don't even

> support HT. Use this heuristic to detect them and disable

> U-APSD accordingly.

>

> Signed-off-by: Avri Altman <avri.altman@intel.com>

> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

> ---

>  net/mac80211/scan.c | 25 +++++++++++++++++++++++++

>  1 file changed, 25 insertions(+)

>

> diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c

> index 7bb6a93..3791c8a 100644

> --- a/net/mac80211/scan.c

> +++ b/net/mac80211/scan.c

> @@ -39,6 +39,28 @@ void ieee80211_rx_bss_put(struct ieee80211_local *local,

>                          container_of((void *)bss, struct cfg80211_bss, priv));

>  }

>

> +/*

> + * An incompatible AP workaround:

> + * 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.

> + */

> +static bool broken_uapsd_workarounds(struct ieee802_11_elems *elems)


Would a better name for this function be something like
is_uapsd_broken()? We're not actually working around anything here,
just checking whether it's broken or not.

[Altman, Avri] Yeah - well, originally this was not the name, but a previous reviewer asked me to changed it to "workaround something...".
Actually it is a workaround of, among others, the iPhone 4/4s when SoftAP, they don't raise the
TIM in its Beacon even if it has data for us, therefore traffic is stuck.
We would prefer to identify those devices via their OUI, but currently this is not well defined.



Thanks,

-- 
Julian Calaby

Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
---------------------------------------------------------------------
A member of the Intel Corporation group of companies

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
Julian Calaby June 11, 2015, 5:34 a.m. UTC | #3
Hi Avri,

On Thu, Jun 11, 2015 at 3:29 PM, Altman, Avri <avri.altman@intel.com> wrote:
>
>
> -----Original Message-----
> From: Julian Calaby [mailto:julian.calaby@gmail.com]
> Sent: Thursday, June 11, 2015 6:55 AM
> To: Grumbach, Emmanuel
> Cc: Johannes Berg; linux-wireless; Altman, Avri
> Subject: Re: [PATCH] mac80211: Disable U-APSD if connected to a SISO or non-HT AP
>
> Hi Emmanuel / Avri,
>
> On Wed, Jun 10, 2015 at 11:49 PM, Emmanuel Grumbach
> <emmanuel.grumbach@intel.com> wrote:
>> From: Avri Altman <avri.altman@intel.com>
>>
>> There are a few APs our there that advertise U-APSD
>> capabilities but don't implement it right which leads to
>> poor traffic. These APs don't support MIMO or don't even
>> support HT. Use this heuristic to detect them and disable
>> U-APSD accordingly.
>>
>> Signed-off-by: Avri Altman <avri.altman@intel.com>
>> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
>> ---
>>  net/mac80211/scan.c | 25 +++++++++++++++++++++++++
>>  1 file changed, 25 insertions(+)
>>
>> diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
>> index 7bb6a93..3791c8a 100644
>> --- a/net/mac80211/scan.c
>> +++ b/net/mac80211/scan.c
>> @@ -39,6 +39,28 @@ void ieee80211_rx_bss_put(struct ieee80211_local *local,
>>                          container_of((void *)bss, struct cfg80211_bss, priv));
>>  }
>>
>> +/*
>> + * An incompatible AP workaround:
>> + * 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.
>> + */
>> +static bool broken_uapsd_workarounds(struct ieee802_11_elems *elems)
>
> Would a better name for this function be something like
> is_uapsd_broken()? We're not actually working around anything here,
> just checking whether it's broken or not.
>
> [Altman, Avri] Yeah - well, originally this was not the name, but a previous reviewer asked me to changed it to "workaround something...".
> Actually it is a workaround of, among others, the iPhone 4/4s when SoftAP, they don't raise the
> TIM in its Beacon even if it has data for us, therefore traffic is stuck.
> We would prefer to identify those devices via their OUI, but currently this is not well defined.

Fair enough then.

As I see it, this isn't a workaround, it's just another test to ensure
that uapsd can be supported.

Thanks,
diff mbox

Patch

diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 7bb6a93..3791c8a 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -39,6 +39,28 @@  void ieee80211_rx_bss_put(struct ieee80211_local *local,
 			 container_of((void *)bss, struct cfg80211_bss, priv));
 }
 
+/*
+ * An incompatible AP workaround:
+ * 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.
+ */
+static bool broken_uapsd_workarounds(struct ieee802_11_elems *elems)
+{
+	int i;
+
+	/* iPhone 4/4s with this problem doesn't have ht_capa */
+	if (!elems->ht_cap_elem)
+		return true;
+
+	for (i = 1; i < 4; i++) {
+		if (elems->ht_cap_elem->mcs.rx_mask[i])
+			return false;
+	}
+
+	return true;
+}
+
 static bool is_uapsd_supported(struct ieee802_11_elems *elems)
 {
 	u8 qos_info;
@@ -53,6 +75,9 @@  static bool is_uapsd_supported(struct ieee802_11_elems *elems)
 		/* no valid wmm information or parameter element found */
 		return false;
 
+	if (broken_uapsd_workarounds(elems))
+		return false;
+
 	return qos_info & IEEE80211_WMM_IE_AP_QOSINFO_UAPSD;
 }