aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-trans.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-04-09 20:46:54 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-04-12 15:06:08 -0400
commit7c5ba4a830cbb730770129b0004e2a06e47dbac5 (patch)
tree3c86c616dbe30b31cd07d9d8720092932f84d05b /drivers/net/wireless/iwlwifi/iwl-trans.h
parent52bcbff762a4cfedf97c46a58ec9890464212420 (diff)
iwlwifi: move queue watchdog into transport
This removes one of the two sources of device restarts in the upper layer -- those are a bit inconvenient because normal restarts originate in the transport. By moving the watchdog down it can be treated the same. Also rewrite the watchdog logic. Timers are much more efficient when they never fire, so instead firing a timer every 500ms set up a timer for each TX queue and fire it only when the queue is really stuck. This avoids the CPU waking up when everything is working well. While at it, remove the wd_disable config item and replace it by simply setting wd_timeout to IWL_WATCHHDOG_DISABLED (0). Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-trans.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h
index 46be59f5ef39..a6598a29ef59 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans.h
+++ b/drivers/net/wireless/iwlwifi/iwl-trans.h
@@ -307,6 +307,8 @@ static inline struct page *rxb_steal_page(struct iwl_rx_cmd_buffer *r)
307 * @n_no_reclaim_cmds: # of commands in list 307 * @n_no_reclaim_cmds: # of commands in list
308 * @rx_buf_size_8k: 8 kB RX buffer size needed for A-MSDUs, 308 * @rx_buf_size_8k: 8 kB RX buffer size needed for A-MSDUs,
309 * if unset 4k will be the RX buffer size 309 * if unset 4k will be the RX buffer size
310 * @queue_watchdog_timeout: time (in ms) after which queues
311 * are considered stuck and will trigger device restart
310 */ 312 */
311struct iwl_trans_config { 313struct iwl_trans_config {
312 struct iwl_op_mode *op_mode; 314 struct iwl_op_mode *op_mode;
@@ -318,6 +320,7 @@ struct iwl_trans_config {
318 int n_no_reclaim_cmds; 320 int n_no_reclaim_cmds;
319 321
320 bool rx_buf_size_8k; 322 bool rx_buf_size_8k;
323 unsigned int queue_watchdog_timeout;
321}; 324};
322 325
323/** 326/**
@@ -355,7 +358,6 @@ struct iwl_trans_config {
355 * irq, tasklet etc... From this point on, the device may not issue 358 * irq, tasklet etc... From this point on, the device may not issue
356 * any interrupt (incl. RFKILL). 359 * any interrupt (incl. RFKILL).
357 * May sleep 360 * May sleep
358 * @check_stuck_queue: check if a specific queue is stuck
359 * @wait_tx_queue_empty: wait until all tx queues are empty 361 * @wait_tx_queue_empty: wait until all tx queues are empty
360 * May sleep 362 * May sleep
361 * @dbgfs_register: add the dbgfs files under this directory. Files will be 363 * @dbgfs_register: add the dbgfs files under this directory. Files will be
@@ -394,7 +396,6 @@ struct iwl_trans_ops {
394 void (*free)(struct iwl_trans *trans); 396 void (*free)(struct iwl_trans *trans);
395 397
396 int (*dbgfs_register)(struct iwl_trans *trans, struct dentry* dir); 398 int (*dbgfs_register)(struct iwl_trans *trans, struct dentry* dir);
397 int (*check_stuck_queue)(struct iwl_trans *trans, int q);
398 int (*wait_tx_queue_empty)(struct iwl_trans *trans); 399 int (*wait_tx_queue_empty)(struct iwl_trans *trans);
399#ifdef CONFIG_PM_SLEEP 400#ifdef CONFIG_PM_SLEEP
400 int (*suspend)(struct iwl_trans *trans); 401 int (*suspend)(struct iwl_trans *trans);
@@ -577,13 +578,6 @@ static inline int iwl_trans_wait_tx_queue_empty(struct iwl_trans *trans)
577 return trans->ops->wait_tx_queue_empty(trans); 578 return trans->ops->wait_tx_queue_empty(trans);
578} 579}
579 580
580static inline int iwl_trans_check_stuck_queue(struct iwl_trans *trans, int q)
581{
582 WARN_ONCE(trans->state != IWL_TRANS_FW_ALIVE,
583 "%s bad state = %d", __func__, trans->state);
584
585 return trans->ops->check_stuck_queue(trans, q);
586}
587static inline int iwl_trans_dbgfs_register(struct iwl_trans *trans, 581static inline int iwl_trans_dbgfs_register(struct iwl_trans *trans,
588 struct dentry *dir) 582 struct dentry *dir)
589{ 583{