mac80211: add initial support for AR9330
[openwrt.git] / package / mac80211 / patches / 547-ath9k-initialize-rx-gain-table-for-AR9330.patch
1 diff --git a/drivers/net/wireless/ath/ath9k/ar9003_hw.c b/drivers/net/wireless/ath/ath9k/ar9003_hw.c
2 index 264a7ea..8efdec2 100644
3 --- a/drivers/net/wireless/ath/ath9k/ar9003_hw.c
4 +++ b/drivers/net/wireless/ath/ath9k/ar9003_hw.c
5 @@ -443,7 +443,17 @@ static void ar9003_rx_gain_table_apply(struct ath_hw *ah)
6         switch (ar9003_hw_get_rx_gain_idx(ah)) {
7         case 0:
8         default:
9 -               if (AR_SREV_9340(ah))
10 +               if (AR_SREV_9330_12(ah))
11 +                       INIT_INI_ARRAY(&ah->iniModesRxGain,
12 +                                       ar9331_common_rx_gain_1p2,
13 +                                       ARRAY_SIZE(ar9331_common_rx_gain_1p2),
14 +                                       2);
15 +               else if (AR_SREV_9330_11(ah))
16 +                       INIT_INI_ARRAY(&ah->iniModesRxGain,
17 +                                       ar9331_common_rx_gain_1p1,
18 +                                       ARRAY_SIZE(ar9331_common_rx_gain_1p1),
19 +                                       2);
20 +               else if (AR_SREV_9340(ah))
21                         INIT_INI_ARRAY(&ah->iniModesRxGain,
22                                        ar9340Common_rx_gain_table_1p0,
23                                        ARRAY_SIZE(ar9340Common_rx_gain_table_1p0),
24 @@ -460,7 +470,17 @@ static void ar9003_rx_gain_table_apply(struct ath_hw *ah)
25                                        2);
26                 break;
27         case 1:
28 -               if (AR_SREV_9340(ah))
29 +               if (AR_SREV_9330_12(ah))
30 +                       INIT_INI_ARRAY(&ah->iniModesRxGain,
31 +                               ar9331_common_wo_xlna_rx_gain_1p2,
32 +                               ARRAY_SIZE(ar9331_common_wo_xlna_rx_gain_1p2),
33 +                               2);
34 +               else if (AR_SREV_9330_11(ah))
35 +                       INIT_INI_ARRAY(&ah->iniModesRxGain,
36 +                               ar9331_common_wo_xlna_rx_gain_1p1,
37 +                               ARRAY_SIZE(ar9331_common_wo_xlna_rx_gain_1p1),
38 +                               2);
39 +               else if (AR_SREV_9340(ah))
40                         INIT_INI_ARRAY(&ah->iniModesRxGain,
41                                        ar9340Common_wo_xlna_rx_gain_table_1p0,
42                                        ARRAY_SIZE(ar9340Common_wo_xlna_rx_gain_table_1p0),
43