Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH 5/7] ath9k_hw: Add a helper to get paprd scale factor
From: Vasanthakumar Thiagarajan @ 2010-12-15 15:30 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless
In-Reply-To: <1292427053-5880-1-git-send-email-vasanth@atheros.com>

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
---
 drivers/net/wireless/ath/ath9k/ar9003_eeprom.c |   21 +++++++++++++++++++++
 drivers/net/wireless/ath/ath9k/ar9003_eeprom.h |    3 +++
 2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
index 4149ffb..9fa5793 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
@@ -4843,6 +4843,27 @@ u8 *ar9003_get_spur_chan_ptr(struct ath_hw *ah, bool is_2ghz)
 		return eep->modalHeader5G.spurChans;
 }
 
+unsigned int ar9003_get_paprd_scale_factor(struct ath_hw *ah,
+					   struct ath9k_channel *chan)
+{
+	struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep;
+
+	if (IS_CHAN_2GHZ(chan))
+		return MS(le32_to_cpu(eep->modalHeader2G.papdRateMaskHt20),
+			  AR9300_PAPRD_SCALE_1);
+	else {
+		if (chan->channel >= 5700)
+		return MS(le32_to_cpu(eep->modalHeader5G.papdRateMaskHt20),
+			  AR9300_PAPRD_SCALE_1);
+		else if (chan->channel >= 5400)
+			return MS(le32_to_cpu(eep->modalHeader5G.papdRateMaskHt40),
+				   AR9300_PAPRD_SCALE_2);
+		else
+			return MS(le32_to_cpu(eep->modalHeader5G.papdRateMaskHt40),
+				  AR9300_PAPRD_SCALE_1);
+	}
+}
+
 const struct eeprom_ops eep_ar9300_ops = {
 	.check_eeprom = ath9k_hw_ar9300_check_eeprom,
 	.get_eeprom = ath9k_hw_ar9300_get_eeprom,
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
index efb6a02..afb0b5e 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
@@ -315,4 +315,7 @@ s32 ar9003_hw_get_tx_gain_idx(struct ath_hw *ah);
 s32 ar9003_hw_get_rx_gain_idx(struct ath_hw *ah);
 
 u8 *ar9003_get_spur_chan_ptr(struct ath_hw *ah, bool is_2ghz);
+
+unsigned int ar9003_get_paprd_scale_factor(struct ath_hw *ah,
+					   struct ath9k_channel *chan);
 #endif
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH 4/7] ath9k_hw: Tx IQ cal changes for AR9003
From: Vasanthakumar Thiagarajan @ 2010-12-15 15:30 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless
In-Reply-To: <1292427053-5880-1-git-send-email-vasanth@atheros.com>

Add multiple Tx IQ cal support to improve EVM accross
different power levels.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
---
 drivers/net/wireless/ath/ath9k/ar9003_calib.c |  212 +++++++++++++------------
 1 files changed, 108 insertions(+), 104 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_calib.c b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
index 75a1c6e..4a4cd88 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
@@ -608,107 +608,6 @@ static bool ar9003_hw_calc_iq_corr(struct ath_hw *ah,
 	return true;
 }
 
-static void ar9003_hw_tx_iq_cal(struct ath_hw *ah)
-{
-	struct ath_common *common = ath9k_hw_common(ah);
-	static const u32 txiqcal_status[AR9300_MAX_CHAINS] = {
-		AR_PHY_TX_IQCAL_STATUS_B0,
-		AR_PHY_TX_IQCAL_STATUS_B1,
-		AR_PHY_TX_IQCAL_STATUS_B2,
-	};
-	static const u_int32_t chan_info_tab[] = {
-		AR_PHY_CHAN_INFO_TAB_0,
-		AR_PHY_CHAN_INFO_TAB_1,
-		AR_PHY_CHAN_INFO_TAB_2,
-	};
-	u32 tx_corr_coeff[AR9300_MAX_CHAINS];
-	s32 iq_res[6];
-	s32 iqc_coeff[2];
-	s32 i, j;
-	u32 num_chains = 0;
-
-	tx_corr_coeff[0] = AR_PHY_TX_IQCAL_CORR_COEFF_B0(0);
-	tx_corr_coeff[1] = AR_PHY_TX_IQCAL_CORR_COEFF_B1(0);
-	tx_corr_coeff[2] = AR_PHY_TX_IQCAL_CORR_COEFF_B2(0);
-
-	for (i = 0; i < AR9300_MAX_CHAINS; i++) {
-		if (ah->txchainmask & (1 << i))
-			num_chains++;
-	}
-
-	REG_RMW_FIELD(ah, AR_PHY_TX_IQCAL_CONTROL_1,
-		      AR_PHY_TX_IQCAQL_CONTROL_1_IQCORR_I_Q_COFF_DELPT,
-		      DELPT);
-	REG_RMW_FIELD(ah, AR_PHY_TX_IQCAL_START,
-		      AR_PHY_TX_IQCAL_START_DO_CAL,
-		      AR_PHY_TX_IQCAL_START_DO_CAL);
-
-	if (!ath9k_hw_wait(ah, AR_PHY_TX_IQCAL_START,
-			   AR_PHY_TX_IQCAL_START_DO_CAL,
-			   0, AH_WAIT_TIMEOUT)) {
-		ath_dbg(common, ATH_DBG_CALIBRATE,
-			"Tx IQ Cal not complete.\n");
-		goto TX_IQ_CAL_FAILED;
-	}
-
-	for (i = 0; i < num_chains; i++) {
-		ath_dbg(common, ATH_DBG_CALIBRATE,
-			"Doing Tx IQ Cal for chain %d.\n", i);
-
-		if (REG_READ(ah, txiqcal_status[i]) &
-			     AR_PHY_TX_IQCAL_STATUS_FAILED) {
-			ath_dbg(common, ATH_DBG_CALIBRATE,
-				"Tx IQ Cal failed for chain %d.\n", i);
-			goto TX_IQ_CAL_FAILED;
-		}
-
-		for (j = 0; j < 3; j++) {
-			u_int8_t idx = 2 * j,
-			offset = 4 * j;
-
-			REG_RMW_FIELD(ah, AR_PHY_CHAN_INFO_MEMORY,
-				      AR_PHY_CHAN_INFO_TAB_S2_READ, 0);
-
-			/* 32 bits */
-			iq_res[idx] = REG_READ(ah, chan_info_tab[i] + offset);
-
-			REG_RMW_FIELD(ah, AR_PHY_CHAN_INFO_MEMORY,
-				      AR_PHY_CHAN_INFO_TAB_S2_READ, 1);
-
-			/* 16 bits */
-			iq_res[idx+1] = 0xffff & REG_READ(ah,
-							  chan_info_tab[i] +
-							  offset);
-
-			ath_dbg(common, ATH_DBG_CALIBRATE,
-				"IQ RES[%d]=0x%x IQ_RES[%d]=0x%x\n",
-				idx, iq_res[idx], idx+1, iq_res[idx+1]);
-		}
-
-		if (!ar9003_hw_calc_iq_corr(ah, i, iq_res, iqc_coeff)) {
-			ath_dbg(common, ATH_DBG_CALIBRATE,
-				"Failed in calculation of IQ correction.\n");
-			goto TX_IQ_CAL_FAILED;
-		}
-
-		ath_dbg(common, ATH_DBG_CALIBRATE,
-			"IQ_COEFF[0] = 0x%x IQ_COEFF[1] = 0x%x\n",
-			iqc_coeff[0], iqc_coeff[1]);
-
-		REG_RMW_FIELD(ah, tx_corr_coeff[i],
-			      AR_PHY_TX_IQCAL_CORR_COEFF_01_COEFF_TABLE,
-			      iqc_coeff[0]);
-	}
-
-	REG_RMW_FIELD(ah, AR_PHY_TX_IQCAL_CONTROL_3,
-		      AR_PHY_TX_IQCAL_CONTROL_3_IQCORR_EN, 0x1);
-
-	return;
-
-TX_IQ_CAL_FAILED:
-	ath_dbg(common, ATH_DBG_CALIBRATE, "Tx IQ Cal failed\n");
-}
-
 static bool ar9003_hw_compute_closest_pass_and_avg(int *mp_coeff, int *mp_avg)
 {
 	int diff[MPASS];
@@ -717,9 +616,9 @@ static bool ar9003_hw_compute_closest_pass_and_avg(int *mp_coeff, int *mp_avg)
 	diff[1] = abs(mp_coeff[1] - mp_coeff[2]);
 	diff[2] = abs(mp_coeff[2] - mp_coeff[0]);
 
-	if (diff[0] > MAX_MEASUREMENT &&
-	    diff[1] > MAX_MEASUREMENT &&
-	    diff[2] > MAX_MEASUREMENT)
+	if (diff[0] > MAX_DIFFERENCE &&
+	    diff[1] > MAX_DIFFERENCE &&
+	    diff[2] > MAX_DIFFERENCE)
 		return false;
 
 	if (diff[0] <= diff[1] && diff[0] <= diff[2])
@@ -817,6 +716,111 @@ disable_txiqcal:
 	ath_dbg(common, ATH_DBG_CALIBRATE, "TX IQ Cal disabled\n");
 }
 
+static void ar9003_hw_tx_iq_cal(struct ath_hw *ah)
+{
+	struct ath_common *common = ath9k_hw_common(ah);
+	static const u32 txiqcal_status[AR9300_MAX_CHAINS] = {
+		AR_PHY_TX_IQCAL_STATUS_B0,
+		AR_PHY_TX_IQCAL_STATUS_B1,
+		AR_PHY_TX_IQCAL_STATUS_B2,
+	};
+	static const u32 chan_info_tab[] = {
+		AR_PHY_CHAN_INFO_TAB_0,
+		AR_PHY_CHAN_INFO_TAB_1,
+		AR_PHY_CHAN_INFO_TAB_2,
+	};
+	struct coeff coeff;
+	s32 iq_res[6];
+	s32 i, j, ip, im, nmeasurement;
+	u8 nchains = get_streams(common->tx_chainmask);
+
+	for (ip = 0; ip < MPASS; ip++) {
+		REG_RMW_FIELD(ah, AR_PHY_TX_IQCAL_CONTROL_1,
+			      AR_PHY_TX_IQCAQL_CONTROL_1_IQCORR_I_Q_COFF_DELPT,
+			      DELPT);
+		REG_RMW_FIELD(ah, AR_PHY_TX_IQCAL_START,
+			      AR_PHY_TX_IQCAL_START_DO_CAL,
+			      AR_PHY_TX_IQCAL_START_DO_CAL);
+
+		if (!ath9k_hw_wait(ah, AR_PHY_TX_IQCAL_START,
+				   AR_PHY_TX_IQCAL_START_DO_CAL,
+				   0, AH_WAIT_TIMEOUT)) {
+			ath_dbg(common, ATH_DBG_CALIBRATE,
+				"Tx IQ Cal not complete.\n");
+			goto TX_IQ_CAL_FAILED;
+		}
+
+		nmeasurement = REG_READ_FIELD(ah, AR_PHY_TX_IQCAL_STATUS_B0,
+					      AR_PHY_CALIBRATED_GAINS_0);
+			if (nmeasurement > MAX_MEASUREMENT)
+				nmeasurement = MAX_MEASUREMENT;
+
+		for (i = 0; i < nchains; i++) {
+			ath_dbg(common, ATH_DBG_CALIBRATE,
+				"Doing Tx IQ Cal for chain %d.\n", i);
+			for (im = 0; im < nmeasurement; im++) {
+				if (REG_READ(ah, txiqcal_status[i]) &
+					     AR_PHY_TX_IQCAL_STATUS_FAILED) {
+					ath_dbg(common, ATH_DBG_CALIBRATE,
+						"Tx IQ Cal failed for chain %d.\n", i);
+					goto TX_IQ_CAL_FAILED;
+				}
+
+				for (j = 0; j < 3; j++) {
+					u8 idx = 2 * j,
+					   offset = 4 * (3 * im + j);
+
+					REG_RMW_FIELD(ah, AR_PHY_CHAN_INFO_MEMORY,
+						      AR_PHY_CHAN_INFO_TAB_S2_READ,
+						      0);
+
+					/* 32 bits */
+					iq_res[idx] = REG_READ(ah,
+							chan_info_tab[i] +
+							offset);
+
+					REG_RMW_FIELD(ah, AR_PHY_CHAN_INFO_MEMORY,
+						      AR_PHY_CHAN_INFO_TAB_S2_READ,
+						      1);
+
+					/* 16 bits */
+					iq_res[idx+1] = 0xffff & REG_READ(ah,
+								chan_info_tab[i] +
+								offset);
+
+					ath_dbg(common, ATH_DBG_CALIBRATE,
+						"IQ RES[%d]=0x%x IQ_RES[%d]=0x%x\n",
+						idx, iq_res[idx], idx+1, iq_res[idx+1]);
+				}
+
+				if (!ar9003_hw_calc_iq_corr(ah, i, iq_res,
+							    coeff.iqc_coeff)) {
+					ath_dbg(common, ATH_DBG_CALIBRATE,
+						"Failed in calculation of IQ correction.\n");
+					goto TX_IQ_CAL_FAILED;
+				}
+				coeff.mag_coeff[i][im][ip] =
+						coeff.iqc_coeff[0] & 0x7f;
+				coeff.phs_coeff[i][im][ip] =
+						(coeff.iqc_coeff[0] >> 7) & 0x7f;
+
+				if (coeff.mag_coeff[i][im][ip] > 63)
+					coeff.mag_coeff[i][im][ip] -= 128;
+				if (coeff.phs_coeff[i][im][ip] > 63)
+					coeff.phs_coeff[i][im][ip] -= 128;
+
+			}
+		}
+	}
+
+	ar9003_hw_tx_iqcal_load_avg_2_passes(ah, nchains, &coeff);
+
+	return;
+
+TX_IQ_CAL_FAILED:
+	ath_dbg(common, ATH_DBG_CALIBRATE, "Tx IQ Cal failed\n");
+}
+
 static void ar9003_hw_tx_iq_cal_run(struct ath_hw *ah)
 {
 	u8 tx_gain_forced;
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH 3/7] ath9k_hw: Move get_streams() to hw.h
From: Vasanthakumar Thiagarajan @ 2010-12-15 15:30 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless
In-Reply-To: <1292427053-5880-1-git-send-email-vasanth@atheros.com>

This helper can be used in multiple places. Also make
it inline returning u8.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
---
 drivers/net/wireless/ath/ath9k/ar9003_paprd.c |    5 -----
 drivers/net/wireless/ath/ath9k/hw.h           |    5 +++++
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
index 69f7792..4c74479 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
@@ -50,11 +50,6 @@ static int ar9003_get_training_power_2g(struct ath_hw *ah)
 	return power;
 }
 
-static int get_streams(int mask)
-{
-	return !!(mask & BIT(0)) + !!(mask & BIT(1)) + !!(mask & BIT(2));
-}
-
 static int ar9003_get_training_power_5g(struct ath_hw *ah)
 {
 	struct ath_common *common = ath9k_hw_common(ah);
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 97f22c4..fb64ab8 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -868,6 +868,11 @@ static inline struct ath_hw_ops *ath9k_hw_ops(struct ath_hw *ah)
 	return &ah->ops;
 }
 
+static inline u8 get_streams(int mask)
+{
+	return !!(mask & BIT(0)) + !!(mask & BIT(1)) + !!(mask & BIT(2));
+}
+
 /* Initialization, Detach, Reset */
 const char *ath9k_hw_probe(u16 vendorid, u16 devid);
 void ath9k_hw_deinit(struct ath_hw *ah);
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH 2/7] ath9k_hw: Remove unnecessary Rx IQ cal register configuration in ar9003_hw_tx_iq_cal()
From: Vasanthakumar Thiagarajan @ 2010-12-15 15:30 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless
In-Reply-To: <1292427053-5880-1-git-send-email-vasanth@atheros.com>

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
---
 drivers/net/wireless/ath/ath9k/ar9003_calib.c |   13 -------------
 1 files changed, 0 insertions(+), 13 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_calib.c b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
index 7c3334b..75a1c6e 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
@@ -616,11 +616,6 @@ static void ar9003_hw_tx_iq_cal(struct ath_hw *ah)
 		AR_PHY_TX_IQCAL_STATUS_B1,
 		AR_PHY_TX_IQCAL_STATUS_B2,
 	};
-	static const u32 rx_corr[AR9300_MAX_CHAINS] = {
-		AR_PHY_RX_IQCAL_CORR_B0,
-		AR_PHY_RX_IQCAL_CORR_B1,
-		AR_PHY_RX_IQCAL_CORR_B2,
-	};
 	static const u_int32_t chan_info_tab[] = {
 		AR_PHY_CHAN_INFO_TAB_0,
 		AR_PHY_CHAN_INFO_TAB_1,
@@ -703,18 +698,10 @@ static void ar9003_hw_tx_iq_cal(struct ath_hw *ah)
 		REG_RMW_FIELD(ah, tx_corr_coeff[i],
 			      AR_PHY_TX_IQCAL_CORR_COEFF_01_COEFF_TABLE,
 			      iqc_coeff[0]);
-		REG_RMW_FIELD(ah, rx_corr[i],
-			      AR_PHY_RX_IQCAL_CORR_LOOPBACK_IQCORR_Q_Q_COFF,
-			      iqc_coeff[1] >> 7);
-		REG_RMW_FIELD(ah, rx_corr[i],
-			      AR_PHY_RX_IQCAL_CORR_LOOPBACK_IQCORR_Q_I_COFF,
-			      iqc_coeff[1]);
 	}
 
 	REG_RMW_FIELD(ah, AR_PHY_TX_IQCAL_CONTROL_3,
 		      AR_PHY_TX_IQCAL_CONTROL_3_IQCORR_EN, 0x1);
-	REG_RMW_FIELD(ah, AR_PHY_RX_IQCAL_CORR_B0,
-		      AR_PHY_RX_IQCAL_CORR_B0_LOOPBACK_IQCORR_EN, 0x1);
 
 	return;
 
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH 1/7] ath9k_hw: Remove delay during regwrite of analog shift registers
From: Vasanthakumar Thiagarajan @ 2010-12-15 15:30 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless

This is not needed for AR9003.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
---
 drivers/net/wireless/ath/ath9k/ar9003_phy.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
index da4a571..07b44ce 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
@@ -578,10 +578,7 @@ static void ar9003_hw_prog_ini(struct ath_hw *ah,
 		u32 reg = INI_RA(iniArr, i, 0);
 		u32 val = INI_RA(iniArr, i, column);
 
-		if (reg >= 0x16000 && reg < 0x17000)
-			ath9k_hw_analog_shift_regwrite(ah, reg, val);
-		else
-			REG_WRITE(ah, reg, val);
+		REG_WRITE(ah, reg, val);
 
 		DO_DELAY(regWrites);
 	}
-- 
1.7.0.4


^ permalink raw reply related

* Re: [PATCH v2] wl12xx_sdio_test: rename files to match current style
From: Roger Quadros @ 2010-12-15 15:16 UTC (permalink / raw)
  To: Luciano Coelho; +Cc: linux-wireless
In-Reply-To: <1292424501.32385.10.camel@chilepepper>

On 12/15/2010 04:48 PM, Luciano Coelho wrote:
> On Wed, 2010-12-15 at 16:33 +0200, ext Luciano Coelho wrote:
>> On Wed, 2010-12-15 at 16:31 +0200, luciano.coelho@nokia.com wrote:
>>> From: Luciano Coelho<luciano.coelho@nokia.com>
>>>
>>> Change some file names and Kconfig settings so that this new module matches
>>> the new way of using wl12xx instead of wl1271.
>>>
>>> Also fix SDIO power enabling and disabling to match the latest way of doing
>>> it.
>>>
>>> Cc: Roger Quadros<roger.quadros@nokia.com>
>>> Signed-off-by: Luciano Coelho<luciano.coelho@nokia.com>
>>> ---
>>
>> In v2 I used the -M flag (to detect renames, which I stupidly forgot
>> before) and removed the file names from the header of the sdio_test.c
>> file, since it's a bad idea to have it there (thanks Johannes for the
>> comments).
>
> Roger, I have just compile-tested this module in upstream.  Could you
> run at least some basic tests with it to make sure it works?
>
>

Luca,

I don't have a ready setup with me which boots mainline kernel and has wl1271 on 
sdio.

The only way to verify it is to load the module with the parameters rx=1 and 
tx=1 and see if the "testing started" message appears.

what platform do you use to verify with mainline kernel & sdio wl1271 ?

-- 
regards,
-roger

^ permalink raw reply

* Re: [PATCH v2] wl12xx_sdio_test: rename files to match current style
From: Luciano Coelho @ 2010-12-15 15:10 UTC (permalink / raw)
  To: linux-wireless; +Cc: Roger Quadros
In-Reply-To: <1292423499-5667-1-git-send-email-luciano.coelho@nokia.com>

On Wed, 2010-12-15 at 16:31 +0200, luciano.coelho@nokia.com wrote:
> From: Luciano Coelho <luciano.coelho@nokia.com>
> 
> Change some file names and Kconfig settings so that this new module matches
> the new way of using wl12xx instead of wl1271.
> 
> Also fix SDIO power enabling and disabling to match the latest way of doing
> it.
> 
> Cc: Roger Quadros <roger.quadros@nokia.com>
> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
> ---

Applied.


-- 
Cheers,
Luca.


^ permalink raw reply

* Re: pull request: wl12xx 2010-12-15
From: Luciano Coelho @ 2010-12-15 15:07 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless@vger.kernel.org
In-Reply-To: <1292425368.32385.14.camel@chilepepper>

On Wed, 2010-12-15 at 17:02 +0200, ext Luciano Coelho wrote:
> Hi John,
> 
> This pull-request contains some improvements and bug fixes for the wl12xx driver.
> 
> Please pull or let me know if there's any problem.  This tree is based
> on wireless-next/master.
> 
> Don't know if there is still time to include these patches for 2.6.38,
> since it's kind of late already, but I didn't see any email from you
> saying "stop now!" either. ;)
> 
> Thanks!

Ahmmm... please ignore this pull for now.  I need to add one more patch
that I just created to fix a compilation problem with this new sdio_test
thingy.  I'll send v2 shortly.

-- 
Cheers,
Luca.


^ permalink raw reply

* pull request: wl12xx 2010-12-15
From: Luciano Coelho @ 2010-12-15 15:02 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless@vger.kernel.org

