From patchwork Mon Oct 18 10:57:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 515908 Delivered-To: patch@linaro.org Received: by 2002:ac0:cd8c:0:0:0:0:0 with SMTP id d12csp1643773imp; Mon, 18 Oct 2021 04:05:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6SxTZcfugw4WwgqI54LrnYvr8jp5Pv6bUJZxFe7rtMXwQFON35+gOqmTttJXP3sWE5ME8 X-Received: by 2002:a63:1656:: with SMTP id 22mr23229259pgw.20.1634555119990; Mon, 18 Oct 2021 04:05:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634555119; cv=none; d=google.com; s=arc-20160816; b=DogkcisbTKPNVoGcFNl0G9HOcHNZ5cKvImtrlbaPTUV0hapT1vC6wUPa6eOjWo/LRV zmi07WwN9FeklWOO52kkK/cgFaeoYcFTAr65hdkFPRRAZlcr4/KRAr8zT8lBiyTuS5nf tPjdeaaG5c/WpS4eZdHJBtpo7/JkK0EIXTyH9iIiR5lrCzl0yHmTPRrtvsPGnaRdMqTH 2Ff3t/50UA13z1ZPcjQ5FR96Lo6mv7k1hPdh83tQNAtFoxNZEcMv0Gyafs/pi+7Ps0ik tlGaVeIkp9Q1nQLkyTGhD4yLHS/LtrNmMsmj1dBTUnkVt0p22WSh00YgT5N4Lpv/y+Es mhMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=ow+NCkZgjEOZY6js/w9lmiTI/fEyQYTBoe2R+jZgvm0=; b=BnOVCFF370jVwVDM52DT8KFSI0EB5+koZwfYYsCIkVW0BwTOe9zz8U8jBbO3+HV67W SvZu7GOkDoObEeFIEJGFbiaxQzjtr0pTbApkoBq8RmUeMJ/yEI/LJrqEArJhHDOuPp7X BNXPw9r2fUs2wovHzzUwd4+JgjfPov34E0r+gAtSS7AKktqADb7pWWVCjfGEQaBl5H2H 4I53OkFx70lcJZlVLzzpGRWiVwO2RVVfSkIoQ4HbPGClEAxlKHqDe20E9M887h5/0hmg 48vw0k9w5iYGinqbDEIrPPUJkjpMdDn56fM9SXTgZDc/KxNOShfZtiKC6/d0xkazDjYu sZRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=MUgUudTq; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="CREtg5/S"; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 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 bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id bi7si18660449plb.71.2021.10.18.04.05.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Oct 2021 04:05:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=MUgUudTq; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="CREtg5/S"; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 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=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:Cc:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ow+NCkZgjEOZY6js/w9lmiTI/fEyQYTBoe2R+jZgvm0=; b=MUgUudTqxArpD1 zpIerYov3STHNpkCKiMA25te9xPt9LxL/G6jQBm8AnGte3TsH7zewT+iKT7AcODceBQD9ciONDLQE s+nmKg/s91VM+aPKR4n4vce5ixVNTHpSWeCjggji7tH537X3z7jkQJedjCLKyx6q4R+AvHOoQsKVh xRinzz15h3YeH2+mRvcdQ04Q9pTzQyzODTtmcZuqngu5xwl5/B3XiH26WPVwa8bhAHpO2eMbXwZxE mHGCOlpTBWtoAfKZO9y5eKpWQIeFOq7d5AmYRDOA0PVDAGS2PVrW/5sgWzv9n85pRuLR6YsfCx63r ksVWl0huQjsz7pElL4tA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mcQSD-00FEsS-O5; Mon, 18 Oct 2021 11:05:17 +0000 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mcQAE-00F6fN-3d for wcn36xx@lists.infradead.org; Mon, 18 Oct 2021 10:46:43 +0000 Received: by mail-wr1-x42c.google.com with SMTP id e12so40522323wra.4 for ; Mon, 18 Oct 2021 03:46:41 -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; bh=d6iwtRfuZTETciNTWdG7oGNdEZ8SIS+Jv3Ox8wXHaJg=; b=CREtg5/Sp+R0I4teGevh/5aiIIv2BLPy9vA+BN5H6e3NsiVbdKeg4tjD+D+CYEteEa hdi7PS9OStq+vez2xtUfbI8P9TnBG/xn61y+LBq3kqem8C//1TQDtaySiSKttPkzkYQV CZ88lBg4IxMYkjiPzgBH7wEtAF9lOYFIRg6qa83a8yxGw3jFDQ6Cf7AgwMo/aOGz9WkD piHkWVtGr+qWQQ1Tc3HYMOgNSAiNRS4x/tEAooKuikm5K6Q81JHUcPMjUPr/Hhb8gYaC 09wX0tN3M8+g9gs+r5IqR9vHjVtKYtEZmftRNjLU3YFLpSfTLwDWsgfd+y0jsVo/j0qj TbaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=d6iwtRfuZTETciNTWdG7oGNdEZ8SIS+Jv3Ox8wXHaJg=; b=EIUo4+gWr64wAedo3H6ndVYft52GF4GXLKR6rBxBfr8rGeCqK+mjVvb83n16dnmE4j Ngi+xAc7DXMZ2edFvT7j/VPAoR56n/8EtgcArs2QuU+Uc34y5sphCYQpjnMNoktMfFtO 3/TmsLLbAVQrbiXOw3PpBpXMMNv5s4q87TWF5pTevpkqvw5q3nOv2G2+DCn2blEYcH/9 QAPIeRROJcEkeiBaBeTa4kZdu7tAtCvlYw+lfWFCQIdiuwS4vLoxt6r8bWEGV4UQVVRW 4hz54m9/aacrRt1gwzX1kahYJa1knfwxZk+ZLFkuRtR70+aliVHrGIBn3/ygbaTwezZQ cyLQ== X-Gm-Message-State: AOAM532Z9RunPGJCpzxg9ud4JkXZpqtD2FmB9wKRy5+Gs8Bnw5rv3yKF AovjygreecTbvcS3aslIxiFGiA== X-Received: by 2002:adf:e390:: with SMTP id e16mr34975492wrm.217.1634553999896; Mon, 18 Oct 2021 03:46:39 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:82c:5f0:9df5:c752:530b:345b]) by smtp.gmail.com with ESMTPSA id r4sm15195945wrz.58.2021.10.18.03.46.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Oct 2021 03:46:39 -0700 (PDT) From: Loic Poulain To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, Loic Poulain Subject: [PATCH 1/2] wcn36xx: Correct band/freq reporting on RX Date: Mon, 18 Oct 2021 12:57:57 +0200 Message-Id: <1634554678-7993-1-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211018_034642_257562_F4E1630A X-CRM114-Status: GOOD ( 14.99 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: For packets originating from hardware scan, the channel and band is included in the buffer descriptor (bd->rf_band & bd->rx_ch). For 2Ghz band the channel value is directly reported in the 4-bit rx_ch field. For 5Ghz band, the rx_ch field contains a mapping index (given the 4-bit limitation). Content analysis details: (-0.2 points, 5.0 required) 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:42c 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_AU Message has a valid DKIM or DK signature from author's 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_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: wcn36xx@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "wcn36xx" Errors-To: wcn36xx-bounces+patch=linaro.org@lists.infradead.org For packets originating from hardware scan, the channel and band is included in the buffer descriptor (bd->rf_band & bd->rx_ch). For 2Ghz band the channel value is directly reported in the 4-bit rx_ch field. For 5Ghz band, the rx_ch field contains a mapping index (given the 4-bit limitation). The reserved0 value field is also used to extend 4-bit mapping to 5-bit mapping to support more than 16 5Ghz channels. This change adds correct reporting of the frequency/band, that is used in scan mechanism. And is required for 5Ghz hardware scan support. Signed-off-by: Loic Poulain --- drivers/net/wireless/ath/wcn36xx/txrx.c | 23 +++++++++++++++++++++++ drivers/net/wireless/ath/wcn36xx/txrx.h | 3 ++- 2 files changed, 25 insertions(+), 1 deletion(-) -- 2.7.4 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx Tested-by: Bryan O'Donoghue diff --git a/drivers/net/wireless/ath/wcn36xx/txrx.c b/drivers/net/wireless/ath/wcn36xx/txrx.c index cab196b..a3ef497 100644 --- a/drivers/net/wireless/ath/wcn36xx/txrx.c +++ b/drivers/net/wireless/ath/wcn36xx/txrx.c @@ -31,6 +31,13 @@ struct wcn36xx_rate { enum rate_info_bw bw; }; +/* Buffer descriptor rx_ch field is limited to 5-bit (4+1), a mapping is used + * for 11A Channels. + */ +static const u8 ab_rx_ch_map[] = { 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, + 108, 112, 116, 120, 124, 128, 132, 136, 140, + 149, 153, 157, 161, 165, 144 }; + static const struct wcn36xx_rate wcn36xx_rate_table[] = { /* 11b rates */ { 10, 0, RX_ENC_LEGACY, 0, RATE_INFO_BW_20 }, @@ -291,6 +298,22 @@ int wcn36xx_rx_skb(struct wcn36xx *wcn, struct sk_buff *skb) ieee80211_is_probe_resp(hdr->frame_control)) status.boottime_ns = ktime_get_boottime_ns(); + if (bd->scan_learn) { + /* If packet originates from hardware scanning, extract the + * band/channel from bd descriptor. + */ + u8 hwch = (bd->reserved0 << 4) + bd->rx_ch; + + if (bd->rf_band != 1 && hwch <= sizeof(ab_rx_ch_map) && hwch >= 1) { + status.band = NL80211_BAND_5GHZ; + status.freq = ieee80211_channel_to_frequency(ab_rx_ch_map[hwch - 1], + status.band); + } else { + status.band = NL80211_BAND_2GHZ; + status.freq = ieee80211_channel_to_frequency(hwch, status.band); + } + } + memcpy(IEEE80211_SKB_RXCB(skb), &status, sizeof(status)); if (ieee80211_is_beacon(hdr->frame_control)) { diff --git a/drivers/net/wireless/ath/wcn36xx/txrx.h b/drivers/net/wireless/ath/wcn36xx/txrx.h index 032216e..b54311f 100644 --- a/drivers/net/wireless/ath/wcn36xx/txrx.h +++ b/drivers/net/wireless/ath/wcn36xx/txrx.h @@ -110,7 +110,8 @@ struct wcn36xx_rx_bd { /* 0x44 */ u32 exp_seq_num:12; u32 cur_seq_num:12; - u32 fr_type_subtype:8; + u32 rf_band:2; + u32 fr_type_subtype:6; /* 0x48 */ u32 msdu_size:16; From patchwork Mon Oct 18 10:57:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 515909 Delivered-To: patch@linaro.org Received: by 2002:ac0:cd8c:0:0:0:0:0 with SMTP id d12csp1643780imp; Mon, 18 Oct 2021 04:05:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzYsS7zihep7sPC/ZR/YA4sS4y0hgPkTNK6msqcfZu+h0CoGz/igMJEgfdsEyS5A3M7fFZ X-Received: by 2002:a17:902:db0a:b0:13e:e968:e144 with SMTP id m10-20020a170902db0a00b0013ee968e144mr26548494plx.43.1634555120300; Mon, 18 Oct 2021 04:05:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634555120; cv=none; d=google.com; s=arc-20160816; b=FkmnZXd4XS2QMBBpDhIu8rhdxHaYaAco7jid9jYhAJfpWIg0yrk9PgKD5w6LclUpsw yb6vvC/+/D9T+kpCs0s7FqRFnQAkm6t1nJFWKbaJpV70hB+mQNI/2ZgBgOWRAlAgt7Iz 1rFey/Bf+856LDLpgdnGv3IID6tcxMxaWSl9iXtrpxXH/2kfHqYBON/C/pKWcDGdv8z9 +Hi7aa/a7jUiNufviQzje6pikbnAAFKnbNWlEhjP6Pw0FvDKS+TRXLOc+0xje8ACZ047 UzX4cPirSAXOzNF48Y0x7JUilS/Wg9Hk/cd0/MivuO5lJRS6OZABxK2NuwAImHQPNfP8 CeMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature:dkim-signature; bh=OfvRv9MIzXvVwf4uaBFrWtADHdLGV457xrLRWhpu8r8=; b=PmUpx4US3GwzlZJORK/34hLpK50LJVaAVXscyc2ItZoXX/24sqd4MqZ5MP8xAANNe+ do3DL8mWOZtwNr7vCDk23zQnYuRCJLX/8I+p62WI4tTAMSyS/v1svsumPS8yQ/vEHOVa q0Tom0Kdq3CQmYZti8W4LvoVSHeY0cVPYUe1w3izUz+6Va4qaCZ0JRXsEboMPPijNmZ0 pgugb9awtaR0sIt+DIQAlnsAGeuoHcRkPwdxSfTyIgagbolXikZOc5GiIpoe2MsIk9wW 7JwyxxLtOfiEsRcj61DpURu+mtysI48H/5WQaB97NnNzMh72gZOugtXaBEjmr7lIno4c /1Vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b="ezDpY/Y1"; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=xn4FIYIE; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 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 bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id a17si16895699pfh.112.2021.10.18.04.05.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Oct 2021 04:05:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b="ezDpY/Y1"; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=xn4FIYIE; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 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=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OfvRv9MIzXvVwf4uaBFrWtADHdLGV457xrLRWhpu8r8=; b=ezDpY/Y1gLiIKG DhxErM9wyq/fQMGkC0R9HmRGeGJfkBQjiO7NVajEEleXuBAG7GEOrXP4C82nZGzJ9DhkjYRsq6FU9 tm+teTHlhDjxBgY3iqI6QdG/Z87+NIQFTlUgec8tW/mSFKDLaYATLk+dtK4NCMbtrXeiTdEpw1MP6 pv4MUYSz2jADi5YkODIVD2QnkgC2zmWo/BGBQOjyNwTF/pjnOSTUhdRIHPvwUPoldYASbIS06wbQR WB29JkL6kGouYvg+d9SoDYsj/73bwQF1g4PVH45Fbb7SwZnMa6N3qlsAgKngpCTIb5/uT7PXYQfwR YjWPEUoV5Lcs/V4rFtdQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mcQSE-00FEsm-6l; Mon, 18 Oct 2021 11:05:18 +0000 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mcQAO-00F6je-5Z for wcn36xx@lists.infradead.org; Mon, 18 Oct 2021 10:46:53 +0000 Received: by mail-wr1-x432.google.com with SMTP id i12so40411071wrb.7 for ; Mon, 18 Oct 2021 03:46:51 -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; bh=BaJ5lbXk0aHDbSY/0wo3ZTQDwBqF9Vwclu0gix6RmYQ=; b=xn4FIYIEzzSCxgDqLrrb44ivDe/qPvSAiYlg5UwclYfv+9u8zEktek80sUw5xKg+H2 sE+Bteza3k3y8ESdsw0M94j3ZQxob+XybcMlwBQjCDVvcgdB15JD7AO3aYFFb5Momqrk xjmCrekgwtjv70Ud8hDgjLkZ4AW3ocSoIE1M4fMT6Grv2fRIRKnfUwsJZobJCoShExGI iqmkGX6dJYi2QESU+4AtiuWttyObJ10TpEE/gtrgZWI+zeyVvsrzl+MdsdZKs5ONfXm1 F4W6/Ndnroa40dXroSW62XIu66XFnwxJ3ajpoSB89v+dni9p/RFtees18vaFMIV/opHC klAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BaJ5lbXk0aHDbSY/0wo3ZTQDwBqF9Vwclu0gix6RmYQ=; b=aAmo4VgDOt8MdaVJfs+Tm9ggBqPbX9B2czp5a/C2JiycJHcIf7tDpGKiuiWY4H124d Dg6HusNrOozJV39rQSYuJiataY36zk2mrHG9hGtfmrv6nQze1XjeGmxEvPLQGRZZFG4U hdqxVEgCp/lSn7xjTzuMwrBvLsmOof8dQF5dDuwu+Vi+dmjPAw6qaqE6bdWIMcU0546D ZuI9aQ9SvpvJxAGMmrhJh1GQZVnl9WKWwll0dcrnIMfTtJW+MRM5QQj9S6adOowpQ77p Bvx+tNta8u+0vqNa6V8PUJPCK444aiRG7FD/1ePdlytA34Ua3aHOsVq31QzX2yvp9fer fT6w== X-Gm-Message-State: AOAM530TTZfj1w4MJ0rYwvAQBYar8Y/Xipaf9NPaYjBcWw1QBAnnZnZG BXPHp+UIxDEEXU5wkIsDXdK+qA== X-Received: by 2002:a5d:59a9:: with SMTP id p9mr35718769wrr.386.1634554010787; Mon, 18 Oct 2021 03:46:50 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:82c:5f0:9df5:c752:530b:345b]) by smtp.gmail.com with ESMTPSA id r4sm15195945wrz.58.2021.10.18.03.46.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Oct 2021 03:46:50 -0700 (PDT) From: Loic Poulain To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, Loic Poulain Subject: [PATCH 2/2] wcn36xx: Enable hardware scan offload for 5Ghz band Date: Mon, 18 Oct 2021 12:57:58 +0200 Message-Id: <1634554678-7993-2-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1634554678-7993-1-git-send-email-loic.poulain@linaro.org> References: <1634554678-7993-1-git-send-email-loic.poulain@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211018_034652_250173_CF2E34A9 X-CRM114-Status: GOOD ( 14.47 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Until now, offload scanning for 5Ghz channels was considered broken. However it was mostly a driver issue, caused by bad reporting of the beacons/probe-resp bands and frequencies, which has been fixed [...] Content analysis details: (-0.2 points, 5.0 required) 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:432 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_AU Message has a valid DKIM or DK signature from author's 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_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: wcn36xx@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "wcn36xx" Errors-To: wcn36xx-bounces+patch=linaro.org@lists.infradead.org Until now, offload scanning for 5Ghz channels was considered broken. However it was mostly a driver issue, caused by bad reporting of the beacons/probe-resp bands and frequencies, which has been fixed. We can now allow offload scan for 5GHz band, this reduces the scanning time comparing to software driven scanning. Note that offloaded scan is limited to 48 channels, check for this. Signed-off-by: Loic Poulain --- drivers/net/wireless/ath/wcn36xx/main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- 2.7.4 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx Tested-by: Bryan O'Donoghue diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index 263af65..2ac8efa 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -659,19 +659,19 @@ static int wcn36xx_hw_scan(struct ieee80211_hw *hw, struct ieee80211_scan_request *hw_req) { struct wcn36xx *wcn = hw->priv; - int i; if (!get_feat_caps(wcn->fw_feat_caps, SCAN_OFFLOAD)) { /* fallback to mac80211 software scan */ return 1; } - /* For unknown reason, the hardware offloaded scan only works with - * 2.4Ghz channels, fallback to software scan in other cases. + /* Firmware scan offload is limited to 48 channels, fallback to + * software driven scanning otherwise. */ - for (i = 0; i < hw_req->req.n_channels; i++) { - if (hw_req->req.channels[i]->band != NL80211_BAND_2GHZ) - return 1; + if (hw_req->req.n_channels > 48) { + wcn36xx_warn("Offload scan aborted, n_channels=%u", + hw_req->req.n_channels); + return 1; } mutex_lock(&wcn->scan_lock);