Commit 09f63ae6 authored by Avinash Patil's avatar Avinash Patil Committed by Kalle Valo

mwifiex: set wiphy params only once

RTS threshold, fragmentation threshold are per device properties.
Setting them on any interface would be reflected for all other
interfaces as well. This patch removes unnesessary command download
per interface.
Signed-off-by: default avatarAvinash Patil <patila@marvell.com>
Signed-off-by: default avatarAmitkumar Karwar <akarwar@marvell.com>
Signed-off-by: default avatarCathy Luo <cluo@marvell.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent e52a85d3
...@@ -590,15 +590,19 @@ mwifiex_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed) ...@@ -590,15 +590,19 @@ mwifiex_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
struct mwifiex_adapter *adapter = mwifiex_cfg80211_get_adapter(wiphy); struct mwifiex_adapter *adapter = mwifiex_cfg80211_get_adapter(wiphy);
struct mwifiex_private *priv; struct mwifiex_private *priv;
struct mwifiex_uap_bss_param *bss_cfg; struct mwifiex_uap_bss_param *bss_cfg;
int ret, bss_started, i; int ret;
for (i = 0; i < adapter->priv_num; i++) { priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);
priv = adapter->priv[i];
switch (priv->bss_role) { switch (priv->bss_role) {
case MWIFIEX_BSS_ROLE_UAP: case MWIFIEX_BSS_ROLE_UAP:
bss_cfg = kzalloc(sizeof(struct mwifiex_uap_bss_param), if (priv->bss_started) {
GFP_KERNEL); dev_err(adapter->dev,
"cannot change wiphy params when bss started");
return -EINVAL;
}
bss_cfg = kzalloc(sizeof(*bss_cfg), GFP_KERNEL);
if (!bss_cfg) if (!bss_cfg)
return -ENOMEM; return -ENOMEM;
...@@ -611,42 +615,24 @@ mwifiex_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed) ...@@ -611,42 +615,24 @@ mwifiex_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
if (changed & WIPHY_PARAM_RETRY_LONG) if (changed & WIPHY_PARAM_RETRY_LONG)
bss_cfg->retry_limit = wiphy->retry_long; bss_cfg->retry_limit = wiphy->retry_long;
bss_started = priv->bss_started;
ret = mwifiex_send_cmd(priv, HostCmd_CMD_UAP_BSS_STOP,
HostCmd_ACT_GEN_SET, 0,
NULL, true);
if (ret) {
wiphy_err(wiphy, "Failed to stop the BSS\n");
kfree(bss_cfg);
return ret;
}
ret = mwifiex_send_cmd(priv, HostCmd_CMD_UAP_SYS_CONFIG, ret = mwifiex_send_cmd(priv, HostCmd_CMD_UAP_SYS_CONFIG,
HostCmd_ACT_GEN_SET, HostCmd_ACT_GEN_SET,
UAP_BSS_PARAMS_I, bss_cfg, UAP_BSS_PARAMS_I, bss_cfg,
false); false);
kfree(bss_cfg); kfree(bss_cfg);
if (ret) { if (ret) {
wiphy_err(wiphy, "Failed to set bss config\n"); wiphy_err(wiphy, "Failed to set wiphy phy params\n");
return ret; return ret;
} }
if (!bss_started)
break; break;
ret = mwifiex_send_cmd(priv, HostCmd_CMD_UAP_BSS_START,
HostCmd_ACT_GEN_SET, 0,
NULL, false);
if (ret) {
wiphy_err(wiphy, "Failed to start BSS\n");
return ret;
}
break;
case MWIFIEX_BSS_ROLE_STA: case MWIFIEX_BSS_ROLE_STA:
if (priv->media_connected) {
dev_err(adapter->dev,
"cannot change wiphy params when connected");
return -EINVAL;
}
if (changed & WIPHY_PARAM_RTS_THRESHOLD) { if (changed & WIPHY_PARAM_RTS_THRESHOLD) {
ret = mwifiex_set_rts(priv, ret = mwifiex_set_rts(priv,
wiphy->rts_threshold); wiphy->rts_threshold);
...@@ -661,7 +647,6 @@ mwifiex_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed) ...@@ -661,7 +647,6 @@ mwifiex_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
} }
break; break;
} }
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment