Linux wireless drivers development
 help / color / mirror / Atom feed
* Re: [PATCH 2/2] ath9k_htc: Fix suspend/resume
From: Luis R. Rodriguez @ 2010-12-07 23:18 UTC (permalink / raw)
  To: John W. Linville; +Cc: Sujith, linux-wireless
In-Reply-To: <20101207194646.GG2700@tuxdriver.com>

On Tue, Dec 7, 2010 at 11:46 AM, John W. Linville
<linville@tuxdriver.com> wrote:
> On Tue, Dec 07, 2010 at 09:39:10AM +0530, Sujith wrote:
>> Luis R. Rodriguez wrote:
>> > Just curious, if you revert this patch and apply the ones I just
>> > posted, does it fix it, or is this patch required either way?
>>
>> Well, I don't see this patch in -testing, -next-2.6 or -2.6.
>> Maybe Linville overlooked this patch.
>
> Obviously I didn't overlook it, or I wouldn't have asked about whether
> or not it should go to 2.6.37...
>
>> Applying 4/5 and 5/5 from your series seems to fix the issue though.
>> I am able to suspend/resume without hiccups with UB95.
>
> But now this begs the question of whether this should be applied at all?

As I reviewed with Johannes the driver must ensure the device remains
idle after we get the last stop() call. So this patch seems fine, I'd
even consider removing the check for the if (!(hif_dev->flags &
HIF_USB_START)) and also call  ath9k_htc_suspend(hif_dev->htc_handle);
upon resume to ensure it is kept in full sleep then as well.

  Luis

^ permalink raw reply

* [PATCH v3 5/5] ath9k_hw: warn if we cannot change the power to the chip
From: Luis R. Rodriguez @ 2010-12-07 23:13 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, amod.bodas, pstew, Luis R. Rodriguez
In-Reply-To: <1291763603-26546-1-git-send-email-lrodriguez@atheros.com>

Suspend requires the device to be in fullsleep otherwise upon
resume the device becomes unresponsive. We need to ensure
that when we want the device to go to sleep it yields to
the request, otherwise we'll have a useless devices upon
resume. Warn when changing the power fails as we need
to look into these issues.

Cc: Paul Stewart <pstew@google.com>
Cc: Amod Bodas <amod.bodas@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
 drivers/net/wireless/ath/ath9k/hw.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 9f4398c..516227f 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1608,6 +1608,13 @@ bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode)
 	}
 	ah->power_mode = mode;
 
+	/*
+	 * XXX: If this warning never comes up after a while then
+	 * simply keep the ATH_DBG_WARN_ON_ONCE() but make
+	 * ath9k_hw_setpower() return type void.
+	 */
+	ATH_DBG_WARN_ON_ONCE(!status);
+
 	return status;
 }
 EXPORT_SYMBOL(ath9k_hw_setpower);
-- 
1.7.3.2.90.gd4c43


^ permalink raw reply related

* [PATCH v3 4/5] ath9k: skip ATH9K_INT_TIM_TIMER when we are idle
From: Luis R. Rodriguez @ 2010-12-07 23:13 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, amod.bodas, pstew, Luis R. Rodriguez
In-Reply-To: <1291763603-26546-1-git-send-email-lrodriguez@atheros.com>

We should not be idle when we get the ATH9K_INT_TIM_TIMER,
otherwise its a sign of something broken in our design with
our idle state machine and mac80211. Skip these and WARN once
just in case this is triggerable.

Cc: Paul Stewart <pstew@google.com>
Cc: Amod Bodas <amod.bodas@atheros.com>
signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
 drivers/net/wireless/ath/ath9k/main.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 669fe6c..5d31eca 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -765,6 +765,8 @@ irqreturn_t ath_isr(int irq, void *dev)
 
 	if (!(ah->caps.hw_caps & ATH9K_HW_CAP_AUTOSLEEP))
 		if (status & ATH9K_INT_TIM_TIMER) {
+			if (ATH_DBG_WARN_ON_ONCE(sc->ps_idle))
+				goto chip_reset;
 			/* Clear RxAbort bit so that we can
 			 * receive frames */
 			ath9k_setpower(sc, ATH9K_PM_AWAKE);
-- 
1.7.3.2.90.gd4c43


^ permalink raw reply related

* [PATCH v3 3/5] ath9k: Make DMA warning in ath_stoprecv WARN_ON_ONCE.
From: Luis R. Rodriguez @ 2010-12-07 23:13 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, amod.bodas, pstew, Ben Greear
In-Reply-To: <1291763603-26546-1-git-send-email-lrodriguez@atheros.com>

From: Ben Greear <greearb@candelatech.com>

This decreases spammage in the log.  A single line message
will still be printed, so users can be aware that problem
exists.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
 drivers/net/wireless/ath/debug.h |   94 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 94 insertions(+), 0 deletions(-)
 create mode 100644 drivers/net/wireless/ath/debug.h

diff --git a/drivers/net/wireless/ath/debug.h b/drivers/net/wireless/ath/debug.h
new file mode 100644
index 0000000..10cf682
--- /dev/null
+++ b/drivers/net/wireless/ath/debug.h
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2008-2009 Atheros Communications Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef ATH_DEBUG_H
+#define ATH_DEBUG_H
+
+#include "ath.h"
+
+/**
+ * enum ath_debug_level - atheros wireless debug level
+ *
+ * @ATH_DBG_RESET: reset processing
+ * @ATH_DBG_QUEUE: hardware queue management
+ * @ATH_DBG_EEPROM: eeprom processing
+ * @ATH_DBG_CALIBRATE: periodic calibration
+ * @ATH_DBG_INTERRUPT: interrupt processing
+ * @ATH_DBG_REGULATORY: regulatory processing
+ * @ATH_DBG_ANI: adaptive noise immunitive processing
+ * @ATH_DBG_XMIT: basic xmit operation
+ * @ATH_DBG_BEACON: beacon handling
+ * @ATH_DBG_CONFIG: configuration of the hardware
+ * @ATH_DBG_FATAL: fatal errors, this is the default, DBG_DEFAULT
+ * @ATH_DBG_PS: power save processing
+ * @ATH_DBG_HWTIMER: hardware timer handling
+ * @ATH_DBG_BTCOEX: bluetooth coexistance
+ * @ATH_DBG_BSTUCK: stuck beacons
+ * @ATH_DBG_ANY: enable all debugging
+ *
+ * The debug level is used to control the amount and type of debugging output
+ * we want to see. Each driver has its own method for enabling debugging and
+ * modifying debug level states -- but this is typically done through a
+ * module parameter 'debug' along with a respective 'debug' debugfs file
+ * entry.
+ */
+enum ATH_DEBUG {
+	ATH_DBG_RESET		= 0x00000001,
+	ATH_DBG_QUEUE		= 0x00000002,
+	ATH_DBG_EEPROM		= 0x00000004,
+	ATH_DBG_CALIBRATE	= 0x00000008,
+	ATH_DBG_INTERRUPT	= 0x00000010,
+	ATH_DBG_REGULATORY	= 0x00000020,
+	ATH_DBG_ANI		= 0x00000040,
+	ATH_DBG_XMIT		= 0x00000080,
+	ATH_DBG_BEACON		= 0x00000100,
+	ATH_DBG_CONFIG		= 0x00000200,
+	ATH_DBG_FATAL		= 0x00000400,
+	ATH_DBG_PS		= 0x00000800,
+	ATH_DBG_HWTIMER		= 0x00001000,
+	ATH_DBG_BTCOEX		= 0x00002000,
+	ATH_DBG_WMI		= 0x00004000,
+	ATH_DBG_BSTUCK		= 0x00008000,
+	ATH_DBG_ANY		= 0xffffffff
+};
+
+#define ATH_DBG_DEFAULT (ATH_DBG_FATAL)
+
+#ifdef CONFIG_ATH_DEBUG
+void ath_print(struct ath_common *common, int dbg_mask, const char *fmt, ...)
+	__attribute__ ((format (printf, 3, 4)));
+#define ATH_DBG_WARN(foo, arg...) WARN(foo, arg)
+#define ATH_DBG_WARN_ON_ONCE(foo) WARN_ON_ONCE(foo)
+#else
+static inline void __attribute__ ((format (printf, 3, 4)))
+ath_print(struct ath_common *common, int dbg_mask, const char *fmt, ...)
+{
+}
+#define ATH_DBG_WARN(foo, arg)
+#define ATH_DBG_WARN_ON_ONCE(foo)
+#endif /* CONFIG_ATH_DEBUG */
+
+/** Returns string describing opmode, or NULL if unknown mode. */
+#ifdef CONFIG_ATH_DEBUG
+const char *ath_opmode_to_string(enum nl80211_iftype opmode);
+#else
+static inline const char *ath_opmode_to_string(enum nl80211_iftype opmode)
+{
+	return "UNKNOWN";
+}
+#endif
+
+#endif /* ATH_DEBUG_H */
-- 
1.7.3.2.90.gd4c43


^ permalink raw reply related

* [PATCH v3 2/5] ath9k: fix assumptions for idle calls on suspend/resume
From: Luis R. Rodriguez @ 2010-12-07 23:13 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, amod.bodas, pstew, Luis R. Rodriguez, stable
In-Reply-To: <1291763603-26546-1-git-send-email-lrodriguez@atheros.com>

mac80211 will notify drivers when to go idle and ath9k
assumed that it would get further notifications for idle
states after a device stop() config call but as per agreed
semantics the idle state of the radio is left up to driver
after mac80211 issues the stop() callback. The driver is
resposnbile for ensuring the device remains idle after
that even between suspend / resume calls.

This fixes suspend/resume when you issue suspend and resume
twice on ath9k when ath9k_stop() was already called. We need
to put the radio to full sleep in order for resume to work
correctly.

What might seem fishy is we are turning the radio off
after resume. The reason why we do this is because we know
we should not have anything enabled after a mac80211 tells
us to stop(), if we resume and never get a start() we won't
get another stop() by mac80211 so to be safe always bring
the 802.11 device with the radio disabled after resume,
this ensures that if we suspend we already have the radio
disabled and only a start() will ever trigger it on.

Cc: stable@kernel.org
Cc: Paul Stewart <pstew@google.com>
Cc: Amod Bodas <amod.bodas@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
 drivers/net/wireless/ath/ath9k/main.c |    4 ++--
 drivers/net/wireless/ath/ath9k/pci.c  |    3 +++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index be19b70..669fe6c 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1330,8 +1330,8 @@ static void ath9k_stop(struct ieee80211_hw *hw)
 
 	ath9k_ps_restore(sc);
 
-	/* Finally, put the chip in FULL SLEEP mode */
-	ath9k_setpower(sc, ATH9K_PM_FULL_SLEEP);
+	sc->ps_idle = true;
+	ath_radio_disable(sc, hw);
 
 	sc->sc_flags |= SC_OP_INVALID;
 
diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c
index 747b287..7ca8499 100644
--- a/drivers/net/wireless/ath/ath9k/pci.c
+++ b/drivers/net/wireless/ath/ath9k/pci.c
@@ -309,6 +309,9 @@ static int ath_pci_resume(struct device *device)
 			    AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
 	ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1);
 
+	sc->ps_idle = true;
+	ath_radio_disable(sc, hw);
+
 	return 0;
 }
 
-- 
1.7.3.2.90.gd4c43


^ permalink raw reply related

* [PATCH v3 1/5] ath9k: Fix power save count imbalance on ath_radio_enable()
From: Luis R. Rodriguez @ 2010-12-07 23:13 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, amod.bodas, pstew, Luis R. Rodriguez, stable
In-Reply-To: <1291763603-26546-1-git-send-email-lrodriguez@atheros.com>

Upon a failure we never call ath9k_ps_restore() on ath_radio_enable(),
this will throw off the sc->ps_usecount. When the sc->ps_usecount
is > 0 we never put the chip to full sleep. This drains battery,
and will also make the chip fail upon resume with:

ath: Starting driver with initial channel: 5745 MHz
ath: timeout (100000 us) on reg 0x7000: 0xdeadbeef & 0x00000003 != 0x00000000

This would make the chip useless upon resume.

I cannot prove this can happen but in theory it is so best to
avoid this race completely and not have users complain about
a broken device after resume.

Cc: stable@kernel.org
Cc: Paul Stewart <pstew@google.com>
Cc: Amod Bodas <amod.bodas@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
 drivers/net/wireless/ath/ath9k/main.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 3e0c8a1..be19b70 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -897,8 +897,7 @@ void ath_radio_enable(struct ath_softc *sc, struct ieee80211_hw *hw)
 	ath_update_txpow(sc);
 	if (ath_startrecv(sc) != 0) {
 		ath_err(common, "Unable to restart recv logic\n");
-		spin_unlock_bh(&sc->sc_pcu_lock);
-		return;
+		goto out;
 	}
 	if (sc->sc_flags & SC_OP_BEACONS)
 		ath_beacon_config(sc, NULL);	/* restart beacons */
@@ -912,6 +911,7 @@ void ath_radio_enable(struct ath_softc *sc, struct ieee80211_hw *hw)
 	ath9k_hw_set_gpio(ah, ah->led_pin, 0);
 
 	ieee80211_wake_queues(hw);
+out:
 	spin_unlock_bh(&sc->sc_pcu_lock);
 
 	ath9k_ps_restore(sc);
-- 
1.7.3.2.90.gd4c43


^ permalink raw reply related

* [PATCH v3 0/5] ath9k: few power save / suspend fixes
From: Luis R. Rodriguez @ 2010-12-07 23:13 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, amod.bodas, pstew, Luis R. Rodriguez

Upon further review with Johannes on the semantics of mac80211's
idle notifications we decided its best to leave it up to the drivers
to ensure idle state after mac80211 issues a stop() callback to
the drivers. This means if you are relying on the IDLE notification
you should not expect it after a stop() callback to disable your
radio. The implications of this means you need to ensure you keep
your 802.11 device idle after stop() and anything in between.

The other patches are a few debug warn once messages which will
only be enabled when you have debugging turned on, I also
integrated Ben's patch into the series as it added the Atheros
debug WARN_ON_ONCE() which I reuse in my other patches..

Ben Greear (1):
  ath9k: Make DMA warning in ath_stoprecv WARN_ON_ONCE.

Luis R. Rodriguez (4):
  ath9k: Fix power save count imbalance on ath_radio_enable()
  ath9k: fix assumptions for idle calls on suspend/resume
  ath9k: skip ATH9K_INT_TIM_TIMER when we are idle
  ath9k_hw: warn if we cannot change the power to the chip

 drivers/net/wireless/ath/ath9k/hw.c   |    7 +++
 drivers/net/wireless/ath/ath9k/main.c |   10 ++--
 drivers/net/wireless/ath/ath9k/pci.c  |    3 +
 drivers/net/wireless/ath/debug.h      |   94 +++++++++++++++++++++++++++++++++
 4 files changed, 110 insertions(+), 4 deletions(-)
 create mode 100644 drivers/net/wireless/ath/debug.h

-- 
1.7.3.2.90.gd4c43


^ permalink raw reply

* [PATCH 1/2] mwifiex: replace struct eth_II_hdr with ethhdr
From: Bing Zhao @ 2010-12-07 23:11 UTC (permalink / raw)
  To: linux-wireless
  Cc: John W. Linville, Johannes Berg, Amitkumar Karwar, Kiran Divekar,
	Frank Huang, Bing Zhao

"struct ethhdr" is defined in include/linux/if_ether.h

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
---
 drivers/net/wireless/mwifiex/fw.h     |    3 +++
 drivers/net/wireless/mwifiex/sta_rx.c |   22 ++++++----------------
 2 files changed, 9 insertions(+), 16 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/fw.h b/drivers/net/wireless/mwifiex/fw.h
index ed691ac..86e8a96 100644
--- a/drivers/net/wireless/mwifiex/fw.h
+++ b/drivers/net/wireless/mwifiex/fw.h
@@ -20,6 +20,9 @@
 #ifndef _MWIFIEX_FW_H_
 #define _MWIFIEX_FW_H_
 
+#include <linux/if_ether.h>
+
+
 #define INTF_HEADER_LEN     4
 
 struct eth_803_hdr {
diff --git a/drivers/net/wireless/mwifiex/sta_rx.c b/drivers/net/wireless/mwifiex/sta_rx.c
index 504c377..022ae4b 100644
--- a/drivers/net/wireless/mwifiex/sta_rx.c
+++ b/drivers/net/wireless/mwifiex/sta_rx.c
@@ -26,16 +26,6 @@
 #include "11n_aggr.h"
 #include "11n_rxreorder.h"
 
-/** Ethernet II header */
-struct eth_II_hdr {
-	/** Ethernet II header destination address */
-	u8 dest_addr[MWIFIEX_MAC_ADDR_LENGTH];
-	/** Ethernet II header source address */
-	u8 src_addr[MWIFIEX_MAC_ADDR_LENGTH];
-	/** Ethernet II header length */
-	u16 ethertype;
-};
-
 /*
  * This function processes the received packet and forwards it
  * to kernel/upper layer.
@@ -58,7 +48,7 @@ mwifiex_process_rx_packet(struct mwifiex_adapter *adapter,
 	struct rx_packet_hdr *rx_pkt_hdr;
 	struct rxpd *local_rx_pd;
 	int hdr_chop;
-	struct eth_II_hdr *eth_hdr;
+	struct ethhdr *eth_hdr;
 	u8 rfc1042_eth_hdr[MWIFIEX_MAC_ADDR_LENGTH] = { 0xaa, 0xaa, 0x03,
 							0x00, 0x00, 0x00 };
 
@@ -114,7 +104,7 @@ mwifiex_process_rx_packet(struct mwifiex_adapter *adapter,
 		 *  To create the Ethernet II, just move the src, dst address
 		 *    right before the snap_type.
 		 */
-		eth_hdr = (struct eth_II_hdr *)
+		eth_hdr = (struct ethhdr *)
 			((u8 *) &rx_pkt_hdr->eth803_hdr
 			 + sizeof(rx_pkt_hdr->eth803_hdr) +
 			 sizeof(rx_pkt_hdr->rfc1042_hdr)
@@ -122,10 +112,10 @@ mwifiex_process_rx_packet(struct mwifiex_adapter *adapter,
 			 - sizeof(rx_pkt_hdr->eth803_hdr.src_addr)
 			 - sizeof(rx_pkt_hdr->rfc1042_hdr.snap_type));
 
-		memcpy(eth_hdr->src_addr, rx_pkt_hdr->eth803_hdr.src_addr,
-		       sizeof(eth_hdr->src_addr));
-		memcpy(eth_hdr->dest_addr, rx_pkt_hdr->eth803_hdr.dest_addr,
-		       sizeof(eth_hdr->dest_addr));
+		memcpy(eth_hdr->h_source, rx_pkt_hdr->eth803_hdr.src_addr,
+		       sizeof(eth_hdr->h_source));
+		memcpy(eth_hdr->h_dest, rx_pkt_hdr->eth803_hdr.dest_addr,
+		       sizeof(eth_hdr->h_dest));
 
 		/* Chop off the rxpd + the excess memory from the 802.2/llc/snap
 		   header that was removed. */
-- 
1.7.0.2


^ permalink raw reply related

* [PATCH 2/2] mwifiex: replace struct eth_803_hdr with ethhdr
From: Bing Zhao @ 2010-12-07 23:11 UTC (permalink / raw)
  To: linux-wireless
  Cc: John W. Linville, Johannes Berg, Amitkumar Karwar, Kiran Divekar,
	Frank Huang, Bing Zhao
In-Reply-To: <1291763515-1203-1-git-send-email-bzhao@marvell.com>

"struct ethhdr" is defined in include/linux/if_ether.h

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
---
 drivers/net/wireless/mwifiex/11n_aggr.c |   24 +++++++++---------------
 drivers/net/wireless/mwifiex/fw.h       |   10 +---------
 drivers/net/wireless/mwifiex/sta_rx.c   |   20 ++++++++++----------
 3 files changed, 20 insertions(+), 34 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/11n_aggr.c b/drivers/net/wireless/mwifiex/11n_aggr.c
index a9a28ed..e100ffc 100644
--- a/drivers/net/wireless/mwifiex/11n_aggr.c
+++ b/drivers/net/wireless/mwifiex/11n_aggr.c
@@ -169,16 +169,10 @@ mwifiex_11n_get_num_aggr_pkts(u8 *data, int total_pkt_len)
 					(data
 					 +
 					 (2 * MWIFIEX_MAC_ADDR_LENGTH))));
-		pad = (((pkt_len + sizeof(struct eth_803_hdr)) & 3)) ? (4 -
-				((pkt_len
-				  +
-				  sizeof
-				  (struct
-				   eth_803_hdr))
-				 & 3)) :
-			0;
-		data += pkt_len + pad + sizeof(struct eth_803_hdr);
-		total_pkt_len -= pkt_len + pad + sizeof(struct eth_803_hdr);
+		pad = (((pkt_len + sizeof(struct ethhdr)) & 3)) ?
+			(4 - ((pkt_len + sizeof(struct ethhdr)) & 3)) : 0;
+		data += pkt_len + pad + sizeof(struct ethhdr);
+		total_pkt_len -= pkt_len + pad + sizeof(struct ethhdr);
 		++pkt_count;
 	}
 
@@ -237,21 +231,21 @@ mwifiex_11n_deaggregate_pkt(struct mwifiex_private *priv,
 			break;
 		}
 
-		pad = (((pkt_len + sizeof(struct eth_803_hdr)) & 3)) ?
-			(4 - ((pkt_len + sizeof(struct eth_803_hdr)) & 3)) : 0;
+		pad = (((pkt_len + sizeof(struct ethhdr)) & 3)) ?
+			(4 - ((pkt_len + sizeof(struct ethhdr)) & 3)) : 0;
 
-		total_pkt_len -= pkt_len + pad + sizeof(struct eth_803_hdr);
+		total_pkt_len -= pkt_len + pad + sizeof(struct ethhdr);
 
 		if (memcmp(&rx_pkt_hdr->rfc1042_hdr,
 			   rfc1042_eth_hdr, sizeof(rfc1042_eth_hdr)) == 0) {
 			memmove(data + LLC_SNAP_LEN, data,
 				(2 * MWIFIEX_MAC_ADDR_LENGTH));
 			data += LLC_SNAP_LEN;
-			pkt_len += sizeof(struct eth_803_hdr) - LLC_SNAP_LEN;
+			pkt_len += sizeof(struct ethhdr) - LLC_SNAP_LEN;
 		} else {
 			*(u16 *) (data + (2 * MWIFIEX_MAC_ADDR_LENGTH))
 				= (u16) 0;
-			pkt_len += sizeof(struct eth_803_hdr);
+			pkt_len += sizeof(struct ethhdr);
 		}
 
 		mbuf_daggr = mwifiex_alloc_buffer(pkt_len);
diff --git a/drivers/net/wireless/mwifiex/fw.h b/drivers/net/wireless/mwifiex/fw.h
index 86e8a96..95b3d2f 100644
--- a/drivers/net/wireless/mwifiex/fw.h
+++ b/drivers/net/wireless/mwifiex/fw.h
@@ -25,25 +25,17 @@
 
 #define INTF_HEADER_LEN     4
 
-struct eth_803_hdr {
-	u8 dest_addr[MWIFIEX_MAC_ADDR_LENGTH];
-	u8 src_addr[MWIFIEX_MAC_ADDR_LENGTH];
-	u16 h803_len;
-};
-
 struct rfc_1042_hdr {
 	u8 llc_dsap;
 	u8 llc_ssap;
 	u8 llc_ctrl;
 	u8 snap_oui[3];
 	u16 snap_type;
-
 };
 
 struct rx_packet_hdr {
-	struct eth_803_hdr eth803_hdr;
+	struct ethhdr eth803_hdr;
 	struct rfc_1042_hdr rfc1042_hdr;
-
 };
 
 #define B_SUPPORTED_RATES               5
diff --git a/drivers/net/wireless/mwifiex/sta_rx.c b/drivers/net/wireless/mwifiex/sta_rx.c
index 022ae4b..47e20ad 100644
--- a/drivers/net/wireless/mwifiex/sta_rx.c
+++ b/drivers/net/wireless/mwifiex/sta_rx.c
@@ -88,10 +88,10 @@ mwifiex_process_rx_packet(struct mwifiex_adapter *adapter,
 	       mbuf->data_len, local_rx_pd->rx_pkt_offset,
 	       mbuf->data_len - local_rx_pd->rx_pkt_offset);
 
