From patchwork Sat Aug 29 03:38:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 248673 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp1602383ilg; Fri, 28 Aug 2020 20:38:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyge86iTPQiA5dD4A1RILG2heFZRlHHluQAWJZYiXfirLh7B+NicugxeCXfz+a34ONHd0S/ X-Received: by 2002:a02:cbc7:: with SMTP id u7mr3986672jaq.74.1598672295932; Fri, 28 Aug 2020 20:38:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598672295; cv=none; d=google.com; s=arc-20160816; b=Pu7R6EG2kbVfvuOtia1kSyh7/x9SGZtfiJPMAgezeW6n/A9JNYb7YA0coXF4cwjzjU ReLdaIWvnKUN1t2i6ubPP3SYFlargJIuKk7POp4Uz+vBYzIszoC2HV2ywsPCC/gW3TzO kDN9TnEUlr5jMcEm+CJj4bRayt0N/2SZPSOER26MP0ewuZpuBzVe8Hv6uyLdRSRRHqFH xgJKNw6RHhQNFPoU3Bq36Uedc1cFVrurQCD3QijEbpE+irXi3kPcuVWaFBgsuh08ZMjQ PX+36BkPodksKUOzS3eQckNQjchWW2lClaYjEXVPa4FJyfAJe8ezgAk5Q2DgmBI56EVD Jz2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:dkim-signature; bh=rN+z6NzdK6xIN6AbvEfETzjCvRNqbcBkSdTL1Dgfvwg=; b=0bv2Fyb0i1UdgbMCinu4qTcaTM9RlPonZbdTEYolUXf9LRoL4/A5vJ/vwlI6RbO1jj QrE7Kcb3VpP/AnuLz9gMbboqYBeVkGQFPAHYUhcUSWYd1bZU12hx4PTUpSYbDTRKRYlz BvLunO9ZL2UYVjTkcUpv2uY5EJRQ4uyX4/uRi+/mFmglbBCX0wG4YK617mZNVCPeE+w7 v9cxifEYsFVMgNs8xR0KFoawQCCkQEDQ6QiezlKq01NnJEv2S4t3zgY6xPS6UjXBsn86 duvrXlHwG0U83uEPho4jl1El4h27aBe4dNw3S3jD4Vc8Rg1FiU6umvZDREYjG9mMc8WW x3KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=ufeSU6NP; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="BTOXWD/U"; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1231::1 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from merlin.infradead.org (merlin.infradead.org. [2001:8b0:10b:1231::1]) by mx.google.com with ESMTPS id l9si994417jaj.48.2020.08.28.20.38.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 20:38:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1231::1 as permitted sender) client-ip=2001:8b0:10b:1231::1; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=ufeSU6NP; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="BTOXWD/U"; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1231::1 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rN+z6NzdK6xIN6AbvEfETzjCvRNqbcBkSdTL1Dgfvwg=; b=ufeSU6NPMznpnW+TXV6b9Z6nV gsoyl1khE+6Vfb6jjiksoNr2p++iD6e/XnWxSgWYIurdl/GU6Xln4jfCspLceOztB8uUxQaZQpoCT MwXZy/ewSis7AicFUfhg/YCkwXhBx/Qu9FrkDIM+Xj3Clu3QZBZ2E6Zju+t0yaY72Lq6oQBv7gWux wLZBis1AgIaooAaOIWGG46B7zT4vpw8UY7P6wISUMOXFt+fXkO78o6HsQrSzf9rcW5l6l0/y8oSof qHigIEh/bP6wyuvuOFxLoSheHPWcvB5Uzv6AjlTrtS79ZnCAE4uvscHcvvOAyehwAVAbjmkZDCYaS tBgviqOwQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBrgy-00028m-GT; Sat, 29 Aug 2020 03:38:12 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBrgv-00026e-Ba for wcn36xx@lists.infradead.org; Sat, 29 Aug 2020 03:38:10 +0000 Received: by mail-wr1-x443.google.com with SMTP id w5so867316wrp.8 for ; Fri, 28 Aug 2020 20:38:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rfxnSLFpws95ZzTiN2qtFlrCYz6/oakRsVyvq/HcoY4=; b=BTOXWD/U3EBW10PEULQgKuppUzxzpqwMLd1PFkYrGZxjdvFELVtGb6a095Ep6a3G0O 6zY6dna0rwjkqN0qJs+yA1Qb3qTuhwztHV0FIR+Wg1R+JusLIbtZsdBESwvjt1aI6Ep5 mdaEHRKUAbWNKihjqS/4omaemGaGzKHHDMuLDztE1+CN66qn0cJAkLujj+W7qv8zmtvF YLymhRAAIGnHoB6NC7hYym9FrUQlaYslPMrDoNfUojEqdJ7/PvrPKaiqBgWpMz8pmbMw cb7HgdSu2eygYcgKX/9B26oeSjODezaHp6OlAaHUVs8dN/kyVjUE6Ql0KmVs0GQ61wgO GKZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rfxnSLFpws95ZzTiN2qtFlrCYz6/oakRsVyvq/HcoY4=; b=cYJPPIwq4mjj69lVFdiP0cbE6ATJ5opA++V1fbcy3dv1KQ+x1YN4+DhpVEGkj3qy0D b5zS55FPV2bwInyNLxF62tfzcwk2bOAUyjhP1MaxjvkU9N0x+W3WcODMaTsl2o5lfL37 wJuwjD3uATk9XFhajJC7b/+Z93Yd9Ehp7XAiVYJ4ReaysMpZI752qP84g26KJkx9UVSi N6PSgzdfz2UTsQfjwYsDKoKbTdqT79RYTPRT7Bvbx0KeH5J/spORp03zrPCKEAsG1ng8 86A1beqYS7JNszbEspbEiDn2Wcb/F5WKD09OuCXTF5dvx7AUxpsx2dPzB04NqmFbdPa2 29UA== X-Gm-Message-State: AOAM532Dl93FAFVX9WzBk+LBQGC/8TN5G32AQoSdc3EWYm1efpinpfad RL+d7+uRqgLv6RhIS96AZLpX/A== X-Received: by 2002:adf:f507:: with SMTP id q7mr1708154wro.343.1598672288484; Fri, 28 Aug 2020 20:38:08 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id v29sm1827545wrv.51.2020.08.28.20.38.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 20:38:08 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH v2 05/10] wcn36xx: Fix warning due to bad rate_idx Date: Sat, 29 Aug 2020 04:38:41 +0100 Message-Id: <20200829033846.2167619-6-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200829033846.2167619-1-bryan.odonoghue@linaro.org> References: <20200829033846.2167619-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200828_233809_452039_01D94670 X-CRM114-Status: GOOD ( 13.83 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:443 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: wcn36xx@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.org Sender: "wcn36xx" Errors-To: wcn36xx-bounces+patch=linaro.org@lists.infradead.org From: Loic Poulain The rate_idx is the index of the bitrate in the supported rate table. However the 5Ghz band has a smaller legacy bitrate table than 2.4Ghz since it does not have the DSSS bitrates (1, 2, 5.5, 11). So in 5Ghz band the index should adjusted accrodingly (-4). Signed-off-by: Loic Poulain [bod: Made sure fix is only applied if the rate_idx > n_bitrates] Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/txrx.c | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.27.0 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx diff --git a/drivers/net/wireless/ath/wcn36xx/txrx.c b/drivers/net/wireless/ath/wcn36xx/txrx.c index 80e96c2296af..05a84f82584c 100644 --- a/drivers/net/wireless/ath/wcn36xx/txrx.c +++ b/drivers/net/wireless/ath/wcn36xx/txrx.c @@ -230,6 +230,7 @@ int wcn36xx_rx_skb(struct wcn36xx *wcn, struct sk_buff *skb) const struct wcn36xx_rate *rate; struct ieee80211_hdr *hdr; struct wcn36xx_rx_bd *bd; + struct ieee80211_supported_band *sband; u16 fc, sn; /* @@ -270,6 +271,14 @@ int wcn36xx_rx_skb(struct wcn36xx *wcn, struct sk_buff *skb) status.enc_flags = rate->encoding_flags; status.bw = rate->bw; status.rate_idx = rate->mcs_or_legacy_index; + sband = wcn->hw->wiphy->bands[status.band]; + + if (status.band == NL80211_BAND_5GHZ && + status.encoding == RX_ENC_LEGACY && + status.rate_idx >= sband->n_bitrates) { + /* no dsss rates in 5Ghz rates table */ + status.rate_idx -= 4; + } } else { status.encoding = 0; status.bw = 0;