mac80211: backport from trunk r47249 + additional patches

This commit is contained in:
Matthias Schiffer 2015-10-24 22:24:30 +02:00
parent 6be3893a7b
commit 2c6484ca15
6 changed files with 23966 additions and 96 deletions

View File

@ -1,95 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Tue, 10 Mar 2015 13:17:14 +0100
Subject: ath10k: add Candelatech community firmware as an additional choice
diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index a1eedce..1c0aebe 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -604,6 +604,14 @@ This module adds support for wireless adapters based on
Atheros USB AR9271 and AR7010 family of chipsets.
endef
+ATH10K_CT_COMMUNITY_FW:=firmware-2-ct-full-community-14.bin
+define Download/ath10k-firmware-ct-community
+ FILE:=$(ATH10K_CT_COMMUNITY_FW)
+ URL:=http://www.candelatech.com/downloads/
+ MD5SUM:=800799459c20c1683138c74b3ba58f25
+endef
+$(eval $(call Download,ath10k-firmware-ct-community))
+
define KernelPackage/ath10k
$(call KernelPackage/mac80211/Default)
TITLE:=Atheros 802.11ac wireless cards support
@@ -624,21 +632,37 @@ endef
define KernelPackage/ath10k/config
if PACKAGE_kmod-ath10k
+ choice
+ prompt "ath10k firmware flavour"
+ default ATH10K_AP_FW
+ help
+ This option allows you to choose between different ath10k firmwares.
+
+ config ATH10K_AP_FW
+ bool "Firmware optimized for AP operation"
+ help
+ Use the ath10k firmware optimized for access point operation.
+ Supports only AP mode, will crash in IBSS (ad-hoc) mode.
+
config ATH10K_STA_FW
bool "Firmware optimized for STA operation"
- default n
help
Use the ath10k firmware optimized for wireless client instead
- of access point operation.
+ of access point operation. Might be unstable in AP mode.
+
+ config ATH10K_CT_COMMUNITY_FW
+ bool "Firmware by Candela Technologies (community version)"
+ help
+ Supports both AP and IBSS (ad-hoc) mode. Doesn't support
+ encryption when using multiple VIFs.
config ATH10K_API2_FW
bool "Firmware optimized for AP operation (v10.1 / API v2)"
- default n
- depends on !ATH10K_STA_FW
help
Use the ath10k firmware from the 10.1 SDK using API v2 optimized
for access point operation if the default firmware keeps crashing.
+ endchoice
endif
endef
@@ -1866,18 +1890,25 @@ define KernelPackage/ath10k/install
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/ath10k/QCA988X/hw2.0/board.bin \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/
+ifeq ($(CONFIG_ATH10K_AP_FW),y)
+ $(INSTALL_DATA) \
+ $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.2.4/firmware-4.bin_10.2.4.45 \
+ $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-4.bin
+endif
ifeq ($(CONFIG_ATH10K_STA_FW),y)
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/main/firmware-2.bin_999.999.0.636 \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin
-else ifeq ($(CONFIG_ATH10K_API2_FW),y)
+endif
+ifeq ($(CONFIG_ATH10K_API2_FW),y)
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.1/firmware-2.bin_10.1.467.2-1 \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin
-else
+endif
+ifeq ($(CONFIG_ATH10K_CT_COMMUNITY_FW),y)
$(INSTALL_DATA) \
- $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.2.4/firmware-4.bin_10.2.4.45 \
- $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-4.bin
+ $(DL_DIR)/$(ATH10K_CT_COMMUNITY_FW) \
+ $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin
endif
endef

File diff suppressed because it is too large Load Diff

View File

