From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org,
Avri Altman <avri.altman@intel.com>,
Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Subject: [PATCH] mac80211: Disable U-APSD if connected to a SISO or non-HT AP
Date: Wed, 10 Jun 2015 16:49:40 +0300 [thread overview]
Message-ID: <1433944180-17321-1-git-send-email-emmanuel.grumbach@intel.com> (raw)
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)
+{
+ 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;
}
--
2.1.4
next reply other threads:[~2015-06-10 13:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-10 13:49 Emmanuel Grumbach [this message]
2015-06-11 3:55 ` [PATCH] mac80211: Disable U-APSD if connected to a SISO or non-HT AP Julian Calaby
2015-06-11 5:29 ` Altman, Avri
2015-06-11 5:34 ` Julian Calaby
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1433944180-17321-1-git-send-email-emmanuel.grumbach@intel.com \
--to=emmanuel.grumbach@intel.com \
--cc=avri.altman@intel.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).