aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath9k/hw.c
diff options
context:
space:
mode:
authorSujith <Sujith.Manoharan@atheros.com>2008-11-28 11:48:05 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-12-05 09:35:08 -0500
commit04bd4638097c767278fdf12d50fecc8b60194d39 (patch)
tree8bad1080889360aa06ffc967bb2625eecd3db26e /drivers/net/wireless/ath9k/hw.c
parentd9a1f48648edbe99fa432626ce6964a1b58f7281 (diff)
ath9k: Use cleaner debug masks
Remove all the useless __func__ prefixes in debug messages, and replace the DPRINTF macro with a function. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath9k/hw.c')
-rw-r--r--drivers/net/wireless/ath9k/hw.c189
1 files changed, 77 insertions, 112 deletions
diff --git a/drivers/net/wireless/ath9k/hw.c b/drivers/net/wireless/ath9k/hw.c
index 6eef10477896..b3f2899026d6 100644
--- a/drivers/net/wireless/ath9k/hw.c
+++ b/drivers/net/wireless/ath9k/hw.c
@@ -104,9 +104,10 @@ bool ath9k_hw_wait(struct ath_hal *ah, u32 reg, u32 mask, u32 val)
104 104
105 udelay(AH_TIME_QUANTUM); 105 udelay(AH_TIME_QUANTUM);
106 } 106 }
107 DPRINTF(ah->ah_sc, ATH_DBG_PHY_IO, 107
108 "%s: timeout on reg 0x%x: 0x%08x & 0x%08x != 0x%08x\n", 108 DPRINTF(ah->ah_sc, ATH_DBG_REG_IO,
109 __func__, reg, REG_READ(ah, reg), mask, val); 109 "timeout on reg 0x%x: 0x%08x & 0x%08x != 0x%08x\n",
110 reg, REG_READ(ah, reg), mask, val);
110 111
111 return false; 112 return false;
112} 113}
@@ -188,8 +189,8 @@ u16 ath9k_hw_computetxtime(struct ath_hal *ah,
188 } 189 }
189 break; 190 break;
190 default: 191 default:
191 DPRINTF(ah->ah_sc, ATH_DBG_PHY_IO, 192 DPRINTF(ah->ah_sc, ATH_DBG_REG_IO,
192 "%s: unknown phy %u (rate ix %u)\n", __func__, 193 "Unknown phy %u (rate ix %u)\n",
193 rates->info[rateix].phy, rateix); 194 rates->info[rateix].phy, rateix);
194 txTime = 0; 195 txTime = 0;
195 break; 196 break;
@@ -355,9 +356,9 @@ static bool ath9k_hw_chip_test(struct ath_hal *ah)
355 rdData = REG_READ(ah, addr); 356 rdData = REG_READ(ah, addr);
356 if (rdData != wrData) { 357 if (rdData != wrData) {
357 DPRINTF(ah->ah_sc, ATH_DBG_REG_IO, 358 DPRINTF(ah->ah_sc, ATH_DBG_REG_IO,
358 "%s: address test failed " 359 "address test failed "
359 "addr: 0x%08x - wr:0x%08x != rd:0x%08x\n", 360 "addr: 0x%08x - wr:0x%08x != rd:0x%08x\n",
360 __func__, addr, wrData, rdData); 361 addr, wrData, rdData);
361 return false; 362 return false;
362 } 363 }
363 } 364 }
@@ -367,9 +368,9 @@ static bool ath9k_hw_chip_test(struct ath_hal *ah)
367 rdData = REG_READ(ah, addr); 368 rdData = REG_READ(ah, addr);
368 if (wrData != rdData) { 369 if (wrData != rdData) {
369 DPRINTF(ah->ah_sc, ATH_DBG_REG_IO, 370 DPRINTF(ah->ah_sc, ATH_DBG_REG_IO,
370 "%s: address test failed " 371 "address test failed "
371 "addr: 0x%08x - wr:0x%08x != rd:0x%08x\n", 372 "addr: 0x%08x - wr:0x%08x != rd:0x%08x\n",
372 __func__, addr, wrData, rdData); 373 addr, wrData, rdData);
373 return false; 374 return false;
374 } 375 }
375 } 376 }
@@ -449,8 +450,7 @@ static struct ath_hal_5416 *ath9k_hw_newstate(u16 devid,
449 ahp = kzalloc(sizeof(struct ath_hal_5416), GFP_KERNEL); 450 ahp = kzalloc(sizeof(struct ath_hal_5416), GFP_KERNEL);
450 if (ahp == NULL) { 451 if (ahp == NULL) {
451 DPRINTF(sc, ATH_DBG_FATAL, 452 DPRINTF(sc, ATH_DBG_FATAL,
452 "%s: cannot allocate memory for state block\n", 453 "Cannot allocate memory for state block\n");
453 __func__);
454 *status = -ENOMEM; 454 *status = -ENOMEM;
455 return NULL; 455 return NULL;
456 } 456 }
@@ -497,8 +497,7 @@ static int ath9k_hw_rfattach(struct ath_hal *ah)
497 rfStatus = ath9k_hw_init_rf(ah, &ecode); 497 rfStatus = ath9k_hw_init_rf(ah, &ecode);
498 if (!rfStatus) { 498 if (!rfStatus) {
499 DPRINTF(ah->ah_sc, ATH_DBG_RESET, 499 DPRINTF(ah->ah_sc, ATH_DBG_RESET,
500 "%s: RF setup failed, status %u\n", __func__, 500 "RF setup failed, status %u\n", ecode);
501 ecode);
502 return ecode; 501 return ecode;
503 } 502 }
504 503
@@ -523,9 +522,9 @@ static int ath9k_hw_rf_claim(struct ath_hal *ah)
523 break; 522 break;
524 default: 523 default:
525 DPRINTF(ah->ah_sc, ATH_DBG_CHANNEL, 524 DPRINTF(ah->ah_sc, ATH_DBG_CHANNEL,
526 "%s: 5G Radio Chip Rev 0x%02X is not " 525 "5G Radio Chip Rev 0x%02X is not "
527 "supported by this driver\n", 526 "supported by this driver\n",
528 __func__, ah->ah_analog5GhzRev); 527 ah->ah_analog5GhzRev);
529 return -EOPNOTSUPP; 528 return -EOPNOTSUPP;
530 } 529 }
531 530
@@ -550,7 +549,7 @@ static int ath9k_hw_init_macaddr(struct ath_hal *ah)
550 } 549 }
551 if (sum == 0 || sum == 0xffff * 3) { 550 if (sum == 0 || sum == 0xffff * 3) {
552 DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, 551 DPRINTF(ah->ah_sc, ATH_DBG_EEPROM,
553 "%s: mac address read failed: %pM\n", __func__, 552 "mac address read failed: %pM\n",
554 ahp->ah_macaddr); 553 ahp->ah_macaddr);
555 return -EADDRNOTAVAIL; 554 return -EADDRNOTAVAIL;
556 } 555 }
@@ -612,7 +611,7 @@ static int ath9k_hw_post_attach(struct ath_hal *ah)
612 611
613 if (!ath9k_hw_chip_test(ah)) { 612 if (!ath9k_hw_chip_test(ah)) {
614 DPRINTF(ah->ah_sc, ATH_DBG_REG_IO, 613 DPRINTF(ah->ah_sc, ATH_DBG_REG_IO,
615 "%s: hardware self-test failed\n", __func__); 614 "hardware self-test failed\n");
616 return -ENODEV; 615 return -ENODEV;
617 } 616 }
618 617
@@ -658,15 +657,13 @@ static struct ath_hal *ath9k_hw_do_attach(u16 devid, struct ath_softc *sc,
658 ahp->ah_intrMitigation = true; 657 ahp->ah_intrMitigation = true;
659 658
660 if (!ath9k_hw_set_reset_reg(ah, ATH9K_RESET_POWER_ON)) { 659 if (!ath9k_hw_set_reset_reg(ah, ATH9K_RESET_POWER_ON)) {
661 DPRINTF(ah->ah_sc, ATH_DBG_RESET, "%s: couldn't reset chip\n", 660 DPRINTF(ah->ah_sc, ATH_DBG_RESET, "Couldn't reset chip\n");
662 __func__);
663 ecode = -EIO; 661 ecode = -EIO;
664 goto bad; 662 goto bad;
665 } 663 }
666 664
667 if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE)) { 665 if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE)) {
668 DPRINTF(ah->ah_sc, ATH_DBG_RESET, "%s: couldn't wakeup chip\n", 666 DPRINTF(ah->ah_sc, ATH_DBG_RESET, "Couldn't wakeup chip\n");
669 __func__);
670 ecode = -EIO; 667 ecode = -EIO;
671 goto bad; 668 goto bad;
672 } 669 }
@@ -682,17 +679,16 @@ static struct ath_hal *ath9k_hw_do_attach(u16 devid, struct ath_softc *sc,
682 } 679 }
683 680
684 DPRINTF(ah->ah_sc, ATH_DBG_RESET, 681 DPRINTF(ah->ah_sc, ATH_DBG_RESET,
685 "%s: serialize_regmode is %d\n", 682 "serialize_regmode is %d\n",
686 __func__, ah->ah_config.serialize_regmode); 683 ah->ah_config.serialize_regmode);
687 684
688 if ((ah->ah_macVersion != AR_SREV_VERSION_5416_PCI) && 685 if ((ah->ah_macVersion != AR_SREV_VERSION_5416_PCI) &&
689 (ah->ah_macVersion != AR_SREV_VERSION_5416_PCIE) && 686 (ah->ah_macVersion != AR_SREV_VERSION_5416_PCIE) &&
690 (ah->ah_macVersion != AR_SREV_VERSION_9160) && 687 (ah->ah_macVersion != AR_SREV_VERSION_9160) &&
691 (!AR_SREV_9100(ah)) && (!AR_SREV_9280(ah))) { 688 (!AR_SREV_9100(ah)) && (!AR_SREV_9280(ah))) {
692 DPRINTF(ah->ah_sc, ATH_DBG_RESET, 689 DPRINTF(ah->ah_sc, ATH_DBG_RESET,
693 "%s: Mac Chip Rev 0x%02x.%x is not supported by " 690 "Mac Chip Rev 0x%02x.%x is not supported by "
694 "this driver\n", __func__, 691 "this driver\n", ah->ah_macVersion, ah->ah_macRev);
695 ah->ah_macVersion, ah->ah_macRev);
696 ecode = -EOPNOTSUPP; 692 ecode = -EOPNOTSUPP;
697 goto bad; 693 goto bad;
698 } 694 }
@@ -737,7 +733,7 @@ static struct ath_hal *ath9k_hw_do_attach(u16 devid, struct ath_softc *sc,
737 } 733 }
738 734
739 DPRINTF(ah->ah_sc, ATH_DBG_RESET, 735 DPRINTF(ah->ah_sc, ATH_DBG_RESET,
740 "%s: This Mac Chip Rev 0x%02x.%x is \n", __func__, 736 "This Mac Chip Rev 0x%02x.%x is \n",
741 ah->ah_macVersion, ah->ah_macRev); 737 ah->ah_macVersion, ah->ah_macRev);
742 738
743 if (AR_SREV_9280_20_OR_LATER(ah)) { 739 if (AR_SREV_9280_20_OR_LATER(ah)) {
@@ -874,7 +870,7 @@ static struct ath_hal *ath9k_hw_do_attach(u16 devid, struct ath_softc *sc,
874#endif 870#endif
875 if (!ath9k_hw_fill_cap_info(ah)) { 871 if (!ath9k_hw_fill_cap_info(ah)) {
876 DPRINTF(ah->ah_sc, ATH_DBG_RESET, 872 DPRINTF(ah->ah_sc, ATH_DBG_RESET,
877 "%s:failed ath9k_hw_fill_cap_info\n", __func__); 873 "failed ath9k_hw_fill_cap_info\n");
878 ecode = -EINVAL; 874 ecode = -EINVAL;
879 goto bad; 875 goto bad;
880 } 876 }
@@ -882,8 +878,7 @@ static struct ath_hal *ath9k_hw_do_attach(u16 devid, struct ath_softc *sc,
882 ecode = ath9k_hw_init_macaddr(ah); 878 ecode = ath9k_hw_init_macaddr(ah);
883 if (ecode != 0) { 879 if (ecode != 0) {
884 DPRINTF(ah->ah_sc, ATH_DBG_RESET, 880 DPRINTF(ah->ah_sc, ATH_DBG_RESET,
885 "%s: failed initializing mac address\n", 881 "failed initializing mac address\n");
886 __func__);
887 goto bad; 882 goto bad;
888 } 883 }
889 884
@@ -1080,8 +1075,7 @@ static bool ath9k_hw_set_ack_timeout(struct ath_hal *ah, u32 us)
1080 struct ath_hal_5416 *ahp = AH5416(ah); 1075 struct ath_hal_5416 *ahp = AH5416(ah);
1081 1076
1082 if (us > ath9k_hw_mac_to_usec(ah, MS(0xffffffff, AR_TIME_OUT_ACK))) { 1077 if (us > ath9k_hw_mac_to_usec(ah, MS(0xffffffff, AR_TIME_OUT_ACK))) {
1083 DPRINTF(ah->ah_sc, ATH_DBG_RESET, "%s: bad ack timeout %u\n", 1078 DPRINTF(ah->ah_sc, ATH_DBG_RESET, "bad ack timeout %u\n", us);
1084 __func__, us);
1085 ahp->ah_acktimeout = (u32) -1; 1079 ahp->ah_acktimeout = (u32) -1;
1086 return false; 1080 return false;
1087 } else { 1081 } else {
@@ -1097,8 +1091,7 @@ static bool ath9k_hw_set_cts_timeout(struct ath_hal *ah, u32 us)
1097 struct ath_hal_5416 *ahp = AH5416(ah); 1091 struct ath_hal_5416 *ahp = AH5416(ah);
1098 1092
1099 if (us > ath9k_hw_mac_to_usec(ah, MS(0xffffffff, AR_TIME_OUT_CTS))) { 1093 if (us > ath9k_hw_mac_to_usec(ah, MS(0xffffffff, AR_TIME_OUT_CTS))) {
1100 DPRINTF(ah->ah_sc, ATH_DBG_RESET, "%s: bad cts timeout %u\n", 1094 DPRINTF(ah->ah_sc, ATH_DBG_RESET, "bad cts timeout %u\n", us);
1101 __func__, us);
1102 ahp->ah_ctstimeout = (u32) -1; 1095 ahp->ah_ctstimeout = (u32) -1;
1103 return false; 1096 return false;
1104 } else { 1097 } else {
@@ -1115,7 +1108,7 @@ static bool ath9k_hw_set_global_txtimeout(struct ath_hal *ah, u32 tu)
1115 1108
1116 if (tu > 0xFFFF) { 1109 if (tu > 0xFFFF) {
1117 DPRINTF(ah->ah_sc, ATH_DBG_XMIT, 1110 DPRINTF(ah->ah_sc, ATH_DBG_XMIT,
1118 "%s: bad global tx timeout %u\n", __func__, tu); 1111 "bad global tx timeout %u\n", tu);
1119 ahp->ah_globaltxtimeout = (u32) -1; 1112 ahp->ah_globaltxtimeout = (u32) -1;
1120 return false; 1113 return false;
1121 } else { 1114 } else {
@@ -1129,8 +1122,8 @@ static void ath9k_hw_init_user_settings(struct ath_hal *ah)
1129{ 1122{
1130 struct ath_hal_5416 *ahp = AH5416(ah); 1123 struct ath_hal_5416 *ahp = AH5416(ah);
1131 1124
1132 DPRINTF(ah->ah_sc, ATH_DBG_RESET, "--AP %s ahp->ah_miscMode 0x%x\n", 1125 DPRINTF(ah->ah_sc, ATH_DBG_RESET, "ahp->ah_miscMode 0x%x\n",
1133 __func__, ahp->ah_miscMode); 1126 ahp->ah_miscMode);
1134 1127
1135 if (ahp->ah_miscMode != 0) 1128 if (ahp->ah_miscMode != 0)
1136 REG_WRITE(ah, AR_PCU_MISC, 1129 REG_WRITE(ah, AR_PCU_MISC,
@@ -1176,7 +1169,7 @@ struct ath_hal *ath9k_hw_attach(u16 devid, struct ath_softc *sc,
1176 break; 1169 break;
1177 default: 1170 default:
1178 DPRINTF(ah->ah_sc, ATH_DBG_ANY, 1171 DPRINTF(ah->ah_sc, ATH_DBG_ANY,
1179 "devid=0x%x not supported.\n", devid); 1172 "devid=0x%x not supported.\n", devid);
1180 ah = NULL; 1173 ah = NULL;
1181 *error = -ENXIO; 1174 *error = -ENXIO;
1182 break; 1175 break;
@@ -1355,13 +1348,13 @@ static int ath9k_hw_process_ini(struct ath_hal *ah,
1355 (u32) ah->ah_powerLimit)); 1348 (u32) ah->ah_powerLimit));
1356 if (status != 0) { 1349 if (status != 0) {
1357 DPRINTF(ah->ah_sc, ATH_DBG_POWER_MGMT, 1350 DPRINTF(ah->ah_sc, ATH_DBG_POWER_MGMT,
1358 "%s: error init'ing transmit power\n", __func__); 1351 "error init'ing transmit power\n");
1359 return -EIO; 1352 return -EIO;
1360 } 1353 }
1361 1354
1362 if (!ath9k_hw_set_rf_regs(ah, chan, freqIndex)) { 1355 if (!ath9k_hw_set_rf_regs(ah, chan, freqIndex)) {
1363 DPRINTF(ah->ah_sc, ATH_DBG_REG_IO, 1356 DPRINTF(ah->ah_sc, ATH_DBG_REG_IO,
1364 "%s: ar5416SetRfRegs failed\n", __func__); 1357 "ar5416SetRfRegs failed\n");
1365 return -EIO; 1358 return -EIO;
1366 } 1359 }
1367 1360
@@ -1533,8 +1526,7 @@ static bool ath9k_hw_set_reset(struct ath_hal *ah, int type)
1533 REG_WRITE(ah, (u16) (AR_RTC_RC), 0); 1526 REG_WRITE(ah, (u16) (AR_RTC_RC), 0);
1534 if (!ath9k_hw_wait(ah, (u16) (AR_RTC_RC), AR_RTC_RC_M, 0)) { 1527 if (!ath9k_hw_wait(ah, (u16) (AR_RTC_RC), AR_RTC_RC_M, 0)) {
1535 DPRINTF(ah->ah_sc, ATH_DBG_RESET, 1528 DPRINTF(ah->ah_sc, ATH_DBG_RESET,
1536 "%s: RTC stuck in MAC reset\n", 1529 "RTC stuck in MAC reset\n");
1537 __func__);
1538 return false; 1530 return false;
1539 } 1531 }
1540 1532
@@ -1561,8 +1553,7 @@ static bool ath9k_hw_set_reset_power_on(struct ath_hal *ah)
1561 AR_RTC_STATUS, 1553 AR_RTC_STATUS,
1562 AR_RTC_STATUS_M, 1554 AR_RTC_STATUS_M,
1563 AR_RTC_STATUS_ON)) { 1555 AR_RTC_STATUS_ON)) {
1564 DPRINTF(ah->ah_sc, ATH_DBG_RESET, "%s: RTC not waking up\n", 1556 DPRINTF(ah->ah_sc, ATH_DBG_RESET, "RTC not waking up\n");
1565 __func__);
1566 return false; 1557 return false;
1567 } 1558 }
1568 1559
@@ -1641,9 +1632,8 @@ static struct ath9k_channel *ath9k_hw_check_chan(struct ath_hal *ah,
1641{ 1632{
1642 if (!(IS_CHAN_2GHZ(chan) ^ IS_CHAN_5GHZ(chan))) { 1633 if (!(IS_CHAN_2GHZ(chan) ^ IS_CHAN_5GHZ(chan))) {
1643 DPRINTF(ah->ah_sc, ATH_DBG_CHANNEL, 1634 DPRINTF(ah->ah_sc, ATH_DBG_CHANNEL,
1644 "%s: invalid channel %u/0x%x; not marked as " 1635 "invalid channel %u/0x%x; not marked as "
1645 "2GHz or 5GHz\n", __func__, chan->channel, 1636 "2GHz or 5GHz\n", chan->channel, chan->channelFlags);
1646 chan->channelFlags);
1647 return NULL; 1637 return NULL;
1648 } 1638 }
1649 1639
@@ -1652,9 +1642,9 @@ static struct ath9k_channel *ath9k_hw_check_chan(struct ath_hal *ah,
1652 !IS_CHAN_HT20(chan) && 1642 !IS_CHAN_HT20(chan) &&
1653 !IS_CHAN_HT40(chan)) { 1643 !IS_CHAN_HT40(chan)) {
1654 DPRINTF(ah->ah_sc, ATH_DBG_CHANNEL, 1644 DPRINTF(ah->ah_sc, ATH_DBG_CHANNEL,
1655 "%s: invalid channel %u/0x%x; not marked as " 1645 "invalid channel %u/0x%x; not marked as "
1656 "OFDM or CCK or HT20 or HT40PLUS or HT40MINUS\n", 1646 "OFDM or CCK or HT20 or HT40PLUS or HT40MINUS\n",
1657 __func__, chan->channel, chan->channelFlags); 1647 chan->channel, chan->channelFlags);
1658 return NULL; 1648 return NULL;
1659 } 1649 }
1660 1650
@@ -1670,8 +1660,7 @@ static bool ath9k_hw_channel_change(struct ath_hal *ah,
1670 for (qnum = 0; qnum < AR_NUM_QCU; qnum++) { 1660 for (qnum = 0; qnum < AR_NUM_QCU; qnum++) {
1671 if (ath9k_hw_numtxpending(ah, qnum)) { 1661 if (ath9k_hw_numtxpending(ah, qnum)) {
1672 DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, 1662 DPRINTF(ah->ah_sc, ATH_DBG_QUEUE,
1673 "%s: Transmit frames pending on queue %d\n", 1663 "Transmit frames pending on queue %d\n", qnum);
1674 __func__, qnum);
1675 return false; 1664 return false;
1676 } 1665 }
1677 } 1666 }
@@ -1679,8 +1668,8 @@ static bool ath9k_hw_channel_change(struct ath_hal *ah,
1679 REG_WRITE(ah, AR_PHY_RFBUS_REQ, AR_PHY_RFBUS_REQ_EN); 1668 REG_WRITE(ah, AR_PHY_RFBUS_REQ, AR_PHY_RFBUS_REQ_EN);
1680 if (!ath9k_hw_wait(ah, AR_PHY_RFBUS_GRANT, AR_PHY_RFBUS_GRANT_EN, 1669 if (!ath9k_hw_wait(ah, AR_PHY_RFBUS_GRANT, AR_PHY_RFBUS_GRANT_EN,
1681 AR_PHY_RFBUS_GRANT_EN)) { 1670 AR_PHY_RFBUS_GRANT_EN)) {
1682 DPRINTF(ah->ah_sc, ATH_DBG_PHY_IO, 1671 DPRINTF(ah->ah_sc, ATH_DBG_REG_IO,
1683 "%s: Could not kill baseband RX\n", __func__); 1672 "Could not kill baseband RX\n");
1684 return false; 1673 return false;
1685 } 1674 }
1686 1675
@@ -1689,13 +1678,13 @@ static bool ath9k_hw_channel_change(struct ath_hal *ah,
1689 if (AR_SREV_9280_10_OR_LATER(ah)) { 1678 if (AR_SREV_9280_10_OR_LATER(ah)) {
1690 if (!(ath9k_hw_ar9280_set_channel(ah, chan))) { 1679 if (!(ath9k_hw_ar9280_set_channel(ah, chan))) {
1691 DPRINTF(ah->ah_sc, ATH_DBG_CHANNEL, 1680 DPRINTF(ah->ah_sc, ATH_DBG_CHANNEL,
1692 "%s: failed to set channel\n", __func__); 1681 "failed to set channel\n");
1693 return false; 1682 return false;
1694 } 1683 }
1695 } else { 1684 } else {
1696 if (!(ath9k_hw_set_channel(ah, chan))) { 1685 if (!(ath9k_hw_set_channel(ah, chan))) {
1697 DPRINTF(ah->ah_sc, ATH_DBG_CHANNEL, 1686 DPRINTF(ah->ah_sc, ATH_DBG_CHANNEL,
1698 "%s: failed to set channel\n", __func__); 1687 "failed to set channel\n");
1699 return false; 1688 return false;
1700 } 1689 }
1701 } 1690 }
@@ -1707,7 +1696,7 @@ static bool ath9k_hw_channel_change(struct ath_hal *ah,
1707 min((u32) MAX_RATE_POWER, 1696 min((u32) MAX_RATE_POWER,
1708 (u32) ah->ah_powerLimit)) != 0) { 1697 (u32) ah->ah_powerLimit)) != 0) {
1709 DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, 1698 DPRINTF(ah->ah_sc, ATH_DBG_EEPROM,
1710 "%s: error init'ing transmit power\n", __func__); 1699 "error init'ing transmit power\n");
1711 return false; 1700 return false;
1712 } 1701 }
1713 1702
@@ -2211,8 +2200,8 @@ bool ath9k_hw_reset(struct ath_hal *ah, struct ath9k_channel *chan,
2211 2200
2212 if (ath9k_hw_check_chan(ah, chan) == NULL) { 2201 if (ath9k_hw_check_chan(ah, chan) == NULL) {
2213 DPRINTF(ah->ah_sc, ATH_DBG_CHANNEL, 2202 DPRINTF(ah->ah_sc, ATH_DBG_CHANNEL,
2214 "%s: invalid channel %u/0x%x; no mapping\n", 2203 "invalid channel %u/0x%x; no mapping\n",
2215 __func__, chan->channel, chan->channelFlags); 2204 chan->channel, chan->channelFlags);
2216 ecode = -EINVAL; 2205 ecode = -EINVAL;
2217 goto bad; 2206 goto bad;
2218 } 2207 }
@@ -2254,8 +2243,7 @@ bool ath9k_hw_reset(struct ath_hal *ah, struct ath9k_channel *chan,
2254 ath9k_hw_mark_phy_inactive(ah); 2243 ath9k_hw_mark_phy_inactive(ah);
2255 2244
2256 if (!ath9k_hw_chip_reset(ah, chan)) { 2245 if (!ath9k_hw_chip_reset(ah, chan)) {
2257 DPRINTF(ah->ah_sc, ATH_DBG_RESET, "%s: chip reset failed\n", 2246 DPRINTF(ah->ah_sc, ATH_DBG_RESET, "chip reset failed\n");
2258 __func__);
2259 ecode = -EINVAL; 2247 ecode = -EINVAL;
2260 goto bad; 2248 goto bad;
2261 } 2249 }
@@ -2289,7 +2277,7 @@ bool ath9k_hw_reset(struct ath_hal *ah, struct ath9k_channel *chan,
2289 2277
2290 if (!ath9k_hw_eeprom_set_board_values(ah, chan)) { 2278 if (!ath9k_hw_eeprom_set_board_values(ah, chan)) {
2291 DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, 2279 DPRINTF(ah->ah_sc, ATH_DBG_EEPROM,
2292 "%s: error setting board options\n", __func__); 2280 "error setting board options\n");
2293 ecode = -EIO; 2281 ecode = -EIO;
2294 goto bad; 2282 goto bad;
2295 } 2283 }
@@ -2379,15 +2367,13 @@ bool ath9k_hw_reset(struct ath_hal *ah, struct ath9k_channel *chan,
2379 mask = REG_READ(ah, AR_CFG); 2367 mask = REG_READ(ah, AR_CFG);
2380 if (mask & (AR_CFG_SWRB | AR_CFG_SWTB | AR_CFG_SWRG)) { 2368 if (mask & (AR_CFG_SWRB | AR_CFG_SWTB | AR_CFG_SWRG)) {
2381 DPRINTF(ah->ah_sc, ATH_DBG_RESET, 2369 DPRINTF(ah->ah_sc, ATH_DBG_RESET,
2382 "%s CFG Byte Swap Set 0x%x\n", __func__, 2370 "CFG Byte Swap Set 0x%x\n", mask);
2383 mask);
2384 } else { 2371 } else {
2385 mask = 2372 mask =
2386 INIT_CONFIG_STATUS | AR_CFG_SWRB | AR_CFG_SWTB; 2373 INIT_CONFIG_STATUS | AR_CFG_SWRB | AR_CFG_SWTB;
2387 REG_WRITE(ah, AR_CFG, mask); 2374 REG_WRITE(ah, AR_CFG, mask);
2388 DPRINTF(ah->ah_sc, ATH_DBG_RESET, 2375 DPRINTF(ah->ah_sc, ATH_DBG_RESET,
2389 "%s Setting CFG 0x%x\n", __func__, 2376 "Setting CFG 0x%x\n", REG_READ(ah, AR_CFG));
2390 REG_READ(ah, AR_CFG));
2391 } 2377 }
2392 } else { 2378 } else {
2393#ifdef __BIG_ENDIAN 2379#ifdef __BIG_ENDIAN
@@ -2412,7 +2398,7 @@ bool ath9k_hw_keyreset(struct ath_hal *ah, u16 entry)
2412 2398
2413 if (entry >= ah->ah_caps.keycache_size) { 2399 if (entry >= ah->ah_caps.keycache_size) {
2414 DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE, 2400 DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE,
2415 "%s: entry %u out of range\n", __func__, entry); 2401 "entry %u out of range\n", entry);
2416 return false; 2402 return false;
2417 } 2403 }
2418 2404
@@ -2449,7 +2435,7 @@ bool ath9k_hw_keysetmac(struct ath_hal *ah, u16 entry, const u8 *mac)
2449 2435
2450 if (entry >= ah->ah_caps.keycache_size) { 2436 if (entry >= ah->ah_caps.keycache_size) {
2451 DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE, 2437 DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE,
2452 "%s: entry %u out of range\n", __func__, entry); 2438 "entry %u out of range\n", entry);
2453 return false; 2439 return false;
2454 } 2440 }
2455 2441
@@ -2485,7 +2471,7 @@ bool ath9k_hw_set_keycache_entry(struct ath_hal *ah, u16 entry,
2485 2471
2486 if (entry >= pCap->keycache_size) { 2472 if (entry >= pCap->keycache_size) {
2487 DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE, 2473 DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE,
2488 "%s: entry %u out of range\n", __func__, entry); 2474 "entry %u out of range\n", entry);
2489 return false; 2475 return false;
2490 } 2476 }
2491 2477
@@ -2496,8 +2482,7 @@ bool ath9k_hw_set_keycache_entry(struct ath_hal *ah, u16 entry,
2496 case ATH9K_CIPHER_AES_CCM: 2482 case ATH9K_CIPHER_AES_CCM:
2497 if (!(pCap->hw_caps & ATH9K_HW_CAP_CIPHER_AESCCM)) { 2483 if (!(pCap->hw_caps & ATH9K_HW_CAP_CIPHER_AESCCM)) {
2498 DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE, 2484 DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE,
2499 "%s: AES-CCM not supported by " 2485 "AES-CCM not supported by mac rev 0x%x\n",
2500 "mac rev 0x%x\n", __func__,
2501 ah->ah_macRev); 2486 ah->ah_macRev);
2502 return false; 2487 return false;
2503 } 2488 }
@@ -2508,16 +2493,14 @@ bool ath9k_hw_set_keycache_entry(struct ath_hal *ah, u16 entry,
2508 if (ATH9K_IS_MIC_ENABLED(ah) 2493 if (ATH9K_IS_MIC_ENABLED(ah)
2509 && entry + 64 >= pCap->keycache_size) { 2494 && entry + 64 >= pCap->keycache_size) {
2510 DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE, 2495 DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE,
2511 "%s: entry %u inappropriate for TKIP\n", 2496 "entry %u inappropriate for TKIP\n", entry);
2512 __func__, entry);
2513 return false; 2497 return false;
2514 } 2498 }
2515 break; 2499 break;
2516 case ATH9K_CIPHER_WEP: 2500 case ATH9K_CIPHER_WEP:
2517 if (k->kv_len < LEN_WEP40) { 2501 if (k->kv_len < LEN_WEP40) {
2518 DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE, 2502 DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE,
2519 "%s: WEP key length %u too small\n", 2503 "WEP key length %u too small\n", k->kv_len);
2520 __func__, k->kv_len);
2521 return false; 2504 return false;
2522 } 2505 }
2523 if (k->kv_len <= LEN_WEP40) 2506 if (k->kv_len <= LEN_WEP40)
@@ -2532,8 +2515,7 @@ bool ath9k_hw_set_keycache_entry(struct ath_hal *ah, u16 entry,
2532 break; 2515 break;
2533 default: 2516 default:
2534 DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE, 2517 DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE,
2535 "%s: cipher %u not supported\n", __func__, 2518 "cipher %u not supported\n", k->kv_type);
2536 k->kv_type);
2537 return false; 2519 return false;
2538 } 2520 }
2539 2521
@@ -2682,8 +2664,7 @@ static bool ath9k_hw_set_power_awake(struct ath_hal *ah,
2682 } 2664 }
2683 if (i == 0) { 2665 if (i == 0) {
2684 DPRINTF(ah->ah_sc, ATH_DBG_POWER_MGMT, 2666 DPRINTF(ah->ah_sc, ATH_DBG_POWER_MGMT,
2685 "%s: Failed to wakeup in %uus\n", 2667 "Failed to wakeup in %uus\n", POWER_UP_TIME / 20);
2686 __func__, POWER_UP_TIME / 20);
2687 return false; 2668 return false;
2688 } 2669 }
2689 } 2670 }
@@ -2705,7 +2686,7 @@ bool ath9k_hw_setpower(struct ath_hal *ah,
2705 }; 2686 };
2706 int status = true, setChip = true; 2687 int status = true, setChip = true;
2707 2688
2708 DPRINTF(ah->ah_sc, ATH_DBG_POWER_MGMT, "%s: %s -> %s (%s)\n", __func__, 2689 DPRINTF(ah->ah_sc, ATH_DBG_POWER_MGMT, "%s -> %s (%s)\n",
2709 modes[ahp->ah_powerMode], modes[mode], 2690 modes[ahp->ah_powerMode], modes[mode],
2710 setChip ? "set chip " : ""); 2691 setChip ? "set chip " : "");
2711 2692
@@ -2722,7 +2703,7 @@ bool ath9k_hw_setpower(struct ath_hal *ah,
2722 break; 2703 break;
2723 default: 2704 default:
2724 DPRINTF(ah->ah_sc, ATH_DBG_POWER_MGMT, 2705 DPRINTF(ah->ah_sc, ATH_DBG_POWER_MGMT,
2725 "%s: unknown power mode %u\n", __func__, mode); 2706 "Unknown power mode %u\n", mode);
2726 return false; 2707 return false;
2727 } 2708 }
2728 ahp->ah_powerMode = mode; 2709 ahp->ah_powerMode = mode;
@@ -2899,8 +2880,7 @@ bool ath9k_hw_getisr(struct ath_hal *ah, enum ath9k_int *masked)
2899 2880
2900 if (isr & AR_ISR_RXORN) { 2881 if (isr & AR_ISR_RXORN) {
2901 DPRINTF(ah->ah_sc, ATH_DBG_INTERRUPT, 2882 DPRINTF(ah->ah_sc, ATH_DBG_INTERRUPT,
2902 "%s: receive FIFO overrun interrupt\n", 2883 "receive FIFO overrun interrupt\n");
2903 __func__);
2904 } 2884 }
2905 2885
2906 if (!AR_SREV_9100(ah)) { 2886 if (!AR_SREV_9100(ah)) {
@@ -2926,27 +2906,23 @@ bool ath9k_hw_getisr(struct ath_hal *ah, enum ath9k_int *masked)
2926 if (fatal_int) { 2906 if (fatal_int) {
2927 if (sync_cause & AR_INTR_SYNC_HOST1_FATAL) { 2907 if (sync_cause & AR_INTR_SYNC_HOST1_FATAL) {
2928 DPRINTF(ah->ah_sc, ATH_DBG_ANY, 2908 DPRINTF(ah->ah_sc, ATH_DBG_ANY,
2929 "%s: received PCI FATAL interrupt\n", 2909 "received PCI FATAL interrupt\n");
2930 __func__);
2931 } 2910 }
2932 if (sync_cause & AR_INTR_SYNC_HOST1_PERR) { 2911 if (sync_cause & AR_INTR_SYNC_HOST1_PERR) {
2933 DPRINTF(ah->ah_sc, ATH_DBG_ANY, 2912 DPRINTF(ah->ah_sc, ATH_DBG_ANY,
2934 "%s: received PCI PERR interrupt\n", 2913 "received PCI PERR interrupt\n");
2935 __func__);
2936 } 2914 }
2937 } 2915 }
2938 if (sync_cause & AR_INTR_SYNC_RADM_CPL_TIMEOUT) { 2916 if (sync_cause & AR_INTR_SYNC_RADM_CPL_TIMEOUT) {
2939 DPRINTF(ah->ah_sc, ATH_DBG_INTERRUPT, 2917 DPRINTF(ah->ah_sc, ATH_DBG_INTERRUPT,
2940 "%s: AR_INTR_SYNC_RADM_CPL_TIMEOUT\n", 2918 "AR_INTR_SYNC_RADM_CPL_TIMEOUT\n");
2941 __func__);
2942 REG_WRITE(ah, AR_RC, AR_RC_HOSTIF); 2919 REG_WRITE(ah, AR_RC, AR_RC_HOSTIF);
2943 REG_WRITE(ah, AR_RC, 0); 2920 REG_WRITE(ah, AR_RC, 0);
2944 *masked |= ATH9K_INT_FATAL; 2921 *masked |= ATH9K_INT_FATAL;
2945 } 2922 }
2946 if (sync_cause & AR_INTR_SYNC_LOCAL_TIMEOUT) { 2923 if (sync_cause & AR_INTR_SYNC_LOCAL_TIMEOUT) {
2947 DPRINTF(ah->ah_sc, ATH_DBG_INTERRUPT, 2924 DPRINTF(ah->ah_sc, ATH_DBG_INTERRUPT,
2948 "%s: AR_INTR_SYNC_LOCAL_TIMEOUT\n", 2925 "AR_INTR_SYNC_LOCAL_TIMEOUT\n");
2949 __func__);
2950 } 2926 }
2951 2927
2952 REG_WRITE(ah, AR_INTR_SYNC_CAUSE_CLR, sync_cause); 2928 REG_WRITE(ah, AR_INTR_SYNC_CAUSE_CLR, sync_cause);
@@ -2968,12 +2944,10 @@ enum ath9k_int ath9k_hw_set_interrupts(struct ath_hal *ah, enum ath9k_int ints)
2968 u32 mask, mask2; 2944 u32 mask, mask2;
2969 struct ath9k_hw_capabilities *pCap = &ah->ah_caps; 2945 struct ath9k_hw_capabilities *pCap = &ah->ah_caps;
2970 2946
2971 DPRINTF(ah->ah_sc, ATH_DBG_INTERRUPT, "%s: 0x%x => 0x%x\n", __func__, 2947 DPRINTF(ah->ah_sc, ATH_DBG_INTERRUPT, "0x%x => 0x%x\n", omask, ints);
2972 omask, ints);
2973 2948
2974 if (omask & ATH9K_INT_GLOBAL) { 2949 if (omask & ATH9K_INT_GLOBAL) {
2975 DPRINTF(ah->ah_sc, ATH_DBG_INTERRUPT, "%s: disable IER\n", 2950 DPRINTF(ah->ah_sc, ATH_DBG_INTERRUPT, "disable IER\n");
2976 __func__);
2977 REG_WRITE(ah, AR_IER, AR_IER_DISABLE); 2951 REG_WRITE(ah, AR_IER, AR_IER_DISABLE);
2978 (void) REG_READ(ah, AR_IER); 2952 (void) REG_READ(ah, AR_IER);
2979 if (!AR_SREV_9100(ah)) { 2953 if (!AR_SREV_9100(ah)) {
@@ -3028,8 +3002,7 @@ enum ath9k_int ath9k_hw_set_interrupts(struct ath_hal *ah, enum ath9k_int ints)
3028 mask2 |= AR_IMR_S2_CST; 3002 mask2 |= AR_IMR_S2_CST;
3029 } 3003 }
3030 3004
3031 DPRINTF(ah->ah_sc, ATH_DBG_INTERRUPT, "%s: new IMR 0x%x\n", __func__, 3005 DPRINTF(ah->ah_sc, ATH_DBG_INTERRUPT, "new IMR 0x%x\n", mask);
3032 mask);
3033 REG_WRITE(ah, AR_IMR, mask); 3006 REG_WRITE(ah, AR_IMR, mask);
3034 mask = REG_READ(ah, AR_IMR_S2) & ~(AR_IMR_S2_TIM | 3007 mask = REG_READ(ah, AR_IMR_S2) & ~(AR_IMR_S2_TIM |
3035 AR_IMR_S2_DTIM | 3008 AR_IMR_S2_DTIM |
@@ -3049,8 +3022,7 @@ enum ath9k_int ath9k_hw_set_interrupts(struct ath_hal *ah, enum ath9k_int ints)
3049 } 3022 }
3050 3023
3051 if (ints & ATH9K_INT_GLOBAL) { 3024 if (ints & ATH9K_INT_GLOBAL) {
3052 DPRINTF(ah->ah_sc, ATH_DBG_INTERRUPT, "%s: enable IER\n", 3025 DPRINTF(ah->ah_sc, ATH_DBG_INTERRUPT, "enable IER\n");
3053 __func__);
3054 REG_WRITE(ah, AR_IER, AR_IER_ENABLE); 3026 REG_WRITE(ah, AR_IER, AR_IER_ENABLE);
3055 if (!AR_SREV_9100(ah)) { 3027 if (!AR_SREV_9100(ah)) {
3056 REG_WRITE(ah, AR_INTR_ASYNC_ENABLE, 3028 REG_WRITE(ah, AR_INTR_ASYNC_ENABLE,
@@ -3156,14 +3128,10 @@ void ath9k_hw_set_sta_beacon_timers(struct ath_hal *ah,
3156 else 3128 else
3157 nextTbtt = bs->bs_nexttbtt; 3129 nextTbtt = bs->bs_nexttbtt;
3158 3130
3159 DPRINTF(ah->ah_sc, ATH_DBG_BEACON, "%s: next DTIM %d\n", __func__, 3131 DPRINTF(ah->ah_sc, ATH_DBG_BEACON, "next DTIM %d\n", bs->bs_nextdtim);
3160 bs->bs_nextdtim); 3132 DPRINTF(ah->ah_sc, ATH_DBG_BEACON, "next beacon %d\n", nextTbtt);
3161 DPRINTF(ah->ah_sc, ATH_DBG_BEACON, "%s: next beacon %d\n", __func__, 3133 DPRINTF(ah->ah_sc, ATH_DBG_BEACON, "beacon period %d\n", beaconintval);
3162 nextTbtt); 3134 DPRINTF(ah->ah_sc, ATH_DBG_BEACON, "DTIM period %d\n", dtimperiod);
3163 DPRINTF(ah->ah_sc, ATH_DBG_BEACON, "%s: beacon period %d\n", __func__,
3164 beaconintval);
3165 DPRINTF(ah->ah_sc, ATH_DBG_BEACON, "%s: DTIM period %d\n", __func__,
3166 dtimperiod);
3167 3135
3168 REG_WRITE(ah, AR_NEXT_DTIM, 3136 REG_WRITE(ah, AR_NEXT_DTIM,
3169 TU_TO_USEC(bs->bs_nextdtim - SLEEP_SLOP)); 3137 TU_TO_USEC(bs->bs_nextdtim - SLEEP_SLOP));
@@ -3216,8 +3184,7 @@ bool ath9k_hw_fill_cap_info(struct ath_hal *ah)
3216 else if (ah->ah_currentRD == 0x41) 3184 else if (ah->ah_currentRD == 0x41)
3217 ah->ah_currentRD = 0x43; 3185 ah->ah_currentRD = 0x43;
3218 DPRINTF(ah->ah_sc, ATH_DBG_REGULATORY, 3186 DPRINTF(ah->ah_sc, ATH_DBG_REGULATORY,
3219 "%s: regdomain mapped to 0x%x\n", __func__, 3187 "regdomain mapped to 0x%x\n", ah->ah_currentRD);
3220 ah->ah_currentRD);
3221 } 3188 }
3222 3189
3223 eeval = ath9k_hw_get_eeprom(ah, EEP_OP_MODE); 3190 eeval = ath9k_hw_get_eeprom(ah, EEP_OP_MODE);
@@ -3823,8 +3790,7 @@ void ath9k_hw_reset_tsf(struct ath_hal *ah)
3823 count++; 3790 count++;
3824 if (count > 10) { 3791 if (count > 10) {
3825 DPRINTF(ah->ah_sc, ATH_DBG_RESET, 3792 DPRINTF(ah->ah_sc, ATH_DBG_RESET,
3826 "%s: AR_SLP32_TSF_WRITE_STATUS limit exceeded\n", 3793 "AR_SLP32_TSF_WRITE_STATUS limit exceeded\n");
3827 __func__);
3828 break; 3794 break;
3829 } 3795 }
3830 udelay(10); 3796 udelay(10);
@@ -3849,8 +3815,7 @@ bool ath9k_hw_setslottime(struct ath_hal *ah, u32 us)
3849 struct ath_hal_5416 *ahp = AH5416(ah); 3815 struct ath_hal_5416 *ahp = AH5416(ah);
3850 3816
3851 if (us < ATH9K_SLOT_TIME_9 || us > ath9k_hw_mac_to_usec(ah, 0xffff)) { 3817 if (us < ATH9K_SLOT_TIME_9 || us > ath9k_hw_mac_to_usec(ah, 0xffff)) {
3852 DPRINTF(ah->ah_sc, ATH_DBG_RESET, "%s: bad slot time %u\n", 3818 DPRINTF(ah->ah_sc, ATH_DBG_RESET, "bad slot time %u\n", us);
3853 __func__, us);
3854 ahp->ah_slottime = (u32) -1; 3819 ahp->ah_slottime = (u32) -1;
3855 return false; 3820 return false;
3856 } else { 3821 } else {