X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/346e30c5b15ef0dfda50f3e414dfc5db4678c118..a4bdef9ca9051d829ee12f9f8ae36016f0c2136e:/package/madwifi/patches/389-autochannel.patch?ds=inline diff --git a/package/madwifi/patches/389-autochannel.patch b/package/madwifi/patches/389-autochannel.patch index 8e5a62daf..1c6228590 100644 --- a/package/madwifi/patches/389-autochannel.patch +++ b/package/madwifi/patches/389-autochannel.patch @@ -8,7 +8,7 @@ /* calibrate every 30 secs in steady state but check every second at first. */ static int ath_calinterval = ATH_SHORT_CALINTERVAL; -@@ -2579,6 +2580,7 @@ ath_init(struct net_device *dev) +@@ -2580,6 +2581,7 @@ ath_init(struct net_device *dev) * be followed by initialization of the appropriate bits * and then setup of the interrupt mask. */ @@ -16,7 +16,7 @@ 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, +@@ -2914,6 +2916,40 @@ ath_hw_check_atim(struct ath_softc *sc, } @@ -33,8 +33,14 @@ + 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 */ + @@ -51,7 +57,7 @@ /* * 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) +@@ -2940,6 +2976,7 @@ ath_reset(struct net_device *dev) * Convert to a HAL channel description with the flags * constrained to reflect the current operating mode. */ @@ -59,7 +65,7 @@ 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 +@@ -9022,6 +9059,7 @@ ath_chan_set(struct ath_softc *sc, struc u_int8_t channel_change_required = 0; struct timeval tv; @@ -109,11 +115,11 @@ pc_cmp_samechan(struct ieee80211com *ic, struct ieee80211_channel *a, struct ieee80211_channel *b) { -@@ -455,6 +468,7 @@ pc_cmp(const void *_a, const void *_b) - return res; \ - } while (0) +@@ -457,6 +470,7 @@ pc_cmp(const void *_a, const void *_b) -+ EVALUATE_CRITERION(idletime, a, b); EVALUATE_CRITERION(radar, a, b); EVALUATE_CRITERION(keepmode, params, a, b); ++ EVALUATE_CRITERION(idletime, a, b); EVALUATE_CRITERION(sc, ic, a, b); + /* XXX: rssi useless? pick_channel evaluates it anyway */ + EVALUATE_CRITERION(rssi, params->ss->ss_priv, a, b);