Commit e65e1d77 authored by Bruno Randolf's avatar Bruno Randolf Committed by John W. Linville

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: default avatarBruno Randolf <br1@einfach.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 1063b176
...@@ -890,10 +890,10 @@ enum ath5k_int { ...@@ -890,10 +890,10 @@ enum ath5k_int {
AR5K_INT_NOCARD = 0xffffffff AR5K_INT_NOCARD = 0xffffffff
}; };
/* Software interrupts used for calibration */ /* mask which calibration is active at the moment */
enum ath5k_software_interrupt { enum ath5k_calibration_mask {
AR5K_SWI_FULL_CALIBRATION = 0x01, AR5K_CALIBRATION_FULL = 0x01,
AR5K_SWI_SHORT_CALIBRATION = 0x02, AR5K_CALIBRATION_SHORT = 0x02,
}; };
/* /*
...@@ -1102,8 +1102,8 @@ struct ath5k_hw { ...@@ -1102,8 +1102,8 @@ struct ath5k_hw {
/* Calibration timestamp */ /* Calibration timestamp */
unsigned long ah_cal_tstamp; unsigned long ah_cal_tstamp;
/* Software interrupt mask */ /* Calibration mask */
u8 ah_swi_mask; u8 ah_cal_mask;
/* /*
* Function pointers * Function pointers
......
...@@ -2507,7 +2507,7 @@ ath5k_init(struct ath5k_softc *sc) ...@@ -2507,7 +2507,7 @@ ath5k_init(struct ath5k_softc *sc)
sc->curband = &sc->sbands[sc->curchan->band]; sc->curband = &sc->sbands[sc->curchan->band];
sc->imask = AR5K_INT_RXOK | AR5K_INT_RXERR | AR5K_INT_RXEOL | sc->imask = AR5K_INT_RXOK | AR5K_INT_RXERR | AR5K_INT_RXEOL |
AR5K_INT_RXORN | AR5K_INT_TXDESC | AR5K_INT_TXEOL | AR5K_INT_RXORN | AR5K_INT_TXDESC | AR5K_INT_TXEOL |
AR5K_INT_FATAL | AR5K_INT_GLOBAL | AR5K_INT_SWI; AR5K_INT_FATAL | AR5K_INT_GLOBAL;
ret = ath5k_reset(sc, NULL); ret = ath5k_reset(sc, NULL);
if (ret) if (ret)
goto done; goto done;
...@@ -2673,9 +2673,6 @@ ath5k_intr(int irq, void *dev_id) ...@@ -2673,9 +2673,6 @@ ath5k_intr(int irq, void *dev_id)
if (status & AR5K_INT_BMISS) { if (status & AR5K_INT_BMISS) {
/* TODO */ /* TODO */
} }
if (status & AR5K_INT_SWI) {
tasklet_schedule(&sc->calib);
}
if (status & AR5K_INT_MIB) { if (status & AR5K_INT_MIB) {
/* /*
* These stats are also used for ANI i think * These stats are also used for ANI i think
...@@ -2716,8 +2713,7 @@ ath5k_tasklet_calibrate(unsigned long data) ...@@ -2716,8 +2713,7 @@ ath5k_tasklet_calibrate(unsigned long data)
struct ath5k_hw *ah = sc->ah; struct ath5k_hw *ah = sc->ah;
/* Only full calibration for now */ /* Only full calibration for now */
if (ah->ah_swi_mask != AR5K_SWI_FULL_CALIBRATION) ah->ah_cal_mask |= AR5K_CALIBRATION_FULL;
return;
/* Stop queues so that calibration /* Stop queues so that calibration
* doesn't interfere with tx */ * doesn't interfere with tx */
...@@ -2740,11 +2736,10 @@ ath5k_tasklet_calibrate(unsigned long data) ...@@ -2740,11 +2736,10 @@ ath5k_tasklet_calibrate(unsigned long data)
ieee80211_frequency_to_channel( ieee80211_frequency_to_channel(
sc->curchan->center_freq)); sc->curchan->center_freq));
ah->ah_swi_mask = 0;
/* Wake queues */ /* Wake queues */
ieee80211_wake_queues(sc->hw); ieee80211_wake_queues(sc->hw);
ah->ah_cal_mask &= ~AR5K_CALIBRATION_FULL;
} }
......
...@@ -1119,8 +1119,7 @@ ath5k_hw_calibration_poll(struct ath5k_hw *ah) ...@@ -1119,8 +1119,7 @@ ath5k_hw_calibration_poll(struct ath5k_hw *ah)
* interrupt (bit gets auto-cleared) */ * interrupt (bit gets auto-cleared) */
if (time_is_before_eq_jiffies(ah->ah_cal_tstamp + cal_intval)) { if (time_is_before_eq_jiffies(ah->ah_cal_tstamp + cal_intval)) {
ah->ah_cal_tstamp = jiffies; ah->ah_cal_tstamp = jiffies;
ah->ah_swi_mask = AR5K_SWI_FULL_CALIBRATION; tasklet_schedule(&ah->ah_sc->calib);
AR5K_REG_ENABLE_BITS(ah, AR5K_CR, AR5K_CR_SWI);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment