All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] wcn36xx: Extend V1 data-structures
@ 2020-09-08 18:24 Bryan O'Donoghue
  2020-09-08 18:24 ` [PATCH v3 1/2] wcn36xx: Add VHT fields to parameter data structures Bryan O'Donoghue
  2020-09-08 18:24 ` [PATCH v3 2/2] wcn36xx: Use V1 data structure to store supported rates Bryan O'Donoghue
  0 siblings, 2 replies; 3+ messages in thread
From: Bryan O'Donoghue @ 2020-09-08 18:24 UTC (permalink / raw)
  To: kvalo, wcn36xx, linux-wireless; +Cc: bryan.odonoghue, shawn.guo, loic.poulain

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

In order to pass VHT parameters to the firmware, we need to extend the
parameter data-structure. In the V2 series, this was accomplished in two
patches.

https://lore.kernel.org/linux-wireless/20200829033908.2167689-13-bryan.odonoghue@linaro.org/T/#u
https://lore.kernel.org/linux-wireless/20200829033908.2167689-2-bryan.odonoghue@linaro.org/T/#u

However since I was rebasing this series anyway I thought it would be a
better idea to do the conversion in one go, so that if someone is
rebasing/bisecting in the future every single patch will still be
functional and testable on wcn3620. If the data-structure is extended and
then the code is subsequently updated, then the patches in-between the
data-structure update and the code update will not be testable on hardware.

As a result I've opted to front-load the conversion. The first patch is
atomic with respect to ongoing functionality on wcn3620, which I think is a
better result for not much extra code.

The eventual enabling for wcn3680 comes in a later patch in a later set.

For a similar reason I thought it best to front-load the conversion to
using the extended V1 data-structure for storing parameters internal to the
driver.

Bryan O'Donoghue (2):
  wcn36xx: Add VHT fields to parameter data structures
  wcn36xx: Use V1 data structure to store supported rates

 drivers/net/wireless/ath/wcn36xx/hal.h     | 14 +++++++++++++-
 drivers/net/wireless/ath/wcn36xx/smd.c     |  7 +++++--
 drivers/net/wireless/ath/wcn36xx/wcn36xx.h |  2 +-
 3 files changed, 19 insertions(+), 4 deletions(-)

-- 
2.27.0


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

* [PATCH v3 1/2] wcn36xx: Add VHT fields to parameter data structures
  2020-09-08 18:24 [PATCH v3 0/2] wcn36xx: Extend V1 data-structures Bryan O'Donoghue
@ 2020-09-08 18:24 ` Bryan O'Donoghue
  2020-09-08 18:24 ` [PATCH v3 2/2] wcn36xx: Use V1 data structure to store supported rates Bryan O'Donoghue
  1 sibling, 0 replies; 3+ messages in thread
From: Bryan O'Donoghue @ 2020-09-08 18:24 UTC (permalink / raw)
  To: kvalo, wcn36xx, linux-wireless; +Cc: bryan.odonoghue, shawn.guo, loic.poulain

In order to pass VHT parameters to wcn3680 we need to use a super-set of
the V1 data-structures with additional VHT parameters tacked on.

This patch adds the additional fields to the STA and BSS parameter
structures.

Since neither wcn3620 nor wcn3660 support VHT the size of the passed
message is fixed to the previous message length. Subsequent changes will
differentiate between wcn3620/wcn3660 and wcn3680 which does use the larger
message size.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/hal.h | 14 +++++++++++++-
 drivers/net/wireless/ath/wcn36xx/smd.c |  2 ++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h b/drivers/net/wireless/ath/wcn36xx/hal.h
index 573799274a02..3cceeaf0136f 100644
--- a/drivers/net/wireless/ath/wcn36xx/hal.h
+++ b/drivers/net/wireless/ath/wcn36xx/hal.h
@@ -1592,9 +1592,15 @@ struct wcn36xx_hal_config_sta_params_v1 {
 	u8 reserved:4;
 
 	/* These rates are the intersection of peer and self capabilities. */
-	struct wcn36xx_hal_supported_rates supported_rates;
+	struct wcn36xx_hal_supported_rates_v1 supported_rates;
+
+	u8 vht_capable;
+	u8 vht_tx_channel_width_set;
+
 } __packed;
 
