From patchwork Fri Dec 12 11:41:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 5481891 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 46F16BEEA8 for ; Fri, 12 Dec 2014 11:55:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 42A3E20125 for ; Fri, 12 Dec 2014 11:55:02 +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 3CD4F2017D for ; Fri, 12 Dec 2014 11:55:01 +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 1XzOoE-0008Gh-56; Fri, 12 Dec 2014 11:54:58 +0000 Received: from mail-wg0-x236.google.com ([2a00:1450:400c:c00::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XzOo9-00089u-Ep for ath10k@lists.infradead.org; Fri, 12 Dec 2014 11:54:54 +0000 Received: by mail-wg0-f54.google.com with SMTP id l2so8921170wgh.41 for ; Fri, 12 Dec 2014 03:54:31 -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=4TrceNPIpiD45DlV9ZAwgZqPGkCNiDEXBxPNhDgRBXIQWNDeOZiuBb+u593qWXNOZv hCZ9593ezAXvR4ebHicJrmSutxyin1jSoPCskt5xhDdj7cg0oT+jXeqCrtISES2XAMVf d7JxJyb2qHGiJF9amSvBCzC6wf7lJ9+fbvn4s= 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=V2Bq75n2++10bCgw6Bwq4D5kcK7rgbv5qWoB8LoJPDsIZYhJ+pxeOs7F9QoumswxIY SdNIJ997odHu4CXPBHez59epZoObFKfroIfE0HMOoM60xJ6w2MlxqdYmJheEbQHXFrGu Y13vIV/BAa2pv6bHyicrD76IuHPZPAPKXMTg09oT7L+ciBxZKMoABFEufW3d0TNLxFXh ynvTDF5yw6kGaIpMaO8pYVfX9bhgJIubwkQqNxE2CzcjYxJQRsQU/qIta2kz7L1ty/ks j6WvH1TiOTT4vrEnCEfOzN5yAmlaGH3Nl1qw2dJEhqvcn6XYL+Tyb8bKKw8cOC19SCYD uF2g== X-Gm-Message-State: ALoCoQkWX6ZQmlF3+QRXLr/L21SmQbV9P1bR7p3tnVHPRwfeg3V66e4svqEH69pi1R5Fa0viclzP0yV1Y+5B81zqJAgi1bu7OUuLvcnfa0e77Y5JZJzs/i+KTTq6afjveU9LcPn/GS6hWYH4RiTAwSQxC5SWYYV5ER6n5TOh8D8YS4Vma8M4qPI= X-Received: by 10.180.85.34 with SMTP id e2mr7189202wiz.0.1418385270534; Fri, 12 Dec 2014 03:54:30 -0800 (PST) Received: from localhost.localdomain ([91.198.246.8]) by mx.google.com with ESMTPSA id pf4sm1516796wjb.36.2014.12.12.03.54.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Dec 2014 03:54:30 -0800 (PST) From: Michal Kazior To: ath10k@lists.infradead.org Subject: [PATCH v2 1/5] ath10k: improve 11b coex Date: Fri, 12 Dec 2014 12:41:35 +0100 Message-Id: <1418384499-31660-2-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1418384499-31660-1-git-send-email-michal.kazior@tieto.com> References: <1418214714-29689-1-git-send-email-michal.kazior@tieto.com> <1418384499-31660-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-20141212_035453_672818_6B590AA6 X-CRM114-Status: GOOD ( 10.48 ) 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=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, 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),