Ticket #1025: madwifi-r1823-txtsf.patch

File madwifi-r1823-txtsf.patch, 1.1 kB (added by georg@boerde.de, 2 years ago)

TX TSF expansion overrun fix

  • ath/if_ath.c

    old new  
    53645364       u_int64_t tsf; 
    53655365 
    53665366       /* Pass up tsf clock in mactime 
    5367         * tx descriptor has the low 15 bits of the tsf at 
    5368         * the time the frame was received.  Use the current 
    5369         * tsf to extend this to 64 bits. 
     5367        * tx descriptor has the low 16 bits (compared to 15 
     5368        * bits for RX) of the tsf at the time the frame was 
     5369        * received. Use the current tsf to extend this to 64 
     5370        * bits. Do not use ath_extend_tsf() here, as it only 
     5371        * supports 15bit values. 
    53705372        */ 
    5371        tsf = ath_extend_tsf(sc->sc_ah, ds->ds_txstat.ts_tstamp); 
     5373       tsf = ath_hal_gettsf64(sc->sc_ah); 
     5374       if ((tsf & 0xffff) < ds->ds_txstat.ts_tstamp) 
     5375               tsf -= 0x10000; 
     5376       tsf = (tsf &~ 0xffff) | ds->ds_txstat.ts_tstamp; 
    53725377 
    53735378       /*                                                                       
    53745379        * release the owner of this skb since we're basically