From: Kalle Valo <kvalo@kernel.org>
To: ath12k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 3/3] wifi: ath12k: wmi: delete PSOC_HOST_MAX_NUM_SS
Date: Tue, 20 Dec 2022 14:06:55 +0200 [thread overview]
Message-ID: <20221220120655.19389-4-kvalo@kernel.org> (raw)
In-Reply-To: <20221220120655.19389-1-kvalo@kernel.org>
From: Kalle Valo <quic_kvalo@quicinc.com>
Both PSOC_HOST_MAX_NUM_SS and WMI_MAX_NUM_SS are set to 8. The host assumes
that the values are the same but there's no check for that, so things will
break if either of the values change. It's simpler and safer to have just one
define so delete PSOC_HOST_MAX_NUM_SS and use WMI_MAX_NUM_SS everywhere.
No functional changes.
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
---
drivers/net/wireless/ath/ath12k/wmi.c | 10 +++++-----
drivers/net/wireless/ath/ath12k/wmi.h | 4 +---
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c
index 338082719631..f6df14149531 100644
--- a/drivers/net/wireless/ath/ath12k/wmi.c
+++ b/drivers/net/wireless/ath/ath12k/wmi.c
@@ -428,7 +428,7 @@ static int ath12k_pull_svc_ready_ext(struct ath12k_wmi_pdev *wmi_handle,
arg->ppet.numss_m1 = le32_to_cpu(ev->ppet.numss_m1);
arg->ppet.ru_bit_mask = le32_to_cpu(ev->ppet.ru_info);
- for (i = 0; i < PSOC_HOST_MAX_NUM_SS; i++)
+ for (i = 0; i < WMI_MAX_NUM_SS; i++)
arg->ppet.ppet16_ppet8_ru3_ru0[i] =
le32_to_cpu(ev->ppet.ppet16_ppet8_ru3_ru0[i]);
@@ -520,7 +520,7 @@ ath12k_pull_mac_phy_cap_svc_ready_ext(struct ath12k_wmi_pdev *wmi_handle,
cap_band->he_ppet.numss_m1 = le32_to_cpu(mac_caps->he_ppet2g.numss_m1);
cap_band->he_ppet.ru_bit_mask = le32_to_cpu(mac_caps->he_ppet2g.ru_info);
- for (i = 0; i < PSOC_HOST_MAX_NUM_SS; i++)
+ for (i = 0; i < WMI_MAX_NUM_SS; i++)
cap_band->he_ppet.ppet16_ppet8_ru3_ru0[i] =
le32_to_cpu(mac_caps->he_ppet2g.ppet16_ppet8_ru3_ru0[i]);
}
@@ -541,7 +541,7 @@ ath12k_pull_mac_phy_cap_svc_ready_ext(struct ath12k_wmi_pdev *wmi_handle,
cap_band->he_ppet.numss_m1 = le32_to_cpu(mac_caps->he_ppet5g.numss_m1);
cap_band->he_ppet.ru_bit_mask = le32_to_cpu(mac_caps->he_ppet5g.ru_info);
- for (i = 0; i < PSOC_HOST_MAX_NUM_SS; i++)
+ for (i = 0; i < WMI_MAX_NUM_SS; i++)
cap_band->he_ppet.ppet16_ppet8_ru3_ru0[i] =
le32_to_cpu(mac_caps->he_ppet5g.ppet16_ppet8_ru3_ru0[i]);
@@ -559,7 +559,7 @@ ath12k_pull_mac_phy_cap_svc_ready_ext(struct ath12k_wmi_pdev *wmi_handle,
cap_band->he_ppet.numss_m1 = le32_to_cpu(mac_caps->he_ppet5g.numss_m1);
cap_band->he_ppet.ru_bit_mask = le32_to_cpu(mac_caps->he_ppet5g.ru_info);
- for (i = 0; i < PSOC_HOST_MAX_NUM_SS; i++)
+ for (i = 0; i < WMI_MAX_NUM_SS; i++)
cap_band->he_ppet.ppet16_ppet8_ru3_ru0[i] =
le32_to_cpu(mac_caps->he_ppet5g.ppet16_ppet8_ru3_ru0[i]);
}
@@ -1935,7 +1935,7 @@ int ath12k_wmi_send_peer_assoc_cmd(struct ath12k *ar,
cpu_to_le32(arg->peer_he_cap_phyinfo[i]);
cmd->peer_ppet.numss_m1 = cpu_to_le32(arg->peer_ppet.numss_m1);
cmd->peer_ppet.ru_info = cpu_to_le32(arg->peer_ppet.ru_bit_mask);
- for (i = 0; i < PSOC_HOST_MAX_NUM_SS; i++)
+ for (i = 0; i < WMI_MAX_NUM_SS; i++)
cmd->peer_ppet.ppet16_ppet8_ru3_ru0[i] =
cpu_to_le32(arg->peer_ppet.ppet16_ppet8_ru3_ru0[i]);
diff --git a/drivers/net/wireless/ath/ath12k/wmi.h b/drivers/net/wireless/ath/ath12k/wmi.h
index c193aea704a2..84e3fb918e43 100644
--- a/drivers/net/wireless/ath/ath12k/wmi.h
+++ b/drivers/net/wireless/ath/ath12k/wmi.h
@@ -43,8 +43,6 @@ static inline s32 a_sle32_to_cpu(a_sle32 val)
return le32_to_cpu((__force __le32)val);
}
-#define PSOC_HOST_MAX_NUM_SS (8)
-
/* defines to set Packet extension values which can be 0 us, 8 usec or 16 usec */
#define MAX_HE_NSS 8
#define MAX_HE_MODULATION 8
@@ -2233,7 +2231,7 @@ struct ath12k_wmi_pdev_band_arg {
struct ath12k_wmi_ppe_threshold_arg {
u32 numss_m1;
u32 ru_bit_mask;
- u32 ppet16_ppet8_ru3_ru0[PSOC_HOST_MAX_NUM_SS];
+ u32 ppet16_ppet8_ru3_ru0[WMI_MAX_NUM_SS];
};
#define PSOC_HOST_MAX_PHY_SIZE (3)
--
2.30.2
prev parent reply other threads:[~2022-12-20 12:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-20 12:06 [PATCH 0/3] wifi: ath12k: small cleanup in HAL and WMI Kalle Valo
2022-12-20 12:06 ` [PATCH 1/3] wifi: ath12k: hal: add ab parameter to macros using it Kalle Valo
2023-01-18 6:36 ` Kalle Valo
2022-12-20 12:06 ` [PATCH 2/3] wifi: ath12k: hal: convert offset macros to functions Kalle Valo
2022-12-20 12:06 ` Kalle Valo [this message]
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=20221220120655.19389-4-kvalo@kernel.org \
--to=kvalo@kernel.org \
--cc=ath12k@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).