All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/4] wcn36xx: Enable VHT when supported
@ 2020-09-10 15:08 Bryan O'Donoghue
  2020-09-10 15:08 ` [PATCH v5 1/4] wcn36xx: Define INIT_HAL_MSG_V1() Bryan O'Donoghue
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Bryan O'Donoghue @ 2020-09-10 15:08 UTC (permalink / raw)
  To: kvalo, wcn36xx, linux-wireless; +Cc: bryan.odonoghue, shawn.guo, loic.poulain

This series is six in a set of seven to add support for wcn3680 at 802.11ac
data-rates.

These two commits have been moved later in the set of commits so that the
patches to enable advertisement of VHT capabilities happen after all of the
supporting code has been comitted.

V5:
- No change to V4 but need to send the set again so that
  prerequisite-patch-id makes sense to the build robot here.

V4:
- Missed inclusion of these two patches in V3 versus V2.
  wcn36xx: Convert to VHT parameter structure on wcn3680
  wcn36xx: Define INIT_HAL_MSG_V1()

- Generated set using --base=ath-202009090652 to aid kernel
  test robot
- https://lore.kernel.org/linux-wireless/20200908183331.2871016-1-bryan.odonoghue@linaro.org/T/#t

V3/RESEND:
- Messed up my .git/config resending from my @linaro.org address

Changes from V2:

- Rename "wcn36xx: Add ieee802.11 VHT flags" to "wcn36xx: Advertise
  ieee802.11 VHT flags"

https://lore.kernel.org/linux-wireless/20200829033908.2167689-5-bryan.odonoghue@linaro.org/T/#u
https://lore.kernel.org/linux-wireless/20200829033846.2167619-4-bryan.odonoghue@linaro.org/T/#u

Bryan O'Donoghue (4):
  wcn36xx: Define INIT_HAL_MSG_V1()
  wcn36xx: Convert to VHT parameter structure on wcn3680
  wcn36xx: Add VHT rates to wcn36xx_update_allowed_rates()
  wcn36xx: Advertise ieee802.11 VHT flags

 drivers/net/wireless/ath/wcn36xx/main.c | 40 +++++++++++++++++++++++++
 drivers/net/wireless/ath/wcn36xx/smd.c  | 26 ++++++++++++----
 2 files changed, 60 insertions(+), 6 deletions(-)


base-commit: 160b351d75cb50a0dd2abf9b63e1891935aa9e4a
prerequisite-patch-id: 9a4ac7faca179f6594c9b3a115ee69a2da540a69
prerequisite-patch-id: 183286f9c22d1aaa12f356651224e6b337ef1938
prerequisite-patch-id: af468d413daaf8d2aad195fcb43c6e66390d8468
prerequisite-patch-id: 08122a9557904ce5358f52dd08cc33270fa202c1
prerequisite-patch-id: 82e0b7c5b2e9fa80baca001cce12577d98e306a9
prerequisite-patch-id: 8ee7f5bd6cb5b7b7d713947b554ad93bb90d8230
prerequisite-patch-id: d05c2253e4523b05b2e43491aa13ceeef68fd2f0
prerequisite-patch-id: 8be29513d3efa64df15297bcf81ec3db55088ee1
prerequisite-patch-id: d267dcd834afad75a69bcd2adcccfdad6566a7ba
prerequisite-patch-id: 47145acae6e24e8e6580fca1dbddfbec24f7b50b
prerequisite-patch-id: 8c66bccb923be821cf109a3a0d3a1a028edb4930
prerequisite-patch-id: d0f5f3769b2963208fd2348840726fa1d3501b63
prerequisite-patch-id: 746f63cf58fa3bf62736435c81dba2558aba8e81
prerequisite-patch-id: 375bb7847ae74c63d2eacdbd0d73371aef1546fe
prerequisite-patch-id: 8a598e22a08b0ec233d0ec56eeb53673eb1b8feb
prerequisite-patch-id: b0eba574ddc35ecec2d0e39c0d3351d1b260420e
prerequisite-patch-id: 143a1019813b7e4974a67e9eea1f1d599c0fdfdf
prerequisite-patch-id: f66d9fe9eb731272b825c9430c15dca89d6c6129
prerequisite-patch-id: c8c2d2dd1452c357f73fc4c92e5b564d59a05562
prerequisite-patch-id: 273c13464a69354d32790ed7509472d9c2b11231
prerequisite-patch-id: adbde1c98b85a16a6500b4210d4f055b9493418c
prerequisite-patch-id: 559b6f9af6b26f860896dea4c7eb385ba9bdf0d5
prerequisite-patch-id: 94c091c0c78b754d4c842a097a6db126bf6e770f
prerequisite-patch-id: f2e549349c09f4675775b40bf9bb9b1f2bec6db8
prerequisite-patch-id: c3a6aa788141f5b8782d28dac264470c8081bb97
-- 
2.27.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v5 1/4] wcn36xx: Define INIT_HAL_MSG_V1()
  2020-09-10 15:08 [PATCH v5 0/4] wcn36xx: Enable VHT when supported Bryan O'Donoghue
@ 2020-09-10 15:08 ` Bryan O'Donoghue
  2020-09-22  7:39   ` Kalle Valo
  2020-09-10 15:08 ` [PATCH v5 2/4] wcn36xx: Convert to VHT parameter structure on wcn3680 Bryan O'Donoghue
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Bryan O'Donoghue @ 2020-09-10 15:08 UTC (permalink / raw)
  To: kvalo, wcn36xx, linux-wireless; +Cc: bryan.odonoghue, shawn.guo, loic.poulain

