staging: wfx: always enable FastPs in combo with new firmwares
authorJérôme Pouiller <jerome.pouiller@silabs.com>
Wed, 1 Jul 2020 15:07:07 +0000 (17:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Jul 2020 08:33:08 +0000 (10:33 +0200)
When multiple interface on different channels are in use. It is
necessary to advertise the AP that the device is no more awake before to
switch to the other channel.

Until now, PS-Poll was the preferred mechanism for that. However.  The
new firmwares (>= 3.7) now nicely support FastPS.

FastPS improves bandwidth and compatibility with AP.

This patch drop the complex and rarely used mechanism introduced in the
commit dd5eba1bb5b4f ("staging: wfx: fix support for AP that do not
support PS-Poll") and use FastPS as soon as it is possible.

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

index e3ebd91..cc7c0cf 100644 (file)
@@ -149,7 +149,6 @@ static int hif_event_indication(struct wfx_dev *wdev,
        struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface);
        const struct hif_ind_event *body = buf;
        int type = le32_to_cpu(body->event_id);
-       int cause;
 
        if (!wvif) {
                dev_warn(wdev->dev, "received event for non-existent vif\n");
@@ -168,13 +167,8 @@ static int hif_event_indication(struct wfx_dev *wdev,
                dev_dbg(wdev->dev, "ignore BSSREGAINED indication\n");
                break;
        case HIF_EVENT_IND_PS_MODE_ERROR:
-               cause = le32_to_cpu(body->event_data.ps_mode_error);
                dev_warn(wdev->dev, "error while processing power save request: %d\n",
-                        cause);
-               if (cause == HIF_PS_ERROR_AP_NOT_RESP_TO_POLL) {
-                       wvif->bss_not_support_ps_poll = true;
-                       schedule_work(&wvif->update_pm_work);
-               }
+                        le32_to_cpu(body->event_data.ps_mode_error));
                break;
        default:
                dev_warn(wdev->dev, "unhandled event indication: %.2x\n",
index fdf4f48..4e30ab1 100644 (file)
@@ -219,10 +219,10 @@ static int wfx_get_ps_timeout(struct wfx_vif *wvif, bool *enable_ps)
                        *enable_ps = true;
                if (wvif->wdev->force_ps_timeout > -1)
                        return wvif->wdev->force_ps_timeout;
-               else if (wvif->bss_not_support_ps_poll)
-                       return 30;
-               else
+               else if (wfx_api_older_than(wvif->wdev, 3, 2))
                        return 0;
+               else
+                       return 30;
        }
        if (enable_ps)
                *enable_ps = wvif->vif->bss_conf.ps;
@@ -255,14 +255,6 @@ int wfx_update_pm(struct wfx_vif *wvif)
        return hif_set_pm(wvif, ps, ps_timeout);
 }
 
-static void wfx_update_pm_work(struct work_struct *work)
-{
-       struct wfx_vif *wvif = container_of(work, struct wfx_vif,
-                                           update_pm_work);
-
-       wfx_update_pm(wvif);
-}
-
 int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
                   u16 queue, const struct ieee80211_tx_queue_params *params)
 {
@@ -372,7 +364,6 @@ void wfx_reset(struct wfx_vif *wvif)
                hif_set_block_ack_policy(wvif, 0xFF, 0xFF);
        wfx_tx_unlock(wdev);
        wvif->join_in_progress = false;
-       wvif->bss_not_support_ps_poll = false;
        cancel_delayed_work_sync(&wvif->beacon_loss_work);
        wvif =  NULL;
        while ((wvif = wvif_iterate(wdev, wvif)) != NULL)
@@ -790,7 +781,6 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
 
        init_completion(&wvif->set_pm_mode_complete);
        complete(&wvif->set_pm_mode_complete);
-       INIT_WORK(&wvif->update_pm_work, wfx_update_pm_work);
        INIT_WORK(&wvif->tx_policy_upload_work, wfx_tx_policy_upload_work);
 
        mutex_init(&wvif->scan_lock);
index 477c08f..38e24d7 100644 (file)
@@ -93,8 +93,6 @@ struct wfx_vif {
        bool                    scan_abort;
        struct ieee80211_scan_request *scan_req;
 
-       bool                    bss_not_support_ps_poll;
-       struct work_struct      update_pm_work;
        struct completion       set_pm_mode_complete;
 };