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: 12786706 X-Patchwork-Delegate: kvalo@adurom.com 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/ve5HSX7JrAY1eScoFbG0JuNfZLU68KxvBxY8kwe6S3XwtdLWZGGH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-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