diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-04-16 07:17:25 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-04-22 16:57:16 -0400 |
commit | 10f644a47b76d3e61b98f2d02ce9690b94c51ee5 (patch) | |
tree | fc344d0f888ea0b97608cd53eec1d2dc17672087 /net/mac80211/main.c | |
parent | 965bedadc01d34027455d5d5b67063ef0209c955 (diff) |
mac80211: disable powersave if pm_qos asks for low latency
When an application asks for a latency lower than the beacon interval
there's nothing we can do -- we need to stay awake and not have the
AP buffer frames for us. Add code to automatically calculate this
constraint in mac80211 so drivers need not concern themselves with it.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/main.c')
-rw-r--r-- | net/mac80211/main.c | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 80c0e28bf549..049ce8639806 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/wireless.h> | 21 | #include <linux/wireless.h> |
22 | #include <linux/rtnetlink.h> | 22 | #include <linux/rtnetlink.h> |
23 | #include <linux/bitmap.h> | 23 | #include <linux/bitmap.h> |
24 | #include <linux/pm_qos_params.h> | ||
24 | #include <net/net_namespace.h> | 25 | #include <net/net_namespace.h> |
25 | #include <net/cfg80211.h> | 26 | #include <net/cfg80211.h> |
26 | 27 | ||
@@ -1038,25 +1039,38 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) | |||
1038 | } | 1039 | } |
1039 | } | 1040 | } |
1040 | 1041 | ||
1042 | local->network_latency_notifier.notifier_call = | ||
1043 | ieee80211_max_network_latency; | ||
1044 | result = pm_qos_add_notifier(PM_QOS_NETWORK_LATENCY, | ||
1045 | &local->network_latency_notifier); | ||
1046 | |||
1047 | if (result) { | ||
1048 | rtnl_lock(); | ||
1049 | goto fail_pm_qos; | ||
1050 | } | ||
1051 | |||
1041 | return 0; | 1052 | return 0; |
1042 | 1053 | ||
1043 | fail_wep: | 1054 | fail_pm_qos: |
1055 | ieee80211_led_exit(local); | ||
1056 | ieee80211_remove_interfaces(local); | ||
1057 | fail_wep: | ||
1044 | rate_control_deinitialize(local); | 1058 | rate_control_deinitialize(local); |
1045 | fail_rate: | 1059 | fail_rate: |
1046 | unregister_netdevice(local->mdev); | 1060 | unregister_netdevice(local->mdev); |
1047 | local->mdev = NULL; | 1061 | local->mdev = NULL; |
1048 | fail_dev: | 1062 | fail_dev: |
1049 | rtnl_unlock(); | 1063 | rtnl_unlock(); |
1050 | sta_info_stop(local); | 1064 | sta_info_stop(local); |
1051 | fail_sta_info: | 1065 | fail_sta_info: |
1052 | debugfs_hw_del(local); | 1066 | debugfs_hw_del(local); |
1053 | destroy_workqueue(local->hw.workqueue); | 1067 | destroy_workqueue(local->hw.workqueue); |
1054 | fail_workqueue: | 1068 | fail_workqueue: |
1055 | if (local->mdev) | 1069 | if (local->mdev) |
1056 | free_netdev(local->mdev); | 1070 | free_netdev(local->mdev); |
1057 | fail_mdev_alloc: | 1071 | fail_mdev_alloc: |
1058 | wiphy_unregister(local->hw.wiphy); | 1072 | wiphy_unregister(local->hw.wiphy); |
1059 | fail_wiphy_register: | 1073 | fail_wiphy_register: |
1060 | kfree(local->int_scan_req.channels); | 1074 | kfree(local->int_scan_req.channels); |
1061 | return result; | 1075 | return result; |
1062 | } | 1076 | } |
@@ -1069,6 +1083,9 @@ void ieee80211_unregister_hw(struct ieee80211_hw *hw) | |||
1069 | tasklet_kill(&local->tx_pending_tasklet); | 1083 | tasklet_kill(&local->tx_pending_tasklet); |
1070 | tasklet_kill(&local->tasklet); | 1084 | tasklet_kill(&local->tasklet); |
1071 | 1085 | ||
1086 | pm_qos_remove_notifier(PM_QOS_NETWORK_LATENCY, | ||
1087 | &local->network_latency_notifier); | ||
1088 | |||
1072 | rtnl_lock(); | 1089 | rtnl_lock(); |
1073 | 1090 | ||
1074 | /* | 1091 | /* |