@ -14,7 +14,7 @@ later in mac80211_setup_vif() by starting authsae.
Signed-off-by: Nils Schneider <nils@nilsschneider.net>
diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
index c9bc3d6..8137b24 100644
index 2a8d2f9..8d31a80 100644
--- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
@@ -455,12 +455,7 @@ mac80211_prepare_vif() {

View File

@ -0,0 +1,82 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Sat, 24 Oct 2015 21:53:10 +0200
Subject: mac80211: fix crash when using mesh (11s) VIF together with another VIF
Using a 802.11s mesh VIF together with a different VIF (e.g. IBSS) led to
a panic.
Steps to reproduce:
rmmod mac80211_hwsim
insmod /lib/modules/3.18.21/mac80211_hwsim.ko channels=2
iw phy phy2 interface add ibss2 type ibss
iw phy phy2 interface add mesh2 type mp
iw phy phy3 interface add ibss3 type ibss
iw phy phy3 interface add mesh3 type mp
ip link set ibss2 up
ip link set mesh2 up
ip link set ibss3 up
ip link set mesh3 up
iw dev ibss2 ibss join foo 2412
iw dev ibss3 ibss join foo 2412
# Ensure that ibss2 and ibss3 are associated, otherwise leave and join
# on ibss3 again
iw dev mesh2 mesh join bar
iw dev mesh3 mesh join bar
The patch has also been submitted upstream.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/package/kernel/mac80211/patches/339-mac80211-fix-crash-on-mesh-local-link-ID-generation-.patch b/package/kernel/mac80211/patches/339-mac80211-fix-crash-on-mesh-local-link-ID-generation-.patch
new file mode 100644
index 0000000..5784b98
--- /dev/null
+++ b/package/kernel/mac80211/patches/339-mac80211-fix-crash-on-mesh-local-link-ID-generation-.patch
@@ -0,0 +1,46 @@
+From 604f8b1964b8380eddf1f03dbdafa7a1c13d80d6 Mon Sep 17 00:00:00 2001
+Message-Id: <604f8b1964b8380eddf1f03dbdafa7a1c13d80d6.1445716231.git.mschiffer@universe-factory.net>
+From: Matthias Schiffer <mschiffer@universe-factory.net>
+Date: Sat, 24 Oct 2015 21:25:51 +0200
+Subject: [PATCH] mac80211: fix crash on mesh local link ID generation with
+ VIFs
+
+llid_in_use needs to be limited to stations of the same VIF, otherwise it
+will cause a NULL deref as the sta_info of non-mesh-VIFs don't have
+sta->mesh set.
+
+Steps to reproduce:
+
+ modprobe mac80211_hwsim channels=2
+ iw phy phy0 interface add ibss0 type ibss
+ iw phy phy0 interface add mesh0 type mp
+ iw phy phy1 interface add ibss1 type ibss
+ iw phy phy1 interface add mesh1 type mp
+ ip link set ibss0 up
+ ip link set mesh0 up
+ ip link set ibss1 up
+ ip link set mesh1 up
+ iw dev ibss0 ibss join foo 2412
+ iw dev ibss1 ibss join foo 2412
+ # Ensure that ibss0 and ibss1 are actually associated; I often need to
+ # leave and join the cell on ibss1 a second time.
+ iw dev mesh0 mesh join bar
+ iw dev mesh1 mesh join bar # crash
+
+Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
+---
+ net/mac80211/mesh_plink.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/net/mac80211/mesh_plink.c
++++ b/net/mac80211/mesh_plink.c
+@@ -646,6 +646,9 @@ static bool llid_in_use(struct ieee80211
+
+ rcu_read_lock();
+ list_for_each_entry_rcu(sta, &local->sta_list, list) {
++ if (sdata != sta->sdata)
++ continue;
++
+ if (!memcmp(&sta->mesh->llid, &llid, sizeof(llid))) {
+ in_use = true;
+ break;

View File

@ -0,0 +1,70 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Tue, 10 Mar 2015 13:17:14 +0100
Subject: ath10k: add Candelatech community firmware as an additional choice
diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index f332cbd..28f40c8 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -270,6 +270,29 @@ Atheros IEEE 802.11ac family of chipsets. For now only
PCI is supported.
endef
+define KernelPackage/ath10k/config
+ if PACKAGE_kmod-ath10k
+ choice
+ prompt "ath10k firmware flavour"
+ default ATH10K_AP_FW
+ help
+ This option allows you to choose between different ath10k firmwares.
+
+ config ATH10K_AP_FW
+ bool "Firmware optimized for AP operation"
+ help
+ Use the ath10k firmware optimized for access point operation.
+ Supports only AP mode, will crash in IBSS (ad-hoc) mode.
+
+ config ATH10K_CT_COMMUNITY_FW
+ bool "Firmware by Candela Technologies (community version)"
+ help
+ Supports both AP and IBSS (ad-hoc) mode. Doesn't support
+ encryption when using multiple VIFs.
+ endchoice
+ endif
+ endef
+
PKG_ATH10K_LINUX_FIRMWARE_NAME:=ath10k-firmware
PKG_ATH10K_LINUX_FIRMWARE_VERSION:=b46f3e01a6c1f9150fb4612ef53611d714565842
PKG_ATH10K_LINUX_FIRMWARE_SOURCE:=$(PKG_ATH10K_LINUX_FIRMWARE_NAME)-$(PKG_ATH10K_LINUX_FIRMWARE_VERSION).tar.bz2
@@ -288,6 +311,14 @@ define Download/ath10k-firmware
endef
$(eval $(call Download,ath10k-firmware))
+ATH10K_CT_COMMUNITY_FW:=firmware-2-ct-full-community-14.bin
+define Download/ath10k-firmware-ct-community
+ FILE:=$(ATH10K_CT_COMMUNITY_FW)
+ URL:=http://www.candelatech.com/downloads/
+ MD5SUM:=800799459c20c1683138c74b3ba58f25
+endef
+$(eval $(call Download,ath10k-firmware-ct-community))
+
#Broadcom firmware
ifneq ($(CONFIG_B43_FW_6_30),)
@@ -1854,9 +1885,16 @@ define KernelPackage/ath10k/install
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/ath10k/QCA988X/hw2.0/board.bin \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/
+ifeq ($(CONFIG_ATH10K_AP_FW),y)
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.2.4/untested/firmware-5.bin_10.2.4.70-2 \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-5.bin
+endif
+ifeq ($(CONFIG_ATH10K_CT_COMMUNITY_FW),y)
+ $(INSTALL_DATA) \
+ $(DL_DIR)/$(ATH10K_CT_COMMUNITY_FW) \
+ $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin
+endif
endef
define KernelPackage/b43/install