Skip to contentSkip to conversation

rt2800lib : Add a patch to disable/enable power save mode.

PATCH NAK Chen, Chien-Chia 2 participants 3 messages Dec 17, 2012 1 message not in the archive Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rt2800lib : Add a patch to disable/enable power save mode.

This patch is to enable/disable power save mode. rt2800lib disables PCI WLAN module power save mode default. It allows to enable the power save mode.

---
 drivers/net/wireless/rt2x00/rt2800lib.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
drivers/net/wireless/rt2x00/rt2800lib.c +9 -1
index 197b446..8ddbf83 100644
@@ -44,6 +44,13 @@
 #include "rt2800.h"
 
 /*
+ * Allow power save mode to be disabled.
+ */
+static bool power_save_disabled = true;
+module_param(power_save_disabled, bool, 0444);
+MODULE_PARM_DESC(power_save_disabled, " Disable power save. (default: disable. 1=disable, 0=enable.)");
+
+/*
  * Register access.
  * All access to the CSR registers will go through the methods
  * rt2800_register_read and rt2800_register_write.
@@ -5079,7 +5086,8 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
 	/*
 	 * Disable powersaving as default on PCI devices.
 	 */
-	if (rt2x00_is_pci(rt2x00dev) || rt2x00_is_soc(rt2x00dev))
+	if ((rt2x00_is_pci(rt2x00dev) || rt2x00_is_soc(rt2x00dev)) &&
+	    power_save_disabled)
 		rt2x00dev->hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT;
 
 	/*
Signature · 1 line
1.6.0.2
#1 lore raw
Quoted 3 lines · Chien-Chia

This patch is to enable/disable power save mode. rt2800lib disables PCI WLAN module power save mode default. It allows to enable the power save mode.

And what is wrong by doing this using the 'iwconfig'/'iw' tools?

Quoted 40 lines
---
 drivers/net/wireless/rt2x00/rt2800lib.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
drivers/net/wireless/rt2x00/rt2800lib.c +9 -2
index 197b446..8ddbf83 100644
@@ -44,6 +44,13 @@
 #include "rt2800.h"
 
 /*
+ * Allow power save mode to be disabled.
+ */
+static bool power_save_disabled = true;
+module_param(power_save_disabled, bool, 0444);
+MODULE_PARM_DESC(power_save_disabled, " Disable power save. (default: disable. 1=disable, 0=enable.)");
+
+/*
  * Register access.
  * All access to the CSR registers will go through the methods
  * rt2800_register_read and rt2800_register_write.
@@ -5079,7 +5086,8 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
        /*
         * Disable powersaving as default on PCI devices.
         */
-       if (rt2x00_is_pci(rt2x00dev) || rt2x00_is_soc(rt2x00dev))
+       if ((rt2x00_is_pci(rt2x00dev) || rt2x00_is_soc(rt2x00dev)) &&
+           power_save_disabled)
                rt2x00dev->hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT;
 
        /*
--

1.6.0.2

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
In reply to a message not in the archive
Quoted 6 lines · Matt Chen

2012/12/17 Ivo Van Doorn <[email protected]>

Quoted 3 lines

On Mon, Dec 17, 2012 at 10:43 AM, Chen, Chien-Chia <[email protected]> wrote:

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

This patch is to enable/disable power save mode. rt2800lib disables PCI WLAN module power save mode default. It allows to enable the power save mode.

And what is wrong by doing this using the 'iwconfig'/'iw' tools?

Compared with iwlwifi [modinfo iwlwifi], it provides the parameter in driver.

I don't consider that a valid excuse.

Quoted 1 line
Quoted 1 line
Quoted 1 line

NACK

There is no point on having this as module parameter, there are sufficient userspace tools to control it already. Having it as a module parameter, is just redundant.

Ivo

Quoted 52 lines
Quoted 51 lines
Quoted 36 lines
---
 drivers/net/wireless/rt2x00/rt2800lib.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
drivers/net/wireless/rt2x00/rt2800lib.c +7 -0
index 197b446..8ddbf83 100644
@@ -44,6 +44,13 @@
 #include "rt2800.h"
 
 /*
+ * Allow power save mode to be disabled.
+ */
+static bool power_save_disabled = true;
+module_param(power_save_disabled, bool, 0444);
+MODULE_PARM_DESC(power_save_disabled, " Disable power save. (default:
 disable. 1=disable, 0=enable.)");
+
+/*
  * Register access.
  * All access to the CSR registers will go through the methods

* rt2800_register_read and rt2800_register_write.

drivers/net/wireless/rt2x00/rt2800lib.c +2 -1
@@ -5079,7 +5086,8 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev
 *rt2x00dev)
        /*
         * Disable powersaving as default on PCI devices.
         */
-       if (rt2x00_is_pci(rt2x00dev) || rt2x00_is_soc(rt2x00dev))
+       if ((rt2x00_is_pci(rt2x00dev) || rt2x00_is_soc(rt2x00dev)) &&
+           power_save_disabled)
                rt2x00dev->hw->wiphy->flags &=
 ~WIPHY_FLAG_PS_ON_BY_DEFAULT;
        /*
Quoted 8 lines

--
1.6.0.2

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

_______________________________________________
users mailing list
[email protected]

http://rt2x00.serialmonkey.com/mailman/listinfo/users_rt2x00.serialmonkey.com