]> err.no Git - linux-2.6/commitdiff
mac80211: trigger ieee80211_sta_work after opening interface
authorJan Niehusmann <jan@gondor.com>
Sun, 23 Mar 2008 19:23:56 +0000 (20:23 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 1 Apr 2008 19:44:07 +0000 (15:44 -0400)
ieee80211_sta_work is disabled while network interface
is down. Therefore, if you configure wireless parameters
before bringing the interface up, these configurations are
not yet effective and association fails.

A workaround from userspace is calling a command like
'iwconfig wlan0 ap any' after the interface is brought up.

To fix this behaviour, trigger execution of ieee80211_sta_work from
ieee80211_open when in STA or IBSS mode.

Signed-off-by: Jan Niehusmann <jan@gondor.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/ieee80211.c

index 28bcdf9fc3df426668eea580ea78d6102f3659c1..8e586390a2efd4d17cb12a4bd0cbe46be2ee00ce 100644 (file)
@@ -286,6 +286,18 @@ static int ieee80211_open(struct net_device *dev)
        if (need_hw_reconfig)
                ieee80211_hw_config(local);
 
+       /*
+        * ieee80211_sta_work is disabled while network interface
+        * is down. Therefore, some configuration changes may not
+        * yet be effective. Trigger execution of ieee80211_sta_work
+        * to fix this.
+        */
+       if(sdata->vif.type == IEEE80211_IF_TYPE_STA ||
+          sdata->vif.type == IEEE80211_IF_TYPE_IBSS) {
+               struct ieee80211_if_sta *ifsta = &sdata->u.sta;
+               queue_work(local->hw.workqueue, &ifsta->work);
+       }
+
        netif_start_queue(dev);
 
        return 0;