Skip to contentSkip to conversation

wl1251_sdio PSM

DISCUSSION GNUtoo 3 participants 13 messages Apr 25, 2010 – May 4, 2010

lore
Share & tools
lore

GNUtoo

author
#0 lore raw

Hi,
We are trying to make the htc dream(also known as G1) android phone usable with a standard GNU(non android) userland.

Inside the htcdream there is a wl1251_sdio chip.

We already use the wl1251_sdio driver with a special module for initialization.

The problem is that When the wifi is on,the battery last for about an hour.

So we definitely need power saving features like PSM(I hope I used the right acronym,I'm looking for the system which makes the access point buffer frames for the phone and then we request the frames,other power saving mode are also welcome but as I understood this one is the most important)

Grepping for psm in the driver show that there is some sort of support for PSM.

Unfortunately the following method of activation failed:

# ./iw dev wlan0 set power_save on
command failed: Operation not supported (-95)
# iwconfig wlan0 power period 2 
Error for wireless request "Set Power Management" (8B2C) :
    invalid argument "2".

and I didn't find a psm sys node.

I wonder where it has been disabled,and if I can re-enable it.

I was also told that most driver have psm disabled,I don't know the reason tough(maybe performance,as it has a serious impact on performance)

our (bad quality)kenrel tree can be found here(we're not yet kernel hackers):
http://gitorious.org/htc-msm-2-6-32/leviathan-incoming/commits/msm-gnuconform

Denis

author
#1 lore raw
Quoted 33 lines · GNUtoo

Hi,
We are trying to make the htc dream(also known as G1) android phone usable with a standard GNU(non android) userland.

Inside the htcdream there is a wl1251_sdio chip.

We already use the wl1251_sdio driver with a special module for initialization.

The problem is that When the wifi is on,the battery last for about an hour.

So we definitely need power saving features like PSM(I hope I used the right acronym,I'm looking for the system which makes the access point buffer frames for the phone and then we request the frames,other power saving mode are also welcome but as I understood this one is the most important)

Grepping for psm in the driver show that there is some sort of support for PSM.

Unfortunately the following method of activation failed:

# ./iw dev wlan0 set power_save on
command failed: Operation not supported (-95)
# iwconfig wlan0 power period 2 
Error for wireless request "Set Power Management" (8B2C) :
    invalid argument "2".

and I didn't find a psm sys node.

Quoted 8 lines

I wonder where it has been disabled,and if I can re-enable it.

I was also told that most driver have psm disabled,I don't know the reason tough(maybe performance,as it has a serious impact on performance)

our (bad quality)kenrel tree can be found here(we're not yet kernel hackers):

iwconfig wlan0 power on now works
I wonder if it really does something tough,I will test

I changed added | IEEE80211_HW_SUPPORTS_PS in:
wl->hw->flags = IEEE80211_HW_SIGNAL_DBM |

                IEEE80211_HW_NOISE_DBM;

Denis.

author
#2 lore raw
Quoted 5 lines

I changed added | IEEE80211_HW_SUPPORTS_PS in:
wl->hw->flags = IEEE80211_HW_SIGNAL_DBM |

                IEEE80211_HW_NOISE_DBM;

Denis.

that was the wrong fix.
The good fix(many thanks to chr_ in #linux-wireless) was to try compat-wireless,which bringed many more power saving features according to him.

Denis.

author
#3 lore raw
Quoted 11 lines · GNUtoo
Quoted 5 lines

I changed added | IEEE80211_HW_SUPPORTS_PS in:
wl->hw->flags = IEEE80211_HW_SIGNAL_DBM |

                IEEE80211_HW_NOISE_DBM;

Denis.

that was the wrong fix.
The good fix(many thanks to chr_ in #linux-wireless) was to try compat-wireless,which bringed many more power saving features according to him.

Denis.

Unfortunately it didn't work as expected:

# ping router
PING router (192.168.1.1): 56 data bytes
64 bytes from 192.168.1.1: seq=0 ttl=64 time=7.995 ms
64 bytes from 192.168.1.1: seq=1 ttl=64 time=5.707 ms
64 bytes from 192.168.1.1: seq=2 ttl=64 time=5.005 ms
64 bytes from 192.168.1.1: seq=3 ttl=64 time=4.730 ms
64 bytes from 192.168.1.1: seq=4 ttl=64 time=13.703 ms
64 bytes from 192.168.1.1: seq=5 ttl=64 time=13.092 ms
64 bytes from 192.168.1.1: seq=6 ttl=64 time=12.513 ms
64 bytes from 192.168.1.1: seq=7 ttl=64 time=11.811 ms
64 bytes from 192.168.1.1: seq=8 ttl=64 time=11.200 ms
64 bytes from 192.168.1.1: seq=9 ttl=64 time=10.101 ms
64 bytes from 192.168.1.1: seq=10 ttl=64 time=9.400 ms
64 bytes from 192.168.1.1: seq=11 ttl=64 time=8.697 ms
64 bytes from 192.168.1.1: seq=12 ttl=64 time=8.088 ms
64 bytes from 192.168.1.1: seq=13 ttl=64 time=7.416 ms
64 bytes from 192.168.1.1: seq=14 ttl=64 time=6.775 ms
64 bytes from 192.168.1.1: seq=15 ttl=64 time=6.164 ms
64 bytes from 192.168.1.1: seq=16 ttl=64 time=5.494 ms
64 bytes from 192.168.1.1: seq=17 ttl=64 time=4.852 ms
64 bytes from 192.168.1.1: seq=18 ttl=64 time=4.364 ms
64 bytes from 192.168.1.1: seq=19 ttl=64 time=3.418 ms
64 bytes from 192.168.1.1: seq=20 ttl=64 time=2.777 ms
64 bytes from 192.168.1.1: seq=21 ttl=64 time=12.024 ms
64 bytes from 192.168.1.1: seq=22 ttl=64 time=11.414 ms
64 bytes from 192.168.1.1: seq=23 ttl=64 time=10.193 ms
64 bytes from 192.168.1.1: seq=24 ttl=64 time=9.552 ms
64 bytes from 192.168.1.1: seq=25 ttl=64 time=8.911 ms
64 bytes from 192.168.1.1: seq=26 ttl=64 time=8.240 ms
64 bytes from 192.168.1.1: seq=27 ttl=64 time=7.812 ms
64 bytes from 192.168.1.1: seq=28 ttl=64 time=6.958 ms
64 bytes from 192.168.1.1: seq=29 ttl=64 time=6.317 ms
64 bytes from 192.168.1.1: seq=30 ttl=64 time=5.707 ms
64 bytes from 192.168.1.1: seq=31 ttl=64 time=4.944 ms
64 bytes from 192.168.1.1: seq=32 ttl=64 time=4.303 ms
64 bytes from 192.168.1.1: seq=33 ttl=64 time=2194.366 ms 
64 bytes from 192.168.1.1: seq=34 ttl=64 time=1193.634 ms
64 bytes from 192.168.1.1: seq=35 ttl=64 time=193.421 ms
64 bytes from 192.168.1.1: seq=38 ttl=64 time=760.559 ms
64 bytes from 192.168.1.1: seq=39 ttl=64 time=784.851 ms

the power_save feature was activated with iw, just before the 64 bytes from 192.168.1.1: seq=33 ttl=64 time=2194.366 ms line
then after 5 lines of ping it stopped displaying the pings.

Denis.

#4 lore raw
Quoted 4 lines · GNUtoo

Unfortunately it didn't work as expected:

# ping router
PING router (192.168.1.1): 56 data bytes
64 bytes from 192.168.1.1: seq=0 ttl=64 time=7.995 ms

<snip>

Quoted 11 lines

64 bytes from 192.168.1.1: seq=32 ttl=64 time=4.303 ms 64 bytes from 192.168.1.1: seq=33 ttl=64 time=2194.366 ms 64 bytes from 192.168.1.1: seq=34 ttl=64 time=1193.634 ms 64 bytes from 192.168.1.1: seq=35 ttl=64 time=193.421 ms 64 bytes from 192.168.1.1: seq=38 ttl=64 time=760.559 ms 64 bytes from 192.168.1.1: seq=39 ttl=64 time=784.851 ms

the power_save feature was activated with iw, just before the 64 bytes from 192.168.1.1: seq=33 ttl=64 time=2194.366 ms line
then after 5 lines of ping it stopped displaying the pings.

You need a few more patches for PS to work (on top of current compat-wireless):
http://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff;h=8eb97a1915ae2ab0a19cc6eef1a2753b9514017d
http://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-wifi.git;a=commitdiff;h=d16ed8871faa892f5fd4e8161412051ee11c5ecb

I'm working on mainline mergeable versions of those..

author
#6 lore raw
Quoted 6 lines · GNUtoo
Quoted 5 lines

You need a few more patches for PS to work (on top of current compat-wireless):
http://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff;h=8eb97a1915ae2ab0a19cc6eef1a2753b9514017d
http://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-wifi.git;a=commitdiff;h=d16ed8871faa892f5fd4e8161412051ee11c5ecb

I'm working on mainline mergeable versions of those..

Denis.

oops I don't know why the message wasn't included,maybe I made an error. Anyway it last much longer,but sometimes it only last for about 50 pings and after that no more network,tough iwconfig still say that it's associated.
I'll check my hostapd router logs and try to put a wakelock

Denis.

author
#7 lore raw
Quoted 5 lines · GNUtoo
Quoted 4 lines · GNUtoo
Quoted 4 lines

You need a few more patches for PS to work (on top of current compat-wireless):
http://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff;h=8eb97a1915ae2ab0a19cc6eef1a2753b9514017d
http://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-wifi.git;a=commitdiff;h=d16ed8871faa892f5fd4e8161412051ee11c5ecb

Quoted 7 lines
Quoted 2 lines
Quoted 1 line

I'm working on mainline mergeable versions of those..

Denis.

oops I don't know why the message wasn't included,maybe I made an error. Anyway it last much longer,but sometimes it only last for about 50 pings and after that no more network,tough iwconfig still say that it's associated.
I'll check my hostapd router logs and try to put a wakelock

Apr 27 18:02:18 router hostapd: wlan0: STA 00:1f:df:f8:ac:7f RADIUS:
starting accounting session 4BA21E4D-000007D8
Apr 27 18:03:24 router hostapd: wlan0: STA 00:1f:df:24:0b:7f IEEE
802.11: disassociated due to inactivity
Apr 27 18:03:25 router hostapd: wlan0: STA 00:1f:df:24:0b:7f IEEE

802.11: deauthenticated due to inactivity

So I think it's not the driver...

By the way,the thanks were lost in the mail containing only a quote and "Denis."
so thanks a lot for the patch!!!

Denis

author
#8 lore raw
Quoted 13 lines · GNUtoo
Quoted 5 lines · GNUtoo
Quoted 4 lines · GNUtoo
Quoted 4 lines

You need a few more patches for PS to work (on top of current compat-wireless):
http://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff;h=8eb97a1915ae2ab0a19cc6eef1a2753b9514017d
http://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-wifi.git;a=commitdiff;h=d16ed8871faa892f5fd4e8161412051ee11c5ecb

Quoted 7 lines
Quoted 2 lines
Quoted 1 line

I'm working on mainline mergeable versions of those..

Denis.

oops I don't know why the message wasn't included,maybe I made an error. Anyway it last much longer,but sometimes it only last for about 50 pings and after that no more network,tough iwconfig still say that it's associated.
I'll check my hostapd router logs and try to put a wakelock

Quoted 6 lines
Apr 27 18:02:18 router hostapd: wlan0: STA 00:1f:df:f8:ac:7f RADIUS:
starting accounting session 4BA21E4D-000007D8
Apr 27 18:03:24 router hostapd: wlan0: STA 00:1f:df:24:0b:7f IEEE
802.11: disassociated due to inactivity
Apr 27 18:03:25 router hostapd: wlan0: STA 00:1f:df:24:0b:7f IEEE

802.11: deauthenticated due to inactivity

hmmm....
now it does that:

Apr 27 18:12:43 router hostapd: wlan0: STA 00:1f:df:65:25:23 IEEE
802.11: authenticated
Apr 27 18:12:43 router hostapd: wlan0: STA 00:1f:df:65:25:23 IEEE
802.11: associated (aid 2)
Apr 27 18:12:43 router hostapd: wlan0: STA 00:1f:df:65:25:23 RADIUS:
starting accounting session 4BA21E4D-000007D9
Apr 27 18:13:11 router hostapd: wlan0: STA 00:1f:df:65:25:23 IEEE
802.11: authenticated
Apr 27 18:13:11 router hostapd: wlan0: STA 00:1f:df:65:25:23 IEEE
802.11: associated (aid 2)
Apr 27 18:13:11 router hostapd: wlan0: STA 00:1f:df:65:25:23 RADIUS:

starting accounting session 4BA21E4D-000007DA
--->start pinging
--->ping stopping

with no messages just after the ping stopping,so maybe I need some more patches...

Denis.

#11 lore raw
In reply to GNUtoo
Quoted 1 line · GNUtoo

Hi,

Hi Mr. GNUtoo,

Quoted 2 lines

We are trying to make the htc dream(also known as G1) android phone usable with a standard GNU(non android) userland.

I'm interested about this. Are there any references about this? For example, instructions how to install etc.

Signature · 1 line
Kalle Valo
author
#12 lore raw
Quoted 11 lines · Kalle Valo
Quoted 1 line · GNUtoo

Hi,

Hi Mr. GNUtoo,

Quoted 2 lines

We are trying to make the htc dream(also known as G1) android phone usable with a standard GNU(non android) userland.

I'm interested about this. Are there any references about this? For example, instructions how to install etc.

There is a status at
http://www.htc-linux.org/wiki/index.php?title=Dream#Status

Here are preview images with FSO:
http://downloads.freesmartphone.org/releases/fso2-preview-1/htcdream/

Zhone is only a test program,it's not our goal. Our goal is targetting the SHR distribution instead ( http://trac.shr-project.org/trac )

For now In order to have a SHR image,for now you have to build one yourself using openembedded
Select htcdream as the machine and shr as the distribution also include that in the local.conf:
require conf/distro/include/fso-autorev.inc
require conf/distro/include/shr-autorev.inc

http://docs.openembedded.org/usermanual/usermanual.html#chapter_getting_oe
Contains some information on how to get the build system setup.

Denis.

author
#9 lore raw
In reply to Grazvydas Ignotas
Quoted 6 lines

You need a few more patches for PS to work (on top of current compat-wireless):
http://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff;h=8eb97a1915ae2ab0a19cc6eef1a2753b9514017d
http://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-wifi.git;a=commitdiff;h=d16ed8871faa892f5fd4e8161412051ee11c5ecb

I'm working on mainline mergeable versions of those..

2 things:
*I rebased the patches against lastest compat wireless but I don't know where to send them...
Basically or they apply or they are already in compat-wireless(verified) here are the one which applies:
0007-wl1251-read-default-MAC-address-from-EEPROM-when-ava.patch 0008-wl1251-register-platform_device-to-pass-board-data.patch 0009-wl1251-add-support-for-dedicated-IRQ-line.patch 0010-wl1251-use-sdio_readb_ext-for-ELP-to-work.patch 0011-wl1251-add-reset-handling.patch 0013-wl1251-prevent-scan-when-connected.patch

against compat-wireless-2010-04-26

By the way we can't make ad-hoc work,Is ad-hoc supported by the driver?

Denis.

#10 lore raw
Quoted 18 lines · gnutoo
Quoted 6 lines

You need a few more patches for PS to work (on top of current compat-wireless):
http://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff;h=8eb97a1915ae2ab0a19cc6eef1a2753b9514017d
http://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-wifi.git;a=commitdiff;h=d16ed8871faa892f5fd4e8161412051ee11c5ecb

I'm working on mainline mergeable versions of those..

2 things:
*I rebased the patches against lastest compat wireless but I don't know where to send them...
Basically or they apply or they are already in compat-wireless(verified) here are the one which applies:
0007-wl1251-read-default-MAC-address-from-EEPROM-when-ava.patch 0008-wl1251-register-platform_device-to-pass-board-data.patch 0009-wl1251-add-support-for-dedicated-IRQ-line.patch 0010-wl1251-use-sdio_readb_ext-for-ELP-to-work.patch 0011-wl1251-add-reset-handling.patch 0013-wl1251-prevent-scan-when-connected.patch

Quoted 3 lines

against compat-wireless-2010-04-26

From your list 0007-0009 are on their way to mainline, 0010-0013 are

not mainline friendly (0010 needs a new function in MMC subsystem which I sent for review, 0011 depends on some code from Android tree, 0013 is a hack).

Quoted 1 line

By the way we can't make ad-hoc work,Is ad-hoc supported by the driver?

AFAIK it is not.

Grazvydas