Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1303079 > unrolled thread
| Started by | Andreas Kemnade <andreas@kemnade.info> |
|---|---|
| First post | 2016-01-06 22:10 +0100 |
| Last post | 2016-01-06 22:10 +0100 |
| Articles | 5 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH 0/6] wireless:libertas: ieee80211 powersave mode Andreas Kemnade <andreas@kemnade.info> - 2016-01-06 22:10 +0100
[PATCH 3/6] wireless:libertas: add an cfg80211 interface for powersaving Andreas Kemnade <andreas@kemnade.info> - 2016-01-06 22:10 +0100
[PATCH 5/6] wireless:libertas: go back to ps mode without commands pending Andreas Kemnade <andreas@kemnade.info> - 2016-01-06 22:10 +0100
[PATCH 6/6] wireless:libertas: fix suspend problems Andreas Kemnade <andreas@kemnade.info> - 2016-01-06 22:10 +0100
[PATCH 4/6] wireless:libertas: do not confirm sleep if commands are pending Andreas Kemnade <andreas@kemnade.info> - 2016-01-06 22:10 +0100
| From | Andreas Kemnade <andreas@kemnade.info> |
|---|---|
| Date | 2016-01-06 22:10 +0100 |
| Subject | [PATCH 0/6] wireless:libertas: ieee80211 powersave mode |
| Message-ID | <qO3vc-6u0-7@gated-at.bofh.it> |
This series makes IEEE 80211 powersave mode work again so that power usage is dramatically reduced when the device is connected. It does not include other power saving methods which are working when the device is not connected (like enabling deep sleep modus) Tested on GTA04 which includes a W2CBW003 chip (Marvel 8686) with sdio interface [PATCH 1/6] wireless:libertas: do not strip header for PS_MODE [PATCH 2/6] wireless:libertas: check whether bus can do more than [PATCH 3/6] wireless:libertas: add an cfg80211 interface for [PATCH 4/6] wireless:libertas: do not confirm sleep if commands are [PATCH 5/6] wireless:libertas: go back to ps mode without commands [PATCH 6/6] wireless:libertas: fix suspend problems -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Andreas Kemnade <andreas@kemnade.info> |
|---|---|
| Date | 2016-01-06 22:10 +0100 |
| Subject | [PATCH 3/6] wireless:libertas: add an cfg80211 interface for powersaving |
| Message-ID | <qO3vd-6u0-23@gated-at.bofh.it> |
| In reply to | #1303079 |
This patch adds an interface for handling commands like
iwconfig wlanX power on/off. Such an interface formerly existed
when the driver used wext.
While performance with sdio in polling mode without using
powersave mode is quite bad, powersaving mode is unusable,
so do not enable it under such conditions.
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
---
drivers/net/wireless/libertas/cfg.c | 38 +++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c
index 8317afd..fd18d03 100644
--- a/drivers/net/wireless/libertas/cfg.c
+++ b/drivers/net/wireless/libertas/cfg.c
@@ -2038,6 +2038,43 @@ static int lbs_leave_ibss(struct wiphy *wiphy, struct net_device *dev)
+int lbs_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
+ bool enabled, int timeout)
+{
+ struct lbs_private *priv = wiphy_priv(wiphy);
+
+ if (!(priv->fwcapinfo & FW_CAPINFO_PS)) {
+ if (!enabled)
+ return 0;
+ else
+ return -EINVAL;
+ }
+ /* firmware does not work well with too long latency with power saving
+ * enabled, so do not enable it if there is only polling, no
+ * interrupts (like in some sdio hosts which can only
+ * poll for sdio irqs)
+ */
+ if (priv->is_polling) {
+ if (!enabled)
+ return 0;
+ else
+ return -EINVAL;
+ }
+ if (!enabled) {
+ priv->psmode = LBS802_11POWERMODECAM;
+ if (priv->psstate != PS_STATE_FULL_POWER)
+ lbs_set_ps_mode(priv,
+ PS_MODE_ACTION_EXIT_PS,
+ true);
+ return 0;
+ }
+ if (priv->psmode != LBS802_11POWERMODECAM)
+ return 0;
+ priv->psmode = LBS802_11POWERMODEMAX_PSP;
+ if (priv->connect_status == LBS_CONNECTED)
+ lbs_set_ps_mode(priv, PS_MODE_ACTION_ENTER_PS, true);
+ return 0;
+}
/*
* Initialization
@@ -2056,6 +2093,7 @@ static struct cfg80211_ops lbs_cfg80211_ops = {
.change_virtual_intf = lbs_change_intf,
.join_ibss = lbs_join_ibss,
.leave_ibss = lbs_leave_ibss,
+ .set_power_mgmt = lbs_set_power_mgmt,
};
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Andreas Kemnade <andreas@kemnade.info> |
|---|---|
| Date | 2016-01-06 22:10 +0100 |
| Subject | [PATCH 5/6] wireless:libertas: go back to ps mode without commands pending |
| Message-ID | <qO3vd-6u0-27@gated-at.bofh.it> |
| In reply to | #1303079 |
Removes the old todo block and checks only whether ieee powersave
mode is requested. We still have to check for being connected as
this powersave mode includes logic for regularly waking up and
checking for packets which only makes sense when connected.
For not being connected, another mode is needed.
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
---
drivers/net/wireless/libertas/cmd.c | 36 +++++-------------------------------
1 file changed, 5 insertions(+), 31 deletions(-)
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index 40467d6..4ddd0e5 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -1428,40 +1428,14 @@ int lbs_execute_next_command(struct lbs_private *priv)
* check if in power save mode, if yes, put the device back
* to PS mode
*/
-#ifdef TODO
- /*
- * This was the old code for libertas+wext. Someone that
- * understands this beast should re-code it in a sane way.
- *
- * I actually don't understand why this is related to WPA
- * and to connection status, shouldn't powering should be
- * independ of such things?
- */
if ((priv->psmode != LBS802_11POWERMODECAM) &&
(priv->psstate == PS_STATE_FULL_POWER) &&
- ((priv->connect_status == LBS_CONNECTED) ||
- lbs_mesh_connected(priv))) {
- if (priv->secinfo.WPAenabled ||
- priv->secinfo.WPA2enabled) {
- /* check for valid WPA group keys */
- if (priv->wpa_mcast_key.len ||
- priv->wpa_unicast_key.len) {
- lbs_deb_host(
- "EXEC_NEXT_CMD: WPA enabled and GTK_SET"
- " go back to PS_SLEEP");
- lbs_set_ps_mode(priv,
- PS_MODE_ACTION_ENTER_PS,
- false);
- }
- } else {
- lbs_deb_host(
- "EXEC_NEXT_CMD: cmdpendingq empty, "
- "go back to PS_SLEEP");
- lbs_set_ps_mode(priv, PS_MODE_ACTION_ENTER_PS,
- false);
- }
+ (priv->connect_status == LBS_CONNECTED)) {
+ lbs_deb_host(
+ "EXEC_NEXT_CMD: cmdpendingq empty, go back to PS_SLEEP");
+ lbs_set_ps_mode(priv, PS_MODE_ACTION_ENTER_PS,
+ false);
}
-#endif
}
ret = 0;
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Andreas Kemnade <andreas@kemnade.info> |
|---|---|
| Date | 2016-01-06 22:10 +0100 |
| Subject | [PATCH 6/6] wireless:libertas: fix suspend problems |
| Message-ID | <qO3vd-6u0-25@gated-at.bofh.it> |
| In reply to | #1303079 |
When the device goes to suspend mode with powersaving enabled,
lbs_remove_card tries to exit powersaving state even
when already woken up. That command is not processed properly in
that situation, so the system hangs at suspend,
so disable it.
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
---
drivers/net/wireless/libertas/main.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index 8079560..b35b8bc 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -1060,7 +1060,12 @@ void lbs_remove_card(struct lbs_private *priv)
if (priv->psmode == LBS802_11POWERMODEMAX_PSP) {
priv->psmode = LBS802_11POWERMODECAM;
- lbs_set_ps_mode(priv, PS_MODE_ACTION_EXIT_PS, true);
+ /* no need to wakeup if already woken up,
+ * on suspend, this exit ps command is not processed
+ * the driver hangs
+ */
+ if (priv->psstate != PS_STATE_FULL_POWER)
+ lbs_set_ps_mode(priv, PS_MODE_ACTION_EXIT_PS, true);
}
if (priv->is_deep_sleep) {
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Andreas Kemnade <andreas@kemnade.info> |
|---|---|
| Date | 2016-01-06 22:10 +0100 |
| Subject | [PATCH 4/6] wireless:libertas: do not confirm sleep if commands are pending |
| Message-ID | <qO3ve-6u0-35@gated-at.bofh.it> |
| In reply to | #1303079 |
If the main thread gets one PS AWAKE event and one PS SLEEP event
in one iteration over event_fifo there will never be checks for
commands to be processed, since psstate will always be
PS_STATE_SLEEP or PS_STATE_PRE_SLEEP
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
---
drivers/net/wireless/libertas/cmdresp.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
index 701125f..c95bf6d 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -257,6 +257,10 @@ int lbs_process_event(struct lbs_private *priv, u32 event)
"EVENT: in FULL POWER mode, ignoring PS_SLEEP\n");
break;
}
+ if (!list_empty(&priv->cmdpendingq)) {
+ lbs_deb_cmd("EVENT: commands in queue, do not sleep\n");
+ break;
+ }
priv->psstate = PS_STATE_PRE_SLEEP;
lbs_ps_confirm_sleep(priv);
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web