From patchwork Sun Mar 20 23:30:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wenli Looi X-Patchwork-Id: 553334 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76137C433EF for ; Sun, 20 Mar 2022 23:30:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343786AbiCTXcB (ORCPT ); Sun, 20 Mar 2022 19:32:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237876AbiCTXcA (ORCPT ); Sun, 20 Mar 2022 19:32:00 -0400 Received: from CAN01-QB1-obe.outbound.protection.outlook.com (mail-eopbgr660086.outbound.protection.outlook.com [40.107.66.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA675132E86 for ; Sun, 20 Mar 2022 16:30:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QVzXFZCUv0zZuww1OKPZXs7gSkvYfGux+4R712zqDf+Cy93196TusIaIPNRv35OFMiA5SC01ji3NCLrLHKAxQwGfPp/PHbUjFDSjpCzYreVl4tVLbUWfpMy8qTrQVWMaCJClB9++C3Iuk/3+Y49IbRuARtPcRHpL3wKvGXrWq/pyEBJxOQ70ZFRDJZ37F+TFpsC/cT8XCZeEYqiT407FG8BdwWGC8BgynWjTJjYKB+9riJxlLRcn01Xlyyjxtiy++7rqQI6QJ56RnIWWxcbk1MrUhsWhiU09fE2L74vgZ0O6TERBW5lAacmn8m6NIZicNrHsdNVvIDrW/f9P1EunAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bLF60ayAhZG81xVgDrxVUOb6up5Hg4WxZbU8wSzTGwo=; b=Xpy6WJ8TMzCe3Pw3Z8ZdGPl9eRO4Kmmr/onKIprnsT+pZjAyLDW0Pi5KCqGR81NOCqCTrXkqniMFISnahsmXNzCgIVMQcmZIfA/9IGPA7kfEnft0JMrHPg4SiH+AP+QU1I+5o6OFvhTW3DUHHZ26ApVHNaO0hICrA6IBX4AouHEju39Ker33aWi5E4bhnopPpvkWiCWt+6YFxntS0EA1zXfs08OTouBNfmN32n0tiQw5xdTCmbkNxUuPSNhOqlWgyzkREAnBD5YgOcCG4UI9vx2PNTYEoz+pj9p1B1YO4jLiN9SoYc1d+einVKjd1j+mIFOeckGczuYz6X1tEm43QQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ucalgary.ca; dmarc=pass action=none header.from=ucalgary.ca; dkim=pass header.d=ucalgary.ca; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=ucalgary.ca; Received: from YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00:4a::23) by YTBPR01MB2989.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:18::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.17; Sun, 20 Mar 2022 23:30:31 +0000 Received: from YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM ([fe80::dd8c:6e57:c431:9323]) by YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM ([fe80::dd8c:6e57:c431:9323%6]) with mapi id 15.20.5081.022; Sun, 20 Mar 2022 23:30:31 +0000 From: Wenli Looi To: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= Cc: Kalle Valo , linux-wireless@vger.kernel.org, ath9k-devel@qca.qualcomm.com, Wenli Looi Subject: [PATCH 1/6] ath9k: make ATH_SREV macros more consistent Date: Sun, 20 Mar 2022 17:30:05 -0600 Message-Id: <20220320233010.123106-2-wlooi@ucalgary.ca> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220320233010.123106-1-wlooi@ucalgary.ca> References: <20220320233010.123106-1-wlooi@ucalgary.ca> X-ClientProxiedBy: MW4PR04CA0176.namprd04.prod.outlook.com (2603:10b6:303:85::31) To YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00:4a::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1356db55-eb76-4b99-41e4-08da0ac99fcb X-MS-TrafficTypeDiagnostic: YTBPR01MB2989:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HpIcdphwF4CcrU50OhgW2ahzpu5Y3dgiT1sfdDJ5Yo140RTst0kam4pHnFIUcBQxv/fFPkwDfibDsyx52SP4rTT5BtzYEFVfvMO28HgmpAJvhp9A34OI7+D0+wQWO4RkGAElTuZT3P6eKg/dFg+zyhnsaCNrnGJm2vSbpDQsCc9z3m1Bnonu5xlZgTOmfJR/pihq+3O+upSWb3a9aak4it2f615qKc3nG6iAZ5g2yE7q7x3MkSI+NSLHZGpqtHkKoyamvgx9F/jDGC8ZmH+XeuEICDC7ktuSsBKXnUGb6yUW8KtzJpL6MRaGC1iMcYaeWPMmQw6HF0Bs3gSfchcZ/ClgjYbWZrSppIQlJwZH4aT4g1SyypG25feUhzkwQ/uFjAPdTFN0JLxGDYeupLKdB1I0ZMBkR8PGzDkogK7N1hOi7KWrNTVfow7hDP3Y99BF4SouhStQoBYqCIKoeRCxyNHLdPdOz828/hFYFnhbUiGSCUf7R5RbkJXbeobgxNcKrs5X/zBES6pEeujpijUzFpYm3YWwN1IOGt3JgNWJ9uIGSmzqCUu6TC8G1BvEr8LAoeD9Psy7DRklUNoKSxtwjoE6GlKuIndqJChnMvLy9WhfnRy3LJuPbslGUj0XXYVWrtvo2tgXF/ts2ciXwEw8xgm7v/Ar1+AxQux6EFj+aatC3juRmb6MG/d28K8TIpK5 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(6486002)(2906002)(83380400001)(66946007)(66556008)(8676002)(66476007)(4326008)(786003)(316002)(6916009)(54906003)(86362001)(508600001)(5660300002)(38100700002)(38350700002)(8936002)(186003)(36756003)(6666004)(26005)(6512007)(2616005)(6506007)(52116002)(107886003)(1076003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VAEkBtdo90beJLB878CX8mP1wJ9a0JtHbPbVE02+4jawWBEQbqDUNmKa18z0HY/KjtfzPGFTvb1meOtXELrV5L5zNgcI4dSHb+zs0BhfacOnI632i/ptA8mpoBq0rocrrVlRHCfvahHZoiuEgNQOBeuKK1Z57Pp3OI9JTJebCsuRBcBl5nVV8QHOMirHo33AWjM9WUOfewXm/PeYIwX9FJPopV3kT8H9hABlDwGSYsFBmbJeF/oMD4nUFNn04/vwFIeGihU2SEwtlWC9jyU/xBp/YYX89JRTiOIb9b71N06WAEtiPRJheUY7JsvCV/ChykJg7IteRTO6Dczhegr923Q8n6lIl9kJYWiprSctUzIeYMRd/rImJbx/LTCzDEOzTI64rxECqBrnlpve/1Fn4dE6X0FSFAMk3Va2tFBgU7t/71bEBhs88lbI/pCKXA6BMiMyu0KjbY6BwJArei7IBXftssr6wRygdK4/VZuU47eTiAa6LQNdd2XFo/J2eiE0GYr+J5Q0BuQ9yW5+qu2Pq7+6TboTA5X5/KxA6eCP2oqMCruhJ+dj5eWrugc4zutIwyfAnAnjv9XWB7mznGm8hUJXtVbnXkfJWtq+opUvxTZTTp9WxFPvWhleG/rc4ZTKJO84Lc2QrmVw700/7TcdD3yMSHr8K37xATpnl8Uo9nlQeyUfjZH9ydt+tE4XEMhFHxFbw+lcmV+vclCivfuxTPWH7I6haA07CBWH5q+qrmbO5Kg7Latq/PnYULH/76/UnJ1sVzcUHRH86x2PjVC37jJME1Fd0bkKMO2QCtSZXr7EpbpZ+8m6JQ5dJXyv64zppwmh2SAWYx2NSqQPBnNxvNnWbSg0dokyF/tlLZnWi5xwyoPPMFisad9J+ArWEj+tD4qvLsPhoDQPEke4mNAd3/SGBuRvPs37I5fe4Psp7kbjQCMjOTs8onP0yGy64GRrEZ7uOMBcDxSMWwNbjezWvAnNlYzqjvTHk23Mm0KPCF9KtWVML7192RxNRrp1rbH//1nbND69rO8R3hPhGIO0cC3/noBZq9CICNrfN12jhC+Oo5z5bqUdlcr2CBCDibu+2KgH7V7xoWLBWsEzg3c35zQXRoR1q77tQGZfsCJssft5hXm8uoY9gWhtkRJkZolWJzJtFAE2I24W2sNT/8wqtbqaqhPYwuTMgH+PIKcdazhfaEqjVA/kPzgIMot8i8rMfWcRd72mfkpadsrWuDq08RJJjWuuhgFDJSTgCGycDTmCvyWaOmeDUkrtcjvkd6b+dbVi3NvTRxi0MGPhX4AbpAlYoimHZmgQ6YcMFqoZpKzAxll6TsWiQgKTSU+iLZurEQ5Su0jwCUf7DKBMijvoiSONPHV9dnqB3VeqRKmazoi/QRZuNFI8+tZAW8Po166iI7uayGCTYaHdwc0P1N+FdangmVdZWzFInIwbClDnKGI8nkyZ+BC+4wYgWmdjw7bH X-OriginatorOrg: ucalgary.ca X-MS-Exchange-CrossTenant-Network-Message-Id: 1356db55-eb76-4b99-41e4-08da0ac99fcb X-MS-Exchange-CrossTenant-AuthSource: YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2022 23:30:31.3354 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: c609a0ec-a5e3-4631-9686-192280bd9151 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 07mzsvV0mLdCwiGmoz5K8FSd/3ty+p1iBpSzhhfnfZHbyhlQDxe57Ku3n6G/t+fJJQce1tVPaetT0xJEQh4o8w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTBPR01MB2989 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This makes the macros more consistent and removes hidden dependencies on ah for macros that take _ah as a parameter. This change does not appear to affect the final binary. Signed-off-by: Wenli Looi Acked-by: Toke Høiland-Jørgensen --- drivers/net/wireless/ath/ath9k/reg.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/reg.h b/drivers/net/wireless/ath/ath9k/reg.h index 653e79611..8983ea6fc 100644 --- a/drivers/net/wireless/ath/ath9k/reg.h +++ b/drivers/net/wireless/ath/ath9k/reg.h @@ -834,8 +834,8 @@ ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22)) || \ ((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100)) -#define AR_SREV_9100(ah) \ - ((ah->hw_version.macVersion) == AR_SREV_VERSION_9100) +#define AR_SREV_9100(_ah) \ + (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9100)) #define AR_SREV_9100_OR_LATER(_ah) \ (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100)) @@ -891,7 +891,7 @@ #define AR_SREV_9300_20_OR_LATER(_ah) \ ((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9300) #define AR_SREV_9300_22(_ah) \ - (AR_SREV_9300(ah) && \ + (AR_SREV_9300((_ah)) && \ ((_ah)->hw_version.macRev == AR_SREV_REVISION_9300_22)) #define AR_SREV_9330(_ah) \ @@ -994,8 +994,8 @@ (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9561)) #define AR_SREV_SOC(_ah) \ - (AR_SREV_9340(_ah) || AR_SREV_9531(_ah) || AR_SREV_9550(ah) || \ - AR_SREV_9561(ah)) + (AR_SREV_9340(_ah) || AR_SREV_9531(_ah) || AR_SREV_9550(_ah) || \ + AR_SREV_9561(_ah)) /* NOTE: When adding chips newer than Peacock, add chip check here */ #define AR_SREV_9580_10_OR_LATER(_ah) \ From patchwork Sun Mar 20 23:30:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wenli Looi X-Patchwork-Id: 553471 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 665C4C433F5 for ; Sun, 20 Mar 2022 23:30:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343788AbiCTXcD (ORCPT ); Sun, 20 Mar 2022 19:32:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343787AbiCTXcB (ORCPT ); Sun, 20 Mar 2022 19:32:01 -0400 Received: from CAN01-QB1-obe.outbound.protection.outlook.com (mail-eopbgr660086.outbound.protection.outlook.com [40.107.66.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EA9A132E92 for ; Sun, 20 Mar 2022 16:30:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E1u+zlCFJ/k+WlCi3nUmorEVpYoliooMZpf8lFjZ8vknr6SipTnPta7fF1P2cuNErtwCDs+IVJVDGkMQjhwg70KSX7T3FmsocbncLgQopSmQT84OkUngeL4kKqCZx6glIgiAdNvnQpCH8VhpkJa166RPs9UMr6B0mpg8ZZ3pCA21HIodgH4tBX8a+N/ZZFWmzc2erjQgJKY66utVkH4zkIbupJPYzwzydXQ9m2PrcM60PrfMGbJ0Wi7f30AHNQ7ze0EooKCDYNowyy/0qNep8YxoK2SheDJrf3dUJiacXSICdRUFSV0jAvqhi8OdkfxzlfXv/poP5jZLMkmOQ+qyVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JR/s85oMYnFNTtRcZ26p56QPVSezp52h/3LNoTInDmM=; b=MCfDSrKnwTg48KNl06G+804kZEPEu4LH5fCtWxSnpJI+LMpM4UlI+yYKJsNLP+hGXUscGBlg13u2QHNd8bTHd7O+/4ZTnOz/1ih7tt5IOH1+2x2uiLoUWhzmX6cb1wmXiTZUQtWeZ1n3cM2f2ufGY3pX3SAq505H4eaDsSktoAlwBNOJqlz68a4ykOkMBZb8F0+m5LAqclZeyfEBLLFY2OzLNriP9HvCrQVNEvwzjYD7Glk/XNlMfre7BX9NV0qlBotXF+lsmAVVlc9HFRebsbjbT+SKwXYN3Zg4jfK1dR2bjVCHc/RA5vcGGynt62Zrng+f8IDlYdqTZ0BsY85/gA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ucalgary.ca; dmarc=pass action=none header.from=ucalgary.ca; dkim=pass header.d=ucalgary.ca; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=ucalgary.ca; Received: from YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00:4a::23) by YTBPR01MB2989.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:18::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.17; Sun, 20 Mar 2022 23:30:34 +0000 Received: from YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM ([fe80::dd8c:6e57:c431:9323]) by YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM ([fe80::dd8c:6e57:c431:9323%6]) with mapi id 15.20.5081.022; Sun, 20 Mar 2022 23:30:34 +0000 From: Wenli Looi To: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= Cc: Kalle Valo , linux-wireless@vger.kernel.org, ath9k-devel@qca.qualcomm.com, Wenli Looi Subject: [PATCH 2/6] ath9k: split set11nRateFlags and set11nChainSel Date: Sun, 20 Mar 2022 17:30:06 -0600 Message-Id: <20220320233010.123106-3-wlooi@ucalgary.ca> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220320233010.123106-1-wlooi@ucalgary.ca> References: <20220320233010.123106-1-wlooi@ucalgary.ca> X-ClientProxiedBy: MW4PR04CA0176.namprd04.prod.outlook.com (2603:10b6:303:85::31) To YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00:4a::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e8a6220f-f1d0-4c31-5fc2-08da0ac9a197 X-MS-TrafficTypeDiagnostic: YTBPR01MB2989:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 30A0RTEfJflWWixr35I9IN4G5BD3e2+2E3gNuHaC0dDJhOn+viW6NOZEFa+v0xaoS2Hk/rMin46CKKEkpR0AETAfwiMBxN+apRj5x5Xxwt8rRzeIIQnHn3hNXLQmOhWCy2GRJGQv06VjGmgVAVNgUhXNBUa08XyS5wq75uq5K+I7pntNnW7xta9tKxP425ErnVUGsHPCaZkUwNVc6QV11PvqX8r9QEwapwl7rxqOqMP2buuFuw29Va82auZxxWMBt1MZo2wM2SsplOxBvepL85PfFaKN4g99F36seNrjao+YLXgRwIfwBZEa6AmMgYfa40xiFw+0JhAjy0uKH+fBF9NkdAsu1qXMUi4KBXiXLLh7SOioca45kZ9pLmyeRj0Nj4pkjJ2NDGVcBK++L+/lH5RT5I3ZAlsQmZ83K4LaMgSahlKgXmQPmOwkH5vJ9EKcNSk9SKbObODPyegwHkFCcKu6y76yMwDqpM0ly7N/Gb2cyZMO4btgDSYzi5bEYgBvfrheWjyP8HpGHW5QpgteSHThRNbC9Xb1Y47X/n2uos85sjnbpn6mYNeFSCF4txMED3ByfVwS3aS4z7Y1gkBP6K5GvOA47zYSzx69UJOHv1oL0s1u2maQAjFg1cqAPIry1I485f6YwtWYDKj79bIyw9pmfTlfHVVWcFaFBZXX8jOxiWqDyil9VZjl61M1j6pt X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(6486002)(2906002)(83380400001)(66946007)(66556008)(8676002)(66476007)(4326008)(786003)(316002)(6916009)(54906003)(86362001)(508600001)(5660300002)(38100700002)(38350700002)(8936002)(186003)(36756003)(6666004)(26005)(6512007)(2616005)(6506007)(52116002)(107886003)(1076003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ju8nixe9sAeoEpquFZ1ZhkkVHdl+cewtJQ7TNQVRDtvJ7kXpDD5mqh0B3Qi16L4P1nmTdffV3NzX9ACENFufxz+5Ep9Goa0gCXz4Uj9S66qAlyerrhmn8J8aWdrNl9U4QEQgJn49lrPs5oYbIUJ0p9gSQR1ssydV8QX/XOCEA/43LkJ2fo3XIfdRvRTLES2O4CzbPFQyD3S8PjO6ngYHH3a8jwaaL8c1/WzoLJXA1i+1DQ0kCBHrHc+b1rZEZ4MQiROH4nGEOgpBJ7zhOCte6zHGhSDFLzdSkXaR6omEVNkYkD0LWrutnSIHfHM3e+Ro0f+tTDmfsO55IhntW0esrBaqPd2hZ2+IY/JSs+LGiGu+wHxRSu95Rhos+tM0OO3ud+eCcZ7AdamD1vePDNLjpZP8za/oi8UJcXm3i7Qv2/ve5HSX7JrAY1eScoFbG0JuNfZLU68KxvBxY8kwe6S3XwtdLWZGGHQ2azt/tUSGCQ0lnFPpzfcHpwcgxCWaLMJHLKAEgGfyXRvPO9dpvYHgIdtxPTrWx9Jz7Ip8lZ9c9YctYLAPMpsrWQGFrGaqQKZfixuwLC5fKNjkxlmURSRk2PYieZeuKU4HOJ6/Sp6vfCoR+wvsEGPPtioxA/10AmWXWtpapBhS6hCgOahz6OquHWZdDJ3r1vwdtYLWYEPvSD17xNHP2LYugRDA2177OtvlA0Zm6BHcVn9fTrIEg1S+41pDbJXOApMwV/7JB9tAUqVFOIKuOhl2WDFYxlVx+1ps0WUx0BQkGbP0wo9fCefXF35u1KfyNEhrCun3HzlVQ81G8GVvyQvru7aICwdDiP1T8SscrLCAHtbPfV+VgLWF7R03KbWKDrQauim6Y0RXg6sR/mMn8i/TMHTBHvQcrlwOR23c9nNnET51yjll/s0pii2I9hvVkbZ9kfGlXXXQNiBC52q27hdrJY/QmW9FTPfO5+R+mC0MLBsCyBk7Kt3IRP4oIkkRubjk/z1t/qKLgHsxLbZrtHypIZKXrRE5Qj5AWw6ak8bdtL/lXPAegCi/JcpJviBgUs9+5tchJWI57+Ho9GX4RhMLcLQ6sHpuXma456jFSoZ0555F5HYKm2yJii9+1TJYouAUZK7dMiWeKUzsfv/EosKGr8zuKjibZKCx9LyDjXn9AqdemqCoyDTgCfq8E3RAkEcgUqKCBnYRasSa08PEXu780l4hdafj6jcQ60iKXgmQe/cgzOeJXAHMatSq9p+N3BczY2drcXf2onuYi9uOu6Bmv60i38t3o4ACZw+PkMWSVr6xBsx381fSKPZ2ZLXIw0EPSY8kWeUIORPJRE/h8krWf+1EuTIV+kXRaca7cBRYM59UeKiglJIpHy/Vuzj3w7rQwJ36tX61pRtQsfTLV+grN4sPA+Kq4fbKqOPWCTKX9e3Nax+EQnqv/Cdm/2jLZhH1goDtkMGcqK035BQvixs9Z+Tei49IBZ2O X-OriginatorOrg: ucalgary.ca X-MS-Exchange-CrossTenant-Network-Message-Id: e8a6220f-f1d0-4c31-5fc2-08da0ac9a197 X-MS-Exchange-CrossTenant-AuthSource: YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2022 23:30:34.3196 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: c609a0ec-a5e3-4631-9686-192280bd9151 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: PNrj5SjtGBRHNNHMVxeS5a8Gar6wMt0HzG8ga4flZOBBEuXfDW/2ChB91fkJ7z1Bin7RW+rTp26idFUICCw27A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTBPR01MB2989 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This makes the code clearer since set11nRateFlags currently sets both the rate flags and chain sel. This may also be required for QCN550x support, where the rate flags and chain sel are in separate fields. This change does not appear to affect the final binary. Signed-off-by: Wenli Looi Acked-by: Toke Høiland-Jørgensen --- drivers/net/wireless/ath/ath9k/ar9002_mac.c | 9 +++++---- drivers/net/wireless/ath/ath9k/ar9003_mac.c | 9 +++++---- drivers/net/wireless/ath/ath9k/mac.h | 6 ++++-- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/ar9002_mac.c b/drivers/net/wireless/ath/ath9k/ar9002_mac.c index fba5a847c..a8c0e8e2d 100644 --- a/drivers/net/wireless/ath/ath9k/ar9002_mac.c +++ b/drivers/net/wireless/ath/ath9k/ar9002_mac.c @@ -301,10 +301,11 @@ ar9002_set_txdesc(struct ath_hw *ah, void *ds, struct ath_tx_info *i) WRITE_ONCE(ads->ds_ctl5, set11nPktDurRTSCTS(i->rates, 2) | set11nPktDurRTSCTS(i->rates, 3)); - WRITE_ONCE(ads->ds_ctl7, set11nRateFlags(i->rates, 0) - | set11nRateFlags(i->rates, 1) - | set11nRateFlags(i->rates, 2) - | set11nRateFlags(i->rates, 3) + WRITE_ONCE(ads->ds_ctl7, + set11nRateFlags(i->rates, 0) | set11nChainSel(i->rates, 0) + | set11nRateFlags(i->rates, 1) | set11nChainSel(i->rates, 1) + | set11nRateFlags(i->rates, 2) | set11nChainSel(i->rates, 2) + | set11nRateFlags(i->rates, 3) | set11nChainSel(i->rates, 3) | SM(i->rtscts_rate, AR_RTSCTSRate)); WRITE_ONCE(ads->ds_ctl9, SM(i->txpower[1], AR_XmitPower1)); diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mac.c b/drivers/net/wireless/ath/ath9k/ar9003_mac.c index 5184a0aac..ff8ab58e6 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c @@ -144,10 +144,11 @@ ar9003_set_txdesc(struct ath_hw *ah, void *ds, struct ath_tx_info *i) WRITE_ONCE(ads->ctl16, set11nPktDurRTSCTS(i->rates, 2) | set11nPktDurRTSCTS(i->rates, 3)); - WRITE_ONCE(ads->ctl18, set11nRateFlags(i->rates, 0) - | set11nRateFlags(i->rates, 1) - | set11nRateFlags(i->rates, 2) - | set11nRateFlags(i->rates, 3) + WRITE_ONCE(ads->ctl18, + set11nRateFlags(i->rates, 0) | set11nChainSel(i->rates, 0) + | set11nRateFlags(i->rates, 1) | set11nChainSel(i->rates, 1) + | set11nRateFlags(i->rates, 2) | set11nChainSel(i->rates, 2) + | set11nRateFlags(i->rates, 3) | set11nChainSel(i->rates, 3) | SM(i->rtscts_rate, AR_RTSCTSRate)); WRITE_ONCE(ads->ctl19, AR_Not_Sounding); diff --git a/drivers/net/wireless/ath/ath9k/mac.h b/drivers/net/wireless/ath/ath9k/mac.h index fd6aa49ad..af44b3381 100644 --- a/drivers/net/wireless/ath/ath9k/mac.h +++ b/drivers/net/wireless/ath/ath9k/mac.h @@ -35,8 +35,10 @@ |((_series)[_index].RateFlags & ATH9K_RATESERIES_HALFGI ? \ AR_GI##_index : 0) \ |((_series)[_index].RateFlags & ATH9K_RATESERIES_STBC ? \ - AR_STBC##_index : 0) \ - |SM((_series)[_index].ChSel, AR_ChainSel##_index)) + AR_STBC##_index : 0)) + +#define set11nChainSel(_series, _index) \ + (SM((_series)[_index].ChSel, AR_ChainSel##_index)) #define CCK_SIFS_TIME 10 #define CCK_PREAMBLE_BITS 144 From patchwork Sun Mar 20 23:30:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wenli Looi X-Patchwork-Id: 553332 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2C76C43217 for ; Sun, 20 Mar 2022 23:30:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343791AbiCTXcE (ORCPT ); Sun, 20 Mar 2022 19:32:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343790AbiCTXcD (ORCPT ); Sun, 20 Mar 2022 19:32:03 -0400 Received: from CAN01-QB1-obe.outbound.protection.outlook.com (mail-eopbgr660086.outbound.protection.outlook.com [40.107.66.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C745132E89 for ; Sun, 20 Mar 2022 16:30:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g6WU07vEaVLBD0fayC6GlksWmhalKtvPiaf7UasMs8bhBovMLyh7HxVcL0crDpbm9dIQpEoTuddiMJtRndqBzldQHEvxrlWU9NnJx6GCqbFA7LCL5x72E9iDB5CWMnbW36GmJIDzbzfKWXbQwfnLEPelTAj/dIVButeeYMHNiIOL2FPWTTGLWt0gP0afBvav2e6dcqgjH+bjPNS+SAhJRL+RjJ7Az3XDZmINURNiFrAcG9Fr2Y0KbJYdH7Tc4ELVlkeF9aMzIGnPC8JITTEkxjwvek5RoAiydiQdoeFJvp3+M2xakw3+OlQt9MX16hleCRmHdMhMYvQvn/yT8rzeOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=O6PdhnFkSqTLNDRdmviaxpVSo4zz1Nks9HV5MOBLuc0=; b=HuQQDpC3Z91avSYgPd2Nuu7DJdMQIZc69Byh/l/hkNOJK8iCM2iP9qKuaXhfc3F2Tm9PBXitpggQndSe9HQ9Y+CqfsWmsys45J53wGcMg6ptJ0Y6K87M4XdYQFr8IvZNIheX/07zz+nUyBNtEKlZJjFNMZauezB4BJh5JgUoid08zS4TJ1bMaGzt1fnhHeQz/5DT1VVvs/VXT4xnYo9nX6pu97wJhmZsZYUf+51lkW+FfrOafTkYY55r/kYnC+F4BEJql8B9wrBjzJyOz47jKagJ7VyE77VuUkkJMbxNCwTQpi85ZMX1NCm2ZG5cdWKm0ElUPE1RfH2KLWATHPYtKw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ucalgary.ca; dmarc=pass action=none header.from=ucalgary.ca; dkim=pass header.d=ucalgary.ca; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=ucalgary.ca; Received: from YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00:4a::23) by YTBPR01MB2989.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:18::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.17; Sun, 20 Mar 2022 23:30:36 +0000 Received: from YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM ([fe80::dd8c:6e57:c431:9323]) by YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM ([fe80::dd8c:6e57:c431:9323%6]) with mapi id 15.20.5081.022; Sun, 20 Mar 2022 23:30:36 +0000 From: Wenli Looi To: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= Cc: Kalle Valo , linux-wireless@vger.kernel.org, ath9k-devel@qca.qualcomm.com, Wenli Looi Subject: [PATCH 3/6] ath9k: use AR9300_MAX_CHAINS when appropriate Date: Sun, 20 Mar 2022 17:30:07 -0600 Message-Id: <20220320233010.123106-4-wlooi@ucalgary.ca> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220320233010.123106-1-wlooi@ucalgary.ca> References: <20220320233010.123106-1-wlooi@ucalgary.ca> X-ClientProxiedBy: MW4PR04CA0176.namprd04.prod.outlook.com (2603:10b6:303:85::31) To YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00:4a::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a9bb04fd-28f8-4edf-b23d-08da0ac9a291 X-MS-TrafficTypeDiagnostic: YTBPR01MB2989:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Wj1j934utkL7nFE8GtbGAZ6sMPV2sKVjM9e5Urmww8A+49FFr9QvlGsASkuaj94N3EtLmhSqkj1Pd7BaeEVznu/98akbvhsVuam2nYZiamOunqongbfyBurKyNgb/cyGoeMjTGpAp5Ue0QcvMxbfXR19gGMhgi4e25epqr6TK0ddvaQsupCgk11pSRoB/IbpD4UArvYYqNVP2OuSpHB+21NOw+QV6x/wsd9rHeP2YmCw6fa3xXKxomWPTud7pCDoiyZ6GnIjTxFIsd69HZOz8dn2rrKxU7HmQgAf/PXLA3EagmI0eYhStYgLjaN0PK72TOZaE+o1EMUBG9LvSBUQXICaFtlU9pe3cCJjOfvQ1moynFbu/AcsKo6lRljAFWVENm4dYqc+9WqAM5AkBPB9rm/Qj12xvIJUU6hSxfJMU981fc0Cf4QpsH45UARNi+xQcf8ziCavIxnYKh946Az6oTO3WFuuii7wwRH9VTICu9K+XtzBr7itiIYPU61/NNV3ZacDLS4jGNEpXeC31JVFfEWFXaKSfxi/+HU0wTPF2JsemPsEZg/c6zaiAsza5s2fitV5kyEuYQMErn2STyRULK2+BiXMFSBAkAXK86s/Gtf6ytc+9JQHuhQPObYxD9rGA5qgnyFtt/it1wfj7RbeeKQfJzDZ54qJli6DNZ4zEoSK7E/9bvdIAtDbce3mRAnk X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(6486002)(2906002)(83380400001)(66946007)(66556008)(8676002)(66476007)(4326008)(786003)(316002)(6916009)(54906003)(86362001)(508600001)(5660300002)(38100700002)(38350700002)(8936002)(186003)(36756003)(6666004)(26005)(6512007)(2616005)(6506007)(52116002)(107886003)(1076003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vAT5N7tyjOiG851Ur4uRC9qT0P9wolxm+pv4yVXJAg0Twz1osmSOQ0QiX6fhFPpd/ms/5DzVhEra7OE/jGIpGCipQtOavaHvizRXQfYWiynvg9iJOUN3k/m7YOcMomtgTYsSyTfGymdye1Y/yRIiqwoDPw9F9SmBwlLrfw5lxWUw/grnpPlX+72Zo+gNcBNXDb9o9GiHBdkoPhLasndhPFVQAzILFZUh2SUXu2NyyQiV3kabD2hKAoH8tXN1FhyJidlbtuXpsyG4rS7Qosc6wgfKYpNdytS2WctPhSzn1BEPv6SKG33bGMLsls2EVAzksVcmrQ8wkDs0LcJlbRrvj1Ky3ztcoCKdIjgsFXf0dV98xRxkOTGwtbGO2Lly1WqsJJRe8YZGyzkkzTUVh6v9MXVLuh5F+1/uu8gp9MEOdbveB1FE6YUOiukoXJg+Z0a1rndeU11AVMePX+s2f/8sbNesadnehV6y2W+QO4SHKQWPhkKOQZDwR1xQhTM9L7H9fJDIhNppwjbIM4aNI/MhDMZlnApmxwP1Olm+htujjHIBUpxwigk+zkwVVPDZUOoBiB+IyqlDlouIqHBneC1sOmXSTamak2deNj9ERwjuGgI5D78kiOHsDBwuyWpeZbQqx4I3ZB7eiVhP7h1x7cy5wOqdQpbFxs4OmvOkdmYmax6ly6NO64UCY1DO2M3xhJX1PKgiQR+waf7BWcfOtKh32jGaj3uSoyb8xWWiRirYKUooC0VDvKuAqiCE6J7PzlWGNoE74motlUuCucCPCUHwPKPoQgPUZ7QCNOBLFJAqz3ffw4JnQbCTVBC3jeQ9W66El690UWc3TjQZX80RKigkTa/qeg7DMsyI84uRRcO580j6DyXrMDOtdoCFScByajUUet+Rpyms8MlHEHRFjsRNx/0BTrYfy8uGbHATGlpJQiU9ISpDX+6IN1bKxST/7cqpsSNLjbEDfpJfrMIkuUiasRtd8zeuiy2NqPyLTWEWPLBBEfolaCMjm4Qv+ZVseNgQuXabTvldMk60PYg6A2fVzKumK+Xc6ORxkHUNYlrrn+zZYd5k2mF/r6609Jnb3ERJFRawr2ZVE3KHQU+jJJUyelji6v5sedL+KIHusskEU1WyqC4+7xu5iEa9UdWIxs4Y6KksbRWlkB4Hr9gKG7Zl6/VlJZHHWA6Q2dfRZTRJKeYVE1R//vi29bhW5NgdZLo0OI8f0/fkAwoxlzKu/xE8GDUrskkrdFn3QxGoz+jARJsF1x14ogX8BxOdk7+jjM4sy5sEfam1EXCN2tgXVt72yysfMdwWu8cqEEXQdgJqxYvY/NWMeVsi/by7NOzlQAqv5BHtJBUn+eGChLX7NF9ikzKiRBejnQvfCoc4fRjopiP2rA5HhzJk7+JgU6SmYThQBTOwj9RY9QXRnkJCbYE5K2kflKcE92SotcuIlSgkg6hEOlFz8woDNjl7Hyf2v4Hi X-OriginatorOrg: ucalgary.ca X-MS-Exchange-CrossTenant-Network-Message-Id: a9bb04fd-28f8-4edf-b23d-08da0ac9a291 X-MS-Exchange-CrossTenant-AuthSource: YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2022 23:30:35.9601 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: c609a0ec-a5e3-4631-9686-192280bd9151 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CvUzLemmRNifm2c6+UGqtO7AufvYsFKSBRkMd/X2jE75ZA0V9DQZ31JS+K6it4niOYrZRGsiOr8DIe8qoeAqlA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTBPR01MB2989 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Replace other constants with AR9300_MAX_CHAINS when appropriate. This change does not appear to affect the final binary. Signed-off-by: Wenli Looi Acked-by: Toke Høiland-Jørgensen --- drivers/net/wireless/ath/ath9k/ar9003_calib.c | 2 +- drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/ar9003_calib.c b/drivers/net/wireless/ath/ath9k/ar9003_calib.c index dc24da1ff..6ca089f15 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c @@ -177,7 +177,7 @@ static void ar9003_hw_iqcal_collect(struct ath_hw *ah) int i; /* Accumulate IQ cal measures for active chains */ - for (i = 0; i < AR5416_MAX_CHAINS; i++) { + for (i = 0; i < AR9300_MAX_CHAINS; i++) { if (ah->txchainmask & BIT(i)) { ah->totalPowerMeasI[i] += REG_READ(ah, AR_PHY_CAL_MEAS_0(i)); diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c index b0a4ca355..669b49b56 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c @@ -3911,7 +3911,7 @@ static void ar9003_hw_atten_apply(struct ath_hw *ah, struct ath9k_channel *chan) } /* Test value. if 0 then attenuation is unused. Don't load anything. */ - for (i = 0; i < 3; i++) { + for (i = 0; i < AR9300_MAX_CHAINS; i++) { if (ah->txchainmask & BIT(i)) { value = ar9003_hw_atten_chain_get(ah, i, chan); REG_RMW_FIELD(ah, ext_atten_reg[i], @@ -5126,7 +5126,7 @@ static int ar9003_hw_calibration_apply(struct ath_hw *ah, int frequency) frequency, correction[0], correction[1], correction[2]); /* Store calibrated noise floor values */ - for (ichain = 0; ichain < AR5416_MAX_CHAINS; ichain++) + for (ichain = 0; ichain < AR9300_MAX_CHAINS; ichain++) if (mode) { ah->nf_5g.cal[ichain] = nf_cal[ichain]; ah->nf_5g.pwr[ichain] = nf_pwr[ichain]; From patchwork Sun Mar 20 23:30:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenli Looi X-Patchwork-Id: 553470 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0EEF5C43219 for ; Sun, 20 Mar 2022 23:30:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343793AbiCTXcF (ORCPT ); Sun, 20 Mar 2022 19:32:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343792AbiCTXcE (ORCPT ); Sun, 20 Mar 2022 19:32:04 -0400 Received: from CAN01-QB1-obe.outbound.protection.outlook.com (mail-eopbgr660086.outbound.protection.outlook.com [40.107.66.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63271132E94 for ; Sun, 20 Mar 2022 16:30:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TTK2TidiE9PcHa3Ldk2mF3BfpIOIzds8NiDiDj5/z2xIHHXJyLJEcNXUsfd0y9473GHZ3t8Eu78HXJqdy3KGnm4jdo7wEg/roBV/PHlHDIwmiOqT+hdPUObu27sL0LXNb5F1cyzzcDtmgFyz2i9Crwhp9BNR2+q5wQ2ztZX1SCRNIAj1rAyvnD1TQ6T8OJ6+RTCoOLrMwYsBZweWlAnPCt1lT2QvE+Fb2cLmlUO/NCngCl8rR4uqbJLpnkHFLaQSo5EUxfqEyMNSHxIGdJHdWr7tEkEXsDnP0LRzdXyLECKAboQc2W6J3cjllIiYXZzy55lqMkbgHWVqNwlADVWClA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2reHbE0WPgtyWD89wih7l4T4Dvd0Lh9f54OomM55zsA=; b=YGh5+DtMmDTvpuEA2Cgd/zC8zzkzktLgr80a++WPbYwcPFcKf0k1d3pOMHmG97ETdNoB/xkvQiBkbN1tdcDqT99zFUVIgFM/E2G51yydxen0ks2Hz/A/NQDclgyv5pwL+ahdACZ00gOuS/PFZ9KgWXOpTYyEF3fYwRIJIlaMPlvvB+J3aRdbiCOIBo0xhAWfyIs/eUvYE0Kxh7mr59I7xootm8FX+CqSF5Ke01BoO4NHW6mj0r5OUZqq7US0FtAEw5E7w+uiIDe5FKhphEdqdjLdGc3+ESDsldgv8l3lDNaO9+4sqY8mUfGeFz279H8P2F0DhhhG2mIbRKp9In+CCA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ucalgary.ca; dmarc=pass action=none header.from=ucalgary.ca; dkim=pass header.d=ucalgary.ca; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=ucalgary.ca; Received: from YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00:4a::23) by YTBPR01MB2989.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:18::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.17; Sun, 20 Mar 2022 23:30:37 +0000 Received: from YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM ([fe80::dd8c:6e57:c431:9323]) by YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM ([fe80::dd8c:6e57:c431:9323%6]) with mapi id 15.20.5081.022; Sun, 20 Mar 2022 23:30:37 +0000 From: Wenli Looi To: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= Cc: Kalle Valo , linux-wireless@vger.kernel.org, ath9k-devel@qca.qualcomm.com, Wenli Looi Subject: [PATCH 4/6] ath9k: fix ar9003_get_eepmisc Date: Sun, 20 Mar 2022 17:30:08 -0600 Message-Id: <20220320233010.123106-5-wlooi@ucalgary.ca> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220320233010.123106-1-wlooi@ucalgary.ca> References: <20220320233010.123106-1-wlooi@ucalgary.ca> X-ClientProxiedBy: MW4PR04CA0176.namprd04.prod.outlook.com (2603:10b6:303:85::31) To YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00:4a::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 382e7f97-682a-4253-b708-08da0ac9a37d X-MS-TrafficTypeDiagnostic: YTBPR01MB2989:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: j6+GFUUldEPDFavbQlnxf8KME7XkW/cqZNclYKknDJUFmd+qHzaGQ0l3qMzbTbPQ8VXDzKS7cyKwMl8vs+xijB0zpTjJN7l69BXHht188NkxOQyuls+bKQUYhEeFmVOn+Dt3deWadVzTx6c8GHzshhlfh/6b0P6477kyMWXJWlOY1Oo64xoodqZTQty5Js+dS3lOvfF63D/DydxXY6K78DCh+du3mpQKcd9t164aWR/Fxg3IfoqlLMrCIyS62MBMB9S7CwvTLGT97slPJBFwlKUeSGxQ3ni0Dle1B/PKJhZYUuJ8ScXfG5qASTFbifzQ122+//CM3hUvxNcNkrS9IPs+1vRFKCtW4g3yg3K9H1WzIH9mT+oA6Txtuxt2taKI+/NbLroqYhet1vHNQDC+2guBcsE7wt5MOPaG8VancCPEn8vP6Ajx1DS9PnIg3k3rXfgVhSb1IjAFlTAzrP7e/LgB2VcrF27ZUq1iLhW5kfq2ui7cQY5Gn0KiCybXqpCzHlx9d13kUVyz61DPK0Wcd1BywfruQ9MDxj9jmRr83lA1uxyBpSnpRAqY9TVZocbu095V5uKPb8Gnl84uyUNH9LKl+PkxOi/sTFWXUm1d3gIPhQ8M6TP8361kk0G2tKfCfeC76yaUlvuAUNR4YMq/EKSIf5B/GOkmOw/T6JaQlsJAaWP/fBi1tlEp/yVwUANx X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(6486002)(2906002)(83380400001)(66946007)(66556008)(8676002)(66476007)(4326008)(786003)(316002)(6916009)(54906003)(86362001)(508600001)(5660300002)(38100700002)(38350700002)(4744005)(8936002)(186003)(36756003)(6666004)(26005)(6512007)(2616005)(6506007)(52116002)(107886003)(1076003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: OLIOt37zWCimUeSmGgexgRk9fLn7R9CwfU4wjoebBfZ3JFZsQW8vUqcF3QQORNwQaQFqQ6rFU/6LV1zpsIfSFHb+T741/+1KcxbER4PbWJSBrQxdeS0F3S2b3kdtSAdW6LqT/BUGEMk42Jzvg/iGOO+VGSytm86dj8wZ8LVNzyWDgXXp+1Qj2ubS9AQNXdLn0Ur/gPJmTRNFdehITLfw9pabp3IKxuuQ4vN46qgqV/2J2TfHwbhya7VtQZO4vlJcUum8DPS3GM9Zqz7fbaWuH9ejDqwXZJxDdz6h3tZHPGgVU+rtHsEAqs9dIBdYmwJa2JPSNH+/VLKRTqjOrrUEHOmTgqfV6QUdvynuaIJa9+IYeaMGPB13uxO+dX4dU/PGh4Bo4v+QMIkWBiR7Il+pMTh3a3y1K2YUsjssUD2I/nizWv4TztqQ1mZLWcHoiDK9M2+KYtAhFCQhU27slVRaiagrItjzctG7ih8Jd2JlPBHVn2/0fctV1LZ82M6pZQNTUMjyAMEtqnKXRom0707YYYbCtdkuY1Pezx7wXqbTQlWzeFaDJW8Wl0gYUGHJDDrAqxt4wyp/y72aAmksq5fLCT257z6PQHqO7cnWs48/2Di1D0vLGCZYWWMK7FtS0LlIrXUvMEdd4fkwlitAbQblYXVEMZ4uhZCQcz9/j4efEjAhBGIFVNghawR8R6nYqbl4bx3xMv9zlHA+cZNPnKmKJfWEMNgUDs/mI69kzA66ttxfi74Wu3xfLaZy/NLnEli5HkjVdvDepbSq4cpsN5Sh1dRLAOg6e6r5Gh61ocZSot/hyrLiGeYeKetzXhd/cl0SuXlO/1X1eFEp4moS6bPVPwb1wQmnSenm5nPOx53up0k3fr9tm6Nx7WGi4HZpVHASKyaq+cSlHRGXS+p1yiTkR9TM8My/Zz3YcwuP9ptOY+rH/QTOebYzUDV6R9+iosVNNKmG3AIwSmX9GLqSB1C3i3R4cbjjQGv92B/6PV4dNWBsGg46LTp6eKatm3xPPSXv54ePWnQZ/OI/do3vAb5/vhjxftKMcey+V87eOezEiecqI+tbpLc1B7QAqCRW9VRKxoeg4Pqgd7ro1TyFT2VO3hn6SUUHlHanfR29Easzl4S3oARD3Sxvv/UJ4+laonE1ZhBieVEjD+Eu4uBNvVuIrjy36WGwz0w3DQtBWmHyWkKmXg/HKHOVYmLX4GZpIyKLTWbh29lg87kjn1afbwqN80nPjIQmFcvP5C/LM2B5FX7Zaz+M2NFiFYYyt1crVUBl/fWbJ4dAn+8gSjK8aAqzM81r/djRTEmIXaHB7zou7OmMncrzwXNRQIe/he9aPWPp2sSMcKGpc0u7WvIwuvye4zl07a3xWiJcgMu4MfH49oyxzQmPaitJE0WI6fy1uSLkY9xK3kALAS1horvMlgTNm7Y3dHwMS674+MO7jUXH+u28oeQiBxkn8h4XDoe3RV+7 X-OriginatorOrg: ucalgary.ca X-MS-Exchange-CrossTenant-Network-Message-Id: 382e7f97-682a-4253-b708-08da0ac9a37d X-MS-Exchange-CrossTenant-AuthSource: YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2022 23:30:37.5538 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: c609a0ec-a5e3-4631-9686-192280bd9151 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: AxtTWErNdoLIcz948umcvJ2XeS0+wL/AQXPNqvLDuicAC0Nj1+NSSUn/Xr/YY3XZzJof1mNHgmeZGWE469e27Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTBPR01MB2989 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The current implementation is reading the wrong eeprom type. Fixes: d8ec2e ("ath9k: Add an eeprom_ops callback for retrieving the eepmisc value") Signed-off-by: Wenli Looi --- drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c index 669b49b56..a109a44a1 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c @@ -5615,7 +5615,7 @@ unsigned int ar9003_get_paprd_scale_factor(struct ath_hw *ah, static u8 ar9003_get_eepmisc(struct ath_hw *ah) { - return ah->eeprom.map4k.baseEepHeader.eepMisc; + return ah->eeprom.ar9300_eep.baseEepHeader.opCapFlags.eepMisc; } const struct eeprom_ops eep_ar9300_ops = { From patchwork Sun Mar 20 23:30:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wenli Looi X-Patchwork-Id: 553469 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA341C433F5 for ; Sun, 20 Mar 2022 23:30:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343794AbiCTXcG (ORCPT ); Sun, 20 Mar 2022 19:32:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343795AbiCTXcF (ORCPT ); Sun, 20 Mar 2022 19:32:05 -0400 Received: from CAN01-QB1-obe.outbound.protection.outlook.com (mail-eopbgr660086.outbound.protection.outlook.com [40.107.66.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 327F4132E8C for ; Sun, 20 Mar 2022 16:30:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IOEVL2tPOhTsQX9TDJVgomGXHwK9epTRaEhjuO6dYIYzbH8NDUP3RxTjRbIeJffpEBM6hRCFlWnAw74dNFJqPYOJdcDvu2Xi15K4Pxzf5uG6fGjWXrmblgUsqCB3Dku4n9GeGaa5gYqAlBGaaod4ejehEfbllDgXV5hjoVeapdWvzjr103Y5TifI61e/L0i+ek8gCsa6OUJRwQz9+/cgBqeLigvCmazJLAuLmfyiCJqrSosV25Mmdx0uRSQ+EJ21+ILLaiKaR+536N3ycO+1LyRgbKg+pUX2Xhg48vYj2pGpfhBK5tTn8el1rDoyWeVUTUQBx5UbPWcnZxlUp3GX2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3P/bbTUJj/+WdI/CITQLN5rbydm6fd7pty+OZOYwbJE=; b=E2Potz9ZRVlo4gOW+sEoa5qosQOn1hQAyiV87WCPcewIuleSbSQXms1PNfuMZLxVOUsljx0CiLwzW+vSGnNUCDfETeamRp5zrV/A8CZ4FcSjNMun1oQ4ads/vQ/HQgFOB6IUIFjyXZCoi4fRRMPwPcS4RThzW5ETgmvi/d/YJ3nyY/QGD5yQQSyiTwwAOXR8cxZX4it1D889xSojAILlGyQDXjoeNFwFmO3FuXM/M+qJtKH8YnruFxQTVqfWbwOz4Ylx6cP0/fDxocJedfZPlkVsOpFIEF0QgFD+rYJuGIAWhSUSIYEK1mBzeOaaIH5M2hexWBFOHpjM6mAkhsNrpg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ucalgary.ca; dmarc=pass action=none header.from=ucalgary.ca; dkim=pass header.d=ucalgary.ca; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=ucalgary.ca; Received: from YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00:4a::23) by YTBPR01MB2989.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:18::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.17; Sun, 20 Mar 2022 23:30:39 +0000 Received: from YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM ([fe80::dd8c:6e57:c431:9323]) by YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM ([fe80::dd8c:6e57:c431:9323%6]) with mapi id 15.20.5081.022; Sun, 20 Mar 2022 23:30:39 +0000 From: Wenli Looi To: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= Cc: Kalle Valo , linux-wireless@vger.kernel.org, ath9k-devel@qca.qualcomm.com, Wenli Looi Subject: [PATCH 5/6] ath9k: refactor ar9003_hw_spur_mitigate_ofdm Date: Sun, 20 Mar 2022 17:30:09 -0600 Message-Id: <20220320233010.123106-6-wlooi@ucalgary.ca> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220320233010.123106-1-wlooi@ucalgary.ca> References: <20220320233010.123106-1-wlooi@ucalgary.ca> X-ClientProxiedBy: MW4PR04CA0176.namprd04.prod.outlook.com (2603:10b6:303:85::31) To YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00:4a::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ad7bed0e-4013-4294-0998-08da0ac9a478 X-MS-TrafficTypeDiagnostic: YTBPR01MB2989:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hS3kSJEIES/r+Rjksjksz0pVG8mB6GCdEbsYQvGEOmhoEe63gf2q4/trU/iqZD/gvMsPJrRP+f4DU+L2IKIBT39Fvwnudwfwlkc+Su6bL6j8XMaRpMy8ULJkqGhoIkJhJvKXgiF0VU1/7EkrQopSBhc/axepQjKQUSiemSkhMsPAEVzQn6xhGhUfTYcsYp0x1wmwojhdPKQbZoM27zK/d3m5V/IyMTPGAVCRyl7nX9EZo9oleJE9/KSuPmHeb14wKh0cLcMUFV3cV0Tirfi9px5XaO1dDh6yOnqUSSOMY15UzXvfABgcTjJq0OzpPXrswoFl3TB+JCppUUVheQOHpKXo5LINSD2Mtv87T0y/lP0+SzPlpDQzwfnP8KIkJO3qsQTOZaERbM2grX79PjarzI61o0vvvzskKsWeNEaGQcKZmaQePnUYQaDcX+lsHIcVVxfSV7fD3GwFkh70YIHjuaHUflYY0Qp23A0c7JjK92cCoGrVppGiF4rPxmtgGhbm6kqVggF4/M+iD11C2LDsYVggXdW7216Q+2STTbl766gPbAF+5HGnzuv0IFsao+WU7t67kn0R5pHsFzqg0ddEq4qWTfoPeJXwbGgOyN0xBbypHDJUweGsoSXtbyktYrxSK655tzSwmnboK4z3JnQ8rPjlaLminhUgBfvLTQyOEZKxzxmJBOKuvDaunKy0bIbACF/4kl35JXVFvYXhZNf0fw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(6486002)(2906002)(83380400001)(66946007)(66556008)(8676002)(66476007)(4326008)(786003)(316002)(6916009)(54906003)(86362001)(508600001)(5660300002)(38100700002)(38350700002)(8936002)(186003)(36756003)(6666004)(26005)(6512007)(2616005)(6506007)(52116002)(107886003)(1076003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: M1wAcmprbpjfQ8/CgqhNebm8KCs5F4PSMsOh2hgxulJhNHfPMrCB3rQC4zSv4KSA//55moRtBeez3JGCa+W1YaFaWKXx17C1C4wjMTeKNFqFvFdiu3jESZ+INIhJv2ynul2QEJCVfI2WdJJRRZ8yNTfhfhRRzasdrQ5ttkYdyip1JdMV+4cE/KBIZ+L1OzHcdttg+ldkuRaK5xI9TcsXN+SFSaflqXveRvtUonpkucO8aQ9ENr4GGAq/V5/wRC+ML5RlRytSy248rezE8Ewkge+4lmAlGoTgEWj3Jb1V1F+sur0n1+CTRH2eaecK4azfopnLex5lTEe6eocHzRsDRXlBeoTxWXc3bpJ6X9s1d5ncBavD/hryQQ7Vo2m2IezWl6KLgiluK3zLimHmlDLeEtBU6VzV/7COulzzjNVJwjBJoGmIp+Evq+e3B9EyVuiDoi2jQknxxfxONQix7BhexV55NDs1rsxUDF2bR7tJZh7Cp6AFybfBwUeKlOn4EVTwdDyERHdAhZhM1XjLaNWbQC6eFWxpTJXD50AydKPFOGvJt7k1y3djian1UMV2NUstLskInpBVY7ETE1wHZ71nAh2VFxShFrZEG0R15IImUYO0U1F8Wx8FzAUCJU6xnscGcXwZODjTiJGkuVK8yfwG0B1j/YVhJeCXPQVElvUSbwhkXzbMPmGiRawlC5uK507RDxBsGMUEvO/V0Kr0D1MGJ4JfkLeMX+VA5Un7YhfPtWzOZ7MjtBjRD6pmJvH7+CHXnislaGTr7mWlgaSZ9GdnKOwJbXWYNNgv+Rh55ofv2KCiyHMQgFx6epFK/sgZg294jd6h1UiOs+g+F4WxJQeXGrnNSagmQr82iuzhb/WvzjHX/khCul/hJnbGyj7L5G1hFgHjrf6gYqZEjVsmyLdwd6NlbTNR0CoPPQ3rCyKW/n1ULrWBjpXlpP6U5/KRTzLqC7CEdIH+Z+EhfHkZvCawS92GotWuXatX/R46pKgdbdj76L2MGavTEdJnAhsIsd+f3/YweWDfK1pWrMIhuf8v05PkzUOAHOrJfxouUdsY5Re4Txu3Tc5h1Q6e3XIviI+LcWEeJj4hHt6AKDVj4nTfDdzhULe/qqF+XrRmOFbvjcD/7iv8U5DtGi8lN3ewhMGwZhlooWKJFOkcanRnFKuBZzIaWP3HVXxkXugzzw3ncew4vph014C3M9j77Wg+TcQgyfhiMeXV8sNBe1udb4Fzo6l8unOYAQE9UIE0hP2zgKOJn1svmxsLWKSzbnnxtPCsBJHRiTRmYC7UkHTJGfbcliP3h7Go7L5IrB7+wmSKWnlA4YlOPnGSVKHzHsenuO5yTQFyMq1OuLUuRbS6MhniaZP/PA1tFDki36E4AtDoCRP3aTggB/oTDd40+5aMwItbTa0Kd/ujiAU3ismr1Co5TEZzIg8V4N72ujpg/5kjIziIupoZmrsy7Z/A67o66K2t X-OriginatorOrg: ucalgary.ca X-MS-Exchange-CrossTenant-Network-Message-Id: ad7bed0e-4013-4294-0998-08da0ac9a478 X-MS-Exchange-CrossTenant-AuthSource: YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2022 23:30:39.1318 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: c609a0ec-a5e3-4631-9686-192280bd9151 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: FEKmnImcXpd1lknarZSENhRS51W1h6t5bGBqMJBeCtZB0F5aSB1z1uYQwmwDUMtCpCvom38EmQXoBqt9K5dagA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTBPR01MB2989 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Similar to ar9003_hw_spur_mitigate_mrc_cck, simplify the code by using ar9003_get_spur_chan_ptr. This may also be required for QCN550x support, to provide an abstraction over the underlying EEPROM format. Signed-off-by: Wenli Looi Acked-by: Toke Høiland-Jørgensen --- drivers/net/wireless/ath/ath9k/ar9003_phy.c | 25 +++++++-------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c index daf30f994..dc0e5ea25 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c @@ -523,21 +523,10 @@ static void ar9003_hw_spur_mitigate_ofdm(struct ath_hw *ah, int synth_freq; int range = 10; int freq_offset = 0; - int mode; - u8* spurChansPtr; + u8 *spur_fbin_ptr = ar9003_get_spur_chan_ptr(ah, IS_CHAN_2GHZ(chan)); unsigned int i; - struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep; - - if (IS_CHAN_5GHZ(chan)) { - spurChansPtr = &(eep->modalHeader5G.spurChans[0]); - mode = 0; - } - else { - spurChansPtr = &(eep->modalHeader2G.spurChans[0]); - mode = 1; - } - if (spurChansPtr[0] == 0) + if (spur_fbin_ptr[0] == 0) return; /* No spur in the mode */ if (IS_CHAN_HT40(chan)) { @@ -554,16 +543,18 @@ static void ar9003_hw_spur_mitigate_ofdm(struct ath_hw *ah, ar9003_hw_spur_ofdm_clear(ah); - for (i = 0; i < AR_EEPROM_MODAL_SPURS && spurChansPtr[i]; i++) { - freq_offset = ath9k_hw_fbin2freq(spurChansPtr[i], mode); + for (i = 0; i < AR_EEPROM_MODAL_SPURS && spur_fbin_ptr[i]; i++) { + freq_offset = ath9k_hw_fbin2freq(spur_fbin_ptr[i], + IS_CHAN_2GHZ(chan)); freq_offset -= synth_freq; if (abs(freq_offset) < range) { ar9003_hw_spur_ofdm_work(ah, chan, freq_offset, range, synth_freq); if (AR_SREV_9565(ah) && (i < 4)) { - freq_offset = ath9k_hw_fbin2freq(spurChansPtr[i + 1], - mode); + freq_offset = + ath9k_hw_fbin2freq(spur_fbin_ptr[i + 1], + IS_CHAN_2GHZ(chan)); freq_offset -= synth_freq; if (abs(freq_offset) < range) ar9003_hw_spur_ofdm_9565(ah, freq_offset); From patchwork Sun Mar 20 23:30:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wenli Looi X-Patchwork-Id: 553331 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A44EC433EF for ; Sun, 20 Mar 2022 23:30:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343798AbiCTXcH (ORCPT ); Sun, 20 Mar 2022 19:32:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343795AbiCTXcG (ORCPT ); Sun, 20 Mar 2022 19:32:06 -0400 Received: from CAN01-QB1-obe.outbound.protection.outlook.com (mail-eopbgr660086.outbound.protection.outlook.com [40.107.66.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5719132E91 for ; Sun, 20 Mar 2022 16:30:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MCDmvhSVbAYlZ/DVkYXsZr6GNlmRVxLIj1JtD8n1r+XKBMaAWl4DA4Ogq8OfHOix5ES0znWVUtT1Qiavrmyq1EAEXsmAX+KqJU5k1SkzNZm3U0AYhUNHbR9bXWxR0vq1Zm9Jne7U8Eu+8SmPmb7DW1TPfKZdAG96Nl/XO622Kgt0k9NacwYwjOa1Ey7RF7oBTjGqfbln5HqlBrDHXZ6gZZIhnQybQcQRS9gIHWsm4WGyHnRHqkwiN9orrjIK6GkSDtSWKI1SH4nvQCUMmsLuPSaQlzchFT7md1TvPF1WlGSJB+RfSIyYNS6zC3561TDZ0KY/nypA4vFQj7RtI7dDUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ohiycFmcjE5J95joqMSCU76LfZ7WOkwbrG4bmZqbGPs=; b=kuuOgwPmqT6oA2FJrt3uvozf2rrY0Q3hSkz4poCc+P0eTsEg2LEiWME5KzgVfyZC2MHyz7LuE7uVYDvf23cTAh9vD8FjjK0qmjb+YJBf9HYAfUVxnBHFU2UVRtjvTar4jP6lJs2y9RAf8Cy1FwGD75vC1Jw4DTA/3tBblp+3Nvk22i7JuuYXcFFNTCtUiCa+D01OWiXLhXqeACfDlHs+l8Ubp/bZDxXNY33i4rTQLsyxMaYQ1P7QEio7SOs7TfgOUVCORcML3VZVAJr0hmL2bId6XQSpp0/tq1ObHZIqxNxOdHlIZdCYja9mhOz0Uuc9c/LgrhBldpPi8qSx75/Wjg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ucalgary.ca; dmarc=pass action=none header.from=ucalgary.ca; dkim=pass header.d=ucalgary.ca; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=ucalgary.ca; Received: from YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00:4a::23) by YTBPR01MB2989.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:18::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.17; Sun, 20 Mar 2022 23:30:40 +0000 Received: from YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM ([fe80::dd8c:6e57:c431:9323]) by YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM ([fe80::dd8c:6e57:c431:9323%6]) with mapi id 15.20.5081.022; Sun, 20 Mar 2022 23:30:40 +0000 From: Wenli Looi To: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= Cc: Kalle Valo , linux-wireless@vger.kernel.org, ath9k-devel@qca.qualcomm.com, Wenli Looi Subject: [PATCH 6/6] ath9k: add functions to get paprd rate mask Date: Sun, 20 Mar 2022 17:30:10 -0600 Message-Id: <20220320233010.123106-7-wlooi@ucalgary.ca> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220320233010.123106-1-wlooi@ucalgary.ca> References: <20220320233010.123106-1-wlooi@ucalgary.ca> X-ClientProxiedBy: MW4PR04CA0176.namprd04.prod.outlook.com (2603:10b6:303:85::31) To YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00:4a::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2fa4179b-ca15-4231-7097-08da0ac9a566 X-MS-TrafficTypeDiagnostic: YTBPR01MB2989:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mdMPP3x6bRliCiL3C3ibNfm+6CXd976gIiD0JOVEJ8NzWjiOiZufLvhfwTt2j2aFkDmbLsipiqVxrtV5MmqPDjmvAHysDaJEOYE59koad2+hx/vR8h5IpZAcnnBTquWFr67QSiLZoBhTSqH5injky5GUCVpkKxxvj29XURECpW239eAiYUt7n26fOs4WObOXFPxi6npjvxWFERK6g+zKzpfH2s/+c2qrgOMcwsfAqddcHe5y2LeM1TfekX1VJSkIpYl4f1d4bvKKvm8hl3orfYCVkgakfw7s7QleSKIWB7Zl51NlVueZ3iqDH3+2ryoJkUkHXEZT8ipGRG67OCKTjl/X5uEA8OQGDSs74Tj5bAUD83Szmwiq/uaez7lKrz+FYcPylpieDZSDHnhZO/OBxl0LSgeO2jzHEUx74p269NEyXmYoMOK5zA7Qk1hqD/delN2ycFq198Tbv+WuU/XtjB1JAbQvydrDmn40V9s/eAJ34fWXb+swQ4w/3tMNu+fUgigEzCR9ClflanEI+tRFE4y1zEkrXp9jHdB9c2kfMUnRTmw48co5z84cBowT5iT5RMq8zRqP6ovYcQ0imAAjCUJm4f4kTfRrV6R4g2phXObDeuZ8j4lbPmr1v2v+kK82baEErAWhZBDSwymMpPX7CuS5eiiqD4zvz2GEwr1w+tXEZnum1vS+21p2rJxMAVVyg/xmA8t3MJK8KnMW5jR/Ug== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(6486002)(2906002)(83380400001)(66946007)(66556008)(8676002)(19627235002)(66476007)(4326008)(786003)(316002)(6916009)(54906003)(86362001)(508600001)(5660300002)(38100700002)(38350700002)(8936002)(186003)(36756003)(6666004)(26005)(6512007)(2616005)(6506007)(52116002)(107886003)(1076003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4ZW5AV5m+Xe0DB65jPehD4QYAXhjxNEGl1Fqd2DZqpjmYF9EWITc8/LPmU6y3seSz/h7yodiADa8v7LZOENHHYXed21g/LNAZwN5X/WUFMFoK/KRJAQKNx47yZrUaZ+gpo8UTnlocgBKyL0tTwYxx3ncwuU3PXH/8JyyHcGyYqYTvDrEi7/Bs1Q6GgYvMdh83N/gPx0JvbQDU5qv+AdZkb6sd1+7aEhifV1yHHPQZi3ciXuKvvSvpsRjd18vRAnegD/eIRuxVLm/zUYNR8owy+nfRA+ZiYG65rT2pVQtk4bjDtqXnZpkHyYByYmjLVJpB1yznQXtgf02WLT+VCO2eOiyfH7cMyC6tlAt2to47MswQw6WJVBIGEArlA86AvSpbdlBWvhl0+A1A2Z7L2Jb/Sha3s4eAQDaFdienFiym2dnkn0bS+XG2k9RPYuZOS4EFme03WTKBK2907b1VUTkKjn4X+RzPaTlnKDp26dNE2A90GryEgNO1jl1gxQpSutbqrKMirYYqnCF/N1CVlMJlKjtfdAluVGFP9getNYbaBEUYQLmyy0aSVL7x4X9WgEkxGgpQJWUpTuUS4hKDWpZ94I5TcXXXfhFpSdfgnu85yE50fdtJ7zgdVWCUYFeuFvkCmEKFYPP8F5trZ02B8r910kJhElWONc+WaHbIXFLOx12Tqznce3Pbl7ODFhsbHJsKfPscapGe82deMOu78wV9l/BAefB827hsZdx4SoQCtMPdwKXED4FIf0qUhSwjfQYjpavNkICXy3QyTQhJBKSRHYVlfsRcoiz+llF/4s1939q4E5v3HlxI3R6nslyLcn7wU7Si8wlgYlwQc5Fh9+p0qf/X6c6+PRhWwduWhPfFGIzuLhlluu/0gLV93gXcFzl/eV6xHUjK54LdBvIU68mZIiVBTpDvFO3Cl/HakSLeutZn8puhWRYH/R+4+Q2XIiQwQh3iBOzH2aDKP915V5NI+zJFeVWrSDunI1iNFJu4EtJoeRt1LGpG32zP2hsu/nNF6nLB/xNNk6P/LyQ/sH7OuGMsiMPUyJkKIdWoMkf6ijkWKw+eOCP2CC0laovK4fKIWt+WEQ8Em524Gygo0i7X4pkyiTk8YFhbXa4HSck38BrI76hxlr7KD0FQ3naXyraiSVBFUuUNklpEXoPz25aUJ4SBGIQLTKZSUywrV3iN/vpRYca4rNi3iTZXfsS1jpc3o7E+oExC7W+drGFtMzonkZfHHs/PaEyKgfWWTOYR5HliTILGIZnkQ9iPY6wc8jzAyyCOJnNioddRtCjxNuPlWhCf6KG0rVKn4FhptYlzheYIF5jXK78s3xU0izKl5ATdZzuFB/D++g2mzFnFZnnXo++x9x38wigXmpKlVZV2PKWh1TReMYoAUZK3w2lmKfSQssEzNtANYOWY980Uv50Z31Ms6cCUIYJMA4+WNdk3XZgzEEyfUggBHy16bdrd1kE X-OriginatorOrg: ucalgary.ca X-MS-Exchange-CrossTenant-Network-Message-Id: 2fa4179b-ca15-4231-7097-08da0ac9a566 X-MS-Exchange-CrossTenant-AuthSource: YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2022 23:30:40.6942 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: c609a0ec-a5e3-4631-9686-192280bd9151 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: vhHOGI3WzDazsM7tSbhfLuqnQl3LbaZp1qMx8+kbqG/tSMGfPsMyF0ZT6aFfAO+Vek04ElcoeeXcbqRXKW2/Jg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTBPR01MB2989 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This removes some code duplication with le32_to_cpu. This may also be required for QCN550x support, to provide an abstraction over the underlying EEPROM format. Signed-off-by: Wenli Looi Acked-by: Toke Høiland-Jørgensen --- .../net/wireless/ath/ath9k/ar9003_eeprom.c | 33 ++++++++++--------- .../net/wireless/ath/ath9k/ar9003_eeprom.h | 2 ++ drivers/net/wireless/ath/ath9k/ar9003_paprd.c | 10 +++--- 3 files changed, 25 insertions(+), 20 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c index a109a44a1..abf12de0e 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c @@ -5449,8 +5449,6 @@ static void ath9k_hw_ar9300_set_txpower(struct ath_hw *ah, { struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah); struct ath_common *common = ath9k_hw_common(ah); - struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep; - struct ar9300_modal_eep_header *modal_hdr; u8 targetPowerValT2[ar9300RateSize]; u8 target_power_val_t2_eep[ar9300RateSize]; u8 targetPowerValT2_tpc[ar9300RateSize]; @@ -5465,17 +5463,12 @@ static void ath9k_hw_ar9300_set_txpower(struct ath_hw *ah, ar9003_hw_get_target_power_eeprom(ah, chan, targetPowerValT2); if (ar9003_is_paprd_enabled(ah)) { - if (IS_CHAN_2GHZ(chan)) - modal_hdr = &eep->modalHeader2G; - else - modal_hdr = &eep->modalHeader5G; - ah->paprd_ratemask = - le32_to_cpu(modal_hdr->papdRateMaskHt20) & + ar9003_get_paprd_rate_mask_ht20(ah, IS_CHAN_2GHZ(chan)) & AR9300_PAPRD_RATE_MASK; ah->paprd_ratemask_ht40 = - le32_to_cpu(modal_hdr->papdRateMaskHt40) & + ar9003_get_paprd_rate_mask_ht40(ah, IS_CHAN_2GHZ(chan)) & AR9300_PAPRD_RATE_MASK; paprd_scale_factor = ar9003_get_paprd_scale_factor(ah, chan); @@ -5592,23 +5585,33 @@ u8 *ar9003_get_spur_chan_ptr(struct ath_hw *ah, bool is2ghz) return ar9003_modal_header(ah, is2ghz)->spurChans; } +u32 ar9003_get_paprd_rate_mask_ht20(struct ath_hw *ah, bool is2ghz) +{ + return le32_to_cpu(ar9003_modal_header(ah, is2ghz)->papdRateMaskHt20); +} + +u32 ar9003_get_paprd_rate_mask_ht40(struct ath_hw *ah, bool is2ghz) +{ + return le32_to_cpu(ar9003_modal_header(ah, is2ghz)->papdRateMaskHt40); +} + unsigned int ar9003_get_paprd_scale_factor(struct ath_hw *ah, struct ath9k_channel *chan) { - struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep; + bool is2ghz = IS_CHAN_2GHZ(chan); - if (IS_CHAN_2GHZ(chan)) - return MS(le32_to_cpu(eep->modalHeader2G.papdRateMaskHt20), + if (is2ghz) + return MS(ar9003_get_paprd_rate_mask_ht20(ah, is2ghz), AR9300_PAPRD_SCALE_1); else { if (chan->channel >= 5700) - return MS(le32_to_cpu(eep->modalHeader5G.papdRateMaskHt20), + return MS(ar9003_get_paprd_rate_mask_ht20(ah, is2ghz), AR9300_PAPRD_SCALE_1); else if (chan->channel >= 5400) - return MS(le32_to_cpu(eep->modalHeader5G.papdRateMaskHt40), + return MS(ar9003_get_paprd_rate_mask_ht40(ah, is2ghz), AR9300_PAPRD_SCALE_2); else - return MS(le32_to_cpu(eep->modalHeader5G.papdRateMaskHt40), + return MS(ar9003_get_paprd_rate_mask_ht40(ah, is2ghz), AR9300_PAPRD_SCALE_1); } } diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h index e8fda54ac..f8ae20318 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h @@ -363,6 +363,8 @@ u32 ar9003_hw_ant_ctrl_common_2_get(struct ath_hw *ah, bool is2ghz); u8 *ar9003_get_spur_chan_ptr(struct ath_hw *ah, bool is_2ghz); +u32 ar9003_get_paprd_rate_mask_ht20(struct ath_hw *ah, bool is2ghz); +u32 ar9003_get_paprd_rate_mask_ht40(struct ath_hw *ah, bool is2ghz); unsigned int ar9003_get_paprd_scale_factor(struct ath_hw *ah, struct ath9k_channel *chan); diff --git a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c index 34e100940..b2d53b6c0 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c @@ -21,7 +21,7 @@ void ar9003_paprd_enable(struct ath_hw *ah, bool val) { struct ath9k_channel *chan = ah->curchan; - struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep; + bool is2ghz = IS_CHAN_2GHZ(chan); /* * 3 bits for modalHeader5G.papdRateMaskHt20 @@ -36,17 +36,17 @@ void ar9003_paprd_enable(struct ath_hw *ah, bool val) * -- disable PAPRD for lower band 5GHz */ - if (IS_CHAN_5GHZ(chan)) { + if (!is2ghz) { if (chan->channel >= UPPER_5G_SUB_BAND_START) { - if (le32_to_cpu(eep->modalHeader5G.papdRateMaskHt20) + if (ar9003_get_paprd_rate_mask_ht20(ah, is2ghz) & BIT(30)) val = false; } else if (chan->channel >= MID_5G_SUB_BAND_START) { - if (le32_to_cpu(eep->modalHeader5G.papdRateMaskHt20) + if (ar9003_get_paprd_rate_mask_ht20(ah, is2ghz) & BIT(29)) val = false; } else { - if (le32_to_cpu(eep->modalHeader5G.papdRateMaskHt20) + if (ar9003_get_paprd_rate_mask_ht20(ah, is2ghz) & BIT(28)) val = false; }