The txpwr settings are for the whole adapter, not for a single priv, so pass the adapter to the relevant functions and use mwifiex_adapter_send_cmd() instead of mwifiex_send_cmd(). Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> --- drivers/net/wireless/marvell/mwifiex/cfg80211.c | 5 ++--- drivers/net/wireless/marvell/mwifiex/main.h | 4 ++-- drivers/net/wireless/marvell/mwifiex/sta_cmd.c | 10 +++++----- drivers/net/wireless/marvell/mwifiex/sta_ioctl.c | 10 +++++----- drivers/net/wireless/marvell/mwifiex/uap_cmd.c | 2 +- 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c index 5c8232b5a8c7d..35fb86b4cb8d5 100644 --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c @@ -657,8 +657,7 @@ static void mwifiex_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request) { struct mwifiex_adapter *adapter = mwifiex_cfg80211_get_adapter(wiphy); - struct mwifiex_private *priv = mwifiex_get_priv(adapter, - MWIFIEX_BSS_ROLE_ANY); + mwifiex_dbg(adapter, INFO, "info: cfg80211 regulatory domain callback for %c%c\n", request->alpha2[0], request->alpha2[1]); @@ -684,7 +683,7 @@ static void mwifiex_reg_notifier(struct wiphy *wiphy, memcpy(adapter->country_code, request->alpha2, sizeof(request->alpha2)); mwifiex_send_domain_info_cmd_fw(wiphy); - mwifiex_dnld_txpwr_table(priv); + mwifiex_dnld_txpwr_table(adapter); } } diff --git a/drivers/net/wireless/marvell/mwifiex/main.h b/drivers/net/wireless/marvell/mwifiex/main.h index 298726c663724..c51b9a5766150 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.h +++ b/drivers/net/wireless/marvell/mwifiex/main.h @@ -1554,9 +1554,9 @@ int mwifiex_11h_activate(struct mwifiex_private *priv, bool flag); void mwifiex_11h_process_join(struct mwifiex_private *priv, u8 **buffer, struct mwifiex_bssdescriptor *bss_desc); int mwifiex_11h_handle_event_chanswann(struct mwifiex_private *priv); -int mwifiex_dnld_dt_cfgdata(struct mwifiex_private *priv, +int mwifiex_dnld_dt_cfgdata(struct mwifiex_adapter *adapter, struct device_node *node, const char *prefix); -void mwifiex_dnld_txpwr_table(struct mwifiex_private *priv); +void mwifiex_dnld_txpwr_table(struct mwifiex_adapter *adapter); extern const struct ethtool_ops mwifiex_ethtool_ops; diff --git a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c index 30dd4e58e2b1d..bf081278000a7 100644 --- a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c +++ b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c @@ -1455,7 +1455,7 @@ static u32 mwifiex_parse_cal_cfg(u8 *src, size_t len, u8 *dst) return d - dst; } -int mwifiex_dnld_dt_cfgdata(struct mwifiex_private *priv, +int mwifiex_dnld_dt_cfgdata(struct mwifiex_adapter *adapter, struct device_node *node, const char *prefix) { #ifdef CONFIG_OF @@ -1472,9 +1472,9 @@ int mwifiex_dnld_dt_cfgdata(struct mwifiex_private *priv, /* property header is 6 bytes, data must fit in cmd buffer */ if (prop->value && prop->length > 6 && prop->length <= MWIFIEX_SIZE_OF_CMD_BUFFER - S_DS_GEN) { - ret = mwifiex_send_cmd(priv, HostCmd_CMD_CFG_DATA, - HostCmd_ACT_GEN_SET, 0, - prop, true); + ret = mwifiex_adapter_send_cmd(adapter, HostCmd_CMD_CFG_DATA, + HostCmd_ACT_GEN_SET, 0, + prop, true); if (ret) return ret; } @@ -2274,7 +2274,7 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta, bool init) adapter->hs_cfg.gpio = data; } - mwifiex_dnld_dt_cfgdata(priv, adapter->dt_node, + mwifiex_dnld_dt_cfgdata(adapter, adapter->dt_node, "marvell,caldata"); } diff --git a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c index 3586def45adae..1a8a60c1c2e67 100644 --- a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c +++ b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c @@ -180,13 +180,13 @@ int mwifiex_fill_new_bss_desc(struct mwifiex_private *priv, return mwifiex_update_bss_desc_with_ie(priv->adapter, bss_desc); } -void mwifiex_dnld_txpwr_table(struct mwifiex_private *priv) +void mwifiex_dnld_txpwr_table(struct mwifiex_adapter *adapter) { - if (priv->adapter->dt_node) { + if (adapter->dt_node) { char txpwr[] = {"marvell,00_txpwrlimit"}; - memcpy(&txpwr[8], priv->adapter->country_code, 2); - mwifiex_dnld_dt_cfgdata(priv, priv->adapter->dt_node, txpwr); + memcpy(&txpwr[8], adapter->country_code, 2); + mwifiex_dnld_dt_cfgdata(adapter, adapter->dt_node, txpwr); } } @@ -249,7 +249,7 @@ static int mwifiex_process_country_ie(struct mwifiex_private *priv, return -1; } - mwifiex_dnld_txpwr_table(priv); + mwifiex_dnld_txpwr_table(priv->adapter); return 0; } diff --git a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c index 1c0ceac6b27fb..e016ca25ff5a9 100644 --- a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c +++ b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c @@ -1029,7 +1029,7 @@ void mwifiex_uap_set_channel(struct mwifiex_private *priv, if (old_bands != config_bands) { mwifiex_send_domain_info_cmd_fw(priv->adapter->wiphy); - mwifiex_dnld_txpwr_table(priv); + mwifiex_dnld_txpwr_table(priv->adapter); } } -- 2.39.2