iwlwifi: automatically adjust sleep level
Depending on required latency requested by pm_qos (via mac80211) we can automatically adjust the sleep state. Also, mac80211 has a user-visible dynamic sleep feature where we are supposed to stay awake after sending/receiving frames to better receive response frames to our packets, this can be integrated into the sleep command. Currently, and this patch doesn't change that yet, we default to using sleep level 1 if PS is enabled. With a module parameter to iwlcore, automatic adjustment to changing network latency requirements can be enabled -- this isn't yet the default due to requiring more testing. The goal is to enable automatic adjustment and then go into the deepest possible sleep state possible depending on the networking latency requirements. This patch does, however, enable IEEE80211_HW_SUPPORTS_DYNAMIC_PS to avoid the double-timer (one in software and one in the device) when transmitting -- the exact timeout may be ignored but that is not of big concern. Note also that we keep the hard-coded power indices around for thermal throttling -- the specification of that calls for using the specified power levels. Those can also be selected in debugfs to allow easier testing of such parameters. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
committed by
John W. Linville
parent
d91b1ba377
commit
e312c24cf8
@ -1568,7 +1568,8 @@ int iwl_setup_mac(struct iwl_priv *priv)
|
||||
IEEE80211_HW_NOISE_DBM |
|
||||
IEEE80211_HW_AMPDU_AGGREGATION |
|
||||
IEEE80211_HW_SPECTRUM_MGMT |
|
||||
IEEE80211_HW_SUPPORTS_PS;
|
||||
IEEE80211_HW_SUPPORTS_PS |
|
||||
IEEE80211_HW_SUPPORTS_DYNAMIC_PS;
|
||||
hw->wiphy->interface_modes =
|
||||
BIT(NL80211_IFTYPE_STATION) |
|
||||
BIT(NL80211_IFTYPE_ADHOC);
|
||||
@ -1663,8 +1664,6 @@ int iwl_init_drv(struct iwl_priv *priv)
|
||||
priv->qos_data.qos_cap.val = 0;
|
||||
|
||||
priv->rates_mask = IWL_RATES_MASK;
|
||||
/* If power management is turned on, default to CAM mode */
|
||||
priv->power_mode = IWL_POWER_MODE_CAM;
|
||||
priv->tx_power_user_lmt = IWL_TX_POWER_TARGET_POWER_MAX;
|
||||
|
||||
ret = iwl_init_channel_map(priv);
|
||||
@ -2551,7 +2550,6 @@ void iwl_bss_info_changed(struct ieee80211_hw *hw,
|
||||
if (bss_conf->assoc) {
|
||||
priv->assoc_id = bss_conf->aid;
|
||||
priv->beacon_int = bss_conf->beacon_int;
|
||||
priv->power_data.dtim_period = bss_conf->dtim_period;
|
||||
priv->timestamp = bss_conf->timestamp;
|
||||
priv->assoc_capability = bss_conf->assoc_capability;
|
||||
|
||||
@ -2801,13 +2799,10 @@ int iwl_mac_config(struct ieee80211_hw *hw, u32 changed)
|
||||
iwl_set_rate(priv);
|
||||
}
|
||||
|
||||
if (changed & IEEE80211_CONF_CHANGE_PS &&
|
||||
priv->iw_mode == NL80211_IFTYPE_STATION) {
|
||||
priv->power_data.power_disabled =
|
||||
!(conf->flags & IEEE80211_CONF_PS);
|
||||
ret = iwl_power_update_mode(priv, 0);
|
||||
if (changed & IEEE80211_CONF_CHANGE_PS) {
|
||||
ret = iwl_power_update_mode(priv, false);
|
||||
if (ret)
|
||||
IWL_DEBUG_MAC80211(priv, "Error setting power level\n");
|
||||
IWL_DEBUG_MAC80211(priv, "Error setting sleep level\n");
|
||||
}
|
||||
|
||||
if (changed & IEEE80211_CONF_CHANGE_POWER) {
|
||||
|
Reference in New Issue
Block a user