1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Mon, 11 Jul 2016 11:35:20 +0200
3 Subject: [PATCH] ath9k_hw: get rid of some duplicate code in calibration
6 Remove a misleading debug message as well
8 Signed-off-by: Felix Fietkau <nbd@nbd.name>
11 --- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c
12 +++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
13 @@ -1373,6 +1373,26 @@ static void ar9003_hw_cl_cal_post_proc(s
17 +static void ar9003_hw_init_cal_common(struct ath_hw *ah)
19 + struct ath9k_hw_cal_data *caldata = ah->caldata;
21 + /* Initialize list pointers */
22 + ah->cal_list = ah->cal_list_last = ah->cal_list_curr = NULL;
24 + INIT_CAL(&ah->iq_caldata);
25 + INSERT_CAL(ah, &ah->iq_caldata);
27 + /* Initialize current pointer to first element in list */
28 + ah->cal_list_curr = ah->cal_list;
30 + if (ah->cal_list_curr)
31 + ath9k_hw_reset_calibration(ah, ah->cal_list_curr);
34 + caldata->CalValid = 0;
37 static bool ar9003_hw_init_cal_pcoem(struct ath_hw *ah,
38 struct ath9k_channel *chan)
40 @@ -1532,21 +1552,7 @@ skip_tx_iqcal:
41 /* Revert chainmask to runtime parameters */
42 ar9003_hw_set_chain_masks(ah, ah->rxchainmask, ah->txchainmask);
44 - /* Initialize list pointers */
45 - ah->cal_list = ah->cal_list_last = ah->cal_list_curr = NULL;
47 - INIT_CAL(&ah->iq_caldata);
48 - INSERT_CAL(ah, &ah->iq_caldata);
49 - ath_dbg(common, CALIBRATE, "enabling IQ Calibration\n");
51 - /* Initialize current pointer to first element in list */
52 - ah->cal_list_curr = ah->cal_list;
54 - if (ah->cal_list_curr)
55 - ath9k_hw_reset_calibration(ah, ah->cal_list_curr);
58 - caldata->CalValid = 0;
59 + ar9003_hw_init_cal_common(ah);
63 @@ -1577,8 +1583,6 @@ static bool do_ar9003_agc_cal(struct ath
64 static bool ar9003_hw_init_cal_soc(struct ath_hw *ah,
65 struct ath9k_channel *chan)
67 - struct ath_common *common = ath9k_hw_common(ah);
68 - struct ath9k_hw_cal_data *caldata = ah->caldata;
69 bool txiqcal_done = false;
71 bool run_agc_cal = false, sep_iq_cal = false;
72 @@ -1676,21 +1680,7 @@ skip_tx_iqcal:
73 /* Revert chainmask to runtime parameters */
74 ar9003_hw_set_chain_masks(ah, ah->rxchainmask, ah->txchainmask);
76 - /* Initialize list pointers */
77 - ah->cal_list = ah->cal_list_last = ah->cal_list_curr = NULL;
79 - INIT_CAL(&ah->iq_caldata);
80 - INSERT_CAL(ah, &ah->iq_caldata);
81 - ath_dbg(common, CALIBRATE, "enabling IQ Calibration\n");
83 - /* Initialize current pointer to first element in list */
84 - ah->cal_list_curr = ah->cal_list;
86 - if (ah->cal_list_curr)
87 - ath9k_hw_reset_calibration(ah, ah->cal_list_curr);
90 - caldata->CalValid = 0;
91 + ar9003_hw_init_cal_common(ah);