ath9k_hw: Fix eeprom offset for AR9287 devices (PCI/USB)
authorRajkumar Manoharan <rmanoharan@atheros.com>
Fri, 19 Nov 2010 11:23:21 +0000 (16:53 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 24 Nov 2010 21:19:41 +0000 (16:19 -0500)
AR9287 devices (PCI/USB) use different eeprom start location
to read nvram. New devices might endup with same devid. So use
driver_info to set offset, instead of devid. driver_info is
valid for HTC devices alone which is filled in usb_device_id.

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/eeprom_9287.c
drivers/net/wireless/ath/ath9k/reg.h

index e75697858ae8b724597da31470fa7921ae3ebb2b..bcb9ed39c0476a129c139aef0ead6e5ec1d1b8d8 100644 (file)
@@ -37,10 +37,10 @@ static bool ath9k_hw_ar9287_fill_eeprom(struct ath_hw *ah)
        int addr, eep_start_loc;
        eep_data = (u16 *)eep;
 
-       if (AR9287_HTC_DEVID(ah))
-               eep_start_loc = AR9287_HTC_EEP_START_LOC;
-       else
+       if (!common->driver_info)
                eep_start_loc = AR9287_EEP_START_LOC;
+       else
+               eep_start_loc = AR9287_HTC_EEP_START_LOC;
 
        if (!ath9k_hw_use_flash(ah)) {
                ath_print(common, ATH_DBG_EEPROM,
index f1bbc7560c86d608491e2ba1590d8ab6b02f4be2..9d68237e4d9c690398b9462f78672fac52f139c6 100644 (file)
         ((_ah)->hw_version.devid == 0xA704) || \
         ((_ah)->hw_version.devid == 0x1200))
 
-#define AR9287_HTC_DEVID(_ah) \
-       (((_ah)->hw_version.devid == 0x7015) || \
-        ((_ah)->hw_version.devid == 0x1200))
-
 #define AR_RADIO_SREV_MAJOR                   0xf0
 #define AR_RAD5133_SREV_MAJOR                 0xc0
 #define AR_RAD2133_SREV_MAJOR                 0xd0