Skip to contentSkip to conversation

Add new mac80211 driver mwlwifi.

PATCH Superseded David Lin 2 participants 3 messages Jun 28, 2016 – Jul 19, 2016 1 message not in the archive

v8 of 9 Superseded Latest is v9 →

lore
Share & tools
lore

David Lin

author
#0 lore raw

PATCH v8 1/1 Add new mac80211 driver mwlwifi.

This patch provides the mwlwifi driver for Marvell 8863, 8864 and 8897 chipsets.
This driver was developed as part of the openwrt.org project to support Linksys WRT1900AC and is maintained on https://github.com/kaloz/mwlwifi.

The mwlwifi driver differs from existing mwifiex driver:
o mwlwifi is a "softmac driver" using the kernel mac802.11 subsystem to provide full AP/Wireless Bridge functionality (routers).
o mwifiex is a "fullmac driver" which provides a comprehensive set of client functions (laptops/embedded devices)
o only mwlwifi supports Marvell AP chip 886X series

NOTE: Users with Marvell 88W8897 chipsets currently should enable (CONFIG=Y or M) either CONFIG_MWIFIEX or CONFIG_MWLWIFI, NOT BOTH.

mwlwifi driver leveraged code from existing MWL8K driver in the following areas:
- 802.11n setting for mac80211
- Functions needed to hook up to mac80211
- Interactions with mac80211 to establish BA streams
- Partial firmware APIs, some data fields
- Method to pass Rx packets to mac80211 except 11ac rates

In addition, mwlwifi driver supports:
- future scalability and future development (refactored source code)
- Marvell 802.11ac chipsets, including combo BT devices
- 802.11ac related settings and functions
- concurrent AP+STA functionalities with single firmware per chip
- firmware APIs for the supported chipset
- communicating new mac80211 settings to firmware
- Different TX/RX datapath where applicable
- A-MSDU and A-MPDU
- Refined the code to establish BA streams

---
 MAINTAINERS                                     |    6 +
 drivers/net/wireless/marvell/Kconfig            |    1 +
 drivers/net/wireless/marvell/Makefile           |    1 +
 drivers/net/wireless/marvell/mwlwifi/Kconfig    |   23 +
 drivers/net/wireless/marvell/mwlwifi/Makefile   |   13 +
 drivers/net/wireless/marvell/mwlwifi/debugfs.c  |  780 +++++++
 drivers/net/wireless/marvell/mwlwifi/debugfs.h  |   24 +
 drivers/net/wireless/marvell/mwlwifi/dev.h      |  502 +++++
 drivers/net/wireless/marvell/mwlwifi/fwcmd.c    | 2747 +++++++++++++++++++++++
 drivers/net/wireless/marvell/mwlwifi/fwcmd.h    |  214 ++
 drivers/net/wireless/marvell/mwlwifi/fwdl.c     |  186 ++
 drivers/net/wireless/marvell/mwlwifi/fwdl.h     |   25 +
 drivers/net/wireless/marvell/mwlwifi/hostcmd.h  |  883 ++++++++
 drivers/net/wireless/marvell/mwlwifi/isr.c      |  172 ++
 drivers/net/wireless/marvell/mwlwifi/isr.h      |   27 +
 drivers/net/wireless/marvell/mwlwifi/mac80211.c |  719 ++++++
 drivers/net/wireless/marvell/mwlwifi/main.c     |  759 +++++++
 drivers/net/wireless/marvell/mwlwifi/rx.c       |  513 +++++
 drivers/net/wireless/marvell/mwlwifi/rx.h       |   25 +
 drivers/net/wireless/marvell/mwlwifi/sysadpt.h  |   83 +
 drivers/net/wireless/marvell/mwlwifi/thermal.c  |  182 ++
 drivers/net/wireless/marvell/mwlwifi/thermal.h  |   40 +
 drivers/net/wireless/marvell/mwlwifi/tx.c       | 1250 +++++++++++
 drivers/net/wireless/marvell/mwlwifi/tx.h       |   37 +
 24 files changed, 9212 insertions(+)
 create mode 100644 drivers/net/wireless/marvell/mwlwifi/Kconfig
 create mode 100644 drivers/net/wireless/marvell/mwlwifi/Makefile
 create mode 100644 drivers/net/wireless/marvell/mwlwifi/debugfs.c
 create mode 100644 drivers/net/wireless/marvell/mwlwifi/debugfs.h
 create mode 100644 drivers/net/wireless/marvell/mwlwifi/dev.h
 create mode 100644 drivers/net/wireless/marvell/mwlwifi/fwcmd.c
 create mode 100644 drivers/net/wireless/marvell/mwlwifi/fwcmd.h
 create mode 100644 drivers/net/wireless/marvell/mwlwifi/fwdl.c
 create mode 100644 drivers/net/wireless/marvell/mwlwifi/fwdl.h
 create mode 100644 drivers/net/wireless/marvell/mwlwifi/hostcmd.h
 create mode 100644 drivers/net/wireless/marvell/mwlwifi/isr.c
 create mode 100644 drivers/net/wireless/marvell/mwlwifi/isr.h
 create mode 100644 drivers/net/wireless/marvell/mwlwifi/mac80211.c
 create mode 100644 drivers/net/wireless/marvell/mwlwifi/main.c
 create mode 100644 drivers/net/wireless/marvell/mwlwifi/rx.c
 create mode 100644 drivers/net/wireless/marvell/mwlwifi/rx.h
 create mode 100644 drivers/net/wireless/marvell/mwlwifi/sysadpt.h
 create mode 100644 drivers/net/wireless/marvell/mwlwifi/thermal.c
 create mode 100644 drivers/net/wireless/marvell/mwlwifi/thermal.h
 create mode 100644 drivers/net/wireless/marvell/mwlwifi/tx.c
 create mode 100644 drivers/net/wireless/marvell/mwlwifi/tx.h
