lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191216170302.29543-35-Jerome.Pouiller@silabs.com>
Date:   Mon, 16 Dec 2019 17:03:51 +0000
From:   Jérôme Pouiller <Jerome.Pouiller@...abs.com>
To:     "devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>,
        "linux-wireless@...r.kernel.org" <linux-wireless@...r.kernel.org>
CC:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Kalle Valo <kvalo@...eaurora.org>,
        "David S . Miller" <davem@...emloft.net>,
        Jérôme Pouiller <Jerome.Pouiller@...abs.com>
Subject: [PATCH 34/55] staging: wfx: drop unnecessary wvif->powersave_mode

From: Jérôme Pouiller <jerome.pouiller@...abs.com>

Power save status is already available in bss_conf. So there is no
reason to keep information duplicated in wvif->powersave_mode.

In add, type of wvif->powersave_mode is low level struct made to
communicate with device. We would like to limit usage of this kind of
struct in upper layers of the driver.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@...abs.com>
---
 drivers/staging/wfx/sta.c | 31 +++++++++++++------------------
 drivers/staging/wfx/wfx.h |  1 -
 2 files changed, 13 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index 91fa4d8aa37d..c57135f77572 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -328,12 +328,23 @@ void wfx_configure_filter(struct ieee80211_hw *hw,
 
 static int wfx_update_pm(struct wfx_vif *wvif)
 {
-	struct hif_req_set_pm_mode pm = wvif->powersave_mode;
+	struct ieee80211_conf *conf = &wvif->wdev->hw->conf;
+	struct hif_req_set_pm_mode pm;
 	u16 uapsd_flags;
 
 	if (wvif->state != WFX_STATE_STA || !wvif->bss_params.aid)
 		return 0;
 
+	memset(&pm, 0, sizeof(pm));
+	if (conf->flags & IEEE80211_CONF_PS) {
+		pm.pm_mode.enter_psm = 1;
+		// Firmware does not support more than 128ms
+		pm.fast_psm_idle_period =
+			min(conf->dynamic_ps_timeout * 2, 255);
+		if (pm.fast_psm_idle_period)
+			pm.pm_mode.fast_psm = 1;
+	}
+
 	memcpy(&uapsd_flags, &wvif->uapsd_info, sizeof(uapsd_flags));
 
 	if (uapsd_flags != 0)
@@ -1432,24 +1443,8 @@ int wfx_config(struct ieee80211_hw *hw, u32 changed)
 
 	if (changed & IEEE80211_CONF_CHANGE_PS) {
 		wvif = NULL;
-		while ((wvif = wvif_iterate(wdev, wvif)) != NULL) {
-			memset(&wvif->powersave_mode, 0,
-			       sizeof(wvif->powersave_mode));
-			if (conf->flags & IEEE80211_CONF_PS) {
-				wvif->powersave_mode.pm_mode.enter_psm = 1;
-				if (conf->dynamic_ps_timeout > 0) {
-					wvif->powersave_mode.pm_mode.fast_psm = 1;
-					/*
-					 * Firmware does not support more than
-					 * 128ms
-					 */
-					wvif->powersave_mode.fast_psm_idle_period =
-						min(conf->dynamic_ps_timeout *
-						    2, 255);
-				}
-			}
+		while ((wvif = wvif_iterate(wdev, wvif)) != NULL)
 			wfx_update_pm(wvif);
-		}
 		wvif = wdev_to_wvif(wdev, 0);
 	}
 
diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h
index 781a8c8ba982..c82d29764d66 100644
--- a/drivers/staging/wfx/wfx.h
+++ b/drivers/staging/wfx/wfx.h
@@ -125,7 +125,6 @@ struct wfx_vif {
 
 	struct wfx_scan		scan;
 
-	struct hif_req_set_pm_mode powersave_mode;
 	struct completion	set_pm_mode_complete;
 
 	struct list_head	event_queue;
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