diff options
| author | Maya Erez <qca_merez@qca.qualcomm.com> | 2016-04-26 07:41:40 -0400 |
|---|---|---|
| committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2016-04-26 07:57:45 -0400 |
| commit | 54eaa8c69e72dca4c824cd390b616cb48b2c4e30 (patch) | |
| tree | fe5a9a2d30442a30ccac16c23db2e9d75755ccf3 /drivers/net | |
| parent | d8ed043accdee611bce8be7c4224b4e26bdc2ab5 (diff) | |
wil6210: unmask RX_HTRSH interrupt only when connected
RX_HTRSH interrupt sometimes triggered during device reset
procedure.
To prevent handling this interrupt when not required, unmask
this interrupt only if we are connected and mask it when
disconnected.
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net')
| -rw-r--r-- | drivers/net/wireless/ath/wil6210/interrupt.c | 6 | ||||
| -rw-r--r-- | drivers/net/wireless/ath/wil6210/main.c | 17 |
2 files changed, 22 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/wil6210/interrupt.c b/drivers/net/wireless/ath/wil6210/interrupt.c index 6897754f2722..22592f338c1e 100644 --- a/drivers/net/wireless/ath/wil6210/interrupt.c +++ b/drivers/net/wireless/ath/wil6210/interrupt.c | |||
| @@ -38,6 +38,8 @@ | |||
| 38 | #define WIL6210_IRQ_DISABLE (0xFFFFFFFFUL) | 38 | #define WIL6210_IRQ_DISABLE (0xFFFFFFFFUL) |
| 39 | #define WIL6210_IMC_RX (BIT_DMA_EP_RX_ICR_RX_DONE | \ | 39 | #define WIL6210_IMC_RX (BIT_DMA_EP_RX_ICR_RX_DONE | \ |
| 40 | BIT_DMA_EP_RX_ICR_RX_HTRSH) | 40 | BIT_DMA_EP_RX_ICR_RX_HTRSH) |
| 41 | #define WIL6210_IMC_RX_NO_RX_HTRSH (WIL6210_IMC_RX & \ | ||
| 42 | (~(BIT_DMA_EP_RX_ICR_RX_HTRSH))) | ||
| 41 | #define WIL6210_IMC_TX (BIT_DMA_EP_TX_ICR_TX_DONE | \ | 43 | #define WIL6210_IMC_TX (BIT_DMA_EP_TX_ICR_TX_DONE | \ |
| 42 | BIT_DMA_EP_TX_ICR_TX_DONE_N(0)) | 44 | BIT_DMA_EP_TX_ICR_TX_DONE_N(0)) |
| 43 | #define WIL6210_IMC_MISC (ISR_MISC_FW_READY | \ | 45 | #define WIL6210_IMC_MISC (ISR_MISC_FW_READY | \ |
| @@ -109,8 +111,10 @@ void wil6210_unmask_irq_tx(struct wil6210_priv *wil) | |||
| 109 | 111 | ||
| 110 | void wil6210_unmask_irq_rx(struct wil6210_priv *wil) | 112 | void wil6210_unmask_irq_rx(struct wil6210_priv *wil) |
| 111 | { | 113 | { |
| 114 | bool unmask_rx_htrsh = test_bit(wil_status_fwconnected, wil->status); | ||
| 115 | |||
| 112 | wil_w(wil, RGF_DMA_EP_RX_ICR + offsetof(struct RGF_ICR, IMC), | 116 | wil_w(wil, RGF_DMA_EP_RX_ICR + offsetof(struct RGF_ICR, IMC), |
| 113 | WIL6210_IMC_RX); | 117 | unmask_rx_htrsh ? WIL6210_IMC_RX : WIL6210_IMC_RX_NO_RX_HTRSH); |
| 114 | } | 118 | } |
| 115 | 119 | ||
| 116 | static void wil6210_unmask_irq_misc(struct wil6210_priv *wil) | 120 | static void wil6210_unmask_irq_misc(struct wil6210_priv *wil) |
diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wil6210/main.c index 8d4e8843004e..261bdabccc83 100644 --- a/drivers/net/wireless/ath/wil6210/main.c +++ b/drivers/net/wireless/ath/wil6210/main.c | |||
| @@ -194,6 +194,18 @@ __acquires(&sta->tid_rx_lock) __releases(&sta->tid_rx_lock) | |||
| 194 | memset(&sta->stats, 0, sizeof(sta->stats)); | 194 | memset(&sta->stats, 0, sizeof(sta->stats)); |
| 195 | } | 195 | } |
| 196 | 196 | ||
| 197 | static bool wil_ap_is_connected(struct wil6210_priv *wil) | ||
| 198 | { | ||
| 199 | int i; | ||
| 200 | |||
| 201 | for (i = 0; i < ARRAY_SIZE(wil->sta); i++) { | ||
| 202 | if (wil->sta[i].status == wil_sta_connected) | ||
| 203 | return true; | ||
| 204 | } | ||
| 205 | |||
| 206 | return false; | ||
| 207 | } | ||
| 208 | |||
| 197 | static void _wil6210_disconnect(struct wil6210_priv *wil, const u8 *bssid, | 209 | static void _wil6210_disconnect(struct wil6210_priv *wil, const u8 *bssid, |
| 198 | u16 reason_code, bool from_event) | 210 | u16 reason_code, bool from_event) |
| 199 | { | 211 | { |
| @@ -247,6 +259,11 @@ static void _wil6210_disconnect(struct wil6210_priv *wil, const u8 *bssid, | |||
| 247 | } | 259 | } |
| 248 | clear_bit(wil_status_fwconnecting, wil->status); | 260 | clear_bit(wil_status_fwconnecting, wil->status); |
| 249 | break; | 261 | break; |
| 262 | case NL80211_IFTYPE_AP: | ||
| 263 | case NL80211_IFTYPE_P2P_GO: | ||
| 264 | if (!wil_ap_is_connected(wil)) | ||
| 265 | clear_bit(wil_status_fwconnected, wil->status); | ||
| 266 | break; | ||
| 250 | default: | 267 | default: |
| 251 | break; | 268 | break; |
| 252 | } | 269 | } |
