]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ieee80211/softmac/ieee80211softmac_event.c
the scheduled bcm43xx removal
[linux-2.6-omap-h63xx.git] / net / ieee80211 / softmac / ieee80211softmac_event.c
index f34fa2ef666b5fa56247f060bae06a2d94f7f06e..8cef05b60f16403dc9f3c9b3cfca1436683edf1c 100644 (file)
@@ -73,11 +73,13 @@ static char *event_descriptions[IEEE80211SOFTMAC_EVENT_LAST+1] = {
 
 
 static void
-ieee80211softmac_notify_callback(void *d)
+ieee80211softmac_notify_callback(struct work_struct *work)
 {
-       struct ieee80211softmac_event event = *(struct ieee80211softmac_event*) d;
-       kfree(d);
-       
+       struct ieee80211softmac_event *pevent =
+               container_of(work, struct ieee80211softmac_event, work.work);
+       struct ieee80211softmac_event event = *pevent;
+       kfree(pevent);
+
        event.fun(event.mac->dev, event.event_type, event.context);
 }
 
@@ -90,16 +92,16 @@ ieee80211softmac_notify_internal(struct ieee80211softmac_device *mac,
 
        if (event < -1 || event > IEEE80211SOFTMAC_EVENT_LAST)
                return -ENOSYS;
-       
+
        if (!fun)
                return -EINVAL;
-       
+
        eventptr = kmalloc(sizeof(struct ieee80211softmac_event), gfp_mask);
        if (!eventptr)
                return -ENOMEM;
-       
+
        eventptr->event_type = event;
-       INIT_WORK(&eventptr->work, ieee80211softmac_notify_callback, eventptr);
+       INIT_DELAYED_WORK(&eventptr->work, ieee80211softmac_notify_callback);
        eventptr->fun = fun;
        eventptr->context = context;
        eventptr->mac = mac;
@@ -120,7 +122,7 @@ ieee80211softmac_notify_gfp(struct net_device *dev,
 
        if (event < 0 || event > IEEE80211SOFTMAC_EVENT_LAST)
                return -ENOSYS;
-       
+
        return ieee80211softmac_notify_internal(mac, event, NULL, fun, context, gfp_mask);
 }
 EXPORT_SYMBOL_GPL(ieee80211softmac_notify_gfp);
@@ -131,7 +133,7 @@ ieee80211softmac_call_events_locked(struct ieee80211softmac_device *mac, int eve
 {
        struct ieee80211softmac_event *eventptr, *tmp;
        struct ieee80211softmac_network *network;
-       
+
        if (event >= 0) {
                union iwreq_data wrqu;
                int we_event;
@@ -170,7 +172,7 @@ ieee80211softmac_call_events_locked(struct ieee80211softmac_device *mac, int eve
                                /* User may have subscribed to ANY event, so
                                 * we tell them which event triggered it. */
                                eventptr->event_type = event;
-                               schedule_work(&eventptr->work);
+                               queue_delayed_work(mac->wq, &eventptr->work, 0);
                        }
                }
 }