wcn36xx: Extend V1 data-structures
v4 cover wcn36xx: Extend V1 data-structures
This series is one in a set of seven to add support for wcn3680 at 802.11ac data-rates.
V4:
- No functional change.
Sending out full set again using --base=ath-202009090652 to aid kernel
test robot
- https://lore.kernel.org/linux-wireless/[email protected]/T/#t
V3:
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/[email protected]/T/#u
https://lore.kernel.org/linux-wireless/[email protected]/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(-)
base-commit: 160b351d75cb50a0dd2abf9b63e1891935aa9e4a
Signature · 1 line
2.27.0
PATCH v4 1/2 wcn36xx: Add VHT fields to parameter data structures
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.
--- drivers/net/wireless/ath/wcn36xx/hal.h | 14 +++++++++++++- drivers/net/wireless/ath/wcn36xx/smd.c | 2 ++ 2 files changed, 15 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/wcn36xx/hal.h +13 -1
@@ -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;
drivers/net/wireless/ath/wcn36xx/smd.c +2 -0
@@ -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;
Signature · 1 line
2.27.0
PATCH v4 2/2 wcn36xx: Use V1 data structure to store supported rates
In reply to Bryan O'DonoghueThis 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.
--- drivers/net/wireless/ath/wcn36xx/smd.c | 5 +++-- drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/wcn36xx/smd.c +3 -2
@@ -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); } }
drivers/net/wireless/ath/wcn36xx/wcn36xx.h +1 -1
@@ -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 ];
Signature · 1 line
2.27.0