aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2015-10-14 12:02:43 -0400
committerJohannes Berg <johannes.berg@intel.com>2015-10-14 12:04:08 -0400
commit4a733ef1bea705cdc69d936b95fedab4b47fbd40 (patch)
tree8e16628865b0f7a35b81615f7c9d4430bf309c5b
parent61f6bba006d4e643fdff62c3d7fd4ea6ca4f468d (diff)
mac80211: remove PM-QoS listener
As this API has never really seen any use and most drivers don't ever use the value derived from it, remove it. Change the only driver using it (rt2x00) to simply use the DTIM period instead of the "max sleep" time. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00config.c2
-rw-r--r--include/net/mac80211.h6
-rw-r--r--net/mac80211/cfg.c4
-rw-r--r--net/mac80211/ieee80211_i.h5
-rw-r--r--net/mac80211/iface.c4
-rw-r--r--net/mac80211/main.c13
-rw-r--r--net/mac80211/mlme.c69
-rw-r--r--net/mac80211/scan.c1
-rw-r--r--net/mac80211/trace.h2
-rw-r--r--net/mac80211/util.c2
10 files changed, 21 insertions, 87 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00config.c b/drivers/net/wireless/rt2x00/rt2x00config.c
index 48a2cad29477..7e8bb1198ae9 100644
--- a/drivers/net/wireless/rt2x00/rt2x00config.c
+++ b/drivers/net/wireless/rt2x00/rt2x00config.c
@@ -266,7 +266,7 @@ void rt2x00lib_config(struct rt2x00_dev *rt2x00dev,
266 if (beacon_diff > beacon_int) 266 if (beacon_diff > beacon_int)
267 beacon_diff = 0; 267 beacon_diff = 0;
268 268
269 autowake_timeout = (conf->max_sleep_period * beacon_int) - beacon_diff; 269 autowake_timeout = (conf->ps_dtim_period * beacon_int) - beacon_diff;
270 queue_delayed_work(rt2x00dev->workqueue, 270 queue_delayed_work(rt2x00dev->workqueue,
271 &rt2x00dev->autowakeup_work, 271 &rt2x00dev->autowakeup_work,
272 autowake_timeout - 15); 272 autowake_timeout - 15);
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 1bb2a2b4e187..4b9dd070aeb9 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1241,11 +1241,6 @@ enum ieee80211_smps_mode {
1241 * @flags: configuration flags defined above 1241 * @flags: configuration flags defined above
1242 * 1242 *
1243 * @listen_interval: listen interval in units of beacon interval 1243 * @listen_interval: listen interval in units of beacon interval
1244 * @max_sleep_period: the maximum number of beacon intervals to sleep for
1245 * before checking the beacon for a TIM bit (managed mode only); this
1246 * value will be only achievable between DTIM frames, the hardware
1247 * needs to check for the multicast traffic bit in DTIM beacons.
1248 * This variable is valid only when the CONF_PS flag is set.
1249 * @ps_dtim_period: The DTIM period of the AP we're connected to, for use 1244 * @ps_dtim_period: The DTIM period of the AP we're connected to, for use
1250 * in power saving. Power saving will not be enabled until a beacon 1245 * in power saving. Power saving will not be enabled until a beacon
1251 * has been received and the DTIM period is known. 1246 * has been received and the DTIM period is known.
@@ -1275,7 +1270,6 @@ enum ieee80211_smps_mode {
1275struct ieee80211_conf { 1270struct ieee80211_conf {
1276 u32 flags; 1271 u32 flags;
1277 int power_level, dynamic_ps_timeout; 1272 int power_level, dynamic_ps_timeout;
1278 int max_sleep_period;
1279 1273
1280 u16 listen_interval; 1274 u16 listen_interval;
1281 u8 ps_dtim_period; 1275 u8 ps_dtim_period;
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 63d03dad654c..276b57243298 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1428,7 +1428,7 @@ static int ieee80211_change_station(struct wiphy *wiphy,
1428 1428
1429 if (sdata->vif.type == NL80211_IFTYPE_STATION && 1429 if (sdata->vif.type == NL80211_IFTYPE_STATION &&
1430 params->sta_flags_mask & BIT(NL80211_STA_FLAG_AUTHORIZED)) { 1430 params->sta_flags_mask & BIT(NL80211_STA_FLAG_AUTHORIZED)) {
1431 ieee80211_recalc_ps(local, -1); 1431 ieee80211_recalc_ps(local);
1432 ieee80211_recalc_ps_vif(sdata); 1432 ieee80211_recalc_ps_vif(sdata);
1433 } 1433 }
1434 1434
@@ -2463,7 +2463,7 @@ static int ieee80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
2463 if (ieee80211_hw_check(&local->hw, SUPPORTS_DYNAMIC_PS)) 2463 if (ieee80211_hw_check(&local->hw, SUPPORTS_DYNAMIC_PS))
2464 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS); 2464 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
2465 2465
2466 ieee80211_recalc_ps(local, -1); 2466 ieee80211_recalc_ps(local);
2467 ieee80211_recalc_ps_vif(sdata); 2467 ieee80211_recalc_ps_vif(sdata);
2468 2468
2469 return 0; 2469 return 0;
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index f9605f13def9..99735408e99d 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1305,7 +1305,6 @@ struct ieee80211_local {
1305 struct work_struct dynamic_ps_enable_work; 1305 struct work_struct dynamic_ps_enable_work;
1306 struct work_struct dynamic_ps_disable_work; 1306 struct work_struct dynamic_ps_disable_work;
1307 struct timer_list dynamic_ps_timer; 1307 struct timer_list dynamic_ps_timer;
1308 struct notifier_block network_latency_notifier;
1309 struct notifier_block ifa_notifier; 1308 struct notifier_block ifa_notifier;
1310 struct notifier_block ifa6_notifier; 1309 struct notifier_block ifa6_notifier;
1311 1310
@@ -1491,10 +1490,8 @@ int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata,
1491 struct cfg80211_disassoc_request *req); 1490 struct cfg80211_disassoc_request *req);
1492void ieee80211_send_pspoll(struct ieee80211_local *local, 1491void ieee80211_send_pspoll(struct ieee80211_local *local,
1493 struct ieee80211_sub_if_data *sdata); 1492 struct ieee80211_sub_if_data *sdata);
1494void ieee80211_recalc_ps(struct ieee80211_local *local, s32 latency); 1493void ieee80211_recalc_ps(struct ieee80211_local *local);
1495void ieee80211_recalc_ps_vif(struct ieee80211_sub_if_data *sdata); 1494void ieee80211_recalc_ps_vif(struct ieee80211_sub_if_data *sdata);
1496int ieee80211_max_network_latency(struct notifier_block *nb,
1497 unsigned long data, void *dummy);
1498int ieee80211_set_arp_filter(struct ieee80211_sub_if_data *sdata); 1495int ieee80211_set_arp_filter(struct ieee80211_sub_if_data *sdata);
1499void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata); 1496void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata);
1500void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, 1497void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 42d7f0f65bd6..f848c75518a2 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -709,7 +709,7 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up)
709 if (hw_reconf_flags) 709 if (hw_reconf_flags)
710 ieee80211_hw_config(local, hw_reconf_flags); 710 ieee80211_hw_config(local, hw_reconf_flags);
711 711
712 ieee80211_recalc_ps(local, -1); 712 ieee80211_recalc_ps(local);
713 713
714 if (sdata->vif.type == NL80211_IFTYPE_MONITOR || 714 if (sdata->vif.type == NL80211_IFTYPE_MONITOR ||
715 sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { 715 sdata->vif.type == NL80211_IFTYPE_AP_VLAN) {
@@ -1016,7 +1016,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
1016 drv_remove_interface(local, sdata); 1016 drv_remove_interface(local, sdata);
1017 } 1017 }
1018 1018
1019 ieee80211_recalc_ps(local, -1); 1019 ieee80211_recalc_ps(local);
1020 1020
1021 if (cancel_scan) 1021 if (cancel_scan)
1022 flush_delayed_work(&local->scan_work); 1022 flush_delayed_work(&local->scan_work);
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 9b813a2f3a75..e2514fadc3d7 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -20,7 +20,6 @@
20#include <linux/if_arp.h> 20#include <linux/if_arp.h>
21#include <linux/rtnetlink.h> 21#include <linux/rtnetlink.h>
22#include <linux/bitmap.h> 22#include <linux/bitmap.h>
23#include <linux/pm_qos.h>
24#include <linux/inetdevice.h> 23#include <linux/inetdevice.h>
25#include <net/net_namespace.h> 24#include <net/net_namespace.h>
26#include <net/cfg80211.h> 25#include <net/cfg80211.h>
@@ -1083,13 +1082,6 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
1083 1082
1084 rtnl_unlock(); 1083 rtnl_unlock();
1085 1084
1086 local->network_latency_notifier.notifier_call =
1087 ieee80211_max_network_latency;
1088 result = pm_qos_add_notifier(PM_QOS_NETWORK_LATENCY,
1089 &local->network_latency_notifier);
1090 if (result)
1091 goto fail_pm_qos;
1092
1093#ifdef CONFIG_INET 1085#ifdef CONFIG_INET
1094 local->ifa_notifier.notifier_call = ieee80211_ifa_changed; 1086 local->ifa_notifier.notifier_call = ieee80211_ifa_changed;
1095 result = register_inetaddr_notifier(&local->ifa_notifier); 1087 result = register_inetaddr_notifier(&local->ifa_notifier);
@@ -1114,10 +1106,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
1114#endif 1106#endif
1115#if defined(CONFIG_INET) || defined(CONFIG_IPV6) 1107#if defined(CONFIG_INET) || defined(CONFIG_IPV6)
1116 fail_ifa: 1108 fail_ifa:
1117 pm_qos_remove_notifier(PM_QOS_NETWORK_LATENCY,
1118 &local->network_latency_notifier);
1119#endif 1109#endif
1120 fail_pm_qos:
1121 rtnl_lock(); 1110 rtnl_lock();
1122 rate_control_deinitialize(local); 1111 rate_control_deinitialize(local);
1123 ieee80211_remove_interfaces(local); 1112 ieee80211_remove_interfaces(local);
@@ -1143,8 +1132,6 @@ void ieee80211_unregister_hw(struct ieee80211_hw *hw)
1143 tasklet_kill(&local->tx_pending_tasklet); 1132 tasklet_kill(&local->tx_pending_tasklet);
1144 tasklet_kill(&local->tasklet); 1133 tasklet_kill(&local->tasklet);
1145 1134
1146 pm_qos_remove_notifier(PM_QOS_NETWORK_LATENCY,
1147 &local->network_latency_notifier);
1148#ifdef CONFIG_INET 1135#ifdef CONFIG_INET
1149 unregister_inetaddr_notifier(&local->ifa_notifier); 1136 unregister_inetaddr_notifier(&local->ifa_notifier);
1150#endif 1137#endif
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 9c450ffdabe8..6158db06a5b5 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -20,7 +20,6 @@
20#include <linux/etherdevice.h> 20#include <linux/etherdevice.h>
21#include <linux/moduleparam.h> 21#include <linux/moduleparam.h>
22#include <linux/rtnetlink.h> 22#include <linux/rtnetlink.h>
23#include <linux/pm_qos.h>
24#include <linux/crc32.h> 23#include <linux/crc32.h>
25#include <linux/slab.h> 24#include <linux/slab.h>
26#include <linux/export.h> 25#include <linux/export.h>
@@ -1476,7 +1475,7 @@ static bool ieee80211_powersave_allowed(struct ieee80211_sub_if_data *sdata)
1476} 1475}
1477 1476
1478/* need to hold RTNL or interface lock */ 1477/* need to hold RTNL or interface lock */
1479void ieee80211_recalc_ps(struct ieee80211_local *local, s32 latency) 1478void ieee80211_recalc_ps(struct ieee80211_local *local)
1480{ 1479{
1481 struct ieee80211_sub_if_data *sdata, *found = NULL; 1480 struct ieee80211_sub_if_data *sdata, *found = NULL;
1482 int count = 0; 1481 int count = 0;
@@ -1505,48 +1504,23 @@ void ieee80211_recalc_ps(struct ieee80211_local *local, s32 latency)
1505 } 1504 }
1506 1505
1507 if (count == 1 && ieee80211_powersave_allowed(found)) { 1506 if (count == 1 && ieee80211_powersave_allowed(found)) {
1507 u8 dtimper = found->u.mgd.dtim_period;
1508 s32 beaconint_us; 1508 s32 beaconint_us;
1509 1509
1510 if (latency < 0)
1511 latency = pm_qos_request(PM_QOS_NETWORK_LATENCY);
1512
1513 beaconint_us = ieee80211_tu_to_usec( 1510 beaconint_us = ieee80211_tu_to_usec(
1514 found->vif.bss_conf.beacon_int); 1511 found->vif.bss_conf.beacon_int);
1515 1512
1516 timeout = local->dynamic_ps_forced_timeout; 1513 timeout = local->dynamic_ps_forced_timeout;
1517 if (timeout < 0) { 1514 if (timeout < 0)
1518 /* 1515 timeout = 100;
1519 * Go to full PSM if the user configures a very low
1520 * latency requirement.
1521 * The 2000 second value is there for compatibility
1522 * until the PM_QOS_NETWORK_LATENCY is configured
1523 * with real values.
1524 */
1525 if (latency > (1900 * USEC_PER_MSEC) &&
1526 latency != (2000 * USEC_PER_SEC))
1527 timeout = 0;
1528 else
1529 timeout = 100;
1530 }
1531 local->hw.conf.dynamic_ps_timeout = timeout; 1516 local->hw.conf.dynamic_ps_timeout = timeout;
1532 1517
1533 if (beaconint_us > latency) { 1518 /* If the TIM IE is invalid, pretend the value is 1 */
1534 local->ps_sdata = NULL; 1519 if (!dtimper)
1535 } else { 1520 dtimper = 1;
1536 int maxslp = 1; 1521
1537 u8 dtimper = found->u.mgd.dtim_period; 1522 local->hw.conf.ps_dtim_period = dtimper;
1538 1523 local->ps_sdata = found;
1539 /* If the TIM IE is invalid, pretend the value is 1 */
1540 if (!dtimper)
1541 dtimper = 1;
1542 else if (dtimper > 1)
1543 maxslp = min_t(int, dtimper,
1544 latency / beaconint_us);
1545
1546 local->hw.conf.max_sleep_period = maxslp;
1547 local->hw.conf.ps_dtim_period = dtimper;
1548 local->ps_sdata = found;
1549 }
1550 } else { 1524 } else {
1551 local->ps_sdata = NULL; 1525 local->ps_sdata = NULL;
1552 } 1526 }
@@ -1997,7 +1971,7 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata,
1997 ieee80211_bss_info_change_notify(sdata, bss_info_changed); 1971 ieee80211_bss_info_change_notify(sdata, bss_info_changed);
1998 1972
1999 mutex_lock(&local->iflist_mtx); 1973 mutex_lock(&local->iflist_mtx);
2000 ieee80211_recalc_ps(local, -1); 1974 ieee80211_recalc_ps(local);
2001 mutex_unlock(&local->iflist_mtx); 1975 mutex_unlock(&local->iflist_mtx);
2002 1976
2003 ieee80211_recalc_smps(sdata); 1977 ieee80211_recalc_smps(sdata);
@@ -2165,7 +2139,7 @@ static void ieee80211_reset_ap_probe(struct ieee80211_sub_if_data *sdata)
2165 __ieee80211_stop_poll(sdata); 2139 __ieee80211_stop_poll(sdata);
2166 2140
2167 mutex_lock(&local->iflist_mtx); 2141 mutex_lock(&local->iflist_mtx);
2168 ieee80211_recalc_ps(local, -1); 2142 ieee80211_recalc_ps(local);
2169 mutex_unlock(&local->iflist_mtx); 2143 mutex_unlock(&local->iflist_mtx);
2170 2144
2171 if (ieee80211_hw_check(&sdata->local->hw, CONNECTION_MONITOR)) 2145 if (ieee80211_hw_check(&sdata->local->hw, CONNECTION_MONITOR))
@@ -2341,7 +2315,7 @@ static void ieee80211_mgd_probe_ap(struct ieee80211_sub_if_data *sdata,
2341 goto out; 2315 goto out;
2342 2316
2343 mutex_lock(&sdata->local->iflist_mtx); 2317 mutex_lock(&sdata->local->iflist_mtx);
2344 ieee80211_recalc_ps(sdata->local, -1); 2318 ieee80211_recalc_ps(sdata->local);
2345 mutex_unlock(&sdata->local->iflist_mtx); 2319 mutex_unlock(&sdata->local->iflist_mtx);
2346 2320
2347 ifmgd->probe_send_count = 0; 2321 ifmgd->probe_send_count = 0;
@@ -3548,7 +3522,7 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
3548 ifmgd->have_beacon = true; 3522 ifmgd->have_beacon = true;
3549 3523
3550 mutex_lock(&local->iflist_mtx); 3524 mutex_lock(&local->iflist_mtx);
3551 ieee80211_recalc_ps(local, -1); 3525 ieee80211_recalc_ps(local);
3552 mutex_unlock(&local->iflist_mtx); 3526 mutex_unlock(&local->iflist_mtx);
3553 3527
3554 ieee80211_recalc_ps_vif(sdata); 3528 ieee80211_recalc_ps_vif(sdata);
@@ -4152,21 +4126,6 @@ void ieee80211_mlme_notify_scan_completed(struct ieee80211_local *local)
4152 rcu_read_unlock(); 4126 rcu_read_unlock();
4153} 4127}
4154 4128
4155int ieee80211_max_network_latency(struct notifier_block *nb,
4156 unsigned long data, void *dummy)
4157{
4158 s32 latency_usec = (s32) data;
4159 struct ieee80211_local *local =
4160 container_of(nb, struct ieee80211_local,
4161 network_latency_notifier);
4162
4163 mutex_lock(&local->iflist_mtx);
4164 ieee80211_recalc_ps(local, latency_usec);
4165 mutex_unlock(&local->iflist_mtx);
4166
4167 return NOTIFY_OK;
4168}
4169
4170static u8 ieee80211_ht_vht_rx_chains(struct ieee80211_sub_if_data *sdata, 4129static u8 ieee80211_ht_vht_rx_chains(struct ieee80211_sub_if_data *sdata,
4171 struct cfg80211_bss *cbss) 4130 struct cfg80211_bss *cbss)
4172{ 4131{
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index a368a1d6caff..b64fd2b2d95a 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -16,7 +16,6 @@
16#include <linux/if_arp.h> 16#include <linux/if_arp.h>
17#include <linux/etherdevice.h> 17#include <linux/etherdevice.h>
18#include <linux/rtnetlink.h> 18#include <linux/rtnetlink.h>
19#include <linux/pm_qos.h>
20#include <net/sch_generic.h> 19#include <net/sch_generic.h>
21#include <linux/slab.h> 20#include <linux/slab.h>
22#include <linux/export.h> 21#include <linux/export.h>
diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h
index 314e3bd7fbdb..5cf8f4ea077f 100644
--- a/net/mac80211/trace.h
+++ b/net/mac80211/trace.h
@@ -325,7 +325,6 @@ TRACE_EVENT(drv_config,
325 __field(u32, flags) 325 __field(u32, flags)
326 __field(int, power_level) 326 __field(int, power_level)
327 __field(int, dynamic_ps_timeout) 327 __field(int, dynamic_ps_timeout)
328 __field(int, max_sleep_period)
329 __field(u16, listen_interval) 328 __field(u16, listen_interval)
330 __field(u8, long_frame_max_tx_count) 329 __field(u8, long_frame_max_tx_count)
331 __field(u8, short_frame_max_tx_count) 330 __field(u8, short_frame_max_tx_count)
@@ -339,7 +338,6 @@ TRACE_EVENT(drv_config,
339 __entry->flags = local->hw.conf.flags; 338 __entry->flags = local->hw.conf.flags;
340 __entry->power_level = local->hw.conf.power_level; 339 __entry->power_level = local->hw.conf.power_level;
341 __entry->dynamic_ps_timeout = local->hw.conf.dynamic_ps_timeout; 340 __entry->dynamic_ps_timeout = local->hw.conf.dynamic_ps_timeout;
342 __entry->max_sleep_period = local->hw.conf.max_sleep_period;
343 __entry->listen_interval = local->hw.conf.listen_interval; 341 __entry->listen_interval = local->hw.conf.listen_interval;
344 __entry->long_frame_max_tx_count = 342 __entry->long_frame_max_tx_count =
345 local->hw.conf.long_frame_max_tx_count; 343 local->hw.conf.long_frame_max_tx_count;
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 8f0fa357a5a7..8274c86296f9 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1951,7 +1951,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1951 } 1951 }
1952 } 1952 }
1953 1953
1954 ieee80211_recalc_ps(local, -1); 1954 ieee80211_recalc_ps(local);
1955 1955
1956 /* 1956 /*
1957 * The sta might be in psm against the ap (e.g. because 1957 * The sta might be in psm against the ap (e.g. because