+#define WCN36XX_DIFF_STA_PARAMS_V1_NOVHT 10
+
 struct wcn36xx_hal_config_sta_req_msg_v1 {
 	struct wcn36xx_hal_msg_header header;
 	struct wcn36xx_hal_config_sta_params_v1 sta_params;
@@ -2015,8 +2021,14 @@ struct wcn36xx_hal_config_bss_params_v1 {
 	 *  "STA context"
 	 */
 	struct wcn36xx_hal_config_sta_params_v1 sta;
+
+	u8 vht_capable;
+	u8 vht_tx_channel_width_set;
+
 } __packed;
 
+#define WCN36XX_DIFF_BSS_PARAMS_V1_NOVHT (WCN36XX_DIFF_STA_PARAMS_V1_NOVHT + 2)
+
 struct wcn36xx_hal_config_bss_req_msg_v1 {
 	struct wcn36xx_hal_msg_header header;
 	struct wcn36xx_hal_config_bss_params_v1 bss_params;
diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index 4c30036e2e56..55aaaeb78b14 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -1223,6 +1223,7 @@ static int wcn36xx_smd_config_sta_v1(struct wcn36xx *wcn,
 	struct wcn36xx_hal_config_sta_params_v1 *sta = &msg_body.sta_params;
 
 	INIT_HAL_MSG(msg_body, WCN36XX_HAL_CONFIG_STA_REQ);
+	msg_body.header.len -= WCN36XX_DIFF_STA_PARAMS_V1_NOVHT;
 
 	wcn36xx_smd_convert_sta_to_v1(wcn, &orig->sta_params,
 				      &msg_body.sta_params);
@@ -1294,6 +1295,7 @@ static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn,
 		return -ENOMEM;
 
 	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] 3+ messages in thread

* [PATCH v3 2/2] wcn36xx: Use V1 data structure to store supported rates
  2020-09-08 18:24 [PATCH v3 0/2] wcn36xx: Extend V1 data-structures Bryan O'Donoghue
  2020-09-08 18:24 ` [PATCH v3 1/2] wcn36xx: Add VHT fields to parameter data structures Bryan O'Donoghue
@ 2020-09-08 18:24 ` Bryan O'Donoghue
  1 sibling, 0 replies; 3+ messages in thread
From: Bryan O'Donoghue @ 2020-09-08 18:24 UTC (permalink / raw)
  To: kvalo, wcn36xx, linux-wireless; +Cc: bryan.odonoghue, shawn.guo, loic.poulain

This patch converts the internal data structure used to store data-rates
from version 0 to version 1.

This allows us to extend out the internal storage to represent VHT
parameters.

Using the extended version 1 data-structure allows us to avoid a whole raft
of version 1 specific fixup functions.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/smd.c     | 5 +++--
 drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index 55aaaeb78b14..d5ca9907af86 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -242,9 +242,10 @@ static void wcn36xx_smd_set_sta_params(struct wcn36xx *wcn,
 		sta_params->aid = sta_priv->aid;
 		wcn36xx_smd_set_sta_ht_params(sta, sta_params);
 		memcpy(&sta_params->supported_rates, &sta_priv->supported_rates,
-			sizeof(sta_priv->supported_rates));
+			sizeof(struct wcn36xx_hal_supported_rates));
 	} else {
-		wcn36xx_set_default_rates(&sta_params->supported_rates);
+		wcn36xx_set_default_rates((struct wcn36xx_hal_supported_rates *)
+					  &sta_params->supported_rates);
 		wcn36xx_smd_set_sta_default_ht_params(sta_params);
 	}
 }
diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
index 342ca0ae7e28..d7d349de20e6 100644
--- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
+++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
@@ -169,7 +169,7 @@ struct wcn36xx_sta {
 	u8 bss_dpu_desc_index;
 	bool is_data_encrypted;
 	/* Rates */
-	struct wcn36xx_hal_supported_rates supported_rates;
+	struct wcn36xx_hal_supported_rates_v1 supported_rates;
 
 	spinlock_t ampdu_lock;		/* protects next two fields */
 	enum wcn36xx_ampdu_state ampdu_state[16];
-- 
2.27.0


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

end of thread, other threads:[~2020-09-08 18:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-08 18:24 [PATCH v3 0/2] wcn36xx: Extend V1 data-structures Bryan O'Donoghue
2020-09-08 18:24 ` [PATCH v3 1/2] wcn36xx: Add VHT fields to parameter data structures Bryan O'Donoghue
2020-09-08 18:24 ` [PATCH v3 2/2] wcn36xx: Use V1 data structure to store supported rates 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.