caf3cc14f6d4696e71a8715dcf52ee124fc9f6a4
[openwrt/svn-archive/archive.git] / package / madwifi / patches / 332-reset_beacons.patch
1 Index: madwifi-trunk-r3314/ath/if_ath.c
2 ===================================================================
3 --- madwifi-trunk-r3314.orig/ath/if_ath.c 2008-02-26 20:23:58.477203701 +0100
4 +++ madwifi-trunk-r3314/ath/if_ath.c 2008-02-26 20:23:59.241247240 +0100
5 @@ -1594,6 +1594,16 @@
6 ath_init(dev);
7 }
8
9 +static HAL_BOOL ath_hw_reset(struct ath_hal *ah, HAL_OPMODE opmode,
10 + HAL_CHANNEL *channel, HAL_BOOL bChannelChange,
11 + HAL_STATUS *status)
12 +{
13 + HAL_BOOL ret;
14 + ret = ath_hal_reset(ah, opmode, channel, bChannelChange, status);
15 + mdelay(5); /* extra delay to allow the hw to settle in */
16 + return ret;
17 +}
18 +
19 /* Channel Availability Check is running, or a channel has already found to be
20 * unavailable. */
21 static int
22 @@ -2476,7 +2486,7 @@
23 */
24 sc->sc_curchan.channel = ic->ic_curchan->ic_freq;
25 sc->sc_curchan.channelFlags = ath_chan2flags(ic->ic_curchan);
26 - if (!ath_hal_reset(ah, sc->sc_opmode, &sc->sc_curchan, AH_FALSE, &status)) {
27 + if (!ath_hw_reset(ah, sc->sc_opmode, &sc->sc_curchan, AH_TRUE, &status)) {
28 EPRINTF(sc, "unable to reset hardware: '%s' (HAL status %u) "
29 "(freq %u flags 0x%x)\n",
30 ath_get_hal_status_desc(status), status,
31 @@ -2775,7 +2785,7 @@
32 ath_draintxq(sc); /* stop xmit side */
33 ath_stoprecv(sc); /* stop recv side */
34 /* NB: indicate channel change so we do a full reset */
35 - if (!ath_hal_reset(ah, sc->sc_opmode, &sc->sc_curchan, AH_TRUE, &status))
36 + if (!ath_hw_reset(ah, sc->sc_opmode, &sc->sc_curchan, AH_TRUE, &status))
37 EPRINTF(sc, "Unable to reset hardware: '%s' (HAL status %u)\n",
38 ath_get_hal_status_desc(status), status);
39
40 @@ -8848,8 +8858,7 @@
41 * needed to do the reset with chanchange = AH_FALSE in order
42 * to receive traffic when peforming high velocity channel
43 * changes. */
44 - if (!ath_hal_reset(ah, sc->sc_opmode, &hchan, AH_TRUE, &status) ||
45 - !ath_hal_reset(ah, sc->sc_opmode, &hchan, AH_FALSE, &status)) {
46 + if (!ath_hw_reset(ah, sc->sc_opmode, &hchan, AH_TRUE, &status)) {
47 EPRINTF(sc, "Unable to reset channel %u (%u MHz) "
48 "flags 0x%x '%s' (HAL status %u)\n",
49 ieee80211_chan2ieee(ic, chan), chan->ic_freq,
50 @@ -8905,7 +8914,7 @@
51 * re configure beacons when it is a turbo mode switch.
52 * HW seems to turn off beacons during turbo mode switch.
53 */
54 - if (sc->sc_beacons && tswitch && !sc->sc_dfs_cac)
55 + if (sc->sc_beacons && !sc->sc_dfs_cac)
56 ath_beacon_config(sc, NULL);
57 /*
58 * Re-enable interrupts.
59 @@ -11456,7 +11465,7 @@
60 ieee80211_cancel_scan(vap); /* anything current */
61 ieee80211_wme_updateparams(vap);
62 /* reset the WNIC */
63 - if (!ath_hal_reset(ah, sc->sc_opmode,
64 + if (!ath_hw_reset(ah, sc->sc_opmode,
65 &sc->sc_curchan, AH_TRUE, &status)) {
66 EPRINTF(sc, "ath_hal_reset failed: '%s' "
67 "(HAL status %u).\n",