[Gta04-owner] wifi power saving
Andreas Kemnade
andreas at kemnade.info
Mon Nov 30 22:38:19 CET 2015
Hi,
On Mon, 30 Nov 2015 16:26:31 +0100
"H. Nikolaus Schaller" <hns at goldelico.com> wrote:
> Hi,
>
> Am 29.11.2015 um 21:30 schrieb Andreas Kemnade <andreas at kemnade.info>:
>
> > Hi,
> >
> > there is one thing called ieee80211 power saving mode which puts the
> > interface into a low power state. So power consumption is reduced when
> > there is little traffic. Since packets are buffered, the symptons are
> > higher, irregular ping times. which drop when you use
> > e.g. ping -i 0.2 host
> >
> > On GTA02 there was a special command like
> > wmiconfig -i wlan0 performance / rec
> > The difference in power consumption is dramatic.
> >
> > On several other hardware you can simply enable/disable power saving
> > with iwconfig wlanX power on resp. off.
> > in iwconfig you have a line
> > Power Management:off
> >
> > The libertas wifi driver supports power management in our
> > 2.6.32-hw-validation kernel. The ping behaviour shows up which I have
> > demonstrated at the OHSW meeting in Garching.
> > Now at home (the first thing I did) I connected my pseudo-battery (the
> > 2.6.32 has no hdq support!) to my labor power supply and found the
> > following values with a bit weird-configured 2.6.32 kernel:
> > 360mA wifi powered off
> > 580mA wifi powered on and iwconfig wlan0 power off
>
> looks as if iwconfig power on/off just enables/disables the interface but
> does not power up/down the chip?
>
iwconfig power does not power anything on/off itself but it enables/
disables ieee power save mode.
> > 380mA+ spikes wifi powered on and iwconfig wlan0 power on
>
> here the interface would be enabled and the chip can decide to power down...
The driver can decide to do anything about powersave mode. It depends on the chip
what the driver has to do itself and what not.
>
> >
> > In e.g. 3.7 there still appears Power Management:on in iwconfig output
> > but iwconfig power on/off fails.
> > Power saving needs to be enabled and disabled by the driver at the
> > right times.
>
> Do we have an idea how this mode is enabled through some sdio control
> commands?
>
I do not fully understand the logic yet. But I have some idea. Well,
there is also some code for wake-on-wlan (e.g. when a sip call arrives). I think
it is called hostsleep.
> >
> > Reasons:
> > - One ugly block of code commented out by
> > #ifdef TODO
> > which needs to be understood to have a good solution
> > That block of code is vital to the power saving stuff so there
> > has to be a hack to have any power saving
> > - driver switched to cfg80211, the interface iwconfig power accesses was
> > provided for cfg80211
> > - some inconsistencies after buffer reorganisation (some code expects
> > headers stripped off but gets buffers with headers
> > - probably other power-saving code which was not adopted when doing
> > structural changes in the driver
> >
> > So for first tries there will be a set of patches where some of them
> > are hacks and other ones clear bugfixes.
> > I will first try to fix 3.7 since there the libertas driver is in good
> > condition. So I have a better chance to learn how the driver works and
> > I will not run into other driver problems.
>
> Looks like a good strategy! I hope we can help you to get it working.
>
I will probably send a patchset tomorrow. At the moment I got switching powersave
on/off via iwconfig power working. With light cpu load, display + backlight on and ping running I get power consumption of around 270mA when in power save mode.
Limitations: disconnecting and setting key stuff and enabling debug output (libertas.ko has a parameter for that) causes trouble in powersave mode. So at the moment I have to
rfkill unblock wifi
iwconfig wlan0 power off (is on per default)
wpa_supplcant ...
dhclient wlan0
if clock is horribly wrong, wait for ntpdate to fix it and cause another group rekeying
iwconfig wlan0 power on
use the connection but stop before next rekeying
iwconfig wlan0 power off
switch connection, go away, ifconfig down...
No problems if I do not enable power saving.
Regards,
Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://lists.goldelico.com/pipermail/gta04-owner/attachments/20151130/e900d2a7/attachment.asc>
More information about the Gta04-owner
mailing list