diff options
author | Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> | 2014-12-23 02:47:19 -0500 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2015-01-15 07:31:38 -0500 |
commit | 78366f69beb604717a12191eee35300057b6bcfc (patch) | |
tree | 968f841cbfecd728d3ac5de7f0451ad3c074b8fc /drivers/net/wireless/ath/wil6210/wil6210.h | |
parent | 1aeda13be061d005b4b84c2a974bf11d0b8675ad (diff) |
wil6210: add advanced interrupt moderation
Add advanced interrupt moderation support available since "Sparrow B0".
Legacy interrupt moderation used only one counter to moderate tx, rx,
and misc interrupts.
Advanced interrupt moderation bypasses misc, and handles separately tx
and rx interrupts. In addition it has two timers for each interrupt type.
Max burst duration timer which defines how long to postpone interrupt after
first event (receive event for rx and tx complete event for tx), and
interframe timeout which defines how to determine the end of the burst and
issue interrupt even if the first timer still pending.
Capabilities flags in wil_priv is set on initialization according to
HW. The rest of the code checks for advanced interrupt capability bit
in capabilities flags field.
Debugfs is split accordingly: "legacy" interrupt moderation remains
unchanged, new debugs files added for advanced interrupt moderation
support.
Module params are aligned to support advanced interrupt moderation
(tx & rx). When not available (for legacy interrupt moderation) will
use only rx configuration; Tx configuration will be ignored in this
case.
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ath/wil6210/wil6210.h')
-rw-r--r-- | drivers/net/wireless/ath/wil6210/wil6210.h | 56 |
1 files changed, 52 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath/wil6210/wil6210.h b/drivers/net/wireless/ath/wil6210/wil6210.h index 8a52a5ffd6b1..a6d63c157b2f 100644 --- a/drivers/net/wireless/ath/wil6210/wil6210.h +++ b/drivers/net/wireless/ath/wil6210/wil6210.h | |||
@@ -76,7 +76,10 @@ static inline u32 wil_mtu2macbuf(u32 mtu) | |||
76 | #define WIL_MAX_ETH_MTU (IEEE80211_MAX_DATA_LEN_DMG - 8) | 76 | #define WIL_MAX_ETH_MTU (IEEE80211_MAX_DATA_LEN_DMG - 8) |
77 | /* Max supported by wil6210 value for interrupt threshold is 5sec. */ | 77 | /* Max supported by wil6210 value for interrupt threshold is 5sec. */ |
78 | #define WIL6210_ITR_TRSH_MAX (5000000) | 78 | #define WIL6210_ITR_TRSH_MAX (5000000) |
79 | #define WIL6210_ITR_TRSH_DEFAULT (300) /* usec */ | 79 | #define WIL6210_ITR_TX_INTERFRAME_TIMEOUT_DEFAULT (15) /* usec */ |
80 | #define WIL6210_ITR_RX_INTERFRAME_TIMEOUT_DEFAULT (15) /* usec */ | ||
81 | #define WIL6210_ITR_TX_MAX_BURST_DURATION_DEFAULT (500) /* usec */ | ||
82 | #define WIL6210_ITR_RX_MAX_BURST_DURATION_DEFAULT (500) /* usec */ | ||
80 | #define WIL6210_FW_RECOVERY_RETRIES (5) /* try to recover this many times */ | 83 | #define WIL6210_FW_RECOVERY_RETRIES (5) /* try to recover this many times */ |
81 | #define WIL6210_FW_RECOVERY_TO msecs_to_jiffies(5000) | 84 | #define WIL6210_FW_RECOVERY_TO msecs_to_jiffies(5000) |
82 | #define WIL6210_SCAN_TO msecs_to_jiffies(10000) | 85 | #define WIL6210_SCAN_TO msecs_to_jiffies(10000) |
@@ -152,7 +155,7 @@ struct RGF_ICR { | |||
152 | #define BIT_DMA_EP_MISC_ICR_TX_NO_ACT BIT(1) | 155 | #define BIT_DMA_EP_MISC_ICR_TX_NO_ACT BIT(1) |
153 | #define BIT_DMA_EP_MISC_ICR_FW_INT(n) BIT(28+n) /* n = [0..3] */ | 156 | #define BIT_DMA_EP_MISC_ICR_FW_INT(n) BIT(28+n) /* n = [0..3] */ |
154 | 157 | ||
155 | /* Interrupt moderation control */ | 158 | /* Legacy interrupt moderation control (before Sparrow v2)*/ |
156 | #define RGF_DMA_ITR_CNT_TRSH (0x881c5c) | 159 | #define RGF_DMA_ITR_CNT_TRSH (0x881c5c) |
157 | #define RGF_DMA_ITR_CNT_DATA (0x881c60) | 160 | #define RGF_DMA_ITR_CNT_DATA (0x881c60) |
158 | #define RGF_DMA_ITR_CNT_CRL (0x881c64) | 161 | #define RGF_DMA_ITR_CNT_CRL (0x881c64) |
@@ -162,6 +165,46 @@ struct RGF_ICR { | |||
162 | #define BIT_DMA_ITR_CNT_CRL_CLR BIT(3) | 165 | #define BIT_DMA_ITR_CNT_CRL_CLR BIT(3) |
163 | #define BIT_DMA_ITR_CNT_CRL_REACH_TRSH BIT(4) | 166 | #define BIT_DMA_ITR_CNT_CRL_REACH_TRSH BIT(4) |
164 | 167 | ||
168 | /* New (sparrow v2+) interrupt moderation control */ | ||
169 | #define RGF_DMA_ITR_TX_DESQ_NO_MOD (0x881d40) | ||
170 | #define RGF_DMA_ITR_TX_CNT_TRSH (0x881d34) | ||
171 | #define RGF_DMA_ITR_TX_CNT_DATA (0x881d38) | ||
172 | #define RGF_DMA_ITR_TX_CNT_CTL (0x881d3c) | ||
173 | #define BIT_DMA_ITR_TX_CNT_CTL_EN BIT(0) | ||
174 | #define BIT_DMA_ITR_TX_CNT_CTL_EXT_TIC_SEL BIT(1) | ||
175 | #define BIT_DMA_ITR_TX_CNT_CTL_FOREVER BIT(2) | ||
176 | #define BIT_DMA_ITR_TX_CNT_CTL_CLR BIT(3) | ||
177 | #define BIT_DMA_ITR_TX_CNT_CTL_REACHED_TRESH BIT(4) | ||
178 | #define BIT_DMA_ITR_TX_CNT_CTL_CROSS_EN BIT(5) | ||
179 | #define BIT_DMA_ITR_TX_CNT_CTL_FREE_RUNNIG BIT(6) | ||
180 | #define RGF_DMA_ITR_TX_IDL_CNT_TRSH (0x881d60) | ||
181 | #define RGF_DMA_ITR_TX_IDL_CNT_DATA (0x881d64) | ||
182 | #define RGF_DMA_ITR_TX_IDL_CNT_CTL (0x881d68) | ||
183 | #define BIT_DMA_ITR_TX_IDL_CNT_CTL_EN BIT(0) | ||
184 | #define BIT_DMA_ITR_TX_IDL_CNT_CTL_EXT_TIC_SEL BIT(1) | ||
185 | #define BIT_DMA_ITR_TX_IDL_CNT_CTL_FOREVER BIT(2) | ||
186 | #define BIT_DMA_ITR_TX_IDL_CNT_CTL_CLR BIT(3) | ||
187 | #define BIT_DMA_ITR_TX_IDL_CNT_CTL_REACHED_TRESH BIT(4) | ||
188 | #define RGF_DMA_ITR_RX_DESQ_NO_MOD (0x881d50) | ||
189 | #define RGF_DMA_ITR_RX_CNT_TRSH (0x881d44) | ||
190 | #define RGF_DMA_ITR_RX_CNT_DATA (0x881d48) | ||
191 | #define RGF_DMA_ITR_RX_CNT_CTL (0x881d4c) | ||
192 | #define BIT_DMA_ITR_RX_CNT_CTL_EN BIT(0) | ||
193 | #define BIT_DMA_ITR_RX_CNT_CTL_EXT_TIC_SEL BIT(1) | ||
194 | #define BIT_DMA_ITR_RX_CNT_CTL_FOREVER BIT(2) | ||
195 | #define BIT_DMA_ITR_RX_CNT_CTL_CLR BIT(3) | ||
196 | #define BIT_DMA_ITR_RX_CNT_CTL_REACHED_TRESH BIT(4) | ||
197 | #define BIT_DMA_ITR_RX_CNT_CTL_CROSS_EN BIT(5) | ||
198 | #define BIT_DMA_ITR_RX_CNT_CTL_FREE_RUNNIG BIT(6) | ||
199 | #define RGF_DMA_ITR_RX_IDL_CNT_TRSH (0x881d54) | ||
200 | #define RGF_DMA_ITR_RX_IDL_CNT_DATA (0x881d58) | ||
201 | #define RGF_DMA_ITR_RX_IDL_CNT_CTL (0x881d5c) | ||
202 | #define BIT_DMA_ITR_RX_IDL_CNT_CTL_EN BIT(0) | ||
203 | #define BIT_DMA_ITR_RX_IDL_CNT_CTL_EXT_TIC_SEL BIT(1) | ||
204 | #define BIT_DMA_ITR_RX_IDL_CNT_CTL_FOREVER BIT(2) | ||
205 | #define BIT_DMA_ITR_RX_IDL_CNT_CTL_CLR BIT(3) | ||
206 | #define BIT_DMA_ITR_RX_IDL_CNT_CTL_REACHED_TRESH BIT(4) | ||
207 | |||
165 | #define RGF_DMA_PSEUDO_CAUSE (0x881c68) | 208 | #define RGF_DMA_PSEUDO_CAUSE (0x881c68) |
166 | #define RGF_DMA_PSEUDO_CAUSE_MASK_SW (0x881c6c) | 209 | #define RGF_DMA_PSEUDO_CAUSE_MASK_SW (0x881c6c) |
167 | #define RGF_DMA_PSEUDO_CAUSE_MASK_FW (0x881c70) | 210 | #define RGF_DMA_PSEUDO_CAUSE_MASK_FW (0x881c70) |
@@ -435,6 +478,7 @@ enum { | |||
435 | 478 | ||
436 | enum { | 479 | enum { |
437 | hw_capability_reset_v2 = 0, | 480 | hw_capability_reset_v2 = 0, |
481 | hw_capability_advanced_itr_moderation = 1, | ||
438 | hw_capability_last | 482 | hw_capability_last |
439 | }; | 483 | }; |
440 | 484 | ||
@@ -475,7 +519,11 @@ struct wil6210_priv { | |||
475 | u32 monitor_flags; | 519 | u32 monitor_flags; |
476 | u32 secure_pcp; /* create secure PCP? */ | 520 | u32 secure_pcp; /* create secure PCP? */ |
477 | int sinfo_gen; | 521 | int sinfo_gen; |
478 | u32 itr_trsh; | 522 | /* interrupt moderation */ |
523 | u32 tx_max_burst_duration; | ||
524 | u32 tx_interframe_timeout; | ||
525 | u32 rx_max_burst_duration; | ||
526 | u32 rx_interframe_timeout; | ||
479 | /* cached ISR registers */ | 527 | /* cached ISR registers */ |
480 | u32 isr_misc; | 528 | u32 isr_misc; |
481 | /* mailbox related */ | 529 | /* mailbox related */ |
@@ -596,7 +644,6 @@ void wil_if_remove(struct wil6210_priv *wil); | |||
596 | int wil_priv_init(struct wil6210_priv *wil); | 644 | int wil_priv_init(struct wil6210_priv *wil); |
597 | void wil_priv_deinit(struct wil6210_priv *wil); | 645 | void wil_priv_deinit(struct wil6210_priv *wil); |
598 | int wil_reset(struct wil6210_priv *wil); | 646 | int wil_reset(struct wil6210_priv *wil); |
599 | void wil_set_itr_trsh(struct wil6210_priv *wil); | ||
600 | void wil_fw_error_recovery(struct wil6210_priv *wil); | 647 | void wil_fw_error_recovery(struct wil6210_priv *wil); |
601 | void wil_set_recovery_state(struct wil6210_priv *wil, int state); | 648 | void wil_set_recovery_state(struct wil6210_priv *wil, int state); |
602 | void wil_link_on(struct wil6210_priv *wil); | 649 | void wil_link_on(struct wil6210_priv *wil); |
@@ -653,6 +700,7 @@ int wil6210_init_irq(struct wil6210_priv *wil, int irq); | |||
653 | void wil6210_fini_irq(struct wil6210_priv *wil, int irq); | 700 | void wil6210_fini_irq(struct wil6210_priv *wil, int irq); |
654 | void wil_mask_irq(struct wil6210_priv *wil); | 701 | void wil_mask_irq(struct wil6210_priv *wil); |
655 | void wil_unmask_irq(struct wil6210_priv *wil); | 702 | void wil_unmask_irq(struct wil6210_priv *wil); |
703 | void wil_configure_interrupt_moderation(struct wil6210_priv *wil); | ||
656 | void wil_disable_irq(struct wil6210_priv *wil); | 704 | void wil_disable_irq(struct wil6210_priv *wil); |
657 | void wil_enable_irq(struct wil6210_priv *wil); | 705 | void wil_enable_irq(struct wil6210_priv *wil); |
658 | int wil_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, | 706 | int wil_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, |