Commit 4d6b228d authored by Luis R. Rodriguez's avatar Luis R. Rodriguez Committed by John W. Linville

ath9k: use ath_hw for DPRINTF() and debug init/exit

DPRINTF() is used in hw specific related code, as such
ensure we don't rely on the private driver core ath_softc
struct when calling it. Drivers can then implement their
own DPRINTF() as they see fit.
Signed-off-by: default avatarLuis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent d519e17e
...@@ -40,7 +40,7 @@ static bool ath_ahb_eeprom_read(struct ath_hw *ah, u32 off, u16 *data) ...@@ -40,7 +40,7 @@ static bool ath_ahb_eeprom_read(struct ath_hw *ah, u32 off, u16 *data)
pdata = (struct ath9k_platform_data *) pdev->dev.platform_data; pdata = (struct ath9k_platform_data *) pdev->dev.platform_data;
if (off >= (ARRAY_SIZE(pdata->eeprom_data))) { if (off >= (ARRAY_SIZE(pdata->eeprom_data))) {
DPRINTF(ah->ah_sc, ATH_DBG_FATAL, DPRINTF(ah, ATH_DBG_FATAL,
"%s: flash read failed, offset %08x is out of range\n", "%s: flash read failed, offset %08x is out of range\n",
__func__, off); __func__, off);
return false; return false;
......
...@@ -31,7 +31,7 @@ static int ath9k_hw_get_ani_channel_idx(struct ath_hw *ah, ...@@ -31,7 +31,7 @@ static int ath9k_hw_get_ani_channel_idx(struct ath_hw *ah,
} }
} }
DPRINTF(ah->ah_sc, ATH_DBG_ANI, DPRINTF(ah, ATH_DBG_ANI,
"No more channel states left. Using channel 0\n"); "No more channel states left. Using channel 0\n");
return 0; return 0;
...@@ -47,7 +47,7 @@ static bool ath9k_hw_ani_control(struct ath_hw *ah, ...@@ -47,7 +47,7 @@ static bool ath9k_hw_ani_control(struct ath_hw *ah,
u32 level = param; u32 level = param;
if (level >= ARRAY_SIZE(ah->totalSizeDesired)) { if (level >= ARRAY_SIZE(ah->totalSizeDesired)) {
DPRINTF(ah->ah_sc, ATH_DBG_ANI, DPRINTF(ah, ATH_DBG_ANI,
"level out of range (%u > %u)\n", "level out of range (%u > %u)\n",
level, level,
(unsigned)ARRAY_SIZE(ah->totalSizeDesired)); (unsigned)ARRAY_SIZE(ah->totalSizeDesired));
...@@ -152,7 +152,7 @@ static bool ath9k_hw_ani_control(struct ath_hw *ah, ...@@ -152,7 +152,7 @@ static bool ath9k_hw_ani_control(struct ath_hw *ah,
u32 level = param; u32 level = param;
if (level >= ARRAY_SIZE(firstep)) { if (level >= ARRAY_SIZE(firstep)) {
DPRINTF(ah->ah_sc, ATH_DBG_ANI, DPRINTF(ah, ATH_DBG_ANI,
"level out of range (%u > %u)\n", "level out of range (%u > %u)\n",
level, level,
(unsigned) ARRAY_SIZE(firstep)); (unsigned) ARRAY_SIZE(firstep));
...@@ -174,7 +174,7 @@ static bool ath9k_hw_ani_control(struct ath_hw *ah, ...@@ -174,7 +174,7 @@ static bool ath9k_hw_ani_control(struct ath_hw *ah,
u32 level = param; u32 level = param;
if (level >= ARRAY_SIZE(cycpwrThr1)) { if (level >= ARRAY_SIZE(cycpwrThr1)) {
DPRINTF(ah->ah_sc, ATH_DBG_ANI, DPRINTF(ah, ATH_DBG_ANI,
"level out of range (%u > %u)\n", "level out of range (%u > %u)\n",
level, level,
(unsigned) (unsigned)
...@@ -194,23 +194,23 @@ static bool ath9k_hw_ani_control(struct ath_hw *ah, ...@@ -194,23 +194,23 @@ static bool ath9k_hw_ani_control(struct ath_hw *ah,
case ATH9K_ANI_PRESENT: case ATH9K_ANI_PRESENT:
break; break;
default: default:
DPRINTF(ah->ah_sc, ATH_DBG_ANI, DPRINTF(ah, ATH_DBG_ANI,
"invalid cmd %u\n", cmd); "invalid cmd %u\n", cmd);
return false; return false;
} }
DPRINTF(ah->ah_sc, ATH_DBG_ANI, "ANI parameters:\n"); DPRINTF(ah, ATH_DBG_ANI, "ANI parameters:\n");
DPRINTF(ah->ah_sc, ATH_DBG_ANI, DPRINTF(ah, ATH_DBG_ANI,
"noiseImmunityLevel=%d, spurImmunityLevel=%d, " "noiseImmunityLevel=%d, spurImmunityLevel=%d, "
"ofdmWeakSigDetectOff=%d\n", "ofdmWeakSigDetectOff=%d\n",
aniState->noiseImmunityLevel, aniState->spurImmunityLevel, aniState->noiseImmunityLevel, aniState->spurImmunityLevel,
!aniState->ofdmWeakSigDetectOff); !aniState->ofdmWeakSigDetectOff);
DPRINTF(ah->ah_sc, ATH_DBG_ANI, DPRINTF(ah, ATH_DBG_ANI,
"cckWeakSigThreshold=%d, " "cckWeakSigThreshold=%d, "
"firstepLevel=%d, listenTime=%d\n", "firstepLevel=%d, listenTime=%d\n",
aniState->cckWeakSigThreshold, aniState->firstepLevel, aniState->cckWeakSigThreshold, aniState->firstepLevel,
aniState->listenTime); aniState->listenTime);
DPRINTF(ah->ah_sc, ATH_DBG_ANI, DPRINTF(ah, ATH_DBG_ANI,
"cycleCount=%d, ofdmPhyErrCount=%d, cckPhyErrCount=%d\n\n", "cycleCount=%d, ofdmPhyErrCount=%d, cckPhyErrCount=%d\n\n",
aniState->cycleCount, aniState->ofdmPhyErrCount, aniState->cycleCount, aniState->ofdmPhyErrCount,
aniState->cckPhyErrCount); aniState->cckPhyErrCount);
...@@ -240,7 +240,7 @@ static void ath9k_ani_restart(struct ath_hw *ah) ...@@ -240,7 +240,7 @@ static void ath9k_ani_restart(struct ath_hw *ah)
if (aniState->ofdmTrigHigh > AR_PHY_COUNTMAX) { if (aniState->ofdmTrigHigh > AR_PHY_COUNTMAX) {
aniState->ofdmPhyErrBase = 0; aniState->ofdmPhyErrBase = 0;
DPRINTF(ah->ah_sc, ATH_DBG_ANI, DPRINTF(ah, ATH_DBG_ANI,
"OFDM Trigger is too high for hw counters\n"); "OFDM Trigger is too high for hw counters\n");
} else { } else {
aniState->ofdmPhyErrBase = aniState->ofdmPhyErrBase =
...@@ -248,13 +248,13 @@ static void ath9k_ani_restart(struct ath_hw *ah) ...@@ -248,13 +248,13 @@ static void ath9k_ani_restart(struct ath_hw *ah)
} }
if (aniState->cckTrigHigh > AR_PHY_COUNTMAX) { if (aniState->cckTrigHigh > AR_PHY_COUNTMAX) {
aniState->cckPhyErrBase = 0; aniState->cckPhyErrBase = 0;
DPRINTF(ah->ah_sc, ATH_DBG_ANI, DPRINTF(ah, ATH_DBG_ANI,
"CCK Trigger is too high for hw counters\n"); "CCK Trigger is too high for hw counters\n");
} else { } else {
aniState->cckPhyErrBase = aniState->cckPhyErrBase =
AR_PHY_COUNTMAX - aniState->cckTrigHigh; AR_PHY_COUNTMAX - aniState->cckTrigHigh;
} }
DPRINTF(ah->ah_sc, ATH_DBG_ANI, DPRINTF(ah, ATH_DBG_ANI,
"Writing ofdmbase=%u cckbase=%u\n", "Writing ofdmbase=%u cckbase=%u\n",
aniState->ofdmPhyErrBase, aniState->ofdmPhyErrBase,
aniState->cckPhyErrBase); aniState->cckPhyErrBase);
...@@ -475,7 +475,7 @@ void ath9k_ani_reset(struct ath_hw *ah) ...@@ -475,7 +475,7 @@ void ath9k_ani_reset(struct ath_hw *ah)
if (DO_ANI(ah) && ah->opmode != NL80211_IFTYPE_STATION if (DO_ANI(ah) && ah->opmode != NL80211_IFTYPE_STATION
&& ah->opmode != NL80211_IFTYPE_ADHOC) { && ah->opmode != NL80211_IFTYPE_ADHOC) {
DPRINTF(ah->ah_sc, ATH_DBG_ANI, DPRINTF(ah, ATH_DBG_ANI,
"Reset ANI state opmode %u\n", ah->opmode); "Reset ANI state opmode %u\n", ah->opmode);
ah->stats.ast_ani_reset++; ah->stats.ast_ani_reset++;
...@@ -569,7 +569,7 @@ void ath9k_hw_ani_monitor(struct ath_hw *ah, ...@@ -569,7 +569,7 @@ void ath9k_hw_ani_monitor(struct ath_hw *ah,
if (phyCnt1 < aniState->ofdmPhyErrBase || if (phyCnt1 < aniState->ofdmPhyErrBase ||
phyCnt2 < aniState->cckPhyErrBase) { phyCnt2 < aniState->cckPhyErrBase) {
if (phyCnt1 < aniState->ofdmPhyErrBase) { if (phyCnt1 < aniState->ofdmPhyErrBase) {
DPRINTF(ah->ah_sc, ATH_DBG_ANI, DPRINTF(ah, ATH_DBG_ANI,
"phyCnt1 0x%x, resetting " "phyCnt1 0x%x, resetting "
"counter value to 0x%x\n", "counter value to 0x%x\n",
phyCnt1, aniState->ofdmPhyErrBase); phyCnt1, aniState->ofdmPhyErrBase);
...@@ -579,7 +579,7 @@ void ath9k_hw_ani_monitor(struct ath_hw *ah, ...@@ -579,7 +579,7 @@ void ath9k_hw_ani_monitor(struct ath_hw *ah,
AR_PHY_ERR_OFDM_TIMING); AR_PHY_ERR_OFDM_TIMING);
} }
if (phyCnt2 < aniState->cckPhyErrBase) { if (phyCnt2 < aniState->cckPhyErrBase) {
DPRINTF(ah->ah_sc, ATH_DBG_ANI, DPRINTF(ah, ATH_DBG_ANI,
"phyCnt2 0x%x, resetting " "phyCnt2 0x%x, resetting "
"counter value to 0x%x\n", "counter value to 0x%x\n",
phyCnt2, aniState->cckPhyErrBase); phyCnt2, aniState->cckPhyErrBase);
...@@ -624,7 +624,7 @@ void ath9k_hw_ani_monitor(struct ath_hw *ah, ...@@ -624,7 +624,7 @@ void ath9k_hw_ani_monitor(struct ath_hw *ah,
void ath9k_enable_mib_counters(struct ath_hw *ah) void ath9k_enable_mib_counters(struct ath_hw *ah)
{ {
DPRINTF(ah->ah_sc, ATH_DBG_ANI, "Enable MIB counters\n"); DPRINTF(ah, ATH_DBG_ANI, "Enable MIB counters\n");
ath9k_hw_update_mibstats(ah, &ah->ah_mibStats); ath9k_hw_update_mibstats(ah, &ah->ah_mibStats);
...@@ -640,7 +640,7 @@ void ath9k_enable_mib_counters(struct ath_hw *ah) ...@@ -640,7 +640,7 @@ void ath9k_enable_mib_counters(struct ath_hw *ah)
/* Freeze the MIB counters, get the stats and then clear them */ /* Freeze the MIB counters, get the stats and then clear them */
void ath9k_hw_disable_mib_counters(struct ath_hw *ah) void ath9k_hw_disable_mib_counters(struct ath_hw *ah)
{ {
DPRINTF(ah->ah_sc, ATH_DBG_ANI, "Disable MIB counters\n"); DPRINTF(ah, ATH_DBG_ANI, "Disable MIB counters\n");
REG_WRITE(ah, AR_MIBC, AR_MIBC_FMC); REG_WRITE(ah, AR_MIBC, AR_MIBC_FMC);
ath9k_hw_update_mibstats(ah, &ah->ah_mibStats); ath9k_hw_update_mibstats(ah, &ah->ah_mibStats);
REG_WRITE(ah, AR_MIBC, AR_MIBC_CMC); REG_WRITE(ah, AR_MIBC, AR_MIBC_CMC);
...@@ -662,7 +662,7 @@ u32 ath9k_hw_GetMibCycleCountsPct(struct ath_hw *ah, ...@@ -662,7 +662,7 @@ u32 ath9k_hw_GetMibCycleCountsPct(struct ath_hw *ah,
u32 cc = REG_READ(ah, AR_CCCNT); u32 cc = REG_READ(ah, AR_CCCNT);
if (cycles == 0 || cycles > cc) { if (cycles == 0 || cycles > cc) {
DPRINTF(ah->ah_sc, ATH_DBG_ANI, DPRINTF(ah, ATH_DBG_ANI,
"cycle counter wrap. ExtBusy = 0\n"); "cycle counter wrap. ExtBusy = 0\n");
good = 0; good = 0;
} else { } else {
...@@ -764,7 +764,7 @@ void ath9k_hw_ani_init(struct ath_hw *ah) ...@@ -764,7 +764,7 @@ void ath9k_hw_ani_init(struct ath_hw *ah)
{ {
int i; int i;
DPRINTF(ah->ah_sc, ATH_DBG_ANI, "Initialize ANI\n"); DPRINTF(ah, ATH_DBG_ANI, "Initialize ANI\n");
memset(ah->ani, 0, sizeof(ah->ani)); memset(ah->ani, 0, sizeof(ah->ani));
for (i = 0; i < ARRAY_SIZE(ah->ani); i++) { for (i = 0; i < ARRAY_SIZE(ah->ani); i++) {
...@@ -786,10 +786,10 @@ void ath9k_hw_ani_init(struct ath_hw *ah) ...@@ -786,10 +786,10 @@ void ath9k_hw_ani_init(struct ath_hw *ah)
AR_PHY_COUNTMAX - ATH9K_ANI_CCK_TRIG_HIGH; AR_PHY_COUNTMAX - ATH9K_ANI_CCK_TRIG_HIGH;
} }
DPRINTF(ah->ah_sc, ATH_DBG_ANI, DPRINTF(ah, ATH_DBG_ANI,
"Setting OfdmErrBase = 0x%08x\n", "Setting OfdmErrBase = 0x%08x\n",
ah->ani[0].ofdmPhyErrBase); ah->ani[0].ofdmPhyErrBase);
DPRINTF(ah->ah_sc, ATH_DBG_ANI, "Setting cckErrBase = 0x%08x\n", DPRINTF(ah, ATH_DBG_ANI, "Setting cckErrBase = 0x%08x\n",
ah->ani[0].cckPhyErrBase); ah->ani[0].cckPhyErrBase);
REG_WRITE(ah, AR_PHY_ERR_1, ah->ani[0].ofdmPhyErrBase); REG_WRITE(ah, AR_PHY_ERR_1, ah->ani[0].ofdmPhyErrBase);
...@@ -803,7 +803,7 @@ void ath9k_hw_ani_init(struct ath_hw *ah) ...@@ -803,7 +803,7 @@ void ath9k_hw_ani_init(struct ath_hw *ah)
void ath9k_hw_ani_disable(struct ath_hw *ah) void ath9k_hw_ani_disable(struct ath_hw *ah)
{ {
DPRINTF(ah->ah_sc, ATH_DBG_ANI, "Disabling ANI\n"); DPRINTF(ah, ATH_DBG_ANI, "Disabling ANI\n");
ath9k_hw_disable_mib_counters(ah); ath9k_hw_disable_mib_counters(ah);
REG_WRITE(ah, AR_PHY_ERR_1, 0); REG_WRITE(ah, AR_PHY_ERR_1, 0);
......
...@@ -42,7 +42,7 @@ static int ath_beaconq_config(struct ath_softc *sc) ...@@ -42,7 +42,7 @@ static int ath_beaconq_config(struct ath_softc *sc)
} }
if (!ath9k_hw_set_txq_props(ah, sc->beacon.beaconq, &qi)) { if (!ath9k_hw_set_txq_props(ah, sc->beacon.beaconq, &qi)) {
DPRINTF(sc, ATH_DBG_FATAL, DPRINTF(ah, ATH_DBG_FATAL,
"Unable to update h/w beacon queue parameters\n"); "Unable to update h/w beacon queue parameters\n");
return 0; return 0;
} else { } else {
...@@ -172,7 +172,7 @@ static struct ath_buf *ath_beacon_generate(struct ieee80211_hw *hw, ...@@ -172,7 +172,7 @@ static struct ath_buf *ath_beacon_generate(struct ieee80211_hw *hw,
if (unlikely(dma_mapping_error(sc->dev, bf->bf_buf_addr))) { if (unlikely(dma_mapping_error(sc->dev, bf->bf_buf_addr))) {
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
bf->bf_mpdu = NULL; bf->bf_mpdu = NULL;
DPRINTF(sc, ATH_DBG_FATAL, "dma_mapping_error on beaconing\n"); DPRINTF(sc->sc_ah, ATH_DBG_FATAL, "dma_mapping_error on beaconing\n");
return NULL; return NULL;
} }
...@@ -192,7 +192,7 @@ static struct ath_buf *ath_beacon_generate(struct ieee80211_hw *hw, ...@@ -192,7 +192,7 @@ static struct ath_buf *ath_beacon_generate(struct ieee80211_hw *hw,
if (skb && cabq_depth) { if (skb && cabq_depth) {
if (sc->nvifs > 1) { if (sc->nvifs > 1) {
DPRINTF(sc, ATH_DBG_BEACON, DPRINTF(sc->sc_ah, ATH_DBG_BEACON,
"Flushing previous cabq traffic\n"); "Flushing previous cabq traffic\n");
ath_draintxq(sc, cabq, false); ath_draintxq(sc, cabq, false);
} }
...@@ -233,7 +233,7 @@ static void ath_beacon_start_adhoc(struct ath_softc *sc, ...@@ -233,7 +233,7 @@ static void ath_beacon_start_adhoc(struct ath_softc *sc,
/* NB: caller is known to have already stopped tx dma */ /* NB: caller is known to have already stopped tx dma */
ath9k_hw_puttxbuf(ah, sc->beacon.beaconq, bf->bf_daddr); ath9k_hw_puttxbuf(ah, sc->beacon.beaconq, bf->bf_daddr);
ath9k_hw_txstart(ah, sc->beacon.beaconq); ath9k_hw_txstart(ah, sc->beacon.beaconq);
DPRINTF(sc, ATH_DBG_BEACON, "TXDP%u = %llx (%p)\n", DPRINTF(ah, ATH_DBG_BEACON, "TXDP%u = %llx (%p)\n",
sc->beacon.beaconq, ito64(bf->bf_daddr), bf->bf_desc); sc->beacon.beaconq, ito64(bf->bf_daddr), bf->bf_desc);
} }
...@@ -309,7 +309,7 @@ int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif) ...@@ -309,7 +309,7 @@ int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif)
/* NB: the beacon data buffer must be 32-bit aligned. */ /* NB: the beacon data buffer must be 32-bit aligned. */
skb = ieee80211_beacon_get(sc->hw, vif); skb = ieee80211_beacon_get(sc->hw, vif);
if (skb == NULL) { if (skb == NULL) {
DPRINTF(sc, ATH_DBG_BEACON, "cannot get skb\n"); DPRINTF(sc->sc_ah, ATH_DBG_BEACON, "cannot get skb\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -333,7 +333,7 @@ int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif) ...@@ -333,7 +333,7 @@ int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif)
tsfadjust = intval * avp->av_bslot / ATH_BCBUF; tsfadjust = intval * avp->av_bslot / ATH_BCBUF;
avp->tsf_adjust = cpu_to_le64(TU_TO_USEC(tsfadjust)); avp->tsf_adjust = cpu_to_le64(TU_TO_USEC(tsfadjust));
DPRINTF(sc, ATH_DBG_BEACON, DPRINTF(sc->sc_ah, ATH_DBG_BEACON,
"stagger beacons, bslot %d intval %u tsfadjust %llu\n", "stagger beacons, bslot %d intval %u tsfadjust %llu\n",
avp->av_bslot, intval, (unsigned long long)tsfadjust); avp->av_bslot, intval, (unsigned long long)tsfadjust);
...@@ -349,7 +349,7 @@ int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif) ...@@ -349,7 +349,7 @@ int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif)
if (unlikely(dma_mapping_error(sc->dev, bf->bf_buf_addr))) { if (unlikely(dma_mapping_error(sc->dev, bf->bf_buf_addr))) {
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
bf->bf_mpdu = NULL; bf->bf_mpdu = NULL;
DPRINTF(sc, ATH_DBG_FATAL, DPRINTF(sc->sc_ah, ATH_DBG_FATAL,
"dma_mapping_error on beacon alloc\n"); "dma_mapping_error on beacon alloc\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -405,11 +405,11 @@ void ath_beacon_tasklet(unsigned long data) ...@@ -405,11 +405,11 @@ void ath_beacon_tasklet(unsigned long data)
sc->beacon.bmisscnt++; sc->beacon.bmisscnt++;
if (sc->beacon.bmisscnt < BSTUCK_THRESH) { if (sc->beacon.bmisscnt < BSTUCK_THRESH) {
DPRINTF(sc, ATH_DBG_BEACON, DPRINTF(sc->sc_ah, ATH_DBG_BEACON,
"missed %u consecutive beacons\n", "missed %u consecutive beacons\n",
sc->beacon.bmisscnt); sc->beacon.bmisscnt);
} else if (sc->beacon.bmisscnt >= BSTUCK_THRESH) { } else if (sc->beacon.bmisscnt >= BSTUCK_THRESH) {
DPRINTF(sc, ATH_DBG_BEACON, DPRINTF(sc->sc_ah, ATH_DBG_BEACON,
"beacon is officially stuck\n"); "beacon is officially stuck\n");
sc->sc_flags |= SC_OP_TSF_RESET; sc->sc_flags |= SC_OP_TSF_RESET;
ath_reset(sc, false); ath_reset(sc, false);
...@@ -419,7 +419,7 @@ void ath_beacon_tasklet(unsigned long data) ...@@ -419,7 +419,7 @@ void ath_beacon_tasklet(unsigned long data)
} }
if (sc->beacon.bmisscnt != 0) { if (sc->beacon.bmisscnt != 0) {
DPRINTF(sc, ATH_DBG_BEACON, DPRINTF(sc->sc_ah, ATH_DBG_BEACON,
"resume beacon xmit after %u misses\n", "resume beacon xmit after %u misses\n",
sc->beacon.bmisscnt); sc->beacon.bmisscnt);
sc->beacon.bmisscnt = 0; sc->beacon.bmisscnt = 0;
...@@ -447,7 +447,7 @@ void ath_beacon_tasklet(unsigned long data) ...@@ -447,7 +447,7 @@ void ath_beacon_tasklet(unsigned long data)
vif = sc->beacon.bslot[slot]; vif = sc->beacon.bslot[slot];
aphy = sc->beacon.bslot_aphy[slot]; aphy = sc->beacon.bslot_aphy[slot];
DPRINTF(sc, ATH_DBG_BEACON, DPRINTF(sc->sc_ah, ATH_DBG_BEACON,
"slot %d [tsf %llu tsftu %u intval %u] vif %p\n", "slot %d [tsf %llu tsftu %u intval %u] vif %p\n",
slot, tsf, tsftu, intval, vif); slot, tsf, tsftu, intval, vif);
...@@ -490,7 +490,7 @@ void ath_beacon_tasklet(unsigned long data) ...@@ -490,7 +490,7 @@ void ath_beacon_tasklet(unsigned long data)
* are still pending on the queue. * are still pending on the queue.
*/ */
if (!ath9k_hw_stoptxdma(ah, sc->beacon.beaconq)) { if (!ath9k_hw_stoptxdma(ah, sc->beacon.beaconq)) {
DPRINTF(sc, ATH_DBG_FATAL, DPRINTF(sc->sc_ah, ATH_DBG_FATAL,
"beacon queue %u did not stop?\n", sc->beacon.beaconq); "beacon queue %u did not stop?\n", sc->beacon.beaconq);
} }
...@@ -651,8 +651,8 @@ static void ath_beacon_config_sta(struct ath_softc *sc, ...@@ -651,8 +651,8 @@ static void ath_beacon_config_sta(struct ath_softc *sc,
/* TSF out of range threshold fixed at 1 second */ /* TSF out of range threshold fixed at 1 second */
bs.bs_tsfoor_threshold = ATH9K_TSFOOR_THRESHOLD; bs.bs_tsfoor_threshold = ATH9K_TSFOOR_THRESHOLD;
DPRINTF(sc, ATH_DBG_BEACON, "tsf: %llu tsftu: %u\n", tsf, tsftu); DPRINTF(sc->sc_ah, ATH_DBG_BEACON, "tsf: %llu tsftu: %u\n", tsf, tsftu);
DPRINTF(sc, ATH_DBG_BEACON, DPRINTF(sc->sc_ah, ATH_DBG_BEACON,
"bmiss: %u sleep: %u cfp-period: %u maxdur: %u next: %u\n", "bmiss: %u sleep: %u cfp-period: %u maxdur: %u next: %u\n",
bs.bs_bmissthreshold, bs.bs_sleepduration, bs.bs_bmissthreshold, bs.bs_sleepduration,
bs.bs_cfpperiod, bs.bs_cfpmaxduration, bs.bs_cfpnext); bs.bs_cfpperiod, bs.bs_cfpmaxduration, bs.bs_cfpnext);
...@@ -689,7 +689,7 @@ static void ath_beacon_config_adhoc(struct ath_softc *sc, ...@@ -689,7 +689,7 @@ static void ath_beacon_config_adhoc(struct ath_softc *sc,
nexttbtt += intval; nexttbtt += intval;
} while (nexttbtt < tsftu); } while (nexttbtt < tsftu);
DPRINTF(sc, ATH_DBG_BEACON, DPRINTF(sc->sc_ah, ATH_DBG_BEACON,
"IBSS nexttbtt %u intval %u (%u)\n", "IBSS nexttbtt %u intval %u (%u)\n",
nexttbtt, intval, conf->beacon_interval); nexttbtt, intval, conf->beacon_interval);
...@@ -759,7 +759,7 @@ void ath_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif) ...@@ -759,7 +759,7 @@ void ath_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif)
ath_beacon_config_sta(sc, cur_conf); ath_beacon_config_sta(sc, cur_conf);
break; break;
default: default:
DPRINTF(sc, ATH_DBG_CONFIG, DPRINTF(sc->sc_ah, ATH_DBG_CONFIG,
"Unsupported beaconing mode\n"); "Unsupported beaconing mode\n");
return; return;
} }
......
...@@ -56,7 +56,7 @@ static void ath_detect_bt_priority(struct ath_softc *sc) ...@@ -56,7 +56,7 @@ static void ath_detect_bt_priority(struct ath_softc *sc)
if (time_after(jiffies, btinfo->bt_priority_time + if (time_after(jiffies, btinfo->bt_priority_time +
msecs_to_jiffies(ATH_BT_PRIORITY_TIME_THRESHOLD))) { msecs_to_jiffies(ATH_BT_PRIORITY_TIME_THRESHOLD))) {
if (btinfo->bt_priority_cnt >= ATH_BT_CNT_THRESHOLD) { if (btinfo->bt_priority_cnt >= ATH_BT_CNT_THRESHOLD) {
DPRINTF(sc, ATH_DBG_BTCOEX, DPRINTF(sc->sc_ah, ATH_DBG_BTCOEX,
"BT priority traffic detected"); "BT priority traffic detected");
sc->sc_flags |= SC_OP_BT_PRIORITY_DETECTED; sc->sc_flags |= SC_OP_BT_PRIORITY_DETECTED;
} else { } else {
...@@ -90,7 +90,7 @@ static void ath_btcoex_bt_stomp(struct ath_softc *sc, ...@@ -90,7 +90,7 @@ static void ath_btcoex_bt_stomp(struct ath_softc *sc,
AR_STOMP_NONE_WLAN_WGHT); AR_STOMP_NONE_WLAN_WGHT);
break; break;
default: default:
DPRINTF(sc, ATH_DBG_BTCOEX, "Invalid Stomptype\n"); DPRINTF(sc->sc_ah, ATH_DBG_BTCOEX, "Invalid Stomptype\n");
break; break;
} }
...@@ -142,7 +142,7 @@ static void ath_btcoex_no_stomp_timer(void *arg) ...@@ -142,7 +142,7 @@ static void ath_btcoex_no_stomp_timer(void *arg)
struct ath_softc *sc = (struct ath_softc *)arg; struct ath_softc *sc = (struct ath_softc *)arg;
struct ath_btcoex_info *btinfo = &sc->btcoex_info; struct ath_btcoex_info *btinfo = &sc->btcoex_info;
DPRINTF(sc, ATH_DBG_BTCOEX, "no stomp timer running \n"); DPRINTF(sc->sc_ah, ATH_DBG_BTCOEX, "no stomp timer running \n");
spin_lock_bh(&btinfo->btcoex_lock); spin_lock_bh(&btinfo->btcoex_lock);
...@@ -326,7 +326,7 @@ void ath_btcoex_timer_resume(struct ath_softc *sc, ...@@ -326,7 +326,7 @@ void ath_btcoex_timer_resume(struct ath_softc *sc,
struct ath_btcoex_info *btinfo) struct ath_btcoex_info *btinfo)
{ {
DPRINTF(sc, ATH_DBG_BTCOEX, "Starting btcoex timers"); DPRINTF(sc->sc_ah, ATH_DBG_BTCOEX, "Starting btcoex timers");
/* make sure duty cycle timer is also stopped when resuming */ /* make sure duty cycle timer is also stopped when resuming */
if (btinfo->hw_timer_enabled) if (btinfo->hw_timer_enabled)
......
This diff is collapsed.
...@@ -23,12 +23,12 @@ module_param_named(debug, ath9k_debug, uint, 0); ...@@ -23,12 +23,12 @@ module_param_named(debug, ath9k_debug, uint, 0);
static struct dentry *ath9k_debugfs_root; static struct dentry *ath9k_debugfs_root;
void DPRINTF(struct ath_softc *sc, int dbg_mask, const char *fmt, ...) void DPRINTF(struct ath_hw *ah, int dbg_mask, const char *fmt, ...)
{ {
if (!sc) if (!ah->ah_sc)
return; return;
if (sc->debug.debug_mask & dbg_mask) { if (ah->ah_sc->debug.debug_mask & dbg_mask) {
va_list args; va_list args;
va_start(args, fmt); va_start(args, fmt);
...@@ -568,8 +568,10 @@ static const struct file_operations fops_xmit = { ...@@ -568,8 +568,10 @@ static const struct file_operations fops_xmit = {
.owner = THIS_MODULE .owner = THIS_MODULE
}; };
int ath9k_init_debug(struct ath_softc *sc) int ath9k_init_debug(struct ath_hw *ah)
{ {
struct ath_softc *sc = ah->ah_sc;
sc->debug.debug_mask = ath9k_debug; sc->debug.debug_mask = ath9k_debug;
if (!ath9k_debugfs_root) if (!ath9k_debugfs_root)
...@@ -619,12 +621,14 @@ int ath9k_init_debug(struct ath_softc *sc) ...@@ -619,12 +621,14 @@ int ath9k_init_debug(struct ath_softc *sc)
return 0; return 0;
err: err:
ath9k_exit_debug(sc); ath9k_exit_debug(ah);
return -ENOMEM; return -ENOMEM;
} }
void ath9k_exit_debug(struct ath_softc *sc) void ath9k_exit_debug(struct ath_hw *ah)
{ {
struct ath_softc *sc = ah->ah_sc;
debugfs_remove(sc->debug.debugfs_xmit); debugfs_remove(sc->debug.debugfs_xmit);
debugfs_remove(sc->debug.debugfs_wiphy); debugfs_remove(sc->debug.debugfs_wiphy);
debugfs_remove(sc->debug.debugfs_rcstat); debugfs_remove(sc->debug.debugfs_rcstat);
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
#ifndef DEBUG_H #ifndef DEBUG_H
#define DEBUG_H #define DEBUG_H
#include "hw.h"
enum ATH_DEBUG { enum ATH_DEBUG {
ATH_DBG_RESET = 0x00000001, ATH_DBG_RESET = 0x00000001,
ATH_DBG_QUEUE = 0x00000002, ATH_DBG_QUEUE = 0x00000002,
...@@ -151,9 +153,10 @@ struct ath9k_debug { ...@@ -151,9 +153,10 @@ struct ath9k_debug {
struct ath_stats stats; struct ath_stats stats;
}; };
void DPRINTF(struct ath_softc *sc, int dbg_mask, const char *fmt, ...); void DPRINTF(struct ath_hw *ah, int dbg_mask, const char *fmt, ...);
int ath9k_init_debug(struct ath_softc *sc); int ath9k_init_debug(struct ath_hw *ah);
void ath9k_exit_debug(struct ath_softc *sc); void ath9k_exit_debug(struct ath_hw *ah);
int ath9k_debug_create_root(void); int ath9k_debug_create_root(void);
void ath9k_debug_remove_root(void); void ath9k_debug_remove_root(void);
void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status); void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status);
...@@ -165,17 +168,17 @@ void ath_debug_stat_retries(struct ath_softc *sc, int rix, ...@@ -165,17 +168,17 @@ void ath_debug_stat_retries(struct ath_softc *sc, int rix,
#else #else
static inline void DPRINTF(struct ath_softc *sc, int dbg_mask, static inline void DPRINTF(struct ath_hw *ah, int dbg_mask,
const char *fmt, ...) const char *fmt, ...)
{ {
} }
static inline int ath9k_init_debug(struct ath_softc *sc) static inline int ath9k_init_debug(struct ath_hw *ah)
{ {
return 0; return 0;
} }
static inline void ath9k_exit_debug(struct ath_softc *sc) static inline void ath9k_exit_debug(struct ath_hw *ah)
{ {
} }
......
...@@ -35,13 +35,13 @@ static bool ath9k_hw_4k_fill_eeprom(struct ath_hw *ah) ...@@ -35,13 +35,13 @@ static bool ath9k_hw_4k_fill_eeprom(struct ath_hw *ah)
eep_start_loc = 64; eep_start_loc = 64;
if (!ath9k_hw_use_flash(ah)) { if (!ath9k_hw_use_flash(ah)) {
DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, DPRINTF(ah, ATH_DBG_EEPROM,
"Reading from EEPROM, not flash\n"); "Reading from EEPROM, not flash\n");
} }
for (addr = 0; addr < SIZE_EEPROM_4K; addr++) { for (addr = 0; addr < SIZE_EEPROM_4K; addr++) {
if (!ath9k_hw_nvram_read(ah, addr + eep_start_loc, eep_data)) { if (!ath9k_hw_nvram_read(ah, addr + eep_start_loc, eep_data)) {
DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, DPRINTF(ah, ATH_DBG_EEPROM,
"Unable to read eeprom region \n"); "Unable to read eeprom region \n");
return false; return false;
} }
...@@ -66,12 +66,12 @@ static int ath9k_hw_4k_check_eeprom(struct ath_hw *ah) ...@@ -66,12 +66,12 @@ static int ath9k_hw_4k_check_eeprom(struct ath_hw *ah)
if (!ath9k_hw_use_flash(ah)) { if (!ath9k_hw_use_flash(ah)) {
if (!ath9k_hw_nvram_read(ah, AR5416_EEPROM_MAGIC_OFFSET, if (!ath9k_hw_nvram_read(ah, AR5416_EEPROM_MAGIC_OFFSET,
&magic)) { &magic)) {
DPRINTF(ah->ah_sc, ATH_DBG_FATAL, DPRINTF(ah, ATH_DBG_FATAL,
"Reading Magic # failed\n"); "Reading Magic # failed\n");
return false; return false;
} }
DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, DPRINTF(ah, ATH_DBG_EEPROM,
"Read Magic = 0x%04X\n", magic); "Read Magic = 0x%04X\n", magic);
if (magic != AR5416_EEPROM_MAGIC) { if (magic != AR5416_EEPROM_MAGIC) {
...@@ -87,7 +87,7 @@ static int ath9k_hw_4k_check_eeprom(struct ath_hw *ah) ...@@ -87,7 +87,7 @@ static int ath9k_hw_4k_check_eeprom(struct ath_hw *ah)
eepdata++; eepdata++;
} }
} else { } else {
DPRINTF(ah->ah_sc, ATH_DBG_FATAL, DPRINTF(ah, ATH_DBG_FATAL,
"Invalid EEPROM Magic. " "Invalid EEPROM Magic. "
"endianness mismatch.\n"); "endianness mismatch.\n");
return -EINVAL; return -EINVAL;
...@@ -95,7 +95,7 @@ static int ath9k_hw_4k_check_eeprom(struct ath_hw *ah) ...@@ -95,7 +95,7 @@ static int ath9k_hw_4k_check_eeprom(struct ath_hw *ah)
} }
} }
DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, "need_swap = %s.\n", DPRINTF(ah, ATH_DBG_EEPROM, "need_swap = %s.\n",
need_swap ? "True" : "False"); need_swap ? "True" : "False");
if (need_swap) if (need_swap)
...@@ -117,7 +117,7 @@ static int ath9k_hw_4k_check_eeprom(struct ath_hw *ah) ...@@ -117,7 +117,7 @@ static int ath9k_hw_4k_check_eeprom(struct ath_hw *ah)
u32 integer; u32 integer;
u16 word; u16 word;
DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, DPRINTF(ah, ATH_DBG_EEPROM,
"EEPROM Endianness is not native.. Changing\n"); "EEPROM Endianness is not native.. Changing\n");
word = swab16(eep->baseEepHeader.length); word = swab16(eep->baseEepHeader.length);
...@@ -160,7 +160,7 @@ static int ath9k_hw_4k_check_eeprom(struct ath_hw *ah) ...@@ -160,7 +160,7 @@ static int ath9k_hw_4k_check_eeprom(struct ath_hw *ah)
if (sum != 0xffff || ah->eep_ops->get_eeprom_ver(ah) != AR5416_EEP_VER || if (sum != 0xffff || ah->eep_ops->get_eeprom_ver(ah) != AR5416_EEP_VER ||
ah->eep_ops->get_eeprom_rev(ah) < AR5416_EEP_NO_BACK_VER) { ah->eep_ops->get_eeprom_rev(ah) < AR5416_EEP_NO_BACK_VER) {
DPRINTF(ah->ah_sc, ATH_DBG_FATAL, DPRINTF(ah, ATH_DBG_FATAL,
"Bad EEPROM checksum 0x%x or revision 0x%04x\n", "Bad EEPROM checksum 0x%x or revision 0x%04x\n",
sum, ah->eep_ops->get_eeprom_ver(ah)); sum, ah->eep_ops->get_eeprom_ver(ah));
return -EINVAL; return -EINVAL;
...@@ -470,11 +470,11 @@ static void ath9k_hw_set_4k_power_cal_table(struct ath_hw *ah, ...@@ -470,11 +470,11 @@ static void ath9k_hw_set_4k_power_cal_table(struct ath_hw *ah,
((pdadcValues[4 * j + 3] & 0xFF) << 24); ((pdadcValues[4 * j + 3] & 0xFF) << 24);
REG_WRITE(ah, regOffset, reg32); REG_WRITE(ah, regOffset, reg32);
DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, DPRINTF(ah, ATH_DBG_EEPROM,
"PDADC (%d,%4x): %4.4x %8.8x\n", "PDADC (%d,%4x): %4.4x %8.8x\n",
i, regChainOffset, regOffset, i, regChainOffset, regOffset,
reg32); reg32);
DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, DPRINTF(ah, ATH_DBG_EEPROM,
"PDADC: Chain %d | " "PDADC: Chain %d | "
"PDADC %3d Value %3d | " "PDADC %3d Value %3d | "
"PDADC %3d Value %3d | " "PDADC %3d Value %3d | "
...@@ -1151,7 +1151,7 @@ static u16 ath9k_hw_4k_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz) ...@@ -1151,7 +1151,7 @@ static u16 ath9k_hw_4k_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz)
u16 spur_val = AR_NO_SPUR; u16 spur_val = AR_NO_SPUR;
DPRINTF(ah->ah_sc, ATH_DBG_ANI, DPRINTF(ah, ATH_DBG_ANI,
"Getting spur idx %d is2Ghz. %d val %x\n", "Getting spur idx %d is2Ghz. %d val %x\n",
i, is2GHz, ah->config.spurchans[i][is2GHz]); i, is2GHz, ah->config.spurchans[i][is2GHz]);
...@@ -1160,7 +1160,7 @@ static u16 ath9k_hw_4k_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz) ...@@ -1160,7 +1160,7 @@ static u16 ath9k_hw_4k_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz)
break; break;
case SPUR_ENABLE_IOCTL: case SPUR_ENABLE_IOCTL:
spur_val = ah->config.spurchans[i][is2GHz]; spur_val = ah->config.spurchans[i][is2GHz];
DPRINTF(ah->ah_sc, ATH_DBG_ANI, DPRINTF(ah, ATH_DBG_ANI,
"Getting spur val from new loc. %d\n", spur_val); "Getting spur val from new loc. %d\n", spur_val);
break; break;
case SPUR_ENABLE_EEPROM: case SPUR_ENABLE_EEPROM:
......
...@@ -34,14 +34,14 @@ static bool ath9k_hw_AR9287_fill_eeprom(struct ath_hw *ah) ...@@ -34,14 +34,14 @@ static bool ath9k_hw_AR9287_fill_eeprom(struct ath_hw *ah)
eep_data = (u16 *)eep; eep_data = (u16 *)eep;
if (!ath9k_hw_use_flash(ah)) { if (!ath9k_hw_use_flash(ah)) {
DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, DPRINTF(ah, ATH_DBG_EEPROM,
"Reading from EEPROM, not flash\n"); "Reading from EEPROM, not flash\n");
} }
for (addr = 0; addr < sizeof(struct ar9287_eeprom) / sizeof(u16); for (addr = 0; addr < sizeof(struct ar9287_eeprom) / sizeof(u16);
addr++) { addr++) {
if (!ath9k_hw_nvram_read(ah, addr + eep_start_loc, eep_data)) { if (!ath9k_hw_nvram_read(ah, addr + eep_start_loc, eep_data)) {
DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, DPRINTF(ah, ATH_DBG_EEPROM,
"Unable to read eeprom region \n"); "Unable to read eeprom region \n");
return false; return false;
} }
...@@ -61,12 +61,12 @@ static int ath9k_hw_AR9287_check_eeprom(struct ath_hw *ah) ...@@ -61,12 +61,12 @@ static int ath9k_hw_AR9287_check_eeprom(struct ath_hw *ah)
if (!ath9k_hw_use_flash(ah)) { if (!ath9k_hw_use_flash(ah)) {
if (!ath9k_hw_nvram_read if (!ath9k_hw_nvram_read
(ah, AR5416_EEPROM_MAGIC_OFFSET, &magic)) { (ah, AR5416_EEPROM_MAGIC_OFFSET, &magic)) {
DPRINTF(ah->ah_sc, ATH_DBG_FATAL, DPRINTF(ah, ATH_DBG_FATAL,
"Reading Magic # failed\n"); "Reading Magic # failed\n");
return false; return false;
} }
DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, DPRINTF(ah, ATH_DBG_EEPROM,
"Read Magic = 0x%04X\n", magic); "Read Magic = 0x%04X\n", magic);
if (magic != AR5416_EEPROM_MAGIC) { if (magic != AR5416_EEPROM_MAGIC) {
magic2 = swab16(magic); magic2 = swab16(magic);
...@@ -83,14 +83,14 @@ static int ath9k_hw_AR9287_check_eeprom(struct ath_hw *ah) ...@@ -83,14 +83,14 @@ static int ath9k_hw_AR9287_check_eeprom(struct ath_hw *ah)
eepdata++; eepdata++;
} }
} else { } else {
DPRINTF(ah->ah_sc, ATH_DBG_FATAL, DPRINTF(ah, ATH_DBG_FATAL,
"Invalid EEPROM Magic. " "Invalid EEPROM Magic. "
"endianness mismatch.\n"); "endianness mismatch.\n");
return -EINVAL; return -EINVAL;
} }
} }
} }
DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, "need_swap = %s.\n", need_swap ? DPRINTF(ah, ATH_DBG_EEPROM, "need_swap = %s.\n", need_swap ?
"True" : "False"); "True" : "False");
if (need_swap) if (need_swap)
...@@ -148,7 +148,7 @@ static int ath9k_hw_AR9287_check_eeprom(struct ath_hw *ah) ...@@ -148,7 +148,7 @@ static int ath9k_hw_AR9287_check_eeprom(struct ath_hw *ah)
if (sum != 0xffff || ah->eep_ops->get_eeprom_ver(ah) != AR9287_EEP_VER if (sum != 0xffff || ah->eep_ops->get_eeprom_ver(ah) != AR9287_EEP_VER
|| ah->eep_ops->get_eeprom_rev(ah) < AR5416_EEP_NO_BACK_VER) { || ah->eep_ops->get_eeprom_rev(ah) < AR5416_EEP_NO_BACK_VER) {
DPRINTF(ah->ah_sc, ATH_DBG_FATAL, DPRINTF(ah, ATH_DBG_FATAL,
"Bad EEPROM checksum 0x%x or revision 0x%04x\n", "Bad EEPROM checksum 0x%x or revision 0x%04x\n",
sum, ah->eep_ops->get_eeprom_ver(ah)); sum, ah->eep_ops->get_eeprom_ver(ah));
return -EINVAL; return -EINVAL;
...@@ -564,12 +564,12 @@ static void ath9k_hw_set_AR9287_power_cal_table(struct ath_hw *ah, ...@@ -564,12 +564,12 @@ static void ath9k_hw_set_AR9287_power_cal_table(struct ath_hw *ah,
& 0xFF) << 24) ; & 0xFF) << 24) ;
REG_WRITE(ah, regOffset, reg32); REG_WRITE(ah, regOffset, reg32);
DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, DPRINTF(ah, ATH_DBG_EEPROM,
"PDADC (%d,%4x): %4.4x %8.8x\n", "PDADC (%d,%4x): %4.4x %8.8x\n",
i, regChainOffset, regOffset, i, regChainOffset, regOffset,
reg32); reg32);
DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, DPRINTF(ah, ATH_DBG_EEPROM,
"PDADC: Chain %d | " "PDADC: Chain %d | "
"PDADC %3d Value %3d | " "PDADC %3d Value %3d | "
"PDADC %3d Value %3d | " "PDADC %3d Value %3d | "
...@@ -966,7 +966,7 @@ static void ath9k_hw_AR9287_set_txpower(struct ath_hw *ah, ...@@ -966,7 +966,7 @@ static void ath9k_hw_AR9287_set_txpower(struct ath_hw *ah,
INCREASE_MAXPOW_BY_THREE_CHAIN; INCREASE_MAXPOW_BY_THREE_CHAIN;
break; break;
default: default:
DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, DPRINTF(ah, ATH_DBG_EEPROM,
"Invalid chainmask configuration\n"); "Invalid chainmask configuration\n");
break; break;
} }
...@@ -1140,7 +1140,7 @@ static u16 ath9k_hw_AR9287_get_spur_channel(struct ath_hw *ah, ...@@ -1140,7 +1140,7 @@ static u16 ath9k_hw_AR9287_get_spur_channel(struct ath_hw *ah,
(ah->eeprom.map9287.modalHeader.spurChans[i].spurChan) (ah->eeprom.map9287.modalHeader.spurChans[i].spurChan)
u16 spur_val = AR_NO_SPUR; u16 spur_val = AR_NO_SPUR;
DPRINTF(ah->ah_sc, ATH_DBG_ANI, DPRINTF(ah, ATH_DBG_ANI,
"Getting spur idx %d is2Ghz. %d val %x\n", "Getting spur idx %d is2Ghz. %d val %x\n",
i, is2GHz, ah->config.spurchans[i][is2GHz]); i, is2GHz, ah->config.spurchans[i][is2GHz]);
...@@ -1149,7 +1149,7 @@ static u16 ath9k_hw_AR9287_get_spur_channel(struct ath_hw *ah, ...@@ -1149,7 +1149,7 @@ static u16 ath9k_hw_AR9287_get_spur_channel(struct ath_hw *ah,
break; break;
case SPUR_ENABLE_IOCTL: case SPUR_ENABLE_IOCTL:
spur_val = ah->config.spurchans[i][is2GHz]; spur_val = ah->config.spurchans[i][is2GHz];
DPRINTF(ah->ah_sc, ATH_DBG_ANI, DPRINTF(ah, ATH_DBG_ANI,
"Getting spur val from new loc. %d\n", spur_val); "Getting spur val from new loc. %d\n", spur_val);
break; break;
case SPUR_ENABLE_EEPROM: case SPUR_ENABLE_EEPROM:
......
...@@ -95,7 +95,7 @@ static bool ath9k_hw_def_fill_eeprom(struct ath_hw *ah) ...@@ -95,7 +95,7 @@ static bool ath9k_hw_def_fill_eeprom(struct ath_hw *ah)
for (addr = 0; addr < SIZE_EEPROM_DEF; addr++) { for (addr = 0; addr < SIZE_EEPROM_DEF; addr++) {
if (!ath9k_hw_nvram_read(ah, addr + ar5416_eep_start_loc, if (!ath9k_hw_nvram_read(ah, addr + ar5416_eep_start_loc,
eep_data)) { eep_data)) {
DPRINTF(ah->ah_sc, ATH_DBG_FATAL, DPRINTF(ah, ATH_DBG_FATAL,
"Unable to read eeprom region\n"); "Unable to read eeprom region\n");
return false; return false;
} }
...@@ -115,12 +115,12 @@ static int ath9k_hw_def_check_eeprom(struct ath_hw *ah) ...@@ -115,12 +115,12 @@ static int ath9k_hw_def_check_eeprom(struct ath_hw *ah)
int i, addr, size; int i, addr, size;
if (!ath9k_hw_nvram_read(ah, AR5416_EEPROM_MAGIC_OFFSET, &magic)) { if (!ath9k_hw_nvram_read(ah, AR5416_EEPROM_MAGIC_OFFSET, &magic)) {
DPRINTF(ah->ah_sc, ATH_DBG_FATAL, "Reading Magic # failed\n"); DPRINTF(ah, ATH_DBG_FATAL, "Reading Magic # failed\n");
return false; return false;
} }
if (!ath9k_hw_use_flash(ah)) { if (!ath9k_hw_use_flash(ah)) {
DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, DPRINTF(ah, ATH_DBG_EEPROM,
"Read Magic = 0x%04X\n", magic); "Read Magic = 0x%04X\n", magic);
if (magic != AR5416_EEPROM_MAGIC) { if (magic != AR5416_EEPROM_MAGIC) {
...@@ -137,7 +137,7 @@ static int ath9k_hw_def_check_eeprom(struct ath_hw *ah) ...@@ -137,7 +137,7 @@ static int ath9k_hw_def_check_eeprom(struct ath_hw *ah)
eepdata++; eepdata++;
} }
} else { } else {
DPRINTF(ah->ah_sc, ATH_DBG_FATAL, DPRINTF(ah, ATH_DBG_FATAL,
"Invalid EEPROM Magic. " "Invalid EEPROM Magic. "
"Endianness mismatch.\n"); "Endianness mismatch.\n");
return -EINVAL; return -EINVAL;
...@@ -145,7 +145,7 @@ static int ath9k_hw_def_check_eeprom(struct ath_hw *ah) ...@@ -145,7 +145,7 @@ static int ath9k_hw_def_check_eeprom(struct ath_hw *ah)
} }
} }
DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, "need_swap = %s.\n", DPRINTF(ah, ATH_DBG_EEPROM, "need_swap = %s.\n",
need_swap ? "True" : "False"); need_swap ? "True" : "False");
if (need_swap) if (need_swap)
...@@ -167,7 +167,7 @@ static int ath9k_hw_def_check_eeprom(struct ath_hw *ah) ...@@ -167,7 +167,7 @@ static int ath9k_hw_def_check_eeprom(struct ath_hw *ah)
u32 integer, j; u32 integer, j;
u16 word; u16 word;
DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, DPRINTF(ah, ATH_DBG_EEPROM,
"EEPROM Endianness is not native.. Changing.\n"); "EEPROM Endianness is not native.. Changing.\n");
word = swab16(eep->baseEepHeader.length); word = swab16(eep->baseEepHeader.length);
...@@ -214,7 +214,7 @@ static int ath9k_hw_def_check_eeprom(struct ath_hw *ah) ...@@ -214,7 +214,7 @@ static int ath9k_hw_def_check_eeprom(struct ath_hw *ah)
if (sum != 0xffff || ah->eep_ops->get_eeprom_ver(ah) != AR5416_EEP_VER || if (sum != 0xffff || ah->eep_ops->get_eeprom_ver(ah) != AR5416_EEP_VER ||
ah->eep_ops->get_eeprom_rev(ah) < AR5416_EEP_NO_BACK_VER) { ah->eep_ops->get_eeprom_rev(ah) < AR5416_EEP_NO_BACK_VER) {
DPRINTF(ah->ah_sc, ATH_DBG_FATAL, DPRINTF(ah, ATH_DBG_FATAL,
"Bad EEPROM checksum 0x%x or revision 0x%04x\n", "Bad EEPROM checksum 0x%x or revision 0x%04x\n",
sum, ah->eep_ops->get_eeprom_ver(ah)); sum, ah->eep_ops->get_eeprom_ver(ah));
return -EINVAL; return -EINVAL;
...@@ -870,11 +870,11 @@ static void ath9k_hw_set_def_power_cal_table(struct ath_hw *ah, ...@@ -870,11 +870,11 @@ static void ath9k_hw_set_def_power_cal_table(struct ath_hw *ah,
((pdadcValues[4 * j + 3] & 0xFF) << 24); ((pdadcValues[4 * j + 3] & 0xFF) << 24);
REG_WRITE(ah, regOffset, reg32); REG_WRITE(ah, regOffset, reg32);
DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, DPRINTF(ah, ATH_DBG_EEPROM,
"PDADC (%d,%4x): %4.4x %8.8x\n", "PDADC (%d,%4x): %4.4x %8.8x\n",
i, regChainOffset, regOffset, i, regChainOffset, regOffset,
reg32); reg32);
DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, DPRINTF(ah, ATH_DBG_EEPROM,
"PDADC: Chain %d | PDADC %3d " "PDADC: Chain %d | PDADC %3d "
"Value %3d | PDADC %3d Value %3d | " "Value %3d | PDADC %3d Value %3d | "
"PDADC %3d Value %3d | PDADC %3d " "PDADC %3d Value %3d | PDADC %3d "
...@@ -1311,7 +1311,7 @@ static void ath9k_hw_def_set_txpower(struct ath_hw *ah, ...@@ -1311,7 +1311,7 @@ static void ath9k_hw_def_set_txpower(struct ath_hw *ah,
regulatory->max_power_level += INCREASE_MAXPOW_BY_THREE_CHAIN; regulatory->max_power_level += INCREASE_MAXPOW_BY_THREE_CHAIN;
break; break;
default: default:
DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, DPRINTF(ah, ATH_DBG_EEPROM,
"Invalid chainmask configuration\n"); "Invalid chainmask configuration\n");
break; break;
} }
...@@ -1352,7 +1352,7 @@ static u16 ath9k_hw_def_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz) ...@@ -1352,7 +1352,7 @@ static u16 ath9k_hw_def_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz)
u16 spur_val = AR_NO_SPUR; u16 spur_val = AR_NO_SPUR;
DPRINTF(ah->ah_sc, ATH_DBG_ANI, DPRINTF(ah, ATH_DBG_ANI,
"Getting spur idx %d is2Ghz. %d val %x\n", "Getting spur idx %d is2Ghz. %d val %x\n",
i, is2GHz, ah->config.spurchans[i][is2GHz]); i, is2GHz, ah->config.spurchans[i][is2GHz]);
...@@ -1361,7 +1361,7 @@ static u16 ath9k_hw_def_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz) ...@@ -1361,7 +1361,7 @@ static u16 ath9k_hw_def_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz)
break; break;
case SPUR_ENABLE_IOCTL: case SPUR_ENABLE_IOCTL:
spur_val = ah->config.spurchans[i][is2GHz]; spur_val = ah->config.spurchans[i][is2GHz];
DPRINTF(ah->ah_sc, ATH_DBG_ANI, DPRINTF(ah, ATH_DBG_ANI,
"Getting spur val from new loc. %d\n", spur_val); "Getting spur val from new loc. %d\n", spur_val);
break; break;
case SPUR_ENABLE_EEPROM: case SPUR_ENABLE_EEPROM:
......
This diff is collapsed.
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
static void ath9k_hw_set_txq_interrupts(struct ath_hw *ah, static void ath9k_hw_set_txq_interrupts(struct ath_hw *ah,
struct ath9k_tx_queue_info *qi) struct ath9k_tx_queue_info *qi)
{ {
DPRINTF(ah->ah_sc, ATH_DBG_INTERRUPT, DPRINTF(ah, ATH_DBG_INTERRUPT,
"tx ok 0x%x err 0x%x desc 0x%x eol 0x%x urn 0x%x\n", "tx ok 0x%x err 0x%x desc 0x%x eol 0x%x urn 0x%x\n",
ah->txok_interrupt_mask, ah->txerr_interrupt_mask, ah->txok_interrupt_mask, ah->txerr_interrupt_mask,
ah->txdesc_interrupt_mask, ah->txeol_interrupt_mask, ah->txdesc_interrupt_mask, ah->txeol_interrupt_mask,
...@@ -47,7 +47,7 @@ void ath9k_hw_puttxbuf(struct ath_hw *ah, u32 q, u32 txdp) ...@@ -47,7 +47,7 @@ void ath9k_hw_puttxbuf(struct ath_hw *ah, u32 q, u32 txdp)
void ath9k_hw_txstart(struct ath_hw *ah, u32 q) void ath9k_hw_txstart(struct ath_hw *ah, u32 q)
{ {
DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, "Enable TXE on queue: %u\n", q); DPRINTF(ah, ATH_DBG_QUEUE, "Enable TXE on queue: %u\n", q);
REG_WRITE(ah, AR_Q_TXE, 1 << q); REG_WRITE(ah, AR_Q_TXE, 1 << q);
} }
...@@ -105,14 +105,14 @@ bool ath9k_hw_stoptxdma(struct ath_hw *ah, u32 q) ...@@ -105,14 +105,14 @@ bool ath9k_hw_stoptxdma(struct ath_hw *ah, u32 q)
u32 wait_time = ATH9K_TX_STOP_DMA_TIMEOUT / ATH9K_TIME_QUANTUM; u32 wait_time = ATH9K_TX_STOP_DMA_TIMEOUT / ATH9K_TIME_QUANTUM;
if (q >= pCap->total_queues) { if (q >= pCap->total_queues) {
DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, "Stopping TX DMA, " DPRINTF(ah, ATH_DBG_QUEUE, "Stopping TX DMA, "
"invalid queue: %u\n", q); "invalid queue: %u\n", q);
return false; return false;
} }
qi = &ah->txq[q]; qi = &ah->txq[q];
if (qi->tqi_type == ATH9K_TX_QUEUE_INACTIVE) { if (qi->tqi_type == ATH9K_TX_QUEUE_INACTIVE) {
DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, "Stopping TX DMA, " DPRINTF(ah, ATH_DBG_QUEUE, "Stopping TX DMA, "
"inactive queue: %u\n", q); "inactive queue: %u\n", q);
return false; return false;
} }
...@@ -126,7 +126,7 @@ bool ath9k_hw_stoptxdma(struct ath_hw *ah, u32 q) ...@@ -126,7 +126,7 @@ bool ath9k_hw_stoptxdma(struct ath_hw *ah, u32 q)
} }
if (ath9k_hw_numtxpending(ah, q)) { if (ath9k_hw_numtxpending(ah, q)) {
DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, DPRINTF(ah, ATH_DBG_QUEUE,
"%s: Num of pending TX Frames %d on Q %d\n", "%s: Num of pending TX Frames %d on Q %d\n",
__func__, ath9k_hw_numtxpending(ah, q), q); __func__, ath9k_hw_numtxpending(ah, q), q);
...@@ -142,7 +142,7 @@ bool ath9k_hw_stoptxdma(struct ath_hw *ah, u32 q) ...@@ -142,7 +142,7 @@ bool ath9k_hw_stoptxdma(struct ath_hw *ah, u32 q)
if ((REG_READ(ah, AR_TSF_L32) >> 10) == (tsfLow >> 10)) if ((REG_READ(ah, AR_TSF_L32) >> 10) == (tsfLow >> 10))
break; break;
DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, DPRINTF(ah, ATH_DBG_QUEUE,
"TSF has moved while trying to set " "TSF has moved while trying to set "
"quiet time TSF: 0x%08x\n", tsfLow); "quiet time TSF: 0x%08x\n", tsfLow);
} }
...@@ -155,7 +155,7 @@ bool ath9k_hw_stoptxdma(struct ath_hw *ah, u32 q) ...@@ -155,7 +155,7 @@ bool ath9k_hw_stoptxdma(struct ath_hw *ah, u32 q)
wait = wait_time; wait = wait_time;
while (ath9k_hw_numtxpending(ah, q)) { while (ath9k_hw_numtxpending(ah, q)) {
if ((--wait) == 0) { if ((--wait) == 0) {
DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, DPRINTF(ah, ATH_DBG_QUEUE,
"Failed to stop TX DMA in 100 " "Failed to stop TX DMA in 100 "
"msec after killing last frame\n"); "msec after killing last frame\n");
break; break;
...@@ -449,19 +449,19 @@ bool ath9k_hw_set_txq_props(struct ath_hw *ah, int q, ...@@ -449,19 +449,19 @@ bool ath9k_hw_set_txq_props(struct ath_hw *ah, int q,
struct ath9k_tx_queue_info *qi; struct ath9k_tx_queue_info *qi;
if (q >= pCap->total_queues) { if (q >= pCap->total_queues) {
DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, "Set TXQ properties, " DPRINTF(ah, ATH_DBG_QUEUE, "Set TXQ properties, "
"invalid queue: %u\n", q); "invalid queue: %u\n", q);
return false; return false;
} }
qi = &ah->txq[q]; qi = &ah->txq[q];
if (qi->tqi_type == ATH9K_TX_QUEUE_INACTIVE) { if (qi->tqi_type == ATH9K_TX_QUEUE_INACTIVE) {
DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, "Set TXQ properties, " DPRINTF(ah, ATH_DBG_QUEUE, "Set TXQ properties, "
"inactive queue: %u\n", q); "inactive queue: %u\n", q);
return false; return false;
} }
DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, "Set queue properties for: %u\n", q); DPRINTF(ah, ATH_DBG_QUEUE, "Set queue properties for: %u\n", q);
qi->tqi_ver = qinfo->tqi_ver; qi->tqi_ver = qinfo->tqi_ver;
qi->tqi_subtype = qinfo->tqi_subtype; qi->tqi_subtype = qinfo->tqi_subtype;
...@@ -518,14 +518,14 @@ bool ath9k_hw_get_txq_props(struct ath_hw *ah, int q, ...@@ -518,14 +518,14 @@ bool ath9k_hw_get_txq_props(struct ath_hw *ah, int q,
struct ath9k_tx_queue_info *qi; struct ath9k_tx_queue_info *qi;
if (q >= pCap->total_queues) { if (q >= pCap->total_queues) {
DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, "Get TXQ properties, " DPRINTF(ah, ATH_DBG_QUEUE, "Get TXQ properties, "
"invalid queue: %u\n", q); "invalid queue: %u\n", q);
return false; return false;
} }
qi = &ah->txq[q]; qi = &ah->txq[q];
if (qi->tqi_type == ATH9K_TX_QUEUE_INACTIVE) { if (qi->tqi_type == ATH9K_TX_QUEUE_INACTIVE) {
DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, "Get TXQ properties, " DPRINTF(ah, ATH_DBG_QUEUE, "Get TXQ properties, "
"inactive queue: %u\n", q); "inactive queue: %u\n", q);
return false; return false;
} }
...@@ -574,22 +574,22 @@ int ath9k_hw_setuptxqueue(struct ath_hw *ah, enum ath9k_tx_queue type, ...@@ -574,22 +574,22 @@ int ath9k_hw_setuptxqueue(struct ath_hw *ah, enum ath9k_tx_queue type,
ATH9K_TX_QUEUE_INACTIVE) ATH9K_TX_QUEUE_INACTIVE)
break; break;
if (q == pCap->total_queues) { if (q == pCap->total_queues) {
DPRINTF(ah->ah_sc, ATH_DBG_FATAL, DPRINTF(ah, ATH_DBG_FATAL,
"No available TX queue\n"); "No available TX queue\n");
return -1; return -1;
} }
break; break;
default: default:
DPRINTF(ah->ah_sc, ATH_DBG_FATAL, "Invalid TX queue type: %u\n", DPRINTF(ah, ATH_DBG_FATAL, "Invalid TX queue type: %u\n",
type); type);
return -1; return -1;
} }
DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, "Setup TX queue: %u\n", q); DPRINTF(ah, ATH_DBG_QUEUE, "Setup TX queue: %u\n", q);
qi = &ah->txq[q]; qi = &ah->txq[q];
if (qi->tqi_type != ATH9K_TX_QUEUE_INACTIVE) { if (qi->tqi_type != ATH9K_TX_QUEUE_INACTIVE) {
DPRINTF(ah->ah_sc, ATH_DBG_FATAL, DPRINTF(ah, ATH_DBG_FATAL,
"TX queue: %u already active\n", q); "TX queue: %u already active\n", q);
return -1; return -1;
} }
...@@ -620,18 +620,18 @@ bool ath9k_hw_releasetxqueue(struct ath_hw *ah, u32 q) ...@@ -620,18 +620,18 @@ bool ath9k_hw_releasetxqueue(struct ath_hw *ah, u32 q)
struct ath9k_tx_queue_info *qi; struct ath9k_tx_queue_info *qi;
if (q >= pCap->total_queues) { if (q >= pCap->total_queues) {
DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, "Release TXQ, " DPRINTF(ah, ATH_DBG_QUEUE, "Release TXQ, "
"invalid queue: %u\n", q); "invalid queue: %u\n", q);
return false; return false;
} }
qi = &ah->txq[q]; qi = &ah->txq[q];
if (qi->tqi_type == ATH9K_TX_QUEUE_INACTIVE) { if (qi->tqi_type == ATH9K_TX_QUEUE_INACTIVE) {
DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, "Release TXQ, " DPRINTF(ah, ATH_DBG_QUEUE, "Release TXQ, "
"inactive queue: %u\n", q); "inactive queue: %u\n", q);
return false; return false;
} }
DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, "Release TX queue: %u\n", q); DPRINTF(ah, ATH_DBG_QUEUE, "Release TX queue: %u\n", q);
qi->tqi_type = ATH9K_TX_QUEUE_INACTIVE; qi->tqi_type = ATH9K_TX_QUEUE_INACTIVE;
ah->txok_interrupt_mask &= ~(1 << q); ah->txok_interrupt_mask &= ~(1 << q);
...@@ -652,19 +652,19 @@ bool ath9k_hw_resettxqueue(struct ath_hw *ah, u32 q) ...@@ -652,19 +652,19 @@ bool ath9k_hw_resettxqueue(struct ath_hw *ah, u32 q)
u32 cwMin, chanCwMin, value; u32 cwMin, chanCwMin, value;
if (q >= pCap->total_queues) { if (q >= pCap->total_queues) {
DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, "Reset TXQ, " DPRINTF(ah, ATH_DBG_QUEUE, "Reset TXQ, "
"invalid queue: %u\n", q); "invalid queue: %u\n", q);
return false; return false;
} }
qi = &ah->txq[q]; qi = &ah->txq[q];
if (qi->tqi_type == ATH9K_TX_QUEUE_INACTIVE) { if (qi->tqi_type == ATH9K_TX_QUEUE_INACTIVE) {
DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, "Reset TXQ, " DPRINTF(ah, ATH_DBG_QUEUE, "Reset TXQ, "
"inactive queue: %u\n", q); "inactive queue: %u\n", q);
return true; return true;
} }
DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, "Reset TX queue: %u\n", q); DPRINTF(ah, ATH_DBG_QUEUE, "Reset TX queue: %u\n", q);
if (qi->tqi_cwmin == ATH9K_TXQ_USEDEFAULT) { if (qi->tqi_cwmin == ATH9K_TXQ_USEDEFAULT) {
if (chan && IS_CHAN_B(chan)) if (chan && IS_CHAN_B(chan))
...@@ -911,7 +911,7 @@ bool ath9k_hw_setrxabort(struct ath_hw *ah, bool set) ...@@ -911,7 +911,7 @@ bool ath9k_hw_setrxabort(struct ath_hw *ah, bool set)
AR_DIAG_RX_ABORT)); AR_DIAG_RX_ABORT));
reg = REG_READ(ah, AR_OBS_BUS_1); reg = REG_READ(ah, AR_OBS_BUS_1);
DPRINTF(ah->ah_sc, ATH_DBG_FATAL, DPRINTF(ah, ATH_DBG_FATAL,
"RX failed to go idle in 10 ms RXSM=0x%x\n", reg); "RX failed to go idle in 10 ms RXSM=0x%x\n", reg);
return false; return false;
...@@ -967,7 +967,7 @@ bool ath9k_hw_stopdmarecv(struct ath_hw *ah) ...@@ -967,7 +967,7 @@ bool ath9k_hw_stopdmarecv(struct ath_hw *ah)
} }
if (i == 0) { if (i == 0) {
DPRINTF(ah->ah_sc, ATH_DBG_FATAL, DPRINTF(ah, ATH_DBG_FATAL,
"DMA failed to stop in %d ms " "DMA failed to stop in %d ms "
"AR_CR=0x%08x AR_DIAG_SW=0x%08x\n", "AR_CR=0x%08x AR_DIAG_SW=0x%08x\n",
AH_RX_STOP_DMA_TIMEOUT / 1000, AH_RX_STOP_DMA_TIMEOUT / 1000,
......
This diff is collapsed.
...@@ -46,7 +46,7 @@ ath9k_hw_set_channel(struct ath_hw *ah, struct ath9k_channel *chan) ...@@ -46,7 +46,7 @@ ath9k_hw_set_channel(struct ath_hw *ah, struct ath9k_channel *chan)
channelSel = ((freq - 704) * 2 - 3040) / 10; channelSel = ((freq - 704) * 2 - 3040) / 10;
bModeSynth = 1; bModeSynth = 1;
} else { } else {
DPRINTF(ah->ah_sc, ATH_DBG_FATAL, DPRINTF(ah, ATH_DBG_FATAL,
"Invalid channel %u MHz\n", freq); "Invalid channel %u MHz\n", freq);
return false; return false;
} }
...@@ -79,7 +79,7 @@ ath9k_hw_set_channel(struct ath_hw *ah, struct ath9k_channel *chan) ...@@ -79,7 +79,7 @@ ath9k_hw_set_channel(struct ath_hw *ah, struct ath9k_channel *chan)
channelSel = ath9k_hw_reverse_bits((freq - 4800) / 5, 8); channelSel = ath9k_hw_reverse_bits((freq - 4800) / 5, 8);
aModeRefSel = ath9k_hw_reverse_bits(1, 2); aModeRefSel = ath9k_hw_reverse_bits(1, 2);
} else { } else {
DPRINTF(ah->ah_sc, ATH_DBG_FATAL, DPRINTF(ah, ATH_DBG_FATAL,
"Invalid channel %u MHz\n", freq); "Invalid channel %u MHz\n", freq);
return false; return false;
} }
...@@ -315,7 +315,7 @@ bool ath9k_hw_init_rf(struct ath_hw *ah, int *status) ...@@ -315,7 +315,7 @@ bool ath9k_hw_init_rf(struct ath_hw *ah, int *status)
|| ah->analogBank6Data == NULL || ah->analogBank6Data == NULL
|| ah->analogBank6TPCData == NULL || ah->analogBank6TPCData == NULL
|| ah->analogBank7Data == NULL) { || ah->analogBank7Data == NULL) {
DPRINTF(ah->ah_sc, ATH_DBG_FATAL, DPRINTF(ah, ATH_DBG_FATAL,
"Cannot allocate RF banks\n"); "Cannot allocate RF banks\n");
*status = -ENOMEM; *status = -ENOMEM;
return false; return false;
...@@ -326,7 +326,7 @@ bool ath9k_hw_init_rf(struct ath_hw *ah, int *status) ...@@ -326,7 +326,7 @@ bool ath9k_hw_init_rf(struct ath_hw *ah, int *status)
ah->iniAddac.ia_rows * ah->iniAddac.ia_rows *
ah->iniAddac.ia_columns), GFP_KERNEL); ah->iniAddac.ia_columns), GFP_KERNEL);
if (ah->addac5416_21 == NULL) { if (ah->addac5416_21 == NULL) {
DPRINTF(ah->ah_sc, ATH_DBG_FATAL, DPRINTF(ah, ATH_DBG_FATAL,
"Cannot allocate addac5416_21\n"); "Cannot allocate addac5416_21\n");
*status = -ENOMEM; *status = -ENOMEM;
return false; return false;
...@@ -336,7 +336,7 @@ bool ath9k_hw_init_rf(struct ath_hw *ah, int *status) ...@@ -336,7 +336,7 @@ bool ath9k_hw_init_rf(struct ath_hw *ah, int *status)
kzalloc((sizeof(u32) * kzalloc((sizeof(u32) *
ah->iniBank6.ia_rows), GFP_KERNEL); ah->iniBank6.ia_rows), GFP_KERNEL);
if (ah->bank6Temp == NULL) { if (ah->bank6Temp == NULL) {
DPRINTF(ah->ah_sc, ATH_DBG_FATAL, DPRINTF(ah, ATH_DBG_FATAL,
"Cannot allocate bank6Temp\n"); "Cannot allocate bank6Temp\n");
*status = -ENOMEM; *status = -ENOMEM;
return false; return false;
......
...@@ -1177,13 +1177,14 @@ struct ath_rate_table *ath_choose_rate_table(struct ath_softc *sc, ...@@ -1177,13 +1177,14 @@ struct ath_rate_table *ath_choose_rate_table(struct ath_softc *sc,
mode = ATH9K_MODE_11NA_HT40PLUS; mode = ATH9K_MODE_11NA_HT40PLUS;
break; break;
default: default:
DPRINTF(sc, ATH_DBG_CONFIG, "Invalid band\n"); DPRINTF(sc->sc_ah, ATH_DBG_CONFIG, "Invalid band\n");
return NULL; return NULL;
} }
BUG_ON(mode >= ATH9K_MODE_MAX); BUG_ON(mode >= ATH9K_MODE_MAX);
DPRINTF(sc, ATH_DBG_CONFIG, "Choosing rate table for mode: %d\n", mode); DPRINTF(sc->sc_ah, ATH_DBG_CONFIG,
"Choosing rate table for mode: %d\n", mode);
return sc->hw_rate_table[mode]; return sc->hw_rate_table[mode];
} }
...@@ -1198,7 +1199,8 @@ static void ath_rc_init(struct ath_softc *sc, ...@@ -1198,7 +1199,8 @@ static void ath_rc_init(struct ath_softc *sc,
u8 i, j, k, hi = 0, hthi = 0; u8 i, j, k, hi = 0, hthi = 0;
if (!rate_table) { if (!rate_table) {
DPRINTF(sc, ATH_DBG_FATAL, "Rate table not initialized\n"); DPRINTF(sc->sc_ah, ATH_DBG_FATAL,
"Rate table not initialized\n");
return; return;
} }
...@@ -1261,7 +1263,8 @@ static void ath_rc_init(struct ath_softc *sc, ...@@ -1261,7 +1263,8 @@ static void ath_rc_init(struct ath_softc *sc,
ath_rc_priv->rate_max_phy = ath_rc_priv->valid_rate_index[k-4]; ath_rc_priv->rate_max_phy = ath_rc_priv->valid_rate_index[k-4];
sc->cur_rate_table = rate_table; sc->cur_rate_table = rate_table;
DPRINTF(sc, ATH_DBG_CONFIG, "RC Initialized with capabilities: 0x%x\n", DPRINTF(sc->sc_ah, ATH_DBG_CONFIG,
"RC Initialized with capabilities: 0x%x\n",
ath_rc_priv->ht_cap); ath_rc_priv->ht_cap);
} }
...@@ -1438,7 +1441,7 @@ static void ath_rate_update(void *priv, struct ieee80211_supported_band *sband, ...@@ -1438,7 +1441,7 @@ static void ath_rate_update(void *priv, struct ieee80211_supported_band *sband,
oper_cw40, oper_sgi40); oper_cw40, oper_sgi40);
ath_rc_init(sc, priv_sta, sband, sta, rate_table); ath_rc_init(sc, priv_sta, sband, sta, rate_table);
DPRINTF(sc, ATH_DBG_CONFIG, DPRINTF(sc->sc_ah, ATH_DBG_CONFIG,
"Operating HT Bandwidth changed to: %d\n", "Operating HT Bandwidth changed to: %d\n",
sc->hw->conf.channel_type); sc->hw->conf.channel_type);
} }
...@@ -1463,7 +1466,7 @@ static void *ath_rate_alloc_sta(void *priv, struct ieee80211_sta *sta, gfp_t gfp ...@@ -1463,7 +1466,7 @@ static void *ath_rate_alloc_sta(void *priv, struct ieee80211_sta *sta, gfp_t gfp
rate_priv = kzalloc(sizeof(struct ath_rate_priv), gfp); rate_priv = kzalloc(sizeof(struct ath_rate_priv), gfp);
if (!rate_priv) { if (!rate_priv) {
DPRINTF(sc, ATH_DBG_FATAL, DPRINTF(sc->sc_ah, ATH_DBG_FATAL,
"Unable to allocate private rc structure\n"); "Unable to allocate private rc structure\n");
return NULL; return NULL;
} }
......
...@@ -306,7 +306,7 @@ int ath_rx_init(struct ath_softc *sc, int nbufs) ...@@ -306,7 +306,7 @@ int ath_rx_init(struct ath_softc *sc, int nbufs)
sc->rx.bufsize = roundup(IEEE80211_MAX_MPDU_LEN, sc->rx.bufsize = roundup(IEEE80211_MAX_MPDU_LEN,
min(sc->common.cachelsz, (u16)64)); min(sc->common.cachelsz, (u16)64));
DPRINTF(sc, ATH_DBG_CONFIG, "cachelsz %u rxbufsize %u\n", DPRINTF(sc->sc_ah, ATH_DBG_CONFIG, "cachelsz %u rxbufsize %u\n",
sc->common.cachelsz, sc->rx.bufsize); sc->common.cachelsz, sc->rx.bufsize);
/* Initialize rx descriptors */ /* Initialize rx descriptors */
...@@ -314,7 +314,7 @@ int ath_rx_init(struct ath_softc *sc, int nbufs) ...@@ -314,7 +314,7 @@ int ath_rx_init(struct ath_softc *sc, int nbufs)
error = ath_descdma_setup(sc, &sc->rx.rxdma, &sc->rx.rxbuf, error = ath_descdma_setup(sc, &sc->rx.rxdma, &sc->rx.rxbuf,
"rx", nbufs, 1); "rx", nbufs, 1);
if (error != 0) { if (error != 0) {
DPRINTF(sc, ATH_DBG_FATAL, DPRINTF(sc->sc_ah, ATH_DBG_FATAL,
"failed to allocate rx descriptors: %d\n", error); "failed to allocate rx descriptors: %d\n", error);
goto err; goto err;
} }
...@@ -334,7 +334,7 @@ int ath_rx_init(struct ath_softc *sc, int nbufs) ...@@ -334,7 +334,7 @@ int ath_rx_init(struct ath_softc *sc, int nbufs)
bf->bf_buf_addr))) { bf->bf_buf_addr))) {
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
bf->bf_mpdu = NULL; bf->bf_mpdu = NULL;
DPRINTF(sc, ATH_DBG_FATAL, DPRINTF(sc->sc_ah, ATH_DBG_FATAL,
"dma_mapping_error() on RX init\n"); "dma_mapping_error() on RX init\n");
error = -ENOMEM; error = -ENOMEM;
goto err; goto err;
...@@ -539,7 +539,7 @@ static void ath_rx_ps_beacon(struct ath_softc *sc, struct sk_buff *skb) ...@@ -539,7 +539,7 @@ static void ath_rx_ps_beacon(struct ath_softc *sc, struct sk_buff *skb)
if (sc->sc_flags & SC_OP_BEACON_SYNC) { if (sc->sc_flags & SC_OP_BEACON_SYNC) {
sc->sc_flags &= ~SC_OP_BEACON_SYNC; sc->sc_flags &= ~SC_OP_BEACON_SYNC;
DPRINTF(sc, ATH_DBG_PS, "Reconfigure Beacon timers based on " DPRINTF(sc->sc_ah, ATH_DBG_PS, "Reconfigure Beacon timers based on "
"timestamp from the AP\n"); "timestamp from the AP\n");
ath_beacon_config(sc, NULL); ath_beacon_config(sc, NULL);
} }
...@@ -552,7 +552,7 @@ static void ath_rx_ps_beacon(struct ath_softc *sc, struct sk_buff *skb) ...@@ -552,7 +552,7 @@ static void ath_rx_ps_beacon(struct ath_softc *sc, struct sk_buff *skb)
* a backup trigger for returning into NETWORK SLEEP state, * a backup trigger for returning into NETWORK SLEEP state,
* so we are waiting for it as well. * so we are waiting for it as well.
*/ */
DPRINTF(sc, ATH_DBG_PS, "Received DTIM beacon indicating " DPRINTF(sc->sc_ah, ATH_DBG_PS, "Received DTIM beacon indicating "
"buffered broadcast/multicast frame(s)\n"); "buffered broadcast/multicast frame(s)\n");
sc->sc_flags |= SC_OP_WAIT_FOR_CAB | SC_OP_WAIT_FOR_BEACON; sc->sc_flags |= SC_OP_WAIT_FOR_CAB | SC_OP_WAIT_FOR_BEACON;
return; return;
...@@ -565,7 +565,7 @@ static void ath_rx_ps_beacon(struct ath_softc *sc, struct sk_buff *skb) ...@@ -565,7 +565,7 @@ static void ath_rx_ps_beacon(struct ath_softc *sc, struct sk_buff *skb)
* been delivered. * been delivered.
*/ */
sc->sc_flags &= ~SC_OP_WAIT_FOR_CAB; sc->sc_flags &= ~SC_OP_WAIT_FOR_CAB;
DPRINTF(sc, ATH_DBG_PS, "PS wait for CAB frames timed out\n"); DPRINTF(sc->sc_ah, ATH_DBG_PS, "PS wait for CAB frames timed out\n");
} }
} }
...@@ -589,13 +589,13 @@ static void ath_rx_ps(struct ath_softc *sc, struct sk_buff *skb) ...@@ -589,13 +589,13 @@ static void ath_rx_ps(struct ath_softc *sc, struct sk_buff *skb)
* point. * point.
*/ */
sc->sc_flags &= ~SC_OP_WAIT_FOR_CAB; sc->sc_flags &= ~SC_OP_WAIT_FOR_CAB;
DPRINTF(sc, ATH_DBG_PS, "All PS CAB frames received, back to " DPRINTF(sc->sc_ah, ATH_DBG_PS, "All PS CAB frames received, back to "
"sleep\n"); "sleep\n");
} else if ((sc->sc_flags & SC_OP_WAIT_FOR_PSPOLL_DATA) && } else if ((sc->sc_flags & SC_OP_WAIT_FOR_PSPOLL_DATA) &&
!is_multicast_ether_addr(hdr->addr1) && !is_multicast_ether_addr(hdr->addr1) &&
!ieee80211_has_morefrags(hdr->frame_control)) { !ieee80211_has_morefrags(hdr->frame_control)) {
sc->sc_flags &= ~SC_OP_WAIT_FOR_PSPOLL_DATA; sc->sc_flags &= ~SC_OP_WAIT_FOR_PSPOLL_DATA;
DPRINTF(sc, ATH_DBG_PS, "Going back to sleep after having " DPRINTF(sc->sc_ah, ATH_DBG_PS, "Going back to sleep after having "
"received PS-Poll data (0x%x)\n", "received PS-Poll data (0x%x)\n",
sc->sc_flags & (SC_OP_WAIT_FOR_BEACON | sc->sc_flags & (SC_OP_WAIT_FOR_BEACON |
SC_OP_WAIT_FOR_CAB | SC_OP_WAIT_FOR_CAB |
...@@ -811,7 +811,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush) ...@@ -811,7 +811,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush)
bf->bf_buf_addr))) { bf->bf_buf_addr))) {
dev_kfree_skb_any(requeue_skb); dev_kfree_skb_any(requeue_skb);
bf->bf_mpdu = NULL; bf->bf_mpdu = NULL;
DPRINTF(sc, ATH_DBG_FATAL, DPRINTF(sc->sc_ah, ATH_DBG_FATAL,
"dma_mapping_error() on RX\n"); "dma_mapping_error() on RX\n");
ath_rx_send_to_mac80211(sc, skb, &rx_status); ath_rx_send_to_mac80211(sc, skb, &rx_status);
break; break;
......
...@@ -854,7 +854,7 @@ struct ath_txq *ath_txq_setup(struct ath_softc *sc, int qtype, int subtype) ...@@ -854,7 +854,7 @@ struct ath_txq *ath_txq_setup(struct ath_softc *sc, int qtype, int subtype)
return NULL; return NULL;
} }
if (qnum >= ARRAY_SIZE(sc->tx.txq)) { if (qnum >= ARRAY_SIZE(sc->tx.txq)) {
DPRINTF(sc, ATH_DBG_FATAL, DPRINTF(ah, ATH_DBG_FATAL,
"qnum %u out of range, max %u!\n", "qnum %u out of range, max %u!\n",
qnum, (unsigned int)ARRAY_SIZE(sc->tx.txq)); qnum, (unsigned int)ARRAY_SIZE(sc->tx.txq));
ath9k_hw_releasetxqueue(ah, qnum); ath9k_hw_releasetxqueue(ah, qnum);
...@@ -884,7 +884,7 @@ int ath_tx_get_qnum(struct ath_softc *sc, int qtype, int haltype) ...@@ -884,7 +884,7 @@ int ath_tx_get_qnum(struct ath_softc *sc, int qtype, int haltype)
switch (qtype) { switch (qtype) {
case ATH9K_TX_QUEUE_DATA: case ATH9K_TX_QUEUE_DATA:
if (haltype >= ARRAY_SIZE(sc->tx.hwq_map)) { if (haltype >= ARRAY_SIZE(sc->tx.hwq_map)) {
DPRINTF(sc, ATH_DBG_FATAL, DPRINTF(sc->sc_ah, ATH_DBG_FATAL,
"HAL AC %u out of range, max %zu!\n", "HAL AC %u out of range, max %zu!\n",
haltype, ARRAY_SIZE(sc->tx.hwq_map)); haltype, ARRAY_SIZE(sc->tx.hwq_map));
return -1; return -1;
...@@ -914,7 +914,7 @@ struct ath_txq *ath_test_get_txq(struct ath_softc *sc, struct sk_buff *skb) ...@@ -914,7 +914,7 @@ struct ath_txq *ath_test_get_txq(struct ath_softc *sc, struct sk_buff *skb)
spin_lock_bh(&txq->axq_lock); spin_lock_bh(&txq->axq_lock);
if (txq->axq_depth >= (ATH_TXBUF - 20)) { if (txq->axq_depth >= (ATH_TXBUF - 20)) {
DPRINTF(sc, ATH_DBG_XMIT, DPRINTF(sc->sc_ah, ATH_DBG_XMIT,
"TX queue: %d is full, depth: %d\n", "TX queue: %d is full, depth: %d\n",
qnum, txq->axq_depth); qnum, txq->axq_depth);
ieee80211_stop_queue(sc->hw, skb_get_queue_mapping(skb)); ieee80211_stop_queue(sc->hw, skb_get_queue_mapping(skb));
...@@ -955,7 +955,7 @@ int ath_txq_update(struct ath_softc *sc, int qnum, ...@@ -955,7 +955,7 @@ int ath_txq_update(struct ath_softc *sc, int qnum,
qi.tqi_readyTime = qinfo->tqi_readyTime; qi.tqi_readyTime = qinfo->tqi_readyTime;
if (!ath9k_hw_set_txq_props(ah, qnum, &qi)) { if (!ath9k_hw_set_txq_props(ah, qnum, &qi)) {
DPRINTF(sc, ATH_DBG_FATAL, DPRINTF(sc->sc_ah, ATH_DBG_FATAL,
"Unable to update hardware queue %u!\n", qnum); "Unable to update hardware queue %u!\n", qnum);
error = -EIO; error = -EIO;
} else { } else {
...@@ -1076,12 +1076,12 @@ void ath_drain_all_txq(struct ath_softc *sc, bool retry_tx) ...@@ -1076,12 +1076,12 @@ void ath_drain_all_txq(struct ath_softc *sc, bool retry_tx)
if (npend) { if (npend) {
int r; int r;
DPRINTF(sc, ATH_DBG_XMIT, "Unable to stop TxDMA. Reset HAL!\n"); DPRINTF(sc->sc_ah, ATH_DBG_XMIT, "Unable to stop TxDMA. Reset HAL!\n");
spin_lock_bh(&sc->sc_resetlock); spin_lock_bh(&sc->sc_resetlock);
r = ath9k_hw_reset(ah, sc->sc_ah->curchan, true); r = ath9k_hw_reset(ah, sc->sc_ah->curchan, true);
if (r) if (r)
DPRINTF(sc, ATH_DBG_FATAL, DPRINTF(sc->sc_ah, ATH_DBG_FATAL,
"Unable to reset hardware; reset status %d\n", "Unable to reset hardware; reset status %d\n",
r); r);
spin_unlock_bh(&sc->sc_resetlock); spin_unlock_bh(&sc->sc_resetlock);
...@@ -1147,7 +1147,7 @@ int ath_tx_setup(struct ath_softc *sc, int haltype) ...@@ -1147,7 +1147,7 @@ int ath_tx_setup(struct ath_softc *sc, int haltype)
struct ath_txq *txq; struct ath_txq *txq;
if (haltype >= ARRAY_SIZE(sc->tx.hwq_map)) { if (haltype >= ARRAY_SIZE(sc->tx.hwq_map)) {
DPRINTF(sc, ATH_DBG_FATAL, DPRINTF(sc->sc_ah, ATH_DBG_FATAL,
"HAL AC %u out of range, max %zu!\n", "HAL AC %u out of range, max %zu!\n",
haltype, ARRAY_SIZE(sc->tx.hwq_map)); haltype, ARRAY_SIZE(sc->tx.hwq_map));
return 0; return 0;
...@@ -1188,17 +1188,17 @@ static void ath_tx_txqaddbuf(struct ath_softc *sc, struct ath_txq *txq, ...@@ -1188,17 +1188,17 @@ static void ath_tx_txqaddbuf(struct ath_softc *sc, struct ath_txq *txq,
txq->axq_depth++; txq->axq_depth++;
txq->axq_linkbuf = list_entry(txq->axq_q.prev, struct ath_buf, list); txq->axq_linkbuf = list_entry(txq->axq_q.prev, struct ath_buf, list);
DPRINTF(sc, ATH_DBG_QUEUE, DPRINTF(sc->sc_ah, ATH_DBG_QUEUE,
"qnum: %d, txq depth: %d\n", txq->axq_qnum, txq->axq_depth); "qnum: %d, txq depth: %d\n", txq->axq_qnum, txq->axq_depth);
if (txq->axq_link == NULL) { if (txq->axq_link == NULL) {
ath9k_hw_puttxbuf(ah, txq->axq_qnum, bf->bf_daddr); ath9k_hw_puttxbuf(ah, txq->axq_qnum, bf->bf_daddr);
DPRINTF(sc, ATH_DBG_XMIT, DPRINTF(sc->sc_ah, ATH_DBG_XMIT,
"TXDP[%u] = %llx (%p)\n", "TXDP[%u] = %llx (%p)\n",
txq->axq_qnum, ito64(bf->bf_daddr), bf->bf_desc); txq->axq_qnum, ito64(bf->bf_daddr), bf->bf_desc);
} else { } else {
*txq->axq_link = bf->bf_daddr; *txq->axq_link = bf->bf_daddr;
DPRINTF(sc, ATH_DBG_XMIT, "link[%u] (%p)=%llx (%p)\n", DPRINTF(sc->sc_ah, ATH_DBG_XMIT, "link[%u] (%p)=%llx (%p)\n",
txq->axq_qnum, txq->axq_link, txq->axq_qnum, txq->axq_link,
ito64(bf->bf_daddr), bf->bf_desc); ito64(bf->bf_daddr), bf->bf_desc);
} }
...@@ -1587,7 +1587,8 @@ static int ath_tx_setup_buffer(struct ieee80211_hw *hw, struct ath_buf *bf, ...@@ -1587,7 +1587,8 @@ static int ath_tx_setup_buffer(struct ieee80211_hw *hw, struct ath_buf *bf,
bf->bf_mpdu = NULL; bf->bf_mpdu = NULL;
kfree(tx_info_priv); kfree(tx_info_priv);
tx_info->rate_driver_data[0] = NULL; tx_info->rate_driver_data[0] = NULL;
DPRINTF(sc, ATH_DBG_FATAL, "dma_mapping_error() on TX\n"); DPRINTF(sc->sc_ah, ATH_DBG_FATAL,
"dma_mapping_error() on TX\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -1674,7 +1675,7 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb, ...@@ -1674,7 +1675,7 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
bf = ath_tx_get_buffer(sc); bf = ath_tx_get_buffer(sc);
if (!bf) { if (!bf) {
DPRINTF(sc, ATH_DBG_XMIT, "TX buffers are full\n"); DPRINTF(sc->sc_ah, ATH_DBG_XMIT, "TX buffers are full\n");
return -1; return -1;
} }
...@@ -1682,7 +1683,7 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb, ...@@ -1682,7 +1683,7 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
if (unlikely(r)) { if (unlikely(r)) {
struct ath_txq *txq = txctl->txq; struct ath_txq *txq = txctl->txq;
DPRINTF(sc, ATH_DBG_FATAL, "TX mem alloc failure\n"); DPRINTF(sc->sc_ah, ATH_DBG_FATAL, "TX mem alloc failure\n");
/* upon ath_tx_processq() this TX queue will be resumed, we /* upon ath_tx_processq() this TX queue will be resumed, we
* guarantee this will happen by knowing beforehand that * guarantee this will happen by knowing beforehand that
...@@ -1736,7 +1737,8 @@ void ath_tx_cabq(struct ieee80211_hw *hw, struct sk_buff *skb) ...@@ -1736,7 +1737,8 @@ void ath_tx_cabq(struct ieee80211_hw *hw, struct sk_buff *skb)
if (hdrlen & 3) { if (hdrlen & 3) {
padsize = hdrlen % 4; padsize = hdrlen % 4;
if (skb_headroom(skb) < padsize) { if (skb_headroom(skb) < padsize) {
DPRINTF(sc, ATH_DBG_XMIT, "TX CABQ padding failed\n"); DPRINTF(sc->sc_ah, ATH_DBG_XMIT,
"TX CABQ padding failed\n");
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
return; return;
} }
...@@ -1746,10 +1748,10 @@ void ath_tx_cabq(struct ieee80211_hw *hw, struct sk_buff *skb) ...@@ -1746,10 +1748,10 @@ void ath_tx_cabq(struct ieee80211_hw *hw, struct sk_buff *skb)
txctl.txq = sc->beacon.cabq; txctl.txq = sc->beacon.cabq;
DPRINTF(sc, ATH_DBG_XMIT, "transmitting CABQ packet, skb: %p\n", skb); DPRINTF(sc->sc_ah, ATH_DBG_XMIT, "transmitting CABQ packet, skb: %p\n", skb);
if (ath_tx_start(hw, skb, &txctl) != 0) { if (ath_tx_start(hw, skb, &txctl) != 0) {
DPRINTF(sc, ATH_DBG_XMIT, "CABQ TX failed\n"); DPRINTF(sc->sc_ah, ATH_DBG_XMIT, "CABQ TX failed\n");
goto exit; goto exit;
} }
...@@ -1771,7 +1773,7 @@ static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb, ...@@ -1771,7 +1773,7 @@ static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb,
int hdrlen, padsize; int hdrlen, padsize;
int frame_type = ATH9K_NOT_INTERNAL; int frame_type = ATH9K_NOT_INTERNAL;
DPRINTF(sc, ATH_DBG_XMIT, "TX complete: skb: %p\n", skb); DPRINTF(sc->sc_ah, ATH_DBG_XMIT, "TX complete: skb: %p\n", skb);
if (tx_info_priv) { if (tx_info_priv) {
hw = tx_info_priv->aphy->hw; hw = tx_info_priv->aphy->hw;
...@@ -1805,7 +1807,7 @@ static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb, ...@@ -1805,7 +1807,7 @@ static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb,
if (sc->sc_flags & SC_OP_WAIT_FOR_TX_ACK) { if (sc->sc_flags & SC_OP_WAIT_FOR_TX_ACK) {
sc->sc_flags &= ~SC_OP_WAIT_FOR_TX_ACK; sc->sc_flags &= ~SC_OP_WAIT_FOR_TX_ACK;
DPRINTF(sc, ATH_DBG_PS, "Going back to sleep after having " DPRINTF(sc->sc_ah, ATH_DBG_PS, "Going back to sleep after having "
"received TX status (0x%x)\n", "received TX status (0x%x)\n",
sc->sc_flags & (SC_OP_WAIT_FOR_BEACON | sc->sc_flags & (SC_OP_WAIT_FOR_BEACON |
SC_OP_WAIT_FOR_CAB | SC_OP_WAIT_FOR_CAB |
...@@ -1942,7 +1944,7 @@ static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq) ...@@ -1942,7 +1944,7 @@ static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq)
int txok; int txok;
int status; int status;
DPRINTF(sc, ATH_DBG_QUEUE, "tx queue %d (%x), link %p\n", DPRINTF(ah, ATH_DBG_QUEUE, "tx queue %d (%x), link %p\n",
txq->axq_qnum, ath9k_hw_gettxbuf(sc->sc_ah, txq->axq_qnum), txq->axq_qnum, ath9k_hw_gettxbuf(sc->sc_ah, txq->axq_qnum),
txq->axq_link); txq->axq_link);
...@@ -2064,7 +2066,7 @@ static void ath_tx_complete_poll_work(struct work_struct *work) ...@@ -2064,7 +2066,7 @@ static void ath_tx_complete_poll_work(struct work_struct *work)
} }
if (needreset) { if (needreset) {
DPRINTF(sc, ATH_DBG_RESET, "tx hung, resetting the chip\n"); DPRINTF(sc->sc_ah, ATH_DBG_RESET, "tx hung, resetting the chip\n");
ath_reset(sc, false); ath_reset(sc, false);
} }
...@@ -2100,7 +2102,7 @@ int ath_tx_init(struct ath_softc *sc, int nbufs) ...@@ -2100,7 +2102,7 @@ int ath_tx_init(struct ath_softc *sc, int nbufs)
error = ath_descdma_setup(sc, &sc->tx.txdma, &sc->tx.txbuf, error = ath_descdma_setup(sc, &sc->tx.txdma, &sc->tx.txbuf,
"tx", nbufs, 1); "tx", nbufs, 1);
if (error != 0) { if (error != 0) {
DPRINTF(sc, ATH_DBG_FATAL, DPRINTF(sc->sc_ah, ATH_DBG_FATAL,
"Failed to allocate tx descriptors: %d\n", error); "Failed to allocate tx descriptors: %d\n", error);
goto err; goto err;
} }
...@@ -2108,7 +2110,7 @@ int ath_tx_init(struct ath_softc *sc, int nbufs) ...@@ -2108,7 +2110,7 @@ int ath_tx_init(struct ath_softc *sc, int nbufs)
error = ath_descdma_setup(sc, &sc->beacon.bdma, &sc->beacon.bbuf, error = ath_descdma_setup(sc, &sc->beacon.bdma, &sc->beacon.bbuf,
"beacon", ATH_BCBUF, 1); "beacon", ATH_BCBUF, 1);
if (error != 0) { if (error != 0) {
DPRINTF(sc, ATH_DBG_FATAL, DPRINTF(sc->sc_ah, ATH_DBG_FATAL,
"Failed to allocate beacon descriptors: %d\n", error); "Failed to allocate beacon descriptors: %d\n", error);
goto err; goto err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment