Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH 3.11 v3] genetlink: fix family dump race
From: Johannes Berg @ 2013-08-13  7:04 UTC (permalink / raw)
  To: netdev; +Cc: linux-wireless, Johannes Berg

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

When dumping generic netlink families, only the first dump call
is locked with genl_lock(), which protects the list of families,
and thus subsequent calls can access the data without locking,
racing against family addition/removal. This can cause a crash.
Fix it - the locking needs to be conditional because the first
time around it's already locked.

A similar bug was reported to me on an old kernel (3.4.47) but
the exact scenario that happened there is no longer possible,
on those kernels the first round wasn't locked either. Looking
at the current code I found the race described above, which had
also existed on the old kernel.

Cc: stable@vger.kernel.org
Reported-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/netlink/genetlink.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index 2fd6dbe..6b6a03a 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -789,6 +789,10 @@ static int ctrl_dumpfamily(struct sk_buff *skb, struct netlink_callback *cb)
 	struct net *net = sock_net(skb->sk);
 	int chains_to_skip = cb->args[0];
 	int fams_to_skip = cb->args[1];
+	bool need_locking = chains_to_skip || fams_to_skip;
+
+	if (need_locking)
+		genl_lock();
 
 	for (i = chains_to_skip; i < GENL_FAM_TAB_SIZE; i++) {
 		n = 0;
@@ -810,6 +814,9 @@ errout:
 	cb->args[0] = i;
 	cb->args[1] = n;
 
+	if (need_locking)
+		genl_unlock();
+
 	return skb->len;
 }
 
-- 
1.8.0


^ permalink raw reply related

* [PATCH 3.11] cfg80211: don't request disconnect if not connected
From: Johannes Berg @ 2013-08-13  7:29 UTC (permalink / raw)
  To: linux-wireless; +Cc: neilb, Johannes Berg

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

Neil Brown reports that with libertas, my recent cfg80211
SME changes in commit ceca7b7121795ef81bd598a240d53a92566
("cfg80211: separate internal SME implementation") broke
libertas suspend because it we now asked it to disconnect
while already disconnected.

The problematic change is in cfg80211_disconnect() as it
previously checked the SME state and now calls the driver
disconnect operation unconditionally.

Fix this by checking if there's a current_bss indicating
a connection, and do nothing if not.

Reported-and-tested-by: Neil Brown <neilb@suse.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/wireless/sme.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index 81c8a10..20e86a9 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -976,21 +976,19 @@ int cfg80211_disconnect(struct cfg80211_registered_device *rdev,
 			struct net_device *dev, u16 reason, bool wextev)
 {
 	struct wireless_dev *wdev = dev->ieee80211_ptr;
-	int err;
+	int err = 0;
 
 	ASSERT_WDEV_LOCK(wdev);
 
 	kfree(wdev->connect_keys);
 	wdev->connect_keys = NULL;
 
-	if (wdev->conn) {
+	if (wdev->conn)
 		err = cfg80211_sme_disconnect(wdev, reason);
-	} else if (!rdev->ops->disconnect) {
+	else if (!rdev->ops->disconnect)
 		cfg80211_mlme_down(rdev, dev);
-		err = 0;
-	} else {
+	else if (wdev->current_bss)
 		err = rdev_disconnect(rdev, dev, reason);
-	}
 
 	return err;
 }
-- 
1.8.0


^ permalink raw reply related

* Re: 80211s with DFS
From: Volker von Hoesslin @ SKBX Systems @ 2013-08-13  9:21 UTC (permalink / raw)
  To: Wright, Brett; +Cc: linux-wireless
In-Reply-To: <475A4E02EFF4724A9E58F55A56AC131608CDEF2D@APEVS1.ap.ci.root>


> The real difficulty with DFS and 802.11s is what happens when a radar is
> detected? All mesh nodes need to be on the same channel, so there needs
> to be some consistent way of propagating a channel switch announcement
> to all wireless nodes.
>

indeed, thats a hard question. my first hint is looking at cisco 
(http://www.cisco.com/en/US/docs/wireless/technology/mesh/7.0/design/guide/MeshAP_70.pdf 
-> page 169), but 80211s has't a RAP so maybe there are only some tips 
for a workflow.

i think there are diffrent possibilities:

1. the MAP that has a radar detection go sleep and wait till the channel 
is clear to come back -> mesh will down :/
2. the mesh has to negotiate a new free channel via bacon-frames, maybe 
generating preventively a list of  channel for switching?
3. some other ideas ?

is there someone at work for a DFS implementation?

volker...

^ permalink raw reply

* Re: [RFC 01/15] ath9k: Add MAX_AMSDU to supported HT capabilities
From: Felix Fietkau @ 2013-08-13  9:44 UTC (permalink / raw)
  To: Sujith Manoharan; +Cc: John Linville, linux-wireless
In-Reply-To: <1376300502-2741-2-git-send-email-sujith@msujith.org>

On 2013-08-12 11:41 AM, Sujith Manoharan wrote:
> From: Sujith Manoharan <c_manoha@qca.qualcomm.com>
> 
> Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
I think processing of fragmented rx in ath9k needs to change before we
can enable this. At the moment the driver only supports assembling a
frame from two fragments, which isn't enough to receive large A-MSDU
packets.

- Felix


^ permalink raw reply

* [PATCH] ath10k: fix WEP in AP and IBSS mode
From: Marek Puzyniak @ 2013-08-13  9:45 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, Marek Puzyniak

WEP encoding was not working properly for AP and IBSS mode.
TX frames were encrypted with default WEP tx key index set
always to zero, what sometimes was wrong when different
key index should be used. This patch allows to update
WEP key index also for AP and IBSS mode.
Problem detected during automated WEP tests.

Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
---
 drivers/net/wireless/ath/ath10k/mac.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index cf2ba4d..bcefeb6 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -1421,10 +1421,6 @@ static void ath10k_tx_h_update_wep_key(struct sk_buff *skb)
 	struct ieee80211_key_conf *key = info->control.hw_key;
 	int ret;
 
-	/* TODO AP mode should be implemented */
-	if (vif->type != NL80211_IFTYPE_STATION)
-		return;
-
 	if (!ieee80211_has_protected(hdr->frame_control))
 		return;
 
-- 
1.8.1.2


^ permalink raw reply related

* Re: [RFC 01/15] ath9k: Add MAX_AMSDU to supported HT capabilities
From: Sujith Manoharan @ 2013-08-13 10:14 UTC (permalink / raw)
  To: Felix Fietkau; +Cc: John Linville, linux-wireless
In-Reply-To: <5209FFED.1040901@openwrt.org>

Felix Fietkau wrote:
> I think processing of fragmented rx in ath9k needs to change before we
> can enable this. At the moment the driver only supports assembling a
> frame from two fragments, which isn't enough to receive large A-MSDU
> packets.

You are right, I'll drop this patch.

Sujith

^ permalink raw reply

* Re: [PATCH v2 2/4] ath10k: fix HTC endpoint worker starvation
From: Michal Kazior @ 2013-08-13 10:22 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, Michal Kazior
In-Reply-To: <1376373578-2180-3-git-send-email-michal.kazior@tieto.com>

On 13 August 2013 07:59, Michal Kazior <michal.kazior@tieto.com> wrote:
> HTC used a worker for each endpoint. This worked
> until a slow host machine was flooded with massive
> number of TX requests. HTT related worker would
> remain active while WMI worker was starved. This
> ended up with "could not send beacon" in AP mode.
> It was even possible to see userspace being
> starved.
>
> The patch switches from using workers to using
> tasklets for processing and submitting HTC frames
> to HIF.
>
> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>

I'd like drop this patch, at least for now. I'm having doubts this is
the right way to solve the problem.


Pozdrawiam / Best regards,
Michał Kazior.

^ permalink raw reply

* [PATCH 5/5] ath9k: reset buffer stale flag in ath_tx_get_tid_subframe
From: Felix Fietkau @ 2013-08-13 10:33 UTC (permalink / raw)
  To: linux-wireless; +Cc: linville
In-Reply-To: <1376390010-81819-1-git-send-email-nbd@openwrt.org>

If that flag stays set for a buffer that already ran through the tx path
once, it might cause issues in tx completion processing. Better clear it
early to ensure that this does not happen

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
 drivers/net/wireless/ath/ath9k/xmit.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index cb06c1c..7223e30 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -888,6 +888,8 @@ ath_tx_get_tid_subframe(struct ath_softc *sc, struct ath_txq *txq,
 		bf = fi->bf;
 		if (!fi->bf)
 			bf = ath_tx_setup_buffer(sc, txq, tid, skb);
+		else
+			bf->bf_state.stale = false;
 
 		if (!bf) {
 			__skb_unlink(skb, *q);
-- 
1.8.0.2


^ permalink raw reply related

* [PATCH 4/5] ath9k: simplify ath_tid_drain
From: Felix Fietkau @ 2013-08-13 10:33 UTC (permalink / raw)
  To: linux-wireless; +Cc: linville
In-Reply-To: <1376390010-81819-1-git-send-email-nbd@openwrt.org>

ath_tid_drain is only called when a station entry is being removed, so
there is no point in still tracking BAW state. Remove some unnecessary
code and a bogus TODO comment related to this.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
 drivers/net/wireless/ath/ath9k/xmit.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 4fc80e3..cb06c1c 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -312,12 +312,6 @@ static void ath_tx_addto_baw(struct ath_softc *sc, struct ath_atx_tid *tid,
 	}
 }
 
-/*
- * TODO: For frame(s) that are in the retry state, we will reuse the
- * sequence number(s) without setting the retry bit. The
- * alternative is to give up on these and BAR the receiver's window
- * forward.
- */
 static void ath_tid_drain(struct ath_softc *sc, struct ath_txq *txq,
 			  struct ath_atx_tid *tid)
 
@@ -341,14 +335,8 @@ static void ath_tid_drain(struct ath_softc *sc, struct ath_txq *txq,
 		}
 
 		list_add_tail(&bf->list, &bf_head);
-
-		ath_tx_update_baw(sc, tid, bf->bf_state.seqno);
 		ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0);
 	}
