diff options
author | Vasanthakumar Thiagarajan <vasanth@atheros.com> | 2010-04-15 17:39:16 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-04-16 15:43:39 -0400 |
commit | 6c84ce08aaf5995afc7ff7b4c54069c2431fca87 (patch) | |
tree | 9530dd90d5dbc8b6a2d04ab3fbf96241c1de9643 | |
parent | 1547da37db9b56eb98eb0f33b84d49ab4e83e01e (diff) |
ath9k_hw: Fill get_isr() for AR9003
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_mac.c | 132 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_mac.h | 8 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/reg.h | 2 |
5 files changed, 146 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mac.c b/drivers/net/wireless/ath/ath9k/ar9003_mac.c index 15f1b0f0d070..2319456f2f0e 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c | |||
@@ -32,6 +32,138 @@ static void ar9003_hw_get_desc_link(void *ds, u32 **ds_link) | |||
32 | 32 | ||
33 | static bool ar9003_hw_get_isr(struct ath_hw *ah, enum ath9k_int *masked) | 33 | static bool ar9003_hw_get_isr(struct ath_hw *ah, enum ath9k_int *masked) |
34 | { | 34 | { |
35 | u32 isr = 0; | ||
36 | u32 mask2 = 0; | ||
37 | struct ath9k_hw_capabilities *pCap = &ah->caps; | ||
38 | u32 sync_cause = 0; | ||
39 | struct ath_common *common = ath9k_hw_common(ah); | ||
40 | |||
41 | if (REG_READ(ah, AR_INTR_ASYNC_CAUSE) & AR_INTR_MAC_IRQ) { | ||
42 | if ((REG_READ(ah, AR_RTC_STATUS) & AR_RTC_STATUS_M) | ||
43 | == AR_RTC_STATUS_ON) | ||
44 | isr = REG_READ(ah, AR_ISR); | ||
45 | } | ||
46 | |||
47 | sync_cause = REG_READ(ah, AR_INTR_SYNC_CAUSE) & AR_INTR_SYNC_DEFAULT; | ||
48 | |||
49 | *masked = 0; | ||
50 | |||
51 | if (!isr && !sync_cause) | ||
52 | return false; | ||
53 | |||
54 | if (isr) { | ||
55 | if (isr & AR_ISR_BCNMISC) { | ||
56 | u32 isr2; | ||
57 | isr2 = REG_READ(ah, AR_ISR_S2); | ||
58 | |||
59 | mask2 |= ((isr2 & AR_ISR_S2_TIM) >> | ||
60 | MAP_ISR_S2_TIM); | ||
61 | mask2 |= ((isr2 & AR_ISR_S2_DTIM) >> | ||
62 | MAP_ISR_S2_DTIM); | ||
63 | mask2 |= ((isr2 & AR_ISR_S2_DTIMSYNC) >> | ||
64 | MAP_ISR_S2_DTIMSYNC); | ||
65 | mask2 |= ((isr2 & AR_ISR_S2_CABEND) >> | ||
66 | MAP_ISR_S2_CABEND); | ||
67 | mask2 |= ((isr2 & AR_ISR_S2_GTT) << | ||
68 | MAP_ISR_S2_GTT); | ||
69 | mask2 |= ((isr2 & AR_ISR_S2_CST) << | ||
70 | MAP_ISR_S2_CST); | ||
71 | mask2 |= ((isr2 & AR_ISR_S2_TSFOOR) >> | ||
72 | MAP_ISR_S2_TSFOOR); | ||
73 | |||
74 | if (!(pCap->hw_caps & ATH9K_HW_CAP_RAC_SUPPORTED)) { | ||
75 | REG_WRITE(ah, AR_ISR_S2, isr2); | ||
76 | isr &= ~AR_ISR_BCNMISC; | ||
77 | } | ||
78 | } | ||
79 | |||
80 | if ((pCap->hw_caps & ATH9K_HW_CAP_RAC_SUPPORTED)) | ||
81 | isr = REG_READ(ah, AR_ISR_RAC); | ||
82 | |||
83 | if (isr == 0xffffffff) { | ||
84 | *masked = 0; | ||
85 | return false; | ||
86 | } | ||
87 | |||
88 | *masked = isr & ATH9K_INT_COMMON; | ||
89 | |||
90 | if (ah->config.rx_intr_mitigation) | ||
91 | if (isr & (AR_ISR_RXMINTR | AR_ISR_RXINTM)) | ||
92 | *masked |= ATH9K_INT_RXLP; | ||
93 | |||
94 | if (ah->config.tx_intr_mitigation) | ||
95 | if (isr & (AR_ISR_TXMINTR | AR_ISR_TXINTM)) | ||
96 | *masked |= ATH9K_INT_TX; | ||
97 | |||
98 | if (isr & (AR_ISR_LP_RXOK | AR_ISR_RXERR)) | ||
99 | *masked |= ATH9K_INT_RXLP; | ||
100 | |||
101 | if (isr & AR_ISR_HP_RXOK) | ||
102 | *masked |= ATH9K_INT_RXHP; | ||
103 | |||
104 | if (isr & (AR_ISR_TXOK | AR_ISR_TXERR | AR_ISR_TXEOL)) { | ||
105 | *masked |= ATH9K_INT_TX; | ||
106 | |||
107 | if (!(pCap->hw_caps & ATH9K_HW_CAP_RAC_SUPPORTED)) { | ||
108 | u32 s0, s1; | ||
109 | s0 = REG_READ(ah, AR_ISR_S0); | ||
110 | REG_WRITE(ah, AR_ISR_S0, s0); | ||
111 | s1 = REG_READ(ah, AR_ISR_S1); | ||
112 | REG_WRITE(ah, AR_ISR_S1, s1); | ||
113 | |||
114 | isr &= ~(AR_ISR_TXOK | AR_ISR_TXERR | | ||
115 | AR_ISR_TXEOL); | ||
116 | } | ||
117 | } | ||
118 | |||
119 | if (isr & AR_ISR_GENTMR) { | ||
120 | u32 s5; | ||
121 | |||
122 | if (pCap->hw_caps & ATH9K_HW_CAP_RAC_SUPPORTED) | ||
123 | s5 = REG_READ(ah, AR_ISR_S5_S); | ||
124 | else | ||
125 | s5 = REG_READ(ah, AR_ISR_S5); | ||
126 | |||
127 | ah->intr_gen_timer_trigger = | ||
128 | MS(s5, AR_ISR_S5_GENTIMER_TRIG); | ||
129 | |||
130 | ah->intr_gen_timer_thresh = | ||
131 | MS(s5, AR_ISR_S5_GENTIMER_THRESH); | ||
132 | |||
133 | if (ah->intr_gen_timer_trigger) | ||
134 | *masked |= ATH9K_INT_GENTIMER; | ||
135 | |||
136 | if (!(pCap->hw_caps & ATH9K_HW_CAP_RAC_SUPPORTED)) { | ||
137 | REG_WRITE(ah, AR_ISR_S5, s5); | ||
138 | isr &= ~AR_ISR_GENTMR; | ||
139 | } | ||
140 | |||
141 | } | ||
142 | |||
143 | *masked |= mask2; | ||
144 | |||
145 | if (!(pCap->hw_caps & ATH9K_HW_CAP_RAC_SUPPORTED)) { | ||
146 | REG_WRITE(ah, AR_ISR, isr); | ||
147 | |||
148 | (void) REG_READ(ah, AR_ISR); | ||
149 | } | ||
150 | } | ||
151 | |||
152 | if (sync_cause) { | ||
153 | if (sync_cause & AR_INTR_SYNC_RADM_CPL_TIMEOUT) { | ||
154 | REG_WRITE(ah, AR_RC, AR_RC_HOSTIF); | ||
155 | REG_WRITE(ah, AR_RC, 0); | ||
156 | *masked |= ATH9K_INT_FATAL; | ||
157 | } | ||
158 | |||
159 | if (sync_cause & AR_INTR_SYNC_LOCAL_TIMEOUT) | ||
160 | ath_print(common, ATH_DBG_INTERRUPT, | ||
161 | "AR_INTR_SYNC_LOCAL_TIMEOUT\n"); | ||
162 | |||
163 | REG_WRITE(ah, AR_INTR_SYNC_CAUSE_CLR, sync_cause); | ||
164 | (void) REG_READ(ah, AR_INTR_SYNC_CAUSE_CLR); | ||
165 | |||
166 | } | ||
35 | return true; | 167 | return true; |
36 | } | 168 | } |
37 | 169 | ||
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mac.h b/drivers/net/wireless/ath/ath9k/ar9003_mac.h index 7374439a836c..2ba06d7674e8 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_mac.h +++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.h | |||
@@ -22,6 +22,14 @@ | |||
22 | #define AR_CtrlStat 0x00004000 | 22 | #define AR_CtrlStat 0x00004000 |
23 | #define AR_TxRxDesc 0x00008000 | 23 | #define AR_TxRxDesc 0x00008000 |
24 | 24 | ||
25 | #define MAP_ISR_S2_CST 6 | ||
26 | #define MAP_ISR_S2_GTT 6 | ||
27 | #define MAP_ISR_S2_TIM 3 | ||
28 | #define MAP_ISR_S2_CABEND 0 | ||
29 | #define MAP_ISR_S2_DTIMSYNC 7 | ||
30 | #define MAP_ISR_S2_DTIM 7 | ||
31 | #define MAP_ISR_S2_TSFOOR 4 | ||
32 | |||
25 | struct ar9003_rxs { | 33 | struct ar9003_rxs { |
26 | u32 ds_info; | 34 | u32 ds_info; |
27 | u32 status1; | 35 | u32 status1; |
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 01706d9cfc56..2a04251d6063 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -2145,6 +2145,9 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah) | |||
2145 | pCap->tx_desc_len = sizeof(struct ath_desc); | 2145 | pCap->tx_desc_len = sizeof(struct ath_desc); |
2146 | } | 2146 | } |
2147 | 2147 | ||
2148 | if (AR_SREV_9300_20_OR_LATER(ah)) | ||
2149 | pCap->hw_caps |= ATH9K_HW_CAP_RAC_SUPPORTED; | ||
2150 | |||
2148 | return 0; | 2151 | return 0; |
2149 | } | 2152 | } |
2150 | 2153 | ||
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index 25713beb8e71..fcf78424bfab 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h | |||
@@ -179,6 +179,7 @@ enum ath9k_hw_caps { | |||
179 | ATH9K_HW_CAP_AUTOSLEEP = BIT(15), | 179 | ATH9K_HW_CAP_AUTOSLEEP = BIT(15), |
180 | ATH9K_HW_CAP_4KB_SPLITTRANS = BIT(16), | 180 | ATH9K_HW_CAP_4KB_SPLITTRANS = BIT(16), |
181 | ATH9K_HW_CAP_EDMA = BIT(17), | 181 | ATH9K_HW_CAP_EDMA = BIT(17), |
182 | ATH9K_HW_CAP_RAC_SUPPORTED = BIT(18), | ||
182 | }; | 183 | }; |
183 | 184 | ||
184 | enum ath9k_capability_type { | 185 | enum ath9k_capability_type { |
diff --git a/drivers/net/wireless/ath/ath9k/reg.h b/drivers/net/wireless/ath/ath9k/reg.h index 12de95ea7631..12f16215c588 100644 --- a/drivers/net/wireless/ath/ath9k/reg.h +++ b/drivers/net/wireless/ath/ath9k/reg.h | |||
@@ -169,6 +169,8 @@ | |||
169 | #define AR_ISR 0x0080 | 169 | #define AR_ISR 0x0080 |
170 | #define AR_ISR_RXOK 0x00000001 | 170 | #define AR_ISR_RXOK 0x00000001 |
171 | #define AR_ISR_RXDESC 0x00000002 | 171 | #define AR_ISR_RXDESC 0x00000002 |
172 | #define AR_ISR_HP_RXOK 0x00000001 | ||
173 | #define AR_ISR_LP_RXOK 0x00000002 | ||
172 | #define AR_ISR_RXERR 0x00000004 | 174 | #define AR_ISR_RXERR 0x00000004 |
173 | #define AR_ISR_RXNOPKT 0x00000008 | 175 | #define AR_ISR_RXNOPKT 0x00000008 |
174 | #define AR_ISR_RXEOL 0x00000010 | 176 | #define AR_ISR_RXEOL 0x00000010 |