From patchwork Wed Dec 10 12:31:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 5468791 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 975DBBEEBA for ; Wed, 10 Dec 2014 12:45:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BD9A42010B for ; Wed, 10 Dec 2014 12:45:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ED89A20160 for ; Wed, 10 Dec 2014 12:45:21 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XygdL-00081n-Jl; Wed, 10 Dec 2014 12:44:47 +0000 Received: from mail-wi0-x22e.google.com ([2a00:1450:400c:c05::22e]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XygdH-0007vw-Rw for ath10k@lists.infradead.org; Wed, 10 Dec 2014 12:44:44 +0000 Received: by mail-wi0-f174.google.com with SMTP id h11so11093129wiw.1 for ; Wed, 10 Dec 2014 04:44:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2FyAIZuKekQv+fGFapuZQYtIhKQTSP6tmlEE9LHI+yo=; b=1TPGoJWPoww1gkK1q3r4ldgCrCkHyJE8x4hH5FnHOs0dcbfTRVzkyf6YGosMeQvo2u xG8/+5A5z46VV5m8aMyJoA00Heb+dxxHemXazVYcgyu4xBfBSGgUjHyRJnVKqZMvn3sG ho7+zr5riJGi5YWinBqB9PWgaqL/HmpotGJlE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2FyAIZuKekQv+fGFapuZQYtIhKQTSP6tmlEE9LHI+yo=; b=cLZDINLeM/w1DRG04mqBhiazj+uXy7ksZdkhJtTjiJM/oi/3jdPhSFycqixQWFawlK gyWUMq4WGSR8rjDqSdi4yuaizTYnjqPnSzqwRytCR3IqFbjhUoPSHXmCCpqzUkd/K33q QSZJ2RKvH72zAD2xhB6lqtXMoC42/5nvE8riNvJRjfhH9iVW8c1KdXFYknlzp782xb/x GVHiO4ozIpLFOnNlp7+9FrymgGEmpWi7oLVHIdkdK+8hr3Iw+zeOiq1fIbeizwebw79F KyRQR0AeWuOUY6gpj+L0iKK+zFLiDG3VVgUdGum4zA708Y8ph9I9rtDApR2kxI2JNu88 6TpQ== X-Gm-Message-State: ALoCoQk28PCcP81BFDMUTZD4AfLjqCsQIFP72nelj8Obj/P+r7uVFfR7x2jDDmJwLcTMdt5ZmUzldksU0Id3pSQqbH6Cj6R9Hjk1/5JWSrI8dKDOAMt0YXZALNJRFMejHpZXCJqI0GF1GLWeuCP3HDUr8Kmc37IAtz2coMGjz5amEOegxx2gSFo= X-Received: by 10.180.90.206 with SMTP id by14mr13022641wib.67.1418215459999; Wed, 10 Dec 2014 04:44:19 -0800 (PST) Received: from localhost.localdomain ([91.198.246.8]) by mx.google.com with ESMTPSA id b10sm6203642wiw.9.2014.12.10.04.44.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Dec 2014 04:44:18 -0800 (PST) From: Michal Kazior To: ath10k@lists.infradead.org Subject: [PATCH 1/5] ath10k: improve 11b coex Date: Wed, 10 Dec 2014 13:31:50 +0100 Message-Id: <1418214714-29689-2-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1418214714-29689-1-git-send-email-michal.kazior@tieto.com> References: <1418214714-29689-1-git-send-email-michal.kazior@tieto.com> X-DomainID: tieto.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141210_044444_046913_5D38927E X-CRM114-Status: GOOD ( 10.83 ) X-Spam-Score: -0.8 (/) Cc: linux-wireless@vger.kernel.org, Michal Kazior X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some firmware revisions need peer phymode to be specified as MODE_11B when associating as station to a 11b AP. Otherwise they can starve other stations. Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/mac.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index fe61201..950322d 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -1416,6 +1416,12 @@ static void ath10k_peer_assoc_h_qos(struct ath10k *ar, } } +static bool ath10k_mac_sta_has_11g_rates(struct ieee80211_sta *sta) +{ + /* First 4 rates in ath10k_rates are CCK (11b) rates. */ + return sta->supp_rates[IEEE80211_BAND_2GHZ] >> 4; +} + static void ath10k_peer_assoc_h_phymode(struct ath10k *ar, struct ieee80211_vif *vif, struct ieee80211_sta *sta, @@ -1430,8 +1436,10 @@ static void ath10k_peer_assoc_h_phymode(struct ath10k *ar, phymode = MODE_11NG_HT40; else phymode = MODE_11NG_HT20; - } else { + } else if (ath10k_mac_sta_has_11g_rates(sta)) { phymode = MODE_11G; + } else { + phymode = MODE_11B; } break; @@ -4724,6 +4732,9 @@ static const struct ieee80211_channel ath10k_5ghz_channels[] = { CHAN5G(165, 5825, 0), }; +/* Note: Be careful if you re-order these. There is code which depends on this + * ordering. + */ static struct ieee80211_rate ath10k_rates[] = { /* CCK */ RATETAB_ENT(10, 0x82, 0),