From patchwork Wed Feb 14 14:47:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Pierre TOSONI X-Patchwork-Id: 10219169 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D2334601C2 for ; Wed, 14 Feb 2018 14:47:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C512C28695 for ; Wed, 14 Feb 2018 14:47:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B9874286AE; Wed, 14 Feb 2018 14:47:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2ABD428695 for ; Wed, 14 Feb 2018 14:47:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030963AbeBNOr3 (ORCPT ); Wed, 14 Feb 2018 09:47:29 -0500 Received: from mail-eopbgr40133.outbound.protection.outlook.com ([40.107.4.133]:44725 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1031118AbeBNOr1 (ORCPT ); Wed, 14 Feb 2018 09:47:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ACKSYS.onmicrosoft.com; s=selector1-acksys-fr; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=VuQpPa63qbOHLTlopMaNrWMVrO1zsZZD2eAD5rmsNUQ=; b=Ki9T8wbbIT3Qr8Nxr980lU8R6ObK0Y2lz9dCqUK7CSyucl6l7XZu765q5wR9qUzZJMK9rm9RmfcGdkkxndzmenRbat8ezP9doH4IaAMdCg2VBfefHdIQNUnzQclqJiNUy7rKBi5WHuv/cHp3SfO5ZlQUrH2jKZkMlNgSEENxTPs= Received: from AM4PR0101MB2305.eurprd01.prod.exchangelabs.com (10.165.38.134) by AM4PR0101MB2212.eurprd01.prod.exchangelabs.com (10.165.38.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.485.10; Wed, 14 Feb 2018 14:47:24 +0000 Received: from AM4PR0101MB2305.eurprd01.prod.exchangelabs.com ([fe80::d8a:c9fa:642:767c]) by AM4PR0101MB2305.eurprd01.prod.exchangelabs.com ([fe80::d8a:c9fa:642:767c%14]) with mapi id 15.20.0485.017; Wed, 14 Feb 2018 14:47:24 +0000 From: Jean Pierre TOSONI To: "linux-wireless@vger.kernel.org" , "ath9k-devel@qca.qualcomm.com" Subject: [PATCH] ath9k: mark RSSI as invalid if frame received during channel setup Thread-Topic: [PATCH] ath9k: mark RSSI as invalid if frame received during channel setup Thread-Index: AdOloTWs3soBtpHgSTucs91di8icEw== Date: Wed, 14 Feb 2018 14:47:23 +0000 Message-ID: Accept-Language: fr-FR, en-US Content-Language: fr-FR X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=jp.tosoni@acksys.fr; x-originating-ip: [62.193.53.221] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR0101MB2212; 7:CNRTH7iTLVXHPSCf+O14Rt2K96ovx91F3JYWj5lezJRo0lUCRGhZL6xJ/dLSUMhjli+qkfSR59oH9Cb3bDUp2wKNiBoe9PLCBV14GaWOEJymjzHC7Ik3ogP7C3Dt2sVQtFm0z4Pho0v4jmFfv4nRf7E30mbNrIFPb41oZ6HxnXIzgJKn3OC9NFhDPhUkgh8+oh/DH6HwJgKTVNdlcPJGM9yMMTrb/M0LFHqzjwuxQEwII+G+DI2u/HwMgKyflONS x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 41d99f34-69de-41c9-f9dd-08d573b9dc01 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(7021125)(5600026)(4604075)(3008032)(4534165)(7022125)(4603075)(4627221)(201702281549075)(7048125)(7024125)(7027125)(7028125)(7023125)(2017052603307)(7153060)(7193020); SRVR:AM4PR0101MB2212; x-ms-traffictypediagnostic: AM4PR0101MB2212: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(3231101)(2400082)(944501161)(6041288)(20161123558120)(20161123564045)(2016111802025)(20161123562045)(20161123560045)(6043046)(6072148)(201708071742011); SRVR:AM4PR0101MB2212; BCL:0; PCL:0; RULEID:; SRVR:AM4PR0101MB2212; x-forefront-prvs: 0583A86C08 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(396003)(39380400002)(39830400003)(376002)(346002)(199004)(189003)(3846002)(1857600001)(99286004)(305945005)(7736002)(6436002)(478600001)(86362001)(110136005)(186003)(3280700002)(316002)(14454004)(105586002)(74482002)(68736007)(5660300001)(102836004)(33656002)(3660700001)(2501003)(8936002)(2906002)(6506007)(66066001)(97736004)(53936002)(7696005)(55016002)(9686003)(5250100002)(81166006)(6116002)(106356001)(81156014)(74316002)(2900100001)(8676002)(26005)(25786009); DIR:OUT; SFP:1102; SCL:1; SRVR:AM4PR0101MB2212; H:AM4PR0101MB2305.eurprd01.prod.exchangelabs.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: acksys.fr does not designate permitted sender hosts) x-microsoft-antispam-message-info: aBj/iCI+8BQFp0LGjYLRObHTaT5dFSSMrmF8mEQVM3ymuVk28d9h7jqmzTs7m/Z1xO3/yr4X/A65xj2on63vXw== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: acksys.fr X-MS-Exchange-CrossTenant-Network-Message-Id: 41d99f34-69de-41c9-f9dd-08d573b9dc01 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Feb 2018 14:47:23.8960 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f18a6414-d5f3-4b5c-9345-f30c01d87e32 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0101MB2212 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ath9k returns a wrong RSSI value for frames received in a 30ms time window after a channel change. The correct value is typically 10dB below the returned value. This was found with a Atheros AR9300 Rev:3 chip (WLE350NX / JWX6083 cards), during offchannel scans. Mark the signal value as invalid in this case. Signed-off-by: Jean Pierre TOSONI --- .../a995-b-acksys-ath9k-wait-channel-change.patch | 39 ++++++++++++++++++++ 1 files changed, 39 insertions(+), 0 deletions(-) create mode 100644 package/kernel/mac80211/patches/a995-b-acksys-ath9k-wait-channel-change.patch -- 1.7.2.5 diff --git a/package/kernel/mac80211/patches/a995-b-acksys-ath9k-wait-channel-change.patch b/package/kernel/mac80211/patches/a995-b-acksys-ath9k-wait-channel-change.patch new file mode 100644 index 0000000..d1e1146 --- /dev/null +++ b/package/kernel/mac80211/patches/a995-b-acksys-ath9k-wait-channel-change.patch @@ -0,0 +1,39 @@ +--- a/drivers/net/wireless/ath/ath9k/ani.c ++++ b/drivers/net/wireless/ath/ath9k/ani.c +@@ -333,6 +333,7 @@ void ath9k_ani_reset(struct ath_hw *ah, + return; + + BUG_ON(aniState == NULL); ++ ah->chan_stable_time = jiffies + (30*HZ)/1000; /* 30ms */ + ah->stats.ast_ani_reset++; + + ofdm_nil = max_t(int, ATH9K_ANI_OFDM_DEF_LEVEL, +--- a/drivers/net/wireless/ath/ath9k/common.c ++++ b/drivers/net/wireless/ath/ath9k/common.c +@@ -220,6 +220,16 @@ void ath9k_cmn_process_rssi(struct ath_c + int i, j; + + /* ++ * RSSI is not available before 30ms after reset on ath9k. ++ */ ++ if (time_before(jiffies, ah->chan_stable_time)) { ++ ath_dbg(common, ANY, "early frame rssi=%d\n",rx_stats->rs_rssi); ++ rxs->flag |= RX_FLAG_NO_SIGNAL_VAL; ++ return; ++ } ++ ah->chan_stable_time = jiffies; /* advance stable time to cop with jiffies wraparound */ ++ ++ /* + * RSSI is not available for subframes in an A-MPDU. + */ + if (rx_stats->rs_moreaggr) { +--- a/drivers/net/wireless/ath/ath9k/hw.h ++++ b/drivers/net/wireless/ath/ath9k/hw.h +@@ -816,6 +816,7 @@ struct ath_hw { + + bool reset_power_on; + bool htc_reset_init; ++ unsigned long chan_stable_time; + + enum nl80211_iftype opmode; + enum ath9k_power_mode power_mode;