source: trunk/package/mac80211/patches/510-ar9100_tsf_preserve.patch @ 21989

Last change on this file since 21989 was 21989, checked in by nbd, 6 years ago

ath9k: fix TSF across hardware resets on AR913x

File size: 1.3 KB
  • drivers/net/wireless/ath/ath9k/hw.c

    a b int ath9k_hw_reset(struct ath_hw *ah, st 
    12801280        macStaId1 = REG_READ(ah, AR_STA_ID1) & AR_STA_ID1_BASE_RATE_11B; 
    12811281 
    12821282        /* For chips on which RTC reset is done, save TSF before it gets cleared */ 
    1283         if (AR_SREV_9280(ah) && ah->eep_ops->get_eeprom(ah, EEP_OL_PWRCTRL)) 
     1283        if (AR_SREV_9100(ah) || 
     1284            (AR_SREV_9280(ah) && ah->eep_ops->get_eeprom(ah, EEP_OL_PWRCTRL))) 
    12841285                tsf = ath9k_hw_gettsf64(ah); 
    12851286 
    12861287        saveLedState = REG_READ(ah, AR_CFG_LED) & 
    int ath9k_hw_reset(struct ath_hw *ah, st 
    13121313        } 
    13131314 
    13141315        /* Restore TSF */ 
    1315         if (tsf && AR_SREV_9280(ah) && ah->eep_ops->get_eeprom(ah, EEP_OL_PWRCTRL)) 
     1316        if (tsf) 
    13161317                ath9k_hw_settsf64(ah, tsf); 
    13171318 
    13181319        if (AR_SREV_9280_10_OR_LATER(ah)) 
    int ath9k_hw_reset(struct ath_hw *ah, st 
    13251326        if (r) 
    13261327                return r; 
    13271328 
     1329        /* 
     1330         * Some AR91xx SoC devices frequently fail to accept TSF writes 
     1331         * right after the chip reset. When that happens, write a new 
     1332         * value after the initvals have been applied, with an offset 
     1333         * based on measured time differences 
     1334         */ 
     1335        if (AR_SREV_9100(ah) && (ath9k_hw_gettsf64(ah) < tsf)) { 
     1336                tsf += 1500; 
     1337                ath9k_hw_settsf64(ah, tsf); 
     1338        } 
     1339 
    13281340        /* Setup MFP options for CCMP */ 
    13291341        if (AR_SREV_9280_20_OR_LATER(ah)) { 
    13301342                /* Mask Retry(b11), PwrMgt(b12), MoreData(b13) to 0 in mgmt 
Note: See TracBrowser for help on using the repository browser.