summaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
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 /net/mac80211/mlme.c
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>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c69
1 files changed, 14 insertions, 55 deletions
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{