diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2006-04-12 20:42:42 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2006-04-19 17:25:39 -0400 |
commit | feeeaa87e8e6702f57ed3be7904ffd87cc044b82 (patch) | |
tree | 658f8410a8a1777aecbf3bef8e3e8f7a7f677e69 /net/ieee80211 | |
parent | 68970ce6ac5ed01b1d10047fd4daba5b40786694 (diff) |
[PATCH] softmac: fix event sending
Softmac is sending custom events to userspace already, but it
should _really_ be sending the right WEXT events instead. This
patch fixes that.
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/ieee80211')
-rw-r--r-- | net/ieee80211/softmac/ieee80211softmac_assoc.c | 2 | ||||
-rw-r--r-- | net/ieee80211/softmac/ieee80211softmac_event.c | 34 |
2 files changed, 31 insertions, 5 deletions
diff --git a/net/ieee80211/softmac/ieee80211softmac_assoc.c b/net/ieee80211/softmac/ieee80211softmac_assoc.c index cb9fca86c26..4498023841d 100644 --- a/net/ieee80211/softmac/ieee80211softmac_assoc.c +++ b/net/ieee80211/softmac/ieee80211softmac_assoc.c | |||
@@ -101,6 +101,7 @@ ieee80211softmac_disassoc(struct ieee80211softmac_device *mac, u16 reason) | |||
101 | /* Do NOT clear bssvalid as that will break ieee80211softmac_assoc_work! */ | 101 | /* Do NOT clear bssvalid as that will break ieee80211softmac_assoc_work! */ |
102 | mac->associated = 0; | 102 | mac->associated = 0; |
103 | mac->associnfo.associating = 0; | 103 | mac->associnfo.associating = 0; |
104 | ieee80211softmac_call_events_locked(mac, IEEE80211SOFTMAC_EVENT_DISASSOCIATED, NULL); | ||
104 | spin_unlock_irqrestore(&mac->lock, flags); | 105 | spin_unlock_irqrestore(&mac->lock, flags); |
105 | } | 106 | } |
106 | 107 | ||
@@ -373,6 +374,7 @@ ieee80211softmac_handle_disassoc(struct net_device * dev, | |||
373 | spin_lock_irqsave(&mac->lock, flags); | 374 | spin_lock_irqsave(&mac->lock, flags); |
374 | mac->associnfo.bssvalid = 0; | 375 | mac->associnfo.bssvalid = 0; |
375 | mac->associated = 0; | 376 | mac->associated = 0; |
377 | ieee80211softmac_call_events_locked(mac, IEEE80211SOFTMAC_EVENT_DISASSOCIATED, NULL); | ||
376 | schedule_work(&mac->associnfo.work); | 378 | schedule_work(&mac->associnfo.work); |
377 | spin_unlock_irqrestore(&mac->lock, flags); | 379 | spin_unlock_irqrestore(&mac->lock, flags); |
378 | 380 | ||
diff --git a/net/ieee80211/softmac/ieee80211softmac_event.c b/net/ieee80211/softmac/ieee80211softmac_event.c index 0a52bbda1e4..5bdd5edd432 100644 --- a/net/ieee80211/softmac/ieee80211softmac_event.c +++ b/net/ieee80211/softmac/ieee80211softmac_event.c | |||
@@ -67,6 +67,7 @@ static char *event_descriptions[IEEE80211SOFTMAC_EVENT_LAST+1] = { | |||
67 | "authenticating failed", | 67 | "authenticating failed", |
68 | "authenticating timed out", | 68 | "authenticating timed out", |
69 | "associating failed because no suitable network was found", | 69 | "associating failed because no suitable network was found", |
70 | "disassociated", | ||
70 | }; | 71 | }; |
71 | 72 | ||
72 | 73 | ||
@@ -128,13 +129,36 @@ void | |||
128 | ieee80211softmac_call_events_locked(struct ieee80211softmac_device *mac, int event, void *event_ctx) | 129 | ieee80211softmac_call_events_locked(struct ieee80211softmac_device *mac, int event, void *event_ctx) |
129 | { | 130 | { |
130 | struct ieee80211softmac_event *eventptr, *tmp; | 131 | struct ieee80211softmac_event *eventptr, *tmp; |
131 | union iwreq_data wrqu; | 132 | struct ieee80211softmac_network *network; |
132 | char *msg; | ||
133 | 133 | ||
134 | if (event >= 0) { | 134 | if (event >= 0) { |
135 | msg = event_descriptions[event]; | 135 | union iwreq_data wrqu; |
136 | wrqu.data.length = strlen(msg); | 136 | int we_event; |
137 | wireless_send_event(mac->dev, IWEVCUSTOM, &wrqu, msg); | 137 | char *msg = NULL; |
138 | |||
139 | switch(event) { | ||
140 | case IEEE80211SOFTMAC_EVENT_ASSOCIATED: | ||
141 | network = (struct ieee80211softmac_network *)event_ctx; | ||
142 | wrqu.data.length = 0; | ||
143 | wrqu.data.flags = 0; | ||
144 | memcpy(wrqu.ap_addr.sa_data, &network->bssid[0], ETH_ALEN); | ||
145 | wrqu.ap_addr.sa_family = ARPHRD_ETHER; | ||
146 | we_event = SIOCGIWAP; | ||
147 | break; | ||
148 | case IEEE80211SOFTMAC_EVENT_DISASSOCIATED: | ||
149 | wrqu.data.length = 0; | ||
150 | wrqu.data.flags = 0; | ||
151 | memset(&wrqu, '\0', sizeof (union iwreq_data)); | ||
152 | wrqu.ap_addr.sa_family = ARPHRD_ETHER; | ||
153 | we_event = SIOCGIWAP; | ||
154 | break; | ||
155 | default: | ||
156 | msg = event_descriptions[event]; | ||
157 | wrqu.data.length = strlen(msg); | ||
158 | we_event = IWEVCUSTOM; | ||
159 | break; | ||
160 | } | ||
161 | wireless_send_event(mac->dev, we_event, &wrqu, msg); | ||
138 | } | 162 | } |
139 | 163 | ||
140 | if (!list_empty(&mac->events)) | 164 | if (!list_empty(&mac->events)) |