aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-03-09 02:58:46 -0500
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2012-04-16 17:34:36 -0400
commit84965795b2908f2e0be929e71b5bf3b7c6ad5329 (patch)
tree00530f02671f71b60588ac9431cbe3dea99b1f3a /drivers/net
parentf57d7b6c9db1f9e26da09694b5fcb5650547f7d2 (diff)
iwlwifi: remove no_sleep_autoadjust
My original idea with this was to adjust the sleep pattern of the uCode based on the maximum network latency userspace asked for. Due to nobody wanting to test it, this logic was disabled by default. It seems the time has come to remove it, since it's not only always disabled but there also don't seem to be any applications that actually request a max network latency. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-lib.c1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c10
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-power.c62
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-shared.h2
4 files changed, 2 insertions, 73 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index da023fdbc7b2..8834b1bf04a1 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -99,7 +99,6 @@ struct iwl_mod_params iwlagn_mod_params = {
99 .restart_fw = 1, 99 .restart_fw = 1,
100 .plcp_check = true, 100 .plcp_check = true,
101 .bt_coex_active = true, 101 .bt_coex_active = true,
102 .no_sleep_autoadjust = true,
103 .power_level = IWL_POWER_INDEX_1, 102 .power_level = IWL_POWER_INDEX_1,
104 .bt_ch_announce = true, 103 .bt_ch_announce = true,
105 .wanted_ucode_alternative = 1, 104 .wanted_ucode_alternative = 1,
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 500eaa3cd642..6cea8a79bbe0 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -2471,13 +2471,3 @@ module_param_named(auto_agg, iwlagn_mod_params.auto_agg,
2471 bool, S_IRUGO); 2471 bool, S_IRUGO);
2472MODULE_PARM_DESC(auto_agg, 2472MODULE_PARM_DESC(auto_agg,
2473 "enable agg w/o check traffic load (default: enable)"); 2473 "enable agg w/o check traffic load (default: enable)");
2474
2475/*
2476 * For now, keep using power level 1 instead of automatically
2477 * adjusting ...
2478 */
2479module_param_named(no_sleep_autoadjust, iwlagn_mod_params.no_sleep_autoadjust,
2480 bool, S_IRUGO);
2481MODULE_PARM_DESC(no_sleep_autoadjust,
2482 "don't automatically adjust sleep level "
2483 "according to maximum network latency (default: true)");
diff --git a/drivers/net/wireless/iwlwifi/iwl-power.c b/drivers/net/wireless/iwlwifi/iwl-power.c
index 7bc7a82aba47..174a0f737214 100644
--- a/drivers/net/wireless/iwlwifi/iwl-power.c
+++ b/drivers/net/wireless/iwlwifi/iwl-power.c
@@ -268,61 +268,6 @@ static void iwl_power_sleep_cam_cmd(struct iwl_priv *priv,
268 IWL_DEBUG_POWER(priv, "Sleep command for CAM\n"); 268 IWL_DEBUG_POWER(priv, "Sleep command for CAM\n");
269} 269}
270 270
271static void iwl_power_fill_sleep_cmd(struct iwl_priv *priv,
272 struct iwl_powertable_cmd *cmd,
273 int dynps_ms, int wakeup_period)
274{
275 /*
276 * These are the original power level 3 sleep successions. The
277 * device may behave better with such succession and was also
278 * only tested with that. Just like the original sleep commands,
279 * also adjust the succession here to the wakeup_period below.
280 * The ranges are the same as for the sleep commands, 0-2, 3-9
281 * and >10, which is selected based on the DTIM interval for
282 * the sleep index but here we use the wakeup period since that
283 * is what we need to do for the latency requirements.
284 */
285 static const u8 slp_succ_r0[IWL_POWER_VEC_SIZE] = { 2, 2, 2, 2, 2 };
286 static const u8 slp_succ_r1[IWL_POWER_VEC_SIZE] = { 2, 4, 6, 7, 9 };
287 static const u8 slp_succ_r2[IWL_POWER_VEC_SIZE] = { 2, 7, 9, 9, 0xFF };
288 const u8 *slp_succ = slp_succ_r0;
289 int i;
290
291 if (wakeup_period > IWL_DTIM_RANGE_0_MAX)
292 slp_succ = slp_succ_r1;
293 if (wakeup_period > IWL_DTIM_RANGE_1_MAX)
294 slp_succ = slp_succ_r2;
295
296 memset(cmd, 0, sizeof(*cmd));
297
298 cmd->flags = IWL_POWER_DRIVER_ALLOW_SLEEP_MSK |
299 IWL_POWER_FAST_PD; /* no use seeing frames for others */
300
301 if (priv->power_data.bus_pm)
302 cmd->flags |= IWL_POWER_PCI_PM_MSK;
303
304 if (cfg(priv)->base_params->shadow_reg_enable)
305 cmd->flags |= IWL_POWER_SHADOW_REG_ENA;
306 else
307 cmd->flags &= ~IWL_POWER_SHADOW_REG_ENA;
308
309 if (iwl_advanced_bt_coexist(priv)) {
310 if (!cfg(priv)->bt_params->bt_sco_disable)
311 cmd->flags |= IWL_POWER_BT_SCO_ENA;
312 else
313 cmd->flags &= ~IWL_POWER_BT_SCO_ENA;
314 }
315
316 cmd->rx_data_timeout = cpu_to_le32(1000 * dynps_ms);
317 cmd->tx_data_timeout = cpu_to_le32(1000 * dynps_ms);
318
319 for (i = 0; i < IWL_POWER_VEC_SIZE; i++)
320 cmd->sleep_interval[i] =
321 cpu_to_le32(min_t(int, slp_succ[i], wakeup_period));
322
323 IWL_DEBUG_POWER(priv, "Automatic sleep command\n");
324}
325
326static int iwl_set_power(struct iwl_priv *priv, struct iwl_powertable_cmd *cmd) 271static int iwl_set_power(struct iwl_priv *priv, struct iwl_powertable_cmd *cmd)
327{ 272{
328 IWL_DEBUG_POWER(priv, "Sending power/sleep command\n"); 273 IWL_DEBUG_POWER(priv, "Sending power/sleep command\n");
@@ -363,7 +308,7 @@ static void iwl_power_build_cmd(struct iwl_priv *priv,
363 iwl_static_sleep_cmd(priv, cmd, 308 iwl_static_sleep_cmd(priv, cmd,
364 priv->power_data.debug_sleep_level_override, 309 priv->power_data.debug_sleep_level_override,
365 dtimper); 310 dtimper);
366 else if (iwlagn_mod_params.no_sleep_autoadjust) { 311 else {
367 if (iwlagn_mod_params.power_level > IWL_POWER_INDEX_1 && 312 if (iwlagn_mod_params.power_level > IWL_POWER_INDEX_1 &&
368 iwlagn_mod_params.power_level <= IWL_POWER_INDEX_5) 313 iwlagn_mod_params.power_level <= IWL_POWER_INDEX_5)
369 iwl_static_sleep_cmd(priv, cmd, 314 iwl_static_sleep_cmd(priv, cmd,
@@ -371,10 +316,7 @@ static void iwl_power_build_cmd(struct iwl_priv *priv,
371 else 316 else
372 iwl_static_sleep_cmd(priv, cmd, 317 iwl_static_sleep_cmd(priv, cmd,
373 IWL_POWER_INDEX_1, dtimper); 318 IWL_POWER_INDEX_1, dtimper);
374 } else 319 }
375 iwl_power_fill_sleep_cmd(priv, cmd,
376 priv->hw->conf.dynamic_ps_timeout,
377 priv->hw->conf.max_sleep_period);
378} 320}
379 321
380int iwl_power_set_mode(struct iwl_priv *priv, struct iwl_powertable_cmd *cmd, 322int iwl_power_set_mode(struct iwl_priv *priv, struct iwl_powertable_cmd *cmd,
diff --git a/drivers/net/wireless/iwlwifi/iwl-shared.h b/drivers/net/wireless/iwlwifi/iwl-shared.h
index 4b764d7967ca..00543d90544c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-shared.h
+++ b/drivers/net/wireless/iwlwifi/iwl-shared.h
@@ -124,7 +124,6 @@ extern struct iwl_mod_params iwlagn_mod_params;
124 * @wd_disable: enable stuck queue check, default = 0 124 * @wd_disable: enable stuck queue check, default = 0
125 * @bt_coex_active: enable bt coex, default = true 125 * @bt_coex_active: enable bt coex, default = true
126 * @led_mode: system default, default = 0 126 * @led_mode: system default, default = 0
127 * @no_sleep_autoadjust: disable autoadjust, default = true
128 * @power_save: disable power save, default = false 127 * @power_save: disable power save, default = false
129 * @power_level: power level, default = 1 128 * @power_level: power level, default = 1
130 * @debug_level: levels are IWL_DL_* 129 * @debug_level: levels are IWL_DL_*
@@ -143,7 +142,6 @@ struct iwl_mod_params {
143 int wd_disable; 142 int wd_disable;
144 bool bt_coex_active; 143 bool bt_coex_active;
145 int led_mode; 144 int led_mode;
146 bool no_sleep_autoadjust;
147 bool power_save; 145 bool power_save;
148 int power_level; 146 int power_level;
149 u32 debug_level; 147 u32 debug_level;