diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2006-06-20 11:19:40 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2006-06-20 11:19:40 -0400 |
commit | d636b2798732f2cfba48d94aa19b7ba206268a83 (patch) | |
tree | 40dc52126ab5a1570a000321d93ca4bb03312684 /net/ieee80211/softmac/ieee80211softmac_event.c | |
parent | 9f5aa2a921797ce6eb4542c7517915bd1d5fbd0b (diff) | |
parent | 25f42b6af09e34c3f92107b36b5aa6edc2fdba2f (diff) |
Merge branch 'master'
Diffstat (limited to 'net/ieee80211/softmac/ieee80211softmac_event.c')
-rw-r--r-- | net/ieee80211/softmac/ieee80211softmac_event.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/net/ieee80211/softmac/ieee80211softmac_event.c b/net/ieee80211/softmac/ieee80211softmac_event.c index 8cc8f3f0f8e7..f34fa2ef666b 100644 --- a/net/ieee80211/softmac/ieee80211softmac_event.c +++ b/net/ieee80211/softmac/ieee80211softmac_event.c | |||
@@ -38,7 +38,8 @@ | |||
38 | * The event context is private and can only be used from | 38 | * The event context is private and can only be used from |
39 | * within this module. Its meaning varies with the event | 39 | * within this module. Its meaning varies with the event |
40 | * type: | 40 | * type: |
41 | * SCAN_FINISHED: no special meaning | 41 | * SCAN_FINISHED, |
42 | * DISASSOCIATED: NULL | ||
42 | * ASSOCIATED, | 43 | * ASSOCIATED, |
43 | * ASSOCIATE_FAILED, | 44 | * ASSOCIATE_FAILED, |
44 | * ASSOCIATE_TIMEOUT, | 45 | * ASSOCIATE_TIMEOUT, |
@@ -59,15 +60,15 @@ | |||
59 | */ | 60 | */ |
60 | 61 | ||
61 | static char *event_descriptions[IEEE80211SOFTMAC_EVENT_LAST+1] = { | 62 | static char *event_descriptions[IEEE80211SOFTMAC_EVENT_LAST+1] = { |
62 | "scan finished", | 63 | NULL, /* scan finished */ |
63 | "associated", | 64 | NULL, /* associated */ |
64 | "associating failed", | 65 | "associating failed", |
65 | "associating timed out", | 66 | "associating timed out", |
66 | "authenticated", | 67 | "authenticated", |
67 | "authenticating failed", | 68 | "authenticating failed", |
68 | "authenticating timed out", | 69 | "authenticating timed out", |
69 | "associating failed because no suitable network was found", | 70 | "associating failed because no suitable network was found", |
70 | "disassociated", | 71 | NULL, /* disassociated */ |
71 | }; | 72 | }; |
72 | 73 | ||
73 | 74 | ||
@@ -77,7 +78,7 @@ ieee80211softmac_notify_callback(void *d) | |||
77 | struct ieee80211softmac_event event = *(struct ieee80211softmac_event*) d; | 78 | struct ieee80211softmac_event event = *(struct ieee80211softmac_event*) d; |
78 | kfree(d); | 79 | kfree(d); |
79 | 80 | ||
80 | event.fun(event.mac->dev, event.context); | 81 | event.fun(event.mac->dev, event.event_type, event.context); |
81 | } | 82 | } |
82 | 83 | ||
83 | int | 84 | int |
@@ -136,30 +137,24 @@ ieee80211softmac_call_events_locked(struct ieee80211softmac_device *mac, int eve | |||
136 | int we_event; | 137 | int we_event; |
137 | char *msg = NULL; | 138 | char *msg = NULL; |
138 | 139 | ||
140 | memset(&wrqu, '\0', sizeof (union iwreq_data)); | ||
141 | |||
139 | switch(event) { | 142 | switch(event) { |
140 | case IEEE80211SOFTMAC_EVENT_ASSOCIATED: | 143 | case IEEE80211SOFTMAC_EVENT_ASSOCIATED: |
141 | network = (struct ieee80211softmac_network *)event_ctx; | 144 | 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 | memcpy(wrqu.ap_addr.sa_data, &network->bssid[0], ETH_ALEN); |
145 | wrqu.ap_addr.sa_family = ARPHRD_ETHER; | 146 | /* fall through */ |
146 | we_event = SIOCGIWAP; | ||
147 | break; | ||
148 | case IEEE80211SOFTMAC_EVENT_DISASSOCIATED: | 147 | 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; | 148 | wrqu.ap_addr.sa_family = ARPHRD_ETHER; |
153 | we_event = SIOCGIWAP; | 149 | we_event = SIOCGIWAP; |
154 | break; | 150 | break; |
155 | case IEEE80211SOFTMAC_EVENT_SCAN_FINISHED: | 151 | case IEEE80211SOFTMAC_EVENT_SCAN_FINISHED: |
156 | wrqu.data.length = 0; | ||
157 | wrqu.data.flags = 0; | ||
158 | memset(&wrqu, '\0', sizeof (union iwreq_data)); | ||
159 | we_event = SIOCGIWSCAN; | 152 | we_event = SIOCGIWSCAN; |
160 | break; | 153 | break; |
161 | default: | 154 | default: |
162 | msg = event_descriptions[event]; | 155 | msg = event_descriptions[event]; |
156 | if (!msg) | ||
157 | msg = "SOFTMAC EVENT BUG"; | ||
163 | wrqu.data.length = strlen(msg); | 158 | wrqu.data.length = strlen(msg); |
164 | we_event = IWEVCUSTOM; | 159 | we_event = IWEVCUSTOM; |
165 | break; | 160 | break; |
@@ -172,6 +167,9 @@ ieee80211softmac_call_events_locked(struct ieee80211softmac_device *mac, int eve | |||
172 | if ((eventptr->event_type == event || eventptr->event_type == -1) | 167 | if ((eventptr->event_type == event || eventptr->event_type == -1) |
173 | && (eventptr->event_context == NULL || eventptr->event_context == event_ctx)) { | 168 | && (eventptr->event_context == NULL || eventptr->event_context == event_ctx)) { |
174 | list_del(&eventptr->list); | 169 | list_del(&eventptr->list); |
170 | /* User may have subscribed to ANY event, so | ||
171 | * we tell them which event triggered it. */ | ||
172 | eventptr->event_type = event; | ||
175 | schedule_work(&eventptr->work); | 173 | schedule_work(&eventptr->work); |
176 | } | 174 | } |
177 | } | 175 | } |