Skip to contentSkip to conversation

mwifiex: check for mfg_mode in add_virtual_intf

PATCH In review Ganapathi Bhat 3 participants 5 messages Sep 7, 2017 – Sep 20, 2017 Marvell mwifiex wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mwifiex: check for mfg_mode in add_virtual_intf

If driver is loaded with 'mfg_mode' enabled, then the sending commands are not allowed. So, skip sending commands, to firmware in mwifiex_add_virtual_intf if 'mfg_mode' is enabled.

Fixes 7311ea850079 ("mwifiex: fix AP start problem for newly added interface")

---
v2: addressed Brian's comments.

---
 drivers/net/wireless/marvell/mwifiex/cfg80211.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)
drivers/net/wireless/marvell/mwifiex/cfg80211.c +11 -8
index 32c5074..ad1ebd8 100644
@@ -2959,18 +2959,21 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
 	}
 
 	mwifiex_init_priv_params(priv, dev);
-	mwifiex_set_mac_address(priv, dev);
 
 	priv->netdev = dev;
 
-	ret = mwifiex_send_cmd(priv, HostCmd_CMD_SET_BSS_MODE,
-			       HostCmd_ACT_GEN_SET, 0, NULL, true);
-	if (ret)
-		goto err_set_bss_mode;
+	if (!adapter->mfg_mode) {
+		mwifiex_set_mac_address(priv, dev);
 
-	ret = mwifiex_sta_init_cmd(priv, false, false);
-	if (ret)
-		goto err_sta_init;
+		ret = mwifiex_send_cmd(priv, HostCmd_CMD_SET_BSS_MODE,
+				       HostCmd_ACT_GEN_SET, 0, NULL, true);
+		if (ret)
+			goto err_set_bss_mode;
+
+		ret = mwifiex_sta_init_cmd(priv, false, false);
+		if (ret)
+			goto err_sta_init;
+	}
 
 	mwifiex_setup_ht_caps(&wiphy->bands[NL80211_BAND_2GHZ]->ht_cap, priv);
 	if (adapter->is_hw_11ac_capable)
Signature · 1 line
1.9.1
maintainer Reviewed-by on v1 1/1
#1 lore raw

Hi,

Could have used a 'v2' in the subject, but hopefully that doesn't bother Kalle too much.

Quoted 33 lines · Ganapathi Bhat

If driver is loaded with 'mfg_mode' enabled, then the sending commands are not allowed. So, skip sending commands, to firmware in mwifiex_add_virtual_intf if 'mfg_mode' is enabled.

Fixes 7311ea850079 ("mwifiex: fix AP start problem for newly added interface")

---
v2: addressed Brian's comments.

---
 drivers/net/wireless/marvell/mwifiex/cfg80211.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)
drivers/net/wireless/marvell/mwifiex/cfg80211.c +2 -7
index 32c5074..ad1ebd8 100644
@@ -2959,18 +2959,21 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
 	}
 
 	mwifiex_init_priv_params(priv, dev);
-	mwifiex_set_mac_address(priv, dev);
 
 	priv->netdev = dev;
 
-	ret = mwifiex_send_cmd(priv, HostCmd_CMD_SET_BSS_MODE,
-			       HostCmd_ACT_GEN_SET, 0, NULL, true);
-	if (ret)
-		goto err_set_bss_mode;
+	if (!adapter->mfg_mode) {
+		mwifiex_set_mac_address(priv, dev);
 
-	ret = mwifiex_sta_init_cmd(priv, false, false);
-	if (ret)

drivers/net/wireless/marvell/mwifiex/cfg80211.c struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy, · line 2976

Quoted 10 lines
drivers/net/wireless/marvell/mwifiex/cfg80211.c +9 -1
-		goto err_sta_init;
+		ret = mwifiex_send_cmd(priv, HostCmd_CMD_SET_BSS_MODE,
+				       HostCmd_ACT_GEN_SET, 0, NULL, true);
+		if (ret)
+			goto err_set_bss_mode;
+
+		ret = mwifiex_sta_init_cmd(priv, false, false);
+		if (ret)
+			goto err_sta_init;
+	}

Seems better to me.

Quoted 6 lines
drivers/net/wireless/marvell/mwifiex/cfg80211.c +0 -0
 	mwifiex_setup_ht_caps(&wiphy->bands[NL80211_BAND_2GHZ]->ht_cap, priv);
 	if (adapter->is_hw_11ac_capable)
Signature · 1 line
1.9.1
#2 lore raw
Quoted 2 lines · Brian Norris

Could have used a 'v2' in the subject, but hopefully that doesn't bother Kalle too much.

It does create more work for me when sorting patches so please always try include the version in the subject. But no need to resend.

Signature · 1 line
Kalle Valo
#3 lore raw

Hi Kalle,

Quoted 11 lines

-----Original Message-----
From: Kalle Valo [mailto:[email protected]]
Sent: Tuesday, September 12, 2017 11:33 AM
To: Brian Norris
Cc: Ganapathi Bhat; [email protected]; Cathy Luo; Xinming Hu; Zhiyuan Yang; James Cao; Mangesh Malusare
Subject: [EXT] Re: [PATCH] mwifiex: check for mfg_mode in add_virtual_intf

External Email

Quoted 8 lines

----------------------------------------------------------------------

Quoted 2 lines · Brian Norris

Could have used a 'v2' in the subject, but hopefully that doesn't bother Kalle too much.

It does create more work for me when sorting patches so please always try include the version in the subject. But no need to resend.

Sure. I will keep this in mind for future submits.

Quoted 3 lines

--
Kalle Valo

Thanks,
Ganapathi

#4 lore raw
In reply to Ganapathi Bhat
Quoted 7 lines · Ganapathi Bhat

If driver is loaded with 'mfg_mode' enabled, then the sending commands are not allowed. So, skip sending commands, to firmware in mwifiex_add_virtual_intf if 'mfg_mode' is enabled.

Fixes 7311ea850079 ("mwifiex: fix AP start problem for newly added interface")

Patch applied to wireless-drivers-next.git, thanks.

26177d7f3969 mwifiex: check for mfg_mode in add_virtual_intf

Signature · 3 lines
https://patchwork.kernel.org/patch/9942827/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches