diff options
author | Felix Fietkau <nbd@openwrt.org> | 2010-04-15 17:38:48 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-04-16 15:43:26 -0400 |
commit | b5c80475abaad015699384ca64ef8229fdd88758 (patch) | |
tree | 68323f0a04427973085153304167678681f5459b /drivers/net/wireless/ath/ath9k/main.c | |
parent | c38d4d2eb988717f7a8be24faeada648b5dac52a (diff) |
ath9k: Add Rx EDMA support
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/main.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/main.c | 40 |
1 files changed, 34 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 494456cd1daa..92f6fdc30076 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -401,6 +401,7 @@ void ath9k_tasklet(unsigned long data) | |||
401 | struct ath_common *common = ath9k_hw_common(ah); | 401 | struct ath_common *common = ath9k_hw_common(ah); |
402 | 402 | ||
403 | u32 status = sc->intrstatus; | 403 | u32 status = sc->intrstatus; |
404 | u32 rxmask; | ||
404 | 405 | ||
405 | ath9k_ps_wakeup(sc); | 406 | ath9k_ps_wakeup(sc); |
406 | 407 | ||
@@ -410,9 +411,21 @@ void ath9k_tasklet(unsigned long data) | |||
410 | return; | 411 | return; |
411 | } | 412 | } |
412 | 413 | ||
413 | if (status & (ATH9K_INT_RX | ATH9K_INT_RXEOL | ATH9K_INT_RXORN)) { | 414 | if (ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) |
415 | rxmask = (ATH9K_INT_RXHP | ATH9K_INT_RXLP | ATH9K_INT_RXEOL | | ||
416 | ATH9K_INT_RXORN); | ||
417 | else | ||
418 | rxmask = (ATH9K_INT_RX | ATH9K_INT_RXEOL | ATH9K_INT_RXORN); | ||
419 | |||
420 | if (status & rxmask) { | ||
414 | spin_lock_bh(&sc->rx.rxflushlock); | 421 | spin_lock_bh(&sc->rx.rxflushlock); |
415 | ath_rx_tasklet(sc, 0); | 422 | |
423 | /* Check for high priority Rx first */ | ||
424 | if ((ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) && | ||
425 | (status & ATH9K_INT_RXHP)) | ||
426 | ath_rx_tasklet(sc, 0, true); | ||
427 | |||
428 | ath_rx_tasklet(sc, 0, false); | ||
416 | spin_unlock_bh(&sc->rx.rxflushlock); | 429 | spin_unlock_bh(&sc->rx.rxflushlock); |
417 | } | 430 | } |
418 | 431 | ||
@@ -445,6 +458,8 @@ irqreturn_t ath_isr(int irq, void *dev) | |||
445 | ATH9K_INT_RXORN | \ | 458 | ATH9K_INT_RXORN | \ |
446 | ATH9K_INT_RXEOL | \ | 459 | ATH9K_INT_RXEOL | \ |
447 | ATH9K_INT_RX | \ | 460 | ATH9K_INT_RX | \ |
461 | ATH9K_INT_RXLP | \ | ||
462 | ATH9K_INT_RXHP | \ | ||
448 | ATH9K_INT_TX | \ | 463 | ATH9K_INT_TX | \ |
449 | ATH9K_INT_BMISS | \ | 464 | ATH9K_INT_BMISS | \ |
450 | ATH9K_INT_CST | \ | 465 | ATH9K_INT_CST | \ |
@@ -496,7 +511,8 @@ irqreturn_t ath_isr(int irq, void *dev) | |||
496 | * If a FATAL or RXORN interrupt is received, we have to reset the | 511 | * If a FATAL or RXORN interrupt is received, we have to reset the |
497 | * chip immediately. | 512 | * chip immediately. |
498 | */ | 513 | */ |
499 | if (status & (ATH9K_INT_FATAL | ATH9K_INT_RXORN)) | 514 | if ((status & ATH9K_INT_FATAL) || ((status & ATH9K_INT_RXORN) && |
515 | !(ah->caps.hw_caps & ATH9K_HW_CAP_EDMA))) | ||
500 | goto chip_reset; | 516 | goto chip_reset; |
501 | 517 | ||
502 | if (status & ATH9K_INT_SWBA) | 518 | if (status & ATH9K_INT_SWBA) |
@@ -505,6 +521,13 @@ irqreturn_t ath_isr(int irq, void *dev) | |||
505 | if (status & ATH9K_INT_TXURN) | 521 | if (status & ATH9K_INT_TXURN) |
506 | ath9k_hw_updatetxtriglevel(ah, true); | 522 | ath9k_hw_updatetxtriglevel(ah, true); |
507 | 523 | ||
524 | if (ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) { | ||
525 | if (status & ATH9K_INT_RXEOL) { | ||
526 | ah->imask &= ~(ATH9K_INT_RXEOL | ATH9K_INT_RXORN); | ||
527 | ath9k_hw_set_interrupts(ah, ah->imask); | ||
528 | } | ||
529 | } | ||
530 | |||
508 | if (status & ATH9K_INT_MIB) { | 531 | if (status & ATH9K_INT_MIB) { |
509 | /* | 532 | /* |
510 | * Disable interrupts until we service the MIB | 533 | * Disable interrupts until we service the MIB |
@@ -1162,9 +1185,14 @@ static int ath9k_start(struct ieee80211_hw *hw) | |||
1162 | } | 1185 | } |
1163 | 1186 | ||
1164 | /* Setup our intr mask. */ | 1187 | /* Setup our intr mask. */ |
1165 | ah->imask = ATH9K_INT_RX | ATH9K_INT_TX | 1188 | ah->imask = ATH9K_INT_TX | ATH9K_INT_RXEOL | |
1166 | | ATH9K_INT_RXEOL | ATH9K_INT_RXORN | 1189 | ATH9K_INT_RXORN | ATH9K_INT_FATAL | |
1167 | | ATH9K_INT_FATAL | ATH9K_INT_GLOBAL; | 1190 | ATH9K_INT_GLOBAL; |
1191 | |||
1192 | if (ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) | ||
1193 | ah->imask |= ATH9K_INT_RXHP | ATH9K_INT_RXLP; | ||
1194 | else | ||
1195 | ah->imask |= ATH9K_INT_RX; | ||
1168 | 1196 | ||
1169 | if (ah->caps.hw_caps & ATH9K_HW_CAP_GTT) | 1197 | if (ah->caps.hw_caps & ATH9K_HW_CAP_GTT) |
1170 | ah->imask |= ATH9K_INT_GTT; | 1198 | ah->imask |= ATH9K_INT_GTT; |