Hi John,

This pull-request contains some improvements and bug fixes for the wl12xx driver.

Please pull or let me know if there's any problem.  This tree is based
on wireless-next/master.

Don't know if there is still time to include these patches for 2.6.38,
since it's kind of late already, but I didn't see any email from you
saying "stop now!" either. ;)

Thanks!

The following changes since commit 412b31334b831a8c2909afaca017c5a236ac2dd0:
  Wolfgang Kufner (1):
        rt2x00: Fix firmware loading regression on x86_64.

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/luca/wl12xx.git wl12xx-next

Eliad Peller (4):
      wl1271: use debugfs_remove_recursive
      wl1271: move wl12xx debugfs directory to under wiphy's debugfs
      wl12xx: add auto-arp support
      wl12xx: allow runtime changing of debug_level

Guy Eilam (1):
      wl1271: fixed problem with WPS IEs in probe requests

Juuso Oikarinen (4):
      wl12xx: Fix kernel crash related to hw recovery and interface shutdown
      wl1271: Fix setting of the hardware connection monitoring probe-req template
      wl12xx: Remove 11j channels from the supported channels list.
      wl12xx: Change TX queue to be per AC

Luciano Coelho (3):
      wl12xx: disable 11a channels when regulatory changes if 11a is not supported
      wl12xx: fix illegal memset if debugfs is not enabled
      wl12xx: disable 11a channels when wl->enable_11a is known

Roger Quadros (2):
      wl1271: Add wl1271_load_firmware() and export some functions
      wl1271_sdio_test: Add module for sdio RX/TX testing

 drivers/net/wireless/wl12xx/Kconfig            |    8 +
 drivers/net/wireless/wl12xx/Makefile           |    2 +
 drivers/net/wireless/wl12xx/acx.c              |    4 +-
 drivers/net/wireless/wl12xx/acx.h              |    9 +-
 drivers/net/wireless/wl12xx/boot.c             |   17 +-
 drivers/net/wireless/wl12xx/boot.h             |    1 +
 drivers/net/wireless/wl12xx/cmd.c              |   69 ++++
 drivers/net/wireless/wl12xx/cmd.h              |    4 +
 drivers/net/wireless/wl12xx/debugfs.c          |  192 ++-------
 drivers/net/wireless/wl12xx/init.c             |   13 +-
 drivers/net/wireless/wl12xx/io.c               |    1 +
 drivers/net/wireless/wl12xx/main.c             |  119 ++++--
 drivers/net/wireless/wl12xx/scan.c             |    4 +
 drivers/net/wireless/wl12xx/tx.c               |   60 +++-
 drivers/net/wireless/wl12xx/wl1271_sdio_test.c |  510 ++++++++++++++++++++++++
 drivers/net/wireless/wl12xx/wl12xx.h           |  129 +------
 drivers/net/wireless/wl12xx/wl12xx_80211.h     |   17 +-
 17 files changed, 835 insertions(+), 324 deletions(-)
 create mode 100644 drivers/net/wireless/wl12xx/wl1271_sdio_test.c


-- 
Cheers,
Luca.



^ permalink raw reply

* Re: [PATCH v2] wl12xx_sdio_test: rename files to match current style
From: Luciano Coelho @ 2010-12-15 14:48 UTC (permalink / raw)
  To: Roger Quadros; +Cc: linux-wireless
In-Reply-To: <1292423633.32385.9.camel@chilepepper>

On Wed, 2010-12-15 at 16:33 +0200, ext Luciano Coelho wrote:
> On Wed, 2010-12-15 at 16:31 +0200, luciano.coelho@nokia.com wrote:
> > From: Luciano Coelho <luciano.coelho@nokia.com>
> > 
> > Change some file names and Kconfig settings so that this new module matches
> > the new way of using wl12xx instead of wl1271.
> > 
> > Also fix SDIO power enabling and disabling to match the latest way of doing
> > it.
> > 
> > Cc: Roger Quadros <roger.quadros@nokia.com>
> > Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
> > ---
> 
> In v2 I used the -M flag (to detect renames, which I stupidly forgot
> before) and removed the file names from the header of the sdio_test.c
> file, since it's a bad idea to have it there (thanks Johannes for the
> comments).

Roger, I have just compile-tested this module in upstream.  Could you
run at least some basic tests with it to make sure it works?


-- 
Cheers,
Luca.


^ permalink raw reply

* Re: [PATCH v2] wl12xx_sdio_test: rename files to match current style
From: Luciano Coelho @ 2010-12-15 14:33 UTC (permalink / raw)
  To: linux-wireless; +Cc: Roger Quadros
In-Reply-To: <1292423499-5667-1-git-send-email-luciano.coelho@nokia.com>

On Wed, 2010-12-15 at 16:31 +0200, luciano.coelho@nokia.com wrote:
> From: Luciano Coelho <luciano.coelho@nokia.com>
> 
> Change some file names and Kconfig settings so that this new module matches
> the new way of using wl12xx instead of wl1271.
> 
> Also fix SDIO power enabling and disabling to match the latest way of doing
> it.
> 
> Cc: Roger Quadros <roger.quadros@nokia.com>
> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
> ---

In v2 I used the -M flag (to detect renames, which I stupidly forgot
before) and removed the file names from the header of the sdio_test.c
file, since it's a bad idea to have it there (thanks Johannes for the
comments).

-- 
Cheers,
Luca.


^ permalink raw reply

* [PATCH v2] wl12xx_sdio_test: rename files to match current style
From: luciano.coelho @ 2010-12-15 14:31 UTC (permalink / raw)
  To: linux-wireless; +Cc: Luciano Coelho, Roger Quadros

From: Luciano Coelho <luciano.coelho@nokia.com>

Change some file names and Kconfig settings so that this new module matches
the new way of using wl12xx instead of wl1271.

Also fix SDIO power enabling and disabling to match the latest way of doing
it.

Cc: Roger Quadros <roger.quadros@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
---
 drivers/net/wireless/wl12xx/Kconfig                |   12 +++++---
 drivers/net/wireless/wl12xx/Makefile               |    3 +-
 .../wl12xx/{wl1271_sdio_test.c => sdio_test.c}     |   28 +++++++++++++------
 3 files changed, 28 insertions(+), 15 deletions(-)
 rename drivers/net/wireless/wl12xx/{wl1271_sdio_test.c => sdio_test.c} (96%)

diff --git a/drivers/net/wireless/wl12xx/Kconfig b/drivers/net/wireless/wl12xx/Kconfig
index 085bc44..0e65bce 100644
--- a/drivers/net/wireless/wl12xx/Kconfig
+++ b/drivers/net/wireless/wl12xx/Kconfig
@@ -52,13 +52,15 @@ config WL12XX_SDIO
 	  If you choose to build a module, it'll be called wl12xx_sdio.
 	  Say N if unsure.
 
-config WL1271_SDIO_TEST
-	tristate "TI wl1271 SDIO testing support"
-	depends on WL1271 && MMC
+config WL12XX_SDIO_TEST
+	tristate "TI wl12xx SDIO testing support"
+	depends on WL12XX && MMC
+	default n
 	---help---
 	  This module adds support for the SDIO bus testing with the
-	  TI wl1271 chipset.  Select this if your platform is using
-	  the SDIO bus.
+	  TI wl12xx chipsets.  You probably don't want this unless you are
+	  testing a new hardware platform.  Select this if you want to test the
+	  SDIO bus which is connected to the wl12xx chip.
 
 config WL12XX_PLATFORM_DATA
 	bool
diff --git a/drivers/net/wireless/wl12xx/Makefile b/drivers/net/wireless/wl12xx/Makefile
index 1876785..521c041 100644
--- a/drivers/net/wireless/wl12xx/Makefile
+++ b/drivers/net/wireless/wl12xx/Makefile
@@ -3,13 +3,14 @@ wl12xx-objs		= main.o cmd.o io.o event.o tx.o rx.o ps.o acx.o \
 
 wl12xx_spi-objs	= spi.o
 wl12xx_sdio-objs	= sdio.o
+wl12xx_sdio_test-objs = sdio_test.o
 
 wl12xx-$(CONFIG_NL80211_TESTMODE)	+= testmode.o
 obj-$(CONFIG_WL12XX)			+= wl12xx.o
 obj-$(CONFIG_WL12XX_SPI)		+= wl12xx_spi.o
 obj-$(CONFIG_WL12XX_SDIO)		+= wl12xx_sdio.o
 
-obj-$(CONFIG_WL1271_SDIO_TEST)	+= wl1271_sdio_test.o
+obj-$(CONFIG_WL12XX_SDIO_TEST)	+= wl12xx_sdio_test.o
 
 # small builtin driver bit
 obj-$(CONFIG_WL12XX_PLATFORM_DATA)	+= wl12xx_platform_data.o
diff --git a/drivers/net/wireless/wl12xx/wl1271_sdio_test.c b/drivers/net/wireless/wl12xx/sdio_test.c
similarity index 96%
rename from drivers/net/wireless/wl12xx/wl1271_sdio_test.c
rename to drivers/net/wireless/wl12xx/sdio_test.c
index 42d1314..9fcbd3d 100644
--- a/drivers/net/wireless/wl12xx/wl1271_sdio_test.c
+++ b/drivers/net/wireless/wl12xx/sdio_test.c
@@ -1,11 +1,11 @@
 /*
- * wl1271_sdio_test.c - SDIO testing driver for wl1271
+ * SDIO testing driver for wl12xx
  *
  * Copyright (C) 2010 Nokia Corporation
  *
  * Contact: Roger Quadros <roger.quadros@nokia.com>
  *
- * wl1271 read/write routines taken from wl1271_sdio.c
+ * wl12xx read/write routines taken from the main module
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -34,10 +34,11 @@
 #include <linux/wl12xx.h>
 #include <linux/kthread.h>
 #include <linux/firmware.h>
+#include <linux/pm_runtime.h>
 
-#include "wl1271.h"
-#include "wl1271_io.h"
-#include "wl1271_boot.h"
+#include "wl12xx.h"
+#include "io.h"
+#include "boot.h"
 
 #ifndef SDIO_VENDOR_ID_TI
 #define SDIO_VENDOR_ID_TI		0x0097
@@ -130,22 +131,31 @@ static void wl1271_sdio_raw_write(struct wl1271 *wl, int addr, void *buf,
 static int wl1271_sdio_set_power(struct wl1271 *wl, bool enable)
 {
 	struct sdio_func *func = wl_to_func(wl);
+	int ret;
 
 	/* Let the SDIO stack handle wlan_enable control, so we
 	 * keep host claimed while wlan is in use to keep wl1271
 	 * alive.
 	 */
 	if (enable) {
-		sdio_claim_power(func);
+		/* Power up the card */
+		ret = pm_runtime_get_sync(&func->dev);
+		if (ret < 0)
+			goto out;
 		sdio_claim_host(func);
 		sdio_enable_func(func);
+		sdio_release_host(func);
 	} else {
+		sdio_claim_host(func);
 		sdio_disable_func(func);
 		sdio_release_host(func);
-		sdio_release_power(func);
+
+		/* Power down the card */
+		ret = pm_runtime_put_sync(&func->dev);
 	}
 
-	return 0;
+out:
+	return ret;
 }
 
 static void wl1271_sdio_disable_interrupts(struct wl1271 *wl)
@@ -481,7 +491,7 @@ static void __devexit wl1271_remove(struct sdio_func *func)
 }
 
 static struct sdio_driver wl1271_sdio_driver = {
-	.name		= "wl1271_sdio_test",
+	.name		= "wl12xx_sdio_test",
 	.id_table	= wl1271_devices,
 	.probe		= wl1271_probe,
 	.remove		= __devexit_p(wl1271_remove),
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH] wl12xx_sdio_test: rename files to match current style
From: luciano.coelho @ 2010-12-15 14:23 UTC (permalink / raw)
  To: linux-wireless; +Cc: Luciano Coelho, Roger Quadros

From: Luciano Coelho <luciano.coelho@nokia.com>

Change some file names and Kconfig settings so that this new module matches
the new way of using wl12xx instead of wl1271.

Also fix SDIO power enabling and disabling to match the latest way of doing
it.

Cc: Roger Quadros <roger.quadros@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
---
 drivers/net/wireless/wl12xx/Kconfig            |   12 +-
 drivers/net/wireless/wl12xx/Makefile           |    3 +-
 drivers/net/wireless/wl12xx/sdio_test.c        |  520 ++++++++++++++++++++++++
 drivers/net/wireless/wl12xx/wl1271_sdio_test.c |  510 -----------------------
 4 files changed, 529 insertions(+), 516 deletions(-)
 create mode 100644 drivers/net/wireless/wl12xx/sdio_test.c
 delete mode 100644 drivers/net/wireless/wl12xx/wl1271_sdio_test.c

diff --git a/drivers/net/wireless/wl12xx/Kconfig b/drivers/net/wireless/wl12xx/Kconfig
index 085bc44..0e65bce 100644
--- a/drivers/net/wireless/wl12xx/Kconfig
+++ b/drivers/net/wireless/wl12xx/Kconfig
@@ -52,13 +52,15 @@ config WL12XX_SDIO
 	  If you choose to build a module, it'll be called wl12xx_sdio.
 	  Say N if unsure.
 
-config WL1271_SDIO_TEST
-	tristate "TI wl1271 SDIO testing support"
-	depends on WL1271 && MMC
+config WL12XX_SDIO_TEST
+	tristate "TI wl12xx SDIO testing support"
+	depends on WL12XX && MMC
+	default n
 	---help---
 	  This module adds support for the SDIO bus testing with the
-	  TI wl1271 chipset.  Select this if your platform is using
-	  the SDIO bus.
+	  TI wl12xx chipsets.  You probably don't want this unless you are
+	  testing a new hardware platform.  Select this if you want to test the
+	  SDIO bus which is connected to the wl12xx chip.
 
 config WL12XX_PLATFORM_DATA
 	bool
diff --git a/drivers/net/wireless/wl12xx/Makefile b/drivers/net/wireless/wl12xx/Makefile
index 1876785..521c041 100644
--- a/drivers/net/wireless/wl12xx/Makefile
+++ b/drivers/net/wireless/wl12xx/Makefile
@@ -3,13 +3,14 @@ wl12xx-objs		= main.o cmd.o io.o event.o tx.o rx.o ps.o acx.o \
 
 wl12xx_spi-objs	= spi.o
 wl12xx_sdio-objs	= sdio.o
+wl12xx_sdio_test-objs = sdio_test.o
 
 wl12xx-$(CONFIG_NL80211_TESTMODE)	+= testmode.o
 obj-$(CONFIG_WL12XX)			+= wl12xx.o
 obj-$(CONFIG_WL12XX_SPI)		+= wl12xx_spi.o
 obj-$(CONFIG_WL12XX_SDIO)		+= wl12xx_sdio.o
 
-obj-$(CONFIG_WL1271_SDIO_TEST)	+= wl1271_sdio_test.o
+obj-$(CONFIG_WL12XX_SDIO_TEST)	+= wl12xx_sdio_test.o
 
 # small builtin driver bit
 obj-$(CONFIG_WL12XX_PLATFORM_DATA)	+= wl12xx_platform_data.o
