diff options
author | Bruno Randolf <br1@einfach.org> | 2010-03-25 01:49:09 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-03-31 14:39:08 -0400 |
commit | e65e1d7713da89d98f01c3f4267b2c9ecb03c16f (patch) | |
tree | 4df0ab05508bf9d55b7a065dc284861ed0685da9 /drivers/net | |
parent | 1063b176c072b936c43d0e6270168b19881ecb72 (diff) |
ath5k: remove the use of SWI interrupt
We don't need to generate a software interrupt (SWI) just to schedule a tasklet
- we can just schedule the tasklet directly.
Rename constants, names, etc to reflect the fact that we don't use SWI any more.
Also move the flag handling into the tasklet and prepare it to behave correctly
when there are multiple flags present.
Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/ath5k.h | 12 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/base.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/phy.c | 3 |
3 files changed, 10 insertions, 16 deletions
diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h index a3019ee4f2fa..d84ccde11171 100644 --- a/drivers/net/wireless/ath/ath5k/ath5k.h +++ b/drivers/net/wireless/ath/ath5k/ath5k.h | |||
@@ -890,10 +890,10 @@ enum ath5k_int { | |||
890 | AR5K_INT_NOCARD = 0xffffffff | 890 | AR5K_INT_NOCARD = 0xffffffff |
891 | }; | 891 | }; |
892 | 892 | ||
893 | /* Software interrupts used for calibration */ | 893 | /* mask which calibration is active at the moment */ |
894 | enum ath5k_software_interrupt { | 894 | enum ath5k_calibration_mask { |
895 | AR5K_SWI_FULL_CALIBRATION = 0x01, | 895 | AR5K_CALIBRATION_FULL = 0x01, |
896 | AR5K_SWI_SHORT_CALIBRATION = 0x02, | 896 | AR5K_CALIBRATION_SHORT = 0x02, |
897 | }; | 897 | }; |
898 | 898 | ||
899 | /* | 899 | /* |
@@ -1102,8 +1102,8 @@ struct ath5k_hw { | |||
1102 | /* Calibration timestamp */ | 1102 | /* Calibration timestamp */ |
1103 | unsigned long ah_cal_tstamp; | 1103 | unsigned long ah_cal_tstamp; |
1104 | 1104 | ||
1105 | /* Software interrupt mask */ | 1105 | /* Calibration mask */ |
1106 | u8 ah_swi_mask; | 1106 | u8 ah_cal_mask; |
1107 | 1107 | ||
1108 | /* | 1108 | /* |
1109 | * Function pointers | 1109 | * Function pointers |
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index 39d580017259..539a6d5415fd 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c | |||
@@ -2507,7 +2507,7 @@ ath5k_init(struct ath5k_softc *sc) | |||
2507 | sc->curband = &sc->sbands[sc->curchan->band]; | 2507 | sc->curband = &sc->sbands[sc->curchan->band]; |
2508 | sc->imask = AR5K_INT_RXOK | AR5K_INT_RXERR | AR5K_INT_RXEOL | | 2508 | sc->imask = AR5K_INT_RXOK | AR5K_INT_RXERR | AR5K_INT_RXEOL | |
2509 | AR5K_INT_RXORN | AR5K_INT_TXDESC | AR5K_INT_TXEOL | | 2509 | AR5K_INT_RXORN | AR5K_INT_TXDESC | AR5K_INT_TXEOL | |
2510 | AR5K_INT_FATAL | AR5K_INT_GLOBAL | AR5K_INT_SWI; | 2510 | AR5K_INT_FATAL | AR5K_INT_GLOBAL; |
2511 | ret = ath5k_reset(sc, NULL); | 2511 | ret = ath5k_reset(sc, NULL); |
2512 | if (ret) | 2512 | if (ret) |
2513 | goto done; | 2513 | goto done; |
@@ -2673,9 +2673,6 @@ ath5k_intr(int irq, void *dev_id) | |||
2673 | if (status & AR5K_INT_BMISS) { | 2673 | if (status & AR5K_INT_BMISS) { |
2674 | /* TODO */ | 2674 | /* TODO */ |
2675 | } | 2675 | } |
2676 | if (status & AR5K_INT_SWI) { | ||
2677 | tasklet_schedule(&sc->calib); | ||
2678 | } | ||
2679 | if (status & AR5K_INT_MIB) { | 2676 | if (status & AR5K_INT_MIB) { |
2680 | /* | 2677 | /* |
2681 | * These stats are also used for ANI i think | 2678 | * These stats are also used for ANI i think |
@@ -2716,8 +2713,7 @@ ath5k_tasklet_calibrate(unsigned long data) | |||
2716 | struct ath5k_hw *ah = sc->ah; | 2713 | struct ath5k_hw *ah = sc->ah; |
2717 | 2714 | ||
2718 | /* Only full calibration for now */ | 2715 | /* Only full calibration for now */ |
2719 | if (ah->ah_swi_mask != AR5K_SWI_FULL_CALIBRATION) | 2716 | ah->ah_cal_mask |= AR5K_CALIBRATION_FULL; |
2720 | return; | ||
2721 | 2717 | ||
2722 | /* Stop queues so that calibration | 2718 | /* Stop queues so that calibration |
2723 | * doesn't interfere with tx */ | 2719 | * doesn't interfere with tx */ |
@@ -2740,11 +2736,10 @@ ath5k_tasklet_calibrate(unsigned long data) | |||
2740 | ieee80211_frequency_to_channel( | 2736 | ieee80211_frequency_to_channel( |
2741 | sc->curchan->center_freq)); | 2737 | sc->curchan->center_freq)); |
2742 | 2738 | ||
2743 | ah->ah_swi_mask = 0; | ||
2744 | |||
2745 | /* Wake queues */ | 2739 | /* Wake queues */ |
2746 | ieee80211_wake_queues(sc->hw); | 2740 | ieee80211_wake_queues(sc->hw); |
2747 | 2741 | ||
2742 | ah->ah_cal_mask &= ~AR5K_CALIBRATION_FULL; | ||
2748 | } | 2743 | } |
2749 | 2744 | ||
2750 | 2745 | ||
diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c index 01b3f29ec13d..075873f98428 100644 --- a/drivers/net/wireless/ath/ath5k/phy.c +++ b/drivers/net/wireless/ath/ath5k/phy.c | |||
@@ -1119,8 +1119,7 @@ ath5k_hw_calibration_poll(struct ath5k_hw *ah) | |||
1119 | * interrupt (bit gets auto-cleared) */ | 1119 | * interrupt (bit gets auto-cleared) */ |
1120 | if (time_is_before_eq_jiffies(ah->ah_cal_tstamp + cal_intval)) { | 1120 | if (time_is_before_eq_jiffies(ah->ah_cal_tstamp + cal_intval)) { |
1121 | ah->ah_cal_tstamp = jiffies; | 1121 | ah->ah_cal_tstamp = jiffies; |
1122 | ah->ah_swi_mask = AR5K_SWI_FULL_CALIBRATION; | 1122 | tasklet_schedule(&ah->ah_sc->calib); |
1123 | AR5K_REG_ENABLE_BITS(ah, AR5K_CR, AR5K_CR_SWI); | ||
1124 | } | 1123 | } |
1125 | } | 1124 | } |
1126 | 1125 | ||