Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] mac80211: fix NULL dereference in radiotap code
From: Johannes Berg @ 2011-11-08 11:28 UTC (permalink / raw)
  To: John Linville; +Cc: Xiaokang Qin, linux-wireless

From: Johannes Berg <johannes.berg@intel.com>

When receiving failed PLCP frames is enabled, there
won't be a rate pointer when we add the radiotap
header and thus the kernel will crash. Fix this by
not assuming the rate pointer is always valid. It's
still always valid for frames that have good PLCP
though, and that is checked & enforced.

This was broken by my
commit fc88518916793af8ad6a02e05ff254d95c36d875
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Fri Jul 30 13:23:12 2010 +0200

    mac80211: don't check rates on PLCP error frames

where I removed the check in this case but didn't
take into account that the rate info would be used.

Reported-by: Xiaokang Qin <xiaokang.qin@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/rx.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

--- a/net/mac80211/rx.c	2011-11-08 09:24:58.000000000 +0100
+++ b/net/mac80211/rx.c	2011-11-08 12:19:55.000000000 +0100
@@ -140,8 +140,9 @@ ieee80211_add_rx_radiotap_header(struct
 	pos++;
 
 	/* IEEE80211_RADIOTAP_RATE */
-	if (status->flag & RX_FLAG_HT) {
+	if (!rate || status->flag & RX_FLAG_HT) {
 		/*
+		 * Without rate information don't add it. If we have,
 		 * MCS information is a separate field in radiotap,
 		 * added below. The byte here is needed as padding
 		 * for the channel though, so initialise it to 0.
@@ -162,12 +163,14 @@ ieee80211_add_rx_radiotap_header(struct
 	else if (status->flag & RX_FLAG_HT)
 		put_unaligned_le16(IEEE80211_CHAN_DYN | IEEE80211_CHAN_2GHZ,
 				   pos);
-	else if (rate->flags & IEEE80211_RATE_ERP_G)
+	else if (rate && rate->flags & IEEE80211_RATE_ERP_G)
 		put_unaligned_le16(IEEE80211_CHAN_OFDM | IEEE80211_CHAN_2GHZ,
 				   pos);
-	else
+	else if (rate)
 		put_unaligned_le16(IEEE80211_CHAN_CCK | IEEE80211_CHAN_2GHZ,
 				   pos);
+	else
+		put_unaligned_le16(IEEE80211_CHAN_2GHZ, pos);
 	pos += 2;
 
 	/* IEEE80211_RADIOTAP_DBM_ANTSIGNAL */



^ permalink raw reply

* Re: [PATCH] cfg80211: fix missing kernel-doc
From: Helmut Schaa @ 2011-11-08 10:59 UTC (permalink / raw)
  To: Johannes Berg; +Cc: John Linville, linux-wireless
In-Reply-To: <1320740407.4304.6.camel@jlt3.sipsolutions.net>

On Tue, Nov 8, 2011 at 9:20 AM, Johannes Berg <johannes@sipsolutions.net> wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> Two new struct members were not documented, fix that.

Thanks for fixing this up!
Helmut

^ permalink raw reply

* [PATCH 4/4] ath9k_hw: Fix tx power settings for AR9003
From: Rajkumar Manoharan @ 2011-11-08  8:52 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Rajkumar Manoharan, Paul Stewart

Retriving tx power for 2x2 and 3x3 chainmask is not handled
properly. While calculating tx power for 2x2, 3 dBm was reduced
and for 3x3, 5 dBm was reduced which should be added back when
retriving.

Cc: Paul Stewart <pstew@google.com>
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath9k/ar9003_eeprom.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
index ee9c09b..d2e4f28 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
@@ -5059,6 +5059,21 @@ static void ath9k_hw_ar9300_set_txpower(struct ath_hw *ah,
 			regulatory->max_power_level = targetPowerValT2[i];
 	}
 
+	switch (ar5416_get_ntxchains(ah->txchainmask)) {
+	case 1:
+		break;
+	case 2:
+		regulatory->max_power_level += INCREASE_MAXPOW_BY_TWO_CHAIN;
+		break;
+	case 3:
+		regulatory->max_power_level += INCREASE_MAXPOW_BY_THREE_CHAIN;
+		break;
+	default:
+		ath_dbg(ath9k_hw_common(ah), ATH_DBG_EEPROM,
+			"Invalid chainmask configuration\n");
+		break;
+	}
+
 	if (test)
 		return;
 
-- 
1.7.7.2


^ permalink raw reply related

* [PATCH 2/4] ath9k_hw: Read and configure xpa timing field
From: Rajkumar Manoharan @ 2011-11-08  8:49 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Rajkumar Manoharan
In-Reply-To: <1320742175-10962-1-git-send-email-rmanohar@qca.qualcomm.com>

Configure xpa timing field while loading boad defaults to
fix 11b CCK spur issue that was observed in EMI testing.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath9k/ar9003_eeprom.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
index de103ef..5fb3f54 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
@@ -3411,6 +3411,7 @@ static u32 ar9003_dump_modal_eeprom(char *buf, u32 len, u32 size,
 	PR_EEP("Chain1 NF Threshold", modal_hdr->noiseFloorThreshCh[1]);
 	PR_EEP("Chain2 NF Threshold", modal_hdr->noiseFloorThreshCh[2]);
 	PR_EEP("Quick Drop", modal_hdr->quick_drop);
+	PR_EEP("txEndToXpaOff", modal_hdr->txEndToXpaOff);
 	PR_EEP("xPA Bias Level", modal_hdr->xpaBiasLvl);
 	PR_EEP("txFrameToDataStart", modal_hdr->txFrameToDataStart);
 	PR_EEP("txFrameToPaOn", modal_hdr->txFrameToPaOn);
@@ -3956,6 +3957,20 @@ static void ar9003_hw_quick_drop_apply(struct ath_hw *ah, u16 freq)
 	REG_RMW_FIELD(ah, AR_PHY_AGC, AR_PHY_AGC_QUICK_DROP, quick_drop);
 }
 
+static void ar9003_hw_txend_to_xpa_off_apply(struct ath_hw *ah, u16 freq)
+{
+	struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep;
+	u32 value;
+
+	value = (freq < 4000) ? eep->modalHeader2G.txEndToXpaOff :
+				eep->modalHeader5G.txEndToXpaOff;
+
+	REG_RMW_FIELD(ah, AR_PHY_XPA_TIMING_CTL,
+		      AR_PHY_XPA_TIMING_CTL_TX_END_XPAB_OFF, value);
+	REG_RMW_FIELD(ah, AR_PHY_XPA_TIMING_CTL,
+		      AR_PHY_XPA_TIMING_CTL_TX_END_XPAA_OFF, value);
+}
+
 static void ath9k_hw_ar9300_set_board_values(struct ath_hw *ah,
 					     struct ath9k_channel *chan)
 {
@@ -3968,6 +3983,7 @@ static void ath9k_hw_ar9300_set_board_values(struct ath_hw *ah,
 		ar9003_hw_internal_regulator_apply(ah);
 	if (AR_SREV_9485(ah) || AR_SREV_9330(ah) || AR_SREV_9340(ah))
 		ar9003_hw_apply_tuning_caps(ah);
+	ar9003_hw_txend_to_xpa_off_apply(ah, chan->channel);
 }
 
 static void ath9k_hw_ar9300_set_addac(struct ath_hw *ah,
-- 
1.7.7.2


^ permalink raw reply related

* [PATCH 3/4] ath9k_hw: Fix channel list of CalFreqPeir for AR938x
From: Rajkumar Manoharan @ 2011-11-08  8:49 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Rajkumar Manoharan
In-Reply-To: <1320742175-10962-1-git-send-email-rmanohar@qca.qualcomm.com>

This patch sync up CalFreqPeir channel list and paprd rate mask
of AR938x templates to the latest received from Systems team.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath9k/ar9003_eeprom.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
index 5fb3f54..ee9c09b 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
@@ -1281,8 +1281,8 @@ static const struct ar9300_eeprom ar9300_h112 = {
 		.txEndToRxOn = 0x2,
 		.txFrameToXpaOn = 0xe,
 		.thresh62 = 28,
-		.papdRateMaskHt20 = LE32(0x80c080),
-		.papdRateMaskHt40 = LE32(0x80c080),
+		.papdRateMaskHt20 = LE32(0x0c80c080),
+		.papdRateMaskHt40 = LE32(0x0080c080),
 		.futureModal = {
 			0, 0, 0, 0, 0, 0, 0, 0,
 		},
@@ -1294,7 +1294,7 @@ static const struct ar9300_eeprom ar9300_h112 = {
 	.calFreqPier2G = {
 		FREQ2FBIN(2412, 1),
 		FREQ2FBIN(2437, 1),
-		FREQ2FBIN(2472, 1),
+		FREQ2FBIN(2462, 1),
 	},
 	/* ar9300_cal_data_per_freq_op_loop 2g */
 	.calPierData2G = {
@@ -1304,7 +1304,7 @@ static const struct ar9300_eeprom ar9300_h112 = {
 	},
 	.calTarget_freqbin_Cck = {
 		FREQ2FBIN(2412, 1),
-		FREQ2FBIN(2484, 1),
+		FREQ2FBIN(2472, 1),
 	},
 	.calTarget_freqbin_2G = {
 		FREQ2FBIN(2412, 1),
@@ -1503,7 +1503,7 @@ static const struct ar9300_eeprom ar9300_h112 = {
 		FREQ2FBIN(5500, 0),
 		FREQ2FBIN(5600, 0),
 		FREQ2FBIN(5700, 0),
-		FREQ2FBIN(5825, 0)
+		FREQ2FBIN(5785, 0)
 	},
 	.calPierData5G = {
 		{
@@ -2441,7 +2441,7 @@ static const struct ar9300_eeprom ar9300_h116 = {
 	.calFreqPier2G = {
 		FREQ2FBIN(2412, 1),
 		FREQ2FBIN(2437, 1),
-		FREQ2FBIN(2472, 1),
+		FREQ2FBIN(2462, 1),
 	 },
 	/* ar9300_cal_data_per_freq_op_loop 2g */
 	.calPierData2G = {
@@ -2643,7 +2643,7 @@ static const struct ar9300_eeprom ar9300_h116 = {
 		.xatten1MarginHigh = {0, 0, 0}
 	 },
 	.calFreqPier5G = {
-		FREQ2FBIN(5180, 0),
+		FREQ2FBIN(5160, 0),
 		FREQ2FBIN(5220, 0),
 		FREQ2FBIN(5320, 0),
 		FREQ2FBIN(5400, 0),
-- 
1.7.7.2


^ permalink raw reply related

* [PATCH 1/4] ath9k_hw: Read and configure quick drop for AR9003
From: Rajkumar Manoharan @ 2011-11-08  8:49 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Rajkumar Manoharan

Read and configure quick drop feild from AR9003 eeprom
inorder to help with strong signal. This patch also removes
obsolate parameters ob, db_stage2, db_stage_3, db_stage4
from the eeprom templates.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath9k/ar9003_eeprom.c |  108 +++++++++++-------------
 drivers/net/wireless/ath/ath9k/ar9003_eeprom.h |   10 +-
 drivers/net/wireless/ath/ath9k/ar9003_phy.h    |    2 +
 drivers/net/wireless/ath/ath9k/eeprom.h        |    3 +-
 4 files changed, 59 insertions(+), 64 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
index 3b262ba..de103ef 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
@@ -121,10 +121,8 @@ static const struct ar9300_eeprom ar9300_default = {
 		 * if the register is per chain
 		 */
 		.noiseFloorThreshCh = {-1, 0, 0},
-		.ob = {1, 1, 1},/* 3 chain */
-		.db_stage2 = {1, 1, 1}, /* 3 chain  */
-		.db_stage3 = {0, 0, 0},
-		.db_stage4 = {0, 0, 0},
+		.reserved = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+		.quick_drop = 0,
 		.xpaBiasLvl = 0,
 		.txFrameToDataStart = 0x0e,
 		.txFrameToPaOn = 0x0e,
@@ -144,7 +142,7 @@ static const struct ar9300_eeprom ar9300_default = {
 	 },
 	.base_ext1 = {
 		.ant_div_control = 0,
-		.future = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
+		.future = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
 	},
 	.calFreqPier2G = {
 		FREQ2FBIN(2412, 1),
@@ -323,10 +321,8 @@ static const struct ar9300_eeprom ar9300_default = {
 		.spurChans = {0, 0, 0, 0, 0},
 		/* noiseFloorThreshCh Check if the register is per chain */
 		.noiseFloorThreshCh = {-1, 0, 0},
-		.ob = {3, 3, 3}, /* 3 chain */
-		.db_stage2 = {3, 3, 3}, /* 3 chain */
-		.db_stage3 = {3, 3, 3}, /* doesn't exist for 2G */
-		.db_stage4 = {3, 3, 3},	 /* don't exist for 2G */
+		.reserved = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+		.quick_drop = 0,
 		.xpaBiasLvl = 0,
 		.txFrameToDataStart = 0x0e,
 		.txFrameToPaOn = 0x0e,
@@ -698,10 +694,8 @@ static const struct ar9300_eeprom ar9300_x113 = {
 		 * if the register is per chain
 		 */
 		.noiseFloorThreshCh = {-1, 0, 0},
-		.ob = {1, 1, 1},/* 3 chain */
-		.db_stage2 = {1, 1, 1}, /* 3 chain  */
-		.db_stage3 = {0, 0, 0},
-		.db_stage4 = {0, 0, 0},
+		.reserved = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+		.quick_drop = 0,
 		.xpaBiasLvl = 0,
 		.txFrameToDataStart = 0x0e,
 		.txFrameToPaOn = 0x0e,
@@ -721,7 +715,7 @@ static const struct ar9300_eeprom ar9300_x113 = {
 	 },
 	 .base_ext1 = {
 		.ant_div_control = 0,
-		.future = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
+		.future = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
 	 },
 	.calFreqPier2G = {
 		FREQ2FBIN(2412, 1),
@@ -900,10 +894,8 @@ static const struct ar9300_eeprom ar9300_x113 = {
 		.spurChans = {FREQ2FBIN(5500, 0), 0, 0, 0, 0},
 		/* noiseFloorThreshCh Check if the register is per chain */
 		.noiseFloorThreshCh = {-1, 0, 0},
-		.ob = {3, 3, 3}, /* 3 chain */
-		.db_stage2 = {3, 3, 3}, /* 3 chain */
-		.db_stage3 = {3, 3, 3}, /* doesn't exist for 2G */
-		.db_stage4 = {3, 3, 3},	 /* don't exist for 2G */
+		.reserved = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+		.quick_drop = 0,
 		.xpaBiasLvl = 0xf,
 		.txFrameToDataStart = 0x0e,
 		.txFrameToPaOn = 0x0e,
@@ -1276,10 +1268,8 @@ static const struct ar9300_eeprom ar9300_h112 = {
 		 * if the register is per chain
 		 */
 		.noiseFloorThreshCh = {-1, 0, 0},
-		.ob = {1, 1, 1},/* 3 chain */
-		.db_stage2 = {1, 1, 1}, /* 3 chain  */
-		.db_stage3 = {0, 0, 0},
-		.db_stage4 = {0, 0, 0},
+		.reserved = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+		.quick_drop = 0,
 		.xpaBiasLvl = 0,
 		.txFrameToDataStart = 0x0e,
 		.txFrameToPaOn = 0x0e,
@@ -1299,7 +1289,7 @@ static const struct ar9300_eeprom ar9300_h112 = {
 	},
 	.base_ext1 = {
 		.ant_div_control = 0,
-		.future = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
+		.future = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
 	},
 	.calFreqPier2G = {
 		FREQ2FBIN(2412, 1),
@@ -1478,10 +1468,8 @@ static const struct ar9300_eeprom ar9300_h112 = {
 		.spurChans = {0, 0, 0, 0, 0},
 		/* noiseFloorThreshCh Check if the register is per chain */
 		.noiseFloorThreshCh = {-1, 0, 0},
-		.ob = {3, 3, 3}, /* 3 chain */
-		.db_stage2 = {3, 3, 3}, /* 3 chain */
-		.db_stage3 = {3, 3, 3}, /* doesn't exist for 2G */
-		.db_stage4 = {3, 3, 3},	 /* don't exist for 2G */
+		.reserved = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+		.quick_drop = 0,
 		.xpaBiasLvl = 0,
 		.txFrameToDataStart = 0x0e,
 		.txFrameToPaOn = 0x0e,
@@ -1854,10 +1842,8 @@ static const struct ar9300_eeprom ar9300_x112 = {
 		 * if the register is per chain
 		 */
 		.noiseFloorThreshCh = {-1, 0, 0},
-		.ob = {1, 1, 1},/* 3 chain */
-		.db_stage2 = {1, 1, 1}, /* 3 chain  */
-		.db_stage3 = {0, 0, 0},
-		.db_stage4 = {0, 0, 0},
+		.reserved = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+		.quick_drop = 0,
 		.xpaBiasLvl = 0,
 		.txFrameToDataStart = 0x0e,
 		.txFrameToPaOn = 0x0e,
@@ -1877,7 +1863,7 @@ static const struct ar9300_eeprom ar9300_x112 = {
 	},
 	.base_ext1 = {
 		.ant_div_control = 0,
-		.future = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
+		.future = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
 	},
 	.calFreqPier2G = {
 		FREQ2FBIN(2412, 1),
@@ -2056,10 +2042,8 @@ static const struct ar9300_eeprom ar9300_x112 = {
 		.spurChans = {0, 0, 0, 0, 0},
 		/* noiseFloorThreshch check if the register is per chain */
 		.noiseFloorThreshCh = {-1, 0, 0},
-		.ob = {3, 3, 3}, /* 3 chain */
-		.db_stage2 = {3, 3, 3}, /* 3 chain */
-		.db_stage3 = {3, 3, 3}, /* doesn't exist for 2G */
-		.db_stage4 = {3, 3, 3},	 /* don't exist for 2G */
+		.reserved = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+		.quick_drop = 0,
 		.xpaBiasLvl = 0,
 		.txFrameToDataStart = 0x0e,
 		.txFrameToPaOn = 0x0e,
@@ -2431,10 +2415,8 @@ static const struct ar9300_eeprom ar9300_h116 = {
 		 * if the register is per chain
 		 */
 		.noiseFloorThreshCh = {-1, 0, 0},
-		.ob = {1, 1, 1},/* 3 chain */
-		.db_stage2 = {1, 1, 1}, /* 3 chain  */
-		.db_stage3 = {0, 0, 0},
-		.db_stage4 = {0, 0, 0},
+		.reserved = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+		.quick_drop = 0,
 		.xpaBiasLvl = 0,
 		.txFrameToDataStart = 0x0e,
 		.txFrameToPaOn = 0x0e,
@@ -2454,7 +2436,7 @@ static const struct ar9300_eeprom ar9300_h116 = {
 	 },
 	 .base_ext1 = {
 		.ant_div_control = 0,
-		.future = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
+		.future = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
 	 },
 	.calFreqPier2G = {
 		FREQ2FBIN(2412, 1),
@@ -2633,10 +2615,8 @@ static const struct ar9300_eeprom ar9300_h116 = {
 		.spurChans = {0, 0, 0, 0, 0},
 		/* noiseFloorThreshCh Check if the register is per chain */
 		.noiseFloorThreshCh = {-1, 0, 0},
-		.ob = {3, 3, 3}, /* 3 chain */
-		.db_stage2 = {3, 3, 3}, /* 3 chain */
-		.db_stage3 = {3, 3, 3}, /* doesn't exist for 2G */
-		.db_stage4 = {3, 3, 3},	 /* don't exist for 2G */
+		.reserved = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+		.quick_drop = 0,
 		.xpaBiasLvl = 0,
 		.txFrameToDataStart = 0x0e,
 		.txFrameToPaOn = 0x0e,
@@ -3023,6 +3003,8 @@ static u32 ath9k_hw_ar9300_get_eeprom(struct ath_hw *ah,
 		return eep->modalHeader5G.antennaGain;
 	case EEP_ANTENNA_GAIN_2G:
 		return eep->modalHeader2G.antennaGain;
+	case EEP_QUICK_DROP:
+		return pBase->miscConfiguration & BIT(1);
 	default:
 		return 0;
 	}
@@ -3428,25 +3410,13 @@ static u32 ar9003_dump_modal_eeprom(char *buf, u32 len, u32 size,
 	PR_EEP("Chain0 NF Threshold", modal_hdr->noiseFloorThreshCh[0]);
 	PR_EEP("Chain1 NF Threshold", modal_hdr->noiseFloorThreshCh[1]);
 	PR_EEP("Chain2 NF Threshold", modal_hdr->noiseFloorThreshCh[2]);
+	PR_EEP("Quick Drop", modal_hdr->quick_drop);
 	PR_EEP("xPA Bias Level", modal_hdr->xpaBiasLvl);
 	PR_EEP("txFrameToDataStart", modal_hdr->txFrameToDataStart);
 	PR_EEP("txFrameToPaOn", modal_hdr->txFrameToPaOn);
 	PR_EEP("txFrameToXpaOn", modal_hdr->txFrameToXpaOn);
 	PR_EEP("txClip", modal_hdr->txClip);
 	PR_EEP("ADC Desired size", modal_hdr->adcDesiredSize);
-	PR_EEP("Chain0 ob", modal_hdr->ob[0]);
-	PR_EEP("Chain1 ob", modal_hdr->ob[1]);
-	PR_EEP("Chain2 ob", modal_hdr->ob[2]);
-
-	PR_EEP("Chain0 db_stage2", modal_hdr->db_stage2[0]);
-	PR_EEP("Chain1 db_stage2", modal_hdr->db_stage2[1]);
-	PR_EEP("Chain2 db_stage2", modal_hdr->db_stage2[2]);
-	PR_EEP("Chain0 db_stage3", modal_hdr->db_stage3[0]);
-	PR_EEP("Chain1 db_stage3", modal_hdr->db_stage3[1]);
-	PR_EEP("Chain2 db_stage3", modal_hdr->db_stage3[2]);
-	PR_EEP("Chain0 db_stage4", modal_hdr->db_stage4[0]);
-	PR_EEP("Chain1 db_stage4", modal_hdr->db_stage4[1]);
-	PR_EEP("Chain2 db_stage4", modal_hdr->db_stage4[2]);
 
 	return len;
 }
@@ -3503,6 +3473,7 @@ static u32 ath9k_hw_ar9003_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr,
 	PR_EEP("Internal regulator", !!(pBase->featureEnable & BIT(4)));
 	PR_EEP("Enable Paprd", !!(pBase->featureEnable & BIT(5)));
 	PR_EEP("Driver Strength", !!(pBase->miscConfiguration & BIT(0)));
+	PR_EEP("Quick Drop", !!(pBase->miscConfiguration & BIT(1)));
 	PR_EEP("Chain mask Reduce", (pBase->miscConfiguration >> 0x3) & 0x1);
 	PR_EEP("Write enable Gpio", pBase->eepromWriteEnableGpio);
 	PR_EEP("WLAN Disable Gpio", pBase->wlanDisableGpio);
@@ -3965,6 +3936,26 @@ static void ar9003_hw_apply_tuning_caps(struct ath_hw *ah)
 	}
 }
 
+static void ar9003_hw_quick_drop_apply(struct ath_hw *ah, u16 freq)
+{
+	struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep;
+	int quick_drop = ath9k_hw_ar9300_get_eeprom(ah, EEP_QUICK_DROP);
+	s32 t[3], f[3] = {5180, 5500, 5785};
+
+	if (!quick_drop)
+		return;
+
+	if (freq < 4000)
+		quick_drop = eep->modalHeader2G.quick_drop;
+	else {
+		t[0] = eep->base_ext1.quick_drop_low;
+		t[1] = eep->modalHeader5G.quick_drop;
+		t[2] = eep->base_ext1.quick_drop_high;
+		quick_drop = ar9003_hw_power_interpolate(freq, f, t, 3);
+	}
+	REG_RMW_FIELD(ah, AR_PHY_AGC, AR_PHY_AGC_QUICK_DROP, quick_drop);
+}
+
 static void ath9k_hw_ar9300_set_board_values(struct ath_hw *ah,
 					     struct ath9k_channel *chan)
 {
@@ -3972,6 +3963,7 @@ static void ath9k_hw_ar9300_set_board_values(struct ath_hw *ah,
 	ar9003_hw_ant_ctrl_apply(ah, IS_CHAN_2GHZ(chan));
 	ar9003_hw_drive_strength_apply(ah);
 	ar9003_hw_atten_apply(ah, chan);
+	ar9003_hw_quick_drop_apply(ah, chan->channel);
 	if (!AR_SREV_9330(ah) && !AR_SREV_9340(ah))
 		ar9003_hw_internal_regulator_apply(ah);
 	if (AR_SREV_9485(ah) || AR_SREV_9330(ah) || AR_SREV_9340(ah))
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
index 6335a86..bb223fe 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
@@ -216,10 +216,8 @@ struct ar9300_modal_eep_header {
 	u8 spurChans[AR_EEPROM_MODAL_SPURS];
 	/* 3  Check if the register is per chain */
 	int8_t noiseFloorThreshCh[AR9300_MAX_CHAINS];
-	u8 ob[AR9300_MAX_CHAINS];
-	u8 db_stage2[AR9300_MAX_CHAINS];
-	u8 db_stage3[AR9300_MAX_CHAINS];
-	u8 db_stage4[AR9300_MAX_CHAINS];
+	u8 reserved[11];
+	int8_t quick_drop;
 	u8 xpaBiasLvl;
 	u8 txFrameToDataStart;
 	u8 txFrameToPaOn;
@@ -269,7 +267,9 @@ struct cal_ctl_data_5g {
 
 struct ar9300_BaseExtension_1 {
 	u8 ant_div_control;
-	u8 future[13];
+	u8 future[11];
+	int8_t quick_drop_low;
+	int8_t quick_drop_high;
 } __packed;
 
 struct ar9300_BaseExtension_2 {
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.h b/drivers/net/wireless/ath/ath9k/ar9003_phy.h
index 4114fe7..497d746 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.h
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.h
@@ -389,6 +389,8 @@
 #define AR_PHY_DAG_CTRLCCK_RSSI_THR_S   10
 
 #define AR_PHY_RIFS_INIT_DELAY         0x3ff0000
+#define AR_PHY_AGC_QUICK_DROP       0x03c00000
+#define AR_PHY_AGC_QUICK_DROP_S     22
 #define AR_PHY_AGC_COARSE_LOW       0x00007F80
 #define AR_PHY_AGC_COARSE_LOW_S     7
 #define AR_PHY_AGC_COARSE_HIGH      0x003F8000
diff --git a/drivers/net/wireless/ath/ath9k/eeprom.h b/drivers/net/wireless/ath/ath9k/eeprom.h
index 49abd34..5ff7ab9 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom.h
+++ b/drivers/net/wireless/ath/ath9k/eeprom.h
@@ -249,7 +249,8 @@ enum eeprom_param {
 	EEP_ANT_DIV_CTL1,
 	EEP_CHAIN_MASK_REDUCE,
 	EEP_ANTENNA_GAIN_2G,
-	EEP_ANTENNA_GAIN_5G
+	EEP_ANTENNA_GAIN_5G,
+	EEP_QUICK_DROP
 };
 
 enum ar5416_rates {
-- 
1.7.7.2


^ permalink raw reply related

* Re: iwlagn is getting very shaky
From: Emmanuel Grumbach @ 2011-11-08  8:24 UTC (permalink / raw)
  To: Norbert Preining
  Cc: Guy, Wey-Yi, David Rientjes, linux-kernel@vger.kernel.org,
	ipw3945-devel@lists.sourceforge.net, ilw@linux.intel.com,
	linux-wireless@vger.kernel.org, Pekka Enberg
In-Reply-To: <CANUX_P06ww42p6N1k_P-Y1KMKOd1QgR_DxVWe19qtsEX2rfWpw@mail.gmail.com>

On Tue, Nov 8, 2011 at 10:07, Emmanuel Grumbach <egrumbach@gmail.com> wrote:
>>
>> In short, this is the output of your patch:
>> [  215.872090] iwlwifi 0000:06:00.0: Queue 11 stuck for 10000 ms.
>> [  215.872101] iwlwifi 0000:06:00.0: Current SW read_ptr 105 write_ptr 115
>> [  215.872156] iwlwifi 0000:06:00.0: Current HW read_ptr 105 write_ptr 115
>> [  215.872164] iwlwifi 0000:06:00.0: On demand firmware reload
>>
>>
> Ok thanks for that. The HW and the SW agree then...
>
> I would like to see what happens in terms or power.
> Please set the power debug flag: modprobe iwlwifi debug=0x100
>
> Thanks.
>

It may be worth to disable Link Power save too. I would be glad if you
could try this patch (attached and inlined), with the power debug flag
set.


diff --git a/drivers/net/wireless/iwlwifi/iwl-power.c
b/drivers/net/wireless/iwlwifi/iwl-power.c
index 4eaab20..e5f309b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-power.c
+++ b/drivers/net/wireless/iwlwifi/iwl-power.c
@@ -436,7 +436,7 @@ int iwl_power_update_mode(struct iwl_priv *priv, bool force)
 /* initialize to default */
 void iwl_power_initialize(struct iwl_priv *priv)
 {
-	priv->power_data.bus_pm = bus_get_pm_support(bus(priv));
+	priv->power_data.bus_pm = false;

 	priv->power_data.debug_sleep_level_override = -1;



Thanks for your patience !

^ permalink raw reply related

* Re: [PATCH] Fix linking with libnl-3
From: Johannes Berg @ 2011-11-08  8:20 UTC (permalink / raw)
  To: Gilles Espinasse; +Cc: linux-wireless
In-Reply-To: <1320739783-3415-1-git-send-email-g.esp@free.fr>

On Tue, 2011-11-08 at 09:09 +0100, Gilles Espinasse wrote:
> iw3.2 fail to link libnl-3.2.2 with this error
> /usr/bin/ld: cannot find -lnl-genl
> 
> Contrary to previous libnl version, on v3 there is a dedicated libnl-genl-3.0.pc file
> Simply use that.

Applied, thanks.


^ permalink raw reply

* [PATCH] cfg80211: fix missing kernel-doc
From: Johannes Berg @ 2011-11-08  8:20 UTC (permalink / raw)
  To: John Linville; +Cc: Helmut Schaa, linux-wireless

From: Johannes Berg <johannes.berg@intel.com>

Two new struct members were not documented, fix that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 include/net/cfg80211.h |    4 ++++
 1 file changed, 4 insertions(+)

--- a/include/net/cfg80211.h	2011-11-07 21:09:22.000000000 +0100
+++ b/include/net/cfg80211.h	2011-11-08 09:19:03.000000000 +0100
@@ -456,6 +456,9 @@ enum station_parameters_apply_mask {
  *	as the AC bitmap in the QoS info field
  * @max_sp: max Service Period. same format as the MAX_SP in the
  *	QoS info field (but already shifted down)
+ * @sta_modify_mask: bitmap indicating which parameters changed
+ *	(for those that don't have a natural "no change" value),
+ *	see &enum station_parameters_apply_mask
  */
 struct station_parameters {
 	u8 *supported_rates;
@@ -615,6 +618,7 @@ struct sta_bss_parameters {
  *	user space MLME/SME implementation. The information is provided for
  *	the cfg80211_new_sta() calls to notify user space of the IEs.
  * @assoc_req_ies_len: Length of assoc_req_ies buffer in octets.
+ * @sta_flags: station flags mask & values
  */
 struct station_info {
 	u32 filled;



^ permalink raw reply

* Re: [PATCH v6 1/2] wireless:  Support ht-capabilities over-rides.
From: Johannes Berg @ 2011-11-08  8:14 UTC (permalink / raw)
  To: greearb; +Cc: linux-wireless
In-Reply-To: <1320707676-17255-1-git-send-email-greearb@candelatech.com>

On Mon, 2011-11-07 at 15:14 -0800, greearb@candelatech.com wrote:

> +++ b/net/wireless/mlme.c
> @@ -501,13 +501,32 @@ int cfg80211_mlme_auth(struct cfg80211_registered_device *rdev,
>  	return err;
>  }
>  
> +/*  Do a logical ht_capa &= ht_capa_mask.  */
> +static void cfg80211_oper_and_ht_capa(struct ieee80211_ht_cap *ht_capa,
> +			const struct ieee80211_ht_cap *ht_capa_mask)
> +{
> +	int i;
> +	u8 *p1, *p2;
> +	if (!ht_capa_mask) {
> +		memset(ht_capa, 0, sizeof(*ht_capa));
> +		return;
> +	}
> +
> +	p1 = (u8*)(ht_capa);
> +	p2 = (u8*)(ht_capa_mask);
> +	for (i = 0; i<sizeof(*ht_capa); i++)
> +		p1[i] &= p2[i];
> +}

I think you also need to call this in the cfg80211_connect() path.

Also, maybe we should reject this configuration if the device didn't
support it at all, ie. ht_capa_mask was NULL? It also seems a bit odd to
allow this on a device that doesn't even support HT.

Also how would you feel about rejecting, instead of silently ignoring,
things that we do look at but don't support, e.g. a wrong A-MSDU
setting? Alternatively, cfg80211 could modify the settings in a way that
drivers don't have to worry about the "downgrade only" part.

Finally, I think we need a tad more documentation about how this is
supposed to work in case somebody wants to implement it on non-mac80211.
The way it's done right now it seems fairly error prone, with all
restrictions that the driver needs to implement like not allowing the
a-MSDU size to be increased.

johannes


^ permalink raw reply

* Re: iwlagn is getting very shaky
From: Emmanuel Grumbach @ 2011-11-08  8:07 UTC (permalink / raw)
  To: Norbert Preining
  Cc: Guy, Wey-Yi, David Rientjes, linux-kernel@vger.kernel.org,
	ipw3945-devel@lists.sourceforge.net, ilw@linux.intel.com,
	linux-wireless@vger.kernel.org, Pekka Enberg
In-Reply-To: <20111108043233.GA21171@gamma.logic.tuwien.ac.at>

>
> In short, this is the output of your patch:
> [  215.872090] iwlwifi 0000:06:00.0: Queue 11 stuck for 10000 ms.
> [  215.872101] iwlwifi 0000:06:00.0: Current SW read_ptr 105 write_ptr 115
> [  215.872156] iwlwifi 0000:06:00.0: Current HW read_ptr 105 write_ptr 115
> [  215.872164] iwlwifi 0000:06:00.0: On demand firmware reload
>
>
Ok thanks for that. The HW and the SW agree then...

I would like to see what happens in terms or power.
Please set the power debug flag: modprobe iwlwifi debug=0x100

Thanks.

^ permalink raw reply

* [PATCH] Fix linking with libnl-3
From: Gilles Espinasse @ 2011-11-08  8:09 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Gilles Espinasse

iw3.2 fail to link libnl-3.2.2 with this error
/usr/bin/ld: cannot find -lnl-genl

Contrary to previous libnl version, on v3 there is a dedicated libnl-genl-3.0.pc file
Simply use that.

Signed-off-by: Gilles Espinasse <g.esp@free.fr>
---
 Makefile |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 8443ee6..fb46324 100644
--- a/Makefile
+++ b/Makefile
@@ -36,10 +36,11 @@ LIBS += -lnl-genl
 NLLIBNAME = libnl-2.0
 endif
 
+# libnl-3 has a separate libnl-genl-3.0.pc
 ifeq ($(NL3FOUND),Y)
 CFLAGS += -DCONFIG_LIBNL30
-LIBS += -lnl-genl
-NLLIBNAME = libnl-3.0
+LIBS =
+NLLIBNAME = libnl-genl-3.0
 endif
 
 ifeq ($(NLLIBNAME),)
-- 
1.5.6.5


^ permalink raw reply related

* [PATCH 6/7] mwifiex: remove unnecessary free_priv handler
From: Bing Zhao @ 2011-11-08  5:41 UTC (permalink / raw)
  To: linux-wireless
  Cc: John W. Linville, Amitkumar Karwar, Kiran Divekar, Yogesh Powar,
	Frank Huang, Bing Zhao
In-Reply-To: <1320730872-25619-1-git-send-email-bzhao@marvell.com>

From: Amitkumar Karwar <akarwar@marvell.com>

Cfg80211 stack allocates private area for driver use in
struct cfg80211_bss. It will be freed by stack in bss_release().
Driver don't need to worry about it.

In mwifiex driver, we use the private area just to store band
information(u8). We don't allocate memory explicitly and store
it's pointer in bss->priv. Hence we don't have any cleanup work
to do in free_priv handler. Currently we try to free the allocated
private area in free_priv handler which is not correct.

This patch removes unnecessary free_priv handler.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
 drivers/net/wireless/mwifiex/scan.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c
index 8a3f959..c650e60 100644
--- a/drivers/net/wireless/mwifiex/scan.c
+++ b/drivers/net/wireless/mwifiex/scan.c
@@ -1535,11 +1535,6 @@ done:
 	return 0;
 }
 
-static void mwifiex_free_bss_priv(struct cfg80211_bss *bss)
-{
-	kfree(bss->priv);
-}
-
 /*
  * This function handles the command response of scan.
  *
@@ -1765,7 +1760,6 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
 					      cap_info_bitmap, beacon_period,
 					      ie_buf, ie_len, rssi, GFP_KERNEL);
 				*(u8 *)bss->priv = band;
-				bss->free_priv = mwifiex_free_bss_priv;
 
 				if (priv->media_connected && !memcmp(bssid,
 					priv->curr_bss_params.bss_descriptor
-- 
1.7.0.2


^ permalink raw reply related

* [PATCH 5/7] mwifiex: fix 'Smatch' warnings
From: Bing Zhao @ 2011-11-08  5:41 UTC (permalink / raw)
  To: linux-wireless
  Cc: John W. Linville, Amitkumar Karwar, Kiran Divekar, Yogesh Powar,
	Frank Huang, Bing Zhao
In-Reply-To: <1320730872-25619-1-git-send-email-bzhao@marvell.com>

From: Yogesh Ashok Powar <yogeshp@marvell.com>

Following three warnings are fixed:

>init.c +256 mwifiex_init_adapter(71)
>warn: variable dereferenced before check 'adapter->sleep_cfm'
>(see line 191)

>sta_rx.c +193 mwifiex_process_sta_rx_packet(75)
>warn: variable dereferenced before check 'priv' (see line 182)

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
 drivers/net/wireless/mwifiex/init.c   |    4 ++--
 drivers/net/wireless/mwifiex/sta_rx.c |   12 +++++++-----
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c
index d792b3f..2694045 100644
--- a/drivers/net/wireless/mwifiex/init.c
+++ b/drivers/net/wireless/mwifiex/init.c
@@ -187,8 +187,6 @@ static void mwifiex_init_adapter(struct mwifiex_adapter *adapter)
 	struct mwifiex_opt_sleep_confirm *sleep_cfm_buf = NULL;
 
 	skb_put(adapter->sleep_cfm, sizeof(struct mwifiex_opt_sleep_confirm));
-	sleep_cfm_buf = (struct mwifiex_opt_sleep_confirm *)
-						(adapter->sleep_cfm->data);
 
 	adapter->cmd_sent = false;
 
@@ -254,6 +252,8 @@ static void mwifiex_init_adapter(struct mwifiex_adapter *adapter)
 	mwifiex_wmm_init(adapter);
 
 	if (adapter->sleep_cfm) {
+		sleep_cfm_buf = (struct mwifiex_opt_sleep_confirm *)
+						adapter->sleep_cfm->data;
 		memset(sleep_cfm_buf, 0, adapter->sleep_cfm->len);
 		sleep_cfm_buf->command =
 				cpu_to_le16(HostCmd_CMD_802_11_PS_MODE_ENH);
diff --git a/drivers/net/wireless/mwifiex/sta_rx.c b/drivers/net/wireless/mwifiex/sta_rx.c
index 2743051..5e1ef7e 100644
--- a/drivers/net/wireless/mwifiex/sta_rx.c
+++ b/drivers/net/wireless/mwifiex/sta_rx.c
@@ -126,6 +126,9 @@ int mwifiex_process_sta_rx_packet(struct mwifiex_adapter *adapter,
 	u16 rx_pkt_type;
 	struct mwifiex_private *priv = adapter->priv[rx_info->bss_index];
 
+	if (!priv)
+		return -1;
+
 	local_rx_pd = (struct rxpd *) (skb->data);
 	rx_pkt_type = local_rx_pd->rx_pkt_type;
 
@@ -189,12 +192,11 @@ int mwifiex_process_sta_rx_packet(struct mwifiex_adapter *adapter,
 					     (u8) local_rx_pd->rx_pkt_type,
 					     skb);
 
-	if (ret || (rx_pkt_type == PKT_TYPE_BAR)) {
-		if (priv && (ret == -1))
-			priv->stats.rx_dropped++;
-
+	if (ret || (rx_pkt_type == PKT_TYPE_BAR))
 		dev_kfree_skb_any(skb);
-	}
+
+	if (ret)
+		priv->stats.rx_dropped++;
 
 	return ret;
 }
-- 
1.7.0.2


^ permalink raw reply related

* [PATCH 7/7] mwifiex: release bss structure returned by cfg80211_inform_bss()
From: Bing Zhao @ 2011-11-08  5:41 UTC (permalink / raw)
  To: linux-wireless
  Cc: John W. Linville, Amitkumar Karwar, Kiran Divekar, Yogesh Powar,
	Frank Huang, Bing Zhao, Johannes Berg
In-Reply-To: <1320730872-25619-1-git-send-email-bzhao@marvell.com>

From: Amitkumar Karwar <akarwar@marvell.com>

Following compilation warning is fixed by releasing referenced BSS
structure returned by cfg80211_inform_bss().

"warning: ignoring return value of cfg80211_inform_bss,
declared with attribute warn_unused_result"

Cc: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
This patch fixes the bug mentioned by Johannes Berg:
See "[PATCH] cfg80211: annotate cfg80211_inform_bss"

 drivers/net/wireless/mwifiex/cfg80211.c |    4 +++-
 drivers/net/wireless/mwifiex/scan.c     |    1 +
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index 462c710..e9ab9a3 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -780,6 +780,7 @@ static int mwifiex_cfg80211_inform_ibss_bss(struct mwifiex_private *priv)
 {
 	struct ieee80211_channel *chan;
 	struct mwifiex_bss_info bss_info;
+	struct cfg80211_bss *bss;
 	int ie_len;
 	u8 ie_buf[IEEE80211_MAX_SSID_LEN + sizeof(struct ieee_types_header)];
 	enum ieee80211_band band;
@@ -800,9 +801,10 @@ static int mwifiex_cfg80211_inform_ibss_bss(struct mwifiex_private *priv)
 			ieee80211_channel_to_frequency(bss_info.bss_chan,
 						       band));
 
-	cfg80211_inform_bss(priv->wdev->wiphy, chan,
+	bss = cfg80211_inform_bss(priv->wdev->wiphy, chan,
 		bss_info.bssid, 0, WLAN_CAPABILITY_IBSS,
 		0, ie_buf, ie_len, 0, GFP_KERNEL);
+	cfg80211_put_bss(bss);
 	memcpy(priv->cfg_bssid, bss_info.bssid, ETH_ALEN);
 
 	return 0;
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c
index c650e60..8a18bcc 100644
--- a/drivers/net/wireless/mwifiex/scan.c
+++ b/drivers/net/wireless/mwifiex/scan.c
@@ -1760,6 +1760,7 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
 					      cap_info_bitmap, beacon_period,
 					      ie_buf, ie_len, rssi, GFP_KERNEL);
 				*(u8 *)bss->priv = band;
+				cfg80211_put_bss(bss);
 
 				if (priv->media_connected && !memcmp(bssid,
 					priv->curr_bss_params.bss_descriptor
-- 
1.7.0.2


^ permalink raw reply related

* [PATCH 2/7] mwifiex: use existing helper function mwifiex_fill_cap_info
From: Bing Zhao @ 2011-11-08  5:41 UTC (permalink / raw)
  To: linux-wireless
  Cc: John W. Linville, Amitkumar Karwar, Kiran Divekar, Yogesh Powar,
	Frank Huang, Bing Zhao
In-Reply-To: <1320730872-25619-1-git-send-email-bzhao@marvell.com>

From: Yogesh Ashok Powar <yogeshp@marvell.com>

Use existing helper function mwifiex_fill_cap_info to fill
the HT CAP info for ibss beacons.

Also removing extra parenthesis block for better readability.

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>

Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
 drivers/net/wireless/mwifiex/join.c |   81 ++++++++++++++--------------------
 1 files changed, 33 insertions(+), 48 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c
index 062716c..b27bd33 100644
--- a/drivers/net/wireless/mwifiex/join.c
+++ b/drivers/net/wireless/mwifiex/join.c
@@ -724,8 +724,8 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
 	u32 cmd_append_size = 0;
 	u32 i;
 	u16 tmp_cap;
-	uint16_t ht_cap_info;
 	struct mwifiex_ie_types_chan_list_param_set *chan_tlv;
+	u8 radio_type;
 
 	struct mwifiex_ie_types_htcap *ht_cap;
 	struct mwifiex_ie_types_htinfo *ht_info;
@@ -914,55 +914,40 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
 	}
 
 	if (adapter->adhoc_11n_enabled) {
-		{
-			ht_cap = (struct mwifiex_ie_types_htcap *) pos;
-			memset(ht_cap, 0,
-			       sizeof(struct mwifiex_ie_types_htcap));
-			ht_cap->header.type =
-				cpu_to_le16(WLAN_EID_HT_CAPABILITY);
-			ht_cap->header.len =
-			       cpu_to_le16(sizeof(struct ieee80211_ht_cap));
-
-			ht_cap_info = IEEE80211_HT_CAP_SGI_20;
-			if (adapter->chan_offset) {
-				ht_cap_info |= IEEE80211_HT_CAP_SGI_40;
-				ht_cap_info |= IEEE80211_HT_CAP_DSSSCCK40;
-				ht_cap_info |= IEEE80211_HT_CAP_SUP_WIDTH_20_40;
-				SETHT_MCS32(ht_cap->ht_cap.mcs.rx_mask);
-			}
-			ht_cap->ht_cap.cap_info = cpu_to_le16(ht_cap_info);
-
-			ht_cap->ht_cap.ampdu_params_info
-					= IEEE80211_HT_MAX_AMPDU_64K;
-			ht_cap->ht_cap.mcs.rx_mask[0] = 0xff;
-			pos += sizeof(struct mwifiex_ie_types_htcap);
-			cmd_append_size +=
-				sizeof(struct mwifiex_ie_types_htcap);
-		}
-		{
-			ht_info = (struct mwifiex_ie_types_htinfo *) pos;
-			memset(ht_info, 0,
-			       sizeof(struct mwifiex_ie_types_htinfo));
-			ht_info->header.type =
-				cpu_to_le16(WLAN_EID_HT_INFORMATION);
-			ht_info->header.len =
-				cpu_to_le16(sizeof(struct ieee80211_ht_info));
-			ht_info->ht_info.control_chan =
-				(u8) priv->curr_bss_params.bss_descriptor.
-				channel;
-			if (adapter->chan_offset) {
-				ht_info->ht_info.ht_param =
-					adapter->chan_offset;
-				ht_info->ht_info.ht_param |=
+		/* Fill HT CAPABILITY */
+		ht_cap = (struct mwifiex_ie_types_htcap *) pos;
+		memset(ht_cap, 0, sizeof(struct mwifiex_ie_types_htcap));
+		ht_cap->header.type = cpu_to_le16(WLAN_EID_HT_CAPABILITY);
+		ht_cap->header.len =
+		       cpu_to_le16(sizeof(struct ieee80211_ht_cap));
+		radio_type = mwifiex_band_to_radio_type(
+					priv->adapter->config_bands);
+		mwifiex_fill_cap_info(priv, radio_type, ht_cap);
+
+		pos += sizeof(struct mwifiex_ie_types_htcap);
+		cmd_append_size +=
+			sizeof(struct mwifiex_ie_types_htcap);
+
+		/* Fill HT INFORMATION */
+		ht_info = (struct mwifiex_ie_types_htinfo *) pos;
+		memset(ht_info, 0, sizeof(struct mwifiex_ie_types_htinfo));
+		ht_info->header.type = cpu_to_le16(WLAN_EID_HT_INFORMATION);
+		ht_info->header.len =
+			cpu_to_le16(sizeof(struct ieee80211_ht_info));
+
+		ht_info->ht_info.control_chan =
+			(u8) priv->curr_bss_params.bss_descriptor.channel;
+		if (adapter->chan_offset) {
+			ht_info->ht_info.ht_param = adapter->chan_offset;
+			ht_info->ht_info.ht_param |=
 					IEEE80211_HT_PARAM_CHAN_WIDTH_ANY;
-			}
-			ht_info->ht_info.operation_mode =
-			     cpu_to_le16(IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT);
-			ht_info->ht_info.basic_set[0] = 0xff;
-			pos += sizeof(struct mwifiex_ie_types_htinfo);
-			cmd_append_size +=
-				sizeof(struct mwifiex_ie_types_htinfo);
 		}
+		ht_info->ht_info.operation_mode =
+		     cpu_to_le16(IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT);
+		ht_info->ht_info.basic_set[0] = 0xff;
+		pos += sizeof(struct mwifiex_ie_types_htinfo);
+		cmd_append_size +=
+			sizeof(struct mwifiex_ie_types_htinfo);
 	}
 
 	cmd->size = cpu_to_le16((u16)
-- 
1.7.0.2


^ permalink raw reply related

* [PATCH 4/7] mwifiex: fix coding style
From: Bing Zhao @ 2011-11-08  5:41 UTC (permalink / raw)
  To: linux-wireless
  Cc: John W. Linville, Amitkumar Karwar, Kiran Divekar, Yogesh Powar,
	Frank Huang, Bing Zhao
In-Reply-To: <1320730872-25619-1-git-send-email-bzhao@marvell.com>

From: Yogesh Ashok Powar <yogeshp@marvell.com>

Rename DataRate to data_rate and arrange 'for' loop
for better readability.

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
 drivers/net/wireless/mwifiex/fw.h   |    2 +-
 drivers/net/wireless/mwifiex/join.c |   17 ++++++++---------
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/fw.h b/drivers/net/wireless/mwifiex/fw.h
index 0cc5d73..35cb29c 100644
--- a/drivers/net/wireless/mwifiex/fw.h
+++ b/drivers/net/wireless/mwifiex/fw.h
@@ -673,7 +673,7 @@ struct host_cmd_ds_802_11_ad_hoc_start {
 	union ieee_types_phy_param_set phy_param_set;
 	u16 reserved1;
 	__le16 cap_info_bitmap;
-	u8 DataRate[HOSTCMD_SUPPORTED_RATES];
+	u8 data_rate[HOSTCMD_SUPPORTED_RATES];
 } __packed;
 
 struct host_cmd_ds_802_11_ad_hoc_result {
diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c
index b27bd33..1c49813 100644
--- a/drivers/net/wireless/mwifiex/join.c
+++ b/drivers/net/wireless/mwifiex/join.c
@@ -837,8 +837,8 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
 		bss_desc->privacy = MWIFIEX_802_11_PRIV_FILTER_ACCEPT_ALL;
 	}
 
-	memset(adhoc_start->DataRate, 0, sizeof(adhoc_start->DataRate));
-	mwifiex_get_active_data_rates(priv, adhoc_start->DataRate);
+	memset(adhoc_start->data_rate, 0, sizeof(adhoc_start->data_rate));
+	mwifiex_get_active_data_rates(priv, adhoc_start->data_rate);
 	if ((adapter->adhoc_start_band & BAND_G) &&
 	    (priv->curr_pkt_filter & HostCmd_ACT_MAC_ADHOC_G_PROTECTION_ON)) {
 		if (mwifiex_send_cmd_async(priv, HostCmd_CMD_MAC_CONTROL,
@@ -850,20 +850,19 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
 		}
 	}
 	/* Find the last non zero */
-	for (i = 0; i < sizeof(adhoc_start->DataRate) &&
-			adhoc_start->DataRate[i];
-			i++)
-			;
+	for (i = 0; i < sizeof(adhoc_start->data_rate); i++)
+		if (!adhoc_start->data_rate[i])
+			break;
 
 	priv->curr_bss_params.num_of_rates = i;
 
 	/* Copy the ad-hoc creating rates into Current BSS rate structure */
 	memcpy(&priv->curr_bss_params.data_rates,
-	       &adhoc_start->DataRate, priv->curr_bss_params.num_of_rates);
+	       &adhoc_start->data_rate, priv->curr_bss_params.num_of_rates);
 
 	dev_dbg(adapter->dev, "info: ADHOC_S_CMD: rates=%02x %02x %02x %02x\n",
-	       adhoc_start->DataRate[0], adhoc_start->DataRate[1],
-	       adhoc_start->DataRate[2], adhoc_start->DataRate[3]);
+	       adhoc_start->data_rate[0], adhoc_start->data_rate[1],
+	       adhoc_start->data_rate[2], adhoc_start->data_rate[3]);
 
 	dev_dbg(adapter->dev, "info: ADHOC_S_CMD: AD-HOC Start command is ready\n");
 
-- 
1.7.0.2


^ permalink raw reply related

* [PATCH 3/7] mwifiex: change return types to void
From: Bing Zhao @ 2011-11-08  5:41 UTC (permalink / raw)
  To: linux-wireless
  Cc: John W. Linville, Amitkumar Karwar, Kiran Divekar, Yogesh Powar,
	Frank Huang, Bing Zhao
In-Reply-To: <1320730872-25619-1-git-send-email-bzhao@marvell.com>

From: Yogesh Ashok Powar <yogeshp@marvell.com>

Functions mwifiex_11n_dispatch_pkt_until_start_win and
mwifiex_11n_scan_and_dispatch used to always return value
zero for all inputs. Changing these functions to void.

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
 drivers/net/wireless/mwifiex/11n_rxreorder.c |   18 ++++++------------
 1 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/11n_rxreorder.c b/drivers/net/wireless/mwifiex/11n_rxreorder.c
index 7aa9aa0..681d3f2 100644
--- a/drivers/net/wireless/mwifiex/11n_rxreorder.c
+++ b/drivers/net/wireless/mwifiex/11n_rxreorder.c
@@ -33,7 +33,7 @@
  * Since the buffer is linear, the function uses rotation to simulate
  * circular buffer.
  */
-static int
+static void
 mwifiex_11n_dispatch_pkt_until_start_win(struct mwifiex_private *priv,
 					 struct mwifiex_rx_reorder_tbl
 					 *rx_reor_tbl_ptr, int start_win)
@@ -71,8 +71,6 @@ mwifiex_11n_dispatch_pkt_until_start_win(struct mwifiex_private *priv,
 
 	rx_reor_tbl_ptr->start_win = start_win;
 	spin_unlock_irqrestore(&priv->rx_pkt_lock, flags);
-
-	return 0;
 }
 
 /*
@@ -83,7 +81,7 @@ mwifiex_11n_dispatch_pkt_until_start_win(struct mwifiex_private *priv,
  * Since the buffer is linear, the function uses rotation to simulate
  * circular buffer.
  */
-static int
+static void
 mwifiex_11n_scan_and_dispatch(struct mwifiex_private *priv,
 			      struct mwifiex_rx_reorder_tbl *rx_reor_tbl_ptr)
 {
@@ -119,7 +117,6 @@ mwifiex_11n_scan_and_dispatch(struct mwifiex_private *priv,
 	rx_reor_tbl_ptr->start_win = (rx_reor_tbl_ptr->start_win + i)
 		&(MAX_TID_VALUE - 1);
 	spin_unlock_irqrestore(&priv->rx_pkt_lock, flags);
-	return 0;
 }
 
 /*
@@ -405,7 +402,7 @@ int mwifiex_11n_rx_reorder_pkt(struct mwifiex_private *priv,
 				u8 *ta, u8 pkt_type, void *payload)
 {
 	struct mwifiex_rx_reorder_tbl *rx_reor_tbl_ptr;
-	int start_win, end_win, win_size, ret;
+	int start_win, end_win, win_size;
 	u16 pkt_index;
 
 	rx_reor_tbl_ptr =
@@ -452,11 +449,8 @@ int mwifiex_11n_rx_reorder_pkt(struct mwifiex_private *priv,
 			start_win = (end_win - win_size) + 1;
 		else
 			start_win = (MAX_TID_VALUE - (win_size - seq_num)) + 1;
-		ret = mwifiex_11n_dispatch_pkt_until_start_win(priv,
+		mwifiex_11n_dispatch_pkt_until_start_win(priv,
 						rx_reor_tbl_ptr, start_win);
-
-		if (ret)
-			return ret;
 	}
 
 	if (pkt_type != PKT_TYPE_BAR) {
@@ -475,9 +469,9 @@ int mwifiex_11n_rx_reorder_pkt(struct mwifiex_private *priv,
 	 * Dispatch all packets sequentially from start_win until a
 	 * hole is found and adjust the start_win appropriately
 	 */
-	ret = mwifiex_11n_scan_and_dispatch(priv, rx_reor_tbl_ptr);
+	mwifiex_11n_scan_and_dispatch(priv, rx_reor_tbl_ptr);
 
-	return ret;
+	return 0;
 }
 
 /*
-- 
1.7.0.2


^ permalink raw reply related

* [PATCH 1/7] mwifiex: fix ht_cap_info in ibss beacons
From: Bing Zhao @ 2011-11-08  5:41 UTC (permalink / raw)
  To: linux-wireless
  Cc: John W. Linville, Amitkumar Karwar, Kiran Divekar, Yogesh Powar,
	Frank Huang, Bing Zhao
In-Reply-To: <1320730872-25619-1-git-send-email-bzhao@marvell.com>

From: Yogesh Ashok Powar <yogeshp@marvell.com>

A local variable is used to calculate ht_cap_info.
Erroneously ht_cap.cap_info isn't updated in the ibss beacons
after the calculation. This patch fixes it.

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Kiran Divekar <dkiran@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
 drivers/net/wireless/mwifiex/join.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c
index 62b4c29..062716c 100644
--- a/drivers/net/wireless/mwifiex/join.c
+++ b/drivers/net/wireless/mwifiex/join.c
@@ -922,15 +922,15 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
 				cpu_to_le16(WLAN_EID_HT_CAPABILITY);
 			ht_cap->header.len =
 			       cpu_to_le16(sizeof(struct ieee80211_ht_cap));
-			ht_cap_info = le16_to_cpu(ht_cap->ht_cap.cap_info);
 
-			ht_cap_info |= IEEE80211_HT_CAP_SGI_20;
+			ht_cap_info = IEEE80211_HT_CAP_SGI_20;
 			if (adapter->chan_offset) {
 				ht_cap_info |= IEEE80211_HT_CAP_SGI_40;
 				ht_cap_info |= IEEE80211_HT_CAP_DSSSCCK40;
 				ht_cap_info |= IEEE80211_HT_CAP_SUP_WIDTH_20_40;
 				SETHT_MCS32(ht_cap->ht_cap.mcs.rx_mask);
 			}
+			ht_cap->ht_cap.cap_info = cpu_to_le16(ht_cap_info);
 
 			ht_cap->ht_cap.ampdu_params_info
 					= IEEE80211_HT_MAX_AMPDU_64K;
-- 
1.7.0.2


^ permalink raw reply related

* [PATCH 0/7] mwifiex: patch series for 3.3
From: Bing Zhao @ 2011-11-08  5:41 UTC (permalink / raw)
  To: linux-wireless
  Cc: John W. Linville, Amitkumar Karwar, Kiran Divekar, Yogesh Powar,
	Frank Huang, Bing Zhao

This series includes a fix for memory leak (7/7) and some code cleanups.

Thanks,
Bing
---

Amitkumar Karwar (2):
  mwifiex: remove unnecessary free_priv handler
  mwifiex: release bss structure returned by cfg80211_inform_bss()

Yogesh Ashok Powar (5):
  mwifiex: fix ht_cap_info in ibss beacons
  mwifiex: use existing helper function mwifiex_fill_cap_info
  mwifiex: change return types to void
  mwifiex: fix coding style
  mwifiex: fix 'Smatch' warnings

 drivers/net/wireless/mwifiex/11n_rxreorder.c |   18 ++---
 drivers/net/wireless/mwifiex/cfg80211.c      |    4 +-
 drivers/net/wireless/mwifiex/fw.h            |    2 +-
 drivers/net/wireless/mwifiex/init.c          |    4 +-
 drivers/net/wireless/mwifiex/join.c          |   96 +++++++++++---------------
 drivers/net/wireless/mwifiex/scan.c          |    7 +--
 drivers/net/wireless/mwifiex/sta_rx.c        |   12 ++--
 7 files changed, 60 insertions(+), 83 deletions(-)


^ permalink raw reply

* Re: iwlagn is getting very shaky
From: Norbert Preining @ 2011-11-08  4:32 UTC (permalink / raw)
  To: Guy, Wey-Yi
  Cc: David Rientjes, linux-kernel@vger.kernel.org,
	ipw3945-devel@lists.sourceforge.net, ilw@linux.intel.com,
	linux-wireless@vger.kernel.org, Pekka Enberg
In-Reply-To: <1320709047.31823.188.camel@wwguy-huron>

Hi Wey,

On Mo, 07 Nov 2011, Guy, Wey-Yi wrote:
> Could you please try with this patch?

new tests with 3.2.0-rc1, plus the patch you send. Starting from
cold state, so no suspend but hard off.

In short, this is the output of your patch:
[  215.872090] iwlwifi 0000:06:00.0: Queue 11 stuck for 10000 ms.
[  215.872101] iwlwifi 0000:06:00.0: Current SW read_ptr 105 write_ptr 115
[  215.872156] iwlwifi 0000:06:00.0: Current HW read_ptr 105 write_ptr 115
[  215.872164] iwlwifi 0000:06:00.0: On demand firmware reload


And here is the rest. As before, first work for short time, then WARNING
and hang, needs full reset with force_reset, finally works.

[   41.881266] Intel(R) Wireless WiFi Link AGN driver for Linux, in-tree:d
[   41.882703] Copyright(c) 2003-2011 Intel Corporation
[   41.884190] iwlwifi 0000:06:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
[   41.885578] iwlwifi 0000:06:00.0: setting latency timer to 64
[   41.885652] iwlwifi 0000:06:00.0: pci_resource_len = 0x00002000
[   41.887041] iwlwifi 0000:06:00.0: pci_resource_base = ffffc9001496c000
[   41.888403] iwlwifi 0000:06:00.0: HW Revision ID = 0x0
[   41.889885] iwlwifi 0000:06:00.0: irq 46 for MSI/MSI-X
[   41.889963] iwlwifi 0000:06:00.0: Detected Intel(R) WiFi Link 5100 AGN, REV=0x54
[   41.891401] iwlwifi 0000:06:00.0: L1 Enabled; Disabling L0S
[   41.914539] iwlwifi 0000:06:00.0: device EEPROM VER=0x11e, CALIB=0x4
[   41.915880] iwlwifi 0000:06:00.0: Device SKU: 0Xf0
[   41.917237] iwlwifi 0000:06:00.0: Tunable channels: 13 802.11bg, 24 802.11a channels
[   41.922968] iwlwifi 0000:06:00.0: loaded firmware version 8.83.5.1 build 33692 (EXP)
[   41.924485] Registered led device: phy0-led
[   41.969919] ieee80211 phy0: Selected rate control algorithm 'iwl-agn-rs'
[...]
[   47.917692] iwlwifi 0000:06:00.0: L1 Enabled; Disabling L0S
[   47.923032] iwlwifi 0000:06:00.0: Radio type=0x1-0x2-0x0
[   48.036928] iwlwifi 0000:06:00.0: L1 Enabled; Disabling L0S
[   48.041410] iwlwifi 0000:06:00.0: Radio type=0x1-0x2-0x0
[...]
[   55.646391] wlan0: direct probe to 00:24:c4:ab:bd:e0 (try 1/3)
[   55.844660] wlan0: direct probe to 00:24:c4:ab:bd:e0 (try 2/3)
[   56.044092] wlan0: direct probe to 00:24:c4:ab:bd:e0 (try 3/3)
[   56.244096] wlan0: direct probe to 00:24:c4:ab:bd:e0 timed out
[   64.277546] wlan0: direct probe to 00:24:c4:ab:bd:e0 (try 1/3)
[   64.476076] wlan0: direct probe to 00:24:c4:ab:bd:e0 (try 2/3)
[   64.676108] wlan0: direct probe to 00:24:c4:ab:bd:e0 (try 3/3)
[   64.876109] wlan0: direct probe to 00:24:c4:ab:bd:e0 timed out
[   72.841928] wlan0: authenticate with 00:24:c4:ab:bd:ef (try 1)
[   73.040056] wlan0: authenticate with 00:24:c4:ab:bd:ef (try 2)
[   73.040718] wlan0: authenticated
[   73.047334] wlan0: associate with 00:24:c4:ab:bd:ef (try 1)
[   73.244070] wlan0: associate with 00:24:c4:ab:bd:ef (try 2)
[   73.246336] wlan0: RX AssocResp from 00:24:c4:ab:bd:ef (capab=0x1 status=0 aid=3)
[   73.246339] wlan0: associated

Up to here it probably worked, but I cannot guarantee, that was while
gnome3 was working its way through tons of initialization.

[   81.628826] iwlwifi 0000:06:00.0: Tx aggregation enabled on ra = 00:24:c4:ab:bd:ef tid = 0
[  106.547117] wlan0: direct probe to 00:24:c4:ab:bd:e0 (try 1/3)
[  106.744017] wlan0: direct probe to 00:24:c4:ab:bd:e0 (try 2/3)
[  106.944087] wlan0: direct probe to 00:24:c4:ab:bd:e0 (try 3/3)
[  107.148023] wlan0: direct probe to 00:24:c4:ab:bd:e0 timed out
[  118.254103] wlan0: deauthenticating from 00:24:c4:ab:bd:ef by local choice (reason=2)
[  118.265841] cfg80211: Calling CRDA for country: JP
[  118.276060] wlan0: direct probe to 00:24:c4:ab:bd:e0 (try 1/3)
[  118.476081] wlan0: direct probe to 00:24:c4:ab:bd:e0 (try 2/3)
[  118.676032] wlan0: direct probe to 00:24:c4:ab:bd:e0 (try 3/3)
[  118.876024] wlan0: direct probe to 00:24:c4:ab:bd:e0 timed out
[  126.839944] wlan0: authenticate with 00:24:c4:ab:bd:ef (try 1)
[  126.840763] wlan0: authenticated
[  126.841851] wlan0: associate with 00:24:c4:ab:bd:ef (try 1)
[  126.844961] wlan0: RX ReassocResp from 00:24:c4:ab:bd:ef (capab=0x1 status=0 aid=3)
[  126.844965] wlan0: associated
[  136.116943] iwlwifi 0000:06:00.0: Tx aggregation enabled on ra = 00:24:c4:ab:bd:ef tid = 0
[  146.550560] wlan0: direct probe to 00:24:c4:ab:bd:e0 (try 1/3)
[  146.748058] wlan0: direct probe to 00:24:c4:ab:bd:e0 (try 2/3)
[  146.948062] wlan0: direct probe to 00:24:c4:ab:bd:e0 (try 3/3)
[  147.148052] wlan0: direct probe to 00:24:c4:ab:bd:e0 timed out
[  158.039627] wlan0: deauthenticating from 00:24:c4:ab:bd:ef by local choice (reason=2)
[  158.081078] cfg80211: Calling CRDA to update world regulatory domain
[  158.085453] wlan0: authenticate with 00:24:c4:ab:bd:ef (try 1)
[  158.088031] wlan0: authenticated
[  158.092327] wlan0: associate with 00:24:c4:ab:bd:ef (try 1)
[  158.094338] wlan0: RX ReassocResp from 00:24:c4:ab:bd:ef (capab=0x1 status=0 aid=3)
[  158.094341] wlan0: associated
[  206.605041] iwlwifi 0000:06:00.0: Tx aggregation enabled on ra = 00:24:c4:ab:bd:ef tid = 0
[  206.605062] ------------[ cut here ]------------
[  206.605101] WARNING: at drivers/net/wireless/iwlwifi/iwl-trans-pcie.c:1105 iwl_trans_pcie_tx+0x180/0x661 [iwlwifi]()
[  206.605110] Hardware name: VGN-Z11VN_B
[  206.605114] Modules linked in: rfcomm bnep vboxpci(O) vboxnetadp(O) vboxnetflt(O) vboxdrv(O) snd_hrtimer binfmt_misc dm_crypt dm_mod isofs btrfs zlib_deflate crc32c libcrc32c vfat fat fuse loop uinput snd_hda_codec_realtek snd_hda_intel snd_hda_codec snd_hwdep snd_pcm_oss snd_mixer_oss arc4 snd_pcm iwlwifi snd_seq_dummy snd_seq_oss snd_seq_midi snd_rawmidi snd_seq_midi_event mac80211 snd_seq sony_laptop(O) snd_timer snd_seq_device snd cfg80211 btusb bluetooth mxm_wmi firewire_ohci rfkill crc16 joydev soundcore snd_page_alloc firewire_core crc_itu_t tpm_infineon
[  206.605244] Pid: 717, comm: kworker/u:4 Tainted: G           O 3.2.0-rc1+ #44
[  206.605250] Call Trace:
[  206.605255]  <IRQ>  [<ffffffff81038475>] warn_slowpath_common+0x83/0x9b
[  206.605281]  [<ffffffff810384a7>] warn_slowpath_null+0x1a/0x1c
[  206.605305]  [<ffffffffa01fdaf7>] iwl_trans_pcie_tx+0x180/0x661 [iwlwifi]
[  206.605328]  [<ffffffffa01e72b2>] ? iwlagn_temperature+0x1a/0x1c [iwlwifi]
[  206.605341]  [<ffffffff810d381d>] ? kmem_cache_alloc+0x44/0xb9
[  206.605362]  [<ffffffffa01e5a1d>] iwlagn_tx_skb+0x87b/0x91b [iwlwifi]
[  206.605376]  [<ffffffff81408758>] ? _raw_spin_unlock_irqrestore+0x2e/0x30
[  206.605393]  [<ffffffffa01dbf8c>] iwlagn_mac_tx+0x131/0x1a2 [iwlwifi]
[  206.605419]  [<ffffffffa019cc56>] ? ieee80211_tx_h_fragment+0x16/0x22c [mac80211]
[  206.605444]  [<ffffffffa01feb13>] ? iwl_rx_queue_update_write_ptr+0x138/0x141 [iwlwifi]
[  206.605474]  [<ffffffffa0190f94>] __ieee80211_tx+0x176/0x1cf [mac80211]
[  206.605494]  [<ffffffffa019cbc8>] ? ieee80211_tx_h_calculate_duration+0x4c/0x65 [mac80211]
[  206.605524]  [<ffffffffa0191d5a>] ieee80211_tx+0x97/0xaf [mac80211]
[  206.605556]  [<ffffffffa0192c56>] ieee80211_tx_pending+0xf0/0x1c3 [mac80211]
[  206.605568]  [<ffffffff8103dbee>] tasklet_action+0x77/0xc2
[  206.605578]  [<ffffffff8103dd2f>] __do_softirq+0xbc/0x1a5
[  206.605590]  [<ffffffff8140a3cc>] call_softirq+0x1c/0x30
[  206.605596]  <EOI>  [<ffffffff8100359e>] do_softirq+0x38/0x6e
[  206.605613]  [<ffffffff8103d9f5>] _local_bh_enable_ip.isra.12+0x7d/0xa0
[  206.605623]  [<ffffffff8103da26>] local_bh_enable_ip+0xe/0x10
[  206.605632]  [<ffffffff814085ca>] _raw_spin_unlock_bh+0x23/0x25
[  206.605657]  [<ffffffffa0180c64>] ieee80211_agg_tx_operational+0x99/0xa4 [mac80211]
[  206.605683]  [<ffffffffa01817b2>] ieee80211_process_addba_resp+0xb8/0xf2 [mac80211]
[  206.605697]  [<ffffffff81064840>] ? in_lock_functions+0x1a/0x1d
[  206.605724]  [<ffffffffa0188a82>] ieee80211_iface_work+0x130/0x2b5 [mac80211]
[  206.605751]  [<ffffffffa0188952>] ? ieee80211_teardown_sdata+0xcc/0xcc [mac80211]
[  206.605764]  [<ffffffff8104de2c>] process_one_work+0x17b/0x2bd
[  206.605774]  [<ffffffff8104c471>] ? need_to_create_worker+0x12/0x26
[  206.605785]  [<ffffffff8104ef27>] worker_thread+0xdb/0x15f
[  206.605795]  [<ffffffff8104ee4c>] ? manage_workers.isra.24+0x171/0x171
[  206.605806]  [<ffffffff8105260d>] kthread+0x84/0x8c
[  206.605817]  [<ffffffff8140a2d4>] kernel_thread_helper+0x4/0x10
[  206.605829]  [<ffffffff81052589>] ? kthread_worker_fn+0x148/0x148
[  206.605839]  [<ffffffff8140a2d0>] ? gs_change+0xb/0xb
[  206.605847] ---[ end trace b36eae6e58c8ed31 ]---
[  206.614587] wlan0: direct probe to 00:24:c4:ab:bd:e0 (try 1/3)
[  206.812155] wlan0: direct probe to 00:24:c4:ab:bd:e0 (try 2/3)
[  207.012096] wlan0: direct probe to 00:24:c4:ab:bd:e0 (try 3/3)
[  207.212105] wlan0: direct probe to 00:24:c4:ab:bd:e0 timed out

Here comes the output of the patch you sent:

[  215.872090] iwlwifi 0000:06:00.0: Queue 11 stuck for 10000 ms.
[  215.872101] iwlwifi 0000:06:00.0: Current SW read_ptr 105 write_ptr 115
[  215.872156] iwlwifi 0000:06:00.0: Current HW read_ptr 105 write_ptr 115
[  215.872164] iwlwifi 0000:06:00.0: On demand firmware reload

echo 1 onto /sys/kernel/debug/...../force_reset

[  215.872600] ieee80211 phy0: Hardware restart was requested
[  215.872815] iwlwifi 0000:06:00.0: L1 Enabled; Disabling L0S
[  215.875847] iwlwifi 0000:06:00.0: Radio type=0x1-0x2-0x0
[  215.927777] wlan0: deauthenticating from 00:24:c4:ab:bd:ef by local choice (reason=2)
[  215.960954] cfg80211: Calling CRDA to update world regulatory domain
[  215.972261] wlan0: direct probe to 00:24:c4:ab:bd:e0 (try 1/3)
[  216.172107] wlan0: direct probe to 00:24:c4:ab:bd:e0 (try 2/3)
[  216.372070] wlan0: direct probe to 00:24:c4:ab:bd:e0 (try 3/3)
[  216.572123] wlan0: direct probe to 00:24:c4:ab:bd:e0 timed out
[  221.368107] usb 8-2: USB disconnect, device number 2
[  224.604953] wlan0: authenticate with 00:24:c4:ab:bd:ef (try 1)
[  224.605664] wlan0: authenticated
[  224.606873] wlan0: associate with 00:24:c4:ab:bd:ef (try 1)
[  224.608866] wlan0: RX ReassocResp from 00:24:c4:ab:bd:ef (capab=0x1 status=0 aid=3)
[  224.608869] wlan0: associated
[  329.901051] iwlwifi 0000:06:00.0: Tx aggregation enabled on ra = 00:24:c4:ab:bd:ef tid = 6
[  332.477994] iwlwifi 0000:06:00.0: On demand firmware reload
[  332.478449] ieee80211 phy0: Hardware restart was requested
[  332.478532] iwlwifi 0000:06:00.0: L1 Enabled; Disabling L0S
[  332.481587] iwlwifi 0000:06:00.0: Radio type=0x1-0x2-0x0
[  416.866720] iwlwifi 0000:06:00.0: Tx aggregation enabled on ra = 00:24:c4:ab:bd:ef tid = 0
[  416.932995] iwlwifi 0000:06:00.0: Tx aggregation enabled on ra = 00:24:c4:ab:bd:ef tid = 6

from here on it started to work.

Best wishes

Norbert
------------------------------------------------------------------------
Norbert Preining            preining@{jaist.ac.jp, logic.at, debian.org}
JAIST, Japan                                 TeX Live & Debian Developer
DSA: 0x09C5B094   fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094
------------------------------------------------------------------------
BOOK	What to do if you find yourself stuck in a crack in the ground
	underneath a giant boulder you can't move, with no hope of
	rescue. Consider how lucky you are that life has been good to
	you so far. Alternatively, if life hasn't been good to you so
	far, which given your current circumstances seems more likely,
	consider how lucky you are that it won't be troubling you much
	longer.
                 --- Comforting advice for Ford and Arthur in this current
                 --- situation, Fit the Eighth.
                 --- Douglas Adams, The Hitchhikers Guide to the Galaxy

^ permalink raw reply

* [PATCH RESEND 4/4] mwifiex: prevent corruption instead of just warning
From: Bing Zhao @ 2011-11-08  3:31 UTC (permalink / raw)
  To: linux-wireless
  Cc: John W. Linville, Dan Carpenter, Amitkumar Karwar, Kiran Divekar,
	Yogesh Powar, Frank Huang, Bing Zhao
In-Reply-To: <1320723107-24202-1-git-send-email-bzhao@marvell.com>

From: Dan Carpenter <dan.carpenter@oracle.com>

Probably we never hit this condition, but in case we do, we may as
well put a return here instead of just printing a warning message and
then corrupting memory.  The caller doesn't check the return code.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Bing Zhao <bzhao@marvell.com>
---
 drivers/net/wireless/mwifiex/pcie.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c
index d12d440..a2f3200 100644
--- a/drivers/net/wireless/mwifiex/pcie.c
+++ b/drivers/net/wireless/mwifiex/pcie.c
@@ -1228,9 +1228,12 @@ static int mwifiex_pcie_event_complete(struct mwifiex_adapter *adapter,
 	if (!skb)
 		return 0;
 
-	if (rdptr >= MWIFIEX_MAX_EVT_BD)
+	if (rdptr >= MWIFIEX_MAX_EVT_BD) {
 		dev_err(adapter->dev, "event_complete: Invalid rdptr 0x%x\n",
 					rdptr);
+		ret = -EINVAL;
+		goto done;
+	}
 
 	/* Read the event ring write pointer set by firmware */
 	if (mwifiex_read_reg(adapter, REG_EVTBD_WRPTR, &wrptr)) {
-- 
1.7.0.2


^ permalink raw reply related

* [PATCH RESEND 1/4] mwifiex: remove unneeded kfree(NULL);
From: Bing Zhao @ 2011-11-08  3:31 UTC (permalink / raw)
  To: linux-wireless
  Cc: John W. Linville, Dan Carpenter, Amitkumar Karwar, Kiran Divekar,
	Yogesh Powar, Frank Huang, Bing Zhao
In-Reply-To: <1320723107-24202-1-git-send-email-bzhao@marvell.com>

From: Dan Carpenter <dan.carpenter@oracle.com>

The previous if statement means this that pointer is NULL so there
is no need to free it.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Bing Zhao <bzhao@marvell.com>
---
 drivers/net/wireless/mwifiex/pcie.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c
index d34acf0..4466976 100644
--- a/drivers/net/wireless/mwifiex/pcie.c
+++ b/drivers/net/wireless/mwifiex/pcie.c
@@ -386,7 +386,6 @@ static int mwifiex_pcie_create_txbd_ring(struct mwifiex_adapter *adapter)
 	card->txbd_ring_vbase = kzalloc(card->txbd_ring_size, GFP_KERNEL);
 	if (!card->txbd_ring_vbase) {
 		dev_err(adapter->dev, "Unable to allocate buffer for txbd ring.\n");
-		kfree(card->txbd_ring_vbase);
 		return -1;
 	}
 	card->txbd_ring_pbase = virt_to_phys(card->txbd_ring_vbase);
-- 
1.7.0.2


^ permalink raw reply related

* [PATCH RESEND 3/4] mwifiex: enable SDIO multiport aggregation
From: Bing Zhao @ 2011-11-08  3:31 UTC (permalink / raw)
  To: linux-wireless
  Cc: John W. Linville, Dan Carpenter, Amitkumar Karwar, Kiran Divekar,
	Yogesh Powar, Frank Huang, Bing Zhao
In-Reply-To: <1320723107-24202-1-git-send-email-bzhao@marvell.com>

From: Amitkumar Karwar <akarwar@marvell.com>

By default SDIO multiport aggregation is disabled. It's useful to
get good throughput results. This patch enables it.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
 drivers/net/wireless/mwifiex/sdio.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c
index 283171b..ffaf3f3 100644
--- a/drivers/net/wireless/mwifiex/sdio.c
+++ b/drivers/net/wireless/mwifiex/sdio.c
@@ -1630,14 +1630,14 @@ static int mwifiex_init_sdio(struct mwifiex_adapter *adapter)
 	card->mpa_tx.pkt_cnt = 0;
 	card->mpa_tx.start_port = 0;
 
-	card->mpa_tx.enabled = 0;
+	card->mpa_tx.enabled = 1;
 	card->mpa_tx.pkt_aggr_limit = SDIO_MP_AGGR_DEF_PKT_LIMIT;
 
 	card->mpa_rx.buf_len = 0;
 	card->mpa_rx.pkt_cnt = 0;
 	card->mpa_rx.start_port = 0;
 
-	card->mpa_rx.enabled = 0;
+	card->mpa_rx.enabled = 1;
 	card->mpa_rx.pkt_aggr_limit = SDIO_MP_AGGR_DEF_PKT_LIMIT;
 
 	/* Allocate buffers for SDIO MP-A */
-- 
1.7.0.2


^ permalink raw reply related

* [PATCH RESEND 2/4] mwifiex: remove an unneeded NULL check
From: Bing Zhao @ 2011-11-08  3:31 UTC (permalink / raw)
  To: linux-wireless
  Cc: John W. Linville, Dan Carpenter, Amitkumar Karwar, Kiran Divekar,
	Yogesh Powar, Frank Huang, Bing Zhao
In-Reply-To: <1320723107-24202-1-git-send-email-bzhao@marvell.com>

From: Dan Carpenter <dan.carpenter@oracle.com>

We dereference adapter in the error handling code so this needed to
be fixed.  This function is always called like:
	adapter->if_ops.host_to_card(adapter, ...);
so adapter can never be NULL and I've removed the NULL check.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Bing Zhao <bzhao@marvell.com>
---
 drivers/net/wireless/mwifiex/pcie.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c
index 4466976..d12d440 100644
--- a/drivers/net/wireless/mwifiex/pcie.c
+++ b/drivers/net/wireless/mwifiex/pcie.c
@@ -1671,9 +1671,8 @@ static int mwifiex_pcie_host_to_card(struct mwifiex_adapter *adapter, u8 type,
 				     struct sk_buff *skb,
 				     struct mwifiex_tx_param *tx_param)
 {
-	if (!adapter || !skb) {
-		dev_err(adapter->dev, "Invalid parameter in %s <%p, %p>\n",
-				__func__, adapter, skb);
+	if (!skb) {
+		dev_err(adapter->dev, "Passed NULL skb to %s\n", __func__);
 		return -1;
 	}
 
-- 
1.7.0.2


^ permalink raw reply related


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