Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH 3/3] ath: fix dynamic user regulatory domain support
From: Luis R. Rodriguez @ 2013-10-29 22:39 UTC (permalink / raw)
  To: linville, johannes; +Cc: linux-wireless, Luis R. Rodriguez
In-Reply-To: <1383086346-2096-1-git-send-email-mcgrof@do-not-panic.com>

As it stands dynamic user regulatory domain support is
only possible for a few programmed regulatory domains as
a few countries do not allow for this.

The existing code however only would take advantage of
the feature if a custom world regulatory domain is used
though as that's when we clear beconing flags. We need
to lift this restriction as otherwise this feature is
pointless.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
 drivers/net/wireless/ath/regd.c | 26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
index 5790aa2..b2c5e41 100644
--- a/drivers/net/wireless/ath/regd.c
+++ b/drivers/net/wireless/ath/regd.c
@@ -296,6 +296,7 @@ static void ath_force_no_ir_freq(struct wiphy *wiphy, u16 center_freq)
 
 static void
 __ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
+				struct ath_regulatory *reg,
 				enum nl80211_reg_initiator initiator,
 				struct ieee80211_channel *ch)
 {
@@ -307,6 +308,9 @@ __ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
 	case NL80211_REGDOM_SET_BY_COUNTRY_IE:
 		ath_force_clear_no_ir_chan(wiphy, ch);
 		break;
+	case NL80211_REGDOM_SET_BY_USER:
+		if (ath_reg_dyn_country_user_allow(reg))
+			ath_force_clear_no_ir_chan(wiphy, ch);
 	default:
 		if (ch->beacon_found)
 			ch->flags &= ~IEEE80211_CHAN_NO_IR;
@@ -322,6 +326,7 @@ __ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
  */
 static void
 ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
+			      struct ath_regulatory *reg,
 			      enum nl80211_reg_initiator initiator)
 {
 	enum ieee80211_band band;
@@ -335,8 +340,8 @@ ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
 		sband = wiphy->bands[band];
 		for (i = 0; i < sband->n_channels; i++) {
 			ch = &sband->channels[i];
-			__ath_reg_apply_beaconing_flags(wiphy, initiator, ch);
-
+			__ath_reg_apply_beaconing_flags(wiphy, reg,
+							initiator, ch);
 		}
 	}
 }
@@ -357,7 +362,8 @@ ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
  */
 static void
 ath_reg_apply_ir_flags(struct wiphy *wiphy,
-				enum nl80211_reg_initiator initiator)
+		       struct ath_regulatory *reg,
+		       enum nl80211_reg_initiator initiator)
 {
 	struct ieee80211_supported_band *sband;
 
@@ -370,6 +376,11 @@ ath_reg_apply_ir_flags(struct wiphy *wiphy,
 		ath_force_clear_no_ir_freq(wiphy, 2467);
 		ath_force_clear_no_ir_freq(wiphy, 2472);
 		break;
+	case NL80211_REGDOM_SET_BY_USER:
+		if (!ath_reg_dyn_country_user_allow(reg))
+			break;
+		ath_force_clear_no_ir_freq(wiphy, 2467);
+		ath_force_clear_no_ir_freq(wiphy, 2472);
 	default:
 		ath_force_no_ir_freq(wiphy, 2467);
 		ath_force_no_ir_freq(wiphy, 2472);
@@ -418,12 +429,15 @@ static void ath_reg_apply_world_flags(struct wiphy *wiphy,
 	case 0x66:
 	case 0x67:
 	case 0x6C:
-		ath_reg_apply_beaconing_flags(wiphy, initiator);
+		ath_reg_apply_beaconing_flags(wiphy, reg, initiator);
 		break;
 	case 0x68:
-		ath_reg_apply_beaconing_flags(wiphy, initiator);
-		ath_reg_apply_ir_flags(wiphy, initiator);
+		ath_reg_apply_beaconing_flags(wiphy, reg, initiator);
+		ath_reg_apply_ir_flags(wiphy, reg, initiator);
 		break;
+	default:
+		if (ath_reg_dyn_country_user_allow(reg))
+			ath_reg_apply_beaconing_flags(wiphy, reg, initiator);
 	}
 }
 
-- 
1.8.4.rc3


^ permalink raw reply related

* Re: [PATCH 3/3] ath: fix dynamic user regulatory domain support
From: Joe Perches @ 2013-10-29 22:51 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: linville, johannes, linux-wireless
In-Reply-To: <1383086346-2096-4-git-send-email-mcgrof@do-not-panic.com>

On Tue, 2013-10-29 at 23:39 +0100, Luis R. Rodriguez wrote:
> As it stands dynamic user regulatory domain support is
> only possible for a few programmed regulatory domains as
> a few countries do not allow for this.
[]
> diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
][
> @@ -296,6 +296,7 @@ static void ath_force_no_ir_freq(struct wiphy *wiphy, u16 center_freq)
>  
>  static void
>  __ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
> +				struct ath_regulatory *reg,
>  				enum nl80211_reg_initiator initiator,
>  				struct ieee80211_channel *ch)
>  {
> @@ -307,6 +308,9 @@ __ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
>  	case NL80211_REGDOM_SET_BY_COUNTRY_IE:
>  		ath_force_clear_no_ir_chan(wiphy, ch);
>  		break;
> +	case NL80211_REGDOM_SET_BY_USER:
> +		if (ath_reg_dyn_country_user_allow(reg))
> +			ath_force_clear_no_ir_chan(wiphy, ch);

Nicer to add explicit /* fallthrough */

>  	default:
>  		if (ch->beacon_found)
>  			ch->flags &= ~IEEE80211_CHAN_NO_IR;

> @@ -370,6 +376,11 @@ ath_reg_apply_ir_flags(struct wiphy *wiphy,
>  		ath_force_clear_no_ir_freq(wiphy, 2467);
>  		ath_force_clear_no_ir_freq(wiphy, 2472);
>  		break;
> +	case NL80211_REGDOM_SET_BY_USER:
> +		if (!ath_reg_dyn_country_user_allow(reg))
> +			break;
> +		ath_force_clear_no_ir_freq(wiphy, 2467);
> +		ath_force_clear_no_ir_freq(wiphy, 2472);

Missing break?

>  	default:
>  		ath_force_no_ir_freq(wiphy, 2467);
>  		ath_force_no_ir_freq(wiphy, 2472);



^ permalink raw reply

* [PATCH v2 3/3] ath: fix dynamic user regulatory domain support
From: Luis R. Rodriguez @ 2013-10-29 23:10 UTC (permalink / raw)
  To: linville, johannes; +Cc: linux-wireless, Luis R. Rodriguez

As it stands dynamic user regulatory domain support is
only possible for a few programmed regulatory domains as
a few countries do not allow for this.

The existing code however only would take advantage of
the feature if a custom world regulatory domain is used
though as that's when we clear beconing flags. We need
to lift this restriction as otherwise this feature is
pointless.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---

This fixes the issues spotted by Joe.

 drivers/net/wireless/ath/regd.c | 28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
index 5790aa2..3480201 100644
--- a/drivers/net/wireless/ath/regd.c
+++ b/drivers/net/wireless/ath/regd.c
@@ -296,6 +296,7 @@ static void ath_force_no_ir_freq(struct wiphy *wiphy, u16 center_freq)
 
 static void
 __ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
+				struct ath_regulatory *reg,
 				enum nl80211_reg_initiator initiator,
 				struct ieee80211_channel *ch)
 {
@@ -307,6 +308,10 @@ __ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
 	case NL80211_REGDOM_SET_BY_COUNTRY_IE:
 		ath_force_clear_no_ir_chan(wiphy, ch);
 		break;
+	case NL80211_REGDOM_SET_BY_USER:
+		if (ath_reg_dyn_country_user_allow(reg))
+			ath_force_clear_no_ir_chan(wiphy, ch);
+		break;
 	default:
 		if (ch->beacon_found)
 			ch->flags &= ~IEEE80211_CHAN_NO_IR;
@@ -322,6 +327,7 @@ __ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
  */
 static void
 ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
+			      struct ath_regulatory *reg,
 			      enum nl80211_reg_initiator initiator)
 {
 	enum ieee80211_band band;
@@ -335,8 +341,8 @@ ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
 		sband = wiphy->bands[band];
 		for (i = 0; i < sband->n_channels; i++) {
 			ch = &sband->channels[i];
-			__ath_reg_apply_beaconing_flags(wiphy, initiator, ch);
-
+			__ath_reg_apply_beaconing_flags(wiphy, reg,
+							initiator, ch);
 		}
 	}
 }
