Changeset 31084


Ignore:
Timestamp:
2012-03-27T15:21:53+02:00 (6 years ago)
Author:
nbd
Message:

ath9k: make endian check optional

Turns out it triggers on some AR71xx devices where no swapping should be done.
Enable endian check for the lantiq target.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/mac80211/patches/501-ath9k-eeprom_endianess.patch

    r31071 r31084  
    1010        bool need_swap = false; 
    1111        int i, addr, size; 
    12 @@ -277,27 +277,15 @@ static int ath9k_hw_def_check_eeprom(str 
     12@@ -277,27 +277,16 @@ static int ath9k_hw_def_check_eeprom(str 
    1313                return false; 
    1414        } 
     
    3535-                               return -EINVAL; 
    3636-                       } 
    37 +       if (swab16(magic) == AR5416_EEPROM_MAGIC) { 
     37+       if (swab16(magic) == AR5416_EEPROM_MAGIC && 
     38+           !(ah->ah_flags & AH_NO_EEP_SWAP)) { 
    3839+               size = sizeof(struct ar5416_eeprom_def); 
    3940+               need_swap = true; 
     
    4748        } 
    4849  
     50--- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c 
     51+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c 
     52@@ -196,7 +196,7 @@ static int ath9k_hw_4k_check_eeprom(stru 
     53        int i, addr; 
     54  
     55  
     56-       if (!ath9k_hw_use_flash(ah)) { 
     57+       if (!(ah->ah_flags & AH_NO_EEP_SWAP)) { 
     58                if (!ath9k_hw_nvram_read(common, AR5416_EEPROM_MAGIC_OFFSET, 
     59                                         &magic)) { 
     60                        ath_err(common, "Reading Magic # failed\n"); 
     61--- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c 
     62+++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c 
     63@@ -189,7 +189,7 @@ static int ath9k_hw_ar9287_check_eeprom( 
     64        struct ar9287_eeprom *eep = &ah->eeprom.map9287; 
     65        struct ath_common *common = ath9k_hw_common(ah); 
     66  
     67-       if (!ath9k_hw_use_flash(ah)) { 
     68+       if (!(ah->ah_flags & AH_NO_EEP_SWAP)) { 
     69                if (!ath9k_hw_nvram_read(common, AR5416_EEPROM_MAGIC_OFFSET, 
     70                                         &magic)) { 
     71                        ath_err(common, "Reading Magic # failed\n"); 
     72--- a/drivers/net/wireless/ath/ath9k/hw.h 
     73+++ b/drivers/net/wireless/ath/ath9k/hw.h 
     74@@ -662,6 +662,7 @@ enum ath_cal_list { 
     75 #define AH_USE_EEPROM   0x1 
     76 #define AH_UNPLUGGED    0x2 /* The card has been physically removed. */ 
     77 #define AH_FASTCC       0x4 
     78+#define AH_NO_EEP_SWAP  0x8 /* Do not swap EEPROM data */ 
     79  
     80 struct ath_hw { 
     81        struct ath_ops reg_ops; 
     82--- a/drivers/net/wireless/ath/ath9k/init.c 
     83+++ b/drivers/net/wireless/ath/ath9k/init.c 
     84@@ -537,6 +537,8 @@ static int ath9k_init_softc(u16 devid, s 
     85                ah->is_clk_25mhz = pdata->is_clk_25mhz; 
     86                ah->get_mac_revision = pdata->get_mac_revision; 
     87                ah->external_reset = pdata->external_reset; 
     88+               if (!pdata->endian_check) 
     89+                       ah->ah_flags |= AH_NO_EEP_SWAP; 
     90        } 
     91  
     92        common = ath9k_hw_common(ah); 
     93--- a/include/linux/ath9k_platform.h 
     94+++ b/include/linux/ath9k_platform.h 
     95@@ -29,6 +29,7 @@ struct ath9k_platform_data { 
     96        u32 gpio_mask; 
     97        u32 gpio_val; 
     98  
     99+       bool endian_check; 
     100        bool is_clk_25mhz; 
     101        int (*get_mac_revision)(void); 
     102        int (*external_reset)(void); 
  • trunk/target/linux/generic/files/include/linux/ath9k_platform.h

    r29530 r31084  
    3030        u32 gpio_val; 
    3131 
     32        bool endian_check; 
    3233        bool is_clk_25mhz; 
    3334        int (*get_mac_revision)(void); 
  • trunk/target/linux/lantiq/files-3.2/arch/mips/lantiq/xway/dev-wifi-athxk.c

    r31064 r31084  
    2020struct ath9k_platform_data ath9k_pdata = { 
    2121        .led_pin = -1, 
     22        .endian_check = true, 
    2223}; 
    2324 
Note: See TracChangeset for help on using the changeset viewer.