diff mbox

[1/3] brcmfmac: set wpa_auth to WPA_AUTH_DISABLED in AP/opensecurity mode

Message ID 1501577287-28904-1-git-send-email-wright.feng@cypress.com (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show

Commit Message

Wright Feng Aug. 1, 2017, 8:48 a.m. UTC
When setting wpa_auth to WPA_AUTH_NONE(1) in AP mode with WEP secuirty,
firmware will set privacy bit and add WPA OUI in VENDOR IE in beacon and
probe response. It confuses the supplicant in sation client by the
security type from softAP beacon and we will see [WPA-?] in scan result.
So we set WPA_AUTH_DISABLED in softAP mode with opensecurity.

Signed-off-by: Wright Feng <wright.feng@cypress.com>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Arend van Spriel Aug. 1, 2017, 12:41 p.m. UTC | #1
On 01-08-17 10:48, Wright Feng wrote:
> When setting wpa_auth to WPA_AUTH_NONE(1) in AP mode with WEP secuirty,
> firmware will set privacy bit and add WPA OUI in VENDOR IE in beacon and
> probe response. It confuses the supplicant in sation client by the
> security type from softAP beacon and we will see [WPA-?] in scan result.
> So we set WPA_AUTH_DISABLED in softAP mode with opensecurity.
> 
> Signed-off-by: Wright Feng <wright.feng@cypress.com>
> ---
>  drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> index a31ea10..54588d2 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> @@ -3854,6 +3854,7 @@ static s32 brcmf_cfg80211_suspend(struct wiphy *wiphy,
>  static s32 brcmf_configure_opensecurity(struct brcmf_if *ifp)
>  {
>  	s32 err;
> +	s32 wpa_val;
>  
>  	/* set auth */
>  	err = brcmf_fil_bsscfg_int_set(ifp, "auth", 0);
> @@ -3868,7 +3869,11 @@ static s32 brcmf_configure_opensecurity(struct brcmf_if *ifp)
>  		return err;
>  	}
>  	/* set upper-layer auth */
> -	err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", WPA_AUTH_NONE);
> +	if (brcmf_is_ibssmode(ifp->vif))
> +		wpa_val = WPA_AUTH_NONE;
> +	else
> +		wpa_val = WPA_AUTH_DISABLED;
> +	err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", wpa_val);

Is WPA_AUTH_NONE ok for IBSS mode? Not sure why it is handled
differently. Is it because you do not want to change things for IBSS
mode as you did not try that?

Regards,
Arend
Wright Feng Aug. 2, 2017, 2:56 a.m. UTC | #2
On 2017/8/1 下午 08:41, Arend van Spriel wrote:
> On 01-08-17 10:48, Wright Feng wrote:
>> When setting wpa_auth to WPA_AUTH_NONE(1) in AP mode with WEP secuirty,
>> firmware will set privacy bit and add WPA OUI in VENDOR IE in beacon and
>> probe response. It confuses the supplicant in sation client by the
>> security type from softAP beacon and we will see [WPA-?] in scan result.
>> So we set WPA_AUTH_DISABLED in softAP mode with opensecurity.
>>
>> Signed-off-by: Wright Feng <wright.feng@cypress.com>
>> ---
>>   drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 7 ++++++-
>>   1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
>> index a31ea10..54588d2 100644
>> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
>> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
>> @@ -3854,6 +3854,7 @@ static s32 brcmf_cfg80211_suspend(struct wiphy *wiphy,
>>   static s32 brcmf_configure_opensecurity(struct brcmf_if *ifp)
>>   {
>>   	s32 err;
>> +	s32 wpa_val;
>>   
>>   	/* set auth */
>>   	err = brcmf_fil_bsscfg_int_set(ifp, "auth", 0);
>> @@ -3868,7 +3869,11 @@ static s32 brcmf_configure_opensecurity(struct brcmf_if *ifp)
>>   		return err;
>>   	}
>>   	/* set upper-layer auth */
>> -	err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", WPA_AUTH_NONE);
>> +	if (brcmf_is_ibssmode(ifp->vif))
>> +		wpa_val = WPA_AUTH_NONE;
>> +	else
>> +		wpa_val = WPA_AUTH_DISABLED;
>> +	err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", wpa_val);
> 
> Is WPA_AUTH_NONE ok for IBSS mode? Not sure why it is handled
> differently. Is it because you do not want to change things for IBSS
> mode as you did not try that?

I would like to keep WPA_AUTH_NODE for IBSS mode because the comment of 
WPA_AUTH_NONE definition in brcmu_wifi.h is "none (IBSS)". It seems that 
WPA_AUTH_NONE is for IBSS mode.
> 
> Regards,
> Arend
>
Kalle Valo Aug. 2, 2017, 9:30 a.m. UTC | #3
Wright Feng <wright.feng@cypress.com> writes:

> When setting wpa_auth to WPA_AUTH_NONE(1) in AP mode with WEP secuirty,
> firmware will set privacy bit and add WPA OUI in VENDOR IE in beacon and
> probe response.

typo: "secuirty"

> It confuses the supplicant in sation client by the security type from
> softAP beacon and we will see [WPA-?] in scan result. 

"sation"? Also the sentence is a bit unclear.

> So we set WPA_AUTH_DISABLED in softAP mode with opensecurity.

Space missing between "open" and "security".
diff mbox

Patch

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index a31ea10..54588d2 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -3854,6 +3854,7 @@  static s32 brcmf_cfg80211_suspend(struct wiphy *wiphy,
 static s32 brcmf_configure_opensecurity(struct brcmf_if *ifp)
 {
 	s32 err;
+	s32 wpa_val;
 
 	/* set auth */
 	err = brcmf_fil_bsscfg_int_set(ifp, "auth", 0);
@@ -3868,7 +3869,11 @@  static s32 brcmf_configure_opensecurity(struct brcmf_if *ifp)
 		return err;
 	}
 	/* set upper-layer auth */
-	err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", WPA_AUTH_NONE);
+	if (brcmf_is_ibssmode(ifp->vif))
+		wpa_val = WPA_AUTH_NONE;
+	else
+		wpa_val = WPA_AUTH_DISABLED;
+	err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", wpa_val);
 	if (err < 0) {
 		brcmf_err("wpa_auth error %d\n", err);
 		return err;