mac80211: add initial support for AR9330
[openwrt/svn-archive/archive.git] / package / mac80211 / patches / 546-ath9k-initialize-tx-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 dc0ad4a..264a7ea 100644
3 --- a/drivers/net/wireless/ath/ath9k/ar9003_hw.c
4 +++ b/drivers/net/wireless/ath/ath9k/ar9003_hw.c
5 @@ -328,7 +328,17 @@ static void ar9003_tx_gain_table_apply(struct ath_hw *ah)
6 switch (ar9003_hw_get_tx_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->iniModesTxGain,
12 + ar9331_modes_lowest_ob_db_tx_gain_1p2,
13 + ARRAY_SIZE(ar9331_modes_lowest_ob_db_tx_gain_1p2),
14 + 5);
15 + else if (AR_SREV_9330_11(ah))
16 + INIT_INI_ARRAY(&ah->iniModesTxGain,
17 + ar9331_modes_lowest_ob_db_tx_gain_1p1,
18 + ARRAY_SIZE(ar9331_modes_lowest_ob_db_tx_gain_1p1),
19 + 5);
20 + else if (AR_SREV_9340(ah))
21 INIT_INI_ARRAY(&ah->iniModesTxGain,
22 ar9340Modes_lowest_ob_db_tx_gain_table_1p0,
23 ARRAY_SIZE(ar9340Modes_lowest_ob_db_tx_gain_table_1p0),
24 @@ -345,7 +355,17 @@ static void ar9003_tx_gain_table_apply(struct ath_hw *ah)
25 5);
26 break;
27 case 1:
28 - if (AR_SREV_9340(ah))
29 + if (AR_SREV_9330_12(ah))
30 + INIT_INI_ARRAY(&ah->iniModesTxGain,
31 + ar9331_modes_high_ob_db_tx_gain_1p2,
32 + ARRAY_SIZE(ar9331_modes_high_ob_db_tx_gain_1p2),
33 + 5);
34 + else if (AR_SREV_9330_11(ah))
35 + INIT_INI_ARRAY(&ah->iniModesTxGain,
36 + ar9331_modes_high_ob_db_tx_gain_1p1,
37 + ARRAY_SIZE(ar9331_modes_high_ob_db_tx_gain_1p1),
38 + 5);
39 + else if (AR_SREV_9340(ah))
40 INIT_INI_ARRAY(&ah->iniModesTxGain,
41 ar9340Modes_lowest_ob_db_tx_gain_table_1p0,
42 ARRAY_SIZE(ar9340Modes_lowest_ob_db_tx_gain_table_1p0),
43 @@ -362,7 +382,17 @@ static void ar9003_tx_gain_table_apply(struct ath_hw *ah)
44 5);
45 break;
46 case 2:
47 - if (AR_SREV_9340(ah))
48 + if (AR_SREV_9330_12(ah))
49 + INIT_INI_ARRAY(&ah->iniModesTxGain,
50 + ar9331_modes_low_ob_db_tx_gain_1p2,
51 + ARRAY_SIZE(ar9331_modes_low_ob_db_tx_gain_1p2),
52 + 5);
53 + else if (AR_SREV_9330_11(ah))
54 + INIT_INI_ARRAY(&ah->iniModesTxGain,
55 + ar9331_modes_low_ob_db_tx_gain_1p1,
56 + ARRAY_SIZE(ar9331_modes_low_ob_db_tx_gain_1p1),
57 + 5);
58 + else if (AR_SREV_9340(ah))
59 INIT_INI_ARRAY(&ah->iniModesTxGain,
60 ar9340Modes_lowest_ob_db_tx_gain_table_1p0,
61 ARRAY_SIZE(ar9340Modes_lowest_ob_db_tx_gain_table_1p0),
62 @@ -379,7 +409,17 @@ static void ar9003_tx_gain_table_apply(struct ath_hw *ah)
63 5);
64 break;
65 case 3:
66 - if (AR_SREV_9340(ah))
67 + if (AR_SREV_9330_12(ah))
68 + INIT_INI_ARRAY(&ah->iniModesTxGain,
69 + ar9331_modes_high_power_tx_gain_1p2,
70 + ARRAY_SIZE(ar9331_modes_high_power_tx_gain_1p2),
71 + 5);
72 + else if (AR_SREV_9330_11(ah))
73 + INIT_INI_ARRAY(&ah->iniModesTxGain,
74 + ar9331_modes_high_power_tx_gain_1p1,
75 + ARRAY_SIZE(ar9331_modes_high_power_tx_gain_1p1),
76 + 5);
77 + else if (AR_SREV_9340(ah))
78 INIT_INI_ARRAY(&ah->iniModesTxGain,
79 ar9340Modes_lowest_ob_db_tx_gain_table_1p0,
80 ARRAY_SIZE(ar9340Modes_lowest_ob_db_tx_gain_table_1p0),
81