In order to pass 802.11ac VHT parameters from the SoC to wcn36xx we need to
use the V1 data structures associated with BSS and STA parameters.

The means of identifying a V1 data-structure is via the SMD version field.
This patch defines a INIT_HAL_MSG_V1() which operates the same way as
INIT_HAL_MSG() with the exception that it defines VERSION1 as opposed to
VERSION0.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/smd.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index dde43a2b0d81..0f5952003fff 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -466,14 +466,20 @@ static void init_hal_msg(struct wcn36xx_hal_msg_header *hdr,
 	hdr->len = msg_size + sizeof(*hdr);
 }
 
-#define INIT_HAL_MSG(msg_body, type) \
+#define __INIT_HAL_MSG(msg_body, type, version) \
 	do {								\
 		memset(&msg_body, 0, sizeof(msg_body));			\
 		msg_body.header.msg_type = type;			\
-		msg_body.header.msg_version = WCN36XX_HAL_MSG_VERSION0; \
+		msg_body.header.msg_version = version;			\
 		msg_body.header.len = sizeof(msg_body);			\
 	} while (0)							\
 
+#define INIT_HAL_MSG(msg_body, type)	\
+	__INIT_HAL_MSG(msg_body, type, WCN36XX_HAL_MSG_VERSION0)
+
+#define INIT_HAL_MSG_V1(msg_body, type) \
+	__INIT_HAL_MSG(msg_body, type, WCN36XX_HAL_MSG_VERSION1)
+
 #define INIT_HAL_PTT_MSG(p_msg_body, ppt_msg_len) \
 	do { \
 		memset(p_msg_body, 0, sizeof(*p_msg_body) + ppt_msg_len); \
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v5 2/4] wcn36xx: Convert to VHT parameter structure on wcn3680
  2020-09-10 15:08 [PATCH v5 0/4] wcn36xx: Enable VHT when supported Bryan O'Donoghue
  2020-09-10 15:08 ` [PATCH v5 1/4] wcn36xx: Define INIT_HAL_MSG_V1() Bryan O'Donoghue
@ 2020-09-10 15:08 ` Bryan O'Donoghue
  2020-09-10 15:08 ` [PATCH v5 3/4] wcn36xx: Add VHT rates to wcn36xx_update_allowed_rates() Bryan O'Donoghue
  2020-09-10 15:08 ` [PATCH v5 4/4] wcn36xx: Advertise ieee802.11 VHT flags Bryan O'Donoghue
  3 siblings, 0 replies; 6+ messages in thread
From: Bryan O'Donoghue @ 2020-09-10 15:08 UTC (permalink / raw)
  To: kvalo, wcn36xx, linux-wireless; +Cc: bryan.odonoghue, shawn.guo, loic.poulain

In order to send VHT parameters to wcn3680 we need to pass the extended V1
parameter structures to the firmware. These commands need to have the
version number set to 1.

This patch makes the conversion. The conversion consists of

1. Setting the version number for wcn3680 or leaving it at 0 otherwise
2. Setting the size of the packet header lower for wcn3620 and wcn3660

