Changeset 3638
- Timestamp:
- 05/16/08 23:21:53 (3 months ago)
- Files:
-
- madwifi/branches/madwifi-dfs/ath/if_ath.c (modified) (9 diffs)
- madwifi/branches/madwifi-dfs/ath/if_athvar.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
madwifi/branches/madwifi-dfs/ath/if_ath.c
r3637 r3638 554 554 } 555 555 556 /* Context: Timer (softIRQ) */ 557 static void 558 ath_swba_watchdog(unsigned long data ) 559 { 560 struct ath_softc * sc = (struct ath_softc *)data; 561 562 DPRINTF(sc, ATH_DEBUG_BEACON, 563 "%s called, configuring beacon\n",__func__); 564 if (sc->sc_beacons) 565 ath_beacon_config(sc, NULL); 566 } 567 556 568 /* Initialize ath_softc structure */ 557 569 … … 760 772 goto bad2; 761 773 } 774 775 /* SWBA watchdog timer : this timer is needed in order to make sure 776 * that beacon timers are still alive. If they are not, for instance 777 * following an IBSS merge where TSF has been updated and beacon timers 778 * are now in the past, this timer callback will kick in. It might 779 * solve other situations where beacons stops being sent for some 780 * reason */ 781 init_timer(&sc->sc_swba_timer); 782 sc->sc_swba_timer.function = ath_swba_watchdog; 783 sc->sc_swba_timer.data = (unsigned long) sc; 784 762 785 /* CAB: Crap After Beacon - a beacon gated queue */ 763 786 sc->sc_cabq = ath_txq_setup(sc, HAL_TX_QUEUE_CAB, 0); … … 1313 1336 now_tu = IEEE80211_TSF_TO_TU(ath_hal_gettsf64(ah)); 1314 1337 nexttbtt = sc->sc_nexttbtt + roundup_s( 1315 (signed)(now_tu + 1 - sc->sc_nexttbtt), 1316 vap->iv_bss->ni_intval); 1338 now_tu + 1 - sc->sc_nexttbtt, vap->iv_bss->ni_intval); 1317 1339 1318 1340 if (nexttbtt != sc->sc_nexttbtt) { … … 2606 2628 if (status & HAL_INT_SWBA) { 2607 2629 struct ieee80211vap * vap; 2630 u_int32_t hw_tsftu = IEEE80211_TSF_TO_TU(hw_tsf); 2608 2631 2609 2632 DPRINTF(sc, ATH_DEBUG_BEACON, … … 2611 2634 "tsf %10llx tsf_tu:%6u nexttbtt %10llx " 2612 2635 "nexttbtt_tu:%6u\n", 2613 __func__, hw_tsf, IEEE80211_TSF_TO_TU(hw_tsf),2636 __func__, hw_tsf, hw_tsftu, 2614 2637 (u_int64_t)sc->sc_nexttbtt << 10, 2615 2638 sc->sc_nexttbtt); … … 2630 2653 vap = TAILQ_FIRST(&sc->sc_ic.ic_vaps); 2631 2654 sc->sc_nexttbtt += vap->iv_bss->ni_intval; 2655 2656 /* Updates SWBA watchdog timer */ 2657 mod_timer(&sc->sc_swba_timer, jiffies 2658 + IEEE80211_TU_TO_JIFFIES( 2659 sc->sc_nexttbtt - hw_tsftu)); 2660 2632 2661 } 2633 2662 if (status & HAL_INT_RXEOL) { … … 5703 5732 * zero, so next beacon will be sent at the next intval 5704 5733 * time */ 5734 hw_tsf = 0; 5735 hw_tsftu = 0; 5705 5736 nexttbtt = intval; 5706 5737 } else if (intval) { /* NB: can be 0 for monitor mode */ … … 5721 5752 * We cannot use the hardware TSF, so we 5722 5753 * wait to synchronize beacons again. */ 5754 nexttbtt = roundup(hw_tsftu + FUDGE, intval); 5723 5755 sc->sc_syncbeacon = 1; 5724 goto ath_beacon_config_debug;5725 5756 } else { 5726 5757 /* Normal case: we received a beacon to which 5727 * we have synchronized. Make sure that nexttbtt 5728 * is at least FUDGE TU ahead of hw_tsf */ 5729 nexttbtt = tsftu + roundup(hw_tsftu + FUDGE - 5730 tsftu, intval); 5758 * we have synchronized. Make sure that 5759 * nexttbtt is at least FUDGE TU ahead of 5760 * hw_tsf */ 5761 nexttbtt = tsftu + roundup(hw_tsftu + FUDGE - 5762 tsftu, intval); 5731 5763 } 5732 5764 } … … 5854 5886 sc->sc_nexttbtt = nexttbtt; 5855 5887 ath_hw_beaconinit(sc, hw_tsftu, nexttbtt, intval); 5856 if ( intval & HAL_BEACON_RESET_TSF) {5888 if (reset_tsf) 5857 5889 sc->sc_last_tsf = 0; 5858 }5859 5890 sc->sc_bmisscount = 0; 5860 5891 ath_hal_intrset(ah, sc->sc_imask); 5861 } 5862 5863 ath_beacon_config_debug: 5892 5893 /* Start SWBA watchdog timer */ 5894 mod_timer(&sc->sc_swba_timer, jiffies 5895 + IEEE80211_TU_TO_JIFFIES( 5896 sc->sc_nexttbtt - hw_tsftu)); 5897 } 5898 5864 5899 /* We print all debug messages here, in order to preserve the 5865 5900 * time critical aspect of this function */ madwifi/branches/madwifi-dfs/ath/if_athvar.h
r3633 r3638 740 740 int sc_bhalq; /* HAL q for outgoing beacons */ 741 741 u_int sc_bmisscount; /* missed beacon transmits */ 742 struct timer_list sc_swba_timer; /* watchdog timer for SWBA */ 742 743 u_int32_t sc_ant_tx[8]; /* recent tx frames/antenna */ 743 744 struct ath_txq *sc_cabq; /* tx q for cab frames */
