Ticket #1033: ibss_beacon_nexttbtt_fix.diff

File ibss_beacon_nexttbtt_fix.diff, 1.5 kB (added by tjalling.hattink@ti-wmc.nl, 2 years ago)

New patch that fixes adhoc beacon transmissions after ibss merge.

  • ath/if_ath.c

    old new  
    44264426{ 
    44274427#define TSF_TO_TU(_h,_l) \ 
    44284428        ((((u_int32_t)(_h)) << 22) | (((u_int32_t)(_l)) >> 10)) 
     4429#define FUDGE   2 
    44294430        struct ieee80211com *ic = &sc->sc_ic; 
    44304431        struct ath_hal *ah = sc->sc_ah; 
    44314432        struct ieee80211_node *ni; 
     
    44814482                        dtimcount = 0;          /* XXX? */ 
    44824483                cfpperiod = 1;                  /* NB: no PCF support yet */ 
    44834484                cfpcount = 0; 
    4484 #define FUDGE   2 
    44854485                /* 
    44864486                 * Pull nexttbtt forward to reflect the current 
    44874487                 * TSF and calculate dtim+cfp state for the result. 
     
    44964496                                        cfpcount = cfpperiod - 1; 
    44974497                        } 
    44984498                } while (nexttbtt < tsftu); 
    4499 #undef FUDGE 
    45004499                memset(&bs, 0, sizeof(bs)); 
    45014500                bs.bs_intval = intval; 
    45024501                bs.bs_nexttbtt = nexttbtt; 
     
    45794578                        intval |= HAL_BEACON_ENA; 
    45804579                        if (!sc->sc_hasveol) 
    45814580                                sc->sc_imask |= HAL_INT_SWBA; 
     4581                        if ((intval & HAL_BEACON_RESET_TSF) == 0) { 
     4582                                u_int64_t tsf; 
     4583                                u_int32_t clintval, tsftu; 
     4584                                /* 
     4585                                 * Pull nexttbtt forward to reflect 
     4586                                 * the current TSF. 
     4587                                 */ 
     4588                                clintval = intval & HAL_BEACON_PERIOD; 
     4589                                tsf = ath_hal_gettsf64(ah); 
     4590                                tsftu = TSF_TO_TU(tsf>>32, tsf); 
     4591                                if (tsftu < nexttbtt) 
     4592                                        tsftu = nexttbtt; 
     4593                                tsftu += clintval + FUDGE; 
     4594                                do { 
     4595                                        nexttbtt += clintval; 
     4596                                } while (nexttbtt < tsftu); 
     4597                        } 
    45824598                        ath_beaconq_config(sc); 
    45834599                } else if (ic->ic_opmode == IEEE80211_M_HOSTAP) { 
    45844600                        /* 
     
    46054621        } 
    46064622        sc->sc_syncbeacon = 0; 
    46074623#undef TSF_TO_TU 
     4624#undef FUDGE 
    46084625} 
    46094626 
    46104627static int