-	HEXDUMP("RX Data: Dest", rx_pkt_hdr->eth803_hdr.dest_addr,
-		sizeof(rx_pkt_hdr->eth803_hdr.dest_addr));
-	HEXDUMP("RX Data: Src", rx_pkt_hdr->eth803_hdr.src_addr,
-		sizeof(rx_pkt_hdr->eth803_hdr.src_addr));
+	HEXDUMP("RX Data: Dest", rx_pkt_hdr->eth803_hdr.h_dest,
+		sizeof(rx_pkt_hdr->eth803_hdr.h_dest));
+	HEXDUMP("RX Data: Src", rx_pkt_hdr->eth803_hdr.h_source,
+		sizeof(rx_pkt_hdr->eth803_hdr.h_source));
 
 	if (!memcmp(&rx_pkt_hdr->rfc1042_hdr,
 		    rfc1042_eth_hdr, sizeof(rfc1042_eth_hdr))) {
@@ -108,13 +108,13 @@ mwifiex_process_rx_packet(struct mwifiex_adapter *adapter,
 			((u8 *) &rx_pkt_hdr->eth803_hdr
 			 + sizeof(rx_pkt_hdr->eth803_hdr) +
 			 sizeof(rx_pkt_hdr->rfc1042_hdr)
-			 - sizeof(rx_pkt_hdr->eth803_hdr.dest_addr)
-			 - sizeof(rx_pkt_hdr->eth803_hdr.src_addr)
+			 - sizeof(rx_pkt_hdr->eth803_hdr.h_dest)
+			 - sizeof(rx_pkt_hdr->eth803_hdr.h_source)
 			 - sizeof(rx_pkt_hdr->rfc1042_hdr.snap_type));
 
-		memcpy(eth_hdr->h_source, rx_pkt_hdr->eth803_hdr.src_addr,
+		memcpy(eth_hdr->h_source, rx_pkt_hdr->eth803_hdr.h_source,
 		       sizeof(eth_hdr->h_source));
-		memcpy(eth_hdr->h_dest, rx_pkt_hdr->eth803_hdr.dest_addr,
+		memcpy(eth_hdr->h_dest, rx_pkt_hdr->eth803_hdr.h_dest,
 		       sizeof(eth_hdr->h_dest));
 
 		/* Chop off the rxpd + the excess memory from the 802.2/llc/snap
@@ -217,14 +217,14 @@ mwifiex_process_sta_rx_packet(struct mwifiex_adapter *adapter,
 	 * directly to os. Don't pass thru rx reordering
 	 */
 	if (!IS_11N_ENABLED(priv) ||
-	    memcmp(priv->curr_addr, rx_pkt_hdr->eth803_hdr.dest_addr,
+	    memcmp(priv->curr_addr, rx_pkt_hdr->eth803_hdr.h_dest,
 		   MWIFIEX_MAC_ADDR_LENGTH)) {
 		mwifiex_process_rx_packet(adapter, mbuf);
 		goto done;
 	}
 
 	if (mwifiex_queuing_ra_based(priv)) {
-		memcpy(ta, rx_pkt_hdr->eth803_hdr.src_addr,
+		memcpy(ta, rx_pkt_hdr->eth803_hdr.h_source,
 		       MWIFIEX_MAC_ADDR_LENGTH);
 	} else {
 		if (rx_pkt_type != PKT_TYPE_BAR)
-- 
1.7.0.2


^ permalink raw reply related

* Re: [PATCH 0/4] Make N-PHY support experimental
From: Larry Finger @ 2010-12-07 23:11 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: Gábor Stefanik, linux-wireless, John W. Linville, b43-dev
In-Reply-To: <AANLkTikp9ErFopLZVmXMjN3tXF2L62SwEEcujKeOBLYC@mail.gmail.com>

On 12/07/2010 04:57 PM, Gábor Stefanik wrote:
> 2010/12/7 Rafał Miłecki <zajec5@gmail.com>:
>> Finally, thanks for Larry and Francesco I got b43 working with BCM4328 chipset!
> 
> Do you mean BCM4321 (14e4:4328)? BCM4328 is AFAIK handled by brcmfmac.
> 
>>
>> It's not perfectly stable yet, but scanning and associating to open network
>> works! It has to be tested, improved, there are some PHY errors from time to
>> time, but generally it works :)

With my device:

04:00.0 Network controller [0280]: Broadcom Corporation BCM4321 802.11a/b/g/n
[14e4:4328] (rev 03)
        Subsystem: Hewlett-Packard Company BCM4321 802.11a/b/g/n Wireless LAN
Controller [103c:1366]
        Kernel driver in use: b43-pci-bridge

Excerpt of log:

[ 1184.780924] b43-pci-bridge 0000:04:00.0: PCI INT A -> Link[LK4E] -> GSI 20
(level, low) -> IRQ 20
[ 1184.780945] b43-pci-bridge 0000:04:00.0: setting latency timer to 64
[ 1184.800166] ssb: Core 0 found: ChipCommon (cc 0x800, rev 0x13, vendor 0x4243)
[ 1184.800176] ssb: Core 1 found: IEEE 802.11 (cc 0x812, rev 0x0C, vendor 0x4243)
[ 1184.800184] ssb: Core 2 found: PCI-E (cc 0x820, rev 0x04, vendor 0x4243)
[ 1184.800192] ssb: Core 3 found: PCI (cc 0x804, rev 0x0D, vendor 0x4243)
[ 1184.800200] ssb: Core 4 found: USB 1.1 Host (cc 0x817, rev 0x04, vendor 0x4243)
[ 1184.820062] ssb: Switching to ChipCommon core, index 0
[ 1184.820202] ssb: chipcommon status is 0x0
[ 1184.820211] ssb: SPROM offset is 0x1000
[ 1184.828653] ssb: SPROM revision 5 detected.
[ 1184.848037] ssb: Switching to PCI-E core, index 2
[ 1184.848659] ssb: Sonics Silicon Backplane found on PCI device 0000:04:00.0
[ 1184.897825] b43-phy0: Broadcom 4321 WLAN found (core revision 12)
[ 1184.916062] ssb: Switching to IEEE 802.11 core, index 1
[ 1184.940038] b43-phy0 debug: Found PHY: Analog 5, Type 4, Revision 2
[ 1184.940064] b43-phy0 debug: Found Radio: Manuf 0x17F, Version 0x2055, Revision 4
[ 1184.975224] Registered led device: b43-phy0::tx
[ 1184.978455] Registered led device: b43-phy0::rx
[ 1184.980387] Registered led device: b43-phy0::radio
[ 1185.256050] b43-phy0: Loading firmware version 508.1107 (2009-06-26 19:16:02)
[ 1185.256059] ssb: Switching to ChipCommon core, index 0
[ 1185.256123] ssb: Switching to IEEE 802.11 core, index 1
[ 1185.332045] b43-phy0 debug: Chip initialized
[ 1185.333522] b43-phy0 debug: 64-bit DMA initialized
[ 1185.333570] b43-phy0 debug: QoS enabled
[ 1185.353497] b43-phy0 debug: Wireless interface started
[ 1185.353512] b43-phy0 debug: Adding Interface type 2
[ 1188.041790] b43-phy0 debug: Using hardware based encryption for keyidx: 0,
mac: c0:3f:0e:be:2b:45
[ 1191.134922] b43-phy0 debug: Disabling hardware based encryption for keyidx:
0, mac: c0:3f:0e:be:2b:45
[ 1192.823490] b43-phy0 debug: Using hardware based encryption for keyidx: 0,
mac: ff:ff:ff:ff:ff:ff
[ 1192.824306] b43-phy0 debug: Using hardware based encryption for keyidx: 1,
mac: ff:ff:ff:ff:ff:ff
[ 1192.824630] b43-phy0 debug: Using hardware based encryption for keyidx: 2,
mac: ff:ff:ff:ff:ff:ff
[ 1192.824989] b43-phy0 debug: Using hardware based encryption for keyidx: 3,
mac: ff:ff:ff:ff:ff:ff
[ 1194.896063] b43-phy0 ERROR: PHY transmission error

It connects and authenticates with WEP, but not with WPA2. It appears to be
limited to CCK rates. Setting a rate above 11Mb/s results in complete failure.

Transmit rate is 4.6 Mb/s at 11M. All in all, not bad for first life.

Larry

^ permalink raw reply

* Re: [PATCH] wireless: Remove spurious warning in mlme.c
From: Gábor Stefanik @ 2010-12-07 23:05 UTC (permalink / raw)
  To: greearb; +Cc: linux-wireless
In-Reply-To: <1291759599-14698-1-git-send-email-greearb@candelatech.com>

On Tue, Dec 7, 2010 at 11:06 PM,  <greearb@candelatech.com> wrote:
> From: Ben Greear <greearb@candelatech.com>
>
> Seems that we should not be warning if all of the
> authtry_bsses are already NULL.
>
> Signed-off-by: Ben Greear <greearb@candelatech.com>
> ---
> :100644 100644 d7680f2... 866d016... M  net/wireless/mlme.c
>  net/wireless/mlme.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
> index d7680f2..866d016 100644
> --- a/net/wireless/mlme.c
> +++ b/net/wireless/mlme.c
> @@ -266,7 +266,7 @@ EXPORT_SYMBOL(cfg80211_send_disassoc);
>  static void __cfg80211_auth_remove(struct wireless_dev *wdev, const u8 *addr)
>  {
>        int i;
> -       bool done = false;
> +       bool done = true;
>
>        ASSERT_WDEV_LOCK(wdev);
>
> @@ -277,9 +277,10 @@ static void __cfg80211_auth_remove(struct wireless_dev *wdev, const u8 *addr)
>                        cfg80211_unhold_bss(wdev->authtry_bsses[i]);
>                        cfg80211_put_bss(&wdev->authtry_bsses[i]->pub);
>                        wdev->authtry_bsses[i] = NULL;
> -                       done = true;
>                        break;
>                }
> +               else if (wdev->authtry_bsses[i])
> +                       done = false;

Coding style issues: always put the else on the same line as the
closing brace, and if one branch is braced, both branches should be
so.

>        }
>
>        WARN_ON(!done);
> --
> 1.7.2.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>



-- 
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)

^ permalink raw reply

* Re: [ath9k-devel] [PATCH] ath9k: Make DMA warning in ath_stoprecv WARN_ON_ONCE.
From: Luis R. Rodriguez @ 2010-12-07 23:05 UTC (permalink / raw)
  To: greearb@gmail.com
  Cc: ath9k-devel@venema.h4ckr.net, linux-wireless@vger.kernel.org
In-Reply-To: <AANLkTikDW6d+rTagHzXD_nFA1K7L1sVxEcFGXtrKhHXs@mail.gmail.com>

On Mon, Dec 6, 2010 at 2:02 PM, Luis R. Rodriguez
<lrodriguez@atheros.com> wrote:
> On Mon, Dec 6, 2010 at 1:59 PM, Luis R. Rodriguez
> <lrodriguez@atheros.com> wrote:
>> On Mon, Dec 06, 2010 at 01:13:07PM -0800, greearb@gmail.com wrote:
>>> From: Ben Greear <greearb@candelatech.com>
>>>
>>> This decreases spammage in the log.  A single line message
>>> will still be printed, so users can be aware that problem
>>> exists.
>>>
>>> Signed-off-by: Ben Greear <greearb@candelatech.com>
>>
>> Acked-by: Luis R. Rodriguez <lrodriguez@atheros.com>
>
> You forgot to address linville, and no need to send to ath9k-devel if
> you already know the patch is good.

Ben, your patch did not get merged in today's pick of patches by John
but I like it and want to resuse the same definition in my new patches
so I will resubmit in my new series. Thanks.

  Luis

^ permalink raw reply

* Re: [PATCH 0/4] Make N-PHY support experimental
From: Gábor Stefanik @ 2010-12-07 22:57 UTC (permalink / raw)
  To: Rafał Miłecki; +Cc: linux-wireless, John W. Linville, b43-dev
In-Reply-To: <1291755360-21570-1-git-send-email-zajec5@gmail.com>

2010/12/7 Rafał Miłecki <zajec5@gmail.com>:
> Finally, thanks for Larry and Francesco I got b43 working with BCM4328 chipset!

Do you mean BCM4321 (14e4:4328)? BCM4328 is AFAIK handled by brcmfmac.

>
> It's not perfectly stable yet, but scanning and associating to open network
> works! It has to be tested, improved, there are some PHY errors from time to
> time, but generally it works :)
>
> Rafał Miłecki (4):
>  b43: N-PHY: silence warnings
>  b43: set TMS to work with current band width for N-PHY
>  b43: fix split of N-PHY devices into supported and not (based on PHY
>    rev)
>  b43: rename config option for N-PHY, drop BROKEN
>
>  drivers/net/wireless/b43/Kconfig      |   13 +++++++------
>  drivers/net/wireless/b43/Makefile     |    8 ++++----
>  drivers/net/wireless/b43/main.c       |   12 +++++++++---
>  drivers/net/wireless/b43/phy_common.c |    9 ++++++++-
>  drivers/net/wireless/b43/phy_common.h |    2 ++
>  drivers/net/wireless/b43/phy_n.c      |   16 ++++++----------
>  6 files changed, 36 insertions(+), 24 deletions(-)
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>



-- 
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)

^ permalink raw reply

* [PATCH] wireless: Remove spurious warning in mlme.c
From: greearb @ 2010-12-07 22:06 UTC (permalink / raw)
  To: linux-wireless; +Cc: Ben Greear

From: Ben Greear <greearb@candelatech.com>

Seems that we should not be warning if all of the
authtry_bsses are already NULL.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 d7680f2... 866d016... M	net/wireless/mlme.c
 net/wireless/mlme.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index d7680f2..866d016 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -266,7 +266,7 @@ EXPORT_SYMBOL(cfg80211_send_disassoc);
 static void __cfg80211_auth_remove(struct wireless_dev *wdev, const u8 *addr)
 {
 	int i;
-	bool done = false;
+	bool done = true;
 
 	ASSERT_WDEV_LOCK(wdev);
 
@@ -277,9 +277,10 @@ static void __cfg80211_auth_remove(struct wireless_dev *wdev, const u8 *addr)
 			cfg80211_unhold_bss(wdev->authtry_bsses[i]);
 			cfg80211_put_bss(&wdev->authtry_bsses[i]->pub);
 			wdev->authtry_bsses[i] = NULL;
-			done = true;
 			break;
 		}
+		else if (wdev->authtry_bsses[i])
+			done = false;
 	}
 
 	WARN_ON(!done);
-- 
1.7.2.3


^ permalink raw reply related

* Re: [PATCH] ath5k: Fix modinfo does not list alias -> pci-id lines
From: Sedat Dilek @ 2010-12-07 22:00 UTC (permalink / raw)
  To: wireless, John Linville, Nick Kossifidis; +Cc: LKML, ath5k-devel, Bruno Randolf
In-Reply-To: <AANLkTimhXLc-YkgPg9So71eOeOtDupnkGyZCEzvK6si3@mail.gmail.com>

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

On Tue, Dec 7, 2010 at 10:55 PM, Sedat Dilek <sedat.dilek@googlemail.com> wrote:
> This patch fixes an issue in wirless-next-2.6 / linux-next
> (next-20101207) with ath5k and wrong modinfo output.
>
> - Sedat -
>

Argh, new attempt... Missing "Signed-off-by: ...".

- Sedat -

[-- Attachment #2: 0001-ath5k-Fix-modinfo-does-not-list-alias-pci-id-lines.patch --]
[-- Type: text/x-diff, Size: 1247 bytes --]

From c32080635a52549692ed36126ec0aeb2611d0816 Mon Sep 17 00:00:00 2001
From: Sedat Dilek <sedat.dilek@gmail.com>
Date: Tue, 7 Dec 2010 22:35:50 +0100
Subject: [PATCH] ath5k: Fix modinfo does not list alias -> pci-id lines

The AHB bus support patchset moved the table "Known PCI ids" from base.c
to pci.c - unfortunately, MODULE_DEVICE_TABLE() was not transferred.
With this fix 'modinfo ath5k' lists the alias -> pci-id lines, again.

The issue was introduced by:
   commit e5b046d86fac609f636d127a38de94a175c7e83b
   "ath5k: Move PCI bus functions to separate file."

Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
---
 drivers/net/wireless/ath/ath5k/pci.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/pci.c b/drivers/net/wireless/ath/ath5k/pci.c
index 39f0331..7f8c5b0 100644
--- a/drivers/net/wireless/ath/ath5k/pci.c
+++ b/drivers/net/wireless/ath/ath5k/pci.c
@@ -45,6 +45,7 @@ static DEFINE_PCI_DEVICE_TABLE(ath5k_pci_id_table) = {
 	{ PCI_VDEVICE(ATHEROS, 0x001d) }, /* 2417 Nala */
 	{ 0 }
 };
+MODULE_DEVICE_TABLE(pci, ath5k_pci_id_table);
 
 /* return bus cachesize in 4B word units */
 static void ath5k_pci_read_cachesize(struct ath_common *common, int *csz)
-- 
1.7.2.3


^ permalink raw reply related

* [PATCH] ath5k: Fix modinfo does not list alias -> pci-id lines
From: Sedat Dilek @ 2010-12-07 21:55 UTC (permalink / raw)
  To: wireless, John Linville, Nick Kossifidis; +Cc: LKML, ath5k-devel, Bruno Randolf

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

This patch fixes an issue in wirless-next-2.6 / linux-next
(next-20101207) with ath5k and wrong modinfo output.

- Sedat -

[-- Attachment #2: 0001-ath5k-Fix-modinfo-does-not-list-alias-pci-id-lines.patch --]
[-- Type: text/x-diff, Size: 1195 bytes --]

From 394c3ca4fdc0e8e92d8117c1da2efdc917362c52 Mon Sep 17 00:00:00 2001
From: Sedat Dilek <sedat.dilek@gmail.com>
Date: Tue, 7 Dec 2010 22:35:50 +0100
Subject: [PATCH] ath5k: Fix modinfo does not list alias -> pci-id lines

The AHB bus support patchset moved the table "Known PCI ids" from base.c
to pci.c - unfortunately, MODULE_DEVICE_TABLE() was not transferred.
With this fix 'modinfo ath5k' lists the alias -> pci-id lines, again.

The issue was introduced by:
   commit e5b046d86fac609f636d127a38de94a175c7e83b
   "ath5k: Move PCI bus functions to separate file."
---
 drivers/net/wireless/ath/ath5k/pci.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/pci.c b/drivers/net/wireless/ath/ath5k/pci.c
index 39f0331..7f8c5b0 100644
--- a/drivers/net/wireless/ath/ath5k/pci.c
+++ b/drivers/net/wireless/ath/ath5k/pci.c
@@ -45,6 +45,7 @@ static DEFINE_PCI_DEVICE_TABLE(ath5k_pci_id_table) = {
 	{ PCI_VDEVICE(ATHEROS, 0x001d) }, /* 2417 Nala */
 	{ 0 }
 };
+MODULE_DEVICE_TABLE(pci, ath5k_pci_id_table);
 
 /* return bus cachesize in 4B word units */
 static void ath5k_pci_read_cachesize(struct ath_common *common, int *csz)
-- 
1.7.2.3


^ permalink raw reply related

* Re: [PATCH 1/2] cfg80211: add some element IDs in enum ieee80211_eid
From: Johannes Berg @ 2010-12-07 21:45 UTC (permalink / raw)
  To: Bing Zhao
  Cc: linux-wireless, John W. Linville, Amitkumar Karwar, Kiran Divekar,
	Frank Huang
In-Reply-To: <1291758184-649-1-git-send-email-bzhao@marvell.com>

On Tue, 2010-12-07 at 13:43 -0800, Bing Zhao wrote:
> From: Amitkumar Karwar <akarwar@marvell.com>
> 
> 1)WLAN_EID_BSS_COEX_2040
> 2)WLAN_EID_OVERLAP_BSS_SCAN_PARAM
> 3)WLAN_EID_EXT_CAPABILITY
> 
> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>

