linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: print reason code for deauth/dissoc frames
@ 2008-10-28  7:58 Zhu Yi
  2008-10-28 10:06 ` Johannes Berg
  2008-10-28 11:31 ` Tomas Winkler
  0 siblings, 2 replies; 5+ messages in thread
From: Zhu Yi @ 2008-10-28  7:58 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Zhu Yi

The patch prints reason code for deauth/dissoc frames to give users
more ideas what's happened for the disconnection.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
---
 net/mac80211/mlme.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index d5006b2..0752e09 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1134,7 +1134,8 @@ static void ieee80211_rx_mgmt_deauth(struct ieee80211_sub_if_data *sdata,
 	reason_code = le16_to_cpu(mgmt->u.deauth.reason_code);
 
 	if (ifsta->flags & IEEE80211_STA_AUTHENTICATED)
-		printk(KERN_DEBUG "%s: deauthenticated\n", sdata->dev->name);
+		printk(KERN_DEBUG "%s: deauthenticated (Reason: %u)\n",
+				sdata->dev->name, reason_code);
 
 	if (ifsta->state == IEEE80211_STA_MLME_AUTHENTICATE ||
 	    ifsta->state == IEEE80211_STA_MLME_ASSOCIATE ||
@@ -1166,7 +1167,8 @@ static void ieee80211_rx_mgmt_disassoc(struct ieee80211_sub_if_data *sdata,
 	reason_code = le16_to_cpu(mgmt->u.disassoc.reason_code);
 
 	if (ifsta->flags & IEEE80211_STA_ASSOCIATED)
-		printk(KERN_DEBUG "%s: disassociated\n", sdata->dev->name);
+		printk(KERN_DEBUG "%s: disassociated (Reason: %u)\n",
+				sdata->dev->name, reason_code);
 
 	if (ifsta->state == IEEE80211_STA_MLME_ASSOCIATED) {
 		ifsta->state = IEEE80211_STA_MLME_ASSOCIATE;
-- 
1.5.3.6


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

* Re: [PATCH] mac80211: print reason code for deauth/dissoc frames
  2008-10-28  7:58 [PATCH] mac80211: print reason code for deauth/dissoc frames Zhu Yi
@ 2008-10-28 10:06 ` Johannes Berg
  2008-10-28 11:31 ` Tomas Winkler
  1 sibling, 0 replies; 5+ messages in thread
From: Johannes Berg @ 2008-10-28 10:06 UTC (permalink / raw)
  To: Zhu Yi; +Cc: linville, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 1565 bytes --]

On Tue, 2008-10-28 at 15:58 +0800, Zhu Yi wrote:
> The patch prints reason code for deauth/dissoc frames to give users
> more ideas what's happened for the disconnection.

Indeed, that seems useful.

> Signed-off-by: Zhu Yi <yi.zhu@intel.com>

Acked-by: Johannes Berg <johannes@sipsolutions.net>

> ---
>  net/mac80211/mlme.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
> index d5006b2..0752e09 100644
> --- a/net/mac80211/mlme.c
> +++ b/net/mac80211/mlme.c
> @@ -1134,7 +1134,8 @@ static void ieee80211_rx_mgmt_deauth(struct ieee80211_sub_if_data *sdata,
>  	reason_code = le16_to_cpu(mgmt->u.deauth.reason_code);
>  
>  	if (ifsta->flags & IEEE80211_STA_AUTHENTICATED)
> -		printk(KERN_DEBUG "%s: deauthenticated\n", sdata->dev->name);
> +		printk(KERN_DEBUG "%s: deauthenticated (Reason: %u)\n",
> +				sdata->dev->name, reason_code);
>  
>  	if (ifsta->state == IEEE80211_STA_MLME_AUTHENTICATE ||
>  	    ifsta->state == IEEE80211_STA_MLME_ASSOCIATE ||
> @@ -1166,7 +1167,8 @@ static void ieee80211_rx_mgmt_disassoc(struct ieee80211_sub_if_data *sdata,
>  	reason_code = le16_to_cpu(mgmt->u.disassoc.reason_code);
>  
>  	if (ifsta->flags & IEEE80211_STA_ASSOCIATED)
> -		printk(KERN_DEBUG "%s: disassociated\n", sdata->dev->name);
> +		printk(KERN_DEBUG "%s: disassociated (Reason: %u)\n",
> +				sdata->dev->name, reason_code);
>  
>  	if (ifsta->state == IEEE80211_STA_MLME_ASSOCIATED) {
>  		ifsta->state = IEEE80211_STA_MLME_ASSOCIATE;

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] mac80211: print reason code for deauth/dissoc frames
  2008-10-28  7:58 [PATCH] mac80211: print reason code for deauth/dissoc frames Zhu Yi
  2008-10-28 10:06 ` Johannes Berg
@ 2008-10-28 11:31 ` Tomas Winkler
  2008-10-28 12:00   ` Jouni Malinen
  1 sibling, 1 reply; 5+ messages in thread
From: Tomas Winkler @ 2008-10-28 11:31 UTC (permalink / raw)
  To: Zhu Yi, Johannes Berg; +Cc: linville, linux-wireless

On Tue, Oct 28, 2008 at 9:58 AM, Zhu Yi <yi.zhu@intel.com> wrote:
> The patch prints reason code for deauth/dissoc frames to give users
> more ideas what's happened for the disconnection.

Do anyone has idea how to push it to the user space?
We already use ieee80211_sta_send_apinfo (SIOCGIWAP) for notification.
Can be reason code attached without breaking user space?  The
iwreq_data it self has enough space to add this and this can be queued
at the end.

struct {
 sockaddr ap_addr; /** 0 address means association failed (Xeros
address dilemma)
 __u16 reason_code /** IEEE reason code */
 __u16 status_code /** IEEE reason code */
__u32 internal_reason /* mac80211/driver crashed/it's raining/too etc */
};


Thanks
Tomas


>
> Signed-off-by: Zhu Yi <yi.zhu@intel.com>
> ---
>  net/mac80211/mlme.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
> index d5006b2..0752e09 100644
> --- a/net/mac80211/mlme.c
> +++ b/net/mac80211/mlme.c
> @@ -1134,7 +1134,8 @@ static void ieee80211_rx_mgmt_deauth(struct ieee80211_sub_if_data *sdata,
>        reason_code = le16_to_cpu(mgmt->u.deauth.reason_code);
>
>        if (ifsta->flags & IEEE80211_STA_AUTHENTICATED)
> -               printk(KERN_DEBUG "%s: deauthenticated\n", sdata->dev->name);
> +               printk(KERN_DEBUG "%s: deauthenticated (Reason: %u)\n",
> +                               sdata->dev->name, reason_code);
>
>        if (ifsta->state == IEEE80211_STA_MLME_AUTHENTICATE ||
>            ifsta->state == IEEE80211_STA_MLME_ASSOCIATE ||
> @@ -1166,7 +1167,8 @@ static void ieee80211_rx_mgmt_disassoc(struct ieee80211_sub_if_data *sdata,
>        reason_code = le16_to_cpu(mgmt->u.disassoc.reason_code);
>
>        if (ifsta->flags & IEEE80211_STA_ASSOCIATED)
> -               printk(KERN_DEBUG "%s: disassociated\n", sdata->dev->name);
> +               printk(KERN_DEBUG "%s: disassociated (Reason: %u)\n",
> +                               sdata->dev->name, reason_code);
>
>        if (ifsta->state == IEEE80211_STA_MLME_ASSOCIATED) {
>                ifsta->state = IEEE80211_STA_MLME_ASSOCIATE;
> --
> 1.5.3.6
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

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

* Re: [PATCH] mac80211: print reason code for deauth/dissoc frames
  2008-10-28 11:31 ` Tomas Winkler
@ 2008-10-28 12:00   ` Jouni Malinen
  2008-10-28 12:07     ` Tomas Winkler
  0 siblings, 1 reply; 5+ messages in thread
From: Jouni Malinen @ 2008-10-28 12:00 UTC (permalink / raw)
  To: Tomas Winkler; +Cc: Zhu Yi, Johannes Berg, linville, linux-wireless

On Tue, Oct 28, 2008 at 01:31:13PM +0200, Tomas Winkler wrote:

> Do anyone has idea how to push it to the user space?
> We already use ieee80211_sta_send_apinfo (SIOCGIWAP) for notification.
> Can be reason code attached without breaking user space?  The
> iwreq_data it self has enough space to add this and this can be queued
> at the end.

Taken into account how broken WEXT events are already on 64/32-bit
systems, it would probably be better to add this as a new nl80211 event
which we will hopefully get in the near future. I'm looking for that to
fix the association info reporting, too (and issue that I fixed with
WEXT, but the fix was reverted due to userspace interop issues..).

-- 
Jouni Malinen                                            PGP id EFC895FA

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

* Re: [PATCH] mac80211: print reason code for deauth/dissoc frames
  2008-10-28 12:00   ` Jouni Malinen
@ 2008-10-28 12:07     ` Tomas Winkler
  0 siblings, 0 replies; 5+ messages in thread
From: Tomas Winkler @ 2008-10-28 12:07 UTC (permalink / raw)
  To: Jouni Malinen; +Cc: Zhu Yi, Johannes Berg, linville, linux-wireless

On Tue, Oct 28, 2008 at 2:00 PM, Jouni Malinen <j@w1.fi> wrote:
> On Tue, Oct 28, 2008 at 01:31:13PM +0200, Tomas Winkler wrote:
>
>> Do anyone has idea how to push it to the user space?
>> We already use ieee80211_sta_send_apinfo (SIOCGIWAP) for notification.
>> Can be reason code attached without breaking user space?  The
>> iwreq_data it self has enough space to add this and this can be queued
>> at the end.
>
> Taken into account how broken WEXT events are already on 64/32-bit
> systems, it would probably be better to add this as a new nl80211 event
> which we will hopefully get in the near future. I'm looking for that to
> fix the association info reporting, too (and issue that I fixed with
> WEXT, but the fix was reverted due to userspace interop issues..).

Okay, thanks for the info. will look into nl direction.
Tomas

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

end of thread, other threads:[~2008-10-28 18:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-28  7:58 [PATCH] mac80211: print reason code for deauth/dissoc frames Zhu Yi
2008-10-28 10:06 ` Johannes Berg
2008-10-28 11:31 ` Tomas Winkler
2008-10-28 12:00   ` Jouni Malinen
2008-10-28 12:07     ` Tomas Winkler

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).