Lines Matching +full:save +full:- +full:mac +full:- +full:address
2 * Copyright (c) 2004-2008 Reyk Floeter <reyk@openbsd.org>
3 * Copyright (c) 2006-2008 Nick Kossifidis <mickflemm@gmail.com>
32 * ath5k_hw_post() - Power On Self Test helper function
53 /* Save previous value */ in ath5k_hw_post()
63 return -EAGAIN; in ath5k_hw_post()
78 return -EAGAIN; in ath5k_hw_post()
96 * ath5k_hw_init() - Check if hw is supported and init the needed structs
100 * structs. Returns -ENOMEM if we don't have memory for the needed structs,
101 * -ENODEV if the device is not supported or prints an error msg if something
108 struct pci_dev *pdev = ah->pdev; in ath5k_hw_init()
116 ah->ah_bwmode = AR5K_BWMODE_DEFAULT; in ath5k_hw_init()
117 ah->ah_txpower.txp_tpc = AR5K_TUNE_TPC_TXPOWER; in ath5k_hw_init()
118 ah->ah_imr = 0; in ath5k_hw_init()
119 ah->ah_retry_short = AR5K_INIT_RETRY_SHORT; in ath5k_hw_init()
120 ah->ah_retry_long = AR5K_INIT_RETRY_LONG; in ath5k_hw_init()
121 ah->ah_ant_mode = AR5K_ANTMODE_DEFAULT; in ath5k_hw_init()
122 ah->ah_noise_floor = -95; /* until first NF calibration is run */ in ath5k_hw_init()
123 ah->ani_state.ani_mode = ATH5K_ANI_MODE_AUTO; in ath5k_hw_init()
124 ah->ah_current_channel = &ah->channels[0]; in ath5k_hw_init()
127 * Find the mac version in ath5k_hw_init()
130 srev = ah->ah_mac_srev; in ath5k_hw_init()
132 ah->ah_version = AR5K_AR5210; in ath5k_hw_init()
134 ah->ah_version = AR5K_AR5211; in ath5k_hw_init()
136 ah->ah_version = AR5K_AR5212; in ath5k_hw_init()
138 /* Get the MAC version */ in ath5k_hw_init()
139 ah->ah_mac_version = AR5K_REG_MS(srev, AR5K_SREV_VER); in ath5k_hw_init()
152 ah->ah_phy_revision = ath5k_hw_reg_read(ah, AR5K_PHY_CHIP_ID) & in ath5k_hw_init()
154 ah->ah_radio_5ghz_revision = ath5k_hw_radio_revision(ah, in ath5k_hw_init()
158 switch (ah->ah_radio_5ghz_revision & 0xf0) { in ath5k_hw_init()
160 ah->ah_radio = AR5K_RF5111; in ath5k_hw_init()
161 ah->ah_single_chip = false; in ath5k_hw_init()
162 ah->ah_radio_2ghz_revision = ath5k_hw_radio_revision(ah, in ath5k_hw_init()
167 ah->ah_radio = AR5K_RF5112; in ath5k_hw_init()
168 ah->ah_single_chip = false; in ath5k_hw_init()
169 ah->ah_radio_2ghz_revision = ath5k_hw_radio_revision(ah, in ath5k_hw_init()
173 ah->ah_radio = AR5K_RF2413; in ath5k_hw_init()
174 ah->ah_single_chip = true; in ath5k_hw_init()
177 ah->ah_radio = AR5K_RF5413; in ath5k_hw_init()
178 ah->ah_single_chip = true; in ath5k_hw_init()
181 ah->ah_radio = AR5K_RF2316; in ath5k_hw_init()
182 ah->ah_single_chip = true; in ath5k_hw_init()
185 ah->ah_radio = AR5K_RF2317; in ath5k_hw_init()
186 ah->ah_single_chip = true; in ath5k_hw_init()
189 if (ah->ah_mac_version == AR5K_SREV_AR2425 || in ath5k_hw_init()
190 ah->ah_mac_version == AR5K_SREV_AR2417) { in ath5k_hw_init()
191 ah->ah_radio = AR5K_RF2425; in ath5k_hw_init()
192 ah->ah_single_chip = true; in ath5k_hw_init()
194 ah->ah_radio = AR5K_RF5413; in ath5k_hw_init()
195 ah->ah_single_chip = true; in ath5k_hw_init()
199 /* Identify radio based on mac/phy srev */ in ath5k_hw_init()
200 if (ah->ah_version == AR5K_AR5210) { in ath5k_hw_init()
201 ah->ah_radio = AR5K_RF5110; in ath5k_hw_init()
202 ah->ah_single_chip = false; in ath5k_hw_init()
203 } else if (ah->ah_version == AR5K_AR5211) { in ath5k_hw_init()
204 ah->ah_radio = AR5K_RF5111; in ath5k_hw_init()
205 ah->ah_single_chip = false; in ath5k_hw_init()
206 ah->ah_radio_2ghz_revision = ath5k_hw_radio_revision(ah, in ath5k_hw_init()
208 } else if (ah->ah_mac_version == (AR5K_SREV_AR2425 >> 4) || in ath5k_hw_init()
209 ah->ah_mac_version == (AR5K_SREV_AR2417 >> 4) || in ath5k_hw_init()
210 ah->ah_phy_revision == AR5K_SREV_PHY_2425) { in ath5k_hw_init()
211 ah->ah_radio = AR5K_RF2425; in ath5k_hw_init()
212 ah->ah_single_chip = true; in ath5k_hw_init()
213 ah->ah_radio_5ghz_revision = AR5K_SREV_RAD_2425; in ath5k_hw_init()
215 ah->ah_phy_revision == AR5K_SREV_PHY_5212B) { in ath5k_hw_init()
216 ah->ah_radio = AR5K_RF5112; in ath5k_hw_init()
217 ah->ah_single_chip = false; in ath5k_hw_init()
218 ah->ah_radio_5ghz_revision = AR5K_SREV_RAD_5112B; in ath5k_hw_init()
219 } else if (ah->ah_mac_version == (AR5K_SREV_AR2415 >> 4) || in ath5k_hw_init()
220 ah->ah_mac_version == (AR5K_SREV_AR2315_R6 >> 4)) { in ath5k_hw_init()
221 ah->ah_radio = AR5K_RF2316; in ath5k_hw_init()
222 ah->ah_single_chip = true; in ath5k_hw_init()
223 ah->ah_radio_5ghz_revision = AR5K_SREV_RAD_2316; in ath5k_hw_init()
224 } else if (ah->ah_mac_version == (AR5K_SREV_AR5414 >> 4) || in ath5k_hw_init()
225 ah->ah_phy_revision == AR5K_SREV_PHY_5413) { in ath5k_hw_init()
226 ah->ah_radio = AR5K_RF5413; in ath5k_hw_init()
227 ah->ah_single_chip = true; in ath5k_hw_init()
228 ah->ah_radio_5ghz_revision = AR5K_SREV_RAD_5413; in ath5k_hw_init()
229 } else if (ah->ah_mac_version == (AR5K_SREV_AR2414 >> 4) || in ath5k_hw_init()
230 ah->ah_phy_revision == AR5K_SREV_PHY_2413) { in ath5k_hw_init()
231 ah->ah_radio = AR5K_RF2413; in ath5k_hw_init()
232 ah->ah_single_chip = true; in ath5k_hw_init()
233 ah->ah_radio_5ghz_revision = AR5K_SREV_RAD_2413; in ath5k_hw_init()
236 ret = -ENODEV; in ath5k_hw_init()
245 ret = -ENODEV; in ath5k_hw_init()
270 ee = &ah->ah_capabilities.cap_eeprom; in ath5k_hw_init()
273 * Write PCI-E power save settings in ath5k_hw_init()
275 if ((ah->ah_version == AR5K_AR5212) && pdev && (pci_is_pcie(pdev))) { in ath5k_hw_init()
283 /* If serdes programming is enabled, increase PCI-E in ath5k_hw_init()
286 if (ee->ee_serdes) in ath5k_hw_init()
312 common->keymax = (ah->ah_version == AR5K_AR5210 ? in ath5k_hw_init()
316 (ee->ee_version < AR5K_EEPROM_VERSION_5_0 || in ath5k_hw_init()
317 !AR5K_EEPROM_AES_DIS(ee->ee_misc5))) in ath5k_hw_init()
318 common->crypt_caps |= ATH_CRYPT_CAP_CIPHER_AESCCM; in ath5k_hw_init()
321 common->crypt_caps |= ATH_CRYPT_CAP_MIC_COMBINED; in ath5k_hw_init()
326 /* MAC address is cleared until add_interface */ in ath5k_hw_init()
329 /* Set BSSID to bcast address: ff:ff:ff:ff:ff:ff for now */ in ath5k_hw_init()
330 eth_broadcast_addr(common->curbssid); in ath5k_hw_init()
332 ath5k_hw_set_opmode(ah, ah->opmode); in ath5k_hw_init()
347 * ath5k_hw_deinit() - Free the &struct ath5k_hw
352 __set_bit(ATH_STAT_INVALID, ah->status); in ath5k_hw_deinit()
354 kfree(ah->ah_rf_banks); in ath5k_hw_deinit()