MAINTAINERS +6 -0
index f8d5a37..87b9e6a 100644
@@ -7212,6 +7212,12 @@ L:	[email protected]
 S:	Odd Fixes
 F:	drivers/net/wireless/marvell/mwl8k.c
 
+MARVELL MWLWIFI WIRELESS DRIVER
+M:	David Lin <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	drivers/net/wireless/marvell/mwlwifi/
+
 MARVELL SOC MMC/SD/SDIO CONTROLLER DRIVER
 M:	Nicolas Pitre <[email protected]>
 S:	Odd Fixes
drivers/net/wireless/marvell/Kconfig +1 -0
index 4938c7e..c7c7e0e4 100644
@@ -14,6 +14,7 @@ if WLAN_VENDOR_MARVELL
 source "drivers/net/wireless/marvell/libertas/Kconfig"
 source "drivers/net/wireless/marvell/libertas_tf/Kconfig"
 source "drivers/net/wireless/marvell/mwifiex/Kconfig"
+source "drivers/net/wireless/marvell/mwlwifi/Kconfig"
 
 config MWL8K
 	tristate "Marvell 88W8xxx PCI/PCIe Wireless support"
drivers/net/wireless/marvell/Makefile +1 -0
index 1b0a7d2..04dff33 100644
@@ -2,5 +2,6 @@ obj-$(CONFIG_LIBERTAS)		+= libertas/
 
 obj-$(CONFIG_LIBERTAS_THINFIRM)	+= libertas_tf/
 obj-$(CONFIG_MWIFIEX)	+= mwifiex/
+obj-$(CONFIG_MWLWIFI)	+= mwlwifi/
 
 obj-$(CONFIG_MWL8K)	+= mwl8k.o
drivers/net/wireless/marvell/mwlwifi/Kconfig new file +23 -0
new file mode 100644
index 0000000..a9bcb9c
@@ -0,0 +1,23 @@
+config MWLWIFI
+	tristate "Marvell Avastar 88W8864/88W8897 PCIe driver (mac80211 compatible)"
+	depends on PCI && MAC80211
+	select FW_LOADER
+	---help---
+		Select to build the driver supporting the:
+
+		Marvell Wireless Wi-Fi 88W8864 modules
+		Marvell Wireless Wi-Fi 88W8897 modules
+
+		This driver uses the kernel's mac80211 subsystem.
+
+		If you want to compile the driver as a module (= code which can be
+		inserted in and removed from the running kernel whenever you want),
+		say M here and read <file:Documentation/kbuild/modules.txt>.  The
+		module will be called mwlwifi.
+
+		NOTE: Selecting this driver may cause conflict with MWIFIEX driver
+		that also operates on the same part number 88W8897. Users should
+		select either MWIFIEX or MWLWIFI, not both. MWIFIEX is fullmac,
+		supporting more comprehensive client functions for laptops/embedded
+		devices. MWLWIFI is mac80211-based for full AP/Wireless Bridge.
+
drivers/net/wireless/marvell/mwlwifi/Makefile new file +13 -0
new file mode 100644
index 0000000..37af74f
@@ -0,0 +1,13 @@
+obj-$(CONFIG_MWLWIFI)	+= mwlwifi.o
+
+mwlwifi-objs		+= main.o
+mwlwifi-objs		+= mac80211.o
+mwlwifi-objs		+= fwdl.o
+mwlwifi-objs		+= fwcmd.o
+mwlwifi-objs		+= tx.o
+mwlwifi-objs		+= rx.o
+mwlwifi-objs		+= isr.o
+mwlwifi-$(CONFIG_THERMAL)	+= thermal.o
+mwlwifi-$(CONFIG_DEBUG_FS)	+= debugfs.o
+
+ccflags-y += -D__CHECK_ENDIAN__
drivers/net/wireless/marvell/mwlwifi/debugfs.c new file +780 -0

780 lines not on this page · raw message

