|
20 | 20 | #include <linux/etherdevice.h> |
21 | 21 | #include <linux/moduleparam.h> |
22 | 22 | #include <linux/rtnetlink.h> |
23 | | -#include <linux/pm_qos.h> |
24 | 23 | #include <linux/crc32.h> |
25 | 24 | #include <linux/slab.h> |
26 | 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 | 1477 | /* need to hold RTNL or interface lock */ |
1479 | | -void ieee80211_recalc_ps(struct ieee80211_local *local, s32 latency) |
| 1478 | +void ieee80211_recalc_ps(struct ieee80211_local *local) |
1480 | 1479 | { |
1481 | 1480 | struct ieee80211_sub_if_data *sdata, *found = NULL; |
1482 | 1481 | int count = 0; |
@@ -1505,48 +1504,23 @@ void ieee80211_recalc_ps(struct ieee80211_local *local, s32 latency) |
1505 | 1504 | } |
1506 | 1505 |
|
1507 | 1506 | if (count == 1 && ieee80211_powersave_allowed(found)) { |
| 1507 | +u8 dtimper = found->u.mgd.dtim_period; |
1508 | 1508 | s32 beaconint_us; |
1509 | 1509 |
|
1510 | | -if (latency < 0) |
1511 | | -latency = pm_qos_request(PM_QOS_NETWORK_LATENCY); |
1512 | | - |
1513 | 1510 | beaconint_us = ieee80211_tu_to_usec( |
1514 | 1511 | found->vif.bss_conf.beacon_int); |
1515 | 1512 |
|
1516 | 1513 | timeout = local->dynamic_ps_forced_timeout; |
1517 | | -if (timeout < 0) { |
1518 | | -/* |
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 | | -} |
| 1514 | +if (timeout < 0) |
| 1515 | +timeout = 100; |
1531 | 1516 | local->hw.conf.dynamic_ps_timeout = timeout; |
1532 | 1517 |
|
1533 | | -if (beaconint_us > latency) { |
1534 | | -local->ps_sdata = NULL; |
1535 | | -} else { |
1536 | | -int maxslp = 1; |
1537 | | -u8 dtimper = found->u.mgd.dtim_period; |
1538 | | - |
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 | | -} |
| 1518 | +/* If the TIM IE is invalid, pretend the value is 1 */ |
| 1519 | +if (!dtimper) |
| 1520 | +dtimper = 1; |
| 1521 | + |
| 1522 | +local->hw.conf.ps_dtim_period = dtimper; |
| 1523 | +local->ps_sdata = found; |
1550 | 1524 | } else { |
1551 | 1525 | local->ps_sdata = NULL; |
1552 | 1526 | } |
@@ -1997,7 +1971,7 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata, |
1997 | 1971 | ieee80211_bss_info_change_notify(sdata, bss_info_changed); |
1998 | 1972 |
|
1999 | 1973 | mutex_lock(&local->iflist_mtx); |
2000 | | -ieee80211_recalc_ps(local, -1); |
| 1974 | +ieee80211_recalc_ps(local); |
2001 | 1975 | mutex_unlock(&local->iflist_mtx); |
2002 | 1976 |
|
2003 | 1977 | ieee80211_recalc_smps(sdata); |
@@ -2165,7 +2139,7 @@ static void ieee80211_reset_ap_probe(struct ieee80211_sub_if_data *sdata) |
2165 | 2139 | __ieee80211_stop_poll(sdata); |
2166 | 2140 |
|
2167 | 2141 | mutex_lock(&local->iflist_mtx); |
2168 | | -ieee80211_recalc_ps(local, -1); |
| 2142 | +ieee80211_recalc_ps(local); |
2169 | 2143 | mutex_unlock(&local->iflist_mtx); |
2170 | 2144 |
|
2171 | 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 | 2315 | goto out; |
2342 | 2316 |
|
2343 | 2317 | mutex_lock(&sdata->local->iflist_mtx); |
2344 | | -ieee80211_recalc_ps(sdata->local, -1); |
| 2318 | +ieee80211_recalc_ps(sdata->local); |
2345 | 2319 | mutex_unlock(&sdata->local->iflist_mtx); |
2346 | 2320 |
|
2347 | 2321 | ifmgd->probe_send_count = 0; |
@@ -3548,7 +3522,7 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata, |
3548 | 3522 | ifmgd->have_beacon = true; |
3549 | 3523 |
|
3550 | 3524 | mutex_lock(&local->iflist_mtx); |
3551 | | -ieee80211_recalc_ps(local, -1); |
| 3525 | +ieee80211_recalc_ps(local); |
3552 | 3526 | mutex_unlock(&local->iflist_mtx); |
3553 | 3527 |
|
3554 | 3528 | ieee80211_recalc_ps_vif(sdata); |
@@ -4152,21 +4126,6 @@ void ieee80211_mlme_notify_scan_completed(struct ieee80211_local *local) |
4152 | 4126 | rcu_read_unlock(); |
4153 | 4127 | } |
4154 | 4128 |
|
4155 | | -int 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 | | - |
4170 | 4129 | static u8 ieee80211_ht_vht_rx_chains(struct ieee80211_sub_if_data *sdata, |
4171 | 4130 | struct cfg80211_bss *cbss) |
4172 | 4131 | { |
|
0 commit comments