sc->sc_curchan.channel = ic->ic_curchan->ic_freq;
sc->sc_curchan.channelFlags = ath_chan2flags(ic->ic_curchan);
if (!ath_hal_reset(ah, sc->sc_opmode, &sc->sc_curchan, AH_FALSE, &status)) {
-@@ -2913,6 +2915,34 @@ ath_hw_check_atim(struct ath_softc *sc,
+@@ -2913,6 +2915,40 @@ ath_hw_check_atim(struct ath_softc *sc,
}
+ if (sc->sc_ah->ah_macType < 5212)
+ return;
+
++ if (!ic->ic_curchan || (ic->ic_curchan == IEEE80211_CHAN_ANYC))
++ return;
++
+ rx = OS_REG_READ(ah, AR5K_RXCLEAR);
+ cc = OS_REG_READ(ah, AR5K_CYCLES);
++ if (!cc)
++ return;
++
+ if (rx > cc)
+ return; /* wraparound */
+
/*
* Reset the hardware w/o losing operational state. This is
* basically a more efficient way of doing ath_stop, ath_init,
-@@ -2939,6 +2969,7 @@ ath_reset(struct net_device *dev)
+@@ -2939,6 +2975,7 @@ ath_reset(struct net_device *dev)
* Convert to a HAL channel description with the flags
* constrained to reflect the current operating mode.
*/
c = ic->ic_curchan;
sc->sc_curchan.channel = c->ic_freq;
sc->sc_curchan.channelFlags = ath_chan2flags(c);
-@@ -9019,6 +9050,7 @@ ath_chan_set(struct ath_softc *sc, struc
+@@ -9019,6 +9056,7 @@ ath_chan_set(struct ath_softc *sc, struc
u_int8_t channel_change_required = 0;
struct timeval tv;