Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH v2] brcmfmac: shut down AP and set IBSS mode only on primary interface
@ 2016-08-11  5:44 Wright Feng
  2016-08-19 15:53 ` Rafał Miłecki
  0 siblings, 1 reply; 4+ messages in thread
From: Wright Feng @ 2016-08-11  5:44 UTC (permalink / raw)
  To: brcm80211-dev-list.pdl, arend.vanspriel, kvalo, franky.lin,
	hante.meuleman, pieterpg, linux-wireless, chln
  Cc: Wright Feng

When stopping hostap on virtual interface, driver will set INFRA and AP
mode that may affect the functionality on primary interface. For example,
if we create and stop hostapd on virtual interface then association
cannot work on primary interface because INFRA mode has been set to IBSS.
Hence we shut down AP and set IBSS mode only on primary interface.

Signed-off-by: Wright Feng <wright.feng@cypress.com>
---
V2:Remove the footnote from the mail.
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index 2628d5e..0687ab9 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -4716,6 +4716,8 @@ exit:
 
 static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
 {
+	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
+	struct net_device *primary_ndev = cfg_to_ndev(cfg);
 	struct brcmf_if *ifp = netdev_priv(ndev);
 	s32 err;
 	struct brcmf_fil_bss_enable_le bss_enable;
@@ -4723,7 +4725,8 @@ static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
 
 	brcmf_dbg(TRACE, "Enter\n");
 
-	if (ifp->vif->wdev.iftype == NL80211_IFTYPE_AP) {
+	if ((ifp->vif->wdev.iftype == NL80211_IFTYPE_AP) &&
+	    (ndev == primary_ndev)) {
 		/* Due to most likely deauths outstanding we sleep */
 		/* first to make sure they get processed by fw. */
 		msleep(400);
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-08-23 11:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-11  5:44 [PATCH v2] brcmfmac: shut down AP and set IBSS mode only on primary interface Wright Feng
2016-08-19 15:53 ` Rafał Miłecki
2016-08-22  3:40   ` Wright Feng
2016-08-23 11:44     ` Rafał Miłecki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox