23 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
25 #include <linux/pci.h>
26 #include <linux/slab.h>
38 static const u32 static_pattern[4] = {
39 0x55555555, 0xaaaaaaaa,
40 0x66666666, 0x99999999
49 for (c = 0; c < 2; c++) {
54 init_val = ath5k_hw_reg_read(ah, cur_reg);
56 for (i = 0; i < 256; i++) {
57 var_pattern = i << 16 |
i;
58 ath5k_hw_reg_write(ah, var_pattern, cur_reg);
59 cur_val = ath5k_hw_reg_read(ah, cur_reg);
61 if (cur_val != var_pattern) {
67 var_pattern = 0x0039080f;
68 ath5k_hw_reg_write(ah, var_pattern, cur_reg);
71 for (i = 0; i < 4; i++) {
72 var_pattern = static_pattern[
i];
73 ath5k_hw_reg_write(ah, var_pattern, cur_reg);
74 cur_val = ath5k_hw_reg_read(ah, cur_reg);
76 if (cur_val != var_pattern) {
82 var_pattern = 0x003b080f;
83 ath5k_hw_reg_write(ah, var_pattern, cur_reg);
87 ath5k_hw_reg_write(ah, init_val, cur_reg);
235 ATH5K_ERR(ah,
"Couldn't identify radio revision.\n");
244 ATH5K_ERR(ah,
"Device not yet supported.\n");
252 ret = ath5k_hw_post(ah);
266 ATH5K_ERR(ah,
"unable to init EEPROM\n");
307 ATH5K_ERR(ah,
"unable to get device capabilities\n");