linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Williams <dcbw@redhat.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org,
	Matthieu Mauger <matthieux.mauger@intel.com>,
	Johannes Berg <johannes.berg@intel.com>
Subject: Re: [PATCH] cfg80211: properly send NL80211_ATTR_DISCONNECTED_BY_AP in disconnect
Date: Fri, 22 May 2015 10:02:11 -0500	[thread overview]
Message-ID: <1432306931.24980.8.camel@redhat.com> (raw)
In-Reply-To: <1432304759-31767-1-git-send-email-johannes@sipsolutions.net>

On Fri, 2015-05-22 at 16:25 +0200, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> When we disconnect from the AP, drivers call cfg80211_disconnect().
> This doesn't know whether the disconnection was initiated locally
> or by the AP though, which can cause problems with the supplicant,
> for example with WPS. This issue obviously doesn't show up with any
> mac80211 based driver since mac80211 doesn't call this function.
> 
> Fix this by requiring drivers to indicate whether the disconnect is
> locally generated or not. I've tried to update the drivers, but may
> not have gotten the values correct, and some drivers may currently
> not be able to report correct values. In case of doubt I left it at
> false, which is the current behaviour.
> 
> Reported-by: Matthieu Mauger <matthieux.mauger@intel.com>
> Tested-by: Matthieu Mauger <matthieux.mauger@intel.com>
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
>  drivers/net/wireless/ath/ath6kl/cfg80211.c         | 4 ++--
>  drivers/net/wireless/ath/wil6210/main.c            | 2 +-
>  drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c | 4 ++--
>  drivers/net/wireless/libertas/cfg.c                | 4 ++--
>  drivers/net/wireless/mwifiex/join.c                | 2 +-
>  drivers/net/wireless/mwifiex/sta_event.c           | 2 +-
>  drivers/net/wireless/rndis_wlan.c                  | 2 +-
>  drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c  | 2 +-
>  drivers/staging/wlan-ng/cfg80211.c                 | 2 +-
>  include/net/cfg80211.h                             | 4 +++-
>  net/wireless/core.h                                | 1 +
>  net/wireless/sme.c                                 | 4 +++-
>  net/wireless/util.c                                | 3 ++-
>  13 files changed, 21 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c
> index 1a4d558022d8..9e3e3176670b 100644
> --- a/drivers/net/wireless/libertas/cfg.c
> +++ b/drivers/net/wireless/libertas/cfg.c
> @@ -841,7 +841,7 @@ void lbs_send_disconnect_notification(struct lbs_private *priv)
>  
>  	cfg80211_disconnected(priv->dev,
>  		0,
> -		NULL, 0,
> +		NULL, 0, false,
>  		GFP_KERNEL);

lbs_send_disconnect_notification() could use a 'bool locally_generated'
parameter that gets passed directly to cfg80211_disconnected(), which in
turn gets passed through from a new 'bool locally_generated' parameter
for lbs_mac_event_disconnected() (which is the only caller of
lbs_send_disconnect_notification).

The calls to lbs_mac_event_disconnected() would pass these values:

lbs_leave_ibss(): true
lbs_process_event(): MACREG_INT_CODE_DEAUTHENTICATED: false
lbs_process_event(): MACREG_INT_CODE_DISASSOCIATED: false
lbs_process_event(): MACREG_INT_CODE_LINK_LOST_NO_SCAN: true
 
>  	lbs_deb_leave(LBS_DEB_CFG80211);
> @@ -1458,7 +1458,7 @@ int lbs_disconnect(struct lbs_private *priv, u16 reason)
>  
>  	cfg80211_disconnected(priv->dev,
>  			reason,
> -			NULL, 0,
> +			NULL, 0, true,
>  			GFP_KERNEL);
>  	priv->connect_status = LBS_DISCONNECTED;

This one is correct.

Dan



      reply	other threads:[~2015-05-22 15:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-22 14:25 [PATCH] cfg80211: properly send NL80211_ATTR_DISCONNECTED_BY_AP in disconnect Johannes Berg
2015-05-22 15:02 ` Dan Williams [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1432306931.24980.8.camel@redhat.com \
    --to=dcbw@redhat.com \
    --cc=johannes.berg@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=matthieux.mauger@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).