2016-08-11 06:08:58

by Wright Feng

[permalink] [raw]
Subject: [PATCH v2] brcmfmac: shut down AP and set IBSS mode only on primary interface

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 <[email protected]>
---
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



2016-08-22 03:55:29

by Wright Feng

[permalink] [raw]
Subject: RE: [PATCH v2] brcmfmac: shut down AP and set IBSS mode only on primary interface

DQoNCg0KRnJvbTogUmFmYcWCIE1pxYJlY2tpIFttYWlsdG86emFqZWM1QGdtYWlsLmN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ZmFjZS4NCkRyaXZlciBzaG91bGQganVz
dCBleGNsdWRlIGZyb20gc2V0dGluZyBJTkZSQSBtb2RlIHdoZW4gc3RvcHBpbmcgQVAgd2l0aCB2
aXJ0dWFsIGludGVyZmFjZSwgYW5kIEknbGwgdXBkYXRlIHRoaXMgY2hhbmdlIGluIFBBVENIIHYz
Lg0KVGhhbmtzIGZvciB5b3VyIHJldmlldy4NCj4NCj4gLS0NCj4gUmFmYcWCDQoNClJlZ2FyZHMs
DQpXcmlnaHQNCg0KVGhpcyBtZXNzYWdlIGFuZCBhbnkgYXR0YWNobWVudHMgbWF5IGNvbnRhaW4g
Q3lwcmVzcyAob3IgaXRzIHN1YnNpZGlhcmllcykgY29uZmlkZW50aWFsIGluZm9ybWF0aW9uLiBJ
ZiBpdCBoYXMgYmVlbiByZWNlaXZlZCBpbiBlcnJvciwgcGxlYXNlIGFkdmlzZSB0aGUgc2VuZGVy
IGFuZCBpbW1lZGlhdGVseSBkZWxldGUgdGhpcyBtZXNzYWdlLg0K

2016-08-23 11:45:00

by Rafał Miłecki

[permalink] [raw]
Subject: Re: [PATCH v2] brcmfmac: shut down AP and set IBSS mode only on primary interface

On 22 August 2016 at 05:40, Wright Feng <[email protected]> wrote:
> This message and any attachments may contain Cypress (or its subsidiaries=
) confidential information. If it has been received in error, please advise=
the sender and immediately delete this message.

You are aware you're writing to few open mailing lists, aren't you? I
don't think such footer makes any/much sense, please avoid it.

--=20
Rafa=C5=82

2016-08-19 15:53:54

by Rafał Miłecki

[permalink] [raw]
Subject: Re: [PATCH v2] brcmfmac: shut down AP and set IBSS mode only on primary interface

On 11 August 2016 at 07:44, Wright Feng <[email protected]> wrote:
> 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.

You also excluded from execution code setting BRCMF_C_SET_AP to 0.
Does it get a reset at some point? Maybe with a "bss" call? I'm
wondering if it's possible to use interface in managed mode if it was
used as AP once.

--=20
Rafa=C5=82