I believe this patch can go in regardless of mwifiex status.

johannes


^ permalink raw reply

* Re: [PATCH 1/4] ath: Add and use ath_printk and ath_<level>
From: John W. Linville @ 2010-12-07 21:38 UTC (permalink / raw)
  To: Joe Perches
  Cc: Luis R. Rodriguez, linux-kernel, Peter Stuge, Felix Fietkau,
	linux-wireless, netdev
In-Reply-To: <241e75c84fdd26bfae1c7b8806fe64fbac5de627.1291333544.git.joe@perches.com>

On Thu, Dec 02, 2010 at 07:12:35PM -0800, Joe Perches wrote:
> Add ath_printk and ath_<level> similar to
> dev_printk and dev_<level> from device.h
> 
> This allows a more gradual rename of ath_print
> to to ath_dbg or perhaps ath_debug.
> 
> This basically removes debug.h leaving
> only an #define ath_printk ath_dbg
> there and moving all the ATH_DBG_<foo>
> enums to ath.h
> 
> I do not think there's much purpose for struct
> ath_common * being passed to the ath_printk
> functions, but perhaps there might be.
> 
> Signed-off-by: Joe Perches <joe@perches.com>

> +#define ATH_DBG_WARN(foo, arg...) WARN(foo, arg)
> +
> +#else
> +
> +static inline  __attribute__ ((format (printf, 3, 4))) int
> +ath_dbg(struct ath_common *common, enum ATH_DEBUG dbg_mask,
> +	const char *fmt, ...)
> +{
> +	return 0;
> +}
> +#define ATH_DBG_WARN(foo, arg) do {} while (0)

Missing the "..." after "arg" -- I fixed it up...

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply

* [PATCH 2/2 v2] mwifiex: remove some element ID's definitions
From: Bing Zhao @ 2010-12-07 21:43 UTC (permalink / raw)
  To: linux-wireless
  Cc: John W. Linville, Johannes Berg, Amitkumar Karwar, Kiran Divekar,
	Frank Huang, Bing Zhao
In-Reply-To: <1291758184-649-1-git-send-email-bzhao@marvell.com>

From: Amitkumar Karwar <akarwar@marvell.com>

Those are already defined in include/linux/ieee80211.h
under "enum ieee80211_eid".

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
 drivers/net/wireless/mwifiex/11n.c         |    9 ++--
 drivers/net/wireless/mwifiex/cfg80211.c    |   20 +++----
 drivers/net/wireless/mwifiex/fw.h          |   10 +---
 drivers/net/wireless/mwifiex/ieee.h        |   29 ----------
 drivers/net/wireless/mwifiex/join.c        |   22 ++++----
 drivers/net/wireless/mwifiex/scan.c        |   80 ++++++++++++++-------------
 drivers/net/wireless/mwifiex/sta_cmd.c     |    4 +-
 drivers/net/wireless/mwifiex/sta_cmdresp.c |    4 +-
 drivers/net/wireless/mwifiex/sta_event.c   |    2 +-
 drivers/net/wireless/mwifiex/sta_ioctl.c   |   16 +++---
 drivers/net/wireless/mwifiex/wmm.c         |   12 +++--
 11 files changed, 88 insertions(+), 120 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/11n.c b/drivers/net/wireless/mwifiex/11n.c
