iPXE
ath9k_ar9002_hw.c File Reference
#include "hw.h"
#include "ar5008_initvals.h"
#include "ar9001_initvals.h"
#include "ar9002_initvals.h"
#include "ar9002_phy.h"

Go to the source code of this file.

Functions

 FILE_LICENCE (BSD2)
 FILE_SECBOOT (FORBIDDEN)
static void ar9002_hw_init_mode_regs (struct ath_hw *ah)
void ar9002_hw_cck_chan14_spread (struct ath_hw *ah)
static void ar9280_20_hw_init_rxgain_ini (struct ath_hw *ah)
static void ar9280_20_hw_init_txgain_ini (struct ath_hw *ah)
static void ar9002_hw_init_mode_gain_regs (struct ath_hw *ah)
static void ar9002_hw_configpcipowersave (struct ath_hw *ah, int restore, int power_off)
static int ar9002_hw_get_radiorev (struct ath_hw *ah)
int ar9002_hw_rf_claim (struct ath_hw *ah)
void ar9002_hw_enable_async_fifo (struct ath_hw *ah)
void ar9002_hw_update_async_fifo (struct ath_hw *ah)
void ar9002_hw_enable_wep_aggregation (struct ath_hw *ah)
void ar9002_hw_attach_ops (struct ath_hw *ah)
void ar9002_hw_load_ani_reg (struct ath_hw *ah, struct ath9k_channel *chan)

Variables

int modparam_force_new_ani

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( BSD2 )

◆ FILE_SECBOOT()

FILE_SECBOOT ( FORBIDDEN )

◆ ar9002_hw_init_mode_regs()

void ar9002_hw_init_mode_regs ( struct ath_hw * ah)
static

Definition at line 33 of file ath9k_ar9002_hw.c.