diff --git a/drivers/net/wireless/wl12xx/sdio_test.c b/drivers/net/wireless/wl12xx/sdio_test.c
new file mode 100644
index 0000000..9475396
--- /dev/null
+++ b/drivers/net/wireless/wl12xx/sdio_test.c
@@ -0,0 +1,520 @@
+/*
+ * wl12xx_sdio_test.c - SDIO testing driver for wl12xx
+ *
+ * Copyright (C) 2010 Nokia Corporation
+ *
+ * Contact: Roger Quadros <roger.quadros@nokia.com>
+ *
+ * wl12xx read/write routines taken from wl12xx_sdio.c
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#include <linux/irq.h>
+#include <linux/module.h>
+#include <linux/crc7.h>
+#include <linux/vmalloc.h>
+#include <linux/mmc/sdio_func.h>
+#include <linux/mmc/sdio_ids.h>
+#include <linux/mmc/card.h>
+#include <linux/gpio.h>
+#include <linux/wl12xx.h>
+#include <linux/kthread.h>
+#include <linux/firmware.h>
+#include <linux/pm_runtime.h>
+
+#include "wl12xx.h"
+#include "io.h"
+#include "boot.h"
+
+#ifndef SDIO_VENDOR_ID_TI
+#define SDIO_VENDOR_ID_TI		0x0097
+#endif
+
+#ifndef SDIO_DEVICE_ID_TI_WL1271
+#define SDIO_DEVICE_ID_TI_WL1271	0x4076
+#endif
+
+static bool rx, tx;
+
+module_param(rx, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(rx, "Perform rx test. Default (0). "
+	"This test continuously reads data from the SDIO device.\n");
+
+module_param(tx, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(tx, "Perform tx test. Default (0). "
+	"This test continuously writes data to the SDIO device.\n");
+
+struct wl1271_test {
+	struct wl1271 wl;
+	struct task_struct *test_task;
+};
+
+static const struct sdio_device_id wl1271_devices[] = {
+	{ SDIO_DEVICE(SDIO_VENDOR_ID_TI, SDIO_DEVICE_ID_TI_WL1271) },
+	{}
+};
+
+static inline struct sdio_func *wl_to_func(struct wl1271 *wl)
+{
+	return wl->if_priv;
+}
+
+static struct device *wl1271_sdio_wl_to_dev(struct wl1271 *wl)
+{
+	return &(wl_to_func(wl)->dev);
+}
+
+static void wl1271_sdio_raw_read(struct wl1271 *wl, int addr, void *buf,
+		size_t len, bool fixed)
+{
+	int ret = 0;
+	struct sdio_func *func = wl_to_func(wl);
+
+	if (unlikely(addr == HW_ACCESS_ELP_CTRL_REG_ADDR)) {
+		((u8 *)buf)[0] = sdio_f0_readb(func, addr, &ret);
+		wl1271_debug(DEBUG_SDIO, "sdio read 52 addr 0x%x, byte 0x%02x",
+				addr, ((u8 *)buf)[0]);
+	} else {
+		if (fixed)
+			ret = sdio_readsb(func, buf, addr, len);
+		else
+			ret = sdio_memcpy_fromio(func, buf, addr, len);
+
+		wl1271_debug(DEBUG_SDIO, "sdio read 53 addr 0x%x, %zu bytes",
+				addr, len);
+		wl1271_dump_ascii(DEBUG_SDIO, "data: ", buf, len);
+	}
+
+	if (ret)
+		wl1271_error("sdio read failed (%d)", ret);
+}
+
+static void wl1271_sdio_raw_write(struct wl1271 *wl, int addr, void *buf,
+		size_t len, bool fixed)
+{
+	int ret = 0;
+	struct sdio_func *func = wl_to_func(wl);
+
+	if (unlikely(addr == HW_ACCESS_ELP_CTRL_REG_ADDR)) {
+		sdio_f0_writeb(func, ((u8 *)buf)[0], addr, &ret);
+		wl1271_debug(DEBUG_SDIO, "sdio write 52 addr 0x%x, byte 0x%02x",
+				addr, ((u8 *)buf)[0]);
+	} else {
+		wl1271_debug(DEBUG_SDIO, "sdio write 53 addr 0x%x, %zu bytes",
+				addr, len);
+		wl1271_dump_ascii(DEBUG_SDIO, "data: ", buf, len);
+
+		if (fixed)
+			ret = sdio_writesb(func, addr, buf, len);
+		else
+			ret = sdio_memcpy_toio(func, addr, buf, len);
+	}
+	if (ret)
+		wl1271_error("sdio write failed (%d)", ret);
+
+}
+
+static int wl1271_sdio_set_power(struct wl1271 *wl, bool enable)
+{
+	struct sdio_func *func = wl_to_func(wl);
+	int ret;
+
+	/* Let the SDIO stack handle wlan_enable control, so we
+	 * keep host claimed while wlan is in use to keep wl1271
+	 * alive.
+	 */
+	if (enable) {
+		/* Power up the card */
+		ret = pm_runtime_get_sync(&func->dev);
+		if (ret < 0)
+			goto out;
+		sdio_claim_host(func);
+		sdio_enable_func(func);
+		sdio_release_host(func);
+	} else {
+		sdio_claim_host(func);
+		sdio_disable_func(func);
+		sdio_release_host(func);
+
+		/* Power down the card */
+		ret = pm_runtime_put_sync(&func->dev);
+	}
+
+out:
+	return ret;
+}
+
+static void wl1271_sdio_disable_interrupts(struct wl1271 *wl)
+{
+}
+
+static void wl1271_sdio_enable_interrupts(struct wl1271 *wl)
+{
+}
+
+
+static struct wl1271_if_operations sdio_ops = {
+	.read		= wl1271_sdio_raw_read,
+	.write		= wl1271_sdio_raw_write,
+	.power		= wl1271_sdio_set_power,
+	.dev		= wl1271_sdio_wl_to_dev,
+	.enable_irq	= wl1271_sdio_enable_interrupts,
+	.disable_irq	= wl1271_sdio_disable_interrupts,
+};
+
+static void wl1271_fw_wakeup(struct wl1271 *wl)
+{
+	u32 elp_reg;
+
+	elp_reg = ELPCTRL_WAKE_UP;
+	wl1271_raw_write32(wl, HW_ACCESS_ELP_CTRL_REG_ADDR, elp_reg);
+}
+
+static int wl1271_fetch_firmware(struct wl1271 *wl)
+{
+	const struct firmware *fw;
+	int ret;
+
+	ret = request_firmware(&fw, WL1271_FW_NAME, wl1271_wl_to_dev(wl));
+
+	if (ret < 0) {
+		wl1271_error("could not get firmware: %d", ret);
+		return ret;
+	}
+
+	if (fw->size % 4) {
+		wl1271_error("firmware size is not multiple of 32 bits: %zu",
+				fw->size);
+		ret = -EILSEQ;
+		goto out;
+	}
+
+	wl->fw_len = fw->size;
+	wl->fw = vmalloc(wl->fw_len);
+
+	if (!wl->fw) {
+		wl1271_error("could not allocate memory for the firmware");
+		ret = -ENOMEM;
+		goto out;
+	}
+
+	memcpy(wl->fw, fw->data, wl->fw_len);
+
+	ret = 0;
+
+out:
+	release_firmware(fw);
+
+	return ret;
+}
+
+static int wl1271_fetch_nvs(struct wl1271 *wl)
+{
+	const struct firmware *fw;
+	int ret;
+
+	ret = request_firmware(&fw, WL1271_NVS_NAME, wl1271_wl_to_dev(wl));
+
+	if (ret < 0) {
+		wl1271_error("could not get nvs file: %d", ret);
+		return ret;
+	}
+
+	wl->nvs = kmemdup(fw->data, sizeof(struct wl1271_nvs_file), GFP_KERNEL);
+
+	if (!wl->nvs) {
+		wl1271_error("could not allocate memory for the nvs file");
+		ret = -ENOMEM;
+		goto out;
+	}
+
+	wl->nvs_len = fw->size;
+
+out:
+	release_firmware(fw);
+
+	return ret;
+}
+
+static int wl1271_chip_wakeup(struct wl1271 *wl)
+{
+	struct wl1271_partition_set partition;
+	int ret;
+
+	msleep(WL1271_PRE_POWER_ON_SLEEP);
+	ret = wl1271_power_on(wl);
+	if (ret)
+		return ret;
+
+	msleep(WL1271_POWER_ON_SLEEP);
+
+	/* We don't need a real memory partition here, because we only want
+	 * to use the registers at this point. */
+	memset(&partition, 0, sizeof(partition));
+	partition.reg.start = REGISTERS_BASE;
+	partition.reg.size = REGISTERS_DOWN_SIZE;
+	wl1271_set_partition(wl, &partition);
+
+	/* ELP module wake up */
+	wl1271_fw_wakeup(wl);
+
+	/* whal_FwCtrl_BootSm() */
+
+	/* 0. read chip id from CHIP_ID */
+	wl->chip.id = wl1271_read32(wl, CHIP_ID_B);
+
+	/* 1. check if chip id is valid */
+
+	switch (wl->chip.id) {
+	case CHIP_ID_1271_PG10:
+		wl1271_warning("chip id 0x%x (1271 PG10) support is obsolete",
+				wl->chip.id);
+		break;
+	case CHIP_ID_1271_PG20:
+		wl1271_notice("chip id 0x%x (1271 PG20)",
+				wl->chip.id);
+		break;
+	default:
+		wl1271_warning("unsupported chip id: 0x%x", wl->chip.id);
+		return -ENODEV;
+	}
+
+	return ret;
+}
+
+static struct wl1271_partition_set part_down = {
+	.mem = {
+		.start = 0x00000000,
+		.size  = 0x000177c0
+	},
+	.reg = {
+		.start = REGISTERS_BASE,
+		.size  = 0x00008800
+	},
+	.mem2 = {
+		.start = 0x00000000,
+		.size  = 0x00000000
+	},
+	.mem3 = {
+		.start = 0x00000000,
+		.size  = 0x00000000
+	},
+};
+
+static int tester(void *data)
+{
+	struct wl1271 *wl = data;
+	struct sdio_func *func = wl_to_func(wl);
+	struct device *pdev = &func->dev;
+	int ret = 0;
+	bool rx_started = 0;
+	bool tx_started = 0;
+	uint8_t *tx_buf, *rx_buf;
+	int test_size = PAGE_SIZE;
+	u32 addr = 0;
+	struct wl1271_partition_set partition;
+
+	/* We assume chip is powered up and firmware fetched */
+
+	memcpy(&partition, &part_down, sizeof(partition));
+	partition.mem.start = addr;
+	wl1271_set_partition(wl, &partition);
+
+	tx_buf = kmalloc(test_size, GFP_KERNEL);
+	rx_buf = kmalloc(test_size, GFP_KERNEL);
+	if (!tx_buf || !rx_buf) {
+		dev_err(pdev,
+			"Could not allocate memory. Test will not run.\n");
+		ret = -ENOMEM;
+		goto free;
+	}
+
+	memset(tx_buf, 0x5a, test_size);
+
+	/* write something in data area so we can read it back */
+	wl1271_write(wl, addr, tx_buf, test_size, false);
+
+	while (!kthread_should_stop()) {
+		if (rx && !rx_started) {
+			dev_info(pdev, "starting rx test\n");
+			rx_started = 1;
+		} else if (!rx && rx_started) {
+			dev_info(pdev, "stopping rx test\n");
+			rx_started = 0;
+		}
+
+		if (tx && !tx_started) {
+			dev_info(pdev, "starting tx test\n");
+			tx_started = 1;
+		} else if (!tx && tx_started) {
+			dev_info(pdev, "stopping tx test\n");
+			tx_started = 0;
+		}
+
+		if (rx_started)
+			wl1271_read(wl, addr, rx_buf, test_size, false);
+
+		if (tx_started)
+			wl1271_write(wl, addr, tx_buf, test_size, false);
+
+		if (!rx_started && !tx_started)
+			msleep(100);
+	}
+
+free:
+	kfree(tx_buf);
+	kfree(rx_buf);
+	return ret;
+}
+
+static int __devinit wl1271_probe(struct sdio_func *func,
+		const struct sdio_device_id *id)
+{
+	const struct wl12xx_platform_data *wlan_data;
+	struct wl1271 *wl;
+	struct wl1271_test *wl_test;
+	int ret = 0;
+
+	/* wl1271 has 2 sdio functions we handle just the wlan part */
+	if (func->num != 0x02)
+		return -ENODEV;
+
+	wl_test = kzalloc(sizeof(struct wl1271_test), GFP_KERNEL);
+	if (!wl_test) {
+		dev_err(&func->dev, "Could not allocate memory\n");
+		return -ENOMEM;
+	}
+
+	wl = &wl_test->wl;
+
+	wl->if_priv = func;
+	wl->if_ops = &sdio_ops;
+
+	/* Grab access to FN0 for ELP reg. */
+	func->card->quirks |= MMC_QUIRK_LENIENT_FN0;
+
+	wlan_data = wl12xx_get_platform_data();
+	if (IS_ERR(wlan_data)) {
+		ret = PTR_ERR(wlan_data);
+		dev_err(&func->dev, "missing wlan platform data: %d\n", ret);
+		goto out_free;
+	}
+
+	wl->irq = wlan_data->irq;
+	wl->ref_clock = wlan_data->board_ref_clock;
+
+	sdio_set_drvdata(func, wl_test);
+
+
+	/* power up the device */
+	ret = wl1271_chip_wakeup(wl);
+	if (ret) {
+		dev_err(&func->dev, "could not wake up chip\n");
+		goto out_free;
+	}
+
+	if (wl->fw == NULL) {
+		ret = wl1271_fetch_firmware(wl);
+		if (ret < 0) {
+			dev_err(&func->dev, "firmware fetch error\n");
+			goto out_off;
+		}
+	}
+
+	/* fetch NVS */
+	if (wl->nvs == NULL) {
+		ret = wl1271_fetch_nvs(wl);
+		if (ret < 0) {
+			dev_err(&func->dev, "NVS fetch error\n");
+			goto out_off;
+		}
+	}
+
+	ret = wl1271_load_firmware(wl);
+	if (ret < 0) {
+		dev_err(&func->dev, "firmware load error: %d\n", ret);
+		goto out_free;
+	}
+
+	dev_info(&func->dev, "initialized\n");
+
+	/* I/O testing will be done in the tester thread */
+
+	wl_test->test_task = kthread_run(tester, wl, "sdio_tester");
+	if (IS_ERR(wl_test->test_task)) {
+		dev_err(&func->dev, "unable to create kernel thread\n");
+		ret = PTR_ERR(wl_test->test_task);
+		goto out_free;
+	}
+
+	return 0;
+
+out_off:
+	/* power off the chip */
+	wl1271_power_off(wl);
+
+out_free:
+	kfree(wl_test);
+	return ret;
+}
+
+static void __devexit wl1271_remove(struct sdio_func *func)
+{
+	struct wl1271_test *wl_test = sdio_get_drvdata(func);
+
+	/* stop the I/O test thread */
+	kthread_stop(wl_test->test_task);
+
+	/* power off the chip */
+	wl1271_power_off(&wl_test->wl);
+
+	vfree(wl_test->wl.fw);
+	wl_test->wl.fw = NULL;
+	kfree(wl_test->wl.nvs);
+	wl_test->wl.nvs = NULL;
+
+	kfree(wl_test);
+}
+
+static struct sdio_driver wl1271_sdio_driver = {
+	.name		= "wl12xx_sdio_test",
+	.id_table	= wl1271_devices,
+	.probe		= wl1271_probe,
+	.remove		= __devexit_p(wl1271_remove),
+};
+
+static int __init wl1271_init(void)
+{
+	int ret;
+
+	ret = sdio_register_driver(&wl1271_sdio_driver);
+	if (ret < 0)
+		pr_err("failed to register sdio driver: %d\n", ret);
+
+	return ret;
+}
+module_init(wl1271_init);
+
+static void __exit wl1271_exit(void)
+{
+	sdio_unregister_driver(&wl1271_sdio_driver);
+}
+module_exit(wl1271_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Roger Quadros <roger.quadros@nokia.com>");
+
diff --git a/drivers/net/wireless/wl12xx/wl1271_sdio_test.c b/drivers/net/wireless/wl12xx/wl1271_sdio_test.c
deleted file mode 100644
index 42d1314..0000000
--- a/drivers/net/wireless/wl12xx/wl1271_sdio_test.c
+++ /dev/null
@@ -1,510 +0,0 @@
-/*
- * wl1271_sdio_test.c - SDIO testing driver for wl1271
- *
- * Copyright (C) 2010 Nokia Corporation
- *
- * Contact: Roger Quadros <roger.quadros@nokia.com>
- *
- * wl1271 read/write routines taken from wl1271_sdio.c
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <linux/irq.h>
-#include <linux/module.h>
-#include <linux/crc7.h>
-#include <linux/vmalloc.h>
-#include <linux/mmc/sdio_func.h>
-#include <linux/mmc/sdio_ids.h>
-#include <linux/mmc/card.h>
-#include <linux/gpio.h>
-#include <linux/wl12xx.h>
-#include <linux/kthread.h>
-#include <linux/firmware.h>
-
-#include "wl1271.h"
-#include "wl1271_io.h"
-#include "wl1271_boot.h"
-
-#ifndef SDIO_VENDOR_ID_TI
-#define SDIO_VENDOR_ID_TI		0x0097
-#endif
-
-#ifndef SDIO_DEVICE_ID_TI_WL1271
-#define SDIO_DEVICE_ID_TI_WL1271	0x4076
-#endif
-
-static bool rx, tx;
-
-module_param(rx, bool, S_IRUGO | S_IWUSR);
-MODULE_PARM_DESC(rx, "Perform rx test. Default (0). "
-	"This test continuously reads data from the SDIO device.\n");
-
-module_param(tx, bool, S_IRUGO | S_IWUSR);
-MODULE_PARM_DESC(tx, "Perform tx test. Default (0). "
-	"This test continuously writes data to the SDIO device.\n");
-
-struct wl1271_test {
-	struct wl1271 wl;
-	struct task_struct *test_task;
-};
-
-static const struct sdio_device_id wl1271_devices[] = {
-	{ SDIO_DEVICE(SDIO_VENDOR_ID_TI, SDIO_DEVICE_ID_TI_WL1271) },
-	{}
-};
-
-static inline struct sdio_func *wl_to_func(struct wl1271 *wl)
-{
-	return wl->if_priv;
-}
-
-static struct device *wl1271_sdio_wl_to_dev(struct wl1271 *wl)
-{
-	return &(wl_to_func(wl)->dev);
-}
-
-static void wl1271_sdio_raw_read(struct wl1271 *wl, int addr, void *buf,
-		size_t len, bool fixed)
-{
-	int ret = 0;
-	struct sdio_func *func = wl_to_func(wl);
-
-	if (unlikely(addr == HW_ACCESS_ELP_CTRL_REG_ADDR)) {
-		((u8 *)buf)[0] = sdio_f0_readb(func, addr, &ret);
-		wl1271_debug(DEBUG_SDIO, "sdio read 52 addr 0x%x, byte 0x%02x",
-				addr, ((u8 *)buf)[0]);
-	} else {
-		if (fixed)
-			ret = sdio_readsb(func, buf, addr, len);
-		else
-			ret = sdio_memcpy_fromio(func, buf, addr, len);
-
-		wl1271_debug(DEBUG_SDIO, "sdio read 53 addr 0x%x, %zu bytes",
-				addr, len);
-		wl1271_dump_ascii(DEBUG_SDIO, "data: ", buf, len);
-	}
-
-	if (ret)
-		wl1271_error("sdio read failed (%d)", ret);
-}
-
-static void wl1271_sdio_raw_write(struct wl1271 *wl, int addr, void *buf,
-		size_t len, bool fixed)
-{
-	int ret = 0;
-	struct sdio_func *func = wl_to_func(wl);
-
-	if (unlikely(addr == HW_ACCESS_ELP_CTRL_REG_ADDR)) {
-		sdio_f0_writeb(func, ((u8 *)buf)[0], addr, &ret);
-		wl1271_debug(DEBUG_SDIO, "sdio write 52 addr 0x%x, byte 0x%02x",
-				addr, ((u8 *)buf)[0]);
-	} else {
-		wl1271_debug(DEBUG_SDIO, "sdio write 53 addr 0x%x, %zu bytes",
-				addr, len);
-		wl1271_dump_ascii(DEBUG_SDIO, "data: ", buf, len);
-
-		if (fixed)
-			ret = sdio_writesb(func, addr, buf, len);
-		else
-			ret = sdio_memcpy_toio(func, addr, buf, len);
-	}
-	if (ret)
-		wl1271_error("sdio write failed (%d)", ret);
-
-}
-
-static int wl1271_sdio_set_power(struct wl1271 *wl, bool enable)
-{
-	struct sdio_func *func = wl_to_func(wl);
-
-	/* Let the SDIO stack handle wlan_enable control, so we
-	 * keep host claimed while wlan is in use to keep wl1271
-	 * alive.
-	 */
-	if (enable) {
-		sdio_claim_power(func);
-		sdio_claim_host(func);
-		sdio_enable_func(func);
-	} else {
-		sdio_disable_func(func);
-		sdio_release_host(func);
-		sdio_release_power(func);
-	}
-
-	return 0;
-}
-
-static void wl1271_sdio_disable_interrupts(struct wl1271 *wl)
-{
-}
-
-static void wl1271_sdio_enable_interrupts(struct wl1271 *wl)
-{
-}
-
-
-static struct wl1271_if_operations sdio_ops = {
-	.read		= wl1271_sdio_raw_read,
-	.write		= wl1271_sdio_raw_write,
-	.power		= wl1271_sdio_set_power,
-	.dev		= wl1271_sdio_wl_to_dev,
-	.enable_irq	= wl1271_sdio_enable_interrupts,
-	.disable_irq	= wl1271_sdio_disable_interrupts,
-};
-
-static void wl1271_fw_wakeup(struct wl1271 *wl)
-{
-	u32 elp_reg;
-
-	elp_reg = ELPCTRL_WAKE_UP;
-	wl1271_raw_write32(wl, HW_ACCESS_ELP_CTRL_REG_ADDR, elp_reg);
-}
-
-static int wl1271_fetch_firmware(struct wl1271 *wl)
-{
-	const struct firmware *fw;
-	int ret;
-
-	ret = request_firmware(&fw, WL1271_FW_NAME, wl1271_wl_to_dev(wl));
-
-	if (ret < 0) {
-		wl1271_error("could not get firmware: %d", ret);
-		return ret;
-	}
-
-	if (fw->size % 4) {
-		wl1271_error("firmware size is not multiple of 32 bits: %zu",
-				fw->size);
-		ret = -EILSEQ;
-		goto out;
-	}
-
-	wl->fw_len = fw->size;
-	wl->fw = vmalloc(wl->fw_len);
-
-	if (!wl->fw) {
-		wl1271_error("could not allocate memory for the firmware");
-		ret = -ENOMEM;
-		goto out;
-	}
-
-	memcpy(wl->fw, fw->data, wl->fw_len);
-
-	ret = 0;
-
-out:
-	release_firmware(fw);
-
-	return ret;
-}
-
-static int wl1271_fetch_nvs(struct wl1271 *wl)
-{
-	const struct firmware *fw;
-	int ret;
-
-	ret = request_firmware(&fw, WL1271_NVS_NAME, wl1271_wl_to_dev(wl));
-
-	if (ret < 0) {
-		wl1271_error("could not get nvs file: %d", ret);
-		return ret;
-	}
-
-	wl->nvs = kmemdup(fw->data, sizeof(struct wl1271_nvs_file), GFP_KERNEL);
-
-	if (!wl->nvs) {
-		wl1271_error("could not allocate memory for the nvs file");
-		ret = -ENOMEM;
-		goto out;
-	}
-
-	wl->nvs_len = fw->size;
-
-out:
-	release_firmware(fw);
-
-	return ret;
-}
-
-static int wl1271_chip_wakeup(struct wl1271 *wl)
-{
-	struct wl1271_partition_set partition;
-	int ret;
-
-	msleep(WL1271_PRE_POWER_ON_SLEEP);
-	ret = wl1271_power_on(wl);
-	if (ret)
-		return ret;
-
-	msleep(WL1271_POWER_ON_SLEEP);
-
-	/* We don't need a real memory partition here, because we only want
-	 * to use the registers at this point. */
-	memset(&partition, 0, sizeof(partition));
-	partition.reg.start = REGISTERS_BASE;
-	partition.reg.size = REGISTERS_DOWN_SIZE;
-	wl1271_set_partition(wl, &partition);
-
-	/* ELP module wake up */
-	wl1271_fw_wakeup(wl);
-
-	/* whal_FwCtrl_BootSm() */
-
-	/* 0. read chip id from CHIP_ID */
-	wl->chip.id = wl1271_read32(wl, CHIP_ID_B);
-
-	/* 1. check if chip id is valid */
-
-	switch (wl->chip.id) {
-	case CHIP_ID_1271_PG10:
-		wl1271_warning("chip id 0x%x (1271 PG10) support is obsolete",
-				wl->chip.id);
-		break;
-	case CHIP_ID_1271_PG20:
-		wl1271_notice("chip id 0x%x (1271 PG20)",
-				wl->chip.id);
-		break;
-	default:
-		wl1271_warning("unsupported chip id: 0x%x", wl->chip.id);
-		return -ENODEV;
-	}
-
-	return ret;
-}
-
-static struct wl1271_partition_set part_down = {
-	.mem = {
-		.start = 0x00000000,
-		.size  = 0x000177c0
-	},
-	.reg = {
-		.start = REGISTERS_BASE,
-		.size  = 0x00008800
-	},
-	.mem2 = {
-		.start = 0x00000000,
-		.size  = 0x00000000
-	},
-	.mem3 = {
-		.start = 0x00000000,
-		.size  = 0x00000000
-	},
-};
-
-static int tester(void *data)
-{
-	struct wl1271 *wl = data;
-	struct sdio_func *func = wl_to_func(wl);
-	struct device *pdev = &func->dev;
-	int ret = 0;
-	bool rx_started = 0;
-	bool tx_started = 0;
-	uint8_t *tx_buf, *rx_buf;
-	int test_size = PAGE_SIZE;
-	u32 addr = 0;
-	struct wl1271_partition_set partition;
-
-	/* We assume chip is powered up and firmware fetched */
-
-	memcpy(&partition, &part_down, sizeof(partition));
-	partition.mem.start = addr;
-	wl1271_set_partition(wl, &partition);
-
-	tx_buf = kmalloc(test_size, GFP_KERNEL);
-	rx_buf = kmalloc(test_size, GFP_KERNEL);
-	if (!tx_buf || !rx_buf) {
-		dev_err(pdev,
-			"Could not allocate memory. Test will not run.\n");
-		ret = -ENOMEM;
-		goto free;
-	}
-
-	memset(tx_buf, 0x5a, test_size);
-
-	/* write something in data area so we can read it back */
-	wl1271_write(wl, addr, tx_buf, test_size, false);
-
-	while (!kthread_should_stop()) {
-		if (rx && !rx_started) {
-			dev_info(pdev, "starting rx test\n");
-			rx_started = 1;
-		} else if (!rx && rx_started) {
-			dev_info(pdev, "stopping rx test\n");
-			rx_started = 0;
-		}
-
-		if (tx && !tx_started) {
-			dev_info(pdev, "starting tx test\n");
-			tx_started = 1;
-		} else if (!tx && tx_started) {
-			dev_info(pdev, "stopping tx test\n");
-			tx_started = 0;
-		}
-
-		if (rx_started)
-			wl1271_read(wl, addr, rx_buf, test_size, false);
-
-		if (tx_started)
-			wl1271_write(wl, addr, tx_buf, test_size, false);
-
-		if (!rx_started && !tx_started)
-			msleep(100);
-	}
-
-free:
-	kfree(tx_buf);
-	kfree(rx_buf);
-	return ret;
-}
-
-static int __devinit wl1271_probe(struct sdio_func *func,
-		const struct sdio_device_id *id)
-{
-	const struct wl12xx_platform_data *wlan_data;
-	struct wl1271 *wl;
-	struct wl1271_test *wl_test;
-	int ret = 0;
-
-	/* wl1271 has 2 sdio functions we handle just the wlan part */
-	if (func->num != 0x02)
-		return -ENODEV;
-
-	wl_test = kzalloc(sizeof(struct wl1271_test), GFP_KERNEL);
-	if (!wl_test) {
-		dev_err(&func->dev, "Could not allocate memory\n");
-		return -ENOMEM;
-	}
-
-	wl = &wl_test->wl;
-
-	wl->if_priv = func;
-	wl->if_ops = &sdio_ops;
-
-	/* Grab access to FN0 for ELP reg. */
-	func->card->quirks |= MMC_QUIRK_LENIENT_FN0;
-
-	wlan_data = wl12xx_get_platform_data();
-	if (IS_ERR(wlan_data)) {
-		ret = PTR_ERR(wlan_data);
-		dev_err(&func->dev, "missing wlan platform data: %d\n", ret);
-		goto out_free;
-	}
-
-	wl->irq = wlan_data->irq;
-	wl->ref_clock = wlan_data->board_ref_clock;
-
-	sdio_set_drvdata(func, wl_test);
-
-
-	/* power up the device */
-	ret = wl1271_chip_wakeup(wl);
-	if (ret) {
-		dev_err(&func->dev, "could not wake up chip\n");
-		goto out_free;
-	}
-
-	if (wl->fw == NULL) {
-		ret = wl1271_fetch_firmware(wl);
-		if (ret < 0) {
-			dev_err(&func->dev, "firmware fetch error\n");
-			goto out_off;
-		}
-	}
-
-	/* fetch NVS */
-	if (wl->nvs == NULL) {
-		ret = wl1271_fetch_nvs(wl);
-		if (ret < 0) {
-			dev_err(&func->dev, "NVS fetch error\n");
-			goto out_off;
-		}
-	}
-
-	ret = wl1271_load_firmware(wl);
-	if (ret < 0) {
-		dev_err(&func->dev, "firmware load error: %d\n", ret);
-		goto out_free;
-	}
-
-	dev_info(&func->dev, "initialized\n");
-
-	/* I/O testing will be done in the tester thread */
-
-	wl_test->test_task = kthread_run(tester, wl, "sdio_tester");
-	if (IS_ERR(wl_test->test_task)) {
-		dev_err(&func->dev, "unable to create kernel thread\n");
-		ret = PTR_ERR(wl_test->test_task);
-		goto out_free;
-	}
-
-	return 0;
-
-out_off:
-	/* power off the chip */
-	wl1271_power_off(wl);
-
-out_free:
-	kfree(wl_test);
-	return ret;
-}
-
-static void __devexit wl1271_remove(struct sdio_func *func)
-{
-	struct wl1271_test *wl_test = sdio_get_drvdata(func);
-
-	/* stop the I/O test thread */
-	kthread_stop(wl_test->test_task);
-
-	/* power off the chip */
-	wl1271_power_off(&wl_test->wl);
-
-	vfree(wl_test->wl.fw);
-	wl_test->wl.fw = NULL;
-	kfree(wl_test->wl.nvs);
-	wl_test->wl.nvs = NULL;
-
-	kfree(wl_test);
-}
-
-static struct sdio_driver wl1271_sdio_driver = {
-	.name		= "wl1271_sdio_test",
-	.id_table	= wl1271_devices,
-	.probe		= wl1271_probe,
-	.remove		= __devexit_p(wl1271_remove),
-};
-
-static int __init wl1271_init(void)
-{
-	int ret;
-
-	ret = sdio_register_driver(&wl1271_sdio_driver);
-	if (ret < 0)
-		pr_err("failed to register sdio driver: %d\n", ret);
-
-	return ret;
-}
-module_init(wl1271_init);
-
-static void __exit wl1271_exit(void)
-{
-	sdio_unregister_driver(&wl1271_sdio_driver);
-}
-module_exit(wl1271_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Roger Quadros <roger.quadros@nokia.com>");
-
-- 
1.7.0.4


^ permalink raw reply related

* Re: [PATCH] wl12xx: Change TX queue to be per AC
From: Luciano Coelho @ 2010-12-15 13:20 UTC (permalink / raw)
  To: juuso.oikarinen; +Cc: linux-wireless
In-Reply-To: <1292226757-21614-1-git-send-email-juuso.oikarinen@nokia.com>

On Mon, 2010-12-13 at 09:52 +0200, juuso.oikarinen@nokia.com wrote:
> From: Juuso Oikarinen <juuso.oikarinen@nokia.com>
> 
> With the current single-queue implementation traffic priorization is not
> working correctly - when using multiple BE streams and one, say VI stream,
> the VI stream will share bandwidth almost equally with the BE streams.
> 
> To fix the issue, implement per AC queues, which are emptied in priority
> order to the firmware. To keep it relatively simple, maintain a global
> buffer count and global queue stop/wake instead of per-AC.
> 
> With these changes, priorization appears to work just fine.
> 
> Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
> ---

Thanks, Juuso! Applied.

-- 
Cheers,
Luca.


^ permalink raw reply

* Re: [PATCH] wl12xx: allow runtime changing of debug_level
From: Luciano Coelho @ 2010-12-15 13:15 UTC (permalink / raw)
  To: ext Eliad Peller; +Cc: linux-wireless
In-Reply-To: <1292148935-8709-1-git-send-email-eliad@wizery.com>

On Sun, 2010-12-12 at 12:15 +0200, ext Eliad Peller wrote:
> Currently, the debug level is set in compilation time (by the DEBUG_LEVEL
> const). This method has the advantage of compiling only the relevant
> messages, while optimizing out the unused ones.
> 
> In order to allow runtime control over the debug_level, while optimizing
> out messages when debug messages are not needed, we combine some methods:
> 1. use dynamic_debug (pr_debug) rather then printk.
> 2. add debug_level module param in order to set debug level during insmod.
> 3. add debug_level sysfs file in order to allow dynamic control over the
>    debug level.
> 
> Since patches for pr_debug_hex_dump() implementation haven't been applied yet,
> we are still temporarly using print_hex_dump().
> 
> Signed-off-by: Eliad Peller <eliad@wizery.com>
> ---

Applied, thanks!


-- 
Cheers,
Luca.


^ permalink raw reply

* Re: [PATCH] wl1271: fixed problem with WPS IEs in probe requests
From: Luciano Coelho @ 2010-12-15 13:14 UTC (permalink / raw)
  To: ext Guy Eilam; +Cc: linux-wireless
In-Reply-To: <1291906499-21141-1-git-send-email-guy@wizery.com>

On Thu, 2010-12-09 at 16:54 +0200, ext Guy Eilam wrote:
> Inclusion of a WPS IE in probe requests caused a problem
> in the driver due to the maximum size of the probe request
> template and the max_scan_ie_len values at initialization.
> 
> Increased the size of probe request template
> to the maximum size allowed by the firmware.
> Struct wl12xx_probe_req_template, which was only used
> for calculating the max size of the probe request template,
> is no longer used and needed.
> 
> max_scan_ie_len is used for validating the size of
> additional IEs in scan requests.
> Initialized the max_scan_ie_len field to the maximum size
> of the probe request template minus the ieee80211 header size.
> 
> Signed-off-by: Guy Eilam <guy@wizery.com>
> ---

Applied, thanks!


-- 
Cheers,
Luca.


^ permalink raw reply

* Re: [PATCH] mac80211: Add timeout to BA session start API
From: Andy Lutomirski @ 2010-12-15 12:56 UTC (permalink / raw)
  To: Sujith; +Cc: linville, linux-wireless, Sujith.Manoharan
In-Reply-To: <19720.9510.589223.207856@gargle.gargle.HOWL>

Sujith wrote:
> From: Sujith Manoharan <Sujith.Manoharan-DlyHzToyqoxBDgjK7y7TUQ@public.gmane.org>
> 
> Allow drivers or rate control algorithms to specify BlockAck session
> timeout when initiating an ADDBA transaction. This is useful in cases
> where maintaining persistent BA sessions does not incur any overhead.
> 
> The current timeout value of 5000 TUs is retained for all non ath9k/ath9k_htc
> drivers.
> 
> Signed-off-by: Sujith Manoharan <Sujith.Manoharan-DlyHzToyqoxBDgjK7y7TUQ@public.gmane.org>
> ---
>  drivers/net/wireless/ath/ath9k/htc_drv_txrx.c |    2 +-
>  drivers/net/wireless/ath/ath9k/rc.c           |    2 +-
>  drivers/net/wireless/iwlwifi/iwl-agn-rs.c     |    2 +-
>  include/net/mac80211.h                        |    4 +++-
>  net/mac80211/agg-tx.c                         |    7 +++++--
>  net/mac80211/debugfs_sta.c                    |    2 +-
>  net/mac80211/rc80211_minstrel_ht.c            |    2 +-
>  net/mac80211/sta_info.h                       |    2 ++
>  8 files changed, 15 insertions(+), 8 deletions(-)
> 

[...]

> diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c
> index 4ad7a36..165a451 100644
> --- a/net/mac80211/rc80211_minstrel_ht.c
> +++ b/net/mac80211/rc80211_minstrel_ht.c
> @@ -374,7 +374,7 @@ minstrel_aggr_check(struct minstrel_priv *mp, struct ieee80211_sta *pubsta, stru
>  	if (skb_get_queue_mapping(skb) == IEEE80211_AC_VO)
>  		return;
>  
> -	ieee80211_start_tx_ba_session(pubsta, tid);
> +	ieee80211_start_tx_ba_session(pubsta, tid, 5000);

What about ath9k with minstrel_ht as rc?  A lot of openwrt users (e.g. me) use
this.

--Andy

^ permalink raw reply

* Re: [PATCH] wl12xx: add auto-arp support
From: Luciano Coelho @ 2010-12-15 13:05 UTC (permalink / raw)
  To: ext Eliad Peller; +Cc: linux-wireless
In-Reply-To: <1291887087-3329-1-git-send-email-eliad@wizery.com>

On Thu, 2010-12-09 at 11:31 +0200, ext Eliad Peller wrote:
> The auto-arp feature of wl12xx allows the firmware to automatically
> response to arp requests asking for its ip.
> 
> in order to use it, we configure the arp response template and
> enable the corresponding bit in wl1271_acx_arp_filter (along with
> passing its ip)
> 
> Signed-off-by: Eliad Peller <eliad@wizery.com>
> ---

Applied.  Thanks, ELP! ;)


-- 
Cheers,
Luca.


^ permalink raw reply

* Re: [PATCH 2/2] wl1271_sdio_test: Add module for sdio RX/TX testing
From: Luciano Coelho @ 2010-12-15 13:03 UTC (permalink / raw)
  To: Roger Quadros; +Cc: linux-wireless, carlos.chinea
In-Reply-To: <1291197534-15319-1-git-send-email-roger.quadros@nokia.com>

On Wed, 2010-12-01 at 11:58 +0200, Roger Quadros wrote:
> From: Roger Quadros <roger.quadros@nokia.com>
> 
> This module enables individually generating RX and TX traffic
> over the SDIO bus on which the WL1271 chipset is connected.
> This is required to perform RF interference testing.
> 
> The module takes 2 module parameters 'rx' and 'tx'.
> 
> To generate RX traffic:
> 	modprobe wl1271_sdio_test rx=1
> To generate TX traffic:
> 	modprobe wl1271_sdio_test tx=1
> 
> To generate both RX & TX traffic, set both rx and tx to 1.
> 
> You can change the testing configuration at runtime by changing
> the rx & tx values at /sys/modules/wl1271_sdio_test/
> 
> To stop testing simply unload the module.
> 
> Signed-off-by: Roger Quadros <roger.quadros@nokia.com>
> Reviewed-by: Carlos Chinea <carlos.chinea@nokia.com>
> ---

Thanks Roger.  Applied.

-- 
Cheers,
Luca.


^ permalink raw reply

* Re: [PATCH] wl12xx: disable 11a channels when wl->enable_11a is known
From: Luciano Coelho @ 2010-12-15 13:00 UTC (permalink / raw)
  To: linux-wireless; +Cc: geryk
In-Reply-To: <1291388740-27218-1-git-send-email-luciano.coelho@nokia.com>

On Fri, 2010-12-03 at 17:05 +0200, luciano.coelho@nokia.com wrote:
> From: Luciano Coelho <luciano.coelho@nokia.com>
> 
> Disabling the 11a channels when not supported in the reg_notify function was
> not working as it should, because when the driver is initiailizing (and
> registering itself with mac80211), it would get the reg notification too
> early.  At that point the driver wouldn't have received the NVS yet, so it
> wouldn't know whether 11a was supported.
> 
> To fix this, we disable 11a channels when we read the NVS instead.  Also, it
> is easier (and still safe) to set n_channels to zero instead of setting the
> disabled flag on every 11a channel.
> 
> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>

Applied.

-- 
Cheers,
Luca.


^ permalink raw reply

* Re: [PATCH 1/2] nl80211: Export available antennas
From: Bruno Randolf @ 2010-12-15  9:53 UTC (permalink / raw)
  To: Daniel Halperin; +Cc: johannes, linville, linux-wireless
In-Reply-To: <AANLkTi=6o=tK1fRhOtchT9UPy+EWCcqzhebVYv+8XJP3@mail.gmail.com>

On Tue December 14 2010 12:11:52 Daniel Halperin wrote:
> Several of the Intel ones, I believe.  For instance 4965 can RX with 3
> antennas but can maybe only TX with A and B?  Intel also has a 1x2
> (5100 maybe?) chipset.

A lot of maybees ;) Can anyone else comment? Do we need available antennas 
separately for RX and TX?

