wcn36xx: Update wcn36xx_smd_config_bss_v1() to operate internally

This patch updates wcn36xx_smd_config_bss_v1() to update on internally
derived parameters only, specifically making use of STA v1 wrapper routines
previously added.

Once done we no longer need to pass a struct wcn36xx_hal_config_bss_req_msg
which gives us options in later patches to eliminate the kzalloc() in
wcn36xx_smd_config_bss entirely.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Loic Poulain <loic.poulain@linaro.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200910150631.2178970-5-bryan.odonoghue@linaro.org
This commit is contained in:
Bryan O'Donoghue 2020-09-10 16:06:28 +01:00 committed by Kalle Valo
parent 6836931020
commit 7656d17985
1 changed files with 58 additions and 52 deletions

View File

@ -1497,10 +1497,14 @@ void wcn36xx_smd_set_bss_params(struct wcn36xx *wcn,
} }
static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn,
const struct wcn36xx_hal_config_bss_req_msg *orig) struct ieee80211_vif *vif,
struct ieee80211_sta *sta_80211,
const u8 *bssid,
bool update)
{ {
struct wcn36xx_hal_config_bss_req_msg_v1 *msg_body; struct wcn36xx_hal_config_bss_req_msg_v1 *msg_body;
struct wcn36xx_hal_config_bss_params_v1 *bss; struct wcn36xx_hal_config_bss_params_v1 *bss;
struct wcn36xx_hal_config_bss_params bss_v0;
struct wcn36xx_hal_config_sta_params_v1 *sta; struct wcn36xx_hal_config_sta_params_v1 *sta;
int ret; int ret;
@ -1514,72 +1518,74 @@ static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn,
bss = &msg_body->bss_params; bss = &msg_body->bss_params;
sta = &bss->sta; sta = &bss->sta;
/* convert orig to v1 */ memset(&bss_v0, 0x00, sizeof(bss_v0));
memcpy(bss->bssid, &orig->bss_params.bssid, ETH_ALEN); wcn36xx_smd_set_bss_params(wcn, vif, sta_80211, bssid, update, &bss_v0);
memcpy(bss->self_mac_addr, &orig->bss_params.self_mac_addr, ETH_ALEN); wcn36xx_smd_set_sta_params_v1(wcn, vif, sta_80211, sta);
bss->bss_type = orig->bss_params.bss_type; /* convert orig to v1 */
bss->oper_mode = orig->bss_params.oper_mode; memcpy(bss->bssid, &bss_v0.bssid, ETH_ALEN);
bss->nw_type = orig->bss_params.nw_type; memcpy(bss->self_mac_addr, &bss_v0.self_mac_addr, ETH_ALEN);
bss->bss_type = bss_v0.bss_type;
bss->oper_mode = bss_v0.oper_mode;
bss->nw_type = bss_v0.nw_type;
bss->short_slot_time_supported = bss->short_slot_time_supported =
orig->bss_params.short_slot_time_supported; bss_v0.short_slot_time_supported;
bss->lla_coexist = orig->bss_params.lla_coexist; bss->lla_coexist = bss_v0.lla_coexist;
bss->llb_coexist = orig->bss_params.llb_coexist; bss->llb_coexist = bss_v0.llb_coexist;
bss->llg_coexist = orig->bss_params.llg_coexist; bss->llg_coexist = bss_v0.llg_coexist;
bss->ht20_coexist = orig->bss_params.ht20_coexist; bss->ht20_coexist = bss_v0.ht20_coexist;
bss->lln_non_gf_coexist = orig->bss_params.lln_non_gf_coexist; bss->lln_non_gf_coexist = bss_v0.lln_non_gf_coexist;
bss->lsig_tx_op_protection_full_support = bss->lsig_tx_op_protection_full_support =
orig->bss_params.lsig_tx_op_protection_full_support; bss_v0.lsig_tx_op_protection_full_support;
bss->rifs_mode = orig->bss_params.rifs_mode; bss->rifs_mode = bss_v0.rifs_mode;
bss->beacon_interval = orig->bss_params.beacon_interval; bss->beacon_interval = bss_v0.beacon_interval;
bss->dtim_period = orig->bss_params.dtim_period; bss->dtim_period = bss_v0.dtim_period;
bss->tx_channel_width_set = orig->bss_params.tx_channel_width_set; bss->tx_channel_width_set = bss_v0.tx_channel_width_set;
bss->oper_channel = orig->bss_params.oper_channel; bss->oper_channel = bss_v0.oper_channel;
bss->ext_channel = orig->bss_params.ext_channel; bss->ext_channel = bss_v0.ext_channel;
bss->reserved = orig->bss_params.reserved; bss->reserved = bss_v0.reserved;
memcpy(&bss->ssid, &orig->bss_params.ssid, memcpy(&bss->ssid, &bss_v0.ssid,
sizeof(orig->bss_params.ssid)); sizeof(bss_v0.ssid));
bss->action = orig->bss_params.action; bss->action = bss_v0.action;
bss->rateset = orig->bss_params.rateset; bss->rateset = bss_v0.rateset;
bss->ht = orig->bss_params.ht; bss->ht = bss_v0.ht;
bss->obss_prot_enabled = orig->bss_params.obss_prot_enabled; bss->obss_prot_enabled = bss_v0.obss_prot_enabled;
bss->rmf = orig->bss_params.rmf; bss->rmf = bss_v0.rmf;
bss->ht_oper_mode = orig->bss_params.ht_oper_mode; bss->ht_oper_mode = bss_v0.ht_oper_mode;
bss->dual_cts_protection = orig->bss_params.dual_cts_protection; bss->dual_cts_protection = bss_v0.dual_cts_protection;
bss->max_probe_resp_retry_limit = bss->max_probe_resp_retry_limit =
orig->bss_params.max_probe_resp_retry_limit; bss_v0.max_probe_resp_retry_limit;
bss->hidden_ssid = orig->bss_params.hidden_ssid; bss->hidden_ssid = bss_v0.hidden_ssid;
bss->proxy_probe_resp = orig->bss_params.proxy_probe_resp; bss->proxy_probe_resp = bss_v0.proxy_probe_resp;
bss->edca_params_valid = orig->bss_params.edca_params_valid; bss->edca_params_valid = bss_v0.edca_params_valid;
memcpy(&bss->acbe, &orig->bss_params.acbe, memcpy(&bss->acbe, &bss_v0.acbe,
sizeof(orig->bss_params.acbe)); sizeof(bss_v0.acbe));
memcpy(&bss->acbk, &orig->bss_params.acbk, memcpy(&bss->acbk, &bss_v0.acbk,
sizeof(orig->bss_params.acbk)); sizeof(bss_v0.acbk));
memcpy(&bss->acvi, &orig->bss_params.acvi, memcpy(&bss->acvi, &bss_v0.acvi,
sizeof(orig->bss_params.acvi)); sizeof(bss_v0.acvi));
memcpy(&bss->acvo, &orig->bss_params.acvo, memcpy(&bss->acvo, &bss_v0.acvo,
sizeof(orig->bss_params.acvo)); sizeof(bss_v0.acvo));
bss->ext_set_sta_key_param_valid = bss->ext_set_sta_key_param_valid =
orig->bss_params.ext_set_sta_key_param_valid; bss_v0.ext_set_sta_key_param_valid;
memcpy(&bss->ext_set_sta_key_param, memcpy(&bss->ext_set_sta_key_param,
&orig->bss_params.ext_set_sta_key_param, &bss_v0.ext_set_sta_key_param,
sizeof(orig->bss_params.acvo)); sizeof(bss_v0.acvo));
bss->wcn36xx_hal_persona = orig->bss_params.wcn36xx_hal_persona; bss->wcn36xx_hal_persona = bss_v0.wcn36xx_hal_persona;
bss->spectrum_mgt_enable = orig->bss_params.spectrum_mgt_enable; bss->spectrum_mgt_enable = bss_v0.spectrum_mgt_enable;
bss->tx_mgmt_power = orig->bss_params.tx_mgmt_power; bss->tx_mgmt_power = bss_v0.tx_mgmt_power;
bss->max_tx_power = orig->bss_params.max_tx_power; bss->max_tx_power = bss_v0.max_tx_power;
wcn36xx_smd_convert_sta_to_v1(wcn, &orig->bss_params.sta, sta);
PREPARE_HAL_BUF(wcn->hal_buf, (*msg_body)); PREPARE_HAL_BUF(wcn->hal_buf, (*msg_body));
@ -1679,7 +1685,7 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif,
sta_params->mac); sta_params->mac);
if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) { if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) {
ret = wcn36xx_smd_config_bss_v1(wcn, msg); ret = wcn36xx_smd_config_bss_v1(wcn, vif, sta, bssid, update);
} else { } else {
PREPARE_HAL_BUF(wcn->hal_buf, (*msg)); PREPARE_HAL_BUF(wcn->hal_buf, (*msg));