aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.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-pcie-int.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-pcie-int.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h
index a1fc439aafd0..731d2750439c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h
+++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h
@@ -34,6 +34,7 @@
34#include <linux/skbuff.h> 34#include <linux/skbuff.h>
35#include <linux/wait.h> 35#include <linux/wait.h>
36#include <linux/pci.h> 36#include <linux/pci.h>
37#include <linux/timer.h>
37 38
38#include "iwl-fh.h" 39#include "iwl-fh.h"
39#include "iwl-csr.h" 40#include "iwl-csr.h"
@@ -204,7 +205,8 @@ struct iwl_tx_queue {
204 struct iwl_cmd_meta *meta; 205 struct iwl_cmd_meta *meta;
205 struct sk_buff **skbs; 206 struct sk_buff **skbs;
206 spinlock_t lock; 207 spinlock_t lock;
207 unsigned long time_stamp; 208 struct timer_list stuck_timer;
209 struct iwl_trans_pcie *trans_pcie;
208 u8 need_update; 210 u8 need_update;
209 u8 active; 211 u8 active;
210}; 212};
@@ -227,6 +229,7 @@ struct iwl_tx_queue {
227 * @cmd_queue - command queue number 229 * @cmd_queue - command queue number
228 * @rx_buf_size_8k: 8 kB RX buffer size 230 * @rx_buf_size_8k: 8 kB RX buffer size
229 * @rx_page_order: page order for receive buffer size 231 * @rx_page_order: page order for receive buffer size
232 * @wd_timeout: queue watchdog timeout (jiffies)
230 */ 233 */
231struct iwl_trans_pcie { 234struct iwl_trans_pcie {
232 struct iwl_rx_queue rxq; 235 struct iwl_rx_queue rxq;
@@ -269,11 +272,22 @@ struct iwl_trans_pcie {
269 272
270 bool rx_buf_size_8k; 273 bool rx_buf_size_8k;
271 u32 rx_page_order; 274 u32 rx_page_order;
275
276
277 /* queue watchdog */
278 unsigned long wd_timeout;
272}; 279};
273 280
274#define IWL_TRANS_GET_PCIE_TRANS(_iwl_trans) \ 281#define IWL_TRANS_GET_PCIE_TRANS(_iwl_trans) \
275 ((struct iwl_trans_pcie *) ((_iwl_trans)->trans_specific)) 282 ((struct iwl_trans_pcie *) ((_iwl_trans)->trans_specific))
276 283
284static inline struct iwl_trans *
285iwl_trans_pcie_get_trans(struct iwl_trans_pcie *trans_pcie)
286{
287 return container_of((void *)trans_pcie, struct iwl_trans,
288 trans_specific);
289}
290
277/***************************************************** 291/*****************************************************
278* RX 292* RX
279******************************************************/ 293******************************************************/