@@ -357,7 +363,8 @@ ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
  */
 static void
 ath_reg_apply_ir_flags(struct wiphy *wiphy,
-				enum nl80211_reg_initiator initiator)
+		       struct ath_regulatory *reg,
+		       enum nl80211_reg_initiator initiator)
 {
 	struct ieee80211_supported_band *sband;
 
@@ -370,6 +377,12 @@ ath_reg_apply_ir_flags(struct wiphy *wiphy,
 		ath_force_clear_no_ir_freq(wiphy, 2467);
 		ath_force_clear_no_ir_freq(wiphy, 2472);
 		break;
+	case NL80211_REGDOM_SET_BY_USER:
+		if (!ath_reg_dyn_country_user_allow(reg))
+			break;
+		ath_force_clear_no_ir_freq(wiphy, 2467);
+		ath_force_clear_no_ir_freq(wiphy, 2472);
+		break;
 	default:
 		ath_force_no_ir_freq(wiphy, 2467);
 		ath_force_no_ir_freq(wiphy, 2472);
@@ -418,12 +431,15 @@ static void ath_reg_apply_world_flags(struct wiphy *wiphy,
 	case 0x66:
 	case 0x67:
 	case 0x6C:
-		ath_reg_apply_beaconing_flags(wiphy, initiator);
+		ath_reg_apply_beaconing_flags(wiphy, reg, initiator);
 		break;
 	case 0x68:
-		ath_reg_apply_beaconing_flags(wiphy, initiator);
-		ath_reg_apply_ir_flags(wiphy, initiator);
+		ath_reg_apply_beaconing_flags(wiphy, reg, initiator);
+		ath_reg_apply_ir_flags(wiphy, reg, initiator);
 		break;
+	default:
+		if (ath_reg_dyn_country_user_allow(reg))
+			ath_reg_apply_beaconing_flags(wiphy, reg, initiator);
 	}
 }
 
-- 
1.8.4.rc3


^ permalink raw reply related

* Re: [PATCH 3/3] ath: fix dynamic user regulatory domain support
From: Luis R. Rodriguez @ 2013-10-29 23:10 UTC (permalink / raw)
  To: Joe Perches; +Cc: John W. Linville, Johannes Berg, linux-wireless
In-Reply-To: <1383087091.12439.33.camel@joe-AO722>

On Tue, Oct 29, 2013 at 11:51 PM, Joe Perches <joe@perches.com> wrote:
> Missing break?

Bug, that's what I get for working until midnight, I should know
better to balance my work.... damn it. Thanks for the review.

  Luis

^ permalink raw reply

* Re: iwlegacy (4965) - what would 0x8000 as the completed TX rate indicate?
From: Adrian Chadd @ 2013-10-30  3:59 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless@vger.kernel.org
In-Reply-To: <1383033823.14377.1.camel@jlt4.sipsolutions.net>

On 29 October 2013 01:03, Johannes Berg <johannes@sipsolutions.net> wrote:

>> Well, what's rate=0 mean?
>>
>> And 0x8000 is bit 11 set, which is HT40. I definitely don't have HT40 enabled.
>
> 0x8000 is bit 15 set, which means "antenna B", I think?

Duh, sorry. was tired. :(

> But then I can't seem to figure out what rate=0 means either. Should be
> an OFDM rate (bit 9 not set) but 0 isn't a valid OFDM rate value. Hmm.

That's why I'm confused too.

I'm seeing some odd behaviour here where sometimes the NIC behaves
fine, and sometimes it just gets long transmit failures on OFDM frames
but is fine with CCK frames. That's why I'm digging into this.

I also see the sensitivity tuning code lose the plot over time as OFDM
errors are returned by the receiver and it keeps trying to compensate
until it's maxed out the sensitivity tuning parameters. If I restart
the NIC, it all comes back to normal for a while.

Do any of these ring a bell?

Thanks,


-adrian

^ permalink raw reply

* [PATCH -next] libertas: fix error return code in if_cs_probe()
From: Wei Yongjun @ 2013-10-30  5:22 UTC (permalink / raw)
  To: linville, hsweeten, gregkh, dcbw
  Cc: yongjun_wei, libertas-dev, linux-wireless

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Fix to return -ENODEV in the unknown model error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/net/wireless/libertas/if_cs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c
index ef8c98e..f499efc 100644
--- a/drivers/net/wireless/libertas/if_cs.c
+++ b/drivers/net/wireless/libertas/if_cs.c
@@ -902,6 +902,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
 	if (card->model == MODEL_UNKNOWN) {
 		pr_err("unsupported manf_id 0x%04x / card_id 0x%04x\n",
 		       p_dev->manf_id, p_dev->card_id);
+		ret = -ENODEV;
 		goto out2;
 	}
 


^ permalink raw reply related

* [PATCH -next] ath10k: fix possible memory leak in ath10k_pci_probe()
From: Wei Yongjun @ 2013-10-30  5:24 UTC (permalink / raw)
  To: kvalo, linville; +Cc: yongjun_wei, ath10k, linux-wireless

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

memory is malloced in ath10k_pci_probe() and should be freed before
leaving from the error handling cases, otherwise it will cause
memory leak.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/net/wireless/ath/ath10k/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index dff23d9..af01631 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -2470,7 +2470,7 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
 	ret = ath10k_do_pci_wake(ar);
 	if (ret) {
 		ath10k_err("Failed to get chip id: %d\n", ret);
-		return ret;
+		goto err_iomap;
 	}
 
 	chip_id = ath10k_pci_read32(ar,


^ permalink raw reply related

* [PATCH -next] NFC: port100: convert to use le16_add_cpu()
From: Wei Yongjun @ 2013-10-30  5:26 UTC (permalink / raw)
  To: lauro.venancio, aloisio.almeida, sameo
  Cc: yongjun_wei, linux-wireless, linux-nfc

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Convert cpu_to_le16(le16_to_cpu(E1) + E2) to use le16_add_cpu().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/nfc/port100.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nfc/port100.c b/drivers/nfc/port100.c
index 8a0571e..ab7afe3 100644
--- a/drivers/nfc/port100.c
+++ b/drivers/nfc/port100.c
@@ -493,7 +493,7 @@ static void port100_tx_update_payload_len(void *_frame, int len)
 {
 	struct port100_frame *frame = _frame;
 
-	frame->datalen = cpu_to_le16(le16_to_cpu(frame->datalen) + len);
+	le16_add_cpu(&frame->datalen, len);
 }
 
 static bool port100_rx_frame_is_valid(void *_frame)


^ permalink raw reply related

* [PATCH -next] wcn36xx: fix missing unlock on error in wcn36xx_smd_update_proberesp_tmpl()
From: Wei Yongjun @ 2013-10-30  5:30 UTC (permalink / raw)
  To: k.eugene.e, linville; +Cc: yongjun_wei, wcn36xx, linux-wireless

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Add the missing unlock before return from function
wcn36xx_smd_update_proberesp_tmpl() in the error
handling case.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/net/wireless/ath/wcn36xx/smd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index f8c3a10..04df70b 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -1327,7 +1327,8 @@ int wcn36xx_smd_update_proberesp_tmpl(struct wcn36xx *wcn,
 	if (skb->len > BEACON_TEMPLATE_SIZE) {
 		wcn36xx_warn("probe response template is too big: %d\n",
 			     skb->len);
-		return -E2BIG;
+		ret = -E2BIG;
+		goto out;
 	}
 
 	msg.probe_resp_template_len = skb->len;


^ permalink raw reply related

* [PATCH] ath9k: Use correct PCIE initvals for AR9485
From: Sujith Manoharan @ 2013-10-30  6:34 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

From: Sujith Manoharan <c_manoha@qca.qualcomm.com>

Currently, the PLL is turned off for AR9485 when
switching to a low power state, but AR9485 has an issue
where the card will become unresponsive if left idle
for a long time without any traffic. To fix this,
force the PLL to always be on using a different initval
array, ar9485_1_1_pll_on_cdr_on_clkreq_disable_L1.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath9k/ar9003_hw.c       | 11 ++------
 drivers/net/wireless/ath/ath9k/ar9485_initvals.h | 35 +++++-------------------
 2 files changed, 9 insertions(+), 37 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_hw.c b/drivers/net/wireless/ath/ath9k/ar9003_hw.c
index 42daea5..b054dee 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_hw.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_hw.c
@@ -187,17 +187,10 @@ static void ar9003_hw_init_mode_regs(struct ath_hw *ah)
 		INIT_INI_ARRAY(&ah->iniCckfirJapan2484,
 			       ar9485_1_1_baseband_core_txfir_coeff_japan_2484);
 
-		/* Load PCIE SERDES settings from INI */
-
-		/* Awake Setting */
-
 		INIT_INI_ARRAY(&ah->iniPcieSerdes,
-				ar9485_1_1_pcie_phy_clkreq_disable_L1);
-
-		/* Sleep Setting */
-
+			       ar9485_1_1_pll_on_cdr_on_clkreq_disable_L1);
 		INIT_INI_ARRAY(&ah->iniPcieSerdesLowPower,
-				ar9485_1_1_pcie_phy_clkreq_disable_L1);
+			       ar9485_1_1_pll_on_cdr_on_clkreq_disable_L1);
 	} else if (AR_SREV_9462_21(ah)) {
 		INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE],
 			       ar9462_2p1_mac_core);
diff --git a/drivers/net/wireless/ath/ath9k/ar9485_initvals.h b/drivers/net/wireless/ath/ath9k/ar9485_initvals.h
index 6f899c6..93b18ce 100644
--- a/drivers/net/wireless/ath/ath9k/ar9485_initvals.h
+++ b/drivers/net/wireless/ath/ath9k/ar9485_initvals.h
@@ -32,13 +32,6 @@ static const u32 ar9485_1_1_mac_postamble[][5] = {
 	{0x00008318, 0x00003e80, 0x00007d00, 0x00006880, 0x00003440},
 };
 
-static const u32 ar9485_1_1_pcie_phy_pll_on_clkreq_disable_L1[][2] = {
-	/* Addr      allmodes  */
-	{0x00018c00, 0x18012e5e},
-	{0x00018c04, 0x000801d8},
-	{0x00018c08, 0x0000080c},
-};
-
 static const u32 ar9485Common_wo_xlna_rx_gain_1_1[][2] = {
 	/* Addr      allmodes  */
 	{0x00009e00, 0x037216a0},
@@ -1101,20 +1094,6 @@ static const u32 ar9485_common_rx_gain_1_1[][2] = {
 	{0x0000a1fc, 0x00000296},
 };
 
-static const u32 ar9485_1_1_pcie_phy_pll_on_clkreq_enable_L1[][2] = {
-	/* Addr      allmodes  */
-	{0x00018c00, 0x18052e5e},
-	{0x00018c04, 0x000801d8},
-	{0x00018c08, 0x0000080c},
-};
-
-static const u32 ar9485_1_1_pcie_phy_clkreq_enable_L1[][2] = {
-	/* Addr      allmodes  */
-	{0x00018c00, 0x18053e5e},
-	{0x00018c04, 0x000801d8},
-	{0x00018c08, 0x0000080c},
-};
-
 static const u32 ar9485_1_1_soc_preamble[][2] = {
 	/* Addr      allmodes  */
 	{0x00004014, 0xba280400},
@@ -1173,13 +1152,6 @@ static const u32 ar9485_1_1_baseband_postamble[][5] = {
 	{0x0000be18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
 };
 
-static const u32 ar9485_1_1_pcie_phy_clkreq_disable_L1[][2] = {
-	/* Addr      allmodes  */
-	{0x00018c00, 0x18013e5e},
-	{0x00018c04, 0x000801d8},
-	{0x00018c08, 0x0000080c},
-};
-
 static const u32 ar9485_1_1_radio_postamble[][2] = {
 	/* Addr      allmodes  */
 	{0x0001609c, 0x0b283f31},
@@ -1358,4 +1330,11 @@ static const u32 ar9485_1_1_baseband_core_txfir_coeff_japan_2484[][2] = {
 	{0x0000a3a0, 0xca9228ee},
 };
 
+static const u32 ar9485_1_1_pll_on_cdr_on_clkreq_disable_L1[][2] = {
+	/* Addr      allmodes  */
+	{0x00018c00, 0x1801265e},
+	{0x00018c04, 0x000801d8},
+	{0x00018c08, 0x0000080c},
+};
+
 #endif /* INITVALS_9485_H */
-- 
1.8.4.1


^ permalink raw reply related

* Re: [PATCH -next] wcn36xx: fix missing unlock on error in wcn36xx_smd_update_proberesp_tmpl()
From: Eugene Krasnikov @ 2013-10-30  7:12 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: John Linville, yongjun_wei, wcn36xx, linux-wireless
In-Reply-To: <CAPgLHd9HRb_o+hac5_RjKhK1K-jJFtQmrv9P2iy7zegQv=WOcw@mail.gmail.com>

Looks good to me! I assume this patch is the result of running smatch?
I made the same patch, just did not have time to send it out.

On Wed, Oct 30, 2013 at 5:30 AM, Wei Yongjun <weiyj.lk@gmail.com> wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> Add the missing unlock before return from function
> wcn36xx_smd_update_proberesp_tmpl() in the error
> handling case.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
>  drivers/net/wireless/ath/wcn36xx/smd.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
> index f8c3a10..04df70b 100644
> --- a/drivers/net/wireless/ath/wcn36xx/smd.c
> +++ b/drivers/net/wireless/ath/wcn36xx/smd.c
> @@ -1327,7 +1327,8 @@ int wcn36xx_smd_update_proberesp_tmpl(struct wcn36xx *wcn,
>         if (skb->len > BEACON_TEMPLATE_SIZE) {
>                 wcn36xx_warn("probe response template is too big: %d\n",
>                              skb->len);
> -               return -E2BIG;
> +               ret = -E2BIG;
> +               goto out;
>         }
>
>         msg.probe_resp_template_len = skb->len;
>



-- 
Best regards,
Eugene

^ permalink raw reply

* Re: [PATCH -next] wcn36xx: fix missing unlock on error in wcn36xx_smd_update_proberesp_tmpl()
From: Wei Yongjun @ 2013-10-30  7:40 UTC (permalink / raw)
  To: k.eugene.e; +Cc: linville, yongjun_wei, wcn36xx, linux-wireless
In-Reply-To: <CAFSJ42ZWiH0K7JKxBUHA8dqBLT++=Zu-mvyoF=egk4kP1+Detw@mail.gmail.com>

On 10/30/2013 03:12 PM, Eugene Krasnikov wrote:
> Looks good to me! I assume this patch is the result of running smatch?
> I made the same patch, just did not have time to send it out.

Hi, 

I used coccinelle with script to found this. ^_^

>
> On Wed, Oct 30, 2013 at 5:30 AM, Wei Yongjun <weiyj.lk@gmail.com> wrote:
>> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>>
>> Add the missing unlock before return from function
>> wcn36xx_smd_update_proberesp_tmpl() in the error
>> handling case.
>>
>> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>> ---
>>  drivers/net/wireless/ath/wcn36xx/smd.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
>> index f8c3a10..04df70b 100644
>> --- a/drivers/net/wireless/ath/wcn36xx/smd.c
>> +++ b/drivers/net/wireless/ath/wcn36xx/smd.c
>> @@ -1327,7 +1327,8 @@ int wcn36xx_smd_update_proberesp_tmpl(struct wcn36xx *wcn,
>>         if (skb->len > BEACON_TEMPLATE_SIZE) {
>>                 wcn36xx_warn("probe response template is too big: %d\n",
>>                              skb->len);
>> -               return -E2BIG;
>> +               ret = -E2BIG;
>> +               goto out;
>>         }
>>
>>         msg.probe_resp_template_len = skb->len;
>>
>
>



^ permalink raw reply

* Re: iwlegacy (4965) - what would 0x8000 as the completed TX rate indicate?
From: Johannes Berg @ 2013-10-30  8:04 UTC (permalink / raw)
  To: Adrian Chadd; +Cc: linux-wireless@vger.kernel.org
In-Reply-To: <CAJ-Vmom0P7bJYWtCAYfCBKmMhhGHnqpf51mwPn0xkgyS84Qt=A@mail.gmail.com>

On Tue, 2013-10-29 at 20:59 -0700, Adrian Chadd wrote:
> On 29 October 2013 01:03, Johannes Berg <johannes@sipsolutions.net> wrote:
> 
> >> Well, what's rate=0 mean?
> >>
> >> And 0x8000 is bit 11 set, which is HT40. I definitely don't have HT40 enabled.
> >
> > 0x8000 is bit 15 set, which means "antenna B", I think?
> 
> Duh, sorry. was tired. :(
> 
> > But then I can't seem to figure out what rate=0 means either. Should be
> > an OFDM rate (bit 9 not set) but 0 isn't a valid OFDM rate value. Hmm.
> 
> That's why I'm confused too.
> 
> I'm seeing some odd behaviour here where sometimes the NIC behaves
> fine, and sometimes it just gets long transmit failures on OFDM frames
> but is fine with CCK frames. That's why I'm digging into this.
> 
> I also see the sensitivity tuning code lose the plot over time as OFDM
> errors are returned by the receiver and it keeps trying to compensate
> until it's maxed out the sensitivity tuning parameters. If I restart
> the NIC, it all comes back to normal for a while.
> 
> Do any of these ring a bell?

Sorry, no.

johannes


^ permalink raw reply

* Re: [PATCH] iwl3945: do not print RFKILL message
From: Stanislaw Gruszka @ 2013-10-30  8:34 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, Dietmar Rudolph, Pedro Francisco
In-Reply-To: <1382699879.12755.0.camel@jlt4.sipsolutions.net>

[-- Attachment #1: Type: text/plain, Size: 730 bytes --]

On Fri, Oct 25, 2013 at 01:17:59PM +0200, Johannes Berg wrote:
> On Fri, 2013-10-25 at 12:37 +0200, Stanislaw Gruszka wrote:
> > We can mess logs if user space try to open device again and again if
> > RFKILL switch is on. Do not print message and return ERFKILL error
> > instead to indicate where the problem is.
> 
> Are you maybe not calling wiphy_rfkill_set_hw_state() in the right
> places?

This is done from work scheduled every 2 second if rfkill state change,
but is possible that initial state is not provided to upper layer.

Dietmar or Pedro, could you test attached patch (my old laptop with 3945
does not work any longer). It is alternative to previous patch posted
before, does rfkill work ok with it?

Stanislaw


[-- Attachment #2: iwl3945_rfkill.patch --]
[-- Type: text/plain, Size: 1206 bytes --]

diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
index dea3b50..74e2b0a 100644
--- a/drivers/net/wireless/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
@@ -2202,6 +2202,9 @@ il3945_alive_start(struct il_priv *il)
 	} else
 		set_bit(S_RFKILL, &il->status);
 
+	wiphy_rfkill_set_hw_state(il->hw->wiphy,
+				  test_bit(S_RFKILL, &il->status));
+
 	/* After the ALIVE response, we can send commands to 3945 uCode */
 	set_bit(S_ALIVE, &il->status);
 
@@ -2397,7 +2400,7 @@ __il3945_up(struct il_priv *il)
 	else {
 		set_bit(S_RFKILL, &il->status);
 		IL_WARN("Radio disabled by HW RF Kill switch\n");
-		return -ENODEV;
+		return 0;
 	}
 
 	_il_wr(il, CSR_INT, 0xFFFFFFFF);
@@ -2825,6 +2828,9 @@ il3945_mac_start(struct ieee80211_hw *hw)
 	if (ret)
 		goto out_release_irq;
 
+	if (il_is_rfkill(il))
+		goto out;
+
 	D_INFO("Start UP work.\n");
 
 	/* Wait for START_ALIVE from ucode. Otherwise callbacks from
@@ -2845,6 +2851,7 @@ il3945_mac_start(struct ieee80211_hw *hw)
 	 * no need to poll the killswitch state anymore */
 	cancel_delayed_work(&il->_3945.rfkill_poll);
 
+out:
 	il->is_open = 1;
 	D_MAC80211("leave\n");
 	return 0;

^ permalink raw reply related

* Re: [PATCH] iwl3945: do not print RFKILL message
From: Dietmar Rudolph @ 2013-10-30  8:51 UTC (permalink / raw)
  To: Stanislaw Gruszka, Johannes Berg; +Cc: linux-wireless, Pedro Francisco
In-Reply-To: <20131030083432.GA1478@redhat.com>

> Dietmar or Pedro, could you test attached patch (my old laptop with 3945
> does not work any longer). It is alternative to previous patch posted
> before, does rfkill work ok with it?

Stanislaw,

I'm sorry a cannot be any help here as I don't have the time nor the 
environment to compile and test your patch.

In regard to this, I'm just a plain end user who installed Ubuntu 
out of the box. I had nticed the problem of the ever growing kernel 
log and found this mailing list to be the right spot to post a bug 
report. And I noticed your immediate reaction. Keep up the great work.

Kind regards
Dietmar

-- 
Dietmar Rudolph
Geschäftsführer/President

CR/LF GmbH
Obere Fuhr 27, 45136 Essen, Germany
phone: ++49 201 254566
mailto: dietmar@crlf.de, http://www.crlf.de

CR/LF Beratungsgesellschaft für EDV-Anwendungen mbH
Essen HRB 7016 - GF: Dipl.-Math. Dietmar Rudolph

^ permalink raw reply

* Re: [PATCH 2/3] brcm80211: fix usage of freq_reg_info()
From: Arend van Spriel @ 2013-10-30  9:10 UTC (permalink / raw)
  To: Luis R. Rodriguez, linville, johannes
  Cc: linux-wireless, Julia Lawall, Peter Senna Tschudin, Seth Forshee
In-Reply-To: <1383071666-26817-3-git-send-email-mcgrof@do-not-panic.com>

On 10/29/2013 07:34 PM, Luis R. Rodriguez wrote:
> freq_reg_info() expects KHz and not MHz, fix this. In
> this case we'll now be getting the no-ir flags cleared
> on channels for any channel when the country IE trusts
> that channel.
>
> @@
> struct ieee80211_channel *ch;
> struct wiphy *wiphy;
> const struct ieee80211_reg_rule *rule;
> @@
>
> -rule = freq_reg_info(wiphy, ch->center_freq);
> +rule = freq_reg_info(wiphy, MHZ_TO_KHZ(ch->center_freq));
>
> Generated-by: Coccinelle SmPL
> Cc: Julia Lawall <julia.lawall@lip6.fr>
> Cc: Peter Senna Tschudin <peter.senna@gmail.com>
> Cc: Seth Forshee <seth.forshee@canonical.com>

Acked-by: Arend van Spriel <arend@broadcom.com>

> Reported-by: Mihir Shete <smihir@qti.qualcomm.com>
> Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
> ---
>   drivers/net/wireless/brcm80211/brcmsmac/channel.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/channel.c b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
> index c99364f..8272570 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/channel.c
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
> @@ -678,7 +678,8 @@ brcms_reg_apply_beaconing_flags(struct wiphy *wiphy,
>   				continue;
>
>   			if (initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE) {
> -				rule = freq_reg_info(wiphy, ch->center_freq);
> +				rule = freq_reg_info(wiphy,
> +						     MHZ_TO_KHZ(ch->center_freq));
>   				if (IS_ERR(rule))
>   					continue;
>
>



^ permalink raw reply

* Re: [PATCH 0/2] ath10k: memory leak fixes
From: Kalle Valo @ 2013-10-30  9:53 UTC (permalink / raw)
  To: Michal Kazior; +Cc: ath10k, linux-wireless
In-Reply-To: <1382941094-3291-1-git-send-email-michal.kazior@tieto.com>

Michal Kazior <michal.kazior@tieto.com> writes:

> Michal Kazior (2):
>   ath10k: plug memory leak in wmi mgmt tx worker
>   ath10k: plug memory leak on beacon tx

Thanks, both patches applied.

-- 
Kalle Valo

^ permalink raw reply

* Monitor mode stopped working after kernel upgrade
From: Piotr Kaczorek @ 2013-10-30 11:10 UTC (permalink / raw)
  To: linux-wireless

Update

I tried few more kernels (few longterm versions from kernel.org - 
3.2.52, 3.4.67, 3.9.11 and current stable 3.11.6).
On 3.4.67 monitor mode still works.

On version 3.9.11 and above it doesn't.

Unfortunately I wanted support for Ralink 5572 which works since ~3.10.

Regards,
Piotr


^ permalink raw reply

* Re: [PATCH 02/16] wl1251: fix scan behaviour while not associated
From: Pavel Machek @ 2013-10-30 11:24 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Luciano Coelho, John W. Linville, Johannes Berg, David S. Miller,
	linux-wireless, netdev, linux-kernel, freemangordon,
	aaro.koskinen, sre, joni.lapilainen, David Gnedt
In-Reply-To: <1382819655-30430-3-git-send-email-pali.rohar@gmail.com>

On Sat 2013-10-26 22:34:01, Pali Rohár wrote:
> From: David Gnedt <david.gnedt@davizone.at>
> 
> With a dissacociated card I often encoutered very long scan delays.
> 
> My guess is that it has something to do with the cards DTIM handling and
> another firmware bug mentioned in the TI WLAN driver, which is described as
> the card may never end scanning if the channel is overloaded because it
> can't send probe requests. I think the firmware somehow also tries to
> receive DTIM messages when the BSSID is not set. Therefore most of the time
> it waits for DTIM messages and can't do scanning work.
> 
> Anyway we can workaround this misbehaviour by setting the HIGH_PRIORITY
> bit for scans in disassociated state.
> 
> Signed-off-by: David Gnedt <david.gnedt@davizone.at>

I guess you should add your Signed-off-by: here (as you are sending
the patch forward).

Other than that:

Reviewed-by: Pavel Machek <pavel@ucw.cz>

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply

* Re: [PATCH 05/16] wl1251: implement hardware ARP filtering
From: Pavel Machek @ 2013-10-30 11:28 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Luciano Coelho, John W. Linville, Johannes Berg, David S. Miller,
	linux-wireless, netdev, linux-kernel, freemangordon,
	aaro.koskinen, sre, joni.lapilainen, David Gnedt
In-Reply-To: <1382819655-30430-6-git-send-email-pali.rohar@gmail.com>

Hi!

> Update hardware ARP filter configuration on BSS_CHANGED_ARP_FILTER
> notification from mac80211.
> Ported from wl1271 driver.
> 
> Signed-off-by: David Gnedt <david.gnedt@davizone.at>
> ---
>  drivers/net/wireless/ti/wl1251/acx.c  |   31 +++++++++++++++++++++++++++++++
>  drivers/net/wireless/ti/wl1251/acx.h  |   15 +++++++++++++++
>  drivers/net/wireless/ti/wl1251/main.c |   13 +++++++++++++
>  3 files changed, 59 insertions(+)
> 
> diff --git a/drivers/net/wireless/ti/wl1251/acx.c b/drivers/net/wireless/ti/wl1251/acx.c
> index cce50e2..9295090 100644
> --- a/drivers/net/wireless/ti/wl1251/acx.c
> +++ b/drivers/net/wireless/ti/wl1251/acx.c
> @@ -1062,6 +1062,37 @@ out:
>  	return ret;
>  }
>  
> +int wl1251_acx_arp_ip_filter(struct wl1251 *wl, bool enable, __be32 address)
> +{
> +	struct wl1251_acx_arp_filter *acx;
> +	int ret;
> +
> +	wl1251_debug(DEBUG_ACX, "acx arp ip filter, enable: %d", enable);
> +
> +	acx = kzalloc(sizeof(*acx), GFP_KERNEL);
> +	if (!acx) {
> +		ret = -ENOMEM;
> +		goto out;
> +	}

I'd do "return -ENOMEM;" here. Trying to free NULL pointer is
unneccessary complication.

> +	acx->version = ACX_IPV4_VERSION;
> +	acx->enable = enable;
> +
> +	if (enable == true)

if (enable) would be C way of writing stuff.

> +		memcpy(acx->address, &address, ACX_IPV4_ADDR_SIZE);
> +
> +	ret = wl1251_cmd_configure(wl, ACX_ARP_IP_FILTER,
> +				   acx, sizeof(*acx));
> +	if (ret < 0) {
> +		wl1251_warning("failed to set arp ip filter: %d", ret);
> +		goto out;
> +	}
> +
> +out:

No need for the out label now.

> diff --git a/drivers/net/wireless/ti/wl1251/main.c b/drivers/net/wireless/ti/wl1251/main.c
> index 46a2494..9752745 100644
> --- a/drivers/net/wireless/ti/wl1251/main.c
> +++ b/drivers/net/wireless/ti/wl1251/main.c
> @@ -1078,6 +1078,19 @@ static void wl1251_op_bss_info_changed(struct ieee80211_hw *hw,
>  		}
>  	}
>  
> +	if (changed & BSS_CHANGED_ARP_FILTER) {
> +		__be32 addr = bss_conf->arp_addr_list[0];
> +		WARN_ON(wl->bss_type != BSS_TYPE_STA_BSS);
> +
> +		if (bss_conf->arp_addr_cnt == 1 && bss_conf->assoc)
> +			ret = wl1251_acx_arp_ip_filter(wl, true, addr);
> +		else
> +			ret = wl1251_acx_arp_ip_filter(wl, false, addr);


  		enable = bss_conf->arp_addr_cnt == 1 && bss_conf->assoc;
		ret = wl1251_acx_arp_ip_filter(wl, enable, addr);

?

Thanks,
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply

* Re: [PATCH 06/16] wl1251: split RX and TX data path initialisation
From: Pavel Machek @ 2013-10-30 11:31 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Luciano Coelho, John W. Linville, Johannes Berg, David S. Miller,
	linux-wireless, netdev, linux-kernel, freemangordon,
	aaro.koskinen, sre, joni.lapilainen, David Gnedt
In-Reply-To: <1382819655-30430-7-git-send-email-pali.rohar@gmail.com>

Hi!

> Split up data path initialisation into RX and TX data path initialisation
> functions. This change is required for channel switching in monitor mode.
> 
> Signed-off-by: David Gnedt <david.gnedt@davizone.at>
> ---
>  drivers/net/wireless/ti/wl1251/cmd.c  |   37 ++++++++++++++++++++++++++-------
>  drivers/net/wireless/ti/wl1251/cmd.h  |    3 ++-
>  drivers/net/wireless/ti/wl1251/init.c |    9 ++++++--
>  3 files changed, 39 insertions(+), 10 deletions(-)
> 
> @@ -238,6 +235,32 @@ int wl1251_cmd_data_path(struct wl1251 *wl, u8 channel, bool enable)
>  	wl1251_debug(DEBUG_BOOT, "rx %s cmd channel %d",
>  		     enable ? "start" : "stop", channel);
>  
> +out:
> +	kfree(cmd);
> +	return ret;
> +}
> +
> +int wl1251_cmd_data_path_tx(struct wl1251 *wl, u8 channel, bool enable)
> +{
> +	struct cmd_enabledisable_path *cmd;
> +	int ret;
> +	u16 cmd_tx;
> +
> +	wl1251_debug(DEBUG_CMD, "cmd data path");
> +
> +	cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
> +	if (!cmd) {
> +		ret = -ENOMEM;
> +		goto out;
> +	}

Again, doing jump just to kfree(NULL)... is probably not worth
it.

Thanks,
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply

* Re: [PATCH 07/16] wl1251: configure hardware en-/decryption for monitor mode
From: Pavel Machek @ 2013-10-30 11:35 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Luciano Coelho, John W. Linville, Johannes Berg, David S. Miller,
	linux-wireless, netdev, linux-kernel, freemangordon,
	aaro.koskinen, sre, joni.lapilainen, David Gnedt
In-Reply-To: <1382819655-30430-8-git-send-email-pali.rohar@gmail.com>

On Sat 2013-10-26 22:34:06, Pali Rohár wrote:
> From: David Gnedt <david.gnedt@davizone.at>
> 
> Disable hardware encryption (DF_ENCRYPTION_DISABLE) and decryption
> (DF_SNIFF_MODE_ENABLE) via wl1251_acx_feature_cfg while monitor interface is
> present.
> 
> Signed-off-by: David Gnedt <david.gnedt@davizone.at>

You need to sign off the patch, otherwise looks ok.

Reviewed-by: Pavel Machek <pavel@ucw.cz>

Thanks,
									Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply

* Re: [PATCH 08/16] wl1251: implement multicast address filtering
From: Pavel Machek @ 2013-10-30 11:41 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Luciano Coelho, John W. Linville, Johannes Berg, David S. Miller,
	linux-wireless, netdev, linux-kernel, freemangordon,
	aaro.koskinen, sre, joni.lapilainen, David Gnedt
In-Reply-To: <1382819655-30430-9-git-send-email-pali.rohar@gmail.com>

Hi!

> Port multicast address filtering from wl1271 driver.
> It sets up the hardware multicast address filter in configure_filter() with
> addresses supplied through prepare_multicast().

> +static u64 wl1251_op_prepare_multicast(struct ieee80211_hw *hw,
> +				       struct netdev_hw_addr_list *mc_list)
> +{
> +	struct wl1251_filter_params *fp;
> +	struct netdev_hw_addr *ha;
> +	struct wl1251 *wl = hw->priv;
> +
> +	if (unlikely(wl->state == WL1251_STATE_OFF))
> +		return 0;
> +
> +	fp = kzalloc(sizeof(*fp), GFP_ATOMIC);
> +	if (!fp) {
> +		wl1251_error("Out of memory setting filters.");
> +		return 0;
> +	}

So if there's not enough memory, we return 0.

> +	/* update multicast filtering parameters */
> +	fp->mc_list_length = 0;
> +	if (netdev_hw_addr_list_count(mc_list) > ACX_MC_ADDRESS_GROUP_MAX) {
> +		fp->enabled = false;
> +	} else {
> +		fp->enabled = true;
> +		netdev_hw_addr_list_for_each(ha, mc_list) {
> +			memcpy(fp->mc_list[fp->mc_list_length],
> +					ha->addr, ETH_ALEN);
> +			fp->mc_list_length++;
> +		}
> +	}
> +
> +	return (u64)(unsigned long)fp;
> +}

Hiding pointers into u64 is not exactly nice, but I guess that's how
interface is designed? :-(.

> @@ -737,6 +779,15 @@ static void wl1251_op_configure_filter(struct ieee80211_hw *hw,
>  	if (ret < 0)
>  		goto out;
>  
> +	if (*total & FIF_ALLMULTI || *total & FIF_PROMISC_IN_BSS)
> +		ret = wl1251_acx_group_address_tbl(wl, false, NULL, 0);
> +	else if (fp)
> +		ret = wl1251_acx_group_address_tbl(wl, fp->enabled,
> +						   fp->mc_list,
> +						     	fp->mc_list_length);

Is it correct not to call anything in !fp case (for example because we
were out of memory?)

> +	if (ret < 0)
> +		goto out;
> +
>  	/* send filters to firmware */
>  	wl1251_acx_rx_config(wl, wl->rx_config, wl->rx_filter);
>  
> @@ -744,6 +795,7 @@ static void wl1251_op_configure_filter(struct ieee80211_hw *hw,
>  
>  out:
>  	mutex_unlock(&wl->mutex);
> +	kfree(fp);
>  }

Umm, this is interesting. Who frees the memory in the success case?

Thanks,
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply

* [PATCH/RFT 00/12] ath10k: pci fixes 2013-10-30
From: Michal Kazior @ 2013-10-30 11:42 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, greearb, Michal Kazior

Hi,

This patchset contains a slew of PCI/CE cleanups
and fixes. The aim of the patchset is to deal with
CE null dereference bugs Ben has been reporting on
the mailing list for some time now.

I've done some brief testing and don't see any
major regressions. I wasn't able to reproduce the
reported bugs though. @Ben: Could you perhaps test
this, please?


Michal Kazior (12):
  ath10k: remove ar_pci->ce_count
  ath10k: don't forget to kill fw error tasklet
  ath10k: split tasklet killing function
  ath10k: rename function to match it's role
  ath10k: make sure to mask all CE irqs
  ath10k: fix ath10k_ce_init() failpath
  ath10k: remove meaningless check
  ath10k: use ath10k_do_pci_wake/sleep
  ath10k: propagate ath10k_ce_disable_interrupts() errors
  ath10k: guard against CE corruption from firmware
  ath10k: re-arrange PCI init code
  ath10k: add some debug prints

 drivers/net/wireless/ath/ath10k/ce.c  |  56 ++++++---
 drivers/net/wireless/ath/ath10k/ce.h  |   3 +-
 drivers/net/wireless/ath/ath10k/htc.c |   5 +
 drivers/net/wireless/ath/ath10k/pci.c | 221 ++++++++++++++++++----------------
 drivers/net/wireless/ath/ath10k/pci.h |   3 -
 5 files changed, 161 insertions(+), 127 deletions(-)

-- 
1.8.4.rc3


^ permalink raw reply

* [PATCH/RFT 01/12] ath10k: remove ar_pci->ce_count
From: Michal Kazior @ 2013-10-30 11:42 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, greearb, Michal Kazior
In-Reply-To: <1383133346-8135-1-git-send-email-michal.kazior@tieto.com>

It wasn't really useful to have it to begin with.
This makes it a little simpler to re-arrange PCI
init code as some function depended on
ar_pci->ce_count being set.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
 drivers/net/wireless/ath/ath10k/ce.c  |  9 +++------
 drivers/net/wireless/ath/ath10k/pci.c | 18 ++++++++----------
 drivers/net/wireless/ath/ath10k/pci.h |  3 ---
 3 files changed, 11 insertions(+), 19 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/ce.c b/drivers/net/wireless/ath/ath10k/ce.c
index d243f28..2b99bd4 100644
--- a/drivers/net/wireless/ath/ath10k/ce.c
+++ b/drivers/net/wireless/ath/ath10k/ce.c
@@ -731,7 +731,6 @@ void ath10k_ce_per_engine_service(struct ath10k *ar, unsigned int ce_id)
 
 void ath10k_ce_per_engine_service_any(struct ath10k *ar)
 {
-	struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
 	int ce_id, ret;
 	u32 intr_summary;
 
@@ -741,7 +740,7 @@ void ath10k_ce_per_engine_service_any(struct ath10k *ar)
 
 	intr_summary = CE_INTERRUPT_SUMMARY(ar);
 
-	for (ce_id = 0; intr_summary && (ce_id < ar_pci->ce_count); ce_id++) {
+	for (ce_id = 0; intr_summary && (ce_id < CE_COUNT); ce_id++) {
 		if (intr_summary & (1 << ce_id))
 			intr_summary &= ~(1 << ce_id);
 		else
@@ -785,16 +784,14 @@ static void ath10k_ce_per_engine_handler_adjust(struct ath10k_ce_pipe *ce_state,
 
 void ath10k_ce_disable_interrupts(struct ath10k *ar)
 {
-	struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
 	int ce_id, ret;
 
 	ret = ath10k_pci_wake(ar);
 	if (ret)
 		return;
 
-	for (ce_id = 0; ce_id < ar_pci->ce_count; ce_id++) {
-		struct ath10k_ce_pipe *ce_state = &ar_pci->ce_states[ce_id];
-		u32 ctrl_addr = ce_state->ctrl_addr;
+	for (ce_id = 0; ce_id < CE_COUNT; ce_id++) {
+		u32 ctrl_addr = ath10k_ce_base_address(ce_id);
 
 		ath10k_ce_copy_complete_intr_disable(ar, ctrl_addr);
 	}
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index 42d2473..05cdbf0 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -831,7 +831,7 @@ static int ath10k_pci_start_ce(struct ath10k *ar)
 	spin_lock_init(&ar_pci->compl_lock);
 	INIT_LIST_HEAD(&ar_pci->compl_process);
 
-	for (pipe_num = 0; pipe_num < ar_pci->ce_count; pipe_num++) {
+	for (pipe_num = 0; pipe_num < CE_COUNT; pipe_num++) {
 		pipe_info = &ar_pci->pipe_info[pipe_num];
 
 		spin_lock_init(&pipe_info->pipe_lock);
@@ -924,7 +924,7 @@ static void ath10k_pci_cleanup_ce(struct ath10k *ar)
 	spin_unlock_bh(&ar_pci->compl_lock);
 
 	/* Free unused completions for each pipe. */
-	for (pipe_num = 0; pipe_num < ar_pci->ce_count; pipe_num++) {
+	for (pipe_num = 0; pipe_num < CE_COUNT; pipe_num++) {
 		pipe_info = &ar_pci->pipe_info[pipe_num];
 
 		spin_lock_bh(&pipe_info->pipe_lock);
@@ -1166,7 +1166,7 @@ static int ath10k_pci_post_rx(struct ath10k *ar)
 	const struct ce_attr *attr;
 	int pipe_num, ret = 0;
 
-	for (pipe_num = 0; pipe_num < ar_pci->ce_count; pipe_num++) {
+	for (pipe_num = 0; pipe_num < CE_COUNT; pipe_num++) {
 		pipe_info = &ar_pci->pipe_info[pipe_num];
 		attr = &host_ce_config_wlan[pipe_num];
 
@@ -1295,7 +1295,7 @@ static void ath10k_pci_buffer_cleanup(struct ath10k *ar)
 	struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
 	int pipe_num;
 
-	for (pipe_num = 0; pipe_num < ar_pci->ce_count; pipe_num++) {
+	for (pipe_num = 0; pipe_num < CE_COUNT; pipe_num++) {
 		struct ath10k_pci_pipe *pipe_info;
 
 		pipe_info = &ar_pci->pipe_info[pipe_num];
@@ -1310,7 +1310,7 @@ static void ath10k_pci_ce_deinit(struct ath10k *ar)
 	struct ath10k_pci_pipe *pipe_info;
 	int pipe_num;
 
-	for (pipe_num = 0; pipe_num < ar_pci->ce_count; pipe_num++) {
+	for (pipe_num = 0; pipe_num < CE_COUNT; pipe_num++) {
 		pipe_info = &ar_pci->pipe_info[pipe_num];
 		if (pipe_info->ce_hdl) {
 			ath10k_ce_deinit(pipe_info->ce_hdl);
@@ -1755,7 +1755,7 @@ static int ath10k_pci_ce_init(struct ath10k *ar)
 	const struct ce_attr *attr;
 	int pipe_num;
 
-	for (pipe_num = 0; pipe_num < ar_pci->ce_count; pipe_num++) {
+	for (pipe_num = 0; pipe_num < CE_COUNT; pipe_num++) {
 		pipe_info = &ar_pci->pipe_info[pipe_num];
 		pipe_info->pipe_num = pipe_num;
 		pipe_info->hif_ce_state = ar;
@@ -1772,13 +1772,12 @@ static int ath10k_pci_ce_init(struct ath10k *ar)
 			return -1;
 		}
 
-		if (pipe_num == ar_pci->ce_count - 1) {
+		if (pipe_num == CE_COUNT - 1) {
 			/*
 			 * Reserve the ultimate CE for
 			 * diagnostic Window support
 			 */
-			ar_pci->ce_diag =
-			ar_pci->pipe_info[ar_pci->ce_count - 1].ce_hdl;
+			ar_pci->ce_diag = pipe_info->ce_hdl;
 			continue;
 		}
 
@@ -2235,7 +2234,6 @@ static int ath10k_pci_start_intr(struct ath10k *ar)
 
 exit:
 	ar_pci->num_msi_intrs = num;
-	ar_pci->ce_count = CE_COUNT;
 	return ret;
 }
 
diff --git a/drivers/net/wireless/ath/ath10k/pci.h b/drivers/net/wireless/ath/ath10k/pci.h
index a304c33..73a3d4e 100644
--- a/drivers/net/wireless/ath/ath10k/pci.h
+++ b/drivers/net/wireless/ath/ath10k/pci.h
@@ -199,9 +199,6 @@ struct ath10k_pci {
 	struct tasklet_struct intr_tq;
 	struct tasklet_struct msi_fw_err;
 
-	/* Number of Copy Engines supported */
-	unsigned int ce_count;
-
 	int started;
 
 	atomic_t keep_awake_count;
-- 
1.8.4.rc3


^ 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