staging: wfx: firmware already handle powersave mode during scan
authorJérôme Pouiller <jerome.pouiller@silabs.com>
Tue, 17 Dec 2019 16:15:09 +0000 (16:15 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Dec 2019 14:56:12 +0000 (15:56 +0100)
When user try to launch scan while connected, it is necessary to notify
the AP that we cannot receive data (using power save mode).

Firmware already handles this automatically so the code in the driver is
redundant and can be dropped.

By edge effect, hack of scan status in wfx_set_pm() is now useless.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20191217161318.31402-31-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wfx/scan.c
drivers/staging/wfx/sta.c

index cb7a1fd..4b95e6a 100644 (file)
@@ -141,22 +141,11 @@ void wfx_scan_work(struct work_struct *work)
                .scan_req.scan_type.type = 0,    /* Foreground */
        };
        struct ieee80211_channel *first;
-       bool first_run = (wvif->scan.begin == wvif->scan.curr &&
-                         wvif->scan.begin != wvif->scan.end);
        int i;
 
        down(&wvif->scan.lock);
        mutex_lock(&wvif->wdev->conf_mutex);
 
-       if (first_run) {
-               if (wvif->state == WFX_STATE_STA &&
-                   !(wvif->powersave_mode.pm_mode.enter_psm)) {
-                       struct hif_req_set_pm_mode pm = wvif->powersave_mode;
-
-                       pm.pm_mode.enter_psm = 1;
-                       wfx_set_pm(wvif, &pm);
-               }
-       }
 
        if (!wvif->scan.req || wvif->scan.curr == wvif->scan.end) {
                if (wvif->scan.output_power != wvif->wdev->output_power)
@@ -177,9 +166,6 @@ void wfx_scan_work(struct work_struct *work)
                __ieee80211_scan_completed_compat(wvif->wdev->hw,
                                                  wvif->scan.status ? 1 : 0);
                up(&wvif->scan.lock);
-               if (wvif->state == WFX_STATE_STA &&
-                   !(wvif->powersave_mode.pm_mode.enter_psm))
-                       wfx_set_pm(wvif, &wvif->powersave_mode);
                return;
        }
        first = *wvif->scan.curr;
index 62e6549..fb45aa6 100644 (file)
@@ -375,7 +375,6 @@ int wfx_set_pm(struct wfx_vif *wvif, const struct hif_req_set_pm_mode *arg)
 {
        struct hif_req_set_pm_mode pm = *arg;
        u16 uapsd_flags;
-       int ret;
 
        if (wvif->state != WFX_STATE_STA || !wvif->bss_params.aid)
                return 0;
@@ -396,11 +395,7 @@ int wfx_set_pm(struct wfx_vif *wvif, const struct hif_req_set_pm_mode *arg)
                                         msecs_to_jiffies(300)))
                dev_warn(wvif->wdev->dev,
                         "timeout while waiting of set_pm_mode_complete\n");
-       ret = hif_set_pm(wvif, &pm);
-       // FIXME: why ?
-       if (-ETIMEDOUT == wvif->scan.status)
-               wvif->scan.status = 1;
-       return ret;
+       return hif_set_pm(wvif, &pm);
 }
 
 int wfx_set_rts_threshold(struct ieee80211_hw *hw, u32 value)