wl1251: Add support for idle mode compat-wireless master
authorJarkko Nikula <jhnikula@gmail.com>
Mon, 4 Apr 2011 08:04:58 +0000 (11:04 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Fri, 27 May 2011 15:31:46 +0000 (18:31 +0300)
commitccb56baff992d682cc84eca10472298b2cce1bf1
tree913dcd0b768fc18343f6d4000cf025bf98fc56f4
parent2353eebf639191a14a5b0646a1e8e17b6483e0c6
wl1251: Add support for idle mode

On Nokia N900 the wl1251 consumes the most power when the interface is up
but not associated to access point (that supports PSM). In terms of battery
current consumption, the consumption is ~180 mA higher when the interface is
up but not associated and only ~5 mA higher when associated compared to
interface down and driver not loaded cases.

This patch adds support for the mac80211 idle notifications. Chip is put into
idle very much the same way when entering into PSM by utilizing the Extreme
Low Power (ELP) mode. I.e. idle is entered by setting necessary conditions
in wl1251_ps_set_mode followed by a call to wl1251_ps_elp_sleep.

It seems it is just enough the authorize ELP mode followed by
CMD_DISCONNECT (thanks to Kalle Valo about the idea to use it).
Without disconnect command the chip remains somewhat active and stays
consuming ~20 mA. Idle mode is left by same way than PSM. The wl1251_join
call is used to revert the CMD_DISCONNECT. Without it association to AP
doesn't work when trying second time.

With this patch the interface up but not associated case the battery current
consumption is less than 1 mA higher compared to interface down case.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Kalle Valo <kvalo@adurom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/wl12xx/wl1251.h
drivers/net/wireless/wl12xx/wl1251_main.c
drivers/net/wireless/wl12xx/wl1251_ps.c