Once done all three chips can continue to use the same code to pass
parameters to their respective firmware. In the case of the wcn3680 the
passed structures will be slightly larger to accommodate communication of
VHT descriptors.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/smd.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index 0f5952003fff..e74abc153153 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -1446,8 +1446,12 @@ static int wcn36xx_smd_config_sta_v1(struct wcn36xx *wcn,
 	struct wcn36xx_hal_config_sta_req_msg_v1 msg_body;
 	struct wcn36xx_hal_config_sta_params_v1 *sta_params;
 
-	INIT_HAL_MSG(msg_body, WCN36XX_HAL_CONFIG_STA_REQ);
-	msg_body.header.len -= WCN36XX_DIFF_STA_PARAMS_V1_NOVHT;
+	if (wcn->rf_id == RF_IRIS_WCN3680) {
+		INIT_HAL_MSG_V1(msg_body, WCN36XX_HAL_CONFIG_STA_REQ);
+	} else {
+		INIT_HAL_MSG(msg_body, WCN36XX_HAL_CONFIG_STA_REQ);
+		msg_body.header.len -= WCN36XX_DIFF_STA_PARAMS_V1_NOVHT;
+	}
 
 	sta_params = &msg_body.sta_params;
 
@@ -1627,8 +1631,12 @@ static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn,
 	if (!msg_body)
 		return -ENOMEM;
 
-	INIT_HAL_MSG((*msg_body), WCN36XX_HAL_CONFIG_BSS_REQ);
-	msg_body->header.len -= WCN36XX_DIFF_BSS_PARAMS_V1_NOVHT;
+	if (wcn->rf_id == RF_IRIS_WCN3680) {
+		INIT_HAL_MSG_V1((*msg_body), WCN36XX_HAL_CONFIG_BSS_REQ);
+	} else {
+		INIT_HAL_MSG((*msg_body), WCN36XX_HAL_CONFIG_BSS_REQ);
+		msg_body->header.len -= WCN36XX_DIFF_BSS_PARAMS_V1_NOVHT;
+	}
 
 	bss = &msg_body->bss_params;
 	sta = &bss->sta;
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v5 3/4] wcn36xx: Add VHT rates to wcn36xx_update_allowed_rates()
  2020-09-10 15:08 [PATCH v5 0/4] wcn36xx: Enable VHT when supported Bryan O'Donoghue
  2020-09-10 15:08 ` [PATCH v5 1/4] wcn36xx: Define INIT_HAL_MSG_V1() Bryan O'Donoghue
  2020-09-10 15:08 ` [PATCH v5 2/4] wcn36xx: Convert to VHT parameter structure on wcn3680 Bryan O'Donoghue
@ 2020-09-10 15:08 ` Bryan O'Donoghue
  2020-09-10 15:08 ` [PATCH v5 4/4] wcn36xx: Advertise ieee802.11 VHT flags Bryan O'Donoghue
  3 siblings, 0 replies; 6+ messages in thread
From: Bryan O'Donoghue @ 2020-09-10 15:08 UTC (permalink / raw)
  To: kvalo, wcn36xx, linux-wireless; +Cc: bryan.odonoghue, shawn.guo, loic.poulain

This commit adds VHT rates to the wcn36xx_update_allowed_rates() routine.
Thus allowing the driver to latch the declared rates and transmit them to
the firmware in the same way as other 80211.n rates are.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/main.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
index 36cfa7043bc3..720d3fa8ddcb 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -766,6 +766,14 @@ static void wcn36xx_update_allowed_rates(struct ieee80211_sta *sta,
 		       sta->ht_cap.mcs.rx_mask,
 		       sizeof(sta->ht_cap.mcs.rx_mask));
 	}
+
+	if (sta->vht_cap.vht_supported) {
+		sta_priv->supported_rates.op_rate_mode = STA_11ac;
+		sta_priv->supported_rates.vht_rx_mcs_map =
+				sta->vht_cap.vht_mcs.rx_mcs_map;
+		sta_priv->supported_rates.vht_tx_mcs_map =
+				sta->vht_cap.vht_mcs.tx_mcs_map;
+	}
 }
 void wcn36xx_set_default_rates(struct wcn36xx_hal_supported_rates *rates)
 {
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v5 4/4] wcn36xx: Advertise ieee802.11 VHT flags
  2020-09-10 15:08 [PATCH v5 0/4] wcn36xx: Enable VHT when supported Bryan O'Donoghue
                   ` (2 preceding siblings ...)
  2020-09-10 15:08 ` [PATCH v5 3/4] wcn36xx: Add VHT rates to wcn36xx_update_allowed_rates() Bryan O'Donoghue
@ 2020-09-10 15:08 ` Bryan O'Donoghue
  3 siblings, 0 replies; 6+ messages in thread
From: Bryan O'Donoghue @ 2020-09-10 15:08 UTC (permalink / raw)
  To: kvalo, wcn36xx, linux-wireless; +Cc: bryan.odonoghue, shawn.guo, loic.poulain

This patch adds ieee802.11 VHT flags for the wcn3680b.

- RX_STBC1
- SU Beamformee
- MU Beamformee
- VHT80 SGI
- Single spatial stream

RX LDPC is declared as supported in the datasheet but not enabled at this
time.

After this patch is applied an AP should see the wcn3680 as an 802.11ac
capable device.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/main.c | 32 +++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
index 720d3fa8ddcb..43596b919ed7 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -1200,6 +1200,35 @@ static const struct ieee80211_ops wcn36xx_ops = {
 	CFG80211_TESTMODE_CMD(wcn36xx_tm_cmd)
 };
 
+static void
+wcn36xx_set_ieee80211_vht_caps(struct ieee80211_sta_vht_cap *vht_cap)
+{
+	vht_cap->vht_supported = true;
+
+	vht_cap->cap = (IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895 |
+			IEEE80211_VHT_CAP_SHORT_GI_80 |
+			IEEE80211_VHT_CAP_RXSTBC_1 |
+			IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE |
+			IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE |
+			3 << IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT |
+			7 << IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT);
+
+	vht_cap->vht_mcs.rx_mcs_map =
+		cpu_to_le16(IEEE80211_VHT_MCS_SUPPORT_0_9 |
+			    IEEE80211_VHT_MCS_NOT_SUPPORTED << 2 |
+			    IEEE80211_VHT_MCS_NOT_SUPPORTED << 4 |
+			    IEEE80211_VHT_MCS_NOT_SUPPORTED << 6 |
+			    IEEE80211_VHT_MCS_NOT_SUPPORTED << 8 |
+			    IEEE80211_VHT_MCS_NOT_SUPPORTED << 10 |
+			    IEEE80211_VHT_MCS_NOT_SUPPORTED << 12 |
+			    IEEE80211_VHT_MCS_NOT_SUPPORTED << 14);
+
+	vht_cap->vht_mcs.rx_highest = cpu_to_le16(433);
+	vht_cap->vht_mcs.tx_highest = vht_cap->vht_mcs.rx_highest;
+
+	vht_cap->vht_mcs.tx_mcs_map = vht_cap->vht_mcs.rx_mcs_map;
+}
+
 static int wcn36xx_init_ieee80211(struct wcn36xx *wcn)
 {
 	static const u32 cipher_suites[] = {
@@ -1226,6 +1255,9 @@ static int wcn36xx_init_ieee80211(struct wcn36xx *wcn)
 	if (wcn->rf_id != RF_IRIS_WCN3620)
 		wcn->hw->wiphy->bands[NL80211_BAND_5GHZ] = &wcn_band_5ghz;
 
+	if (wcn->rf_id == RF_IRIS_WCN3680)
+		wcn36xx_set_ieee80211_vht_caps(&wcn_band_5ghz.vht_cap);
+
 	wcn->hw->wiphy->max_scan_ssids = WCN36XX_MAX_SCAN_SSIDS;
 	wcn->hw->wiphy->max_scan_ie_len = WCN36XX_MAX_SCAN_IE_LEN;
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v5 1/4] wcn36xx: Define INIT_HAL_MSG_V1()
  2020-09-10 15:08 ` [PATCH v5 1/4] wcn36xx: Define INIT_HAL_MSG_V1() Bryan O'Donoghue
@ 2020-09-22  7:39   ` Kalle Valo
  0 siblings, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2020-09-22  7:39 UTC (permalink / raw)
  To: Bryan O'Donoghue
  Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo, loic.poulain

Bryan O'Donoghue <bryan.odonoghue@linaro.org> wrote:

> In order to pass 802.11ac VHT parameters from the SoC to wcn36xx we need to
> use the V1 data structures associated with BSS and STA parameters.
> 
> The means of identifying a V1 data-structure is via the SMD version field.
> This patch defines a INIT_HAL_MSG_V1() which operates the same way as
> INIT_HAL_MSG() with the exception that it defines VERSION1 as opposed to
> VERSION0.
> 
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

4 patches applied to ath-next branch of ath.git, thanks.

f97fe43a9495 wcn36xx: Define INIT_HAL_MSG_V1()
d961fdfaa208 wcn36xx: Convert to VHT parameter structure on wcn3680
87d3f1f34157 wcn36xx: Add VHT rates to wcn36xx_update_allowed_rates()
b421d04e4978 wcn36xx: Advertise ieee802.11 VHT flags

-- 
https://patchwork.kernel.org/patch/11768953/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-09-22  7:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-10 15:08 [PATCH v5 0/4] wcn36xx: Enable VHT when supported Bryan O'Donoghue
2020-09-10 15:08 ` [PATCH v5 1/4] wcn36xx: Define INIT_HAL_MSG_V1() Bryan O'Donoghue
2020-09-22  7:39   ` Kalle Valo
2020-09-10 15:08 ` [PATCH v5 2/4] wcn36xx: Convert to VHT parameter structure on wcn3680 Bryan O'Donoghue
2020-09-10 15:08 ` [PATCH v5 3/4] wcn36xx: Add VHT rates to wcn36xx_update_allowed_rates() Bryan O'Donoghue
2020-09-10 15:08 ` [PATCH v5 4/4] wcn36xx: Advertise ieee802.11 VHT flags Bryan O'Donoghue

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.