All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wenli Looi <wlooi@ucalgary.ca>
To: "Toke Høiland-Jørgensen" <toke@toke.dk>
Cc: Kalle Valo <kvalo@kernel.org>,
	linux-wireless@vger.kernel.org, ath9k-devel@qca.qualcomm.com,
	Wenli Looi <wlooi@ucalgary.ca>
Subject: [PATCH 2/6] ath9k: split set11nRateFlags and set11nChainSel
Date: Sun, 20 Mar 2022 17:30:06 -0600	[thread overview]
Message-ID: <20220320233010.123106-3-wlooi@ucalgary.ca> (raw)
In-Reply-To: <20220320233010.123106-1-wlooi@ucalgary.ca>

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 <wlooi@ucalgary.ca>
---
 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
-- 
2.25.1


  parent reply	other threads:[~2022-03-20 23:30 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-20 23:30 [PATCH 0/6] ath9k: suggested improvements and bugfixes Wenli Looi
2022-03-20 23:30 ` [PATCH 1/6] ath9k: make ATH_SREV macros more consistent Wenli Looi
2022-03-21 16:02   ` Toke Høiland-Jørgensen
2022-03-25 10:34   ` Kalle Valo
2022-03-20 23:30 ` Wenli Looi [this message]
2022-03-21 16:02   ` [PATCH 2/6] ath9k: split set11nRateFlags and set11nChainSel Toke Høiland-Jørgensen
2022-03-20 23:30 ` [PATCH 3/6] ath9k: use AR9300_MAX_CHAINS when appropriate Wenli Looi
2022-03-21 16:02   ` Toke Høiland-Jørgensen
2022-03-20 23:30 ` [PATCH 4/6] ath9k: fix ar9003_get_eepmisc Wenli Looi
2022-03-21 15:51   ` Toke Høiland-Jørgensen
2022-03-21 19:57     ` Wenli Looi
2022-03-21 21:07       ` Toke Høiland-Jørgensen
2022-03-21 21:07   ` Toke Høiland-Jørgensen
2022-03-23  9:30   ` Kalle Valo
2022-03-23 11:15     ` Toke Høiland-Jørgensen
2022-03-23 12:16       ` Kalle Valo
2022-03-23 12:34         ` Toke Høiland-Jørgensen
2022-03-24 15:51     ` Wenli Looi
2022-03-20 23:30 ` [PATCH 5/6] ath9k: refactor ar9003_hw_spur_mitigate_ofdm Wenli Looi
2022-03-21 16:03   ` Toke Høiland-Jørgensen
2022-03-20 23:30 ` [PATCH 6/6] ath9k: add functions to get paprd rate mask Wenli Looi
2022-03-21 16:03   ` Toke Høiland-Jørgensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220320233010.123106-3-wlooi@ucalgary.ca \
    --to=wlooi@ucalgary.ca \
    --cc=ath9k-devel@qca.qualcomm.com \
    --cc=kvalo@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=toke@toke.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.