44 static const u32 static_pattern[4] = {
45 0x55555555, 0xaaaaaaaa,
46 0x66666666, 0x99999999
55 for (c = 0; c < 2; c++) {
62 for (i = 0; i < 256; i++) {
63 var_pattern = i << 16 | i;
67 if (cur_val != var_pattern) {
68 DBG(
"ath5k: POST failed!\n");
73 var_pattern = 0x0039080f;
77 for (i = 0; i < 4; i++) {
78 var_pattern = static_pattern[i];
82 if (cur_val != var_pattern) {
83 DBG(
"ath5k: POST failed!\n");
88 var_pattern = 0x003b080f;
124 DBG(
"ath5k: out of memory\n");
135 ah->ah_txpower.txp_tpc = 0;
137 ah->ah_atim_window = 0;
141 ah->ah_software_retry = 0;
147 ah->ah_version = mac_version;
161 ah->ah_mac_srev = srev;
169 switch (
ah->ah_radio_5ghz_revision & 0xf0) {
172 ah->ah_single_chip = 0;
179 ah->ah_single_chip = 0;
185 ah->ah_single_chip = 1;
189 ah->ah_single_chip = 1;
193 ah->ah_single_chip = 1;
197 ah->ah_single_chip = 1;
206 ah->ah_single_chip = 1;
212 ah->ah_single_chip = 0;
215 ah->ah_single_chip = 0;
222 ah->ah_single_chip = 1;
227 ah->ah_single_chip = 0;
231 ah->ah_single_chip = 1;
236 ah->ah_single_chip = 1;
241 ah->ah_single_chip = 1;
244 DBG(
"ath5k: Couldn't identify radio revision.\n");
253 DBG(
"ath5k: Device not yet supported.\n");
298 DBG(
"ath5k: unable to init EEPROM\n");
305 DBG(
"ath5k: unable to get device capabilities: 0x%04x\n",
311 ah->ah_combined_mic = 1;
static int ath5k_hw_post(struct ath5k_hw *ah)
ath5k_hw_post - Power On Self Test helper function
#define AR5K_SREV_RAD_5413
#define AR5K_SREV_RAD_2112
#define AR5K_SREV_PHY_2413
u16 ath5k_hw_radio_revision(struct ath5k_hw *ah, unsigned int chan)
#define AR5K_TUNE_ANT_DIVERSITY
#define AR5K_SREV_PHY_5212B
#define AR5K_INIT_TX_RETRY
#define AR5K_REG_MS(_val, _flags)
#define AR5K_SREV_RAD_5112
void ath5k_hw_set_associd(struct ath5k_hw *ah, const u8 *bssid, u16 assoc_id)
ath5k_hw_set_associd - Set BSSID for association
#define AR5K_SREV_RAD_2413
#define AR5K_SREV_RAD_5424
int ath5k_hw_init_desc_functions(struct ath5k_hw *ah)
ath5k_hw_get_isr - Get interrupt status
#define ENOTSUP
Operation not supported.
#define ENOMEM
Not enough space.
#define AR5K_SREV_RAD_2317
#define AR5K_PCICFG_RETRY_FIX
uint16_t device
Device ID.
#define AR5K_SREV_RAD_2425
#define AR5K_PCIE_SERDES_RESET
int ath5k_hw_set_capabilities(struct ath5k_hw *ah)
int ath5k_hw_rfgain_opt_init(struct ath5k_hw *ah)
#define AR5K_SREV_PHY_2425
static void(* free)(struct refcnt *refcnt))
#define AR5K_SREV_RAD_5112B
void * zalloc(size_t size)
Allocate cleared memory.
#define AR5K_SREV_RAD_2316
static void ath5k_hw_reg_write(struct ath5k_hw *ah, u32 val, u16 reg)
void ath5k_eeprom_detach(struct ath5k_hw *ah)
int ath5k_hw_nic_wakeup(struct ath5k_hw *ah, int flags, int initial)
int ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version, struct ath5k_hw **hw)
ath5k_hw_attach - Check if hw is supported and init the needed structs
#define EAGAIN
Resource temporarily unavailable.
#define PCI_CAP_ID_EXP
PCI Express.
#define AR5K_SREV_AR5213A
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
int ath5k_hw_set_opmode(struct ath5k_hw *ah)
ath5k_hw_set_opmode - Set PCU operating mode
#define AR5K_SREV_PHY_5413
#define AR5K_SREV_RAD_5111
void ath5k_hw_detach(struct ath5k_hw *ah)
ath5k_hw_detach - Free the ath5k_hw struct
static u32 ath5k_hw_reg_read(struct ath5k_hw *ah, u16 reg)
#define DBG(...)
Print a debugging message.
#define NULL
NULL pointer (VOID *)
int ath5k_eeprom_init(struct ath5k_hw *ah)
#define AR5K_MISC_MODE_COMBINED_MIC
#define AR5K_REG_ENABLE_BITS(ah, _reg, _flags)
void * memset(void *dest, int character, size_t len) __nonnull