linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] brcmfmac: remove setting IBSS mode when stopping AP
@ 2017-05-18  9:22 Wright Feng
  2017-05-19  4:49 ` Kalle Valo
  2017-05-22 15:21 ` Kalle Valo
  0 siblings, 2 replies; 5+ messages in thread
From: Wright Feng @ 2017-05-18  9:22 UTC (permalink / raw)
  To: arend.vanspriel, franky.lin, hante.meuleman, kvalo
  Cc: linux-wireless, brcm80211-dev-list.pdl, wright.feng, Chi-hsien Lin

From: Chi-hsien Lin <Chi-Hsien.Lin@cypress.com>

Setting IBSS mode when stopping AP may affect functionality of INFRA
mode on another interface. For instance, if user creates and stops
hostap daemon on virtual interface, then association cannot work on
primary interface because default BSS has been set to IBSS mode in
firmware side. The IBSS mode should be set when cfg80211 changes the
interface.

Reviewed-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Chi-hsien Lin <Chi-Hsien.Lin@cypress.com>
Signed-off-by: Wright Feng <wright.feng@cypress.com>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index 944b83c..ce2a5b6 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -4658,9 +4658,6 @@ static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
 		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 0);
 		if (err < 0)
 			brcmf_err("setting AP mode failed %d\n", err);
-		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_INFRA, 0);
-		if (err < 0)
-			brcmf_err("setting INFRA mode failed %d\n", err);
 		if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS))
 			brcmf_fil_iovar_int_set(ifp, "mbss", 0);
 		brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY,
-- 
2.1.0

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

* Re: [PATCH] brcmfmac: remove setting IBSS mode when stopping AP
  2017-05-18  9:22 [PATCH] brcmfmac: remove setting IBSS mode when stopping AP Wright Feng
@ 2017-05-19  4:49 ` Kalle Valo
  2017-05-19  7:49   ` Arend van Spriel
  2017-05-22 15:21 ` Kalle Valo
  1 sibling, 1 reply; 5+ messages in thread
From: Kalle Valo @ 2017-05-19  4:49 UTC (permalink / raw)
  To: Wright Feng
  Cc: arend.vanspriel, franky.lin, hante.meuleman, linux-wireless,
	brcm80211-dev-list.pdl, Chi-hsien Lin

Wright Feng <wright.feng@cypress.com> writes:

> From: Chi-hsien Lin <Chi-Hsien.Lin@cypress.com>
>
> Setting IBSS mode when stopping AP may affect functionality of INFRA
> mode on another interface. For instance, if user creates and stops
> hostap daemon on virtual interface, then association cannot work on
> primary interface because default BSS has been set to IBSS mode in
> firmware side. The IBSS mode should be set when cfg80211 changes the
> interface.
>
> Reviewed-by: Wright Feng <wright.feng@cypress.com>
> Signed-off-by: Chi-hsien Lin <Chi-Hsien.Lin@cypress.com>
> Signed-off-by: Wright Feng <wright.feng@cypress.com>
> ---
>  drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> index 944b83c..ce2a5b6 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> @@ -4658,9 +4658,6 @@ static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
>  		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 0);
>  		if (err < 0)
>  			brcmf_err("setting AP mode failed %d\n", err);
> -		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_INFRA, 0);
> -		if (err < 0)
> -			brcmf_err("setting INFRA mode failed %d\n", err);

The title talks about setting IBSS mode but the code looks to be about
setting INFRA mode. Is this correct?

-- 
Kalle Valo

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

* Re: [PATCH] brcmfmac: remove setting IBSS mode when stopping AP
  2017-05-19  4:49 ` Kalle Valo
@ 2017-05-19  7:49   ` Arend van Spriel
  2017-05-19  7:54     ` Kalle Valo
  0 siblings, 1 reply; 5+ messages in thread
From: Arend van Spriel @ 2017-05-19  7:49 UTC (permalink / raw)
  To: Kalle Valo, Wright Feng
  Cc: franky.lin, hante.meuleman, linux-wireless,
	brcm80211-dev-list.pdl, Chi-hsien Lin

On 5/19/2017 6:49 AM, Kalle Valo wrote:
> Wright Feng <wright.feng@cypress.com> writes:
> 
>> From: Chi-hsien Lin <Chi-Hsien.Lin@cypress.com>
>>
>> Setting IBSS mode when stopping AP may affect functionality of INFRA
>> mode on another interface. For instance, if user creates and stops
>> hostap daemon on virtual interface, then association cannot work on
>> primary interface because default BSS has been set to IBSS mode in
>> firmware side. The IBSS mode should be set when cfg80211 changes the
>> interface.
>>
>> Reviewed-by: Wright Feng <wright.feng@cypress.com>
>> Signed-off-by: Chi-hsien Lin <Chi-Hsien.Lin@cypress.com>
>> Signed-off-by: Wright Feng <wright.feng@cypress.com>
>> ---
>>   drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 3 ---
>>   1 file changed, 3 deletions(-)
>>
>> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
>> index 944b83c..ce2a5b6 100644
>> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
>> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
>> @@ -4658,9 +4658,6 @@ static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
>>   		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 0);
>>   		if (err < 0)
>>   			brcmf_err("setting AP mode failed %d\n", err);
>> -		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_INFRA, 0);
>> -		if (err < 0)
>> -			brcmf_err("setting INFRA mode failed %d\n", err);
> 
> The title talks about setting IBSS mode but the code looks to be about
> setting INFRA mode. Is this correct?

