|
@@ -988,6 +988,11 @@ static void wl1271_recovery_work(struct work_struct *work)
|
|
|
/* Prevent spurious TX during FW restart */
|
|
|
ieee80211_stop_queues(wl->hw);
|
|
|
|
|
|
+ if (wl->sched_scanning) {
|
|
|
+ ieee80211_sched_scan_stopped(wl->hw);
|
|
|
+ wl->sched_scanning = false;
|
|
|
+ }
|
|
|
+
|
|
|
/* reboot the chipset */
|
|
|
__wl1271_op_remove_interface(wl, false);
|
|
|
ieee80211_restart_hw(wl->hw);
|
|
@@ -1576,6 +1581,7 @@ static void __wl1271_op_remove_interface(struct wl1271 *wl,
|
|
|
memset(wl->ap_hlid_map, 0, sizeof(wl->ap_hlid_map));
|
|
|
wl->ap_fw_ps_map = 0;
|
|
|
wl->ap_ps_map = 0;
|
|
|
+ wl->sched_scanning = false;
|
|
|
|
|
|
/*
|
|
|
* this is performed after the cancel_work calls and the associated
|
|
@@ -1778,6 +1784,13 @@ static int wl1271_sta_handle_idle(struct wl1271 *wl, bool idle)
|
|
|
wl->session_counter++;
|
|
|
if (wl->session_counter >= SESSION_COUNTER_MAX)
|
|
|
wl->session_counter = 0;
|
|
|
+
|
|
|
+ /* The current firmware only supports sched_scan in idle */
|
|
|
+ if (wl->sched_scanning) {
|
|
|
+ wl1271_scan_sched_scan_stop(wl);
|
|
|
+ ieee80211_sched_scan_stopped(wl->hw);
|
|
|
+ }
|
|
|
+
|
|
|
ret = wl1271_dummy_join(wl);
|
|
|
if (ret < 0)
|
|
|
goto out;
|
|
@@ -2330,6 +2343,60 @@ out:
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
+static int wl1271_op_sched_scan_start(struct ieee80211_hw *hw,
|
|
|
+ struct ieee80211_vif *vif,
|
|
|
+ struct cfg80211_sched_scan_request *req,
|
|
|
+ struct ieee80211_sched_scan_ies *ies)
|
|
|
+{
|
|
|
+ struct wl1271 *wl = hw->priv;
|
|
|
+ int ret;
|
|
|
+
|
|
|
+ wl1271_debug(DEBUG_MAC80211, "wl1271_op_sched_scan_start");
|
|
|
+
|
|
|
+ mutex_lock(&wl->mutex);
|
|
|
+
|
|
|
+ ret = wl1271_ps_elp_wakeup(wl);
|
|
|
+ if (ret < 0)
|
|
|
+ goto out;
|
|
|
+
|
|
|
+ ret = wl1271_scan_sched_scan_config(wl, req, ies);
|
|
|
+ if (ret < 0)
|
|
|
+ goto out_sleep;
|
|
|
+
|
|
|
+ ret = wl1271_scan_sched_scan_start(wl);
|
|
|
+ if (ret < 0)
|
|
|
+ goto out_sleep;
|
|
|
+
|
|
|
+ wl->sched_scanning = true;
|
|
|
+
|
|
|
+out_sleep:
|
|
|
+ wl1271_ps_elp_sleep(wl);
|
|
|
+out:
|
|
|
+ mutex_unlock(&wl->mutex);
|
|
|
+ return ret;
|
|
|
+}
|
|
|
+
|
|
|
+static void wl1271_op_sched_scan_stop(struct ieee80211_hw *hw,
|
|
|
+ struct ieee80211_vif *vif)
|
|
|
+{
|
|
|
+ struct wl1271 *wl = hw->priv;
|
|
|
+ int ret;
|
|
|
+
|
|
|
+ wl1271_debug(DEBUG_MAC80211, "wl1271_op_sched_scan_stop");
|
|
|
+
|
|
|
+ mutex_lock(&wl->mutex);
|
|
|
+
|
|
|
+ ret = wl1271_ps_elp_wakeup(wl);
|
|
|
+ if (ret < 0)
|
|
|
+ goto out;
|
|
|
+
|
|
|
+ wl1271_scan_sched_scan_stop(wl);
|
|
|
+
|
|
|
+ wl1271_ps_elp_sleep(wl);
|
|
|
+out:
|
|
|
+ mutex_unlock(&wl->mutex);
|
|
|
+}
|
|
|
+
|
|
|
static int wl1271_op_set_frag_threshold(struct ieee80211_hw *hw, u32 value)
|
|
|
{
|
|
|
struct wl1271 *wl = hw->priv;
|
|
@@ -3445,6 +3512,8 @@ static const struct ieee80211_ops wl1271_ops = {
|
|
|
.tx = wl1271_op_tx,
|
|
|
.set_key = wl1271_op_set_key,
|
|
|
.hw_scan = wl1271_op_hw_scan,
|
|
|
+ .sched_scan_start = wl1271_op_sched_scan_start,
|
|
|
+ .sched_scan_stop = wl1271_op_sched_scan_stop,
|
|
|
.bss_info_changed = wl1271_op_bss_info_changed,
|
|
|
.set_frag_threshold = wl1271_op_set_frag_threshold,
|
|
|
.set_rts_threshold = wl1271_op_set_rts_threshold,
|
|
@@ -3765,6 +3834,7 @@ struct ieee80211_hw *wl1271_alloc_hw(void)
|
|
|
wl->ap_fw_ps_map = 0;
|
|
|
wl->quirks = 0;
|
|
|
wl->platform_quirks = 0;
|
|
|
+ wl->sched_scanning = false;
|
|
|
|
|
|
memset(wl->tx_frames_map, 0, sizeof(wl->tx_frames_map));
|
|
|
for (i = 0; i < ACX_TX_DESCRIPTORS; i++)
|