34{
35 if (AR_SREV_9271(ah)) {
40 INIT_INI_ARRAY(&ah->iniCommon_normal_cck_fir_coeff_9271,
43 INIT_INI_ARRAY(&ah->iniCommon_japan_2484_cck_fir_coeff_9271,
46 INIT_INI_ARRAY(&ah->iniModes_9271_1_0_only,
49 INIT_INI_ARRAY(&ah->iniModes_9271_ANI_reg, ar9271Modes_9271_ANI_reg,
51 INIT_INI_ARRAY(&ah->iniModes_high_power_tx_gain_9271,
54 INIT_INI_ARRAY(&ah->iniModes_normal_power_tx_gain_9271,
57 return;
58 }
59
65 if (ah->config.pcie_clock_req)
66 INIT_INI_ARRAY(&ah->iniPcieSerdes,
69 else
70 INIT_INI_ARRAY(&ah->iniPcieSerdes,
73 2);
74 } else if (AR_SREV_9285_12_OR_LATER(ah)) {
75
76
81
82 if (ah->config.pcie_clock_req) {
83 INIT_INI_ARRAY(&ah->iniPcieSerdes,
86 } else {
87 INIT_INI_ARRAY(&ah->iniPcieSerdes,
90 2);
91 }
92 } else if (AR_SREV_9280_20_OR_LATER(ah)) {
97
98 if (ah->config.pcie_clock_req) {
99 INIT_INI_ARRAY(&ah->iniPcieSerdes,
102 } else {
103 INIT_INI_ARRAY(&ah->iniPcieSerdes,
106 }
107 INIT_INI_ARRAY(&ah->iniModesAdditional,
110 } else if (AR_SREV_9160_10_OR_LATER(ah)) {
117 INIT_INI_ARRAY(&ah->iniBB_RfGain, ar5416BB_RfGain_9160,
131 if (AR_SREV_9160_11(ah)) {
132 INIT_INI_ARRAY(&ah->iniAddac,
135 } else {
138 }
139 } else if (AR_SREV_9100_OR_LATER(ah)) {
146 INIT_INI_ARRAY(&ah->iniBB_RfGain, ar5416BB_RfGain_9100,
162 } else {
163 INIT_INI_ARRAY(&ah->iniModes, ar5416Modes,
165 INIT_INI_ARRAY(&ah->iniCommon, ar5416Common,
167 INIT_INI_ARRAY(&ah->iniBank0, ar5416Bank0,
169 INIT_INI_ARRAY(&ah->iniBB_RfGain, ar5416BB_RfGain,
171 INIT_INI_ARRAY(&ah->iniBank1, ar5416Bank1,
173 INIT_INI_ARRAY(&ah->iniBank2, ar5416Bank2,
175 INIT_INI_ARRAY(&ah->iniBank3, ar5416Bank3,
177 INIT_INI_ARRAY(&ah->iniBank6, ar5416Bank6,
179 INIT_INI_ARRAY(&ah->iniBank6TPC, ar5416Bank6TPC,
181 INIT_INI_ARRAY(&ah->iniBank7, ar5416Bank7,
183 INIT_INI_ARRAY(&ah->iniAddac, ar5416Addac,
185 }
186}
static const u32 ar5416Bank1[][2]
static const u32 ar5416BB_RfGain[][3]
static const u32 ar5416Bank6[][3]
static const u32 ar5416Addac[][2]
static const u32 ar5416Common[][2]
static const u32 ar5416Bank7[][2]
static const u32 ar5416Bank2[][2]
static const u32 ar5416Modes[][6]
static const u32 ar5416Bank3[][3]
static const u32 ar5416Bank6TPC[][3]
static const u32 ar5416Bank0[][2]
static const u32 ar5416Bank7_9160[][2]
static const u32 ar5416Bank0_9100[][2]
static const u32 ar5416Common_9100[][2]
static const u32 ar5416Bank6TPC_9100[][3]
static const u32 ar5416Bank3_9160[][3]
static const u32 ar5416BB_RfGain_9100[][3]
static const u32 ar5416Bank3_9100[][3]
static const u32 ar5416Bank6_9160[][3]
static const u32 ar5416Addac_9100[][2]
static const u32 ar5416Bank6TPC_9160[][3]
static const u32 ar5416Bank6_9100[][3]
static const u32 ar5416Bank7_9100[][2]
static const u32 ar5416Bank2_9160[][2]
static const u32 ar5416Addac_9160[][2]
static const u32 ar5416Bank1_9100[][2]
static const u32 ar5416Addac_9160_1_1[][2]
static const u32 ar5416Common_9160[][2]
static const u32 ar5416Modes_9100[][6]
static const u32 ar5416Bank0_9160[][2]
static const u32 ar5416Bank2_9100[][2]
static const u32 ar5416Modes_9160[][6]
static const u32 ar5416BB_RfGain_9160[][3]
static const u32 ar5416Bank1_9160[][2]
static __unused const u32 ar9285PciePhy_clkreq_off_L1_9285_1_2[][2]
static __unused const u32 ar9280Modes_fast_clock_9280_2[][3]
static __unused const u32 ar9271Modes_9271_ANI_reg[][6]
static __unused const u32 ar9287Common_9287_1_1[][2]
static __unused const u32 ar9280PciePhy_clkreq_off_L1_9280[][2]
static __unused const u32 ar9285PciePhy_clkreq_always_on_L1_9285_1_2[][2]
static __unused const u32 ar9271Common_9271[][2]
static __unused const u32 ar9271Modes_normal_power_tx_gain_9271[][6]
static __unused const u32 ar9285Common_9285_1_2[][2]
static __unused const u32 ar9271Modes_high_power_tx_gain_9271[][6]
static __unused const u32 ar9280PciePhy_clkreq_always_on_L1_9280[][2]
static __unused const u32 ar9280Common_9280_2[][2]
static __unused const u32 ar9287PciePhy_clkreq_always_on_L1_9287_1_1[][2]
static __unused const u32 ar9271Common_normal_cck_fir_coeff_9271[][2]
static __unused const u32 ar9287Modes_9287_1_1[][6]
static __unused const u32 ar9271Modes_9271_1_0_only[][6]
static __unused const u32 ar9280Modes_9280_2[][6]
static __unused const u32 ar9271Modes_9271[][6]
static __unused const u32 ar9271Common_japan_2484_cck_fir_coeff_9271[][2]
static __unused const u32 ar9285Modes_9285_1_2[][6]
static __unused const u32 ar9287PciePhy_clkreq_off_L1_9287_1_1[][2]
#define AR_SREV_9285_12_OR_LATER(_ah)
Definition reg.h:832
#define AR_SREV_9287_11_OR_LATER(_ah)
Definition reg.h:837
#define AR_SREV_9280_20_OR_LATER(_ah)
Definition reg.h:825
#define AR_SREV_9100_OR_LATER(_ah)
Definition reg.h:813
#define AR_SREV_9271(_ah)
Definition reg.h:854
#define AR_SREV_9160_10_OR_LATER(_ah)
Definition reg.h:818
#define AR_SREV_9160_11(_ah)
Definition reg.h:820
#define INIT_INI_ARRAY(iniarray, array, rows, columns)
Definition calib.h:40
#define ARRAY_SIZE(x)
Definition efx_common.h:43
uint8_t ah
Definition registers.h:1

References ah, ar5416Addac, ar5416Addac_9100, ar5416Addac_9160, ar5416Addac_9160_1_1, ar5416Bank0, ar5416Bank0_9100, ar5416Bank0_9160, ar5416Bank1, ar5416Bank1_9100, ar5416Bank1_9160, ar5416Bank2, ar5416Bank2_9100, ar5416Bank2_9160, ar5416Bank3, ar5416Bank3_9100, ar5416Bank3_9160, ar5416Bank6, ar5416Bank6_9100, ar5416Bank6_9160, ar5416Bank6TPC, ar5416Bank6TPC_9100, ar5416Bank6TPC_9160, ar5416Bank7, ar5416Bank7_9100, ar5416Bank7_9160, ar5416BB_RfGain, ar5416BB_RfGain_9100, ar5416BB_RfGain_9160, ar5416Common, ar5416Common_9100, ar5416Common_9160, ar5416Modes, ar5416Modes_9100, ar5416Modes_9160, ar9271Common_9271, ar9271Common_japan_2484_cck_fir_coeff_9271, ar9271Common_normal_cck_fir_coeff_9271, ar9271Modes_9271, ar9271Modes_9271_1_0_only, ar9271Modes_9271_ANI_reg, ar9271Modes_high_power_tx_gain_9271, ar9271Modes_normal_power_tx_gain_9271, ar9280Common_9280_2, ar9280Modes_9280_2, ar9280Modes_fast_clock_9280_2, ar9280PciePhy_clkreq_always_on_L1_9280, ar9280PciePhy_clkreq_off_L1_9280, ar9285Common_9285_1_2, ar9285Modes_9285_1_2, ar9285PciePhy_clkreq_always_on_L1_9285_1_2, ar9285PciePhy_clkreq_off_L1_9285_1_2, ar9287Common_9287_1_1, ar9287Modes_9287_1_1, ar9287PciePhy_clkreq_always_on_L1_9287_1_1, ar9287PciePhy_clkreq_off_L1_9287_1_1, AR_SREV_9100_OR_LATER, AR_SREV_9160_10_OR_LATER, AR_SREV_9160_11, AR_SREV_9271, AR_SREV_9280_20_OR_LATER, AR_SREV_9285_12_OR_LATER, AR_SREV_9287_11_OR_LATER, ARRAY_SIZE, and INIT_INI_ARRAY.

Referenced by ar9002_hw_attach_ops().

◆ ar9002_hw_cck_chan14_spread()

void ar9002_hw_cck_chan14_spread ( struct ath_hw * ah)

Definition at line 189 of file ath9k_ar9002_hw.c.

190{
192 INIT_INI_ARRAY(&ah->iniCckfirNormal,
195 2);
196 INIT_INI_ARRAY(&ah->iniCckfirJapan2484,
199 2);
200 }
201}
static __unused const u32 ar9287Common_japan_2484_cck_fir_coeff_9287_1_1[][2]
static __unused const u32 ar9287Common_normal_cck_fir_coeff_9287_1_1[][2]

References ah, ar9287Common_japan_2484_cck_fir_coeff_9287_1_1, ar9287Common_normal_cck_fir_coeff_9287_1_1, AR_SREV_9287_11_OR_LATER, ARRAY_SIZE, and INIT_INI_ARRAY.

Referenced by __ath9k_hw_init().

◆ ar9280_20_hw_init_rxgain_ini()

void ar9280_20_hw_init_rxgain_ini ( struct ath_hw * ah)
static

Definition at line 203 of file ath9k_ar9002_hw.c.

204{
205 u32 rxgain_type;
206
207 if (ah->eep_ops->get_eeprom(ah, EEP_MINOR_REV) >=
209 rxgain_type = ah->eep_ops->get_eeprom(ah, EEP_RXGAIN_TYPE);
210
211 if (rxgain_type == AR5416_EEP_RXGAIN_13DB_BACKOFF)
212 INIT_INI_ARRAY(&ah->iniModesRxGain,
215 else if (rxgain_type == AR5416_EEP_RXGAIN_23DB_BACKOFF)
216 INIT_INI_ARRAY(&ah->iniModesRxGain,
219 else
220 INIT_INI_ARRAY(&ah->iniModesRxGain,
223 } else {
224 INIT_INI_ARRAY(&ah->iniModesRxGain,
227 }
228}
static __unused const u32 ar9280Modes_backoff_23db_rxgain_9280_2[][6]
static __unused const u32 ar9280Modes_backoff_13db_rxgain_9280_2[][6]
static __unused const u32 ar9280Modes_original_rxgain_9280_2[][6]
#define AR5416_EEP_MINOR_VER_17
Definition eeprom.h:139
#define AR5416_EEP_RXGAIN_23DB_BACKOFF
Definition eeprom.h:165
#define AR5416_EEP_RXGAIN_13DB_BACKOFF
Definition eeprom.h:166
@ EEP_RXGAIN_TYPE
Definition eeprom.h:245
@ EEP_MINOR_REV
Definition eeprom.h:241
#define u32
Definition vga.h:21

References ah, AR5416_EEP_MINOR_VER_17, AR5416_EEP_RXGAIN_13DB_BACKOFF, AR5416_EEP_RXGAIN_23DB_BACKOFF, ar9280Modes_backoff_13db_rxgain_9280_2, ar9280Modes_backoff_23db_rxgain_9280_2, ar9280Modes_original_rxgain_9280_2, ARRAY_SIZE, EEP_MINOR_REV, EEP_RXGAIN_TYPE, INIT_INI_ARRAY, and u32.

Referenced by ar9002_hw_init_mode_gain_regs().

◆ ar9280_20_hw_init_txgain_ini()

void ar9280_20_hw_init_txgain_ini ( struct ath_hw * ah)
static

Definition at line 230 of file ath9k_ar9002_hw.c.

231{
232 u32 txgain_type;
233
234 if (ah->eep_ops->get_eeprom(ah, EEP_MINOR_REV) >=
236 txgain_type = ah->eep_ops->get_eeprom(ah, EEP_TXGAIN_TYPE);
237
238 if (txgain_type == AR5416_EEP_TXGAIN_HIGH_POWER)
239 INIT_INI_ARRAY(&ah->iniModesTxGain,
242 else
243 INIT_INI_ARRAY(&ah->iniModesTxGain,
246 } else {
247 INIT_INI_ARRAY(&ah->iniModesTxGain,
250 }
251}
static __unused const u32 ar9280Modes_high_power_tx_gain_9280_2[][6]
static __unused const u32 ar9280Modes_original_tx_gain_9280_2[][6]
@ EEP_TXGAIN_TYPE
Definition eeprom.h:247
#define AR5416_EEP_MINOR_VER_19
Definition eeprom.h:140
#define AR5416_EEP_TXGAIN_HIGH_POWER
Definition eeprom.h:171

References ah, AR5416_EEP_MINOR_VER_19, AR5416_EEP_TXGAIN_HIGH_POWER, ar9280Modes_high_power_tx_gain_9280_2, ar9280Modes_original_tx_gain_9280_2, ARRAY_SIZE, EEP_MINOR_REV, EEP_TXGAIN_TYPE, INIT_INI_ARRAY, and u32.

Referenced by ar9002_hw_init_mode_gain_regs().

◆ ar9002_hw_init_mode_gain_regs()

void ar9002_hw_init_mode_gain_regs ( struct ath_hw * ah)
static

Definition at line 253 of file ath9k_ar9002_hw.c.

254{
256 INIT_INI_ARRAY(&ah->iniModesRxGain,
259 else if (AR_SREV_9280_20(ah))
261
263 INIT_INI_ARRAY(&ah->iniModesTxGain,
266 } else if (AR_SREV_9280_20(ah)) {
268 } else if (AR_SREV_9285_12_OR_LATER(ah)) {
269 u32 txgain_type = ah->eep_ops->get_eeprom(ah, EEP_TXGAIN_TYPE);
270
271 /* txgain table */
272 if (txgain_type == AR5416_EEP_TXGAIN_HIGH_POWER) {
273 if (AR_SREV_9285E_20(ah)) {
274 INIT_INI_ARRAY(&ah->iniModesTxGain,
278 } else {
279 INIT_INI_ARRAY(&ah->iniModesTxGain,
283 }
284 } else {
285 if (AR_SREV_9285E_20(ah)) {
286 INIT_INI_ARRAY(&ah->iniModesTxGain,
290 } else {
291 INIT_INI_ARRAY(&ah->iniModesTxGain,
295 }
296 }
297 }
298}
static __unused const u32 ar9287Modes_tx_gain_9287_1_1[][6]
static __unused const u32 ar9285Modes_high_power_tx_gain_9285_1_2[][6]
static __unused const u32 ar9285Modes_original_tx_gain_9285_1_2[][6]
static __unused const u32 ar9285Modes_XE2_0_normal_power[][6]
static __unused const u32 ar9285Modes_XE2_0_high_power[][6]
static __unused const u32 ar9287Modes_rx_gain_9287_1_1[][6]
#define AR_SREV_9280_20(_ah)
Definition reg.h:827
#define AR_SREV_9285E_20(_ah)
Definition reg.h:882
static void ar9280_20_hw_init_txgain_ini(struct ath_hw *ah)
static void ar9280_20_hw_init_rxgain_ini(struct ath_hw *ah)

References ah, AR5416_EEP_TXGAIN_HIGH_POWER, ar9280_20_hw_init_rxgain_ini(), ar9280_20_hw_init_txgain_ini(), ar9285Modes_high_power_tx_gain_9285_1_2, ar9285Modes_original_tx_gain_9285_1_2, ar9285Modes_XE2_0_high_power, ar9285Modes_XE2_0_normal_power, ar9287Modes_rx_gain_9287_1_1, ar9287Modes_tx_gain_9287_1_1, AR_SREV_9280_20, AR_SREV_9285_12_OR_LATER, AR_SREV_9285E_20, AR_SREV_9287_11_OR_LATER, ARRAY_SIZE, EEP_TXGAIN_TYPE, INIT_INI_ARRAY, and u32.

Referenced by ar9002_hw_attach_ops().

◆ ar9002_hw_configpcipowersave()

void ar9002_hw_configpcipowersave ( struct ath_hw * ah,
int restore,
int power_off )
static

Definition at line 309 of file ath9k_ar9002_hw.c.

312{
313 u8 i;
314 u32 val;
315
316 if (ah->is_pciexpress != 1)
317 return;
318
319 /* Do not touch SerDes registers */
320 if (ah->config.pcie_powersave_enable == 2)
321 return;
322
323 /* Nothing to do on restore for 11N */
324 if (!restore) {
326 /*
327 * AR9280 2.0 or later chips use SerDes values from the
328 * initvals.h initialized depending on chipset during
329 * __ath9k_hw_init()
330 */
331 for (i = 0; i < ah->iniPcieSerdes.ia_rows; i++) {
332 REG_WRITE(ah, INI_RA(&ah->iniPcieSerdes, i, 0),
333 INI_RA(&ah->iniPcieSerdes, i, 1));
334 }
335 } else {
337
338 REG_WRITE(ah, AR_PCIE_SERDES, 0x9248fc00);
339 REG_WRITE(ah, AR_PCIE_SERDES, 0x24924924);
340
341 /* RX shut off when elecidle is asserted */
342 REG_WRITE(ah, AR_PCIE_SERDES, 0x28000039);
343 REG_WRITE(ah, AR_PCIE_SERDES, 0x53160824);
344 REG_WRITE(ah, AR_PCIE_SERDES, 0xe5980579);
345
346 /*
347 * Ignore ah->ah_config.pcie_clock_req setting for
348 * pre-AR9280 11n
349 */
350 REG_WRITE(ah, AR_PCIE_SERDES, 0x001defff);
351
352 REG_WRITE(ah, AR_PCIE_SERDES, 0x1aaabe40);
353 REG_WRITE(ah, AR_PCIE_SERDES, 0xbe105554);
354 REG_WRITE(ah, AR_PCIE_SERDES, 0x000e3007);
355
356 /* Load the new settings */
357 REG_WRITE(ah, AR_PCIE_SERDES2, 0x00000000);
358
360 }
361
362 udelay(1000);
363 }
364
365 if (power_off) {
366 /* clear bit 19 to disable L1 */
368
369 val = REG_READ(ah, AR_WA);
370
371 /*
372 * Set PCIe workaround bits
373 * In AR9280 and AR9285, bit 14 in WA register (disable L1)
374 * should only be set when device enters D3 and be
375 * cleared when device comes back to D0.
376 */
377 if (ah->config.pcie_waen) {
378 if (ah->config.pcie_waen & AR_WA_D3_L1_DISABLE)
380 } else {
381 if (((AR_SREV_9285(ah) ||
382 AR_SREV_9271(ah) ||
383 AR_SREV_9287(ah)) &&
385 (AR_SREV_9280(ah) &&
388 }
389 }
390
392 /*
393 * Disable bit 6 and 7 before entering D3 to
394 * prevent system hang.
395 */
396 val &= ~(AR_WA_BIT6 | AR_WA_BIT7);
397 }
398
399 if (AR_SREV_9280(ah))
400 val |= AR_WA_BIT22;
401
402 if (AR_SREV_9285E_20(ah))
403 val |= AR_WA_BIT23;
404
406 } else {
407 if (ah->config.pcie_waen) {
408 val = ah->config.pcie_waen;
409 if (!power_off)
411 } else {
412 if (AR_SREV_9285(ah) ||
413 AR_SREV_9271(ah) ||
414 AR_SREV_9287(ah)) {
416 if (!power_off)
418 }
419 else if (AR_SREV_9280(ah)) {
420 /*
421 * For AR9280 chips, bit 22 of 0x4004
422 * needs to be set.
423 */
425 if (!power_off)
427 } else {
429 }
430 }
431
432 /* WAR for ASPM system hang */
435
436 if (AR_SREV_9285E_20(ah))
437 val |= AR_WA_BIT23;
438
440
441 /* set bit 19 to allow forcing of pcie core into L1 state */
443 }
444}
#define AR_SREV_9287(_ah)
Definition reg.h:835
#define AR_WA_BIT6
Definition reg.h:700
#define AR9280_WA_DEFAULT
Definition reg.h:711
#define AR_PCIE_SERDES2
Definition reg.h:983
#define AR_WA_BIT7
Definition reg.h:701
#define AR_PCIE_SERDES
Definition reg.h:982
#define AR_SREV_9280(_ah)
Definition reg.h:823
#define AR_SREV_9285(_ah)
Definition reg.h:830
#define AR_WA_DEFAULT
Definition reg.h:712
#define AR_PCIE_PM_CTRL_ENA
Definition reg.h:985
#define AR9285_WA_DEFAULT
Definition reg.h:710
#define AR_PCIE_PM_CTRL
Definition reg.h:984
#define AR_WA
Definition reg.h:699
#define AR_WA_BIT23
Definition reg.h:702
#define AR_WA_BIT22
Definition reg.h:709
#define AR_WA_D3_L1_DISABLE
Definition reg.h:703
#define INI_RA(iniarray, row, column)
Definition calib.h:46
#define REGWRITE_BUFFER_FLUSH(_ah)
Definition hw.h:96
#define REG_WRITE(_ah, _reg, _val)
Definition hw.h:78
#define REG_READ(_ah, _reg)
Definition hw.h:81
#define ENABLE_REGWRITE_BUFFER(_ah)
Definition hw.h:90
#define REG_CLR_BIT(_a, _r, _f)
Definition hw.h:110
#define REG_SET_BIT(_a, _r, _f)
Definition hw.h:108
#define u8
Definition igbvf_osdep.h:40
void __asmcall int val
Definition setjmp.h:12
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
Definition timer.c:61

References ah, AR9280_WA_DEFAULT, AR9285_WA_DEFAULT, AR_PCIE_PM_CTRL, AR_PCIE_PM_CTRL_ENA, AR_PCIE_SERDES, AR_PCIE_SERDES2, AR_SREV_9271, AR_SREV_9280, AR_SREV_9280_20_OR_LATER, AR_SREV_9285, AR_SREV_9285E_20, AR_SREV_9287, AR_WA, AR_WA_BIT22, AR_WA_BIT23, AR_WA_BIT6, AR_WA_BIT7, AR_WA_D3_L1_DISABLE, AR_WA_DEFAULT, ENABLE_REGWRITE_BUFFER, INI_RA, REG_CLR_BIT, REG_READ, REG_SET_BIT, REG_WRITE, REGWRITE_BUFFER_FLUSH, u32, u8, udelay(), and val.

Referenced by ar9002_hw_attach_ops().

◆ ar9002_hw_get_radiorev()

int ar9002_hw_get_radiorev ( struct ath_hw * ah)
static

Definition at line 446 of file ath9k_ar9002_hw.c.

447{
448 u32 val;
449 int i;
450
452
453 REG_WRITE(ah, AR_PHY(0x36), 0x00007058);
454 for (i = 0; i < 8; i++)
455 REG_WRITE(ah, AR_PHY(0x20), 0x00010000);
456
458
459 val = (REG_READ(ah, AR_PHY(256)) >> 24) & 0xff;
460 val = ((val & 0xf0) >> 4) | ((val & 0x0f) << 4);
461
462 return ath9k_hw_reverse_bits(val, 8);
463}
u32 ath9k_hw_reverse_bits(u32 val, u32 n)
Definition ath9k_hw.c:127
#define AR_PHY(_n)
Definition phy.h:28

References ah, AR_PHY, ath9k_hw_reverse_bits(), ENABLE_REGWRITE_BUFFER, REG_READ, REG_WRITE, REGWRITE_BUFFER_FLUSH, u32, and val.

Referenced by ar9002_hw_rf_claim().

◆ ar9002_hw_rf_claim()

int ar9002_hw_rf_claim ( struct ath_hw * ah)

Definition at line 465 of file ath9k_ar9002_hw.c.

466{
467 u32 val;
468
469 REG_WRITE(ah, AR_PHY(0), 0x00000007);
470
472 switch (val & AR_RADIO_SREV_MAJOR) {
473 case 0:
475 break;
480 break;
481 default:
482 DBG("ath9k: "
483 "Radio Chip Rev 0x%02X not supported\n",
485 return -EOPNOTSUPP;
486 }
487
488 ah->hw_version.analog5GhzRev = val;
489
490 return 0;
491}
#define AR_RAD5122_SREV_MAJOR
Definition reg.h:899
#define AR_RAD5133_SREV_MAJOR
Definition reg.h:897
#define AR_RAD2122_SREV_MAJOR
Definition reg.h:900
#define AR_RAD2133_SREV_MAJOR
Definition reg.h:898
#define AR_RADIO_SREV_MAJOR
Definition reg.h:896
static int ar9002_hw_get_radiorev(struct ath_hw *ah)
#define DBG(...)
Print a debugging message.
Definition compiler.h:498
#define EOPNOTSUPP
Operation not supported on socket.
Definition errno.h:605

References ah, ar9002_hw_get_radiorev(), AR_PHY, AR_RAD2122_SREV_MAJOR, AR_RAD2133_SREV_MAJOR, AR_RAD5122_SREV_MAJOR, AR_RAD5133_SREV_MAJOR, AR_RADIO_SREV_MAJOR, DBG, EOPNOTSUPP, REG_WRITE, u32, and val.

Referenced by ath9k_hw_post_init().

◆ ar9002_hw_enable_async_fifo()

◆ ar9002_hw_update_async_fifo()

void ar9002_hw_update_async_fifo ( struct ath_hw * ah)

Definition at line 513 of file ath9k_ar9002_hw.c.

514{
522
525
530 }
531}
#define AR_AHB_MODE
Definition reg.h:902
#define AR_TIME_OUT
Definition reg.h:1462
#define AR_D_GBL_IFS_SIFS_ASYNC_FIFO_DUR
Definition reg.h:606
#define AR_MAC_PCU_LOGIC_ANALYZER_DISBUG20768
Definition reg.h:1815
#define AR_D_GBL_IFS_SLOT
Definition reg.h:619
#define AR_AHB_CUSTOM_BURST_ASYNC_FIFO_VAL
Definition reg.h:913
#define AR_D_GBL_IFS_EIFS_ASYNC_FIFO_DUR
Definition reg.h:627
#define AR_TIME_OUT_ACK_CTS_ASYNC_FIFO_DUR
Definition reg.h:1467
#define AR_D_GBL_IFS_SLOT_ASYNC_FIFO_DUR
Definition reg.h:622
#define AR_MAC_PCU_LOGIC_ANALYZER
Definition reg.h:1814
#define AR_D_GBL_IFS_SIFS
Definition reg.h:604
#define AR_AHB_CUSTOM_BURST_EN
Definition reg.h:911
#define AR_USEC_ASYNC_FIFO_DUR
Definition reg.h:1483
#define AR_USEC
Definition reg.h:1477
#define AR_D_GBL_IFS_EIFS
Definition reg.h:624
#define REG_RMW_FIELD(_a, _r, _f, _v)
Definition hw.h:104

References ah, AR_AHB_CUSTOM_BURST_ASYNC_FIFO_VAL, AR_AHB_CUSTOM_BURST_EN, AR_AHB_MODE, AR_D_GBL_IFS_EIFS, AR_D_GBL_IFS_EIFS_ASYNC_FIFO_DUR, AR_D_GBL_IFS_SIFS, AR_D_GBL_IFS_SIFS_ASYNC_FIFO_DUR, AR_D_GBL_IFS_SLOT, AR_D_GBL_IFS_SLOT_ASYNC_FIFO_DUR, AR_MAC_PCU_LOGIC_ANALYZER, AR_MAC_PCU_LOGIC_ANALYZER_DISBUG20768, AR_SREV_9287_13_OR_LATER, AR_TIME_OUT, AR_TIME_OUT_ACK_CTS_ASYNC_FIFO_DUR, AR_USEC, AR_USEC_ASYNC_FIFO_DUR, REG_RMW_FIELD, REG_SET_BIT, and REG_WRITE.

Referenced by ath9k_hw_reset().

◆ ar9002_hw_enable_wep_aggregation()

void ar9002_hw_enable_wep_aggregation ( struct ath_hw * ah)

Definition at line 537 of file ath9k_ar9002_hw.c.

538{
542 }
543}
#define AR_PCU_MISC_MODE2
Definition reg.h:1831
#define AR_PCU_MISC_MODE2_ENABLE_AGGWEP
Definition reg.h:1841

References ah, AR_PCU_MISC_MODE2, AR_PCU_MISC_MODE2_ENABLE_AGGWEP, AR_SREV_9287_13_OR_LATER, and REG_SET_BIT.

Referenced by ath9k_hw_reset().

◆ ar9002_hw_attach_ops()

void ar9002_hw_attach_ops ( struct ath_hw * ah)

Definition at line 546 of file ath9k_ar9002_hw.c.

547{
548 struct ath_hw_private_ops *priv_ops = ath9k_hw_private_ops(ah);
549 struct ath_hw_ops *ops = ath9k_hw_ops(ah);
550
553
555
559
562}
void ar5008_hw_attach_phy_ops(struct ath_hw *ah)
void ar9002_hw_attach_calib_ops(struct ath_hw *ah)
static void ar9002_hw_configpcipowersave(struct ath_hw *ah, int restore, int power_off)
static void ar9002_hw_init_mode_gain_regs(struct ath_hw *ah)
static void ar9002_hw_init_mode_regs(struct ath_hw *ah)
void ar9002_hw_attach_mac_ops(struct ath_hw *ah)
void ar9002_hw_attach_phy_ops(struct ath_hw *ah)
static struct ath_hw_private_ops * ath9k_hw_private_ops(struct ath_hw *ah)
Definition hw.h:880
static struct ath_hw_ops * ath9k_hw_ops(struct ath_hw *ah)
Definition hw.h:885
struct ath_hw_ops - callbacks used by hardware code and driver code
Definition hw.h:604
void(* config_pci_powersave)(struct ath_hw *ah, int restore, int power_off)
Definition hw.h:605
struct ath_hw_private_ops - callbacks used internally by hardware code
Definition hw.h:551
void(* init_mode_regs)(struct ath_hw *ah)
Definition hw.h:556
void(* init_mode_gain_regs)(struct ath_hw *ah)
Definition hw.h:557

References ah, ar5008_hw_attach_phy_ops(), ar9002_hw_attach_calib_ops(), ar9002_hw_attach_mac_ops(), ar9002_hw_attach_phy_ops(), ar9002_hw_configpcipowersave(), ar9002_hw_init_mode_gain_regs(), ar9002_hw_init_mode_regs(), AR_SREV_9280_20_OR_LATER, ath9k_hw_ops(), ath9k_hw_private_ops(), ath_hw_ops::config_pci_powersave, ath_hw_private_ops::init_mode_gain_regs, and ath_hw_private_ops::init_mode_regs.

Referenced by ath9k_hw_attach_ops().

◆ ar9002_hw_load_ani_reg()

void ar9002_hw_load_ani_reg ( struct ath_hw * ah,
struct ath9k_channel * chan )

Definition at line 564 of file ath9k_ar9002_hw.c.

565{
566 u32 modesIndex;
567 unsigned int i;
568
569 switch (chan->chanmode) {
570 case CHANNEL_A:
571 case CHANNEL_A_HT20:
572 modesIndex = 1;
573 break;
576 modesIndex = 2;
577 break;
578 case CHANNEL_G:
579 case CHANNEL_G_HT20:
580 case CHANNEL_B:
581 modesIndex = 4;
582 break;
585 modesIndex = 3;
586 break;
587
588 default:
589 return;
590 }
591
593
594 for (i = 0; i < ah->iniModes_9271_ANI_reg.ia_rows; i++) {
595 u32 reg = INI_RA(&ah->iniModes_9271_ANI_reg, i, 0);
596 u32 val = INI_RA(&ah->iniModes_9271_ANI_reg, i, modesIndex);
597 u32 val_orig;
598
599 if (reg == AR_PHY_CCK_DETECT) {
600 val_orig = REG_READ(ah, reg);
603
604 REG_WRITE(ah, reg, val|val_orig);
605 } else
606 REG_WRITE(ah, reg, val);
607 }
608
610}
#define AR_PHY_CCK_DETECT
Definition ar9002_phy.h:414
#define AR_PHY_CCK_DETECT_WEAK_SIG_THR_CCK
Definition ar9002_phy.h:415
#define CHANNEL_B
Definition ath5k.h:641
#define CHANNEL_G
Definition ath5k.h:642
#define CHANNEL_A
Definition ath5k.h:640
#define CHANNEL_A_HT20
Definition hw.h:319
#define CHANNEL_G_HT40MINUS
Definition hw.h:321
#define CHANNEL_A_HT40MINUS
Definition hw.h:323
#define CHANNEL_G_HT20
Definition hw.h:318
#define CHANNEL_G_HT40PLUS
Definition hw.h:320
#define CHANNEL_A_HT40PLUS
Definition hw.h:322
static unsigned int unsigned int reg
Definition myson.h:162
u32 chanmode
Definition hw.h:352

References ah, AR_PHY_CCK_DETECT, AR_PHY_CCK_DETECT_WEAK_SIG_THR_CCK, ath9k_channel::chanmode, CHANNEL_A, CHANNEL_A_HT20, CHANNEL_A_HT40MINUS, CHANNEL_A_HT40PLUS, CHANNEL_B, CHANNEL_G, CHANNEL_G_HT20, CHANNEL_G_HT40MINUS, CHANNEL_G_HT40PLUS, ENABLE_REGWRITE_BUFFER, INI_RA, reg, REG_READ, REG_WRITE, REGWRITE_BUFFER_FLUSH, u32, and val.

Referenced by ath9k_hw_reset().

Variable Documentation

◆ modparam_force_new_ani

int modparam_force_new_ani