Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(535)

Unified Diff: laptop-mode-tools_1.52/usr/share/laptop-mode-tools/modules/wifi-powermgmt

Issue 1769003: Added WiFi power management support. Saves 0.3-0.8W at idle. (Closed)
Patch Set: Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « laptop-mode-tools_1.52/etc/laptop-mode/conf.d/wifi-powermgmt.conf ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: laptop-mode-tools_1.52/usr/share/laptop-mode-tools/modules/wifi-powermgmt
diff --git a/laptop-mode-tools_1.52/usr/share/laptop-mode-tools/modules/wifi-powermgmt b/laptop-mode-tools_1.52/usr/share/laptop-mode-tools/modules/wifi-powermgmt
new file mode 100755
index 0000000000000000000000000000000000000000..2efb1a661353ffa4f6113cc99ea73319ea48ecc9
--- /dev/null
+++ b/laptop-mode-tools_1.52/usr/share/laptop-mode-tools/modules/wifi-powermgmt
@@ -0,0 +1,24 @@
+IWCONFIG=iwconfig
+
+if [ x$CONTROL_WIFI_POWER = x1 ] ; then
+ if [ $ON_AC -eq 1 ] ; then
+ power_mgmt="off"
+ else
+ power_mgmt="on"
+ fi
+
+ for DEVICE in /sys/class/net/* ; do
+ if [ -d $DEVICE/wireless ]; then
+ dev=`basename $DEVICE`
+ $IWCONFIG $dev power $power_mgmt
+ ret=$?
+ if [ "$ret" = "0" ]; then
+ log "VERBOSE" "Power Management set to $power_mgmt for $dev."
+ else
+ log "VERBOSE" "Failed to set Power Management to $power_mgmt for $dev."
+ fi
+ fi
+ done
+else
+ log "VERBOSE" "WiFi power setting is disabled."
+fi
« no previous file with comments | « laptop-mode-tools_1.52/etc/laptop-mode/conf.d/wifi-powermgmt.conf ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698