* Re: [PATCH v2 13/16] wcn36xx: add wcn36xx.h
From: Joe Perches @ 2013-08-23 23:02 UTC (permalink / raw)
To: Eugene Krasnikov; +Cc: linux-wireless, wcn36xx
In-Reply-To: <1377248299-21007-14-git-send-email-k.eugene.e@gmail.com>
On Fri, 2013-08-23 at 10:58 +0200, Eugene Krasnikov wrote:
> Adding wcn36xx.h
[]
> +#define wcn36xx_err(fmt, arg...) \
> + printk(KERN_ERR pr_fmt("ERROR " fmt), ##arg);
> +
> +#define wcn36xx_warn(fmt, arg...) \
> + printk(KERN_WARNING pr_fmt("WARNING " fmt), ##arg)
> +
> +#define wcn36xx_info(fmt, arg...) \
> + printk(KERN_INFO pr_fmt(fmt), ##arg)
> +
I these would be better using:
#define wcn36xx_err(fmt, ...) \
pr_err("ERROR " fmt, ##__VA_ARGS__)
etc...
> +#define wcn36xx_dbg(mask, fmt, arg...) do { \
> + if (debug_mask & mask) \
> + printk(KERN_DEBUG pr_fmt(fmt), ##arg); \
> +} while (0)
And maybe this one using pr_debug so dynamic_debug
can work too.
^ permalink raw reply
* [PATCH 5/5] b43: call PCIe up and down functions
From: Hauke Mehrtens @ 2013-08-23 22:32 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, zajec5, Hauke Mehrtens
In-Reply-To: <1377297154-14525-1-git-send-email-hauke@hauke-m.de>
Tell the PCIe host core when the wifi is activated.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
drivers/net/wireless/b43/main.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 0e933bb..ccd24f0a 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -4645,6 +4645,19 @@ static void b43_wireless_core_exit(struct b43_wldev *dev)
b43_maskset32(dev, B43_MMIO_MACCTL, ~B43_MACCTL_PSM_RUN,
B43_MACCTL_PSM_JMP0);
+ switch (dev->dev->bus_type) {
+#ifdef CONFIG_B43_BCMA
+ case B43_BUS_BCMA:
+ bcma_core_pci_down(dev->dev->bdev->bus);
+ break;
+#endif
+#ifdef CONFIG_B43_SSB
+ case B43_BUS_SSB:
+ /* TODO */
+ break;
+#endif
+ }
+
b43_dma_free(dev);
b43_pio_free(dev);
b43_chip_exit(dev);
@@ -4684,6 +4697,7 @@ static int b43_wireless_core_init(struct b43_wldev *dev)
case B43_BUS_BCMA:
bcma_core_pci_irq_ctl(&dev->dev->bdev->bus->drv_pci[0],
dev->dev->bdev, true);
+ bcma_core_pci_up(dev->dev->bdev->bus);
break;
#endif
#ifdef CONFIG_B43_SSB
--
1.7.10.4
^ permalink raw reply related
* [PATCH 4/5] bcma: add bcma_core_pci_power_save()
From: Hauke Mehrtens @ 2013-08-23 22:32 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, zajec5, Hauke Mehrtens
In-Reply-To: <1377297154-14525-1-git-send-email-hauke@hauke-m.de>
This enables or disables power saving on the PCIe bus when the wifi is
in operation or not.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
drivers/bcma/driver_pci.c | 36 +++++++++++++++++++++++++++++++---
include/linux/bcma/bcma_driver_pci.h | 20 +++++++++++++++++++
2 files changed, 53 insertions(+), 3 deletions(-)
diff --git a/drivers/bcma/driver_pci.c b/drivers/bcma/driver_pci.c
index d51d194..c9fd694 100644
--- a/drivers/bcma/driver_pci.c
+++ b/drivers/bcma/driver_pci.c
@@ -31,7 +31,7 @@ static void bcma_pcie_write(struct bcma_drv_pci *pc, u32 address, u32 data)
pcicore_write32(pc, BCMA_CORE_PCI_PCIEIND_DATA, data);
}
-static void bcma_pcie_mdio_set_phy(struct bcma_drv_pci *pc, u8 phy)
+static void bcma_pcie_mdio_set_phy(struct bcma_drv_pci *pc, u16 phy)
{
u32 v;
int i;
@@ -55,7 +55,7 @@ static void bcma_pcie_mdio_set_phy(struct bcma_drv_pci *pc, u8 phy)
}
}
-static u16 bcma_pcie_mdio_read(struct bcma_drv_pci *pc, u8 device, u8 address)
+static u16 bcma_pcie_mdio_read(struct bcma_drv_pci *pc, u16 device, u8 address)
{
int max_retries = 10;
u16 ret = 0;
@@ -98,7 +98,7 @@ static u16 bcma_pcie_mdio_read(struct bcma_drv_pci *pc, u8 device, u8 address)
return ret;
}
-static void bcma_pcie_mdio_write(struct bcma_drv_pci *pc, u8 device,
+static void bcma_pcie_mdio_write(struct bcma_drv_pci *pc, u16 device,
u8 address, u16 data)
{
int max_retries = 10;
@@ -137,6 +137,13 @@ static void bcma_pcie_mdio_write(struct bcma_drv_pci *pc, u8 device,
pcicore_write32(pc, BCMA_CORE_PCI_MDIO_CONTROL, 0);
}
+static u16 bcma_pcie_mdio_writeread(struct bcma_drv_pci *pc, u16 device,
+ u8 address, u16 data)
+{
+ bcma_pcie_mdio_write(pc, device, address, data);
+ return bcma_pcie_mdio_read(pc, device, address);
+}
+
/**************************************************
* Workarounds.
**************************************************/
@@ -203,6 +210,25 @@ static void bcma_core_pci_config_fixup(struct bcma_drv_pci *pc)
}
}
+static void bcma_core_pci_power_save(struct bcma_drv_pci *pc, bool up)
+{
+ u16 data;
+
+ if (pc->core->id.rev >= 15 && pc->core->id.rev <= 20) {
+ data = up ? 0x74 : 0x7C;
+ bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1,
+ BCMA_CORE_PCI_MDIO_BLK1_MGMT1, 0x7F64);
+ bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1,
+ BCMA_CORE_PCI_MDIO_BLK1_MGMT3, data);
+ } else if (pc->core->id.rev >= 21 && pc->core->id.rev <= 22) {
+ data = up ? 0x75 : 0x7D;
+ bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1,
+ BCMA_CORE_PCI_MDIO_BLK1_MGMT1, 0x7E65);
+ bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1,
+ BCMA_CORE_PCI_MDIO_BLK1_MGMT3, data);
+ }
+}
+
/**************************************************
* Init.
**************************************************/
@@ -284,6 +310,8 @@ void bcma_core_pci_up(struct bcma_bus *bus)
pc = &bus->drv_pci[0];
+ bcma_core_pci_power_save(pc, true);
+
bcma_core_pci_extend_L1timer(pc, true);
}
EXPORT_SYMBOL_GPL(bcma_core_pci_up);
@@ -298,5 +326,7 @@ void bcma_core_pci_down(struct bcma_bus *bus)
pc = &bus->drv_pci[0];
bcma_core_pci_extend_L1timer(pc, false);
+
+ bcma_core_pci_power_save(pc, false);
}
EXPORT_SYMBOL_GPL(bcma_core_pci_down);
diff --git a/include/linux/bcma/bcma_driver_pci.h b/include/linux/bcma/bcma_driver_pci.h
index 0234955..d66033f 100644
--- a/include/linux/bcma/bcma_driver_pci.h
+++ b/include/linux/bcma/bcma_driver_pci.h
@@ -181,6 +181,26 @@ struct pci_dev;
#define BCMA_CORE_PCI_CFG_DEVCTRL 0xd8
+#define BCMA_CORE_PCI_
+
+/* MDIO devices (SERDES modules) */
+#define BCMA_CORE_PCI_MDIO_IEEE0 0x000
+#define BCMA_CORE_PCI_MDIO_IEEE1 0x001
+#define BCMA_CORE_PCI_MDIO_BLK0 0x800
+#define BCMA_CORE_PCI_MDIO_BLK1 0x801
+#define BCMA_CORE_PCI_MDIO_BLK1_MGMT0 0x16
+#define BCMA_CORE_PCI_MDIO_BLK1_MGMT1 0x17
+#define BCMA_CORE_PCI_MDIO_BLK1_MGMT2 0x18
+#define BCMA_CORE_PCI_MDIO_BLK1_MGMT3 0x19
+#define BCMA_CORE_PCI_MDIO_BLK1_MGMT4 0x1A
+#define BCMA_CORE_PCI_MDIO_BLK2 0x802
+#define BCMA_CORE_PCI_MDIO_BLK3 0x803
+#define BCMA_CORE_PCI_MDIO_BLK4 0x804
+#define BCMA_CORE_PCI_MDIO_TXPLL 0x808 /* TXPLL register block idx */
+#define BCMA_CORE_PCI_MDIO_TXCTRL0 0x820
+#define BCMA_CORE_PCI_MDIO_SERDESID 0x831
+#define BCMA_CORE_PCI_MDIO_RXCTRL0 0x840
+
/* PCIE Root Capability Register bits (Host mode only) */
#define BCMA_CORE_PCI_RC_CRS_VISIBILITY 0x0001
--
1.7.10.4
^ permalink raw reply related
* [PATCH 3/5] bcma: do not export bcma_core_pci_extend_L1timer()
From: Hauke Mehrtens @ 2013-08-23 22:32 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, zajec5, Hauke Mehrtens
In-Reply-To: <1377297154-14525-1-git-send-email-hauke@hauke-m.de>
This is not called any more, do not export it.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
drivers/bcma/driver_pci.c | 3 +--
include/linux/bcma/bcma_driver_pci.h | 1 -
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/bcma/driver_pci.c b/drivers/bcma/driver_pci.c
index 6ea817f..d51d194 100644
--- a/drivers/bcma/driver_pci.c
+++ b/drivers/bcma/driver_pci.c
@@ -262,7 +262,7 @@ out:
}
EXPORT_SYMBOL_GPL(bcma_core_pci_irq_ctl);
-void bcma_core_pci_extend_L1timer(struct bcma_drv_pci *pc, bool extend)
+static void bcma_core_pci_extend_L1timer(struct bcma_drv_pci *pc, bool extend)
{
u32 w;
@@ -274,7 +274,6 @@ void bcma_core_pci_extend_L1timer(struct bcma_drv_pci *pc, bool extend)
bcma_pcie_write(pc, BCMA_CORE_PCI_DLLP_PMTHRESHREG, w);
bcma_pcie_read(pc, BCMA_CORE_PCI_DLLP_PMTHRESHREG);
}
-EXPORT_SYMBOL_GPL(bcma_core_pci_extend_L1timer);
void bcma_core_pci_up(struct bcma_bus *bus)
{
diff --git a/include/linux/bcma/bcma_driver_pci.h b/include/linux/bcma/bcma_driver_pci.h
index 27f9ceb..0234955 100644
--- a/include/linux/bcma/bcma_driver_pci.h
+++ b/include/linux/bcma/bcma_driver_pci.h
@@ -220,7 +220,6 @@ struct bcma_drv_pci {
extern void bcma_core_pci_init(struct bcma_drv_pci *pc);
extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc,
struct bcma_device *core, bool enable);
-extern void bcma_core_pci_extend_L1timer(struct bcma_drv_pci *pc, bool extend);
extern void bcma_core_pci_up(struct bcma_bus *bus);
extern void bcma_core_pci_down(struct bcma_bus *bus);
--
1.7.10.4
^ permalink raw reply related
* [PATCH 2/5] brcmsmac: use bcma PCIe up and down functions
From: Hauke Mehrtens @ 2013-08-23 22:32 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, zajec5, Hauke Mehrtens, Arend van Spriel
In-Reply-To: <1377297154-14525-1-git-send-email-hauke@hauke-m.de>
replace the calls to bcma_core_pci_extend_L1timer() by calls to the
newly introduced bcma_core_pci_ip() and bcma_core_pci_down()
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Cc: Arend van Spriel <arend@broadcom.com>
---
drivers/net/wireless/brcm80211/brcmsmac/aiutils.c | 21 ---------------------
drivers/net/wireless/brcm80211/brcmsmac/aiutils.h | 3 ---
drivers/net/wireless/brcm80211/brcmsmac/main.c | 8 ++++----
3 files changed, 4 insertions(+), 28 deletions(-)
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
index e4fd1ee..5336597 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
@@ -679,27 +679,6 @@ bool ai_clkctl_cc(struct si_pub *sih, enum bcma_clkmode mode)
return mode == BCMA_CLKMODE_FAST;
}
-void ai_pci_up(struct si_pub *sih)
-{
- struct si_info *sii;
-
- sii = container_of(sih, struct si_info, pub);
-
- if (sii->icbus->hosttype == BCMA_HOSTTYPE_PCI)
- bcma_core_pci_extend_L1timer(&sii->icbus->drv_pci[0], true);
-}
-
-/* Unconfigure and/or apply various WARs when going down */
-void ai_pci_down(struct si_pub *sih)
-{
- struct si_info *sii;
-
- sii = container_of(sih, struct si_info, pub);
-
- if (sii->icbus->hosttype == BCMA_HOSTTYPE_PCI)
- bcma_core_pci_extend_L1timer(&sii->icbus->drv_pci[0], false);
-}
-
/* Enable BT-COEX & Ex-PA for 4313 */
void ai_epa_4313war(struct si_pub *sih)
{
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h
index 89562c1..a8a267b 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h
+++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h
@@ -183,9 +183,6 @@ extern u16 ai_clkctl_fast_pwrup_delay(struct si_pub *sih);
extern bool ai_clkctl_cc(struct si_pub *sih, enum bcma_clkmode mode);
extern bool ai_deviceremoved(struct si_pub *sih);
-extern void ai_pci_down(struct si_pub *sih);
-extern void ai_pci_up(struct si_pub *sih);
-
/* Enable Ex-PA for 4313 */
extern void ai_epa_4313war(struct si_pub *sih);
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c
index c3c6123..4608e0e 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
@@ -4669,7 +4669,7 @@ static int brcms_b_attach(struct brcms_c_info *wlc, struct bcma_device *core,
brcms_c_coredisable(wlc_hw);
/* Match driver "down" state */
- ai_pci_down(wlc_hw->sih);
+ bcma_core_pci_down(wlc_hw->d11core->bus);
/* turn off pll and xtal to match driver "down" state */
brcms_b_xtal(wlc_hw, OFF);
@@ -5012,12 +5012,12 @@ static int brcms_b_up_prep(struct brcms_hardware *wlc_hw)
*/
if (brcms_b_radio_read_hwdisabled(wlc_hw)) {
/* put SB PCI in down state again */
- ai_pci_down(wlc_hw->sih);
+ bcma_core_pci_down(wlc_hw->d11core->bus);
brcms_b_xtal(wlc_hw, OFF);
return -ENOMEDIUM;
}
- ai_pci_up(wlc_hw->sih);
+ bcma_core_pci_up(wlc_hw->d11core->bus);
/* reset the d11 core */
brcms_b_corereset(wlc_hw, BRCMS_USE_COREFLAGS);
@@ -5214,7 +5214,7 @@ static int brcms_b_down_finish(struct brcms_hardware *wlc_hw)
/* turn off primary xtal and pll */
if (!wlc_hw->noreset) {
- ai_pci_down(wlc_hw->sih);
+ bcma_core_pci_down(wlc_hw->d11core->bus);
brcms_b_xtal(wlc_hw, OFF);
}
}
--
1.7.10.4
^ permalink raw reply related
* [PATCH 1/5] bcma: add method to power up and down the PCIe core by wifi driver
From: Hauke Mehrtens @ 2013-08-23 22:32 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, zajec5, Hauke Mehrtens
The wifi driver should tell the PCIe core that it is now in operation
so that some workarounds can be applied and the power state is changed.
This should replace the call to bcma_core_pci_extend_L1timer by the
brcmsmac driver.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
drivers/bcma/driver_pci.c | 26 ++++++++++++++++++++++++++
include/linux/bcma/bcma_driver_pci.h | 3 +++
2 files changed, 29 insertions(+)
diff --git a/drivers/bcma/driver_pci.c b/drivers/bcma/driver_pci.c
index cf7a476..6ea817f 100644
--- a/drivers/bcma/driver_pci.c
+++ b/drivers/bcma/driver_pci.c
@@ -275,3 +275,29 @@ void bcma_core_pci_extend_L1timer(struct bcma_drv_pci *pc, bool extend)
bcma_pcie_read(pc, BCMA_CORE_PCI_DLLP_PMTHRESHREG);
}
EXPORT_SYMBOL_GPL(bcma_core_pci_extend_L1timer);
+
+void bcma_core_pci_up(struct bcma_bus *bus)
+{
+ struct bcma_drv_pci *pc;
+
+ if (bus->hosttype != BCMA_HOSTTYPE_PCI)
+ return;
+
+ pc = &bus->drv_pci[0];
+
+ bcma_core_pci_extend_L1timer(pc, true);
+}
+EXPORT_SYMBOL_GPL(bcma_core_pci_up);
+
+void bcma_core_pci_down(struct bcma_bus *bus)
+{
+ struct bcma_drv_pci *pc;
+
+ if (bus->hosttype != BCMA_HOSTTYPE_PCI)
+ return;
+
+ pc = &bus->drv_pci[0];
+
+ bcma_core_pci_extend_L1timer(pc, false);
+}
+EXPORT_SYMBOL_GPL(bcma_core_pci_down);
diff --git a/include/linux/bcma/bcma_driver_pci.h b/include/linux/bcma/bcma_driver_pci.h
index 424760f..27f9ceb 100644
--- a/include/linux/bcma/bcma_driver_pci.h
+++ b/include/linux/bcma/bcma_driver_pci.h
@@ -185,6 +185,7 @@ struct pci_dev;
#define BCMA_CORE_PCI_RC_CRS_VISIBILITY 0x0001
struct bcma_drv_pci;
+struct bcma_bus;
#ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE
struct bcma_drv_pci_host {
@@ -220,6 +221,8 @@ extern void bcma_core_pci_init(struct bcma_drv_pci *pc);
extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc,
struct bcma_device *core, bool enable);
extern void bcma_core_pci_extend_L1timer(struct bcma_drv_pci *pc, bool extend);
+extern void bcma_core_pci_up(struct bcma_bus *bus);
+extern void bcma_core_pci_down(struct bcma_bus *bus);
extern int bcma_core_pci_pcibios_map_irq(const struct pci_dev *dev);
extern int bcma_core_pci_plat_dev_init(struct pci_dev *dev);
--
1.7.10.4
^ permalink raw reply related
* [PATCH] bcma: change max PCI read request size to 128
From: Hauke Mehrtens @ 2013-08-23 21:22 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, zajec5, Hauke Mehrtens
This PCIe controller does not support a max read request size above 128
bytes. The sold card I tested this controller with used 128 as default
value, but some new routers are sold with BCM4331 chips, which have a
default max read request size of 512. This device fails at the first
DMA reqeust whch is bigger than 126 bytes.
This patch changes the max read request size to 128 for every device on
the PCIe link.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
drivers/bcma/driver_pci_host.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/bcma/driver_pci_host.c b/drivers/bcma/driver_pci_host.c
index 30629a3..c3d7b03 100644
--- a/drivers/bcma/driver_pci_host.c
+++ b/drivers/bcma/driver_pci_host.c
@@ -581,6 +581,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, bcma_core_pci_fixup_addresses);
int bcma_core_pci_plat_dev_init(struct pci_dev *dev)
{
struct bcma_drv_pci_host *pc_host;
+ int readrq;
if (dev->bus->ops->read != bcma_core_pci_hostmode_read_config) {
/* This is not a device on the PCI-core bridge. */
@@ -595,6 +596,11 @@ int bcma_core_pci_plat_dev_init(struct pci_dev *dev)
dev->irq = bcma_core_irq(pc_host->pdev->core);
pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
+ readrq = pcie_get_readrq(dev);
+ if (readrq > 128) {
+ pr_info("change PCIe max read request size from %i to 128\n", readrq);
+ pcie_set_readrq(dev, 128);
+ }
return 0;
}
EXPORT_SYMBOL(bcma_core_pci_plat_dev_init);
--
1.7.10.4
^ permalink raw reply related
* Re: travelling...
From: Antonio Quartulli @ 2013-08-23 20:16 UTC (permalink / raw)
To: David Miller, netdev, linux-wireless, netfilter-devel
In-Reply-To: <20130823182943.GE808@order.stressinduktion.org>
[-- Attachment #1: Type: text/plain, Size: 814 bytes --]
On Fri, Aug 23, 2013 at 08:29:43PM +0200, Hannes Frederic Sowa wrote:
> On Fri, Aug 23, 2013 at 11:13:08AM -0700, David Miller wrote:
> >
> > I'm travelling over the weekend so I won't be as responsive as
> > usual.
> >
> > I just pushed 'net' to Linus and he pulled it in. I plan to work
> > on my next set of -stable submissions this coming Monday.
> >
> > If a merge of 'net' into 'net-next' would be useful for someone,
> > now would be a really good time to tell me.
>
> If it would not take you too much time, it would be nice. I depend on
> a change in net to make another small patch. :)
If possible I'd need that too in order to send a couple of changes to net-next.
Have a nice weekend!
--
Antonio Quartulli
..each of us alone is worth nothing..
Ernesto "Che" Guevara
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* Problems associating to AP with rtl8192cu driver
From: Mark Cave-Ayland @ 2013-08-23 18:55 UTC (permalink / raw)
To: linux-wireless
Hi all,
I have a RTL8188CUS wireless USB adapter which I've been trying to
unsuccessfully use in WPA mode with the rtl8192cu driver. The adapter
reports itself in lsusb as follows:
0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter
What happens is that the adapter seems to repeatedly authenticate and
associate with the AP without passing data (although a couple of times I
have randomly managed to load a web page if I can catch the timing right).
The relevant excerpt from dmesg looks like this:
kernel: [ 1158.204831] wlan1: Connection to AP f8:d1:11:88:3b:92 lost
kernel: [ 1159.012203] wlan1: authenticate with f8:d1:11:88:3b:92
kernel: [ 1159.025043] wlan1: send auth to f8:d1:11:88:3b:92 (try 1/3)
kernel: [ 1159.127844] wlan1: send auth to f8:d1:11:88:3b:92 (try 2/3)
kernel: [ 1159.231872] wlan1: send auth to f8:d1:11:88:3b:92 (try 3/3)
kernel: [ 1159.335900] wlan1: authentication with f8:d1:11:88:3b:92
timed out
kernel: [ 1165.866451] wlan1: authenticate with f8:d1:11:88:3b:92
kernel: [ 1165.879197] wlan1: send auth to f8:d1:11:88:3b:92 (try 1/3)
kernel: [ 1165.894702] wlan1: authenticated
kernel: [ 1165.897721] wlan1: associate with f8:d1:11:88:3b:92 (try 1/3)
kernel: [ 1165.912581] wlan1: RX AssocResp from f8:d1:11:88:3b:92
(capab=0x431 status=0 aid=1)
kernel: [ 1165.912603] wlan1: associated
kernel: [ 1172.232843] rtlwifi:rtl_watchdog_wq_callback():<0-0> AP off,
try to reconnect now
kernel: [ 1172.232850] wlan1: Connection to AP f8:d1:11:88:3b:92 lost
kernel: [ 1173.044038] wlan1: authenticate with f8:d1:11:88:3b:92
kernel: [ 1173.056683] wlan1: send auth to f8:d1:11:88:3b:92 (try 1/3)
kernel: [ 1173.159669] wlan1: send auth to f8:d1:11:88:3b:92 (try 2/3)
kernel: [ 1173.263696] wlan1: send auth to f8:d1:11:88:3b:92 (try 3/3)
kernel: [ 1173.367724] wlan1: authentication with f8:d1:11:88:3b:92
timed out
kernel: [ 1179.893884] wlan1: authenticate with f8:d1:11:88:3b:92
kernel: [ 1179.906836] wlan1: send auth to f8:d1:11:88:3b:92 (try 1/3)
kernel: [ 1179.912587] wlan1: authenticated
kernel: [ 1179.913534] wlan1: associate with f8:d1:11:88:3b:92 (try 1/3)
kernel: [ 1179.933971] wlan1: RX AssocResp from f8:d1:11:88:3b:92
(capab=0x431 status=0 aid=1)
kernel: [ 1179.933994] wlan1: associated
kernel: [ 1183.428882] wlan1: deauthenticating from f8:d1:11:88:3b:92 by
local choice (reason=3)
kernel: [ 1187.219901] wlan1: authenticate with f8:d1:11:88:3b:92
kernel: [ 1187.234505] wlan1: send auth to f8:d1:11:88:3b:92 (try 1/3)
kernel: [ 1187.240871] wlan1: authenticated
kernel: [ 1187.243514] wlan1: associate with f8:d1:11:88:3b:92 (try 1/3)
kernel: [ 1187.266015] wlan1: RX AssocResp from f8:d1:11:88:3b:92
(capab=0x431 status=0 aid=1)
kernel: [ 1187.266042] wlan1: associated
kernel: [ 1193.818318] usb 4-1.2: USB disconnect, device number 5
kernel: [ 1193.818572] wlan1: deauthenticating from f8:d1:11:88:3b:92 by
local choice (reason=3)
Can anyone provide any hints to debugging the issue? I've just updated
to Linus' latest git master from earlier today and the issue still
appears :(
Many thanks,
Mark.
^ permalink raw reply
* Re: travelling...
From: Hannes Frederic Sowa @ 2013-08-23 18:29 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-wireless, netfilter-devel
In-Reply-To: <20130823.111308.1720597810013400745.davem@davemloft.net>
On Fri, Aug 23, 2013 at 11:13:08AM -0700, David Miller wrote:
>
> I'm travelling over the weekend so I won't be as responsive as
> usual.
>
> I just pushed 'net' to Linus and he pulled it in. I plan to work
> on my next set of -stable submissions this coming Monday.
>
> If a merge of 'net' into 'net-next' would be useful for someone,
> now would be a really good time to tell me.
If it would not take you too much time, it would be nice. I depend on
a change in net to make another small patch. :)
But that is not too important..
Have a nice weekend!
^ permalink raw reply
* travelling...
From: David Miller @ 2013-08-23 18:13 UTC (permalink / raw)
To: netdev; +Cc: linux-wireless, netfilter-devel
I'm travelling over the weekend so I won't be as responsive as
usual.
I just pushed 'net' to Linus and he pulled it in. I plan to work
on my next set of -stable submissions this coming Monday.
If a merge of 'net' into 'net-next' would be useful for someone,
now would be a really good time to tell me.
Thanks.
^ permalink raw reply
* pull request: wireless 2013-08-23
From: John W. Linville @ 2013-08-23 16:20 UTC (permalink / raw)
To: davem; +Cc: linux-wireless, netdev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 11214 bytes --]
Dave,
This is one more set of fixes intended for the 3.11 stream...
For the mac80211 bits, Johannes says:
"I have three more patches for the 3.11 stream: Felix's fix for the
fairly visible brcmsmac crash, a fix from Simon for an IBSS join bug I
found and a fix for a channel context bug in IBSS I'd introduced."
Along with those...
Sujith Manoharan makes a minor change to not use a PLL hang workaroun
for AR9550. This one-liner fixes a couple of bugs reported in the Red Hat
bugzilla.
Helmut Schaa addresses an ath9k_htc bug that mangles frame headers
during Tx. This fix is small, tested by the bug reported and isolated
to ath9k_htc.
Stanislaw Gruszka reverts a recent iwl4965 change that broke rfkill
notification to user space.
Please let me know if there are problems!
Thanks,
John
---
The following changes since commit 4a5a8aa6c966eafc106543bd955ae388230420e5:
ipv4: expose IPV4_DEVCONF (2013-08-22 20:30:15 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless.git for-davem
for you to fetch changes up to 81ca2ff9450c2e983ee416eca17ebe6fa9c3da4f:
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless into for-davem (2013-08-23 11:47:48 -0400)
----------------------------------------------------------------
Felix Fietkau (1):
mac80211: add a flag to indicate CCK support for HT clients
Helmut Schaa (1):
ath9k_htc: Restore skb headroom when returning skb to mac80211
Johannes Berg (1):
mac80211: add missing channel context release
John W. Linville (2):
Merge branch 'for-john' of git://git.kernel.org/.../jberg/mac80211
Merge branch 'master' of git://git.kernel.org/.../linville/wireless into for-davem
Simon Wunderlich (1):
mac80211: ibss: fix ignored channel parameter
Stanislaw Gruszka (1):
iwl4965: fix rfkill set state regression
Sujith Manoharan (1):
ath9k: Enable PLL fix only for AR9340/AR9330
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 10 ++++++++
drivers/net/wireless/ath/ath9k/init.c | 3 ++-
drivers/net/wireless/ath/ath9k/main.c | 3 +--
drivers/net/wireless/ath/carl9170/main.c | 3 ++-
drivers/net/wireless/iwlegacy/4965-mac.c | 2 +-
drivers/net/wireless/rt2x00/rt2800lib.c | 3 ++-
include/net/mac80211.h | 1 +
net/mac80211/ibss.c | 34 +++++++++++++++++++++++----
net/mac80211/rc80211_minstrel_ht.c | 3 +++
9 files changed, 52 insertions(+), 10 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
index e602c95..c028df7 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
@@ -448,6 +448,7 @@ static void ath9k_htc_tx_process(struct ath9k_htc_priv *priv,
struct ieee80211_conf *cur_conf = &priv->hw->conf;
bool txok;
int slot;
+ int hdrlen, padsize;
slot = strip_drv_header(priv, skb);
if (slot < 0) {
@@ -504,6 +505,15 @@ send_mac80211:
ath9k_htc_tx_clear_slot(priv, slot);
+ /* Remove padding before handing frame back to mac80211 */
+ hdrlen = ieee80211_get_hdrlen_from_skb(skb);
+
+ padsize = hdrlen & 3;
+ if (padsize && skb->len > hdrlen + padsize) {
+ memmove(skb->data + padsize, skb->data, hdrlen);
+ skb_pull(skb, padsize);
+ }
+
/* Send status to mac80211 */
ieee80211_tx_status(priv->hw, skb);
}
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index 16f8b20..026a2a0 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -802,7 +802,8 @@ void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
IEEE80211_HW_PS_NULLFUNC_STACK |
IEEE80211_HW_SPECTRUM_MGMT |
IEEE80211_HW_REPORTS_TX_ACK_STATUS |
- IEEE80211_HW_SUPPORTS_RC_TABLE;
+ IEEE80211_HW_SUPPORTS_RC_TABLE |
+ IEEE80211_HW_SUPPORTS_HT_CCK_RATES;
if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT) {
hw->flags |= IEEE80211_HW_AMPDU_AGGREGATION;
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 1737a3e..cb5a655 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -173,8 +173,7 @@ static void ath_restart_work(struct ath_softc *sc)
{
ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work, 0);
- if (AR_SREV_9340(sc->sc_ah) || AR_SREV_9485(sc->sc_ah) ||
- AR_SREV_9550(sc->sc_ah))
+ if (AR_SREV_9340(sc->sc_ah) || AR_SREV_9330(sc->sc_ah))
ieee80211_queue_delayed_work(sc->hw, &sc->hw_pll_work,
msecs_to_jiffies(ATH_PLL_WORK_INTERVAL));
diff --git a/drivers/net/wireless/ath/carl9170/main.c b/drivers/net/wireless/ath/carl9170/main.c
index 4a33c6e..349fa22 100644
--- a/drivers/net/wireless/ath/carl9170/main.c
+++ b/drivers/net/wireless/ath/carl9170/main.c
@@ -1860,7 +1860,8 @@ void *carl9170_alloc(size_t priv_size)
IEEE80211_HW_PS_NULLFUNC_STACK |
IEEE80211_HW_NEED_DTIM_BEFORE_ASSOC |
IEEE80211_HW_SUPPORTS_RC_TABLE |
- IEEE80211_HW_SIGNAL_DBM;
+ IEEE80211_HW_SIGNAL_DBM |
+ IEEE80211_HW_SUPPORTS_HT_CCK_RATES;
if (!modparam_noht) {
/*
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index f2ed62e..7acf5ee 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -4464,9 +4464,9 @@ il4965_irq_tasklet(struct il_priv *il)
set_bit(S_RFKILL, &il->status);
} else {
clear_bit(S_RFKILL, &il->status);
- wiphy_rfkill_set_hw_state(il->hw->wiphy, hw_rf_kill);
il_force_reset(il, true);
}
+ wiphy_rfkill_set_hw_state(il->hw->wiphy, hw_rf_kill);
handled |= CSR_INT_BIT_RF_KILL;
}
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index 1f80ea5..1b41c8e 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -6133,7 +6133,8 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
IEEE80211_HW_SUPPORTS_PS |
IEEE80211_HW_PS_NULLFUNC_STACK |
IEEE80211_HW_AMPDU_AGGREGATION |
- IEEE80211_HW_REPORTS_TX_ACK_STATUS;
+ IEEE80211_HW_REPORTS_TX_ACK_STATUS |
+ IEEE80211_HW_SUPPORTS_HT_CCK_RATES;
/*
* Don't set IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING for USB devices
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 5b7a3da..551ba6a 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1499,6 +1499,7 @@ enum ieee80211_hw_flags {
IEEE80211_HW_SUPPORTS_RC_TABLE = 1<<24,
IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF = 1<<25,
IEEE80211_HW_TIMING_BEACON_ONLY = 1<<26,
+ IEEE80211_HW_SUPPORTS_HT_CCK_RATES = 1<<27,
};
/**
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index ea7b9c2..2d45643 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -36,7 +36,7 @@
static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
const u8 *bssid, const int beacon_int,
- struct ieee80211_channel *chan,
+ struct cfg80211_chan_def *req_chandef,
const u32 basic_rates,
const u16 capability, u64 tsf,
bool creator)
@@ -51,6 +51,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
u32 bss_change;
u8 supp_rates[IEEE80211_MAX_SUPP_RATES];
struct cfg80211_chan_def chandef;
+ struct ieee80211_channel *chan;
struct beacon_data *presp;
int frame_len;
@@ -81,7 +82,9 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
sdata->drop_unencrypted = capability & WLAN_CAPABILITY_PRIVACY ? 1 : 0;
- chandef = ifibss->chandef;
+ /* make a copy of the chandef, it could be modified below. */
+ chandef = *req_chandef;
+ chan = chandef.chan;
if (!cfg80211_reg_can_beacon(local->hw.wiphy, &chandef)) {
chandef.width = NL80211_CHAN_WIDTH_20;
chandef.center_freq1 = chan->center_freq;
@@ -259,10 +262,12 @@ static void ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
struct cfg80211_bss *cbss =
container_of((void *)bss, struct cfg80211_bss, priv);
struct ieee80211_supported_band *sband;
+ struct cfg80211_chan_def chandef;
u32 basic_rates;
int i, j;
u16 beacon_int = cbss->beacon_interval;
const struct cfg80211_bss_ies *ies;
+ enum nl80211_channel_type chan_type;
u64 tsf;
sdata_assert_lock(sdata);
@@ -270,6 +275,26 @@ static void ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
if (beacon_int < 10)
beacon_int = 10;
+ switch (sdata->u.ibss.chandef.width) {
+ case NL80211_CHAN_WIDTH_20_NOHT:
+ case NL80211_CHAN_WIDTH_20:
+ case NL80211_CHAN_WIDTH_40:
+ chan_type = cfg80211_get_chandef_type(&sdata->u.ibss.chandef);
+ cfg80211_chandef_create(&chandef, cbss->channel, chan_type);
+ break;
+ case NL80211_CHAN_WIDTH_5:
+ case NL80211_CHAN_WIDTH_10:
+ cfg80211_chandef_create(&chandef, cbss->channel,
+ NL80211_CHAN_WIDTH_20_NOHT);
+ chandef.width = sdata->u.ibss.chandef.width;
+ break;
+ default:
+ /* fall back to 20 MHz for unsupported modes */
+ cfg80211_chandef_create(&chandef, cbss->channel,
+ NL80211_CHAN_WIDTH_20_NOHT);
+ break;
+ }
+
sband = sdata->local->hw.wiphy->bands[cbss->channel->band];
basic_rates = 0;
@@ -294,7 +319,7 @@ static void ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
__ieee80211_sta_join_ibss(sdata, cbss->bssid,
beacon_int,
- cbss->channel,
+ &chandef,
basic_rates,
cbss->capability,
tsf, false);
@@ -736,7 +761,7 @@ static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata)
sdata->drop_unencrypted = 0;
__ieee80211_sta_join_ibss(sdata, bssid, sdata->vif.bss_conf.beacon_int,
- ifibss->chandef.chan, ifibss->basic_rates,
+ &ifibss->chandef, ifibss->basic_rates,
capability, 0, true);
}
@@ -1138,6 +1163,7 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata)
clear_bit(SDATA_STATE_OFFCHANNEL_BEACON_STOPPED, &sdata->state);
ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON_ENABLED |
BSS_CHANGED_IBSS);
+ ieee80211_vif_release_channel(sdata);
synchronize_rcu();
kfree(presp);
diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c
index f5aed96..f3bbea1 100644
--- a/net/mac80211/rc80211_minstrel_ht.c
+++ b/net/mac80211/rc80211_minstrel_ht.c
@@ -828,6 +828,9 @@ minstrel_ht_update_cck(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
if (sband->band != IEEE80211_BAND_2GHZ)
return;
+ if (!(mp->hw->flags & IEEE80211_HW_SUPPORTS_HT_CCK_RATES))
+ return;
+
mi->cck_supported = 0;
mi->cck_supported_short = 0;
for (i = 0; i < 4; i++) {
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply related
* Re: [PATCH 3.11] mac80211: ignore (E)CSA in probe response frames
From: Seth Forshee @ 2013-08-23 15:04 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Johannes Berg
In-Reply-To: <1377265924-19012-1-git-send-email-johannes@sipsolutions.net>
On Fri, Aug 23, 2013 at 03:52:04PM +0200, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> Seth reports that some APs, notably the Netgear WNDAP360, send
> invalid ECSA IEs in probe response frames with the operating
> class and channel number both set to zero, even when no channel
> switch is being done. As a result, any scan while connected to
> such an AP results in the connection being dropped.
>
> Fix this by ignoring any channel switch announcment in probe
> response frames entirely, since we're connected to the AP we
> will be receiving a beacon (and maybe even an action frame) if
> a channel switch is done, which is sufficient.
>
> Cc: stable@vger.kernel.org # 3.10
> Reported-by: Seth Forshee <seth.forshee@canonical.com>
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This fixes the problem. Thanks Johannes!
Tested-by: Seth Forshee <seth.forshee@canonical.com>
^ permalink raw reply
* Re: [PATCH net-next 08/10] net: libertas: inherit addr_assign_type along with dev_addr
From: John W. Linville @ 2013-08-23 14:52 UTC (permalink / raw)
To: Bjørn Mork; +Cc: netdev, libertas-dev, linux-wireless
In-Reply-To: <1377250513-3662-9-git-send-email-bjorn@mork.no>
On Fri, Aug 23, 2013 at 11:35:11AM +0200, Bjørn Mork wrote:
> Cc: "John W. Linville" <linville@tuxdriver.com>
> Signed-off-by: Bjørn Mork <bjorn@mork.no>
> ---
> drivers/net/wireless/libertas/mesh.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/libertas/mesh.c b/drivers/net/wireless/libertas/mesh.c
> index efae07e..6fef746 100644
> --- a/drivers/net/wireless/libertas/mesh.c
> +++ b/drivers/net/wireless/libertas/mesh.c
> @@ -1017,7 +1017,7 @@ static int lbs_add_mesh(struct lbs_private *priv)
>
> mesh_dev->netdev_ops = &mesh_netdev_ops;
> mesh_dev->ethtool_ops = &lbs_ethtool_ops;
> - memcpy(mesh_dev->dev_addr, priv->dev->dev_addr, ETH_ALEN);
> + eth_hw_addr_inherit(mesh_dev, priv->dev);
>
> SET_NETDEV_DEV(priv->mesh_dev, priv->dev->dev.parent);
>
> --
> 1.7.10.4
>
>
Acked-by: "John W. Linville" <linville@tuxdriver.com>
--
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
* Re: [PATCH net-next 06/10] net: airo: inherit addr_assign_type along with dev_addr
From: John W. Linville @ 2013-08-23 14:53 UTC (permalink / raw)
To: Bjørn Mork; +Cc: netdev, linux-wireless
In-Reply-To: <1377250513-3662-7-git-send-email-bjorn@mork.no>
On Fri, Aug 23, 2013 at 11:35:09AM +0200, Bjørn Mork wrote:
> Cc: "John W. Linville" <linville@tuxdriver.com>
> Signed-off-by: Bjørn Mork <bjorn@mork.no>
> ---
> drivers/net/wireless/airo.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
> index d0adbaf..7fe1964 100644
> --- a/drivers/net/wireless/airo.c
> +++ b/drivers/net/wireless/airo.c
> @@ -2693,7 +2693,7 @@ static struct net_device *init_wifidev(struct airo_info *ai,
> dev->base_addr = ethdev->base_addr;
> dev->wireless_data = ethdev->wireless_data;
> SET_NETDEV_DEV(dev, ethdev->dev.parent);
> - memcpy(dev->dev_addr, ethdev->dev_addr, dev->addr_len);
> + eth_hw_addr_inherit(dev, ethdev);
> err = register_netdev(dev);
> if (err<0) {
> free_netdev(dev);
> --
> 1.7.10.4
Acked-by: "John W. Linville" <linville@tuxdriver.com>
--
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
* Re: [PATCH v14 2/2] cfg80211: P2P find phase offload
From: Johannes Berg @ 2013-08-23 14:16 UTC (permalink / raw)
To: Vladimir Kondratiev
Cc: linux-wireless, Luis R . Rodriguez, John W . Linville,
Jouni Malinen
In-Reply-To: <1376567489-1863-3-git-send-email-qca_vkondrat@qca.qualcomm.com>
On Thu, 2013-08-15 at 14:51 +0300, Vladimir Kondratiev wrote:
[...]
Generally, I think this looks good now. Some small comments:
> - configure rx management filter to get probe-request and probe-response frames
This is misleading, there's no "filter" that the supplicant can
configure. It can (and should) subscribe to these frames, but that's not
really the same thing.
> - start p2p find via driver's cfg80211_ops start_p2p_find method
> - driver start p2p find with hardware and notify wpa_supplicant with
> cfg80211_p2p_find_notify_start()
> - driver/firmware toggle search/listen states. Received probe-request and
> probe-response frames passed to the wpa_supplicant via cfg80211_rx_mgmt;
> replied by driver/firmware probe-request frames indicated with
> NL80211_RXMGMT_FLAG_REPLIED flag
ANSWERED now
> Alternatively, driver/firmware may decide to stop p2p find.
This is somewhat problematic, see below.
> All driver to user space communication done through nl80211 layer.
Well, umm, ok. That seems kinda obvious :)
> @@ -3062,6 +3116,7 @@ struct wireless_dev {
> struct mutex mtx;
>
> bool use_4addr, p2p_started;
> + bool p2p_find_active; /* protected by rtnl */
Should that really be in the wdev, i.e. is it OK to run p2p_find on
multiple wdevs of the same wiphy? That seems odd.
> +/**
> + * cfg80211_p2p_find_notify_end - report p2p find phase ended
> + * @wdev: the wireless device reporting the event
> + * @gfp: allocation flags
> + *
> + * p2p find phase may be ended either unsolicited or in response to
> + * ops->stop_p2p_find. If called out of context of ops->stop_p2p_find,
> + * should be protected with rtnl_lock()
I think this is problematic, how are drivers going to be able to
guarantee this? They'd most likely call this from some RX context if the
firmware gives up, or firmware restart context, and not really know
whether the RTNL is held or not? Then drivers will have to make it
async, but then we might just as well make it async in cfg80211, no?
Thinking about this, I'm also starting to think that requiring this to
be called when the stop_p2p_find() operation is called is pretty
pointless, as cfg80211 can just do it itself? If the driver still calls
it, it can obviously suppress the extra event.
> +void cfg80211_p2p_find_notify_end(struct wireless_dev *wdev, gfp_t gfp);
That gfp argument is also fairly useless, if you must hold the RTNL it's
likely that you're able to sleep, unless doing something 'exotic' like
rtnl_lock()
rcu_read_lock()
...
p2p_find_notify_end()
but that would be strange and not usually needed?
> + if (!wdev->p2p_find_active)
> + return -ENOENT;
> +
> + rdev_stop_p2p_find(rdev, wdev);
Here you could do something like
if p2p_find_active
send_event()
p2p_find_active = false
so drivers don't have to call it?
> +void cfg80211_p2p_find_notify_end(struct wireless_dev *wdev, gfp_t gfp)
> +{
> + ASSERT_RTNL();
In fact, ASSERT_RTNL() can only be called when able to sleep, because it
attempts to lock or so ... unless that changed to lockdep recently?
Ilan also pointed out to me that it might be necessary to document (and
enforce?) that scan/sched_scan can't be executed in parallel? Or can
they?
johannes
^ permalink raw reply
* Re: [PATCH v14 1/2] cfg80211: add 'flags' to cfg80211_rx_mgmt()
From: Johannes Berg @ 2013-08-23 14:07 UTC (permalink / raw)
To: Vladimir Kondratiev
Cc: linux-wireless, Luis R . Rodriguez, John W . Linville,
Jouni Malinen
In-Reply-To: <1376567489-1863-2-git-send-email-qca_vkondrat@qca.qualcomm.com>
On Thu, 2013-08-15 at 14:51 +0300, Vladimir Kondratiev wrote:
> Flags intended to report various auxiliary information.
> Introduced flag NL80211_RXMGMT_FLAG_REPLIED to report
> whether frame was replied by the device/driver.
Applied, with some small changes.
johannes
^ permalink raw reply
* Re: [PATCH] mac80211: implement STA CSA for drivers using channel contexts
From: Johannes Berg @ 2013-08-23 14:01 UTC (permalink / raw)
To: Arik Nemtsov; +Cc: linux-wireless@vger.kernel.org
In-Reply-To: <CA+XVXfeVtaxqAgWQgSsiMw8uZ6uDmEwba+T8M9-YrUNBwxvshA@mail.gmail.com>
On Fri, 2013-08-16 at 23:09 +0300, Arik Nemtsov wrote:
> > Well, it can't. If you look carefully then the old chan_switch op
> > behaviour is to let the driver switch, not switch in software
> > afterwards.
>
> The right thing for chan_switch drivers would be not to call hw_config()..
chan_switch? or chanctx?
> > Yeah but it's (currently) meant for interfaces controlling the CSA (i.e.
> > AP only right now) ... so I really think we need to make this
> > controllable, I think that when we want to implement it for Intel MVM
> > firmware then we'll let the firmware control the switch timing, etc.
> > None of this can even be done today or with your patch.
>
> The TI driver implements the chan_switch op and uses channel contexts.
Huh, ok, that was a combination I didn't think was going to exist, since
the chanswitch API doesn't really tell you what channel context etc.
OTOH, it does give you the vif so you have the chanctx implicitly.
> If I catch your drift you would rather these kind of drivers (which
> include MVM) use a new API exposed by mac80211 to complete the channel
> switch. This API would basically be ieee80211_vif_change_channel(). Do
> we still need to touch the cfg80211 chandef definition in ifmgd?
That's what I was thinking, yes.
> The above is maybe cleaner, but it's functionally equivalent to the
> solution today - the low level driver decides when the channel switch
> is completed, and ieee80211_chswitch_work() is called, which does the
> right thing for all cases.
Right ... I guess that works.
> Note that with the above, the channel_contexts + software chan-switch
> drivers will still need the kind of code that I wrote. So it would
> just lead to replicated code. Or maybe you meant something else?
We have too many possibilities I guess ... I think for MVM I want the
disconnect, not the channel context change in software. You're taking
that possibility away, hence my suggestion of a new hardware flag for it
or so.
> Also, where would you put csa_active = true (if at all) for a STA
> interface? Unlike AP, the trigger here is mac80211 code. So putting it
> there seemed appropriate.
Yeah, I was really just trying to say that current chanctx drivers need
not really expect a chanctx to change channel unless they implement CSA,
but that currently means AP-CSA - basically what I just said above with
taking away the possibility of doing the deauth instead.
johannes
^ permalink raw reply
* Re: [PATCH V3] cfg80211: vlan priority handling in WMM
From: Johannes Berg @ 2013-08-23 13:57 UTC (permalink / raw)
To: cedric.voncken; +Cc: linux-wireless
In-Reply-To: <1377092917-23411-1-git-send-email-cedric.voncken@acksys.fr>
On Wed, 2013-08-21 at 15:48 +0200, cedric.voncken@acksys.fr wrote:
> + if(vlan_tx_tag_present(skb)) {
need space
> + vlan_priority = (vlan_tx_tag_get(skb) & VLAN_PRIO_MASK) >> VLAN_PRIO_SHIFT;
>80 cols
johannes
^ permalink raw reply
* [PATCH 3.11] mac80211: ignore (E)CSA in probe response frames
From: Johannes Berg @ 2013-08-23 13:52 UTC (permalink / raw)
To: linux-wireless; +Cc: seth.forshee, Johannes Berg
From: Johannes Berg <johannes.berg@intel.com>
Seth reports that some APs, notably the Netgear WNDAP360, send
invalid ECSA IEs in probe response frames with the operating
class and channel number both set to zero, even when no channel
switch is being done. As a result, any scan while connected to
such an AP results in the connection being dropped.
Fix this by ignoring any channel switch announcment in probe
response frames entirely, since we're connected to the AP we
will be receiving a beacon (and maybe even an action frame) if
a channel switch is done, which is sufficient.
Cc: stable@vger.kernel.org # 3.10
Reported-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/mac80211/mlme.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index cc9e02d..7a98d52 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2851,14 +2851,6 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
ieee80211_rx_bss_put(local, bss);
sdata->vif.bss_conf.beacon_rate = bss->beacon_rate;
}
-
- if (!sdata->u.mgd.associated ||
- !ether_addr_equal(mgmt->bssid, sdata->u.mgd.associated->bssid))
- return;
-
- ieee80211_sta_process_chanswitch(sdata, rx_status->mactime,
- elems, true);
-
}
@@ -3147,6 +3139,9 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
ieee80211_rx_bss_info(sdata, mgmt, len, rx_status, &elems);
+ ieee80211_sta_process_chanswitch(sdata, rx_status->mactime,
+ &elems, true);
+
if (ieee80211_sta_wmm_params(local, sdata, elems.wmm_param,
elems.wmm_param_len))
changed |= BSS_CHANGED_QOS;
--
1.8.4.rc3
^ permalink raw reply related
* Re: [PATCH] mac80211: ignore obviously bogus ECSAs in probe response frames
From: Johannes Berg @ 2013-08-23 13:47 UTC (permalink / raw)
To: Seth Forshee; +Cc: linux-wireless, John W. Linville
In-Reply-To: <20130822141011.GA24445@thinkpad-t410>
On Thu, 2013-08-22 at 09:10 -0500, Seth Forshee wrote:
> On Thu, Aug 22, 2013 at 04:01:03PM +0200, Johannes Berg wrote:
> > On Thu, 2013-08-22 at 08:53 -0500, Seth Forshee wrote:
> > > The Netgear WNDAP360 sends invalid ECSA IEs in probe response
> > > frames
> >
> > I think we shouldn't be checking probe response frames at all. That
> > seems like a mistake. Can you try this?
>
> I had considered this, but the spec says that it's at least valid for
> the AP to be sending ECSAs in probe responses. IEEE 802.11-2012 section
> 10.3.3.2:
>
> ...an AP shall inform associated STAs that the AP is moving to a new
> channel and/or operating class and maintain the association by
> advertising the switch using Extended Channel Switch Announcement
> elements in any transmitted Beacon frames, Probe Response frames, and
> Extended Channel Switch Announcement frames until the intended channel
> switch time.
>
> Perhaps we can still ignore them though? I suppose we'd expect to
> receive some other frame with the ECSA before it actually happens.
I suppose that's to avoid clients connecting to it when they find the
AP, I don't see any reason to actually react to that in our code - we
should have picked up a beacon already anyway.
johannes
^ permalink raw reply
* Re: [PATCH] mac80211: assign seqnums for group QoS frames
From: Johannes Berg @ 2013-08-23 13:44 UTC (permalink / raw)
To: Bob Copeland; +Cc: linux-wireless
In-Reply-To: <1377264938-5333-1-git-send-email-me@bobcopeland.com>
On Fri, 2013-08-23 at 09:35 -0400, Bob Copeland wrote:
> According to 802.11-2012 9.3.2.10, paragraph 4, QoS
> data frames with a group address in the Address 1 field
> have sequence numbers allocated from the same counter
> as non-QoS data and management frames. Without this
> flag, some drivers may not assign sequence numbers, and
> in rare cases frames might get dropped. Set the control
> flag accordingly.
Applied (to -next), thanks.
johannes
^ permalink raw reply
* [PATCH 2/2] staging: vt6656: rxtx.c s_vFillTxKey fill structure vnt_mic_hdr
From: Malcolm Priestley @ 2013-08-23 13:37 UTC (permalink / raw)
To: gregkh; +Cc: linux-wireless
Replace the pointer offsets with structure of mic_hdr with
endian conversion where needed.
Replace vFillTxKey argument u8 *pMICHDR with struct vnt_mic_hdr *mic_hdr
and fix type of calling functions.
An extra check that mic_hdr is not NULL
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
drivers/staging/vt6656/rxtx.c | 71 +++++++++++++++++++------------------------
1 file changed, 32 insertions(+), 39 deletions(-)
diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index c055c76..14b7def 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -113,7 +113,7 @@ static void s_vGenerateMACHeader(struct vnt_private *pDevice,
static void s_vFillTxKey(struct vnt_private *pDevice, u8 *pbyBuf,
u8 *pbyIVHead, PSKeyItem pTransmitKey, u8 *pbyHdrBuf, u16 wPayloadLen,
- u8 *pMICHDR);
+ struct vnt_mic_hdr *mic_hdr);
static void s_vSWencryption(struct vnt_private *pDevice,
PSKeyItem pTransmitKey, u8 *pbyPayloadHead, u16 wPayloadSize);
@@ -183,11 +183,10 @@ static void s_vSaveTxPktInfo(struct vnt_private *pDevice, u8 byPktNum,
static void s_vFillTxKey(struct vnt_private *pDevice, u8 *pbyBuf,
u8 *pbyIVHead, PSKeyItem pTransmitKey, u8 *pbyHdrBuf,
- u16 wPayloadLen, u8 *pMICHDR)
+ u16 wPayloadLen, struct vnt_mic_hdr *mic_hdr)
{
u32 *pdwIV = (u32 *)pbyIVHead;
u32 *pdwExtIV = (u32 *)((u8 *)pbyIVHead + 4);
- u16 wValue;
struct ieee80211_hdr *pMACHeader = (struct ieee80211_hdr *)pbyHdrBuf;
u32 dwRevIVCounter;
@@ -251,40 +250,34 @@ static void s_vFillTxKey(struct vnt_private *pDevice, u8 *pbyBuf,
//Append IV&ExtIV after Mac Header
*pdwExtIV = cpu_to_le32(pTransmitKey->dwTSC47_16);
- //Fill MICHDR0
- *pMICHDR = 0x59;
- *((u8 *)(pMICHDR+1)) = 0; // TxPriority
- memcpy(pMICHDR+2, &(pMACHeader->addr2[0]), 6);
- *((u8 *)(pMICHDR+8)) = HIBYTE(HIWORD(pTransmitKey->dwTSC47_16));
- *((u8 *)(pMICHDR+9)) = LOBYTE(HIWORD(pTransmitKey->dwTSC47_16));
- *((u8 *)(pMICHDR+10)) = HIBYTE(LOWORD(pTransmitKey->dwTSC47_16));
- *((u8 *)(pMICHDR+11)) = LOBYTE(LOWORD(pTransmitKey->dwTSC47_16));
- *((u8 *)(pMICHDR+12)) = HIBYTE(pTransmitKey->wTSC15_0);
- *((u8 *)(pMICHDR+13)) = LOBYTE(pTransmitKey->wTSC15_0);
- *((u8 *)(pMICHDR+14)) = HIBYTE(wPayloadLen);
- *((u8 *)(pMICHDR+15)) = LOBYTE(wPayloadLen);
-
- //Fill MICHDR1
- *((u8 *)(pMICHDR+16)) = 0; // HLEN[15:8]
- if (pDevice->bLongHeader) {
- *((u8 *)(pMICHDR+17)) = 28; // HLEN[7:0]
- } else {
- *((u8 *)(pMICHDR+17)) = 22; // HLEN[7:0]
- }
- wValue = cpu_to_le16(pMACHeader->frame_control & 0xC78F);
- memcpy(pMICHDR+18, (u8 *)&wValue, 2); // MSKFRACTL
- memcpy(pMICHDR+20, &(pMACHeader->addr1[0]), 6);
- memcpy(pMICHDR+26, &(pMACHeader->addr2[0]), 6);
-
- //Fill MICHDR2
- memcpy(pMICHDR+32, &(pMACHeader->addr3[0]), 6);
- wValue = pMACHeader->seq_ctrl;
- wValue &= 0x000F;
- wValue = cpu_to_le16(wValue);
- memcpy(pMICHDR+38, (u8 *)&wValue, 2); // MSKSEQCTL
- if (pDevice->bLongHeader) {
- memcpy(pMICHDR+40, &(pMACHeader->addr4[0]), 6);
- }
+ if (!mic_hdr)
+ return;
+
+ /* MICHDR0 */
+ mic_hdr->id = 0x59;
+ mic_hdr->payload_len = cpu_to_be16(wPayloadLen);
+ memcpy(mic_hdr->mic_addr2, pMACHeader->addr2, ETH_ALEN);
+
+ mic_hdr->tsc_47_16 = cpu_to_be32(pTransmitKey->dwTSC47_16);
+ mic_hdr->tsc_15_0 = cpu_to_be16(pTransmitKey->wTSC15_0);
+
+ /* MICHDR1 */
+ if (pDevice->bLongHeader)
+ mic_hdr->hlen = cpu_to_be16(28);
+ else
+ mic_hdr->hlen = cpu_to_be16(22);
+
+ memcpy(mic_hdr->addr1, pMACHeader->addr1, ETH_ALEN);
+ memcpy(mic_hdr->addr2, pMACHeader->addr2, ETH_ALEN);
+
+ /* MICHDR2 */
+ memcpy(mic_hdr->addr3, pMACHeader->addr3, ETH_ALEN);
+ mic_hdr->frame_control = cpu_to_le16(pMACHeader->frame_control
+ & 0xc78f);
+ mic_hdr->seq_ctrl = cpu_to_le16(pMACHeader->seq_ctrl & 0xf);
+
+ if (pDevice->bLongHeader)
+ memcpy(mic_hdr->addr4, pMACHeader->addr4, ETH_ALEN);
}
}
@@ -1294,7 +1287,7 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
if (bNeedEncryption == true) {
//Fill TXKEY
s_vFillTxKey(pDevice, (u8 *)(pTxBufHead->adwTxKey), pbyIVHead, pTransmitKey,
- pbyMacHdr, (u16)cbFrameBodySize, (u8 *)pMICHDR);
+ pbyMacHdr, (u16)cbFrameBodySize, pMICHDR);
if (pDevice->bEnableHostWEP) {
pMgmt->sNodeDBTable[uNodeIndex].dwTSC47_16 = pTransmitKey->dwTSC47_16;
@@ -2203,7 +2196,7 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb)
}
s_vFillTxKey(pDevice, (u8 *)(pTxBufHead->adwTxKey), pbyIVHead, pTransmitKey,
- pbyMacHdr, (u16)cbFrameBodySize, (u8 *)pMICHDR);
+ pbyMacHdr, (u16)cbFrameBodySize, pMICHDR);
if (pDevice->bEnableHostWEP) {
pMgmt->sNodeDBTable[uNodeIndex].dwTSC47_16 = pTransmitKey->dwTSC47_16;
--
1.8.1.2
^ permalink raw reply related
* [PATCH] mac80211: assign seqnums for group QoS frames
From: Bob Copeland @ 2013-08-23 13:35 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless
According to 802.11-2012 9.3.2.10, paragraph 4, QoS
data frames with a group address in the Address 1 field
have sequence numbers allocated from the same counter
as non-QoS data and management frames. Without this
flag, some drivers may not assign sequence numbers, and
in rare cases frames might get dropped. Set the control
flag accordingly.
Signed-off-by: Bob Copeland <bob@cozybit.com>
---
I noticed seq=0 on DHCP/mDNS frames with mesh on certain
hardware (since mesh sends all data frames as QoS).
Johannes pointed out this only causes issues if a unicast
frame with seq=0 has retries, and if the receiver caches
seqnums from multicast frames (mac80211 does not).
net/mac80211/tx.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 098ae85..3456c04 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -781,9 +781,11 @@ ieee80211_tx_h_sequence(struct ieee80211_tx_data *tx)
/*
* Anything but QoS data that has a sequence number field
* (is long enough) gets a sequence number from the global
- * counter.
+ * counter. QoS data frames with a multicast destination
+ * also use the global counter (802.11-2012 9.3.2.10).
*/
- if (!ieee80211_is_data_qos(hdr->frame_control)) {
+ if (!ieee80211_is_data_qos(hdr->frame_control) ||
+ is_multicast_ether_addr(hdr->addr1)) {
/* driver should assign sequence number */
info->flags |= IEEE80211_TX_CTL_ASSIGN_SEQ;
/* for pure STA mode without beacons, we can do it */
--
1.7.10.4
^ permalink raw reply related
* [PATCH 1/2] staging: vt6656: desc.h Remove typedef struct tagSMICHDRHead to new structure in rxtx.h
From: Malcolm Priestley @ 2013-08-23 13:33 UTC (permalink / raw)
To: gregkh; +Cc: linux-wireless
To new structure.
typedef struct tagSMICHDRHead -> struct vnt_mic_hdr
This is only needed by rxtc.c so moved to rxtx.h
The new structure is the same size as the old but
contains the members as pointer referenced in
rxtx.c s_vFillTxKey
u8 id
*pMICHDR = 0x59;
u8 tx_priority;
*((u8 *)(pMICHDR+1)) = 0; // TxPriority
u8 mic_addr2[6];
memcpy(pMICHDR+2, &(pMACHeader->addr2[0]), 6);
__be32 tsc_47_16;
pMICHDR+8 = HIBYTE(HIWORD(pTransmitKey->dwTSC47_16));
pMICHDR+9 = LOBYTE(HIWORD(pTransmitKey->dwTSC47_16));
pMICHDR+10 = HIBYTE(LOWORD(pTransmitKey->dwTSC47_16));
pMICHDR+11 = LOBYTE(LOWORD(pTransmitKey->dwTSC47_16));
__be16 tsc_15_0;
pMICHDR+12 = HIBYTE(pTransmitKey->wTSC15_0);
pMICHDR+13 = LOBYTE(pTransmitKey->wTSC15_0);
__be16 payload_len;
pMICHDR+14 = HIBYTE(wPayloadLen);
pMICHDR+15 = LOBYTE(wPayloadLen);
__be16 hlen;
pMICHDR+16 = 0; // HLEN[15:8]
pMICHDR+17 = 28; // HLEN[7:0]
__le16 frame_control;
memcpy(pMICHDR+18, (u8 *)&wValue, 2); // MSKFRACTL
u8 addr1[6];
memcpy(pMICHDR+20, &(pMACHeader->addr1[0]), 6);
u8 addr2[6];
memcpy(pMICHDR+26, &(pMACHeader->addr2[0]), 6);
u8 addr3[6];
memcpy(pMICHDR+32, &(pMACHeader->addr3[0]), 6);
__le16 seq_ctrl;
memcpy(pMICHDR+38, (u8 *)&wValue, 2); // MSKSEQCTL
u8 addr4[6];
memcpy(pMICHDR+40, &(pMACHeader->addr4[0]), 6);
u16 packing; /* packing to 48 bytes */
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
drivers/staging/vt6656/desc.h | 12 ------------
drivers/staging/vt6656/rxtx.c | 26 +++++++++++++-------------
drivers/staging/vt6656/rxtx.h | 18 ++++++++++++++++++
3 files changed, 31 insertions(+), 25 deletions(-)
diff --git a/drivers/staging/vt6656/desc.h b/drivers/staging/vt6656/desc.h
index b3e8cc1..4675135 100644
--- a/drivers/staging/vt6656/desc.h
+++ b/drivers/staging/vt6656/desc.h
@@ -163,18 +163,6 @@ typedef struct tagSTxShortBufHead {
STxShortBufHead, *PSTxShortBufHead;
typedef const STxShortBufHead *PCSTxShortBufHead;
-/*
- * MICHDR data header
- */
-typedef struct tagSMICHDRHead {
- u32 adwHDR0[4];
- u32 adwHDR1[4];
- u32 adwHDR2[4];
-} __attribute__ ((__packed__))
-SMICHDRHead, *PSMICHDRHead;
-
-typedef const SMICHDRHead *PCSMICHDRHead;
-
typedef struct tagSBEACONCtl {
u32 BufReady:1;
u32 TSF:15;
diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index ed3fdf4..c055c76 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -1004,7 +1004,7 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
u32 uDuration;
u32 cbHeaderLength = 0, uPadding = 0;
void *pvRrvTime;
- PSMICHDRHead pMICHDR;
+ struct vnt_mic_hdr *pMICHDR;
void *pvRTS;
void *pvCTS;
void *pvTxDataHd;
@@ -1121,7 +1121,7 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
if (pTransmitKey->byCipherSuite == KEY_CTL_CCMP) {
cbIVlen = 8;//RSN Header
cbICVlen = 8;//MIC
- cbMICHDR = sizeof(SMICHDRHead);
+ cbMICHDR = sizeof(struct vnt_mic_hdr);
}
if (bSoftWEP == false) {
//MAC Header should be padding 0 to DW alignment.
@@ -1146,7 +1146,7 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
if (bRTS == true) {//RTS_need
pvRrvTime = (struct vnt_rrv_time_rts *)
(pbyTxBufferAddr + wTxBufSize);
- pMICHDR = (PSMICHDRHead)(pbyTxBufferAddr + wTxBufSize +
+ pMICHDR = (struct vnt_mic_hdr *)(pbyTxBufferAddr + wTxBufSize +
sizeof(struct vnt_rrv_time_rts));
pvRTS = (struct vnt_rts_g *) (pbyTxBufferAddr + wTxBufSize +
sizeof(struct vnt_rrv_time_rts) + cbMICHDR);
@@ -1161,7 +1161,7 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
else { //RTS_needless
pvRrvTime = (struct vnt_rrv_time_cts *)
(pbyTxBufferAddr + wTxBufSize);
- pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize +
+ pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize +
sizeof(struct vnt_rrv_time_cts));
pvRTS = NULL;
pvCTS = (struct vnt_cts *) (pbyTxBufferAddr + wTxBufSize +
@@ -1178,7 +1178,7 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
if (bRTS == true) {//RTS_need
pvRrvTime = (struct vnt_rrv_time_rts *)(pbyTxBufferAddr +
wTxBufSize);
- pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize +
+ pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize +
sizeof(struct vnt_rrv_time_rts));
pvRTS = (struct vnt_rts_g_fb *) (pbyTxBufferAddr + wTxBufSize +
sizeof(struct vnt_rrv_time_rts) + cbMICHDR);
@@ -1193,7 +1193,7 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
else if (bRTS == false) { //RTS_needless
pvRrvTime = (struct vnt_rrv_time_cts *)
(pbyTxBufferAddr + wTxBufSize);
- pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize +
+ pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize +
sizeof(struct vnt_rrv_time_cts));
pvRTS = NULL;
pvCTS = (struct vnt_cts_fb *) (pbyTxBufferAddr + wTxBufSize +
@@ -1212,7 +1212,7 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
if (bRTS == true) {//RTS_need
pvRrvTime = (struct vnt_rrv_time_ab *) (pbyTxBufferAddr +
wTxBufSize);
- pMICHDR = (PSMICHDRHead)(pbyTxBufferAddr + wTxBufSize +
+ pMICHDR = (struct vnt_mic_hdr *)(pbyTxBufferAddr + wTxBufSize +
sizeof(struct vnt_rrv_time_ab));
pvRTS = (struct vnt_rts_ab *) (pbyTxBufferAddr + wTxBufSize +
sizeof(struct vnt_rrv_time_ab) + cbMICHDR);
@@ -1227,7 +1227,7 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
else if (bRTS == false) { //RTS_needless, no MICHDR
pvRrvTime = (struct vnt_rrv_time_ab *)(pbyTxBufferAddr +
wTxBufSize);
- pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize +
+ pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize +
sizeof(struct vnt_rrv_time_ab));
pvRTS = NULL;
pvCTS = NULL;
@@ -1241,7 +1241,7 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
if (bRTS == true) {//RTS_need
pvRrvTime = (struct vnt_rrv_time_ab *)(pbyTxBufferAddr +
wTxBufSize);
- pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize +
+ pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize +
sizeof(struct vnt_rrv_time_ab));
pvRTS = (struct vnt_rts_a_fb *) (pbyTxBufferAddr + wTxBufSize +
sizeof(struct vnt_rrv_time_ab) + cbMICHDR);
@@ -1256,7 +1256,7 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
else if (bRTS == false) { //RTS_needless
pvRrvTime = (struct vnt_rrv_time_ab *)(pbyTxBufferAddr +
wTxBufSize);
- pMICHDR = (PSMICHDRHead)(pbyTxBufferAddr + wTxBufSize +
+ pMICHDR = (struct vnt_mic_hdr *)(pbyTxBufferAddr + wTxBufSize +
sizeof(struct vnt_rrv_time_ab));
pvRTS = NULL;
pvCTS = NULL;
@@ -2057,7 +2057,7 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb)
else if (pDevice->eEncryptionStatus == Ndis802_11Encryption3Enabled) {
cbIVlen = 8;//RSN Header
cbICVlen = 8;//MIC
- cbMICHDR = sizeof(SMICHDRHead);
+ cbMICHDR = sizeof(struct vnt_mic_hdr);
pTxBufHead->wFragCtl |= FRAGCTL_AES;
pDevice->bAES = true;
}
@@ -2076,7 +2076,7 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb)
if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) {//802.11g packet
pvRrvTime = (struct vnt_rrv_time_cts *) (pbyTxBufferAddr + wTxBufSize);
- pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize +
+ pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize +
sizeof(struct vnt_rrv_time_cts));
pvRTS = NULL;
pvCTS = (struct vnt_cts *) (pbyTxBufferAddr + wTxBufSize +
@@ -2091,7 +2091,7 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb)
else {//802.11a/b packet
pvRrvTime = (struct vnt_rrv_time_ab *) (pbyTxBufferAddr + wTxBufSize);
- pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize +
+ pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize +
sizeof(struct vnt_rrv_time_ab));
pvRTS = NULL;
pvCTS = NULL;
diff --git a/drivers/staging/vt6656/rxtx.h b/drivers/staging/vt6656/rxtx.h
index 3484f2b..ad62052 100644
--- a/drivers/staging/vt6656/rxtx.h
+++ b/drivers/staging/vt6656/rxtx.h
@@ -33,6 +33,24 @@
#include "wcmd.h"
#include "baseband.h"
+/* MIC HDR data header */
+struct vnt_mic_hdr {
+ u8 id;
+ u8 tx_priority;
+ u8 mic_addr2[6];
+ __be32 tsc_47_16;
+ __be16 tsc_15_0;
+ __be16 payload_len;
+ __be16 hlen;
+ __le16 frame_control;
+ u8 addr1[6];
+ u8 addr2[6];
+ u8 addr3[6];
+ __le16 seq_ctrl;
+ u8 addr4[6];
+ u16 packing; /* packing to 48 bytes */
+} __packed;
+
/* RsvTime buffer header */
struct vnt_rrv_time_rts {
u16 wRTSTxRrvTime_ba;
--
1.8.1.2
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox