diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/hw.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 60aa8d71e753..1d9ad5bfe0c8 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -121,6 +121,36 @@ void ath9k_hw_write_array(struct ath_hw *ah, const struct ar5416IniArray *array, | |||
121 | REGWRITE_BUFFER_FLUSH(ah); | 121 | REGWRITE_BUFFER_FLUSH(ah); |
122 | } | 122 | } |
123 | 123 | ||
124 | void ath9k_hw_read_array(struct ath_hw *ah, u32 array[][2], int size) | ||
125 | { | ||
126 | u32 *tmp_reg_list, *tmp_data; | ||
127 | int i; | ||
128 | |||
129 | tmp_reg_list = kmalloc(size * sizeof(u32), GFP_KERNEL); | ||
130 | if (!tmp_reg_list) { | ||
131 | dev_err(ah->dev, "%s: tmp_reg_list: alloc filed\n", __func__); | ||
132 | return; | ||
133 | } | ||
134 | |||
135 | tmp_data = kmalloc(size * sizeof(u32), GFP_KERNEL); | ||
136 | if (!tmp_data) { | ||
137 | dev_err(ah->dev, "%s tmp_data: alloc filed\n", __func__); | ||
138 | goto error_tmp_data; | ||
139 | } | ||
140 | |||
141 | for (i = 0; i < size; i++) | ||
142 | tmp_reg_list[i] = array[i][0]; | ||
143 | |||
144 | REG_READ_MULTI(ah, tmp_reg_list, tmp_data, size); | ||
145 | |||
146 | for (i = 0; i < size; i++) | ||
147 | array[i][1] = tmp_data[i]; | ||
148 | |||
149 | kfree(tmp_data); | ||
150 | error_tmp_data: | ||
151 | kfree(tmp_reg_list); | ||
152 | } | ||
153 | |||
124 | u32 ath9k_hw_reverse_bits(u32 val, u32 n) | 154 | u32 ath9k_hw_reverse_bits(u32 val, u32 n) |
125 | { | 155 | { |
126 | u32 retval; | 156 | u32 retval; |
@@ -366,6 +396,9 @@ static void ath9k_hw_init_config(struct ath_hw *ah) | |||
366 | ah->config.rimt_first = 700; | 396 | ah->config.rimt_first = 700; |
367 | } | 397 | } |
368 | 398 | ||
399 | if (AR_SREV_9462(ah) || AR_SREV_9565(ah)) | ||
400 | ah->config.pll_pwrsave = 7; | ||
401 | |||
369 | /* | 402 | /* |
370 | * We need this for PCI devices only (Cardbus, PCI, miniPCI) | 403 | * We need this for PCI devices only (Cardbus, PCI, miniPCI) |
371 | * _and_ if on non-uniprocessor systems (Multiprocessor/HT). | 404 | * _and_ if on non-uniprocessor systems (Multiprocessor/HT). |
@@ -1197,6 +1230,7 @@ static void ath9k_hw_set_operating_mode(struct ath_hw *ah, int opmode) | |||
1197 | u32 mask = AR_STA_ID1_STA_AP | AR_STA_ID1_ADHOC; | 1230 | u32 mask = AR_STA_ID1_STA_AP | AR_STA_ID1_ADHOC; |
1198 | u32 set = AR_STA_ID1_KSRCH_MODE; | 1231 | u32 set = AR_STA_ID1_KSRCH_MODE; |
1199 | 1232 | ||
1233 | ENABLE_REG_RMW_BUFFER(ah); | ||
1200 | switch (opmode) { | 1234 | switch (opmode) { |
1201 | case NL80211_IFTYPE_ADHOC: | 1235 | case NL80211_IFTYPE_ADHOC: |
1202 | if (!AR_SREV_9340_13(ah)) { | 1236 | if (!AR_SREV_9340_13(ah)) { |
@@ -1218,6 +1252,7 @@ static void ath9k_hw_set_operating_mode(struct ath_hw *ah, int opmode) | |||
1218 | break; | 1252 | break; |
1219 | } | 1253 | } |
1220 | REG_RMW(ah, AR_STA_ID1, set, mask); | 1254 | REG_RMW(ah, AR_STA_ID1, set, mask); |
1255 | REG_RMW_BUFFER_FLUSH(ah); | ||
1221 | } | 1256 | } |
1222 | 1257 | ||
1223 | void ath9k_hw_get_delta_slope_vals(struct ath_hw *ah, u32 coef_scaled, | 1258 | void ath9k_hw_get_delta_slope_vals(struct ath_hw *ah, u32 coef_scaled, |
@@ -1930,6 +1965,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, | |||
1930 | if (!ath9k_hw_mci_is_enabled(ah)) | 1965 | if (!ath9k_hw_mci_is_enabled(ah)) |
1931 | REG_WRITE(ah, AR_OBS, 8); | 1966 | REG_WRITE(ah, AR_OBS, 8); |
1932 | 1967 | ||
1968 | ENABLE_REG_RMW_BUFFER(ah); | ||
1933 | if (ah->config.rx_intr_mitigation) { | 1969 | if (ah->config.rx_intr_mitigation) { |
1934 | REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_LAST, ah->config.rimt_last); | 1970 | REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_LAST, ah->config.rimt_last); |
1935 | REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_FIRST, ah->config.rimt_first); | 1971 | REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_FIRST, ah->config.rimt_first); |
@@ -1939,6 +1975,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, | |||
1939 | REG_RMW_FIELD(ah, AR_TIMT, AR_TIMT_LAST, 300); | 1975 | REG_RMW_FIELD(ah, AR_TIMT, AR_TIMT_LAST, 300); |
1940 | REG_RMW_FIELD(ah, AR_TIMT, AR_TIMT_FIRST, 750); | 1976 | REG_RMW_FIELD(ah, AR_TIMT, AR_TIMT_FIRST, 750); |
1941 | } | 1977 | } |
1978 | REG_RMW_BUFFER_FLUSH(ah); | ||
1942 | 1979 | ||
1943 | ath9k_hw_init_bb(ah, chan); | 1980 | ath9k_hw_init_bb(ah, chan); |
1944 | 1981 | ||