index 00ab56c..d1494bf 100644
--- a/drivers/net/wireless/mwifiex/11n.c
+++ b/drivers/net/wireless/mwifiex/11n.c
@@ -829,7 +829,7 @@ mwifiex_cmd_append_11n_tlv(struct mwifiex_private *priv,
 	if (bss_desc->bcn_ht_cap) {
 		ht_cap = (struct mwifiex_ie_types_htcap *) *buffer;
 		memset(ht_cap, 0, sizeof(struct mwifiex_ie_types_htcap));
-		ht_cap->header.type = cpu_to_le16(HT_CAPABILITY);
+		ht_cap->header.type = cpu_to_le16(WLAN_EID_HT_CAPABILITY);
 		ht_cap->header.len = cpu_to_le16(sizeof(struct ieee_htcap));
 		memcpy((u8 *) ht_cap + sizeof(struct mwifiex_ie_types_header),
 		       (u8 *) bss_desc->bcn_ht_cap +
@@ -849,7 +849,8 @@ mwifiex_cmd_append_11n_tlv(struct mwifiex_private *priv,
 			ht_info = (struct mwifiex_ie_types_htinfo *) *buffer;
 			memset(ht_info, 0,
 			       sizeof(struct mwifiex_ie_types_htinfo));
-			ht_info->header.type = cpu_to_le16(HT_OPERATION);
+			ht_info->header.type =
+					cpu_to_le16(WLAN_EID_HT_INFORMATION);
 			ht_info->header.len =
 				cpu_to_le16(sizeof(struct ieee_htinfo));
 
@@ -904,7 +905,7 @@ mwifiex_cmd_append_11n_tlv(struct mwifiex_private *priv,
 		bss_co_2040 = (struct mwifiex_ie_types_2040bssco *) *buffer;
 		memset(bss_co_2040, 0,
 		       sizeof(struct mwifiex_ie_types_2040bssco));
-		bss_co_2040->header.type = cpu_to_le16(BSSCO_2040);
+		bss_co_2040->header.type = cpu_to_le16(WLAN_EID_BSS_COEX_2040);
 		bss_co_2040->header.len =
 		       cpu_to_le16(sizeof(struct ieee_bssco_2040));
 
@@ -923,7 +924,7 @@ mwifiex_cmd_append_11n_tlv(struct mwifiex_private *priv,
 	if (bss_desc->bcn_ext_cap) {
 		ext_cap = (struct mwifiex_ie_types_extcap *) *buffer;
 		memset(ext_cap, 0, sizeof(struct mwifiex_ie_types_extcap));
-		ext_cap->header.type = cpu_to_le16(EXT_CAPABILITY);
+		ext_cap->header.type = cpu_to_le16(WLAN_EID_EXT_CAPABILITY);
 		ext_cap->header.len = cpu_to_le16(sizeof(struct ieee_extcap));
 
 		memcpy((u8 *) ext_cap +
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index d3b2b3e..4a42493 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -1254,7 +1254,7 @@ mwifiex_inform_bss_from_scan_result(struct mwifiex_private *priv,
 	u8 *cap;
 	u8 *beacon;
 	int beacon_size;
-	enum ieee_types_elementid_e element_id;
+	u8 element_id;
 	u8 element_len;
 
 	ENTER();
@@ -1322,10 +1322,8 @@ mwifiex_inform_bss_from_scan_result(struct mwifiex_private *priv,
 
 		while (beacon_size >= sizeof(struct ieee_types_header)) {
 			ie = ie_buf + ie_len;
-			element_id =
-				(enum ieee_types_elementid_e) (*(u8 *)
-							       beacon);
-			element_len = *((u8 *) beacon + 1);
+			element_id = *beacon;
+			element_len = *(beacon + 1);
 			if (beacon_size <
 			    (int) element_len +
 			    sizeof(struct ieee_types_header)) {
@@ -1335,12 +1333,12 @@ mwifiex_inform_bss_from_scan_result(struct mwifiex_private *priv,
 				break;
 			}
 			switch (element_id) {
-			case EXT_CAPABILITY:
-			case DS_PARAM_SET:
-			case HT_CAPABILITY:
-			case VENDOR_SPECIFIC_221:
-			case RSN_IE:
-			case WAPI_IE:
+			case WLAN_EID_EXT_CAPABILITY:
+			case WLAN_EID_DS_PARAMS:
+			case WLAN_EID_HT_CAPABILITY:
+			case WLAN_EID_VENDOR_SPECIFIC:
+			case WLAN_EID_RSN:
+			case WLAN_EID_BSS_AC_ACCESS_DELAY:
 				ie[0] = element_id;
 				ie[1] = element_len;
 				tmp = (u8 *) beacon;
diff --git a/drivers/net/wireless/mwifiex/fw.h b/drivers/net/wireless/mwifiex/fw.h
index bafeafb..ed691ac 100644
--- a/drivers/net/wireless/mwifiex/fw.h
+++ b/drivers/net/wireless/mwifiex/fw.h
@@ -134,14 +134,6 @@ enum MWIFIEX_802_11_WEP_STATUS {
 #define CAL_SNR(RSSI, NF)		((s16)((s16)(RSSI)-(s16)(NF)))
 
 #define PROPRIETARY_TLV_BASE_ID                 0x0100
-#define TLV_TYPE_SSID                           0x0000
-#define TLV_TYPE_RATES                          0x0001
-#define TLV_TYPE_PHY_FH                         0x0002
-#define TLV_TYPE_PHY_DS                         0x0003
-#define TLV_TYPE_CF                             0x0004
-#define TLV_TYPE_IBSS                           0x0006
-#define TLV_TYPE_DOMAIN                         0x0007
-
 #define TLV_TYPE_KEY_MATERIAL       (PROPRIETARY_TLV_BASE_ID + 0)
 #define TLV_TYPE_CHANLIST           (PROPRIETARY_TLV_BASE_ID + 1)
 #define TLV_TYPE_NUMPROBES          (PROPRIETARY_TLV_BASE_ID + 2)
@@ -1006,7 +998,7 @@ struct mwifiex_scan_cmd_config {
 	 *  SSID TLV(s) and ChanList TLVs to be sent in the firmware command
 	 *
 	 *  TLV_TYPE_CHANLIST, mwifiex_ie_types_chan_list_param_set
-	 *  TLV_TYPE_SSID, mwifiex_ie_types_ssid_param_set
+	 *  WLAN_EID_SSID, mwifiex_ie_types_ssid_param_set
 	 */
 	u8 tlv_buf[1];	/* SSID TLV(s) and ChanList TLVs are stored
 				   here */
diff --git a/drivers/net/wireless/mwifiex/ieee.h b/drivers/net/wireless/mwifiex/ieee.h
index 21e4fc2..ed9e03d 100644
--- a/drivers/net/wireless/mwifiex/ieee.h
+++ b/drivers/net/wireless/mwifiex/ieee.h
@@ -32,35 +32,6 @@ enum MWIFIEX_802_11_NETWORK_TYPE {
 
 #define IEEE_MAX_IE_SIZE			256
 
-enum ieee_types_elementid_e {
-	SSID = 0,
-	SUPPORTED_RATES = 1,
-	FH_PARAM_SET = 2,
-	DS_PARAM_SET = 3,
-	CF_PARAM_SET = 4,
-
-	IBSS_PARAM_SET = 6,
-
-	HT_CAPABILITY = 45,
-	HT_OPERATION = 61,
-	BSSCO_2040 = 72,
-	OVERLAP_BSS_SCAN_PARAM = 74,
-	EXT_CAPABILITY = 127,
-
-	ERP_INFO = 42,
-
-	EXTENDED_SUPPORTED_RATES = 50,
-
-	VENDOR_SPECIFIC_221 = 221,
-	WMM_IE = VENDOR_SPECIFIC_221,
-
-	WPS_IE = VENDOR_SPECIFIC_221,
-	WPA_IE = VENDOR_SPECIFIC_221,
-	RSN_IE = 48,
-	VS_IE = VENDOR_SPECIFIC_221,
-	WAPI_IE = 68,
-} __attribute__ ((packed));
-
 struct ieee_types_header {
 	u8 element_id;
 	u8 len;
diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c
index aa26105..917f368 100644
--- a/drivers/net/wireless/mwifiex/join.c
+++ b/drivers/net/wireless/mwifiex/join.c
@@ -387,14 +387,14 @@ mwifiex_cmd_802_11_associate(struct mwifiex_private *priv,
 	pos += sizeof(assoc->dtim_period);
 
 	ssid_tlv = (struct mwifiex_ie_types_ssid_param_set *) pos;
-	ssid_tlv->header.type = cpu_to_le16(TLV_TYPE_SSID);
+	ssid_tlv->header.type = cpu_to_le16(WLAN_EID_SSID);
 	ssid_tlv->header.len = cpu_to_le16((u16) bss_desc->ssid.ssid_len);
 	memcpy(ssid_tlv->ssid, bss_desc->ssid.ssid,
 		le16_to_cpu(ssid_tlv->header.len));
 	pos += sizeof(ssid_tlv->header) + le16_to_cpu(ssid_tlv->header.len);
 
 	phy_tlv = (struct mwifiex_ie_types_phy_param_set *) pos;
-	phy_tlv->header.type = cpu_to_le16(TLV_TYPE_PHY_DS);
+	phy_tlv->header.type = cpu_to_le16(WLAN_EID_DS_PARAMS);
 	phy_tlv->header.len = cpu_to_le16(sizeof(phy_tlv->fh_ds.ds_param_set));
 	memcpy(&phy_tlv->fh_ds.ds_param_set,
 	       &bss_desc->phy_param_set.ds_param_set.current_chan,
@@ -402,7 +402,7 @@ mwifiex_cmd_802_11_associate(struct mwifiex_private *priv,
 	pos += sizeof(phy_tlv->header) + le16_to_cpu(phy_tlv->header.len);
 
 	ss_tlv = (struct mwifiex_ie_types_ss_param_set *) pos;
-	ss_tlv->header.type = cpu_to_le16(TLV_TYPE_CF);
+	ss_tlv->header.type = cpu_to_le16(WLAN_EID_CF_PARAMS);
 	ss_tlv->header.len = cpu_to_le16(sizeof(ss_tlv->cf_ibss.cf_param_set));
 	pos += sizeof(ss_tlv->header) + le16_to_cpu(ss_tlv->header.len);
 
@@ -419,7 +419,7 @@ mwifiex_cmd_802_11_associate(struct mwifiex_private *priv,
 
 	/* Setup the Rates TLV in the association command */
 	rates_tlv = (struct mwifiex_ie_types_rates_param_set *) pos;
-	rates_tlv->header.type = cpu_to_le16(TLV_TYPE_RATES);
+	rates_tlv->header.type = cpu_to_le16(WLAN_EID_SUPP_RATES);
 	rates_tlv->header.len = cpu_to_le16((u16) rates_size);
 	memcpy(rates_tlv->rates, rates, rates_size);
 	pos += sizeof(rates_tlv->header) + rates_size;
@@ -477,7 +477,6 @@ mwifiex_cmd_802_11_associate(struct mwifiex_private *priv,
 					priv->sec_info.wpa2_enabled)) {
 			rsn_ie_tlv =
 				(struct mwifiex_ie_types_rsn_param_set *) pos;
-			/* WPA_IE or WPA2_IE */
 			rsn_ie_tlv->header.type =
 				cpu_to_le16((u16) priv->wpa_ie[0]);
 			rsn_ie_tlv->header.type =
@@ -748,14 +747,15 @@ mwifiex_ret_802_11_associate(struct mwifiex_private *priv,
 	 */
 	mwifiex_update_tsf_timestamps(priv, bss_desc);
 
-	if (bss_desc->wmm_ie.vend_hdr.element_id == WMM_IE)
+	if (bss_desc->wmm_ie.vend_hdr.element_id == WLAN_EID_VENDOR_SPECIFIC)
 		priv->curr_bss_params.wmm_enabled = true;
 	else
 		priv->curr_bss_params.wmm_enabled = false;
 
 	if ((priv->wmm_required
 	     || (bss_desc->bcn_ht_cap &&
-		 (bss_desc->bcn_ht_cap->ieee_hdr.element_id == HT_CAPABILITY))
+		 (bss_desc->bcn_ht_cap->ieee_hdr.element_id ==
+			WLAN_EID_HT_CAPABILITY))
 	    ) && priv->curr_bss_params.wmm_enabled)
 		priv->wmm_enabled = true;
 	else
@@ -1093,7 +1093,6 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
 
 	if (priv->sec_info.wpa_enabled || priv->sec_info.ewpa_enabled) {
 		rsn_ie_tlv = (struct mwifiex_ie_types_rsn_param_set *) pos;
-			/* WPA_IE or  WPA2_IE */
 		rsn_ie_tlv->header.type = cpu_to_le16((u16) priv->wpa_ie[0]);
 		rsn_ie_tlv->header.type =
 			cpu_to_le16(le16_to_cpu(rsn_ie_tlv->header.type)
@@ -1126,7 +1125,8 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
 			ht_cap = (struct mwifiex_ie_types_htcap *) pos;
 			memset(ht_cap, 0,
 			       sizeof(struct mwifiex_ie_types_htcap));
-			ht_cap->header.type = cpu_to_le16(HT_CAPABILITY);
+			ht_cap->header.type =
+				cpu_to_le16(WLAN_EID_HT_CAPABILITY);
 			ht_cap->header.len =
 			       cpu_to_le16(sizeof(struct ieee_htcap));
 			ht_cap_info = le16_to_cpu(ht_cap->ht_cap.ht_cap_info);
@@ -1152,7 +1152,8 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
 			ht_info = (struct mwifiex_ie_types_htinfo *) pos;
 			memset(ht_info, 0,
 			       sizeof(struct mwifiex_ie_types_htinfo));
-			ht_info->header.type = cpu_to_le16(HT_OPERATION);
+			ht_info->header.type =
+				cpu_to_le16(WLAN_EID_HT_INFORMATION);
 			ht_info->header.len =
 				cpu_to_le16(sizeof(struct ieee_htinfo));
 			ht_info->ht_info.pri_chan =
@@ -1351,7 +1352,6 @@ mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv,
 
 	if (priv->sec_info.wpa_enabled) {
 		rsn_ie_tlv = (struct mwifiex_ie_types_rsn_param_set *) pos;
-		/* WPA_IE or WPA2_IE */
 		rsn_ie_tlv->header.type = cpu_to_le16((u16) priv->wpa_ie[0]);
 		rsn_ie_tlv->header.type =
 			cpu_to_le16(le16_to_cpu(rsn_ie_tlv->header.type)
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c
index ddde627..8ed3677 100644
--- a/drivers/net/wireless/mwifiex/scan.c
+++ b/drivers/net/wireless/mwifiex/scan.c
@@ -125,7 +125,7 @@ mwifiex_is_rsn_oui_present(struct mwifiex_bssdescriptor *bss_desc, u32 cipher)
 	u8 ret = MWIFIEX_OUI_NOT_PRESENT;
 
 	if (((bss_desc->bcn_rsn_ie) && ((*(bss_desc->bcn_rsn_ie)).
-					ieee_hdr.element_id == RSN_IE))) {
+					ieee_hdr.element_id == WLAN_EID_RSN))) {
 		iebody =
 			(struct ie_body *)
 			(((u8 *) bss_desc->bcn_rsn_ie->data) +
@@ -153,7 +153,7 @@ mwifiex_is_wpa_oui_present(struct mwifiex_bssdescriptor *bss_desc, u32 cipher)
 	u8 ret = MWIFIEX_OUI_NOT_PRESENT;
 
 	if (((bss_desc->bcn_wpa_ie) && ((*(bss_desc->bcn_wpa_ie)).
-				      vend_hdr.element_id == WPA_IE))) {
+				      vend_hdr.element_id == WLAN_EID_WPA))) {
 		iebody = (struct ie_body *) bss_desc->bcn_wpa_ie->data;
 		oui = &mwifiex_wpa_oui[cipher][0];
 		ret = mwifiex_search_oui_in_ie(iebody, oui);
@@ -396,10 +396,10 @@ mwifiex_is_network_compatible(struct mwifiex_private *priv, u32 index,
 	if ((bss_desc->bss_mode == mode) && priv->sec_info.ewpa_enabled) {
 		if (((bss_desc->bcn_wpa_ie) &&
 		     ((*(bss_desc->bcn_wpa_ie)).vend_hdr.element_id ==
-		     WPA_IE)) ||
+		     WLAN_EID_WPA)) ||
 		    ((bss_desc->bcn_rsn_ie) &&
 		     ((*(bss_desc->bcn_rsn_ie)).ieee_hdr.element_id ==
-		     RSN_IE))) {
+		     WLAN_EID_RSN))) {
 			if (((priv->adapter->config_bands & BAND_GN ||
 			      priv->adapter->config_bands & BAND_AN) &&
 			     bss_desc->bcn_ht_cap)
@@ -433,7 +433,8 @@ mwifiex_is_network_compatible(struct mwifiex_private *priv, u32 index,
 
 	if (priv->sec_info.wapi_enabled &&
 	    (bss_desc->bcn_wapi_ie &&
-	     ((*(bss_desc->bcn_wapi_ie)).ieee_hdr.element_id == WAPI_IE))) {
+	     ((*(bss_desc->bcn_wapi_ie)).ieee_hdr.element_id ==
+			WLAN_EID_BSS_AC_ACCESS_DELAY))) {
 		PRINTM(MINFO, "Return success for WAPI AP\n");
 		LEAVE();
 		return index;
@@ -445,10 +446,10 @@ mwifiex_is_network_compatible(struct mwifiex_private *priv, u32 index,
 		    && !priv->sec_info.wpa2_enabled
 		    && ((!bss_desc->bcn_wpa_ie) ||
 			((*(bss_desc->bcn_wpa_ie)).vend_hdr.element_id !=
-		    WPA_IE))
+		    WLAN_EID_WPA))
 		    && ((!bss_desc->bcn_rsn_ie) ||
 			((*(bss_desc->bcn_rsn_ie)).ieee_hdr.element_id !=
-		    RSN_IE))
+		    WLAN_EID_RSN))
 		    && priv->sec_info.encryption_mode ==
 		    MWIFIEX_ENCRYPTION_MODE_NONE && !bss_desc->privacy) {
 			/* No security */
@@ -470,7 +471,7 @@ mwifiex_is_network_compatible(struct mwifiex_private *priv, u32 index,
 			   && !priv->sec_info.wpa2_enabled
 			   && ((bss_desc->bcn_wpa_ie)
 			       && ((*(bss_desc->bcn_wpa_ie)).vend_hdr.
-				   element_id == WPA_IE))
+				   element_id == WLAN_EID_WPA))
 			   /*
 			    * Privacy bit may NOT be set in some APs like
 			    * LinkSys WRT54G && bss_desc->privacy
@@ -517,7 +518,7 @@ mwifiex_is_network_compatible(struct mwifiex_private *priv, u32 index,
 			   && priv->sec_info.wpa2_enabled
 			   && ((bss_desc->bcn_rsn_ie)
 			       && ((*(bss_desc->bcn_rsn_ie)).ieee_hdr.
-				   element_id == RSN_IE))
+				   element_id == WLAN_EID_RSN))
 			   /*
 			    * Privacy bit may NOT be set in some APs like
 			    * LinkSys WRT54G && bss_desc->privacy
@@ -564,10 +565,10 @@ mwifiex_is_network_compatible(struct mwifiex_private *priv, u32 index,
 			   && !priv->sec_info.wpa2_enabled
 			   && ((!bss_desc->bcn_wpa_ie)
 			       || ((*(bss_desc->bcn_wpa_ie)).vend_hdr.
-				   element_id != WPA_IE))
+				   element_id != WLAN_EID_WPA))
 			   && ((!bss_desc->bcn_rsn_ie)
 			       || ((*(bss_desc->bcn_rsn_ie)).ieee_hdr.
-				   element_id != RSN_IE))
+				   element_id != WLAN_EID_RSN))
 			   && priv->sec_info.encryption_mode ==
 			   MWIFIEX_ENCRYPTION_MODE_NONE && bss_desc->privacy) {
 			/* Ad-hoc AES enabled */
@@ -579,10 +580,10 @@ mwifiex_is_network_compatible(struct mwifiex_private *priv, u32 index,
 			   && !priv->sec_info.wpa2_enabled
 			   && ((!bss_desc->bcn_wpa_ie)
 			       || ((*(bss_desc->bcn_wpa_ie)).vend_hdr.
-				   element_id != WPA_IE))
+				   element_id != WLAN_EID_WPA))
 			   && ((!bss_desc->bcn_rsn_ie)
 			       || ((*(bss_desc->bcn_rsn_ie)).ieee_hdr.
-				   element_id != RSN_IE))
+				   element_id != WLAN_EID_RSN))
 			   && priv->sec_info.encryption_mode !=
 			   MWIFIEX_ENCRYPTION_MODE_NONE && bss_desc->privacy) {
 			/* Dynamic WEP enabled */
@@ -1117,7 +1118,7 @@ mwifiex_scan_setup_scan_config(struct mwifiex_private *priv,
 	rates_size = mwifiex_get_supported_rates(priv, rates);
 
 	rates_tlv = (struct mwifiex_ie_types_rates_param_set *) tlv_pos;
-	rates_tlv->header.type = cpu_to_le16(TLV_TYPE_RATES);
+	rates_tlv->header.type = cpu_to_le16(WLAN_EID_SUPP_RATES);
 	rates_tlv->header.len = cpu_to_le16((u16) rates_size);
 	memcpy(rates_tlv->rates, rates, rates_size);
 	tlv_pos += sizeof(rates_tlv->header) + rates_size;
@@ -1129,7 +1130,7 @@ mwifiex_scan_setup_scan_config(struct mwifiex_private *priv,
 		|| priv->adapter->config_bands & BAND_AN)) {
 		ht_cap = (struct mwifiex_ie_types_htcap *) tlv_pos;
 		memset(ht_cap, 0, sizeof(struct mwifiex_ie_types_htcap));
-		ht_cap->header.type = cpu_to_le16(HT_CAPABILITY);
+		ht_cap->header.type = cpu_to_le16(WLAN_EID_HT_CAPABILITY);
 		ht_cap->header.len = cpu_to_le16(sizeof(struct ieee_htcap));
 		mwifiex_fill_cap_info(priv, ht_cap);
 		HEXDUMP("SCAN: HT_CAPABILITIES IE", (u8 *) ht_cap,
@@ -1328,7 +1329,7 @@ mwifiex_interpret_bss_desc_with_ie(struct mwifiex_adapter *adapter,
 				   u8 **beacon_info, u32 *bytes_left)
 {
 	enum mwifiex_status ret = MWIFIEX_STATUS_SUCCESS;
-	enum ieee_types_elementid_e element_id;
+	u8 element_id;
 	struct ieee_types_fh_param_set *fh_param_set;
 	struct ieee_types_ds_param_set *ds_param_set;
 	struct ieee_types_cf_param_set *cf_param_set;
@@ -1461,10 +1462,8 @@ mwifiex_interpret_bss_desc_with_ie(struct mwifiex_adapter *adapter,
 
 	/* Process variable IE */
 	while (bytes_left_for_current_beacon >= 2) {
-		element_id =
-			(enum
-			 ieee_types_elementid_e) (*((u8 *) current_ptr));
-		element_len = *((u8 *) current_ptr + 1);
+		element_id = *current_ptr;
+		element_len = *(current_ptr + 1);
 		total_ie_len = element_len + sizeof(struct ieee_types_header);
 
 		if (bytes_left_for_current_beacon < total_ie_len) {
@@ -1476,7 +1475,7 @@ mwifiex_interpret_bss_desc_with_ie(struct mwifiex_adapter *adapter,
 		}
 
 		switch (element_id) {
-		case SSID:
+		case WLAN_EID_SSID:
 			bss_entry->ssid.ssid_len = element_len;
 			memcpy(bss_entry->ssid.ssid, (current_ptr + 2),
 			       element_len);
@@ -1484,7 +1483,7 @@ mwifiex_interpret_bss_desc_with_ie(struct mwifiex_adapter *adapter,
 			       bss_entry->ssid.ssid);
 			break;
 
-		case SUPPORTED_RATES:
+		case WLAN_EID_SUPP_RATES:
 			memcpy(bss_entry->data_rates, current_ptr + 2,
 			       element_len);
 			memcpy(bss_entry->supported_rates, current_ptr + 2,
@@ -1495,7 +1494,7 @@ mwifiex_interpret_bss_desc_with_ie(struct mwifiex_adapter *adapter,
 			found_data_rate_ie = true;
 			break;
 
-		case FH_PARAM_SET:
+		case WLAN_EID_FH_PARAMS:
 			fh_param_set =
 				(struct ieee_types_fh_param_set *) current_ptr;
 			bss_entry->network_type_use = MWIFIEX_802_11_FH;
@@ -1504,7 +1503,7 @@ mwifiex_interpret_bss_desc_with_ie(struct mwifiex_adapter *adapter,
 			       sizeof(struct ieee_types_fh_param_set));
 			break;
 
-		case DS_PARAM_SET:
+		case WLAN_EID_DS_PARAMS:
 			ds_param_set =
 				(struct ieee_types_ds_param_set *) current_ptr;
 
@@ -1516,7 +1515,7 @@ mwifiex_interpret_bss_desc_with_ie(struct mwifiex_adapter *adapter,
 			       sizeof(struct ieee_types_ds_param_set));
 			break;
 
-		case CF_PARAM_SET:
+		case WLAN_EID_CF_PARAMS:
 			cf_param_set =
 				(struct ieee_types_cf_param_set *) current_ptr;
 			memcpy(&bss_entry->ss_param_set.cf_param_set,
@@ -1524,7 +1523,7 @@ mwifiex_interpret_bss_desc_with_ie(struct mwifiex_adapter *adapter,
 			       sizeof(struct ieee_types_cf_param_set));
 			break;
 
-		case IBSS_PARAM_SET:
+		case WLAN_EID_IBSS_PARAMS:
 			ibss_param_set =
 				(struct ieee_types_ibss_param_set *)
 				current_ptr;
@@ -1533,12 +1532,12 @@ mwifiex_interpret_bss_desc_with_ie(struct mwifiex_adapter *adapter,
 			       sizeof(struct ieee_types_ibss_param_set));
 			break;
 
-		case ERP_INFO:
+		case WLAN_EID_ERP_INFO:
 			erp_info = (struct ieee_types_erp_info *) current_ptr;
 			bss_entry->erp_flags = erp_info->erp_flags;
 			break;
 
-		case EXTENDED_SUPPORTED_RATES:
+		case WLAN_EID_EXT_SUPP_RATES:
 			/*
 			 * Only process extended supported rate
 			 * if data rate is already found.
@@ -1568,7 +1567,7 @@ mwifiex_interpret_bss_desc_with_ie(struct mwifiex_adapter *adapter,
 				element_len + rate_size);
 			break;
 
-		case VENDOR_SPECIFIC_221:
+		case WLAN_EID_VENDOR_SPECIFIC:
 			vendor_ie =
 				(struct ieee_types_vendor_specific *)
 				current_ptr;
@@ -1582,7 +1581,7 @@ mwifiex_interpret_bss_desc_with_ie(struct mwifiex_adapter *adapter,
 				bss_entry->wpa_offset =
 					(u16) (current_ptr -
 						 bss_entry->beacon_buf);
-				HEXDUMP("InterpretIE: Resp WPA_IE",
+				HEXDUMP("InterpretIE: Resp WLAN_EID_WPA",
 					(u8 *) bss_entry->bcn_wpa_ie,
 					((*(bss_entry->bcn_wpa_ie))
 					.vend_hdr.len +
@@ -1608,29 +1607,30 @@ mwifiex_interpret_bss_desc_with_ie(struct mwifiex_adapter *adapter,
 				}
 			}
 			break;
-		case RSN_IE:
+		case WLAN_EID_RSN:
 			bss_entry->bcn_rsn_ie =
 				(struct ieee_types_generic *) current_ptr;
 			bss_entry->rsn_offset =
 				(u16) (current_ptr -
 					 bss_entry->beacon_buf);
-			HEXDUMP("InterpretIE: Resp RSN_IE",
+			HEXDUMP("InterpretIE: Resp WLAN_EID_RSN",
 				(u8 *) bss_entry->bcn_rsn_ie,
 				(*(bss_entry->bcn_rsn_ie)).ieee_hdr.len +
 				sizeof(struct ieee_types_header));
 			break;
-		case WAPI_IE:
+		case WLAN_EID_BSS_AC_ACCESS_DELAY:
 			bss_entry->bcn_wapi_ie =
 				(struct ieee_types_generic *) current_ptr;
 			bss_entry->wapi_offset =
 				(u16) (current_ptr -
 					 bss_entry->beacon_buf);
-			HEXDUMP("InterpretIE: Resp WAPI_IE",
+			HEXDUMP("InterpretIE: "
+				"Resp WLAN_EID_BSS_AC_ACCESS_DELAY",
 				(u8 *) bss_entry->bcn_wapi_ie,
 				(*(bss_entry->bcn_wapi_ie)).ieee_hdr.len +
 				sizeof(struct ieee_types_header));
 			break;
-		case HT_CAPABILITY:
+		case WLAN_EID_HT_CAPABILITY:
 			bss_entry->bcn_ht_cap =
 				(struct ieee_types_htcap *) current_ptr;
 			bss_entry->ht_cap_offset =
@@ -1641,7 +1641,7 @@ mwifiex_interpret_bss_desc_with_ie(struct mwifiex_adapter *adapter,
 				(*(bss_entry->bcn_ht_cap)).ieee_hdr.len +
 				sizeof(struct ieee_types_header));
 			break;
-		case HT_OPERATION:
+		case WLAN_EID_HT_INFORMATION:
 			bss_entry->bcn_ht_info =
 				(struct ieee_types_htinfo *) current_ptr;
 			bss_entry->ht_info_offset =
@@ -1652,7 +1652,7 @@ mwifiex_interpret_bss_desc_with_ie(struct mwifiex_adapter *adapter,
 				(*(bss_entry->bcn_ht_info)).ieee_hdr.len +
 				sizeof(struct ieee_types_header));
 			break;
-		case BSSCO_2040:
+		case WLAN_EID_BSS_COEX_2040:
 			bss_entry->bcn_bss_co_2040 =
 				(struct ieee_types_2040bssco *) current_ptr;
 			bss_entry->bss_co_2040_offset =
@@ -1663,7 +1663,7 @@ mwifiex_interpret_bss_desc_with_ie(struct mwifiex_adapter *adapter,
 				(*(bss_entry->bcn_bss_co_2040)).ieee_hdr.len +
 				sizeof(struct ieee_types_header));
 			break;
-		case EXT_CAPABILITY:
+		case WLAN_EID_EXT_CAPABILITY:
 			bss_entry->bcn_ext_cap =
 				(struct ieee_types_extcap *) current_ptr;
 			bss_entry->ext_cap_offset =
@@ -1674,7 +1674,7 @@ mwifiex_interpret_bss_desc_with_ie(struct mwifiex_adapter *adapter,
 				(*(bss_entry->bcn_ext_cap)).ieee_hdr.len +
 				sizeof(struct ieee_types_header));
 			break;
-		case OVERLAP_BSS_SCAN_PARAM:
+		case WLAN_EID_OVERLAP_BSS_SCAN_PARAM:
 			bss_entry->bcn_obss_scan =
 				(struct ieee_types_obss_scan_param *)
 				current_ptr;
@@ -1687,6 +1687,8 @@ mwifiex_interpret_bss_desc_with_ie(struct mwifiex_adapter *adapter,
 				ieee_hdr.len +
 				sizeof(struct ieee_types_header));
 			break;
+		default:
+			break;
 		}
 
 		current_ptr += element_len + 2;
diff --git a/drivers/net/wireless/mwifiex/sta_cmd.c b/drivers/net/wireless/mwifiex/sta_cmd.c
index 51206db..955b960 100644
--- a/drivers/net/wireless/mwifiex/sta_cmd.c
+++ b/drivers/net/wireless/mwifiex/sta_cmd.c
@@ -860,7 +860,7 @@ static enum mwifiex_status mwifiex_cmd_802_11_supplicant_pmk(
 	if (psk->ssid.ssid_len) {
 		pssid_tlv = (struct mwifiex_ie_types_ssid_param_set *)
 					ptlv_buffer;
-		pssid_tlv->header.type = cpu_to_le16(TLV_TYPE_SSID);
+		pssid_tlv->header.type = cpu_to_le16(WLAN_EID_SSID);
 		pssid_tlv->header.len = cpu_to_le16((u16)psk->ssid.ssid_len);
 		memcpy((char *)pssid_tlv->ssid, psk->ssid.ssid,
 					psk->ssid.ssid_len);
@@ -984,7 +984,7 @@ mwifiex_cmd_802_11d_domain_info(struct mwifiex_private *priv,
 	}
 
 	/* Set domain info fields */
-	domain->header.type = cpu_to_le16(TLV_TYPE_DOMAIN);
+	domain->header.type = cpu_to_le16(WLAN_EID_COUNTRY);
 	memcpy(domain->country_code,
 			adapter->domain_reg.country_code,
 			sizeof(domain->country_code));
diff --git a/drivers/net/wireless/mwifiex/sta_cmdresp.c b/drivers/net/wireless/mwifiex/sta_cmdresp.c
index 5ae2c8e..ed8e1aa 100644
--- a/drivers/net/wireless/mwifiex/sta_cmdresp.c
+++ b/drivers/net/wireless/mwifiex/sta_cmdresp.c
@@ -877,13 +877,13 @@ mwifiex_ret_802_11_supplicant_pmk(struct mwifiex_private *priv,
 		if (action == HostCmd_ACT_GEN_GET) {
 			while (tlv_buf_len > 0) {
 				tlv = (*tlv_buf) | (*(tlv_buf + 1) << 8);
-				if ((tlv != TLV_TYPE_SSID)
+				if ((tlv != WLAN_EID_SSID)
 						&& (tlv != TLV_TYPE_BSSID)
 						&& (tlv != TLV_TYPE_PASSPHRASE)
 						&& (tlv != TLV_TYPE_PMK))
 					break;
 				switch (tlv) {
-				case TLV_TYPE_SSID:
+				case WLAN_EID_SSID:
 					pssid_tlv =
 						(struct
 						mwifiex_ie_types_ssid_param_set
diff --git a/drivers/net/wireless/mwifiex/sta_event.c b/drivers/net/wireless/mwifiex/sta_event.c
index 005f522..f4384d5 100644
--- a/drivers/net/wireless/mwifiex/sta_event.c
+++ b/drivers/net/wireless/mwifiex/sta_event.c
@@ -162,7 +162,7 @@ mwifiex_2040_coex_event(struct mwifiex_private *priv)
 
 	if (priv->curr_bss_params.bss_descriptor.bcn_obss_scan &&
 	    priv->curr_bss_params.bss_descriptor.bcn_obss_scan->
-	    ieee_hdr.element_id == OVERLAP_BSS_SCAN_PARAM) {
+	    ieee_hdr.element_id == WLAN_EID_OVERLAP_BSS_SCAN_PARAM) {
 		ele_len =
 			priv->curr_bss_params.bss_descriptor.
 			bcn_obss_scan->ieee_hdr.len;
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index 0bcb1ac..cad23c3 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -3182,9 +3182,9 @@ mwifiex_set_wpa_ie_helper(struct mwifiex_private *priv, u8 *ie_data_ptr,
 		PRINTM(MCMND, "Set Wpa_ie_len=%d IE=%#x\n", priv->wpa_ie_len,
 		       priv->wpa_ie[0]);
 		DBG_HEXDUMP(MCMD_D, "Wpa_ie", priv->wpa_ie, priv->wpa_ie_len);
-		if (priv->wpa_ie[0] == WPA_IE) {
+		if (priv->wpa_ie[0] == WLAN_EID_WPA) {
 			priv->sec_info.wpa_enabled = true;
-		} else if (priv->wpa_ie[0] == RSN_IE) {
+		} else if (priv->wpa_ie[0] == WLAN_EID_RSN) {
 			priv->sec_info.wpa2_enabled = true;
 		} else {
 			priv->sec_info.wpa_enabled = false;
@@ -3227,7 +3227,7 @@ mwifiex_set_wapi_ie(struct mwifiex_private *priv, u8 *ie_data_ptr,
 		       priv->wapi_ie[0]);
 		DBG_HEXDUMP(MCMD_D, "wapi_ie", priv->wapi_ie,
 			    priv->wapi_ie_len);
-		if (priv->wapi_ie[0] == WAPI_IE)
+		if (priv->wapi_ie[0] == WLAN_EID_BSS_AC_ACCESS_DELAY)
 			priv->sec_info.wapi_enabled = true;
 	} else {
 		memset(priv->wapi_ie, 0, sizeof(priv->wapi_ie));
@@ -5743,16 +5743,17 @@ mwifiex_set_gen_ie_helper(struct mwifiex_private *priv, u8 *ie_data_ptr,
 	} else {
 		pvendor_ie = (struct ieee_types_vendor_header *) ie_data_ptr;
 		/* Test to see if it is a WPA IE, if not, then it is a gen IE */
-		if (((pvendor_ie->element_id == WPA_IE)
+		if (((pvendor_ie->element_id == WLAN_EID_WPA)
 		     && (!memcmp(pvendor_ie->oui, wpa_oui, sizeof(wpa_oui))))
-		    || (pvendor_ie->element_id == RSN_IE)
+		    || (pvendor_ie->element_id == WLAN_EID_RSN)
 			) {
 
 			/* IE is a WPA/WPA2 IE so call set_wpa function */
 			ret = mwifiex_set_wpa_ie_helper(priv, ie_data_ptr,
 							ie_len);
 			priv->wps.session_enable = false;
-		} else if (pvendor_ie->element_id == WAPI_IE) {
+		} else if (pvendor_ie->element_id ==
+				WLAN_EID_BSS_AC_ACCESS_DELAY) {
 			/* IE is a WAPI IE so call set_wapi function */
 			ret = mwifiex_set_wapi_ie(priv, ie_data_ptr, ie_len);
 		} else {
@@ -5769,7 +5770,8 @@ mwifiex_set_gen_ie_helper(struct mwifiex_private *priv, u8 *ie_data_ptr,
 				pvendor_ie = (struct
 					      ieee_types_vendor_header
 					      *) ie_data_ptr;
-				if ((pvendor_ie->element_id == WPS_IE)
+				if ((pvendor_ie->element_id ==
+						WLAN_EID_VENDOR_SPECIFIC)
 						&& (!memcmp(pvendor_ie->oui,
 						wps_oui, sizeof(wps_oui)))) {
 					priv->wps.session_enable = true;
diff --git a/drivers/net/wireless/mwifiex/wmm.c b/drivers/net/wireless/mwifiex/wmm.c
index 7a47eab..4758151 100644
--- a/drivers/net/wireless/mwifiex/wmm.c
+++ b/drivers/net/wireless/mwifiex/wmm.c
@@ -39,7 +39,7 @@
 #define IPTOS_OFFSET 5
 
 /** WMM information IE */
-static const u8 wmm_info_ie[] = { WMM_IE, 0x07,
+static const u8 wmm_info_ie[] = { WLAN_EID_VENDOR_SPECIFIC, 0x07,
 	0x00, 0x50, 0xf2, 0x02,
 	0x00, 0x01, 0x00
 };
@@ -871,7 +871,7 @@ mwifiex_ret_wmm_get_status(struct mwifiex_private *priv,
 			ac_status->flow_created = tlv_wmm_qstatus->flow_created;
 			break;
 
-		case WMM_IE:
+		case WLAN_EID_VENDOR_SPECIFIC:
 			/*
 			 * Point the regular IEEE IE 2 bytes into the Marvell IE
 			 *   and setup the IEEE IE type and length byte fields
@@ -883,7 +883,8 @@ mwifiex_ret_wmm_get_status(struct mwifiex_private *priv,
 				(struct ieee_types_wmm_parameter *) (curr +
 								    2);
 			wmm_param_ie->vend_hdr.len = (u8) tlv_len;
-			wmm_param_ie->vend_hdr.element_id = WMM_IE;
+			wmm_param_ie->vend_hdr.element_id =
+						WLAN_EID_VENDOR_SPECIFIC;
 
 			PRINTM(MINFO, "CMD_RESP: WMM_GET_STATUS: WMM Parameter "
 					"Set: %d\n",
@@ -950,11 +951,12 @@ mwifiex_wmm_process_association_req(struct mwifiex_private *priv,
 	       wmm_ie->vend_hdr.element_id);
 
 	if ((priv->wmm_required
-	     || (ht_cap && (ht_cap->ieee_hdr.element_id == HT_CAPABILITY)
+	     || (ht_cap && (ht_cap->ieee_hdr.element_id ==
+		WLAN_EID_HT_CAPABILITY)
 		 && (priv->adapter->config_bands & BAND_GN
 		     || priv->adapter->config_bands & BAND_AN))
 	    )
-	    && wmm_ie->vend_hdr.element_id == WMM_IE) {
+	    && wmm_ie->vend_hdr.element_id == WLAN_EID_VENDOR_SPECIFIC) {
 		wmm_tlv = (struct mwifiex_ie_types_wmm_param_set *) *assoc_buf;
 		wmm_tlv->header.type = cpu_to_le16((u16) wmm_info_ie[0]);
 		wmm_tlv->header.len = cpu_to_le16((u16) wmm_info_ie[1]);
-- 
1.7.0.2


^ permalink raw reply related

* [PATCH 1/2] cfg80211: add some element IDs in enum ieee80211_eid
From: Bing Zhao @ 2010-12-07 21:43 UTC (permalink / raw)
  To: linux-wireless
  Cc: John W. Linville, Johannes Berg, Amitkumar Karwar, Kiran Divekar,
	Frank Huang, Bing Zhao

From: Amitkumar Karwar <akarwar@marvell.com>

1)WLAN_EID_BSS_COEX_2040
2)WLAN_EID_OVERLAP_BSS_SCAN_PARAM
3)WLAN_EID_EXT_CAPABILITY

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
---
 include/linux/ieee80211.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index ed5a03c..351c0ab 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -1223,6 +1223,9 @@ enum ieee80211_eid {
 	WLAN_EID_BSS_AC_ACCESS_DELAY = 68,
 	WLAN_EID_RRM_ENABLED_CAPABILITIES = 70,
 	WLAN_EID_MULTIPLE_BSSID = 71,
+	WLAN_EID_BSS_COEX_2040 = 72,
+	WLAN_EID_OVERLAP_BSS_SCAN_PARAM = 74,
+	WLAN_EID_EXT_CAPABILITY = 127,
 
 	WLAN_EID_MOBILITY_DOMAIN = 54,
 	WLAN_EID_FAST_BSS_TRANSITION = 55,
-- 
1.7.0.2


^ permalink raw reply related

* [PATCH 1/3] ath5k: Fix beaconing in mesh mode
From: Javier Cardona @ 2010-12-07 21:35 UTC (permalink / raw)
  To: John W. Linville
  Cc: Javier Cardona, Steve Derosier, devel, linux-wireless, Jiri Slaby,
	Nick Kossifidis, Luis R. Rodriguez, Bob Copeland
In-Reply-To: <20101207205812.GK2700@tuxdriver.com>

This patch fixes the oops below when attempting to bring up a mesh
interface on ath5k hardware.

[  128.933099] kernel BUG at drivers/net/wireless/ath/ath5k/base.c:197!
[  128.933099] invalid opcode: 0000 [#1]
(...)
[  128.933099] Call Trace:
[  128.933099]  [<c83b77fa>] ? ath5k_beacon_update+0x57/0x1f8 [ath5k]
[  128.933099]  [<c02d9a40>] ? __sysfs_add_one+0x28/0x76
[  128.933099]  [<c83b830e>] ? ath5k_bss_info_changed+0x13f/0x173
[ath5k]
[  128.933099]  [<c82ff629>] ? ieee80211_config_beacon+0xc0/0x17e
[mac80211]
[  128.933099]  [<c82f073e>] ?
ieee80211_bss_info_change_notify+0x182/0x18b [mac80211]
[  128.933099]  [<c83b81cf>] ? ath5k_bss_info_changed+0x0/0x173 [ath5k]
[  128.933099]  [<c82ff6d6>] ? ieee80211_config_beacon+0x16d/0x17e
[mac80211]
[  128.933099]  [<c82ff753>] ? ieee80211_add_beacon+0x34/0x39 [mac80211]
[  128.933099]  [<c830a4ed>] ? ieee80211s_init+0xf8/0x10f [mac80211]
[  128.933099]  [<c830a5df>] ? ieee80211_mesh_init_sdata+0xdb/0x154 [mac80211]

Signed-off-by: Javier Cardona <javier@cozybit.com>
---
 drivers/net/wireless/ath/ath5k/base.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 0a7071a..6c35730 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1913,8 +1913,9 @@ ath5k_beacon_send(struct ath5k_softc *sc)
 		/* NB: hw still stops DMA, so proceed */
 	}
 
-	/* refresh the beacon for AP mode */
-	if (sc->opmode == NL80211_IFTYPE_AP)
+	/* refresh the beacon for AP or MESH mode */
+	if (sc->opmode == NL80211_IFTYPE_AP ||
+			sc->opmode == NL80211_IFTYPE_MESH_POINT)
 		ath5k_beacon_update(sc->hw, vif);
 
 	ath5k_hw_set_txdp(ah, sc->bhalq, bf->daddr);
@@ -2977,7 +2978,8 @@ static int ath5k_add_interface(struct ieee80211_hw *hw,
 
 	/* Assign the vap/adhoc to a beacon xmit slot. */
 	if ((avf->opmode == NL80211_IFTYPE_AP) ||
-	    (avf->opmode == NL80211_IFTYPE_ADHOC)) {
+	    (avf->opmode == NL80211_IFTYPE_ADHOC) ||
+	    (avf->opmode == NL80211_IFTYPE_MESH_POINT)) {
 		int slot;
 
 		WARN_ON(list_empty(&sc->bcbuf));
-- 
1.7.1


^ permalink raw reply related

* [PATCH 2/3] ath5k: Prevent mesh interfaces from being counted as ad-hoc
From: Javier Cardona @ 2010-12-07 21:36 UTC (permalink / raw)
  To: John W. Linville
  Cc: Javier Cardona, Steve Derosier, devel, linux-wireless, Jiri Slaby,
	Nick Kossifidis, Luis R. Rodriguez, Bob Copeland
In-Reply-To: <20101207205829.GL2700@tuxdriver.com>

This results in an erroneus num_adhoc_vifs count, as the this counter
was incremented but not decremented for mesh interfaces.

Signed-off-by: Javier Cardona <javier@cozybit.com>
---
 drivers/net/wireless/ath/ath5k/base.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 6c35730..2bf2e28 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -2998,7 +2998,7 @@ static int ath5k_add_interface(struct ieee80211_hw *hw,
 		sc->bslot[avf->bslot] = vif;
 		if (avf->opmode == NL80211_IFTYPE_AP)
 			sc->num_ap_vifs++;
-		else
+		else if (avf->opmode == NL80211_IFTYPE_ADHOC)
 			sc->num_adhoc_vifs++;
 	}
 
-- 
1.7.1


^ permalink raw reply related

* [PATCH 3/3] ath5k: Put the right tsf value in mesh beacons
From: Javier Cardona @ 2010-12-07 21:37 UTC (permalink / raw)
  To: John W. Linville
  Cc: Javier Cardona, Steve Derosier, devel, linux-wireless, Jiri Slaby,
	Nick Kossifidis, Luis R. Rodriguez, Bob Copeland
In-Reply-To: <20101207205751.GJ2700@tuxdriver.com>


Signed-off-by: Javier Cardona <javier@cozybit.com>
---
 drivers/net/wireless/ath/ath5k/base.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 2bf2e28..ac7da50 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1881,7 +1881,8 @@ ath5k_beacon_send(struct ath5k_softc *sc)
 		sc->bmisscount = 0;
 	}
 
-	if (sc->opmode == NL80211_IFTYPE_AP && sc->num_ap_vifs > 1) {
+	if ((sc->opmode == NL80211_IFTYPE_AP && sc->num_ap_vifs > 1) ||
+			sc->opmode == NL80211_IFTYPE_MESH_POINT) {
 		u64 tsf = ath5k_hw_get_tsf64(ah);
 		u32 tsftu = TSF_TO_TU(tsf);
 		int slot = ((tsftu % sc->bintval) * ATH_BCBUF) / sc->bintval;
-- 
1.7.1


^ permalink raw reply related

* Re: [linux-next] next-20101207: Better now, but modinfo ath5k
From: Sedat Dilek @ 2010-12-07 21:32 UTC (permalink / raw)
  To: John W. Linville
  Cc: wireless, LKML, Stephen Rothwell, Nick Kossifidis, Bruno Randolf,
	ath5k-devel
In-Reply-To: <AANLkTi=hUfKWWkwD+MuuZx_B7Th+xc_g-W6OSvU-3dP3@mail.gmail.com>

On Tue, Dec 7, 2010 at 7:13 PM, Sedat Dilek <sedat.dilek@googlemail.com> wrote:
> On Tue, Dec 7, 2010 at 4:59 PM, John W. Linville <linville@tuxdriver.com> wrote:
>> On Tue, Dec 07, 2010 at 04:57:08PM +0100, Sedat Dilek wrote:
>>> On Tue, Dec 7, 2010 at 3:26 PM, John W. Linville <linville@tuxdriver.com> wrote:
>>> > On Tue, Dec 07, 2010 at 12:24:14PM +0100, Sedat Dilek wrote:
>>> >
>>> >> I have already reported on linux-wireless (short: l-w) ML that after
>>> >> especially the merge of "AHB Bus support" patchset (see [2]) my ath5k
>>> >> was not working as expected in daily use (also modinfo).
>>> >>
>>> >> I am not sure if it is the driver but reverting the 9 commits in my
>>> >> local linux-next GIT seemed to "stabilize" a bit the Internet
>>> >> connection.
>>> >> The patchset from Nick (see below) definitely helped to stabilize ath5k.
>>> >
>>> > I imagine that these are the "9 commits" you mean:
>>> >
>>> >> git rev-list c30ae13..4cebb34
>>> > 4cebb34caa5122216a1e2451eae9e0fc47ec2589
>>> > a0b907ee2a71052fefdf6151764095f3f97b3275
>>> > c31b5c9c806b1fbdc9e98885d897664a0d482989
>>> > e7aecd327d80b2f156b54769013aaccb2a20645a
>>> > 8efa5d7d6ad307ae2d220def37ca89594062c40d
>>> > 4aa5d783c9e1c72e4950ff34f388077ccecac74a
>>> > e5b046d86fac609f636d127a38de94a175c7e83b
>>> > 132b1c3ee38ea6fa0501004fd0f19acb554e5a44
>>> > aeae4ac9090462ea38387dcdbac4f01b944af6a4
>>> >
>>> > Most of those look fairly harmless so long as you don't define
>>> > CONFIG_ATHEROS_AR231X.  Just to narrow things down...if you only revert
>>> > the first 8 (i.e. leave aeae4ac alone), do you still have problems?
>>> > Or does it still "stabilize"?
>>> >
>>> > That patch converts the driver to the generic DMA API.  It seems
>>> > OK at first glance, but I suspect it is the only one likely to be
>>> > effecting your situation.
>>> >
>>> > John
>>> > --
>>> > John W. Linville                Someday the world will need a hero, and you
>>> > linville@tuxdriver.com                  might be all we have.  Be ready.
>>> >
>>>
>>> Before jumping to another problem, I had a quick look into the
>>> appropriate Kconfig file, as you say I have not CONFIG_ATHEROS_AR231X
>>> set and that's why AHB support is not selected/built, instead
>>>
>>>   CC [M]  drivers/net/wireless/ath/ath5k/pci.o
>>>
>>> is built.
>>>
>>> Unfortunately, I can't cleanly revert. Sorry, I can't help.
>>
>> I don't quite understand -- you said you were reverting them before,
>> but now I ask you to revert one _less_ patch (i.e. the last one to
>> be reverted anyway) and you can't do it?
>>
>> John
>> --
>> John W. Linville                Someday the world will need a hero, and you
>> linville@tuxdriver.com                  might be all we have.  Be ready.
>>
>
> I tested with a linux-next (next-20101206) with revert-at5k-patches.
> Unfortunately, Nick's patchset is needed for a stable WLAN connection,
> several ReAssoc's etc.
> So, I can't give a comment to the effects of the AHB patchset on my AR5212.
>
> But... I have found the culprit patch which makes modinfo no more list
> the aliases/pci-id (see [1]):
>
> commit e5b046d86fac609f636d127a38de94a175c7e83b
> "ath5k: Move PCI bus functions to separate file."
>
> - Sedat -
>
> [1] http://git.kernel.org/?p=linux/kernel/git/linville/wireless-next-2.6.git;a=commit;h=e5b046d86fac609f636d127a38de94a175c7e83b
>
> $ ~/src/linux-2.6/linux-2.6.37-rc4/debian/build/source_i386_none
>
> $ cat .pc/applied-patches
> revert-ath5k-patches/0001-Revert-ath5k-Fix-reset-and-interrupts-for-AHB-type-o.patch
> revert-ath5k-patches/0002-Revert-ath5k-Add-AHB-bus-support.patch
> revert-ath5k-patches/0003-Revert-ath5k-Add-initial-registers-values-for-radio-.patch
> revert-ath5k-patches/0004-Revert-ath5k-Add-a-function-to-read-chipset-s-MAC-re.patch
> revert-ath5k-patches/0005-Revert-ath5k-Check-if-pci-pdev-struct-is-initialized.patch
> revert-ath5k-patches/0006-Revert-ath5k-Use-generic-eeprom-read-from-common-ath.patch
> revert-ath5k-patches/0007-Revert-ath5k-Move-PCI-bus-functions-to-separate-file.patch
>
> # modinfo ath5k
> filename:
> /lib/modules/2.6.37-rc4-686/kernel/drivers/net/wireless/ath/ath5k/ath5k.ko
> version:        0.6.0 (EXPERIMENTAL)
> license:        Dual BSD/GPL
> description:    Support for 5xxx series of Atheros 802.11 wireless LAN
> cards.
> author:         Nick Kossifidis
> author:         Jiri Slaby
> srcversion:     666105BAEE881F2C2F10CE6
> alias:          pci:v0000168Cd0000001Dsv*sd*bc*sc*i*
> alias:          pci:v0000168Cd0000001Csv*sd*bc*sc*i*
> alias:          pci:v0000168Cd0000001Bsv*sd*bc*sc*i*
> alias:          pci:v0000168Cd0000001Asv*sd*bc*sc*i*
> alias:          pci:v0000168Cd00000019sv*sd*bc*sc*i*
> alias:          pci:v0000168Cd00000018sv*sd*bc*sc*i*
> alias:          pci:v0000168Cd00000017sv*sd*bc*sc*i*
> alias:          pci:v0000168Cd00000016sv*sd*bc*sc*i*
> alias:          pci:v0000168Cd00000015sv*sd*bc*sc*i*
> alias:          pci:v0000168Cd00000014sv*sd*bc*sc*i*
> alias:          pci:v0000168Cd00001014sv*sd*bc*sc*i*
> alias:          pci:v000010B7d00000013sv*sd*bc*sc*i*
> alias:          pci:v0000A727d00000013sv*sd*bc*sc*i*
> alias:          pci:v0000168Cd00000013sv*sd*bc*sc*i*
> alias:          pci:v0000168Cd00000012sv*sd*bc*sc*i*
> alias:          pci:v0000168Cd00000011sv*sd*bc*sc*i*
> alias:          pci:v0000168Cd00000007sv*sd*bc*sc*i*
> alias:          pci:v0000168Cd00000207sv*sd*bc*sc*i*
> depends:        mac80211,cfg80211,ath
> vermagic:       2.6.37-rc4-686 SMP mod_unload modversions 686
> parm:           debug:uint
> parm:           nohwcrypt:Disable hardware encryption. (bool)
> parm:           all_channels:Expose all channels the device can use. (bool)
>

I have found the cause for the modinfo problem, here is a fix (I will
send later a separate patch):

$ diff -Naur drivers/net/wireless/ath/ath5k/pci.c.orig
drivers/net/wireless/ath/ath5k/pci.c
--- drivers/net/wireless/ath/ath5k/pci.c.orig   2010-12-07
19:34:53.999334165 +0100
+++ drivers/net/wireless/ath/ath5k/pci.c        2010-12-07
22:25:20.387028188 +0100
@@ -45,6 +45,7 @@
        { PCI_VDEVICE(ATHEROS, 0x001d) }, /* 2417 Nala */
        { 0 }
 };
+MODULE_DEVICE_TABLE(pci, ath5k_pci_id_table);

 /* return bus cachesize in 4B word units */
 static void ath5k_pci_read_cachesize(struct ath_common *common, int *csz)

# modinfo ath5k
filename:
/lib/modules/2.6.37-rc4-686/kernel/drivers/net/wireless/ath/ath5k/ath5k.ko
version:        0.6.0 (EXPERIMENTAL)
license:        Dual BSD/GPL
description:    Support for 5xxx series of Atheros 802.11 wireless LAN
cards.
author:         Nick Kossifidis
author:         Jiri Slaby
srcversion:     1B224A604952CD0597CA568
alias:          pci:v0000168Cd0000001Dsv*sd*bc*sc*i*
alias:          pci:v0000168Cd0000001Csv*sd*bc*sc*i*
alias:          pci:v0000168Cd0000001Bsv*sd*bc*sc*i*
alias:          pci:v0000168Cd0000001Asv*sd*bc*sc*i*
alias:          pci:v0000168Cd00000019sv*sd*bc*sc*i*
alias:          pci:v0000168Cd00000018sv*sd*bc*sc*i*
alias:          pci:v0000168Cd00000017sv*sd*bc*sc*i*
alias:          pci:v0000168Cd00000016sv*sd*bc*sc*i*
alias:          pci:v0000168Cd00000015sv*sd*bc*sc*i*
alias:          pci:v0000168Cd00000014sv*sd*bc*sc*i*
alias:          pci:v0000168Cd00001014sv*sd*bc*sc*i*
alias:          pci:v000010B7d00000013sv*sd*bc*sc*i*
alias:          pci:v0000A727d00000013sv*sd*bc*sc*i*
alias:          pci:v0000168Cd00000013sv*sd*bc*sc*i*
alias:          pci:v0000168Cd00000012sv*sd*bc*sc*i*
alias:          pci:v0000168Cd00000011sv*sd*bc*sc*i*
alias:          pci:v0000168Cd00000007sv*sd*bc*sc*i*
alias:          pci:v0000168Cd00000207sv*sd*bc*sc*i*
depends:        mac80211,cfg80211,ath
vermagic:       2.6.37-rc4-686 SMP mod_unload modversions 686
parm:           debug:uint
parm:           nohwcrypt:Disable hardware encryption. (bool)
parm:           all_channels:Expose all channels the device can use. (bool)

^ permalink raw reply

* Re: [PATCH 5/5] mac80211: fix issuing idle calls when device open count is 0
From: Luis R. Rodriguez @ 2010-12-07 21:28 UTC (permalink / raw)
  To: Johannes Berg
  Cc: Luis Rodriguez, linville@tuxdriver.com,
	linux-wireless@vger.kernel.org, Amod Bodas, pstew@google.com,
	stable@kernel.org
In-Reply-To: <1291755472.3607.60.camel@jlt3.sipsolutions.net>

On Tue, Dec 07, 2010 at 12:57:52PM -0800, Johannes Berg wrote:
> On Tue, 2010-12-07 at 12:56 -0800, Luis R. Rodriguez wrote:
> 
> > > Not really, since we do scan_cancel() within suspend()... I guess I'd
> > > like to find out why that doesn't do what I think it does.
> > 
> > Well lets see, this is only reproducible with the new DBUS APIs, and
> > frankly I am not sure what these things do. Is it possible we have a
> > race between how it brings down an interface for suspend and canceling
> > a scan?
> 
> But both suspend and do_stop should run under RTNL.

Paul, can you try this instead of these two patches. What this
does is it assumes mac80211 will tell us that stop() implies
to disable the radio as explained in the documentation and that
any further operations will not happen, and that idle settings
prior to mac80211 issuing a start() callback are the responsibility
of the driver to ensure integrity on. Because of this we ensure
idle on stop() as no other interfaces are possible enabled and
we also ensure it to be idle on resume.

diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 97ddb32..eb98f7f 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1337,8 +1337,8 @@ static void ath9k_stop(struct ieee80211_hw *hw)
 
 	ath9k_ps_restore(sc);
 
-	/* Finally, put the chip in FULL SLEEP mode */
-	ath9k_setpower(sc, ATH9K_PM_FULL_SLEEP);
+	sc->ps_idle = true;
+	ath_radio_disable(sc, hw);
 
 	sc->sc_flags |= SC_OP_INVALID;
 
diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c
index 09f69a9..47334f3 100644
--- a/drivers/net/wireless/ath/ath9k/pci.c
+++ b/drivers/net/wireless/ath/ath9k/pci.c
@@ -297,6 +297,9 @@ static int ath_pci_resume(struct device *device)
 			    AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
 	ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1);
 
+	sc->ps_idle = true;
+	ath_radio_disable(sc, hw);
+
 	return 0;
 }
 

^ 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