* [PATCH 02/21] rt2x00: rt2800pci: use rt2800mmio prefix for TX descriptor functions
From: Gabor Juhos @ 2013-10-17 7:42 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, users, Gabor Juhos
In-Reply-To: <1381995755-16471-1-git-send-email-juhosg@openwrt.org>
The functions are used for devices with memory
mapped I/O and contain no PCI specific code at
all. Use rt2800mmio prefix instead of rt2800pci
in the function names to reflect that.
The patch contains no functional changes.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
drivers/net/wireless/rt2x00/rt2800pci.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index f8f2abb..ddc6a42 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -629,13 +629,13 @@ static int rt2800pci_set_device_state(struct rt2x00_dev *rt2x00dev,
/*
* TX descriptor initialization
*/
-static __le32 *rt2800pci_get_txwi(struct queue_entry *entry)
+static __le32 *rt2800mmio_get_txwi(struct queue_entry *entry)
{
return (__le32 *) entry->skb->data;
}
-static void rt2800pci_write_tx_desc(struct queue_entry *entry,
- struct txentry_desc *txdesc)
+static void rt2800mmio_write_tx_desc(struct queue_entry *entry,
+ struct txentry_desc *txdesc)
{
struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
struct queue_entry_priv_mmio *entry_priv = entry->priv_data;
@@ -826,7 +826,7 @@ static bool rt2800pci_txdone_release_entries(struct queue_entry *entry,
{
if (test_bit(ENTRY_DATA_STATUS_SET, &entry->flags)) {
rt2800_txdone_entry(entry, entry->status,
- rt2800pci_get_txwi(entry));
+ rt2800mmio_get_txwi(entry));
return false;
}
@@ -1146,7 +1146,7 @@ static const struct rt2800_ops rt2800pci_rt2800_ops = {
.hwcrypt_disabled = rt2800pci_hwcrypt_disabled,
.drv_write_firmware = rt2800pci_write_firmware,
.drv_init_registers = rt2800pci_init_registers,
- .drv_get_txwi = rt2800pci_get_txwi,
+ .drv_get_txwi = rt2800mmio_get_txwi,
};
static const struct rt2x00lib_ops rt2800pci_rt2x00_ops = {
@@ -1175,7 +1175,7 @@ static const struct rt2x00lib_ops rt2800pci_rt2x00_ops = {
.kick_queue = rt2800pci_kick_queue,
.stop_queue = rt2800pci_stop_queue,
.flush_queue = rt2x00mmio_flush_queue,
- .write_tx_desc = rt2800pci_write_tx_desc,
+ .write_tx_desc = rt2800mmio_write_tx_desc,
.write_tx_data = rt2800_write_tx_data,
.write_beacon = rt2800_write_beacon,
.clear_beacon = rt2800_clear_beacon,
--
1.7.10
^ permalink raw reply related
* [PATCH 03/21] rt2x00: rt2800pci: move TX descriptor functions to the rt2800mmio module
From: Gabor Juhos @ 2013-10-17 7:42 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, users, Gabor Juhos
In-Reply-To: <1381995755-16471-1-git-send-email-juhosg@openwrt.org>
Move the functions into a separate module, in order
to make those usable from other modules. Also move
the TX descriptor related defines from rt2800pci.h
into rt2800mmio.h.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
drivers/net/wireless/rt2x00/Kconfig | 1 +
drivers/net/wireless/rt2x00/rt2800mmio.c | 68 ++++++++++++++++++++++++++++++
drivers/net/wireless/rt2x00/rt2800mmio.h | 47 +++++++++++++++++++++
drivers/net/wireless/rt2x00/rt2800pci.c | 62 +--------------------------
drivers/net/wireless/rt2x00/rt2800pci.h | 37 ----------------
5 files changed, 117 insertions(+), 98 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/Kconfig b/drivers/net/wireless/rt2x00/Kconfig
index 2232b11..535ad3a 100644
--- a/drivers/net/wireless/rt2x00/Kconfig
+++ b/drivers/net/wireless/rt2x00/Kconfig
@@ -205,6 +205,7 @@ config RT2800_LIB
config RT2800_LIB_MMIO
tristate
+ select RT2X00_LIB_MMIO
config RT2X00_LIB_MMIO
tristate
diff --git a/drivers/net/wireless/rt2x00/rt2800mmio.c b/drivers/net/wireless/rt2x00/rt2800mmio.c
index a2b9848..d2ebb68 100644
--- a/drivers/net/wireless/rt2x00/rt2800mmio.c
+++ b/drivers/net/wireless/rt2x00/rt2800mmio.c
@@ -30,6 +30,74 @@
#include <linux/kernel.h>
#include <linux/module.h>
+#include <linux/export.h>
+
+#include "rt2x00.h"
+#include "rt2x00mmio.h"
+#include "rt2800mmio.h"
+
+/*
+ * TX descriptor initialization
+ */
+__le32 *rt2800mmio_get_txwi(struct queue_entry *entry)
+{
+ return (__le32 *) entry->skb->data;
+}
+EXPORT_SYMBOL_GPL(rt2800mmio_get_txwi);
+
+void rt2800mmio_write_tx_desc(struct queue_entry *entry,
+ struct txentry_desc *txdesc)
+{
+ struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
+ struct queue_entry_priv_mmio *entry_priv = entry->priv_data;
+ __le32 *txd = entry_priv->desc;
+ u32 word;
+ const unsigned int txwi_size = entry->queue->winfo_size;
+
+ /*
+ * The buffers pointed by SD_PTR0/SD_LEN0 and SD_PTR1/SD_LEN1
+ * must contains a TXWI structure + 802.11 header + padding + 802.11
+ * data. We choose to have SD_PTR0/SD_LEN0 only contains TXWI and
+ * SD_PTR1/SD_LEN1 contains 802.11 header + padding + 802.11
+ * data. It means that LAST_SEC0 is always 0.
+ */
+
+ /*
+ * Initialize TX descriptor
+ */
+ word = 0;
+ rt2x00_set_field32(&word, TXD_W0_SD_PTR0, skbdesc->skb_dma);
+ rt2x00_desc_write(txd, 0, word);
+
+ word = 0;
+ rt2x00_set_field32(&word, TXD_W1_SD_LEN1, entry->skb->len);
+ rt2x00_set_field32(&word, TXD_W1_LAST_SEC1,
+ !test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags));
+ rt2x00_set_field32(&word, TXD_W1_BURST,
+ test_bit(ENTRY_TXD_BURST, &txdesc->flags));
+ rt2x00_set_field32(&word, TXD_W1_SD_LEN0, txwi_size);
+ rt2x00_set_field32(&word, TXD_W1_LAST_SEC0, 0);
+ rt2x00_set_field32(&word, TXD_W1_DMA_DONE, 0);
+ rt2x00_desc_write(txd, 1, word);
+
+ word = 0;
+ rt2x00_set_field32(&word, TXD_W2_SD_PTR1,
+ skbdesc->skb_dma + txwi_size);
+ rt2x00_desc_write(txd, 2, word);
+
+ word = 0;
+ rt2x00_set_field32(&word, TXD_W3_WIV,
+ !test_bit(ENTRY_TXD_ENCRYPT_IV, &txdesc->flags));
+ rt2x00_set_field32(&word, TXD_W3_QSEL, 2);
+ rt2x00_desc_write(txd, 3, word);
+
+ /*
+ * Register descriptor details in skb frame descriptor.
+ */
+ skbdesc->desc = txd;
+ skbdesc->desc_len = TXD_DESC_SIZE;
+}
+EXPORT_SYMBOL_GPL(rt2800mmio_write_tx_desc);
#include "rt2x00.h"
diff --git a/drivers/net/wireless/rt2x00/rt2800mmio.h b/drivers/net/wireless/rt2x00/rt2800mmio.h
index 32f9dcd..0266640 100644
--- a/drivers/net/wireless/rt2x00/rt2800mmio.h
+++ b/drivers/net/wireless/rt2x00/rt2800mmio.h
@@ -31,4 +31,51 @@
#ifndef RT2800MMIO_H
#define RT2800MMIO_H
+/*
+ * DMA descriptor defines.
+ */
+#define TXD_DESC_SIZE (4 * sizeof(__le32))
+
+/*
+ * TX descriptor format for TX, PRIO and Beacon Ring.
+ */
+
+/*
+ * Word0
+ */
+#define TXD_W0_SD_PTR0 FIELD32(0xffffffff)
+
+/*
+ * Word1
+ */
+#define TXD_W1_SD_LEN1 FIELD32(0x00003fff)
+#define TXD_W1_LAST_SEC1 FIELD32(0x00004000)
+#define TXD_W1_BURST FIELD32(0x00008000)
+#define TXD_W1_SD_LEN0 FIELD32(0x3fff0000)
+#define TXD_W1_LAST_SEC0 FIELD32(0x40000000)
+#define TXD_W1_DMA_DONE FIELD32(0x80000000)
+
+/*
+ * Word2
+ */
+#define TXD_W2_SD_PTR1 FIELD32(0xffffffff)
+
+/*
+ * Word3
+ * WIV: Wireless Info Valid. 1: Driver filled WI, 0: DMA needs to copy WI
+ * QSEL: Select on-chip FIFO ID for 2nd-stage output scheduler.
+ * 0:MGMT, 1:HCCA 2:EDCA
+ */
+#define TXD_W3_WIV FIELD32(0x01000000)
+#define TXD_W3_QSEL FIELD32(0x06000000)
+#define TXD_W3_TCO FIELD32(0x20000000)
+#define TXD_W3_UCO FIELD32(0x40000000)
+#define TXD_W3_ICO FIELD32(0x80000000)
+
+
+/* TX descriptor initialization */
+__le32 *rt2800mmio_get_txwi(struct queue_entry *entry);
+void rt2800mmio_write_tx_desc(struct queue_entry *entry,
+ struct txentry_desc *txdesc);
+
#endif /* RT2800MMIO_H */
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index ddc6a42..b2e2b09 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -45,6 +45,7 @@
#include "rt2x00pci.h"
#include "rt2x00soc.h"
#include "rt2800lib.h"
+#include "rt2800mmio.h"
#include "rt2800.h"
#include "rt2800pci.h"
@@ -627,67 +628,6 @@ static int rt2800pci_set_device_state(struct rt2x00_dev *rt2x00dev,
}
/*
- * TX descriptor initialization
- */
-static __le32 *rt2800mmio_get_txwi(struct queue_entry *entry)
-{
- return (__le32 *) entry->skb->data;
-}
-
-static void rt2800mmio_write_tx_desc(struct queue_entry *entry,
- struct txentry_desc *txdesc)
-{
- struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
- struct queue_entry_priv_mmio *entry_priv = entry->priv_data;
- __le32 *txd = entry_priv->desc;
- u32 word;
- const unsigned int txwi_size = entry->queue->winfo_size;
-
- /*
- * The buffers pointed by SD_PTR0/SD_LEN0 and SD_PTR1/SD_LEN1
- * must contains a TXWI structure + 802.11 header + padding + 802.11
- * data. We choose to have SD_PTR0/SD_LEN0 only contains TXWI and
- * SD_PTR1/SD_LEN1 contains 802.11 header + padding + 802.11
- * data. It means that LAST_SEC0 is always 0.
- */
-
- /*
- * Initialize TX descriptor
- */
- word = 0;
- rt2x00_set_field32(&word, TXD_W0_SD_PTR0, skbdesc->skb_dma);
- rt2x00_desc_write(txd, 0, word);
-
- word = 0;
- rt2x00_set_field32(&word, TXD_W1_SD_LEN1, entry->skb->len);
- rt2x00_set_field32(&word, TXD_W1_LAST_SEC1,
- !test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags));
- rt2x00_set_field32(&word, TXD_W1_BURST,
- test_bit(ENTRY_TXD_BURST, &txdesc->flags));
- rt2x00_set_field32(&word, TXD_W1_SD_LEN0, txwi_size);
- rt2x00_set_field32(&word, TXD_W1_LAST_SEC0, 0);
- rt2x00_set_field32(&word, TXD_W1_DMA_DONE, 0);
- rt2x00_desc_write(txd, 1, word);
-
- word = 0;
- rt2x00_set_field32(&word, TXD_W2_SD_PTR1,
- skbdesc->skb_dma + txwi_size);
- rt2x00_desc_write(txd, 2, word);
-
- word = 0;
- rt2x00_set_field32(&word, TXD_W3_WIV,
- !test_bit(ENTRY_TXD_ENCRYPT_IV, &txdesc->flags));
- rt2x00_set_field32(&word, TXD_W3_QSEL, 2);
- rt2x00_desc_write(txd, 3, word);
-
- /*
- * Register descriptor details in skb frame descriptor.
- */
- skbdesc->desc = txd;
- skbdesc->desc_len = TXD_DESC_SIZE;
-}
-
-/*
* RX control handlers
*/
static void rt2800pci_fill_rxdone(struct queue_entry *entry,
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.h b/drivers/net/wireless/rt2x00/rt2800pci.h
index ab22a08..ecd154e 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.h
+++ b/drivers/net/wireless/rt2x00/rt2800pci.h
@@ -53,46 +53,9 @@
/*
* DMA descriptor defines.
*/
-#define TXD_DESC_SIZE (4 * sizeof(__le32))
#define RXD_DESC_SIZE (4 * sizeof(__le32))
/*
- * TX descriptor format for TX, PRIO and Beacon Ring.
- */
-
-/*
- * Word0
- */
-#define TXD_W0_SD_PTR0 FIELD32(0xffffffff)
-
-/*
- * Word1
- */
-#define TXD_W1_SD_LEN1 FIELD32(0x00003fff)
-#define TXD_W1_LAST_SEC1 FIELD32(0x00004000)
-#define TXD_W1_BURST FIELD32(0x00008000)
-#define TXD_W1_SD_LEN0 FIELD32(0x3fff0000)
-#define TXD_W1_LAST_SEC0 FIELD32(0x40000000)
-#define TXD_W1_DMA_DONE FIELD32(0x80000000)
-
-/*
- * Word2
- */
-#define TXD_W2_SD_PTR1 FIELD32(0xffffffff)
-
-/*
- * Word3
- * WIV: Wireless Info Valid. 1: Driver filled WI, 0: DMA needs to copy WI
- * QSEL: Select on-chip FIFO ID for 2nd-stage output scheduler.
- * 0:MGMT, 1:HCCA 2:EDCA
- */
-#define TXD_W3_WIV FIELD32(0x01000000)
-#define TXD_W3_QSEL FIELD32(0x06000000)
-#define TXD_W3_TCO FIELD32(0x20000000)
-#define TXD_W3_UCO FIELD32(0x40000000)
-#define TXD_W3_ICO FIELD32(0x80000000)
-
-/*
* RX descriptor format for RX Ring.
*/
--
1.7.10
^ permalink raw reply related
* [PATCH 01/21] rt2x00: create a new module for rt2800 MMIO code
From: Gabor Juhos @ 2013-10-17 7:42 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, users, Gabor Juhos
In-Reply-To: <1381995755-16471-1-git-send-email-juhosg@openwrt.org>
Create a new module for common code which can be used
for rt2800 device with memory mapped I/O. It is an empty
module for now, but it will be populated by subsequent
patches.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
drivers/net/wireless/rt2x00/Kconfig | 4 +++
drivers/net/wireless/rt2x00/Makefile | 1 +
drivers/net/wireless/rt2x00/rt2800mmio.c | 39 ++++++++++++++++++++++++++++++
drivers/net/wireless/rt2x00/rt2800mmio.h | 34 ++++++++++++++++++++++++++
4 files changed, 78 insertions(+)
create mode 100644 drivers/net/wireless/rt2x00/rt2800mmio.c
create mode 100644 drivers/net/wireless/rt2x00/rt2800mmio.h
diff --git a/drivers/net/wireless/rt2x00/Kconfig b/drivers/net/wireless/rt2x00/Kconfig
index a18b005..2232b11 100644
--- a/drivers/net/wireless/rt2x00/Kconfig
+++ b/drivers/net/wireless/rt2x00/Kconfig
@@ -60,6 +60,7 @@ config RT2800PCI
tristate "Ralink rt27xx/rt28xx/rt30xx (PCI/PCIe/PCMCIA) support"
depends on PCI || SOC_RT288X || SOC_RT305X
select RT2800_LIB
+ select RT2800_LIB_MMIO
select RT2X00_LIB_MMIO
select RT2X00_LIB_PCI if PCI
select RT2X00_LIB_SOC if SOC_RT288X || SOC_RT305X
@@ -202,6 +203,9 @@ endif
config RT2800_LIB
tristate
+config RT2800_LIB_MMIO
+ tristate
+
config RT2X00_LIB_MMIO
tristate
diff --git a/drivers/net/wireless/rt2x00/Makefile b/drivers/net/wireless/rt2x00/Makefile
index f069d8b..d11e356 100644
--- a/drivers/net/wireless/rt2x00/Makefile
+++ b/drivers/net/wireless/rt2x00/Makefile
@@ -14,6 +14,7 @@ obj-$(CONFIG_RT2X00_LIB_PCI) += rt2x00pci.o
obj-$(CONFIG_RT2X00_LIB_SOC) += rt2x00soc.o
obj-$(CONFIG_RT2X00_LIB_USB) += rt2x00usb.o
obj-$(CONFIG_RT2800_LIB) += rt2800lib.o
+obj-$(CONFIG_RT2800_LIB_MMIO) += rt2800mmio.o
obj-$(CONFIG_RT2400PCI) += rt2400pci.o
obj-$(CONFIG_RT2500PCI) += rt2500pci.o
obj-$(CONFIG_RT61PCI) += rt61pci.o
diff --git a/drivers/net/wireless/rt2x00/rt2800mmio.c b/drivers/net/wireless/rt2x00/rt2800mmio.c
new file mode 100644
index 0000000..a2b9848
--- /dev/null
+++ b/drivers/net/wireless/rt2x00/rt2800mmio.c
@@ -0,0 +1,39 @@
+/* Copyright (C) 2009 - 2010 Ivo van Doorn <IvDoorn@gmail.com>
+ * Copyright (C) 2009 Alban Browaeys <prahal@yahoo.com>
+ * Copyright (C) 2009 Felix Fietkau <nbd@openwrt.org>
+ * Copyright (C) 2009 Luis Correia <luis.f.correia@gmail.com>
+ * Copyright (C) 2009 Mattias Nissler <mattias.nissler@gmx.de>
+ * Copyright (C) 2009 Mark Asselstine <asselsm@gmail.com>
+ * Copyright (C) 2009 Xose Vazquez Perez <xose.vazquez@gmail.com>
+ * Copyright (C) 2009 Bart Zolnierkiewicz <bzolnier@gmail.com>
+ * <http://rt2x00.serialmonkey.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/* Module: rt2800mmio
+ * Abstract: rt2800 MMIO device routines.
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+
+#include "rt2x00.h"
+
+MODULE_AUTHOR(DRV_PROJECT);
+MODULE_VERSION(DRV_VERSION);
+MODULE_DESCRIPTION("rt2800 MMIO library");
+MODULE_LICENSE("GPL");
diff --git a/drivers/net/wireless/rt2x00/rt2800mmio.h b/drivers/net/wireless/rt2x00/rt2800mmio.h
new file mode 100644
index 0000000..32f9dcd
--- /dev/null
+++ b/drivers/net/wireless/rt2x00/rt2800mmio.h
@@ -0,0 +1,34 @@
+/* Copyright (C) 2009 - 2010 Ivo van Doorn <IvDoorn@gmail.com>
+ * Copyright (C) 2009 Alban Browaeys <prahal@yahoo.com>
+ * Copyright (C) 2009 Felix Fietkau <nbd@openwrt.org>
+ * Copyright (C) 2009 Luis Correia <luis.f.correia@gmail.com>
+ * Copyright (C) 2009 Mattias Nissler <mattias.nissler@gmx.de>
+ * Copyright (C) 2009 Mark Asselstine <asselsm@gmail.com>
+ * Copyright (C) 2009 Xose Vazquez Perez <xose.vazquez@gmail.com>
+ * Copyright (C) 2009 Bart Zolnierkiewicz <bzolnier@gmail.com>
+ * <http://rt2x00.serialmonkey.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/* Module: rt2800mmio
+ * Abstract: forward declarations for the rt2800mmio module.
+ */
+
+#ifndef RT2800MMIO_H
+#define RT2800MMIO_H
+
+#endif /* RT2800MMIO_H */
--
1.7.10
^ permalink raw reply related
* [PATCH 00/21] rt2x00: separate rt2800 PCI and SoC driver
From: Gabor Juhos @ 2013-10-17 7:42 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, users, Gabor Juhos
The rt2800pci driver supports both PCI and SoC device. To achieve
this, the code uses several ifdef statements which makes the code
quite ugly. The patch set introduces a shared module, and moves the
SoC driver into a separate module to get rid of the mess.
Gabor Juhos (21):
rt2x00: create a new module for rt2800 MMIO code
rt2x00: rt2800pci: use rt2800mmio prefix for TX descriptor functions
rt2x00: rt2800pci: move TX descriptor functions to the rt2800mmio module
rt2x00: rt2800pci: use rt2800mmio prefix for RX control handler functions
rt2x00: rt2800pci: move RX control handler functions to the rt2800mmio module
rt2x00: rt2800pci: use rt2800mmio prefix for interrupt functions
rt2x00: rt2800pci: move interrupt functions to the rt2800mmio module
rt2x00: rt2800pci: use rt2800mmio prefix for queue functions
rt2x00: rt2800pci: move queue functions to the rt2800mmio module
rt2x00: rt2800pci: use rt2800mmio prefix for initialization functions
rt2x00: rt2800pci: move initialization functions to the rt2800mmio module
rt2x00: rt2800pci: use separate ops for the SoC driver
rt2x00: rt2800pci: use separate read_eeprom callback for SoC devices
rt2x00: rt2800pci: use separate firmware callbacks for SoC devices
rt2x00: rt2800pci: use separate set_state callback for SoC devices
rt2x00: rt2800pci: rename rt2800pci_disable_radio function
rt2x00: rt2800pci: split rt2800pci_enable_radio function
rt2x00: rt2800pci: move rt2800mmio_enable_radio function to another module
rt2x00: rt2800pci: use separate hwcrypt_disabled callback for SoC devices
rt2x00: rt2800pci: move SoC specific code into a separate module
rt2x00: rt2800pci: use module_pci_driver macro
drivers/net/wireless/rt2x00/Kconfig | 27 +-
drivers/net/wireless/rt2x00/Makefile | 2 +
drivers/net/wireless/rt2x00/rt2800mmio.c | 873 +++++++++++++++++++++++++++
drivers/net/wireless/rt2x00/rt2800mmio.h | 165 ++++++
drivers/net/wireless/rt2x00/rt2800pci.c | 951 +-----------------------------
drivers/net/wireless/rt2x00/rt2800pci.h | 97 ---
drivers/net/wireless/rt2x00/rt2800soc.c | 263 +++++++++
7 files changed, 1348 insertions(+), 1030 deletions(-)
create mode 100644 drivers/net/wireless/rt2x00/rt2800mmio.c
create mode 100644 drivers/net/wireless/rt2x00/rt2800mmio.h
create mode 100644 drivers/net/wireless/rt2x00/rt2800soc.c
--
1.7.10
^ permalink raw reply
* [PATCH 04/21] rt2x00: rt2800pci: use rt2800mmio prefix for RX control handler functions
From: Gabor Juhos @ 2013-10-17 7:42 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, users, Gabor Juhos
In-Reply-To: <1381995755-16471-1-git-send-email-juhosg@openwrt.org>
The functions are used for devices with memory
mapped I/O and contain no PCI specific code at
all. Use rt2800mmio prefix instead of rt2800pci
in the function names to reflect that.
The patch contains no functional changes.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
drivers/net/wireless/rt2x00/rt2800pci.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index b2e2b09..37ac888 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -630,8 +630,8 @@ static int rt2800pci_set_device_state(struct rt2x00_dev *rt2x00dev,
/*
* RX control handlers
*/
-static void rt2800pci_fill_rxdone(struct queue_entry *entry,
- struct rxdone_entry_desc *rxdesc)
+static void rt2800mmio_fill_rxdone(struct queue_entry *entry,
+ struct rxdone_entry_desc *rxdesc)
{
struct queue_entry_priv_mmio *entry_priv = entry->priv_data;
__le32 *rxd = entry_priv->desc;
@@ -1119,7 +1119,7 @@ static const struct rt2x00lib_ops rt2800pci_rt2x00_ops = {
.write_tx_data = rt2800_write_tx_data,
.write_beacon = rt2800_write_beacon,
.clear_beacon = rt2800_clear_beacon,
- .fill_rxdone = rt2800pci_fill_rxdone,
+ .fill_rxdone = rt2800mmio_fill_rxdone,
.config_shared_key = rt2800_config_shared_key,
.config_pairwise_key = rt2800_config_pairwise_key,
.config_filter = rt2800_config_filter,
--
1.7.10
^ permalink raw reply related
* Re: [PATCH 5/5] net: rfkill: gpio: add ACPI support
From: Mika Westerberg @ 2013-10-17 7:44 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Heikki Krogerus, John W. Linville, Johannes Berg, Rhyland Klein,
linux-acpi, linux-wireless, netdev
In-Reply-To: <2878506.7lf24R85t6@vostro.rjw.lan>
On Wed, Oct 16, 2013 at 10:55:01PM +0200, Rafael J. Wysocki wrote:
> On Wednesday, October 16, 2013 01:53:43 PM Heikki Krogerus wrote:
> > Including ACPI ID for Broadcom GPS receiver BCM4752.
> >
> > Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> > ---
> > net/rfkill/rfkill-gpio.c | 31 ++++++++++++++++++++++++++++++-
> > 1 file changed, 30 insertions(+), 1 deletion(-)
> >
> > diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c
> > index 2dd78c6..5620d3c 100644
> > --- a/net/rfkill/rfkill-gpio.c
> > +++ b/net/rfkill/rfkill-gpio.c
> > @@ -24,6 +24,8 @@
> > #include <linux/platform_device.h>
> > #include <linux/clk.h>
> > #include <linux/slab.h>
> > +#include <linux/acpi.h>
> > +#include <linux/acpi_gpio.h>
> >
> > #include <linux/rfkill-gpio.h>
> >
> > @@ -70,6 +72,23 @@ static const struct rfkill_ops rfkill_gpio_ops = {
> > .set_block = rfkill_gpio_set_power,
> > };
> >
> > +static int rfkill_gpio_acpi_probe(struct device *dev,
> > + struct rfkill_gpio_data *rfkill)
> > +{
> > + const struct acpi_device_id *id;
> > +
> > + id = acpi_match_device(dev->driver->acpi_match_table, dev);
> > + if (!id)
> > + return -ENODEV;
> > +
> > + rfkill->name = dev_name(dev);
> > + rfkill->type = (unsigned)id->driver_data;
> > + rfkill->reset_gpio = acpi_get_gpio_by_index(dev, 0, NULL);
> > + rfkill->shutdown_gpio = acpi_get_gpio_by_index(dev, 1, NULL);
> > +
> > + return 0;
> > +}
> > +
> > static int rfkill_gpio_probe(struct platform_device *pdev)
> > {
> > struct rfkill_gpio_platform_data *pdata = pdev->dev.platform_data;
> > @@ -82,7 +101,11 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
> > if (!rfkill)
> > return -ENOMEM;
> >
> > - if (pdata) {
> > + if (ACPI_HANDLE(&pdev->dev)) {
> > + ret = rfkill_gpio_acpi_probe(&pdev->dev, rfkill);
> > + if (ret)
> > + return ret;
> > + } else if (pdata) {
> > clk_name = pdata->power_clk_name;
> > rfkill->name = pdata->name;
> > rfkill->type = pdata->type;
> > @@ -170,12 +193,18 @@ static int rfkill_gpio_remove(struct platform_device *pdev)
> > return 0;
> > }
> >
> > +static const struct acpi_device_id rfkill_acpi_match[] = {
> > + { "BCM4752", RFKILL_TYPE_GPS },
> > + { },
> > +};
> > +
> > static struct platform_driver rfkill_gpio_driver = {
> > .probe = rfkill_gpio_probe,
> > .remove = rfkill_gpio_remove,
> > .driver = {
> > .name = "rfkill_gpio",
> > .owner = THIS_MODULE,
> > + .acpi_match_table = ACPI_PTR(rfkill_acpi_match),
> > },
> > };
>
> Looks good to me.
>
> Has Mika seen this?
Yes, saw it now and looks good to me as well.
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
for the whole series, for what it's worth.
^ permalink raw reply
* Re: [PATCH v2 7/8] ath10k: fix device initialization routine
From: Kalle Valo @ 2013-10-17 5:33 UTC (permalink / raw)
To: Michal Kazior; +Cc: ath10k, linux-wireless
In-Reply-To: <CA+BoTQ=9cEwB7PY8VMGv1SmEPsH6WGmDEBgujmo9G=Cby82uyg@mail.gmail.com>
Michal Kazior <michal.kazior@tieto.com> writes:
> On 16 October 2013 08:57, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
>> Michal Kazior <michal.kazior@tieto.com> writes:
>>
>>>> + /* disable pending irqs */
>>>> + ath10k_pci_core_write32(ar, PCIE_INTR_ENABLE_ADDRESS, 0);
>>>> + ath10k_pci_core_write32(ar, PCIE_INTR_CLR_ADDRESS, ~0);
>>>
>>> These use SOC_CORE_BASE_ADDRESS as the suffix, not the RTC_SOC_BASE_ADDRESS.
>>
>> But I am using SOC_CORE_BASE_ADDRESS, right?
>
> Ah, right. Sorry. My eyesight failed me :) Those function names seem a
> little confusing (_core_ for SOC_CORE and _soc_ for RTC_SOC)
Yeah, I agree. I didn't research what RTC_SOC stands for, I just assumed
it contains registers for controlling the whole SOC state. That's why I
used "_soc_" here. And CORE registers control just one part of SOC.
--
Kalle Valo
^ permalink raw reply
* [PATCH] cfg80211/nl80211: Add support to report unsafe frequency ranges(s)
From: Rajesh Chauhan @ 2013-10-17 4:57 UTC (permalink / raw)
To: johannes, linux-wireless, rodrigue, jouni; +Cc: rajeshc
Add support for WLAN driver to report unsafe frequency range(s). User
space should move SAP/P2P-GO out of those unsafe frequency range(s).
User space may decide to continue operation on unsafe frequency but in
such case there might be impact on performance because of interference.
Signed-off-by: Rajesh Chauhan <rajeshc@qca.qualcomm.com>
---
include/net/cfg80211.h | 30 +++++++++++++++++++
include/uapi/linux/nl80211.h | 31 ++++++++++++++++++++
net/wireless/nl80211.c | 68 ++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 129 insertions(+)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 45f6bf5..25b54dc 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1933,6 +1933,24 @@ struct cfg80211_update_ft_ies_params {
};
/**
+ * struct cfg80211_avoid_frequency_range - frequency range(s) to avoid
+ *
+ * This structure provides frequency range(s) that should be avoided
+ *
+ * @start_freq: start of frequency (KHz)
+ * @end_freq: end of frequency (KHz)
+ */
+struct cfg80211_avoid_frequency_range {
+ unsigned int start_freq;
+ unsigned int end_freq;
+};
+
+struct cfg80211_avoid_frequency_list {
+ unsigned int n_freq_ranges;
+ struct cfg80211_avoid_frequency_range *freq_range[0];
+};
+
+/**
* struct cfg80211_ops - backend description for wireless configuration
*
* This struct is registered by fullmac card drivers and/or wireless stacks
@@ -4340,6 +4358,18 @@ void cfg80211_ft_event(struct net_device *netdev,
struct cfg80211_ft_event_params *ft_event);
/**
+ * cfg80211_avoid_frequency_event - notify userspace about frequency range(s)
+ * @netdev: network device
+ * @freq_list: frequency range(s) information
+ * @gfp: allocation flags
+ *
+ * WLAN driver calls this function to notify userspace about frequency
+ * range(s) that should be avoided.
+ */
+void cfg80211_avoid_frequency_event(struct net_device *netdev,
+ struct cfg80211_avoid_frequency_list *freq_list, gfp_t gfp);
+
+/**
* cfg80211_get_p2p_attr - find and copy a P2P attribute from IE buffer
* @ies: the input IE buffer
* @len: the input length
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index fde2c02..457fd67 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -686,6 +686,13 @@
* other station that transmission must be blocked until the channel
* switch is complete.
*
+ * @NL80211_CMD_AVOID_FREQUENCIES_EVENT: Send range(s) of frequencies that
+ * should be avoided, from the WLAN driver to the user space. WLAN driver
+ * may send unsafe frequencies to avoid interference. User space should
+ * move SAP/P2P-GO out of those unsafe frequency ranges. User space may
+ * decide to continue operation on unsafe frequency but in such case,
+ * performance might get impact.
+ *
* @NL80211_CMD_MAX: highest used command number
* @__NL80211_CMD_AFTER_LAST: internal use
*/
@@ -853,6 +860,8 @@ enum nl80211_commands {
NL80211_CMD_CHANNEL_SWITCH,
+ NL80211_CMD_AVOID_FREQUENCIES_EVENT,
+
/* add new commands above here */
/* used to define NL80211_CMD_MAX below */
@@ -1496,6 +1505,8 @@ enum nl80211_commands {
* @NL80211_ATTR_RXMGMT_FLAGS: flags for nl80211_send_mgmt(), u32.
* As specified in the &enum nl80211_rxmgmt_flags.
*
+ * @NL80211_ATTR_AVOID_FREQUENCIES: Avoid frequencies container information
+ *
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
*/
@@ -1806,6 +1817,8 @@ enum nl80211_attrs {
NL80211_ATTR_RXMGMT_FLAGS,
+ NL80211_ATTR_AVOID_FREQUENCIES,
+
/* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST,
@@ -2255,6 +2268,24 @@ enum nl80211_frequency_attr {
#define NL80211_FREQUENCY_ATTR_MAX_TX_POWER NL80211_FREQUENCY_ATTR_MAX_TX_POWER
/**
+ * enum nl80211_avoid_frequency_attr - avoid frequency attributes
+ * @__NL80211_FREQUENCY_ATTR_INVALID: attribute number 0 is reserved
+ * @NL80211_AVOID_FREQUENCY_ATTR_START_FREQ: Start of frequency (KHz) range
+ * @NL80211_AVOID_FREQUENCY_ATTR_END_FREQ: End of frequency (KHz) range
+ * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
+ */
+enum nl80211_avoid_frequency_attr {
+ __NL80211_AVOID_FREQUENCY_ATTR_INVALID,
+ NL80211_AVOID_FREQUENCY_ATTR_START_FREQ,
+ NL80211_AVOID_FREQUENCY_ATTR_END_FREQ,
+
+ /* keep last */
+ __NL80211_AVOID_FREQUENCY_ATTR_AFTER_LAST,
+ NL80211_AVOID_FREQUENCY_ATTR_MAX =
+ __NL80211_AVOID_FREQUENCY_ATTR_AFTER_LAST - 1
+};
+
+/**
* enum nl80211_bitrate_attr - bitrate attributes
* @__NL80211_BITRATE_ATTR_INVALID: attribute number 0 is reserved
* @NL80211_BITRATE_ATTR_RATE: Bitrate in units of 100 kbps
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index cbbef88..dc3443a 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -354,6 +354,7 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
[NL80211_ATTR_CSA_IES] = { .type = NLA_NESTED },
[NL80211_ATTR_CSA_C_OFF_BEACON] = { .type = NLA_U16 },
[NL80211_ATTR_CSA_C_OFF_PRESP] = { .type = NLA_U16 },
+ [NL80211_ATTR_AVOID_FREQUENCIES] = { .type = NLA_NESTED },
};
/* policy for the key attributes */
@@ -11234,6 +11235,73 @@ void cfg80211_ft_event(struct net_device *netdev,
}
EXPORT_SYMBOL(cfg80211_ft_event);
+void cfg80211_avoid_frequency_event(struct net_device *netdev,
+ struct cfg80211_avoid_frequency_list *freq_list, gfp_t gfp)
+{
+ struct wiphy *wiphy;
+ struct cfg80211_registered_device *rdev;
+ struct sk_buff *msg;
+ void *hdr;
+ struct nlattr *nl_ranges, *nl_range;
+ int err = -EINVAL;
+ unsigned int i;
+
+ if (!netdev || !netdev->ieee80211_ptr ||
+ !netdev->ieee80211_ptr->wiphy || !freq_list)
+ return;
+
+ wiphy = netdev->ieee80211_ptr->wiphy;
+ rdev = wiphy_to_dev(wiphy);
+
+ if (!rdev)
+ return;
+
+ msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp);
+ if (!msg)
+ return;
+
+ hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_AVOID_FREQUENCIES_EVENT);
+ if (!hdr) {
+ nlmsg_free(msg);
+ return;
+ }
+
+ if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
+ nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex))
+ goto nla_put_failure;
+
+ nl_ranges = nla_nest_start(msg, NL80211_ATTR_AVOID_FREQUENCIES);
+ if (!nl_ranges)
+ goto nla_put_failure;
+
+ for (i = 0; i < freq_list->n_freq_ranges; i++) {
+ nl_range = nla_nest_start(msg, i);
+ if (!nl_range)
+ goto nla_put_failure;
+
+ if (nla_put_u32(msg, NL80211_AVOID_FREQUENCY_ATTR_START_FREQ,
+ freq_list->freq_range[i]->start_freq) ||
+ nla_put_u32(msg, NL80211_AVOID_FREQUENCY_ATTR_END_FREQ,
+ freq_list->freq_range[i]->end_freq))
+ goto nla_put_failure;
+ nla_nest_end(msg, nl_range);
+ }
+ nla_nest_end(msg, nl_ranges);
+
+ err = genlmsg_end(msg, hdr);
+ if (err < 0)
+ goto nla_put_failure;
+
+ genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
+ nl80211_mlme_mcgrp.id, gfp);
+ return;
+
+nla_put_failure:
+ genlmsg_cancel(msg, hdr);
+ nlmsg_free(msg);
+}
+EXPORT_SYMBOL(cfg80211_avoid_frequency_event);
+
void cfg80211_crit_proto_stopped(struct wireless_dev *wdev, gfp_t gfp)
{
struct cfg80211_registered_device *rdev;
--
1.8.4
^ permalink raw reply related
* Re: ath9k AR9287 status?
From: Sujith Manoharan @ 2013-10-17 2:08 UTC (permalink / raw)
To: Bruno Randolf; +Cc: Oleksij Rempel, linux-wireless, nbd, Ingo Randolf
In-Reply-To: <524DA3DC.6060806@einfach.org>
Bruno Randolf wrote:
> I just tried current wireless-testing (3.12.0-rc3-wl) and it shows the
> same problems.
>
> For reference:
>
> Card: Unex DNXA-97 (AR9287) http://unex.com.tw/product/dnxa-97
> Board: Advantech MIO-2261N (Atom N260)
>
> ASPM is disabled in the BIOS and by pcie_aspm=off. Scanning seems to
> work, but when I start up hostapd (v2.0, simple AP config) nothing
> happens (no AP is found by clients). When I stop hostapd the system
> freezes with "BUG: soft lockup - CPU#3 stuck for 23s! (hostapd:2250)"
Can you post the kernel log with latest wireless-testing ?
Please load the driver with debug=0x8f49.
Sujith
^ permalink raw reply
* [PATCH] drivers: net: wireless: b43: Fix possible NULL ptr dereference
From: Felipe Pena @ 2013-10-17 0:40 UTC (permalink / raw)
To: Stefano Brivio, John W. Linville
Cc: linux-wireless, b43-dev, netdev, linux-kernel, Felipe Pena
On the ternary expression the 'e' variable could be NULL dereferenced,
when b43_nphy_get_rf_ctl_over_rev7 function returns NULL.
Signed-off-by: Felipe Pena <felipensp@gmail.com>
---
drivers/net/wireless/b43/phy_n.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 7c970d3..05ee7f1 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -164,7 +164,8 @@ static void b43_nphy_rf_ctl_override_rev7(struct b43_wldev *dev, u16 field,
}
en_addr = en_addrs[override][i];
- val_addr = (i == 0) ? e->val_addr_core0 : e->val_addr_core1;
+ if (e)
+ val_addr = (i == 0) ? e->val_addr_core0 : e->val_addr_core1;
if (off) {
b43_phy_mask(dev, en_addr, ~en_mask);
--
1.7.10.4
^ permalink raw reply related
* Re: [PATCH 2/2] staging: vt6656: rxtx change u32 [4] aWTxKey to u8[16] tx_key
From: Malcolm @ 2013-10-16 21:25 UTC (permalink / raw)
To: Greg KH; +Cc: linux-wireless
In-Reply-To: <20131016194638.GA25749@kroah.com>
On 16/10/13 20:46, Greg KH wrote:
> On Tue, Oct 15, 2013 at 09:46:49PM +0100, Malcolm Priestley wrote:
>> Replace 4 x u32 aWTxKey with u8 array of 16 bytes tx_key.
>>
>> Replaces pbyBuf in s_vFillTxKey and connects pbyTxBufferAddr
>> directly to tx_key without a cast elsewhere in structure.
>>
>> Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
> This patch causes a bunch of compiler warnings to get spit out by the
> compiler, so I can't take it.
>
> Please fix them up and resend.
hmm for some reason I am not getting them on gcc 4.8.1
Anyway, I will drop this patch for now. It requires changes elsewhere.
Malcolm
^ permalink raw reply
* Re: [PATCH 5/5] net: rfkill: gpio: add ACPI support
From: Rafael J. Wysocki @ 2013-10-16 20:55 UTC (permalink / raw)
To: Heikki Krogerus
Cc: John W. Linville, Johannes Berg, Rhyland Klein, linux-acpi,
linux-wireless, netdev, Mika Westerberg
In-Reply-To: <1381920823-15403-6-git-send-email-heikki.krogerus@linux.intel.com>
On Wednesday, October 16, 2013 01:53:43 PM Heikki Krogerus wrote:
> Including ACPI ID for Broadcom GPS receiver BCM4752.
>
> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> net/rfkill/rfkill-gpio.c | 31 ++++++++++++++++++++++++++++++-
> 1 file changed, 30 insertions(+), 1 deletion(-)
>
> diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c
> index 2dd78c6..5620d3c 100644
> --- a/net/rfkill/rfkill-gpio.c
> +++ b/net/rfkill/rfkill-gpio.c
> @@ -24,6 +24,8 @@
> #include <linux/platform_device.h>
> #include <linux/clk.h>
> #include <linux/slab.h>
> +#include <linux/acpi.h>
> +#include <linux/acpi_gpio.h>
>
> #include <linux/rfkill-gpio.h>
>
> @@ -70,6 +72,23 @@ static const struct rfkill_ops rfkill_gpio_ops = {
> .set_block = rfkill_gpio_set_power,
> };
>
> +static int rfkill_gpio_acpi_probe(struct device *dev,
> + struct rfkill_gpio_data *rfkill)
> +{
> + const struct acpi_device_id *id;
> +
> + id = acpi_match_device(dev->driver->acpi_match_table, dev);
> + if (!id)
> + return -ENODEV;
> +
> + rfkill->name = dev_name(dev);
> + rfkill->type = (unsigned)id->driver_data;
> + rfkill->reset_gpio = acpi_get_gpio_by_index(dev, 0, NULL);
> + rfkill->shutdown_gpio = acpi_get_gpio_by_index(dev, 1, NULL);
> +
> + return 0;
> +}
> +
> static int rfkill_gpio_probe(struct platform_device *pdev)
> {
> struct rfkill_gpio_platform_data *pdata = pdev->dev.platform_data;
> @@ -82,7 +101,11 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
> if (!rfkill)
> return -ENOMEM;
>
> - if (pdata) {
> + if (ACPI_HANDLE(&pdev->dev)) {
> + ret = rfkill_gpio_acpi_probe(&pdev->dev, rfkill);
> + if (ret)
> + return ret;
> + } else if (pdata) {
> clk_name = pdata->power_clk_name;
> rfkill->name = pdata->name;
> rfkill->type = pdata->type;
> @@ -170,12 +193,18 @@ static int rfkill_gpio_remove(struct platform_device *pdev)
> return 0;
> }
>
> +static const struct acpi_device_id rfkill_acpi_match[] = {
> + { "BCM4752", RFKILL_TYPE_GPS },
> + { },
> +};
> +
> static struct platform_driver rfkill_gpio_driver = {
> .probe = rfkill_gpio_probe,
> .remove = rfkill_gpio_remove,
> .driver = {
> .name = "rfkill_gpio",
> .owner = THIS_MODULE,
> + .acpi_match_table = ACPI_PTR(rfkill_acpi_match),
> },
> };
Looks good to me.
Has Mika seen this?
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply
* Re: [PATCH 2/2] staging: vt6656: rxtx change u32 [4] aWTxKey to u8[16] tx_key
From: Greg KH @ 2013-10-16 19:46 UTC (permalink / raw)
To: Malcolm Priestley; +Cc: linux-wireless
In-Reply-To: <1381870009.5100.45.camel@canaries32-MCP7A>
On Tue, Oct 15, 2013 at 09:46:49PM +0100, Malcolm Priestley wrote:
> Replace 4 x u32 aWTxKey with u8 array of 16 bytes tx_key.
>
> Replaces pbyBuf in s_vFillTxKey and connects pbyTxBufferAddr
> directly to tx_key without a cast elsewhere in structure.
>
> Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
This patch causes a bunch of compiler warnings to get spit out by the
compiler, so I can't take it.
Please fix them up and resend.
thanks,
greg k-h
^ permalink raw reply
* Re: p54usb raspberry pi no wlan0 device
From: Andrey @ 2013-10-16 16:35 UTC (permalink / raw)
To: linux-wireless
In-Reply-To: <trinity-4366d417-bdc3-4e3b-a613-25b1af7a51a7-1379880343916@3capp-gmx-bs34>
<the_force@...> writes:
>
>
> Hi Folks,
>
> i want to use an Corega WLUSB2GTST USB adapter on my Raspberry Pi linux
device. I used fwextract utility with
> the driver file (Windows 2000 driver, nobyteswap option). So i got these
2 files:
>
> cgwlusb200.arm
> cgwlusb201.arm
>
> I have copied these files (i tried cgwlusb200.arm also cgwlusb201.arm) to
the following location on my
> Raspberry Pi:
>
> /lib/firmware/isl3887usb
> /lib/modules/3.6.11+/kernel/drivers/net/wireless/isl3887usb
>
> After doing a modprobe p54usb, the module seems to load fine:
>
> root <at> pinulldrei:/lib/firmware# lsmod
> ModuleSize Used by
> p54usb 11627 0
> p54common 30229 1 p54usb
> crc_ccitt 1530 1 p54common
> mac80211 273979 2 p54common,p54usb
> cfg80211 184390 2 mac80211,p54common
> rfkill 18298 1 cfg80211
> tun 14995 2
> snd_bcm2835 16432 0
> snd_pcm 77728 1 snd_bcm2835
> snd_seq 53482 0
> snd_timer 20110 2 snd_pcm,snd_seq
> snd_seq_device 6462 1 snd_seq
> snd 58744 5 snd_bcm2835,snd_timer,snd_pcm,snd_seq,snd_seq_device
> snd_page_alloc 5169 1 snd_pcm
> leds_gpio 2243 0
> led_class 3570 2 leds_gpio,p54common
> root <at> pinulldrei:/lib/firmware#
>
> dmesg says:
> [1031466.099404] usb 1-1.2.1: new high-speed USB device number 10 using
dwc_otg
> [1031466.202908] usb 1-1.2.1: New USB device found, idVendor=07aa,
idProduct=0020
> [1031466.202939] usb 1-1.2.1: New USB device strings: Mfr=1, Product=2,
SerialNumber=3
> [1031554.700433] cfg80211: Calling CRDA to update world regulatory domain
> [1031554.755865] usbcore: registered new interface driver p54usb
>
> /var/log/messages says:
> Sep 22 21:33:08 pinulldrei kernel: [1031466.099404] usb 1-1.2.1: new high-
speed USB device number 10
> using dwc_otg
> Sep 22 21:33:09 pinulldrei kernel: [1031466.202908] usb 1-1.2.1: New USB
device found, idVendor=07aa, idProduct=0020
> Sep 22 21:33:09 pinulldrei kernel: [1031466.202939] usb 1-1.2.1: New USB
device strings: Mfr=1,
> Product=2, SerialNumber=3
> Sep 22 21:34:37 pinulldrei kernel: [1031554.700433] cfg80211: Calling
CRDA to update world regulatory domain
> Sep 22 21:34:37 pinulldrei kernel: [1031554.755865] usbcore: registered
new interface driver p54usb
>
> Everything looks fine - but no wlan0 device will be created The led on
the stick will not turn on, so i think
> i have a driver problem.
>
> How can i debug / solve this problem?!?
>
> Greetings from Germany,
> Jörg
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless"
in
> the body of a message to majordomo@...
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
The same shit, it seems like p54usb doesn't provide support for this Corega
wi-fi stick. If you'd have done modinfo p54usb you could see that there's
no corega's vendor and device code among available aliases, the only one
Corega device listed is 07aa:001C (your Corega WLUSB2GTST has device id
07aa:0020), but it uses different ISL chip.
^ permalink raw reply
* Re: [PATCH 0/5] rfkill-gpio: ACPI support
From: Rhyland Klein @ 2013-10-16 16:13 UTC (permalink / raw)
To: Heikki Krogerus
Cc: John W. Linville, Johannes Berg, Rafael J. Wysocki,
linux-acpi@vger.kernel.org, linux-wireless@vger.kernel.org,
netdev@vger.kernel.org
In-Reply-To: <1381920823-15403-1-git-send-email-heikki.krogerus@linux.intel.com>
On 10/16/2013 6:53 AM, Heikki Krogerus wrote:
> Hi,
>
> The first patches prepare the driver for the support. The last patch
> can then add the support quite easily. With these patches, adding DT
> support later will be quite straight forward if someone needs it.
>
>
> Heikki Krogerus (5):
> net: rfkill: gpio: convert to resource managed allocation
> net: rfkill: gpio: clean up clock handling
> net: rfkill: gpio: spinlock-safe GPIO access
> net: rfkill: gpio: prepare for DT and ACPI support
> net: rfkill: gpio: add ACPI support
>
> net/rfkill/Kconfig | 2 +-
> net/rfkill/rfkill-gpio.c | 211 ++++++++++++++++++++++-------------------------
> 2 files changed, 99 insertions(+), 114 deletions(-)
>
Strictly speaking, duplicating the pdata fields into the
rfkill_gpio_data structure isn't really necessary. Many drivers simply
have the dt parsing or in this case ACPI parsing generate a
platform_data structure which would then be saved in the
rfkill_gpio_data structure.
In this case, since it is only a few fields, I am not too worried and I
am fine either way.
Acked-by: Rhyland Klein <rklein@nvidia.com>
--
nvpublic
^ permalink raw reply
* Re: [PATCH v2 7/8] ath10k: fix device initialization routine
From: Michal Kazior @ 2013-10-16 16:01 UTC (permalink / raw)
To: Kalle Valo; +Cc: ath10k, linux-wireless
In-Reply-To: <87ppr55hun.fsf@kamboji.qca.qualcomm.com>
On 16 October 2013 08:57, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
> Michal Kazior <michal.kazior@tieto.com> writes:
>
>>> + /* disable pending irqs */
>>> + ath10k_pci_core_write32(ar, PCIE_INTR_ENABLE_ADDRESS, 0);
>>> + ath10k_pci_core_write32(ar, PCIE_INTR_CLR_ADDRESS, ~0);
>>
>> These use SOC_CORE_BASE_ADDRESS as the suffix, not the RTC_SOC_BASE_ADDRESS.
>
> But I am using SOC_CORE_BASE_ADDRESS, right?
Ah, right. Sorry. My eyesight failed me :) Those function names seem a
little confusing (_core_ for SOC_CORE and _soc_ for RTC_SOC)
Michał
^ permalink raw reply
* Re: [PATCH v2 7/8] ath10k: fix device initialization routine
From: Kalle Valo @ 2013-10-16 15:57 UTC (permalink / raw)
To: Michal Kazior; +Cc: ath10k, linux-wireless
In-Reply-To: <CA+BoTQkqkuf-=a4giyJHeYdXZ2T3deU7nmuQOxpFcKSzWjGb3Q@mail.gmail.com>
Michal Kazior <michal.kazior@tieto.com> writes:
>> + /* disable pending irqs */
>> + ath10k_pci_core_write32(ar, PCIE_INTR_ENABLE_ADDRESS, 0);
>> + ath10k_pci_core_write32(ar, PCIE_INTR_CLR_ADDRESS, ~0);
>
> These use SOC_CORE_BASE_ADDRESS as the suffix, not the RTC_SOC_BASE_ADDRESS.
But I am using SOC_CORE_BASE_ADDRESS, right?
static inline u32 ath10k_pci_core_read32(struct ath10k *ar, u32 addr)
{
return ath10k_pci_read32(ar, SOC_CORE_BASE_ADDRESS + addr);
}
static inline void ath10k_pci_core_write32(struct ath10k *ar, u32 addr, u32 val)
{
ath10k_pci_write32(ar, SOC_CORE_BASE_ADDRESS + addr, val);
}
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH v2 6/8] ath10k: implement ath10k_pci_soc_read/write32()
From: Kalle Valo @ 2013-10-16 15:55 UTC (permalink / raw)
To: Michal Kazior; +Cc: ath10k, linux-wireless
In-Reply-To: <CA+BoTQmP14xuXP=D4mEsJiWOXvtg0iJ4=BmUb=89QgA_AX5edA@mail.gmail.com>
Michal Kazior <michal.kazior@tieto.com> writes:
> On 16 October 2013 06:46, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
>> To make it easier to access SOC registers. No functional
>> changes.
>>
>> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
>> ---
>> drivers/net/wireless/ath/ath10k/pci.c | 3 +--
>> drivers/net/wireless/ath/ath10k/pci.h | 10 ++++++++++
>> 2 files changed, 11 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
>> index d09f8a2..5c78383 100644
>> --- a/drivers/net/wireless/ath/ath10k/pci.c
>> +++ b/drivers/net/wireless/ath/ath10k/pci.c
>> @@ -2454,8 +2454,7 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
>> return ret;
>> }
>>
>> - chip_id = ath10k_pci_read32(ar,
>> - RTC_SOC_BASE_ADDRESS + SOC_CHIP_ID_ADDRESS);
>> + chip_id = ath10k_pci_soc_read32(ar, SOC_CHIP_ID_ADDRESS);
>>
>> ath10k_do_pci_sleep(ar);
>>
>> diff --git a/drivers/net/wireless/ath/ath10k/pci.h b/drivers/net/wireless/ath/ath10k/pci.h
>> index 52fb7b9..a304c33 100644
>> --- a/drivers/net/wireless/ath/ath10k/pci.h
>> +++ b/drivers/net/wireless/ath/ath10k/pci.h
>> @@ -318,6 +318,16 @@ static inline u32 ath10k_pci_read32(struct ath10k *ar, u32 offset)
>> return ioread32(ar_pci->mem + offset);
>> }
>>
>> +static inline u32 ath10k_pci_soc_read32(struct ath10k *ar, u32 addr)
>> +{
>> + return ath10k_pci_read32(ar, RTC_SOC_BASE_ADDRESS + addr);
>> +}
>> +
>> +static inline void ath10k_pci_soc_write32(struct ath10k *ar, u32 addr, u32 val)
>> +{
>> + ath10k_pci_write32(ar, RTC_SOC_BASE_ADDRESS + addr, val);
>> +}
>> +
>
> I'm not entirely sure about this. There are a couple of soc address
> groups (RTC_SOC, RTC_WMAC, SOC_PCIE, SOC_CORE, ..).
And then we can have different functions for each group.
> I'd rather use just raw ioread/iowrite than have all those wrappers.
Well, I again would prefer to have clean interfaces instead of doing
address arithmetic in every call :)
> I think the reason for having ath10k_pci_{read,write}32 was the HW v1
> workaround.
No, it was also to make the code simple.
> Do we really need to keep it?
In my opinion yes. What is the negative side of keeping them? Why don't
you like these wrappers?
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH v2 7/8] ath10k: fix device initialization routine
From: Michal Kazior @ 2013-10-16 15:44 UTC (permalink / raw)
To: Kalle Valo; +Cc: ath10k, linux-wireless
In-Reply-To: <20131016134617.25095.10581.stgit@localhost6.localdomain6>
On 16 October 2013 06:46, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
> From: Michal Kazior <michal.kazior@tieto.com>
>
> Hardware revision 2 does not support cold reset
> correctly. As such it would sometimes lead to host
> machine freeze or data bus errors.
>
> The patch introduces warm reset function which is
> used instead of the cold reset one. It also moves
> the reset before interrupts are being set up to
> prevent any kind of spurious interrupts from being
> handled.
>
> kvalo: use ath10k_pci_write32() style wrappers, fix long
> lines
>
> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
> ---
[...]
> @@ -1825,16 +1824,78 @@ static void ath10k_pci_fw_interrupt_handler(struct ath10k *ar)
> ath10k_pci_sleep(ar);
> }
>
> -static int ath10k_pci_hif_power_up(struct ath10k *ar)
> +static int ath10k_pci_warm_reset(struct ath10k *ar)
> {
> struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
> int ret;
> + u32 val;
>
> - ret = ath10k_pci_start_intr(ar);
> - if (ret) {
> - ath10k_err("could not start interrupt handling (%d)\n", ret);
> - goto err;
> - }
> + ath10k_dbg(ATH10K_DBG_BOOT, "performing warm chip reset\n");
> +
> + ret = ath10k_do_pci_wake(ar);
> + if (ret)
> + return ret;
> +
> + ath10k_dbg(ATH10K_DBG_BOOT,
> + "pci intr cause 0x%08x cpu intr 0x%08x (before)\n",
> + ath10k_pci_core_read32(ar, PCIE_INTR_CAUSE_ADDRESS),
> + ath10k_pci_core_read32(ar, CPU_INTR_ADDRESS));
> +
> + /* disable pending irqs */
> + ath10k_pci_core_write32(ar, PCIE_INTR_ENABLE_ADDRESS, 0);
> + ath10k_pci_core_write32(ar, PCIE_INTR_CLR_ADDRESS, ~0);
These use SOC_CORE_BASE_ADDRESS as the suffix, not the RTC_SOC_BASE_ADDRESS.
> + ath10k_dbg(ATH10K_DBG_BOOT,
> + "pci intr cause 0x%08x cpu intr 0x%08x (after)\n",
> + ath10k_pci_core_read32(ar, PCIE_INTR_CAUSE_ADDRESS),
> + ath10k_pci_core_read32(ar, CPU_INTR_ADDRESS));
Ditto. These are in SOC_CORE_BASE_ADDRESS group.
Michał
^ permalink raw reply
* Re: [PATCH v2 6/8] ath10k: implement ath10k_pci_soc_read/write32()
From: Michal Kazior @ 2013-10-16 15:38 UTC (permalink / raw)
To: Kalle Valo; +Cc: ath10k, linux-wireless
In-Reply-To: <20131016134611.25095.80204.stgit@localhost6.localdomain6>
On 16 October 2013 06:46, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
> To make it easier to access SOC registers. No functional
> changes.
>
> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
> ---
> drivers/net/wireless/ath/ath10k/pci.c | 3 +--
> drivers/net/wireless/ath/ath10k/pci.h | 10 ++++++++++
> 2 files changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
> index d09f8a2..5c78383 100644
> --- a/drivers/net/wireless/ath/ath10k/pci.c
> +++ b/drivers/net/wireless/ath/ath10k/pci.c
> @@ -2454,8 +2454,7 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
> return ret;
> }
>
> - chip_id = ath10k_pci_read32(ar,
> - RTC_SOC_BASE_ADDRESS + SOC_CHIP_ID_ADDRESS);
> + chip_id = ath10k_pci_soc_read32(ar, SOC_CHIP_ID_ADDRESS);
>
> ath10k_do_pci_sleep(ar);
>
> diff --git a/drivers/net/wireless/ath/ath10k/pci.h b/drivers/net/wireless/ath/ath10k/pci.h
> index 52fb7b9..a304c33 100644
> --- a/drivers/net/wireless/ath/ath10k/pci.h
> +++ b/drivers/net/wireless/ath/ath10k/pci.h
> @@ -318,6 +318,16 @@ static inline u32 ath10k_pci_read32(struct ath10k *ar, u32 offset)
> return ioread32(ar_pci->mem + offset);
> }
>
> +static inline u32 ath10k_pci_soc_read32(struct ath10k *ar, u32 addr)
> +{
> + return ath10k_pci_read32(ar, RTC_SOC_BASE_ADDRESS + addr);
> +}
> +
> +static inline void ath10k_pci_soc_write32(struct ath10k *ar, u32 addr, u32 val)
> +{
> + ath10k_pci_write32(ar, RTC_SOC_BASE_ADDRESS + addr, val);
> +}
> +
I'm not entirely sure about this. There are a couple of soc address
groups (RTC_SOC, RTC_WMAC, SOC_PCIE, SOC_CORE, ..).
I'd rather use just raw ioread/iowrite than have all those wrappers. I
think the reason for having ath10k_pci_{read,write}32 was the HW v1
workaround. Do we really need to keep it?
Michał
^ permalink raw reply
* Re: [PATCH 0/7] ath10k: fixes 2013-10-15
From: Kalle Valo @ 2013-10-16 14:18 UTC (permalink / raw)
To: Michal Kazior; +Cc: linux-wireless, ath10k
In-Reply-To: <CA+BoTQ=wpEWF3sWavKSfKy4s6qW097amCt_VqbapZg-ECWOE=g@mail.gmail.com>
Michal Kazior <michal.kazior@tieto.com> writes:
> On 16 October 2013 05:56, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
>> Kalle Valo <kvalo@qca.qualcomm.com> writes:
>>
>> Michal, if it's ok for you I'll submit v2 of this patchset. I'll fix the
>> long line warnings and also I do small cleanup to the warm reset code.
>
> I am totally okay with this. Thank you for your trouble.
As you can see, I changed the warm reset code quite a lot. If you have
time, please review that carefully.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH 0/7] ath10k: fixes 2013-10-15
From: Michal Kazior @ 2013-10-16 14:05 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless, ath10k
In-Reply-To: <87bo2p74sp.fsf@kamboji.qca.qualcomm.com>
On 16 October 2013 05:56, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
> Kalle Valo <kvalo@qca.qualcomm.com> writes:
>
>> Michal Kazior <michal.kazior@tieto.com> writes:
>>
>>> This is a bunch of fixes I've had queued up for
>>> some time now. I was reluctant to send them
>>> without some additional checks and because some of
>>> the fixes are not ideal. At least we can get a
>>> discussion going if anything raises any serious
>>> concern.
>>>
>>>
>>> Michal Kazior (7):
>>> ath10k: prevent starting monitor without a vdev
>>> ath10k: add sanity checks for monitor management
>>> ath10k: fix endianess in prints
>>> ath10k: fix NSS reporting in RX
>>> ath10k: fix NULL deref upon early FW crash
>>> ath10k: fix device initialization routine
>>> ath10k: fix FW crashes on heavy TX on 10.1.389 AP FW
>>
>> I get few long line warnings:
>>
>> drivers/net/wireless/ath/ath10k/pci.c:1842: WARNING: line over 80 characters
>> drivers/net/wireless/ath/ath10k/pci.c:1844: WARNING: line over 80 characters
>> drivers/net/wireless/ath/ath10k/pci.c:1847: WARNING: line over 80 characters
>> drivers/net/wireless/ath/ath10k/pci.c:1848: WARNING: line over 80 characters
>> drivers/net/wireless/ath/ath10k/pci.c:1856: WARNING: line over 80 characters
>> drivers/net/wireless/ath/ath10k/pci.c:1875: WARNING: line over 80 characters
>> drivers/net/wireless/ath/ath10k/pci.c:1877: WARNING: line over 80 characters
>> drivers/net/wireless/ath/ath10k/pci.c:1883: WARNING: line over 80 characters
>> drivers/net/wireless/ath/ath10k/mac.c:2284: WARNING: line over 80 characters
>
> Michal, if it's ok for you I'll submit v2 of this patchset. I'll fix the
> long line warnings and also I do small cleanup to the warm reset code.
I am totally okay with this. Thank you for your trouble.
Micał
^ permalink raw reply
* [PATCH v2 8/8] ath10k: fix FW crashes on heavy TX on 10.1.389 AP FW
From: Kalle Valo @ 2013-10-16 13:46 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
In-Reply-To: <20131016134503.25095.8044.stgit@localhost6.localdomain6>
From: Michal Kazior <michal.kazior@tieto.com>
10.1.389 firmware has some differences in
calculation of number of outstanding HTT TX
completions. This led to FW crashes of 10.1.389
while main firmware branch was unnaffected.
The patch makes sure ath10k doesn't queue up more
MSDUs than it should.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/ce.c | 11 +++++++++++
drivers/net/wireless/ath/ath10k/htt_tx.c | 11 ++++-------
2 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/ce.c b/drivers/net/wireless/ath/ath10k/ce.c
index e46951b..d243f28 100644
--- a/drivers/net/wireless/ath/ath10k/ce.c
+++ b/drivers/net/wireless/ath/ath10k/ce.c
@@ -1050,6 +1050,17 @@ struct ath10k_ce_pipe *ath10k_ce_init(struct ath10k *ar,
u32 ctrl_addr = ath10k_ce_base_address(ce_id);
int ret;
+ /*
+ * Make sure there's enough CE ringbuffer entries for HTT TX to avoid
+ * additional TX locking checks.
+ *
+ * For the lack of a better place do the check here.
+ */
+ BUILD_BUG_ON(TARGET_NUM_MSDU_DESC >
+ (CE_HTT_H2T_MSG_SRC_NENTRIES - 1));
+ BUILD_BUG_ON(TARGET_10X_NUM_MSDU_DESC >
+ (CE_HTT_H2T_MSG_SRC_NENTRIES - 1));
+
ret = ath10k_pci_wake(ar);
if (ret)
return NULL;
diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c
index d9335e9..f1d36d2 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -85,16 +85,13 @@ void ath10k_htt_tx_free_msdu_id(struct ath10k_htt *htt, u16 msdu_id)
int ath10k_htt_tx_attach(struct ath10k_htt *htt)
{
- u8 pipe;
-
spin_lock_init(&htt->tx_lock);
init_waitqueue_head(&htt->empty_tx_wq);
- /* At the beginning free queue number should hint us the maximum
- * queue length */
- pipe = htt->ar->htc.endpoint[htt->eid].ul_pipe_id;
- htt->max_num_pending_tx = ath10k_hif_get_free_queue_number(htt->ar,
- pipe);
+ if (test_bit(ATH10K_FW_FEATURE_WMI_10X, htt->ar->fw_features))
+ htt->max_num_pending_tx = TARGET_10X_NUM_MSDU_DESC;
+ else
+ htt->max_num_pending_tx = TARGET_NUM_MSDU_DESC;
ath10k_dbg(ATH10K_DBG_BOOT, "htt tx max num pending tx %d\n",
htt->max_num_pending_tx);
^ permalink raw reply related
* [PATCH v2 7/8] ath10k: fix device initialization routine
From: Kalle Valo @ 2013-10-16 13:46 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
In-Reply-To: <20131016134503.25095.8044.stgit@localhost6.localdomain6>
From: Michal Kazior <michal.kazior@tieto.com>
Hardware revision 2 does not support cold reset
correctly. As such it would sometimes lead to host
machine freeze or data bus errors.
The patch introduces warm reset function which is
used instead of the cold reset one. It also moves
the reset before interrupts are being set up to
prevent any kind of spurious interrupts from being
handled.
kvalo: use ath10k_pci_write32() style wrappers, fix long
lines
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/hw.h | 7 ++
drivers/net/wireless/ath/ath10k/pci.c | 130 ++++++++++++++++++++-------------
drivers/net/wireless/ath/ath10k/pci.h | 10 +++
3 files changed, 97 insertions(+), 50 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h
index 8aeb46d..2032737 100644
--- a/drivers/net/wireless/ath/ath10k/hw.h
+++ b/drivers/net/wireless/ath/ath10k/hw.h
@@ -204,8 +204,11 @@ enum ath10k_mcast2ucast_mode {
#define WLAN_ANALOG_INTF_PCIE_BASE_ADDRESS 0x0006c000
#define PCIE_LOCAL_BASE_ADDRESS 0x00080000
+#define SOC_RESET_CONTROL_ADDRESS 0x00000000
#define SOC_RESET_CONTROL_OFFSET 0x00000000
#define SOC_RESET_CONTROL_SI0_RST_MASK 0x00000001
+#define SOC_RESET_CONTROL_CE_RST_MASK 0x00040000
+#define SOC_RESET_CONTROL_CPU_WARM_RST_MASK 0x00000040
#define SOC_CPU_CLOCK_OFFSET 0x00000020
#define SOC_CPU_CLOCK_STANDARD_LSB 0
#define SOC_CPU_CLOCK_STANDARD_MASK 0x00000003
@@ -215,6 +218,8 @@ enum ath10k_mcast2ucast_mode {
#define SOC_LPO_CAL_OFFSET 0x000000e0
#define SOC_LPO_CAL_ENABLE_LSB 20
#define SOC_LPO_CAL_ENABLE_MASK 0x00100000
+#define SOC_LF_TIMER_CONTROL0_ADDRESS 0x00000050
+#define SOC_LF_TIMER_CONTROL0_ENABLE_MASK 0x00000004
#define SOC_CHIP_ID_ADDRESS 0x000000ec
#define SOC_CHIP_ID_REV_LSB 8
@@ -269,8 +274,10 @@ enum ath10k_mcast2ucast_mode {
#define CORE_CTRL_CPU_INTR_MASK 0x00002000
#define CORE_CTRL_ADDRESS 0x0000
#define PCIE_INTR_ENABLE_ADDRESS 0x0008
+#define PCIE_INTR_CAUSE_ADDRESS 0x000c
#define PCIE_INTR_CLR_ADDRESS 0x0014
#define SCRATCH_3_ADDRESS 0x0030
+#define CPU_INTR_ADDRESS 0x0010
/* Firmware indications to the Host via SCRATCH_3 register. */
#define FW_INDICATOR_ADDRESS (SOC_CORE_BASE_ADDRESS + SCRATCH_3_ADDRESS)
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index 5c78383..1e9cfcc9 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -52,7 +52,6 @@ static int ath10k_pci_post_rx_pipe(struct ath10k_pci_pipe *pipe_info,
int num);
static void ath10k_pci_rx_pipe_cleanup(struct ath10k_pci_pipe *pipe_info);
static void ath10k_pci_stop_ce(struct ath10k *ar);
-static void ath10k_pci_device_reset(struct ath10k *ar);
static int ath10k_pci_reset_target(struct ath10k *ar);
static int ath10k_pci_start_intr(struct ath10k *ar);
static void ath10k_pci_stop_intr(struct ath10k *ar);
@@ -1825,16 +1824,78 @@ static void ath10k_pci_fw_interrupt_handler(struct ath10k *ar)
ath10k_pci_sleep(ar);
}
-static int ath10k_pci_hif_power_up(struct ath10k *ar)
+static int ath10k_pci_warm_reset(struct ath10k *ar)
{
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
int ret;
+ u32 val;
- ret = ath10k_pci_start_intr(ar);
- if (ret) {
- ath10k_err("could not start interrupt handling (%d)\n", ret);
- goto err;
- }
+ ath10k_dbg(ATH10K_DBG_BOOT, "performing warm chip reset\n");
+
+ ret = ath10k_do_pci_wake(ar);
+ if (ret)
+ return ret;
+
+ ath10k_dbg(ATH10K_DBG_BOOT,
+ "pci intr cause 0x%08x cpu intr 0x%08x (before)\n",
+ ath10k_pci_core_read32(ar, PCIE_INTR_CAUSE_ADDRESS),
+ ath10k_pci_core_read32(ar, CPU_INTR_ADDRESS));
+
+ /* disable pending irqs */
+ ath10k_pci_core_write32(ar, PCIE_INTR_ENABLE_ADDRESS, 0);
+ ath10k_pci_core_write32(ar, PCIE_INTR_CLR_ADDRESS, ~0);
+
+ msleep(100);
+
+ /* clear fw indicator */
+ ath10k_pci_write32(ar, ar_pci->fw_indicator_address, 0);
+
+ /* clear target LF timer interrupts */
+ val = ath10k_pci_soc_read32(ar, SOC_LF_TIMER_CONTROL0_ADDRESS);
+ ath10k_pci_soc_write32(ar, SOC_LF_TIMER_CONTROL0_ADDRESS,
+ val & ~SOC_LF_TIMER_CONTROL0_ENABLE_MASK);
+
+ /* reset CE */
+ val = ath10k_pci_soc_read32(ar, SOC_RESET_CONTROL_ADDRESS);
+ val |= SOC_RESET_CONTROL_CE_RST_MASK;
+ ath10k_pci_soc_write32(ar, SOC_RESET_CONTROL_ADDRESS, val);
+ val = ath10k_pci_soc_read32(ar, SOC_RESET_CONTROL_ADDRESS);
+
+ msleep(10);
+
+ /* unreset CE */
+ val &= ~SOC_RESET_CONTROL_CE_RST_MASK;
+ ath10k_pci_soc_write32(ar, SOC_RESET_CONTROL_ADDRESS, val);
+ val = ath10k_pci_soc_read32(ar, SOC_RESET_CONTROL_ADDRESS);
+
+ msleep(10);
+
+ ath10k_dbg(ATH10K_DBG_BOOT,
+ "pci intr cause 0x%08x cpu intr 0x%08x (after)\n",
+ ath10k_pci_core_read32(ar, PCIE_INTR_CAUSE_ADDRESS),
+ ath10k_pci_core_read32(ar, CPU_INTR_ADDRESS));
+
+ /* CPU warm reset */
+ val = ath10k_pci_soc_read32(ar, SOC_RESET_CONTROL_ADDRESS);
+ ath10k_pci_soc_write32(ar, SOC_RESET_CONTROL_ADDRESS,
+ val | SOC_RESET_CONTROL_CPU_WARM_RST_MASK);
+
+ ath10k_dbg(ATH10K_DBG_BOOT, "soc reset control 0x%08x\n",
+ ath10k_pci_soc_read32(ar, SOC_RESET_CONTROL_ADDRESS));
+
+ msleep(100);
+
+ ath10k_dbg(ATH10K_DBG_BOOT, "warm reset complete\n");
+
+ ath10k_do_pci_sleep(ar);
+
+ return ret;
+}
+
+static int ath10k_pci_hif_power_up(struct ath10k *ar)
+{
+ struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
+ int ret;
/*
* Bring the target up cleanly.
@@ -1845,8 +1906,19 @@ static int ath10k_pci_hif_power_up(struct ath10k *ar)
* (aux) powered and running. On a subsequent driver load, the Target
* is in an unexpected state. We try to catch that here in order to
* reset the Target and retry the probe.
+ *
+ * Only HW v2 supports warm reset. Since ath10k does not support v1
+ * anymore just forget about cold reset which is broken on v2 for now.
*/
- ath10k_pci_device_reset(ar);
+ ret = ath10k_pci_warm_reset(ar);
+ if (ret)
+ goto err;
+
+ ret = ath10k_pci_start_intr(ar);
+ if (ret) {
+ ath10k_err("could not start interrupt handling (%d)\n", ret);
+ goto err;
+ }
ret = ath10k_pci_reset_target(ar);
if (ret)
@@ -2278,48 +2350,6 @@ static int ath10k_pci_reset_target(struct ath10k *ar)
return 0;
}
-static void ath10k_pci_device_reset(struct ath10k *ar)
-{
- int i;
- u32 val;
-
- if (!SOC_GLOBAL_RESET_ADDRESS)
- return;
-
- ath10k_pci_reg_write32(ar, PCIE_SOC_WAKE_ADDRESS,
- PCIE_SOC_WAKE_V_MASK);
- for (i = 0; i < ATH_PCI_RESET_WAIT_MAX; i++) {
- if (ath10k_pci_target_is_awake(ar))
- break;
- msleep(1);
- }
-
- /* Put Target, including PCIe, into RESET. */
- val = ath10k_pci_reg_read32(ar, SOC_GLOBAL_RESET_ADDRESS);
- val |= 1;
- ath10k_pci_reg_write32(ar, SOC_GLOBAL_RESET_ADDRESS, val);
-
- for (i = 0; i < ATH_PCI_RESET_WAIT_MAX; i++) {
- if (ath10k_pci_reg_read32(ar, RTC_STATE_ADDRESS) &
- RTC_STATE_COLD_RESET_MASK)
- break;
- msleep(1);
- }
-
- /* Pull Target, including PCIe, out of RESET. */
- val &= ~1;
- ath10k_pci_reg_write32(ar, SOC_GLOBAL_RESET_ADDRESS, val);
-
- for (i = 0; i < ATH_PCI_RESET_WAIT_MAX; i++) {
- if (!(ath10k_pci_reg_read32(ar, RTC_STATE_ADDRESS) &
- RTC_STATE_COLD_RESET_MASK))
- break;
- msleep(1);
- }
-
- ath10k_pci_reg_write32(ar, PCIE_SOC_WAKE_ADDRESS, PCIE_SOC_WAKE_RESET);
-}
-
static void ath10k_pci_dump_features(struct ath10k_pci *ar_pci)
{
int i;
diff --git a/drivers/net/wireless/ath/ath10k/pci.h b/drivers/net/wireless/ath/ath10k/pci.h
index a304c33..28e8ca2 100644
--- a/drivers/net/wireless/ath/ath10k/pci.h
+++ b/drivers/net/wireless/ath/ath10k/pci.h
@@ -328,6 +328,16 @@ static inline void ath10k_pci_soc_write32(struct ath10k *ar, u32 addr, u32 val)
ath10k_pci_write32(ar, RTC_SOC_BASE_ADDRESS + addr, val);
}
+static inline u32 ath10k_pci_core_read32(struct ath10k *ar, u32 addr)
+{
+ return ath10k_pci_read32(ar, SOC_CORE_BASE_ADDRESS + addr);
+}
+
+static inline void ath10k_pci_core_write32(struct ath10k *ar, u32 addr, u32 val)
+{
+ ath10k_pci_write32(ar, SOC_CORE_BASE_ADDRESS + addr, val);
+}
+
int ath10k_do_pci_wake(struct ath10k *ar);
void ath10k_do_pci_sleep(struct ath10k *ar);
^ permalink raw reply related
* [PATCH v2 6/8] ath10k: implement ath10k_pci_soc_read/write32()
From: Kalle Valo @ 2013-10-16 13:46 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
In-Reply-To: <20131016134503.25095.8044.stgit@localhost6.localdomain6>
To make it easier to access SOC registers. No functional
changes.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/pci.c | 3 +--
drivers/net/wireless/ath/ath10k/pci.h | 10 ++++++++++
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index d09f8a2..5c78383 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -2454,8 +2454,7 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
return ret;
}
- chip_id = ath10k_pci_read32(ar,
- RTC_SOC_BASE_ADDRESS + SOC_CHIP_ID_ADDRESS);
+ chip_id = ath10k_pci_soc_read32(ar, SOC_CHIP_ID_ADDRESS);
ath10k_do_pci_sleep(ar);
diff --git a/drivers/net/wireless/ath/ath10k/pci.h b/drivers/net/wireless/ath/ath10k/pci.h
index 52fb7b9..a304c33 100644
--- a/drivers/net/wireless/ath/ath10k/pci.h
+++ b/drivers/net/wireless/ath/ath10k/pci.h
@@ -318,6 +318,16 @@ static inline u32 ath10k_pci_read32(struct ath10k *ar, u32 offset)
return ioread32(ar_pci->mem + offset);
}
+static inline u32 ath10k_pci_soc_read32(struct ath10k *ar, u32 addr)
+{
+ return ath10k_pci_read32(ar, RTC_SOC_BASE_ADDRESS + addr);
+}
+
+static inline void ath10k_pci_soc_write32(struct ath10k *ar, u32 addr, u32 val)
+{
+ ath10k_pci_write32(ar, RTC_SOC_BASE_ADDRESS + addr, val);
+}
+
int ath10k_do_pci_wake(struct ath10k *ar);
void ath10k_do_pci_sleep(struct ath10k *ar);
^ 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