]> Pileus Git - ~andy/linux/commitdiff
wlcore: call ieee80211_sched_scan_stopped on interface removal
authorEliad Peller <eliad@wizery.com>
Thu, 22 Nov 2012 16:06:23 +0000 (18:06 +0200)
committerLuciano Coelho <coelho@ti.com>
Wed, 28 Nov 2012 09:41:44 +0000 (11:41 +0200)
The interface might go down before we got the SCHED_STOPPED
event, so make sure to call ieee80211_sched_scan_stopped()
if the scanned interface is removed.

Replace sched_scanning with sched_vif in order to save
the scanned interface.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
drivers/net/wireless/ti/wlcore/debugfs.c
drivers/net/wireless/ti/wlcore/event.c
drivers/net/wireless/ti/wlcore/main.c
drivers/net/wireless/ti/wlcore/wlcore.h

index 80376d461144dcea6d8aaf49843a94d990b9200e..1cf2cdbae2928095b321bb38d70916d591cb80ca 100644 (file)
@@ -490,7 +490,6 @@ static ssize_t driver_state_read(struct file *file, char __user *user_buf,
        DRIVER_STATE_PRINT_HEX(chip.id);
        DRIVER_STATE_PRINT_STR(chip.fw_ver_str);
        DRIVER_STATE_PRINT_STR(chip.phy_fw_ver_str);
-       DRIVER_STATE_PRINT_INT(sched_scanning);
 
 #undef DRIVER_STATE_PRINT_INT
 #undef DRIVER_STATE_PRINT_LONG
index 3c20393d255eae86f82ab787ea1b28cb5740fbee..cb32c021a9f62173a08d7dca2ba30d1cfda40813 100644 (file)
@@ -109,9 +109,9 @@ void wlcore_event_sched_scan_completed(struct wl1271 *wl,
        wl1271_debug(DEBUG_EVENT, "PERIODIC_SCAN_COMPLETE_EVENT (status 0x%0x)",
                     status);
 
-       if (wl->sched_scanning) {
+       if (wl->sched_vif) {
                ieee80211_sched_scan_stopped(wl->hw);
-               wl->sched_scanning = false;
+               wl->sched_vif = NULL;
        }
 }
 EXPORT_SYMBOL_GPL(wlcore_event_sched_scan_completed);
index 015d769ae9f7c6129f26320e6a7428be57d50ad9..cce73c417deca208093f96d4cc0d9450c0971a22 100644 (file)
@@ -923,11 +923,6 @@ static void wl1271_recovery_work(struct work_struct *work)
        /* Prevent spurious TX during FW restart */
        wlcore_stop_queues(wl, WLCORE_QUEUE_STOP_REASON_FW_RESTART);
 
-       if (wl->sched_scanning) {
-               ieee80211_sched_scan_stopped(wl->hw);
-               wl->sched_scanning = false;
-       }
-
        /* reboot the chipset */
        while (!list_empty(&wl->wlvif_list)) {
                wlvif = list_first_entry(&wl->wlvif_list,
@@ -1871,7 +1866,6 @@ static void wlcore_op_stop_locked(struct wl1271 *wl)
        wl->time_offset = 0;
        wl->ap_fw_ps_map = 0;
        wl->ap_ps_map = 0;
-       wl->sched_scanning = false;
        wl->sleep_auth = WL1271_PSM_ILLEGAL;
        memset(wl->roles_map, 0, sizeof(wl->roles_map));
        memset(wl->links_map, 0, sizeof(wl->links_map));
@@ -2405,6 +2399,11 @@ static void __wl1271_op_remove_interface(struct wl1271 *wl,
                ieee80211_scan_completed(wl->hw, true);
        }
 
+       if (wl->sched_vif == wlvif) {
+               ieee80211_sched_scan_stopped(wl->hw);
+               wl->sched_vif = NULL;
+       }
+
        if (!test_bit(WL1271_FLAG_RECOVERY_IN_PROGRESS, &wl->flags)) {
                /* disable active roles */
                ret = wl1271_ps_elp_wakeup(wl);
@@ -3439,7 +3438,7 @@ static int wl1271_op_sched_scan_start(struct ieee80211_hw *hw,
        if (ret < 0)
                goto out_sleep;
 
-       wl->sched_scanning = true;
+       wl->sched_vif = wlvif;
 
 out_sleep:
        wl1271_ps_elp_sleep(wl);
@@ -3928,7 +3927,7 @@ static int wlcore_set_bssid(struct wl1271 *wl, struct wl12xx_vif *wlvif,
                                                wlvif->band);
 
        /* we only support sched_scan while not connected */
-       if (wl->sched_scanning)
+       if (wl->sched_vif == wlvif)
                wl->ops->sched_scan_stop(wl, wlvif);
 
        ret = wl1271_acx_sta_rate_policies(wl, wlvif);
@@ -5638,7 +5637,6 @@ struct ieee80211_hw *wlcore_alloc_hw(size_t priv_size, u32 aggr_buf_size,
        wl->ap_fw_ps_map = 0;
        wl->quirks = 0;
        wl->platform_quirks = 0;
-       wl->sched_scanning = false;
        wl->system_hlid = WL12XX_SYSTEM_HLID;
        wl->active_sta_count = 0;
        wl->fwlog_size = 0;
index d3818ef1bc980675967b99f6360d770083d2106c..b31589792dfda74af8f3ed938b3f888053906db2 100644 (file)
@@ -307,7 +307,7 @@ struct wl1271 {
        struct ieee80211_vif *roc_vif;
        struct delayed_work roc_complete_work;
 
-       bool sched_scanning;
+       struct wl12xx_vif *sched_vif;
 
        /* The current band */
        enum ieee80211_band band;