summaryrefslogtreecommitdiff
path: root/package/madwifi/patches/389-autochannel.patch
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2008-12-04 21:57:17 +0000
committerFelix Fietkau <nbd@openwrt.org>2008-12-04 21:57:17 +0000
commit95a9e47a00fdc5b161219627644ad667bd2e643d (patch)
treeddd27feabf13f87fcddf07d39f6edefb7a91e3db /package/madwifi/patches/389-autochannel.patch
parent130413bb0f1de803e52cd168c59373b3e6473f4e (diff)
downloadmtk-20170518-95a9e47a00fdc5b161219627644ad667bd2e643d.zip
mtk-20170518-95a9e47a00fdc5b161219627644ad667bd2e643d.tar.gz
mtk-20170518-95a9e47a00fdc5b161219627644ad667bd2e643d.tar.bz2
madwifi: fix division by zero
SVN-Revision: 13521
Diffstat (limited to 'package/madwifi/patches/389-autochannel.patch')
-rw-r--r--package/madwifi/patches/389-autochannel.patch9
1 files changed, 6 insertions, 3 deletions
diff --git a/package/madwifi/patches/389-autochannel.patch b/package/madwifi/patches/389-autochannel.patch
index 9c77b0e..7926d2e 100644
--- a/package/madwifi/patches/389-autochannel.patch
+++ b/package/madwifi/patches/389-autochannel.patch
@@ -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,37 @@ ath_hw_check_atim(struct ath_softc *sc,
+@@ -2913,6 +2915,40 @@ ath_hw_check_atim(struct ath_softc *sc,
}
@@ -38,6 +38,9 @@
+
+ rx = OS_REG_READ(ah, AR5K_RXCLEAR);
+ cc = OS_REG_READ(ah, AR5K_CYCLES);
++ if (!cc)
++ return;
++
+ if (rx > cc)
+ return; /* wraparound */
+
@@ -54,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 +2972,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.
*/
@@ -62,7 +65,7 @@
c = ic->ic_curchan;
sc->sc_curchan.channel = c->ic_freq;
sc->sc_curchan.channelFlags = ath_chan2flags(c);
-@@ -9019,6 +9053,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;