6be78881447a23260963896773d0e997ec0438d9
[openwrt-10.03/.git] / package / mac80211 / patches / 406-ath9k-set-AH_USE_EEPROM-only-if-no-platform-data-present.patch
1 --- a/drivers/net/wireless/ath/ath9k/hw.c
2 +++ b/drivers/net/wireless/ath/ath9k/hw.c
3 @@ -403,11 +403,8 @@ static void ath9k_hw_init_defaults(struc
4         ah->hw_version.magic = AR5416_MAGIC;
5         ah->hw_version.subvendorid = 0;
6  
7 -       ah->ah_flags = 0;
8         if (ah->hw_version.devid == AR5416_AR9100_DEVID)
9                 ah->hw_version.macVersion = AR_SREV_VERSION_9100;
10 -       if (!AR_SREV_9100(ah))
11 -               ah->ah_flags = AH_USE_EEPROM;
12  
13         ah->atim_window = 0;
14         ah->sta_id1_defaults = AR_STA_ID1_CRPT_MIC_ENABLE;
15 --- a/drivers/net/wireless/ath/ath9k/main.c
16 +++ b/drivers/net/wireless/ath/ath9k/main.c
17 @@ -15,6 +15,7 @@
18   */
19  
20  #include <linux/nl80211.h>
21 +#include <linux/ath9k_platform.h>
22  #include "ath9k.h"
23  #include "btcoex.h"
24  
25 @@ -1597,6 +1598,7 @@ static int ath_init_softc(u16 devid, str
26  {
27         struct ath_hw *ah = NULL;
28         struct ath_common *common;
29 +       struct ath9k_platform_data *pdata;
30         int r = 0, i;
31         int csz = 0;
32         int qnum;
33 @@ -1619,6 +1621,10 @@ static int ath_init_softc(u16 devid, str
34  
35         ah->hw_version.devid = devid;
36         ah->hw_version.subsysid = subsysid;
37 +       pdata = (struct ath9k_platform_data *) sc->dev->platform_data;
38 +       if (!pdata)
39 +               ah->ah_flags |= AH_USE_EEPROM;
40 +
41         sc->sc_ah = ah;
42  
43         common = ath9k_hw_common(ah);