<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Wapnet Blog &#187; Intel</title>
	<atom:link href="http://blog.wapnet.nl/tag/intel/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.wapnet.nl</link>
	<description>Knowledge Base</description>
	<lastBuildDate>Wed, 14 Dec 2011 06:55:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Ubuntu</title>
		<link>http://blog.wapnet.nl/2008/02/ubuntu/</link>
		<comments>http://blog.wapnet.nl/2008/02/ubuntu/#comments</comments>
		<pubDate>Mon, 04 Feb 2008 22:37:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[accu]]></category>
		<category><![CDATA[battery]]></category>
		<category><![CDATA[Intel]]></category>
		<category><![CDATA[levensduur]]></category>
		<category><![CDATA[livetime]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[nic]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://blog.wapnet.nl/?p=14</guid>
		<description><![CDATA[Hi everyone, this is a simple Howto for owners of laptops with Intel 2200 or 3945 wifi cards. Using these commands will use laptop-mode automatically at bootup to improve your battery life. Additionnaly, there are two scripts to be added to laptop-mode so that it manages the power saving modes on the intel wifi cards. [...]]]></description>
			<content:encoded><![CDATA[<p>Hi everyone,<br />
this is a simple Howto for owners of laptops with Intel 2200 or 3945 wifi cards. Using these commands will use laptop-mode automatically at bootup to improve your battery life. Additionnaly, there are two scripts to be added to laptop-mode so that it manages the power saving modes on the intel wifi cards. This howto assumes you already have a working wireless setup, there are other threads on getting you wifi working, please keep this thread about power management.</p>
<p><strong>To use laptop-mode by default</strong>:</p>
<p style="margin: 5px 20px 20px">
<p class="smallfont" style="margin-bottom: 2px">Code:</p>
<pre class="alt2" dir="ltr" style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 34px; text-align: left">sudo gedit /etc/default/acpi-support</pre>
<p>Scroll down change laptop-mode to true:</p>
<p style="margin: 5px 20px 20px">
<p class="smallfont" style="margin-bottom: 2px">Code:</p>
<pre class="alt2" dir="ltr" style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 34px; text-align: left">ENABLE_LAPTOP_MODE=true</pre>
<p>For some reason, laptop-mode is only started when the AC is unplugged. This might seem fine unless you bootup the laptop on the battery, in which case laptop-mode never gets started. Thus, to enable laptop-mode at boot (taken from a lost thread):</p>
<p style="margin: 5px 20px 20px">
<p class="smallfont" style="margin-bottom: 2px">Code:</p>
<pre class="alt2" dir="ltr" style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 34px; text-align: left">sudo update-rc.d laptop-mode multiuser</pre>
<p>Now that laptop-mode is started automatically, we can make sure it manages the power saving on the intel wireless cards (ipw3945 &amp; iwp2200) this way.</p>
<p>To use the power management, you will need to install the wireless tools:</p>
<p style="margin: 5px 20px 20px">
<p class="smallfont" style="margin-bottom: 2px">Code:</p>
<pre class="alt2" dir="ltr" style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 34px; text-align: left">sudo apt-get install linux-restricted-modules-generic wireless-tools</pre>
<p><strong>For both intel 3945 (ipw3945 driver) and 2200 (ipw2200 driver) cards</strong>:</p>
<p>First, create the helper function file (taken from largecat&#8217;s post on page 2 of this thread):</p>
<p style="margin: 5px 20px 20px">
<p class="smallfont" style="margin-bottom: 2px">Code:</p>
<pre class="alt2" dir="ltr" style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 34px; text-align: left">sudo gedit /etc/acpi/intelWifiPwr.sh</pre>
<p>copy &amp; paste this code in the editor, save and exit.</p>
<p style="margin: 5px 20px 20px">
<p class="smallfont" style="margin-bottom: 2px">Code:</p>
<pre class="alt2" dir="ltr" style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 498px; text-align: left">#!/bin/bash
# Power saving setting for the Intel 3945 and 2200 wireless adaptor
#
# This script relies upon the name of the driver.

I3945_DRIVERNAME=ipw3945
I2200_DRIVERNAME=ipw2200

IWPRIV=/sbin/iwpriv
IWCONFIG=/sbin/iwconfig

SET_I3945_AC_PARMS="set_power 6"
SET_I3945_BAT_PARMS="set_power 7"

SET_I2200_AC_PARMS="power off"
SET_I2200_BAT_PARMS="power on"

#
# Find all the wireless devices using the supplied driver names.
# Place the interface names on the list WIFI_IFNAMES.
#
function findWifiIfsByDriver {
    local DEVICE;
    local LINK_TARGET;
    WIFI_IFNAMES=""

    for DEVICE in /sys/class/net/*; do
	if [ -d $DEVICE/wireless ]; then
# See if the driver for $DEVICE matches the supplied one by checking the link to
# the driver.
	    if [ -h $DEVICE/device/driver ]; then
		LINK_TARGET=`readlink $DEVICE/device/driver | sed 's/.*\///'`

		if [ $LINK_TARGET == $1 ]; then

# add the interface name to the list
		    WIFI_IFNAMES=$WIFI_IFNAMES" "`echo -n $DEVICE | sed 's/.*\///'`
		fi
	    fi
	fi
    done
}

#
# Set all the adaptors using the supplied driver into the supplied
# power saving mode
#
# $1 - driver name
# $2 - power command
# $3 - power command arguments
#
function setWifiPwrSave {
    local DEVICE;
    findWifiIfsByDriver $1;

    for DEVICE in $WIFI_IFNAMES; do
#	echo "Would execute $2 $DEVICE $3"
	$2 $DEVICE $3
    done
}

function intel3945_BatPwrSave {
    setWifiPwrSave "$I3945_DRIVERNAME" "$IWPRIV" "$SET_I3945_BAT_PARMS"
}

function intel3945_AcPwrSave {
    setWifiPwrSave "$I3945_DRIVERNAME" "$IWPRIV" "$SET_I3945_AC_PARMS"
}

function intel2200_BatPwrSave {
    setWifiPwrSave "$I2200_DRIVERNAME" "$IWCONFIG" "$SET_I2200_BAT_PARMS"
}

function intel2200_AcPwrSave {
    setWifiPwrSave "$I2200_DRIVERNAME" "$IWCONFIG" "$SET_I2200_AC_PARMS"
}</pre>
<p>Then we will create 2 scripts.  The first will run when the laptop is unplugged, the later when it runs on AC.</p>
<p>On battery:</p>
<p style="margin: 5px 20px 20px">
<p class="smallfont" style="margin-bottom: 2px">Code:</p>
<pre class="alt2" dir="ltr" style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 34px; text-align: left">sudo gedit /etc/laptop-mode/batt-start/20-wireless-battery.sh</pre>
<p>Then copy and paste this code into the editor, save and exit:</p>
<p style="margin: 5px 20px 20px">
<p class="smallfont" style="margin-bottom: 2px">Code:</p>
<pre class="alt2" dir="ltr" style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 146px; text-align: left">#!/bin/bash

# source the helper script
. /etc/acpi/intelWifiPwr.sh

# set Battery power saving
intel3945_BatPwrSave
intel2200_BatPwrSave</pre>
<p>Make it executable:</p>
<p style="margin: 5px 20px 20px">
<p class="smallfont" style="margin-bottom: 2px">Code:</p>
<pre class="alt2" dir="ltr" style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 34px; text-align: left">sudo chmod +x /etc/laptop-mode/batt-start/20-wireless-battery.sh</pre>
<p>On AC:</p>
<p style="margin: 5px 20px 20px">
<p class="smallfont" style="margin-bottom: 2px">Code:</p>
<pre class="alt2" dir="ltr" style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 34px; text-align: left">sudo gedit /etc/laptop-mode/batt-stop/20-wireless-ac.sh</pre>
<p>Then copy and paste this code into the editor, save and exit:</p>
<p style="margin: 5px 20px 20px">
<p class="smallfont" style="margin-bottom: 2px">Code:</p>
<pre class="alt2" dir="ltr" style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 146px; text-align: left">#!/bin/bash

# source the helper script
. /etc/acpi/intelWifiPwr.sh

# set Battery power saving
intel3945_AcPwrSave
intel2200_AcPwrSave</pre>
<p>Make it executable:</p>
<p style="margin: 5px 20px 20px">
<p class="smallfont" style="margin-bottom: 2px">Code:</p>
<pre class="alt2" dir="ltr" style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 34px; text-align: left">sudo chmod +x /etc/laptop-mode/batt-stop/20-wireless-ac.sh</pre>
<p>That&#8217;s it, you can give it a try by plugging and unplugging the AC and running iwconfig to verify that the Power management: on/off changes (this can take up to 15 seconds to change)</p>
<p>Bron: http://ubuntuforums.org/showthread.php?t=419772</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.wapnet.nl/2008/02/ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 1/9 queries in 0.023 seconds using disk: basic
Object Caching 360/369 objects using disk: basic

Served from: blog.wapnet.nl @ 2011-12-14 12:05:17 -->