drivers/net/wireless/marvell/mwlwifi/debugfs.h new file +24 -0
new file mode 100644
index 0000000..b4c3eb3
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2006-2016, Marvell International Ltd.
+ *
+ * This software file (the "File") is distributed by Marvell International
+ * Ltd. under the terms of the GNU General Public License Version 2, June 1991
+ * (the "License").  You may use, redistribute and/or modify this File in
+ * accordance with the terms and conditions of the License, a copy of which
+ * is available by writing to the Free Software Foundation, Inc.
+ *
+ * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
+ * ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
+ * this warranty disclaimer.
+ */
+
+/* Description:  This file defines debug fs related functions. */
+
+#ifndef _MWL_DEBUGFS_H_
+#define _MWL_DEBUGFS_H_
+
+void mwl_debugfs_init(struct ieee80211_hw *hw);
+void mwl_debugfs_remove(struct ieee80211_hw *hw);
+
+#endif /* _MWL_DEBUGFS_H_ */
drivers/net/wireless/marvell/mwlwifi/dev.h new file +502 -0

502 lines not on this page · raw message

drivers/net/wireless/marvell/mwlwifi/fwcmd.c new file +2747 -0

1,633 lines not on this page · raw message

drivers/net/wireless/marvell/mwlwifi/fwcmd.h new file +214 -0

214 lines not on this page · raw message

drivers/net/wireless/marvell/mwlwifi/fwdl.c new file +186 -0

186 lines not on this page · raw message

drivers/net/wireless/marvell/mwlwifi/fwdl.h new file +25 -0
new file mode 100644
index 0000000..eedf4dd

Lines of this file are not shown. View the raw message.

drivers/net/wireless/marvell/mwlwifi/hostcmd.h new file +883 -0

883 lines not on this page · raw message

drivers/net/wireless/marvell/mwlwifi/isr.c new file +172 -0

172 lines not on this page · raw message

drivers/net/wireless/marvell/mwlwifi/isr.h new file +27 -0
new file mode 100644
index 0000000..adcc67f

Lines of this file are not shown. View the raw message.

drivers/net/wireless/marvell/mwlwifi/mac80211.c new file +719 -0

719 lines not on this page · raw message

drivers/net/wireless/marvell/mwlwifi/main.c new file +759 -0

759 lines not on this page · raw message

drivers/net/wireless/marvell/mwlwifi/rx.c new file +513 -0

513 lines not on this page · raw message

drivers/net/wireless/marvell/mwlwifi/rx.h new file +25 -0
new file mode 100644
index 0000000..f19e692

Lines of this file are not shown. View the raw message.

drivers/net/wireless/marvell/mwlwifi/sysadpt.h new file +83 -0

83 lines not on this page · raw message

drivers/net/wireless/marvell/mwlwifi/thermal.c new file +182 -0

182 lines not on this page · raw message

drivers/net/wireless/marvell/mwlwifi/thermal.h new file +40 -0
new file mode 100644
index 0000000..fcdcb47

Lines of this file are not shown. View the raw message.

drivers/net/wireless/marvell/mwlwifi/tx.c new file +1250 -0

1,250 lines not on this page · raw message

drivers/net/wireless/marvell/mwlwifi/tx.h new file +37 -0
new file mode 100644
index 0000000..eaacc3b

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.9.3

Part of the diff is not shown here. View the raw message.

#1 lore raw
Quoted 34 lines · David Lin

This patch provides the mwlwifi driver for Marvell 8863, 8864 and 8897 chipsets.
This driver was developed as part of the openwrt.org project to support Linksys WRT1900AC and is maintained on https://github.com/kaloz/mwlwifi.

The mwlwifi driver differs from existing mwifiex driver:
o mwlwifi is a "softmac driver" using the kernel mac802.11 subsystem to provide full AP/Wireless Bridge functionality (routers).
o mwifiex is a "fullmac driver" which provides a comprehensive set of client functions (laptops/embedded devices)
o only mwlwifi supports Marvell AP chip 886X series

NOTE: Users with Marvell 88W8897 chipsets currently should enable (CONFIG=Y or M) either CONFIG_MWIFIEX or CONFIG_MWLWIFI, NOT BOTH.

mwlwifi driver leveraged code from existing MWL8K driver in the following areas:
- 802.11n setting for mac80211
- Functions needed to hook up to mac80211
- Interactions with mac80211 to establish BA streams
- Partial firmware APIs, some data fields
- Method to pass Rx packets to mac80211 except 11ac rates

In addition, mwlwifi driver supports:
- future scalability and future development (refactored source code)
- Marvell 802.11ac chipsets, including combo BT devices
- 802.11ac related settings and functions
- concurrent AP+STA functionalities with single firmware per chip
- firmware APIs for the supported chipset
- communicating new mac80211 settings to firmware
- Different TX/RX datapath where applicable
- A-MSDU and A-MPDU
- Refined the code to establish BA streams

Quoted 1 line

I applied this to the pending branch for kbuild bot to run it's tests.

Signature · 2 lines
Sent by pwcli
https://patchwork.kernel.org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