Skip to content

Commit 7d3e663

Browse files
jonas2515gregkh
authored andcommitted
mwifiex: Run SET_BSS_MODE when changing from P2P to STATION vif-type
[ Upstream commit c2e9666 ] We currently handle changing from the P2P to the STATION virtual interface type slightly different than changing from P2P to ADHOC: When changing to STATION, we don't send the SET_BSS_MODE command. We do send that command on all other type-changes though, and it probably makes sense to send the command since after all we just changed our BSS_MODE. Looking at prior changes to this part of the code, it seems that this is simply a leftover from old refactorings. Since sending the SET_BSS_MODE command is the only difference between mwifiex_change_vif_to_sta_adhoc() and the current code, we can now use mwifiex_change_vif_to_sta_adhoc() for both switching to ADHOC and STATION interface type. This does not fix any particular bug and just "looked right", so there's a small chance it might be a regression. Signed-off-by: Jonas Dreßler <verdre@v0yd.nl> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20210914195909.36035-4-verdre@v0yd.nl Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 480c240 commit 7d3e663

File tree

1 file changed

+4
-18
lines changed

1 file changed

+4
-18
lines changed

drivers/net/wireless/marvell/mwifiex/cfg80211.c

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,29 +1233,15 @@ mwifiex_cfg80211_change_virtual_intf(struct wiphy *wiphy,
12331233
break;
12341234
case NL80211_IFTYPE_P2P_CLIENT:
12351235
case NL80211_IFTYPE_P2P_GO:
1236+
if (mwifiex_cfg80211_deinit_p2p(priv))
1237+
return -EFAULT;
1238+
12361239
switch (type) {
1237-
case NL80211_IFTYPE_STATION:
1238-
if (mwifiex_cfg80211_deinit_p2p(priv))
1239-
return -EFAULT;
1240-
priv->adapter->curr_iface_comb.p2p_intf--;
1241-
priv->adapter->curr_iface_comb.sta_intf++;
1242-
dev->ieee80211_ptr->iftype = type;
1243-
if (mwifiex_deinit_priv_params(priv))
1244-
return -1;
1245-
if (mwifiex_init_new_priv_params(priv, dev, type))
1246-
return -1;
1247-
if (mwifiex_sta_init_cmd(priv, false, false))
1248-
return -1;
1249-
break;
12501240
case NL80211_IFTYPE_ADHOC:
1251-
if (mwifiex_cfg80211_deinit_p2p(priv))
1252-
return -EFAULT;
1241+
case NL80211_IFTYPE_STATION:
12531242
return mwifiex_change_vif_to_sta_adhoc(dev, curr_iftype,
12541243
type, params);
1255-
break;
12561244
case NL80211_IFTYPE_AP:
1257-
if (mwifiex_cfg80211_deinit_p2p(priv))
1258-
return -EFAULT;
12591245
return mwifiex_change_vif_to_ap(dev, curr_iftype, type,
12601246
params);
12611247
case NL80211_IFTYPE_UNSPECIFIED:

0 commit comments

Comments
 (0)