c2f54d6464d8d6d1bafd7d1703debf37c74d31b5
[openwrt/staging/yousong.git] / package / mac80211 / patches / 565-ath9k_fix_txgain.patch
1 --- a/drivers/net/wireless/ath/ath9k/ar9003_hw.c
2 +++ b/drivers/net/wireless/ath/ath9k/ar9003_hw.c
3 @@ -561,8 +561,8 @@ static void ar9003_tx_gain_table_mode1(s
4 5);
5 else if (AR_SREV_9340(ah))
6 INIT_INI_ARRAY(&ah->iniModesTxGain,
7 - ar9340Modes_lowest_ob_db_tx_gain_table_1p0,
8 - ARRAY_SIZE(ar9340Modes_lowest_ob_db_tx_gain_table_1p0),
9 + ar9340Modes_high_ob_db_tx_gain_table_1p0,
10 + ARRAY_SIZE(ar9340Modes_high_ob_db_tx_gain_table_1p0),
11 5);
12 else if (AR_SREV_9485_11(ah))
13 INIT_INI_ARRAY(&ah->iniModesTxGain,
14 @@ -605,8 +605,8 @@ static void ar9003_tx_gain_table_mode2(s
15 5);
16 else if (AR_SREV_9340(ah))
17 INIT_INI_ARRAY(&ah->iniModesTxGain,
18 - ar9340Modes_lowest_ob_db_tx_gain_table_1p0,
19 - ARRAY_SIZE(ar9340Modes_lowest_ob_db_tx_gain_table_1p0),
20 + ar9340Modes_low_ob_db_tx_gain_table_1p0,
21 + ARRAY_SIZE(ar9340Modes_low_ob_db_tx_gain_table_1p0),
22 5);
23 else if (AR_SREV_9485_11(ah))
24 INIT_INI_ARRAY(&ah->iniModesTxGain,
25 @@ -639,8 +639,8 @@ static void ar9003_tx_gain_table_mode3(s
26 5);
27 else if (AR_SREV_9340(ah))
28 INIT_INI_ARRAY(&ah->iniModesTxGain,
29 - ar9340Modes_lowest_ob_db_tx_gain_table_1p0,
30 - ARRAY_SIZE(ar9340Modes_lowest_ob_db_tx_gain_table_1p0),
31 + ar9340Modes_high_power_tx_gain_table_1p0,
32 + ARRAY_SIZE(ar9340Modes_high_power_tx_gain_table_1p0),
33 5);
34 else if (AR_SREV_9485_11(ah))
35 INIT_INI_ARRAY(&ah->iniModesTxGain,
36 @@ -659,6 +659,20 @@ static void ar9003_tx_gain_table_mode3(s
37 5);
38 }
39
40 +static void ar9003_tx_gain_table_mode4(struct ath_hw *ah)
41 +{
42 + if (AR_SREV_9340(ah))
43 + INIT_INI_ARRAY(&ah->iniModesTxGain,
44 + ar9340Modes_mixed_ob_db_tx_gain_table_1p0,
45 + ARRAY_SIZE(ar9340Modes_mixed_ob_db_tx_gain_table_1p0),
46 + 5);
47 + else if (AR_SREV_9580(ah))
48 + INIT_INI_ARRAY(&ah->iniModesTxGain,
49 + ar9580_1p0_mixed_ob_db_tx_gain_table,
50 + ARRAY_SIZE(ar9580_1p0_mixed_ob_db_tx_gain_table),
51 + 5);
52 +}
53 +
54 static void ar9003_tx_gain_table_apply(struct ath_hw *ah)
55 {
56 switch (ar9003_hw_get_tx_gain_idx(ah)) {
57 @@ -675,6 +689,9 @@ static void ar9003_tx_gain_table_apply(s
58 case 3:
59 ar9003_tx_gain_table_mode3(ah);
60 break;
61 + case 4:
62 + ar9003_tx_gain_table_mode4(ah);
63 + break;
64 }
65 }
66