From bc15b6c8101edec5dca358c597cd2f3fbe2399d3 Mon Sep 17 00:00:00 2001 From: Leo Krueger Date: Mon, 14 Sep 2015 23:31:34 +0200 Subject: [PATCH 01/99] gluon-ebtables-filter-multicast: drop icmpv6 type 128 & 139, drop icmp in a layer 2 mesh network, multicast pings cause a lot of traffic in the network, significantly increasing the 'backgroudn noise' (= Grundrauschen) and stressing nodes in the network. this commit blacklists all icmpv4 multicast traffic as well as multicast icmpv6 echo-requests and node iformation queries. as no application depending on these types of multicast traffic is known, blacklisting is safe. --- .../files/lib/gluon/ebtables/110-mcast-allow-icmp | 1 - .../files/lib/gluon/ebtables/110-mcast-allow-icmpv6 | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) delete mode 100644 package/gluon-ebtables-filter-multicast/files/lib/gluon/ebtables/110-mcast-allow-icmp diff --git a/package/gluon-ebtables-filter-multicast/files/lib/gluon/ebtables/110-mcast-allow-icmp b/package/gluon-ebtables-filter-multicast/files/lib/gluon/ebtables/110-mcast-allow-icmp deleted file mode 100644 index 25a95f39..00000000 --- a/package/gluon-ebtables-filter-multicast/files/lib/gluon/ebtables/110-mcast-allow-icmp +++ /dev/null @@ -1 +0,0 @@ -rule 'MULTICAST_OUT -p IPv4 --ip-protocol icmp -j RETURN' diff --git a/package/gluon-ebtables-filter-multicast/files/lib/gluon/ebtables/110-mcast-allow-icmpv6 b/package/gluon-ebtables-filter-multicast/files/lib/gluon/ebtables/110-mcast-allow-icmpv6 index a7b67414..8d3b7ec2 100644 --- a/package/gluon-ebtables-filter-multicast/files/lib/gluon/ebtables/110-mcast-allow-icmpv6 +++ b/package/gluon-ebtables-filter-multicast/files/lib/gluon/ebtables/110-mcast-allow-icmpv6 @@ -1,2 +1,5 @@ -rule 'MULTICAST_OUT -p IPv6 --ip6-protocol 0 -j RETURN' -- hop-by-hop +rule 'MULTICAST_OUT -p IPv6 --ip6-protocol ipv6-icmp --ip6-icmp-type echo-request -j DROP' +rule 'MULTICAST_OUT -p IPv6 --ip6-protocol ipv6-icmp --ip6-icmp-type 139 -j DROP' rule 'MULTICAST_OUT -p IPv6 --ip6-protocol ipv6-icmp -j RETURN' + +rule 'MULTICAST_OUT -p IPv6 --ip6-protocol 0 -j RETURN' -- hop-by-hop From 3f704405276c86db17052df234179bc5a7f24aae Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 20 Nov 2015 00:04:59 +0100 Subject: [PATCH 02/99] ar71xx: fix AR71XX_MODEL on TP-Link TL-WR703N --- ...ix-AR71XX_MODEL-on-TP-Link-TL-WR703N.patch | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 patches/openwrt/0039-ar71xx-fix-AR71XX_MODEL-on-TP-Link-TL-WR703N.patch diff --git a/patches/openwrt/0039-ar71xx-fix-AR71XX_MODEL-on-TP-Link-TL-WR703N.patch b/patches/openwrt/0039-ar71xx-fix-AR71XX_MODEL-on-TP-Link-TL-WR703N.patch new file mode 100644 index 00000000..4d10da30 --- /dev/null +++ b/patches/openwrt/0039-ar71xx-fix-AR71XX_MODEL-on-TP-Link-TL-WR703N.patch @@ -0,0 +1,20 @@ +From: Matthias Schiffer +Date: Thu, 19 Nov 2015 23:29:17 +0100 +Subject: ar71xx: fix AR71XX_MODEL on TP-Link TL-WR703N + +The hwid check was wrong, causing the AR71XX_MODEL value to end with a +space (as $hwver was unset). + +diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh +index 9c7c139..388cf38 100755 +--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh ++++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh +@@ -122,7 +122,7 @@ tplink_board_detect() { + "3C0002"*) + model="MINIBOX_V1" + ;; +- "070300"*) ++ "070301"*) + model="TP-Link TL-WR703N" + ;; + "071000"*) From 77829cda98df681b70214dd3230b05e526c3f2ad Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 20 Nov 2015 15:23:02 +0100 Subject: [PATCH 03/99] ar71xx: fix wndr3700_board_detect for some NETGEAR WNDR3700v2 (again) --- ...ct-for-some-NETGEAR-WNDR3700v2-again.patch | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 patches/openwrt/0040-ar71xx-fix-wndr3700_board_detect-for-some-NETGEAR-WNDR3700v2-again.patch diff --git a/patches/openwrt/0040-ar71xx-fix-wndr3700_board_detect-for-some-NETGEAR-WNDR3700v2-again.patch b/patches/openwrt/0040-ar71xx-fix-wndr3700_board_detect-for-some-NETGEAR-WNDR3700v2-again.patch new file mode 100644 index 00000000..cc078e54 --- /dev/null +++ b/patches/openwrt/0040-ar71xx-fix-wndr3700_board_detect-for-some-NETGEAR-WNDR3700v2-again.patch @@ -0,0 +1,46 @@ +From: Matthias Schiffer +Date: Fri, 20 Nov 2015 15:09:03 +0100 +Subject: ar71xx: fix wndr3700_board_detect for some NETGEAR WNDR3700v2 (again) + +When fixing the model string for WNDR3700v2 which contain a model string +followed by 0xff in r46455, the match for other versions of the WNDR3700v2 +which just contain lots of 0xff broke (as the 0xff $model is checked for +is stripped off). + +Fix by stripping off non-printable characters only for the actual output +string, but not for the internal matching. + +diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh +index 388cf38..daebaa4 100755 +--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh ++++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh +@@ -37,8 +37,9 @@ wndr3700_board_detect() { + machine="NETGEAR WNDR3700" + ;; + "33373031") +- # Use awk to remove everything after the first zero byte +- model="$(ar71xx_get_mtd_offset_size_format art 41 32 %c | LC_CTYPE=C awk -v 'FS=[^[:print:]]' '{print $1; exit}')" ++ model="$(ar71xx_get_mtd_offset_size_format art 41 32 %c)" ++ # Use awk to remove everything unprintable ++ model_stripped="$(echo -n "$model" | LC_CTYPE=C awk -v 'FS=[^[:print:]]' '{print $1; exit}')" + case $model in + $'\xff'*) + if [ "${model:24:1}" = 'N' ]; then +@@ -48,14 +49,14 @@ wndr3700_board_detect() { + fi + ;; + '29763654+16+64'*) +- machine="NETGEAR ${model:14}" ++ machine="NETGEAR ${model_stripped:14}" + ;; + '29763654+16+128'*) +- machine="NETGEAR ${model:15}" ++ machine="NETGEAR ${model_stripped:15}" + ;; + *) + # Unknown ID +- machine="NETGEAR $model" ++ machine="NETGEAR ${model_stripped}" + esac + esac + From 186fb0f33a9fc0c6e9a76294ebedbe81793fcdda Mon Sep 17 00:00:00 2001 From: brokenbike Date: Sat, 21 Nov 2015 13:29:31 +0100 Subject: [PATCH 04/99] Fix typo in LICENSE In line 2: indiviual -> individual --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index adc32281..c6bfdbea 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ The code of Project Gluon may be distributed under the following terms, unless -noted otherwise in indiviual files or subtrees. +noted otherwise in individual files or subtrees. Copyright (c) 2013, Project Gluon All rights reserved. From fabb0143c4abfb9e0b8adf0b370dc8efd052509d Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 21 Nov 2015 18:36:45 +0100 Subject: [PATCH 05/99] base-files: add missing public key This patch is already included in the current OpenWrt CC branch. Cherry-pick for now as we're very close to the Gluon 2015.2 release. --- ...1-CC-base-files-add-missing-public-key.patch | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 patches/openwrt/0041-CC-base-files-add-missing-public-key.patch diff --git a/patches/openwrt/0041-CC-base-files-add-missing-public-key.patch b/patches/openwrt/0041-CC-base-files-add-missing-public-key.patch new file mode 100644 index 00000000..12cff28d --- /dev/null +++ b/patches/openwrt/0041-CC-base-files-add-missing-public-key.patch @@ -0,0 +1,17 @@ +From: Matthias Schiffer +Date: Sat, 21 Nov 2015 18:35:49 +0100 +Subject: CC: base-files: add missing public key + +Add the secondary package signature key to the 15.05 sources so that people +building the release have the same keys as people using precompiled images. + +Signed-off-by: Jo-Philipp Wich + +diff --git a/package/base-files/files/etc/opkg/keys/de98a2dd1d0f8a07 b/package/base-files/files/etc/opkg/keys/de98a2dd1d0f8a07 +new file mode 100644 +index 0000000..5e3088c +--- /dev/null ++++ b/package/base-files/files/etc/opkg/keys/de98a2dd1d0f8a07 +@@ -0,0 +1,2 @@ ++untrusted comment: openwrt.org 15.05 release key ++RWTemKLdHQ+KBxOILy8gyk+5PaDVdfyJ32TFnY/jnQOrBAd1wobbLNYz From f0308ed93cc2578792f168152840c1be27d003f5 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 23 Nov 2015 00:39:32 +0100 Subject: [PATCH 06/99] docs: add documentation for gluon-ebtables-filter-{multicast,ra-dhcp} --- docs/index.rst | 2 ++ .../gluon-ebtables-filter-multicast.rst | 30 +++++++++++++++++++ .../package/gluon-ebtables-filter-ra-dhcp.rst | 13 ++++++++ 3 files changed, 45 insertions(+) create mode 100644 docs/package/gluon-ebtables-filter-multicast.rst create mode 100644 docs/package/gluon-ebtables-filter-ra-dhcp.rst diff --git a/docs/index.rst b/docs/index.rst index 692b2e50..445f9973 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -50,6 +50,8 @@ Packages :maxdepth: 1 package/gluon-client-bridge + package/gluon-ebtables-filter-multicast + package/gluon-ebtables-filter-ra-dhcp Releases -------- diff --git a/docs/package/gluon-ebtables-filter-multicast.rst b/docs/package/gluon-ebtables-filter-multicast.rst new file mode 100644 index 00000000..fa9f2d50 --- /dev/null +++ b/docs/package/gluon-ebtables-filter-multicast.rst @@ -0,0 +1,30 @@ +gluon-ebtables-filter-multicast +=============================== + +The *gluon-ebtables-filter-multicast* package filters out various kinds of +non-essential multicast traffic, as this traffic often constitutes a +disproportionate burden on the mesh network. Unfortunately, this breaks many useful services +(Avahi, Bonjour chat, ...), but this seems unavoidable, as the current Avahi implementation is +optimized for small local networks and causes too much traffic in lange mesh networks. + +The multicast packets are filtered between the nodes' client bridge (*br-client*) and mesh +interface (*bat0*) on output. + + +The following packet types are considered essential and aren't filtered: + +* ARP (except requests for/replies from 0.0.0.0) +* DHCP, DHCPv6 +* ICMPv6 (except Echo Requests (ping) and Node Information Queries (RFC4620) +* IGMP + +In addition, the following packet types are allowed to allow experimentation with +layer 3 routing protocols. + +* Babel +* OSPF +* RIPng + +The following packet types are also allowed: + +* BitTorrent Local Peer Discovery (it seems better to have local peers for BitTorrent than sending everything through the internet) diff --git a/docs/package/gluon-ebtables-filter-ra-dhcp.rst b/docs/package/gluon-ebtables-filter-ra-dhcp.rst new file mode 100644 index 00000000..539fbc0d --- /dev/null +++ b/docs/package/gluon-ebtables-filter-ra-dhcp.rst @@ -0,0 +1,13 @@ +gluon-ebtables-filter-ra-dhcp +============================= + +The *gluon-ebtables-filter-ra-dhcp* package tries to prevent common +misconfigurations (i.e. connecting the client interface of a Gluon +node to a private network) from causing issues for either of the +networks. + +The rules are the following: + +* DHCP requests, DHCPv6 requests and Router Solicitations may only be sent from clients to the mesh, but aren't forwarded + from the mesh to clients +* DHCP replies, DHCPv6 replies and Router Advertisements from clients aren't forwarded to the mesh From 40a9bdd7b19d023b0ee5fb7f79571622cd9ef5c8 Mon Sep 17 00:00:00 2001 From: picard Date: Tue, 3 Nov 2015 20:25:20 +0100 Subject: [PATCH 07/99] docs: update ffnw site URL --- docs/user/site.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user/site.rst b/docs/user/site.rst index 6b5a7cf5..a0629bc5 100644 --- a/docs/user/site.rst +++ b/docs/user/site.rst @@ -374,7 +374,7 @@ This is a non-exhaustive list of site-repos from various communities: * `site-ffmyk `_ (Mayen-Koblenz) * `site-ffm `_ (München) * `site-ffms `_ (Münsterland) -* `site-ffnw `_ (Nordwest) +* `site-ffnw `_ (Nordwest) * `site-ffpb `_ (Paderborn) * `site-ffka `_ (Karlsruhe) * `site-ffrl `_ (Rheinland) From f01121f7dbbe48245ac2677443c945e6d1656f06 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 23 Nov 2015 01:14:54 +0100 Subject: [PATCH 08/99] contrib/sign.sh: various cleanups, exit with 1 on error --- contrib/sign.sh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/contrib/sign.sh b/contrib/sign.sh index 082e967e..2a725320 100755 --- a/contrib/sign.sh +++ b/contrib/sign.sh @@ -1,6 +1,8 @@ #!/bin/sh -if [ $# -eq 0 -o "-h" = "$1" -o "-help" = "$1" -o "--help" = "$1" ]; then +set -e + +if [ $# -ne 2 -o "-h" = "$1" -o "--help" = "$1" -o ! -r "$1" -o ! -r "$2" ]; then cat < @@ -25,16 +27,18 @@ manifest="$2" upper="$(mktemp)" lower="$(mktemp)" -awk "BEGIN { sep=0 } - /^---\$/ { sep=1; next } - { if(sep==0) print > \"$upper\"; - else print > \"$lower\"}" \ +trap 'echo rm -f "$upper" "$lower"; rm -f "$upper" "$lower"' EXIT + +awk 'BEGIN { sep=0 } + /^---$/ { sep=1; next } + { if(sep==0) print > "'"$upper"'"; + else print > "'"$lower"'"}' \ "$manifest" ecdsasign "$upper" < "$SECRET" >> "$lower" -cat "$upper" > "$manifest" -echo --- >> "$manifest" -cat "$lower" >> "$manifest" - -rm -f "$upper" "$lower" +( + cat "$upper" + echo --- + cat "$lower" +) > "$manifest" From f79d837e87e3995d6a737395cef1f5cdba2e60f7 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 23 Nov 2015 01:43:35 +0100 Subject: [PATCH 09/99] docs: update list of supported hardware Also * create list of newly supported devices since v2015.1.2 in the v2015.2 release notes * update information on docs/user/x86 * fix a comment in targets/ar71xx-generic/profiles.mk --- docs/index.rst | 42 +++++++++++++++++++++--------- docs/releases/v2015.2.rst | 32 +++++++++++++++++++++-- docs/user/x86.rst | 11 ++++++-- targets/ar71xx-generic/profiles.mk | 2 +- 4 files changed, 70 insertions(+), 17 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 445f9973..0e2bec80 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -81,6 +81,7 @@ ar71xx-generic * Buffalo - WZR-HP-AG300H / WZR-600DHP + - WZR-HP-G300N - WZR-HP-G450H * D-Link @@ -105,10 +106,10 @@ ar71xx-generic * TP-Link - - CPE210 (v1) - - CPE220 (v1) - - CPE510 (v1) - - CPE520 (v1) + - CPE210 (v1.0, v1.1) + - CPE220 (v1.0, v1.1) + - CPE510 (v1.0, v1.1) + - CPE520 (v1.0, v1.1) - TL-MR3020 (v1) - TL-MR3040 (v1, v2) - TL-MR3220 (v1, v2) @@ -119,29 +120,32 @@ ar71xx-generic - TL-WA830RE (v1, v2) - TL-WA850RE (v1) - TL-WA860RE (v1) - - TL-WA901N/ND (v2, v3) + - TL-WA901N/ND (v1, v2, v3) - TL-WDR3500 (v1) - TL-WDR3600 (v1) - TL-WDR4300 (v1) - - TL-WR1043N/ND (v1, v2) - TL-WR703N (v1) - - TL-WR710N (v1) + - TL-WR710N (v1, v2) - TL-WR740N (v1, v3, v4, v5) - TL-WR741N/ND (v1, v2, v4, v5) - TL-WR743N/ND (v1, v2) + - TL-WR801N/ND (v1, v2) - TL-WR841N/ND (v3, v5, v7, v8, v9, v10) - TL-WR842N/ND (v1, v2) - - TL-WR941N/ND (v2, v3, v4, v5) + - TL-WR940N (v1, v2, v3) + - TL-WR941ND (v2, v3, v4, v5, v6) + - TL-WR1043N/ND (v1, v2, v3) - TL-WR2543N/ND (v1) * Ubiquiti - - Bullet M2 - - Nanostation M2 + - Air Gateway + - Bullet M + - Nanostation M - Nanostation M XW - Loco M XW - - Picostation M2 - - Rocket M2 + - Picostation M + - Rocket M - UniFi AP - UniFi AP Pro - UniFi AP Outdoor @@ -175,6 +179,20 @@ x86-kvm_guest See also: :doc:`user/x86` +x86-xen_domu +^^^^^^^^^^^^ +* x86-xen + +See also: :doc:`user/x86` + +x86-64 +^^^^^^ +* x86-64-generic +* x86-64-virtualbox +* x86-64-vmware + +See also: :doc:`user/x86` + License ------- diff --git a/docs/releases/v2015.2.rst b/docs/releases/v2015.2.rst index 13af5b28..9fcc34a3 100644 --- a/docs/releases/v2015.2.rst +++ b/docs/releases/v2015.2.rst @@ -1,9 +1,37 @@ Gluon 2015.2 (in development) ============================= -Added (and removed) hardware support -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Added hardware support +~~~~~~~~~~~~~~~~~~~~~~ +ar71xx-generic +^^^^^^^^^^^^^^ + +* Buffalo + + - WZR-HP-G300N + +* TP-Link + + - CPE210/220/510/520 v1.1 + - TL-WA901N/ND v1 + - TL-WR710N v2 + - TL-WR801N/ND v1, v2 + - TL-WR841N/ND v10 + - TL-WR842N/ND (v1, v2) + - TL-WR940N v1, v2, v3 + - TL-WR941ND v6 + - TL-WR1043N/ND v3 + +x86-xen_domu +^^^^^^^^^^^^ + +New target containing the necessary drivers for use in Xen. + +x86-64 +^^^^^^ + +64bit version of `x86-generic`. The generic image can also be used in KVM with VirtIO. New features ~~~~~~~~~~~~ diff --git a/docs/user/x86.rst b/docs/user/x86.rst index b985d6fc..9364b7ed 100644 --- a/docs/user/x86.rst +++ b/docs/user/x86.rst @@ -2,12 +2,12 @@ x86 support =========== Gluon can run on normal x86 systems, for example virtual machines -and VPN boxes. There is no WLAN support on x86 though. +and VPN boxes. By default, there is no WLAN support on x86 though. Targets ^^^^^^^ -There are two targets for x86 images: +The following targets for x86 images exist: `x86-generic` Generic x86 support with many different ethernet drivers; should run on @@ -27,3 +27,10 @@ There are two targets for x86 images: `x86-kvm` The `x86-kvm` image uses VirtIO as its harddisk and network driver. + +`x86-xen_domu` + The `x86-xen_domu` target contains the necessary drivers for use in Xen. + +`x86-64` + 64bit version of `x86-generic`. Also has VirtIO support, so there's no need for an + `x86-64-kvm` target. diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index e723badb..a64ebdd4 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -107,7 +107,7 @@ $(eval $(call GluonModel,TLWA850,tl-wa850re-v1,tp-link-tl-wa850re-v1)) $(eval $(call GluonProfile,TLWA860)) $(eval $(call GluonModel,TLWA860,tl-wa860re-v1,tp-link-tl-wa860re-v1)) -# TL-WA901N/ND v2 +# TL-WA901N/ND v1, v2, v3 $(eval $(call GluonProfile,TLWA901)) $(eval $(call GluonModel,TLWA901,tl-wa901nd-v1,tp-link-tl-wa901n-nd-v1)) $(eval $(call GluonModel,TLWA901,tl-wa901nd-v2,tp-link-tl-wa901n-nd-v2)) From ce44045a8b15b555f1a39c2e8d3a063f0b424d5e Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 23 Nov 2015 01:51:57 +0100 Subject: [PATCH 10/99] docs: releases/v2015.2: remove accidentially pasted line in the "Added hardware support" section --- docs/releases/v2015.2.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/releases/v2015.2.rst b/docs/releases/v2015.2.rst index 9fcc34a3..8794fe01 100644 --- a/docs/releases/v2015.2.rst +++ b/docs/releases/v2015.2.rst @@ -18,7 +18,6 @@ ar71xx-generic - TL-WR710N v2 - TL-WR801N/ND v1, v2 - TL-WR841N/ND v10 - - TL-WR842N/ND (v1, v2) - TL-WR940N v1, v2, v3 - TL-WR941ND v6 - TL-WR1043N/ND v3 From 8f31ce81b3a9210079dea30d116c21f0cf15c218 Mon Sep 17 00:00:00 2001 From: Adorfer Date: Mon, 23 Nov 2015 13:11:26 +0100 Subject: [PATCH 11/99] -spelling --- docs/package/gluon-ebtables-filter-multicast.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/package/gluon-ebtables-filter-multicast.rst b/docs/package/gluon-ebtables-filter-multicast.rst index fa9f2d50..eca9c6c7 100644 --- a/docs/package/gluon-ebtables-filter-multicast.rst +++ b/docs/package/gluon-ebtables-filter-multicast.rst @@ -5,7 +5,7 @@ The *gluon-ebtables-filter-multicast* package filters out various kinds of non-essential multicast traffic, as this traffic often constitutes a disproportionate burden on the mesh network. Unfortunately, this breaks many useful services (Avahi, Bonjour chat, ...), but this seems unavoidable, as the current Avahi implementation is -optimized for small local networks and causes too much traffic in lange mesh networks. +optimized for small local networks and causes too much traffic in large mesh networks. The multicast packets are filtered between the nodes' client bridge (*br-client*) and mesh interface (*bat0*) on output. From e5d6ec73f5ebfb012912a545daf0cbd0205c4638 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 23 Nov 2015 21:09:23 +0100 Subject: [PATCH 12/99] contrib/sign.sh: remove debug echo command --- contrib/sign.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/sign.sh b/contrib/sign.sh index 2a725320..0923b2dc 100755 --- a/contrib/sign.sh +++ b/contrib/sign.sh @@ -27,7 +27,7 @@ manifest="$2" upper="$(mktemp)" lower="$(mktemp)" -trap 'echo rm -f "$upper" "$lower"; rm -f "$upper" "$lower"' EXIT +trap 'rm -f "$upper" "$lower"' EXIT awk 'BEGIN { sep=0 } /^---$/ { sep=1; next } From 00022fc07fff964411abc30f069b8f15f2853e25 Mon Sep 17 00:00:00 2001 From: Felix Kaechele Date: Mon, 23 Nov 2015 23:13:51 +0100 Subject: [PATCH 13/99] targets/ar71xx-generic: add WD MyNet N600/N750 Signed-off-by: Felix Kaechele --- targets/ar71xx-generic/profiles.mk | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index a64ebdd4..c32d1f0a 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -232,3 +232,13 @@ $(eval $(call GluonModel,ALL0315N,all0315n,allnet-all0315n)) $(eval $(call GluonProfile,GLINET)) $(eval $(call GluonModel,GLINET,gl-inet-6408A-v1,gl-inet-6408a-v1)) $(eval $(call GluonModel,GLINET,gl-inet-6416A-v1,gl-inet-6416a-v1)) + +## Western Digital + +# WD MyNet N600 +$(eval $(call GluonProfile,MYNETN600)) +$(eval $(call GluonModel,MYNETN600,mynet-n600,wd-my-net-n600)) + +# WD MyNet N750 +$(eval $(call GluonProfile,MYNETN750)) +$(eval $(call GluonModel,MYNETN750,mynet-n750,wd-my-net-n750)) From 26b4d5691f0ef9db52c6dd2a0d1cc23c5c3d50c7 Mon Sep 17 00:00:00 2001 From: Andreas Ziegler Date: Tue, 24 Nov 2015 03:55:52 +0100 Subject: [PATCH 14/99] docs: add link to tecff/site-ffa (Altdorf, Landshut & Umgebung) --- docs/user/site.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/user/site.rst b/docs/user/site.rst index a0629bc5..d16b6c3b 100644 --- a/docs/user/site.rst +++ b/docs/user/site.rst @@ -362,6 +362,7 @@ site-repos in the wild This is a non-exhaustive list of site-repos from various communities: +* `site-ffa `_ (Altdorf, Landshut & Umgebung) * `site-ffbs `_ (Braunschweig) * `site-ffhb `_ (Bremen) * `site-ffda `_ (Darmstadt) From 7c12de7250bca2f4eff741e2a4d7025c4b89e01d Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 24 Nov 2015 04:10:07 +0100 Subject: [PATCH 15/99] docs: add WD My Net N600/N750 to list of supported devices --- docs/index.rst | 5 +++++ docs/releases/v2015.2.rst | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/docs/index.rst b/docs/index.rst index 0e2bec80..54effbcf 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -150,6 +150,11 @@ ar71xx-generic - UniFi AP Pro - UniFi AP Outdoor +* Western Digital + + - My Net N600 + - My Net N750 + ar71xx-nand ^^^^^^^^^^^ diff --git a/docs/releases/v2015.2.rst b/docs/releases/v2015.2.rst index 8794fe01..f330090f 100644 --- a/docs/releases/v2015.2.rst +++ b/docs/releases/v2015.2.rst @@ -22,6 +22,11 @@ ar71xx-generic - TL-WR941ND v6 - TL-WR1043N/ND v3 +* Western Digital + + - My Net N600 + - My Net N750 + x86-xen_domu ^^^^^^^^^^^^ From df9df3d1b4b104736bcefc17c1b954ce883efddb Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 23 Nov 2015 03:42:43 +0100 Subject: [PATCH 16/99] docs: add v2015.2 release notes --- docs/releases/v2015.2.rst | 77 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/docs/releases/v2015.2.rst b/docs/releases/v2015.2.rst index f330090f..e2ac7250 100644 --- a/docs/releases/v2015.2.rst +++ b/docs/releases/v2015.2.rst @@ -40,13 +40,66 @@ x86-64 New features ~~~~~~~~~~~~ +Kernel module opkg repository +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +We've not been able to keep ABI compatiblity with the kernel of the official OpenWrt images. +Therefore, Gluon now generates a opkg repository with modules itself. + +The repository can be found at `output/modules/` by default, the image output directory has +been moved from `images/` to `output/images/`. See the updated :doc:`../user/getting_started` guide +for information on the handling of the signing keys for this repository. + +The `opkg_repo` site.conf option has been replaced to allow specifying this and other additional repositories. + +New status page +^^^^^^^^^^^^^^^ + +The new status page provides a visually pleasing experience, and displays all important information +on a node in a clear manner. It also contains a real-time signal strength graph for all neighbouring +nodes to aid with the alignment of antennas. + +802.11s mesh support +^^^^^^^^^^^^^^^^^^^^ + +Gluon now supports using 802.11s for its mesh links instead of IBSS (Adhoc). This will allow supporting +WLAN hardware which can't to AP and IBSS mode simultaneously in the future (like Ralink/Mediatek). + +Note that batman-adv is still used on top of 802.11s (and 802.11s forwarding is disabled), the mesh routing protocol +provided by 802.11s is not used. + +Multicast filter extension +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The `gluon-ebtables-filter-multicast` package has been extended to filter out multicast +ICMP and ICMPv6 Echo Requests (ping) and Node Information Queries (RFC4620). This prevents +pings to multicast addresses like ff02::1 to cause traffic peaks +(as all nodes and clients would answer such a ping). + +French translation +^^^^^^^^^^^^^^^^^^ + +A French translation for the Config Mode/Expert Mode has been added. Bugfixes ~~~~~~~~ +* Update kernel code for the QCA953x + + Might improve statility of the TP-Link TL-WR841N/ND v9. +* Fix model detection on some Netgear WNDR3700v2 + + The broken devices will identify as "NETGEAR ". + This also breaks the autoupdater, making a manual upgrade necessary. +* Ensure that `odhcp6c` doesn't spawn multiple instances of ``dhcpv6.script`` +* Fix support for Buffalo WZR-600DHP + + A flashable factory image is generated now. The sysupgrade image is still shared + with the WZR-HP-AG300H. Site changes ~~~~~~~~~~~~ + * ``site.conf`` - New WLAN configuration @@ -172,6 +225,30 @@ Site changes Internals ~~~~~~~~~ +* OpenWrt has been updated to Chaos Calmer +* mac80211 has been backported from OpenWrt trunk r47249 (wireless-testing 2015-07-21) + + This allows us to support the TL-WR940N v3/TL-WR941ND v6, which uses a TP9343 (QCA956x) SoC. +* Several packages have been moved from the Gluon repo to the packages repo, removing references to Gluon: + + - gluon-cron -> micrond (the crontabs are now read from ``/usr/lib/micron.d`` instead of ``/lib/gluon/cron``) + - gluon-radvd -> uradvd + - gluon-simple-tc -> simple-tc (the config file has been renamed as well) +* Some of the Gluon-specific i18n support code in the build system has been removed, as LuCI now provides + similar facilities +* The C-based `luci-lib-jsonc` library is now used for JSON encoding/decoding instead of the pure Lua `luci-lib-json` Known Issues ~~~~~~~~~~~~ + +* Default TX power on many Ubiquiti devices is too high, correct offsets are unknown (`#94 `_) + + Reducing the TX power in the Expert Mode is recommended. +* batman-adv causes stability issues for both alfred and respondd/announced (`#177 `_) +* The MAC address of the WAN interface is modified even when Mesh-on-WAN is disabled (`#496 `_) + + This may lead to issues in environments where a fixed MAC address is expected (like VMware when promicious mode is disallowed). + +* Inconsistent respondd/announced API (`#522 `_) + + The current API is inconsistent and will be replaced in the next release. The old API will still be supported for a while. From 2ffd05357ccee120c5a0d9875079fe9df3e9d146 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 25 Nov 2015 02:28:37 +0100 Subject: [PATCH 17/99] build: ensure the feeds are updated when modules or site modules change --- Makefile | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index a1c2e7e6..387b3806 100644 --- a/Makefile +++ b/Makefile @@ -177,6 +177,9 @@ GLUON_$(1)_MODEL_$(2)_ALIASES += $(3) endef +export SHA512SUM := $(GLUONDIR)/scripts/sha512sum.sh + + prereq: FORCE +$(NO_TRACE_MAKE) prereq @@ -209,7 +212,12 @@ gluon-tools: FORCE +$(GLUONMAKE_EARLY) package/lua/host/install package/usign/host/install -early_prepared_stamp := $(GLUON_BUILDDIR)/prepared + +early_prepared_stamp := $(GLUON_BUILDDIR)/prepared_$(shell \ + ( \ + $(SHA512SUM) $(GLUONDIR)/modules; \ + [ ! -r $(GLUON_SITEDIR)/modules ] || $(SHA512SUM) $(GLUON_SITEDIR)/modules \ + ) | $(SHA512SUM) ) prepare-early: FORCE for dir in build_dir dl staging_dir; do \ @@ -222,7 +230,7 @@ prepare-early: FORCE mkdir -p $$(dirname $(early_prepared_stamp)) touch $(early_prepared_stamp) -$(early_prepared_stamp): +$(early_prepared_stamp): $(GLUONDIR)/modules $(wildcard $(GLUON_SITEDIR)/modules) +$(GLUONMAKE_EARLY) prepare-early $(GLUON_OPKG_KEY): $(early_prepared_stamp) FORCE @@ -304,9 +312,6 @@ clean: FORCE rm -f $(gluon_prepared_stamp) -export SHA512SUM := $(GLUONDIR)/scripts/sha512sum.sh - - download: FORCE +$(SUBMAKE) tools/download +$(SUBMAKE) toolchain/download From c456fb231f7d9bce29017e828b0f3dede96cd351 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 25 Nov 2015 11:35:34 +0100 Subject: [PATCH 18/99] build: improve feed update fix (and remove accidentially committed part) --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 387b3806..a5da5004 100644 --- a/Makefile +++ b/Makefile @@ -230,7 +230,8 @@ prepare-early: FORCE mkdir -p $$(dirname $(early_prepared_stamp)) touch $(early_prepared_stamp) -$(early_prepared_stamp): $(GLUONDIR)/modules $(wildcard $(GLUON_SITEDIR)/modules) +$(early_prepared_stamp): + rm -f $(GLUON_BUILDDIR)/prepared_* +$(GLUONMAKE_EARLY) prepare-early $(GLUON_OPKG_KEY): $(early_prepared_stamp) FORCE From 7f0fe061dc18f70121dcd4ad84a292f3b269450d Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 27 Nov 2015 09:49:12 +0100 Subject: [PATCH 19/99] gluon-luci-private-wifi: fix translation files --- package/gluon-luci-private-wifi/i18n/de.po | 2 +- package/gluon-luci-private-wifi/i18n/fr.po | 11 ++++++----- .../i18n/gluon-luci-private-wifi.pot | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/package/gluon-luci-private-wifi/i18n/de.po b/package/gluon-luci-private-wifi/i18n/de.po index 5b2ac19d..31223cd4 100644 --- a/package/gluon-luci-private-wifi/i18n/de.po +++ b/package/gluon-luci-private-wifi/i18n/de.po @@ -21,7 +21,7 @@ msgstr "Privates WLAN" msgid "" "Your node can additionally extend your private network by bridging the WAN " -"interface with a separate WLAN. This feature is completely independent of " +"interface with a seperate WLAN. This feature is completely independent of " "the mesh functionality. Please note that the private WLAN and meshing on the " "WAN interface should not be enabled at the same time." msgstr "" diff --git a/package/gluon-luci-private-wifi/i18n/fr.po b/package/gluon-luci-private-wifi/i18n/fr.po index 091aa87d..6bf2bb2d 100644 --- a/package/gluon-luci-private-wifi/i18n/fr.po +++ b/package/gluon-luci-private-wifi/i18n/fr.po @@ -1,12 +1,12 @@ msgid "" msgstr "" -"Content-Type: text/plain; charset=UTF-8\n" "Project-Id-Version: PACKAGE VERSION\n" "PO-Revision-Date: 2015-08-19 23:30+0100\n" "Last-Translator:Tobias Bernot \n" "Language-Team: French\n" "Language: fr\n" "MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" @@ -21,10 +21,11 @@ msgstr "WLAN privé" msgid "" "Your node can additionally extend your private network by bridging the WAN " -"interface with a separate WLAN. This feature is completely independent of " +"interface with a seperate WLAN. This feature is completely independent of " "the mesh functionality. Please note that the private WLAN and meshing on the " "WAN interface should not be enabled at the same time." msgstr "" -"Votre nœud peut étendre votre réseau privé en interfaçant le WAN avec un WLAN séparé. " -"Cette fonction est complètement indépendante de les fonctions de MESH. " -"Il ne faut pas activer la fonction de MESH et de WLAN privé en même temps." +"Votre nœud peut étendre votre réseau privé en interfaçant le WAN avec un " +"WLAN séparé. Cette fonction est complètement indépendante de les fonctions " +"de MESH. Il ne faut pas activer la fonction de MESH et de WLAN privé en même " +"temps." diff --git a/package/gluon-luci-private-wifi/i18n/gluon-luci-private-wifi.pot b/package/gluon-luci-private-wifi/i18n/gluon-luci-private-wifi.pot index 98d41bf8..4051319f 100644 --- a/package/gluon-luci-private-wifi/i18n/gluon-luci-private-wifi.pot +++ b/package/gluon-luci-private-wifi/i18n/gluon-luci-private-wifi.pot @@ -12,7 +12,7 @@ msgstr "" msgid "" "Your node can additionally extend your private network by bridging the WAN " -"interface with a separate WLAN. This feature is completely independent of " +"interface with a seperate WLAN. This feature is completely independent of " "the mesh functionality. Please note that the private WLAN and meshing on the " "WAN interface should not be enabled at the same time." msgstr "" From 9c7582afe0afb403af7276ba09cbf6e588b448d2 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 27 Nov 2015 14:33:56 +0100 Subject: [PATCH 20/99] gluon-luci-private-wifi: fix typo in code file and regenerate translation files (correctly this time) --- .../files/usr/lib/lua/luci/model/cbi/admin/privatewifi.lua | 2 +- package/gluon-luci-private-wifi/i18n/de.po | 2 +- package/gluon-luci-private-wifi/i18n/fr.po | 2 +- .../gluon-luci-private-wifi/i18n/gluon-luci-private-wifi.pot | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package/gluon-luci-private-wifi/files/usr/lib/lua/luci/model/cbi/admin/privatewifi.lua b/package/gluon-luci-private-wifi/files/usr/lib/lua/luci/model/cbi/admin/privatewifi.lua index d3ddcd72..788ff430 100644 --- a/package/gluon-luci-private-wifi/files/usr/lib/lua/luci/model/cbi/admin/privatewifi.lua +++ b/package/gluon-luci-private-wifi/files/usr/lib/lua/luci/model/cbi/admin/privatewifi.lua @@ -11,7 +11,7 @@ f.template = "admin/expertmode" s = f:section(SimpleSection, nil, translate( 'Your node can additionally extend your private network by bridging the WAN interface ' - .. 'with a seperate WLAN. This feature is completely independent of the mesh functionality. ' + .. 'with a separate WLAN. This feature is completely independent of the mesh functionality. ' .. 'Please note that the private WLAN and meshing on the WAN interface should not be enabled ' .. 'at the same time.' )) diff --git a/package/gluon-luci-private-wifi/i18n/de.po b/package/gluon-luci-private-wifi/i18n/de.po index 31223cd4..5b2ac19d 100644 --- a/package/gluon-luci-private-wifi/i18n/de.po +++ b/package/gluon-luci-private-wifi/i18n/de.po @@ -21,7 +21,7 @@ msgstr "Privates WLAN" msgid "" "Your node can additionally extend your private network by bridging the WAN " -"interface with a seperate WLAN. This feature is completely independent of " +"interface with a separate WLAN. This feature is completely independent of " "the mesh functionality. Please note that the private WLAN and meshing on the " "WAN interface should not be enabled at the same time." msgstr "" diff --git a/package/gluon-luci-private-wifi/i18n/fr.po b/package/gluon-luci-private-wifi/i18n/fr.po index 6bf2bb2d..c95ecd0a 100644 --- a/package/gluon-luci-private-wifi/i18n/fr.po +++ b/package/gluon-luci-private-wifi/i18n/fr.po @@ -21,7 +21,7 @@ msgstr "WLAN privé" msgid "" "Your node can additionally extend your private network by bridging the WAN " -"interface with a seperate WLAN. This feature is completely independent of " +"interface with a separate WLAN. This feature is completely independent of " "the mesh functionality. Please note that the private WLAN and meshing on the " "WAN interface should not be enabled at the same time." msgstr "" diff --git a/package/gluon-luci-private-wifi/i18n/gluon-luci-private-wifi.pot b/package/gluon-luci-private-wifi/i18n/gluon-luci-private-wifi.pot index 4051319f..98d41bf8 100644 --- a/package/gluon-luci-private-wifi/i18n/gluon-luci-private-wifi.pot +++ b/package/gluon-luci-private-wifi/i18n/gluon-luci-private-wifi.pot @@ -12,7 +12,7 @@ msgstr "" msgid "" "Your node can additionally extend your private network by bridging the WAN " -"interface with a seperate WLAN. This feature is completely independent of " +"interface with a separate WLAN. This feature is completely independent of " "the mesh functionality. Please note that the private WLAN and meshing on the " "WAN interface should not be enabled at the same time." msgstr "" From b16ce6637b93a5519f6cff81340ba209ca8b72bb Mon Sep 17 00:00:00 2001 From: Martin Gebhardt Date: Sat, 28 Nov 2015 01:13:50 +0100 Subject: [PATCH 21/99] Add WZR-HP-G300NH to ar71xx-generic target --- targets/ar71xx-generic/profiles.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index c32d1f0a..3f35410f 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -187,6 +187,10 @@ $(eval $(call GluonModel,WRT160NL,wrt160nl,linksys-wrt160nl)) $(eval $(call GluonProfile,WZRHPG450H)) $(eval $(call GluonModel,WZRHPG450H,wzr-hp-g450h,buffalo-wzr-hp-g450h)) +# WZR-HP-G300NH +$(eval $(call GluonProfile,WZRHPG300NH)) +$(eval $(call GluonModel,WZRHPG300NH,wzr-hp-g300nh,buffalo-wzr-hp-g300nh)) + # WZR-HP-AG300H (factory) $(eval $(call GluonProfile,WZRHPAG300H)) $(eval $(call GluonProfileSysupgradeSuffix,WZRHPAG300H)) From 6110d3d44431ddc1c17a940ebacdd8bab2e23280 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 28 Nov 2015 22:41:42 +0100 Subject: [PATCH 22/99] acx-mac80211: mark as BROKEN to avoid compile failure on mipsel targets --- ...void-compile-failure-on-mipsel-targets.patch | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 patches/openwrt/0042-acx-mac80211-mark-as-BROKEN-to-avoid-compile-failure-on-mipsel-targets.patch diff --git a/patches/openwrt/0042-acx-mac80211-mark-as-BROKEN-to-avoid-compile-failure-on-mipsel-targets.patch b/patches/openwrt/0042-acx-mac80211-mark-as-BROKEN-to-avoid-compile-failure-on-mipsel-targets.patch new file mode 100644 index 00000000..93353f10 --- /dev/null +++ b/patches/openwrt/0042-acx-mac80211-mark-as-BROKEN-to-avoid-compile-failure-on-mipsel-targets.patch @@ -0,0 +1,17 @@ +From: Matthias Schiffer +Date: Sat, 28 Nov 2015 22:40:40 +0100 +Subject: acx-mac80211: mark as BROKEN to avoid compile failure on mipsel targets + +diff --git a/package/kernel/acx-mac80211/Makefile b/package/kernel/acx-mac80211/Makefile +index 1820e7a..fb17a46 100644 +--- a/package/kernel/acx-mac80211/Makefile ++++ b/package/kernel/acx-mac80211/Makefile +@@ -30,7 +30,7 @@ include $(INCLUDE_DIR)/package.mk + define KernelPackage/acx-mac80211 + SUBMENU:=Wireless Drivers + TITLE:=ACX1xx mac80211 driver +- DEPENDS:=@(PCI_SUPPORT||TARGET_ar7) @!TARGET_cobalt @mipsel +kmod-mac80211 ++ DEPENDS:=@(PCI_SUPPORT||TARGET_ar7) @!TARGET_cobalt @mipsel +kmod-mac80211 @BROKEN + FILES:=$(PKG_BUILD_DIR)/acx-mac80211.ko + AUTOLOAD:=$(call AutoLoad,50,mac80211 acx-mac80211) + MAINTAINER:=Florian Fainelli From 87dd5bb3bbe26e60e90c84560f0bb7a207f93e7b Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 2 Dec 2015 15:06:25 +0100 Subject: [PATCH 23/99] build: copy opkg keypair to target openwrt tree instead of linking it Fixes #579 --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a5da5004..bb61eb92 100644 --- a/Makefile +++ b/Makefile @@ -262,8 +262,9 @@ MODULE_PREFIX = gluon-$(GLUON_SITE_CODE)-$(PREPARED_RELEASE) include $(INCLUDE_DIR)/target.mk build-key: FORCE - ln -sf $(GLUON_OPKG_KEY) $(BUILD_KEY) - ln -sf $(GLUON_OPKG_KEY).pub $(BUILD_KEY).pub + rm -f $(BUILD_KEY) $(BUILD_KEY).pub + cp $(GLUON_OPKG_KEY) $(BUILD_KEY) + cp $(GLUON_OPKG_KEY).pub $(BUILD_KEY).pub config: FORCE +$(NO_TRACE_MAKE) scripts/config/conf OPENWRT_BUILD= QUIET=0 From e73d3c5c522ab24c0c523690bdeaa01953826133 Mon Sep 17 00:00:00 2001 From: Ranlvor Date: Sun, 6 Dec 2015 16:14:51 +0100 Subject: [PATCH 24/99] OpenSSL: Added source/old to PKG_SOURCE_URL OpenSSL moves old versions of the library from http://www.openssl.org/source/ to http://www.openssl.org/source/old/1.0.2/ breaking the old links. That behavior breaks the OpenWRT-build every time OpenSSL releases a new version. This patch adds http://www.openssl.org/source/old/1.0.2/ to the PKG_SOURCE_URL of OpenSSL to avoid breaking the build whenever OpenSSL releases a new version. --- ...L-Added-source-old-to-PKG_SOURCE_URL.patch | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 patches/openwrt/0043-OpenSSL-Added-source-old-to-PKG_SOURCE_URL.patch diff --git a/patches/openwrt/0043-OpenSSL-Added-source-old-to-PKG_SOURCE_URL.patch b/patches/openwrt/0043-OpenSSL-Added-source-old-to-PKG_SOURCE_URL.patch new file mode 100644 index 00000000..8c5e166f --- /dev/null +++ b/patches/openwrt/0043-OpenSSL-Added-source-old-to-PKG_SOURCE_URL.patch @@ -0,0 +1,24 @@ +From: Ranlvor +Date: Sun, 6 Dec 2015 16:12:55 +0100 +Subject: OpenSSL: Added source/old to PKG_SOURCE_URL + +OpenSSL moves old versions of the library from http://www.openssl.org/source/ +to http://www.openssl.org/source/old/1.0.2/ breaking the old links. That +behavior breaks the OpenWRT-build every time OpenSSL releases a new version. + +This patch adds http://www.openssl.org/source/old/1.0.2/ to the PKG_SOURCE_URL +of OpenSSL to avoid breaking the build whenever OpenSSL releases a new +version. + +diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile +index 7f0da8b..039e1ab 100644 +--- a/package/libs/openssl/Makefile ++++ b/package/libs/openssl/Makefile +@@ -16,6 +16,7 @@ PKG_BUILD_PARALLEL:=1 + + PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz + PKG_SOURCE_URL:=http://www.openssl.org/source/ \ ++ http://www.openssl.org/source/old/1.0.2/ \ + ftp://ftp.funet.fi/pub/crypt/mirrors/ftp.openssl.org/source \ + ftp://ftp.sunet.se/pub/security/tools/net/openssl/source/ + PKG_MD5SUM:=38dd619b2e77cbac69b99f52a053d25a From 444105d22ea28f0518a982753b575cbfbdb6c5a3 Mon Sep 17 00:00:00 2001 From: Philzen Date: Sun, 6 Dec 2015 00:08:49 +0100 Subject: [PATCH 25/99] docs: releases/v2015.2: fix small typo --- docs/releases/v2015.2.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/releases/v2015.2.rst b/docs/releases/v2015.2.rst index e2ac7250..786ed444 100644 --- a/docs/releases/v2015.2.rst +++ b/docs/releases/v2015.2.rst @@ -86,7 +86,7 @@ Bugfixes * Update kernel code for the QCA953x - Might improve statility of the TP-Link TL-WR841N/ND v9. + Might improve stability of the TP-Link TL-WR841N/ND v9. * Fix model detection on some Netgear WNDR3700v2 The broken devices will identify as "NETGEAR ". From 0bb530d1c6d8c6595eb050728f47c8dec7667eb4 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Mon, 7 Dec 2015 13:44:17 +0100 Subject: [PATCH 26/99] gluon-status-page: fix display of rx and tx traffic On the status page statistics section counters for transmitted and received traffic were mixed up. Transmitted traffic was shown as received while received traffic was shown as being transmitted. Fixes #586 --- package/gluon-status-page/src/js/lib/gui/statistics.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/gluon-status-page/src/js/lib/gui/statistics.js b/package/gluon-status-page/src/js/lib/gui/statistics.js index 33a845d8..49778dac 100644 --- a/package/gluon-status-page/src/js/lib/gui/statistics.js +++ b/package/gluon-status-page/src/js/lib/gui/statistics.js @@ -252,8 +252,8 @@ define(["lib/helper"], function (Helper) { table = document.createElement("table") - mkTrafficRow(table, children, "Gesendet", stream, ".traffic.rx") - mkTrafficRow(table, children, "Empfangen", stream, ".traffic.tx") + mkTrafficRow(table, children, "Gesendet", stream, ".traffic.tx") + mkTrafficRow(table, children, "Empfangen", stream, ".traffic.rx") mkTrafficRow(table, children, "Weitergeleitet", stream, ".traffic.forward") el.appendChild(table) From 4c78da2978296ada6a9320676d0a9f67a56b33a4 Mon Sep 17 00:00:00 2001 From: Tobias Hachmer Date: Tue, 8 Dec 2015 19:32:08 +0100 Subject: [PATCH 27/99] docs: releases/v2015.2: add ubiquiti airgateway --- docs/releases/v2015.2.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/releases/v2015.2.rst b/docs/releases/v2015.2.rst index 786ed444..687582a1 100644 --- a/docs/releases/v2015.2.rst +++ b/docs/releases/v2015.2.rst @@ -22,6 +22,10 @@ ar71xx-generic - TL-WR941ND v6 - TL-WR1043N/ND v3 +* Ubiquiti + + - airGateway + * Western Digital - My Net N600 From 3655a5b2282902eed46d24ee386656b2d8aa68b5 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 8 Dec 2015 19:52:26 +0100 Subject: [PATCH 28/99] Revert "bzip2: extend/fix the Host/Install rule to install libbz2.so files" Fixes #589 --- ...tall-rule-to-install-libbz2.so-files.patch | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 patches/openwrt/0044-Revert-bzip2-extend-fix-the-Host-Install-rule-to-install-libbz2.so-files.patch diff --git a/patches/openwrt/0044-Revert-bzip2-extend-fix-the-Host-Install-rule-to-install-libbz2.so-files.patch b/patches/openwrt/0044-Revert-bzip2-extend-fix-the-Host-Install-rule-to-install-libbz2.so-files.patch new file mode 100644 index 00000000..53e88b42 --- /dev/null +++ b/patches/openwrt/0044-Revert-bzip2-extend-fix-the-Host-Install-rule-to-install-libbz2.so-files.patch @@ -0,0 +1,23 @@ +From: Matthias Schiffer +Date: Tue, 8 Dec 2015 19:51:05 +0100 +Subject: Revert "bzip2: extend/fix the Host/Install rule to install libbz2.so files" + +This reverts commit f5ebfb02fc5f539e89393b8186f7ecd768402f12. + +diff --git a/package/utils/bzip2/Makefile b/package/utils/bzip2/Makefile +index ba47cfb..e1c7b97 100644 +--- a/package/utils/bzip2/Makefile ++++ b/package/utils/bzip2/Makefile +@@ -97,10 +97,9 @@ HOST_CONFIGURE_ARGS+= \ + --prefix=$(STAGING_DIR_HOST) + + define Host/Install +- $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin/ $(STAGING_DIR_HOST)/usr/lib ++ $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin/ + $(MAKE) -C $(HOST_BUILD_DIR) PREFIX=$(STAGING_DIR_HOST)/usr/ install +- $(CP) $(HOST_BUILD_DIR)/libbz2.so* $(STAGING_DIR_HOST)/usr/lib/ +- $(CP) $(HOST_BUILD_DIR)/libbz2.so.1.0 $(STAGING_DIR_HOST)/usr/lib/libbz2.so ++# $(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(STAGING_DIR_HOST)/bin/pgen2 + endef + + $(eval $(call HostBuild)) From 5ecb8a73668d030561dda8cf22143bedb27b05da Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 8 Dec 2015 22:47:32 +0100 Subject: [PATCH 29/99] gluon-mesh-vpn-fastd: gluon-annouced: fix fastd status always being reported as enabled --- .../files/lib/gluon/announce/nodeinfo.d/software/fastd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/gluon-mesh-vpn-fastd/files/lib/gluon/announce/nodeinfo.d/software/fastd b/package/gluon-mesh-vpn-fastd/files/lib/gluon/announce/nodeinfo.d/software/fastd index 7b1ff4bc..2c412eb8 100644 --- a/package/gluon-mesh-vpn-fastd/files/lib/gluon/announce/nodeinfo.d/software/fastd +++ b/package/gluon-mesh-vpn-fastd/files/lib/gluon/announce/nodeinfo.d/software/fastd @@ -1,5 +1,5 @@ local ret = { - enabled = uci:get('fastd', 'mesh_vpn', 'enabled') ~= 0, + enabled = uci:get('fastd', 'mesh_vpn') and (uci:get('fastd', 'mesh_vpn', 'enabled') == nil or uci:get_bool('fastd', 'mesh_vpn', 'enabled')), version = util.readline(io.popen('exec fastd -v')):match('^[^%s]+%s+(.+)'), } return ret From de8c908dc3294c96e264371f65563a27e96d7582 Mon Sep 17 00:00:00 2001 From: ruben Date: Fri, 4 Dec 2015 09:51:51 +0100 Subject: [PATCH 30/99] docs: grammar and formatting enhanced in site.conf --- docs/user/site.rst | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/docs/user/site.rst b/docs/user/site.rst index d16b6c3b..cef838f4 100644 --- a/docs/user/site.rst +++ b/docs/user/site.rst @@ -95,14 +95,16 @@ wifi24 : optional This will only affect new installations. Upgrades will not changed the disabled state. - ``ap`` requires a single parameter, a string, named ``ssid`` which sets the interface's ESSID. + ``ap`` requires a single parameter, a string, named ``ssid`` which sets the + interface's ESSID. ``mesh`` requires a single parameter, a string, named ``id`` which sets the mesh id. ``ibss`` requires two parametersr: ``ssid`` (a string) and ``bssid`` (a MAC). An optional parameter ``vlan`` (integer) is supported. - Both ``mesh`` and ``ibss`` accept an optional ``mcast_rate`` (kbit/s) parameter for setting the default multicast datarate. + Both ``mesh`` and ``ibss`` accept an optional ``mcast_rate`` (kbit/s) parameter for + setting the default multicast datarate. :: wifi24 = { @@ -156,10 +158,10 @@ fastd_mesh_vpn The `enabled` option can be set to true to enable the VPN by default. - If `configurable` is `false` or unset, the method list will be replaced on updates - with the list in the site configuration. Setting `configurable` to `true` will allow the user to - add the method ``null`` to the front of the method list or remove ``null`` from it, - and make this change survive updates. Settings configurable is necessary for the + If `configurable` is set to `false` or unset, the method list will be replaced on updates + with the list from the site configuration. Setting `configurable` to `true` will allow the user to + add the method ``null`` to the beginning of the method list or remove ``null`` from it, + and make this change survive updates. Setting `configurable` is necessary for the package `gluon-luci-mesh-vpn-fastd`, which adds a UI for this configuration. In any case, the ``null`` method should always be the first method in the list @@ -169,8 +171,8 @@ fastd_mesh_vpn fastd_mesh_vpn = { methods = {'salsa2012+umac'}, - -- enabled = true, - -- configurable = true, + -- enabled = true, + -- configurable = true, mtu = 1280, groups = { backbone = { @@ -225,9 +227,9 @@ autoupdater : package } roles : optional - Optional role definitions. With this nodes will announce their role inside the mesh. - In the backend this adds the facility to distinguish between normal, backbone and - service nodes or even gateways (if they advertise the role, also). It is up to + Optional role definitions. Nodes will announce their role inside the mesh. + This will allow in the backend to distinguish between normal, backbone and + service nodes or even gateways (if they advertise that role). It is up to the community which roles to define. See the section below as an example. ``default`` takes the default role which is set initially. This value should be part of ``list``. If you want node owners to change the role via config mode add @@ -279,7 +281,7 @@ The ``site.mk`` is a Makefile which should define constants involved in the build process of Gluon. GLUON_SITE_PACKAGES - Defines a list of packages which should installed in addition + Defines a list of packages which should be installed additionally to the ``gluon-core`` package. GLUON_RELEASE @@ -290,7 +292,7 @@ GLUON_PRIORITY for more information). GLUON_LANGS - List of languages (as two-letter-codes) to include for the web interface. Should always contain + List of languages (as two-letter-codes) to be included in the web interface. Should always contain ``en``. .. _site-config-mode-texts: From 46aa2e7c6accbc6f74c297e8966dda27c5717354 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Litza Date: Wed, 9 Dec 2015 21:00:19 +0100 Subject: [PATCH 31/99] docs: Improve documentation of fastd and autoupdater config in site.conf --- docs/user/site.rst | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/docs/user/site.rst b/docs/user/site.rst index cef838f4..49cc303a 100644 --- a/docs/user/site.rst +++ b/docs/user/site.rst @@ -176,14 +176,36 @@ fastd_mesh_vpn mtu = 1280, groups = { backbone = { - limit = 1, + -- Limit number of connected peers from this group + limit = 2, peers = { peer1 = { key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', - remotes = {'ipv4 "vpn1.entenhausen.freifunk.net" port 10000'}, + -- Having multiple domains prevents SPOF in freifunk.net + remotes = { + 'ipv4 "vpn1.entenhausen.freifunk.net" port 10000', + 'ipv4 "vpn1.entenhausener-freifunk.de" port 10000', + }, }, - } - } + peer2 = { + key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + -- You can also omit the ipv4 to allow both connection via ipv4 and ipv6 + remotes = {'"vpn2.entenhausen.freifunk.net" port 10000'}, + }, + }, + -- Optional: nested peer groups + -- groups = { + -- lowend_backbone = { + -- limit = 1, + -- peers = ... + -- }, + -- }, + }, + -- Optional: additional peer groups, possibly with other limits + -- peertopeer = { + -- limit = 10, + -- peers = { ... }, + -- }, }, bandwidth_limit = { @@ -209,14 +231,15 @@ autoupdater : package :: autoupdater = { - branch = 'experimental', + branch = 'stable', branches = { stable = { name = 'stable', mirrors = { 'http://[fdca:ffee:babe:1::fec1]/firmware/stable/sysupgrade/', - 'http://[fdca:ffee:babe:1::fec2]/firmware/stable/sysupgrade/', + 'http://autoupdate.entenhausen.freifunk.net/firmware/stable/sysupgrade/', }, + -- Number of good signatures required good_signatures = 2, pubkeys = { 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', -- someguy From 6b8888fe5aebd941c5e7a83a97ceb0678bee4c43 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 12 Dec 2015 20:51:34 +0100 Subject: [PATCH 32/99] Update Gluon packages --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 5cb9b484..9dd531ec 100644 --- a/modules +++ b/modules @@ -8,7 +8,7 @@ PACKAGES_OPENWRT_COMMIT=f8a70fc188673d0ae8739b0a3095f7f61335fc10 PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git -PACKAGES_GLUON_COMMIT=b4f04f51d53b151a45f0618eef6d89d32f52dae7 +PACKAGES_GLUON_COMMIT=c1aa8b847b80f2a59bcf95984496be128b964928 PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_COMMIT=ae65d4fe027592652376f8dbd3ff2ef37f5a84bc From 38477d5c0ceba656c34cdc434bef893ffd20686d Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 18 Dec 2015 17:27:02 +0100 Subject: [PATCH 33/99] Update gluon packages --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 9dd531ec..bd95c865 100644 --- a/modules +++ b/modules @@ -8,7 +8,7 @@ PACKAGES_OPENWRT_COMMIT=f8a70fc188673d0ae8739b0a3095f7f61335fc10 PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git -PACKAGES_GLUON_COMMIT=c1aa8b847b80f2a59bcf95984496be128b964928 +PACKAGES_GLUON_COMMIT=26203eae4d7b7d7e5e37d4232a838648d744800d PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_COMMIT=ae65d4fe027592652376f8dbd3ff2ef37f5a84bc From 5927fd66dba7e7712e510662384ec817916cc0fc Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 12 Dec 2015 20:48:19 +0100 Subject: [PATCH 34/99] gluon-status-page: filter out duplicate events in statistics event stream Allows simple handling of cached events. --- package/gluon-status-page/src/js/lib/streams.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/gluon-status-page/src/js/lib/streams.js b/package/gluon-status-page/src/js/lib/streams.js index 50286b74..68667cb2 100644 --- a/package/gluon-status-page/src/js/lib/streams.js +++ b/package/gluon-status-page/src/js/lib/streams.js @@ -55,7 +55,7 @@ define(["bacon", "lib/helper"], function(Bacon, Helper) { function statistics(ip) { var url = Helper.buildUrl(ip, "dyn/statistics") - return simpleStream(url) + return simpleStream(url).skipDuplicates(function (a, b) {return (a.uptime === b.uptime)}) } return { nodeInfo: nodeInfo From eba7ecbbc0eaddbd7c4840291854cb2837e46f80 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 12 Dec 2015 20:49:17 +0100 Subject: [PATCH 35/99] gluon-announced: add support for caching announced data --- .../files/usr/lib/lua/gluon/announced.lua | 33 +++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/package/gluon-announced/files/usr/lib/lua/gluon/announced.lua b/package/gluon-announced/files/usr/lib/lua/gluon/announced.lua index f6863277..7c43a523 100644 --- a/package/gluon-announced/files/usr/lib/lua/gluon/announced.lua +++ b/package/gluon-announced/files/usr/lib/lua/gluon/announced.lua @@ -1,6 +1,7 @@ local announce = require 'gluon.announce' local deflate = require 'deflate' local json = require 'luci.jsonc' +local util = require 'luci.util' local nixio = require 'nixio' local fs = require 'nixio.fs' @@ -10,16 +11,36 @@ nixio.chdir('/lib/gluon/announce/') for dir in fs.glob('*.d') do local name = dir:sub(1, -3) - memoize[name] = announce.collect_dir(dir) + memoize[name] = { + collect = announce.collect_dir(dir), + -- tonumber will return 0 for invalid inputs + cache_time = tonumber(util.trim(fs.readfile(name .. '.cache') or '')) + } end -local function collect(type) - return memoize[type] and memoize[type]() +local function collect(type, timestamp) + local c = memoize[type] + if not c then + return nil + end + + if c.cache_timeout and timestamp < c.cache_timeout then + return c.cache + else + local ret = c.collect() + + if c.cache_time then + c.cache = ret + c.cache_timeout = timestamp + c.cache_time + end + + return ret + end end module('gluon.announced', package.seeall) -function handle_request(query) +function handle_request(query, timestamp) collectgarbage() local m = query:match('^GET ([a-z ]+)$') @@ -28,7 +49,7 @@ function handle_request(query) local data = {} for q in m:gmatch('([a-z]+)') do - local ok, val = pcall(collect, q) + local ok, val = pcall(collect, q, timestamp) if ok then data[q] = val end @@ -38,7 +59,7 @@ function handle_request(query) ret = deflate.compress(json.stringify(data)) end elseif query:match('^[a-z]+$') then - local ok, data = pcall(collect, query) + local ok, data = pcall(collect, query, timestamp) if ok then ret = json.stringify(data) end From 48d24c26742acd309e8523d9960e5a891b231270 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 12 Dec 2015 20:50:36 +0100 Subject: [PATCH 36/99] gluon-announce: enable caching --- package/gluon-announce/files/lib/gluon/announce/neighbours.cache | 1 + package/gluon-announce/files/lib/gluon/announce/nodeinfo.cache | 1 + package/gluon-announce/files/lib/gluon/announce/statistics.cache | 1 + 3 files changed, 3 insertions(+) create mode 100644 package/gluon-announce/files/lib/gluon/announce/neighbours.cache create mode 100644 package/gluon-announce/files/lib/gluon/announce/nodeinfo.cache create mode 100644 package/gluon-announce/files/lib/gluon/announce/statistics.cache diff --git a/package/gluon-announce/files/lib/gluon/announce/neighbours.cache b/package/gluon-announce/files/lib/gluon/announce/neighbours.cache new file mode 100644 index 00000000..f599e28b --- /dev/null +++ b/package/gluon-announce/files/lib/gluon/announce/neighbours.cache @@ -0,0 +1 @@ +10 diff --git a/package/gluon-announce/files/lib/gluon/announce/nodeinfo.cache b/package/gluon-announce/files/lib/gluon/announce/nodeinfo.cache new file mode 100644 index 00000000..697cb3a2 --- /dev/null +++ b/package/gluon-announce/files/lib/gluon/announce/nodeinfo.cache @@ -0,0 +1 @@ +300 diff --git a/package/gluon-announce/files/lib/gluon/announce/statistics.cache b/package/gluon-announce/files/lib/gluon/announce/statistics.cache new file mode 100644 index 00000000..7ed6ff82 --- /dev/null +++ b/package/gluon-announce/files/lib/gluon/announce/statistics.cache @@ -0,0 +1 @@ +5 From 077dbe3c0820109a58dd7a3966c831f722a13cea Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 12 Dec 2015 20:53:34 +0100 Subject: [PATCH 37/99] gluon-status-page-api: decrease dyn/statistics event frequency The statistics data is now cached for 5s, no need to send an event every second. The new interval is 3s, which is coprime with the cache timeout. --- .../files/lib/gluon/status-page/www/cgi-bin/dyn/statistics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/dyn/statistics b/package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/dyn/statistics index f93a10b4..637c8bc6 100755 --- a/package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/dyn/statistics +++ b/package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/dyn/statistics @@ -2,4 +2,4 @@ echo "Access-Control-Allow-Origin: *" -exec gluon-neighbour-info -s "" -l -d ::1 -p 1001 -t 1 -r statistics +exec gluon-neighbour-info -s "" -l -d ::1 -p 1001 -t 3 -r statistics From c3150d821f9fe404c7836d6aa4e5047a450b29fa Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 18 Dec 2015 17:44:16 +0100 Subject: [PATCH 38/99] gluon-announce{,d}: create a new UCI cursor for each run --- .../files/usr/lib/lua/gluon/announce.lua | 19 ++++++++++++++++++- .../files/usr/lib/lua/gluon/announced.lua | 2 +- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/package/gluon-announce/files/usr/lib/lua/gluon/announce.lua b/package/gluon-announce/files/usr/lib/lua/gluon/announce.lua index 29a1f817..0e336ad5 100644 --- a/package/gluon-announce/files/usr/lib/lua/gluon/announce.lua +++ b/package/gluon-announce/files/usr/lib/lua/gluon/announce.lua @@ -3,8 +3,11 @@ module('gluon.announce', package.seeall) fs = require 'nixio.fs' -uci = require('luci.model.uci').cursor() util = require 'gluon.util' +model_uci = require 'luci.model.uci' + + +local collect_dir local function collect_entry(entry) if fs.stat(entry, 'type') == 'dir' then @@ -49,3 +52,17 @@ function collect_dir(dir) return ret end end + +function collect(dir) + local f = collect_dir(dir) + + return function () + _M.uci = model_uci.cursor() + ret = f() + _M.uci = nil + + collectgarbage() + + return ret + end +end diff --git a/package/gluon-announced/files/usr/lib/lua/gluon/announced.lua b/package/gluon-announced/files/usr/lib/lua/gluon/announced.lua index 7c43a523..2dfe005c 100644 --- a/package/gluon-announced/files/usr/lib/lua/gluon/announced.lua +++ b/package/gluon-announced/files/usr/lib/lua/gluon/announced.lua @@ -12,7 +12,7 @@ nixio.chdir('/lib/gluon/announce/') for dir in fs.glob('*.d') do local name = dir:sub(1, -3) memoize[name] = { - collect = announce.collect_dir(dir), + collect = announce.collect(dir), -- tonumber will return 0 for invalid inputs cache_time = tonumber(util.trim(fs.readfile(name .. '.cache') or '')) } From d3bc707caad3147016b1c860cbd0409a8d7095d6 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 13 Dec 2015 18:44:04 +0100 Subject: [PATCH 39/99] gluon-neighbour-info: flush after writing the HTTP header sse-multiplex likes to get the header as fast as possible. --- package/gluon-neighbour-info/src/gluon-neighbour-info.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package/gluon-neighbour-info/src/gluon-neighbour-info.c b/package/gluon-neighbour-info/src/gluon-neighbour-info.c index b2652bcc..71bcf391 100644 --- a/package/gluon-neighbour-info/src/gluon-neighbour-info.c +++ b/package/gluon-neighbour-info/src/gluon-neighbour-info.c @@ -206,8 +206,10 @@ int main(int argc, char **argv) { exit(EXIT_FAILURE); } - if (sse) + if (sse) { fputs("Content-Type: text/event-stream\n\n", stdout); + fflush(stdout); + } do { ret = request(sock, &client_addr, request_string, sse, timeout, max_count); From a3155c427aa20b241c4be36be4d0211e04049606 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 13 Dec 2015 18:45:15 +0100 Subject: [PATCH 40/99] gluon-neighbour-info: fix a few compiler warnings --- package/gluon-neighbour-info/src/gluon-neighbour-info.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/package/gluon-neighbour-info/src/gluon-neighbour-info.c b/package/gluon-neighbour-info/src/gluon-neighbour-info.c index 71bcf391..d9862368 100644 --- a/package/gluon-neighbour-info/src/gluon-neighbour-info.c +++ b/package/gluon-neighbour-info/src/gluon-neighbour-info.c @@ -133,7 +133,6 @@ int main(int argc, char **argv) { int sock; struct sockaddr_in6 client_addr = {}; char *request_string = NULL; - struct in6_addr mgroup_addr; sock = socket(PF_INET6, SOCK_DGRAM, 0); @@ -147,9 +146,7 @@ int main(int argc, char **argv) { opterr = 0; - int port_set = 0; - int destination_set = 0; - unsigned int max_count = 0; + int max_count = 0; double timeout = 3.0; char *sse = NULL; bool loop = false; From fa504dae8d9901da0fff7fa79ac50de915084935 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 13 Dec 2015 19:08:37 +0100 Subject: [PATCH 41/99] gluon-neighbour-info: simplify and fix timeout calculation The timeout was calculated incorrectly (in each iteration the span between the start time and the current time was substracted from the timeout again), and would often become negative, causing warnings in the kernel log. --- .../src/gluon-neighbour-info.c | 37 +++++++++++-------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/package/gluon-neighbour-info/src/gluon-neighbour-info.c b/package/gluon-neighbour-info/src/gluon-neighbour-info.c index d9862368..c1dd162a 100644 --- a/package/gluon-neighbour-info/src/gluon-neighbour-info.c +++ b/package/gluon-neighbour-info/src/gluon-neighbour-info.c @@ -58,7 +58,7 @@ void getclock(struct timeval *tv) { } /* Assumes a and b are normalized */ -void tv_subtract (struct timeval *r, struct timeval *a, struct timeval *b) { +void tv_subtract (struct timeval *r, const struct timeval *a, const struct timeval *b) { r->tv_usec = a->tv_usec - b->tv_usec; r->tv_sec = a->tv_sec - b->tv_sec; @@ -68,18 +68,17 @@ void tv_subtract (struct timeval *r, struct timeval *a, struct timeval *b) { } } -ssize_t recvtimeout(int socket, void *buffer, size_t length, int flags, struct timeval *timeout, struct timeval *offset) { - struct timeval now, delta; - ssize_t ret; - - setsockopt(socket, SOL_SOCKET, SO_RCVTIMEO, timeout, sizeof(*timeout)); - ret = recv(socket, buffer, length, flags); +ssize_t recvtimeout(int socket, void *buffer, size_t length, int flags, const struct timeval *timeout) { + struct timeval now, timeout_left; getclock(&now); - tv_subtract(&delta, &now, offset); - tv_subtract(timeout, timeout, &delta); + tv_subtract(&timeout_left, timeout, &now); - return ret; + if (timeout_left.tv_sec < 0) + return -1; + + setsockopt(socket, SOL_SOCKET, SO_RCVTIMEO, &timeout_left, sizeof(timeout_left)); + return recv(socket, buffer, length, flags); } int request(const int sock, const struct sockaddr_in6 *client_addr, const char *request, const char *sse, double timeout, unsigned int max_count) { @@ -94,14 +93,18 @@ int request(const int sock, const struct sockaddr_in6 *client_addr, const char * exit(EXIT_FAILURE); } - struct timeval tv_timeout, tv_offset; - tv_timeout.tv_sec = (int) timeout; - tv_timeout.tv_usec = ((int) (timeout * 1000000)) % 1000000; + struct timeval tv_timeout; + getclock(&tv_timeout); - getclock(&tv_offset); + tv_timeout.tv_sec += (int) timeout; + tv_timeout.tv_usec += ((int) (timeout * 1000000)) % 1000000; + if (tv_timeout.tv_usec >= 1000000) { + tv_timeout.tv_usec -= 1000000; + tv_timeout.tv_sec += 1; + } do { - ret = recvtimeout(sock, buffer, sizeof(buffer), 0, &tv_timeout, &tv_offset); + ret = recvtimeout(sock, buffer, sizeof(buffer), 0, &tv_timeout); if (ret < 0) break; @@ -176,6 +179,10 @@ int main(int argc, char **argv) { break; case 't': timeout = atof(optarg); + if (timeout < 0) { + perror("Negative timeout not supported"); + exit(EXIT_FAILURE); + } break; case 's': sse = optarg; From 90a64ca87f7bdc2c9176484c325f69b82622fe81 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 13 Dec 2015 14:46:27 +0100 Subject: [PATCH 42/99] gluon-status-page-api: use sse-multiplex --- package/gluon-status-page-api/Makefile | 8 ++--- .../www/cgi-bin/dyn/neighbours-batadv | 7 +++++ .../www/cgi-bin/dyn/neighbours-nodeinfo | 8 ++++- .../status-page/www/cgi-bin/dyn/stations | 15 ++++++++++ .../status-page/www/cgi-bin/dyn/statistics | 6 ++-- .../src/neighbours-batadv.c | 2 +- package/gluon-status-page-api/src/stations.c | 29 ++----------------- 7 files changed, 41 insertions(+), 34 deletions(-) create mode 100755 package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/dyn/neighbours-batadv create mode 100755 package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/dyn/stations mode change 100755 => 100644 package/gluon-status-page-api/src/neighbours-batadv.c mode change 100755 => 100644 package/gluon-status-page-api/src/stations.c diff --git a/package/gluon-status-page-api/Makefile b/package/gluon-status-page-api/Makefile index 91a7095a..46c9e7d2 100644 --- a/package/gluon-status-page-api/Makefile +++ b/package/gluon-status-page-api/Makefile @@ -12,7 +12,7 @@ define Package/gluon-status-page-api SECTION:=gluon CATEGORY:=Gluon TITLE:=API for gluon-status-page - DEPENDS:=+gluon-core +uhttpd +gluon-neighbour-info +gluon-announced +libiwinfo +libjson-c + DEPENDS:=+gluon-core +uhttpd +sse-multiplex +gluon-neighbour-info +gluon-announced +libiwinfo +libjson-c endef define Build/Prepare @@ -21,9 +21,9 @@ define Build/Prepare endef define Package/gluon-status-page-api/install - $(INSTALL_DIR) $(1)/lib/gluon/status-page/www/cgi-bin/dyn - $(INSTALL_BIN) $(PKG_BUILD_DIR)/neighbours-batadv $(1)/lib/gluon/status-page/www/cgi-bin/dyn/ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/stations $(1)/lib/gluon/status-page/www/cgi-bin/dyn/ + $(INSTALL_DIR) $(1)/lib/gluon/status-page/providers + $(INSTALL_BIN) $(PKG_BUILD_DIR)/neighbours-batadv $(1)/lib/gluon/status-page/providers/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/stations $(1)/lib/gluon/status-page/providers/ $(CP) ./files/* $(1)/ endef diff --git a/package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/dyn/neighbours-batadv b/package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/dyn/neighbours-batadv new file mode 100755 index 00000000..075e8b8b --- /dev/null +++ b/package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/dyn/neighbours-batadv @@ -0,0 +1,7 @@ +#!/bin/sh + +echo 'Access-Control-Allow-Origin: *' + +CMD='exec /lib/gluon/status-page/providers/neighbours-batadv' + +exec /usr/sbin/sse-multiplex "$CMD" diff --git a/package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/dyn/neighbours-nodeinfo b/package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/dyn/neighbours-nodeinfo index 4420570e..657f17e5 100755 --- a/package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/dyn/neighbours-nodeinfo +++ b/package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/dyn/neighbours-nodeinfo @@ -1,7 +1,13 @@ #!/bin/sh +badrequest() { + echo 'Status: 400 Bad Request' + echo + exit 1 +} + echo 'Access-Control-Allow-Origin: *' -batctl if | cut -d: -f1 | grep -qxF "$QUERY_STRING" || exit 1 +batctl if | cut -d: -f1 | grep -qxF "$QUERY_STRING" || badrequest exec /usr/bin/gluon-neighbour-info -s neighbour -i "$QUERY_STRING" -d ff02::2:1001 -p 1001 -r nodeinfo diff --git a/package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/dyn/stations b/package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/dyn/stations new file mode 100755 index 00000000..258122fb --- /dev/null +++ b/package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/dyn/stations @@ -0,0 +1,15 @@ +#!/bin/sh + +badrequest() { + echo 'Status: 400 Bad Request' + echo + exit 1 +} + +echo 'Access-Control-Allow-Origin: *' + +batctl if | cut -d: -f1 | grep -qxF "$QUERY_STRING" || badrequest + +CMD="exec /lib/gluon/status-page/providers/stations '$QUERY_STRING'" + +exec /usr/sbin/sse-multiplex "$CMD" diff --git a/package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/dyn/statistics b/package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/dyn/statistics index 637c8bc6..ef0dd3d8 100755 --- a/package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/dyn/statistics +++ b/package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/dyn/statistics @@ -1,5 +1,7 @@ #!/bin/sh -echo "Access-Control-Allow-Origin: *" +echo 'Access-Control-Allow-Origin: *' -exec gluon-neighbour-info -s "" -l -d ::1 -p 1001 -t 3 -r statistics +CMD='exec gluon-neighbour-info -s "" -l -d ::1 -p 1001 -t 3 -r statistics' + +exec /usr/sbin/sse-multiplex "$CMD" diff --git a/package/gluon-status-page-api/src/neighbours-batadv.c b/package/gluon-status-page-api/src/neighbours-batadv.c old mode 100755 new mode 100644 index a386b5e0..1fd62eaf --- a/package/gluon-status-page-api/src/neighbours-batadv.c +++ b/package/gluon-status-page-api/src/neighbours-batadv.c @@ -50,8 +50,8 @@ static json_object *neighbours(void) { int main(void) { struct json_object *obj; - printf("Access-Control-Allow-Origin: *\n"); printf("Content-type: text/event-stream\n\n"); + fflush(stdout); while (1) { obj = neighbours(); diff --git a/package/gluon-status-page-api/src/stations.c b/package/gluon-status-page-api/src/stations.c old mode 100755 new mode 100644 index 9cae3680..13288827 --- a/package/gluon-status-page-api/src/stations.c +++ b/package/gluon-status-page-api/src/stations.c @@ -1,15 +1,10 @@ #include #include #include -#include #include #include #include -#define STR(x) #x -#define XSTR(x) STR(x) - -#define BATIF_PREFIX "/sys/class/net/bat0/lower_" static struct json_object *get_stations(const struct iwinfo_ops *iw, const char *ifname) { int len; @@ -45,34 +40,16 @@ static void badrequest() { exit(1); } -bool interface_is_valid(const char *ifname) { - if (strlen(ifname) > IF_NAMESIZE) - return false; - - if (strchr(ifname, '/') != NULL) - return false; - - char *path = alloca(1 + strlen(BATIF_PREFIX) + strlen(ifname)); - sprintf(path, "%s%s", BATIF_PREFIX, ifname); - - return access(path, F_OK) == 0; -} - -int main(void) { - char *ifname = getenv("QUERY_STRING"); - - if (ifname == NULL) - badrequest(); - - if (!interface_is_valid(ifname)) +int main(int argc, char *argv[]) { + if (argc != 2) badrequest(); + const char *ifname = argv[1]; const struct iwinfo_ops *iw = iwinfo_backend(ifname); if (iw == NULL) badrequest(); - printf("Access-Control-Allow-Origin: *\n"); printf("Content-type: text/event-stream\n\n"); while (true) { From 939087cec91bf3db72bb0b30ae42e3092b4c6292 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 14 Dec 2015 02:55:33 +0100 Subject: [PATCH 43/99] gluon-status-page-api: neighbours-batadv: use batman-adv-visdata, increase interval --- package/gluon-status-page-api/Makefile | 2 +- .../src/neighbours-batadv.c | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package/gluon-status-page-api/Makefile b/package/gluon-status-page-api/Makefile index 46c9e7d2..5b806331 100644 --- a/package/gluon-status-page-api/Makefile +++ b/package/gluon-status-page-api/Makefile @@ -12,7 +12,7 @@ define Package/gluon-status-page-api SECTION:=gluon CATEGORY:=Gluon TITLE:=API for gluon-status-page - DEPENDS:=+gluon-core +uhttpd +sse-multiplex +gluon-neighbour-info +gluon-announced +libiwinfo +libjson-c + DEPENDS:=+gluon-core +uhttpd +sse-multiplex +batman-adv-visdata +gluon-neighbour-info +gluon-announced +libiwinfo +libjson-c endef define Build/Prepare diff --git a/package/gluon-status-page-api/src/neighbours-batadv.c b/package/gluon-status-page-api/src/neighbours-batadv.c index 1fd62eaf..fb7be776 100644 --- a/package/gluon-status-page-api/src/neighbours-batadv.c +++ b/package/gluon-status-page-api/src/neighbours-batadv.c @@ -12,12 +12,10 @@ static json_object *neighbours(void) { FILE *f; - f = fopen("/sys/kernel/debug/batman_adv/bat0/originators" , "r"); + f = fopen("/tmp/batman-adv-visdata/bat0/originators" , "r"); - if (f == NULL) { - perror("Can not open bat0/originators"); - exit(1); - } + if (f == NULL) + return NULL; while (!feof(f)) { char mac1[18]; @@ -55,10 +53,12 @@ int main(void) { while (1) { obj = neighbours(); - printf("data: %s\n\n", json_object_to_json_string_ext(obj, JSON_C_TO_STRING_PLAIN)); - fflush(stdout); - json_object_put(obj); - sleep(1); + if (obj) { + printf("data: %s\n\n", json_object_to_json_string_ext(obj, JSON_C_TO_STRING_PLAIN)); + fflush(stdout); + json_object_put(obj); + } + sleep(10); } return 0; From 8ffdcaaa1ba35e2d5bc6c526fb0ba9c36a3c8323 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 14 Dec 2015 02:57:47 +0100 Subject: [PATCH 44/99] gluon-mesh-batman-adv-core: announce/neighbours.d: use batman-adv-visdata --- package/gluon-mesh-batman-adv-core/Makefile | 2 +- .../files/lib/gluon/announce/neighbours.d/batadv | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/gluon-mesh-batman-adv-core/Makefile b/package/gluon-mesh-batman-adv-core/Makefile index c256ac93..cb7426f2 100644 --- a/package/gluon-mesh-batman-adv-core/Makefile +++ b/package/gluon-mesh-batman-adv-core/Makefile @@ -11,7 +11,7 @@ define Package/gluon-mesh-batman-adv-core SECTION:=gluon CATEGORY:=Gluon TITLE:=Support for batman-adv meshing (core) - DEPENDS:=+gluon-core +gluon-client-bridge +firewall +libiwinfo-lua + DEPENDS:=+gluon-core +gluon-client-bridge +firewall +libiwinfo-lua +batman-adv-visdata endef define Build/Prepare diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/neighbours.d/batadv b/package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/neighbours.d/batadv index 69b7981d..fa953037 100644 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/neighbours.d/batadv +++ b/package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/neighbours.d/batadv @@ -14,7 +14,7 @@ end function batadv() local interfaces = {} - local list = io.lines("/sys/kernel/debug/batman_adv/bat0/originators") + local list = io.lines("/tmp/batman-adv-visdata/bat0/originators") for line in list do local mac1, lastseen, tq, mac2, ifname = line:match("^([0-9a-f:]+) +(%d+%.%d+)s +%( *(%d+)%) +([0-9a-f:]+) +%[ *(.-)%]") From 73a818b896bea86cb6398cf6dbc93fd0bb8ea00d Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 14 Dec 2015 03:10:01 +0100 Subject: [PATCH 45/99] alfred: use batman-adv-visdata --- .../0005-alfred-use-batman-adv-visdata.patch | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 patches/packages/routing/0005-alfred-use-batman-adv-visdata.patch diff --git a/patches/packages/routing/0005-alfred-use-batman-adv-visdata.patch b/patches/packages/routing/0005-alfred-use-batman-adv-visdata.patch new file mode 100644 index 00000000..6064774d --- /dev/null +++ b/patches/packages/routing/0005-alfred-use-batman-adv-visdata.patch @@ -0,0 +1,83 @@ +From: Matthias Schiffer +Date: Mon, 14 Dec 2015 03:08:42 +0100 +Subject: alfred: use batman-adv-visdata + +diff --git a/alfred/Makefile b/alfred/Makefile +index 8f49b5a..f1d7c6e 100644 +--- a/alfred/Makefile ++++ b/alfred/Makefile +@@ -28,7 +28,7 @@ define Package/alfred + SECTION:=net + CATEGORY:=Network + TITLE:=A.L.F.R.E.D. - Almighty Lightweight Fact Remote Exchange Daemon +- DEPENDS:= +libc +kmod-ipv6 +librt \ ++ DEPENDS:= +libc +kmod-ipv6 +librt +batman-adv-visdata \ + +ALFRED_NEEDS_lua:lua \ + +ALFRED_NEEDS_libgps:libgps + endef +diff --git a/alfred/patches/0002-alfred-use-batman-adv-visdata.patch b/alfred/patches/0002-alfred-use-batman-adv-visdata.patch +new file mode 100644 +index 0000000..a28b6a4 +--- /dev/null ++++ b/alfred/patches/0002-alfred-use-batman-adv-visdata.patch +@@ -0,0 +1,60 @@ ++--- a/batadv_query.c +++++ b/batadv_query.c ++@@ -91,8 +91,10 @@ int ipv6_to_mac(const struct in6_addr *a ++ int batadv_interface_check(const char *mesh_iface) ++ { ++ char *debugfs_mnt; +++#if 0 ++ char full_path[MAX_PATH + 1]; ++ FILE *f; +++#endif ++ ++ debugfs_mnt = debugfs_mount(NULL); ++ if (!debugfs_mnt) { ++@@ -100,6 +102,7 @@ int batadv_interface_check(const char *m ++ return -1; ++ } ++ +++#if 0 ++ debugfs_make_path(DEBUG_BATIF_PATH_FMT "/" DEBUG_TRANSTABLE_GLOBAL, ++ mesh_iface, full_path, sizeof(full_path)); ++ f = fopen(full_path, "r"); ++@@ -121,6 +124,7 @@ int batadv_interface_check(const char *m ++ return -1; ++ } ++ fclose(f); +++#endif ++ ++ return 0; ++ } ++@@ -150,8 +154,7 @@ struct ether_addr *translate_mac(const c ++ if (!debugfs_mnt) ++ goto out; ++ ++- debugfs_make_path(DEBUG_BATIF_PATH_FMT "/" DEBUG_TRANSTABLE_GLOBAL, ++- mesh_iface, full_path, sizeof(full_path)); +++ snprintf(full_path, sizeof(full_path), "/tmp/batman-adv-visdata/%s/transtable_global", mesh_iface); ++ ++ f = fopen(full_path, "r"); ++ if (!f) ++@@ -232,8 +235,7 @@ uint8_t get_tq(const char *mesh_iface, s ++ if (!debugfs_mnt) ++ goto out; ++ ++- debugfs_make_path(DEBUG_BATIF_PATH_FMT "/" DEBUG_ORIGINATORS, ++- mesh_iface, full_path, sizeof(full_path)); +++ snprintf(full_path, sizeof(full_path), "/tmp/batman-adv-visdata/%s/originators", mesh_iface); ++ ++ f = fopen(full_path, "r"); ++ if (!f) ++--- a/vis/vis.c +++++ b/vis/vis.c ++@@ -325,7 +325,7 @@ static int parse_orig_list(struct global ++ char path[1024]; ++ struct vis_list_entry *v_entry; ++ ++- snprintf(path, sizeof(path), "/sys/kernel/debug/batman_adv/%s/originators", globals->interface); +++ snprintf(path, sizeof(path), "/tmp/batman-adv-visdata/%s/originators", globals->interface); ++ fbuf = read_file(path); ++ if (!fbuf) ++ return -1; From df018ed7c7f33006565918bf7d4cc4caab631aee Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 20 Dec 2015 20:13:09 +0100 Subject: [PATCH 46/99] docs: releases/v2015.2: fix typo --- docs/releases/v2015.2.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/releases/v2015.2.rst b/docs/releases/v2015.2.rst index 687582a1..9c7e2cad 100644 --- a/docs/releases/v2015.2.rst +++ b/docs/releases/v2015.2.rst @@ -215,7 +215,7 @@ Site changes * ``i18n/`` - The translations of ``gluon-config-mode:pubkey`` now have to show the fastd - public key itself if desired, making the formatting of the key and whether it is shown at + public key themselves if desired, making the formatting of the key and whether it is shown at all configurable. To retain the old format, add ``

`` to the beginning of your translations and append:: From 65ce99449e1d45a1520639bdb9ad604c0493dc64 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 1 Jan 2016 16:29:15 +0100 Subject: [PATCH 47/99] docs: rename development version to v2016.1 --- docs/features/wired-mesh.rst | 4 ++-- docs/index.rst | 2 +- docs/releases/{v2015.2.rst => v2016.1.rst} | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename docs/releases/{v2015.2.rst => v2016.1.rst} (99%) diff --git a/docs/features/wired-mesh.rst b/docs/features/wired-mesh.rst index f394464b..c62cc2b8 100644 --- a/docs/features/wired-mesh.rst +++ b/docs/features/wired-mesh.rst @@ -60,6 +60,6 @@ It may be disabled by running:: done uci commit -Please note that this configuration has changed in Gluon v2015.2. Using -the old commands on v2015.2 will break the corresponding Export Mode +Please note that this configuration has changed in Gluon v2016.1. Using +the old commands on v2016.1 will break the corresponding Export Mode settings. diff --git a/docs/index.rst b/docs/index.rst index 54effbcf..c03ad749 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -59,7 +59,7 @@ Releases .. toctree:: :maxdepth: 1 - releases/v2015.2 + releases/v2016.1 releases/v2015.1.2 releases/v2015.1.1 releases/v2015.1 diff --git a/docs/releases/v2015.2.rst b/docs/releases/v2016.1.rst similarity index 99% rename from docs/releases/v2015.2.rst rename to docs/releases/v2016.1.rst index 9c7e2cad..f708492a 100644 --- a/docs/releases/v2015.2.rst +++ b/docs/releases/v2016.1.rst @@ -1,4 +1,4 @@ -Gluon 2015.2 (in development) +Gluon 2016.1 (in development) ============================= Added hardware support From 02d3ed2fa9ade8473b604c2b54170c2ad64ed443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?PetaByteBoy=20//=20Milan=20P=C3=A4ssler?= Date: Fri, 1 Jan 2016 20:23:15 +0100 Subject: [PATCH 48/99] docs: features/wired-mesh: fix typo --- docs/features/wired-mesh.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features/wired-mesh.rst b/docs/features/wired-mesh.rst index c62cc2b8..77c7d6b3 100644 --- a/docs/features/wired-mesh.rst +++ b/docs/features/wired-mesh.rst @@ -61,5 +61,5 @@ It may be disabled by running:: uci commit Please note that this configuration has changed in Gluon v2016.1. Using -the old commands on v2016.1 will break the corresponding Export Mode +the old commands on v2016.1 will break the corresponding Expert Mode settings. From ddc2a5176470ea43d33036f9cbcbee86c03eaffc Mon Sep 17 00:00:00 2001 From: bdobe Date: Fri, 1 Jan 2016 23:04:38 +0100 Subject: [PATCH 49/99] ar71xx-generic: add support for D-Link DIR-505 --- targets/ar71xx-generic/profiles.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index c32d1f0a..8c791aa0 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -166,6 +166,11 @@ endif ## D-Link +# D-Link DIR-505 rev. A1 + +$(eval $(call GluonProfile,DIR505A1)) +$(eval $(call GluonModel,DIR505A1,dir-505-a1,d-link-dir-505-rev-a1)) + # D-Link DIR-615 rev. C1 $(eval $(call GluonProfile,DIR615C1)) $(eval $(call GluonModel,DIR615C1,dir-615-c1,d-link-dir-615-rev-c1)) From 289f58d5b93b9b86c7c4ee88970838de4a766317 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 2 Jan 2016 23:46:03 +0100 Subject: [PATCH 50/99] ar71xx: another fix to wndr3700_board_detect --- ...another-fix-to-wndr3700_board_detect.patch | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 patches/openwrt/0045-ar71xx-another-fix-to-wndr3700_board_detect.patch diff --git a/patches/openwrt/0045-ar71xx-another-fix-to-wndr3700_board_detect.patch b/patches/openwrt/0045-ar71xx-another-fix-to-wndr3700_board_detect.patch new file mode 100644 index 00000000..e6671e98 --- /dev/null +++ b/patches/openwrt/0045-ar71xx-another-fix-to-wndr3700_board_detect.patch @@ -0,0 +1,29 @@ +From: Matthias Schiffer +Date: Sat, 2 Jan 2016 23:36:25 +0100 +Subject: ar71xx: another fix to wndr3700_board_detect + +My last bugfix (r47538) introduced a new bug in wndr3700_board_detect +(again...). + +Assigning the result of ar71xx_get_mtd_offset_size_format to the model +variable before stripping of garbage using awk will cause all NUL bytes to +be removed before awk is applied, leading to model strings like +"NETGEAR WNDRMACv2NETGEAR", where a NUL byte after the v2 is supposed to +terminate the string. + +Fix by calling ar71xx_get_mtd_offset_size_format twice, once piping to awk +directly. + +diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh +index daebaa4..d0abf42 100755 +--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh ++++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh +@@ -39,7 +39,7 @@ wndr3700_board_detect() { + "33373031") + model="$(ar71xx_get_mtd_offset_size_format art 41 32 %c)" + # Use awk to remove everything unprintable +- model_stripped="$(echo -n "$model" | LC_CTYPE=C awk -v 'FS=[^[:print:]]' '{print $1; exit}')" ++ model_stripped="$(ar71xx_get_mtd_offset_size_format art 41 32 %c | LC_CTYPE=C awk -v 'FS=[^[:print:]]' '{print $1; exit}')" + case $model in + $'\xff'*) + if [ "${model:24:1}" = 'N' ]; then From 97471a1bb76b8f974e5e55ea18075d605382cdbd Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 30 Dec 2015 01:02:59 +0100 Subject: [PATCH 51/99] lua-cjson: add host build support --- ...stallation-of-headers-for-host-build.patch | 16 ++++++++++ ...003-lua-cjson-add-host-build-support.patch | 32 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 patches/openwrt/0046-lua-fix-installation-of-headers-for-host-build.patch create mode 100644 patches/packages/openwrt/0003-lua-cjson-add-host-build-support.patch diff --git a/patches/openwrt/0046-lua-fix-installation-of-headers-for-host-build.patch b/patches/openwrt/0046-lua-fix-installation-of-headers-for-host-build.patch new file mode 100644 index 00000000..ab49ad65 --- /dev/null +++ b/patches/openwrt/0046-lua-fix-installation-of-headers-for-host-build.patch @@ -0,0 +1,16 @@ +From: Matthias Schiffer +Date: Tue, 29 Dec 2015 22:48:52 +0100 +Subject: lua: fix installation of headers for host build + +diff --git a/package/utils/lua/Makefile b/package/utils/lua/Makefile +index 72d5631..c37d99b 100644 +--- a/package/utils/lua/Makefile ++++ b/package/utils/lua/Makefile +@@ -140,6 +140,7 @@ define Host/Install + $(MAKE) -C $(HOST_BUILD_DIR) \ + INSTALL_TOP="$(STAGING_DIR_HOST)" \ + install ++ $(CP) $(HOST_BUILD_DIR)/src/lnum_config.h $(STAGING_DIR_HOST)/include/ + endef + + define Build/InstallDev diff --git a/patches/packages/openwrt/0003-lua-cjson-add-host-build-support.patch b/patches/packages/openwrt/0003-lua-cjson-add-host-build-support.patch new file mode 100644 index 00000000..9c1f7744 --- /dev/null +++ b/patches/packages/openwrt/0003-lua-cjson-add-host-build-support.patch @@ -0,0 +1,32 @@ +From: Matthias Schiffer +Date: Wed, 30 Dec 2015 01:00:49 +0100 +Subject: lua-cjson: add host build support + +diff --git a/lang/lua-cjson/Makefile b/lang/lua-cjson/Makefile +index fd489f2..90c8f98 100644 +--- a/lang/lua-cjson/Makefile ++++ b/lang/lua-cjson/Makefile +@@ -20,6 +20,7 @@ PKG_MD5SUM:=24f270663e9f6ca8ba2a02cef19f7963 + + PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) + ++include $(INCLUDE_DIR)/host-build.mk + include $(INCLUDE_DIR)/package.mk + include $(INCLUDE_DIR)/cmake.mk + +@@ -39,6 +40,9 @@ endef + CMAKE_OPTIONS += \ + -DUSE_LUA=ON + ++CMAKE_HOST_OPTIONS += \ ++ -DLUA_MATH_LIBRARY=m ++ + define Package/lua-cjson/install + $(INSTALL_DIR) $(1)/usr/lib/lua + $(INSTALL_BIN) $(PKG_BUILD_DIR)/cjson.so $(1)/usr/lib/lua/ +@@ -47,4 +51,5 @@ define Package/lua-cjson/install + $(INSTALL_DATA) $(PKG_BUILD_DIR)/lua/cjson/util.lua $(1)/usr/lib/lua/cjson + endef + ++$(eval $(call HostBuild)) + $(eval $(call BuildPackage,lua-cjson)) From f23e02478718cd2f1b17719fdf83c4b85113149c Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 30 Dec 2015 03:35:17 +0100 Subject: [PATCH 52/99] Convert site.conf to JSON during build This will allow us to use its content from other languages than Lua as well. --- Makefile | 2 +- package/gluon-core/Makefile | 2 +- .../files/usr/lib/lua/gluon/site_config.lua | 22 ++++++++++++------- package/gluon-site/Makefile | 4 ++-- scripts/check_site.sh | 2 +- scripts/site.sh | 2 +- scripts/site_config.lua | 9 ++++++++ 7 files changed, 29 insertions(+), 14 deletions(-) create mode 100644 scripts/site_config.lua diff --git a/Makefile b/Makefile index bb61eb92..a1b69459 100644 --- a/Makefile +++ b/Makefile @@ -338,7 +338,7 @@ prepare-image: FORCE +$(SUBMAKE) -C $(TOPDIR)/target/linux/$(BOARD)/image image_prepare KDIR="$(BOARD_KDIR)" prepare: FORCE - @$(STAGING_DIR_HOST)/bin/lua $(GLUONDIR)/package/gluon-core/files/usr/lib/lua/gluon/site_config.lua \ + @$(STAGING_DIR_HOST)/bin/lua $(GLUONDIR)/scripts/site_config.lua \ || (echo 'Your site configuration did not pass validation.'; false) mkdir -p $(GLUON_IMAGEDIR) $(BOARD_BUILDDIR) diff --git a/package/gluon-core/Makefile b/package/gluon-core/Makefile index ddf67dcd..ecd6fbe3 100644 --- a/package/gluon-core/Makefile +++ b/package/gluon-core/Makefile @@ -12,7 +12,7 @@ define Package/gluon-core SECTION:=gluon CATEGORY:=Gluon TITLE:=Base files of Gluon - DEPENDS:=+gluon-site +lua-platform-info +luci-base +odhcp6c +firewall + DEPENDS:=+gluon-site +lua-platform-info +luci-base +luci-lib-jsonc +odhcp6c +firewall endef diff --git a/package/gluon-core/files/usr/lib/lua/gluon/site_config.lua b/package/gluon-core/files/usr/lib/lua/gluon/site_config.lua index cf151483..6f01b066 100644 --- a/package/gluon-core/files/usr/lib/lua/gluon/site_config.lua +++ b/package/gluon-core/files/usr/lib/lua/gluon/site_config.lua @@ -1,20 +1,26 @@ -local config = os.getenv('GLUON_SITE_CONFIG') or '/lib/gluon/site.conf' +local function get_site_config() + local config = '/lib/gluon/site.json' -local function loader() - coroutine.yield('return ') - coroutine.yield(io.open(config):read('*a')) + local json = require 'luci.jsonc' + local ltn12 = require 'luci.ltn12' + + local file = assert(io.open(config)) + + local decoder = json.new() + ltn12.pump.all(ltn12.source.file(io.open(config)), decoder:sink()) + + file:close() + + return assert(decoder:get()) end --- setfenv doesn't work with Lua 5.2 anymore, but we're using 5.1 -local site_config = setfenv(assert(load(coroutine.wrap(loader), 'site.conf')), {})() - local setmetatable = setmetatable module 'gluon.site_config' setmetatable(_M, { - __index = site_config, + __index = get_site_config(), } ) diff --git a/package/gluon-site/Makefile b/package/gluon-site/Makefile index abd057c9..a7084ad0 100644 --- a/package/gluon-site/Makefile +++ b/package/gluon-site/Makefile @@ -5,7 +5,7 @@ PKG_VERSION:=$(if $(GLUON_SITE_CODE),$(GLUON_SITE_CODE),1) PKG_RELEASE:=$(GLUON_RELEASE) PKG_FILE_DEPENDS := $(GLUON_SITEDIR)/site.conf $(GLUON_SITEDIR)/i18n/ -PKG_BUILD_DEPENDS := luci-base/host +PKG_BUILD_DEPENDS := luci-base/host lua-cjson/host PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) @@ -33,7 +33,7 @@ endef define Package/gluon-site/install $(INSTALL_DIR) $(1)/lib/gluon - $(CP) $(GLUON_SITEDIR)/site.conf $(1)/lib/gluon/site.conf + lua -e 'print(require("cjson").encode(assert(dofile("$(GLUONDIR)/scripts/site_config.lua"))))' > $(1)/lib/gluon/site.json echo "$(GLUON_RELEASE)" > $(1)/lib/gluon/release $(call GluonInstallI18N,gluon-site,$(1)) diff --git a/scripts/check_site.sh b/scripts/check_site.sh index e0aa43e5..0ca30316 100755 --- a/scripts/check_site.sh +++ b/scripts/check_site.sh @@ -1,6 +1,6 @@ #!/bin/sh -SITE_CONFIG_LUA=package/gluon-core/files/usr/lib/lua/gluon/site_config.lua +SITE_CONFIG_LUA=scripts/site_config.lua CHECK_SITE_LIB=scripts/check_site_lib.lua "$GLUONDIR"/openwrt/staging_dir/host/bin/lua -e "site = dofile(os.getenv('GLUONDIR') .. '/${SITE_CONFIG_LUA}'); dofile(os.getenv('GLUONDIR') .. '/${CHECK_SITE_LIB}'); dofile()" diff --git a/scripts/site.sh b/scripts/site.sh index 82016cbe..5038438a 100755 --- a/scripts/site.sh +++ b/scripts/site.sh @@ -1,5 +1,5 @@ #!/bin/sh -SITE_CONFIG_LUA=package/gluon-core/files/usr/lib/lua/gluon/site_config.lua +SITE_CONFIG_LUA=scripts/site_config.lua "$GLUONDIR"/openwrt/staging_dir/host/bin/lua -e "print(assert(dofile(os.getenv('GLUONDIR') .. '/${SITE_CONFIG_LUA}').$1))" 2>/dev/null diff --git a/scripts/site_config.lua b/scripts/site_config.lua new file mode 100644 index 00000000..a50f115b --- /dev/null +++ b/scripts/site_config.lua @@ -0,0 +1,9 @@ +local config = os.getenv('GLUON_SITE_CONFIG') + +local function loader() + coroutine.yield('return ') + coroutine.yield(io.open(config):read('*a')) +end + +-- setfenv doesn't work with Lua 5.2 anymore, but we're using 5.1 +return setfenv(assert(load(coroutine.wrap(loader), 'site.conf')), {})() From 4456480a5262d6b5f80ef73fc7f82b741d2561cb Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 4 Jan 2016 05:32:14 +0100 Subject: [PATCH 53/99] docs: add D-Link DIR-505 (A1) and Buffalo WZR-HP-G300NH (and remove WZR-HP-G300N, it is not actually supported) --- docs/index.rst | 5 +++-- docs/releases/v2016.1.rst | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index c03ad749..4066eef9 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -81,13 +81,14 @@ ar71xx-generic * Buffalo - WZR-HP-AG300H / WZR-600DHP - - WZR-HP-G300N + - WZR-HP-G300NH - WZR-HP-G450H * D-Link - - DIR-825 (B1) + - DIR-505 (A1) - DIR-615 (C1) + - DIR-825 (B1) * GL-Inet diff --git a/docs/releases/v2016.1.rst b/docs/releases/v2016.1.rst index f708492a..029c4e63 100644 --- a/docs/releases/v2016.1.rst +++ b/docs/releases/v2016.1.rst @@ -9,7 +9,11 @@ ar71xx-generic * Buffalo - - WZR-HP-G300N + - WZR-HP-G300NH + +* D-Link + + - DIR-505 (A1) * TP-Link From 0bd0df6f9303e5d553790ff49dc703b957fdac1d Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 4 Jan 2016 10:26:40 +0100 Subject: [PATCH 54/99] kernel: fs, seq_file: fallback to vmalloc instead of oom kill processes Fixes #177 --- ...malloc-instead-of-oom-kill-processes.patch | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 patches/openwrt/0047-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch diff --git a/patches/openwrt/0047-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch b/patches/openwrt/0047-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch new file mode 100644 index 00000000..72ad4f7d --- /dev/null +++ b/patches/openwrt/0047-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch @@ -0,0 +1,63 @@ +From: Matthias Schiffer +Date: Mon, 4 Jan 2016 10:22:52 +0100 +Subject: kernel: fs, seq_file: fallback to vmalloc instead of oom kill processes + +diff --git a/target/linux/generic/patches-3.18/089-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-.patch b/target/linux/generic/patches-3.18/089-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-.patch +new file mode 100644 +index 0000000..cad56f4 +--- /dev/null ++++ b/target/linux/generic/patches-3.18/089-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-.patch +@@ -0,0 +1,53 @@ ++From 5cec38ac866bfb8775638e71a86e4d8cac30caae Mon Sep 17 00:00:00 2001 ++Message-Id: <5cec38ac866bfb8775638e71a86e4d8cac30caae.1451899087.git.mschiffer@universe-factory.net> ++From: David Rientjes ++Date: Fri, 12 Dec 2014 16:56:16 -0800 ++Subject: [PATCH] fs, seq_file: fallback to vmalloc instead of oom kill ++ processes ++ ++Since commit 058504edd026 ("fs/seq_file: fallback to vmalloc allocation"), ++seq_buf_alloc() falls back to vmalloc() when the kmalloc() for contiguous ++memory fails. This was done to address order-4 slab allocations for ++reading /proc/stat on large machines and noticed because ++PAGE_ALLOC_COSTLY_ORDER < 4, so there is no infinite loop in the page ++allocator when allocating new slab for such high-order allocations. ++ ++Contiguous memory isn't necessary for caller of seq_buf_alloc(), however. ++Other GFP_KERNEL high-order allocations that are <= ++PAGE_ALLOC_COSTLY_ORDER will simply loop forever in the page allocator and ++oom kill processes as a result. ++ ++We don't want to kill processes so that we can allocate contiguous memory ++in situations when contiguous memory isn't necessary. ++ ++This patch does the kmalloc() allocation with __GFP_NORETRY for high-order ++allocations. This still utilizes memory compaction and direct reclaim in ++the allocation path, the only difference is that it will fail immediately ++instead of oom kill processes when out of memory. ++ ++[akpm@linux-foundation.org: add comment] ++Signed-off-by: David Rientjes ++Cc: Heiko Carstens ++Cc: Christoph Hellwig ++Cc: Al Viro ++Signed-off-by: Andrew Morton ++Signed-off-by: Linus Torvalds ++--- ++ fs/seq_file.c | 6 +++++- ++ 1 file changed, 5 insertions(+), 1 deletion(-) ++ ++--- a/fs/seq_file.c +++++ b/fs/seq_file.c ++@@ -36,7 +36,11 @@ static void *seq_buf_alloc(unsigned long ++ { ++ void *buf; ++ ++- buf = kmalloc(size, GFP_KERNEL | __GFP_NOWARN); +++ /* +++ * __GFP_NORETRY to avoid oom-killings with high-order allocations - +++ * it's better to fall back to vmalloc() than to kill things. +++ */ +++ buf = kmalloc(size, GFP_KERNEL | __GFP_NORETRY | __GFP_NOWARN); ++ if (!buf && size > PAGE_SIZE) ++ buf = vmalloc(size); ++ return buf; From bbdc334b433d96e928a0ae968911e299bad1bb1d Mon Sep 17 00:00:00 2001 From: Delta / Stefan Date: Thu, 7 Jan 2016 17:47:53 +0100 Subject: [PATCH 55/99] gluon-status-page: add TB to list of units for transfer volumes Fixes #614 --- package/gluon-status-page/src/js/lib/gui/statistics.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/gluon-status-page/src/js/lib/gui/statistics.js b/package/gluon-status-page/src/js/lib/gui/statistics.js index 49778dac..7f09323c 100644 --- a/package/gluon-status-page/src/js/lib/gui/statistics.js +++ b/package/gluon-status-page/src/js/lib/gui/statistics.js @@ -192,7 +192,7 @@ define(["lib/helper"], function (Helper) { } function prettyBytes(d) { - return prettyPrefix([ "B", "kB", "MB", "GB" ], 1024, d) + return prettyPrefix([ "B", "kB", "MB", "GB", "TB" ], 1024, d) } function prettyUptime(seconds) { From c69587fba488b2323b8ff4336259bbf9f8fd10a1 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 8 Jan 2016 11:04:31 +0100 Subject: [PATCH 56/99] build: disable generation of ramdisk images Our build process works similarly to the image builder and doesn't support the generation of initramfs-based images. Fixes #616 --- include/config | 1 + 1 file changed, 1 insertion(+) diff --git a/include/config b/include/config index 8476ec64..aa949adf 100644 --- a/include/config +++ b/include/config @@ -1,5 +1,6 @@ CONFIG_IMAGEOPT=y # CONFIG_PER_FEED_REPO is not set +# CONFIG_TARGET_ROOTFS_INITRAMFS is not set CONFIG_DEVEL=y CONFIG_ALL_KMODS=y From 0880159eb5bc279421ebceeb63f3e81b55820c5f Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 8 Jan 2016 14:54:30 +0100 Subject: [PATCH 57/99] gluon-status-page: fix handling of interface names containing dots --- .../gluon-status-page/src/js/lib/gui/neighbours.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/package/gluon-status-page/src/js/lib/gui/neighbours.js b/package/gluon-status-page/src/js/lib/gui/neighbours.js index 3c2aaca7..396c56fe 100644 --- a/package/gluon-status-page/src/js/lib/gui/neighbours.js +++ b/package/gluon-status-page/src/js/lib/gui/neighbours.js @@ -225,6 +225,12 @@ function (Helper, SignalGraph, Signal) { return !(a < b || a > b) } + function getter(k) { + return function(obj) { + return obj[k] + } + } + return function (nodeInfo, stream, mgmtBus) { var stopStream, div @@ -252,9 +258,10 @@ function (Helper, SignalGraph, Signal) { remove.forEach(function (d) { div.removeChild(d) }) - for (var k in d) + for (var k in d) { if (!(k in have)) - new Interface(div, nodeInfo, k, stream.map("." + k), mgmtBus) + new Interface(div, nodeInfo, k, stream.map(getter(k)), mgmtBus) + } } } From 65c0e256abf550e47a090569abafac1ac685e5a8 Mon Sep 17 00:00:00 2001 From: Matthias Kolja Miehl Date: Sat, 9 Jan 2016 21:17:53 +0000 Subject: [PATCH 58/99] readme: fix typo, improve formatting --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 87750136..4bda1a17 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ Documentation (incomplete at this time, contribute if you can!) may be found at -http://gluon.readthedocs.org/ +http://gluon.readthedocs.org/. If you're new to Gluon and ready to get your feet wet, have a look at the [Getting Started Guide](http://gluon.readthedocs.org/en/latest/user/getting_started.html). @@ -8,13 +8,13 @@ If you're new to Gluon and ready to get your feet wet, have a look at the ## Issues & Feature requests -Before opening an issue make sure to read check whether any existing issues +Before opening an issue, make sure to check whether any existing issues (open or closed) match. If you're suggesting a new feature, drop by on IRC or our mailinglist to discuss it first. ## Use a release! -Please refrain from using the master branch for anything else but development purposes! +Please refrain from using the `master` branch for anything else but development purposes! Use the most recent release instead. You can list all relaseses by running `git branch -a` and switch to one by running `git checkout v2015.1 && make update`. From e012e67bf165861a8857cd143cfd3de7b7156ba7 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 12 Jan 2016 16:01:58 +0100 Subject: [PATCH 59/99] Update Gluon packages --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index bd95c865..38a30cb6 100644 --- a/modules +++ b/modules @@ -8,7 +8,7 @@ PACKAGES_OPENWRT_COMMIT=f8a70fc188673d0ae8739b0a3095f7f61335fc10 PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git -PACKAGES_GLUON_COMMIT=26203eae4d7b7d7e5e37d4232a838648d744800d +PACKAGES_GLUON_COMMIT=2fc02029b96876a8a28ae1061e0dcc427c7e9b26 PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_COMMIT=ae65d4fe027592652376f8dbd3ff2ef37f5a84bc From 4ce85afc22a2c64e5ac5ea1b52ad93f323e384d4 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Fri, 11 Dec 2015 02:53:09 +0100 Subject: [PATCH 60/99] gluon-status-page-api: support batadv-in-VLAN on ibss interface introduce function to recurse down to the lowest layer-2 interface corresponding to a given interface. also re-introduce some of the previously removed input validation plus some more to protect against glob and path based exploits. --- package/gluon-status-page-api/src/stations.c | 65 +++++++++++++++++++- 1 file changed, 63 insertions(+), 2 deletions(-) diff --git a/package/gluon-status-page-api/src/stations.c b/package/gluon-status-page-api/src/stations.c index 13288827..24775a07 100644 --- a/package/gluon-status-page-api/src/stations.c +++ b/package/gluon-status-page-api/src/stations.c @@ -4,7 +4,12 @@ #include #include #include +#include +#include +#define NETIF_PREFIX "/sys/class/net/" +#define VIRTIF_PREFIX "/sys/devices/virtual/net/" +#define LOWERGLOB_SUFFIX "/lower_*" static struct json_object *get_stations(const struct iwinfo_ops *iw, const char *ifname) { int len; @@ -40,12 +45,68 @@ static void badrequest() { exit(1); } +// recurse down to the lowest layer-2 interface +static int interface_get_lowest(const char *ifname, char *hwifname); +static int interface_get_lowest(const char *ifname, char *hwifname) { + glob_t globbuf; + char *fnamebuf = alloca(1 + strlen(VIRTIF_PREFIX) + IF_NAMESIZE + + strlen(LOWERGLOB_SUFFIX)); + char *lowentry = NULL; + + + sprintf(fnamebuf, "%s%s%s", VIRTIF_PREFIX, ifname, LOWERGLOB_SUFFIX); + glob(fnamebuf, GLOB_NOSORT | GLOB_NOESCAPE, NULL, &globbuf); + + if (globbuf.gl_pathc == 1) { + lowentry = alloca(1 + strlen(globbuf.gl_pathv[0])); + strncpy(lowentry, globbuf.gl_pathv[0], 1 + strlen(globbuf.gl_pathv[0])); + } + + globfree(&globbuf); + + if (!lowentry) { + char *path = alloca(1 + strlen(NETIF_PREFIX) + strlen(ifname)); + sprintf(path, "%s%s", NETIF_PREFIX, ifname); + + if(access(path, F_OK) != 0) + return false; + + strncpy(hwifname, ifname, IF_NAMESIZE - 1); + return true; + } else { + char buf[PATH_MAX]; + ssize_t len; + + if ((len = readlink(lowentry, buf, sizeof(buf)-1)) != -1) + buf[len] = '\0'; + else + return false; + + if (strncmp(buf, "../", 3) == 0) { + return interface_get_lowest(strrchr(buf, '/') + 1, hwifname); + } else { + return false; + } + } +} + int main(int argc, char *argv[]) { if (argc != 2) badrequest(); const char *ifname = argv[1]; - const struct iwinfo_ops *iw = iwinfo_backend(ifname); + char hwifname[IF_NAMESIZE] = ""; + + if (strlen(ifname) >= IF_NAMESIZE) + badrequest(); + + if (strcspn(ifname, "/\\[]{}*?") != strlen(ifname)) + badrequest(); + + if (!interface_get_lowest(ifname, hwifname)) + badrequest(); + + const struct iwinfo_ops *iw = iwinfo_backend(hwifname); if (iw == NULL) badrequest(); @@ -54,7 +115,7 @@ int main(int argc, char *argv[]) { while (true) { struct json_object *obj; - obj = get_stations(iw, ifname); + obj = get_stations(iw, hwifname); printf("data: %s\n\n", json_object_to_json_string_ext(obj, JSON_C_TO_STRING_PLAIN)); fflush(stdout); json_object_put(obj); From d10a7b9c72c5a66da4019e7e40eb7b8acb4f507a Mon Sep 17 00:00:00 2001 From: Andreas Ziegler Date: Thu, 14 Jan 2016 02:46:29 +0100 Subject: [PATCH 61/99] docs: Update autoupdater.rst fix typo and express sentence regarding update priority clearer --- docs/features/autoupdater.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/features/autoupdater.rst b/docs/features/autoupdater.rst index 8f35efb8..873f6097 100644 --- a/docs/features/autoupdater.rst +++ b/docs/features/autoupdater.rst @@ -15,8 +15,8 @@ ecdsautils) can by found in the `contrib` directory. When creating the manifest, be set on the command line, or it can be taken from the ``site.mk``. The priority defines the maximum number of days that may pass between releasing an update and installation -of the images. The update probability with start at 0 after the release time mentioned in the manifest -and then slowly rise to 1 after the number of days given by the priority has passed. +of the images. The update probability will start at 0 after the release time mentioned in the manifest +and then slowly rise to 1 up to the point when the number of days given by the priority has passed. The priority may be an integer or a decimal fraction. @@ -59,7 +59,7 @@ The server must be available via IPv6. Command Line ------------ -These commands can be used on a node. +These commands can be used on a node: :: From 472a1ff3eb6a6189fe70fcfdf566ede0309413eb Mon Sep 17 00:00:00 2001 From: Neal Oakey Date: Sun, 17 Jan 2016 16:33:49 +0100 Subject: [PATCH 62/99] add support for ubiquiti airRouter --- docs/index.rst | 1 + docs/releases/v2016.1.rst | 1 + targets/ar71xx-generic/profiles.mk | 1 + 3 files changed, 3 insertions(+) diff --git a/docs/index.rst b/docs/index.rst index 4066eef9..2c6cb4c1 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -141,6 +141,7 @@ ar71xx-generic * Ubiquiti - Air Gateway + - Air Router - Bullet M - Nanostation M - Nanostation M XW diff --git a/docs/releases/v2016.1.rst b/docs/releases/v2016.1.rst index 029c4e63..3002d3c1 100644 --- a/docs/releases/v2016.1.rst +++ b/docs/releases/v2016.1.rst @@ -29,6 +29,7 @@ ar71xx-generic * Ubiquiti - airGateway + - airRouter * Western Digital diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 7c8cfeb8..d846ce0c 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -146,6 +146,7 @@ endif ## Ubiquiti (everything) $(eval $(call GluonProfile,UBNT)) $(eval $(call GluonModel,UBNT,ubnt-air-gateway,ubiquiti-airgateway)) +$(eval $(call GluonModel,UBNT,ubnt-airrouter,ubiquiti-airrouter)) $(eval $(call GluonModel,UBNT,ubnt-bullet-m,ubiquiti-bullet-m)) $(eval $(call GluonModelAlias,UBNT,ubiquiti-bullet-m,ubiquiti-loco-m)) From 7c67ff0cf1b3bdaf06c3947c17802be5a91feeb7 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 17 Jan 2016 23:16:00 +0100 Subject: [PATCH 63/99] ath9k: fix HSR tuner support for UniFi Outdoor Plus Also remove the BROKEN check as the UniFi Outdoor Plus support seems to work fine now. Fixes #272 --- ...d-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch | 13 +++---------- targets/ar71xx-generic/profiles.mk | 3 ++- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/patches/openwrt/0024-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch b/patches/openwrt/0024-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch index 98a85aaf..3b74d88d 100644 --- a/patches/openwrt/0024-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch +++ b/patches/openwrt/0024-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch @@ -6,10 +6,10 @@ Patch-by: Stefan Rompf diff --git a/package/kernel/mac80211/patches/931-ubnt-uap-plus-hsr.patch b/package/kernel/mac80211/patches/931-ubnt-uap-plus-hsr.patch new file mode 100644 -index 0000000..4cd6faf +index 0000000..4533335 --- /dev/null +++ b/package/kernel/mac80211/patches/931-ubnt-uap-plus-hsr.patch -@@ -0,0 +1,353 @@ +@@ -0,0 +1,346 @@ +--- a/drivers/net/wireless/ath/ath9k/channel.c ++++ b/drivers/net/wireless/ath/ath9k/channel.c +@@ -15,6 +15,8 @@ @@ -266,7 +266,7 @@ index 0000000..4cd6faf ++ +--- /dev/null ++++ b/drivers/net/wireless/ath/ath9k/hsr.h -+@@ -0,0 +1,40 @@ ++@@ -0,0 +1,33 @@ ++/* ++ * The MIT License (MIT) ++ * @@ -294,17 +294,10 @@ index 0000000..4cd6faf ++#ifndef HSR_H_ ++#define HSR_H_ ++ -++#ifdef CPTCFG_ATH9K_UBNTHSR ++void hsr_init(struct ath_hw* ah); ++int hsr_disable(struct ath_hw* ah); ++int hsr_enable(struct ath_hw* ah, int bw, int fq); ++int hsr_status(struct ath_hw* ah); -++#else -++static inline void hsr_init(struct ath_hw* ah) {} -++static inline int hsr_disable(struct ath_hw* ah) { return 0; } -++static inline int hsr_enable(struct ath_hw* ah, int bw, int fq) { return 0; } -++static inline int hsr_status(struct ath_hw* ah) { return 0; } -++#endif ++ ++#endif /* HSR_H_ */ +--- a/drivers/net/wireless/ath/ath9k/main.c diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index d846ce0c..23eefdd1 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -159,9 +159,10 @@ $(eval $(call GluonModel,UBNT,ubnt-nano-m-xw,ubiquiti-nanostation-m-xw)) $(eval $(call GluonModel,UBNT,ubnt-uap-pro,ubiquiti-unifi-ap-pro)) $(eval $(call GluonModel,UBNT,ubnt-unifi,ubiquiti-unifi)) $(eval $(call GluonModel,UBNT,ubnt-unifi-outdoor,ubiquiti-unifiap-outdoor)) +$(eval $(call GluonModel,UBNT,ubnt-unifi-outdoor-plus,ubiquiti-unifiap-outdoor+)) + ifeq ($(BROKEN),1) $(eval $(call GluonModel,UBNT,ubnt-ls-sr71,ubiquiti-ls-sr71)) # BROKEN: Untested -$(eval $(call GluonModel,UBNT,ubnt-unifi-outdoor-plus,ubiquiti-unifiap-outdoor+)) # BROKEN: WLAN doesn't work correctly (high packet loss) endif From 4ed5b856688d4e13abb1ae84b01ab5cce991ef06 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 17 Jan 2016 23:23:42 +0100 Subject: [PATCH 64/99] docs: add UniFi AP Outdoor+ to list of supported devices --- docs/index.rst | 1 + docs/releases/v2016.1.rst | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/index.rst b/docs/index.rst index 2c6cb4c1..b391b847 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -151,6 +151,7 @@ ar71xx-generic - UniFi AP - UniFi AP Pro - UniFi AP Outdoor + - UniFi AP Outdoor+ * Western Digital diff --git a/docs/releases/v2016.1.rst b/docs/releases/v2016.1.rst index 3002d3c1..6060ab6b 100644 --- a/docs/releases/v2016.1.rst +++ b/docs/releases/v2016.1.rst @@ -30,6 +30,7 @@ ar71xx-generic - airGateway - airRouter + - UniFi AP Outdoor+ * Western Digital From 2223ccd94c7d1fa3e563d2c68fc116d8fca4a663 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 24 Jan 2016 19:35:09 +0100 Subject: [PATCH 65/99] Update gluon packages --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 38a30cb6..6c9a9f62 100644 --- a/modules +++ b/modules @@ -8,7 +8,7 @@ PACKAGES_OPENWRT_COMMIT=f8a70fc188673d0ae8739b0a3095f7f61335fc10 PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git -PACKAGES_GLUON_COMMIT=2fc02029b96876a8a28ae1061e0dcc427c7e9b26 +PACKAGES_GLUON_COMMIT=bdb56bba02168a7fdd7c8bbf380ae59a4febac7c PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_COMMIT=ae65d4fe027592652376f8dbd3ff2ef37f5a84bc From 35ed4d2b765f8fe49fc4887b04e6bc041cd7b6df Mon Sep 17 00:00:00 2001 From: Ranlvor Date: Fri, 29 Jan 2016 00:07:54 +0100 Subject: [PATCH 66/99] Added Support for TP-Link WR843ND Tests done to verify that this worked as intended: * checked plattform_info image_name * checked primary_mac * does appear in ffmap-d3 * does mesh * does fastd-VPN --- targets/ar71xx-generic/profiles.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 23eefdd1..7a17e33b 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -66,6 +66,10 @@ $(eval $(call GluonProfile,TLWR842)) $(eval $(call GluonModel,TLWR842,tl-wr842n-v1,tp-link-tl-wr842n-nd-v1)) $(eval $(call GluonModel,TLWR842,tl-wr842n-v2,tp-link-tl-wr842n-nd-v2)) +# TL-WR843N/ND v1 +$(eval $(call GluonProfile,TLWR843)) +$(eval $(call GluonModel,TLWR843,tl-wr843nd-v1,tp-link-tl-wr843n-nd-v1)) + # TL-WR941N/ND v2, v3, v4, v5, v6; TL-WR940N/ND v1, v2, v3 $(eval $(call GluonProfile,TLWR941)) $(eval $(call GluonModel,TLWR941,tl-wr941nd-v2,tp-link-tl-wr941n-nd-v2)) From 54ed2a8d1407655f3ddeac5e0dd6c9e8b4d402fd Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 30 Jan 2016 02:01:21 +0100 Subject: [PATCH 67/99] docs: add TP-Link TL-WR843N/ND --- docs/index.rst | 1 + docs/releases/v2016.1.rst | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/index.rst b/docs/index.rst index b391b847..7b4d56e7 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -133,6 +133,7 @@ ar71xx-generic - TL-WR801N/ND (v1, v2) - TL-WR841N/ND (v3, v5, v7, v8, v9, v10) - TL-WR842N/ND (v1, v2) + - TL-WR843N/ND (v1) - TL-WR940N (v1, v2, v3) - TL-WR941ND (v2, v3, v4, v5, v6) - TL-WR1043N/ND (v1, v2, v3) diff --git a/docs/releases/v2016.1.rst b/docs/releases/v2016.1.rst index 6060ab6b..0a67746d 100644 --- a/docs/releases/v2016.1.rst +++ b/docs/releases/v2016.1.rst @@ -22,6 +22,7 @@ ar71xx-generic - TL-WR710N v2 - TL-WR801N/ND v1, v2 - TL-WR841N/ND v10 + - TL-WR843N/ND v1 - TL-WR940N v1, v2, v3 - TL-WR941ND v6 - TL-WR1043N/ND v3 From 840d07dd4858b2e15bf2898e4c90c778dcf3e61d Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 2 Feb 2016 06:38:03 +0100 Subject: [PATCH 68/99] Add utility library libgluonutil --- package/libgluonutil/Makefile | 35 +++++++ package/libgluonutil/src/CMakeLists.txt | 24 +++++ package/libgluonutil/src/FindJSON_C.cmake | 20 ++++ package/libgluonutil/src/libgluonutil.c | 114 ++++++++++++++++++++++ package/libgluonutil/src/libgluonutil.h | 40 ++++++++ 5 files changed, 233 insertions(+) create mode 100644 package/libgluonutil/Makefile create mode 100644 package/libgluonutil/src/CMakeLists.txt create mode 100644 package/libgluonutil/src/FindJSON_C.cmake create mode 100644 package/libgluonutil/src/libgluonutil.c create mode 100644 package/libgluonutil/src/libgluonutil.h diff --git a/package/libgluonutil/Makefile b/package/libgluonutil/Makefile new file mode 100644 index 00000000..762c25f4 --- /dev/null +++ b/package/libgluonutil/Makefile @@ -0,0 +1,35 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=libgluonutil +PKG_VERSION:=1 +CMAKE_INSTALL:=1 + +PKG_LICENSE:=BSD-2-Clause + +PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/libgluonutil + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Gluon utility library + DEPENDS:=+libjson-c +endef + +CMAKE_OPTIONS += \ + -DCMAKE_BUILD_TYPE:String="MINSIZEREL" + + +define Build/Prepare + mkdir -p $(PKG_BUILD_DIR) + $(CP) ./src/* $(PKG_BUILD_DIR)/ +endef + +define Package/libgluonutil/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libgluonutil.so $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libgluonutil)) diff --git a/package/libgluonutil/src/CMakeLists.txt b/package/libgluonutil/src/CMakeLists.txt new file mode 100644 index 00000000..ba92a3e1 --- /dev/null +++ b/package/libgluonutil/src/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 2.6) + +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) + +project(libgluonutil C) + +set(LIBDIR "lib${LIB_SUFFIX}") + +find_package(JSON_C REQUIRED) + +set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS _GNU_SOURCE) + +add_library(gluonutil SHARED libgluonutil.c) +set_property(TARGET gluonutil PROPERTY COMPILE_FLAGS "-Wall -std=c99 ${JSON_C_CFLAGS_OTHER}") +set_property(TARGET gluonutil PROPERTY LINK_FLAGS "${JSON_C_LDFLAGS_OTHER}") +set_property(TARGET gluonutil APPEND PROPERTY INCLUDE_DIRECTORIES ${JSON_C_INCLUDE_DIR}) +target_link_libraries(gluonutil ${JSON_C_LIBRARIES}) +install(TARGETS gluonutil + ARCHIVE DESTINATION ${LIBDIR} + LIBRARY DESTINATION ${LIBDIR} +) + + +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/libgluonutil.h DESTINATION include) diff --git a/package/libgluonutil/src/FindJSON_C.cmake b/package/libgluonutil/src/FindJSON_C.cmake new file mode 100644 index 00000000..f6abee65 --- /dev/null +++ b/package/libgluonutil/src/FindJSON_C.cmake @@ -0,0 +1,20 @@ +# Defines the following variables: +# JSON_C_FOUND +# JSON_C_INCLUDE_DIR +# JSON_C_LIBRARIES +# JSON_C_CFLAGS_OTHER +# JSON_C_LDFLAGS_OTHER + + +find_package(PkgConfig REQUIRED QUIET) + +pkg_check_modules(_JSON_C json-c) + +find_path(JSON_C_INCLUDE_DIR NAMES json-c/json.h HINTS ${_JSON_C_INCLUDE_DIRS}) +find_library(JSON_C_LIBRARIES NAMES json-c HINTS ${_JSON_C_LIBRARY_DIRS}) + +set(JSON_C_CFLAGS_OTHER "${_JSON_C_CFLAGS_OTHER}" CACHE STRING "Additional compiler flags for json-c") +set(JSON_C_LDFLAGS_OTHER "${_JSON_C_LDFLAGS_OTHER}" CACHE STRING "Additional linker flags for json-c") + +find_package_handle_standard_args(JSON_C REQUIRED_VARS JSON_C_LIBRARIES JSON_C_INCLUDE_DIR) +mark_as_advanced(JSON_C_INCLUDE_DIR JSON_C_LIBRARIES JSON_C_CFLAGS_OTHER JSON_C_LDFLAGS_OTHER) diff --git a/package/libgluonutil/src/libgluonutil.c b/package/libgluonutil/src/libgluonutil.c new file mode 100644 index 00000000..5932c544 --- /dev/null +++ b/package/libgluonutil/src/libgluonutil.c @@ -0,0 +1,114 @@ +/* + Copyright (c) 2016, Matthias Schiffer + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + +#include "libgluonutil.h" + +#include + +#include +#include +#include + + +char * gluonutil_read_line(const char *filename) { + FILE *f = fopen(filename, "r"); + if (!f) + return NULL; + + char *line = NULL; + size_t len = 0; + + ssize_t r = getline(&line, &len, f); + + fclose(f); + + if (r >= 0) { + len = strlen(line); + + if (len && line[len-1] == '\n') + line[len-1] = 0; + } + else { + free(line); + line = NULL; + } + + return line; +} + +char * gluonutil_get_sysconfig(const char *key) { + if (strchr(key, '/')) + return NULL; + + const char prefix[] = "/lib/gluon/core/sysconfig/"; + char path[strlen(prefix) + strlen(key) + 1]; + snprintf(path, sizeof(path), "%s%s", prefix, key); + + return gluonutil_read_line(path); +} + +char * gluonutil_get_node_id(void) { + char *node_id = gluonutil_get_sysconfig("primary_mac"); + if (!node_id) + return NULL; + + char *in = node_id, *out = node_id; + + do { + if (*in != ':') + *out++ = *in; + } while (*in++); + + return node_id; +} + +char * gluonutil_get_interface_address(const char *ifname) { + const char *format = "/sys/class/net/%s/address"; + char path[strlen(format) + strlen(ifname) - 1]; + + snprintf(path, sizeof(path), format, ifname); + + return gluonutil_read_line(path); +} + + + +struct json_object * gluonutil_wrap_string(const char *str) { + if (!str) + return NULL; + + return json_object_new_string(str); +} + +struct json_object * gluonutil_wrap_and_free_string(char *str) { + struct json_object *ret = gluonutil_wrap_string(str); + free(str); + return ret; +} + +struct json_object * gluonutil_load_site_config(void) { + return json_object_from_file("/lib/gluon/site.json"); +} diff --git a/package/libgluonutil/src/libgluonutil.h b/package/libgluonutil/src/libgluonutil.h new file mode 100644 index 00000000..96195281 --- /dev/null +++ b/package/libgluonutil/src/libgluonutil.h @@ -0,0 +1,40 @@ +/* + Copyright (c) 2016, Matthias Schiffer + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + +#ifndef _LIBGLUON_LIBGLUON_H_ +#define _LIBGLUON_LIBGLUON_H_ + +char * gluonutil_read_line(const char *filename); +char * gluonutil_get_sysconfig(const char *key); +char * gluonutil_get_node_id(void); +char * gluonutil_get_interface_address(const char *ifname); + +struct json_object * gluonutil_wrap_string(const char *str); +struct json_object * gluonutil_wrap_and_free_string(char *str); + +struct json_object * gluonutil_load_site_config(void); + +#endif /* _LIBGLUON_LIBGLUON_H_ */ From 9004028cb47d360360c9fdcc2fea52822998a75f Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 2 Feb 2016 06:38:03 +0100 Subject: [PATCH 69/99] Convert gluon-announce Lua code to C modules, rename to gluon-respondd gluon-announced and gluon-announce are merged to gluon-respondd. --- modules | 2 +- package/gluon-alfred/Makefile | 2 +- package/gluon-announce/Makefile | 32 - .../files/lib/gluon/announce/neighbours.cache | 1 - .../lib/gluon/announce/neighbours.d/node_id | 1 - .../files/lib/gluon/announce/nodeinfo.cache | 1 - .../gluon/announce/nodeinfo.d/hardware/model | 1 - .../gluon/announce/nodeinfo.d/hardware/nproc | 14 - .../lib/gluon/announce/nodeinfo.d/hostname | 1 - .../lib/gluon/announce/nodeinfo.d/network/mac | 1 - .../lib/gluon/announce/nodeinfo.d/node_id | 1 - .../announce/nodeinfo.d/software/firmware | 4 - .../announce/nodeinfo.d/system/site_code | 1 - .../files/lib/gluon/announce/statistics.cache | 1 - .../lib/gluon/announce/statistics.d/idletime | 1 - .../lib/gluon/announce/statistics.d/loadavg | 1 - .../lib/gluon/announce/statistics.d/memory | 13 - .../lib/gluon/announce/statistics.d/node_id | 1 - .../lib/gluon/announce/statistics.d/processes | 3 - .../gluon/announce/statistics.d/rootfs_usage | 4 - .../lib/gluon/announce/statistics.d/uptime | 1 - .../files/usr/lib/lua/gluon/announce.lua | 68 -- package/gluon-announced/Makefile | 32 - .../files/usr/lib/lua/gluon/announced.lua | 71 -- package/gluon-autoupdater/Makefile | 13 +- .../announce/nodeinfo.d/software/autoupdater | 7 - package/gluon-autoupdater/src/Makefile | 6 + package/gluon-autoupdater/src/respondd.c | 79 +++ package/gluon-core/Makefile | 2 +- .../nodeinfo.d/software/batman-adv/compat | 1 - .../lib/gluon/mesh-batman-adv-core/compat | 1 + .../nodeinfo.d/software/batman-adv/compat | 1 - .../lib/gluon/mesh-batman-adv-core/compat | 1 + package/gluon-mesh-batman-adv-core/Makefile | 13 +- .../lib/gluon/announce/neighbours.d/batadv | 39 -- .../lib/gluon/announce/neighbours.d/wifi | 40 -- .../announce/nodeinfo.d/network/addresses | 15 - .../nodeinfo.d/network/mesh/bat0/interfaces | 56 -- .../nodeinfo.d/network/mesh_interfaces | 13 - .../nodeinfo.d/software/batman-adv/version | 1 - .../lib/gluon/announce/statistics.d/clients | 55 -- .../lib/gluon/announce/statistics.d/gateway | 12 - .../lib/gluon/announce/statistics.d/traffic | 14 - .../gluon-mesh-batman-adv-core/src/Makefile | 6 + .../gluon-mesh-batman-adv-core/src/respondd.c | 604 ++++++++++++++++++ package/gluon-mesh-vpn-fastd/Makefile | 17 +- .../gluon/announce/nodeinfo.d/software/fastd | 5 - .../lib/gluon/announce/statistics.d/mesh_vpn | 70 -- package/gluon-mesh-vpn-fastd/src/Makefile | 6 + package/gluon-mesh-vpn-fastd/src/respondd.c | 305 +++++++++ package/gluon-node-info/Makefile | 17 +- .../lib/gluon/announce/nodeinfo.d/location | 7 - .../files/lib/gluon/announce/nodeinfo.d/owner | 4 - .../lib/gluon/announce/nodeinfo.d/system/role | 4 - package/gluon-node-info/src/Makefile | 6 + package/gluon-node-info/src/respondd.c | 144 +++++ package/gluon-respondd/Makefile | 29 + .../etc/hotplug.d/iface/10-gluon-respondd} | 9 +- .../files/lib/gluon/respondd/neighbours.cache | 1 + .../files/lib/gluon/respondd/nodeinfo.cache | 1 + .../files/lib/gluon/respondd/statistics.cache | 1 + .../lib/gluon/upgrade/400-respondd-firewall} | 8 +- package/gluon-respondd/src/Makefile | 6 + package/gluon-respondd/src/respondd.c | 209 ++++++ package/gluon-status-page-api/Makefile | 7 +- .../announce/nodeinfo.d/software/status-page | 1 - package/gluon-status-page-api/src/Makefile | 13 +- package/gluon-status-page-api/src/respondd.c | 47 ++ 68 files changed, 1502 insertions(+), 652 deletions(-) delete mode 100644 package/gluon-announce/Makefile delete mode 100644 package/gluon-announce/files/lib/gluon/announce/neighbours.cache delete mode 100644 package/gluon-announce/files/lib/gluon/announce/neighbours.d/node_id delete mode 100644 package/gluon-announce/files/lib/gluon/announce/nodeinfo.cache delete mode 100644 package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/hardware/model delete mode 100644 package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/hardware/nproc delete mode 100644 package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/hostname delete mode 100644 package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/network/mac delete mode 100644 package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/node_id delete mode 100644 package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/software/firmware delete mode 100644 package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/system/site_code delete mode 100644 package/gluon-announce/files/lib/gluon/announce/statistics.cache delete mode 100644 package/gluon-announce/files/lib/gluon/announce/statistics.d/idletime delete mode 100644 package/gluon-announce/files/lib/gluon/announce/statistics.d/loadavg delete mode 100644 package/gluon-announce/files/lib/gluon/announce/statistics.d/memory delete mode 100644 package/gluon-announce/files/lib/gluon/announce/statistics.d/node_id delete mode 100644 package/gluon-announce/files/lib/gluon/announce/statistics.d/processes delete mode 100644 package/gluon-announce/files/lib/gluon/announce/statistics.d/rootfs_usage delete mode 100644 package/gluon-announce/files/lib/gluon/announce/statistics.d/uptime delete mode 100644 package/gluon-announce/files/usr/lib/lua/gluon/announce.lua delete mode 100644 package/gluon-announced/Makefile delete mode 100644 package/gluon-announced/files/usr/lib/lua/gluon/announced.lua delete mode 100644 package/gluon-autoupdater/files/lib/gluon/announce/nodeinfo.d/software/autoupdater create mode 100644 package/gluon-autoupdater/src/Makefile create mode 100644 package/gluon-autoupdater/src/respondd.c delete mode 100644 package/gluon-mesh-batman-adv-14/files/lib/gluon/announce/nodeinfo.d/software/batman-adv/compat create mode 100644 package/gluon-mesh-batman-adv-14/files/lib/gluon/mesh-batman-adv-core/compat delete mode 100644 package/gluon-mesh-batman-adv-15/files/lib/gluon/announce/nodeinfo.d/software/batman-adv/compat create mode 100644 package/gluon-mesh-batman-adv-15/files/lib/gluon/mesh-batman-adv-core/compat delete mode 100644 package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/neighbours.d/batadv delete mode 100644 package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/neighbours.d/wifi delete mode 100644 package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/nodeinfo.d/network/addresses delete mode 100644 package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/nodeinfo.d/network/mesh/bat0/interfaces delete mode 100644 package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/nodeinfo.d/network/mesh_interfaces delete mode 100644 package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/nodeinfo.d/software/batman-adv/version delete mode 100644 package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/statistics.d/clients delete mode 100644 package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/statistics.d/gateway delete mode 100644 package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/statistics.d/traffic create mode 100644 package/gluon-mesh-batman-adv-core/src/Makefile create mode 100644 package/gluon-mesh-batman-adv-core/src/respondd.c delete mode 100644 package/gluon-mesh-vpn-fastd/files/lib/gluon/announce/nodeinfo.d/software/fastd delete mode 100644 package/gluon-mesh-vpn-fastd/files/lib/gluon/announce/statistics.d/mesh_vpn create mode 100644 package/gluon-mesh-vpn-fastd/src/Makefile create mode 100644 package/gluon-mesh-vpn-fastd/src/respondd.c delete mode 100644 package/gluon-node-info/files/lib/gluon/announce/nodeinfo.d/location delete mode 100644 package/gluon-node-info/files/lib/gluon/announce/nodeinfo.d/owner delete mode 100644 package/gluon-node-info/files/lib/gluon/announce/nodeinfo.d/system/role create mode 100644 package/gluon-node-info/src/Makefile create mode 100644 package/gluon-node-info/src/respondd.c create mode 100644 package/gluon-respondd/Makefile rename package/{gluon-announced/files/etc/hotplug.d/iface/10-gluon-announced => gluon-respondd/files/etc/hotplug.d/iface/10-gluon-respondd} (79%) create mode 100644 package/gluon-respondd/files/lib/gluon/respondd/neighbours.cache create mode 100644 package/gluon-respondd/files/lib/gluon/respondd/nodeinfo.cache create mode 100644 package/gluon-respondd/files/lib/gluon/respondd/statistics.cache rename package/{gluon-announced/files/lib/gluon/upgrade/400-announced-firewall => gluon-respondd/files/lib/gluon/upgrade/400-respondd-firewall} (54%) create mode 100644 package/gluon-respondd/src/Makefile create mode 100644 package/gluon-respondd/src/respondd.c delete mode 100644 package/gluon-status-page-api/files/lib/gluon/announce/nodeinfo.d/software/status-page create mode 100644 package/gluon-status-page-api/src/respondd.c diff --git a/modules b/modules index 6c9a9f62..ad6d44b5 100644 --- a/modules +++ b/modules @@ -8,7 +8,7 @@ PACKAGES_OPENWRT_COMMIT=f8a70fc188673d0ae8739b0a3095f7f61335fc10 PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git -PACKAGES_GLUON_COMMIT=bdb56bba02168a7fdd7c8bbf380ae59a4febac7c +PACKAGES_GLUON_COMMIT=fd06c7d67da69713f0361dadab16393c26cb609b PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_COMMIT=ae65d4fe027592652376f8dbd3ff2ef37f5a84bc diff --git a/package/gluon-alfred/Makefile b/package/gluon-alfred/Makefile index 54881c70..ca3ae327 100644 --- a/package/gluon-alfred/Makefile +++ b/package/gluon-alfred/Makefile @@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/package.mk define Package/gluon-alfred SECTION:=gluon CATEGORY:=Gluon - DEPENDS:=+gluon-core +gluon-announced +gluon-neighbour-info +micrond +alfred + DEPENDS:=+gluon-core +gluon-respondd +gluon-neighbour-info +micrond +alfred TITLE:=Configure alfred endef diff --git a/package/gluon-announce/Makefile b/package/gluon-announce/Makefile deleted file mode 100644 index d2742cf7..00000000 --- a/package/gluon-announce/Makefile +++ /dev/null @@ -1,32 +0,0 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=gluon-announce -PKG_VERSION:=1 -PKG_RELEASE:=1 - -PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) - -include $(INCLUDE_DIR)/package.mk - -define Package/gluon-announce - SECTION:=gluon - CATEGORY:=Gluon - DEPENDS:=+gluon-core +luci-lib-jsonc +lua-ethtool-stats - TITLE:=Lua scripts announcing various information -endef - -define Build/Prepare - mkdir -p $(PKG_BUILD_DIR) -endef - -define Build/Configure -endef - -define Build/Compile -endef - -define Package/gluon-announce/install - $(CP) ./files/* $(1)/ -endef - -$(eval $(call BuildPackage,gluon-announce)) diff --git a/package/gluon-announce/files/lib/gluon/announce/neighbours.cache b/package/gluon-announce/files/lib/gluon/announce/neighbours.cache deleted file mode 100644 index f599e28b..00000000 --- a/package/gluon-announce/files/lib/gluon/announce/neighbours.cache +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/package/gluon-announce/files/lib/gluon/announce/neighbours.d/node_id b/package/gluon-announce/files/lib/gluon/announce/neighbours.d/node_id deleted file mode 100644 index 66303f4c..00000000 --- a/package/gluon-announce/files/lib/gluon/announce/neighbours.d/node_id +++ /dev/null @@ -1 +0,0 @@ -return require('gluon.util').node_id() diff --git a/package/gluon-announce/files/lib/gluon/announce/nodeinfo.cache b/package/gluon-announce/files/lib/gluon/announce/nodeinfo.cache deleted file mode 100644 index 697cb3a2..00000000 --- a/package/gluon-announce/files/lib/gluon/announce/nodeinfo.cache +++ /dev/null @@ -1 +0,0 @@ -300 diff --git a/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/hardware/model b/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/hardware/model deleted file mode 100644 index aee3cd81..00000000 --- a/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/hardware/model +++ /dev/null @@ -1 +0,0 @@ -return require('platform_info').get_model() diff --git a/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/hardware/nproc b/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/hardware/nproc deleted file mode 100644 index fc94bd5b..00000000 --- a/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/hardware/nproc +++ /dev/null @@ -1,14 +0,0 @@ -local n = 0 - -local cpus = util.readline(io.open('/sys/devices/system/cpu/online')) - -for entry in cpus:gmatch('([^,]+)') do - local x, y = entry:match('(%d+)-(%d+)') - if x then - n = n + tonumber(y) - tonumber(x) + 1 - else - n = n + 1 - end -end - -return n diff --git a/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/hostname b/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/hostname deleted file mode 100644 index 7d4f0521..00000000 --- a/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/hostname +++ /dev/null @@ -1 +0,0 @@ -return uci:get_first('system', 'system', 'hostname') diff --git a/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/network/mac b/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/network/mac deleted file mode 100644 index 049eea58..00000000 --- a/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/network/mac +++ /dev/null @@ -1 +0,0 @@ -return require('gluon.sysconfig').primary_mac diff --git a/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/node_id b/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/node_id deleted file mode 100644 index 66303f4c..00000000 --- a/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/node_id +++ /dev/null @@ -1 +0,0 @@ -return require('gluon.util').node_id() diff --git a/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/software/firmware b/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/software/firmware deleted file mode 100644 index 53f6fbaf..00000000 --- a/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/software/firmware +++ /dev/null @@ -1,4 +0,0 @@ -return { - base = 'gluon-' .. util.readline(io.open('/lib/gluon/gluon-version')), - release = util.readline(io.open('/lib/gluon/release')), -} diff --git a/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/system/site_code b/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/system/site_code deleted file mode 100644 index fa7d9e80..00000000 --- a/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/system/site_code +++ /dev/null @@ -1 +0,0 @@ -return require('gluon.site_config').site_code diff --git a/package/gluon-announce/files/lib/gluon/announce/statistics.cache b/package/gluon-announce/files/lib/gluon/announce/statistics.cache deleted file mode 100644 index 7ed6ff82..00000000 --- a/package/gluon-announce/files/lib/gluon/announce/statistics.cache +++ /dev/null @@ -1 +0,0 @@ -5 diff --git a/package/gluon-announce/files/lib/gluon/announce/statistics.d/idletime b/package/gluon-announce/files/lib/gluon/announce/statistics.d/idletime deleted file mode 100644 index 61258820..00000000 --- a/package/gluon-announce/files/lib/gluon/announce/statistics.d/idletime +++ /dev/null @@ -1 +0,0 @@ -return tonumber(util.readline(io.open('/proc/uptime')):match('^[^ ]+ ([^ ]+)')) diff --git a/package/gluon-announce/files/lib/gluon/announce/statistics.d/loadavg b/package/gluon-announce/files/lib/gluon/announce/statistics.d/loadavg deleted file mode 100644 index 3548ac7a..00000000 --- a/package/gluon-announce/files/lib/gluon/announce/statistics.d/loadavg +++ /dev/null @@ -1 +0,0 @@ -return tonumber(util.readline(io.open('/proc/loadavg')):match('^([^ ]+) ')) diff --git a/package/gluon-announce/files/lib/gluon/announce/statistics.d/memory b/package/gluon-announce/files/lib/gluon/announce/statistics.d/memory deleted file mode 100644 index 2e880346..00000000 --- a/package/gluon-announce/files/lib/gluon/announce/statistics.d/memory +++ /dev/null @@ -1,13 +0,0 @@ -local data = io.open('/proc/meminfo'):read('*a') - -local fields = {} -for k, v in data:gmatch('([^\n:]+):%s*(%d+) kB') do - fields[k] = tonumber(v) -end - -return { - total = fields.MemTotal, - free = fields.MemFree, - buffers = fields.Buffers, - cached = fields.Cached, -} diff --git a/package/gluon-announce/files/lib/gluon/announce/statistics.d/node_id b/package/gluon-announce/files/lib/gluon/announce/statistics.d/node_id deleted file mode 100644 index 66303f4c..00000000 --- a/package/gluon-announce/files/lib/gluon/announce/statistics.d/node_id +++ /dev/null @@ -1 +0,0 @@ -return require('gluon.util').node_id() diff --git a/package/gluon-announce/files/lib/gluon/announce/statistics.d/processes b/package/gluon-announce/files/lib/gluon/announce/statistics.d/processes deleted file mode 100644 index 30f09790..00000000 --- a/package/gluon-announce/files/lib/gluon/announce/statistics.d/processes +++ /dev/null @@ -1,3 +0,0 @@ -local running, total = util.readline(io.open('/proc/loadavg')):match('^[^ ]+ [^ ]+ [^ ]+ (%d+)/(%d+)') - -return { running = tonumber(running), total = tonumber(total) } diff --git a/package/gluon-announce/files/lib/gluon/announce/statistics.d/rootfs_usage b/package/gluon-announce/files/lib/gluon/announce/statistics.d/rootfs_usage deleted file mode 100644 index 8426e9e1..00000000 --- a/package/gluon-announce/files/lib/gluon/announce/statistics.d/rootfs_usage +++ /dev/null @@ -1,4 +0,0 @@ -local fs = require "nixio.fs" - -local st = fs.statvfs("/") -return 1 - st.bfree / st.blocks diff --git a/package/gluon-announce/files/lib/gluon/announce/statistics.d/uptime b/package/gluon-announce/files/lib/gluon/announce/statistics.d/uptime deleted file mode 100644 index 509d1470..00000000 --- a/package/gluon-announce/files/lib/gluon/announce/statistics.d/uptime +++ /dev/null @@ -1 +0,0 @@ -return tonumber(util.readline(io.open('/proc/uptime')):match('^([^ ]+) ')) diff --git a/package/gluon-announce/files/usr/lib/lua/gluon/announce.lua b/package/gluon-announce/files/usr/lib/lua/gluon/announce.lua deleted file mode 100644 index 0e336ad5..00000000 --- a/package/gluon-announce/files/usr/lib/lua/gluon/announce.lua +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/lua - -module('gluon.announce', package.seeall) - -fs = require 'nixio.fs' -util = require 'gluon.util' -model_uci = require 'luci.model.uci' - - -local collect_dir - -local function collect_entry(entry) - if fs.stat(entry, 'type') == 'dir' then - return collect_dir(entry) - else - return loadfile(entry) - end -end - -function collect_dir(dir) - local fns = {} - - for entry in fs.dir(dir) do - if entry:sub(1, 1) ~= '.' then - collectgarbage() - local fn, err = collect_entry(dir .. '/' .. entry) - - if fn then - fns[entry] = fn - else - io.stderr:write(err, '\n') - end - end - end - - return function () - local ret = { [{}] = true } - - for k, v in pairs(fns) do - collectgarbage() - local ok, val = pcall(setfenv(v, _M)) - - if ok then - ret[k] = val - else - io.stderr:write(val, '\n') - end - end - - collectgarbage() - - return ret - end -end - -function collect(dir) - local f = collect_dir(dir) - - return function () - _M.uci = model_uci.cursor() - ret = f() - _M.uci = nil - - collectgarbage() - - return ret - end -end diff --git a/package/gluon-announced/Makefile b/package/gluon-announced/Makefile deleted file mode 100644 index d5b06dce..00000000 --- a/package/gluon-announced/Makefile +++ /dev/null @@ -1,32 +0,0 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=gluon-announced -PKG_VERSION:=2 -PKG_RELEASE:=1 - -PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) - -include $(INCLUDE_DIR)/package.mk - -define Package/gluon-announced - SECTION:=gluon - CATEGORY:=Gluon - TITLE:=Provides node information to the network - DEPENDS:=+gluon-announce +respondd +lua-deflate -endef - -define Build/Prepare - mkdir -p $(PKG_BUILD_DIR) -endef - -define Build/Configure -endef - -define Build/Compile -endef - -define Package/gluon-announced/install - $(CP) ./files/* $(1)/ -endef - -$(eval $(call BuildPackage,gluon-announced)) diff --git a/package/gluon-announced/files/usr/lib/lua/gluon/announced.lua b/package/gluon-announced/files/usr/lib/lua/gluon/announced.lua deleted file mode 100644 index 2dfe005c..00000000 --- a/package/gluon-announced/files/usr/lib/lua/gluon/announced.lua +++ /dev/null @@ -1,71 +0,0 @@ -local announce = require 'gluon.announce' -local deflate = require 'deflate' -local json = require 'luci.jsonc' -local util = require 'luci.util' -local nixio = require 'nixio' -local fs = require 'nixio.fs' - -local memoize = {} - -nixio.chdir('/lib/gluon/announce/') - -for dir in fs.glob('*.d') do - local name = dir:sub(1, -3) - memoize[name] = { - collect = announce.collect(dir), - -- tonumber will return 0 for invalid inputs - cache_time = tonumber(util.trim(fs.readfile(name .. '.cache') or '')) - } -end - -local function collect(type, timestamp) - local c = memoize[type] - if not c then - return nil - end - - if c.cache_timeout and timestamp < c.cache_timeout then - return c.cache - else - local ret = c.collect() - - if c.cache_time then - c.cache = ret - c.cache_timeout = timestamp + c.cache_time - end - - return ret - end -end - -module('gluon.announced', package.seeall) - -function handle_request(query, timestamp) - collectgarbage() - - local m = query:match('^GET ([a-z ]+)$') - local ret - if m then - local data = {} - - for q in m:gmatch('([a-z]+)') do - local ok, val = pcall(collect, q, timestamp) - if ok then - data[q] = val - end - end - - if next(data) then - ret = deflate.compress(json.stringify(data)) - end - elseif query:match('^[a-z]+$') then - local ok, data = pcall(collect, query, timestamp) - if ok then - ret = json.stringify(data) - end - end - - collectgarbage() - - return ret -end diff --git a/package/gluon-autoupdater/Makefile b/package/gluon-autoupdater/Makefile index f4885ee0..40120fa9 100644 --- a/package/gluon-autoupdater/Makefile +++ b/package/gluon-autoupdater/Makefile @@ -5,29 +5,28 @@ PKG_VERSION:=4 PKG_RELEASE:=$(GLUON_BRANCH) PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) +PKG_BUILD_DEPENDS := respondd include $(GLUONDIR)/include/package.mk define Package/gluon-autoupdater SECTION:=gluon CATEGORY:=Gluon - DEPENDS:=+gluon-core +micrond +autoupdater + DEPENDS:=+gluon-core +libgluonutil +micrond +autoupdater TITLE:=Automatically update firmware endef define Build/Prepare mkdir -p $(PKG_BUILD_DIR) -endef - -define Build/Configure -endef - -define Build/Compile + $(CP) ./src/* $(PKG_BUILD_DIR)/ endef define Package/gluon-autoupdater/install $(CP) ./files/* $(1)/ + $(INSTALL_DIR) $(1)/lib/gluon/respondd + $(CP) $(PKG_BUILD_DIR)/respondd.so $(1)/lib/gluon/respondd/autoupdater.so + if [ '$(GLUON_BRANCH)' ]; then \ $(INSTALL_DIR) $(1)/lib/gluon/autoupdater; \ echo '$(GLUON_BRANCH)' > $(1)/lib/gluon/autoupdater/default_branch; \ diff --git a/package/gluon-autoupdater/files/lib/gluon/announce/nodeinfo.d/software/autoupdater b/package/gluon-autoupdater/files/lib/gluon/announce/nodeinfo.d/software/autoupdater deleted file mode 100644 index 75a67578..00000000 --- a/package/gluon-autoupdater/files/lib/gluon/announce/nodeinfo.d/software/autoupdater +++ /dev/null @@ -1,7 +0,0 @@ -local autoupdater = uci:get_all('autoupdater', 'settings') -if autoupdater then - return { - branch = autoupdater['branch'], - enabled = uci:get_bool('autoupdater', 'settings', 'enabled'), - } -end diff --git a/package/gluon-autoupdater/src/Makefile b/package/gluon-autoupdater/src/Makefile new file mode 100644 index 00000000..3ddc8a58 --- /dev/null +++ b/package/gluon-autoupdater/src/Makefile @@ -0,0 +1,6 @@ +all: respondd.so + +CFLAGS += -Wall + +respondd.so: respondd.c + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared -fPIC -D_GNU_SOURCE -o $@ $^ $(LDLIBS) -lgluonutil -luci diff --git a/package/gluon-autoupdater/src/respondd.c b/package/gluon-autoupdater/src/respondd.c new file mode 100644 index 00000000..66b7a928 --- /dev/null +++ b/package/gluon-autoupdater/src/respondd.c @@ -0,0 +1,79 @@ +/* + Copyright (c) 2016, Matthias Schiffer + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + +#include + +#include +#include + +#include + +#include + + +static struct json_object * get_autoupdater(void) { + struct uci_context *ctx = uci_alloc_context(); + ctx->flags &= ~UCI_FLAG_STRICT; + + struct uci_package *p; + if (uci_load(ctx, "autoupdater", &p)) + goto error; + + struct uci_section *s = uci_lookup_section(ctx, p, "settings"); + if (!s) + goto error; + + struct json_object *ret = json_object_new_object(); + + json_object_object_add(ret, "branch", gluonutil_wrap_string(uci_lookup_option_string(ctx, s, "branch"))); + + const char *enabled = uci_lookup_option_string(ctx, s, "enabled"); + json_object_object_add(ret, "enabled", json_object_new_boolean(enabled && !strcmp(enabled, "1"))); + + uci_free_context(ctx); + + return ret; + + error: + uci_free_context(ctx); + return NULL; +} + +static struct json_object * respondd_provider_nodeinfo(void) { + struct json_object *ret = json_object_new_object(); + + struct json_object *software = json_object_new_object(); + json_object_object_add(software, "autoupdater", get_autoupdater()); + json_object_object_add(ret, "software", software); + + return ret; +} + + +const struct respondd_provider_info respondd_providers[] = { + {"nodeinfo", respondd_provider_nodeinfo}, + {} +}; diff --git a/package/gluon-core/Makefile b/package/gluon-core/Makefile index ecd6fbe3..de54283b 100644 --- a/package/gluon-core/Makefile +++ b/package/gluon-core/Makefile @@ -12,7 +12,7 @@ define Package/gluon-core SECTION:=gluon CATEGORY:=Gluon TITLE:=Base files of Gluon - DEPENDS:=+gluon-site +lua-platform-info +luci-base +luci-lib-jsonc +odhcp6c +firewall + DEPENDS:=+gluon-site +libgluonutil +lua-platform-info +luci-base +luci-lib-jsonc +odhcp6c +firewall endef diff --git a/package/gluon-mesh-batman-adv-14/files/lib/gluon/announce/nodeinfo.d/software/batman-adv/compat b/package/gluon-mesh-batman-adv-14/files/lib/gluon/announce/nodeinfo.d/software/batman-adv/compat deleted file mode 100644 index 84137237..00000000 --- a/package/gluon-mesh-batman-adv-14/files/lib/gluon/announce/nodeinfo.d/software/batman-adv/compat +++ /dev/null @@ -1 +0,0 @@ -return 14 diff --git a/package/gluon-mesh-batman-adv-14/files/lib/gluon/mesh-batman-adv-core/compat b/package/gluon-mesh-batman-adv-14/files/lib/gluon/mesh-batman-adv-core/compat new file mode 100644 index 00000000..8351c193 --- /dev/null +++ b/package/gluon-mesh-batman-adv-14/files/lib/gluon/mesh-batman-adv-core/compat @@ -0,0 +1 @@ +14 diff --git a/package/gluon-mesh-batman-adv-15/files/lib/gluon/announce/nodeinfo.d/software/batman-adv/compat b/package/gluon-mesh-batman-adv-15/files/lib/gluon/announce/nodeinfo.d/software/batman-adv/compat deleted file mode 100644 index d44224b3..00000000 --- a/package/gluon-mesh-batman-adv-15/files/lib/gluon/announce/nodeinfo.d/software/batman-adv/compat +++ /dev/null @@ -1 +0,0 @@ -return 15 diff --git a/package/gluon-mesh-batman-adv-15/files/lib/gluon/mesh-batman-adv-core/compat b/package/gluon-mesh-batman-adv-15/files/lib/gluon/mesh-batman-adv-core/compat new file mode 100644 index 00000000..60d3b2f4 --- /dev/null +++ b/package/gluon-mesh-batman-adv-15/files/lib/gluon/mesh-batman-adv-core/compat @@ -0,0 +1 @@ +15 diff --git a/package/gluon-mesh-batman-adv-core/Makefile b/package/gluon-mesh-batman-adv-core/Makefile index cb7426f2..365ccbca 100644 --- a/package/gluon-mesh-batman-adv-core/Makefile +++ b/package/gluon-mesh-batman-adv-core/Makefile @@ -4,6 +4,7 @@ PKG_NAME:=gluon-mesh-batman-adv-core PKG_VERSION:=1 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) +PKG_BUILD_DEPENDS := respondd include $(GLUONDIR)/include/package.mk @@ -11,21 +12,19 @@ define Package/gluon-mesh-batman-adv-core SECTION:=gluon CATEGORY:=Gluon TITLE:=Support for batman-adv meshing (core) - DEPENDS:=+gluon-core +gluon-client-bridge +firewall +libiwinfo-lua +batman-adv-visdata + DEPENDS:=+gluon-core +libgluonutil +gluon-client-bridge +firewall +libiwinfo +batman-adv-visdata endef define Build/Prepare mkdir -p $(PKG_BUILD_DIR) -endef - -define Build/Configure -endef - -define Build/Compile + $(CP) ./src/* $(PKG_BUILD_DIR)/ endef define Package/gluon-mesh-batman-adv-core/install $(CP) ./files/* $(1)/ + + $(INSTALL_DIR) $(1)/lib/gluon/respondd + $(CP) $(PKG_BUILD_DIR)/respondd.so $(1)/lib/gluon/respondd/mesh-batman-adv-core.so endef define Package/gluon-mesh-batman-adv-core/postinst diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/neighbours.d/batadv b/package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/neighbours.d/batadv deleted file mode 100644 index fa953037..00000000 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/neighbours.d/batadv +++ /dev/null @@ -1,39 +0,0 @@ -local ifname_address_cache = {} - -function ifname2address(ifname) - local ifaddress - if ifname_address_cache[ifname] ~= nil then - ifaddress = ifname_address_cache[ifname] - else - ifaddress = util.readline(io.open("/sys/class/net/" .. ifname .. "/address")) - ifname_address_cache[ifname] = ifaddress - end - - return ifaddress -end - -function batadv() - local interfaces = {} - local list = io.lines("/tmp/batman-adv-visdata/bat0/originators") - for line in list do - local mac1, lastseen, tq, mac2, ifname = - line:match("^([0-9a-f:]+) +(%d+%.%d+)s +%( *(%d+)%) +([0-9a-f:]+) +%[ *(.-)%]") - - if mac1 ~= nil and mac1 == mac2 then - ifaddress = ifname2address(ifname) - if interfaces[ifaddress] == nil then - interfaces[ifaddress] = { neighbours = { [{}] = true } } - end - - interfaces[ifaddress].neighbours[mac1] = { tq = tonumber(tq) - , lastseen = tonumber(lastseen) - } - end - end - - if next(interfaces) then - return interfaces - end -end - -return batadv() diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/neighbours.d/wifi b/package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/neighbours.d/wifi deleted file mode 100644 index 4f2b0ce2..00000000 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/neighbours.d/wifi +++ /dev/null @@ -1,40 +0,0 @@ -local batman_adv = require 'gluon.batman_adv' -local iwinfo = require 'iwinfo' - -function neighbours(iface) - local stations = {} - for k, v in pairs(iface.iw.assoclist(iface.ifname)) do - stations[k:lower()] = { signal = v.signal - , noise = v.noise - , inactive = v.inactive - } - end - - if next(stations) then - return stations - end -end - -function interfaces() - local interfaces = {} - for ifname in batman_adv.interfaces('bat0') do - pcall(function() - local address = util.readline(io.open('/sys/class/net/' .. ifname .. '/address')) - local wifitype = iwinfo.type(ifname) - if wifitype ~= nil then - interfaces[address] = { ifname = ifname, iw = iwinfo[wifitype] } - end - end) - end - - return interfaces -end - -local wifi = {} -for address, iface in pairs(interfaces()) do - wifi[address] = { [{}] = true, neighbours = neighbours(iface) } -end - -if next(wifi) then - return wifi -end diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/nodeinfo.d/network/addresses b/package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/nodeinfo.d/network/addresses deleted file mode 100644 index aa513b1c..00000000 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/nodeinfo.d/network/addresses +++ /dev/null @@ -1,15 +0,0 @@ -local ip = require 'luci.ip' -local bit = require 'nixio'.bit - -local addresses = {} - -for line in io.lines('/proc/net/if_inet6') do - local matches = { line:match('^' .. string.rep('(%x%x%x%x)', 8) .. string.rep(' %x%x', 3) .. ' (%x%x)%s+([^%s]+)$') } - -- exclude wrong interfaces and deprecated as well as tentative addresses - -- (see /include/uapi/linux/if_addr.h in linux source for flags) - if matches[10] == 'br-client' and bit.band(tonumber(matches[9], 16), 0x60) == 0 then - table.insert(addresses, ip.IPv6(string.format('%s:%s:%s:%s:%s:%s:%s:%s', unpack(matches))):string():lower()) - end -end - -return addresses diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/nodeinfo.d/network/mesh/bat0/interfaces b/package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/nodeinfo.d/network/mesh/bat0/interfaces deleted file mode 100644 index 6f63af2f..00000000 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/nodeinfo.d/network/mesh/bat0/interfaces +++ /dev/null @@ -1,56 +0,0 @@ -local batman_adv = require 'gluon.batman_adv' - -local wireless = {} -local tunnel = {} -local other = {} - -local function get_address(t, ifname) - pcall( - function() - table.insert(t, util.readline(io.open('/sys/class/net/' .. ifname .. '/address'))) - end - ) -end - -local function file_exists(filename) - local f = io.open(filename) - if f == nil then - return false - else - f:close() - return true - end -end - -local function is_wireless(ifname) - return file_exists('/sys/class/net/' .. ifname .. '/wireless') -end - -local function is_tuntap(ifname) - return file_exists('/sys/class/net/' .. ifname .. '/tun_flags') -end - -local function nil_table(t) - if next(t) ~= nil then - return t - else - return nil - end -end - -for ifname in batman_adv.interfaces('bat0') do - if is_wireless(ifname) then - get_address(wireless, ifname) - elseif is_tuntap(ifname) then - get_address(tunnel, ifname) - else - get_address(other, ifname) - end -end - -return { - wireless = nil_table(wireless), - tunnel = nil_table(tunnel), - other = nil_table(other), - [{}] = true -} diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/nodeinfo.d/network/mesh_interfaces b/package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/nodeinfo.d/network/mesh_interfaces deleted file mode 100644 index 0d66d603..00000000 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/nodeinfo.d/network/mesh_interfaces +++ /dev/null @@ -1,13 +0,0 @@ -local batman_adv = require 'gluon.batman_adv' - -local interfaces = {} - -for ifname in batman_adv.interfaces('bat0') do - pcall( - function() - table.insert(interfaces, util.readline(io.open('/sys/class/net/' .. ifname .. '/address'))) - end - ) -end - -return interfaces diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/nodeinfo.d/software/batman-adv/version b/package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/nodeinfo.d/software/batman-adv/version deleted file mode 100644 index e0f556cf..00000000 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/nodeinfo.d/software/batman-adv/version +++ /dev/null @@ -1 +0,0 @@ -return util.readline(io.open('/sys/module/batman_adv/version')) diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/statistics.d/clients b/package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/statistics.d/clients deleted file mode 100644 index 8e4506e9..00000000 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/statistics.d/clients +++ /dev/null @@ -1,55 +0,0 @@ -local iwinfo = require 'iwinfo' - -local counts = { total = 0 - , wifi = 0 - , wifi24 = 0 - , wifi5 = 0 - } - -local list = io.lines("/sys/kernel/debug/batman_adv/bat0/transtable_local") -local clients = {} -for line in list do - local mac, _, flags, lastseen = line:match("^ %* ([0-9a-f:]+) *(.- )%[(.-)%] +(%d+%.%d+)") - if mac then - if not flags:match('P') then - counts.total = counts.total + 1 - clients[mac:lower()] = true - - if flags:match('W') then - counts.wifi = counts.wifi +1 - end - end - end -end - -function count_iface_stations(iface) - local wifitype = iwinfo.type(iface) - if wifitype == nil then - return - end - - local freq = iwinfo[wifitype].frequency(iface) - local key - if freq >= 2400 and freq < 2500 then - key = "wifi24" - elseif freq >= 5000 and freq < 6000 then - key = "wifi5" - else - return - end - - for k, v in pairs(iwinfo[wifitype].assoclist(iface)) do - if clients[k:lower()] then - counts[key] = counts[key] + 1 - end - end -end - -local ifaces = {} -uci:foreach("wireless", "wifi-iface", function(s) - if s.network == "client" and s.mode == "ap" then - count_iface_stations(s.ifname) - end -end) - -return counts diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/statistics.d/gateway b/package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/statistics.d/gateway deleted file mode 100644 index b1909cf6..00000000 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/statistics.d/gateway +++ /dev/null @@ -1,12 +0,0 @@ -local gateway = '' - -for line in io.lines('/sys/kernel/debug/batman_adv/bat0/gateways') do - if line:sub(1, 3) == '=> ' then - gateway = line:sub(4, 20) - break - end -end - -if gateway ~= '' then - return gateway -end diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/statistics.d/traffic b/package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/statistics.d/traffic deleted file mode 100644 index 01f6b4ab..00000000 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/statistics.d/traffic +++ /dev/null @@ -1,14 +0,0 @@ -local ethtool = require 'ethtool_stats' - -local fields = ethtool.interface_stats('bat0') - -local traffic = {} -for _, class in ipairs({'rx', 'tx', 'forward', 'mgmt_rx', 'mgmt_tx'}) do - traffic[class] = { - bytes = fields[class .. '_bytes'], - packets = fields[class], - } -end -traffic['tx']['dropped'] = fields['tx_dropped'] - -return traffic diff --git a/package/gluon-mesh-batman-adv-core/src/Makefile b/package/gluon-mesh-batman-adv-core/src/Makefile new file mode 100644 index 00000000..84d9d48e --- /dev/null +++ b/package/gluon-mesh-batman-adv-core/src/Makefile @@ -0,0 +1,6 @@ +all: respondd.so + +CFLAGS += -Wall + +respondd.so: respondd.c + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared -fPIC -D_GNU_SOURCE -o $@ $^ $(LDLIBS) -lgluonutil -liwinfo -luci diff --git a/package/gluon-mesh-batman-adv-core/src/respondd.c b/package/gluon-mesh-batman-adv-core/src/respondd.c new file mode 100644 index 00000000..cc1c59cc --- /dev/null +++ b/package/gluon-mesh-batman-adv-core/src/respondd.c @@ -0,0 +1,604 @@ +/* + Copyright (c) 2016, Matthias Schiffer + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + + + +#define _STRINGIFY(s) #s +#define STRINGIFY(s) _STRINGIFY(s) + + +static struct json_object * get_addresses(void) { + FILE *f = fopen("/proc/net/if_inet6", "r"); + if (!f) + return NULL; + + char *line = NULL; + size_t len = 0; + + struct json_object *ret = json_object_new_array(); + + while (getline(&line, &len, f) >= 0) { + /* IF_NAMESIZE would be enough, but adding 1 here is simpler than subtracting 1 in the format string */ + char ifname[IF_NAMESIZE+1]; + unsigned int flags; + struct in6_addr addr; + char buf[INET6_ADDRSTRLEN]; + + if (sscanf(line, + "%2"SCNx8"%2"SCNx8"%2"SCNx8"%2"SCNx8"%2"SCNx8"%2"SCNx8"%2"SCNx8"%2"SCNx8 + "%2"SCNx8"%2"SCNx8"%2"SCNx8"%2"SCNx8"%2"SCNx8"%2"SCNx8"%2"SCNx8"%2"SCNx8 + " %*2x %*2x %*2x %2x %"STRINGIFY(IF_NAMESIZE)"s", + &addr.s6_addr[0], &addr.s6_addr[1], &addr.s6_addr[2], &addr.s6_addr[3], + &addr.s6_addr[4], &addr.s6_addr[5], &addr.s6_addr[6], &addr.s6_addr[7], + &addr.s6_addr[8], &addr.s6_addr[9], &addr.s6_addr[10], &addr.s6_addr[11], + &addr.s6_addr[12], &addr.s6_addr[13], &addr.s6_addr[14], &addr.s6_addr[15], + &flags, ifname) != 18) + continue; + + if (strcmp(ifname, "br-client")) + continue; + + if (flags & (IFA_F_TENTATIVE|IFA_F_DEPRECATED)) + continue; + + inet_ntop(AF_INET6, &addr, buf, sizeof(buf)); + + json_object_array_add(ret, json_object_new_string(buf)); + } + + fclose(f); + free(line); + + return ret; +} + +static void add_if_not_empty(struct json_object *obj, const char *key, struct json_object *val) { + if (json_object_array_length(val)) + json_object_object_add(obj, key, val); + else + json_object_put(val); +} + +static bool interface_file_exists(const char *ifname, const char *name) { + const char *format = "/sys/class/net/%s/%s"; + char path[strlen(format) + strlen(ifname) + strlen(name)]; + snprintf(path, sizeof(path), format, ifname, name); + + return !access(path, F_OK); +} + +static void mesh_add_subif(const char *ifname, struct json_object *wireless, + struct json_object *tunnel, struct json_object *other) { + struct json_object *address = gluonutil_wrap_and_free_string(gluonutil_get_interface_address(ifname)); + + if (interface_file_exists(ifname, "wireless")) + json_object_array_add(wireless, address); + else if (interface_file_exists(ifname, "tun_flags")) + json_object_array_add(tunnel, address); + else + json_object_array_add(other, address); + +} + +static struct json_object * get_mesh_subifs(const char *ifname) { + struct json_object *wireless = json_object_new_array(); + struct json_object *tunnel = json_object_new_array(); + struct json_object *other = json_object_new_array(); + + const char *format = "/sys/class/net/%s/lower_*"; + char pattern[strlen(format) + strlen(ifname) - 1]; + snprintf(pattern, sizeof(pattern), format, ifname); + + size_t pattern_len = strlen(pattern); + + glob_t lower; + if (!glob(pattern, GLOB_NOSORT, NULL, &lower)) { + size_t i; + for (i = 0; i < lower.gl_pathc; i++) { + mesh_add_subif(lower.gl_pathv[i] + pattern_len - 1, + wireless, tunnel, other); + } + + globfree(&lower); + } + + struct json_object *ret = json_object_new_object(); + add_if_not_empty(ret, "wireless", wireless); + add_if_not_empty(ret, "tunnel", tunnel); + add_if_not_empty(ret, "other", other); + return ret; +} + +static struct json_object * get_mesh(void) { + struct json_object *ret = json_object_new_object(); + struct json_object *bat0_interfaces = json_object_new_object(); + json_object_object_add(bat0_interfaces, "interfaces", get_mesh_subifs("bat0")); + json_object_object_add(ret, "bat0", bat0_interfaces); + return ret; +} + +static struct json_object * get_batman_adv_compat(void) { + FILE *f = fopen("/lib/gluon/mesh-batman-adv-core/compat", "r"); + if (!f) + return NULL; + + struct json_object *ret = NULL; + + int compat; + if (fscanf(f, "%i", &compat) == 1) + ret = json_object_new_int(compat); + + fclose(f); + + return ret; +} + +static struct json_object * respondd_provider_nodeinfo(void) { + struct json_object *ret = json_object_new_object(); + + struct json_object *network = json_object_new_object(); + json_object_object_add(network, "addresses", get_addresses()); + json_object_object_add(network, "mesh", get_mesh()); + json_object_object_add(ret, "network", network); + + struct json_object *software = json_object_new_object(); + struct json_object *software_batman_adv = json_object_new_object(); + json_object_object_add(software_batman_adv, "version", gluonutil_wrap_and_free_string(gluonutil_read_line("/sys/module/batman_adv/version"))); + json_object_object_add(software_batman_adv, "compat", get_batman_adv_compat()); + json_object_object_add(software, "batman-adv", software_batman_adv); + json_object_object_add(ret, "software", software); + + return ret; +} + + +static void add_gateway(struct json_object *obj) { + FILE *f = fopen("/sys/kernel/debug/batman_adv/bat0/gateways", "r"); + if (!f) + return; + + char *line = NULL; + size_t len = 0; + + while (getline(&line, &len, f) >= 0) { + char addr[18]; + + if (sscanf(line, "=> %17[0-9a-fA-F:]", addr) != 1) + continue; + + json_object_object_add(obj, "gateway", json_object_new_string(addr)); + break; + } + + free(line); + fclose(f); +} + +static inline bool ethtool_ioctl(int fd, struct ifreq *ifr, void *data) { + ifr->ifr_data = data; + + return (ioctl(fd, SIOCETHTOOL, ifr) >= 0); +} + +static uint32_t ethtool_get_stats_length(int fd, struct ifreq *ifr) { + const size_t sset_info_len = sizeof(struct ethtool_sset_info) + sizeof(uint32_t); + struct ethtool_sset_info *sset_info = alloca(sset_info_len); + memset(sset_info, 0, sset_info_len); + + sset_info->cmd = ETHTOOL_GSSET_INFO; + sset_info->sset_mask = 1ull << ETH_SS_STATS; + + if (!ethtool_ioctl(fd, ifr, sset_info)) + return 0; + + return sset_info->sset_mask ? sset_info->data[0] : 0; +} + +static struct ethtool_gstrings * ethtool_get_stats_strings(int fd, struct ifreq *ifr) { + uint32_t n_stats = ethtool_get_stats_length(fd, ifr); + + if (!n_stats) + return NULL; + + struct ethtool_gstrings *strings = calloc(1, sizeof(*strings) + n_stats * ETH_GSTRING_LEN); + + strings->cmd = ETHTOOL_GSTRINGS; + strings->string_set = ETH_SS_STATS; + strings->len = n_stats; + + if (!ethtool_ioctl(fd, ifr, strings)) { + free(strings); + return NULL; + } + + return strings; +} + + +static struct json_object * get_traffic(void) { + struct ethtool_gstrings *strings = NULL; + struct ethtool_stats *stats = NULL; + + struct ifreq ifr = {}; + strncpy(ifr.ifr_name, "bat0", IF_NAMESIZE); + + struct json_object *ret = NULL; + + int fd = socket(AF_INET, SOCK_DGRAM, 0); + if (fd < 0) + return NULL; + + strings = ethtool_get_stats_strings(fd, &ifr); + if (!strings) + goto out; + + stats = calloc(1, sizeof(struct ethtool_stats) + strings->len * sizeof(uint64_t)); + stats->cmd = ETHTOOL_GSTATS; + stats->n_stats = strings->len; + + if (!ethtool_ioctl(fd, &ifr, stats)) + goto out; + + struct json_object *rx = json_object_new_object(); + struct json_object *tx = json_object_new_object(); + struct json_object *forward = json_object_new_object(); + struct json_object *mgmt_rx = json_object_new_object(); + struct json_object *mgmt_tx = json_object_new_object(); + + size_t i; + for (i = 0; i < strings->len; i++) { + if (!strncmp((const char*)&strings->data[i * ETH_GSTRING_LEN], "rx", ETH_GSTRING_LEN)) + json_object_object_add(rx, "packets", json_object_new_int64(stats->data[i])); + else if (!strncmp((const char*)&strings->data[i * ETH_GSTRING_LEN], "rx_bytes", ETH_GSTRING_LEN)) + json_object_object_add(rx, "bytes", json_object_new_int64(stats->data[i])); + else if (!strncmp((const char*)&strings->data[i * ETH_GSTRING_LEN], "tx", ETH_GSTRING_LEN)) + json_object_object_add(tx, "packets", json_object_new_int64(stats->data[i])); + else if (!strncmp((const char*)&strings->data[i * ETH_GSTRING_LEN], "tx_dropped", ETH_GSTRING_LEN)) + json_object_object_add(tx, "dropped", json_object_new_int64(stats->data[i])); + else if (!strncmp((const char*)&strings->data[i * ETH_GSTRING_LEN], "tx_bytes", ETH_GSTRING_LEN)) + json_object_object_add(tx, "bytes", json_object_new_int64(stats->data[i])); + else if (!strncmp((const char*)&strings->data[i * ETH_GSTRING_LEN], "forward", ETH_GSTRING_LEN)) + json_object_object_add(forward, "packets", json_object_new_int64(stats->data[i])); + else if (!strncmp((const char*)&strings->data[i * ETH_GSTRING_LEN], "forward_bytes", ETH_GSTRING_LEN)) + json_object_object_add(forward, "bytes", json_object_new_int64(stats->data[i])); + else if (!strncmp((const char*)&strings->data[i * ETH_GSTRING_LEN], "mgmt_rx", ETH_GSTRING_LEN)) + json_object_object_add(mgmt_rx, "packets", json_object_new_int64(stats->data[i])); + else if (!strncmp((const char*)&strings->data[i * ETH_GSTRING_LEN], "mgmt_rx_bytes", ETH_GSTRING_LEN)) + json_object_object_add(mgmt_rx, "bytes", json_object_new_int64(stats->data[i])); + else if (!strncmp((const char*)&strings->data[i * ETH_GSTRING_LEN], "mgmt_tx", ETH_GSTRING_LEN)) + json_object_object_add(mgmt_tx, "packets", json_object_new_int64(stats->data[i])); + else if (!strncmp((const char*)&strings->data[i * ETH_GSTRING_LEN], "mgmt_tx_bytes", ETH_GSTRING_LEN)) + json_object_object_add(mgmt_tx, "bytes", json_object_new_int64(stats->data[i])); + } + + ret = json_object_new_object(); + json_object_object_add(ret, "rx", rx); + json_object_object_add(ret, "tx", tx); + json_object_object_add(ret, "forward", forward); + json_object_object_add(ret, "mgmt_rx", mgmt_rx); + json_object_object_add(ret, "mgmt_tx", mgmt_tx); + + out: + free(stats); + free(strings); + close(fd); + return ret; +} + +static void count_iface_stations(size_t *wifi24, size_t *wifi5, const char *ifname) { + const struct iwinfo_ops *iw = iwinfo_backend(ifname); + if (!iw) + return; + + int freq; + if (iw->frequency(ifname, &freq) < 0) + return; + + size_t *wifi; + if (freq >= 2400 && freq < 2500) + wifi = wifi24; + else if (freq >= 5000 && freq < 6000) + wifi = wifi5; + else + return; + + int len; + char buf[IWINFO_BUFSIZE]; + if (iw->assoclist(ifname, buf, &len) < 0) + return; + + struct iwinfo_assoclist_entry *entry; + for (entry = (struct iwinfo_assoclist_entry *)buf; (char*)(entry+1) <= buf + len; entry++) + (*wifi)++; +} + +static void count_stations(size_t *wifi24, size_t *wifi5) { + struct uci_context *ctx = uci_alloc_context(); + ctx->flags &= ~UCI_FLAG_STRICT; + + + struct uci_package *p; + if (uci_load(ctx, "wireless", &p)) + goto end; + + + struct uci_element *e; + uci_foreach_element(&p->sections, e) { + struct uci_section *s = uci_to_section(e); + if (strcmp(s->type, "wifi-iface")) + continue; + + const char *network = uci_lookup_option_string(ctx, s, "network"); + if (!network || strcmp(network, "client")) + continue; + + const char *mode = uci_lookup_option_string(ctx, s, "mode"); + if (!mode || strcmp(mode, "ap")) + continue; + + const char *ifname = uci_lookup_option_string(ctx, s, "ifname"); + if (!ifname) + continue; + + count_iface_stations(wifi24, wifi5, ifname); + } + + end: + uci_free_context(ctx); +} + +static struct json_object * get_clients(void) { + size_t total = 0, wifi = 0, wifi24 = 0, wifi5 = 0; + + FILE *f = fopen("/sys/kernel/debug/batman_adv/bat0/transtable_local", "r"); + if (!f) + return NULL; + + char *line = NULL; + size_t len = 0; + + while (getline(&line, &len, f) >= 0) { + char addr[18], flags[16]; + + if (sscanf(line, " * %17[0-9a-fA-F:] [%15[^]]]", addr, flags) != 2) + continue; + + if (strchr(flags, 'P')) + continue; + + total++; + + if (strchr(flags, 'W')) + wifi++; + } + + free(line); + fclose(f); + + count_stations(&wifi24, &wifi5); + + struct json_object *ret = json_object_new_object(); + json_object_object_add(ret, "total", json_object_new_int(total)); + json_object_object_add(ret, "wifi", json_object_new_int(wifi)); + json_object_object_add(ret, "wifi24", json_object_new_int(wifi24)); + json_object_object_add(ret, "wifi5", json_object_new_int(wifi5)); + return ret; +} + + +static struct json_object * respondd_provider_statistics(void) { + struct json_object *ret = json_object_new_object(); + + json_object_object_add(ret, "clients", get_clients()); + json_object_object_add(ret, "traffic", get_traffic()); + + add_gateway(ret); + + return ret; +} + + +static struct json_object * ifnames2addrs(struct json_object *interfaces) { + struct json_object *ret = json_object_new_object(); + + json_object_object_foreach(interfaces, ifname, interface) { + char *ifaddr = gluonutil_get_interface_address(ifname); + if (!ifaddr) + continue; + + struct json_object *obj = json_object_new_object(); + json_object_object_add(obj, "neighbours", json_object_get(interface)); + json_object_object_add(ret, ifaddr, obj); + + free(ifaddr); + } + + json_object_put(interfaces); + + return ret; +} + +static struct json_object * get_batadv(void) { + FILE *f = fopen("/tmp/batman-adv-visdata/bat0/originators", "r"); + if (!f) + return NULL; + + char *line = NULL; + size_t len = 0; + + struct json_object *interfaces = json_object_new_object(); + + while (getline(&line, &len, f) >= 0) { + char mac1[18], mac2[18]; + /* IF_NAMESIZE would be enough, but adding 1 here is simpler than subtracting 1 in the format string */ + char ifname[IF_NAMESIZE+1]; + double lastseen; + int tq; + + if (sscanf(line, + "%17[0-9a-fA-F:] %lfs ( %i ) %17[0-9a-fA-F:] [ %"STRINGIFY(IF_NAMESIZE)"[^]] ]", + mac1, &lastseen, &tq, mac2, ifname) != 5) + continue; + + if (strcmp(mac1, mac2)) + continue; + + struct json_object *interface; + if (!json_object_object_get_ex(interfaces, ifname, &interface)) { + interface = json_object_new_object(); + json_object_object_add(interfaces, ifname, interface); + } + + struct json_object *obj = json_object_new_object(); + json_object_object_add(obj, "tq", json_object_new_int(tq)); + json_object_object_add(obj, "lastseen", json_object_new_double(lastseen)); + json_object_object_add(interface, mac1, obj); + } + + fclose(f); + free(line); + + return ifnames2addrs(interfaces); +} + +static struct json_object * get_wifi_neighbours(const char *ifname) { + const struct iwinfo_ops *iw = iwinfo_backend(ifname); + if (!iw) + return NULL; + + int len; + char buf[IWINFO_BUFSIZE]; + if (iw->assoclist(ifname, buf, &len) < 0) + return NULL; + + struct json_object *neighbours = json_object_new_object(); + + struct iwinfo_assoclist_entry *entry; + for (entry = (struct iwinfo_assoclist_entry *)buf; (char*)(entry+1) <= buf + len; entry++) { + struct json_object *obj = json_object_new_object(); + + json_object_object_add(obj, "signal", json_object_new_int(entry->signal)); + json_object_object_add(obj, "noise", json_object_new_int(entry->noise)); + json_object_object_add(obj, "inactive", json_object_new_int(entry->inactive)); + + char mac[18]; + snprintf(mac, sizeof(mac), "%02x:%02x:%02x:%02x:%02x:%02x", + entry->mac[0], entry->mac[1], entry->mac[2], + entry->mac[3], entry->mac[4], entry->mac[5]); + + json_object_object_add(neighbours, mac, obj); + } + + struct json_object *ret = json_object_new_object(); + + if (json_object_object_length(neighbours)) + json_object_object_add(ret, "neighbours", neighbours); + else + json_object_put(neighbours); + + return ret; +} + +static struct json_object * get_wifi(void) { + const char *mesh = "bat0"; + + struct json_object *ret = json_object_new_object(); + + const char *format = "/sys/class/net/%s/lower_*"; + char pattern[strlen(format) + strlen(mesh)]; + snprintf(pattern, sizeof(pattern), format, mesh); + + size_t pattern_len = strlen(pattern); + + glob_t lower; + if (!glob(pattern, GLOB_NOSORT, NULL, &lower)) { + size_t i; + for (i = 0; i < lower.gl_pathc; i++) { + const char *ifname = lower.gl_pathv[i] + pattern_len - 1; + char *ifaddr = gluonutil_get_interface_address(ifname); + if (!ifaddr) + continue; + + struct json_object *neighbours = get_wifi_neighbours(ifname); + if (neighbours) + json_object_object_add(ret, ifaddr, neighbours); + + free(ifaddr); + } + + globfree(&lower); + } + + return ret; +} + +static struct json_object * respondd_provider_neighbours(void) { + struct json_object *ret = json_object_new_object(); + + struct json_object *batadv = get_batadv(); + if (batadv) + json_object_object_add(ret, "batadv", batadv); + + struct json_object *wifi = get_wifi(); + if (wifi) + json_object_object_add(ret, "wifi", wifi); + + return ret; +} + + +const struct respondd_provider_info respondd_providers[] = { + {"nodeinfo", respondd_provider_nodeinfo}, + {"statistics", respondd_provider_statistics}, + {"neighbours", respondd_provider_neighbours}, + {} +}; diff --git a/package/gluon-mesh-vpn-fastd/Makefile b/package/gluon-mesh-vpn-fastd/Makefile index 4fdd608b..0875e485 100644 --- a/package/gluon-mesh-vpn-fastd/Makefile +++ b/package/gluon-mesh-vpn-fastd/Makefile @@ -4,6 +4,7 @@ PKG_NAME:=gluon-mesh-vpn-fastd PKG_VERSION:=3 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) +PKG_BUILD_DEPENDS := respondd include $(GLUONDIR)/include/package.mk @@ -11,25 +12,19 @@ define Package/gluon-mesh-vpn-fastd SECTION:=gluon CATEGORY:=Gluon TITLE:=Support for connecting batman-adv meshes via fastd - DEPENDS:=+gluon-core gluon-mesh-batman-adv +gluon-wan-dnsmasq +fastd +iptables-mod-extra +simple-tc -endef - -define Package/gluon-mesh-vpn-fastd/description - Gluon community wifi mesh firmware framework: fastd support + DEPENDS:=+gluon-core +libgluonutil gluon-mesh-batman-adv +gluon-wan-dnsmasq +fastd +iptables-mod-extra +simple-tc endef define Build/Prepare mkdir -p $(PKG_BUILD_DIR) -endef - -define Build/Configure -endef - -define Build/Compile + $(CP) ./src/* $(PKG_BUILD_DIR)/ endef define Package/gluon-mesh-vpn-fastd/install $(CP) ./files/* $(1)/ + + $(INSTALL_DIR) $(1)/lib/gluon/respondd + $(CP) $(PKG_BUILD_DIR)/respondd.so $(1)/lib/gluon/respondd/mesh-vpn-fastd.so endef define Package/gluon-mesh-vpn-fastd/postinst diff --git a/package/gluon-mesh-vpn-fastd/files/lib/gluon/announce/nodeinfo.d/software/fastd b/package/gluon-mesh-vpn-fastd/files/lib/gluon/announce/nodeinfo.d/software/fastd deleted file mode 100644 index 2c412eb8..00000000 --- a/package/gluon-mesh-vpn-fastd/files/lib/gluon/announce/nodeinfo.d/software/fastd +++ /dev/null @@ -1,5 +0,0 @@ -local ret = { - enabled = uci:get('fastd', 'mesh_vpn') and (uci:get('fastd', 'mesh_vpn', 'enabled') == nil or uci:get_bool('fastd', 'mesh_vpn', 'enabled')), - version = util.readline(io.popen('exec fastd -v')):match('^[^%s]+%s+(.+)'), -} -return ret diff --git a/package/gluon-mesh-vpn-fastd/files/lib/gluon/announce/statistics.d/mesh_vpn b/package/gluon-mesh-vpn-fastd/files/lib/gluon/announce/statistics.d/mesh_vpn deleted file mode 100644 index f4e8f221..00000000 --- a/package/gluon-mesh-vpn-fastd/files/lib/gluon/announce/statistics.d/mesh_vpn +++ /dev/null @@ -1,70 +0,0 @@ -local json = require 'luci.jsonc' -local ltn12 = require 'luci.ltn12' -local nixio = require 'nixio' -local site = require 'gluon.site_config' - -local fastd_sock = nixio.socket('unix', 'stream') -local socket_path = uci:get('fastd', 'mesh_vpn', 'status_socket') - -if not fastd_sock:connect(socket_path) then - return nil -end - -local decoder = json.new() -ltn12.pump.all(ltn12.source.file(fastd_sock), decoder:sink()) - -local status = decoder:get() - - -local peer_groups - -local function peer_connection(config) - local peer = status.peers[config.key] - if peer then - if peer.connection then - return { - established = peer.connection.established/1000 - } - else - return function()end -- nil - end - end -end - -local function peer_group(config) - local ret = {} - - if config.peers then - local peers = {} - - for peername, peerconfig in pairs(config.peers) do - peers[peername] = peer_connection(peerconfig) - end - - if next(peers) then - ret.peers = peers - end - end - - ret.groups = peer_groups(config.groups) - - if next(ret) then - return ret - end -end - -function peer_groups(groups) - if groups then - local ret = {} - - for name, group in pairs(groups) do - ret[name] = peer_group(group) - end - - if next(ret) then - return ret - end - end -end - -return peer_group(site.fastd_mesh_vpn) diff --git a/package/gluon-mesh-vpn-fastd/src/Makefile b/package/gluon-mesh-vpn-fastd/src/Makefile new file mode 100644 index 00000000..3ddc8a58 --- /dev/null +++ b/package/gluon-mesh-vpn-fastd/src/Makefile @@ -0,0 +1,6 @@ +all: respondd.so + +CFLAGS += -Wall + +respondd.so: respondd.c + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared -fPIC -D_GNU_SOURCE -o $@ $^ $(LDLIBS) -lgluonutil -luci diff --git a/package/gluon-mesh-vpn-fastd/src/respondd.c b/package/gluon-mesh-vpn-fastd/src/respondd.c new file mode 100644 index 00000000..3045c77a --- /dev/null +++ b/package/gluon-mesh-vpn-fastd/src/respondd.c @@ -0,0 +1,305 @@ +/* + Copyright (c) 2016, Matthias Schiffer + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + + +static struct json_object * get_peer_groups(struct json_object *groups, struct json_object *peers); + +static struct json_object * get_fastd_version(void) { + FILE *f = popen("exec fastd -v", "r"); + if (!f) + return NULL; + + char *line = NULL; + size_t len = 0; + + ssize_t r = getline(&line, &len, f); + + pclose(f); + + if (r >= 0) { + len = strlen(line); /* The len given by getline is the buffer size, not the string length */ + + if (len && line[len-1] == '\n') + line[len-1] = 0; + } + else { + free(line); + line = NULL; + } + + const char *version = line; + if (strncmp(version, "fastd ", 6) == 0) + version += 6; + + struct json_object *ret = gluonutil_wrap_string(version); + free(line); + return ret; +} + +static struct json_object * get_fastd(void) { + bool enabled = false; + + struct uci_context *ctx = uci_alloc_context(); + ctx->flags &= ~UCI_FLAG_STRICT; + + struct uci_package *p; + if (uci_load(ctx, "fastd", &p)) + goto disabled; + + struct uci_section *s = uci_lookup_section(ctx, p, "mesh_vpn"); + if (!s) + goto disabled; + + const char *enabled_str = uci_lookup_option_string(ctx, s, "enabled"); + if (!enabled_str || !strcmp(enabled_str, "1")) + enabled = true; + + disabled: + + uci_free_context(ctx); + + struct json_object *ret = json_object_new_object(); + json_object_object_add(ret, "version", get_fastd_version()); + json_object_object_add(ret, "enabled", json_object_new_boolean(enabled)); + return ret; +} + +static struct json_object * respondd_provider_nodeinfo(void) { + struct json_object *ret = json_object_new_object(); + + struct json_object *software = json_object_new_object(); + json_object_object_add(software, "fastd", get_fastd()); + json_object_object_add(ret, "software", software); + + return ret; +} + + +static const char * get_status_socket(struct uci_context *ctx, struct uci_section *s) { + return uci_lookup_option_string(ctx, s, "status_socket"); +} + +static struct json_object * read_status(struct uci_context *ctx, struct uci_section *s) { + const char *path = get_status_socket(ctx, s); + + size_t addrlen = strlen(path); + + /* Allocate enough space for arbitrary-length paths */ + char addrbuf[offsetof(struct sockaddr_un, sun_path) + addrlen + 1]; + memset(addrbuf, 0, sizeof(addrbuf)); + + struct sockaddr_un *addr = (struct sockaddr_un *)addrbuf; + addr->sun_family = AF_UNIX; + memcpy(addr->sun_path, path, addrlen+1); + + int fd = socket(AF_UNIX, SOCK_STREAM, 0); + if (fd < 0) + return NULL; + + if (connect(fd, (struct sockaddr*)addr, sizeof(addrbuf)) < 0) { + close(fd); + return NULL; + } + + struct json_object *ret = NULL; + struct json_tokener *tok = json_tokener_new(); + + do { + char buf[1024]; + size_t len = read(fd, buf, sizeof(buf)); + if (len <= 0) + break; + + ret = json_tokener_parse_ex(tok, buf, len); + } while (!ret && json_tokener_get_error(tok) == json_tokener_continue); + + json_tokener_free(tok); + close(fd); + return ret; +} + +static struct json_object * get_status(void) { + struct json_object *ret = NULL; + + struct uci_context *ctx = uci_alloc_context(); + ctx->flags &= ~UCI_FLAG_STRICT; + + struct uci_package *p; + if (!uci_load(ctx, "fastd", &p)) { + struct uci_section *s = uci_lookup_section(ctx, p, "mesh_vpn"); + + if (s) + ret = read_status(ctx, s); + } + + uci_free_context(ctx); + + return ret; +} + +static bool get_peer_connection(struct json_object **ret, struct json_object *config, struct json_object *peers) { + struct json_object *key_object; + if (!json_object_object_get_ex(config, "key", &key_object)) + return false; + + const char *key = json_object_get_string(key_object); + if (!key) + return false; + + struct json_object *peer, *connection, *established; + if (!json_object_object_get_ex(peers, key, &peer) || + !json_object_object_get_ex(peer, "connection", &connection)) + return false; + + if (json_object_object_get_ex(connection, "established", &established)) { + int64_t established_time = json_object_get_int64(established); + + *ret = json_object_new_object(); + json_object_object_add(*ret, "established", json_object_new_double(established_time/1000.0)); + } + else { + *ret = NULL; + } + + return true; +} + +static struct json_object * get_peer_group(struct json_object *config, struct json_object *peers) { + struct json_object *ret = json_object_new_object(); + + struct json_object *config_peers; + if (json_object_object_get_ex(config, "peers", &config_peers) && + json_object_is_type(config_peers, json_type_object)) { + struct json_object *ret_peers = json_object_new_object(); + + json_object_object_foreach(config_peers, peername, peerconfig) { + struct json_object *obj; + if (get_peer_connection(&obj, peerconfig, peers)) + json_object_object_add(ret_peers, peername, obj); + } + + if (json_object_object_length(ret_peers)) + json_object_object_add(ret, "peers", ret_peers); + else + json_object_put(ret_peers); + } + + struct json_object *config_groups; + if (json_object_object_get_ex(config, "groups", &config_groups)) { + struct json_object *obj = get_peer_groups(config_groups, peers); + if (obj) + json_object_object_add(ret, "groups", obj); + } + + + if (!json_object_object_length(ret)) { + json_object_put(ret); + return NULL; + } + + return ret; +} + +static struct json_object * get_peer_groups(struct json_object *groups, struct json_object *peers) { + if (!json_object_is_type(groups, json_type_object)) + return NULL; + + struct json_object *ret = json_object_new_object(); + + json_object_object_foreach(groups, name, group) { + struct json_object *g = get_peer_group(group, peers); + if (g) + json_object_object_add(ret, name, g); + } + + if (!json_object_object_length(ret)) { + json_object_put(ret); + return NULL; + } + + return ret; +} + +static struct json_object * get_mesh_vpn(void) { + struct json_object *ret = NULL; + struct json_object *status = NULL; + struct json_object *site = NULL; + + status = get_status(); + if (!status) + goto end; + + struct json_object *peers; + if (!json_object_object_get_ex(status, "peers", &peers)) + goto end; + + site = gluonutil_load_site_config(); + if (!site) + goto end; + + struct json_object *fastd_mesh_vpn; + if (!json_object_object_get_ex(site, "fastd_mesh_vpn", &fastd_mesh_vpn)) + goto end; + + ret = get_peer_group(fastd_mesh_vpn, peers); + + end: + json_object_put(site); + json_object_put(status); + + return ret; +} + +static struct json_object * respondd_provider_statistics(void) { + struct json_object *ret = json_object_new_object(); + + struct json_object *mesh_vpn = get_mesh_vpn(); + if (mesh_vpn) + json_object_object_add(ret, "mesh_vpn", mesh_vpn); + + return ret; +} + + +const struct respondd_provider_info respondd_providers[] = { + {"nodeinfo", respondd_provider_nodeinfo}, + {"statistics", respondd_provider_statistics}, + {} +}; diff --git a/package/gluon-node-info/Makefile b/package/gluon-node-info/Makefile index 0fe8a8dd..a5ac8ddc 100644 --- a/package/gluon-node-info/Makefile +++ b/package/gluon-node-info/Makefile @@ -5,6 +5,7 @@ PKG_VERSION:=1 PKG_RELEASE:=1 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) +PKG_BUILD_DEPENDS := respondd include $(GLUONDIR)/include/package.mk @@ -12,25 +13,19 @@ define Package/gluon-node-info SECTION:=gluon CATEGORY:=Gluon TITLE:=Add /etc/config/gluon-node-info to uci - DEPENDS:=+gluon-core -endef - -define Package/gluon-node-info/description - This packages creates /etc/config/gluon-node-info. + DEPENDS:=+gluon-core +libgluonutil endef define Build/Prepare mkdir -p $(PKG_BUILD_DIR) -endef - -define Build/Configure -endef - -define Build/Compile + $(CP) ./src/* $(PKG_BUILD_DIR)/ endef define Package/gluon-node-info/install $(CP) ./files/* $(1)/ + + $(INSTALL_DIR) $(1)/lib/gluon/respondd + $(CP) $(PKG_BUILD_DIR)/respondd.so $(1)/lib/gluon/respondd/node-info.so endef define Package/gluon-node-info/postinst diff --git a/package/gluon-node-info/files/lib/gluon/announce/nodeinfo.d/location b/package/gluon-node-info/files/lib/gluon/announce/nodeinfo.d/location deleted file mode 100644 index 72bf8878..00000000 --- a/package/gluon-node-info/files/lib/gluon/announce/nodeinfo.d/location +++ /dev/null @@ -1,7 +0,0 @@ -if uci:get_first('gluon-node-info', 'location', 'share_location', false) then - return { - latitude = tonumber(uci:get_first('gluon-node-info', 'location', 'latitude')), - longitude = tonumber(uci:get_first('gluon-node-info', 'location', 'longitude')), - altitude = tonumber(uci:get_first('gluon-node-info', 'location', 'altitude')), - } -end diff --git a/package/gluon-node-info/files/lib/gluon/announce/nodeinfo.d/owner b/package/gluon-node-info/files/lib/gluon/announce/nodeinfo.d/owner deleted file mode 100644 index 8a2a611d..00000000 --- a/package/gluon-node-info/files/lib/gluon/announce/nodeinfo.d/owner +++ /dev/null @@ -1,4 +0,0 @@ -local contact = uci:get_first('gluon-node-info', 'owner', 'contact', '') -if contact ~= '' then - return { contact = contact } -end diff --git a/package/gluon-node-info/files/lib/gluon/announce/nodeinfo.d/system/role b/package/gluon-node-info/files/lib/gluon/announce/nodeinfo.d/system/role deleted file mode 100644 index 38de47d7..00000000 --- a/package/gluon-node-info/files/lib/gluon/announce/nodeinfo.d/system/role +++ /dev/null @@ -1,4 +0,0 @@ -local role = uci:get_first('gluon-node-info', 'system', 'role', '') -if role ~= '' then - return role -end diff --git a/package/gluon-node-info/src/Makefile b/package/gluon-node-info/src/Makefile new file mode 100644 index 00000000..3ddc8a58 --- /dev/null +++ b/package/gluon-node-info/src/Makefile @@ -0,0 +1,6 @@ +all: respondd.so + +CFLAGS += -Wall + +respondd.so: respondd.c + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared -fPIC -D_GNU_SOURCE -o $@ $^ $(LDLIBS) -lgluonutil -luci diff --git a/package/gluon-node-info/src/respondd.c b/package/gluon-node-info/src/respondd.c new file mode 100644 index 00000000..dfbfd3f8 --- /dev/null +++ b/package/gluon-node-info/src/respondd.c @@ -0,0 +1,144 @@ +/* + Copyright (c) 2016, Matthias Schiffer + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + +#include + +#include +#include + +#include + +#include +#include + + +static struct uci_section * get_first_section(struct uci_package *p, const char *type) { + struct uci_element *e; + uci_foreach_element(&p->sections, e) { + struct uci_section *s = uci_to_section(e); + if (!strcmp(s->type, type)) + return s; + } + + return NULL; +} + +static const char * get_first_option(struct uci_context *ctx, struct uci_package *p, const char *type, const char *option) { + struct uci_section *s = get_first_section(p, type); + if (s) + return uci_lookup_option_string(ctx, s, option); + else + return NULL; +} + +static struct json_object * get_number(struct uci_context *ctx, struct uci_section *s, const char *name) { + const char *val = uci_lookup_option_string(ctx, s, name); + if (!val || !*val) + return NULL; + + char *end; + double d = strtod(val, &end); + if (*end) + return NULL; + + return json_object_new_double(d); +} + +static struct json_object * get_location(struct uci_context *ctx, struct uci_package *p) { + struct uci_section *s = get_first_section(p, "location"); + if (!s) + return NULL; + + const char *share = uci_lookup_option_string(ctx, s, "share_location"); + if (!share || strcmp(share, "1")) + return NULL; + + struct json_object *ret = json_object_new_object(); + + struct json_object *latitude = get_number(ctx, s, "latitude"); + if (latitude) + json_object_object_add(ret, "latitude", latitude); + + struct json_object *longitude = get_number(ctx, s, "longitude"); + if (longitude) + json_object_object_add(ret, "longitude", longitude); + + struct json_object *altitude = get_number(ctx, s, "altitude"); + if (altitude) + json_object_object_add(ret, "altitude", altitude); + + return ret; +} + +static struct json_object * get_owner(struct uci_context *ctx, struct uci_package *p) { + const char *contact = get_first_option(ctx, p, "owner", "contact"); + if (!contact || !*contact) + return NULL; + + struct json_object *ret = json_object_new_object(); + json_object_object_add(ret, "contact", gluonutil_wrap_string(contact)); + return ret; +} + +static struct json_object * get_system(struct uci_context *ctx, struct uci_package *p) { + struct json_object *ret = json_object_new_object(); + + const char *role = get_first_option(ctx, p, "system", "role"); + if (role && *role) + json_object_object_add(ret, "role", gluonutil_wrap_string(role)); + + return ret; +} + +static struct json_object * respondd_provider_nodeinfo(void) { + struct json_object *ret = json_object_new_object(); + + struct uci_context *ctx = uci_alloc_context(); + ctx->flags &= ~UCI_FLAG_STRICT; + + struct uci_package *p; + if (!uci_load(ctx, "gluon-node-info", &p)) { + struct json_object *location = get_location(ctx, p); + if (location) + json_object_object_add(ret, "location", location); + + struct json_object *owner = get_owner(ctx, p); + if (owner) + json_object_object_add(ret, "owner", owner); + + json_object_object_add(ret, "system", get_system(ctx, p)); + } + + uci_free_context(ctx); + + return ret; +} + + +const struct respondd_provider_info respondd_providers[] = { + {"nodeinfo", respondd_provider_nodeinfo}, + {} +}; diff --git a/package/gluon-respondd/Makefile b/package/gluon-respondd/Makefile new file mode 100644 index 00000000..df9f257e --- /dev/null +++ b/package/gluon-respondd/Makefile @@ -0,0 +1,29 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=gluon-respondd +PKG_VERSION:=1 + +PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/gluon-respondd + SECTION:=gluon + CATEGORY:=Gluon + TITLE:=Provides node information to the network + DEPENDS:=+gluon-core +libplatforminfo +libgluonutil +respondd +endef + +define Build/Prepare + mkdir -p $(PKG_BUILD_DIR) + $(CP) ./src/* $(PKG_BUILD_DIR)/ +endef + +define Package/gluon-respondd/install + $(CP) ./files/* $(1)/ + + $(INSTALL_DIR) $(1)/lib/gluon/respondd + $(CP) $(PKG_BUILD_DIR)/respondd.so $(1)/lib/gluon/respondd/respondd.so +endef + +$(eval $(call BuildPackage,gluon-respondd)) diff --git a/package/gluon-announced/files/etc/hotplug.d/iface/10-gluon-announced b/package/gluon-respondd/files/etc/hotplug.d/iface/10-gluon-respondd similarity index 79% rename from package/gluon-announced/files/etc/hotplug.d/iface/10-gluon-announced rename to package/gluon-respondd/files/etc/hotplug.d/iface/10-gluon-respondd index a1e2c45f..c8594a1b 100644 --- a/package/gluon-announced/files/etc/hotplug.d/iface/10-gluon-announced +++ b/package/gluon-respondd/files/etc/hotplug.d/iface/10-gluon-respondd @@ -3,7 +3,7 @@ . /usr/share/libubox/jshn.sh . /lib/functions/service.sh -DEVLIST=/var/run/gluon-announced.devs +DEVLIST=/var/run/gluon-respondd.devs DAEMON=/usr/bin/respondd ifname_to_dev () { @@ -13,7 +13,7 @@ ifname_to_dev () { echo "$dev" } -restart_announced () { +restart_respondd () { SERVICE_USE_PID=1 SERVICE_WRITE_PID=1 SERVICE_DAEMONIZE=1 @@ -21,7 +21,7 @@ restart_announced () { DEVS=$(cat $DEVLIST | while read dev iface; do echo -n " -i $dev"; done) service_stop $DAEMON - service_start $DAEMON -g ff02::2:1001 -p 1001 -c 'return require("gluon.announced").handle_request' $DEVS + service_start $DAEMON -g ff02::2:1001 -p 1001 -d /lib/gluon/respondd $DEVS } case "$ACTION" in @@ -38,8 +38,7 @@ case "$ACTION" in echo "$DEVS" | sort -u > $DEVLIST - restart_announced + restart_respondd ;; esac - diff --git a/package/gluon-respondd/files/lib/gluon/respondd/neighbours.cache b/package/gluon-respondd/files/lib/gluon/respondd/neighbours.cache new file mode 100644 index 00000000..5caff40c --- /dev/null +++ b/package/gluon-respondd/files/lib/gluon/respondd/neighbours.cache @@ -0,0 +1 @@ +10000 diff --git a/package/gluon-respondd/files/lib/gluon/respondd/nodeinfo.cache b/package/gluon-respondd/files/lib/gluon/respondd/nodeinfo.cache new file mode 100644 index 00000000..67f9d558 --- /dev/null +++ b/package/gluon-respondd/files/lib/gluon/respondd/nodeinfo.cache @@ -0,0 +1 @@ +300000 diff --git a/package/gluon-respondd/files/lib/gluon/respondd/statistics.cache b/package/gluon-respondd/files/lib/gluon/respondd/statistics.cache new file mode 100644 index 00000000..e9c02dad --- /dev/null +++ b/package/gluon-respondd/files/lib/gluon/respondd/statistics.cache @@ -0,0 +1 @@ +5000 diff --git a/package/gluon-announced/files/lib/gluon/upgrade/400-announced-firewall b/package/gluon-respondd/files/lib/gluon/upgrade/400-respondd-firewall similarity index 54% rename from package/gluon-announced/files/lib/gluon/upgrade/400-announced-firewall rename to package/gluon-respondd/files/lib/gluon/upgrade/400-respondd-firewall index 77acb1b9..65c5d8e3 100755 --- a/package/gluon-announced/files/lib/gluon/upgrade/400-announced-firewall +++ b/package/gluon-respondd/files/lib/gluon/upgrade/400-respondd-firewall @@ -2,10 +2,12 @@ local uci = require('luci.model.uci').cursor() --- Allow announced port on WAN to allow resolving neighbours over mesh-on-wan -uci:section('firewall', 'rule', 'wan_announced', +uci:delete('firewall', 'wan_announced') + +-- Allow respondd port on WAN to allow resolving neighbours over mesh-on-wan +uci:section('firewall', 'rule', 'wan_respondd', { - name = 'wan_announced', + name = 'wan_respondd', src = 'wan', src_ip = 'fe80::/64', dest_port = '1001', diff --git a/package/gluon-respondd/src/Makefile b/package/gluon-respondd/src/Makefile new file mode 100644 index 00000000..eddbe260 --- /dev/null +++ b/package/gluon-respondd/src/Makefile @@ -0,0 +1,6 @@ +all: respondd.so + +CFLAGS += -Wall + +respondd.so: respondd.c + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared -fPIC -D_GNU_SOURCE -o $@ $^ $(LDLIBS) -lgluonutil -lplatforminfo diff --git a/package/gluon-respondd/src/respondd.c b/package/gluon-respondd/src/respondd.c new file mode 100644 index 00000000..85006d6f --- /dev/null +++ b/package/gluon-respondd/src/respondd.c @@ -0,0 +1,209 @@ +/* + Copyright (c) 2016, Matthias Schiffer + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include + + +static struct json_object * gluon_version(void) { + char *version = gluonutil_read_line("/lib/gluon/gluon-version"); + if (!version) + return NULL; + + char full_version[6 + strlen(version) + 1]; + snprintf(full_version, sizeof(full_version), "gluon-%s", version); + + free(version); + + + return json_object_new_string(full_version); +} + +static struct json_object * get_site_code(void) { + struct json_object *site = gluonutil_load_site_config(); + if (!site) + return NULL; + + struct json_object *ret = NULL; + json_object_object_get_ex(site, "site_code", &ret); + if (ret) + json_object_get(ret); + + json_object_put(site); + return ret; +} + +static struct json_object * get_hostname(void) { + struct utsname utsname; + + if (uname(&utsname)) + return NULL; + + return gluonutil_wrap_string(utsname.nodename); +} + +static struct json_object * respondd_provider_nodeinfo(void) { + struct json_object *ret = json_object_new_object(); + + json_object_object_add(ret, "node_id", gluonutil_wrap_and_free_string(gluonutil_get_node_id())); + json_object_object_add(ret, "hostname", get_hostname()); + + struct json_object *hardware = json_object_new_object(); + json_object_object_add(hardware, "model", json_object_new_string(platforminfo_get_model())); + json_object_object_add(hardware, "nproc", json_object_new_int(sysconf(_SC_NPROCESSORS_ONLN))); + json_object_object_add(ret, "hardware", hardware); + + struct json_object *network = json_object_new_object(); + json_object_object_add(network, "mac", gluonutil_wrap_and_free_string(gluonutil_get_sysconfig("primary_mac"))); + json_object_object_add(ret, "network", network); + + struct json_object *software = json_object_new_object(); + struct json_object *software_firmware = json_object_new_object(); + json_object_object_add(software_firmware, "base", gluon_version()); + json_object_object_add(software_firmware, "release", gluonutil_wrap_and_free_string(gluonutil_read_line("/lib/gluon/release"))); + json_object_object_add(software, "firmware", software_firmware); + json_object_object_add(ret, "software", software); + + struct json_object *system = json_object_new_object(); + json_object_object_add(system, "site_code", get_site_code()); + json_object_object_add(ret, "system", system); + + return ret; +} + + +static void add_uptime(struct json_object *obj) { + FILE *f = fopen("/proc/uptime", "r"); + if (!f) + return; + + double uptime, idletime; + if (fscanf(f, "%lf %lf", &uptime, &idletime) == 2) { + json_object_object_add(obj, "uptime", json_object_new_double(uptime)); + json_object_object_add(obj, "idletime", json_object_new_double(idletime)); + } + + fclose(f); +} + +static void add_loadavg(struct json_object *obj) { + FILE *f = fopen("/proc/loadavg", "r"); + if (!f) + return; + + double loadavg; + unsigned proc_running, proc_total; + if (fscanf(f, "%lf %*f %*f %u/%u", &loadavg, &proc_running, &proc_total) == 3) { + json_object_object_add(obj, "loadavg", json_object_new_double(loadavg)); + + struct json_object *processes = json_object_new_object(); + json_object_object_add(processes, "running", json_object_new_int(proc_running)); + json_object_object_add(processes, "total", json_object_new_int(proc_total)); + json_object_object_add(obj, "processes", processes); + } + + fclose(f); +} + +static struct json_object * get_memory(void) { + FILE *f = fopen("/proc/meminfo", "r"); + if (!f) + return NULL; + + struct json_object *ret = json_object_new_object(); + + char *line = NULL; + size_t len = 0; + + while (getline(&line, &len, f) >= 0) { + char label[32]; + unsigned value; + + if (sscanf(line, "%31[^:]: %u", label, &value) != 2) + continue; + + if (!strcmp(label, "MemTotal")) + json_object_object_add(ret, "total", json_object_new_int(value)); + else if (!strcmp(label, "MemFree")) + json_object_object_add(ret, "free", json_object_new_int(value)); + else if (!strcmp(label, "Buffers")) + json_object_object_add(ret, "buffers", json_object_new_int(value)); + else if (!strcmp(label, "Cached")) + json_object_object_add(ret, "cached", json_object_new_int(value)); + } + + free(line); + fclose(f); + + return ret; +} + +static struct json_object * get_rootfs_usage(void) { + struct statfs s; + if (statfs("/", &s)) + return NULL; + + return json_object_new_double(1 - (double)s.f_bfree / s.f_blocks); +} + +static struct json_object * respondd_provider_statistics(void) { + struct json_object *ret = json_object_new_object(); + + json_object_object_add(ret, "node_id", gluonutil_wrap_and_free_string(gluonutil_get_node_id())); + + json_object_object_add(ret, "rootfs_usage", get_rootfs_usage()); + json_object_object_add(ret, "memory", get_memory()); + + add_uptime(ret); + add_loadavg(ret); + + return ret; +} + + +static struct json_object * respondd_provider_neighbours(void) { + struct json_object *ret = json_object_new_object(); + json_object_object_add(ret, "node_id", gluonutil_wrap_and_free_string(gluonutil_get_node_id())); + return ret; +} + + +const struct respondd_provider_info respondd_providers[] = { + {"nodeinfo", respondd_provider_nodeinfo}, + {"statistics", respondd_provider_statistics}, + {"neighbours", respondd_provider_neighbours}, + {} +}; diff --git a/package/gluon-status-page-api/Makefile b/package/gluon-status-page-api/Makefile index 5b806331..17abab29 100644 --- a/package/gluon-status-page-api/Makefile +++ b/package/gluon-status-page-api/Makefile @@ -5,6 +5,7 @@ PKG_VERSION:=1 PKG_RELEASE:=1 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) +PKG_BUILD_DEPENDS := respondd include $(INCLUDE_DIR)/package.mk @@ -12,7 +13,7 @@ define Package/gluon-status-page-api SECTION:=gluon CATEGORY:=Gluon TITLE:=API for gluon-status-page - DEPENDS:=+gluon-core +uhttpd +sse-multiplex +batman-adv-visdata +gluon-neighbour-info +gluon-announced +libiwinfo +libjson-c + DEPENDS:=+gluon-core +uhttpd +sse-multiplex +batman-adv-visdata +gluon-neighbour-info +gluon-respondd +libiwinfo +libjson-c endef define Build/Prepare @@ -24,6 +25,10 @@ define Package/gluon-status-page-api/install $(INSTALL_DIR) $(1)/lib/gluon/status-page/providers $(INSTALL_BIN) $(PKG_BUILD_DIR)/neighbours-batadv $(1)/lib/gluon/status-page/providers/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/stations $(1)/lib/gluon/status-page/providers/ + + $(INSTALL_DIR) $(1)/lib/gluon/respondd + $(CP) $(PKG_BUILD_DIR)/respondd.so $(1)/lib/gluon/respondd/status-page-api.so + $(CP) ./files/* $(1)/ endef diff --git a/package/gluon-status-page-api/files/lib/gluon/announce/nodeinfo.d/software/status-page b/package/gluon-status-page-api/files/lib/gluon/announce/nodeinfo.d/software/status-page deleted file mode 100644 index 20e865f3..00000000 --- a/package/gluon-status-page-api/files/lib/gluon/announce/nodeinfo.d/software/status-page +++ /dev/null @@ -1 +0,0 @@ -return { api = 1 } diff --git a/package/gluon-status-page-api/src/Makefile b/package/gluon-status-page-api/src/Makefile index f0bee975..81b48b6d 100644 --- a/package/gluon-status-page-api/src/Makefile +++ b/package/gluon-status-page-api/src/Makefile @@ -1,12 +1,15 @@ CFLAGS += -std=c99 -D_BSD_SOURCE -CFLAGS += $(shell pkg-config --cflags json-c) -LDFLAGS += $(shell pkg-config --libs json-c) +CFLAGS_JSONC = $(shell pkg-config --cflags json-c) +LDFLAGS_JSONC = $(shell pkg-config --libs json-c) -all: neighbours-batadv stations +all: neighbours-batadv stations respondd.so neighbours-batadv: neighbours-batadv.c - $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -Wall -o $@ $^ $(LDLIBS) + $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_JSONC) $(LDFLAGS) $(LDFLAGS_JSONC) -Wall -o $@ $^ $(LDLIBS) stations: stations.c - $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -Wall -o $@ $^ $(LDLIBS) -liwinfo + $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_JSONC) $(LDFLAGS) $(LDFLAGS_JSONC) -Wall -o $@ $^ $(LDLIBS) -liwinfo + +respondd.so: respondd.c + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared -fPIC -o $@ $^ $(LDLIBS) diff --git a/package/gluon-status-page-api/src/respondd.c b/package/gluon-status-page-api/src/respondd.c new file mode 100644 index 00000000..f6a0e51e --- /dev/null +++ b/package/gluon-status-page-api/src/respondd.c @@ -0,0 +1,47 @@ +/* + Copyright (c) 2016, Matthias Schiffer + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + +#include + +#include + + +static struct json_object * respondd_provider_nodeinfo(void) { + struct json_object *ret = json_object_new_object(); + + struct json_object *software = json_object_new_object(); + struct json_object *software_status_page = json_object_new_object(); + json_object_object_add(software_status_page, "api", json_object_new_int(1)); + json_object_object_add(software, "status-page", software_status_page); + json_object_object_add(ret, "software", software); + + return ret; +} + +const struct respondd_provider_info respondd_providers[] = { + {"nodeinfo", respondd_provider_nodeinfo}, + {} +}; From b4aaf8a1f804af5bab9c16bd43112606cc8620b3 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 2 Feb 2016 06:38:03 +0100 Subject: [PATCH 70/99] gluon-respondd: add init script Instead of starting gluon-respondd from a hotplug handler, add a proper init script. The new init script has a restart_if_running argument which is now used by the hotplug handler. --- .../etc/hotplug.d/iface/10-gluon-respondd | 22 +++------ .../files/etc/init.d/gluon-respondd | 45 +++++++++++++++++++ 2 files changed, 51 insertions(+), 16 deletions(-) create mode 100755 package/gluon-respondd/files/etc/init.d/gluon-respondd diff --git a/package/gluon-respondd/files/etc/hotplug.d/iface/10-gluon-respondd b/package/gluon-respondd/files/etc/hotplug.d/iface/10-gluon-respondd index c8594a1b..4f49be52 100644 --- a/package/gluon-respondd/files/etc/hotplug.d/iface/10-gluon-respondd +++ b/package/gluon-respondd/files/etc/hotplug.d/iface/10-gluon-respondd @@ -4,7 +4,6 @@ . /lib/functions/service.sh DEVLIST=/var/run/gluon-respondd.devs -DAEMON=/usr/bin/respondd ifname_to_dev () { json_load "$(ubus call network.interface.$1 status)" @@ -13,20 +12,10 @@ ifname_to_dev () { echo "$dev" } -restart_respondd () { - SERVICE_USE_PID=1 - SERVICE_WRITE_PID=1 - SERVICE_DAEMONIZE=1 - - DEVS=$(cat $DEVLIST | while read dev iface; do echo -n " -i $dev"; done) - - service_stop $DAEMON - service_start $DAEMON -g ff02::2:1001 -p 1001 -d /lib/gluon/respondd $DEVS -} - case "$ACTION" in ifdown) - sed -i "/$INTERFACE/d" $DEVLIST + sed "/ $INTERFACE$/d" $DEVLIST > $DEVLIST.new + mv $DEVLIST.new $DEVLIST ;; ifup) DEVICE="$(ifname_to_dev "$INTERFACE")" @@ -34,11 +23,12 @@ case "$ACTION" in [ "$MESH" = "bat0" -o "$INTERFACE" = "client" ] || exit 0 - DEVS=$(cat $DEVLIST; echo $DEVICE $INTERFACE) + DEVS=$(cat $DEVLIST 2>/dev/null; echo $DEVICE $INTERFACE) - echo "$DEVS" | sort -u > $DEVLIST + echo "$DEVS" | sort -u > $DEVLIST.new + mv $DEVLIST.new $DEVLIST - restart_respondd + /etc/init.d/gluon-respondd restart_if_running & ;; esac diff --git a/package/gluon-respondd/files/etc/init.d/gluon-respondd b/package/gluon-respondd/files/etc/init.d/gluon-respondd new file mode 100755 index 00000000..a1bf979f --- /dev/null +++ b/package/gluon-respondd/files/etc/init.d/gluon-respondd @@ -0,0 +1,45 @@ +#!/bin/sh /etc/rc.common + +EXTRA_COMMANDS='restart_if_running' + +START=50 + +SERVICE_WRITE_PID=1 +SERVICE_DAEMONIZE=1 + +DEVLIST=/var/run/gluon-respondd.devs +DAEMON=/usr/bin/respondd +LOCK=/var/run/gluon-respondd.lock + + +do_start() { + DEVS=$(cat $DEVLIST 2>/dev/null | while read dev iface; do echo -n " -i $dev"; done) + service_start $DAEMON -g ff02::2:1001 -p 1001 -d /lib/gluon/respondd $DEVS +} + +do_stop() { + service_stop $DAEMON +} + +start() { + lock $LOCK + do_start + lock -u $LOCK +} + +stop() { + lock $LOCK + do_stop + lock -u $LOCK +} + +restart_if_running() { + lock $LOCK + + if service_check $DAEMON; then + do_stop + do_start + fi + + lock -u $LOCK +} From 0005b3b5a2e7ceddedaff4196104d185c76d2923 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 2 Feb 2016 06:38:03 +0100 Subject: [PATCH 71/99] autoupdater: stop non-essential services before downloading the image --- .../usr/lib/autoupdater/abort.d/60gluon-alfred | 6 ++++++ .../lib/autoupdater/download.d/40gluon-alfred | 6 ++++++ .../files/lib/gluon/autoupdater/lib.sh | 16 ++++++++++++++++ .../lib/autoupdater/abort.d/90gluon-autoupdater | 9 +++++++++ .../autoupdater/download.d/10gluon-autoupdater | 9 +++++++++ .../usr/lib/autoupdater/abort.d/80gluon-radvd | 6 ++++++ .../usr/lib/autoupdater/download.d/20gluon-radvd | 6 ++++++ .../usr/lib/autoupdater/abort.d/50gluon-respondd | 7 +++++++ .../lib/autoupdater/download.d/50gluon-respondd | 7 +++++++ .../autoupdater/abort.d/70gluon-status-page-api | 7 +++++++ .../download.d/30gluon-status-page-api | 7 +++++++ 11 files changed, 86 insertions(+) create mode 100755 package/gluon-alfred/files/usr/lib/autoupdater/abort.d/60gluon-alfred create mode 100755 package/gluon-alfred/files/usr/lib/autoupdater/download.d/40gluon-alfred create mode 100644 package/gluon-autoupdater/files/lib/gluon/autoupdater/lib.sh create mode 100755 package/gluon-autoupdater/files/usr/lib/autoupdater/abort.d/90gluon-autoupdater create mode 100755 package/gluon-autoupdater/files/usr/lib/autoupdater/download.d/10gluon-autoupdater create mode 100755 package/gluon-radvd/files/usr/lib/autoupdater/abort.d/80gluon-radvd create mode 100755 package/gluon-radvd/files/usr/lib/autoupdater/download.d/20gluon-radvd create mode 100755 package/gluon-respondd/files/usr/lib/autoupdater/abort.d/50gluon-respondd create mode 100755 package/gluon-respondd/files/usr/lib/autoupdater/download.d/50gluon-respondd create mode 100755 package/gluon-status-page-api/files/usr/lib/autoupdater/abort.d/70gluon-status-page-api create mode 100755 package/gluon-status-page-api/files/usr/lib/autoupdater/download.d/30gluon-status-page-api diff --git a/package/gluon-alfred/files/usr/lib/autoupdater/abort.d/60gluon-alfred b/package/gluon-alfred/files/usr/lib/autoupdater/abort.d/60gluon-alfred new file mode 100755 index 00000000..621c09a0 --- /dev/null +++ b/package/gluon-alfred/files/usr/lib/autoupdater/abort.d/60gluon-alfred @@ -0,0 +1,6 @@ +#!/bin/sh + +. /lib/gluon/autoupdater/lib.sh + + +start_enabled alfred diff --git a/package/gluon-alfred/files/usr/lib/autoupdater/download.d/40gluon-alfred b/package/gluon-alfred/files/usr/lib/autoupdater/download.d/40gluon-alfred new file mode 100755 index 00000000..19427620 --- /dev/null +++ b/package/gluon-alfred/files/usr/lib/autoupdater/download.d/40gluon-alfred @@ -0,0 +1,6 @@ +#!/bin/sh + +. /lib/gluon/autoupdater/lib.sh + + +stop alfred diff --git a/package/gluon-autoupdater/files/lib/gluon/autoupdater/lib.sh b/package/gluon-autoupdater/files/lib/gluon/autoupdater/lib.sh new file mode 100644 index 00000000..36ddd971 --- /dev/null +++ b/package/gluon-autoupdater/files/lib/gluon/autoupdater/lib.sh @@ -0,0 +1,16 @@ +# Library to be sourced by download.d/abort.d scripts + + +stop() { + if [ -x /etc/init.d/$1 ]; then + echo "Stopping $1..." + /etc/init.d/$1 stop + fi +} + +start_enabled() { + if [ -x /etc/init.d/$1 ] && /etc/init.d/$1 enabled; then + echo "Starting $1..." + /etc/init.d/$1 start + fi +} diff --git a/package/gluon-autoupdater/files/usr/lib/autoupdater/abort.d/90gluon-autoupdater b/package/gluon-autoupdater/files/usr/lib/autoupdater/abort.d/90gluon-autoupdater new file mode 100755 index 00000000..19def950 --- /dev/null +++ b/package/gluon-autoupdater/files/usr/lib/autoupdater/abort.d/90gluon-autoupdater @@ -0,0 +1,9 @@ +#!/bin/sh + +. /lib/gluon/autoupdater/lib.sh + + +start_enabled cron +start_enabled haveged +start_enabled micrond +start_enabled sysntpd diff --git a/package/gluon-autoupdater/files/usr/lib/autoupdater/download.d/10gluon-autoupdater b/package/gluon-autoupdater/files/usr/lib/autoupdater/download.d/10gluon-autoupdater new file mode 100755 index 00000000..6f2268fe --- /dev/null +++ b/package/gluon-autoupdater/files/usr/lib/autoupdater/download.d/10gluon-autoupdater @@ -0,0 +1,9 @@ +#!/bin/sh + +. /lib/gluon/autoupdater/lib.sh + + +stop cron +stop haveged +stop micrond +stop sysntpd diff --git a/package/gluon-radvd/files/usr/lib/autoupdater/abort.d/80gluon-radvd b/package/gluon-radvd/files/usr/lib/autoupdater/abort.d/80gluon-radvd new file mode 100755 index 00000000..5784fa5f --- /dev/null +++ b/package/gluon-radvd/files/usr/lib/autoupdater/abort.d/80gluon-radvd @@ -0,0 +1,6 @@ +#!/bin/sh + +. /lib/gluon/autoupdater/lib.sh + + +start_enabled gluon-radvd diff --git a/package/gluon-radvd/files/usr/lib/autoupdater/download.d/20gluon-radvd b/package/gluon-radvd/files/usr/lib/autoupdater/download.d/20gluon-radvd new file mode 100755 index 00000000..ade50616 --- /dev/null +++ b/package/gluon-radvd/files/usr/lib/autoupdater/download.d/20gluon-radvd @@ -0,0 +1,6 @@ +#!/bin/sh + +. /lib/gluon/autoupdater/lib.sh + + +stop gluon-radvd diff --git a/package/gluon-respondd/files/usr/lib/autoupdater/abort.d/50gluon-respondd b/package/gluon-respondd/files/usr/lib/autoupdater/abort.d/50gluon-respondd new file mode 100755 index 00000000..1a5e14e4 --- /dev/null +++ b/package/gluon-respondd/files/usr/lib/autoupdater/abort.d/50gluon-respondd @@ -0,0 +1,7 @@ +#!/bin/sh + +. /lib/gluon/autoupdater/lib.sh + + +start_enabled batman-adv-visdata +start_enabled gluon-respondd diff --git a/package/gluon-respondd/files/usr/lib/autoupdater/download.d/50gluon-respondd b/package/gluon-respondd/files/usr/lib/autoupdater/download.d/50gluon-respondd new file mode 100755 index 00000000..05f56fae --- /dev/null +++ b/package/gluon-respondd/files/usr/lib/autoupdater/download.d/50gluon-respondd @@ -0,0 +1,7 @@ +#!/bin/sh + +. /lib/gluon/autoupdater/lib.sh + + +stop gluon-respondd +stop batman-adv-visdata diff --git a/package/gluon-status-page-api/files/usr/lib/autoupdater/abort.d/70gluon-status-page-api b/package/gluon-status-page-api/files/usr/lib/autoupdater/abort.d/70gluon-status-page-api new file mode 100755 index 00000000..9afbeec5 --- /dev/null +++ b/package/gluon-status-page-api/files/usr/lib/autoupdater/abort.d/70gluon-status-page-api @@ -0,0 +1,7 @@ +#!/bin/sh + +. /lib/gluon/autoupdater/lib.sh + + +start_enabled sse-multiplexd +start_enabled uhttpd diff --git a/package/gluon-status-page-api/files/usr/lib/autoupdater/download.d/30gluon-status-page-api b/package/gluon-status-page-api/files/usr/lib/autoupdater/download.d/30gluon-status-page-api new file mode 100755 index 00000000..7db1d6b7 --- /dev/null +++ b/package/gluon-status-page-api/files/usr/lib/autoupdater/download.d/30gluon-status-page-api @@ -0,0 +1,7 @@ +#!/bin/sh + +. /lib/gluon/autoupdater/lib.sh + + +stop uhttpd +stop sse-multiplexd From 5bb4316f717b498c56bfe4c0fbc5842c9035a20a Mon Sep 17 00:00:00 2001 From: Jan-Philipp Litza Date: Tue, 2 Feb 2016 13:03:41 +0100 Subject: [PATCH 72/99] gluon-neighbour-info: Open firewall on WAN for respondd replies If the query was via multicast, the response isn't matched by --state ESTABLISHED,RELATED This fixes #619 --- package/gluon-neighbour-info/Makefile | 2 ++ .../gluon/upgrade/400-neighbour-info-firewall | 20 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100755 package/gluon-neighbour-info/files/lib/gluon/upgrade/400-neighbour-info-firewall diff --git a/package/gluon-neighbour-info/Makefile b/package/gluon-neighbour-info/Makefile index 74aa6e8f..63586920 100644 --- a/package/gluon-neighbour-info/Makefile +++ b/package/gluon-neighbour-info/Makefile @@ -32,6 +32,8 @@ define Build/Compile endef define Package/gluon-neighbour-info/install + $(CP) ./files/* $(1)/ + $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_BUILD_DIR)/gluon-neighbour-info $(1)/usr/bin/ endef diff --git a/package/gluon-neighbour-info/files/lib/gluon/upgrade/400-neighbour-info-firewall b/package/gluon-neighbour-info/files/lib/gluon/upgrade/400-neighbour-info-firewall new file mode 100755 index 00000000..a6d7f490 --- /dev/null +++ b/package/gluon-neighbour-info/files/lib/gluon/upgrade/400-neighbour-info-firewall @@ -0,0 +1,20 @@ +#!/usr/bin/lua + +local uci = require('luci.model.uci').cursor() + +-- Allow incoming respondd replies to queries on WAN +-- If the query was via multicast, the response isn't matched by --state RELATED +uci:section('firewall', 'rule', 'wan_respondd_reply', + { + name = 'wan_respondd_reply', + src = 'wan', + src_ip = 'fe80::/64', + src_port = '1001', + dest_port = '32768:61000', -- see /proc/sys/net/ipv4/ip_local_port_range + proto = 'udp', + target = 'ACCEPT', + } +) + +uci:save('firewall') +uci:commit('firewall') From 4ab184cd61f3799e1eb3a171c9c3334abd476235 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Litza Date: Tue, 2 Feb 2016 15:13:17 +0100 Subject: [PATCH 73/99] docs: Update regarding respondd refactoring --- docs/releases/v2016.1.rst | 9 +++++++++ docs/site-example/site.mk | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/releases/v2016.1.rst b/docs/releases/v2016.1.rst index 0a67746d..babc0d6e 100644 --- a/docs/releases/v2016.1.rst +++ b/docs/releases/v2016.1.rst @@ -219,6 +219,13 @@ Site changes - ``%GR`` is replaced by the Gluon release (as specified in ``site.mk``) +* ``site.mk`` + + - The packages `gluon-announce` and `gluon-announced` were merged into + the package `gluon-respondd`. If you had any of them (probably + `gluon-announced`) in your package list, you have to replace them. + + * ``i18n/`` - The translations of ``gluon-config-mode:pubkey`` now have to show the fastd @@ -248,6 +255,8 @@ Internals * Some of the Gluon-specific i18n support code in the build system has been removed, as LuCI now provides similar facilities * The C-based `luci-lib-jsonc` library is now used for JSON encoding/decoding instead of the pure Lua `luci-lib-json` +* The site config is now stored as JSON on the node. The Lua interface via ``gluon.site_config`` is still available, and a C interface via the newly added `libgluonutil` was added. +* The `respondd` daemon now uses C modules instead of Lua snippets, which greatly enhances response speed and reduces memory usage. Known Issues ~~~~~~~~~~~~ diff --git a/docs/site-example/site.mk b/docs/site-example/site.mk index 6a16eb53..de8a562a 100644 --- a/docs/site-example/site.mk +++ b/docs/site-example/site.mk @@ -7,7 +7,7 @@ GLUON_SITE_PACKAGES := \ gluon-mesh-batman-adv-15 \ gluon-alfred \ - gluon-announced \ + gluon-respondd \ gluon-autoupdater \ gluon-config-mode-autoupdater \ gluon-config-mode-contact-info \ From d58484c84ecafc9d16895497097561ede9be8c27 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 2 Feb 2016 17:18:08 +0100 Subject: [PATCH 74/99] gluon-mesh-batman-adv-core: respondd: fix pattern to count clients to work with compat 15 --- package/gluon-mesh-batman-adv-core/src/respondd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/gluon-mesh-batman-adv-core/src/respondd.c b/package/gluon-mesh-batman-adv-core/src/respondd.c index cc1c59cc..7ffb94c1 100644 --- a/package/gluon-mesh-batman-adv-core/src/respondd.c +++ b/package/gluon-mesh-batman-adv-core/src/respondd.c @@ -407,9 +407,9 @@ static struct json_object * get_clients(void) { size_t len = 0; while (getline(&line, &len, f) >= 0) { - char addr[18], flags[16]; + char flags[16]; - if (sscanf(line, " * %17[0-9a-fA-F:] [%15[^]]]", addr, flags) != 2) + if (sscanf(line, " * %*[^[] [%15[^]]]", flags) != 1) continue; if (strchr(flags, 'P')) From e8d0fc6a81d1660c40b181e99fa924aa657e38d5 Mon Sep 17 00:00:00 2001 From: kpanic23 Date: Thu, 4 Feb 2016 14:29:01 +0100 Subject: [PATCH 75/99] Corrected some typos and strange grammar --- docs/site-example/i18n/en.po | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/site-example/i18n/en.po b/docs/site-example/i18n/en.po index ac28fea5..13273230 100644 --- a/docs/site-example/i18n/en.po +++ b/docs/site-example/i18n/en.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Project-Id-Version: PACKAGE VERSION\n" -"PO-Revision-Date: 2015-03-19 20:28+0100\n" -"Last-Translator: Matthias Schiffer \n" +"PO-Revision-Date: 2016-02-04 14:28+0100\n" +"Last-Translator: David Lutz \n" "Language-Team: English\n" "Language: en\n" "MIME-Version: 1.0\n" @@ -12,15 +12,15 @@ msgstr "" msgid "gluon-config-mode:welcome" msgstr "" -"Welcome the the setup wizard of your new Freifunk Duckburg node. " -"Please fill out the following form and transmit it." +"Welcome to the setup wizard of your new Freifunk Duckburg node. " +"Please fill out the following form and submit it." msgid "gluon-config-mode:pubkey" msgstr "" "

This is your Freifunk node's public key. The node won't be able to " "connect to the mesh VPN until the key has been registered on the Freifunk " "Duckburg servers. " -"To register the key send it together with your node's name (<%=hostname%>) to " +"To register, send the key together with your node's name (<%=hostname%>) to " "keys@entenhausen.freifunk.net." "

" "
" @@ -33,10 +33,10 @@ msgstr "" msgid "gluon-config-mode:reboot" msgstr "" "

The node is currently rebooting and will try to connect to other " -"nearby Freifunk nodes after that. " -"Your can find lots of information on the Freifunk Duckburg community on " +"nearby Freifunk nodes after that. " +"For more information on the Freifunk Duckburg community, have a look at " "our homepage.

" "

To get back to this configuration interface, press the reset button for " "3 seconds during normal operation. The device will then reboot into config " "mode.

" -"

Have fun with your node and exploring the Freifunk network!

" +"

Have fun with your node and exploring of the Freifunk network!

" From 54bb1431287c79c10e8d6224b3b0a2e669027235 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 5 Feb 2016 06:54:45 +0100 Subject: [PATCH 76/99] docs: releases/v2016.1: grammar fixes, some minor improvements --- docs/releases/v2016.1.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/releases/v2016.1.rst b/docs/releases/v2016.1.rst index babc0d6e..bcfd00b4 100644 --- a/docs/releases/v2016.1.rst +++ b/docs/releases/v2016.1.rst @@ -55,7 +55,7 @@ Kernel module opkg repository ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ We've not been able to keep ABI compatiblity with the kernel of the official OpenWrt images. -Therefore, Gluon now generates a opkg repository with modules itself. +Therefore, Gluon now generates an opkg repository with modules itself. The repository can be found at `output/modules/` by default, the image output directory has been moved from `images/` to `output/images/`. See the updated :doc:`../user/getting_started` guide @@ -74,7 +74,7 @@ nodes to aid with the alignment of antennas. ^^^^^^^^^^^^^^^^^^^^ Gluon now supports using 802.11s for its mesh links instead of IBSS (Adhoc). This will allow supporting -WLAN hardware which can't to AP and IBSS mode simultaneously in the future (like Ralink/Mediatek). +more WLAN hardware in the future (like Ralink/Mediatek, which don't support AP and IBSS mode simultaneously). Note that batman-adv is still used on top of 802.11s (and 802.11s forwarding is disabled), the mesh routing protocol provided by 802.11s is not used. @@ -252,11 +252,13 @@ Internals - gluon-cron -> micrond (the crontabs are now read from ``/usr/lib/micron.d`` instead of ``/lib/gluon/cron``) - gluon-radvd -> uradvd - gluon-simple-tc -> simple-tc (the config file has been renamed as well) + * Some of the Gluon-specific i18n support code in the build system has been removed, as LuCI now provides similar facilities * The C-based `luci-lib-jsonc` library is now used for JSON encoding/decoding instead of the pure Lua `luci-lib-json` -* The site config is now stored as JSON on the node. The Lua interface via ``gluon.site_config`` is still available, and a C interface via the newly added `libgluonutil` was added. -* The `respondd` daemon now uses C modules instead of Lua snippets, which greatly enhances response speed and reduces memory usage. +* The site config is now stored as JSON on the node. The Lua interface``gluon.site_config`` is still available, and a C interface was added as part of the new package `libgluonutil`. +* The `respondd` daemon now uses C modules instead of Lua snippets, which greatly enhances response speed and reduces memory usage. The Gluon integration package has + been renamed from `gluon-announced` to `gluon-respondd`. Known Issues ~~~~~~~~~~~~ From 10d7ad210764e948a84b83dc961640dbad51074b Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 5 Feb 2016 10:40:26 +0100 Subject: [PATCH 77/99] docs: add more documentation of WLAN configuration Fixes #574 --- docs/features/wlan-configuration.rst | 26 ++++++++++++++++++++++++++ docs/index.rst | 1 + 2 files changed, 27 insertions(+) create mode 100644 docs/features/wlan-configuration.rst diff --git a/docs/features/wlan-configuration.rst b/docs/features/wlan-configuration.rst new file mode 100644 index 00000000..ff280eba --- /dev/null +++ b/docs/features/wlan-configuration.rst @@ -0,0 +1,26 @@ +WLAN configuration +================== + +Gluon allows to configure 2.4GHz and 5GHz radios independently. The configuration +may include any or all of the three networks "client" (AP mode), "mesh" (802.11s +mode) and "ibss" (adhoc mode), which can be used simultaneously (using "mesh" and +"ibss" at same time should be avoided though as weaker hardware usually can't handle the additional +load). See :doc:`../user/site` for details on the configuration. + +Upgrade behaviour +----------------- + +For each of these networks, the site configuration may define a `disabled` flag (by +default, all configured networks are enabled). This flag is merely a default setting, +on upgrades the existing setting is always retained (as this setting may have been changed +by the user). This means that is is not possible to enable or disable an existing network +configurations during upgrades. + +For the "mesh" and "ibss" networks, the default setting only has an effect if none +of the two has existed before. If a new configuration has been added for "mesh" or "ibss", +while the other of the two has already existed before, the enabled/disabled state of the +existing configuration will also be set for the new configuration. + +This allows upgrades to change from IBSS to 11s and vice-versa while retaining the +"wireless meshing is enabled/disabled" property configured by the user regardless +of the used mode. diff --git a/docs/index.rst b/docs/index.rst index 7b4d56e7..6ae4f013 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -24,6 +24,7 @@ Features features/configmode features/autoupdater + features/wlan-configuration features/private-wlan features/wired-mesh features/announce From 4d6956fa25db667a3a60b1cbebb2322f65b418f1 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 5 Feb 2016 11:00:38 +0100 Subject: [PATCH 78/99] docs: update outdated monitoring documentation --- .../features/{announce.rst => monitoring.rst} | 101 +++++++----------- docs/index.rst | 2 +- 2 files changed, 39 insertions(+), 64 deletions(-) rename docs/features/{announce.rst => monitoring.rst} (57%) diff --git a/docs/features/announce.rst b/docs/features/monitoring.rst similarity index 57% rename from docs/features/announce.rst rename to docs/features/monitoring.rst index 9e2bf020..3649b3c0 100644 --- a/docs/features/announce.rst +++ b/docs/features/monitoring.rst @@ -1,5 +1,5 @@ -Announcing Node Information -=========================== +Node monitoring +=============== Gluon is capable of announcing information about each node to the mesh and to neighbouring nodes. This allows nodes to learn each others hostname, @@ -8,7 +8,7 @@ IP addresses, location, software versions and various other information. Format of collected data ------------------------ -Information to be announced is currently split into two categories: +Information to be announced is currently split into three categories: nodeinfo In this category (mostly) static information is collected. If @@ -19,8 +19,12 @@ Information to be announced is currently split into two categories: This category holds fast changing data, like traffic counters, uptime, system load or the selected gateway. -Both categories will have a ``node_id`` key by default. It should be used to -match data from *statistics* to *nodeinfo*. + neighbours + `neighbours` contains information about all neighbouring nodes of all + interfaces. This data can be used to determine the network topology. + +All categories will have a ``node_id`` key. It should be used to +relate data of different catagories. Accessing Node Information -------------------------- @@ -43,8 +47,13 @@ installed. Please note that at least one alfred daemon is required to run as .. _alfred-json: https://github.com/tcatm/alfred-json -`nodeinfo` is distributed as alfred datatype `158`, while `statistics` uses -`159`. Both are compressed using GZip (alfred-json can handle the decompression). +The following datatypes are used: + +* `nodeinfo`: 158 +* `statistics`: 159 +* `neighbours`: 160 + +All data is compressed using GZip (alfred-json can handle the decompression). In order to retrieve statistics data you could run: @@ -90,18 +99,26 @@ You can find more information about alfred in its README_. .. _README: http://www.open-mesh.org/projects/alfred/repository/revisions/master/entry/README -gluon-announced -~~~~~~~~~~~~~~~ +gluon-respondd +~~~~~~~~~~~~~~ -`gluon-announced` allows querying neighbouring nodes for their `nodeinfo`. +`gluon-respondd` allows querying neighbouring nodes for their information. It is a daemon listening on the multicast address ``ff02::2:1001`` on -UDP port 1001 on the bare mesh interfaces. +UDP port 1001 on both the bare mesh interfaces and `br-client`. Unicast +requests are supported as well. + +The supported requests are: + +* ``nodeinfo``, ``statistics``, ``neighbours``: Returns the data of single category uncompressed. +* ``GET nodeinfo``, ...: Returns the data of one or multiple categories (separated by spaces) + compressed using the `deflate` algorithm (without a gzip header). The data may + be decompressed using zlib and many zlib bindings using -15 as the window size parameter. gluon-neighbour-info ~~~~~~~~~~~~~~~~~~~~ -A programm called `gluon-neighbour-info` has been developed to retrieve -information from neighbours. +The programm `gluon-neighbour-info` can be used to retrieve +information from other nodes. :: @@ -109,55 +126,13 @@ information from neighbours. -p 1001 -d ff02:0:0:0:0:0:2:1001 \ -r nodeinfo -On optional timeout may be specified, e.g. `-t 5` (default: 3 seconds). +An optional timeout may be specified, e.g. `-t 5` (default: 3 seconds). See +the usage information printed by ``gluon-neighbour-info -h`` for more information +about the supported arguments. -Adding a fact -------------- +Adding a data provider +---------------------- -To add a fact just add a file to either ``/lib/gluon/announce/nodeinfo.d/`` or -``/lib/gluon/announce/statistics.d/``. - -The file must contain a lua script and its name will become the key for the -resulting JSON object. A simple script adding a ``hostname`` field might look -like this: - -:: - - return uci:get_first('system', 'system', 'hostname') - -The directory structure will be converted to a JSON object, i.e. you may -create subdirectories. So, if the directories look like this - -:: - - . - ├── hardware - │   └── model - ├── hostname - ├── network - │   └── mac - ├── node_id - └── software - └── firmware - -the resulting JSON would become: - -:: - - # /lib/gluon/announce/announce.lua nodeinfo - { - "hardware" : { - "model" : "TP-Link TL-MR3420 v1" - }, - "hostname" : "mr3420-test", - "network" : { - "mac" : "90:f6:52:82:06:02" - }, - "node_id" : "90f652820602", - "software" : { - "firmware" : { - "base" : "gluon-v2014.2-32-ge831099", - "release" : "0.4.1+0-exp20140720" - } - } - } +To add a provider, you need to install a shared object into ``/lib/gluon/respondd``. +For more information, refer to the `respondd README `_ +and have a look the existing providers. diff --git a/docs/index.rst b/docs/index.rst index 6ae4f013..feac0979 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -27,7 +27,7 @@ Features features/wlan-configuration features/private-wlan features/wired-mesh - features/announce + features/monitoring features/authorized-keys features/roles From 2f499dbfc1e09a89fc18435aad2bcd9ff955d94d Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 5 Feb 2016 16:59:27 +0100 Subject: [PATCH 79/99] gluon-respondd: restrict queries from the mesh to link-local addresses Restrict to link-local addresses to prevent amplification attacks from outside the mesh, or such attacks affecting the outside world. Fixes #637 --- .../files/lib/gluon/upgrade/400-respondd-firewall | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/package/gluon-respondd/files/lib/gluon/upgrade/400-respondd-firewall b/package/gluon-respondd/files/lib/gluon/upgrade/400-respondd-firewall index 65c5d8e3..c5076830 100755 --- a/package/gluon-respondd/files/lib/gluon/upgrade/400-respondd-firewall +++ b/package/gluon-respondd/files/lib/gluon/upgrade/400-respondd-firewall @@ -16,5 +16,17 @@ uci:section('firewall', 'rule', 'wan_respondd', } ) +-- Restrict respondd queries to link-local addresses to prevent amplification attacks from outside +uci:section('firewall', 'rule', 'client_respondd', + { + name = 'client_respondd', + src = 'client', + src_ip = '!fe80::/64', + dest_port = '1001', + proto = 'udp', + target = 'REJECT', + } +) + uci:save('firewall') uci:commit('firewall') From 145cb4ded2834a4c36a4ce077611e73a394fc3d2 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 5 Feb 2016 18:31:25 +0100 Subject: [PATCH 80/99] gluon-luci-admin: ensure that the authorized_keys file always ends with a newline Fixes #558 --- .../files/usr/lib/lua/luci/model/cbi/admin/remote.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/gluon-luci-admin/files/usr/lib/lua/luci/model/cbi/admin/remote.lua b/package/gluon-luci-admin/files/usr/lib/lua/luci/model/cbi/admin/remote.lua index 13840542..c79c0195 100644 --- a/package/gluon-luci-admin/files/usr/lib/lua/luci/model/cbi/admin/remote.lua +++ b/package/gluon-luci-admin/files/usr/lib/lua/luci/model/cbi/admin/remote.lua @@ -44,7 +44,7 @@ if fs.access("/etc/config/dropbear") then function keys.write(self, section, value) if value then - fs.writefile("/etc/dropbear/authorized_keys", value:gsub("\r\n", "\n")) + fs.writefile("/etc/dropbear/authorized_keys", value:gsub("\r\n", "\n"):trim() .. "\n") end end From 495e154a6a9da9c6cefd16a020ecd1c0c2b9a8f1 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 5 Feb 2016 18:45:37 +0100 Subject: [PATCH 81/99] docs, LICENSE: fix upper and lower case of "OpenWrt" --- LICENSE | 2 +- docs/user/getting_started.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index c6bfdbea..81ed5a23 100644 --- a/LICENSE +++ b/LICENSE @@ -25,7 +25,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -OpenWRT is licensed under the terms of the GNU General Public License Version 2, +OpenWrt is licensed under the terms of the GNU General Public License Version 2, which can be found under openwrt/LICENSE after the openwrt submodule has been obtained. This applies to the following submodules: * openwrt diff --git a/docs/user/getting_started.rst b/docs/user/getting_started.rst index d1e7d254..dbd1ed8d 100644 --- a/docs/user/getting_started.rst +++ b/docs/user/getting_started.rst @@ -92,7 +92,7 @@ To see a complete list of supported targets, call ``make`` without setting ``GLU The built images can be found in the directory `output/images`. Of these, the factory images are to be used when flashing from the original firmware a device came with, -and sysupgrade is to upgrade from other versions of Gluon or any other OpenWRT-based +and sysupgrade is to upgrade from other versions of Gluon or any other OpenWrt-based system. You should reserve about 10GB of disk space for each `GLUON_TARGET`. From 8bfb5fe1020facf13577a0ec9f80b8df4e054b5f Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 5 Feb 2016 19:02:49 +0100 Subject: [PATCH 82/99] docs: add information about image symlinks to the Getting Started page --- docs/user/getting_started.rst | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/user/getting_started.rst b/docs/user/getting_started.rst index dbd1ed8d..6180364f 100644 --- a/docs/user/getting_started.rst +++ b/docs/user/getting_started.rst @@ -90,12 +90,21 @@ In case of errors read the messages carefully and try to fix the stated issues ( ``ar71xx-generic`` is the most common target and will generate images for most of the supported hardware. To see a complete list of supported targets, call ``make`` without setting ``GLUON_TARGET``. -The built images can be found in the directory `output/images`. Of these, the factory +You should reserve about 10GB of disk space for each `GLUON_TARGET`. + +The built images can be found in the directory `output/images`. Of these, the `factory` images are to be used when flashing from the original firmware a device came with, -and sysupgrade is to upgrade from other versions of Gluon or any other OpenWrt-based +and `sysupgrade` is to upgrade from other versions of Gluon or any other OpenWrt-based system. -You should reserve about 10GB of disk space for each `GLUON_TARGET`. +**Note:** The images for some models are identical; to save disk space, symlinks are generated instead +of multiple copies of the same image. If your webserver's configuration prohibits following +symlinks, you can use the following command to resolve these links while copying the images:: + + cp -rL output/images /var/www + +Cleaning the build tree +....................... There are two levels of `make clean`:: From 10f7a88ba92c0a06640892436d0c7d79c83b9b5f Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 6 Feb 2016 07:39:51 +0100 Subject: [PATCH 83/99] Backport fix for CVE-2016-0728 (local root exploit) We're too close to the release of Gluon 2016.1 to do a full update of our OpenWrt tree, therefore just make a backport of this. --- ...keyring-reference-leak-CVE-2016-0728.patch | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 patches/openwrt/0048-kernel-fix-keyring-reference-leak-CVE-2016-0728.patch diff --git a/patches/openwrt/0048-kernel-fix-keyring-reference-leak-CVE-2016-0728.patch b/patches/openwrt/0048-kernel-fix-keyring-reference-leak-CVE-2016-0728.patch new file mode 100644 index 00000000..406be868 --- /dev/null +++ b/patches/openwrt/0048-kernel-fix-keyring-reference-leak-CVE-2016-0728.patch @@ -0,0 +1,87 @@ +From: Matthias Schiffer +Date: Sat, 6 Feb 2016 07:35:33 +0100 +Subject: kernel: fix keyring reference leak (CVE-2016-0728) + +Signed-off-by: Felix Fietkau + +diff --git a/target/linux/generic/patches-3.18/010-KEYS-Fix-keyring-ref-leak-in-join_session_keyring.patch b/target/linux/generic/patches-3.18/010-KEYS-Fix-keyring-ref-leak-in-join_session_keyring.patch +new file mode 100644 +index 0000000..9c6a969 +--- /dev/null ++++ b/target/linux/generic/patches-3.18/010-KEYS-Fix-keyring-ref-leak-in-join_session_keyring.patch +@@ -0,0 +1,75 @@ ++From 7ca88764d45c209791e8813131c1457c2e9e51e7 Mon Sep 17 00:00:00 2001 ++From: Yevgeny Pats ++Date: Mon, 11 Jan 2016 12:05:28 +0000 ++Subject: KEYS: Fix keyring ref leak in join_session_keyring() ++ ++If a thread is asked to join as a session keyring the keyring that's already ++set as its session, we leak a keyring reference. ++ ++This can be tested with the following program: ++ ++ #include ++ #include ++ #include ++ #include ++ ++ int main(int argc, const char *argv[]) ++ { ++ int i = 0; ++ key_serial_t serial; ++ ++ serial = keyctl(KEYCTL_JOIN_SESSION_KEYRING, ++ "leaked-keyring"); ++ if (serial < 0) { ++ perror("keyctl"); ++ return -1; ++ } ++ ++ if (keyctl(KEYCTL_SETPERM, serial, ++ KEY_POS_ALL | KEY_USR_ALL) < 0) { ++ perror("keyctl"); ++ return -1; ++ } ++ ++ for (i = 0; i < 100; i++) { ++ serial = keyctl(KEYCTL_JOIN_SESSION_KEYRING, ++ "leaked-keyring"); ++ if (serial < 0) { ++ perror("keyctl"); ++ return -1; ++ } ++ } ++ ++ return 0; ++ } ++ ++If, after the program has run, there something like the following line in ++/proc/keys: ++ ++3f3d898f I--Q--- 100 perm 3f3f0000 0 0 keyring leaked-keyring: empty ++ ++with a usage count of 100 * the number of times the program has been run, ++then the kernel is malfunctioning. If leaked-keyring has zero usages or ++has been garbage collected, then the problem is fixed. ++ ++Reported-by: Yevgeny Pats ++Signed-off-by: David Howells ++--- ++ security/keys/process_keys.c | 1 + ++ 1 file changed, 1 insertion(+) ++ ++diff --git a/security/keys/process_keys.c b/security/keys/process_keys.c ++index a3f85d2..e6d50172 100644 ++--- a/security/keys/process_keys.c +++++ b/security/keys/process_keys.c ++@@ -794,6 +794,7 @@ long join_session_keyring(const char *name) ++ ret = PTR_ERR(keyring); ++ goto error2; ++ } else if (keyring == new->session_keyring) { +++ key_put(keyring); ++ ret = 0; ++ goto error2; ++ } ++-- ++2.7.0.rc3 ++ From 627e6b7b8185169206b98c5fc2f6b828db6485f7 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 7 Feb 2016 11:23:41 +0100 Subject: [PATCH 84/99] docs: user/site: change peer limit in example fastd config to 1 Change the limit to match our recommendation in the site-example. --- docs/user/site.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user/site.rst b/docs/user/site.rst index 49cc303a..b26a28a1 100644 --- a/docs/user/site.rst +++ b/docs/user/site.rst @@ -177,7 +177,7 @@ fastd_mesh_vpn groups = { backbone = { -- Limit number of connected peers from this group - limit = 2, + limit = 1, peers = { peer1 = { key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', From f8b328835bb240a058278fd74db9de216c121467 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 7 Feb 2016 21:42:04 +0100 Subject: [PATCH 85/99] docs: features/monitoring: replace one last mention of gluon-announced --- docs/features/monitoring.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features/monitoring.rst b/docs/features/monitoring.rst index 3649b3c0..f3d0382d 100644 --- a/docs/features/monitoring.rst +++ b/docs/features/monitoring.rst @@ -31,7 +31,7 @@ Accessing Node Information There are two packages responsible for distribution of the information. For one, information is distributed across the mesh using alfred_. Information -between neighbouring nodes is exchanged using `gluon-announced`. +between neighbouring nodes is exchanged using `gluon-respondd`. .. _alfred: http://www.open-mesh.org/projects/alfred From b8791e08293ab5671da4e8254e10dcdc4623b05e Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 8 Feb 2016 10:22:46 +0100 Subject: [PATCH 86/99] docs: releases/v2016.1: fix a formatting issue --- docs/releases/v2016.1.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/releases/v2016.1.rst b/docs/releases/v2016.1.rst index bcfd00b4..426def3d 100644 --- a/docs/releases/v2016.1.rst +++ b/docs/releases/v2016.1.rst @@ -256,7 +256,7 @@ Internals * Some of the Gluon-specific i18n support code in the build system has been removed, as LuCI now provides similar facilities * The C-based `luci-lib-jsonc` library is now used for JSON encoding/decoding instead of the pure Lua `luci-lib-json` -* The site config is now stored as JSON on the node. The Lua interface``gluon.site_config`` is still available, and a C interface was added as part of the new package `libgluonutil`. +* The site config is now stored as JSON on the node. The Lua interface ``gluon.site_config`` is still available, and a C interface was added as part of the new package `libgluonutil`. * The `respondd` daemon now uses C modules instead of Lua snippets, which greatly enhances response speed and reduces memory usage. The Gluon integration package has been renamed from `gluon-announced` to `gluon-respondd`. From 55dc9c369d763f4b359070b2628efe46d983e0ec Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 8 Feb 2016 10:46:28 +0100 Subject: [PATCH 87/99] docs, README: change current release to v2016.1 --- README.md | 2 +- docs/conf.py | 4 ++-- docs/releases/v2016.1.rst | 4 ++-- docs/site-example/site.conf | 2 +- docs/user/getting_started.rst | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 4bda1a17..b20fe40f 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ our mailinglist to discuss it first. Please refrain from using the `master` branch for anything else but development purposes! Use the most recent release instead. You can list all relaseses by running `git branch -a` -and switch to one by running `git checkout v2015.1 && make update`. +and switch to one by running `git checkout v2016.1 && make update`. If you're using the autoupdater, do not autoupdate nodes with anything but releases. If you upgrade using random master commits the nodes *will break* eventually. diff --git a/docs/conf.py b/docs/conf.py index 090de523..66b907ea 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -54,9 +54,9 @@ copyright = '2015, Project Gluon' # built documents. # # The short X.Y version. -version = '2015.1+' +version = '2016.1' # The full version, including alpha/beta/rc tags. -release = '2015.1+' +release = '2016.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/releases/v2016.1.rst b/docs/releases/v2016.1.rst index 426def3d..5a42a1eb 100644 --- a/docs/releases/v2016.1.rst +++ b/docs/releases/v2016.1.rst @@ -1,5 +1,5 @@ -Gluon 2016.1 (in development) -============================= +Gluon 2016.1 +============ Added hardware support ~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/site-example/site.conf b/docs/site-example/site.conf index 8ebb79ba..d9c3cbe4 100644 --- a/docs/site-example/site.conf +++ b/docs/site-example/site.conf @@ -1,4 +1,4 @@ --- This is an example site configuration for Gluon v2015.1+ +-- This is an example site configuration for Gluon v2016.1 -- -- Take a look at the documentation located at -- http://gluon.readthedocs.org/ for details. diff --git a/docs/user/getting_started.rst b/docs/user/getting_started.rst index 6180364f..f10f9acf 100644 --- a/docs/user/getting_started.rst +++ b/docs/user/getting_started.rst @@ -8,7 +8,7 @@ Gluon's releases are managed using `Git tags`_. If you are just getting started with Gluon we recommend to use the latest stable release of Gluon. Take a look at the `list of gluon releases`_ and notice the latest release, -e.g. *v2014.3*. Always get Gluon using git and don't try to download it +e.g. *v2016.1*. Always get Gluon using git and don't try to download it as a Zip archive as the archive will be missing version information. Please keep in mind that there is no "default Gluon" build; a site configuration @@ -42,7 +42,7 @@ Building the images ------------------- To build Gluon, first check out the repository. Replace *RELEASE* with the -version you'd like to checkout, e.g. *v2015.1*. +version you'd like to checkout, e.g. *v2016.1*. :: From e021af7cb5b655f265a23d74ca30136ac200cfc9 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 8 Feb 2016 10:49:06 +0100 Subject: [PATCH 88/99] docs: change version to v2016.1+ --- docs/conf.py | 4 ++-- docs/site-example/site.conf | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 66b907ea..1f634eb2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -54,9 +54,9 @@ copyright = '2015, Project Gluon' # built documents. # # The short X.Y version. -version = '2016.1' +version = '2016.1+' # The full version, including alpha/beta/rc tags. -release = '2016.1' +release = '2016.1+' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/site-example/site.conf b/docs/site-example/site.conf index d9c3cbe4..acabadb2 100644 --- a/docs/site-example/site.conf +++ b/docs/site-example/site.conf @@ -1,4 +1,4 @@ --- This is an example site configuration for Gluon v2016.1 +-- This is an example site configuration for Gluon v2016.1+ -- -- Take a look at the documentation located at -- http://gluon.readthedocs.org/ for details. From d45b2def4008b7b32a4849d03f621dff65e5faf6 Mon Sep 17 00:00:00 2001 From: Felix Kaechele Date: Mon, 8 Feb 2016 14:16:11 +0100 Subject: [PATCH 89/99] backport: Futro support in x86-generic Signed-off-by: Felix Kaechele --- ...49-x86-generic-refresh-kernel-config.patch | 48 +++++++++++++++++++ ...86-generic-enable-pata_atiixp-driver.patch | 22 +++++++++ 2 files changed, 70 insertions(+) create mode 100644 patches/openwrt/0049-x86-generic-refresh-kernel-config.patch create mode 100644 patches/openwrt/0050-x86-generic-enable-pata_atiixp-driver.patch diff --git a/patches/openwrt/0049-x86-generic-refresh-kernel-config.patch b/patches/openwrt/0049-x86-generic-refresh-kernel-config.patch new file mode 100644 index 00000000..a650e115 --- /dev/null +++ b/patches/openwrt/0049-x86-generic-refresh-kernel-config.patch @@ -0,0 +1,48 @@ +From: Felix Kaechele +Date: Tue, 17 Nov 2015 05:00:02 +0100 +Subject: x86/generic: refresh kernel config + +Signed-off-by: Felix Kaechele + +diff --git a/target/linux/x86/generic/config-default b/target/linux/x86/generic/config-default +index eb4b357..e077ebd 100644 +--- a/target/linux/x86/generic/config-default ++++ b/target/linux/x86/generic/config-default +@@ -17,7 +17,6 @@ CONFIG_ACPI_LEGACY_TABLES_LOOKUP=y + CONFIG_ACPI_PROCESSOR=y + # CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set + # CONFIG_ACPI_PROCFS_POWER is not set +-# CONFIG_ACPI_REDUCED_HARDWARE_ONLY is not set + # CONFIG_ACPI_SBS is not set + CONFIG_ACPI_THERMAL=y + CONFIG_ACPI_VIDEO=y +@@ -46,7 +45,6 @@ CONFIG_BACKLIGHT_LCD_SUPPORT=y + CONFIG_BLK_DEV_SR=y + # CONFIG_BLK_DEV_SR_VENDOR is not set + CONFIG_CPU_IDLE_GOV_MENU=y +-# CONFIG_DELL_SMO8800 is not set + CONFIG_DMA_SHARED_BUFFER=y + CONFIG_DMI=y + # CONFIG_DMIID is not set +@@ -120,7 +118,6 @@ CONFIG_INPUT_MOUSEDEV=y + CONFIG_INPUT_MOUSEDEV_PSAUX=y + CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 + CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 +-# CONFIG_INT340X_THERMAL is not set + CONFIG_INTEL_GTT=y + CONFIG_INTEL_IDLE=y + # CONFIG_INTEL_IPS is not set +@@ -173,13 +170,10 @@ CONFIG_PNP_DEBUG_MESSAGES=y + CONFIG_RAS=y + # CONFIG_SAMSUNG_Q10 is not set + CONFIG_SATA_AHCI=y +-# CONFIG_SCx200_ACB is not set +-# CONFIG_SERIAL_8250_FINTEK is not set + CONFIG_SERIAL_8250_PNP=y + # CONFIG_THINKPAD_ACPI is not set + # CONFIG_TOPSTAR_LAPTOP is not set + # CONFIG_TOSHIBA_BT_RFKILL is not set +-# CONFIG_TOSHIBA_HAPS is not set + CONFIG_USB=y + CONFIG_USB_COMMON=y + CONFIG_USB_EHCI_HCD=y diff --git a/patches/openwrt/0050-x86-generic-enable-pata_atiixp-driver.patch b/patches/openwrt/0050-x86-generic-enable-pata_atiixp-driver.patch new file mode 100644 index 00000000..6a489761 --- /dev/null +++ b/patches/openwrt/0050-x86-generic-enable-pata_atiixp-driver.patch @@ -0,0 +1,22 @@ +From: Felix Kaechele +Date: Tue, 17 Nov 2015 05:00:51 +0100 +Subject: x86/generic: enable pata_atiixp driver + +This enables booting from devices that use an ATI PATA controller for +the boot device, such as the embedded CF cards in Fujitsu-Siemens Futro +thin-clients. + +Signed-off-by: Felix Kaechele + +diff --git a/target/linux/x86/generic/config-default b/target/linux/x86/generic/config-default +index e077ebd..666a985 100644 +--- a/target/linux/x86/generic/config-default ++++ b/target/linux/x86/generic/config-default +@@ -150,6 +150,7 @@ CONFIG_NLS=y + CONFIG_NO_HZ=y + # CONFIG_PANASONIC_LAPTOP is not set + CONFIG_PATA_AMD=y ++CONFIG_PATA_ATIIXP=y + CONFIG_PATA_LEGACY=y + CONFIG_PATA_MPIIX=y + CONFIG_PATA_OLDPIIX=y From 43ceba8cb99dff243e21fb23ae2cda8e7e163956 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 8 Feb 2016 18:38:36 +0100 Subject: [PATCH 90/99] Update OpenWrt base --- modules | 2 +- ...-mac80211-backport-from-trunk-r47249.patch | 7265 +++++++++++++++-- ...d-support-for-tp-link-wr740n-v5.0-EU.patch | 2 +- ...ar71xx-add-support-for-TL-WR741ND-v5.patch | 2 +- .../0011-brcm2708-Implement-sysupgrade.patch | 87 - ...11-sunxi-fix-uboot-install-location.patch} | 0 ...i-respect-CONFIG_TARGET_IMAGES_GZIP.patch} | 0 ...urcefilter-to-disable-source-filter.patch} | 0 ...cast-rate-for-mesh-point-interfaces.patch} | 0 ...d_detect-for-some-NETGEAR-WNDR3700v2.patch | 26 - ...apd-prevent-channel-switch-for-5GHz.patch} | 0 ...-Link-TL-WR841N-ND-v9-Compex-WPJ531.patch} | 0 ...r71xx-rework-patch-for-qca953x-956x.patch} | 148 +- ...agate-the-real-postinst-return-code.patch} | 0 ...itional-libopenssl-build-dependency.patch} | 0 ...itional-libopenssl-build-dependency.patch} | 0 ...s.patch => 0021-odhcp6c-minor-fixes.patch} | 0 ...uner-support-for-UniFi-Outdoor-Plus.patch} | 0 ...ase-files-add-etc-profile.d-support.patch} | 2 +- ...52-based-USB-to-Ethernet-converters.patch} | 0 ...support-for-TP-LINK-TL-WR841N-ND-v10.patch | 31 - ...ils-tplink-safeloader-clean-up-code.patch} | 0 ...-format-clean-up-vendor-information.patch} | 0 ...n-1.1-support-to-CPE210-220-510-520.patch} | 0 ...s-with-prohibited-blackholed-source.patch} | 0 ...h-11s-VIF-together-with-another-VIF.patch} | 0 ...ty-firmware-as-an-additional-choice.patch} | 0 ...h79_soc_rev-value-for-QCA9531-ver.-2.patch | 181 - ...-add-correct-MAC-BB-name-for-ar9561.patch} | 0 ...TL-WR941ND-v6-international-version.patch} | 10 +- ...-support-for-TP-Link-TL-WR1043ND-v3.patch} | 2 +- ...th10k-calibration-data-load-changes.patch} | 0 ...x-AR71XX_MODEL-on-TP-Link-TL-WR703N.patch} | 4 +- ...d-compile-failure-on-mipsel-targets.patch} | 0 ...-Added-source-old-to-PKG_SOURCE_URL.patch} | 4 +- ...tallation-of-headers-for-host-build.patch} | 0 ...alloc-instead-of-oom-kill-processes.patch} | 0 ...ct-for-some-NETGEAR-WNDR3700v2-again.patch | 46 - ...0-x86-generic-refresh-kernel-config.patch} | 0 ...CC-base-files-add-missing-public-key.patch | 17 - ...6-generic-enable-pata_atiixp-driver.patch} | 0 ...tall-rule-to-install-libbz2.so-files.patch | 23 - ...another-fix-to-wndr3700_board_detect.patch | 29 - ...keyring-reference-leak-CVE-2016-0728.patch | 87 - 44 files changed, 6704 insertions(+), 1264 deletions(-) delete mode 100644 patches/openwrt/0011-brcm2708-Implement-sysupgrade.patch rename patches/openwrt/{0012-sunxi-fix-uboot-install-location.patch => 0011-sunxi-fix-uboot-install-location.patch} (100%) rename patches/openwrt/{0013-sunxi-respect-CONFIG_TARGET_IMAGES_GZIP.patch => 0012-sunxi-respect-CONFIG_TARGET_IMAGES_GZIP.patch} (100%) rename patches/openwrt/{0014-odhcp6c-add-option-sourcefilter-to-disable-source-filter.patch => 0013-odhcp6c-add-option-sourcefilter-to-disable-source-filter.patch} (100%) rename patches/openwrt/{0016-mac80211-set-mcast-rate-for-mesh-point-interfaces.patch => 0014-mac80211-set-mcast-rate-for-mesh-point-interfaces.patch} (100%) delete mode 100644 patches/openwrt/0015-ar71xx-fix-wndr3700_board_detect-for-some-NETGEAR-WNDR3700v2.patch rename patches/openwrt/{0017-hostapd-prevent-channel-switch-for-5GHz.patch => 0015-hostapd-prevent-channel-switch-for-5GHz.patch} (100%) rename patches/openwrt/{0018-ar71xx-fix-ethernet-initialization-on-QCA953x-based-boards-TP-Link-TL-WR841N-ND-v9-Compex-WPJ531.patch => 0016-ar71xx-fix-ethernet-initialization-on-QCA953x-based-boards-TP-Link-TL-WR841N-ND-v9-Compex-WPJ531.patch} (100%) rename patches/openwrt/{0019-ar71xx-rework-patch-for-qca953x-956x.patch => 0017-ar71xx-rework-patch-for-qca953x-956x.patch} (84%) rename patches/openwrt/{0020-base-files-default_postinst-propagate-the-real-postinst-return-code.patch => 0018-base-files-default_postinst-propagate-the-real-postinst-return-code.patch} (100%) rename patches/openwrt/{0021-opkg-work-around-unconditional-libopenssl-build-dependency.patch => 0019-opkg-work-around-unconditional-libopenssl-build-dependency.patch} (100%) rename patches/openwrt/{0022-hostapd-work-around-unconditional-libopenssl-build-dependency.patch => 0020-hostapd-work-around-unconditional-libopenssl-build-dependency.patch} (100%) rename patches/openwrt/{0023-odhcp6c-minor-fixes.patch => 0021-odhcp6c-minor-fixes.patch} (100%) rename patches/openwrt/{0024-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch => 0022-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch} (100%) rename patches/openwrt/{0026-base-files-add-etc-profile.d-support.patch => 0023-base-files-add-etc-profile.d-support.patch} (98%) rename patches/openwrt/{0027-Kernel-Realtek-8150-and-Realtek-8152-based-USB-to-Ethernet-converters.patch => 0024-Kernel-Realtek-8150-and-Realtek-8152-based-USB-to-Ethernet-converters.patch} (100%) delete mode 100644 patches/openwrt/0025-ar71xx-add-support-for-TP-LINK-TL-WR841N-ND-v10.patch rename patches/openwrt/{0028-tools-firmware-utils-tplink-safeloader-clean-up-code.patch => 0025-tools-firmware-utils-tplink-safeloader-clean-up-code.patch} (100%) rename patches/openwrt/{0029-tools-firmware-utils-tplink-safeloader-fix-support-list-format-clean-up-vendor-information.patch => 0026-tools-firmware-utils-tplink-safeloader-fix-support-list-format-clean-up-vendor-information.patch} (100%) rename patches/openwrt/{0030-tools-firmware-utils-tplink-safeloader-add-version-1.1-support-to-CPE210-220-510-520.patch => 0027-tools-firmware-utils-tplink-safeloader-add-version-1.1-support-to-CPE210-220-510-520.patch} (100%) rename patches/openwrt/{0032-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch => 0028-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch} (100%) rename patches/openwrt/{0033-mac80211-fix-crash-when-using-mesh-11s-VIF-together-with-another-VIF.patch => 0029-mac80211-fix-crash-when-using-mesh-11s-VIF-together-with-another-VIF.patch} (100%) rename patches/openwrt/{0034-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch => 0030-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch} (100%) delete mode 100644 patches/openwrt/0031-ar71xx-fix-ath79_soc_rev-value-for-QCA9531-ver.-2.patch rename patches/openwrt/{0035-mac80211-ath9k-add-correct-MAC-BB-name-for-ar9561.patch => 0031-mac80211-ath9k-add-correct-MAC-BB-name-for-ar9561.patch} (100%) rename patches/openwrt/{0036-ar71xx-add-support-for-TP-LINK-TL-WR941ND-v6-international-version.patch => 0032-ar71xx-add-support-for-TP-LINK-TL-WR941ND-v6-international-version.patch} (98%) rename patches/openwrt/{0037-ar71xx-add-support-for-TP-Link-TL-WR1043ND-v3.patch => 0033-ar71xx-add-support-for-TP-Link-TL-WR1043ND-v3.patch} (98%) rename patches/openwrt/{0038-ar71xx-backport-ath10k-calibration-data-load-changes.patch => 0034-ar71xx-backport-ath10k-calibration-data-load-changes.patch} (100%) rename patches/openwrt/{0039-ar71xx-fix-AR71XX_MODEL-on-TP-Link-TL-WR703N.patch => 0035-ar71xx-fix-AR71XX_MODEL-on-TP-Link-TL-WR703N.patch} (88%) rename patches/openwrt/{0042-acx-mac80211-mark-as-BROKEN-to-avoid-compile-failure-on-mipsel-targets.patch => 0036-acx-mac80211-mark-as-BROKEN-to-avoid-compile-failure-on-mipsel-targets.patch} (100%) rename patches/openwrt/{0043-OpenSSL-Added-source-old-to-PKG_SOURCE_URL.patch => 0037-OpenSSL-Added-source-old-to-PKG_SOURCE_URL.patch} (92%) rename patches/openwrt/{0046-lua-fix-installation-of-headers-for-host-build.patch => 0038-lua-fix-installation-of-headers-for-host-build.patch} (100%) rename patches/openwrt/{0047-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch => 0039-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch} (100%) delete mode 100644 patches/openwrt/0040-ar71xx-fix-wndr3700_board_detect-for-some-NETGEAR-WNDR3700v2-again.patch rename patches/openwrt/{0049-x86-generic-refresh-kernel-config.patch => 0040-x86-generic-refresh-kernel-config.patch} (100%) delete mode 100644 patches/openwrt/0041-CC-base-files-add-missing-public-key.patch rename patches/openwrt/{0050-x86-generic-enable-pata_atiixp-driver.patch => 0041-x86-generic-enable-pata_atiixp-driver.patch} (100%) delete mode 100644 patches/openwrt/0044-Revert-bzip2-extend-fix-the-Host-Install-rule-to-install-libbz2.so-files.patch delete mode 100644 patches/openwrt/0045-ar71xx-another-fix-to-wndr3700_board_detect.patch delete mode 100644 patches/openwrt/0048-kernel-fix-keyring-reference-leak-CVE-2016-0728.patch diff --git a/modules b/modules index ad6d44b5..f7b1af47 100644 --- a/modules +++ b/modules @@ -1,7 +1,7 @@ GLUON_FEEDS='openwrt gluon routing luci' OPENWRT_REPO=git://git.openwrt.org/15.05/openwrt.git -OPENWRT_COMMIT=363508bcabd8e9205f5fffc8ff282439e61d618f +OPENWRT_COMMIT=c698aa66043a151ac76d19849be9ee24dfd78b72 PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git PACKAGES_OPENWRT_COMMIT=f8a70fc188673d0ae8739b0a3095f7f61335fc10 diff --git a/patches/openwrt/0006-mac80211-backport-from-trunk-r47249.patch b/patches/openwrt/0006-mac80211-backport-from-trunk-r47249.patch index 2f8fb79b..5f6e2ad0 100644 --- a/patches/openwrt/0006-mac80211-backport-from-trunk-r47249.patch +++ b/patches/openwrt/0006-mac80211-backport-from-trunk-r47249.patch @@ -3174,7 +3174,7 @@ index a1eedce..566e156 100644 $(eval $(call KernelPackage,wl18xx)) +$(eval $(call KernelPackage,zd1211rw)) diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh -index c9bc3d6..2a8d2f9 100644 +index 2852f3e..2a8d2f9 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -486,7 +486,7 @@ mac80211_prepare_vif() { @@ -3186,7 +3186,17 @@ index c9bc3d6..2a8d2f9 100644 fi json_select .. -@@ -582,7 +582,7 @@ mac80211_setup_vif() { +@@ -525,9 +525,6 @@ mac80211_setup_adhoc_htmode() { + esac + [ "$auto_channel" -gt 0 ] && ibss_htmode="HT40+" + ;; +- NONE|NOHT) +- ibss_htmode="NOHT" +- ;; + *) ibss_htmode="" ;; + esac + +@@ -585,7 +582,7 @@ mac80211_setup_vif() { json_get_vars mode json_get_var vif_txpower txpower @@ -3195,7 +3205,7 @@ index c9bc3d6..2a8d2f9 100644 wireless_setup_vif_failed IFUP_ERROR json_select .. return -@@ -638,7 +638,7 @@ mac80211_interface_cleanup() { +@@ -641,7 +638,7 @@ mac80211_interface_cleanup() { local phy="$1" for wdev in $(list_phy_interfaces "$phy"); do @@ -3205,287 +3215,514 @@ index c9bc3d6..2a8d2f9 100644 done } diff --git a/package/kernel/mac80211/files/regdb.txt b/package/kernel/mac80211/files/regdb.txt -index ba95fc6..84413fd 100644 +index 463ace3..84413fd 100644 --- a/package/kernel/mac80211/files/regdb.txt +++ b/package/kernel/mac80211/files/regdb.txt -@@ -6,7 +6,7 @@ country 00: +@@ -2,7 +2,7 @@ + country 00: + (2402 - 2472 @ 40), (20) + # Channel 12 - 13. +- (2457 - 2482 @ 20), (20), NO-IR, AUTO-BW ++ (2457 - 2482 @ 40), (20), NO-IR # Channel 14. Only JP enables this and for 802.11b only (2474 - 2494 @ 20), (20), NO-IR, NO-OFDM # Channel 36 - 48 -- (5170 - 5250 @ 80), (20) -+ (5170 - 5250 @ 80), (20), AUTO-BW - # Channel 52 - 64 - (5250 - 5330 @ 80), (20), NO-IR, DFS, AUTO-BW - # Channel 100 - 144 -@@ -54,8 +54,8 @@ country AL: DFS-ETSI - - country AM: DFS-ETSI - (2402 - 2482 @ 40), (20) -- (5170 - 5250 @ 80), (18) -- (5250 - 5330 @ 80), (18), DFS -+ (5170 - 5250 @ 20), (18) -+ (5250 - 5330 @ 20), (18), DFS - - country AN: DFS-ETSI - (2402 - 2482 @ 40), (20) -@@ -85,7 +85,7 @@ country AT: DFS-ETSI - # 60 gHz band channels 1-4, ref: Etsi En 302 567 +@@ -22,7 +22,7 @@ country AD: + (5170 - 5250 @ 80), (20) + (5250 - 5330 @ 80), (20), DFS + (5490 - 5710 @ 80), (27), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 (57000 - 66000 @ 2160), (40) --country AU: -+country AU: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW -@@ -141,14 +141,20 @@ country BG: DFS-ETSI + country AE: DFS-FCC +@@ -82,7 +82,7 @@ country AT: DFS-ETSI (5170 - 5250 @ 80), (20), AUTO-BW (5250 - 5330 @ 80), (20), DFS, AUTO-BW (5490 - 5710 @ 160), (27), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + + country AU: DFS-ETSI +@@ -108,7 +108,7 @@ country BA: DFS-ETSI + (5170 - 5250 @ 80), (20), AUTO-BW + (5250 - 5330 @ 80), (20), DFS, AUTO-BW + (5490 - 5710 @ 160), (27), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + + country BB: DFS-FCC +@@ -126,7 +126,7 @@ country BE: DFS-ETSI + (5170 - 5250 @ 80), (20), AUTO-BW + (5250 - 5330 @ 80), (20), DFS, AUTO-BW + (5490 - 5710 @ 160), (27), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + + country BF: DFS-FCC +@@ -141,13 +141,13 @@ country BG: DFS-ETSI + (5170 - 5250 @ 80), (20), AUTO-BW + (5250 - 5330 @ 80), (20), DFS, AUTO-BW + (5490 - 5710 @ 160), (27), DFS +- # 5 GHz Short Range Devices, ref: + # 5 gHz Short Range Devices, ref: -+ # Etsi EN 300 440-1 -+ # Etsi EN 300 440-2 -+ # http://crc.bg/files/_bg/Spisak_2015.pdf -+ # http://crc.bg/files/_bg/Pravila_2015_resh24.pdf -+ (5725 - 5875 @ 80), (14) - # 60 gHz band channels 1-4, ref: Etsi En 302 567 + # Etsi EN 300 440-1 + # Etsi EN 300 440-2 + # http://crc.bg/files/_bg/Spisak_2015.pdf + # http://crc.bg/files/_bg/Pravila_2015_resh24.pdf + (5725 - 5875 @ 80), (14) +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 (57000 - 66000 @ 2160), (40) country BH: DFS-JP - (2402 - 2482 @ 40), (20) -- (5170 - 5250 @ 80), (20) -- (5250 - 5330 @ 80), (20), DFS -- (5735 - 5835 @ 80), (20) -+ (5170 - 5250 @ 20), (20) -+ (5250 - 5330 @ 20), (20), DFS -+ (5735 - 5835 @ 20), (20) - - country BL: DFS-ETSI - (2402 - 2482 @ 40), (20) -@@ -263,10 +269,10 @@ country CO: DFS-FCC - - country CR: DFS-FCC - (2402 - 2482 @ 40), (20) -- (5170 - 5250 @ 80), (17) -- (5250 - 5330 @ 80), (24), DFS -- (5490 - 5730 @ 80), (24), DFS -- (5735 - 5835 @ 80), (30) -+ (5170 - 5250 @ 20), (17) -+ (5250 - 5330 @ 20), (24), DFS -+ (5490 - 5730 @ 20), (24), DFS -+ (5735 - 5835 @ 20), (30) - - country CX: DFS-FCC - (2402 - 2482 @ 40), (20) -@@ -349,10 +355,10 @@ country DZ: DFS-JP - - country EC: DFS-FCC - (2402 - 2482 @ 40), (20) -- (5170 - 5250 @ 80), (17) -- (5250 - 5330 @ 80), (24), DFS -- (5490 - 5730 @ 80), (24), DFS -- (5735 - 5835 @ 80), (30) -+ (5170 - 5250 @ 20), (17) -+ (5250 - 5330 @ 20), (24), DFS -+ (5490 - 5730 @ 20), (24), DFS -+ (5735 - 5835 @ 20), (30) - - country EE: DFS-ETSI - (2402 - 2482 @ 40), (20) -@@ -364,8 +370,8 @@ country EE: DFS-ETSI - - country EG: DFS-ETSI - (2402 - 2482 @ 40), (20) -- (5170 - 5250 @ 80), (20) -- (5250 - 5330 @ 80), (20), DFS -+ (5170 - 5250 @ 40), (20) -+ (5250 - 5330 @ 40), (20), DFS - - # Orden IET/787/2013, de 25 de abril, por la que se aprueba - # el cuadro nacional de atribución de frecuencias. -@@ -474,10 +480,10 @@ country GT: DFS-FCC - - country GU: DFS-FCC +@@ -216,8 +216,7 @@ country CA: DFS-FCC (2402 - 2472 @ 40), (30) -- (5170 - 5250 @ 80), (17) -- (5250 - 5330 @ 80), (24), DFS -- (5490 - 5730 @ 80), (24), DFS -- (5735 - 5835 @ 80), (30) -+ (5170 - 5250 @ 20), (17) -+ (5250 - 5330 @ 20), (24), DFS -+ (5490 - 5730 @ 20), (24), DFS -+ (5735 - 5835 @ 20), (30) - - country GY: - (2402 - 2482 @ 40), (30) -@@ -522,8 +528,8 @@ country HU: DFS-ETSI - - country ID: DFS-JP - # ref: http://www.postel.go.id/content/ID/regulasi/standardisasi/kepdir/bwa%205,8%20ghz.pdf -- (2402 - 2482 @ 40), (20) -- (5735 - 5815 @ 80), (23) -+ (2402 - 2482 @ 20), (20) -+ (5735 - 5815 @ 20), (23) - - country IE: DFS-ETSI - (2402 - 2482 @ 40), (20) -@@ -584,6 +590,9 @@ country JP: DFS-JP - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (23), DFS -+ # 60 GHz band channels 2-4 at 10mW, -+ # ref: http://www.arib.or.jp/english/html/overview/doc/1-STD-T74v1_1.pdf -+ (59000 - 66000 @ 2160), (10 mW) - - country KE: DFS-JP - (2402 - 2482 @ 40), (20) -@@ -607,11 +616,11 @@ country KN: DFS-ETSI - (5735 - 5815 @ 80), (30) - - country KP: DFS-JP -- (2402 - 2482 @ 40), (20) -- (5170 - 5250 @ 80), (20), AUTO-BW -- (5250 - 5330 @ 80), (20), DFS, AUTO-BW -- (5490 - 5630 @ 80), (30), DFS -- (5735 - 5815 @ 80), (30) -+ (2402 - 2482 @ 20), (20) -+ (5170 - 5250 @ 20), (20) -+ (5250 - 5330 @ 20), (20), DFS -+ (5490 - 5630 @ 20), (30), DFS -+ (5735 - 5815 @ 20), (30) - - country KR: DFS-JP - (2402 - 2482 @ 40), (20) -@@ -659,10 +668,10 @@ country LI: DFS-ETSI - - country LK: DFS-FCC - (2402 - 2482 @ 40), (20) -- (5170 - 5250 @ 80), (17) -- (5250 - 5330 @ 80), (24), DFS -- (5490 - 5730 @ 80), (24), DFS -- (5735 - 5835 @ 80), (30) -+ (5170 - 5250 @ 20), (17) -+ (5250 - 5330 @ 20), (24), DFS -+ (5490 - 5730 @ 20), (24), DFS -+ (5735 - 5835 @ 20), (30) - - # Source: - # http://lca.org.ls/images/documents/lesotho_national_frequency_allocation_plan.pdf -@@ -751,11 +760,12 @@ country MN: DFS-FCC - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - --country MO: -- (2402 - 2482 @ 40), (20) -- (5170 - 5250 @ 40), (23) -- (5250 - 5330 @ 40), (23), DFS -- (5735 - 5835 @ 40), (30) -+country MO: DFS-FCC -+ (2402 - 2482 @ 40), (23) -+ (5170 - 5250 @ 80), (23), AUTO-BW -+ (5250 - 5330 @ 80), (23), DFS, AUTO-BW -+ (5490 - 5730 @ 160), (30), DFS -+ (5735 - 5835 @ 80), (30) - - country MP: DFS-FCC - (2402 - 2472 @ 40), (30) -@@ -793,6 +803,14 @@ country MU: DFS-FCC - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -+# Source: -+# http://www.cam.gov.mv/docs/tech_standards/TAM-TS-100-2004-WLAN.pdf -+country MV: DFS-ETSI -+ (2400 - 2483.5 @ 40), (100 mW) -+ (5150 - 5250 @ 80), (200 mW), AUTO-BW -+ (5250 - 5350 @ 80), (100 mW), DFS, AUTO-BW -+ (5725 - 5850 @ 80), (100 mW) -+ - country MW: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW -@@ -812,6 +830,11 @@ country MY: DFS-FCC - (5250 - 5330 @ 80), (23), DFS, AUTO-BW - (5735 - 5835 @ 80), (30) - -+country NG: DFS-ETSI -+ (2402 - 2482 @ 40), (20) -+ (5250 - 5330 @ 80), (30), DFS -+ (5735 - 5835 @ 80), (30) -+ - country NI: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 80), (24), AUTO-BW -@@ -848,7 +871,7 @@ country NP: DFS-JP - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5735 - 5835 @ 80), (20) - --country NZ: DFS-FCC -+country NZ: DFS-ETSI - (2402 - 2482 @ 40), (30) (5170 - 5250 @ 80), (17), AUTO-BW (5250 - 5330 @ 80), (24), DFS, AUTO-BW -@@ -971,10 +994,12 @@ country RS: DFS-ETSI +- (5490 - 5600 @ 80), (24), DFS +- (5650 - 5730 @ 80), (24), DFS ++ (5490 - 5730 @ 160), (24), DFS + (5735 - 5835 @ 80), (30) + + # Source: +@@ -234,7 +233,7 @@ country CH: DFS-ETSI + (5170 - 5250 @ 80), (20), AUTO-BW + (5250 - 5330 @ 80), (20), DFS, AUTO-BW + (5490 - 5710 @ 160), (27), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + + country CI: DFS-FCC +@@ -255,7 +254,7 @@ country CN: DFS-FCC + (5170 - 5250 @ 80), (23), AUTO-BW + (5250 - 5330 @ 80), (23), DFS, AUTO-BW + (5735 - 5835 @ 80), (30) +- # 60 GHz band channels 1,4: 28dBm, channels 2,3: 44dBm ++ # 60 gHz band channels 1,4: 28dBm, channels 2,3: 44dBm + # ref: http://www.miit.gov.cn/n11293472/n11505629/n11506593/n11960250/n11960606/n11960700/n12330791.files/n12330790.pdf + (57240 - 59400 @ 2160), (28) + (59400 - 63720 @ 2160), (44) +@@ -287,7 +286,7 @@ country CY: DFS-ETSI + (5170 - 5250 @ 80), (20), AUTO-BW + (5250 - 5330 @ 80), (20), DFS, AUTO-BW + (5490 - 5710 @ 160), (27), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + + # Data from http://www.ctu.eu/164/download/VOR/VOR-12-08-2005-34.pdf +@@ -299,7 +298,7 @@ country CZ: DFS-ETSI + (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW + (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW + (5470 - 5725 @ 160), (500 mW), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + + # Data from "Frequenznutzungsplan" (as published in April 2008), downloaded from +@@ -323,7 +322,7 @@ country DE: DFS-ETSI + (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW + # entries 308002, 309001 and 310003 + (5470 - 5725 @ 160), (500 mW), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + + country DK: DFS-ETSI +@@ -331,7 +330,7 @@ country DK: DFS-ETSI + (5170 - 5250 @ 80), (20), AUTO-BW + (5250 - 5330 @ 80), (20), DFS, AUTO-BW + (5490 - 5710 @ 160), (27), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + + # Source: +@@ -366,7 +365,7 @@ country EE: DFS-ETSI + (5170 - 5250 @ 80), (20), AUTO-BW + (5250 - 5330 @ 80), (20), DFS, AUTO-BW + (5490 - 5710 @ 160), (27), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + + country EG: DFS-ETSI +@@ -386,7 +385,7 @@ country ES: DFS-ETSI + (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW + (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW + (5470 - 5725 @ 160), (500 mW), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + + country ET: DFS-ETSI +@@ -396,11 +395,11 @@ country ET: DFS-ETSI + (5490 - 5710 @ 160), (27), DFS + + country FI: DFS-ETSI +- (2400 - 2483.5 @ 40), (20) +- (5150 - 5250 @ 80), (23), NO-OUTDOOR, AUTO-BW +- (5250 - 5350 @ 80), (20), NO-OUTDOOR, DFS, AUTO-BW +- (5470 - 5725 @ 160), (27), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ (2402 - 2482 @ 40), (20) ++ (5170 - 5250 @ 80), (20), AUTO-BW ++ (5250 - 5330 @ 80), (20), DFS, AUTO-BW ++ (5490 - 5710 @ 160), (27), DFS ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + + country FM: DFS-FCC +@@ -415,7 +414,7 @@ country FR: DFS-ETSI + (5170 - 5250 @ 80), (20), AUTO-BW + (5250 - 5330 @ 80), (20), DFS, AUTO-BW + (5490 - 5710 @ 160), (27), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + + country GB: DFS-ETSI +@@ -423,7 +422,7 @@ country GB: DFS-ETSI + (5170 - 5250 @ 80), (20), AUTO-BW + (5250 - 5330 @ 80), (20), DFS, AUTO-BW + (5490 - 5710 @ 160), (27), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + + country GD: DFS-FCC +@@ -437,7 +436,7 @@ country GE: DFS-ETSI + (2402 - 2482 @ 40), (20) + (5170 - 5250 @ 80), (18), AUTO-BW + (5250 - 5330 @ 80), (18), DFS, AUTO-BW +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + + country GF: DFS-ETSI +@@ -455,9 +454,9 @@ country GH: DFS-FCC + + country GL: DFS-ETSI + (2402 - 2482 @ 40), (20) +- (5170 - 5250 @ 80), (20), AUTO-BW +- (5250 - 5330 @ 80), (20), DFS, AUTO-BW +- (5490 - 5710 @ 160), (27), DFS ++ (5170 - 5250 @ 80), (20) ++ (5250 - 5330 @ 80), (20), DFS ++ (5490 - 5710 @ 80), (27), DFS + + country GP: DFS-ETSI + (2402 - 2482 @ 40), (20) +@@ -470,7 +469,7 @@ country GR: DFS-ETSI + (5170 - 5250 @ 80), (20), AUTO-BW + (5250 - 5330 @ 80), (20), DFS, AUTO-BW + (5490 - 5710 @ 160), (27), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + + country GT: DFS-FCC +@@ -490,7 +489,7 @@ country GY: + (2402 - 2482 @ 40), (30) + (5735 - 5835 @ 80), (30) + +-country HK: DFS-ETSI ++country HK: + (2402 - 2482 @ 40), (20) + (5170 - 5250 @ 80), (17), AUTO-BW + (5250 - 5330 @ 80), (24), DFS, AUTO-BW +@@ -505,11 +504,11 @@ country HN: DFS-FCC + (5735 - 5835 @ 80), (30) + + country HR: DFS-ETSI +- (2400 - 2483.5 @ 40), (20) +- (5150 - 5250 @ 80), (23), NO-OUTDOOR, AUTO-BW +- (5250 - 5350 @ 80), (20), NO-OUTDOOR, DFS, AUTO-BW +- (5470 - 5725 @ 160), (27), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ (2402 - 2482 @ 40), (20) ++ (5170 - 5250 @ 80), (20), AUTO-BW ++ (5250 - 5330 @ 80), (20), DFS, AUTO-BW ++ (5490 - 5710 @ 160), (27), DFS ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + + country HT: DFS-FCC +@@ -524,7 +523,7 @@ country HU: DFS-ETSI + (5170 - 5250 @ 80), (20), AUTO-BW + (5250 - 5330 @ 80), (20), DFS, AUTO-BW + (5490 - 5710 @ 160), (27), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + + country ID: DFS-JP +@@ -537,7 +536,7 @@ country IE: DFS-ETSI + (5170 - 5250 @ 80), (20), AUTO-BW + (5250 - 5330 @ 80), (20), DFS, AUTO-BW + (5490 - 5710 @ 160), (27), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + + country IL: DFS-ETSI +@@ -560,7 +559,7 @@ country IS: DFS-ETSI + (5170 - 5250 @ 80), (20), AUTO-BW + (5250 - 5330 @ 80), (20), DFS, AUTO-BW + (5490 - 5710 @ 160), (27), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + + country IT: DFS-ETSI +@@ -568,7 +567,7 @@ country IT: DFS-ETSI + (5170 - 5250 @ 80), (20), AUTO-BW + (5250 - 5330 @ 80), (20), DFS, AUTO-BW + (5490 - 5710 @ 160), (27), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + + country JM: DFS-FCC +@@ -687,7 +686,7 @@ country LT: DFS-ETSI + (5170 - 5250 @ 80), (20), AUTO-BW + (5250 - 5330 @ 80), (20), DFS, AUTO-BW + (5490 - 5710 @ 160), (27), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + + country LU: DFS-ETSI +@@ -695,7 +694,7 @@ country LU: DFS-ETSI + (5170 - 5250 @ 80), (20), AUTO-BW + (5250 - 5330 @ 80), (20), DFS, AUTO-BW + (5490 - 5710 @ 160), (27), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + + country LV: DFS-ETSI +@@ -703,7 +702,7 @@ country LV: DFS-ETSI + (5170 - 5250 @ 80), (20), AUTO-BW + (5250 - 5330 @ 80), (20), DFS, AUTO-BW + (5490 - 5710 @ 160), (27), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + + country MA: DFS-ETSI +@@ -751,7 +750,7 @@ country MK: DFS-ETSI + (5170 - 5250 @ 80), (20), AUTO-BW + (5250 - 5330 @ 80), (20), DFS, AUTO-BW + (5490 - 5710 @ 160), (27), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + + country MN: DFS-FCC +@@ -794,7 +793,7 @@ country MT: DFS-ETSI + (5170 - 5250 @ 80), (20), AUTO-BW + (5250 - 5330 @ 80), (20), DFS, AUTO-BW + (5490 - 5710 @ 160), (27), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + + country MU: DFS-FCC +@@ -827,10 +826,9 @@ country MX: DFS-FCC + + country MY: DFS-FCC + (2402 - 2482 @ 40), (20) +- (5170 - 5250 @ 80), (24), AUTO-BW +- (5250 - 5330 @ 80), (24), DFS, AUTO-BW +- (5490 - 5650 @ 160), (24), DFS +- (5735 - 5835 @ 80), (24) ++ (5170 - 5250 @ 80), (17), AUTO-BW ++ (5250 - 5330 @ 80), (23), DFS, AUTO-BW ++ (5735 - 5835 @ 80), (30) + + country NG: DFS-ETSI + (2402 - 2482 @ 40), (20) +@@ -849,7 +847,7 @@ country NL: DFS-ETSI + (5170 - 5250 @ 80), (20), NO-OUTDOOR, AUTO-BW + (5250 - 5330 @ 80), (20), NO-OUTDOOR, DFS, AUTO-BW + (5490 - 5710 @ 160), (27), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + + # Data from http://www.lovdata.no/dokument/SF/forskrift/2012-01-19-77 +@@ -864,7 +862,7 @@ country NO: DFS-ETSI + (5470 - 5795 @ 160), (500 mW), DFS + (5815 - 5850 @ 35), (2000 mW), DFS + (17100 - 17300 @ 200), (100 mW) +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + + country NP: DFS-JP +@@ -928,7 +926,7 @@ country PL: DFS-ETSI + (5170 - 5250 @ 80), (20), AUTO-BW + (5250 - 5330 @ 80), (20), DFS, AUTO-BW + (5490 - 5710 @ 160), (27), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + + country PM: DFS-ETSI +@@ -949,7 +947,7 @@ country PT: DFS-ETSI + (5170 - 5250 @ 80), (20), AUTO-BW + (5250 - 5330 @ 80), (20), DFS, AUTO-BW + (5490 - 5710 @ 160), (27), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + + country PW: DFS-FCC +@@ -981,7 +979,7 @@ country RO: DFS-ETSI + (5170 - 5250 @ 80), (20), AUTO-BW + (5250 - 5330 @ 80), (20), DFS, AUTO-BW + (5490 - 5710 @ 160), (27), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + + +@@ -991,15 +989,15 @@ country RS: DFS-ETSI + (2400 - 2483.5 @ 40), (100 mW) + (5150 - 5350 @ 40), (200 mW), NO-OUTDOOR + (5470 - 5725 @ 20), (1000 mW), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) country RU: DFS-ETSI (2402 - 2482 @ 40), (20) -- (5170 - 5250 @ 80), (20) -- (5250 - 5330 @ 80), (20), DFS +- (5170 - 5250 @ 80), (20), AUTO-BW +- (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5650 - 5730 @ 80), (30), DFS - (5735 - 5835 @ 80), (30) + (5170 - 5250 @ 40), (20) + (5250 - 5330 @ 40), (20), DFS + (5650 - 5730 @ 40), (30), DFS + (5735 - 5835 @ 40), (30) -+ # 60 GHz band channels 1-4, ref: Changes to NLA 124_Order №129_22042015.pdf -+ (57000 - 66000 @ 2160), (40) + # 60 GHz band channels 1-4, ref: Changes to NLA 124_Order №129_22042015.pdf + (57000 - 66000 @ 2160), (40) - country RW: DFS-FCC - (2402 - 2482 @ 40), (20) -@@ -1037,9 +1062,9 @@ country SR: DFS-ETSI - - country SV: DFS-FCC - (2402 - 2482 @ 40), (20) -- (5170 - 5250 @ 80), (17) -- (5250 - 5330 @ 80), (23), DFS -- (5735 - 5835 @ 80), (30) -+ (5170 - 5250 @ 20), (17) -+ (5250 - 5330 @ 20), (23), DFS -+ (5735 - 5835 @ 20), (30) - - country SY: - (2402 - 2482 @ 40), (20) -@@ -1099,6 +1124,10 @@ country TW: DFS-JP - (5650 - 5710 @ 40), (30), DFS - (5735 - 5835 @ 80), (30) - -+country TZ: -+ (2402 - 2482 @ 40), (20) -+ (5735 - 5835 @ 80), (30) -+ - # Source: - # #914 / 06 Sep 2007: http://www.ucrf.gov.ua/uk/doc/nkrz/1196068874 - # #1174 / 23 Oct 2008: http://www.nkrz.gov.ua/uk/activities/ruling/1225269361 -@@ -1125,6 +1154,7 @@ country US: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (23), DFS, AUTO-BW -+ (5490 - 5730 @ 160), (23), DFS - (5735 - 5835 @ 80), (30) - # 60g band - # reference: http://cfr.regstoday.com/47cfr15.aspx#47_CFR_15p255 -@@ -1192,6 +1222,12 @@ country WF: DFS-ETSI +@@ -1021,7 +1019,7 @@ country SE: DFS-ETSI + (5170 - 5250 @ 80), (20), AUTO-BW (5250 - 5330 @ 80), (20), DFS, AUTO-BW (5490 - 5710 @ 160), (27), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) -+country WS: DFS-ETSI -+ (2402 - 2482 @ 40), (20) -+ (5170 - 5250 @ 40), (20) -+ (5250 - 5330 @ 40), (20), DFS -+ (5490 - 5710 @ 40), (27), DFS -+ - country YE: + country SG: DFS-FCC +@@ -1036,7 +1034,7 @@ country SI: DFS-ETSI + (5170 - 5250 @ 80), (20), AUTO-BW + (5250 - 5330 @ 80), (20), DFS, AUTO-BW + (5490 - 5710 @ 160), (27), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + + country SK: DFS-ETSI +@@ -1044,7 +1042,7 @@ country SK: DFS-ETSI + (5170 - 5250 @ 80), (20), AUTO-BW + (5250 - 5330 @ 80), (20), DFS, AUTO-BW + (5490 - 5710 @ 160), (27), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + + # Source: +@@ -1109,7 +1107,7 @@ country TR: DFS-ETSI + (5170 - 5250 @ 80), (20), AUTO-BW + (5250 - 5330 @ 80), (20), DFS, AUTO-BW + (5490 - 5710 @ 160), (27), DFS +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + + country TT: DFS-FCC +@@ -1119,20 +1117,12 @@ country TT: DFS-FCC + (5490 - 5730 @ 160), (24), DFS + (5735 - 5835 @ 80), (30) + +-# Source: +-# Table of Frequency Allocations of Republic of China (Taiwan) / Nov 2014: +-# http://www.motc.gov.tw/websitedowndoc?file=post/201411171137330.doc& \ +-# filedisplay=Table+of+radio+frequency+allocation.doc +-# LP0002 Low-power Radio-frequency Devices Technical Regulations / 28 Jun 2011: +-# http://www.ncc.gov.tw/english/show_file.aspx?table_name=news&file_sn=681 +-# (section 3.10.1, 4.7) +-country TW: DFS-FCC +- (2400 - 2483.5 @ 40), (30) +- # Follow US 5.15 ~ 5.25 GHz: 30 dBm for master mode, 23 dBm for clients +- (5150 - 5250 @ 80), (23), AUTO-BW +- (5250 - 5350 @ 80), (23), DFS, AUTO-BW +- (5470 - 5725 @ 160), (23), DFS +- (5725 - 5850 @ 80), (30) ++country TW: DFS-JP ++ (2402 - 2472 @ 40), (30) ++ (5270 - 5330 @ 40), (17), DFS ++ (5490 - 5590 @ 80), (30), DFS ++ (5650 - 5710 @ 40), (30), DFS ++ (5735 - 5835 @ 80), (30) + + country TZ: (2402 - 2482 @ 40), (20) +@@ -1147,11 +1137,10 @@ country TZ: + # disputable definitions there. + country UA: DFS-ETSI + (2400 - 2483.5 @ 40), (20), NO-OUTDOOR +- (5150 - 5250 @ 80), (20), NO-OUTDOOR, AUTO-BW +- (5250 - 5350 @ 80), (20), DFS, NO-OUTDOOR, AUTO-BW +- (5490 - 5670 @ 160), (20), DFS ++ (5150 - 5350 @ 40), (20), NO-OUTDOOR ++ (5490 - 5670 @ 80), (20), DFS + (5735 - 5835 @ 80), (20) +- # 60 GHz band channels 1-4, ref: Etsi En 302 567 ++ # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57000 - 66000 @ 2160), (40) + country UG: DFS-FCC +@@ -1163,8 +1152,7 @@ country UG: DFS-FCC + + country US: DFS-FCC + (2402 - 2472 @ 40), (30) +- # 5.15 ~ 5.25 GHz: 30 dBm for master mode, 23 dBm for clients +- (5170 - 5250 @ 80), (23), AUTO-BW ++ (5170 - 5250 @ 80), (17), AUTO-BW + (5250 - 5330 @ 80), (23), DFS, AUTO-BW + (5490 - 5730 @ 160), (23), DFS + (5735 - 5835 @ 80), (30) +@@ -1175,8 +1163,9 @@ country US: DFS-FCC + + country UY: DFS-FCC + (2402 - 2482 @ 40), (20) +- (5170 - 5250 @ 80), (23), AUTO-BW +- (5250 - 5330 @ 80), (23), DFS, AUTO-BW ++ (5170 - 5250 @ 80), (17), AUTO-BW ++ (5250 - 5330 @ 80), (24), DFS, AUTO-BW ++ (5490 - 5730 @ 160), (24), DFS + (5735 - 5835 @ 80), (30) + + # Source: +@@ -1252,7 +1241,7 @@ country ZA: DFS-ETSI + (2402 - 2482 @ 40), (20) + (5170 - 5250 @ 80), (20), AUTO-BW + (5250 - 5330 @ 80), (20), DFS, AUTO-BW +- (5490 - 5710 @ 160), (30) ++ (5490 - 5710 @ 160), (27), DFS + + country ZW: DFS-ETSI + (2402 - 2482 @ 40), (20) diff --git a/package/kernel/mac80211/patches/001-fix_build.patch b/package/kernel/mac80211/patches/001-fix_build.patch index 818983e..402649d 100644 --- a/package/kernel/mac80211/patches/001-fix_build.patch @@ -13184,10 +13421,10 @@ index 0000000..b19e7ee + } else { + info->flags |= IEEE80211_TX_CTL_ASSIGN_SEQ; + hdr->seq_ctrl = cpu_to_le16(sdata->sequence_number); -diff --git a/package/kernel/mac80211/patches/335-brcmfmac-Fix-oops-when-SDIO-device-is-removed.patch b/package/kernel/mac80211/patches/335-brcmfmac-Fix-oops-when-SDIO-device-is-removed.patch +diff --git a/package/kernel/mac80211/patches/335-0001-brcmfmac-Fix-oops-when-SDIO-device-is-removed.patch b/package/kernel/mac80211/patches/335-0001-brcmfmac-Fix-oops-when-SDIO-device-is-removed.patch deleted file mode 100644 index 5e63a80..0000000 ---- a/package/kernel/mac80211/patches/335-brcmfmac-Fix-oops-when-SDIO-device-is-removed.patch +--- a/package/kernel/mac80211/patches/335-0001-brcmfmac-Fix-oops-when-SDIO-device-is-removed.patch +++ /dev/null @@ -1,44 +0,0 @@ -From: Hante Meuleman @@ -13234,89 +13471,10 @@ index 5e63a80..0000000 - } else if (atomic_read(&bus->intstatus) || - atomic_read(&bus->ipend) > 0 || - (!atomic_read(&bus->fcstate) && -diff --git a/package/kernel/mac80211/patches/335-mac80211-fix-handling-of-PS-filtering-with-fast-xmit.patch b/package/kernel/mac80211/patches/335-mac80211-fix-handling-of-PS-filtering-with-fast-xmit.patch -new file mode 100644 -index 0000000..7aef205 ---- /dev/null -+++ b/package/kernel/mac80211/patches/335-mac80211-fix-handling-of-PS-filtering-with-fast-xmit.patch -@@ -0,0 +1,45 @@ -+From: Felix Fietkau -+Date: Thu, 24 Sep 2015 14:11:40 +0200 -+Subject: [PATCH] mac80211: fix handling of PS filtering with fast-xmit -+ -+Fixes dropped packets in the tx path in case a non-PS station triggers -+the tx filter. -+ -+Cc: stable@vger.kernel.org # 4.2 -+Signed-off-by: Felix Fietkau -+--- -+ -+--- a/net/mac80211/status.c -++++ b/net/mac80211/status.c -+@@ -101,6 +101,7 @@ static void ieee80211_handle_filtered_fr -+ * when it wakes up for the next time. -+ */ -+ set_sta_flag(sta, WLAN_STA_CLEAR_PS_FILT); -++ ieee80211_clear_fast_xmit(sta); -+ -+ /* -+ * This code races in the following way: -+--- a/net/mac80211/tx.c -++++ b/net/mac80211/tx.c -+@@ -1217,8 +1217,10 @@ ieee80211_tx_prepare(struct ieee80211_su -+ -+ if (!tx->sta) -+ info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT; -+- else if (test_and_clear_sta_flag(tx->sta, WLAN_STA_CLEAR_PS_FILT)) -++ else if (test_and_clear_sta_flag(tx->sta, WLAN_STA_CLEAR_PS_FILT)) { -+ info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT; -++ ieee80211_check_fast_xmit(tx->sta); -++ } -+ -+ info->flags |= IEEE80211_TX_CTL_FIRST_FRAGMENT; -+ -+@@ -2450,7 +2452,8 @@ void ieee80211_check_fast_xmit(struct st -+ -+ if (test_sta_flag(sta, WLAN_STA_PS_STA) || -+ test_sta_flag(sta, WLAN_STA_PS_DRIVER) || -+- test_sta_flag(sta, WLAN_STA_PS_DELIVER)) -++ test_sta_flag(sta, WLAN_STA_PS_DELIVER) || -++ test_sta_flag(sta, WLAN_STA_CLEAR_PS_FILT)) -+ goto out; -+ -+ if (sdata->noack_map) -diff --git a/package/kernel/mac80211/patches/336-ath9k-declare-required-extra-tx-headroom.patch b/package/kernel/mac80211/patches/336-ath9k-declare-required-extra-tx-headroom.patch -new file mode 100644 -index 0000000..4d88591 ---- /dev/null -+++ b/package/kernel/mac80211/patches/336-ath9k-declare-required-extra-tx-headroom.patch -@@ -0,0 +1,22 @@ -+From: Felix Fietkau -+Date: Thu, 24 Sep 2015 16:57:37 +0200 -+Subject: [PATCH] ath9k: declare required extra tx headroom -+ -+ath9k inserts padding between the 802.11 header and the data area (to -+align it). Since it didn't declare this extra required headroom, this -+led to some nasty issues like randomly dropped packets in some setups. -+ -+Cc: stable@vger.kernel.org -+Signed-off-by: Felix Fietkau -+--- -+ -+--- a/drivers/net/wireless/ath/ath9k/init.c -++++ b/drivers/net/wireless/ath/ath9k/init.c -+@@ -875,6 +875,7 @@ static void ath9k_set_hw_capab(struct at -+ hw->max_rate_tries = 10; -+ hw->sta_data_size = sizeof(struct ath_node); -+ hw->vif_data_size = sizeof(struct ath_vif); -++ hw->extra_tx_headroom = 4; -+ -+ hw->wiphy->available_antennas_rx = BIT(ah->caps.max_rxchains) - 1; -+ hw->wiphy->available_antennas_tx = BIT(ah->caps.max_txchains) - 1; -diff --git a/package/kernel/mac80211/patches/336-brcmfmac-Simplify-watchdog-sleep.patch b/package/kernel/mac80211/patches/336-brcmfmac-Simplify-watchdog-sleep.patch +diff --git a/package/kernel/mac80211/patches/335-0002-brcmfmac-Simplify-watchdog-sleep.patch b/package/kernel/mac80211/patches/335-0002-brcmfmac-Simplify-watchdog-sleep.patch deleted file mode 100644 index 201da75..0000000 ---- a/package/kernel/mac80211/patches/336-brcmfmac-Simplify-watchdog-sleep.patch +--- a/package/kernel/mac80211/patches/335-0002-brcmfmac-Simplify-watchdog-sleep.patch +++ /dev/null @@ -1,157 +0,0 @@ -From: Hante Meuleman @@ -13476,10 +13634,10 @@ index 201da75..0000000 - - /* Assign bus interface call back */ - bus->sdiodev->bus_if->dev = bus->sdiodev->dev; -diff --git a/package/kernel/mac80211/patches/337-brcmfmac-Fix-possible-race-condition.patch b/package/kernel/mac80211/patches/337-brcmfmac-Fix-possible-race-condition.patch +diff --git a/package/kernel/mac80211/patches/335-0003-brcmfmac-Fix-possible-race-condition.patch b/package/kernel/mac80211/patches/335-0003-brcmfmac-Fix-possible-race-condition.patch deleted file mode 100644 index 3a2de7a..0000000 ---- a/package/kernel/mac80211/patches/337-brcmfmac-Fix-possible-race-condition.patch +--- a/package/kernel/mac80211/patches/335-0003-brcmfmac-Fix-possible-race-condition.patch +++ /dev/null @@ -1,83 +0,0 @@ -From: Hante Meuleman @@ -13565,53 +13723,10 @@ index 3a2de7a..0000000 - } - - if (ret) -diff --git a/package/kernel/mac80211/patches/337-nl80211-put-current-TX-power-in-interface-info.patch b/package/kernel/mac80211/patches/337-nl80211-put-current-TX-power-in-interface-info.patch -new file mode 100644 -index 0000000..df2cc4b ---- /dev/null -+++ b/package/kernel/mac80211/patches/337-nl80211-put-current-TX-power-in-interface-info.patch -@@ -0,0 +1,37 @@ -+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -+Date: Mon, 31 Aug 2015 22:59:38 +0200 -+Subject: [PATCH] nl80211: put current TX power in interface info -+MIME-Version: 1.0 -+Content-Type: text/plain; charset=UTF-8 -+Content-Transfer-Encoding: 8bit -+ -+Many drivers implement reading current TX power (using either cfg80211 -+or ieee80211 op) but userspace can't get it using nl80211. Right now the -+only way to access it is to call some wext ioctl. -+Let's put TX power in interface info reply (callback is wdev specific) -+just like we do with current channel. -+To be consistent (e.g. NL80211_CMD_SET_WIPHY) let's use mBm as na unit. -+ -+Signed-off-by: Rafał Miłecki -+Signed-off-by: Johannes Berg -+--- -+ -+--- a/net/wireless/nl80211.c -++++ b/net/wireless/nl80211.c -+@@ -2406,6 +2406,16 @@ static int nl80211_send_iface(struct sk_ -+ } -+ } -+ -++ if (rdev->ops->get_tx_power) { -++ int dbm, ret; -++ -++ ret = rdev_get_tx_power(rdev, wdev, &dbm); -++ if (ret == 0 && -++ nla_put_u32(msg, NL80211_ATTR_WIPHY_TX_POWER_LEVEL, -++ DBM_TO_MBM(dbm))) -++ goto nla_put_failure; -++ } -++ -+ if (wdev->ssid_len) { -+ if (nla_put(msg, NL80211_ATTR_SSID, wdev->ssid_len, wdev->ssid)) -+ goto nla_put_failure; -diff --git a/package/kernel/mac80211/patches/338-brcmfmac-Add-support-for-BCM4345-SDIO-chipset.patch b/package/kernel/mac80211/patches/338-brcmfmac-Add-support-for-BCM4345-SDIO-chipset.patch +diff --git a/package/kernel/mac80211/patches/335-0004-brcmfmac-Add-support-for-BCM4345-SDIO-chipset.patch b/package/kernel/mac80211/patches/335-0004-brcmfmac-Add-support-for-BCM4345-SDIO-chipset.patch deleted file mode 100644 index c9eb900..0000000 ---- a/package/kernel/mac80211/patches/338-brcmfmac-Add-support-for-BCM4345-SDIO-chipset.patch +--- a/package/kernel/mac80211/patches/335-0004-brcmfmac-Add-support-for-BCM4345-SDIO-chipset.patch +++ /dev/null @@ -1,86 +0,0 @@ -From: Syed Asifful Dayyan @@ -13700,37 +13815,61 @@ index c9eb900..0000000 - #define SDIO_DEVICE_ID_BROADCOM_4354 0x4354 - - #define SDIO_VENDOR_ID_INTEL 0x0089 -diff --git a/package/kernel/mac80211/patches/338-mac80211-initialize-tid-field-in-struct-ieee80211_tx.patch b/package/kernel/mac80211/patches/338-mac80211-initialize-tid-field-in-struct-ieee80211_tx.patch +diff --git a/package/kernel/mac80211/patches/335-mac80211-fix-handling-of-PS-filtering-with-fast-xmit.patch b/package/kernel/mac80211/patches/335-mac80211-fix-handling-of-PS-filtering-with-fast-xmit.patch new file mode 100644 -index 0000000..2f492e0 +index 0000000..7aef205 --- /dev/null -+++ b/package/kernel/mac80211/patches/338-mac80211-initialize-tid-field-in-struct-ieee80211_tx.patch -@@ -0,0 +1,21 @@ ++++ b/package/kernel/mac80211/patches/335-mac80211-fix-handling-of-PS-filtering-with-fast-xmit.patch +@@ -0,0 +1,45 @@ +From: Felix Fietkau -+Date: Mon, 5 Oct 2015 17:41:25 +0200 -+Subject: [PATCH] mac80211: initialize tid field in struct ieee80211_txq ++Date: Thu, 24 Sep 2015 14:11:40 +0200 ++Subject: [PATCH] mac80211: fix handling of PS filtering with fast-xmit + ++Fixes dropped packets in the tx path in case a non-PS station triggers ++the tx filter. ++ ++Cc: stable@vger.kernel.org # 4.2 +Signed-off-by: Felix Fietkau +--- + -+--- a/net/mac80211/util.c -++++ b/net/mac80211/util.c -+@@ -3288,9 +3288,11 @@ void ieee80211_init_tx_queue(struct ieee -+ if (sta) { -+ txqi->txq.sta = &sta->sta; -+ sta->sta.txq[tid] = &txqi->txq; -++ txqi->txq.tid = tid; -+ txqi->txq.ac = ieee802_1d_to_ac[tid & 7]; -+ } else { -+ sdata->vif.txq = &txqi->txq; -++ txqi->txq.tid = 0; -+ txqi->txq.ac = IEEE80211_AC_BE; -+ } -+ } -diff --git a/package/kernel/mac80211/patches/339-brcmfmac-remove-duplication-of-ramsize-info.patch b/package/kernel/mac80211/patches/339-brcmfmac-remove-duplication-of-ramsize-info.patch ++--- a/net/mac80211/status.c +++++ b/net/mac80211/status.c ++@@ -101,6 +101,7 @@ static void ieee80211_handle_filtered_fr ++ * when it wakes up for the next time. ++ */ ++ set_sta_flag(sta, WLAN_STA_CLEAR_PS_FILT); +++ ieee80211_clear_fast_xmit(sta); ++ ++ /* ++ * This code races in the following way: ++--- a/net/mac80211/tx.c +++++ b/net/mac80211/tx.c ++@@ -1217,8 +1217,10 @@ ieee80211_tx_prepare(struct ieee80211_su ++ ++ if (!tx->sta) ++ info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT; ++- else if (test_and_clear_sta_flag(tx->sta, WLAN_STA_CLEAR_PS_FILT)) +++ else if (test_and_clear_sta_flag(tx->sta, WLAN_STA_CLEAR_PS_FILT)) { ++ info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT; +++ ieee80211_check_fast_xmit(tx->sta); +++ } ++ ++ info->flags |= IEEE80211_TX_CTL_FIRST_FRAGMENT; ++ ++@@ -2450,7 +2452,8 @@ void ieee80211_check_fast_xmit(struct st ++ ++ if (test_sta_flag(sta, WLAN_STA_PS_STA) || ++ test_sta_flag(sta, WLAN_STA_PS_DRIVER) || ++- test_sta_flag(sta, WLAN_STA_PS_DELIVER)) +++ test_sta_flag(sta, WLAN_STA_PS_DELIVER) || +++ test_sta_flag(sta, WLAN_STA_CLEAR_PS_FILT)) ++ goto out; ++ ++ if (sdata->noack_map) +diff --git a/package/kernel/mac80211/patches/336-0001-brcmfmac-remove-duplication-of-ramsize-info.patch b/package/kernel/mac80211/patches/336-0001-brcmfmac-remove-duplication-of-ramsize-info.patch deleted file mode 100644 index 7a688c4..0000000 ---- a/package/kernel/mac80211/patches/339-brcmfmac-remove-duplication-of-ramsize-info.patch +--- a/package/kernel/mac80211/patches/336-0001-brcmfmac-remove-duplication-of-ramsize-info.patch +++ /dev/null @@ -1,48 +0,0 @@ -From: Arend van Spriel @@ -13781,10 +13920,10 @@ index 7a688c4..0000000 - /* Set card control so an SDIO card reset does a WLAN backplane reset */ - reg_val = brcmf_sdiod_regrb(bus->sdiodev, - SDIO_CCCR_BRCM_CARDCTRL, &err); -diff --git a/package/kernel/mac80211/patches/340-brcmfmac-always-perform-cores-checks.patch b/package/kernel/mac80211/patches/340-brcmfmac-always-perform-cores-checks.patch +diff --git a/package/kernel/mac80211/patches/336-0002-brcmfmac-always-perform-cores-checks.patch b/package/kernel/mac80211/patches/336-0002-brcmfmac-always-perform-cores-checks.patch deleted file mode 100644 index e2a2074..0000000 ---- a/package/kernel/mac80211/patches/340-brcmfmac-always-perform-cores-checks.patch +--- a/package/kernel/mac80211/patches/336-0002-brcmfmac-always-perform-cores-checks.patch +++ /dev/null @@ -1,74 +0,0 @@ -From: Arend van Spriel @@ -13861,10 +14000,10 @@ index e2a2074..0000000 - - static void brcmf_chip_get_raminfo(struct brcmf_chip_priv *ci) - { -diff --git a/package/kernel/mac80211/patches/341-brcmfmac-rename-chip-download-functions.patch b/package/kernel/mac80211/patches/341-brcmfmac-rename-chip-download-functions.patch +diff --git a/package/kernel/mac80211/patches/336-0003-brcmfmac-rename-chip-download-functions.patch b/package/kernel/mac80211/patches/336-0003-brcmfmac-rename-chip-download-functions.patch deleted file mode 100644 index a272800..0000000 ---- a/package/kernel/mac80211/patches/341-brcmfmac-rename-chip-download-functions.patch +--- a/package/kernel/mac80211/patches/336-0003-brcmfmac-rename-chip-download-functions.patch +++ /dev/null @@ -1,240 +0,0 @@ -From: Arend van Spriel @@ -14107,10 +14246,10 @@ index a272800..0000000 - brcmf_sdio_clkctl(bus, CLK_NONE, false); - sdio_release_host(bus->sdiodev->func[1]); - } -diff --git a/package/kernel/mac80211/patches/342-brcmfmac-assure-device-is-ready-for-download-after-b.patch b/package/kernel/mac80211/patches/342-brcmfmac-assure-device-is-ready-for-download-after-b.patch +diff --git a/package/kernel/mac80211/patches/336-0004-brcmfmac-assure-device-is-ready-for-download-after-b.patch b/package/kernel/mac80211/patches/336-0004-brcmfmac-assure-device-is-ready-for-download-after-b.patch deleted file mode 100644 index 6b1dd81..0000000 ---- a/package/kernel/mac80211/patches/342-brcmfmac-assure-device-is-ready-for-download-after-b.patch +--- a/package/kernel/mac80211/patches/336-0004-brcmfmac-assure-device-is-ready-for-download-after-b.patch +++ /dev/null @@ -1,61 +0,0 @@ -From: Arend van Spriel @@ -14174,10 +14313,10 @@ index 6b1dd81..0000000 - rstvec = get_unaligned_le32(fw->data); - brcmf_dbg(SDIO, "firmware rstvec: %x\n", rstvec); - -diff --git a/package/kernel/mac80211/patches/343-brcmfmac-extract-ram-size-info-from-internal-memory-.patch b/package/kernel/mac80211/patches/343-brcmfmac-extract-ram-size-info-from-internal-memory-.patch +diff --git a/package/kernel/mac80211/patches/336-0005-brcmfmac-extract-ram-size-info-from-internal-memory-.patch b/package/kernel/mac80211/patches/336-0005-brcmfmac-extract-ram-size-info-from-internal-memory-.patch deleted file mode 100644 index bcc2ed4..0000000 ---- a/package/kernel/mac80211/patches/343-brcmfmac-extract-ram-size-info-from-internal-memory-.patch +--- a/package/kernel/mac80211/patches/336-0005-brcmfmac-extract-ram-size-info-from-internal-memory-.patch +++ /dev/null @@ -1,367 +0,0 @@ -From: Arend van Spriel @@ -14547,10 +14686,10 @@ index bcc2ed4..0000000 - char name[8]; - }; - -diff --git a/package/kernel/mac80211/patches/344-brcmfmac-take-save-restore-memory-into-account-for-S.patch b/package/kernel/mac80211/patches/344-brcmfmac-take-save-restore-memory-into-account-for-S.patch +diff --git a/package/kernel/mac80211/patches/336-0006-brcmfmac-take-save-restore-memory-into-account-for-S.patch b/package/kernel/mac80211/patches/336-0006-brcmfmac-take-save-restore-memory-into-account-for-S.patch deleted file mode 100644 index 69618a7..0000000 ---- a/package/kernel/mac80211/patches/344-brcmfmac-take-save-restore-memory-into-account-for-S.patch +--- a/package/kernel/mac80211/patches/336-0006-brcmfmac-take-save-restore-memory-into-account-for-S.patch +++ /dev/null @@ -1,96 +0,0 @@ -From: Arend van Spriel @@ -14649,10 +14788,10 @@ index 69618a7..0000000 - } - - static void brcmf_sdio_get_console_addr(struct brcmf_sdio *bus) -diff --git a/package/kernel/mac80211/patches/345-brcmfmac-fix-watchdog-timer-regression.patch b/package/kernel/mac80211/patches/345-brcmfmac-fix-watchdog-timer-regression.patch +diff --git a/package/kernel/mac80211/patches/336-0007-brcmfmac-fix-watchdog-timer-regression.patch b/package/kernel/mac80211/patches/336-0007-brcmfmac-fix-watchdog-timer-regression.patch deleted file mode 100644 index 1b10dbb..0000000 ---- a/package/kernel/mac80211/patches/345-brcmfmac-fix-watchdog-timer-regression.patch +--- a/package/kernel/mac80211/patches/336-0007-brcmfmac-fix-watchdog-timer-regression.patch +++ /dev/null @@ -1,59 +0,0 @@ -From: Arend van Spriel @@ -14714,10 +14853,38 @@ index 1b10dbb..0000000 - brcmf_sdio_clkctl(bus, CLK_AVAIL, false); - /* Leave the device in state where it is - * 'passive'. This is done by resetting all -diff --git a/package/kernel/mac80211/patches/346-brcmfmac-avoid-runtime-pm-for-sdio-host-controller.patch b/package/kernel/mac80211/patches/346-brcmfmac-avoid-runtime-pm-for-sdio-host-controller.patch +diff --git a/package/kernel/mac80211/patches/336-ath9k-declare-required-extra-tx-headroom.patch b/package/kernel/mac80211/patches/336-ath9k-declare-required-extra-tx-headroom.patch +new file mode 100644 +index 0000000..4d88591 +--- /dev/null ++++ b/package/kernel/mac80211/patches/336-ath9k-declare-required-extra-tx-headroom.patch +@@ -0,0 +1,22 @@ ++From: Felix Fietkau ++Date: Thu, 24 Sep 2015 16:57:37 +0200 ++Subject: [PATCH] ath9k: declare required extra tx headroom ++ ++ath9k inserts padding between the 802.11 header and the data area (to ++align it). Since it didn't declare this extra required headroom, this ++led to some nasty issues like randomly dropped packets in some setups. ++ ++Cc: stable@vger.kernel.org ++Signed-off-by: Felix Fietkau ++--- ++ ++--- a/drivers/net/wireless/ath/ath9k/init.c +++++ b/drivers/net/wireless/ath/ath9k/init.c ++@@ -875,6 +875,7 @@ static void ath9k_set_hw_capab(struct at ++ hw->max_rate_tries = 10; ++ hw->sta_data_size = sizeof(struct ath_node); ++ hw->vif_data_size = sizeof(struct ath_vif); +++ hw->extra_tx_headroom = 4; ++ ++ hw->wiphy->available_antennas_rx = BIT(ah->caps.max_rxchains) - 1; ++ hw->wiphy->available_antennas_tx = BIT(ah->caps.max_txchains) - 1; +diff --git a/package/kernel/mac80211/patches/337-0001-brcmfmac-avoid-runtime-pm-for-sdio-host-controller.patch b/package/kernel/mac80211/patches/337-0001-brcmfmac-avoid-runtime-pm-for-sdio-host-controller.patch deleted file mode 100644 index af76f13..0000000 ---- a/package/kernel/mac80211/patches/346-brcmfmac-avoid-runtime-pm-for-sdio-host-controller.patch +--- a/package/kernel/mac80211/patches/337-0001-brcmfmac-avoid-runtime-pm-for-sdio-host-controller.patch +++ /dev/null @@ -1,44 +0,0 @@ -From: Arend van Spriel @@ -14764,10 +14931,10 @@ index af76f13..0000000 - out: - if (ret) - brcmf_sdiod_remove(sdiodev); -diff --git a/package/kernel/mac80211/patches/347-brcmfmac-Add-necessary-memory-barriers-for-SDIO.patch b/package/kernel/mac80211/patches/347-brcmfmac-Add-necessary-memory-barriers-for-SDIO.patch +diff --git a/package/kernel/mac80211/patches/337-0002-brcmfmac-Add-necessary-memory-barriers-for-SDIO.patch b/package/kernel/mac80211/patches/337-0002-brcmfmac-Add-necessary-memory-barriers-for-SDIO.patch deleted file mode 100644 index c419cc6..0000000 ---- a/package/kernel/mac80211/patches/347-brcmfmac-Add-necessary-memory-barriers-for-SDIO.patch +--- a/package/kernel/mac80211/patches/337-0002-brcmfmac-Add-necessary-memory-barriers-for-SDIO.patch +++ /dev/null @@ -1,171 +0,0 @@ -From: Hante Meuleman @@ -14941,10 +15108,10 @@ index c419cc6..0000000 - - /* Assign bus interface call back */ - bus->sdiodev->bus_if->dev = bus->sdiodev->dev; -diff --git a/package/kernel/mac80211/patches/348-brcmfmac-Remove-unnecessary-new-line-in-pcie-console.patch b/package/kernel/mac80211/patches/348-brcmfmac-Remove-unnecessary-new-line-in-pcie-console.patch +diff --git a/package/kernel/mac80211/patches/337-0003-brcmfmac-Remove-unnecessary-new-line-in-pcie-console.patch b/package/kernel/mac80211/patches/337-0003-brcmfmac-Remove-unnecessary-new-line-in-pcie-console.patch deleted file mode 100644 index 1bc98a0..0000000 ---- a/package/kernel/mac80211/patches/348-brcmfmac-Remove-unnecessary-new-line-in-pcie-console.patch +--- a/package/kernel/mac80211/patches/337-0003-brcmfmac-Remove-unnecessary-new-line-in-pcie-console.patch +++ /dev/null @@ -1,26 +0,0 @@ -From: Hante Meuleman @@ -14973,10 +15140,10 @@ index 1bc98a0..0000000 - console->log_idx = 0; - } - } -diff --git a/package/kernel/mac80211/patches/349-brcmfmac-add-MODULE_FIRMWARE-macros-for-bcm4356-PCIe.patch b/package/kernel/mac80211/patches/349-brcmfmac-add-MODULE_FIRMWARE-macros-for-bcm4356-PCIe.patch +diff --git a/package/kernel/mac80211/patches/337-0004-brcmfmac-add-MODULE_FIRMWARE-macros-for-bcm4356-PCIe.patch b/package/kernel/mac80211/patches/337-0004-brcmfmac-add-MODULE_FIRMWARE-macros-for-bcm4356-PCIe.patch deleted file mode 100644 index fcf0bf3..0000000 ---- a/package/kernel/mac80211/patches/349-brcmfmac-add-MODULE_FIRMWARE-macros-for-bcm4356-PCIe.patch +--- a/package/kernel/mac80211/patches/337-0004-brcmfmac-add-MODULE_FIRMWARE-macros-for-bcm4356-PCIe.patch +++ /dev/null @@ -1,26 +0,0 @@ -From: Arend van Spriel @@ -15005,10 +15172,10 @@ index fcf0bf3..0000000 - MODULE_FIRMWARE(BRCMF_PCIE_43570_FW_NAME); - MODULE_FIRMWARE(BRCMF_PCIE_43570_NVRAM_NAME); - -diff --git a/package/kernel/mac80211/patches/350-brcmfmac-add-support-for-BCM43430-SDIO-chipset.patch b/package/kernel/mac80211/patches/350-brcmfmac-add-support-for-BCM43430-SDIO-chipset.patch +diff --git a/package/kernel/mac80211/patches/337-0005-brcmfmac-add-support-for-BCM43430-SDIO-chipset.patch b/package/kernel/mac80211/patches/337-0005-brcmfmac-add-support-for-BCM43430-SDIO-chipset.patch deleted file mode 100644 index b3e9bc9..0000000 ---- a/package/kernel/mac80211/patches/350-brcmfmac-add-support-for-BCM43430-SDIO-chipset.patch +--- a/package/kernel/mac80211/patches/337-0005-brcmfmac-add-support-for-BCM43430-SDIO-chipset.patch +++ /dev/null @@ -1,138 +0,0 @@ -From: Arend van Spriel @@ -15149,10 +15316,10 @@ index b3e9bc9..0000000 - #define SDIO_DEVICE_ID_BROADCOM_4345 0x4345 - #define SDIO_DEVICE_ID_BROADCOM_4354 0x4354 - -diff --git a/package/kernel/mac80211/patches/351-brcmfmac-only-support-the-BCM43455-7-device.patch b/package/kernel/mac80211/patches/351-brcmfmac-only-support-the-BCM43455-7-device.patch +diff --git a/package/kernel/mac80211/patches/337-0006-brcmfmac-only-support-the-BCM43455-7-device.patch b/package/kernel/mac80211/patches/337-0006-brcmfmac-only-support-the-BCM43455-7-device.patch deleted file mode 100644 index c3d7bc2..0000000 ---- a/package/kernel/mac80211/patches/351-brcmfmac-only-support-the-BCM43455-7-device.patch +--- a/package/kernel/mac80211/patches/337-0006-brcmfmac-only-support-the-BCM43455-7-device.patch +++ /dev/null @@ -1,50 +0,0 @@ -From: Arend van Spriel @@ -15205,10 +15372,10 @@ index c3d7bc2..0000000 - { BRCM_CC_4354_CHIP_ID, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4354) } - }; - -diff --git a/package/kernel/mac80211/patches/352-brcmfmac-remove-support-for-unreleased-BCM4354-PCIe.patch b/package/kernel/mac80211/patches/352-brcmfmac-remove-support-for-unreleased-BCM4354-PCIe.patch +diff --git a/package/kernel/mac80211/patches/337-0007-brcmfmac-remove-support-for-unreleased-BCM4354-PCIe.patch b/package/kernel/mac80211/patches/337-0007-brcmfmac-remove-support-for-unreleased-BCM4354-PCIe.patch deleted file mode 100644 index a62cfdf..0000000 ---- a/package/kernel/mac80211/patches/352-brcmfmac-remove-support-for-unreleased-BCM4354-PCIe.patch +--- a/package/kernel/mac80211/patches/337-0007-brcmfmac-remove-support-for-unreleased-BCM4354-PCIe.patch +++ /dev/null @@ -1,52 +0,0 @@ -From: Arend van Spriel @@ -15263,10 +15430,53 @@ index a62cfdf..0000000 - BRCMF_PCIE_DEVICE(BRCM_PCIE_4356_DEVICE_ID), - BRCMF_PCIE_DEVICE(BRCM_PCIE_43567_DEVICE_ID), - BRCMF_PCIE_DEVICE(BRCM_PCIE_43570_DEVICE_ID), -diff --git a/package/kernel/mac80211/patches/353-brcmfmac-disable-MBSS-feature-for-BCM43362.patch b/package/kernel/mac80211/patches/353-brcmfmac-disable-MBSS-feature-for-BCM43362.patch +diff --git a/package/kernel/mac80211/patches/337-nl80211-put-current-TX-power-in-interface-info.patch b/package/kernel/mac80211/patches/337-nl80211-put-current-TX-power-in-interface-info.patch +new file mode 100644 +index 0000000..df2cc4b +--- /dev/null ++++ b/package/kernel/mac80211/patches/337-nl80211-put-current-TX-power-in-interface-info.patch +@@ -0,0 +1,37 @@ ++From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= ++Date: Mon, 31 Aug 2015 22:59:38 +0200 ++Subject: [PATCH] nl80211: put current TX power in interface info ++MIME-Version: 1.0 ++Content-Type: text/plain; charset=UTF-8 ++Content-Transfer-Encoding: 8bit ++ ++Many drivers implement reading current TX power (using either cfg80211 ++or ieee80211 op) but userspace can't get it using nl80211. Right now the ++only way to access it is to call some wext ioctl. ++Let's put TX power in interface info reply (callback is wdev specific) ++just like we do with current channel. ++To be consistent (e.g. NL80211_CMD_SET_WIPHY) let's use mBm as na unit. ++ ++Signed-off-by: Rafał Miłecki ++Signed-off-by: Johannes Berg ++--- ++ ++--- a/net/wireless/nl80211.c +++++ b/net/wireless/nl80211.c ++@@ -2406,6 +2406,16 @@ static int nl80211_send_iface(struct sk_ ++ } ++ } ++ +++ if (rdev->ops->get_tx_power) { +++ int dbm, ret; +++ +++ ret = rdev_get_tx_power(rdev, wdev, &dbm); +++ if (ret == 0 && +++ nla_put_u32(msg, NL80211_ATTR_WIPHY_TX_POWER_LEVEL, +++ DBM_TO_MBM(dbm))) +++ goto nla_put_failure; +++ } +++ ++ if (wdev->ssid_len) { ++ if (nla_put(msg, NL80211_ATTR_SSID, wdev->ssid_len, wdev->ssid)) ++ goto nla_put_failure; +diff --git a/package/kernel/mac80211/patches/338-brcmfmac-disable-MBSS-feature-for-BCM43362.patch b/package/kernel/mac80211/patches/338-brcmfmac-disable-MBSS-feature-for-BCM43362.patch deleted file mode 100644 index 366ff85..0000000 ---- a/package/kernel/mac80211/patches/353-brcmfmac-disable-MBSS-feature-for-BCM43362.patch +--- a/package/kernel/mac80211/patches/338-brcmfmac-disable-MBSS-feature-for-BCM43362.patch +++ /dev/null @@ -1,28 +0,0 @@ -From: Arend van Spriel @@ -15297,10 +15507,37 @@ index 366ff85..0000000 - - /* set chip related quirks */ - switch (drvr->bus_if->chip) { -diff --git a/package/kernel/mac80211/patches/354-brcmfmac-use-static-superset-of-channels-for-wiphy-b.patch b/package/kernel/mac80211/patches/354-brcmfmac-use-static-superset-of-channels-for-wiphy-b.patch +diff --git a/package/kernel/mac80211/patches/338-mac80211-initialize-tid-field-in-struct-ieee80211_tx.patch b/package/kernel/mac80211/patches/338-mac80211-initialize-tid-field-in-struct-ieee80211_tx.patch +new file mode 100644 +index 0000000..2f492e0 +--- /dev/null ++++ b/package/kernel/mac80211/patches/338-mac80211-initialize-tid-field-in-struct-ieee80211_tx.patch +@@ -0,0 +1,21 @@ ++From: Felix Fietkau ++Date: Mon, 5 Oct 2015 17:41:25 +0200 ++Subject: [PATCH] mac80211: initialize tid field in struct ieee80211_txq ++ ++Signed-off-by: Felix Fietkau ++--- ++ ++--- a/net/mac80211/util.c +++++ b/net/mac80211/util.c ++@@ -3288,9 +3288,11 @@ void ieee80211_init_tx_queue(struct ieee ++ if (sta) { ++ txqi->txq.sta = &sta->sta; ++ sta->sta.txq[tid] = &txqi->txq; +++ txqi->txq.tid = tid; ++ txqi->txq.ac = ieee802_1d_to_ac[tid & 7]; ++ } else { ++ sdata->vif.txq = &txqi->txq; +++ txqi->txq.tid = 0; ++ txqi->txq.ac = IEEE80211_AC_BE; ++ } ++ } +diff --git a/package/kernel/mac80211/patches/339-0001-brcmfmac-use-static-superset-of-channels-for-wiphy-b.patch b/package/kernel/mac80211/patches/339-0001-brcmfmac-use-static-superset-of-channels-for-wiphy-b.patch deleted file mode 100644 index 6e461f6..0000000 ---- a/package/kernel/mac80211/patches/354-brcmfmac-use-static-superset-of-channels-for-wiphy-b.patch +--- a/package/kernel/mac80211/patches/339-0001-brcmfmac-use-static-superset-of-channels-for-wiphy-b.patch +++ /dev/null @@ -1,300 +0,0 @@ -From: Arend van Spriel @@ -15603,10 +15840,10 @@ index 6e461f6..0000000 - kfree(wiphy->iface_combinations); - if (wiphy->bands[IEEE80211_BAND_2GHZ]) { - kfree(wiphy->bands[IEEE80211_BAND_2GHZ]->channels); -diff --git a/package/kernel/mac80211/patches/355-brcmfmac-update-wiphy-band-information-upon-updating.patch b/package/kernel/mac80211/patches/355-brcmfmac-update-wiphy-band-information-upon-updating.patch +diff --git a/package/kernel/mac80211/patches/339-0002-brcmfmac-update-wiphy-band-information-upon-updating.patch b/package/kernel/mac80211/patches/339-0002-brcmfmac-update-wiphy-band-information-upon-updating.patch deleted file mode 100644 index a0c22eb..0000000 ---- a/package/kernel/mac80211/patches/355-brcmfmac-update-wiphy-band-information-upon-updating.patch +--- a/package/kernel/mac80211/patches/339-0002-brcmfmac-update-wiphy-band-information-upon-updating.patch +++ /dev/null @@ -1,29 +0,0 @@ -From: Arend van Spriel @@ -15638,10 +15875,10 @@ index a0c22eb..0000000 - } - - static void brcmf_free_wiphy(struct wiphy *wiphy) -diff --git a/package/kernel/mac80211/patches/356-brcmfmac-add-description-for-feature-flags.patch b/package/kernel/mac80211/patches/356-brcmfmac-add-description-for-feature-flags.patch +diff --git a/package/kernel/mac80211/patches/339-0003-brcmfmac-add-description-for-feature-flags.patch b/package/kernel/mac80211/patches/339-0003-brcmfmac-add-description-for-feature-flags.patch deleted file mode 100644 index 193f507..0000000 ---- a/package/kernel/mac80211/patches/356-brcmfmac-add-description-for-feature-flags.patch +--- a/package/kernel/mac80211/patches/339-0003-brcmfmac-add-description-for-feature-flags.patch +++ /dev/null @@ -1,24 +0,0 @@ -From: Arend van Spriel @@ -15668,10 +15905,10 @@ index 193f507..0000000 - */ - #define BRCMF_FEAT_LIST \ - BRCMF_FEAT_DEF(MBSS) \ -diff --git a/package/kernel/mac80211/patches/357-brcmfmac-make-scheduled-scan-support-conditional.patch b/package/kernel/mac80211/patches/357-brcmfmac-make-scheduled-scan-support-conditional.patch +diff --git a/package/kernel/mac80211/patches/339-0004-brcmfmac-make-scheduled-scan-support-conditional.patch b/package/kernel/mac80211/patches/339-0004-brcmfmac-make-scheduled-scan-support-conditional.patch deleted file mode 100644 index 42330b4..0000000 ---- a/package/kernel/mac80211/patches/357-brcmfmac-make-scheduled-scan-support-conditional.patch +--- a/package/kernel/mac80211/patches/339-0004-brcmfmac-make-scheduled-scan-support-conditional.patch +++ /dev/null @@ -1,51 +0,0 @@ -From: Arend van Spriel @@ -15725,10 +15962,10 @@ index 42330b4..0000000 - BRCMF_FEAT_DEF(WOWL) - /* - * Quirks: -diff --git a/package/kernel/mac80211/patches/358-brcmfmac-add-support-for-BCM4324-rev-B5-chipset.patch b/package/kernel/mac80211/patches/358-brcmfmac-add-support-for-BCM4324-rev-B5-chipset.patch +diff --git a/package/kernel/mac80211/patches/339-0005-brcmfmac-add-support-for-BCM4324-rev-B5-chipset.patch b/package/kernel/mac80211/patches/339-0005-brcmfmac-add-support-for-BCM4324-rev-B5-chipset.patch deleted file mode 100644 index b859d46..0000000 ---- a/package/kernel/mac80211/patches/358-brcmfmac-add-support-for-BCM4324-rev-B5-chipset.patch +--- a/package/kernel/mac80211/patches/339-0005-brcmfmac-add-support-for-BCM4324-rev-B5-chipset.patch +++ /dev/null @@ -1,43 +0,0 @@ -From: Arend van Spriel @@ -15774,10 +16011,10 @@ index b859d46..0000000 - { BRCM_CC_4329_CHIP_ID, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4329) }, - { BRCM_CC_4330_CHIP_ID, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4330) }, - { BRCM_CC_4334_CHIP_ID, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4334) }, -diff --git a/package/kernel/mac80211/patches/359-brcmfmac-process-interrupt-regardless-sdiod-state.patch b/package/kernel/mac80211/patches/359-brcmfmac-process-interrupt-regardless-sdiod-state.patch +diff --git a/package/kernel/mac80211/patches/339-0006-brcmfmac-process-interrupt-regardless-sdiod-state.patch b/package/kernel/mac80211/patches/339-0006-brcmfmac-process-interrupt-regardless-sdiod-state.patch deleted file mode 100644 index d420308..0000000 ---- a/package/kernel/mac80211/patches/359-brcmfmac-process-interrupt-regardless-sdiod-state.patch +--- a/package/kernel/mac80211/patches/339-0006-brcmfmac-process-interrupt-regardless-sdiod-state.patch +++ /dev/null @@ -1,27 +0,0 @@ -From: Arend van Spriel @@ -15807,10 +16044,10 @@ index d420308..0000000 - /* Count the interrupt call */ - bus->sdcnt.intrcount++; - if (in_interrupt()) -diff --git a/package/kernel/mac80211/patches/360-brcmfmac-fix-sdio-suspend-and-resume.patch b/package/kernel/mac80211/patches/360-brcmfmac-fix-sdio-suspend-and-resume.patch +diff --git a/package/kernel/mac80211/patches/339-0007-brcmfmac-fix-sdio-suspend-and-resume.patch b/package/kernel/mac80211/patches/339-0007-brcmfmac-fix-sdio-suspend-and-resume.patch deleted file mode 100644 index ac5584e..0000000 ---- a/package/kernel/mac80211/patches/360-brcmfmac-fix-sdio-suspend-and-resume.patch +--- a/package/kernel/mac80211/patches/339-0007-brcmfmac-fix-sdio-suspend-and-resume.patch +++ /dev/null @@ -1,68 +0,0 @@ -From: Arend van Spriel @@ -15881,10 +16118,10 @@ index ac5584e..0000000 - return 0; - } - -diff --git a/package/kernel/mac80211/patches/361-brcmfmac-add-support-for-BCM4358-PCIe-device.patch b/package/kernel/mac80211/patches/361-brcmfmac-add-support-for-BCM4358-PCIe-device.patch +diff --git a/package/kernel/mac80211/patches/339-0008-brcmfmac-add-support-for-BCM4358-PCIe-device.patch b/package/kernel/mac80211/patches/339-0008-brcmfmac-add-support-for-BCM4358-PCIe-device.patch deleted file mode 100644 index a521b65..0000000 ---- a/package/kernel/mac80211/patches/361-brcmfmac-add-support-for-BCM4358-PCIe-device.patch +--- a/package/kernel/mac80211/patches/339-0008-brcmfmac-add-support-for-BCM4358-PCIe-device.patch +++ /dev/null @@ -1,77 +0,0 @@ -From: Arend van Spriel @@ -15964,10 +16201,10 @@ index a521b65..0000000 - #define BRCM_PCIE_43602_DEVICE_ID 0x43ba - #define BRCM_PCIE_43602_2G_DEVICE_ID 0x43bb - #define BRCM_PCIE_43602_5G_DEVICE_ID 0x43bc -diff --git a/package/kernel/mac80211/patches/362-brcmfmac-add-additional-43602-pcie-device-id.patch b/package/kernel/mac80211/patches/362-brcmfmac-add-additional-43602-pcie-device-id.patch +diff --git a/package/kernel/mac80211/patches/339-0009-brcmfmac-add-additional-43602-pcie-device-id.patch b/package/kernel/mac80211/patches/339-0009-brcmfmac-add-additional-43602-pcie-device-id.patch deleted file mode 100644 index bcbb984..0000000 ---- a/package/kernel/mac80211/patches/362-brcmfmac-add-additional-43602-pcie-device-id.patch +--- a/package/kernel/mac80211/patches/339-0009-brcmfmac-add-additional-43602-pcie-device-id.patch +++ /dev/null @@ -1,30 +0,0 @@ -From: Hante Meuleman @@ -16000,10 +16237,10 @@ index bcbb984..0000000 - - /* brcmsmac IDs */ - #define BCM4313_D11N2G_ID 0x4727 /* 4313 802.11n 2.4G device */ -diff --git a/package/kernel/mac80211/patches/363-brcmfmac-Add-support-for-multiple-PCIE-devices-in-nv.patch b/package/kernel/mac80211/patches/363-brcmfmac-Add-support-for-multiple-PCIE-devices-in-nv.patch +diff --git a/package/kernel/mac80211/patches/339-0010-brcmfmac-Add-support-for-multiple-PCIE-devices-in-nv.patch b/package/kernel/mac80211/patches/339-0010-brcmfmac-Add-support-for-multiple-PCIE-devices-in-nv.patch deleted file mode 100644 index 5f9bbea..0000000 ---- a/package/kernel/mac80211/patches/363-brcmfmac-Add-support-for-multiple-PCIE-devices-in-nv.patch +--- a/package/kernel/mac80211/patches/339-0010-brcmfmac-Add-support-for-multiple-PCIE-devices-in-nv.patch +++ /dev/null @@ -1,351 +0,0 @@ -From: Hante Meuleman @@ -16357,10 +16594,10 @@ index 5f9bbea..0000000 - if (ret == 0) - return 0; - fail_bus: -diff --git a/package/kernel/mac80211/patches/364-brcmfmac-cleanup-a-sizeof.patch b/package/kernel/mac80211/patches/364-brcmfmac-cleanup-a-sizeof.patch +diff --git a/package/kernel/mac80211/patches/340-brcmfmac-cleanup-a-sizeof.patch b/package/kernel/mac80211/patches/340-brcmfmac-cleanup-a-sizeof.patch deleted file mode 100644 index d26e118..0000000 ---- a/package/kernel/mac80211/patches/364-brcmfmac-cleanup-a-sizeof.patch +--- a/package/kernel/mac80211/patches/340-brcmfmac-cleanup-a-sizeof.patch +++ /dev/null @@ -1,23 +0,0 @@ -From: Dan Carpenter @@ -16386,10 +16623,10 @@ index d26e118..0000000 - GFP_KERNEL); - if (!flowrings) - goto fail; -diff --git a/package/kernel/mac80211/patches/365-brcmfmac-check-result-of-USB-firmware-request.patch b/package/kernel/mac80211/patches/365-brcmfmac-check-result-of-USB-firmware-request.patch +diff --git a/package/kernel/mac80211/patches/341-brcmfmac-check-result-of-USB-firmware-request.patch b/package/kernel/mac80211/patches/341-brcmfmac-check-result-of-USB-firmware-request.patch deleted file mode 100644 index 9b2880d..0000000 ---- a/package/kernel/mac80211/patches/365-brcmfmac-check-result-of-USB-firmware-request.patch +--- a/package/kernel/mac80211/patches/341-brcmfmac-check-result-of-USB-firmware-request.patch +++ /dev/null @@ -1,33 +0,0 @@ -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= @@ -16425,10 +16662,10 @@ index 9b2880d..0000000 - return 0; - - fail: -diff --git a/package/kernel/mac80211/patches/366-brcmfmac-prohibit-ACPI-power-management-for-brcmfmac.patch b/package/kernel/mac80211/patches/366-brcmfmac-prohibit-ACPI-power-management-for-brcmfmac.patch +diff --git a/package/kernel/mac80211/patches/342-brcmfmac-prohibit-ACPI-power-management-for-brcmfmac.patch b/package/kernel/mac80211/patches/342-brcmfmac-prohibit-ACPI-power-management-for-brcmfmac.patch deleted file mode 100644 index d46b300..0000000 ---- a/package/kernel/mac80211/patches/366-brcmfmac-prohibit-ACPI-power-management-for-brcmfmac.patch +--- a/package/kernel/mac80211/patches/342-brcmfmac-prohibit-ACPI-power-management-for-brcmfmac.patch +++ /dev/null @@ -1,47 +0,0 @@ -From: "Fu, Zhonghui" @@ -16478,10 +16715,10 @@ index d46b300..0000000 - /* Consume func num 1 but dont do anything with it. */ - if (func->num == 1) - return 0; -diff --git a/package/kernel/mac80211/patches/367-brcmfmac-avoid-gcc-5.1-warning.patch b/package/kernel/mac80211/patches/367-brcmfmac-avoid-gcc-5.1-warning.patch +diff --git a/package/kernel/mac80211/patches/343-brcmfmac-avoid-gcc-5.1-warning.patch b/package/kernel/mac80211/patches/343-brcmfmac-avoid-gcc-5.1-warning.patch deleted file mode 100644 index 9b4609f..0000000 ---- a/package/kernel/mac80211/patches/367-brcmfmac-avoid-gcc-5.1-warning.patch +--- a/package/kernel/mac80211/patches/343-brcmfmac-avoid-gcc-5.1-warning.patch +++ /dev/null @@ -1,30 +0,0 @@ -From: Arnd Bergmann @@ -16514,10 +16751,10 @@ index 9b4609f..0000000 - u32 slot_id, struct sk_buff **pktout, - bool remove_item) - { -diff --git a/package/kernel/mac80211/patches/368-brcmfmac-allow-device-tree-node-without-interrupts-p.patch b/package/kernel/mac80211/patches/368-brcmfmac-allow-device-tree-node-without-interrupts-p.patch +diff --git a/package/kernel/mac80211/patches/344-0001-brcmfmac-allow-device-tree-node-without-interrupts-p.patch b/package/kernel/mac80211/patches/344-0001-brcmfmac-allow-device-tree-node-without-interrupts-p.patch deleted file mode 100644 index b16782d..0000000 ---- a/package/kernel/mac80211/patches/368-brcmfmac-allow-device-tree-node-without-interrupts-p.patch +--- a/package/kernel/mac80211/patches/344-0001-brcmfmac-allow-device-tree-node-without-interrupts-p.patch +++ /dev/null @@ -1,45 +0,0 @@ -From: Arend van Spriel @@ -16565,10 +16802,10 @@ index b16782d..0000000 -- if (of_property_read_u32(np, "brcm,drive-strength", &val) == 0) -- sdiodev->pdata->drive_strength = val; - } -diff --git a/package/kernel/mac80211/patches/369-brcmfmac-Improve-throughput-by-scheduling-msbug-flow.patch b/package/kernel/mac80211/patches/369-brcmfmac-Improve-throughput-by-scheduling-msbug-flow.patch +diff --git a/package/kernel/mac80211/patches/344-0002-brcmfmac-Improve-throughput-by-scheduling-msbug-flow.patch b/package/kernel/mac80211/patches/344-0002-brcmfmac-Improve-throughput-by-scheduling-msbug-flow.patch deleted file mode 100644 index f81250e..0000000 ---- a/package/kernel/mac80211/patches/369-brcmfmac-Improve-throughput-by-scheduling-msbug-flow.patch +--- a/package/kernel/mac80211/patches/344-0002-brcmfmac-Improve-throughput-by-scheduling-msbug-flow.patch +++ /dev/null @@ -1,87 +0,0 @@ -From: Hante Meuleman @@ -16658,10 +16895,10 @@ index f81250e..0000000 - - return 0; - } -diff --git a/package/kernel/mac80211/patches/370-brcmfmac-remove-pci-shared-structure-rev4-support.patch b/package/kernel/mac80211/patches/370-brcmfmac-remove-pci-shared-structure-rev4-support.patch +diff --git a/package/kernel/mac80211/patches/344-0003-brcmfmac-remove-pci-shared-structure-rev4-support.patch b/package/kernel/mac80211/patches/344-0003-brcmfmac-remove-pci-shared-structure-rev4-support.patch deleted file mode 100644 index 61153c4..0000000 ---- a/package/kernel/mac80211/patches/370-brcmfmac-remove-pci-shared-structure-rev4-support.patch +--- a/package/kernel/mac80211/patches/344-0003-brcmfmac-remove-pci-shared-structure-rev4-support.patch +++ /dev/null @@ -1,41 +0,0 @@ -From: Franky Lin @@ -16705,10 +16942,10 @@ index 61153c4..0000000 - - addr = sharedram_addr + BRCMF_SHARED_MAX_RXBUFPOST_OFFSET; - shared->max_rxbufpost = brcmf_pcie_read_tcm16(devinfo, addr); -diff --git a/package/kernel/mac80211/patches/371-brcmfmac-remove-dummy-cache-flush-invalidate-functio.patch b/package/kernel/mac80211/patches/371-brcmfmac-remove-dummy-cache-flush-invalidate-functio.patch +diff --git a/package/kernel/mac80211/patches/344-0004-brcmfmac-remove-dummy-cache-flush-invalidate-functio.patch b/package/kernel/mac80211/patches/344-0004-brcmfmac-remove-dummy-cache-flush-invalidate-functio.patch deleted file mode 100644 index 8c8eebe..0000000 ---- a/package/kernel/mac80211/patches/371-brcmfmac-remove-dummy-cache-flush-invalidate-functio.patch +--- a/package/kernel/mac80211/patches/344-0004-brcmfmac-remove-dummy-cache-flush-invalidate-functio.patch +++ /dev/null @@ -1,120 +0,0 @@ -From: Franky Lin @@ -16831,10 +17068,10 @@ index 8c8eebe..0000000 - - addr = devinfo->shared.tcm_base_address + - BRCMF_SHARED_DMA_RINGUPD_ADDR_OFFSET; -diff --git a/package/kernel/mac80211/patches/372-brcmfmac-add-support-for-dma-indices-feature.patch b/package/kernel/mac80211/patches/372-brcmfmac-add-support-for-dma-indices-feature.patch +diff --git a/package/kernel/mac80211/patches/344-0005-brcmfmac-add-support-for-dma-indices-feature.patch b/package/kernel/mac80211/patches/344-0005-brcmfmac-add-support-for-dma-indices-feature.patch deleted file mode 100644 index 2f50abd..0000000 ---- a/package/kernel/mac80211/patches/372-brcmfmac-add-support-for-dma-indices-feature.patch +--- a/package/kernel/mac80211/patches/344-0005-brcmfmac-add-support-for-dma-indices-feature.patch +++ /dev/null @@ -1,270 +0,0 @@ -From: Franky Lin @@ -17107,10 +17344,10 @@ index 2f50abd..0000000 - addr = sharedram_addr + BRCMF_SHARED_MAX_RXBUFPOST_OFFSET; - shared->max_rxbufpost = brcmf_pcie_read_tcm16(devinfo, addr); - if (shared->max_rxbufpost == 0) -diff --git a/package/kernel/mac80211/patches/373-brcmfmac-avoid-null-pointer-access-when-brcmf_msgbuf.patch b/package/kernel/mac80211/patches/373-brcmfmac-avoid-null-pointer-access-when-brcmf_msgbuf.patch +diff --git a/package/kernel/mac80211/patches/345-brcmfmac-avoid-null-pointer-access-when-brcmf_msgbuf.patch b/package/kernel/mac80211/patches/345-brcmfmac-avoid-null-pointer-access-when-brcmf_msgbuf.patch deleted file mode 100644 index 28408d2..0000000 ---- a/package/kernel/mac80211/patches/373-brcmfmac-avoid-null-pointer-access-when-brcmf_msgbuf.patch +--- a/package/kernel/mac80211/patches/345-brcmfmac-avoid-null-pointer-access-when-brcmf_msgbuf.patch +++ /dev/null @@ -1,102 +0,0 @@ -From: Arend van Spriel @@ -17215,10 +17452,10 @@ index 28408d2..0000000 - - if (data_offset) - skb_pull(skb, data_offset); -diff --git a/package/kernel/mac80211/patches/374-brcmfmac-fix-invalid-access-to-struct-acpi_device-fi.patch b/package/kernel/mac80211/patches/374-brcmfmac-fix-invalid-access-to-struct-acpi_device-fi.patch +diff --git a/package/kernel/mac80211/patches/346-brcmfmac-fix-invalid-access-to-struct-acpi_device-fi.patch b/package/kernel/mac80211/patches/346-brcmfmac-fix-invalid-access-to-struct-acpi_device-fi.patch deleted file mode 100644 index f023034..0000000 ---- a/package/kernel/mac80211/patches/374-brcmfmac-fix-invalid-access-to-struct-acpi_device-fi.patch +--- a/package/kernel/mac80211/patches/346-brcmfmac-fix-invalid-access-to-struct-acpi_device-fi.patch +++ /dev/null @@ -1,63 +0,0 @@ -From: Arend van Spriel @@ -17284,10 +17521,10 @@ index f023034..0000000 - - /* Consume func num 1 but dont do anything with it. */ - if (func->num == 1) -diff --git a/package/kernel/mac80211/patches/375-brcmfmac-simplify-check-stripping-v2-NVRAM.patch b/package/kernel/mac80211/patches/375-brcmfmac-simplify-check-stripping-v2-NVRAM.patch +diff --git a/package/kernel/mac80211/patches/347-brcmfmac-simplify-check-stripping-v2-NVRAM.patch b/package/kernel/mac80211/patches/347-brcmfmac-simplify-check-stripping-v2-NVRAM.patch deleted file mode 100644 index 2bfd44f..0000000 ---- a/package/kernel/mac80211/patches/375-brcmfmac-simplify-check-stripping-v2-NVRAM.patch +--- a/package/kernel/mac80211/patches/347-brcmfmac-simplify-check-stripping-v2-NVRAM.patch +++ /dev/null @@ -1,56 +0,0 @@ -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= @@ -17346,10 +17583,10 @@ index 2bfd44f..0000000 - while (nvp->nvram[i] != 0) { - nvram[j] = nvp->nvram[i]; - i++; -diff --git a/package/kernel/mac80211/patches/376-brcmfmac-simplify-check-finding-NVRAM-v1-device-path.patch b/package/kernel/mac80211/patches/376-brcmfmac-simplify-check-finding-NVRAM-v1-device-path.patch +diff --git a/package/kernel/mac80211/patches/348-brcmfmac-simplify-check-finding-NVRAM-v1-device-path.patch b/package/kernel/mac80211/patches/348-brcmfmac-simplify-check-finding-NVRAM-v1-device-path.patch deleted file mode 100644 index 0e65114..0000000 ---- a/package/kernel/mac80211/patches/376-brcmfmac-simplify-check-finding-NVRAM-v1-device-path.patch +--- a/package/kernel/mac80211/patches/348-brcmfmac-simplify-check-finding-NVRAM-v1-device-path.patch +++ /dev/null @@ -1,57 +0,0 @@ -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= @@ -17409,10 +17646,10 @@ index 0e65114..0000000 - } - while (nvp->nvram[i] != 0) - i++; -diff --git a/package/kernel/mac80211/patches/377-brcmfmac-treat-0-as-end-of-comment-when-parsing-NVRA.patch b/package/kernel/mac80211/patches/377-brcmfmac-treat-0-as-end-of-comment-when-parsing-NVRA.patch +diff --git a/package/kernel/mac80211/patches/349-brcmfmac-treat-0-as-end-of-comment-when-parsing-NVRA.patch b/package/kernel/mac80211/patches/349-brcmfmac-treat-0-as-end-of-comment-when-parsing-NVRA.patch deleted file mode 100644 index dc174e5..0000000 ---- a/package/kernel/mac80211/patches/377-brcmfmac-treat-0-as-end-of-comment-when-parsing-NVRA.patch +--- a/package/kernel/mac80211/patches/349-brcmfmac-treat-0-as-end-of-comment-when-parsing-NVRA.patch +++ /dev/null @@ -1,45 +0,0 @@ -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= @@ -17460,10 +17697,10 @@ index dc174e5..0000000 - return IDLE; - } - -diff --git a/package/kernel/mac80211/patches/378-brcmfmac-allow-NVRAM-values-to-contain-spaces.patch b/package/kernel/mac80211/patches/378-brcmfmac-allow-NVRAM-values-to-contain-spaces.patch +diff --git a/package/kernel/mac80211/patches/350-brcmfmac-allow-NVRAM-values-to-contain-spaces.patch b/package/kernel/mac80211/patches/350-brcmfmac-allow-NVRAM-values-to-contain-spaces.patch deleted file mode 100644 index 5700142..0000000 ---- a/package/kernel/mac80211/patches/378-brcmfmac-allow-NVRAM-values-to-contain-spaces.patch +--- a/package/kernel/mac80211/patches/350-brcmfmac-allow-NVRAM-values-to-contain-spaces.patch +++ /dev/null @@ -1,50 +0,0 @@ -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= @@ -17516,10 +17753,10 @@ index 5700142..0000000 - brcmf_dbg(INFO, "warning: ln=%d:col=%d: '=' expected, skip invalid key entry\n", - nvp->line, nvp->column); - return COMMENT; -diff --git a/package/kernel/mac80211/patches/379-ath9k-fix-DMA-stop-sequence-for-AR9003.patch b/package/kernel/mac80211/patches/379-ath9k-fix-DMA-stop-sequence-for-AR9003.patch +diff --git a/package/kernel/mac80211/patches/351-ath9k-fix-DMA-stop-sequence-for-AR9003.patch b/package/kernel/mac80211/patches/351-ath9k-fix-DMA-stop-sequence-for-AR9003.patch deleted file mode 100644 index 814b0d7..0000000 ---- a/package/kernel/mac80211/patches/379-ath9k-fix-DMA-stop-sequence-for-AR9003.patch +--- a/package/kernel/mac80211/patches/351-ath9k-fix-DMA-stop-sequence-for-AR9003.patch +++ /dev/null @@ -1,33 +0,0 @@ -From: Felix Fietkau @@ -17555,10 +17792,10 @@ index 814b0d7..0000000 - - return ret; - } -diff --git a/package/kernel/mac80211/patches/380-brcmfmac-support-NVRAMs-containing-pci-devpaths-inst.patch b/package/kernel/mac80211/patches/380-brcmfmac-support-NVRAMs-containing-pci-devpaths-inst.patch +diff --git a/package/kernel/mac80211/patches/352-brcmfmac-support-NVRAMs-containing-pci-devpaths-inst.patch b/package/kernel/mac80211/patches/352-brcmfmac-support-NVRAMs-containing-pci-devpaths-inst.patch deleted file mode 100644 index 7bbd57e..0000000 ---- a/package/kernel/mac80211/patches/380-brcmfmac-support-NVRAMs-containing-pci-devpaths-inst.patch +--- a/package/kernel/mac80211/patches/352-brcmfmac-support-NVRAMs-containing-pci-devpaths-inst.patch +++ /dev/null @@ -1,56 +0,0 @@ -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= @@ -17617,10 +17854,10 @@ index 7bbd57e..0000000 - id = nvp->nvram[i + 7] - '0'; - found = true; - break; -diff --git a/package/kernel/mac80211/patches/381-brcmfmac-set-wiphy-perm_addr-to-hardware-MAC-address.patch b/package/kernel/mac80211/patches/381-brcmfmac-set-wiphy-perm_addr-to-hardware-MAC-address.patch +diff --git a/package/kernel/mac80211/patches/353-brcmfmac-set-wiphy-perm_addr-to-hardware-MAC-address.patch b/package/kernel/mac80211/patches/353-brcmfmac-set-wiphy-perm_addr-to-hardware-MAC-address.patch deleted file mode 100644 index 1eff6ed..0000000 ---- a/package/kernel/mac80211/patches/381-brcmfmac-set-wiphy-perm_addr-to-hardware-MAC-address.patch +--- a/package/kernel/mac80211/patches/353-brcmfmac-set-wiphy-perm_addr-to-hardware-MAC-address.patch +++ /dev/null @@ -1,23 +0,0 @@ -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= @@ -17646,10 +17883,10 @@ index 1eff6ed..0000000 - set_wiphy_dev(wiphy, busdev); - - cfg = wiphy_priv(wiphy); -diff --git a/package/kernel/mac80211/patches/382-brcmfmac-use-direct-data-pointer-in-NVRAM-parser-str.patch b/package/kernel/mac80211/patches/382-brcmfmac-use-direct-data-pointer-in-NVRAM-parser-str.patch +diff --git a/package/kernel/mac80211/patches/354-brcmfmac-use-direct-data-pointer-in-NVRAM-parser-str.patch b/package/kernel/mac80211/patches/354-brcmfmac-use-direct-data-pointer-in-NVRAM-parser-str.patch deleted file mode 100644 index c6e83dd..0000000 ---- a/package/kernel/mac80211/patches/382-brcmfmac-use-direct-data-pointer-in-NVRAM-parser-str.patch +--- a/package/kernel/mac80211/patches/354-brcmfmac-use-direct-data-pointer-in-NVRAM-parser-str.patch +++ /dev/null @@ -1,144 +0,0 @@ -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= @@ -17796,10 +18033,10 @@ index c6e83dd..0000000 - fwctx->domain_nr, fwctx->bus_nr); - release_firmware(fw); - if (!nvram && !(fwctx->flags & BRCMF_FW_REQ_NV_OPTIONAL)) -diff --git a/package/kernel/mac80211/patches/383-b43-fix-support-for-14e4-4321-PCI-dev-with-BCM4321-c.patch b/package/kernel/mac80211/patches/383-b43-fix-support-for-14e4-4321-PCI-dev-with-BCM4321-c.patch +diff --git a/package/kernel/mac80211/patches/355-b43-fix-support-for-14e4-4321-PCI-dev-with-BCM4321-c.patch b/package/kernel/mac80211/patches/355-b43-fix-support-for-14e4-4321-PCI-dev-with-BCM4321-c.patch deleted file mode 100644 index 4ecef3b..0000000 ---- a/package/kernel/mac80211/patches/383-b43-fix-support-for-14e4-4321-PCI-dev-with-BCM4321-c.patch +--- a/package/kernel/mac80211/patches/355-b43-fix-support-for-14e4-4321-PCI-dev-with-BCM4321-c.patch +++ /dev/null @@ -1,32 +0,0 @@ -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= @@ -17834,10 +18071,10 @@ index 4ecef3b..0000000 - case 0x4313: /* BCM4311 */ - case 0x431a: /* BCM4318 */ - case 0x432a: /* BCM4321 */ -diff --git a/package/kernel/mac80211/patches/384-ath9k-force-rx_clear-when-disabling-rx.patch b/package/kernel/mac80211/patches/384-ath9k-force-rx_clear-when-disabling-rx.patch +diff --git a/package/kernel/mac80211/patches/356-ath9k-force-rx_clear-when-disabling-rx.patch b/package/kernel/mac80211/patches/356-ath9k-force-rx_clear-when-disabling-rx.patch deleted file mode 100644 index bddb15a..0000000 ---- a/package/kernel/mac80211/patches/384-ath9k-force-rx_clear-when-disabling-rx.patch +--- a/package/kernel/mac80211/patches/356-ath9k-force-rx_clear-when-disabling-rx.patch +++ /dev/null @@ -1,31 +0,0 @@ -From: Felix Fietkau @@ -17871,36 +18108,10 @@ index bddb15a..0000000 - - ath9k_hw_disable_mib_counters(ah); - } -diff --git a/package/kernel/mac80211/patches/385-ath9k_hw-fix-device-ID-check-for-AR956x.patch b/package/kernel/mac80211/patches/385-ath9k_hw-fix-device-ID-check-for-AR956x.patch -deleted file mode 100644 -index 2674efb..0000000 ---- a/package/kernel/mac80211/patches/385-ath9k_hw-fix-device-ID-check-for-AR956x.patch -+++ /dev/null -@@ -1,20 +0,0 @@ --From: Felix Fietkau --Date: Sun, 21 Jun 2015 19:45:59 +0200 --Subject: [PATCH] ath9k_hw: fix device ID check for AR956x -- --Because of the missing return, the macVersion value was being --overwritten with an invalid register read -- --Signed-off-by: Felix Fietkau ----- -- ----- a/drivers/net/wireless/ath/ath9k/hw.c --+++ b/drivers/net/wireless/ath/ath9k/hw.c --@@ -278,6 +278,7 @@ static void ath9k_hw_read_revisions(stru -- return; -- case AR9300_DEVID_QCA956X: -- ah->hw_version.macVersion = AR_SREV_VERSION_9561; --+ return; -- } -- -- val = REG_READ(ah, AR_SREV) & AR_SREV_ID; -diff --git a/package/kernel/mac80211/patches/385-brcmfmac-Update-msgbuf-read-pointer-quicker.patch b/package/kernel/mac80211/patches/385-brcmfmac-Update-msgbuf-read-pointer-quicker.patch +diff --git a/package/kernel/mac80211/patches/357-0001-brcmfmac-Update-msgbuf-read-pointer-quicker.patch b/package/kernel/mac80211/patches/357-0001-brcmfmac-Update-msgbuf-read-pointer-quicker.patch deleted file mode 100644 index 74df9f9..0000000 ---- a/package/kernel/mac80211/patches/385-brcmfmac-Update-msgbuf-read-pointer-quicker.patch +--- a/package/kernel/mac80211/patches/357-0001-brcmfmac-Update-msgbuf-read-pointer-quicker.patch +++ /dev/null @@ -1,109 +0,0 @@ -From: Hante Meuleman @@ -18012,10 +18223,10 @@ index 74df9f9..0000000 - - if (commonring->r_ptr == 0) - goto again; -diff --git a/package/kernel/mac80211/patches/386-brcmfmac-remove-chipinfo-debugfs-entry.patch b/package/kernel/mac80211/patches/386-brcmfmac-remove-chipinfo-debugfs-entry.patch +diff --git a/package/kernel/mac80211/patches/357-0002-brcmfmac-remove-chipinfo-debugfs-entry.patch b/package/kernel/mac80211/patches/357-0002-brcmfmac-remove-chipinfo-debugfs-entry.patch deleted file mode 100644 index 9e5b486..0000000 ---- a/package/kernel/mac80211/patches/386-brcmfmac-remove-chipinfo-debugfs-entry.patch +--- a/package/kernel/mac80211/patches/357-0002-brcmfmac-remove-chipinfo-debugfs-entry.patch +++ /dev/null @@ -1,39 +0,0 @@ -From: Arend van Spriel @@ -18057,10 +18268,10 @@ index 9e5b486..0000000 - - return PTR_ERR_OR_ZERO(drvr->dbgfs_dir); - } -diff --git a/package/kernel/mac80211/patches/387-brcmfmac-remove-watchdog-reset-from-brcmf_pcie_busco.patch b/package/kernel/mac80211/patches/387-brcmfmac-remove-watchdog-reset-from-brcmf_pcie_busco.patch +diff --git a/package/kernel/mac80211/patches/357-0003-brcmfmac-remove-watchdog-reset-from-brcmf_pcie_busco.patch b/package/kernel/mac80211/patches/357-0003-brcmfmac-remove-watchdog-reset-from-brcmf_pcie_busco.patch deleted file mode 100644 index c38b2cd..0000000 ---- a/package/kernel/mac80211/patches/387-brcmfmac-remove-watchdog-reset-from-brcmf_pcie_busco.patch +--- a/package/kernel/mac80211/patches/357-0003-brcmfmac-remove-watchdog-reset-from-brcmf_pcie_busco.patch +++ /dev/null @@ -1,53 +0,0 @@ -From: Arend van Spriel @@ -18116,10 +18327,10 @@ index c38b2cd..0000000 - - kfree(bus->bus_priv.pcie); - kfree(bus->msgbuf->flowrings); -diff --git a/package/kernel/mac80211/patches/388-brcmfmac-use-debugfs_create_devm_seqfile-helper-func.patch b/package/kernel/mac80211/patches/388-brcmfmac-use-debugfs_create_devm_seqfile-helper-func.patch +diff --git a/package/kernel/mac80211/patches/357-0004-brcmfmac-use-debugfs_create_devm_seqfile-helper-func.patch b/package/kernel/mac80211/patches/357-0004-brcmfmac-use-debugfs_create_devm_seqfile-helper-func.patch deleted file mode 100644 index 756fbb2..0000000 ---- a/package/kernel/mac80211/patches/388-brcmfmac-use-debugfs_create_devm_seqfile-helper-func.patch +--- a/package/kernel/mac80211/patches/357-0004-brcmfmac-use-debugfs_create_devm_seqfile-helper-func.patch +++ /dev/null @@ -1,69 +0,0 @@ -From: Arend van Spriel @@ -18191,10 +18402,36 @@ index 756fbb2..0000000 -+ drvr->dbgfs_dir, read_fn); -+ return PTR_ERR_OR_ZERO(e); - } -diff --git a/package/kernel/mac80211/patches/389-0001-brcmfmac-Check-if-firmware-supports-p2p.patch b/package/kernel/mac80211/patches/389-0001-brcmfmac-Check-if-firmware-supports-p2p.patch +diff --git a/package/kernel/mac80211/patches/358-ath9k_hw-fix-device-ID-check-for-AR956x.patch b/package/kernel/mac80211/patches/358-ath9k_hw-fix-device-ID-check-for-AR956x.patch +deleted file mode 100644 +index 2674efb..0000000 +--- a/package/kernel/mac80211/patches/358-ath9k_hw-fix-device-ID-check-for-AR956x.patch ++++ /dev/null +@@ -1,20 +0,0 @@ +-From: Felix Fietkau +-Date: Sun, 21 Jun 2015 19:45:59 +0200 +-Subject: [PATCH] ath9k_hw: fix device ID check for AR956x +- +-Because of the missing return, the macVersion value was being +-overwritten with an invalid register read +- +-Signed-off-by: Felix Fietkau +---- +- +---- a/drivers/net/wireless/ath/ath9k/hw.c +-+++ b/drivers/net/wireless/ath/ath9k/hw.c +-@@ -278,6 +278,7 @@ static void ath9k_hw_read_revisions(stru +- return; +- case AR9300_DEVID_QCA956X: +- ah->hw_version.macVersion = AR_SREV_VERSION_9561; +-+ return; +- } +- +- val = REG_READ(ah, AR_SREV) & AR_SREV_ID; +diff --git a/package/kernel/mac80211/patches/359-0001-brcmfmac-Check-if-firmware-supports-p2p.patch b/package/kernel/mac80211/patches/359-0001-brcmfmac-Check-if-firmware-supports-p2p.patch deleted file mode 100644 index ff24a4a..0000000 ---- a/package/kernel/mac80211/patches/389-0001-brcmfmac-Check-if-firmware-supports-p2p.patch +--- a/package/kernel/mac80211/patches/359-0001-brcmfmac-Check-if-firmware-supports-p2p.patch +++ /dev/null @@ -1,42 +0,0 @@ -From: Pontus Fuchs @@ -18239,10 +18476,10 @@ index ff24a4a..0000000 - /* - * Quirks: - * -diff --git a/package/kernel/mac80211/patches/389-0002-brcmfmac-Build-wiphy-mode-and-interface-combinations.patch b/package/kernel/mac80211/patches/389-0002-brcmfmac-Build-wiphy-mode-and-interface-combinations.patch +diff --git a/package/kernel/mac80211/patches/359-0002-brcmfmac-Build-wiphy-mode-and-interface-combinations.patch b/package/kernel/mac80211/patches/359-0002-brcmfmac-Build-wiphy-mode-and-interface-combinations.patch deleted file mode 100644 index 3876ba0..0000000 ---- a/package/kernel/mac80211/patches/389-0002-brcmfmac-Build-wiphy-mode-and-interface-combinations.patch +--- a/package/kernel/mac80211/patches/359-0002-brcmfmac-Build-wiphy-mode-and-interface-combinations.patch +++ /dev/null @@ -1,198 +0,0 @@ -From: Pontus Fuchs @@ -18443,10 +18680,10 @@ index 3876ba0..0000000 - kfree(wiphy->iface_combinations); - if (wiphy->bands[IEEE80211_BAND_2GHZ]) { - kfree(wiphy->bands[IEEE80211_BAND_2GHZ]->channels); -diff --git a/package/kernel/mac80211/patches/389-0003-brcmfmac-rework-.get_station-callback.patch b/package/kernel/mac80211/patches/389-0003-brcmfmac-rework-.get_station-callback.patch +diff --git a/package/kernel/mac80211/patches/359-0003-brcmfmac-rework-.get_station-callback.patch b/package/kernel/mac80211/patches/359-0003-brcmfmac-rework-.get_station-callback.patch deleted file mode 100644 index 7bd0686..0000000 ---- a/package/kernel/mac80211/patches/389-0003-brcmfmac-rework-.get_station-callback.patch +--- a/package/kernel/mac80211/patches/359-0003-brcmfmac-rework-.get_station-callback.patch +++ /dev/null @@ -1,326 +0,0 @@ -From: Arend van Spriel @@ -18775,10 +19012,10 @@ index 7bd0686..0000000 - }; - - struct brcmf_chanspec_list { -diff --git a/package/kernel/mac80211/patches/389-0004-brcmfmac-have-sdio-return-EIO-when-device-communicat.patch b/package/kernel/mac80211/patches/389-0004-brcmfmac-have-sdio-return-EIO-when-device-communicat.patch +diff --git a/package/kernel/mac80211/patches/359-0004-brcmfmac-have-sdio-return-EIO-when-device-communicat.patch b/package/kernel/mac80211/patches/359-0004-brcmfmac-have-sdio-return-EIO-when-device-communicat.patch deleted file mode 100644 index 302bc3e..0000000 ---- a/package/kernel/mac80211/patches/389-0004-brcmfmac-have-sdio-return-EIO-when-device-communicat.patch +--- a/package/kernel/mac80211/patches/359-0004-brcmfmac-have-sdio-return-EIO-when-device-communicat.patch +++ /dev/null @@ -1,56 +0,0 @@ -From: Arend van Spriel @@ -18837,10 +19074,10 @@ index 302bc3e..0000000 - - /* Wait until control frame is available */ - timeleft = brcmf_sdio_dcmd_resp_wait(bus, &bus->rxlen, &pending); -diff --git a/package/kernel/mac80211/patches/389-0005-ath9k-make-DMA-stop-related-messages-debug-only.patch b/package/kernel/mac80211/patches/389-0005-ath9k-make-DMA-stop-related-messages-debug-only.patch +diff --git a/package/kernel/mac80211/patches/359-0005-ath9k-make-DMA-stop-related-messages-debug-only.patch b/package/kernel/mac80211/patches/359-0005-ath9k-make-DMA-stop-related-messages-debug-only.patch deleted file mode 100644 index 34af6d2..0000000 ---- a/package/kernel/mac80211/patches/389-0005-ath9k-make-DMA-stop-related-messages-debug-only.patch +--- a/package/kernel/mac80211/patches/359-0005-ath9k-make-DMA-stop-related-messages-debug-only.patch +++ /dev/null @@ -1,74 +0,0 @@ -From: Felix Fietkau @@ -18917,10 +19154,10 @@ index 34af6d2..0000000 - - for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) { - if (!ATH_TXQ_SETUP(sc, i)) -diff --git a/package/kernel/mac80211/patches/389-0006-brcmfmac-free-ifp-for-non-netdev-interface-in-p2p-mo.patch b/package/kernel/mac80211/patches/389-0006-brcmfmac-free-ifp-for-non-netdev-interface-in-p2p-mo.patch +diff --git a/package/kernel/mac80211/patches/359-0006-brcmfmac-free-ifp-for-non-netdev-interface-in-p2p-mo.patch b/package/kernel/mac80211/patches/359-0006-brcmfmac-free-ifp-for-non-netdev-interface-in-p2p-mo.patch deleted file mode 100644 index 06f2dce..0000000 ---- a/package/kernel/mac80211/patches/389-0006-brcmfmac-free-ifp-for-non-netdev-interface-in-p2p-mo.patch +--- a/package/kernel/mac80211/patches/359-0006-brcmfmac-free-ifp-for-non-netdev-interface-in-p2p-mo.patch +++ /dev/null @@ -1,44 +0,0 @@ -From: Arend van Spriel @@ -18967,10 +19204,10 @@ index 06f2dce..0000000 - brcmf_p2p_delete_p2pdev(p2p, vif); - return 0; - default: -diff --git a/package/kernel/mac80211/patches/389-0007-brcmfmac-move-p2p-attach-detach-functions.patch b/package/kernel/mac80211/patches/389-0007-brcmfmac-move-p2p-attach-detach-functions.patch +diff --git a/package/kernel/mac80211/patches/359-0007-brcmfmac-move-p2p-attach-detach-functions.patch b/package/kernel/mac80211/patches/359-0007-brcmfmac-move-p2p-attach-detach-functions.patch deleted file mode 100644 index 0a6e093..0000000 ---- a/package/kernel/mac80211/patches/389-0007-brcmfmac-move-p2p-attach-detach-functions.patch +--- a/package/kernel/mac80211/patches/359-0007-brcmfmac-move-p2p-attach-detach-functions.patch +++ /dev/null @@ -1,225 +0,0 @@ -From: Arend van Spriel @@ -19198,10 +19435,10 @@ index 0a6e093..0000000 -+ memset(p2p, 0, sizeof(*p2p)); -+} -+ -diff --git a/package/kernel/mac80211/patches/389-0008-brcmfmac-assure-p2pdev-is-unregistered-upon-driver-u.patch b/package/kernel/mac80211/patches/389-0008-brcmfmac-assure-p2pdev-is-unregistered-upon-driver-u.patch +diff --git a/package/kernel/mac80211/patches/359-0008-brcmfmac-assure-p2pdev-is-unregistered-upon-driver-u.patch b/package/kernel/mac80211/patches/359-0008-brcmfmac-assure-p2pdev-is-unregistered-upon-driver-u.patch deleted file mode 100644 index 72e8eed..0000000 ---- a/package/kernel/mac80211/patches/389-0008-brcmfmac-assure-p2pdev-is-unregistered-upon-driver-u.patch +--- a/package/kernel/mac80211/patches/359-0008-brcmfmac-assure-p2pdev-is-unregistered-upon-driver-u.patch +++ /dev/null @@ -1,63 +0,0 @@ -From: Arend van Spriel @@ -19267,10 +19504,10 @@ index 72e8eed..0000000 - } - /* just set it all to zero */ - memset(p2p, 0, sizeof(*p2p)); -diff --git a/package/kernel/mac80211/patches/390-0001-brcmfmac-fix-double-free-of-p2pdev-interface.patch b/package/kernel/mac80211/patches/390-0001-brcmfmac-fix-double-free-of-p2pdev-interface.patch +diff --git a/package/kernel/mac80211/patches/360-0001-brcmfmac-fix-double-free-of-p2pdev-interface.patch b/package/kernel/mac80211/patches/360-0001-brcmfmac-fix-double-free-of-p2pdev-interface.patch deleted file mode 100644 index 179c77e..0000000 ---- a/package/kernel/mac80211/patches/390-0001-brcmfmac-fix-double-free-of-p2pdev-interface.patch +--- a/package/kernel/mac80211/patches/360-0001-brcmfmac-fix-double-free-of-p2pdev-interface.patch +++ /dev/null @@ -1,27 +0,0 @@ -From: Arend van Spriel @@ -19300,10 +19537,10 @@ index 179c77e..0000000 - brcmf_free_vif(vif); - } - -diff --git a/package/kernel/mac80211/patches/390-0002-brcmfmac-make-brcmf_p2p_detach-call-conditional.patch b/package/kernel/mac80211/patches/390-0002-brcmfmac-make-brcmf_p2p_detach-call-conditional.patch +diff --git a/package/kernel/mac80211/patches/360-0002-brcmfmac-make-brcmf_p2p_detach-call-conditional.patch b/package/kernel/mac80211/patches/360-0002-brcmfmac-make-brcmf_p2p_detach-call-conditional.patch deleted file mode 100644 index e4f88b5..0000000 ---- a/package/kernel/mac80211/patches/390-0002-brcmfmac-make-brcmf_p2p_detach-call-conditional.patch +--- a/package/kernel/mac80211/patches/360-0002-brcmfmac-make-brcmf_p2p_detach-call-conditional.patch +++ /dev/null @@ -1,29 +0,0 @@ -From: Arend van Spriel @@ -19335,10 +19572,10 @@ index e4f88b5..0000000 - - brcmf_bus_change_state(bus_if, BRCMF_BUS_DOWN); - -diff --git a/package/kernel/mac80211/patches/391-brcmfmac-set-wiphy-s-addresses-to-provide-valid-MACs.patch b/package/kernel/mac80211/patches/391-brcmfmac-set-wiphy-s-addresses-to-provide-valid-MACs.patch +diff --git a/package/kernel/mac80211/patches/361-brcmfmac-set-wiphy-s-addresses-to-provide-valid-MACs.patch b/package/kernel/mac80211/patches/361-brcmfmac-set-wiphy-s-addresses-to-provide-valid-MACs.patch deleted file mode 100644 index 0a81237..0000000 ---- a/package/kernel/mac80211/patches/391-brcmfmac-set-wiphy-s-addresses-to-provide-valid-MACs.patch +--- a/package/kernel/mac80211/patches/361-brcmfmac-set-wiphy-s-addresses-to-provide-valid-MACs.patch +++ /dev/null @@ -1,67 +0,0 @@ -From: Rafa? Mi?ecki @@ -19408,10 +19645,10 @@ index 0a81237..0000000 - struct brcmf_if *iflist[BRCMF_MAX_IFS]; - - struct mutex proto_block; -diff --git a/package/kernel/mac80211/patches/392-brcmfmac-dhd_sdio.c-use-existing-atomic_or-primitive.patch b/package/kernel/mac80211/patches/392-brcmfmac-dhd_sdio.c-use-existing-atomic_or-primitive.patch +diff --git a/package/kernel/mac80211/patches/362-brcmfmac-dhd_sdio.c-use-existing-atomic_or-primitive.patch b/package/kernel/mac80211/patches/362-brcmfmac-dhd_sdio.c-use-existing-atomic_or-primitive.patch deleted file mode 100644 index e44f121..0000000 ---- a/package/kernel/mac80211/patches/392-brcmfmac-dhd_sdio.c-use-existing-atomic_or-primitive.patch +--- a/package/kernel/mac80211/patches/362-brcmfmac-dhd_sdio.c-use-existing-atomic_or-primitive.patch +++ /dev/null @@ -1,45 +0,0 @@ -From: Vineet Gupta @@ -19459,10 +19696,10 @@ index e44f121..0000000 - - brcmf_sdio_clrintr(bus); - -diff --git a/package/kernel/mac80211/patches/393-0001-brcmfmac-check-all-combinations-when-setting-wiphy-s.patch b/package/kernel/mac80211/patches/393-0001-brcmfmac-check-all-combinations-when-setting-wiphy-s.patch +diff --git a/package/kernel/mac80211/patches/363-0001-brcmfmac-check-all-combinations-when-setting-wiphy-s.patch b/package/kernel/mac80211/patches/363-0001-brcmfmac-check-all-combinations-when-setting-wiphy-s.patch deleted file mode 100644 index 76ca143..0000000 ---- a/package/kernel/mac80211/patches/393-0001-brcmfmac-check-all-combinations-when-setting-wiphy-s.patch +--- a/package/kernel/mac80211/patches/363-0001-brcmfmac-check-all-combinations-when-setting-wiphy-s.patch +++ /dev/null @@ -1,46 +0,0 @@ -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= @@ -19511,10 +19748,10 @@ index 76ca143..0000000 - u8 *addr = drvr->addresses[i].addr; - - memcpy(addr, drvr->mac, ETH_ALEN); -diff --git a/package/kernel/mac80211/patches/393-0002-brcmfmac-correct-interface-combination-info.patch b/package/kernel/mac80211/patches/393-0002-brcmfmac-correct-interface-combination-info.patch +diff --git a/package/kernel/mac80211/patches/363-0002-brcmfmac-correct-interface-combination-info.patch b/package/kernel/mac80211/patches/363-0002-brcmfmac-correct-interface-combination-info.patch deleted file mode 100644 index c4a0720..0000000 ---- a/package/kernel/mac80211/patches/393-0002-brcmfmac-correct-interface-combination-info.patch +--- a/package/kernel/mac80211/patches/363-0002-brcmfmac-correct-interface-combination-info.patch +++ /dev/null @@ -1,204 +0,0 @@ -From: Arend van Spriel @@ -19721,10 +19958,10 @@ index c4a0720..0000000 - kfree(wiphy->iface_combinations); - if (wiphy->bands[IEEE80211_BAND_2GHZ]) { - kfree(wiphy->bands[IEEE80211_BAND_2GHZ]->channels); -diff --git a/package/kernel/mac80211/patches/393-0003-brcmfmac-add-debugfs-entry-for-msgbuf-statistics.patch b/package/kernel/mac80211/patches/393-0003-brcmfmac-add-debugfs-entry-for-msgbuf-statistics.patch +diff --git a/package/kernel/mac80211/patches/363-0003-brcmfmac-add-debugfs-entry-for-msgbuf-statistics.patch b/package/kernel/mac80211/patches/363-0003-brcmfmac-add-debugfs-entry-for-msgbuf-statistics.patch deleted file mode 100644 index 9768ef2..0000000 ---- a/package/kernel/mac80211/patches/393-0003-brcmfmac-add-debugfs-entry-for-msgbuf-statistics.patch +--- a/package/kernel/mac80211/patches/363-0003-brcmfmac-add-debugfs-entry-for-msgbuf-statistics.patch +++ /dev/null @@ -1,87 +0,0 @@ -From: Franky Lin @@ -19814,10 +20051,10 @@ index 9768ef2..0000000 - return 0; - - fail: -diff --git a/package/kernel/mac80211/patches/393-0004-brcmfmac-make-use-of-cfg80211_check_combinations.patch b/package/kernel/mac80211/patches/393-0004-brcmfmac-make-use-of-cfg80211_check_combinations.patch +diff --git a/package/kernel/mac80211/patches/363-0004-brcmfmac-make-use-of-cfg80211_check_combinations.patch b/package/kernel/mac80211/patches/363-0004-brcmfmac-make-use-of-cfg80211_check_combinations.patch deleted file mode 100644 index 2b84cf9..0000000 ---- a/package/kernel/mac80211/patches/393-0004-brcmfmac-make-use-of-cfg80211_check_combinations.patch +--- a/package/kernel/mac80211/patches/363-0004-brcmfmac-make-use-of-cfg80211_check_combinations.patch +++ /dev/null @@ -1,83 +0,0 @@ -From: Arend van Spriel @@ -19903,10 +20140,10 @@ index 2b84cf9..0000000 - switch (type) { - case NL80211_IFTYPE_MONITOR: - case NL80211_IFTYPE_WDS: -diff --git a/package/kernel/mac80211/patches/393-0005-brcmfmac-block-the-correct-flowring-when-backup-queu.patch b/package/kernel/mac80211/patches/393-0005-brcmfmac-block-the-correct-flowring-when-backup-queu.patch +diff --git a/package/kernel/mac80211/patches/363-0005-brcmfmac-block-the-correct-flowring-when-backup-queu.patch b/package/kernel/mac80211/patches/363-0005-brcmfmac-block-the-correct-flowring-when-backup-queu.patch deleted file mode 100644 index 2d5f7b9..0000000 ---- a/package/kernel/mac80211/patches/393-0005-brcmfmac-block-the-correct-flowring-when-backup-queu.patch +--- a/package/kernel/mac80211/patches/363-0005-brcmfmac-block-the-correct-flowring-when-backup-queu.patch +++ /dev/null @@ -1,48 +0,0 @@ -From: Franky Lin @@ -19957,10 +20194,10 @@ index 2d5f7b9..0000000 - spin_unlock_irqrestore(&flow->block_lock, flags); - return; - } -diff --git a/package/kernel/mac80211/patches/393-0006-brcmfmac-bump-highest-event-number-for-4339-firmware.patch b/package/kernel/mac80211/patches/393-0006-brcmfmac-bump-highest-event-number-for-4339-firmware.patch +diff --git a/package/kernel/mac80211/patches/363-0006-brcmfmac-bump-highest-event-number-for-4339-firmware.patch b/package/kernel/mac80211/patches/363-0006-brcmfmac-bump-highest-event-number-for-4339-firmware.patch deleted file mode 100644 index 7378401..0000000 ---- a/package/kernel/mac80211/patches/393-0006-brcmfmac-bump-highest-event-number-for-4339-firmware.patch +--- a/package/kernel/mac80211/patches/363-0006-brcmfmac-bump-highest-event-number-for-4339-firmware.patch +++ /dev/null @@ -1,52 +0,0 @@ -From: Arend van Spriel @@ -20015,10 +20252,10 @@ index 7378401..0000000 - }; - #undef BRCMF_ENUM_DEF - -diff --git a/package/kernel/mac80211/patches/394-0001-brcmfmac-consolidate-ifp-lookup-in-driver-core.patch b/package/kernel/mac80211/patches/394-0001-brcmfmac-consolidate-ifp-lookup-in-driver-core.patch +diff --git a/package/kernel/mac80211/patches/365-0001-brcmfmac-consolidate-ifp-lookup-in-driver-core.patch b/package/kernel/mac80211/patches/365-0001-brcmfmac-consolidate-ifp-lookup-in-driver-core.patch deleted file mode 100644 index 97444b3..0000000 ---- a/package/kernel/mac80211/patches/394-0001-brcmfmac-consolidate-ifp-lookup-in-driver-core.patch +--- a/package/kernel/mac80211/patches/365-0001-brcmfmac-consolidate-ifp-lookup-in-driver-core.patch +++ /dev/null @@ -1,138 +0,0 @@ -From: Arend van Spriel @@ -20159,10 +20396,10 @@ index 97444b3..0000000 - brcmf_err("Received pkt for invalid ifidx %d\n", ifidx); - brcmu_pkt_buf_free_skb(skb); - return; -diff --git a/package/kernel/mac80211/patches/394-0002-brcmfmac-make-brcmf_proto_hdrpull-return-struct-brcm.patch b/package/kernel/mac80211/patches/394-0002-brcmfmac-make-brcmf_proto_hdrpull-return-struct-brcm.patch +diff --git a/package/kernel/mac80211/patches/365-0002-brcmfmac-make-brcmf_proto_hdrpull-return-struct-brcm.patch b/package/kernel/mac80211/patches/365-0002-brcmfmac-make-brcmf_proto_hdrpull-return-struct-brcm.patch deleted file mode 100644 index 632714c..0000000 ---- a/package/kernel/mac80211/patches/394-0002-brcmfmac-make-brcmf_proto_hdrpull-return-struct-brcm.patch +--- a/package/kernel/mac80211/patches/365-0002-brcmfmac-make-brcmf_proto_hdrpull-return-struct-brcm.patch +++ /dev/null @@ -1,222 +0,0 @@ -From: Arend van Spriel @@ -20387,10 +20624,10 @@ index 632714c..0000000 - } - static inline int brcmf_proto_query_dcmd(struct brcmf_pub *drvr, int ifidx, - uint cmd, void *buf, uint len) -diff --git a/package/kernel/mac80211/patches/394-0003-brcmfmac-change-parameters-for-brcmf_remove_interfac.patch b/package/kernel/mac80211/patches/394-0003-brcmfmac-change-parameters-for-brcmf_remove_interfac.patch +diff --git a/package/kernel/mac80211/patches/365-0003-brcmfmac-change-parameters-for-brcmf_remove_interfac.patch b/package/kernel/mac80211/patches/365-0003-brcmfmac-change-parameters-for-brcmf_remove_interfac.patch deleted file mode 100644 index 2d15a77..0000000 ---- a/package/kernel/mac80211/patches/394-0003-brcmfmac-change-parameters-for-brcmf_remove_interfac.patch +--- a/package/kernel/mac80211/patches/365-0003-brcmfmac-change-parameters-for-brcmf_remove_interfac.patch +++ /dev/null @@ -1,87 +0,0 @@ -From: Arend van Spriel @@ -20480,10 +20717,10 @@ index 2d15a77..0000000 - brcmf_free_vif(vif); - } - -diff --git a/package/kernel/mac80211/patches/394-0004-brcmfmac-only-call-brcmf_cfg80211_detach-when-attach.patch b/package/kernel/mac80211/patches/394-0004-brcmfmac-only-call-brcmf_cfg80211_detach-when-attach.patch +diff --git a/package/kernel/mac80211/patches/365-0004-brcmfmac-only-call-brcmf_cfg80211_detach-when-attach.patch b/package/kernel/mac80211/patches/365-0004-brcmfmac-only-call-brcmf_cfg80211_detach-when-attach.patch deleted file mode 100644 index 2b61f4e..0000000 ---- a/package/kernel/mac80211/patches/394-0004-brcmfmac-only-call-brcmf_cfg80211_detach-when-attach.patch +--- a/package/kernel/mac80211/patches/365-0004-brcmfmac-only-call-brcmf_cfg80211_detach-when-attach.patch +++ /dev/null @@ -1,92 +0,0 @@ -From: Arend van Spriel @@ -20578,10 +20815,10 @@ index 2b61f4e..0000000 - if (drvr->fws) { - brcmf_fws_del_interface(ifp); - brcmf_fws_deinit(drvr); -diff --git a/package/kernel/mac80211/patches/394-0005-brcmfmac-correct-detection-of-p2pdev-interface-event.patch b/package/kernel/mac80211/patches/394-0005-brcmfmac-correct-detection-of-p2pdev-interface-event.patch +diff --git a/package/kernel/mac80211/patches/365-0005-brcmfmac-correct-detection-of-p2pdev-interface-event.patch b/package/kernel/mac80211/patches/365-0005-brcmfmac-correct-detection-of-p2pdev-interface-event.patch deleted file mode 100644 index 868b0a8..0000000 ---- a/package/kernel/mac80211/patches/394-0005-brcmfmac-correct-detection-of-p2pdev-interface-event.patch +--- a/package/kernel/mac80211/patches/365-0005-brcmfmac-correct-detection-of-p2pdev-interface-event.patch +++ /dev/null @@ -1,105 +0,0 @@ -From: Arend van Spriel @@ -20689,10 +20926,10 @@ index 868b0a8..0000000 - if (IS_ERR(ifp)) - return; - brcmf_fws_add_interface(ifp); -diff --git a/package/kernel/mac80211/patches/394-0006-brcmfmac-use-brcmf_get_ifp-to-map-ifidx-to-struct-br.patch b/package/kernel/mac80211/patches/394-0006-brcmfmac-use-brcmf_get_ifp-to-map-ifidx-to-struct-br.patch +diff --git a/package/kernel/mac80211/patches/365-0006-brcmfmac-use-brcmf_get_ifp-to-map-ifidx-to-struct-br.patch b/package/kernel/mac80211/patches/365-0006-brcmfmac-use-brcmf_get_ifp-to-map-ifidx-to-struct-br.patch deleted file mode 100644 index aebbfa6..0000000 ---- a/package/kernel/mac80211/patches/394-0006-brcmfmac-use-brcmf_get_ifp-to-map-ifidx-to-struct-br.patch +--- a/package/kernel/mac80211/patches/365-0006-brcmfmac-use-brcmf_get_ifp-to-map-ifidx-to-struct-br.patch +++ /dev/null @@ -1,126 +0,0 @@ -From: Arend van Spriel @@ -20821,10 +21058,10 @@ index aebbfa6..0000000 - "wlfc_mode", mode) == 0) { - BRCMF_FWS_MODE_SET_REUSESEQ(fws->mode, 1); - } -diff --git a/package/kernel/mac80211/patches/394-0007-brcmfmac-pass-struct-brcmf_if-instance-in-brcmf_txfi.patch b/package/kernel/mac80211/patches/394-0007-brcmfmac-pass-struct-brcmf_if-instance-in-brcmf_txfi.patch +diff --git a/package/kernel/mac80211/patches/365-0007-brcmfmac-pass-struct-brcmf_if-instance-in-brcmf_txfi.patch b/package/kernel/mac80211/patches/365-0007-brcmfmac-pass-struct-brcmf_if-instance-in-brcmf_txfi.patch deleted file mode 100644 index 23a7b6f..0000000 ---- a/package/kernel/mac80211/patches/394-0007-brcmfmac-pass-struct-brcmf_if-instance-in-brcmf_txfi.patch +--- a/package/kernel/mac80211/patches/365-0007-brcmfmac-pass-struct-brcmf_if-instance-in-brcmf_txfi.patch +++ /dev/null @@ -1,122 +0,0 @@ -From: Arend van Spriel @@ -20949,10 +21186,10 @@ index 23a7b6f..0000000 - } - - -diff --git a/package/kernel/mac80211/patches/394-0008-brcmfmac-add-mapping-for-interface-index-to-bsscfg-i.patch b/package/kernel/mac80211/patches/394-0008-brcmfmac-add-mapping-for-interface-index-to-bsscfg-i.patch +diff --git a/package/kernel/mac80211/patches/365-0008-brcmfmac-add-mapping-for-interface-index-to-bsscfg-i.patch b/package/kernel/mac80211/patches/365-0008-brcmfmac-add-mapping-for-interface-index-to-bsscfg-i.patch deleted file mode 100644 index 8ddc0a6..0000000 ---- a/package/kernel/mac80211/patches/394-0008-brcmfmac-add-mapping-for-interface-index-to-bsscfg-i.patch +--- a/package/kernel/mac80211/patches/365-0008-brcmfmac-add-mapping-for-interface-index-to-bsscfg-i.patch +++ /dev/null @@ -1,92 +0,0 @@ -From: Arend van Spriel @@ -21047,10 +21284,10 @@ index 8ddc0a6..0000000 - - struct mutex proto_block; - unsigned char proto_buf[BRCMF_DCMD_MAXLEN]; -diff --git a/package/kernel/mac80211/patches/394-0009-brcmfmac-add-dedicated-debug-level-for-firmware-cons.patch b/package/kernel/mac80211/patches/394-0009-brcmfmac-add-dedicated-debug-level-for-firmware-cons.patch +diff --git a/package/kernel/mac80211/patches/365-0009-brcmfmac-add-dedicated-debug-level-for-firmware-cons.patch b/package/kernel/mac80211/patches/365-0009-brcmfmac-add-dedicated-debug-level-for-firmware-cons.patch deleted file mode 100644 index a0a798b..0000000 ---- a/package/kernel/mac80211/patches/394-0009-brcmfmac-add-dedicated-debug-level-for-firmware-cons.patch +--- a/package/kernel/mac80211/patches/365-0009-brcmfmac-add-dedicated-debug-level-for-firmware-cons.patch +++ /dev/null @@ -1,103 +0,0 @@ -From: Arend van Spriel @@ -21156,10 +21393,10 @@ index a0a798b..0000000 - bus->console_interval != 0) { - bus->console.count += BRCMF_WD_POLL_MS; - if (bus->console.count >= bus->console_interval) { -diff --git a/package/kernel/mac80211/patches/394-0010-brcmfmac-remove-ifidx-parameter-from-brcmf_fws_txsta.patch b/package/kernel/mac80211/patches/394-0010-brcmfmac-remove-ifidx-parameter-from-brcmf_fws_txsta.patch +diff --git a/package/kernel/mac80211/patches/365-0010-brcmfmac-remove-ifidx-parameter-from-brcmf_fws_txsta.patch b/package/kernel/mac80211/patches/365-0010-brcmfmac-remove-ifidx-parameter-from-brcmf_fws_txsta.patch deleted file mode 100644 index 53e7ede..0000000 ---- a/package/kernel/mac80211/patches/394-0010-brcmfmac-remove-ifidx-parameter-from-brcmf_fws_txsta.patch +--- a/package/kernel/mac80211/patches/365-0010-brcmfmac-remove-ifidx-parameter-from-brcmf_fws_txsta.patch +++ /dev/null @@ -1,34 +0,0 @@ -From: Arend van Spriel @@ -21196,10 +21433,10 @@ index 53e7ede..0000000 - genbit, seq); - if (remove_from_hanger || ret) - brcmf_txfinalize(ifp, skb, true); -diff --git a/package/kernel/mac80211/patches/394-0011-brcmfmac-change-prototype-for-brcmf_fws_hdrpull.patch b/package/kernel/mac80211/patches/394-0011-brcmfmac-change-prototype-for-brcmf_fws_hdrpull.patch +diff --git a/package/kernel/mac80211/patches/365-0011-brcmfmac-change-prototype-for-brcmf_fws_hdrpull.patch b/package/kernel/mac80211/patches/365-0011-brcmfmac-change-prototype-for-brcmf_fws_hdrpull.patch deleted file mode 100644 index bb05235..0000000 ---- a/package/kernel/mac80211/patches/394-0011-brcmfmac-change-prototype-for-brcmf_fws_hdrpull.patch +--- a/package/kernel/mac80211/patches/365-0011-brcmfmac-change-prototype-for-brcmf_fws_hdrpull.patch +++ /dev/null @@ -1,97 +0,0 @@ -From: Arend van Spriel @@ -21299,10 +21536,10 @@ index bb05235..0000000 - int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb); - - void brcmf_fws_reset_interface(struct brcmf_if *ifp); -diff --git a/package/kernel/mac80211/patches/394-0012-brcmfmac-introduce-brcmf_net_detach-function.patch b/package/kernel/mac80211/patches/394-0012-brcmfmac-introduce-brcmf_net_detach-function.patch +diff --git a/package/kernel/mac80211/patches/365-0012-brcmfmac-introduce-brcmf_net_detach-function.patch b/package/kernel/mac80211/patches/365-0012-brcmfmac-introduce-brcmf_net_detach-function.patch deleted file mode 100644 index ba92c67..0000000 ---- a/package/kernel/mac80211/patches/394-0012-brcmfmac-introduce-brcmf_net_detach-function.patch +--- a/package/kernel/mac80211/patches/365-0012-brcmfmac-introduce-brcmf_net_detach-function.patch +++ /dev/null @@ -1,99 +0,0 @@ -From: Arend van Spriel @@ -21404,10 +21641,10 @@ index ba92c67..0000000 - drvr->iflist[1] = NULL; - } - return ret; -diff --git a/package/kernel/mac80211/patches/395-brcmfmac-Reset-PCIE-devices-after-recognition.patch b/package/kernel/mac80211/patches/395-brcmfmac-Reset-PCIE-devices-after-recognition.patch +diff --git a/package/kernel/mac80211/patches/366-brcmfmac-Reset-PCIE-devices-after-recognition.patch b/package/kernel/mac80211/patches/366-brcmfmac-Reset-PCIE-devices-after-recognition.patch deleted file mode 100644 index 5a7e447..0000000 ---- a/package/kernel/mac80211/patches/395-brcmfmac-Reset-PCIE-devices-after-recognition.patch +--- a/package/kernel/mac80211/patches/366-brcmfmac-Reset-PCIE-devices-after-recognition.patch +++ /dev/null @@ -1,193 +0,0 @@ -From: Hante Meuleman @@ -21603,10 +21840,10 @@ index 5a7e447..0000000 - - kfree(bus->bus_priv.pcie); - kfree(bus->msgbuf->flowrings); -diff --git a/package/kernel/mac80211/patches/396-ath10k-fix-DMA-related-firmware-crashes-on-multiple-.patch b/package/kernel/mac80211/patches/396-ath10k-fix-DMA-related-firmware-crashes-on-multiple-.patch +diff --git a/package/kernel/mac80211/patches/367-ath10k-fix-DMA-related-firmware-crashes-on-multiple-.patch b/package/kernel/mac80211/patches/367-ath10k-fix-DMA-related-firmware-crashes-on-multiple-.patch deleted file mode 100644 index f7b3e40..0000000 ---- a/package/kernel/mac80211/patches/396-ath10k-fix-DMA-related-firmware-crashes-on-multiple-.patch +--- a/package/kernel/mac80211/patches/367-ath10k-fix-DMA-related-firmware-crashes-on-multiple-.patch +++ /dev/null @@ -1,24 +0,0 @@ -From: Felix Fietkau @@ -21633,10 +21870,10 @@ index f7b3e40..0000000 - - /* Target specific defines for WMI-TLV firmware */ - #define TARGET_TLV_NUM_VDEVS 3 -diff --git a/package/kernel/mac80211/patches/397-ath9k-declare-required-extra-tx-headroom.patch b/package/kernel/mac80211/patches/397-ath9k-declare-required-extra-tx-headroom.patch +diff --git a/package/kernel/mac80211/patches/368-ath9k-declare-required-extra-tx-headroom.patch b/package/kernel/mac80211/patches/368-ath9k-declare-required-extra-tx-headroom.patch deleted file mode 100644 index c420d20..0000000 ---- a/package/kernel/mac80211/patches/397-ath9k-declare-required-extra-tx-headroom.patch +--- a/package/kernel/mac80211/patches/368-ath9k-declare-required-extra-tx-headroom.patch +++ /dev/null @@ -1,22 +0,0 @@ -From: Felix Fietkau @@ -21661,10 +21898,10 @@ index c420d20..0000000 - - hw->wiphy->available_antennas_rx = BIT(ah->caps.max_rxchains) - 1; - hw->wiphy->available_antennas_tx = BIT(ah->caps.max_txchains) - 1; -diff --git a/package/kernel/mac80211/patches/398-mac80211-initialize-tid-field-in-struct-ieee80211_tx.patch b/package/kernel/mac80211/patches/398-mac80211-initialize-tid-field-in-struct-ieee80211_tx.patch +diff --git a/package/kernel/mac80211/patches/369-mac80211-initialize-tid-field-in-struct-ieee80211_tx.patch b/package/kernel/mac80211/patches/369-mac80211-initialize-tid-field-in-struct-ieee80211_tx.patch deleted file mode 100644 index 1478efa..0000000 ---- a/package/kernel/mac80211/patches/398-mac80211-initialize-tid-field-in-struct-ieee80211_tx.patch +--- a/package/kernel/mac80211/patches/369-mac80211-initialize-tid-field-in-struct-ieee80211_tx.patch +++ /dev/null @@ -1,21 +0,0 @@ -From: Felix Fietkau @@ -21688,6 +21925,5737 @@ index 1478efa..0000000 - txqi->txq.ac = IEEE80211_AC_BE; - } - } +diff --git a/package/kernel/mac80211/patches/370-0001-brcmfmac-Fix-exception-handling.patch b/package/kernel/mac80211/patches/370-0001-brcmfmac-Fix-exception-handling.patch +deleted file mode 100644 +index bcd1031..0000000 +--- a/package/kernel/mac80211/patches/370-0001-brcmfmac-Fix-exception-handling.patch ++++ /dev/null +@@ -1,24 +0,0 @@ +-From: Hante Meuleman +-Date: Fri, 18 Sep 2015 22:08:04 +0200 +-Subject: [PATCH] brcmfmac: Fix exception handling. +- +-In some exception situations the ifp->vif was not properly assigned +-which could result in crash. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-@@ -6331,6 +6331,7 @@ wiphy_unreg_out: +- priv_out: +- wl_deinit_priv(cfg); +- brcmf_free_vif(vif); +-+ ifp->vif = NULL; +- wiphy_out: +- brcmf_free_wiphy(wiphy); +- return NULL; +diff --git a/package/kernel/mac80211/patches/370-0002-brcmfmac-Add-support-for-the-BCM4350-PCIE-device.patch b/package/kernel/mac80211/patches/370-0002-brcmfmac-Add-support-for-the-BCM4350-PCIE-device.patch +deleted file mode 100644 +index f4ab77b..0000000 +--- a/package/kernel/mac80211/patches/370-0002-brcmfmac-Add-support-for-the-BCM4350-PCIE-device.patch ++++ /dev/null +@@ -1,81 +0,0 @@ +-From: Hante Meuleman +-Date: Fri, 18 Sep 2015 22:08:05 +0200 +-Subject: [PATCH] brcmfmac: Add support for the BCM4350 PCIE device. +- +-This patch adds support fo the BRCM4350 2x2 11ac PCIE device. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/chip.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c +-@@ -647,6 +647,7 @@ static u32 brcmf_chip_tcm_rambase(struct +- return 0x198000; +- case BRCM_CC_4335_CHIP_ID: +- case BRCM_CC_4339_CHIP_ID: +-+ case BRCM_CC_4350_CHIP_ID: +- case BRCM_CC_4354_CHIP_ID: +- case BRCM_CC_4356_CHIP_ID: +- case BRCM_CC_43567_CHIP_ID: +---- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-@@ -47,6 +47,8 @@ enum brcmf_pcie_state { +- +- #define BRCMF_PCIE_43602_FW_NAME "brcm/brcmfmac43602-pcie.bin" +- #define BRCMF_PCIE_43602_NVRAM_NAME "brcm/brcmfmac43602-pcie.txt" +-+#define BRCMF_PCIE_4350_FW_NAME "brcm/brcmfmac4350-pcie.bin" +-+#define BRCMF_PCIE_4350_NVRAM_NAME "brcm/brcmfmac4350-pcie.txt" +- #define BRCMF_PCIE_4356_FW_NAME "brcm/brcmfmac4356-pcie.bin" +- #define BRCMF_PCIE_4356_NVRAM_NAME "brcm/brcmfmac4356-pcie.txt" +- #define BRCMF_PCIE_43570_FW_NAME "brcm/brcmfmac43570-pcie.bin" +-@@ -194,6 +196,8 @@ enum brcmf_pcie_state { +- +- MODULE_FIRMWARE(BRCMF_PCIE_43602_FW_NAME); +- MODULE_FIRMWARE(BRCMF_PCIE_43602_NVRAM_NAME); +-+MODULE_FIRMWARE(BRCMF_PCIE_4350_FW_NAME); +-+MODULE_FIRMWARE(BRCMF_PCIE_4350_NVRAM_NAME); +- MODULE_FIRMWARE(BRCMF_PCIE_4356_FW_NAME); +- MODULE_FIRMWARE(BRCMF_PCIE_4356_NVRAM_NAME); +- MODULE_FIRMWARE(BRCMF_PCIE_43570_FW_NAME); +-@@ -1418,6 +1422,10 @@ static int brcmf_pcie_get_fwnames(struct +- fw_name = BRCMF_PCIE_43602_FW_NAME; +- nvram_name = BRCMF_PCIE_43602_NVRAM_NAME; +- break; +-+ case BRCM_CC_4350_CHIP_ID: +-+ fw_name = BRCMF_PCIE_4350_FW_NAME; +-+ nvram_name = BRCMF_PCIE_4350_NVRAM_NAME; +-+ break; +- case BRCM_CC_4356_CHIP_ID: +- fw_name = BRCMF_PCIE_4356_FW_NAME; +- nvram_name = BRCMF_PCIE_4356_NVRAM_NAME; +-@@ -1956,6 +1964,7 @@ cleanup: +- PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_NETWORK_OTHER << 8, 0xffff00, 0 } +- +- static struct pci_device_id brcmf_pcie_devid_table[] = { +-+ BRCMF_PCIE_DEVICE(BRCM_PCIE_4350_DEVICE_ID), +- BRCMF_PCIE_DEVICE(BRCM_PCIE_4356_DEVICE_ID), +- BRCMF_PCIE_DEVICE(BRCM_PCIE_43567_DEVICE_ID), +- BRCMF_PCIE_DEVICE(BRCM_PCIE_43570_DEVICE_ID), +---- a/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h +-+++ b/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h +-@@ -39,6 +39,7 @@ +- #define BRCM_CC_4339_CHIP_ID 0x4339 +- #define BRCM_CC_43430_CHIP_ID 43430 +- #define BRCM_CC_4345_CHIP_ID 0x4345 +-+#define BRCM_CC_4350_CHIP_ID 0x4350 +- #define BRCM_CC_4354_CHIP_ID 0x4354 +- #define BRCM_CC_4356_CHIP_ID 0x4356 +- #define BRCM_CC_43566_CHIP_ID 43566 +-@@ -56,6 +57,7 @@ +- #define BRCM_USB_BCMFW_DEVICE_ID 0x0bdc +- +- /* PCIE Device IDs */ +-+#define BRCM_PCIE_4350_DEVICE_ID 0x43a3 +- #define BRCM_PCIE_4354_DEVICE_ID 0x43df +- #define BRCM_PCIE_4356_DEVICE_ID 0x43ec +- #define BRCM_PCIE_43567_DEVICE_ID 0x43d3 +diff --git a/package/kernel/mac80211/patches/370-0003-brcmfmac-Fix-set-and-get-tx-power-functions.patch b/package/kernel/mac80211/patches/370-0003-brcmfmac-Fix-set-and-get-tx-power-functions.patch +deleted file mode 100644 +index 62fdd8d..0000000 +--- a/package/kernel/mac80211/patches/370-0003-brcmfmac-Fix-set-and-get-tx-power-functions.patch ++++ /dev/null +@@ -1,218 +0,0 @@ +-From: Hante Meuleman +-Date: Fri, 18 Sep 2015 22:08:06 +0200 +-Subject: [PATCH] brcmfmac: Fix set and get tx-power functions. +- +-Implementation of tx-power (get and set) related functions are +-still assuming mW interface. This is wrong as functions use dbm +-(or mbm) nowadays. As a result a tx power configuration could +-result in wrong power configuration. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-@@ -236,89 +236,6 @@ static int brcmf_roamoff; +- module_param_named(roamoff, brcmf_roamoff, int, S_IRUSR); +- MODULE_PARM_DESC(roamoff, "do not use internal roaming engine"); +- +--/* Quarter dBm units to mW +-- * Table starts at QDBM_OFFSET, so the first entry is mW for qdBm=153 +-- * Table is offset so the last entry is largest mW value that fits in +-- * a u16. +-- */ +-- +--#define QDBM_OFFSET 153 /* Offset for first entry */ +--#define QDBM_TABLE_LEN 40 /* Table size */ +-- +--/* Smallest mW value that will round up to the first table entry, QDBM_OFFSET. +-- * Value is ( mW(QDBM_OFFSET - 1) + mW(QDBM_OFFSET) ) / 2 +-- */ +--#define QDBM_TABLE_LOW_BOUND 6493 /* Low bound */ +-- +--/* Largest mW value that will round down to the last table entry, +-- * QDBM_OFFSET + QDBM_TABLE_LEN-1. +-- * Value is ( mW(QDBM_OFFSET + QDBM_TABLE_LEN - 1) + +-- * mW(QDBM_OFFSET + QDBM_TABLE_LEN) ) / 2. +-- */ +--#define QDBM_TABLE_HIGH_BOUND 64938 /* High bound */ +-- +--static const u16 nqdBm_to_mW_map[QDBM_TABLE_LEN] = { +--/* qdBm: +0 +1 +2 +3 +4 +5 +6 +7 */ +--/* 153: */ 6683, 7079, 7499, 7943, 8414, 8913, 9441, 10000, +--/* 161: */ 10593, 11220, 11885, 12589, 13335, 14125, 14962, 15849, +--/* 169: */ 16788, 17783, 18836, 19953, 21135, 22387, 23714, 25119, +--/* 177: */ 26607, 28184, 29854, 31623, 33497, 35481, 37584, 39811, +--/* 185: */ 42170, 44668, 47315, 50119, 53088, 56234, 59566, 63096 +--}; +-- +--static u16 brcmf_qdbm_to_mw(u8 qdbm) +--{ +-- uint factor = 1; +-- int idx = qdbm - QDBM_OFFSET; +-- +-- if (idx >= QDBM_TABLE_LEN) +-- /* clamp to max u16 mW value */ +-- return 0xFFFF; +-- +-- /* scale the qdBm index up to the range of the table 0-40 +-- * where an offset of 40 qdBm equals a factor of 10 mW. +-- */ +-- while (idx < 0) { +-- idx += 40; +-- factor *= 10; +-- } +-- +-- /* return the mW value scaled down to the correct factor of 10, +-- * adding in factor/2 to get proper rounding. +-- */ +-- return (nqdBm_to_mW_map[idx] + factor / 2) / factor; +--} +-- +--static u8 brcmf_mw_to_qdbm(u16 mw) +--{ +-- u8 qdbm; +-- int offset; +-- uint mw_uint = mw; +-- uint boundary; +-- +-- /* handle boundary case */ +-- if (mw_uint <= 1) +-- return 0; +-- +-- offset = QDBM_OFFSET; +-- +-- /* move mw into the range of the table */ +-- while (mw_uint < QDBM_TABLE_LOW_BOUND) { +-- mw_uint *= 10; +-- offset -= 40; +-- } +-- +-- for (qdbm = 0; qdbm < QDBM_TABLE_LEN - 1; qdbm++) { +-- boundary = nqdBm_to_mW_map[qdbm] + (nqdBm_to_mW_map[qdbm + 1] - +-- nqdBm_to_mW_map[qdbm]) / 2; +-- if (mw_uint < boundary) +-- break; +-- } +-- +-- qdbm += (u8) offset; +-- +-- return qdbm; +--} +- +- static u16 chandef_to_chanspec(struct brcmu_d11inf *d11inf, +- struct cfg80211_chan_def *ch) +-@@ -2016,16 +1933,14 @@ static s32 +- brcmf_cfg80211_set_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, +- enum nl80211_tx_power_setting type, s32 mbm) +- { +-- +- struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); +- struct net_device *ndev = cfg_to_ndev(cfg); +- struct brcmf_if *ifp = netdev_priv(ndev); +-- u16 txpwrmw; +-- s32 err = 0; +-- s32 disable = 0; +-- s32 dbm = MBM_TO_DBM(mbm); +-+ s32 err; +-+ s32 disable; +-+ u32 qdbm = 127; +- +-- brcmf_dbg(TRACE, "Enter\n"); +-+ brcmf_dbg(TRACE, "Enter %d %d\n", type, mbm); +- if (!check_vif_up(ifp->vif)) +- return -EIO; +- +-@@ -2034,12 +1949,20 @@ brcmf_cfg80211_set_tx_power(struct wiphy +- break; +- case NL80211_TX_POWER_LIMITED: +- case NL80211_TX_POWER_FIXED: +-- if (dbm < 0) { +-+ if (mbm < 0) { +- brcmf_err("TX_POWER_FIXED - dbm is negative\n"); +- err = -EINVAL; +- goto done; +- } +-+ qdbm = MBM_TO_DBM(4 * mbm); +-+ if (qdbm > 127) +-+ qdbm = 127; +-+ qdbm |= WL_TXPWR_OVERRIDE; +- break; +-+ default: +-+ brcmf_err("Unsupported type %d\n", type); +-+ err = -EINVAL; +-+ goto done; +- } +- /* Make sure radio is off or on as far as software is concerned */ +- disable = WL_RADIO_SW_DISABLE << 16; +-@@ -2047,52 +1970,44 @@ brcmf_cfg80211_set_tx_power(struct wiphy +- if (err) +- brcmf_err("WLC_SET_RADIO error (%d)\n", err); +- +-- if (dbm > 0xffff) +-- txpwrmw = 0xffff; +-- else +-- txpwrmw = (u16) dbm; +-- err = brcmf_fil_iovar_int_set(ifp, "qtxpower", +-- (s32)brcmf_mw_to_qdbm(txpwrmw)); +-+ err = brcmf_fil_iovar_int_set(ifp, "qtxpower", qdbm); +- if (err) +- brcmf_err("qtxpower error (%d)\n", err); +-- cfg->conf->tx_power = dbm; +- +- done: +-- brcmf_dbg(TRACE, "Exit\n"); +-+ brcmf_dbg(TRACE, "Exit %d (qdbm)\n", qdbm & ~WL_TXPWR_OVERRIDE); +- return err; +- } +- +--static s32 brcmf_cfg80211_get_tx_power(struct wiphy *wiphy, +-- struct wireless_dev *wdev, +-- s32 *dbm) +-+static s32 +-+brcmf_cfg80211_get_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, +-+ s32 *dbm) +- { +- struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); +-- struct brcmf_if *ifp = netdev_priv(cfg_to_ndev(cfg)); +-- s32 txpwrdbm; +-- u8 result; +-- s32 err = 0; +-+ struct net_device *ndev = cfg_to_ndev(cfg); +-+ struct brcmf_if *ifp = netdev_priv(ndev); +-+ s32 qdbm = 0; +-+ s32 err; +- +- brcmf_dbg(TRACE, "Enter\n"); +- if (!check_vif_up(ifp->vif)) +- return -EIO; +- +-- err = brcmf_fil_iovar_int_get(ifp, "qtxpower", &txpwrdbm); +-+ err = brcmf_fil_iovar_int_get(ifp, "qtxpower", &qdbm); +- if (err) { +- brcmf_err("error (%d)\n", err); +- goto done; +- } +-- +-- result = (u8) (txpwrdbm & ~WL_TXPWR_OVERRIDE); +-- *dbm = (s32) brcmf_qdbm_to_mw(result); +-+ *dbm = (qdbm & ~WL_TXPWR_OVERRIDE) / 4; +- +- done: +-- brcmf_dbg(TRACE, "Exit\n"); +-+ brcmf_dbg(TRACE, "Exit (0x%x %d)\n", qdbm, *dbm); +- return err; +- } +- +- static s32 +- brcmf_cfg80211_config_default_key(struct wiphy *wiphy, struct net_device *ndev, +-- u8 key_idx, bool unicast, bool multicast) +-+ u8 key_idx, bool unicast, bool multicast) +- { +- struct brcmf_if *ifp = netdev_priv(ndev); +- u32 index; +diff --git a/package/kernel/mac80211/patches/370-0004-brcmfmac-Only-assign-primary-netdev-to-if2bss-array.patch b/package/kernel/mac80211/patches/370-0004-brcmfmac-Only-assign-primary-netdev-to-if2bss-array.patch +deleted file mode 100644 +index c51365f..0000000 +--- a/package/kernel/mac80211/patches/370-0004-brcmfmac-Only-assign-primary-netdev-to-if2bss-array.patch ++++ /dev/null +@@ -1,73 +0,0 @@ +-From: Hante Meuleman +-Date: Fri, 18 Sep 2015 22:08:07 +0200 +-Subject: [PATCH] brcmfmac: Only assign primary netdev to if2bss array. +- +-The if2bss allows for translation of ifidx to bssidx which has a 1:n +-relation. Therefor only the first (primary) netdev should be +-assigned in this array. This fixes the p2pon=1 module param usage. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c +-@@ -53,6 +53,8 @@ MODULE_LICENSE("Dual BSD/GPL"); +- #define BRCMF_RXREORDER_EXPIDX_VALID 0x08 +- #define BRCMF_RXREORDER_NEW_HOLE 0x10 +- +-+#define BRCMF_BSSIDX_INVALID -1 +-+ +- /* Error bits */ +- int brcmf_msg_level; +- module_param_named(debug, brcmf_msg_level, int, S_IRUSR | S_IWUSR); +-@@ -837,7 +839,8 @@ struct brcmf_if *brcmf_add_if(struct brc +- ifp = netdev_priv(ndev); +- ifp->ndev = ndev; +- /* store mapping ifidx to bssidx */ +-- drvr->if2bss[ifidx] = bssidx; +-+ if (drvr->if2bss[ifidx] == BRCMF_BSSIDX_INVALID) +-+ drvr->if2bss[ifidx] = bssidx; +- } +- +- ifp->drvr = drvr; +-@@ -862,15 +865,15 @@ static void brcmf_del_if(struct brcmf_pu +- struct brcmf_if *ifp; +- +- ifp = drvr->iflist[bssidx]; +-- drvr->if2bss[ifp->ifidx] = -1; +- drvr->iflist[bssidx] = NULL; +- if (!ifp) { +- brcmf_err("Null interface, idx=%d\n", bssidx); +- return; +- } +- brcmf_dbg(TRACE, "Enter, idx=%d, ifidx=%d\n", bssidx, ifp->ifidx); +-+ if (drvr->if2bss[ifp->ifidx] == bssidx) +-+ drvr->if2bss[ifp->ifidx] = BRCMF_BSSIDX_INVALID; +- if (ifp->ndev) { +-- drvr->if2bss[ifp->ifidx] = -1; +- if (bssidx == 0) { +- if (ifp->ndev->netdev_ops == &brcmf_netdev_ops_pri) { +- rtnl_lock(); +-@@ -926,6 +929,7 @@ int brcmf_attach(struct device *dev) +- { +- struct brcmf_pub *drvr = NULL; +- int ret = 0; +-+ int i; +- +- brcmf_dbg(TRACE, "Enter\n"); +- +-@@ -934,7 +938,9 @@ int brcmf_attach(struct device *dev) +- if (!drvr) +- return -ENOMEM; +- +-- memset(drvr->if2bss, 0xFF, sizeof(drvr->if2bss)); +-+ for (i = 0; i < ARRAY_SIZE(drvr->if2bss); i++) +-+ drvr->if2bss[i] = BRCMF_BSSIDX_INVALID; +-+ +- mutex_init(&drvr->proto_block); +- +- /* Link to bus module */ +diff --git a/package/kernel/mac80211/patches/370-0005-brcmfmac-Inform-p2p-module-about-p2pon-through-API.patch b/package/kernel/mac80211/patches/370-0005-brcmfmac-Inform-p2p-module-about-p2pon-through-API.patch +deleted file mode 100644 +index 3c1058d..0000000 +--- a/package/kernel/mac80211/patches/370-0005-brcmfmac-Inform-p2p-module-about-p2pon-through-API.patch ++++ /dev/null +@@ -1,113 +0,0 @@ +-From: Hante Meuleman +-Date: Fri, 18 Sep 2015 22:08:08 +0200 +-Subject: [PATCH] brcmfmac: Inform p2p module about p2pon through API +- +-When the p2pon module param is used then p2p attach will initialize +-p2p device iface in the firmware, but it is doing that by checking +-data. It is cleaner to pass the p2pon information to p2p by API. +-This information is also needed for other patch. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-@@ -6126,7 +6126,8 @@ static void brcmf_free_wiphy(struct wiph +- } +- +- struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr, +-- struct device *busdev) +-+ struct device *busdev, +-+ bool p2pdev_forced) +- { +- struct net_device *ndev = brcmf_get_ifp(drvr, 0)->ndev; +- struct brcmf_cfg80211_info *cfg; +-@@ -6218,7 +6219,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802 +- *cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; +- } +- +-- err = brcmf_p2p_attach(cfg); +-+ err = brcmf_p2p_attach(cfg, p2pdev_forced); +- if (err) { +- brcmf_err("P2P initilisation failed (%d)\n", err); +- goto wiphy_unreg_out; +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.h +-@@ -469,7 +469,8 @@ brcmf_cfg80211_connect_info *cfg_to_conn +- } +- +- struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr, +-- struct device *busdev); +-+ struct device *busdev, +-+ bool p2pdev_forced); +- void brcmf_cfg80211_detach(struct brcmf_cfg80211_info *cfg); +- s32 brcmf_cfg80211_up(struct net_device *ndev); +- s32 brcmf_cfg80211_down(struct net_device *ndev); +---- a/drivers/net/wireless/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c +-@@ -1044,7 +1044,8 @@ int brcmf_bus_start(struct device *dev) +- +- brcmf_fws_add_interface(ifp); +- +-- drvr->config = brcmf_cfg80211_attach(drvr, bus_if->dev); +-+ drvr->config = brcmf_cfg80211_attach(drvr, bus_if->dev, +-+ brcmf_p2p_enable); +- if (drvr->config == NULL) { +- ret = -ENOMEM; +- goto fail; +---- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +-@@ -2333,7 +2333,7 @@ void brcmf_p2p_stop_device(struct wiphy +- * +- * @cfg: driver private data for cfg80211 interface. +- */ +--s32 brcmf_p2p_attach(struct brcmf_cfg80211_info *cfg) +-+s32 brcmf_p2p_attach(struct brcmf_cfg80211_info *cfg, bool p2pdev_forced) +- { +- struct brcmf_if *pri_ifp; +- struct brcmf_if *p2p_ifp; +-@@ -2348,11 +2348,15 @@ s32 brcmf_p2p_attach(struct brcmf_cfg802 +- +- drvr = cfg->pub; +- +-- pri_ifp = drvr->iflist[0]; +-- p2p_ifp = drvr->iflist[1]; +-- +-+ pri_ifp = brcmf_get_ifp(drvr, 0); +- p2p->bss_idx[P2PAPI_BSSCFG_PRIMARY].vif = pri_ifp->vif; +- +-+ if (p2pdev_forced) { +-+ p2p_ifp = drvr->iflist[1]; +-+ } else { +-+ p2p_ifp = NULL; +-+ p2p->p2pdev_dynamically = true; +-+ } +- if (p2p_ifp) { +- p2p_vif = brcmf_alloc_vif(cfg, NL80211_IFTYPE_P2P_DEVICE, +- false); +---- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.h +-@@ -124,6 +124,7 @@ struct afx_hdl { +- * @wait_next_af: thread synchronizing struct. +- * @gon_req_action: about to send go negotiation requets frame. +- * @block_gon_req_tx: drop tx go negotiation requets frame. +-+ * @p2pdev_dynamically: is p2p device if created by module param or supplicant. +- */ +- struct brcmf_p2p_info { +- struct brcmf_cfg80211_info *cfg; +-@@ -144,9 +145,10 @@ struct brcmf_p2p_info { +- struct completion wait_next_af; +- bool gon_req_action; +- bool block_gon_req_tx; +-+ bool p2pdev_dynamically; +- }; +- +--s32 brcmf_p2p_attach(struct brcmf_cfg80211_info *cfg); +-+s32 brcmf_p2p_attach(struct brcmf_cfg80211_info *cfg, bool p2pdev_forced); +- void brcmf_p2p_detach(struct brcmf_p2p_info *p2p); +- struct wireless_dev *brcmf_p2p_add_vif(struct wiphy *wiphy, const char *name, +- enum nl80211_iftype type, u32 *flags, +diff --git a/package/kernel/mac80211/patches/370-0006-brcmfmac-Fix-bug-in-flowring-management.patch b/package/kernel/mac80211/patches/370-0006-brcmfmac-Fix-bug-in-flowring-management.patch +deleted file mode 100644 +index 66b2117..0000000 +--- a/package/kernel/mac80211/patches/370-0006-brcmfmac-Fix-bug-in-flowring-management.patch ++++ /dev/null +@@ -1,26 +0,0 @@ +-From: Hante Meuleman +-Date: Fri, 18 Sep 2015 22:08:09 +0200 +-Subject: [PATCH] brcmfmac: Fix bug in flowring management. +- +-The hash index stored in the flowrings is of type u16 but gets +-stored in u8. This can result in incorrect indexing and possibly +-result in crashes. This patch fixes the type. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/flowring.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/flowring.h +-@@ -34,7 +34,7 @@ enum ring_status { +- }; +- +- struct brcmf_flowring_ring { +-- u8 hash_id; +-+ u16 hash_id; +- bool blocked; +- enum ring_status status; +- struct sk_buff_head skblist; +diff --git a/package/kernel/mac80211/patches/370-0007-brcmfmac-Make-p2pon-module-param-always-available.patch b/package/kernel/mac80211/patches/370-0007-brcmfmac-Make-p2pon-module-param-always-available.patch +deleted file mode 100644 +index c143c3b..0000000 +--- a/package/kernel/mac80211/patches/370-0007-brcmfmac-Make-p2pon-module-param-always-available.patch ++++ /dev/null +@@ -1,29 +0,0 @@ +-From: Hante Meuleman +-Date: Fri, 18 Sep 2015 22:08:10 +0200 +-Subject: [PATCH] brcmfmac: Make p2pon module param always available. +- +-p2pon module param is currently under define BRCMDBG. Though it is +-a needed option for older versions of the wpa_supplicant which do not +-support the P2P_DEVICE interface. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c +-@@ -62,10 +62,8 @@ MODULE_PARM_DESC(debug, "level of debug +- +- /* P2P0 enable */ +- static int brcmf_p2p_enable; +--#ifdef CPTCFG_BRCMDBG +- module_param_named(p2pon, brcmf_p2p_enable, int, 0); +--MODULE_PARM_DESC(p2pon, "enable p2p management functionality"); +--#endif +-+MODULE_PARM_DESC(p2pon, "enable legacy p2p management functionality"); +- +- char *brcmf_ifname(struct brcmf_pub *drvr, int ifidx) +- { +diff --git a/package/kernel/mac80211/patches/370-0008-brcmfmac-Workaround-in-change-vif-for-wpa_supplicant.patch b/package/kernel/mac80211/patches/370-0008-brcmfmac-Workaround-in-change-vif-for-wpa_supplicant.patch +deleted file mode 100644 +index 15ac2d9..0000000 +--- a/package/kernel/mac80211/patches/370-0008-brcmfmac-Workaround-in-change-vif-for-wpa_supplicant.patch ++++ /dev/null +@@ -1,76 +0,0 @@ +-From: Hante Meuleman +-Date: Fri, 18 Sep 2015 22:08:11 +0200 +-Subject: [PATCH] brcmfmac: Workaround in change vif for wpa_supplicant +- support. +- +-Different wpa_supplicants have different behavior and expectations +-regarding the change_virtual_intf behavior. This patch implements +-a workaround for the different versions and possible brcmfmac +-configuration. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-@@ -776,6 +776,37 @@ brcmf_cfg80211_change_iface(struct wiphy +- s32 err = 0; +- +- brcmf_dbg(TRACE, "Enter, idx=%d, type=%d\n", ifp->bssidx, type); +-+ +-+ /* WAR: There are a number of p2p interface related problems which +-+ * need to be handled initially (before doing the validate). +-+ * wpa_supplicant tends to do iface changes on p2p device/client/go +-+ * which are not always possible/allowed. However we need to return +-+ * OK otherwise the wpa_supplicant wont start. The situation differs +-+ * on configuration and setup (p2pon=1 module param). The first check +-+ * is to see if the request is a change to station for p2p iface. +-+ */ +-+ if ((type == NL80211_IFTYPE_STATION) && +-+ ((vif->wdev.iftype == NL80211_IFTYPE_P2P_CLIENT) || +-+ (vif->wdev.iftype == NL80211_IFTYPE_P2P_GO) || +-+ (vif->wdev.iftype == NL80211_IFTYPE_P2P_DEVICE))) { +-+ brcmf_dbg(TRACE, "Ignoring cmd for p2p if\n"); +-+ /* Now depending on whether module param p2pon=1 was used the +-+ * response needs to be either 0 or EOPNOTSUPP. The reason is +-+ * that if p2pon=1 is used, but a newer supplicant is used then +-+ * we should return an error, as this combination wont work. +-+ * In other situations 0 is returned and supplicant will start +-+ * normally. It will give a trace in cfg80211, but it is the +-+ * only way to get it working. Unfortunately this will result +-+ * in situation where we wont support new supplicant in +-+ * combination with module param p2pon=1, but that is the way +-+ * it is. If the user tries this then unloading of driver might +-+ * fail/lock. +-+ */ +-+ if (cfg->p2p.p2pdev_dynamically) +-+ return -EOPNOTSUPP; +-+ else +-+ return 0; +-+ } +- err = brcmf_vif_change_validate(wiphy_to_cfg(wiphy), vif, type); +- if (err) { +- brcmf_err("iface validation failed: err=%d\n", err); +-@@ -791,18 +822,6 @@ brcmf_cfg80211_change_iface(struct wiphy +- infra = 0; +- break; +- case NL80211_IFTYPE_STATION: +-- /* Ignore change for p2p IF. Unclear why supplicant does this */ +-- if ((vif->wdev.iftype == NL80211_IFTYPE_P2P_CLIENT) || +-- (vif->wdev.iftype == NL80211_IFTYPE_P2P_GO)) { +-- brcmf_dbg(TRACE, "Ignoring cmd for p2p if\n"); +-- /* WAR: It is unexpected to get a change of VIF for P2P +-- * IF, but it happens. The request can not be handled +-- * but returning EPERM causes a crash. Returning 0 +-- * without setting ieee80211_ptr->iftype causes trace +-- * (WARN_ON) but it works with wpa_supplicant +-- */ +-- return 0; +-- } +- infra = 1; +- break; +- case NL80211_IFTYPE_AP: +diff --git a/package/kernel/mac80211/patches/370-0009-brcmfmac-Deleting-of-p2p-device-is-leaking-memory.patch b/package/kernel/mac80211/patches/370-0009-brcmfmac-Deleting-of-p2p-device-is-leaking-memory.patch +deleted file mode 100644 +index 1988b5c..0000000 +--- a/package/kernel/mac80211/patches/370-0009-brcmfmac-Deleting-of-p2p-device-is-leaking-memory.patch ++++ /dev/null +@@ -1,124 +0,0 @@ +-From: Hante Meuleman +-Date: Fri, 18 Sep 2015 22:08:12 +0200 +-Subject: [PATCH] brcmfmac: Deleting of p2p device is leaking memory. +- +-When a p2p device gets deleted, the memory for the vif is not being +-released. This is solved by reorganizing the cleanup path and +-properly freeing the memory. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c +-@@ -887,6 +887,16 @@ static void brcmf_del_if(struct brcmf_pu +- cancel_work_sync(&ifp->multicast_work); +- } +- brcmf_net_detach(ifp->ndev); +-+ } else { +-+ /* Only p2p device interfaces which get dynamically created +-+ * end up here. In this case the p2p module should be informed +-+ * about the removal of the interface within the firmware. If +-+ * not then p2p commands towards the firmware will cause some +-+ * serious troublesome side effects. The p2p module will clean +-+ * up the ifp if needed. +-+ */ +-+ brcmf_p2p_ifp_removed(ifp); +-+ kfree(ifp); +- } +- } +- +-@@ -894,7 +904,8 @@ void brcmf_remove_interface(struct brcmf +- { +- if (!ifp || WARN_ON(ifp->drvr->iflist[ifp->bssidx] != ifp)) +- return; +-- +-+ brcmf_dbg(TRACE, "Enter, bssidx=%d, ifidx=%d\n", ifp->bssidx, +-+ ifp->ifidx); +- brcmf_fws_del_interface(ifp); +- brcmf_del_if(ifp->drvr, ifp->bssidx); +- } +---- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +-@@ -2131,20 +2131,6 @@ fail: +- } +- +- /** +-- * brcmf_p2p_delete_p2pdev() - delete P2P_DEVICE virtual interface. +-- * +-- * @vif: virtual interface object to delete. +-- */ +--static void brcmf_p2p_delete_p2pdev(struct brcmf_p2p_info *p2p, +-- struct brcmf_cfg80211_vif *vif) +--{ +-- cfg80211_unregister_wdev(&vif->wdev); +-- p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; +-- brcmf_remove_interface(vif->ifp); +-- brcmf_free_vif(vif); +--} +-- +--/** +- * brcmf_p2p_add_vif() - create a new P2P virtual interface. +- * +- * @wiphy: wiphy device of new interface. +-@@ -2264,9 +2250,11 @@ int brcmf_p2p_del_vif(struct wiphy *wiph +- break; +- +- case NL80211_IFTYPE_P2P_DEVICE: +-+ if (!p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif) +-+ return 0; +- brcmf_p2p_cancel_remain_on_channel(vif->ifp); +- brcmf_p2p_deinit_discovery(p2p); +-- brcmf_p2p_delete_p2pdev(p2p, vif); +-+ brcmf_remove_interface(vif->ifp); +- return 0; +- default: +- return -ENOTSUPP; +-@@ -2298,6 +2286,21 @@ int brcmf_p2p_del_vif(struct wiphy *wiph +- return err; +- } +- +-+void brcmf_p2p_ifp_removed(struct brcmf_if *ifp) +-+{ +-+ struct brcmf_cfg80211_info *cfg; +-+ struct brcmf_cfg80211_vif *vif; +-+ +-+ brcmf_dbg(INFO, "P2P: device interface removed\n"); +-+ vif = ifp->vif; +-+ cfg = wdev_to_cfg(&vif->wdev); +-+ cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; +-+ rtnl_lock(); +-+ cfg80211_unregister_wdev(&vif->wdev); +-+ rtnl_unlock(); +-+ brcmf_free_vif(vif); +-+} +-+ +- int brcmf_p2p_start_device(struct wiphy *wiphy, struct wireless_dev *wdev) +- { +- struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); +-@@ -2422,10 +2425,7 @@ void brcmf_p2p_detach(struct brcmf_p2p_i +- if (vif != NULL) { +- brcmf_p2p_cancel_remain_on_channel(vif->ifp); +- brcmf_p2p_deinit_discovery(p2p); +-- /* remove discovery interface */ +-- rtnl_lock(); +-- brcmf_p2p_delete_p2pdev(p2p, vif); +-- rtnl_unlock(); +-+ brcmf_remove_interface(vif->ifp); +- } +- /* just set it all to zero */ +- memset(p2p, 0, sizeof(*p2p)); +---- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.h +-@@ -156,6 +156,7 @@ struct wireless_dev *brcmf_p2p_add_vif(s +- int brcmf_p2p_del_vif(struct wiphy *wiphy, struct wireless_dev *wdev); +- int brcmf_p2p_ifchange(struct brcmf_cfg80211_info *cfg, +- enum brcmf_fil_p2p_if_types if_type); +-+void brcmf_p2p_ifp_removed(struct brcmf_if *ifp); +- int brcmf_p2p_start_device(struct wiphy *wiphy, struct wireless_dev *wdev); +- void brcmf_p2p_stop_device(struct wiphy *wiphy, struct wireless_dev *wdev); +- int brcmf_p2p_scan_prep(struct wiphy *wiphy, +diff --git a/package/kernel/mac80211/patches/370-0010-brcmfmac-Only-handle-p2p_stop_device-if-vif-is-valid.patch b/package/kernel/mac80211/patches/370-0010-brcmfmac-Only-handle-p2p_stop_device-if-vif-is-valid.patch +deleted file mode 100644 +index 5225c9e..0000000 +--- a/package/kernel/mac80211/patches/370-0010-brcmfmac-Only-handle-p2p_stop_device-if-vif-is-valid.patch ++++ /dev/null +@@ -1,40 +0,0 @@ +-From: Hante Meuleman +-Date: Fri, 18 Sep 2015 22:08:13 +0200 +-Subject: [PATCH] brcmfmac: Only handle p2p_stop_device if vif is valid +- +-In some situations it is possible that vif has been removed while +-cfg80211 invokes the p2p_stop_device handler. This will result in +-crash. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +-@@ -2324,11 +2324,17 @@ void brcmf_p2p_stop_device(struct wiphy +- struct brcmf_cfg80211_vif *vif; +- +- vif = container_of(wdev, struct brcmf_cfg80211_vif, wdev); +-- mutex_lock(&cfg->usr_sync); +-- (void)brcmf_p2p_deinit_discovery(p2p); +-- brcmf_abort_scanning(cfg); +-- clear_bit(BRCMF_VIF_STATUS_READY, &vif->sme_state); +-- mutex_unlock(&cfg->usr_sync); +-+ /* This call can be result of the unregister_wdev call. In that case +-+ * we dont want to do anything anymore. Just return. The config vif +-+ * will have been cleared at this point. +-+ */ +-+ if (p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif == vif) { +-+ mutex_lock(&cfg->usr_sync); +-+ (void)brcmf_p2p_deinit_discovery(p2p); +-+ brcmf_abort_scanning(cfg); +-+ clear_bit(BRCMF_VIF_STATUS_READY, &vif->sme_state); +-+ mutex_unlock(&cfg->usr_sync); +-+ } +- } +- +- /** +diff --git a/package/kernel/mac80211/patches/370-0011-brcmfmac-Fix-p2p-bug-for-older-firmwares.patch b/package/kernel/mac80211/patches/370-0011-brcmfmac-Fix-p2p-bug-for-older-firmwares.patch +deleted file mode 100644 +index e2f24e8..0000000 +--- a/package/kernel/mac80211/patches/370-0011-brcmfmac-Fix-p2p-bug-for-older-firmwares.patch ++++ /dev/null +@@ -1,35 +0,0 @@ +-From: Hante Meuleman +-Date: Fri, 18 Sep 2015 22:08:14 +0200 +-Subject: [PATCH] brcmfmac: Fix p2p bug for older firmwares. +- +-Some devices with older firmwares are reporting new p2p device +-interface with the wrong type. Accept this type to get p2p +-working for these devices. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/fweh.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/fweh.c +-@@ -186,11 +186,13 @@ static void brcmf_fweh_handle_if_event(s +- ifevent->action, ifevent->ifidx, ifevent->bssidx, +- ifevent->flags, ifevent->role); +- +-- /* The P2P Device interface event must not be ignored +-- * contrary to what firmware tells us. +-+ /* The P2P Device interface event must not be ignored contrary to what +-+ * firmware tells us. Older firmware uses p2p noif, with sta role. +-+ * This should be accepted. +- */ +-- is_p2pdev = (ifevent->flags & BRCMF_E_IF_FLAG_NOIF) && +-- ifevent->role == BRCMF_E_IF_ROLE_P2P_CLIENT; +-+ is_p2pdev = ((ifevent->flags & BRCMF_E_IF_FLAG_NOIF) && +-+ (ifevent->role == BRCMF_E_IF_ROLE_P2P_CLIENT || +-+ ifevent->role == BRCMF_E_IF_ROLE_STA)); +- if (!is_p2pdev && (ifevent->flags & BRCMF_E_IF_FLAG_NOIF)) { +- brcmf_dbg(EVENT, "event can be ignored\n"); +- return; +diff --git a/package/kernel/mac80211/patches/370-0012-brcmfmac-Add-module-parameter-to-disable-features.patch b/package/kernel/mac80211/patches/370-0012-brcmfmac-Add-module-parameter-to-disable-features.patch +deleted file mode 100644 +index 52c787f..0000000 +--- a/package/kernel/mac80211/patches/370-0012-brcmfmac-Add-module-parameter-to-disable-features.patch ++++ /dev/null +@@ -1,54 +0,0 @@ +-From: Hante Meuleman +-Date: Fri, 18 Sep 2015 22:08:15 +0200 +-Subject: [PATCH] brcmfmac: Add module parameter to disable features. +- +-For debugging purpose it is very handy to be able to disable +-features. It has happened a few times that new features turned +-out not always being properly detected for all devices/firmwares. +-Making it possible to disable the feature with a module parameter +-will make testing/debugging easier. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/feature.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/feature.c +-@@ -15,6 +15,7 @@ +- */ +- +- #include +-+#include +- +- #include +- #include "core.h" +-@@ -23,6 +24,12 @@ +- #include "fwil.h" +- #include "feature.h" +- +-+ +-+/* Module param feature_disable (global for all devices) */ +-+static int brcmf_feature_disable; +-+module_param_named(feature_disable, brcmf_feature_disable, int, 0); +-+MODULE_PARM_DESC(feature_disable, "Disable features"); +-+ +- /* +- * expand feature list to array of feature strings. +- */ +-@@ -131,6 +138,12 @@ void brcmf_feat_attach(struct brcmf_pub +- brcmf_feat_iovar_int_set(ifp, BRCMF_FEAT_MBSS, "mbss", 0); +- brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_P2P, "p2p"); +- +-+ if (brcmf_feature_disable) { +-+ brcmf_dbg(INFO, "Features: 0x%02x, disable: 0x%02x\n", +-+ ifp->drvr->feat_flags, brcmf_feature_disable); +-+ ifp->drvr->feat_flags &= ~brcmf_feature_disable; +-+ } +-+ +- /* set chip related quirks */ +- switch (drvr->bus_if->chip) { +- case BRCM_CC_43236_CHIP_ID: +diff --git a/package/kernel/mac80211/patches/370-0013-brcmfmac-Fix-race-condition-bug-when-deleting-p2p-in.patch b/package/kernel/mac80211/patches/370-0013-brcmfmac-Fix-race-condition-bug-when-deleting-p2p-in.patch +deleted file mode 100644 +index 58a638a..0000000 +--- a/package/kernel/mac80211/patches/370-0013-brcmfmac-Fix-race-condition-bug-when-deleting-p2p-in.patch ++++ /dev/null +@@ -1,80 +0,0 @@ +-From: Hante Meuleman +-Date: Fri, 18 Sep 2015 22:08:16 +0200 +-Subject: [PATCH] brcmfmac: Fix race condition bug when deleting p2p interface. +- +-When p2p device interface gets deleted by deinitialising discovery +-it will result in an event which removes the interface, but that is +-also done by delete p2p interface code. This results in race +-condition which sometimes results in lockup/crash. With this patch +-the delete device interface will wait for the event (with timeout) +-removing the possible race condition. Also on the stop device call +-from cfg80211 the deinitialisation of the discovery device should +-be avoided as it can result in a similar situation. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +-@@ -2238,6 +2238,7 @@ int brcmf_p2p_del_vif(struct wiphy *wiph +- brcmf_dbg(TRACE, "delete P2P vif\n"); +- vif = container_of(wdev, struct brcmf_cfg80211_vif, wdev); +- +-+ brcmf_cfg80211_arm_vif_event(cfg, vif); +- switch (vif->wdev.iftype) { +- case NL80211_IFTYPE_P2P_CLIENT: +- if (test_bit(BRCMF_VIF_STATUS_DISCONNECTING, &vif->sme_state)) +-@@ -2254,8 +2255,6 @@ int brcmf_p2p_del_vif(struct wiphy *wiph +- return 0; +- brcmf_p2p_cancel_remain_on_channel(vif->ifp); +- brcmf_p2p_deinit_discovery(p2p); +-- brcmf_remove_interface(vif->ifp); +-- return 0; +- default: +- return -ENOTSUPP; +- } +-@@ -2267,10 +2266,11 @@ int brcmf_p2p_del_vif(struct wiphy *wiph +- wait_for_completion_timeout(&cfg->vif_disabled, +- msecs_to_jiffies(500)); +- +-- brcmf_vif_clear_mgmt_ies(vif); +-- +-- brcmf_cfg80211_arm_vif_event(cfg, vif); +-- err = brcmf_p2p_release_p2p_if(vif); +-+ err = 0; +-+ if (vif->wdev.iftype != NL80211_IFTYPE_P2P_DEVICE) { +-+ brcmf_vif_clear_mgmt_ies(vif); +-+ err = brcmf_p2p_release_p2p_if(vif); +-+ } +- if (!err) { +- /* wait for firmware event */ +- err = brcmf_cfg80211_wait_vif_event_timeout(cfg, BRCMF_E_IF_DEL, +-@@ -2280,8 +2280,12 @@ int brcmf_p2p_del_vif(struct wiphy *wiph +- else +- err = 0; +- } +-+ if (err) +-+ brcmf_remove_interface(vif->ifp); +-+ +- brcmf_cfg80211_arm_vif_event(cfg, NULL); +-- p2p->bss_idx[P2PAPI_BSSCFG_CONNECTION].vif = NULL; +-+ if (vif->wdev.iftype != NL80211_IFTYPE_P2P_DEVICE) +-+ p2p->bss_idx[P2PAPI_BSSCFG_CONNECTION].vif = NULL; +- +- return err; +- } +-@@ -2330,7 +2334,9 @@ void brcmf_p2p_stop_device(struct wiphy +- */ +- if (p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif == vif) { +- mutex_lock(&cfg->usr_sync); +-- (void)brcmf_p2p_deinit_discovery(p2p); +-+ /* Set the discovery state to SCAN */ +-+ (void)brcmf_p2p_set_discover_state(vif->ifp, +-+ WL_P2P_DISC_ST_SCAN, 0, 0); +- brcmf_abort_scanning(cfg); +- clear_bit(BRCMF_VIF_STATUS_READY, &vif->sme_state); +- mutex_unlock(&cfg->usr_sync); +diff --git a/package/kernel/mac80211/patches/370-0014-brcmfmac-Add-support-for-the-BCM4365-and-BCM4366-PCI.patch b/package/kernel/mac80211/patches/370-0014-brcmfmac-Add-support-for-the-BCM4365-and-BCM4366-PCI.patch +deleted file mode 100644 +index d0bbf2a..0000000 +--- a/package/kernel/mac80211/patches/370-0014-brcmfmac-Add-support-for-the-BCM4365-and-BCM4366-PCI.patch ++++ /dev/null +@@ -1,277 +0,0 @@ +-From: Hante Meuleman +-Date: Fri, 18 Sep 2015 22:08:17 +0200 +-Subject: [PATCH] brcmfmac: Add support for the BCM4365 and BCM4366 PCIE +- devices. +- +-This patch adds support for the BCM4365 and BCM4366 11ac Wave2 +-PCIE devices. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/chip.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c +-@@ -208,6 +208,7 @@ struct sbsocramregs { +- }; +- +- #define SOCRAMREGOFFS(_f) offsetof(struct sbsocramregs, _f) +-+#define SYSMEMREGOFFS(_f) offsetof(struct sbsocramregs, _f) +- +- #define ARMCR4_CAP (0x04) +- #define ARMCR4_BANKIDX (0x40) +-@@ -516,6 +517,9 @@ static int brcmf_chip_cores_check(struct +- case BCMA_CORE_ARM_CR4: +- cpu_found = true; +- break; +-+ case BCMA_CORE_ARM_CA7: +-+ cpu_found = true; +-+ break; +- default: +- break; +- } +-@@ -614,6 +618,29 @@ static void brcmf_chip_socram_ramsize(st +- } +- } +- +-+/** Return the SYS MEM size */ +-+static u32 brcmf_chip_sysmem_ramsize(struct brcmf_core_priv *sysmem) +-+{ +-+ u32 memsize = 0; +-+ u32 coreinfo; +-+ u32 idx; +-+ u32 nb; +-+ u32 banksize; +-+ +-+ if (!brcmf_chip_iscoreup(&sysmem->pub)) +-+ brcmf_chip_resetcore(&sysmem->pub, 0, 0, 0); +-+ +-+ coreinfo = brcmf_chip_core_read32(sysmem, SYSMEMREGOFFS(coreinfo)); +-+ nb = (coreinfo & SRCI_SRNB_MASK) >> SRCI_SRNB_SHIFT; +-+ +-+ for (idx = 0; idx < nb; idx++) { +-+ brcmf_chip_socram_banksize(sysmem, idx, &banksize); +-+ memsize += banksize; +-+ } +-+ +-+ return memsize; +-+} +-+ +- /** Return the TCM-RAM size of the ARMCR4 core. */ +- static u32 brcmf_chip_tcm_ramsize(struct brcmf_core_priv *cr4) +- { +-@@ -656,6 +683,9 @@ static u32 brcmf_chip_tcm_rambase(struct +- case BRCM_CC_4358_CHIP_ID: +- case BRCM_CC_43602_CHIP_ID: +- return 0x180000; +-+ case BRCM_CC_4365_CHIP_ID: +-+ case BRCM_CC_4366_CHIP_ID: +-+ return 0x200000; +- default: +- brcmf_err("unknown chip: %s\n", ci->pub.name); +- break; +-@@ -678,10 +708,28 @@ static int brcmf_chip_get_raminfo(struct +- return -EINVAL; +- } +- } else { +-- mem = brcmf_chip_get_core(&ci->pub, BCMA_CORE_INTERNAL_MEM); +-- mem_core = container_of(mem, struct brcmf_core_priv, pub); +-- brcmf_chip_socram_ramsize(mem_core, &ci->pub.ramsize, +-- &ci->pub.srsize); +-+ mem = brcmf_chip_get_core(&ci->pub, BCMA_CORE_SYS_MEM); +-+ if (mem) { +-+ mem_core = container_of(mem, struct brcmf_core_priv, +-+ pub); +-+ ci->pub.ramsize = brcmf_chip_sysmem_ramsize(mem_core); +-+ ci->pub.rambase = brcmf_chip_tcm_rambase(ci); +-+ if (!ci->pub.rambase) { +-+ brcmf_err("RAM base not provided with ARM CA7 core\n"); +-+ return -EINVAL; +-+ } +-+ } else { +-+ mem = brcmf_chip_get_core(&ci->pub, +-+ BCMA_CORE_INTERNAL_MEM); +-+ if (!mem) { +-+ brcmf_err("No memory cores found\n"); +-+ return -ENOMEM; +-+ } +-+ mem_core = container_of(mem, struct brcmf_core_priv, +-+ pub); +-+ brcmf_chip_socram_ramsize(mem_core, &ci->pub.ramsize, +-+ &ci->pub.srsize); +-+ } +- } +- brcmf_dbg(INFO, "RAM: base=0x%x size=%d (0x%x) sr=%d (0x%x)\n", +- ci->pub.rambase, ci->pub.ramsize, ci->pub.ramsize, +-@@ -924,7 +972,7 @@ static int brcmf_chip_recognition(struct +- static void brcmf_chip_disable_arm(struct brcmf_chip_priv *chip, u16 id) +- { +- struct brcmf_core *core; +-- struct brcmf_core_priv *cr4; +-+ struct brcmf_core_priv *cpu; +- u32 val; +- +- +-@@ -937,10 +985,11 @@ static void brcmf_chip_disable_arm(struc +- brcmf_chip_coredisable(core, 0, 0); +- break; +- case BCMA_CORE_ARM_CR4: +-- cr4 = container_of(core, struct brcmf_core_priv, pub); +-+ case BCMA_CORE_ARM_CA7: +-+ cpu = container_of(core, struct brcmf_core_priv, pub); +- +- /* clear all IOCTL bits except HALT bit */ +-- val = chip->ops->read32(chip->ctx, cr4->wrapbase + BCMA_IOCTL); +-+ val = chip->ops->read32(chip->ctx, cpu->wrapbase + BCMA_IOCTL); +- val &= ARMCR4_BCMA_IOCTL_CPUHALT; +- brcmf_chip_resetcore(core, val, ARMCR4_BCMA_IOCTL_CPUHALT, +- ARMCR4_BCMA_IOCTL_CPUHALT); +-@@ -1162,6 +1211,33 @@ static bool brcmf_chip_cr4_set_active(st +- return true; +- } +- +-+static inline void +-+brcmf_chip_ca7_set_passive(struct brcmf_chip_priv *chip) +-+{ +-+ struct brcmf_core *core; +-+ +-+ brcmf_chip_disable_arm(chip, BCMA_CORE_ARM_CA7); +-+ +-+ core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_80211); +-+ brcmf_chip_resetcore(core, D11_BCMA_IOCTL_PHYRESET | +-+ D11_BCMA_IOCTL_PHYCLOCKEN, +-+ D11_BCMA_IOCTL_PHYCLOCKEN, +-+ D11_BCMA_IOCTL_PHYCLOCKEN); +-+} +-+ +-+static bool brcmf_chip_ca7_set_active(struct brcmf_chip_priv *chip, u32 rstvec) +-+{ +-+ struct brcmf_core *core; +-+ +-+ chip->ops->activate(chip->ctx, &chip->pub, rstvec); +-+ +-+ /* restore ARM */ +-+ core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_ARM_CA7); +-+ brcmf_chip_resetcore(core, ARMCR4_BCMA_IOCTL_CPUHALT, 0, 0); +-+ +-+ return true; +-+} +-+ +- void brcmf_chip_set_passive(struct brcmf_chip *pub) +- { +- struct brcmf_chip_priv *chip; +-@@ -1175,8 +1251,16 @@ void brcmf_chip_set_passive(struct brcmf +- brcmf_chip_cr4_set_passive(chip); +- return; +- } +-- +-- brcmf_chip_cm3_set_passive(chip); +-+ arm = brcmf_chip_get_core(pub, BCMA_CORE_ARM_CA7); +-+ if (arm) { +-+ brcmf_chip_ca7_set_passive(chip); +-+ return; +-+ } +-+ arm = brcmf_chip_get_core(pub, BCMA_CORE_ARM_CM3); +-+ if (arm) { +-+ brcmf_chip_cm3_set_passive(chip); +-+ return; +-+ } +- } +- +- bool brcmf_chip_set_active(struct brcmf_chip *pub, u32 rstvec) +-@@ -1190,8 +1274,14 @@ bool brcmf_chip_set_active(struct brcmf_ +- arm = brcmf_chip_get_core(pub, BCMA_CORE_ARM_CR4); +- if (arm) +- return brcmf_chip_cr4_set_active(chip, rstvec); +-+ arm = brcmf_chip_get_core(pub, BCMA_CORE_ARM_CA7); +-+ if (arm) +-+ return brcmf_chip_ca7_set_active(chip, rstvec); +-+ arm = brcmf_chip_get_core(pub, BCMA_CORE_ARM_CM3); +-+ if (arm) +-+ return brcmf_chip_cm3_set_active(chip); +- +-- return brcmf_chip_cm3_set_active(chip); +-+ return false; +- } +- +- bool brcmf_chip_sr_capable(struct brcmf_chip *pub) +---- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-@@ -55,6 +55,10 @@ enum brcmf_pcie_state { +- #define BRCMF_PCIE_43570_NVRAM_NAME "brcm/brcmfmac43570-pcie.txt" +- #define BRCMF_PCIE_4358_FW_NAME "brcm/brcmfmac4358-pcie.bin" +- #define BRCMF_PCIE_4358_NVRAM_NAME "brcm/brcmfmac4358-pcie.txt" +-+#define BRCMF_PCIE_4365_FW_NAME "brcm/brcmfmac4365b-pcie.bin" +-+#define BRCMF_PCIE_4365_NVRAM_NAME "brcm/brcmfmac4365b-pcie.txt" +-+#define BRCMF_PCIE_4366_FW_NAME "brcm/brcmfmac4366b-pcie.bin" +-+#define BRCMF_PCIE_4366_NVRAM_NAME "brcm/brcmfmac4366b-pcie.txt" +- +- #define BRCMF_PCIE_FW_UP_TIMEOUT 2000 /* msec */ +- +-@@ -204,6 +208,10 @@ MODULE_FIRMWARE(BRCMF_PCIE_43570_FW_NAME +- MODULE_FIRMWARE(BRCMF_PCIE_43570_NVRAM_NAME); +- MODULE_FIRMWARE(BRCMF_PCIE_4358_FW_NAME); +- MODULE_FIRMWARE(BRCMF_PCIE_4358_NVRAM_NAME); +-+MODULE_FIRMWARE(BRCMF_PCIE_4365_FW_NAME); +-+MODULE_FIRMWARE(BRCMF_PCIE_4365_NVRAM_NAME); +-+MODULE_FIRMWARE(BRCMF_PCIE_4366_FW_NAME); +-+MODULE_FIRMWARE(BRCMF_PCIE_4366_NVRAM_NAME); +- +- +- struct brcmf_pcie_console { +-@@ -1440,6 +1448,14 @@ static int brcmf_pcie_get_fwnames(struct +- fw_name = BRCMF_PCIE_4358_FW_NAME; +- nvram_name = BRCMF_PCIE_4358_NVRAM_NAME; +- break; +-+ case BRCM_CC_4365_CHIP_ID: +-+ fw_name = BRCMF_PCIE_4365_FW_NAME; +-+ nvram_name = BRCMF_PCIE_4365_NVRAM_NAME; +-+ break; +-+ case BRCM_CC_4366_CHIP_ID: +-+ fw_name = BRCMF_PCIE_4366_FW_NAME; +-+ nvram_name = BRCMF_PCIE_4366_NVRAM_NAME; +-+ break; +- default: +- brcmf_err("Unsupported chip 0x%04x\n", devinfo->ci->chip); +- return -ENODEV; +-@@ -1973,6 +1989,12 @@ static struct pci_device_id brcmf_pcie_d +- BRCMF_PCIE_DEVICE(BRCM_PCIE_43602_2G_DEVICE_ID), +- BRCMF_PCIE_DEVICE(BRCM_PCIE_43602_5G_DEVICE_ID), +- BRCMF_PCIE_DEVICE(BRCM_PCIE_43602_RAW_DEVICE_ID), +-+ BRCMF_PCIE_DEVICE(BRCM_PCIE_4365_DEVICE_ID), +-+ BRCMF_PCIE_DEVICE(BRCM_PCIE_4365_2G_DEVICE_ID), +-+ BRCMF_PCIE_DEVICE(BRCM_PCIE_4365_5G_DEVICE_ID), +-+ BRCMF_PCIE_DEVICE(BRCM_PCIE_4366_DEVICE_ID), +-+ BRCMF_PCIE_DEVICE(BRCM_PCIE_4366_2G_DEVICE_ID), +-+ BRCMF_PCIE_DEVICE(BRCM_PCIE_4366_5G_DEVICE_ID), +- { /* end: all zeroes */ } +- }; +- +---- a/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h +-+++ b/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h +-@@ -48,6 +48,8 @@ +- #define BRCM_CC_43570_CHIP_ID 43570 +- #define BRCM_CC_4358_CHIP_ID 0x4358 +- #define BRCM_CC_43602_CHIP_ID 43602 +-+#define BRCM_CC_4365_CHIP_ID 0x4365 +-+#define BRCM_CC_4366_CHIP_ID 0x4366 +- +- /* USB Device IDs */ +- #define BRCM_USB_43143_DEVICE_ID 0xbd1e +-@@ -67,6 +69,13 @@ +- #define BRCM_PCIE_43602_2G_DEVICE_ID 0x43bb +- #define BRCM_PCIE_43602_5G_DEVICE_ID 0x43bc +- #define BRCM_PCIE_43602_RAW_DEVICE_ID 43602 +-+#define BRCM_PCIE_4365_DEVICE_ID 0x43ca +-+#define BRCM_PCIE_4365_2G_DEVICE_ID 0x43cb +-+#define BRCM_PCIE_4365_5G_DEVICE_ID 0x43cc +-+#define BRCM_PCIE_4366_DEVICE_ID 0x43c3 +-+#define BRCM_PCIE_4366_2G_DEVICE_ID 0x43c4 +-+#define BRCM_PCIE_4366_5G_DEVICE_ID 0x43c5 +-+ +- +- /* brcmsmac IDs */ +- #define BCM4313_D11N2G_ID 0x4727 /* 4313 802.11n 2.4G device */ +diff --git a/package/kernel/mac80211/patches/370-0015-brcmfmac-Fix-TDLS-setup-by-properly-handling-p2p-noi.patch b/package/kernel/mac80211/patches/370-0015-brcmfmac-Fix-TDLS-setup-by-properly-handling-p2p-noi.patch +deleted file mode 100644 +index d33c803..0000000 +--- a/package/kernel/mac80211/patches/370-0015-brcmfmac-Fix-TDLS-setup-by-properly-handling-p2p-noi.patch ++++ /dev/null +@@ -1,120 +0,0 @@ +-From: Hante Meuleman +-Date: Fri, 18 Sep 2015 22:08:18 +0200 +-Subject: [PATCH] brcmfmac: Fix TDLS setup by properly handling p2p noif. +- +-There is a workaround needed for p2p device setup which breaks tdls +-functionality. This patch fixes that by properly signalling fweh that +-p2p device setup is ongoing. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/fweh.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/fweh.c +-@@ -188,11 +188,13 @@ static void brcmf_fweh_handle_if_event(s +- +- /* The P2P Device interface event must not be ignored contrary to what +- * firmware tells us. Older firmware uses p2p noif, with sta role. +-- * This should be accepted. +-+ * This should be accepted when p2pdev_setup is ongoing. TDLS setup will +-+ * use the same ifevent and should be ignored. +- */ +- is_p2pdev = ((ifevent->flags & BRCMF_E_IF_FLAG_NOIF) && +- (ifevent->role == BRCMF_E_IF_ROLE_P2P_CLIENT || +-- ifevent->role == BRCMF_E_IF_ROLE_STA)); +-+ ((ifevent->role == BRCMF_E_IF_ROLE_STA) && +-+ (drvr->fweh.p2pdev_setup_ongoing)))); +- if (!is_p2pdev && (ifevent->flags & BRCMF_E_IF_FLAG_NOIF)) { +- brcmf_dbg(EVENT, "event can be ignored\n"); +- return; +-@@ -316,6 +318,17 @@ event_free: +- } +- +- /** +-+ * brcmf_fweh_p2pdev_setup() - P2P device setup ongoing (or not). +-+ * +-+ * @ifp: ifp on which setup is taking place or finished. +-+ * @ongoing: p2p device setup in progress (or not). +-+ */ +-+void brcmf_fweh_p2pdev_setup(struct brcmf_if *ifp, bool ongoing) +-+{ +-+ ifp->drvr->fweh.p2pdev_setup_ongoing = ongoing; +-+} +-+ +-+/** +- * brcmf_fweh_attach() - initialize firmware event handling. +- * +- * @drvr: driver information object. +---- a/drivers/net/wireless/brcm80211/brcmfmac/fweh.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/fweh.h +-@@ -230,12 +230,14 @@ typedef int (*brcmf_fweh_handler_t)(stru +- /** +- * struct brcmf_fweh_info - firmware event handling information. +- * +-+ * @p2pdev_setup_ongoing: P2P device creation in progress. +- * @event_work: event worker. +- * @evt_q_lock: lock for event queue protection. +- * @event_q: event queue. +- * @evt_handler: registered event handlers. +- */ +- struct brcmf_fweh_info { +-+ bool p2pdev_setup_ongoing; +- struct work_struct event_work; +- spinlock_t evt_q_lock; +- struct list_head event_q; +-@@ -255,6 +257,7 @@ void brcmf_fweh_unregister(struct brcmf_ +- int brcmf_fweh_activate_events(struct brcmf_if *ifp); +- void brcmf_fweh_process_event(struct brcmf_pub *drvr, +- struct brcmf_event *event_packet); +-+void brcmf_fweh_p2pdev_setup(struct brcmf_if *ifp, bool ongoing); +- +- static inline void brcmf_fweh_process_skb(struct brcmf_pub *drvr, +- struct sk_buff *skb) +---- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +-@@ -2084,11 +2084,13 @@ static struct wireless_dev *brcmf_p2p_cr +- brcmf_p2p_set_firmware(pri_ifp, p2p->dev_addr); +- +- brcmf_cfg80211_arm_vif_event(p2p->cfg, p2p_vif); +-+ brcmf_fweh_p2pdev_setup(pri_ifp, true); +- +- /* Initialize P2P Discovery in the firmware */ +- err = brcmf_fil_iovar_int_set(pri_ifp, "p2p_disc", 1); +- if (err < 0) { +- brcmf_err("set p2p_disc error\n"); +-+ brcmf_fweh_p2pdev_setup(pri_ifp, false); +- brcmf_cfg80211_arm_vif_event(p2p->cfg, NULL); +- goto fail; +- } +-@@ -2097,6 +2099,7 @@ static struct wireless_dev *brcmf_p2p_cr +- err = brcmf_cfg80211_wait_vif_event_timeout(p2p->cfg, BRCMF_E_IF_ADD, +- msecs_to_jiffies(1500)); +- brcmf_cfg80211_arm_vif_event(p2p->cfg, NULL); +-+ brcmf_fweh_p2pdev_setup(pri_ifp, false); +- if (!err) { +- brcmf_err("timeout occurred\n"); +- err = -EIO; +-@@ -2393,6 +2396,8 @@ s32 brcmf_p2p_attach(struct brcmf_cfg802 +- memcpy(p2p_ifp->mac_addr, p2p->dev_addr, ETH_ALEN); +- brcmf_p2p_set_firmware(pri_ifp, p2p->dev_addr); +- +-+ brcmf_fweh_p2pdev_setup(pri_ifp, true); +-+ +- /* Initialize P2P Discovery in the firmware */ +- err = brcmf_fil_iovar_int_set(pri_ifp, "p2p_disc", 1); +- if (err < 0) { +-@@ -2419,8 +2424,9 @@ s32 brcmf_p2p_attach(struct brcmf_cfg802 +- INIT_WORK(&p2p->afx_hdl.afx_work, brcmf_p2p_afx_handler); +- init_completion(&p2p->afx_hdl.act_frm_scan); +- init_completion(&p2p->wait_next_af); +-- } +- exit: +-+ brcmf_fweh_p2pdev_setup(pri_ifp, false); +-+ } +- return err; +- } +- +diff --git a/package/kernel/mac80211/patches/370-0016-brcmfmac-Accept-events-when-TDLS-is-used-in-combinat.patch b/package/kernel/mac80211/patches/370-0016-brcmfmac-Accept-events-when-TDLS-is-used-in-combinat.patch +deleted file mode 100644 +index b880078..0000000 +--- a/package/kernel/mac80211/patches/370-0016-brcmfmac-Accept-events-when-TDLS-is-used-in-combinat.patch ++++ /dev/null +@@ -1,29 +0,0 @@ +-From: Hante Meuleman +-Date: Fri, 18 Sep 2015 22:08:19 +0200 +-Subject: [PATCH] brcmfmac: Accept events when TDLS is used in combination with +- p2p. +- +-TDLS events are mapped back to primary interface but when p2p is in +-use then this fails because the check was incorrect by checking +-bsscfg number. Which can be different when a p2p device has been +-created. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/fweh.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/fweh.c +-@@ -300,8 +300,7 @@ static void brcmf_fweh_event_worker(stru +- goto event_free; +- } +- +-- if ((event->code == BRCMF_E_TDLS_PEER_EVENT) && +-- (emsg.bsscfgidx == 1)) +-+ if (event->code == BRCMF_E_TDLS_PEER_EVENT) +- ifp = drvr->iflist[0]; +- else +- ifp = drvr->iflist[emsg.bsscfgidx]; +diff --git a/package/kernel/mac80211/patches/371-brcmfmac-include-linux-atomic.h.patch b/package/kernel/mac80211/patches/371-brcmfmac-include-linux-atomic.h.patch +deleted file mode 100644 +index 9311a9d..0000000 +--- a/package/kernel/mac80211/patches/371-brcmfmac-include-linux-atomic.h.patch ++++ /dev/null +@@ -1,23 +0,0 @@ +-From: Hauke Mehrtens +-Date: Sat, 19 Sep 2015 12:47:20 +0200 +-Subject: [PATCH] brcmfmac: include linux/atomic.h +- +-brcmfmac uses atomic_or() and other atomic_* functions, but does not +-include linux/atomic.h. This file gets included by some other header +-file so this normally does not cause problems. +- +-Signed-off-by: Hauke Mehrtens +-Acked-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-@@ -15,6 +15,7 @@ +- */ +- +- #include +-+#include +- #include +- #include +- #include +diff --git a/package/kernel/mac80211/patches/372-0001-brcmfmac-expose-device-memory-to-devcoredump-subsyst.patch b/package/kernel/mac80211/patches/372-0001-brcmfmac-expose-device-memory-to-devcoredump-subsyst.patch +deleted file mode 100644 +index cf3f278..0000000 +--- a/package/kernel/mac80211/patches/372-0001-brcmfmac-expose-device-memory-to-devcoredump-subsyst.patch ++++ /dev/null +@@ -1,347 +0,0 @@ +-From: Arend van Spriel +-Date: Thu, 8 Oct 2015 20:33:11 +0200 +-Subject: [PATCH] brcmfmac: expose device memory to devcoredump subsystem +- +-Upon PSM watchdog event received from firmware the driver will obtain +-a memory snapshot of the device and expose it to user-space through +-the devcoredump framework. This will trigger a uevent. +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/Kconfig +-+++ b/drivers/net/wireless/brcm80211/Kconfig +-@@ -85,5 +85,6 @@ config BRCM_TRACING +- config BRCMDBG +- bool "Broadcom driver debug functions" +- depends on BRCMSMAC || BRCMFMAC +-+ select WANT_DEV_COREDUMP +- ---help--- +- Selecting this enables additional code for debug purposes. +---- a/drivers/net/wireless/brcm80211/brcmfmac/bus.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/bus.h +-@@ -65,6 +65,8 @@ struct brcmf_bus_dcmd { +- * @rxctl: receive a control response message from dongle. +- * @gettxq: obtain a reference of bus transmit queue (optional). +- * @wowl_config: specify if dongle is configured for wowl when going to suspend +-+ * @get_ramsize: obtain size of device memory. +-+ * @get_memdump: obtain device memory dump in provided buffer. +- * +- * This structure provides an abstract interface towards the +- * bus specific driver. For control messages to common driver +-@@ -79,6 +81,8 @@ struct brcmf_bus_ops { +- int (*rxctl)(struct device *dev, unsigned char *msg, uint len); +- struct pktq * (*gettxq)(struct device *dev); +- void (*wowl_config)(struct device *dev, bool enabled); +-+ size_t (*get_ramsize)(struct device *dev); +-+ int (*get_memdump)(struct device *dev, void *data, size_t len); +- }; +- +- +-@@ -185,6 +189,23 @@ void brcmf_bus_wowl_config(struct brcmf_ +- bus->ops->wowl_config(bus->dev, enabled); +- } +- +-+static inline size_t brcmf_bus_get_ramsize(struct brcmf_bus *bus) +-+{ +-+ if (!bus->ops->get_ramsize) +-+ return 0; +-+ +-+ return bus->ops->get_ramsize(bus->dev); +-+} +-+ +-+static inline +-+int brcmf_bus_get_memdump(struct brcmf_bus *bus, void *data, size_t len) +-+{ +-+ if (!bus->ops->get_memdump) +-+ return -EOPNOTSUPP; +-+ +-+ return bus->ops->get_memdump(bus->dev, data, len); +-+} +-+ +- /* +- * interface functions from common layer +- */ +---- a/drivers/net/wireless/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c +-@@ -957,8 +957,8 @@ int brcmf_attach(struct device *dev) +- drvr->bus_if = dev_get_drvdata(dev); +- drvr->bus_if->drvr = drvr; +- +-- /* create device debugfs folder */ +-- brcmf_debugfs_attach(drvr); +-+ /* attach debug facilities */ +-+ brcmf_debug_attach(drvr); +- +- /* Attach and link in the protocol */ +- ret = brcmf_proto_attach(drvr); +-@@ -1155,7 +1155,7 @@ void brcmf_detach(struct device *dev) +- +- brcmf_proto_detach(drvr); +- +-- brcmf_debugfs_detach(drvr); +-+ brcmf_debug_detach(drvr); +- bus_if->drvr = NULL; +- kfree(drvr); +- } +---- a/drivers/net/wireless/brcm80211/brcmfmac/debug.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/debug.c +-@@ -16,15 +16,45 @@ +- #include +- #include +- #include +-+#include +- +- #include +- #include +- #include "core.h" +- #include "bus.h" +-+#include "fweh.h" +- #include "debug.h" +- +- static struct dentry *root_folder; +- +-+static int brcmf_debug_create_memdump(struct brcmf_bus *bus, const void *data, +-+ size_t len) +-+{ +-+ void *dump; +-+ size_t ramsize; +-+ +-+ ramsize = brcmf_bus_get_ramsize(bus); +-+ if (ramsize) { +-+ dump = vzalloc(len + ramsize); +-+ if (!dump) +-+ return -ENOMEM; +-+ memcpy(dump, data, len); +-+ brcmf_bus_get_memdump(bus, dump + len, ramsize); +-+ dev_coredumpv(bus->dev, dump, len + ramsize, GFP_KERNEL); +-+ } +-+ return 0; +-+} +-+ +-+static int brcmf_debug_psm_watchdog_notify(struct brcmf_if *ifp, +-+ const struct brcmf_event_msg *evtmsg, +-+ void *data) +-+{ +-+ brcmf_dbg(TRACE, "enter: idx=%d\n", ifp->bssidx); +-+ +-+ return brcmf_debug_create_memdump(ifp->drvr->bus_if, data, +-+ evtmsg->datalen); +-+} +-+ +- void brcmf_debugfs_init(void) +- { +- root_folder = debugfs_create_dir(KBUILD_MODNAME, NULL); +-@@ -41,7 +71,7 @@ void brcmf_debugfs_exit(void) +- root_folder = NULL; +- } +- +--int brcmf_debugfs_attach(struct brcmf_pub *drvr) +-+int brcmf_debug_attach(struct brcmf_pub *drvr) +- { +- struct device *dev = drvr->bus_if->dev; +- +-@@ -49,12 +79,18 @@ int brcmf_debugfs_attach(struct brcmf_pu +- return -ENODEV; +- +- drvr->dbgfs_dir = debugfs_create_dir(dev_name(dev), root_folder); +-+ if (IS_ERR(drvr->dbgfs_dir)) +-+ return PTR_ERR(drvr->dbgfs_dir); +- +-- return PTR_ERR_OR_ZERO(drvr->dbgfs_dir); +-+ +-+ return brcmf_fweh_register(drvr, BRCMF_E_PSM_WATCHDOG, +-+ brcmf_debug_psm_watchdog_notify); +- } +- +--void brcmf_debugfs_detach(struct brcmf_pub *drvr) +-+void brcmf_debug_detach(struct brcmf_pub *drvr) +- { +-+ brcmf_fweh_unregister(drvr, BRCMF_E_PSM_WATCHDOG); +-+ +- if (!IS_ERR_OR_NULL(drvr->dbgfs_dir)) +- debugfs_remove_recursive(drvr->dbgfs_dir); +- } +---- a/drivers/net/wireless/brcm80211/brcmfmac/debug.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/debug.h +-@@ -109,8 +109,8 @@ struct brcmf_pub; +- #ifdef DEBUG +- void brcmf_debugfs_init(void); +- void brcmf_debugfs_exit(void); +--int brcmf_debugfs_attach(struct brcmf_pub *drvr); +--void brcmf_debugfs_detach(struct brcmf_pub *drvr); +-+int brcmf_debug_attach(struct brcmf_pub *drvr); +-+void brcmf_debug_detach(struct brcmf_pub *drvr); +- struct dentry *brcmf_debugfs_get_devdir(struct brcmf_pub *drvr); +- int brcmf_debugfs_add_entry(struct brcmf_pub *drvr, const char *fn, +- int (*read_fn)(struct seq_file *seq, void *data)); +-@@ -121,11 +121,11 @@ static inline void brcmf_debugfs_init(vo +- static inline void brcmf_debugfs_exit(void) +- { +- } +--static inline int brcmf_debugfs_attach(struct brcmf_pub *drvr) +-+static inline int brcmf_debug_attach(struct brcmf_pub *drvr) +- { +- return 0; +- } +--static inline void brcmf_debugfs_detach(struct brcmf_pub *drvr) +-+static inline void brcmf_debug_detach(struct brcmf_pub *drvr) +- { +- } +- static inline +---- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-@@ -448,6 +448,47 @@ brcmf_pcie_copy_mem_todev(struct brcmf_p +- } +- +- +-+static void +-+brcmf_pcie_copy_dev_tomem(struct brcmf_pciedev_info *devinfo, u32 mem_offset, +-+ void *dstaddr, u32 len) +-+{ +-+ void __iomem *address = devinfo->tcm + mem_offset; +-+ __le32 *dst32; +-+ __le16 *dst16; +-+ u8 *dst8; +-+ +-+ if (((ulong)address & 4) || ((ulong)dstaddr & 4) || (len & 4)) { +-+ if (((ulong)address & 2) || ((ulong)dstaddr & 2) || (len & 2)) { +-+ dst8 = (u8 *)dstaddr; +-+ while (len) { +-+ *dst8 = ioread8(address); +-+ address++; +-+ dst8++; +-+ len--; +-+ } +-+ } else { +-+ len = len / 2; +-+ dst16 = (__le16 *)dstaddr; +-+ while (len) { +-+ *dst16 = cpu_to_le16(ioread16(address)); +-+ address += 2; +-+ dst16++; +-+ len--; +-+ } +-+ } +-+ } else { +-+ len = len / 4; +-+ dst32 = (__le32 *)dstaddr; +-+ while (len) { +-+ *dst32 = cpu_to_le32(ioread32(address)); +-+ address += 4; +-+ dst32++; +-+ len--; +-+ } +-+ } +-+} +-+ +-+ +- #define WRITECC32(devinfo, reg, value) brcmf_pcie_write_reg32(devinfo, \ +- CHIPCREGOFFS(reg), value) +- +-@@ -1352,12 +1393,36 @@ static void brcmf_pcie_wowl_config(struc +- } +- +- +-+static size_t brcmf_pcie_get_ramsize(struct device *dev) +-+{ +-+ struct brcmf_bus *bus_if = dev_get_drvdata(dev); +-+ struct brcmf_pciedev *buspub = bus_if->bus_priv.pcie; +-+ struct brcmf_pciedev_info *devinfo = buspub->devinfo; +-+ +-+ return devinfo->ci->ramsize - devinfo->ci->srsize; +-+} +-+ +-+ +-+static int brcmf_pcie_get_memdump(struct device *dev, void *data, size_t len) +-+{ +-+ struct brcmf_bus *bus_if = dev_get_drvdata(dev); +-+ struct brcmf_pciedev *buspub = bus_if->bus_priv.pcie; +-+ struct brcmf_pciedev_info *devinfo = buspub->devinfo; +-+ +-+ brcmf_dbg(PCIE, "dump at 0x%08X: len=%zu\n", devinfo->ci->rambase, len); +-+ brcmf_pcie_copy_dev_tomem(devinfo, devinfo->ci->rambase, data, len); +-+ return 0; +-+} +-+ +-+ +- static struct brcmf_bus_ops brcmf_pcie_bus_ops = { +- .txdata = brcmf_pcie_tx, +- .stop = brcmf_pcie_down, +- .txctl = brcmf_pcie_tx_ctlpkt, +- .rxctl = brcmf_pcie_rx_ctlpkt, +- .wowl_config = brcmf_pcie_wowl_config, +-+ .get_ramsize = brcmf_pcie_get_ramsize, +-+ .get_memdump = brcmf_pcie_get_memdump, +- }; +- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-@@ -3539,6 +3539,51 @@ done: +- return err; +- } +- +-+static size_t brcmf_sdio_bus_get_ramsize(struct device *dev) +-+{ +-+ struct brcmf_bus *bus_if = dev_get_drvdata(dev); +-+ struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio; +-+ struct brcmf_sdio *bus = sdiodev->bus; +-+ +-+ return bus->ci->ramsize - bus->ci->srsize; +-+} +-+ +-+static int brcmf_sdio_bus_get_memdump(struct device *dev, void *data, +-+ size_t mem_size) +-+{ +-+ struct brcmf_bus *bus_if = dev_get_drvdata(dev); +-+ struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio; +-+ struct brcmf_sdio *bus = sdiodev->bus; +-+ int err; +-+ int address; +-+ int offset; +-+ int len; +-+ +-+ brcmf_dbg(INFO, "dump at 0x%08x: size=%zu\n", bus->ci->rambase, +-+ mem_size); +-+ +-+ address = bus->ci->rambase; +-+ offset = err = 0; +-+ sdio_claim_host(sdiodev->func[1]); +-+ while (offset < mem_size) { +-+ len = ((offset + MEMBLOCK) < mem_size) ? MEMBLOCK : +-+ mem_size - offset; +-+ err = brcmf_sdiod_ramrw(sdiodev, false, address, data, len); +-+ if (err) { +-+ brcmf_err("error %d on reading %d membytes at 0x%08x\n", +-+ err, len, address); +-+ goto done; +-+ } +-+ data += len; +-+ offset += len; +-+ address += len; +-+ } +-+ +-+done: +-+ sdio_release_host(sdiodev->func[1]); +-+ return err; +-+} +-+ +- void brcmf_sdio_trigger_dpc(struct brcmf_sdio *bus) +- { +- if (!bus->dpc_triggered) { +-@@ -3987,7 +4032,9 @@ static struct brcmf_bus_ops brcmf_sdio_b +- .txctl = brcmf_sdio_bus_txctl, +- .rxctl = brcmf_sdio_bus_rxctl, +- .gettxq = brcmf_sdio_bus_gettxq, +-- .wowl_config = brcmf_sdio_wowl_config +-+ .wowl_config = brcmf_sdio_wowl_config, +-+ .get_ramsize = brcmf_sdio_bus_get_ramsize, +-+ .get_memdump = brcmf_sdio_bus_get_memdump, +- }; +- +- static void brcmf_sdio_firmware_callback(struct device *dev, +diff --git a/package/kernel/mac80211/patches/372-0002-brcmfmac-Fix-race-condition-between-USB-probe-load-a.patch b/package/kernel/mac80211/patches/372-0002-brcmfmac-Fix-race-condition-between-USB-probe-load-a.patch +deleted file mode 100644 +index 5b82bca..0000000 +--- a/package/kernel/mac80211/patches/372-0002-brcmfmac-Fix-race-condition-between-USB-probe-load-a.patch ++++ /dev/null +@@ -1,108 +0,0 @@ +-From: Hante Meuleman +-Date: Thu, 8 Oct 2015 20:33:12 +0200 +-Subject: [PATCH] brcmfmac: Fix race condition between USB probe/load and +- disconnect. +- +-When a USB device gets disconnected due to for example removal +-then it is possible that it is still in the loading phase due to +-the asynchronous load routines. These routines can then possible +-access memory which has been freed. Fix this by mutex locking the +-device init phase. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/usb.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/usb.c +-@@ -144,6 +144,7 @@ struct brcmf_usbdev_info { +- +- struct usb_device *usbdev; +- struct device *dev; +-+ struct mutex dev_init_lock; +- +- int ctl_in_pipe, ctl_out_pipe; +- struct urb *ctl_urb; /* URB for control endpoint */ +-@@ -1204,6 +1205,8 @@ static void brcmf_usb_probe_phase2(struc +- int ret; +- +- brcmf_dbg(USB, "Start fw downloading\n"); +-+ +-+ devinfo = bus->bus_priv.usb->devinfo; +- ret = check_file(fw->data); +- if (ret < 0) { +- brcmf_err("invalid firmware\n"); +-@@ -1211,7 +1214,6 @@ static void brcmf_usb_probe_phase2(struc +- goto error; +- } +- +-- devinfo = bus->bus_priv.usb->devinfo; +- devinfo->image = fw->data; +- devinfo->image_len = fw->size; +- +-@@ -1224,9 +1226,11 @@ static void brcmf_usb_probe_phase2(struc +- if (ret) +- goto error; +- +-+ mutex_unlock(&devinfo->dev_init_lock); +- return; +- error: +- brcmf_dbg(TRACE, "failed: dev=%s, err=%d\n", dev_name(dev), ret); +-+ mutex_unlock(&devinfo->dev_init_lock); +- device_release_driver(dev); +- } +- +-@@ -1264,6 +1268,7 @@ static int brcmf_usb_probe_cb(struct brc +- if (ret) +- goto fail; +- /* we are done */ +-+ mutex_unlock(&devinfo->dev_init_lock); +- return 0; +- } +- bus->chip = bus_pub->devid; +-@@ -1317,6 +1322,12 @@ brcmf_usb_probe(struct usb_interface *in +- +- devinfo->usbdev = usb; +- devinfo->dev = &usb->dev; +-+ /* Take an init lock, to protect for disconnect while still loading. +-+ * Necessary because of the asynchronous firmware load construction +-+ */ +-+ mutex_init(&devinfo->dev_init_lock); +-+ mutex_lock(&devinfo->dev_init_lock); +-+ +- usb_set_intfdata(intf, devinfo); +- +- /* Check that the device supports only one configuration */ +-@@ -1391,6 +1402,7 @@ brcmf_usb_probe(struct usb_interface *in +- return 0; +- +- fail: +-+ mutex_unlock(&devinfo->dev_init_lock); +- kfree(devinfo); +- usb_set_intfdata(intf, NULL); +- return ret; +-@@ -1403,8 +1415,19 @@ brcmf_usb_disconnect(struct usb_interfac +- +- brcmf_dbg(USB, "Enter\n"); +- devinfo = (struct brcmf_usbdev_info *)usb_get_intfdata(intf); +-- brcmf_usb_disconnect_cb(devinfo); +-- kfree(devinfo); +-+ +-+ if (devinfo) { +-+ mutex_lock(&devinfo->dev_init_lock); +-+ /* Make sure that devinfo still exists. Firmware probe routines +-+ * may have released the device and cleared the intfdata. +-+ */ +-+ if (!usb_get_intfdata(intf)) +-+ goto done; +-+ +-+ brcmf_usb_disconnect_cb(devinfo); +-+ kfree(devinfo); +-+ } +-+done: +- brcmf_dbg(USB, "Exit\n"); +- } +- +diff --git a/package/kernel/mac80211/patches/372-0003-brcmfmac-rename-firmware_path-to-alternative_fw_path.patch b/package/kernel/mac80211/patches/372-0003-brcmfmac-rename-firmware_path-to-alternative_fw_path.patch +deleted file mode 100644 +index f877c23..0000000 +--- a/package/kernel/mac80211/patches/372-0003-brcmfmac-rename-firmware_path-to-alternative_fw_path.patch ++++ /dev/null +@@ -1,28 +0,0 @@ +-From: Franky Lin +-Date: Thu, 8 Oct 2015 20:33:13 +0200 +-Subject: [PATCH] brcmfmac: rename firmware_path to alternative_fw_path +- +-In brcmfmac the module parameter "firmware_path" is used as an +-alternative relative path under the search path used by firmware_class +-or ueventhelper. Rename the parameter to alternative_fw_path to avoid +-confusion. +- +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Hante Meuleman +-Signed-off-by: Franky Lin +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/firmware.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/firmware.c +-@@ -28,7 +28,7 @@ +- #define BRCMF_FW_NVRAM_PCIEDEV_LEN 10 /* pcie/1/4/ + \0 */ +- +- char brcmf_firmware_path[BRCMF_FW_PATH_LEN]; +--module_param_string(firmware_path, brcmf_firmware_path, +-+module_param_string(alternative_fw_path, brcmf_firmware_path, +- BRCMF_FW_PATH_LEN, 0440); +- +- enum nvram_parser_state { +diff --git a/package/kernel/mac80211/patches/372-0004-brcmfmac-remove-conversational-comment.patch b/package/kernel/mac80211/patches/372-0004-brcmfmac-remove-conversational-comment.patch +deleted file mode 100644 +index 0bfd9ef..0000000 +--- a/package/kernel/mac80211/patches/372-0004-brcmfmac-remove-conversational-comment.patch ++++ /dev/null +@@ -1,25 +0,0 @@ +-From: Arend van Spriel +-Date: Thu, 8 Oct 2015 20:33:14 +0200 +-Subject: [PATCH] brcmfmac: remove conversational comment +- +-Removing a comment that was only useful during the review of +-the change that introduced it and which should never have been +-submitted. +- +-Reviewed-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c +-@@ -873,9 +873,6 @@ brcmf_msgbuf_process_txstatus(struct brc +- commonring = msgbuf->flowrings[flowid]; +- atomic_dec(&commonring->outstanding_tx); +- +-- /* Hante: i believe this was a bug as tx_status->msg.ifidx was used +-- * in brcmf_txfinalize as index in drvr->iflist. Can you confirm/deny? +-- */ +- brcmf_txfinalize(brcmf_get_ifp(msgbuf->drvr, tx_status->msg.ifidx), +- skb, true); +- } +diff --git a/package/kernel/mac80211/patches/372-0005-brcmfmac-Rework-p2p-attach-use-single-method-for-p2p.patch b/package/kernel/mac80211/patches/372-0005-brcmfmac-Rework-p2p-attach-use-single-method-for-p2p.patch +deleted file mode 100644 +index 3ffada8..0000000 +--- a/package/kernel/mac80211/patches/372-0005-brcmfmac-Rework-p2p-attach-use-single-method-for-p2p.patch ++++ /dev/null +@@ -1,226 +0,0 @@ +-From: Hante Meuleman +-Date: Thu, 8 Oct 2015 20:33:15 +0200 +-Subject: [PATCH] brcmfmac: Rework p2p attach, use single method for p2p dev +- creation. +- +-When module param p2pon is used a p2p device is created at init. +-This patch reworks how this is done by using the same method as +-for a dynamically (by user space) created p2p device. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Franky (Zhenhui) Lin +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-@@ -6237,6 +6237,17 @@ struct brcmf_cfg80211_info *brcmf_cfg802 +- else +- *cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; +- } +-+ /* p2p might require that "if-events" get processed by fweh. So +-+ * activate the already registered event handlers now and activate +-+ * the rest when initialization has completed. drvr->config needs to +-+ * be assigned before activating events. +-+ */ +-+ drvr->config = cfg; +-+ err = brcmf_fweh_activate_events(ifp); +-+ if (err) { +-+ brcmf_err("FWEH activation failed (%d)\n", err); +-+ goto wiphy_unreg_out; +-+ } +- +- err = brcmf_p2p_attach(cfg, p2pdev_forced); +- if (err) { +-@@ -6259,6 +6270,13 @@ struct brcmf_cfg80211_info *brcmf_cfg802 +- brcmf_notify_tdls_peer_event); +- } +- +-+ /* (re-) activate FWEH event handling */ +-+ err = brcmf_fweh_activate_events(ifp); +-+ if (err) { +-+ brcmf_err("FWEH activation failed (%d)\n", err); +-+ goto wiphy_unreg_out; +-+ } +-+ +- return cfg; +- +- wiphy_unreg_out: +---- a/drivers/net/wireless/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c +-@@ -828,8 +828,8 @@ struct brcmf_if *brcmf_add_if(struct brc +- } else { +- brcmf_dbg(INFO, "allocate netdev interface\n"); +- /* Allocate netdev, including space for private structure */ +-- ndev = alloc_netdev(sizeof(*ifp), name, NET_NAME_UNKNOWN, +-- ether_setup); +-+ ndev = alloc_netdev(sizeof(*ifp), is_p2pdev ? "p2p%d" : name, +-+ NET_NAME_UNKNOWN, ether_setup); +- if (!ndev) +- return ERR_PTR(-ENOMEM); +- +-@@ -1021,12 +1021,7 @@ int brcmf_bus_start(struct device *dev) +- if (IS_ERR(ifp)) +- return PTR_ERR(ifp); +- +-- if (brcmf_p2p_enable) +-- p2p_ifp = brcmf_add_if(drvr, 1, 0, false, "p2p%d", NULL); +-- else +-- p2p_ifp = NULL; +-- if (IS_ERR(p2p_ifp)) +-- p2p_ifp = NULL; +-+ p2p_ifp = NULL; +- +- /* signal bus ready */ +- brcmf_bus_change_state(bus_if, BRCMF_BUS_UP); +-@@ -1060,11 +1055,13 @@ int brcmf_bus_start(struct device *dev) +- goto fail; +- } +- +-- ret = brcmf_fweh_activate_events(ifp); +-- if (ret < 0) +-- goto fail; +-- +- ret = brcmf_net_attach(ifp, false); +-+ +-+ if ((!ret) && (brcmf_p2p_enable)) { +-+ p2p_ifp = drvr->iflist[1]; +-+ if (p2p_ifp) +-+ ret = brcmf_net_p2p_attach(p2p_ifp); +-+ } +- fail: +- if (ret < 0) { +- brcmf_err("failed: %d\n", ret); +-@@ -1076,20 +1073,12 @@ fail: +- brcmf_fws_del_interface(ifp); +- brcmf_fws_deinit(drvr); +- } +-- if (drvr->iflist[0]) { +-+ if (ifp) +- brcmf_net_detach(ifp->ndev); +-- drvr->iflist[0] = NULL; +-- } +-- if (p2p_ifp) { +-+ if (p2p_ifp) +- brcmf_net_detach(p2p_ifp->ndev); +-- drvr->iflist[1] = NULL; +-- } +- return ret; +- } +-- if ((brcmf_p2p_enable) && (p2p_ifp)) +-- if (brcmf_net_p2p_attach(p2p_ifp) < 0) +-- brcmf_p2p_enable = 0; +-- +- return 0; +- } +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/fweh.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/fweh.c +-@@ -213,7 +213,8 @@ static void brcmf_fweh_handle_if_event(s +- is_p2pdev, emsg->ifname, emsg->addr); +- if (IS_ERR(ifp)) +- return; +-- brcmf_fws_add_interface(ifp); +-+ if (!is_p2pdev) +-+ brcmf_fws_add_interface(ifp); +- if (!drvr->fweh.evt_handler[BRCMF_E_IF]) +- if (brcmf_net_attach(ifp, false) < 0) +- return; +---- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +-@@ -2350,83 +2350,30 @@ void brcmf_p2p_stop_device(struct wiphy +- * brcmf_p2p_attach() - attach for P2P. +- * +- * @cfg: driver private data for cfg80211 interface. +-+ * @p2pdev_forced: create p2p device interface at attach. +- */ +- s32 brcmf_p2p_attach(struct brcmf_cfg80211_info *cfg, bool p2pdev_forced) +- { +-- struct brcmf_if *pri_ifp; +-- struct brcmf_if *p2p_ifp; +-- struct brcmf_cfg80211_vif *p2p_vif; +- struct brcmf_p2p_info *p2p; +-- struct brcmf_pub *drvr; +-- s32 bssidx; +-+ struct brcmf_if *pri_ifp; +- s32 err = 0; +-+ void *err_ptr; +- +- p2p = &cfg->p2p; +- p2p->cfg = cfg; +- +-- drvr = cfg->pub; +-- +-- pri_ifp = brcmf_get_ifp(drvr, 0); +-+ pri_ifp = brcmf_get_ifp(cfg->pub, 0); +- p2p->bss_idx[P2PAPI_BSSCFG_PRIMARY].vif = pri_ifp->vif; +- +- if (p2pdev_forced) { +-- p2p_ifp = drvr->iflist[1]; +-+ err_ptr = brcmf_p2p_create_p2pdev(p2p, NULL, NULL); +-+ if (IS_ERR(err_ptr)) { +-+ brcmf_err("P2P device creation failed.\n"); +-+ err = PTR_ERR(err_ptr); +-+ } +- } else { +-- p2p_ifp = NULL; +- p2p->p2pdev_dynamically = true; +- } +-- if (p2p_ifp) { +-- p2p_vif = brcmf_alloc_vif(cfg, NL80211_IFTYPE_P2P_DEVICE, +-- false); +-- if (IS_ERR(p2p_vif)) { +-- brcmf_err("could not create discovery vif\n"); +-- err = -ENOMEM; +-- goto exit; +-- } +-- +-- p2p_vif->ifp = p2p_ifp; +-- p2p_ifp->vif = p2p_vif; +-- p2p_vif->wdev.netdev = p2p_ifp->ndev; +-- p2p_ifp->ndev->ieee80211_ptr = &p2p_vif->wdev; +-- SET_NETDEV_DEV(p2p_ifp->ndev, wiphy_dev(cfg->wiphy)); +-- +-- p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = p2p_vif; +-- +-- brcmf_p2p_generate_bss_mac(p2p, NULL); +-- memcpy(p2p_ifp->mac_addr, p2p->dev_addr, ETH_ALEN); +-- brcmf_p2p_set_firmware(pri_ifp, p2p->dev_addr); +-- +-- brcmf_fweh_p2pdev_setup(pri_ifp, true); +-- +-- /* Initialize P2P Discovery in the firmware */ +-- err = brcmf_fil_iovar_int_set(pri_ifp, "p2p_disc", 1); +-- if (err < 0) { +-- brcmf_err("set p2p_disc error\n"); +-- brcmf_free_vif(p2p_vif); +-- goto exit; +-- } +-- /* obtain bsscfg index for P2P discovery */ +-- err = brcmf_fil_iovar_int_get(pri_ifp, "p2p_dev", &bssidx); +-- if (err < 0) { +-- brcmf_err("retrieving discover bsscfg index failed\n"); +-- brcmf_free_vif(p2p_vif); +-- goto exit; +-- } +-- /* Verify that firmware uses same bssidx as driver !! */ +-- if (p2p_ifp->bssidx != bssidx) { +-- brcmf_err("Incorrect bssidx=%d, compared to p2p_ifp->bssidx=%d\n", +-- bssidx, p2p_ifp->bssidx); +-- brcmf_free_vif(p2p_vif); +-- goto exit; +-- } +-- +-- init_completion(&p2p->send_af_done); +-- INIT_WORK(&p2p->afx_hdl.afx_work, brcmf_p2p_afx_handler); +-- init_completion(&p2p->afx_hdl.act_frm_scan); +-- init_completion(&p2p->wait_next_af); +--exit: +-- brcmf_fweh_p2pdev_setup(pri_ifp, false); +-- } +- return err; +- } +- +diff --git a/package/kernel/mac80211/patches/372-0006-brcmfmac-Fix-station-info-rate-information.patch b/package/kernel/mac80211/patches/372-0006-brcmfmac-Fix-station-info-rate-information.patch +deleted file mode 100644 +index 0abcf1e..0000000 +--- a/package/kernel/mac80211/patches/372-0006-brcmfmac-Fix-station-info-rate-information.patch ++++ /dev/null +@@ -1,36 +0,0 @@ +-From: Hante Meuleman +-Date: Thu, 8 Oct 2015 20:33:16 +0200 +-Subject: [PATCH] brcmfmac: Fix station info rate information. +- +-Txrate and rxrate in get_station got assigned first with value +-in kbps and then divided by 100 to get it in 100kbps unit. The +-problem with that is that type of rate is u16 which resulted +-in incorrect values for high data rate values. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-@@ -2477,13 +2477,13 @@ brcmf_cfg80211_get_station(struct wiphy +- sinfo->rx_packets += le32_to_cpu(sta_info_le.rx_mcast_pkts); +- if (sinfo->tx_packets) { +- sinfo->filled |= BIT(NL80211_STA_INFO_TX_BITRATE); +-- sinfo->txrate.legacy = le32_to_cpu(sta_info_le.tx_rate); +-- sinfo->txrate.legacy /= 100; +-+ sinfo->txrate.legacy = +-+ le32_to_cpu(sta_info_le.tx_rate) / 100; +- } +- if (sinfo->rx_packets) { +- sinfo->filled |= BIT(NL80211_STA_INFO_RX_BITRATE); +-- sinfo->rxrate.legacy = le32_to_cpu(sta_info_le.rx_rate); +-- sinfo->rxrate.legacy /= 100; +-+ sinfo->rxrate.legacy = +-+ le32_to_cpu(sta_info_le.rx_rate) / 100; +- } +- if (le16_to_cpu(sta_info_le.ver) >= 4) { +- sinfo->filled |= BIT(NL80211_STA_INFO_TX_BYTES); +diff --git a/package/kernel/mac80211/patches/372-0007-brcmfmac-Add-RSSI-information-to-get_station.patch b/package/kernel/mac80211/patches/372-0007-brcmfmac-Add-RSSI-information-to-get_station.patch +deleted file mode 100644 +index bb03d67..0000000 +--- a/package/kernel/mac80211/patches/372-0007-brcmfmac-Add-RSSI-information-to-get_station.patch ++++ /dev/null +@@ -1,50 +0,0 @@ +-From: Hante Meuleman +-Date: Thu, 8 Oct 2015 20:33:17 +0200 +-Subject: [PATCH] brcmfmac: Add RSSI information to get_station. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-@@ -2431,6 +2431,9 @@ brcmf_cfg80211_get_station(struct wiphy +- struct brcmf_sta_info_le sta_info_le; +- u32 sta_flags; +- u32 is_tdls_peer; +-+ s32 total_rssi; +-+ s32 count_rssi; +-+ u32 i; +- +- brcmf_dbg(TRACE, "Enter, MAC %pM\n", mac); +- if (!check_vif_up(ifp->vif)) +-@@ -2491,6 +2494,26 @@ brcmf_cfg80211_get_station(struct wiphy +- sinfo->filled |= BIT(NL80211_STA_INFO_RX_BYTES); +- sinfo->rx_bytes = le64_to_cpu(sta_info_le.rx_tot_bytes); +- } +-+ total_rssi = 0; +-+ count_rssi = 0; +-+ for (i = 0; i < BRCMF_ANT_MAX; i++) { +-+ if (sta_info_le.rssi[i]) { +-+ sinfo->chain_signal_avg[count_rssi] = +-+ sta_info_le.rssi[i]; +-+ sinfo->chain_signal[count_rssi] = +-+ sta_info_le.rssi[i]; +-+ total_rssi += sta_info_le.rssi[i]; +-+ count_rssi++; +-+ } +-+ } +-+ if (count_rssi) { +-+ sinfo->filled |= BIT(NL80211_STA_INFO_CHAIN_SIGNAL); +-+ sinfo->chains = count_rssi; +-+ +-+ sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL); +-+ total_rssi /= count_rssi; +-+ sinfo->signal = total_rssi; +-+ } +- } +- done: +- brcmf_dbg(TRACE, "Exit\n"); +diff --git a/package/kernel/mac80211/patches/372-0008-brcmfmac-Add-dump_station-support-to-cfg80221-ops.patch b/package/kernel/mac80211/patches/372-0008-brcmfmac-Add-dump_station-support-to-cfg80221-ops.patch +deleted file mode 100644 +index a6bafd2..0000000 +--- a/package/kernel/mac80211/patches/372-0008-brcmfmac-Add-dump_station-support-to-cfg80221-ops.patch ++++ /dev/null +@@ -1,107 +0,0 @@ +-From: Hante Meuleman +-Date: Thu, 8 Oct 2015 20:33:18 +0200 +-Subject: [PATCH] brcmfmac: Add dump_station support to cfg80221 ops. +- +-With this feature it becomes possible to request a station +-assoc list. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-@@ -2520,6 +2520,35 @@ done: +- return err; +- } +- +-+static int +-+brcmf_cfg80211_dump_station(struct wiphy *wiphy, struct net_device *ndev, +-+ int idx, u8 *mac, struct station_info *sinfo) +-+{ +-+ struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); +-+ struct brcmf_if *ifp = netdev_priv(ndev); +-+ s32 err; +-+ +-+ brcmf_dbg(TRACE, "Enter, idx %d\n", idx); +-+ +-+ if (idx == 0) { +-+ cfg->assoclist.count = cpu_to_le32(BRCMF_MAX_ASSOCLIST); +-+ err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_ASSOCLIST, +-+ &cfg->assoclist, +-+ sizeof(cfg->assoclist)); +-+ if (err) { +-+ brcmf_err("BRCMF_C_GET_ASSOCLIST unsupported, err=%d\n", +-+ err); +-+ cfg->assoclist.count = 0; +-+ return -EOPNOTSUPP; +-+ } +-+ } +-+ if (idx < le32_to_cpu(cfg->assoclist.count)) { +-+ memcpy(mac, cfg->assoclist.mac[idx], ETH_ALEN); +-+ return brcmf_cfg80211_get_station(wiphy, ndev, mac, sinfo); +-+ } +-+ return -ENOENT; +-+} +-+ +- static s32 +- brcmf_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *ndev, +- bool enabled, s32 timeout) +-@@ -4619,6 +4648,7 @@ static struct cfg80211_ops wl_cfg80211_o +- .join_ibss = brcmf_cfg80211_join_ibss, +- .leave_ibss = brcmf_cfg80211_leave_ibss, +- .get_station = brcmf_cfg80211_get_station, +-+ .dump_station = brcmf_cfg80211_dump_station, +- .set_tx_power = brcmf_cfg80211_set_tx_power, +- .get_tx_power = brcmf_cfg80211_get_tx_power, +- .add_key = brcmf_cfg80211_add_key, +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.h +-@@ -407,6 +407,7 @@ struct brcmf_cfg80211_info { +- struct brcmu_d11inf d11inf; +- bool wowl_enabled; +- u32 pre_wowl_pmmode; +-+ struct brcmf_assoclist_le assoclist; +- }; +- +- /** +---- a/drivers/net/wireless/brcm80211/brcmfmac/fwil.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwil.h +-@@ -72,6 +72,7 @@ +- #define BRCMF_C_GET_BSS_INFO 136 +- #define BRCMF_C_GET_BANDLIST 140 +- #define BRCMF_C_SET_SCB_TIMEOUT 158 +-+#define BRCMF_C_GET_ASSOCLIST 159 +- #define BRCMF_C_GET_PHYLIST 180 +- #define BRCMF_C_SET_SCAN_CHANNEL_TIME 185 +- #define BRCMF_C_SET_SCAN_UNASSOC_TIME 187 +---- a/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h +-@@ -119,6 +119,8 @@ +- #define BRCMF_COUNTRY_BUF_SZ 4 +- #define BRCMF_ANT_MAX 4 +- +-+#define BRCMF_MAX_ASSOCLIST 128 +-+ +- /* join preference types for join_pref iovar */ +- enum brcmf_join_pref_types { +- BRCMF_JOIN_PREF_RSSI = 1, +-@@ -621,4 +623,15 @@ struct brcmf_rev_info_le { +- __le32 nvramrev; +- }; +- +-+/** +-+ * struct brcmf_assoclist_le - request assoc list. +-+ * +-+ * @count: indicates number of stations. +-+ * @mac: MAC addresses of stations. +-+ */ +-+struct brcmf_assoclist_le { +-+ __le32 count; +-+ u8 mac[BRCMF_MAX_ASSOCLIST][ETH_ALEN]; +-+}; +-+ +- #endif /* FWIL_TYPES_H_ */ +diff --git a/package/kernel/mac80211/patches/372-0009-brcmfmac-Move-brcmf_c_preinit_dcmds-prototype-to-cor.patch b/package/kernel/mac80211/patches/372-0009-brcmfmac-Move-brcmf_c_preinit_dcmds-prototype-to-cor.patch +deleted file mode 100644 +index dc54904..0000000 +--- a/package/kernel/mac80211/patches/372-0009-brcmfmac-Move-brcmf_c_preinit_dcmds-prototype-to-cor.patch ++++ /dev/null +@@ -1,42 +0,0 @@ +-From: Hante Meuleman +-Date: Thu, 8 Oct 2015 20:33:19 +0200 +-Subject: [PATCH] brcmfmac: Move brcmf_c_preinit_dcmds prototype to correct +- file. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/common.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/common.h +-@@ -17,4 +17,7 @@ +- +- extern const u8 ALLFFMAC[ETH_ALEN]; +- +-+/* Sets dongle media info (drv_version, mac address). */ +-+int brcmf_c_preinit_dcmds(struct brcmf_if *ifp); +-+ +- #endif /* BRCMFMAC_COMMON_H */ +---- a/drivers/net/wireless/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c +-@@ -33,6 +33,7 @@ +- #include "feature.h" +- #include "proto.h" +- #include "pcie.h" +-+#include "common.h" +- +- MODULE_AUTHOR("Broadcom Corporation"); +- MODULE_DESCRIPTION("Broadcom 802.11 wireless LAN fullmac driver."); +---- a/drivers/net/wireless/brcm80211/brcmfmac/core.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.h +-@@ -214,7 +214,4 @@ void brcmf_txflowblock_if(struct brcmf_i +- void brcmf_txfinalize(struct brcmf_if *ifp, struct sk_buff *txp, bool success); +- void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb); +- +--/* Sets dongle media info (drv_version, mac address). */ +--int brcmf_c_preinit_dcmds(struct brcmf_if *ifp); +-- +- #endif /* BRCMFMAC_CORE_H */ +diff --git a/package/kernel/mac80211/patches/372-0010-brcmfmac-Remove-unused-state-AP-creating.patch b/package/kernel/mac80211/patches/372-0010-brcmfmac-Remove-unused-state-AP-creating.patch +deleted file mode 100644 +index c6a7363..0000000 +--- a/package/kernel/mac80211/patches/372-0010-brcmfmac-Remove-unused-state-AP-creating.patch ++++ /dev/null +@@ -1,55 +0,0 @@ +-From: Hante Meuleman +-Date: Thu, 8 Oct 2015 20:33:20 +0200 +-Subject: [PATCH] brcmfmac: Remove unused state AP creating. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-@@ -839,7 +839,6 @@ brcmf_cfg80211_change_iface(struct wiphy +- err = brcmf_p2p_ifchange(cfg, BRCMF_FIL_P2P_IF_GO); +- } +- if (!err) { +-- set_bit(BRCMF_VIF_STATUS_AP_CREATING, &vif->sme_state); +- brcmf_dbg(INFO, "IF Type = AP\n"); +- } +- } else { +-@@ -4250,7 +4249,6 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +- +- brcmf_dbg(TRACE, "GO mode configuration complete\n"); +- } +-- clear_bit(BRCMF_VIF_STATUS_AP_CREATING, &ifp->vif->sme_state); +- set_bit(BRCMF_VIF_STATUS_AP_CREATED, &ifp->vif->sme_state); +- +- exit: +-@@ -4315,7 +4313,6 @@ static int brcmf_cfg80211_stop_ap(struct +- } +- brcmf_set_mpc(ifp, 1); +- brcmf_configure_arp_offload(ifp, true); +-- set_bit(BRCMF_VIF_STATUS_AP_CREATING, &ifp->vif->sme_state); +- clear_bit(BRCMF_VIF_STATUS_AP_CREATED, &ifp->vif->sme_state); +- +- return err; +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.h +-@@ -143,7 +143,6 @@ struct brcmf_cfg80211_profile { +- * @BRCMF_VIF_STATUS_CONNECTING: connect/join in progress. +- * @BRCMF_VIF_STATUS_CONNECTED: connected/joined succesfully. +- * @BRCMF_VIF_STATUS_DISCONNECTING: disconnect/disable in progress. +-- * @BRCMF_VIF_STATUS_AP_CREATING: interface configured for AP operation. +- * @BRCMF_VIF_STATUS_AP_CREATED: AP operation started. +- */ +- enum brcmf_vif_status { +-@@ -151,7 +150,6 @@ enum brcmf_vif_status { +- BRCMF_VIF_STATUS_CONNECTING, +- BRCMF_VIF_STATUS_CONNECTED, +- BRCMF_VIF_STATUS_DISCONNECTING, +-- BRCMF_VIF_STATUS_AP_CREATING, +- BRCMF_VIF_STATUS_AP_CREATED +- }; +- +diff --git a/package/kernel/mac80211/patches/372-0011-brcmfmac-Properly-set-carrier-state-of-netdev.patch b/package/kernel/mac80211/patches/372-0011-brcmfmac-Properly-set-carrier-state-of-netdev.patch +deleted file mode 100644 +index c0948de..0000000 +--- a/package/kernel/mac80211/patches/372-0011-brcmfmac-Properly-set-carrier-state-of-netdev.patch ++++ /dev/null +@@ -1,122 +0,0 @@ +-From: Hante Meuleman +-Date: Thu, 8 Oct 2015 20:33:21 +0200 +-Subject: [PATCH] brcmfmac: Properly set carrier state of netdev. +- +-Use the netif_carrier api to correctly set carrier state on the +-different modes. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Franky (Zhenhui) Lin +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-@@ -4250,6 +4250,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +- brcmf_dbg(TRACE, "GO mode configuration complete\n"); +- } +- set_bit(BRCMF_VIF_STATUS_AP_CREATED, &ifp->vif->sme_state); +-+ brcmf_net_setcarrier(ifp, true); +- +- exit: +- if ((err) && (!mbss)) { +-@@ -4314,6 +4315,7 @@ static int brcmf_cfg80211_stop_ap(struct +- brcmf_set_mpc(ifp, 1); +- brcmf_configure_arp_offload(ifp, true); +- clear_bit(BRCMF_VIF_STATUS_AP_CREATED, &ifp->vif->sme_state); +-+ brcmf_net_setcarrier(ifp, false); +- +- return err; +- } +-@@ -5023,6 +5025,7 @@ brcmf_notify_connect_status(struct brcmf +- &ifp->vif->sme_state); +- } else +- brcmf_bss_connect_done(cfg, ndev, e, true); +-+ brcmf_net_setcarrier(ifp, true); +- } else if (brcmf_is_linkdown(e)) { +- brcmf_dbg(CONN, "Linkdown\n"); +- if (!brcmf_is_ibssmode(ifp->vif)) { +-@@ -5032,6 +5035,7 @@ brcmf_notify_connect_status(struct brcmf +- brcmf_init_prof(ndev_to_prof(ndev)); +- if (ndev != cfg_to_ndev(cfg)) +- complete(&cfg->vif_disabled); +-+ brcmf_net_setcarrier(ifp, false); +- } else if (brcmf_is_nonetwork(cfg, e)) { +- if (brcmf_is_ibssmode(ifp->vif)) +- clear_bit(BRCMF_VIF_STATUS_CONNECTING, +---- a/drivers/net/wireless/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c +-@@ -635,8 +635,7 @@ static int brcmf_netdev_stop(struct net_ +- +- brcmf_cfg80211_down(ndev); +- +-- /* Set state and stop OS transmissions */ +-- netif_stop_queue(ndev); +-+ brcmf_net_setcarrier(ifp, false); +- +- return 0; +- } +-@@ -670,8 +669,8 @@ static int brcmf_netdev_open(struct net_ +- return -EIO; +- } +- +-- /* Allow transmit calls */ +-- netif_start_queue(ndev); +-+ /* Clear, carrier, set when connected or AP mode. */ +-+ netif_carrier_off(ndev); +- return 0; +- } +- +-@@ -736,6 +735,24 @@ static void brcmf_net_detach(struct net_ +- brcmf_cfg80211_free_netdev(ndev); +- } +- +-+void brcmf_net_setcarrier(struct brcmf_if *ifp, bool on) +-+{ +-+ struct net_device *ndev; +-+ +-+ brcmf_dbg(TRACE, "Enter, idx=%d carrier=%d\n", ifp->bssidx, on); +-+ +-+ ndev = ifp->ndev; +-+ brcmf_txflowblock_if(ifp, BRCMF_NETIF_STOP_REASON_DISCONNECTED, !on); +-+ if (on) { +-+ if (!netif_carrier_ok(ndev)) +-+ netif_carrier_on(ndev); +-+ +-+ } else { +-+ if (netif_carrier_ok(ndev)) +-+ netif_carrier_off(ndev); +-+ } +-+} +-+ +- static int brcmf_net_p2p_open(struct net_device *ndev) +- { +- brcmf_dbg(TRACE, "Enter\n"); +---- a/drivers/net/wireless/brcm80211/brcmfmac/core.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.h +-@@ -154,10 +154,13 @@ struct brcmf_fws_mac_descriptor; +- * netif stopped due to firmware signalling flow control. +- * @BRCMF_NETIF_STOP_REASON_FLOW: +- * netif stopped due to flowring full. +-+ * @BRCMF_NETIF_STOP_REASON_DISCONNECTED: +-+ * netif stopped due to not being connected (STA mode). +- */ +- enum brcmf_netif_stop_reason { +-- BRCMF_NETIF_STOP_REASON_FWS_FC = 1, +-- BRCMF_NETIF_STOP_REASON_FLOW = 2 +-+ BRCMF_NETIF_STOP_REASON_FWS_FC = BIT(0), +-+ BRCMF_NETIF_STOP_REASON_FLOW = BIT(1), +-+ BRCMF_NETIF_STOP_REASON_DISCONNECTED = BIT(2) +- }; +- +- /** +-@@ -213,5 +216,6 @@ void brcmf_txflowblock_if(struct brcmf_i +- enum brcmf_netif_stop_reason reason, bool state); +- void brcmf_txfinalize(struct brcmf_if *ifp, struct sk_buff *txp, bool success); +- void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb); +-+void brcmf_net_setcarrier(struct brcmf_if *ifp, bool on); +- +- #endif /* BRCMFMAC_CORE_H */ +diff --git a/package/kernel/mac80211/patches/373-brcm80211-Add-support-for-brcm4371.patch b/package/kernel/mac80211/patches/373-brcm80211-Add-support-for-brcm4371.patch +deleted file mode 100644 +index ea6fad1..0000000 +--- a/package/kernel/mac80211/patches/373-brcm80211-Add-support-for-brcm4371.patch ++++ /dev/null +@@ -1,78 +0,0 @@ +-From: Eric Caruso +-Date: Wed, 14 Oct 2015 12:34:11 -0700 +-Subject: [PATCH] brcm80211: Add support for brcm4371 +- +-This is a new Broadcom chip and we should be able to recognize it. +- +-Signed-off-by: Eric Caruso +-Acked-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/chip.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c +-@@ -682,6 +682,7 @@ static u32 brcmf_chip_tcm_rambase(struct +- case BRCM_CC_43570_CHIP_ID: +- case BRCM_CC_4358_CHIP_ID: +- case BRCM_CC_43602_CHIP_ID: +-+ case BRCM_CC_4371_CHIP_ID: +- return 0x180000; +- case BRCM_CC_4365_CHIP_ID: +- case BRCM_CC_4366_CHIP_ID: +---- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-@@ -59,6 +59,8 @@ enum brcmf_pcie_state { +- #define BRCMF_PCIE_4365_NVRAM_NAME "brcm/brcmfmac4365b-pcie.txt" +- #define BRCMF_PCIE_4366_FW_NAME "brcm/brcmfmac4366b-pcie.bin" +- #define BRCMF_PCIE_4366_NVRAM_NAME "brcm/brcmfmac4366b-pcie.txt" +-+#define BRCMF_PCIE_4371_FW_NAME "brcm/brcmfmac4371-pcie.bin" +-+#define BRCMF_PCIE_4371_NVRAM_NAME "brcm/brcmfmac4371-pcie.txt" +- +- #define BRCMF_PCIE_FW_UP_TIMEOUT 2000 /* msec */ +- +-@@ -212,6 +214,8 @@ MODULE_FIRMWARE(BRCMF_PCIE_4365_FW_NAME) +- MODULE_FIRMWARE(BRCMF_PCIE_4365_NVRAM_NAME); +- MODULE_FIRMWARE(BRCMF_PCIE_4366_FW_NAME); +- MODULE_FIRMWARE(BRCMF_PCIE_4366_NVRAM_NAME); +-+MODULE_FIRMWARE(BRCMF_PCIE_4371_FW_NAME); +-+MODULE_FIRMWARE(BRCMF_PCIE_4371_NVRAM_NAME); +- +- +- struct brcmf_pcie_console { +-@@ -1521,6 +1525,10 @@ static int brcmf_pcie_get_fwnames(struct +- fw_name = BRCMF_PCIE_4366_FW_NAME; +- nvram_name = BRCMF_PCIE_4366_NVRAM_NAME; +- break; +-+ case BRCM_CC_4371_CHIP_ID: +-+ fw_name = BRCMF_PCIE_4371_FW_NAME; +-+ nvram_name = BRCMF_PCIE_4371_NVRAM_NAME; +-+ break; +- default: +- brcmf_err("Unsupported chip 0x%04x\n", devinfo->ci->chip); +- return -ENODEV; +-@@ -2060,6 +2068,7 @@ static struct pci_device_id brcmf_pcie_d +- BRCMF_PCIE_DEVICE(BRCM_PCIE_4366_DEVICE_ID), +- BRCMF_PCIE_DEVICE(BRCM_PCIE_4366_2G_DEVICE_ID), +- BRCMF_PCIE_DEVICE(BRCM_PCIE_4366_5G_DEVICE_ID), +-+ BRCMF_PCIE_DEVICE(BRCM_PCIE_4371_DEVICE_ID), +- { /* end: all zeroes */ } +- }; +- +---- a/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h +-+++ b/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h +-@@ -50,6 +50,7 @@ +- #define BRCM_CC_43602_CHIP_ID 43602 +- #define BRCM_CC_4365_CHIP_ID 0x4365 +- #define BRCM_CC_4366_CHIP_ID 0x4366 +-+#define BRCM_CC_4371_CHIP_ID 0x4371 +- +- /* USB Device IDs */ +- #define BRCM_USB_43143_DEVICE_ID 0xbd1e +-@@ -75,6 +76,7 @@ +- #define BRCM_PCIE_4366_DEVICE_ID 0x43c3 +- #define BRCM_PCIE_4366_2G_DEVICE_ID 0x43c4 +- #define BRCM_PCIE_4366_5G_DEVICE_ID 0x43c5 +-+#define BRCM_PCIE_4371_DEVICE_ID 0x440d +- +- +- /* brcmsmac IDs */ +diff --git a/package/kernel/mac80211/patches/374-0001-brcmfmac-Add-support-for-the-BCM4359-11ac-RSDB-PCIE-.patch b/package/kernel/mac80211/patches/374-0001-brcmfmac-Add-support-for-the-BCM4359-11ac-RSDB-PCIE-.patch +deleted file mode 100644 +index 221bae6..0000000 +--- a/package/kernel/mac80211/patches/374-0001-brcmfmac-Add-support-for-the-BCM4359-11ac-RSDB-PCIE-.patch ++++ /dev/null +@@ -1,78 +0,0 @@ +-From: Hante Meuleman +-Date: Thu, 29 Oct 2015 20:33:11 +0100 +-Subject: [PATCH] brcmfmac: Add support for the BCM4359 11ac RSDB PCIE device. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/chip.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c +-@@ -681,6 +681,7 @@ static u32 brcmf_chip_tcm_rambase(struct +- case BRCM_CC_43569_CHIP_ID: +- case BRCM_CC_43570_CHIP_ID: +- case BRCM_CC_4358_CHIP_ID: +-+ case BRCM_CC_4359_CHIP_ID: +- case BRCM_CC_43602_CHIP_ID: +- case BRCM_CC_4371_CHIP_ID: +- return 0x180000; +---- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-@@ -55,6 +55,8 @@ enum brcmf_pcie_state { +- #define BRCMF_PCIE_43570_NVRAM_NAME "brcm/brcmfmac43570-pcie.txt" +- #define BRCMF_PCIE_4358_FW_NAME "brcm/brcmfmac4358-pcie.bin" +- #define BRCMF_PCIE_4358_NVRAM_NAME "brcm/brcmfmac4358-pcie.txt" +-+#define BRCMF_PCIE_4359_FW_NAME "brcm/brcmfmac4359-pcie.bin" +-+#define BRCMF_PCIE_4359_NVRAM_NAME "brcm/brcmfmac4359-pcie.txt" +- #define BRCMF_PCIE_4365_FW_NAME "brcm/brcmfmac4365b-pcie.bin" +- #define BRCMF_PCIE_4365_NVRAM_NAME "brcm/brcmfmac4365b-pcie.txt" +- #define BRCMF_PCIE_4366_FW_NAME "brcm/brcmfmac4366b-pcie.bin" +-@@ -210,6 +212,8 @@ MODULE_FIRMWARE(BRCMF_PCIE_43570_FW_NAME +- MODULE_FIRMWARE(BRCMF_PCIE_43570_NVRAM_NAME); +- MODULE_FIRMWARE(BRCMF_PCIE_4358_FW_NAME); +- MODULE_FIRMWARE(BRCMF_PCIE_4358_NVRAM_NAME); +-+MODULE_FIRMWARE(BRCMF_PCIE_4359_FW_NAME); +-+MODULE_FIRMWARE(BRCMF_PCIE_4359_NVRAM_NAME); +- MODULE_FIRMWARE(BRCMF_PCIE_4365_FW_NAME); +- MODULE_FIRMWARE(BRCMF_PCIE_4365_NVRAM_NAME); +- MODULE_FIRMWARE(BRCMF_PCIE_4366_FW_NAME); +-@@ -1517,6 +1521,10 @@ static int brcmf_pcie_get_fwnames(struct +- fw_name = BRCMF_PCIE_4358_FW_NAME; +- nvram_name = BRCMF_PCIE_4358_NVRAM_NAME; +- break; +-+ case BRCM_CC_4359_CHIP_ID: +-+ fw_name = BRCMF_PCIE_4359_FW_NAME; +-+ nvram_name = BRCMF_PCIE_4359_NVRAM_NAME; +-+ break; +- case BRCM_CC_4365_CHIP_ID: +- fw_name = BRCMF_PCIE_4365_FW_NAME; +- nvram_name = BRCMF_PCIE_4365_NVRAM_NAME; +-@@ -2058,6 +2066,7 @@ static struct pci_device_id brcmf_pcie_d +- BRCMF_PCIE_DEVICE(BRCM_PCIE_43567_DEVICE_ID), +- BRCMF_PCIE_DEVICE(BRCM_PCIE_43570_DEVICE_ID), +- BRCMF_PCIE_DEVICE(BRCM_PCIE_4358_DEVICE_ID), +-+ BRCMF_PCIE_DEVICE(BRCM_PCIE_4359_DEVICE_ID), +- BRCMF_PCIE_DEVICE(BRCM_PCIE_43602_DEVICE_ID), +- BRCMF_PCIE_DEVICE(BRCM_PCIE_43602_2G_DEVICE_ID), +- BRCMF_PCIE_DEVICE(BRCM_PCIE_43602_5G_DEVICE_ID), +---- a/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h +-+++ b/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h +-@@ -47,6 +47,7 @@ +- #define BRCM_CC_43569_CHIP_ID 43569 +- #define BRCM_CC_43570_CHIP_ID 43570 +- #define BRCM_CC_4358_CHIP_ID 0x4358 +-+#define BRCM_CC_4359_CHIP_ID 0x4359 +- #define BRCM_CC_43602_CHIP_ID 43602 +- #define BRCM_CC_4365_CHIP_ID 0x4365 +- #define BRCM_CC_4366_CHIP_ID 0x4366 +-@@ -66,6 +67,7 @@ +- #define BRCM_PCIE_43567_DEVICE_ID 0x43d3 +- #define BRCM_PCIE_43570_DEVICE_ID 0x43d9 +- #define BRCM_PCIE_4358_DEVICE_ID 0x43e9 +-+#define BRCM_PCIE_4359_DEVICE_ID 0x43ef +- #define BRCM_PCIE_43602_DEVICE_ID 0x43ba +- #define BRCM_PCIE_43602_2G_DEVICE_ID 0x43bb +- #define BRCM_PCIE_43602_5G_DEVICE_ID 0x43bc +diff --git a/package/kernel/mac80211/patches/374-0002-brcmfmac-Simplify-and-fix-usage-of-brcmf_ifname.patch b/package/kernel/mac80211/patches/374-0002-brcmfmac-Simplify-and-fix-usage-of-brcmf_ifname.patch +deleted file mode 100644 +index 331896b..0000000 +--- a/package/kernel/mac80211/patches/374-0002-brcmfmac-Simplify-and-fix-usage-of-brcmf_ifname.patch ++++ /dev/null +@@ -1,110 +0,0 @@ +-From: Hante Meuleman +-Date: Thu, 29 Oct 2015 20:33:12 +0100 +-Subject: [PATCH] brcmfmac: Simplify and fix usage of brcmf_ifname. +- +-brcmf_ifname is a debug function to return a name related to an ifp, +-but is using a rather complex implementation. It was also used +-wrongly from bcdc as it did not use the bsscfgidx as it was supposed +-to, but bssidx. This patch fixes that bug and simplifies +-brcmf_ifname. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/bcdc.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcdc.c +-@@ -187,7 +187,8 @@ retry: +- goto retry; +- if (id != bcdc->reqid) { +- brcmf_err("%s: unexpected request id %d (expected %d)\n", +-- brcmf_ifname(drvr, ifidx), id, bcdc->reqid); +-+ brcmf_ifname(brcmf_get_ifp(drvr, ifidx)), id, +-+ bcdc->reqid); +- ret = -EINVAL; +- goto done; +- } +-@@ -234,7 +235,8 @@ brcmf_proto_bcdc_set_dcmd(struct brcmf_p +- +- if (id != bcdc->reqid) { +- brcmf_err("%s: unexpected request id %d (expected %d)\n", +-- brcmf_ifname(drvr, ifidx), id, bcdc->reqid); +-+ brcmf_ifname(brcmf_get_ifp(drvr, ifidx)), id, +-+ bcdc->reqid); +- ret = -EINVAL; +- goto done; +- } +-@@ -298,13 +300,13 @@ brcmf_proto_bcdc_hdrpull(struct brcmf_pu +- if (((h->flags & BCDC_FLAG_VER_MASK) >> BCDC_FLAG_VER_SHIFT) != +- BCDC_PROTO_VER) { +- brcmf_err("%s: non-BCDC packet received, flags 0x%x\n", +-- brcmf_ifname(drvr, tmp_if->ifidx), h->flags); +-+ brcmf_ifname(tmp_if), h->flags); +- return -EBADE; +- } +- +- if (h->flags & BCDC_FLAG_SUM_GOOD) { +- brcmf_dbg(BCDC, "%s: BDC rcv, good checksum, flags 0x%x\n", +-- brcmf_ifname(drvr, tmp_if->ifidx), h->flags); +-+ brcmf_ifname(tmp_if), h->flags); +- pktbuf->ip_summed = CHECKSUM_UNNECESSARY; +- } +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c +-@@ -66,20 +66,13 @@ static int brcmf_p2p_enable; +- module_param_named(p2pon, brcmf_p2p_enable, int, 0); +- MODULE_PARM_DESC(p2pon, "enable legacy p2p management functionality"); +- +--char *brcmf_ifname(struct brcmf_pub *drvr, int ifidx) +-+char *brcmf_ifname(struct brcmf_if *ifp) +- { +-- if (ifidx < 0 || ifidx >= BRCMF_MAX_IFS) { +-- brcmf_err("ifidx %d out of range\n", ifidx); +-- return ""; +-- } +-- +-- if (drvr->iflist[ifidx] == NULL) { +-- brcmf_err("null i/f %d\n", ifidx); +-+ if (!ifp) +- return ""; +-- } +- +-- if (drvr->iflist[ifidx]->ndev) +-- return drvr->iflist[ifidx]->ndev->name; +-+ if (ifp->ndev) +-+ return ifp->ndev->name; +- +- return ""; +- } +-@@ -237,14 +230,14 @@ static netdev_tx_t brcmf_netdev_start_xm +- struct sk_buff *skb2; +- +- brcmf_dbg(INFO, "%s: insufficient headroom\n", +-- brcmf_ifname(drvr, ifp->bssidx)); +-+ brcmf_ifname(ifp)); +- drvr->bus_if->tx_realloc++; +- skb2 = skb_realloc_headroom(skb, drvr->hdrlen); +- dev_kfree_skb(skb); +- skb = skb2; +- if (skb == NULL) { +- brcmf_err("%s: skb_realloc_headroom failed\n", +-- brcmf_ifname(drvr, ifp->bssidx)); +-+ brcmf_ifname(ifp)); +- ret = -ENOMEM; +- goto done; +- } +---- a/drivers/net/wireless/brcm80211/brcmfmac/core.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.h +-@@ -205,7 +205,7 @@ struct brcmf_skb_reorder_data { +- int brcmf_netdev_wait_pend8021x(struct brcmf_if *ifp); +- +- /* Return pointer to interface name */ +--char *brcmf_ifname(struct brcmf_pub *drvr, int idx); +-+char *brcmf_ifname(struct brcmf_if *ifp); +- struct brcmf_if *brcmf_get_ifp(struct brcmf_pub *drvr, int ifidx); +- int brcmf_net_attach(struct brcmf_if *ifp, bool rtnl_locked); +- struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bssidx, s32 ifidx, +diff --git a/package/kernel/mac80211/patches/374-0003-brcmfmac-Remove-unnecessary-check-from-start_xmit.patch b/package/kernel/mac80211/patches/374-0003-brcmfmac-Remove-unnecessary-check-from-start_xmit.patch +deleted file mode 100644 +index 4d60521..0000000 +--- a/package/kernel/mac80211/patches/374-0003-brcmfmac-Remove-unnecessary-check-from-start_xmit.patch ++++ /dev/null +@@ -1,32 +0,0 @@ +-From: Hante Meuleman +-Date: Thu, 29 Oct 2015 20:33:13 +0100 +-Subject: [PATCH] brcmfmac: Remove unnecessary check from start_xmit. +- +-The brcmf_netdev_start_xmit checks if the ndev is still valid by +-checking if it still exists in database. This check is not needed +-and therefor removed. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c +-@@ -217,14 +217,6 @@ static netdev_tx_t brcmf_netdev_start_xm +- goto done; +- } +- +-- if (!drvr->iflist[ifp->bssidx]) { +-- brcmf_err("bad ifidx %d\n", ifp->bssidx); +-- netif_stop_queue(ndev); +-- dev_kfree_skb(skb); +-- ret = -ENODEV; +-- goto done; +-- } +-- +- /* Make sure there's enough room for any header */ +- if (skb_headroom(skb) < drvr->hdrlen) { +- struct sk_buff *skb2; +diff --git a/package/kernel/mac80211/patches/374-0004-brcmfmac-Remove-unncessary-variable-irq_requested.patch b/package/kernel/mac80211/patches/374-0004-brcmfmac-Remove-unncessary-variable-irq_requested.patch +deleted file mode 100644 +index 5030297..0000000 +--- a/package/kernel/mac80211/patches/374-0004-brcmfmac-Remove-unncessary-variable-irq_requested.patch ++++ /dev/null +@@ -1,49 +0,0 @@ +-From: Hante Meuleman +-Date: Thu, 29 Oct 2015 20:33:14 +0100 +-Subject: [PATCH] brcmfmac: Remove unncessary variable irq_requested. +- +-The variable irq_requested is unneeded as the functionality +-it is providing, is also provided by the variable irq_allocated. +- +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-@@ -257,7 +257,6 @@ struct brcmf_pcie_core_info { +- struct brcmf_pciedev_info { +- enum brcmf_pcie_state state; +- bool in_irq; +-- bool irq_requested; +- struct pci_dev *pdev; +- char fw_name[BRCMF_FW_PATH_LEN + BRCMF_FW_NAME_LEN]; +- char nvram_name[BRCMF_FW_PATH_LEN + BRCMF_FW_NAME_LEN]; +-@@ -889,7 +888,6 @@ static int brcmf_pcie_request_irq(struct +- +- brcmf_dbg(PCIE, "Enter\n"); +- /* is it a v1 or v2 implementation */ +-- devinfo->irq_requested = false; +- pci_enable_msi(pdev); +- if (devinfo->generic_corerev == BRCMF_PCIE_GENREV1) { +- if (request_threaded_irq(pdev->irq, +-@@ -912,7 +910,6 @@ static int brcmf_pcie_request_irq(struct +- return -EIO; +- } +- } +-- devinfo->irq_requested = true; +- devinfo->irq_allocated = true; +- return 0; +- } +-@@ -930,9 +927,6 @@ static void brcmf_pcie_release_irq(struc +- pdev = devinfo->pdev; +- +- brcmf_pcie_intr_disable(devinfo); +-- if (!devinfo->irq_requested) +-- return; +-- devinfo->irq_requested = false; +- free_irq(pdev->irq, devinfo); +- pci_disable_msi(pdev); +- +diff --git a/package/kernel/mac80211/patches/374-0005-brcmfmac-Disable-runtime-pm-for-USB.patch b/package/kernel/mac80211/patches/374-0005-brcmfmac-Disable-runtime-pm-for-USB.patch +deleted file mode 100644 +index f2afb90..0000000 +--- a/package/kernel/mac80211/patches/374-0005-brcmfmac-Disable-runtime-pm-for-USB.patch ++++ /dev/null +@@ -1,26 +0,0 @@ +-From: Hante Meuleman +-Date: Thu, 29 Oct 2015 20:33:15 +0100 +-Subject: [PATCH] brcmfmac: Disable runtime pm for USB. +- +-Currently runtime pm is enabled for USB, but it is not properly +-supported by driver. This patch disables the runtime PM support +-completely for USB, as it currently can result in problems on +-some systems. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/usb.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/usb.c +-@@ -1504,7 +1504,6 @@ static struct usb_driver brcmf_usbdrvr = +- .suspend = brcmf_usb_suspend, +- .resume = brcmf_usb_resume, +- .reset_resume = brcmf_usb_reset_resume, +-- .supports_autosuspend = 1, +- #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) +- .disable_hub_initiated_lpm = 1, +- #endif +diff --git a/package/kernel/mac80211/patches/374-0006-brcmfmac-Add-RSDB-support.patch b/package/kernel/mac80211/patches/374-0006-brcmfmac-Add-RSDB-support.patch +deleted file mode 100644 +index 78a95c5..0000000 +--- a/package/kernel/mac80211/patches/374-0006-brcmfmac-Add-RSDB-support.patch ++++ /dev/null +@@ -1,65 +0,0 @@ +-From: Hante Meuleman +-Date: Thu, 29 Oct 2015 20:33:16 +0100 +-Subject: [PATCH] brcmfmac: Add RSDB support. +- +-Broadcom devices with a single 802.11 core can work on two band +-concurrently using VSDB feature, ie. Virtual Simultaneous Dual-Band. +-For devices that are fitted with two 802.11 cores and RF paths the +-driver should support a firmware feature called RSDB, which stands +-for Real Simultaneous Dual-Band. RSDB works almost autonomously in +-firmware except for AP config. When the device supports RSDB then +-the interface should not be brought down when configuring it, +-otherwise the link (if configured) on the other interface will be +-lost. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-[kvalo@codeaurora.org: changed the commit log based on discussion] +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-@@ -4182,7 +4182,9 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +- } +- } +- +-- if (dev_role == NL80211_IFTYPE_AP) { +-+ if ((dev_role == NL80211_IFTYPE_AP) && +-+ ((ifp->ifidx == 0) || +-+ !brcmf_feat_is_enabled(ifp, BRCMF_FEAT_RSDB))) { +- err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_DOWN, 1); +- if (err < 0) { +- brcmf_err("BRCMF_C_DOWN error %d\n", err); +---- a/drivers/net/wireless/brcm80211/brcmfmac/feature.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/feature.c +-@@ -137,6 +137,7 @@ void brcmf_feat_attach(struct brcmf_pub +- if (drvr->bus_if->chip != BRCM_CC_43362_CHIP_ID) +- brcmf_feat_iovar_int_set(ifp, BRCMF_FEAT_MBSS, "mbss", 0); +- brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_P2P, "p2p"); +-+ brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_RSDB, "rsdb_mode"); +- +- if (brcmf_feature_disable) { +- brcmf_dbg(INFO, "Features: 0x%02x, disable: 0x%02x\n", +---- a/drivers/net/wireless/brcm80211/brcmfmac/feature.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/feature.h +-@@ -24,13 +24,16 @@ +- * PNO: preferred network offload. +- * WOWL: Wake-On-WLAN. +- * P2P: peer-to-peer +-+ * RSDB: Real Simultaneous Dual Band +- */ +- #define BRCMF_FEAT_LIST \ +- BRCMF_FEAT_DEF(MBSS) \ +- BRCMF_FEAT_DEF(MCHAN) \ +- BRCMF_FEAT_DEF(PNO) \ +- BRCMF_FEAT_DEF(WOWL) \ +-- BRCMF_FEAT_DEF(P2P) +-+ BRCMF_FEAT_DEF(P2P) \ +-+ BRCMF_FEAT_DEF(RSDB) +-+ +- /* +- * Quirks: +- * +diff --git a/package/kernel/mac80211/patches/374-0007-brcmfmac-Use-consistent-naming-for-bsscfgidx.patch b/package/kernel/mac80211/patches/374-0007-brcmfmac-Use-consistent-naming-for-bsscfgidx.patch +deleted file mode 100644 +index d1e7264..0000000 +--- a/package/kernel/mac80211/patches/374-0007-brcmfmac-Use-consistent-naming-for-bsscfgidx.patch ++++ /dev/null +@@ -1,533 +0,0 @@ +-From: Hante Meuleman +-Date: Thu, 29 Oct 2015 20:33:17 +0100 +-Subject: [PATCH] brcmfmac: Use consistent naming for bsscfgidx. +- +-The variable bsscfgidx is used in different places with different +-names, e.g. bsscfg, bssidx, bsscfg_idx. This patch cleans this up +-by using bsscfgidx everywhere. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-@@ -775,7 +775,8 @@ brcmf_cfg80211_change_iface(struct wiphy +- s32 ap = 0; +- s32 err = 0; +- +-- brcmf_dbg(TRACE, "Enter, idx=%d, type=%d\n", ifp->bssidx, type); +-+ brcmf_dbg(TRACE, "Enter, bsscfgidx=%d, type=%d\n", ifp->bsscfgidx, +-+ type); +- +- /* WAR: There are a number of p2p interface related problems which +- * need to be handled initially (before doing the validate). +-@@ -2920,7 +2921,7 @@ brcmf_cfg80211_escan_handler(struct brcm +- status = e->status; +- +- if (!test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)) { +-- brcmf_err("scan not ready, bssidx=%d\n", ifp->bssidx); +-+ brcmf_err("scan not ready, bsscfgidx=%d\n", ifp->bsscfgidx); +- return -EPERM; +- } +- +-@@ -3876,7 +3877,8 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c +- ifp = vif->ifp; +- saved_ie = &vif->saved_ie; +- +-- brcmf_dbg(TRACE, "bssidx %d, pktflag : 0x%02X\n", ifp->bssidx, pktflag); +-+ brcmf_dbg(TRACE, "bsscfgidx %d, pktflag : 0x%02X\n", ifp->bsscfgidx, +-+ pktflag); +- iovar_ie_buf = kzalloc(WL_EXTRA_BUF_MAX, GFP_KERNEL); +- if (!iovar_ie_buf) +- return -ENOMEM; +-@@ -4240,7 +4242,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +- brcmf_err("setting ssid failed %d\n", err); +- goto exit; +- } +-- bss_enable.bsscfg_idx = cpu_to_le32(ifp->bssidx); +-+ bss_enable.bsscfgidx = cpu_to_le32(ifp->bsscfgidx); +- bss_enable.enable = cpu_to_le32(1); +- err = brcmf_fil_iovar_data_set(ifp, "bss", &bss_enable, +- sizeof(bss_enable)); +-@@ -4307,7 +4309,7 @@ static int brcmf_cfg80211_stop_ap(struct +- if (err < 0) +- brcmf_err("BRCMF_C_UP error %d\n", err); +- } else { +-- bss_enable.bsscfg_idx = cpu_to_le32(ifp->bssidx); +-+ bss_enable.bsscfgidx = cpu_to_le32(ifp->bsscfgidx); +- bss_enable.enable = cpu_to_le32(0); +- err = brcmf_fil_iovar_data_set(ifp, "bss", &bss_enable, +- sizeof(bss_enable)); +-@@ -5093,9 +5095,9 @@ static s32 brcmf_notify_vif_event(struct +- struct brcmf_cfg80211_vif_event *event = &cfg->vif_event; +- struct brcmf_cfg80211_vif *vif; +- +-- brcmf_dbg(TRACE, "Enter: action %u flags %u ifidx %u bsscfg %u\n", +-+ brcmf_dbg(TRACE, "Enter: action %u flags %u ifidx %u bsscfgidx %u\n", +- ifevent->action, ifevent->flags, ifevent->ifidx, +-- ifevent->bssidx); +-+ ifevent->bsscfgidx); +- +- mutex_lock(&event->vif_event_lock); +- event->action = ifevent->action; +---- a/drivers/net/wireless/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c +-@@ -80,7 +80,7 @@ char *brcmf_ifname(struct brcmf_if *ifp) +- struct brcmf_if *brcmf_get_ifp(struct brcmf_pub *drvr, int ifidx) +- { +- struct brcmf_if *ifp; +-- s32 bssidx; +-+ s32 bsscfgidx; +- +- if (ifidx < 0 || ifidx >= BRCMF_MAX_IFS) { +- brcmf_err("ifidx %d out of range\n", ifidx); +-@@ -88,9 +88,9 @@ struct brcmf_if *brcmf_get_ifp(struct br +- } +- +- ifp = NULL; +-- bssidx = drvr->if2bss[ifidx]; +-- if (bssidx >= 0) +-- ifp = drvr->iflist[bssidx]; +-+ bsscfgidx = drvr->if2bss[ifidx]; +-+ if (bsscfgidx >= 0) +-+ ifp = drvr->iflist[bsscfgidx]; +- +- return ifp; +- } +-@@ -108,7 +108,7 @@ static void _brcmf_set_multicast_list(st +- +- ifp = container_of(work, struct brcmf_if, multicast_work); +- +-- brcmf_dbg(TRACE, "Enter, idx=%d\n", ifp->bssidx); +-+ brcmf_dbg(TRACE, "Enter, bsscfgidx=%d\n", ifp->bsscfgidx); +- +- ndev = ifp->ndev; +- +-@@ -168,7 +168,7 @@ _brcmf_set_mac_address(struct work_struc +- +- ifp = container_of(work, struct brcmf_if, setmacaddr_work); +- +-- brcmf_dbg(TRACE, "Enter, idx=%d\n", ifp->bssidx); +-+ brcmf_dbg(TRACE, "Enter, bsscfgidx=%d\n", ifp->bsscfgidx); +- +- err = brcmf_fil_iovar_data_set(ifp, "cur_etheraddr", ifp->mac_addr, +- ETH_ALEN); +-@@ -206,7 +206,7 @@ static netdev_tx_t brcmf_netdev_start_xm +- struct brcmf_pub *drvr = ifp->drvr; +- struct ethhdr *eh = (struct ethhdr *)(skb->data); +- +-- brcmf_dbg(DATA, "Enter, idx=%d\n", ifp->bssidx); +-+ brcmf_dbg(DATA, "Enter, bsscfgidx=%d\n", ifp->bsscfgidx); +- +- /* Can the device send data? */ +- if (drvr->bus_if->state != BRCMF_BUS_UP) { +-@@ -267,8 +267,8 @@ void brcmf_txflowblock_if(struct brcmf_i +- if (!ifp || !ifp->ndev) +- return; +- +-- brcmf_dbg(TRACE, "enter: idx=%d stop=0x%X reason=%d state=%d\n", +-- ifp->bssidx, ifp->netif_stop, reason, state); +-+ brcmf_dbg(TRACE, "enter: bsscfgidx=%d stop=0x%X reason=%d state=%d\n", +-+ ifp->bsscfgidx, ifp->netif_stop, reason, state); +- +- spin_lock_irqsave(&ifp->netif_stop_lock, flags); +- if (state) { +-@@ -587,7 +587,7 @@ static struct net_device_stats *brcmf_ne +- { +- struct brcmf_if *ifp = netdev_priv(ndev); +- +-- brcmf_dbg(TRACE, "Enter, idx=%d\n", ifp->bssidx); +-+ brcmf_dbg(TRACE, "Enter, bsscfgidx=%d\n", ifp->bsscfgidx); +- +- return &ifp->stats; +- } +-@@ -616,7 +616,7 @@ static int brcmf_netdev_stop(struct net_ +- { +- struct brcmf_if *ifp = netdev_priv(ndev); +- +-- brcmf_dbg(TRACE, "Enter, idx=%d\n", ifp->bssidx); +-+ brcmf_dbg(TRACE, "Enter, bsscfgidx=%d\n", ifp->bsscfgidx); +- +- brcmf_cfg80211_down(ndev); +- +-@@ -632,7 +632,7 @@ static int brcmf_netdev_open(struct net_ +- struct brcmf_bus *bus_if = drvr->bus_if; +- u32 toe_ol; +- +-- brcmf_dbg(TRACE, "Enter, idx=%d\n", ifp->bssidx); +-+ brcmf_dbg(TRACE, "Enter, bsscfgidx=%d\n", ifp->bsscfgidx); +- +- /* If bus is not ready, can't continue */ +- if (bus_if->state != BRCMF_BUS_UP) { +-@@ -674,7 +674,7 @@ int brcmf_net_attach(struct brcmf_if *if +- struct net_device *ndev; +- s32 err; +- +-- brcmf_dbg(TRACE, "Enter, idx=%d mac=%pM\n", ifp->bssidx, +-+ brcmf_dbg(TRACE, "Enter, bsscfgidx=%d mac=%pM\n", ifp->bsscfgidx, +- ifp->mac_addr); +- ndev = ifp->ndev; +- +-@@ -706,7 +706,7 @@ int brcmf_net_attach(struct brcmf_if *if +- return 0; +- +- fail: +-- drvr->iflist[ifp->bssidx] = NULL; +-+ drvr->iflist[ifp->bsscfgidx] = NULL; +- ndev->netdev_ops = NULL; +- free_netdev(ndev); +- return -EBADE; +-@@ -724,7 +724,8 @@ void brcmf_net_setcarrier(struct brcmf_i +- { +- struct net_device *ndev; +- +-- brcmf_dbg(TRACE, "Enter, idx=%d carrier=%d\n", ifp->bssidx, on); +-+ brcmf_dbg(TRACE, "Enter, bsscfgidx=%d carrier=%d\n", ifp->bsscfgidx, +-+ on); +- +- ndev = ifp->ndev; +- brcmf_txflowblock_if(ifp, BRCMF_NETIF_STOP_REASON_DISCONNECTED, !on); +-@@ -771,7 +772,7 @@ static int brcmf_net_p2p_attach(struct b +- { +- struct net_device *ndev; +- +-- brcmf_dbg(TRACE, "Enter, idx=%d mac=%pM\n", ifp->bssidx, +-+ brcmf_dbg(TRACE, "Enter, bsscfgidx=%d mac=%pM\n", ifp->bsscfgidx, +- ifp->mac_addr); +- ndev = ifp->ndev; +- +-@@ -790,21 +791,21 @@ static int brcmf_net_p2p_attach(struct b +- return 0; +- +- fail: +-- ifp->drvr->iflist[ifp->bssidx] = NULL; +-+ ifp->drvr->iflist[ifp->bsscfgidx] = NULL; +- ndev->netdev_ops = NULL; +- free_netdev(ndev); +- return -EBADE; +- } +- +--struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bssidx, s32 ifidx, +-+struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bsscfgidx, s32 ifidx, +- bool is_p2pdev, char *name, u8 *mac_addr) +- { +- struct brcmf_if *ifp; +- struct net_device *ndev; +- +-- brcmf_dbg(TRACE, "Enter, idx=%d, ifidx=%d\n", bssidx, ifidx); +-+ brcmf_dbg(TRACE, "Enter, bsscfgidx=%d, ifidx=%d\n", bsscfgidx, ifidx); +- +-- ifp = drvr->iflist[bssidx]; +-+ ifp = drvr->iflist[bsscfgidx]; +- /* +- * Delete the existing interface before overwriting it +- * in case we missed the BRCMF_E_IF_DEL event. +-@@ -815,7 +816,7 @@ struct brcmf_if *brcmf_add_if(struct brc +- if (ifidx) { +- netif_stop_queue(ifp->ndev); +- brcmf_net_detach(ifp->ndev); +-- drvr->iflist[bssidx] = NULL; +-+ drvr->iflist[bsscfgidx] = NULL; +- } else { +- brcmf_err("ignore IF event\n"); +- return ERR_PTR(-EINVAL); +-@@ -839,15 +840,15 @@ struct brcmf_if *brcmf_add_if(struct brc +- ndev->destructor = brcmf_cfg80211_free_netdev; +- ifp = netdev_priv(ndev); +- ifp->ndev = ndev; +-- /* store mapping ifidx to bssidx */ +-+ /* store mapping ifidx to bsscfgidx */ +- if (drvr->if2bss[ifidx] == BRCMF_BSSIDX_INVALID) +-- drvr->if2bss[ifidx] = bssidx; +-+ drvr->if2bss[ifidx] = bsscfgidx; +- } +- +- ifp->drvr = drvr; +-- drvr->iflist[bssidx] = ifp; +-+ drvr->iflist[bsscfgidx] = ifp; +- ifp->ifidx = ifidx; +-- ifp->bssidx = bssidx; +-+ ifp->bsscfgidx = bsscfgidx; +- +- init_waitqueue_head(&ifp->pend_8021x_wait); +- spin_lock_init(&ifp->netif_stop_lock); +-@@ -861,21 +862,22 @@ struct brcmf_if *brcmf_add_if(struct brc +- return ifp; +- } +- +--static void brcmf_del_if(struct brcmf_pub *drvr, s32 bssidx) +-+static void brcmf_del_if(struct brcmf_pub *drvr, s32 bsscfgidx) +- { +- struct brcmf_if *ifp; +- +-- ifp = drvr->iflist[bssidx]; +-- drvr->iflist[bssidx] = NULL; +-+ ifp = drvr->iflist[bsscfgidx]; +-+ drvr->iflist[bsscfgidx] = NULL; +- if (!ifp) { +-- brcmf_err("Null interface, idx=%d\n", bssidx); +-+ brcmf_err("Null interface, bsscfgidx=%d\n", bsscfgidx); +- return; +- } +-- brcmf_dbg(TRACE, "Enter, idx=%d, ifidx=%d\n", bssidx, ifp->ifidx); +-- if (drvr->if2bss[ifp->ifidx] == bssidx) +-+ brcmf_dbg(TRACE, "Enter, bsscfgidx=%d, ifidx=%d\n", bsscfgidx, +-+ ifp->ifidx); +-+ if (drvr->if2bss[ifp->ifidx] == bsscfgidx) +- drvr->if2bss[ifp->ifidx] = BRCMF_BSSIDX_INVALID; +- if (ifp->ndev) { +-- if (bssidx == 0) { +-+ if (bsscfgidx == 0) { +- if (ifp->ndev->netdev_ops == &brcmf_netdev_ops_pri) { +- rtnl_lock(); +- brcmf_netdev_stop(ifp->ndev); +-@@ -905,12 +907,12 @@ static void brcmf_del_if(struct brcmf_pu +- +- void brcmf_remove_interface(struct brcmf_if *ifp) +- { +-- if (!ifp || WARN_ON(ifp->drvr->iflist[ifp->bssidx] != ifp)) +-+ if (!ifp || WARN_ON(ifp->drvr->iflist[ifp->bsscfgidx] != ifp)) +- return; +-- brcmf_dbg(TRACE, "Enter, bssidx=%d, ifidx=%d\n", ifp->bssidx, +-+ brcmf_dbg(TRACE, "Enter, bsscfgidx=%d, ifidx=%d\n", ifp->bsscfgidx, +- ifp->ifidx); +- brcmf_fws_del_interface(ifp); +-- brcmf_del_if(ifp->drvr, ifp->bssidx); +-+ brcmf_del_if(ifp->drvr, ifp->bsscfgidx); +- } +- +- int brcmf_get_next_free_bsscfgidx(struct brcmf_pub *drvr) +-@@ -925,10 +927,10 @@ int brcmf_get_next_free_bsscfgidx(struct +- highest = 2; +- for (ifidx = 0; ifidx < BRCMF_MAX_IFS; ifidx++) { +- if (drvr->iflist[ifidx]) { +-- if (drvr->iflist[ifidx]->bssidx == bsscfgidx) +-+ if (drvr->iflist[ifidx]->bsscfgidx == bsscfgidx) +- bsscfgidx = highest + 1; +-- else if (drvr->iflist[ifidx]->bssidx > highest) +-- highest = drvr->iflist[ifidx]->bssidx; +-+ else if (drvr->iflist[ifidx]->bsscfgidx > highest) +-+ highest = drvr->iflist[ifidx]->bsscfgidx; +- } else { +- available = true; +- } +---- a/drivers/net/wireless/brcm80211/brcmfmac/core.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.h +-@@ -174,7 +174,7 @@ enum brcmf_netif_stop_reason { +- * @multicast_work: worker object for multicast provisioning. +- * @fws_desc: interface specific firmware-signalling descriptor. +- * @ifidx: interface index in device firmware. +-- * @bssidx: index of bss associated with this interface. +-+ * @bsscfgidx: index of bss associated with this interface. +- * @mac_addr: assigned mac address. +- * @netif_stop: bitmap indicates reason why netif queues are stopped. +- * @netif_stop_lock: spinlock for update netif_stop from multiple sources. +-@@ -190,7 +190,7 @@ struct brcmf_if { +- struct work_struct multicast_work; +- struct brcmf_fws_mac_descriptor *fws_desc; +- int ifidx; +-- s32 bssidx; +-+ s32 bsscfgidx; +- u8 mac_addr[ETH_ALEN]; +- u8 netif_stop; +- spinlock_t netif_stop_lock; +-@@ -208,7 +208,7 @@ int brcmf_netdev_wait_pend8021x(struct b +- char *brcmf_ifname(struct brcmf_if *ifp); +- struct brcmf_if *brcmf_get_ifp(struct brcmf_pub *drvr, int ifidx); +- int brcmf_net_attach(struct brcmf_if *ifp, bool rtnl_locked); +--struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bssidx, s32 ifidx, +-+struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bsscfgidx, s32 ifidx, +- bool is_p2pdev, char *name, u8 *mac_addr); +- void brcmf_remove_interface(struct brcmf_if *ifp); +- int brcmf_get_next_free_bsscfgidx(struct brcmf_pub *drvr); +---- a/drivers/net/wireless/brcm80211/brcmfmac/debug.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/debug.c +-@@ -49,7 +49,7 @@ static int brcmf_debug_psm_watchdog_noti +- const struct brcmf_event_msg *evtmsg, +- void *data) +- { +-- brcmf_dbg(TRACE, "enter: idx=%d\n", ifp->bssidx); +-+ brcmf_dbg(TRACE, "enter: bsscfgidx=%d\n", ifp->bsscfgidx); +- +- return brcmf_debug_create_memdump(ifp->drvr->bus_if, data, +- evtmsg->datalen); +---- a/drivers/net/wireless/brcm80211/brcmfmac/fweh.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/fweh.c +-@@ -182,8 +182,8 @@ static void brcmf_fweh_handle_if_event(s +- bool is_p2pdev; +- int err = 0; +- +-- brcmf_dbg(EVENT, "action: %u idx: %u bsscfg: %u flags: %u role: %u\n", +-- ifevent->action, ifevent->ifidx, ifevent->bssidx, +-+ brcmf_dbg(EVENT, "action: %u ifidx: %u bsscfgidx: %u flags: %u role: %u\n", +-+ ifevent->action, ifevent->ifidx, ifevent->bsscfgidx, +- ifevent->flags, ifevent->role); +- +- /* The P2P Device interface event must not be ignored contrary to what +-@@ -204,12 +204,12 @@ static void brcmf_fweh_handle_if_event(s +- return; +- } +- +-- ifp = drvr->iflist[ifevent->bssidx]; +-+ ifp = drvr->iflist[ifevent->bsscfgidx]; +- +- if (ifevent->action == BRCMF_E_IF_ADD) { +- brcmf_dbg(EVENT, "adding %s (%pM)\n", emsg->ifname, +- emsg->addr); +-- ifp = brcmf_add_if(drvr, ifevent->bssidx, ifevent->ifidx, +-+ ifp = brcmf_add_if(drvr, ifevent->bsscfgidx, ifevent->ifidx, +- is_p2pdev, emsg->ifname, emsg->addr); +- if (IS_ERR(ifp)) +- return; +---- a/drivers/net/wireless/brcm80211/brcmfmac/fweh.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/fweh.h +-@@ -219,7 +219,7 @@ struct brcmf_if_event { +- u8 ifidx; +- u8 action; +- u8 flags; +-- u8 bssidx; +-+ u8 bsscfgidx; +- u8 role; +- }; +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/fwil.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwil.c +-@@ -293,22 +293,22 @@ brcmf_fil_iovar_int_get(struct brcmf_if +- } +- +- static u32 +--brcmf_create_bsscfg(s32 bssidx, char *name, char *data, u32 datalen, char *buf, +-- u32 buflen) +-+brcmf_create_bsscfg(s32 bsscfgidx, char *name, char *data, u32 datalen, +-+ char *buf, u32 buflen) +- { +- const s8 *prefix = "bsscfg:"; +- s8 *p; +- u32 prefixlen; +- u32 namelen; +- u32 iolen; +-- __le32 bssidx_le; +-+ __le32 bsscfgidx_le; +- +-- if (bssidx == 0) +-+ if (bsscfgidx == 0) +- return brcmf_create_iovar(name, data, datalen, buf, buflen); +- +- prefixlen = strlen(prefix); +- namelen = strlen(name) + 1; /* lengh of iovar name + null */ +-- iolen = prefixlen + namelen + sizeof(bssidx_le) + datalen; +-+ iolen = prefixlen + namelen + sizeof(bsscfgidx_le) + datalen; +- +- if (buflen < iolen) { +- brcmf_err("buffer is too short\n"); +-@@ -326,9 +326,9 @@ brcmf_create_bsscfg(s32 bssidx, char *na +- p += namelen; +- +- /* bss config index as first data */ +-- bssidx_le = cpu_to_le32(bssidx); +-- memcpy(p, &bssidx_le, sizeof(bssidx_le)); +-- p += sizeof(bssidx_le); +-+ bsscfgidx_le = cpu_to_le32(bsscfgidx); +-+ memcpy(p, &bsscfgidx_le, sizeof(bsscfgidx_le)); +-+ p += sizeof(bsscfgidx_le); +- +- /* parameter buffer follows */ +- if (datalen) +-@@ -347,12 +347,12 @@ brcmf_fil_bsscfg_data_set(struct brcmf_i +- +- mutex_lock(&drvr->proto_block); +- +-- brcmf_dbg(FIL, "ifidx=%d, bssidx=%d, name=%s, len=%d\n", ifp->ifidx, +-- ifp->bssidx, name, len); +-+ brcmf_dbg(FIL, "ifidx=%d, bsscfgidx=%d, name=%s, len=%d\n", ifp->ifidx, +-+ ifp->bsscfgidx, name, len); +- brcmf_dbg_hex_dump(BRCMF_FIL_ON(), data, +- min_t(uint, len, MAX_HEX_DUMP_LEN), "data\n"); +- +-- buflen = brcmf_create_bsscfg(ifp->bssidx, name, data, len, +-+ buflen = brcmf_create_bsscfg(ifp->bsscfgidx, name, data, len, +- drvr->proto_buf, sizeof(drvr->proto_buf)); +- if (buflen) { +- err = brcmf_fil_cmd_data(ifp, BRCMF_C_SET_VAR, drvr->proto_buf, +-@@ -376,7 +376,7 @@ brcmf_fil_bsscfg_data_get(struct brcmf_i +- +- mutex_lock(&drvr->proto_block); +- +-- buflen = brcmf_create_bsscfg(ifp->bssidx, name, data, len, +-+ buflen = brcmf_create_bsscfg(ifp->bsscfgidx, name, data, len, +- drvr->proto_buf, sizeof(drvr->proto_buf)); +- if (buflen) { +- err = brcmf_fil_cmd_data(ifp, BRCMF_C_GET_VAR, drvr->proto_buf, +-@@ -387,8 +387,8 @@ brcmf_fil_bsscfg_data_get(struct brcmf_i +- err = -EPERM; +- brcmf_err("Creating bsscfg failed\n"); +- } +-- brcmf_dbg(FIL, "ifidx=%d, bssidx=%d, name=%s, len=%d\n", ifp->ifidx, +-- ifp->bssidx, name, len); +-+ brcmf_dbg(FIL, "ifidx=%d, bsscfgidx=%d, name=%s, len=%d\n", ifp->ifidx, +-+ ifp->bsscfgidx, name, len); +- brcmf_dbg_hex_dump(BRCMF_FIL_ON(), data, +- min_t(uint, len, MAX_HEX_DUMP_LEN), "data\n"); +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h +-@@ -170,7 +170,7 @@ struct brcmf_fil_af_params_le { +- }; +- +- struct brcmf_fil_bss_enable_le { +-- __le32 bsscfg_idx; +-+ __le32 bsscfgidx; +- __le32 enable; +- }; +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c +-@@ -719,7 +719,7 @@ static void brcmf_fws_macdesc_init(struc +- desc->state = BRCMF_FWS_STATE_OPEN; +- desc->requested_credit = 0; +- desc->requested_packet = 0; +-- /* depending on use may need ifp->bssidx instead */ +-+ /* depending on use may need ifp->bsscfgidx instead */ +- desc->interface_id = ifidx; +- desc->ac_bitmap = 0xff; /* update this when handling APSD */ +- if (addr) +-@@ -1938,7 +1938,7 @@ void brcmf_fws_reset_interface(struct br +- { +- struct brcmf_fws_mac_descriptor *entry = ifp->fws_desc; +- +-- brcmf_dbg(TRACE, "enter: idx=%d\n", ifp->bssidx); +-+ brcmf_dbg(TRACE, "enter: bsscfgidx=%d\n", ifp->bsscfgidx); +- if (!entry) +- return; +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +-@@ -2067,7 +2067,7 @@ static struct wireless_dev *brcmf_p2p_cr +- struct brcmf_if *p2p_ifp; +- struct brcmf_if *pri_ifp; +- int err; +-- u32 bssidx; +-+ u32 bsscfgidx; +- +- if (p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif) +- return ERR_PTR(-ENOSPC); +-@@ -2113,13 +2113,13 @@ static struct wireless_dev *brcmf_p2p_cr +- memcpy(&p2p_vif->wdev.address, p2p->dev_addr, sizeof(p2p->dev_addr)); +- +- /* verify bsscfg index for P2P discovery */ +-- err = brcmf_fil_iovar_int_get(pri_ifp, "p2p_dev", &bssidx); +-+ err = brcmf_fil_iovar_int_get(pri_ifp, "p2p_dev", &bsscfgidx); +- if (err < 0) { +- brcmf_err("retrieving discover bsscfg index failed\n"); +- goto fail; +- } +- +-- WARN_ON(p2p_ifp->bssidx != bssidx); +-+ WARN_ON(p2p_ifp->bsscfgidx != bsscfgidx); +- +- init_completion(&p2p->send_af_done); +- INIT_WORK(&p2p->afx_hdl.afx_work, brcmf_p2p_afx_handler); +diff --git a/package/kernel/mac80211/patches/374-0008-brcmfmac-Use-new-methods-for-pcie-Power-Management.patch b/package/kernel/mac80211/patches/374-0008-brcmfmac-Use-new-methods-for-pcie-Power-Management.patch +deleted file mode 100644 +index fb2b85e..0000000 +--- a/package/kernel/mac80211/patches/374-0008-brcmfmac-Use-new-methods-for-pcie-Power-Management.patch ++++ /dev/null +@@ -1,163 +0,0 @@ +-From: Hante Meuleman +-Date: Thu, 29 Oct 2015 20:33:18 +0100 +-Subject: [PATCH] brcmfmac: Use new methods for pcie Power Management. +- +-Currently the legacy methods suspend and resume are used for pcie +-devices. This is not the preferable method and is also causing +-issues with some setups when doing hibernate. Changing this to +-use the new PM methods. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-@@ -1388,10 +1388,6 @@ static void brcmf_pcie_wowl_config(struc +- +- brcmf_dbg(PCIE, "Configuring WOWL, enabled=%d\n", enabled); +- devinfo->wowl_enabled = enabled; +-- if (enabled) +-- device_set_wakeup_enable(&devinfo->pdev->dev, true); +-- else +-- device_set_wakeup_enable(&devinfo->pdev->dev, false); +- } +- +- +-@@ -1961,15 +1957,14 @@ brcmf_pcie_remove(struct pci_dev *pdev) +- #ifdef CONFIG_PM +- +- +--static int brcmf_pcie_suspend(struct pci_dev *pdev, pm_message_t state) +-+static int brcmf_pcie_pm_enter_D3(struct device *dev) +- { +- struct brcmf_pciedev_info *devinfo; +- struct brcmf_bus *bus; +-- int err; +- +-- brcmf_dbg(PCIE, "Enter, state=%d, pdev=%p\n", state.event, pdev); +-+ brcmf_err("Enter\n"); +- +-- bus = dev_get_drvdata(&pdev->dev); +-+ bus = dev_get_drvdata(dev); +- devinfo = bus->bus_priv.pcie->devinfo; +- +- brcmf_bus_change_state(bus, BRCMF_BUS_DOWN); +-@@ -1984,62 +1979,45 @@ static int brcmf_pcie_suspend(struct pci +- brcmf_err("Timeout on response for entering D3 substate\n"); +- return -EIO; +- } +-- brcmf_pcie_send_mb_data(devinfo, BRCMF_H2D_HOST_D0_INFORM_IN_USE); +- +-- err = pci_save_state(pdev); +-- if (err) +-- brcmf_err("pci_save_state failed, err=%d\n", err); +-- if ((err) || (!devinfo->wowl_enabled)) { +-- brcmf_chip_detach(devinfo->ci); +-- devinfo->ci = NULL; +-- brcmf_pcie_remove(pdev); +-- return 0; +-- } +-+ devinfo->state = BRCMFMAC_PCIE_STATE_DOWN; +- +-- return pci_prepare_to_sleep(pdev); +-+ return 0; +- } +- +--static int brcmf_pcie_resume(struct pci_dev *pdev) +-+ +-+static int brcmf_pcie_pm_leave_D3(struct device *dev) +- { +- struct brcmf_pciedev_info *devinfo; +- struct brcmf_bus *bus; +-+ struct pci_dev *pdev; +- int err; +- +-- bus = dev_get_drvdata(&pdev->dev); +-- brcmf_dbg(PCIE, "Enter, pdev=%p, bus=%p\n", pdev, bus); +-+ brcmf_err("Enter\n"); +- +-- err = pci_set_power_state(pdev, PCI_D0); +-- if (err) { +-- brcmf_err("pci_set_power_state failed, err=%d\n", err); +-- goto cleanup; +-- } +-- pci_restore_state(pdev); +-- pci_enable_wake(pdev, PCI_D3hot, false); +-- pci_enable_wake(pdev, PCI_D3cold, false); +-+ bus = dev_get_drvdata(dev); +-+ devinfo = bus->bus_priv.pcie->devinfo; +-+ brcmf_dbg(PCIE, "Enter, dev=%p, bus=%p\n", dev, bus); +- +- /* Check if device is still up and running, if so we are ready */ +-- if (bus) { +-- devinfo = bus->bus_priv.pcie->devinfo; +-- if (brcmf_pcie_read_reg32(devinfo, +-- BRCMF_PCIE_PCIE2REG_INTMASK) != 0) { +-- if (brcmf_pcie_send_mb_data(devinfo, +-- BRCMF_H2D_HOST_D0_INFORM)) +-- goto cleanup; +-- brcmf_dbg(PCIE, "Hot resume, continue....\n"); +-- brcmf_pcie_select_core(devinfo, BCMA_CORE_PCIE2); +-- brcmf_bus_change_state(bus, BRCMF_BUS_UP); +-- brcmf_pcie_intr_enable(devinfo); +-- return 0; +-- } +-+ if (brcmf_pcie_read_reg32(devinfo, BRCMF_PCIE_PCIE2REG_INTMASK) != 0) { +-+ brcmf_dbg(PCIE, "Try to wakeup device....\n"); +-+ if (brcmf_pcie_send_mb_data(devinfo, BRCMF_H2D_HOST_D0_INFORM)) +-+ goto cleanup; +-+ brcmf_dbg(PCIE, "Hot resume, continue....\n"); +-+ devinfo->state = BRCMFMAC_PCIE_STATE_UP; +-+ brcmf_pcie_select_core(devinfo, BCMA_CORE_PCIE2); +-+ brcmf_bus_change_state(bus, BRCMF_BUS_UP); +-+ brcmf_pcie_intr_enable(devinfo); +-+ return 0; +- } +- +- cleanup: +-- if (bus) { +-- devinfo = bus->bus_priv.pcie->devinfo; +-- brcmf_chip_detach(devinfo->ci); +-- devinfo->ci = NULL; +-- brcmf_pcie_remove(pdev); +-- } +-+ brcmf_chip_detach(devinfo->ci); +-+ devinfo->ci = NULL; +-+ pdev = devinfo->pdev; +-+ brcmf_pcie_remove(pdev); +-+ +- err = brcmf_pcie_probe(pdev, NULL); +- if (err) +- brcmf_err("probe after resume failed, err=%d\n", err); +-@@ -2048,6 +2026,14 @@ cleanup: +- } +- +- +-+static const struct dev_pm_ops brcmf_pciedrvr_pm = { +-+ .suspend = brcmf_pcie_pm_enter_D3, +-+ .resume = brcmf_pcie_pm_leave_D3, +-+ .freeze = brcmf_pcie_pm_enter_D3, +-+ .restore = brcmf_pcie_pm_leave_D3, +-+}; +-+ +-+ +- #endif /* CONFIG_PM */ +- +- +-@@ -2086,9 +2072,8 @@ static struct pci_driver brcmf_pciedrvr +- .probe = brcmf_pcie_probe, +- .remove = brcmf_pcie_remove, +- #ifdef CONFIG_PM +-- .suspend = brcmf_pcie_suspend, +-- .resume = brcmf_pcie_resume +--#endif /* CONFIG_PM */ +-+ .driver.pm = &brcmf_pciedrvr_pm, +-+#endif +- }; +- +- +diff --git a/package/kernel/mac80211/patches/374-0009-brcmfmac-Add-wowl-wake-indication-report.patch b/package/kernel/mac80211/patches/374-0009-brcmfmac-Add-wowl-wake-indication-report.patch +deleted file mode 100644 +index 4324cc7..0000000 +--- a/package/kernel/mac80211/patches/374-0009-brcmfmac-Add-wowl-wake-indication-report.patch ++++ /dev/null +@@ -1,129 +0,0 @@ +-From: Hante Meuleman +-Date: Thu, 29 Oct 2015 20:33:19 +0100 +-Subject: [PATCH] brcmfmac: Add wowl wake indication report. +- +-On wakeup of the system (resume) a wowl wakeup indication report +-can be sent to cfg80211. This patch adds support for this. The +-report specifies if the device was responsible for the wakeup +-and if so, will specify the exact reason. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-@@ -3061,6 +3061,67 @@ static s32 brcmf_config_wowl_pattern(str +- return ret; +- } +- +-+#ifdef CPTCFG_PM +-+ +-+static void brcmf_report_wowl_wakeind(struct wiphy *wiphy, struct brcmf_if *ifp) +-+{ +-+ struct brcmf_wowl_wakeind_le wake_ind_le; +-+ struct cfg80211_wowlan_wakeup wakeup_data; +-+ struct cfg80211_wowlan_wakeup *wakeup; +-+ u32 wakeind; +-+ s32 err; +-+ +-+ err = brcmf_fil_iovar_data_get(ifp, "wowl_wakeind", &wake_ind_le, +-+ sizeof(wake_ind_le)); +-+ if (!err) { +-+ brcmf_err("Get wowl_wakeind failed, err = %d\n", err); +-+ return; +-+ } +-+ +-+ wakeind = le32_to_cpu(wake_ind_le.ucode_wakeind); +-+ if (wakeind & (BRCMF_WOWL_MAGIC | BRCMF_WOWL_DIS | BRCMF_WOWL_BCN | +-+ BRCMF_WOWL_RETR | BRCMF_WOWL_NET)) { +-+ wakeup = &wakeup_data; +-+ memset(&wakeup_data, 0, sizeof(wakeup_data)); +-+ wakeup_data.pattern_idx = -1; +-+ +-+ if (wakeind & BRCMF_WOWL_MAGIC) { +-+ brcmf_dbg(INFO, "WOWL Wake indicator: BRCMF_WOWL_MAGIC\n"); +-+ wakeup_data.magic_pkt = true; +-+ } +-+ if (wakeind & BRCMF_WOWL_DIS) { +-+ brcmf_dbg(INFO, "WOWL Wake indicator: BRCMF_WOWL_DIS\n"); +-+ wakeup_data.disconnect = true; +-+ } +-+ if (wakeind & BRCMF_WOWL_BCN) { +-+ brcmf_dbg(INFO, "WOWL Wake indicator: BRCMF_WOWL_BCN\n"); +-+ wakeup_data.disconnect = true; +-+ } +-+ if (wakeind & BRCMF_WOWL_RETR) { +-+ brcmf_dbg(INFO, "WOWL Wake indicator: BRCMF_WOWL_RETR\n"); +-+ wakeup_data.disconnect = true; +-+ } +-+ if (wakeind & BRCMF_WOWL_NET) { +-+ brcmf_dbg(INFO, "WOWL Wake indicator: BRCMF_WOWL_NET\n"); +-+ /* For now always map to pattern 0, no API to get +-+ * correct information available at the moment. +-+ */ +-+ wakeup_data.pattern_idx = 0; +-+ } +-+ } else { +-+ wakeup = NULL; +-+ } +-+ cfg80211_report_wowlan_wakeup(&ifp->vif->wdev, wakeup, GFP_KERNEL); +-+} +-+ +-+#else +-+ +-+static void brcmf_report_wowl_wakeind(struct wiphy *wiphy, struct brcmf_if *ifp) +-+{ +-+} +-+ +-+#endif /* CPTCFG_PM */ +-+ +- static s32 brcmf_cfg80211_resume(struct wiphy *wiphy) +- { +- struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); +-@@ -3070,11 +3131,12 @@ static s32 brcmf_cfg80211_resume(struct +- brcmf_dbg(TRACE, "Enter\n"); +- +- if (cfg->wowl_enabled) { +-+ brcmf_report_wowl_wakeind(wiphy, ifp); +-+ brcmf_fil_iovar_int_set(ifp, "wowl_clear", 0); +-+ brcmf_config_wowl_pattern(ifp, "clr", NULL, 0, NULL, 0); +- brcmf_configure_arp_offload(ifp, true); +- brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PM, +- cfg->pre_wowl_pmmode); +-- brcmf_fil_iovar_int_set(ifp, "wowl_clear", 0); +-- brcmf_config_wowl_pattern(ifp, "clr", NULL, 0, NULL, 0); +- cfg->wowl_enabled = false; +- } +- return 0; +-@@ -3108,6 +3170,7 @@ static void brcmf_configure_wowl(struct +- wowl->patterns[i].pkt_offset); +- } +- } +-+ brcmf_fil_iovar_data_set(ifp, "wowl_wakeind", "clear", strlen("clear")); +- brcmf_fil_iovar_int_set(ifp, "wowl", wowl_config); +- brcmf_fil_iovar_int_set(ifp, "wowl_activate", 1); +- brcmf_bus_wowl_config(cfg->pub->bus_if, true); +---- a/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h +-@@ -634,4 +634,16 @@ struct brcmf_assoclist_le { +- u8 mac[BRCMF_MAX_ASSOCLIST][ETH_ALEN]; +- }; +- +-+/** +-+ * struct brcmf_wowl_wakeind_le - Wakeup indicators +-+ * Note: note both fields contain same information. +-+ * +-+ * @pci_wakeind: Whether PCI PMECSR PMEStatus bit was set. +-+ * @ucode_wakeind: What wakeup-event indication was set by ucode +-+ */ +-+struct brcmf_wowl_wakeind_le { +-+ __le32 pci_wakeind; +-+ __le32 ucode_wakeind; +-+}; +-+ +- #endif /* FWIL_TYPES_H_ */ +diff --git a/package/kernel/mac80211/patches/375-brcmfmac-constify-brcmf_bus_ops-structures.patch b/package/kernel/mac80211/patches/375-brcmfmac-constify-brcmf_bus_ops-structures.patch +deleted file mode 100644 +index a0cc231..0000000 +--- a/package/kernel/mac80211/patches/375-brcmfmac-constify-brcmf_bus_ops-structures.patch ++++ /dev/null +@@ -1,57 +0,0 @@ +-From: Julia Lawall +-Date: Sat, 14 Nov 2015 17:22:07 +0100 +-Subject: [PATCH] brcmfmac: constify brcmf_bus_ops structures +- +-The brcmf_bus_ops structures are never modified, so declare them as const. +- +-Done with the help of Coccinelle. +- +-Signed-off-by: Julia Lawall +-Acked-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/bus.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/bus.h +-@@ -137,7 +137,7 @@ struct brcmf_bus { +- bool always_use_fws_queue; +- bool wowl_supported; +- +-- struct brcmf_bus_ops *ops; +-+ const struct brcmf_bus_ops *ops; +- struct brcmf_bus_msgbuf *msgbuf; +- }; +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-@@ -1413,7 +1413,7 @@ static int brcmf_pcie_get_memdump(struct +- } +- +- +--static struct brcmf_bus_ops brcmf_pcie_bus_ops = { +-+static const struct brcmf_bus_ops brcmf_pcie_bus_ops = { +- .txdata = brcmf_pcie_tx, +- .stop = brcmf_pcie_down, +- .txctl = brcmf_pcie_tx_ctlpkt, +---- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-@@ -4025,7 +4025,7 @@ brcmf_sdio_watchdog(unsigned long data) +- } +- } +- +--static struct brcmf_bus_ops brcmf_sdio_bus_ops = { +-+static const struct brcmf_bus_ops brcmf_sdio_bus_ops = { +- .stop = brcmf_sdio_bus_stop, +- .preinit = brcmf_sdio_bus_preinit, +- .txdata = brcmf_sdio_bus_txdata, +---- a/drivers/net/wireless/brcm80211/brcmfmac/usb.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/usb.c +-@@ -1163,7 +1163,7 @@ static void brcmf_usb_wowl_config(struct +- device_set_wakeup_enable(devinfo->dev, false); +- } +- +--static struct brcmf_bus_ops brcmf_usb_bus_ops = { +-+static const struct brcmf_bus_ops brcmf_usb_bus_ops = { +- .txdata = brcmf_usb_tx, +- .stop = brcmf_usb_down, +- .txctl = brcmf_usb_tx_ctlpkt, +diff --git a/package/kernel/mac80211/patches/376-0001-brcmfmac-Cleanup-ssid-storage.patch b/package/kernel/mac80211/patches/376-0001-brcmfmac-Cleanup-ssid-storage.patch +deleted file mode 100644 +index 83f1ebe..0000000 +--- a/package/kernel/mac80211/patches/376-0001-brcmfmac-Cleanup-ssid-storage.patch ++++ /dev/null +@@ -1,251 +0,0 @@ +-From: Hante Meuleman +-Date: Wed, 25 Nov 2015 11:32:37 +0100 +-Subject: [PATCH] brcmfmac: Cleanup ssid storage. +- +-SSIDs used for connect and p2p got stored, but never used. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-@@ -959,7 +959,7 @@ brcmf_run_escan(struct brcmf_cfg80211_in +- params_size += sizeof(u32) * ((request->n_channels + 1) / 2); +- +- /* Allocate space for populating ssids in struct */ +-- params_size += sizeof(struct brcmf_ssid) * request->n_ssids; +-+ params_size += sizeof(struct brcmf_ssid_le) * request->n_ssids; +- } +- +- params = kzalloc(params_size, GFP_KERNEL); +-@@ -1291,6 +1291,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w +- s32 wsec = 0; +- s32 bcnprd; +- u16 chanspec; +-+ u32 ssid_len; +- +- brcmf_dbg(TRACE, "Enter\n"); +- if (!check_vif_up(ifp->vif)) +-@@ -1368,17 +1369,15 @@ brcmf_cfg80211_join_ibss(struct wiphy *w +- memset(&join_params, 0, sizeof(struct brcmf_join_params)); +- +- /* SSID */ +-- profile->ssid.SSID_len = min_t(u32, params->ssid_len, 32); +-- memcpy(profile->ssid.SSID, params->ssid, profile->ssid.SSID_len); +-- memcpy(join_params.ssid_le.SSID, params->ssid, profile->ssid.SSID_len); +-- join_params.ssid_le.SSID_len = cpu_to_le32(profile->ssid.SSID_len); +-+ ssid_len = min_t(u32, params->ssid_len, IEEE80211_MAX_SSID_LEN); +-+ memcpy(join_params.ssid_le.SSID, params->ssid, ssid_len); +-+ join_params.ssid_le.SSID_len = cpu_to_le32(ssid_len); +- join_params_size = sizeof(join_params.ssid_le); +- +- /* BSSID */ +- if (params->bssid) { +- memcpy(join_params.params_le.bssid, params->bssid, ETH_ALEN); +-- join_params_size = sizeof(join_params.ssid_le) + +-- BRCMF_ASSOC_PARAMS_FIXED_SIZE; +-+ join_params_size += BRCMF_ASSOC_PARAMS_FIXED_SIZE; +- memcpy(profile->bssid, params->bssid, ETH_ALEN); +- } else { +- eth_broadcast_addr(join_params.params_le.bssid); +-@@ -1728,7 +1727,6 @@ brcmf_cfg80211_connect(struct wiphy *wip +- { +- struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); +- struct brcmf_if *ifp = netdev_priv(ndev); +-- struct brcmf_cfg80211_profile *profile = &ifp->vif->profile; +- struct ieee80211_channel *chan = sme->channel; +- struct brcmf_join_params join_params; +- size_t join_params_size; +-@@ -1739,6 +1737,7 @@ brcmf_cfg80211_connect(struct wiphy *wip +- struct brcmf_ext_join_params_le *ext_join_params; +- u16 chanspec; +- s32 err = 0; +-+ u32 ssid_len; +- +- brcmf_dbg(TRACE, "Enter\n"); +- if (!check_vif_up(ifp->vif)) +-@@ -1824,15 +1823,6 @@ brcmf_cfg80211_connect(struct wiphy *wip +- goto done; +- } +- +-- profile->ssid.SSID_len = min_t(u32, (u32)sizeof(profile->ssid.SSID), +-- (u32)sme->ssid_len); +-- memcpy(&profile->ssid.SSID, sme->ssid, profile->ssid.SSID_len); +-- if (profile->ssid.SSID_len < IEEE80211_MAX_SSID_LEN) { +-- profile->ssid.SSID[profile->ssid.SSID_len] = 0; +-- brcmf_dbg(CONN, "SSID \"%s\", len (%d)\n", profile->ssid.SSID, +-- profile->ssid.SSID_len); +-- } +-- +- /* Join with specific BSSID and cached SSID +- * If SSID is zero join based on BSSID only +- */ +-@@ -1845,9 +1835,12 @@ brcmf_cfg80211_connect(struct wiphy *wip +- err = -ENOMEM; +- goto done; +- } +-- ext_join_params->ssid_le.SSID_len = cpu_to_le32(profile->ssid.SSID_len); +-- memcpy(&ext_join_params->ssid_le.SSID, sme->ssid, +-- profile->ssid.SSID_len); +-+ ssid_len = min_t(u32, sme->ssid_len, IEEE80211_MAX_SSID_LEN); +-+ ext_join_params->ssid_le.SSID_len = cpu_to_le32(ssid_len); +-+ memcpy(&ext_join_params->ssid_le.SSID, sme->ssid, ssid_len); +-+ if (ssid_len < IEEE80211_MAX_SSID_LEN) +-+ brcmf_dbg(CONN, "SSID \"%s\", len (%d)\n", +-+ ext_join_params->ssid_le.SSID, ssid_len); +- +- /* Set up join scan parameters */ +- ext_join_params->scan_le.scan_type = -1; +-@@ -1895,8 +1888,8 @@ brcmf_cfg80211_connect(struct wiphy *wip +- memset(&join_params, 0, sizeof(join_params)); +- join_params_size = sizeof(join_params.ssid_le); +- +-- memcpy(&join_params.ssid_le.SSID, sme->ssid, profile->ssid.SSID_len); +-- join_params.ssid_le.SSID_len = cpu_to_le32(profile->ssid.SSID_len); +-+ memcpy(&join_params.ssid_le.SSID, sme->ssid, ssid_len); +-+ join_params.ssid_le.SSID_len = cpu_to_le32(ssid_len); +- +- if (sme->bssid) +- memcpy(join_params.params_le.bssid, sme->bssid, ETH_ALEN); +-@@ -2775,9 +2768,7 @@ CleanUp: +- static s32 brcmf_update_bss_info(struct brcmf_cfg80211_info *cfg, +- struct brcmf_if *ifp) +- { +-- struct brcmf_cfg80211_profile *profile = ndev_to_prof(ifp->ndev); +- struct brcmf_bss_info_le *bi; +-- struct brcmf_ssid *ssid; +- const struct brcmf_tlv *tim; +- u16 beacon_interval; +- u8 dtim_period; +-@@ -2789,8 +2780,6 @@ static s32 brcmf_update_bss_info(struct +- if (brcmf_is_ibssmode(ifp->vif)) +- return err; +- +-- ssid = &profile->ssid; +-- +- *(__le32 *)cfg->extra_buf = cpu_to_le32(WL_EXTRA_BUF_MAX); +- err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BSS_INFO, +- cfg->extra_buf, WL_EXTRA_BUF_MAX); +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.h +-@@ -124,13 +124,11 @@ struct brcmf_cfg80211_security { +- /** +- * struct brcmf_cfg80211_profile - profile information. +- * +-- * @ssid: ssid of associated/associating ap. +- * @bssid: bssid of joined/joining ibss. +- * @sec: security information. +- * @key: key information +- */ +- struct brcmf_cfg80211_profile { +-- struct brcmf_ssid ssid; +- u8 bssid[ETH_ALEN]; +- struct brcmf_cfg80211_security sec; +- struct brcmf_wsec_key key[BRCMF_MAX_DEFAULT_KEYS]; +---- a/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h +-@@ -282,14 +282,9 @@ struct brcm_rateset_le { +- u8 rates[BRCMF_MAXRATES_IN_SET]; +- }; +- +--struct brcmf_ssid { +-- u32 SSID_len; +-- unsigned char SSID[32]; +--}; +-- +- struct brcmf_ssid_le { +- __le32 SSID_len; +-- unsigned char SSID[32]; +-+ unsigned char SSID[IEEE80211_MAX_SSID_LEN]; +- }; +- +- struct brcmf_scan_params_le { +---- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +-@@ -642,7 +642,6 @@ static s32 brcmf_p2p_escan(struct brcmf_ +- struct brcmf_cfg80211_vif *vif; +- struct brcmf_p2p_scan_le *p2p_params; +- struct brcmf_scan_params_le *sparams; +-- struct brcmf_ssid ssid; +- +- memsize += num_chans * sizeof(__le16); +- memblk = kzalloc(memsize, GFP_KERNEL); +-@@ -655,16 +654,16 @@ static s32 brcmf_p2p_escan(struct brcmf_ +- ret = -EINVAL; +- goto exit; +- } +-+ p2p_params = (struct brcmf_p2p_scan_le *)memblk; +-+ sparams = &p2p_params->eparams.params_le; +- +- switch (search_state) { +- case WL_P2P_DISC_ST_SEARCH: +- /* +- * If we in SEARCH STATE, we don't need to set SSID explictly +-- * because dongle use P2P WILDCARD internally by default +-+ * because dongle use P2P WILDCARD internally by default, use +-+ * null ssid, which it is already due to kzalloc. +- */ +-- /* use null ssid */ +-- ssid.SSID_len = 0; +-- memset(ssid.SSID, 0, sizeof(ssid.SSID)); +- break; +- case WL_P2P_DISC_ST_SCAN: +- /* +-@@ -673,8 +672,10 @@ static s32 brcmf_p2p_escan(struct brcmf_ +- * P2P WILDCARD because we just do broadcast scan unless +- * setting SSID. +- */ +-- ssid.SSID_len = BRCMF_P2P_WILDCARD_SSID_LEN; +-- memcpy(ssid.SSID, BRCMF_P2P_WILDCARD_SSID, ssid.SSID_len); +-+ sparams->ssid_le.SSID_len = +-+ cpu_to_le32(BRCMF_P2P_WILDCARD_SSID_LEN); +-+ memcpy(sparams->ssid_le.SSID, BRCMF_P2P_WILDCARD_SSID, +-+ BRCMF_P2P_WILDCARD_SSID_LEN); +- break; +- default: +- brcmf_err(" invalid search state %d\n", search_state); +-@@ -687,11 +688,9 @@ static s32 brcmf_p2p_escan(struct brcmf_ +- /* +- * set p2p scan parameters. +- */ +-- p2p_params = (struct brcmf_p2p_scan_le *)memblk; +- p2p_params->type = 'E'; +- +- /* determine the scan engine parameters */ +-- sparams = &p2p_params->eparams.params_le; +- sparams->bss_type = DOT11_BSSTYPE_ANY; +- if (p2p->cfg->active_scan) +- sparams->scan_type = 0; +-@@ -699,9 +698,6 @@ static s32 brcmf_p2p_escan(struct brcmf_ +- sparams->scan_type = 1; +- +- eth_broadcast_addr(sparams->bssid); +-- if (ssid.SSID_len) +-- memcpy(sparams->ssid_le.SSID, ssid.SSID, ssid.SSID_len); +-- sparams->ssid_le.SSID_len = cpu_to_le32(ssid.SSID_len); +- sparams->home_time = cpu_to_le32(P2PAPI_SCAN_HOME_TIME_MS); +- +- /* +---- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.h +-@@ -112,7 +112,6 @@ struct afx_hdl { +- * @int_addr: P2P interface address. +- * @bss_idx: informate for P2P bss types. +- * @listen_timer: timer for @WL_P2P_DISC_ST_LISTEN discover state. +-- * @ssid: ssid for P2P GO. +- * @listen_channel: channel for @WL_P2P_DISC_ST_LISTEN discover state. +- * @remain_on_channel: contains copy of struct used by cfg80211. +- * @remain_on_channel_cookie: cookie counter for remain on channel cmd +-@@ -133,7 +132,6 @@ struct brcmf_p2p_info { +- u8 int_addr[ETH_ALEN]; +- struct p2p_bss bss_idx[P2PAPI_BSSCFG_MAX]; +- struct timer_list listen_timer; +-- struct brcmf_ssid ssid; +- u8 listen_channel; +- struct ieee80211_channel remain_on_channel; +- u32 remain_on_channel_cookie; +diff --git a/package/kernel/mac80211/patches/376-0002-brcmfmac-Return-actual-error-by-fwil.patch b/package/kernel/mac80211/patches/376-0002-brcmfmac-Return-actual-error-by-fwil.patch +deleted file mode 100644 +index 8672c18..0000000 +--- a/package/kernel/mac80211/patches/376-0002-brcmfmac-Return-actual-error-by-fwil.patch ++++ /dev/null +@@ -1,31 +0,0 @@ +-From: Hante Meuleman +-Date: Wed, 25 Nov 2015 11:32:38 +0100 +-Subject: [PATCH] brcmfmac: Return actual error by fwil. +- +-FWIL is always mapping back errors to EBADE. This is not very +-conventient when trying to understand problems by reading logs. +-Some callers print the error code, but that is quite useless +-when the exact error code is not returned. It also makes it +-impossible to differentiate based on error code. This patch +-changes the return of EBADE into the actual error code. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/fwil.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwil.c +-@@ -126,7 +126,8 @@ brcmf_fil_cmd_data(struct brcmf_if *ifp, +- +- brcmf_dbg(FIL, "Failed: %s (%d)\n", +- brcmf_fil_get_errstr((u32)(-err)), err); +-- return -EBADE; +-+ +-+ return err; +- } +- +- s32 +diff --git a/package/kernel/mac80211/patches/376-0003-brcmfmac-Change-error-print-on-wlan0-existence.patch b/package/kernel/mac80211/patches/376-0003-brcmfmac-Change-error-print-on-wlan0-existence.patch +deleted file mode 100644 +index 1cfab21..0000000 +--- a/package/kernel/mac80211/patches/376-0003-brcmfmac-Change-error-print-on-wlan0-existence.patch ++++ /dev/null +@@ -1,41 +0,0 @@ +-From: Hante Meuleman +-Date: Wed, 25 Nov 2015 11:32:39 +0100 +-Subject: [PATCH] brcmfmac: Change error print on wlan0 existence. +- +-During initialization of the device, but also on some other +-moments the driver prints an error that the netdev already exists. +-This is a result of the way the driver is initializing the +-firmware and not really an error. The code is not treating it as +-an error either. This error print has resulted in many questions +-by users and is confusing and incorrect. This patch changes the +-error log into a debug info log. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c +-@@ -811,14 +811,15 @@ struct brcmf_if *brcmf_add_if(struct brc +- * in case we missed the BRCMF_E_IF_DEL event. +- */ +- if (ifp) { +-- brcmf_err("ERROR: netdev:%s already exists\n", +-- ifp->ndev->name); +- if (ifidx) { +-+ brcmf_err("ERROR: netdev:%s already exists\n", +-+ ifp->ndev->name); +- netif_stop_queue(ifp->ndev); +- brcmf_net_detach(ifp->ndev); +- drvr->iflist[bsscfgidx] = NULL; +- } else { +-- brcmf_err("ignore IF event\n"); +-+ brcmf_dbg(INFO, "netdev:%s ignore IF event\n", +-+ ifp->ndev->name); +- return ERR_PTR(-EINVAL); +- } +- } +diff --git a/package/kernel/mac80211/patches/376-0004-brcmfmac-no-retries-on-rxglom-superframe-errors.patch b/package/kernel/mac80211/patches/376-0004-brcmfmac-no-retries-on-rxglom-superframe-errors.patch +deleted file mode 100644 +index dfc3a98..0000000 +--- a/package/kernel/mac80211/patches/376-0004-brcmfmac-no-retries-on-rxglom-superframe-errors.patch ++++ /dev/null +@@ -1,76 +0,0 @@ +-From: Franky Lin +-Date: Wed, 25 Nov 2015 11:32:40 +0100 +-Subject: [PATCH] brcmfmac: no retries on rxglom superframe errors +- +-Aborting the current read attempt on the superframe also removes the +-packet from the pipeline. Retries should not be attempted on the next +-packet since it would not be a superframe(either a superframe descriptor +-or other data packet) and should not be handled by brcmf_sdio_rxglom +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Arend Van Spriel +-Signed-off-by: Franky Lin +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-@@ -460,7 +460,6 @@ struct brcmf_sdio { +- +- struct sk_buff *glomd; /* Packet containing glomming descriptor */ +- struct sk_buff_head glom; /* Packet list for glommed superframe */ +-- uint glomerr; /* Glom packet read errors */ +- +- u8 *rxbuf; /* Buffer for receiving control packets */ +- uint rxblen; /* Allocated length of rxbuf */ +-@@ -1654,20 +1653,15 @@ static u8 brcmf_sdio_rxglom(struct brcmf +- sdio_release_host(bus->sdiodev->func[1]); +- bus->sdcnt.f2rxdata++; +- +-- /* On failure, kill the superframe, allow a couple retries */ +-+ /* On failure, kill the superframe */ +- if (errcode < 0) { +- brcmf_err("glom read of %d bytes failed: %d\n", +- dlen, errcode); +- +- sdio_claim_host(bus->sdiodev->func[1]); +-- if (bus->glomerr++ < 3) { +-- brcmf_sdio_rxfail(bus, true, true); +-- } else { +-- bus->glomerr = 0; +-- brcmf_sdio_rxfail(bus, true, false); +-- bus->sdcnt.rxglomfail++; +-- brcmf_sdio_free_glom(bus); +-- } +-+ brcmf_sdio_rxfail(bus, true, false); +-+ bus->sdcnt.rxglomfail++; +-+ brcmf_sdio_free_glom(bus); +- sdio_release_host(bus->sdiodev->func[1]); +- return 0; +- } +-@@ -1708,19 +1702,11 @@ static u8 brcmf_sdio_rxglom(struct brcmf +- } +- +- if (errcode) { +-- /* Terminate frame on error, request +-- a couple retries */ +-+ /* Terminate frame on error */ +- sdio_claim_host(bus->sdiodev->func[1]); +-- if (bus->glomerr++ < 3) { +-- /* Restore superframe header space */ +-- skb_push(pfirst, sfdoff); +-- brcmf_sdio_rxfail(bus, true, true); +-- } else { +-- bus->glomerr = 0; +-- brcmf_sdio_rxfail(bus, true, false); +-- bus->sdcnt.rxglomfail++; +-- brcmf_sdio_free_glom(bus); +-- } +-+ brcmf_sdio_rxfail(bus, true, false); +-+ bus->sdcnt.rxglomfail++; +-+ brcmf_sdio_free_glom(bus); +- sdio_release_host(bus->sdiodev->func[1]); +- bus->cur_read.len = 0; +- return 0; +diff --git a/package/kernel/mac80211/patches/376-0005-brcmfmac-Remove-redundant-parameter-action-from-scan.patch b/package/kernel/mac80211/patches/376-0005-brcmfmac-Remove-redundant-parameter-action-from-scan.patch +deleted file mode 100644 +index ede1f47..0000000 +--- a/package/kernel/mac80211/patches/376-0005-brcmfmac-Remove-redundant-parameter-action-from-scan.patch ++++ /dev/null +@@ -1,108 +0,0 @@ +-From: Hante Meuleman +-Date: Wed, 25 Nov 2015 11:32:41 +0100 +-Subject: [PATCH] brcmfmac: Remove redundant parameter action from scan. +- +-ESCAN is always performed using action start scan. No need to +-pass this parameter on to different functions. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-@@ -945,7 +945,7 @@ static void brcmf_escan_prep(struct brcm +- +- static s32 +- brcmf_run_escan(struct brcmf_cfg80211_info *cfg, struct brcmf_if *ifp, +-- struct cfg80211_scan_request *request, u16 action) +-+ struct cfg80211_scan_request *request) +- { +- s32 params_size = BRCMF_SCAN_PARAMS_FIXED_SIZE + +- offsetof(struct brcmf_escan_params_le, params_le); +-@@ -970,7 +970,7 @@ brcmf_run_escan(struct brcmf_cfg80211_in +- BUG_ON(params_size + sizeof("escan") >= BRCMF_DCMD_MEDLEN); +- brcmf_escan_prep(cfg, ¶ms->params_le, request); +- params->version = cpu_to_le32(BRCMF_ESCAN_REQ_VERSION); +-- params->action = cpu_to_le16(action); +-+ params->action = cpu_to_le16(WL_ESCAN_ACTION_START); +- params->sync_id = cpu_to_le16(0x1234); +- +- err = brcmf_fil_iovar_data_set(ifp, "escan", params, params_size); +-@@ -1012,7 +1012,7 @@ brcmf_do_escan(struct brcmf_cfg80211_inf +- results->count = 0; +- results->buflen = WL_ESCAN_RESULTS_FIXED_SIZE; +- +-- err = escan->run(cfg, ifp, request, WL_ESCAN_ACTION_START); +-+ err = escan->run(cfg, ifp, request); +- if (err) +- brcmf_scan_config_mpc(ifp, 1); +- return err; +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.h +-@@ -231,7 +231,7 @@ struct escan_info { +- struct wiphy *wiphy; +- struct brcmf_if *ifp; +- s32 (*run)(struct brcmf_cfg80211_info *cfg, struct brcmf_if *ifp, +-- struct cfg80211_scan_request *request, u16 action); +-+ struct cfg80211_scan_request *request); +- }; +- +- /** +---- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +-@@ -625,11 +625,10 @@ exit: +- * @num_chans: number of channels to scan. +- * @chanspecs: channel parameters for @num_chans channels. +- * @search_state: P2P discover state to use. +-- * @action: scan action to pass to firmware. +- * @bss_type: type of P2P bss. +- */ +- static s32 brcmf_p2p_escan(struct brcmf_p2p_info *p2p, u32 num_chans, +-- u16 chanspecs[], s32 search_state, u16 action, +-+ u16 chanspecs[], s32 search_state, +- enum p2p_bss_type bss_type) +- { +- s32 ret = 0; +-@@ -738,7 +737,7 @@ static s32 brcmf_p2p_escan(struct brcmf_ +- +- /* set the escan specific parameters */ +- p2p_params->eparams.version = cpu_to_le32(BRCMF_ESCAN_REQ_VERSION); +-- p2p_params->eparams.action = cpu_to_le16(action); +-+ p2p_params->eparams.action = cpu_to_le16(WL_ESCAN_ACTION_START); +- p2p_params->eparams.sync_id = cpu_to_le16(0x1234); +- /* perform p2p scan on primary device */ +- ret = brcmf_fil_bsscfg_data_set(vif->ifp, "p2p_scan", memblk, memsize); +-@@ -762,8 +761,7 @@ exit: +- */ +- static s32 brcmf_p2p_run_escan(struct brcmf_cfg80211_info *cfg, +- struct brcmf_if *ifp, +-- struct cfg80211_scan_request *request, +-- u16 action) +-+ struct cfg80211_scan_request *request) +- { +- struct brcmf_p2p_info *p2p = &cfg->p2p; +- s32 err = 0; +-@@ -823,7 +821,7 @@ static s32 brcmf_p2p_run_escan(struct br +- num_nodfs++; +- } +- err = brcmf_p2p_escan(p2p, num_nodfs, chanspecs, search_state, +-- action, P2PAPI_BSSCFG_DEVICE); +-+ P2PAPI_BSSCFG_DEVICE); +- kfree(chanspecs); +- } +- exit: +-@@ -1092,8 +1090,7 @@ static s32 brcmf_p2p_act_frm_search(stru +- default_chan_list[2] = ch.chspec; +- } +- err = brcmf_p2p_escan(p2p, channel_cnt, default_chan_list, +-- WL_P2P_DISC_ST_SEARCH, WL_ESCAN_ACTION_START, +-- P2PAPI_BSSCFG_DEVICE); +-+ WL_P2P_DISC_ST_SEARCH, P2PAPI_BSSCFG_DEVICE); +- kfree(default_chan_list); +- exit: +- return err; +diff --git a/package/kernel/mac80211/patches/376-0006-brcmfmac-Cleanup-roaming-configuration.patch b/package/kernel/mac80211/patches/376-0006-brcmfmac-Cleanup-roaming-configuration.patch +deleted file mode 100644 +index 41b8770..0000000 +--- a/package/kernel/mac80211/patches/376-0006-brcmfmac-Cleanup-roaming-configuration.patch ++++ /dev/null +@@ -1,180 +0,0 @@ +-From: Hante Meuleman +-Date: Wed, 25 Nov 2015 11:32:42 +0100 +-Subject: [PATCH] brcmfmac: Cleanup roaming configuration. +- +-Put all roaming configuration related code in one place and +-configure timeout based upon roaming setting. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-@@ -4755,7 +4755,6 @@ struct brcmf_cfg80211_vif *brcmf_alloc_v +- vif->wdev.iftype = type; +- +- vif->pm_block = pm_block; +-- vif->roam_off = -1; +- +- brcmf_init_prof(&vif->profile); +- +-@@ -5305,35 +5304,33 @@ static void init_vif_event(struct brcmf_ +- mutex_init(&event->vif_event_lock); +- } +- +--static s32 +--brcmf_dongle_roam(struct brcmf_if *ifp, u32 bcn_timeout) +-+static s32 brcmf_dongle_roam(struct brcmf_if *ifp) +- { +-- s32 err = 0; +-+ s32 err; +-+ u32 bcn_timeout; +- __le32 roamtrigger[2]; +- __le32 roam_delta[2]; +- +-- /* +-- * Setup timeout if Beacons are lost and roam is +-- * off to report link down +-- */ +-- if (brcmf_roamoff) { +-- err = brcmf_fil_iovar_int_set(ifp, "bcn_timeout", bcn_timeout); +-- if (err) { +-- brcmf_err("bcn_timeout error (%d)\n", err); +-- goto dongle_rom_out; +-- } +-+ /* Configure beacon timeout value based upon roaming setting */ +-+ if (brcmf_roamoff) +-+ bcn_timeout = BRCMF_DEFAULT_BCN_TIMEOUT_ROAM_OFF; +-+ else +-+ bcn_timeout = BRCMF_DEFAULT_BCN_TIMEOUT_ROAM_ON; +-+ err = brcmf_fil_iovar_int_set(ifp, "bcn_timeout", bcn_timeout); +-+ if (err) { +-+ brcmf_err("bcn_timeout error (%d)\n", err); +-+ goto roam_setup_done; +- } +- +-- /* +-- * Enable/Disable built-in roaming to allow supplicant +-- * to take care of roaming +-+ /* Enable/Disable built-in roaming to allow supplicant to take care of +-+ * roaming. +- */ +- brcmf_dbg(INFO, "Internal Roaming = %s\n", +- brcmf_roamoff ? "Off" : "On"); +- err = brcmf_fil_iovar_int_set(ifp, "roam_off", !!(brcmf_roamoff)); +- if (err) { +- brcmf_err("roam_off error (%d)\n", err); +-- goto dongle_rom_out; +-+ goto roam_setup_done; +- } +- +- roamtrigger[0] = cpu_to_le32(WL_ROAM_TRIGGER_LEVEL); +-@@ -5342,7 +5339,7 @@ brcmf_dongle_roam(struct brcmf_if *ifp, +- (void *)roamtrigger, sizeof(roamtrigger)); +- if (err) { +- brcmf_err("WLC_SET_ROAM_TRIGGER error (%d)\n", err); +-- goto dongle_rom_out; +-+ goto roam_setup_done; +- } +- +- roam_delta[0] = cpu_to_le32(WL_ROAM_DELTA); +-@@ -5351,10 +5348,10 @@ brcmf_dongle_roam(struct brcmf_if *ifp, +- (void *)roam_delta, sizeof(roam_delta)); +- if (err) { +- brcmf_err("WLC_SET_ROAM_DELTA error (%d)\n", err); +-- goto dongle_rom_out; +-+ goto roam_setup_done; +- } +- +--dongle_rom_out: +-+roam_setup_done: +- return err; +- } +- +-@@ -6069,7 +6066,7 @@ static s32 brcmf_config_dongle(struct br +- brcmf_dbg(INFO, "power save set to %s\n", +- (power_mode ? "enabled" : "disabled")); +- +-- err = brcmf_dongle_roam(ifp, WL_BEACON_TIMEOUT); +-+ err = brcmf_dongle_roam(ifp); +- if (err) +- goto default_conf_out; +- err = brcmf_cfg80211_change_iface(wdev->wiphy, ndev, wdev->iftype, +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.h +-@@ -28,7 +28,6 @@ +- #define WL_EXTRA_BUF_MAX 2048 +- #define WL_ROAM_TRIGGER_LEVEL -75 +- #define WL_ROAM_DELTA 20 +--#define WL_BEACON_TIMEOUT 3 +- +- #define WL_SCAN_CHANNEL_TIME 40 +- #define WL_SCAN_UNASSOC_TIME 40 +-@@ -77,6 +76,9 @@ +- +- #define BRCMF_MAX_DEFAULT_KEYS 4 +- +-+/* beacon loss timeout defaults */ +-+#define BRCMF_DEFAULT_BCN_TIMEOUT_ROAM_ON 2 +-+#define BRCMF_DEFAULT_BCN_TIMEOUT_ROAM_OFF 4 +- +- /** +- * enum brcmf_scan_status - scan engine status +-@@ -178,7 +180,6 @@ struct vif_saved_ie { +- * @ifp: lower layer interface pointer +- * @wdev: wireless device. +- * @profile: profile information. +-- * @roam_off: roaming state. +- * @sme_state: SME state using enum brcmf_vif_status bits. +- * @pm_block: power-management blocked. +- * @list: linked list. +-@@ -189,7 +190,6 @@ struct brcmf_cfg80211_vif { +- struct brcmf_if *ifp; +- struct wireless_dev wdev; +- struct brcmf_cfg80211_profile profile; +-- s32 roam_off; +- unsigned long sme_state; +- bool pm_block; +- struct vif_saved_ie saved_ie; +---- a/drivers/net/wireless/brcm80211/brcmfmac/common.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/common.c +-@@ -29,7 +29,6 @@ +- +- const u8 ALLFFMAC[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; +- +--#define BRCMF_DEFAULT_BCN_TIMEOUT 3 +- #define BRCMF_DEFAULT_SCAN_CHANNEL_TIME 40 +- #define BRCMF_DEFAULT_SCAN_UNASSOC_TIME 40 +- +-@@ -107,26 +106,6 @@ int brcmf_c_preinit_dcmds(struct brcmf_i +- goto done; +- } +- +-- /* +-- * Setup timeout if Beacons are lost and roam is off to report +-- * link down +-- */ +-- err = brcmf_fil_iovar_int_set(ifp, "bcn_timeout", +-- BRCMF_DEFAULT_BCN_TIMEOUT); +-- if (err) { +-- brcmf_err("bcn_timeout error (%d)\n", err); +-- goto done; +-- } +-- +-- /* Enable/Disable build-in roaming to allowed ext supplicant to take +-- * of romaing +-- */ +-- err = brcmf_fil_iovar_int_set(ifp, "roam_off", 1); +-- if (err) { +-- brcmf_err("roam_off error (%d)\n", err); +-- goto done; +-- } +-- +- /* Setup join_pref to select target by RSSI(with boost on 5GHz) */ +- join_pref_params[0].type = BRCMF_JOIN_PREF_RSSI_DELTA; +- join_pref_params[0].len = 2; +diff --git a/package/kernel/mac80211/patches/376-0007-brcmfmac-Add-beamforming-support.patch b/package/kernel/mac80211/patches/376-0007-brcmfmac-Add-beamforming-support.patch +deleted file mode 100644 +index 395166b..0000000 +--- a/package/kernel/mac80211/patches/376-0007-brcmfmac-Add-beamforming-support.patch ++++ /dev/null +@@ -1,115 +0,0 @@ +-From: Hante Meuleman +-Date: Wed, 25 Nov 2015 11:32:43 +0100 +-Subject: [PATCH] brcmfmac: Add beamforming support. +- +-Some devices support beamforming. This patch enables tx beamforming +-if supported and reports beamforming capabilities per channel if +-supported. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-@@ -5671,7 +5671,8 @@ static __le16 brcmf_get_mcs_map(u32 ncha +- } +- +- static void brcmf_update_vht_cap(struct ieee80211_supported_band *band, +-- u32 bw_cap[2], u32 nchain) +-+ u32 bw_cap[2], u32 nchain, u32 txstreams, +-+ u32 txbf_bfe_cap, u32 txbf_bfr_cap) +- { +- __le16 mcs_map; +- +-@@ -5690,6 +5691,25 @@ static void brcmf_update_vht_cap(struct +- mcs_map = brcmf_get_mcs_map(nchain, IEEE80211_VHT_MCS_SUPPORT_0_9); +- band->vht_cap.vht_mcs.rx_mcs_map = mcs_map; +- band->vht_cap.vht_mcs.tx_mcs_map = mcs_map; +-+ +-+ /* Beamforming support information */ +-+ if (txbf_bfe_cap & BRCMF_TXBF_SU_BFE_CAP) +-+ band->vht_cap.cap |= IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE; +-+ if (txbf_bfe_cap & BRCMF_TXBF_MU_BFE_CAP) +-+ band->vht_cap.cap |= IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE; +-+ if (txbf_bfr_cap & BRCMF_TXBF_SU_BFR_CAP) +-+ band->vht_cap.cap |= IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE; +-+ if (txbf_bfr_cap & BRCMF_TXBF_MU_BFR_CAP) +-+ band->vht_cap.cap |= IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE; +-+ +-+ if ((txbf_bfe_cap || txbf_bfr_cap) && (txstreams > 1)) { +-+ band->vht_cap.cap |= +-+ (2 << IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT); +-+ band->vht_cap.cap |= ((txstreams - 1) << +-+ IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_SHIFT); +-+ band->vht_cap.cap |= +-+ IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB; +-+ } +- } +- +- static int brcmf_setup_wiphybands(struct wiphy *wiphy) +-@@ -5704,6 +5724,9 @@ static int brcmf_setup_wiphybands(struct +- int err; +- s32 i; +- struct ieee80211_supported_band *band; +-+ u32 txstreams = 0; +-+ u32 txbf_bfe_cap = 0; +-+ u32 txbf_bfr_cap = 0; +- +- (void)brcmf_fil_iovar_int_get(ifp, "vhtmode", &vhtmode); +- err = brcmf_fil_iovar_int_get(ifp, "nmode", &nmode); +-@@ -5732,6 +5755,14 @@ static int brcmf_setup_wiphybands(struct +- return err; +- } +- +-+ if (vhtmode) { +-+ (void)brcmf_fil_iovar_int_get(ifp, "txstreams", &txstreams); +-+ (void)brcmf_fil_iovar_int_get(ifp, "txbf_bfe_cap", +-+ &txbf_bfe_cap); +-+ (void)brcmf_fil_iovar_int_get(ifp, "txbf_bfr_cap", +-+ &txbf_bfr_cap); +-+ } +-+ +- wiphy = cfg_to_wiphy(cfg); +- for (i = 0; i < ARRAY_SIZE(wiphy->bands); i++) { +- band = wiphy->bands[i]; +-@@ -5741,7 +5772,8 @@ static int brcmf_setup_wiphybands(struct +- if (nmode) +- brcmf_update_ht_cap(band, bw_cap, nchain); +- if (vhtmode) +-- brcmf_update_vht_cap(band, bw_cap, nchain); +-+ brcmf_update_vht_cap(band, bw_cap, nchain, txstreams, +-+ txbf_bfe_cap, txbf_bfr_cap); +- } +- +- return 0; +---- a/drivers/net/wireless/brcm80211/brcmfmac/common.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/common.c +-@@ -153,6 +153,9 @@ int brcmf_c_preinit_dcmds(struct brcmf_i +- goto done; +- } +- +-+ /* Enable tx beamforming, errors can be ignored (not supported) */ +-+ (void)brcmf_fil_iovar_int_set(ifp, "txbf", 1); +-+ +- /* do bus specific preinit here */ +- err = brcmf_bus_preinit(ifp->drvr->bus_if); +- done: +---- a/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h +-@@ -121,6 +121,11 @@ +- +- #define BRCMF_MAX_ASSOCLIST 128 +- +-+#define BRCMF_TXBF_SU_BFE_CAP BIT(0) +-+#define BRCMF_TXBF_MU_BFE_CAP BIT(1) +-+#define BRCMF_TXBF_SU_BFR_CAP BIT(0) +-+#define BRCMF_TXBF_MU_BFR_CAP BIT(1) +-+ +- /* join preference types for join_pref iovar */ +- enum brcmf_join_pref_types { +- BRCMF_JOIN_PREF_RSSI = 1, +diff --git a/package/kernel/mac80211/patches/376-0008-brcmfmac-assure-net_ratelimit-is-declared-before-use.patch b/package/kernel/mac80211/patches/376-0008-brcmfmac-assure-net_ratelimit-is-declared-before-use.patch +deleted file mode 100644 +index d471eb5..0000000 +--- a/package/kernel/mac80211/patches/376-0008-brcmfmac-assure-net_ratelimit-is-declared-before-use.patch ++++ /dev/null +@@ -1,25 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 25 Nov 2015 11:32:45 +0100 +-Subject: [PATCH] brcmfmac: assure net_ratelimit() is declared before use +- +-Under some kernel configuration we get build issue with implicit +-declaration of net_ratelimit() function. Fix this by explicitly +-including the file providing the prototype. +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/debug.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/debug.h +-@@ -17,6 +17,8 @@ +- #ifndef BRCMFMAC_DEBUG_H +- #define BRCMFMAC_DEBUG_H +- +-+#include /* net_ratelimit() */ +-+ +- /* message levels */ +- #define BRCMF_TRACE_VAL 0x00000002 +- #define BRCMF_INFO_VAL 0x00000004 +diff --git a/package/kernel/mac80211/patches/376-0009-brcmfmac-Unify-methods-to-define-and-map-firmware-fi.patch b/package/kernel/mac80211/patches/376-0009-brcmfmac-Unify-methods-to-define-and-map-firmware-fi.patch +deleted file mode 100644 +index 0ec9d10..0000000 +--- a/package/kernel/mac80211/patches/376-0009-brcmfmac-Unify-methods-to-define-and-map-firmware-fi.patch ++++ /dev/null +@@ -1,664 +0,0 @@ +-From: Hante Meuleman +-Date: Wed, 25 Nov 2015 11:32:46 +0100 +-Subject: [PATCH] brcmfmac: Unify methods to define and map firmware files. +- +-All bus drivers (sdio, usb and pcie) require firmware files which +-needs to be downloaded to the device, The definitions and mapping +-of device id and revision to firmware and nvram file is done by +-each bus driver. This patch creates common functions and defines +-to simplify and unify the definition of these firmware and nvram +-files and mapping. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/firmware.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/firmware.c +-@@ -27,9 +27,9 @@ +- #define BRCMF_FW_NVRAM_DEVPATH_LEN 19 /* devpath0=pcie/1/4/ */ +- #define BRCMF_FW_NVRAM_PCIEDEV_LEN 10 /* pcie/1/4/ + \0 */ +- +--char brcmf_firmware_path[BRCMF_FW_PATH_LEN]; +-+static char brcmf_firmware_path[BRCMF_FW_NAME_LEN]; +- module_param_string(alternative_fw_path, brcmf_firmware_path, +-- BRCMF_FW_PATH_LEN, 0440); +-+ BRCMF_FW_NAME_LEN, 0440); +- +- enum nvram_parser_state { +- IDLE, +-@@ -531,3 +531,43 @@ int brcmf_fw_get_firmwares(struct device +- 0); +- } +- +-+int brcmf_fw_map_chip_to_name(u32 chip, u32 chiprev, +-+ struct brcmf_firmware_mapping mapping_table[], +-+ u32 table_size, char fw_name[BRCMF_FW_NAME_LEN], +-+ char nvram_name[BRCMF_FW_NAME_LEN]) +-+{ +-+ u32 i; +-+ char end; +-+ +-+ for (i = 0; i < table_size; i++) { +-+ if (mapping_table[i].chipid == chip && +-+ mapping_table[i].revmask & BIT(chiprev)) +-+ break; +-+ } +-+ +-+ if (i == table_size) { +-+ brcmf_err("Unknown chipid %d [%d]\n", chip, chiprev); +-+ return -ENODEV; +-+ } +-+ +-+ /* check if firmware path is provided by module parameter */ +-+ if (brcmf_firmware_path[0] != '\0') { +-+ strlcpy(fw_name, brcmf_firmware_path, BRCMF_FW_NAME_LEN); +-+ if ((nvram_name) && (mapping_table[i].nvram)) +-+ strlcpy(nvram_name, brcmf_firmware_path, +-+ BRCMF_FW_NAME_LEN); +-+ +-+ end = brcmf_firmware_path[strlen(brcmf_firmware_path) - 1]; +-+ if (end != '/') { +-+ strlcat(fw_name, "/", BRCMF_FW_NAME_LEN); +-+ if ((nvram_name) && (mapping_table[i].nvram)) +-+ strlcat(nvram_name, "/", BRCMF_FW_NAME_LEN); +-+ } +-+ } +-+ strlcat(fw_name, mapping_table[i].fw, BRCMF_FW_NAME_LEN); +-+ if ((nvram_name) && (mapping_table[i].nvram)) +-+ strlcat(nvram_name, mapping_table[i].nvram, BRCMF_FW_NAME_LEN); +-+ +-+ return 0; +-+} +-+ +---- a/drivers/net/wireless/brcm80211/brcmfmac/firmware.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/firmware.h +-@@ -21,11 +21,51 @@ +- #define BRCMF_FW_REQ_FLAGS 0x00F0 +- #define BRCMF_FW_REQ_NV_OPTIONAL 0x0010 +- +--#define BRCMF_FW_PATH_LEN 256 +--#define BRCMF_FW_NAME_LEN 32 +-+#define BRCMF_FW_NAME_LEN 320 +- +--extern char brcmf_firmware_path[]; +-+#define BRCMF_FW_DEFAULT_PATH "brcm/" +- +-+/** +-+ * struct brcmf_firmware_mapping - Used to map chipid/revmask to firmware +-+ * filename and nvram filename. Each bus type implementation should create +-+ * a table of firmware mappings (using the macros defined below). +-+ * +-+ * @chipid: ID of chip. +-+ * @revmask: bitmask of revisions, e.g. 0x10 means rev 4 only, 0xf means rev 0-3 +-+ * @fw: name of the firmware file. +-+ * @nvram: name of nvram file. +-+ */ +-+struct brcmf_firmware_mapping { +-+ u32 chipid; +-+ u32 revmask; +-+ const char *fw; +-+ const char *nvram; +-+}; +-+ +-+#define BRCMF_FW_NVRAM_DEF(fw_nvram_name, fw, nvram) \ +-+static const char BRCM_ ## fw_nvram_name ## _FIRMWARE_NAME[] = \ +-+ BRCMF_FW_DEFAULT_PATH fw; \ +-+static const char BRCM_ ## fw_nvram_name ## _NVRAM_NAME[] = \ +-+ BRCMF_FW_DEFAULT_PATH nvram; \ +-+MODULE_FIRMWARE(BRCMF_FW_DEFAULT_PATH fw); \ +-+MODULE_FIRMWARE(BRCMF_FW_DEFAULT_PATH nvram) +-+ +-+#define BRCMF_FW_DEF(fw_name, fw) \ +-+static const char BRCM_ ## fw_name ## _FIRMWARE_NAME[] = \ +-+ BRCMF_FW_DEFAULT_PATH fw; \ +-+MODULE_FIRMWARE(BRCMF_FW_DEFAULT_PATH fw) \ +-+ +-+#define BRCMF_FW_NVRAM_ENTRY(chipid, mask, name) \ +-+ { chipid, mask, \ +-+ BRCM_ ## name ## _FIRMWARE_NAME, BRCM_ ## name ## _NVRAM_NAME } +-+ +-+#define BRCMF_FW_ENTRY(chipid, mask, name) \ +-+ { chipid, mask, BRCM_ ## name ## _FIRMWARE_NAME, NULL } +-+ +-+int brcmf_fw_map_chip_to_name(u32 chip, u32 chiprev, +-+ struct brcmf_firmware_mapping mapping_table[], +-+ u32 table_size, char fw_name[BRCMF_FW_NAME_LEN], +-+ char nvram_name[BRCMF_FW_NAME_LEN]); +- void brcmf_fw_nvram_free(void *nvram); +- /* +- * Request firmware(s) asynchronously. When the asynchronous request +---- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-@@ -44,25 +44,29 @@ enum brcmf_pcie_state { +- BRCMFMAC_PCIE_STATE_UP +- }; +- +-- +--#define BRCMF_PCIE_43602_FW_NAME "brcm/brcmfmac43602-pcie.bin" +--#define BRCMF_PCIE_43602_NVRAM_NAME "brcm/brcmfmac43602-pcie.txt" +--#define BRCMF_PCIE_4350_FW_NAME "brcm/brcmfmac4350-pcie.bin" +--#define BRCMF_PCIE_4350_NVRAM_NAME "brcm/brcmfmac4350-pcie.txt" +--#define BRCMF_PCIE_4356_FW_NAME "brcm/brcmfmac4356-pcie.bin" +--#define BRCMF_PCIE_4356_NVRAM_NAME "brcm/brcmfmac4356-pcie.txt" +--#define BRCMF_PCIE_43570_FW_NAME "brcm/brcmfmac43570-pcie.bin" +--#define BRCMF_PCIE_43570_NVRAM_NAME "brcm/brcmfmac43570-pcie.txt" +--#define BRCMF_PCIE_4358_FW_NAME "brcm/brcmfmac4358-pcie.bin" +--#define BRCMF_PCIE_4358_NVRAM_NAME "brcm/brcmfmac4358-pcie.txt" +--#define BRCMF_PCIE_4359_FW_NAME "brcm/brcmfmac4359-pcie.bin" +--#define BRCMF_PCIE_4359_NVRAM_NAME "brcm/brcmfmac4359-pcie.txt" +--#define BRCMF_PCIE_4365_FW_NAME "brcm/brcmfmac4365b-pcie.bin" +--#define BRCMF_PCIE_4365_NVRAM_NAME "brcm/brcmfmac4365b-pcie.txt" +--#define BRCMF_PCIE_4366_FW_NAME "brcm/brcmfmac4366b-pcie.bin" +--#define BRCMF_PCIE_4366_NVRAM_NAME "brcm/brcmfmac4366b-pcie.txt" +--#define BRCMF_PCIE_4371_FW_NAME "brcm/brcmfmac4371-pcie.bin" +--#define BRCMF_PCIE_4371_NVRAM_NAME "brcm/brcmfmac4371-pcie.txt" +-+BRCMF_FW_NVRAM_DEF(43602, "brcmfmac43602-pcie.bin", "brcmfmac43602-pcie.txt"); +-+BRCMF_FW_NVRAM_DEF(4350, "brcmfmac4350-pcie.bin", "brcmfmac4350-pcie.txt"); +-+BRCMF_FW_NVRAM_DEF(4356, "brcmfmac4356-pcie.bin", "brcmfmac4356-pcie.txt"); +-+BRCMF_FW_NVRAM_DEF(43570, "brcmfmac43570-pcie.bin", "brcmfmac43570-pcie.txt"); +-+BRCMF_FW_NVRAM_DEF(4358, "brcmfmac4358-pcie.bin", "brcmfmac4358-pcie.txt"); +-+BRCMF_FW_NVRAM_DEF(4359, "brcmfmac4359-pcie.bin", "brcmfmac4359-pcie.txt"); +-+BRCMF_FW_NVRAM_DEF(4365B, "brcmfmac4365b-pcie.bin", "brcmfmac4365b-pcie.txt"); +-+BRCMF_FW_NVRAM_DEF(4366B, "brcmfmac4366b-pcie.bin", "brcmfmac4366b-pcie.txt"); +-+BRCMF_FW_NVRAM_DEF(4371, "brcmfmac4371-pcie.bin", "brcmfmac4371-pcie.txt"); +-+ +-+static struct brcmf_firmware_mapping brcmf_pcie_fwnames[] = { +-+ BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43602_CHIP_ID, 0xFFFFFFFF, 43602), +-+ BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4350_CHIP_ID, 0xFFFFFFFF, 4350), +-+ BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4356_CHIP_ID, 0xFFFFFFFF, 4356), +-+ BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43567_CHIP_ID, 0xFFFFFFFF, 43570), +-+ BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43569_CHIP_ID, 0xFFFFFFFF, 43570), +-+ BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43570_CHIP_ID, 0xFFFFFFFF, 43570), +-+ BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4358_CHIP_ID, 0xFFFFFFFF, 4358), +-+ BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4359_CHIP_ID, 0xFFFFFFFF, 4359), +-+ BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4365_CHIP_ID, 0xFFFFFFFF, 4365B), +-+ BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4366_CHIP_ID, 0xFFFFFFFF, 4366B), +-+ BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4371_CHIP_ID, 0xFFFFFFFF, 4371), +-+}; +- +- #define BRCMF_PCIE_FW_UP_TIMEOUT 2000 /* msec */ +- +-@@ -202,26 +206,6 @@ enum brcmf_pcie_state { +- #define BRCMF_PCIE_LINK_STATUS_CTRL_ASPM_ENAB 3 +- +- +--MODULE_FIRMWARE(BRCMF_PCIE_43602_FW_NAME); +--MODULE_FIRMWARE(BRCMF_PCIE_43602_NVRAM_NAME); +--MODULE_FIRMWARE(BRCMF_PCIE_4350_FW_NAME); +--MODULE_FIRMWARE(BRCMF_PCIE_4350_NVRAM_NAME); +--MODULE_FIRMWARE(BRCMF_PCIE_4356_FW_NAME); +--MODULE_FIRMWARE(BRCMF_PCIE_4356_NVRAM_NAME); +--MODULE_FIRMWARE(BRCMF_PCIE_43570_FW_NAME); +--MODULE_FIRMWARE(BRCMF_PCIE_43570_NVRAM_NAME); +--MODULE_FIRMWARE(BRCMF_PCIE_4358_FW_NAME); +--MODULE_FIRMWARE(BRCMF_PCIE_4358_NVRAM_NAME); +--MODULE_FIRMWARE(BRCMF_PCIE_4359_FW_NAME); +--MODULE_FIRMWARE(BRCMF_PCIE_4359_NVRAM_NAME); +--MODULE_FIRMWARE(BRCMF_PCIE_4365_FW_NAME); +--MODULE_FIRMWARE(BRCMF_PCIE_4365_NVRAM_NAME); +--MODULE_FIRMWARE(BRCMF_PCIE_4366_FW_NAME); +--MODULE_FIRMWARE(BRCMF_PCIE_4366_NVRAM_NAME); +--MODULE_FIRMWARE(BRCMF_PCIE_4371_FW_NAME); +--MODULE_FIRMWARE(BRCMF_PCIE_4371_NVRAM_NAME); +-- +-- +- struct brcmf_pcie_console { +- u32 base_addr; +- u32 buf_addr; +-@@ -258,8 +242,8 @@ struct brcmf_pciedev_info { +- enum brcmf_pcie_state state; +- bool in_irq; +- struct pci_dev *pdev; +-- char fw_name[BRCMF_FW_PATH_LEN + BRCMF_FW_NAME_LEN]; +-- char nvram_name[BRCMF_FW_PATH_LEN + BRCMF_FW_NAME_LEN]; +-+ char fw_name[BRCMF_FW_NAME_LEN]; +-+ char nvram_name[BRCMF_FW_NAME_LEN]; +- void __iomem *regs; +- void __iomem *tcm; +- u32 tcm_size; +-@@ -1478,84 +1462,6 @@ brcmf_pcie_init_share_ram_info(struct br +- } +- +- +--static int brcmf_pcie_get_fwnames(struct brcmf_pciedev_info *devinfo) +--{ +-- char *fw_name; +-- char *nvram_name; +-- uint fw_len, nv_len; +-- char end; +-- +-- brcmf_dbg(PCIE, "Enter, chip 0x%04x chiprev %d\n", devinfo->ci->chip, +-- devinfo->ci->chiprev); +-- +-- switch (devinfo->ci->chip) { +-- case BRCM_CC_43602_CHIP_ID: +-- fw_name = BRCMF_PCIE_43602_FW_NAME; +-- nvram_name = BRCMF_PCIE_43602_NVRAM_NAME; +-- break; +-- case BRCM_CC_4350_CHIP_ID: +-- fw_name = BRCMF_PCIE_4350_FW_NAME; +-- nvram_name = BRCMF_PCIE_4350_NVRAM_NAME; +-- break; +-- case BRCM_CC_4356_CHIP_ID: +-- fw_name = BRCMF_PCIE_4356_FW_NAME; +-- nvram_name = BRCMF_PCIE_4356_NVRAM_NAME; +-- break; +-- case BRCM_CC_43567_CHIP_ID: +-- case BRCM_CC_43569_CHIP_ID: +-- case BRCM_CC_43570_CHIP_ID: +-- fw_name = BRCMF_PCIE_43570_FW_NAME; +-- nvram_name = BRCMF_PCIE_43570_NVRAM_NAME; +-- break; +-- case BRCM_CC_4358_CHIP_ID: +-- fw_name = BRCMF_PCIE_4358_FW_NAME; +-- nvram_name = BRCMF_PCIE_4358_NVRAM_NAME; +-- break; +-- case BRCM_CC_4359_CHIP_ID: +-- fw_name = BRCMF_PCIE_4359_FW_NAME; +-- nvram_name = BRCMF_PCIE_4359_NVRAM_NAME; +-- break; +-- case BRCM_CC_4365_CHIP_ID: +-- fw_name = BRCMF_PCIE_4365_FW_NAME; +-- nvram_name = BRCMF_PCIE_4365_NVRAM_NAME; +-- break; +-- case BRCM_CC_4366_CHIP_ID: +-- fw_name = BRCMF_PCIE_4366_FW_NAME; +-- nvram_name = BRCMF_PCIE_4366_NVRAM_NAME; +-- break; +-- case BRCM_CC_4371_CHIP_ID: +-- fw_name = BRCMF_PCIE_4371_FW_NAME; +-- nvram_name = BRCMF_PCIE_4371_NVRAM_NAME; +-- break; +-- default: +-- brcmf_err("Unsupported chip 0x%04x\n", devinfo->ci->chip); +-- return -ENODEV; +-- } +-- +-- fw_len = sizeof(devinfo->fw_name) - 1; +-- nv_len = sizeof(devinfo->nvram_name) - 1; +-- /* check if firmware path is provided by module parameter */ +-- if (brcmf_firmware_path[0] != '\0') { +-- strncpy(devinfo->fw_name, brcmf_firmware_path, fw_len); +-- strncpy(devinfo->nvram_name, brcmf_firmware_path, nv_len); +-- fw_len -= strlen(devinfo->fw_name); +-- nv_len -= strlen(devinfo->nvram_name); +-- +-- end = brcmf_firmware_path[strlen(brcmf_firmware_path) - 1]; +-- if (end != '/') { +-- strncat(devinfo->fw_name, "/", fw_len); +-- strncat(devinfo->nvram_name, "/", nv_len); +-- fw_len--; +-- nv_len--; +-- } +-- } +-- strncat(devinfo->fw_name, fw_name, fw_len); +-- strncat(devinfo->nvram_name, nvram_name, nv_len); +-- +-- return 0; +--} +-- +-- +- static int brcmf_pcie_download_fw_nvram(struct brcmf_pciedev_info *devinfo, +- const struct firmware *fw, void *nvram, +- u32 nvram_len) +-@@ -1891,7 +1797,10 @@ brcmf_pcie_probe(struct pci_dev *pdev, c +- bus->wowl_supported = pci_pme_capable(pdev, PCI_D3hot); +- dev_set_drvdata(&pdev->dev, bus); +- +-- ret = brcmf_pcie_get_fwnames(devinfo); +-+ ret = brcmf_fw_map_chip_to_name(devinfo->ci->chip, devinfo->ci->chiprev, +-+ brcmf_pcie_fwnames, +-+ ARRAY_SIZE(brcmf_pcie_fwnames), +-+ devinfo->fw_name, devinfo->nvram_name); +- if (ret) +- goto fail_bus; +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-@@ -596,136 +596,41 @@ static const struct sdiod_drive_str sdio +- {4, 0x1} +- }; +- +--#define BCM43143_FIRMWARE_NAME "brcm/brcmfmac43143-sdio.bin" +--#define BCM43143_NVRAM_NAME "brcm/brcmfmac43143-sdio.txt" +--#define BCM43241B0_FIRMWARE_NAME "brcm/brcmfmac43241b0-sdio.bin" +--#define BCM43241B0_NVRAM_NAME "brcm/brcmfmac43241b0-sdio.txt" +--#define BCM43241B4_FIRMWARE_NAME "brcm/brcmfmac43241b4-sdio.bin" +--#define BCM43241B4_NVRAM_NAME "brcm/brcmfmac43241b4-sdio.txt" +--#define BCM43241B5_FIRMWARE_NAME "brcm/brcmfmac43241b5-sdio.bin" +--#define BCM43241B5_NVRAM_NAME "brcm/brcmfmac43241b5-sdio.txt" +--#define BCM4329_FIRMWARE_NAME "brcm/brcmfmac4329-sdio.bin" +--#define BCM4329_NVRAM_NAME "brcm/brcmfmac4329-sdio.txt" +--#define BCM4330_FIRMWARE_NAME "brcm/brcmfmac4330-sdio.bin" +--#define BCM4330_NVRAM_NAME "brcm/brcmfmac4330-sdio.txt" +--#define BCM4334_FIRMWARE_NAME "brcm/brcmfmac4334-sdio.bin" +--#define BCM4334_NVRAM_NAME "brcm/brcmfmac4334-sdio.txt" +--#define BCM43340_FIRMWARE_NAME "brcm/brcmfmac43340-sdio.bin" +--#define BCM43340_NVRAM_NAME "brcm/brcmfmac43340-sdio.txt" +--#define BCM4335_FIRMWARE_NAME "brcm/brcmfmac4335-sdio.bin" +--#define BCM4335_NVRAM_NAME "brcm/brcmfmac4335-sdio.txt" +--#define BCM43362_FIRMWARE_NAME "brcm/brcmfmac43362-sdio.bin" +--#define BCM43362_NVRAM_NAME "brcm/brcmfmac43362-sdio.txt" +--#define BCM4339_FIRMWARE_NAME "brcm/brcmfmac4339-sdio.bin" +--#define BCM4339_NVRAM_NAME "brcm/brcmfmac4339-sdio.txt" +--#define BCM43430_FIRMWARE_NAME "brcm/brcmfmac43430-sdio.bin" +--#define BCM43430_NVRAM_NAME "brcm/brcmfmac43430-sdio.txt" +--#define BCM43455_FIRMWARE_NAME "brcm/brcmfmac43455-sdio.bin" +--#define BCM43455_NVRAM_NAME "brcm/brcmfmac43455-sdio.txt" +--#define BCM4354_FIRMWARE_NAME "brcm/brcmfmac4354-sdio.bin" +--#define BCM4354_NVRAM_NAME "brcm/brcmfmac4354-sdio.txt" +-- +--MODULE_FIRMWARE(BCM43143_FIRMWARE_NAME); +--MODULE_FIRMWARE(BCM43143_NVRAM_NAME); +--MODULE_FIRMWARE(BCM43241B0_FIRMWARE_NAME); +--MODULE_FIRMWARE(BCM43241B0_NVRAM_NAME); +--MODULE_FIRMWARE(BCM43241B4_FIRMWARE_NAME); +--MODULE_FIRMWARE(BCM43241B4_NVRAM_NAME); +--MODULE_FIRMWARE(BCM43241B5_FIRMWARE_NAME); +--MODULE_FIRMWARE(BCM43241B5_NVRAM_NAME); +--MODULE_FIRMWARE(BCM4329_FIRMWARE_NAME); +--MODULE_FIRMWARE(BCM4329_NVRAM_NAME); +--MODULE_FIRMWARE(BCM4330_FIRMWARE_NAME); +--MODULE_FIRMWARE(BCM4330_NVRAM_NAME); +--MODULE_FIRMWARE(BCM4334_FIRMWARE_NAME); +--MODULE_FIRMWARE(BCM4334_NVRAM_NAME); +--MODULE_FIRMWARE(BCM43340_FIRMWARE_NAME); +--MODULE_FIRMWARE(BCM43340_NVRAM_NAME); +--MODULE_FIRMWARE(BCM4335_FIRMWARE_NAME); +--MODULE_FIRMWARE(BCM4335_NVRAM_NAME); +--MODULE_FIRMWARE(BCM43362_FIRMWARE_NAME); +--MODULE_FIRMWARE(BCM43362_NVRAM_NAME); +--MODULE_FIRMWARE(BCM4339_FIRMWARE_NAME); +--MODULE_FIRMWARE(BCM4339_NVRAM_NAME); +--MODULE_FIRMWARE(BCM43430_FIRMWARE_NAME); +--MODULE_FIRMWARE(BCM43430_NVRAM_NAME); +--MODULE_FIRMWARE(BCM43455_FIRMWARE_NAME); +--MODULE_FIRMWARE(BCM43455_NVRAM_NAME); +--MODULE_FIRMWARE(BCM4354_FIRMWARE_NAME); +--MODULE_FIRMWARE(BCM4354_NVRAM_NAME); +-- +--struct brcmf_firmware_names { +-- u32 chipid; +-- u32 revmsk; +-- const char *bin; +-- const char *nv; +-+BRCMF_FW_NVRAM_DEF(43143, "brcmfmac43143-sdio.bin", "brcmfmac43143-sdio.txt"); +-+BRCMF_FW_NVRAM_DEF(43241B0, "brcmfmac43241b0-sdio.bin", +-+ "brcmfmac43241b0-sdio.txt"); +-+BRCMF_FW_NVRAM_DEF(43241B4, "brcmfmac43241b4-sdio.bin", +-+ "brcmfmac43241b4-sdio.txt"); +-+BRCMF_FW_NVRAM_DEF(43241B5, "brcmfmac43241b5-sdio.bin", +-+ "brcmfmac43241b5-sdio.txt"); +-+BRCMF_FW_NVRAM_DEF(4329, "brcmfmac4329-sdio.bin", "brcmfmac4329-sdio.txt"); +-+BRCMF_FW_NVRAM_DEF(4330, "brcmfmac4330-sdio.bin", "brcmfmac4330-sdio.txt"); +-+BRCMF_FW_NVRAM_DEF(4334, "brcmfmac4334-sdio.bin", "brcmfmac4334-sdio.txt"); +-+BRCMF_FW_NVRAM_DEF(43340, "brcmfmac43340-sdio.bin", "brcmfmac43340-sdio.txt"); +-+BRCMF_FW_NVRAM_DEF(4335, "brcmfmac4335-sdio.bin", "brcmfmac4335-sdio.txt"); +-+BRCMF_FW_NVRAM_DEF(43362, "brcmfmac43362-sdio.bin", "brcmfmac43362-sdio.txt"); +-+BRCMF_FW_NVRAM_DEF(4339, "brcmfmac4339-sdio.bin", "brcmfmac4339-sdio.txt"); +-+BRCMF_FW_NVRAM_DEF(43430, "brcmfmac43430-sdio.bin", "brcmfmac43430-sdio.txt"); +-+BRCMF_FW_NVRAM_DEF(43455, "brcmfmac43455-sdio.bin", "brcmfmac43455-sdio.txt"); +-+BRCMF_FW_NVRAM_DEF(4354, "brcmfmac4354-sdio.bin", "brcmfmac4354-sdio.txt"); +-+ +-+static struct brcmf_firmware_mapping brcmf_sdio_fwnames[] = { +-+ BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43143_CHIP_ID, 0xFFFFFFFF, 43143), +-+ BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43241_CHIP_ID, 0x0000001F, 43241B0), +-+ BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43241_CHIP_ID, 0x00000020, 43241B4), +-+ BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43241_CHIP_ID, 0xFFFFFFC0, 43241B5), +-+ BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4329_CHIP_ID, 0xFFFFFFFF, 4329), +-+ BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4330_CHIP_ID, 0xFFFFFFFF, 4330), +-+ BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4334_CHIP_ID, 0xFFFFFFFF, 4334), +-+ BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43340_CHIP_ID, 0xFFFFFFFF, 43340), +-+ BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4335_CHIP_ID, 0xFFFFFFFF, 4335), +-+ BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43362_CHIP_ID, 0xFFFFFFFE, 43362), +-+ BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4339_CHIP_ID, 0xFFFFFFFF, 4339), +-+ BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43430_CHIP_ID, 0xFFFFFFFF, 43430), +-+ BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4345_CHIP_ID, 0xFFFFFFC0, 43455), +-+ BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4354_CHIP_ID, 0xFFFFFFFF, 4354) +- }; +- +--enum brcmf_firmware_type { +-- BRCMF_FIRMWARE_BIN, +-- BRCMF_FIRMWARE_NVRAM +--}; +-- +--#define BRCMF_FIRMWARE_NVRAM(name) \ +-- name ## _FIRMWARE_NAME, name ## _NVRAM_NAME +-- +--static const struct brcmf_firmware_names brcmf_fwname_data[] = { +-- { BRCM_CC_43143_CHIP_ID, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM43143) }, +-- { BRCM_CC_43241_CHIP_ID, 0x0000001F, BRCMF_FIRMWARE_NVRAM(BCM43241B0) }, +-- { BRCM_CC_43241_CHIP_ID, 0x00000020, BRCMF_FIRMWARE_NVRAM(BCM43241B4) }, +-- { BRCM_CC_43241_CHIP_ID, 0xFFFFFFC0, BRCMF_FIRMWARE_NVRAM(BCM43241B5) }, +-- { BRCM_CC_4329_CHIP_ID, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4329) }, +-- { BRCM_CC_4330_CHIP_ID, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4330) }, +-- { BRCM_CC_4334_CHIP_ID, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4334) }, +-- { BRCM_CC_43340_CHIP_ID, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM43340) }, +-- { BRCM_CC_4335_CHIP_ID, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4335) }, +-- { BRCM_CC_43362_CHIP_ID, 0xFFFFFFFE, BRCMF_FIRMWARE_NVRAM(BCM43362) }, +-- { BRCM_CC_4339_CHIP_ID, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4339) }, +-- { BRCM_CC_43430_CHIP_ID, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM43430) }, +-- { BRCM_CC_4345_CHIP_ID, 0xFFFFFFC0, BRCMF_FIRMWARE_NVRAM(BCM43455) }, +-- { BRCM_CC_4354_CHIP_ID, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4354) } +--}; +-- +--static int brcmf_sdio_get_fwnames(struct brcmf_chip *ci, +-- struct brcmf_sdio_dev *sdiodev) +--{ +-- int i; +-- char end; +-- +-- for (i = 0; i < ARRAY_SIZE(brcmf_fwname_data); i++) { +-- if (brcmf_fwname_data[i].chipid == ci->chip && +-- brcmf_fwname_data[i].revmsk & BIT(ci->chiprev)) +-- break; +-- } +-- +-- if (i == ARRAY_SIZE(brcmf_fwname_data)) { +-- brcmf_err("Unknown chipid %d [%d]\n", ci->chip, ci->chiprev); +-- return -ENODEV; +-- } +-- +-- /* check if firmware path is provided by module parameter */ +-- if (brcmf_firmware_path[0] != '\0') { +-- strlcpy(sdiodev->fw_name, brcmf_firmware_path, +-- sizeof(sdiodev->fw_name)); +-- strlcpy(sdiodev->nvram_name, brcmf_firmware_path, +-- sizeof(sdiodev->nvram_name)); +-- +-- end = brcmf_firmware_path[strlen(brcmf_firmware_path) - 1]; +-- if (end != '/') { +-- strlcat(sdiodev->fw_name, "/", +-- sizeof(sdiodev->fw_name)); +-- strlcat(sdiodev->nvram_name, "/", +-- sizeof(sdiodev->nvram_name)); +-- } +-- } +-- strlcat(sdiodev->fw_name, brcmf_fwname_data[i].bin, +-- sizeof(sdiodev->fw_name)); +-- strlcat(sdiodev->nvram_name, brcmf_fwname_data[i].nv, +-- sizeof(sdiodev->nvram_name)); +-- +-- return 0; +--} +-- +- static void pkt_align(struct sk_buff *p, int len, int align) +- { +- uint datalign; +-@@ -4252,7 +4157,10 @@ struct brcmf_sdio *brcmf_sdio_probe(stru +- brcmf_sdio_debugfs_create(bus); +- brcmf_dbg(INFO, "completed!!\n"); +- +-- ret = brcmf_sdio_get_fwnames(bus->ci, sdiodev); +-+ ret = brcmf_fw_map_chip_to_name(bus->ci->chip, bus->ci->chiprev, +-+ brcmf_sdio_fwnames, +-+ ARRAY_SIZE(brcmf_sdio_fwnames), +-+ sdiodev->fw_name, sdiodev->nvram_name); +- if (ret) +- goto fail; +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.h +-@@ -195,8 +195,8 @@ struct brcmf_sdio_dev { +- uint max_segment_size; +- uint txglomsz; +- struct sg_table sgtable; +-- char fw_name[BRCMF_FW_PATH_LEN + BRCMF_FW_NAME_LEN]; +-- char nvram_name[BRCMF_FW_PATH_LEN + BRCMF_FW_NAME_LEN]; +-+ char fw_name[BRCMF_FW_NAME_LEN]; +-+ char nvram_name[BRCMF_FW_NAME_LEN]; +- bool wowl_enabled; +- enum brcmf_sdiod_state state; +- struct brcmf_sdiod_freezer *freezer; +---- a/drivers/net/wireless/brcm80211/brcmfmac/usb.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/usb.c +-@@ -43,10 +43,20 @@ +- #define BRCMF_USB_CBCTL_READ 1 +- #define BRCMF_USB_MAX_PKT_SIZE 1600 +- +--#define BRCMF_USB_43143_FW_NAME "brcm/brcmfmac43143.bin" +--#define BRCMF_USB_43236_FW_NAME "brcm/brcmfmac43236b.bin" +--#define BRCMF_USB_43242_FW_NAME "brcm/brcmfmac43242a.bin" +--#define BRCMF_USB_43569_FW_NAME "brcm/brcmfmac43569.bin" +-+BRCMF_FW_DEF(43143, "brcmfmac43143.bin"); +-+BRCMF_FW_DEF(43236B, "brcmfmac43236b.bin"); +-+BRCMF_FW_DEF(43242A, "brcmfmac43242a.bin"); +-+BRCMF_FW_DEF(43569, "brcmfmac43569.bin"); +-+ +-+static struct brcmf_firmware_mapping brcmf_usb_fwnames[] = { +-+ BRCMF_FW_ENTRY(BRCM_CC_43143_CHIP_ID, 0xFFFFFFFF, 43143), +-+ BRCMF_FW_ENTRY(BRCM_CC_43235_CHIP_ID, 0x00000008, 43236B), +-+ BRCMF_FW_ENTRY(BRCM_CC_43236_CHIP_ID, 0x00000008, 43236B), +-+ BRCMF_FW_ENTRY(BRCM_CC_43238_CHIP_ID, 0x00000008, 43236B), +-+ BRCMF_FW_ENTRY(BRCM_CC_43242_CHIP_ID, 0xFFFFFFFF, 43242A), +-+ BRCMF_FW_ENTRY(BRCM_CC_43566_CHIP_ID, 0xFFFFFFFF, 43569), +-+ BRCMF_FW_ENTRY(BRCM_CC_43569_CHIP_ID, 0xFFFFFFFF, 43569) +-+}; +- +- #define TRX_MAGIC 0x30524448 /* "HDR0" */ +- #define TRX_MAX_OFFSET 3 /* Max number of file offsets */ +-@@ -139,6 +149,7 @@ struct brcmf_usbdev_info { +- struct brcmf_usbreq *tx_reqs; +- struct brcmf_usbreq *rx_reqs; +- +-+ char fw_name[BRCMF_FW_NAME_LEN]; +- const u8 *image; /* buffer for combine fw and nvram */ +- int image_len; +- +-@@ -983,45 +994,15 @@ static int brcmf_usb_dlrun(struct brcmf_ +- return 0; +- } +- +--static bool brcmf_usb_chip_support(int chipid, int chiprev) +--{ +-- switch(chipid) { +-- case BRCM_CC_43143_CHIP_ID: +-- return true; +-- case BRCM_CC_43235_CHIP_ID: +-- case BRCM_CC_43236_CHIP_ID: +-- case BRCM_CC_43238_CHIP_ID: +-- return (chiprev == 3); +-- case BRCM_CC_43242_CHIP_ID: +-- return true; +-- case BRCM_CC_43566_CHIP_ID: +-- case BRCM_CC_43569_CHIP_ID: +-- return true; +-- default: +-- break; +-- } +-- return false; +--} +-- +- static int +- brcmf_usb_fw_download(struct brcmf_usbdev_info *devinfo) +- { +-- int devid, chiprev; +- int err; +- +- brcmf_dbg(USB, "Enter\n"); +- if (devinfo == NULL) +- return -ENODEV; +- +-- devid = devinfo->bus_pub.devid; +-- chiprev = devinfo->bus_pub.chiprev; +-- +-- if (!brcmf_usb_chip_support(devid, chiprev)) { +-- brcmf_err("unsupported chip %d rev %d\n", +-- devid, chiprev); +-- return -EINVAL; +-- } +-- +- if (!devinfo->image) { +- brcmf_err("No firmware!\n"); +- return -ENOENT; +-@@ -1071,25 +1052,6 @@ static int check_file(const u8 *headers) +- return -1; +- } +- +--static const char *brcmf_usb_get_fwname(struct brcmf_usbdev_info *devinfo) +--{ +-- switch (devinfo->bus_pub.devid) { +-- case BRCM_CC_43143_CHIP_ID: +-- return BRCMF_USB_43143_FW_NAME; +-- case BRCM_CC_43235_CHIP_ID: +-- case BRCM_CC_43236_CHIP_ID: +-- case BRCM_CC_43238_CHIP_ID: +-- return BRCMF_USB_43236_FW_NAME; +-- case BRCM_CC_43242_CHIP_ID: +-- return BRCMF_USB_43242_FW_NAME; +-- case BRCM_CC_43566_CHIP_ID: +-- case BRCM_CC_43569_CHIP_ID: +-- return BRCMF_USB_43569_FW_NAME; +-- default: +-- return NULL; +-- } +--} +-- +- +- static +- struct brcmf_usbdev *brcmf_usb_attach(struct brcmf_usbdev_info *devinfo, +-@@ -1274,9 +1236,16 @@ static int brcmf_usb_probe_cb(struct brc +- bus->chip = bus_pub->devid; +- bus->chiprev = bus_pub->chiprev; +- +-+ ret = brcmf_fw_map_chip_to_name(bus_pub->devid, bus_pub->chiprev, +-+ brcmf_usb_fwnames, +-+ ARRAY_SIZE(brcmf_usb_fwnames), +-+ devinfo->fw_name, NULL); +-+ if (ret) +-+ goto fail; +-+ +- /* request firmware here */ +-- ret = brcmf_fw_get_firmwares(dev, 0, brcmf_usb_get_fwname(devinfo), +-- NULL, brcmf_usb_probe_phase2); +-+ ret = brcmf_fw_get_firmwares(dev, 0, devinfo->fw_name, NULL, +-+ brcmf_usb_probe_phase2); +- if (ret) { +- brcmf_err("firmware request failed: %d\n", ret); +- goto fail; +-@@ -1472,8 +1441,7 @@ static int brcmf_usb_reset_resume(struct +- +- brcmf_dbg(USB, "Enter\n"); +- +-- return brcmf_fw_get_firmwares(&usb->dev, 0, +-- brcmf_usb_get_fwname(devinfo), NULL, +-+ return brcmf_fw_get_firmwares(&usb->dev, 0, devinfo->fw_name, NULL, +- brcmf_usb_probe_phase2); +- } +- +-@@ -1491,10 +1459,6 @@ static struct usb_device_id brcmf_usb_de +- }; +- +- MODULE_DEVICE_TABLE(usb, brcmf_usb_devid_table); +--MODULE_FIRMWARE(BRCMF_USB_43143_FW_NAME); +--MODULE_FIRMWARE(BRCMF_USB_43236_FW_NAME); +--MODULE_FIRMWARE(BRCMF_USB_43242_FW_NAME); +--MODULE_FIRMWARE(BRCMF_USB_43569_FW_NAME); +- +- static struct usb_driver brcmf_usbdrvr = { +- .name = KBUILD_MODNAME, +diff --git a/package/kernel/mac80211/patches/376-0010-brcmfmac-Fix-double-free-on-exception-at-module-load.patch b/package/kernel/mac80211/patches/376-0010-brcmfmac-Fix-double-free-on-exception-at-module-load.patch +deleted file mode 100644 +index 2174d09..0000000 +--- a/package/kernel/mac80211/patches/376-0010-brcmfmac-Fix-double-free-on-exception-at-module-load.patch ++++ /dev/null +@@ -1,22 +0,0 @@ +-From: Hante Meuleman +-Date: Wed, 25 Nov 2015 11:32:47 +0100 +-Subject: [PATCH] brcmfmac: Fix double free on exception at module load. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c +-@@ -1083,6 +1083,8 @@ fail: +- brcmf_net_detach(ifp->ndev); +- if (p2p_ifp) +- brcmf_net_detach(p2p_ifp->ndev); +-+ drvr->iflist[0] = NULL; +-+ drvr->iflist[1] = NULL; +- return ret; +- } +- return 0; +diff --git a/package/kernel/mac80211/patches/377-brcmfmac-only-lock-and-unlock-fws-if-fws-is-not-null.patch b/package/kernel/mac80211/patches/377-brcmfmac-only-lock-and-unlock-fws-if-fws-is-not-null.patch +deleted file mode 100644 +index 8ec1441..0000000 +--- a/package/kernel/mac80211/patches/377-brcmfmac-only-lock-and-unlock-fws-if-fws-is-not-null.patch ++++ /dev/null +@@ -1,30 +0,0 @@ +-From: Colin Ian King +-Date: Wed, 2 Dec 2015 11:45:10 +0000 +-Subject: [PATCH] brcmfmac: only lock and unlock fws if fws is not null +- +-There is a null ptr check for fws to set bcmc_credit_check, however, +-there a lock and unlock on fws should only performed if fwts is +-also not null to also avoid a potential null pointer deference. +- +-Signed-off-by: Colin Ian King +-Acked-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c +-@@ -1609,10 +1609,11 @@ static int brcmf_fws_notify_bcmc_credit_ +- { +- struct brcmf_fws_info *fws = ifp->drvr->fws; +- +-- brcmf_fws_lock(fws); +-- if (fws) +-+ if (fws) { +-+ brcmf_fws_lock(fws); +- fws->bcmc_credit_check = true; +-- brcmf_fws_unlock(fws); +-+ brcmf_fws_unlock(fws); +-+ } +- return 0; +- } +- diff --git a/package/kernel/mac80211/patches/400-ath_move_debug_code.patch b/package/kernel/mac80211/patches/400-ath_move_debug_code.patch index 298f722..72e9a41 100644 --- a/package/kernel/mac80211/patches/400-ath_move_debug_code.patch @@ -23368,19 +29336,120 @@ index ac58dba..dd82ce5 100644 hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN; +diff --git a/package/kernel/mac80211/patches/860-brcmfmac-use-bcm47xx-platform-NVRAM-as-fallback.patch b/package/kernel/mac80211/patches/860-brcmfmac-use-bcm47xx-platform-NVRAM-as-fallback.patch +index 44bb779..dbfb158 100644 +--- a/package/kernel/mac80211/patches/860-brcmfmac-use-bcm47xx-platform-NVRAM-as-fallback.patch ++++ b/package/kernel/mac80211/patches/860-brcmfmac-use-bcm47xx-platform-NVRAM-as-fallback.patch +@@ -69,9 +69,9 @@ Signed-off-by: Rafał Miłecki + } + --- a/drivers/net/wireless/brcm80211/brcmfmac/debug.h + +++ b/drivers/net/wireless/brcm80211/brcmfmac/debug.h +-@@ -19,6 +19,8 @@ +- +- #include /* net_ratelimit() */ ++@@ -17,6 +17,8 @@ ++ #ifndef BRCMFMAC_DEBUG_H ++ #define BRCMFMAC_DEBUG_H + + +#include + + +diff --git a/package/kernel/mac80211/patches/861-brcmfmac-register-wiphy-s-during-module_init.patch b/package/kernel/mac80211/patches/861-brcmfmac-register-wiphy-s-during-module_init.patch +index 14f8a00..685a5f9 100644 +--- a/package/kernel/mac80211/patches/861-brcmfmac-register-wiphy-s-during-module_init.patch ++++ b/package/kernel/mac80211/patches/861-brcmfmac-register-wiphy-s-during-module_init.patch +@@ -13,7 +13,7 @@ Signed-off-by: Rafał Miłecki + + --- a/drivers/net/wireless/brcm80211/brcmfmac/core.c + +++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c +-@@ -1226,6 +1226,7 @@ static int __init brcmfmac_module_init(v ++@@ -1213,6 +1213,7 @@ static int __init brcmfmac_module_init(v + #endif + if (!schedule_work(&brcmf_driver_work)) + return -EBUSY; diff --git a/package/kernel/mac80211/patches/862-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch b/package/kernel/mac80211/patches/862-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch -index 1cba2b3..5fdfa37 100644 +index 32c4a6f..5fdfa37 100644 --- a/package/kernel/mac80211/patches/862-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch +++ b/package/kernel/mac80211/patches/862-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch @@ -10,7 +10,7 @@ Signed-off-by: Rafał Miłecki --- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c --@@ -691,9 +691,37 @@ static struct wireless_dev *brcmf_cfg802 +-@@ -608,9 +608,37 @@ static struct wireless_dev *brcmf_cfg802 +@@ -692,9 +692,37 @@ static struct wireless_dev *brcmf_cfg802 u32 *flags, struct vif_params *params) { +diff --git a/package/kernel/mac80211/patches/863-brcmfmac-fix-setting-primary-channel-for-80-MHz-widt.patch b/package/kernel/mac80211/patches/863-brcmfmac-fix-setting-primary-channel-for-80-MHz-widt.patch +deleted file mode 100644 +index d6b9e37..0000000 +--- a/package/kernel/mac80211/patches/863-brcmfmac-fix-setting-primary-channel-for-80-MHz-widt.patch ++++ /dev/null +@@ -1,65 +0,0 @@ +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Wed, 20 Jan 2016 16:35:12 +0100 +-Subject: [PATCH] brcmfmac: fix setting primary channel for 80 MHz width +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-First of all it changes the way we calculate primary channel offset. If +-we use e.g. 80 MHz channel with primary frequency 5180 MHz (which means +-center frequency is 5210 MHz) it makes sense to calculate primary offset +-as -30 MHz. +-Then it fixes values we compare primary_offset with. We were comparing +-offset in MHz against -2 or 2 which was resulting in picking a wrong +-primary channel. +- +-Signed-off-by: Rafał Miłecki +---- +- .../brcm80211/brcmfmac/cfg80211.c | 23 ++++++++++------------ +- 1 file changed, 10 insertions(+), 13 deletions(-) +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-@@ -246,7 +246,7 @@ static u16 chandef_to_chanspec(struct br +- brcmf_dbg(TRACE, "chandef: control %d center %d width %d\n", +- ch->chan->center_freq, ch->center_freq1, ch->width); +- ch_inf.chnum = ieee80211_frequency_to_channel(ch->center_freq1); +-- primary_offset = ch->center_freq1 - ch->chan->center_freq; +-+ primary_offset = ch->chan->center_freq - ch->center_freq1; +- switch (ch->width) { +- case NL80211_CHAN_WIDTH_20: +- case NL80211_CHAN_WIDTH_20_NOHT: +-@@ -255,24 +255,21 @@ static u16 chandef_to_chanspec(struct br +- break; +- case NL80211_CHAN_WIDTH_40: +- ch_inf.bw = BRCMU_CHAN_BW_40; +-- if (primary_offset < 0) +-+ if (primary_offset > 0) +- ch_inf.sb = BRCMU_CHAN_SB_U; +- else +- ch_inf.sb = BRCMU_CHAN_SB_L; +- break; +- case NL80211_CHAN_WIDTH_80: +- ch_inf.bw = BRCMU_CHAN_BW_80; +-- if (primary_offset < 0) { +-- if (primary_offset < -CH_10MHZ_APART) +-- ch_inf.sb = BRCMU_CHAN_SB_UU; +-- else +-- ch_inf.sb = BRCMU_CHAN_SB_UL; +-- } else { +-- if (primary_offset > CH_10MHZ_APART) +-- ch_inf.sb = BRCMU_CHAN_SB_LL; +-- else +-- ch_inf.sb = BRCMU_CHAN_SB_LU; +-- } +-+ if (primary_offset == -30) +-+ ch_inf.sb = BRCMU_CHAN_SB_LL; +-+ else if (primary_offset == -10) +-+ ch_inf.sb = BRCMU_CHAN_SB_LU; +-+ else if (primary_offset == 10) +-+ ch_inf.sb = BRCMU_CHAN_SB_UL; +-+ else +-+ ch_inf.sb = BRCMU_CHAN_SB_UU; +- break; +- case NL80211_CHAN_WIDTH_80P80: +- case NL80211_CHAN_WIDTH_160: diff --git a/package/kernel/mac80211/patches/900-wlcore-Add-support-for-DT-platform-data.patch b/package/kernel/mac80211/patches/900-wlcore-Add-support-for-DT-platform-data.patch deleted file mode 100644 index 856dea8..0000000 diff --git a/patches/openwrt/0009-ar71xx-add-support-for-tp-link-wr740n-v5.0-EU.patch b/patches/openwrt/0009-ar71xx-add-support-for-tp-link-wr740n-v5.0-EU.patch index 20af4e8d..903e7e5f 100644 --- a/patches/openwrt/0009-ar71xx-add-support-for-tp-link-wr740n-v5.0-EU.patch +++ b/patches/openwrt/0009-ar71xx-add-support-for-tp-link-wr740n-v5.0-EU.patch @@ -10,7 +10,7 @@ tested it on my own v5.0 router and it works. Signed-off-by: Daniel Petre diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile -index 013a215..37ce8a4 100644 +index 4336697..1fe88d5 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile @@ -501,6 +501,14 @@ define Device/tl-wr740n-v4 diff --git a/patches/openwrt/0010-ar71xx-add-support-for-TL-WR741ND-v5.patch b/patches/openwrt/0010-ar71xx-add-support-for-TL-WR741ND-v5.patch index e8bf32dc..94af335c 100644 --- a/patches/openwrt/0010-ar71xx-add-support-for-TL-WR741ND-v5.patch +++ b/patches/openwrt/0010-ar71xx-add-support-for-TL-WR741ND-v5.patch @@ -6,7 +6,7 @@ This device is identical to the TL-WR740N v5, it even uses the same HWID (which wasn't the case for older TL-WR741ND revisions). diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile -index 37ce8a4..8a25832 100644 +index 1fe88d5..78d35e1 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile @@ -531,6 +531,14 @@ define Device/tl-wr741nd-v4 diff --git a/patches/openwrt/0011-brcm2708-Implement-sysupgrade.patch b/patches/openwrt/0011-brcm2708-Implement-sysupgrade.patch deleted file mode 100644 index 4c205284..00000000 --- a/patches/openwrt/0011-brcm2708-Implement-sysupgrade.patch +++ /dev/null @@ -1,87 +0,0 @@ -From: Matthias Schiffer -Date: Fri, 17 Jul 2015 20:51:23 +0200 -Subject: brcm2708: Implement sysupgrade - -Implement sysupgrade for Raspberry Pi, similar to the way it is done on x86: -The config files are saved in the boot partition and moved to where they are -normally expected in preinit. - -Also add optional gzip compression for the SD card image, since this can save -a lot of space (76M vs 6M), also similar to x86. - -Signed-off-by: Bruno Randolf - -diff --git a/target/linux/brcm2708/Makefile b/target/linux/brcm2708/Makefile -index 30f6e1d..015aa9c 100644 ---- a/target/linux/brcm2708/Makefile -+++ b/target/linux/brcm2708/Makefile -@@ -19,7 +19,7 @@ SUBTARGETS:=bcm2708 bcm2709 - KERNEL_PATCHVER:=3.18 - - include $(INCLUDE_DIR)/target.mk --DEFAULT_PACKAGES += brcm2708-gpu-fw kmod-usb-hid kmod-sound-core kmod-sound-arm-bcm2835 -+DEFAULT_PACKAGES += brcm2708-gpu-fw kmod-usb-hid kmod-sound-core kmod-sound-arm-bcm2835 kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 - - define Target/Description - Build firmware image for Broadcom BCM2708/BCM2709 SoC devices. -diff --git a/target/linux/brcm2708/base-files/lib/preinit/79_move_config b/target/linux/brcm2708/base-files/lib/preinit/79_move_config -new file mode 100644 -index 0000000..7bcea7b ---- /dev/null -+++ b/target/linux/brcm2708/base-files/lib/preinit/79_move_config -@@ -0,0 +1,18 @@ -+#!/bin/sh -+# Copyright (C) 2015 OpenWrt.org -+ -+BOOTPART=/dev/mmcblk0p1 -+ -+move_config() { -+ if [ -b $BOOTPART ]; then -+ insmod nls_cp437 -+ insmod nls_iso8859-1 -+ insmod fat -+ insmod vfat -+ mount -t vfat -o rw,noatime $BOOTPART /mnt -+ [ -f /mnt/sysupgrade.tgz ] && mv -f /mnt/sysupgrade.tgz / -+ umount /mnt -+ fi -+} -+ -+boot_hook_add preinit_mount_root move_config -diff --git a/target/linux/brcm2708/base-files/lib/upgrade/platform.sh b/target/linux/brcm2708/base-files/lib/upgrade/platform.sh -new file mode 100644 -index 0000000..3e1ee00 ---- /dev/null -+++ b/target/linux/brcm2708/base-files/lib/upgrade/platform.sh -@@ -0,0 +1,17 @@ -+platform_check_image() { -+ # i know no way to verify the image -+ return 0; -+} -+ -+platform_do_upgrade() { -+ sync -+ get_image "$1" | dd of=/dev/mmcblk0 bs=2M conv=fsync -+ sleep 1 -+} -+ -+platform_copy_config() { -+ mount -t vfat -o rw,noatime /dev/mmcblk0p1 /mnt -+ cp -af "$CONF_TAR" /mnt/ -+ sync -+ umount /mnt -+} -diff --git a/target/linux/brcm2708/image/Makefile b/target/linux/brcm2708/image/Makefile -index e70bdd0..2c18baf 100644 ---- a/target/linux/brcm2708/image/Makefile -+++ b/target/linux/brcm2708/image/Makefile -@@ -28,6 +28,9 @@ define Image/Build/RaspberryPi - mcopy -i $(KDIR)/boot.img $(KDIR)/Image ::kernel.img # Copy OpenWrt built kernel - ./gen_rpi_sdcard_img.sh $(BIN_DIR)/$(IMG_PREFIX)-sdcard-vfat-$(1).img $(KDIR)/boot.img $(KDIR)/root.$(1) \ - $(CONFIG_BRCM2708_SD_BOOT_PARTSIZE) $(CONFIG_TARGET_ROOTFS_PARTSIZE) -+ ifneq ($(CONFIG_TARGET_IMAGES_GZIP),) -+ gzip -f9n $(BIN_DIR)/$(IMG_PREFIX)-sdcard-vfat-$(1).img -+ endif - endef - - define Image/Build diff --git a/patches/openwrt/0012-sunxi-fix-uboot-install-location.patch b/patches/openwrt/0011-sunxi-fix-uboot-install-location.patch similarity index 100% rename from patches/openwrt/0012-sunxi-fix-uboot-install-location.patch rename to patches/openwrt/0011-sunxi-fix-uboot-install-location.patch diff --git a/patches/openwrt/0013-sunxi-respect-CONFIG_TARGET_IMAGES_GZIP.patch b/patches/openwrt/0012-sunxi-respect-CONFIG_TARGET_IMAGES_GZIP.patch similarity index 100% rename from patches/openwrt/0013-sunxi-respect-CONFIG_TARGET_IMAGES_GZIP.patch rename to patches/openwrt/0012-sunxi-respect-CONFIG_TARGET_IMAGES_GZIP.patch diff --git a/patches/openwrt/0014-odhcp6c-add-option-sourcefilter-to-disable-source-filter.patch b/patches/openwrt/0013-odhcp6c-add-option-sourcefilter-to-disable-source-filter.patch similarity index 100% rename from patches/openwrt/0014-odhcp6c-add-option-sourcefilter-to-disable-source-filter.patch rename to patches/openwrt/0013-odhcp6c-add-option-sourcefilter-to-disable-source-filter.patch diff --git a/patches/openwrt/0016-mac80211-set-mcast-rate-for-mesh-point-interfaces.patch b/patches/openwrt/0014-mac80211-set-mcast-rate-for-mesh-point-interfaces.patch similarity index 100% rename from patches/openwrt/0016-mac80211-set-mcast-rate-for-mesh-point-interfaces.patch rename to patches/openwrt/0014-mac80211-set-mcast-rate-for-mesh-point-interfaces.patch diff --git a/patches/openwrt/0015-ar71xx-fix-wndr3700_board_detect-for-some-NETGEAR-WNDR3700v2.patch b/patches/openwrt/0015-ar71xx-fix-wndr3700_board_detect-for-some-NETGEAR-WNDR3700v2.patch deleted file mode 100644 index 743177ea..00000000 --- a/patches/openwrt/0015-ar71xx-fix-wndr3700_board_detect-for-some-NETGEAR-WNDR3700v2.patch +++ /dev/null @@ -1,26 +0,0 @@ -From: Matthias Schiffer -Date: Thu, 23 Jul 2015 01:31:05 +0200 -Subject: ar71xx: fix wndr3700_board_detect for some NETGEAR WNDR3700v2 - -There are a few NETGEAR devices which don't terminate the model name in the -ART with a NUL byte, at least some NETGEAR WNDR3700v2. The current awk -expression doesn't match 0xFF bytes, so AR71XX_MODEL contains lots of -trailing 0xFF garbage in this case. - -Fix this by matching for the first non-printable character and explicitly -setting LC_CTYPE=C (probably not strictly necessary on OpenWrt, but will -definitely work like this, even when awk supports locales and LANG is set). - -diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh -index 839abc7..af92b01 100755 ---- a/target/linux/ar71xx/base-files/lib/ar71xx.sh -+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh -@@ -38,7 +38,7 @@ wndr3700_board_detect() { - ;; - "33373031") - # Use awk to remove everything after the first zero byte -- model="$(ar71xx_get_mtd_offset_size_format art 41 32 %c | awk 'BEGIN{FS="[[:cntrl:]]"} {print $1; exit}')" -+ model="$(ar71xx_get_mtd_offset_size_format art 41 32 %c | LC_CTYPE=C awk -v 'FS=[^[:print:]]' '{print $1; exit}')" - case $model in - $'\xff'*) - if [ "${model:24:1}" = 'N' ]; then diff --git a/patches/openwrt/0017-hostapd-prevent-channel-switch-for-5GHz.patch b/patches/openwrt/0015-hostapd-prevent-channel-switch-for-5GHz.patch similarity index 100% rename from patches/openwrt/0017-hostapd-prevent-channel-switch-for-5GHz.patch rename to patches/openwrt/0015-hostapd-prevent-channel-switch-for-5GHz.patch diff --git a/patches/openwrt/0018-ar71xx-fix-ethernet-initialization-on-QCA953x-based-boards-TP-Link-TL-WR841N-ND-v9-Compex-WPJ531.patch b/patches/openwrt/0016-ar71xx-fix-ethernet-initialization-on-QCA953x-based-boards-TP-Link-TL-WR841N-ND-v9-Compex-WPJ531.patch similarity index 100% rename from patches/openwrt/0018-ar71xx-fix-ethernet-initialization-on-QCA953x-based-boards-TP-Link-TL-WR841N-ND-v9-Compex-WPJ531.patch rename to patches/openwrt/0016-ar71xx-fix-ethernet-initialization-on-QCA953x-based-boards-TP-Link-TL-WR841N-ND-v9-Compex-WPJ531.patch diff --git a/patches/openwrt/0019-ar71xx-rework-patch-for-qca953x-956x.patch b/patches/openwrt/0017-ar71xx-rework-patch-for-qca953x-956x.patch similarity index 84% rename from patches/openwrt/0019-ar71xx-rework-patch-for-qca953x-956x.patch rename to patches/openwrt/0017-ar71xx-rework-patch-for-qca953x-956x.patch index eb1d12f4..5b2b234f 100644 --- a/patches/openwrt/0019-ar71xx-rework-patch-for-qca953x-956x.patch +++ b/patches/openwrt/0017-ar71xx-rework-patch-for-qca953x-956x.patch @@ -103,25 +103,16 @@ index ae3db4c..ff94e2e 100644 break; diff --git a/target/linux/ar71xx/patches-3.18/707-MIPS-ath79-add-support-for-QCA953x-SoC.patch b/target/linux/ar71xx/patches-3.18/707-MIPS-ath79-add-support-for-QCA953x-SoC.patch -index 5041619..403897a 100644 +index f3b4446..cf10af3 100644 --- a/target/linux/ar71xx/patches-3.18/707-MIPS-ath79-add-support-for-QCA953x-SoC.patch +++ b/target/linux/ar71xx/patches-3.18/707-MIPS-ath79-add-support-for-QCA953x-SoC.patch -@@ -44,7 +44,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. - config ATH79_NVRAM - --- a/arch/mips/ath79/clock.c - +++ b/arch/mips/ath79/clock.c --@@ -350,6 +350,91 @@ static void __init ar934x_clocks_init(vo -+@@ -350,6 +350,91 @@ static void __init ar934x_clocks_init(void) - iounmap(dpll_base); - } - @@ -175,6 +175,48 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. soc_is_qca955x()) { ath79_uart_data[0].uartclk = uart_clk_rate; platform_device_register(&ath79_uart_device); +--- a/arch/mips/ath79/dev-usb.c ++++ b/arch/mips/ath79/dev-usb.c -+@@ -236,6 +236,30 @@ static void __init ar934x_usb_setup(void) ++@@ -236,6 +236,30 @@ static void __init ar934x_usb_setup(void + &ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2)); + } + @@ -164,26 +155,6 @@ index 5041619..403897a 100644 --- a/arch/mips/ath79/dev-wmac.c +++ b/arch/mips/ath79/dev-wmac.c @@ -101,7 +101,7 @@ static int ar933x_wmac_reset(void) -@@ -186,7 +228,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. - { - return ath79_soc_rev; - } --@@ -126,7 +126,7 @@ static void __init ar933x_wmac_setup(voi -+@@ -126,7 +126,7 @@ static void __init ar933x_wmac_setup(void) - ath79_wmac_data.is_clk_25mhz = true; - - if (ath79_soc_rev == 1) -@@ -195,8 +237,8 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. - - ath79_wmac_data.external_reset = ar933x_wmac_reset; - } --@@ -149,6 +149,26 @@ static void ar934x_wmac_setup(void) -- ath79_wmac_data.is_clk_25mhz = true; -+@@ -151,6 +151,26 @@ static void ar934x_wmac_setup(void) -+ ath79_wmac_data.get_mac_revision = ar93xx_get_soc_revision; - } - - +static void qca953x_wmac_setup(void) @@ -207,8 +249,8 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. + + ath79_wmac_resources[0].start = QCA953X_WMAC_BASE; @@ -195,20 +166,11 @@ index 5041619..403897a 100644 + + t = ath79_reset_rr(QCA953X_RESET_REG_BOOTSTRAP); + if (t & QCA953X_BOOTSTRAP_REF_CLK_40) -@@ -222,7 +264,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. - static void qca955x_wmac_setup(void) - { - u32 t; --@@ -366,6 +386,8 @@ void __init ath79_register_wmac(u8 *cal_ -+@@ -368,6 +388,8 @@ void __init ath79_register_wmac(u8 *cal_data, u8 *mac_addr) - ar933x_wmac_setup(); - else if (soc_is_ar934x()) - ar934x_wmac_setup(); @@ -244,6 +286,24 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. _prom_putchar = prom_putchar_ar71xx; --- a/arch/mips/ath79/gpio.c +++ b/arch/mips/ath79/gpio.c -+@@ -148,7 +148,7 @@ static void __iomem *ath79_gpio_get_function_reg(void) ++@@ -148,7 +148,7 @@ static void __iomem *ath79_gpio_get_func + soc_is_ar913x() || + soc_is_ar933x()) + reg = AR71XX_GPIO_REG_FUNC; @@ -217,7 +179,7 @@ index 5041619..403897a 100644 + reg = AR934X_GPIO_REG_FUNC; + else + BUG(); -+@@ -187,7 +187,7 @@ void __init ath79_gpio_output_select(unsigned gpio, u8 val) ++@@ -187,7 +187,7 @@ void __init ath79_gpio_output_select(uns + unsigned int reg; + u32 t, s; + @@ -229,16 +191,7 @@ index 5041619..403897a 100644 @@ -224,6 +224,8 @@ void __init ath79_gpio_init(void) ath79_gpio_count = AR933X_GPIO_COUNT; else if (soc_is_ar934x()) -@@ -264,7 +324,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. - } - --- a/arch/mips/ath79/irq.c - +++ b/arch/mips/ath79/irq.c --@@ -106,6 +106,7 @@ static void __init ath79_misc_irq_init(v -+@@ -106,6 +106,7 @@ static void __init ath79_misc_irq_init(void) - else if (soc_is_ar724x() || - soc_is_ar933x() || - soc_is_ar934x() || -@@ -272,19 +332,80 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. +@@ -272,16 +332,77 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. soc_is_qca955x()) ath79_misc_irq_chip.irq_ack = ar724x_misc_irq_ack; else @@ -317,40 +270,9 @@ index 5041619..403897a 100644 + } --- a/arch/mips/ath79/setup.c +++ b/arch/mips/ath79/setup.c --@@ -59,6 +59,7 @@ static void __init ath79_detect_sys_type -+@@ -60,6 +60,7 @@ static void __init ath79_detect_sys_type(void) - u32 major; - u32 minor; - u32 rev = 0; -@@ -292,7 +413,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. - - id = ath79_reset_rr(AR71XX_RESET_REG_REV_ID); - major = id & REV_ID_MAJOR_MASK; --@@ -151,6 +152,16 @@ static void __init ath79_detect_sys_type -+@@ -152,6 +153,16 @@ static void __init ath79_detect_sys_type(void) - rev = id & AR934X_REV_ID_REVISION_MASK; - break; - -@@ -309,38 +430,60 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. - case REV_ID_MAJOR_QCA9556: - ath79_soc = ATH79_SOC_QCA9556; - chip = "9556"; --@@ -169,9 +180,9 @@ static void __init ath79_detect_sys_type -+@@ -170,7 +181,7 @@ static void __init ath79_detect_sys_type(void) - - ath79_soc_rev = rev; - - - if (soc_is_qca955x()) --- sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s rev %u", --- chip, rev); - + if (soc_is_qca953x() || soc_is_qca955x()) --+ sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s ver %u rev %u", --+ chip, ver, rev); -+ sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s rev %u", -+ chip, rev); - else -- sprintf(ath79_sys_type, "Atheros AR%s rev %u", chip, rev); -- pr_info("SoC: %s\n", ath79_sys_type); + @@ -59,6 +59,7 @@ static void __init ath79_detect_sys_type +@@ -329,23 +450,49 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. + pr_info("SoC: %s\n", ath79_sys_type); --- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h +++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h -@@ -105,6 +105,9 @@ @@ -401,7 +323,7 @@ index 5041619..403897a 100644 +#define QCA953X_PLL_ETH_XMII_CONTROL_REG 0x2c +#define QCA953X_PLL_ETH_SGMII_CONTROL_REG 0x48 + -@@ -351,7 +494,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. +@@ -356,7 +503,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. +#define QCA953X_PLL_CPU_CONFIG_REFDIV_SHIFT 12 +#define QCA953X_PLL_CPU_CONFIG_REFDIV_MASK 0x1f +#define QCA953X_PLL_CPU_CONFIG_OUTDIV_SHIFT 19 @@ -410,7 +332,7 @@ index 5041619..403897a 100644 + +#define QCA953X_PLL_DDR_CONFIG_NFRAC_SHIFT 0 +#define QCA953X_PLL_DDR_CONFIG_NFRAC_MASK 0x3ff -@@ -378,27 +521,85 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. +@@ -383,27 +530,85 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. #define QCA955X_PLL_CPU_CONFIG_REG 0x00 #define QCA955X_PLL_DDR_CONFIG_REG 0x04 #define QCA955X_PLL_CLK_CTRL_REG 0x08 @@ -500,7 +422,7 @@ index 5041619..403897a 100644 #define REV_ID_MAJOR_AR9341 0x0120 #define REV_ID_MAJOR_AR9342 0x1120 #define REV_ID_MAJOR_AR9344 0x2120 -@@ -407,7 +608,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. +@@ -412,7 +617,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. #define REV_ID_MAJOR_QCA9556 0x0130 #define REV_ID_MAJOR_QCA9558 0x1130 @@ -509,7 +431,7 @@ index 5041619..403897a 100644 #define AR934X_REV_ID_REVISION_MASK 0xf -@@ -416,14 +617,81 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. +@@ -421,14 +626,81 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. #define QCA955X_REV_ID_REVISION_MASK 0xf /* @@ -594,7 +516,7 @@ index 5041619..403897a 100644 +++ b/arch/mips/include/asm/mach-ath79/ath79.h @@ -32,6 +32,7 @@ enum ath79_soc_type { diff --git a/target/linux/ar71xx/patches-3.18/735-MIPS-ath79-add-support-for-QCA956x-SoC.patch b/target/linux/ar71xx/patches-3.18/735-MIPS-ath79-add-support-for-QCA956x-SoC.patch -index 491a7aa..2bdc744 100644 +index ab2bc38..eecccdc 100644 --- a/target/linux/ar71xx/patches-3.18/735-MIPS-ath79-add-support-for-QCA956x-SoC.patch +++ b/target/linux/ar71xx/patches-3.18/735-MIPS-ath79-add-support-for-QCA956x-SoC.patch @@ -142,74 +142,9 @@ @@ -743,32 +665,8 @@ index 491a7aa..2bdc744 100644 else if (soc_is_qca955x()) qca955x_irq_init(); + else if (soc_is_qca956x()) -@@ -519,7 +452,7 @@ - return -ENODEV; - --- a/arch/mips/ath79/setup.c - +++ b/arch/mips/ath79/setup.c --@@ -175,15 +175,30 @@ static void __init ath79_detect_sys_type -+@@ -175,14 +175,29 @@ static void __init ath79_detect_sys_type - rev = id & QCA955X_REV_ID_REVISION_MASK; - break; - -@@ -542,18 +475,18 @@ - ath79_soc_rev = rev; - - - if (soc_is_qca953x() || soc_is_qca955x()) -+- sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s rev %u", - + if (soc_is_qca953x() || soc_is_qca955x() || soc_is_qca9561()) -- sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s ver %u rev %u", -- chip, ver, rev); -++ sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s ver %u rev %u", -++ chip, ver, rev); - + else if (soc_is_tp9343()) - + sprintf(ath79_sys_type, "Qualcomm Atheros TP%s rev %u", --+ chip, rev); -+ chip, rev); - else - sprintf(ath79_sys_type, "Atheros AR%s rev %u", chip, rev); -- pr_info("SoC: %s\n", ath79_sys_type); +@@ -554,7 +487,7 @@ + pr_info("SoC: %s\n", ath79_sys_type); --- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h +++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h -@@ -131,6 +131,23 @@ @@ -776,7 +674,7 @@ index 491a7aa..2bdc744 100644 #define QCA955X_NFC_BASE 0x1b800200 #define QCA955X_NFC_SIZE 0xb8 -@@ -577,7 +510,7 @@ +@@ -578,7 +511,7 @@ #define AR9300_OTP_BASE 0x14000 #define AR9300_OTP_STATUS 0x15f18 #define AR9300_OTP_STATUS_TYPE 0x7 @@ -785,7 +683,7 @@ index 491a7aa..2bdc744 100644 #define QCA955X_PLL_CLK_CTRL_DDRCLK_FROM_DDRPLL BIT(21) #define QCA955X_PLL_CLK_CTRL_AHBCLK_FROM_DDRPLL BIT(24) -@@ -627,7 +560,7 @@ +@@ -628,7 +561,7 @@ /* * USB_CONFIG block */ @@ -794,7 +692,7 @@ index 491a7aa..2bdc744 100644 #define QCA955X_RESET_REG_BOOTSTRAP 0xb0 #define QCA955X_RESET_REG_EXT_INT_STATUS 0xac -@@ -639,7 +572,7 @@ +@@ -640,7 +573,7 @@ #define MISC_INT_ETHSW BIT(12) #define MISC_INT_TIMER4 BIT(10) #define MISC_INT_TIMER3 BIT(9) @@ -803,7 +701,7 @@ index 491a7aa..2bdc744 100644 #define QCA955X_BOOTSTRAP_REF_CLK_40 BIT(4) -@@ -648,7 +581,7 @@ +@@ -649,7 +582,7 @@ #define AR934X_PCIE_WMAC_INT_WMAC_MISC BIT(0) #define AR934X_PCIE_WMAC_INT_WMAC_TX BIT(1) #define AR934X_PCIE_WMAC_INT_WMAC_RXLP BIT(2) @@ -812,7 +710,7 @@ index 491a7aa..2bdc744 100644 QCA955X_EXT_INT_PCIE_RC2_INT1 | QCA955X_EXT_INT_PCIE_RC2_INT2 | \ QCA955X_EXT_INT_PCIE_RC2_INT3) -@@ -686,7 +619,7 @@ +@@ -687,7 +620,7 @@ #define REV_ID_MAJOR_MASK 0xfff0 #define REV_ID_MAJOR_AR71XX 0x00a0 #define REV_ID_MAJOR_AR913X 0x00b0 @@ -821,7 +719,7 @@ index 491a7aa..2bdc744 100644 #define REV_ID_MAJOR_QCA9533_V2 0x0160 #define REV_ID_MAJOR_QCA9556 0x0130 #define REV_ID_MAJOR_QCA9558 0x1130 -@@ -695,7 +628,7 @@ +@@ -696,7 +629,7 @@ #define AR71XX_REV_ID_MINOR_MASK 0x3 #define AR71XX_REV_ID_MINOR_AR7130 0x0 @@ -830,7 +728,7 @@ index 491a7aa..2bdc744 100644 #define QCA955X_REV_ID_REVISION_MASK 0xf -@@ -704,9 +637,9 @@ +@@ -705,9 +638,9 @@ /* * SPI block */ @@ -843,7 +741,7 @@ index 491a7aa..2bdc744 100644 +#define QCA956X_GPIO_REG_OUT_FUNC0 0x2c +#define QCA956X_GPIO_REG_OUT_FUNC1 0x30 -@@ -724,9 +657,9 @@ +@@ -725,9 +658,9 @@ #define AR71XX_GPIO_COUNT 16 #define AR7240_GPIO_COUNT 18 #define AR7241_GPIO_COUNT 20 diff --git a/patches/openwrt/0020-base-files-default_postinst-propagate-the-real-postinst-return-code.patch b/patches/openwrt/0018-base-files-default_postinst-propagate-the-real-postinst-return-code.patch similarity index 100% rename from patches/openwrt/0020-base-files-default_postinst-propagate-the-real-postinst-return-code.patch rename to patches/openwrt/0018-base-files-default_postinst-propagate-the-real-postinst-return-code.patch diff --git a/patches/openwrt/0021-opkg-work-around-unconditional-libopenssl-build-dependency.patch b/patches/openwrt/0019-opkg-work-around-unconditional-libopenssl-build-dependency.patch similarity index 100% rename from patches/openwrt/0021-opkg-work-around-unconditional-libopenssl-build-dependency.patch rename to patches/openwrt/0019-opkg-work-around-unconditional-libopenssl-build-dependency.patch diff --git a/patches/openwrt/0022-hostapd-work-around-unconditional-libopenssl-build-dependency.patch b/patches/openwrt/0020-hostapd-work-around-unconditional-libopenssl-build-dependency.patch similarity index 100% rename from patches/openwrt/0022-hostapd-work-around-unconditional-libopenssl-build-dependency.patch rename to patches/openwrt/0020-hostapd-work-around-unconditional-libopenssl-build-dependency.patch diff --git a/patches/openwrt/0023-odhcp6c-minor-fixes.patch b/patches/openwrt/0021-odhcp6c-minor-fixes.patch similarity index 100% rename from patches/openwrt/0023-odhcp6c-minor-fixes.patch rename to patches/openwrt/0021-odhcp6c-minor-fixes.patch diff --git a/patches/openwrt/0024-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch b/patches/openwrt/0022-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch similarity index 100% rename from patches/openwrt/0024-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch rename to patches/openwrt/0022-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch diff --git a/patches/openwrt/0026-base-files-add-etc-profile.d-support.patch b/patches/openwrt/0023-base-files-add-etc-profile.d-support.patch similarity index 98% rename from patches/openwrt/0026-base-files-add-etc-profile.d-support.patch rename to patches/openwrt/0023-base-files-add-etc-profile.d-support.patch index 93543e8e..0295626e 100644 --- a/patches/openwrt/0026-base-files-add-etc-profile.d-support.patch +++ b/patches/openwrt/0023-base-files-add-etc-profile.d-support.patch @@ -24,7 +24,7 @@ v4 keep it simple and mimic OpenWrt style Signed-off-by: Bastian Bittorf diff --git a/package/base-files/files/etc/profile b/package/base-files/files/etc/profile -index 3dd58e1..577b63b 100644 +index 170f487..bd008a8 100644 --- a/package/base-files/files/etc/profile +++ b/package/base-files/files/etc/profile @@ -14,3 +14,10 @@ export PS1='\u@\h:\w\$ ' diff --git a/patches/openwrt/0027-Kernel-Realtek-8150-and-Realtek-8152-based-USB-to-Ethernet-converters.patch b/patches/openwrt/0024-Kernel-Realtek-8150-and-Realtek-8152-based-USB-to-Ethernet-converters.patch similarity index 100% rename from patches/openwrt/0027-Kernel-Realtek-8150-and-Realtek-8152-based-USB-to-Ethernet-converters.patch rename to patches/openwrt/0024-Kernel-Realtek-8150-and-Realtek-8152-based-USB-to-Ethernet-converters.patch diff --git a/patches/openwrt/0025-ar71xx-add-support-for-TP-LINK-TL-WR841N-ND-v10.patch b/patches/openwrt/0025-ar71xx-add-support-for-TP-LINK-TL-WR841N-ND-v10.patch deleted file mode 100644 index 84f6505c..00000000 --- a/patches/openwrt/0025-ar71xx-add-support-for-TP-LINK-TL-WR841N-ND-v10.patch +++ /dev/null @@ -1,31 +0,0 @@ -From: Matthias Schiffer -Date: Sun, 11 Oct 2015 18:00:27 +0200 -Subject: ar71xx: add support for TP-LINK TL-WR841N/ND v10 - -diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile -index 8a25832..3a17420 100644 ---- a/target/linux/ar71xx/image/Makefile -+++ b/target/linux/ar71xx/image/Makefile -@@ -562,6 +562,13 @@ define Device/tl-wr841n-v9 - TPLINK_HWID := 0x08410009 - endef - -+define Device/tl-wr841n-v10 -+ $(Device/tplink-4mlzma) -+ BOARDNAME := TL-WR841N-v9 -+ DEVICE_PROFILE := TLWR841 -+ TPLINK_HWID := 0x08410010 -+endef -+ - define Device/tl-wr842n-v2 - $(Device/tplink-8mlzma) - BOARDNAME := TL-WR842N-v2 -@@ -582,7 +589,7 @@ define Device/tl-wr847n-v8 - DEVICE_PROFILE := TLWR841 - TPLINK_HWID := 0x08470008 - endef --TARGET_DEVICES += tl-wr841n-v8 tl-wr841n-v9 tl-wr842n-v2 tl-wr843nd-v1 tl-wr847n-v8 -+TARGET_DEVICES += tl-wr841n-v8 tl-wr841n-v9 tl-wr841n-v10 tl-wr842n-v2 tl-wr843nd-v1 tl-wr847n-v8 - - define Device/tl-wr941nd-v5 - $(Device/tplink-4mlzma) diff --git a/patches/openwrt/0028-tools-firmware-utils-tplink-safeloader-clean-up-code.patch b/patches/openwrt/0025-tools-firmware-utils-tplink-safeloader-clean-up-code.patch similarity index 100% rename from patches/openwrt/0028-tools-firmware-utils-tplink-safeloader-clean-up-code.patch rename to patches/openwrt/0025-tools-firmware-utils-tplink-safeloader-clean-up-code.patch diff --git a/patches/openwrt/0029-tools-firmware-utils-tplink-safeloader-fix-support-list-format-clean-up-vendor-information.patch b/patches/openwrt/0026-tools-firmware-utils-tplink-safeloader-fix-support-list-format-clean-up-vendor-information.patch similarity index 100% rename from patches/openwrt/0029-tools-firmware-utils-tplink-safeloader-fix-support-list-format-clean-up-vendor-information.patch rename to patches/openwrt/0026-tools-firmware-utils-tplink-safeloader-fix-support-list-format-clean-up-vendor-information.patch diff --git a/patches/openwrt/0030-tools-firmware-utils-tplink-safeloader-add-version-1.1-support-to-CPE210-220-510-520.patch b/patches/openwrt/0027-tools-firmware-utils-tplink-safeloader-add-version-1.1-support-to-CPE210-220-510-520.patch similarity index 100% rename from patches/openwrt/0030-tools-firmware-utils-tplink-safeloader-add-version-1.1-support-to-CPE210-220-510-520.patch rename to patches/openwrt/0027-tools-firmware-utils-tplink-safeloader-add-version-1.1-support-to-CPE210-220-510-520.patch diff --git a/patches/openwrt/0032-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch b/patches/openwrt/0028-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch similarity index 100% rename from patches/openwrt/0032-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch rename to patches/openwrt/0028-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch diff --git a/patches/openwrt/0033-mac80211-fix-crash-when-using-mesh-11s-VIF-together-with-another-VIF.patch b/patches/openwrt/0029-mac80211-fix-crash-when-using-mesh-11s-VIF-together-with-another-VIF.patch similarity index 100% rename from patches/openwrt/0033-mac80211-fix-crash-when-using-mesh-11s-VIF-together-with-another-VIF.patch rename to patches/openwrt/0029-mac80211-fix-crash-when-using-mesh-11s-VIF-together-with-another-VIF.patch diff --git a/patches/openwrt/0034-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch b/patches/openwrt/0030-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch similarity index 100% rename from patches/openwrt/0034-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch rename to patches/openwrt/0030-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch diff --git a/patches/openwrt/0031-ar71xx-fix-ath79_soc_rev-value-for-QCA9531-ver.-2.patch b/patches/openwrt/0031-ar71xx-fix-ath79_soc_rev-value-for-QCA9531-ver.-2.patch deleted file mode 100644 index e1b0ed2d..00000000 --- a/patches/openwrt/0031-ar71xx-fix-ath79_soc_rev-value-for-QCA9531-ver.-2.patch +++ /dev/null @@ -1,181 +0,0 @@ -From: Matthias Schiffer -Date: Thu, 22 Oct 2015 00:33:25 +0200 -Subject: ar71xx: fix ath79_soc_rev value for QCA9531 ver. 2 - -ath9k expects to get revision id 2 for the QCA9531 ver. 2 rev. 0. This -fixes the very low TX power on some devices like the TP-LINK -TL-WR841ND v10. - -As ath79_soc_rev is only used to get the revision number to ath9k on the -QCA9533, just set it to the expected value on the ver. 2. - -diff --git a/target/linux/ar71xx/patches-3.18/707-MIPS-ath79-add-support-for-QCA953x-SoC.patch b/target/linux/ar71xx/patches-3.18/707-MIPS-ath79-add-support-for-QCA953x-SoC.patch -index 403897a..cf10af3 100644 ---- a/target/linux/ar71xx/patches-3.18/707-MIPS-ath79-add-support-for-QCA953x-SoC.patch -+++ b/target/linux/ar71xx/patches-3.18/707-MIPS-ath79-add-support-for-QCA953x-SoC.patch -@@ -44,7 +44,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. - config ATH79_NVRAM - --- a/arch/mips/ath79/clock.c - +++ b/arch/mips/ath79/clock.c --@@ -350,6 +350,91 @@ static void __init ar934x_clocks_init(void) -+@@ -350,6 +350,91 @@ static void __init ar934x_clocks_init(vo - iounmap(dpll_base); - } - -@@ -177,7 +177,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. - platform_device_register(&ath79_uart_device); - --- a/arch/mips/ath79/dev-usb.c - +++ b/arch/mips/ath79/dev-usb.c --@@ -236,6 +236,30 @@ static void __init ar934x_usb_setup(void) -+@@ -236,6 +236,30 @@ static void __init ar934x_usb_setup(void - &ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2)); - } - -@@ -228,7 +228,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. - { - return ath79_soc_rev; - } --@@ -126,7 +126,7 @@ static void __init ar933x_wmac_setup(void) -+@@ -126,7 +126,7 @@ static void __init ar933x_wmac_setup(voi - ath79_wmac_data.is_clk_25mhz = true; - - if (ath79_soc_rev == 1) -@@ -237,8 +237,8 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. - - ath79_wmac_data.external_reset = ar933x_wmac_reset; - } --@@ -151,6 +151,26 @@ static void ar934x_wmac_setup(void) -- ath79_wmac_data.get_mac_revision = ar93xx_get_soc_revision; -+@@ -149,6 +149,26 @@ static void ar934x_wmac_setup(void) -+ ath79_wmac_data.is_clk_25mhz = true; - } - - +static void qca953x_wmac_setup(void) -@@ -264,7 +264,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. - static void qca955x_wmac_setup(void) - { - u32 t; --@@ -368,6 +388,8 @@ void __init ath79_register_wmac(u8 *cal_data, u8 *mac_addr) -+@@ -366,6 +386,8 @@ void __init ath79_register_wmac(u8 *cal_ - ar933x_wmac_setup(); - else if (soc_is_ar934x()) - ar934x_wmac_setup(); -@@ -286,7 +286,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. - _prom_putchar = prom_putchar_ar71xx; - --- a/arch/mips/ath79/gpio.c - +++ b/arch/mips/ath79/gpio.c --@@ -148,7 +148,7 @@ static void __iomem *ath79_gpio_get_function_reg(void) -+@@ -148,7 +148,7 @@ static void __iomem *ath79_gpio_get_func - soc_is_ar913x() || - soc_is_ar933x()) - reg = AR71XX_GPIO_REG_FUNC; -@@ -295,7 +295,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. - reg = AR934X_GPIO_REG_FUNC; - else - BUG(); --@@ -187,7 +187,7 @@ void __init ath79_gpio_output_select(unsigned gpio, u8 val) -+@@ -187,7 +187,7 @@ void __init ath79_gpio_output_select(uns - unsigned int reg; - u32 t, s; - -@@ -324,7 +324,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. - } - --- a/arch/mips/ath79/irq.c - +++ b/arch/mips/ath79/irq.c --@@ -106,6 +106,7 @@ static void __init ath79_misc_irq_init(void) -+@@ -106,6 +106,7 @@ static void __init ath79_misc_irq_init(v - else if (soc_is_ar724x() || - soc_is_ar933x() || - soc_is_ar934x() || -@@ -405,7 +405,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. - } - --- a/arch/mips/ath79/setup.c - +++ b/arch/mips/ath79/setup.c --@@ -60,6 +60,7 @@ static void __init ath79_detect_sys_type(void) -+@@ -59,6 +59,7 @@ static void __init ath79_detect_sys_type - u32 major; - u32 minor; - u32 rev = 0; -@@ -413,12 +413,13 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. - - id = ath79_reset_rr(AR71XX_RESET_REG_REV_ID); - major = id & REV_ID_MAJOR_MASK; --@@ -152,6 +153,16 @@ static void __init ath79_detect_sys_type(void) -+@@ -151,6 +152,17 @@ static void __init ath79_detect_sys_type - rev = id & AR934X_REV_ID_REVISION_MASK; - break; - - + case REV_ID_MAJOR_QCA9533_V2: - + ver = 2; -++ ath79_soc_rev = 2; - + /* drop through */ - + - + case REV_ID_MAJOR_QCA9533: -@@ -430,15 +431,23 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. - case REV_ID_MAJOR_QCA9556: - ath79_soc = ATH79_SOC_QCA9556; - chip = "9556"; --@@ -170,7 +181,7 @@ static void __init ath79_detect_sys_type(void) -+@@ -167,11 +179,12 @@ static void __init ath79_detect_sys_type -+ panic("ath79: unknown SoC, id:0x%08x", id); -+ } - -- ath79_soc_rev = rev; -+- ath79_soc_rev = rev; -++ if (ver == 1) -++ ath79_soc_rev = rev; - - - if (soc_is_qca955x()) -+- sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s rev %u", -+- chip, rev); - + if (soc_is_qca953x() || soc_is_qca955x()) -- sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s rev %u", -- chip, rev); -++ sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s ver %u rev %u", -++ chip, ver, rev); - else -+ sprintf(ath79_sys_type, "Atheros AR%s rev %u", chip, rev); -+ pr_info("SoC: %s\n", ath79_sys_type); - --- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h - +++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h - @@ -105,6 +105,21 @@ -diff --git a/target/linux/ar71xx/patches-3.18/735-MIPS-ath79-add-support-for-QCA956x-SoC.patch b/target/linux/ar71xx/patches-3.18/735-MIPS-ath79-add-support-for-QCA956x-SoC.patch -index 2bdc744..eecccdc 100644 ---- a/target/linux/ar71xx/patches-3.18/735-MIPS-ath79-add-support-for-QCA956x-SoC.patch -+++ b/target/linux/ar71xx/patches-3.18/735-MIPS-ath79-add-support-for-QCA956x-SoC.patch -@@ -452,7 +452,7 @@ - return -ENODEV; - --- a/arch/mips/ath79/setup.c - +++ b/arch/mips/ath79/setup.c --@@ -175,14 +175,29 @@ static void __init ath79_detect_sys_type -+@@ -176,6 +176,18 @@ static void __init ath79_detect_sys_type - rev = id & QCA955X_REV_ID_REVISION_MASK; - break; - -@@ -471,19 +471,20 @@ - default: - panic("ath79: unknown SoC, id:0x%08x", id); - } -- -- ath79_soc_rev = rev; -+@@ -183,9 +195,12 @@ static void __init ath79_detect_sys_type -+ if (ver == 1) -+ ath79_soc_rev = rev; - - - if (soc_is_qca953x() || soc_is_qca955x()) --- sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s rev %u", - + if (soc_is_qca953x() || soc_is_qca955x() || soc_is_qca9561()) --+ sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s ver %u rev %u", --+ chip, ver, rev); -+ sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s ver %u rev %u", -+ chip, ver, rev); - + else if (soc_is_tp9343()) - + sprintf(ath79_sys_type, "Qualcomm Atheros TP%s rev %u", -- chip, rev); -++ chip, rev); - else - sprintf(ath79_sys_type, "Atheros AR%s rev %u", chip, rev); -+ pr_info("SoC: %s\n", ath79_sys_type); - --- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h - +++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h - @@ -143,6 +143,23 @@ diff --git a/patches/openwrt/0035-mac80211-ath9k-add-correct-MAC-BB-name-for-ar9561.patch b/patches/openwrt/0031-mac80211-ath9k-add-correct-MAC-BB-name-for-ar9561.patch similarity index 100% rename from patches/openwrt/0035-mac80211-ath9k-add-correct-MAC-BB-name-for-ar9561.patch rename to patches/openwrt/0031-mac80211-ath9k-add-correct-MAC-BB-name-for-ar9561.patch diff --git a/patches/openwrt/0036-ar71xx-add-support-for-TP-LINK-TL-WR941ND-v6-international-version.patch b/patches/openwrt/0032-ar71xx-add-support-for-TP-LINK-TL-WR941ND-v6-international-version.patch similarity index 98% rename from patches/openwrt/0036-ar71xx-add-support-for-TP-LINK-TL-WR941ND-v6-international-version.patch rename to patches/openwrt/0032-ar71xx-add-support-for-TP-LINK-TL-WR941ND-v6-international-version.patch index 8bc91f15..f74c7922 100644 --- a/patches/openwrt/0036-ar71xx-add-support-for-TP-LINK-TL-WR941ND-v6-international-version.patch +++ b/patches/openwrt/0032-ar71xx-add-support-for-TP-LINK-TL-WR941ND-v6-international-version.patch @@ -37,7 +37,7 @@ index 5241db2..11b3fa0 100644 ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0" ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt" diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network -index 5c38c54..2f0855c 100755 +index 8143d2d..5a74461 100755 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network @@ -226,6 +226,7 @@ tl-mr3420-v2 |\ @@ -49,10 +49,10 @@ index 5c38c54..2f0855c 100755 wnr2000-v4 |\ wnr2200 |\ diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh -index af92b01..9c7c139 100755 +index 0b2857d..46af69a 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh -@@ -799,6 +799,9 @@ ar71xx_board_detect() { +@@ -800,6 +800,9 @@ ar71xx_board_detect() { *"TL-WR941N/ND v5") name="tl-wr941nd-v5" ;; @@ -75,7 +75,7 @@ index f11ea8c..fd337e1 100644 wnr2200 |\ wnr612-v2 |\ diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh -index ab69e4f..f181a63 100755 +index 8dea48f..2fc1d10 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -354,6 +354,7 @@ platform_check_image() { @@ -254,7 +254,7 @@ index 0000000..8c788e2 +MIPS_MACHINE(ATH79_MACH_TL_WR941ND_V6, "TL-WR941ND-v6", "TP-LINK TL-WR941N/ND v6", + tl_wr941nd_v6_setup); diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile -index 3a17420..cc25be7 100644 +index 78d35e1..11fb568 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile @@ -600,7 +600,7 @@ endef diff --git a/patches/openwrt/0037-ar71xx-add-support-for-TP-Link-TL-WR1043ND-v3.patch b/patches/openwrt/0033-ar71xx-add-support-for-TP-Link-TL-WR1043ND-v3.patch similarity index 98% rename from patches/openwrt/0037-ar71xx-add-support-for-TP-Link-TL-WR1043ND-v3.patch rename to patches/openwrt/0033-ar71xx-add-support-for-TP-Link-TL-WR1043ND-v3.patch index 5e781e21..0518a00b 100644 --- a/patches/openwrt/0037-ar71xx-add-support-for-TP-Link-TL-WR1043ND-v3.patch +++ b/patches/openwrt/0033-ar71xx-add-support-for-TP-Link-TL-WR1043ND-v3.patch @@ -3,7 +3,7 @@ Date: Thu, 5 Nov 2015 15:48:09 +0100 Subject: ar71xx: add support for TP-Link TL-WR1043ND v3 diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile -index cc25be7..4b29d9c 100644 +index 11fb568..dd224d4 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile @@ -2023,6 +2023,7 @@ $(eval $(call SingleProfile,TPLINK,64kraw,TLWR941NV4,tl-wr941nd-v4,TL-WR741ND,tt diff --git a/patches/openwrt/0038-ar71xx-backport-ath10k-calibration-data-load-changes.patch b/patches/openwrt/0034-ar71xx-backport-ath10k-calibration-data-load-changes.patch similarity index 100% rename from patches/openwrt/0038-ar71xx-backport-ath10k-calibration-data-load-changes.patch rename to patches/openwrt/0034-ar71xx-backport-ath10k-calibration-data-load-changes.patch diff --git a/patches/openwrt/0039-ar71xx-fix-AR71XX_MODEL-on-TP-Link-TL-WR703N.patch b/patches/openwrt/0035-ar71xx-fix-AR71XX_MODEL-on-TP-Link-TL-WR703N.patch similarity index 88% rename from patches/openwrt/0039-ar71xx-fix-AR71XX_MODEL-on-TP-Link-TL-WR703N.patch rename to patches/openwrt/0035-ar71xx-fix-AR71XX_MODEL-on-TP-Link-TL-WR703N.patch index 4d10da30..9916aa81 100644 --- a/patches/openwrt/0039-ar71xx-fix-AR71XX_MODEL-on-TP-Link-TL-WR703N.patch +++ b/patches/openwrt/0035-ar71xx-fix-AR71XX_MODEL-on-TP-Link-TL-WR703N.patch @@ -6,10 +6,10 @@ The hwid check was wrong, causing the AR71XX_MODEL value to end with a space (as $hwver was unset). diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh -index 9c7c139..388cf38 100755 +index 46af69a..d0abf42 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh -@@ -122,7 +122,7 @@ tplink_board_detect() { +@@ -123,7 +123,7 @@ tplink_board_detect() { "3C0002"*) model="MINIBOX_V1" ;; diff --git a/patches/openwrt/0042-acx-mac80211-mark-as-BROKEN-to-avoid-compile-failure-on-mipsel-targets.patch b/patches/openwrt/0036-acx-mac80211-mark-as-BROKEN-to-avoid-compile-failure-on-mipsel-targets.patch similarity index 100% rename from patches/openwrt/0042-acx-mac80211-mark-as-BROKEN-to-avoid-compile-failure-on-mipsel-targets.patch rename to patches/openwrt/0036-acx-mac80211-mark-as-BROKEN-to-avoid-compile-failure-on-mipsel-targets.patch diff --git a/patches/openwrt/0043-OpenSSL-Added-source-old-to-PKG_SOURCE_URL.patch b/patches/openwrt/0037-OpenSSL-Added-source-old-to-PKG_SOURCE_URL.patch similarity index 92% rename from patches/openwrt/0043-OpenSSL-Added-source-old-to-PKG_SOURCE_URL.patch rename to patches/openwrt/0037-OpenSSL-Added-source-old-to-PKG_SOURCE_URL.patch index 8c5e166f..4d18a727 100644 --- a/patches/openwrt/0043-OpenSSL-Added-source-old-to-PKG_SOURCE_URL.patch +++ b/patches/openwrt/0037-OpenSSL-Added-source-old-to-PKG_SOURCE_URL.patch @@ -11,7 +11,7 @@ of OpenSSL to avoid breaking the build whenever OpenSSL releases a new version. diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile -index 7f0da8b..039e1ab 100644 +index ad93678..9a16599 100644 --- a/package/libs/openssl/Makefile +++ b/package/libs/openssl/Makefile @@ -16,6 +16,7 @@ PKG_BUILD_PARALLEL:=1 @@ -21,4 +21,4 @@ index 7f0da8b..039e1ab 100644 + http://www.openssl.org/source/old/1.0.2/ \ ftp://ftp.funet.fi/pub/crypt/mirrors/ftp.openssl.org/source \ ftp://ftp.sunet.se/pub/security/tools/net/openssl/source/ - PKG_MD5SUM:=38dd619b2e77cbac69b99f52a053d25a + PKG_MD5SUM:=b3bf73f507172be9292ea2a8c28b659d diff --git a/patches/openwrt/0046-lua-fix-installation-of-headers-for-host-build.patch b/patches/openwrt/0038-lua-fix-installation-of-headers-for-host-build.patch similarity index 100% rename from patches/openwrt/0046-lua-fix-installation-of-headers-for-host-build.patch rename to patches/openwrt/0038-lua-fix-installation-of-headers-for-host-build.patch diff --git a/patches/openwrt/0047-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch b/patches/openwrt/0039-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch similarity index 100% rename from patches/openwrt/0047-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch rename to patches/openwrt/0039-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch diff --git a/patches/openwrt/0040-ar71xx-fix-wndr3700_board_detect-for-some-NETGEAR-WNDR3700v2-again.patch b/patches/openwrt/0040-ar71xx-fix-wndr3700_board_detect-for-some-NETGEAR-WNDR3700v2-again.patch deleted file mode 100644 index cc078e54..00000000 --- a/patches/openwrt/0040-ar71xx-fix-wndr3700_board_detect-for-some-NETGEAR-WNDR3700v2-again.patch +++ /dev/null @@ -1,46 +0,0 @@ -From: Matthias Schiffer -Date: Fri, 20 Nov 2015 15:09:03 +0100 -Subject: ar71xx: fix wndr3700_board_detect for some NETGEAR WNDR3700v2 (again) - -When fixing the model string for WNDR3700v2 which contain a model string -followed by 0xff in r46455, the match for other versions of the WNDR3700v2 -which just contain lots of 0xff broke (as the 0xff $model is checked for -is stripped off). - -Fix by stripping off non-printable characters only for the actual output -string, but not for the internal matching. - -diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh -index 388cf38..daebaa4 100755 ---- a/target/linux/ar71xx/base-files/lib/ar71xx.sh -+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh -@@ -37,8 +37,9 @@ wndr3700_board_detect() { - machine="NETGEAR WNDR3700" - ;; - "33373031") -- # Use awk to remove everything after the first zero byte -- model="$(ar71xx_get_mtd_offset_size_format art 41 32 %c | LC_CTYPE=C awk -v 'FS=[^[:print:]]' '{print $1; exit}')" -+ model="$(ar71xx_get_mtd_offset_size_format art 41 32 %c)" -+ # Use awk to remove everything unprintable -+ model_stripped="$(echo -n "$model" | LC_CTYPE=C awk -v 'FS=[^[:print:]]' '{print $1; exit}')" - case $model in - $'\xff'*) - if [ "${model:24:1}" = 'N' ]; then -@@ -48,14 +49,14 @@ wndr3700_board_detect() { - fi - ;; - '29763654+16+64'*) -- machine="NETGEAR ${model:14}" -+ machine="NETGEAR ${model_stripped:14}" - ;; - '29763654+16+128'*) -- machine="NETGEAR ${model:15}" -+ machine="NETGEAR ${model_stripped:15}" - ;; - *) - # Unknown ID -- machine="NETGEAR $model" -+ machine="NETGEAR ${model_stripped}" - esac - esac - diff --git a/patches/openwrt/0049-x86-generic-refresh-kernel-config.patch b/patches/openwrt/0040-x86-generic-refresh-kernel-config.patch similarity index 100% rename from patches/openwrt/0049-x86-generic-refresh-kernel-config.patch rename to patches/openwrt/0040-x86-generic-refresh-kernel-config.patch diff --git a/patches/openwrt/0041-CC-base-files-add-missing-public-key.patch b/patches/openwrt/0041-CC-base-files-add-missing-public-key.patch deleted file mode 100644 index 12cff28d..00000000 --- a/patches/openwrt/0041-CC-base-files-add-missing-public-key.patch +++ /dev/null @@ -1,17 +0,0 @@ -From: Matthias Schiffer -Date: Sat, 21 Nov 2015 18:35:49 +0100 -Subject: CC: base-files: add missing public key - -Add the secondary package signature key to the 15.05 sources so that people -building the release have the same keys as people using precompiled images. - -Signed-off-by: Jo-Philipp Wich - -diff --git a/package/base-files/files/etc/opkg/keys/de98a2dd1d0f8a07 b/package/base-files/files/etc/opkg/keys/de98a2dd1d0f8a07 -new file mode 100644 -index 0000000..5e3088c ---- /dev/null -+++ b/package/base-files/files/etc/opkg/keys/de98a2dd1d0f8a07 -@@ -0,0 +1,2 @@ -+untrusted comment: openwrt.org 15.05 release key -+RWTemKLdHQ+KBxOILy8gyk+5PaDVdfyJ32TFnY/jnQOrBAd1wobbLNYz diff --git a/patches/openwrt/0050-x86-generic-enable-pata_atiixp-driver.patch b/patches/openwrt/0041-x86-generic-enable-pata_atiixp-driver.patch similarity index 100% rename from patches/openwrt/0050-x86-generic-enable-pata_atiixp-driver.patch rename to patches/openwrt/0041-x86-generic-enable-pata_atiixp-driver.patch diff --git a/patches/openwrt/0044-Revert-bzip2-extend-fix-the-Host-Install-rule-to-install-libbz2.so-files.patch b/patches/openwrt/0044-Revert-bzip2-extend-fix-the-Host-Install-rule-to-install-libbz2.so-files.patch deleted file mode 100644 index 53e88b42..00000000 --- a/patches/openwrt/0044-Revert-bzip2-extend-fix-the-Host-Install-rule-to-install-libbz2.so-files.patch +++ /dev/null @@ -1,23 +0,0 @@ -From: Matthias Schiffer -Date: Tue, 8 Dec 2015 19:51:05 +0100 -Subject: Revert "bzip2: extend/fix the Host/Install rule to install libbz2.so files" - -This reverts commit f5ebfb02fc5f539e89393b8186f7ecd768402f12. - -diff --git a/package/utils/bzip2/Makefile b/package/utils/bzip2/Makefile -index ba47cfb..e1c7b97 100644 ---- a/package/utils/bzip2/Makefile -+++ b/package/utils/bzip2/Makefile -@@ -97,10 +97,9 @@ HOST_CONFIGURE_ARGS+= \ - --prefix=$(STAGING_DIR_HOST) - - define Host/Install -- $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin/ $(STAGING_DIR_HOST)/usr/lib -+ $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin/ - $(MAKE) -C $(HOST_BUILD_DIR) PREFIX=$(STAGING_DIR_HOST)/usr/ install -- $(CP) $(HOST_BUILD_DIR)/libbz2.so* $(STAGING_DIR_HOST)/usr/lib/ -- $(CP) $(HOST_BUILD_DIR)/libbz2.so.1.0 $(STAGING_DIR_HOST)/usr/lib/libbz2.so -+# $(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(STAGING_DIR_HOST)/bin/pgen2 - endef - - $(eval $(call HostBuild)) diff --git a/patches/openwrt/0045-ar71xx-another-fix-to-wndr3700_board_detect.patch b/patches/openwrt/0045-ar71xx-another-fix-to-wndr3700_board_detect.patch deleted file mode 100644 index e6671e98..00000000 --- a/patches/openwrt/0045-ar71xx-another-fix-to-wndr3700_board_detect.patch +++ /dev/null @@ -1,29 +0,0 @@ -From: Matthias Schiffer -Date: Sat, 2 Jan 2016 23:36:25 +0100 -Subject: ar71xx: another fix to wndr3700_board_detect - -My last bugfix (r47538) introduced a new bug in wndr3700_board_detect -(again...). - -Assigning the result of ar71xx_get_mtd_offset_size_format to the model -variable before stripping of garbage using awk will cause all NUL bytes to -be removed before awk is applied, leading to model strings like -"NETGEAR WNDRMACv2NETGEAR", where a NUL byte after the v2 is supposed to -terminate the string. - -Fix by calling ar71xx_get_mtd_offset_size_format twice, once piping to awk -directly. - -diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh -index daebaa4..d0abf42 100755 ---- a/target/linux/ar71xx/base-files/lib/ar71xx.sh -+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh -@@ -39,7 +39,7 @@ wndr3700_board_detect() { - "33373031") - model="$(ar71xx_get_mtd_offset_size_format art 41 32 %c)" - # Use awk to remove everything unprintable -- model_stripped="$(echo -n "$model" | LC_CTYPE=C awk -v 'FS=[^[:print:]]' '{print $1; exit}')" -+ model_stripped="$(ar71xx_get_mtd_offset_size_format art 41 32 %c | LC_CTYPE=C awk -v 'FS=[^[:print:]]' '{print $1; exit}')" - case $model in - $'\xff'*) - if [ "${model:24:1}" = 'N' ]; then diff --git a/patches/openwrt/0048-kernel-fix-keyring-reference-leak-CVE-2016-0728.patch b/patches/openwrt/0048-kernel-fix-keyring-reference-leak-CVE-2016-0728.patch deleted file mode 100644 index 406be868..00000000 --- a/patches/openwrt/0048-kernel-fix-keyring-reference-leak-CVE-2016-0728.patch +++ /dev/null @@ -1,87 +0,0 @@ -From: Matthias Schiffer -Date: Sat, 6 Feb 2016 07:35:33 +0100 -Subject: kernel: fix keyring reference leak (CVE-2016-0728) - -Signed-off-by: Felix Fietkau - -diff --git a/target/linux/generic/patches-3.18/010-KEYS-Fix-keyring-ref-leak-in-join_session_keyring.patch b/target/linux/generic/patches-3.18/010-KEYS-Fix-keyring-ref-leak-in-join_session_keyring.patch -new file mode 100644 -index 0000000..9c6a969 ---- /dev/null -+++ b/target/linux/generic/patches-3.18/010-KEYS-Fix-keyring-ref-leak-in-join_session_keyring.patch -@@ -0,0 +1,75 @@ -+From 7ca88764d45c209791e8813131c1457c2e9e51e7 Mon Sep 17 00:00:00 2001 -+From: Yevgeny Pats -+Date: Mon, 11 Jan 2016 12:05:28 +0000 -+Subject: KEYS: Fix keyring ref leak in join_session_keyring() -+ -+If a thread is asked to join as a session keyring the keyring that's already -+set as its session, we leak a keyring reference. -+ -+This can be tested with the following program: -+ -+ #include -+ #include -+ #include -+ #include -+ -+ int main(int argc, const char *argv[]) -+ { -+ int i = 0; -+ key_serial_t serial; -+ -+ serial = keyctl(KEYCTL_JOIN_SESSION_KEYRING, -+ "leaked-keyring"); -+ if (serial < 0) { -+ perror("keyctl"); -+ return -1; -+ } -+ -+ if (keyctl(KEYCTL_SETPERM, serial, -+ KEY_POS_ALL | KEY_USR_ALL) < 0) { -+ perror("keyctl"); -+ return -1; -+ } -+ -+ for (i = 0; i < 100; i++) { -+ serial = keyctl(KEYCTL_JOIN_SESSION_KEYRING, -+ "leaked-keyring"); -+ if (serial < 0) { -+ perror("keyctl"); -+ return -1; -+ } -+ } -+ -+ return 0; -+ } -+ -+If, after the program has run, there something like the following line in -+/proc/keys: -+ -+3f3d898f I--Q--- 100 perm 3f3f0000 0 0 keyring leaked-keyring: empty -+ -+with a usage count of 100 * the number of times the program has been run, -+then the kernel is malfunctioning. If leaked-keyring has zero usages or -+has been garbage collected, then the problem is fixed. -+ -+Reported-by: Yevgeny Pats -+Signed-off-by: David Howells -+--- -+ security/keys/process_keys.c | 1 + -+ 1 file changed, 1 insertion(+) -+ -+diff --git a/security/keys/process_keys.c b/security/keys/process_keys.c -+index a3f85d2..e6d50172 100644 -+--- a/security/keys/process_keys.c -++++ b/security/keys/process_keys.c -+@@ -794,6 +794,7 @@ long join_session_keyring(const char *name) -+ ret = PTR_ERR(keyring); -+ goto error2; -+ } else if (keyring == new->session_keyring) { -++ key_put(keyring); -+ ret = 0; -+ goto error2; -+ } -+-- -+2.7.0.rc3 -+ From 4ebbf01a515cf5562fa155c4ee91ab7215c21f36 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 8 Feb 2016 19:42:55 +0100 Subject: [PATCH 91/99] Update OpenWrt packages --- modules | 2 +- .../openwrt/0003-lua-cjson-add-host-build-support.patch | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules b/modules index f7b1af47..a834ab89 100644 --- a/modules +++ b/modules @@ -4,7 +4,7 @@ OPENWRT_REPO=git://git.openwrt.org/15.05/openwrt.git OPENWRT_COMMIT=c698aa66043a151ac76d19849be9ee24dfd78b72 PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git -PACKAGES_OPENWRT_COMMIT=f8a70fc188673d0ae8739b0a3095f7f61335fc10 +PACKAGES_OPENWRT_COMMIT=9622fe984bba3a4547f48bc507ebaba7637eb2b0 PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git diff --git a/patches/packages/openwrt/0003-lua-cjson-add-host-build-support.patch b/patches/packages/openwrt/0003-lua-cjson-add-host-build-support.patch index 9c1f7744..08fba881 100644 --- a/patches/packages/openwrt/0003-lua-cjson-add-host-build-support.patch +++ b/patches/packages/openwrt/0003-lua-cjson-add-host-build-support.patch @@ -3,7 +3,7 @@ Date: Wed, 30 Dec 2015 01:00:49 +0100 Subject: lua-cjson: add host build support diff --git a/lang/lua-cjson/Makefile b/lang/lua-cjson/Makefile -index fd489f2..90c8f98 100644 +index fbdcf17..1adfeb3 100644 --- a/lang/lua-cjson/Makefile +++ b/lang/lua-cjson/Makefile @@ -20,6 +20,7 @@ PKG_MD5SUM:=24f270663e9f6ca8ba2a02cef19f7963 From d84028301eb7d2ebda43f0b0500116b9cad6ce6d Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 8 Feb 2016 19:49:20 +0100 Subject: [PATCH 92/99] Update LuCI packages --- modules | 2 +- .../0003-luci-base-depend-on-libubus-lua.patch | 17 ----------------- ...e-non-string-or-number-keys-in-tables.patch} | 0 ...-lib-jsonc-allow-encoding-empty-lists.patch} | 0 ...ib-jsonc-Fix-memory-leak-in-stringify.patch} | 0 ...onc-Add-ltn12-compatible-sink-factory.patch} | 0 ...el.uci-add-add_to_set-remove_from_set.patch} | 0 ...dency-from-luci-base-to-luci-mode-rpc.patch} | 6 +++--- 8 files changed, 4 insertions(+), 21 deletions(-) delete mode 100644 patches/packages/luci/0003-luci-base-depend-on-libubus-lua.patch rename patches/packages/luci/{0004-luci-lib-jsonc-Ignore-non-string-or-number-keys-in-tables.patch => 0003-luci-lib-jsonc-Ignore-non-string-or-number-keys-in-tables.patch} (100%) rename patches/packages/luci/{0005-luci-lib-jsonc-allow-encoding-empty-lists.patch => 0004-luci-lib-jsonc-allow-encoding-empty-lists.patch} (100%) rename patches/packages/luci/{0006-luci-lib-jsonc-Fix-memory-leak-in-stringify.patch => 0005-luci-lib-jsonc-Fix-memory-leak-in-stringify.patch} (100%) rename patches/packages/luci/{0007-luci-lib-jsonc-Add-ltn12-compatible-sink-factory.patch => 0006-luci-lib-jsonc-Add-ltn12-compatible-sink-factory.patch} (100%) rename patches/packages/luci/{0008-model.uci-add-add_to_set-remove_from_set.patch => 0007-model.uci-add-add_to_set-remove_from_set.patch} (100%) rename patches/packages/luci/{0009-Move-rpcd-dependency-from-luci-base-to-luci-mode-rpc.patch => 0008-Move-rpcd-dependency-from-luci-base-to-luci-mode-rpc.patch} (84%) diff --git a/modules b/modules index a834ab89..805af847 100644 --- a/modules +++ b/modules @@ -14,5 +14,5 @@ PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_COMMIT=ae65d4fe027592652376f8dbd3ff2ef37f5a84bc PACKAGES_LUCI_REPO=git://github.com/openwrt/luci.git -PACKAGES_LUCI_COMMIT=8832d534e96d3a934bd02711884371fc78a0d506 +PACKAGES_LUCI_COMMIT=cdcdfd2594634804ab09dc8105e46116edce0cd6 PACKAGES_LUCI_BRANCH=for-15.05 diff --git a/patches/packages/luci/0003-luci-base-depend-on-libubus-lua.patch b/patches/packages/luci/0003-luci-base-depend-on-libubus-lua.patch deleted file mode 100644 index eb8f8aa2..00000000 --- a/patches/packages/luci/0003-luci-base-depend-on-libubus-lua.patch +++ /dev/null @@ -1,17 +0,0 @@ -From: Matthias Schiffer -Date: Thu, 21 May 2015 02:34:01 +0200 -Subject: luci-base: depend on libubus-lua - -diff --git a/modules/luci-base/Makefile b/modules/luci-base/Makefile -index 80bbda1..55c21eb 100644 ---- a/modules/luci-base/Makefile -+++ b/modules/luci-base/Makefile -@@ -12,7 +12,7 @@ LUCI_TYPE:=mod - LUCI_BASENAME:=base - - LUCI_TITLE:=LuCI core libraries --LUCI_DEPENDS:=+lua +libuci-lua +luci-lib-nixio +luci-lib-ip +rpcd -+LUCI_DEPENDS:=+lua +libuci-lua +libubus-lua +luci-lib-nixio +luci-lib-ip +rpcd - - PKG_SOURCE:=LuaSrcDiet-0.12.1.tar.bz2 - PKG_SOURCE_URL:=https://luasrcdiet.googlecode.com/files diff --git a/patches/packages/luci/0004-luci-lib-jsonc-Ignore-non-string-or-number-keys-in-tables.patch b/patches/packages/luci/0003-luci-lib-jsonc-Ignore-non-string-or-number-keys-in-tables.patch similarity index 100% rename from patches/packages/luci/0004-luci-lib-jsonc-Ignore-non-string-or-number-keys-in-tables.patch rename to patches/packages/luci/0003-luci-lib-jsonc-Ignore-non-string-or-number-keys-in-tables.patch diff --git a/patches/packages/luci/0005-luci-lib-jsonc-allow-encoding-empty-lists.patch b/patches/packages/luci/0004-luci-lib-jsonc-allow-encoding-empty-lists.patch similarity index 100% rename from patches/packages/luci/0005-luci-lib-jsonc-allow-encoding-empty-lists.patch rename to patches/packages/luci/0004-luci-lib-jsonc-allow-encoding-empty-lists.patch diff --git a/patches/packages/luci/0006-luci-lib-jsonc-Fix-memory-leak-in-stringify.patch b/patches/packages/luci/0005-luci-lib-jsonc-Fix-memory-leak-in-stringify.patch similarity index 100% rename from patches/packages/luci/0006-luci-lib-jsonc-Fix-memory-leak-in-stringify.patch rename to patches/packages/luci/0005-luci-lib-jsonc-Fix-memory-leak-in-stringify.patch diff --git a/patches/packages/luci/0007-luci-lib-jsonc-Add-ltn12-compatible-sink-factory.patch b/patches/packages/luci/0006-luci-lib-jsonc-Add-ltn12-compatible-sink-factory.patch similarity index 100% rename from patches/packages/luci/0007-luci-lib-jsonc-Add-ltn12-compatible-sink-factory.patch rename to patches/packages/luci/0006-luci-lib-jsonc-Add-ltn12-compatible-sink-factory.patch diff --git a/patches/packages/luci/0008-model.uci-add-add_to_set-remove_from_set.patch b/patches/packages/luci/0007-model.uci-add-add_to_set-remove_from_set.patch similarity index 100% rename from patches/packages/luci/0008-model.uci-add-add_to_set-remove_from_set.patch rename to patches/packages/luci/0007-model.uci-add-add_to_set-remove_from_set.patch diff --git a/patches/packages/luci/0009-Move-rpcd-dependency-from-luci-base-to-luci-mode-rpc.patch b/patches/packages/luci/0008-Move-rpcd-dependency-from-luci-base-to-luci-mode-rpc.patch similarity index 84% rename from patches/packages/luci/0009-Move-rpcd-dependency-from-luci-base-to-luci-mode-rpc.patch rename to patches/packages/luci/0008-Move-rpcd-dependency-from-luci-base-to-luci-mode-rpc.patch index 5c9445f9..ceacdf5a 100644 --- a/patches/packages/luci/0009-Move-rpcd-dependency-from-luci-base-to-luci-mode-rpc.patch +++ b/patches/packages/luci/0008-Move-rpcd-dependency-from-luci-base-to-luci-mode-rpc.patch @@ -6,15 +6,15 @@ LuCI's authentication won't work without rpcd, but we aren't using the authentication anyways. Users who need it can just install rpcd explicitly. diff --git a/modules/luci-base/Makefile b/modules/luci-base/Makefile -index 55c21eb..7a1009c 100644 +index 54506b0..4457034 100644 --- a/modules/luci-base/Makefile +++ b/modules/luci-base/Makefile @@ -12,7 +12,7 @@ LUCI_TYPE:=mod LUCI_BASENAME:=base LUCI_TITLE:=LuCI core libraries --LUCI_DEPENDS:=+lua +libuci-lua +libubus-lua +luci-lib-nixio +luci-lib-ip +rpcd -+LUCI_DEPENDS:=+lua +libuci-lua +libubus-lua +luci-lib-nixio +luci-lib-ip +-LUCI_DEPENDS:=+lua +libuci-lua +luci-lib-nixio +luci-lib-ip +rpcd +libubus-lua ++LUCI_DEPENDS:=+lua +libuci-lua +luci-lib-nixio +luci-lib-ip +libubus-lua PKG_SOURCE:=LuaSrcDiet-0.12.1.tar.bz2 PKG_SOURCE_URL:=https://luasrcdiet.googlecode.com/files From c523238f82d9e01deef38948b8526a41f1cb8d1f Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 8 Feb 2016 19:50:36 +0100 Subject: [PATCH 93/99] Update routing packages --- modules | 2 +- ...-adv-introduce-no_rebroadcast-option.patch | 41 +++++++----- ...n-adv-decrease-maximum-fragment-size.patch | 19 +++--- ...erface-but-also-a-link-local-address.patch | 62 ------------------- ... 0004-alfred-use-batman-adv-visdata.patch} | 2 +- 5 files changed, 41 insertions(+), 85 deletions(-) delete mode 100644 patches/packages/routing/0004-alfred-not-only-wait-for-the-interface-but-also-a-link-local-address.patch rename patches/packages/routing/{0005-alfred-use-batman-adv-visdata.patch => 0004-alfred-use-batman-adv-visdata.patch} (98%) diff --git a/modules b/modules index 805af847..58dfda33 100644 --- a/modules +++ b/modules @@ -11,7 +11,7 @@ PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git PACKAGES_GLUON_COMMIT=fd06c7d67da69713f0361dadab16393c26cb609b PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git -PACKAGES_ROUTING_COMMIT=ae65d4fe027592652376f8dbd3ff2ef37f5a84bc +PACKAGES_ROUTING_COMMIT=2a8338559de5c4b077cde7a83f43f4700a17d5cc PACKAGES_LUCI_REPO=git://github.com/openwrt/luci.git PACKAGES_LUCI_COMMIT=cdcdfd2594634804ab09dc8105e46116edce0cd6 diff --git a/patches/packages/routing/0002-batman-adv-introduce-no_rebroadcast-option.patch b/patches/packages/routing/0002-batman-adv-introduce-no_rebroadcast-option.patch index f4745ca3..f6d1646a 100644 --- a/patches/packages/routing/0002-batman-adv-introduce-no_rebroadcast-option.patch +++ b/patches/packages/routing/0002-batman-adv-introduce-no_rebroadcast-option.patch @@ -30,12 +30,12 @@ index 632a209..01f567f 100644 } diff --git a/batman-adv/patches/1001-batman-adv-introduce-no_rebroadcast-option.patch b/batman-adv/patches/1001-batman-adv-introduce-no_rebroadcast-option.patch new file mode 100644 -index 0000000..f461ddc +index 0000000..3324102 --- /dev/null +++ b/batman-adv/patches/1001-batman-adv-introduce-no_rebroadcast-option.patch -@@ -0,0 +1,172 @@ -+From a20c87779270f509227feecc4487e36a7d850c0f Mon Sep 17 00:00:00 2001 -+Message-Id: +@@ -0,0 +1,185 @@ ++From bb9feeed3b49a55034cce90be996b11cd095b1ce Mon Sep 17 00:00:00 2001 ++Message-Id: +From: =?UTF-8?q?Linus=20L=C3=BCssing?= +Date: Tue, 24 Sep 2013 04:36:27 +0200 +Subject: [PATCH 1/2] batman-adv: introduce 'no_rebroadcast' option @@ -70,6 +70,8 @@ index 0000000..f461ddc + net/batman-adv/types.h | 1 + + 5 files changed, 76 insertions(+) + ++diff --git a/Documentation/ABI/testing/sysfs-class-net-batman-adv b/Documentation/ABI/testing/sysfs-class-net-batman-adv ++index 7f34a95..cf7fe00 100644 +--- a/Documentation/ABI/testing/sysfs-class-net-batman-adv ++++ b/Documentation/ABI/testing/sysfs-class-net-batman-adv +@@ -13,3 +13,13 @@ Description: @@ -86,9 +88,11 @@ index 0000000..f461ddc ++ and symmetric only, for instance point-to-point wifi longshots ++ or wired links. Using this option wrongly is going to ++ break your mesh network, use at your own risk! ++diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c ++index aea4d06..66a703d 100644 +--- a/net/batman-adv/hard-interface.c ++++ b/net/batman-adv/hard-interface.c -+@@ -639,6 +639,8 @@ batadv_hardif_add_interface(struct net_d ++@@ -657,6 +657,8 @@ batadv_hardif_add_interface(struct net_device *net_dev) + /* extra reference for return */ + atomic_set(&hard_iface->refcount, 2); + @@ -97,9 +101,11 @@ index 0000000..f461ddc + batadv_check_known_mac_addr(hard_iface->net_dev); + list_add_tail_rcu(&hard_iface->list, &batadv_hardif_list); + ++diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c ++index c188f46..145f7cb 100644 +--- a/net/batman-adv/send.c ++++ b/net/batman-adv/send.c -+@@ -531,6 +531,10 @@ static void batadv_send_outstanding_bcas ++@@ -535,6 +535,10 @@ static void batadv_send_outstanding_bcast_packet(struct work_struct *work) + if (forw_packet->num_packets >= hard_iface->num_bcasts) + continue; + @@ -110,9 +116,11 @@ index 0000000..f461ddc + /* send a copy of the saved skb */ + skb1 = skb_clone(forw_packet->skb, GFP_ATOMIC); + if (skb1) ++diff --git a/net/batman-adv/sysfs.c b/net/batman-adv/sysfs.c ++index f38d7b7..600633c 100644 +--- a/net/batman-adv/sysfs.c ++++ b/net/batman-adv/sysfs.c -+@@ -129,6 +129,17 @@ struct batadv_attribute batadv_attr_vlan ++@@ -131,6 +131,17 @@ struct batadv_attribute batadv_attr_vlan_##_name = { \ + .store = _store, \ + } + @@ -130,7 +138,7 @@ index 0000000..f461ddc + /* Use this, if you have customized show and store functions */ + #define BATADV_ATTR(_name, _mode, _show, _store) \ + struct batadv_attribute batadv_attr_##_name = { \ -+@@ -239,6 +250,52 @@ ssize_t batadv_show_vlan_##_name(struct ++@@ -241,6 +252,52 @@ ssize_t batadv_show_vlan_##_name(struct kobject *kobj, \ + static BATADV_ATTR_VLAN(_name, _mode, batadv_show_vlan_##_name, \ + batadv_store_vlan_##_name) + @@ -182,8 +190,8 @@ index 0000000..f461ddc ++ + static int batadv_store_bool_attr(char *buff, size_t count, + struct net_device *net_dev, -+ const char *attr_name, atomic_t *attr) -+@@ -863,10 +920,12 @@ static ssize_t batadv_show_iface_status( ++ const char *attr_name, atomic_t *attr, ++@@ -870,10 +927,12 @@ static ssize_t batadv_show_iface_status(struct kobject *kobj, + static BATADV_ATTR(mesh_iface, S_IRUGO | S_IWUSR, batadv_show_mesh_iface, + batadv_store_mesh_iface); + static BATADV_ATTR(iface_status, S_IRUGO, batadv_show_iface_status, NULL); @@ -196,13 +204,18 @@ index 0000000..f461ddc + NULL, + }; + ++diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h ++index 5e8c8df..913f104 100644 +--- a/net/batman-adv/types.h ++++ b/net/batman-adv/types.h -+@@ -115,6 +115,7 @@ struct batadv_hard_iface { -+ struct batadv_hard_iface_bat_iv bat_iv; -+ struct work_struct cleanup_work; -+ struct dentry *debug_dir; ++@@ -120,6 +120,7 @@ struct batadv_hard_iface { ++ struct hlist_head neigh_list; ++ /* neigh_list_lock protects: neigh_list */ ++ spinlock_t neigh_list_lock; ++ atomic_t no_rebroadcast; + }; + + /** ++-- ++2.7.0 ++ diff --git a/patches/packages/routing/0003-batman-adv-decrease-maximum-fragment-size.patch b/patches/packages/routing/0003-batman-adv-decrease-maximum-fragment-size.patch index e7b5580e..a53bef28 100644 --- a/patches/packages/routing/0003-batman-adv-decrease-maximum-fragment-size.patch +++ b/patches/packages/routing/0003-batman-adv-decrease-maximum-fragment-size.patch @@ -4,14 +4,14 @@ Subject: batman-adv: decrease maximum fragment size diff --git a/batman-adv/patches/1002-batman-adv-decrease-maximum-fragment-size.patch b/batman-adv/patches/1002-batman-adv-decrease-maximum-fragment-size.patch new file mode 100644 -index 0000000..16cb023 +index 0000000..56311ea --- /dev/null +++ b/batman-adv/patches/1002-batman-adv-decrease-maximum-fragment-size.patch -@@ -0,0 +1,23 @@ -+From 02c861b6aa334dff1ce8031ffc328924c78beec1 Mon Sep 17 00:00:00 2001 -+Message-Id: <02c861b6aa334dff1ce8031ffc328924c78beec1.1438892883.git.mschiffer@universe-factory.net> -+In-Reply-To: -+References: +@@ -0,0 +1,28 @@ ++From 3de3f885d441f9059a4d4c88504845851667a68c Mon Sep 17 00:00:00 2001 ++Message-Id: <3de3f885d441f9059a4d4c88504845851667a68c.1454958586.git.mschiffer@universe-factory.net> ++In-Reply-To: ++References: +From: Matthias Schiffer +Date: Thu, 6 Aug 2015 22:27:01 +0200 +Subject: [PATCH 2/2] batman-adv: decrease maximum fragment size @@ -20,9 +20,11 @@ index 0000000..16cb023 + net/batman-adv/main.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + ++diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h ++index 34f56ef..81a7cc2 100644 +--- a/net/batman-adv/main.h ++++ b/net/batman-adv/main.h -+@@ -148,7 +148,7 @@ enum batadv_uev_type { ++@@ -147,7 +147,7 @@ enum batadv_uev_type { + /* Maximum number of fragments for one packet */ + #define BATADV_FRAG_MAX_FRAGMENTS 16 + /* Maxumim size of each fragment */ @@ -31,3 +33,6 @@ index 0000000..16cb023 + /* Time to keep fragments while waiting for rest of the fragments */ + #define BATADV_FRAG_TIMEOUT 10000 + ++-- ++2.7.0 ++ diff --git a/patches/packages/routing/0004-alfred-not-only-wait-for-the-interface-but-also-a-link-local-address.patch b/patches/packages/routing/0004-alfred-not-only-wait-for-the-interface-but-also-a-link-local-address.patch deleted file mode 100644 index e6873c7b..00000000 --- a/patches/packages/routing/0004-alfred-not-only-wait-for-the-interface-but-also-a-link-local-address.patch +++ /dev/null @@ -1,62 +0,0 @@ -From: Matthias Schiffer -Date: Sun, 9 Aug 2015 18:03:28 +0200 -Subject: alfred: not only wait for the interface, but also a link-local address - -Changes between alfred 2015.0 and 2015.1 cause alfred to print an error -and exit when the interface to bind to is not completely set up (has no -non-tentative link-local address). As a workaround, wait for such an -address by reading /proc/net/if_inet6 before alfred is started. - -In the long term, it would be nice to make alfred more robust against -missing interfaces (allowing alfred to start without the interface -existing, and keeping it working even when the interface is removed and -re-added while alfred is running). - -Signed-off-by: Matthias Schiffer - -diff --git a/alfred/files/alfred.init b/alfred/files/alfred.init -index 5ce06c0..8e1f11d 100755 ---- a/alfred/files/alfred.init -+++ b/alfred/files/alfred.init -@@ -37,6 +37,32 @@ wait_for_dir() - fi - } - -+wait_for_ll_address() -+{ -+ local iface="$1" -+ local timeout -+ -+ timeout=30 -+ echo "${initscript}: waiting $timeout secs for $iface address..." -+ for i in $(seq $timeout); do -+ # We look for -+ # - the link-local address (starts with fe80) -+ # - without tentative flag (bit 0x40 in the flags field; the first char of the flags field begins 38 columns after the fe80 prefix -+ # - on interface $iface -+ if awk ' -+ BEGIN { RET=1 } -+ /^fe80.{37} [012389ab]/ { if ($6 == "'"$iface"'") RET=0 } -+ END { exit RET } -+ ' /proc/net/if_inet6; then -+ return -+ fi -+ sleep 1 -+ done -+ -+ echo "${initscript}: $iface address not detected, alfred not starting." -+ exit 1 -+} -+ - alfred_start() - { - local args="" -@@ -62,7 +88,7 @@ alfred_start() - wait_for_dir "$batmanif" "/sys/class/net/$batmanif/mesh" - fi - -- wait_for_dir "$interface" "/sys/class/net/$interface/" -+ wait_for_ll_address "$interface" - - append alfred_args "$args" - enable=1 diff --git a/patches/packages/routing/0005-alfred-use-batman-adv-visdata.patch b/patches/packages/routing/0004-alfred-use-batman-adv-visdata.patch similarity index 98% rename from patches/packages/routing/0005-alfred-use-batman-adv-visdata.patch rename to patches/packages/routing/0004-alfred-use-batman-adv-visdata.patch index 6064774d..48b720be 100644 --- a/patches/packages/routing/0005-alfred-use-batman-adv-visdata.patch +++ b/patches/packages/routing/0004-alfred-use-batman-adv-visdata.patch @@ -3,7 +3,7 @@ Date: Mon, 14 Dec 2015 03:08:42 +0100 Subject: alfred: use batman-adv-visdata diff --git a/alfred/Makefile b/alfred/Makefile -index 8f49b5a..f1d7c6e 100644 +index 504fddd..f356f55 100644 --- a/alfred/Makefile +++ b/alfred/Makefile @@ -28,7 +28,7 @@ define Package/alfred From 19242f4deb047ea32b6d4fa9fc57a96d2fef702b Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 8 Feb 2016 20:58:28 +0100 Subject: [PATCH 94/99] Remove all uses of batman-adv-visdata Should be redundant after 0bd0df6f9303e5d553790ff49dc703b957fdac1d --- package/gluon-mesh-batman-adv-core/Makefile | 2 +- .../gluon-mesh-batman-adv-core/src/respondd.c | 2 +- .../lib/autoupdater/abort.d/50gluon-respondd | 1 - .../autoupdater/download.d/50gluon-respondd | 1 - package/gluon-status-page-api/Makefile | 2 +- .../src/neighbours-batadv.c | 2 +- .../0004-alfred-use-batman-adv-visdata.patch | 83 ------------------- 7 files changed, 4 insertions(+), 89 deletions(-) delete mode 100644 patches/packages/routing/0004-alfred-use-batman-adv-visdata.patch diff --git a/package/gluon-mesh-batman-adv-core/Makefile b/package/gluon-mesh-batman-adv-core/Makefile index 365ccbca..7ae7c305 100644 --- a/package/gluon-mesh-batman-adv-core/Makefile +++ b/package/gluon-mesh-batman-adv-core/Makefile @@ -12,7 +12,7 @@ define Package/gluon-mesh-batman-adv-core SECTION:=gluon CATEGORY:=Gluon TITLE:=Support for batman-adv meshing (core) - DEPENDS:=+gluon-core +libgluonutil +gluon-client-bridge +firewall +libiwinfo +batman-adv-visdata + DEPENDS:=+gluon-core +libgluonutil +gluon-client-bridge +firewall +libiwinfo endef define Build/Prepare diff --git a/package/gluon-mesh-batman-adv-core/src/respondd.c b/package/gluon-mesh-batman-adv-core/src/respondd.c index 7ffb94c1..83f25e30 100644 --- a/package/gluon-mesh-batman-adv-core/src/respondd.c +++ b/package/gluon-mesh-batman-adv-core/src/respondd.c @@ -468,7 +468,7 @@ static struct json_object * ifnames2addrs(struct json_object *interfaces) { } static struct json_object * get_batadv(void) { - FILE *f = fopen("/tmp/batman-adv-visdata/bat0/originators", "r"); + FILE *f = fopen("/sys/kernel/debug/batman_adv/bat0/originators", "r"); if (!f) return NULL; diff --git a/package/gluon-respondd/files/usr/lib/autoupdater/abort.d/50gluon-respondd b/package/gluon-respondd/files/usr/lib/autoupdater/abort.d/50gluon-respondd index 1a5e14e4..d29af306 100755 --- a/package/gluon-respondd/files/usr/lib/autoupdater/abort.d/50gluon-respondd +++ b/package/gluon-respondd/files/usr/lib/autoupdater/abort.d/50gluon-respondd @@ -3,5 +3,4 @@ . /lib/gluon/autoupdater/lib.sh -start_enabled batman-adv-visdata start_enabled gluon-respondd diff --git a/package/gluon-respondd/files/usr/lib/autoupdater/download.d/50gluon-respondd b/package/gluon-respondd/files/usr/lib/autoupdater/download.d/50gluon-respondd index 05f56fae..3edd5f1d 100755 --- a/package/gluon-respondd/files/usr/lib/autoupdater/download.d/50gluon-respondd +++ b/package/gluon-respondd/files/usr/lib/autoupdater/download.d/50gluon-respondd @@ -4,4 +4,3 @@ stop gluon-respondd -stop batman-adv-visdata diff --git a/package/gluon-status-page-api/Makefile b/package/gluon-status-page-api/Makefile index 17abab29..174e2e85 100644 --- a/package/gluon-status-page-api/Makefile +++ b/package/gluon-status-page-api/Makefile @@ -13,7 +13,7 @@ define Package/gluon-status-page-api SECTION:=gluon CATEGORY:=Gluon TITLE:=API for gluon-status-page - DEPENDS:=+gluon-core +uhttpd +sse-multiplex +batman-adv-visdata +gluon-neighbour-info +gluon-respondd +libiwinfo +libjson-c + DEPENDS:=+gluon-core +uhttpd +sse-multiplex +gluon-neighbour-info +gluon-respondd +libiwinfo +libjson-c endef define Build/Prepare diff --git a/package/gluon-status-page-api/src/neighbours-batadv.c b/package/gluon-status-page-api/src/neighbours-batadv.c index fb7be776..f0a484b2 100644 --- a/package/gluon-status-page-api/src/neighbours-batadv.c +++ b/package/gluon-status-page-api/src/neighbours-batadv.c @@ -12,7 +12,7 @@ static json_object *neighbours(void) { FILE *f; - f = fopen("/tmp/batman-adv-visdata/bat0/originators" , "r"); + f = fopen("/sys/kernel/debug/batman_adv/bat0/originators" , "r"); if (f == NULL) return NULL; diff --git a/patches/packages/routing/0004-alfred-use-batman-adv-visdata.patch b/patches/packages/routing/0004-alfred-use-batman-adv-visdata.patch deleted file mode 100644 index 48b720be..00000000 --- a/patches/packages/routing/0004-alfred-use-batman-adv-visdata.patch +++ /dev/null @@ -1,83 +0,0 @@ -From: Matthias Schiffer -Date: Mon, 14 Dec 2015 03:08:42 +0100 -Subject: alfred: use batman-adv-visdata - -diff --git a/alfred/Makefile b/alfred/Makefile -index 504fddd..f356f55 100644 ---- a/alfred/Makefile -+++ b/alfred/Makefile -@@ -28,7 +28,7 @@ define Package/alfred - SECTION:=net - CATEGORY:=Network - TITLE:=A.L.F.R.E.D. - Almighty Lightweight Fact Remote Exchange Daemon -- DEPENDS:= +libc +kmod-ipv6 +librt \ -+ DEPENDS:= +libc +kmod-ipv6 +librt +batman-adv-visdata \ - +ALFRED_NEEDS_lua:lua \ - +ALFRED_NEEDS_libgps:libgps - endef -diff --git a/alfred/patches/0002-alfred-use-batman-adv-visdata.patch b/alfred/patches/0002-alfred-use-batman-adv-visdata.patch -new file mode 100644 -index 0000000..a28b6a4 ---- /dev/null -+++ b/alfred/patches/0002-alfred-use-batman-adv-visdata.patch -@@ -0,0 +1,60 @@ -+--- a/batadv_query.c -++++ b/batadv_query.c -+@@ -91,8 +91,10 @@ int ipv6_to_mac(const struct in6_addr *a -+ int batadv_interface_check(const char *mesh_iface) -+ { -+ char *debugfs_mnt; -++#if 0 -+ char full_path[MAX_PATH + 1]; -+ FILE *f; -++#endif -+ -+ debugfs_mnt = debugfs_mount(NULL); -+ if (!debugfs_mnt) { -+@@ -100,6 +102,7 @@ int batadv_interface_check(const char *m -+ return -1; -+ } -+ -++#if 0 -+ debugfs_make_path(DEBUG_BATIF_PATH_FMT "/" DEBUG_TRANSTABLE_GLOBAL, -+ mesh_iface, full_path, sizeof(full_path)); -+ f = fopen(full_path, "r"); -+@@ -121,6 +124,7 @@ int batadv_interface_check(const char *m -+ return -1; -+ } -+ fclose(f); -++#endif -+ -+ return 0; -+ } -+@@ -150,8 +154,7 @@ struct ether_addr *translate_mac(const c -+ if (!debugfs_mnt) -+ goto out; -+ -+- debugfs_make_path(DEBUG_BATIF_PATH_FMT "/" DEBUG_TRANSTABLE_GLOBAL, -+- mesh_iface, full_path, sizeof(full_path)); -++ snprintf(full_path, sizeof(full_path), "/tmp/batman-adv-visdata/%s/transtable_global", mesh_iface); -+ -+ f = fopen(full_path, "r"); -+ if (!f) -+@@ -232,8 +235,7 @@ uint8_t get_tq(const char *mesh_iface, s -+ if (!debugfs_mnt) -+ goto out; -+ -+- debugfs_make_path(DEBUG_BATIF_PATH_FMT "/" DEBUG_ORIGINATORS, -+- mesh_iface, full_path, sizeof(full_path)); -++ snprintf(full_path, sizeof(full_path), "/tmp/batman-adv-visdata/%s/originators", mesh_iface); -+ -+ f = fopen(full_path, "r"); -+ if (!f) -+--- a/vis/vis.c -++++ b/vis/vis.c -+@@ -325,7 +325,7 @@ static int parse_orig_list(struct global -+ char path[1024]; -+ struct vis_list_entry *v_entry; -+ -+- snprintf(path, sizeof(path), "/sys/kernel/debug/batman_adv/%s/originators", globals->interface); -++ snprintf(path, sizeof(path), "/tmp/batman-adv-visdata/%s/originators", globals->interface); -+ fbuf = read_file(path); -+ if (!fbuf) -+ return -1; From 9a10ad688d4b50115709ac355bb527154a996ae5 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 9 Feb 2016 13:50:22 +0100 Subject: [PATCH 95/99] build: add support for choosing a different url filename part than the output file Backport of r47591 and r48427 --- ...l-filename-part-than-the-output-file.patch | 68 +++++++++++++++++++ ...mac80211-backport-from-trunk-r47249.patch} | 0 ...1-ath10k-allow-simultaneous-AP-IBSS.patch} | 0 ...te-NanoStation-Loco-txpower-offsets.patch} | 0 ...-support-for-tp-link-wr740n-v5.0-EU.patch} | 0 ...r71xx-add-support-for-TL-WR741ND-v5.patch} | 0 ...12-sunxi-fix-uboot-install-location.patch} | 0 ...i-respect-CONFIG_TARGET_IMAGES_GZIP.patch} | 0 ...urcefilter-to-disable-source-filter.patch} | 0 ...cast-rate-for-mesh-point-interfaces.patch} | 0 ...apd-prevent-channel-switch-for-5GHz.patch} | 0 ...-Link-TL-WR841N-ND-v9-Compex-WPJ531.patch} | 0 ...r71xx-rework-patch-for-qca953x-956x.patch} | 0 ...agate-the-real-postinst-return-code.patch} | 0 ...itional-libopenssl-build-dependency.patch} | 0 ...itional-libopenssl-build-dependency.patch} | 0 ...s.patch => 0022-odhcp6c-minor-fixes.patch} | 0 ...uner-support-for-UniFi-Outdoor-Plus.patch} | 0 ...ase-files-add-etc-profile.d-support.patch} | 0 ...52-based-USB-to-Ethernet-converters.patch} | 0 ...ils-tplink-safeloader-clean-up-code.patch} | 0 ...-format-clean-up-vendor-information.patch} | 0 ...n-1.1-support-to-CPE210-220-510-520.patch} | 0 ...s-with-prohibited-blackholed-source.patch} | 0 ...h-11s-VIF-together-with-another-VIF.patch} | 0 ...ty-firmware-as-an-additional-choice.patch} | 0 ...-add-correct-MAC-BB-name-for-ar9561.patch} | 0 ...TL-WR941ND-v6-international-version.patch} | 0 ...-support-for-TP-Link-TL-WR1043ND-v3.patch} | 0 ...th10k-calibration-data-load-changes.patch} | 0 ...x-AR71XX_MODEL-on-TP-Link-TL-WR703N.patch} | 0 ...d-compile-failure-on-mipsel-targets.patch} | 0 ...-Added-source-old-to-PKG_SOURCE_URL.patch} | 0 ...tallation-of-headers-for-host-build.patch} | 0 ...alloc-instead-of-oom-kill-processes.patch} | 0 ...1-x86-generic-refresh-kernel-config.patch} | 0 ...6-generic-enable-pata_atiixp-driver.patch} | 0 37 files changed, 68 insertions(+) create mode 100644 patches/openwrt/0006-build-add-support-for-choosing-a-different-url-filename-part-than-the-output-file.patch rename patches/openwrt/{0006-mac80211-backport-from-trunk-r47249.patch => 0007-mac80211-backport-from-trunk-r47249.patch} (100%) rename patches/openwrt/{0007-mac80211-ath10k-allow-simultaneous-AP-IBSS.patch => 0008-mac80211-ath10k-allow-simultaneous-AP-IBSS.patch} (100%) rename patches/openwrt/{0008-iwinfo-update-NanoStation-Loco-txpower-offsets.patch => 0009-iwinfo-update-NanoStation-Loco-txpower-offsets.patch} (100%) rename patches/openwrt/{0009-ar71xx-add-support-for-tp-link-wr740n-v5.0-EU.patch => 0010-ar71xx-add-support-for-tp-link-wr740n-v5.0-EU.patch} (100%) rename patches/openwrt/{0010-ar71xx-add-support-for-TL-WR741ND-v5.patch => 0011-ar71xx-add-support-for-TL-WR741ND-v5.patch} (100%) rename patches/openwrt/{0011-sunxi-fix-uboot-install-location.patch => 0012-sunxi-fix-uboot-install-location.patch} (100%) rename patches/openwrt/{0012-sunxi-respect-CONFIG_TARGET_IMAGES_GZIP.patch => 0013-sunxi-respect-CONFIG_TARGET_IMAGES_GZIP.patch} (100%) rename patches/openwrt/{0013-odhcp6c-add-option-sourcefilter-to-disable-source-filter.patch => 0014-odhcp6c-add-option-sourcefilter-to-disable-source-filter.patch} (100%) rename patches/openwrt/{0014-mac80211-set-mcast-rate-for-mesh-point-interfaces.patch => 0015-mac80211-set-mcast-rate-for-mesh-point-interfaces.patch} (100%) rename patches/openwrt/{0015-hostapd-prevent-channel-switch-for-5GHz.patch => 0016-hostapd-prevent-channel-switch-for-5GHz.patch} (100%) rename patches/openwrt/{0016-ar71xx-fix-ethernet-initialization-on-QCA953x-based-boards-TP-Link-TL-WR841N-ND-v9-Compex-WPJ531.patch => 0017-ar71xx-fix-ethernet-initialization-on-QCA953x-based-boards-TP-Link-TL-WR841N-ND-v9-Compex-WPJ531.patch} (100%) rename patches/openwrt/{0017-ar71xx-rework-patch-for-qca953x-956x.patch => 0018-ar71xx-rework-patch-for-qca953x-956x.patch} (100%) rename patches/openwrt/{0018-base-files-default_postinst-propagate-the-real-postinst-return-code.patch => 0019-base-files-default_postinst-propagate-the-real-postinst-return-code.patch} (100%) rename patches/openwrt/{0019-opkg-work-around-unconditional-libopenssl-build-dependency.patch => 0020-opkg-work-around-unconditional-libopenssl-build-dependency.patch} (100%) rename patches/openwrt/{0020-hostapd-work-around-unconditional-libopenssl-build-dependency.patch => 0021-hostapd-work-around-unconditional-libopenssl-build-dependency.patch} (100%) rename patches/openwrt/{0021-odhcp6c-minor-fixes.patch => 0022-odhcp6c-minor-fixes.patch} (100%) rename patches/openwrt/{0022-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch => 0023-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch} (100%) rename patches/openwrt/{0023-base-files-add-etc-profile.d-support.patch => 0024-base-files-add-etc-profile.d-support.patch} (100%) rename patches/openwrt/{0024-Kernel-Realtek-8150-and-Realtek-8152-based-USB-to-Ethernet-converters.patch => 0025-Kernel-Realtek-8150-and-Realtek-8152-based-USB-to-Ethernet-converters.patch} (100%) rename patches/openwrt/{0025-tools-firmware-utils-tplink-safeloader-clean-up-code.patch => 0026-tools-firmware-utils-tplink-safeloader-clean-up-code.patch} (100%) rename patches/openwrt/{0026-tools-firmware-utils-tplink-safeloader-fix-support-list-format-clean-up-vendor-information.patch => 0027-tools-firmware-utils-tplink-safeloader-fix-support-list-format-clean-up-vendor-information.patch} (100%) rename patches/openwrt/{0027-tools-firmware-utils-tplink-safeloader-add-version-1.1-support-to-CPE210-220-510-520.patch => 0028-tools-firmware-utils-tplink-safeloader-add-version-1.1-support-to-CPE210-220-510-520.patch} (100%) rename patches/openwrt/{0028-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch => 0029-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch} (100%) rename patches/openwrt/{0029-mac80211-fix-crash-when-using-mesh-11s-VIF-together-with-another-VIF.patch => 0030-mac80211-fix-crash-when-using-mesh-11s-VIF-together-with-another-VIF.patch} (100%) rename patches/openwrt/{0030-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch => 0031-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch} (100%) rename patches/openwrt/{0031-mac80211-ath9k-add-correct-MAC-BB-name-for-ar9561.patch => 0032-mac80211-ath9k-add-correct-MAC-BB-name-for-ar9561.patch} (100%) rename patches/openwrt/{0032-ar71xx-add-support-for-TP-LINK-TL-WR941ND-v6-international-version.patch => 0033-ar71xx-add-support-for-TP-LINK-TL-WR941ND-v6-international-version.patch} (100%) rename patches/openwrt/{0033-ar71xx-add-support-for-TP-Link-TL-WR1043ND-v3.patch => 0034-ar71xx-add-support-for-TP-Link-TL-WR1043ND-v3.patch} (100%) rename patches/openwrt/{0034-ar71xx-backport-ath10k-calibration-data-load-changes.patch => 0035-ar71xx-backport-ath10k-calibration-data-load-changes.patch} (100%) rename patches/openwrt/{0035-ar71xx-fix-AR71XX_MODEL-on-TP-Link-TL-WR703N.patch => 0036-ar71xx-fix-AR71XX_MODEL-on-TP-Link-TL-WR703N.patch} (100%) rename patches/openwrt/{0036-acx-mac80211-mark-as-BROKEN-to-avoid-compile-failure-on-mipsel-targets.patch => 0037-acx-mac80211-mark-as-BROKEN-to-avoid-compile-failure-on-mipsel-targets.patch} (100%) rename patches/openwrt/{0037-OpenSSL-Added-source-old-to-PKG_SOURCE_URL.patch => 0038-OpenSSL-Added-source-old-to-PKG_SOURCE_URL.patch} (100%) rename patches/openwrt/{0038-lua-fix-installation-of-headers-for-host-build.patch => 0039-lua-fix-installation-of-headers-for-host-build.patch} (100%) rename patches/openwrt/{0039-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch => 0040-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch} (100%) rename patches/openwrt/{0040-x86-generic-refresh-kernel-config.patch => 0041-x86-generic-refresh-kernel-config.patch} (100%) rename patches/openwrt/{0041-x86-generic-enable-pata_atiixp-driver.patch => 0042-x86-generic-enable-pata_atiixp-driver.patch} (100%) diff --git a/patches/openwrt/0006-build-add-support-for-choosing-a-different-url-filename-part-than-the-output-file.patch b/patches/openwrt/0006-build-add-support-for-choosing-a-different-url-filename-part-than-the-output-file.patch new file mode 100644 index 00000000..67564c80 --- /dev/null +++ b/patches/openwrt/0006-build-add-support-for-choosing-a-different-url-filename-part-than-the-output-file.patch @@ -0,0 +1,68 @@ +From: Matthias Schiffer +Date: Tue, 9 Feb 2016 13:49:01 +0100 +Subject: build: add support for choosing a different url filename part than the output file + +Signed-off-by: Felix Fietkau + +Backport of r47591 and r48427 + +diff --git a/include/download.mk b/include/download.mk +index 937b5d3..e518cce 100644 +--- a/include/download.mk ++++ b/include/download.mk +@@ -44,11 +44,11 @@ define DownloadMethod/unknown + endef + + define DownloadMethod/default +- $(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(FILE)" "$(MD5SUM)" $(foreach url,$(URL),"$(url)") ++ $(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(FILE)" "$(MD5SUM)" "$(URL_FILE)" $(foreach url,$(URL),"$(url)") + endef + + define wrap_mirror +- $(if $(if $(MIRROR),$(filter-out x,$(MIRROR_MD5SUM))),@$(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(FILE)" "$(MIRROR_MD5SUM)" || ( $(1) ),$(1)) ++ $(if $(if $(MIRROR),$(filter-out x,$(MIRROR_MD5SUM))),@$(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(FILE)" "$(MIRROR_MD5SUM)" "" || ( $(1) ),$(1)) + endef + + define DownloadMethod/cvs +@@ -157,6 +157,7 @@ Validate/darcs=VERSION SUBDIR + define Download/Defaults + URL:= + FILE:= ++ URL_FILE:= + PROTO:= + MD5SUM:= + SUBDIR:= +diff --git a/scripts/download.pl b/scripts/download.pl +index cd68a7b..111d03c 100755 +--- a/scripts/download.pl ++++ b/scripts/download.pl +@@ -11,15 +11,19 @@ use warnings; + use File::Basename; + use File::Copy; + +-@ARGV > 2 or die "Syntax: $0 [ ...]\n"; ++@ARGV > 2 or die "Syntax: $0 [ ...]\n"; + ++my $url_filename; + my $target = shift @ARGV; + my $filename = shift @ARGV; + my $md5sum = shift @ARGV; ++$url_filename = shift @ARGV unless $ARGV[0] =~ /:\/\//; + my $scriptdir = dirname($0); + my @mirrors; + my $ok; + ++$url_filename or $url_filename = $filename; ++ + sub localmirrors { + my @mlist; + open LM, "$scriptdir/localmirrors" and do { +@@ -106,7 +110,7 @@ sub download + return; + } + } else { +- open WGET, "wget -t5 --timeout=20 --no-check-certificate $options -O- '$mirror/$filename' |" or die "Cannot launch wget.\n"; ++ open WGET, "wget -t5 --timeout=20 --no-check-certificate $options -O- '$mirror/$url_filename' |" or die "Cannot launch wget.\n"; + open MD5SUM, "| $md5cmd > '$target/$filename.md5sum'" or die "Cannot launch md5sum.\n"; + open OUTPUT, "> $target/$filename.dl" or die "Cannot create file $target/$filename.dl: $!\n"; + my $buffer; diff --git a/patches/openwrt/0006-mac80211-backport-from-trunk-r47249.patch b/patches/openwrt/0007-mac80211-backport-from-trunk-r47249.patch similarity index 100% rename from patches/openwrt/0006-mac80211-backport-from-trunk-r47249.patch rename to patches/openwrt/0007-mac80211-backport-from-trunk-r47249.patch diff --git a/patches/openwrt/0007-mac80211-ath10k-allow-simultaneous-AP-IBSS.patch b/patches/openwrt/0008-mac80211-ath10k-allow-simultaneous-AP-IBSS.patch similarity index 100% rename from patches/openwrt/0007-mac80211-ath10k-allow-simultaneous-AP-IBSS.patch rename to patches/openwrt/0008-mac80211-ath10k-allow-simultaneous-AP-IBSS.patch diff --git a/patches/openwrt/0008-iwinfo-update-NanoStation-Loco-txpower-offsets.patch b/patches/openwrt/0009-iwinfo-update-NanoStation-Loco-txpower-offsets.patch similarity index 100% rename from patches/openwrt/0008-iwinfo-update-NanoStation-Loco-txpower-offsets.patch rename to patches/openwrt/0009-iwinfo-update-NanoStation-Loco-txpower-offsets.patch diff --git a/patches/openwrt/0009-ar71xx-add-support-for-tp-link-wr740n-v5.0-EU.patch b/patches/openwrt/0010-ar71xx-add-support-for-tp-link-wr740n-v5.0-EU.patch similarity index 100% rename from patches/openwrt/0009-ar71xx-add-support-for-tp-link-wr740n-v5.0-EU.patch rename to patches/openwrt/0010-ar71xx-add-support-for-tp-link-wr740n-v5.0-EU.patch diff --git a/patches/openwrt/0010-ar71xx-add-support-for-TL-WR741ND-v5.patch b/patches/openwrt/0011-ar71xx-add-support-for-TL-WR741ND-v5.patch similarity index 100% rename from patches/openwrt/0010-ar71xx-add-support-for-TL-WR741ND-v5.patch rename to patches/openwrt/0011-ar71xx-add-support-for-TL-WR741ND-v5.patch diff --git a/patches/openwrt/0011-sunxi-fix-uboot-install-location.patch b/patches/openwrt/0012-sunxi-fix-uboot-install-location.patch similarity index 100% rename from patches/openwrt/0011-sunxi-fix-uboot-install-location.patch rename to patches/openwrt/0012-sunxi-fix-uboot-install-location.patch diff --git a/patches/openwrt/0012-sunxi-respect-CONFIG_TARGET_IMAGES_GZIP.patch b/patches/openwrt/0013-sunxi-respect-CONFIG_TARGET_IMAGES_GZIP.patch similarity index 100% rename from patches/openwrt/0012-sunxi-respect-CONFIG_TARGET_IMAGES_GZIP.patch rename to patches/openwrt/0013-sunxi-respect-CONFIG_TARGET_IMAGES_GZIP.patch diff --git a/patches/openwrt/0013-odhcp6c-add-option-sourcefilter-to-disable-source-filter.patch b/patches/openwrt/0014-odhcp6c-add-option-sourcefilter-to-disable-source-filter.patch similarity index 100% rename from patches/openwrt/0013-odhcp6c-add-option-sourcefilter-to-disable-source-filter.patch rename to patches/openwrt/0014-odhcp6c-add-option-sourcefilter-to-disable-source-filter.patch diff --git a/patches/openwrt/0014-mac80211-set-mcast-rate-for-mesh-point-interfaces.patch b/patches/openwrt/0015-mac80211-set-mcast-rate-for-mesh-point-interfaces.patch similarity index 100% rename from patches/openwrt/0014-mac80211-set-mcast-rate-for-mesh-point-interfaces.patch rename to patches/openwrt/0015-mac80211-set-mcast-rate-for-mesh-point-interfaces.patch diff --git a/patches/openwrt/0015-hostapd-prevent-channel-switch-for-5GHz.patch b/patches/openwrt/0016-hostapd-prevent-channel-switch-for-5GHz.patch similarity index 100% rename from patches/openwrt/0015-hostapd-prevent-channel-switch-for-5GHz.patch rename to patches/openwrt/0016-hostapd-prevent-channel-switch-for-5GHz.patch diff --git a/patches/openwrt/0016-ar71xx-fix-ethernet-initialization-on-QCA953x-based-boards-TP-Link-TL-WR841N-ND-v9-Compex-WPJ531.patch b/patches/openwrt/0017-ar71xx-fix-ethernet-initialization-on-QCA953x-based-boards-TP-Link-TL-WR841N-ND-v9-Compex-WPJ531.patch similarity index 100% rename from patches/openwrt/0016-ar71xx-fix-ethernet-initialization-on-QCA953x-based-boards-TP-Link-TL-WR841N-ND-v9-Compex-WPJ531.patch rename to patches/openwrt/0017-ar71xx-fix-ethernet-initialization-on-QCA953x-based-boards-TP-Link-TL-WR841N-ND-v9-Compex-WPJ531.patch diff --git a/patches/openwrt/0017-ar71xx-rework-patch-for-qca953x-956x.patch b/patches/openwrt/0018-ar71xx-rework-patch-for-qca953x-956x.patch similarity index 100% rename from patches/openwrt/0017-ar71xx-rework-patch-for-qca953x-956x.patch rename to patches/openwrt/0018-ar71xx-rework-patch-for-qca953x-956x.patch diff --git a/patches/openwrt/0018-base-files-default_postinst-propagate-the-real-postinst-return-code.patch b/patches/openwrt/0019-base-files-default_postinst-propagate-the-real-postinst-return-code.patch similarity index 100% rename from patches/openwrt/0018-base-files-default_postinst-propagate-the-real-postinst-return-code.patch rename to patches/openwrt/0019-base-files-default_postinst-propagate-the-real-postinst-return-code.patch diff --git a/patches/openwrt/0019-opkg-work-around-unconditional-libopenssl-build-dependency.patch b/patches/openwrt/0020-opkg-work-around-unconditional-libopenssl-build-dependency.patch similarity index 100% rename from patches/openwrt/0019-opkg-work-around-unconditional-libopenssl-build-dependency.patch rename to patches/openwrt/0020-opkg-work-around-unconditional-libopenssl-build-dependency.patch diff --git a/patches/openwrt/0020-hostapd-work-around-unconditional-libopenssl-build-dependency.patch b/patches/openwrt/0021-hostapd-work-around-unconditional-libopenssl-build-dependency.patch similarity index 100% rename from patches/openwrt/0020-hostapd-work-around-unconditional-libopenssl-build-dependency.patch rename to patches/openwrt/0021-hostapd-work-around-unconditional-libopenssl-build-dependency.patch diff --git a/patches/openwrt/0021-odhcp6c-minor-fixes.patch b/patches/openwrt/0022-odhcp6c-minor-fixes.patch similarity index 100% rename from patches/openwrt/0021-odhcp6c-minor-fixes.patch rename to patches/openwrt/0022-odhcp6c-minor-fixes.patch diff --git a/patches/openwrt/0022-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch b/patches/openwrt/0023-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch similarity index 100% rename from patches/openwrt/0022-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch rename to patches/openwrt/0023-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch diff --git a/patches/openwrt/0023-base-files-add-etc-profile.d-support.patch b/patches/openwrt/0024-base-files-add-etc-profile.d-support.patch similarity index 100% rename from patches/openwrt/0023-base-files-add-etc-profile.d-support.patch rename to patches/openwrt/0024-base-files-add-etc-profile.d-support.patch diff --git a/patches/openwrt/0024-Kernel-Realtek-8150-and-Realtek-8152-based-USB-to-Ethernet-converters.patch b/patches/openwrt/0025-Kernel-Realtek-8150-and-Realtek-8152-based-USB-to-Ethernet-converters.patch similarity index 100% rename from patches/openwrt/0024-Kernel-Realtek-8150-and-Realtek-8152-based-USB-to-Ethernet-converters.patch rename to patches/openwrt/0025-Kernel-Realtek-8150-and-Realtek-8152-based-USB-to-Ethernet-converters.patch diff --git a/patches/openwrt/0025-tools-firmware-utils-tplink-safeloader-clean-up-code.patch b/patches/openwrt/0026-tools-firmware-utils-tplink-safeloader-clean-up-code.patch similarity index 100% rename from patches/openwrt/0025-tools-firmware-utils-tplink-safeloader-clean-up-code.patch rename to patches/openwrt/0026-tools-firmware-utils-tplink-safeloader-clean-up-code.patch diff --git a/patches/openwrt/0026-tools-firmware-utils-tplink-safeloader-fix-support-list-format-clean-up-vendor-information.patch b/patches/openwrt/0027-tools-firmware-utils-tplink-safeloader-fix-support-list-format-clean-up-vendor-information.patch similarity index 100% rename from patches/openwrt/0026-tools-firmware-utils-tplink-safeloader-fix-support-list-format-clean-up-vendor-information.patch rename to patches/openwrt/0027-tools-firmware-utils-tplink-safeloader-fix-support-list-format-clean-up-vendor-information.patch diff --git a/patches/openwrt/0027-tools-firmware-utils-tplink-safeloader-add-version-1.1-support-to-CPE210-220-510-520.patch b/patches/openwrt/0028-tools-firmware-utils-tplink-safeloader-add-version-1.1-support-to-CPE210-220-510-520.patch similarity index 100% rename from patches/openwrt/0027-tools-firmware-utils-tplink-safeloader-add-version-1.1-support-to-CPE210-220-510-520.patch rename to patches/openwrt/0028-tools-firmware-utils-tplink-safeloader-add-version-1.1-support-to-CPE210-220-510-520.patch diff --git a/patches/openwrt/0028-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch b/patches/openwrt/0029-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch similarity index 100% rename from patches/openwrt/0028-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch rename to patches/openwrt/0029-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch diff --git a/patches/openwrt/0029-mac80211-fix-crash-when-using-mesh-11s-VIF-together-with-another-VIF.patch b/patches/openwrt/0030-mac80211-fix-crash-when-using-mesh-11s-VIF-together-with-another-VIF.patch similarity index 100% rename from patches/openwrt/0029-mac80211-fix-crash-when-using-mesh-11s-VIF-together-with-another-VIF.patch rename to patches/openwrt/0030-mac80211-fix-crash-when-using-mesh-11s-VIF-together-with-another-VIF.patch diff --git a/patches/openwrt/0030-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch b/patches/openwrt/0031-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch similarity index 100% rename from patches/openwrt/0030-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch rename to patches/openwrt/0031-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch diff --git a/patches/openwrt/0031-mac80211-ath9k-add-correct-MAC-BB-name-for-ar9561.patch b/patches/openwrt/0032-mac80211-ath9k-add-correct-MAC-BB-name-for-ar9561.patch similarity index 100% rename from patches/openwrt/0031-mac80211-ath9k-add-correct-MAC-BB-name-for-ar9561.patch rename to patches/openwrt/0032-mac80211-ath9k-add-correct-MAC-BB-name-for-ar9561.patch diff --git a/patches/openwrt/0032-ar71xx-add-support-for-TP-LINK-TL-WR941ND-v6-international-version.patch b/patches/openwrt/0033-ar71xx-add-support-for-TP-LINK-TL-WR941ND-v6-international-version.patch similarity index 100% rename from patches/openwrt/0032-ar71xx-add-support-for-TP-LINK-TL-WR941ND-v6-international-version.patch rename to patches/openwrt/0033-ar71xx-add-support-for-TP-LINK-TL-WR941ND-v6-international-version.patch diff --git a/patches/openwrt/0033-ar71xx-add-support-for-TP-Link-TL-WR1043ND-v3.patch b/patches/openwrt/0034-ar71xx-add-support-for-TP-Link-TL-WR1043ND-v3.patch similarity index 100% rename from patches/openwrt/0033-ar71xx-add-support-for-TP-Link-TL-WR1043ND-v3.patch rename to patches/openwrt/0034-ar71xx-add-support-for-TP-Link-TL-WR1043ND-v3.patch diff --git a/patches/openwrt/0034-ar71xx-backport-ath10k-calibration-data-load-changes.patch b/patches/openwrt/0035-ar71xx-backport-ath10k-calibration-data-load-changes.patch similarity index 100% rename from patches/openwrt/0034-ar71xx-backport-ath10k-calibration-data-load-changes.patch rename to patches/openwrt/0035-ar71xx-backport-ath10k-calibration-data-load-changes.patch diff --git a/patches/openwrt/0035-ar71xx-fix-AR71XX_MODEL-on-TP-Link-TL-WR703N.patch b/patches/openwrt/0036-ar71xx-fix-AR71XX_MODEL-on-TP-Link-TL-WR703N.patch similarity index 100% rename from patches/openwrt/0035-ar71xx-fix-AR71XX_MODEL-on-TP-Link-TL-WR703N.patch rename to patches/openwrt/0036-ar71xx-fix-AR71XX_MODEL-on-TP-Link-TL-WR703N.patch diff --git a/patches/openwrt/0036-acx-mac80211-mark-as-BROKEN-to-avoid-compile-failure-on-mipsel-targets.patch b/patches/openwrt/0037-acx-mac80211-mark-as-BROKEN-to-avoid-compile-failure-on-mipsel-targets.patch similarity index 100% rename from patches/openwrt/0036-acx-mac80211-mark-as-BROKEN-to-avoid-compile-failure-on-mipsel-targets.patch rename to patches/openwrt/0037-acx-mac80211-mark-as-BROKEN-to-avoid-compile-failure-on-mipsel-targets.patch diff --git a/patches/openwrt/0037-OpenSSL-Added-source-old-to-PKG_SOURCE_URL.patch b/patches/openwrt/0038-OpenSSL-Added-source-old-to-PKG_SOURCE_URL.patch similarity index 100% rename from patches/openwrt/0037-OpenSSL-Added-source-old-to-PKG_SOURCE_URL.patch rename to patches/openwrt/0038-OpenSSL-Added-source-old-to-PKG_SOURCE_URL.patch diff --git a/patches/openwrt/0038-lua-fix-installation-of-headers-for-host-build.patch b/patches/openwrt/0039-lua-fix-installation-of-headers-for-host-build.patch similarity index 100% rename from patches/openwrt/0038-lua-fix-installation-of-headers-for-host-build.patch rename to patches/openwrt/0039-lua-fix-installation-of-headers-for-host-build.patch diff --git a/patches/openwrt/0039-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch b/patches/openwrt/0040-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch similarity index 100% rename from patches/openwrt/0039-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch rename to patches/openwrt/0040-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch diff --git a/patches/openwrt/0040-x86-generic-refresh-kernel-config.patch b/patches/openwrt/0041-x86-generic-refresh-kernel-config.patch similarity index 100% rename from patches/openwrt/0040-x86-generic-refresh-kernel-config.patch rename to patches/openwrt/0041-x86-generic-refresh-kernel-config.patch diff --git a/patches/openwrt/0041-x86-generic-enable-pata_atiixp-driver.patch b/patches/openwrt/0042-x86-generic-enable-pata_atiixp-driver.patch similarity index 100% rename from patches/openwrt/0041-x86-generic-enable-pata_atiixp-driver.patch rename to patches/openwrt/0042-x86-generic-enable-pata_atiixp-driver.patch From a40d3cddbae51dca6698388dc7910a77fcebe085 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 8 Feb 2016 22:26:29 +0100 Subject: [PATCH 96/99] mac80211: update backport to r48681 --- include/config | 1 - ...mac80211-backport-from-trunk-r48681.patch} | 13750 ++++++++++------ ...la-Technologies-firmware-for-QCA988X.patch | 59 + ...1-ath10k-allow-simultaneous-AP-IBSS.patch} | 0 ...te-NanoStation-Loco-txpower-offsets.patch} | 0 ...-support-for-tp-link-wr740n-v5.0-EU.patch} | 0 ...r71xx-add-support-for-TL-WR741ND-v5.patch} | 0 ...13-sunxi-fix-uboot-install-location.patch} | 0 ...i-respect-CONFIG_TARGET_IMAGES_GZIP.patch} | 0 ...mcast-rate-for-mesh-point-interfaces.patch | 47 - ...urcefilter-to-disable-source-filter.patch} | 0 ...TL-WR941ND-v6-international-version.patch} | 0 ...sh-11s-VIF-together-with-another-VIF.patch | 82 - ...-support-for-TP-Link-TL-WR1043ND-v3.patch} | 0 ...ity-firmware-as-an-additional-choice.patch | 70 - ...th10k-calibration-data-load-changes.patch} | 0 ...k-add-correct-MAC-BB-name-for-ar9561.patch | 35 - ...x-AR71XX_MODEL-on-TP-Link-TL-WR703N.patch} | 0 ...-Added-source-old-to-PKG_SOURCE_URL.patch} | 0 ...tallation-of-headers-for-host-build.patch} | 0 ...alloc-instead-of-oom-kill-processes.patch} | 0 ...id-compile-failure-on-mipsel-targets.patch | 17 - ...7-x86-generic-refresh-kernel-config.patch} | 0 ...6-generic-enable-pata_atiixp-driver.patch} | 0 targets/ar71xx-generic/profiles.mk | 2 +- 25 files changed, 8369 insertions(+), 5694 deletions(-) rename patches/openwrt/{0007-mac80211-backport-from-trunk-r47249.patch => 0007-mac80211-backport-from-trunk-r48681.patch} (76%) create mode 100644 patches/openwrt/0008-ath10k-firmware-add-Candela-Technologies-firmware-for-QCA988X.patch rename patches/openwrt/{0008-mac80211-ath10k-allow-simultaneous-AP-IBSS.patch => 0009-mac80211-ath10k-allow-simultaneous-AP-IBSS.patch} (100%) rename patches/openwrt/{0009-iwinfo-update-NanoStation-Loco-txpower-offsets.patch => 0010-iwinfo-update-NanoStation-Loco-txpower-offsets.patch} (100%) rename patches/openwrt/{0010-ar71xx-add-support-for-tp-link-wr740n-v5.0-EU.patch => 0011-ar71xx-add-support-for-tp-link-wr740n-v5.0-EU.patch} (100%) rename patches/openwrt/{0011-ar71xx-add-support-for-TL-WR741ND-v5.patch => 0012-ar71xx-add-support-for-TL-WR741ND-v5.patch} (100%) rename patches/openwrt/{0012-sunxi-fix-uboot-install-location.patch => 0013-sunxi-fix-uboot-install-location.patch} (100%) rename patches/openwrt/{0013-sunxi-respect-CONFIG_TARGET_IMAGES_GZIP.patch => 0014-sunxi-respect-CONFIG_TARGET_IMAGES_GZIP.patch} (100%) delete mode 100644 patches/openwrt/0015-mac80211-set-mcast-rate-for-mesh-point-interfaces.patch rename patches/openwrt/{0014-odhcp6c-add-option-sourcefilter-to-disable-source-filter.patch => 0015-odhcp6c-add-option-sourcefilter-to-disable-source-filter.patch} (100%) rename patches/openwrt/{0033-ar71xx-add-support-for-TP-LINK-TL-WR941ND-v6-international-version.patch => 0030-ar71xx-add-support-for-TP-LINK-TL-WR941ND-v6-international-version.patch} (100%) delete mode 100644 patches/openwrt/0030-mac80211-fix-crash-when-using-mesh-11s-VIF-together-with-another-VIF.patch rename patches/openwrt/{0034-ar71xx-add-support-for-TP-Link-TL-WR1043ND-v3.patch => 0031-ar71xx-add-support-for-TP-Link-TL-WR1043ND-v3.patch} (100%) delete mode 100644 patches/openwrt/0031-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch rename patches/openwrt/{0035-ar71xx-backport-ath10k-calibration-data-load-changes.patch => 0032-ar71xx-backport-ath10k-calibration-data-load-changes.patch} (100%) delete mode 100644 patches/openwrt/0032-mac80211-ath9k-add-correct-MAC-BB-name-for-ar9561.patch rename patches/openwrt/{0036-ar71xx-fix-AR71XX_MODEL-on-TP-Link-TL-WR703N.patch => 0033-ar71xx-fix-AR71XX_MODEL-on-TP-Link-TL-WR703N.patch} (100%) rename patches/openwrt/{0038-OpenSSL-Added-source-old-to-PKG_SOURCE_URL.patch => 0034-OpenSSL-Added-source-old-to-PKG_SOURCE_URL.patch} (100%) rename patches/openwrt/{0039-lua-fix-installation-of-headers-for-host-build.patch => 0035-lua-fix-installation-of-headers-for-host-build.patch} (100%) rename patches/openwrt/{0040-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch => 0036-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch} (100%) delete mode 100644 patches/openwrt/0037-acx-mac80211-mark-as-BROKEN-to-avoid-compile-failure-on-mipsel-targets.patch rename patches/openwrt/{0041-x86-generic-refresh-kernel-config.patch => 0037-x86-generic-refresh-kernel-config.patch} (100%) rename patches/openwrt/{0042-x86-generic-enable-pata_atiixp-driver.patch => 0038-x86-generic-enable-pata_atiixp-driver.patch} (100%) diff --git a/include/config b/include/config index aa949adf..12f8a7d4 100644 --- a/include/config +++ b/include/config @@ -18,6 +18,5 @@ CONFIG_BUSYBOX_CONFIG_FEATURE_WGET_TIMEOUT=y CONFIG_ATH_USER_REGD=y CONFIG_PACKAGE_ATH_DEBUG=y -CONFIG_ATH10K_CT_COMMUNITY_FW=y CONFIG_LUCI_SRCDIET=y diff --git a/patches/openwrt/0007-mac80211-backport-from-trunk-r47249.patch b/patches/openwrt/0007-mac80211-backport-from-trunk-r48681.patch similarity index 76% rename from patches/openwrt/0007-mac80211-backport-from-trunk-r47249.patch rename to patches/openwrt/0007-mac80211-backport-from-trunk-r48681.patch index 5f6e2ad0..27c6da67 100644 --- a/patches/openwrt/0007-mac80211-backport-from-trunk-r47249.patch +++ b/patches/openwrt/0007-mac80211-backport-from-trunk-r48681.patch @@ -1,9 +1,1156 @@ From: Matthias Schiffer Date: Tue, 23 Dec 2014 18:57:16 +0100 -Subject: mac80211: backport from trunk r47249 +Subject: mac80211: backport from trunk r48681 +Backport mac80211 and dependent drivers/firmwares from OpenWrt trunk. + +diff --git a/package/firmware/ath10k-firmware/Makefile b/package/firmware/ath10k-firmware/Makefile +new file mode 100644 +index 0000000..882294c +--- /dev/null ++++ b/package/firmware/ath10k-firmware/Makefile +@@ -0,0 +1,104 @@ ++# ++# Copyright (C) 2015 OpenWrt.org ++# ++# This is free software, licensed under the GNU General Public License v2. ++# See /LICENSE for more information. ++# ++ ++include $(TOPDIR)/rules.mk ++ ++PKG_NAME:=ath10k-firmware ++PKG_SOURCE_VERSION:=77f72b5f7dd940386d9e619a17904987759b7186 ++PKG_VERSION:=2014-11-13-$(PKG_SOURCE_VERSION) ++PKG_RELEASE:=1 ++ ++PKG_SOURCE_PROTO:=git ++PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz ++PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) ++PKG_SOURCE_URL:=https://github.com/kvalo/ath10k-firmware.git ++ ++PKG_MAINTAINER:=Felix Fietkau ++ ++include $(INCLUDE_DIR)/package.mk ++ ++WMENU:=Wireless Drivers ++ ++define Package/ath10k-firmware-default ++ SECTION:=kernel ++ CATEGORY:=Kernel modules ++ SUBMENU:=$(WMENU) ++ URL:=$(PKG_SOURCE_URL) ++ DEPENDS:=kmod-ath10k ++endef ++ ++define Package/ath10k-firmware-qca988x ++$(Package/ath10k-firmware-default) ++ DEFAULT:=PACKAGE_kmod-ath10k ++ TITLE:=ath10k firmware for QCA988x devices ++endef ++ ++QCA988X_FIRMWARE_FILE:=firmware-5.bin_10.2.4.97-1 ++ ++define Download/ath10k-firmware-qca988x ++ URL:=https://www.codeaurora.org/cgit/quic/qsdk/oss/firmware/ath10k-firmware/plain/10.2.4/ ++ FILE:=$(QCA988X_FIRMWARE_FILE) ++ MD5SUM:=fcb2fbd42d73a63fbf603505c718cbde ++endef ++$(eval $(call Download,ath10k-firmware-qca988x)) ++ ++define Package/ath10k-firmware-qca99x0 ++$(Package/ath10k-firmware-default) ++ TITLE:=ath10k firmware for QCA99x0 devices ++endef ++ ++define Package/ath10k-firmware-qca6174 ++$(Package/ath10k-firmware-default) ++ TITLE:=ath10k firmware for QCA6174 devices ++endef ++ ++QCA99X0_BOARD_REV:=ddcec9efd245da9365c474f513a855a55f3ac7fe ++QCA99X0_BOARD_FILE:=board-2.bin.$(QCA99X0_BOARD_REV) ++ ++define Download/qca99x0-board ++ URL:=https://www.codeaurora.org/cgit/quic/qsdk/oss/firmware/ath10k-firmware/plain/ath10k/QCA99X0/hw2.0 ++ URL_FILE:=board-2.bin?id=ddcec9efd245da9365c474f513a855a55f3ac7fe ++ FILE:=$(QCA99X0_BOARD_FILE) ++ MD5SUM:=a2b3c653c2363a5641200051d6333d0a ++endef ++$(eval $(call Download,qca99x0-board)) ++ ++define Build/Compile ++ ++endef ++ ++define Package/ath10k-firmware-qca988x/install ++ $(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA988X/hw2.0 ++ $(INSTALL_DATA) \ ++ $(PKG_BUILD_DIR)/QCA988X/board.bin \ ++ $(1)/lib/firmware/ath10k/QCA988X/hw2.0/ ++ $(INSTALL_DATA) \ ++ $(DL_DIR)/$(QCA988X_FIRMWARE_FILE) \ ++ $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-5.bin ++endef ++ ++define Package/ath10k-firmware-qca6174/install ++ $(INSTALL_DIR) $(1)/lib/firmware/ath10k ++ $(CP) $(PKG_BUILD_DIR)/QCA6174 $(1)/lib/firmware/ath10k/ ++endef ++ ++define Package/ath10k-firmware-qca99x0/install ++ $(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA99X0/hw2.0 ++ $(INSTALL_DATA) \ ++ $(DL_DIR)/$(QCA99X0_BOARD_FILE) \ ++ $(1)/lib/firmware/ath10k/QCA99X0/hw2.0/board-2.bin ++ $(INSTALL_DATA) \ ++ $(PKG_BUILD_DIR)/QCA99X0/hw2.0/boardData_AR900B_CUS239_5G_v2_001.bin \ ++ $(1)/lib/firmware/ath10k/QCA99X0/hw2.0/board.bin ++ $(INSTALL_DATA) \ ++ $(PKG_BUILD_DIR)/QCA99X0/hw2.0/firmware-5.bin_10.4.1.00030-1 \ ++ $(1)/lib/firmware/ath10k/QCA99X0/hw2.0/firmware-5.bin ++endef ++ ++$(eval $(call BuildPackage,ath10k-firmware-qca988x)) ++$(eval $(call BuildPackage,ath10k-firmware-qca99x0)) ++$(eval $(call BuildPackage,ath10k-firmware-qca6174)) +diff --git a/package/firmware/b43legacy-firmware/Makefile b/package/firmware/b43legacy-firmware/Makefile +new file mode 100644 +index 0000000..ec13c7d +--- /dev/null ++++ b/package/firmware/b43legacy-firmware/Makefile +@@ -0,0 +1,72 @@ ++# ++# Copyright (C) 2016 OpenWrt.org ++# ++# This is free software, licensed under the GNU General Public License v2. ++# See /LICENSE for more information. ++# ++ ++include $(TOPDIR)/rules.mk ++ ++PKG_NAME:=b43legacy-firmware ++PKG_VERSION:=3.130.20.0 ++PKG_RELEASE:=1 ++ ++PKG_SOURCE:=wl_apsta-$(PKG_VERSION).o ++PKG_SOURCE_URL:=http://downloads.openwrt.org/sources ++PKG_MD5SUM:=e08665c5c5b66beb9c3b2dd54aa80cb3 ++ ++include $(INCLUDE_DIR)/package.mk ++ ++define Package/b43legacy-firmware ++ SECTION:=firmware ++ CATEGORY:=Firmware ++ URL:=$(PKG_SOURCE_URL) ++ TITLE:=Broadcom bcm43xx b43legacy firmware ++endef ++ ++define Package/b43legacy-firmware/config ++ if PACKAGE_b43legacy-firmware ++ ++ config B43LEGACY_FW_SQUASH ++ bool "Remove unnecessary firmware files" ++ default y ++ help ++ This options allows you to remove unnecessary b43legacy firmware files ++ from the final rootfs image. This can reduce the rootfs size by ++ up to 50k. ++ ++ If unsure, say Y. ++ ++ config B43LEGACY_FW_SQUASH_COREREVS ++ string "Core revisions to include" ++ depends on B43LEGACY_FW_SQUASH ++ default "1,2,3,4" ++ help ++ This is a comma seperated list of core revision numbers. ++ ++ Example (keep files for rev4 only): ++ 4 ++ ++ Example (keep files for rev2 and rev4): ++ 2,4 ++ ++ endif ++endef ++ ++define Build/Prepare ++ mkdir -p $(PKG_BUILD_DIR) ++endef ++ ++define Build/Compile ++ ++endef ++ ++define Package/b43legacy-firmware/install ++ $(INSTALL_DIR) $(1)/lib/firmware ++ b43-fwcutter --unsupported -w $(1)/lib/firmware/ $(DL_DIR)/$(PKG_SOURCE) ++ ifneq ($(CONFIG_B43LEGACY_FW_SQUASH),) ++ b43-fwsquash.py "G" "$(CONFIG_B43LEGACY_FW_SQUASH_COREREVS)" "$(1)/lib/firmware/b43legacy" ++ endif ++endef ++ ++$(eval $(call BuildPackage,b43legacy-firmware)) +diff --git a/package/firmware/ixp4xx-microcode/Makefile b/package/firmware/ixp4xx-microcode/Makefile +index 52b44f3..1af1248 100644 +--- a/package/firmware/ixp4xx-microcode/Makefile ++++ b/package/firmware/ixp4xx-microcode/Makefile +@@ -1,4 +1,4 @@ +-# ++# + # Copyright (C) 2007 OpenWrt.org + # + # This is free software, licensed under the GNU General Public License v2. +diff --git a/package/firmware/lantiq/dsl-vrx200-firmware-xdsl-a/Makefile b/package/firmware/lantiq/dsl-vrx200-firmware-xdsl-a/Makefile +new file mode 100644 +index 0000000..e8dd659 +--- /dev/null ++++ b/package/firmware/lantiq/dsl-vrx200-firmware-xdsl-a/Makefile +@@ -0,0 +1,47 @@ ++# Copyright (C) 2015 OpenWrt.org ++# Copyright (C) 2015 Lantiq Beteiligungs GmbH & Co KG. ++# ++# This is free software, licensed under the GNU General Public License v2. ++# See /LICENSE for more information. ++ ++include $(TOPDIR)/rules.mk ++ ++PKG_NAME:=dsl_vr9_firmware_xdsl ++PKG_VERSION:=05.07.04.03.00.06_05.07.01.08.00.01_osc ++PKG_RELEASE:=1 ++PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz ++PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources ++PKG_MD5SUM:=4c8d9ca68dda88d3cfc0ca0fb946a63e ++ ++include $(INCLUDE_DIR)/package.mk ++ ++define Package/dsl-vrx200-firmware-xdsl-a ++ SECTION:=firmware ++ CATEGORY:=Firmware ++ TITLE:=VRX200 / VR9 CPE xDSL Annex A firmware ++ URL:=http://www.lantiq.com/ ++ DEPENDS:=@TARGET_lantiq_xrx200 ++endef ++ ++define Package/dsl-vrx200-firmware-xdsl-a/description ++ VRX200 / VR9 CPE VDSL and ADSL Annex A firmware ++endef ++ ++define Build/Prepare ++ rm -rf $(PKG_BUILD_DIR) ++ mkdir -p $(PKG_BUILD_DIR) ++ $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(PKG_SOURCE) ++endef ++ ++define Build/Compile ++endef ++ ++define Package/dsl-vrx200-firmware-xdsl-a/install ++ $(INSTALL_DIR) $(1)/lib/firmware/ ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/LICENSE $(1)/lib/firmware/xcpe_574306_571801.LICENSE ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/xcpe_574306_571801.bin $(1)/lib/firmware/ ++ ln -s xcpe_574306_571801.bin $(1)/lib/firmware/vdsl.bin ++ ln -s xcpe_574306_571801.bin $(1)/lib/firmware/adsl-a.bin ++endef ++ ++$(eval $(call BuildPackage,dsl-vrx200-firmware-xdsl-a)) +diff --git a/package/firmware/lantiq/dsl-vrx200-firmware-xdsl-b/Makefile b/package/firmware/lantiq/dsl-vrx200-firmware-xdsl-b/Makefile +new file mode 100644 +index 0000000..c283da2 +--- /dev/null ++++ b/package/firmware/lantiq/dsl-vrx200-firmware-xdsl-b/Makefile +@@ -0,0 +1,47 @@ ++# Copyright (C) 2015 OpenWrt.org ++# Copyright (C) 2015 Lantiq Beteiligungs GmbH & Co KG. ++# ++# This is free software, licensed under the GNU General Public License v2. ++# See /LICENSE for more information. ++ ++include $(TOPDIR)/rules.mk ++ ++PKG_NAME:=dsl_vr9_firmware_xdsl ++PKG_VERSION:=05.07.03.03.00.06_05.07.01.0C.00.02_osc ++PKG_RELEASE:=1 ++PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz ++PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources ++PKG_MD5SUM:=af5581836cbe574574590c046fe45bab ++ ++include $(INCLUDE_DIR)/package.mk ++ ++define Package/dsl-vrx200-firmware-xdsl-b ++ SECTION:=firmware ++ CATEGORY:=Firmware ++ TITLE:=VRX200 / VR9 CPE xDSL Annex B firmware ++ URL:=http://www.lantiq.com/ ++ DEPENDS:=@TARGET_lantiq_xrx200 ++endef ++ ++define Package/dsl-vrx200-firmware-xdsl-b/description ++ VRX200 / VR9 CPE VDSL and ADSL Annex B firmware ++endef ++ ++define Build/Prepare ++ rm -rf $(PKG_BUILD_DIR) ++ mkdir -p $(PKG_BUILD_DIR) ++ $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(PKG_SOURCE) ++endef ++ ++define Build/Compile ++endef ++ ++define Package/dsl-vrx200-firmware-xdsl-b/install ++ $(INSTALL_DIR) $(1)/lib/firmware/ ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/LICENSE $(1)/lib/firmware/xcpe_573306_571C02.LICENSE ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/xcpe_573306_571C02.bin $(1)/lib/firmware/ ++ ln -s xcpe_573306_571C02.bin $(1)/lib/firmware/vdsl.bin ++ ln -s xcpe_573306_571C02.bin $(1)/lib/firmware/adsl-b.bin ++endef ++ ++$(eval $(call BuildPackage,dsl-vrx200-firmware-xdsl-b)) +diff --git a/package/firmware/linux-firmware/Makefile b/package/firmware/linux-firmware/Makefile +index 015aff7..2fcd93b 100644 +--- a/package/firmware/linux-firmware/Makefile ++++ b/package/firmware/linux-firmware/Makefile +@@ -8,56 +8,33 @@ + include $(TOPDIR)/rules.mk + + PKG_NAME:=linux-firmware +-PKG_SOURCE_VERSION:=f8c22c692bdee57a20b092e647464ff6176df3ed +-PKG_VERSION:=2014-03-16-$(PKG_SOURCE_VERSION) ++PKG_SOURCE_VERSION:=52442afee9907bc32a058f22bb3295d040677c26 ++PKG_VERSION:=2016-01-25-$(PKG_SOURCE_VERSION) + PKG_RELEASE:=1 + + PKG_SOURCE_PROTO:=git + PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) ++PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION) ++PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR) + PKG_SOURCE_URL:=git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git + PKG_MIRROR_MD5SUM:=ca4d289ad9380471cae376fc7dd3660a + + PKG_MAINTAINER:=Felix Fietkau + +-include $(INCLUDE_DIR)/package.mk +- +-define Package/r8169-firmware +- SECTION:=firmware +- CATEGORY:=Firmware +- URL:=http://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git +- TITLE:=RealTek r8169 firmware +-endef +- +-define Build/Compile ++SCAN_DEPS = *.mk + +-endef +- +-define Package/r8169-firmware/install +- $(INSTALL_DIR) $(1)/lib/firmware/rtl_nic +- $(CP) \ +- $(PKG_BUILD_DIR)/rtl_nic/* \ +- $(1)/lib/firmware/rtl_nic +-endef +- +-$(eval $(call BuildPackage,r8169-firmware)) ++include $(INCLUDE_DIR)/package.mk + +-define Package/r8188eu-firmware ++define Package/firmware-default + SECTION:=firmware + CATEGORY:=Firmware + URL:=http://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git +- TITLE:=RealTek r8188eu firmware ++ TITLE:=$(1) + endef + + define Build/Compile + + endef + +-define Package/r8188eu-firmware/install +- $(INSTALL_DIR) $(1)/lib/firmware/rtlwifi +- $(CP) \ +- $(PKG_BUILD_DIR)/rtlwifi/rtl8188eufw.bin \ +- $(1)/lib/firmware/rtlwifi +-endef +- +-$(eval $(call BuildPackage,r8188eu-firmware)) ++include $(wildcard ./*.mk) ++#$(eval $(call BuildPackage,linux-firmware)) +diff --git a/package/firmware/linux-firmware/broadcom.mk b/package/firmware/linux-firmware/broadcom.mk +new file mode 100644 +index 0000000..659dc82 +--- /dev/null ++++ b/package/firmware/linux-firmware/broadcom.mk +@@ -0,0 +1,45 @@ ++Package/brcmfmac-firmware-pcie = $(call Package/firmware-default,Broadcom BCM43xx fullmac PCIe firmware) ++define Package/brcmfmac-firmware-pcie/install ++ $(INSTALL_DIR) $(1)/lib/firmware/brcm ++ $(INSTALL_DATA) \ ++ $(PKG_BUILD_DIR)/brcm/brcmfmac43602-pcie.ap.bin \ ++ $(1)/lib/firmware/brcm/brcmfmac43602-pcie.bin ++ $(INSTALL_DATA) \ ++ $(PKG_BUILD_DIR)/brcm/brcmfmac4366b-pcie.bin \ ++ $(1)/lib/firmware/brcm/ ++endef ++$(eval $(call BuildPackage,brcmfmac-firmware-pcie)) ++ ++Package/brcmfmac-firmware-sdio = $(call Package/firmware-default,Broadcom BCM43xx fullmac SDIO firmware) ++define Package/brcmfmac-firmware-sdio/install ++ $(INSTALL_DIR) $(1)/lib/firmware/brcm ++ $(INSTALL_DATA) \ ++ $(PKG_BUILD_DIR)/brcm/brcmfmac4329-sdio.bin \ ++ $(1)/lib/firmware/brcm/brcmfmac4329-sdio.bin ++ $(INSTALL_DATA) \ ++ $(PKG_BUILD_DIR)/brcm/brcmfmac43362-sdio.bin \ ++ $(1)/lib/firmware/brcm/brcmfmac43362-sdio.bin ++endef ++$(eval $(call BuildPackage,brcmfmac-firmware-sdio)) ++ ++Package/brcmfmac-firmware-usb = $(call Package/firmware-default,Broadcom BCM43xx fullmac USB firmware) ++define Package/brcmfmac-firmware-usb/install ++ $(INSTALL_DIR) $(1)/lib/firmware/brcm ++ $(INSTALL_DATA) \ ++ $(PKG_BUILD_DIR)/brcm/brcmfmac43236b.bin \ ++ $(1)/lib/firmware/brcm/ ++ $(INSTALL_DATA) \ ++ $(PKG_BUILD_DIR)/brcm/brcmfmac43143.bin \ ++ $(1)/lib/firmware/brcm/ ++endef ++$(eval $(call BuildPackage,brcmfmac-firmware-usb)) ++ ++Package/brcmsmac-firmware = $(call Package/firmware-default,Broadcom BCM43xx softmac PCIe firmware) ++define Package/brcmsmac-firmware/install ++ $(INSTALL_DIR) $(1)/lib/firmware/brcm ++ $(INSTALL_DATA) \ ++ $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/bcm43xx-0.fw \ ++ $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/bcm43xx_hdr-0.fw \ ++ $(1)/lib/firmware/brcm/ ++endef ++$(eval $(call BuildPackage,brcmsmac-firmware)) +diff --git a/package/firmware/linux-firmware/intel.mk b/package/firmware/linux-firmware/intel.mk +new file mode 100644 +index 0000000..f5adfaf +--- /dev/null ++++ b/package/firmware/linux-firmware/intel.mk +@@ -0,0 +1,192 @@ ++Package/ibt-firmware = $(call Package/firmware-default,Intel bluetooth firmware) ++define Package/ibt-firmware/install ++ $(INSTALL_DIR) $(1)/lib/firmware/intel ++ $(CP) \ ++ $(PKG_BUILD_DIR)/intel/*.bseq \ ++ $(1)/lib/firmware/intel ++endef ++$(eval $(call BuildPackage,ibt-firmware)) ++ ++Package/iwl3945-firmware = $(call Package/firmware-default,Intel IWL3945 firmware) ++define Package/iwl3945-firmware/install ++ $(INSTALL_DIR) $(1)/lib/firmware ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-3945-2.ucode $(1)/lib/firmware ++endef ++$(eval $(call BuildPackage,iwl3945-firmware)) ++ ++Package/iwl4965-firmware = $(call Package/firmware-default,Intel IWL4965 firmware) ++define Package/iwl4965-firmware/install ++ $(INSTALL_DIR) $(1)/lib/firmware ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-4965-2.ucode $(1)/lib/firmware ++endef ++$(eval $(call BuildPackage,iwl4965-firmware)) ++ ++Package/iwlwifi-firmware = $(call Package/firmware-default,Intel wireless firmware) ++define Package/iwlwifi-firmware/config ++ if PACKAGE_iwlwifi-firmware ++ config IWL100_FW ++ bool "Intel 100 Firmware" ++ default y ++ help ++ Download and install firmware for: ++ Intel Centrino Wireless-N 100 ++ ++ config IWL1000_FW ++ bool "Intel 1000 Firmware" ++ default y ++ help ++ Download and install firmware for: ++ Intel Centrino Wireless-N 1000 ++ ++ config IWL105_FW ++ bool "Intel 105 Firmware" ++ default y ++ help ++ Download and install firmware for: ++ Intel Centrino Wireless-N 105 ++ ++ config IWL135_FW ++ bool "Intel 135 Firmware" ++ default y ++ help ++ Download and install firmware for: ++ Intel Centrino Wireless-N 135 ++ ++ config IWL2000_FW ++ bool "Intel 2000 Firmware" ++ default y ++ help ++ Download and install firmware for: ++ Intel Centrino Wireless-N 2200 ++ ++ config IWL2030_FW ++ bool "Intel 2030 Firmware" ++ default y ++ help ++ Download and install firmware for: ++ Intel Centrino Wireless-N 2230 ++ ++ config IWL3160_FW ++ bool "Intel 3160 Firmware" ++ default y ++ help ++ Download and install firmware for: ++ Intel Wireless WiFi 3160 ++ ++ config IWL5000_FW ++ bool "Intel 5000 Firmware" ++ default y ++ help ++ Download and install firmware for: ++ Intel Wireless WiFi 5100AGN, 5300AGN, and 5350AGN ++ ++ config IWL5150_FW ++ bool "Intel 5150 Firmware" ++ default y ++ help ++ Download and install firmware for: ++ Intel Wireless WiFi 5150AGN ++ ++ config IWL6000_FW ++ bool "Intel 6000 Firmware" ++ default y ++ help ++ Download and install firmware for: ++ Intel Centrino Ultimate-N 6300 and Advanced-N 6200 ++ ++ config IWL6005_FW ++ bool "Intel 6005 Firmware" ++ default y ++ help ++ Download and install firmware for: ++ Intel Centrino Advanced-N 6205 ++ ++ config IWL6030_FW ++ bool "Intel 6030 Firmware" ++ default y ++ help ++ Download and install firmware for: ++ Intel Centrino Advanced-N 6230, Wireless-N 1030, Wireless-N 130 and Advanced-N 6235 ++ ++ config IWL6050_FW ++ bool "Intel 6050 Firmware" ++ default y ++ help ++ Download and install firmware for: ++ Intel Centrino Advanced-N + WiMAX 6250 and Wireless-N + WiMAX 6150 ++ ++ config IWL7260_FW ++ bool "Intel 7260 Firmware" ++ default y ++ help ++ Download and install firmware for: ++ Intel Dual Band Wireless-N 7260 and Intel Dual Band Wireless-AC 7260 ++ ++ config IWL7265_FW ++ bool "Intel 7265 Firmware" ++ default y ++ help ++ Download and install firmware for: ++ Intel Wireless 7265, 7265D, 3165 ++ ++ config IWL8000_FW ++ bool "Intel 8000 Series Firmware" ++ default y ++ help ++ Download and install firmware for: ++ Intel Wireless Series 8260, 4165 ++ endif ++endef ++define Package/iwlwifi-firmware/install ++ $(INSTALL_DIR) $(1)/lib/firmware ++ifneq ($(CONFIG_IWL100_FW),) ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-100-5.ucode $(1)/lib/firmware ++endif ++ifneq ($(CONFIG_IWL1000_FW),) ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-1000-5.ucode $(1)/lib/firmware ++endif ++ifneq ($(CONFIG_IWL105_FW),) ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-105-6.ucode $(1)/lib/firmware ++endif ++ifneq ($(CONFIG_IWL135_FW),) ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-135-6.ucode $(1)/lib/firmware ++endif ++ifneq ($(CONFIG_IWL2000_FW),) ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-2000-6.ucode $(1)/lib/firmware ++endif ++ifneq ($(CONFIG_IWL2030_FW),) ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-2030-6.ucode $(1)/lib/firmware ++endif ++ifneq ($(CONFIG_IWL3160_FW),) ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-3160-16.ucode $(1)/lib/firmware ++endif ++ifneq ($(CONFIG_IWL5000_FW),) ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-5000-5.ucode $(1)/lib/firmware ++endif ++ifneq ($(CONFIG_IWL5150_FW),) ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-5150-2.ucode $(1)/lib/firmware ++endif ++ifneq ($(CONFIG_IWL6000_FW),) ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-6000-4.ucode $(1)/lib/firmware ++endif ++ifneq ($(CONFIG_IWL6005_FW),) ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-6000g2a-6.ucode $(1)/lib/firmware ++endif ++ifneq ($(CONFIG_IWL6030_FW),) ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-6000g2b-6.ucode $(1)/lib/firmware ++endif ++ifneq ($(CONFIG_IWL6050_FW),) ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-6050-5.ucode $(1)/lib/firmware ++endif ++ifneq ($(CONFIG_IWL7260_FW),) ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-7260-16.ucode $(1)/lib/firmware ++endif ++ifneq ($(CONFIG_IWL7265_FW),) ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-7265-16.ucode $(1)/lib/firmware ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-7265D-16.ucode $(1)/lib/firmware ++endif ++ifneq ($(CONFIG_IWL8000_FW),) ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-8000C-16.ucode $(1)/lib/firmware ++endif ++endef ++$(eval $(call BuildPackage,iwlwifi-firmware)) +diff --git a/package/firmware/linux-firmware/marvell.mk b/package/firmware/linux-firmware/marvell.mk +new file mode 100644 +index 0000000..86c0e6f +--- /dev/null ++++ b/package/firmware/linux-firmware/marvell.mk +@@ -0,0 +1,46 @@ ++Package/mwl8k-firmware = $(call Package/firmware-default,Marvell 8366/8687 firmware) ++define Package/mwl8k-firmware/install ++ $(INSTALL_DIR) $(1)/lib/firmware/mwl8k ++ $(INSTALL_DATA) \ ++ $(PKG_BUILD_DIR)/mwl8k/fmimage_8366_ap-3.fw \ ++ $(PKG_BUILD_DIR)/mwl8k/fmimage_8366.fw \ ++ $(PKG_BUILD_DIR)/mwl8k/helper_8366.fw \ ++ $(PKG_BUILD_DIR)/mwl8k/fmimage_8687.fw \ ++ $(PKG_BUILD_DIR)/mwl8k/helper_8687.fw \ ++ $(1)/lib/firmware/mwl8k/ ++endef ++$(eval $(call BuildPackage,mwl8k-firmware)) ++ ++Package/mwifiex-pcie-firmware = $(call Package/firmware-default,Marvell 8897 firmware) ++define Package/mwifiex-pcie-firmware/install ++ $(INSTALL_DIR) $(1)/lib/firmware/mrvl ++ $(INSTALL_DATA) \ ++ $(PKG_BUILD_DIR)/mrvl/pcie8897_uapsta.bin \ ++ $(1)/lib/firmware/mrvl/ ++endef ++$(eval $(call BuildPackage,mwifiex-pcie-firmware)) ++ ++Package/libertas-usb-firmware = $(call Package/firmware-default,Marvell 8388/8682 USB firmware) ++define Package/libertas-usb-firmware/install ++ $(INSTALL_DIR) $(1)/lib/firmware/libertas ++ $(INSTALL_DATA) \ ++ $(PKG_BUILD_DIR)/libertas/usb8388_v9.bin \ ++ $(PKG_BUILD_DIR)/libertas/usb8682.bin \ ++ $(1)/lib/firmware/libertas/ ++endef ++$(eval $(call BuildPackage,libertas-usb-firmware)) ++ ++Package/libertas-sdio-firmware = $(call Package/firmware-default,Marvell 8385/8686/8688 SDIO firmware) ++define Package/libertas-sdio-firmware/install ++ $(INSTALL_DIR) $(1)/lib/firmware/libertas ++ $(INSTALL_DATA) \ ++ $(PKG_BUILD_DIR)/libertas/sd8385_helper.bin \ ++ $(PKG_BUILD_DIR)/libertas/sd8385.bin \ ++ $(PKG_BUILD_DIR)/libertas/sd8686_v9_helper.bin \ ++ $(PKG_BUILD_DIR)/libertas/sd8686_v9.bin \ ++ $(PKG_BUILD_DIR)/libertas/sd8688_helper.bin \ ++ $(PKG_BUILD_DIR)/libertas/sd8688.bin \ ++ $(1)/lib/firmware/libertas ++endef ++$(eval $(call BuildPackage,libertas-sdio-firmware)) ++ +diff --git a/package/firmware/linux-firmware/mediatek.mk b/package/firmware/linux-firmware/mediatek.mk +new file mode 100644 +index 0000000..591ffee +--- /dev/null ++++ b/package/firmware/linux-firmware/mediatek.mk +@@ -0,0 +1,43 @@ ++Package/mt7601u-firmware = $(call Package/firmware-default,MediaTek MT7601U firmware) ++define Package/mt7601u-firmware/install ++ $(INSTALL_DIR) $(1)/lib/firmware ++ $(INSTALL_DATA) \ ++ $(PKG_BUILD_DIR)/mt7601u.bin \ ++ $(1)/lib/firmware ++endef ++$(eval $(call BuildPackage,mt7601u-firmware)) ++ ++Package/rt2800-pci-firmware = $(call Package/firmware-default,Ralink RT28xx/3xxx PCI/SoC firmware) ++define Package/rt2800-pci-firmware/install ++ $(INSTALL_DIR) $(1)/lib/firmware ++ $(INSTALL_DATA) \ ++ $(PKG_BUILD_DIR)/rt2860.bin \ ++ $(PKG_BUILD_DIR)/rt3290.bin \ ++ $(1)/lib/firmware ++endef ++$(eval $(call BuildPackage,rt2800-pci-firmware)) ++ ++Package/rt2800-usb-firmware = $(call Package/firmware-default,Ralink RT28xx/3xxx USB firmware) ++define Package/rt2800-usb-firmware/install ++ $(INSTALL_DIR) $(1)/lib/firmware ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/rt2870.bin $(1)/lib/firmware/ ++endef ++$(eval $(call BuildPackage,rt2800-usb-firmware)) ++ ++Package/rt61-pci-firmware = $(call Package/firmware-default,Ralink RT2561 firmware) ++define Package/rt61-pci-firmware/install ++ $(INSTALL_DIR) $(1)/lib/firmware ++ $(INSTALL_DATA) \ ++ $(PKG_BUILD_DIR)/rt2561.bin \ ++ $(PKG_BUILD_DIR)/rt2561s.bin \ ++ $(PKG_BUILD_DIR)/rt2661.bin \ ++ $(1)/lib/firmware/ ++endef ++$(eval $(call BuildPackage,rt61-pci-firmware)) ++ ++Package/rt73-pci-firmware = $(call Package/firmware-default,Ralink RT2573 firmware) ++define Package/rt73-usb-firmware/install ++ $(INSTALL_DIR) $(1)/lib/firmware ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/rt73.bin $(1)/lib/firmware/ ++endef ++$(eval $(call BuildPackage,rt73-pci-firmware)) +diff --git a/package/firmware/linux-firmware/qca.mk b/package/firmware/linux-firmware/qca.mk +new file mode 100644 +index 0000000..7ad27ef +--- /dev/null ++++ b/package/firmware/linux-firmware/qca.mk +@@ -0,0 +1,25 @@ ++Package/ar3k-firmware = $(call Package/firmware-default,ath3k firmware) ++define Package/ar3k-firmware/install ++ $(INSTALL_DIR) $(1)/lib/firmware/ar3k ++ $(CP) \ ++ $(PKG_BUILD_DIR)/ar3k/*.dfu \ ++ $(1)/lib/firmware/ar3k ++endef ++$(eval $(call BuildPackage,ar3k-firmware)) ++ ++Package/ath9k-htc-firmware = $(call Package/firmware-default,AR9271/AR7010 firmware) ++define Package/ath9k-htc-firmware/install ++ $(INSTALL_DIR) $(1)/lib/firmware/ath9k_htc ++ $(INSTALL_DATA) \ ++ $(PKG_BUILD_DIR)/ath9k_htc/htc_9271-1.4.0.fw \ ++ $(PKG_BUILD_DIR)/ath9k_htc/htc_7010-1.4.0.fw \ ++ $(1)/lib/firmware/ath9k_htc ++endef ++$(eval $(call BuildPackage,ath9k-htc-firmware)) ++ ++Package/carl9170-firmware = $(call Package/firmware-default,AR9170 firmware) ++define Package/carl9170-firmware/install ++ $(INSTALL_DIR) $(1)/lib/firmware ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/carl9170-1.fw $(1)/lib/firmware ++endef ++$(eval $(call BuildPackage,carl9170-firmware)) +diff --git a/package/firmware/linux-firmware/realtek.mk b/package/firmware/linux-firmware/realtek.mk +new file mode 100644 +index 0000000..0f8b1ce +--- /dev/null ++++ b/package/firmware/linux-firmware/realtek.mk +@@ -0,0 +1,50 @@ ++Package/r8169-firmware = $(call Package/firmware-default,RealTek RTL8169 firmware) ++define Package/r8169-firmware/install ++ $(INSTALL_DIR) $(1)/lib/firmware/rtl_nic ++ $(CP) \ ++ $(PKG_BUILD_DIR)/rtl_nic/* \ ++ $(1)/lib/firmware/rtl_nic ++endef ++$(eval $(call BuildPackage,r8169-firmware)) ++ ++Package/r8188eu-firmware = $(call Package/firmware-default,RealTek RTL8188EU firmware) ++define Package/r8188eu-firmware/install ++ $(INSTALL_DIR) $(1)/lib/firmware/rtlwifi ++ $(CP) \ ++ $(PKG_BUILD_DIR)/rtlwifi/rtl8188eufw.bin \ ++ $(1)/lib/firmware/rtlwifi ++endef ++$(eval $(call BuildPackage,r8188eu-firmware)) ++ ++Package/rtl8192ce-firmware = $(call Package/firmware-default,RealTek RTL8192CE firmware) ++define Package/rtl8192ce-firmware/install ++ $(INSTALL_DIR) $(1)/lib/firmware/rtlwifi ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8192cfw.bin $(1)/lib/firmware/rtlwifi ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8192cfwU.bin $(1)/lib/firmware/rtlwifi ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8192cfwU_B.bin $(1)/lib/firmware/rtlwifi ++endef ++$(eval $(call BuildPackage,rtl8192ce-firmware)) ++ ++Package/rtl8192cu-firmware = $(call Package/firmware-default,RealTek RTL8192CU firmware) ++define Package/rtl8192cu-firmware/install ++ $(INSTALL_DIR) $(1)/lib/firmware/rtlwifi ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8192cufw.bin $(1)/lib/firmware/rtlwifi ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8192cufw_A.bin $(1)/lib/firmware/rtlwifi ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8192cufw_B.bin $(1)/lib/firmware/rtlwifi ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8192cufw_TMSC.bin $(1)/lib/firmware/rtlwifi ++endef ++$(eval $(call BuildPackage,rtl8192cu-firmware)) ++ ++Package/rtl8192de-firmware = $(call Package/firmware-default,RealTek RTL8192DE firmware) ++define Package/rtl8192de-firmware/install ++ $(INSTALL_DIR) $(1)/lib/firmware/rtlwifi ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8192defw.bin $(1)/lib/firmware/rtlwifi ++endef ++$(eval $(call BuildPackage,rtl8192de-firmware)) ++ ++Package/rtl8192se-firmware = $(call Package/firmware-default,RealTek RTL8192SE firmware) ++define KernelPackage/rtl8192se/install ++ $(INSTALL_DIR) $(1)/lib/firmware/rtlwifi ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8192sefw.bin $(1)/lib/firmware/rtlwifi ++endef ++$(eval $(call BuildPackage,rtl8192se-firmware)) +diff --git a/package/firmware/linux-firmware/ti.mk b/package/firmware/linux-firmware/ti.mk +new file mode 100644 +index 0000000..a1e12fc +--- /dev/null ++++ b/package/firmware/linux-firmware/ti.mk +@@ -0,0 +1,25 @@ ++Package/wl12xx-firmware = $(call Package/firmware-default,TI WL12xx firmware) ++define Package/wl12xx-firmware/install ++ $(INSTALL_DIR) $(1)/lib/firmware/ti-connectivity ++ $(INSTALL_DATA) \ ++ $(PKG_BUILD_DIR)/ti-connectivity/wl127x-fw-5-mr.bin \ ++ $(PKG_BUILD_DIR)/ti-connectivity/wl127x-fw-5-plt.bin \ ++ $(PKG_BUILD_DIR)/ti-connectivity/wl127x-fw-5-sr.bin \ ++ $(PKG_BUILD_DIR)/ti-connectivity/wl1271-nvs.bin \ ++ $(PKG_BUILD_DIR)/ti-connectivity/wl128x-fw-5-mr.bin \ ++ $(PKG_BUILD_DIR)/ti-connectivity/wl128x-fw-5-plt.bin \ ++ $(PKG_BUILD_DIR)/ti-connectivity/wl128x-fw-5-sr.bin \ ++ $(PKG_BUILD_DIR)/ti-connectivity/wl128x-nvs.bin \ ++ $(1)/lib/firmware/ti-connectivity ++endef ++$(eval $(call BuildPackage,wl12xx-firmware)) ++ ++Package/wl18xx-firmware = $(call Package/firmware-default,TI WL18xx firmware) ++define Package/wl18xx-firmware/install ++ $(INSTALL_DIR) $(1)/lib/firmware/ti-connectivity ++ $(INSTALL_DATA) \ ++ $(PKG_BUILD_DIR)/ti-connectivity/wl18xx-fw-4.bin \ ++ $(1)/lib/firmware/ti-connectivity ++endef ++$(eval $(call BuildPackage,wl18xx-firmware)) ++ +diff --git a/package/kernel/acx-mac80211/Makefile b/package/kernel/acx-mac80211/Makefile +index 1820e7a..c5c020d 100644 +--- a/package/kernel/acx-mac80211/Makefile ++++ b/package/kernel/acx-mac80211/Makefile +@@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk + include $(INCLUDE_DIR)/kernel.mk + + PKG_NAME:=acx-mac80211 +-PKG_REV:=v20130127 +-PKG_VERSION:=20130909 ++PKG_REV:=b6fc31491020cb01d2cd1acc170cfa03ced7e726 ++PKG_VERSION:=20140216 + PKG_RELEASE:=1 + + PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +-PKG_SOURCE_URL:=git://acx100.git.sourceforge.net/gitroot/acx100/acx-mac80211 ++PKG_SOURCE_URL:=git://git.code.sf.net/p/acx100/acx-mac80211 + PKG_SOURCE_PROTO:=git + PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) + PKG_SOURCE_VERSION:=$(PKG_REV) +@@ -190,7 +190,7 @@ define Build/Compile + CROSS_COMPILE="$(TARGET_CROSS)" \ + SUBDIRS="$(PKG_BUILD_DIR)" \ + $(PKG_EXTRA_KCONFIG) \ +- EXTRA_CFLAGS="$(PKG_EXTRA_CFLAGS) -DCONFIG_ACX_MAC80211_VERSION=\"KERNEL_VERSION(3,14,0)\"" \ ++ EXTRA_CFLAGS="$(PKG_EXTRA_CFLAGS) -DCONFIG_ACX_MAC80211_VERSION=\"KERNEL_VERSION(4,2,0)\"" \ + LINUXINCLUDE="-I$(STAGING_DIR)/usr/include/mac80211-backport/uapi -I$(STAGING_DIR)/usr/include/mac80211-backport \ + -I$(STAGING_DIR)/usr/include/mac80211/uapi -I$(STAGING_DIR)/usr/include/mac80211 \ + -I$(LINUX_DIR)/include -I$(LINUX_DIR)/include/$(LINUX_UAPI_DIR) \ +diff --git a/package/kernel/acx-mac80211/patches/001-pci-mem-Fix-3.8-build.patch b/package/kernel/acx-mac80211/patches/001-pci-mem-Fix-3.8-build.patch +deleted file mode 100644 +index fa4a6be..0000000 +--- a/package/kernel/acx-mac80211/patches/001-pci-mem-Fix-3.8-build.patch ++++ /dev/null +@@ -1,129 +0,0 @@ +-From 8a0f5890019bf43f4bc95ef0754b062ddfcfa9cd Mon Sep 17 00:00:00 2001 +-From: Oliver Winker +-Date: Sun, 10 Mar 2013 21:04:23 +0100 +-Subject: [PATCH 1/3] pci, mem: Fix 3.8 build +- +-__devexit and __devinit not used anymore in 3.8 +- +-Signed-off-by: Reinhard Karcher +-Signed-off-by: Oliver Winker +---- +- mem.c | 13 ++++++++++++- +- pci.c | 26 +++++++++++++++++++++++++- +- 2 files changed, 37 insertions(+), 2 deletions(-) +- +---- a/mem.c +-+++ b/mem.c +-@@ -2216,7 +2216,11 @@ int acx100mem_ioctl_set_phy_amp_bias(str +- * ================================================== +- */ +- +-+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0) +- static int __devinit acxmem_probe(struct platform_device *pdev) +-+#else +-+static int acxmem_probe(struct platform_device *pdev) +-+#endif +- { +- acx_device_t *adev = NULL; +- const char *chip_name; +-@@ -2392,7 +2396,11 @@ static int __devinit acxmem_probe(struct +- * pdev - ptr to PCI device structure containing info about pci +- * configuration +- */ +-+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0) +- static int __devexit acxmem_remove(struct platform_device *pdev) +-+#else +-+static int acxmem_remove(struct platform_device *pdev) +-+#endif +- { +- struct ieee80211_hw *hw = (struct ieee80211_hw *) +- platform_get_drvdata(pdev); +-@@ -2594,8 +2602,11 @@ static struct platform_driver acxmem_dri +- .name = "acx-mem", +- }, +- .probe = acxmem_probe, +-+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0) +- .remove = __devexit_p(acxmem_remove), +-- +-+#else +-+ .remove = acxmem_remove, +-+#endif +- #ifdef CONFIG_PM +- .suspend = acxmem_e_suspend, +- .resume = acxmem_e_resume +---- a/pci.c +-+++ b/pci.c +-@@ -1039,7 +1039,11 @@ int acx100pci_ioctl_set_phy_amp_bias(str +- * id - ptr to the device id entry that matched this device +- */ +- #ifdef CONFIG_PCI +-+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0) +- static int __devinit acxpci_probe(struct pci_dev *pdev, +-+#else +-+static int acxpci_probe(struct pci_dev *pdev, +-+#endif +- const struct pci_device_id *id) +- { +- unsigned long mem_region1 = 0; +-@@ -1292,7 +1296,11 @@ static int __devinit acxpci_probe(struct +- * +- * pdev - ptr to PCI device structure containing info about pci configuration +- */ +-+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0) +- static void __devexit acxpci_remove(struct pci_dev *pdev) +-+#else +-+static void acxpci_remove(struct pci_dev *pdev) +-+#endif +- { +- struct ieee80211_hw *hw +- = (struct ieee80211_hw *) pci_get_drvdata(pdev); +-@@ -1505,7 +1513,11 @@ static struct pci_driver acxpci_driver = +- .name = "acx_pci", +- .id_table = acxpci_id_tbl, +- .probe = acxpci_probe, +-+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0) +- .remove = __devexit_p(acxpci_remove), +-+#else +-+ .remove = acxpci_remove, +-+#endif +- #ifdef CONFIG_PM +- .suspend = acxpci_e_suspend, +- .resume = acxpci_e_resume +-@@ -1603,8 +1615,12 @@ static struct vlynq_device_id acx_vlynq_ +- }; +- +- +-+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0) +- static __devinit int vlynq_probe(struct vlynq_device *vdev, +-- struct vlynq_device_id *id) +-+#else +-+static int vlynq_probe(struct vlynq_device *vdev, +-+#endif +-+ struct vlynq_device_id *id) +- { +- int result = -EIO, i; +- u32 addr; +-@@ -1785,7 +1801,11 @@ static __devinit int vlynq_probe(struct +- return result; +- } +- +-+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0) +- static __devexit void vlynq_remove(struct vlynq_device *vdev) +-+#else +-+static void vlynq_remove(struct vlynq_device *vdev) +-+#endif +- { +- struct ieee80211_hw *hw = vlynq_get_drvdata(vdev); +- acx_device_t *adev = hw2adev(hw); +-@@ -1851,7 +1871,11 @@ static struct vlynq_driver acxvlynq_driv +- .name = "acx_vlynq", +- .id_table = acx_vlynq_id, +- .probe = vlynq_probe, +-+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0) +- .remove = __devexit_p(vlynq_remove), +-+#else +-+ .remove = vlynq_remove, +-+#endif +- }; +- #endif /* CONFIG_VLYNQ */ +- +diff --git a/package/kernel/acx-mac80211/patches/003-Fix-3.10-build.patch b/package/kernel/acx-mac80211/patches/003-Fix-3.10-build.patch +deleted file mode 100644 +index c737844..0000000 +--- a/package/kernel/acx-mac80211/patches/003-Fix-3.10-build.patch ++++ /dev/null +@@ -1,31 +0,0 @@ +-From 1daf4bfdb072b08f3b4e412bbfa9645f88dc0a01 Mon Sep 17 00:00:00 2001 +-From: Oliver Winker +-Date: Tue, 3 Sep 2013 20:36:36 +0200 +-Subject: [PATCH 3/3] Fix 3.10 build +- +-Signed-off-by: Reinhard Karcher +-Signed-off-by: Oliver Winker +---- +- main.c | 7 +++++++ +- 1 file changed, 7 insertions(+) +- +---- a/main.c +-+++ b/main.c +-@@ -682,10 +682,17 @@ int acx_op_config(struct ieee80211_hw *h +- +- if (changed & IEEE80211_CONF_CHANGE_CHANNEL) { +- logf1(L_DEBUG, "IEEE80211_CONF_CHANGE_CHANNEL," +-+#if CONFIG_ACX_MAC80211_VERSION >= KERNEL_VERSION(3, 10, 0) +-+ "channel->hw_value=%i\n", conf->chandef.chan->hw_value); +-+ +-+ acx_set_channel(adev, conf->chandef.chan->hw_value, +-+ conf->chandef.chan->center_freq); +-+#else +- "channel->hw_value=%i\n", conf->channel->hw_value); +- +- acx_set_channel(adev, conf->channel->hw_value, +- conf->channel->center_freq); +-+#endif +- +- changed_not_done &= ~IEEE80211_CONF_CHANGE_CHANNEL; +- } +diff --git a/package/kernel/acx-mac80211/patches/004-Fix-3.14-build.patch b/package/kernel/acx-mac80211/patches/004-Fix-3.14-build.patch +deleted file mode 100644 +index 847b573..0000000 +--- a/package/kernel/acx-mac80211/patches/004-Fix-3.14-build.patch ++++ /dev/null +@@ -1,22 +0,0 @@ +-From d17fcac710e629463591f6bd09d76b66ec591583 Mon Sep 17 00:00:00 2001 +-From: Hauke Mehrtens +-Date: Wed, 5 Feb 2014 20:57:07 +0100 +-Subject: [PATCH] Fix 3.14 build +- +-Signed-off-by: Hauke Mehrtens +---- +- main.c | 2 ++ +- 1 file changed, 2 insertions(+) +- +---- a/main.c +-+++ b/main.c +-@@ -500,7 +500,9 @@ int acx_init_ieee80211(acx_device_t *ade +- hw->flags &= ~IEEE80211_HW_RX_INCLUDES_FCS; +- hw->queues = 1; +- hw->wiphy->max_scan_ssids = 1; +-+#if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(3, 14, 0) +- hw->channel_change_time = 10000; +-+#endif +- +- /* OW TODO Check if RTS/CTS threshold can be included here */ +- +diff --git a/package/kernel/acx-mac80211/patches/300-kernel_4_2.patch b/package/kernel/acx-mac80211/patches/300-kernel_4_2.patch +new file mode 100644 +index 0000000..ee92b94 +--- /dev/null ++++ b/package/kernel/acx-mac80211/patches/300-kernel_4_2.patch +@@ -0,0 +1,67 @@ ++diff --git a/main.c b/main.c ++index bfec856..3c482d9 100644 ++--- a/main.c +++++ b/main.c ++@@ -497,7 +497,7 @@ int acx_free_mechanics(acx_device_t *adev) ++ ++ int acx_init_ieee80211(acx_device_t *adev, struct ieee80211_hw *hw) ++ { ++- hw->flags &= ~IEEE80211_HW_RX_INCLUDES_FCS; +++ __clear_bit(IEEE80211_HW_RX_INCLUDES_FCS, hw->flags); ++ hw->queues = 1; ++ hw->wiphy->max_scan_ssids = 1; ++ ++@@ -525,7 +525,7 @@ int acx_init_ieee80211(acx_device_t *adev, struct ieee80211_hw *hw) ++ /* We base signal quality on winlevel approach of previous driver ++ * TODO OW 20100615 This should into a common init code ++ */ ++- hw->flags |= IEEE80211_HW_SIGNAL_UNSPEC; +++ __set_bit(IEEE80211_HW_SIGNAL_UNSPEC, hw->flags); ++ hw->max_signal = 100; ++ ++ if (IS_ACX100(adev)) { ++@@ -945,8 +945,8 @@ void acx_op_configure_filter(struct ieee80211_hw *hw, ++ changed_flags, *total_flags); ++ ++ /* OWI TODO: Set also FIF_PROBE_REQ ? */ ++- *total_flags &= (FIF_PROMISC_IN_BSS | FIF_ALLMULTI | FIF_FCSFAIL ++- | FIF_CONTROL | FIF_OTHER_BSS); +++ *total_flags &= (FIF_ALLMULTI | FIF_FCSFAIL | FIF_CONTROL +++ | FIF_OTHER_BSS); ++ ++ logf1(L_DEBUG, "2: *total_flags=0x%08x\n", *total_flags); ++ ++@@ -1045,9 +1045,10 @@ void acx_op_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, ++ } ++ ++ int acx_op_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ++- struct cfg80211_scan_request *req) +++ struct ieee80211_scan_request *hw_req) ++ { ++ acx_device_t *adev = hw2adev(hw); +++ struct cfg80211_scan_request *req = &hw_req->req; ++ struct sk_buff *skb; ++ size_t ssid_len = 0; ++ u8 *ssid = NULL; ++@@ -1082,7 +1083,7 @@ int acx_op_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ++ goto out; ++ } ++ #else ++- skb = ieee80211_probereq_get(adev->hw, adev->vif, ssid, ssid_len, +++ skb = ieee80211_probereq_get(adev->hw, vif->addr, ssid, ssid_len, ++ req->ie_len); ++ if (!skb) { ++ ret = -ENOMEM; ++diff --git a/main.h b/main.h ++index 293f5c8..84ecb9a 100644 ++--- a/main.h +++++ b/main.h ++@@ -62,7 +62,7 @@ void acx_op_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, ++ #endif ++ ++ int acx_op_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ++- struct cfg80211_scan_request *req); +++ struct ieee80211_scan_request *req); ++ ++ int acx_recover_hw(acx_device_t *adev); ++ diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile -index a1eedce..566e156 100644 +index a1eedce..156ea01 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -10,11 +10,11 @@ include $(INCLUDE_DIR)/kernel.mk @@ -12,16 +1159,16 @@ index a1eedce..566e156 100644 -PKG_VERSION:=2015-03-09 -PKG_RELEASE:=3 -+PKG_VERSION:=2015-07-21 ++PKG_VERSION:=2016-01-10 +PKG_RELEASE:=1 PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources PKG_BACKPORT_VERSION:= -PKG_MD5SUM:=6d4b04e4ce8a1f54dabfb04f4709453c -+PKG_MD5SUM:=ec529acfb9c942daf8116e5cff47c999 ++PKG_MD5SUM:=be5fae2e8d6f7490f9b073374fb895ba PKG_SOURCE:=compat-wireless-$(PKG_VERSION)$(PKG_BACKPORT_VERSION).tar.bz2 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/compat-wireless-$(PKG_VERSION) -@@ -23,15 +23,28 @@ PKG_BUILD_PARALLEL:=1 +@@ -23,15 +23,29 @@ PKG_BUILD_PARALLEL:=1 PKG_MAINTAINER:=Felix Fietkau PKG_DRIVERS = \ @@ -53,12 +1200,13 @@ index a1eedce..566e156 100644 rtlwifi rtlwifi-pci rtlwifi-usb rtl8192c-common rtl8192ce rtl8192se \ - rtl8192de rtl8192cu + rtl8192de rtl8192cu \ ++ rtl8xxxu \ + wlcore wl12xx wl18xx \ + zd1211rw PKG_CONFIG_DEPENDS:= \ CONFIG_PACKAGE_kmod-mac80211 \ -@@ -60,7 +73,6 @@ define KernelPackage/mac80211/Default +@@ -60,7 +74,6 @@ define KernelPackage/mac80211/Default SUBMENU:=$(WMENU) URL:=https://wireless.wiki.kernel.org/ MAINTAINER:=Felix Fietkau @@ -66,21 +1214,45 @@ index a1eedce..566e156 100644 endef define KernelPackage/cfg80211 -@@ -109,8 +121,8 @@ Generic IEEE 802.11 Networking Stack (mac80211) +@@ -97,6 +110,15 @@ define KernelPackage/mac80211/config + Select this to see extensive information about + the internal state of mac80211 in debugfs. + ++ config PACKAGE_MAC80211_TRACING ++ bool "Enable tracing (mac80211 and supported drivers)" ++ select KERNEL_FTRACE ++ select KERNEL_ENABLE_DEFAULT_TRACERS ++ default n ++ help ++ Select this to enable tracing of mac80211 and ++ related wifi drivers (using trace-cmd). ++ + config PACKAGE_MAC80211_MESH + bool "Enable 802.11s mesh support" + default y +@@ -108,833 +130,703 @@ define KernelPackage/mac80211/description + Generic IEEE 802.11 Networking Stack (mac80211) endef - PKG_LINUX_FIRMWARE_NAME:=linux-firmware +-PKG_LINUX_FIRMWARE_NAME:=linux-firmware -PKG_LINUX_FIRMWARE_VERSION:=f404336ba808cbd57547196e13367079a23b822c -PKG_LINUX_FIRMWARE_SOURCE:=$(PKG_LINUX_FIRMWARE_NAME)-2015-03-20-$(PKG_LINUX_FIRMWARE_VERSION).tar.bz2 -+PKG_LINUX_FIRMWARE_VERSION:=6ebf5d57d9f6d0cf05558baef1af2b90a3fe98ed -+PKG_LINUX_FIRMWARE_SOURCE:=$(PKG_LINUX_FIRMWARE_NAME)-2015-09-03-$(PKG_LINUX_FIRMWARE_VERSION).tar.xz - PKG_LINUX_FIRMWARE_PROTO:=git - PKG_LINUX_FIRMWARE_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git - PKG_LINUX_FIRMWARE_SUBDIR:=$(PKG_LINUX_FIRMWARE_NAME)-$(PKG_LINUX_FIRMWARE_VERSION) -@@ -127,723 +139,769 @@ define Download/linux-firmware - endef - $(eval $(call Download,linux-firmware)) - +-PKG_LINUX_FIRMWARE_PROTO:=git +-PKG_LINUX_FIRMWARE_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git +-PKG_LINUX_FIRMWARE_SUBDIR:=$(PKG_LINUX_FIRMWARE_NAME)-$(PKG_LINUX_FIRMWARE_VERSION) +-#PKG_LINUX_FIRMWARE_MIRROR_MD5SUM:=e219333f01835c6e556875a9e0deb3f9 +- +-define Download/linux-firmware +- FILE:=$(PKG_LINUX_FIRMWARE_SOURCE) +- URL:=$(PKG_LINUX_FIRMWARE_SOURCE_URL) +- MD5SUM:=$(PKG_LINUX_FIRMWARE_MD5SUM) +- PROTO:=$(PKG_LINUX_FIRMWARE_PROTO) +- VERSION:=$(PKG_LINUX_FIRMWARE_VERSION) +- SUBDIR:=$(PKG_LINUX_FIRMWARE_SUBDIR) +- MIRROR_MD5SUM:=$(PKG_LINUX_FIRMWARE_MIRROR_MD5SUM) +-endef +-$(eval $(call Download,linux-firmware)) +- -PKG_ATH10K_LINUX_FIRMWARE_NAME:=ath10k-firmware -PKG_ATH10K_LINUX_FIRMWARE_VERSION:=da0f85d924226ee30c46e037120621c9e192b39e -PKG_ATH10K_LINUX_FIRMWARE_SOURCE:=$(PKG_ATH10K_LINUX_FIRMWARE_NAME)-$(PKG_ATH10K_LINUX_FIRMWARE_VERSION).tar.bz2 @@ -88,7 +1260,7 @@ index a1eedce..566e156 100644 -PKG_ATH10K_LINUX_FIRMWARE_SOURCE_URL:=https://github.com/kvalo/ath10k-firmware.git -PKG_ATH10K_LINUX_FIRMWARE_SUBDIR:=$(PKG_ATH10K_LINUX_FIRMWARE_NAME)-$(PKG_ATH10K_LINUX_FIRMWARE_VERSION) -#PKG_ATH10K_LINUX_FIRMWARE_MIRROR_MD5SUM:=? - +- -define Download/ath10k-firmware - FILE:=$(PKG_ATH10K_LINUX_FIRMWARE_SOURCE) - URL:=$(PKG_ATH10K_LINUX_FIRMWARE_SOURCE_URL) @@ -96,19 +1268,92 @@ index a1eedce..566e156 100644 - VERSION:=$(PKG_ATH10K_LINUX_FIRMWARE_VERSION) - SUBDIR:=$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR) - #MIRROR_MD5SUM:=$(PKG_ATH10K_LINUX_FIRMWARE_MIRROR_MD5SUM) -+define KernelPackage/adm8211 -+ $(call KernelPackage/mac80211/Default) -+ TITLE:=ADMTek 8211 support -+ DEPENDS+=@PCI_SUPPORT +kmod-mac80211 +kmod-eeprom-93cx6 -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/adm8211.ko -+ AUTOLOAD:=$(call AutoProbe,adm8211) - endef +-endef -$(eval $(call Download,ath10k-firmware)) - +- -# Prism54 drivers -P54PCIFW:=2.13.12.0.arm -P54USBFW:=2.13.24.0.lm87.arm -P54SPIFW:=2.13.0.0.a.13.14.arm +- +-define Download/p54usb +- FILE:=$(P54USBFW) +- URL:=http://daemonizer.de/prism54/prism54-fw/fw-usb +- MD5SUM:=8e8ab005a4f8f0123bcdc51bc25b47f6 +-endef +-$(eval $(call Download,p54usb)) +- +-define Download/p54pci +- FILE:=$(P54PCIFW) +- URL:=http://daemonizer.de/prism54/prism54-fw/fw-softmac +- MD5SUM:=ff7536af2092b1c4b21315bd103ef4c4 +-endef +-$(eval $(call Download,p54pci)) +- +-define Download/p54spi +- FILE:=$(P54SPIFW) +- URL:=http://daemonizer.de/prism54/prism54-fw/stlc4560 +- MD5SUM:=42661f8ecbadd88012807493f596081d +-endef +-$(eval $(call Download,p54spi)) +- +-define KernelPackage/p54/Default +- $(call KernelPackage/mac80211/Default) +- TITLE:=Prism54 Drivers +-endef +- +-define KernelPackage/p54/description +- Kernel module for Prism54 chipsets (mac80211) +-endef +- +-define KernelPackage/p54-common +- $(call KernelPackage/p54/Default) +- DEPENDS+= @PCI_SUPPORT||@USB_SUPPORT||@TARGET_omap24xx +kmod-mac80211 +kmod-lib-crc-ccitt +- TITLE+= (COMMON) +- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54common.ko +-endef +- +-define KernelPackage/p54-pci +- $(call KernelPackage/p54/Default) +- TITLE+= (PCI) +- DEPENDS+= @PCI_SUPPORT +kmod-p54-common +- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54pci.ko +- AUTOLOAD:=$(call AutoProbe,p54pci) +-endef +- +-define KernelPackage/p54-usb +- $(call KernelPackage/p54/Default) +- TITLE+= (USB) +- DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-p54-common +- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54usb.ko +- AUTOLOAD:=$(call AutoProbe,p54usb) +-endef +- +-define KernelPackage/p54-spi +- $(call KernelPackage/p54/Default) +- TITLE+= (SPI) +- DEPENDS+= @TARGET_omap24xx +kmod-p54-common +- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54spi.ko +- AUTOLOAD:=$(call AutoProbe,p54spi) +-endef +- +-define KernelPackage/rt2x00/Default ++define KernelPackage/adm8211 + $(call KernelPackage/mac80211/Default) +- TITLE:=Ralink Drivers for RT2x00 cards ++ TITLE:=ADMTek 8211 support ++ DEPENDS+=@PCI_SUPPORT +kmod-mac80211 +kmod-eeprom-93cx6 ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/admtek/adm8211.ko ++ AUTOLOAD:=$(call AutoProbe,adm8211) + endef + +-define KernelPackage/rt2x00-lib +-$(call KernelPackage/rt2x00/Default) +- DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT||TARGET_ramips) +kmod-mac80211 +kmod-lib-crc-itu-t +- TITLE+= (LIB) +- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00lib.ko +- MENU:=1 +-endef +define KernelPackage/ath/config + if PACKAGE_kmod-ath + config ATH_USER_REGD @@ -119,56 +1364,53 @@ index a1eedce..566e156 100644 + even further, even if the country allows frequencies or power levels that + are forbidden by the EEPROM settings. --define Download/p54usb -- FILE:=$(P54USBFW) -- URL:=http://daemonizer.de/prism54/prism54-fw/fw-usb -- MD5SUM:=8e8ab005a4f8f0123bcdc51bc25b47f6 --endef --$(eval $(call Download,p54usb)) +-define KernelPackage/rt2x00-lib/config +- if PACKAGE_kmod-rt2x00-lib + Select this option if you want the driver to respect the user's decision about + regulatory settings. --define Download/p54pci -- FILE:=$(P54PCIFW) -- URL:=http://daemonizer.de/prism54/prism54-fw/fw-softmac -- MD5SUM:=ff7536af2092b1c4b21315bd103ef4c4 --endef --$(eval $(call Download,p54pci)) +- config PACKAGE_RT2X00_LIB_DEBUGFS +- bool "Enable rt2x00 debugfs support" +- depends on PACKAGE_MAC80211_DEBUGFS + config PACKAGE_ATH_DEBUG + bool "Atheros wireless debugging" -+ help + help +- Enable creation of debugfs files for the rt2x00 drivers. +- These debugfs files support both reading and writing of the +- most important register types of the rt2x00 hardware. + Say Y, if you want to debug atheros wireless drivers. + Only ath9k & ath10k make use of this. --define Download/p54spi -- FILE:=$(P54SPIFW) -- URL:=http://daemonizer.de/prism54/prism54-fw/stlc4560 -- MD5SUM:=42661f8ecbadd88012807493f596081d --endef --$(eval $(call Download,p54spi)) +- config PACKAGE_RT2X00_DEBUG +- bool "Enable rt2x00 debug output" + config PACKAGE_ATH_DFS + bool "Enable DFS support" + default y -+ help + help +- Enable debugging output for all rt2x00 modules + Dynamic frequency selection (DFS) is required for most of the 5 GHz band + channels in Europe, US, and Japan. --define KernelPackage/p54/Default -- $(call KernelPackage/mac80211/Default) -- TITLE:=Prism54 Drivers +- endif -endef + Select this option if you want to use such channels. --define KernelPackage/p54/description -- Kernel module for Prism54 chipsets (mac80211) +-define KernelPackage/rt2x00-mmio +-$(call KernelPackage/rt2x00/Default) +- DEPENDS+= @(PCI_SUPPORT||TARGET_ramips) +kmod-rt2x00-lib +kmod-eeprom-93cx6 +- HIDDEN:=1 +- TITLE+= (MMIO) +- FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00mmio.ko + endif endef --define KernelPackage/p54-common -- $(call KernelPackage/p54/Default) -- DEPENDS+= @PCI_SUPPORT||@USB_SUPPORT||@TARGET_omap24xx +kmod-mac80211 +kmod-lib-crc-ccitt -- TITLE+= (COMMON) -- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54common.ko +-define KernelPackage/rt2x00-pci +-$(call KernelPackage/rt2x00/Default) +- DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-mmio +kmod-rt2x00-lib +- HIDDEN:=1 +- TITLE+= (PCI) +- FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00pci.ko +- AUTOLOAD:=$(call AutoProbe,rt2x00pci) +define KernelPackage/ath + $(call KernelPackage/mac80211/Default) + TITLE:=Atheros common driver part @@ -177,22 +1419,23 @@ index a1eedce..566e156 100644 + MENU:=1 endef --define KernelPackage/p54-pci -- $(call KernelPackage/p54/Default) -- TITLE+= (PCI) -- DEPENDS+= @PCI_SUPPORT +kmod-p54-common -- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54pci.ko -- AUTOLOAD:=$(call AutoProbe,p54pci) +-define KernelPackage/rt2x00-usb +-$(call KernelPackage/rt2x00/Default) +- DEPENDS+= @USB_SUPPORT +kmod-rt2x00-lib +kmod-usb-core +- HIDDEN:=1 +- TITLE+= (USB) +- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00usb.ko +- AUTOLOAD:=$(call AutoProbe,rt2x00usb) +define KernelPackage/ath/description + This module contains some common parts needed by Atheros Wireless drivers. endef --define KernelPackage/p54-usb -- $(call KernelPackage/p54/Default) -- TITLE+= (USB) -- DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-p54-common -- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54usb.ko -- AUTOLOAD:=$(call AutoProbe,p54usb) +-define KernelPackage/rt2800-lib +-$(call KernelPackage/rt2x00/Default) +- DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT||TARGET_ramips) +kmod-rt2x00-lib +kmod-lib-crc-ccitt +@DRIVER_11N_SUPPORT +- HIDDEN:=1 +- TITLE+= (rt2800 LIB) +- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800lib.ko +define KernelPackage/ath5k + $(call KernelPackage/mac80211/Default) + TITLE:=Atheros 5xxx wireless cards support @@ -202,21 +1445,25 @@ index a1eedce..566e156 100644 + AUTOLOAD:=$(call AutoProbe,ath5k) endef --define KernelPackage/p54-spi -- $(call KernelPackage/p54/Default) -- TITLE+= (SPI) -- DEPENDS+= @TARGET_omap24xx +kmod-p54-common -- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54spi.ko -- AUTOLOAD:=$(call AutoProbe,p54spi) +-define KernelPackage/rt2400-pci +-$(call KernelPackage/rt2x00/Default) +- DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci +- TITLE+= (RT2400 PCI) +- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2400pci.ko +- AUTOLOAD:=$(call AutoProbe,rt2400pci) +define KernelPackage/ath5k/description + This module adds support for wireless adapters based on + Atheros 5xxx chipset. endef --define KernelPackage/rt2x00/Default +-define KernelPackage/rt2500-pci +-$(call KernelPackage/rt2x00/Default) +- DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci +- TITLE+= (RT2500 PCI) +- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2500pci.ko +- AUTOLOAD:=$(call AutoProbe,rt2500pci) +define KernelPackage/ath9k-common - $(call KernelPackage/mac80211/Default) -- TITLE:=Ralink Drivers for RT2x00 cards ++ $(call KernelPackage/mac80211/Default) + TITLE:=Atheros 802.11n wireless devices (common code for ath9k and ath9k_htc) + URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k + DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ar71xx +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT +@KERNEL_RELAY @@ -225,12 +1472,12 @@ index a1eedce..566e156 100644 + $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_hw.ko endef --define KernelPackage/rt2x00-lib +-define KernelPackage/rt2500-usb -$(call KernelPackage/rt2x00/Default) -- DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT||TARGET_ramips) +kmod-mac80211 +kmod-lib-crc-itu-t -- TITLE+= (LIB) -- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00lib.ko -- MENU:=1 +- DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb +- TITLE+= (RT2500 USB) +- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2500usb.ko +- AUTOLOAD:=$(call AutoProbe,rt2500usb) +define KernelPackage/ath9k + $(call KernelPackage/mac80211/Default) + TITLE:=Atheros 802.11n PCI wireless cards support @@ -241,128 +1488,16 @@ index a1eedce..566e156 100644 + AUTOLOAD:=$(call AutoProbe,ath9k) endef --define KernelPackage/rt2x00-lib/config -- if PACKAGE_kmod-rt2x00-lib -- -- config PACKAGE_RT2X00_LIB_DEBUGFS -- bool "Enable rt2x00 debugfs support" -- depends on PACKAGE_MAC80211_DEBUGFS -- help -- Enable creation of debugfs files for the rt2x00 drivers. -- These debugfs files support both reading and writing of the -- most important register types of the rt2x00 hardware. -- -- config PACKAGE_RT2X00_DEBUG -- bool "Enable rt2x00 debug output" -- help -- Enable debugging output for all rt2x00 modules -- -- endif -+define KernelPackage/ath9k/description -+This module adds support for wireless adapters based on -+Atheros IEEE 802.11n AR5008 and AR9001 family of chipsets. - endef - --define KernelPackage/rt2x00-mmio --$(call KernelPackage/rt2x00/Default) -- DEPENDS+= @(PCI_SUPPORT||TARGET_ramips) +kmod-rt2x00-lib +kmod-eeprom-93cx6 -- HIDDEN:=1 -- TITLE+= (MMIO) -- FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00mmio.ko --endef -+define KernelPackage/ath9k/config - --define KernelPackage/rt2x00-pci --$(call KernelPackage/rt2x00/Default) -- DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-mmio +kmod-rt2x00-lib -- HIDDEN:=1 -- TITLE+= (PCI) -- FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00pci.ko -- AUTOLOAD:=$(call AutoProbe,rt2x00pci) --endef -+ config ATH9K_SUPPORT_PCOEM -+ bool "Support chips used in PC OEM cards" -+ depends on PACKAGE_kmod-ath9k - --define KernelPackage/rt2x00-usb --$(call KernelPackage/rt2x00/Default) -- DEPENDS+= @USB_SUPPORT +kmod-rt2x00-lib +kmod-usb-core -- HIDDEN:=1 -- TITLE+= (USB) -- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00usb.ko -- AUTOLOAD:=$(call AutoProbe,rt2x00usb) - endef - --define KernelPackage/rt2800-lib --$(call KernelPackage/rt2x00/Default) -- DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT||TARGET_ramips) +kmod-rt2x00-lib +kmod-lib-crc-ccitt +@DRIVER_11N_SUPPORT -- HIDDEN:=1 -- TITLE+= (rt2800 LIB) -- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800lib.ko -+define KernelPackage/ath9k-htc -+ $(call KernelPackage/mac80211/Default) -+ TITLE:=Atheros 802.11n USB device support -+ URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k -+ DEPENDS+= @USB_SUPPORT +kmod-ath9k-common +kmod-usb-core -+ FILES:= \ -+ $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_htc.ko -+ AUTOLOAD:=$(call AutoProbe,ath9k_htc) - endef - --define KernelPackage/rt2400-pci --$(call KernelPackage/rt2x00/Default) -- DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci -- TITLE+= (RT2400 PCI) -- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2400pci.ko -- AUTOLOAD:=$(call AutoProbe,rt2400pci) -+define KernelPackage/ath9k-htc/description -+This module adds support for wireless adapters based on -+Atheros USB AR9271 and AR7010 family of chipsets. - endef - --define KernelPackage/rt2500-pci --$(call KernelPackage/rt2x00/Default) -- DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci -- TITLE+= (RT2500 PCI) -- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2500pci.ko -- AUTOLOAD:=$(call AutoProbe,rt2500pci) -+define KernelPackage/ath10k -+ $(call KernelPackage/mac80211/Default) -+ TITLE:=Atheros 802.11ac wireless cards support -+ URL:=https://wireless.wiki.kernel.org/en/users/Drivers/ath10k -+ DEPENDS+= @PCI_SUPPORT +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT -+ FILES:= \ -+ $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_core.ko \ -+ $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_pci.ko -+ AUTOLOAD:=$(call AutoLoad,55,ath10k_core ath10k_pci) - endef - --define KernelPackage/rt2500-usb --$(call KernelPackage/rt2x00/Default) -- DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb -- TITLE+= (RT2500 USB) -- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2500usb.ko -- AUTOLOAD:=$(call AutoProbe,rt2500usb) -+define KernelPackage/ath10k/description -+This module adds support for wireless adapters based on -+Atheros IEEE 802.11ac family of chipsets. For now only -+PCI is supported. - endef - -define KernelPackage/rt61-pci -$(call KernelPackage/rt2x00/Default) - DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci - TITLE+= (RT2x61 PCI) - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt61pci.ko - AUTOLOAD:=$(call AutoProbe,rt61pci) --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 -+PKG_ATH10K_LINUX_FIRMWARE_PROTO:=git -+PKG_ATH10K_LINUX_FIRMWARE_SOURCE_URL:=https://github.com/kvalo/ath10k-firmware.git -+PKG_ATH10K_LINUX_FIRMWARE_SUBDIR:=$(PKG_ATH10K_LINUX_FIRMWARE_NAME)-$(PKG_ATH10K_LINUX_FIRMWARE_VERSION) -+#PKG_ATH10K_LINUX_FIRMWARE_MIRROR_MD5SUM:=? ++define KernelPackage/ath9k/description ++This module adds support for wireless adapters based on ++Atheros IEEE 802.11n AR5008 and AR9001 family of chipsets. + endef -define KernelPackage/rt73-usb - $(call KernelPackage/rt2x00/Default) @@ -370,15 +1505,8 @@ index a1eedce..566e156 100644 - TITLE+= (RT73 USB) - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt73usb.ko - AUTOLOAD:=$(call AutoProbe,rt73usb) -+define Download/ath10k-firmware -+ FILE:=$(PKG_ATH10K_LINUX_FIRMWARE_SOURCE) -+ URL:=$(PKG_ATH10K_LINUX_FIRMWARE_SOURCE_URL) -+ PROTO:=$(PKG_ATH10K_LINUX_FIRMWARE_PROTO) -+ VERSION:=$(PKG_ATH10K_LINUX_FIRMWARE_VERSION) -+ SUBDIR:=$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR) -+ #MIRROR_MD5SUM:=$(PKG_ATH10K_LINUX_FIRMWARE_MIRROR_MD5SUM) - endef -+$(eval $(call Download,ath10k-firmware)) +-endef ++define KernelPackage/ath9k/config -define KernelPackage/rt2800-mmio -$(call KernelPackage/rt2x00/Default) @@ -387,6 +1515,9 @@ index a1eedce..566e156 100644 - HIDDEN:=1 - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800mmio.ko -endef ++ config ATH9K_SUPPORT_PCOEM ++ bool "Support chips used in PC OEM cards" ++ depends on PACKAGE_kmod-ath9k -define KernelPackage/rt2800-soc -$(call KernelPackage/rt2x00/Default) @@ -396,6 +1527,68 @@ index a1eedce..566e156 100644 - $(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00soc.ko \ - $(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800soc.ko - AUTOLOAD:=$(call AutoProbe,rt2800soc) + endef + +-define KernelPackage/rt2800-pci +-$(call KernelPackage/rt2x00/Default) +- DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci +kmod-rt2800-lib +kmod-rt2800-mmio +- TITLE+= (RT2860 PCI) +- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800pci.ko +- AUTOLOAD:=$(call AutoProbe,rt2800pci) ++define KernelPackage/ath9k-htc ++ $(call KernelPackage/mac80211/Default) ++ TITLE:=Atheros 802.11n USB device support ++ URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k ++ DEPENDS+= @USB_SUPPORT +kmod-ath9k-common +kmod-usb-core +ath9k-htc-firmware ++ FILES:= \ ++ $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_htc.ko ++ AUTOLOAD:=$(call AutoProbe,ath9k_htc) + endef + +-define KernelPackage/rt2800-usb +-$(call KernelPackage/rt2x00/Default) +- DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb +kmod-rt2800-lib +kmod-lib-crc-ccitt +- TITLE+= (RT2870 USB) +- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800usb.ko +- AUTOLOAD:=$(call AutoProbe,rt2800usb) ++define KernelPackage/ath9k-htc/description ++This module adds support for wireless adapters based on ++Atheros USB AR9271 and AR7010 family of chipsets. + endef + +-define KernelPackage/rtl818x/Default ++define KernelPackage/ath10k + $(call KernelPackage/mac80211/Default) +- TITLE:=Realtek Drivers for RTL818x devices +- URL:=http://wireless.kernel.org/en/users/Drivers/rtl8187 +- DEPENDS+= +kmod-eeprom-93cx6 +kmod-mac80211 ++ TITLE:=Atheros 802.11ac wireless cards support ++ URL:=https://wireless.wiki.kernel.org/en/users/Drivers/ath10k ++ DEPENDS+= @PCI_SUPPORT +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT +@KERNEL_RELAY ++ FILES:= \ ++ $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_core.ko \ ++ $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_pci.ko ++ AUTOLOAD:=$(call AutoLoad,55,ath10k_core ath10k_pci) + endef + +-define KernelPackage/rtl8180 +- $(call KernelPackage/rtl818x/Default) +- DEPENDS+= @PCI_SUPPORT +- TITLE+= (RTL8180 PCI) +- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtl818x/rtl8180/rtl818x_pci.ko +- AUTOLOAD:=$(call AutoProbe,rtl818x_pci) ++define KernelPackage/ath10k/description ++This module adds support for wireless adapters based on ++Atheros IEEE 802.11ac family of chipsets. For now only ++PCI is supported. + endef + +-define KernelPackage/rtl8187 +-$(call KernelPackage/rtl818x/Default) +- DEPENDS+= @USB_SUPPORT +kmod-usb-core +- TITLE+= (RTL8187 USB) +- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtl818x/rtl8187/rtl8187.ko +- AUTOLOAD:=$(call AutoProbe,rtl8187) -endef +#Broadcom firmware +ifneq ($(CONFIG_B43_FW_6_30),) @@ -449,19 +1642,13 @@ index a1eedce..566e156 100644 + PKG_B43_FWV4_MD5SUM:=e045a135453274e439ae183f8498b0fa +endif --define KernelPackage/rt2800-pci --$(call KernelPackage/rt2x00/Default) -- DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci +kmod-rt2800-lib +kmod-rt2800-mmio -- TITLE+= (RT2860 PCI) -- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800pci.ko -- AUTOLOAD:=$(call AutoProbe,rt2800pci) -+ -+PKG_B43_FWV3_NAME:=wl_apsta -+PKG_B43_FWV3_VERSION:=3.130.20.0 -+PKG_B43_FWV3_SOURCE:=$(PKG_B43_FWV3_NAME)-$(PKG_B43_FWV3_VERSION).o -+PKG_B43_FWV3_SOURCE_URL:=http://downloads.openwrt.org/sources/ -+PKG_B43_FWV3_MD5SUM:=e08665c5c5b66beb9c3b2dd54aa80cb3 -+ +-define KernelPackage/rtlwifi/config +- config PACKAGE_RTLWIFI_DEBUG +- bool "Realtek wireless debugging" +- depends on PACKAGE_kmod-rtlwifi +- help +- Say Y, if you want to debug realtek wireless drivers. + +define Download/b43 + FILE:=$(PKG_B43_FWV4_SOURCE) + URL:=$(PKG_B43_FWV4_SOURCE_URL) @@ -469,26 +1656,13 @@ index a1eedce..566e156 100644 endef +$(eval $(call Download,b43)) --define KernelPackage/rt2800-usb --$(call KernelPackage/rt2x00/Default) -- DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb +kmod-rt2800-lib +kmod-lib-crc-ccitt -- TITLE+= (RT2870 USB) -- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800usb.ko -- AUTOLOAD:=$(call AutoProbe,rt2800usb) -+define Download/b43legacy -+ FILE:=$(PKG_B43_FWV3_SOURCE) -+ URL:=$(PKG_B43_FWV3_SOURCE_URL) -+ MD5SUM:=$(PKG_B43_FWV3_MD5SUM) - endef -+$(eval $(call Download,b43legacy)) - --define KernelPackage/rtl818x/Default -+ +-define KernelPackage/rtlwifi +define KernelPackage/b43 $(call KernelPackage/mac80211/Default) -- TITLE:=Realtek Drivers for RTL818x devices -- URL:=http://wireless.kernel.org/en/users/Drivers/rtl8187 -- DEPENDS+= +kmod-eeprom-93cx6 +kmod-mac80211 +- TITLE:=Realtek common driver part +- DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT) +kmod-mac80211 +@DRIVER_11N_SUPPORT +- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtlwifi.ko +- HIDDEN:=1 + TITLE:=Broadcom 43xx wireless support + URL:=https://wireless.wiki.kernel.org/en/users/drivers/b43 + KCONFIG:= \ @@ -498,69 +1672,11 @@ index a1eedce..566e156 100644 + @PCI_SUPPORT +kmod-mac80211 \ + $(if $(CONFIG_PACKAGE_B43_USE_SSB),+kmod-ssb) \ + $(if $(CONFIG_PACKAGE_B43_USE_BCMA),+kmod-bcma) -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/b43/b43.ko ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/b43/b43.ko + AUTOLOAD:=$(call AutoProbe,b43) + MENU:=1 endef --define KernelPackage/rtl8180 -- $(call KernelPackage/rtl818x/Default) -- DEPENDS+= @PCI_SUPPORT -- TITLE+= (RTL8180 PCI) -- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtl818x/rtl8180/rtl818x_pci.ko -- AUTOLOAD:=$(call AutoProbe,rtl818x_pci) --endef -+define KernelPackage/b43/config - --define KernelPackage/rtl8187 --$(call KernelPackage/rtl818x/Default) -- DEPENDS+= @USB_SUPPORT +kmod-usb-core -- TITLE+= (RTL8187 USB) -- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtl818x/rtl8187/rtl8187.ko -- AUTOLOAD:=$(call AutoProbe,rtl8187) --endef -+config PACKAGE_B43_USE_SSB -+ select PACKAGE_kmod-ssb -+ tristate -+ depends on !TARGET_brcm47xx && !TARGET_brcm63xx -+ default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_BCMA_AND_SSB -+ default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_SSB - --define KernelPackage/rtlwifi/config -- config PACKAGE_RTLWIFI_DEBUG -- bool "Realtek wireless debugging" -- depends on PACKAGE_kmod-rtlwifi -+config PACKAGE_B43_USE_BCMA -+ select PACKAGE_kmod-bcma -+ tristate -+ depends on !TARGET_brcm47xx && !TARGET_bcm53xx -+ default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_BCMA_AND_SSB -+ default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_BCMA -+ -+ if PACKAGE_kmod-b43 -+ -+ choice -+ prompt "b43 firmware version" -+ default B43_FW_5_100_138 - help -- Say Y, if you want to debug realtek wireless drivers. -+ This option allows you to select the version of the b43 firmware. - --endef -+ config B43_FW_4_150 -+ bool "Firmware 410.2160 from driver 4.150.10.5 (old stable)" -+ help -+ Old stable firmware for BCM43xx devices. - --define KernelPackage/rtlwifi -- $(call KernelPackage/mac80211/Default) -- TITLE:=Realtek common driver part -- DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT) +kmod-mac80211 +@DRIVER_11N_SUPPORT -- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtlwifi.ko -- HIDDEN:=1 --endef -+ If unsure, select this. - -define KernelPackage/rtlwifi-pci - $(call KernelPackage/mac80211/Default) - TITLE:=Realtek common driver part (PCI support) @@ -569,10 +1685,7 @@ index a1eedce..566e156 100644 - AUTOLOAD:=$(call AutoProbe,rtl_pci) - HIDDEN:=1 -endef -+ config B43_FW_4_178 -+ bool "Firmware 478.104 from driver 4.178.10.4" -+ help -+ Older firmware for BCM43xx devices. ++define KernelPackage/b43/config -define KernelPackage/rtlwifi-usb - $(call KernelPackage/mac80211/Default) @@ -582,7 +1695,12 @@ index a1eedce..566e156 100644 - AUTOLOAD:=$(call AutoProbe,rtl_usb) - HIDDEN:=1 -endef -+ If unsure, select the "stable" firmware. ++config PACKAGE_B43_USE_SSB ++ select PACKAGE_kmod-ssb ++ tristate ++ depends on !TARGET_brcm47xx && !TARGET_brcm63xx ++ default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_BCMA_AND_SSB ++ default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_SSB -define KernelPackage/rtl8192c-common - $(call KernelPackage/mac80211/Default) @@ -591,10 +1709,12 @@ index a1eedce..566e156 100644 - FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl8192c/rtl8192c-common.ko - HIDDEN:=1 -endef -+ config B43_FW_5_10 -+ bool "Firmware 508.1084 from driver 5.10.56.27" -+ help -+ Older firmware for BCM43xx devices. ++config PACKAGE_B43_USE_BCMA ++ select PACKAGE_kmod-bcma ++ tristate ++ depends on !TARGET_brcm47xx && !TARGET_bcm53xx ++ default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_BCMA_AND_SSB ++ default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_BCMA -define KernelPackage/rtl8192ce - $(call KernelPackage/mac80211/Default) @@ -603,7 +1723,7 @@ index a1eedce..566e156 100644 - FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl8192ce/rtl8192ce.ko - AUTOLOAD:=$(call AutoProbe,rtl8192ce) -endef -+ If unsure, select the "stable" firmware. ++ if PACKAGE_kmod-b43 -define KernelPackage/rtl8192ce/install - $(INSTALL_DIR) $(1)/lib/firmware/rtlwifi @@ -611,10 +1731,11 @@ index a1eedce..566e156 100644 - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cfwU.bin $(1)/lib/firmware/rtlwifi - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cfwU_B.bin $(1)/lib/firmware/rtlwifi -endef -+ config B43_FW_5_100_138 -+ bool "Firmware 666.2 from driver 5.100.138 (stable)" ++ choice ++ prompt "b43 firmware version" ++ default B43_FW_5_100_138 + help -+ The currently default firmware for BCM43xx devices. ++ This option allows you to select the version of the b43 firmware. -define KernelPackage/rtl8192se - $(call KernelPackage/mac80211/Default) @@ -623,13 +1744,16 @@ index a1eedce..566e156 100644 - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl8192se/rtl8192se.ko - AUTOLOAD:=$(call AutoProbe,rtl8192se) -endef -+ This firmware currently gets most of the testing and is needed for some N-PHY devices. ++ config B43_FW_4_150 ++ bool "Firmware 410.2160 from driver 4.150.10.5 (old stable)" ++ help ++ Old stable firmware for BCM43xx devices. -define KernelPackage/rtl8192se/install - $(INSTALL_DIR) $(1)/lib/firmware/rtlwifi - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192sefw.bin $(1)/lib/firmware/rtlwifi -endef -+ If unsure, select the this firmware. ++ If unsure, select this. -define KernelPackage/rtl8192de - $(call KernelPackage/mac80211/Default) @@ -638,16 +1762,16 @@ index a1eedce..566e156 100644 - FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl8192de/rtl8192de.ko - AUTOLOAD:=$(call AutoProbe,rtl8192de) -endef -+ config B43_FW_6_30 -+ bool "Firmware 784.2 from driver 6.30.163.46 (experimental)" ++ config B43_FW_4_178 ++ bool "Firmware 478.104 from driver 4.178.10.4" + help -+ Newer experimental firmware for BCM43xx devices. ++ Older firmware for BCM43xx devices. -define KernelPackage/rtl8192de/install - $(INSTALL_DIR) $(1)/lib/firmware/rtlwifi - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192defw.bin $(1)/lib/firmware/rtlwifi -endef -+ This firmware is mostly untested. ++ If unsure, select the "stable" firmware. -define KernelPackage/rtl8192cu - $(call KernelPackage/mac80211/Default) @@ -656,7 +1780,10 @@ index a1eedce..566e156 100644 - FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl8192cu/rtl8192cu.ko - AUTOLOAD:=$(call AutoProbe,rtl8192cu) -endef -+ If unsure, select the "stable" firmware. ++ config B43_FW_5_10 ++ bool "Firmware 508.1084 from driver 5.10.56.27" ++ help ++ Older firmware for BCM43xx devices. -define KernelPackage/rtl8192cu/install - $(INSTALL_DIR) $(1)/lib/firmware/rtlwifi @@ -665,10 +1792,7 @@ index a1eedce..566e156 100644 - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cufw_B.bin $(1)/lib/firmware/rtlwifi - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cufw_TMSC.bin $(1)/lib/firmware/rtlwifi -endef -+ config B43_OPENFIRMWARE -+ bool "Open FirmWare for WiFi networks" -+ help -+ Opensource firmware for BCM43xx devices. ++ If unsure, select the "stable" firmware. -ZD1211FW_NAME:=zd1211-firmware -ZD1211FW_VERSION:=1.4 @@ -678,11 +1802,10 @@ index a1eedce..566e156 100644 - MD5SUM:=19f28781d76569af8551c9d11294c870 -endef -$(eval $(call Download,zd1211rw)) -+ Do _not_ select this, unless you know what you are doing. -+ The Opensource firmware is not suitable for embedded devices, yet. -+ It does not support QoS, which is bad for AccessPoints. -+ It does not support hardware crypto acceleration, which is a showstopper -+ for embedded devices with low CPU resources. ++ config B43_FW_5_100_138 ++ bool "Firmware 666.2 from driver 5.100.138 (stable)" ++ help ++ The currently default firmware for BCM43xx devices. -define KernelPackage/zd1211rw - $(call KernelPackage/mac80211/Default) @@ -691,7 +1814,7 @@ index a1eedce..566e156 100644 - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/zd1211rw/zd1211rw.ko - AUTOLOAD:=$(call AutoProbe,zd1211rw) -endef -+ If unsure, select the "stable" firmware. ++ This firmware currently gets most of the testing and is needed for some N-PHY devices. -define KernelPackage/adm8211 - $(call KernelPackage/mac80211/Default) @@ -700,6 +1823,38 @@ index a1eedce..566e156 100644 - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/adm8211.ko - AUTOLOAD:=$(call AutoProbe,adm8211) -endef ++ If unsure, select the this firmware. + +-define KernelPackage/ath/config +- if PACKAGE_kmod-ath +- config ATH_USER_REGD +- bool "Force Atheros drivers to respect the user's regdomain settings" ++ config B43_FW_6_30 ++ bool "Firmware 784.2 from driver 6.30.163.46 (experimental)" + help +- Atheros' idea of regulatory handling is that the EEPROM of the card defines +- the regulatory limits and the user is only allowed to restrict the settings +- even further, even if the country allows frequencies or power levels that +- are forbidden by the EEPROM settings. ++ Newer experimental firmware for BCM43xx devices. ++ ++ This firmware is mostly untested. ++ ++ If unsure, select the "stable" firmware. ++ ++ config B43_OPENFIRMWARE ++ bool "Open FirmWare for WiFi networks" ++ help ++ Opensource firmware for BCM43xx devices. ++ ++ Do _not_ select this, unless you know what you are doing. ++ The Opensource firmware is not suitable for embedded devices, yet. ++ It does not support QoS, which is bad for AccessPoints. ++ It does not support hardware crypto acceleration, which is a showstopper ++ for embedded devices with low CPU resources. ++ ++ If unsure, select the "stable" firmware. ++ + endchoice + + config B43_FW_SQUASH @@ -787,68 +1942,37 @@ index a1eedce..566e156 100644 + help + Enable support for using PIO instead of DMA. Unless you have DMA + transfer problems you don't need this. -+ -+ If unsure, say N. -+ -+ config PACKAGE_B43_PHY_G -+ bool "Enable support for G-PHYs" -+ default n if TARGET_brcm47xx_mips74k -+ default y -+ help -+ Enable support for G-PHY. This includes support for the following devices: -+ PCI: BCM4306, BCM4311, BCM4318 -+ SoC: BCM5352E, BCM4712 - --define KernelPackage/ath/config -- if PACKAGE_kmod-ath -- config ATH_USER_REGD -- bool "Force Atheros drivers to respect the user's regdomain settings" -+ If unsure, say Y. -+ -+ config PACKAGE_B43_PHY_N -+ bool "Enable support for N-PHYs" -+ default y - help -- Atheros' idea of regulatory handling is that the EEPROM of the card defines -- the regulatory limits and the user is only allowed to restrict the settings -- even further, even if the country allows frequencies or power levels that -- are forbidden by the EEPROM settings. -+ Enable support for N-PHY. This includes support for the following devices: -+ PCI: BCM4321, BCM4322, BCM43222, BCM43224, BCM43225 -+ SoC: BCM4716, BCM4717, BCM4718 - Select this option if you want the driver to respect the user's decision about - regulatory settings. -+ Currently only 11g speed is available. ++ If unsure, say N. - config PACKAGE_ATH_DEBUG - bool "Atheros wireless debugging" -+ If unsure, say Y. -+ -+ config PACKAGE_B43_PHY_LP -+ bool "Enable support for LP-PHYs" ++ config PACKAGE_B43_PHY_G ++ bool "Enable support for G-PHYs" + default n if TARGET_brcm47xx_mips74k + default y help - Say Y, if you want to debug atheros wireless drivers. - Right now only ath9k makes use of this. -+ Enable support for LP-PHY. This includes support for the following devices: -+ PCI: BCM4312 -+ SoC: BCM5354 ++ Enable support for G-PHY. This includes support for the following devices: ++ PCI: BCM4306, BCM4311, BCM4318 ++ SoC: BCM5352E, BCM4712 - config PACKAGE_ATH_DFS - bool "Enable DFS support" + If unsure, say Y. + -+ config PACKAGE_B43_PHY_HT -+ bool "Enable support for HT-PHYs" -+ default n if TARGET_brcm47xx_legacy ++ config PACKAGE_B43_PHY_N ++ bool "Enable support for N-PHYs" default y help - Dynamic frequency selection (DFS) is required for most of the 5 GHz band - channels in Europe, US, and Japan. -+ Enable support for HT-PHY. This includes support for the following devices: -+ PCI: BCM4331 ++ Enable support for N-PHY. This includes support for the following devices: ++ PCI: BCM4321, BCM4322, BCM43222, BCM43224, BCM43225 ++ SoC: BCM4716, BCM4717, BCM4718 - Select this option if you want to use such channels. + Currently only 11g speed is available. @@ -864,17 +1988,19 @@ index a1eedce..566e156 100644 - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath.ko - MENU:=1 -endef -+ config PACKAGE_B43_PHY_LCN -+ bool "Enable support for LCN-PHYs" -+ depends on BROKEN -+ default n ++ config PACKAGE_B43_PHY_LP ++ bool "Enable support for LP-PHYs" ++ default n if TARGET_brcm47xx_mips74k ++ default y + help -+ Currently broken. ++ Enable support for LP-PHY. This includes support for the following devices: ++ PCI: BCM4312 ++ SoC: BCM5354 -define KernelPackage/ath/description - This module contains some common parts needed by Atheros Wireless drivers. -endef -+ If unsure, say N. ++ If unsure, say Y. -define KernelPackage/ath5k - $(call KernelPackage/mac80211/Default) @@ -883,34 +2009,31 @@ index a1eedce..566e156 100644 - DEPENDS+= @PCI_SUPPORT||@TARGET_ath25 +kmod-ath - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath5k/ath5k.ko - AUTOLOAD:=$(call AutoProbe,ath5k) -+ endif - endef +-endef ++ config PACKAGE_B43_PHY_HT ++ bool "Enable support for HT-PHYs" ++ default n if TARGET_brcm47xx_legacy ++ default y ++ help ++ Enable support for HT-PHY. This includes support for the following devices: ++ PCI: BCM4331 -define KernelPackage/ath5k/description - This module adds support for wireless adapters based on - Atheros 5xxx chipset. -+define KernelPackage/b43/description -+Kernel module for Broadcom 43xx wireless support (mac80211 stack) new - endef +-endef ++ Currently only 11g speed is available. -define KernelPackage/ath9k-common -+define KernelPackage/b43legacy - $(call KernelPackage/mac80211/Default) +- $(call KernelPackage/mac80211/Default) - TITLE:=Atheros 802.11n wireless devices (common code for ath9k and ath9k_htc) - URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k - DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ar71xx +kmod-ath +@DRIVER_11N_SUPPORT +@KERNEL_RELAY - FILES:= \ - $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_common.ko \ - $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_hw.ko -+ TITLE:=Broadcom 43xx-legacy wireless support -+ URL:=https://wireless.wiki.kernel.org/en/users/drivers/b43 -+ KCONFIG:= \ -+ CONFIG_HW_RANDOM=y -+ DEPENDS+= +kmod-mac80211 +!(TARGET_brcm47xx||TARGET_brcm63xx):kmod-ssb -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/b43legacy/b43legacy.ko -+ AUTOLOAD:=$(call AutoProbe,b43legacy) -+ MENU:=1 - endef +-endef ++ If unsure, say Y. -define KernelPackage/ath9k - $(call KernelPackage/mac80211/Default) @@ -921,51 +2044,48 @@ index a1eedce..566e156 100644 - $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k.ko - AUTOLOAD:=$(call AutoProbe,ath9k) -endef -+define KernelPackage/b43legacy/config -+ if PACKAGE_kmod-b43legacy ++ config PACKAGE_B43_PHY_LCN ++ bool "Enable support for LCN-PHYs" ++ depends on BROKEN ++ default n ++ help ++ Currently broken. -define KernelPackage/ath9k/description -This module adds support for wireless adapters based on -Atheros IEEE 802.11n AR5008 and AR9001 family of chipsets. -endef -+ config B43LEGACY_FW_SQUASH -+ bool "Remove unnecessary firmware files" -+ default y -+ help -+ This options allows you to remove unnecessary b43legacy firmware files -+ from the final rootfs image. This can reduce the rootfs size by -+ up to 50k. ++ If unsure, say N. -define KernelPackage/ath9k/config -+ If unsure, say Y. ++ endif ++endef - config ATH9K_SUPPORT_PCOEM - bool "Support chips used in PC OEM cards" - depends on PACKAGE_kmod-ath9k - --endef -+ config B43LEGACY_FW_SQUASH_COREREVS -+ string "Core revisions to include" -+ depends on B43LEGACY_FW_SQUASH -+ default "1,2,3,4" -+ help -+ This is a comma seperated list of core revision numbers. ++define KernelPackage/b43/description ++Kernel module for Broadcom 43xx wireless support (mac80211 stack) new + endef -define KernelPackage/ath9k-htc -- $(call KernelPackage/mac80211/Default) ++define KernelPackage/b43legacy + $(call KernelPackage/mac80211/Default) - TITLE:=Atheros 802.11n USB device support - URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k - DEPENDS+= @USB_SUPPORT +kmod-ath9k-common +kmod-usb-core - FILES:= \ - $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_htc.ko - AUTOLOAD:=$(call AutoProbe,ath9k_htc) -+ Example (keep files for rev4 only): -+ 4 -+ -+ Example (keep files for rev2 and rev4): -+ 2,4 -+ -+ endif ++ TITLE:=Broadcom 43xx-legacy wireless support ++ URL:=https://wireless.wiki.kernel.org/en/users/drivers/b43 ++ KCONFIG:= \ ++ CONFIG_HW_RANDOM=y ++ DEPENDS+= +kmod-mac80211 +!(TARGET_brcm47xx||TARGET_brcm63xx):kmod-ssb +b43legacy-firmware ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/b43legacy/b43legacy.ko ++ AUTOLOAD:=$(call AutoProbe,b43legacy) ++ MENU:=1 endef -define KernelPackage/ath9k-htc/description @@ -989,7 +2109,7 @@ index a1eedce..566e156 100644 + TITLE:=Broadcom IEEE802.11n common driver parts + URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211 + DEPENDS+=@PCI_SUPPORT||USB_SUPPORT -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/brcm80211/brcmutil/brcmutil.ko ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/brcm80211/brcmutil/brcmutil.ko + AUTOLOAD:=$(call AutoProbe,brcmutil) + MENU:=1 endef @@ -1066,8 +2186,8 @@ index a1eedce..566e156 100644 - ) + TITLE:=Broadcom IEEE802.11n PCIe SoftMAC WLAN driver + URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211 -+ DEPENDS+= +kmod-mac80211 +@DRIVER_11N_SUPPORT +!TARGET_brcm47xx:kmod-bcma +kmod-lib-cordic +kmod-lib-crc8 +kmod-brcmutil -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/brcm80211/brcmsmac/brcmsmac.ko ++ DEPENDS+= +kmod-mac80211 +@DRIVER_11N_SUPPORT +!TARGET_brcm47xx:kmod-bcma +kmod-lib-cordic +kmod-lib-crc8 +kmod-brcmutil +!BRCMSMAC_USE_FW_FROM_WL:brcmsmac-firmware ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/brcm80211/brcmsmac/brcmsmac.ko + AUTOLOAD:=$(call AutoProbe,brcmsmac) + MENU:=1 endef @@ -1103,6 +2223,7 @@ index a1eedce..566e156 100644 - $(PKG_BUILD_DIR)/drivers/net/wireless/libertas/libertas.ko \ - $(PKG_BUILD_DIR)/drivers/net/wireless/libertas/libertas_sdio.ko - AUTOLOAD:=$(call AutoProbe,libertas libertas_sdio) +-endef + config BRCMSMAC_USE_FW_FROM_WL + bool "Use firmware extracted from broadcom proprietary driver" + default y @@ -1111,11 +2232,6 @@ index a1eedce..566e156 100644 + version 666.2 extracted from the proprietary Broadcom driver + is used. This is needed to get core rev 17 used in bcm4716 + to work. -+ -+ If unsure, say Y. -+ -+ endif - endef -define KernelPackage/mac80211-hwsim - $(call KernelPackage/mac80211/Default) @@ -1123,9 +2239,13 @@ index a1eedce..566e156 100644 - DEPENDS+= +kmod-mac80211 +@DRIVER_11N_SUPPORT - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mac80211_hwsim.ko - AUTOLOAD:=$(call AutoProbe,mac80211_hwsim) --endef ++ If unsure, say Y. ++ ++ endif + endef -define KernelPackage/net-libipw ++ +define KernelPackage/brcmfmac $(call KernelPackage/mac80211/Default) - TITLE:=libipw for ipw2100 and ipw2200 @@ -1134,8 +2254,11 @@ index a1eedce..566e156 100644 - AUTOLOAD:=$(call AutoProbe,libipw) + TITLE:=Broadcom IEEE802.11n USB FullMAC WLAN driver + URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211 -+ DEPENDS+= @USB_SUPPORT +kmod-cfg80211 +@DRIVER_11N_SUPPORT +kmod-brcmutil +BRCMFMAC_SDIO:kmod-mmc +BRCMFMAC_USB:kmod-usb-core -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/brcm80211/brcmfmac/brcmfmac.ko ++ DEPENDS+= @USB_SUPPORT +kmod-cfg80211 +@DRIVER_11N_SUPPORT +kmod-brcmutil \ ++ +BRCMFMAC_PCIE:brcmfmac-firmware-pcie \ ++ +BRCMFMAC_SDIO:kmod-mmc +BRCMFMAC_SDIO:brcmfmac-firmware-sdio \ ++ +BRCMFMAC_USB:kmod-usb-core +BRCMFMAC_USB:brcmfmac-firmware-usb ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko + AUTOLOAD:=$(call AutoProbe,brcmfmac) endef @@ -1220,7 +2343,7 @@ index a1eedce..566e156 100644 +define KernelPackage/carl9170 + $(call KernelPackage/mac80211/Default) + TITLE:=Driver for Atheros AR9170 USB sticks -+ DEPENDS:=@USB_SUPPORT +kmod-mac80211 +kmod-ath +kmod-usb-core +kmod-input-core +@DRIVER_11N_SUPPORT ++ DEPENDS:=@USB_SUPPORT +kmod-mac80211 +kmod-ath +kmod-usb-core +kmod-input-core +@DRIVER_11N_SUPPORT +carl9170-firmware + FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/carl9170/carl9170.ko + AUTOLOAD:=$(call AutoProbe,carl9170) endef @@ -1231,8 +2354,9 @@ index a1eedce..566e156 100644 $(call KernelPackage/mac80211/Default) TITLE:=Hermes 802.11b chipset support - DEPENDS:=@PCI_SUPPORT||PCMCIA_SUPPORT +kmod-cfg80211 +@DRIVER_WEXT_SUPPORT +- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco.ko + DEPENDS:=@PCI_SUPPORT||PCMCIA_SUPPORT +kmod-cfg80211 +@DRIVER_WEXT_SUPPORT +kmod-crypto-michael-mic - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco.ko ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/orinoco/orinoco.ko AUTOLOAD:=$(call AutoProbe,orinoco) endef @@ -1246,8 +2370,9 @@ index a1eedce..566e156 100644 $(call KernelPackage/mac80211/Default) TITLE:=Intersil Prism 2.5 PCI support - DEPENDS:=@PCI_SUPPORT +kmod-net-hermes +- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco_pci.ko + DEPENDS:=@PCI_SUPPORT +kmod-hermes - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco_pci.ko ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/orinoco/orinoco_pci.ko AUTOLOAD:=$(call AutoProbe,orinoco_pci) endef @@ -1261,8 +2386,9 @@ index a1eedce..566e156 100644 $(call KernelPackage/mac80211/Default) TITLE:=PLX9052 based PCI adaptor - DEPENDS:=@PCI_SUPPORT +kmod-net-hermes +- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco_plx.ko + DEPENDS:=@PCI_SUPPORT +kmod-hermes - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco_plx.ko ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/orinoco/orinoco_plx.ko AUTOLOAD:=$(call AutoProbe,orinoco_plx) endef @@ -1276,8 +2402,9 @@ index a1eedce..566e156 100644 $(call KernelPackage/mac80211/Default) TITLE:=Hermes based PCMCIA adaptors - DEPENDS:=@PCMCIA_SUPPORT +kmod-net-hermes @BROKEN +- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco_cs.ko + DEPENDS:=@PCMCIA_SUPPORT +kmod-hermes @BROKEN - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco_cs.ko ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/orinoco/orinoco_cs.ko AUTOLOAD:=$(call AutoProbe,orinoco_cs) endef @@ -1290,14 +2417,16 @@ index a1eedce..566e156 100644 + +define KernelPackage/iwlwifi $(call KernelPackage/mac80211/Default) - DEPENDS:= +kmod-mac80211 @PCI_SUPPORT +@DRIVER_11N_SUPPORT +- DEPENDS:= +kmod-mac80211 @PCI_SUPPORT +@DRIVER_11N_SUPPORT ++ DEPENDS:= +kmod-mac80211 @PCI_SUPPORT +@DRIVER_11N_SUPPORT +iwlwifi-firmware TITLE:=Intel AGN Wireless support FILES:= \ - $(PKG_BUILD_DIR)/drivers/net/wireless/iwlwifi/iwlwifi.ko \ +- $(PKG_BUILD_DIR)/drivers/net/wireless/iwlwifi/iwlwifi.ko \ - $(PKG_BUILD_DIR)/drivers/net/wireless/iwlwifi/dvm/iwldvm.ko - AUTOLOAD:=$(call AutoProbe,iwlwifi iwldvm) -+ $(PKG_BUILD_DIR)/drivers/net/wireless/iwlwifi/dvm/iwldvm.ko \ -+ $(PKG_BUILD_DIR)/drivers/net/wireless/iwlwifi/mvm/iwlmvm.ko ++ $(PKG_BUILD_DIR)/drivers/net/wireless/intel/iwlwifi/iwlwifi.ko \ ++ $(PKG_BUILD_DIR)/drivers/net/wireless/intel/iwlwifi/dvm/iwldvm.ko \ ++ $(PKG_BUILD_DIR)/drivers/net/wireless/intel/iwlwifi/mvm/iwlmvm.ko + AUTOLOAD:=$(call AutoProbe,iwlwifi iwldvm iwlmvm) MENU:=1 endef @@ -1305,6 +2434,48 @@ index a1eedce..566e156 100644 -define KernelPackage/iwlagn/description - iwlagn kernel module for Intel 5000/5150/1000/6000/6050/6005/6030/100 support -endef +- +-define KernelPackage/iwlagn/config +- if PACKAGE_kmod-iwlagn +- +- config IWL5000_FW +- bool "Intel 5000 Firmware" +- default y +- help +- Download and install firmware for: +- Intel Wireless WiFi 5100AGN, 5300AGN, and 5350AGN +- +- config IWL5150_FW +- bool "Intel 5150 Firmware" +- default y +- help +- Download and install firmware for: +- Intel Wireless WiFi 5150AGN +- +- config IWL1000_FW +- bool "Intel 1000 Firmware" +- default y +- help +- Download and install firmware for: +- Intel Centrino Wireless-N 1000 +- +- config IWL6000_FW +- bool "Intel 6000 Firmware" +- default y +- help +- Download and install firmware for: +- Intel Centrino Ultimate-N 6300 and Advanced-N 6200 +- +- config IWL6050_FW +- bool "Intel 6050 Firmware" +- default y +- help +- Download and install firmware for: +- Intel Centrino Advanced-N + WiMAX 6250 and Wireless-N + WiMAX 6150 +- +- config IWL6005_FW +- bool "Intel 6005 Firmware" +- default y +define KernelPackage/iwlwifi/description + iwlwifi kernel module for + Intel Wireless WiFi Link 6250AGN Adapter @@ -1330,223 +2501,132 @@ index a1eedce..566e156 100644 + config PACKAGE_IWLWIFI_DEBUG + bool "Enable full debugging output in the iwlwifi driver" + default n -+ help + help +- Download and install firmware for: +- Intel Centrino Advanced-N 6205 + This option will enable debug tracing output for the iwlwifi drivers --define KernelPackage/iwlagn/config -- if PACKAGE_kmod-iwlagn +- config IWL6030_FW +- bool "Intel 6030 Firmware" +- default y +- help +- Download and install firmware for: +- Intel Centrino Advanced-N 6230, Wireless-N 1030, Wireless-N 130 and Advanced-N 6235 + This will result in the kernel module being ~100k larger. You can + control which debug output is sent to the kernel log by setting the + value in -- config IWL5000_FW -- bool "Intel 5000 Firmware" +- config IWL7260_FW +- bool "Intel 7260 Firmware" - default y +- help +- Download and install firmware for: +- Intel Dual Band Wireless-N 7260 and Intel Dual Band Wireless-AC 7260 + /sys/module/iwlwifi/parameters/debug -+ + +- config IWL7265_FW +- bool "Intel 7265 Firmware" +- default y +- help +- Download and install firmware for: +- Intel Wireless 7265 + This entry will only exist if this option is enabled. -+ + +- config IWL100_FW +- bool "Intel 100 Firmware" +- default y +- help +- Download and install firmware for: +- Intel Centrino Wireless-N 100 + To set a value, simply echo an 8-byte hex value to the same file: -+ + +- config IWL2000_FW +- bool "Intel 2000 Firmware" +- default y +- help +- Download and install firmware for: +- Intel Centrino Wireless-N 2200 + % echo 0x43fff > /sys/module/iwlwifi/parameters/debug -+ + +- config IWL2030_FW +- bool "Intel 2030 Firmware" +- default y +- help +- Download and install firmware for: +- Intel Centrino Wireless-N 2230 + You can find the list of debug mask values in: -+ drivers/net/wireless/iwlwifi/iwl-debug.h -+ ++ drivers/net/wireless/intel/iwlwifi/iwl-debug.h + +- config IWL105_FW +- bool "Intel 105 Firmware" +- default y +- help +- Download and install firmware for: +- Intel Centrino Wireless-N 105 + If this is your first time using this driver, you should say Y here + as the debug information can assist others in helping you resolve + any problems you may encounter. -+ + +- config IWL135_FW +- bool "Intel 135 Firmware" +- default y + config PACKAGE_IWLWIFI_DEBUGFS + bool "iwlwifi debugfs support" + depends on PACKAGE_MAC80211_DEBUGFS + default n help - Download and install firmware for: -- Intel Wireless WiFi 5100AGN, 5300AGN, and 5350AGN +- Intel Centrino Wireless-N 135 + Enable creation of debugfs files for the iwlwifi drivers. This + is a low-impact option that allows getting insight into the + driver's state at runtime. -- config IWL5150_FW -- bool "Intel 5150 Firmware" -+ config IWL100_FW -+ bool "Intel 100 Firmware" - default y - help - Download and install firmware for: -- Intel Wireless WiFi 5150AGN -+ Intel Centrino Wireless-N 100 - - config IWL1000_FW - bool "Intel 1000 Firmware" -@@ -852,89 +910,104 @@ define KernelPackage/iwlagn/config - Download and install firmware for: - Intel Centrino Wireless-N 1000 - -- config IWL6000_FW -- bool "Intel 6000 Firmware" -+ config IWL105_FW -+ bool "Intel 105 Firmware" - default y - help - Download and install firmware for: -- Intel Centrino Ultimate-N 6300 and Advanced-N 6200 -+ Intel Centrino Wireless-N 105 - -- config IWL6050_FW -- bool "Intel 6050 Firmware" -+ config IWL135_FW -+ bool "Intel 135 Firmware" - default y - help - Download and install firmware for: -- Intel Centrino Advanced-N + WiMAX 6250 and Wireless-N + WiMAX 6150 -+ Intel Centrino Wireless-N 135 - -- config IWL6005_FW -- bool "Intel 6005 Firmware" -+ config IWL2000_FW -+ bool "Intel 2000 Firmware" - default y - help - Download and install firmware for: -- Intel Centrino Advanced-N 6205 -+ Intel Centrino Wireless-N 2200 - -- config IWL6030_FW -- bool "Intel 6030 Firmware" -+ config IWL2030_FW -+ bool "Intel 2030 Firmware" - default y - help - Download and install firmware for: -- Intel Centrino Advanced-N 6230, Wireless-N 1030, Wireless-N 130 and Advanced-N 6235 -+ Intel Centrino Wireless-N 2230 - -- config IWL7260_FW -- bool "Intel 7260 Firmware" -+ config IWL3160_FW -+ bool "Intel 3160 Firmware" - default y - help - Download and install firmware for: -- Intel Dual Band Wireless-N 7260 and Intel Dual Band Wireless-AC 7260 -+ Intel Wireless WiFi 3160 - -- config IWL7265_FW -- bool "Intel 7265 Firmware" -+ config IWL5000_FW -+ bool "Intel 5000 Firmware" - default y - help - Download and install firmware for: -- Intel Wireless 7265 -+ Intel Wireless WiFi 5100AGN, 5300AGN, and 5350AGN - -- config IWL100_FW -- bool "Intel 100 Firmware" -+ config IWL5150_FW -+ bool "Intel 5150 Firmware" - default y - help - Download and install firmware for: -- Intel Centrino Wireless-N 100 -+ Intel Wireless WiFi 5150AGN - -- config IWL2000_FW -- bool "Intel 2000 Firmware" -+ config IWL6000_FW -+ bool "Intel 6000 Firmware" - default y - help - Download and install firmware for: -- Intel Centrino Wireless-N 2200 -+ Intel Centrino Ultimate-N 6300 and Advanced-N 6200 - -- config IWL2030_FW -- bool "Intel 2030 Firmware" -+ config IWL6005_FW -+ bool "Intel 6005 Firmware" - default y - help - Download and install firmware for: -- Intel Centrino Wireless-N 2230 -+ Intel Centrino Advanced-N 6205 - -- config IWL105_FW -- bool "Intel 105 Firmware" -+ config IWL6030_FW -+ bool "Intel 6030 Firmware" - default y - help - Download and install firmware for: -- Intel Centrino Wireless-N 105 -+ Intel Centrino Advanced-N 6230, Wireless-N 1030, Wireless-N 130 and Advanced-N 6235 - -- config IWL135_FW -- bool "Intel 135 Firmware" -+ config IWL6050_FW -+ bool "Intel 6050 Firmware" - default y - help - Download and install firmware for: -- Intel Centrino Wireless-N 135 -+ Intel Centrino Advanced-N + WiMAX 6250 and Wireless-N + WiMAX 6150 - - config IWL3160_FW - bool "Intel 3160 Firmware" -+ config IWL7260_FW -+ bool "Intel 7260 Firmware" -+ default y -+ help -+ Download and install firmware for: -+ Intel Dual Band Wireless-N 7260 and Intel Dual Band Wireless-AC 7260 -+ -+ config IWL7265_FW -+ bool "Intel 7265 Firmware" -+ default y -+ help -+ Download and install firmware for: -+ Intel Wireless 7265, 7265D, 3165 -+ -+ config IWL8000_FW -+ bool "Intel 8000 Series Firmware" - default y - help - Download and install firmware for: +- default y +- help +- Download and install firmware for: - Intel Wireless 3160 -+ Intel Wireless Series 8260, 4165 -+ endif endef -@@ -953,578 +1026,587 @@ endef +@@ -942,7 +834,7 @@ define KernelPackage/iwl-legacy + $(call KernelPackage/mac80211/Default) + DEPENDS:= +kmod-mac80211 @PCI_SUPPORT + TITLE:=Intel legacy Wireless support +- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/iwlegacy/iwlegacy.ko ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intel/iwlegacy/iwlegacy.ko + AUTOLOAD:=$(call AutoProbe,iwlegacy) + endef + +@@ -952,9 +844,9 @@ endef + define KernelPackage/iwl3945 $(call KernelPackage/mac80211/Default) - DEPENDS:= +kmod-mac80211 +kmod-iwl-legacy -- TITLE:=Intel iwl3945 Wireless support +- DEPENDS:= +kmod-mac80211 +kmod-iwl-legacy ++ DEPENDS:= +kmod-mac80211 +kmod-iwl-legacy +iwl3945-firmware + TITLE:=Intel iwl3945 Wireless support - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/iwlegacy/iwl3945.ko -- AUTOLOAD:=$(call AutoProbe,iwl3945) --endef -- --define KernelPackage/iwl3945/description -- iwl3945 kernel module for Intel 3945 support --endef -- --define KernelPackage/iwl4965 -- $(call KernelPackage/mac80211/Default) ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intel/iwlegacy/iwl3945.ko + AUTOLOAD:=$(call AutoProbe,iwl3945) + endef + +@@ -964,9 +856,9 @@ endef + + define KernelPackage/iwl4965 + $(call KernelPackage/mac80211/Default) - DEPENDS:= +kmod-mac80211 +kmod-iwl-legacy +@DRIVER_11N_SUPPORT -- TITLE:=Intel iwl4965 Wireless support ++ DEPENDS:= +kmod-mac80211 +kmod-iwl-legacy +@DRIVER_11N_SUPPORT +iwl4965-firmware + TITLE:=Intel iwl4965 Wireless support - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/iwlegacy/iwl4965.ko -- AUTOLOAD:=$(call AutoProbe,iwl4965) --endef -- --define KernelPackage/iwl4965/description -- iwl4965 kernel module for Intel 4965 support --endef -- -- ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intel/iwlegacy/iwl4965.ko + AUTOLOAD:=$(call AutoProbe,iwl4965) + endef + +@@ -975,557 +867,562 @@ define KernelPackage/iwl4965/description + endef + + -define KernelPackage/mwl8k - $(call KernelPackage/mac80211/Default) - TITLE:=Driver for Marvell TOPDOG 802.11 Wireless cards @@ -1578,10 +2658,13 @@ index a1eedce..566e156 100644 - - -define KernelPackage/wlcore -- $(call KernelPackage/mac80211/Default) ++define KernelPackage/lib80211 + $(call KernelPackage/mac80211/Default) - TITLE:=TI common driver part - DEPENDS+= @TARGET_omap +kmod-mac80211 +@DRIVER_11N_SUPPORT -- FILES:= \ ++ TITLE:=802.11 Networking stack ++ DEPENDS:=+kmod-cfg80211 + FILES:= \ - $(PKG_BUILD_DIR)/drivers/net/wireless/ti/wlcore/wlcore.ko \ - $(PKG_BUILD_DIR)/drivers/net/wireless/ti/wlcore/wlcore_sdio.ko - AUTOLOAD:=$(call AutoProbe,wlcore wlcore_sdio) @@ -1598,38 +2681,26 @@ index a1eedce..566e156 100644 - DEPENDS+= +kmod-wlcore - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wl12xx/wl12xx.ko - AUTOLOAD:=$(call AutoProbe,wl12xx) -+ TITLE:=Intel iwl3945 Wireless support -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/iwlegacy/iwl3945.ko -+ AUTOLOAD:=$(call AutoProbe,iwl3945) - endef - +-endef +- -define KernelPackage/wl12xx/description - Kernel modules for TI WL12xx -+define KernelPackage/iwl3945/description -+ iwl3945 kernel module for Intel 3945 support - endef - +-endef +- -define KernelPackage/wl18xx -+define KernelPackage/iwl4965 - $(call KernelPackage/mac80211/Default) +- $(call KernelPackage/mac80211/Default) - TITLE:=Driver for TI WL18xx - URL:=http://wireless.kernel.org/en/users/Drivers/wl18xx - DEPENDS+= +kmod-wlcore - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wl18xx/wl18xx.ko - AUTOLOAD:=$(call AutoProbe,wl18xx) -+ DEPENDS:= +kmod-mac80211 +kmod-iwl-legacy +@DRIVER_11N_SUPPORT -+ TITLE:=Intel iwl4965 Wireless support -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/iwlegacy/iwl4965.ko -+ AUTOLOAD:=$(call AutoProbe,iwl4965) - endef - +-endef +- -define KernelPackage/wl18xx/description - Kernel modules for TI WL18xx -+define KernelPackage/iwl4965/description -+ iwl4965 kernel module for Intel 4965 support - endef - - +-endef +- +- -#Broadcom firmware -ifneq ($(CONFIG_B43_FW_6_30),) - PKG_B43_FWV4_NAME:=broadcom-wl @@ -1693,11 +2764,13 @@ index a1eedce..566e156 100644 - FILE:=$(PKG_B43_FWV4_SOURCE) - URL:=$(PKG_B43_FWV4_SOURCE_URL) - MD5SUM:=$(PKG_B43_FWV4_MD5SUM) -+define KernelPackage/lib80211 -+ $(call KernelPackage/mac80211/Default) -+ TITLE:=802.11 Networking stack -+ DEPENDS:=+kmod-cfg80211 -+ FILES:= \ +-endef +-$(eval $(call Download,b43)) +- +-define Download/b43legacy +- FILE:=$(PKG_B43_FWV3_SOURCE) +- URL:=$(PKG_B43_FWV3_SOURCE_URL) +- MD5SUM:=$(PKG_B43_FWV3_MD5SUM) + $(PKG_BUILD_DIR)/net/wireless/lib80211.ko \ + $(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_wep.ko \ + $(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_ccmp.ko \ @@ -1709,26 +2782,11 @@ index a1eedce..566e156 100644 + lib80211_crypt_tkip \ + ) endef --$(eval $(call Download,b43)) - --define Download/b43legacy -- FILE:=$(PKG_B43_FWV3_SOURCE) -- URL:=$(PKG_B43_FWV3_SOURCE_URL) -- MD5SUM:=$(PKG_B43_FWV3_MD5SUM) -+define KernelPackage/lib80211/description -+ Kernel modules for 802.11 Networking stack -+ Includes: -+ - lib80211 -+ - lib80211_crypt_wep -+ - lib80211_crypt_tkip -+ - lib80211_crytp_ccmp - endef -$(eval $(call Download,b43legacy)) - +- -define KernelPackage/b43 -+define KernelPackage/libipw - $(call KernelPackage/mac80211/Default) +- $(call KernelPackage/mac80211/Default) - TITLE:=Broadcom 43xx wireless support - URL:=https://wireless.wiki.kernel.org/en/users/drivers/b43 - KCONFIG:= \ @@ -1741,10 +2799,13 @@ index a1eedce..566e156 100644 - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/b43/b43.ko - AUTOLOAD:=$(call AutoProbe,b43) - MENU:=1 -+ TITLE:=libipw for ipw2100 and ipw2200 -+ DEPENDS:=@PCI_SUPPORT +kmod-crypto-michael-mic +kmod-lib80211 +kmod-cfg80211 +@DRIVER_WEXT_SUPPORT @!BIG_ENDIAN -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ipw2x00/libipw.ko -+ AUTOLOAD:=$(call AutoProbe,libipw) ++define KernelPackage/lib80211/description ++ Kernel modules for 802.11 Networking stack ++ Includes: ++ - lib80211 ++ - lib80211_crypt_wep ++ - lib80211_crypt_tkip ++ - lib80211_crytp_ccmp endef -define KernelPackage/b43/config @@ -1755,20 +2816,45 @@ index a1eedce..566e156 100644 - depends on !TARGET_brcm47xx && !TARGET_brcm63xx - default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_BCMA_AND_SSB - default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_SSB -+define KernelPackage/libipw/description -+ Hardware independent IEEE 802.11 networking stack for ipw2100 and ipw2200. -+endef - +- -config PACKAGE_B43_USE_BCMA - select PACKAGE_kmod-bcma - tristate - depends on !TARGET_brcm47xx && !TARGET_bcm53xx - default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_BCMA_AND_SSB - default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_BCMA +- +- if PACKAGE_kmod-b43 + +- choice +- prompt "b43 firmware version" +- default B43_FW_5_100_138 +- help +- This option allows you to select the version of the b43 firmware. ++define KernelPackage/libipw ++ $(call KernelPackage/mac80211/Default) ++ TITLE:=libipw for ipw2100 and ipw2200 ++ DEPENDS:=@PCI_SUPPORT +kmod-crypto-michael-mic +kmod-lib80211 +kmod-cfg80211 +@DRIVER_WEXT_SUPPORT @!BIG_ENDIAN ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intel/ipw2x00/libipw.ko ++ AUTOLOAD:=$(call AutoProbe,libipw) ++endef + +- config B43_FW_4_150 +- bool "Firmware 410.2160 from driver 4.150.10.5 (old stable)" +- help +- Old stable firmware for BCM43xx devices. ++define KernelPackage/libipw/description ++ Hardware independent IEEE 802.11 networking stack for ipw2100 and ipw2200. ++endef + +- If unsure, select this. +IPW2100_NAME:=ipw2100-fw +IPW2100_VERSION:=1.3 -- if PACKAGE_kmod-b43 +- config B43_FW_4_178 +- bool "Firmware 478.104 from driver 4.178.10.4" +- help +- Older firmware for BCM43xx devices. +define Download/ipw2100 + URL:=http://bughost.org/firmware/ + FILE:=$(IPW2100_NAME)-$(IPW2100_VERSION).tgz @@ -1776,37 +2862,33 @@ index a1eedce..566e156 100644 +endef +$(eval $(call Download,ipw2100)) -- choice -- prompt "b43 firmware version" -- default B43_FW_5_100_138 -- help -- This option allows you to select the version of the b43 firmware. +- If unsure, select the "stable" firmware. +define KernelPackage/ipw2100 + $(call KernelPackage/mac80211/Default) + TITLE:=Intel IPW2100 driver + DEPENDS:=@PCI_SUPPORT +kmod-libipw -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ipw2x00/ipw2100.ko ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intel/ipw2x00/ipw2100.ko + AUTOLOAD:=$(call AutoProbe,ipw2100) +endef -- config B43_FW_4_150 -- bool "Firmware 410.2160 from driver 4.150.10.5 (old stable)" +- config B43_FW_5_10 +- bool "Firmware 508.1084 from driver 5.10.56.27" - help -- Old stable firmware for BCM43xx devices. +- Older firmware for BCM43xx devices. +define KernelPackage/ipw2100/description + Kernel support for Intel IPW2100 + Includes: + - ipw2100 +endef -- If unsure, select this. +- If unsure, select the "stable" firmware. +IPW2200_NAME:=ipw2200-fw +IPW2200_VERSION:=3.1 -- config B43_FW_4_178 -- bool "Firmware 478.104 from driver 4.178.10.4" +- config B43_FW_5_100_138 +- bool "Firmware 666.2 from driver 5.100.138 (stable)" - help -- Older firmware for BCM43xx devices. +- The currently default firmware for BCM43xx devices. +define Download/ipw2200 + URL:=http://bughost.org/firmware/ + FILE:=$(IPW2200_NAME)-$(IPW2200_VERSION).tgz @@ -1814,53 +2896,53 @@ index a1eedce..566e156 100644 +endef +$(eval $(call Download,ipw2200)) -- If unsure, select the "stable" firmware. +- This firmware currently gets most of the testing and is needed for some N-PHY devices. +define KernelPackage/ipw2200 + $(call KernelPackage/mac80211/Default) + TITLE:=Intel IPW2200 driver + DEPENDS:=@PCI_SUPPORT +kmod-libipw -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ipw2x00/ipw2200.ko ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intel/ipw2x00/ipw2200.ko + AUTOLOAD:=$(call AutoProbe,ipw2200) +endef -- config B43_FW_5_10 -- bool "Firmware 508.1084 from driver 5.10.56.27" -- help -- Older firmware for BCM43xx devices. +- If unsure, select the this firmware. +define KernelPackage/ipw2200/description + Kernel support for Intel IPW2200 + Includes: + - ipw2200 +endef -- If unsure, select the "stable" firmware. - -- config B43_FW_5_100_138 -- bool "Firmware 666.2 from driver 5.100.138 (stable)" +- config B43_FW_6_30 +- bool "Firmware 784.2 from driver 6.30.163.46 (experimental)" - help -- The currently default firmware for BCM43xx devices. +- Newer experimental firmware for BCM43xx devices. + +- This firmware is mostly untested. +define KernelPackage/libertas-usb + $(call KernelPackage/mac80211/Default) -+ DEPENDS+= @USB_SUPPORT +kmod-cfg80211 +kmod-usb-core +kmod-lib80211 +@DRIVER_WEXT_SUPPORT ++ DEPENDS+= @USB_SUPPORT +kmod-cfg80211 +kmod-usb-core +kmod-lib80211 +@DRIVER_WEXT_SUPPORT +libertas-usb-firmware + TITLE:=Marvell 88W8015 Wireless Driver + FILES:= \ -+ $(PKG_BUILD_DIR)/drivers/net/wireless/libertas/libertas.ko \ -+ $(PKG_BUILD_DIR)/drivers/net/wireless/libertas/usb8xxx.ko ++ $(PKG_BUILD_DIR)/drivers/net/wireless/marvell/libertas/libertas.ko \ ++ $(PKG_BUILD_DIR)/drivers/net/wireless/marvell/libertas/usb8xxx.ko + AUTOLOAD:=$(call AutoProbe,libertas usb8xxx) +endef -- This firmware currently gets most of the testing and is needed for some N-PHY devices. +- If unsure, select the "stable" firmware. +define KernelPackage/libertas-sdio + $(call KernelPackage/mac80211/Default) -+ DEPENDS+= +kmod-cfg80211 +kmod-lib80211 +kmod-mmc +@DRIVER_WEXT_SUPPORT @!TARGET_uml ++ DEPENDS+= +kmod-cfg80211 +kmod-lib80211 +kmod-mmc +@DRIVER_WEXT_SUPPORT @!TARGET_uml +libertas-sdio-firmware + TITLE:=Marvell 88W8686 Wireless Driver + FILES:= \ -+ $(PKG_BUILD_DIR)/drivers/net/wireless/libertas/libertas.ko \ -+ $(PKG_BUILD_DIR)/drivers/net/wireless/libertas/libertas_sdio.ko ++ $(PKG_BUILD_DIR)/drivers/net/wireless/marvell/libertas/libertas.ko \ ++ $(PKG_BUILD_DIR)/drivers/net/wireless/marvell/libertas/libertas_sdio.ko + AUTOLOAD:=$(call AutoProbe,libertas libertas_sdio) +endef -- If unsure, select the this firmware. +- config B43_OPENFIRMWARE +- bool "Open FirmWare for WiFi networks" +- help +- Opensource firmware for BCM43xx devices. +define KernelPackage/mac80211-hwsim + $(call KernelPackage/mac80211/Default) + TITLE:=mac80211 HW simulation device @@ -1869,69 +2951,22 @@ index a1eedce..566e156 100644 + AUTOLOAD:=$(call AutoProbe,mac80211_hwsim) +endef -- config B43_FW_6_30 -- bool "Firmware 784.2 from driver 6.30.163.46 (experimental)" -- help -- Newer experimental firmware for BCM43xx devices. -+PKG_MT7601U_FW_NAME:=DPO_MT7601U_LinuxSTA -+PKG_MT7601U_FW_VERSION:=3.0.0.4_20130913 -+PKG_MT7601U_FW_MD5SUM:=5f440dccc8bc952745a191994fc34699 -+PKG_MT7601U_FW_SOURCE:=$(PKG_MT7601U_FW_NAME)_$(PKG_MT7601U_FW_VERSION).tar.bz2 -+PKG_MT7601U_FW_SOURCE_URL:=http://www.mediatek.com/AmazonS3/Downloads/linux/ -+define Download/mt7601u-firmware -+ FILE:=$(PKG_MT7601U_FW_SOURCE) -+ URL:=$(PKG_MT7601U_FW_SOURCE_URL) -+ MD5SUM:=$(PKG_MT7601U_FW_MD5SUM) -+ SUBDIR:=$(PKG_MT7601U_FW_NAME)_$(PKG_MT7601U_FW_VERSION) -+endef -+$(eval $(call Download,mt7601u-firmware)) - -- This firmware is mostly untested. -+define KernelPackage/mt7601u -+ $(call KernelPackage/mac80211/Default) -+ TITLE:=MT7601U-based USB dongles Wireless Driver -+ DEPENDS+= +kmod-mac80211 +@DRIVER_11N_SUPPORT @USB_SUPPORT +kmod-usb-core -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mediatek/mt7601u/mt7601u.ko -+ AUTOLOAD:=$(call AutoProbe,mt7601) -+endef - -- If unsure, select the "stable" firmware. - -- config B43_OPENFIRMWARE -- bool "Open FirmWare for WiFi networks" -- help -- Opensource firmware for BCM43xx devices. -+define KernelPackage/mwl8k -+ $(call KernelPackage/mac80211/Default) -+ TITLE:=Driver for Marvell TOPDOG 802.11 Wireless cards -+ URL:=http://wireless.kernel.org/en/users/Drivers/mwl8k -+ DEPENDS+= @PCI_SUPPORT +kmod-mac80211 +@DRIVER_11N_SUPPORT -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mwl8k.ko -+ AUTOLOAD:=$(call AutoProbe,mwl8k) -+endef - - Do _not_ select this, unless you know what you are doing. - The Opensource firmware is not suitable for embedded devices, yet. - It does not support QoS, which is bad for AccessPoints. - It does not support hardware crypto acceleration, which is a showstopper - for embedded devices with low CPU resources. -+define KernelPackage/mwl8k/description -+ Kernel modules for Marvell TOPDOG 802.11 Wireless cards -+endef - If unsure, select the "stable" firmware. ++define KernelPackage/mt7601u ++ $(call KernelPackage/mac80211/Default) ++ TITLE:=MT7601U-based USB dongles Wireless Driver ++ DEPENDS+= +kmod-mac80211 +@DRIVER_11N_SUPPORT @USB_SUPPORT +kmod-usb-core +mt7601u-firmware ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mediatek/mt7601u/mt7601u.ko ++ AUTOLOAD:=$(call AutoProbe,mt7601u) ++endef - endchoice -+define KernelPackage/mwifiex-pcie -+ $(call KernelPackage/mac80211/Default) -+ TITLE:=Driver for Marvell 802.11n/802.11ac PCIe Wireless cards -+ URL:=http://wireless.kernel.org/en/users/Drivers/mwifiex -+ DEPENDS+= @PCI_SUPPORT +kmod-mac80211 +@DRIVER_11N_SUPPORT -+ FILES:= \ -+ $(PKG_BUILD_DIR)/drivers/net/wireless/mwifiex/mwifiex.ko \ -+ $(PKG_BUILD_DIR)/drivers/net/wireless/mwifiex/mwifiex_pcie.ko -+ AUTOLOAD:=$(call AutoProbe,mwifiex_pcie) -+endef - config B43_FW_SQUASH - bool "Remove unnecessary firmware files" @@ -1941,11 +2976,19 @@ index a1eedce..566e156 100644 - This options allows you to remove unnecessary b43 firmware files - from the final rootfs image. This can reduce the rootfs size by - up to 200k. -+define KernelPackage/mwifiex-pcie/description -+ Kernel modules for Marvell 802.11n/802.11ac PCIe Wireless cards ++define KernelPackage/mwl8k ++ $(call KernelPackage/mac80211/Default) ++ TITLE:=Driver for Marvell TOPDOG 802.11 Wireless cards ++ URL:=http://wireless.kernel.org/en/users/Drivers/mwl8k ++ DEPENDS+= @PCI_SUPPORT +kmod-mac80211 +@DRIVER_11N_SUPPORT +mwl8k-firmware ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/marvell/mwl8k.ko ++ AUTOLOAD:=$(call AutoProbe,mwl8k) +endef - If unsure, say Y. ++define KernelPackage/mwl8k/description ++ Kernel modules for Marvell TOPDOG 802.11 Wireless cards ++endef - config B43_FW_SQUASH_COREREVS - string "Core revisions to include" @@ -1955,28 +2998,25 @@ index a1eedce..566e156 100644 - default "5,6,7,8,9,10,11,13,15,16,28,29,30" - help - This is a comma seperated list of core revision numbers. -+# Prism54 drivers -+P54PCIFW:=2.13.12.0.arm -+P54USBFW:=2.13.24.0.lm87.arm -+P54SPIFW:=2.13.0.0.a.13.14.arm - Example (keep files for rev5 only): - 5 -+define Download/p54usb -+ FILE:=$(P54USBFW) -+ URL:=http://daemonizer.de/prism54/prism54-fw/fw-usb -+ MD5SUM:=8e8ab005a4f8f0123bcdc51bc25b47f6 ++define KernelPackage/mwifiex-pcie ++ $(call KernelPackage/mac80211/Default) ++ TITLE:=Driver for Marvell 802.11n/802.11ac PCIe Wireless cards ++ URL:=http://wireless.kernel.org/en/users/Drivers/mwifiex ++ DEPENDS+= @PCI_SUPPORT +kmod-mac80211 +@DRIVER_11N_SUPPORT +mwifiex-pcie-firmware ++ FILES:= \ ++ $(PKG_BUILD_DIR)/drivers/net/wireless/marvell/mwifiex/mwifiex.ko \ ++ $(PKG_BUILD_DIR)/drivers/net/wireless/marvell/mwifiex/mwifiex_pcie.ko ++ AUTOLOAD:=$(call AutoProbe,mwifiex_pcie) +endef -+$(eval $(call Download,p54usb)) - Example (keep files for rev5 and rev11): - 5,11 -+define Download/p54pci -+ FILE:=$(P54PCIFW) -+ URL:=http://daemonizer.de/prism54/prism54-fw/fw-softmac -+ MD5SUM:=ff7536af2092b1c4b21315bd103ef4c4 ++define KernelPackage/mwifiex-pcie/description ++ Kernel modules for Marvell 802.11n/802.11ac PCIe Wireless cards +endef -+$(eval $(call Download,p54pci)) - config B43_FW_SQUASH_PHYTYPES - string "PHY types to include" @@ -1995,6 +3035,38 @@ index a1eedce..566e156 100644 - LCN => LCN-PHY - LCN40 => LCN40-PHY - AC => AC-PHY + +- Example (keep files for G-PHY only): +- G ++# Prism54 drivers ++P54PCIFW:=2.13.12.0.arm ++P54USBFW:=2.13.24.0.lm87.arm ++P54SPIFW:=2.13.0.0.a.13.14.arm + +- Example (keep files for G-PHY and N-PHY): +- G,N ++define Download/p54usb ++ FILE:=$(P54USBFW) ++ URL:=http://daemonizer.de/prism54/prism54-fw/fw-usb ++ MD5SUM:=8e8ab005a4f8f0123bcdc51bc25b47f6 ++endef ++$(eval $(call Download,p54usb)) + +- choice +- prompt "Supported buses" +- default PACKAGE_B43_BUSES_BCMA_AND_SSB +- help +- This allows choosing buses that b43 should support. ++define Download/p54pci ++ FILE:=$(P54PCIFW) ++ URL:=http://daemonizer.de/prism54/prism54-fw/fw-softmac ++ MD5SUM:=ff7536af2092b1c4b21315bd103ef4c4 ++endef ++$(eval $(call Download,p54pci)) + +- config PACKAGE_B43_BUSES_BCMA_AND_SSB +- depends on !TARGET_brcm47xx_legacy && !TARGET_brcm47xx_mips74k && !TARGET_bcm53xx +- bool "BCMA and SSB" +define Download/p54spi + FILE:=$(P54SPIFW) + URL:=http://daemonizer.de/prism54/prism54-fw/stlc4560 @@ -2002,68 +3074,27 @@ index a1eedce..566e156 100644 +endef +$(eval $(call Download,p54spi)) -- Example (keep files for G-PHY only): -- G +- config PACKAGE_B43_BUSES_BCMA +- depends on !TARGET_brcm47xx_legacy +- bool "BCMA only" +define KernelPackage/p54/Default + $(call KernelPackage/mac80211/Default) + TITLE:=Prism54 Drivers +endef -- Example (keep files for G-PHY and N-PHY): -- G,N +- config PACKAGE_B43_BUSES_SSB +- depends on !TARGET_brcm47xx_mips74k && !TARGET_bcm53xx +- bool "SSB only" +define KernelPackage/p54/description + Kernel module for Prism54 chipsets (mac80211) +endef -- choice -- prompt "Supported buses" -- default PACKAGE_B43_BUSES_BCMA_AND_SSB -- help -- This allows choosing buses that b43 should support. +- endchoice +define KernelPackage/p54-common + $(call KernelPackage/p54/Default) + DEPENDS+= @PCI_SUPPORT||@USB_SUPPORT||@TARGET_omap24xx +kmod-mac80211 +kmod-lib-crc-ccitt + TITLE+= (COMMON) -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54common.ko -+endef - -- config PACKAGE_B43_BUSES_BCMA_AND_SSB -- depends on !TARGET_brcm47xx_legacy && !TARGET_brcm47xx_mips74k && !TARGET_bcm53xx -- bool "BCMA and SSB" -+define KernelPackage/p54-pci -+ $(call KernelPackage/p54/Default) -+ TITLE+= (PCI) -+ DEPENDS+= @PCI_SUPPORT +kmod-p54-common -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54pci.ko -+ AUTOLOAD:=$(call AutoProbe,p54pci) -+endef - -- config PACKAGE_B43_BUSES_BCMA -- depends on !TARGET_brcm47xx_legacy -- bool "BCMA only" -+define KernelPackage/p54-usb -+ $(call KernelPackage/p54/Default) -+ TITLE+= (USB) -+ DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-p54-common -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54usb.ko -+ AUTOLOAD:=$(call AutoProbe,p54usb) -+endef - -- config PACKAGE_B43_BUSES_SSB -- depends on !TARGET_brcm47xx_mips74k && !TARGET_bcm53xx -- bool "SSB only" -+define KernelPackage/p54-spi -+ $(call KernelPackage/p54/Default) -+ TITLE+= (SPI) -+ DEPENDS+= @TARGET_omap24xx +kmod-p54-common -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54spi.ko -+ AUTOLOAD:=$(call AutoProbe,p54spi) -+endef - -- endchoice -+define KernelPackage/rt2x00/Default -+ $(call KernelPackage/mac80211/Default) -+ TITLE:=Ralink Drivers for RT2x00 cards ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/p54/p54common.ko +endef - config PACKAGE_B43_DEBUG @@ -2072,82 +3103,85 @@ index a1eedce..566e156 100644 - help - Enable additional debug output and runtime sanity checks for b43 - and enables the debugfs interface. -+define KernelPackage/rt2x00-lib -+$(call KernelPackage/rt2x00/Default) -+ DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT||TARGET_ramips) +kmod-mac80211 +kmod-lib-crc-itu-t -+ TITLE+= (LIB) -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00lib.ko -+ MENU:=1 ++define KernelPackage/p54-pci ++ $(call KernelPackage/p54/Default) ++ TITLE+= (PCI) ++ DEPENDS+= @PCI_SUPPORT +kmod-p54-common ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/p54/p54pci.ko ++ AUTOLOAD:=$(call AutoProbe,p54pci) +endef - If unsure, say N. -+define KernelPackage/rt2x00-lib/config -+ if PACKAGE_kmod-rt2x00-lib ++define KernelPackage/p54-usb ++ $(call KernelPackage/p54/Default) ++ TITLE+= (USB) ++ DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-p54-common ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/p54/p54usb.ko ++ AUTOLOAD:=$(call AutoProbe,p54usb) ++endef - config PACKAGE_B43_PIO - bool "Enable support for PIO transfer mode" - default n -+ config PACKAGE_RT2X00_LIB_DEBUGFS -+ bool "Enable rt2x00 debugfs support" -+ depends on PACKAGE_MAC80211_DEBUGFS - help +- help - Enable support for using PIO instead of DMA. Unless you have DMA - transfer problems you don't need this. -- ++define KernelPackage/p54-spi ++ $(call KernelPackage/p54/Default) ++ TITLE+= (SPI) ++ DEPENDS+= @TARGET_omap24xx +kmod-p54-common ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/p54/p54spi.ko ++ AUTOLOAD:=$(call AutoProbe,p54spi) ++endef + - If unsure, say N. -+ Enable creation of debugfs files for the rt2x00 drivers. -+ These debugfs files support both reading and writing of the -+ most important register types of the rt2x00 hardware. ++define KernelPackage/rt2x00/Default ++ $(call KernelPackage/mac80211/Default) ++ TITLE:=Ralink Drivers for RT2x00 cards ++endef - config PACKAGE_B43_PHY_G - bool "Enable support for G-PHYs" - default n if TARGET_brcm47xx_mips74k - default y -+ config PACKAGE_RT2X00_DEBUG -+ bool "Enable rt2x00 debug output" - help +- help - Enable support for G-PHY. This includes support for the following devices: - PCI: BCM4306, BCM4311, BCM4318 - SoC: BCM5352E, BCM4712 -+ Enable debugging output for all rt2x00 modules ++define KernelPackage/rt2x00-lib ++$(call KernelPackage/rt2x00/Default) ++ DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT||TARGET_ramips) +kmod-mac80211 +kmod-lib-crc-itu-t ++ TITLE+= (LIB) ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ralink/rt2x00/rt2x00lib.ko ++ MENU:=1 ++endef - If unsure, say Y. -+ endif -+endef ++define KernelPackage/rt2x00-lib/config ++ if PACKAGE_kmod-rt2x00-lib - config PACKAGE_B43_PHY_N - bool "Enable support for N-PHYs" - default y -- help ++ config PACKAGE_RT2X00_LIB_DEBUGFS ++ bool "Enable rt2x00 debugfs support" ++ depends on PACKAGE_MAC80211_DEBUGFS + help - Enable support for N-PHY. This includes support for the following devices: - PCI: BCM4321, BCM4322, BCM43222, BCM43224, BCM43225 - SoC: BCM4716, BCM4717, BCM4718 -+define KernelPackage/rt2x00-mmio -+$(call KernelPackage/rt2x00/Default) -+ DEPENDS+= @(PCI_SUPPORT||TARGET_ramips) +kmod-rt2x00-lib +kmod-eeprom-93cx6 -+ HIDDEN:=1 -+ TITLE+= (MMIO) -+ FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00mmio.ko -+endef ++ Enable creation of debugfs files for the rt2x00 drivers. ++ These debugfs files support both reading and writing of the ++ most important register types of the rt2x00 hardware. - Currently only 11g speed is available. -+define KernelPackage/rt2x00-pci -+$(call KernelPackage/rt2x00/Default) -+ DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-mmio +kmod-rt2x00-lib -+ HIDDEN:=1 -+ TITLE+= (PCI) -+ FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00pci.ko -+ AUTOLOAD:=$(call AutoProbe,rt2x00pci) -+endef ++ config PACKAGE_RT2X00_DEBUG ++ bool "Enable rt2x00 debug output" ++ help ++ Enable debugging output for all rt2x00 modules - If unsure, say Y. -+define KernelPackage/rt2x00-usb -+$(call KernelPackage/rt2x00/Default) -+ DEPENDS+= @USB_SUPPORT +kmod-rt2x00-lib +kmod-usb-core -+ HIDDEN:=1 -+ TITLE+= (USB) -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00usb.ko -+ AUTOLOAD:=$(call AutoProbe,rt2x00usb) ++ endif +endef - config PACKAGE_B43_PHY_LP @@ -2158,21 +3192,22 @@ index a1eedce..566e156 100644 - Enable support for LP-PHY. This includes support for the following devices: - PCI: BCM4312 - SoC: BCM5354 -+define KernelPackage/rt2800-lib ++define KernelPackage/rt2x00-mmio +$(call KernelPackage/rt2x00/Default) -+ DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT||TARGET_ramips) +kmod-rt2x00-lib +kmod-lib-crc-ccitt +@DRIVER_11N_SUPPORT ++ DEPENDS+= @(PCI_SUPPORT||TARGET_ramips) +kmod-rt2x00-lib +kmod-eeprom-93cx6 + HIDDEN:=1 -+ TITLE+= (rt2800 LIB) -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800lib.ko ++ TITLE+= (MMIO) ++ FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/ralink/rt2x00/rt2x00mmio.ko +endef - If unsure, say Y. -+define KernelPackage/rt2400-pci ++define KernelPackage/rt2x00-pci +$(call KernelPackage/rt2x00/Default) -+ DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci -+ TITLE+= (RT2400 PCI) -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2400pci.ko -+ AUTOLOAD:=$(call AutoProbe,rt2400pci) ++ DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-mmio +kmod-rt2x00-lib ++ HIDDEN:=1 ++ TITLE+= (PCI) ++ FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/ralink/rt2x00/rt2x00pci.ko ++ AUTOLOAD:=$(call AutoProbe,rt2x00pci) +endef - config PACKAGE_B43_PHY_HT @@ -2182,48 +3217,31 @@ index a1eedce..566e156 100644 - help - Enable support for HT-PHY. This includes support for the following devices: - PCI: BCM4331 -+define KernelPackage/rt2500-pci ++define KernelPackage/rt2x00-usb +$(call KernelPackage/rt2x00/Default) -+ DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci -+ TITLE+= (RT2500 PCI) -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2500pci.ko -+ AUTOLOAD:=$(call AutoProbe,rt2500pci) -+endef -+ -+define KernelPackage/rt2500-usb -+$(call KernelPackage/rt2x00/Default) -+ DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb -+ TITLE+= (RT2500 USB) -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2500usb.ko -+ AUTOLOAD:=$(call AutoProbe,rt2500usb) -+endef -+ -+define KernelPackage/rt2800-mmio -+$(call KernelPackage/rt2x00/Default) -+ TITLE += (RT28xx/RT3xxx MMIO) -+ DEPENDS += +kmod-rt2800-lib +kmod-rt2x00-mmio ++ DEPENDS+= @USB_SUPPORT +kmod-rt2x00-lib +kmod-usb-core + HIDDEN:=1 -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800mmio.ko ++ TITLE+= (USB) ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ralink/rt2x00/rt2x00usb.ko ++ AUTOLOAD:=$(call AutoProbe,rt2x00usb) +endef - Currently only 11g speed is available. -+define KernelPackage/rt2800-soc ++define KernelPackage/rt2800-lib +$(call KernelPackage/rt2x00/Default) -+ DEPENDS += @(TARGET_ramips_rt288x||TARGET_ramips_rt305x||TARGET_ramips_rt3883||TARGET_ramips_mt7620) +kmod-rt2800-mmio +kmod-rt2800-lib -+ TITLE += (RT28xx/RT3xxx SoC) -+ FILES := \ -+ $(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00soc.ko \ -+ $(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800soc.ko -+ AUTOLOAD:=$(call AutoProbe,rt2800soc) ++ DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT||TARGET_ramips) +kmod-rt2x00-lib +kmod-lib-crc-ccitt +@DRIVER_11N_SUPPORT ++ HIDDEN:=1 ++ TITLE+= (rt2800 LIB) ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ralink/rt2x00/rt2800lib.ko +endef - If unsure, say Y. -+define KernelPackage/rt2800-pci ++define KernelPackage/rt2400-pci +$(call KernelPackage/rt2x00/Default) -+ DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci +kmod-rt2800-lib +kmod-rt2800-mmio -+ TITLE+= (RT2860 PCI) -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800pci.ko -+ AUTOLOAD:=$(call AutoProbe,rt2800pci) ++ DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci ++ TITLE+= (RT2400 PCI) ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ralink/rt2x00/rt2400pci.ko ++ AUTOLOAD:=$(call AutoProbe,rt2400pci) +endef - config PACKAGE_B43_PHY_LCN @@ -2232,39 +3250,46 @@ index a1eedce..566e156 100644 - default n - help - Currently broken. -+define KernelPackage/rt2800-usb ++define KernelPackage/rt2500-pci +$(call KernelPackage/rt2x00/Default) -+ DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb +kmod-rt2800-lib +kmod-lib-crc-ccitt -+ TITLE+= (RT2870 USB) -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800usb.ko -+ AUTOLOAD:=$(call AutoProbe,rt2800usb) ++ DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci ++ TITLE+= (RT2500 PCI) ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ralink/rt2x00/rt2500pci.ko ++ AUTOLOAD:=$(call AutoProbe,rt2500pci) +endef - If unsure, say N. ++define KernelPackage/rt2500-usb ++$(call KernelPackage/rt2x00/Default) ++ DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb ++ TITLE+= (RT2500 USB) ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ralink/rt2x00/rt2500usb.ko ++ AUTOLOAD:=$(call AutoProbe,rt2500usb) ++endef - endif -+define KernelPackage/rt61-pci ++define KernelPackage/rt2800-mmio +$(call KernelPackage/rt2x00/Default) -+ DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci -+ TITLE+= (RT2x61 PCI) -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt61pci.ko -+ AUTOLOAD:=$(call AutoProbe,rt61pci) ++ TITLE += (RT28xx/RT3xxx MMIO) ++ DEPENDS += +kmod-rt2800-lib +kmod-rt2x00-mmio ++ HIDDEN:=1 ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ralink/rt2x00/rt2800mmio.ko endef -define KernelPackage/b43/description -Kernel module for Broadcom 43xx wireless support (mac80211 stack) new -+define KernelPackage/rt73-usb -+ $(call KernelPackage/rt2x00/Default) -+ DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb -+ TITLE+= (RT73 USB) -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt73usb.ko -+ AUTOLOAD:=$(call AutoProbe,rt73usb) ++define KernelPackage/rt2800-soc ++$(call KernelPackage/rt2x00/Default) ++ DEPENDS += @(TARGET_ramips_rt288x||TARGET_ramips_rt305x||TARGET_ramips_rt3883||TARGET_ramips_mt7620) +kmod-rt2800-mmio +kmod-rt2800-lib ++ TITLE += (RT28xx/RT3xxx SoC) ++ FILES := \ ++ $(PKG_BUILD_DIR)/drivers/net/wireless/ralink/rt2x00/rt2x00soc.ko \ ++ $(PKG_BUILD_DIR)/drivers/net/wireless/ralink/rt2x00/rt2800soc.ko ++ AUTOLOAD:=$(call AutoProbe,rt2800soc) endef -define KernelPackage/b43legacy -+ -+define KernelPackage/rtl818x/Default - $(call KernelPackage/mac80211/Default) +- $(call KernelPackage/mac80211/Default) - TITLE:=Broadcom 43xx-legacy wireless support - URL:=https://wireless.wiki.kernel.org/en/users/drivers/b43 - KCONFIG:= \ @@ -2273,14 +3298,24 @@ index a1eedce..566e156 100644 - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/b43legacy/b43legacy.ko - AUTOLOAD:=$(call AutoProbe,b43legacy) - MENU:=1 -+ TITLE:=Realtek Drivers for RTL818x devices -+ URL:=http://wireless.kernel.org/en/users/Drivers/rtl8187 -+ DEPENDS+= +kmod-eeprom-93cx6 +kmod-mac80211 ++define KernelPackage/rt2800-pci ++$(call KernelPackage/rt2x00/Default) ++ DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci +kmod-rt2800-lib +kmod-rt2800-mmio +rt2800-pci-firmware ++ TITLE+= (RT2860 PCI) ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ralink/rt2x00/rt2800pci.ko ++ AUTOLOAD:=$(call AutoProbe,rt2800pci) endef -define KernelPackage/b43legacy/config - if PACKAGE_kmod-b43legacy -- ++define KernelPackage/rt2800-usb ++$(call KernelPackage/rt2x00/Default) ++ DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb +kmod-rt2800-lib +kmod-lib-crc-ccitt +rt2800-usb-firmware ++ TITLE+= (RT2870 USB) ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ralink/rt2x00/rt2800usb.ko ++ AUTOLOAD:=$(call AutoProbe,rt2800usb) ++endef + - config B43LEGACY_FW_SQUASH - bool "Remove unnecessary firmware files" - default y @@ -2288,80 +3323,72 @@ index a1eedce..566e156 100644 - This options allows you to remove unnecessary b43legacy firmware files - from the final rootfs image. This can reduce the rootfs size by - up to 50k. -+define KernelPackage/rtl8180 -+ $(call KernelPackage/rtl818x/Default) -+ DEPENDS+= @PCI_SUPPORT -+ TITLE+= (RTL8180 PCI) -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtl818x/rtl8180/rtl818x_pci.ko -+ AUTOLOAD:=$(call AutoProbe,rtl818x_pci) -+endef - If unsure, say Y. -+define KernelPackage/rtl8187 -+$(call KernelPackage/rtl818x/Default) -+ DEPENDS+= @USB_SUPPORT +kmod-usb-core -+ TITLE+= (RTL8187 USB) -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtl818x/rtl8187/rtl8187.ko -+ AUTOLOAD:=$(call AutoProbe,rtl8187) ++define KernelPackage/rt61-pci ++$(call KernelPackage/rt2x00/Default) ++ DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci +rt61-pci-firmware ++ TITLE+= (RT2x61 PCI) ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ralink/rt2x00/rt61pci.ko ++ AUTOLOAD:=$(call AutoProbe,rt61pci) +endef - config B43LEGACY_FW_SQUASH_COREREVS - string "Core revisions to include" - depends on B43LEGACY_FW_SQUASH - default "1,2,3,4" -+define KernelPackage/rtlwifi/config -+ config PACKAGE_RTLWIFI_DEBUG -+ bool "Realtek wireless debugging" -+ depends on PACKAGE_kmod-rtlwifi - help +- help - This is a comma seperated list of core revision numbers. -+ Say Y, if you want to debug realtek wireless drivers. ++define KernelPackage/rt73-usb ++ $(call KernelPackage/rt2x00/Default) ++ DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb +rt73-usb-firmware ++ TITLE+= (RT73 USB) ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ralink/rt2x00/rt73usb.ko ++ AUTOLOAD:=$(call AutoProbe,rt73usb) ++endef - Example (keep files for rev4 only): - 4 -+endef - Example (keep files for rev2 and rev4): - 2,4 -+define KernelPackage/rtlwifi ++define KernelPackage/rtl818x/Default + $(call KernelPackage/mac80211/Default) -+ TITLE:=Realtek common driver part -+ DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT) +kmod-mac80211 +@DRIVER_11N_SUPPORT -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtlwifi.ko -+ HIDDEN:=1 ++ TITLE:=Realtek Drivers for RTL818x devices ++ URL:=http://wireless.kernel.org/en/users/Drivers/rtl8187 ++ DEPENDS+= +kmod-eeprom-93cx6 +kmod-mac80211 +endef - endif -+define KernelPackage/rtlwifi-pci -+ $(call KernelPackage/mac80211/Default) -+ TITLE:=Realtek common driver part (PCI support) -+ DEPENDS+= @PCI_SUPPORT +kmod-rtlwifi -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl_pci.ko -+ AUTOLOAD:=$(call AutoProbe,rtl_pci) -+ HIDDEN:=1 ++define KernelPackage/rtl8180 ++ $(call KernelPackage/rtl818x/Default) ++ DEPENDS+= @PCI_SUPPORT ++ TITLE+= (RTL8180 PCI) ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtl818x/rtl8180/rtl818x_pci.ko ++ AUTOLOAD:=$(call AutoProbe,rtl818x_pci) endef -define KernelPackage/b43legacy/description -Kernel module for Broadcom 43xx-legacy wireless support (mac80211 stack) new -+define KernelPackage/rtlwifi-usb -+ $(call KernelPackage/mac80211/Default) -+ TITLE:=Realtek common driver part (USB support) -+ DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-rtlwifi -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl_usb.ko -+ AUTOLOAD:=$(call AutoProbe,rtl_usb) -+ HIDDEN:=1 ++define KernelPackage/rtl8187 ++$(call KernelPackage/rtl818x/Default) ++ DEPENDS+= @USB_SUPPORT +kmod-usb-core ++ TITLE+= (RTL8187 USB) ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtl818x/rtl8187/rtl8187.ko ++ AUTOLOAD:=$(call AutoProbe,rtl8187) endef -+define KernelPackage/rtl8192c-common -+ $(call KernelPackage/mac80211/Default) -+ TITLE:=Realtek RTL8192CE/RTL8192CU common support module -+ DEPENDS+= +kmod-rtlwifi -+ FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl8192c/rtl8192c-common.ko -+ HIDDEN:=1 ++define KernelPackage/rtlwifi/config ++ config PACKAGE_RTLWIFI_DEBUG ++ bool "Realtek wireless debugging" ++ depends on PACKAGE_kmod-rtlwifi ++ help ++ Say Y, if you want to debug realtek wireless drivers. ++ +endef -define KernelPackage/brcmutil -+define KernelPackage/rtl8192ce ++define KernelPackage/rtlwifi $(call KernelPackage/mac80211/Default) - TITLE:=Broadcom IEEE802.11n common driver parts - URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211 @@ -2369,47 +3396,53 @@ index a1eedce..566e156 100644 - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/brcm80211/brcmutil/brcmutil.ko - AUTOLOAD:=$(call AutoProbe,brcmutil) - MENU:=1 -+ TITLE:=Realtek RTL8192CE/RTL8188CE support -+ DEPENDS+= +kmod-rtlwifi-pci +kmod-rtl8192c-common -+ FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl8192ce/rtl8192ce.ko -+ AUTOLOAD:=$(call AutoProbe,rtl8192ce) ++ TITLE:=Realtek common driver part ++ DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT) +kmod-mac80211 +@DRIVER_11N_SUPPORT ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtlwifi/rtlwifi.ko ++ HIDDEN:=1 endef -define KernelPackage/brcmutil/description - This module contains some common parts needed by Broadcom Wireless drivers brcmsmac and brcmfmac. -+define KernelPackage/rtl8192ce/install -+ $(INSTALL_DIR) $(1)/lib/firmware/rtlwifi -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cfw.bin $(1)/lib/firmware/rtlwifi -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cfwU.bin $(1)/lib/firmware/rtlwifi -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cfwU_B.bin $(1)/lib/firmware/rtlwifi ++define KernelPackage/rtlwifi-pci ++ $(call KernelPackage/mac80211/Default) ++ TITLE:=Realtek common driver part (PCI support) ++ DEPENDS+= @PCI_SUPPORT +kmod-rtlwifi ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtlwifi/rtl_pci.ko ++ AUTOLOAD:=$(call AutoProbe,rtl_pci) ++ HIDDEN:=1 endef -define KernelPackage/brcmutil/config - if PACKAGE_kmod-brcmutil -+define KernelPackage/rtl8192se ++define KernelPackage/rtlwifi-usb + $(call KernelPackage/mac80211/Default) -+ TITLE:=Realtek RTL8192SE/RTL8191SE support -+ DEPENDS+= +kmod-rtlwifi-pci -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl8192se/rtl8192se.ko -+ AUTOLOAD:=$(call AutoProbe,rtl8192se) ++ TITLE:=Realtek common driver part (USB support) ++ DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-rtlwifi ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtlwifi/rtl_usb.ko ++ AUTOLOAD:=$(call AutoProbe,rtl_usb) ++ HIDDEN:=1 +endef - config PACKAGE_BRCM80211_DEBUG - bool "Broadcom wireless driver debugging" - help - Say Y, if you want to debug brcmsmac and brcmfmac wireless driver. -+define KernelPackage/rtl8192se/install -+ $(INSTALL_DIR) $(1)/lib/firmware/rtlwifi -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192sefw.bin $(1)/lib/firmware/rtlwifi ++define KernelPackage/rtl8192c-common ++ $(call KernelPackage/mac80211/Default) ++ TITLE:=Realtek RTL8192CE/RTL8192CU common support module ++ DEPENDS+= +kmod-rtlwifi ++ FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtlwifi/rtl8192c/rtl8192c-common.ko ++ HIDDEN:=1 +endef - endif -+define KernelPackage/rtl8192de ++define KernelPackage/rtl8192ce + $(call KernelPackage/mac80211/Default) -+ TITLE:=Realtek RTL8192DE/RTL8188DE support -+ DEPENDS+= +kmod-rtlwifi-pci -+ FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl8192de/rtl8192de.ko -+ AUTOLOAD:=$(call AutoProbe,rtl8192de) ++ TITLE:=Realtek RTL8192CE/RTL8188CE support ++ DEPENDS+= +kmod-rtlwifi-pci +kmod-rtl8192c-common +rtl8192ce-firmware ++ FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/rtl8192ce.ko ++ AUTOLOAD:=$(call AutoProbe,rtl8192ce) endef -PKG_BRCMSMAC_FW_NAME:=broadcom-wl @@ -2418,35 +3451,29 @@ index a1eedce..566e156 100644 -PKG_BRCMSMAC_FW_SOURCE:=$(PKG_BRCMSMAC_FW_NAME)-$(PKG_BRCMSMAC_FW_VERSION).tar.bz2 -PKG_BRCMSMAC_FW_SOURCE_URL:=http://www.lwfinger.com/b43-firmware/ -PKG_BRCMSMAC_FW_MD5SUM:=f4e357b09eaf5d8b1f1920cf3493a555 -+define KernelPackage/rtl8192de/install -+ $(INSTALL_DIR) $(1)/lib/firmware/rtlwifi -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192defw.bin $(1)/lib/firmware/rtlwifi ++define KernelPackage/rtl8192se ++ $(call KernelPackage/mac80211/Default) ++ TITLE:=Realtek RTL8192SE/RTL8191SE support ++ DEPENDS+= +kmod-rtlwifi-pci +rtl8192se-firmware ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtlwifi/rtl8192se/rtl8192se.ko ++ AUTOLOAD:=$(call AutoProbe,rtl8192se) +endef -define Download/brcmsmac - FILE:=$(PKG_BRCMSMAC_FW_SOURCE) - URL:=$(PKG_BRCMSMAC_FW_SOURCE_URL) - MD5SUM:=$(PKG_BRCMSMAC_FW_MD5SUM) -+define KernelPackage/rtl8192cu ++define KernelPackage/rtl8192de + $(call KernelPackage/mac80211/Default) -+ TITLE:=Realtek RTL8192CU/RTL8188CU support -+ DEPENDS+= +kmod-rtlwifi-usb +kmod-rtl8192c-common -+ FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl8192cu/rtl8192cu.ko -+ AUTOLOAD:=$(call AutoProbe,rtl8192cu) ++ TITLE:=Realtek RTL8192DE/RTL8188DE support ++ DEPENDS+= +kmod-rtlwifi-pci +rtl8192de-firmware ++ FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtlwifi/rtl8192de/rtl8192de.ko ++ AUTOLOAD:=$(call AutoProbe,rtl8192de) endef -$(eval $(call Download,brcmsmac)) -define KernelPackage/brcmsmac -+define KernelPackage/rtl8192cu/install -+ $(INSTALL_DIR) $(1)/lib/firmware/rtlwifi -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cufw.bin $(1)/lib/firmware/rtlwifi -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cufw_A.bin $(1)/lib/firmware/rtlwifi -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cufw_B.bin $(1)/lib/firmware/rtlwifi -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cufw_TMSC.bin $(1)/lib/firmware/rtlwifi -+endef -+ -+ -+define KernelPackage/wlcore ++define KernelPackage/rtl8192cu $(call KernelPackage/mac80211/Default) - TITLE:=Broadcom IEEE802.11n PCIe SoftMAC WLAN driver - URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211 @@ -2454,30 +3481,30 @@ index a1eedce..566e156 100644 - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/brcm80211/brcmsmac/brcmsmac.ko - AUTOLOAD:=$(call AutoProbe,brcmsmac) - MENU:=1 -+ TITLE:=TI common driver part -+ DEPENDS+= @TARGET_omap +kmod-mac80211 +@DRIVER_11N_SUPPORT -+ FILES:= \ -+ $(PKG_BUILD_DIR)/drivers/net/wireless/ti/wlcore/wlcore.ko \ -+ $(PKG_BUILD_DIR)/drivers/net/wireless/ti/wlcore/wlcore_sdio.ko -+ AUTOLOAD:=$(call AutoProbe,wlcore wlcore_sdio) ++ TITLE:=Realtek RTL8192CU/RTL8188CU support ++ DEPENDS+= +kmod-rtlwifi-usb +kmod-rtl8192c-common +rtl8192cu-firmware ++ FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/rtl8192cu.ko ++ AUTOLOAD:=$(call AutoProbe,rtl8192cu) endef -define KernelPackage/brcmsmac/description - Kernel module for Broadcom IEEE802.11n PCIe Wireless cards -+define KernelPackage/wlcore/description -+ This module contains some common parts needed by TI Wireless drivers. ++ ++define KernelPackage/rtl8xxxu ++ $(call KernelPackage/mac80211/Default) ++ TITLE:=alternative Realtek RTL8XXXU support ++ DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-mac80211 ++ FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.ko ++ AUTOLOAD:=$(call AutoProbe,rtl8xxxu) endef -define KernelPackage/brcmsmac/config - if PACKAGE_kmod-brcmsmac -+define KernelPackage/wl12xx -+ $(call KernelPackage/mac80211/Default) -+ TITLE:=Driver for TI WL12xx -+ URL:=http://wireless.kernel.org/en/users/Drivers/wl12xx -+ DEPENDS+= +kmod-wlcore -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wl12xx/wl12xx.ko -+ AUTOLOAD:=$(call AutoProbe,wl12xx) -+endef ++define KernelPackage/rtl8xxxu/description ++ This is an alternative driver for various Realtek RTL8XXX ++ parts written to utilize the Linux mac80211 stack. ++ The driver is known to work with a number of RTL8723AU, ++ RL8188CU, RTL8188RU, RTL8191CU, and RTL8192CU devices - config BRCMSMAC_USE_FW_FROM_WL - bool "Use firmware extracted from broadcom proprietary driver" @@ -2487,55 +3514,60 @@ index a1eedce..566e156 100644 - version 666.2 extracted from the proprietary Broadcom driver - is used. This is needed to get core rev 17 used in bcm4716 - to work. -+define KernelPackage/wl12xx/description -+ Kernel modules for TI WL12xx -+endef ++ This driver is under development and has a limited feature ++ set. In particular it does not yet support 40MHz channels ++ and power management. However it should have a smaller ++ memory footprint than the vendor drivers and benetifs ++ from the in kernel mac80211 stack. ++ ++ It can coexist with drivers from drivers/staging/rtl8723au, ++ drivers/staging/rtl8192u, and drivers/net/wireless/rtlwifi, ++ but you will need to control which module you wish to load. - If unsure, say Y. -+define KernelPackage/wl18xx -+ $(call KernelPackage/mac80211/Default) -+ TITLE:=Driver for TI WL18xx -+ URL:=http://wireless.kernel.org/en/users/Drivers/wl18xx -+ DEPENDS+= +kmod-wlcore -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wl18xx/wl18xx.ko -+ AUTOLOAD:=$(call AutoProbe,wl18xx) -+endef ++ RTL8XXXU_UNTESTED is enabled ++ This option enables detection of Realtek 8723/8188/8191/8192 WiFi ++ USB devices which have not been tested directly by the driver ++ author or reported to be working by third parties. - endif -+define KernelPackage/wl18xx/description -+ Kernel modules for TI WL18xx ++ Please report your results! endef -define KernelPackage/brcmfmac -- $(call KernelPackage/mac80211/Default) ++define KernelPackage/wlcore + $(call KernelPackage/mac80211/Default) - TITLE:=Broadcom IEEE802.11n USB FullMAC WLAN driver - URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211 - DEPENDS+= @USB_SUPPORT +kmod-cfg80211 +@DRIVER_11N_SUPPORT +kmod-brcmutil +BRCMFMAC_SDIO:kmod-mmc +BRCMFMAC_USB:kmod-usb-core - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/brcm80211/brcmfmac/brcmfmac.ko - AUTOLOAD:=$(call AutoProbe,brcmfmac) -+ZD1211FW_NAME:=zd1211-firmware -+ZD1211FW_VERSION:=1.4 -+define Download/zd1211rw -+ FILE:=$(ZD1211FW_NAME)-$(ZD1211FW_VERSION).tar.bz2 -+ URL:=@SF/zd1211/ -+ MD5SUM:=19f28781d76569af8551c9d11294c870 ++ TITLE:=TI common driver part ++ DEPENDS+= @TARGET_omap +kmod-mac80211 +@DRIVER_11N_SUPPORT ++ FILES:= \ ++ $(PKG_BUILD_DIR)/drivers/net/wireless/ti/wlcore/wlcore.ko \ ++ $(PKG_BUILD_DIR)/drivers/net/wireless/ti/wlcore/wlcore_sdio.ko ++ AUTOLOAD:=$(call AutoProbe,wlcore wlcore_sdio) endef -+$(eval $(call Download,zd1211rw)) -define KernelPackage/brcmfmac/description - Kernel module for Broadcom IEEE802.11n USB Wireless cards -+define KernelPackage/zd1211rw -+ $(call KernelPackage/mac80211/Default) -+ TITLE:=Zydas ZD1211 support -+ DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-mac80211 -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/zd1211rw/zd1211rw.ko -+ AUTOLOAD:=$(call AutoProbe,zd1211rw) ++define KernelPackage/wlcore/description ++ This module contains some common parts needed by TI Wireless drivers. endef -define KernelPackage/brcmfmac/config - if PACKAGE_kmod-brcmfmac -- ++define KernelPackage/wl12xx ++ $(call KernelPackage/mac80211/Default) ++ TITLE:=Driver for TI WL12xx ++ URL:=http://wireless.kernel.org/en/users/Drivers/wl12xx ++ DEPENDS+= +kmod-wlcore +wl12xx-firmware ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wl12xx/wl12xx.ko ++ AUTOLOAD:=$(call AutoProbe,wl12xx) ++endef + - config BRCMFMAC_SDIO - bool "Enable SDIO bus interface support" - default n @@ -2544,7 +3576,10 @@ index a1eedce..566e156 100644 - Select this option only if you are sure that your - board has a Broadcom wireless chip atacched to - that bus. -- ++define KernelPackage/wl12xx/description ++ Kernel modules for TI WL12xx ++endef + - config BRCMFMAC_USB - bool "Enable USB bus interface support" - depends on USB_SUPPORT @@ -2553,7 +3588,15 @@ index a1eedce..566e156 100644 - Supported USB connected chipsets: - BCM43235, BCM43236, BCM43238 (all in revision 3 only) - BCM43143, BCM43242, BCM43566, BCM43569 -- ++define KernelPackage/wl18xx ++ $(call KernelPackage/mac80211/Default) ++ TITLE:=Driver for TI WL18xx ++ URL:=http://wireless.kernel.org/en/users/Drivers/wl18xx ++ DEPENDS+= +kmod-wlcore +wl18xx-firmware ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wl18xx/wl18xx.ko ++ AUTOLOAD:=$(call AutoProbe,wl18xx) ++endef + - config BRCMFMAC_PCIE - bool "Enable PCIE bus interface support" - depends on PCI_SUPPORT @@ -2561,13 +3604,73 @@ index a1eedce..566e156 100644 - help - Supported PCIe connected chipsets: - BCM4354, BCM4356, BCM43567, BCM43570, BCM43602 ++define KernelPackage/wl18xx/description ++ Kernel modules for TI WL18xx ++endef - endif --endef ++ ++ZD1211FW_NAME:=zd1211-firmware ++ZD1211FW_VERSION:=1.4 ++define Download/zd1211rw ++ FILE:=$(ZD1211FW_NAME)-$(ZD1211FW_VERSION).tar.bz2 ++ URL:=@SF/zd1211/ ++ MD5SUM:=19f28781d76569af8551c9d11294c870 ++endef ++$(eval $(call Download,zd1211rw)) ++ ++define KernelPackage/zd1211rw ++ $(call KernelPackage/mac80211/Default) ++ TITLE:=Zydas ZD1211 support ++ DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-mac80211 ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/zydas/zd1211rw/zd1211rw.ko ++ AUTOLOAD:=$(call AutoProbe,zd1211rw) + endef ++ ++ config_package=$(if $(CONFIG_PACKAGE_kmod-$(1)),m) -@@ -1602,6 +1684,8 @@ config-$(CONFIG_BRCMFMAC_PCIE) += BRCMFMAC_PCIE + config-y:= \ +@@ -1538,6 +1435,20 @@ config-y:= \ + MAC80211_RC_MINSTREL_HT \ + MAC80211_RC_MINSTREL_VHT \ + MAC80211_RC_DEFAULT_MINSTREL \ ++ WLAN_VENDOR_ADMTEK \ ++ WLAN_VENDOR_ATH \ ++ WLAN_VENDOR_ATMEL \ ++ WLAN_VENDOR_BROADCOM \ ++ WLAN_VENDOR_INTEL \ ++ WLAN_VENDOR_INTERSIL \ ++ WLAN_VENDOR_MARVELL \ ++ WLAN_VENDOR_MEDIATEK \ ++ WLAN_VENDOR_RALINK \ ++ WLAN_VENDOR_REALTEK \ ++ WLAN_VENDOR_RSI \ ++ WLAN_VENDOR_ST \ ++ WLAN_VENDOR_TI \ ++ WLAN_VENDOR_ZYDAS \ + + config-$(call config_package,cfg80211) += CFG80211 + +@@ -1554,6 +1465,16 @@ ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS + ATH5K_DEBUG + endif + ++ifdef CONFIG_PACKAGE_MAC80211_TRACING ++ config-y += \ ++ ATH10K_TRACING \ ++ ATH6KL_TRACING \ ++ ATH_TRACEPOINTS \ ++ WIL6210_TRACING \ ++ ATH5K_TRACER \ ++ IWLWIFI_DEVICE_TRACING ++endif ++ + config-$(call config_package,lib80211) += LIB80211 LIB80211_CRYPT_WEP LIB80211_CRYPT_CCMP LIB80211_CRYPT_TKIP + + config-$(call config_package,ath) += ATH_CARDS ATH_COMMON +@@ -1602,6 +1523,8 @@ config-$(CONFIG_BRCMFMAC_PCIE) += BRCMFMAC_PCIE config-$(CONFIG_PACKAGE_BRCM80211_DEBUG) += BRCMDBG config-$(call config_package,mac80211-hwsim) += MAC80211_HWSIM @@ -2576,7 +3679,7 @@ index a1eedce..566e156 100644 config-$(call config_package,rt2x00-lib) += RT2X00 RT2X00_LIB config-$(call config_package,rt2x00-pci) += RT2X00_LIB_PCI -@@ -1623,26 +1707,28 @@ config-$(call config_package,rt2800-pci) += RT2800PCI +@@ -1623,26 +1546,28 @@ config-$(call config_package,rt2800-pci) += RT2800PCI config-y += RT2800PCI_RT33XX RT2800PCI_RT35XX RT2800PCI_RT53XX RT2800PCI_RT3290 config-$(call config_package,rt2800-usb) += RT2800USB @@ -2614,35 +3717,46 @@ index a1eedce..566e156 100644 config-y += HERMES_PRISM config-$(call config_package,adm8211) += ADM8211 -@@ -1702,8 +1788,9 @@ define Build/Prepare +@@ -1668,12 +1593,15 @@ config-$(call config_package,rtl8192de) += RTL8192DE + config-$(call config_package,rtl8192cu) += RTL8192CU + config-$(CONFIG_PACKAGE_RTLWIFI_DEBUG) += RTLWIFI_DEBUG + ++config-$(call config_package,rtl8xxxu) += RTL8XXXU ++config-y += RTL8XXXU_UNTESTED ++ + config-$(CONFIG_LEDS_TRIGGERS) += MAC80211_LEDS B43_LEDS B43LEGACY_LEDS + + MAKE_OPTS:= -C "$(PKG_BUILD_DIR)" \ + CROSS_COMPILE="$(KERNEL_CROSS)" \ + ARCH="$(LINUX_KARCH)" \ +- EXTRA_CFLAGS="-I$(PKG_BUILD_DIR)/include" \ ++ EXTRA_CFLAGS="-I$(PKG_BUILD_DIR)/include $(IREMAP_CFLAGS)" \ + KLIB_BUILD="$(LINUX_DIR)" \ + MODPROBE=true \ + KLIB=$(TARGET_MODULES_DIR) \ +@@ -1702,8 +1630,6 @@ define Build/Prepare $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(IPW2100_NAME)-$(IPW2100_VERSION).tgz $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(IPW2200_NAME)-$(IPW2200_VERSION).tgz $(TAR) -C $(PKG_BUILD_DIR) -xjf $(DL_DIR)/$(ZD1211FW_NAME)-$(ZD1211FW_VERSION).tar.bz2 - $(TAR) -C $(PKG_BUILD_DIR) -xjf $(DL_DIR)/$(PKG_LINUX_FIRMWARE_SOURCE) -+ $(TAR) -C $(PKG_BUILD_DIR) -xJf $(DL_DIR)/$(PKG_LINUX_FIRMWARE_SOURCE) - $(TAR) -C $(PKG_BUILD_DIR) -xjf $(DL_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SOURCE) -+ $(TAR) -C $(PKG_BUILD_DIR) -xjf $(DL_DIR)/$(PKG_MT7601U_FW_SOURCE) +- $(TAR) -C $(PKG_BUILD_DIR) -xjf $(DL_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SOURCE) rm -rf \ $(PKG_BUILD_DIR)/include/linux/ssb \ $(PKG_BUILD_DIR)/include/linux/bcma \ -@@ -1739,233 +1826,37 @@ define Build/Compile - $(MAKE) $(MAKE_OPTS) allnoconfig - $(call Build/Compile/kmod) +@@ -1715,7 +1641,8 @@ define Build/Prepare + $(PKG_BUILD_DIR)/include/linux/eeprom_93cx6.h \ + $(PKG_BUILD_DIR)/include/linux/wl12xx.h \ + $(PKG_BUILD_DIR)/include/linux/spi/libertas_spi.h \ +- $(PKG_BUILD_DIR)/include/net/ieee80211.h ++ $(PKG_BUILD_DIR)/include/net/ieee80211.h \ ++ $(PKG_BUILD_DIR)/backport-include/linux/bcm47xx_nvram.h + + echo 'compat-wireless-$(PKG_VERSION)-$(PKG_RELEASE)-$(REVISION)' > $(PKG_BUILD_DIR)/compat_version + $(CP) ./files/regdb.txt $(PKG_BUILD_DIR)/net/wireless/db.txt +@@ -1753,220 +1680,6 @@ define Build/InstallDev + rm -f $(1)/usr/include/mac80211-backport/linux/module.h endef -- --define Build/InstallDev -- mkdir -p \ -- $(1)/usr/include/mac80211 \ -- $(1)/usr/include/mac80211-backport \ -- $(1)/usr/include/mac80211/ath \ -- $(1)/usr/include/net/mac80211 -- $(CP) $(PKG_BUILD_DIR)/net/mac80211/*.h $(PKG_BUILD_DIR)/include/* $(1)/usr/include/mac80211/ -- $(CP) $(PKG_BUILD_DIR)/backport-include/* $(1)/usr/include/mac80211-backport/ -- $(CP) $(PKG_BUILD_DIR)/net/mac80211/rate.h $(1)/usr/include/net/mac80211/ -- $(CP) $(PKG_BUILD_DIR)/drivers/net/wireless/ath/*.h $(1)/usr/include/mac80211/ath/ -- rm -f $(1)/usr/include/mac80211-backport/linux/module.h --endef -- + -define KernelPackage/libertas-usb/install - $(INSTALL_DIR) $(1)/lib/firmware/libertas - $(INSTALL_DATA) \ @@ -2846,54 +3960,60 @@ index a1eedce..566e156 100644 -ifneq ($(CONFIG_IWL3160_FW),) - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-3160-9.ucode $(1)/lib/firmware -endif -+ -+define Build/InstallDev -+ mkdir -p \ -+ $(1)/usr/include/mac80211 \ -+ $(1)/usr/include/mac80211-backport \ -+ $(1)/usr/include/mac80211/ath \ -+ $(1)/usr/include/net/mac80211 -+ $(CP) $(PKG_BUILD_DIR)/net/mac80211/*.h $(PKG_BUILD_DIR)/include/* $(1)/usr/include/mac80211/ -+ $(CP) $(PKG_BUILD_DIR)/backport-include/* $(1)/usr/include/mac80211-backport/ -+ $(CP) $(PKG_BUILD_DIR)/net/mac80211/rate.h $(1)/usr/include/net/mac80211/ -+ $(CP) $(PKG_BUILD_DIR)/drivers/net/wireless/ath/*.h $(1)/usr/include/mac80211/ath/ -+ rm -f $(1)/usr/include/mac80211-backport/linux/module.h - endef - +-endef +- -define KernelPackage/iwl3945/install -+ -+define KernelPackage/ath9k-htc/install - $(INSTALL_DIR) $(1)/lib/firmware +- $(INSTALL_DIR) $(1)/lib/firmware - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-3945-2.ucode $(1)/lib/firmware -+ $(INSTALL_DATA) \ -+ $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/htc_9271.fw \ -+ $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/htc_7010.fw \ -+ $(1)/lib/firmware/ - endef - +-endef +- -define KernelPackage/iwl4965/install - $(INSTALL_DIR) $(1)/lib/firmware - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-4965-2.ucode $(1)/lib/firmware -+define KernelPackage/ath10k/install -+ $(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA988X/hw2.0 -+ $(INSTALL_DATA) \ -+ $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/ath10k/QCA988X/hw2.0/board.bin \ -+ $(1)/lib/firmware/ath10k/QCA988X/hw2.0/ -+ $(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 - endef +-endef define KernelPackage/b43/install -@@ -2028,13 +1919,237 @@ ifneq ($(CONFIG_BRCMFMAC_PCIE),) + rm -rf $(1)/lib/firmware/ +@@ -1990,51 +1703,84 @@ ifneq ($(CONFIG_B43_FW_SQUASH),) endif endef -+define KernelPackage/carl9170/install -+ $(INSTALL_DIR) $(1)/lib/firmware -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/carl9170-1.fw $(1)/lib/firmware -+endef -+ +-define KernelPackage/b43legacy/install +- $(INSTALL_DIR) $(1)/lib/firmware/ +- b43-fwcutter --unsupported -w $(1)/lib/firmware/ $(DL_DIR)/$(PKG_B43_FWV3_SOURCE) +-ifneq ($(CONFIG_B43LEGACY_FW_SQUASH),) +- b43-fwsquash.py "G" "$(CONFIG_B43LEGACY_FW_SQUASH_COREREVS)" "$(1)/lib/firmware/b43legacy" +-endif +-endef +- + define KernelPackage/brcmsmac/install + $(INSTALL_DIR) $(1)/lib/firmware/brcm + ifeq ($(CONFIG_BRCMSMAC_USE_FW_FROM_WL),y) + tar xjf "$(DL_DIR)/$(PKG_BRCMSMAC_FW_SOURCE)" -C "$(PKG_BUILD_DIR)" + b43-fwcutter --brcmsmac -w $(1)/lib/firmware/ $(PKG_BUILD_DIR)/$(PKG_BRCMSMAC_FW_OBJECT) +-else +- $(INSTALL_DATA) \ +- $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/bcm43xx-0.fw \ +- $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/bcm43xx_hdr-0.fw \ +- $(1)/lib/firmware/brcm/ + endif + endef + +-define KernelPackage/brcmfmac/install +- $(INSTALL_DIR) $(1)/lib/firmware/brcm +-ifneq ($(CONFIG_BRCMFMAC_USB),) +- $(INSTALL_DATA) \ +- $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac43236b.bin \ +- $(1)/lib/firmware/brcm/ +- $(INSTALL_DATA) \ +- $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac43143.bin \ +- $(1)/lib/firmware/brcm/ +-endif +-ifneq ($(CONFIG_BRCMFMAC_PCIE),) +- $(INSTALL_DATA) \ +- $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac43602-pcie.ap.bin \ +- $(1)/lib/firmware/brcm/brcmfmac43602-pcie.bin +-endif +define KernelPackage/cfg80211/install + $(INSTALL_DIR) $(1)/lib/wifi $(1)/lib/netifd/wireless + $(INSTALL_DATA) ./files/lib/wifi/mac80211.sh $(1)/lib/wifi @@ -2910,114 +4030,6 @@ index a1eedce..566e156 100644 + $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(IPW2200_NAME)-$(IPW2200_VERSION)/ipw2200*.fw $(1)/lib/firmware +endef + -+define KernelPackage/iwlwifi/install -+ $(INSTALL_DIR) $(1)/lib/firmware -+ifneq ($(CONFIG_IWL100_FW),) -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-100-5.ucode $(1)/lib/firmware -+endif -+ifneq ($(CONFIG_IWL1000_FW),) -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-1000-5.ucode $(1)/lib/firmware -+endif -+ifneq ($(CONFIG_IWL105_FW),) -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-105-6.ucode $(1)/lib/firmware -+endif -+ifneq ($(CONFIG_IWL135_FW),) -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-135-6.ucode $(1)/lib/firmware -+endif -+ifneq ($(CONFIG_IWL2000_FW),) -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-2000-6.ucode $(1)/lib/firmware -+endif -+ifneq ($(CONFIG_IWL2030_FW),) -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-2030-6.ucode $(1)/lib/firmware -+endif -+ifneq ($(CONFIG_IWL3160_FW),) -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-3160-13.ucode $(1)/lib/firmware -+endif -+ifneq ($(CONFIG_IWL5000_FW),) -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-5000-5.ucode $(1)/lib/firmware -+endif -+ifneq ($(CONFIG_IWL5150_FW),) -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-5150-2.ucode $(1)/lib/firmware -+endif -+ifneq ($(CONFIG_IWL6000_FW),) -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-6000-4.ucode $(1)/lib/firmware -+endif -+ifneq ($(CONFIG_IWL6005_FW),) -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-6000g2a-6.ucode $(1)/lib/firmware -+endif -+ifneq ($(CONFIG_IWL6030_FW),) -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-6000g2b-6.ucode $(1)/lib/firmware -+endif -+ifneq ($(CONFIG_IWL6050_FW),) -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-6050-5.ucode $(1)/lib/firmware -+endif -+ifneq ($(CONFIG_IWL7260_FW),) -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-7260-13.ucode $(1)/lib/firmware -+endif -+ifneq ($(CONFIG_IWL7265_FW),) -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-7265-13.ucode $(1)/lib/firmware -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-7265D-13.ucode $(1)/lib/firmware -+endif -+ifneq ($(CONFIG_IWL8000_FW),) -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-8000C-13.ucode $(1)/lib/firmware -+endif -+endef -+ -+define KernelPackage/iwl3945/install -+ $(INSTALL_DIR) $(1)/lib/firmware -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-3945-2.ucode $(1)/lib/firmware -+endef -+ -+define KernelPackage/iwl4965/install -+ $(INSTALL_DIR) $(1)/lib/firmware -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-4965-2.ucode $(1)/lib/firmware -+endef -+ -+define KernelPackage/libertas-usb/install -+ $(INSTALL_DIR) $(1)/lib/firmware/libertas -+ $(INSTALL_DATA) \ -+ $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/usb8388_v9.bin \ -+ $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/usb8682.bin \ -+ $(1)/lib/firmware/libertas/ -+endef -+ -+define KernelPackage/libertas-sdio/install -+ $(INSTALL_DIR) $(1)/lib/firmware/libertas -+ $(INSTALL_DATA) \ -+ $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8385_helper.bin \ -+ $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8385.bin \ -+ $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8686_v9_helper.bin \ -+ $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8686_v9.bin \ -+ $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8688_helper.bin \ -+ $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8688.bin \ -+ $(1)/lib/firmware/libertas -+endef -+ -+define KernelPackage/mt7601u/install -+ $(INSTALL_DIR) $(1)/lib/firmware -+ $(INSTALL_DATA) \ -+ $(PKG_BUILD_DIR)/$(PKG_MT7601U_FW_NAME)_$(PKG_MT7601U_FW_VERSION)/mcu/bin/MT7601.bin \ -+ $(1)/lib/firmware/mt7601u.bin -+endef -+ -+define KernelPackage/mwl8k/install -+ $(INSTALL_DIR) $(1)/lib/firmware/mwl8k -+ $(INSTALL_DATA) \ -+ $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/fmimage_8366_ap-3.fw \ -+ $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/fmimage_8366.fw \ -+ $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/helper_8366.fw \ -+ $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/fmimage_8687.fw \ -+ $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/helper_8687.fw \ -+ $(1)/lib/firmware/mwl8k/ -+endef -+ -+define KernelPackage/mwifiex-pcie/install -+ $(INSTALL_DIR) $(1)/lib/firmware/mrvl -+ $(INSTALL_DATA) \ -+ $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mrvl/pcie8897_uapsta.bin \ -+ $(1)/lib/firmware/mrvl/ -+endef -+ +define KernelPackage/p54-pci/install + $(INSTALL_DIR) $(1)/lib/firmware + $(INSTALL_DATA) $(DL_DIR)/$(P54PCIFW) $(1)/lib/firmware/isl3886pci @@ -3031,56 +4043,8 @@ index a1eedce..566e156 100644 +define KernelPackage/p54-spi/install + $(INSTALL_DIR) $(1)/lib/firmware + $(INSTALL_DATA) $(DL_DIR)/$(P54SPIFW) $(1)/lib/firmware/3826.arm -+endef -+ -+define KernelPackage/rt2800-pci/install -+ $(INSTALL_DIR) $(1)/lib/firmware -+ $(INSTALL_DATA) \ -+ $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2860.bin \ -+ $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt3290.bin \ -+ $(1)/lib/firmware -+endef -+ -+define KernelPackage/rt2800-usb/install -+ $(INSTALL_DIR) $(1)/lib/firmware -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2870.bin $(1)/lib/firmware/ -+endef -+ -+define KernelPackage/rt61-pci/install -+ $(INSTALL_DIR) $(1)/lib/firmware -+ $(INSTALL_DATA) \ -+ $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2561.bin \ -+ $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2561s.bin \ -+ $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2661.bin \ -+ $(1)/lib/firmware/ -+endef -+ -+define KernelPackage/rt73-usb/install -+ $(INSTALL_DIR) $(1)/lib/firmware -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt73.bin $(1)/lib/firmware/ -+endef -+ -+define KernelPackage/wl12xx/install -+ $(INSTALL_DIR) $(1)/lib/firmware/ti-connectivity -+ $(INSTALL_DATA) \ -+ $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl127x-fw-5-mr.bin \ -+ $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl127x-fw-5-plt.bin \ -+ $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl127x-fw-5-sr.bin \ -+ $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl1271-nvs.bin \ -+ $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl128x-fw-5-mr.bin \ -+ $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl128x-fw-5-plt.bin \ -+ $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl128x-fw-5-sr.bin \ -+ $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl128x-nvs.bin \ -+ $(1)/lib/firmware/ti-connectivity -+endef -+ -+define KernelPackage/wl18xx/install -+ $(INSTALL_DIR) $(1)/lib/firmware/ti-connectivity -+ $(INSTALL_DATA) \ -+ $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl18xx-fw-4.bin \ -+ $(1)/lib/firmware/ti-connectivity -+endef -+ + endef + +define KernelPackage/zd1211rw/install + $(INSTALL_DIR) $(1)/lib/firmware/zd1211 + $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(ZD1211FW_NAME)/zd1211* $(1)/lib/firmware/zd1211 @@ -3124,7 +4088,7 @@ index a1eedce..566e156 100644 $(eval $(call KernelPackage,p54-common)) $(eval $(call KernelPackage,p54-pci)) $(eval $(call KernelPackage,p54-usb)) -@@ -2047,12 +2162,12 @@ $(eval $(call KernelPackage,rt2800-lib)) +@@ -2047,12 +1793,12 @@ $(eval $(call KernelPackage,rt2800-lib)) $(eval $(call KernelPackage,rt2400-pci)) $(eval $(call KernelPackage,rt2500-pci)) $(eval $(call KernelPackage,rt2500-usb)) @@ -3139,7 +4103,7 @@ index a1eedce..566e156 100644 $(eval $(call KernelPackage,rtl8180)) $(eval $(call KernelPackage,rtl8187)) $(eval $(call KernelPackage,rtlwifi)) -@@ -2063,32 +2178,7 @@ $(eval $(call KernelPackage,rtl8192ce)) +@@ -2063,32 +1809,8 @@ $(eval $(call KernelPackage,rtl8192ce)) $(eval $(call KernelPackage,rtl8192se)) $(eval $(call KernelPackage,rtl8192de)) $(eval $(call KernelPackage,rtl8192cu)) @@ -3169,15 +4133,70 @@ index a1eedce..566e156 100644 -$(eval $(call KernelPackage,net-hermes-pci)) -$(eval $(call KernelPackage,net-hermes-plx)) -$(eval $(call KernelPackage,net-hermes-pcmcia)) ++$(eval $(call KernelPackage,rtl8xxxu)) $(eval $(call KernelPackage,wlcore)) $(eval $(call KernelPackage,wl12xx)) $(eval $(call KernelPackage,wl18xx)) +$(eval $(call KernelPackage,zd1211rw)) diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh -index 2852f3e..2a8d2f9 100644 +index 2852f3e..02c195e 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh -@@ -486,7 +486,7 @@ mac80211_prepare_vif() { +@@ -23,6 +23,7 @@ drv_mac80211_init_device_config() { + config_add_int rxantenna txantenna antenna_gain txpower distance + config_add_boolean noscan ht_coex + config_add_array ht_capab ++ config_add_array channels + config_add_boolean \ + rxldpc \ + short_gi_80 \ +@@ -89,6 +90,7 @@ mac80211_hostapd_setup_base() { + json_select config + + [ "$auto_channel" -gt 0 ] && channel=acs_survey ++ [ "$auto_channel" -gt 0 ] && json_get_values channel_list channels + + json_get_vars noscan ht_coex + json_get_values ht_capab_list ht_capab +@@ -301,6 +303,7 @@ mac80211_hostapd_setup_base() { + hostapd_prepare_device_config "$hostapd_conf_file" nl80211 + cat >> "$hostapd_conf_file" </dev/null); do ++ case "$(readlink -f /sys/class/ieee80211/$phy/device)" in ++ *$path) return 0;; ++ esac + done + } + [ -n "$macaddr" ] && { +@@ -455,12 +457,7 @@ mac80211_prepare_vif() { + } + ;; + mesh) +- json_get_vars key mesh_id +- if [ -n "$key" ]; then +- iw phy "$phy" interface add "$ifname" type mp +- else +- iw phy "$phy" interface add "$ifname" type mp mesh_id "$mesh_id" +- fi ++ iw phy "$phy" interface add "$ifname" type mp + ;; + monitor) + iw phy "$phy" interface add "$ifname" type monitor +@@ -486,7 +483,7 @@ mac80211_prepare_vif() { # All interfaces must have unique mac addresses # which can either be explicitly set in the device # section, or automatically generated @@ -3186,17 +4205,26 @@ index 2852f3e..2a8d2f9 100644 fi json_select .. -@@ -525,9 +525,6 @@ mac80211_setup_adhoc_htmode() { +@@ -501,7 +498,7 @@ mac80211_setup_supplicant() { + mac80211_setup_adhoc_htmode() { + case "$htmode" in + VHT20|HT20) ibss_htmode=HT20;; +- HT40*|VHT40|VHT80|VHT160) ++ HT40*|VHT40|VHT160) + case "$hwmode" in + a) + case "$(( ($channel / 4) % 2 ))" in +@@ -525,6 +522,9 @@ mac80211_setup_adhoc_htmode() { esac [ "$auto_channel" -gt 0 ] && ibss_htmode="HT40+" ;; -- NONE|NOHT) -- ibss_htmode="NOHT" -- ;; - *) ibss_htmode="" ;; - esac - -@@ -585,7 +582,7 @@ mac80211_setup_vif() { ++ VHT80) ++ ibss_htmode="80MHZ" ++ ;; + NONE|NOHT) + ibss_htmode="NOHT" + ;; +@@ -585,7 +585,7 @@ mac80211_setup_vif() { json_get_vars mode json_get_var vif_txpower txpower @@ -3205,7 +4233,21 @@ index 2852f3e..2a8d2f9 100644 wireless_setup_vif_failed IFUP_ERROR json_select .. return -@@ -641,7 +638,7 @@ mac80211_interface_cleanup() { +@@ -606,6 +606,13 @@ mac80211_setup_vif() { + wireless_vif_parse_encryption + mac80211_setup_supplicant || failed=1 + fi ++ else ++ json_get_vars mesh_id mcast_rate ++ ++ mcval= ++ [ -n "$mcast_rate" ] && wpa_supplicant_add_rate mcval "$mcast_rate" ++ ++ iw dev "$ifname" mesh join "$mesh_id" ${mcval:+mcast-rate $mcval} + fi + + for var in $MP_CONFIG_INT $MP_CONFIG_BOOL $MP_CONFIG_STRING; do +@@ -641,7 +648,7 @@ mac80211_interface_cleanup() { local phy="$1" for wdev in $(list_phy_interfaces "$phy"); do @@ -3214,515 +4256,36 @@ index 2852f3e..2a8d2f9 100644 iw dev "$wdev" del done } -diff --git a/package/kernel/mac80211/files/regdb.txt b/package/kernel/mac80211/files/regdb.txt -index 463ace3..84413fd 100644 ---- a/package/kernel/mac80211/files/regdb.txt -+++ b/package/kernel/mac80211/files/regdb.txt -@@ -2,7 +2,7 @@ - country 00: - (2402 - 2472 @ 40), (20) - # Channel 12 - 13. -- (2457 - 2482 @ 20), (20), NO-IR, AUTO-BW -+ (2457 - 2482 @ 40), (20), NO-IR - # Channel 14. Only JP enables this and for 802.11b only - (2474 - 2494 @ 20), (20), NO-IR, NO-OFDM - # Channel 36 - 48 -@@ -22,7 +22,7 @@ country AD: - (5170 - 5250 @ 80), (20) - (5250 - 5330 @ 80), (20), DFS - (5490 - 5710 @ 80), (27), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) +diff --git a/package/kernel/mac80211/files/lib/wifi/mac80211.sh b/package/kernel/mac80211/files/lib/wifi/mac80211.sh +index ea229d6..06f3b8b 100644 +--- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh ++++ b/package/kernel/mac80211/files/lib/wifi/mac80211.sh +@@ -9,11 +9,10 @@ lookup_phy() { + local devpath + config_get devpath "$device" path + [ -n "$devpath" ] && { +- for _phy in /sys/devices/$devpath/ieee80211/phy*; do +- [ -e "$_phy" ] && { +- phy="${_phy##*/}" +- return +- } ++ for phy in $(ls /sys/class/ieee80211 2>/dev/null); do ++ case "$(readlink -f /sys/class/ieee80211/$phy/device)" in ++ *$devpath) return;; ++ esac + done + } - country AE: DFS-FCC -@@ -82,7 +82,7 @@ country AT: DFS-ETSI - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - country AU: DFS-ETSI -@@ -108,7 +108,7 @@ country BA: DFS-ETSI - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - country BB: DFS-FCC -@@ -126,7 +126,7 @@ country BE: DFS-ETSI - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - country BF: DFS-FCC -@@ -141,13 +141,13 @@ country BG: DFS-ETSI - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS -- # 5 GHz Short Range Devices, ref: -+ # 5 gHz Short Range Devices, ref: - # Etsi EN 300 440-1 - # Etsi EN 300 440-2 - # http://crc.bg/files/_bg/Spisak_2015.pdf - # http://crc.bg/files/_bg/Pravila_2015_resh24.pdf - (5725 - 5875 @ 80), (14) -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - country BH: DFS-JP -@@ -216,8 +216,7 @@ country CA: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW -- (5490 - 5600 @ 80), (24), DFS -- (5650 - 5730 @ 80), (24), DFS -+ (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - - # Source: -@@ -234,7 +233,7 @@ country CH: DFS-ETSI - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - country CI: DFS-FCC -@@ -255,7 +254,7 @@ country CN: DFS-FCC - (5170 - 5250 @ 80), (23), AUTO-BW - (5250 - 5330 @ 80), (23), DFS, AUTO-BW - (5735 - 5835 @ 80), (30) -- # 60 GHz band channels 1,4: 28dBm, channels 2,3: 44dBm -+ # 60 gHz band channels 1,4: 28dBm, channels 2,3: 44dBm - # ref: http://www.miit.gov.cn/n11293472/n11505629/n11506593/n11960250/n11960606/n11960700/n12330791.files/n12330790.pdf - (57240 - 59400 @ 2160), (28) - (59400 - 63720 @ 2160), (44) -@@ -287,7 +286,7 @@ country CY: DFS-ETSI - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - # Data from http://www.ctu.eu/164/download/VOR/VOR-12-08-2005-34.pdf -@@ -299,7 +298,7 @@ country CZ: DFS-ETSI - (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW - (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW - (5470 - 5725 @ 160), (500 mW), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - # Data from "Frequenznutzungsplan" (as published in April 2008), downloaded from -@@ -323,7 +322,7 @@ country DE: DFS-ETSI - (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW - # entries 308002, 309001 and 310003 - (5470 - 5725 @ 160), (500 mW), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - country DK: DFS-ETSI -@@ -331,7 +330,7 @@ country DK: DFS-ETSI - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - # Source: -@@ -366,7 +365,7 @@ country EE: DFS-ETSI - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - country EG: DFS-ETSI -@@ -386,7 +385,7 @@ country ES: DFS-ETSI - (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW - (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW - (5470 - 5725 @ 160), (500 mW), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - country ET: DFS-ETSI -@@ -396,11 +395,11 @@ country ET: DFS-ETSI - (5490 - 5710 @ 160), (27), DFS - - country FI: DFS-ETSI -- (2400 - 2483.5 @ 40), (20) -- (5150 - 5250 @ 80), (23), NO-OUTDOOR, AUTO-BW -- (5250 - 5350 @ 80), (20), NO-OUTDOOR, DFS, AUTO-BW -- (5470 - 5725 @ 160), (27), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ (2402 - 2482 @ 40), (20) -+ (5170 - 5250 @ 80), (20), AUTO-BW -+ (5250 - 5330 @ 80), (20), DFS, AUTO-BW -+ (5490 - 5710 @ 160), (27), DFS -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - country FM: DFS-FCC -@@ -415,7 +414,7 @@ country FR: DFS-ETSI - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - country GB: DFS-ETSI -@@ -423,7 +422,7 @@ country GB: DFS-ETSI - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - country GD: DFS-FCC -@@ -437,7 +436,7 @@ country GE: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (18), AUTO-BW - (5250 - 5330 @ 80), (18), DFS, AUTO-BW -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - country GF: DFS-ETSI -@@ -455,9 +454,9 @@ country GH: DFS-FCC - - country GL: DFS-ETSI - (2402 - 2482 @ 40), (20) -- (5170 - 5250 @ 80), (20), AUTO-BW -- (5250 - 5330 @ 80), (20), DFS, AUTO-BW -- (5490 - 5710 @ 160), (27), DFS -+ (5170 - 5250 @ 80), (20) -+ (5250 - 5330 @ 80), (20), DFS -+ (5490 - 5710 @ 80), (27), DFS - - country GP: DFS-ETSI - (2402 - 2482 @ 40), (20) -@@ -470,7 +469,7 @@ country GR: DFS-ETSI - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - country GT: DFS-FCC -@@ -490,7 +489,7 @@ country GY: - (2402 - 2482 @ 40), (30) - (5735 - 5835 @ 80), (30) - --country HK: DFS-ETSI -+country HK: - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW -@@ -505,11 +504,11 @@ country HN: DFS-FCC - (5735 - 5835 @ 80), (30) - - country HR: DFS-ETSI -- (2400 - 2483.5 @ 40), (20) -- (5150 - 5250 @ 80), (23), NO-OUTDOOR, AUTO-BW -- (5250 - 5350 @ 80), (20), NO-OUTDOOR, DFS, AUTO-BW -- (5470 - 5725 @ 160), (27), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ (2402 - 2482 @ 40), (20) -+ (5170 - 5250 @ 80), (20), AUTO-BW -+ (5250 - 5330 @ 80), (20), DFS, AUTO-BW -+ (5490 - 5710 @ 160), (27), DFS -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - country HT: DFS-FCC -@@ -524,7 +523,7 @@ country HU: DFS-ETSI - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - country ID: DFS-JP -@@ -537,7 +536,7 @@ country IE: DFS-ETSI - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - country IL: DFS-ETSI -@@ -560,7 +559,7 @@ country IS: DFS-ETSI - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - country IT: DFS-ETSI -@@ -568,7 +567,7 @@ country IT: DFS-ETSI - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - country JM: DFS-FCC -@@ -687,7 +686,7 @@ country LT: DFS-ETSI - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - country LU: DFS-ETSI -@@ -695,7 +694,7 @@ country LU: DFS-ETSI - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - country LV: DFS-ETSI -@@ -703,7 +702,7 @@ country LV: DFS-ETSI - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - country MA: DFS-ETSI -@@ -751,7 +750,7 @@ country MK: DFS-ETSI - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - country MN: DFS-FCC -@@ -794,7 +793,7 @@ country MT: DFS-ETSI - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - country MU: DFS-FCC -@@ -827,10 +826,9 @@ country MX: DFS-FCC - - country MY: DFS-FCC - (2402 - 2482 @ 40), (20) -- (5170 - 5250 @ 80), (24), AUTO-BW -- (5250 - 5330 @ 80), (24), DFS, AUTO-BW -- (5490 - 5650 @ 160), (24), DFS -- (5735 - 5835 @ 80), (24) -+ (5170 - 5250 @ 80), (17), AUTO-BW -+ (5250 - 5330 @ 80), (23), DFS, AUTO-BW -+ (5735 - 5835 @ 80), (30) - - country NG: DFS-ETSI - (2402 - 2482 @ 40), (20) -@@ -849,7 +847,7 @@ country NL: DFS-ETSI - (5170 - 5250 @ 80), (20), NO-OUTDOOR, AUTO-BW - (5250 - 5330 @ 80), (20), NO-OUTDOOR, DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - # Data from http://www.lovdata.no/dokument/SF/forskrift/2012-01-19-77 -@@ -864,7 +862,7 @@ country NO: DFS-ETSI - (5470 - 5795 @ 160), (500 mW), DFS - (5815 - 5850 @ 35), (2000 mW), DFS - (17100 - 17300 @ 200), (100 mW) -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - country NP: DFS-JP -@@ -928,7 +926,7 @@ country PL: DFS-ETSI - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - country PM: DFS-ETSI -@@ -949,7 +947,7 @@ country PT: DFS-ETSI - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - country PW: DFS-FCC -@@ -981,7 +979,7 @@ country RO: DFS-ETSI - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - -@@ -991,15 +989,15 @@ country RS: DFS-ETSI - (2400 - 2483.5 @ 40), (100 mW) - (5150 - 5350 @ 40), (200 mW), NO-OUTDOOR - (5470 - 5725 @ 20), (1000 mW), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - country RU: DFS-ETSI - (2402 - 2482 @ 40), (20) -- (5170 - 5250 @ 80), (20), AUTO-BW -- (5250 - 5330 @ 80), (20), DFS, AUTO-BW -- (5650 - 5730 @ 80), (30), DFS -- (5735 - 5835 @ 80), (30) -+ (5170 - 5250 @ 40), (20) -+ (5250 - 5330 @ 40), (20), DFS -+ (5650 - 5730 @ 40), (30), DFS -+ (5735 - 5835 @ 40), (30) - # 60 GHz band channels 1-4, ref: Changes to NLA 124_Order №129_22042015.pdf - (57000 - 66000 @ 2160), (40) - -@@ -1021,7 +1019,7 @@ country SE: DFS-ETSI - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - country SG: DFS-FCC -@@ -1036,7 +1034,7 @@ country SI: DFS-ETSI - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - country SK: DFS-ETSI -@@ -1044,7 +1042,7 @@ country SK: DFS-ETSI - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - # Source: -@@ -1109,7 +1107,7 @@ country TR: DFS-ETSI - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - country TT: DFS-FCC -@@ -1119,20 +1117,12 @@ country TT: DFS-FCC - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - --# Source: --# Table of Frequency Allocations of Republic of China (Taiwan) / Nov 2014: --# http://www.motc.gov.tw/websitedowndoc?file=post/201411171137330.doc& \ --# filedisplay=Table+of+radio+frequency+allocation.doc --# LP0002 Low-power Radio-frequency Devices Technical Regulations / 28 Jun 2011: --# http://www.ncc.gov.tw/english/show_file.aspx?table_name=news&file_sn=681 --# (section 3.10.1, 4.7) --country TW: DFS-FCC -- (2400 - 2483.5 @ 40), (30) -- # Follow US 5.15 ~ 5.25 GHz: 30 dBm for master mode, 23 dBm for clients -- (5150 - 5250 @ 80), (23), AUTO-BW -- (5250 - 5350 @ 80), (23), DFS, AUTO-BW -- (5470 - 5725 @ 160), (23), DFS -- (5725 - 5850 @ 80), (30) -+country TW: DFS-JP -+ (2402 - 2472 @ 40), (30) -+ (5270 - 5330 @ 40), (17), DFS -+ (5490 - 5590 @ 80), (30), DFS -+ (5650 - 5710 @ 40), (30), DFS -+ (5735 - 5835 @ 80), (30) - - country TZ: - (2402 - 2482 @ 40), (20) -@@ -1147,11 +1137,10 @@ country TZ: - # disputable definitions there. - country UA: DFS-ETSI - (2400 - 2483.5 @ 40), (20), NO-OUTDOOR -- (5150 - 5250 @ 80), (20), NO-OUTDOOR, AUTO-BW -- (5250 - 5350 @ 80), (20), DFS, NO-OUTDOOR, AUTO-BW -- (5490 - 5670 @ 160), (20), DFS -+ (5150 - 5350 @ 40), (20), NO-OUTDOOR -+ (5490 - 5670 @ 80), (20), DFS - (5735 - 5835 @ 80), (20) -- # 60 GHz band channels 1-4, ref: Etsi En 302 567 -+ # 60 gHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - country UG: DFS-FCC -@@ -1163,8 +1152,7 @@ country UG: DFS-FCC - - country US: DFS-FCC - (2402 - 2472 @ 40), (30) -- # 5.15 ~ 5.25 GHz: 30 dBm for master mode, 23 dBm for clients -- (5170 - 5250 @ 80), (23), AUTO-BW -+ (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (23), DFS, AUTO-BW - (5490 - 5730 @ 160), (23), DFS - (5735 - 5835 @ 80), (30) -@@ -1175,8 +1163,9 @@ country US: DFS-FCC - - country UY: DFS-FCC - (2402 - 2482 @ 40), (20) -- (5170 - 5250 @ 80), (23), AUTO-BW -- (5250 - 5330 @ 80), (23), DFS, AUTO-BW -+ (5170 - 5250 @ 80), (17), AUTO-BW -+ (5250 - 5330 @ 80), (24), DFS, AUTO-BW -+ (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - - # Source: -@@ -1252,7 +1241,7 @@ country ZA: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW -- (5490 - 5710 @ 160), (30) -+ (5490 - 5710 @ 160), (27), DFS - - country ZW: DFS-ETSI - (2402 - 2482 @ 40), (20) +@@ -102,6 +101,9 @@ detect_mac80211() { + fi + if [ -n "$path" ]; then + path="${path##/sys/devices/}" ++ case "$path" in ++ platform*/pci*) path="${path##platform/}";; ++ esac + dev_id=" option path '$path'" + else + dev_id=" option macaddr $(cat /sys/class/ieee80211/${dev}/macaddress)" diff --git a/package/kernel/mac80211/patches/001-fix_build.patch b/package/kernel/mac80211/patches/001-fix_build.patch index 818983e..402649d 100644 --- a/package/kernel/mac80211/patches/001-fix_build.patch @@ -3766,6 +4329,69 @@ index 818983e..402649d 100644 + print=0 ;\ + for v in $$kvers ; do \ + if [ "$$print" = "1" ] ; then \ +diff --git a/package/kernel/mac80211/patches/002-change_allconfig.patch b/package/kernel/mac80211/patches/002-change_allconfig.patch +index 91ad20f..bd5bebf 100644 +--- a/package/kernel/mac80211/patches/002-change_allconfig.patch ++++ b/package/kernel/mac80211/patches/002-change_allconfig.patch +@@ -1,6 +1,6 @@ + --- a/kconf/conf.c + +++ b/kconf/conf.c +-@@ -578,40 +578,12 @@ int main(int ac, char **av) ++@@ -593,40 +593,12 @@ int main(int ac, char **av) + case oldconfig: + case listnewconfig: + case olddefconfig: +@@ -42,3 +42,23 @@ + break; + default: + break; ++--- a/kconf/confdata.c +++++ b/kconf/confdata.c ++@@ -1169,6 +1169,8 @@ bool conf_set_all_new_symbols(enum conf_ ++ } ++ bool has_changed = false; ++ +++ sym_clear_all_valid(); +++ ++ for_all_symbols(i, sym) { ++ if (sym_has_value(sym) || (sym->flags & SYMBOL_VALID)) ++ continue; ++@@ -1212,8 +1214,6 @@ bool conf_set_all_new_symbols(enum conf_ ++ ++ } ++ ++- sym_clear_all_valid(); ++- ++ /* ++ * We have different type of choice blocks. ++ * If curr.tri equals to mod then we can select several +diff --git a/package/kernel/mac80211/patches/004-backports-add-skb_free_frag.patch b/package/kernel/mac80211/patches/004-backports-add-skb_free_frag.patch +new file mode 100644 +index 0000000..9adfd8f +--- /dev/null ++++ b/package/kernel/mac80211/patches/004-backports-add-skb_free_frag.patch +@@ -0,0 +1,21 @@ ++From: Felix Fietkau ++Date: Thu, 28 Jan 2016 15:16:35 +0100 ++Subject: [PATCH] backports: add skb_free_frag() ++ ++Signed-off-by: Felix Fietkau ++--- ++ ++--- a/backport-include/linux/skbuff.h +++++ b/backport-include/linux/skbuff.h ++@@ -300,4 +300,11 @@ int skb_ensure_writable(struct sk_buff * ++ ++ #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) */ ++ +++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0) +++static inline void skb_free_frag(void *data) +++{ +++ put_page(virt_to_head_page(data)); +++} +++#endif +++ ++ #endif /* __BACKPORT_SKBUFF_H */ diff --git a/package/kernel/mac80211/patches/004-backports_debugfs_fix.patch b/package/kernel/mac80211/patches/004-backports_debugfs_fix.patch deleted file mode 100644 index d48a723..0000000 @@ -3782,6 +4408,32 @@ index d48a723..0000000 - - #if defined(CONFIG_DEBUG_FS) - struct dentry *debugfs_create_devm_seqfile(struct device *dev, const char *name, +diff --git a/package/kernel/mac80211/patches/005-backports-add-napi_alloc_frag.patch b/package/kernel/mac80211/patches/005-backports-add-napi_alloc_frag.patch +new file mode 100644 +index 0000000..9b672a8 +--- /dev/null ++++ b/package/kernel/mac80211/patches/005-backports-add-napi_alloc_frag.patch +@@ -0,0 +1,20 @@ ++From: Felix Fietkau ++Date: Thu, 28 Jan 2016 15:19:22 +0100 ++Subject: [PATCH] backports: add napi_alloc_frag ++ ++Signed-off-by: Felix Fietkau ++--- ++ ++--- a/backport-include/linux/netdevice.h +++++ b/backport-include/linux/netdevice.h ++@@ -232,6 +232,10 @@ static inline void backport_unregister_n ++ #define unregister_netdevice_many LINUX_BACKPORT(unregister_netdevice_many) ++ #endif ++ +++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) +++#define napi_alloc_frag netdev_alloc_frag +++#endif +++ ++ /* ++ * Complicated way of saying: We only backport netdev_rss_key stuff on kernels ++ * that either already have net_get_random_once() (>= 3.13) or where we've been diff --git a/package/kernel/mac80211/patches/008-fix_netdev_unregister.patch b/package/kernel/mac80211/patches/008-fix_netdev_unregister.patch deleted file mode 100644 index e07f323..0000000 @@ -3847,45 +4499,37 @@ index e5310bc..0000000 -+#define MPLS_LS_TTL_SHIFT 0 -+ -+#endif /* _UAPI_MPLS_H */ -diff --git a/package/kernel/mac80211/patches/020-backports-do-not-add-debugfs_create_devm_seqfile-on-.patch b/package/kernel/mac80211/patches/020-backports-do-not-add-debugfs_create_devm_seqfile-on-.patch -new file mode 100644 -index 0000000..97f678c ---- /dev/null -+++ b/package/kernel/mac80211/patches/020-backports-do-not-add-debugfs_create_devm_seqfile-on-.patch -@@ -0,0 +1,33 @@ -+From e15e9231e7a9f81f5264d294fd3fd96a20d92516 Mon Sep 17 00:00:00 2001 -+From: Hauke Mehrtens -+Date: Sat, 25 Jul 2015 15:19:17 +0200 -+Subject: [PATCH 3/3] backports: do not add debugfs_create_devm_seqfile() on -+ recent kernel versions -+ -+An #ifdef for the kernel version was missing around the header of -+debugfs_create_devm_seqfile() and the LINUX_BACKPORT() was also not -+done. -+ -+Signed-off-by: Hauke Mehrtens -+--- -+ backport/backport-include/linux/debugfs.h | 3 +++ -+ 1 file changed, 3 insertions(+) -+ -+--- a/backport-include/linux/debugfs.h -++++ b/backport-include/linux/debugfs.h -+@@ -5,6 +5,8 @@ -+ #include -+ #include -+ -++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) -++#define debugfs_create_devm_seqfile LINUX_BACKPORT(debugfs_create_devm_seqfile) -+ #if defined(CONFIG_DEBUG_FS) -+ struct dentry *debugfs_create_devm_seqfile(struct device *dev, const char *name, -+ struct dentry *parent, -+@@ -20,5 +22,6 @@ static inline struct dentry *debugfs_cre -+ return ERR_PTR(-ENODEV); -+ } -+ #endif /* CONFIG_DEBUG_FS */ -++#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) */ -+ -+ #endif /* __BACKPORT_DEBUGFS_H_ */ +diff --git a/package/kernel/mac80211/patches/030-rt2x00_options.patch b/package/kernel/mac80211/patches/030-rt2x00_options.patch +index 35b5b5d..a4ca884 100644 +--- a/package/kernel/mac80211/patches/030-rt2x00_options.patch ++++ b/package/kernel/mac80211/patches/030-rt2x00_options.patch +@@ -1,5 +1,5 @@ +---- a/drivers/net/wireless/rt2x00/Kconfig +-+++ b/drivers/net/wireless/rt2x00/Kconfig ++--- a/drivers/net/wireless/ralink/rt2x00/Kconfig +++++ b/drivers/net/wireless/ralink/rt2x00/Kconfig + @@ -225,36 +225,37 @@ config RT2800SOC + + +@@ -43,5 +43,5 @@ + - tristate + + tristate "RT2x00 support" + depends on m +- select BPAUTO_AVERAGE + ++ config RT2X00_LIB_FIRMWARE +diff --git a/package/kernel/mac80211/patches/040-brcmutil_option.patch b/package/kernel/mac80211/patches/040-brcmutil_option.patch +index 8a6cae6..167332d 100644 +--- a/package/kernel/mac80211/patches/040-brcmutil_option.patch ++++ b/package/kernel/mac80211/patches/040-brcmutil_option.patch +@@ -1,5 +1,5 @@ +---- a/drivers/net/wireless/brcm80211/Kconfig +-+++ b/drivers/net/wireless/brcm80211/Kconfig ++--- a/drivers/net/wireless/broadcom/brcm80211/Kconfig +++++ b/drivers/net/wireless/broadcom/brcm80211/Kconfig + @@ -1,5 +1,5 @@ + config BRCMUTIL + - tristate diff --git a/package/kernel/mac80211/patches/045-bcma-from-4.1.patch b/package/kernel/mac80211/patches/045-bcma-from-4.1.patch deleted file mode 100644 index dce217f..0000000 @@ -3996,19 +4640,52 @@ index dce217f..0000000 - true); - - /* +diff --git a/package/kernel/mac80211/patches/050-lib80211_option.patch b/package/kernel/mac80211/patches/050-lib80211_option.patch +index 5fe5558..3fc8c05 100644 +--- a/package/kernel/mac80211/patches/050-lib80211_option.patch ++++ b/package/kernel/mac80211/patches/050-lib80211_option.patch +@@ -1,6 +1,6 @@ + --- a/net/wireless/Kconfig + +++ b/net/wireless/Kconfig +-@@ -174,7 +174,7 @@ config CFG80211_WEXT_EXPORT ++@@ -171,7 +171,7 @@ config CFG80211_WEXT_EXPORT + wext compatibility symbols to be exported. + + config LIB80211 +@@ -9,7 +9,7 @@ + depends on m + default n + help +-@@ -184,15 +184,15 @@ config LIB80211 ++@@ -181,15 +181,15 @@ config LIB80211 + Drivers should select this themselves if needed. + + config LIB80211_CRYPT_WEP diff --git a/package/kernel/mac80211/patches/060-no_local_ssb_bcma.patch b/package/kernel/mac80211/patches/060-no_local_ssb_bcma.patch -index d307949..4fbab23 100644 +index d307949..fd1e1cf 100644 --- a/package/kernel/mac80211/patches/060-no_local_ssb_bcma.patch +++ b/package/kernel/mac80211/patches/060-no_local_ssb_bcma.patch -@@ -1,6 +1,6 @@ +@@ -1,9 +1,9 @@ --- a/.local-symbols +++ b/.local-symbols -@@ -344,40 +344,3 @@ USB_CDC_PHONET= -+@@ -449,43 +449,6 @@ USB_CDC_PHONET= - USB_IPHETH= +- USB_IPHETH= ++@@ -476,44 +476,6 @@ USB_IPHETH= USB_SIERRA_NET= USB_VL600= -@@ -32,26 +32,18 @@ ++ USB_NET_CH9200= + -SSB_POSSIBLE= + -SSB= + -SSB_SPROM= +@@ -15,6 +15,7 @@ + -SSB_PCMCIAHOST= + -SSB_SDIOHOST_POSSIBLE= + -SSB_SDIOHOST= ++-SSB_HOST_SOC= + -SSB_SILENT= + -SSB_DEBUG= + -SSB_SERIAL= +@@ -32,28 +33,20 @@ -BCMA_BLOCKIO= -BCMA_HOST_PCI_POSSIBLE= -BCMA_HOST_PCI= @@ -4033,13 +4710,17 @@ index d307949..4fbab23 100644 - #obj-$(CPTCFG_ETHERNET) += drivers/net/ethernet/ - obj-$(CPTCFG_USB_NET_RNDIS_WLAN) += drivers/net/usb/ - #obj-$(CPTCFG_NFC) += net/nfc/ +---- a/drivers/net/wireless/b43/main.c +-+++ b/drivers/net/wireless/b43/main.c + NFC= + NFC_DIGITAL= + NFC_NCI= - --- a/drivers/net/wireless/b43/main.c - +++ b/drivers/net/wireless/b43/main.c ++--- a/drivers/net/wireless/broadcom/b43/main.c +++++ b/drivers/net/wireless/broadcom/b43/main.c @@ -2866,7 +2866,7 @@ static struct ssb_device *b43_ssb_gpio_d -@@ -63,7 +55,7 @@ + { + struct ssb_bus *bus = dev->dev->sdev->bus; +@@ -63,7 +56,7 @@ return (bus->chipco.dev ? bus->chipco.dev : bus->pcicore.dev); #else return bus->chipco.dev; @@ -4048,7 +4729,40 @@ index d307949..4fbab23 100644 } if (sprom->boardflags_lo & B43_BFL_XTAL_NOSLOW) hf |= B43_HF_DSCRQ; /* Disable slowclock requests from ucode. */ -@@ -116,12 +108,23 @@ +@@ -72,8 +65,8 @@ + if (dev->dev->bus_type == B43_BUS_SSB && + dev->dev->sdev->bus->bustype == SSB_BUSTYPE_PCI && + dev->dev->sdev->bus->pcicore.dev->id.revision <= 10) +---- a/drivers/net/wireless/b43legacy/main.c +-+++ b/drivers/net/wireless/b43legacy/main.c ++--- a/drivers/net/wireless/broadcom/b43legacy/main.c +++++ b/drivers/net/wireless/broadcom/b43legacy/main.c + @@ -1937,7 +1937,7 @@ static int b43legacy_gpio_init(struct b4 + if (dev->dev->id.revision >= 2) + mask |= 0x0010; /* FIXME: This is redundant. */ +@@ -92,8 +85,8 @@ + pcidev = bus->pcicore.dev; + #endif + gpiodev = bus->chipco.dev ? : pcidev; +---- a/drivers/net/wireless/brcm80211/brcmsmac/Makefile +-+++ b/drivers/net/wireless/brcm80211/brcmsmac/Makefile ++--- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/Makefile +++++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/Makefile + @@ -43,6 +43,6 @@ brcmsmac-y := \ + brcms_trace_events.o \ + debug.o +@@ -102,8 +95,8 @@ + +brcmsmac-$(CONFIG_BCMA_DRIVER_GPIO) += led.o + + obj-$(CPTCFG_BRCMSMAC) += brcmsmac.o +---- a/drivers/net/wireless/brcm80211/brcmsmac/led.h +-+++ b/drivers/net/wireless/brcm80211/brcmsmac/led.h ++--- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/led.h +++++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/led.h + @@ -22,7 +22,7 @@ struct brcms_led { + bool active_low; + }; +@@ -116,12 +109,23 @@ --- a/Kconfig.sources +++ b/Kconfig.sources @@ -9,9 +9,6 @@ source "$BACKPORT_DIR/drivers/net/wirele @@ -4075,6 +4789,27 @@ index d307949..4fbab23 100644 + obj-$(CPTCFG_ETHERNET) += drivers/net/ethernet/ + obj-$(CPTCFG_USB_NET_RNDIS_WLAN) += drivers/net/usb/ + obj-$(CPTCFG_NFC) += net/nfc/ +diff --git a/package/kernel/mac80211/patches/070-ath_common_config.patch b/package/kernel/mac80211/patches/070-ath_common_config.patch +index c6e9cd8..41774fe 100644 +--- a/package/kernel/mac80211/patches/070-ath_common_config.patch ++++ b/package/kernel/mac80211/patches/070-ath_common_config.patch +@@ -1,10 +1,9 @@ + --- a/drivers/net/wireless/ath/Kconfig + +++ b/drivers/net/wireless/ath/Kconfig +-@@ -6,6 +6,7 @@ menuconfig ATH_CARDS +- tristate "Atheros Wireless Cards" ++@@ -1,5 +1,5 @@ ++ config ATH_COMMON ++- tristate +++ tristate "ath.ko" + depends on m +- depends on CFG80211 && (!UML || BROKEN) +-+ select ATH_COMMON +- ---help--- +- This will enable the support for the Atheros wireless drivers. +- ath5k, ath9k, ath9k_htc and ar9170 drivers share some common code, this option ++ ++ config WLAN_VENDOR_ATH diff --git a/package/kernel/mac80211/patches/090-linux_3_18_12_compat.patch b/package/kernel/mac80211/patches/090-linux_3_18_12_compat.patch deleted file mode 100644 index 85c5280..0000000 @@ -4112,7 +4847,7 @@ index 85c5280..0000000 - u8 netdev_rss_key[NETDEV_RSS_KEY_LEN]; diff --git a/package/kernel/mac80211/patches/100-remove-cryptoapi-dependencies.patch b/package/kernel/mac80211/patches/100-remove-cryptoapi-dependencies.patch new file mode 100644 -index 0000000..07dde54 +index 0000000..02f46c7 --- /dev/null +++ b/package/kernel/mac80211/patches/100-remove-cryptoapi-dependencies.patch @@ -0,0 +1,376 @@ @@ -4125,11 +4860,11 @@ index 0000000..07dde54 +- select BPAUTO_CRYPTO_CCM +- depends on CRYPTO_GCM + depends on CRC32 -+ select BPAUTO_AVERAGE + ---help--- ++ This option enables the hardware independent IEEE 802.11 +--- a/net/mac80211/Makefile ++++ b/net/mac80211/Makefile -+@@ -15,9 +15,7 @@ mac80211-y := \ ++@@ -16,9 +16,7 @@ mac80211-y := \ + michael.o \ + tkip.o \ + aes_ccm.o \ @@ -4438,7 +5173,7 @@ index 0000000..07dde54 + struct { +--- a/net/mac80211/wpa.c ++++ b/net/mac80211/wpa.c -+@@ -304,7 +304,8 @@ ieee80211_crypto_tkip_decrypt(struct iee ++@@ -307,7 +307,8 @@ ieee80211_crypto_tkip_decrypt(struct iee + } + + @@ -4448,7 +5183,7 @@ index 0000000..07dde54 + { + __le16 mask_fc; + int a4_included, mgmt; -+@@ -334,14 +335,8 @@ static void ccmp_special_blocks(struct s ++@@ -337,14 +338,8 @@ static void ccmp_special_blocks(struct s + else + qos_tid = 0; + @@ -4465,7 +5200,7 @@ index 0000000..07dde54 + + /* Nonce: Nonce Flags | A2 | PN + * Nonce Flags: Priority (b0..b3) | Management (b4) | Reserved (b5..b7) -+@@ -349,6 +344,8 @@ static void ccmp_special_blocks(struct s ++@@ -352,6 +347,8 @@ static void ccmp_special_blocks(struct s + b_0[1] = qos_tid | (mgmt << 4); + memcpy(&b_0[2], hdr->addr2, ETH_ALEN); + memcpy(&b_0[8], pn, IEEE80211_CCMP_PN_LEN); @@ -4474,7 +5209,7 @@ index 0000000..07dde54 + + /* AAD (extra authenticate-only data) / masked 802.11 header + * FC | A1 | A2 | A3 | SC | [A4] | [QC] */ -+@@ -460,7 +457,7 @@ static int ccmp_encrypt_skb(struct ieee8 ++@@ -463,7 +460,7 @@ static int ccmp_encrypt_skb(struct ieee8 + return 0; + + pos += IEEE80211_CCMP_HDR_LEN; @@ -4483,7 +5218,7 @@ index 0000000..07dde54 + ieee80211_aes_ccm_encrypt(key->u.ccmp.tfm, b_0, aad, pos, len, + skb_put(skb, mic_len), mic_len); + -+@@ -531,7 +528,7 @@ ieee80211_crypto_ccmp_decrypt(struct iee ++@@ -534,7 +531,7 @@ ieee80211_crypto_ccmp_decrypt(struct iee + u8 aad[2 * AES_BLOCK_SIZE]; + u8 b_0[AES_BLOCK_SIZE]; + /* hardware didn't decrypt/verify MIC */ @@ -6554,7 +7289,7 @@ index ceca952..0000000 -- - #endif /* WPA_H */ diff --git a/package/kernel/mac80211/patches/110-mac80211_keep_keys_on_stop_ap.patch b/package/kernel/mac80211/patches/110-mac80211_keep_keys_on_stop_ap.patch -index 41a3c4f..cff6d89 100644 +index 41a3c4f..d1d9fbd 100644 --- a/package/kernel/mac80211/patches/110-mac80211_keep_keys_on_stop_ap.patch +++ b/package/kernel/mac80211/patches/110-mac80211_keep_keys_on_stop_ap.patch @@ -2,7 +2,7 @@ Used for AP+STA support in OpenWrt - preserve AP mode keys across STA reconnects @@ -6562,50 +7297,80 @@ index 41a3c4f..cff6d89 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -856,7 +856,6 @@ static int ieee80211_stop_ap(struct wiph -+@@ -886,7 +886,6 @@ static int ieee80211_stop_ap(struct wiph ++@@ -846,7 +846,6 @@ static int ieee80211_stop_ap(struct wiph sdata->u.ap.driver_smps_mode = IEEE80211_SMPS_OFF; __sta_info_flush(sdata, true); diff --git a/package/kernel/mac80211/patches/150-disable_addr_notifier.patch b/package/kernel/mac80211/patches/150-disable_addr_notifier.patch -index de79bd2..5fc9454 100644 +index de79bd2..2855a88 100644 --- a/package/kernel/mac80211/patches/150-disable_addr_notifier.patch +++ b/package/kernel/mac80211/patches/150-disable_addr_notifier.patch -@@ -18,7 +18,7 @@ +@@ -1,6 +1,6 @@ + --- a/net/mac80211/main.c + +++ b/net/mac80211/main.c +-@@ -287,7 +287,7 @@ void ieee80211_restart_hw(struct ieee802 ++@@ -291,7 +291,7 @@ void ieee80211_restart_hw(struct ieee802 + } + EXPORT_SYMBOL(ieee80211_restart_hw); + +@@ -9,7 +9,7 @@ + static int ieee80211_ifa_changed(struct notifier_block *nb, + unsigned long data, void *arg) + { +-@@ -346,7 +346,7 @@ static int ieee80211_ifa_changed(struct ++@@ -350,7 +350,7 @@ static int ieee80211_ifa_changed(struct + } + #endif + +@@ -18,9 +18,9 @@ static int ieee80211_ifa6_changed(struct notifier_block *nb, unsigned long data, void *arg) { -@@ -1057,14 +1057,14 @@ int ieee80211_register_hw(struct ieee802 -+@@ -1086,14 +1086,14 @@ int ieee80211_register_hw(struct ieee802 - if (result) - goto fail_pm_qos; +- if (result) +- goto fail_pm_qos; ++@@ -1087,14 +1087,14 @@ int ieee80211_register_hw(struct ieee802 ++ ++ rtnl_unlock(); + -#ifdef CONFIG_INET + +#ifdef __disabled__CONFIG_INET @@ -35,7 +35,7 @@ local->ifa6_notifier.notifier_call = ieee80211_ifa6_changed; result = register_inet6addr_notifier(&local->ifa6_notifier); if (result) -@@ -1073,13 +1073,13 @@ int ieee80211_register_hw(struct ieee802 -+@@ -1102,13 +1102,13 @@ int ieee80211_register_hw(struct ieee802 ++@@ -1103,13 +1103,13 @@ int ieee80211_register_hw(struct ieee802 return 0; -@@ -52,7 +52,7 @@ +@@ -50,12 +50,12 @@ + -#if defined(CONFIG_INET) || defined(CONFIG_IPV6) + +#if defined(__disabled__CONFIG_INET) || defined(__disabled__CONFIG_IPV6) fail_ifa: - pm_qos_remove_notifier(PM_QOS_NETWORK_LATENCY, - &local->network_latency_notifier); +- pm_qos_remove_notifier(PM_QOS_NETWORK_LATENCY, +- &local->network_latency_notifier); -@@ -1124,10 +1124,10 @@ void ieee80211_unregister_hw(struct ieee -+@@ -1141,10 +1141,10 @@ void ieee80211_unregister_hw(struct ieee ++ #endif ++ rtnl_lock(); ++@@ -1137,10 +1137,10 @@ void ieee80211_unregister_hw(struct ieee ++ tasklet_kill(&local->tx_pending_tasklet); ++ tasklet_kill(&local->tasklet); - pm_qos_remove_notifier(PM_QOS_NETWORK_LATENCY, - &local->network_latency_notifier); +- pm_qos_remove_notifier(PM_QOS_NETWORK_LATENCY, +- &local->network_latency_notifier); + -#ifdef CONFIG_INET + +#ifdef __disabled__CONFIG_INET + unregister_inetaddr_notifier(&local->ifa_notifier); diff --git a/package/kernel/mac80211/patches/210-ap_scan.patch b/package/kernel/mac80211/patches/210-ap_scan.patch -index 47dcec3..29f05c4 100644 +index 47dcec3..a99cbd2 100644 --- a/package/kernel/mac80211/patches/210-ap_scan.patch +++ b/package/kernel/mac80211/patches/210-ap_scan.patch @@ -1,6 +1,6 @@ --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -1963,7 +1963,7 @@ static int ieee80211_scan(struct wiphy * -+@@ -2008,7 +2008,7 @@ static int ieee80211_scan(struct wiphy * ++@@ -1999,7 +1999,7 @@ static int ieee80211_scan(struct wiphy * * the frames sent while scanning on other channel will be * lost) */ @@ -7536,7 +8301,7 @@ index 237121b..0000000 - void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid) diff --git a/package/kernel/mac80211/patches/301-ath9k-limit-retries-for-powersave-response-frames.patch b/package/kernel/mac80211/patches/301-ath9k-limit-retries-for-powersave-response-frames.patch new file mode 100644 -index 0000000..4faac0d +index 0000000..a160dc4 --- /dev/null +++ b/package/kernel/mac80211/patches/301-ath9k-limit-retries-for-powersave-response-frames.patch @@ -0,0 +1,121 @@ @@ -7555,7 +8320,7 @@ index 0000000..4faac0d + +--- a/drivers/net/wireless/ath/ath9k/xmit.c ++++ b/drivers/net/wireless/ath/ath9k/xmit.c -+@@ -147,10 +147,25 @@ static void ath_send_bar(struct ath_atx_ ++@@ -136,10 +136,25 @@ static void ath_send_bar(struct ath_atx_ + } + + static void ath_set_rates(struct ieee80211_vif *vif, struct ieee80211_sta *sta, @@ -7582,7 +8347,7 @@ index 0000000..4faac0d + } + + static void ath_txq_skb_done(struct ath_softc *sc, struct ath_txq *txq, -+@@ -1430,7 +1445,7 @@ ath_tx_form_burst(struct ath_softc *sc, ++@@ -1419,7 +1434,7 @@ ath_tx_form_burst(struct ath_softc *sc, + if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) + break; + @@ -7591,7 +8356,7 @@ index 0000000..4faac0d + } while (1); + } + -+@@ -1461,7 +1476,7 @@ static bool ath_tx_sched_aggr(struct ath ++@@ -1450,7 +1465,7 @@ static bool ath_tx_sched_aggr(struct ath + return false; + } + @@ -7600,7 +8365,7 @@ index 0000000..4faac0d + if (aggr) + last = ath_tx_form_aggr(sc, txq, tid, &bf_q, bf, + tid_q, &aggr_len); -+@@ -1653,7 +1668,7 @@ void ath9k_release_buffered_frames(struc ++@@ -1647,7 +1662,7 @@ void ath9k_release_buffered_frames(struc + + __skb_unlink(bf->bf_mpdu, tid_q); + list_add_tail(&bf->list, &bf_q); @@ -7609,7 +8374,7 @@ index 0000000..4faac0d + if (bf_isampdu(bf)) { + ath_tx_addto_baw(sc, tid, bf); + bf->bf_state.bf_type &= ~BUF_AGGR; -+@@ -2318,7 +2333,7 @@ int ath_tx_start(struct ieee80211_hw *hw ++@@ -2293,7 +2308,7 @@ int ath_tx_start(struct ieee80211_hw *hw + struct ath_txq *txq = txctl->txq; + struct ath_atx_tid *tid = NULL; + struct ath_buf *bf; @@ -7618,7 +8383,7 @@ index 0000000..4faac0d + int q, ret; + + if (vif) -+@@ -2365,13 +2380,13 @@ int ath_tx_start(struct ieee80211_hw *hw ++@@ -2346,13 +2361,13 @@ int ath_tx_start(struct ieee80211_hw *hw + if (!txctl->an) + txctl->an = &avp->mcast_node; + queue = true; @@ -7634,7 +8399,7 @@ index 0000000..4faac0d + ath_txq_unlock(sc, txq); + txq = sc->tx.uapsdq; + ath_txq_lock(sc, txq); -+@@ -2409,7 +2424,7 @@ int ath_tx_start(struct ieee80211_hw *hw ++@@ -2390,7 +2405,7 @@ int ath_tx_start(struct ieee80211_hw *hw + if (txctl->paprd) + bf->bf_state.bfs_paprd_timestamp = jiffies; + @@ -7643,7 +8408,7 @@ index 0000000..4faac0d + ath_tx_send_normal(sc, txq, tid, skb); + + out: -+@@ -2448,7 +2463,7 @@ void ath_tx_cabq(struct ieee80211_hw *hw ++@@ -2429,7 +2444,7 @@ void ath_tx_cabq(struct ieee80211_hw *hw + break; + + bf->bf_lastbf = bf; @@ -7652,7 +8417,7 @@ index 0000000..4faac0d + ath_buf_set_rate(sc, bf, &info, fi->framelen, false); + duration += info.rates[0].PktDuration; + if (bf_tail) -+@@ -2968,7 +2983,7 @@ int ath9k_tx99_send(struct ath_softc *sc ++@@ -2932,7 +2947,7 @@ int ath9k_tx99_send(struct ath_softc *sc + return -EINVAL; + } + @@ -7792,68 +8557,6 @@ index 465d943..0000000 - spinlock_t lock; - - struct work_struct drv_deliver_wk; -diff --git a/package/kernel/mac80211/patches/302-ath10k-Delay-device-access-after-cold-reset.patch b/package/kernel/mac80211/patches/302-ath10k-Delay-device-access-after-cold-reset.patch -new file mode 100644 -index 0000000..820aa9a ---- /dev/null -+++ b/package/kernel/mac80211/patches/302-ath10k-Delay-device-access-after-cold-reset.patch -@@ -0,0 +1,56 @@ -+From: Vasanthakumar Thiagarajan -+Date: Fri, 3 Jul 2015 11:45:42 +0530 -+Subject: [PATCH] ath10k: Delay device access after cold reset -+ -+It is observed that during cold reset pcie access right -+after a write operation to SOC_GLOBAL_RESET_ADDRESS causes -+Data Bus Error and system hard lockup. The reason -+for bus error is that pcie needs some time to get -+back to stable state for any transaction during cold reset. Add -+delay of 20 msecs after write of SOC_GLOBAL_RESET_ADDRESS -+to fix this issue. -+ -+Signed-off-by: Vasanthakumar Thiagarajan -+--- -+ -+--- a/drivers/net/wireless/ath/ath10k/pci.c -++++ b/drivers/net/wireless/ath/ath10k/pci.c -+@@ -2761,7 +2761,6 @@ static int ath10k_pci_wait_for_target_in -+ -+ static int ath10k_pci_cold_reset(struct ath10k *ar) -+ { -+- int i; -+ u32 val; -+ -+ ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot cold reset\n"); -+@@ -2777,23 +2776,18 @@ static int ath10k_pci_cold_reset(struct -+ 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); -+- } -++ /* After writing into SOC_GLOBAL_RESET to put device into -++ * reset and pulling out of reset pcie may not be stable -++ * for any immediate pcie register access and cause bus error, -++ * add delay before any pcie access request to fix this issue. -++ */ -++ msleep(20); -+ -+ /* 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); -+- } -++ msleep(20); -+ -+ ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot cold reset complete\n"); -+ diff --git a/package/kernel/mac80211/patches/302-ath9k-restart-only-triggering-DFS-detector-line.patch b/package/kernel/mac80211/patches/302-ath9k-restart-only-triggering-DFS-detector-line.patch deleted file mode 100644 index e54e16e..0000000 @@ -7881,6 +8584,107 @@ index e54e16e..0000000 - return true; - } - } +diff --git a/package/kernel/mac80211/patches/302-ath9k_hw-add-low-power-tx-gain-table-for-AR953x.patch b/package/kernel/mac80211/patches/302-ath9k_hw-add-low-power-tx-gain-table-for-AR953x.patch +new file mode 100644 +index 0000000..22b987a +--- /dev/null ++++ b/package/kernel/mac80211/patches/302-ath9k_hw-add-low-power-tx-gain-table-for-AR953x.patch +@@ -0,0 +1,95 @@ ++From: Felix Fietkau ++Date: Thu, 14 Jan 2016 03:14:03 +0100 ++Subject: [PATCH] ath9k_hw: add low power tx gain table for AR953x ++ ++Used in some newer TP-Link AR9533 devices. ++ ++Signed-off-by: Felix Fietkau ++--- ++ ++--- a/drivers/net/wireless/ath/ath9k/ar9003_hw.c +++++ b/drivers/net/wireless/ath/ath9k/ar9003_hw.c ++@@ -698,6 +698,9 @@ static void ar9003_tx_gain_table_mode2(s ++ else if (AR_SREV_9340(ah)) ++ INIT_INI_ARRAY(&ah->iniModesTxGain, ++ ar9340Modes_low_ob_db_tx_gain_table_1p0); +++ else if (AR_SREV_9531_11(ah)) +++ INIT_INI_ARRAY(&ah->iniModesTxGain, +++ qca953x_1p1_modes_no_xpa_low_power_tx_gain_table); ++ else if (AR_SREV_9485_11_OR_LATER(ah)) ++ INIT_INI_ARRAY(&ah->iniModesTxGain, ++ ar9485Modes_low_ob_db_tx_gain_1_1); ++--- a/drivers/net/wireless/ath/ath9k/ar953x_initvals.h +++++ b/drivers/net/wireless/ath/ath9k/ar953x_initvals.h ++@@ -757,6 +757,71 @@ static const u32 qca953x_1p1_modes_xpa_t ++ {0x00016448, 0x6c927a70}, ++ }; ++ +++static const u32 qca953x_1p1_modes_no_xpa_low_power_tx_gain_table[][2] = { +++ /* Addr allmodes */ +++ {0x0000a2dc, 0xfff55592}, +++ {0x0000a2e0, 0xfff99924}, +++ {0x0000a2e4, 0xfffe1e00}, +++ {0x0000a2e8, 0xffffe000}, +++ {0x0000a410, 0x000050d6}, +++ {0x0000a500, 0x00000069}, +++ {0x0000a504, 0x0400006b}, +++ {0x0000a508, 0x0800006d}, +++ {0x0000a50c, 0x0c000269}, +++ {0x0000a510, 0x1000026b}, +++ {0x0000a514, 0x1400026d}, +++ {0x0000a518, 0x18000669}, +++ {0x0000a51c, 0x1c00066b}, +++ {0x0000a520, 0x1d000a68}, +++ {0x0000a524, 0x21000a6a}, +++ {0x0000a528, 0x25000a6c}, +++ {0x0000a52c, 0x29000a6e}, +++ {0x0000a530, 0x2d0012a9}, +++ {0x0000a534, 0x310012ab}, +++ {0x0000a538, 0x350012ad}, +++ {0x0000a53c, 0x39001b0a}, +++ {0x0000a540, 0x3d001b0c}, +++ {0x0000a544, 0x41001b0e}, +++ {0x0000a548, 0x43001bae}, +++ {0x0000a54c, 0x45001914}, +++ {0x0000a550, 0x47001916}, +++ {0x0000a554, 0x49001b96}, +++ {0x0000a558, 0x49001b96}, +++ {0x0000a55c, 0x49001b96}, +++ {0x0000a560, 0x49001b96}, +++ {0x0000a564, 0x49001b96}, +++ {0x0000a568, 0x49001b96}, +++ {0x0000a56c, 0x49001b96}, +++ {0x0000a570, 0x49001b96}, +++ {0x0000a574, 0x49001b96}, +++ {0x0000a578, 0x49001b96}, +++ {0x0000a57c, 0x49001b96}, +++ {0x0000a600, 0x00000000}, +++ {0x0000a604, 0x00000000}, +++ {0x0000a608, 0x00000000}, +++ {0x0000a60c, 0x00000000}, +++ {0x0000a610, 0x00000000}, +++ {0x0000a614, 0x00000000}, +++ {0x0000a618, 0x00804201}, +++ {0x0000a61c, 0x01408201}, +++ {0x0000a620, 0x01408502}, +++ {0x0000a624, 0x01408502}, +++ {0x0000a628, 0x01408502}, +++ {0x0000a62c, 0x01408502}, +++ {0x0000a630, 0x01408502}, +++ {0x0000a634, 0x01408502}, +++ {0x0000a638, 0x01408502}, +++ {0x0000a63c, 0x01408502}, +++ {0x0000b2dc, 0xfff55592}, +++ {0x0000b2e0, 0xfff99924}, +++ {0x0000b2e4, 0xfffe1e00}, +++ {0x0000b2e8, 0xffffe000}, +++ {0x00016044, 0x044922db}, +++ {0x00016048, 0x6c927a70}, +++ {0x00016444, 0x044922db}, +++ {0x00016448, 0x6c927a70}, +++}; +++ ++ static const u32 qca953x_2p0_baseband_core[][2] = { ++ /* Addr allmodes */ ++ {0x00009800, 0xafe68e30}, diff --git a/package/kernel/mac80211/patches/303-ath9k-add-DFS-support-for-extension-channel.patch b/package/kernel/mac80211/patches/303-ath9k-add-DFS-support-for-extension-channel.patch deleted file mode 100644 index ed268ea..0000000 @@ -7963,29 +8767,168 @@ index ed268ea..0000000 - } -+#undef PRI_CH_RADAR_FOUND -+#undef EXT_CH_RADAR_FOUND -diff --git a/package/kernel/mac80211/patches/303-ath9k-add-fast-xmit-support.patch b/package/kernel/mac80211/patches/303-ath9k-add-fast-xmit-support.patch +diff --git a/package/kernel/mac80211/patches/303-rt2x00-fix-monitor-mode-regression.patch b/package/kernel/mac80211/patches/303-rt2x00-fix-monitor-mode-regression.patch new file mode 100644 -index 0000000..139015c +index 0000000..7bb7435 --- /dev/null -+++ b/package/kernel/mac80211/patches/303-ath9k-add-fast-xmit-support.patch -@@ -0,0 +1,17 @@ -+From: Felix Fietkau -+Date: Mon, 11 May 2015 18:35:20 +0200 -+Subject: [PATCH] ath9k: add fast-xmit support ++++ b/package/kernel/mac80211/patches/303-rt2x00-fix-monitor-mode-regression.patch +@@ -0,0 +1,156 @@ ++From: Eli Cooper ++Date: Thu, 14 Jan 2016 00:07:12 +0800 ++Subject: [PATCH] rt2x00: fix monitor mode regression + -+Signed-off-by: Felix Fietkau ++Since commit df1404650ccbfeb76a84f301f22316be0d00a864 monitor mode for rt2x00 ++has been made effectively useless because the hardware filter is configured to ++drop packets whose intended recipient is not the device, regardless of the ++presence of monitor mode interfaces. ++ ++This patch fixes this regression by adding explicit monitor mode support, and ++configuring the hardware filter accordingly. ++ ++Signed-off-by: Eli Cooper +--- + -+--- a/drivers/net/wireless/ath/ath9k/init.c -++++ b/drivers/net/wireless/ath/ath9k/init.c -+@@ -826,6 +826,7 @@ static void ath9k_set_hw_capab(struct at -+ ieee80211_hw_set(hw, SIGNAL_DBM); -+ ieee80211_hw_set(hw, RX_INCLUDES_FCS); -+ ieee80211_hw_set(hw, HOST_BROADCAST_PS_BUFFERING); -++ ieee80211_hw_set(hw, SUPPORT_FAST_XMIT); ++--- a/drivers/net/wireless/ralink/rt2x00/rt2400pci.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2400pci.c ++@@ -273,8 +273,10 @@ static void rt2400pci_config_filter(stru ++ !(filter_flags & FIF_PLCPFAIL)); ++ rt2x00_set_field32(®, RXCSR0_DROP_CONTROL, ++ !(filter_flags & FIF_CONTROL)); ++- rt2x00_set_field32(®, RXCSR0_DROP_NOT_TO_ME, 1); +++ rt2x00_set_field32(®, RXCSR0_DROP_NOT_TO_ME, +++ !rt2x00dev->is_monitoring); ++ rt2x00_set_field32(®, RXCSR0_DROP_TODS, +++ !rt2x00dev->is_monitoring && ++ !rt2x00dev->intf_ap_count); ++ rt2x00_set_field32(®, RXCSR0_DROP_VERSION_ERROR, 1); ++ rt2x00mmio_register_write(rt2x00dev, RXCSR0, reg); ++--- a/drivers/net/wireless/ralink/rt2x00/rt2500pci.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2500pci.c ++@@ -274,8 +274,10 @@ static void rt2500pci_config_filter(stru ++ !(filter_flags & FIF_PLCPFAIL)); ++ rt2x00_set_field32(®, RXCSR0_DROP_CONTROL, ++ !(filter_flags & FIF_CONTROL)); ++- rt2x00_set_field32(®, RXCSR0_DROP_NOT_TO_ME, 1); +++ rt2x00_set_field32(®, RXCSR0_DROP_NOT_TO_ME, +++ !rt2x00dev->is_monitoring); ++ rt2x00_set_field32(®, RXCSR0_DROP_TODS, +++ !rt2x00dev->is_monitoring && ++ !rt2x00dev->intf_ap_count); ++ rt2x00_set_field32(®, RXCSR0_DROP_VERSION_ERROR, 1); ++ rt2x00_set_field32(®, RXCSR0_DROP_MCAST, ++--- a/drivers/net/wireless/ralink/rt2x00/rt2500usb.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2500usb.c ++@@ -437,8 +437,10 @@ static void rt2500usb_config_filter(stru ++ !(filter_flags & FIF_PLCPFAIL)); ++ rt2x00_set_field16(®, TXRX_CSR2_DROP_CONTROL, ++ !(filter_flags & FIF_CONTROL)); ++- rt2x00_set_field16(®, TXRX_CSR2_DROP_NOT_TO_ME, 1); +++ rt2x00_set_field16(®, TXRX_CSR2_DROP_NOT_TO_ME, +++ !rt2x00dev->is_monitoring); ++ rt2x00_set_field16(®, TXRX_CSR2_DROP_TODS, +++ !rt2x00dev->is_monitoring && ++ !rt2x00dev->intf_ap_count); ++ rt2x00_set_field16(®, TXRX_CSR2_DROP_VERSION_ERROR, 1); ++ rt2x00_set_field16(®, TXRX_CSR2_DROP_MULTICAST, ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++@@ -1490,7 +1490,8 @@ void rt2800_config_filter(struct rt2x00_ ++ !(filter_flags & FIF_FCSFAIL)); ++ rt2x00_set_field32(®, RX_FILTER_CFG_DROP_PHY_ERROR, ++ !(filter_flags & FIF_PLCPFAIL)); ++- rt2x00_set_field32(®, RX_FILTER_CFG_DROP_NOT_TO_ME, 1); +++ rt2x00_set_field32(®, RX_FILTER_CFG_DROP_NOT_TO_ME, +++ !rt2x00dev->is_monitoring); ++ rt2x00_set_field32(®, RX_FILTER_CFG_DROP_NOT_MY_BSSD, 0); ++ rt2x00_set_field32(®, RX_FILTER_CFG_DROP_VER_ERROR, 1); ++ rt2x00_set_field32(®, RX_FILTER_CFG_DROP_MULTICAST, ++--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h +++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h ++@@ -844,11 +844,13 @@ struct rt2x00_dev { ++ * - Open sta interface count. ++ * - Association count. ++ * - Beaconing enabled count. +++ * - Whether the device is monitoring. ++ */ ++ unsigned int intf_ap_count; ++ unsigned int intf_sta_count; ++ unsigned int intf_associated; ++ unsigned int intf_beaconing; +++ bool is_monitoring; + -+ if (ath9k_ps_enable) -+ ieee80211_hw_set(hw, SUPPORTS_PS); ++ /* ++ * Interface combinations ++--- a/drivers/net/wireless/ralink/rt2x00/rt2x00config.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00config.c ++@@ -244,6 +244,16 @@ void rt2x00lib_config(struct rt2x00_dev ++ (ieee80211_flags & IEEE80211_CONF_CHANGE_PS)) ++ cancel_delayed_work_sync(&rt2x00dev->autowakeup_work); ++ +++ if (ieee80211_flags & IEEE80211_CONF_CHANGE_MONITOR) { +++ if (conf->flags & IEEE80211_CONF_MONITOR) { +++ rt2x00_dbg(rt2x00dev, "Monitor mode is enabled\n"); +++ rt2x00dev->is_monitoring = true; +++ } else { +++ rt2x00_dbg(rt2x00dev, "Monitor mode is disabled\n"); +++ rt2x00dev->is_monitoring = false; +++ } +++ } +++ ++ /* ++ * Start configuration. ++ */ ++--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c ++@@ -1204,6 +1204,7 @@ int rt2x00lib_start(struct rt2x00_dev *r ++ rt2x00dev->intf_ap_count = 0; ++ rt2x00dev->intf_sta_count = 0; ++ rt2x00dev->intf_associated = 0; +++ rt2x00dev->is_monitoring = false; ++ ++ /* Enable the radio */ ++ retval = rt2x00lib_enable_radio(rt2x00dev); ++--- a/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c ++@@ -385,11 +385,6 @@ void rt2x00mac_configure_filter(struct i ++ *total_flags |= FIF_PSPOLL; ++ } ++ ++- /* ++- * Check if there is any work left for us. ++- */ ++- if (rt2x00dev->packet_filter == *total_flags) ++- return; ++ rt2x00dev->packet_filter = *total_flags; ++ ++ rt2x00dev->ops->lib->config_filter(rt2x00dev, *total_flags); ++--- a/drivers/net/wireless/ralink/rt2x00/rt61pci.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt61pci.c ++@@ -530,8 +530,10 @@ static void rt61pci_config_filter(struct ++ !(filter_flags & FIF_PLCPFAIL)); ++ rt2x00_set_field32(®, TXRX_CSR0_DROP_CONTROL, ++ !(filter_flags & (FIF_CONTROL | FIF_PSPOLL))); ++- rt2x00_set_field32(®, TXRX_CSR0_DROP_NOT_TO_ME, 1); +++ rt2x00_set_field32(®, TXRX_CSR0_DROP_NOT_TO_ME, +++ !rt2x00dev->is_monitoring); ++ rt2x00_set_field32(®, TXRX_CSR0_DROP_TO_DS, +++ !rt2x00dev->is_monitoring && ++ !rt2x00dev->intf_ap_count); ++ rt2x00_set_field32(®, TXRX_CSR0_DROP_VERSION_ERROR, 1); ++ rt2x00_set_field32(®, TXRX_CSR0_DROP_MULTICAST, ++--- a/drivers/net/wireless/ralink/rt2x00/rt73usb.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt73usb.c ++@@ -480,8 +480,10 @@ static void rt73usb_config_filter(struct ++ !(filter_flags & FIF_PLCPFAIL)); ++ rt2x00_set_field32(®, TXRX_CSR0_DROP_CONTROL, ++ !(filter_flags & (FIF_CONTROL | FIF_PSPOLL))); ++- rt2x00_set_field32(®, TXRX_CSR0_DROP_NOT_TO_ME, 1); +++ rt2x00_set_field32(®, TXRX_CSR0_DROP_NOT_TO_ME, +++ !rt2x00dev->is_monitoring); ++ rt2x00_set_field32(®, TXRX_CSR0_DROP_TO_DS, +++ !rt2x00dev->is_monitoring && ++ !rt2x00dev->intf_ap_count); ++ rt2x00_set_field32(®, TXRX_CSR0_DROP_VERSION_ERROR, 1); ++ rt2x00_set_field32(®, TXRX_CSR0_DROP_MULTICAST, diff --git a/package/kernel/mac80211/patches/304-ath9k-allow-40MHz-radar-detection-width.patch b/package/kernel/mac80211/patches/304-ath9k-allow-40MHz-radar-detection-width.patch deleted file mode 100644 index e1eab64..0000000 @@ -8011,397 +8954,44 @@ index e1eab64..0000000 - } - #endif - }; -diff --git a/package/kernel/mac80211/patches/304-ath9k-remove-struct-ath_atx_ac.patch b/package/kernel/mac80211/patches/304-ath9k-remove-struct-ath_atx_ac.patch +diff --git a/package/kernel/mac80211/patches/304-ath9k-avoid-ANI-restart-if-no-trigger.patch b/package/kernel/mac80211/patches/304-ath9k-avoid-ANI-restart-if-no-trigger.patch new file mode 100644 -index 0000000..9f04276 +index 0000000..049059a --- /dev/null -+++ b/package/kernel/mac80211/patches/304-ath9k-remove-struct-ath_atx_ac.patch -@@ -0,0 +1,385 @@ -+From: Felix Fietkau -+Date: Sat, 4 Apr 2015 18:39:06 +0200 -+Subject: [PATCH] ath9k: remove struct ath_atx_ac ++++ b/package/kernel/mac80211/patches/304-ath9k-avoid-ANI-restart-if-no-trigger.patch +@@ -0,0 +1,32 @@ ++From: Miaoqing Pan ++Date: Fri, 15 Jan 2016 18:17:17 +0800 ++Subject: [PATCH] ath9k: avoid ANI restart if no trigger + -+struct ath_atx_ac contains a list of active TIDs belonging to one WMM AC. -+This patch changes the code to track active station TIDs in the txq directly. ++Fixes commit 54da20d83f0e ("ath9k_hw: improve ANI processing and rx desensitizing parameters") + -+Signed-off-by: Felix Fietkau ++Call ath9k_ani_restart() only when the phy error rate reach the ++ANI immunity threshold. Sync the logic with internal code base. ++ ++Signed-off-by: Miaoqing Pan +--- + -+--- a/drivers/net/wireless/ath/ath9k/ath9k.h -++++ b/drivers/net/wireless/ath/ath9k/ath9k.h -+@@ -173,14 +173,6 @@ struct ath_txq { -+ struct sk_buff_head complete_q; -+ }; -+ -+-struct ath_atx_ac { -+- struct ath_txq *txq; -+- struct list_head list; -+- struct list_head tid_q; -+- bool clear_ps_filter; -+- bool sched; -+-}; -+- -+ struct ath_frame_info { -+ struct ath_buf *bf; -+ u16 framelen; -+@@ -243,7 +235,7 @@ struct ath_atx_tid { -+ struct sk_buff_head buf_q; -+ struct sk_buff_head retry_q; -+ struct ath_node *an; -+- struct ath_atx_ac *ac; -++ struct ath_txq *txq; -+ unsigned long tx_buf[BITS_TO_LONGS(ATH_TID_MAX_BUFS)]; -+ u16 seq_start; -+ u16 seq_next; -+@@ -255,6 +247,7 @@ struct ath_atx_tid { -+ s8 bar_index; -+ bool sched; -+ bool active; -++ bool clear_ps_filter; -+ }; -+ -+ struct ath_node { -+@@ -262,7 +255,6 @@ struct ath_node { -+ struct ieee80211_sta *sta; /* station struct we're part of */ -+ struct ieee80211_vif *vif; /* interface with which we're associated */ -+ struct ath_atx_tid tid[IEEE80211_NUM_TIDS]; -+- struct ath_atx_ac ac[IEEE80211_NUM_ACS]; -+ -+ u16 maxampdu; -+ u8 mpdudensity; -+--- a/drivers/net/wireless/ath/ath9k/xmit.c -++++ b/drivers/net/wireless/ath/ath9k/xmit.c -+@@ -106,7 +106,6 @@ void ath_txq_unlock_complete(struct ath_ -+ static void ath_tx_queue_tid(struct ath_softc *sc, struct ath_txq *txq, -+ struct ath_atx_tid *tid) -+ { -+- struct ath_atx_ac *ac = tid->ac; -+ struct list_head *list; -+ struct ath_vif *avp = (struct ath_vif *) tid->an->vif->drv_priv; -+ struct ath_chanctx *ctx = avp->chanctx; -+@@ -118,15 +117,8 @@ static void ath_tx_queue_tid(struct ath_ -+ return; -+ -+ tid->sched = true; -+- list_add_tail(&tid->list, &ac->tid_q); -+- -+- if (ac->sched) -+- return; -+- -+- ac->sched = true; -+- -+ list = &ctx->acq[TID_TO_WME_AC(tid->tidno)]; -+- list_add_tail(&ac->list, list); -++ list_add_tail(&tid->list, list); -+ } -+ -+ static struct ath_frame_info *get_frame_info(struct sk_buff *skb) -+@@ -223,7 +215,7 @@ static struct sk_buff *ath_tid_dequeue(s -+ static void -+ ath_tx_tid_change_state(struct ath_softc *sc, struct ath_atx_tid *tid) -+ { -+- struct ath_txq *txq = tid->ac->txq; -++ struct ath_txq *txq = tid->txq; -+ struct ieee80211_tx_info *tx_info; -+ struct sk_buff *skb, *tskb; -+ struct ath_buf *bf; -+@@ -252,7 +244,7 @@ ath_tx_tid_change_state(struct ath_softc -+ -+ static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid) -+ { -+- struct ath_txq *txq = tid->ac->txq; -++ struct ath_txq *txq = tid->txq; -+ struct sk_buff *skb; -+ struct ath_buf *bf; -+ struct list_head bf_head; -+@@ -659,7 +651,7 @@ static void ath_tx_complete_aggr(struct -+ ath_tx_queue_tid(sc, txq, tid); -+ -+ if (ts->ts_status & (ATH9K_TXERR_FILT | ATH9K_TXERR_XRETRY)) -+- tid->ac->clear_ps_filter = true; -++ tid->clear_ps_filter = true; ++--- a/drivers/net/wireless/ath/ath9k/ani.c +++++ b/drivers/net/wireless/ath/ath9k/ani.c ++@@ -444,14 +444,16 @@ void ath9k_hw_ani_monitor(struct ath_hw ++ ofdmPhyErrRate < ah->config.ofdm_trig_low) { ++ ath9k_hw_ani_lower_immunity(ah); ++ aniState->ofdmsTurn = !aniState->ofdmsTurn; +++ ath9k_ani_restart(ah); ++ } else if (ofdmPhyErrRate > ah->config.ofdm_trig_high) { ++ ath9k_hw_ani_ofdm_err_trigger(ah); ++ aniState->ofdmsTurn = false; +++ ath9k_ani_restart(ah); ++ } else if (cckPhyErrRate > ah->config.cck_trig_high) { ++ ath9k_hw_ani_cck_err_trigger(ah); ++ aniState->ofdmsTurn = true; +++ ath9k_ani_restart(ah); + } -+ } -+ -+@@ -749,7 +741,7 @@ static u32 ath_lookup_rate(struct ath_so -+ struct ieee80211_tx_rate *rates; -+ u32 max_4ms_framelen, frmlen; -+ u16 aggr_limit, bt_aggr_limit, legacy = 0; -+- int q = tid->ac->txq->mac80211_qnum; -++ int q = tid->txq->mac80211_qnum; -+ int i; -+ -+ skb = bf->bf_mpdu; -+@@ -1486,8 +1478,8 @@ static bool ath_tx_sched_aggr(struct ath -+ if (list_empty(&bf_q)) -+ return false; -+ -+- if (tid->ac->clear_ps_filter || tid->an->no_ps_filter) { -+- tid->ac->clear_ps_filter = false; -++ if (tid->clear_ps_filter || tid->an->no_ps_filter) { -++ tid->clear_ps_filter = false; -+ tx_info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT; -+ } -+ -+@@ -1506,7 +1498,7 @@ int ath_tx_aggr_start(struct ath_softc * -+ -+ an = (struct ath_node *)sta->drv_priv; -+ txtid = ATH_AN_2_TID(an, tid); -+- txq = txtid->ac->txq; -++ txq = txtid->txq; -+ -+ ath_txq_lock(sc, txq); -+ -+@@ -1540,7 +1532,7 @@ void ath_tx_aggr_stop(struct ath_softc * -+ { -+ struct ath_node *an = (struct ath_node *)sta->drv_priv; -+ struct ath_atx_tid *txtid = ATH_AN_2_TID(an, tid); -+- struct ath_txq *txq = txtid->ac->txq; -++ struct ath_txq *txq = txtid->txq; -+ -+ ath_txq_lock(sc, txq); -+ txtid->active = false; -+@@ -1553,7 +1545,6 @@ void ath_tx_aggr_sleep(struct ieee80211_ -+ struct ath_node *an) -+ { -+ struct ath_atx_tid *tid; -+- struct ath_atx_ac *ac; -+ struct ath_txq *txq; -+ bool buffered; -+ int tidno; -+@@ -1561,8 +1552,7 @@ void ath_tx_aggr_sleep(struct ieee80211_ -+ for (tidno = 0, tid = &an->tid[tidno]; -+ tidno < IEEE80211_NUM_TIDS; tidno++, tid++) { -+ -+- ac = tid->ac; -+- txq = ac->txq; -++ txq = tid->txq; -+ -+ ath_txq_lock(sc, txq); -+ -+@@ -1576,11 +1566,6 @@ void ath_tx_aggr_sleep(struct ieee80211_ -+ tid->sched = false; -+ list_del(&tid->list); -+ -+- if (ac->sched) { -+- ac->sched = false; -+- list_del(&ac->list); -+- } -+- -+ ath_txq_unlock(sc, txq); -+ -+ ieee80211_sta_set_buffered(sta, tidno, buffered); -+@@ -1590,18 +1575,16 @@ void ath_tx_aggr_sleep(struct ieee80211_ -+ void ath_tx_aggr_wakeup(struct ath_softc *sc, struct ath_node *an) -+ { -+ struct ath_atx_tid *tid; -+- struct ath_atx_ac *ac; -+ struct ath_txq *txq; -+ int tidno; -+ -+ for (tidno = 0, tid = &an->tid[tidno]; -+ tidno < IEEE80211_NUM_TIDS; tidno++, tid++) { -+ -+- ac = tid->ac; -+- txq = ac->txq; -++ txq = tid->txq; -+ -+ ath_txq_lock(sc, txq); -+- ac->clear_ps_filter = true; -++ tid->clear_ps_filter = true; -+ -+ if (ath_tid_has_buffered(tid)) { -+ ath_tx_queue_tid(sc, txq, tid); -+@@ -1621,7 +1604,7 @@ void ath_tx_aggr_resume(struct ath_softc -+ -+ an = (struct ath_node *)sta->drv_priv; -+ tid = ATH_AN_2_TID(an, tidno); -+- txq = tid->ac->txq; -++ txq = tid->txq; -+ -+ ath_txq_lock(sc, txq); -+ -+@@ -1660,7 +1643,7 @@ void ath9k_release_buffered_frames(struc -+ -+ tid = ATH_AN_2_TID(an, i); -+ -+- ath_txq_lock(sc, tid->ac->txq); -++ ath_txq_lock(sc, tid->txq); -+ while (nframes > 0) { -+ bf = ath_tx_get_tid_subframe(sc, sc->tx.uapsdq, tid, &tid_q); -+ if (!bf) -+@@ -1684,7 +1667,7 @@ void ath9k_release_buffered_frames(struc -+ if (an->sta && !ath_tid_has_buffered(tid)) -+ ieee80211_sta_set_buffered(an->sta, i, false); -+ } -+- ath_txq_unlock_complete(sc, tid->ac->txq); -++ ath_txq_unlock_complete(sc, tid->txq); -+ } -+ -+ if (list_empty(&bf_q)) -+@@ -1933,9 +1916,8 @@ void ath_tx_cleanupq(struct ath_softc *s -+ void ath_txq_schedule(struct ath_softc *sc, struct ath_txq *txq) -+ { -+ struct ath_common *common = ath9k_hw_common(sc->sc_ah); -+- struct ath_atx_ac *ac, *last_ac; -+ struct ath_atx_tid *tid, *last_tid; -+- struct list_head *ac_list; -++ struct list_head *tid_list; -+ bool sent = false; -+ -+ if (txq->mac80211_qnum < 0) -+@@ -1945,63 +1927,46 @@ void ath_txq_schedule(struct ath_softc * -+ return; -+ -+ spin_lock_bh(&sc->chan_lock); -+- ac_list = &sc->cur_chan->acq[txq->mac80211_qnum]; -++ tid_list = &sc->cur_chan->acq[txq->mac80211_qnum]; -+ -+- if (list_empty(ac_list)) { -++ if (list_empty(tid_list)) { -+ spin_unlock_bh(&sc->chan_lock); -+ return; -+ } -+ -+ rcu_read_lock(); -+ -+- last_ac = list_entry(ac_list->prev, struct ath_atx_ac, list); -+- while (!list_empty(ac_list)) { -++ last_tid = list_entry(tid_list->prev, struct ath_atx_tid, list); -++ while (!list_empty(tid_list)) { -+ bool stop = false; -+ -+ if (sc->cur_chan->stopped) -+ break; -+ -+- ac = list_first_entry(ac_list, struct ath_atx_ac, list); -+- last_tid = list_entry(ac->tid_q.prev, struct ath_atx_tid, list); -+- list_del(&ac->list); -+- ac->sched = false; -+- -+- while (!list_empty(&ac->tid_q)) { -+- -+- tid = list_first_entry(&ac->tid_q, struct ath_atx_tid, -+- list); -+- list_del(&tid->list); -+- tid->sched = false; -+- -+- if (ath_tx_sched_aggr(sc, txq, tid, &stop)) -+- sent = true; -+- -+- /* -+- * add tid to round-robin queue if more frames -+- * are pending for the tid -+- */ -+- if (ath_tid_has_buffered(tid)) -+- ath_tx_queue_tid(sc, txq, tid); -++ tid = list_first_entry(tid_list, struct ath_atx_tid, list); -++ list_del(&tid->list); -++ tid->sched = false; -+ -+- if (stop || tid == last_tid) -+- break; -+- } -++ if (ath_tx_sched_aggr(sc, txq, tid, &stop)) -++ sent = true; -+ -+- if (!list_empty(&ac->tid_q) && !ac->sched) { -+- ac->sched = true; -+- list_add_tail(&ac->list, ac_list); -+- } -++ /* -++ * add tid to round-robin queue if more frames -++ * are pending for the tid -++ */ -++ if (ath_tid_has_buffered(tid)) -++ ath_tx_queue_tid(sc, txq, tid); -+ -+ if (stop) -+ break; -+ -+- if (ac == last_ac) { -++ if (tid == last_tid) { -+ if (!sent) -+ break; -+ -+ sent = false; -+- last_ac = list_entry(ac_list->prev, -+- struct ath_atx_ac, list); -++ last_tid = list_entry(tid_list->prev, -++ struct ath_atx_tid, list); -+ } -+ } -+ -+@@ -2391,10 +2356,10 @@ int ath_tx_start(struct ieee80211_hw *hw -+ txq = sc->tx.uapsdq; -+ ath_txq_lock(sc, txq); -+ } else if (txctl->an && queue) { -+- WARN_ON(tid->ac->txq != txctl->txq); -++ WARN_ON(tid->txq != txctl->txq); -+ -+ if (info->flags & IEEE80211_TX_CTL_CLEAR_PS_FILT) -+- tid->ac->clear_ps_filter = true; -++ tid->clear_ps_filter = true; -+ -+ /* -+ * Add this frame to software queue for scheduling later -+@@ -2888,7 +2853,6 @@ int ath_tx_init(struct ath_softc *sc, in -+ void ath_tx_node_init(struct ath_softc *sc, struct ath_node *an) -+ { -+ struct ath_atx_tid *tid; -+- struct ath_atx_ac *ac; -+ int tidno, acno; -+ -+ for (tidno = 0, tid = &an->tid[tidno]; -+@@ -2901,24 +2865,16 @@ void ath_tx_node_init(struct ath_softc * -+ tid->baw_head = tid->baw_tail = 0; -+ tid->sched = false; -+ tid->active = false; -++ tid->clear_ps_filter = true; -+ __skb_queue_head_init(&tid->buf_q); -+ __skb_queue_head_init(&tid->retry_q); -+ acno = TID_TO_WME_AC(tidno); -+- tid->ac = &an->ac[acno]; -+- } -+- -+- for (acno = 0, ac = &an->ac[acno]; -+- acno < IEEE80211_NUM_ACS; acno++, ac++) { -+- ac->sched = false; -+- ac->clear_ps_filter = true; -+- ac->txq = sc->tx.txq_map[acno]; -+- INIT_LIST_HEAD(&ac->tid_q); -++ tid->txq = sc->tx.txq_map[acno]; ++- ath9k_ani_restart(ah); + } + } -+ -+ void ath_tx_node_cleanup(struct ath_softc *sc, struct ath_node *an) -+ { -+- struct ath_atx_ac *ac; -+ struct ath_atx_tid *tid; -+ struct ath_txq *txq; -+ int tidno; -+@@ -2926,8 +2882,7 @@ void ath_tx_node_cleanup(struct ath_soft -+ for (tidno = 0, tid = &an->tid[tidno]; -+ tidno < IEEE80211_NUM_TIDS; tidno++, tid++) { -+ -+- ac = tid->ac; -+- txq = ac->txq; -++ txq = tid->txq; -+ -+ ath_txq_lock(sc, txq); -+ -+@@ -2936,11 +2891,6 @@ void ath_tx_node_cleanup(struct ath_soft -+ tid->sched = false; -+ } -+ -+- if (ac->sched) { -+- list_del(&ac->list); -+- tid->ac->sched = false; -+- } -+- -+ ath_tid_drain(sc, txq, tid); -+ tid->active = false; -+ ++ EXPORT_SYMBOL(ath9k_hw_ani_monitor); diff --git a/package/kernel/mac80211/patches/305-ath5k-channel-change-fix.patch b/package/kernel/mac80211/patches/305-ath5k-channel-change-fix.patch deleted file mode 100644 index 4cfa53f..0000000 @@ -8545,102 +9135,103 @@ index 4cfa53f..0000000 - mode = channel->hw_value; - switch (mode) { - case AR5K_MODE_11A: -diff --git a/package/kernel/mac80211/patches/305-ath9k-remove-the-sched-field-in-struct-ath_atx_tid.patch b/package/kernel/mac80211/patches/305-ath9k-remove-the-sched-field-in-struct-ath_atx_tid.patch +diff --git a/package/kernel/mac80211/patches/305-ath9k-clean-up-ANI-per-channel-pointer-checking.patch b/package/kernel/mac80211/patches/305-ath9k-clean-up-ANI-per-channel-pointer-checking.patch new file mode 100644 -index 0000000..ec860dc +index 0000000..a1ac67c --- /dev/null -+++ b/package/kernel/mac80211/patches/305-ath9k-remove-the-sched-field-in-struct-ath_atx_tid.patch -@@ -0,0 +1,90 @@ -+From: Felix Fietkau -+Date: Sat, 4 Apr 2015 18:42:33 +0200 -+Subject: [PATCH] ath9k: remove the sched field in struct ath_atx_tid ++++ b/package/kernel/mac80211/patches/305-ath9k-clean-up-ANI-per-channel-pointer-checking.patch +@@ -0,0 +1,91 @@ ++From: Miaoqing Pan ++Date: Fri, 15 Jan 2016 18:17:18 +0800 ++Subject: [PATCH] ath9k: clean up ANI per-channel pointer checking + -+Use list_empty(&tid->list) instead ++commit c24bd3620c50 ("ath9k: Do not maintain ANI state per-channel") ++removed per-channel handling, the code to check 'curchan' also ++should be removed as never used. + -+Signed-off-by: Felix Fietkau ++Signed-off-by: Miaoqing Pan +--- + -+--- a/drivers/net/wireless/ath/ath9k/ath9k.h -++++ b/drivers/net/wireless/ath/ath9k/ath9k.h -+@@ -245,7 +245,6 @@ struct ath_atx_tid { -+ int baw_tail; /* next unused tx buffer slot */ ++--- a/drivers/net/wireless/ath/ath9k/ani.c +++++ b/drivers/net/wireless/ath/ath9k/ani.c ++@@ -126,12 +126,8 @@ static void ath9k_hw_update_mibstats(str + -+ s8 bar_index; -+- bool sched; -+ bool active; -+ bool clear_ps_filter; -+ }; -+--- a/drivers/net/wireless/ath/ath9k/xmit.c -++++ b/drivers/net/wireless/ath/ath9k/xmit.c -+@@ -113,12 +113,9 @@ static void ath_tx_queue_tid(struct ath_ -+ if (!ctx) -+ return; ++ static void ath9k_ani_restart(struct ath_hw *ah) ++ { ++- struct ar5416AniState *aniState; ++- ++- if (!ah->curchan) ++- return; +++ struct ar5416AniState *aniState = &ah->ani; + -+- if (tid->sched) ++- aniState = &ah->ani; ++ aniState->listenTime = 0; ++ ++ ENABLE_REGWRITE_BUFFER(ah); ++@@ -221,12 +217,7 @@ static void ath9k_hw_set_ofdm_nil(struct ++ ++ static void ath9k_hw_ani_ofdm_err_trigger(struct ath_hw *ah) ++ { ++- struct ar5416AniState *aniState; ++- ++- if (!ah->curchan) +- return; +- -+- tid->sched = true; -+ list = &ctx->acq[TID_TO_WME_AC(tid->tidno)]; -+- list_add_tail(&tid->list, list); -++ if (list_empty(&tid->list)) -++ list_add_tail(&tid->list, list); -+ } ++- aniState = &ah->ani; +++ struct ar5416AniState *aniState = &ah->ani; + -+ static struct ath_frame_info *get_frame_info(struct sk_buff *skb) -+@@ -1556,15 +1553,14 @@ void ath_tx_aggr_sleep(struct ieee80211_ ++ if (aniState->ofdmNoiseImmunityLevel < ATH9K_ANI_OFDM_MAX_LEVEL) ++ ath9k_hw_set_ofdm_nil(ah, aniState->ofdmNoiseImmunityLevel + 1, false); ++@@ -281,12 +272,7 @@ static void ath9k_hw_set_cck_nil(struct + -+ ath_txq_lock(sc, txq); ++ static void ath9k_hw_ani_cck_err_trigger(struct ath_hw *ah) ++ { ++- struct ar5416AniState *aniState; ++- ++- if (!ah->curchan) ++- return; ++- ++- aniState = &ah->ani; +++ struct ar5416AniState *aniState = &ah->ani; + -+- if (!tid->sched) { -++ if (list_empty(&tid->list)) { -+ ath_txq_unlock(sc, txq); -+ continue; -+ } ++ if (aniState->cckNoiseImmunityLevel < ATH9K_ANI_CCK_MAX_LEVEL) ++ ath9k_hw_set_cck_nil(ah, aniState->cckNoiseImmunityLevel + 1, ++@@ -299,9 +285,7 @@ static void ath9k_hw_ani_cck_err_trigger ++ */ ++ static void ath9k_hw_ani_lower_immunity(struct ath_hw *ah) ++ { ++- struct ar5416AniState *aniState; ++- ++- aniState = &ah->ani; +++ struct ar5416AniState *aniState = &ah->ani; + -+ buffered = ath_tid_has_buffered(tid); ++ /* lower OFDM noise immunity */ ++ if (aniState->ofdmNoiseImmunityLevel > 0 && ++@@ -329,7 +313,7 @@ void ath9k_ani_reset(struct ath_hw *ah, ++ struct ath_common *common = ath9k_hw_common(ah); ++ int ofdm_nil, cck_nil; + -+- tid->sched = false; -+- list_del(&tid->list); -++ list_del_init(&tid->list); ++- if (!ah->curchan) +++ if (!chan) ++ return; + -+ ath_txq_unlock(sc, txq); ++ BUG_ON(aniState == NULL); ++@@ -416,14 +400,10 @@ static bool ath9k_hw_ani_read_counters(s + -+@@ -1944,8 +1940,7 @@ void ath_txq_schedule(struct ath_softc * -+ break; ++ void ath9k_hw_ani_monitor(struct ath_hw *ah, struct ath9k_channel *chan) ++ { ++- struct ar5416AniState *aniState; +++ struct ar5416AniState *aniState = &ah->ani; ++ struct ath_common *common = ath9k_hw_common(ah); ++ u32 ofdmPhyErrRate, cckPhyErrRate; + -+ tid = list_first_entry(tid_list, struct ath_atx_tid, list); -+- list_del(&tid->list); -+- tid->sched = false; -++ list_del_init(&tid->list); ++- if (!ah->curchan) ++- return; ++- ++- aniState = &ah->ani; ++ if (!ath9k_hw_ani_read_counters(ah)) ++ return; + -+ if (ath_tx_sched_aggr(sc, txq, tid, &stop)) -+ sent = true; -+@@ -2863,11 +2858,11 @@ void ath_tx_node_init(struct ath_softc * -+ tid->seq_start = tid->seq_next = 0; -+ tid->baw_size = WME_MAX_BA; -+ tid->baw_head = tid->baw_tail = 0; -+- tid->sched = false; -+ tid->active = false; -+ tid->clear_ps_filter = true; -+ __skb_queue_head_init(&tid->buf_q); -+ __skb_queue_head_init(&tid->retry_q); -++ INIT_LIST_HEAD(&tid->list); -+ acno = TID_TO_WME_AC(tidno); -+ tid->txq = sc->tx.txq_map[acno]; -+ } -+@@ -2886,10 +2881,8 @@ void ath_tx_node_cleanup(struct ath_soft -+ -+ ath_txq_lock(sc, txq); -+ -+- if (tid->sched) { -+- list_del(&tid->list); -+- tid->sched = false; -+- } -++ if (!list_empty(&tid->list)) -++ list_del_init(&tid->list); -+ -+ ath_tid_drain(sc, txq, tid); -+ tid->active = false; diff --git a/package/kernel/mac80211/patches/306-ath5k-fix-reset-race.patch b/package/kernel/mac80211/patches/306-ath5k-fix-reset-race.patch deleted file mode 100644 index 85a1904..0000000 @@ -8743,173 +9334,76 @@ index 85a1904..0000000 - ath5k_beacon_config(ah); - /* intrs are enabled by ath5k_beacon_config */ - -diff --git a/package/kernel/mac80211/patches/306-mac80211-Deinline-rate_control_rate_init-rate_contro.patch b/package/kernel/mac80211/patches/306-mac80211-Deinline-rate_control_rate_init-rate_contro.patch +diff --git a/package/kernel/mac80211/patches/306-ath9k-do-not-reset-while-BB-panic-0x4000409-on-ar956.patch b/package/kernel/mac80211/patches/306-ath9k-do-not-reset-while-BB-panic-0x4000409-on-ar956.patch new file mode 100644 -index 0000000..928c93b +index 0000000..cf8194a --- /dev/null -+++ b/package/kernel/mac80211/patches/306-mac80211-Deinline-rate_control_rate_init-rate_contro.patch -@@ -0,0 +1,161 @@ -+From: Denys Vlasenko -+Date: Wed, 15 Jul 2015 14:56:06 +0200 -+Subject: [PATCH] mac80211: Deinline rate_control_rate_init, -+ rate_control_rate_update ++++ b/package/kernel/mac80211/patches/306-ath9k-do-not-reset-while-BB-panic-0x4000409-on-ar956.patch +@@ -0,0 +1,31 @@ ++From: Miaoqing Pan ++Date: Fri, 15 Jan 2016 18:17:19 +0800 ++Subject: [PATCH] ath9k: do not reset while BB panic(0x4000409) on ar9561 + -+With this .config: http://busybox.net/~vda/kernel_config, -+after deinlining these functions have sizes and callsite counts -+as follows: ++BB panic(0x4000409) observed while AP enabling/disabling ++bursting. + -+rate_control_rate_init: 554 bytes, 8 calls -+rate_control_rate_update: 1596 bytes, 5 calls -+ -+Total size reduction: about 11 kbytes. -+ -+Signed-off-by: Denys Vlasenko -+CC: John Linville -+CC: Michal Kazior -+CC: Johannes Berg -+Cc: linux-wireless@vger.kernel.org -+Cc: netdev@vger.kernel.org -+CC: linux-kernel@vger.kernel.org ++Signed-off-by: Miaoqing Pan +--- + -+--- a/net/mac80211/rate.c -++++ b/net/mac80211/rate.c -+@@ -29,6 +29,65 @@ module_param(ieee80211_default_rc_algo, -+ MODULE_PARM_DESC(ieee80211_default_rc_algo, -+ "Default rate control algorithm for mac80211 to use"); ++--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c +++++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c ++@@ -2071,7 +2071,8 @@ void ar9003_hw_attach_phy_ops(struct ath ++ * to be disabled. ++ * ++ * 0x04000409: Packet stuck on receive. ++- * Full chip reset is required for all chips except AR9340. +++ * Full chip reset is required for all chips except +++ * AR9340, AR9531 and AR9561. ++ */ + -++void rate_control_rate_init(struct sta_info *sta) -++{ -++ struct ieee80211_local *local = sta->sdata->local; -++ struct rate_control_ref *ref = sta->rate_ctrl; -++ struct ieee80211_sta *ista = &sta->sta; -++ void *priv_sta = sta->rate_ctrl_priv; -++ struct ieee80211_supported_band *sband; -++ struct ieee80211_chanctx_conf *chanctx_conf; -++ -++ ieee80211_sta_set_rx_nss(sta); -++ -++ if (!ref) -++ return; -++ -++ rcu_read_lock(); -++ -++ chanctx_conf = rcu_dereference(sta->sdata->vif.chanctx_conf); -++ if (WARN_ON(!chanctx_conf)) { -++ rcu_read_unlock(); -++ return; -++ } -++ -++ sband = local->hw.wiphy->bands[chanctx_conf->def.chan->band]; -++ -++ spin_lock_bh(&sta->rate_ctrl_lock); -++ ref->ops->rate_init(ref->priv, sband, &chanctx_conf->def, ista, -++ priv_sta); -++ spin_unlock_bh(&sta->rate_ctrl_lock); -++ rcu_read_unlock(); -++ set_sta_flag(sta, WLAN_STA_RATE_CONTROL); -++} -++ -++void rate_control_rate_update(struct ieee80211_local *local, -++ struct ieee80211_supported_band *sband, -++ struct sta_info *sta, u32 changed) -++{ -++ struct rate_control_ref *ref = local->rate_ctrl; -++ struct ieee80211_sta *ista = &sta->sta; -++ void *priv_sta = sta->rate_ctrl_priv; -++ struct ieee80211_chanctx_conf *chanctx_conf; -++ -++ if (ref && ref->ops->rate_update) { -++ rcu_read_lock(); -++ -++ chanctx_conf = rcu_dereference(sta->sdata->vif.chanctx_conf); -++ if (WARN_ON(!chanctx_conf)) { -++ rcu_read_unlock(); -++ return; -++ } -++ -++ spin_lock_bh(&sta->rate_ctrl_lock); -++ ref->ops->rate_update(ref->priv, sband, &chanctx_conf->def, -++ ista, priv_sta, changed); -++ spin_unlock_bh(&sta->rate_ctrl_lock); -++ rcu_read_unlock(); -++ } -++ drv_sta_rc_update(local, sta->sdata, &sta->sta, changed); -++} -++ -+ int ieee80211_rate_control_register(const struct rate_control_ops *ops) -+ { -+ struct rate_control_alg *alg; -+--- a/net/mac80211/rate.h -++++ b/net/mac80211/rate.h -+@@ -71,64 +71,10 @@ rate_control_tx_status_noskb(struct ieee -+ spin_unlock_bh(&sta->rate_ctrl_lock); -+ } -+ -+-static inline void rate_control_rate_init(struct sta_info *sta) -+-{ -+- struct ieee80211_local *local = sta->sdata->local; -+- struct rate_control_ref *ref = sta->rate_ctrl; -+- struct ieee80211_sta *ista = &sta->sta; -+- void *priv_sta = sta->rate_ctrl_priv; -+- struct ieee80211_supported_band *sband; -+- struct ieee80211_chanctx_conf *chanctx_conf; -+- -+- ieee80211_sta_set_rx_nss(sta); -+- -+- if (!ref) -+- return; -+- -+- rcu_read_lock(); -+- -+- chanctx_conf = rcu_dereference(sta->sdata->vif.chanctx_conf); -+- if (WARN_ON(!chanctx_conf)) { -+- rcu_read_unlock(); -+- return; -+- } -+- -+- sband = local->hw.wiphy->bands[chanctx_conf->def.chan->band]; -+- -+- spin_lock_bh(&sta->rate_ctrl_lock); -+- ref->ops->rate_init(ref->priv, sband, &chanctx_conf->def, ista, -+- priv_sta); -+- spin_unlock_bh(&sta->rate_ctrl_lock); -+- rcu_read_unlock(); -+- set_sta_flag(sta, WLAN_STA_RATE_CONTROL); -+-} -+- -+-static inline void rate_control_rate_update(struct ieee80211_local *local, -++void rate_control_rate_init(struct sta_info *sta); -++void rate_control_rate_update(struct ieee80211_local *local, -+ struct ieee80211_supported_band *sband, -+- struct sta_info *sta, u32 changed) -+-{ -+- struct rate_control_ref *ref = local->rate_ctrl; -+- struct ieee80211_sta *ista = &sta->sta; -+- void *priv_sta = sta->rate_ctrl_priv; -+- struct ieee80211_chanctx_conf *chanctx_conf; -+- -+- if (ref && ref->ops->rate_update) { -+- rcu_read_lock(); -+- -+- chanctx_conf = rcu_dereference(sta->sdata->vif.chanctx_conf); -+- if (WARN_ON(!chanctx_conf)) { -+- rcu_read_unlock(); -+- return; -+- } -+- -+- spin_lock_bh(&sta->rate_ctrl_lock); -+- ref->ops->rate_update(ref->priv, sband, &chanctx_conf->def, -+- ista, priv_sta, changed); -+- spin_unlock_bh(&sta->rate_ctrl_lock); -+- rcu_read_unlock(); -+- } -+- drv_sta_rc_update(local, sta->sdata, &sta->sta, changed); -+-} -++ struct sta_info *sta, u32 changed); -+ -+ static inline void *rate_control_alloc_sta(struct rate_control_ref *ref, -+ struct sta_info *sta, gfp_t gfp) ++ /* ++@@ -2100,7 +2101,7 @@ bool ar9003_hw_bb_watchdog_check(struct ++ case 0x04000b09: ++ return true; ++ case 0x04000409: ++- if (AR_SREV_9340(ah) || AR_SREV_9531(ah)) +++ if (AR_SREV_9340(ah) || AR_SREV_9531(ah) || AR_SREV_9561(ah)) ++ return false; ++ else ++ return true; +diff --git a/package/kernel/mac80211/patches/307-ath9k-fix-inconsistent-use-of-tab-and-space-in-inden.patch b/package/kernel/mac80211/patches/307-ath9k-fix-inconsistent-use-of-tab-and-space-in-inden.patch +new file mode 100644 +index 0000000..80b781c +--- /dev/null ++++ b/package/kernel/mac80211/patches/307-ath9k-fix-inconsistent-use-of-tab-and-space-in-inden.patch +@@ -0,0 +1,27 @@ ++From: Miaoqing Pan ++Date: Fri, 15 Jan 2016 18:17:20 +0800 ++Subject: [PATCH] ath9k: fix inconsistent use of tab and space in ++ indentation ++ ++Minor changes for indenting. ++ ++Signed-off-by: Miaoqing Pan ++--- ++ ++--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +++++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c ++@@ -5485,11 +5485,11 @@ unsigned int ar9003_get_paprd_scale_fact ++ AR9300_PAPRD_SCALE_1); ++ else { ++ if (chan->channel >= 5700) ++- return MS(le32_to_cpu(eep->modalHeader5G.papdRateMaskHt20), ++- AR9300_PAPRD_SCALE_1); +++ return MS(le32_to_cpu(eep->modalHeader5G.papdRateMaskHt20), +++ AR9300_PAPRD_SCALE_1); ++ else if (chan->channel >= 5400) ++ return MS(le32_to_cpu(eep->modalHeader5G.papdRateMaskHt40), ++- AR9300_PAPRD_SCALE_2); +++ AR9300_PAPRD_SCALE_2); ++ else ++ return MS(le32_to_cpu(eep->modalHeader5G.papdRateMaskHt40), ++ AR9300_PAPRD_SCALE_1); diff --git a/package/kernel/mac80211/patches/307-ath9k-fix-tracking-of-enabled-AP-beacons.patch b/package/kernel/mac80211/patches/307-ath9k-fix-tracking-of-enabled-AP-beacons.patch deleted file mode 100644 index ab9771e..0000000 @@ -8992,164 +9486,77 @@ index ab9771e..0000000 - bool ibss_creator; - u32 nexttbtt; - u32 intval; -diff --git a/package/kernel/mac80211/patches/307-mac80211-Deinline-drv_sta_state.patch b/package/kernel/mac80211/patches/307-mac80211-Deinline-drv_sta_state.patch +diff --git a/package/kernel/mac80211/patches/308-ath9k-fix-data-bus-error-on-ar9300-and-ar9580.patch b/package/kernel/mac80211/patches/308-ath9k-fix-data-bus-error-on-ar9300-and-ar9580.patch new file mode 100644 -index 0000000..474c409 +index 0000000..d408866 --- /dev/null -+++ b/package/kernel/mac80211/patches/307-mac80211-Deinline-drv_sta_state.patch -@@ -0,0 +1,116 @@ -+From: Denys Vlasenko -+Date: Wed, 15 Jul 2015 14:56:05 +0200 -+Subject: [PATCH] mac80211: Deinline drv_sta_state ++++ b/package/kernel/mac80211/patches/308-ath9k-fix-data-bus-error-on-ar9300-and-ar9580.patch +@@ -0,0 +1,65 @@ ++From: Miaoqing Pan ++Date: Fri, 15 Jan 2016 18:17:21 +0800 ++Subject: [PATCH] ath9k: fix data bus error on ar9300 and ar9580 + -+With this .config: http://busybox.net/~vda/kernel_config, -+after deinlining the function size is 3132 bytes and there are -+7 callsites. ++One crash issue be found on ar9300: RTC_RC reg read leads crash, leading ++the data bus error, due to RTC_RC reg write not happen properly. + -+Total size reduction: about 20 kbytes. ++Warm Reset trigger in continuous beacon stuck for one of the customer for ++other chip, noticed the MAC was stuck in RTC reset. After analysis noticed ++DMA did not complete when RTC was put in reset. + -+Signed-off-by: Denys Vlasenko -+CC: John Linville -+CC: Michal Kazior -+Cc: Johannes Berg -+Cc: linux-wireless@vger.kernel.org -+Cc: netdev@vger.kernel.org -+CC: linux-kernel@vger.kernel.org ++So, before resetting the MAC need to make sure there are no pending DMA ++transactions because this reset does not reset all parts of the chip. ++ ++The 12th and 11th bit of MAC _DMA_CFG register used to do that. ++ 12 cfg_halt_ack 0x0 ++ 0 DMA has not yet halted ++ 1 DMA has halted ++ 11 cfg_halt_req 0x0 ++ 0 DMA logic operates normally ++ 1 Request DMA logic to stop so software can reset the MAC ++ ++The Bit [12] of this register indicates when the halt has taken effect or ++not. the DMA halt IS NOT recoverable; once software sets bit [11] to ++request a DMA halt, software must wait for bit [12] to be set and reset ++the MAC. ++ ++So, the same thing we implemented for ar9580 chip. ++ ++Signed-off-by: Miaoqing Pan +--- -+ create mode 100644 net/mac80211/driver-ops.c + -+--- a/net/mac80211/Makefile -++++ b/net/mac80211/Makefile -+@@ -3,6 +3,7 @@ obj-$(CPTCFG_MAC80211) += mac80211.o -+ # mac80211 objects -+ mac80211-y := \ -+ main.o status.o \ -++ driver-ops.o \ -+ sta_info.o \ -+ wep.o \ -+ wpa.o \ -+--- /dev/null -++++ b/net/mac80211/driver-ops.c -+@@ -0,0 +1,41 @@ -++/* -++ * This program is free software; you can redistribute it and/or modify -++ * it under the terms of the GNU General Public License version 2 as -++ * published by the Free Software Foundation. -++ */ -++#include -++#include "ieee80211_i.h" -++#include "trace.h" -++#include "driver-ops.h" -++ -++__must_check -++int drv_sta_state(struct ieee80211_local *local, -++ struct ieee80211_sub_if_data *sdata, -++ struct sta_info *sta, -++ enum ieee80211_sta_state old_state, -++ enum ieee80211_sta_state new_state) -++{ -++ int ret = 0; -++ -++ might_sleep(); -++ -++ sdata = get_bss_sdata(sdata); -++ if (!check_sdata_in_driver(sdata)) -++ return -EIO; -++ -++ trace_drv_sta_state(local, sdata, &sta->sta, old_state, new_state); -++ if (local->ops->sta_state) { -++ ret = local->ops->sta_state(&local->hw, &sdata->vif, &sta->sta, -++ old_state, new_state); -++ } else if (old_state == IEEE80211_STA_AUTH && -++ new_state == IEEE80211_STA_ASSOC) { -++ ret = drv_sta_add(local, sdata, &sta->sta); -++ if (ret == 0) -++ sta->uploaded = true; -++ } else if (old_state == IEEE80211_STA_ASSOC && -++ new_state == IEEE80211_STA_AUTH) { -++ drv_sta_remove(local, sdata, &sta->sta); ++--- a/drivers/net/wireless/ath/ath9k/hw.c +++++ b/drivers/net/wireless/ath/ath9k/hw.c ++@@ -1368,6 +1368,16 @@ static bool ath9k_hw_set_reset(struct at ++ if (ath9k_hw_mci_is_enabled(ah)) ++ ar9003_mci_check_gpm_offset(ah); ++ +++ /* DMA HALT added to resolve ar9300 and ar9580 bus error during +++ * RTC_RC reg read +++ */ +++ if (AR_SREV_9300(ah) || AR_SREV_9580(ah)) { +++ REG_SET_BIT(ah, AR_CFG, AR_CFG_HALT_REQ); +++ ath9k_hw_wait(ah, AR_CFG, AR_CFG_HALT_ACK, AR_CFG_HALT_ACK, +++ 20 * AH_WAIT_TIMEOUT); +++ REG_CLR_BIT(ah, AR_CFG, AR_CFG_HALT_REQ); ++ } -++ trace_drv_return_int(local, ret); -++ return ret; -++} -+--- a/net/mac80211/driver-ops.h -++++ b/net/mac80211/driver-ops.h -+@@ -573,37 +573,12 @@ static inline void drv_sta_pre_rcu_remov -+ trace_drv_return_void(local); -+ } +++ ++ REG_WRITE(ah, AR_RTC_RC, rst_flags); + -+-static inline __must_check -++__must_check -+ int drv_sta_state(struct ieee80211_local *local, -+ struct ieee80211_sub_if_data *sdata, -+ struct sta_info *sta, -+ enum ieee80211_sta_state old_state, -+- enum ieee80211_sta_state new_state) -+-{ -+- int ret = 0; -+- -+- might_sleep(); -+- -+- sdata = get_bss_sdata(sdata); -+- if (!check_sdata_in_driver(sdata)) -+- return -EIO; -+- -+- trace_drv_sta_state(local, sdata, &sta->sta, old_state, new_state); -+- if (local->ops->sta_state) { -+- ret = local->ops->sta_state(&local->hw, &sdata->vif, &sta->sta, -+- old_state, new_state); -+- } else if (old_state == IEEE80211_STA_AUTH && -+- new_state == IEEE80211_STA_ASSOC) { -+- ret = drv_sta_add(local, sdata, &sta->sta); -+- if (ret == 0) -+- sta->uploaded = true; -+- } else if (old_state == IEEE80211_STA_ASSOC && -+- new_state == IEEE80211_STA_AUTH) { -+- drv_sta_remove(local, sdata, &sta->sta); -+- } -+- trace_drv_return_int(local, ret); -+- return ret; -+-} -++ enum ieee80211_sta_state new_state); ++ REGWRITE_BUFFER_FLUSH(ah); ++--- a/drivers/net/wireless/ath/ath9k/reg.h +++++ b/drivers/net/wireless/ath/ath9k/reg.h ++@@ -34,8 +34,10 @@ ++ #define AR_CFG_SWRG 0x00000010 ++ #define AR_CFG_AP_ADHOC_INDICATION 0x00000020 ++ #define AR_CFG_PHOK 0x00000100 ++-#define AR_CFG_CLK_GATE_DIS 0x00000400 ++ #define AR_CFG_EEBS 0x00000200 +++#define AR_CFG_CLK_GATE_DIS 0x00000400 +++#define AR_CFG_HALT_REQ 0x00000800 +++#define AR_CFG_HALT_ACK 0x00001000 ++ #define AR_CFG_PCI_MASTER_REQ_Q_THRESH 0x00060000 ++ #define AR_CFG_PCI_MASTER_REQ_Q_THRESH_S 17 + -+ static inline void drv_sta_rc_update(struct ieee80211_local *local, -+ struct ieee80211_sub_if_data *sdata, -diff --git a/package/kernel/mac80211/patches/308-ath9k-Fix-NF-CCA-limits-for-AR9287-and-AR9227.patch b/package/kernel/mac80211/patches/308-ath9k-Fix-NF-CCA-limits-for-AR9287-and-AR9227.patch -new file mode 100644 -index 0000000..1a3a9d4 ---- /dev/null -+++ b/package/kernel/mac80211/patches/308-ath9k-Fix-NF-CCA-limits-for-AR9287-and-AR9227.patch -@@ -0,0 +1,30 @@ -+From: Martin Blumenstingl -+Date: Wed, 22 Jul 2015 10:42:43 +0200 -+Subject: [PATCH] ath9k: Fix NF CCA limits for AR9287 and AR9227 -+ -+The FreeBSD driver [0] uses the same 2G values as for the AR9280 chips. -+Using the same values in ath9k results in much better throughput for me. -+ -+Before this patch I had a huge amount of packet loss (sometimes up to -+40%) and the max transfer speed was somewhere around 5Mbit/s. With this -+patch applied I have zero packet loss and ten times the throughput. -+My device uses a AR9227 which is the PCI variant of the AR9287. -+ -+[0] http://bxr.su/FreeBSD/sys/dev/ath/ath_hal/ar9002/ar9287.h -+ -+Signed-off-by: Martin Blumenstingl -+--- -+ -+--- a/drivers/net/wireless/ath/ath9k/ar9002_phy.h -++++ b/drivers/net/wireless/ath/ath9k/ar9002_phy.h -+@@ -610,8 +610,8 @@ -+ #define AR_PHY_CCA_MIN_GOOD_VAL_9271_2GHZ -127 -+ #define AR_PHY_CCA_MAX_GOOD_VAL_9271_2GHZ -116 -+ -+-#define AR_PHY_CCA_NOM_VAL_9287_2GHZ -120 -++#define AR_PHY_CCA_NOM_VAL_9287_2GHZ -112 -+ #define AR_PHY_CCA_MIN_GOOD_VAL_9287_2GHZ -127 -+-#define AR_PHY_CCA_MAX_GOOD_VAL_9287_2GHZ -110 -++#define AR_PHY_CCA_MAX_GOOD_VAL_9287_2GHZ -97 -+ -+ #endif diff --git a/package/kernel/mac80211/patches/308-mac80211-minstrel_ht-fix-rounding-issue-in-MCS-durat.patch b/package/kernel/mac80211/patches/308-mac80211-minstrel_ht-fix-rounding-issue-in-MCS-durat.patch deleted file mode 100644 index d132636..0000000 @@ -9227,32 +9634,75 @@ index 945fbce..0000000 - - ah->ani_function = ATH9K_ANI_ALL; - if (!AR_SREV_9300_20_OR_LATER(ah)) -diff --git a/package/kernel/mac80211/patches/309-mac80211-make-local-tx_headroom-a-multiple-of-4.patch b/package/kernel/mac80211/patches/309-mac80211-make-local-tx_headroom-a-multiple-of-4.patch +diff --git a/package/kernel/mac80211/patches/309-brcmfmac-add-missing-include.patch b/package/kernel/mac80211/patches/309-brcmfmac-add-missing-include.patch new file mode 100644 -index 0000000..e8e9617 +index 0000000..d9511c8 --- /dev/null -+++ b/package/kernel/mac80211/patches/309-mac80211-make-local-tx_headroom-a-multiple-of-4.patch -@@ -0,0 +1,20 @@ ++++ b/package/kernel/mac80211/patches/309-brcmfmac-add-missing-include.patch +@@ -0,0 +1,19 @@ +From: Felix Fietkau -+Date: Thu, 30 Jul 2015 14:12:25 +0200 -+Subject: [PATCH] mac80211: make local->tx_headroom a multiple of 4 ++Date: Fri, 15 Jan 2016 15:59:45 +0100 ++Subject: [PATCH] brcmfmac: add missing include + -+This ensures that mac80211 generated management frames and beacons are -+aligned before being passed to the driver ++linux/module.h is required for defining module parameters + +Signed-off-by: Felix Fietkau +--- + -+--- a/net/mac80211/main.c -++++ b/net/mac80211/main.c -+@@ -1031,6 +1031,7 @@ int ieee80211_register_hw(struct ieee802 -+ */ -+ local->tx_headroom = max_t(unsigned int , local->hw.extra_tx_headroom, -+ IEEE80211_TX_STATUS_HEADROOM); -++ local->tx_headroom = ALIGN(local->tx_headroom, 4); -+ -+ debugfs_hw_add(local); ++--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c +++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c ++@@ -17,6 +17,7 @@ ++ #include ++ #include ++ #include +++#include ++ #include ++ #include ++ #include "core.h" +diff --git a/package/kernel/mac80211/patches/310-ath9k_hw-ignore-eeprom-magic-mismatch-on-flash-based.patch b/package/kernel/mac80211/patches/310-ath9k_hw-ignore-eeprom-magic-mismatch-on-flash-based.patch +new file mode 100644 +index 0000000..287d6e1 +--- /dev/null ++++ b/package/kernel/mac80211/patches/310-ath9k_hw-ignore-eeprom-magic-mismatch-on-flash-based.patch +@@ -0,0 +1,38 @@ ++From: Felix Fietkau ++Date: Thu, 21 Jan 2016 16:28:44 +0100 ++Subject: [PATCH] ath9k_hw: ignore eeprom magic mismatch on flash based devices ++ ++Many AR913x based devices (maybe others too) do not have a valid EEPROM ++magic in their calibration data partition. ++ ++Fixes: 6fa658fd5ab2 ("ath9k: Simplify and fix eeprom endianness swapping") ++Signed-off-by: Felix Fietkau ++--- ++ ++--- a/drivers/net/wireless/ath/ath9k/eeprom.c +++++ b/drivers/net/wireless/ath/ath9k/eeprom.c ++@@ -150,18 +150,18 @@ int ath9k_hw_nvram_swap_data(struct ath_ ++ return -EIO; ++ } + ++- if (magic == AR5416_EEPROM_MAGIC) { ++- *swap_needed = false; ++- } else if (swab16(magic) == AR5416_EEPROM_MAGIC) { +++ *swap_needed = false; +++ if (swab16(magic) == AR5416_EEPROM_MAGIC) { ++ if (ah->ah_flags & AH_NO_EEP_SWAP) { ++ ath_info(common, ++ "Ignoring endianness difference in EEPROM magic bytes.\n"); ++- ++- *swap_needed = false; ++ } else { ++ *swap_needed = true; ++ } ++- } else { +++ } else if (magic != AR5416_EEPROM_MAGIC) { +++ if (ath9k_hw_use_flash(ah)) +++ return 0; +++ ++ ath_err(common, ++ "Invalid EEPROM Magic (0x%04x).\n", magic); ++ return -EINVAL; diff --git a/package/kernel/mac80211/patches/310-mac80211-don-t-look-up-stations-for-multicast-addres.patch b/package/kernel/mac80211/patches/310-mac80211-don-t-look-up-stations-for-multicast-addres.patch deleted file mode 100644 index bd3050e..0000000 @@ -9280,97 +9730,67 @@ index bd3050e..0000000 - tx->sta = sta_info_get(sdata, hdr->addr1); - - if (tx->sta && ieee80211_is_data_qos(hdr->frame_control) && -diff --git a/package/kernel/mac80211/patches/310-mac80211-fix-invalid-read-in-minstrel_sort_best_tp_r.patch b/package/kernel/mac80211/patches/310-mac80211-fix-invalid-read-in-minstrel_sort_best_tp_r.patch +diff --git a/package/kernel/mac80211/patches/311-ath9k-do-not-limit-the-number-of-DFS-interfaces-to-1.patch b/package/kernel/mac80211/patches/311-ath9k-do-not-limit-the-number-of-DFS-interfaces-to-1.patch new file mode 100644 -index 0000000..51a315c +index 0000000..070efa9 --- /dev/null -+++ b/package/kernel/mac80211/patches/310-mac80211-fix-invalid-read-in-minstrel_sort_best_tp_r.patch -@@ -0,0 +1,34 @@ -+From: Adrien Schildknecht -+Date: Tue, 28 Jul 2015 10:30:16 +0200 -+Subject: [PATCH] mac80211: fix invalid read in minstrel_sort_best_tp_rates() ++++ b/package/kernel/mac80211/patches/311-ath9k-do-not-limit-the-number-of-DFS-interfaces-to-1.patch +@@ -0,0 +1,55 @@ ++From: Felix Fietkau ++Date: Fri, 22 Jan 2016 01:05:56 +0100 ++Subject: [PATCH] ath9k: do not limit the number of DFS interfaces to 1 + -+At the last iteration of the loop, j may equal zero and thus -+tp_list[j - 1] causes an invalid read. -+Changed the logic of the loop so that j - 1 is always >= 0. -+ -+Signed-off-by: Adrien Schildknecht ++Signed-off-by: Felix Fietkau +--- + -+--- a/net/mac80211/rc80211_minstrel.c -++++ b/net/mac80211/rc80211_minstrel.c -+@@ -92,14 +92,15 @@ int minstrel_get_tp_avg(struct minstrel_ -+ static inline void -+ minstrel_sort_best_tp_rates(struct minstrel_sta_info *mi, int i, u8 *tp_list) -+ { -+- int j = MAX_THR_RATES; -+- struct minstrel_rate_stats *tmp_mrs = &mi->r[j - 1].stats; -++ int j; -++ struct minstrel_rate_stats *tmp_mrs; -+ struct minstrel_rate_stats *cur_mrs = &mi->r[i].stats; ++--- a/drivers/net/wireless/ath/ath9k/init.c +++++ b/drivers/net/wireless/ath/ath9k/init.c ++@@ -751,14 +751,6 @@ static const struct ieee80211_iface_comb + -+- while (j > 0 && (minstrel_get_tp_avg(&mi->r[i], cur_mrs->prob_ewma) > -+- minstrel_get_tp_avg(&mi->r[tp_list[j - 1]], tmp_mrs->prob_ewma))) { -+- j--; -++ for (j = MAX_THR_RATES; j > 0; --j) { -+ tmp_mrs = &mi->r[tp_list[j - 1]].stats; -++ if (minstrel_get_tp_avg(&mi->r[i], cur_mrs->prob_ewma) <= -++ minstrel_get_tp_avg(&mi->r[tp_list[j - 1]], tmp_mrs->prob_ewma)) -++ break; -+ } ++ #endif /* CPTCFG_ATH9K_CHANNEL_CONTEXT */ + -+ if (j < MAX_THR_RATES - 1) -diff --git a/package/kernel/mac80211/patches/311-brcmfmac-dhd_sdio.c-use-existing-atomic_or-primitive.patch b/package/kernel/mac80211/patches/311-brcmfmac-dhd_sdio.c-use-existing-atomic_or-primitive.patch -new file mode 100644 -index 0000000..e44f121 ---- /dev/null -+++ b/package/kernel/mac80211/patches/311-brcmfmac-dhd_sdio.c-use-existing-atomic_or-primitive.patch -@@ -0,0 +1,45 @@ -+From: Vineet Gupta -+Date: Thu, 9 Jul 2015 13:43:18 +0530 -+Subject: [PATCH] brcmfmac: dhd_sdio.c: use existing atomic_or primitive -+ -+There's already a generic implementation so use that instead. -+ -+Signed-off-by: Kalle Valo -+--- -+ -+--- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c -+@@ -2564,15 +2564,6 @@ static inline void brcmf_sdio_clrintr(st -+ } -+ } -+ -+-static void atomic_orr(int val, atomic_t *v) -+-{ -+- int old_val; ++-static const struct ieee80211_iface_limit if_dfs_limits[] = { ++- { .max = 1, .types = BIT(NL80211_IFTYPE_AP) | ++-#ifdef CPTCFG_MAC80211_MESH ++- BIT(NL80211_IFTYPE_MESH_POINT) | ++-#endif ++- BIT(NL80211_IFTYPE_ADHOC) }, ++-}; +- -+- old_val = atomic_read(v); -+- while (atomic_cmpxchg(v, old_val, val | old_val) != old_val) -+- old_val = atomic_read(v); -+-} -+- -+ static int brcmf_sdio_intr_rstatus(struct brcmf_sdio *bus) -+ { -+ struct brcmf_core *buscore; -+@@ -2595,7 +2586,7 @@ static int brcmf_sdio_intr_rstatus(struc -+ if (val) { -+ brcmf_sdiod_regwl(bus->sdiodev, addr, val, &ret); -+ bus->sdcnt.f1regdata++; -+- atomic_orr(val, &bus->intstatus); -++ atomic_or(val, &bus->intstatus); -+ } -+ -+ return ret; -+@@ -2712,7 +2703,7 @@ static void brcmf_sdio_dpc(struct brcmf_ -+ -+ /* Keep still-pending events for next scheduling */ -+ if (intstatus) -+- atomic_orr(intstatus, &bus->intstatus); -++ atomic_or(intstatus, &bus->intstatus); -+ -+ brcmf_sdio_clrintr(bus); ++ static const struct ieee80211_iface_combination if_comb[] = { ++ { ++ .limits = if_limits, ++@@ -766,6 +758,11 @@ static const struct ieee80211_iface_comb ++ .max_interfaces = 2048, ++ .num_different_channels = 1, ++ .beacon_int_infra_match = true, +++#ifdef CPTCFG_ATH9K_DFS_CERTIFIED +++ .radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) | +++ BIT(NL80211_CHAN_WIDTH_20) | +++ BIT(NL80211_CHAN_WIDTH_40), +++#endif ++ }, ++ { ++ .limits = wds_limits, ++@@ -774,18 +771,6 @@ static const struct ieee80211_iface_comb ++ .num_different_channels = 1, ++ .beacon_int_infra_match = true, ++ }, ++-#ifdef CPTCFG_ATH9K_DFS_CERTIFIED ++- { ++- .limits = if_dfs_limits, ++- .n_limits = ARRAY_SIZE(if_dfs_limits), ++- .max_interfaces = 1, ++- .num_different_channels = 1, ++- .beacon_int_infra_match = true, ++- .radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) | ++- BIT(NL80211_CHAN_WIDTH_20) | ++- BIT(NL80211_CHAN_WIDTH_40), ++- } ++-#endif ++ }; + ++ #ifdef CPTCFG_ATH9K_CHANNEL_CONTEXT diff --git a/package/kernel/mac80211/patches/311-mac80211-remove-drop_unencrypted-code.patch b/package/kernel/mac80211/patches/311-mac80211-remove-drop_unencrypted-code.patch deleted file mode 100644 index b2475b9..0000000 @@ -9507,58 +9927,6 @@ index b2475b9..0000000 - - if (tx->key) { - bool skip_hw = false; -diff --git a/package/kernel/mac80211/patches/312-brcmfmac-check-all-combinations-when-setting-wiphy-s.patch b/package/kernel/mac80211/patches/312-brcmfmac-check-all-combinations-when-setting-wiphy-s.patch -new file mode 100644 -index 0000000..bb27115 ---- /dev/null -+++ b/package/kernel/mac80211/patches/312-brcmfmac-check-all-combinations-when-setting-wiphy-s.patch -@@ -0,0 +1,46 @@ -+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -+Date: Thu, 20 Aug 2015 00:16:42 +0200 -+Subject: [PATCH] brcmfmac: check all combinations when setting wiphy's -+ addresses -+MIME-Version: 1.0 -+Content-Type: text/plain; charset=UTF-8 -+Content-Transfer-Encoding: 8bit -+ -+Broadcom is working on better reflection of interface combinations. With -+upcoming patches we may have 1st combination supporting less interfaces -+than others. -+To don't run out of addresses check all combinations to find the one -+with the greatest max_interfaces value. -+ -+Signed-off-by: Rafał Miłecki -+Signed-off-by: Kalle Valo -+--- -+ -+--- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c -+@@ -5786,7 +5786,9 @@ static void brcmf_wiphy_wowl_params(stru -+ static int brcmf_setup_wiphy(struct wiphy *wiphy, struct brcmf_if *ifp) -+ { -+ struct brcmf_pub *drvr = ifp->drvr; -++ const struct ieee80211_iface_combination *combo; -+ struct ieee80211_supported_band *band; -++ u16 max_interfaces = 0; -+ __le32 bandlist[3]; -+ u32 n_bands; -+ int err, i; -+@@ -5799,8 +5801,13 @@ static int brcmf_setup_wiphy(struct wiph -+ if (err) -+ return err; -+ -+- for (i = 0; i < wiphy->iface_combinations->max_interfaces && -+- i < ARRAY_SIZE(drvr->addresses); i++) { -++ for (i = 0, combo = wiphy->iface_combinations; -++ i < wiphy->n_iface_combinations; i++, combo++) { -++ max_interfaces = max(max_interfaces, combo->max_interfaces); -++ } -++ -++ for (i = 0; i < max_interfaces && i < ARRAY_SIZE(drvr->addresses); -++ i++) { -+ u8 *addr = drvr->addresses[i].addr; -+ -+ memcpy(addr, drvr->mac, ETH_ALEN); diff --git a/package/kernel/mac80211/patches/312-mac80211-don-t-look-up-destination-station-twice.patch b/package/kernel/mac80211/patches/312-mac80211-don-t-look-up-destination-station-twice.patch deleted file mode 100644 index 02a7fab..0000000 @@ -9636,216 +10004,39 @@ index 02a7fab..0000000 - sta = sta_info_get(sdata, hdr.addr1); - if (sta) { - authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); -diff --git a/package/kernel/mac80211/patches/313-brcmfmac-correct-interface-combination-info.patch b/package/kernel/mac80211/patches/313-brcmfmac-correct-interface-combination-info.patch +diff --git a/package/kernel/mac80211/patches/312-mac80211-fix-txq-queue-related-crashes.patch b/package/kernel/mac80211/patches/312-mac80211-fix-txq-queue-related-crashes.patch new file mode 100644 -index 0000000..baee295 +index 0000000..61cafc7 --- /dev/null -+++ b/package/kernel/mac80211/patches/313-brcmfmac-correct-interface-combination-info.patch -@@ -0,0 +1,204 @@ -+From: Arend van Spriel -+Date: Thu, 20 Aug 2015 22:06:03 +0200 -+Subject: [PATCH] brcmfmac: correct interface combination info ++++ b/package/kernel/mac80211/patches/312-mac80211-fix-txq-queue-related-crashes.patch +@@ -0,0 +1,27 @@ ++From: Michal Kazior ++Date: Thu, 21 Jan 2016 14:23:07 +0100 ++Subject: [PATCH] mac80211: fix txq queue related crashes + -+The interface combination provided by brcmfmac did not truly reflect -+the combinations supported by driver and/or firmware. ++The driver can access the queue simultanously ++while mac80211 tears down the interface. Without ++spinlock protection this could lead to corrupting ++sk_buff_head and subsequently to an invalid ++pointer dereference. + -+Reviewed-by: Hante Meuleman -+Reviewed-by: Franky (Zhenhui) Lin -+Reviewed-by: Pieter-Paul Giesberts -+Reviewed-by: Pontus Fuchs -+Signed-off-by: Arend van Spriel -+Signed-off-by: Kalle Valo ++Fixes: ba8c3d6f16a1 ("mac80211: add an intermediate software queue implementation") ++Signed-off-by: Michal Kazior +--- + -+--- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c -+@@ -5695,63 +5695,132 @@ brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = ++--- a/net/mac80211/iface.c +++++ b/net/mac80211/iface.c ++@@ -977,7 +977,10 @@ static void ieee80211_do_stop(struct iee ++ if (sdata->vif.txq) { ++ struct txq_info *txqi = to_txq_info(sdata->vif.txq); ++ +++ spin_lock_bh(&txqi->queue.lock); ++ ieee80211_purge_tx_queue(&local->hw, &txqi->queue); +++ spin_unlock_bh(&txqi->queue.lock); +++ ++ atomic_set(&sdata->txqs_len[txqi->txq.ac], 0); + } -+ }; + -++/** -++ * brcmf_setup_ifmodes() - determine interface modes and combinations. -++ * -++ * @wiphy: wiphy object. -++ * @ifp: interface object needed for feat module api. -++ * -++ * The interface modes and combinations are determined dynamically here -++ * based on firmware functionality. -++ * -++ * no p2p and no mbss: -++ * -++ * #STA <= 1, #AP <= 1, channels = 1, 2 total -++ * -++ * no p2p and mbss: -++ * -++ * #STA <= 1, #AP <= 1, channels = 1, 2 total -++ * #AP <= 4, matching BI, channels = 1, 4 total -++ * -++ * p2p, no mchan, and mbss: -++ * -++ * #STA <= 1, #P2P-DEV <= 1, #{P2P-CL, P2P-GO} <= 1, channels = 1, 3 total -++ * #STA <= 1, #P2P-DEV <= 1, #AP <= 1, #P2P-CL <= 1, channels = 1, 4 total -++ * #AP <= 4, matching BI, channels = 1, 4 total -++ * -++ * p2p, mchan, and mbss: -++ * -++ * #STA <= 1, #P2P-DEV <= 1, #{P2P-CL, P2P-GO} <= 1, channels = 2, 3 total -++ * #STA <= 1, #P2P-DEV <= 1, #AP <= 1, #P2P-CL <= 1, channels = 1, 4 total -++ * #AP <= 4, matching BI, channels = 1, 4 total -++ */ -+ static int brcmf_setup_ifmodes(struct wiphy *wiphy, struct brcmf_if *ifp) -+ { -+ struct ieee80211_iface_combination *combo = NULL; -+- struct ieee80211_iface_limit *limits = NULL; -+- int i = 0, max_iface_cnt; -++ struct ieee80211_iface_limit *c0_limits = NULL; -++ struct ieee80211_iface_limit *p2p_limits = NULL; -++ struct ieee80211_iface_limit *mbss_limits = NULL; -++ bool mbss, p2p; -++ int i, c, n_combos; -+ -+- combo = kzalloc(sizeof(*combo), GFP_KERNEL); -++ mbss = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS); -++ p2p = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_P2P); -++ -++ n_combos = 1 + !!p2p + !!mbss; -++ combo = kcalloc(n_combos, sizeof(*combo), GFP_KERNEL); -+ if (!combo) -+ goto err; -+ -+- limits = kzalloc(sizeof(*limits) * 4, GFP_KERNEL); -+- if (!limits) -++ c0_limits = kcalloc(p2p ? 3 : 2, sizeof(*c0_limits), GFP_KERNEL); -++ if (!c0_limits) -+ goto err; -+ -++ if (p2p) { -++ p2p_limits = kcalloc(4, sizeof(*p2p_limits), GFP_KERNEL); -++ if (!p2p_limits) -++ goto err; -++ } -++ -++ if (mbss) { -++ mbss_limits = kcalloc(1, sizeof(*mbss_limits), GFP_KERNEL); -++ if (!mbss_limits) -++ goto err; -++ } -++ -+ wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | -+ BIT(NL80211_IFTYPE_ADHOC) | -+ BIT(NL80211_IFTYPE_AP); -+ -+- if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MCHAN)) -+- combo->num_different_channels = 2; -+- else -+- combo->num_different_channels = 1; -+- -+- if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS)) { -+- limits[i].max = 1; -+- limits[i++].types = BIT(NL80211_IFTYPE_STATION); -+- limits[i].max = 4; -+- limits[i++].types = BIT(NL80211_IFTYPE_AP); -+- max_iface_cnt = 5; -+- } else { -+- limits[i].max = 2; -+- limits[i++].types = BIT(NL80211_IFTYPE_STATION) | -+- BIT(NL80211_IFTYPE_AP); -+- max_iface_cnt = 2; -+- } -+- -+- if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_P2P)) { -++ c = 0; -++ i = 0; -++ combo[c].num_different_channels = 1; -++ c0_limits[i].max = 1; -++ c0_limits[i++].types = BIT(NL80211_IFTYPE_STATION); -++ if (p2p) { -++ if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MCHAN)) -++ combo[c].num_different_channels = 2; -+ wiphy->interface_modes |= BIT(NL80211_IFTYPE_P2P_CLIENT) | -+ BIT(NL80211_IFTYPE_P2P_GO) | -+ BIT(NL80211_IFTYPE_P2P_DEVICE); -+- limits[i].max = 1; -+- limits[i++].types = BIT(NL80211_IFTYPE_P2P_CLIENT) | -+- BIT(NL80211_IFTYPE_P2P_GO); -+- limits[i].max = 1; -+- limits[i++].types = BIT(NL80211_IFTYPE_P2P_DEVICE); -+- max_iface_cnt += 2; -+- } -+- combo->max_interfaces = max_iface_cnt; -+- combo->limits = limits; -+- combo->n_limits = i; -++ c0_limits[i].max = 1; -++ c0_limits[i++].types = BIT(NL80211_IFTYPE_P2P_DEVICE); -++ c0_limits[i].max = 1; -++ c0_limits[i++].types = BIT(NL80211_IFTYPE_P2P_CLIENT) | -++ BIT(NL80211_IFTYPE_P2P_GO); -++ } else { -++ c0_limits[i].max = 1; -++ c0_limits[i++].types = BIT(NL80211_IFTYPE_AP); -++ } -++ combo[c].max_interfaces = i; -++ combo[c].n_limits = i; -++ combo[c].limits = c0_limits; -++ -++ if (p2p) { -++ c++; -++ i = 0; -++ combo[c].num_different_channels = 1; -++ p2p_limits[i].max = 1; -++ p2p_limits[i++].types = BIT(NL80211_IFTYPE_STATION); -++ p2p_limits[i].max = 1; -++ p2p_limits[i++].types = BIT(NL80211_IFTYPE_AP); -++ p2p_limits[i].max = 1; -++ p2p_limits[i++].types = BIT(NL80211_IFTYPE_P2P_CLIENT); -++ p2p_limits[i].max = 1; -++ p2p_limits[i++].types = BIT(NL80211_IFTYPE_P2P_DEVICE); -++ combo[c].max_interfaces = i; -++ combo[c].n_limits = i; -++ combo[c].limits = p2p_limits; -++ } -+ -++ if (mbss) { -++ c++; -++ combo[c].beacon_int_infra_match = true; -++ combo[c].num_different_channels = 1; -++ mbss_limits[0].max = 4; -++ mbss_limits[0].types = BIT(NL80211_IFTYPE_AP); -++ combo[c].max_interfaces = 4; -++ combo[c].n_limits = 1; -++ combo[c].limits = mbss_limits; -++ } -++ wiphy->n_iface_combinations = n_combos; -+ wiphy->iface_combinations = combo; -+- wiphy->n_iface_combinations = 1; -+ return 0; -+ -+ err: -+- kfree(limits); -++ kfree(c0_limits); -++ kfree(p2p_limits); -++ kfree(mbss_limits); -+ kfree(combo); -+ return -ENOMEM; -+ } -+@@ -6080,11 +6149,15 @@ static void brcmf_cfg80211_reg_notifier( -+ -+ static void brcmf_free_wiphy(struct wiphy *wiphy) -+ { -++ int i; -++ -+ if (!wiphy) -+ return; -+ -+- if (wiphy->iface_combinations) -+- kfree(wiphy->iface_combinations->limits); -++ if (wiphy->iface_combinations) { -++ for (i = 0; i < wiphy->n_iface_combinations; i++) -++ kfree(wiphy->iface_combinations[i].limits); -++ } -+ kfree(wiphy->iface_combinations); -+ if (wiphy->bands[IEEE80211_BAND_2GHZ]) { -+ kfree(wiphy->bands[IEEE80211_BAND_2GHZ]->channels); diff --git a/package/kernel/mac80211/patches/313-mac80211-drop-4-addr-VLAN-frames-earlier-if-not-conn.patch b/package/kernel/mac80211/patches/313-mac80211-drop-4-addr-VLAN-frames-earlier-if-not-conn.patch deleted file mode 100644 index 4125351..0000000 @@ -9879,99 +10070,178 @@ index 4125351..0000000 - } - ap_sdata = container_of(sdata->bss, struct ieee80211_sub_if_data, - u.ap); -diff --git a/package/kernel/mac80211/patches/314-brcmfmac-add-debugfs-entry-for-msgbuf-statistics.patch b/package/kernel/mac80211/patches/314-brcmfmac-add-debugfs-entry-for-msgbuf-statistics.patch +diff --git a/package/kernel/mac80211/patches/313-mac80211-fix-unnecessary-frame-drops-in-mesh-fwding.patch b/package/kernel/mac80211/patches/313-mac80211-fix-unnecessary-frame-drops-in-mesh-fwding.patch new file mode 100644 -index 0000000..9768ef2 +index 0000000..844d43b --- /dev/null -+++ b/package/kernel/mac80211/patches/314-brcmfmac-add-debugfs-entry-for-msgbuf-statistics.patch -@@ -0,0 +1,87 @@ -+From: Franky Lin -+Date: Thu, 20 Aug 2015 22:06:04 +0200 -+Subject: [PATCH] brcmfmac: add debugfs entry for msgbuf statistics ++++ b/package/kernel/mac80211/patches/313-mac80211-fix-unnecessary-frame-drops-in-mesh-fwding.patch +@@ -0,0 +1,57 @@ ++From: Michal Kazior ++Date: Mon, 25 Jan 2016 14:43:24 +0100 ++Subject: [PATCH] mac80211: fix unnecessary frame drops in mesh fwding + -+Expose ring buffer read/write pointers and other useful statistics -+through debugfs. ++The ieee80211_queue_stopped() expects hw queue ++number but it was given raw WMM AC number instead. + -+Reviewed-by: Arend Van Spriel -+Reviewed-by: Hante Meuleman -+Reviewed-by: Pieter-Paul Giesberts -+Signed-off-by: Franky Lin -+Signed-off-by: Arend van Spriel -+Signed-off-by: Kalle Valo ++This could cause frame drops and problems with ++traffic in some cases - most notably if driver ++doesn't map AC numbers to queue numbers 1:1 and ++uses ieee80211_stop_queues() and ++ieee80211_wake_queue() only without ever calling ++ieee80211_wake_queues(). ++ ++On ath10k it was possible to hit this problem in ++the following case: ++ ++ 1. wlan0 uses queue 0 ++ (ath10k maps queues per vif) ++ 2. offchannel uses queue 15 ++ 3. queues 1-14 are unused ++ 4. ieee80211_stop_queues() ++ 5. ieee80211_wake_queue(q=0) ++ 6. ieee80211_wake_queue(q=15) ++ (other queues are not woken up because both ++ driver and mac80211 know other queues are ++ unused) ++ 7. ieee80211_rx_h_mesh_fwding() ++ 8. ieee80211_select_queue_80211() returns 2 ++ 9. ieee80211_queue_stopped(q=2) returns true ++ 10. frame is dropped (oops!) ++ ++Fixes: d3c1597b8d1b ("mac80211: fix forwarded mesh frame queue mapping") ++Signed-off-by: Michal Kazior +--- + -+--- a/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c -+@@ -1360,6 +1360,60 @@ void brcmf_msgbuf_delete_flowring(struct ++--- a/net/mac80211/rx.c +++++ b/net/mac80211/rx.c ++@@ -2235,7 +2235,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80 ++ struct ieee80211_local *local = rx->local; ++ struct ieee80211_sub_if_data *sdata = rx->sdata; ++ struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; ++- u16 q, hdrlen; +++ u16 ac, q, hdrlen; ++ ++ hdr = (struct ieee80211_hdr *) skb->data; ++ hdrlen = ieee80211_hdrlen(hdr->frame_control); ++@@ -2304,7 +2304,8 @@ ieee80211_rx_h_mesh_fwding(struct ieee80 ++ ether_addr_equal(sdata->vif.addr, hdr->addr3)) ++ return RX_CONTINUE; ++ ++- q = ieee80211_select_queue_80211(sdata, skb, hdr); +++ ac = ieee80211_select_queue_80211(sdata, skb, hdr); +++ q = sdata->vif.hw_queue[ac]; ++ if (ieee80211_queue_stopped(&local->hw, q)) { ++ IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_congestion); ++ return RX_DROP_MONITOR; +diff --git a/package/kernel/mac80211/patches/314-mac80211-Requeue-work-after-scan-complete-for-all-VI.patch b/package/kernel/mac80211/patches/314-mac80211-Requeue-work-after-scan-complete-for-all-VI.patch +new file mode 100644 +index 0000000..5b3efbd +--- /dev/null ++++ b/package/kernel/mac80211/patches/314-mac80211-Requeue-work-after-scan-complete-for-all-VI.patch +@@ -0,0 +1,103 @@ ++From: Sachin Kulkarni ++Date: Tue, 12 Jan 2016 14:30:19 +0530 ++Subject: [PATCH] mac80211: Requeue work after scan complete for all VIF ++ types. ++ ++During a sw scan ieee80211_iface_work ignores work items for all vifs. ++However after the scan complete work is requeued only for STA, ADHOC ++and MESH iftypes. ++ ++This occasionally results in event processing getting delayed/not ++processed for iftype AP when it coexists with a STA. This can result ++in data halt and eventually disconnection on the AP interface. ++ ++Signed-off-by: Sachin Kulkarni ++Cc: linux-wireless@vger.kernel.org ++Cc: johannes@sipsolutions.net ++--- ++ ++--- a/net/mac80211/ibss.c +++++ b/net/mac80211/ibss.c ++@@ -1731,7 +1731,6 @@ void ieee80211_ibss_notify_scan_complete ++ if (sdata->vif.type != NL80211_IFTYPE_ADHOC) ++ continue; ++ sdata->u.ibss.last_scan_completed = jiffies; ++- ieee80211_queue_work(&local->hw, &sdata->work); ++ } ++ mutex_unlock(&local->iflist_mtx); ++ } ++--- a/net/mac80211/mesh.c +++++ b/net/mac80211/mesh.c ++@@ -1369,17 +1369,6 @@ out: ++ sdata_unlock(sdata); ++ } ++ ++-void ieee80211_mesh_notify_scan_completed(struct ieee80211_local *local) ++-{ ++- struct ieee80211_sub_if_data *sdata; ++- ++- rcu_read_lock(); ++- list_for_each_entry_rcu(sdata, &local->interfaces, list) ++- if (ieee80211_vif_is_mesh(&sdata->vif) && ++- ieee80211_sdata_running(sdata)) ++- ieee80211_queue_work(&local->hw, &sdata->work); ++- rcu_read_unlock(); ++-} ++ ++ void ieee80211_mesh_init_sdata(struct ieee80211_sub_if_data *sdata) ++ { ++--- a/net/mac80211/mesh.h +++++ b/net/mac80211/mesh.h ++@@ -362,14 +362,10 @@ static inline bool mesh_path_sel_is_hwmp ++ return sdata->u.mesh.mesh_pp_id == IEEE80211_PATH_PROTOCOL_HWMP; ++ } ++ ++-void ieee80211_mesh_notify_scan_completed(struct ieee80211_local *local); ++- ++ void mesh_path_flush_by_iface(struct ieee80211_sub_if_data *sdata); ++ void mesh_sync_adjust_tbtt(struct ieee80211_sub_if_data *sdata); ++ void ieee80211s_stop(void); ++ #else ++-static inline void ++-ieee80211_mesh_notify_scan_completed(struct ieee80211_local *local) {} ++ static inline bool mesh_path_sel_is_hwmp(struct ieee80211_sub_if_data *sdata) ++ { return false; } ++ static inline void mesh_path_flush_by_iface(struct ieee80211_sub_if_data *sdata) ++--- a/net/mac80211/mlme.c +++++ b/net/mac80211/mlme.c ++@@ -3978,8 +3978,6 @@ static void ieee80211_restart_sta_timer( ++ if (!ieee80211_hw_check(&sdata->local->hw, CONNECTION_MONITOR)) ++ ieee80211_queue_work(&sdata->local->hw, ++ &sdata->u.mgd.monitor_work); ++- /* and do all the other regular work too */ ++- ieee80211_queue_work(&sdata->local->hw, &sdata->work); + } + } + -++#ifdef DEBUG -++static int brcmf_msgbuf_stats_read(struct seq_file *seq, void *data) -++{ -++ struct brcmf_bus *bus_if = dev_get_drvdata(seq->private); -++ struct brcmf_pub *drvr = bus_if->drvr; -++ struct brcmf_msgbuf *msgbuf = (struct brcmf_msgbuf *)drvr->proto->pd; -++ struct brcmf_commonring *commonring; -++ u16 i; -++ struct brcmf_flowring_ring *ring; -++ struct brcmf_flowring_hash *hash; ++--- a/net/mac80211/scan.c +++++ b/net/mac80211/scan.c ++@@ -314,6 +314,7 @@ static void __ieee80211_scan_completed(s ++ bool was_scanning = local->scanning; ++ struct cfg80211_scan_request *scan_req; ++ struct ieee80211_sub_if_data *scan_sdata; +++ struct ieee80211_sub_if_data *sdata; ++ ++ lockdep_assert_held(&local->mtx); ++ ++@@ -373,7 +374,15 @@ static void __ieee80211_scan_completed(s ++ ++ ieee80211_mlme_notify_scan_completed(local); ++ ieee80211_ibss_notify_scan_completed(local); ++- ieee80211_mesh_notify_scan_completed(local); ++ -++ commonring = msgbuf->commonrings[BRCMF_H2D_MSGRING_CONTROL_SUBMIT]; -++ seq_printf(seq, "h2d_ctl_submit: rp %4u, wp %4u, depth %4u\n", -++ commonring->r_ptr, commonring->w_ptr, commonring->depth); -++ commonring = msgbuf->commonrings[BRCMF_H2D_MSGRING_RXPOST_SUBMIT]; -++ seq_printf(seq, "h2d_rx_submit: rp %4u, wp %4u, depth %4u\n", -++ commonring->r_ptr, commonring->w_ptr, commonring->depth); -++ commonring = msgbuf->commonrings[BRCMF_D2H_MSGRING_CONTROL_COMPLETE]; -++ seq_printf(seq, "d2h_ctl_cmplt: rp %4u, wp %4u, depth %4u\n", -++ commonring->r_ptr, commonring->w_ptr, commonring->depth); -++ commonring = msgbuf->commonrings[BRCMF_D2H_MSGRING_TX_COMPLETE]; -++ seq_printf(seq, "d2h_tx_cmplt: rp %4u, wp %4u, depth %4u\n", -++ commonring->r_ptr, commonring->w_ptr, commonring->depth); -++ commonring = msgbuf->commonrings[BRCMF_D2H_MSGRING_RX_COMPLETE]; -++ seq_printf(seq, "d2h_rx_cmplt: rp %4u, wp %4u, depth %4u\n", -++ commonring->r_ptr, commonring->w_ptr, commonring->depth); -++ -++ seq_printf(seq, "\nh2d_flowrings: depth %u\n", -++ BRCMF_H2D_TXFLOWRING_MAX_ITEM); -++ seq_puts(seq, "Active flowrings:\n"); -++ hash = msgbuf->flow->hash; -++ for (i = 0; i < msgbuf->flow->nrofrings; i++) { -++ if (!msgbuf->flow->rings[i]) -++ continue; -++ ring = msgbuf->flow->rings[i]; -++ if (ring->status != RING_OPEN) -++ continue; -++ commonring = msgbuf->flowrings[i]; -++ hash = &msgbuf->flow->hash[ring->hash_id]; -++ seq_printf(seq, "id %3u: rp %4u, wp %4u, qlen %4u, blocked %u\n" -++ " ifidx %u, fifo %u, da %pM\n", -++ i, commonring->r_ptr, commonring->w_ptr, -++ skb_queue_len(&ring->skblist), ring->blocked, -++ hash->ifidx, hash->fifo, hash->mac); +++ /* Requeue all the work that might have been ignored while +++ * the scan was in progress +++ */ +++ list_for_each_entry_rcu(sdata, &local->interfaces, list) { +++ if (ieee80211_sdata_running(sdata)) +++ ieee80211_queue_work(&sdata->local->hw, &sdata->work); ++ } ++ -++ return 0; -++} -++#else -++static int brcmf_msgbuf_stats_read(struct seq_file *seq, void *data) -++{ -++ return 0; -++} -++#endif -+ -+ int brcmf_proto_msgbuf_attach(struct brcmf_pub *drvr) -+ { -+@@ -1460,6 +1514,8 @@ int brcmf_proto_msgbuf_attach(struct brc -+ spin_lock_init(&msgbuf->flowring_work_lock); -+ INIT_LIST_HEAD(&msgbuf->work_queue); -+ -++ brcmf_debugfs_add_entry(drvr, "msgbuf_stats", brcmf_msgbuf_stats_read); -++ -+ return 0; -+ -+ fail: ++ if (was_scanning) ++ ieee80211_start_next_roc(local); ++ } diff --git a/package/kernel/mac80211/patches/314-mac80211-mesh-avoid-pointless-station-lookup.patch b/package/kernel/mac80211/patches/314-mac80211-mesh-avoid-pointless-station-lookup.patch deleted file mode 100644 index 9105a64..0000000 @@ -10011,95 +10281,6 @@ index 9105a64..0000000 - sta = sta_info_get(sdata, hdr.addr1); - if (sta) { - authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); -diff --git a/package/kernel/mac80211/patches/315-brcmfmac-make-use-of-cfg80211_check_combinations.patch b/package/kernel/mac80211/patches/315-brcmfmac-make-use-of-cfg80211_check_combinations.patch -new file mode 100644 -index 0000000..281f02b ---- /dev/null -+++ b/package/kernel/mac80211/patches/315-brcmfmac-make-use-of-cfg80211_check_combinations.patch -@@ -0,0 +1,83 @@ -+From: Arend van Spriel -+Date: Thu, 20 Aug 2015 22:06:05 +0200 -+Subject: [PATCH] brcmfmac: make use of cfg80211_check_combinations() -+ -+Use cfg80211_check_combinations() so we can bail out early when an -+interface add or change results in an invalid combination. -+ -+Reviewed-by: Hante Meuleman -+Reviewed-by: Franky (Zhenhui) Lin -+Reviewed-by: Pieter-Paul Giesberts -+Signed-off-by: Arend van Spriel -+Signed-off-by: Kalle Valo -+--- -+ -+--- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c -+@@ -469,6 +469,36 @@ brcmf_find_wpsie(const u8 *parse, u32 le -+ return NULL; -+ } -+ -++static int brcmf_vif_change_validate(struct brcmf_cfg80211_info *cfg, -++ struct brcmf_cfg80211_vif *vif, -++ enum nl80211_iftype new_type) -++{ -++ int iftype_num[NUM_NL80211_IFTYPES]; -++ struct brcmf_cfg80211_vif *pos; -++ -++ memset(&iftype_num[0], 0, sizeof(iftype_num)); -++ list_for_each_entry(pos, &cfg->vif_list, list) -++ if (pos == vif) -++ iftype_num[new_type]++; -++ else -++ iftype_num[pos->wdev.iftype]++; -++ -++ return cfg80211_check_combinations(cfg->wiphy, 1, 0, iftype_num); -++} -++ -++static int brcmf_vif_add_validate(struct brcmf_cfg80211_info *cfg, -++ enum nl80211_iftype new_type) -++{ -++ int iftype_num[NUM_NL80211_IFTYPES]; -++ struct brcmf_cfg80211_vif *pos; -++ -++ memset(&iftype_num[0], 0, sizeof(iftype_num)); -++ list_for_each_entry(pos, &cfg->vif_list, list) -++ iftype_num[pos->wdev.iftype]++; -++ -++ iftype_num[new_type]++; -++ return cfg80211_check_combinations(cfg->wiphy, 1, 0, iftype_num); -++} -+ -+ static void convert_key_from_CPU(struct brcmf_wsec_key *key, -+ struct brcmf_wsec_key_le *key_le) -+@@ -663,8 +693,14 @@ static struct wireless_dev *brcmf_cfg802 -+ struct vif_params *params) -+ { -+ struct wireless_dev *wdev; -++ int err; -+ -+ brcmf_dbg(TRACE, "enter: %s type %d\n", name, type); -++ err = brcmf_vif_add_validate(wiphy_to_cfg(wiphy), type); -++ if (err) { -++ brcmf_err("iface validation failed: err=%d\n", err); -++ return ERR_PTR(err); -++ } -+ switch (type) { -+ case NL80211_IFTYPE_ADHOC: -+ case NL80211_IFTYPE_STATION: -+@@ -823,8 +859,12 @@ brcmf_cfg80211_change_iface(struct wiphy -+ s32 ap = 0; -+ s32 err = 0; -+ -+- brcmf_dbg(TRACE, "Enter, ndev=%p, type=%d\n", ndev, type); -+- -++ brcmf_dbg(TRACE, "Enter, idx=%d, type=%d\n", ifp->bssidx, type); -++ err = brcmf_vif_change_validate(wiphy_to_cfg(wiphy), vif, type); -++ if (err) { -++ brcmf_err("iface validation failed: err=%d\n", err); -++ return err; -++ } -+ switch (type) { -+ case NL80211_IFTYPE_MONITOR: -+ case NL80211_IFTYPE_WDS: diff --git a/package/kernel/mac80211/patches/315-mac80211-avoid-duplicate-TX-path-station-lookup.patch b/package/kernel/mac80211/patches/315-mac80211-avoid-duplicate-TX-path-station-lookup.patch deleted file mode 100644 index d143025..0000000 @@ -10373,60 +10554,69 @@ index d143025..0000000 -+ ieee80211_xmit(sdata, NULL, skb); - local_bh_enable(); - } -diff --git a/package/kernel/mac80211/patches/316-brcmfmac-block-the-correct-flowring-when-backup-queu.patch b/package/kernel/mac80211/patches/316-brcmfmac-block-the-correct-flowring-when-backup-queu.patch +diff --git a/package/kernel/mac80211/patches/315-mac80211-fix-ibss-scan-parameters.patch b/package/kernel/mac80211/patches/315-mac80211-fix-ibss-scan-parameters.patch new file mode 100644 -index 0000000..2d5f7b9 +index 0000000..52fecb9 --- /dev/null -+++ b/package/kernel/mac80211/patches/316-brcmfmac-block-the-correct-flowring-when-backup-queu.patch -@@ -0,0 +1,48 @@ -+From: Franky Lin -+Date: Thu, 20 Aug 2015 22:06:06 +0200 -+Subject: [PATCH] brcmfmac: block the correct flowring when backup queue -+ overflow ++++ b/package/kernel/mac80211/patches/315-mac80211-fix-ibss-scan-parameters.patch +@@ -0,0 +1,57 @@ ++From: Sara Sharon ++Date: Mon, 25 Jan 2016 15:46:35 +0200 ++Subject: [PATCH] mac80211: fix ibss scan parameters + -+brcmf_flowring_block blocks the last active flowring under the same -+interface instead of the one provided by caller. This could lead to a -+dead lock of netif stop if there are more than one flowring under the -+interface and the traffic is high enough so brcmf_flowring_enqueue can -+not unblock the ring right away. ++When joining IBSS a full scan should be initiated in order to search ++for existing cell, unless the fixed_channel parameter was set. ++A default channel to create the IBSS on if no cell was found is ++provided as well. ++However - a scan is initiated only on the default channel provided ++regardless of whether ifibss->fixed_channel is set or not, with the ++obvious result of the cell not joining existing IBSS cell that is ++on another channel. + -+Reviewed-by: Pieter-Paul Giesberts -+Reviewed-by: Hante Meuleman -+Signed-off-by: Franky Lin -+Signed-off-by: Arend van Spriel -+Signed-off-by: Kalle Valo ++Fixes: 76bed0f43b27 ("mac80211: IBSS fix scan request") ++Signed-off-by: Sara Sharon ++Signed-off-by: Emmanuel Grumbach +--- + -+--- a/drivers/net/wireless/brcm80211/brcmfmac/flowring.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/flowring.c -+@@ -194,11 +194,15 @@ static void brcmf_flowring_block(struct -+ spin_lock_irqsave(&flow->block_lock, flags); ++--- a/net/mac80211/ibss.c +++++ b/net/mac80211/ibss.c ++@@ -7,6 +7,7 @@ ++ * Copyright 2007, Michael Wu ++ * Copyright 2009, Johannes Berg ++ * Copyright 2013-2014 Intel Mobile Communications GmbH +++ * Copyright(c) 2016 Intel Deutschland GmbH ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++@@ -1483,14 +1484,21 @@ static void ieee80211_sta_find_ibss(stru + -+ ring = flow->rings[flowid]; -++ if (ring->blocked == blocked) { -++ spin_unlock_irqrestore(&flow->block_lock, flags); -++ return; -++ } -+ ifidx = brcmf_flowring_ifidx_get(flow, flowid); ++ sdata_info(sdata, "Trigger new scan to find an IBSS to join\n"); ++ ++- num = ieee80211_ibss_setup_scan_channels(local->hw.wiphy, ++- &ifibss->chandef, ++- channels, ++- ARRAY_SIZE(channels)); ++ scan_width = cfg80211_chandef_to_scan_width(&ifibss->chandef); ++- ieee80211_request_ibss_scan(sdata, ifibss->ssid, ++- ifibss->ssid_len, channels, num, ++- scan_width); +++ +++ if (ifibss->fixed_channel) { +++ num = ieee80211_ibss_setup_scan_channels(local->hw.wiphy, +++ &ifibss->chandef, +++ channels, +++ ARRAY_SIZE(channels)); +++ ieee80211_request_ibss_scan(sdata, ifibss->ssid, +++ ifibss->ssid_len, channels, +++ num, scan_width); +++ } else { +++ ieee80211_request_ibss_scan(sdata, ifibss->ssid, +++ ifibss->ssid_len, NULL, +++ 0, scan_width); +++ } ++ } else { ++ int interval = IEEE80211_SCAN_INTERVAL; + -+ currently_blocked = false; -+ for (i = 0; i < flow->nrofrings; i++) { -+- if (flow->rings[i]) { -++ if ((flow->rings[i]) && (i != flowid)) { -+ ring = flow->rings[i]; -+ if ((ring->status == RING_OPEN) && -+ (brcmf_flowring_ifidx_get(flow, i) == ifidx)) { -+@@ -209,8 +213,8 @@ static void brcmf_flowring_block(struct -+ } -+ } -+ } -+- ring->blocked = blocked; -+- if (currently_blocked == blocked) { -++ flow->rings[flowid]->blocked = blocked; -++ if (currently_blocked) { -+ spin_unlock_irqrestore(&flow->block_lock, flags); -+ return; -+ } diff --git a/package/kernel/mac80211/patches/316-mac80211-reduce-log-spam-from-ieee80211_handle_pwr_c.patch b/package/kernel/mac80211/patches/316-mac80211-reduce-log-spam-from-ieee80211_handle_pwr_c.patch deleted file mode 100644 index 77a82c2..0000000 @@ -10471,6 +10661,62 @@ index 77a82c2..0000000 - new_ap_level = pwr_level_cisco; - } - +diff --git a/package/kernel/mac80211/patches/316-net-mac80211-agg-rx.c-fix-use-of-uninitialised-value.patch b/package/kernel/mac80211/patches/316-net-mac80211-agg-rx.c-fix-use-of-uninitialised-value.patch +new file mode 100644 +index 0000000..e78df36 +--- /dev/null ++++ b/package/kernel/mac80211/patches/316-net-mac80211-agg-rx.c-fix-use-of-uninitialised-value.patch +@@ -0,0 +1,50 @@ ++From: Chris Bainbridge ++Date: Wed, 27 Jan 2016 15:46:18 +0000 ++Subject: [PATCH] net/mac80211/agg-rx.c: fix use of uninitialised values ++ ++Use kzalloc instead of kmalloc for struct tid_ampdu_rx. Fixes: ++ ++[ 7.976605] UBSAN: Undefined behaviour in net/mac80211/rx.c:932:29 ++[ 7.976608] load of value 2 is not a valid value for type '_Bool' ++[ 7.976611] CPU: 3 PID: 1134 Comm: kworker/u16:7 Not tainted 4.5.0-rc1+ #265 ++[ 7.976613] Hardware name: Apple Inc. MacBookPro10,2/Mac-AFD8A9D944EA4843, BIOS MBP102.88Z.0106.B0A.1509130955 09/13/2015 ++[ 7.976616] Workqueue: phy0 rt2x00usb_work_rxdone ++[ 7.976619] 0000000000000004 ffff880254a7ba50 ffffffff8181d866 0000000000000007 ++[ 7.976622] ffff880254a7ba78 ffff880254a7ba68 ffffffff8188422d ffffffff8379b500 ++[ 7.976626] ffff880254a7bab8 ffffffff81884747 0000000000000202 0000000348620032 ++[ 7.976629] Call Trace: ++[ 7.976633] [] dump_stack+0x45/0x5f ++[ 7.976637] [] ubsan_epilogue+0xd/0x40 ++[ 7.976642] [] __ubsan_handle_load_invalid_value+0x67/0x70 ++[ 7.976646] [] ieee80211_sta_reorder_release.isra.16+0x5ed/0x730 ++[ 7.976650] [] ieee80211_prepare_and_rx_handle+0xd04/0x1c00 ++[ 7.976654] [] ? usb_hcd_map_urb_for_dma+0x65e/0x960 ++[ 7.976659] [] __ieee80211_rx_handle_packet+0x1f3/0x750 ++[ 7.976663] [] ieee80211_rx_napi+0x447/0x990 ++[ 7.976667] [] rt2x00lib_rxdone+0x305/0xbd0 ++[ 7.976670] [] ? dequeue_task_fair+0x64f/0x1de0 ++[ 7.976674] [] ? sched_clock_cpu+0xe6/0x150 ++[ 7.976678] [] rt2x00usb_work_rxdone+0x7c/0x140 ++[ 7.976682] [] process_one_work+0x226/0x860 ++[ 7.976686] [] worker_thread+0x5c/0x680 ++[ 7.976690] [] ? process_one_work+0x860/0x860 ++[ 7.976693] [] kthread+0xf6/0x150 ++[ 7.976697] [] ? kthread_worker_fn+0x310/0x310 ++[ 7.976700] [] ret_from_fork+0x3f/0x70 ++[ 7.976703] [] ? kthread_worker_fn+0x310/0x310 ++ ++Link: https://lkml.org/lkml/2016/1/26/230 ++Signed-off-by: Chris Bainbridge ++--- ++ ++--- a/net/mac80211/agg-rx.c +++++ b/net/mac80211/agg-rx.c ++@@ -327,7 +327,7 @@ void __ieee80211_start_rx_ba_session(str ++ } ++ ++ /* prepare A-MPDU MLME for Rx aggregation */ ++- tid_agg_rx = kmalloc(sizeof(struct tid_ampdu_rx), GFP_KERNEL); +++ tid_agg_rx = kzalloc(sizeof(struct tid_ampdu_rx), GFP_KERNEL); ++ if (!tid_agg_rx) ++ goto end; ++ diff --git a/package/kernel/mac80211/patches/317-brcmfmac-Fix-race-condition-in-msgbuf-ioctl-processi.patch b/package/kernel/mac80211/patches/317-brcmfmac-Fix-race-condition-in-msgbuf-ioctl-processi.patch deleted file mode 100644 index e005fe7..0000000 @@ -10512,64 +10758,57 @@ index e005fe7..0000000 - } - - -diff --git a/package/kernel/mac80211/patches/317-brcmfmac-bump-highest-event-number-for-4339-firmware.patch b/package/kernel/mac80211/patches/317-brcmfmac-bump-highest-event-number-for-4339-firmware.patch +diff --git a/package/kernel/mac80211/patches/317-mac80211-minstrel_ht-fix-out-of-bound-in-minstrel_ht.patch b/package/kernel/mac80211/patches/317-mac80211-minstrel_ht-fix-out-of-bound-in-minstrel_ht.patch new file mode 100644 -index 0000000..7378401 +index 0000000..5bf53b9 --- /dev/null -+++ b/package/kernel/mac80211/patches/317-brcmfmac-bump-highest-event-number-for-4339-firmware.patch -@@ -0,0 +1,52 @@ -+From: Arend van Spriel -+Date: Thu, 20 Aug 2015 22:06:07 +0200 -+Subject: [PATCH] brcmfmac: bump highest event number for 4339 firmware ++++ b/package/kernel/mac80211/patches/317-mac80211-minstrel_ht-fix-out-of-bound-in-minstrel_ht.patch +@@ -0,0 +1,45 @@ ++From: Konstantin Khlebnikov ++Date: Fri, 29 Jan 2016 11:35:12 +0300 ++Subject: [PATCH] mac80211: minstrel_ht: fix out-of-bound in ++ minstrel_ht_set_best_prob_rate + -+The event mask length is determined by the highest event number -+that is specified in the driver. When this length is shorter than -+firmware expects setting event mask will fail and device becomes -+pretty useless. This issue was reported with bcm4339 firmware that -+was recently released. ++Patch fixes this splat + -+Reported-by: Pontus Fuchs -+Reviewed-by: Hante Meuleman -+Reviewed-by: Franky (Zhenhui) Lin -+Reviewed-by: Pieter-Paul Giesberts -+Reviewed-by: Pontus Fuchs -+Signed-off-by: Arend van Spriel -+Signed-off-by: Kalle Valo ++BUG: KASAN: slab-out-of-bounds in minstrel_ht_update_stats.isra.7+0x6e1/0x9e0 ++[mac80211] at addr ffff8800cee640f4 Read of size 4 by task swapper/3/0 ++ ++Signed-off-by: Konstantin Khlebnikov ++Link: http://lkml.kernel.org/r/CALYGNiNyJhSaVnE35qS6UCGaSb2Dx1_i5HcRavuOX14oTz2P+w@mail.gmail.com +--- + -+--- a/drivers/net/wireless/brcm80211/brcmfmac/fweh.h -++++ b/drivers/net/wireless/brcm80211/brcmfmac/fweh.h -+@@ -85,7 +85,6 @@ struct brcmf_event; -+ BRCMF_ENUM_DEF(IF, 54) \ -+ BRCMF_ENUM_DEF(P2P_DISC_LISTEN_COMPLETE, 55) \ -+ BRCMF_ENUM_DEF(RSSI, 56) \ -+- BRCMF_ENUM_DEF(PFN_SCAN_COMPLETE, 57) \ -+ BRCMF_ENUM_DEF(EXTLOG_MSG, 58) \ -+ BRCMF_ENUM_DEF(ACTION_FRAME, 59) \ -+ BRCMF_ENUM_DEF(ACTION_FRAME_COMPLETE, 60) \ -+@@ -103,8 +102,7 @@ struct brcmf_event; -+ BRCMF_ENUM_DEF(FIFO_CREDIT_MAP, 74) \ -+ BRCMF_ENUM_DEF(ACTION_FRAME_RX, 75) \ -+ BRCMF_ENUM_DEF(TDLS_PEER_EVENT, 92) \ -+- BRCMF_ENUM_DEF(BCMC_CREDIT_SUPPORT, 127) \ -+- BRCMF_ENUM_DEF(PSTA_PRIMARY_INTF_IND, 128) -++ BRCMF_ENUM_DEF(BCMC_CREDIT_SUPPORT, 127) ++--- a/net/mac80211/rc80211_minstrel_ht.c +++++ b/net/mac80211/rc80211_minstrel_ht.c ++@@ -414,15 +414,16 @@ minstrel_ht_set_best_prob_rate(struct mi ++ (max_tp_group != MINSTREL_CCK_GROUP)) ++ return; + -+ #define BRCMF_ENUM_DEF(id, val) \ -+ BRCMF_E_##id = (val), -+@@ -112,7 +110,11 @@ struct brcmf_event; -+ /* firmware event codes sent by the dongle */ -+ enum brcmf_fweh_event_code { -+ BRCMF_FWEH_EVENT_ENUM_DEFLIST -+- BRCMF_E_LAST -++ /* this determines event mask length which must match -++ * minimum length check in device firmware so it is -++ * hard-coded here. -++ */ -++ BRCMF_E_LAST = 139 -+ }; -+ #undef BRCMF_ENUM_DEF +++ max_gpr_group = mg->max_group_prob_rate / MCS_GROUP_RATES; +++ max_gpr_idx = mg->max_group_prob_rate % MCS_GROUP_RATES; +++ max_gpr_prob = mi->groups[max_gpr_group].rates[max_gpr_idx].prob_ewma; +++ ++ if (mrs->prob_ewma > MINSTREL_FRAC(75, 100)) { ++ cur_tp_avg = minstrel_ht_get_tp_avg(mi, cur_group, cur_idx, ++ mrs->prob_ewma); ++ if (cur_tp_avg > tmp_tp_avg) ++ mi->max_prob_rate = index; + ++- max_gpr_group = mg->max_group_prob_rate / MCS_GROUP_RATES; ++- max_gpr_idx = mg->max_group_prob_rate % MCS_GROUP_RATES; ++- max_gpr_prob = mi->groups[max_gpr_group].rates[max_gpr_idx].prob_ewma; ++ max_gpr_tp_avg = minstrel_ht_get_tp_avg(mi, max_gpr_group, ++ max_gpr_idx, ++ max_gpr_prob); ++@@ -431,7 +432,7 @@ minstrel_ht_set_best_prob_rate(struct mi ++ } else { ++ if (mrs->prob_ewma > tmp_prob) ++ mi->max_prob_rate = index; ++- if (mrs->prob_ewma > mg->rates[mg->max_group_prob_rate].prob_ewma) +++ if (mrs->prob_ewma > max_gpr_prob) ++ mg->max_group_prob_rate = index; ++ } ++ } diff --git a/package/kernel/mac80211/patches/318-brcmfmac-Update-msgbuf-commonring-size-for-improved-.patch b/package/kernel/mac80211/patches/318-brcmfmac-Update-msgbuf-commonring-size-for-improved-.patch deleted file mode 100644 index c2cd1c5..0000000 @@ -10606,6 +10845,47 @@ index c2cd1c5..0000000 - #define BRCMF_H2D_TXFLOWRING_MAX_ITEM 512 - - #define BRCMF_H2D_MSGRING_CONTROL_SUBMIT_ITEMSIZE 40 +diff --git a/package/kernel/mac80211/patches/318-mac80211-move-A-MSDU-skb_linearize-call-to-ieee80211.patch b/package/kernel/mac80211/patches/318-mac80211-move-A-MSDU-skb_linearize-call-to-ieee80211.patch +new file mode 100644 +index 0000000..655dc4b +--- /dev/null ++++ b/package/kernel/mac80211/patches/318-mac80211-move-A-MSDU-skb_linearize-call-to-ieee80211.patch +@@ -0,0 +1,35 @@ ++From: Felix Fietkau ++Date: Tue, 2 Feb 2016 14:39:08 +0100 ++Subject: [PATCH] mac80211: move A-MSDU skb_linearize call to ++ ieee80211_amsdu_to_8023s ++ ++Prepararation for zero-copy A-MSDU support with page fragment SKBs ++ ++Signed-off-by: Felix Fietkau ++Signed-off-by: Johannes Berg ++--- ++ ++--- a/net/mac80211/rx.c +++++ b/net/mac80211/rx.c ++@@ -2203,9 +2203,6 @@ ieee80211_rx_h_amsdu(struct ieee80211_rx ++ skb->dev = dev; ++ __skb_queue_head_init(&frame_list); ++ ++- if (skb_linearize(skb)) ++- return RX_DROP_UNUSABLE; ++- ++ ieee80211_amsdu_to_8023s(skb, &frame_list, dev->dev_addr, ++ rx->sdata->vif.type, ++ rx->local->hw.extra_tx_headroom, true); ++--- a/net/wireless/util.c +++++ b/net/wireless/util.c ++@@ -657,6 +657,9 @@ void ieee80211_amsdu_to_8023s(struct sk_ ++ int remaining, err; ++ u8 dst[ETH_ALEN], src[ETH_ALEN]; ++ +++ if (skb_linearize(skb)) +++ goto out; +++ ++ if (has_80211_header) { ++ err = ieee80211_data_to_8023(skb, addr, iftype); ++ if (err) diff --git a/package/kernel/mac80211/patches/319-ath9k_htc-add-new-WMI_REG_RMW_CMDID-command.patch b/package/kernel/mac80211/patches/319-ath9k_htc-add-new-WMI_REG_RMW_CMDID-command.patch deleted file mode 100644 index 6af69eb..0000000 @@ -10919,150 +11199,198 @@ index 6af69eb..0000000 - }; - - struct wmi *ath9k_init_wmi(struct ath9k_htc_priv *priv); -diff --git a/package/kernel/mac80211/patches/319-brcmfmac-consolidate-ifp-lookup-in-driver-core.patch b/package/kernel/mac80211/patches/319-brcmfmac-consolidate-ifp-lookup-in-driver-core.patch +diff --git a/package/kernel/mac80211/patches/319-cfg80211-add-function-for-802.3-conversion-with-sepa.patch b/package/kernel/mac80211/patches/319-cfg80211-add-function-for-802.3-conversion-with-sepa.patch new file mode 100644 -index 0000000..97444b3 +index 0000000..b646ab3 --- /dev/null -+++ b/package/kernel/mac80211/patches/319-brcmfmac-consolidate-ifp-lookup-in-driver-core.patch -@@ -0,0 +1,138 @@ -+From: Arend van Spriel -+Date: Wed, 26 Aug 2015 22:14:53 +0200 -+Subject: [PATCH] brcmfmac: consolidate ifp lookup in driver core ++++ b/package/kernel/mac80211/patches/319-cfg80211-add-function-for-802.3-conversion-with-sepa.patch +@@ -0,0 +1,186 @@ ++From: Felix Fietkau ++Date: Tue, 2 Feb 2016 14:39:09 +0100 ++Subject: [PATCH] cfg80211: add function for 802.3 conversion with separate ++ output buffer + -+In rx path the firmware provide an interface index which is used to -+map to a struct brcmf_if instance. However, this involves some trick -+that is done in two places. This is changed by having driver core -+providing brcmf_get_ifp() function. ++Use skb_copy_bits in preparation for allowing fragmented skbs + -+Reviewed-by: Hante Meuleman -+Reviewed-by: Franky (Zhenhui) Lin -+Reviewed-by: Pieter-Paul Giesberts -+Signed-off-by: Arend van Spriel ++Signed-off-by: Felix Fietkau ++Signed-off-by: Johannes Berg +--- + -+--- a/drivers/net/wireless/brcm80211/brcmfmac/bcdc.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/bcdc.c -+@@ -276,6 +276,7 @@ brcmf_proto_bcdc_hdrpull(struct brcmf_pu -+ struct sk_buff *pktbuf) ++--- a/net/wireless/util.c +++++ b/net/wireless/util.c ++@@ -393,9 +393,9 @@ unsigned int ieee80211_get_hdrlen_from_s ++ } ++ EXPORT_SYMBOL(ieee80211_get_hdrlen_from_skb); ++ ++-unsigned int ieee80211_get_mesh_hdrlen(struct ieee80211s_hdr *meshhdr) +++static unsigned int __ieee80211_get_mesh_hdrlen(u8 flags) + { -+ struct brcmf_proto_bcdc_header *h; -++ struct brcmf_if *ifp; -+ -+ brcmf_dbg(BCDC, "Enter\n"); -+ -+@@ -289,30 +290,21 @@ brcmf_proto_bcdc_hdrpull(struct brcmf_pu -+ trace_brcmf_bcdchdr(pktbuf->data); -+ h = (struct brcmf_proto_bcdc_header *)(pktbuf->data); -+ -+- *ifidx = BCDC_GET_IF_IDX(h); -+- if (*ifidx >= BRCMF_MAX_IFS) { -+- brcmf_err("rx data ifnum out of range (%d)\n", *ifidx); -++ ifp = brcmf_get_ifp(drvr, BCDC_GET_IF_IDX(h)); -++ if (IS_ERR_OR_NULL(ifp)) { -++ brcmf_dbg(INFO, "no matching ifp found\n"); -+ return -EBADE; ++- int ae = meshhdr->flags & MESH_FLAGS_AE; +++ int ae = flags & MESH_FLAGS_AE; ++ /* 802.11-2012, 8.2.4.7.3 */ ++ switch (ae) { ++ default: ++@@ -407,21 +407,31 @@ unsigned int ieee80211_get_mesh_hdrlen(s ++ return 18; + } -+- /* The ifidx is the idx to map to matching netdev/ifp. When receiving -+- * events this is easy because it contains the bssidx which maps -+- * 1-on-1 to the netdev/ifp. But for data frames the ifidx is rcvd. -+- * bssidx 1 is used for p2p0 and no data can be received or -+- * transmitted on it. Therefor bssidx is ifidx + 1 if ifidx > 0 -+- */ -+- if (*ifidx) -+- (*ifidx)++; -+- -+ if (((h->flags & BCDC_FLAG_VER_MASK) >> BCDC_FLAG_VER_SHIFT) != -+ BCDC_PROTO_VER) { -+ brcmf_err("%s: non-BCDC packet received, flags 0x%x\n", -+- brcmf_ifname(drvr, *ifidx), h->flags); -++ brcmf_ifname(drvr, ifp->ifidx), h->flags); -+ return -EBADE; -+ } -+ -+ if (h->flags & BCDC_FLAG_SUM_GOOD) { -+ brcmf_dbg(BCDC, "%s: BDC rcv, good checksum, flags 0x%x\n", -+- brcmf_ifname(drvr, *ifidx), h->flags); -++ brcmf_ifname(drvr, ifp->ifidx), h->flags); -+ pktbuf->ip_summed = CHECKSUM_UNNECESSARY; -+ } -+ -+@@ -320,12 +312,15 @@ brcmf_proto_bcdc_hdrpull(struct brcmf_pu -+ -+ skb_pull(pktbuf, BCDC_HEADER_LEN); -+ if (do_fws) -+- brcmf_fws_hdrpull(drvr, *ifidx, h->data_offset << 2, pktbuf); -++ brcmf_fws_hdrpull(drvr, ifp->ifidx, h->data_offset << 2, -++ pktbuf); -+ else -+ skb_pull(pktbuf, h->data_offset << 2); -+ -+ if (pktbuf->len == 0) -+ return -ENODATA; ++ } +++ +++unsigned int ieee80211_get_mesh_hdrlen(struct ieee80211s_hdr *meshhdr) +++{ +++ return __ieee80211_get_mesh_hdrlen(meshhdr->flags); +++} ++ EXPORT_SYMBOL(ieee80211_get_mesh_hdrlen); ++ ++-int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr, ++- enum nl80211_iftype iftype) +++static int __ieee80211_data_to_8023(struct sk_buff *skb, struct ethhdr *ehdr, +++ const u8 *addr, enum nl80211_iftype iftype) ++ { ++ struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; ++- u16 hdrlen, ethertype; ++- u8 *payload; ++- u8 dst[ETH_ALEN]; ++- u8 src[ETH_ALEN] __aligned(2); +++ struct { +++ u8 hdr[ETH_ALEN] __aligned(2); +++ __be16 proto; +++ } payload; +++ struct ethhdr tmp; +++ u16 hdrlen; +++ u8 mesh_flags = 0; ++ ++ if (unlikely(!ieee80211_is_data_present(hdr->frame_control))) ++ return -1; ++ ++ hdrlen = ieee80211_hdrlen(hdr->frame_control); +++ if (skb->len < hdrlen + 8) +++ return -1; ++ ++ /* convert IEEE 802.11 header + possible LLC headers into Ethernet ++ * header ++@@ -432,8 +442,11 @@ int ieee80211_data_to_8023(struct sk_buf ++ * 1 0 BSSID SA DA n/a ++ * 1 1 RA TA DA SA ++ */ ++- memcpy(dst, ieee80211_get_DA(hdr), ETH_ALEN); ++- memcpy(src, ieee80211_get_SA(hdr), ETH_ALEN); +++ memcpy(tmp.h_dest, ieee80211_get_DA(hdr), ETH_ALEN); +++ memcpy(tmp.h_source, ieee80211_get_SA(hdr), ETH_ALEN); +++ +++ if (iftype == NL80211_IFTYPE_MESH_POINT) +++ skb_copy_bits(skb, hdrlen, &mesh_flags, 1); ++ ++ switch (hdr->frame_control & ++ cpu_to_le16(IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) { ++@@ -450,44 +463,31 @@ int ieee80211_data_to_8023(struct sk_buf ++ iftype != NL80211_IFTYPE_STATION)) ++ return -1; ++ if (iftype == NL80211_IFTYPE_MESH_POINT) { ++- struct ieee80211s_hdr *meshdr = ++- (struct ieee80211s_hdr *) (skb->data + hdrlen); ++- /* make sure meshdr->flags is on the linear part */ ++- if (!pskb_may_pull(skb, hdrlen + 1)) ++- return -1; ++- if (meshdr->flags & MESH_FLAGS_AE_A4) +++ if (mesh_flags & MESH_FLAGS_AE_A4) ++ return -1; ++- if (meshdr->flags & MESH_FLAGS_AE_A5_A6) { +++ if (mesh_flags & MESH_FLAGS_AE_A5_A6) { ++ skb_copy_bits(skb, hdrlen + ++ offsetof(struct ieee80211s_hdr, eaddr1), ++- dst, ETH_ALEN); ++- skb_copy_bits(skb, hdrlen + ++- offsetof(struct ieee80211s_hdr, eaddr2), ++- src, ETH_ALEN); +++ tmp.h_dest, 2 * ETH_ALEN); ++ } ++- hdrlen += ieee80211_get_mesh_hdrlen(meshdr); +++ hdrlen += __ieee80211_get_mesh_hdrlen(mesh_flags); ++ } ++ break; ++ case cpu_to_le16(IEEE80211_FCTL_FROMDS): ++ if ((iftype != NL80211_IFTYPE_STATION && ++ iftype != NL80211_IFTYPE_P2P_CLIENT && ++ iftype != NL80211_IFTYPE_MESH_POINT) || ++- (is_multicast_ether_addr(dst) && ++- ether_addr_equal(src, addr))) +++ (is_multicast_ether_addr(tmp.h_dest) && +++ ether_addr_equal(tmp.h_source, addr))) ++ return -1; ++ if (iftype == NL80211_IFTYPE_MESH_POINT) { ++- struct ieee80211s_hdr *meshdr = ++- (struct ieee80211s_hdr *) (skb->data + hdrlen); ++- /* make sure meshdr->flags is on the linear part */ ++- if (!pskb_may_pull(skb, hdrlen + 1)) ++- return -1; ++- if (meshdr->flags & MESH_FLAGS_AE_A5_A6) +++ if (mesh_flags & MESH_FLAGS_AE_A5_A6) ++ return -1; ++- if (meshdr->flags & MESH_FLAGS_AE_A4) +++ if (mesh_flags & MESH_FLAGS_AE_A4) ++ skb_copy_bits(skb, hdrlen + ++ offsetof(struct ieee80211s_hdr, eaddr1), ++- src, ETH_ALEN); ++- hdrlen += ieee80211_get_mesh_hdrlen(meshdr); +++ tmp.h_source, ETH_ALEN); +++ hdrlen += __ieee80211_get_mesh_hdrlen(mesh_flags); ++ } ++ break; ++ case cpu_to_le16(0): ++@@ -498,33 +498,33 @@ int ieee80211_data_to_8023(struct sk_buf ++ break; ++ } ++ ++- if (!pskb_may_pull(skb, hdrlen + 8)) ++- return -1; ++- ++- payload = skb->data + hdrlen; ++- ethertype = (payload[6] << 8) | payload[7]; +++ skb_copy_bits(skb, hdrlen, &payload, sizeof(payload)); +++ tmp.h_proto = payload.proto; ++ ++- if (likely((ether_addr_equal(payload, rfc1042_header) && ++- ethertype != ETH_P_AARP && ethertype != ETH_P_IPX) || ++- ether_addr_equal(payload, bridge_tunnel_header))) { +++ if (likely((ether_addr_equal(payload.hdr, rfc1042_header) && +++ tmp.h_proto != htons(ETH_P_AARP) && +++ tmp.h_proto != htons(ETH_P_IPX)) || +++ ether_addr_equal(payload.hdr, bridge_tunnel_header))) ++ /* remove RFC1042 or Bridge-Tunnel encapsulation and ++ * replace EtherType */ ++- skb_pull(skb, hdrlen + 6); ++- memcpy(skb_push(skb, ETH_ALEN), src, ETH_ALEN); ++- memcpy(skb_push(skb, ETH_ALEN), dst, ETH_ALEN); ++- } else { ++- struct ethhdr *ehdr; ++- __be16 len; +++ hdrlen += ETH_ALEN + 2; +++ else +++ tmp.h_proto = htons(skb->len); ++ ++- skb_pull(skb, hdrlen); ++- len = htons(skb->len); +++ pskb_pull(skb, hdrlen); +++ +++ if (!ehdr) ++ ehdr = (struct ethhdr *) skb_push(skb, sizeof(struct ethhdr)); ++- memcpy(ehdr->h_dest, dst, ETH_ALEN); ++- memcpy(ehdr->h_source, src, ETH_ALEN); ++- ehdr->h_proto = len; ++- } +++ memcpy(ehdr, &tmp, sizeof(tmp)); ++ -++ *ifidx = ifp->ifidx; + return 0; + } -+ -+--- a/drivers/net/wireless/brcm80211/brcmfmac/core.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c -+@@ -83,6 +83,25 @@ char *brcmf_ifname(struct brcmf_pub *drv -+ return ""; -+ } -+ -++struct brcmf_if *brcmf_get_ifp(struct brcmf_pub *drvr, int ifidx) +++ +++int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr, +++ enum nl80211_iftype iftype) ++{ -++ if (ifidx < 0 || ifidx >= BRCMF_MAX_IFS) { -++ brcmf_err("ifidx %d out of range\n", ifidx); -++ return ERR_PTR(-ERANGE); -++ } -++ -++ /* The ifidx is the idx to map to matching netdev/ifp. When receiving -++ * events this is easy because it contains the bssidx which maps -++ * 1-on-1 to the netdev/ifp. But for data frames the ifidx is rcvd. -++ * bssidx 1 is used for p2p0 and no data can be received or -++ * transmitted on it. Therefor bssidx is ifidx + 1 if ifidx > 0 -++ */ -++ if (ifidx) -++ ifidx++; -++ -++ return drvr->iflist[ifidx]; +++ return __ieee80211_data_to_8023(skb, NULL, addr, iftype); ++} -++ -+ static void _brcmf_set_multicast_list(struct work_struct *work) -+ { -+ struct brcmf_if *ifp; -+--- a/drivers/net/wireless/brcm80211/brcmfmac/core.h -++++ b/drivers/net/wireless/brcm80211/brcmfmac/core.h -+@@ -202,7 +202,7 @@ int brcmf_netdev_wait_pend8021x(struct b ++ EXPORT_SYMBOL(ieee80211_data_to_8023); + -+ /* Return pointer to interface name */ -+ char *brcmf_ifname(struct brcmf_pub *drvr, int idx); -+- -++struct brcmf_if *brcmf_get_ifp(struct brcmf_pub *drvr, int ifidx); -+ int brcmf_net_attach(struct brcmf_if *ifp, bool rtnl_locked); -+ struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bssidx, s32 ifidx, -+ char *name, u8 *mac_addr); -+--- a/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c -+@@ -1081,16 +1081,8 @@ brcmf_msgbuf_rx_skb(struct brcmf_msgbuf -+ { -+ struct brcmf_if *ifp; -+ -+- /* The ifidx is the idx to map to matching netdev/ifp. When receiving -+- * events this is easy because it contains the bssidx which maps -+- * 1-on-1 to the netdev/ifp. But for data frames the ifidx is rcvd. -+- * bssidx 1 is used for p2p0 and no data can be received or -+- * transmitted on it. Therefor bssidx is ifidx + 1 if ifidx > 0 -+- */ -+- if (ifidx) -+- (ifidx)++; -+- ifp = msgbuf->drvr->iflist[ifidx]; -+- if (!ifp || !ifp->ndev) { -++ ifp = brcmf_get_ifp(msgbuf->drvr, ifidx); -++ if (IS_ERR_OR_NULL(ifp) || !ifp->ndev) { -+ brcmf_err("Received pkt for invalid ifidx %d\n", ifidx); -+ brcmu_pkt_buf_free_skb(skb); -+ return; ++ int ieee80211_data_from_8023(struct sk_buff *skb, const u8 *addr, diff --git a/package/kernel/mac80211/patches/320-ath9k-ar9271_hw_pa_cal-use-defs-instead-of-magin-num.patch b/package/kernel/mac80211/patches/320-ath9k-ar9271_hw_pa_cal-use-defs-instead-of-magin-num.patch deleted file mode 100644 index c4dd1af..0000000 @@ -11158,234 +11486,171 @@ index c4dd1af..0000000 - regVal = REG_READ(ah, 0x9808); - regVal &= (~(0x1 << 27)); - REG_WRITE(ah, 0x9808, regVal); -diff --git a/package/kernel/mac80211/patches/320-brcmfmac-make-brcmf_proto_hdrpull-return-struct-brcm.patch b/package/kernel/mac80211/patches/320-brcmfmac-make-brcmf_proto_hdrpull-return-struct-brcm.patch +diff --git a/package/kernel/mac80211/patches/320-cfg80211-add-support-for-non-linear-skbs-in-ieee8021.patch b/package/kernel/mac80211/patches/320-cfg80211-add-support-for-non-linear-skbs-in-ieee8021.patch new file mode 100644 -index 0000000..632714c +index 0000000..2eeed22 --- /dev/null -+++ b/package/kernel/mac80211/patches/320-brcmfmac-make-brcmf_proto_hdrpull-return-struct-brcm.patch -@@ -0,0 +1,222 @@ -+From: Arend van Spriel -+Date: Wed, 26 Aug 2015 22:14:54 +0200 -+Subject: [PATCH] brcmfmac: make brcmf_proto_hdrpull() return struct -+ brcmf_if instance ++++ b/package/kernel/mac80211/patches/320-cfg80211-add-support-for-non-linear-skbs-in-ieee8021.patch +@@ -0,0 +1,159 @@ ++From: Felix Fietkau ++Date: Tue, 2 Feb 2016 14:39:10 +0100 ++Subject: [PATCH] cfg80211: add support for non-linear skbs in ++ ieee80211_amsdu_to_8023s + -+Avoid spreading the ifidx in the driver, but have it return the -+struct brcmf_if instance. -+ -+Reviewed-by: Hante Meuleman -+Reviewed-by: Franky (Zhenhui) Lin -+Reviewed-by: Pieter-Paul Giesberts -+Signed-off-by: Arend van Spriel ++Signed-off-by: Felix Fietkau ++Signed-off-by: Johannes Berg +--- + -+--- a/drivers/net/wireless/brcm80211/brcmfmac/bcdc.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/bcdc.c -+@@ -272,11 +272,11 @@ brcmf_proto_bcdc_hdrpush(struct brcmf_pu ++--- a/net/wireless/util.c +++++ b/net/wireless/util.c ++@@ -644,73 +644,75 @@ int ieee80211_data_from_8023(struct sk_b + } ++ EXPORT_SYMBOL(ieee80211_data_from_8023); + -+ static int -+-brcmf_proto_bcdc_hdrpull(struct brcmf_pub *drvr, bool do_fws, u8 *ifidx, -+- struct sk_buff *pktbuf) -++brcmf_proto_bcdc_hdrpull(struct brcmf_pub *drvr, bool do_fws, -++ struct sk_buff *pktbuf, struct brcmf_if **ifp) -+ { -+ struct brcmf_proto_bcdc_header *h; -+- struct brcmf_if *ifp; -++ struct brcmf_if *tmp_if; -+ -+ brcmf_dbg(BCDC, "Enter\n"); -+ -+@@ -290,21 +290,21 @@ brcmf_proto_bcdc_hdrpull(struct brcmf_pu -+ trace_brcmf_bcdchdr(pktbuf->data); -+ h = (struct brcmf_proto_bcdc_header *)(pktbuf->data); -+ -+- ifp = brcmf_get_ifp(drvr, BCDC_GET_IF_IDX(h)); -+- if (IS_ERR_OR_NULL(ifp)) { -++ tmp_if = brcmf_get_ifp(drvr, BCDC_GET_IF_IDX(h)); -++ if (!tmp_if) { -+ brcmf_dbg(INFO, "no matching ifp found\n"); -+ return -EBADE; -+ } -+ if (((h->flags & BCDC_FLAG_VER_MASK) >> BCDC_FLAG_VER_SHIFT) != -+ BCDC_PROTO_VER) { -+ brcmf_err("%s: non-BCDC packet received, flags 0x%x\n", -+- brcmf_ifname(drvr, ifp->ifidx), h->flags); -++ brcmf_ifname(drvr, tmp_if->ifidx), h->flags); -+ return -EBADE; -+ } -+ -+ if (h->flags & BCDC_FLAG_SUM_GOOD) { -+ brcmf_dbg(BCDC, "%s: BDC rcv, good checksum, flags 0x%x\n", -+- brcmf_ifname(drvr, ifp->ifidx), h->flags); -++ brcmf_ifname(drvr, tmp_if->ifidx), h->flags); -+ pktbuf->ip_summed = CHECKSUM_UNNECESSARY; -+ } -+ -+@@ -312,7 +312,7 @@ brcmf_proto_bcdc_hdrpull(struct brcmf_pu -+ -+ skb_pull(pktbuf, BCDC_HEADER_LEN); -+ if (do_fws) -+- brcmf_fws_hdrpull(drvr, ifp->ifidx, h->data_offset << 2, -++ brcmf_fws_hdrpull(drvr, tmp_if->ifidx, h->data_offset << 2, -+ pktbuf); -+ else -+ skb_pull(pktbuf, h->data_offset << 2); -+@@ -320,7 +320,7 @@ brcmf_proto_bcdc_hdrpull(struct brcmf_pu -+ if (pktbuf->len == 0) -+ return -ENODATA; -+ -+- *ifidx = ifp->ifidx; -++ *ifp = tmp_if; -+ return 0; -+ } -+ -+--- a/drivers/net/wireless/brcm80211/brcmfmac/core.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c -+@@ -87,7 +87,7 @@ struct brcmf_if *brcmf_get_ifp(struct br -+ { -+ if (ifidx < 0 || ifidx >= BRCMF_MAX_IFS) { -+ brcmf_err("ifidx %d out of range\n", ifidx); -+- return ERR_PTR(-ERANGE); -++ return NULL; -+ } -+ -+ /* The ifidx is the idx to map to matching netdev/ifp. When receiving -+@@ -539,17 +539,15 @@ void brcmf_rx_frame(struct device *dev, -+ struct brcmf_bus *bus_if = dev_get_drvdata(dev); -+ struct brcmf_pub *drvr = bus_if->drvr; -+ struct brcmf_skb_reorder_data *rd; -+- u8 ifidx; -+ int ret; -+ -+ brcmf_dbg(DATA, "Enter: %s: rxp=%p\n", dev_name(dev), skb); -+ -+ /* process and remove protocol-specific header */ -+- ret = brcmf_proto_hdrpull(drvr, true, &ifidx, skb); -+- ifp = drvr->iflist[ifidx]; -++ ret = brcmf_proto_hdrpull(drvr, true, skb, &ifp); -+ -+ if (ret || !ifp || !ifp->ndev) { -+- if ((ret != -ENODATA) && ifp) -++ if (ret != -ENODATA && ifp) -+ ifp->stats.rx_errors++; -+ brcmu_pkt_buf_free_skb(skb); -+ return; -+@@ -592,17 +590,17 @@ void brcmf_txcomplete(struct device *dev -+ { -+ struct brcmf_bus *bus_if = dev_get_drvdata(dev); -+ struct brcmf_pub *drvr = bus_if->drvr; -+- u8 ifidx; -++ struct brcmf_if *ifp; -+ -+ /* await txstatus signal for firmware if active */ -+ if (brcmf_fws_fc_active(drvr->fws)) { -+ if (!success) -+ brcmf_fws_bustxfail(drvr->fws, txp); -+ } else { -+- if (brcmf_proto_hdrpull(drvr, false, &ifidx, txp)) -++ if (brcmf_proto_hdrpull(drvr, false, txp, &ifp)) -+ brcmu_pkt_buf_free_skb(txp); -+ else -+- brcmf_txfinalize(drvr, txp, ifidx, success); -++ brcmf_txfinalize(drvr, txp, ifp->ifidx, success); -+ } -+ } -+ -+--- a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c -+@@ -1448,7 +1448,7 @@ brcmf_fws_txs_process(struct brcmf_fws_i -+ struct sk_buff *skb; -+ struct brcmf_skbuff_cb *skcb; -+ struct brcmf_fws_mac_descriptor *entry = NULL; -+- u8 ifidx; -++ struct brcmf_if *ifp; -+ -+ brcmf_dbg(DATA, "flags %d\n", flags); -+ -+@@ -1497,15 +1497,16 @@ brcmf_fws_txs_process(struct brcmf_fws_i -+ } -+ brcmf_fws_macdesc_return_req_credit(skb); -+ -+- if (brcmf_proto_hdrpull(fws->drvr, false, &ifidx, skb)) { -++ ret = brcmf_proto_hdrpull(fws->drvr, false, skb, &ifp); -++ if (ret) { -+ brcmu_pkt_buf_free_skb(skb); -+ return -EINVAL; -+ } -+ if (!remove_from_hanger) -+- ret = brcmf_fws_txstatus_suppressed(fws, fifo, skb, ifidx, -++ ret = brcmf_fws_txstatus_suppressed(fws, fifo, skb, ifp->ifidx, -+ genbit, seq); -+ if (remove_from_hanger || ret) -+- brcmf_txfinalize(fws->drvr, skb, ifidx, true); -++ brcmf_txfinalize(fws->drvr, skb, ifp->ifidx, true); -+ -+ return 0; -+ } -+@@ -1848,7 +1849,7 @@ static int brcmf_fws_commit_skb(struct b -+ entry->transit_count--; -+ if (entry->suppressed) -+ entry->suppr_transit_count--; -+- brcmf_proto_hdrpull(fws->drvr, false, &ifidx, skb); -++ (void)brcmf_proto_hdrpull(fws->drvr, false, skb, NULL); -+ goto rollback; -+ } -+ -+--- a/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c -+@@ -522,7 +522,7 @@ static int brcmf_msgbuf_set_dcmd(struct -+ -+ -+ static int brcmf_msgbuf_hdrpull(struct brcmf_pub *drvr, bool do_fws, -+- u8 *ifidx, struct sk_buff *skb) -++ struct sk_buff *skb, struct brcmf_if **ifp) -+ { -+ return -ENODEV; -+ } -+@@ -1082,7 +1082,7 @@ brcmf_msgbuf_rx_skb(struct brcmf_msgbuf -+ struct brcmf_if *ifp; -+ -+ ifp = brcmf_get_ifp(msgbuf->drvr, ifidx); -+- if (IS_ERR_OR_NULL(ifp) || !ifp->ndev) { -++ if (!ifp || !ifp->ndev) { -+ brcmf_err("Received pkt for invalid ifidx %d\n", ifidx); -+ brcmu_pkt_buf_free_skb(skb); -+ return; -+--- a/drivers/net/wireless/brcm80211/brcmfmac/proto.h -++++ b/drivers/net/wireless/brcm80211/brcmfmac/proto.h -+@@ -24,8 +24,8 @@ enum proto_addr_mode { -+ -+ -+ struct brcmf_proto { -+- int (*hdrpull)(struct brcmf_pub *drvr, bool do_fws, u8 *ifidx, -+- struct sk_buff *skb); -++ int (*hdrpull)(struct brcmf_pub *drvr, bool do_fws, -++ struct sk_buff *skb, struct brcmf_if **ifp); -+ int (*query_dcmd)(struct brcmf_pub *drvr, int ifidx, uint cmd, -+ void *buf, uint len); -+ int (*set_dcmd)(struct brcmf_pub *drvr, int ifidx, uint cmd, void *buf, -+@@ -46,9 +46,19 @@ int brcmf_proto_attach(struct brcmf_pub -+ void brcmf_proto_detach(struct brcmf_pub *drvr); -+ -+ static inline int brcmf_proto_hdrpull(struct brcmf_pub *drvr, bool do_fws, -+- u8 *ifidx, struct sk_buff *skb) -++ struct sk_buff *skb, -++ struct brcmf_if **ifp) -+ { -+- return drvr->proto->hdrpull(drvr, do_fws, ifidx, skb); -++ struct brcmf_if *tmp = NULL; +++static struct sk_buff * +++__ieee80211_amsdu_copy(struct sk_buff *skb, unsigned int hlen, +++ int offset, int len) +++{ +++ struct sk_buff *frame; ++ -++ /* assure protocol is always called with -++ * non-null initialized pointer. +++ if (skb->len - offset < len) +++ return NULL; +++ +++ /* +++ * Allocate and reserve two bytes more for payload +++ * alignment since sizeof(struct ethhdr) is 14. ++ */ -++ if (ifp) -++ *ifp = NULL; -++ else -++ ifp = &tmp; -++ return drvr->proto->hdrpull(drvr, do_fws, skb, ifp); -+ } -+ static inline int brcmf_proto_query_dcmd(struct brcmf_pub *drvr, int ifidx, -+ uint cmd, void *buf, uint len) +++ frame = dev_alloc_skb(hlen + sizeof(struct ethhdr) + 2 + len); +++ +++ skb_reserve(frame, hlen + sizeof(struct ethhdr) + 2); +++ skb_copy_bits(skb, offset, skb_put(frame, len), len); +++ +++ return frame; +++} ++ ++ void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list, ++ const u8 *addr, enum nl80211_iftype iftype, ++ const unsigned int extra_headroom, ++ bool has_80211_header) ++ { +++ unsigned int hlen = ALIGN(extra_headroom, 4); ++ struct sk_buff *frame = NULL; ++ u16 ethertype; ++ u8 *payload; ++- const struct ethhdr *eth; ++- int remaining, err; ++- u8 dst[ETH_ALEN], src[ETH_ALEN]; ++- ++- if (skb_linearize(skb)) ++- goto out; +++ int offset = 0, remaining, err; +++ struct ethhdr eth; +++ bool reuse_skb = true; +++ bool last = false; ++ ++ if (has_80211_header) { ++- err = ieee80211_data_to_8023(skb, addr, iftype); +++ err = __ieee80211_data_to_8023(skb, ð, addr, iftype); ++ if (err) ++ goto out; ++- ++- /* skip the wrapping header */ ++- eth = (struct ethhdr *) skb_pull(skb, sizeof(struct ethhdr)); ++- if (!eth) ++- goto out; ++- } else { ++- eth = (struct ethhdr *) skb->data; ++ } ++ ++- while (skb != frame) { +++ while (!last) { +++ unsigned int subframe_len; +++ int len; ++ u8 padding; ++- __be16 len = eth->h_proto; ++- unsigned int subframe_len = sizeof(struct ethhdr) + ntohs(len); ++- ++- remaining = skb->len; ++- memcpy(dst, eth->h_dest, ETH_ALEN); ++- memcpy(src, eth->h_source, ETH_ALEN); ++ +++ skb_copy_bits(skb, offset, ð, sizeof(eth)); +++ len = ntohs(eth.h_proto); +++ subframe_len = sizeof(struct ethhdr) + len; ++ padding = (4 - subframe_len) & 0x3; +++ ++ /* the last MSDU has no padding */ +++ remaining = skb->len - offset; ++ if (subframe_len > remaining) ++ goto purge; ++ ++- skb_pull(skb, sizeof(struct ethhdr)); +++ offset += sizeof(struct ethhdr); ++ /* reuse skb for the last subframe */ ++- if (remaining <= subframe_len + padding) +++ last = remaining <= subframe_len + padding; +++ if (!skb_is_nonlinear(skb) && last) { +++ skb_pull(skb, offset); ++ frame = skb; ++- else { ++- unsigned int hlen = ALIGN(extra_headroom, 4); ++- /* ++- * Allocate and reserve two bytes more for payload ++- * alignment since sizeof(struct ethhdr) is 14. ++- */ ++- frame = dev_alloc_skb(hlen + subframe_len + 2); +++ reuse_skb = true; +++ } else { +++ frame = __ieee80211_amsdu_copy(skb, hlen, offset, len); ++ if (!frame) ++ goto purge; ++ ++- skb_reserve(frame, hlen + sizeof(struct ethhdr) + 2); ++- memcpy(skb_put(frame, ntohs(len)), skb->data, ++- ntohs(len)); ++- ++- eth = (struct ethhdr *)skb_pull(skb, ntohs(len) + ++- padding); ++- if (!eth) { ++- dev_kfree_skb(frame); ++- goto purge; ++- } +++ offset += len + padding; ++ } ++ ++ skb_reset_network_header(frame); ++@@ -719,24 +721,20 @@ void ieee80211_amsdu_to_8023s(struct sk_ ++ ++ payload = frame->data; ++ ethertype = (payload[6] << 8) | payload[7]; ++- ++ if (likely((ether_addr_equal(payload, rfc1042_header) && ++ ethertype != ETH_P_AARP && ethertype != ETH_P_IPX) || ++ ether_addr_equal(payload, bridge_tunnel_header))) { ++- /* remove RFC1042 or Bridge-Tunnel ++- * encapsulation and replace EtherType */ ++- skb_pull(frame, 6); ++- memcpy(skb_push(frame, ETH_ALEN), src, ETH_ALEN); ++- memcpy(skb_push(frame, ETH_ALEN), dst, ETH_ALEN); ++- } else { ++- memcpy(skb_push(frame, sizeof(__be16)), &len, ++- sizeof(__be16)); ++- memcpy(skb_push(frame, ETH_ALEN), src, ETH_ALEN); ++- memcpy(skb_push(frame, ETH_ALEN), dst, ETH_ALEN); +++ eth.h_proto = htons(ethertype); +++ skb_pull(frame, ETH_ALEN + 2); ++ } +++ +++ memcpy(skb_push(frame, sizeof(eth)), ð, sizeof(eth)); ++ __skb_queue_tail(list, frame); ++ } ++ +++ if (!reuse_skb) +++ dev_kfree_skb(skb); +++ ++ return; ++ ++ purge: diff --git a/package/kernel/mac80211/patches/321-ath9k-ar9271_hw_pa_cal-use-proper-makroses.patch b/package/kernel/mac80211/patches/321-ath9k-ar9271_hw_pa_cal-use-proper-makroses.patch deleted file mode 100644 index f05287d..0000000 @@ -11471,99 +11736,167 @@ index f05287d..0000000 - for (i = 0; i < ARRAY_SIZE(regList); i++) - REG_WRITE(ah, regList[i][0], regList[i][1]); - -diff --git a/package/kernel/mac80211/patches/321-brcmfmac-change-parameters-for-brcmf_remove_interfac.patch b/package/kernel/mac80211/patches/321-brcmfmac-change-parameters-for-brcmf_remove_interfac.patch +diff --git a/package/kernel/mac80211/patches/321-mac80211-Parse-legacy-and-HT-rate-in-injected-frames.patch b/package/kernel/mac80211/patches/321-mac80211-Parse-legacy-and-HT-rate-in-injected-frames.patch new file mode 100644 -index 0000000..3360cbc +index 0000000..c4155a1 --- /dev/null -+++ b/package/kernel/mac80211/patches/321-brcmfmac-change-parameters-for-brcmf_remove_interfac.patch -@@ -0,0 +1,87 @@ -+From: Arend van Spriel -+Date: Wed, 26 Aug 2015 22:14:55 +0200 -+Subject: [PATCH] brcmfmac: change parameters for -+ brcmf_remove_interface() ++++ b/package/kernel/mac80211/patches/321-mac80211-Parse-legacy-and-HT-rate-in-injected-frames.patch +@@ -0,0 +1,155 @@ ++From: Sven Eckelmann ++Date: Tue, 26 Jan 2016 17:11:13 +0100 ++Subject: [PATCH] mac80211: Parse legacy and HT rate in injected frames + -+Just pass the interface to be removed, ie. the struct brcmf_if instance. ++Drivers/devices without their own rate control algorithm can get the ++information what rates they should use from either the radiotap header of ++injected frames or from the rate control algorithm. But the parsing of the ++legacy rate information from the radiotap header was removed in commit ++e6a9854b05c1 ("mac80211/drivers: rewrite the rate control API"). + -+Reviewed-by: Hante Meuleman -+Reviewed-by: Franky (Zhenhui) Lin -+Reviewed-by: Pieter-Paul Giesberts -+Signed-off-by: Arend van Spriel ++The removal of this feature heavily reduced the usefulness of frame ++injection when wanting to simulate specific transmission behavior. Having ++rate parsing together with MCS rates and retry support allows a fine ++grained selection of the tx behavior of injected frames for these kind of ++tests. ++ ++Signed-off-by: Sven Eckelmann ++Cc: Simon Wunderlich ++Signed-off-by: Johannes Berg +--- + -+--- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c -+@@ -4983,7 +4983,7 @@ brcmf_notify_connect_status_ap(struct br -+ brcmf_dbg(CONN, "AP mode link down\n"); -+ complete(&cfg->vif_disabled); -+ if (ifp->vif->mbss) -+- brcmf_remove_interface(ifp->drvr, ifp->bssidx); -++ brcmf_remove_interface(ifp); -+ return 0; -+ } ++--- a/include/net/mac80211.h +++++ b/include/net/mac80211.h ++@@ -708,12 +708,14 @@ enum mac80211_tx_info_flags { ++ * protocol frame (e.g. EAP) ++ * @IEEE80211_TX_CTRL_PS_RESPONSE: This frame is a response to a poll ++ * frame (PS-Poll or uAPSD). +++ * @IEEE80211_TX_CTRL_RATE_INJECT: This frame is injected with rate information ++ * ++ * These flags are used in tx_info->control.flags. ++ */ ++ enum mac80211_tx_control_flags { ++ IEEE80211_TX_CTRL_PORT_CTRL_PROTO = BIT(0), ++ IEEE80211_TX_CTRL_PS_RESPONSE = BIT(1), +++ IEEE80211_TX_CTRL_RATE_INJECT = BIT(2), ++ }; + -+--- a/drivers/net/wireless/brcm80211/brcmfmac/core.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c -+@@ -887,12 +887,13 @@ static void brcmf_del_if(struct brcmf_pu -+ } -+ } ++ /* ++--- a/net/mac80211/tx.c +++++ b/net/mac80211/tx.c ++@@ -710,6 +710,10 @@ ieee80211_tx_h_rate_ctrl(struct ieee8021 + -+-void brcmf_remove_interface(struct brcmf_pub *drvr, u32 bssidx) -++void brcmf_remove_interface(struct brcmf_if *ifp) -+ { -+- if (drvr->iflist[bssidx]) { -+- brcmf_fws_del_interface(drvr->iflist[bssidx]); -+- brcmf_del_if(drvr, bssidx); -+- } -++ if (!ifp || WARN_ON(ifp->drvr->iflist[ifp->bssidx] != ifp)) -++ return; ++ info->control.short_preamble = txrc.short_preamble; ++ +++ /* don't ask rate control when rate already injected via radiotap */ +++ if (info->control.flags & IEEE80211_TX_CTRL_RATE_INJECT) +++ return TX_CONTINUE; ++ -++ brcmf_fws_del_interface(ifp); -++ brcmf_del_if(ifp->drvr, ifp->bssidx); ++ if (tx->sta) ++ assoc = test_sta_flag(tx->sta, WLAN_STA_ASSOC); ++ ++@@ -1665,15 +1669,24 @@ void ieee80211_xmit(struct ieee80211_sub ++ ieee80211_tx(sdata, sta, skb, false); + } + -+ int brcmf_get_next_free_bsscfgidx(struct brcmf_pub *drvr) -+@@ -1122,7 +1123,7 @@ void brcmf_detach(struct device *dev) -+ -+ /* make sure primary interface removed last */ -+ for (i = BRCMF_MAX_IFS-1; i > -1; i--) -+- brcmf_remove_interface(drvr, i); -++ brcmf_remove_interface(drvr->iflist[i]); -+ -+ brcmf_cfg80211_detach(drvr->config); -+ -+--- a/drivers/net/wireless/brcm80211/brcmfmac/core.h -++++ b/drivers/net/wireless/brcm80211/brcmfmac/core.h -+@@ -206,7 +206,7 @@ struct brcmf_if *brcmf_get_ifp(struct br -+ int brcmf_net_attach(struct brcmf_if *ifp, bool rtnl_locked); -+ struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bssidx, s32 ifidx, -+ char *name, u8 *mac_addr); -+-void brcmf_remove_interface(struct brcmf_pub *drvr, u32 bssidx); -++void brcmf_remove_interface(struct brcmf_if *ifp); -+ int brcmf_get_next_free_bsscfgidx(struct brcmf_pub *drvr); -+ void brcmf_txflowblock_if(struct brcmf_if *ifp, -+ enum brcmf_netif_stop_reason reason, bool state); -+--- a/drivers/net/wireless/brcm80211/brcmfmac/fweh.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/fweh.c -+@@ -222,7 +222,7 @@ static void brcmf_fweh_handle_if_event(s -+ err = brcmf_fweh_call_event_handler(ifp, emsg->event_code, emsg, data); -+ -+ if (ifp && ifevent->action == BRCMF_E_IF_DEL) -+- brcmf_remove_interface(drvr, ifevent->bssidx); -++ brcmf_remove_interface(ifp); -+ } -+ -+ /** -+--- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c -+@@ -2140,7 +2140,7 @@ static void brcmf_p2p_delete_p2pdev(stru ++-static bool ieee80211_parse_tx_radiotap(struct sk_buff *skb) +++static bool ieee80211_parse_tx_radiotap(struct ieee80211_local *local, +++ struct sk_buff *skb) + { -+ cfg80211_unregister_wdev(&vif->wdev); -+ p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; -+- brcmf_remove_interface(vif->ifp->drvr, vif->ifp->bssidx); -++ brcmf_remove_interface(vif->ifp); -+ brcmf_free_vif(vif); -+ } ++ struct ieee80211_radiotap_iterator iterator; ++ struct ieee80211_radiotap_header *rthdr = ++ (struct ieee80211_radiotap_header *) skb->data; ++ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); +++ struct ieee80211_supported_band *sband = +++ local->hw.wiphy->bands[info->band]; ++ int ret = ieee80211_radiotap_iterator_init(&iterator, rthdr, skb->len, ++ NULL); ++ u16 txflags; +++ u16 rate = 0; +++ bool rate_found = false; +++ u8 rate_retries = 0; +++ u16 rate_flags = 0; +++ u8 mcs_known, mcs_flags; +++ int i; + ++ info->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT | ++ IEEE80211_TX_CTL_DONTFRAG; ++@@ -1724,6 +1737,35 @@ static bool ieee80211_parse_tx_radiotap( ++ info->flags |= IEEE80211_TX_CTL_NO_ACK; ++ break; ++ +++ case IEEE80211_RADIOTAP_RATE: +++ rate = *iterator.this_arg; +++ rate_flags = 0; +++ rate_found = true; +++ break; +++ +++ case IEEE80211_RADIOTAP_DATA_RETRIES: +++ rate_retries = *iterator.this_arg; +++ break; +++ +++ case IEEE80211_RADIOTAP_MCS: +++ mcs_known = iterator.this_arg[0]; +++ mcs_flags = iterator.this_arg[1]; +++ if (!(mcs_known & IEEE80211_RADIOTAP_MCS_HAVE_MCS)) +++ break; +++ +++ rate_found = true; +++ rate = iterator.this_arg[2]; +++ rate_flags = IEEE80211_TX_RC_MCS; +++ +++ if (mcs_known & IEEE80211_RADIOTAP_MCS_HAVE_GI && +++ mcs_flags & IEEE80211_RADIOTAP_MCS_SGI) +++ rate_flags |= IEEE80211_TX_RC_SHORT_GI; +++ +++ if (mcs_known & IEEE80211_RADIOTAP_MCS_HAVE_BW && +++ mcs_flags & IEEE80211_RADIOTAP_MCS_BW_40) +++ rate_flags |= IEEE80211_TX_RC_40_MHZ_WIDTH; +++ break; +++ ++ /* ++ * Please update the file ++ * Documentation/networking/mac80211-injection.txt ++@@ -1738,6 +1780,32 @@ static bool ieee80211_parse_tx_radiotap( ++ if (ret != -ENOENT) /* ie, if we didn't simply run out of fields */ ++ return false; ++ +++ if (rate_found) { +++ info->control.flags |= IEEE80211_TX_CTRL_RATE_INJECT; +++ +++ for (i = 0; i < IEEE80211_TX_MAX_RATES; i++) { +++ info->control.rates[i].idx = -1; +++ info->control.rates[i].flags = 0; +++ info->control.rates[i].count = 0; +++ } +++ +++ if (rate_flags & IEEE80211_TX_RC_MCS) { +++ info->control.rates[0].idx = rate; +++ } else { +++ for (i = 0; i < sband->n_bitrates; i++) { +++ if (rate * 5 != sband->bitrates[i].bitrate) +++ continue; +++ +++ info->control.rates[0].idx = i; +++ break; +++ } +++ } +++ +++ info->control.rates[0].flags = rate_flags; +++ info->control.rates[0].count = min_t(u8, rate_retries + 1, +++ local->hw.max_rate_tries); +++ } +++ ++ /* ++ * remove the radiotap header ++ * iterator->_max_length was sanity-checked against ++@@ -1819,7 +1887,7 @@ netdev_tx_t ieee80211_monitor_start_xmit ++ IEEE80211_TX_CTL_INJECTED; ++ ++ /* process and remove the injection radiotap header */ ++- if (!ieee80211_parse_tx_radiotap(skb)) +++ if (!ieee80211_parse_tx_radiotap(local, skb)) ++ goto fail; ++ ++ rcu_read_lock(); diff --git a/package/kernel/mac80211/patches/322-ath9k-ar9271_hw_pa_cal-use-RMW-buffer.patch b/package/kernel/mac80211/patches/322-ath9k-ar9271_hw_pa_cal-use-RMW-buffer.patch deleted file mode 100644 index 7247369..0000000 @@ -11618,104 +11951,642 @@ index 7247369..0000000 - - ENABLE_REGWRITE_BUFFER(ah); - for (i = 0; i < ARRAY_SIZE(regList); i++) -diff --git a/package/kernel/mac80211/patches/322-brcmfmac-only-call-brcmf_cfg80211_detach-when-attach.patch b/package/kernel/mac80211/patches/322-brcmfmac-only-call-brcmf_cfg80211_detach-when-attach.patch +diff --git a/package/kernel/mac80211/patches/322-mac80211-add-A-MSDU-tx-support.patch b/package/kernel/mac80211/patches/322-mac80211-add-A-MSDU-tx-support.patch new file mode 100644 -index 0000000..2b61f4e +index 0000000..d55f772 --- /dev/null -+++ b/package/kernel/mac80211/patches/322-brcmfmac-only-call-brcmf_cfg80211_detach-when-attach.patch -@@ -0,0 +1,92 @@ -+From: Arend van Spriel -+Date: Wed, 26 Aug 2015 22:14:56 +0200 -+Subject: [PATCH] brcmfmac: only call brcmf_cfg80211_detach() when attach -+ was successful ++++ b/package/kernel/mac80211/patches/322-mac80211-add-A-MSDU-tx-support.patch +@@ -0,0 +1,292 @@ ++From: Felix Fietkau ++Date: Fri, 5 Feb 2016 01:38:51 +0100 ++Subject: [PATCH] mac80211: add A-MSDU tx support + -+In brcmf_bus_start() the function brcmf_cfg80211_attach() is called which -+may fail. If this happens we should not call brcmf_cfg80211_detach() in -+the failure path as it will result in NULL pointer dereference: ++Requires software tx queueing support. frag_list support (for zero-copy) ++is optional. + -+ brcmf_fweh_activate_events: Set event_msgs error (-5) -+ brcmf_bus_start: failed: -5 -+ brcmf_sdio_firmware_callback: dongle is not responding -+ BUG: unable to handle kernel NULL pointer dereference at 0000000000000068 -+ IP: [] kernfs_find_ns+0x18/0xd0 -+ PGD 0 -+ Oops: 0000 [#1] SMP -+ Modules linked in: brcmfmac(O) brcmutil(O) cfg80211 auth_rpcgss -+ CPU: 1 PID: 45 Comm: kworker/1:1 Tainted: G O -+ Hardware name: Dell Inc. Latitude E6410/07XJP9, BIOS A07 02/15/2011 -+ Workqueue: events request_firmware_work_func -+ task: ffff880036c09ac0 ti: ffff880036dd4000 task.ti: ffff880036dd4000 -+ RIP: 0010:[] [] kernfs_find_ns+0x18/0xd0 -+ RSP: 0018:ffff880036dd7a28 EFLAGS: 00010246 -+ RAX: ffff880036c09ac0 RBX: 0000000000000000 RCX: 000000007fffffff -+ RDX: 0000000000000000 RSI: ffffffff816578b9 RDI: 0000000000000000 -+ RBP: ffff880036dd7a48 R08: 0000000000000000 R09: ffff880036c0b340 -+ R10: 00000000000002ec R11: ffff880036dd7b08 R12: ffffffff816578b9 -+ R13: 0000000000000000 R14: ffffffff816578b9 R15: ffff8800c6c87000 -+ FS: 0000000000000000(0000) GS:ffff88012bc40000(0000) knlGS:0000000000000000 -+ CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b -+ CR2: 0000000000000068 CR3: 0000000001a0b000 CR4: 00000000000006e0 -+ Stack: -+ 0000000000000000 ffffffff816578b9 0000000000000000 ffff8800c0d003c8 -+ ffff880036dd7a78 ffffffff811e8ff5 0000000ffffffff1 ffffffff81a9b060 -+ ffff8800c789f880 ffff8800c0d00000 ffff880036dd7a98 ffffffff811ebe0d -+ Call Trace: -+ [] kernfs_find_and_get_ns+0x35/0x60 -+ [] sysfs_unmerge_group+0x1d/0x60 -+ [] dpm_sysfs_remove+0x22/0x60 -+ [] device_del+0x49/0x240 -+ [] rfkill_unregister+0x58/0xc0 -+ [] wiphy_unregister+0xab/0x2f0 [cfg80211] -+ [] brcmf_cfg80211_detach+0x23/0x50 [brcmfmac] -+ [] brcmf_detach+0x86/0xe0 [brcmfmac] -+ [] brcmf_sdio_remove+0x48/0x120 [brcmfmac] -+ [] brcmf_sdiod_remove+0x29/0xd0 [brcmfmac] -+ [] brcmf_ops_sdio_remove+0xb1/0x110 [brcmfmac] -+ [] sdio_bus_remove+0x37/0x100 [mmc_core] -+ [] __device_release_driver+0x96/0x130 -+ [] device_release_driver+0x23/0x30 -+ [] brcmf_sdio_firmware_callback+0x2a8/0x5d0 [brcmfmac] -+ [] brcmf_fw_request_nvram_done+0x15f/0x5e0 [brcmfmac] -+ [] ? devres_add+0x3f/0x50 -+ [] ? usermodehelper_read_unlock+0x15/0x20 -+ [] ? platform_match+0x70/0xa0 -+ [] request_firmware_work_func+0x30/0x60 -+ [] process_one_work+0x14c/0x3d0 -+ [] worker_thread+0x11a/0x450 -+ [] ? process_one_work+0x3d0/0x3d0 -+ [] kthread+0xd2/0xf0 -+ [] ? kthread_create_on_node+0x180/0x180 -+ [] ret_from_fork+0x3f/0x70 -+ [] ? kthread_create_on_node+0x180/0x180 -+ Code: e9 40 fe ff ff 48 89 d8 eb 87 66 0f 1f 84 00 00 00 00 00 66 66 66 66 -+ 90 55 48 89 e5 41 56 49 89 f6 41 55 49 89 d5 31 d2 41 54 53 <0f> b7 -+ 47 68 48 8b 5f 48 66 c1 e8 05 83 e0 01 4d 85 ed 0f b6 c8 -+ RIP [] kernfs_find_ns+0x18/0xd0 -+ RSP -+ CR2: 0000000000000068 -+ ---[ end trace 87d6ec0d3fe46740 ]--- -+ -+Reported-by: Daniel (Deognyoun) Kim -+Reviewed-by: Hante Meuleman -+Reviewed-by: Franky (Zhenhui) Lin -+Reviewed-by: Pieter-Paul Giesberts -+Signed-off-by: Arend van Spriel ++Signed-off-by: Felix Fietkau +--- + -+--- a/drivers/net/wireless/brcm80211/brcmfmac/core.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c -+@@ -1049,7 +1049,10 @@ int brcmf_bus_start(struct device *dev) -+ fail: -+ if (ret < 0) { -+ brcmf_err("failed: %d\n", ret); -+- brcmf_cfg80211_detach(drvr->config); -++ if (drvr->config) { -++ brcmf_cfg80211_detach(drvr->config); -++ drvr->config = NULL; ++--- a/include/net/mac80211.h +++++ b/include/net/mac80211.h ++@@ -709,6 +709,7 @@ enum mac80211_tx_info_flags { ++ * @IEEE80211_TX_CTRL_PS_RESPONSE: This frame is a response to a poll ++ * frame (PS-Poll or uAPSD). ++ * @IEEE80211_TX_CTRL_RATE_INJECT: This frame is injected with rate information +++ * @IEEE80211_TX_CTRL_AMSDU: This frame is an A-MSDU frame ++ * ++ * These flags are used in tx_info->control.flags. ++ */ ++@@ -716,6 +717,7 @@ enum mac80211_tx_control_flags { ++ IEEE80211_TX_CTRL_PORT_CTRL_PROTO = BIT(0), ++ IEEE80211_TX_CTRL_PS_RESPONSE = BIT(1), ++ IEEE80211_TX_CTRL_RATE_INJECT = BIT(2), +++ IEEE80211_TX_CTRL_AMSDU = BIT(3), ++ }; ++ ++ /* ++@@ -1961,6 +1963,12 @@ struct ieee80211_txq { ++ * order and does not need to manage its own reorder buffer or BA session ++ * timeout. ++ * +++ * @IEEE80211_HW_TX_AMSDU: Hardware (or driver) supports software aggregated +++ * A-MSDU frames. Requires software tx queueing support. +++ * +++ * @IEEE80211_HW_TX_FRAG_LIST: Hardware (or driver) supports sending frag_list +++ * skbs, needed for zero-copy software A-MSDU. +++ * ++ * @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays ++ */ ++ enum ieee80211_hw_flags { ++@@ -1998,6 +2006,8 @@ enum ieee80211_hw_flags { ++ IEEE80211_HW_BEACON_TX_STATUS, ++ IEEE80211_HW_NEEDS_UNIQUE_STA_ADDR, ++ IEEE80211_HW_SUPPORTS_REORDERING_BUFFER, +++ IEEE80211_HW_TX_AMSDU, +++ IEEE80211_HW_TX_FRAG_LIST, ++ ++ /* keep last, obviously */ ++ NUM_IEEE80211_HW_FLAGS ++@@ -2070,6 +2080,8 @@ enum ieee80211_hw_flags { ++ * size is smaller (an example is LinkSys WRT120N with FW v1.0.07 ++ * build 002 Jun 18 2012). ++ * +++ * @max_tx_fragments: maximum fragments per (A-)MSDU. +++ * ++ * @offchannel_tx_hw_queue: HW queue ID to use for offchannel TX ++ * (if %IEEE80211_HW_QUEUE_CONTROL is set) ++ * ++@@ -2124,6 +2136,7 @@ struct ieee80211_hw { ++ u8 max_rate_tries; ++ u8 max_rx_aggregation_subframes; ++ u8 max_tx_aggregation_subframes; +++ u8 max_tx_fragments; ++ u8 offchannel_tx_hw_queue; ++ u8 radiotap_mcs_details; ++ u16 radiotap_vht_details; ++--- a/net/mac80211/agg-tx.c +++++ b/net/mac80211/agg-tx.c ++@@ -935,6 +935,7 @@ void ieee80211_process_addba_resp(struct ++ size_t len) ++ { ++ struct tid_ampdu_tx *tid_tx; +++ struct ieee80211_txq *txq; ++ u16 capab, tid; ++ u8 buf_size; ++ bool amsdu; ++@@ -945,6 +946,10 @@ void ieee80211_process_addba_resp(struct ++ buf_size = (capab & IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK) >> 6; ++ buf_size = min(buf_size, local->hw.max_tx_aggregation_subframes); ++ +++ txq = sta->sta.txq[tid]; +++ if (!amsdu && txq) +++ set_bit(IEEE80211_TXQ_NO_AMSDU, &to_txq_info(txq)->flags); +++ ++ mutex_lock(&sta->ampdu_mlme.mtx); ++ ++ tid_tx = rcu_dereference_protected_tid_tx(sta, tid); ++--- a/net/mac80211/debugfs.c +++++ b/net/mac80211/debugfs.c ++@@ -127,6 +127,8 @@ static const char *hw_flag_names[NUM_IEE ++ FLAG(BEACON_TX_STATUS), ++ FLAG(NEEDS_UNIQUE_STA_ADDR), ++ FLAG(SUPPORTS_REORDERING_BUFFER), +++ FLAG(TX_AMSDU), +++ FLAG(TX_FRAG_LIST), ++ ++ /* keep last for the build bug below */ ++ (void *)0x1 ++--- a/net/mac80211/ieee80211_i.h +++++ b/net/mac80211/ieee80211_i.h ++@@ -799,6 +799,7 @@ struct mac80211_qos_map { ++ enum txq_info_flags { ++ IEEE80211_TXQ_STOP, ++ IEEE80211_TXQ_AMPDU, +++ IEEE80211_TXQ_NO_AMSDU, ++ }; ++ ++ struct txq_info { ++--- a/net/mac80211/tx.c +++++ b/net/mac80211/tx.c ++@@ -1318,6 +1318,10 @@ struct sk_buff *ieee80211_tx_dequeue(str ++ out: ++ spin_unlock_bh(&txqi->queue.lock); ++ +++ if (skb && skb_has_frag_list(skb) && +++ !ieee80211_hw_check(&local->hw, TX_FRAG_LIST)) +++ skb_linearize(skb); +++ ++ return skb; ++ } ++ EXPORT_SYMBOL(ieee80211_tx_dequeue); ++@@ -2757,6 +2761,158 @@ void ieee80211_clear_fast_xmit(struct st ++ kfree_rcu(fast_tx, rcu_head); ++ } ++ +++static int ieee80211_amsdu_pad(struct sk_buff *skb, int subframe_len) +++{ +++ int amsdu_len = subframe_len + sizeof(struct ethhdr); +++ int padding = (4 - amsdu_len) & 3; +++ +++ if (padding) +++ memset(skb_put(skb, padding), 0, padding); +++ +++ return padding; +++} +++ +++static bool ieee80211_amsdu_prepare_head(struct ieee80211_sub_if_data *sdata, +++ struct ieee80211_fast_tx *fast_tx, +++ struct sk_buff *skb) +++{ +++ struct ieee80211_local *local = sdata->local; +++ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); +++ struct ieee80211_hdr *hdr; +++ struct ethhdr amsdu_hdr; +++ int hdr_len = fast_tx->hdr_len - sizeof(rfc1042_header); +++ int subframe_len = skb->len - hdr_len; +++ void *data; +++ u8 *qc; +++ +++ if (info->control.flags & IEEE80211_TX_CTRL_AMSDU) +++ return true; +++ +++ if (skb_headroom(skb) < sizeof(amsdu_hdr) || skb_tailroom(skb) < 3) { +++ I802_DEBUG_INC(local->tx_expand_skb_head); +++ +++ if (pskb_expand_head(skb, sizeof(amsdu_hdr), 3, GFP_ATOMIC)) { +++ wiphy_debug(local->hw.wiphy, +++ "failed to reallocate TX buffer\n"); +++ return false; ++ } -+ if (drvr->fws) { -+ brcmf_fws_del_interface(ifp); -+ brcmf_fws_deinit(drvr); +++ } +++ +++ subframe_len += ieee80211_amsdu_pad(skb, subframe_len); +++ +++ amsdu_hdr.h_proto = cpu_to_be16(subframe_len); +++ memcpy(amsdu_hdr.h_source, skb->data + fast_tx->sa_offs, ETH_ALEN); +++ memcpy(amsdu_hdr.h_dest, skb->data + fast_tx->da_offs, ETH_ALEN); +++ +++ data = skb_push(skb, sizeof(amsdu_hdr)); +++ memmove(data, data + sizeof(amsdu_hdr), hdr_len); +++ memcpy(data + hdr_len, &amsdu_hdr, sizeof(amsdu_hdr)); +++ +++ hdr = data; +++ qc = ieee80211_get_qos_ctl(hdr); +++ *qc |= IEEE80211_QOS_CTL_A_MSDU_PRESENT; +++ +++ info->control.flags |= IEEE80211_TX_CTRL_AMSDU; +++ +++ return true; +++} +++ +++static bool ieee80211_amsdu_aggregate(struct ieee80211_sub_if_data *sdata, +++ struct sta_info *sta, +++ struct ieee80211_fast_tx *fast_tx, +++ struct sk_buff *skb) +++{ +++ struct ieee80211_local *local = sdata->local; +++ u8 tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK; +++ struct ieee80211_txq *txq = sta->sta.txq[tid]; +++ struct txq_info *txqi; +++ struct sk_buff **frag_tail, *head; +++ int subframe_len = skb->len - ETH_ALEN; +++ u8 max_subframes = sta->sta.max_amsdu_subframes; +++ int max_frags = local->hw.max_tx_fragments; +++ int max_amsdu_len; +++ __be16 len; +++ void *data; +++ bool ret = false; +++ int n = 1, nfrags; +++ +++ if (!ieee80211_hw_check(&local->hw, TX_AMSDU)) +++ return false; +++ +++ if (!txq) +++ return false; +++ +++ txqi = to_txq_info(txq); +++ if (test_bit(IEEE80211_TXQ_NO_AMSDU, &txqi->flags)) +++ return false; +++ +++ spin_lock_bh(&txqi->queue.lock); +++ +++ head = skb_peek_tail(&txqi->queue); +++ if (!head) +++ goto out; +++ +++ if (skb->len + head->len > max_amsdu_len) +++ goto out; +++ +++ /* +++ * HT A-MPDU limits maximum MPDU size to 4095 bytes. Since aggregation +++ * sessions are started/stopped without txq flush, use the limit here +++ * to avoid having to de-aggregate later. +++ */ +++ if (skb->len + head->len > 4095 && +++ !sta->sta.vht_cap.vht_supported) +++ goto out; +++ +++ if (!ieee80211_amsdu_prepare_head(sdata, fast_tx, head)) +++ goto out; +++ +++ nfrags = 1 + skb_shinfo(skb)->nr_frags; +++ nfrags += 1 + skb_shinfo(head)->nr_frags; +++ frag_tail = &skb_shinfo(head)->frag_list; +++ while (*frag_tail) { +++ nfrags += 1 + skb_shinfo(*frag_tail)->nr_frags; +++ frag_tail = &(*frag_tail)->next; +++ n++; +++ } +++ +++ if (max_subframes && n > max_subframes) +++ goto out; +++ +++ if (max_frags && nfrags > max_frags) +++ goto out; +++ +++ if (skb_headroom(skb) < 8 || skb_tailroom(skb) < 3) { +++ I802_DEBUG_INC(local->tx_expand_skb_head); +++ +++ if (pskb_expand_head(skb, 8, 3, GFP_ATOMIC)) { +++ wiphy_debug(local->hw.wiphy, +++ "failed to reallocate TX buffer\n"); +++ goto out; +++ } +++ } +++ +++ subframe_len += ieee80211_amsdu_pad(skb, subframe_len); +++ +++ ret = true; +++ data = skb_push(skb, ETH_ALEN + 2); +++ memmove(data, data + ETH_ALEN + 2, 2 * ETH_ALEN); +++ +++ data += 2 * ETH_ALEN; +++ len = cpu_to_be16(subframe_len); +++ memcpy(data, &len, 2); +++ memcpy(data + 2, rfc1042_header, ETH_ALEN); +++ +++ head->len += skb->len; +++ head->data_len += skb->len; +++ *frag_tail = skb; +++ +++out: +++ spin_unlock_bh(&txqi->queue.lock); +++ +++ return ret; +++} +++ ++ static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata, ++ struct net_device *dev, struct sta_info *sta, ++ struct ieee80211_fast_tx *fast_tx, ++@@ -2811,6 +2967,10 @@ static bool ieee80211_xmit_fast(struct i ++ ++ ieee80211_tx_stats(dev, skb->len + extra_head); ++ +++ if ((hdr->frame_control & cpu_to_le16(IEEE80211_STYPE_QOS_DATA)) && +++ ieee80211_amsdu_aggregate(sdata, sta, fast_tx, skb)) +++ return true; +++ ++ /* will not be crypto-handled beyond what we do here, so use false ++ * as the may-encrypt argument for the resize to not account for ++ * more room than we already have in 'extra_head' +diff --git a/package/kernel/mac80211/patches/323-0001-brcmfmac-analyze-descriptors-of-current-component-on.patch b/package/kernel/mac80211/patches/323-0001-brcmfmac-analyze-descriptors-of-current-component-on.patch +new file mode 100644 +index 0000000..d7018da +--- /dev/null ++++ b/package/kernel/mac80211/patches/323-0001-brcmfmac-analyze-descriptors-of-current-component-on.patch +@@ -0,0 +1,51 @@ ++From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= ++Date: Tue, 26 Jan 2016 17:57:01 +0100 ++Subject: [PATCH] brcmfmac: analyze descriptors of current component only ++MIME-Version: 1.0 ++Content-Type: text/plain; charset=UTF-8 ++Content-Transfer-Encoding: 8bit ++ ++So far we were looking for address descriptors without a check for ++crossing current component border. In case of dealing with unsupported ++descriptor or descriptor missing at all the code would incorrectly get ++data from another component. ++ ++Consider this binary-described component from BCM4366 EROM: ++4bf83b01 TAG==CI CID==0x83b ++20080201 TAG==CI PORTS==0+1 WRAPPERS==0+1 ++18400035 TAG==ADDR SZ_SZD TYPE_SLAVE ++00050000 ++18107085 TAG==ADDR SZ_4K TYPE_SWRAP ++ ++Driver was assigning invalid base address to this core: ++brcmfmac: [6 ] core 0x83b:32 base 0x18109000 wrap 0x18107000 ++which came from totally different component defined in EROM: ++43b36701 TAG==CI CID==0x367 ++00000201 TAG==CI PORTS==0+1 WRAPPERS==0+0 ++18109005 TAG==ADDR SZ_4K TYPE_SLAVE ++ ++This change will also allow us to support components without wrapper ++address in the future. ++ ++Signed-off-by: Rafał Miłecki ++Signed-off-by: Kalle Valo ++--- ++ ++--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c +++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c ++@@ -803,7 +803,14 @@ static int brcmf_chip_dmp_get_regaddr(st ++ *eromaddr -= 4; ++ return -EFAULT; ++ } ++- } while (desc != DMP_DESC_ADDRESS); +++ } while (desc != DMP_DESC_ADDRESS && +++ desc != DMP_DESC_COMPONENT); +++ +++ /* stop if we crossed current component border */ +++ if (desc == DMP_DESC_COMPONENT) { +++ *eromaddr -= 4; +++ return 0; +++ } ++ ++ /* skip upper 32-bit address descriptor */ ++ if (val & DMP_DESC_ADDRSIZE_GT32) +diff --git a/package/kernel/mac80211/patches/323-0002-brcmfmac-allow-storing-PMU-core-without-wrapper-addr.patch b/package/kernel/mac80211/patches/323-0002-brcmfmac-allow-storing-PMU-core-without-wrapper-addr.patch +new file mode 100644 +index 0000000..045ab49 +--- /dev/null ++++ b/package/kernel/mac80211/patches/323-0002-brcmfmac-allow-storing-PMU-core-without-wrapper-addr.patch +@@ -0,0 +1,28 @@ ++From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= ++Date: Tue, 26 Jan 2016 17:57:02 +0100 ++Subject: [PATCH] brcmfmac: allow storing PMU core without wrapper address ++MIME-Version: 1.0 ++Content-Type: text/plain; charset=UTF-8 ++Content-Transfer-Encoding: 8bit ++ ++Separated PMU core can be found in new devices and should be used for ++accessing PMU registers (which were routed through ChipCommon so far). ++This core is one of exceptions that doesn't have or need wrapper address ++to be still safely accessible. ++ ++Signed-off-by: Rafał Miłecki ++Signed-off-by: Kalle Valo ++--- ++ ++--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c +++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c ++@@ -883,7 +883,8 @@ int brcmf_chip_dmp_erom_scan(struct brcm ++ rev = (val & DMP_COMP_REVISION) >> DMP_COMP_REVISION_S; ++ ++ /* need core with ports */ ++- if (nmw + nsw == 0) +++ if (nmw + nsw == 0 && +++ id != BCMA_CORE_PMU) ++ continue; ++ ++ /* try to obtain register address info */ +diff --git a/package/kernel/mac80211/patches/323-0003-brcmfmac-read-extended-capabilities-of-ChipCommon-co.patch b/package/kernel/mac80211/patches/323-0003-brcmfmac-read-extended-capabilities-of-ChipCommon-co.patch +new file mode 100644 +index 0000000..7b7ba4f +--- /dev/null ++++ b/package/kernel/mac80211/patches/323-0003-brcmfmac-read-extended-capabilities-of-ChipCommon-co.patch +@@ -0,0 +1,43 @@ ++From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= ++Date: Tue, 26 Jan 2016 17:57:03 +0100 ++Subject: [PATCH] brcmfmac: read extended capabilities of ChipCommon core ++MIME-Version: 1.0 ++Content-Type: text/plain; charset=UTF-8 ++Content-Transfer-Encoding: 8bit ++ ++This is an extra bitfield with info about some present hardware. ++ ++Signed-off-by: Rafał Miłecki ++Signed-off-by: Kalle Valo ++--- ++ ++--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c +++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c ++@@ -1025,6 +1025,9 @@ static int brcmf_chip_setup(struct brcmf ++ /* get chipcommon capabilites */ ++ pub->cc_caps = chip->ops->read32(chip->ctx, ++ CORE_CC_REG(base, capabilities)); +++ pub->cc_caps_ext = chip->ops->read32(chip->ctx, +++ CORE_CC_REG(base, +++ capabilities_ext)); ++ ++ /* get pmu caps & rev */ ++ if (pub->cc_caps & CC_CAP_PMU) { ++--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h +++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h ++@@ -27,6 +27,7 @@ ++ * @chip: chip identifier. ++ * @chiprev: chip revision. ++ * @cc_caps: chipcommon core capabilities. +++ * @cc_caps_ext: chipcommon core extended capabilities. ++ * @pmucaps: PMU capabilities. ++ * @pmurev: PMU revision. ++ * @rambase: RAM base address (only applicable for ARM CR4 chips). ++@@ -38,6 +39,7 @@ struct brcmf_chip { ++ u32 chip; ++ u32 chiprev; ++ u32 cc_caps; +++ u32 cc_caps_ext; ++ u32 pmucaps; ++ u32 pmurev; ++ u32 rambase; +diff --git a/package/kernel/mac80211/patches/323-0004-brcmfmac-access-PMU-registers-using-standalone-PMU-c.patch b/package/kernel/mac80211/patches/323-0004-brcmfmac-access-PMU-registers-using-standalone-PMU-c.patch +new file mode 100644 +index 0000000..2af6fd9 +--- /dev/null ++++ b/package/kernel/mac80211/patches/323-0004-brcmfmac-access-PMU-registers-using-standalone-PMU-c.patch +@@ -0,0 +1,148 @@ ++From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= ++Date: Tue, 26 Jan 2016 17:57:04 +0100 ++Subject: [PATCH] brcmfmac: access PMU registers using standalone PMU core if ++ available ++MIME-Version: 1.0 ++Content-Type: text/plain; charset=UTF-8 ++Content-Transfer-Encoding: 8bit ++ ++On recent Broadcom chipsets PMU is present as separated core and it ++can't be accessed using ChipCommon anymore as it fails with e.g.: ++[ 18.198412] Unhandled fault: imprecise external abort (0x1406) at 0xb6da200f ++ ++Add a new helper function that will return a proper core that should be ++used for accessing PMU registers. ++ ++Signed-off-by: Rafał Miłecki ++Signed-off-by: Kalle Valo ++--- ++ ++--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c +++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c ++@@ -1014,6 +1014,7 @@ static int brcmf_chip_setup(struct brcmf ++ { ++ struct brcmf_chip *pub; ++ struct brcmf_core_priv *cc; +++ struct brcmf_core *pmu; ++ u32 base; ++ u32 val; ++ int ret = 0; ++@@ -1030,9 +1031,10 @@ static int brcmf_chip_setup(struct brcmf ++ capabilities_ext)); ++ ++ /* get pmu caps & rev */ +++ pmu = brcmf_chip_get_pmu(pub); /* after reading cc_caps_ext */ ++ if (pub->cc_caps & CC_CAP_PMU) { ++ val = chip->ops->read32(chip->ctx, ++- CORE_CC_REG(base, pmucapabilities)); +++ CORE_CC_REG(pmu->base, pmucapabilities)); ++ pub->pmurev = val & PCAP_REV_MASK; ++ pub->pmucaps = val; ++ } ++@@ -1131,6 +1133,23 @@ struct brcmf_core *brcmf_chip_get_chipco ++ return &cc->pub; ++ } ++ +++struct brcmf_core *brcmf_chip_get_pmu(struct brcmf_chip *pub) +++{ +++ struct brcmf_core *cc = brcmf_chip_get_chipcommon(pub); +++ struct brcmf_core *pmu; +++ +++ /* See if there is separated PMU core available */ +++ if (cc->rev >= 35 && +++ pub->cc_caps_ext & BCMA_CC_CAP_EXT_AOB_PRESENT) { +++ pmu = brcmf_chip_get_core(pub, BCMA_CORE_PMU); +++ if (pmu) +++ return pmu; +++ } +++ +++ /* Fallback to ChipCommon core for older hardware */ +++ return cc; +++} +++ ++ bool brcmf_chip_iscoreup(struct brcmf_core *pub) ++ { ++ struct brcmf_core_priv *core; ++@@ -1301,6 +1320,7 @@ bool brcmf_chip_sr_capable(struct brcmf_ ++ { ++ u32 base, addr, reg, pmu_cc3_mask = ~0; ++ struct brcmf_chip_priv *chip; +++ struct brcmf_core *pmu = brcmf_chip_get_pmu(pub); ++ ++ brcmf_dbg(TRACE, "Enter\n"); ++ ++@@ -1320,9 +1340,9 @@ bool brcmf_chip_sr_capable(struct brcmf_ ++ case BRCM_CC_4335_CHIP_ID: ++ case BRCM_CC_4339_CHIP_ID: ++ /* read PMU chipcontrol register 3 */ ++- addr = CORE_CC_REG(base, chipcontrol_addr); +++ addr = CORE_CC_REG(pmu->base, chipcontrol_addr); ++ chip->ops->write32(chip->ctx, addr, 3); ++- addr = CORE_CC_REG(base, chipcontrol_data); +++ addr = CORE_CC_REG(pmu->base, chipcontrol_data); ++ reg = chip->ops->read32(chip->ctx, addr); ++ return (reg & pmu_cc3_mask) != 0; ++ case BRCM_CC_43430_CHIP_ID: ++@@ -1330,12 +1350,12 @@ bool brcmf_chip_sr_capable(struct brcmf_ ++ reg = chip->ops->read32(chip->ctx, addr); ++ return reg != 0; ++ default: ++- addr = CORE_CC_REG(base, pmucapabilities_ext); +++ addr = CORE_CC_REG(pmu->base, pmucapabilities_ext); ++ reg = chip->ops->read32(chip->ctx, addr); ++ if ((reg & PCAPEXT_SR_SUPPORTED_MASK) == 0) ++ return false; ++ ++- addr = CORE_CC_REG(base, retention_ctl); +++ addr = CORE_CC_REG(pmu->base, retention_ctl); ++ reg = chip->ops->read32(chip->ctx, addr); ++ return (reg & (PMU_RCTL_MACPHY_DISABLE_MASK | ++ PMU_RCTL_LOGIC_DISABLE_MASK)) == 0; ++--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h +++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h ++@@ -85,6 +85,7 @@ struct brcmf_chip *brcmf_chip_attach(voi ++ void brcmf_chip_detach(struct brcmf_chip *chip); ++ struct brcmf_core *brcmf_chip_get_core(struct brcmf_chip *chip, u16 coreid); ++ struct brcmf_core *brcmf_chip_get_chipcommon(struct brcmf_chip *chip); +++struct brcmf_core *brcmf_chip_get_pmu(struct brcmf_chip *pub); ++ bool brcmf_chip_iscoreup(struct brcmf_core *core); ++ void brcmf_chip_coredisable(struct brcmf_core *core, u32 prereset, u32 reset); ++ void brcmf_chip_resetcore(struct brcmf_core *core, u32 prereset, u32 reset, ++--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c ++@@ -3615,7 +3615,6 @@ brcmf_sdio_drivestrengthinit(struct brcm ++ const struct sdiod_drive_str *str_tab = NULL; ++ u32 str_mask; ++ u32 str_shift; ++- u32 base; ++ u32 i; ++ u32 drivestrength_sel = 0; ++ u32 cc_data_temp; ++@@ -3658,14 +3657,15 @@ brcmf_sdio_drivestrengthinit(struct brcm ++ } ++ ++ if (str_tab != NULL) { +++ struct brcmf_core *pmu = brcmf_chip_get_pmu(ci); +++ ++ for (i = 0; str_tab[i].strength != 0; i++) { ++ if (drivestrength >= str_tab[i].strength) { ++ drivestrength_sel = str_tab[i].sel; ++ break; ++ } ++ } ++- base = brcmf_chip_get_chipcommon(ci)->base; ++- addr = CORE_CC_REG(base, chipcontrol_addr); +++ addr = CORE_CC_REG(pmu->base, chipcontrol_addr); ++ brcmf_sdiod_regwl(sdiodev, addr, 1, NULL); ++ cc_data_temp = brcmf_sdiod_regrl(sdiodev, addr, NULL); ++ cc_data_temp &= ~str_mask; ++@@ -3835,8 +3835,7 @@ brcmf_sdio_probe_attach(struct brcmf_sdi ++ goto fail; ++ ++ /* set PMUControl so a backplane reset does PMU state reload */ ++- reg_addr = CORE_CC_REG(brcmf_chip_get_chipcommon(bus->ci)->base, ++- pmucontrol); +++ reg_addr = CORE_CC_REG(brcmf_chip_get_pmu(bus->ci)->base, pmucontrol); ++ reg_val = brcmf_sdiod_regrl(bus->sdiodev, reg_addr, &err); ++ if (err) ++ goto fail; +diff --git a/package/kernel/mac80211/patches/323-0005-brcmfmac-add-support-for-14e4-4365-PCI-ID-with-BCM43.patch b/package/kernel/mac80211/patches/323-0005-brcmfmac-add-support-for-14e4-4365-PCI-ID-with-BCM43.patch +new file mode 100644 +index 0000000..35887fc +--- /dev/null ++++ b/package/kernel/mac80211/patches/323-0005-brcmfmac-add-support-for-14e4-4365-PCI-ID-with-BCM43.patch +@@ -0,0 +1,38 @@ ++From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= ++Date: Tue, 26 Jan 2016 17:57:05 +0100 ++Subject: [PATCH] brcmfmac: add support for 14e4:4365 PCI ID with BCM4366 ++ chipset ++MIME-Version: 1.0 ++Content-Type: text/plain; charset=UTF-8 ++Content-Transfer-Encoding: 8bit ++ ++On Broadcom ARM routers BCM4366 cards are available with 14e4:4365 ID. ++Unfortunately this ID was already used by Broadcom for cards with ++BCM43142, a totally different chipset requiring SoftMAC driver. To avoid ++a conflict between brcmfmac and bcma use more specific ID entry with ++subvendor and subdevice specified. ++ ++Signed-off-by: Rafał Miłecki ++Signed-off-by: Kalle Valo ++--- ++ ++--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c ++@@ -1951,6 +1951,9 @@ static const struct dev_pm_ops brcmf_pci ++ ++ #define BRCMF_PCIE_DEVICE(dev_id) { BRCM_PCIE_VENDOR_ID_BROADCOM, dev_id,\ ++ PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_NETWORK_OTHER << 8, 0xffff00, 0 } +++#define BRCMF_PCIE_DEVICE_SUB(dev_id, subvend, subdev) { \ +++ BRCM_PCIE_VENDOR_ID_BROADCOM, dev_id,\ +++ subvend, subdev, PCI_CLASS_NETWORK_OTHER << 8, 0xffff00, 0 } ++ ++ static struct pci_device_id brcmf_pcie_devid_table[] = { ++ BRCMF_PCIE_DEVICE(BRCM_PCIE_4350_DEVICE_ID), ++@@ -1966,6 +1969,7 @@ static struct pci_device_id brcmf_pcie_d ++ BRCMF_PCIE_DEVICE(BRCM_PCIE_4365_DEVICE_ID), ++ BRCMF_PCIE_DEVICE(BRCM_PCIE_4365_2G_DEVICE_ID), ++ BRCMF_PCIE_DEVICE(BRCM_PCIE_4365_5G_DEVICE_ID), +++ BRCMF_PCIE_DEVICE_SUB(0x4365, BRCM_PCIE_VENDOR_ID_BROADCOM, 0x4365), ++ BRCMF_PCIE_DEVICE(BRCM_PCIE_4366_DEVICE_ID), ++ BRCMF_PCIE_DEVICE(BRCM_PCIE_4366_2G_DEVICE_ID), ++ BRCMF_PCIE_DEVICE(BRCM_PCIE_4366_5G_DEVICE_ID), diff --git a/package/kernel/mac80211/patches/323-ath9k-add-multi_read-to-be-compatible-with-ath9k_htc.patch b/package/kernel/mac80211/patches/323-ath9k-add-multi_read-to-be-compatible-with-ath9k_htc.patch deleted file mode 100644 index 246bb9d..0000000 @@ -11757,117 +12628,6 @@ index 246bb9d..0000000 - ah->reg_ops.write = ath9k_iowrite32; - ah->reg_ops.rmw = ath9k_reg_rmw; - pCap = &ah->caps; -diff --git a/package/kernel/mac80211/patches/323-brcmfmac-correct-detection-of-p2pdev-interface-event.patch b/package/kernel/mac80211/patches/323-brcmfmac-correct-detection-of-p2pdev-interface-event.patch -new file mode 100644 -index 0000000..868b0a8 ---- /dev/null -+++ b/package/kernel/mac80211/patches/323-brcmfmac-correct-detection-of-p2pdev-interface-event.patch -@@ -0,0 +1,105 @@ -+From: Arend van Spriel -+Date: Wed, 26 Aug 2015 22:14:57 +0200 -+Subject: [PATCH] brcmfmac: correct detection of p2pdev interface event -+ -+The p2pdev interface is setup in firmware resulting in a interface -+event. This event has role and no-if flag. When role is p2p client -+and no-if flag is set it indicates that this is the p2pdev interface. -+This info is used in handling the event and adding interface in the -+driver. -+ -+Reviewed-by: Hante Meuleman -+Reviewed-by: Franky (Zhenhui) Lin -+Reviewed-by: Pieter-Paul Giesberts -+Signed-off-by: Arend van Spriel -+--- -+ -+--- a/drivers/net/wireless/brcm80211/brcmfmac/core.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c -+@@ -795,7 +795,7 @@ fail: -+ } -+ -+ struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bssidx, s32 ifidx, -+- char *name, u8 *mac_addr) -++ bool is_p2pdev, char *name, u8 *mac_addr) -+ { -+ struct brcmf_if *ifp; -+ struct net_device *ndev; -+@@ -821,7 +821,7 @@ struct brcmf_if *brcmf_add_if(struct brc -+ } -+ } -+ -+- if (!brcmf_p2p_enable && bssidx == 1) { -++ if (!brcmf_p2p_enable && is_p2pdev) { -+ /* this is P2P_DEVICE interface */ -+ brcmf_dbg(INFO, "allocate non-netdev interface\n"); -+ ifp = kzalloc(sizeof(*ifp), GFP_KERNEL); -+@@ -999,12 +999,12 @@ int brcmf_bus_start(struct device *dev) -+ brcmf_dbg(TRACE, "\n"); -+ -+ /* add primary networking interface */ -+- ifp = brcmf_add_if(drvr, 0, 0, "wlan%d", NULL); -++ ifp = brcmf_add_if(drvr, 0, 0, false, "wlan%d", NULL); -+ if (IS_ERR(ifp)) -+ return PTR_ERR(ifp); -+ -+ if (brcmf_p2p_enable) -+- p2p_ifp = brcmf_add_if(drvr, 1, 0, "p2p%d", NULL); -++ p2p_ifp = brcmf_add_if(drvr, 1, 0, false, "p2p%d", NULL); -+ else -+ p2p_ifp = NULL; -+ if (IS_ERR(p2p_ifp)) -+--- a/drivers/net/wireless/brcm80211/brcmfmac/core.h -++++ b/drivers/net/wireless/brcm80211/brcmfmac/core.h -+@@ -205,7 +205,7 @@ char *brcmf_ifname(struct brcmf_pub *drv -+ struct brcmf_if *brcmf_get_ifp(struct brcmf_pub *drvr, int ifidx); -+ int brcmf_net_attach(struct brcmf_if *ifp, bool rtnl_locked); -+ struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bssidx, s32 ifidx, -+- char *name, u8 *mac_addr); -++ bool is_p2pdev, char *name, u8 *mac_addr); -+ void brcmf_remove_interface(struct brcmf_if *ifp); -+ int brcmf_get_next_free_bsscfgidx(struct brcmf_pub *drvr); -+ void brcmf_txflowblock_if(struct brcmf_if *ifp, -+--- a/drivers/net/wireless/brcm80211/brcmfmac/fweh.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/fweh.c -+@@ -179,6 +179,7 @@ static void brcmf_fweh_handle_if_event(s -+ { -+ struct brcmf_if_event *ifevent = data; -+ struct brcmf_if *ifp; -++ bool is_p2pdev; -+ int err = 0; -+ -+ brcmf_dbg(EVENT, "action: %u idx: %u bsscfg: %u flags: %u role: %u\n", -+@@ -186,18 +187,16 @@ static void brcmf_fweh_handle_if_event(s -+ ifevent->flags, ifevent->role); -+ -+ /* The P2P Device interface event must not be ignored -+- * contrary to what firmware tells us. The only way to -+- * distinguish the P2P Device is by looking at the ifidx -+- * and bssidx received. -++ * contrary to what firmware tells us. -+ */ -+- if (!(ifevent->ifidx == 0 && ifevent->bssidx == 1) && -+- (ifevent->flags & BRCMF_E_IF_FLAG_NOIF)) { -++ is_p2pdev = (ifevent->flags & BRCMF_E_IF_FLAG_NOIF) && -++ ifevent->role == BRCMF_E_IF_ROLE_P2P_CLIENT; -++ if (!is_p2pdev && (ifevent->flags & BRCMF_E_IF_FLAG_NOIF)) { -+ brcmf_dbg(EVENT, "event can be ignored\n"); -+ return; -+ } -+ if (ifevent->ifidx >= BRCMF_MAX_IFS) { -+- brcmf_err("invalid interface index: %u\n", -+- ifevent->ifidx); -++ brcmf_err("invalid interface index: %u\n", ifevent->ifidx); -+ return; -+ } -+ -+@@ -207,7 +206,7 @@ static void brcmf_fweh_handle_if_event(s -+ brcmf_dbg(EVENT, "adding %s (%pM)\n", emsg->ifname, -+ emsg->addr); -+ ifp = brcmf_add_if(drvr, ifevent->bssidx, ifevent->ifidx, -+- emsg->ifname, emsg->addr); -++ is_p2pdev, emsg->ifname, emsg->addr); -+ if (IS_ERR(ifp)) -+ return; -+ brcmf_fws_add_interface(ifp); diff --git a/package/kernel/mac80211/patches/324-ath9k-add-new-function-ath9k_hw_read_array.patch b/package/kernel/mac80211/patches/324-ath9k-add-new-function-ath9k_hw_read_array.patch deleted file mode 100644 index 2eda1c9..0000000 @@ -11943,138 +12703,44 @@ index 2eda1c9..0000000 - u32 ath9k_hw_reverse_bits(u32 val, u32 n); - u16 ath9k_hw_computetxtime(struct ath_hw *ah, - u8 phy, int kbps, -diff --git a/package/kernel/mac80211/patches/324-brcmfmac-use-brcmf_get_ifp-to-map-ifidx-to-struct-br.patch b/package/kernel/mac80211/patches/324-brcmfmac-use-brcmf_get_ifp-to-map-ifidx-to-struct-br.patch +diff --git a/package/kernel/mac80211/patches/324-brcmfmac-treat-NULL-character-in-NVRAM-as-separator.patch b/package/kernel/mac80211/patches/324-brcmfmac-treat-NULL-character-in-NVRAM-as-separator.patch new file mode 100644 -index 0000000..abd6681 +index 0000000..6ce60f1 --- /dev/null -+++ b/package/kernel/mac80211/patches/324-brcmfmac-use-brcmf_get_ifp-to-map-ifidx-to-struct-br.patch -@@ -0,0 +1,126 @@ -+From: Arend van Spriel -+Date: Wed, 26 Aug 2015 22:14:58 +0200 -+Subject: [PATCH] brcmfmac: use brcmf_get_ifp() to map ifidx to struct -+ brcmf_if instance ++++ b/package/kernel/mac80211/patches/324-brcmfmac-treat-NULL-character-in-NVRAM-as-separator.patch +@@ -0,0 +1,32 @@ ++From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= ++Date: Sun, 31 Jan 2016 12:14:34 +0100 ++Subject: [PATCH] brcmfmac: treat NULL character in NVRAM as separator ++MIME-Version: 1.0 ++Content-Type: text/plain; charset=UTF-8 ++Content-Transfer-Encoding: 8bit + -+The knowledge on how to map the interface index to a struct brcmf_if -+instance is in brcmf_get_ifp() so use that function when only the -+interface index is known instead of accessing brcmf_pub::iflist -+directly. ++Platform NVRAM (stored on a flash partition) has entries separated by a ++NULL (\0) char. Our parsing code switches from VALUE state to IDLE ++whenever it meets a NULL (\0). When that happens our IDLE handler should ++simply consume it and analyze whatever is placed ahead. + -+Reviewed-by: Hante Meuleman -+Reviewed-by: Franky (Zhenhui) Lin -+Reviewed-by: Pieter-Paul Giesberts -+Signed-off-by: Arend van Spriel ++This fixes harmless warnings spamming debugging output: ++[ 155.165624] brcmfmac: brcmf_nvram_handle_idle warning: ln=1:col=20: ignoring invalid character ++[ 155.180806] brcmfmac: brcmf_nvram_handle_idle warning: ln=1:col=44: ignoring invalid character ++[ 155.195971] brcmfmac: brcmf_nvram_handle_idle warning: ln=1:col=63: ignoring invalid character ++ ++Signed-off-by: Rafał Miłecki ++Signed-off-by: Kalle Valo +--- + -+--- a/drivers/net/wireless/brcm80211/brcmfmac/btcoex.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/btcoex.c -+@@ -149,7 +149,7 @@ static s32 brcmf_btcoex_params_read(stru -+ static void brcmf_btcoex_boost_wifi(struct brcmf_btcoex_info *btci, -+ bool trump_sco) -+ { -+- struct brcmf_if *ifp = btci->cfg->pub->iflist[0]; -++ struct brcmf_if *ifp = brcmf_get_ifp(btci->cfg->pub, 0); -+ -+ if (trump_sco && !btci->saved_regs_part2) { -+ /* this should reduce eSCO agressive -+@@ -468,7 +468,7 @@ int brcmf_btcoex_set_mode(struct brcmf_c -+ { -+ struct brcmf_cfg80211_info *cfg = wiphy_priv(vif->wdev.wiphy); -+ struct brcmf_btcoex_info *btci = cfg->btcoex; -+- struct brcmf_if *ifp = cfg->pub->iflist[0]; -++ struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0); -+ -+ switch (mode) { -+ case BRCMF_BTCOEX_DISABLED: -+--- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c -+@@ -6213,7 +6213,7 @@ static void brcmf_free_wiphy(struct wiph -+ struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr, -+ struct device *busdev) -+ { -+- struct net_device *ndev = drvr->iflist[0]->ndev; -++ struct net_device *ndev = brcmf_get_ifp(drvr, 0)->ndev; -+ struct brcmf_cfg80211_info *cfg; -+ struct wiphy *wiphy; -+ struct brcmf_cfg80211_vif *vif; -+--- a/drivers/net/wireless/brcm80211/brcmfmac/feature.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/feature.c -+@@ -121,7 +121,7 @@ static void brcmf_feat_iovar_int_set(str -+ -+ void brcmf_feat_attach(struct brcmf_pub *drvr) -+ { -+- struct brcmf_if *ifp = drvr->iflist[0]; -++ struct brcmf_if *ifp = brcmf_get_ifp(drvr, 0); -+ -+ brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_MCHAN, "mchan"); -+ brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_PNO, "pfn"); -+--- a/drivers/net/wireless/brcm80211/brcmfmac/flowring.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/flowring.c -+@@ -221,7 +221,7 @@ static void brcmf_flowring_block(struct -+ -+ bus_if = dev_get_drvdata(flow->dev); -+ drvr = bus_if->drvr; -+- ifp = drvr->iflist[ifidx]; -++ ifp = brcmf_get_ifp(drvr, ifidx); -+ brcmf_txflowblock_if(ifp, BRCMF_NETIF_STOP_REASON_FLOW, blocked); -+ -+ spin_unlock_irqrestore(&flow->block_lock, flags); -+--- a/drivers/net/wireless/brcm80211/brcmfmac/fweh.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/fweh.c -+@@ -334,7 +334,7 @@ void brcmf_fweh_attach(struct brcmf_pub -+ void brcmf_fweh_detach(struct brcmf_pub *drvr) -+ { -+ struct brcmf_fweh_info *fweh = &drvr->fweh; -+- struct brcmf_if *ifp = drvr->iflist[0]; -++ struct brcmf_if *ifp = brcmf_get_ifp(drvr, 0); -+ s8 eventmask[BRCMF_EVENTING_MASK_LEN]; -+ -+ if (ifp) { -+--- a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c -+@@ -972,7 +972,7 @@ static void -+ brcmf_fws_flow_control_check(struct brcmf_fws_info *fws, struct pktq *pq, -+ u8 if_id) -+ { -+- struct brcmf_if *ifp = fws->drvr->iflist[!if_id ? 0 : if_id + 1]; -++ struct brcmf_if *ifp = brcmf_get_ifp(fws->drvr, if_id); -+ -+ if (WARN_ON(!ifp)) -+ return; -+@@ -2118,6 +2118,7 @@ static int brcmf_debugfs_fws_stats_read( -+ int brcmf_fws_init(struct brcmf_pub *drvr) -+ { -+ struct brcmf_fws_info *fws; -++ struct brcmf_if *ifp; -+ u32 tlv = BRCMF_FWS_FLAGS_RSSI_SIGNALS; -+ int rc; -+ u32 mode; -+@@ -2177,21 +2178,22 @@ int brcmf_fws_init(struct brcmf_pub *drv -+ * continue. Set mode back to none indicating not enabled. -+ */ -+ fws->fw_signals = true; -+- if (brcmf_fil_iovar_int_set(drvr->iflist[0], "tlv", tlv)) { -++ ifp = brcmf_get_ifp(drvr, 0); -++ if (brcmf_fil_iovar_int_set(ifp, "tlv", tlv)) { -+ brcmf_err("failed to set bdcv2 tlv signaling\n"); -+ fws->fcmode = BRCMF_FWS_FCMODE_NONE; -+ fws->fw_signals = false; -+ } -+ -+- if (brcmf_fil_iovar_int_set(drvr->iflist[0], "ampdu_hostreorder", 1)) -++ if (brcmf_fil_iovar_int_set(ifp, "ampdu_hostreorder", 1)) -+ brcmf_dbg(INFO, "enabling AMPDU host-reorder failed\n"); -+ -+ /* Enable seq number reuse, if supported */ -+- if (brcmf_fil_iovar_int_get(drvr->iflist[0], "wlfc_mode", &mode) == 0) { -++ if (brcmf_fil_iovar_int_get(ifp, "wlfc_mode", &mode) == 0) { -+ if (BRCMF_FWS_MODE_GET_REUSESEQ(mode)) { -+ mode = 0; -+ BRCMF_FWS_MODE_SET_REUSESEQ(mode, 1); -+- if (brcmf_fil_iovar_int_set(drvr->iflist[0], -++ if (brcmf_fil_iovar_int_set(ifp, -+ "wlfc_mode", mode) == 0) { -+ BRCMF_FWS_MODE_SET_REUSESEQ(fws->mode, 1); -+ } ++--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c +++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c ++@@ -93,7 +93,7 @@ static enum nvram_parser_state brcmf_nvr ++ c = nvp->data[nvp->pos]; ++ if (c == '\n') ++ return COMMENT; ++- if (is_whitespace(c)) +++ if (is_whitespace(c) || c == '\0') ++ goto proceed; ++ if (c == '#') ++ return COMMENT; diff --git a/package/kernel/mac80211/patches/325-ath9k-ar9271_hw_pa_cal-use-REG_READ_ARRAY.patch b/package/kernel/mac80211/patches/325-ath9k-ar9271_hw_pa_cal-use-REG_READ_ARRAY.patch deleted file mode 100644 index 4e4888f..0000000 @@ -12105,134 +12771,146 @@ index 4e4888f..0000000 - - ENABLE_REG_RMW_BUFFER(ah); - /* 7834, b1=0 */ -diff --git a/package/kernel/mac80211/patches/325-brcmfmac-pass-struct-brcmf_if-instance-in-brcmf_txfi.patch b/package/kernel/mac80211/patches/325-brcmfmac-pass-struct-brcmf_if-instance-in-brcmf_txfi.patch +diff --git a/package/kernel/mac80211/patches/325-brcmfmac-sdio-Increase-the-default-timeouts-a-bit.patch b/package/kernel/mac80211/patches/325-brcmfmac-sdio-Increase-the-default-timeouts-a-bit.patch new file mode 100644 -index 0000000..23a7b6f +index 0000000..012dea1 --- /dev/null -+++ b/package/kernel/mac80211/patches/325-brcmfmac-pass-struct-brcmf_if-instance-in-brcmf_txfi.patch -@@ -0,0 +1,122 @@ -+From: Arend van Spriel -+Date: Wed, 26 Aug 2015 22:14:59 +0200 -+Subject: [PATCH] brcmfmac: pass struct brcmf_if instance in -+ brcmf_txfinalize() ++++ b/package/kernel/mac80211/patches/325-brcmfmac-sdio-Increase-the-default-timeouts-a-bit.patch +@@ -0,0 +1,41 @@ ++From: Sjoerd Simons ++Date: Mon, 25 Jan 2016 11:47:29 +0100 ++Subject: [PATCH] brcmfmac: sdio: Increase the default timeouts a bit + -+Most call sites of brcmf_txfinalize already have struct brcmf_if -+instance so pass that to brcmf_txfinalize() as the function -+needs it anyway. ++On a Radxa Rock2 board with a Ampak AP6335 (Broadcom 4339 core) it seems ++the card responds very quickly most of the time, unfortunately during ++initialisation it sometimes seems to take just a bit over 2 seconds to ++respond. + -+Reviewed-by: Hante Meuleman -+Reviewed-by: Franky (Zhenhui) Lin -+Reviewed-by: Pieter-Paul Giesberts -+Signed-off-by: Arend van Spriel ++This results intialization failing with message like: ++ brcmf_c_preinit_dcmds: Retreiving cur_etheraddr failed, -52 ++ brcmf_bus_start: failed: -52 ++ brcmf_sdio_firmware_callback: dongle is not responding ++ ++Increasing the timeout to allow for a bit more headroom allows the ++card to initialize reliably. ++ ++A quick search online after diagnosing/fixing this showed that Google ++has a similar patch in their ChromeOS tree, so this doesn't seem ++specific to the board I'm using. ++ ++Signed-off-by: Sjoerd Simons ++Reviewed-by: Julian Calaby ++Acked-by: Arend van Spriel ++Reviewed-by: Douglas Anderson ++Signed-off-by: Kalle Valo +--- + -+--- a/drivers/net/wireless/brcm80211/brcmfmac/core.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c -+@@ -560,17 +560,11 @@ void brcmf_rx_frame(struct device *dev, -+ brcmf_netif_rx(ifp, skb); -+ } ++--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c ++@@ -45,8 +45,8 @@ ++ #include "chip.h" ++ #include "firmware.h" + -+-void brcmf_txfinalize(struct brcmf_pub *drvr, struct sk_buff *txp, u8 ifidx, -+- bool success) -++void brcmf_txfinalize(struct brcmf_if *ifp, struct sk_buff *txp, bool success) -+ { -+- struct brcmf_if *ifp; -+ struct ethhdr *eh; -+ u16 type; ++-#define DCMD_RESP_TIMEOUT msecs_to_jiffies(2000) ++-#define CTL_DONE_TIMEOUT msecs_to_jiffies(2000) +++#define DCMD_RESP_TIMEOUT msecs_to_jiffies(2500) +++#define CTL_DONE_TIMEOUT msecs_to_jiffies(2500) + -+- ifp = drvr->iflist[ifidx]; -+- if (!ifp) -+- goto done; -+- -+ eh = (struct ethhdr *)(txp->data); -+ type = ntohs(eh->h_proto); ++ #ifdef DEBUG + -+@@ -582,7 +576,7 @@ void brcmf_txfinalize(struct brcmf_pub * +diff --git a/package/kernel/mac80211/patches/326-ath9k-make-NF-load-complete-quickly-and-reliably.patch b/package/kernel/mac80211/patches/326-ath9k-make-NF-load-complete-quickly-and-reliably.patch +new file mode 100644 +index 0000000..71f7a40 +--- /dev/null ++++ b/package/kernel/mac80211/patches/326-ath9k-make-NF-load-complete-quickly-and-reliably.patch +@@ -0,0 +1,87 @@ ++From: Miaoqing Pan ++Date: Fri, 5 Feb 2016 09:45:50 +0800 ++Subject: [PATCH] ath9k: make NF load complete quickly and reliably ++ ++Make NF load complete quickly and reliably. NF load execution ++is delayed by HW to end of frame if frame Rx or Tx is ongoing. ++Increasing timeout to max frame duration. If NF cal is ongoing ++before NF load, stop it before load, and restart it afterwards. ++ ++Signed-off-by: Miaoqing Pan ++--- ++ ++--- a/drivers/net/wireless/ath/ath9k/calib.c +++++ b/drivers/net/wireless/ath/ath9k/calib.c ++@@ -241,6 +241,7 @@ int ath9k_hw_loadnf(struct ath_hw *ah, s ++ u8 chainmask = (ah->rxchainmask << 3) | ah->rxchainmask; ++ struct ath_common *common = ath9k_hw_common(ah); ++ s16 default_nf = ath9k_hw_get_default_nf(ah, chan); +++ u32 bb_agc_ctl = REG_READ(ah, AR_PHY_AGC_CONTROL); + -+ if (!success) -+ ifp->stats.tx_errors++; -+-done: -++ -+ brcmu_pkt_buf_free_skb(txp); -+ } -+ -+@@ -600,7 +594,7 @@ void brcmf_txcomplete(struct device *dev -+ if (brcmf_proto_hdrpull(drvr, false, txp, &ifp)) -+ brcmu_pkt_buf_free_skb(txp); -+ else -+- brcmf_txfinalize(drvr, txp, ifp->ifidx, success); -++ brcmf_txfinalize(ifp, txp, success); -+ } -+ } -+ -+--- a/drivers/net/wireless/brcm80211/brcmfmac/core.h -++++ b/drivers/net/wireless/brcm80211/brcmfmac/core.h -+@@ -210,8 +210,7 @@ void brcmf_remove_interface(struct brcmf -+ int brcmf_get_next_free_bsscfgidx(struct brcmf_pub *drvr); -+ void brcmf_txflowblock_if(struct brcmf_if *ifp, -+ enum brcmf_netif_stop_reason reason, bool state); -+-void brcmf_txfinalize(struct brcmf_pub *drvr, struct sk_buff *txp, u8 ifidx, -+- bool success); -++void brcmf_txfinalize(struct brcmf_if *ifp, struct sk_buff *txp, bool success); -+ void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb); -+ -+ /* Sets dongle media info (drv_version, mac address). */ -+--- a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c -+@@ -1506,7 +1506,7 @@ brcmf_fws_txs_process(struct brcmf_fws_i -+ ret = brcmf_fws_txstatus_suppressed(fws, fifo, skb, ifp->ifidx, -+ genbit, seq); -+ if (remove_from_hanger || ret) -+- brcmf_txfinalize(fws->drvr, skb, ifp->ifidx, true); -++ brcmf_txfinalize(ifp, skb, true); -+ -+ return 0; -+ } -+@@ -1905,7 +1905,7 @@ int brcmf_fws_process_skb(struct brcmf_i -+ if (fws->avoid_queueing) { -+ rc = brcmf_proto_txdata(drvr, ifp->ifidx, 0, skb); -+ if (rc < 0) -+- brcmf_txfinalize(drvr, skb, ifp->ifidx, false); -++ brcmf_txfinalize(ifp, skb, false); -+ return rc; ++ if (ah->caldata) ++ h = ah->caldata->nfCalHist; ++@@ -264,6 +265,16 @@ int ath9k_hw_loadnf(struct ath_hw *ah, s + } + -+@@ -1929,7 +1929,7 @@ int brcmf_fws_process_skb(struct brcmf_i -+ brcmf_fws_schedule_deq(fws); -+ } else { -+ brcmf_err("drop skb: no hanger slot\n"); -+- brcmf_txfinalize(drvr, skb, ifp->ifidx, false); -++ brcmf_txfinalize(ifp, skb, false); -+ rc = -ENOMEM; -+ } -+ brcmf_fws_unlock(fws); -+@@ -2009,8 +2009,9 @@ static void brcmf_fws_dequeue_worker(str -+ ret = brcmf_proto_txdata(drvr, ifidx, 0, skb); -+ brcmf_fws_lock(fws); -+ if (ret < 0) -+- brcmf_txfinalize(drvr, skb, ifidx, -+- false); -++ brcmf_txfinalize(brcmf_get_ifp(drvr, -++ ifidx), -++ skb, false); -+ if (fws->bus_flow_blocked) -+ break; -+ } -+--- a/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c -+@@ -873,7 +873,11 @@ brcmf_msgbuf_process_txstatus(struct brc -+ commonring = msgbuf->flowrings[flowid]; -+ atomic_dec(&commonring->outstanding_tx); -+ -+- brcmf_txfinalize(msgbuf->drvr, skb, tx_status->msg.ifidx, true); -++ /* Hante: i believe this was a bug as tx_status->msg.ifidx was used -++ * in brcmf_txfinalize as index in drvr->iflist. Can you confirm/deny? ++ /* +++ * stop NF cal if ongoing to ensure NF load completes immediately +++ * (or after end rx/tx frame if ongoing) ++ */ -++ brcmf_txfinalize(brcmf_get_ifp(msgbuf->drvr, tx_status->msg.ifidx), -++ skb, true); -+ } +++ if (bb_agc_ctl & AR_PHY_AGC_CONTROL_NF) { +++ REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NF); +++ REG_RMW_BUFFER_FLUSH(ah); +++ ENABLE_REG_RMW_BUFFER(ah); +++ } +++ +++ /* ++ * Load software filtered NF value into baseband internal minCCApwr ++ * variable. ++ */ ++@@ -276,18 +287,33 @@ int ath9k_hw_loadnf(struct ath_hw *ah, s + ++ /* ++ * Wait for load to complete, should be fast, a few 10s of us. ++- * The max delay was changed from an original 250us to 10000us ++- * since 250us often results in NF load timeout and causes deaf ++- * condition during stress testing 12/12/2009 +++ * The max delay was changed from an original 250us to 22.2 msec. +++ * This would increase timeout to the longest possible frame +++ * (11n max length 22.1 msec) ++ */ ++- for (j = 0; j < 10000; j++) { +++ for (j = 0; j < 22200; j++) { ++ if ((REG_READ(ah, AR_PHY_AGC_CONTROL) & ++- AR_PHY_AGC_CONTROL_NF) == 0) +++ AR_PHY_AGC_CONTROL_NF) == 0) ++ break; ++ udelay(10); ++ } + ++ /* +++ * Restart NF so it can continue. +++ */ +++ if (bb_agc_ctl & AR_PHY_AGC_CONTROL_NF) { +++ ENABLE_REG_RMW_BUFFER(ah); +++ if (bb_agc_ctl & AR_PHY_AGC_CONTROL_ENABLE_NF) +++ REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, +++ AR_PHY_AGC_CONTROL_ENABLE_NF); +++ if (bb_agc_ctl & AR_PHY_AGC_CONTROL_NO_UPDATE_NF) +++ REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, +++ AR_PHY_AGC_CONTROL_NO_UPDATE_NF); +++ REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NF); +++ REG_RMW_BUFFER_FLUSH(ah); +++ } +++ +++ /* ++ * We timed out waiting for the noisefloor to load, probably due to an ++ * in-progress rx. Simply return here and allow the load plenty of time ++ * to complete before the next calibration interval. We need to avoid ++@@ -296,7 +322,7 @@ int ath9k_hw_loadnf(struct ath_hw *ah, s ++ * here, the baseband nf cal will just be capped by our present ++ * noisefloor until the next calibration timer. ++ */ ++- if (j == 10000) { +++ if (j == 22200) { ++ ath_dbg(common, ANY, ++ "Timeout while waiting for nf to load: AR_PHY_AGC_CONTROL=0x%x\n", ++ REG_READ(ah, AR_PHY_AGC_CONTROL)); diff --git a/package/kernel/mac80211/patches/326-ath9k-use-one-shot-read-in-ath9k_hw_update_mibstats.patch b/package/kernel/mac80211/patches/326-ath9k-use-one-shot-read-in-ath9k_hw_update_mibstats.patch deleted file mode 100644 index a22cd1d..0000000 @@ -12278,104 +12956,6 @@ index a22cd1d..0000000 - } - - static void ath9k_ani_restart(struct ath_hw *ah) -diff --git a/package/kernel/mac80211/patches/326-brcmfmac-add-mapping-for-interface-index-to-bsscfg-i.patch b/package/kernel/mac80211/patches/326-brcmfmac-add-mapping-for-interface-index-to-bsscfg-i.patch -new file mode 100644 -index 0000000..8ddc0a6 ---- /dev/null -+++ b/package/kernel/mac80211/patches/326-brcmfmac-add-mapping-for-interface-index-to-bsscfg-i.patch -@@ -0,0 +1,92 @@ -+From: Arend van Spriel -+Date: Wed, 26 Aug 2015 22:15:00 +0200 -+Subject: [PATCH] brcmfmac: add mapping for interface index to bsscfg -+ index -+ -+Because the P2P Device interface in firmware uses the same interface -+index as the primary interface we use the bsscfg index as index in the -+struct brcmf_pub::iflist. However, in the data path we get the interface -+index and not the bsscfg index. So we need a mapping of interface index -+to bsscfg index, which can be determined upon handle adding the interface. -+ -+Reviewed-by: Hante Meuleman -+Reviewed-by: Franky (Zhenhui) Lin -+Reviewed-by: Pieter-Paul Giesberts -+Signed-off-by: Arend van Spriel -+--- -+ -+--- a/drivers/net/wireless/brcm80211/brcmfmac/core.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c -+@@ -85,21 +85,20 @@ char *brcmf_ifname(struct brcmf_pub *drv -+ -+ struct brcmf_if *brcmf_get_ifp(struct brcmf_pub *drvr, int ifidx) -+ { -++ struct brcmf_if *ifp; -++ s32 bssidx; -++ -+ if (ifidx < 0 || ifidx >= BRCMF_MAX_IFS) { -+ brcmf_err("ifidx %d out of range\n", ifidx); -+ return NULL; -+ } -+ -+- /* The ifidx is the idx to map to matching netdev/ifp. When receiving -+- * events this is easy because it contains the bssidx which maps -+- * 1-on-1 to the netdev/ifp. But for data frames the ifidx is rcvd. -+- * bssidx 1 is used for p2p0 and no data can be received or -+- * transmitted on it. Therefor bssidx is ifidx + 1 if ifidx > 0 -+- */ -+- if (ifidx) -+- ifidx++; -++ ifp = NULL; -++ bssidx = drvr->if2bss[ifidx]; -++ if (bssidx >= 0) -++ ifp = drvr->iflist[bssidx]; -+ -+- return drvr->iflist[ifidx]; -++ return ifp; -+ } -+ -+ static void _brcmf_set_multicast_list(struct work_struct *work) -+@@ -831,6 +830,8 @@ struct brcmf_if *brcmf_add_if(struct brc -+ -+ ifp = netdev_priv(ndev); -+ ifp->ndev = ndev; -++ /* store mapping ifidx to bssidx */ -++ drvr->if2bss[ifidx] = bssidx; -+ } -+ -+ ifp->drvr = drvr; -+@@ -855,6 +856,7 @@ static void brcmf_del_if(struct brcmf_pu -+ struct brcmf_if *ifp; -+ -+ ifp = drvr->iflist[bssidx]; -++ drvr->if2bss[ifp->ifidx] = -1; -+ drvr->iflist[bssidx] = NULL; -+ if (!ifp) { -+ brcmf_err("Null interface, idx=%d\n", bssidx); -+@@ -862,6 +864,7 @@ static void brcmf_del_if(struct brcmf_pu -+ } -+ brcmf_dbg(TRACE, "Enter, idx=%d, ifidx=%d\n", bssidx, ifp->ifidx); -+ if (ifp->ndev) { -++ drvr->if2bss[ifp->ifidx] = -1; -+ if (bssidx == 0) { -+ if (ifp->ndev->netdev_ops == &brcmf_netdev_ops_pri) { -+ rtnl_lock(); -+@@ -926,6 +929,7 @@ int brcmf_attach(struct device *dev) -+ if (!drvr) -+ return -ENOMEM; -+ -++ memset(drvr->if2bss, 0xFF, sizeof(drvr->if2bss)); -+ mutex_init(&drvr->proto_block); -+ -+ /* Link to bus module */ -+--- a/drivers/net/wireless/brcm80211/brcmfmac/core.h -++++ b/drivers/net/wireless/brcm80211/brcmfmac/core.h -+@@ -122,6 +122,7 @@ struct brcmf_pub { -+ struct mac_address addresses[BRCMF_MAX_IFS]; -+ -+ struct brcmf_if *iflist[BRCMF_MAX_IFS]; -++ s32 if2bss[BRCMF_MAX_IFS]; -+ -+ struct mutex proto_block; -+ unsigned char proto_buf[BRCMF_DCMD_MAXLEN]; diff --git a/package/kernel/mac80211/patches/327-ath9k-ath9k_hw_loadnf-use-REG_RMW.patch b/package/kernel/mac80211/patches/327-ath9k-ath9k_hw_loadnf-use-REG_RMW.patch deleted file mode 100644 index e5a362f..0000000 @@ -12453,115 +13033,66 @@ index e5a362f..0000000 - - return 0; - } -diff --git a/package/kernel/mac80211/patches/327-brcmfmac-add-dedicated-debug-level-for-firmware-cons.patch b/package/kernel/mac80211/patches/327-brcmfmac-add-dedicated-debug-level-for-firmware-cons.patch +diff --git a/package/kernel/mac80211/patches/327-mac80211-Remove-MPP-table-entries-with-MPath.patch b/package/kernel/mac80211/patches/327-mac80211-Remove-MPP-table-entries-with-MPath.patch new file mode 100644 -index 0000000..a0a798b +index 0000000..f7f9df9 --- /dev/null -+++ b/package/kernel/mac80211/patches/327-brcmfmac-add-dedicated-debug-level-for-firmware-cons.patch -@@ -0,0 +1,103 @@ -+From: Arend van Spriel -+Date: Wed, 26 Aug 2015 22:15:01 +0200 -+Subject: [PATCH] brcmfmac: add dedicated debug level for firmware -+ console logging ++++ b/package/kernel/mac80211/patches/327-mac80211-Remove-MPP-table-entries-with-MPath.patch +@@ -0,0 +1,54 @@ ++From: Henning Rogge ++Date: Wed, 3 Feb 2016 13:58:36 +0100 ++Subject: [PATCH] mac80211: Remove MPP table entries with MPath + -+Both PCIe and SDIO devices have the possibility to log the firmware -+console output in kernel log. For PCIe it is logged when PCIE debug -+level is enabled. For SDIO it is logged when user specifies a non-zero -+console interval through debugfs. This patch tries to make it a -+bit more consistent. The firmware console output is only logged when -+FWCON debug level is enabled. ++Make the mesh_path_del() function remove all mpp table entries ++that are proxied by the removed mesh path. + -+Reviewed-by: Hante Meuleman -+Reviewed-by: Franky (Zhenhui) Lin -+Reviewed-by: Pieter-Paul Giesberts -+Reviewed-by: Pontus Fuchs -+Signed-off-by: Arend van Spriel ++Acked-by: Bob Copeland ++Signed-off-by: Henning Rogge ++Signed-off-by: Johannes Berg +--- + -+--- a/drivers/net/wireless/brcm80211/brcmfmac/debug.h -++++ b/drivers/net/wireless/brcm80211/brcmfmac/debug.h -+@@ -37,6 +37,7 @@ -+ #define BRCMF_SDIO_VAL 0x00020000 -+ #define BRCMF_MSGBUF_VAL 0x00040000 -+ #define BRCMF_PCIE_VAL 0x00080000 -++#define BRCMF_FWCON_VAL 0x00100000 -+ -+ /* set default print format */ -+ #undef pr_fmt -+@@ -78,6 +79,7 @@ do { \ -+ #define BRCMF_GLOM_ON() (brcmf_msg_level & BRCMF_GLOM_VAL) -+ #define BRCMF_EVENT_ON() (brcmf_msg_level & BRCMF_EVENT_VAL) -+ #define BRCMF_FIL_ON() (brcmf_msg_level & BRCMF_FIL_VAL) -++#define BRCMF_FWCON_ON() (brcmf_msg_level & BRCMF_FWCON_VAL) -+ -+ #else /* defined(DEBUG) || defined(CPTCFG_BRCM_TRACING) */ -+ -+@@ -90,6 +92,7 @@ do { \ -+ #define BRCMF_GLOM_ON() 0 -+ #define BRCMF_EVENT_ON() 0 -+ #define BRCMF_FIL_ON() 0 -++#define BRCMF_FWCON_ON() 0 -+ -+ #endif /* defined(DEBUG) || defined(CPTCFG_BRCM_TRACING) */ -+ -+--- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c -+@@ -644,7 +644,7 @@ static void brcmf_pcie_bus_console_init( -+ addr = console->base_addr + BRCMF_CONSOLE_BUFSIZE_OFFSET; -+ console->bufsize = brcmf_pcie_read_tcm32(devinfo, addr); -+ -+- brcmf_dbg(PCIE, "Console: base %x, buf %x, size %d\n", -++ brcmf_dbg(FWCON, "Console: base %x, buf %x, size %d\n", -+ console->base_addr, console->buf_addr, console->bufsize); ++--- a/net/mac80211/mesh_pathtbl.c +++++ b/net/mac80211/mesh_pathtbl.c ++@@ -835,6 +835,29 @@ void mesh_path_flush_by_nexthop(struct s ++ rcu_read_unlock(); + } + -+@@ -656,6 +656,9 @@ static void brcmf_pcie_bus_console_read( -+ u8 ch; -+ u32 newidx; -+ -++ if (!BRCMF_FWCON_ON()) -++ return; +++static void mpp_flush_by_proxy(struct ieee80211_sub_if_data *sdata, +++ const u8 *proxy) +++{ +++ struct mesh_table *tbl; +++ struct mesh_path *mpp; +++ struct mpath_node *node; +++ int i; ++ -+ console = &devinfo->shared.console; -+ addr = console->base_addr + BRCMF_CONSOLE_WRITEIDX_OFFSET; -+ newidx = brcmf_pcie_read_tcm32(devinfo, addr); -+@@ -677,7 +680,7 @@ static void brcmf_pcie_bus_console_read( -+ } -+ if (ch == '\n') { -+ console->log_str[console->log_idx] = 0; -+- brcmf_dbg(PCIE, "CONSOLE: %s", console->log_str); -++ pr_debug("CONSOLE: %s", console->log_str); -+ console->log_idx = 0; -+ } -+ } -+--- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c -+@@ -123,6 +123,7 @@ struct rte_console { -+ -+ #define BRCMF_FIRSTREAD (1 << 6) -+ -++#define BRCMF_CONSOLE 10 /* watchdog interval to poll console */ -+ -+ /* SBSDIO_DEVICE_CTL */ -+ -+@@ -3204,6 +3205,8 @@ static void brcmf_sdio_debugfs_create(st -+ if (IS_ERR_OR_NULL(dentry)) -+ return; -+ -++ bus->console_interval = BRCMF_CONSOLE; +++ rcu_read_lock(); +++ read_lock_bh(&pathtbl_resize_lock); +++ tbl = resize_dereference_mpp_paths(); +++ for_each_mesh_entry(tbl, node, i) { +++ mpp = node->mpath; +++ if (ether_addr_equal(mpp->mpp, proxy)) { +++ spin_lock(&tbl->hashwlock[i]); +++ __mesh_path_del(tbl, node); +++ spin_unlock(&tbl->hashwlock[i]); +++ } +++ } +++ read_unlock_bh(&pathtbl_resize_lock); +++ rcu_read_unlock(); +++} ++ -+ brcmf_debugfs_add_entry(drvr, "forensics", brcmf_sdio_forensic_read); -+ brcmf_debugfs_add_entry(drvr, "counters", -+ brcmf_debugfs_sdio_count_read); -+@@ -3613,7 +3616,7 @@ static void brcmf_sdio_bus_watchdog(stru -+ } -+ #ifdef DEBUG -+ /* Poll for console output periodically */ -+- if (bus->sdiodev->state == BRCMF_SDIOD_DATA && -++ if (bus->sdiodev->state == BRCMF_SDIOD_DATA && BRCMF_FWCON_ON() && -+ bus->console_interval != 0) { -+ bus->console.count += BRCMF_WD_POLL_MS; -+ if (bus->console.count >= bus->console_interval) { ++ static void table_flush_by_iface(struct mesh_table *tbl, ++ struct ieee80211_sub_if_data *sdata) ++ { ++@@ -892,6 +915,9 @@ int mesh_path_del(struct ieee80211_sub_i ++ int hash_idx; ++ int err = 0; ++ +++ /* flush relevant mpp entries first */ +++ mpp_flush_by_proxy(sdata, addr); +++ ++ read_lock_bh(&pathtbl_resize_lock); ++ tbl = resize_dereference_mesh_paths(); ++ hash_idx = mesh_table_hash(addr, sdata, tbl); diff --git a/package/kernel/mac80211/patches/328-ath9k-write-buffer-related-optimisation-in-ar5008_hw.patch b/package/kernel/mac80211/patches/328-ath9k-write-buffer-related-optimisation-in-ar5008_hw.patch deleted file mode 100644 index 01c8011..0000000 @@ -12595,46 +13126,116 @@ index 01c8011..0000000 - REG_WRITE(ah, AR_GTXTO, 25 << AR_GTXTO_TIMEOUT_LIMIT_S); - REG_WRITE(ah, AR_CST, 0xF << AR_CST_TIMEOUT_LIMIT_S); - -diff --git a/package/kernel/mac80211/patches/328-brcmfmac-remove-ifidx-parameter-from-brcmf_fws_txsta.patch b/package/kernel/mac80211/patches/328-brcmfmac-remove-ifidx-parameter-from-brcmf_fws_txsta.patch +diff --git a/package/kernel/mac80211/patches/328-mac80211-let-unused-MPP-table-entries-timeout.patch b/package/kernel/mac80211/patches/328-mac80211-let-unused-MPP-table-entries-timeout.patch new file mode 100644 -index 0000000..53e7ede +index 0000000..740993c --- /dev/null -+++ b/package/kernel/mac80211/patches/328-brcmfmac-remove-ifidx-parameter-from-brcmf_fws_txsta.patch -@@ -0,0 +1,34 @@ -+From: Arend van Spriel -+Date: Wed, 26 Aug 2015 22:15:02 +0200 -+Subject: [PATCH] brcmfmac: remove ifidx parameter from -+ brcmf_fws_txstatus_suppressed() ++++ b/package/kernel/mac80211/patches/328-mac80211-let-unused-MPP-table-entries-timeout.patch +@@ -0,0 +1,104 @@ ++From: Henning Rogge ++Date: Wed, 3 Feb 2016 13:58:37 +0100 ++Subject: [PATCH] mac80211: let unused MPP table entries timeout + -+The brcmf_fws_txstatus_suppressed() function prototype specifies an -+ifidx parameter which is not used within the function implementation. ++Remember the last time when a mpp table entry is used for ++rx or tx and remove them after MESH_PATH_EXPIRE time. + -+Reviewed-by: Hante Meuleman -+Reviewed-by: Franky (Zhenhui) Lin -+Reviewed-by: Pieter-Paul Giesberts -+Signed-off-by: Arend van Spriel ++Acked-by: Bob Copeland ++Signed-off-by: Henning Rogge ++Signed-off-by: Johannes Berg +--- + -+--- a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c -+@@ -1398,7 +1398,7 @@ done: ++--- a/net/mac80211/mesh_pathtbl.c +++++ b/net/mac80211/mesh_pathtbl.c ++@@ -942,6 +942,46 @@ enddel: + } + -+ static int brcmf_fws_txstatus_suppressed(struct brcmf_fws_info *fws, int fifo, -+- struct sk_buff *skb, u8 ifidx, -++ struct sk_buff *skb, -+ u32 genbit, u16 seq) -+ { -+ struct brcmf_fws_mac_descriptor *entry = brcmf_skbcb(skb)->mac; -+@@ -1503,7 +1503,7 @@ brcmf_fws_txs_process(struct brcmf_fws_i -+ return -EINVAL; ++ /** +++ * mpp_path_del - delete a mesh proxy path from the table +++ * +++ * @addr: addr address (ETH_ALEN length) +++ * @sdata: local subif +++ * +++ * Returns: 0 if successful +++ */ +++static int mpp_path_del(struct ieee80211_sub_if_data *sdata, const u8 *addr) +++{ +++ struct mesh_table *tbl; +++ struct mesh_path *mpath; +++ struct mpath_node *node; +++ struct hlist_head *bucket; +++ int hash_idx; +++ int err = 0; +++ +++ read_lock_bh(&pathtbl_resize_lock); +++ tbl = resize_dereference_mpp_paths(); +++ hash_idx = mesh_table_hash(addr, sdata, tbl); +++ bucket = &tbl->hash_buckets[hash_idx]; +++ +++ spin_lock(&tbl->hashwlock[hash_idx]); +++ hlist_for_each_entry(node, bucket, list) { +++ mpath = node->mpath; +++ if (mpath->sdata == sdata && +++ ether_addr_equal(addr, mpath->dst)) { +++ __mesh_path_del(tbl, node); +++ goto enddel; +++ } +++ } +++ +++ err = -ENXIO; +++enddel: +++ mesh_paths_generation++; +++ spin_unlock(&tbl->hashwlock[hash_idx]); +++ read_unlock_bh(&pathtbl_resize_lock); +++ return err; +++} +++ +++/** ++ * mesh_path_tx_pending - sends pending frames in a mesh path queue ++ * ++ * @mpath: mesh path to activate ++@@ -1157,6 +1197,17 @@ void mesh_path_expire(struct ieee80211_s ++ time_after(jiffies, mpath->exp_time + MESH_PATH_EXPIRE)) ++ mesh_path_del(mpath->sdata, mpath->dst); + } -+ if (!remove_from_hanger) -+- ret = brcmf_fws_txstatus_suppressed(fws, fifo, skb, ifp->ifidx, -++ ret = brcmf_fws_txstatus_suppressed(fws, fifo, skb, -+ genbit, seq); -+ if (remove_from_hanger || ret) -+ brcmf_txfinalize(ifp, skb, true); +++ +++ tbl = rcu_dereference(mpp_paths); +++ for_each_mesh_entry(tbl, node, i) { +++ if (node->mpath->sdata != sdata) +++ continue; +++ mpath = node->mpath; +++ if ((!(mpath->flags & MESH_PATH_FIXED)) && +++ time_after(jiffies, mpath->exp_time + MESH_PATH_EXPIRE)) +++ mpp_path_del(mpath->sdata, mpath->dst); +++ } +++ ++ rcu_read_unlock(); ++ } ++ ++--- a/net/mac80211/rx.c +++++ b/net/mac80211/rx.c ++@@ -2291,6 +2291,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80 ++ spin_lock_bh(&mppath->state_lock); ++ if (!ether_addr_equal(mppath->mpp, mpp_addr)) ++ memcpy(mppath->mpp, mpp_addr, ETH_ALEN); +++ mppath->exp_time = jiffies; ++ spin_unlock_bh(&mppath->state_lock); ++ } ++ rcu_read_unlock(); ++--- a/net/mac80211/tx.c +++++ b/net/mac80211/tx.c ++@@ -2171,8 +2171,11 @@ static struct sk_buff *ieee80211_build_h ++ mpp_lookup = true; ++ } ++ ++- if (mpp_lookup) +++ if (mpp_lookup) { ++ mppath = mpp_path_lookup(sdata, skb->data); +++ if (mppath) +++ mppath->exp_time = jiffies; +++ } ++ ++ if (mppath && mpath) ++ mesh_path_del(mpath->sdata, mpath->dst); diff --git a/package/kernel/mac80211/patches/329-ath9k-ath9k_hw_set_4k_power_cal_tabl-use-rmw-buffer.patch b/package/kernel/mac80211/patches/329-ath9k-ath9k_hw_set_4k_power_cal_tabl-use-rmw-buffer.patch deleted file mode 100644 index e5219f2..0000000 @@ -12667,109 +13268,155 @@ index e5219f2..0000000 - - for (i = 0; i < AR5416_EEP4K_MAX_CHAINS; i++) { - regChainOffset = i * 0x1000; -diff --git a/package/kernel/mac80211/patches/329-brcmfmac-change-prototype-for-brcmf_fws_hdrpull.patch b/package/kernel/mac80211/patches/329-brcmfmac-change-prototype-for-brcmf_fws_hdrpull.patch +diff --git a/package/kernel/mac80211/patches/329-mac80211-Unify-mesh-and-mpp-path-removal-function.patch b/package/kernel/mac80211/patches/329-mac80211-Unify-mesh-and-mpp-path-removal-function.patch new file mode 100644 -index 0000000..bb05235 +index 0000000..0c36b1d --- /dev/null -+++ b/package/kernel/mac80211/patches/329-brcmfmac-change-prototype-for-brcmf_fws_hdrpull.patch -@@ -0,0 +1,97 @@ -+From: Arend van Spriel -+Date: Wed, 26 Aug 2015 22:15:03 +0200 -+Subject: [PATCH] brcmfmac: change prototype for brcmf_fws_hdrpull() ++++ b/package/kernel/mac80211/patches/329-mac80211-Unify-mesh-and-mpp-path-removal-function.patch +@@ -0,0 +1,143 @@ ++From: Henning Rogge ++Date: Wed, 3 Feb 2016 13:58:38 +0100 ++Subject: [PATCH] mac80211: Unify mesh and mpp path removal function + -+Instead of passing ifidx and drvr just pass struct brcmf_if pointer -+which holds both parameters. ++mpp_path_del() and mesh_path_del() are mostly the same function. ++Move common code into a new static function. + -+Reviewed-by: Hante Meuleman -+Reviewed-by: Franky (Zhenhui) Lin -+Reviewed-by: Pieter-Paul Giesberts -+Signed-off-by: Arend van Spriel ++Acked-by: Bob Copeland ++Signed-off-by: Henning Rogge ++Signed-off-by: Johannes Berg +--- + -+--- a/drivers/net/wireless/brcm80211/brcmfmac/bcdc.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/bcdc.c -+@@ -312,8 +312,7 @@ brcmf_proto_bcdc_hdrpull(struct brcmf_pu ++--- a/net/mac80211/mesh_pathtbl.c +++++ b/net/mac80211/mesh_pathtbl.c ++@@ -55,16 +55,21 @@ int mpp_paths_generation; ++ static DEFINE_RWLOCK(pathtbl_resize_lock); + -+ skb_pull(pktbuf, BCDC_HEADER_LEN); -+ if (do_fws) -+- brcmf_fws_hdrpull(drvr, tmp_if->ifidx, h->data_offset << 2, -+- pktbuf); -++ brcmf_fws_hdrpull(tmp_if, h->data_offset << 2, pktbuf); -+ else -+ skb_pull(pktbuf, h->data_offset << 2); + -+--- a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c -+@@ -1616,11 +1616,10 @@ static int brcmf_fws_notify_bcmc_credit_ -+ return 0; -+ } -+ -+-int brcmf_fws_hdrpull(struct brcmf_pub *drvr, int ifidx, s16 signal_len, -+- struct sk_buff *skb) -++void brcmf_fws_hdrpull(struct brcmf_if *ifp, s16 siglen, struct sk_buff *skb) +++static inline struct mesh_table *resize_dereference_paths( +++ struct mesh_table __rcu *table) +++{ +++ return rcu_dereference_protected(table, +++ lockdep_is_held(&pathtbl_resize_lock)); +++} +++ ++ static inline struct mesh_table *resize_dereference_mesh_paths(void) + { -+ struct brcmf_skb_reorder_data *rd; -+- struct brcmf_fws_info *fws = drvr->fws; -++ struct brcmf_fws_info *fws = ifp->drvr->fws; -+ u8 *signal_data; -+ s16 data_len; -+ u8 type; -+@@ -1630,20 +1629,20 @@ int brcmf_fws_hdrpull(struct brcmf_pub * -+ s32 err; -+ -+ brcmf_dbg(HDRS, "enter: ifidx %d, skblen %u, sig %d\n", -+- ifidx, skb->len, signal_len); -++ ifp->ifidx, skb->len, siglen); -+ -+- WARN_ON(signal_len > skb->len); -++ WARN_ON(siglen > skb->len); -+ -+- if (!signal_len) -+- return 0; -++ if (!siglen) -++ return; -+ /* if flow control disabled, skip to packet data and leave */ -+ if ((!fws) || (!fws->fw_signals)) { -+- skb_pull(skb, signal_len); -+- return 0; -++ skb_pull(skb, siglen); -++ return; -+ } -+ -+ fws->stats.header_pulls++; -+- data_len = signal_len; -++ data_len = siglen; -+ signal_data = skb->data; -+ -+ status = BRCMF_FWS_RET_OK_NOSCHEDULE; -+@@ -1731,14 +1730,12 @@ int brcmf_fws_hdrpull(struct brcmf_pub * -+ /* signalling processing result does -+ * not affect the actual ethernet packet. -+ */ -+- skb_pull(skb, signal_len); -++ skb_pull(skb, siglen); -+ -+ /* this may be a signal-only packet -+ */ -+ if (skb->len == 0) -+ fws->stats.header_only_pkt++; -+- -+- return 0; ++- return rcu_dereference_protected(mesh_paths, ++- lockdep_is_held(&pathtbl_resize_lock)); +++ return resize_dereference_paths(mesh_paths); + } + -+ static u8 brcmf_fws_precommit_skb(struct brcmf_fws_info *fws, int fifo, -+--- a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.h -++++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.h -+@@ -21,8 +21,7 @@ -+ int brcmf_fws_init(struct brcmf_pub *drvr); -+ void brcmf_fws_deinit(struct brcmf_pub *drvr); -+ bool brcmf_fws_fc_active(struct brcmf_fws_info *fws); -+-int brcmf_fws_hdrpull(struct brcmf_pub *drvr, int ifidx, s16 signal_len, -+- struct sk_buff *skb); -++void brcmf_fws_hdrpull(struct brcmf_if *ifp, s16 siglen, struct sk_buff *skb); -+ int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb); ++ static inline struct mesh_table *resize_dereference_mpp_paths(void) ++ { ++- return rcu_dereference_protected(mpp_paths, ++- lockdep_is_held(&pathtbl_resize_lock)); +++ return resize_dereference_paths(mpp_paths); ++ } ++ ++ /* ++@@ -899,14 +904,17 @@ void mesh_path_flush_by_iface(struct iee ++ } ++ ++ /** ++- * mesh_path_del - delete a mesh path from the table +++ * table_path_del - delete a path from the mesh or mpp table ++ * ++- * @addr: dst address (ETH_ALEN length) +++ * @tbl: mesh or mpp path table ++ * @sdata: local subif +++ * @addr: dst address (ETH_ALEN length) ++ * ++ * Returns: 0 if successful ++ */ ++-int mesh_path_del(struct ieee80211_sub_if_data *sdata, const u8 *addr) +++static int table_path_del(struct mesh_table __rcu *rcu_tbl, +++ struct ieee80211_sub_if_data *sdata, +++ const u8 *addr) ++ { ++ struct mesh_table *tbl; ++ struct mesh_path *mpath; ++@@ -915,11 +923,7 @@ int mesh_path_del(struct ieee80211_sub_i ++ int hash_idx; ++ int err = 0; ++ ++- /* flush relevant mpp entries first */ ++- mpp_flush_by_proxy(sdata, addr); ++- ++- read_lock_bh(&pathtbl_resize_lock); ++- tbl = resize_dereference_mesh_paths(); +++ tbl = resize_dereference_paths(rcu_tbl); ++ hash_idx = mesh_table_hash(addr, sdata, tbl); ++ bucket = &tbl->hash_buckets[hash_idx]; ++ ++@@ -935,9 +939,30 @@ int mesh_path_del(struct ieee80211_sub_i ++ ++ err = -ENXIO; ++ enddel: ++- mesh_paths_generation++; ++ spin_unlock(&tbl->hashwlock[hash_idx]); +++ return err; +++} +++ +++/** +++ * mesh_path_del - delete a mesh path from the table +++ * +++ * @addr: dst address (ETH_ALEN length) +++ * @sdata: local subif +++ * +++ * Returns: 0 if successful +++ */ +++int mesh_path_del(struct ieee80211_sub_if_data *sdata, const u8 *addr) +++{ +++ int err = 0; +++ +++ /* flush relevant mpp entries first */ +++ mpp_flush_by_proxy(sdata, addr); +++ +++ read_lock_bh(&pathtbl_resize_lock); +++ err = table_path_del(mesh_paths, sdata, addr); +++ mesh_paths_generation++; ++ read_unlock_bh(&pathtbl_resize_lock); +++ ++ return err; ++ } ++ ++@@ -951,33 +976,13 @@ enddel: ++ */ ++ static int mpp_path_del(struct ieee80211_sub_if_data *sdata, const u8 *addr) ++ { ++- struct mesh_table *tbl; ++- struct mesh_path *mpath; ++- struct mpath_node *node; ++- struct hlist_head *bucket; ++- int hash_idx; ++ int err = 0; ++ ++ read_lock_bh(&pathtbl_resize_lock); ++- tbl = resize_dereference_mpp_paths(); ++- hash_idx = mesh_table_hash(addr, sdata, tbl); ++- bucket = &tbl->hash_buckets[hash_idx]; ++- ++- spin_lock(&tbl->hashwlock[hash_idx]); ++- hlist_for_each_entry(node, bucket, list) { ++- mpath = node->mpath; ++- if (mpath->sdata == sdata && ++- ether_addr_equal(addr, mpath->dst)) { ++- __mesh_path_del(tbl, node); ++- goto enddel; ++- } ++- } ++- ++- err = -ENXIO; ++-enddel: ++- mesh_paths_generation++; ++- spin_unlock(&tbl->hashwlock[hash_idx]); +++ err = table_path_del(mpp_paths, sdata, addr); +++ mpp_paths_generation++; ++ read_unlock_bh(&pathtbl_resize_lock); +++ ++ return err; ++ } + -+ void brcmf_fws_reset_interface(struct brcmf_if *ifp); diff --git a/package/kernel/mac80211/patches/330-ath9k-use-rmw-buffer-in-ath9k_hw_set_operating_mode-.patch b/package/kernel/mac80211/patches/330-ath9k-use-rmw-buffer-in-ath9k_hw_set_operating_mode-.patch deleted file mode 100644 index 6ce3f40..0000000 @@ -12819,111 +13466,63 @@ index 6ce3f40..0000000 - - ath9k_hw_init_bb(ah, chan); - -diff --git a/package/kernel/mac80211/patches/330-brcmfmac-introduce-brcmf_net_detach-function.patch b/package/kernel/mac80211/patches/330-brcmfmac-introduce-brcmf_net_detach-function.patch +diff --git a/package/kernel/mac80211/patches/330-mac80211-minstrel-Change-expected-throughput-unit-ba.patch b/package/kernel/mac80211/patches/330-mac80211-minstrel-Change-expected-throughput-unit-ba.patch new file mode 100644 -index 0000000..0651a2f +index 0000000..4dc6d66 --- /dev/null -+++ b/package/kernel/mac80211/patches/330-brcmfmac-introduce-brcmf_net_detach-function.patch -@@ -0,0 +1,99 @@ -+From: Arend van Spriel -+Date: Wed, 26 Aug 2015 22:15:04 +0200 -+Subject: [PATCH] brcmfmac: introduce brcmf_net_detach() function ++++ b/package/kernel/mac80211/patches/330-mac80211-minstrel-Change-expected-throughput-unit-ba.patch +@@ -0,0 +1,51 @@ ++From: Sven Eckelmann ++Date: Tue, 2 Feb 2016 08:12:26 +0100 ++Subject: [PATCH] mac80211: minstrel: Change expected throughput unit back to ++ Kbps + -+In case of error during brcmf_bus_start() the network interfaces were -+freed using free_netdev(). However, the interfaces may have additional -+memory allocated which is not freed. The netdev has destructor set to -+brcmf_cfg80211_free_netdev() which frees the additional memory if -+allocated and call free_netdev(). The brcmf_net_detach() either calls -+brcmf_cfg80211_free_netdev() directly or uses unregister_netdev() when -+struct net_device::reg_state indicates the netdev was registered. ++The change from cur_tp to the function ++minstrel_get_tp_avg/minstrel_ht_get_tp_avg changed the unit used for the ++current throughput. For example in minstrel_ht the correct ++conversion between them would be: + -+Reported-by: Daniel (Deognyoun) Kim -+Reviewed-by: Hante Meuleman -+Reviewed-by: Franky (Zhenhui) Lin -+Reviewed-by: Pieter-Paul Giesberts -+Signed-off-by: Arend van Spriel ++ mrs->cur_tp / 10 == minstrel_ht_get_tp_avg(..). ++ ++This factor 10 must also be included in the calculation of ++minstrel_get_expected_throughput and minstrel_ht_get_expected_throughput to ++return values with the unit [Kbps] instead of [10Kbps]. Otherwise routing ++algorithms like B.A.T.M.A.N. V will make incorrect decision based on these ++values. Its kernel based implementation expects expected_throughput always ++to have the unit [Kbps] and not sometimes [10Kbps] and sometimes [Kbps]. ++ ++The same requirement has iw or olsrdv2's nl80211 based statistics module ++which retrieve the same data via NL80211_STA_INFO_TX_BITRATE. ++ ++Cc: stable@vger.kernel.org ++Fixes: 6a27b2c40b48 ("mac80211: restructure per-rate throughput calculation into function") ++Signed-off-by: Sven Eckelmann ++Signed-off-by: Johannes Berg +--- + -+--- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c -+@@ -4747,7 +4747,8 @@ void brcmf_cfg80211_free_netdev(struct n -+ ifp = netdev_priv(ndev); -+ vif = ifp->vif; ++--- a/net/mac80211/rc80211_minstrel.c +++++ b/net/mac80211/rc80211_minstrel.c ++@@ -711,7 +711,7 @@ static u32 minstrel_get_expected_through ++ * computing cur_tp ++ */ ++ tmp_mrs = &mi->r[idx].stats; ++- tmp_cur_tp = minstrel_get_tp_avg(&mi->r[idx], tmp_mrs->prob_ewma); +++ tmp_cur_tp = minstrel_get_tp_avg(&mi->r[idx], tmp_mrs->prob_ewma) * 10; ++ tmp_cur_tp = tmp_cur_tp * 1200 * 8 / 1024; + -+- brcmf_free_vif(vif); -++ if (vif) -++ brcmf_free_vif(vif); -+ free_netdev(ndev); ++ return tmp_cur_tp; ++--- a/net/mac80211/rc80211_minstrel_ht.c +++++ b/net/mac80211/rc80211_minstrel_ht.c ++@@ -1335,7 +1335,8 @@ static u32 minstrel_ht_get_expected_thro ++ prob = mi->groups[i].rates[j].prob_ewma; ++ ++ /* convert tp_avg from pkt per second in kbps */ ++- tp_avg = minstrel_ht_get_tp_avg(mi, i, j, prob) * AVG_PKT_SIZE * 8 / 1024; +++ tp_avg = minstrel_ht_get_tp_avg(mi, i, j, prob) * 10; +++ tp_avg = tp_avg * AVG_PKT_SIZE * 8 / 1024; ++ ++ return tp_avg; + } -+ -+--- a/drivers/net/wireless/brcm80211/brcmfmac/core.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c -+@@ -718,8 +718,6 @@ int brcmf_net_attach(struct brcmf_if *if -+ } -+ -+ brcmf_dbg(INFO, "%s: Broadcom Dongle Host Driver\n", ndev->name); -+- -+- ndev->destructor = brcmf_cfg80211_free_netdev; -+ return 0; -+ -+ fail: -+@@ -729,6 +727,14 @@ fail: -+ return -EBADE; -+ } -+ -++static void brcmf_net_detach(struct net_device *ndev) -++{ -++ if (ndev->reg_state == NETREG_REGISTERED) -++ unregister_netdev(ndev); -++ else -++ brcmf_cfg80211_free_netdev(ndev); -++} -++ -+ static int brcmf_net_p2p_open(struct net_device *ndev) -+ { -+ brcmf_dbg(TRACE, "Enter\n"); -+@@ -805,8 +811,7 @@ struct brcmf_if *brcmf_add_if(struct brc -+ ifp->ndev->name); -+ if (ifidx) { -+ netif_stop_queue(ifp->ndev); -+- unregister_netdev(ifp->ndev); -+- free_netdev(ifp->ndev); -++ brcmf_net_detach(ifp->ndev); -+ drvr->iflist[bssidx] = NULL; -+ } else { -+ brcmf_err("ignore IF event\n"); -+@@ -828,6 +833,7 @@ struct brcmf_if *brcmf_add_if(struct brc -+ if (!ndev) -+ return ERR_PTR(-ENOMEM); -+ -++ ndev->destructor = brcmf_cfg80211_free_netdev; -+ ifp = netdev_priv(ndev); -+ ifp->ndev = ndev; -+ /* store mapping ifidx to bssidx */ -+@@ -879,8 +885,7 @@ static void brcmf_del_if(struct brcmf_pu -+ cancel_work_sync(&ifp->setmacaddr_work); -+ cancel_work_sync(&ifp->multicast_work); -+ } -+- /* unregister will take care of freeing it */ -+- unregister_netdev(ifp->ndev); -++ brcmf_net_detach(ifp->ndev); -+ } -+ } -+ -+@@ -1056,11 +1061,11 @@ fail: -+ brcmf_fws_deinit(drvr); -+ } -+ if (drvr->iflist[0]) { -+- free_netdev(ifp->ndev); -++ brcmf_net_detach(ifp->ndev); -+ drvr->iflist[0] = NULL; -+ } -+ if (p2p_ifp) { -+- free_netdev(p2p_ifp->ndev); -++ brcmf_net_detach(p2p_ifp->ndev); -+ drvr->iflist[1] = NULL; -+ } -+ return ret; diff --git a/package/kernel/mac80211/patches/331-ath9k-ath9k_hw_4k_set_board_values-use-rmw-buffer.patch b/package/kernel/mac80211/patches/331-ath9k-ath9k_hw_4k_set_board_values-use-rmw-buffer.patch deleted file mode 100644 index edd6160..0000000 @@ -12956,244 +13555,319 @@ index edd6160..0000000 - } - } - -diff --git a/package/kernel/mac80211/patches/331-brcmfmac-Reset-PCIE-devices-after-recognition.patch b/package/kernel/mac80211/patches/331-brcmfmac-Reset-PCIE-devices-after-recognition.patch +diff --git a/package/kernel/mac80211/patches/331-brcmfmac-Increase-nr-of-supported-flowrings.patch b/package/kernel/mac80211/patches/331-brcmfmac-Increase-nr-of-supported-flowrings.patch new file mode 100644 -index 0000000..5a7e447 +index 0000000..1fd016f --- /dev/null -+++ b/package/kernel/mac80211/patches/331-brcmfmac-Reset-PCIE-devices-after-recognition.patch -@@ -0,0 +1,193 @@ ++++ b/package/kernel/mac80211/patches/331-brcmfmac-Increase-nr-of-supported-flowrings.patch +@@ -0,0 +1,307 @@ +From: Hante Meuleman -+Date: Thu, 27 Aug 2015 16:14:06 +0200 -+Subject: [PATCH] brcmfmac: Reset PCIE devices after recognition. ++Date: Sun, 7 Feb 2016 18:08:24 +0100 ++Subject: [PATCH] brcmfmac: Increase nr of supported flowrings. ++MIME-Version: 1.0 ++Content-Type: text/plain; charset=UTF-8 ++Content-Transfer-Encoding: 8bit + -+When PCIE type devices are being FW reloaded without being properly -+reset then the device ends up in a locked state, requiring the -+device to be completely powered down. This patch adds a reset -+through watchdog at the moment the device (cores) has been -+recognized. This will solve warm reboot issues. ++New generation devices have firmware which has more than 256 flowrings. ++E.g. following debugging message comes from 14e4:4365 BCM4366: ++[ 194.606245] brcmfmac: brcmf_pcie_init_ringbuffers Nr of flowrings is 264 + -+Cc: Rafal Milecki ++At various code places (related to flowrings) we were using u8 which ++could lead to storing wrong number or infinite loops when indexing with ++this type. This issue was quite easy to spot in brcmf_flowring_detach ++where it led to infinite loop e.g. on failed initialization. ++ ++This patch switches code to proper types and increases the maximum ++number of supported flowrings to 512. ++ ++Originally this change was sent in September 2015, but back it was ++causing a regression on BCM43602 resulting in: ++Unable to handle kernel NULL pointer dereference at virtual address ... ++ ++The reason for this regression was missing update (s/u8/u16) of struct ++brcmf_flowring_ring. This problem was handled in 9f64df9 ("brcmfmac: Fix ++bug in flowring management."). Starting with that it's safe to apply ++this original patch as it doesn't cause a regression anymore. ++ ++This patch fixes an infinite loop on BCM4366 which is supported since ++4.4 so it makes sense to apply it to stable 4.4+. ++ ++Cc: # 4.4+ +Reviewed-by: Arend Van Spriel +Reviewed-by: Franky (Zhenhui) Lin +Reviewed-by: Pieter-Paul Giesberts +Signed-off-by: Hante Meuleman +Signed-off-by: Arend van Spriel ++Signed-off-by: Rafał Miłecki +--- + -+--- a/drivers/net/wireless/brcm80211/brcmfmac/chip.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c -+@@ -101,6 +101,9 @@ -+ /* ARM Cortex M3 core, ID 0x82a */ -+ #define BCM4329_CORE_ARM_BASE 0x18002000 ++--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c +++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c ++@@ -32,7 +32,7 @@ ++ #define BRCMF_FLOWRING_LOW (BRCMF_FLOWRING_HIGH - 256) ++ #define BRCMF_FLOWRING_INVALID_IFIDX 0xff + -++/* Max possibly supported memory size (limited by IO mapped memory) */ -++#define BRCMF_CHIP_MAX_MEMSIZE (4 * 1024 * 1024) -++ -+ #define CORE_SB(base, field) \ -+ (base + SBCONFIGOFF + offsetof(struct sbconfig, field)) -+ #define SBCOREREV(sbidh) \ -+@@ -687,6 +690,12 @@ static int brcmf_chip_get_raminfo(struct -+ brcmf_err("RAM size is undetermined\n"); -+ return -ENOMEM; ++-#define BRCMF_FLOWRING_HASH_AP(da, fifo, ifidx) (da[5] + fifo + ifidx * 16) +++#define BRCMF_FLOWRING_HASH_AP(da, fifo, ifidx) (da[5] * 2 + fifo + ifidx * 16) ++ #define BRCMF_FLOWRING_HASH_STA(fifo, ifidx) (fifo + ifidx * 16) ++ ++ static const u8 brcmf_flowring_prio2fifo[] = { ++@@ -68,7 +68,7 @@ u32 brcmf_flowring_lookup(struct brcmf_f ++ u8 prio, u8 ifidx) ++ { ++ struct brcmf_flowring_hash *hash; ++- u8 hash_idx; +++ u16 hash_idx; ++ u32 i; ++ bool found; ++ bool sta; ++@@ -88,6 +88,7 @@ u32 brcmf_flowring_lookup(struct brcmf_f + } -++ -++ if (ci->pub.ramsize > BRCMF_CHIP_MAX_MEMSIZE) { -++ brcmf_err("RAM size is incorrect\n"); -++ return -ENOMEM; -++ } -++ -+ return 0; ++ hash_idx = sta ? BRCMF_FLOWRING_HASH_STA(fifo, ifidx) : ++ BRCMF_FLOWRING_HASH_AP(mac, fifo, ifidx); +++ hash_idx &= (BRCMF_FLOWRING_HASHSIZE - 1); ++ found = false; ++ hash = flow->hash; ++ for (i = 0; i < BRCMF_FLOWRING_HASHSIZE; i++) { ++@@ -98,6 +99,7 @@ u32 brcmf_flowring_lookup(struct brcmf_f ++ break; ++ } ++ hash_idx++; +++ hash_idx &= (BRCMF_FLOWRING_HASHSIZE - 1); ++ } ++ if (found) ++ return hash[hash_idx].flowid; ++@@ -111,7 +113,7 @@ u32 brcmf_flowring_create(struct brcmf_f ++ { ++ struct brcmf_flowring_ring *ring; ++ struct brcmf_flowring_hash *hash; ++- u8 hash_idx; +++ u16 hash_idx; ++ u32 i; ++ bool found; ++ u8 fifo; ++@@ -131,6 +133,7 @@ u32 brcmf_flowring_create(struct brcmf_f ++ } ++ hash_idx = sta ? BRCMF_FLOWRING_HASH_STA(fifo, ifidx) : ++ BRCMF_FLOWRING_HASH_AP(mac, fifo, ifidx); +++ hash_idx &= (BRCMF_FLOWRING_HASHSIZE - 1); ++ found = false; ++ hash = flow->hash; ++ for (i = 0; i < BRCMF_FLOWRING_HASHSIZE; i++) { ++@@ -140,6 +143,7 @@ u32 brcmf_flowring_create(struct brcmf_f ++ break; ++ } ++ hash_idx++; +++ hash_idx &= (BRCMF_FLOWRING_HASHSIZE - 1); ++ } ++ if (found) { ++ for (i = 0; i < flow->nrofrings; i++) { ++@@ -169,7 +173,7 @@ u32 brcmf_flowring_create(struct brcmf_f + } + -+@@ -899,6 +908,15 @@ static int brcmf_chip_recognition(struct + -+ /* assure chip is passive for core access */ -+ brcmf_chip_set_passive(&ci->pub); -++ -++ /* Call bus specific reset function now. Cores have been determined -++ * but further access may require a chip specific reset at this point. -++ */ -++ if (ci->ops->reset) { -++ ci->ops->reset(ci->ctx, &ci->pub); -++ brcmf_chip_set_passive(&ci->pub); -++ } -++ -+ return brcmf_chip_get_raminfo(ci); ++-u8 brcmf_flowring_tid(struct brcmf_flowring *flow, u8 flowid) +++u8 brcmf_flowring_tid(struct brcmf_flowring *flow, u16 flowid) ++ { ++ struct brcmf_flowring_ring *ring; ++ ++@@ -179,7 +183,7 @@ u8 brcmf_flowring_tid(struct brcmf_flowr + } + -+--- a/drivers/net/wireless/brcm80211/brcmfmac/chip.h -++++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.h -+@@ -73,6 +73,7 @@ struct brcmf_buscore_ops { -+ u32 (*read32)(void *ctx, u32 addr); -+ void (*write32)(void *ctx, u32 addr, u32 value); -+ int (*prepare)(void *ctx); -++ int (*reset)(void *ctx, struct brcmf_chip *chip); -+ int (*setup)(void *ctx, struct brcmf_chip *chip); -+ void (*activate)(void *ctx, struct brcmf_chip *chip, u32 rstvec); ++ ++-static void brcmf_flowring_block(struct brcmf_flowring *flow, u8 flowid, +++static void brcmf_flowring_block(struct brcmf_flowring *flow, u16 flowid, ++ bool blocked) ++ { ++ struct brcmf_flowring_ring *ring; ++@@ -228,10 +232,10 @@ static void brcmf_flowring_block(struct ++ } ++ ++ ++-void brcmf_flowring_delete(struct brcmf_flowring *flow, u8 flowid) +++void brcmf_flowring_delete(struct brcmf_flowring *flow, u16 flowid) ++ { ++ struct brcmf_flowring_ring *ring; ++- u8 hash_idx; +++ u16 hash_idx; ++ struct sk_buff *skb; ++ ++ ring = flow->rings[flowid]; ++@@ -253,7 +257,7 @@ void brcmf_flowring_delete(struct brcmf_ ++ } ++ ++ ++-u32 brcmf_flowring_enqueue(struct brcmf_flowring *flow, u8 flowid, +++u32 brcmf_flowring_enqueue(struct brcmf_flowring *flow, u16 flowid, ++ struct sk_buff *skb) ++ { ++ struct brcmf_flowring_ring *ring; ++@@ -279,7 +283,7 @@ u32 brcmf_flowring_enqueue(struct brcmf_ ++ } ++ ++ ++-struct sk_buff *brcmf_flowring_dequeue(struct brcmf_flowring *flow, u8 flowid) +++struct sk_buff *brcmf_flowring_dequeue(struct brcmf_flowring *flow, u16 flowid) ++ { ++ struct brcmf_flowring_ring *ring; ++ struct sk_buff *skb; ++@@ -300,7 +304,7 @@ struct sk_buff *brcmf_flowring_dequeue(s ++ } ++ ++ ++-void brcmf_flowring_reinsert(struct brcmf_flowring *flow, u8 flowid, +++void brcmf_flowring_reinsert(struct brcmf_flowring *flow, u16 flowid, ++ struct sk_buff *skb) ++ { ++ struct brcmf_flowring_ring *ring; ++@@ -311,7 +315,7 @@ void brcmf_flowring_reinsert(struct brcm ++ } ++ ++ ++-u32 brcmf_flowring_qlen(struct brcmf_flowring *flow, u8 flowid) +++u32 brcmf_flowring_qlen(struct brcmf_flowring *flow, u16 flowid) ++ { ++ struct brcmf_flowring_ring *ring; ++ ++@@ -326,7 +330,7 @@ u32 brcmf_flowring_qlen(struct brcmf_flo ++ } ++ ++ ++-void brcmf_flowring_open(struct brcmf_flowring *flow, u8 flowid) +++void brcmf_flowring_open(struct brcmf_flowring *flow, u16 flowid) ++ { ++ struct brcmf_flowring_ring *ring; ++ ++@@ -340,10 +344,10 @@ void brcmf_flowring_open(struct brcmf_fl ++ } ++ ++ ++-u8 brcmf_flowring_ifidx_get(struct brcmf_flowring *flow, u8 flowid) +++u8 brcmf_flowring_ifidx_get(struct brcmf_flowring *flow, u16 flowid) ++ { ++ struct brcmf_flowring_ring *ring; ++- u8 hash_idx; +++ u16 hash_idx; ++ ++ ring = flow->rings[flowid]; ++ hash_idx = ring->hash_id; ++@@ -384,7 +388,7 @@ void brcmf_flowring_detach(struct brcmf_ ++ struct brcmf_pub *drvr = bus_if->drvr; ++ struct brcmf_flowring_tdls_entry *search; ++ struct brcmf_flowring_tdls_entry *remove; ++- u8 flowid; +++ u16 flowid; ++ ++ for (flowid = 0; flowid < flow->nrofrings; flowid++) { ++ if (flow->rings[flowid]) ++@@ -408,7 +412,7 @@ void brcmf_flowring_configure_addr_mode( ++ struct brcmf_bus *bus_if = dev_get_drvdata(flow->dev); ++ struct brcmf_pub *drvr = bus_if->drvr; ++ u32 i; ++- u8 flowid; +++ u16 flowid; ++ ++ if (flow->addr_mode[ifidx] != addr_mode) { ++ for (i = 0; i < ARRAY_SIZE(flow->hash); i++) { ++@@ -434,7 +438,7 @@ void brcmf_flowring_delete_peer(struct b ++ struct brcmf_flowring_tdls_entry *prev; ++ struct brcmf_flowring_tdls_entry *search; ++ u32 i; ++- u8 flowid; +++ u16 flowid; ++ bool sta; ++ ++ sta = (flow->addr_mode[ifidx] == ADDR_INDIRECT); ++--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.h +++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.h ++@@ -16,7 +16,7 @@ ++ #define BRCMFMAC_FLOWRING_H ++ ++ ++-#define BRCMF_FLOWRING_HASHSIZE 256 +++#define BRCMF_FLOWRING_HASHSIZE 512 /* has to be 2^x */ ++ #define BRCMF_FLOWRING_INVALID_ID 0xFFFFFFFF ++ ++ ++@@ -24,7 +24,7 @@ struct brcmf_flowring_hash { ++ u8 mac[ETH_ALEN]; ++ u8 fifo; ++ u8 ifidx; ++- u8 flowid; +++ u16 flowid; + }; -+--- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c -+@@ -74,6 +74,8 @@ enum brcmf_pcie_state { -+ #define BRCMF_PCIE_REG_INTMASK 0x94 -+ #define BRCMF_PCIE_REG_SBMBX 0x98 + -++#define BRCMF_PCIE_REG_LINK_STATUS_CTRL 0xBC -++ -+ #define BRCMF_PCIE_PCIE2REG_INTMASK 0x24 -+ #define BRCMF_PCIE_PCIE2REG_MAILBOXINT 0x48 -+ #define BRCMF_PCIE_PCIE2REG_MAILBOXMASK 0x4C -+@@ -466,6 +468,7 @@ brcmf_pcie_select_core(struct brcmf_pcie -+ -+ static void brcmf_pcie_reset_device(struct brcmf_pciedev_info *devinfo) -+ { -++ struct brcmf_core *core; -+ u16 cfg_offset[] = { BRCMF_PCIE_CFGREG_STATUS_CMD, -+ BRCMF_PCIE_CFGREG_PM_CSR, -+ BRCMF_PCIE_CFGREG_MSI_CAP, -+@@ -484,32 +487,38 @@ static void brcmf_pcie_reset_device(stru -+ if (!devinfo->ci) -+ return; -+ -++ /* Disable ASPM */ -+ brcmf_pcie_select_core(devinfo, BCMA_CORE_PCIE2); -+- brcmf_pcie_write_reg32(devinfo, BRCMF_PCIE_PCIE2REG_CONFIGADDR, -+- BRCMF_PCIE_CFGREG_LINK_STATUS_CTRL); -+- lsc = brcmf_pcie_read_reg32(devinfo, BRCMF_PCIE_PCIE2REG_CONFIGDATA); -++ pci_read_config_dword(devinfo->pdev, BRCMF_PCIE_REG_LINK_STATUS_CTRL, -++ &lsc); -+ val = lsc & (~BRCMF_PCIE_LINK_STATUS_CTRL_ASPM_ENAB); -+- brcmf_pcie_write_reg32(devinfo, BRCMF_PCIE_PCIE2REG_CONFIGDATA, val); -++ pci_write_config_dword(devinfo->pdev, BRCMF_PCIE_REG_LINK_STATUS_CTRL, -++ val); -+ -++ /* Watchdog reset */ -+ brcmf_pcie_select_core(devinfo, BCMA_CORE_CHIPCOMMON); -+ WRITECC32(devinfo, watchdog, 4); -+ msleep(100); -+ -++ /* Restore ASPM */ -+ brcmf_pcie_select_core(devinfo, BCMA_CORE_PCIE2); -+- brcmf_pcie_write_reg32(devinfo, BRCMF_PCIE_PCIE2REG_CONFIGADDR, -+- BRCMF_PCIE_CFGREG_LINK_STATUS_CTRL); -+- brcmf_pcie_write_reg32(devinfo, BRCMF_PCIE_PCIE2REG_CONFIGDATA, lsc); -++ pci_write_config_dword(devinfo->pdev, BRCMF_PCIE_REG_LINK_STATUS_CTRL, -++ lsc); -+ -+- brcmf_pcie_select_core(devinfo, BCMA_CORE_PCIE2); -+- for (i = 0; i < ARRAY_SIZE(cfg_offset); i++) { -+- brcmf_pcie_write_reg32(devinfo, BRCMF_PCIE_PCIE2REG_CONFIGADDR, -+- cfg_offset[i]); -+- val = brcmf_pcie_read_reg32(devinfo, -+- BRCMF_PCIE_PCIE2REG_CONFIGDATA); -+- brcmf_dbg(PCIE, "config offset 0x%04x, value 0x%04x\n", -+- cfg_offset[i], val); -+- brcmf_pcie_write_reg32(devinfo, BRCMF_PCIE_PCIE2REG_CONFIGDATA, -+- val); -++ core = brcmf_chip_get_core(devinfo->ci, BCMA_CORE_PCIE2); -++ if (core->rev <= 13) { -++ for (i = 0; i < ARRAY_SIZE(cfg_offset); i++) { -++ brcmf_pcie_write_reg32(devinfo, -++ BRCMF_PCIE_PCIE2REG_CONFIGADDR, -++ cfg_offset[i]); -++ val = brcmf_pcie_read_reg32(devinfo, -++ BRCMF_PCIE_PCIE2REG_CONFIGDATA); -++ brcmf_dbg(PCIE, "config offset 0x%04x, value 0x%04x\n", -++ cfg_offset[i], val); -++ brcmf_pcie_write_reg32(devinfo, -++ BRCMF_PCIE_PCIE2REG_CONFIGDATA, -++ val); -++ } -+ } -+ } -+ -+@@ -519,8 +528,6 @@ static void brcmf_pcie_attach(struct brc -+ u32 config; -+ -+ brcmf_pcie_select_core(devinfo, BCMA_CORE_PCIE2); -+- if (brcmf_pcie_read_reg32(devinfo, BRCMF_PCIE_PCIE2REG_INTMASK) != 0) -+- brcmf_pcie_reset_device(devinfo); -+ /* BAR1 window may not be sized properly */ -+ brcmf_pcie_select_core(devinfo, BCMA_CORE_PCIE2); -+ brcmf_pcie_write_reg32(devinfo, BRCMF_PCIE_PCIE2REG_CONFIGADDR, 0x4e0); -+@@ -1636,6 +1643,23 @@ static int brcmf_pcie_buscoreprep(void * ++ enum ring_status { ++@@ -61,16 +61,16 @@ u32 brcmf_flowring_lookup(struct brcmf_f ++ u8 prio, u8 ifidx); ++ u32 brcmf_flowring_create(struct brcmf_flowring *flow, u8 da[ETH_ALEN], ++ u8 prio, u8 ifidx); ++-void brcmf_flowring_delete(struct brcmf_flowring *flow, u8 flowid); ++-void brcmf_flowring_open(struct brcmf_flowring *flow, u8 flowid); ++-u8 brcmf_flowring_tid(struct brcmf_flowring *flow, u8 flowid); ++-u32 brcmf_flowring_enqueue(struct brcmf_flowring *flow, u8 flowid, +++void brcmf_flowring_delete(struct brcmf_flowring *flow, u16 flowid); +++void brcmf_flowring_open(struct brcmf_flowring *flow, u16 flowid); +++u8 brcmf_flowring_tid(struct brcmf_flowring *flow, u16 flowid); +++u32 brcmf_flowring_enqueue(struct brcmf_flowring *flow, u16 flowid, ++ struct sk_buff *skb); ++-struct sk_buff *brcmf_flowring_dequeue(struct brcmf_flowring *flow, u8 flowid); ++-void brcmf_flowring_reinsert(struct brcmf_flowring *flow, u8 flowid, +++struct sk_buff *brcmf_flowring_dequeue(struct brcmf_flowring *flow, u16 flowid); +++void brcmf_flowring_reinsert(struct brcmf_flowring *flow, u16 flowid, ++ struct sk_buff *skb); ++-u32 brcmf_flowring_qlen(struct brcmf_flowring *flow, u8 flowid); ++-u8 brcmf_flowring_ifidx_get(struct brcmf_flowring *flow, u8 flowid); +++u32 brcmf_flowring_qlen(struct brcmf_flowring *flow, u16 flowid); +++u8 brcmf_flowring_ifidx_get(struct brcmf_flowring *flow, u16 flowid); ++ struct brcmf_flowring *brcmf_flowring_attach(struct device *dev, u16 nrofrings); ++ void brcmf_flowring_detach(struct brcmf_flowring *flow); ++ void brcmf_flowring_configure_addr_mode(struct brcmf_flowring *flow, int ifidx, ++--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c +++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c ++@@ -677,7 +677,7 @@ static u32 brcmf_msgbuf_flowring_create( + } + + -++static int brcmf_pcie_buscore_reset(void *ctx, struct brcmf_chip *chip) -++{ -++ struct brcmf_pciedev_info *devinfo = (struct brcmf_pciedev_info *)ctx; -++ u32 val; -++ -++ devinfo->ci = chip; -++ brcmf_pcie_reset_device(devinfo); -++ -++ val = brcmf_pcie_read_reg32(devinfo, BRCMF_PCIE_PCIE2REG_MAILBOXINT); -++ if (val != 0xffffffff) -++ brcmf_pcie_write_reg32(devinfo, BRCMF_PCIE_PCIE2REG_MAILBOXINT, -++ val); -++ -++ return 0; -++} -++ -++ -+ static void brcmf_pcie_buscore_activate(void *ctx, struct brcmf_chip *chip, -+ u32 rstvec) ++-static void brcmf_msgbuf_txflow(struct brcmf_msgbuf *msgbuf, u8 flowid) +++static void brcmf_msgbuf_txflow(struct brcmf_msgbuf *msgbuf, u16 flowid) + { -+@@ -1647,6 +1671,7 @@ static void brcmf_pcie_buscore_activate( ++ struct brcmf_flowring *flow = msgbuf->flow; ++ struct brcmf_commonring *commonring; ++@@ -1310,7 +1310,7 @@ int brcmf_proto_msgbuf_rx_trigger(struct ++ } + -+ static const struct brcmf_buscore_ops brcmf_pcie_buscore_ops = { -+ .prepare = brcmf_pcie_buscoreprep, -++ .reset = brcmf_pcie_buscore_reset, -+ .activate = brcmf_pcie_buscore_activate, -+ .read32 = brcmf_pcie_buscore_read32, -+ .write32 = brcmf_pcie_buscore_write32, -+@@ -1814,7 +1839,6 @@ brcmf_pcie_remove(struct pci_dev *pdev) -+ brcmf_pcie_intr_disable(devinfo); + -+ brcmf_detach(&pdev->dev); -+- brcmf_pcie_reset_device(devinfo); ++-void brcmf_msgbuf_delete_flowring(struct brcmf_pub *drvr, u8 flowid) +++void brcmf_msgbuf_delete_flowring(struct brcmf_pub *drvr, u16 flowid) ++ { ++ struct brcmf_msgbuf *msgbuf = (struct brcmf_msgbuf *)drvr->proto->pd; ++ struct msgbuf_tx_flowring_delete_req *delete; ++@@ -1415,6 +1415,13 @@ int brcmf_proto_msgbuf_attach(struct brc ++ u32 count; + -+ kfree(bus->bus_priv.pcie); -+ kfree(bus->msgbuf->flowrings); -diff --git a/package/kernel/mac80211/patches/332-ath10k-fix-DMA-related-firmware-crashes-on-multiple-.patch b/package/kernel/mac80211/patches/332-ath10k-fix-DMA-related-firmware-crashes-on-multiple-.patch -new file mode 100644 -index 0000000..52b7fa9 ---- /dev/null -+++ b/package/kernel/mac80211/patches/332-ath10k-fix-DMA-related-firmware-crashes-on-multiple-.patch -@@ -0,0 +1,33 @@ -+From: Felix Fietkau -+Date: Sun, 13 Sep 2015 22:26:10 +0200 -+Subject: [PATCH] ath10k: fix DMA related firmware crashes on multiple devices -+ -+Some platforms really don't like DMA bursts of 256 bytes, and this -+causes the firmware to crash when sending beacons. -+Also, changing this based on the firmware version does not seem to make -+much sense, so use 128 bytes for all versions. -+ -+Cc: stable@vger.kernel.org -+Signed-off-by: Felix Fietkau -+--- -+ -+--- a/drivers/net/wireless/ath/ath10k/hw.h -++++ b/drivers/net/wireless/ath/ath10k/hw.h -+@@ -340,7 +340,7 @@ enum ath10k_hw_rate_cck { -+ #define TARGET_10X_MAX_FRAG_ENTRIES 0 ++ if_msgbuf = drvr->bus_if->msgbuf; +++ +++ if (if_msgbuf->nrof_flowrings >= BRCMF_FLOWRING_HASHSIZE) { +++ brcmf_err("driver not configured for this many flowrings %d\n", +++ if_msgbuf->nrof_flowrings); +++ if_msgbuf->nrof_flowrings = BRCMF_FLOWRING_HASHSIZE - 1; +++ } +++ ++ msgbuf = kzalloc(sizeof(*msgbuf), GFP_KERNEL); ++ if (!msgbuf) ++ goto fail; ++--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.h +++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.h ++@@ -33,7 +33,7 @@ + -+ /* 10.2 parameters */ -+-#define TARGET_10_2_DMA_BURST_SIZE 1 -++#define TARGET_10_2_DMA_BURST_SIZE 0 + -+ /* Target specific defines for WMI-TLV firmware */ -+ #define TARGET_TLV_NUM_VDEVS 4 -+@@ -397,7 +397,7 @@ enum ath10k_hw_rate_cck { -+ -+ #define TARGET_10_4_TX_DBG_LOG_SIZE 1024 -+ #define TARGET_10_4_NUM_WDS_ENTRIES 32 -+-#define TARGET_10_4_DMA_BURST_SIZE 1 -++#define TARGET_10_4_DMA_BURST_SIZE 0 -+ #define TARGET_10_4_MAC_AGGR_DELIM 0 -+ #define TARGET_10_4_RX_SKIP_DEFRAG_TIMEOUT_DUP_DETECTION_CHECK 1 -+ #define TARGET_10_4_VOW_CONFIG 0 ++ int brcmf_proto_msgbuf_rx_trigger(struct device *dev); ++-void brcmf_msgbuf_delete_flowring(struct brcmf_pub *drvr, u8 flowid); +++void brcmf_msgbuf_delete_flowring(struct brcmf_pub *drvr, u16 flowid); ++ int brcmf_proto_msgbuf_attach(struct brcmf_pub *drvr); ++ void brcmf_proto_msgbuf_detach(struct brcmf_pub *drvr); ++ #else diff --git a/package/kernel/mac80211/patches/332-ath9k-ath9k_hw_analog_shift_rmw-use-REG_RMW.patch b/package/kernel/mac80211/patches/332-ath9k-ath9k_hw_analog_shift_rmw-use-REG_RMW.patch deleted file mode 100644 index 3ce4428..0000000 @@ -13227,45 +13901,34 @@ index 3ce4428..0000000 - - if (ah->config.analog_shiftreg) - udelay(100); -diff --git a/package/kernel/mac80211/patches/333-ath9k-enable-hw-manual-peak-calibration-for-QCA9561.patch b/package/kernel/mac80211/patches/333-ath9k-enable-hw-manual-peak-calibration-for-QCA9561.patch +diff --git a/package/kernel/mac80211/patches/332-cfg80211-fix-faulty-variable-initialization-in-ieee8.patch b/package/kernel/mac80211/patches/332-cfg80211-fix-faulty-variable-initialization-in-ieee8.patch new file mode 100644 -index 0000000..faf6cdc +index 0000000..e414f23 --- /dev/null -+++ b/package/kernel/mac80211/patches/333-ath9k-enable-hw-manual-peak-calibration-for-QCA9561.patch -@@ -0,0 +1,33 @@ -+From: Miaoqing Pan -+Date: Tue, 1 Sep 2015 10:56:09 +0800 -+Subject: [PATCH] ath9k: enable hw manual peak calibration for QCA9561 ++++ b/package/kernel/mac80211/patches/332-cfg80211-fix-faulty-variable-initialization-in-ieee8.patch +@@ -0,0 +1,22 @@ ++From: Felix Fietkau ++Date: Mon, 8 Feb 2016 14:24:36 +0100 ++Subject: [PATCH] cfg80211: fix faulty variable initialization in ++ ieee80211_amsdu_to_8023s + -+This patch fix https://lists.openwrt.org/pipermail/openwrt-devel/ -+2015-August/034979.html. As the peak detect calibration is set -+incorrectly. ++reuse_skb is set to true if the code decides to use the last segment. ++Fixes a memory leak + -+Signed-off-by: Miaoqing Pan ++Signed-off-by: Felix Fietkau +--- + -+--- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c -++++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c -+@@ -1249,7 +1249,8 @@ static void ar9003_hw_manual_peak_cal(st -+ REG_RMW_FIELD(ah, AR_PHY_65NM_RXRF_AGC(chain), -+ AR_PHY_65NM_RXRF_AGC_AGC2G_CALDAC_OVR, 0x0); ++--- a/net/wireless/util.c +++++ b/net/wireless/util.c ++@@ -676,7 +676,7 @@ void ieee80211_amsdu_to_8023s(struct sk_ ++ u8 *payload; ++ int offset = 0, remaining, err; ++ struct ethhdr eth; ++- bool reuse_skb = true; +++ bool reuse_skb = false; ++ bool last = false; + -+- if (AR_SREV_9003_PCOEM(ah) || AR_SREV_9550(ah) || AR_SREV_9531(ah)) { -++ if (AR_SREV_9003_PCOEM(ah) || AR_SREV_9550(ah) || AR_SREV_9531(ah) || -++ AR_SREV_9561(ah)) { -+ if (is_2g) -+ REG_RMW_FIELD(ah, AR_PHY_65NM_RXRF_AGC(chain), -+ AR_PHY_65NM_RXRF_AGC_AGC2G_DBDAC_OVR, -+@@ -1640,7 +1641,8 @@ static bool ar9003_hw_init_cal_soc(struc -+ -+ skip_tx_iqcal: -+ if (run_agc_cal || !(ah->ah_flags & AH_FASTCC)) { -+- if (AR_SREV_9330_11(ah) || AR_SREV_9531(ah) || AR_SREV_9550(ah)) { -++ if (AR_SREV_9330_11(ah) || AR_SREV_9531(ah) || AR_SREV_9550(ah) || -++ AR_SREV_9561(ah)) { -+ for (i = 0; i < AR9300_MAX_CHAINS; i++) { -+ if (!(ah->rxchainmask & (1 << i))) -+ continue; ++ if (has_80211_header) { diff --git a/package/kernel/mac80211/patches/333-ath9k-use-REG_RMW-and-rmw-buffer-in-ath9k_hw_4k_set_.patch b/package/kernel/mac80211/patches/333-ath9k-use-REG_RMW-and-rmw-buffer-in-ath9k_hw_4k_set_.patch deleted file mode 100644 index 8f12b36..0000000 @@ -13319,6 +13982,144 @@ index 8f12b36..0000000 - } - - /* +diff --git a/package/kernel/mac80211/patches/333-cfg80211-reuse-existing-page-fragments-in-A-MSDU-rx.patch b/package/kernel/mac80211/patches/333-cfg80211-reuse-existing-page-fragments-in-A-MSDU-rx.patch +new file mode 100644 +index 0000000..6e2d0cf +--- /dev/null ++++ b/package/kernel/mac80211/patches/333-cfg80211-reuse-existing-page-fragments-in-A-MSDU-rx.patch +@@ -0,0 +1,132 @@ ++From: Felix Fietkau ++Date: Mon, 8 Feb 2016 14:33:19 +0100 ++Subject: [PATCH] cfg80211: reuse existing page fragments in A-MSDU rx ++ ++This massively reduces data copying and thus improves rx performance ++ ++Signed-off-by: Felix Fietkau ++--- ++ ++--- a/net/wireless/util.c +++++ b/net/wireless/util.c ++@@ -644,23 +644,93 @@ int ieee80211_data_from_8023(struct sk_b ++ } ++ EXPORT_SYMBOL(ieee80211_data_from_8023); ++ +++static void +++__frame_add_frag(struct sk_buff *skb, struct page *page, +++ void *ptr, int len, int size) +++{ +++ struct skb_shared_info *sh = skb_shinfo(skb); +++ int page_offset; +++ +++ atomic_inc(&page->_count); +++ page_offset = ptr - page_address(page); +++ skb_add_rx_frag(skb, sh->nr_frags, page, page_offset, len, size); +++} +++ +++static void +++__ieee80211_amsdu_copy_frag(struct sk_buff *skb, struct sk_buff *frame, +++ int offset, int len) +++{ +++ struct skb_shared_info *sh = skb_shinfo(skb); +++ const skb_frag_t *frag = &sh->frags[-1]; +++ struct page *frag_page; +++ void *frag_ptr; +++ int frag_len, frag_size; +++ int head_size = skb->len - skb->data_len; +++ int cur_len; +++ +++ frag_page = virt_to_head_page(skb->head); +++ frag_ptr = skb->data; +++ frag_size = head_size; +++ +++ while (offset >= frag_size) { +++ offset -= frag_size; +++ frag++; +++ frag_page = skb_frag_page(frag); +++ frag_ptr = skb_frag_address(frag); +++ frag_size = skb_frag_size(frag); +++ } +++ +++ frag_ptr += offset; +++ frag_len = frag_size - offset; +++ +++ cur_len = min(len, frag_len); +++ +++ __frame_add_frag(frame, frag_page, frag_ptr, cur_len, frag_size); +++ len -= cur_len; +++ +++ while (len > 0) { +++ frag++; +++ frag_len = skb_frag_size(frag); +++ cur_len = min(len, frag_len); +++ __frame_add_frag(frame, skb_frag_page(frag), +++ skb_frag_address(frag), cur_len, frag_len); +++ len -= cur_len; +++ } +++} +++ ++ static struct sk_buff * ++ __ieee80211_amsdu_copy(struct sk_buff *skb, unsigned int hlen, ++- int offset, int len) +++ int offset, int len, bool reuse_frag) ++ { ++ struct sk_buff *frame; +++ int cur_len = len; ++ ++ if (skb->len - offset < len) ++ return NULL; ++ ++ /* +++ * When reusing framents, copy some data to the head to simplify +++ * ethernet header handling and speed up protocol header processing +++ * in the stack later. +++ */ +++ if (reuse_frag) +++ cur_len = min_t(int, len, 32); +++ +++ /* ++ * Allocate and reserve two bytes more for payload ++ * alignment since sizeof(struct ethhdr) is 14. ++ */ ++- frame = dev_alloc_skb(hlen + sizeof(struct ethhdr) + 2 + len); +++ frame = dev_alloc_skb(hlen + sizeof(struct ethhdr) + 2 + cur_len); ++ ++ skb_reserve(frame, hlen + sizeof(struct ethhdr) + 2); ++- skb_copy_bits(skb, offset, skb_put(frame, len), len); +++ skb_copy_bits(skb, offset, skb_put(frame, cur_len), cur_len); +++ +++ len -= cur_len; +++ if (!len) +++ return frame; +++ +++ offset += cur_len; +++ __ieee80211_amsdu_copy_frag(skb, frame, offset, len); ++ ++ return frame; ++ } ++@@ -676,6 +746,7 @@ void ieee80211_amsdu_to_8023s(struct sk_ ++ u8 *payload; ++ int offset = 0, remaining, err; ++ struct ethhdr eth; +++ bool reuse_frag = skb->head_frag && !skb_has_frag_list(skb); ++ bool reuse_skb = false; ++ bool last = false; ++ ++@@ -703,12 +774,13 @@ void ieee80211_amsdu_to_8023s(struct sk_ ++ offset += sizeof(struct ethhdr); ++ /* reuse skb for the last subframe */ ++ last = remaining <= subframe_len + padding; ++- if (!skb_is_nonlinear(skb) && last) { +++ if (!skb_is_nonlinear(skb) && !reuse_frag && last) { ++ skb_pull(skb, offset); ++ frame = skb; ++ reuse_skb = true; ++ } else { ++- frame = __ieee80211_amsdu_copy(skb, hlen, offset, len); +++ frame = __ieee80211_amsdu_copy(skb, hlen, offset, len, +++ reuse_frag); ++ if (!frame) ++ goto purge; ++ diff --git a/package/kernel/mac80211/patches/334-ath9k-use-REG_RMW-and-rmw-buffer-in-ath9k_hw_def_set.patch b/package/kernel/mac80211/patches/334-ath9k-use-REG_RMW-and-rmw-buffer-in-ath9k_hw_def_set.patch deleted file mode 100644 index f26e059..0000000 @@ -13392,35 +14193,6 @@ index f26e059..0000000 - } - - static void ath9k_hw_def_set_board_values(struct ath_hw *ah, -diff --git a/package/kernel/mac80211/patches/334-mac80211-fix-tx-sequence-number-assignment-with-soft.patch b/package/kernel/mac80211/patches/334-mac80211-fix-tx-sequence-number-assignment-with-soft.patch -new file mode 100644 -index 0000000..b19e7ee ---- /dev/null -+++ b/package/kernel/mac80211/patches/334-mac80211-fix-tx-sequence-number-assignment-with-soft.patch -@@ -0,0 +1,23 @@ -+From: Felix Fietkau -+Date: Thu, 24 Sep 2015 14:10:07 +0200 -+Subject: [PATCH] mac80211: fix tx sequence number assignment with software -+ queue + fast-xmit -+ -+When using software queueing, tx sequence number assignment happens at -+ieee80211_tx_dequeue time, so the fast-xmit codepath must not do that. -+ -+Signed-off-by: Felix Fietkau -+--- -+ -+--- a/net/mac80211/tx.c -++++ b/net/mac80211/tx.c -+@@ -2766,7 +2766,8 @@ static bool ieee80211_xmit_fast(struct i -+ -+ if (hdr->frame_control & cpu_to_le16(IEEE80211_STYPE_QOS_DATA)) { -+ *ieee80211_get_qos_ctl(hdr) = tid; -+- hdr->seq_ctrl = ieee80211_tx_next_seq(sta, tid); -++ if (!sta->sta.txq[0]) -++ hdr->seq_ctrl = ieee80211_tx_next_seq(sta, tid); -+ } else { -+ info->flags |= IEEE80211_TX_CTL_ASSIGN_SEQ; -+ hdr->seq_ctrl = cpu_to_le16(sdata->sequence_number); diff --git a/package/kernel/mac80211/patches/335-0001-brcmfmac-Fix-oops-when-SDIO-device-is-removed.patch b/package/kernel/mac80211/patches/335-0001-brcmfmac-Fix-oops-when-SDIO-device-is-removed.patch deleted file mode 100644 index 5e63a80..0000000 @@ -13815,57 +14587,6 @@ index c9eb900..0000000 - #define SDIO_DEVICE_ID_BROADCOM_4354 0x4354 - - #define SDIO_VENDOR_ID_INTEL 0x0089 -diff --git a/package/kernel/mac80211/patches/335-mac80211-fix-handling-of-PS-filtering-with-fast-xmit.patch b/package/kernel/mac80211/patches/335-mac80211-fix-handling-of-PS-filtering-with-fast-xmit.patch -new file mode 100644 -index 0000000..7aef205 ---- /dev/null -+++ b/package/kernel/mac80211/patches/335-mac80211-fix-handling-of-PS-filtering-with-fast-xmit.patch -@@ -0,0 +1,45 @@ -+From: Felix Fietkau -+Date: Thu, 24 Sep 2015 14:11:40 +0200 -+Subject: [PATCH] mac80211: fix handling of PS filtering with fast-xmit -+ -+Fixes dropped packets in the tx path in case a non-PS station triggers -+the tx filter. -+ -+Cc: stable@vger.kernel.org # 4.2 -+Signed-off-by: Felix Fietkau -+--- -+ -+--- a/net/mac80211/status.c -++++ b/net/mac80211/status.c -+@@ -101,6 +101,7 @@ static void ieee80211_handle_filtered_fr -+ * when it wakes up for the next time. -+ */ -+ set_sta_flag(sta, WLAN_STA_CLEAR_PS_FILT); -++ ieee80211_clear_fast_xmit(sta); -+ -+ /* -+ * This code races in the following way: -+--- a/net/mac80211/tx.c -++++ b/net/mac80211/tx.c -+@@ -1217,8 +1217,10 @@ ieee80211_tx_prepare(struct ieee80211_su -+ -+ if (!tx->sta) -+ info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT; -+- else if (test_and_clear_sta_flag(tx->sta, WLAN_STA_CLEAR_PS_FILT)) -++ else if (test_and_clear_sta_flag(tx->sta, WLAN_STA_CLEAR_PS_FILT)) { -+ info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT; -++ ieee80211_check_fast_xmit(tx->sta); -++ } -+ -+ info->flags |= IEEE80211_TX_CTL_FIRST_FRAGMENT; -+ -+@@ -2450,7 +2452,8 @@ void ieee80211_check_fast_xmit(struct st -+ -+ if (test_sta_flag(sta, WLAN_STA_PS_STA) || -+ test_sta_flag(sta, WLAN_STA_PS_DRIVER) || -+- test_sta_flag(sta, WLAN_STA_PS_DELIVER)) -++ test_sta_flag(sta, WLAN_STA_PS_DELIVER) || -++ test_sta_flag(sta, WLAN_STA_CLEAR_PS_FILT)) -+ goto out; -+ -+ if (sdata->noack_map) diff --git a/package/kernel/mac80211/patches/336-0001-brcmfmac-remove-duplication-of-ramsize-info.patch b/package/kernel/mac80211/patches/336-0001-brcmfmac-remove-duplication-of-ramsize-info.patch deleted file mode 100644 index 7a688c4..0000000 @@ -14853,34 +15574,6 @@ index 1b10dbb..0000000 - brcmf_sdio_clkctl(bus, CLK_AVAIL, false); - /* Leave the device in state where it is - * 'passive'. This is done by resetting all -diff --git a/package/kernel/mac80211/patches/336-ath9k-declare-required-extra-tx-headroom.patch b/package/kernel/mac80211/patches/336-ath9k-declare-required-extra-tx-headroom.patch -new file mode 100644 -index 0000000..4d88591 ---- /dev/null -+++ b/package/kernel/mac80211/patches/336-ath9k-declare-required-extra-tx-headroom.patch -@@ -0,0 +1,22 @@ -+From: Felix Fietkau -+Date: Thu, 24 Sep 2015 16:57:37 +0200 -+Subject: [PATCH] ath9k: declare required extra tx headroom -+ -+ath9k inserts padding between the 802.11 header and the data area (to -+align it). Since it didn't declare this extra required headroom, this -+led to some nasty issues like randomly dropped packets in some setups. -+ -+Cc: stable@vger.kernel.org -+Signed-off-by: Felix Fietkau -+--- -+ -+--- a/drivers/net/wireless/ath/ath9k/init.c -++++ b/drivers/net/wireless/ath/ath9k/init.c -+@@ -875,6 +875,7 @@ static void ath9k_set_hw_capab(struct at -+ hw->max_rate_tries = 10; -+ hw->sta_data_size = sizeof(struct ath_node); -+ hw->vif_data_size = sizeof(struct ath_vif); -++ hw->extra_tx_headroom = 4; -+ -+ hw->wiphy->available_antennas_rx = BIT(ah->caps.max_rxchains) - 1; -+ hw->wiphy->available_antennas_tx = BIT(ah->caps.max_txchains) - 1; diff --git a/package/kernel/mac80211/patches/337-0001-brcmfmac-avoid-runtime-pm-for-sdio-host-controller.patch b/package/kernel/mac80211/patches/337-0001-brcmfmac-avoid-runtime-pm-for-sdio-host-controller.patch deleted file mode 100644 index af76f13..0000000 @@ -15430,49 +16123,6 @@ index a62cfdf..0000000 - BRCMF_PCIE_DEVICE(BRCM_PCIE_4356_DEVICE_ID), - BRCMF_PCIE_DEVICE(BRCM_PCIE_43567_DEVICE_ID), - BRCMF_PCIE_DEVICE(BRCM_PCIE_43570_DEVICE_ID), -diff --git a/package/kernel/mac80211/patches/337-nl80211-put-current-TX-power-in-interface-info.patch b/package/kernel/mac80211/patches/337-nl80211-put-current-TX-power-in-interface-info.patch -new file mode 100644 -index 0000000..df2cc4b ---- /dev/null -+++ b/package/kernel/mac80211/patches/337-nl80211-put-current-TX-power-in-interface-info.patch -@@ -0,0 +1,37 @@ -+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -+Date: Mon, 31 Aug 2015 22:59:38 +0200 -+Subject: [PATCH] nl80211: put current TX power in interface info -+MIME-Version: 1.0 -+Content-Type: text/plain; charset=UTF-8 -+Content-Transfer-Encoding: 8bit -+ -+Many drivers implement reading current TX power (using either cfg80211 -+or ieee80211 op) but userspace can't get it using nl80211. Right now the -+only way to access it is to call some wext ioctl. -+Let's put TX power in interface info reply (callback is wdev specific) -+just like we do with current channel. -+To be consistent (e.g. NL80211_CMD_SET_WIPHY) let's use mBm as na unit. -+ -+Signed-off-by: Rafał Miłecki -+Signed-off-by: Johannes Berg -+--- -+ -+--- a/net/wireless/nl80211.c -++++ b/net/wireless/nl80211.c -+@@ -2406,6 +2406,16 @@ static int nl80211_send_iface(struct sk_ -+ } -+ } -+ -++ if (rdev->ops->get_tx_power) { -++ int dbm, ret; -++ -++ ret = rdev_get_tx_power(rdev, wdev, &dbm); -++ if (ret == 0 && -++ nla_put_u32(msg, NL80211_ATTR_WIPHY_TX_POWER_LEVEL, -++ DBM_TO_MBM(dbm))) -++ goto nla_put_failure; -++ } -++ -+ if (wdev->ssid_len) { -+ if (nla_put(msg, NL80211_ATTR_SSID, wdev->ssid_len, wdev->ssid)) -+ goto nla_put_failure; diff --git a/package/kernel/mac80211/patches/338-brcmfmac-disable-MBSS-feature-for-BCM43362.patch b/package/kernel/mac80211/patches/338-brcmfmac-disable-MBSS-feature-for-BCM43362.patch deleted file mode 100644 index 366ff85..0000000 @@ -15507,33 +16157,6 @@ index 366ff85..0000000 - - /* set chip related quirks */ - switch (drvr->bus_if->chip) { -diff --git a/package/kernel/mac80211/patches/338-mac80211-initialize-tid-field-in-struct-ieee80211_tx.patch b/package/kernel/mac80211/patches/338-mac80211-initialize-tid-field-in-struct-ieee80211_tx.patch -new file mode 100644 -index 0000000..2f492e0 ---- /dev/null -+++ b/package/kernel/mac80211/patches/338-mac80211-initialize-tid-field-in-struct-ieee80211_tx.patch -@@ -0,0 +1,21 @@ -+From: Felix Fietkau -+Date: Mon, 5 Oct 2015 17:41:25 +0200 -+Subject: [PATCH] mac80211: initialize tid field in struct ieee80211_txq -+ -+Signed-off-by: Felix Fietkau -+--- -+ -+--- a/net/mac80211/util.c -++++ b/net/mac80211/util.c -+@@ -3288,9 +3288,11 @@ void ieee80211_init_tx_queue(struct ieee -+ if (sta) { -+ txqi->txq.sta = &sta->sta; -+ sta->sta.txq[tid] = &txqi->txq; -++ txqi->txq.tid = tid; -+ txqi->txq.ac = ieee802_1d_to_ac[tid & 7]; -+ } else { -+ sdata->vif.txq = &txqi->txq; -++ txqi->txq.tid = 0; -+ txqi->txq.ac = IEEE80211_AC_BE; -+ } -+ } diff --git a/package/kernel/mac80211/patches/339-0001-brcmfmac-use-static-superset-of-channels-for-wiphy-b.patch b/package/kernel/mac80211/patches/339-0001-brcmfmac-use-static-superset-of-channels-for-wiphy-b.patch deleted file mode 100644 index 6e461f6..0000000 @@ -27670,39 +28293,59 @@ index 298f722..72e9a41 100644 /** Returns string describing opmode, or NULL if unknown mode. */ diff --git a/package/kernel/mac80211/patches/402-ath_regd_optional.patch b/package/kernel/mac80211/patches/402-ath_regd_optional.patch -index 2dac505..f918c18 100644 +index 2dac505..7351353 100644 --- a/package/kernel/mac80211/patches/402-ath_regd_optional.patch +++ b/package/kernel/mac80211/patches/402-ath_regd_optional.patch -@@ -59,7 +59,7 @@ +@@ -47,9 +47,9 @@ + + --- a/drivers/net/wireless/ath/Kconfig + +++ b/drivers/net/wireless/ath/Kconfig +-@@ -22,6 +22,9 @@ menuconfig ATH_CARDS ++@@ -23,6 +23,9 @@ config WLAN_VENDOR_ATH + +- if ATH_CARDS ++ if WLAN_VENDOR_ATH + + +config ATH_USER_REGD + + bool "Do not enforce EEPROM regulatory restrictions" +@@ -59,9 +59,9 @@ ---help--- --- a/.local-symbols +++ b/.local-symbols -@@ -89,6 +89,7 @@ RTL8187_LEDS= -+@@ -137,6 +137,7 @@ RTL8187_LEDS= ++@@ -125,6 +125,7 @@ ADM8211= ATH_COMMON= - ATH_CARDS= +- ATH_CARDS= ++ WLAN_VENDOR_ATH= ATH_DEBUG= + +ATH_USER_REGD= + ATH_TRACEPOINTS= diff --git a/package/kernel/mac80211/patches/404-regd_no_assoc_hints.patch b/package/kernel/mac80211/patches/404-regd_no_assoc_hints.patch -index 1476953..8b52ac3 100644 +index 1476953..1ef5545 100644 --- a/package/kernel/mac80211/patches/404-regd_no_assoc_hints.patch +++ b/package/kernel/mac80211/patches/404-regd_no_assoc_hints.patch @@ -1,6 +1,6 @@ --- a/net/wireless/reg.c +++ b/net/wireless/reg.c -@@ -2368,6 +2368,8 @@ void regulatory_hint_country_ie(struct w -+@@ -2390,6 +2390,8 @@ void regulatory_hint_country_ie(struct w ++@@ -2411,6 +2411,8 @@ void regulatory_hint_country_ie(struct w enum environment_cap env = ENVIRON_ANY; struct regulatory_request *request = NULL, *lr; -@@ -9,7 +9,7 @@ +@@ -9,11 +9,11 @@ /* IE len must be evenly divisible by 2 */ if (country_ie_len & 0x01) return; -@@ -2571,6 +2573,7 @@ static void restore_regulatory_settings( -+@@ -2596,6 +2598,7 @@ static void restore_regulatory_settings( ++@@ -2617,6 +2619,7 @@ static void restore_regulatory_settings( void regulatory_hint_disconnect(void) { + + return; +- REG_DBG_PRINT("All devices are disconnected, going to restore regulatory settings\n"); ++ pr_debug("All devices are disconnected, going to restore regulatory settings\n"); + restore_regulatory_settings(false); + } diff --git a/package/kernel/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch b/package/kernel/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch index 93760f9..1a62484 100644 --- a/package/kernel/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch @@ -27716,7 +28359,7 @@ index 93760f9..1a62484 100644 { .max = 1, .types = BIT(NL80211_IFTYPE_P2P_CLIENT) | BIT(NL80211_IFTYPE_P2P_GO) }, diff --git a/package/kernel/mac80211/patches/440-ath5k_channel_bw_debugfs.patch b/package/kernel/mac80211/patches/440-ath5k_channel_bw_debugfs.patch -index aa521d2..42d43a4 100644 +index aa521d2..924b62e 100644 --- a/package/kernel/mac80211/patches/440-ath5k_channel_bw_debugfs.patch +++ b/package/kernel/mac80211/patches/440-ath5k_channel_bw_debugfs.patch @@ -121,7 +121,7 @@ drivers/net/wireless/ath/ath5k/debug.c | 86 ++++++++++++++++++++++++++++++++ @@ -27724,22 +28367,10 @@ index aa521d2..42d43a4 100644 --- a/drivers/net/wireless/ath/ath5k/ath5k.h +++ b/drivers/net/wireless/ath/ath5k/ath5k.h -@@ -1371,6 +1371,7 @@ struct ath5k_hw { -+@@ -1370,6 +1370,7 @@ struct ath5k_hw { ++@@ -1372,6 +1372,7 @@ struct ath5k_hw { u8 ah_coverage_class; bool ah_ack_bitrate_high; u8 ah_bwmode; -diff --git a/package/kernel/mac80211/patches/501-ath9k_ahb_init.patch b/package/kernel/mac80211/patches/501-ath9k_ahb_init.patch -index 5892c3e..5a3e37c 100644 ---- a/package/kernel/mac80211/patches/501-ath9k_ahb_init.patch -+++ b/package/kernel/mac80211/patches/501-ath9k_ahb_init.patch -@@ -1,6 +1,6 @@ - --- a/drivers/net/wireless/ath/ath9k/init.c - +++ b/drivers/net/wireless/ath/ath9k/init.c --@@ -1024,23 +1024,23 @@ static int __init ath9k_init(void) -+@@ -1032,23 +1032,23 @@ static int __init ath9k_init(void) - { - int error; - diff --git a/package/kernel/mac80211/patches/510-ath9k_intr_mitigation_tweak.patch b/package/kernel/mac80211/patches/510-ath9k_intr_mitigation_tweak.patch index ed2cfee..d2a3b96 100644 --- a/package/kernel/mac80211/patches/510-ath9k_intr_mitigation_tweak.patch @@ -27785,51 +28416,79 @@ index 40b5c81..c84d1bc 100644 /* These are all the AR5008/AR9001/AR9002/AR9003 hardware family of chipsets */ switch (ah->hw_version.devid) { diff --git a/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch b/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch -index 0c50a0b..99bf7e8 100644 +index 0c50a0b..e151a12 100644 --- a/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch +++ b/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch +@@ -1,6 +1,6 @@ + --- a/include/net/cfg80211.h + +++ b/include/net/cfg80211.h +-@@ -2320,6 +2320,7 @@ struct cfg80211_qos_map { ++@@ -2363,6 +2363,7 @@ struct cfg80211_qos_map { + * (as advertised by the nl80211 feature flag.) + * @get_tx_power: store the current TX power into the dbm variable; + * return 0 if successful +@@ -8,7 +8,7 @@ + * + * @set_wds_peer: set the WDS peer for a WDS interface + * +-@@ -2576,6 +2577,7 @@ struct cfg80211_ops { ++@@ -2624,6 +2625,7 @@ struct cfg80211_ops { + enum nl80211_tx_power_setting type, int mbm); + int (*get_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev, + int *dbm); @@ -18,7 +18,7 @@ const u8 *addr); --- a/include/net/mac80211.h +++ b/include/net/mac80211.h -@@ -1171,6 +1171,7 @@ enum ieee80211_smps_mode { -+@@ -1252,6 +1252,7 @@ enum ieee80211_smps_mode { ++@@ -1286,6 +1286,7 @@ enum ieee80211_smps_mode { * * @power_level: requested transmit power (in dBm), backward compatibility * value only that is set to the minimum of all interfaces -@@ -26,7 +26,7 @@ +@@ -26,19 +26,19 @@ * * @chandef: the channel definition to tune to * @radar_enabled: whether radar detection is enabled -@@ -1192,6 +1193,7 @@ struct ieee80211_conf { -+@@ -1273,6 +1274,7 @@ struct ieee80211_conf { ++@@ -1306,6 +1307,7 @@ enum ieee80211_smps_mode { ++ struct ieee80211_conf { u32 flags; int power_level, dynamic_ps_timeout; - int max_sleep_period; -@@ -36,7 +36,7 @@ +- int max_sleep_period; + + int max_antenna_gain; + + u16 listen_interval; u8 ps_dtim_period; --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h -@@ -1760,6 +1760,9 @@ enum nl80211_commands { -+@@ -1761,6 +1761,9 @@ enum nl80211_commands { - * @NL80211_ATTR_REG_INDOOR: flag attribute, if set indicates that the device - * is operating in an indoor environment. +- * @NL80211_ATTR_REG_INDOOR: flag attribute, if set indicates that the device +- * is operating in an indoor environment. ++@@ -1790,6 +1790,9 @@ enum nl80211_commands { ++ * between scans. The scan plans are executed sequentially. ++ * Each scan plan is a nested attribute of &enum nl80211_sched_scan_plan. * -@@ -46,7 +46,7 @@ + + * @NL80211_ATTR_WIPHY_ANTENNA_GAIN: Configured antenna gain. Used to reduce + + * transmit power to stay within regulatory limits. u32, dBi. +@@ -46,9 +46,9 @@ * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use -@@ -2129,6 +2132,8 @@ enum nl80211_attrs { -+@@ -2130,6 +2133,8 @@ enum nl80211_attrs { - - NL80211_ATTR_REG_INDOOR, +- +- NL80211_ATTR_REG_INDOOR, ++@@ -2164,6 +2167,8 @@ enum nl80211_attrs { ++ NL80211_ATTR_MAX_SCAN_PLAN_ITERATIONS, ++ NL80211_ATTR_SCHED_SCAN_PLANS, + + NL80211_ATTR_WIPHY_ANTENNA_GAIN, + + @@ -57,7 +57,7 @@ __NL80211_ATTR_AFTER_LAST, --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -2208,6 +2208,19 @@ static int ieee80211_get_tx_power(struct -+@@ -2233,6 +2233,19 @@ static int ieee80211_get_tx_power(struct ++@@ -2229,6 +2229,19 @@ static int ieee80211_get_tx_power(struct return 0; } @@ -27838,7 +28497,7 @@ index 0c50a0b..99bf7e8 100644 const u8 *addr) { -@@ -3771,6 +3784,7 @@ const struct cfg80211_ops mac80211_confi -+@@ -3845,6 +3858,7 @@ const struct cfg80211_ops mac80211_confi ++@@ -3403,6 +3416,7 @@ const struct cfg80211_ops mac80211_confi .set_wiphy_params = ieee80211_set_wiphy_params, .set_tx_power = ieee80211_set_tx_power, .get_tx_power = ieee80211_get_tx_power, @@ -27856,7 +28515,7 @@ index 0c50a0b..99bf7e8 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c -@@ -98,7 +98,7 @@ static u32 ieee80211_hw_conf_chan(struct -+@@ -95,7 +95,7 @@ static u32 ieee80211_hw_conf_chan(struct ++@@ -93,7 +93,7 @@ static u32 ieee80211_hw_conf_chan(struct struct ieee80211_sub_if_data *sdata; struct cfg80211_chan_def chandef = {}; u32 changed = 0; @@ -27865,7 +28524,7 @@ index 0c50a0b..99bf7e8 100644 offchannel_flag = local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL; -@@ -155,6 +155,12 @@ static u32 ieee80211_hw_conf_chan(struct -+@@ -152,6 +152,12 @@ static u32 ieee80211_hw_conf_chan(struct ++@@ -150,6 +150,12 @@ static u32 ieee80211_hw_conf_chan(struct } rcu_read_unlock(); @@ -27874,7 +28533,7 @@ index 0c50a0b..99bf7e8 100644 changed |= IEEE80211_CONF_CHANGE_POWER; local->hw.conf.power_level = power; -@@ -578,6 +584,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_ -+@@ -581,6 +587,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_ ++@@ -586,6 +592,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_ IEEE80211_RADIOTAP_MCS_HAVE_BW; local->hw.radiotap_vht_details = IEEE80211_RADIOTAP_VHT_KNOWN_GI | IEEE80211_RADIOTAP_VHT_KNOWN_BANDWIDTH; @@ -27883,7 +28542,7 @@ index 0c50a0b..99bf7e8 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c -@@ -400,6 +400,7 @@ static const struct nla_policy nl80211_p -+@@ -402,6 +402,7 @@ static const struct nla_policy nl80211_p ++@@ -403,6 +403,7 @@ static const struct nla_policy nl80211_p [NL80211_ATTR_NETNS_FD] = { .type = NLA_U32 }, [NL80211_ATTR_SCHED_SCAN_DELAY] = { .type = NLA_U32 }, [NL80211_ATTR_REG_INDOOR] = { .type = NLA_FLAG }, @@ -27892,51 +28551,93 @@ index 0c50a0b..99bf7e8 100644 /* policy for the key attributes */ -@@ -2206,6 +2207,20 @@ static int nl80211_set_wiphy(struct sk_b -+@@ -2207,6 +2208,20 @@ static int nl80211_set_wiphy(struct sk_b ++@@ -2220,6 +2221,20 @@ static int nl80211_set_wiphy(struct sk_b if (result) return result; } diff --git a/package/kernel/mac80211/patches/530-ath9k_extra_leds.patch b/package/kernel/mac80211/patches/530-ath9k_extra_leds.patch -index 7512811..3cfffa0 100644 +index 7512811..5a5e464 100644 --- a/package/kernel/mac80211/patches/530-ath9k_extra_leds.patch +++ b/package/kernel/mac80211/patches/530-ath9k_extra_leds.patch -@@ -1,6 +1,6 @@ - --- a/drivers/net/wireless/ath/ath9k/ath9k.h - +++ b/drivers/net/wireless/ath/ath9k/ath9k.h --@@ -814,6 +814,9 @@ static inline int ath9k_dump_btcoex(stru -+@@ -806,6 +806,9 @@ static inline int ath9k_dump_btcoex(stru - void ath_init_leds(struct ath_softc *sc); - void ath_deinit_leds(struct ath_softc *sc); - void ath_fill_led_pin(struct ath_softc *sc); -@@ -10,7 +10,7 @@ - #else - static inline void ath_init_leds(struct ath_softc *sc) - { --@@ -953,6 +956,13 @@ void ath_ant_comb_scan(struct ath_softc -+@@ -945,6 +948,13 @@ void ath_ant_comb_scan(struct ath_softc - - #define ATH9K_NUM_CHANCTX 2 /* supports 2 operating channels */ - @@ -24,7 +24,7 @@ struct ath_softc { struct ieee80211_hw *hw; struct device *dev; -@@ -1004,9 +1014,8 @@ struct ath_softc { -+@@ -996,9 +1006,8 @@ struct ath_softc { ++@@ -1005,9 +1015,8 @@ struct ath_softc { spinlock_t chan_lock; #ifdef CPTCFG_MAC80211_LEDS -@@ -165,7 +165,7 @@ - void ath_fill_led_pin(struct ath_softc *sc) - --- a/drivers/net/wireless/ath/ath9k/init.c - +++ b/drivers/net/wireless/ath/ath9k/init.c --@@ -936,7 +936,7 @@ int ath9k_init_device(u16 devid, struct -+@@ -944,7 +944,7 @@ int ath9k_init_device(u16 devid, struct +@@ -54,7 +54,8 @@ + + (brightness != LED_OFF) ^ led->gpio->active_low); + + ath9k_ps_restore(sc); + +} +-+ ++ ++- ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, val); + +static int ath_add_led(struct ath_softc *sc, struct ath_led *led) + +{ + + const struct gpio_led *gpio = led->gpio; +@@ -63,8 +64,7 @@ + + led->cdev.name = gpio->name; + + led->cdev.default_trigger = gpio->default_trigger; + + led->cdev.brightness_set = ath_led_brightness; +- +-- ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, val); +++ + + ret = led_classdev_register(wiphy_dev(sc->hw->wiphy), &led->cdev); + + if (ret < 0) + + return ret; +@@ -159,7 +159,7 @@ + + trigger = ieee80211_get_radio_led_name(sc->hw); - #ifdef CPTCFG_MAC80211_LEDS - /* must be initialized before ieee80211_register_hw */ + - sc->led_registered = true; +-+ ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger, 1); +++ ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger, !sc->sc_ah->config.led_active_high); + } + + void ath_fill_led_pin(struct ath_softc *sc) +diff --git a/package/kernel/mac80211/patches/531-ath9k_extra_platform_leds.patch b/package/kernel/mac80211/patches/531-ath9k_extra_platform_leds.patch +index dc33cd0..7c10ea6 100644 +--- a/package/kernel/mac80211/patches/531-ath9k_extra_platform_leds.patch ++++ b/package/kernel/mac80211/patches/531-ath9k_extra_platform_leds.patch +@@ -59,7 +59,7 @@ + @@ -120,6 +141,12 @@ void ath_init_leds(struct ath_softc *sc) + trigger = ieee80211_get_radio_led_name(sc->hw); + +- ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger, 1); ++ ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger, !sc->sc_ah->config.led_active_high); + + + + if (!pdata) + + return; +diff --git a/package/kernel/mac80211/patches/532-ath9k_get_led_polarity_from_platform_data.patch b/package/kernel/mac80211/patches/532-ath9k_get_led_polarity_from_platform_data.patch +new file mode 100644 +index 0000000..6d62a2b +--- /dev/null ++++ b/package/kernel/mac80211/patches/532-ath9k_get_led_polarity_from_platform_data.patch +@@ -0,0 +1,20 @@ ++--- a/include/linux/ath9k_platform.h +++++ b/include/linux/ath9k_platform.h ++@@ -36,6 +36,7 @@ struct ath9k_platform_data { ++ bool tx_gain_buffalo; ++ bool disable_2ghz; ++ bool disable_5ghz; +++ bool led_active_high; ++ ++ int (*get_mac_revision)(void); ++ int (*external_reset)(void); ++--- a/drivers/net/wireless/ath/ath9k/init.c +++++ b/drivers/net/wireless/ath/ath9k/init.c ++@@ -577,6 +577,7 @@ static int ath9k_init_softc(u16 devid, s ++ ah->external_reset = pdata->external_reset; ++ ah->disable_2ghz = pdata->disable_2ghz; ++ ah->disable_5ghz = pdata->disable_5ghz; +++ ah->config.led_active_high = pdata->led_active_high; ++ if (!pdata->endian_check) ++ ah->ah_flags |= AH_NO_EEP_SWAP; ++ } diff --git a/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch b/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch -index 08c5a0f..2b2c763 100644 +index 08c5a0f..e83c6bf 100644 --- a/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch +++ b/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch @@ -62,7 +62,7 @@ @@ -27971,7 +28672,7 @@ index 08c5a0f..2b2c763 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -1804,6 +1804,20 @@ u32 ath9k_hw_get_tsf_offset(struct times -+@@ -1808,6 +1808,20 @@ u32 ath9k_hw_get_tsf_offset(struct times ++@@ -1819,6 +1819,20 @@ u32 ath9k_hw_get_tsf_offset(struct times } EXPORT_SYMBOL(ath9k_hw_get_tsf_offset); @@ -27980,12 +28681,12 @@ index 08c5a0f..2b2c763 100644 struct ath9k_hw_cal_data *caldata, bool fastcc) { -@@ -2012,6 +2026,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st -+@@ -2016,6 +2030,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st ++@@ -2027,6 +2041,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st ar9003_hw_disable_phy_restart(ah); ath9k_hw_apply_gpio_override(ah); diff --git a/package/kernel/mac80211/patches/543-ath9k_entropy_from_adc.patch b/package/kernel/mac80211/patches/543-ath9k_entropy_from_adc.patch -index 8c9b34c..fddaf56 100644 +index 8c9b34c..d7bb5a1 100644 --- a/package/kernel/mac80211/patches/543-ath9k_entropy_from_adc.patch +++ b/package/kernel/mac80211/patches/543-ath9k_entropy_from_adc.patch @@ -1,6 +1,6 @@ @@ -28005,12 +28706,30 @@ index 8c9b34c..fddaf56 100644 struct ath_hw_antcomb_conf *antconf); void (*antdiv_comb_conf_set)(struct ath_hw *ah, struct ath_hw_antcomb_conf *antconf); +@@ -18,7 +18,7 @@ + void (*spectral_scan_trigger)(struct ath_hw *ah); + --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c + +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c +-@@ -1999,6 +1999,26 @@ void ar9003_hw_init_rate_txpower(struct ++@@ -1998,6 +1998,26 @@ void ar9003_hw_init_rate_txpower(struct + } + } + +@@ -45,7 +45,7 @@ + void ar9003_hw_attach_phy_ops(struct ath_hw *ah) + { + struct ath_hw_private_ops *priv_ops = ath9k_hw_private_ops(ah); +-@@ -2035,6 +2055,7 @@ void ar9003_hw_attach_phy_ops(struct ath ++@@ -2034,6 +2054,7 @@ void ar9003_hw_attach_phy_ops(struct ath + priv_ops->set_radar_params = ar9003_hw_set_radar_params; + priv_ops->fast_chan_change = ar9003_hw_fast_chan_change; + @@ -55,7 +55,7 @@ ops->spectral_scan_config = ar9003_hw_spectral_scan_config; --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c -@@ -703,7 +703,8 @@ static void ath9k_init_txpower_limits(st -+@@ -710,7 +710,8 @@ static void ath9k_init_txpower_limits(st ++@@ -711,7 +711,8 @@ static void ath9k_init_txpower_limits(st if (ah->caps.hw_caps & ATH9K_HW_CAP_5GHZ) ath9k_init_band_txpower(sc, IEEE80211_BAND_5GHZ); @@ -28019,7 +28738,7 @@ index 8c9b34c..fddaf56 100644 static const struct ieee80211_iface_limit if_limits[] = { -@@ -896,6 +897,18 @@ static void ath9k_set_hw_capab(struct at -+@@ -904,6 +905,18 @@ static void ath9k_set_hw_capab(struct at ++@@ -897,6 +898,18 @@ static void ath9k_set_hw_capab(struct at SET_IEEE80211_PERM_ADDR(hw, common->macaddr); } @@ -28028,7 +28747,7 @@ index 8c9b34c..fddaf56 100644 const struct ath_bus_ops *bus_ops) { -@@ -941,6 +954,8 @@ int ath9k_init_device(u16 devid, struct -+@@ -949,6 +962,8 @@ int ath9k_init_device(u16 devid, struct ++@@ -942,6 +955,8 @@ int ath9k_init_device(u16 devid, struct ARRAY_SIZE(ath9k_tpt_blink)); #endif @@ -28051,7 +28770,7 @@ index 8c9b34c..fddaf56 100644 return ret; diff --git a/package/kernel/mac80211/patches/544-ath9k-ar933x-usb-hang-workaround.patch b/package/kernel/mac80211/patches/544-ath9k-ar933x-usb-hang-workaround.patch -index 240b898..6ca642a 100644 +index 240b898..8768c5d 100644 --- a/package/kernel/mac80211/patches/544-ath9k-ar933x-usb-hang-workaround.patch +++ b/package/kernel/mac80211/patches/544-ath9k-ar933x-usb-hang-workaround.patch @@ -1,6 +1,6 @@ @@ -28067,7 +28786,7 @@ index 240b898..6ca642a 100644 /* Chip Revisions */ /******************/ -@@ -1382,6 +1395,9 @@ static bool ath9k_hw_set_reset(struct at -+@@ -1386,6 +1399,9 @@ static bool ath9k_hw_set_reset(struct at ++@@ -1397,6 +1410,9 @@ static bool ath9k_hw_set_reset(struct at if (AR_SREV_9100(ah)) udelay(50); @@ -28076,7 +28795,7 @@ index 240b898..6ca642a 100644 } -@@ -1481,6 +1497,9 @@ static bool ath9k_hw_chip_reset(struct a -+@@ -1485,6 +1501,9 @@ static bool ath9k_hw_chip_reset(struct a ++@@ -1496,6 +1512,9 @@ static bool ath9k_hw_chip_reset(struct a ar9003_hw_internal_regulator_apply(ah); ath9k_hw_init_pll(ah, chan); @@ -28085,7 +28804,7 @@ index 240b898..6ca642a 100644 } -@@ -1782,8 +1801,14 @@ static int ath9k_hw_do_fastcc(struct ath -+@@ -1786,8 +1805,14 @@ static int ath9k_hw_do_fastcc(struct ath ++@@ -1797,8 +1816,14 @@ static int ath9k_hw_do_fastcc(struct ath if (AR_SREV_9271(ah)) ar9002_hw_load_ani_reg(ah, chan); @@ -28094,12 +28813,12 @@ index 240b898..6ca642a 100644 } -@@ -2037,6 +2062,9 @@ int ath9k_hw_reset(struct ath_hw *ah, st -+@@ -2041,6 +2066,9 @@ int ath9k_hw_reset(struct ath_hw *ah, st ++@@ -2052,6 +2077,9 @@ int ath9k_hw_reset(struct ath_hw *ah, st ath9k_hw_set_radar_params(ah); } diff --git a/package/kernel/mac80211/patches/545-ath9k_ani_ws_detect.patch b/package/kernel/mac80211/patches/545-ath9k_ani_ws_detect.patch -index 9610372..bc0aca6 100644 +index 9610372..3d24ccd 100644 --- a/package/kernel/mac80211/patches/545-ath9k_ani_ws_detect.patch +++ b/package/kernel/mac80211/patches/545-ath9k_ani_ws_detect.patch @@ -1,6 +1,6 @@ @@ -28110,12 +28829,36 @@ index 9610372..bc0aca6 100644 * on == 0 means more noise imm */ u32 on = param ? 1 : 0; +@@ -79,7 +79,7 @@ + static const u8 ofdm2pwr[] = { + ALL_TARGET_LEGACY_6_24, + ALL_TARGET_LEGACY_6_24, +-@@ -1090,11 +1076,6 @@ static bool ar9003_hw_ani_control(struct ++@@ -1089,11 +1075,6 @@ static bool ar9003_hw_ani_control(struct + struct ath_common *common = ath9k_hw_common(ah); + struct ath9k_channel *chan = ah->curchan; + struct ar5416AniState *aniState = &ah->ani; +@@ -91,7 +91,7 @@ + s32 value, value2; + + switch (cmd & ah->ani_function) { +-@@ -1108,61 +1089,6 @@ static bool ar9003_hw_ani_control(struct ++@@ -1107,61 +1088,6 @@ static bool ar9003_hw_ani_control(struct + */ + u32 on = param ? 1 : 0; + diff --git a/package/kernel/mac80211/patches/600-0001-rt2x00-rt2800lib-move-rt2800_drv_data-declaration-in.patch b/package/kernel/mac80211/patches/600-0001-rt2x00-rt2800lib-move-rt2800_drv_data-declaration-in.patch -index c0dc4fe..15863a6 100644 +index c0dc4fe..bd81555 100644 --- a/package/kernel/mac80211/patches/600-0001-rt2x00-rt2800lib-move-rt2800_drv_data-declaration-in.patch +++ b/package/kernel/mac80211/patches/600-0001-rt2x00-rt2800lib-move-rt2800_drv_data-declaration-in.patch -@@ -20,32 +20,14 @@ Changes since v1: --- - drivers/net/wireless/rt2x00/rt2800lib.h | 11 +++++++++++ +@@ -16,36 +16,18 @@ Signed-off-by: Gabor Juhos + --- + Changes since v1: --- + --- +- drivers/net/wireless/rt2x00/rt2800.h | 13 ------------- +- drivers/net/wireless/rt2x00/rt2800lib.h | 11 +++++++++++ ++ drivers/net/wireless/ralink/rt2x00/rt2800.h | 13 ------------- ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.h | 11 +++++++++++ 2 files changed, 11 insertions(+), 13 deletions(-) ---- a/drivers/net/wireless/rt2x00/rt2800.h @@ -28138,9 +28881,11 @@ index c0dc4fe..15863a6 100644 --}; -- - #endif /* RT2800_H */ - --- a/drivers/net/wireless/rt2x00/rt2800lib.h - +++ b/drivers/net/wireless/rt2x00/rt2800lib.h +---- a/drivers/net/wireless/rt2x00/rt2800lib.h +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.h -@@ -20,6 +20,17 @@ ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h +@@ -20,6 +20,20 @@ #ifndef RT2800LIB_H #define RT2800LIB_H @@ -28160,8 +28905,8 @@ index c0dc4fe..15863a6 100644 struct rt2800_ops { void (*register_read)(struct rt2x00_dev *rt2x00dev, const unsigned int offset, u32 *value); -+--- a/drivers/net/wireless/rt2x00/rt2800.h -++++ b/drivers/net/wireless/rt2x00/rt2800.h ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800.h +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800.h +@@ -2969,18 +2969,4 @@ enum rt2800_eeprom_word { + #define WCID_END 222 + #define STA_IDS_SIZE (WCID_END - WCID_START + 2) @@ -28182,15 +28927,25 @@ index c0dc4fe..15863a6 100644 +- + #endif /* RT2800_H */ diff --git a/package/kernel/mac80211/patches/600-0002-rt2x00-rt2800lib-introduce-RT2800_HAS_HIGH_SHARED_ME.patch b/package/kernel/mac80211/patches/600-0002-rt2x00-rt2800lib-introduce-RT2800_HAS_HIGH_SHARED_ME.patch -index 6bad6ac..9165eec 100644 +index 6bad6ac..8245909 100644 --- a/package/kernel/mac80211/patches/600-0002-rt2x00-rt2800lib-introduce-RT2800_HAS_HIGH_SHARED_ME.patch +++ b/package/kernel/mac80211/patches/600-0002-rt2x00-rt2800lib-introduce-RT2800_HAS_HIGH_SHARED_ME.patch -@@ -24,7 +24,7 @@ Changes since v1: +@@ -18,13 +18,13 @@ Signed-off-by: Gabor Juhos + Changes since v1: + - don't enable the new flag for RT3071 and RT5592 + --- +- drivers/net/wireless/rt2x00/rt2800lib.c | 4 ++++ +- drivers/net/wireless/rt2x00/rt2800lib.h | 13 +++++++++++++ ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 4 ++++ ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.h | 13 +++++++++++++ + 2 files changed, 17 insertions(+) - --- a/drivers/net/wireless/rt2x00/rt2800lib.c - +++ b/drivers/net/wireless/rt2x00/rt2800lib.c +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c -@@ -7747,6 +7747,7 @@ static int rt2800_probe_rt(struct rt2x00 -+@@ -7721,6 +7721,7 @@ static int rt2800_probe_rt(struct rt2x00 ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++@@ -7722,6 +7722,7 @@ static int rt2800_probe_rt(struct rt2x00 int rt2800_probe_hw(struct rt2x00_dev *rt2x00dev) { @@ -28199,17 +28954,21 @@ index 6bad6ac..9165eec 100644 u32 reg; -@@ -7754,6 +7755,9 @@ int rt2800_probe_hw(struct rt2x00_dev *r -+@@ -7728,6 +7729,9 @@ int rt2800_probe_hw(struct rt2x00_dev *r ++@@ -7729,6 +7730,9 @@ int rt2800_probe_hw(struct rt2x00_dev *r if (retval) return retval; -@@ -44,9 +44,9 @@ Changes since v1: +@@ -42,11 +42,11 @@ Changes since v1: + /* + * Allocate eeprom data. */ - --- a/drivers/net/wireless/rt2x00/rt2800lib.h - +++ b/drivers/net/wireless/rt2x00/rt2800lib.h +---- a/drivers/net/wireless/rt2x00/rt2800lib.h +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.h -@@ -20,6 +20,10 @@ - #ifndef RT2800LIB_H - #define RT2800LIB_H ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h +@@ -22,6 +22,10 @@ + + #include "rt2800.h" @@ -28237,9 +28996,36 @@ index 6bad6ac..9165eec 100644 }; diff --git a/package/kernel/mac80211/patches/600-0003-rt2x00-rt2800-serialize-shared-memory-access.patch b/package/kernel/mac80211/patches/600-0003-rt2x00-rt2800-serialize-shared-memory-access.patch -index 9f8dfcc..5671515 100644 +index 9f8dfcc..7abfcd1 100644 --- a/package/kernel/mac80211/patches/600-0003-rt2x00-rt2800-serialize-shared-memory-access.patch +++ b/package/kernel/mac80211/patches/600-0003-rt2x00-rt2800-serialize-shared-memory-access.patch +@@ -17,17 +17,17 @@ Signed-off-by: Gabor Juhos + --- + Changes since v1: --- + --- +- drivers/net/wireless/rt2x00/rt2800lib.c | 55 +++++++++++++++++++++++++++++- +- drivers/net/wireless/rt2x00/rt2800lib.h | 32 +++++++++++++++++ +- drivers/net/wireless/rt2x00/rt2800mmio.c | 26 ++++++++++++++ +- drivers/net/wireless/rt2x00/rt2800mmio.h | 4 +++ +- drivers/net/wireless/rt2x00/rt2800pci.c | 14 ++++++++ +- drivers/net/wireless/rt2x00/rt2800soc.c | 3 ++ +- drivers/net/wireless/rt2x00/rt2800usb.c | 31 +++++++++++++++++ ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 55 +++++++++++++++++++++++++++++- ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.h | 32 +++++++++++++++++ ++ drivers/net/wireless/ralink/rt2x00/rt2800mmio.c | 26 ++++++++++++++ ++ drivers/net/wireless/ralink/rt2x00/rt2800mmio.h | 4 +++ ++ drivers/net/wireless/ralink/rt2x00/rt2800pci.c | 14 ++++++++ ++ drivers/net/wireless/ralink/rt2x00/rt2800soc.c | 3 ++ ++ drivers/net/wireless/ralink/rt2x00/rt2800usb.c | 31 +++++++++++++++++ + 7 files changed, 164 insertions(+), 1 deletion(-) + +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c + @@ -451,11 +451,13 @@ void rt2800_mcu_request(struct rt2x00_de + rt2x00_set_field32(®, H2M_MAILBOX_CSR_CMD_TOKEN, token); + rt2x00_set_field32(®, H2M_MAILBOX_CSR_ARG0, arg0); @@ -175,7 +175,7 @@ Changes since v1: --- /* @@ -28254,7 +29040,7 @@ index 9f8dfcc..5671515 100644 /* -@@ -4908,14 +4941,19 @@ static int rt2800_init_registers(struct -+@@ -4884,14 +4917,19 @@ static int rt2800_init_registers(struct ++@@ -4885,14 +4918,19 @@ static int rt2800_init_registers(struct /* * ASIC will keep garbage value after boot, clear encryption keys. */ @@ -28263,7 +29049,7 @@ index 9f8dfcc..5671515 100644 /* -@@ -5041,8 +5079,10 @@ static int rt2800_wait_bbp_ready(struct -+@@ -5017,8 +5055,10 @@ static int rt2800_wait_bbp_ready(struct ++@@ -5018,8 +5056,10 @@ static int rt2800_wait_bbp_ready(struct * BBP was enabled after firmware was loaded, * but we need to reactivate it now. */ @@ -28272,7 +29058,7 @@ index 9f8dfcc..5671515 100644 for (i = 0; i < REGISTER_BUSY_COUNT; i++) { -@@ -6738,11 +6778,19 @@ int rt2800_enable_radio(struct rt2x00_de -+@@ -6714,11 +6754,19 @@ int rt2800_enable_radio(struct rt2x00_de ++@@ -6715,11 +6755,19 @@ int rt2800_enable_radio(struct rt2x00_de /* * Send signal during boot time to initialize firmware. */ @@ -28281,7 +29067,7 @@ index 9f8dfcc..5671515 100644 /* -@@ -7751,6 +7799,8 @@ int rt2800_probe_hw(struct rt2x00_dev *r -+@@ -7725,6 +7773,8 @@ int rt2800_probe_hw(struct rt2x00_dev *r ++@@ -7726,6 +7774,8 @@ int rt2800_probe_hw(struct rt2x00_dev *r int retval; u32 reg; @@ -28291,7 +29077,7 @@ index 9f8dfcc..5671515 100644 return retval; -@@ -7830,8 +7880,11 @@ void rt2800_get_tkip_seq(struct ieee8021 - u32 offset; -+@@ -7808,8 +7858,11 @@ void rt2800_get_key_seq(struct ieee80211 ++@@ -7809,8 +7859,11 @@ void rt2800_get_key_seq(struct ieee80211 + return; - offset = MAC_IVEIV_ENTRY(hw_key_idx); @@ -28304,12 +29090,14 @@ index 9f8dfcc..5671515 100644 - memcpy(iv16, &iveiv_entry.iv[0], sizeof(*iv16)); - memcpy(iv32, &iveiv_entry.iv[4], sizeof(*iv32)); -+ memcpy(&seq->tkip.iv16, &iveiv_entry.iv[0], 2); -+ memcpy(&seq->tkip.iv32, &iveiv_entry.iv[4], 4); - --- a/drivers/net/wireless/rt2x00/rt2800lib.h - +++ b/drivers/net/wireless/rt2x00/rt2800lib.h +---- a/drivers/net/wireless/rt2x00/rt2800lib.h +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.h -@@ -35,6 +35,11 @@ struct rt2800_drv_data { - unsigned int tbtt_tick; ++ memcpy(&seq->tkip.iv16, &iveiv_entry.iv[0], 2); ++ memcpy(&seq->tkip.iv32, &iveiv_entry.iv[4], 4); ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h +@@ -38,6 +38,11 @@ struct rt2800_drv_data { + DECLARE_BITMAP(sta_ids, STA_IDS_SIZE); @@ -28333,6 +29121,61 @@ index 9f8dfcc..5671515 100644 return test_bit(RT2800_HAS_HIGH_SHARED_MEM, &drv_data->rt2800_flags); } +@@ -315,8 +315,8 @@ Changes since v1: --- + static inline void rt2800_register_read(struct rt2x00_dev *rt2x00dev, + const unsigned int offset, + u32 *value) +---- a/drivers/net/wireless/rt2x00/rt2800mmio.c +-+++ b/drivers/net/wireless/rt2x00/rt2800mmio.c ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c + @@ -820,8 +820,10 @@ int rt2800mmio_init_registers(struct rt2 + rt2x00_set_field32(®, WPDMA_RST_IDX_DRX_IDX0, 1); + rt2x00mmio_register_write(rt2x00dev, WPDMA_RST_IDX, reg); +@@ -359,8 +359,8 @@ Changes since v1: --- + MODULE_AUTHOR(DRV_PROJECT); + MODULE_VERSION(DRV_VERSION); + MODULE_DESCRIPTION("rt2800 MMIO library"); +---- a/drivers/net/wireless/rt2x00/rt2800mmio.h +-+++ b/drivers/net/wireless/rt2x00/rt2800mmio.h ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800mmio.h +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800mmio.h + @@ -160,4 +160,8 @@ int rt2800mmio_init_registers(struct rt2 + /* Device state switch handlers. */ + int rt2800mmio_enable_radio(struct rt2x00_dev *rt2x00dev); +@@ -370,8 +370,8 @@ Changes since v1: --- + +void rt2800mmio_shmem_unlock(struct rt2x00_dev *rt2x00dev); + + + #endif /* RT2800MMIO_H */ +---- a/drivers/net/wireless/rt2x00/rt2800pci.c +-+++ b/drivers/net/wireless/rt2x00/rt2800pci.c ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800pci.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800pci.c + @@ -69,7 +69,9 @@ static void rt2800pci_mcu_status(struct + return; + +@@ -444,8 +444,8 @@ Changes since v1: --- + }; + + static const struct rt2x00lib_ops rt2800pci_rt2x00_ops = { +---- a/drivers/net/wireless/rt2x00/rt2800soc.c +-+++ b/drivers/net/wireless/rt2x00/rt2800soc.c ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800soc.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800soc.c + @@ -176,6 +176,9 @@ static const struct rt2800_ops rt2800soc + .drv_write_firmware = rt2800soc_write_firmware, + .drv_init_registers = rt2800mmio_init_registers, +@@ -456,8 +456,8 @@ Changes since v1: --- + }; + + static const struct rt2x00lib_ops rt2800soc_rt2x00_ops = { +---- a/drivers/net/wireless/rt2x00/rt2800usb.c +-+++ b/drivers/net/wireless/rt2x00/rt2800usb.c ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800usb.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800usb.c + @@ -51,6 +51,27 @@ static bool rt2800usb_hwcrypt_disabled(s + return modparam_nohwcrypt; + } @@ -486,7 +486,7 @@ Changes since v1: --- /* * Queue handlers. @@ -28369,16 +29212,58 @@ index 9f8dfcc..5671515 100644 .drv_write_firmware = rt2800usb_write_firmware, .drv_init_registers = rt2800usb_init_registers, .drv_get_txwi = rt2800usb_get_txwi, +diff --git a/package/kernel/mac80211/patches/600-0004-rt2x00-rt2800lib-fix-beacon-generation-on-RT3593.patch b/package/kernel/mac80211/patches/600-0004-rt2x00-rt2800lib-fix-beacon-generation-on-RT3593.patch +index b8c1914..985a3b9 100644 +--- a/package/kernel/mac80211/patches/600-0004-rt2x00-rt2800lib-fix-beacon-generation-on-RT3593.patch ++++ b/package/kernel/mac80211/patches/600-0004-rt2x00-rt2800lib-fix-beacon-generation-on-RT3593.patch +@@ -23,12 +23,12 @@ Signed-off-by: Gabor Juhos + --- + Changes since v1: --- + --- +- drivers/net/wireless/rt2x00/rt2800.h | 3 +++ +- drivers/net/wireless/rt2x00/rt2800lib.c | 44 +++++++++++++++++++++++++++++++ ++ drivers/net/wireless/ralink/rt2x00/rt2800.h | 3 +++ ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 44 +++++++++++++++++++++++++++++++ + 2 files changed, 47 insertions(+) + +---- a/drivers/net/wireless/rt2x00/rt2800.h +-+++ b/drivers/net/wireless/rt2x00/rt2800.h ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800.h +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800.h + @@ -574,6 +574,7 @@ + #define PBF_SYS_CTRL 0x0400 + #define PBF_SYS_CTRL_READY FIELD32(0x00000080) +@@ -46,8 +46,8 @@ Changes since v1: --- + #define BEACON_BASE_TO_OFFSET(_base) (((_base) - 0x4000) / 64) + + /* +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c + @@ -82,6 +82,39 @@ static inline bool rt2800_is_305x_soc(st + return false; + } diff --git a/package/kernel/mac80211/patches/600-0005-rt2x00-rt2800lib-add-hw_beacon_count-field-to-struct.patch b/package/kernel/mac80211/patches/600-0005-rt2x00-rt2800lib-add-hw_beacon_count-field-to-struct.patch -index e7eb630..d04998a 100644 +index e7eb630..02b2acf 100644 --- a/package/kernel/mac80211/patches/600-0005-rt2x00-rt2800lib-add-hw_beacon_count-field-to-struct.patch +++ b/package/kernel/mac80211/patches/600-0005-rt2x00-rt2800lib-add-hw_beacon_count-field-to-struct.patch -@@ -24,7 +24,7 @@ Signed-off-by: Gabor Juhos +@@ -18,13 +18,13 @@ new field with the actually used value. - --- a/drivers/net/wireless/rt2x00/rt2800lib.c - +++ b/drivers/net/wireless/rt2x00/rt2800lib.c + Signed-off-by: Gabor Juhos + --- +- drivers/net/wireless/rt2x00/rt2800lib.c | 5 ++++- +- drivers/net/wireless/rt2x00/rt2800lib.h | 1 + ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 5 ++++- ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.h | 1 + + 2 files changed, 5 insertions(+), 1 deletion(-) + +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c -@@ -4638,6 +4638,7 @@ EXPORT_SYMBOL_GPL(rt2800_link_tuner); -+@@ -4614,6 +4614,7 @@ EXPORT_SYMBOL_GPL(rt2800_link_tuner); ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++@@ -4615,6 +4615,7 @@ EXPORT_SYMBOL_GPL(rt2800_link_tuner); */ static int rt2800_init_registers(struct rt2x00_dev *rt2x00dev) { @@ -28387,7 +29272,7 @@ index e7eb630..d04998a 100644 u16 eeprom; unsigned int i; -@@ -5003,7 +5004,7 @@ static int rt2800_init_registers(struct -+@@ -4979,7 +4980,7 @@ static int rt2800_init_registers(struct ++@@ -4980,7 +4981,7 @@ static int rt2800_init_registers(struct /* * Clear all beacons */ @@ -28396,15 +29281,19 @@ index e7eb630..d04998a 100644 if (rt2x00_is_usb(rt2x00dev)) { -@@ -7852,6 +7853,8 @@ int rt2800_probe_hw(struct rt2x00_dev *r -+@@ -7826,6 +7827,8 @@ int rt2800_probe_hw(struct rt2x00_dev *r ++@@ -7827,6 +7828,8 @@ int rt2800_probe_hw(struct rt2x00_dev *r if (rt2x00_rt(rt2x00dev, RT3593)) __set_bit(RT2800_HAS_HIGH_SHARED_MEM, &drv_data->rt2800_flags); -@@ -52,11 +52,11 @@ Signed-off-by: Gabor Juhos +@@ -50,13 +50,13 @@ Signed-off-by: Gabor Juhos + /* + * Allocate eeprom data. */ - --- a/drivers/net/wireless/rt2x00/rt2800lib.h - +++ b/drivers/net/wireless/rt2x00/rt2800lib.h +---- a/drivers/net/wireless/rt2x00/rt2800lib.h +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.h -@@ -33,6 +33,7 @@ struct rt2800_drv_data { ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h +@@ -35,6 +35,7 @@ struct rt2800_drv_data { u8 txmixer_gain_24g; u8 txmixer_gain_5g; @@ -28415,54 +29304,131 @@ index e7eb630..d04998a 100644 unsigned long rt2800_flags; - diff --git a/package/kernel/mac80211/patches/600-0006-rt2x00-rt2800lib-init-additional-beacon-offset-regis.patch b/package/kernel/mac80211/patches/600-0006-rt2x00-rt2800lib-init-additional-beacon-offset-regis.patch -index b79b4be..f5231f0 100644 +index b79b4be..4e735d3 100644 --- a/package/kernel/mac80211/patches/600-0006-rt2x00-rt2800lib-init-additional-beacon-offset-regis.patch +++ b/package/kernel/mac80211/patches/600-0006-rt2x00-rt2800lib-init-additional-beacon-offset-regis.patch -@@ -34,7 +34,7 @@ Signed-off-by: Gabor Juhos +@@ -5,12 +5,12 @@ Subject: [PATCH] rt2x00: rt2800lib: init additional beacon offset registers + + Signed-off-by: Gabor Juhos + --- +- drivers/net/wireless/rt2x00/rt2800.h | 14 ++++++++++++++ +- drivers/net/wireless/rt2x00/rt2800lib.c | 24 ++++++++++++++++++++++++ ++ drivers/net/wireless/ralink/rt2x00/rt2800.h | 14 ++++++++++++++ ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 24 ++++++++++++++++++++++++ + 2 files changed, 38 insertions(+) + +---- a/drivers/net/wireless/rt2x00/rt2800.h +-+++ b/drivers/net/wireless/rt2x00/rt2800.h ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800.h +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800.h + @@ -629,6 +629,20 @@ */ - --- a/drivers/net/wireless/rt2x00/rt2800lib.c - +++ b/drivers/net/wireless/rt2x00/rt2800lib.c + #define PBF_DBG 0x043c +@@ -32,9 +32,9 @@ Signed-off-by: Gabor Juhos + /* + * RF registers + */ +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c -@@ -4650,6 +4650,30 @@ static int rt2800_init_registers(struct -+@@ -4626,6 +4626,30 @@ static int rt2800_init_registers(struct ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++@@ -4627,6 +4627,30 @@ static int rt2800_init_registers(struct if (ret) return ret; diff --git a/package/kernel/mac80211/patches/600-0007-rt2x00-rt2800lib-fix-max-supported-beacon-count-for-.patch b/package/kernel/mac80211/patches/600-0007-rt2x00-rt2800lib-fix-max-supported-beacon-count-for-.patch -index 180c5e3..4b21eae 100644 +index 180c5e3..e909272 100644 --- a/package/kernel/mac80211/patches/600-0007-rt2x00-rt2800lib-fix-max-supported-beacon-count-for-.patch +++ b/package/kernel/mac80211/patches/600-0007-rt2x00-rt2800lib-fix-max-supported-beacon-count-for-.patch -@@ -10,7 +10,7 @@ Signed-off-by: Gabor Juhos +@@ -5,12 +5,12 @@ Subject: [PATCH] rt2x00: rt2800lib: fix max supported beacon count for RT3593 - --- a/drivers/net/wireless/rt2x00/rt2800lib.c - +++ b/drivers/net/wireless/rt2x00/rt2800lib.c + Signed-off-by: Gabor Juhos + --- +- drivers/net/wireless/rt2x00/rt2800lib.c | 5 ++++- ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c -@@ -7877,7 +7877,10 @@ int rt2800_probe_hw(struct rt2x00_dev *r -+@@ -7851,7 +7851,10 @@ int rt2800_probe_hw(struct rt2x00_dev *r ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++@@ -7852,7 +7852,10 @@ int rt2800_probe_hw(struct rt2x00_dev *r if (rt2x00_rt(rt2x00dev, RT3593)) __set_bit(RT2800_HAS_HIGH_SHARED_MEM, &drv_data->rt2800_flags); +diff --git a/package/kernel/mac80211/patches/600-0008-rt2x00-allow-to-build-rt2800soc-module-for-RT3883.patch b/package/kernel/mac80211/patches/600-0008-rt2x00-allow-to-build-rt2800soc-module-for-RT3883.patch +index 8a10c6e..565e39d 100644 +--- a/package/kernel/mac80211/patches/600-0008-rt2x00-allow-to-build-rt2800soc-module-for-RT3883.patch ++++ b/package/kernel/mac80211/patches/600-0008-rt2x00-allow-to-build-rt2800soc-module-for-RT3883.patch +@@ -5,11 +5,11 @@ Subject: [PATCH] rt2x00: allow to build rt2800soc module for RT3883 + + Signed-off-by: Gabor Juhos + --- +- drivers/net/wireless/rt2x00/Kconfig | 2 +- ++ drivers/net/wireless/ralink/rt2x00/Kconfig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +---- a/drivers/net/wireless/rt2x00/Kconfig +-+++ b/drivers/net/wireless/rt2x00/Kconfig ++--- a/drivers/net/wireless/ralink/rt2x00/Kconfig +++++ b/drivers/net/wireless/ralink/rt2x00/Kconfig + @@ -210,7 +210,7 @@ endif + config RT2800SOC + tristate "Ralink WiSoC support" diff --git a/package/kernel/mac80211/patches/600-0009-rt2x00-rt2800lib-enable-support-for-RT3883.patch b/package/kernel/mac80211/patches/600-0009-rt2x00-rt2800lib-enable-support-for-RT3883.patch -index 31aa34a..e77cd86 100644 +index 31aa34a..7fe38e0 100644 --- a/package/kernel/mac80211/patches/600-0009-rt2x00-rt2800lib-enable-support-for-RT3883.patch +++ b/package/kernel/mac80211/patches/600-0009-rt2x00-rt2800lib-enable-support-for-RT3883.patch -@@ -10,7 +10,7 @@ Signed-off-by: Gabor Juhos +@@ -5,12 +5,12 @@ Subject: [PATCH] rt2x00: rt2800lib: enable support for RT3883 - --- a/drivers/net/wireless/rt2x00/rt2800lib.c - +++ b/drivers/net/wireless/rt2x00/rt2800lib.c + Signed-off-by: Gabor Juhos + --- +- drivers/net/wireless/rt2x00/rt2800lib.c | 1 + ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 1 + + 1 file changed, 1 insertion(+) + +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c -@@ -7847,6 +7847,7 @@ static int rt2800_probe_rt(struct rt2x00 -+@@ -7821,6 +7821,7 @@ static int rt2800_probe_rt(struct rt2x00 ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++@@ -7822,6 +7822,7 @@ static int rt2800_probe_rt(struct rt2x00 case RT3390: case RT3572: case RT3593: diff --git a/package/kernel/mac80211/patches/600-0010-rt2x00-rt2800lib-add-rf_vals-for-RF3853.patch b/package/kernel/mac80211/patches/600-0010-rt2x00-rt2800lib-add-rf_vals-for-RF3853.patch -index a90c590..780c1dd 100644 +index a90c590..253a0c0 100644 --- a/package/kernel/mac80211/patches/600-0010-rt2x00-rt2800lib-add-rf_vals-for-RF3853.patch +++ b/package/kernel/mac80211/patches/600-0010-rt2x00-rt2800lib-add-rf_vals-for-RF3853.patch -@@ -31,7 +31,7 @@ Signed-off-by: Gabor Juhos +@@ -5,12 +5,12 @@ Subject: [PATCH] rt2x00: rt2800lib: add rf_vals for RF3853 + + Signed-off-by: Gabor Juhos + --- +- drivers/net/wireless/rt2x00/rt2800.h | 4 +- +- drivers/net/wireless/rt2x00/rt2800lib.c | 65 +++++++++++++++++++++++++++++++ ++ drivers/net/wireless/ralink/rt2x00/rt2800.h | 4 +- ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 65 +++++++++++++++++++++++++++++++ + 2 files changed, 68 insertions(+), 1 deletion(-) + +---- a/drivers/net/wireless/rt2x00/rt2800.h +-+++ b/drivers/net/wireless/rt2x00/rt2800.h ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800.h +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800.h + @@ -48,7 +48,8 @@ + * RF2853 2.4G/5G 3T3R + * RF3320 2.4G 1T1R(RT3350/RT3370/RT3390) +@@ -29,9 +29,9 @@ Signed-off-by: Gabor Juhos + #define RF5360 0x5360 + #define RF5362 0x5362 #define RF5370 0x5370 - --- a/drivers/net/wireless/rt2x00/rt2800lib.c - +++ b/drivers/net/wireless/rt2x00/rt2800lib.c +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c -@@ -7465,6 +7465,66 @@ static const struct rf_channel rf_vals_3 -+@@ -7441,6 +7441,66 @@ static const struct rf_channel rf_vals_3 ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++@@ -7442,6 +7442,66 @@ static const struct rf_channel rf_vals_3 {173, 0x61, 0, 9}, }; @@ -28471,20 +29437,28 @@ index a90c590..780c1dd 100644 /* Channel, N, K, mod, R */ {1, 482, 4, 10, 3}, -@@ -7694,6 +7754,11 @@ static int rt2800_probe_hw_mode(struct r -+@@ -7668,6 +7728,11 @@ static int rt2800_probe_hw_mode(struct r ++@@ -7669,6 +7729,11 @@ static int rt2800_probe_hw_mode(struct r spec->channels = rf_vals_3x; break; diff --git a/package/kernel/mac80211/patches/600-0011-rt2x00-rt2800lib-enable-VCO-calibration-for-RF3853.patch b/package/kernel/mac80211/patches/600-0011-rt2x00-rt2800lib-enable-VCO-calibration-for-RF3853.patch -index ab2673b..858dece 100644 +index ab2673b..f15c22b 100644 --- a/package/kernel/mac80211/patches/600-0011-rt2x00-rt2800lib-enable-VCO-calibration-for-RF3853.patch +++ b/package/kernel/mac80211/patches/600-0011-rt2x00-rt2800lib-enable-VCO-calibration-for-RF3853.patch -@@ -10,7 +10,7 @@ Signed-off-by: Gabor Juhos +@@ -5,12 +5,12 @@ Subject: [PATCH] rt2x00: rt2800lib: enable VCO calibration for RF3853 - --- a/drivers/net/wireless/rt2x00/rt2800lib.c - +++ b/drivers/net/wireless/rt2x00/rt2800lib.c + Signed-off-by: Gabor Juhos + --- +- drivers/net/wireless/rt2x00/rt2800lib.c | 2 ++ ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 2 ++ + 1 file changed, 2 insertions(+) + +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c -@@ -4402,6 +4402,7 @@ void rt2800_vco_calibration(struct rt2x0 -+@@ -4378,6 +4378,7 @@ void rt2800_vco_calibration(struct rt2x0 ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++@@ -4379,6 +4379,7 @@ void rt2800_vco_calibration(struct rt2x0 case RF3053: case RF3070: case RF3290: @@ -28493,20 +29467,28 @@ index ab2673b..858dece 100644 case RF5362: case RF5370: -@@ -7873,6 +7874,7 @@ static int rt2800_probe_hw_mode(struct r -+@@ -7847,6 +7848,7 @@ static int rt2800_probe_hw_mode(struct r ++@@ -7848,6 +7849,7 @@ static int rt2800_probe_hw_mode(struct r case RF3053: case RF3070: case RF3290: diff --git a/package/kernel/mac80211/patches/600-0012-rt2x00-rt2800lib-add-channel-configuration-function-.patch b/package/kernel/mac80211/patches/600-0012-rt2x00-rt2800lib-add-channel-configuration-function-.patch -index 05ed444..ed82e44 100644 +index 05ed444..c120f2c 100644 --- a/package/kernel/mac80211/patches/600-0012-rt2x00-rt2800lib-add-channel-configuration-function-.patch +++ b/package/kernel/mac80211/patches/600-0012-rt2x00-rt2800lib-add-channel-configuration-function-.patch -@@ -11,7 +11,7 @@ Signed-off-by: Gabor Juhos +@@ -6,12 +6,12 @@ Subject: [PATCH] rt2x00: rt2800lib: add channel configuration function for - --- a/drivers/net/wireless/rt2x00/rt2800lib.c - +++ b/drivers/net/wireless/rt2x00/rt2800lib.c + Signed-off-by: Gabor Juhos + --- +- drivers/net/wireless/rt2x00/rt2800lib.c | 208 +++++++++++++++++++++++++++++++ ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 208 +++++++++++++++++++++++++++++++ + 1 file changed, 208 insertions(+) + +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c -@@ -2649,6 +2649,211 @@ static void rt2800_config_channel_rf3053 -+@@ -2625,6 +2625,211 @@ static void rt2800_config_channel_rf3053 ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++@@ -2626,6 +2626,211 @@ static void rt2800_config_channel_rf3053 } } @@ -28515,33 +29497,62 @@ index 05ed444..ed82e44 100644 #define POWER_BOUND_5G 0x2b -@@ -3261,6 +3466,9 @@ static void rt2800_config_channel(struct -+@@ -3237,6 +3442,9 @@ static void rt2800_config_channel(struct ++@@ -3238,6 +3443,9 @@ static void rt2800_config_channel(struct case RF3322: rt2800_config_channel_rf3322(rt2x00dev, conf, rf, info); break; diff --git a/package/kernel/mac80211/patches/600-0013-rt2x00-rt2800lib-enable-RF3853-support.patch b/package/kernel/mac80211/patches/600-0013-rt2x00-rt2800lib-enable-RF3853-support.patch -index 3b50775..33cbc4c 100644 +index 3b50775..f006304 100644 --- a/package/kernel/mac80211/patches/600-0013-rt2x00-rt2800lib-enable-RF3853-support.patch +++ b/package/kernel/mac80211/patches/600-0013-rt2x00-rt2800lib-enable-RF3853-support.patch -@@ -10,7 +10,7 @@ Signed-off-by: Gabor Juhos +@@ -5,12 +5,12 @@ Subject: [PATCH] rt2x00: rt2800lib: enable RF3853 support - --- a/drivers/net/wireless/rt2x00/rt2800lib.c - +++ b/drivers/net/wireless/rt2x00/rt2800lib.c + Signed-off-by: Gabor Juhos + --- +- drivers/net/wireless/rt2x00/rt2800lib.c | 1 + ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 1 + + 1 file changed, 1 insertion(+) + +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c -@@ -7430,6 +7430,7 @@ static int rt2800_init_eeprom(struct rt2 -+@@ -7406,6 +7406,7 @@ static int rt2800_init_eeprom(struct rt2 ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++@@ -7407,6 +7407,7 @@ static int rt2800_init_eeprom(struct rt2 case RF3290: case RF3320: case RF3322: diff --git a/package/kernel/mac80211/patches/600-0014-rt2x00-rt2800lib-add-MAC-register-initialization-for.patch b/package/kernel/mac80211/patches/600-0014-rt2x00-rt2800lib-add-MAC-register-initialization-for.patch -index 4dfb068..c3a4798 100644 +index 4dfb068..a56bfa8 100644 --- a/package/kernel/mac80211/patches/600-0014-rt2x00-rt2800lib-add-MAC-register-initialization-for.patch +++ b/package/kernel/mac80211/patches/600-0014-rt2x00-rt2800lib-add-MAC-register-initialization-for.patch -@@ -35,7 +35,7 @@ Signed-off-by: Gabor Juhos +@@ -6,12 +6,12 @@ Subject: [PATCH] rt2x00: rt2800lib: add MAC register initialization for + + Signed-off-by: Gabor Juhos + --- +- drivers/net/wireless/rt2x00/rt2800.h | 14 ++++++++++++++ +- drivers/net/wireless/rt2x00/rt2800lib.c | 19 ++++++++++++++++--- ++ drivers/net/wireless/ralink/rt2x00/rt2800.h | 14 ++++++++++++++ ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 19 ++++++++++++++++--- + 2 files changed, 30 insertions(+), 3 deletions(-) + +---- a/drivers/net/wireless/rt2x00/rt2800.h +-+++ b/drivers/net/wireless/rt2x00/rt2800.h ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800.h +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800.h + @@ -1588,6 +1588,20 @@ + #define TX_PWR_CFG_9_STBC7_CH2 FIELD32(0x00000f00) + +@@ -33,9 +33,9 @@ Signed-off-by: Gabor Juhos + * RX_FILTER_CFG: RX configuration register. + */ #define RX_FILTER_CFG 0x1400 - --- a/drivers/net/wireless/rt2x00/rt2800lib.c - +++ b/drivers/net/wireless/rt2x00/rt2800lib.c +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c -@@ -5005,6 +5005,12 @@ static int rt2800_init_registers(struct -+@@ -4981,6 +4981,12 @@ static int rt2800_init_registers(struct ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++@@ -4982,6 +4982,12 @@ static int rt2800_init_registers(struct rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00000000); } @@ -28550,7 +29561,7 @@ index 4dfb068..c3a4798 100644 rt2x00_rt(rt2x00dev, RT5392) || rt2x00_rt(rt2x00dev, RT5592)) { -@@ -5035,9 +5041,11 @@ static int rt2800_init_registers(struct -+@@ -5011,9 +5017,11 @@ static int rt2800_init_registers(struct ++@@ -5012,9 +5018,11 @@ static int rt2800_init_registers(struct rt2800_register_read(rt2x00dev, MAX_LEN_CFG, ®); rt2x00_set_field32(®, MAX_LEN_CFG_MAX_MPDU, AGGREGATION_SIZE); @@ -28559,20 +29570,47 @@ index 4dfb068..c3a4798 100644 else rt2x00_set_field32(®, MAX_LEN_CFG_MAX_PSDU, 1); -@@ -5190,6 +5198,11 @@ static int rt2800_init_registers(struct -+@@ -5166,6 +5174,11 @@ static int rt2800_init_registers(struct ++@@ -5167,6 +5175,11 @@ static int rt2800_init_registers(struct reg = rt2x00_rt(rt2x00dev, RT5592) ? 0x00000082 : 0x00000002; rt2800_register_write(rt2x00dev, TXOP_HLDR_ET, reg); +diff --git a/package/kernel/mac80211/patches/600-0015-rt2x00-rt2800soc-fix-rt2800soc_disable_radio-for-RT3.patch b/package/kernel/mac80211/patches/600-0015-rt2x00-rt2800soc-fix-rt2800soc_disable_radio-for-RT3.patch +index 837c025..d68ad50 100644 +--- a/package/kernel/mac80211/patches/600-0015-rt2x00-rt2800soc-fix-rt2800soc_disable_radio-for-RT3.patch ++++ b/package/kernel/mac80211/patches/600-0015-rt2x00-rt2800soc-fix-rt2800soc_disable_radio-for-RT3.patch +@@ -5,11 +5,11 @@ Subject: [PATCH] rt2x00: rt2800soc: fix rt2800soc_disable_radio for RT3883 + + Signed-off-by: Gabor Juhos + --- +- drivers/net/wireless/rt2x00/rt2800soc.c | 9 ++++++++- ++ drivers/net/wireless/ralink/rt2x00/rt2800soc.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +---- a/drivers/net/wireless/rt2x00/rt2800soc.c +-+++ b/drivers/net/wireless/rt2x00/rt2800soc.c ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800soc.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800soc.c + @@ -51,9 +51,16 @@ static bool rt2800soc_hwcrypt_disabled(s + + static void rt2800soc_disable_radio(struct rt2x00_dev *rt2x00dev) diff --git a/package/kernel/mac80211/patches/600-0016-rt2x00-rt2800lib-add-BBP-register-initialization-for.patch b/package/kernel/mac80211/patches/600-0016-rt2x00-rt2800lib-add-BBP-register-initialization-for.patch -index 6663b78..e647777 100644 +index 6663b78..9532632 100644 --- a/package/kernel/mac80211/patches/600-0016-rt2x00-rt2800lib-add-BBP-register-initialization-for.patch +++ b/package/kernel/mac80211/patches/600-0016-rt2x00-rt2800lib-add-BBP-register-initialization-for.patch -@@ -11,7 +11,7 @@ Signed-off-by: Gabor Juhos +@@ -6,12 +6,12 @@ Subject: [PATCH] rt2x00: rt2800lib: add BBP register initialization for - --- a/drivers/net/wireless/rt2x00/rt2800lib.c - +++ b/drivers/net/wireless/rt2x00/rt2800lib.c + Signed-off-by: Gabor Juhos + --- +- drivers/net/wireless/rt2x00/rt2800lib.c | 44 +++++++++++++++++++++++++++++++ ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 44 +++++++++++++++++++++++++++++++ + 1 file changed, 44 insertions(+) + +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c -@@ -5808,6 +5808,47 @@ static void rt2800_init_bbp_3593(struct -+@@ -5784,6 +5784,47 @@ static void rt2800_init_bbp_3593(struct ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++@@ -5785,6 +5785,47 @@ static void rt2800_init_bbp_3593(struct rt2800_bbp_write(rt2x00dev, 103, 0xc0); } @@ -28581,20 +29619,41 @@ index 6663b78..e647777 100644 { int ant, div_mode; -@@ -6026,6 +6067,9 @@ static void rt2800_init_bbp(struct rt2x0 -+@@ -6002,6 +6043,9 @@ static void rt2800_init_bbp(struct rt2x0 ++@@ -6003,6 +6044,9 @@ static void rt2800_init_bbp(struct rt2x0 case RT3593: rt2800_init_bbp_3593(rt2x00dev); return; diff --git a/package/kernel/mac80211/patches/600-0017-rt2x00-rt2800lib-add-RFCSR-initialization-for-RT3883.patch b/package/kernel/mac80211/patches/600-0017-rt2x00-rt2800lib-add-RFCSR-initialization-for-RT3883.patch -index 6e66f14..0fec3cd 100644 +index 6e66f14..936fa35 100644 --- a/package/kernel/mac80211/patches/600-0017-rt2x00-rt2800lib-add-RFCSR-initialization-for-RT3883.patch +++ b/package/kernel/mac80211/patches/600-0017-rt2x00-rt2800lib-add-RFCSR-initialization-for-RT3883.patch -@@ -21,7 +21,7 @@ Signed-off-by: Gabor Juhos +@@ -5,12 +5,12 @@ Subject: [PATCH] rt2x00: rt2800lib: add RFCSR initialization for RT3883 + + Signed-off-by: Gabor Juhos + --- +- drivers/net/wireless/rt2x00/rt2800.h | 1 + +- drivers/net/wireless/rt2x00/rt2800lib.c | 141 +++++++++++++++++++++++++++++++ ++ drivers/net/wireless/ralink/rt2x00/rt2800.h | 1 + ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 141 +++++++++++++++++++++++++++++++ + 2 files changed, 142 insertions(+) + +---- a/drivers/net/wireless/rt2x00/rt2800.h +-+++ b/drivers/net/wireless/rt2x00/rt2800.h ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800.h +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800.h + @@ -2171,6 +2171,7 @@ struct mac_iveiv_entry { /* - --- a/drivers/net/wireless/rt2x00/rt2800lib.c - +++ b/drivers/net/wireless/rt2x00/rt2800lib.c + * RFCSR 2: +@@ -19,9 +19,9 @@ Signed-off-by: Gabor Juhos + #define RFCSR2_RESCAL_EN FIELD8(0x80) + + /* +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c -@@ -6843,6 +6843,144 @@ static void rt2800_init_rfcsr_3593(struc -+@@ -6819,6 +6819,144 @@ static void rt2800_init_rfcsr_3593(struc ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++@@ -6820,6 +6820,144 @@ static void rt2800_init_rfcsr_3593(struc /* TODO: enable stream mode support */ } @@ -28603,33 +29662,68 @@ index 6e66f14..0fec3cd 100644 { rt2800_rf_init_calibration(rt2x00dev, 2); -@@ -7074,6 +7212,9 @@ static void rt2800_init_rfcsr(struct rt2 -+@@ -7050,6 +7188,9 @@ static void rt2800_init_rfcsr(struct rt2 ++@@ -7051,6 +7189,9 @@ static void rt2800_init_rfcsr(struct rt2 case RT3390: rt2800_init_rfcsr_3390(rt2x00dev); break; +diff --git a/package/kernel/mac80211/patches/600-0018-rt2x00-rt2800lib-use-the-extended-EEPROM-map-for-RT3.patch b/package/kernel/mac80211/patches/600-0018-rt2x00-rt2800lib-use-the-extended-EEPROM-map-for-RT3.patch +index 57af961..ae899f7 100644 +--- a/package/kernel/mac80211/patches/600-0018-rt2x00-rt2800lib-use-the-extended-EEPROM-map-for-RT3.patch ++++ b/package/kernel/mac80211/patches/600-0018-rt2x00-rt2800lib-use-the-extended-EEPROM-map-for-RT3.patch +@@ -5,11 +5,11 @@ Subject: [PATCH] rt2x00: rt2800lib: use the extended EEPROM map for RT3883 + + Signed-off-by: Gabor Juhos + --- +- drivers/net/wireless/rt2x00/rt2800lib.c | 3 ++- ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c + @@ -342,7 +342,8 @@ static unsigned int rt2800_eeprom_word_i + wiphy_name(rt2x00dev->hw->wiphy), word)) + return 0; diff --git a/package/kernel/mac80211/patches/600-0019-rt2x00-rt2800lib-force-rf-type-to-RF3853-on-RT3883.patch b/package/kernel/mac80211/patches/600-0019-rt2x00-rt2800lib-force-rf-type-to-RF3853-on-RT3883.patch -index 9390f7e..c9d1e06 100644 +index 9390f7e..bcaf676 100644 --- a/package/kernel/mac80211/patches/600-0019-rt2x00-rt2800lib-force-rf-type-to-RF3853-on-RT3883.patch +++ b/package/kernel/mac80211/patches/600-0019-rt2x00-rt2800lib-force-rf-type-to-RF3853-on-RT3883.patch -@@ -10,7 +10,7 @@ Signed-off-by: Gabor Juhos +@@ -5,12 +5,12 @@ Subject: [PATCH] rt2x00: rt2800lib: force rf type to RF3853 on RT3883 - --- a/drivers/net/wireless/rt2x00/rt2800lib.c - +++ b/drivers/net/wireless/rt2x00/rt2800lib.c + Signed-off-by: Gabor Juhos + --- +- drivers/net/wireless/rt2x00/rt2800lib.c | 2 ++ ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 2 ++ + 1 file changed, 2 insertions(+) + +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c -@@ -7611,6 +7611,8 @@ static int rt2800_init_eeprom(struct rt2 -+@@ -7587,6 +7587,8 @@ static int rt2800_init_eeprom(struct rt2 ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++@@ -7588,6 +7588,8 @@ static int rt2800_init_eeprom(struct rt2 rt2x00_rt(rt2x00dev, RT5390) || rt2x00_rt(rt2x00dev, RT5392)) rt2800_eeprom_read(rt2x00dev, EEPROM_CHIP_ID, &rf); diff --git a/package/kernel/mac80211/patches/600-0020-rt2x00-rt2800lib-add-channel-configuration-code-for-.patch b/package/kernel/mac80211/patches/600-0020-rt2x00-rt2800lib-add-channel-configuration-code-for-.patch -index 1cba4f6..12b9c33 100644 +index 1cba4f6..3169c10 100644 --- a/package/kernel/mac80211/patches/600-0020-rt2x00-rt2800lib-add-channel-configuration-code-for-.patch +++ b/package/kernel/mac80211/patches/600-0020-rt2x00-rt2800lib-add-channel-configuration-code-for-.patch -@@ -10,7 +10,7 @@ Signed-off-by: Gabor Juhos +@@ -5,12 +5,12 @@ Subject: [PATCH] rt2x00: rt2800lib: add channel configuration code for RT3883 - --- a/drivers/net/wireless/rt2x00/rt2800lib.c - +++ b/drivers/net/wireless/rt2x00/rt2800lib.c + Signed-off-by: Gabor Juhos + --- +- drivers/net/wireless/rt2x00/rt2800lib.c | 72 +++++++++++++++++++++++++++++-- ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 72 +++++++++++++++++++++++++++++-- + 1 file changed, 69 insertions(+), 3 deletions(-) + +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c -@@ -3429,6 +3429,36 @@ static char rt2800_txpower_to_dev(struct -+@@ -3405,6 +3405,36 @@ static char rt2800_txpower_to_dev(struct ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++@@ -3406,6 +3406,36 @@ static char rt2800_txpower_to_dev(struct return clamp_t(char, txpower, MIN_A_TXPOWER, MAX_A_TXPOWER); } @@ -28638,7 +29732,7 @@ index 1cba4f6..12b9c33 100644 struct ieee80211_conf *conf, struct rf_channel *rf, -@@ -3447,6 +3477,12 @@ static void rt2800_config_channel(struct -+@@ -3423,6 +3453,12 @@ static void rt2800_config_channel(struct ++@@ -3424,6 +3454,12 @@ static void rt2800_config_channel(struct rt2800_txpower_to_dev(rt2x00dev, rf->channel, info->default_power3); @@ -28647,7 +29741,7 @@ index 1cba4f6..12b9c33 100644 case RF2020: case RF3020: -@@ -3530,6 +3566,15 @@ static void rt2800_config_channel(struct -+@@ -3506,6 +3542,15 @@ static void rt2800_config_channel(struct ++@@ -3507,6 +3543,15 @@ static void rt2800_config_channel(struct rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev->lna_gain); rt2800_bbp_write(rt2x00dev, 64, 0x37 - rt2x00dev->lna_gain); rt2800_bbp_write(rt2x00dev, 77, 0x98); @@ -28656,7 +29750,7 @@ index 1cba4f6..12b9c33 100644 rt2800_bbp_write(rt2x00dev, 62, 0x37 - rt2x00dev->lna_gain); rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev->lna_gain); -@@ -3542,6 +3587,7 @@ static void rt2800_config_channel(struct -+@@ -3518,6 +3563,7 @@ static void rt2800_config_channel(struct ++@@ -3519,6 +3564,7 @@ static void rt2800_config_channel(struct !rt2x00_rt(rt2x00dev, RT5392)) { if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) { rt2800_bbp_write(rt2x00dev, 82, 0x62); @@ -28665,7 +29759,7 @@ index 1cba4f6..12b9c33 100644 } else { if (rt2x00_rt(rt2x00dev, RT3593)) -@@ -3550,19 +3596,22 @@ static void rt2800_config_channel(struct -+@@ -3526,19 +3572,22 @@ static void rt2800_config_channel(struct ++@@ -3527,19 +3573,22 @@ static void rt2800_config_channel(struct rt2800_bbp_write(rt2x00dev, 82, 0x84); rt2800_bbp_write(rt2x00dev, 75, 0x50); } @@ -28674,46 +29768,70 @@ index 1cba4f6..12b9c33 100644 if (rt2x00_has_cap_external_lna_a(rt2x00dev)) -@@ -3684,6 +3733,23 @@ static void rt2800_config_channel(struct -+@@ -3660,6 +3709,23 @@ static void rt2800_config_channel(struct ++@@ -3661,6 +3710,23 @@ static void rt2800_config_channel(struct rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, reg); diff --git a/package/kernel/mac80211/patches/600-0021-rt2x00-rt2800lib-fix-txpower_to_dev-function-for-RT3.patch b/package/kernel/mac80211/patches/600-0021-rt2x00-rt2800lib-fix-txpower_to_dev-function-for-RT3.patch -index 1773128..3f40b4e 100644 +index 1773128..fa646d2 100644 --- a/package/kernel/mac80211/patches/600-0021-rt2x00-rt2800lib-fix-txpower_to_dev-function-for-RT3.patch +++ b/package/kernel/mac80211/patches/600-0021-rt2x00-rt2800lib-fix-txpower_to_dev-function-for-RT3.patch -@@ -10,7 +10,7 @@ Signed-off-by: Gabor Juhos +@@ -5,12 +5,12 @@ Subject: [PATCH] rt2x00: rt2800lib: fix txpower_to_dev function for RT3883 - --- a/drivers/net/wireless/rt2x00/rt2800lib.c - +++ b/drivers/net/wireless/rt2x00/rt2800lib.c + Signed-off-by: Gabor Juhos + --- +- drivers/net/wireless/rt2x00/rt2800lib.c | 6 ++++-- ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c -@@ -3416,13 +3416,15 @@ static char rt2800_txpower_to_dev(struct -+@@ -3392,13 +3392,15 @@ static char rt2800_txpower_to_dev(struct ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++@@ -3393,13 +3393,15 @@ static char rt2800_txpower_to_dev(struct unsigned int channel, char txpower) { diff --git a/package/kernel/mac80211/patches/600-0022-rt2x00-rt2800lib-use-correct-txpower-calculation-fun.patch b/package/kernel/mac80211/patches/600-0022-rt2x00-rt2800lib-use-correct-txpower-calculation-fun.patch -index 36f0a4c..52baeec 100644 +index 36f0a4c..c068769 100644 --- a/package/kernel/mac80211/patches/600-0022-rt2x00-rt2800lib-use-correct-txpower-calculation-fun.patch +++ b/package/kernel/mac80211/patches/600-0022-rt2x00-rt2800lib-use-correct-txpower-calculation-fun.patch -@@ -11,7 +11,7 @@ Signed-off-by: Gabor Juhos +@@ -6,12 +6,12 @@ Subject: [PATCH] rt2x00: rt2800lib: use correct txpower calculation function - --- a/drivers/net/wireless/rt2x00/rt2800lib.c - +++ b/drivers/net/wireless/rt2x00/rt2800lib.c + Signed-off-by: Gabor Juhos + --- +- drivers/net/wireless/rt2x00/rt2800lib.c | 3 ++- ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c -@@ -4635,7 +4635,8 @@ static void rt2800_config_txpower(struct -+@@ -4611,7 +4611,8 @@ static void rt2800_config_txpower(struct ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++@@ -4612,7 +4612,8 @@ static void rt2800_config_txpower(struct struct ieee80211_channel *chan, int power_level) { diff --git a/package/kernel/mac80211/patches/600-0023-rt2x00-rt2800lib-hardcode-txmixer-gain-values-to-zer.patch b/package/kernel/mac80211/patches/600-0023-rt2x00-rt2800lib-hardcode-txmixer-gain-values-to-zer.patch -index 8119f97..b9dafc6 100644 +index 8119f97..74d80de 100644 --- a/package/kernel/mac80211/patches/600-0023-rt2x00-rt2800lib-hardcode-txmixer-gain-values-to-zer.patch +++ b/package/kernel/mac80211/patches/600-0023-rt2x00-rt2800lib-hardcode-txmixer-gain-values-to-zer.patch -@@ -11,7 +11,7 @@ Signed-off-by: Gabor Juhos +@@ -6,12 +6,12 @@ Subject: [PATCH] rt2x00: rt2800lib: hardcode txmixer gain values to zero for - --- a/drivers/net/wireless/rt2x00/rt2800lib.c - +++ b/drivers/net/wireless/rt2x00/rt2800lib.c + Signed-off-by: Gabor Juhos + --- +- drivers/net/wireless/rt2x00/rt2800lib.c | 6 ++++-- ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c -@@ -7493,7 +7493,8 @@ static u8 rt2800_get_txmixer_gain_24g(st -+@@ -7469,7 +7469,8 @@ static u8 rt2800_get_txmixer_gain_24g(st ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++@@ -7470,7 +7470,8 @@ static u8 rt2800_get_txmixer_gain_24g(st { u16 word; @@ -28722,46 +29840,108 @@ index 8119f97..b9dafc6 100644 rt2800_eeprom_read(rt2x00dev, EEPROM_TXMIXER_GAIN_BG, &word); -@@ -7507,7 +7508,8 @@ static u8 rt2800_get_txmixer_gain_5g(str -+@@ -7483,7 +7484,8 @@ static u8 rt2800_get_txmixer_gain_5g(str ++@@ -7484,7 +7485,8 @@ static u8 rt2800_get_txmixer_gain_5g(str { u16 word; +diff --git a/package/kernel/mac80211/patches/600-0024-rt2x00-rt2800lib-use-correct-RT-XWI-size-for-RT3883.patch b/package/kernel/mac80211/patches/600-0024-rt2x00-rt2800lib-use-correct-RT-XWI-size-for-RT3883.patch +index 53435aa..1259286 100644 +--- a/package/kernel/mac80211/patches/600-0024-rt2x00-rt2800lib-use-correct-RT-XWI-size-for-RT3883.patch ++++ b/package/kernel/mac80211/patches/600-0024-rt2x00-rt2800lib-use-correct-RT-XWI-size-for-RT3883.patch +@@ -5,11 +5,11 @@ Subject: [PATCH] rt2x00: rt2800lib: use correct [RT]XWI size for RT3883 + + Signed-off-by: Gabor Juhos + --- +- drivers/net/wireless/rt2x00/rt2800lib.c | 1 + ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 1 + + 1 file changed, 1 insertion(+) + +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c + @@ -558,6 +558,7 @@ void rt2800_get_txwi_rxwi_size(struct rt + { + switch (rt2x00dev->chip.rt) { +diff --git a/package/kernel/mac80211/patches/600-0025-rt2x00-rt2800lib-use-correct-beacon-base-for-RT3883.patch b/package/kernel/mac80211/patches/600-0025-rt2x00-rt2800lib-use-correct-beacon-base-for-RT3883.patch +index 08f3f88..0dcc027 100644 +--- a/package/kernel/mac80211/patches/600-0025-rt2x00-rt2800lib-use-correct-beacon-base-for-RT3883.patch ++++ b/package/kernel/mac80211/patches/600-0025-rt2x00-rt2800lib-use-correct-beacon-base-for-RT3883.patch +@@ -5,11 +5,11 @@ Subject: [PATCH] rt2x00: rt2800lib: use correct beacon base for RT3883 + + Signed-off-by: Gabor Juhos + --- +- drivers/net/wireless/rt2x00/rt2800lib.c | 3 ++- ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c + @@ -983,7 +983,8 @@ EXPORT_SYMBOL_GPL(rt2800_txdone_entry); + static unsigned int rt2800_hw_beacon_base(struct rt2x00_dev *rt2x00dev, + unsigned int index) diff --git a/package/kernel/mac80211/patches/600-0026-rt2x00-rt2800lib-use-correct-beacon-count-for-RT3883.patch b/package/kernel/mac80211/patches/600-0026-rt2x00-rt2800lib-use-correct-beacon-count-for-RT3883.patch -index dfbdee7..f09f803 100644 +index dfbdee7..6ce224a 100644 --- a/package/kernel/mac80211/patches/600-0026-rt2x00-rt2800lib-use-correct-beacon-count-for-RT3883.patch +++ b/package/kernel/mac80211/patches/600-0026-rt2x00-rt2800lib-use-correct-beacon-count-for-RT3883.patch -@@ -10,7 +10,7 @@ Signed-off-by: Gabor Juhos +@@ -5,12 +5,12 @@ Subject: [PATCH] rt2x00: rt2800lib: use correct beacon count for RT3883 - --- a/drivers/net/wireless/rt2x00/rt2800lib.c - +++ b/drivers/net/wireless/rt2x00/rt2800lib.c + Signed-off-by: Gabor Juhos + --- +- drivers/net/wireless/rt2x00/rt2800lib.c | 3 ++- ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c -@@ -8428,7 +8428,8 @@ int rt2800_probe_hw(struct rt2x00_dev *r -+@@ -8402,7 +8402,8 @@ int rt2800_probe_hw(struct rt2x00_dev *r ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++@@ -8403,7 +8403,8 @@ int rt2800_probe_hw(struct rt2x00_dev *r if (rt2x00_rt(rt2x00dev, RT3593)) __set_bit(RT2800_HAS_HIGH_SHARED_MEM, &drv_data->rt2800_flags); diff --git a/package/kernel/mac80211/patches/600-0027-rt2x00-rt2800lib-fix-antenna-configuration-for-RT388.patch b/package/kernel/mac80211/patches/600-0027-rt2x00-rt2800lib-fix-antenna-configuration-for-RT388.patch -index 22f7110..f7d23fc 100644 +index 22f7110..3936368 100644 --- a/package/kernel/mac80211/patches/600-0027-rt2x00-rt2800lib-fix-antenna-configuration-for-RT388.patch +++ b/package/kernel/mac80211/patches/600-0027-rt2x00-rt2800lib-fix-antenna-configuration-for-RT388.patch -@@ -10,7 +10,7 @@ Signed-off-by: Gabor Juhos +@@ -5,12 +5,12 @@ Subject: [PATCH] rt2x00: rt2800lib: fix antenna configuration for RT3883 - --- a/drivers/net/wireless/rt2x00/rt2800lib.c - +++ b/drivers/net/wireless/rt2x00/rt2800lib.c + Signed-off-by: Gabor Juhos + --- +- drivers/net/wireless/rt2x00/rt2800lib.c | 3 ++- ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c -@@ -1961,7 +1961,8 @@ void rt2800_config_ant(struct rt2x00_dev -+@@ -1937,7 +1937,8 @@ void rt2800_config_ant(struct rt2x00_dev ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++@@ -1938,7 +1938,8 @@ void rt2800_config_ant(struct rt2x00_dev rt2800_bbp_write(rt2x00dev, 3, r3); rt2800_bbp_write(rt2x00dev, 1, r1); diff --git a/package/kernel/mac80211/patches/600-0028-rt2x00-rt2800lib-fix-LNA-gain-configuration-for-RT38.patch b/package/kernel/mac80211/patches/600-0028-rt2x00-rt2800lib-fix-LNA-gain-configuration-for-RT38.patch -index 9945f38..4da750e 100644 +index 9945f38..f028587 100644 --- a/package/kernel/mac80211/patches/600-0028-rt2x00-rt2800lib-fix-LNA-gain-configuration-for-RT38.patch +++ b/package/kernel/mac80211/patches/600-0028-rt2x00-rt2800lib-fix-LNA-gain-configuration-for-RT38.patch -@@ -10,7 +10,7 @@ Signed-off-by: Gabor Juhos +@@ -5,12 +5,12 @@ Subject: [PATCH] rt2x00: rt2800lib: fix LNA gain configuration for RT3883 - --- a/drivers/net/wireless/rt2x00/rt2800lib.c - +++ b/drivers/net/wireless/rt2x00/rt2800lib.c + Signed-off-by: Gabor Juhos + --- +- drivers/net/wireless/rt2x00/rt2800lib.c | 6 ++++-- ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c -@@ -1984,7 +1984,8 @@ static void rt2800_config_lna_gain(struc -+@@ -1960,7 +1960,8 @@ static void rt2800_config_lna_gain(struc ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++@@ -1961,7 +1961,8 @@ static void rt2800_config_lna_gain(struc rt2800_eeprom_read(rt2x00dev, EEPROM_LNA, &eeprom); lna_gain = rt2x00_get_field16(eeprom, EEPROM_LNA_A0); } else if (libconf->rf.channel <= 128) { @@ -28770,20 +29950,28 @@ index 9945f38..4da750e 100644 lna_gain = rt2x00_get_field16(eeprom, EEPROM_EXT_LNA2_A1); -@@ -1994,7 +1995,8 @@ static void rt2800_config_lna_gain(struc -+@@ -1970,7 +1971,8 @@ static void rt2800_config_lna_gain(struc ++@@ -1971,7 +1972,8 @@ static void rt2800_config_lna_gain(struc EEPROM_RSSI_BG2_LNA_A1); } } else { diff --git a/package/kernel/mac80211/patches/600-0029-rt2x00-rt2800lib-fix-VGC-setup-for-RT3883.patch b/package/kernel/mac80211/patches/600-0029-rt2x00-rt2800lib-fix-VGC-setup-for-RT3883.patch -index beadea8..628b237 100644 +index beadea8..ab8c625 100644 --- a/package/kernel/mac80211/patches/600-0029-rt2x00-rt2800lib-fix-VGC-setup-for-RT3883.patch +++ b/package/kernel/mac80211/patches/600-0029-rt2x00-rt2800lib-fix-VGC-setup-for-RT3883.patch -@@ -10,7 +10,7 @@ Signed-off-by: Gabor Juhos +@@ -5,12 +5,12 @@ Subject: [PATCH] rt2x00: rt2800lib: fix VGC setup for RT3883 - --- a/drivers/net/wireless/rt2x00/rt2800lib.c - +++ b/drivers/net/wireless/rt2x00/rt2800lib.c + Signed-off-by: Gabor Juhos + --- +- drivers/net/wireless/rt2x00/rt2800lib.c | 11 +++++++++-- ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c -@@ -4835,7 +4835,8 @@ static u8 rt2800_get_default_vgc(struct -+@@ -4811,7 +4811,8 @@ static u8 rt2800_get_default_vgc(struct ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++@@ -4812,7 +4812,8 @@ static u8 rt2800_get_default_vgc(struct else vgc = 0x2e + rt2x00dev->lna_gain; } else { /* 5GHZ band */ @@ -28792,7 +29980,7 @@ index beadea8..628b237 100644 else if (rt2x00_rt(rt2x00dev, RT5592)) vgc = 0x24 + (2 * rt2x00dev->lna_gain); -@@ -4855,7 +4856,8 @@ static inline void rt2800_set_vgc(struct -+@@ -4831,7 +4832,8 @@ static inline void rt2800_set_vgc(struct ++@@ -4832,7 +4833,8 @@ static inline void rt2800_set_vgc(struct { if (qual->vgc_level != vgc_level) { if (rt2x00_rt(rt2x00dev, RT3572) || @@ -28801,20 +29989,28 @@ index beadea8..628b237 100644 vgc_level); } else if (rt2x00_rt(rt2x00dev, RT5592)) { -@@ -4902,6 +4904,11 @@ void rt2800_link_tuner(struct rt2x00_dev -+@@ -4878,6 +4880,11 @@ void rt2800_link_tuner(struct rt2x00_dev ++@@ -4879,6 +4881,11 @@ void rt2800_link_tuner(struct rt2x00_dev } break; diff --git a/package/kernel/mac80211/patches/600-0030-rt2x00-rt2800lib-fix-EEPROM-LNA-validation-for-RT388.patch b/package/kernel/mac80211/patches/600-0030-rt2x00-rt2800lib-fix-EEPROM-LNA-validation-for-RT388.patch -index a6c0f58..216b8b6 100644 +index a6c0f58..49830a1 100644 --- a/package/kernel/mac80211/patches/600-0030-rt2x00-rt2800lib-fix-EEPROM-LNA-validation-for-RT388.patch +++ b/package/kernel/mac80211/patches/600-0030-rt2x00-rt2800lib-fix-EEPROM-LNA-validation-for-RT388.patch -@@ -10,7 +10,7 @@ Signed-off-by: Gabor Juhos +@@ -5,12 +5,12 @@ Subject: [PATCH] rt2x00: rt2800lib: fix EEPROM LNA validation for RT3883 - --- a/drivers/net/wireless/rt2x00/rt2800lib.c - +++ b/drivers/net/wireless/rt2x00/rt2800lib.c + Signed-off-by: Gabor Juhos + --- +- drivers/net/wireless/rt2x00/rt2800lib.c | 9 ++++++--- ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c -@@ -7630,7 +7630,8 @@ static int rt2800_validate_eeprom(struct -+@@ -7606,7 +7606,8 @@ static int rt2800_validate_eeprom(struct ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++@@ -7607,7 +7607,8 @@ static int rt2800_validate_eeprom(struct rt2800_eeprom_read(rt2x00dev, EEPROM_RSSI_BG2, &word); if (abs(rt2x00_get_field16(word, EEPROM_RSSI_BG2_OFFSET2)) > 10) rt2x00_set_field16(&word, EEPROM_RSSI_BG2_OFFSET2, 0); @@ -28823,7 +30019,7 @@ index a6c0f58..216b8b6 100644 rt2x00_get_field16(word, EEPROM_RSSI_BG2_LNA_A1) == 0xff) rt2x00_set_field16(&word, EEPROM_RSSI_BG2_LNA_A1, -@@ -7650,7 +7651,8 @@ static int rt2800_validate_eeprom(struct -+@@ -7626,7 +7627,8 @@ static int rt2800_validate_eeprom(struct ++@@ -7627,7 +7628,8 @@ static int rt2800_validate_eeprom(struct rt2800_eeprom_read(rt2x00dev, EEPROM_RSSI_A2, &word); if (abs(rt2x00_get_field16(word, EEPROM_RSSI_A2_OFFSET2)) > 10) rt2x00_set_field16(&word, EEPROM_RSSI_A2_OFFSET2, 0); @@ -28832,45 +30028,141 @@ index a6c0f58..216b8b6 100644 rt2x00_get_field16(word, EEPROM_RSSI_A2_LNA_A2) == 0xff) rt2x00_set_field16(&word, EEPROM_RSSI_A2_LNA_A2, -@@ -7658,7 +7660,8 @@ static int rt2800_validate_eeprom(struct -+@@ -7634,7 +7636,8 @@ static int rt2800_validate_eeprom(struct ++@@ -7635,7 +7637,8 @@ static int rt2800_validate_eeprom(struct } rt2800_eeprom_write(rt2x00dev, EEPROM_RSSI_A2, word); diff --git a/package/kernel/mac80211/patches/600-0031-rt2x00-rt2800lib-fix-txpower-compensation-for-RT3883.patch b/package/kernel/mac80211/patches/600-0031-rt2x00-rt2800lib-fix-txpower-compensation-for-RT3883.patch -index 910f9ec..515086f 100644 +index 910f9ec..6e22847 100644 --- a/package/kernel/mac80211/patches/600-0031-rt2x00-rt2800lib-fix-txpower-compensation-for-RT3883.patch +++ b/package/kernel/mac80211/patches/600-0031-rt2x00-rt2800lib-fix-txpower-compensation-for-RT3883.patch -@@ -10,7 +10,7 @@ Signed-off-by: Gabor Juhos +@@ -5,12 +5,12 @@ Subject: [PATCH] rt2x00: rt2800lib: fix txpower compensation for RT3883 - --- a/drivers/net/wireless/rt2x00/rt2800lib.c - +++ b/drivers/net/wireless/rt2x00/rt2800lib.c + Signed-off-by: Gabor Juhos + --- +- drivers/net/wireless/rt2x00/rt2800lib.c | 3 +++ ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 3 +++ + 1 file changed, 3 insertions(+) + +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c -@@ -4005,6 +4005,9 @@ static u8 rt2800_compensate_txpower(stru -+@@ -3981,6 +3981,9 @@ static u8 rt2800_compensate_txpower(stru ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++@@ -3982,6 +3982,9 @@ static u8 rt2800_compensate_txpower(stru if (rt2x00_rt(rt2x00dev, RT3593)) return min_t(u8, txpower, 0xc); diff --git a/package/kernel/mac80211/patches/600-0032-rt2x00-rt2800lib-enable-RT2800_HAS_HIGH_SHARED_MEM-f.patch b/package/kernel/mac80211/patches/600-0032-rt2x00-rt2800lib-enable-RT2800_HAS_HIGH_SHARED_MEM-f.patch -index bcdfc67..77e3f1b 100644 +index bcdfc67..25753af 100644 --- a/package/kernel/mac80211/patches/600-0032-rt2x00-rt2800lib-enable-RT2800_HAS_HIGH_SHARED_MEM-f.patch +++ b/package/kernel/mac80211/patches/600-0032-rt2x00-rt2800lib-enable-RT2800_HAS_HIGH_SHARED_MEM-f.patch -@@ -11,7 +11,7 @@ Signed-off-by: Gabor Juhos +@@ -6,12 +6,12 @@ Subject: [PATCH] rt2x00: rt2800lib: enable RT2800_HAS_HIGH_SHARED_MEM for - --- a/drivers/net/wireless/rt2x00/rt2800lib.c - +++ b/drivers/net/wireless/rt2x00/rt2800lib.c + Signed-off-by: Gabor Juhos + --- +- drivers/net/wireless/rt2x00/rt2800lib.c | 3 ++- ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c -@@ -8441,7 +8441,8 @@ int rt2800_probe_hw(struct rt2x00_dev *r -+@@ -8415,7 +8415,8 @@ int rt2800_probe_hw(struct rt2x00_dev *r ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++@@ -8416,7 +8416,8 @@ int rt2800_probe_hw(struct rt2x00_dev *r if (retval) return retval; +diff --git a/package/kernel/mac80211/patches/600-0033-rt2x00-rt2800lib-use-high-memory-for-beacons-on-RT38.patch b/package/kernel/mac80211/patches/600-0033-rt2x00-rt2800lib-use-high-memory-for-beacons-on-RT38.patch +index dc06e6a..4f2e754 100644 +--- a/package/kernel/mac80211/patches/600-0033-rt2x00-rt2800lib-use-high-memory-for-beacons-on-RT38.patch ++++ b/package/kernel/mac80211/patches/600-0033-rt2x00-rt2800lib-use-high-memory-for-beacons-on-RT38.patch +@@ -5,11 +5,11 @@ Subject: [PATCH] rt2x00: rt2800lib: use high memory for beacons on RT3883 + + Signed-off-by: Gabor Juhos + --- +- drivers/net/wireless/rt2x00/rt2800lib.c | 3 ++- ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c + @@ -97,7 +97,8 @@ static inline void rt2800_shared_mem_sel + + static inline bool rt2800_beacon_uses_high_mem(struct rt2x00_dev *rt2x00dev) +diff --git a/package/kernel/mac80211/patches/600-0034-rt2x00-rt2800mmio-add-a-workaround-for-spurious-TX_F.patch b/package/kernel/mac80211/patches/600-0034-rt2x00-rt2800mmio-add-a-workaround-for-spurious-TX_F.patch +index 212eb4e..a497b5e 100644 +--- a/package/kernel/mac80211/patches/600-0034-rt2x00-rt2800mmio-add-a-workaround-for-spurious-TX_F.patch ++++ b/package/kernel/mac80211/patches/600-0034-rt2x00-rt2800mmio-add-a-workaround-for-spurious-TX_F.patch +@@ -6,12 +6,12 @@ Subject: [PATCH] rt2x00: rt2800mmio: add a workaround for spurious + + Signed-off-by: Gabor Juhos + --- +- drivers/net/wireless/rt2x00/rt2800mmio.c | 72 +++++++++++++++++++++++++----- +- drivers/net/wireless/rt2x00/rt2x00.h | 5 +++ ++ drivers/net/wireless/ralink/rt2x00/rt2800mmio.c | 72 +++++++++++++++++++++++++----- ++ drivers/net/wireless/ralink/rt2x00/rt2x00.h | 5 +++ + 2 files changed, 65 insertions(+), 12 deletions(-) + +---- a/drivers/net/wireless/rt2x00/rt2800mmio.c +-+++ b/drivers/net/wireless/rt2x00/rt2800mmio.c ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c + @@ -415,9 +415,9 @@ void rt2800mmio_autowake_tasklet(unsigne + } + EXPORT_SYMBOL_GPL(rt2800mmio_autowake_tasklet); +@@ -120,9 +120,9 @@ Signed-off-by: Gabor Juhos + /* + * Never disable the TX_FIFO_STATUS interrupt. + */ +---- a/drivers/net/wireless/rt2x00/rt2x00.h +-+++ b/drivers/net/wireless/rt2x00/rt2x00.h +-@@ -987,6 +987,11 @@ struct rt2x00_dev { ++--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h +++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h ++@@ -991,6 +991,11 @@ struct rt2x00_dev { + int rf_channel; + + /* +diff --git a/package/kernel/mac80211/patches/601-rt2x00-set_pci_mwi.patch b/package/kernel/mac80211/patches/601-rt2x00-set_pci_mwi.patch +index 08c8fa6..a407161 100644 +--- a/package/kernel/mac80211/patches/601-rt2x00-set_pci_mwi.patch ++++ b/package/kernel/mac80211/patches/601-rt2x00-set_pci_mwi.patch +@@ -1,5 +1,5 @@ +---- a/drivers/net/wireless/rt2x00/rt2x00pci.c +-+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c ++--- a/drivers/net/wireless/ralink/rt2x00/rt2x00pci.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00pci.c + @@ -94,8 +94,10 @@ int rt2x00pci_probe(struct pci_dev *pci_ + + pci_set_master(pci_dev); +diff --git a/package/kernel/mac80211/patches/602-rt2x00-introduce-rt2x00_platform_h.patch b/package/kernel/mac80211/patches/602-rt2x00-introduce-rt2x00_platform_h.patch +index 8c71075..7a183a4 100644 +--- a/package/kernel/mac80211/patches/602-rt2x00-introduce-rt2x00_platform_h.patch ++++ b/package/kernel/mac80211/patches/602-rt2x00-introduce-rt2x00_platform_h.patch +@@ -20,8 +20,8 @@ + +}; + + + +#endif /* _RT2X00_PLATFORM_H */ +---- a/drivers/net/wireless/rt2x00/rt2x00.h +-+++ b/drivers/net/wireless/rt2x00/rt2x00.h ++--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h +++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h + @@ -38,6 +38,7 @@ + #include + #include diff --git a/package/kernel/mac80211/patches/603-rt2x00-introduce-rt2x00eeprom.patch b/package/kernel/mac80211/patches/603-rt2x00-introduce-rt2x00eeprom.patch -index 8f650a2..44b629f 100644 +index 8f650a2..bc056cd 100644 --- a/package/kernel/mac80211/patches/603-rt2x00-introduce-rt2x00eeprom.patch +++ b/package/kernel/mac80211/patches/603-rt2x00-introduce-rt2x00eeprom.patch -@@ -1,13 +1,13 @@ +@@ -1,15 +1,15 @@ --- a/.local-symbols +++ b/.local-symbols -@@ -263,6 +263,7 @@ RT2X00_LIB_FIRMWARE= -+@@ -312,6 +312,7 @@ RT2X00_LIB_FIRMWARE= ++@@ -329,6 +329,7 @@ RT2X00_LIB_FIRMWARE= RT2X00_LIB_CRYPTO= RT2X00_LIB_LEDS= RT2X00_LIB_DEBUGFS= @@ -28878,16 +30170,44 @@ index 8f650a2..44b629f 100644 RT2X00_DEBUG= - RTL_CARDS= - RTL8192CE= -+ WL_MEDIATEK= -+ MT7601U= - --- a/drivers/net/wireless/rt2x00/Kconfig - +++ b/drivers/net/wireless/rt2x00/Kconfig +---- a/drivers/net/wireless/rt2x00/Kconfig +-+++ b/drivers/net/wireless/rt2x00/Kconfig ++ WLAN_VENDOR_REALTEK= ++ RTL8180= ++--- a/drivers/net/wireless/ralink/rt2x00/Kconfig +++++ b/drivers/net/wireless/ralink/rt2x00/Kconfig @@ -69,6 +69,7 @@ config RT2800PCI -@@ -48,7 +48,7 @@ + select RT2X00_LIB_MMIO + select RT2X00_LIB_PCI +@@ -26,7 +26,7 @@ + select RT2800_LIB + select RT2800_LIB_MMIO + ---help--- +-@@ -266,6 +268,9 @@ config RT2X00_LIB_FIRMWARE ++@@ -265,6 +267,9 @@ config RT2X00_LIB_FIRMWARE + config RT2X00_LIB_CRYPTO + bool + +@@ -36,8 +36,8 @@ + config RT2X00_LIB_LEDS + bool + default y if (RT2X00_LIB=y && LEDS_CLASS=y) || (RT2X00_LIB=m && LEDS_CLASS!=n) +---- a/drivers/net/wireless/rt2x00/Makefile +-+++ b/drivers/net/wireless/rt2x00/Makefile ++--- a/drivers/net/wireless/ralink/rt2x00/Makefile +++++ b/drivers/net/wireless/ralink/rt2x00/Makefile + @@ -7,6 +7,7 @@ rt2x00lib-$(CPTCFG_RT2X00_LIB_DEBUGFS) + + rt2x00lib-$(CPTCFG_RT2X00_LIB_CRYPTO) += rt2x00crypto.o + rt2x00lib-$(CPTCFG_RT2X00_LIB_FIRMWARE) += rt2x00firmware.o +@@ -46,9 +46,9 @@ + + obj-$(CPTCFG_RT2X00_LIB) += rt2x00lib.o obj-$(CPTCFG_RT2X00_LIB_MMIO) += rt2x00mmio.o - --- a/drivers/net/wireless/rt2x00/rt2800lib.h - +++ b/drivers/net/wireless/rt2x00/rt2800lib.h +---- a/drivers/net/wireless/rt2x00/rt2800lib.h +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.h -@@ -43,6 +43,8 @@ struct rt2800_drv_data { ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h +@@ -46,6 +46,8 @@ struct rt2800_drv_data { } shmem_lock; }; @@ -28901,37 +30221,235 @@ index 8f650a2..44b629f 100644 { const struct rt2800_ops *rt2800ops = rt2x00dev->ops->drv; +@@ -73,8 +73,8 @@ + return rt2800ops->read_eeprom(rt2x00dev); + } + +---- a/drivers/net/wireless/rt2x00/rt2800soc.c +-+++ b/drivers/net/wireless/rt2x00/rt2800soc.c ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800soc.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800soc.c + @@ -102,19 +102,6 @@ static int rt2800soc_set_device_state(st + return retval; + } +@@ -103,9 +103,9 @@ + .hwcrypt_disabled = rt2800soc_hwcrypt_disabled, + .drv_write_firmware = rt2800soc_write_firmware, + .drv_init_registers = rt2800mmio_init_registers, +---- a/drivers/net/wireless/rt2x00/rt2x00.h +-+++ b/drivers/net/wireless/rt2x00/rt2x00.h +-@@ -695,6 +695,7 @@ enum rt2x00_capability_flags { ++--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h +++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h ++@@ -697,6 +697,7 @@ enum rt2x00_capability_flags { + REQUIRE_HT_TX_DESC, + REQUIRE_PS_AUTOWAKE, + REQUIRE_DELAYED_RFKILL, +@@ -113,7 +113,7 @@ + + /* + * Capabilities +-@@ -964,6 +965,11 @@ struct rt2x00_dev { ++@@ -968,6 +969,11 @@ struct rt2x00_dev { + const struct firmware *fw; + + /* +@@ -125,9 +125,9 @@ + * FIFO for storing tx status reports between isr and tasklet. + */ + DECLARE_KFIFO_PTR(txstatus_fifo, u32); +---- a/drivers/net/wireless/rt2x00/rt2x00dev.c +-+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c +-@@ -1334,6 +1334,10 @@ int rt2x00lib_probe_dev(struct rt2x00_de ++--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c ++@@ -1335,6 +1335,10 @@ int rt2x00lib_probe_dev(struct rt2x00_de + INIT_DELAYED_WORK(&rt2x00dev->autowakeup_work, rt2x00lib_autowakeup); + INIT_WORK(&rt2x00dev->sleep_work, rt2x00lib_sleep); + +@@ -138,7 +138,7 @@ + /* + * Let the driver probe the device to detect the capabilities. + */ +-@@ -1474,6 +1478,11 @@ void rt2x00lib_remove_dev(struct rt2x00_ ++@@ -1475,6 +1479,11 @@ void rt2x00lib_remove_dev(struct rt2x00_ + * Free the driver data. + */ + kfree(rt2x00dev->drv_data); +@@ -151,7 +151,7 @@ + EXPORT_SYMBOL_GPL(rt2x00lib_remove_dev); + + --- /dev/null +-+++ b/drivers/net/wireless/rt2x00/rt2x00eeprom.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c + @@ -0,0 +1,111 @@ + +/* + + Copyright (C) 2004 - 2009 Ivo van Doorn +@@ -264,8 +264,8 @@ + + release_firmware(rt2x00dev->eeprom_file); + + rt2x00dev->eeprom_file = NULL; + +} +---- a/drivers/net/wireless/rt2x00/rt2x00lib.h +-+++ b/drivers/net/wireless/rt2x00/rt2x00lib.h ++--- a/drivers/net/wireless/ralink/rt2x00/rt2x00lib.h +++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00lib.h + @@ -320,6 +320,22 @@ static inline void rt2x00lib_free_firmwa + #endif /* CPTCFG_RT2X00_LIB_FIRMWARE */ + +@@ -289,8 +289,8 @@ + * Debugfs handlers. + */ + #ifdef CPTCFG_RT2X00_LIB_DEBUGFS +---- a/drivers/net/wireless/rt2x00/rt2x00soc.c +-+++ b/drivers/net/wireless/rt2x00/rt2x00soc.c ++--- a/drivers/net/wireless/ralink/rt2x00/rt2x00soc.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00soc.c + @@ -92,6 +92,7 @@ int rt2x00soc_probe(struct platform_devi + rt2x00dev->hw = hw; + rt2x00dev->irq = platform_get_irq(pdev, 0); +diff --git a/package/kernel/mac80211/patches/604-rt2x00-of_load_eeprom_filename.patch b/package/kernel/mac80211/patches/604-rt2x00-of_load_eeprom_filename.patch +index 4bc6f37..9dffef1 100644 +--- a/package/kernel/mac80211/patches/604-rt2x00-of_load_eeprom_filename.patch ++++ b/package/kernel/mac80211/patches/604-rt2x00-of_load_eeprom_filename.patch +@@ -1,5 +1,5 @@ +---- a/drivers/net/wireless/rt2x00/rt2x00eeprom.c +-+++ b/drivers/net/wireless/rt2x00/rt2x00eeprom.c ++--- a/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c + @@ -26,6 +26,7 @@ + + #include +diff --git a/package/kernel/mac80211/patches/605-rt2x00-load-eeprom-on-SoC-from-a-mtd-device-defines-.patch b/package/kernel/mac80211/patches/605-rt2x00-load-eeprom-on-SoC-from-a-mtd-device-defines-.patch +index 75f0415..5dceff8 100644 +--- a/package/kernel/mac80211/patches/605-rt2x00-load-eeprom-on-SoC-from-a-mtd-device-defines-.patch ++++ b/package/kernel/mac80211/patches/605-rt2x00-load-eeprom-on-SoC-from-a-mtd-device-defines-.patch +@@ -6,12 +6,12 @@ Subject: [PATCH] rt2x00: load eeprom on SoC from a mtd device defines inside + + Signed-off-by: John Crispin + --- +- drivers/net/wireless/rt2x00/Kconfig | 1 + +- drivers/net/wireless/rt2x00/rt2800pci.c | 44 ++++++++++++++++++++++++++----- ++ drivers/net/wireless/ralink/rt2x00/Kconfig | 1 + ++ drivers/net/wireless/ralink/rt2x00/rt2800pci.c | 44 ++++++++++++++++++++++++++----- + 2 files changed, 39 insertions(+), 6 deletions(-) + +---- a/drivers/net/wireless/rt2x00/Kconfig +-+++ b/drivers/net/wireless/rt2x00/Kconfig ++--- a/drivers/net/wireless/ralink/rt2x00/Kconfig +++++ b/drivers/net/wireless/ralink/rt2x00/Kconfig + @@ -219,6 +219,7 @@ config RT2800SOC + select RT2X00_LIB_EEPROM + select RT2800_LIB +@@ -20,8 +20,8 @@ Signed-off-by: John Crispin + ---help--- + This adds support for Ralink WiSoC devices. + Supported chips: RT2880, RT3050, RT3052, RT3350, RT3352. +---- a/drivers/net/wireless/rt2x00/rt2x00eeprom.c +-+++ b/drivers/net/wireless/rt2x00/rt2x00eeprom.c ++--- a/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c + @@ -26,11 +26,66 @@ + + #include +@@ -79,7 +79,7 @@ Signed-off-by: John Crispin + + if (!ret) { + + rt2x00dev->eeprom_file = &mtd_fw; + + mtd_fw.size = len; +-+ mtd_fw.data = rt2x00dev->eeprom; +++ mtd_fw.data = (const u8 *) rt2x00dev->eeprom; + + } + +#endif + + +diff --git a/package/kernel/mac80211/patches/607-rt2x00-allow_disabling_bands_through_platform_data.patch b/package/kernel/mac80211/patches/607-rt2x00-allow_disabling_bands_through_platform_data.patch +index 70f7b78..d923e05 100644 +--- a/package/kernel/mac80211/patches/607-rt2x00-allow_disabling_bands_through_platform_data.patch ++++ b/package/kernel/mac80211/patches/607-rt2x00-allow_disabling_bands_through_platform_data.patch +@@ -10,8 +10,8 @@ + }; + + #endif /* _RT2X00_PLATFORM_H */ +---- a/drivers/net/wireless/rt2x00/rt2x00dev.c +-+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c ++--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c + @@ -940,6 +940,22 @@ static int rt2x00lib_probe_hw_modes(stru + unsigned int num_rates; + unsigned int i; +@@ -35,9 +35,9 @@ + num_rates = 0; + if (spec->supported_rates & SUPPORT_RATE_CCK) + num_rates += 4; +---- a/drivers/net/wireless/rt2x00/rt2x00.h +-+++ b/drivers/net/wireless/rt2x00/rt2x00.h +-@@ -403,6 +403,7 @@ struct hw_mode_spec { ++--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h +++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h ++@@ -405,6 +405,7 @@ struct hw_mode_spec { + unsigned int supported_bands; + #define SUPPORT_BAND_2GHZ 0x00000001 + #define SUPPORT_BAND_5GHZ 0x00000002 diff --git a/package/kernel/mac80211/patches/608-add_platform_data_mac_addr.patch b/package/kernel/mac80211/patches/608-add_platform_data_mac_addr.patch -index a35bd55..16a579d 100644 +index a35bd55..a645ba1 100644 --- a/package/kernel/mac80211/patches/608-add_platform_data_mac_addr.patch +++ b/package/kernel/mac80211/patches/608-add_platform_data_mac_addr.patch -@@ -41,7 +41,7 @@ +@@ -8,8 +8,8 @@ + + int disable_2ghz; + int disable_5ghz; +---- a/drivers/net/wireless/rt2x00/rt2x00dev.c +-+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c ++--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c + @@ -931,6 +931,18 @@ static void rt2x00lib_rate(struct ieee80 + entry->flags |= IEEE80211_RATE_SHORT_PREAMBLE; + } +@@ -29,9 +29,9 @@ + static int rt2x00lib_probe_hw_modes(struct rt2x00_dev *rt2x00dev, + struct hw_mode_spec *spec) + { +---- a/drivers/net/wireless/rt2x00/rt2x00.h +-+++ b/drivers/net/wireless/rt2x00/rt2x00.h +-@@ -1410,6 +1410,7 @@ static inline void rt2x00debug_dump_fram ++--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h +++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h ++@@ -1414,6 +1414,7 @@ static inline void rt2x00debug_dump_fram + */ + u32 rt2x00lib_get_bssidx(struct rt2x00_dev *rt2x00dev, + struct ieee80211_vif *vif); +@@ -39,8 +39,8 @@ + + /* * Interrupt context handlers. - --- a/drivers/net/wireless/rt2x00/rt61pci.c - +++ b/drivers/net/wireless/rt2x00/rt61pci.c --@@ -2392,6 +2392,7 @@ static int rt61pci_validate_eeprom(struc -+@@ -2390,6 +2390,7 @@ static int rt61pci_validate_eeprom(struc +---- a/drivers/net/wireless/rt2x00/rt61pci.c +-+++ b/drivers/net/wireless/rt2x00/rt61pci.c ++--- a/drivers/net/wireless/ralink/rt2x00/rt61pci.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt61pci.c + @@ -2392,6 +2392,7 @@ static int rt61pci_validate_eeprom(struc u32 reg; u16 word; - u8 *mac; -@@ -49,7 +49,7 @@ - s8 value; - - rt2x00mmio_register_read(rt2x00dev, E2PROM_CSR, ®); --@@ -2412,7 +2413,11 @@ static int rt61pci_validate_eeprom(struc -+@@ -2410,7 +2411,11 @@ static int rt61pci_validate_eeprom(struc - /* - * Start validation of the data that has been read. - */ +diff --git a/package/kernel/mac80211/patches/609-rt2x00-allow_disabling_bands_through_dts.patch b/package/kernel/mac80211/patches/609-rt2x00-allow_disabling_bands_through_dts.patch +index 63a8641..3fdaae7 100644 +--- a/package/kernel/mac80211/patches/609-rt2x00-allow_disabling_bands_through_dts.patch ++++ b/package/kernel/mac80211/patches/609-rt2x00-allow_disabling_bands_through_dts.patch +@@ -1,5 +1,5 @@ +---- a/drivers/net/wireless/rt2x00/rt2x00dev.c +-+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c ++--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c + @@ -26,6 +26,7 @@ + #include + #include diff --git a/package/kernel/mac80211/patches/610-rt2x00-fix-rt3352-ext-pa.patch b/package/kernel/mac80211/patches/610-rt2x00-fix-rt3352-ext-pa.patch -index 067d2ea..39b1ccc 100644 +index 067d2ea..c69d330 100644 --- a/package/kernel/mac80211/patches/610-rt2x00-fix-rt3352-ext-pa.patch +++ b/package/kernel/mac80211/patches/610-rt2x00-fix-rt3352-ext-pa.patch @@ -1,6 +1,6 @@ - --- a/drivers/net/wireless/rt2x00/rt2800lib.c - +++ b/drivers/net/wireless/rt2x00/rt2800lib.c +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c -@@ -3552,11 +3552,18 @@ static void rt2800_config_channel(struct -+@@ -3528,11 +3528,18 @@ static void rt2800_config_channel(struct ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++@@ -3529,11 +3529,18 @@ static void rt2800_config_channel(struct /* * Change BBP settings */ @@ -28940,7 +30458,7 @@ index 067d2ea..39b1ccc 100644 if (rf->channel > 14) { /* Disable CCK Packet detection on 5GHz */ -@@ -6618,6 +6625,12 @@ static void rt2800_init_rfcsr_3290(struc -+@@ -6594,6 +6601,12 @@ static void rt2800_init_rfcsr_3290(struc ++@@ -6595,6 +6602,12 @@ static void rt2800_init_rfcsr_3290(struc static void rt2800_init_rfcsr_3352(struct rt2x00_dev *rt2x00dev) { @@ -28949,7 +30467,7 @@ index 067d2ea..39b1ccc 100644 rt2800_rfcsr_write(rt2x00dev, 0, 0xf0); -@@ -6653,15 +6666,30 @@ static void rt2800_init_rfcsr_3352(struc -+@@ -6629,15 +6642,30 @@ static void rt2800_init_rfcsr_3352(struc ++@@ -6630,15 +6643,30 @@ static void rt2800_init_rfcsr_3352(struc rt2800_rfcsr_write(rt2x00dev, 31, 0x80); rt2800_rfcsr_write(rt2x00dev, 32, 0x80); rt2800_rfcsr_write(rt2x00dev, 33, 0x00); @@ -28958,7 +30476,7 @@ index 067d2ea..39b1ccc 100644 rt2800_rfcsr_write(rt2x00dev, 44, 0xdb); rt2800_rfcsr_write(rt2x00dev, 45, 0xdb); -@@ -6669,15 +6697,20 @@ static void rt2800_init_rfcsr_3352(struc -+@@ -6645,15 +6673,20 @@ static void rt2800_init_rfcsr_3352(struc ++@@ -6646,15 +6674,20 @@ static void rt2800_init_rfcsr_3352(struc rt2800_rfcsr_write(rt2x00dev, 47, 0x0d); rt2800_rfcsr_write(rt2x00dev, 48, 0x14); rt2800_rfcsr_write(rt2x00dev, 49, 0x00); @@ -28967,7 +30485,7 @@ index 067d2ea..39b1ccc 100644 rt2800_rfcsr_write(rt2x00dev, 60, 0x00); rt2800_rfcsr_write(rt2x00dev, 61, 0x00); -@@ -7698,6 +7731,7 @@ static int rt2800_init_eeprom(struct rt2 -+@@ -7674,6 +7707,7 @@ static int rt2800_init_eeprom(struct rt2 ++@@ -7675,6 +7708,7 @@ static int rt2800_init_eeprom(struct rt2 * RT53xx: defined in "EEPROM_CHIP_ID" field */ if (rt2x00_rt(rt2x00dev, RT3290) || @@ -28976,7 +30494,7 @@ index 067d2ea..39b1ccc 100644 rt2x00_rt(rt2x00dev, RT5392)) rt2800_eeprom_read(rt2x00dev, EEPROM_CHIP_ID, &rf); -@@ -7793,7 +7827,8 @@ static int rt2800_init_eeprom(struct rt2 -+@@ -7769,7 +7803,8 @@ static int rt2800_init_eeprom(struct rt2 ++@@ -7770,7 +7804,8 @@ static int rt2800_init_eeprom(struct rt2 /* * Detect if this device has Bluetooth co-existence. */ @@ -28985,19 +30503,45 @@ index 067d2ea..39b1ccc 100644 /* -@@ -7822,6 +7857,22 @@ static int rt2800_init_eeprom(struct rt2 -+@@ -7798,6 +7833,22 @@ static int rt2800_init_eeprom(struct rt2 ++@@ -7799,6 +7834,22 @@ static int rt2800_init_eeprom(struct rt2 EIRP_MAX_TX_POWER_LIMIT) __set_bit(CAPABILITY_POWER_LIMIT, &rt2x00dev->cap_flags); +@@ -137,8 +137,8 @@ + return 0; + } + +---- a/drivers/net/wireless/rt2x00/rt2800.h +-+++ b/drivers/net/wireless/rt2x00/rt2800.h ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800.h +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800.h + @@ -2335,6 +2335,12 @@ struct mac_iveiv_entry { + #define RFCSR36_RF_BS FIELD8(0x80) + +@@ -198,9 +198,9 @@ + + /* + * EEPROM frequency +---- a/drivers/net/wireless/rt2x00/rt2x00.h +-+++ b/drivers/net/wireless/rt2x00/rt2x00.h +-@@ -715,6 +715,8 @@ enum rt2x00_capability_flags { ++--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h +++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h ++@@ -717,6 +717,8 @@ enum rt2x00_capability_flags { + CAPABILITY_DOUBLE_ANTENNA, + CAPABILITY_BT_COEXIST, + CAPABILITY_VCO_RECALIBRATION, diff --git a/package/kernel/mac80211/patches/611-rt2x00-rf_vals-rt3352-xtal20.patch b/package/kernel/mac80211/patches/611-rt2x00-rf_vals-rt3352-xtal20.patch -index 1dcca36..dcecba4 100644 +index 1dcca36..b44fe90 100644 --- a/package/kernel/mac80211/patches/611-rt2x00-rf_vals-rt3352-xtal20.patch +++ b/package/kernel/mac80211/patches/611-rt2x00-rf_vals-rt3352-xtal20.patch @@ -1,6 +1,6 @@ - --- a/drivers/net/wireless/rt2x00/rt2800lib.c - +++ b/drivers/net/wireless/rt2x00/rt2800lib.c +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c -@@ -8209,6 +8209,27 @@ static const struct rf_channel rf_vals_5 -+@@ -8185,6 +8185,27 @@ static const struct rf_channel rf_vals_5 ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++@@ -8186,6 +8186,27 @@ static const struct rf_channel rf_vals_5 {196, 83, 0, 12, 1}, }; @@ -29006,7 +30550,7 @@ index 1dcca36..dcecba4 100644 { struct hw_mode_spec *spec = &rt2x00dev->spec; -@@ -8297,7 +8318,10 @@ static int rt2800_probe_hw_mode(struct r -+@@ -8271,7 +8292,10 @@ static int rt2800_probe_hw_mode(struct r ++@@ -8272,7 +8293,10 @@ static int rt2800_probe_hw_mode(struct r case RF5390: case RF5392: spec->num_channels = 14; @@ -29015,7 +30559,7 @@ index 1dcca36..dcecba4 100644 case RF3052: -@@ -8481,6 +8505,19 @@ static int rt2800_probe_rt(struct rt2x00 -+@@ -8455,6 +8479,19 @@ static int rt2800_probe_rt(struct rt2x00 ++@@ -8456,6 +8480,19 @@ static int rt2800_probe_rt(struct rt2x00 return 0; } @@ -29024,33 +30568,94 @@ index 1dcca36..dcecba4 100644 { struct rt2800_drv_data *drv_data = rt2x00dev->drv_data; -@@ -8523,6 +8560,15 @@ int rt2800_probe_hw(struct rt2x00_dev *r -+@@ -8497,6 +8534,15 @@ int rt2800_probe_hw(struct rt2x00_dev *r ++@@ -8498,6 +8535,15 @@ int rt2800_probe_hw(struct rt2x00_dev *r rt2800_register_write(rt2x00dev, GPIO_CTRL, reg); /* +@@ -76,9 +76,9 @@ + * Initialize hw specifications. + */ + retval = rt2800_probe_hw_mode(rt2x00dev); +---- a/drivers/net/wireless/rt2x00/rt2x00.h +-+++ b/drivers/net/wireless/rt2x00/rt2x00.h +-@@ -398,6 +398,7 @@ static inline struct rt2x00_intf* vif_to ++--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h +++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h ++@@ -400,6 +400,7 @@ static inline struct rt2x00_intf* vif_to + * @channels: Device/chipset specific channel values (See &struct rf_channel). + * @channels_info: Additional information for channels (See &struct channel_info). + * @ht: Driver HT Capabilities (See &ieee80211_sta_ht_cap). +@@ -86,7 +86,7 @@ + */ + struct hw_mode_spec { + unsigned int supported_bands; +-@@ -414,6 +415,7 @@ struct hw_mode_spec { ++@@ -416,6 +417,7 @@ struct hw_mode_spec { + const struct channel_info *channels_info; + + struct ieee80211_sta_ht_cap ht; +diff --git a/package/kernel/mac80211/patches/612-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch b/package/kernel/mac80211/patches/612-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch +index 1970efc..e4b028b 100644 +--- a/package/kernel/mac80211/patches/612-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch ++++ b/package/kernel/mac80211/patches/612-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch +@@ -8,11 +8,11 @@ devicetree. + + Signed-off-by: John Crispin + --- +- drivers/net/wireless/rt2x00/rt2800pci.c | 7 +++++++ ++ drivers/net/wireless/ralink/rt2x00/rt2800pci.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +---- a/drivers/net/wireless/rt2x00/rt2800soc.c +-+++ b/drivers/net/wireless/rt2x00/rt2800soc.c ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800soc.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800soc.c + @@ -237,10 +237,17 @@ static int rt2800soc_probe(struct platfo + return rt2x00soc_probe(pdev, &rt2800soc_ops); + } diff --git a/package/kernel/mac80211/patches/615-rt2x00-fix_20mhz_clk.patch b/package/kernel/mac80211/patches/615-rt2x00-fix_20mhz_clk.patch -index c779a17..9f11862 100644 +index c779a17..8e3bd2a 100644 --- a/package/kernel/mac80211/patches/615-rt2x00-fix_20mhz_clk.patch +++ b/package/kernel/mac80211/patches/615-rt2x00-fix_20mhz_clk.patch +@@ -1,5 +1,5 @@ +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c + @@ -36,6 +36,7 @@ + #include + #include @@ -8,7 +8,7 @@ #include "rt2x00.h" #include "rt2800lib.h" -@@ -8507,13 +8508,14 @@ static int rt2800_probe_rt(struct rt2x00 -+@@ -8481,13 +8482,14 @@ static int rt2800_probe_rt(struct rt2x00 ++@@ -8482,13 +8483,14 @@ static int rt2800_probe_rt(struct rt2x00 int rt2800_probe_clk(struct rt2x00_dev *rt2x00dev) { diff --git a/package/kernel/mac80211/patches/616-rt2x00-support-rt5350.patch b/package/kernel/mac80211/patches/616-rt2x00-support-rt5350.patch -index 840b3bc..9679d71 100644 +index 840b3bc..faa5879 100644 --- a/package/kernel/mac80211/patches/616-rt2x00-support-rt5350.patch +++ b/package/kernel/mac80211/patches/616-rt2x00-support-rt5350.patch -@@ -10,7 +10,7 @@ +@@ -1,5 +1,5 @@ +---- a/drivers/net/wireless/rt2x00/rt2800.h +-+++ b/drivers/net/wireless/rt2x00/rt2800.h ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800.h +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800.h + @@ -74,6 +74,7 @@ + #define RF3070 0x3070 + #define RF3290 0x3290 +@@ -8,9 +8,9 @@ + #define RF5360 0x5360 + #define RF5362 0x5362 #define RF5370 0x5370 - --- a/drivers/net/wireless/rt2x00/rt2800lib.c - +++ b/drivers/net/wireless/rt2x00/rt2800lib.c +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c -@@ -3038,6 +3038,13 @@ static void rt2800_config_channel_rf53xx -+@@ -3014,6 +3014,13 @@ static void rt2800_config_channel_rf53xx ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++@@ -3015,6 +3015,13 @@ static void rt2800_config_channel_rf53xx rt2800_rfcsr_write(rt2x00dev, 59, r59_non_bt[idx]); @@ -29059,7 +30664,7 @@ index 840b3bc..9679d71 100644 } } -@@ -3516,6 +3523,7 @@ static void rt2800_config_channel(struct -+@@ -3492,6 +3499,7 @@ static void rt2800_config_channel(struct ++@@ -3493,6 +3500,7 @@ static void rt2800_config_channel(struct rt2800_config_channel_rf3853(rt2x00dev, conf, rf, info); break; case RF3070: @@ -29068,7 +30673,7 @@ index 840b3bc..9679d71 100644 case RF5362: case RF5370: -@@ -3534,6 +3542,7 @@ static void rt2800_config_channel(struct -+@@ -3510,6 +3518,7 @@ static void rt2800_config_channel(struct ++@@ -3511,6 +3519,7 @@ static void rt2800_config_channel(struct if (rt2x00_rf(rt2x00dev, RF3070) || rt2x00_rf(rt2x00dev, RF3290) || rt2x00_rf(rt2x00dev, RF3322) || @@ -29077,7 +30682,7 @@ index 840b3bc..9679d71 100644 rt2x00_rf(rt2x00dev, RF5362) || rt2x00_rf(rt2x00dev, RF5370) || -@@ -3812,7 +3821,8 @@ static void rt2800_config_channel(struct -+@@ -3788,7 +3797,8 @@ static void rt2800_config_channel(struct ++@@ -3789,7 +3798,8 @@ static void rt2800_config_channel(struct /* * Clear update flag */ @@ -29086,7 +30691,7 @@ index 840b3bc..9679d71 100644 rt2x00_set_field8(&bbp, BBP49_UPDATE_FLAG, 0); rt2800_bbp_write(rt2x00dev, 49, bbp); -@@ -4698,6 +4708,7 @@ void rt2800_vco_calibration(struct rt2x0 -+@@ -4674,6 +4684,7 @@ void rt2800_vco_calibration(struct rt2x0 ++@@ -4675,6 +4685,7 @@ void rt2800_vco_calibration(struct rt2x0 case RF3070: case RF3290: case RF3853: @@ -29095,7 +30700,7 @@ index 840b3bc..9679d71 100644 case RF5362: case RF5370: -@@ -5111,6 +5122,8 @@ static int rt2800_init_registers(struct -+@@ -5087,6 +5098,8 @@ static int rt2800_init_registers(struct ++@@ -5088,6 +5099,8 @@ static int rt2800_init_registers(struct rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000404); rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00080606); rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00000000); @@ -29104,7 +30709,7 @@ index 840b3bc..9679d71 100644 rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000000); rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00080606); -@@ -5766,9 +5779,13 @@ static void rt2800_init_bbp_3352(struct -+@@ -5742,9 +5755,13 @@ static void rt2800_init_bbp_3352(struct ++@@ -5743,9 +5756,13 @@ static void rt2800_init_bbp_3352(struct rt2800_bbp_write(rt2x00dev, 82, 0x62); @@ -29113,7 +30718,7 @@ index 840b3bc..9679d71 100644 rt2800_bbp_write(rt2x00dev, 86, 0x38); -@@ -5782,9 +5799,13 @@ static void rt2800_init_bbp_3352(struct -+@@ -5758,9 +5775,13 @@ static void rt2800_init_bbp_3352(struct ++@@ -5759,9 +5776,13 @@ static void rt2800_init_bbp_3352(struct rt2800_bbp_write(rt2x00dev, 104, 0x92); @@ -29122,7 +30727,7 @@ index 840b3bc..9679d71 100644 rt2800_bbp_write(rt2x00dev, 120, 0x50); -@@ -5809,6 +5830,13 @@ static void rt2800_init_bbp_3352(struct -+@@ -5785,6 +5806,13 @@ static void rt2800_init_bbp_3352(struct ++@@ -5786,6 +5807,13 @@ static void rt2800_init_bbp_3352(struct rt2800_bbp_write(rt2x00dev, 143, 0xa2); rt2800_bbp_write(rt2x00dev, 148, 0xc8); @@ -29131,7 +30736,7 @@ index 840b3bc..9679d71 100644 static void rt2800_init_bbp_3390(struct rt2x00_dev *rt2x00dev) -@@ -6150,6 +6178,7 @@ static void rt2800_init_bbp(struct rt2x0 -+@@ -6126,6 +6154,7 @@ static void rt2800_init_bbp(struct rt2x0 ++@@ -6127,6 +6155,7 @@ static void rt2800_init_bbp(struct rt2x0 rt2800_init_bbp_3290(rt2x00dev); break; case RT3352: @@ -29140,7 +30745,7 @@ index 840b3bc..9679d71 100644 break; case RT3390: -@@ -7101,6 +7130,76 @@ static void rt2800_init_rfcsr_3883(struc -+@@ -7077,6 +7106,76 @@ static void rt2800_init_rfcsr_3883(struc ++@@ -7078,6 +7107,76 @@ static void rt2800_init_rfcsr_3883(struc rt2800_rfcsr_write(rt2x00dev, 20, rfcsr); } @@ -29149,7 +30754,7 @@ index 840b3bc..9679d71 100644 { rt2800_rf_init_calibration(rt2x00dev, 2); -@@ -7341,6 +7440,9 @@ static void rt2800_init_rfcsr(struct rt2 -+@@ -7317,6 +7416,9 @@ static void rt2800_init_rfcsr(struct rt2 ++@@ -7318,6 +7417,9 @@ static void rt2800_init_rfcsr(struct rt2 case RT3593: rt2800_init_rfcsr_3593(rt2x00dev); break; @@ -29158,7 +30763,7 @@ index 840b3bc..9679d71 100644 rt2800_init_rfcsr_5390(rt2x00dev); break; -@@ -7600,6 +7702,12 @@ static int rt2800_validate_eeprom(struct -+@@ -7576,6 +7678,12 @@ static int rt2800_validate_eeprom(struct ++@@ -7577,6 +7679,12 @@ static int rt2800_validate_eeprom(struct rt2x00_set_field16(&word, EEPROM_NIC_CONF0_RF_TYPE, RF2820); rt2800_eeprom_write(rt2x00dev, EEPROM_NIC_CONF0, word); rt2x00_eeprom_dbg(rt2x00dev, "Antenna: 0x%04x\n", word); @@ -29167,7 +30772,7 @@ index 840b3bc..9679d71 100644 rt2x00_rt(rt2x00dev, RT2872)) { /* -@@ -7738,6 +7846,8 @@ static int rt2800_init_eeprom(struct rt2 -+@@ -7714,6 +7822,8 @@ static int rt2800_init_eeprom(struct rt2 ++@@ -7715,6 +7823,8 @@ static int rt2800_init_eeprom(struct rt2 rt2800_eeprom_read(rt2x00dev, EEPROM_CHIP_ID, &rf); else if (rt2x00_rt(rt2x00dev, RT3883)) rf = RF3853; @@ -29176,7 +30781,7 @@ index 840b3bc..9679d71 100644 rf = rt2x00_get_field16(eeprom, EEPROM_NIC_CONF0_RF_TYPE); -@@ -7757,6 +7867,7 @@ static int rt2800_init_eeprom(struct rt2 -+@@ -7733,6 +7843,7 @@ static int rt2800_init_eeprom(struct rt2 ++@@ -7734,6 +7844,7 @@ static int rt2800_init_eeprom(struct rt2 case RF3320: case RF3322: case RF3853: @@ -29185,7 +30790,7 @@ index 840b3bc..9679d71 100644 case RF5362: case RF5370: -@@ -8312,6 +8423,7 @@ static int rt2800_probe_hw_mode(struct r -+@@ -8286,6 +8397,7 @@ static int rt2800_probe_hw_mode(struct r ++@@ -8287,6 +8398,7 @@ static int rt2800_probe_hw_mode(struct r case RF3290: case RF3320: case RF3322: @@ -29194,7 +30799,7 @@ index 840b3bc..9679d71 100644 case RF5362: case RF5370: -@@ -8451,6 +8563,7 @@ static int rt2800_probe_hw_mode(struct r -+@@ -8425,6 +8537,7 @@ static int rt2800_probe_hw_mode(struct r ++@@ -8426,6 +8538,7 @@ static int rt2800_probe_hw_mode(struct r case RF3070: case RF3290: case RF3853: @@ -29203,76 +30808,315 @@ index 840b3bc..9679d71 100644 case RF5362: case RF5370: -@@ -8491,6 +8604,7 @@ static int rt2800_probe_rt(struct rt2x00 -+@@ -8465,6 +8578,7 @@ static int rt2800_probe_rt(struct rt2x00 ++@@ -8466,6 +8579,7 @@ static int rt2800_probe_rt(struct rt2x00 case RT3572: case RT3593: case RT3883: +@@ -264,8 +264,8 @@ + case RT5390: + case RT5392: + case RT5592: +---- a/drivers/net/wireless/rt2x00/rt2x00.h +-+++ b/drivers/net/wireless/rt2x00/rt2x00.h ++--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h +++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h + @@ -169,6 +169,7 @@ struct rt2x00_chip { + #define RT3572 0x3572 + #define RT3593 0x3593 diff --git a/package/kernel/mac80211/patches/619-rt2x00-change-led-polarity-from-OF.patch b/package/kernel/mac80211/patches/619-rt2x00-change-led-polarity-from-OF.patch -index 13f2048..b085c5e 100644 +index 13f2048..6094a61 100644 --- a/package/kernel/mac80211/patches/619-rt2x00-change-led-polarity-from-OF.patch +++ b/package/kernel/mac80211/patches/619-rt2x00-change-led-polarity-from-OF.patch +@@ -1,5 +1,5 @@ +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c + @@ -37,6 +37,7 @@ + #include + #include @@ -8,7 +8,7 @@ #include "rt2x00.h" #include "rt2800lib.h" -@@ -7957,6 +7958,17 @@ static int rt2800_init_eeprom(struct rt2 -+@@ -7933,6 +7934,17 @@ static int rt2800_init_eeprom(struct rt2 ++@@ -7934,6 +7935,17 @@ static int rt2800_init_eeprom(struct rt2 rt2800_init_led(rt2x00dev, &rt2x00dev->led_assoc, LED_TYPE_ASSOC); rt2800_init_led(rt2x00dev, &rt2x00dev->led_qual, LED_TYPE_QUALITY); +@@ -26,8 +26,8 @@ + rt2x00dev->led_mcu_reg = eeprom; + #endif /* CPTCFG_RT2X00_LIB_LEDS */ + +---- a/drivers/net/wireless/rt2x00/rt2x00leds.c +-+++ b/drivers/net/wireless/rt2x00/rt2x00leds.c ++--- a/drivers/net/wireless/ralink/rt2x00/rt2x00leds.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00leds.c + @@ -109,6 +109,9 @@ static int rt2x00leds_register_led(struc + led->led_dev.name = name; + led->led_dev.brightness = LED_OFF; +diff --git a/package/kernel/mac80211/patches/620-rt2x00-add-AP+STA-support.patch b/package/kernel/mac80211/patches/620-rt2x00-add-AP+STA-support.patch +index 2dbfd10..55452b9 100644 +--- a/package/kernel/mac80211/patches/620-rt2x00-add-AP+STA-support.patch ++++ b/package/kernel/mac80211/patches/620-rt2x00-add-AP+STA-support.patch +@@ -1,6 +1,6 @@ +---- a/drivers/net/wireless/rt2x00/rt2x00dev.c +-+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c +-@@ -1283,7 +1283,7 @@ static inline void rt2x00lib_set_if_comb ++--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c ++@@ -1284,7 +1284,7 @@ static inline void rt2x00lib_set_if_comb + */ + if_limit = &rt2x00dev->if_limits_ap; + if_limit->max = rt2x00dev->ops->max_ap_intf; diff --git a/package/kernel/mac80211/patches/620-rt2x00-rt3352-rf-id.patch b/package/kernel/mac80211/patches/620-rt2x00-rt3352-rf-id.patch -index aaa8367..259cb1f 100644 +index aaa8367..8ddf425 100644 --- a/package/kernel/mac80211/patches/620-rt2x00-rt3352-rf-id.patch +++ b/package/kernel/mac80211/patches/620-rt2x00-rt3352-rf-id.patch @@ -1,6 +1,6 @@ - --- a/drivers/net/wireless/rt2x00/rt2800lib.c - +++ b/drivers/net/wireless/rt2x00/rt2800lib.c +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c -@@ -7841,10 +7841,11 @@ static int rt2800_init_eeprom(struct rt2 -+@@ -7817,10 +7817,11 @@ static int rt2800_init_eeprom(struct rt2 ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++@@ -7818,10 +7818,11 @@ static int rt2800_init_eeprom(struct rt2 * RT53xx: defined in "EEPROM_CHIP_ID" field */ if (rt2x00_rt(rt2x00dev, RT3290) || diff --git a/package/kernel/mac80211/patches/621-rt2x00-ht20_40_fix.patch b/package/kernel/mac80211/patches/621-rt2x00-ht20_40_fix.patch -index bb2fc1c..77d63fe 100644 +index bb2fc1c..e3e4c98 100644 --- a/package/kernel/mac80211/patches/621-rt2x00-ht20_40_fix.patch +++ b/package/kernel/mac80211/patches/621-rt2x00-ht20_40_fix.patch -@@ -11,7 +11,7 @@ +@@ -1,5 +1,5 @@ +---- a/drivers/net/wireless/rt2x00/rt2800.h +-+++ b/drivers/net/wireless/rt2x00/rt2800.h ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800.h +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800.h + @@ -2321,6 +2321,8 @@ struct mac_iveiv_entry { + #define RFCSR30_RX_H20M FIELD8(0x04) + #define RFCSR30_RX_VCM FIELD8(0x18) +@@ -9,9 +9,9 @@ + + /* * RFCSR 31: - --- a/drivers/net/wireless/rt2x00/rt2800lib.c - +++ b/drivers/net/wireless/rt2x00/rt2800lib.c +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c -@@ -3551,8 +3551,13 @@ static void rt2800_config_channel(struct -+@@ -3527,8 +3527,13 @@ static void rt2800_config_channel(struct ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++@@ -3528,8 +3528,13 @@ static void rt2800_config_channel(struct rt2x00_rf(rt2x00dev, RF5390) || rt2x00_rf(rt2x00dev, RF5392)) { rt2800_rfcsr_read(rt2x00dev, 30, &rfcsr); +diff --git a/package/kernel/mac80211/patches/622-rt2x00-fix-beacon-bit-balance.patch b/package/kernel/mac80211/patches/622-rt2x00-fix-beacon-bit-balance.patch +new file mode 100644 +index 0000000..3cf6268 +--- /dev/null ++++ b/package/kernel/mac80211/patches/622-rt2x00-fix-beacon-bit-balance.patch +@@ -0,0 +1,47 @@ ++--- a/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c ++@@ -627,12 +627,8 @@ void rt2x00mac_bss_info_changed(struct i ++ } else if (bss_conf->enable_beacon && !intf->enable_beacon) { ++ rt2x00dev->intf_beaconing++; ++ intf->enable_beacon = true; ++- /* ++- * Upload beacon to the H/W. This is only required on ++- * USB devices. PCI devices fetch beacons periodically. ++- */ ++- if (rt2x00_is_usb(rt2x00dev)) ++- rt2x00queue_update_beacon(rt2x00dev, vif); +++ +++ rt2x00queue_update_beacon(rt2x00dev, vif); ++ ++ if (rt2x00dev->intf_beaconing == 1) { ++ /* ++--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c ++@@ -144,7 +144,8 @@ static void rt2x00lib_intf_scheduled_ite ++ ++ if (test_and_clear_bit(DELAYED_UPDATE_BEACON, &intf->delayed_flags)) { ++ mutex_lock(&intf->beacon_skb_mutex); ++- rt2x00queue_update_beacon(rt2x00dev, vif); +++ if (intf->enable_beacon) +++ rt2x00queue_update_beacon(rt2x00dev, vif); ++ mutex_unlock(&intf->beacon_skb_mutex); ++ } ++ } ++@@ -207,6 +208,7 @@ static void rt2x00lib_beaconupdate_iter( ++ struct ieee80211_vif *vif) ++ { ++ struct rt2x00_dev *rt2x00dev = data; +++ struct rt2x00_intf *intf = vif_to_intf(vif); ++ ++ if (vif->type != NL80211_IFTYPE_AP && ++ vif->type != NL80211_IFTYPE_ADHOC && ++@@ -220,7 +222,8 @@ static void rt2x00lib_beaconupdate_iter( ++ * never be called for USB devices. ++ */ ++ WARN_ON(rt2x00_is_usb(rt2x00dev)); ++- rt2x00queue_update_beacon(rt2x00dev, vif); +++ if (intf->enable_beacon) +++ rt2x00queue_update_beacon(rt2x00dev, vif); ++ } ++ ++ void rt2x00lib_beacondone(struct rt2x00_dev *rt2x00dev) +diff --git a/package/kernel/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch b/package/kernel/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch +index f2a7663..a901a44 100644 +--- a/package/kernel/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch ++++ b/package/kernel/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch +@@ -1,6 +1,6 @@ +---- a/drivers/net/wireless/mwl8k.c +-+++ b/drivers/net/wireless/mwl8k.c +-@@ -5678,6 +5678,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw") ++--- a/drivers/net/wireless/marvell/mwl8k.c +++++ b/drivers/net/wireless/marvell/mwl8k.c ++@@ -5681,6 +5681,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw") + MODULE_FIRMWARE(MWL8K_8366_AP_FW(MWL8K_8366_AP_FW_API)); + + static const struct pci_device_id mwl8k_pci_id_table[] = { diff --git a/package/kernel/mac80211/patches/801-libertas-configure-sysfs-links.patch b/package/kernel/mac80211/patches/801-libertas-configure-sysfs-links.patch -index 9e29034..3b8b756 100644 +index 9e29034..fd885cc 100644 --- a/package/kernel/mac80211/patches/801-libertas-configure-sysfs-links.patch +++ b/package/kernel/mac80211/patches/801-libertas-configure-sysfs-links.patch -@@ -1,6 +1,6 @@ - --- a/drivers/net/wireless/libertas/cfg.c - +++ b/drivers/net/wireless/libertas/cfg.c --@@ -2084,6 +2084,8 @@ struct wireless_dev *lbs_cfg_alloc(struc -+@@ -2083,6 +2083,8 @@ struct wireless_dev *lbs_cfg_alloc(struc +@@ -1,5 +1,5 @@ +---- a/drivers/net/wireless/libertas/cfg.c +-+++ b/drivers/net/wireless/libertas/cfg.c ++--- a/drivers/net/wireless/marvell/libertas/cfg.c +++++ b/drivers/net/wireless/marvell/libertas/cfg.c + @@ -2084,6 +2084,8 @@ struct wireless_dev *lbs_cfg_alloc(struc goto err_wiphy_new; } +@@ -9,8 +9,8 @@ + lbs_deb_leave(LBS_DEB_CFG80211); + return wdev; +---- a/drivers/net/wireless/libertas/main.c +-+++ b/drivers/net/wireless/libertas/main.c ++--- a/drivers/net/wireless/marvell/libertas/main.c +++++ b/drivers/net/wireless/marvell/libertas/main.c + @@ -987,6 +987,7 @@ struct lbs_private *lbs_add_card(void *c + goto err_adapter; + } diff --git a/package/kernel/mac80211/patches/802-libertas-set-wireless-macaddr.patch b/package/kernel/mac80211/patches/802-libertas-set-wireless-macaddr.patch -index 252fa81..dace56b 100644 +index 252fa81..b67a95f 100644 --- a/package/kernel/mac80211/patches/802-libertas-set-wireless-macaddr.patch +++ b/package/kernel/mac80211/patches/802-libertas-set-wireless-macaddr.patch -@@ -1,6 +1,6 @@ - --- a/drivers/net/wireless/libertas/cfg.c - +++ b/drivers/net/wireless/libertas/cfg.c --@@ -2174,6 +2174,8 @@ int lbs_cfg_register(struct lbs_private -+@@ -2173,6 +2173,8 @@ int lbs_cfg_register(struct lbs_private +@@ -1,5 +1,5 @@ +---- a/drivers/net/wireless/libertas/cfg.c +-+++ b/drivers/net/wireless/libertas/cfg.c ++--- a/drivers/net/wireless/marvell/libertas/cfg.c +++++ b/drivers/net/wireless/marvell/libertas/cfg.c + @@ -2174,6 +2174,8 @@ int lbs_cfg_register(struct lbs_private wdev->wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites); wdev->wiphy->reg_notifier = lbs_reg_notifier; +diff --git a/package/kernel/mac80211/patches/804-b43-sync-with-bcma.patch b/package/kernel/mac80211/patches/804-b43-sync-with-bcma.patch +new file mode 100644 +index 0000000..74cd448 +--- /dev/null ++++ b/package/kernel/mac80211/patches/804-b43-sync-with-bcma.patch +@@ -0,0 +1,17 @@ ++--- a/drivers/net/wireless/broadcom/b43/main.c +++++ b/drivers/net/wireless/broadcom/b43/main.c ++@@ -1215,10 +1215,10 @@ void b43_wireless_core_phy_pll_reset(str ++ case B43_BUS_BCMA: ++ bcma_cc = &dev->dev->bdev->bus->drv_cc; ++ ++- bcma_cc_write32(bcma_cc, BCMA_CC_CHIPCTL_ADDR, 0); ++- bcma_cc_mask32(bcma_cc, BCMA_CC_CHIPCTL_DATA, ~0x4); ++- bcma_cc_set32(bcma_cc, BCMA_CC_CHIPCTL_DATA, 0x4); ++- bcma_cc_mask32(bcma_cc, BCMA_CC_CHIPCTL_DATA, ~0x4); +++ bcma_cc_write32(bcma_cc, BCMA_CC_PMU_CHIPCTL_ADDR, 0); +++ bcma_cc_mask32(bcma_cc, BCMA_CC_PMU_CHIPCTL_DATA, ~0x4); +++ bcma_cc_set32(bcma_cc, BCMA_CC_PMU_CHIPCTL_DATA, 0x4); +++ bcma_cc_mask32(bcma_cc, BCMA_CC_PMU_CHIPCTL_DATA, ~0x4); ++ break; ++ #endif ++ #ifdef CPTCFG_B43_SSB +diff --git a/package/kernel/mac80211/patches/805-b43-gpio-mask-module-option.patch b/package/kernel/mac80211/patches/805-b43-gpio-mask-module-option.patch +index 95867ef..fd9e6fd 100644 +--- a/package/kernel/mac80211/patches/805-b43-gpio-mask-module-option.patch ++++ b/package/kernel/mac80211/patches/805-b43-gpio-mask-module-option.patch +@@ -1,5 +1,5 @@ +---- a/drivers/net/wireless/b43/b43.h +-+++ b/drivers/net/wireless/b43/b43.h ++--- a/drivers/net/wireless/broadcom/b43/b43.h +++++ b/drivers/net/wireless/broadcom/b43/b43.h + @@ -839,6 +839,7 @@ struct b43_wldev { + bool qos_enabled; /* TRUE, if QoS is used. */ + bool hwcrypto_enabled; /* TRUE, if HW crypto acceleration is enabled. */ +@@ -8,9 +8,9 @@ + /* PHY/Radio device. */ + struct b43_phy phy; +---- a/drivers/net/wireless/b43/main.c +-+++ b/drivers/net/wireless/b43/main.c +-@@ -76,6 +76,11 @@ MODULE_FIRMWARE("b43/ucode16_mimo.fw"); ++--- a/drivers/net/wireless/broadcom/b43/main.c +++++ b/drivers/net/wireless/broadcom/b43/main.c ++@@ -75,6 +75,11 @@ MODULE_FIRMWARE("b43/ucode16_mimo.fw"); + MODULE_FIRMWARE("b43/ucode5.fw"); + MODULE_FIRMWARE("b43/ucode9.fw"); + +diff --git a/package/kernel/mac80211/patches/810-b43_no_pio.patch b/package/kernel/mac80211/patches/810-b43_no_pio.patch +index 0979100..79428c2 100644 +--- a/package/kernel/mac80211/patches/810-b43_no_pio.patch ++++ b/package/kernel/mac80211/patches/810-b43_no_pio.patch +@@ -1,5 +1,5 @@ +---- a/drivers/net/wireless/b43/Makefile +-+++ b/drivers/net/wireless/b43/Makefile ++--- a/drivers/net/wireless/broadcom/b43/Makefile +++++ b/drivers/net/wireless/broadcom/b43/Makefile + @@ -17,7 +17,7 @@ b43-$(CPTCFG_B43_PHY_AC) += phy_ac.o + b43-y += sysfs.o + b43-y += xmit.o +@@ -9,8 +9,8 @@ + b43-y += rfkill.o + b43-y += ppr.o + b43-$(CPTCFG_B43_LEDS) += leds.o +---- a/drivers/net/wireless/b43/main.c +-+++ b/drivers/net/wireless/b43/main.c ++--- a/drivers/net/wireless/broadcom/b43/main.c +++++ b/drivers/net/wireless/broadcom/b43/main.c + @@ -2008,10 +2008,12 @@ static void b43_do_interrupt_thread(stru + dma_reason[0], dma_reason[1], + dma_reason[2], dma_reason[3], +@@ -24,8 +24,8 @@ + b43_controller_restart(dev, "DMA error"); + return; + } +---- a/drivers/net/wireless/b43/pio.h +-+++ b/drivers/net/wireless/b43/pio.h ++--- a/drivers/net/wireless/broadcom/b43/pio.h +++++ b/drivers/net/wireless/broadcom/b43/pio.h + @@ -150,7 +150,7 @@ static inline void b43_piorx_write32(str + b43_write32(q->dev, q->mmio_base + offset, value); + } +@@ -73,9 +73,9 @@ + +#endif /* CPTCFG_B43_PIO */ + + #endif /* B43_PIO_H_ */ +---- a/drivers/net/wireless/b43/Kconfig +-+++ b/drivers/net/wireless/b43/Kconfig +-@@ -118,7 +118,7 @@ config B43_BCMA_PIO ++--- a/drivers/net/wireless/broadcom/b43/Kconfig +++++ b/drivers/net/wireless/broadcom/b43/Kconfig ++@@ -98,7 +98,7 @@ config B43_BCMA_PIO + default y + + config B43_PIO diff --git a/package/kernel/mac80211/patches/820-b43-add-antenna-control.patch b/package/kernel/mac80211/patches/820-b43-add-antenna-control.patch -index ac58dba..dd82ce5 100644 +index ac58dba..06c731f 100644 --- a/package/kernel/mac80211/patches/820-b43-add-antenna-control.patch +++ b/package/kernel/mac80211/patches/820-b43-add-antenna-control.patch +@@ -1,5 +1,5 @@ +---- a/drivers/net/wireless/b43/main.c +-+++ b/drivers/net/wireless/b43/main.c ++--- a/drivers/net/wireless/broadcom/b43/main.c +++++ b/drivers/net/wireless/broadcom/b43/main.c + @@ -1648,7 +1648,7 @@ static void b43_write_beacon_template(st + len, ram_offset, shm_size_offset, rate); + @@ -9,7 +9,7 @@ antenna = b43_antenna_to_phyctl(antenna); ctl = b43_shm_read16(dev, B43_SHM_SHARED, B43_SHM_SH_BEACPHYCTL); @@ -29336,46 +31180,270 @@ index ac58dba..dd82ce5 100644 hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN; +@@ -118,8 +118,8 @@ + wl->hw_registred = false; + hw->max_rates = 2; + SET_IEEE80211_DEV(hw, dev->dev); +---- a/drivers/net/wireless/b43/b43.h +-+++ b/drivers/net/wireless/b43/b43.h ++--- a/drivers/net/wireless/broadcom/b43/b43.h +++++ b/drivers/net/wireless/broadcom/b43/b43.h + @@ -840,6 +840,8 @@ struct b43_wldev { + bool hwcrypto_enabled; /* TRUE, if HW crypto acceleration is enabled. */ + bool use_pio; /* TRUE if next init should use PIO */ +diff --git a/package/kernel/mac80211/patches/841-b43-reduce-number-of-RX-slots.patch b/package/kernel/mac80211/patches/841-b43-reduce-number-of-RX-slots.patch +index 9c51ac6..5899706 100644 +--- a/package/kernel/mac80211/patches/841-b43-reduce-number-of-RX-slots.patch ++++ b/package/kernel/mac80211/patches/841-b43-reduce-number-of-RX-slots.patch +@@ -1,5 +1,5 @@ +---- a/drivers/net/wireless/b43/dma.h +-+++ b/drivers/net/wireless/b43/dma.h ++--- a/drivers/net/wireless/broadcom/b43/dma.h +++++ b/drivers/net/wireless/broadcom/b43/dma.h + @@ -169,7 +169,7 @@ struct b43_dmadesc_generic { + + /* DMA engine tuning knobs */ +diff --git a/package/kernel/mac80211/patches/845-b43-only-use-gpio-0-1-for-led.patch b/package/kernel/mac80211/patches/845-b43-only-use-gpio-0-1-for-led.patch +index d4f9a88..8d0c041 100644 +--- a/package/kernel/mac80211/patches/845-b43-only-use-gpio-0-1-for-led.patch ++++ b/package/kernel/mac80211/patches/845-b43-only-use-gpio-0-1-for-led.patch +@@ -1,5 +1,5 @@ +---- a/drivers/net/wireless/b43/main.c +-+++ b/drivers/net/wireless/b43/main.c ++--- a/drivers/net/wireless/broadcom/b43/main.c +++++ b/drivers/net/wireless/broadcom/b43/main.c + @@ -2899,6 +2899,14 @@ static int b43_gpio_init(struct b43_wlde + } else if (dev->dev->chip_id == 0x5354) { + /* Don't allow overtaking buttons GPIOs */ +diff --git a/package/kernel/mac80211/patches/847-b43-always-take-overlapping-devs.patch b/package/kernel/mac80211/patches/847-b43-always-take-overlapping-devs.patch +index 9d1d419..ef7f3c9 100644 +--- a/package/kernel/mac80211/patches/847-b43-always-take-overlapping-devs.patch ++++ b/package/kernel/mac80211/patches/847-b43-always-take-overlapping-devs.patch +@@ -1,6 +1,6 @@ +---- a/drivers/net/wireless/b43/main.c +-+++ b/drivers/net/wireless/b43/main.c +-@@ -118,7 +118,7 @@ static int b43_modparam_pio = 0; ++--- a/drivers/net/wireless/broadcom/b43/main.c +++++ b/drivers/net/wireless/broadcom/b43/main.c ++@@ -117,7 +117,7 @@ static int b43_modparam_pio = 0; + module_param_named(pio, b43_modparam_pio, int, 0644); + MODULE_PARM_DESC(pio, "Use PIO accesses by default: 0=DMA, 1=PIO"); + +diff --git a/package/kernel/mac80211/patches/850-brcmsmac-remove-extra-regulation-restriction.patch b/package/kernel/mac80211/patches/850-brcmsmac-remove-extra-regulation-restriction.patch +index 185c427..3c93386 100644 +--- a/package/kernel/mac80211/patches/850-brcmsmac-remove-extra-regulation-restriction.patch ++++ b/package/kernel/mac80211/patches/850-brcmsmac-remove-extra-regulation-restriction.patch +@@ -1,5 +1,5 @@ +---- a/drivers/net/wireless/brcm80211/brcmsmac/channel.c +-+++ b/drivers/net/wireless/brcm80211/brcmsmac/channel.c ++--- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/channel.c +++++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/channel.c + @@ -58,19 +58,12 @@ + (((c) < 149) ? 3 : 4)))) + diff --git a/package/kernel/mac80211/patches/860-brcmfmac-use-bcm47xx-platform-NVRAM-as-fallback.patch b/package/kernel/mac80211/patches/860-brcmfmac-use-bcm47xx-platform-NVRAM-as-fallback.patch -index 44bb779..dbfb158 100644 +deleted file mode 100644 +index 44bb779..0000000 --- a/package/kernel/mac80211/patches/860-brcmfmac-use-bcm47xx-platform-NVRAM-as-fallback.patch -+++ b/package/kernel/mac80211/patches/860-brcmfmac-use-bcm47xx-platform-NVRAM-as-fallback.patch -@@ -69,9 +69,9 @@ Signed-off-by: Rafał Miłecki - } - --- a/drivers/net/wireless/brcm80211/brcmfmac/debug.h - +++ b/drivers/net/wireless/brcm80211/brcmfmac/debug.h ++++ /dev/null +@@ -1,80 +0,0 @@ +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Mon, 8 Jun 2015 16:59:31 +0200 +-Subject: [PATCH] brcmfmac: use bcm47xx platform NVRAM as fallback +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-Signed-off-by: Rafał Miłecki +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/firmware.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/firmware.c +-@@ -19,6 +19,9 @@ +- #include +- #include +- #include +-+#if IS_ENABLED(CONFIG_BCM47XX_NVRAM) +-+#include +-+#endif +- +- #include "debug.h" +- #include "firmware.h" +-@@ -424,17 +427,42 @@ struct brcmf_fw { +- static void brcmf_fw_request_nvram_done(const struct firmware *fw, void *ctx) +- { +- struct brcmf_fw *fwctx = ctx; +-+#if IS_ENABLED(CONFIG_BCM47XX_NVRAM) +-+ const u8 *bcm47xx_nvram = NULL; +-+ size_t bcm47xx_nvram_len; +-+#endif +-+ const u8 *data = NULL; +-+ size_t data_len; +- u32 nvram_length = 0; +- void *nvram = NULL; +- +- brcmf_dbg(TRACE, "enter: dev=%s\n", dev_name(fwctx->dev)); +-- if (!fw && !(fwctx->flags & BRCMF_FW_REQ_NV_OPTIONAL)) +-+ if (fw) { +-+ data = fw->data; +-+ data_len = fw->size; +-+ } +-+#if IS_ENABLED(CONFIG_BCM47XX_NVRAM) +-+ else { +-+ bcm47xx_nvram = bcm47xx_nvram_get_contents(&bcm47xx_nvram_len); +-+ if (bcm47xx_nvram) { +-+ data = bcm47xx_nvram; +-+ data_len = bcm47xx_nvram_len; +-+ brcmf_err("Found platform NVRAM (%zu B)\n", data_len); +-+ } +-+ } +-+#endif +-+ if (!data && !(fwctx->flags & BRCMF_FW_REQ_NV_OPTIONAL)) +- goto fail; +- +-- if (fw) { +-- nvram = brcmf_fw_nvram_strip(fw->data, fw->size, &nvram_length, +-+ if (data) { +-+ nvram = brcmf_fw_nvram_strip(data, data_len, &nvram_length, +- fwctx->domain_nr, fwctx->bus_nr); +-- release_firmware(fw); +-+ if (fw) +-+ release_firmware(fw); +-+#if IS_ENABLED(CONFIG_BCM47XX_NVRAM) +-+ if (bcm47xx_nvram) +-+ bcm47xx_nvram_release_contents(bcm47xx_nvram); +-+#endif +- if (!nvram && !(fwctx->flags & BRCMF_FW_REQ_NV_OPTIONAL)) +- goto fail; +- } +---- a/drivers/net/wireless/brcm80211/brcmfmac/debug.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/debug.h -@@ -19,6 +19,8 @@ - - #include /* net_ratelimit() */ -+@@ -17,6 +17,8 @@ -+ #ifndef BRCMFMAC_DEBUG_H -+ #define BRCMFMAC_DEBUG_H - - +#include - + +- +-+#include +-+ +- /* message levels */ +- #define BRCMF_TRACE_VAL 0x00000002 +- #define BRCMF_INFO_VAL 0x00000004 diff --git a/package/kernel/mac80211/patches/861-brcmfmac-register-wiphy-s-during-module_init.patch b/package/kernel/mac80211/patches/861-brcmfmac-register-wiphy-s-during-module_init.patch -index 14f8a00..685a5f9 100644 +index 14f8a00..95d93ae 100644 --- a/package/kernel/mac80211/patches/861-brcmfmac-register-wiphy-s-during-module_init.patch +++ b/package/kernel/mac80211/patches/861-brcmfmac-register-wiphy-s-during-module_init.patch -@@ -13,7 +13,7 @@ Signed-off-by: Rafał Miłecki +@@ -11,9 +11,9 @@ module loads successfully. + Signed-off-by: Rafał Miłecki + --- - --- a/drivers/net/wireless/brcm80211/brcmfmac/core.c - +++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c +---- a/drivers/net/wireless/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c -@@ -1226,6 +1226,7 @@ static int __init brcmfmac_module_init(v -+@@ -1213,6 +1213,7 @@ static int __init brcmfmac_module_init(v ++--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c ++@@ -1332,6 +1332,7 @@ static int __init brcmfmac_module_init(v #endif if (!schedule_work(&brcmf_driver_work)) return -EBUSY; +@@ -21,9 +21,9 @@ Signed-off-by: Rafał Miłecki + + return 0; + } +---- a/drivers/net/wireless/brcm80211/brcmfmac/firmware.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/firmware.c +-@@ -422,13 +422,14 @@ struct brcmf_fw { ++--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c +++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c ++@@ -418,6 +418,7 @@ struct brcmf_fw { + u16 bus_nr; + void (*done)(struct device *dev, const struct firmware *fw, + void *nvram_image, u32 nvram_len); +@@ -31,16 +31,8 @@ Signed-off-by: Rafał Miłecki + }; + + static void brcmf_fw_request_nvram_done(const struct firmware *fw, void *ctx) +- { +- struct brcmf_fw *fwctx = ctx; +- #if IS_ENABLED(CONFIG_BCM47XX_NVRAM) +-- const u8 *bcm47xx_nvram = NULL; +-+ u8 *bcm47xx_nvram = NULL; +- size_t bcm47xx_nvram_len; +- #endif +- const u8 *data = NULL; +-@@ -468,6 +469,8 @@ static void brcmf_fw_request_nvram_done( +- } ++@@ -452,6 +453,8 @@ static void brcmf_fw_request_nvram_done( ++ goto fail; + + fwctx->done(fwctx->dev, fwctx->code, nvram, nvram_length); + + if (fwctx->completion) +@@ -48,7 +40,7 @@ Signed-off-by: Rafał Miłecki + kfree(fwctx); + return; + +-@@ -475,6 +478,8 @@ fail: ++@@ -459,6 +462,8 @@ fail: + brcmf_dbg(TRACE, "failed: dev=%s\n", dev_name(fwctx->dev)); + release_firmware(fwctx->code); + device_release_driver(fwctx->dev); +@@ -57,7 +49,7 @@ Signed-off-by: Rafał Miłecki + kfree(fwctx); + } + +-@@ -490,6 +495,8 @@ static void brcmf_fw_request_code_done(c ++@@ -474,6 +479,8 @@ static void brcmf_fw_request_code_done(c + /* only requested code so done here */ + if (!(fwctx->flags & BRCMF_FW_REQUEST_NVRAM)) { + fwctx->done(fwctx->dev, fw, NULL, 0); +@@ -66,16 +58,7 @@ Signed-off-by: Rafał Miłecki + kfree(fwctx); + return; + } +-@@ -504,6 +511,8 @@ static void brcmf_fw_request_code_done(c +- /* when nvram is optional call .done() callback here */ +- if (fwctx->flags & BRCMF_FW_REQ_NV_OPTIONAL) { +- fwctx->done(fwctx->dev, fw, NULL, 0); +-+ if (fwctx->completion) +-+ complete(fwctx->completion); +- kfree(fwctx); +- return; +- } +-@@ -513,6 +522,8 @@ static void brcmf_fw_request_code_done(c ++@@ -491,6 +498,8 @@ static void brcmf_fw_request_code_done(c + fail: + brcmf_dbg(TRACE, "failed: dev=%s\n", dev_name(fwctx->dev)); + device_release_driver(fwctx->dev); +@@ -84,7 +67,7 @@ Signed-off-by: Rafał Miłecki + kfree(fwctx); + } + +-@@ -524,6 +535,8 @@ int brcmf_fw_get_firmwares_pcie(struct d ++@@ -502,6 +511,8 @@ int brcmf_fw_get_firmwares_pcie(struct d + u16 domain_nr, u16 bus_nr) + { + struct brcmf_fw *fwctx; +@@ -93,7 +76,7 @@ Signed-off-by: Rafał Miłecki + + brcmf_dbg(TRACE, "enter: dev=%s\n", dev_name(dev)); + if (!fw_cb || !code) +-@@ -544,9 +557,17 @@ int brcmf_fw_get_firmwares_pcie(struct d ++@@ -522,9 +533,17 @@ int brcmf_fw_get_firmwares_pcie(struct d + fwctx->domain_nr = domain_nr; + fwctx->bus_nr = bus_nr; + diff --git a/package/kernel/mac80211/patches/862-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch b/package/kernel/mac80211/patches/862-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch -index 32c4a6f..5fdfa37 100644 +index 32c4a6f..9aeb97e 100644 --- a/package/kernel/mac80211/patches/862-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch +++ b/package/kernel/mac80211/patches/862-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch -@@ -10,7 +10,7 @@ Signed-off-by: Rafał Miłecki +@@ -8,9 +8,9 @@ Content-Transfer-Encoding: 8bit + Signed-off-by: Rafał Miłecki + --- - --- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c - +++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c -@@ -608,9 +608,37 @@ static struct wireless_dev *brcmf_cfg802 -+@@ -692,9 +692,37 @@ static struct wireless_dev *brcmf_cfg802 ++--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c ++@@ -618,9 +618,37 @@ static struct wireless_dev *brcmf_cfg802 u32 *flags, struct vif_params *params) { @@ -29595,16 +31663,67 @@ index 856dea8..0000000 - kfree(glue); - } - +diff --git a/package/kernel/mac80211/patches/910-00-rt2x00-enable-rt2800soc-for-mt7620.patch b/package/kernel/mac80211/patches/910-00-rt2x00-enable-rt2800soc-for-mt7620.patch +index e6b2d7b..bc9f799 100644 +--- a/package/kernel/mac80211/patches/910-00-rt2x00-enable-rt2800soc-for-mt7620.patch ++++ b/package/kernel/mac80211/patches/910-00-rt2x00-enable-rt2800soc-for-mt7620.patch +@@ -1,5 +1,5 @@ +---- a/drivers/net/wireless/rt2x00/Kconfig +-+++ b/drivers/net/wireless/rt2x00/Kconfig ++--- a/drivers/net/wireless/ralink/rt2x00/Kconfig +++++ b/drivers/net/wireless/ralink/rt2x00/Kconfig + @@ -211,7 +211,7 @@ endif + config RT2800SOC + tristate "Ralink WiSoC support" diff --git a/package/kernel/mac80211/patches/910-01-add-support-for-mt7620.patch b/package/kernel/mac80211/patches/910-01-add-support-for-mt7620.patch -index 501910f..b0536ce 100644 +index 501910f..f2e21ea 100644 --- a/package/kernel/mac80211/patches/910-01-add-support-for-mt7620.patch +++ b/package/kernel/mac80211/patches/910-01-add-support-for-mt7620.patch +@@ -1,5 +1,5 @@ +---- a/drivers/net/wireless/rt2x00/rt2800.h +-+++ b/drivers/net/wireless/rt2x00/rt2800.h ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800.h +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800.h + @@ -81,6 +81,7 @@ + #define RF5372 0x5372 + #define RF5390 0x5390 +@@ -62,8 +62,8 @@ + /* TX_PWR_CFG_7 */ + #define TX_PWR_CFG_7 0x13d4 + #define TX_PWR_CFG_7_OFDM54_CH0 FIELD32(0x0000000f) +---- a/drivers/net/wireless/rt2x00/rt2800lib.c +-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c + @@ -61,6 +61,8 @@ + rt2800_regbusy_read((__dev), BBP_CSR_CFG, BBP_CSR_CFG_BUSY, (__reg)) + #define WAIT_FOR_RFCSR(__dev, __reg) \ +@@ -91,7 +91,8 @@ + + rt2x00_set_field32(®, RF_CSR_CFG_REGNUM_MT7620, word); + + rt2x00_set_field32(®, RF_CSR_CFG_WRITE_MT7620, 1); + + rt2x00_set_field32(®, RF_CSR_CFG_BUSY_MT7620, 1); +-+ ++ ++- rt2800_register_write_lock(rt2x00dev, RF_CSR_CFG, reg); + + rt2800_register_write_lock(rt2x00dev, RF_CSR_CFG, reg); + + } + + break; +@@ -103,8 +104,7 @@ + + rt2x00_set_field32(®, RF_CSR_CFG_REGNUM, word); + + rt2x00_set_field32(®, RF_CSR_CFG_WRITE, 1); + + rt2x00_set_field32(®, RF_CSR_CFG_BUSY, 1); +- +-- rt2800_register_write_lock(rt2x00dev, RF_CSR_CFG, reg); +++ + + rt2800_register_write_lock(rt2x00dev, RF_CSR_CFG, reg); + + } + + break; @@ -210,7 +210,7 @@ case RT5592: *txwi_size = TXWI_DESC_SIZE_5WORDS; *rxwi_size = RXWI_DESC_SIZE_6WORDS; -@@ -3326,6 +3399,312 @@ static void rt2800_config_channel_rf55xx -+@@ -3302,6 +3375,312 @@ static void rt2800_config_channel_rf55xx ++@@ -3303,6 +3376,312 @@ static void rt2800_config_channel_rf55xx rt2800_bbp_write(rt2x00dev, 196, (rf->channel <= 14) ? 0x19 : 0x7F); } @@ -29629,7 +31748,7 @@ index 501910f..b0536ce 100644 const unsigned int word, const u8 value) -@@ -3482,7 +3861,7 @@ static void rt2800_config_channel(struct -+@@ -3458,7 +3837,7 @@ static void rt2800_config_channel(struct ++@@ -3459,7 +3838,7 @@ static void rt2800_config_channel(struct struct channel_info *info) { u32 reg; @@ -29638,7 +31757,7 @@ index 501910f..b0536ce 100644 info->default_power1 = rt2800_txpower_to_dev(rt2x00dev, rf->channel, -@@ -3536,6 +3915,9 @@ static void rt2800_config_channel(struct -+@@ -3512,6 +3891,9 @@ static void rt2800_config_channel(struct ++@@ -3513,6 +3892,9 @@ static void rt2800_config_channel(struct case RF5592: rt2800_config_channel_rf55xx(rt2x00dev, conf, rf, info); break; @@ -29647,7 +31766,7 @@ index 501910f..b0536ce 100644 rt2800_config_channel_rf2xxx(rt2x00dev, conf, rf, info); } -@@ -3638,7 +4020,7 @@ static void rt2800_config_channel(struct -+@@ -3614,7 +3996,7 @@ static void rt2800_config_channel(struct ++@@ -3615,7 +3997,7 @@ static void rt2800_config_channel(struct else if (rt2x00_rt(rt2x00dev, RT3593) || rt2x00_rt(rt2x00dev, RT3883)) rt2800_bbp_write(rt2x00dev, 82, 0x82); @@ -29656,7 +31775,7 @@ index 501910f..b0536ce 100644 if (rt2x00_rt(rt2x00dev, RT3593) || -@@ -3660,7 +4042,7 @@ static void rt2800_config_channel(struct -+@@ -3636,7 +4018,7 @@ static void rt2800_config_channel(struct ++@@ -3637,7 +4019,7 @@ static void rt2800_config_channel(struct if (rt2x00_rt(rt2x00dev, RT3572)) rt2800_rfcsr_write(rt2x00dev, 8, 0); @@ -29665,7 +31784,7 @@ index 501910f..b0536ce 100644 switch (rt2x00dev->default_ant.tx_chain_num) { case 3: -@@ -3709,6 +4091,7 @@ static void rt2800_config_channel(struct -+@@ -3685,6 +4067,7 @@ static void rt2800_config_channel(struct ++@@ -3686,6 +4068,7 @@ static void rt2800_config_channel(struct rt2x00_set_field32(&tx_pin, TX_PIN_CFG_RFTR_EN, 1); rt2x00_set_field32(&tx_pin, TX_PIN_CFG_TRSW_EN, 1); @@ -29674,7 +31793,7 @@ index 501910f..b0536ce 100644 rt2800_register_write(rt2x00dev, TX_PIN_CFG, tx_pin); -@@ -4725,6 +5108,14 @@ void rt2800_vco_calibration(struct rt2x0 -+@@ -4701,6 +5084,14 @@ void rt2800_vco_calibration(struct rt2x0 ++@@ -4702,6 +5085,14 @@ void rt2800_vco_calibration(struct rt2x0 rt2x00_set_field8(&rfcsr, RFCSR3_VCOCAL_EN, 1); rt2800_rfcsr_write(rt2x00dev, 3, rfcsr); break; @@ -29683,7 +31802,7 @@ index 501910f..b0536ce 100644 return; } -@@ -5125,9 +5516,42 @@ static int rt2800_init_registers(struct -+@@ -5101,9 +5492,42 @@ static int rt2800_init_registers(struct ++@@ -5102,9 +5493,42 @@ static int rt2800_init_registers(struct } else if (rt2x00_rt(rt2x00dev, RT5390) || rt2x00_rt(rt2x00dev, RT5392) || rt2x00_rt(rt2x00dev, RT5592)) { @@ -29692,7 +31811,7 @@ index 501910f..b0536ce 100644 rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000404); } else { -@@ -6159,6 +6583,225 @@ static void rt2800_init_bbp_5592(struct -+@@ -6135,6 +6559,225 @@ static void rt2800_init_bbp_5592(struct ++@@ -6136,6 +6560,225 @@ static void rt2800_init_bbp_5592(struct rt2800_bbp_write(rt2x00dev, 103, 0xc0); } @@ -29701,7 +31820,7 @@ index 501910f..b0536ce 100644 { unsigned int i; -@@ -6201,7 +6844,10 @@ static void rt2800_init_bbp(struct rt2x0 -+@@ -6177,7 +6820,10 @@ static void rt2800_init_bbp(struct rt2x0 ++@@ -6178,7 +6821,10 @@ static void rt2800_init_bbp(struct rt2x0 return; case RT5390: case RT5392: @@ -29710,7 +31829,7 @@ index 501910f..b0536ce 100644 case RT5592: rt2800_init_bbp_5592(rt2x00dev); -@@ -7415,6 +8061,295 @@ static void rt2800_init_rfcsr_5592(struc -+@@ -7391,6 +8037,296 @@ static void rt2800_init_rfcsr_5592(struc ++@@ -7392,6 +8038,296 @@ static void rt2800_init_rfcsr_5592(struc rt2800_led_open_drain_enable(rt2x00dev); } @@ -29736,7 +31855,7 @@ index 501910f..b0536ce 100644 { if (rt2800_is_305x_soc(rt2x00dev)) { -@@ -7450,7 +8385,10 @@ static void rt2800_init_rfcsr(struct rt2 -+@@ -7426,7 +8362,10 @@ static void rt2800_init_rfcsr(struct rt2 ++@@ -7427,7 +8363,10 @@ static void rt2800_init_rfcsr(struct rt2 rt2800_init_rfcsr_5350(rt2x00dev); break; case RT5390: @@ -29745,7 +31864,7 @@ index 501910f..b0536ce 100644 case RT5392: rt2800_init_rfcsr_5392(rt2x00dev); -@@ -7882,6 +8820,7 @@ static int rt2800_init_eeprom(struct rt2 -+@@ -7858,6 +8797,7 @@ static int rt2800_init_eeprom(struct rt2 ++@@ -7859,6 +8798,7 @@ static int rt2800_init_eeprom(struct rt2 case RF5390: case RF5392: case RF5592: @@ -29754,7 +31873,7 @@ index 501910f..b0536ce 100644 default: rt2x00_err(rt2x00dev, "Invalid RF chipset 0x%04x detected\n", -@@ -8448,6 +9387,7 @@ static int rt2800_probe_hw_mode(struct r -+@@ -8422,6 +9362,7 @@ static int rt2800_probe_hw_mode(struct r ++@@ -8423,6 +9363,7 @@ static int rt2800_probe_hw_mode(struct r case RF5372: case RF5390: case RF5392: @@ -29763,7 +31882,7 @@ index 501910f..b0536ce 100644 if (spec->clk_is_20mhz) spec->channels = rf_vals_xtal20mhz_3x; -@@ -8588,6 +9528,7 @@ static int rt2800_probe_hw_mode(struct r -+@@ -8562,6 +9503,7 @@ static int rt2800_probe_hw_mode(struct r ++@@ -8563,6 +9504,7 @@ static int rt2800_probe_hw_mode(struct r case RF5372: case RF5390: case RF5392: @@ -29794,7 +31913,7 @@ index 4c04d4f..0000000 - - return 0; diff --git a/package/kernel/mac80211/patches/921-ath10k_init_devices_synchronously.patch b/package/kernel/mac80211/patches/921-ath10k_init_devices_synchronously.patch -index eed3814..93196e1 100644 +index eed3814..8c6d720 100644 --- a/package/kernel/mac80211/patches/921-ath10k_init_devices_synchronously.patch +++ b/package/kernel/mac80211/patches/921-ath10k_init_devices_synchronously.patch @@ -14,7 +14,7 @@ Signed-off-by: Sven Eckelmann @@ -29802,19 +31921,19 @@ index eed3814..93196e1 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c -@@ -1323,6 +1323,16 @@ int ath10k_core_register(struct ath10k * -+@@ -1520,6 +1520,16 @@ int ath10k_core_register(struct ath10k * ++@@ -1914,6 +1914,16 @@ int ath10k_core_register(struct ath10k * ar->chip_id = chip_id; queue_work(ar->workqueue, &ar->register_work); diff --git a/package/kernel/mac80211/patches/930-ath10k_add_tpt_led_trigger.patch b/package/kernel/mac80211/patches/930-ath10k_add_tpt_led_trigger.patch -index 8003f86..34910a0 100644 +index 8003f86..281b447 100644 --- a/package/kernel/mac80211/patches/930-ath10k_add_tpt_led_trigger.patch +++ b/package/kernel/mac80211/patches/930-ath10k_add_tpt_led_trigger.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -5416,6 +5416,21 @@ struct ath10k_vif *ath10k_get_arvif(stru -+@@ -6804,6 +6804,21 @@ struct ath10k_vif *ath10k_get_arvif(stru ++@@ -7141,6 +7141,21 @@ struct ath10k_vif *ath10k_get_arvif(stru return arvif_iter.arvif; } @@ -29823,19 +31942,19 @@ index 8003f86..34910a0 100644 { static const u32 cipher_suites[] = { -@@ -5590,6 +5605,12 @@ int ath10k_mac_register(struct ath10k *a -+@@ -7025,6 +7040,12 @@ int ath10k_mac_register(struct ath10k *a ++@@ -7357,6 +7372,12 @@ int ath10k_mac_register(struct ath10k *a ar->hw->wiphy->cipher_suites = cipher_suites; ar->hw->wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites); diff --git a/package/kernel/mac80211/patches/940-mwl8k_init_devices_synchronously.patch b/package/kernel/mac80211/patches/940-mwl8k_init_devices_synchronously.patch new file mode 100644 -index 0000000..75d8212 +index 0000000..357faee --- /dev/null +++ b/package/kernel/mac80211/patches/940-mwl8k_init_devices_synchronously.patch @@ -0,0 +1,20 @@ -+--- a/drivers/net/wireless/mwl8k.c -++++ b/drivers/net/wireless/mwl8k.c -+@@ -6261,6 +6261,8 @@ static int mwl8k_probe(struct pci_dev *p ++--- a/drivers/net/wireless/marvell/mwl8k.c +++++ b/drivers/net/wireless/marvell/mwl8k.c ++@@ -6264,6 +6264,8 @@ static int mwl8k_probe(struct pci_dev *p + + priv->running_bsses = 0; + @@ -29844,7 +31963,7 @@ index 0000000..75d8212 + return rc; + + err_stop_firmware: -+@@ -6294,8 +6296,6 @@ static void mwl8k_remove(struct pci_dev ++@@ -6297,8 +6299,6 @@ static void mwl8k_remove(struct pci_dev + return; + priv = hw->priv; + @@ -29853,6 +31972,41 @@ index 0000000..75d8212 + if (priv->fw_state == FW_STATE_ERROR) { + mwl8k_hw_reset(priv); + goto unmap; +diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile +index 5ede95a..c098832 100644 +--- a/package/kernel/mt76/Makefile ++++ b/package/kernel/mt76/Makefile +@@ -1,7 +1,7 @@ + include $(TOPDIR)/rules.mk + + PKG_NAME:=mt76 +-PKG_VERSION:=2015-10-12 ++PKG_VERSION:=2016-02-08 + PKG_RELEASE=1 + + PKG_LICENSE:=GPLv2 +@@ -10,7 +10,7 @@ PKG_LICENSE_FILES:= + PKG_SOURCE_URL:=https://github.com/openwrt/mt76 + PKG_SOURCE_PROTO:=git + PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +-PKG_SOURCE_VERSION:=2f31d1e329dc43074a05782624195860c45b099a ++PKG_SOURCE_VERSION:=84a312645c7b805255e6d7b6191e9f62142985d9 + PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz + + PKG_MAINTAINER:=Felix Fietkau +@@ -23,8 +23,10 @@ define KernelPackage/mt76 + SUBMENU:=Wireless Drivers + TITLE:=MediaTek MT76x2 wireless driver + DEPENDS:=+kmod-mac80211 +@DRIVER_11N_SUPPORT @PCI_SUPPORT +- FILES:=$(PKG_BUILD_DIR)/mt76pci.ko +- AUTOLOAD:=$(call AutoLoad,50,mac80211 mt76pci) ++ FILES:=\ ++ $(PKG_BUILD_DIR)/mt76.ko \ ++ $(PKG_BUILD_DIR)/mt76x2e.ko ++ AUTOLOAD:=$(call AutoLoad,50,mac80211 mt76 mt76x2e) + endef + + NOSTDINC_FLAGS = \ diff --git a/package/kernel/mt76/patches/001-backport_ieee80211_hw_set.patch b/package/kernel/mt76/patches/001-backport_ieee80211_hw_set.patch deleted file mode 100644 index e94574d..0000000 @@ -29871,3 +32025,717 @@ index e94574d..0000000 - static bool - mt76_wait_for_mac(struct mt76_dev *dev) - { +diff --git a/package/kernel/mt76/patches/002-disable_fast_xmit.patch b/package/kernel/mt76/patches/002-disable_fast_xmit.patch +deleted file mode 100644 +index f7a011b..0000000 +--- a/package/kernel/mt76/patches/002-disable_fast_xmit.patch ++++ /dev/null +@@ -1,10 +0,0 @@ +---- a/init.c +-+++ b/init.c +-@@ -816,7 +816,6 @@ int mt76_register_device(struct mt76_dev +- ieee80211_hw_set(hw, HOST_BROADCAST_PS_BUFFERING); +- ieee80211_hw_set(hw, AMPDU_AGGREGATION); +- ieee80211_hw_set(hw, SUPPORTS_RC_TABLE); +-- ieee80211_hw_set(hw, SUPPORT_FAST_XMIT); +- +- hw->sta_data_size = sizeof(struct mt76_sta); +- hw->vif_data_size = sizeof(struct mt76_vif); +diff --git a/package/kernel/mwlwifi/patches/100-drop_old_api.patch b/package/kernel/mwlwifi/patches/100-drop_old_api.patch +new file mode 100644 +index 0000000..d2e149e +--- /dev/null ++++ b/package/kernel/mwlwifi/patches/100-drop_old_api.patch +@@ -0,0 +1,92 @@ ++--- a/main.c +++++ b/main.c ++@@ -418,11 +418,7 @@ static void mwl_set_ht_caps(struct mwl_p ++ band->ht_cap.cap |= IEEE80211_HT_CAP_SGI_20; ++ band->ht_cap.cap |= IEEE80211_HT_CAP_SGI_40; ++ ++-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) ++- hw->flags |= IEEE80211_HW_AMPDU_AGGREGATION; ++-#else ++ ieee80211_hw_set(hw, AMPDU_AGGREGATION); ++-#endif ++ band->ht_cap.ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K; ++ band->ht_cap.ampdu_density = IEEE80211_HT_MPDU_DENSITY_4; ++ ++@@ -524,29 +520,16 @@ static int mwl_wl_init(struct mwl_priv * ++ hw->queues = SYSADPT_TX_WMM_QUEUES; ++ ++ /* Set rssi values to dBm */ ++-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) ++- hw->flags |= IEEE80211_HW_SIGNAL_DBM | IEEE80211_HW_HAS_RATE_CONTROL; ++-#else ++ ieee80211_hw_set(hw, SIGNAL_DBM); ++ ieee80211_hw_set(hw, HAS_RATE_CONTROL); ++-#endif ++ ++ /* Ask mac80211 not to trigger PS mode ++ * based on PM bit of incoming frames. ++ */ ++-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) ++- hw->flags |= IEEE80211_HW_AP_LINK_PS; ++-#else ++ ieee80211_hw_set(hw, AP_LINK_PS); ++-#endif ++ ++-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) ++- hw->flags |= IEEE80211_HW_SUPPORTS_PER_STA_GTK | ++- IEEE80211_HW_MFP_CAPABLE; ++-#else ++ ieee80211_hw_set(hw, SUPPORTS_PER_STA_GTK); ++ ieee80211_hw_set(hw, MFP_CAPABLE); ++-#endif ++ ++ hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN; ++ ++--- a/dev.h +++++ b/dev.h ++@@ -484,10 +484,6 @@ static inline struct mwl_sta *mwl_dev_ge ++ return (struct mwl_sta *)&sta->drv_priv; ++ } ++ ++-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0) ++-#define ether_addr_copy(dst, src) memcpy(dst, src, ETH_ALEN) ++-#endif ++- ++ /* Defined in mac80211.c. */ ++ extern const struct ieee80211_ops mwl_mac80211_ops; ++ ++--- a/mac80211.c +++++ b/mac80211.c ++@@ -572,19 +572,11 @@ static int mwl_mac80211_get_survey(struc ++ return 0; ++ } ++ ++-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0) ++-static int mwl_mac80211_ampdu_action(struct ieee80211_hw *hw, ++- struct ieee80211_vif *vif, ++- enum ieee80211_ampdu_mlme_action action, ++- struct ieee80211_sta *sta, ++- u16 tid, u16 *ssn, u8 buf_size) ++-#else ++ static int mwl_mac80211_ampdu_action(struct ieee80211_hw *hw, ++ struct ieee80211_vif *vif, ++ enum ieee80211_ampdu_mlme_action action, ++ struct ieee80211_sta *sta, ++ u16 tid, u16 *ssn, u8 buf_size, bool amsdu) ++-#endif ++ { ++ int rc = 0; ++ struct mwl_priv *priv = hw->priv; ++--- a/rx.c +++++ b/rx.c ++@@ -232,10 +232,8 @@ static inline void mwl_rx_prepare_status ++ status->flag |= RX_FLAG_VHT; ++ if (bw == RX_RATE_INFO_HT40) ++ status->flag |= RX_FLAG_40MHZ; ++-#if LINUX_VERSION_CODE > KERNEL_VERSION(3, 18, 0) ++ if (bw == RX_RATE_INFO_HT80) ++ status->vht_flag |= RX_VHT_FLAG_80MHZ; ++-#endif ++ if (gi == RX_RATE_INFO_SHORT_INTERVAL) ++ status->flag |= RX_FLAG_SHORT_GI; ++ status->vht_nss = (nss + 1); +diff --git a/package/kernel/mwlwifi/patches/110-api_sync.patch b/package/kernel/mwlwifi/patches/110-api_sync.patch +new file mode 100644 +index 0000000..ed3e06a +--- /dev/null ++++ b/package/kernel/mwlwifi/patches/110-api_sync.patch +@@ -0,0 +1,19 @@ ++--- a/mac80211.c +++++ b/mac80211.c ++@@ -597,10 +597,13 @@ static int mwl_mac80211_get_survey(struc ++ ++ static int mwl_mac80211_ampdu_action(struct ieee80211_hw *hw, ++ struct ieee80211_vif *vif, ++- enum ieee80211_ampdu_mlme_action action, ++- struct ieee80211_sta *sta, ++- u16 tid, u16 *ssn, u8 buf_size, bool amsdu) +++ struct ieee80211_ampdu_params *params) ++ { +++ enum ieee80211_ampdu_mlme_action action = params->action; +++ struct ieee80211_sta *sta = params->sta; +++ u16 tid = params->tid; +++ u16 *ssn = ¶ms->ssn; +++ u8 buf_size = params->buf_size; ++ int rc = 0; ++ struct mwl_priv *priv = hw->priv; ++ struct mwl_ampdu_stream *stream; +diff --git a/target/linux/generic/files/include/linux/ath9k_platform.h b/target/linux/generic/files/include/linux/ath9k_platform.h +index 9fa7016..30ce216 100644 +--- a/target/linux/generic/files/include/linux/ath9k_platform.h ++++ b/target/linux/generic/files/include/linux/ath9k_platform.h +@@ -36,6 +36,7 @@ struct ath9k_platform_data { + bool tx_gain_buffalo; + bool disable_2ghz; + bool disable_5ghz; ++ bool led_active_high; + + int (*get_mac_revision)(void); + int (*external_reset)(void); +diff --git a/target/linux/generic/patches-3.18/030-backport_bcm47xx_nvram.patch b/target/linux/generic/patches-3.18/030-backport_bcm47xx_nvram.patch +new file mode 100644 +index 0000000..7ae8b1d +--- /dev/null ++++ b/target/linux/generic/patches-3.18/030-backport_bcm47xx_nvram.patch +@@ -0,0 +1,52 @@ ++--- /dev/null +++++ b/include/linux/bcm47xx_nvram.h ++@@ -0,0 +1,49 @@ +++/* +++ * 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. +++ */ +++ +++#ifndef __BCM47XX_NVRAM_H +++#define __BCM47XX_NVRAM_H +++ +++#include +++#include +++#include +++ +++#ifdef CONFIG_BCM47XX_NVRAM +++int bcm47xx_nvram_init_from_mem(u32 base, u32 lim); +++int bcm47xx_nvram_getenv(const char *name, char *val, size_t val_len); +++int bcm47xx_nvram_gpio_pin(const char *name); +++char *bcm47xx_nvram_get_contents(size_t *val_len); +++static inline void bcm47xx_nvram_release_contents(char *nvram) +++{ +++ vfree(nvram); +++}; +++#else +++static inline int bcm47xx_nvram_init_from_mem(u32 base, u32 lim) +++{ +++ return -ENOTSUPP; +++}; +++static inline int bcm47xx_nvram_getenv(const char *name, char *val, +++ size_t val_len) +++{ +++ return -ENOTSUPP; +++}; +++static inline int bcm47xx_nvram_gpio_pin(const char *name) +++{ +++ return -ENOTSUPP; +++}; +++ +++static inline char *bcm47xx_nvram_get_contents(size_t *val_len) +++{ +++ return NULL; +++}; +++ +++static inline void bcm47xx_nvram_release_contents(char *nvram) +++{ +++}; +++#endif +++ +++#endif /* __BCM47XX_NVRAM_H */ +diff --git a/target/linux/generic/patches-3.18/031-bcma-from-4.5.patch b/target/linux/generic/patches-3.18/031-bcma-from-4.5.patch +new file mode 100644 +index 0000000..171395d +--- /dev/null ++++ b/target/linux/generic/patches-3.18/031-bcma-from-4.5.patch +@@ -0,0 +1,49 @@ ++--- a/drivers/bcma/main.c +++++ b/drivers/bcma/main.c ++@@ -637,11 +637,36 @@ static int bcma_device_uevent(struct dev ++ core->id.rev, core->id.class); ++ } ++ ++-static int __init bcma_modinit(void) +++static unsigned int bcma_bus_registered; +++ +++/* +++ * If built-in, bus has to be registered early, before any driver calls +++ * bcma_driver_register. +++ * Otherwise registering driver would trigger BUG in driver_register. +++ */ +++static int __init bcma_init_bus_register(void) ++ { ++ int err; ++ +++ if (bcma_bus_registered) +++ return 0; +++ ++ err = bus_register(&bcma_bus_type); +++ if (!err) +++ bcma_bus_registered = 1; +++ +++ return err; +++} +++#ifndef MODULE +++fs_initcall(bcma_init_bus_register); +++#endif +++ +++/* Main initialization has to be done with SPI/mtd/NAND/SPROM available */ +++static int __init bcma_modinit(void) +++{ +++ int err; +++ +++ err = bcma_init_bus_register(); ++ if (err) ++ return err; ++ ++@@ -660,7 +685,7 @@ static int __init bcma_modinit(void) ++ ++ return err; ++ } ++-fs_initcall(bcma_modinit); +++module_init(bcma_modinit); ++ ++ static void __exit bcma_modexit(void) ++ { +diff --git a/target/linux/generic/patches-3.18/032-bcma-from-4.6.patch b/target/linux/generic/patches-3.18/032-bcma-from-4.6.patch +new file mode 100644 +index 0000000..a74d9ee +--- /dev/null ++++ b/target/linux/generic/patches-3.18/032-bcma-from-4.6.patch +@@ -0,0 +1,444 @@ ++--- a/drivers/bcma/driver_chipcommon.c +++++ b/drivers/bcma/driver_chipcommon.c ++@@ -15,6 +15,8 @@ ++ #include ++ #include ++ +++static void bcma_chipco_serial_init(struct bcma_drv_cc *cc); +++ ++ static inline u32 bcma_cc_write32_masked(struct bcma_drv_cc *cc, u16 offset, ++ u32 mask, u32 value) ++ { ++@@ -115,6 +117,8 @@ int bcma_chipco_watchdog_register(struct ++ ++ void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc) ++ { +++ struct bcma_bus *bus = cc->core->bus; +++ ++ if (cc->early_setup_done) ++ return; ++ ++@@ -129,6 +133,9 @@ void bcma_core_chipcommon_early_init(str ++ if (cc->capabilities & BCMA_CC_CAP_PMU) ++ bcma_pmu_early_init(cc); ++ +++ if (IS_BUILTIN(CONFIG_BCM47XX) && bus->hosttype == BCMA_HOSTTYPE_SOC) +++ bcma_chipco_serial_init(cc); +++ ++ cc->early_setup_done = true; ++ } ++ ++@@ -185,11 +192,12 @@ u32 bcma_chipco_watchdog_timer_set(struc ++ ticks = 2; ++ else if (ticks > maxt) ++ ticks = maxt; ++- bcma_cc_write32(cc, BCMA_CC_PMU_WATCHDOG, ticks); +++ bcma_pmu_write32(cc, BCMA_CC_PMU_WATCHDOG, ticks); ++ } else { ++ struct bcma_bus *bus = cc->core->bus; ++ ++ if (bus->chipinfo.id != BCMA_CHIP_ID_BCM4707 && +++ bus->chipinfo.id != BCMA_CHIP_ID_BCM47094 && ++ bus->chipinfo.id != BCMA_CHIP_ID_BCM53018) ++ bcma_core_set_clockmode(cc->core, ++ ticks ? BCMA_CLKMODE_FAST : BCMA_CLKMODE_DYNAMIC); ++@@ -314,9 +322,9 @@ u32 bcma_chipco_gpio_pulldown(struct bcm ++ return res; ++ } ++ ++-#ifdef CONFIG_BCMA_DRIVER_MIPS ++-void bcma_chipco_serial_init(struct bcma_drv_cc *cc) +++static void bcma_chipco_serial_init(struct bcma_drv_cc *cc) ++ { +++#if IS_BUILTIN(CONFIG_BCM47XX) ++ unsigned int irq; ++ u32 baud_base; ++ u32 i; ++@@ -358,5 +366,5 @@ void bcma_chipco_serial_init(struct bcma ++ ports[i].baud_base = baud_base; ++ ports[i].reg_shift = 0; ++ } +++#endif /* CONFIG_BCM47XX */ ++ } ++-#endif /* CONFIG_BCMA_DRIVER_MIPS */ ++--- a/drivers/bcma/driver_chipcommon_pmu.c +++++ b/drivers/bcma/driver_chipcommon_pmu.c ++@@ -15,44 +15,44 @@ ++ ++ u32 bcma_chipco_pll_read(struct bcma_drv_cc *cc, u32 offset) ++ { ++- bcma_cc_write32(cc, BCMA_CC_PLLCTL_ADDR, offset); ++- bcma_cc_read32(cc, BCMA_CC_PLLCTL_ADDR); ++- return bcma_cc_read32(cc, BCMA_CC_PLLCTL_DATA); +++ bcma_pmu_write32(cc, BCMA_CC_PMU_PLLCTL_ADDR, offset); +++ bcma_pmu_read32(cc, BCMA_CC_PMU_PLLCTL_ADDR); +++ return bcma_pmu_read32(cc, BCMA_CC_PMU_PLLCTL_DATA); ++ } ++ EXPORT_SYMBOL_GPL(bcma_chipco_pll_read); ++ ++ void bcma_chipco_pll_write(struct bcma_drv_cc *cc, u32 offset, u32 value) ++ { ++- bcma_cc_write32(cc, BCMA_CC_PLLCTL_ADDR, offset); ++- bcma_cc_read32(cc, BCMA_CC_PLLCTL_ADDR); ++- bcma_cc_write32(cc, BCMA_CC_PLLCTL_DATA, value); +++ bcma_pmu_write32(cc, BCMA_CC_PMU_PLLCTL_ADDR, offset); +++ bcma_pmu_read32(cc, BCMA_CC_PMU_PLLCTL_ADDR); +++ bcma_pmu_write32(cc, BCMA_CC_PMU_PLLCTL_DATA, value); ++ } ++ EXPORT_SYMBOL_GPL(bcma_chipco_pll_write); ++ ++ void bcma_chipco_pll_maskset(struct bcma_drv_cc *cc, u32 offset, u32 mask, ++ u32 set) ++ { ++- bcma_cc_write32(cc, BCMA_CC_PLLCTL_ADDR, offset); ++- bcma_cc_read32(cc, BCMA_CC_PLLCTL_ADDR); ++- bcma_cc_maskset32(cc, BCMA_CC_PLLCTL_DATA, mask, set); +++ bcma_pmu_write32(cc, BCMA_CC_PMU_PLLCTL_ADDR, offset); +++ bcma_pmu_read32(cc, BCMA_CC_PMU_PLLCTL_ADDR); +++ bcma_pmu_maskset32(cc, BCMA_CC_PMU_PLLCTL_DATA, mask, set); ++ } ++ EXPORT_SYMBOL_GPL(bcma_chipco_pll_maskset); ++ ++ void bcma_chipco_chipctl_maskset(struct bcma_drv_cc *cc, ++ u32 offset, u32 mask, u32 set) ++ { ++- bcma_cc_write32(cc, BCMA_CC_CHIPCTL_ADDR, offset); ++- bcma_cc_read32(cc, BCMA_CC_CHIPCTL_ADDR); ++- bcma_cc_maskset32(cc, BCMA_CC_CHIPCTL_DATA, mask, set); +++ bcma_pmu_write32(cc, BCMA_CC_PMU_CHIPCTL_ADDR, offset); +++ bcma_pmu_read32(cc, BCMA_CC_PMU_CHIPCTL_ADDR); +++ bcma_pmu_maskset32(cc, BCMA_CC_PMU_CHIPCTL_DATA, mask, set); ++ } ++ EXPORT_SYMBOL_GPL(bcma_chipco_chipctl_maskset); ++ ++ void bcma_chipco_regctl_maskset(struct bcma_drv_cc *cc, u32 offset, u32 mask, ++ u32 set) ++ { ++- bcma_cc_write32(cc, BCMA_CC_REGCTL_ADDR, offset); ++- bcma_cc_read32(cc, BCMA_CC_REGCTL_ADDR); ++- bcma_cc_maskset32(cc, BCMA_CC_REGCTL_DATA, mask, set); +++ bcma_pmu_write32(cc, BCMA_CC_PMU_REGCTL_ADDR, offset); +++ bcma_pmu_read32(cc, BCMA_CC_PMU_REGCTL_ADDR); +++ bcma_pmu_maskset32(cc, BCMA_CC_PMU_REGCTL_DATA, mask, set); ++ } ++ EXPORT_SYMBOL_GPL(bcma_chipco_regctl_maskset); ++ ++@@ -60,18 +60,18 @@ static u32 bcma_pmu_xtalfreq(struct bcma ++ { ++ u32 ilp_ctl, alp_hz; ++ ++- if (!(bcma_cc_read32(cc, BCMA_CC_PMU_STAT) & +++ if (!(bcma_pmu_read32(cc, BCMA_CC_PMU_STAT) & ++ BCMA_CC_PMU_STAT_EXT_LPO_AVAIL)) ++ return 0; ++ ++- bcma_cc_write32(cc, BCMA_CC_PMU_XTAL_FREQ, ++- BIT(BCMA_CC_PMU_XTAL_FREQ_MEASURE_SHIFT)); +++ bcma_pmu_write32(cc, BCMA_CC_PMU_XTAL_FREQ, +++ BIT(BCMA_CC_PMU_XTAL_FREQ_MEASURE_SHIFT)); ++ usleep_range(1000, 2000); ++ ++- ilp_ctl = bcma_cc_read32(cc, BCMA_CC_PMU_XTAL_FREQ); +++ ilp_ctl = bcma_pmu_read32(cc, BCMA_CC_PMU_XTAL_FREQ); ++ ilp_ctl &= BCMA_CC_PMU_XTAL_FREQ_ILPCTL_MASK; ++ ++- bcma_cc_write32(cc, BCMA_CC_PMU_XTAL_FREQ, 0); +++ bcma_pmu_write32(cc, BCMA_CC_PMU_XTAL_FREQ, 0); ++ ++ alp_hz = ilp_ctl * 32768 / 4; ++ return (alp_hz + 50000) / 100000 * 100; ++@@ -127,8 +127,8 @@ static void bcma_pmu2_pll_init0(struct b ++ mask = (u32)~(BCMA_RES_4314_HT_AVAIL | ++ BCMA_RES_4314_MACPHY_CLK_AVAIL); ++ ++- bcma_cc_mask32(cc, BCMA_CC_PMU_MINRES_MSK, mask); ++- bcma_cc_mask32(cc, BCMA_CC_PMU_MAXRES_MSK, mask); +++ bcma_pmu_mask32(cc, BCMA_CC_PMU_MINRES_MSK, mask); +++ bcma_pmu_mask32(cc, BCMA_CC_PMU_MAXRES_MSK, mask); ++ bcma_wait_value(cc->core, BCMA_CLKCTLST, ++ BCMA_CLKCTLST_HAVEHT, 0, 20000); ++ break; ++@@ -140,7 +140,7 @@ static void bcma_pmu2_pll_init0(struct b ++ ++ /* Flush */ ++ if (cc->pmu.rev >= 2) ++- bcma_cc_set32(cc, BCMA_CC_PMU_CTL, BCMA_CC_PMU_CTL_PLL_UPD); +++ bcma_pmu_set32(cc, BCMA_CC_PMU_CTL, BCMA_CC_PMU_CTL_PLL_UPD); ++ ++ /* TODO: Do we need to update OTP? */ ++ } ++@@ -195,9 +195,9 @@ static void bcma_pmu_resources_init(stru ++ ++ /* Set the resource masks. */ ++ if (min_msk) ++- bcma_cc_write32(cc, BCMA_CC_PMU_MINRES_MSK, min_msk); +++ bcma_pmu_write32(cc, BCMA_CC_PMU_MINRES_MSK, min_msk); ++ if (max_msk) ++- bcma_cc_write32(cc, BCMA_CC_PMU_MAXRES_MSK, max_msk); +++ bcma_pmu_write32(cc, BCMA_CC_PMU_MAXRES_MSK, max_msk); ++ ++ /* ++ * Add some delay; allow resources to come up and settle. ++@@ -269,23 +269,33 @@ static void bcma_pmu_workarounds(struct ++ ++ void bcma_pmu_early_init(struct bcma_drv_cc *cc) ++ { +++ struct bcma_bus *bus = cc->core->bus; ++ u32 pmucap; ++ ++- pmucap = bcma_cc_read32(cc, BCMA_CC_PMU_CAP); +++ if (cc->core->id.rev >= 35 && +++ cc->capabilities_ext & BCMA_CC_CAP_EXT_AOB_PRESENT) { +++ cc->pmu.core = bcma_find_core(bus, BCMA_CORE_PMU); +++ if (!cc->pmu.core) +++ bcma_warn(bus, "Couldn't find expected PMU core"); +++ } +++ if (!cc->pmu.core) +++ cc->pmu.core = cc->core; +++ +++ pmucap = bcma_pmu_read32(cc, BCMA_CC_PMU_CAP); ++ cc->pmu.rev = (pmucap & BCMA_CC_PMU_CAP_REVISION); ++ ++- bcma_debug(cc->core->bus, "Found rev %u PMU (capabilities 0x%08X)\n", ++- cc->pmu.rev, pmucap); +++ bcma_debug(bus, "Found rev %u PMU (capabilities 0x%08X)\n", cc->pmu.rev, +++ pmucap); ++ } ++ ++ void bcma_pmu_init(struct bcma_drv_cc *cc) ++ { ++ if (cc->pmu.rev == 1) ++- bcma_cc_mask32(cc, BCMA_CC_PMU_CTL, ++- ~BCMA_CC_PMU_CTL_NOILPONW); +++ bcma_pmu_mask32(cc, BCMA_CC_PMU_CTL, +++ ~BCMA_CC_PMU_CTL_NOILPONW); ++ else ++- bcma_cc_set32(cc, BCMA_CC_PMU_CTL, ++- BCMA_CC_PMU_CTL_NOILPONW); +++ bcma_pmu_set32(cc, BCMA_CC_PMU_CTL, +++ BCMA_CC_PMU_CTL_NOILPONW); ++ ++ bcma_pmu_pll_init(cc); ++ bcma_pmu_resources_init(cc); ++@@ -472,8 +482,8 @@ u32 bcma_pmu_get_cpu_clock(struct bcma_d ++ static void bcma_pmu_spuravoid_pll_write(struct bcma_drv_cc *cc, u32 offset, ++ u32 value) ++ { ++- bcma_cc_write32(cc, BCMA_CC_PLLCTL_ADDR, offset); ++- bcma_cc_write32(cc, BCMA_CC_PLLCTL_DATA, value); +++ bcma_pmu_write32(cc, BCMA_CC_PMU_PLLCTL_ADDR, offset); +++ bcma_pmu_write32(cc, BCMA_CC_PMU_PLLCTL_DATA, value); ++ } ++ ++ void bcma_pmu_spuravoid_pllupdate(struct bcma_drv_cc *cc, int spuravoid) ++@@ -497,20 +507,20 @@ void bcma_pmu_spuravoid_pllupdate(struct ++ bus->chipinfo.id == BCMA_CHIP_ID_BCM53572) ? 6 : 0; ++ ++ /* RMW only the P1 divider */ ++- bcma_cc_write32(cc, BCMA_CC_PLLCTL_ADDR, +++ bcma_pmu_write32(cc, BCMA_CC_PMU_PLLCTL_ADDR, ++ BCMA_CC_PMU_PLL_CTL0 + phypll_offset); ++- tmp = bcma_cc_read32(cc, BCMA_CC_PLLCTL_DATA); +++ tmp = bcma_pmu_read32(cc, BCMA_CC_PMU_PLLCTL_DATA); ++ tmp &= (~(BCMA_CC_PMU1_PLL0_PC0_P1DIV_MASK)); ++ tmp |= (bcm5357_bcm43236_p1div[spuravoid] << BCMA_CC_PMU1_PLL0_PC0_P1DIV_SHIFT); ++- bcma_cc_write32(cc, BCMA_CC_PLLCTL_DATA, tmp); +++ bcma_pmu_write32(cc, BCMA_CC_PMU_PLLCTL_DATA, tmp); ++ ++ /* RMW only the int feedback divider */ ++- bcma_cc_write32(cc, BCMA_CC_PLLCTL_ADDR, +++ bcma_pmu_write32(cc, BCMA_CC_PMU_PLLCTL_ADDR, ++ BCMA_CC_PMU_PLL_CTL2 + phypll_offset); ++- tmp = bcma_cc_read32(cc, BCMA_CC_PLLCTL_DATA); +++ tmp = bcma_pmu_read32(cc, BCMA_CC_PMU_PLLCTL_DATA); ++ tmp &= ~(BCMA_CC_PMU1_PLL0_PC2_NDIV_INT_MASK); ++ tmp |= (bcm5357_bcm43236_ndiv[spuravoid]) << BCMA_CC_PMU1_PLL0_PC2_NDIV_INT_SHIFT; ++- bcma_cc_write32(cc, BCMA_CC_PLLCTL_DATA, tmp); +++ bcma_pmu_write32(cc, BCMA_CC_PMU_PLLCTL_DATA, tmp); ++ ++ tmp = BCMA_CC_PMU_CTL_PLL_UPD; ++ break; ++@@ -646,7 +656,7 @@ void bcma_pmu_spuravoid_pllupdate(struct ++ break; ++ } ++ ++- tmp |= bcma_cc_read32(cc, BCMA_CC_PMU_CTL); ++- bcma_cc_write32(cc, BCMA_CC_PMU_CTL, tmp); +++ tmp |= bcma_pmu_read32(cc, BCMA_CC_PMU_CTL); +++ bcma_pmu_write32(cc, BCMA_CC_PMU_CTL, tmp); ++ } ++ EXPORT_SYMBOL_GPL(bcma_pmu_spuravoid_pllupdate); ++--- a/drivers/bcma/driver_chipcommon_sflash.c +++++ b/drivers/bcma/driver_chipcommon_sflash.c ++@@ -38,6 +38,7 @@ static const struct bcma_sflash_tbl_e bc ++ { "M25P32", 0x15, 0x10000, 64, }, ++ { "M25P64", 0x16, 0x10000, 128, }, ++ { "M25FL128", 0x17, 0x10000, 256, }, +++ { "MX25L25635F", 0x18, 0x10000, 512, }, ++ { NULL }, ++ }; ++ ++--- a/drivers/bcma/scan.c +++++ b/drivers/bcma/scan.c ++@@ -98,6 +98,9 @@ static const struct bcma_device_id_name ++ { BCMA_CORE_SHIM, "SHIM" }, ++ { BCMA_CORE_PCIE2, "PCIe Gen2" }, ++ { BCMA_CORE_ARM_CR4, "ARM CR4" }, +++ { BCMA_CORE_GCI, "GCI" }, +++ { BCMA_CORE_CMEM, "CNDS DDR2/3 memory controller" }, +++ { BCMA_CORE_ARM_CA7, "ARM CA7" }, ++ { BCMA_CORE_DEFAULT, "Default" }, ++ }; ++ ++@@ -315,6 +318,8 @@ static int bcma_get_next_core(struct bcm ++ switch (core->id.id) { ++ case BCMA_CORE_4706_MAC_GBIT_COMMON: ++ case BCMA_CORE_NS_CHIPCOMMON_B: +++ case BCMA_CORE_PMU: +++ case BCMA_CORE_GCI: ++ /* Not used yet: case BCMA_CORE_OOB_ROUTER: */ ++ break; ++ default: ++--- a/drivers/net/wireless/b43/main.c +++++ b/drivers/net/wireless/b43/main.c ++@@ -1215,10 +1215,10 @@ void b43_wireless_core_phy_pll_reset(str ++ case B43_BUS_BCMA: ++ bcma_cc = &dev->dev->bdev->bus->drv_cc; ++ ++- bcma_cc_write32(bcma_cc, BCMA_CC_CHIPCTL_ADDR, 0); ++- bcma_cc_mask32(bcma_cc, BCMA_CC_CHIPCTL_DATA, ~0x4); ++- bcma_cc_set32(bcma_cc, BCMA_CC_CHIPCTL_DATA, 0x4); ++- bcma_cc_mask32(bcma_cc, BCMA_CC_CHIPCTL_DATA, ~0x4); +++ bcma_cc_write32(bcma_cc, BCMA_CC_PMU_CHIPCTL_ADDR, 0); +++ bcma_cc_mask32(bcma_cc, BCMA_CC_PMU_CHIPCTL_DATA, ~0x4); +++ bcma_cc_set32(bcma_cc, BCMA_CC_PMU_CHIPCTL_DATA, 0x4); +++ bcma_cc_mask32(bcma_cc, BCMA_CC_PMU_CHIPCTL_DATA, ~0x4); ++ break; ++ #endif ++ #ifdef CONFIG_B43_SSB ++--- a/include/linux/bcma/bcma.h +++++ b/include/linux/bcma/bcma.h ++@@ -151,6 +151,8 @@ struct bcma_host_ops { ++ #define BCMA_CORE_PCIE2 0x83C /* PCI Express Gen2 */ ++ #define BCMA_CORE_USB30_DEV 0x83D ++ #define BCMA_CORE_ARM_CR4 0x83E +++#define BCMA_CORE_GCI 0x840 +++#define BCMA_CORE_CMEM 0x846 /* CNDS DDR2/3 memory controller */ ++ #define BCMA_CORE_ARM_CA7 0x847 ++ #define BCMA_CORE_SYS_MEM 0x849 ++ #define BCMA_CORE_DEFAULT 0xFFF ++@@ -199,6 +201,7 @@ struct bcma_host_ops { ++ #define BCMA_PKG_ID_BCM4707 1 ++ #define BCMA_PKG_ID_BCM4708 2 ++ #define BCMA_PKG_ID_BCM4709 0 +++#define BCMA_CHIP_ID_BCM47094 53030 ++ #define BCMA_CHIP_ID_BCM53018 53018 ++ ++ /* Board types (on PCI usually equals to the subsystem dev id) */ ++--- a/include/linux/bcma/bcma_driver_chipcommon.h +++++ b/include/linux/bcma/bcma_driver_chipcommon.h ++@@ -217,6 +217,11 @@ ++ #define BCMA_CC_CLKDIV_JTAG_SHIFT 8 ++ #define BCMA_CC_CLKDIV_UART 0x000000FF ++ #define BCMA_CC_CAP_EXT 0x00AC /* Capabilities */ +++#define BCMA_CC_CAP_EXT_SECI_PRESENT 0x00000001 +++#define BCMA_CC_CAP_EXT_GSIO_PRESENT 0x00000002 +++#define BCMA_CC_CAP_EXT_GCI_PRESENT 0x00000004 +++#define BCMA_CC_CAP_EXT_SECI_PUART_PRESENT 0x00000008 /* UART present */ +++#define BCMA_CC_CAP_EXT_AOB_PRESENT 0x00000040 ++ #define BCMA_CC_PLLONDELAY 0x00B0 /* Rev >= 4 only */ ++ #define BCMA_CC_FREFSELDELAY 0x00B4 /* Rev >= 4 only */ ++ #define BCMA_CC_SLOWCLKCTL 0x00B8 /* 6 <= Rev <= 9 only */ ++@@ -351,12 +356,12 @@ ++ #define BCMA_CC_PMU_RES_REQTS 0x0640 /* PMU res req timer sel */ ++ #define BCMA_CC_PMU_RES_REQT 0x0644 /* PMU res req timer */ ++ #define BCMA_CC_PMU_RES_REQM 0x0648 /* PMU res req mask */ ++-#define BCMA_CC_CHIPCTL_ADDR 0x0650 ++-#define BCMA_CC_CHIPCTL_DATA 0x0654 ++-#define BCMA_CC_REGCTL_ADDR 0x0658 ++-#define BCMA_CC_REGCTL_DATA 0x065C ++-#define BCMA_CC_PLLCTL_ADDR 0x0660 ++-#define BCMA_CC_PLLCTL_DATA 0x0664 +++#define BCMA_CC_PMU_CHIPCTL_ADDR 0x0650 +++#define BCMA_CC_PMU_CHIPCTL_DATA 0x0654 +++#define BCMA_CC_PMU_REGCTL_ADDR 0x0658 +++#define BCMA_CC_PMU_REGCTL_DATA 0x065C +++#define BCMA_CC_PMU_PLLCTL_ADDR 0x0660 +++#define BCMA_CC_PMU_PLLCTL_DATA 0x0664 ++ #define BCMA_CC_PMU_STRAPOPT 0x0668 /* (corerev >= 28) */ ++ #define BCMA_CC_PMU_XTAL_FREQ 0x066C /* (pmurev >= 10) */ ++ #define BCMA_CC_PMU_XTAL_FREQ_ILPCTL_MASK 0x00001FFF ++@@ -566,6 +571,7 @@ ++ * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU) ++ */ ++ struct bcma_chipcommon_pmu { +++ struct bcma_device *core; /* Can be separated core or just ChipCommon one */ ++ u8 rev; /* PMU revision */ ++ u32 crystalfreq; /* The active crystal frequency (in kHz) */ ++ }; ++@@ -663,6 +669,19 @@ struct bcma_drv_cc_b { ++ #define bcma_cc_maskset32(cc, offset, mask, set) \ ++ bcma_cc_write32(cc, offset, (bcma_cc_read32(cc, offset) & (mask)) | (set)) ++ +++/* PMU registers access */ +++#define bcma_pmu_read32(cc, offset) \ +++ bcma_read32((cc)->pmu.core, offset) +++#define bcma_pmu_write32(cc, offset, val) \ +++ bcma_write32((cc)->pmu.core, offset, val) +++ +++#define bcma_pmu_mask32(cc, offset, mask) \ +++ bcma_pmu_write32(cc, offset, bcma_pmu_read32(cc, offset) & (mask)) +++#define bcma_pmu_set32(cc, offset, set) \ +++ bcma_pmu_write32(cc, offset, bcma_pmu_read32(cc, offset) | (set)) +++#define bcma_pmu_maskset32(cc, offset, mask, set) \ +++ bcma_pmu_write32(cc, offset, (bcma_pmu_read32(cc, offset) & (mask)) | (set)) +++ ++ extern u32 bcma_chipco_watchdog_timer_set(struct bcma_drv_cc *cc, u32 ticks); ++ ++ extern u32 bcma_chipco_get_alp_clock(struct bcma_drv_cc *cc); ++--- a/drivers/bcma/bcma_private.h +++++ b/drivers/bcma/bcma_private.h ++@@ -47,7 +47,6 @@ void bcma_core_chipcommon_early_init(str ++ void bcma_core_chipcommon_init(struct bcma_drv_cc *cc); ++ void bcma_chipco_bcm4331_ext_pa_lines_ctl(struct bcma_drv_cc *cc, bool enable); ++ #ifdef CONFIG_BCMA_DRIVER_MIPS ++-void bcma_chipco_serial_init(struct bcma_drv_cc *cc); ++ extern struct platform_device bcma_pflash_dev; ++ #endif /* CONFIG_BCMA_DRIVER_MIPS */ ++ ++--- a/drivers/bcma/driver_gpio.c +++++ b/drivers/bcma/driver_gpio.c ++@@ -229,6 +229,7 @@ int bcma_gpio_init(struct bcma_drv_cc *c ++ case BCMA_CHIP_ID_BCM4707: ++ case BCMA_CHIP_ID_BCM5357: ++ case BCMA_CHIP_ID_BCM53572: +++ case BCMA_CHIP_ID_BCM47094: ++ chip->ngpio = 32; ++ break; ++ default: ++--- a/drivers/bcma/driver_mips.c +++++ b/drivers/bcma/driver_mips.c ++@@ -328,12 +328,9 @@ static void bcma_core_mips_flash_detect( ++ ++ void bcma_core_mips_early_init(struct bcma_drv_mips *mcore) ++ { ++- struct bcma_bus *bus = mcore->core->bus; ++- ++ if (mcore->early_setup_done) ++ return; ++ ++- bcma_chipco_serial_init(&bus->drv_cc); ++ bcma_core_mips_flash_detect(mcore); ++ ++ mcore->early_setup_done = true; ++--- a/drivers/bcma/host_pci.c +++++ b/drivers/bcma/host_pci.c ++@@ -294,7 +294,7 @@ static const struct pci_device_id bcma_p ++ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4358) }, ++ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4359) }, ++ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4360) }, ++- { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4365) }, +++ { PCI_DEVICE_SUB(PCI_VENDOR_ID_BROADCOM, 0x4365, PCI_VENDOR_ID_DELL, 0x0016) }, ++ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43a0) }, ++ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43a9) }, ++ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43aa) }, diff --git a/patches/openwrt/0008-ath10k-firmware-add-Candela-Technologies-firmware-for-QCA988X.patch b/patches/openwrt/0008-ath10k-firmware-add-Candela-Technologies-firmware-for-QCA988X.patch new file mode 100644 index 00000000..5f6976fe --- /dev/null +++ b/patches/openwrt/0008-ath10k-firmware-add-Candela-Technologies-firmware-for-QCA988X.patch @@ -0,0 +1,59 @@ +From: Matthias Schiffer +Date: Tue, 9 Feb 2016 18:22:29 +0100 +Subject: ath10k-firmware: add Candela Technologies firmware for QCA988X + +diff --git a/package/firmware/ath10k-firmware/Makefile b/package/firmware/ath10k-firmware/Makefile +index 882294c..c6e6f2d 100644 +--- a/package/firmware/ath10k-firmware/Makefile ++++ b/package/firmware/ath10k-firmware/Makefile +@@ -46,6 +46,26 @@ define Download/ath10k-firmware-qca988x + endef + $(eval $(call Download,ath10k-firmware-qca988x)) + ++ ++define Package/ath10k-firmware-qca988x-ct ++$(Package/ath10k-firmware-default) ++ TITLE:=ath10k firmware for QCA988x devices (Candela Technologies version) ++ CONFLICTS:=ath10k-firmware-qca988x ++endef ++ ++QCA988X_CT_FIRMWARE_FILE:=firmware-5-ct-full-community.bin ++ ++define Download/ath10k-firmware-qca988x-ct ++ # See http://www.candelatech.com/ath10k.php ++ #URL:=http://www.candelatech.com/downloads/ath10k-10-2/ ++ # Update to beta version (will switch back to official URL after v2 release) ++ URL:=https://home.universe-factory.net/neoraider/ ++ FILE:=$(QCA988X_CT_FIRMWARE_FILE) ++ MD5SUM:=9aa205cfd6b98e695ca8e9ae6d1bcb6b ++endef ++$(eval $(call Download,ath10k-firmware-qca988x-ct)) ++ ++ + define Package/ath10k-firmware-qca99x0 + $(Package/ath10k-firmware-default) + TITLE:=ath10k firmware for QCA99x0 devices +@@ -81,6 +101,16 @@ define Package/ath10k-firmware-qca988x/install + $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-5.bin + endef + ++define Package/ath10k-firmware-qca988x-ct/install ++ $(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA988X/hw2.0 ++ $(INSTALL_DATA) \ ++ $(PKG_BUILD_DIR)/QCA988X/board.bin \ ++ $(1)/lib/firmware/ath10k/QCA988X/hw2.0/ ++ $(INSTALL_DATA) \ ++ $(DL_DIR)/$(QCA988X_CT_FIRMWARE_FILE) \ ++ $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-5.bin ++endef ++ + define Package/ath10k-firmware-qca6174/install + $(INSTALL_DIR) $(1)/lib/firmware/ath10k + $(CP) $(PKG_BUILD_DIR)/QCA6174 $(1)/lib/firmware/ath10k/ +@@ -100,5 +130,6 @@ define Package/ath10k-firmware-qca99x0/install + endef + + $(eval $(call BuildPackage,ath10k-firmware-qca988x)) ++$(eval $(call BuildPackage,ath10k-firmware-qca988x-ct)) + $(eval $(call BuildPackage,ath10k-firmware-qca99x0)) + $(eval $(call BuildPackage,ath10k-firmware-qca6174)) diff --git a/patches/openwrt/0008-mac80211-ath10k-allow-simultaneous-AP-IBSS.patch b/patches/openwrt/0009-mac80211-ath10k-allow-simultaneous-AP-IBSS.patch similarity index 100% rename from patches/openwrt/0008-mac80211-ath10k-allow-simultaneous-AP-IBSS.patch rename to patches/openwrt/0009-mac80211-ath10k-allow-simultaneous-AP-IBSS.patch diff --git a/patches/openwrt/0009-iwinfo-update-NanoStation-Loco-txpower-offsets.patch b/patches/openwrt/0010-iwinfo-update-NanoStation-Loco-txpower-offsets.patch similarity index 100% rename from patches/openwrt/0009-iwinfo-update-NanoStation-Loco-txpower-offsets.patch rename to patches/openwrt/0010-iwinfo-update-NanoStation-Loco-txpower-offsets.patch diff --git a/patches/openwrt/0010-ar71xx-add-support-for-tp-link-wr740n-v5.0-EU.patch b/patches/openwrt/0011-ar71xx-add-support-for-tp-link-wr740n-v5.0-EU.patch similarity index 100% rename from patches/openwrt/0010-ar71xx-add-support-for-tp-link-wr740n-v5.0-EU.patch rename to patches/openwrt/0011-ar71xx-add-support-for-tp-link-wr740n-v5.0-EU.patch diff --git a/patches/openwrt/0011-ar71xx-add-support-for-TL-WR741ND-v5.patch b/patches/openwrt/0012-ar71xx-add-support-for-TL-WR741ND-v5.patch similarity index 100% rename from patches/openwrt/0011-ar71xx-add-support-for-TL-WR741ND-v5.patch rename to patches/openwrt/0012-ar71xx-add-support-for-TL-WR741ND-v5.patch diff --git a/patches/openwrt/0012-sunxi-fix-uboot-install-location.patch b/patches/openwrt/0013-sunxi-fix-uboot-install-location.patch similarity index 100% rename from patches/openwrt/0012-sunxi-fix-uboot-install-location.patch rename to patches/openwrt/0013-sunxi-fix-uboot-install-location.patch diff --git a/patches/openwrt/0013-sunxi-respect-CONFIG_TARGET_IMAGES_GZIP.patch b/patches/openwrt/0014-sunxi-respect-CONFIG_TARGET_IMAGES_GZIP.patch similarity index 100% rename from patches/openwrt/0013-sunxi-respect-CONFIG_TARGET_IMAGES_GZIP.patch rename to patches/openwrt/0014-sunxi-respect-CONFIG_TARGET_IMAGES_GZIP.patch diff --git a/patches/openwrt/0015-mac80211-set-mcast-rate-for-mesh-point-interfaces.patch b/patches/openwrt/0015-mac80211-set-mcast-rate-for-mesh-point-interfaces.patch deleted file mode 100644 index 2f57a812..00000000 --- a/patches/openwrt/0015-mac80211-set-mcast-rate-for-mesh-point-interfaces.patch +++ /dev/null @@ -1,47 +0,0 @@ -From: Nils Schneider -Date: Fri, 24 Jul 2015 21:52:12 +0200 -Subject: mac80211: set mcast-rate for mesh point interfaces - -In order to set the multicast rate for mesh point interfaces the "mesh join" -was made explicit and moved to mac80211_setup_vif(), similar to how it is -done for IBSS interfaces. - -Previously, the mesh join was made implicit in case authentication (i.e. -$key) was not used when creating the interface in mac80211_prepare_vif(), -while using authentication would create the interface first, then join -later in mac80211_setup_vif() by starting authsae. - -Signed-off-by: Nils Schneider - -diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh -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() { - } - ;; - mesh) -- json_get_vars key mesh_id -- if [ -n "$key" ]; then -- iw phy "$phy" interface add "$ifname" type mp -- else -- iw phy "$phy" interface add "$ifname" type mp mesh_id "$mesh_id" -- fi -+ iw phy "$phy" interface add "$ifname" type mp - ;; - monitor) - iw phy "$phy" interface add "$ifname" type monitor -@@ -603,6 +598,13 @@ mac80211_setup_vif() { - wireless_vif_parse_encryption - mac80211_setup_supplicant || failed=1 - fi -+ else -+ json_get_vars mesh_id mcast_rate -+ -+ mcval= -+ [ -n "$mcast_rate" ] && wpa_supplicant_add_rate mcval "$mcast_rate" -+ -+ iw dev "$ifname" mesh join "$mesh_id" ${mcval:+mcast-rate $mcval} - fi - - for var in $MP_CONFIG_INT $MP_CONFIG_BOOL $MP_CONFIG_STRING; do diff --git a/patches/openwrt/0014-odhcp6c-add-option-sourcefilter-to-disable-source-filter.patch b/patches/openwrt/0015-odhcp6c-add-option-sourcefilter-to-disable-source-filter.patch similarity index 100% rename from patches/openwrt/0014-odhcp6c-add-option-sourcefilter-to-disable-source-filter.patch rename to patches/openwrt/0015-odhcp6c-add-option-sourcefilter-to-disable-source-filter.patch diff --git a/patches/openwrt/0033-ar71xx-add-support-for-TP-LINK-TL-WR941ND-v6-international-version.patch b/patches/openwrt/0030-ar71xx-add-support-for-TP-LINK-TL-WR941ND-v6-international-version.patch similarity index 100% rename from patches/openwrt/0033-ar71xx-add-support-for-TP-LINK-TL-WR941ND-v6-international-version.patch rename to patches/openwrt/0030-ar71xx-add-support-for-TP-LINK-TL-WR941ND-v6-international-version.patch diff --git a/patches/openwrt/0030-mac80211-fix-crash-when-using-mesh-11s-VIF-together-with-another-VIF.patch b/patches/openwrt/0030-mac80211-fix-crash-when-using-mesh-11s-VIF-together-with-another-VIF.patch deleted file mode 100644 index ce907a22..00000000 --- a/patches/openwrt/0030-mac80211-fix-crash-when-using-mesh-11s-VIF-together-with-another-VIF.patch +++ /dev/null @@ -1,82 +0,0 @@ -From: Matthias Schiffer -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 - -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 -+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 -+--- -+ 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; diff --git a/patches/openwrt/0034-ar71xx-add-support-for-TP-Link-TL-WR1043ND-v3.patch b/patches/openwrt/0031-ar71xx-add-support-for-TP-Link-TL-WR1043ND-v3.patch similarity index 100% rename from patches/openwrt/0034-ar71xx-add-support-for-TP-Link-TL-WR1043ND-v3.patch rename to patches/openwrt/0031-ar71xx-add-support-for-TP-Link-TL-WR1043ND-v3.patch diff --git a/patches/openwrt/0031-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch b/patches/openwrt/0031-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch deleted file mode 100644 index 335f550a..00000000 --- a/patches/openwrt/0031-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch +++ /dev/null @@ -1,70 +0,0 @@ -From: Matthias Schiffer -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 566e156..1dc1816 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 diff --git a/patches/openwrt/0035-ar71xx-backport-ath10k-calibration-data-load-changes.patch b/patches/openwrt/0032-ar71xx-backport-ath10k-calibration-data-load-changes.patch similarity index 100% rename from patches/openwrt/0035-ar71xx-backport-ath10k-calibration-data-load-changes.patch rename to patches/openwrt/0032-ar71xx-backport-ath10k-calibration-data-load-changes.patch diff --git a/patches/openwrt/0032-mac80211-ath9k-add-correct-MAC-BB-name-for-ar9561.patch b/patches/openwrt/0032-mac80211-ath9k-add-correct-MAC-BB-name-for-ar9561.patch deleted file mode 100644 index b82614fc..00000000 --- a/patches/openwrt/0032-mac80211-ath9k-add-correct-MAC-BB-name-for-ar9561.patch +++ /dev/null @@ -1,35 +0,0 @@ -From: Matthias Schiffer -Date: Tue, 1 Sep 2015 19:59:16 +0200 -Subject: mac80211: ath9k: add correct MAC/BB name for ar9561 - -diff --git a/package/kernel/mac80211/patches/546-ath9k_add-correct-MAC-BB-name-for-ar9561.patch b/package/kernel/mac80211/patches/546-ath9k_add-correct-MAC-BB-name-for-ar9561.patch -new file mode 100644 -index 0000000..a2a2c78 ---- /dev/null -+++ b/package/kernel/mac80211/patches/546-ath9k_add-correct-MAC-BB-name-for-ar9561.patch -@@ -0,0 +1,25 @@ -+From 1165dd900cc8de3addbc8bef7e6196b07799d25e Mon Sep 17 00:00:00 2001 -+From: Miaoqing Pan -+Date: Wed, 12 Aug 2015 14:20:46 +0800 -+Subject: ath9k: add correct MAC/BB name for ar9561 -+ -+MAC/BB name is"????" if the MAC/BB is unknown. -+ -+Signed-off-by: Miaoqing Pan -+Signed-off-by: Kalle Valo -+ -+diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c -+index a31a680..1dd0339 100644 -+--- a/drivers/net/wireless/ath/ath9k/hw.c -++++ b/drivers/net/wireless/ath/ath9k/hw.c -+@@ -3186,6 +3186,7 @@ static struct { -+ { AR_SREV_VERSION_9550, "9550" }, -+ { AR_SREV_VERSION_9565, "9565" }, -+ { AR_SREV_VERSION_9531, "9531" }, -++ { AR_SREV_VERSION_9561, "9561" }, -+ }; -+ -+ /* For devices with external radios */ -+-- -+cgit v0.10.2 -+ diff --git a/patches/openwrt/0036-ar71xx-fix-AR71XX_MODEL-on-TP-Link-TL-WR703N.patch b/patches/openwrt/0033-ar71xx-fix-AR71XX_MODEL-on-TP-Link-TL-WR703N.patch similarity index 100% rename from patches/openwrt/0036-ar71xx-fix-AR71XX_MODEL-on-TP-Link-TL-WR703N.patch rename to patches/openwrt/0033-ar71xx-fix-AR71XX_MODEL-on-TP-Link-TL-WR703N.patch diff --git a/patches/openwrt/0038-OpenSSL-Added-source-old-to-PKG_SOURCE_URL.patch b/patches/openwrt/0034-OpenSSL-Added-source-old-to-PKG_SOURCE_URL.patch similarity index 100% rename from patches/openwrt/0038-OpenSSL-Added-source-old-to-PKG_SOURCE_URL.patch rename to patches/openwrt/0034-OpenSSL-Added-source-old-to-PKG_SOURCE_URL.patch diff --git a/patches/openwrt/0039-lua-fix-installation-of-headers-for-host-build.patch b/patches/openwrt/0035-lua-fix-installation-of-headers-for-host-build.patch similarity index 100% rename from patches/openwrt/0039-lua-fix-installation-of-headers-for-host-build.patch rename to patches/openwrt/0035-lua-fix-installation-of-headers-for-host-build.patch diff --git a/patches/openwrt/0040-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch b/patches/openwrt/0036-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch similarity index 100% rename from patches/openwrt/0040-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch rename to patches/openwrt/0036-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch diff --git a/patches/openwrt/0037-acx-mac80211-mark-as-BROKEN-to-avoid-compile-failure-on-mipsel-targets.patch b/patches/openwrt/0037-acx-mac80211-mark-as-BROKEN-to-avoid-compile-failure-on-mipsel-targets.patch deleted file mode 100644 index 93353f10..00000000 --- a/patches/openwrt/0037-acx-mac80211-mark-as-BROKEN-to-avoid-compile-failure-on-mipsel-targets.patch +++ /dev/null @@ -1,17 +0,0 @@ -From: Matthias Schiffer -Date: Sat, 28 Nov 2015 22:40:40 +0100 -Subject: acx-mac80211: mark as BROKEN to avoid compile failure on mipsel targets - -diff --git a/package/kernel/acx-mac80211/Makefile b/package/kernel/acx-mac80211/Makefile -index 1820e7a..fb17a46 100644 ---- a/package/kernel/acx-mac80211/Makefile -+++ b/package/kernel/acx-mac80211/Makefile -@@ -30,7 +30,7 @@ include $(INCLUDE_DIR)/package.mk - define KernelPackage/acx-mac80211 - SUBMENU:=Wireless Drivers - TITLE:=ACX1xx mac80211 driver -- DEPENDS:=@(PCI_SUPPORT||TARGET_ar7) @!TARGET_cobalt @mipsel +kmod-mac80211 -+ DEPENDS:=@(PCI_SUPPORT||TARGET_ar7) @!TARGET_cobalt @mipsel +kmod-mac80211 @BROKEN - FILES:=$(PKG_BUILD_DIR)/acx-mac80211.ko - AUTOLOAD:=$(call AutoLoad,50,mac80211 acx-mac80211) - MAINTAINER:=Florian Fainelli diff --git a/patches/openwrt/0041-x86-generic-refresh-kernel-config.patch b/patches/openwrt/0037-x86-generic-refresh-kernel-config.patch similarity index 100% rename from patches/openwrt/0041-x86-generic-refresh-kernel-config.patch rename to patches/openwrt/0037-x86-generic-refresh-kernel-config.patch diff --git a/patches/openwrt/0042-x86-generic-enable-pata_atiixp-driver.patch b/patches/openwrt/0038-x86-generic-enable-pata_atiixp-driver.patch similarity index 100% rename from patches/openwrt/0042-x86-generic-enable-pata_atiixp-driver.patch rename to patches/openwrt/0038-x86-generic-enable-pata_atiixp-driver.patch diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 7a17e33b..43fb17b5 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -142,7 +142,7 @@ $(eval $(call GluonModel,TLWR2543,tl-wr2543-v1,tp-link-tl-wr2543n-nd-v1)) ifeq ($(BROKEN),1) # Archer C5 v1, C7 v2 -$(eval $(call GluonProfile,ARCHERC7,kmod-ath10k)) +$(eval $(call GluonProfile,ARCHERC7,kmod-ath10k ath10k-firmware-qca988x-ct)) $(eval $(call GluonModel,ARCHERC7,archer-c5,tp-link-archer-c5-v1)) # BROKEN: ath10k $(eval $(call GluonModel,ARCHERC7,archer-c7-v2,tp-link-archer-c7-v2)) # BROKEN: ath10k endif From 0fd4ff0a686a3b3b62eda308ed24a33e3cf14d56 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 13 Feb 2016 17:02:11 +0100 Subject: [PATCH 97/99] build: don't overwrite opkg key when it already exists --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a1b69459..dfc0f001 100644 --- a/Makefile +++ b/Makefile @@ -236,7 +236,7 @@ $(early_prepared_stamp): $(GLUON_OPKG_KEY): $(early_prepared_stamp) FORCE [ -s $(GLUON_OPKG_KEY) -a -s $(GLUON_OPKG_KEY).pub ] || \ - mkdir -p $$(dirname $(GLUON_OPKG_KEY)) && $(STAGING_DIR_HOST)/bin/usign -G -s $(GLUON_OPKG_KEY) -p $(GLUON_OPKG_KEY).pub -c "Gluon opkg key" + ( mkdir -p $$(dirname $(GLUON_OPKG_KEY)) && $(STAGING_DIR_HOST)/bin/usign -G -s $(GLUON_OPKG_KEY) -p $(GLUON_OPKG_KEY).pub -c "Gluon opkg key" ) $(GLUON_OPKG_KEY).pub: $(GLUON_OPKG_KEY) From f0ad8ed5cb165cb47a19c5432e7284166d649fd0 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 16 Feb 2016 23:25:03 +0100 Subject: [PATCH 98/99] gluon-mesh-batman-adv-core: enable mesh_no_rebroadcast for Mesh-on-WAN/LAN Ethernet links provide transitive connectivity in all but very unusual setup, enable mesh_no_rebroadcast to reduce load for devices on links with many nodes. Fixes #652 --- .../gluon/upgrade/330-gluon-mesh-batman-adv-core-mesh-on-wan | 1 + .../gluon/upgrade/340-gluon-mesh-batman-adv-core-mesh-on-lan | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/330-gluon-mesh-batman-adv-core-mesh-on-wan b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/330-gluon-mesh-batman-adv-core-mesh-on-wan index d40c5729..8db95145 100755 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/330-gluon-mesh-batman-adv-core-mesh-on-wan +++ b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/330-gluon-mesh-batman-adv-core-mesh-on-wan @@ -10,6 +10,7 @@ if not c:get('network', 'mesh_wan') then { ifname = 'br-wan' , proto = 'batadv' , mesh = 'bat0' + , mesh_no_rebroadcast = '1' , auto = site.mesh_on_wan and 1 or 0 }) end diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/340-gluon-mesh-batman-adv-core-mesh-on-lan b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/340-gluon-mesh-batman-adv-core-mesh-on-lan index 2d800546..8b192adb 100755 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/340-gluon-mesh-batman-adv-core-mesh-on-lan +++ b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/340-gluon-mesh-batman-adv-core-mesh-on-lan @@ -27,6 +27,7 @@ if sysconfig.lan_ifname and not uci:get('network', 'mesh_lan') then { ifname = sysconfig.lan_ifname , proto = 'batadv' , mesh = 'bat0' + , mesh_no_rebroadcast = '1' , macaddr = util.generate_mac(1, 1) , auto = enable and 1 or 0 }) @@ -34,4 +35,3 @@ if sysconfig.lan_ifname and not uci:get('network', 'mesh_lan') then uci:save('network') uci:commit('network') end - From f97269158a085c6a44a44dbbcf479423ace62a4b Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 19 Feb 2016 17:57:50 +0100 Subject: [PATCH 99/99] Update Gluon packages --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 58dfda33..5d951303 100644 --- a/modules +++ b/modules @@ -8,7 +8,7 @@ PACKAGES_OPENWRT_COMMIT=9622fe984bba3a4547f48bc507ebaba7637eb2b0 PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git -PACKAGES_GLUON_COMMIT=fd06c7d67da69713f0361dadab16393c26cb609b +PACKAGES_GLUON_COMMIT=06f2a62b97a25ddd1b9919d084c626d42cef5489 PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_COMMIT=2a8338559de5c4b077cde7a83f43f4700a17d5cc