/* initialize DFS related variables */
sc->sc_dfswait = 0;
- sc->sc_dfs_cac = 0;
sc->sc_dfs_testmode = 0;
init_timer(&sc->sc_dfs_cac_timer);
ath_hal_setpower(sc->sc_ah, HAL_PM_AWAKE, AH_TRUE);
/* Flush the radar task if it's scheduled */
- if (sc->sc_dfs_cac)
+ if (timer_pending(&sc->sc_dfs_cac_timer))
flush_scheduled_work();
sc->sc_invalid = 1;
static int
ath_chan_unavail(struct ath_softc *sc)
{
- return sc->sc_dfs_cac ||
+ return timer_pending(&sc->sc_dfs_cac_timer) ||
((sc->sc_curchan.privFlags & CHANNEL_DFS) &&
(sc->sc_curchan.privFlags & CHANNEL_INTERFERENCE));
}
static inline int
_ath_cac_running_dbgmsg(struct ath_softc *sc, const char *func)
{
- int b = sc->sc_dfs_cac;
+ int b = timer_pending(&sc->sc_dfs_cac_timer);
if (b)
DPRINTF(sc, ATH_DEBUG_DOTH,
"%s: Invoked a transmit function during DFS "
* Handle beacon transmission directly; deferring
* this is too slow to meet timing constraints
* under load. */
- if (!sc->sc_dfs_cac)
+ if (!timer_pending(&sc->sc_dfs_cac_timer))
ath_beacon_send(sc, &needmark, hw_tsf);
else {
sc->sc_beacons = 0;
}
if (status & HAL_INT_BMISS) {
sc->sc_stats.ast_bmiss++;
- if (!sc->sc_dfs_cac)
+ if (!timer_pending(&sc->sc_dfs_cac_timer))
ATH_SCHEDULE_TQUEUE(&sc->sc_bmisstq, &needmark);
else {
sc->sc_beacons = 0;
/* Stop any pending channel calibrations or availability check if we
* are really changing channels. maybe a turbo mode switch only. */
if (hchan.channel != sc->sc_curchan.channel)
- if (!sc->sc_dfs_testmode && sc->sc_dfs_cac)
+ if (!sc->sc_dfs_testmode && timer_pending(&sc->sc_dfs_cac_timer))
ath_interrupt_dfs_cac(sc,
"Channel change interrupted DFS wait.");
/* set the timeout to normal */
dev->watchdog_timeo = 120 * HZ;
/* Disable beacons and beacon miss interrupts */
- sc->sc_dfs_cac = 1;
sc->sc_beacons = 0;
sc->sc_imask &= ~(HAL_INT_SWBA | HAL_INT_BMISS);
ath_hal_intrset(ah, sc->sc_imask);
* re configure beacons when it is a turbo mode switch.
* HW seems to turn off beacons during turbo mode switch.
*/
- if (sc->sc_beacons && !sc->sc_dfs_cac)
+ if (sc->sc_beacons && !timer_pending(&sc->sc_dfs_cac_timer))
ath_beacon_config(sc, NULL);
/*
* Re-enable interrupts.
(TAILQ_FIRST(&ic->ic_vaps)->iv_opmode !=
IEEE80211_M_WDS) &&
!txcont_was_active &&
- !sc->sc_dfs_cac) {
+ !timer_pending(&sc->sc_dfs_cac_timer)) {
sc->sc_beacons = 1;
}
/* if it is a DFS channel and has not been checked for radar
* do not let the 80211 state machine to go to RUN state. */
- if (sc->sc_dfs_cac &&
+ if (timer_pending(&sc->sc_dfs_cac_timer) &&
IEEE80211_IS_MODE_DFS_MASTER(vap->iv_opmode)) {
DPRINTF(sc, ATH_DEBUG_STATE | ATH_DEBUG_DOTH,
"VAP -> DFSWAIT_PENDING \n");
sc->sc_beacons = 1;
}
} else {
- if (sc->sc_dfs_cac &&
+ if (timer_pending(&sc->sc_dfs_cac_timer) &&
IEEE80211_IS_MODE_DFS_MASTER(vap->iv_opmode) &&
(sc->sc_dfs_cac_timer.data == (unsigned long)vap))
{
del_timer_sync(&sc->sc_dfs_cac_timer);
- sc->sc_dfs_cac = 0;
DPRINTF(sc, ATH_DEBUG_STATE,
"VAP DFSWAIT_PENDING -> run\n");
}
#endif
bad:
netif_wake_queue(dev);
- dev->watchdog_timeo = (sc->sc_dfs_cac ? 120 : 5) * HZ; /* set the timeout to normal */
+ dev->watchdog_timeo = (timer_pending(&sc->sc_dfs_cac_timer) ? 120 : 5) * HZ; /* set the timeout to normal */
return error;
}
struct ieee80211vap *vap ;
struct timeval tv;
- if (!sc->sc_dfs_cac) {
+ if (!timer_pending(&sc->sc_dfs_cac_timer)) {
DPRINTF(sc, ATH_DEBUG_DOTH, "DFS wait timer "
"expired, but the driver didn't think we "
"were in dfswait. Somebody forgot to "
ieee80211_mhz2ieee(sc->sc_curchan.channel,
sc->sc_curchan.channelFlags),
tv.tv_sec, (long)tv.tv_usec);
- sc->sc_dfs_cac = 0;
if (sc->sc_curchan.privFlags & CHANNEL_INTERFERENCE) {
DPRINTF(sc, ATH_DEBUG_DOTH,
"DFS wait timer expired "
struct timeval tv;
del_timer_sync(&sc->sc_dfs_cac_timer);
- if (sc->sc_dfs_cac) {
+ if (timer_pending(&sc->sc_dfs_cac_timer)) {
do_gettimeofday(&tv);
DPRINTF(sc, ATH_DEBUG_STATE | ATH_DEBUG_DOTH,
"%s - Channel: %u Time: %ld.%06ld\n",
sc->sc_curchan.channelFlags),
tv.tv_sec, (long)tv.tv_usec);
}
- sc->sc_dfs_cac = 0;
}
/* Invoked from interrupt context when radar is detected and positively
/* Stop here if we are testing w/o channel switching */
if (sc->sc_dfs_testmode) {
/* ath_dump_phyerr_statistics(sc, cause); */
- if (sc->sc_dfs_cac)
+ if (timer_pending(&sc->sc_dfs_cac_timer))
DPRINTF(sc, ATH_DEBUG_DOTH,
"dfs_testmode enabled -- "
"staying in CAC mode!\n");