aboutsummaryrefslogtreecommitdiffstats
path: root/net/ieee80211/softmac/ieee80211softmac_event.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-06-19 18:50:43 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-19 18:50:43 -0700
commit2090af718014f3d434fb8b85b00eeea01ebcec19 (patch)
tree97eb6e655a3c2d90c212de79b563fa35837a341f /net/ieee80211/softmac/ieee80211softmac_event.c
parentAdd support for suspending and resuming the whole console subsystem (diff)
parentMerge branch 'master' into upstream (diff)
downloadlinux-dev-2090af718014f3d434fb8b85b00eeea01ebcec19.tar.xz
linux-dev-2090af718014f3d434fb8b85b00eeea01ebcec19.zip
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6: (166 commits) [PATCH] net: au1000_eth: PHY framework conversion [PATCH] 3c5zz ethernet: fix section warnings [PATCH] smc ethernet: fix section mismatch warnings [PATCH] hp ethernet: fix section mismatches [PATCH] Section mismatch in drivers/net/ne.o during modpost [PATCH] e1000: prevent statistics from getting garbled during reset [PATCH] smc911x Kconfig fix [PATCH] forcedeth: new device ids [PATCH] forcedeth config: version [PATCH] forcedeth config: module parameters [PATCH] forcedeth config: diagnostics [PATCH] forcedeth config: move functions [PATCH] forcedeth config: statistics [PATCH] forcedeth config: csum [PATCH] forcedeth config: wol [PATCH] forcedeth config: phy [PATCH] forcedeth config: flow control [PATCH] forcedeth config: ring sizes [PATCH] forcedeth config: tso cleanup [DOC] Update bonding documentation with sysfs info ...
Diffstat (limited to 'net/ieee80211/softmac/ieee80211softmac_event.c')
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_event.c30
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 @@
* The event context is private and can only be used from
* within this module. Its meaning varies with the event
* type:
- * SCAN_FINISHED: no special meaning
+ * SCAN_FINISHED,
+ * DISASSOCIATED: NULL
* ASSOCIATED,
* ASSOCIATE_FAILED,
* ASSOCIATE_TIMEOUT,
@@ -59,15 +60,15 @@
*/
static char *event_descriptions[IEEE80211SOFTMAC_EVENT_LAST+1] = {
- "scan finished",
- "associated",
+ NULL, /* scan finished */
+ NULL, /* associated */
"associating failed",
"associating timed out",
"authenticated",
"authenticating failed",
"authenticating timed out",
"associating failed because no suitable network was found",
- "disassociated",
+ NULL, /* disassociated */
};
@@ -77,7 +78,7 @@ ieee80211softmac_notify_callback(void *d)
struct ieee80211softmac_event event = *(struct ieee80211softmac_event*) d;
kfree(d);
- event.fun(event.mac->dev, event.context);
+ event.fun(event.mac->dev, event.event_type, event.context);
}
int
@@ -136,30 +137,24 @@ ieee80211softmac_call_events_locked(struct ieee80211softmac_device *mac, int eve
int we_event;
char *msg = NULL;
+ memset(&wrqu, '\0', sizeof (union iwreq_data));
+
switch(event) {
case IEEE80211SOFTMAC_EVENT_ASSOCIATED:
network = (struct ieee80211softmac_network *)event_ctx;
- wrqu.data.length = 0;
- wrqu.data.flags = 0;
memcpy(wrqu.ap_addr.sa_data, &network->bssid[0], ETH_ALEN);
- wrqu.ap_addr.sa_family = ARPHRD_ETHER;
- we_event = SIOCGIWAP;
- break;
+ /* fall through */
case IEEE80211SOFTMAC_EVENT_DISASSOCIATED:
- wrqu.data.length = 0;
- wrqu.data.flags = 0;
- memset(&wrqu, '\0', sizeof (union iwreq_data));
wrqu.ap_addr.sa_family = ARPHRD_ETHER;
we_event = SIOCGIWAP;
break;
case IEEE80211SOFTMAC_EVENT_SCAN_FINISHED:
- wrqu.data.length = 0;
- wrqu.data.flags = 0;
- memset(&wrqu, '\0', sizeof (union iwreq_data));
we_event = SIOCGIWSCAN;
break;
default:
msg = event_descriptions[event];
+ if (!msg)
+ msg = "SOFTMAC EVENT BUG";
wrqu.data.length = strlen(msg);
we_event = IWEVCUSTOM;
break;
@@ -172,6 +167,9 @@ ieee80211softmac_call_events_locked(struct ieee80211softmac_device *mac, int eve
if ((eventptr->event_type == event || eventptr->event_type == -1)
&& (eventptr->event_context == NULL || eventptr->event_context == event_ctx)) {
list_del(&eventptr->list);
+ /* User may have subscribed to ANY event, so
+ * we tell them which event triggered it. */
+ eventptr->event_type = event;
schedule_work(&eventptr->work);
}
}