-
-	tid->seq_next = tid->seq_start;
-	tid->baw_tail = tid->baw_head;
-	tid->bar_index = -1;
 }
 
 static void ath_tx_set_retry(struct ath_softc *sc, struct ath_txq *txq,
-- 
1.8.0.2


^ permalink raw reply related

* [PATCH 2/5] ath9k: simplify debugfs chainmask handling
From: Felix Fietkau @ 2013-08-13 10:33 UTC (permalink / raw)
  To: linux-wireless; +Cc: linville
In-Reply-To: <1376390010-81819-1-git-send-email-nbd@openwrt.org>

Writing to that file is unnecessary and quirky, the antenna API should
be used instead. Use debugfs_create_u8 to allow reading the values.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
 drivers/net/wireless/ath/ath9k/debug.c | 92 ++--------------------------------
 1 file changed, 4 insertions(+), 88 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index e5c8333..c088744 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -88,90 +88,6 @@ static const struct file_operations fops_debug = {
 
 #define DMA_BUF_LEN 1024
 
-static ssize_t read_file_tx_chainmask(struct file *file, char __user *user_buf,
-			     size_t count, loff_t *ppos)
-{
-	struct ath_softc *sc = file->private_data;
-	struct ath_hw *ah = sc->sc_ah;
-	char buf[32];
-	unsigned int len;
-
-	len = sprintf(buf, "0x%08x\n", ah->txchainmask);
-	return simple_read_from_buffer(user_buf, count, ppos, buf, len);
-}
-
-static ssize_t write_file_tx_chainmask(struct file *file, const char __user *user_buf,
-			     size_t count, loff_t *ppos)
-{
-	struct ath_softc *sc = file->private_data;
-	struct ath_hw *ah = sc->sc_ah;
-	unsigned long mask;
-	char buf[32];
-	ssize_t len;
-
-	len = min(count, sizeof(buf) - 1);
-	if (copy_from_user(buf, user_buf, len))
-		return -EFAULT;
-
-	buf[len] = '\0';
-	if (kstrtoul(buf, 0, &mask))
-		return -EINVAL;
-
-	ah->txchainmask = mask;
-	ah->caps.tx_chainmask = mask;
-	return count;
-}
-
-static const struct file_operations fops_tx_chainmask = {
-	.read = read_file_tx_chainmask,
-	.write = write_file_tx_chainmask,
-	.open = simple_open,
-	.owner = THIS_MODULE,
-	.llseek = default_llseek,
-};
-
-
-static ssize_t read_file_rx_chainmask(struct file *file, char __user *user_buf,
-			     size_t count, loff_t *ppos)
-{
-	struct ath_softc *sc = file->private_data;
-	struct ath_hw *ah = sc->sc_ah;
-	char buf[32];
-	unsigned int len;
-
-	len = sprintf(buf, "0x%08x\n", ah->rxchainmask);
-	return simple_read_from_buffer(user_buf, count, ppos, buf, len);
-}
-
-static ssize_t write_file_rx_chainmask(struct file *file, const char __user *user_buf,
-			     size_t count, loff_t *ppos)
-{
-	struct ath_softc *sc = file->private_data;
-	struct ath_hw *ah = sc->sc_ah;
-	unsigned long mask;
-	char buf[32];
-	ssize_t len;
-
-	len = min(count, sizeof(buf) - 1);
-	if (copy_from_user(buf, user_buf, len))
-		return -EFAULT;
-
-	buf[len] = '\0';
-	if (kstrtoul(buf, 0, &mask))
-		return -EINVAL;
-
-	ah->rxchainmask = mask;
-	ah->caps.rx_chainmask = mask;
-	return count;
-}
-
-static const struct file_operations fops_rx_chainmask = {
-	.read = read_file_rx_chainmask,
-	.write = write_file_rx_chainmask,
-	.open = simple_open,
-	.owner = THIS_MODULE,
-	.llseek = default_llseek,
-};
 
 static ssize_t read_file_ani(struct file *file, char __user *user_buf,
 			     size_t count, loff_t *ppos)
@@ -1896,10 +1812,10 @@ int ath9k_init_debug(struct ath_hw *ah)
 			    &fops_reset);
 	debugfs_create_file("recv", S_IRUSR, sc->debug.debugfs_phy, sc,
 			    &fops_recv);
-	debugfs_create_file("rx_chainmask", S_IRUSR | S_IWUSR,
-			    sc->debug.debugfs_phy, sc, &fops_rx_chainmask);
-	debugfs_create_file("tx_chainmask", S_IRUSR | S_IWUSR,
-			    sc->debug.debugfs_phy, sc, &fops_tx_chainmask);
+	debugfs_create_u8("rx_chainmask", S_IRUSR, sc->debug.debugfs_phy,
+			  &ah->rxchainmask);
+	debugfs_create_u8("tx_chainmask", S_IRUSR, sc->debug.debugfs_phy,
+			  &ah->txchainmask);
 	debugfs_create_file("ani", S_IRUSR | S_IWUSR,
 			    sc->debug.debugfs_phy, sc, &fops_ani);
 	debugfs_create_bool("paprd", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
-- 
1.8.0.2


^ permalink raw reply related

* [PATCH 1/5] ath9k: remove ath9k_sta_remove_debugfs
From: Felix Fietkau @ 2013-08-13 10:33 UTC (permalink / raw)
  To: linux-wireless; +Cc: linville

mac80211 uses debugfs_remove_recursive, so there's no need for the
driver to do an explicit cleanup of its sta debugfs entry.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
 drivers/net/wireless/ath/ath9k/ath9k.h |  4 ----
 drivers/net/wireless/ath/ath9k/debug.c | 12 +-----------
 drivers/net/wireless/ath/ath9k/debug.h |  4 ----
 drivers/net/wireless/ath/ath9k/main.c  |  1 -
 4 files changed, 1 insertion(+), 20 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 7b1d036..df1c495 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -262,10 +262,6 @@ struct ath_node {
 
 	bool sleeping;
 	bool no_ps_filter;
-
-#if defined(CONFIG_MAC80211_DEBUGFS) && defined(CONFIG_ATH9K_DEBUGFS)
-	struct dentry *node_stat;
-#endif
 };
 
 struct ath_tx_control {
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index c10cec5..e5c8333 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -1725,17 +1725,7 @@ void ath9k_sta_add_debugfs(struct ieee80211_hw *hw,
 			   struct dentry *dir)
 {
 	struct ath_node *an = (struct ath_node *)sta->drv_priv;
-	an->node_stat = debugfs_create_file("node_stat", S_IRUGO,
-					    dir, an, &fops_node_stat);
-}
-
-void ath9k_sta_remove_debugfs(struct ieee80211_hw *hw,
-			      struct ieee80211_vif *vif,
-			      struct ieee80211_sta *sta,
-			      struct dentry *dir)
-{
-	struct ath_node *an = (struct ath_node *)sta->drv_priv;
-	debugfs_remove(an->node_stat);
+	debugfs_create_file("node_stat", S_IRUGO, dir, an, &fops_node_stat);
 }
 
 /* Ethtool support for get-stats */
diff --git a/drivers/net/wireless/ath/ath9k/debug.h b/drivers/net/wireless/ath/ath9k/debug.h
index 01c5c6a..6e1556f 100644
--- a/drivers/net/wireless/ath/ath9k/debug.h
+++ b/drivers/net/wireless/ath/ath9k/debug.h
@@ -292,10 +292,6 @@ void ath9k_sta_add_debugfs(struct ieee80211_hw *hw,
 			   struct ieee80211_vif *vif,
 			   struct ieee80211_sta *sta,
 			   struct dentry *dir);
-void ath9k_sta_remove_debugfs(struct ieee80211_hw *hw,
-			      struct ieee80211_vif *vif,
-			      struct ieee80211_sta *sta,
-			      struct dentry *dir);
 void ath_debug_send_fft_sample(struct ath_softc *sc,
 			       struct fft_sample_tlv *fft_sample);
 void ath9k_debug_stat_ant(struct ath_softc *sc,
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 911744f..0bee105 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -2364,7 +2364,6 @@ struct ieee80211_ops ath9k_ops = {
 
 #if defined(CONFIG_MAC80211_DEBUGFS) && defined(CONFIG_ATH9K_DEBUGFS)
 	.sta_add_debugfs    = ath9k_sta_add_debugfs,
-	.sta_remove_debugfs = ath9k_sta_remove_debugfs,
 #endif
 	.sw_scan_start	    = ath9k_sw_scan_start,
 	.sw_scan_complete   = ath9k_sw_scan_complete,
-- 
1.8.0.2


^ permalink raw reply related

* [PATCH 3/5] ath9k: avoid accessing MRC registers on single-chain devices
From: Felix Fietkau @ 2013-08-13 10:33 UTC (permalink / raw)
  To: linux-wireless; +Cc: linville
In-Reply-To: <1376390010-81819-1-git-send-email-nbd@openwrt.org>

They are not implemented, and accessing them might trigger errors

Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
 drivers/net/wireless/ath/ath9k/ar9003_phy.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
index 39c3730..18a5aa4 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
@@ -1172,6 +1172,10 @@ skip_ws_det:
 		 * is_on == 0 means MRC CCK is OFF (more noise imm)
 		 */
 		bool is_on = param ? 1 : 0;
+
+		if (ah->caps.rx_chainmask == 1)
+			break;
+
 		REG_RMW_FIELD(ah, AR_PHY_MRC_CCK_CTRL,
 			      AR_PHY_MRC_CCK_ENABLE, is_on);
 		REG_RMW_FIELD(ah, AR_PHY_MRC_CCK_CTRL,
-- 
1.8.0.2


^ permalink raw reply related

* Re: [wireless-regdb] [PATCH 00/53] wireless-regdb: latest updates
From: Bjørn Mork @ 2013-08-13 11:13 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: linville, linux-wireless, wireless-regdb
In-Reply-To: <1374027522-18488-1-git-send-email-mcgrof@do-not-panic.com>

"Luis R. Rodriguez" <mcgrof@do-not-panic.com> writes:

> From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
>
> I saw one comment posted about the Indonesia patch, I fixed that.
> I also then ran some sanity tests with a new reglib addition
> wich I recently posted. This helped find two cases which
> required disabling VHT80 for two countries on a specific band.
> One was for US for 5690 and another for TW for 5290. In both cases
> the reason is due to the fact that the only way to use VHT80 is
> to combine two frequency ranges together that are contiguous and
> apply the most restrictive band rules for that range. We don't support
> this yet so just disable VHT80 in both cases. In the US case this
> also seems to be the preferred ruling.

Hello,

Out of personal interest I'm wondering why you excluded Norway and
Iceland from this series?  As EEA [1] members they pretty much follow
all relevant EU regulations, like for example the R&TTE directive.  And
the CEPT documents should also be pretty clear wrt VHT80 support.


[1] http://en.wikipedia.org/wiki/European_Economic_Area



Bjørn

^ permalink raw reply

* [PATCH] mac80211: implement STA CSA for drivers using channel contexts
From: Arik Nemtsov @ 2013-08-13 12:03 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg, Arik Nemtsov

Limit the current implementation to a single channel context used by
a single vif, thereby avoiding multi-vif/channel complexities.

Reuse the main function from AP CSA code, but move a portion out in
order to fit the STA scenario.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
---
This isn't very well tested yet, but seems to work with a TI wl18xx card.
The single-role/single-channel support is enough to pass the 11h certification.

 net/mac80211/cfg.c  |  5 +++++
 net/mac80211/chan.c |  5 -----
 net/mac80211/mlme.c | 55 +++++++++++++++++++++++++++++++++++++++--------------
 3 files changed, 46 insertions(+), 19 deletions(-)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 7aa38ce..beb1c2a 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2872,6 +2872,11 @@ void ieee80211_csa_finalize_work(struct work_struct *work)
 	if (WARN_ON(err < 0))
 		return;
 
+	if (!local->use_chanctx) {
+		local->_oper_chandef = local->csa_chandef;
+		ieee80211_hw_config(local, 0);
+	}
+
 	err = ieee80211_assign_beacon(sdata, sdata->u.ap.next_beacon);
 	if (err < 0)
 		return;
diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c
index 3a4764b..03ba6b5 100644
--- a/net/mac80211/chan.c
+++ b/net/mac80211/chan.c
@@ -453,11 +453,6 @@ int ieee80211_vif_change_channel(struct ieee80211_sub_if_data *sdata,
 	chanctx_changed |= IEEE80211_CHANCTX_CHANGE_CHANNEL;
 	drv_change_chanctx(local, ctx, chanctx_changed);
 
-	if (!local->use_chanctx) {
-		local->_oper_chandef = *chandef;
-		ieee80211_hw_config(local, 0);
-	}
-
 	ieee80211_recalc_chanctx_chantype(local, ctx);
 	ieee80211_recalc_smps_chanctx(local, ctx);
 	ieee80211_recalc_radar_chanctx(local, ctx);
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 45a87ee..750bf55 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -926,6 +926,8 @@ static void ieee80211_chswitch_work(struct work_struct *work)
 		container_of(work, struct ieee80211_sub_if_data, u.mgd.chswitch_work);
 	struct ieee80211_local *local = sdata->local;
 	struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
+	u32 changed = 0;
+	int ret;
 
 	if (!ieee80211_sdata_running(sdata))
 		return;
@@ -934,24 +936,38 @@ static void ieee80211_chswitch_work(struct work_struct *work)
 	if (!ifmgd->associated)
 		goto out;
 
-	local->_oper_chandef = local->csa_chandef;
+	ret = ieee80211_vif_change_channel(sdata, &local->csa_chandef,
+					   &changed);
+	if (ret) {
+		sdata_info(sdata,
+			   "vif channel switch failed, disconnecting\n");
+		ieee80211_queue_work(&sdata->local->hw,
+				     &ifmgd->csa_connection_drop_work);
+		goto out;
+	}
 
-	if (!local->ops->channel_switch) {
-		/* call "hw_config" only if doing sw channel switch */
-		ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL);
-	} else {
-		/* update the device channel directly */
-		local->hw.conf.chandef = local->_oper_chandef;
+	if (!local->use_chanctx) {
+		local->_oper_chandef = local->csa_chandef;
+		/* Call "hw_config" only if doing sw channel switch.
+		 * Otherwise update the channel directly */
+		if (!local->ops->channel_switch)
+			ieee80211_hw_config(local, 0);
+		else
+			local->hw.conf.chandef = local->_oper_chandef;
 	}
 
 	/* XXX: shouldn't really modify cfg80211-owned data! */
-	ifmgd->associated->channel = local->_oper_chandef.chan;
+	ifmgd->associated->channel = local->csa_chandef.chan;
 
 	/* XXX: wait for a beacon first? */
 	ieee80211_wake_queues_by_reason(&local->hw,
 					IEEE80211_MAX_QUEUE_MAP,
 					IEEE80211_QUEUE_STOP_REASON_CSA);
+
+	ieee80211_bss_info_change_notify(sdata, changed);
+
  out:
+	sdata->vif.csa_active = false;
 	ifmgd->flags &= ~IEEE80211_STA_CSA_RECEIVED;
 	sdata_unlock(sdata);
 }
@@ -1180,17 +1196,27 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
 	}
 
 	ifmgd->flags |= IEEE80211_STA_CSA_RECEIVED;
+	sdata->vif.csa_active = true;
 
+	mutex_lock(&local->chanctx_mtx);
 	if (local->use_chanctx) {
-		sdata_info(sdata,
-			   "not handling channel switch with channel contexts\n");
-		ieee80211_queue_work(&local->hw,
-				     &ifmgd->csa_connection_drop_work);
-		return;
+		u32 num_chanctx = 0;
+		list_for_each_entry(chanctx, &local->chanctx_list, list)
+		       num_chanctx++;
+
+		if (num_chanctx > 1) {
+			sdata_info(sdata,
+				   "not handling chan-switch with channel contexts multi-vif\n");
+			ieee80211_queue_work(&local->hw,
+					     &ifmgd->csa_connection_drop_work);
+			mutex_unlock(&local->chanctx_mtx);
+			return;
+		}
 	}
 
-	mutex_lock(&local->chanctx_mtx);
 	if (WARN_ON(!rcu_access_pointer(sdata->vif.chanctx_conf))) {
+		ieee80211_queue_work(&local->hw,
+				     &ifmgd->csa_connection_drop_work);
 		mutex_unlock(&local->chanctx_mtx);
 		return;
 	}
@@ -2163,6 +2189,7 @@ static void __ieee80211_disconnect(struct ieee80211_sub_if_data *sdata)
 			       WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY,
 			       true, frame_buf);
 	ifmgd->flags &= ~IEEE80211_STA_CSA_RECEIVED;
+	sdata->vif.csa_active = false;
 	ieee80211_wake_queues_by_reason(&sdata->local->hw,
 					IEEE80211_MAX_QUEUE_MAP,
 					IEEE80211_QUEUE_STOP_REASON_CSA);
-- 
1.8.1.2


^ permalink raw reply related

* [PATCH] wil6210: fix for HW csum
From: Vladimir Kondratiev @ 2013-08-13 12:25 UTC (permalink / raw)
  To: John W . Linville
  Cc: Kirshenbaum Erez, Vladimir Kondratiev, linux-wireless,
	Luis R . Rodriguez, wil6210

Following is fix for HW csum calculation. User visible
impact is quite severe: before this patch, TCP iperf
Windows -> Linux would stall in about 1sec.

Vladimir Kondratiev (1):
  wil6210: let IP stack re-check HW TCP/UDP csum errors

 drivers/net/wireless/ath/wil6210/txrx.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

-- 
1.8.1.2


^ permalink raw reply

* [PATCH] wil6210: let IP stack re-check HW TCP/UDP csum errors
From: Vladimir Kondratiev @ 2013-08-13 12:25 UTC (permalink / raw)
  To: John W . Linville
  Cc: Kirshenbaum Erez, Vladimir Kondratiev, linux-wireless,
	Luis R . Rodriguez, wil6210
In-Reply-To: <1376396732-26632-1-git-send-email-qca_vkondrat@qca.qualcomm.com>

Fix for TCP iperf from Windows to Linux stall after about 1sec

Hardware reports false errors in some situations:

Microsoft IP stack, in violation of RFC 1624, set TCP checksum that should be 0x0
as 0xffff. hardware report Rx csum error. If HW csum absolutely trusted,
this frame can be never received, as re-transmitted one will have same csum problem.
In addition, it mess up block ack reorder buffer, as if packet dropped, it is not score boarded
there.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
---
 drivers/net/wireless/ath/wil6210/txrx.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c
index ea1abeb..d505b26 100644
--- a/drivers/net/wireless/ath/wil6210/txrx.c
+++ b/drivers/net/wireless/ath/wil6210/txrx.c
@@ -416,13 +416,13 @@ static struct sk_buff *wil_vring_reap_rx(struct wil6210_priv *wil,
 	 */
 	if (d->dma.status & RX_DMA_STATUS_L4_IDENT) {
 		/* L4 protocol identified, csum calculated */
-		if ((d->dma.error & RX_DMA_ERROR_L4_ERR) == 0) {
+		if ((d->dma.error & RX_DMA_ERROR_L4_ERR) == 0)
 			skb->ip_summed = CHECKSUM_UNNECESSARY;
-		} else {
-			wil_err(wil, "Incorrect checksum reported\n");
-			kfree_skb(skb);
-			return NULL;
-		}
+		/* If HW reports bad checksum, let IP stack re-check it
+		 * For example, HW don't understand Microsoft IP stack that
+		 * mis-calculates TCP checksum - if it should be 0x0,
+		 * it writes 0xffff in violation of RFC 1624
+		 */
 	}
 
 	ds_bits = wil_rxdesc_ds_bits(d);
-- 
1.8.1.2


^ permalink raw reply related

* Re: [PATCH 3/5] ath9k: avoid accessing MRC registers on single-chain devices
From: Sujith Manoharan @ 2013-08-13 12:49 UTC (permalink / raw)
  To: Felix Fietkau; +Cc: linux-wireless, linville
In-Reply-To: <1376390010-81819-3-git-send-email-nbd@openwrt.org>

Felix Fietkau wrote:
> They are not implemented, and accessing them might trigger errors
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Felix Fietkau <nbd@openwrt.org>
> ---
>  drivers/net/wireless/ath/ath9k/ar9003_phy.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
> index 39c3730..18a5aa4 100644
> --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
> +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
> @@ -1172,6 +1172,10 @@ skip_ws_det:
>  		 * is_on == 0 means MRC CCK is OFF (more noise imm)
>  		 */
>  		bool is_on = param ? 1 : 0;
> +
> +		if (ah->caps.rx_chainmask == 1)
> +			break;
> +

This is done in ath9k_hw_set_cck_nil(). All the 1-chain devices are handled
except AR9330. Maybe the chainmask check can be moved there ?

Sujith

^ permalink raw reply

* Re: brcsmac kernel panic
From: Arend van Spriel @ 2013-08-13 13:41 UTC (permalink / raw)
  To: Daniel Wagner; +Cc: linux-wireless, linux-kernel
In-Reply-To: <52094156.7010905@monom.org>

On 08/12/2013 10:11 PM, Daniel Wagner wrote:
> Hi Arend,
>
> On 08/12/2013 12:38 PM, Arend van Spriel wrote:
>> On 08/11/2013 06:21 PM, Daniel Wagner wrote:
>>> I just updated my laptop (MacBook Air 2012) from 3.11-rc3+ to 3.11-rc4+
>>> and since then brcsmac crashes short after enabling it. Unfortunately, I
>>> did also change some config flags in the area of cpufreq (enabling
>>> p-state driver) so the configuration is not exactly the same. Before I
>>> try to figure out what I have changed, I am posting the picture of the
>>> crash. Maybe it is something obvious.
>>>
>>> v3.11-rc4-197-gd92581f
>>> http://www.monom.org/misc/brcmsmac/v3.11-rc4.config
>>> http://www.monom.org/misc/brcmsmac/IMAG0064.jpg
>>
>> Thanks, Daniel
>>
>> I was looking at this issue two weeks ago and just got back from my
>> vacation. Can you apply the patch and send me a kernel log?
>
> Sure, the patch does the trick, the panic is gone.

Unfortunately, it results in a lot of error print and phy tx errors that 
has been reported by others. I think the two are related, but I have not 
root caused it yet. Your laptop may be usable now, but wireless 
performance is probably bad.

Too bad I can not reproduce the issue over here. Are you willing to test 
some patches when I got a better grasp on the issue?

Regards,
Arend

>> Sharing pictures, huh. What about this one :-p
>
> No no, that isn't me, that is someone else! :P
>
> cheers,
> daniel
>
>



^ permalink raw reply

* Re: brcsmac kernel panic
From: Daniel Wagner @ 2013-08-13 13:55 UTC (permalink / raw)
  To: Arend van Spriel; +Cc: linux-wireless, linux-kernel
In-Reply-To: <520A3784.2060108@broadcom.com>

On 08/13/2013 03:41 PM, Arend van Spriel wrote:
> On 08/12/2013 10:11 PM, Daniel Wagner wrote:
>> On 08/12/2013 12:38 PM, Arend van Spriel wrote:
>>> On 08/11/2013 06:21 PM, Daniel Wagner wrote:
>>>> I just updated my laptop (MacBook Air 2012) from 3.11-rc3+ to 3.11-rc4+
>>>> and since then brcsmac crashes short after enabling it.
>>>> Unfortunately, I
>>>> did also change some config flags in the area of cpufreq (enabling
>>>> p-state driver) so the configuration is not exactly the same. Before I
>>>> try to figure out what I have changed, I am posting the picture of the
>>>> crash. Maybe it is something obvious.
>>>>
>>>> v3.11-rc4-197-gd92581f
>>>> http://www.monom.org/misc/brcmsmac/v3.11-rc4.config
>>>> http://www.monom.org/misc/brcmsmac/IMAG0064.jpg
>>>
>>> Thanks, Daniel
>>>
>>> I was looking at this issue two weeks ago and just got back from my
>>> vacation. Can you apply the patch and send me a kernel log?
>>
>> Sure, the patch does the trick, the panic is gone.
>
> Unfortunately, it results in a lot of error print and phy tx errors that
> has been reported by others. I think the two are related, but I have not
> root caused it yet. Your laptop may be usable now, but wireless
> performance is probably bad.
>
> Too bad I can not reproduce the issue over here. Are you willing to test
> some patches when I got a better grasp on the issue?

Sure, let there be patches. :)

cheers,
daniel


^ permalink raw reply

* Re: [PATCH] ath10k: check allocation errors in CE
From: Kalle Valo @ 2013-08-13 14:47 UTC (permalink / raw)
  To: Janusz Dziedzic; +Cc: ath10k, linux-wireless
In-Reply-To: <1376030353-32421-1-git-send-email-janusz.dziedzic@tieto.com>

Janusz Dziedzic <janusz.dziedzic@tieto.com> writes:

> Handle pci_alloc_consistent(), kmalloc()
> errors in copy engine module.
> Found during code review.
>
> Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>

Thanks, applied.

-- 
Kalle Valo

^ permalink raw reply

* Re: [PATCH] backports: rename some mem functions to not break custom kernels
From: Arik Nemtsov @ 2013-08-13 14:47 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: linux-wireless, mcgrof, backports@vger.kernel.org
In-Reply-To: <52090C37.2000103@hauke-m.de>

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

On Mon, Aug 12, 2013 at 7:24 PM, Hauke Mehrtens <hauke@hauke-m.de> wrote:
> adding the LINUX_BACKPORT() line should be enough to rename it
> everywhere in backprots, so you do not have to modify
> backport/compat/backport-3.11.c or manually add the prefix anywhere else.
>
> Could you try if this fixes your problems with phys_wc_to_mtrr_index:
>
>  ...
> +#define phys_wc_to_mtrr_index LINUX_BACKPORT(phys_wc_to_mtrr_index)
>  #ifdef CONFIG_MTRR
>  extern int phys_wc_to_mtrr_index(int handle);
>  #else
>  static inline int phys_wc_to_mtrr_index(int handle)
>  {
>         return -1;
>  }
>  #endif /* CONFIG_MTRR */
>

Thanks. It seems to do the trick. The attached patch solves the issue.
Luis - any comments on this one?

Regards,
Arik

[-- Attachment #2: 0001-backports-rename-some-mem-functions-to-not-break-cus.patch --]
[-- Type: application/octet-stream, Size: 1891 bytes --]

From ffcb716aaf2a3fe61af29e74fe23c4688f39a53d Mon Sep 17 00:00:00 2001
From: Arik Nemtsov <arik@wizery.com>
Date: Tue, 6 Aug 2013 18:28:56 +0300
Subject: [PATCH] backports: rename some mem functions to not break custom
 kernels

When custom patches are cherry-picked to a kernel, some symbols exported
by backports may clash with the built-in ones. Rename the backports
symbols using the standard backport_ prefix to prevent that.

The offending symbols were exported by the patch below:

commit 2ce5c22448bb45998318267c00b5d6ef9cff3170
Author: Hauke Mehrtens <hauke@hauke-m.de>
Date:   Thu Jun 6 13:48:04 2013 +0200

    backports: backport some memory functions

Signed-off-by: Arik Nemtsov <arik@wizery.com>
---
 backport/backport-include/asm/mtrr.h | 1 +
 backport/backport-include/linux/io.h | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/backport/backport-include/asm/mtrr.h b/backport/backport-include/asm/mtrr.h
index cf0f6fd..861438a 100644
--- a/backport/backport-include/asm/mtrr.h
+++ b/backport/backport-include/asm/mtrr.h
@@ -7,6 +7,7 @@
  * The following functions are for use by other drivers that cannot use
  * arch_phys_wc_add and arch_phys_wc_del.
  */
+#define phys_wc_to_mtrr_index LINUX_BACKPORT(phys_wc_to_mtrr_index)
 #ifdef CONFIG_MTRR
 extern int phys_wc_to_mtrr_index(int handle);
 #else
diff --git a/backport/backport-include/linux/io.h b/backport/backport-include/linux/io.h
index 9a5b308..5447df8 100644
--- a/backport/backport-include/linux/io.h
+++ b/backport/backport-include/linux/io.h
@@ -13,6 +13,9 @@
  * arch_phys_del_wc(0) or arch_phys_del_wc(any error code) is guaranteed
  * to have no effect.
  */
+#define arch_phys_wc_add LINUX_BACKPORT(arch_phys_wc_add)
+#define arch_phys_wc_del LINUX_BACKPORT(arch_phys_wc_del)
+
 #ifndef arch_phys_wc_add
 #ifdef CONFIG_MTRR
 extern int __must_check arch_phys_wc_add(unsigned long base,
-- 
1.8.1.2


^ permalink raw reply related

* Signal loss rtl8723ae wifi driver
From: Phillip Moss @ 2013-08-13 16:23 UTC (permalink / raw)
  To: linux-wireless; +Cc: Larry.Finger

Hi all,
I have a rtl8723ae wifi card on my laptop. When connecting to any wifi Access Point 
the wifi signal fluctuates from full strength to very low.  In order to connect and 
stay connected I must be no farther than two meters from my router otherwise I get
disconnected. I have tried the kernel driver on multiple distros as well as the
vendor drivers for older kernel versions. All seem to have the same problem. The card
works ok on Windows 7 with vendor drivers. I have also tried compiling
backports-3.10-rc1-2 with no luck. During a signal loss period I get no logs but if I
take the laptop too far from the AP dmesg reports:

[  764.163774] wlp3s0: authenticate with xx:xx:xx:xx:xx:xx
[  764.192783] wlp3s0: send auth to xx:xx:xx:xx:xx:xx (try 1/3)
[  764.200572] wlp3s0: authenticated
[  764.203290] wlp3s0: associate with xx:xx:xx:xx:xx:xx (try 1/3)
[  764.225178] wlp3s0: RX AssocResp from xx:xx:xx:xx:xx:xx (capab=0x411 status=0
aid=2) [  764.225452] wlp3s0: associated
[  764.225459] IPv6: ADDRCONF(NETDEV_CHANGE): wlp3s0: link becomes ready
[  772.036168] wlp3s0: deauthenticated from xx:xx:xx:xx:xx:xx (Reason: 15)
[  772.077800] cfg80211: Calling CRDA to update world regulatory domain
[  775.286474] wlp3s0: authenticate with xx:xx:xx:xx:xx:xx
[  775.315559] wlp3s0: send auth to xx:xx:xx:xx:xx:xx (try 1/3)
[  775.321158] wlp3s0: authenticated
[  775.322689] wlp3s0: associate with xx:xx:xx:xx:xx:xx (try 1/3)
[  775.426155] wlp3s0: associate with xx:xx:xx:xx:xx:xx (try 2/3)
[  775.529550] wlp3s0: associate with xx:xx:xx:xx:xx:xx (try 3/3)
[  775.633015] wlp3s0: association with xx:xx:xx:xx:xx:xx timed out
[  786.622957] wlp3s0: authenticate with xx:xx:xx:xx:xx:xx
[  786.651896] wlp3s0: send auth to xx:xx:xx:xx:xx:xx (try 1/3)
[  786.662445] wlp3s0: authenticated
[  786.665720] wlp3s0: associate with xx:xx:xx:xx:xx:xx (try 1/3)
[  786.673076] wlp3s0: RX AssocResp from xx:xx:xx:xx:xx:xx (capab=0x411 status=0
aid=2) [  786.673305] wlp3s0: associated
[  814.496149] wlp3s0: Connection to AP xx:xx:xx:xx:xx:xx lost
[  814.589627] cfg80211: Calling CRDA to update world regulatory domain
[  815.974548] wlp3s0: authenticate with xx:xx:xx:xx:xx:xx
[  816.003540] wlp3s0: send auth to xx:xx:xx:xx:xx:xx (try 1/3)
[  816.012928] wlp3s0: authenticated
[  816.014009] wlp3s0: associate with xx:xx:xx:xx:xx:xx (try 1/3)
[  816.117439] wlp3s0: associate with xx:xx:xx:xx:xx:xx (try 2/3)
[  816.220847] wlp3s0: associate with xx:xx:xx:xx:xx:xx (try 3/3)
[  816.324220] wlp3s0: association with xx:xx:xx:xx:xx:xx timed out
[  817.806001] wlp3s0: authenticate with xx:xx:xx:xx:xx:xx
[  817.835045] wlp3s0: send auth to xx:xx:xx:xx:xx:xx (try 1/3)
[  817.935652] wlp3s0: send auth to xx:xx:xx:xx:xx:xx (try 2/3)
[  818.039082] wlp3s0: send auth to xx:xx:xx:xx:xx:xx (try 3/3)
[  818.142458] wlp3s0: authentication with xx:xx:xx:xx:xx:xx timed out
[  820.148096] wlp3s0: authenticate with xx:xx:xx:xx:xx:xx
[  820.177057] wlp3s0: send auth to xx:xx:xx:xx:xx:xx (try 1/3)
[  820.183705] wlp3s0: authenticated
[  820.184179] wlp3s0: associate with xx:xx:xx:xx:xx:xx (try 1/3)
[  820.287650] wlp3s0: associate with xx:xx:xx:xx:xx:xx (try 2/3)
[  820.391074] wlp3s0: associate with xx:xx:xx:xx:xx:xx (try 3/3)
[  820.494461] wlp3s0: association with xx:xx:xx:xx:xx:xx timed out
[  826.476820] wlp3s0: authenticate with xx:xx:xx:xx:xx:xx
[  826.505764] wlp3s0: send auth to xx:xx:xx:xx:xx:xx (try 1/3)
[  826.606337] wlp3s0: send auth to xx:xx:xx:xx:xx:xx (try 2/3)
[  826.709744] wlp3s0: send auth to xx:xx:xx:xx:xx:xx (try 3/3)
[  826.813199] wlp3s0: authentication with xx:xx:xx:xx:xx:xx timed out
[  837.813007] wlp3s0: authenticate with xx:xx:xx:xx:xx:xx
[  837.842080] wlp3s0: send auth to xx:xx:xx:xx:xx:xx (try 1/3)
[  837.857000] wlp3s0: authenticated
[  837.859229] wlp3s0: associate with xx:xx:xx:xx:xx:xx (try 1/3)
[  837.866815] wlp3s0: RX AssocResp from xx:xx:xx:xx:xx:xx (capab=0x411 status=0
aid=2) [  837.867038] wlp3s0: associated
[  845.599874] wlp3s0: deauthenticated from xx:xx:xx:xx:xx:xx (Reason: 15)
[  845.627330] cfg80211: Calling CRDA to update world regulatory domain
[  857.376412] wlp3s0: authenticate with xx:xx:xx:xx:xx:xx
[  857.405387] wlp3s0: send auth to xx:xx:xx:xx:xx:xx (try 1/3)
[  857.410017] wlp3s0: authenticated
[  857.412546] wlp3s0: associate with xx:xx:xx:xx:xx:xx (try 1/3)
[  857.415665] wlp3s0: RX AssocResp from xx:xx:xx:xx:xx:xx (capab=0x411 status=0
aid=2) [  857.415902] wlp3s0: associated

The issue is exactly the same as discribed here:
http://askubuntu.com/questions/289414/rtl8723ae-driver-problem-ubuntu-13-04
Does anyone know what might be wrong?
Cheers for the help.

^ permalink raw reply

* [PATCH 1/2 v2] staging: vt6656: rxtx.h always pack BEACON_BUFFER/TX_BUFFER
From: Malcolm Priestley @ 2013-08-13 18:47 UTC (permalink / raw)
  To: gregkh; +Cc: linux-wireless

All structure members of BEACON_BUFFER/TX_BUFFER should be packed.

Only the first 4 members of these structures are live.

The forth member is referenced at run-time by packed structures.
typedef struct tagSTxBufHead
typedef struct tagSTxShortBufHead
in desc.h

If these structures are not packed the alignment of these members
will be wrong.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
 drivers/staging/vt6656/rxtx.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/vt6656/rxtx.h b/drivers/staging/vt6656/rxtx.h
index dd7e85d..d854b38 100644
--- a/drivers/staging/vt6656/rxtx.h
+++ b/drivers/staging/vt6656/rxtx.h
@@ -609,7 +609,7 @@ typedef struct tagSTX_BUFFER
     // Actual message
     TX_BUFFER_CONTAINER             BufferHeader;
 
-} TX_BUFFER, *PTX_BUFFER;
+} __packed TX_BUFFER, *PTX_BUFFER;
 
 //
 // Remote NDIS message format
@@ -626,7 +626,7 @@ typedef struct tagSBEACON_BUFFER
     // Actual message
     TX_BUFFER_CONTAINER             BufferHeader;
 
-} BEACON_BUFFER, *PBEACON_BUFFER;
+} __packed BEACON_BUFFER, *PBEACON_BUFFER;
 
 void vDMA0_tx_80211(struct vnt_private *, struct sk_buff *skb);
 int nsDMA_tx_packet(struct vnt_private *, u32 uDMAIdx, struct sk_buff *skb);
-- 
1.8.1.2



^ permalink raw reply related

* [PATCH 2/2 v2] staging: vt6656: rxtx.h dead code typedef union tagUTX_BUFFER_CONTAINER
From: Malcolm Priestley @ 2013-08-13 18:52 UTC (permalink / raw)
  To: gregkh; +Cc: linux-wireless

This is part of the Remote NDIS message format with patch

vt6656: rxtx.c: s_vGetFreeContext use single tx memset.

there is not need for this structure and its members.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
 drivers/staging/vt6656/rxtx.h | 573 ------------------------------------------
 1 file changed, 573 deletions(-)

diff --git a/drivers/staging/vt6656/rxtx.h b/drivers/staging/vt6656/rxtx.h
index d854b38..3e2a877 100644
--- a/drivers/staging/vt6656/rxtx.h
+++ b/drivers/staging/vt6656/rxtx.h
@@ -32,568 +32,6 @@
 #include "device.h"
 #include "wcmd.h"
 
-//
-// RTS buffer header
-//
-typedef struct tagSRTSDataF {
-    u16    wFrameControl;
-    u16    wDurationID;
-    u8    abyRA[ETH_ALEN];
-    u8    abyTA[ETH_ALEN];
-} SRTSDataF, *PSRTSDataF;
-
-//
-// CTS buffer header
-//
-typedef struct tagSCTSDataF {
-    u16    wFrameControl;
-    u16    wDurationID;
-    u8    abyRA[ETH_ALEN];
-    u16    wReserved;
-} SCTSDataF, *PSCTSDataF;
-
-//
-// MICHDR data header
-//
-typedef struct tagSMICHDR {
-	u32 adwHDR0[4];
-	u32 adwHDR1[4];
-	u32 adwHDR2[4];
-} SMICHDR, *PSMICHDR;
-
-typedef struct tagSTX_NAF_G_RTS
-{
-    //RsvTime
-    u16            wRTSTxRrvTime_ba;
-    u16            wRTSTxRrvTime_aa;
-    u16            wRTSTxRrvTime_bb;
-    u16            wReserved2;
-    u16            wTxRrvTime_b;
-    u16            wTxRrvTime_a;
-
-    //RTS
-    u8            byRTSSignalField_b;
-    u8            byRTSServiceField_b;
-    u16            wRTSTransmitLength_b;
-    u8            byRTSSignalField_a;
-    u8            byRTSServiceField_a;
-    u16            wRTSTransmitLength_a;
-    u16            wRTSDuration_ba;
-    u16            wRTSDuration_aa;
-    u16            wRTSDuration_bb;
-    u16            wReserved3;
-    SRTSDataF       sRTS;
-
-    //Data
-    u8            bySignalField_b;
-    u8            byServiceField_b;
-    u16            wTransmitLength_b;
-    u8            bySignalField_a;
-    u8            byServiceField_a;
-    u16            wTransmitLength_a;
-    u16            wDuration_b;
-    u16            wDuration_a;
-    u16            wTimeStampOff_b;
-    u16            wTimeStampOff_a;
-
-} TX_NAF_G_RTS, *PTX_NAF_G_RTS;
-
-typedef struct tagSTX_NAF_G_RTS_MIC
-{
-    //RsvTime
-    u16            wRTSTxRrvTime_ba;
-    u16            wRTSTxRrvTime_aa;
-    u16            wRTSTxRrvTime_bb;
-    u16            wReserved2;
-    u16            wTxRrvTime_b;
-    u16            wTxRrvTime_a;
-
-    SMICHDR         sMICHDR;
-
-    //RTS
-    u8            byRTSSignalField_b;
-    u8            byRTSServiceField_b;
-    u16            wRTSTransmitLength_b;
-    u8            byRTSSignalField_a;
-    u8            byRTSServiceField_a;
-    u16            wRTSTransmitLength_a;
-    u16            wRTSDuration_ba;
-    u16            wRTSDuration_aa;
-    u16            wRTSDuration_bb;
-    u16            wReserved3;
-    SRTSDataF       sRTS;
-
-    //Data
-    u8            bySignalField_b;
-    u8            byServiceField_b;
-    u16            wTransmitLength_b;
-    u8            bySignalField_a;
-    u8            byServiceField_a;
-    u16            wTransmitLength_a;
-    u16            wDuration_b;
-    u16            wDuration_a;
-    u16            wTimeStampOff_b;
-    u16            wTimeStampOff_a;
-
-} TX_NAF_G_RTS_MIC, *PTX_NAF_G_RTS_MIC;
-
-typedef struct tagSTX_NAF_G_CTS
-{
-    //RsvTime
-    u16            wCTSTxRrvTime_ba;
-    u16            wReserved2;
-    u16            wTxRrvTime_b;
-    u16            wTxRrvTime_a;
-
-    //CTS
-    u8            byCTSSignalField_b;
-    u8            byCTSServiceField_b;
-    u16            wCTSTransmitLength_b;
-    u16            wCTSDuration_ba;
-    u16            wReserved3;
-    SCTSDataF       sCTS;
-
-    //Data
-    u8            bySignalField_b;
-    u8            byServiceField_b;
-    u16            wTransmitLength_b;
-    u8            bySignalField_a;
-    u8            byServiceField_a;
-    u16            wTransmitLength_a;
-    u16            wDuration_b;
-    u16            wDuration_a;
-    u16            wTimeStampOff_b;
-    u16            wTimeStampOff_a;
-
-} TX_NAF_G_CTS, *PTX_NAF_G_CTS;
-
-typedef struct tagSTX_NAF_G_CTS_MIC
-{
-    //RsvTime
-    u16            wCTSTxRrvTime_ba;
-    u16            wReserved2;
-    u16            wTxRrvTime_b;
-    u16            wTxRrvTime_a;
-
-    SMICHDR         sMICHDR;
-
-    //CTS
-    u8            byCTSSignalField_b;
-    u8            byCTSServiceField_b;
-    u16            wCTSTransmitLength_b;
-    u16            wCTSDuration_ba;
-    u16            wReserved3;
-    SCTSDataF       sCTS;
-
-    //Data
-    u8            bySignalField_b;
-    u8            byServiceField_b;
-    u16            wTransmitLength_b;
-    u8            bySignalField_a;
-    u8            byServiceField_a;
-    u16            wTransmitLength_a;
-    u16            wDuration_b;
-    u16            wDuration_a;
-    u16            wTimeStampOff_b;
-    u16            wTimeStampOff_a;
-
-} TX_NAF_G_CTS_MIC, *PTX_NAF_G_CTS_MIC;
-
-typedef struct tagSTX_NAF_G_BEACON
-{
-    u16            wFIFOCtl;
-    u16            wTimeStamp;
-
-    //CTS
-    u8            byCTSSignalField_b;
-    u8            byCTSServiceField_b;
-    u16            wCTSTransmitLength_b;
-    u16            wCTSDuration_ba;
-    u16            wReserved1;
-    SCTSDataF       sCTS;
-
-    //Data
-    u8            bySignalField_a;
-    u8            byServiceField_a;
-    u16            wTransmitLength_a;
-    u16            wDuration_a;
-    u16            wTimeStampOff_a;
-
-} TX_NAF_G_BEACON, *PTX_NAF_G_BEACON;
-
-typedef struct tagSTX_NAF_AB_RTS
-{
-    //RsvTime
-    u16            wRTSTxRrvTime_ab;
-    u16            wTxRrvTime_ab;
-
-    //RTS
-    u8            byRTSSignalField_ab;
-    u8            byRTSServiceField_ab;
-    u16            wRTSTransmitLength_ab;
-    u16            wRTSDuration_ab;
-    u16            wReserved2;
-    SRTSDataF       sRTS;
-
-    //Data
-    u8            bySignalField_ab;
-    u8            byServiceField_ab;
-    u16            wTransmitLength_ab;
-    u16            wDuration_ab;
-    u16            wTimeStampOff_ab;
-
-} TX_NAF_AB_RTS, *PTX_NAF_AB_RTS;
-
-typedef struct tagSTX_NAF_AB_RTS_MIC
-{
-    //RsvTime
-    u16            wRTSTxRrvTime_ab;
-    u16            wTxRrvTime_ab;
-
-    SMICHDR         sMICHDR;
-
-    //RTS
-    u8            byRTSSignalField_ab;
-    u8            byRTSServiceField_ab;
-    u16            wRTSTransmitLength_ab;
-    u16            wRTSDuration_ab;
-    u16            wReserved2;
-    SRTSDataF       sRTS;
-
-    //Data
-    u8            bySignalField_ab;
-    u8            byServiceField_ab;
-    u16            wTransmitLength_ab;
-    u16            wDuration_ab;
-    u16            wTimeStampOff_ab;
-
-} TX_NAF_AB_RTS_MIC, *PTX_NAF_AB_RTS_MIC;
-
-typedef struct tagSTX_NAF_AB_CTS
-{
-    //RsvTime
-    u16            wReserved2;
-    u16            wTxRrvTime_ab;
-
-    //Data
-    u8            bySignalField_ab;
-    u8            byServiceField_ab;
-    u16            wTransmitLength_ab;
-    u16            wDuration_ab;
-    u16            wTimeStampOff_ab;
-
-} TX_NAF_AB_CTS, *PTX_NAF_AB_CTS;
-
-typedef struct tagSTX_NAF_AB_CTS_MIC
-{
-    //RsvTime
-    u16            wReserved2;
-    u16            wTxRrvTime_ab;
-
-    SMICHDR         sMICHDR;
-
-    //Data
-    u8            bySignalField_ab;
-    u8            byServiceField_ab;
-    u16            wTransmitLength_ab;
-    u16            wDuration_ab;
-    u16            wTimeStampOff_ab;
-
-} TX_NAF_AB_CTS_MIC, *PTX_NAF_AB_CTS_MIC;
-
-typedef struct tagSTX_NAF_AB_BEACON
-{
-    u16            wFIFOCtl;
-    u16            wTimeStamp;
-
-   //Data
-    u8            bySignalField_ab;
-    u8            byServiceField_ab;
-    u16            wTransmitLength_ab;
-    u16            wDuration_ab;
-    u16            wTimeStampOff_ab;
-
-} TX_NAF_AB_BEACON, *PTX_NAF_AB_BEACON;
-
-typedef struct tagSTX_AF_G_RTS
-{
-    //RsvTime
-    u16            wRTSTxRrvTime_ba;
-    u16            wRTSTxRrvTime_aa;
-    u16            wRTSTxRrvTime_bb;
-    u16            wReserved2;
-    u16            wTxRrvTime_b;
-    u16            wTxRrvTime_a;
-
-    //RTS
-    u8            byRTSSignalField_b;
-    u8            byRTSServiceField_b;
-    u16            wRTSTransmitLength_b;
-    u8            byRTSSignalField_a;
-    u8            byRTSServiceField_a;
-    u16            wRTSTransmitLength_a;
-    u16            wRTSDuration_ba;
-    u16            wRTSDuration_aa;
-    u16            wRTSDuration_bb;
-    u16            wReserved3;
-    u16            wRTSDuration_ba_f0;
-    u16            wRTSDuration_aa_f0;
-    u16            wRTSDuration_ba_f1;
-    u16            wRTSDuration_aa_f1;
-    SRTSDataF       sRTS;
-
-    //Data
-    u8            bySignalField_b;
-    u8            byServiceField_b;
-    u16            wTransmitLength_b;
-    u8            bySignalField_a;
-    u8            byServiceField_a;
-    u16            wTransmitLength_a;
-    u16            wDuration_b;
-    u16            wDuration_a;
-    u16            wDuration_a_f0;
-    u16            wDuration_a_f1;
-    u16            wTimeStampOff_b;
-    u16            wTimeStampOff_a;
-
-} TX_AF_G_RTS, *PTX_AF_G_RTS;
-
-typedef struct tagSTX_AF_G_RTS_MIC
-{
-    //RsvTime
-    u16            wRTSTxRrvTime_ba;
-    u16            wRTSTxRrvTime_aa;
-    u16            wRTSTxRrvTime_bb;
-    u16            wReserved2;
-    u16            wTxRrvTime_b;
-    u16            wTxRrvTime_a;
-
-    SMICHDR         sMICHDR;
-
-    //RTS
-    u8            byRTSSignalField_b;
-    u8            byRTSServiceField_b;
-    u16            wRTSTransmitLength_b;
-    u8            byRTSSignalField_a;
-    u8            byRTSServiceField_a;
-    u16            wRTSTransmitLength_a;
-    u16            wRTSDuration_ba;
-    u16            wRTSDuration_aa;
-    u16            wRTSDuration_bb;
-    u16            wReserved3;
-    u16            wRTSDuration_ba_f0;
-    u16            wRTSDuration_aa_f0;
-    u16            wRTSDuration_ba_f1;
-    u16            wRTSDuration_aa_f1;
-    SRTSDataF       sRTS;
-
-    //Data
-    u8            bySignalField_b;
-    u8            byServiceField_b;
-    u16            wTransmitLength_b;
-    u8            bySignalField_a;
-    u8            byServiceField_a;
-    u16            wTransmitLength_a;
-    u16            wDuration_b;
-    u16            wDuration_a;
-    u16            wDuration_a_f0;
-    u16            wDuration_a_f1;
-    u16            wTimeStampOff_b;
-    u16            wTimeStampOff_a;
-
-} TX_AF_G_RTS_MIC, *PTX_AF_G_RTS_MIC;
-
-typedef struct tagSTX_AF_G_CTS
-{
-    //RsvTime
-    u16            wCTSTxRrvTime_ba;
-    u16            wReserved2;
-    u16            wTxRrvTime_b;
-    u16            wTxRrvTime_a;
-
-    //CTS
-    u8            byCTSSignalField_b;
-    u8            byCTSServiceField_b;
-    u16            wCTSTransmitLength_b;
-    u16            wCTSDuration_ba;
-    u16            wReserved3;
-    u16            wCTSDuration_ba_f0;
-    u16            wCTSDuration_ba_f1;
-    SCTSDataF       sCTS;
-
-    //Data
-    u8            bySignalField_b;
-    u8            byServiceField_b;
-    u16            wTransmitLength_b;
-    u8            bySignalField_a;
-    u8            byServiceField_a;
-    u16            wTransmitLength_a;
-    u16            wDuration_b;
-    u16            wDuration_a;
-    u16            wDuration_a_f0;
-    u16            wDuration_a_f1;
-    u16            wTimeStampOff_b;
-    u16            wTimeStampOff_a;
-
-} TX_AF_G_CTS, *PTX_AF_G_CTS;
-
-typedef struct tagSTX_AF_G_CTS_MIC
-{
-    //RsvTime
-    u16            wCTSTxRrvTime_ba;
-    u16            wReserved2;
-    u16            wTxRrvTime_b;
-    u16            wTxRrvTime_a;
-
-    SMICHDR         sMICHDR;
-
-    //CTS
-    u8            byCTSSignalField_b;
-    u8            byCTSServiceField_b;
-    u16            wCTSTransmitLength_b;
-    u16            wCTSDuration_ba;
-    u16            wReserved3;
-    u16            wCTSDuration_ba_f0;
-    u16            wCTSDuration_ba_f1;
-    SCTSDataF       sCTS;
-
-    //Data
-    u8            bySignalField_b;
-    u8            byServiceField_b;
-    u16            wTransmitLength_b;
-    u8            bySignalField_a;
-    u8            byServiceField_a;
-    u16            wTransmitLength_a;
-    u16            wDuration_b;
-    u16            wDuration_a;
-    u16            wDuration_a_f0;
-    u16            wDuration_a_f1;
-    u16            wTimeStampOff_b;
-    u16            wTimeStampOff_a;
-
-} TX_AF_G_CTS_MIC, *PTX_AF_G_CTS_MIC;
-
-typedef struct tagSTX_AF_A_RTS
-{
-    //RsvTime
-    u16            wRTSTxRrvTime_a;
-    u16            wTxRrvTime_a;
-
-    //RTS
-    u8            byRTSSignalField_a;
-    u8            byRTSServiceField_a;
-    u16            wRTSTransmitLength_a;
-    u16            wRTSDuration_a;
-    u16            wReserved2;
-    u16            wRTSDuration_a_f0;
-    u16            wRTSDuration_a_f1;
-    SRTSDataF       sRTS;
-
-    //Data
-    u8            bySignalField_a;
-    u8            byServiceField_a;
-    u16            wTransmitLength_a;
-    u16            wDuration_a;
-    u16            wTimeStampOff_a;
-    u16            wDuration_a_f0;
-    u16            wDuration_a_f1;
-
-} TX_AF_A_RTS, *PTX_AF_A_RTS;
-
-typedef struct tagSTX_AF_A_RTS_MIC
-{
-    //RsvTime
-    u16            wRTSTxRrvTime_a;
-    u16            wTxRrvTime_a;
-
-    SMICHDR         sMICHDR;
-
-    //RTS
-    u8            byRTSSignalField_a;
-    u8            byRTSServiceField_a;
-    u16            wRTSTransmitLength_a;
-    u16            wRTSDuration_a;
-    u16            wReserved2;
-    u16            wRTSDuration_a_f0;
-    u16            wRTSDuration_a_f1;
-    SRTSDataF       sRTS;
-
-    //Data
-    u8            bySignalField_a;
-    u8            byServiceField_a;
-    u16            wTransmitLength_a;
-    u16            wDuration_a;
-    u16            wTimeStampOff_a;
-    u16            wDuration_a_f0;
-    u16            wDuration_a_f1;
-
-} TX_AF_A_RTS_MIC, *PTX_AF_A_RTS_MIC;
-
-typedef struct tagSTX_AF_A_CTS
-{
-    //RsvTime
-    u16            wReserved2;
-    u16            wTxRrvTime_a;
-
-    //Data
-    u8            bySignalField_a;
-    u8            byServiceField_a;
-    u16            wTransmitLength_a;
-    u16            wDuration_a;
-    u16            wTimeStampOff_a;
-    u16            wDuration_a_f0;
-    u16            wDuration_a_f1;
-
-} TX_AF_A_CTS, *PTX_AF_A_CTS;
-
-typedef struct tagSTX_AF_A_CTS_MIC
-{
-    //RsvTime
-    u16            wReserved2;
-    u16            wTxRrvTime_a;
-
-    SMICHDR         sMICHDR;
-
-    //Data
-    u8            bySignalField_a;
-    u8            byServiceField_a;
-    u16            wTransmitLength_a;
-    u16            wDuration_a;
-    u16            wTimeStampOff_a;
-    u16            wDuration_a_f0;
-    u16            wDuration_a_f1;
-
-} TX_AF_A_CTS_MIC, *PTX_AF_A_CTS_MIC;
-
-//
-// union with all of the TX Buffer Type
-//
-typedef union tagUTX_BUFFER_CONTAINER
-{
-    TX_NAF_G_RTS                    RTS_G;
-    TX_NAF_G_RTS_MIC                RTS_G_MIC;
-    TX_NAF_G_CTS                    CTS_G;
-    TX_NAF_G_CTS_MIC                CTS_G_MIC;
-    //TX_NAF_G_BEACON                 Beacon_G;
-    TX_NAF_AB_RTS                   RTS_AB;
-    TX_NAF_AB_RTS_MIC               RTS_AB_MIC;
-    TX_NAF_AB_CTS                   CTS_AB;
-    TX_NAF_AB_CTS_MIC               CTS_AB_MIC;
-    //TX_NAF_AB_BEACON                Beacon_AB;
-    TX_AF_G_RTS                     RTS_G_AutoFB;
-    TX_AF_G_RTS_MIC                 RTS_G_AutoFB_MIC;
-    TX_AF_G_CTS                     CTS_G_AutoFB;
-    TX_AF_G_CTS_MIC                 CTS_G_AutoFB_MIC;
-    TX_AF_A_RTS                     RTS_A_AutoFB;
-    TX_AF_A_RTS_MIC                 RTS_A_AutoFB_MIC;
-    TX_AF_A_CTS                     CTS_A_AutoFB;
-    TX_AF_A_CTS_MIC                 CTS_A_AutoFB_MIC;
-
-} TX_BUFFER_CONTAINER, *PTX_BUFFER_CONTAINER;
-
-//
-// Remote NDIS message format
-//
 typedef struct tagSTX_BUFFER
 {
     u8                            byType;
@@ -605,15 +43,8 @@ typedef struct tagSTX_BUFFER
     u16                            wTimeStamp;
     u16                            wFragCtl;
     u16                            wReserved;
-
-    // Actual message
-    TX_BUFFER_CONTAINER             BufferHeader;
-
 } __packed TX_BUFFER, *PTX_BUFFER;
 
-//
-// Remote NDIS message format
-//
 typedef struct tagSBEACON_BUFFER
 {
     u8                            byType;
@@ -622,10 +53,6 @@ typedef struct tagSBEACON_BUFFER
 
     u16                            wFIFOCtl;
     u16                            wTimeStamp;
-
-    // Actual message
-    TX_BUFFER_CONTAINER             BufferHeader;
-
 } __packed BEACON_BUFFER, *PBEACON_BUFFER;
 
 void vDMA0_tx_80211(struct vnt_private *, struct sk_buff *skb);
-- 
1.8.1.2



^ permalink raw reply related

* [PATCH v2 rebased] staging: vt6656: rxtx.c s:_uGetDataDuration simplify structure.
From: Malcolm Priestley @ 2013-08-13 18:59 UTC (permalink / raw)
  To: gregkh; +Cc: linux-wireless

A value is only returned when bNeedAck is true.

Only when byDurType == DATADUR_B is different.

Remove switch statement and simplify with if structure.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
 drivers/staging/vt6656/rxtx.c | 50 ++++++++-----------------------------------
 1 file changed, 9 insertions(+), 41 deletions(-)

diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index c8e3e7e8..a701120 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -389,47 +389,15 @@ static u32 s_uGetDataDuration(struct vnt_private *pDevice, u8 byDurType,
 {
 	u32 uAckTime = 0;
 
-    switch (byDurType) {
-
-    case DATADUR_B:    //DATADUR_B
-            if (bNeedAck) {
-            	uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopCCKBasicRate);
-                return (pDevice->uSIFS + uAckTime);
-            } else {
-                return 0;
-            }
-        break;
-
-    case DATADUR_A:    //DATADUR_A
-            if(bNeedAck){
-            	uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate);
-                return (pDevice->uSIFS + uAckTime);
-            } else {
-                return 0;
-            }
-        break;
-
-    case DATADUR_A_F0:    //DATADUR_A_F0
-            if(bNeedAck){
-            	uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate);
-                return (pDevice->uSIFS + uAckTime);
-            } else {
-                return 0;
-            }
-        break;
-
-    case DATADUR_A_F1:    //DATADUR_A_F1
-            if(bNeedAck){
-            	uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate);
-                return (pDevice->uSIFS + uAckTime);
-            } else {
-                return 0;
-            }
-        break;
-
-    default:
-        break;
-    }
+	if (bNeedAck) {
+		if (byDurType == DATADUR_B)
+			uAckTime = BBuGetFrameTime(pDevice->byPreambleType,
+				byPktType, 14, pDevice->byTopCCKBasicRate);
+		else
+			uAckTime = BBuGetFrameTime(pDevice->byPreambleType,
+				byPktType, 14, pDevice->byTopOFDMBasicRate);
+		return pDevice->uSIFS + uAckTime;
+	}
 
 	return 0;
 }
-- 
1.8.1.2



^ permalink raw reply related


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