18 #include <linux/slab.h>
19 #include <linux/module.h>
20 #include <asm/unaligned.h>
38 static int __init ath9k_init(
void)
44 static void __exit ath9k_exit(
void)
52 static void ath9k_hw_init_cal_settings(
struct ath_hw *
ah)
54 ath9k_hw_private_ops(ah)->init_cal_settings(ah);
57 static void ath9k_hw_init_mode_regs(
struct ath_hw *ah)
59 ath9k_hw_private_ops(ah)->init_mode_regs(ah);
62 static u32 ath9k_hw_compute_pll_control(
struct ath_hw *ah,
65 return ath9k_hw_private_ops(ah)->compute_pll_control(ah, chan);
68 static void ath9k_hw_init_mode_gain_regs(
struct ath_hw *ah)
70 if (!ath9k_hw_private_ops(ah)->init_mode_gain_regs)
73 ath9k_hw_private_ops(ah)->init_mode_gain_regs(ah);
76 static void ath9k_hw_ani_cache_ini_regs(
struct ath_hw *ah)
79 if (!ath9k_hw_private_ops(ah)->ani_cache_ini_regs)
82 ath9k_hw_private_ops(ah)->ani_cache_ini_regs(ah);
89 #ifdef CONFIG_ATH9K_DEBUGFS
95 sc->debug.stats.istats.sync_cause_all++;
97 sc->debug.stats.istats.sync_rtc_irq++;
99 sc->debug.stats.istats.sync_mac_irq++;
101 sc->debug.stats.istats.eeprom_illegal_access++;
103 sc->debug.stats.istats.apb_timeout++;
105 sc->debug.stats.istats.pci_mode_conflict++;
107 sc->debug.stats.istats.host1_fatal++;
109 sc->debug.stats.istats.host1_perr++;
111 sc->debug.stats.istats.trcv_fifo_perr++;
113 sc->debug.stats.istats.radm_cpl_ep++;
115 sc->debug.stats.istats.radm_cpl_dllp_abort++;
117 sc->debug.stats.istats.radm_cpl_tlp_abort++;
119 sc->debug.stats.istats.radm_cpl_ecrc_err++;
121 sc->debug.stats.istats.radm_cpl_timeout++;
123 sc->debug.stats.istats.local_timeout++;
125 sc->debug.stats.istats.pm_access++;
127 sc->debug.stats.istats.mac_awake++;
129 sc->debug.stats.istats.mac_asleep++;
131 sc->debug.stats.istats.mac_sleep_access++;
136 static void ath9k_hw_set_clockrate(
struct ath_hw *ah)
139 struct ath_common *common = ath9k_hw_common(ah);
154 if (conf_is_ht40(conf))
169 struct ath_common *common = ath9k_hw_common(ah);
188 "timeout (%d us) on reg 0x%x: 0x%08x & 0x%08x != 0x%08x\n",
189 timeout, reg,
REG_READ(ah, reg), mask, val);
199 hw_delay = (4 * hw_delay) / 22;
212 int column,
unsigned int *writecnt)
217 for (r = 0; r < array->
ia_rows; r++) {
219 INI_RA(array, r, column));
230 for (i = 0, retval = 0; i <
n; i++) {
231 retval = (retval << 1) | (val & 1);
242 u32 bitsPerSymbol, numBits, numSymbols, phyTime, txTime;
252 numBits = frameLen << 3;
253 txTime =
CCK_SIFS_TIME + phyTime + ((numBits * 1000) / kbps);
281 "Unknown phy %u (rate ix %u)\n", phy, rateix);
324 static void ath9k_hw_read_revisions(
struct ath_hw *ah)
379 static void ath9k_hw_disablepcie(
struct ath_hw *ah)
398 static bool ath9k_hw_chip_test(
struct ath_hw *ah)
400 struct ath_common *common = ath9k_hw_common(ah);
403 static const u32 patternData[4] = {
404 0x55555555, 0xaaaaaaaa, 0x66666666, 0x99999999
414 for (i = 0; i < loop_max; i++) {
419 for (j = 0; j < 0x100; j++) {
420 wrData = (j << 16) | j;
423 if (rdData != wrData) {
425 "address test failed addr: 0x%08x - wr:0x%08x != rd:0x%08x\n",
426 addr, wrData, rdData);
430 for (j = 0; j < 4; j++) {
431 wrData = patternData[
j];
434 if (wrData != rdData) {
436 "address test failed addr: 0x%08x - wr:0x%08x != rd:0x%08x\n",
437 addr, wrData, rdData);
448 static void ath9k_hw_init_config(
struct ath_hw *ah)
452 ah->
config.dma_beacon_response_time = 1;
453 ah->
config.sw_beacon_response_time = 6;
454 ah->
config.additional_swba_backoff = 0;
456 ah->
config.cwm_ignore_extcca = 0;
457 ah->
config.pcie_clock_req = 0;
459 ah->
config.analog_shiftreg = 1;
460 ah->
config.enable_ani =
true;
467 ah->
config.rx_intr_mitigation =
true;
468 ah->
config.pcieSerDesWrite =
true;
490 static void ath9k_hw_init_defaults(
struct ath_hw *ah)
512 static int ath9k_hw_init_macaddr(
struct ath_hw *ah)
514 struct ath_common *common = ath9k_hw_common(ah);
521 for (i = 0; i < 3; i++) {
522 eeval = ah->
eep_ops->get_eeprom(ah, EEP_MAC[i]);
524 common->
macaddr[2 *
i] = eeval >> 8;
525 common->
macaddr[2 * i + 1] = eeval & 0xff;
527 if (sum == 0 || sum == 0xffff * 3)
533 static int ath9k_hw_post_init(
struct ath_hw *ah)
535 struct ath_common *common = ath9k_hw_common(ah);
539 if (!ath9k_hw_chip_test(ah))
553 ath_dbg(ath9k_hw_common(ah),
CONFIG,
"Eeprom VER: %d, REV: %d\n",
554 ah->
eep_ops->get_eeprom_ver(ah),
555 ah->
eep_ops->get_eeprom_rev(ah));
557 ecode = ath9k_hw_rf_alloc_ext_banks(ah);
560 "Failed allocating banks for external radio\n");
561 ath9k_hw_rf_free_ext_banks(ah);
565 if (ah->
config.enable_ani) {
573 static void ath9k_hw_attach_ops(
struct ath_hw *ah)
582 static int __ath9k_hw_init(
struct ath_hw *ah)
584 struct ath_common *common = ath9k_hw_common(ah);
587 ath9k_hw_read_revisions(ah);
599 ath_err(common,
"Couldn't reset chip\n");
611 ath9k_hw_init_defaults(ah);
612 ath9k_hw_init_config(ah);
614 ath9k_hw_attach_ops(ah);
617 ath_err(common,
"Couldn't wakeup chip\n");
625 ah->
config.serialize_regmode =
628 ah->
config.serialize_regmode =
634 ah->
config.serialize_regmode);
660 "Mac Chip Rev 0x%02x.%x is not supported by this driver\n",
670 ath9k_hw_init_cal_settings(ah);
678 ath9k_hw_init_mode_regs(ah);
681 ath9k_hw_disablepcie(ah);
683 r = ath9k_hw_post_init(ah);
687 ath9k_hw_init_mode_gain_regs(ah);
692 r = ath9k_hw_init_macaddr(ah);
694 ath_err(common,
"Failed to initialize MAC address\n");
716 struct ath_common *common = ath9k_hw_common(ah);
743 ath_err(common,
"Hardware device ID 0x%04x not supported\n",
748 ret = __ath9k_hw_init(ah);
751 "Unable to initialize hardware; initialization status: %d\n",
760 static void ath9k_hw_init_qos(
struct ath_hw *ah)
783 struct ath_common *common = ath9k_hw_common(ah);
795 ath_err(common,
"PLL4 meaurement not done\n");
806 static void ath9k_hw_init_pll(
struct ath_hw *ah,
842 u32 ddr_dpll2, pll_control2, kd;
845 ddr_dpll2 = 0x18e82f01;
846 pll_control2 = 0xe04a3d;
849 ddr_dpll2 = 0x19e82f01;
850 pll_control2 = 0x886666;
875 u32 regval, pll2_divint, pll2_divfrac, refdiv;
885 pll2_divfrac = 0x1eb85;
894 pll2_divfrac = 0x26666;
900 regval |= (0x1 << 16);
905 (pll2_divint << 18) | pll2_divfrac);
910 regval = (regval & 0x80071fff) | (0x1 << 30) |
911 (0x1 << 13) | (0x4 << 26) | (0x18 << 19);
913 regval = (regval & 0x80071fff) | (0x3 << 30) |
914 (0x1 << 13) | (0x4 << 26) | (0x60 << 19);
921 pll = ath9k_hw_compute_pll_control(ah, chan);
954 static void ath9k_hw_init_interrupt_masks(
struct ath_hw *ah,
965 sync_default &= ~AR_INTR_SYNC_HOST1_FATAL;
969 if (ah->
config.rx_intr_mitigation)
975 if (ah->
config.rx_intr_mitigation)
981 if (ah->
config.tx_intr_mitigation)
1008 static void ath9k_hw_set_sifs_time(
struct ath_hw *ah,
u32 us)
1010 u32 val = ath9k_hw_mac_to_clks(ah, us - 2);
1011 val =
min(val, (
u32) 0xFFFF);
1015 static void ath9k_hw_setslottime(
struct ath_hw *ah,
u32 us)
1017 u32 val = ath9k_hw_mac_to_clks(ah, us);
1018 val =
min(val, (
u32) 0xFFFF);
1022 static void ath9k_hw_set_ack_timeout(
struct ath_hw *ah,
u32 us)
1024 u32 val = ath9k_hw_mac_to_clks(ah, us);
1029 static void ath9k_hw_set_cts_timeout(
struct ath_hw *ah,
u32 us)
1031 u32 val = ath9k_hw_mac_to_clks(ah, us);
1036 static bool ath9k_hw_set_global_txtimeout(
struct ath_hw *ah,
u32 tu)
1039 ath_dbg(ath9k_hw_common(ah), XMIT,
"bad global tx timeout %u\n",
1052 struct ath_common *common = ath9k_hw_common(ah);
1055 int acktimeout, ctstimeout, ack_offset = 0;
1058 int rx_lat = 0, tx_lat = 0, eifs = 0;
1061 ath_dbg(ath9k_hw_common(ah),
RESET,
"ah->misc_mode 0x%x\n",
1093 rx_lat = (rx_lat * 4) - 1;
1117 acktimeout = slottime + sifstime + 3 * ah->
coverage_class + ack_offset;
1118 ctstimeout = acktimeout;
1129 acktimeout += 64 - sifstime - ah->
slottime;
1130 ctstimeout += 48 - sifstime - ah->
slottime;
1134 ath9k_hw_set_sifs_time(ah, sifstime);
1135 ath9k_hw_setslottime(ah, slottime);
1136 ath9k_hw_set_ack_timeout(ah, acktimeout);
1137 ath9k_hw_set_cts_timeout(ah, ctstimeout);
1153 struct ath_common *common = ath9k_hw_common(ah);
1161 ath9k_hw_rf_free_ext_banks(ah);
1187 static inline void ath9k_hw_set_dma(
struct ath_hw *ah)
1189 struct ath_common *common = ath9k_hw_common(ah);
1231 ah->
caps.rx_status_len);
1256 static void ath9k_hw_set_operating_mode(
struct ath_hw *ah,
int opmode)
1282 u32 *coef_mantissa,
u32 *coef_exponent)
1284 u32 coef_exp, coef_man;
1286 for (coef_exp = 31; coef_exp > 0; coef_exp--)
1287 if ((coef_scaled >> coef_exp) & 0x1)
1292 coef_man = coef_scaled + (1 << (
COEF_SCALE_S - coef_exp - 1));
1294 *coef_mantissa = coef_man >> (
COEF_SCALE_S - coef_exp);
1295 *coef_exponent = coef_exp - 16;
1298 static bool ath9k_hw_set_reset(
struct ath_hw *ah,
int type)
1325 (AR_INTR_SYNC_LOCAL_TIMEOUT |
1326 AR_INTR_SYNC_RADM_CPL_TIMEOUT)) {
1364 "reset MAC via external reset\n");
1369 "External reset failed, err=%d\n",
1378 if (ath9k_hw_mci_is_enabled(ah))
1389 ath_dbg(ath9k_hw_common(ah),
RESET,
"RTC stuck in MAC reset\n");
1402 static bool ath9k_hw_set_reset_power_on(
struct ath_hw *ah)
1434 ath_dbg(ath9k_hw_common(ah),
RESET,
"RTC not waking up\n");
1441 static bool ath9k_hw_set_reset_reg(
struct ath_hw *ah,
u32 type)
1458 ret = ath9k_hw_set_reset_power_on(ah);
1464 ret = ath9k_hw_set_reset(ah, type);
1473 static bool ath9k_hw_chip_reset(
struct ath_hw *ah,
1485 if (!ath9k_hw_set_reset_reg(ah, reset_type))
1495 ath9k_hw_init_pll(ah, chan);
1496 ath9k_hw_set_rfmode(ah, chan);
1501 static bool ath9k_hw_channel_change(
struct ath_hw *ah,
1504 struct ath_common *common = ath9k_hw_common(ah);
1508 bool band_switch, mode_diff;
1519 "Transmit frames pending on queue %d\n", qnum);
1524 if (!ath9k_hw_rfbus_req(ah)) {
1525 ath_err(common,
"Could not kill baseband RX\n");
1529 if (edma && (band_switch || mode_diff)) {
1530 ath9k_hw_mark_phy_inactive(ah);
1533 ath9k_hw_init_pll(ah,
NULL);
1535 if (ath9k_hw_fast_chan_change(ah, chan, &ini_reloaded)) {
1536 ath_err(common,
"Failed to do fast channel change\n");
1541 ath9k_hw_set_channel_regs(ah, chan);
1543 r = ath9k_hw_rf_set_freq(ah, chan);
1545 ath_err(common,
"Failed to set channel\n");
1548 ath9k_hw_set_clockrate(ah);
1550 ath9k_hw_rfbus_done(ah);
1553 ath9k_hw_set_delta_slope(ah, chan);
1555 ath9k_hw_spur_mitigate_freq(ah, chan);
1557 if (edma && (band_switch || mode_diff)) {
1559 if (band_switch || ini_reloaded)
1560 ah->
eep_ops->set_board_values(ah, chan);
1562 ath9k_hw_init_bb(ah, chan);
1564 if (band_switch || ini_reloaded)
1565 ath9k_hw_init_cal(ah, chan);
1572 static void ath9k_hw_apply_gpio_override(
struct ath_hw *ah)
1577 for (i = 0; gpio_mask; i++, gpio_mask >>= 1) {
1578 if (!(gpio_mask & 1))
1586 static bool ath9k_hw_check_dcs(
u32 dma_dbg,
u32 num_dcu_states,
1587 int *hang_state,
int *hang_pos)
1589 static u32 dcu_chain_state[] = {5, 6, 9};
1590 u32 chain_state, dcs_pos,
i;
1592 for (dcs_pos = 0; dcs_pos < num_dcu_states; dcs_pos++) {
1593 chain_state = (dma_dbg >> (5 * dcs_pos)) & 0x1f;
1594 for (i = 0; i < 3; i++) {
1595 if (chain_state == dcu_chain_state[i]) {
1596 *hang_state = chain_state;
1597 *hang_pos = dcs_pos;
1605 #define DCU_COMPLETE_STATE 1
1606 #define DCU_COMPLETE_STATE_MASK 0x3
1607 #define NUM_STATUS_READS 50
1608 static bool ath9k_hw_detect_mac_hang(
struct ath_hw *ah)
1611 u32 i, hang_pos, hang_state, num_state = 6;
1617 "MAC Hang signature not found at DCU complete\n");
1621 chain_state =
REG_READ(ah, dcs_reg);
1622 if (ath9k_hw_check_dcs(chain_state, num_state, &hang_state, &hang_pos))
1623 goto hang_check_iter;
1627 chain_state =
REG_READ(ah, dcs_reg);
1628 if (ath9k_hw_check_dcs(chain_state, num_state, &hang_state, &hang_pos))
1629 goto hang_check_iter;
1632 "MAC Hang signature 1 not found\n");
1637 "DCU registers: chain %08x complete %08x Hang: state %d pos %d\n",
1638 chain_state, comp_state, hang_state, hang_pos);
1641 chain_state =
REG_READ(ah, dcs_reg);
1642 chain_state = (chain_state >> (5 * hang_pos)) & 0x1f;
1645 if (((comp_state & DCU_COMPLETE_STATE_MASK) !=
1647 (chain_state != hang_state))
1651 ath_dbg(ath9k_hw_common(ah),
RESET,
"MAC Hang signature 1 found\n");
1662 return !ath9k_hw_detect_mac_hang(ah);
1670 if ((reg & 0x7E7FFFEF) == 0x00702400)
1673 switch (reg & 0x7E000B00) {
1681 }
while (count-- > 0);
1699 struct ath_common *common = ath9k_hw_common(ah);
1730 (!ah->
caldata->done_txiqcal_once ||
1731 !ah->
caldata->done_txclcal_once ||
1735 ath_dbg(common,
RESET,
"FastChannelChange for %d -> %d\n",
1738 ret = ath9k_hw_channel_change(ah, chan);
1742 if (ath9k_hw_mci_is_enabled(ah))
1759 struct ath_common *common = ath9k_hw_common(ah);
1765 bool start_mci_reset =
false;
1768 if (ath9k_hw_mci_is_enabled(ah)) {
1770 if (start_mci_reset)
1786 memset(caldata, 0,
sizeof(*caldata));
1788 }
else if (caldata) {
1794 r = ath9k_hw_do_fastcc(ah, chan);
1799 if (ath9k_hw_mci_is_enabled(ah))
1803 if (saveDefAntenna == 0)
1817 ath9k_hw_mark_phy_inactive(ah);
1829 if (!ath9k_hw_chip_reset(ah, chan)) {
1830 ath_err(common,
"Chip reset failed\n");
1853 r = ath9k_hw_process_ini(ah, chan);
1857 if (ath9k_hw_mci_is_enabled(ah))
1889 ath9k_hw_set_delta_slope(ah, chan);
1891 ath9k_hw_spur_mitigate_freq(ah, chan);
1892 ah->
eep_ops->set_board_values(ah, chan);
1911 ath9k_hw_set_operating_mode(ah, ah->
opmode);
1913 r = ath9k_hw_rf_set_freq(ah, chan);
1917 ath9k_hw_set_clockrate(ah);
1930 ath9k_hw_init_interrupt_masks(ah, ah->
opmode);
1931 ath9k_hw_ani_cache_ini_regs(ah);
1932 ath9k_hw_init_qos(ah);
1950 ath9k_hw_set_dma(ah);
1952 if (!ath9k_hw_mci_is_enabled(ah))
1955 if (ah->
config.rx_intr_mitigation) {
1960 if (ah->
config.tx_intr_mitigation) {
1965 ath9k_hw_init_bb(ah, chan);
1971 if (!ath9k_hw_init_cal(ah, chan))
1979 ath9k_hw_restore_chainmask(ah);
2017 if (ath9k_hw_btcoex_is_enabled(ah))
2020 if (ath9k_hw_mci_is_enabled(ah))
2032 ath9k_hw_apply_gpio_override(ah);
2049 static void ath9k_set_power_sleep(
struct ath_hw *ah)
2068 if (ath9k_hw_mci_is_enabled(ah))
2090 static void ath9k_set_power_network_sleep(
struct ath_hw *ah)
2111 if (ath9k_hw_mci_is_enabled(ah))
2120 if (ath9k_hw_mci_is_enabled(ah))
2129 static bool ath9k_hw_set_power_awake(
struct ath_hw *ah)
2146 ath9k_hw_init_pll(ah,
NULL);
2156 if (ath9k_hw_mci_is_enabled(ah))
2169 "Failed to wakeup in %uus\n",
2181 struct ath_common *common = ath9k_hw_common(ah);
2183 static const char *modes[] = {
2198 status = ath9k_hw_set_power_awake(ah);
2201 if (ath9k_hw_mci_is_enabled(ah))
2204 ath9k_set_power_sleep(ah);
2208 ath9k_set_power_network_sleep(ah);
2211 ath_err(common,
"Unknown power mode %u\n", mode);
2258 "%s: unsupported opmode: %d\n", __func__, ah->
opmode);
2277 u32 nextTbtt, beaconintval, dtimperiod, beacontimeout;
2279 struct ath_common *common = ath9k_hw_common(ah);
2304 if (beaconintval == dtimperiod)
2311 ath_dbg(common,
BEACON,
"beacon period %d\n", beaconintval);
2350 static u8 fixup_chainmask(
u8 chip_chainmask,
u8 eeprom_chainmask)
2352 eeprom_chainmask &= chip_chainmask;
2353 if (eeprom_chainmask)
2354 return eeprom_chainmask;
2356 return chip_chainmask;
2372 static bool ath9k_hw_dfs_tested(
struct ath_hw *ah)
2387 struct ath_common *common = ath9k_hw_common(ah);
2388 unsigned int chip_chainmask;
2391 u8 ant_div_ctl1, tx_chainmask, rx_chainmask;
2403 ath_dbg(common, REGULATORY,
"regdomain mapped to 0x%x\n",
2410 "no band has been marked as supported in EEPROM\n");
2440 !(eeval & AR5416_OPFLAGS_11A) &&
2488 #if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE)
2538 if ((ant_div_ctl1 & 0x1) && ((ant_div_ctl1 >> 3) & 0x1))
2560 if ((ant_div_ctl1 >> 0x6) == 0x3)
2569 if (ath9k_hw_dfs_tested(ah))
2574 while (tx_chainmask || rx_chainmask) {
2575 if (tx_chainmask &
BIT(0))
2577 if (rx_chainmask &
BIT(0))
2614 static void ath9k_hw_gpio_cfg_output_mux(
struct ath_hw *ah,
2627 gpio_shift = (gpio % 6) * 5;
2631 REG_RMW(ah, addr, (type << gpio_shift),
2632 (0x1f << gpio_shift));
2635 tmp = ((tmp & 0x1F0) << 1) | (tmp & ~0x1F0);
2636 tmp &= ~(0x1f << gpio_shift);
2637 tmp |= (type << gpio_shift);
2656 gpio_shift = gpio << 1;
2666 #define MS_REG_READ(x, y) \
2667 (MS(REG_READ(ah, AR_GPIO_IN_OUT), x##_GPIO_IN_VAL) & (AR_GPIO_BIT(y)))
2669 if (gpio >= ah->
caps.num_gpio_pins)
2705 ath9k_hw_gpio_cfg_output_mux(ah, gpio, ah_signal_type);
2706 gpio_shift = 2 *
gpio;
2784 if (ath9k_hw_mci_is_enabled(ah))
2790 ath9k_hw_init_pll(ah,
NULL);
2804 ath9k_hw_init_pll(ah,
NULL);
2818 return ah->
eep_ops->get_eeprom(ah, gain_param);
2826 int chan_pwr, new_pwr, max_gain;
2827 int ant_gain, ant_reduction = 0;
2832 channel = chan->
chan;
2837 ant_gain = get_antenna_gain(ah, chan);
2838 if (ant_gain > max_gain)
2839 ant_reduction = ant_gain - max_gain;
2841 ah->
eep_ops->set_txpower(ah, chan,
2843 ant_reduction, new_pwr, test);
2865 ath9k_hw_set_operating_mode(ah, ah->
opmode);
2878 struct ath_common *common = ath9k_hw_common(ah);
2886 #define ATH9K_MAX_TSF_READ 10
2890 u32 tsf_lower, tsf_upper1, tsf_upper2;
2897 if (tsf_upper2 == tsf_upper1)
2899 tsf_upper1 = tsf_upper2;
2902 WARN_ON( i == ATH9K_MAX_TSF_READ );
2904 return (((
u64)tsf_upper1 << 32) | tsf_lower);
2920 "AR_SLP32_TSF_WRITE_STATUS limit exceeded\n");
2940 if (conf_is_ht40(conf) && !ah->
config.cwm_ignore_extcca)
3010 if (timer ==
NULL) {
3012 "Failed to allocate memory for hw timer[%d]\n",
3019 timer->
index = timer_index;
3042 timer_next = tsf + trig_timeout;
3044 ath_dbg(ath9k_hw_common(ah), HWTIMER,
3045 "current tsf %x period %x timer_next %x\n",
3046 tsf, timer_period, timer_next);
3066 (1 << timer->
index));
3069 (1 << timer->
index));
3098 (1 << timer->
index));
3128 struct ath_common *common = ath9k_hw_common(ah);
3129 u32 trigger_mask, thresh_mask,
index;
3137 trigger_mask &= ~thresh_mask;
3139 while (thresh_mask) {
3140 index = rightmost_index(timer_table, &thresh_mask);
3143 ath_dbg(common, HWTIMER,
"TSF overflow for Gen timer %d\n",
3148 while (trigger_mask) {
3149 index = rightmost_index(timer_table, &trigger_mask);
3153 "Gen timer[%d] trigger\n", index);
3166 } ath_mac_bb_names[] = {
3190 } ath_rf_names[] = {
3201 static const char *ath9k_hw_mac_bb_name(
u32 mac_bb_version)
3205 for (i=0; i<
ARRAY_SIZE(ath_mac_bb_names); i++) {
3206 if (ath_mac_bb_names[i].
version == mac_bb_version) {
3207 return ath_mac_bb_names[
i].name;
3218 static const char *ath9k_hw_rf_name(
u16 rf_version)
3223 if (ath_rf_names[i].
version == rf_version) {
3224 return ath_rf_names[
i].name;
3238 "Atheros AR%s Rev:%x",
3239 ath9k_hw_mac_bb_name(ah->
hw_version.macVersion),
3244 "Atheros AR%s MAC/BB Rev:%x AR%s RF Rev:%x",
3245 ath9k_hw_mac_bb_name(ah->
hw_version.macVersion),
3247 ath9k_hw_rf_name((ah->
hw_version.analog5GhzRev &
3252 hw_name[
used] =
'\0';