Linux wireless drivers development
 help / color / mirror / Atom feed
* Re: brcmsmac causes soft lockup in 3.12-rc1
From: Michael Stolovitzsky @ 2013-09-25 18:00 UTC (permalink / raw)
  To: linux-wireless
In-Reply-To: <524144FF.9020908@broadcom.com>

On 13-09-24, Arend van Spriel wrote:
> On 09/24/2013 02:52 AM, Michael Stolovitzsky wrote:
> >On Mon, Sep 23, 2013 at 10:13:49AM +0200, Arend van Spriel wrote:
> >>On 09/22/2013 12:34 AM, Michael Stolovitzsky wrote:
> >>>Hi,
> >>>
> >>>On 3.12-rc1, modprobe brcmsmac causes a soft lockup (trace #1), effectively killing the box. This is a Lenovo S206
> >>>with BCM4313 (14e4:4727), which I believe is a bluetooth combo board. After a while,
> >>>RCU scheduler code detects a lockup (trace #2).
> >>>
[...]
> >>
> >>A fix for this problem has been submitted to John. I think it is in
> >>transit to mainline so probably will be in 3.12-rc2.
> >>
> >>Here the URL of the patch:
> >>
> >>https://git.kernel.org/cgit/linux/kernel/git/linville/wireless.git/patch/?id=aaa2ced15ad8dca8048666c9f70736424d696a6b
> >>
> >
[...]
> The patch is in 3.12-rc2. There have been more reports on that, but
> it still needs to be investigated. Can you provide content of
> /sys/kernel/debug/brcmsmac/bcma*/hardware? You need to have
> CONFIG_BRCMDBG selected.
> 

Here you go:

board vendor: 14e4
board type: 587
board revision: 1307
board flags: 402201
board flags2: 884
firmware revision: 262032c

Once again thank you. On 3.12.0-rc2, brcmsmac seems to work fine, which has never happened before, and makes me
very happy. Now I am getting new bug messages that I have to look at.

^ permalink raw reply

* [PATCH  2/8 V4] rtlwifi: rtl8192de: Fix smatch warnings in rtl8192de/hw.c
From: Larry Finger @ 2013-09-25 18:00 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Larry Finger, netdev

Smatch lists the following:
  CHECK   drivers/net/wireless/rtlwifi/rtl8192de/hw.c
drivers/net/wireless/rtlwifi/rtl8192de/hw.c:1200 rtl92de_set_qos() info: ignoring unreachable code.
drivers/net/wireless/rtlwifi/rtl8192de/hw.c:1200 rtl92de_set_qos() info: ignoring unreachable code.

The dead code is deleted.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---

Previous send had messed up subject.

Larry
---
 drivers/net/wireless/rtlwifi/rtl8192de/hw.c | 18 ------------------
 1 file changed, 18 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/hw.c b/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
index 7dd8f6d..c4a7db9 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
@@ -1194,25 +1194,7 @@ void rtl92d_linked_set_reg(struct ieee80211_hw *hw)
  * mac80211 will send pkt when scan */
 void rtl92de_set_qos(struct ieee80211_hw *hw, int aci)
 {
-	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	rtl92d_dm_init_edca_turbo(hw);
-	return;
-	switch (aci) {
-	case AC1_BK:
-		rtl_write_dword(rtlpriv, REG_EDCA_BK_PARAM, 0xa44f);
-		break;
-	case AC0_BE:
-		break;
-	case AC2_VI:
-		rtl_write_dword(rtlpriv, REG_EDCA_VI_PARAM, 0x5e4322);
-		break;
-	case AC3_VO:
-		rtl_write_dword(rtlpriv, REG_EDCA_VO_PARAM, 0x2f3222);
-		break;
-	default:
-		RT_ASSERT(false, "invalid aci: %d !\n", aci);
-		break;
-	}
 }
 
 void rtl92de_enable_interrupt(struct ieee80211_hw *hw)
-- 
1.8.1.4


^ permalink raw reply related

* [PATCH 8/8 V4] rtlwifi: Remove all remaining references to variable 'noise' in rtl_stats struct
From: Larry Finger @ 2013-09-25 17:57 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Larry Finger, netdev
In-Reply-To: <1380131869-19185-1-git-send-email-Larry.Finger@lwfinger.net>

This completes removal of all places that reference variable 'noise'
in the rtl_stats struct. The definition of the struct is unchanged.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
 drivers/net/wireless/rtlwifi/rtl8188ee/trx.c | 1 -
 drivers/net/wireless/rtlwifi/rtl8192ce/trx.c | 1 -
 drivers/net/wireless/rtlwifi/rtl8192se/trx.c | 1 -
 drivers/net/wireless/rtlwifi/rtl8723ae/trx.c | 1 -
 4 files changed, 4 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/rtl8188ee/trx.c b/drivers/net/wireless/rtlwifi/rtl8188ee/trx.c
index a8871d6..5e628ab 100644
--- a/drivers/net/wireless/rtlwifi/rtl8188ee/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8188ee/trx.c
@@ -477,7 +477,6 @@ bool rtl88ee_rx_query_desc(struct ieee80211_hw *hw,
 
 	/*rx_status->qual = status->signal; */
 	rx_status->signal = status->recvsignalpower + 10;
-	/*rx_status->noise = -status->noise; */
 	if (status->packet_report_type == TX_REPORT2) {
 		status->macid_valid_entry[0] =
 			 GET_RX_RPT2_DESC_MACID_VALID_1(pdesc);
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
index 6ad23b4..52abf0a 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
@@ -420,7 +420,6 @@ bool rtl92ce_rx_query_desc(struct ieee80211_hw *hw,
 
 	/*rx_status->qual = stats->signal; */
 	rx_status->signal = stats->recvsignalpower + 10;
-	/*rx_status->noise = -stats->noise; */
 
 	return true;
 }
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
index c709511..222d2e7 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
@@ -330,7 +330,6 @@ bool rtl92se_rx_query_desc(struct ieee80211_hw *hw, struct rtl_stats *stats,
 
 	/*rx_status->qual = stats->signal; */
 	rx_status->signal = stats->rssi + 10;
-	/*rx_status->noise = -stats->noise; */
 
 	return true;
 }
diff --git a/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c b/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c
index c72758d..e85ec21 100644
--- a/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c
@@ -359,7 +359,6 @@ bool rtl8723ae_rx_query_desc(struct ieee80211_hw *hw,
 
 	/*rx_status->qual = status->signal; */
 	rx_status->signal = status->recvsignalpower + 10;
-	/*rx_status->noise = -status->noise; */
 
 	return true;
 }
-- 
1.8.1.4


^ permalink raw reply related

* [PATCH 7/8 V4] rtlwifi: rtl8188ee: Fix smatch warning in rtl8188ee/hw.c
From: Larry Finger @ 2013-09-25 17:57 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Larry Finger, netdev, Stable
In-Reply-To: <1380131869-19185-1-git-send-email-Larry.Finger@lwfinger.net>

Smatch lists the following:
  CHECK   drivers/net/wireless/rtlwifi/rtl8188ee/hw.c
drivers/net/wireless/rtlwifi/rtl8188ee/hw.c:149 _rtl88ee_set_fw_clock_on() info: ignoring unreachable code.
drivers/net/wireless/rtlwifi/rtl8188ee/hw.c:149 _rtl88ee_set_fw_clock_on() info: ignoring unreachable code.

This info message is the result of a real error due to a missing break statement
in a "while (1)" loop.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org> [3.10+]
---
 drivers/net/wireless/rtlwifi/rtl8188ee/hw.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/rtlwifi/rtl8188ee/hw.c b/drivers/net/wireless/rtlwifi/rtl8188ee/hw.c
index b68cae3..e06971b 100644
--- a/drivers/net/wireless/rtlwifi/rtl8188ee/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8188ee/hw.c
@@ -143,6 +143,7 @@ static void _rtl88ee_set_fw_clock_on(struct ieee80211_hw *hw,
 		} else {
 			rtlhal->fw_clk_change_in_progress = false;
 			spin_unlock_bh(&rtlpriv->locks.fw_ps_lock);
+			break;
 		}
 	}
 
-- 
1.8.1.4


^ permalink raw reply related

* [PATCH 6/8 V4] rtlwifi: Fix smatch warnings in usb.c
From: Larry Finger @ 2013-09-25 17:57 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Larry Finger, netdev
In-Reply-To: <1380131869-19185-1-git-send-email-Larry.Finger@lwfinger.net>

Smatch displays the following:
  CHECK   drivers/net/wireless/rtlwifi/usb.c
drivers/net/wireless/rtlwifi/usb.c:458 _rtl_usb_rx_process_agg() warn: assigning (-98) to unsigned variable 'stats.noise'
drivers/net/wireless/rtlwifi/usb.c:503 _rtl_usb_rx_process_noagg() warn: assigning (-98) to unsigned variable 'stats.noise'
drivers/net/wireless/rtlwifi/usb.c:596 _rtl_rx_get_padding() info: ignoring unreachable code.
drivers/net/wireless/rtlwifi/usb.c:596 _rtl_rx_get_padding() info: ignoring unreachable code.

The variable 'stats.noise' is not used, thus the initializers are removed.
The unreachable code info is fixed by including the appropriate section inside
#ifdef .. #endif constructions.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
 drivers/net/wireless/rtlwifi/usb.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c
index e56778c..6e2b5c5 100644
--- a/drivers/net/wireless/rtlwifi/usb.c
+++ b/drivers/net/wireless/rtlwifi/usb.c
@@ -455,7 +455,6 @@ static void _rtl_usb_rx_process_agg(struct ieee80211_hw *hw,
 	struct ieee80211_rx_status rx_status = {0};
 	struct rtl_stats stats = {
 		.signal = 0,
-		.noise = -98,
 		.rate = 0,
 	};
 
@@ -498,7 +497,6 @@ static void _rtl_usb_rx_process_noagg(struct ieee80211_hw *hw,
 	struct ieee80211_rx_status rx_status = {0};
 	struct rtl_stats stats = {
 		.signal = 0,
-		.noise = -98,
 		.rate = 0,
 	};
 
@@ -582,12 +580,15 @@ static void _rtl_rx_work(unsigned long param)
 static unsigned int _rtl_rx_get_padding(struct ieee80211_hdr *hdr,
 					unsigned int len)
 {
+#if NET_IP_ALIGN != 0
 	unsigned int padding = 0;
+#endif
 
 	/* make function no-op when possible */
 	if (NET_IP_ALIGN == 0 || len < sizeof(*hdr))
 		return 0;
 
+#if NET_IP_ALIGN != 0
 	/* alignment calculation as in lbtf_rx() / carl9170_rx_copy_data() */
 	/* TODO: deduplicate common code, define helper function instead? */
 
@@ -608,6 +609,7 @@ static unsigned int _rtl_rx_get_padding(struct ieee80211_hdr *hdr,
 		padding ^= NET_IP_ALIGN;
 
 	return padding;
+#endif
 }
 
 #define __RADIO_TAP_SIZE_RSV	32
-- 
1.8.1.4


^ permalink raw reply related

* [PATCH 5/8 V4] rtlwifi: Fix smatch warning in pci.c
From: Larry Finger @ 2013-09-25 17:57 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Larry Finger, netdev
In-Reply-To: <1380131869-19185-1-git-send-email-Larry.Finger@lwfinger.net>

Smatch reports the following:
  CHECK   drivers/net/wireless/rtlwifi/pci.c
drivers/net/wireless/rtlwifi/pci.c:739 _rtl_pci_rx_interrupt() warn: assigning (-98) to unsigned variable 'stats.noise'

The variable 'stats.noise' is not used. That initializer is removed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
 drivers/net/wireless/rtlwifi/pci.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
index 703f839..6295ed2 100644
--- a/drivers/net/wireless/rtlwifi/pci.c
+++ b/drivers/net/wireless/rtlwifi/pci.c
@@ -736,7 +736,6 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
 
 	struct rtl_stats stats = {
 		.signal = 0,
-		.noise = -98,
 		.rate = 0,
 	};
 	int index = rtlpci->rx_ring[rx_queue_idx].idx;
-- 
1.8.1.4


^ permalink raw reply related

* [PATCH 4/8 V4] rtlwifi: rtl8192_common: Fix smatch errors and warnings in rtl8192c/dm_common.c
From: Larry Finger @ 2013-09-25 17:57 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Larry Finger, netdev
In-Reply-To: <1380131869-19185-1-git-send-email-Larry.Finger@lwfinger.net>

Smatch lists the following:
  CHECK   drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c:551 rtl92c_dm_pwdb_monitor() info: ignoring unreachable code.
drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c:551 rtl92c_dm_pwdb_monitor() info: ignoring unreachable code.
drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c:870 rtl92c_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'txpwr_level' 2 <= 2
drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c:870 rtl92c_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'txpwr_level' 2 <= 2
drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c:882 rtl92c_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'txpwr_level' 2 <= 2
drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c:883 rtl92c_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'txpwr_level' 2 <= 2
drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c:891 rtl92c_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'txpwr_level' 2 <= 2
drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c:892 rtl92c_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'txpwr_level' 2 <= 2

The unreachable code message is fixed by deleting the code that follows a return.

The errors are fixed by increasing the size of txpwr_level.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
 drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c | 25 +----------------------
 1 file changed, 1 insertion(+), 24 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
index d2d57a2..e9caa5d 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
@@ -541,29 +541,6 @@ EXPORT_SYMBOL(rtl92c_dm_write_dig);
 
 static void rtl92c_dm_pwdb_monitor(struct ieee80211_hw *hw)
 {
-	struct rtl_priv *rtlpriv = rtl_priv(hw);
-	long tmpentry_max_pwdb = 0, tmpentry_min_pwdb = 0xff;
-
-	u8 h2c_parameter[3] = { 0 };
-
-	return;
-
-	if (tmpentry_max_pwdb != 0) {
-		rtlpriv->dm.entry_max_undec_sm_pwdb = tmpentry_max_pwdb;
-	} else {
-		rtlpriv->dm.entry_max_undec_sm_pwdb = 0;
-	}
-
-	if (tmpentry_min_pwdb != 0xff) {
-		rtlpriv->dm.entry_min_undec_sm_pwdb = tmpentry_min_pwdb;
-	} else {
-		rtlpriv->dm.entry_min_undec_sm_pwdb = 0;
-	}
-
-	h2c_parameter[2] = (u8) (rtlpriv->dm.undec_sm_pwdb & 0xFF);
-	h2c_parameter[0] = 0;
-
-	rtl92c_fill_h2c_cmd(hw, H2C_RSSI_REPORT, 3, h2c_parameter);
 }
 
 void rtl92c_dm_init_edca_turbo(struct ieee80211_hw *hw)
@@ -673,7 +650,7 @@ static void rtl92c_dm_txpower_tracking_callback_thermalmeter(struct ieee80211_hw
 	s8 cck_index = 0;
 	int i;
 	bool is2t = IS_92C_SERIAL(rtlhal->version);
-	s8 txpwr_level[2] = {0, 0};
+	s8 txpwr_level[3] = {0, 0, 0};
 	u8 ofdm_min_index = 6, rf;
 
 	rtlpriv->dm.txpower_trackinginit = true;
-- 
1.8.1.4


^ permalink raw reply related

* [PATCH 3/8 V4] rtlwifi: rtl8192cu: Fix smatch warning in rtl8192cu/trx.c
From: Larry Finger @ 2013-09-25 17:57 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Larry Finger, netdev
In-Reply-To: <1380131869-19185-1-git-send-email-Larry.Finger@lwfinger.net>

Smatch lists the following:
  CHECK   drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
drivers/net/wireless/rtlwifi/rtl8192cu/trx.c:367 _rtl_rx_process() warn: assigning (-98) to unsigned variable 'stats.noise'

This variable is unused, thus the initializer is removed, as well as a
comment referring to that variable.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
 drivers/net/wireless/rtlwifi/rtl8192cu/trx.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
index 763cf1d..04c7e57 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
@@ -349,7 +349,6 @@ bool rtl92cu_rx_query_desc(struct ieee80211_hw *hw,
 	}
 	/*rx_status->qual = stats->signal; */
 	rx_status->signal = stats->rssi + 10;
-	/*rx_status->noise = -stats->noise; */
 	return true;
 }
 
@@ -364,7 +363,6 @@ static void _rtl_rx_process(struct ieee80211_hw *hw, struct sk_buff *skb)
 	u8 *rxdesc;
 	struct rtl_stats stats = {
 		.signal = 0,
-		.noise = -98,
 		.rate = 0,
 	};
 	struct rx_fwinfo_92c *p_drvinfo;
-- 
1.8.1.4


^ permalink raw reply related

* [PATCH V4] rtlwifi: rtl8192de: Fix smatch warnings in rtl8192de/hw.c
From: Larry Finger @ 2013-09-25 17:57 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Larry Finger, netdev
In-Reply-To: <1380131869-19185-1-git-send-email-Larry.Finger@lwfinger.net>

Smatch lists the following:
  CHECK   drivers/net/wireless/rtlwifi/rtl8192de/hw.c
drivers/net/wireless/rtlwifi/rtl8192de/hw.c:1200 rtl92de_set_qos() info: ignoring unreachable code.
drivers/net/wireless/rtlwifi/rtl8192de/hw.c:1200 rtl92de_set_qos() info: ignoring unreachable code.

The dead code is deleted.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
 drivers/net/wireless/rtlwifi/rtl8192de/hw.c | 18 ------------------
 1 file changed, 18 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/hw.c b/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
index 7dd8f6d..c4a7db9 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
@@ -1194,25 +1194,7 @@ void rtl92d_linked_set_reg(struct ieee80211_hw *hw)
  * mac80211 will send pkt when scan */
 void rtl92de_set_qos(struct ieee80211_hw *hw, int aci)
 {
-	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	rtl92d_dm_init_edca_turbo(hw);
-	return;
-	switch (aci) {
-	case AC1_BK:
-		rtl_write_dword(rtlpriv, REG_EDCA_BK_PARAM, 0xa44f);
-		break;
-	case AC0_BE:
-		break;
-	case AC2_VI:
-		rtl_write_dword(rtlpriv, REG_EDCA_VI_PARAM, 0x5e4322);
-		break;
-	case AC3_VO:
-		rtl_write_dword(rtlpriv, REG_EDCA_VO_PARAM, 0x2f3222);
-		break;
-	default:
-		RT_ASSERT(false, "invalid aci: %d !\n", aci);
-		break;
-	}
 }
 
 void rtl92de_enable_interrupt(struct ieee80211_hw *hw)
-- 
1.8.1.4


^ permalink raw reply related

* [PATCH 1/8 V4] rtlwifi: rtl8192du: Fix smatch errors in /rtl8192de/dm.c
From: Larry Finger @ 2013-09-25 17:57 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Larry Finger, netdev
In-Reply-To: <1380131869-19185-1-git-send-email-Larry.Finger@lwfinger.net>

Smatch lists the following:
  CHECK   drivers/net/wireless/rtlwifi/rtl8192de/dm.c
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1054 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'ofdm_index' 2 <= 2
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1056 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'ofdm_index' 2 <= 2
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1126 rtl92d_dm_txpower_tracking_callback_thermalmeter() debug: remove_pools: nr_children over 4000 (4596). (rtlpriv->dbg.global_debuglevel merged)
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1126 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'cckswing_table_ch1ch13' 33 <= 255
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1129 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'cckswing_table_ch1ch13' 33 <= 255
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1132 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'cckswing_table_ch1ch13' 33 <= 255
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1135 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'cckswing_table_ch1ch13' 33 <= 255
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1138 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'cckswing_table_ch1ch13' 33 <= 255
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1141 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'cckswing_table_ch1ch13' 33 <= 255
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1144 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'cckswing_table_ch1ch13' 33 <= 255
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1147 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'cckswing_table_ch1ch13' 33 <= 255
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1151 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'cckswing_table_ch14' 33 <= 255
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1154 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'cckswing_table_ch14' 33 <= 255
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1157 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'cckswing_table_ch14' 33 <= 255
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1160 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'cckswing_table_ch14' 33 <= 255
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1163 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'cckswing_table_ch14' 33 <= 255
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1166 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'cckswing_table_ch14' 33 <= 255
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1169 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'cckswing_table_ch14' 33 <= 255
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1172 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'cckswing_table_ch14' 33 <= 255

This patch fixes several off-by-one errors. It also removes a comment
referencing variable 'noise' in the rts_stats struct.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
 drivers/net/wireless/rtlwifi/rtl8192de/dm.c  | 8 ++++++--
 drivers/net/wireless/rtlwifi/rtl8192de/trx.c | 1 -
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/dm.c b/drivers/net/wireless/rtlwifi/rtl8192de/dm.c
index 47875ba..eaeee77 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/dm.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/dm.c
@@ -840,9 +840,9 @@ static void rtl92d_dm_txpower_tracking_callback_thermalmeter(
 	bool internal_pa = false;
 	long ele_a = 0, ele_d, temp_cck, val_x, value32;
 	long val_y, ele_c = 0;
-	u8 ofdm_index[2];
+	u8 ofdm_index[3];
 	s8 cck_index = 0;
-	u8 ofdm_index_old[2] = {0, 0};
+	u8 ofdm_index_old[3] = {0, 0, 0};
 	s8 cck_index_old = 0;
 	u8 index;
 	int i;
@@ -1118,6 +1118,10 @@ static void rtl92d_dm_txpower_tracking_callback_thermalmeter(
 				 val_x, val_y, ele_a, ele_c, ele_d,
 				 val_x, val_y);
 
+			if (cck_index >= CCK_TABLE_SIZE)
+				cck_index = CCK_TABLE_SIZE - 1;
+			if (cck_index < 0)
+				cck_index = 0;
 			if (rtlhal->current_bandtype == BAND_ON_2_4G) {
 				/* Adjust CCK according to IQK result */
 				if (!rtlpriv->dm.cck_inch14) {
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/trx.c b/drivers/net/wireless/rtlwifi/rtl8192de/trx.c
index b8ec718..945ddec 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/trx.c
@@ -526,7 +526,6 @@ bool rtl92de_rx_query_desc(struct ieee80211_hw *hw,	struct rtl_stats *stats,
 	}
 	/*rx_status->qual = stats->signal; */
 	rx_status->signal = stats->rssi + 10;
-	/*rx_status->noise = -stats->noise; */
 	return true;
 }
 
-- 
1.8.1.4


^ permalink raw reply related

* [PATCH 0/8 V4] rtlwifi: Patches to fix problems shown by smatch
From: Larry Finger @ 2013-09-25 17:57 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Larry Finger, netdev

Fix smatch warnings and errors in the rtlwifi family of drivers.

V2 addresses comments by David Laight and Sergei Shtylyov.
V3 addresses further comments by David, Sergei, and Kalle Valo. The
   dead code is removed, and the variable is left in the struct.
V4 Fixes extra line removed by accident from rtl8192de/hw.c as
   noted by Sergei

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---

Larry Finger (8):
  rtlwifi: rtl8192du: Fix smatch errors in /rtl8192de/dm.c
  rtlwifi: rtl8192de: Fix smatch warnings in rtl8192de/hw.c
  rtlwifi: rtl8192cu: Fix smatch warning in rtl8192cu/trx.c
  rtlwifi: rtl8192_common: Fix smatch errors and warnings in
    rtl8192c/dm_common.c
  rtlwifi: Fix smatch warning in pci.c
  rtlwifi: Fix smatch warnings in usb.c
  rtlwifi: rtl8188ee: Fix smatch warning in rtl8188ee/hw.c
  rtlwifi: Remove all remaining references to variable 'noise' in
    rtl_stats struct

 drivers/net/wireless/rtlwifi/pci.c                |  1 -
 drivers/net/wireless/rtlwifi/rtl8188ee/hw.c       |  1 +
 drivers/net/wireless/rtlwifi/rtl8188ee/trx.c      |  1 -
 drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c | 25 +----------------------
 drivers/net/wireless/rtlwifi/rtl8192ce/trx.c      |  1 -
 drivers/net/wireless/rtlwifi/rtl8192cu/trx.c      |  2 --
 drivers/net/wireless/rtlwifi/rtl8192de/dm.c       |  8 ++++++--
 drivers/net/wireless/rtlwifi/rtl8192de/hw.c       | 18 ----------------
 drivers/net/wireless/rtlwifi/rtl8192de/trx.c      |  1 -
 drivers/net/wireless/rtlwifi/rtl8192se/trx.c      |  1 -
 drivers/net/wireless/rtlwifi/rtl8723ae/trx.c      |  1 -
 drivers/net/wireless/rtlwifi/usb.c                |  6 ++++--
 12 files changed, 12 insertions(+), 54 deletions(-)

-- 
1.8.1.4


^ permalink raw reply

* Re: No connection with TP-Link TL-WN823N (rtl8192cu)
From: Larry Finger @ 2013-09-25 16:46 UTC (permalink / raw)
  To: Dan Williams; +Cc: linux-wireless
In-Reply-To: <1380113275.7555.18.camel@dcbw.foobar.com>

On 09/25/2013 07:47 AM, Dan Williams wrote:
> On Tue, 2013-09-24 at 17:43 -0500, Larry Finger wrote:
>> On 09/09/2013 05:15 PM, Dan Williams wrote:
>>> On Mon, 2013-09-09 at 16:52 -0500, Larry Finger wrote:
>>
>>>> I have been running rtl8192cu for the past 24 hours without a permanent
>>>> disconnect. Under NetworkManager, I see some reason 7 deauthentications, but
>>>
>>> Running wpa_supplicant with debugging on might shed some light on these;
>>> basically:
>>>
>>> mv /usr/sbin/wpa_supplicant /
>>> killall -TERM wpa_supplicant
>>> /wpa_supplicant -dddtu <piped to your favorite log file>
>>>
>>> and NM should automatically reconnect, and then we can figure out what's
>>> going on in the supplicant.
>>
>> Dan,
>>
>> The log of wpa_supplicant associated with the reason 7 disconnects are as follows:
>
> So reason 7 is "Incorrect frame type or subtype received from
> unassociated station" which seems like the AP thinks we got
> disconnected, and would seem to be a driver/mac80211 issue still, right?

Yes. These only happen with rtl8192ce and rtl8192cu. They are a bit more common 
when running NetworkManager than with ifup. In my current run, they have been at 
intervals of 1000 to 30,000 seconds apart. Capturing them with wireshark may not 
be practical.

--snip--

> And got reconnected after a bit more than one second.  So at least it
> recovers quickly, but the question is more about why the reason 7
> happened, and what frames caused it, I think.

I agree. The sequence seems to start with an MLME Event 39:

.908249: nl80211: MLME event 39
.908252: nl80211: MLME event frame - hexdump(len=26): c0 00 3a 01 1c 65 9d 5a c3 
9d 20 e5 2a 01 f7 ea 20 e5 2a 01 f7 ea a0 f6 07 00
.908269: wlan3: Event DEAUTH (12) received
.908273: wlan3: Deauthentication notification

All that happens within 25 usec, but I have no clue what triggers that. In 
addition, I have been unable to find any documentation on MLME events. Any 
suggestions regarding a source would be appreciated.

Thanks,

Larry


^ permalink raw reply

* Re: [PATCH 3.12] mwifiex: queue main work from main process when bailing on races
From: Daniel Mack @ 2013-09-25 16:37 UTC (permalink / raw)
  To: Bing Zhao
  Cc: Paul Stewart, Dylan Reid, linux-wireless@vger.kernel.org,
	s.neumann@raumfeld.com, afenkart@gmail.com,
	linville@tuxdriver.com, johannes.berg@intel.com,
	stable@vger.kernel.org
In-Reply-To: <477F20668A386D41ADCC57781B1F70430F45077CCF@SC-VEXCH1.marvell.com>

Hi Bing,

On 25.09.2013 18:19, Bing Zhao wrote:
>>> Acked-by: Bing Zhao <bzhao@marvell.com>
>> 
>> John, could you pick this one?
> 
> We found that this patch causes CPU utilization issue on
> Chromebooks. Could you please try attached patch on your platform?
> Basically this patch reverts your change and add main_proc_lock
> protection for int_status and IS_CARD_RX_RCVD access to avoid the
> missing interrupt handling.

Ok, that seems to work fine for me as well. Thanks for the update :)

Fell free to add my

	Tested-by: Daniel Mack <zonque@gmail.com>

if you need it.


Thanks,
Daniel


^ permalink raw reply

* RE: [patch] mwifiex: potential integer underflow in mwifiex_ret_wmm_get_status()
From: Bing Zhao @ 2013-09-25 16:25 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: John W. Linville, linux-wireless@vger.kernel.org,
	kernel-janitors@vger.kernel.org
In-Reply-To: <20130925085729.GC6661@elgon.mountain>

Hi Dan,

> If "resp_len" gets set to negative then it counts as a high positive value.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> I spotted this reviewing the int => bool changes, but I don't have the
> hardware and can't test it.

Thanks for spotting this potential integer underflow problem.

I think we can change the 'resp_len' variable type to a signed integer to fix this issue.

Thanks,
Bing

> 
> diff --git a/drivers/net/wireless/mwifiex/wmm.c
> b/drivers/net/wireless/mwifiex/wmm.c
> index 2e8f9cd..3c6ee3a 100644
> --- a/drivers/net/wireless/mwifiex/wmm.c
> +++ b/drivers/net/wireless/mwifiex/wmm.c
> @@ -772,6 +772,8 @@ int mwifiex_ret_wmm_get_status(struct
> mwifiex_private *priv,
>  			break;
>  		}
> 
> +		if (resp_len < tlv_len + sizeof(tlv_hdr->header))
> +			break;
>  		curr += (tlv_len + sizeof(tlv_hdr->header));
>  		resp_len -= (tlv_len + sizeof(tlv_hdr->header));
>  	}

^ permalink raw reply

* RE: [PATCH 3.12] mwifiex: queue main work from main process when bailing on races
From: Bing Zhao @ 2013-09-25 16:19 UTC (permalink / raw)
  To: Daniel Mack, Paul Stewart, Dylan Reid
  Cc: linux-wireless@vger.kernel.org, s.neumann@raumfeld.com,
	afenkart@gmail.com, linville@tuxdriver.com,
	johannes.berg@intel.com, stable@vger.kernel.org
In-Reply-To: <5242F1D7.4040404@gmail.com>

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

Hi Daniel,

> > Acked-by: Bing Zhao <bzhao@marvell.com>
> 
> John, could you pick this one?

We found that this patch causes CPU utilization issue on Chromebooks.
Could you please try attached patch on your platform? Basically this patch reverts your change and add main_proc_lock protection for int_status and IS_CARD_RX_RCVD access to avoid the missing interrupt handling.

Thanks,
Bing
 

[-- Attachment #2: 0001-mwifiex-avoid-redundant-main-process-queueing.patch --]
[-- Type: application/octet-stream, Size: 1965 bytes --]

From 43b3fcb3e58b6d10b70c08f5b2259a64a195f1a5 Mon Sep 17 00:00:00 2001
From: Amitkumar Karwar <akarwar@marvell.com>
Date: Wed, 25 Sep 2013 21:21:29 +0530
Subject: [PATCH] mwifiex: avoid redundant main process queueing

As we use single threaded workqueue, the only possiblity
for concurrent mwifiex_main_process() calls is during SDIO
interrupts where the routine is directly called.

Recently queue_work() call is added to fix corner case
SDIO interrupt lost issue. With this change main process
is sometimes unnecessarily queued multiple times which results
in increased CPU utilization.

This patch makes sure that currently running main process
will always take care of pending interrupts. We don't need to
queue an extra main process. This fixes interrupt lost issue.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
---
 drivers/net/wireless/mwifiex/main.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index 516b80e..dd6548e 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -235,7 +235,6 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter)
 	/* Check if already processing */
 	if (adapter->mwifiex_processing) {
 		spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
-		queue_work(adapter->workqueue, &adapter->main_work);
 		goto exit_main_proc;
 	} else {
 		adapter->mwifiex_processing = true;
@@ -359,10 +358,12 @@ process_start:
 		}
 	} while (true);
 
-	if ((adapter->int_status) || IS_CARD_RX_RCVD(adapter))
+	spin_lock_irqsave(&adapter->main_proc_lock, flags);
+	if ((adapter->int_status) || IS_CARD_RX_RCVD(adapter)) {
+		spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
 		goto process_start;
+	}
 
-	spin_lock_irqsave(&adapter->main_proc_lock, flags);
 	adapter->mwifiex_processing = false;
 	spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
 
-- 
1.7.3.4


^ permalink raw reply related

* Re: [PATCH 3.12] mwifiex: queue main work from main process when bailing on races
From: Daniel Mack @ 2013-09-25 14:23 UTC (permalink / raw)
  To: Bing Zhao
  Cc: linux-wireless@vger.kernel.org, s.neumann@raumfeld.com,
	afenkart@gmail.com, linville@tuxdriver.com,
	johannes.berg@intel.com, stable@vger.kernel.org
In-Reply-To: <477F20668A386D41ADCC57781B1F70430F44C5880A@SC-VEXCH1.marvell.com>

On 17.09.2013 21:15, Bing Zhao wrote:
>> Queue main_work in case mwifiex_main_process() bails due to an already
>> processed transaction. This is particularly necessary because
>> mwifiex_main_process() is called from both the SDIO interrupt handler and
>> the workqueue. In case an interrupt occurs while the main process is
>> currently executed from the workqueue, the interrupt is lost, resulting in a
>> command timeout and consequently a card reset.
>>
>> I'm marking this for stable kernel in version 3.7+, because on our platform,
>> the issue appears since 601216e12c ("mwifiex: process RX packets in SDIO
>> IRQ thread directly") went in.
>>
>> Signed-off-by: Daniel Mack <zonque@gmail.com>
>> Reported-by: Sven Neumann <s.neumann@raumfeld.com>
>> Reported-by: Andreas Fenkart <afenkart@gmail.com>
>> Cc: Bing Zhao <bzhao@marvell.com>
>> Cc: <stable@vger.kernel.org> [v3.7+]
> 
> Acked-by: Bing Zhao <bzhao@marvell.com>

John, could you pick this one?


Many thanks,
Daniel


> 
> Thanks,
> Bing
> 
>> ---
>>  drivers/net/wireless/mwifiex/main.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/net/wireless/mwifiex/main.c
>> b/drivers/net/wireless/mwifiex/main.c
>> index ff4ed96..0700bc2 100644
>> --- a/drivers/net/wireless/mwifiex/main.c
>> +++ b/drivers/net/wireless/mwifiex/main.c
>> @@ -235,6 +235,7 @@ int mwifiex_main_process(struct mwifiex_adapter
>> *adapter)
>>  	/* Check if already processing */
>>  	if (adapter->mwifiex_processing) {
>>  		spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
>> +		queue_work(adapter->workqueue, &adapter->main_work);
>>  		goto exit_main_proc;
>>  	} else {
>>  		adapter->mwifiex_processing = true;
>> --
>> 1.8.3.1
> 


^ permalink raw reply

* Re: [PATCH] ti-connectivity: add wl1251 firmware and license
From: Felipe Balbi @ 2013-09-25 13:59 UTC (permalink / raw)
  To: Luca Coelho
  Cc: balbi, ben, Linux Kernel Mailing List, linux-wireless,
	Pavel Machek
In-Reply-To: <1380116535.4503.19.camel@porter.coelho.fi>

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

On Wed, Sep 25, 2013 at 04:42:15PM +0300, Luca Coelho wrote:
> On Wed, 2013-09-25 at 08:23 -0500, Felipe Balbi wrote:
> > On Wed, Sep 25, 2013 at 02:07:58PM +0300, Luca Coelho wrote:
> > > On Wed, 2013-09-25 at 14:04 +0300, Luca Coelho wrote:
> > > > When sending big binary blobs, it's generally better to send pull
> > > > requests instead of patches.  If you add the -p option when calling git
> > > > pull-request, the text will include all the readable parts but will omit
> > > > the binary stuff.
> > > > 
> > > > Thank you very much for following up on this!
> > > 
> > > Ah, and I forgot to say that you should update the WHENCE file
> > > accordingly too.  Check the wl12xx and wl18xx drivers for examples.
> > 
> > I'll send a pull request, but how about this ? I don't think we can
> > change the license. It seems like the other firmwares are using the
> > older license, I'd argue those should be changed to the new one, but
> > that's another discussion.
> 
> Cool, in general it looks good!
> 
> Though it would be nice to know if the same "new" license could be used
> for all the firmwares to avoid almost identical licenses.

well, i'm not a lawyer :-s

> > diff --git a/WHENCE b/WHENCE
> > index e66fea5..4e9e2ed 100644
> > --- a/WHENCE
> > +++ b/WHENCE
> > @@ -1705,6 +1705,19 @@ Licence: Redistributable. See LICENCE.tda7706-firmware.txt for details.
> >  
> >  --------------------------------------------------------------------------
> >  
> > +Driver: wl1251 - Texas Instruments 802.11 WLAN driver for WiLink4 chips
> > +
> > +File: ti-connectivity/wl1251-fw.bin
> > +File: ti-connectivity/wl1251-nvs.bin
> 
> Don't you have the firmware version number to add here with "Version:"
> tags like the other ones? I think you can easily find the version by
> running strings on the binary and grepping for "Rev" (at least with the
> newer WiLinks, this works).

Done :-) thanks for the tip.

> > +Licence: See LICENCE.wl1251 for details.
> > +
> > +The driver expects to find the firmwares under a ti-connectivity subdirectory.
> > +So if your system looks for firmwares in /lib/firmware, the firmwares for
> > +wl12xx chips must be located in /lib/firmware/ti-connectivity/.
> 
> It's a bit stupid that this was never changed in wl1251, but it still
> expects the driver in the "root" firmwares directory (ie.
> in /lib/firmware/wl1251-fw.bin, not
> in /lib/firmware/ti-connectivity/wl1251-fw.bin).  Maybe now is the right
> time to change the driver appropriately to keep consistency? ;)

alright, will do...

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* Re: [PATCH] ti-connectivity: add wl1251 firmware and license
From: Luca Coelho @ 2013-09-25 13:42 UTC (permalink / raw)
  To: balbi; +Cc: ben, Linux Kernel Mailing List, linux-wireless, Pavel Machek
In-Reply-To: <20130925132359.GE10746@radagast>

On Wed, 2013-09-25 at 08:23 -0500, Felipe Balbi wrote:
> On Wed, Sep 25, 2013 at 02:07:58PM +0300, Luca Coelho wrote:
> > On Wed, 2013-09-25 at 14:04 +0300, Luca Coelho wrote:
> > > When sending big binary blobs, it's generally better to send pull
> > > requests instead of patches.  If you add the -p option when calling git
> > > pull-request, the text will include all the readable parts but will omit
> > > the binary stuff.
> > > 
> > > Thank you very much for following up on this!
> > 
> > Ah, and I forgot to say that you should update the WHENCE file
> > accordingly too.  Check the wl12xx and wl18xx drivers for examples.
> 
> I'll send a pull request, but how about this ? I don't think we can
> change the license. It seems like the other firmwares are using the
> older license, I'd argue those should be changed to the new one, but
> that's another discussion.

Cool, in general it looks good!

Though it would be nice to know if the same "new" license could be used
for all the firmwares to avoid almost identical licenses.

More comments below...

> diff --git a/WHENCE b/WHENCE
> index e66fea5..4e9e2ed 100644
> --- a/WHENCE
> +++ b/WHENCE
> @@ -1705,6 +1705,19 @@ Licence: Redistributable. See LICENCE.tda7706-firmware.txt for details.
>  
>  --------------------------------------------------------------------------
>  
> +Driver: wl1251 - Texas Instruments 802.11 WLAN driver for WiLink4 chips
> +
> +File: ti-connectivity/wl1251-fw.bin
> +File: ti-connectivity/wl1251-nvs.bin

Don't you have the firmware version number to add here with "Version:"
tags like the other ones? I think you can easily find the version by
running strings on the binary and grepping for "Rev" (at least with the
newer WiLinks, this works).


> +Licence: See LICENCE.wl1251 for details.
> +
> +The driver expects to find the firmwares under a ti-connectivity subdirectory.
> +So if your system looks for firmwares in /lib/firmware, the firmwares for
> +wl12xx chips must be located in /lib/firmware/ti-connectivity/.

It's a bit stupid that this was never changed in wl1251, but it still
expects the driver in the "root" firmwares directory (ie.
in /lib/firmware/wl1251-fw.bin, not
in /lib/firmware/ti-connectivity/wl1251-fw.bin).  Maybe now is the right
time to change the driver appropriately to keep consistency? ;)

--
Luca.


^ permalink raw reply

* [PATCH] rt2800: add support for radio chip RF3070
From: Stanislaw Gruszka @ 2013-09-25 13:34 UTC (permalink / raw)
  To: linux-wireless; +Cc: users

Add support for new RF chip ID: 3070. It seems to be the same as 5370,
maybe vendor just put wrong value on the eeprom, but add this id anyway
since devices with it showed on the marked.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>

diff --git a/drivers/net/wireless/rt2x00/rt2800.h b/drivers/net/wireless/rt2x00/rt2800.h
index fa33b5e..e3eb952 100644
--- a/drivers/net/wireless/rt2x00/rt2800.h
+++ b/drivers/net/wireless/rt2x00/rt2800.h
@@ -52,6 +52,7 @@
  * RF3322 2.4G 2T2R(RT3352/RT3371/RT3372/RT3391/RT3392)
  * RF3053 2.4G/5G 3T3R(RT3883/RT3563/RT3573/RT3593/RT3662)
  * RF5592 2.4G/5G 2T2R
+ * RF3070 2.4G 1T1R
  * RF5360 2.4G 1T1R
  * RF5370 2.4G 1T1R
  * RF5390 2.4G 1T1R
@@ -70,6 +71,7 @@
 #define RF3322				0x000c
 #define RF3053				0x000d
 #define RF5592				0x000f
+#define RF3070				0x3070
 #define RF3290				0x3290
 #define RF5360				0x5360
 #define RF5370				0x5370
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index 88ce656..d2f638f 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -3152,6 +3152,7 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
 	case RF3322:
 		rt2800_config_channel_rf3322(rt2x00dev, conf, rf, info);
 		break;
+	case RF3070:
 	case RF5360:
 	case RF5370:
 	case RF5372:
@@ -3166,7 +3167,8 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
 		rt2800_config_channel_rf2xxx(rt2x00dev, conf, rf, info);
 	}
 
-	if (rt2x00_rf(rt2x00dev, RF3290) ||
+	if (rt2x00_rf(rt2x00dev, RF3070) ||
+	    rt2x00_rf(rt2x00dev, RF3290) ||
 	    rt2x00_rf(rt2x00dev, RF3322) ||
 	    rt2x00_rf(rt2x00dev, RF5360) ||
 	    rt2x00_rf(rt2x00dev, RF5370) ||
@@ -4264,6 +4266,7 @@ void rt2800_vco_calibration(struct rt2x00_dev *rt2x00dev)
 		rt2800_rfcsr_write(rt2x00dev, 7, rfcsr);
 		break;
 	case RF3053:
+	case RF3070:
 	case RF3290:
 	case RF5360:
 	case RF5370:
@@ -7021,6 +7024,7 @@ static int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev)
 	case RF3022:
 	case RF3052:
 	case RF3053:
+	case RF3070:
 	case RF3290:
 	case RF3320:
 	case RF3322:
@@ -7543,6 +7547,7 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
 		   rt2x00_rf(rt2x00dev, RF2020) ||
 		   rt2x00_rf(rt2x00dev, RF3021) ||
 		   rt2x00_rf(rt2x00dev, RF3022) ||
+		   rt2x00_rf(rt2x00dev, RF3070) ||
 		   rt2x00_rf(rt2x00dev, RF3290) ||
 		   rt2x00_rf(rt2x00dev, RF3320) ||
 		   rt2x00_rf(rt2x00dev, RF3322) ||
@@ -7671,6 +7676,7 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
 	case RF3320:
 	case RF3052:
 	case RF3053:
+	case RF3070:
 	case RF3290:
 	case RF5360:
 	case RF5370:

^ permalink raw reply related

* Re: [PATCH] ti-connectivity: add wl1251 firmware and license
From: Felipe Balbi @ 2013-09-25 13:23 UTC (permalink / raw)
  To: Luca Coelho
  Cc: Felipe Balbi, ben, Linux Kernel Mailing List, linux-wireless,
	Pavel Machek
In-Reply-To: <1380107278.4503.9.camel@porter.coelho.fi>

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

Hi,

On Wed, Sep 25, 2013 at 02:07:58PM +0300, Luca Coelho wrote:
> On Wed, 2013-09-25 at 14:04 +0300, Luca Coelho wrote:
> > Hi dude,
> > 
> > Great, this is cool! Finally! :)
> > 
> > A few comments...
> > 
> > 
> > On Tue, 2013-09-24 at 09:44 -0500, Felipe Balbi wrote:
> > > It's way overdue that we send these firmware
> > > blobs upstream. Thanks for everybody involved
> > > in getting this sorted out.
> > > 
> > > Cc: Luciano Coelho <luca@coelho.fi>
> > > Cc: Pavel Machek <pavel@denx.de>
> > > Signed-off-by: Felipe Balbi <balbi@ti.com>
> > > ---
> > 
> > The commit message could be a bit more descriptive rather than
> > narrative?
> > 
> > 
> > >  ti-connectivity/license-wl1251.txt |  59 +++++++++++++++++++++++++++++++++++++
> > 
> > The license file should be in the root, together with the other licenses
> > and called LICENCE.wl1251 (note the en-GB spelling).  Also, this license
> > is *very* similar to the one for WiLink6/7/8 (LICENCE.ti-connectivity),
> > except for some very minor things and the formatting.  Couldn't the same
> > one be used, for the sake of simplicity and consistency?
> > 
> > 
> > >  ti-connectivity/wl1251-fw.bin      | Bin 0 -> 194180 bytes
> > >  ti-connectivity/wl1251-nvs.bin     | Bin 0 -> 752 bytes
> > >  3 files changed, 59 insertions(+)
> > >  create mode 100644 ti-connectivity/license-wl1251.txt
> > >  create mode 100644 ti-connectivity/wl1251-fw.bin
> > >  create mode 100644 ti-connectivity/wl1251-nvs.bin
> > 
> > When sending big binary blobs, it's generally better to send pull
> > requests instead of patches.  If you add the -p option when calling git
> > pull-request, the text will include all the readable parts but will omit
> > the binary stuff.
> > 
> > Thank you very much for following up on this!
> 
> Ah, and I forgot to say that you should update the WHENCE file
> accordingly too.  Check the wl12xx and wl18xx drivers for examples.

I'll send a pull request, but how about this ? I don't think we can
change the license. It seems like the other firmwares are using the
older license, I'd argue those should be changed to the new one, but
that's another discussion.

commit 453b2a32470b2e50c5c96bc7ac4a39a3f6b6b30d
Author: Felipe Balbi <balbi@ti.com>
Date:   Tue Sep 24 09:29:34 2013 -0500

    ti-connectivity: add wl1251 firmware and license
    
    This new firmware blob is used with the old wl1251
    device whose driver has been in the kernel for quite
    some time.
    
    Cc: Luciano Coelho <luca@coelho.fi>
    Cc: Pavel Machek <pavel@denx.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>

diff --git a/LICENCE.wl1251 b/LICENCE.wl1251
new file mode 100644
index 0000000..bd0f5f1
--- /dev/null
+++ b/LICENCE.wl1251
@@ -0,0 +1,59 @@
+Copyright (c) 2000 – 2013 Texas Instruments Incorporated
+
+All rights reserved not granted herein.
+
+Limited License.
+
+Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive
+license under copyrights and patents it now or hereafter owns or controls to
+make, have made, use, import, offer to sell and sell ("Utilize") this software
+subject to the terms herein.  With respect to the foregoing patent license,
+such license is granted  solely to the extent that any such patent is necessary
+to Utilize the software alone.  The patent license shall not apply to any
+combinations which include this software, other than combinations with devices
+manufactured by or for TI (“TI Devices”).  No hardware patent is licensed
+hereunder.
+
+Redistributions must preserve existing copyright notices and reproduce this
+license (including the above copyright notice and the disclaimer and (if
+applicable) source code license limitations below) in the documentation and/or
+other materials provided with the distribution
+
+Redistribution and use in binary form, without modification, are permitted
+provided that the following conditions are met:
+
+*	No reverse engineering, decompilation, or disassembly of this software
+	is permitted with respect to any software provided in binary form.
+
+*	any redistribution and use are licensed by TI for use only with TI
+	Devices.
+
+*	Nothing shall obligate TI to provide you with source code for the
+	software licensed and provided to you in object code.
+
+If software source code is provided to you, modification and redistribution of
+the source code are permitted provided that the following conditions are met:
+
+*	any redistribution and use of the source code, including any resulting
+	derivative works, are licensed by TI for use only with TI Devices.
+
+*	any redistribution and use of any object code compiled from the source
+	code and any resulting derivative works, are licensed by TI for use
+	only with TI Devices.
+
+Neither the name of Texas Instruments Incorporated nor the names of its
+suppliers may be used to endorse or promote products derived from this software
+without specific prior written permission.
+
+DISCLAIMER.
+
+THIS SOFTWARE IS PROVIDED BY TI AND TI’S LICENSORS "AS IS" AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+EVENT SHALL TI AND TI’S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/WHENCE b/WHENCE
index e66fea5..4e9e2ed 100644
--- a/WHENCE
+++ b/WHENCE
@@ -1705,6 +1705,19 @@ Licence: Redistributable. See LICENCE.tda7706-firmware.txt for details.
 
 --------------------------------------------------------------------------
 
+Driver: wl1251 - Texas Instruments 802.11 WLAN driver for WiLink4 chips
+
+File: ti-connectivity/wl1251-fw.bin
+File: ti-connectivity/wl1251-nvs.bin
+
+Licence: See LICENCE.wl1251 for details.
+
+The driver expects to find the firmwares under a ti-connectivity subdirectory.
+So if your system looks for firmwares in /lib/firmware, the firmwares for
+wl12xx chips must be located in /lib/firmware/ti-connectivity/.
+
+--------------------------------------------------------------------------
+
 Driver: wl12xx - Texas Instruments 802.11 WLAN driver for WiLink6/7 chips
 
 File: ti-connectivity/wl1271-fw.bin
diff --git a/ti-connectivity/wl1251-fw.bin b/ti-connectivity/wl1251-fw.bin
new file mode 100644
index 0000000..f89c983
Binary files /dev/null and b/ti-connectivity/wl1251-fw.bin differ
diff --git a/ti-connectivity/wl1251-nvs.bin b/ti-connectivity/wl1251-nvs.bin
new file mode 100644
index 0000000..2bf9c50
Binary files /dev/null and b/ti-connectivity/wl1251-nvs.bin differ

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply related

* Re: [PATCH] ti-connectivity: add wl1251 firmware and license
From: Felipe Balbi @ 2013-09-25 12:54 UTC (permalink / raw)
  To: Luca Coelho
  Cc: Felipe Balbi, ben, Linux Kernel Mailing List, linux-wireless,
	Pavel Machek
In-Reply-To: <1380107096.4503.8.camel@porter.coelho.fi>

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

Hi,

On Wed, Sep 25, 2013 at 02:04:56PM +0300, Luca Coelho wrote:
> Hi dude,
> 
> Great, this is cool! Finally! :)
> 
> A few comments...
> 
> 
> On Tue, 2013-09-24 at 09:44 -0500, Felipe Balbi wrote:
> > It's way overdue that we send these firmware
> > blobs upstream. Thanks for everybody involved
> > in getting this sorted out.
> > 
> > Cc: Luciano Coelho <luca@coelho.fi>
> > Cc: Pavel Machek <pavel@denx.de>
> > Signed-off-by: Felipe Balbi <balbi@ti.com>
> > ---
> 
> The commit message could be a bit more descriptive rather than
> narrative?

sure, why not.

> >  ti-connectivity/license-wl1251.txt |  59 +++++++++++++++++++++++++++++++++++++
> 
> The license file should be in the root, together with the other licenses
> and called LICENCE.wl1251 (note the en-GB spelling).  Also, this license
> is *very* similar to the one for WiLink6/7/8 (LICENCE.ti-connectivity),
> except for some very minor things and the formatting.  Couldn't the same
> one be used, for the sake of simplicity and consistency?

let me check.

> >  ti-connectivity/wl1251-fw.bin      | Bin 0 -> 194180 bytes
> >  ti-connectivity/wl1251-nvs.bin     | Bin 0 -> 752 bytes
> >  3 files changed, 59 insertions(+)
> >  create mode 100644 ti-connectivity/license-wl1251.txt
> >  create mode 100644 ti-connectivity/wl1251-fw.bin
> >  create mode 100644 ti-connectivity/wl1251-nvs.bin
> 
> When sending big binary blobs, it's generally better to send pull
> requests instead of patches.  If you add the -p option when calling git
> pull-request, the text will include all the readable parts but will omit
> the binary stuff.

will do

> Thank you very much for following up on this!

np.

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* Re: No connection with TP-Link TL-WN823N (rtl8192cu)
From: Dan Williams @ 2013-09-25 12:47 UTC (permalink / raw)
  To: Larry Finger; +Cc: linux-wireless
In-Reply-To: <524215AD.6060300@lwfinger.net>

On Tue, 2013-09-24 at 17:43 -0500, Larry Finger wrote:
> On 09/09/2013 05:15 PM, Dan Williams wrote:
> > On Mon, 2013-09-09 at 16:52 -0500, Larry Finger wrote:
> 
> >> I have been running rtl8192cu for the past 24 hours without a permanent
> >> disconnect. Under NetworkManager, I see some reason 7 deauthentications, but
> >
> > Running wpa_supplicant with debugging on might shed some light on these;
> > basically:
> >
> > mv /usr/sbin/wpa_supplicant /
> > killall -TERM wpa_supplicant
> > /wpa_supplicant -dddtu <piped to your favorite log file>
> >
> > and NM should automatically reconnect, and then we can figure out what's
> > going on in the supplicant.
> 
> Dan,
> 
> The log of wpa_supplicant associated with the reason 7 disconnects are as follows:

So reason 7 is "Incorrect frame type or subtype received from
unassociated station" which seems like the AP thinks we got
disconnected, and would seem to be a driver/mac80211 issue still, right?

> 1380060983.255499: RTM_NEWLINK: operstate=1 ifi_flags=0x1003 ([UP])
> 1380060983.255516: RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan3' added
> 1380060983.255588: nl80211: if_removed already cleared - ignore event
> 1380060983.255600: Ignore event for foreign ifindex 22
> 1380060983.272257: nl80211: Event message available
> 1380060983.272307: nl80211: Delete station 20:e5:2a:01:f7:ea
> 1380060983.280211: nl80211: Event message available
> 1380060983.280228: nl80211: MLME event 39
> 1380060983.280230: nl80211: MLME event frame - hexdump(len=26): c0 00 3a 01 1c 
> 65 9d 5a c3 9d 20 e5 2a 01 f7 ea 20 e5 2a 01 f7 ea 30 d2 07 00
> 1380060983.280248: wlan3: Event DEAUTH (12) received
> 1380060983.280252: wlan3: Deauthentication notification
> 1380060983.280255: wlan3:  * reason 7
> 1380060983.280258: wlan3:  * address 20:e5:2a:01:f7:ea
> 1380060983.280260: Deauthentication frame IE(s) - hexdump(len=0): [NULL]
> 1380060983.280264: wlan3: WPA: Auto connect enabled: try to reconnect (wps=0)
> 1380060983.280267: wlan3: Setting scan request: 0 sec 100000 usec
> 1380060983.280271: Added BSSID 20:e5:2a:01:f7:ea into blacklist
> 1380060983.280276: wlan3: Not rescheduling scan to ensure that specific SSID 
> scans occur
> 1380060983.280281: wlan3: CTRL-EVENT-DISCONNECTED bssid=20:e5:2a:01:f7:ea reason=7
> 1380060983.280283: wlan3: Disconnect event - remove keys

Ok, got disconnected with reason 7...

> 1380060984.471985: WPA: Group Key - hexdump(len=16): [REMOVED]
> 1380060984.471989: wlan3: WPA: Installing GTK to the driver (keyidx=1 tx=0 len=16)
> 1380060984.471991: WPA: RSC - hexdump(len=6): 61 44 1a 00 00 00
> 1380060984.472044: wpa_driver_nl80211_set_key: ifindex=22 alg=3 addr=0x492909 
> key_idx=1 set_tx=0 seq_len=6 key_len=16
> 1380060984.472051:    broadcast key
> 1380060984.473171: wlan3: WPA: Key negotiation completed with 20:e5:2a:01:f7:ea 
> [PTK=CCMP GTK=CCMP]
> 1380060984.473174: wlan3: Cancelling authentication timeout
> 1380060984.473178: wlan3: State: GROUP_HANDSHAKE -> COMPLETED
> 1380060984.473183: wlan3: CTRL-EVENT-CONNECTED - Connection to 20:e5:2a:01:f7:ea 
> completed (reauth) [id=0 id_str=]

And got reconnected after a bit more than one second.  So at least it
recovers quickly, but the question is more about why the reason 7
happened, and what frames caused it, I think.

Dan


^ permalink raw reply

* Re: [PATCH] ti-connectivity: add wl1251 firmware and license
From: Luca Coelho @ 2013-09-25 11:07 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: ben, Linux Kernel Mailing List, linux-wireless, Pavel Machek
In-Reply-To: <1380107096.4503.8.camel@porter.coelho.fi>

On Wed, 2013-09-25 at 14:04 +0300, Luca Coelho wrote:
> Hi dude,
> 
> Great, this is cool! Finally! :)
> 
> A few comments...
> 
> 
> On Tue, 2013-09-24 at 09:44 -0500, Felipe Balbi wrote:
> > It's way overdue that we send these firmware
> > blobs upstream. Thanks for everybody involved
> > in getting this sorted out.
> > 
> > Cc: Luciano Coelho <luca@coelho.fi>
> > Cc: Pavel Machek <pavel@denx.de>
> > Signed-off-by: Felipe Balbi <balbi@ti.com>
> > ---
> 
> The commit message could be a bit more descriptive rather than
> narrative?
> 
> 
> >  ti-connectivity/license-wl1251.txt |  59 +++++++++++++++++++++++++++++++++++++
> 
> The license file should be in the root, together with the other licenses
> and called LICENCE.wl1251 (note the en-GB spelling).  Also, this license
> is *very* similar to the one for WiLink6/7/8 (LICENCE.ti-connectivity),
> except for some very minor things and the formatting.  Couldn't the same
> one be used, for the sake of simplicity and consistency?
> 
> 
> >  ti-connectivity/wl1251-fw.bin      | Bin 0 -> 194180 bytes
> >  ti-connectivity/wl1251-nvs.bin     | Bin 0 -> 752 bytes
> >  3 files changed, 59 insertions(+)
> >  create mode 100644 ti-connectivity/license-wl1251.txt
> >  create mode 100644 ti-connectivity/wl1251-fw.bin
> >  create mode 100644 ti-connectivity/wl1251-nvs.bin
> 
> When sending big binary blobs, it's generally better to send pull
> requests instead of patches.  If you add the -p option when calling git
> pull-request, the text will include all the readable parts but will omit
> the binary stuff.
> 
> Thank you very much for following up on this!

Ah, and I forgot to say that you should update the WHENCE file
accordingly too.  Check the wl12xx and wl18xx drivers for examples.

--
Luca.


^ permalink raw reply

* [PATCH 1/7] brcmfmac: sync firmware event list
From: Arend van Spriel @ 2013-09-25 11:05 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless, Franky Lin, Arend van Spriel
In-Reply-To: <1380107146-24026-1-git-send-email-arend@broadcom.com>

From: Franky Lin <frankyl@broadcom.com>

Update event list to keep sync with firmware development. Use calculated event
mask length instead of hard-coded value.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
 drivers/net/wireless/brcm80211/brcmfmac/dhd.h  |    2 --
 drivers/net/wireless/brcm80211/brcmfmac/fweh.h |    5 ++++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd.h b/drivers/net/wireless/brcm80211/brcmfmac/dhd.h
index 2eb9e64..4de9aac 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd.h
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd.h
@@ -97,8 +97,6 @@
 #define	WLC_PHY_TYPE_LCN	8
 #define	WLC_PHY_TYPE_NULL	0xf
 
-#define BRCMF_EVENTING_MASK_LEN	16
-
 #define TOE_TX_CSUM_OL		0x00000001
 #define TOE_RX_CSUM_OL		0x00000002
 
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fweh.h b/drivers/net/wireless/brcm80211/brcmfmac/fweh.h
index e679214..9ee5c51 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/fweh.h
+++ b/drivers/net/wireless/brcm80211/brcmfmac/fweh.h
@@ -102,7 +102,8 @@ struct brcmf_event;
 	BRCMF_ENUM_DEF(DCS_REQUEST, 73) \
 	BRCMF_ENUM_DEF(FIFO_CREDIT_MAP, 74) \
 	BRCMF_ENUM_DEF(ACTION_FRAME_RX, 75) \
-	BRCMF_ENUM_DEF(BCMC_CREDIT_SUPPORT, 127)
+	BRCMF_ENUM_DEF(BCMC_CREDIT_SUPPORT, 127) \
+	BRCMF_ENUM_DEF(PSTA_PRIMARY_INTF_IND, 128)
 
 #define BRCMF_ENUM_DEF(id, val) \
 	BRCMF_E_##id = (val),
@@ -114,6 +115,8 @@ enum brcmf_fweh_event_code {
 };
 #undef BRCMF_ENUM_DEF
 
+#define BRCMF_EVENTING_MASK_LEN		(roundup(BRCMF_E_LAST, 8)/8)
+
 /* flags field values in struct brcmf_event_msg */
 #define BRCMF_EVENT_MSG_LINK		0x01
 #define BRCMF_EVENT_MSG_FLUSHTXQ	0x02
-- 
1.7.10.4



^ permalink raw reply related

* [PATCH 5/7] brcmfmac: fix sparse error 'bad constant expression'
From: Arend van Spriel @ 2013-09-25 11:05 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless, Arend van Spriel
In-Reply-To: <1380107146-24026-1-git-send-email-arend@broadcom.com>

The definition of BRCMF_EVENTING_MASK_LEN results in a sparse
error message

.../fweh.c:331:22: error: bad constant expression
.../fweh.c:388:22: error: bad constant expression
.../dhd_common.c:256:22: error: bad constant expression

This is caused by the use of roundup() in BRCMF_EVENTING_MASK_LEN
and it is used to allocate an array variable on the stack. Better
use DIV_ROUND_UP() macro.

Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
 drivers/net/wireless/brcm80211/brcmfmac/fweh.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fweh.h b/drivers/net/wireless/brcm80211/brcmfmac/fweh.h
index 9ee5c51..14bc24d 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/fweh.h
+++ b/drivers/net/wireless/brcm80211/brcmfmac/fweh.h
@@ -115,7 +115,7 @@ enum brcmf_fweh_event_code {
 };
 #undef BRCMF_ENUM_DEF
 
-#define BRCMF_EVENTING_MASK_LEN		(roundup(BRCMF_E_LAST, 8)/8)
+#define BRCMF_EVENTING_MASK_LEN		DIV_ROUND_UP(BRCMF_E_LAST, 8)
 
 /* flags field values in struct brcmf_event_msg */
 #define BRCMF_EVENT_MSG_LINK		0x01
-- 
1.7.10.4



^ 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