bruno

> On Mon, Dec 13, 2010 at 6:31 PM, Bruno Randolf <br1@einfach.org> wrote:
> > On Tue December 14 2010 11:23:09 Daniel Halperin wrote:
> >> > diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
> >> > index b8fa25d..63b603c 100644
> >> > --- a/include/linux/nl80211.h
> >> > +++ b/include/linux/nl80211.h
> >> > @@ -841,6 +841,9 @@ enum nl80211_commands {
> >> >  *     the hardware should not be configured to receive on this
> >> > antenna. *     For a more detailed descripton see
> >> > @NL80211_ATTR_WIPHY_ANTENNA_TX. *
> >> > + * @NL80211_ATTR_WIPHY_ANTENNA_AVAIL: Bitmap of antennas which are
> >> > available for + *     configuration via the above parameters.
> >> > + *
> >> 
> >> Not clear exactly what the point of this is -- there's no commit
> >> message -- but should not this API distinguish between TX and RX?
> >> E.g., several chipsets can only TX from a subset of RX antennas.
> > 
> > This is just the nl80211 part of a patch that got merged earlier, the
> > description of which has more info:
> > 
> > https://patchwork.kernel.org/patch/389682/
> > 
> > If it's necessary to distinguish between RX and TX it has to be done
> > there too. Can you give us examples of these chipsets which you
> > mentioned?
> > 
> > bruno

^ permalink raw reply

* [PATCH] wl12xx: remove redundant debugfs_remove_recursive() call
From: Eliad Peller @ 2010-12-15  9:47 UTC (permalink / raw)
  To: Luciano Coelho; +Cc: linux-wireless

Upon rmmod, the <debugfs>/ieee80211/phyX dir is being removed.
later, we try to remove <debugfs>/ieee80211/phyX/wl12xx, which
might result in NULL dereference.

Remove the excessive debugfs_remove_recursive() call.
(consequently, there is no more need to save wl->rootdir)

Reported-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 drivers/net/wireless/wl12xx/debugfs.c |   34 ++++++++++++++------------------
 drivers/net/wireless/wl12xx/wl12xx.h  |    1 -
 2 files changed, 15 insertions(+), 20 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/debugfs.c b/drivers/net/wireless/wl12xx/debugfs.c
index 8106a6c..86cf1fc 100644
--- a/drivers/net/wireless/wl12xx/debugfs.c
+++ b/drivers/net/wireless/wl12xx/debugfs.c
@@ -293,12 +293,13 @@ static const struct file_operations gpio_power_ops = {
 	.llseek = default_llseek,
 };
 
-static int wl1271_debugfs_add_files(struct wl1271 *wl)
+static int wl1271_debugfs_add_files(struct wl1271 *wl,
+				     struct dentry *rootdir)
 {
 	int ret = 0;
 	struct dentry *entry, *stats;
 
-	stats = debugfs_create_dir("fw-statistics", wl->rootdir);
+	stats = debugfs_create_dir("fw-statistics", rootdir);
 	if (!stats || IS_ERR(stats)) {
 		entry = stats;
 		goto err;
@@ -395,11 +396,11 @@ static int wl1271_debugfs_add_files(struct wl1271 *wl)
 	DEBUGFS_FWSTATS_ADD(rxpipe, missed_beacon_host_int_trig_rx_data);
 	DEBUGFS_FWSTATS_ADD(rxpipe, tx_xfr_host_int_trig_rx_data);
 
-	DEBUGFS_ADD(tx_queue_len, wl->rootdir);
-	DEBUGFS_ADD(retry_count, wl->rootdir);
-	DEBUGFS_ADD(excessive_retries, wl->rootdir);
+	DEBUGFS_ADD(tx_queue_len, rootdir);
+	DEBUGFS_ADD(retry_count, rootdir);
+	DEBUGFS_ADD(excessive_retries, rootdir);
 
-	DEBUGFS_ADD(gpio_power, wl->rootdir);
+	DEBUGFS_ADD(gpio_power, rootdir);
 
 	return 0;
 
@@ -414,7 +415,7 @@ err:
 
 void wl1271_debugfs_reset(struct wl1271 *wl)
 {
-	if (!wl->rootdir)
+	if (!wl->stats.fw_stats)
 		return;
 
 	memset(wl->stats.fw_stats, 0, sizeof(*wl->stats.fw_stats));
@@ -425,13 +426,13 @@ void wl1271_debugfs_reset(struct wl1271 *wl)
 int wl1271_debugfs_init(struct wl1271 *wl)
 {
 	int ret;
+	struct dentry *rootdir;
 
-	wl->rootdir = debugfs_create_dir(KBUILD_MODNAME,
-					 wl->hw->wiphy->debugfsdir);
+	rootdir = debugfs_create_dir(KBUILD_MODNAME,
+				     wl->hw->wiphy->debugfsdir);
 
-	if (IS_ERR(wl->rootdir)) {
-		ret = PTR_ERR(wl->rootdir);
-		wl->rootdir = NULL;
+	if (IS_ERR(rootdir)) {
+		ret = PTR_ERR(rootdir);
 		goto err;
 	}
 
@@ -445,7 +446,7 @@ int wl1271_debugfs_init(struct wl1271 *wl)
 
 	wl->stats.fw_stats_update = jiffies;
 
-	ret = wl1271_debugfs_add_files(wl);
+	ret = wl1271_debugfs_add_files(wl, rootdir);
 
 	if (ret < 0)
 		goto err_file;
@@ -457,8 +458,7 @@ err_file:
 	wl->stats.fw_stats = NULL;
 
 err_fw:
-	debugfs_remove_recursive(wl->rootdir);
-	wl->rootdir = NULL;
+	debugfs_remove_recursive(rootdir);
 
 err:
 	return ret;
@@ -468,8 +468,4 @@ void wl1271_debugfs_exit(struct wl1271 *wl)
 {
 	kfree(wl->stats.fw_stats);
 	wl->stats.fw_stats = NULL;
-
-	debugfs_remove_recursive(wl->rootdir);
-	wl->rootdir = NULL;
-
 }
diff --git a/drivers/net/wireless/wl12xx/wl12xx.h b/drivers/net/wireless/wl12xx/wl12xx.h
index e904c72..da275d0 100644
--- a/drivers/net/wireless/wl12xx/wl12xx.h
+++ b/drivers/net/wireless/wl12xx/wl12xx.h
@@ -376,7 +376,6 @@ struct wl1271 {
 	int last_rssi_event;
 
 	struct wl1271_stats stats;
-	struct dentry *rootdir;
 
 	__le32 buffer_32;
 	u32 buffer_cmd;
-- 
1.7.0.4


^ permalink raw reply related

* Re: another device working
From: Sedat Dilek @ 2010-12-15  9:42 UTC (permalink / raw)
  To: Johannes Berg; +Cc: Larry Finger, Eduardo Costa, linux-wireless
In-Reply-To: <1292403963.3678.0.camel@jlt3.sipsolutions.net>

On Wed, Dec 15, 2010 at 10:06 AM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Tue, 2010-12-14 at 22:05 +0100, Sedat Dilek wrote:
>
>> I wanted to add the device-specific data to [1], but edit-mode looks
>> strange (see attached screenshot).
>> Johannes any idea?
>>
>> [1] http://wireless.kernel.org/en/users/Devices/USB
>
> Well you have to edit the right driver's page, and this one gets built
> automatically ...
>
> johannes
>
>

The page to edit is [1]... and I have added the device, now.

- Sedat -

[1] http://wireless.kernel.org/en/users/Drivers/p54/devices

^ permalink raw reply

* Re: [PATCH] mac80211: Add timeout to BA session start API
From: Johannes Berg @ 2010-12-15  9:29 UTC (permalink / raw)
  To: Sujith; +Cc: linville, linux-wireless
In-Reply-To: <19720.35054.401355.825223@gargle.gargle.HOWL>

On Wed, 2010-12-15 at 14:52 +0530, Sujith wrote:
> Johannes Berg wrote:
> > Maybe you need to make minstrel configurable here. Or maybe instead of
> > passing the value to the function directly, it should be a config option
> > in the hw struct? I'll let you sort that out with other people (Ivo?
> > Helmut? anyone else working on HT drivers?) -- I don't care since we
> > can't use minstrel for iwlwifi anyway.
> 
> Yep, I thought of making it a config option, but then it seemed cleaner to
> give the RC algorithm the freedom to decide dynamically the timeout value on a per-tid basis.
> (for ex. based on AP or managed mode, based on AC priority ..)

Indeed, that's another good point.

johannes


^ permalink raw reply

* Re: [PATCH] mac80211: Add timeout to BA session start API
From: Johannes Berg @ 2010-12-15  9:12 UTC (permalink / raw)
  To: Sujith; +Cc: linville, linux-wireless, Sujith.Manoharan
In-Reply-To: <19720.9510.589223.207856@gargle.gargle.HOWL>

On Wed, 2010-12-15 at 07:47 +0530, Sujith wrote:
> From: Sujith Manoharan <Sujith.Manoharan@atheros.com>
> 
> Allow drivers or rate control algorithms to specify BlockAck session
> timeout when initiating an ADDBA transaction. This is useful in cases
> where maintaining persistent BA sessions does not incur any overhead.
> 
> The current timeout value of 5000 TUs is retained for all non ath9k/ath9k_htc
> drivers.
> 
> Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>

Reviewed-by: Johannes Berg <johannes@sipsolutions.net>

> --- a/net/mac80211/rc80211_minstrel_ht.c
> +++ b/net/mac80211/rc80211_minstrel_ht.c
> @@ -374,7 +374,7 @@ minstrel_aggr_check(struct minstrel_priv *mp, struct ieee80211_sta *pubsta, stru
>  	if (skb_get_queue_mapping(skb) == IEEE80211_AC_VO)
>  		return;
>  
> -	ieee80211_start_tx_ba_session(pubsta, tid);
> +	ieee80211_start_tx_ba_session(pubsta, tid, 5000);
>  }
>  
>  static void

Maybe you need to make minstrel configurable here. Or maybe instead of
passing the value to the function directly, it should be a config option
in the hw struct? I'll let you sort that out with other people (Ivo?
Helmut? anyone else working on HT drivers?) -- I don't care since we
can't use minstrel for iwlwifi anyway.

johannes


^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox