ipv4: flush route cache after change accept_local
[linux-2.6.git] / net / mac80211 / work.c
index f0c74a1..7737f20 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "ieee80211_i.h"
 #include "rate.h"
+#include "driver-ops.h"
 
 #define IEEE80211_AUTH_TIMEOUT (HZ / 5)
 #define IEEE80211_AUTH_MAX_TRIES 3
@@ -427,6 +428,14 @@ ieee80211_direct_probe(struct ieee80211_work *wk)
        struct ieee80211_sub_if_data *sdata = wk->sdata;
        struct ieee80211_local *local = sdata->local;
 
+       if (!wk->probe_auth.synced) {
+               int ret = drv_tx_sync(local, sdata, wk->filter_ta,
+                                     IEEE80211_TX_SYNC_AUTH);
+               if (ret)
+                       return WORK_ACT_TIMEOUT;
+       }
+       wk->probe_auth.synced = true;
+
        wk->probe_auth.tries++;
        if (wk->probe_auth.tries > IEEE80211_AUTH_MAX_TRIES) {
                printk(KERN_DEBUG "%s: direct probe to %pM timed out\n",
@@ -466,6 +475,14 @@ ieee80211_authenticate(struct ieee80211_work *wk)
        struct ieee80211_sub_if_data *sdata = wk->sdata;
        struct ieee80211_local *local = sdata->local;
 
+       if (!wk->probe_auth.synced) {
+               int ret = drv_tx_sync(local, sdata, wk->filter_ta,
+                                     IEEE80211_TX_SYNC_AUTH);
+               if (ret)
+                       return WORK_ACT_TIMEOUT;
+       }
+       wk->probe_auth.synced = true;
+
        wk->probe_auth.tries++;
        if (wk->probe_auth.tries > IEEE80211_AUTH_MAX_TRIES) {
                printk(KERN_DEBUG "%s: authentication with %pM"
@@ -499,6 +516,14 @@ ieee80211_associate(struct ieee80211_work *wk)
        struct ieee80211_sub_if_data *sdata = wk->sdata;
        struct ieee80211_local *local = sdata->local;
 
+       if (!wk->assoc.synced) {
+               int ret = drv_tx_sync(local, sdata, wk->filter_ta,
+                                     IEEE80211_TX_SYNC_ASSOC);
+               if (ret)
+                       return WORK_ACT_TIMEOUT;
+       }
+       wk->assoc.synced = true;
+
        wk->assoc.tries++;
        if (wk->assoc.tries > IEEE80211_ASSOC_MAX_TRIES) {
                printk(KERN_DEBUG "%s: association with %pM"
@@ -554,7 +579,7 @@ ieee80211_offchannel_tx(struct ieee80211_work *wk)
                /*
                 * After this, offchan_tx.frame remains but now is no
                 * longer a valid pointer -- we still need it as the
-                * cookie for canceling this work.
+                * cookie for canceling this work/status matching.
                 */
                ieee80211_tx_skb(wk->sdata, wk->offchan_tx.frame);
 
@@ -1061,14 +1086,13 @@ static void ieee80211_work_work(struct work_struct *work)
                        continue;
                if (wk->chan != local->tmp_channel)
                        continue;
-               if (ieee80211_work_ct_coexists(wk->chan_type,
-                                              local->tmp_channel_type))
+               if (!ieee80211_work_ct_coexists(wk->chan_type,
+                                               local->tmp_channel_type))
                        continue;
                remain_off_channel = true;
        }
 
        if (!remain_off_channel && local->tmp_channel) {
-               bool on_oper_chan = ieee80211_cfg_on_oper_channel(local);
                local->tmp_channel = NULL;
                /* If tmp_channel wasn't operating channel, then
                 * we need to go back on-channel.
@@ -1078,7 +1102,7 @@ static void ieee80211_work_work(struct work_struct *work)
                 * we still need to do a hardware config.  Currently,
                 * we cannot be here while scanning, however.
                 */
-               if (ieee80211_cfg_on_oper_channel(local) && !on_oper_chan)
+               if (!ieee80211_cfg_on_oper_channel(local))
                        ieee80211_hw_config(local, 0);
 
                /* At the least, we need to disable offchannel_ps,