lkml.org 
[lkml]   [2020]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 13/13] staging: wfx: always enable FastPs in combo with new firmwares
Date
From: Jérôme Pouiller <jerome.pouiller@silabs.com>

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>
---
drivers/staging/wfx/hif_rx.c | 8 +-------
drivers/staging/wfx/sta.c | 16 +++-------------
drivers/staging/wfx/wfx.h | 2 --
3 files changed, 4 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c
index e3ebd910fabfd..cc7c0cf226ba1 100644
--- a/drivers/staging/wfx/hif_rx.c
+++ b/drivers/staging/wfx/hif_rx.c
@@ -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",
diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index fdf4f48ddc2ce..4e30ab17a93d4 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -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);
diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h
index 477c08fc713fa..38e24d7f72f24 100644
--- a/drivers/staging/wfx/wfx.h
+++ b/drivers/staging/wfx/wfx.h
@@ -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;
};

--
2.27.0
\
 
 \ /
  Last update: 2020-07-01 17:10    [W:1.164 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site