Skip to content

Commit

Permalink
wlcore: call ieee80211_sched_scan_stopped on interface removal
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eliad Peller authored and Luciano Coelho committed Nov 28, 2012
1 parent 6b70e7e commit 1019975
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
1 change: 0 additions & 1 deletion drivers/net/wireless/ti/wlcore/debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/ti/wlcore/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
16 changes: 7 additions & 9 deletions drivers/net/wireless/ti/wlcore/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ti/wlcore/wlcore.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1019975

Please sign in to comment.