diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-04-29 06:26:17 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-05-06 15:14:51 -0400 |
commit | 5cff20e6c5a6591a79d3b027af222870f52bb550 (patch) | |
tree | 81b6ebb75c1dc87b65258e71526c1581d168156c /include/net | |
parent | 9955151df7c6452cae2ed9649f53d265c91cf155 (diff) |
mac80211: tell driver when idle
When we aren't doing anything in mac80211, we can turn off
much of the hardware, depending on the driver/hw. Not doing
anything, aka being idle, means:
* no monitor interfaces
* no AP/mesh/wds interfaces
* any station interfaces are in DISABLED state
* any IBSS interfaces aren't trying to be in a network
* we aren't trying to scan
By creating a new function that verifies these conditions and calling
it at strategic points where the states of those conditions change,
we can easily make mac80211 tell the driver when we are idle to save
power.
Additionally, this fixes a small quirk where a recalculated powersave
state is passed to the driver even if the hardware is about to stopped
completely.
This patch intentionally doesn't touch radio_enabled because that is
currently implemented to be a soft rfkill which is inappropriate here
when we need to be able to wake up with low latency.
One thing I'm not entirely sure about is this:
phy0: device no longer idle - in use
wlan0: direct probe to AP 00:11:24:91:07:4d try 1
wlan0 direct probe responded
wlan0: authenticate with AP 00:11:24:91:07:4d
wlan0: authenticated
> phy0: device now idle
> phy0: device no longer idle - in use
wlan0: associate with AP 00:11:24:91:07:4d
wlan0: RX AssocResp from 00:11:24:91:07:4d (capab=0x401 status=0 aid=1)
wlan0: associated
Is it appropriate to go into idle state for a short time when we have
just authenticated, but not associated yet? This happens only with the
userspace SME, because we cannot really know how long it will wait
before asking us to associate. Would going idle after a short timeout
be more appropriate? We may need to revisit this, depending on what
happens.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/mac80211.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 7806e22f4ace..38dc1cd10270 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -533,10 +533,16 @@ struct ieee80211_rx_status { | |||
533 | * | 533 | * |
534 | * @IEEE80211_CONF_RADIOTAP: add radiotap header at receive time (if supported) | 534 | * @IEEE80211_CONF_RADIOTAP: add radiotap header at receive time (if supported) |
535 | * @IEEE80211_CONF_PS: Enable 802.11 power save mode (managed mode only) | 535 | * @IEEE80211_CONF_PS: Enable 802.11 power save mode (managed mode only) |
536 | * @IEEE80211_CONF_IDLE: The device is running, but idle; if the flag is set | ||
537 | * the driver should be prepared to handle configuration requests but | ||
538 | * may turn the device off as much as possible. Typically, this flag will | ||
539 | * be set when an interface is set UP but not associated or scanning, but | ||
540 | * it can also be unset in that case when monitor interfaces are active. | ||
536 | */ | 541 | */ |
537 | enum ieee80211_conf_flags { | 542 | enum ieee80211_conf_flags { |
538 | IEEE80211_CONF_RADIOTAP = (1<<0), | 543 | IEEE80211_CONF_RADIOTAP = (1<<0), |
539 | IEEE80211_CONF_PS = (1<<1), | 544 | IEEE80211_CONF_PS = (1<<1), |
545 | IEEE80211_CONF_IDLE = (1<<2), | ||
540 | }; | 546 | }; |
541 | 547 | ||
542 | 548 | ||
@@ -551,6 +557,7 @@ enum ieee80211_conf_flags { | |||
551 | * @IEEE80211_CONF_CHANGE_POWER: the TX power changed | 557 | * @IEEE80211_CONF_CHANGE_POWER: the TX power changed |
552 | * @IEEE80211_CONF_CHANGE_CHANNEL: the channel/channel_type changed | 558 | * @IEEE80211_CONF_CHANGE_CHANNEL: the channel/channel_type changed |
553 | * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed | 559 | * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed |
560 | * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed | ||
554 | */ | 561 | */ |
555 | enum ieee80211_conf_changed { | 562 | enum ieee80211_conf_changed { |
556 | IEEE80211_CONF_CHANGE_RADIO_ENABLED = BIT(0), | 563 | IEEE80211_CONF_CHANGE_RADIO_ENABLED = BIT(0), |
@@ -561,6 +568,7 @@ enum ieee80211_conf_changed { | |||
561 | IEEE80211_CONF_CHANGE_POWER = BIT(5), | 568 | IEEE80211_CONF_CHANGE_POWER = BIT(5), |
562 | IEEE80211_CONF_CHANGE_CHANNEL = BIT(6), | 569 | IEEE80211_CONF_CHANGE_CHANNEL = BIT(6), |
563 | IEEE80211_CONF_CHANGE_RETRY_LIMITS = BIT(7), | 570 | IEEE80211_CONF_CHANGE_RETRY_LIMITS = BIT(7), |
571 | IEEE80211_CONF_CHANGE_IDLE = BIT(8), | ||
564 | }; | 572 | }; |
565 | 573 | ||
566 | static inline __deprecated enum ieee80211_conf_changed | 574 | static inline __deprecated enum ieee80211_conf_changed |