diff options
author | Sujith <Sujith.Manoharan@atheros.com> | 2008-11-28 11:48:05 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-12-05 09:35:08 -0500 |
commit | 04bd4638097c767278fdf12d50fecc8b60194d39 (patch) | |
tree | 8bad1080889360aa06ffc967bb2625eecd3db26e /drivers/net/wireless/ath9k/calib.c | |
parent | d9a1f48648edbe99fa432626ce6964a1b58f7281 (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/calib.c')
-rw-r--r-- | drivers/net/wireless/ath9k/calib.c | 69 |
1 files changed, 31 insertions, 38 deletions
diff --git a/drivers/net/wireless/ath9k/calib.c b/drivers/net/wireless/ath9k/calib.c index 0e214f746a96..51c8a3ce4e60 100644 --- a/drivers/net/wireless/ath9k/calib.c +++ b/drivers/net/wireless/ath9k/calib.c | |||
@@ -31,11 +31,11 @@ static const int16_t NOISE_FLOOR[] = { -96, -93, -98, -96, -93, -96 }; | |||
31 | static bool ath9k_hw_nf_in_range(struct ath_hal *ah, s16 nf) | 31 | static bool ath9k_hw_nf_in_range(struct ath_hal *ah, s16 nf) |
32 | { | 32 | { |
33 | if (nf > ATH9K_NF_TOO_LOW) { | 33 | if (nf > ATH9K_NF_TOO_LOW) { |
34 | DPRINTF(ah->ah_sc, ATH_DBG_NF_CAL, | 34 | DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, |
35 | "%s: noise floor value detected (%d) is " | 35 | "noise floor value detected (%d) is " |
36 | "lower than what we think is a " | 36 | "lower than what we think is a " |
37 | "reasonable value (%d)\n", | 37 | "reasonable value (%d)\n", |
38 | __func__, nf, ATH9K_NF_TOO_LOW); | 38 | nf, ATH9K_NF_TOO_LOW); |
39 | return false; | 39 | return false; |
40 | } | 40 | } |
41 | return true; | 41 | return true; |
@@ -116,7 +116,7 @@ static void ath9k_hw_do_getnf(struct ath_hal *ah, | |||
116 | 116 | ||
117 | if (nf & 0x100) | 117 | if (nf & 0x100) |
118 | nf = 0 - ((nf ^ 0x1ff) + 1); | 118 | nf = 0 - ((nf ^ 0x1ff) + 1); |
119 | DPRINTF(ah->ah_sc, ATH_DBG_NF_CAL, | 119 | DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, |
120 | "NF calibrated [ctl] [chain 1] is %d\n", nf); | 120 | "NF calibrated [ctl] [chain 1] is %d\n", nf); |
121 | nfarray[1] = nf; | 121 | nfarray[1] = nf; |
122 | 122 | ||
@@ -125,7 +125,7 @@ static void ath9k_hw_do_getnf(struct ath_hal *ah, | |||
125 | AR_PHY_CH2_MINCCA_PWR); | 125 | AR_PHY_CH2_MINCCA_PWR); |
126 | if (nf & 0x100) | 126 | if (nf & 0x100) |
127 | nf = 0 - ((nf ^ 0x1ff) + 1); | 127 | nf = 0 - ((nf ^ 0x1ff) + 1); |
128 | DPRINTF(ah->ah_sc, ATH_DBG_NF_CAL, | 128 | DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, |
129 | "NF calibrated [ctl] [chain 2] is %d\n", nf); | 129 | "NF calibrated [ctl] [chain 2] is %d\n", nf); |
130 | nfarray[2] = nf; | 130 | nfarray[2] = nf; |
131 | } | 131 | } |
@@ -139,7 +139,7 @@ static void ath9k_hw_do_getnf(struct ath_hal *ah, | |||
139 | 139 | ||
140 | if (nf & 0x100) | 140 | if (nf & 0x100) |
141 | nf = 0 - ((nf ^ 0x1ff) + 1); | 141 | nf = 0 - ((nf ^ 0x1ff) + 1); |
142 | DPRINTF(ah->ah_sc, ATH_DBG_NF_CAL, | 142 | DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, |
143 | "NF calibrated [ext] [chain 0] is %d\n", nf); | 143 | "NF calibrated [ext] [chain 0] is %d\n", nf); |
144 | nfarray[3] = nf; | 144 | nfarray[3] = nf; |
145 | 145 | ||
@@ -161,7 +161,7 @@ static void ath9k_hw_do_getnf(struct ath_hal *ah, | |||
161 | AR_PHY_CH2_EXT_MINCCA_PWR); | 161 | AR_PHY_CH2_EXT_MINCCA_PWR); |
162 | if (nf & 0x100) | 162 | if (nf & 0x100) |
163 | nf = 0 - ((nf ^ 0x1ff) + 1); | 163 | nf = 0 - ((nf ^ 0x1ff) + 1); |
164 | DPRINTF(ah->ah_sc, ATH_DBG_NF_CAL, | 164 | DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, |
165 | "NF calibrated [ext] [chain 2] is %d\n", nf); | 165 | "NF calibrated [ext] [chain 2] is %d\n", nf); |
166 | nfarray[5] = nf; | 166 | nfarray[5] = nf; |
167 | } | 167 | } |
@@ -187,8 +187,7 @@ static bool getNoiseFloorThresh(struct ath_hal *ah, | |||
187 | break; | 187 | break; |
188 | default: | 188 | default: |
189 | DPRINTF(ah->ah_sc, ATH_DBG_CHANNEL, | 189 | DPRINTF(ah->ah_sc, ATH_DBG_CHANNEL, |
190 | "%s: invalid channel flags 0x%x\n", __func__, | 190 | "invalid channel flags 0x%x\n", chan->channelFlags); |
191 | chan->channelFlags); | ||
192 | return false; | 191 | return false; |
193 | } | 192 | } |
194 | 193 | ||
@@ -206,24 +205,22 @@ static void ath9k_hw_setup_calibration(struct ath_hal *ah, | |||
206 | case IQ_MISMATCH_CAL: | 205 | case IQ_MISMATCH_CAL: |
207 | REG_WRITE(ah, AR_PHY_CALMODE, AR_PHY_CALMODE_IQ); | 206 | REG_WRITE(ah, AR_PHY_CALMODE, AR_PHY_CALMODE_IQ); |
208 | DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, | 207 | DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, |
209 | "%s: starting IQ Mismatch Calibration\n", | 208 | "starting IQ Mismatch Calibration\n"); |
210 | __func__); | ||
211 | break; | 209 | break; |
212 | case ADC_GAIN_CAL: | 210 | case ADC_GAIN_CAL: |
213 | REG_WRITE(ah, AR_PHY_CALMODE, AR_PHY_CALMODE_ADC_GAIN); | 211 | REG_WRITE(ah, AR_PHY_CALMODE, AR_PHY_CALMODE_ADC_GAIN); |
214 | DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, | 212 | DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, |
215 | "%s: starting ADC Gain Calibration\n", __func__); | 213 | "starting ADC Gain Calibration\n"); |
216 | break; | 214 | break; |
217 | case ADC_DC_CAL: | 215 | case ADC_DC_CAL: |
218 | REG_WRITE(ah, AR_PHY_CALMODE, AR_PHY_CALMODE_ADC_DC_PER); | 216 | REG_WRITE(ah, AR_PHY_CALMODE, AR_PHY_CALMODE_ADC_DC_PER); |
219 | DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, | 217 | DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, |
220 | "%s: starting ADC DC Calibration\n", __func__); | 218 | "starting ADC DC Calibration\n"); |
221 | break; | 219 | break; |
222 | case ADC_DC_INIT_CAL: | 220 | case ADC_DC_INIT_CAL: |
223 | REG_WRITE(ah, AR_PHY_CALMODE, AR_PHY_CALMODE_ADC_DC_INIT); | 221 | REG_WRITE(ah, AR_PHY_CALMODE, AR_PHY_CALMODE_ADC_DC_INIT); |
224 | DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, | 222 | DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, |
225 | "%s: starting Init ADC DC Calibration\n", | 223 | "starting Init ADC DC Calibration\n"); |
226 | __func__); | ||
227 | break; | 224 | break; |
228 | } | 225 | } |
229 | 226 | ||
@@ -594,16 +591,16 @@ void ath9k_hw_reset_calvalid(struct ath_hal *ah, struct ath9k_channel *chan, | |||
594 | 591 | ||
595 | if (ichan == NULL) { | 592 | if (ichan == NULL) { |
596 | DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, | 593 | DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, |
597 | "%s: invalid channel %u/0x%x; no mapping\n", | 594 | "invalid channel %u/0x%x; no mapping\n", |
598 | __func__, chan->channel, chan->channelFlags); | 595 | chan->channel, chan->channelFlags); |
599 | return; | 596 | return; |
600 | } | 597 | } |
601 | 598 | ||
602 | 599 | ||
603 | if (currCal->calState != CAL_DONE) { | 600 | if (currCal->calState != CAL_DONE) { |
604 | DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, | 601 | DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, |
605 | "%s: Calibration state incorrect, %d\n", | 602 | "Calibration state incorrect, %d\n", |
606 | __func__, currCal->calState); | 603 | currCal->calState); |
607 | return; | 604 | return; |
608 | } | 605 | } |
609 | 606 | ||
@@ -612,8 +609,8 @@ void ath9k_hw_reset_calvalid(struct ath_hal *ah, struct ath9k_channel *chan, | |||
612 | return; | 609 | return; |
613 | 610 | ||
614 | DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, | 611 | DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, |
615 | "%s: Resetting Cal %d state for channel %u/0x%x\n", | 612 | "Resetting Cal %d state for channel %u/0x%x\n", |
616 | __func__, currCal->calData->calType, chan->channel, | 613 | currCal->calData->calType, chan->channel, |
617 | chan->channelFlags); | 614 | chan->channelFlags); |
618 | 615 | ||
619 | ichan->CalValid &= ~currCal->calData->calType; | 616 | ichan->CalValid &= ~currCal->calData->calType; |
@@ -705,8 +702,7 @@ int16_t ath9k_hw_getnf(struct ath_hal *ah, | |||
705 | chan->channelFlags &= (~CHANNEL_CW_INT); | 702 | chan->channelFlags &= (~CHANNEL_CW_INT); |
706 | if (REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF) { | 703 | if (REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF) { |
707 | DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, | 704 | DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, |
708 | "%s: NF did not complete in calibration window\n", | 705 | "NF did not complete in calibration window\n"); |
709 | __func__); | ||
710 | nf = 0; | 706 | nf = 0; |
711 | chan->rawNoiseFloor = nf; | 707 | chan->rawNoiseFloor = nf; |
712 | return chan->rawNoiseFloor; | 708 | return chan->rawNoiseFloor; |
@@ -716,8 +712,8 @@ int16_t ath9k_hw_getnf(struct ath_hal *ah, | |||
716 | if (getNoiseFloorThresh(ah, chan, &nfThresh) | 712 | if (getNoiseFloorThresh(ah, chan, &nfThresh) |
717 | && nf > nfThresh) { | 713 | && nf > nfThresh) { |
718 | DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, | 714 | DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, |
719 | "%s: noise floor failed detected; " | 715 | "noise floor failed detected; " |
720 | "detected %d, threshold %d\n", __func__, | 716 | "detected %d, threshold %d\n", |
721 | nf, nfThresh); | 717 | nf, nfThresh); |
722 | chan->channelFlags |= CHANNEL_CW_INT; | 718 | chan->channelFlags |= CHANNEL_CW_INT; |
723 | } | 719 | } |
@@ -759,9 +755,9 @@ s16 ath9k_hw_getchan_noise(struct ath_hal *ah, struct ath9k_channel *chan) | |||
759 | 755 | ||
760 | ichan = ath9k_regd_check_channel(ah, chan); | 756 | ichan = ath9k_regd_check_channel(ah, chan); |
761 | if (ichan == NULL) { | 757 | if (ichan == NULL) { |
762 | DPRINTF(ah->ah_sc, ATH_DBG_NF_CAL, | 758 | DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, |
763 | "%s: invalid channel %u/0x%x; no mapping\n", | 759 | "invalid channel %u/0x%x; no mapping\n", |
764 | __func__, chan->channel, chan->channelFlags); | 760 | chan->channel, chan->channelFlags); |
765 | return ATH_DEFAULT_NOISE_FLOOR; | 761 | return ATH_DEFAULT_NOISE_FLOOR; |
766 | } | 762 | } |
767 | if (ichan->rawNoiseFloor == 0) { | 763 | if (ichan->rawNoiseFloor == 0) { |
@@ -788,8 +784,8 @@ bool ath9k_hw_calibrate(struct ath_hal *ah, struct ath9k_channel *chan, | |||
788 | 784 | ||
789 | if (ichan == NULL) { | 785 | if (ichan == NULL) { |
790 | DPRINTF(ah->ah_sc, ATH_DBG_CHANNEL, | 786 | DPRINTF(ah->ah_sc, ATH_DBG_CHANNEL, |
791 | "%s: invalid channel %u/0x%x; no mapping\n", | 787 | "invalid channel %u/0x%x; no mapping\n", |
792 | __func__, chan->channel, chan->channelFlags); | 788 | chan->channel, chan->channelFlags); |
793 | return false; | 789 | return false; |
794 | } | 790 | } |
795 | 791 | ||
@@ -834,8 +830,8 @@ bool ath9k_hw_init_cal(struct ath_hal *ah, | |||
834 | 830 | ||
835 | if (!ath9k_hw_wait(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_CAL, 0)) { | 831 | if (!ath9k_hw_wait(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_CAL, 0)) { |
836 | DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, | 832 | DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, |
837 | "%s: offset calibration failed to complete in 1ms; " | 833 | "offset calibration failed to complete in 1ms; " |
838 | "noisy environment?\n", __func__); | 834 | "noisy environment?\n"); |
839 | return false; | 835 | return false; |
840 | } | 836 | } |
841 | 837 | ||
@@ -850,22 +846,19 @@ bool ath9k_hw_init_cal(struct ath_hal *ah, | |||
850 | INIT_CAL(&ahp->ah_adcGainCalData); | 846 | INIT_CAL(&ahp->ah_adcGainCalData); |
851 | INSERT_CAL(ahp, &ahp->ah_adcGainCalData); | 847 | INSERT_CAL(ahp, &ahp->ah_adcGainCalData); |
852 | DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, | 848 | DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, |
853 | "%s: enabling ADC Gain Calibration.\n", | 849 | "enabling ADC Gain Calibration.\n"); |
854 | __func__); | ||
855 | } | 850 | } |
856 | if (ath9k_hw_iscal_supported(ah, chan, ADC_DC_CAL)) { | 851 | if (ath9k_hw_iscal_supported(ah, chan, ADC_DC_CAL)) { |
857 | INIT_CAL(&ahp->ah_adcDcCalData); | 852 | INIT_CAL(&ahp->ah_adcDcCalData); |
858 | INSERT_CAL(ahp, &ahp->ah_adcDcCalData); | 853 | INSERT_CAL(ahp, &ahp->ah_adcDcCalData); |
859 | DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, | 854 | DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, |
860 | "%s: enabling ADC DC Calibration.\n", | 855 | "enabling ADC DC Calibration.\n"); |
861 | __func__); | ||
862 | } | 856 | } |
863 | if (ath9k_hw_iscal_supported(ah, chan, IQ_MISMATCH_CAL)) { | 857 | if (ath9k_hw_iscal_supported(ah, chan, IQ_MISMATCH_CAL)) { |
864 | INIT_CAL(&ahp->ah_iqCalData); | 858 | INIT_CAL(&ahp->ah_iqCalData); |
865 | INSERT_CAL(ahp, &ahp->ah_iqCalData); | 859 | INSERT_CAL(ahp, &ahp->ah_iqCalData); |
866 | DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, | 860 | DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, |
867 | "%s: enabling IQ Calibration.\n", | 861 | "enabling IQ Calibration.\n"); |
868 | __func__); | ||
869 | } | 862 | } |
870 | 863 | ||
871 | ahp->ah_cal_list_curr = ahp->ah_cal_list; | 864 | ahp->ah_cal_list_curr = ahp->ah_cal_list; |