All of lore.kernel.org
 help / color / mirror / Atom feed
From: Muna Sinada <quic_msinada@quicinc.com>
To: <ath11k@lists.infradead.org>
Cc: <linux-wireless@vger.kernel.org>, Muna Sinada <quic_msinada@quicinc.com>
Subject: [PATCH v2 4/4] wifi: ath11k: generate rx and tx mcs maps for supported HE mcs
Date: Tue, 18 Oct 2022 14:28:21 -0700	[thread overview]
Message-ID: <1666128501-12364-5-git-send-email-quic_msinada@quicinc.com> (raw)
In-Reply-To: <1666128501-12364-1-git-send-email-quic_msinada@quicinc.com>

Generate rx and tx mcs maps in ath11k_mac_set_hemcsmap() and set them
in supported mcs/nss for HE capabilities.

Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00356-QCAHKSWPL_SILICONZ-1

Signed-off-by: Muna Sinada <quic_msinada@quicinc.com>
---
 drivers/net/wireless/ath/ath11k/mac.c | 30 +++++++++++++++++++++++-------
 1 file changed, 23 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index 56335e47939b..11d6dcac74fd 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -5464,20 +5464,36 @@ static void ath11k_mac_set_hemcsmap(struct ath11k *ar,
 				    struct ieee80211_sta_he_cap *he_cap,
 				    int band)
 {
-	struct ath11k_band_cap *band_cap = &cap->band[band];
+	u16 txmcs_map, rxmcs_map;
+	u32 i;
 
+	rxmcs_map = 0;
+	txmcs_map = 0;
+	for (i = 0; i < 8; i++) {
+		if (i < ar->num_tx_chains &&
+		    (ar->cfg_tx_chainmask >> cap->tx_chain_mask_shift) & BIT(i))
+			txmcs_map |= IEEE80211_HE_MCS_SUPPORT_0_11 << (i * 2);
+		else
+			txmcs_map |= IEEE80211_HE_MCS_NOT_SUPPORTED << (i * 2);
+
+		if (i < ar->num_rx_chains &&
+		    (ar->cfg_rx_chainmask >> cap->tx_chain_mask_shift) & BIT(i))
+			rxmcs_map |= IEEE80211_HE_MCS_SUPPORT_0_11 << (i * 2);
+		else
+			rxmcs_map |= IEEE80211_HE_MCS_NOT_SUPPORTED << (i * 2);
+	}
 	he_cap->he_mcs_nss_supp.rx_mcs_80 =
-		cpu_to_le16(band_cap->he_mcs & 0xffff);
+		cpu_to_le16(rxmcs_map & 0xffff);
 	he_cap->he_mcs_nss_supp.tx_mcs_80 =
-		cpu_to_le16(band_cap->he_mcs & 0xffff);
+		cpu_to_le16(txmcs_map & 0xffff);
 	he_cap->he_mcs_nss_supp.rx_mcs_160 =
-		cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
+		cpu_to_le16(rxmcs_map & 0xffff);
 	he_cap->he_mcs_nss_supp.tx_mcs_160 =
-		cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
+		cpu_to_le16(txmcs_map & 0xffff);
 	he_cap->he_mcs_nss_supp.rx_mcs_80p80 =
-		cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
+		cpu_to_le16(rxmcs_map & 0xffff);
 	he_cap->he_mcs_nss_supp.tx_mcs_80p80 =
-		cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
+		cpu_to_le16(txmcs_map & 0xffff);
 }
 
 static int ath11k_mac_copy_he_cap(struct ath11k *ar,
-- 
2.7.4


WARNING: multiple messages have this Message-ID (diff)
From: Muna Sinada <quic_msinada@quicinc.com>
To: <ath11k@lists.infradead.org>
Cc: <linux-wireless@vger.kernel.org>, Muna Sinada <quic_msinada@quicinc.com>
Subject: [PATCH v2 4/4] wifi: ath11k: generate rx and tx mcs maps for supported HE mcs
Date: Tue, 18 Oct 2022 14:28:21 -0700	[thread overview]
Message-ID: <1666128501-12364-5-git-send-email-quic_msinada@quicinc.com> (raw)
In-Reply-To: <1666128501-12364-1-git-send-email-quic_msinada@quicinc.com>

Generate rx and tx mcs maps in ath11k_mac_set_hemcsmap() and set them
in supported mcs/nss for HE capabilities.

Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00356-QCAHKSWPL_SILICONZ-1

Signed-off-by: Muna Sinada <quic_msinada@quicinc.com>
---
 drivers/net/wireless/ath/ath11k/mac.c | 30 +++++++++++++++++++++++-------
 1 file changed, 23 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index 56335e47939b..11d6dcac74fd 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -5464,20 +5464,36 @@ static void ath11k_mac_set_hemcsmap(struct ath11k *ar,
 				    struct ieee80211_sta_he_cap *he_cap,
 				    int band)
 {
-	struct ath11k_band_cap *band_cap = &cap->band[band];
+	u16 txmcs_map, rxmcs_map;
+	u32 i;
 
+	rxmcs_map = 0;
+	txmcs_map = 0;
+	for (i = 0; i < 8; i++) {
+		if (i < ar->num_tx_chains &&
+		    (ar->cfg_tx_chainmask >> cap->tx_chain_mask_shift) & BIT(i))
+			txmcs_map |= IEEE80211_HE_MCS_SUPPORT_0_11 << (i * 2);
+		else
+			txmcs_map |= IEEE80211_HE_MCS_NOT_SUPPORTED << (i * 2);
+
+		if (i < ar->num_rx_chains &&
+		    (ar->cfg_rx_chainmask >> cap->tx_chain_mask_shift) & BIT(i))
+			rxmcs_map |= IEEE80211_HE_MCS_SUPPORT_0_11 << (i * 2);
+		else
+			rxmcs_map |= IEEE80211_HE_MCS_NOT_SUPPORTED << (i * 2);
+	}
 	he_cap->he_mcs_nss_supp.rx_mcs_80 =
-		cpu_to_le16(band_cap->he_mcs & 0xffff);
+		cpu_to_le16(rxmcs_map & 0xffff);
 	he_cap->he_mcs_nss_supp.tx_mcs_80 =
-		cpu_to_le16(band_cap->he_mcs & 0xffff);
+		cpu_to_le16(txmcs_map & 0xffff);
 	he_cap->he_mcs_nss_supp.rx_mcs_160 =
-		cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
+		cpu_to_le16(rxmcs_map & 0xffff);
 	he_cap->he_mcs_nss_supp.tx_mcs_160 =
-		cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
+		cpu_to_le16(txmcs_map & 0xffff);
 	he_cap->he_mcs_nss_supp.rx_mcs_80p80 =
-		cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
+		cpu_to_le16(rxmcs_map & 0xffff);
 	he_cap->he_mcs_nss_supp.tx_mcs_80p80 =
-		cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
+		cpu_to_le16(txmcs_map & 0xffff);
 }
 
 static int ath11k_mac_copy_he_cap(struct ath11k *ar,
-- 
2.7.4


-- 
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

  parent reply	other threads:[~2022-10-18 21:29 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-18 21:28 [PATCH v2 0/4] wifi: ath11k: push MU-MIMO configurations to hardware Muna Sinada
2022-10-18 21:28 ` Muna Sinada
2022-10-18 21:28 ` [PATCH v2 1/4] wifi: ath11k: modify accessor macros to match index size Muna Sinada
2022-10-18 21:28   ` Muna Sinada
2023-02-27 12:26   ` Kalle Valo
2023-02-27 12:26     ` Kalle Valo
2022-10-18 21:28 ` [PATCH v2 2/4] wifi: ath11k: push MU-MIMO params from hostapd to hardware Muna Sinada
2022-10-18 21:28   ` Muna Sinada
2023-03-28 11:11   ` Robert Marko
2023-03-28 11:11     ` Robert Marko
2023-03-29  9:45     ` Kalle Valo
2023-03-29  9:45       ` Kalle Valo
2023-03-29 10:42       ` Robert Marko
2023-03-29 10:42         ` Robert Marko
2023-03-29 11:28         ` Kalle Valo
2023-03-29 11:28           ` Kalle Valo
2023-04-05  8:19           ` Kalle Valo
2023-04-05  8:19             ` Kalle Valo
2023-04-12 23:19             ` Muna Sinada (QUIC)
2023-04-12 23:19               ` Muna Sinada (QUIC)
2023-04-14  5:18               ` Kalle Valo
2023-04-14  5:18                 ` Kalle Valo
2023-04-18  9:09                 ` Kalle Valo
2023-04-18  9:09                   ` Kalle Valo
2023-04-18  9:10                   ` Robert Marko
2023-04-18  9:10                     ` Robert Marko
2022-10-18 21:28 ` [PATCH v2 3/4] wifi: ath11k: move HE MCS mapper to a separate function Muna Sinada
2022-10-18 21:28   ` Muna Sinada
2022-10-18 21:28 ` Muna Sinada [this message]
2022-10-18 21:28   ` [PATCH v2 4/4] wifi: ath11k: generate rx and tx mcs maps for supported HE mcs Muna Sinada
2023-04-05  8:25 ` wifi: ath11k: push MU-MIMO configurations to hardware Kernel.org Bugbot
2023-04-05  8:25   ` Kernel.org Bugbot
2023-04-19 14:41 ` ath11k: regression with 80+80 and 160MHz channels Kernel.org Bugbot
2023-04-19 14:41   ` Kernel.org Bugbot

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=1666128501-12364-5-git-send-email-quic_msinada@quicinc.com \
    --to=quic_msinada@quicinc.com \
    --cc=ath11k@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    /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.