From patchwork Wed Sep 8 13:30:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 507930 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp601521jai; Wed, 8 Sep 2021 06:28:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPgCpUWzHOcf/K2hVSHyWuSoAQkkdOA4EGvx5SqyxzZMeYAb5fI7bcB5Ou7LEW0FtfcDYS X-Received: by 2002:a05:6808:1442:: with SMTP id x2mr2341060oiv.162.1631107715004; Wed, 08 Sep 2021 06:28:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631107715; cv=none; d=google.com; s=arc-20160816; b=w6ZOocvj6RIhdn09nbt4K/+5epHwRcI9CdIFUgQWKjCng/50v7emBdqbRy5BOxtJj5 0Dq47hWhQrmygSdNUV5pdR8BW4QOePESAs05tzKxoofpOV5eG/vAo8qgQjlWeMN/cpgg O3qhO8s6TsYO7c79TkzEn5KcQuM//Ytxbxnc7WlraQsf/He+rxi6ciXKxT1CJAWrqWKy kn4M2mJ+XNiguPyNY6GRQGrRccFXExAY5fGMnD6v0a4LQ3LygWhWnXZRhF9mulW9A3fr N1E9f3RSuMD9JFwzrdHUxXEJUhdvvJH2WCMSjxz5Ybvtw9CKmeCBC4d6p64SRPJ4Bp9O wAjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature; bh=LMmr6fvbSSa6gAjJs0ebPyL6nJOHyDeQsIII0F2VJB8=; b=AlU1yV/2kD6CBa9C387ipm+TvPKRptziP7NLNFA2QZfh7KpbNZWPpRxz/RJM+npoVx 9hGd5QPHSef85K1ImHKPlgw42sI4M8xMaPzVm4S0i+1HtntQZ3Idl0Cos8axM1j4CLcy laOx+dTfC5/n4oUqKCvPNFZt7bytiCRGT7tFWDYTZKGZYTbdj6uUbsnKkr7lFvYOsHru LDs6ZMM1xbRJuRn+w3geCf3kcgdz8m6D0yWm83El9Uphg/LT/MNaP+zcqOI5uRWL33Fm dGuRVHElK4ivgJjufppSuR8mXeK1tEKEHzt5SnXr2l1F5KwHNVJyO6607amXlNOXzAzM LW+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=jKITIitM; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=PGAdxkeA; 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 l5si1596618otk.259.2021.09.08.06.28.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Sep 2021 06:28:34 -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=jKITIitM; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=PGAdxkeA; 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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=LMmr6fvbSSa6gAjJs0ebPyL6nJOHyDeQsIII0F2VJB8=; b=jKITIitM1BI1U0 P82sZmpCnsihXi7Bhl7yzS1/xga+F7OnDtBWYGguwbTb6TMIaRw2MQpgG8gqU3TOmzx/m9kvQQF+b urhnEb5ogz7cAQIKcDows4Yi/IHzheZZCQRIdlcApNH0KwtpJHOodby7CIF9y/C+P7Rin/6KfDIho WPTWCKk9ENOZHpoK/TFG5VcHI3fJlH/xtu4/0YdmV1Rl8DuTq2OoDb63DwmieT5XFeaNRht+nVvht /dxewyngwyYJt4BaDhqqS56pupSrLjvD70QTO+8sAGvP7TMOxG85zOggRnD40Sj/Mz/11FpMBMCyv amzfmdQ/UVJQZxynzF8Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mNxcv-006nB1-4t; Wed, 08 Sep 2021 13:28:33 +0000 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mNxcs-006n9y-0G for wcn36xx@lists.infradead.org; Wed, 08 Sep 2021 13:28:31 +0000 Received: by mail-wr1-x42d.google.com with SMTP id q11so3296668wrr.9 for ; Wed, 08 Sep 2021 06:28:28 -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=5zNiaZ6kUNl6kjTzbhdQAe4ycjtuI2UDzzfFBenbEs0=; b=PGAdxkeAA933kRu6BjCxcmQDwYtSp8uC6iLinztsFaVJsb/vuReHlbo9TTMNHWA+4T wK+wjPeTymWwLoKI+RFtwMEbI4NELcjygChc+XEYUpeU6XnL0EexCmoEd6x+5x9L4j0I kJZdZMcVcC+NsfHSZwbbq0vZku/BGTSaHzEBpEC5oIOjof+GfzKlmOaEbv4HS+CRIpdl ZAegabM91CvXa3so+gyzF5oDkVw79bLBGHlNzFAUxl65eqeXXK+YKrX6zMHZgTDj3q0k 6OXXmgNRoKOb5LLr4cvAEB0Ce50b4SrEYo3Vu7HPljbUAxlubCtVE8Cc/AN4WoFNHAS2 yJPw== 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:mime-version:content-transfer-encoding; bh=5zNiaZ6kUNl6kjTzbhdQAe4ycjtuI2UDzzfFBenbEs0=; b=22lQLKXHsLbqmP9N8GtMolV/fHaM3PxTpZ/hB8YgFGR8A4PW0ZH2zoOlZeRxLE0res 7sEIw/fId1IEqCb9VdxqLq5TJI72/seEGkMKjlwSYE40p+i70yKG/SZ1YekiEltIfL8F YSI4F6oukdmBvHUac4qxFGmCG2YWtXIWOLyXudpdiEI8mOBI5cjmPmdejPO1qXrmUiRR e7pdPtonwxylkGXw5mxvnSLUyUIE8R1xlWR379NLJ1SzCBEZCten3w48lwoIiQTsXoEq vgKRIJ7EhAzT0M/j98OatkR7296wui68yJ0QuIUGZmzWb7WbU1QesBRvLbD8XHHHZFjF 7awg== X-Gm-Message-State: AOAM532kWTZe025CSP7IA21nSfhLVuLyWAd40oQCBbJCAJa+kra8JYlh 3SvkPhCz6+w/CYLpkg9daRvTdg== X-Received: by 2002:a5d:69c6:: with SMTP id s6mr4085853wrw.157.1631107707158; Wed, 08 Sep 2021 06:28:27 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id u25sm2136139wmj.10.2021.09.08.06.28.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Sep 2021 06:28:26 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, linux-wireless@vger.kernel.org, wcn36xx@lists.infradead.org Cc: loic.poulain@linaro.org, benl@squareup.com, bryan.odonoghue@linaro.org Subject: [PATCH 1/2] wcn36xx: Fix Antenna Diversity Switching Date: Wed, 8 Sep 2021 14:30:18 +0100 Message-Id: <20210908133019.2408092-2-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210908133019.2408092-1-bryan.odonoghue@linaro.org> References: <20210908133019.2408092-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-20210908_062830_102208_4CEECCC9 X-CRM114-Status: GOOD ( 24.25 ) 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: We have been tracking a strange bug with Antenna Diversity Switching (ADS) on wcn3680b for a while. ADS is configured like this: A. Via a firmware configuration table baked into the firmware binary. 1. Defines if ADS is enabled. 2. Defines which GPIOs are connected to which antenna enable pin. 3. De [...] 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:42d 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: , Sender: "wcn36xx" Errors-To: wcn36xx-bounces+patch=linaro.org@lists.infradead.org We have been tracking a strange bug with Antenna Diversity Switching (ADS) on wcn3680b for a while. ADS is configured like this: A. Via a firmware configuration table baked into the firmware binary. 1. Defines if ADS is enabled. 2. Defines which GPIOs are connected to which antenna enable pin. 3. Defines which antenna/GPIO is primary and which is secondary. B. WCN36XX_CFG_VAL(ANTENNA_DIVERSITY, N) N is a bitmask of available antenna. Setting N to 3 indicates a bitmask of enabled antenna (1 | 2). Obviously then we can set N to 1 or N to 2 to fix to a particular antenna and disable antenna diversity. C. WCN36XX_CFG_VAL(ASD_PROBE_INTERVAL, XX) XX is the number of beacons between each antenna RSSI check. Setting this value to 50 means, every 50 received beacons, run the ADS algorithm. D. WCN36XX_CFG_VAL(ASD_TRIGGER_THRESHOLD, YY) YY is a two's complement integer which specifies the RSSI decibel threshold below which ADS will run. We default to -60db here, meaning a measured RSSI <= -60db will trigger an ADS probe. E. WCN36XX_CFG_VAL(ASD_RTT_RSSI_HYST_THRESHOLD, Z) Z is a hysteresis value, indicating a delta which the RSSI must exceed for the antenna switch to be valid. For example if HYST_THRESHOLD == 3 AntennaId1-RSSI == -60db and AntennaId-2-RSSI == -58db then firmware will not switch antenna. The threshold needs to be -57db or better to satisfy the criteria. ADS works like this: A. Every XX beacons the firmware switches to or remains on the primary antenna. B. The firmware then sends a Request-To-Send (RTS) packet to the AP. C. The firmware waits for a Clear-To-Send (CTS) response from the AP. D. The firmware then notes the received RSSI on the CTS packet. E. The firmware then repeats steps A-D on the secondary antenna. F. Subsequently if the measured RSSI on the primary or secondary antenna is better than ASD_TRIGGER_THRESHOLD + ASD_RTT_RSSI_HYST_THRESHOLD then that antenna becomes the active antenna. G. If RSSI rises past ASD_TRIGGER_THRESHOLD then ADS doesn't run at all even if there is a substantially better RSSI on the other antenna. What we have been observing is that the RTS packet is being sent but the MAC address is a byte-swapped version of the target MAC. The ADS/RTS MAC is corrupted only when the link is encrypted, if the AP is open the RTS MAC is correct. Similarly if we configure the firmware to an RTS/CTS sequence for regular data - the transmitted RTS MAC is correctly formatted. Internally the wcn36xx firmware uses the indexes in the SMD commands to populate and extract data from specific entries in an STA lookup table. The AP's MAC appears a number of times in different indexes within this lookup table, so the MAC address extracted for the data-transmit RTS and the MAC address extracted for the ADS/RTS packet are not the same STA table index. Our analysis indicates the relevant firmware STA table index is "bssSelfStaIdx". There is an STA populate function responsible for formatting the MAC address of the bssSelfStaIdx including byte-swapping the MAC address. Its clear then that the required STA populate command did not run for bssSelfStaIdx. So taking a look at the sequence of SMD commands sent to the firmware we see the following downstream when moving from an unencrypted to encrypted BSS setup. - WLAN_HAL_CONFIG_BSS_REQ - WLAN_HAL_CONFIG_STA_REQ - WLAN_HAL_SET_STAKEY_REQ Upstream in wcn36xx we have - WLAN_HAL_CONFIG_BSS_REQ - WLAN_HAL_SET_STAKEY_REQ The solution then is to add the missing WLAN_HAL_CONFIG_STA_REQ between WLAN_HAL_CONFIG_BSS_REQ and WLAN_HAL_SET_STAKEY_REQ. No surprise WLAN_HAL_CONFIG_STA_REQ is the routine responsible for populating the STA lookup table in the firmware and once done the MAC sent by the ADS routine is in the correct byte-order. This bug is apparent with ADS but it is also the case that any other firmware routine that depends on the "bssSelfStaIdx" would retrieve malformed data on an encrypted link. Fixes: 3e977c5c523d ("wcn36xx: Define wcn3680 specific firmware parameters") Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.33.0 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx Tested-by: Benjamin Li diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index 2ccf7a8924a0..60cf0516e1bc 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -567,12 +567,14 @@ static int wcn36xx_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, if (IEEE80211_KEY_FLAG_PAIRWISE & key_conf->flags) { sta_priv->is_data_encrypted = true; /* Reconfigure bss with encrypt_type */ - if (NL80211_IFTYPE_STATION == vif->type) + if (NL80211_IFTYPE_STATION == vif->type) { wcn36xx_smd_config_bss(wcn, vif, sta, sta->addr, true); + wcn36xx_smd_config_sta(wcn, vif, sta); + } wcn36xx_smd_set_stakey(wcn, vif_priv->encrypt_type, From patchwork Wed Sep 8 13:30:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 507931 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp601550jai; Wed, 8 Sep 2021 06:28:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyXDzypT9oLYbQAm7hSjQefPM0pV9t5iXzzd/YKHXNyUs+nNPrcvR5aIcJ/WhR8ndps2uD X-Received: by 2002:a17:90a:190:: with SMTP id 16mr4170558pjc.31.1631107716915; Wed, 08 Sep 2021 06:28:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631107716; cv=none; d=google.com; s=arc-20160816; b=kwDM8xNEdbHk5+RFQMu3+VgicpaBCODEMFU5EGfODjC/zDPQpd9ICvJB4afAdwj025 8xo4oczOHxAgYL9b5thOk6kAKVFZwSGKT1w6SNGdAinTVqpEii11+scNxdHu5HCnjuPY UtCOpzMAKnFiYuokY3eC4vVrb3KJo0ao7rv4CwdKv42tvmgspjICGCwhmRsAngQiga1s YTNYh/AiJEgx/j6Dk8bdGDXoikWuzxduThoXBCN2so5khThg3z+AKSVTIoKwS/G2MpsX KggzyZAkZ+BHkqc7tBFtqpR99WAbbaG/Ps/fIikUatCLlrLtzKgP7EVbgzqii94DFbuH F2lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature; bh=U9qVabi4AiyOUAhToX2AIRGdG0uaHEgAX15L+IS29y8=; b=BOKxrS9h49WKMZ0qN1H6IxnYUtoan3ANt0BLl/oThme3PnoYA9wh+HvXsTeL9jBhXS UF/6l79tYximZM7m5FxgNlEOz0N/e49cn5TMQ9Do1b7TNuKRTvTFpQdwKtTV65SS/kbT Gl2k9z+x2pMWG8dpbmo1XjSsJMQ/WwZqWkMAUiegbf8OIDSjzo+SyZ0zljnouQb0tLbA U/3t2OvBlnJjxlEg2VEvni1yliTlClkvgl9TVawExPI+X3NUgykcg/Mhsfgw1oQhsewc lp+aNxD4Cqv2+Cc+yoTwMr4TUb0Rg//IMpNZpHa6RhXZvJRee1S/AHlLRp0Ho522Df3k uqRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=vZ9ht7n7; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=kzoNXbvI; 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 11si2380536pgp.384.2021.09.08.06.28.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Sep 2021 06:28:36 -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=vZ9ht7n7; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=kzoNXbvI; 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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=U9qVabi4AiyOUAhToX2AIRGdG0uaHEgAX15L+IS29y8=; b=vZ9ht7n7Nych/F d749LxsRQkXkP2ncRwaZj+9nDZNp9jzWmDTngTbv6cA94arg6CWPbb/rveS8IJPSJDSUrCXDj1fI7 wrkrBZucPLQAECojQJCIiF9iWsrnL68fY8oZrMMzQml3uDVfVJgg3i0/KXwIUeOEHWoIsoSeH8+9k r0K8vihykr3ze3YUuV2PKKj5Ap1qSg0hHa4cNDOLCQ94eXNZn+Sxg17W2MffnEGx/0GVYrEN7La06 /rbnfCPtXVhyHWUff8fL3mHzo6RxAAtdVH3rO6F8OAumWf8wq84yS4KrKdP7O82Gt2ns4rpUdB7G2 SgYZAKMC/KKPngbQ8IRA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mNxcw-006nBP-GN; Wed, 08 Sep 2021 13:28:34 +0000 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mNxct-006nA3-Ap for wcn36xx@lists.infradead.org; Wed, 08 Sep 2021 13:28:33 +0000 Received: by mail-wr1-x433.google.com with SMTP id i28so3342724wrb.2 for ; Wed, 08 Sep 2021 06:28:29 -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=TgoOn36K+S6nh4/mfR/A8ymiirWfbLzHv33YEgx+ZwQ=; b=kzoNXbvINYZXDC4r87cRVjjosqo7iqankbMTHHbpRtvbV+7drf0IQbEoyagmQ9/rCs 5AldCUjXP6CnKHLA7h8Xmos2ad51IUY/r0QPUzRpbfT3KevLK/4KycUHftXkuz121Vpi dT+kOPjhWB23j3F0ql6Z5rnny5Rw7LoSIM4vbgOVyijbzMT7+f25mvH9juER5OMJk/m3 XnEmrvhY6hgBsI4k/ktSJ3rZA3MMck34W8zyRe7dI0mRUE12qbtCUGZ3QEi5OUfJ7mKu rBlZNzqGisxoyzA9//mQRu841P7G7EFJ0IhJMq/N+VtJbfxko4NQhGEOdXMivnRhDATP aMdA== 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:mime-version:content-transfer-encoding; bh=TgoOn36K+S6nh4/mfR/A8ymiirWfbLzHv33YEgx+ZwQ=; b=C7txMjIJT4Ob6O9nJGJEHShIu1NsHWHI1S30ZXw1Xp2BZYzNcV2Y0q+Y2coSsTK0sV cGdPO1Cx2Abo8R+zQQTHe7FXWQyAYtujDy9kpBgF/T4NNGfKQq0UPDPV/qx6a3NY1xnn SZWyJB9viyDjw2uoqcMh/WK8Pak9U6HxBF/A4vJKAJXUv0xwRsmDorll7huTP0zA/mY1 oHzXpdmPebd+NBbj9cgVXlN1CYZ7G1PUu8IuxX4wi1ISvvr34Jwdf9cnonxKDhmNQHaF pYE9bowQ5szIt2ZQkv9Avj2wZ5V5GV/B09jv1gM4ydaS6qwimOxjmyACkzteBz7tByQp eqvg== X-Gm-Message-State: AOAM5310LR6XTpRAfdcxWG3wytsHJIlo8LqTVIxHxPUWOsIWWyo9NCp9 uVieXeIrpS6vecK+6Zgf6DpBvw== X-Received: by 2002:adf:eb02:: with SMTP id s2mr4240602wrn.294.1631107708394; Wed, 08 Sep 2021 06:28:28 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id u25sm2136139wmj.10.2021.09.08.06.28.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Sep 2021 06:28:27 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, linux-wireless@vger.kernel.org, wcn36xx@lists.infradead.org Cc: loic.poulain@linaro.org, benl@squareup.com, bryan.odonoghue@linaro.org Subject: [PATCH 2/2] wcn36xx: Add ability for wcn36xx_smd_dump_cmd_req to pass two's complement Date: Wed, 8 Sep 2021 14:30:19 +0100 Message-Id: <20210908133019.2408092-3-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210908133019.2408092-1-bryan.odonoghue@linaro.org> References: <20210908133019.2408092-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-20210908_062831_412612_CFBFA078 X-CRM114-Status: GOOD ( 13.67 ) 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: Qcom documents suggest passing of negative values to the dump command. Currently we convert from string to u32 not s32, so we cannot pass a two's complement value to the firmware in this way. There is in fact only one parameter which takes a two's complement value in the antenna diversity switch command. 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:433 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: , Sender: "wcn36xx" Errors-To: wcn36xx-bounces+patch=linaro.org@lists.infradead.org Qcom documents suggest passing of negative values to the dump command. Currently we convert from string to u32 not s32, so we cannot pass a two's complement value to the firmware in this way. There is in fact only one parameter which takes a two's complement value in the antenna diversity switch command. Downstream: iwpriv wlan0 dump 71 3 Upstream: echo "71 3 50 -60 3" > /sys/kernel/debug/ieee80211/phy0/wcn36xx/dump Meaning enable Antenna Diveristy Switching every 50 beacons if the signal quality is -60db or worse and a hysteresis of 3 db or better to switch from one antenna to another. Fixes: 8e84c2582169 ("wcn36xx: mac80211 driver for Qualcomm WCN3660/WCN3680 hardware") Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.33.0 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx diff --git a/drivers/net/wireless/ath/wcn36xx/debug.c b/drivers/net/wireless/ath/wcn36xx/debug.c index 389b5e7129a6..6af306ae41ad 100644 --- a/drivers/net/wireless/ath/wcn36xx/debug.c +++ b/drivers/net/wireless/ath/wcn36xx/debug.c @@ -120,7 +120,7 @@ static ssize_t write_file_dump(struct file *file, if (begin == NULL) break; - if (kstrtou32(begin, 0, &arg[i]) != 0) + if (kstrtos32(begin, 0, &arg[i]) != 0) break; }