Both are correct :-p Have to admit this is confusing. The command 
SET_INFRA with zero value means "disable INFRA; thus enable IBSS".

I would rephrase the commit message indeed explaining what the code 
currently does, ie.:

Upon stopping an AP interface the driver disable INFRA mode effectively 
setting the interface in IBSS mode. However, this may affect other 
interfaces running in INFRA mode. For instance, ....

Regards,
Arend

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

* Re: [PATCH] brcmfmac: remove setting IBSS mode when stopping AP
  2017-05-19  7:49   ` Arend van Spriel
@ 2017-05-19  7:54     ` Kalle Valo
  0 siblings, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2017-05-19  7:54 UTC (permalink / raw)
  To: Arend van Spriel
  Cc: Wright Feng, franky.lin, hante.meuleman, linux-wireless,
	brcm80211-dev-list.pdl, Chi-hsien Lin

Arend van Spriel <arend.vanspriel@broadcom.com> writes:

> On 5/19/2017 6:49 AM, Kalle Valo wrote:
>> Wright Feng <wright.feng@cypress.com> writes:
>>
>>> From: Chi-hsien Lin <Chi-Hsien.Lin@cypress.com>
>>>
>>> Setting IBSS mode when stopping AP may affect functionality of INFRA
>>> mode on another interface. For instance, if user creates and stops
>>> hostap daemon on virtual interface, then association cannot work on
>>> primary interface because default BSS has been set to IBSS mode in
>>> firmware side. The IBSS mode should be set when cfg80211 changes the
>>> interface.
>>>
>>> Reviewed-by: Wright Feng <wright.feng@cypress.com>
>>> Signed-off-by: Chi-hsien Lin <Chi-Hsien.Lin@cypress.com>
>>> Signed-off-by: Wright Feng <wright.feng@cypress.com>
>>> ---
>>>   drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 3 ---
>>>   1 file changed, 3 deletions(-)
>>>
>>> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
>>> index 944b83c..ce2a5b6 100644
>>> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
>>> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
>>> @@ -4658,9 +4658,6 @@ static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
>>>   		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 0);
>>>   		if (err < 0)
>>>   			brcmf_err("setting AP mode failed %d\n", err);
>>> -		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_INFRA, 0);
>>> -		if (err < 0)
>>> -			brcmf_err("setting INFRA mode failed %d\n", err);
>>
>> The title talks about setting IBSS mode but the code looks to be about
>> setting INFRA mode. Is this correct?
>
> Both are correct :-p Have to admit this is confusing. The command
> SET_INFRA with zero value means "disable INFRA; thus enable IBSS".

Ah, that IS confusing :)

> I would rephrase the commit message indeed explaining what the code
> currently does, ie.:
>
> Upon stopping an AP interface the driver disable INFRA mode
> effectively setting the interface in IBSS mode. However, this may
> affect other interfaces running in INFRA mode. For instance, ....

I can fix that during commit. Thanks.

-- 
Kalle Valo

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

* Re: brcmfmac: remove setting IBSS mode when stopping AP
  2017-05-18  9:22 [PATCH] brcmfmac: remove setting IBSS mode when stopping AP Wright Feng
  2017-05-19  4:49 ` Kalle Valo
@ 2017-05-22 15:21 ` Kalle Valo
  1 sibling, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2017-05-22 15:21 UTC (permalink / raw)
  To: Wright Feng
  Cc: arend.vanspriel, franky.lin, hante.meuleman, linux-wireless,
	brcm80211-dev-list.pdl, wright.feng, Chi-hsien Lin

Wright Feng <wright.feng@cypress.com> wrote:
> From: Chi-hsien Lin <Chi-Hsien.Lin@cypress.com>
> 
> Upon stopping an AP interface the driver disable INFRA mode effectively 
> setting the interface in IBSS mode. However, this may affect other 
> interfaces running in INFRA mode. For instance, if user creates and stops
> hostap daemon on virtual interface, then association cannot work on
> primary interface because default BSS has been set to IBSS mode in
> firmware side. The IBSS mode should be set when cfg80211 changes the
> interface.
> 
> Reviewed-by: Wright Feng <wright.feng@cypress.com>
> Signed-off-by: Chi-hsien Lin <Chi-Hsien.Lin@cypress.com>
> [kvalo@codeaurora.org: rephased commit log based on discussion]
> Signed-off-by: Wright Feng <wright.feng@cypress.com>

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

9029679f66d9 brcmfmac: remove setting IBSS mode when stopping AP

-- 
https://patchwork.kernel.org/patch/9733205/

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

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

end of thread, other threads:[~2017-05-22 15:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-18  9:22 [PATCH] brcmfmac: remove setting IBSS mode when stopping AP Wright Feng
2017-05-19  4:49 ` Kalle Valo
2017-05-19  7:49   ` Arend van Spriel
2017-05-19  7:54     ` Kalle Valo
2017-05-22 15:21 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).