From 2164893616289e4df59ad522f16f94ba000acc8d Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Fri, 8 May 2015 13:01:22 +0200 Subject: [PATCH 001/867] gluon-radvd: on-link flag By introducing a new option -a in addition to -p this patch allows controlling the on-link flag of announcements. A prefix specified using -a will have the on-link flag set to zero while a prefix specified using -p will retain its behaviour (i.e. on-link flag set). Example: gluon-radvd -i local-node -p 2001:db8:aaaa:/64 -a 2001:db8:bbbb::/64 This will announce 2001:db8:aaaa::/64 with the on-link flag set and 2001:db8:bbbb::/64 with the flag unset. --- package/gluon-radvd/src/gluon-radvd.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/package/gluon-radvd/src/gluon-radvd.c b/package/gluon-radvd/src/gluon-radvd.c index bd57eabc..e146c4f5 100644 --- a/package/gluon-radvd/src/gluon-radvd.c +++ b/package/gluon-radvd/src/gluon-radvd.c @@ -100,6 +100,7 @@ static struct global { size_t n_prefixes; struct in6_addr prefixes[MAX_PREFIXES]; + bool prefixes_onlink[MAX_PREFIXES]; } G = { .rtnl_sock = -1, .icmp_sock = -1, @@ -483,11 +484,16 @@ static void send_advert(void) { size_t i; for (i = 0; i < G.n_prefixes; i++) { + uint8_t flags = ND_OPT_PI_FLAG_AUTO; + + if (G.prefixes_onlink[i]) + flags |= ND_OPT_PI_FLAG_ONLINK; + prefixes[i] = (struct nd_opt_prefix_info){ .nd_opt_pi_type = ND_OPT_PREFIX_INFORMATION, .nd_opt_pi_len = 4, .nd_opt_pi_prefix_len = 64, - .nd_opt_pi_flags_reserved = ND_OPT_PI_FLAG_AUTO|ND_OPT_PI_FLAG_ONLINK, + .nd_opt_pi_flags_reserved = flags, .nd_opt_pi_valid_time = htonl(AdvValidLifetime), .nd_opt_pi_preferred_time = htonl(AdvPreferredLifetime), .nd_opt_pi_prefix = G.prefixes[i], @@ -541,10 +547,10 @@ static void send_advert(void) { static void usage(void) { - fprintf(stderr, "Usage: gluon-radvd [-h] -i -p [ -p ... ]\n"); + fprintf(stderr, "Usage: gluon-radvd [-h] -i -a/-p [ -a/-p ... ]\n"); } -static void add_prefix(const char *prefix) { +static void add_prefix(const char *prefix, bool adv_onlink) { if (G.n_prefixes == MAX_PREFIXES) error(1, 0, "maximum number of prefixes is %i.", MAX_PREFIXES); @@ -566,6 +572,8 @@ static void add_prefix(const char *prefix) { if (memcmp(G.prefixes[G.n_prefixes].s6_addr + 8, zero, 8) != 0) goto error; + G.prefixes_onlink[G.n_prefixes] = adv_onlink; + G.n_prefixes++; return; @@ -575,7 +583,7 @@ static void add_prefix(const char *prefix) { static void parse_cmdline(int argc, char *argv[]) { int c; - while ((c = getopt(argc, argv, "i:p:h")) != -1) { + while ((c = getopt(argc, argv, "i:a:p:h")) != -1) { switch(c) { case 'i': if (G.ifname) @@ -585,8 +593,12 @@ static void parse_cmdline(int argc, char *argv[]) { break; + case 'a': + add_prefix(optarg, false); + break; + case 'p': - add_prefix(optarg); + add_prefix(optarg, true); break; case 'h': From 4b01ecce7c09c23c40262a56645f8b18d1965c00 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 10 Jun 2015 11:01:25 +0200 Subject: [PATCH 002/867] Update modules --- modules | 8 ++++---- ...atech-community-firmware-as-an-additional-choice.patch | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules b/modules index 783113be..bbb6cf0c 100644 --- a/modules +++ b/modules @@ -1,19 +1,19 @@ GLUON_FEEDS='openwrt gluon routing luci' OPENWRT_REPO=git://git.openwrt.org/openwrt.git -OPENWRT_COMMIT=08ac77da771204772119aeecf6826a5da4a0a45f +OPENWRT_COMMIT=1f6b5e1275c88dea2582c0ff7bf95fd4b7fc6900 PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git -PACKAGES_OPENWRT_COMMIT=4c4c2dbdae02b38eff4a6abd95cfd54f61702246 +PACKAGES_OPENWRT_COMMIT=f109732f56fb00a7db4d9e966e9356dc71359f73 PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git PACKAGES_GLUON_COMMIT=dcc5a5ab74822492877eadcba5fc3ad845ee65db PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git -PACKAGES_ROUTING_COMMIT=2bca6fb55f898c08e4227d35533fda2486c8983c +PACKAGES_ROUTING_COMMIT=f789112125413c26ce6658be66e86ebecd609b10 PACKAGES_ROUTING_BRANCH=for-15.05 PACKAGES_LUCI_REPO=git://github.com/openwrt/luci.git -PACKAGES_LUCI_COMMIT=a497fbab4c4d7e3228c67a93e107000f7e70fd1f +PACKAGES_LUCI_COMMIT=65e5e0dd895732491452206eeae60733db66a1f8 PACKAGES_LUCI_BRANCH=for-15.05 diff --git a/patches/openwrt/0005-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch b/patches/openwrt/0005-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch index e662cbe5..26090220 100644 --- a/patches/openwrt/0005-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch +++ b/patches/openwrt/0005-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch @@ -3,7 +3,7 @@ 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 2a40bb1..17dbe03 100644 +index 2af5d39..2d90aef 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -604,6 +604,14 @@ This module adds support for wireless adapters based on From de0b59754d2aaabb49b656b7084832f3b47de6ed Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 10 Jun 2015 11:10:38 +0200 Subject: [PATCH 003/867] luci-lib-json: ignore null keys to allow encoding empty objects --- ...keys-to-allow-encoding-empty-objects.patch | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 patches/packages/luci/0004-luci-lib-json-ignore-null-keys-to-allow-encoding-empty-objects.patch diff --git a/patches/packages/luci/0004-luci-lib-json-ignore-null-keys-to-allow-encoding-empty-objects.patch b/patches/packages/luci/0004-luci-lib-json-ignore-null-keys-to-allow-encoding-empty-objects.patch new file mode 100644 index 00000000..ab02429c --- /dev/null +++ b/patches/packages/luci/0004-luci-lib-json-ignore-null-keys-to-allow-encoding-empty-objects.patch @@ -0,0 +1,36 @@ +From: Matthias Schiffer +Date: Thu, 4 Jun 2015 21:03:24 +0200 +Subject: luci-lib-json: ignore null keys to allow encoding empty objects + +There is currently no way to encode an empty object {}, as empty tables are +encoded as empty lists []. + +With this patch, encode() will ignore table fields with the key json.null (which +doesn't make sense anyways). This allows adding a field with key json.null to +force encoding it as an object. + +Signed-off-by: Matthias Schiffer + +diff --git a/libs/luci-lib-json/luasrc/json.lua b/libs/luci-lib-json/luasrc/json.lua +index 416b25f..f7b57f9 100644 +--- a/libs/luci-lib-json/luasrc/json.lua ++++ b/libs/luci-lib-json/luasrc/json.lua +@@ -149,11 +149,13 @@ function Encoder.parse_iter(self, obj) + local first = true + + for key, entry in pairs(obj) do +- first = first or self:put(",") +- first = first and false +- self:parse_string(tostring(key)) +- self:put(":") +- self:dispatch(entry) ++ if key ~= null then ++ first = first or self:put(",") ++ first = first and false ++ self:parse_string(tostring(key)) ++ self:put(":") ++ self:dispatch(entry) ++ end + end + + self:put("}") From 3422f6f72b27301920d6ff67623d3e0a0c43eba5 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 10 Jun 2015 19:40:06 +0200 Subject: [PATCH 004/867] Switch openwrt-routing module to master branch This updates batman-adv to 2015.0. --- modules | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules b/modules index bbb6cf0c..b6940b1e 100644 --- a/modules +++ b/modules @@ -11,8 +11,7 @@ PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git PACKAGES_GLUON_COMMIT=dcc5a5ab74822492877eadcba5fc3ad845ee65db PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git -PACKAGES_ROUTING_COMMIT=f789112125413c26ce6658be66e86ebecd609b10 -PACKAGES_ROUTING_BRANCH=for-15.05 +PACKAGES_ROUTING_COMMIT=aca8cb6ee36812f05aacba48602666abbd02d0d6 PACKAGES_LUCI_REPO=git://github.com/openwrt/luci.git PACKAGES_LUCI_COMMIT=65e5e0dd895732491452206eeae60733db66a1f8 From 6c378d17269849df1c64fa79e1c95e39ee806b40 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 15 Jun 2015 12:37:38 +0200 Subject: [PATCH 005/867] batman-adv: refresh no_rebroadcast patch to apply to 2015.0 cleanly --- ...-adv-introduce-no_rebroadcast-option.patch | 27 +++++-------------- 1 file changed, 7 insertions(+), 20 deletions(-) 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 c0e90d66..6022d351 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,10 +30,10 @@ index 632a209..01f567f 100644 } diff --git a/batman-adv/patches/0001-batman-adv-introduce-no_rebroadcast-option.patch b/batman-adv/patches/0001-batman-adv-introduce-no_rebroadcast-option.patch new file mode 100644 -index 0000000..cd79917 +index 0000000..9fc9426 --- /dev/null +++ b/batman-adv/patches/0001-batman-adv-introduce-no_rebroadcast-option.patch -@@ -0,0 +1,185 @@ +@@ -0,0 +1,172 @@ +From 5ba3f1eac041857deabe39432fdfe1a584bbdd81 Mon Sep 17 00:00:00 2001 +Message-Id: <5ba3f1eac041857deabe39432fdfe1a584bbdd81.1420645650.git.mschiffer@universe-factory.net> +From: =?UTF-8?q?Linus=20L=C3=BCssing?= @@ -70,11 +70,9 @@ index 0000000..cd79917 + types.h | 1 + + 5 files changed, 76 insertions(+) + -+diff --git a/hard-interface.c b/hard-interface.c -+index fbda6b5..3997f9c 100644 +--- a/hard-interface.c ++++ b/hard-interface.c -+@@ -591,6 +591,8 @@ batadv_hardif_add_interface(struct net_device *net_dev) ++@@ -592,6 +592,8 @@ batadv_hardif_add_interface(struct net_d + /* extra reference for return */ + atomic_set(&hard_iface->refcount, 2); + @@ -83,11 +81,9 @@ index 0000000..cd79917 + batadv_check_known_mac_addr(hard_iface->net_dev); + list_add_tail_rcu(&hard_iface->list, &batadv_hardif_list); + -+diff --git a/send.c b/send.c -+index d27161e..4383a66 100644 +--- a/send.c ++++ b/send.c -+@@ -513,6 +513,10 @@ static void batadv_send_outstanding_bcast_packet(struct work_struct *work) ++@@ -513,6 +513,10 @@ static void batadv_send_outstanding_bcas + if (forw_packet->num_packets >= hard_iface->num_bcasts) + continue; + @@ -98,8 +94,6 @@ index 0000000..cd79917 + /* send a copy of the saved skb */ + skb1 = skb_clone(forw_packet->skb, GFP_ATOMIC); + if (skb1) -+diff --git a/sysfs-class-net-batman-adv b/sysfs-class-net-batman-adv -+index 7f34a95..cf7fe00 100644 +--- a/sysfs-class-net-batman-adv ++++ b/sysfs-class-net-batman-adv +@@ -13,3 +13,13 @@ Description: @@ -116,11 +110,9 @@ index 0000000..cd79917 ++ 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/sysfs.c b/sysfs.c -+index fc47baa..adaeca4 100644 +--- a/sysfs.c ++++ b/sysfs.c -+@@ -110,6 +110,17 @@ struct batadv_attribute batadv_attr_vlan_##_name = { \ ++@@ -110,6 +110,17 @@ struct batadv_attribute batadv_attr_vlan + .store = _store, \ + } + @@ -138,7 +130,7 @@ index 0000000..cd79917 + /* Use this, if you have customized show and store functions */ + #define BATADV_ATTR(_name, _mode, _show, _store) \ + struct batadv_attribute batadv_attr_##_name = { \ -+@@ -221,6 +232,52 @@ ssize_t batadv_show_vlan_##_name(struct kobject *kobj, \ ++@@ -220,6 +231,52 @@ ssize_t batadv_show_vlan_##_name(struct + static BATADV_ATTR_VLAN(_name, _mode, batadv_show_vlan_##_name, \ + batadv_store_vlan_##_name) + @@ -191,7 +183,7 @@ index 0000000..cd79917 + static int batadv_store_bool_attr(char *buff, size_t count, + struct net_device *net_dev, + const char *attr_name, atomic_t *attr) -+@@ -844,10 +901,12 @@ static ssize_t batadv_show_iface_status(struct kobject *kobj, ++@@ -843,10 +900,12 @@ static ssize_t batadv_show_iface_status( + 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); @@ -204,8 +196,6 @@ index 0000000..cd79917 + NULL, + }; + -+diff --git a/types.h b/types.h -+index 8854c05..39619fb 100644 +--- a/types.h ++++ b/types.h +@@ -101,6 +101,7 @@ struct batadv_hard_iface { @@ -216,6 +206,3 @@ index 0000000..cd79917 + }; + + /** -+-- -+2.2.1 -+ From d37f3619ceed135a6a95c42549de4f3494a4ca13 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 15 Jun 2015 19:34:26 +0200 Subject: [PATCH 006/867] Switch to OpenWrt 15.05 release branch --- modules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules b/modules index b6940b1e..b7e46211 100644 --- a/modules +++ b/modules @@ -1,7 +1,7 @@ GLUON_FEEDS='openwrt gluon routing luci' -OPENWRT_REPO=git://git.openwrt.org/openwrt.git -OPENWRT_COMMIT=1f6b5e1275c88dea2582c0ff7bf95fd4b7fc6900 +OPENWRT_REPO=git://git.openwrt.org/15.05/openwrt.git +OPENWRT_COMMIT=e0a389d68300240411922693f75c4acb81ee7730 PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git PACKAGES_OPENWRT_COMMIT=f109732f56fb00a7db4d9e966e9356dc71359f73 From 68a3b5f394ba9aef1b8cad9cc5fe933da0a17b1a Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 15 Jun 2015 20:56:03 +0200 Subject: [PATCH 007/867] gluon-announce, ...: don't output empty lists where not appropriate Always output empty objects or nothing at all where objects are expected, but no elements exist. Also remove a few unneeded "requires", a few basic modules are provided by announce.lua by default. --- .../files/usr/lib/lua/gluon/announce.lua | 3 ++- .../files/lib/gluon/announce/neighbours.d/batadv | 10 ++++------ .../files/lib/gluon/announce/neighbours.d/wifi | 11 ++++++----- .../announce/nodeinfo.d/network/mesh/bat0/interfaces | 3 ++- 4 files changed, 14 insertions(+), 13 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 17109785..be855b3a 100644 --- a/package/gluon-announce/files/usr/lib/lua/gluon/announce.lua +++ b/package/gluon-announce/files/usr/lib/lua/gluon/announce.lua @@ -3,6 +3,7 @@ module('gluon.announce', package.seeall) fs = require 'nixio.fs' +json = require 'luci.json' uci = require('luci.model.uci').cursor() util = require 'luci.util' @@ -15,7 +16,7 @@ local function collect_entry(entry) end function collect_dir(dir) - local ret = {} + local ret = { [json.null] = true } for entry in fs.dir(dir) do if entry:sub(1, 1) ~= '.' then 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 f93a11f9..cfdd72dc 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 @@ -1,7 +1,3 @@ -local json = require 'luci.json' -local util = require 'luci.util' -local fs = require 'nixio.fs' - local ifname_address_cache = {} function ifname2address(ifname) @@ -26,7 +22,7 @@ function batadv() if mac1 ~= nil and mac1 == mac2 then ifaddress = ifname2address(ifname) if interfaces[ifaddress] == nil then - interfaces[ifaddress] = { neighbours = {} } + interfaces[ifaddress] = { neighbours = { [json.null] = true } } end interfaces[ifaddress].neighbours[mac1] = { tq = tonumber(tq) @@ -35,7 +31,9 @@ function batadv() end end - return interfaces + 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 index d3754222..26168003 100644 --- 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 @@ -1,6 +1,3 @@ -local json = require 'luci.json' -local util = require 'luci.util' -local fs = require 'nixio.fs' local iwinfo = require 'iwinfo' function neighbours(iface) @@ -12,7 +9,9 @@ function neighbours(iface) } end - return stations + if next(stations) then + return stations + end end function interfaces() @@ -38,4 +37,6 @@ for address, iface in pairs(interfaces()) do wifi[address] = { neighbours = neighbours(iface) } end -return wifi +if next(wifi) then + return wifi +end 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 index 97180b81..e0c3c9ac 100644 --- 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 @@ -48,5 +48,6 @@ end return { wireless = nil_table(wireless), tunnel = nil_table(tunnel), - other = nil_table(other) + other = nil_table(other), + [json.null] = true } From 8e87d84120cb0eb4fb6bfae299c045bb0f31fa17 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 16 Jun 2015 00:58:18 +0200 Subject: [PATCH 008/867] Update default opkg repo to 15.05-rc2 --- include/gluon.mk | 2 +- targets/ar71xx-generic/vermagic | 2 +- targets/ar71xx-nand/vermagic | 2 +- targets/mpc85xx-generic/vermagic | 2 +- targets/ramips-rt305x/vermagic | 2 +- targets/x86-generic/vermagic | 2 +- targets/x86-kvm_guest/vermagic | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/gluon.mk b/include/gluon.mk index fdccef20..5047eb68 100644 --- a/include/gluon.mk +++ b/include/gluon.mk @@ -35,7 +35,7 @@ export GLUON_LANGS ifeq ($(OPENWRT_BUILD),1) ifeq ($(GLUON_TOOLS),1) -CONFIG_VERSION_REPO := $(shell $(GLUONDIR)/scripts/site.sh opkg_repo || echo http://downloads.openwrt.org/chaos_calmer/15.05-rc1/%S/packages) +CONFIG_VERSION_REPO := $(shell $(GLUONDIR)/scripts/site.sh opkg_repo || echo http://downloads.openwrt.org/chaos_calmer/15.05-rc2/%S/packages) export CONFIG_VERSION_REPO GLUON_SITE_CODE := $(shell $(GLUONDIR)/scripts/site.sh site_code) diff --git a/targets/ar71xx-generic/vermagic b/targets/ar71xx-generic/vermagic index ab5f8c55..43702d39 100644 --- a/targets/ar71xx-generic/vermagic +++ b/targets/ar71xx-generic/vermagic @@ -1 +1 @@ -c9110281555cccc9dd13e092c2acaeaf +47cf67747cc95dea86ac56de2508504c diff --git a/targets/ar71xx-nand/vermagic b/targets/ar71xx-nand/vermagic index e3613a7a..dbf5b2f8 100644 --- a/targets/ar71xx-nand/vermagic +++ b/targets/ar71xx-nand/vermagic @@ -1 +1 @@ -689cae9c23d40bdba3f46c59a12ca179 +20a1d10ab1094c3fb87bfcaacac54d23 diff --git a/targets/mpc85xx-generic/vermagic b/targets/mpc85xx-generic/vermagic index 9f75ad13..454f24d6 100644 --- a/targets/mpc85xx-generic/vermagic +++ b/targets/mpc85xx-generic/vermagic @@ -1 +1 @@ -18b3b28a5f70d5040f741bd44916dc57 +941b423bf2458808787f26bdb072a8f4 diff --git a/targets/ramips-rt305x/vermagic b/targets/ramips-rt305x/vermagic index c6652242..28bebb91 100644 --- a/targets/ramips-rt305x/vermagic +++ b/targets/ramips-rt305x/vermagic @@ -1 +1 @@ -4d806b94ed2b1e50df33a69891888e4a +ced5b5a0a4b7d37ece0f2af5dad52992 diff --git a/targets/x86-generic/vermagic b/targets/x86-generic/vermagic index 457dc764..128d11e3 100644 --- a/targets/x86-generic/vermagic +++ b/targets/x86-generic/vermagic @@ -1 +1 @@ -6581cdee9837e0761056ab3c80d05a2e +f42c71e8114133916fd30f85470545e5 diff --git a/targets/x86-kvm_guest/vermagic b/targets/x86-kvm_guest/vermagic index 89969699..f465d300 100644 --- a/targets/x86-kvm_guest/vermagic +++ b/targets/x86-kvm_guest/vermagic @@ -1 +1 @@ -23b9575454f0084518a8c2f51423207c +9023fccdcd64c8d92778dee7bd1576dc From d15e7118ea0269d1bdf94af55f382c4d91512cd8 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 16 Jun 2015 17:04:58 +0200 Subject: [PATCH 009/867] Update modules --- modules | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules b/modules index b7e46211..50e35c0b 100644 --- a/modules +++ b/modules @@ -1,18 +1,18 @@ GLUON_FEEDS='openwrt gluon routing luci' OPENWRT_REPO=git://git.openwrt.org/15.05/openwrt.git -OPENWRT_COMMIT=e0a389d68300240411922693f75c4acb81ee7730 +OPENWRT_COMMIT=ef302858d2edf30f356c0d00943e894c0cafc3c4 PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git -PACKAGES_OPENWRT_COMMIT=f109732f56fb00a7db4d9e966e9356dc71359f73 +PACKAGES_OPENWRT_COMMIT=2bff28cf8f268365a3a0a9f94322be69aae07885 PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git PACKAGES_GLUON_COMMIT=dcc5a5ab74822492877eadcba5fc3ad845ee65db PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git -PACKAGES_ROUTING_COMMIT=aca8cb6ee36812f05aacba48602666abbd02d0d6 +PACKAGES_ROUTING_COMMIT=b760a5e09d5a2ba3a4de5a19258ebdbb3d9cf846 PACKAGES_LUCI_REPO=git://github.com/openwrt/luci.git -PACKAGES_LUCI_COMMIT=65e5e0dd895732491452206eeae60733db66a1f8 +PACKAGES_LUCI_COMMIT=f27ebb620c83d033f4a99423d4740cfc5e23fd2c PACKAGES_LUCI_BRANCH=for-15.05 From 86ba583f4603c1ab12fd3f99d26571b7110ac5c8 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 18 Jun 2015 02:40:18 +0200 Subject: [PATCH 010/867] Update modules --- modules | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules b/modules index 50e35c0b..a50dc1aa 100644 --- a/modules +++ b/modules @@ -1,18 +1,18 @@ GLUON_FEEDS='openwrt gluon routing luci' OPENWRT_REPO=git://git.openwrt.org/15.05/openwrt.git -OPENWRT_COMMIT=ef302858d2edf30f356c0d00943e894c0cafc3c4 +OPENWRT_COMMIT=0157ef1216d327ccd8a6fd7d3af33c05ed7717a9 PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git -PACKAGES_OPENWRT_COMMIT=2bff28cf8f268365a3a0a9f94322be69aae07885 +PACKAGES_OPENWRT_COMMIT=50b79a9e8644752820d77e5d12d239b8c9536426 PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git PACKAGES_GLUON_COMMIT=dcc5a5ab74822492877eadcba5fc3ad845ee65db PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git -PACKAGES_ROUTING_COMMIT=b760a5e09d5a2ba3a4de5a19258ebdbb3d9cf846 +PACKAGES_ROUTING_COMMIT=09beed4a4aa120f3f5a505c8763caa03510a0372 PACKAGES_LUCI_REPO=git://github.com/openwrt/luci.git -PACKAGES_LUCI_COMMIT=f27ebb620c83d033f4a99423d4740cfc5e23fd2c +PACKAGES_LUCI_COMMIT=8005ecb2b9e52baa4f276c6cdba01fefec78fc3f PACKAGES_LUCI_BRANCH=for-15.05 From 449a18f8344a225370c3592dff5269372f3f7a86 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 15 Jun 2015 22:40:11 +0200 Subject: [PATCH 011/867] docs: releases/v2015.1.1 --- docs/index.rst | 1 + docs/releases/v2015.1.1.rst | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 docs/releases/v2015.1.1.rst diff --git a/docs/index.rst b/docs/index.rst index 92fb58b7..2235dc54 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -49,6 +49,7 @@ Releases .. toctree:: :maxdepth: 1 + releases/v2015.1.1 releases/v2015.1 releases/v2014.4 releases/v2014.3.1 diff --git a/docs/releases/v2015.1.1.rst b/docs/releases/v2015.1.1.rst new file mode 100644 index 00000000..4800dc19 --- /dev/null +++ b/docs/releases/v2015.1.1.rst @@ -0,0 +1,27 @@ +Gluon 2015.1.1 +============== + +Added hardware support +~~~~~~~~~~~~~~~~~~~~~~ +ar71xx-generic +^^^^^^^^^^^^^^ + +* TP-Link + + - TL-WA830RE (v1) + +New features +~~~~~~~~~~~~ +The `x86-generic` and `x86-kvm_guest` images now support two ethernet interfaces by default. If two interfaces exist during +the first boot, `eth0` will be used as LAN and `eth1` as WAN. + +Bugfixes +~~~~~~~~ + +* Fix German "Expert Mode" label (was "Export Mode") +* Fix download of OpenSSL during build (because of broken OpenSSL download servers...) +* Fix ABI break causing kernel panics when trying to use network-related modules from the official OpenWrt repository (like `kmod-pppoe`) +* Fix race conditions breaking parallel build occasionally +* A broken network configuration would be generated when an older Gluon version was updated to 2015.1 with + ``mesh_on_lan`` enabled in `site.conf` +* Minor announced/alfred JSON format fixes (don't output empty lists where empty objects would be expected) From 094721f86224fdcd356ea85823a115c8c9c8944d Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 18 Jun 2015 20:10:55 +0200 Subject: [PATCH 012/867] Update OpenWrt base --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index a50dc1aa..f8750419 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=0157ef1216d327ccd8a6fd7d3af33c05ed7717a9 +OPENWRT_COMMIT=28fb2e2a3678229f5442a3688a0e72b652f2f0ff PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git PACKAGES_OPENWRT_COMMIT=50b79a9e8644752820d77e5d12d239b8c9536426 From c2d4c490200be86c127d4699dee321610c2763c8 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 19 Jun 2015 14:32:38 +0200 Subject: [PATCH 013/867] Update modules --- modules | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules b/modules index f8750419..13b4dbdf 100644 --- a/modules +++ b/modules @@ -1,17 +1,17 @@ GLUON_FEEDS='openwrt gluon routing luci' OPENWRT_REPO=git://git.openwrt.org/15.05/openwrt.git -OPENWRT_COMMIT=28fb2e2a3678229f5442a3688a0e72b652f2f0ff +OPENWRT_COMMIT=93d2b4121b162432e281e5c5aef51faf83ea1c79 PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git -PACKAGES_OPENWRT_COMMIT=50b79a9e8644752820d77e5d12d239b8c9536426 +PACKAGES_OPENWRT_COMMIT=4a44bd069ed769233d4f9df855d7f5fc1a3e604c PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git PACKAGES_GLUON_COMMIT=dcc5a5ab74822492877eadcba5fc3ad845ee65db PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git -PACKAGES_ROUTING_COMMIT=09beed4a4aa120f3f5a505c8763caa03510a0372 +PACKAGES_ROUTING_COMMIT=fcf34a758ee90cdf3c03c39cc2e52f91388c5799 PACKAGES_LUCI_REPO=git://github.com/openwrt/luci.git PACKAGES_LUCI_COMMIT=8005ecb2b9e52baa4f276c6cdba01fefec78fc3f From b5d01f81df88866c601635661f4d30cfb9f97edd Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 20 Jun 2015 22:20:53 +0200 Subject: [PATCH 014/867] Remove oldpackages opkg.conf entry The oldpackages repo has been dropped for Chaos Calmer. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f8a4f85e..151ce012 100644 --- a/Makefile +++ b/Makefile @@ -368,7 +368,7 @@ endif opkg_config: FORCE cp $(GLUON_OPENWRTDIR)/package/system/opkg/files/opkg.conf $(TARGET_DIR)/etc/opkg.conf - for d in base luci packages routing telephony management oldpackages; do \ + for d in base packages luci routing telephony management; do \ echo "src/gz %n_$$d %U/$$d" >> $(TARGET_DIR)/etc/opkg.conf; \ done $(VERSION_SED) $(TARGET_DIR)/etc/opkg.conf From 0df337fbe4d65b47ee9d04d28e51ff2b4bd639fa Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 21 Jun 2015 05:57:23 +0200 Subject: [PATCH 015/867] Fix routing from node to mesh Recent changes in the routing configuration of OpenWrt broke source address selection, sometimes leading to the node trying to contact other addresses in the mesh network from the next-node address. Revert the problematic commits until this has been solved upstream. --- ...g-PIOs-as-sent-by-some-apple-routers.patch | 34 +++ ...sourcerouting-parameter-registration.patch | 18 ++ ...sourcerouting-parameter-registration.patch | 18 ++ ...eded-source-dest-routing-workarounds.patch | 214 ++++++++++++++++++ ...SAS-fixes-for-source-specific-routes.patch | 108 +++++++++ 5 files changed, 392 insertions(+) create mode 100644 patches/openwrt/0009-Revert-odhcp6c-work-around-RIOs-matching-PIOs-as-sent-by-some-apple-routers.patch create mode 100644 patches/openwrt/0010-Revert-6to4-Remove-sourcerouting-parameter-registration.patch create mode 100644 patches/openwrt/0011-Revert-6rd-Remove-sourcerouting-parameter-registration.patch create mode 100644 patches/openwrt/0012-Revert-ipv6-remove-now-unneeded-source-dest-routing-workarounds.patch create mode 100644 patches/openwrt/0013-Revert-linux-backport-IPv6-SAS-fixes-for-source-specific-routes.patch diff --git a/patches/openwrt/0009-Revert-odhcp6c-work-around-RIOs-matching-PIOs-as-sent-by-some-apple-routers.patch b/patches/openwrt/0009-Revert-odhcp6c-work-around-RIOs-matching-PIOs-as-sent-by-some-apple-routers.patch new file mode 100644 index 00000000..65120445 --- /dev/null +++ b/patches/openwrt/0009-Revert-odhcp6c-work-around-RIOs-matching-PIOs-as-sent-by-some-apple-routers.patch @@ -0,0 +1,34 @@ +From: Matthias Schiffer +Date: Sun, 21 Jun 2015 05:47:46 +0200 +Subject: Revert "odhcp6c: work around RIOs matching PIOs as sent by some apple routers" + +This reverts commit c46402e106ee924e3861f9685d6187552e7f8f2b. + +diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile +index d0935eb..a90f5ce 100644 +--- a/package/network/ipv6/odhcp6c/Makefile ++++ b/package/network/ipv6/odhcp6c/Makefile +@@ -8,7 +8,7 @@ + include $(TOPDIR)/rules.mk + + PKG_NAME:=odhcp6c +-PKG_VERSION:=2015-06-10 ++PKG_VERSION:=2015-06-09 + PKG_RELEASE=$(PKG_SOURCE_VERSION) + + PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.script b/package/network/ipv6/odhcp6c/files/dhcpv6.script +index 84eb706..650c9b2 100755 +--- a/package/network/ipv6/odhcp6c/files/dhcpv6.script ++++ b/package/network/ipv6/odhcp6c/files/dhcpv6.script +@@ -88,10 +88,6 @@ setup_interface () { + + if [ -z "$gw" ]; then + proto_add_ipv6_route "$addr" "$mask" "$gw" "$metric" "$valid" +- +- # work around if there is a PIO matching a RIO +- # Linux seems to prefer source-dest over dest-only even if metric is higher +- proto_add_ipv6_route "$addr" "$mask" "$gw" "$metric" "$valid" "$addr/$mask" + else + for prefix in $PREFIXES $ADDRESSES; do + local paddr="${prefix%%,*}" diff --git a/patches/openwrt/0010-Revert-6to4-Remove-sourcerouting-parameter-registration.patch b/patches/openwrt/0010-Revert-6to4-Remove-sourcerouting-parameter-registration.patch new file mode 100644 index 00000000..63d6b796 --- /dev/null +++ b/patches/openwrt/0010-Revert-6to4-Remove-sourcerouting-parameter-registration.patch @@ -0,0 +1,18 @@ +From: Matthias Schiffer +Date: Sun, 21 Jun 2015 05:47:54 +0200 +Subject: Revert "6to4: Remove sourcerouting parameter registration" + +This reverts commit b64e2fa3f75b9ae21d670a9084ca855ea39c25e6. + +diff --git a/package/network/ipv6/6to4/files/6to4.sh b/package/network/ipv6/6to4/files/6to4.sh +index a5d0567..57efc52 100755 +--- a/package/network/ipv6/6to4/files/6to4.sh ++++ b/package/network/ipv6/6to4/files/6to4.sh +@@ -91,6 +91,7 @@ proto_6to4_init_config() { + proto_config_add_int "mtu" + proto_config_add_int "ttl" + proto_config_add_string "tos" ++ proto_config_add_boolean "sourcerouting" + } + + [ -n "$INCLUDE_ONLY" ] || { diff --git a/patches/openwrt/0011-Revert-6rd-Remove-sourcerouting-parameter-registration.patch b/patches/openwrt/0011-Revert-6rd-Remove-sourcerouting-parameter-registration.patch new file mode 100644 index 00000000..0be7d722 --- /dev/null +++ b/patches/openwrt/0011-Revert-6rd-Remove-sourcerouting-parameter-registration.patch @@ -0,0 +1,18 @@ +From: Matthias Schiffer +Date: Sun, 21 Jun 2015 05:48:01 +0200 +Subject: Revert "6rd: Remove sourcerouting parameter registration" + +This reverts commit cedaf068bf920099483adfad2e106e35737c964f. + +diff --git a/package/network/ipv6/6rd/files/6rd.sh b/package/network/ipv6/6rd/files/6rd.sh +index 62d35b6..6c68b3b 100644 +--- a/package/network/ipv6/6rd/files/6rd.sh ++++ b/package/network/ipv6/6rd/files/6rd.sh +@@ -94,6 +94,7 @@ proto_6rd_init_config() { + proto_config_add_string "ip6prefixlen" + proto_config_add_string "ip4prefixlen" + proto_config_add_string "tunlink" ++ proto_config_add_boolean "sourcerouting" + proto_config_add_string "zone" + } + diff --git a/patches/openwrt/0012-Revert-ipv6-remove-now-unneeded-source-dest-routing-workarounds.patch b/patches/openwrt/0012-Revert-ipv6-remove-now-unneeded-source-dest-routing-workarounds.patch new file mode 100644 index 00000000..5c7b5d4c --- /dev/null +++ b/patches/openwrt/0012-Revert-ipv6-remove-now-unneeded-source-dest-routing-workarounds.patch @@ -0,0 +1,214 @@ +From: Matthias Schiffer +Date: Sun, 21 Jun 2015 05:48:45 +0200 +Subject: Revert "ipv6: remove now unneeded source-dest-routing workarounds" + +This reverts commit 31214c38c8dd0f70366b523f9b0335145b9386bd. + +diff --git a/package/network/ipv6/6in4/Makefile b/package/network/ipv6/6in4/Makefile +index b7c2da7..21e69e6 100644 +--- a/package/network/ipv6/6in4/Makefile ++++ b/package/network/ipv6/6in4/Makefile +@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk + + PKG_NAME:=6in4 + PKG_VERSION:=21 +-PKG_RELEASE:=2 ++PKG_RELEASE:=1 + PKG_LICENSE:=GPL-2.0 + + include $(INCLUDE_DIR)/package.mk +diff --git a/package/network/ipv6/6in4/files/6in4.sh b/package/network/ipv6/6in4/files/6in4.sh +index af2ddca..0289df3 100755 +--- a/package/network/ipv6/6in4/files/6in4.sh ++++ b/package/network/ipv6/6in4/files/6in4.sh +@@ -27,8 +27,8 @@ proto_6in4_setup() { + local iface="$2" + local link="6in4-$cfg" + +- local mtu ttl tos ipaddr peeraddr ip6addr ip6prefix tunnelid username password updatekey +- json_get_vars mtu ttl tos ipaddr peeraddr ip6addr ip6prefix tunnelid username password updatekey ++ local mtu ttl tos ipaddr peeraddr ip6addr ip6prefix tunnelid username password updatekey sourcerouting ++ json_get_vars mtu ttl tos ipaddr peeraddr ip6addr ip6prefix tunnelid username password updatekey sourcerouting + + [ -z "$peeraddr" ] && { + proto_notify_error "$cfg" "MISSING_ADDRESS" +@@ -48,17 +48,21 @@ proto_6in4_setup() { + + proto_init_update "$link" 1 + ++ local source="" ++ [ "$sourcerouting" != "0" ] && source="::/128" ++ proto_add_ipv6_route "::" 0 "" "" "" "$source" ++ + [ -n "$ip6addr" ] && { + local local6="${ip6addr%%/*}" + local mask6="${ip6addr##*/}" + [[ "$local6" = "$mask6" ]] && mask6= + proto_add_ipv6_address "$local6" "$mask6" +- proto_add_ipv6_route "::" 0 "" "" "" "$local6/$mask6" ++ [ "$sourcerouting" != "0" ] && proto_add_ipv6_route "::" 0 "" "" "" "$local6/$mask6" + } + + [ -n "$ip6prefix" ] && { + proto_add_ipv6_prefix "$ip6prefix" +- proto_add_ipv6_route "::" 0 "" "" "" "$ip6prefix" ++ [ "$sourcerouting" != "0" ] && proto_add_ipv6_route "::" 0 "" "" "" "$ip6prefix" + } + + proto_add_tunnel +@@ -142,6 +146,7 @@ proto_6in4_init_config() { + proto_config_add_int "mtu" + proto_config_add_int "ttl" + proto_config_add_string "tos" ++ proto_config_add_boolean "sourcerouting" + } + + [ -n "$INCLUDE_ONLY" ] || { +diff --git a/package/network/ipv6/6rd/Makefile b/package/network/ipv6/6rd/Makefile +index cde7117..f9b7eae 100644 +--- a/package/network/ipv6/6rd/Makefile ++++ b/package/network/ipv6/6rd/Makefile +@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk + + PKG_NAME:=6rd + PKG_VERSION:=9 +-PKG_RELEASE:=2 ++PKG_RELEASE:=1 + PKG_LICENSE:=GPL-2.0 + + include $(INCLUDE_DIR)/package.mk +diff --git a/package/network/ipv6/6rd/files/6rd.sh b/package/network/ipv6/6rd/files/6rd.sh +index 6c68b3b..b485136 100644 +--- a/package/network/ipv6/6rd/files/6rd.sh ++++ b/package/network/ipv6/6rd/files/6rd.sh +@@ -14,8 +14,8 @@ proto_6rd_setup() { + local iface="$2" + local link="6rd-$cfg" + +- local mtu df ttl tos ipaddr peeraddr ip6prefix ip6prefixlen ip4prefixlen tunlink zone +- json_get_vars mtu df ttl tos ipaddr peeraddr ip6prefix ip6prefixlen ip4prefixlen tunlink zone ++ local mtu df ttl tos ipaddr peeraddr ip6prefix ip6prefixlen ip4prefixlen tunlink sourcerouting zone ++ json_get_vars mtu df ttl tos ipaddr peeraddr ip6prefix ip6prefixlen ip4prefixlen tunlink sourcerouting zone + + [ -z "$ip6prefix" -o -z "$peeraddr" ] && { + proto_notify_error "$cfg" "MISSING_ADDRESS" +@@ -54,8 +54,13 @@ proto_6rd_setup() { + proto_add_ipv6_address "$ip6addr" "$ip6prefixlen" + proto_add_ipv6_prefix "$ip6lanprefix" + +- proto_add_ipv6_route "::" 0 "::$peeraddr" 4096 "" "$ip6addr/$ip6prefixlen" +- proto_add_ipv6_route "::" 0 "::$peeraddr" 4096 "" "$ip6lanprefix" ++ if [ "$sourcerouting" != "0" ]; then ++ proto_add_ipv6_route "::" 0 "::$peeraddr" 4096 "" "::/128" ++ proto_add_ipv6_route "::" 0 "::$peeraddr" 4096 "" "$ip6addr/$ip6prefixlen" ++ proto_add_ipv6_route "::" 0 "::$peeraddr" 4096 "" "$ip6lanprefix" ++ else ++ proto_add_ipv6_route "::" 0 "::$peeraddr" 4096 ++ fi + + proto_add_tunnel + json_add_string mode sit +diff --git a/package/network/ipv6/6to4/Makefile b/package/network/ipv6/6to4/Makefile +index fcec90d..6be2cc5 100644 +--- a/package/network/ipv6/6to4/Makefile ++++ b/package/network/ipv6/6to4/Makefile +@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk + + PKG_NAME:=6to4 + PKG_VERSION:=12 +-PKG_RELEASE:=2 ++PKG_RELEASE:=1 + PKG_LICENSE:=GPL-2.0 + + include $(INCLUDE_DIR)/package.mk +diff --git a/package/network/ipv6/6to4/files/6to4.sh b/package/network/ipv6/6to4/files/6to4.sh +index 57efc52..ce1de53 100755 +--- a/package/network/ipv6/6to4/files/6to4.sh ++++ b/package/network/ipv6/6to4/files/6to4.sh +@@ -34,8 +34,8 @@ proto_6to4_setup() { + local iface="$2" + local link="6to4-$cfg" + +- local mtu ttl tos ipaddr +- json_get_vars mtu ttl tos ipaddr ++ local mtu ttl tos ipaddr sourcerouting ++ json_get_vars mtu ttl tos ipaddr sourcerouting + + ( proto_add_host_dependency "$cfg" 0.0.0.0 ) + +@@ -65,8 +65,13 @@ proto_6to4_setup() { + proto_add_ipv6_address "$local6" 16 + proto_add_ipv6_prefix "$prefix6::/48" + +- proto_add_ipv6_route "::" 0 "::192.88.99.1" "" "" "$local6/16" +- proto_add_ipv6_route "::" 0 "::192.88.99.1" "" "" "$prefix6::/48" ++ if [ "$sourcerouting" != "0" ]; then ++ proto_add_ipv6_route "::" 0 "::192.88.99.1" "" "" "::/128" ++ proto_add_ipv6_route "::" 0 "::192.88.99.1" "" "" "$local6/16" ++ proto_add_ipv6_route "::" 0 "::192.88.99.1" "" "" "$prefix6::/48" ++ else ++ proto_add_ipv6_route "::" 0 "::192.88.99.1" ++ fi + + proto_add_tunnel + json_add_string mode sit +diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile +index a90f5ce..ddd6917 100644 +--- a/package/network/ipv6/odhcp6c/Makefile ++++ b/package/network/ipv6/odhcp6c/Makefile +@@ -8,7 +8,7 @@ + include $(TOPDIR)/rules.mk + + PKG_NAME:=odhcp6c +-PKG_VERSION:=2015-06-09 ++PKG_VERSION:=2015-05-16 + PKG_RELEASE=$(PKG_SOURCE_VERSION) + + PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.script b/package/network/ipv6/odhcp6c/files/dhcpv6.script +index 650c9b2..6cd59fa 100755 +--- a/package/network/ipv6/odhcp6c/files/dhcpv6.script ++++ b/package/network/ipv6/odhcp6c/files/dhcpv6.script +@@ -86,9 +86,10 @@ setup_interface () { + entry="${entry#*,}" + local metric="${entry%%,*}" + +- if [ -z "$gw" ]; then ++ if [ -z "$SOURCE_ROUTING" -o -z "$gw" ]; then + proto_add_ipv6_route "$addr" "$mask" "$gw" "$metric" "$valid" + else ++ proto_add_ipv6_route "$addr" "$mask" "$gw" "$metric" "$valid" "::/128" + for prefix in $PREFIXES $ADDRESSES; do + local paddr="${prefix%%,*}" + proto_add_ipv6_route "$addr" "$mask" "$gw" "$metric" "$valid" "$paddr" +diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.sh b/package/network/ipv6/odhcp6c/files/dhcpv6.sh +index adcb100..9fb6fa3 100755 +--- a/package/network/ipv6/odhcp6c/files/dhcpv6.sh ++++ b/package/network/ipv6/odhcp6c/files/dhcpv6.sh +@@ -23,6 +23,7 @@ proto_dhcpv6_init_config() { + proto_config_add_string zone_464xlat + proto_config_add_string zone + proto_config_add_string 'ifaceid:ip6addr' ++ proto_config_add_string 'sourcerouting:bool' + proto_config_add_string "userclass" + proto_config_add_string "vendorclass" + proto_config_add_boolean delegate +@@ -34,8 +35,8 @@ proto_dhcpv6_setup() { + local config="$1" + local iface="$2" + +- local reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes +- json_get_vars reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes ++ local reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid sourcerouting userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes ++ json_get_vars reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid sourcerouting userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes + + + # Configure +@@ -69,6 +70,7 @@ proto_dhcpv6_setup() { + [ -n "$iface_dslite" ] && proto_export "IFACE_DSLITE=$iface_dslite" + [ -n "$iface_map" ] && proto_export "IFACE_MAP=$iface_map" + [ -n "$iface_464xlat" ] && proto_export "IFACE_464XLAT=$iface_464xlat" ++ [ "$sourcerouting" != "0" ] && proto_export "SOURCE_ROUTING=1" + [ "$delegate" = "0" ] && proto_export "IFACE_DSLITE_DELEGATE=0" + [ "$delegate" = "0" ] && proto_export "IFACE_MAP_DELEGATE=0" + [ -n "$zone_dslite" ] && proto_export "ZONE_DSLITE=$zone_dslite" diff --git a/patches/openwrt/0013-Revert-linux-backport-IPv6-SAS-fixes-for-source-specific-routes.patch b/patches/openwrt/0013-Revert-linux-backport-IPv6-SAS-fixes-for-source-specific-routes.patch new file mode 100644 index 00000000..1bc94146 --- /dev/null +++ b/patches/openwrt/0013-Revert-linux-backport-IPv6-SAS-fixes-for-source-specific-routes.patch @@ -0,0 +1,108 @@ +From: Matthias Schiffer +Date: Sun, 21 Jun 2015 05:49:05 +0200 +Subject: Revert "linux: backport IPv6 SAS fixes for source-specific routes" + +This reverts commit 5168c9a5702648eb690d32ec821647aca80aeba9. + +diff --git a/target/linux/generic/patches-3.18/667-ipv6-Fixed-source-specific-default-route-handling.patch b/target/linux/generic/patches-3.18/667-ipv6-Fixed-source-specific-default-route-handling.patch +deleted file mode 100644 +index f67ef47..0000000 +--- a/target/linux/generic/patches-3.18/667-ipv6-Fixed-source-specific-default-route-handling.patch ++++ /dev/null +@@ -1,96 +0,0 @@ +-From e16e888b525503be05b3aea64190e8b3bdef44d0 Mon Sep 17 00:00:00 2001 +-From: Markus Stenberg +-Date: Tue, 5 May 2015 13:36:59 +0300 +-Subject: [PATCH] ipv6: Fixed source specific default route handling. +- +-If there are only IPv6 source specific default routes present, the +-host gets -ENETUNREACH on e.g. connect() because ip6_dst_lookup_tail +-calls ip6_route_output first, and given source address any, it fails, +-and ip6_route_get_saddr is never called. +- +-The change is to use the ip6_route_get_saddr, even if the initial +-ip6_route_output fails, and then doing ip6_route_output _again_ after +-we have appropriate source address available. +- +-Note that this is '99% fix' to the problem; a correct fix would be to +-do route lookups only within addrconf.c when picking a source address, +-and never call ip6_route_output before source address has been +-populated. +- +-Signed-off-by: Markus Stenberg +-Signed-off-by: David S. Miller +---- +- net/ipv6/ip6_output.c | 39 +++++++++++++++++++++++++++++++-------- +- net/ipv6/route.c | 5 +++-- +- 2 files changed, 34 insertions(+), 10 deletions(-) +- +---- a/net/ipv6/ip6_output.c +-+++ b/net/ipv6/ip6_output.c +-@@ -898,21 +898,45 @@ static int ip6_dst_lookup_tail(struct so +- #endif +- int err; +- +-- if (*dst == NULL) +-- *dst = ip6_route_output(net, sk, fl6); +-- +-- if ((err = (*dst)->error)) +-- goto out_err_release; +-+ /* The correct way to handle this would be to do +-+ * ip6_route_get_saddr, and then ip6_route_output; however, +-+ * the route-specific preferred source forces the +-+ * ip6_route_output call _before_ ip6_route_get_saddr. +-+ * +-+ * In source specific routing (no src=any default route), +-+ * ip6_route_output will fail given src=any saddr, though, so +-+ * that's why we try it again later. +-+ */ +-+ if (ipv6_addr_any(&fl6->saddr) && (!*dst || !(*dst)->error)) { +-+ struct rt6_info *rt; +-+ bool had_dst = *dst != NULL; +- +-- if (ipv6_addr_any(&fl6->saddr)) { +-- struct rt6_info *rt = (struct rt6_info *) *dst; +-+ if (!had_dst) +-+ *dst = ip6_route_output(net, sk, fl6); +-+ rt = (*dst)->error ? NULL : (struct rt6_info *)*dst; +- err = ip6_route_get_saddr(net, rt, &fl6->daddr, +- sk ? inet6_sk(sk)->srcprefs : 0, +- &fl6->saddr); +- if (err) +- goto out_err_release; +-+ +-+ /* If we had an erroneous initial result, pretend it +-+ * never existed and let the SA-enabled version take +-+ * over. +-+ */ +-+ if (!had_dst && (*dst)->error) { +-+ dst_release(*dst); +-+ *dst = NULL; +-+ } +- } +- +-+ if (!*dst) +-+ *dst = ip6_route_output(net, sk, fl6); +-+ +-+ err = (*dst)->error; +-+ if (err) +-+ goto out_err_release; +-+ +- #ifdef CONFIG_IPV6_OPTIMISTIC_DAD +- /* +- * Here if the dst entry we've looked up +---- a/net/ipv6/route.c +-+++ b/net/ipv6/route.c +-@@ -2182,9 +2182,10 @@ int ip6_route_get_saddr(struct net *net, +- unsigned int prefs, +- struct in6_addr *saddr) +- { +-- struct inet6_dev *idev = ip6_dst_idev((struct dst_entry *)rt); +-+ struct inet6_dev *idev = +-+ rt ? ip6_dst_idev((struct dst_entry *)rt) : NULL; +- int err = 0; +-- if (rt->rt6i_prefsrc.plen) +-+ if (rt && rt->rt6i_prefsrc.plen) +- *saddr = rt->rt6i_prefsrc.addr; +- else +- err = ipv6_dev_get_saddr(net, idev ? idev->dev : NULL, From 370544f3b42bb6a805b13393ca193870fa33be45 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 21 Jun 2015 21:10:45 +0200 Subject: [PATCH 016/867] Update OpenWrt base and packages --- modules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules b/modules index 13b4dbdf..fd19f01c 100644 --- a/modules +++ b/modules @@ -1,10 +1,10 @@ GLUON_FEEDS='openwrt gluon routing luci' OPENWRT_REPO=git://git.openwrt.org/15.05/openwrt.git -OPENWRT_COMMIT=93d2b4121b162432e281e5c5aef51faf83ea1c79 +OPENWRT_COMMIT=4004819a1c91de2d2c06b1e0d52609460bf3cab3 PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git -PACKAGES_OPENWRT_COMMIT=4a44bd069ed769233d4f9df855d7f5fc1a3e604c +PACKAGES_OPENWRT_COMMIT=8cb6f4c09e75f874771c52091404b975fd373d49 PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git From bccfc0419e4c12acde4cb0391460b5660223a241 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 21 Jun 2015 23:01:58 +0200 Subject: [PATCH 017/867] Add support for TP-LINK TL-WR740N/TL-WR741ND The TL-WR741ND will identify itself as a TL-WR740N/ND as well. This is fine as the images are identical anyways. --- ...d-support-for-tp-link-wr740n-v5.0-EU.patch | 39 +++++++++++++++++++ ...ar71xx-add-support-for-TL-WR741ND-v5.patch | 35 +++++++++++++++++ targets/ar71xx-generic/profiles.mk | 6 ++- 3 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 patches/openwrt/0014-ar71xx-add-support-for-tp-link-wr740n-v5.0-EU.patch create mode 100644 patches/openwrt/0015-ar71xx-add-support-for-TL-WR741ND-v5.patch diff --git a/patches/openwrt/0014-ar71xx-add-support-for-tp-link-wr740n-v5.0-EU.patch b/patches/openwrt/0014-ar71xx-add-support-for-tp-link-wr740n-v5.0-EU.patch new file mode 100644 index 00000000..a2a77083 --- /dev/null +++ b/patches/openwrt/0014-ar71xx-add-support-for-tp-link-wr740n-v5.0-EU.patch @@ -0,0 +1,39 @@ +From: Matthias Schiffer +Date: Sun, 21 Jun 2015 22:50:48 +0200 +Subject: ar71xx: add support for tp-link wr740n v5.0 (EU) + +TP-Link ships wr740n v5.0 to Romania (so probably everywhere except +China) with 4 MB flash and 32 MB memory (confirmed by their local +support). This patch adds support for the v5.0 clone of v4, i just +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 c8ed2ec..a233349 100644 +--- a/target/linux/ar71xx/image/Makefile ++++ b/target/linux/ar71xx/image/Makefile +@@ -459,6 +459,14 @@ define Device/tl-wr740n-v4 + CONSOLE := ttyATH0,115200 + endef + ++define Device/tl-wr740n-v5 ++ $(Device/tplink-4mlzma) ++ BOARDNAME := TL-WR741ND-v4 ++ DEVICE_PROFILE := TLWR740 ++ TPLINK_HWID := 0x07400005 ++ CONSOLE := ttyATH0,115200 ++endef ++ + define Device/tl-wr741nd-v1 + $(Device/tplink-4m) + BOARDNAME := TL-WR741ND +@@ -488,7 +496,7 @@ define Device/tl-wr743nd-v2 + TPLINK_HWID := 0x07430002 + CONSOLE := ttyATH0,115200 + endef +-TARGET_DEVICES += tl-wr740n-v4 tl-wr741nd-v1 tl-wr741nd-v2 tl-wr741nd-v4 tl-wr743nd-v2 ++TARGET_DEVICES += tl-wr740n-v4 tl-wr740n-v5 tl-wr741nd-v1 tl-wr741nd-v2 tl-wr741nd-v4 tl-wr743nd-v2 + + define Device/tl-wr841n-v8 + $(Device/tplink-4mlzma) diff --git a/patches/openwrt/0015-ar71xx-add-support-for-TL-WR741ND-v5.patch b/patches/openwrt/0015-ar71xx-add-support-for-TL-WR741ND-v5.patch new file mode 100644 index 00000000..d4c0f9d5 --- /dev/null +++ b/patches/openwrt/0015-ar71xx-add-support-for-TL-WR741ND-v5.patch @@ -0,0 +1,35 @@ +From: Matthias Schiffer +Date: Sun, 21 Jun 2015 22:48:04 +0200 +Subject: ar71xx: add support for TL-WR741ND v5 + +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 a233349..2615244 100644 +--- a/target/linux/ar71xx/image/Makefile ++++ b/target/linux/ar71xx/image/Makefile +@@ -489,6 +489,14 @@ define Device/tl-wr741nd-v4 + CONSOLE := ttyATH0,115200 + endef + ++define Device/tl-wr741nd-v5 ++ $(Device/tplink-4mlzma) ++ BOARDNAME := TL-WR741ND-v4 ++ DEVICE_PROFILE := TLWR741 ++ TPLINK_HWID := 0x07400005 ++ CONSOLE := ttyATH0,115200 ++endef ++ + define Device/tl-wr743nd-v2 + $(Device/tplink-4mlzma) + BOARDNAME := TL-WR741ND-v4 +@@ -496,7 +504,7 @@ define Device/tl-wr743nd-v2 + TPLINK_HWID := 0x07430002 + CONSOLE := ttyATH0,115200 + endef +-TARGET_DEVICES += tl-wr740n-v4 tl-wr740n-v5 tl-wr741nd-v1 tl-wr741nd-v2 tl-wr741nd-v4 tl-wr743nd-v2 ++TARGET_DEVICES += tl-wr740n-v4 tl-wr740n-v5 tl-wr741nd-v1 tl-wr741nd-v2 tl-wr741nd-v4 tl-wr741nd-v5 tl-wr743nd-v2 + + define Device/tl-wr841n-v8 + $(Device/tplink-4mlzma) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 7be12d57..5634c662 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -24,17 +24,19 @@ $(eval $(call GluonModel,TLWR703,tl-wr703n-v1,tp-link-tl-wr703n-v1)) $(eval $(call GluonProfile,TLWR710)) $(eval $(call GluonModel,TLWR710,tl-wr710n-v1,tp-link-tl-wr710n-v1)) -# TL-WR740N v1, v3, v4 +# TL-WR740N v1, v3, v4, v5 $(eval $(call GluonProfile,TLWR740)) $(eval $(call GluonModel,TLWR740,tl-wr740n-v1,tp-link-tl-wr740n-nd-v1)) $(eval $(call GluonModel,TLWR740,tl-wr740n-v3,tp-link-tl-wr740n-nd-v3)) $(eval $(call GluonModel,TLWR740,tl-wr740n-v4,tp-link-tl-wr740n-nd-v4)) +$(eval $(call GluonModel,TLWR740,tl-wr740n-v5,tp-link-tl-wr740n-nd-v5)) -# TL-WR741N/ND v1, v2, v4 +# TL-WR741N/ND v1, v2, v4, v5 $(eval $(call GluonProfile,TLWR741)) $(eval $(call GluonModel,TLWR741,tl-wr741nd-v1,tp-link-tl-wr741n-nd-v1)) $(eval $(call GluonModel,TLWR741,tl-wr741nd-v2,tp-link-tl-wr741n-nd-v2)) $(eval $(call GluonModel,TLWR741,tl-wr741nd-v4,tp-link-tl-wr741n-nd-v4)) +$(eval $(call GluonModel,TLWR741,tl-wr741nd-v5,tp-link-tl-wr741n-nd-v5)) # TL-WR743N/ND v1, v1.1, v2 $(eval $(call GluonProfile,TLWR743)) From 372335e742fb0635c6b07ec3c5dc0ab5a363ac31 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 26 Jun 2015 00:59:23 +0200 Subject: [PATCH 018/867] Update modules --- modules | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules b/modules index fd19f01c..d6158f4d 100644 --- a/modules +++ b/modules @@ -1,17 +1,17 @@ GLUON_FEEDS='openwrt gluon routing luci' OPENWRT_REPO=git://git.openwrt.org/15.05/openwrt.git -OPENWRT_COMMIT=4004819a1c91de2d2c06b1e0d52609460bf3cab3 +OPENWRT_COMMIT=45af270042373818324b9ed5b57cd77bede6cbf6 PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git -PACKAGES_OPENWRT_COMMIT=8cb6f4c09e75f874771c52091404b975fd373d49 +PACKAGES_OPENWRT_COMMIT=0716433f2e028d64bbdbbfd58f8bdafd2f7fcc48 PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git PACKAGES_GLUON_COMMIT=dcc5a5ab74822492877eadcba5fc3ad845ee65db PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git -PACKAGES_ROUTING_COMMIT=fcf34a758ee90cdf3c03c39cc2e52f91388c5799 +PACKAGES_ROUTING_COMMIT=fdd1fbf6e1605e8d76603c79be7e1c3d9e9148a2 PACKAGES_LUCI_REPO=git://github.com/openwrt/luci.git PACKAGES_LUCI_COMMIT=8005ecb2b9e52baa4f276c6cdba01fefec78fc3f From 28668c8c52187e936c876ed6fec1c68196ac5339 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Fri, 31 Jan 2014 02:04:14 +0100 Subject: [PATCH 019/867] gluon-status-page: API --- package/gluon-status-page/Makefile | 2 +- .../announce/nodeinfo.d/software/status-page | 1 + .../www/cgi-bin/dyn/neighbours-batadv | 32 ++++++++++++ .../www/cgi-bin/dyn/neighbours-nodeinfo | 7 +++ .../status-page/www/cgi-bin/dyn/stations | 52 +++++++++++++++++++ .../status-page/www/cgi-bin/dyn/statistics | 18 +++++++ .../gluon/status-page/www/cgi-bin/interfaces | 24 +++++++++ .../gluon/status-page/www/cgi-bin/nodeinfo | 15 ++++++ 8 files changed, 150 insertions(+), 1 deletion(-) create mode 100644 package/gluon-status-page/files/lib/gluon/announce/nodeinfo.d/software/status-page create mode 100755 package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/dyn/neighbours-batadv create mode 100755 package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/dyn/neighbours-nodeinfo create mode 100755 package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/dyn/stations create mode 100755 package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/dyn/statistics create mode 100755 package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/interfaces create mode 100755 package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/nodeinfo diff --git a/package/gluon-status-page/Makefile b/package/gluon-status-page/Makefile index 4e44e2b2..3d9edbfe 100644 --- a/package/gluon-status-page/Makefile +++ b/package/gluon-status-page/Makefile @@ -12,7 +12,7 @@ define Package/gluon-status-page SECTION:=gluon CATEGORY:=Gluon TITLE:=Adds a status page showing information about the node. - DEPENDS:=+gluon-core +gluon-neighbour-info +uhttpd + DEPENDS:=+gluon-core +uhttpd +gluon-neighbour-info +gluon-announce +libiwinfo-lua endef define Package/gluon-status-page/description diff --git a/package/gluon-status-page/files/lib/gluon/announce/nodeinfo.d/software/status-page b/package/gluon-status-page/files/lib/gluon/announce/nodeinfo.d/software/status-page new file mode 100644 index 00000000..20e865f3 --- /dev/null +++ b/package/gluon-status-page/files/lib/gluon/announce/nodeinfo.d/software/status-page @@ -0,0 +1 @@ +return { api = 1 } diff --git a/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/dyn/neighbours-batadv b/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/dyn/neighbours-batadv new file mode 100755 index 00000000..addecd60 --- /dev/null +++ b/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/dyn/neighbours-batadv @@ -0,0 +1,32 @@ +#!/usr/bin/lua + +local json = require 'luci.json' +local nixio = require 'nixio' + +function neighbours() + local neighbours = {} + local list = io.lines("/sys/kernel/debug/batman_adv/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 + neighbours[mac1] = { tq = tonumber(tq) + , lastseen = tonumber(lastseen) + , ifname = ifname + } + end + end + + return neighbours +end + +io.write("Access-Control-Allow-Origin: *\n") +io.write("Content-type: text/event-stream\n\n") + +while true do + local neighbours = json.encode(neighbours()) + io.write("data: " .. neighbours .. "\n\n") + io.flush() + nixio.nanosleep(1, 0) +end diff --git a/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/dyn/neighbours-nodeinfo b/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/dyn/neighbours-nodeinfo new file mode 100755 index 00000000..34c1204e --- /dev/null +++ b/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/dyn/neighbours-nodeinfo @@ -0,0 +1,7 @@ +#!/bin/sh + +echo 'Access-Control-Allow-Origin: *' + +batctl if | cut -d: -f1 | grep -qxF "$QUERY_STRING" || exit 1 + +exec /usr/bin/gluon-neighbour-info -s -i "$QUERY_STRING" -d ff02::2:1001 -p 1001 -r nodeinfo diff --git a/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/dyn/stations b/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/dyn/stations new file mode 100755 index 00000000..4745c342 --- /dev/null +++ b/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/dyn/stations @@ -0,0 +1,52 @@ +#!/usr/bin/lua + +util = require 'luci.util' +json = require 'luci.json' +nixio = require 'nixio' +iwinfo = require 'iwinfo' + +function badrequest() + io.write("Status: 400 Bad Request\n\n") + os.exit(1) +end + +function get_stations(iw, ifname) + local stations = {} + + for k, v in pairs(iw.assoclist(ifname)) do + stations[k:lower()] = {signal = v.signal, noise = v.noise, inactive = v.inactive} + end + + return stations +end + +local ifname = os.getenv("QUERY_STRING") + +if ifname == nil then badrequest() end + +local list = util.exec('batctl if') +local found = false +for _, line in ipairs(util.split(list)) do + if ifname == line:match('^(.-):') then + found = true + break + end +end + +if found == false then badrequest() end + +local wifitype = iwinfo.type(ifname) + +if wifitype == nil then badrequest() end + +local iw = iwinfo[wifitype] + +io.write("Access-Control-Allow-Origin: *\n") +io.write("Content-type: text/event-stream\n\n") + +while true do + local stations = json.encode(get_stations(iw, ifname)) + io.write("data: " .. stations .. "\n\n") + io.flush() + nixio.nanosleep(0, 150e6) +end diff --git a/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/dyn/statistics b/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/dyn/statistics new file mode 100755 index 00000000..7805afe8 --- /dev/null +++ b/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/dyn/statistics @@ -0,0 +1,18 @@ +#!/usr/bin/lua + +local announce = require 'gluon.announce' +local json = require 'luci.json' +local util = require 'luci.util' +local nixio = require 'nixio' + +local announce_dir = '/lib/gluon/announce/statistics.d/' + +io.write("Access-Control-Allow-Origin: *\n") +io.write("Content-type: text/event-stream\n\n") + +while true do + local data = json.encode(announce.collect_dir(announce_dir)) + io.write("data: " .. data .. "\n\n") + io.flush() + nixio.nanosleep(1, 0) +end diff --git a/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/interfaces b/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/interfaces new file mode 100755 index 00000000..2615ed82 --- /dev/null +++ b/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/interfaces @@ -0,0 +1,24 @@ +#!/usr/bin/lua + +util = require 'luci.util' +json = require 'luci.json' +fs = require 'nixio.fs' + +io.write("Access-Control-Allow-Origin: *\n") +io.write("Content-type: application/json\n\n") + +list = util.exec('batctl if') + +interfaces = {} + +for _, line in ipairs(util.split(list)) do + ifname = line:match('^(.-):') + if ifname ~= nil then + pcall(function() + local address = util.trim(fs.readfile('/sys/class/net/' .. ifname .. '/address')) + interfaces[ifname] = { address = address } + end) + end +end + +io.write(json.encode(interfaces)) diff --git a/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/nodeinfo b/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/nodeinfo new file mode 100755 index 00000000..a2ef61c7 --- /dev/null +++ b/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/nodeinfo @@ -0,0 +1,15 @@ +#!/usr/bin/lua + +local announce = require 'gluon.announce' +local json = require 'luci.json' +local util = require 'luci.util' +local nixio = require 'nixio' + +local announce_dir = '/lib/gluon/announce/nodeinfo.d/' + +io.write("Access-Control-Allow-Origin: *\n") +io.write("Content-type: application/json\n\n") + +local data = json.encode(announce.collect_dir(announce_dir)) +io.write(data) +io.flush() From 4f8ce1232524ef848ace89c0d1214eba89e310b2 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Fri, 22 Aug 2014 14:12:40 +0200 Subject: [PATCH 020/867] uhttpd: set max_requests to 12 This limits the number of concurrent users to 2 or 3 (approx. 4 connections per user), greatly reducing DoS potential. --- .../gluon-status-page/files/lib/gluon/upgrade/500-status-page | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/gluon-status-page/files/lib/gluon/upgrade/500-status-page b/package/gluon-status-page/files/lib/gluon/upgrade/500-status-page index ee7a58c9..71eca5b1 100755 --- a/package/gluon-status-page/files/lib/gluon/upgrade/500-status-page +++ b/package/gluon-status-page/files/lib/gluon/upgrade/500-status-page @@ -9,5 +9,7 @@ uci batch <<-EOF set uhttpd.main.home=/lib/gluon/status-page/www + set uhttpd.main.max_requests=12 + commit uhttpd EOF From 514f14863b009f75aef0a63f24458836bd2b05e8 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 1 Jul 2015 17:17:38 +0200 Subject: [PATCH 021/867] Add support for TP-Link TL-WA801N/ND v1 Tested-by: @RubenKelevra --- targets/ar71xx-generic/profiles.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 5634c662..9eb7b609 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -43,8 +43,9 @@ $(eval $(call GluonProfile,TLWR743)) $(eval $(call GluonModel,TLWR743,tl-wr743nd-v1,tp-link-tl-wr743n-nd-v1)) $(eval $(call GluonModel,TLWR743,tl-wr743nd-v2,tp-link-tl-wr743n-nd-v2)) -# TL-WR801N/ND v2 +# TL-WR801N/ND v1, v2 $(eval $(call GluonProfile,TLWA801)) +$(eval $(call GluonModel,TLWA801,tl-wa801nd-v1,tp-link-tl-wa801n-nd-v1)) $(eval $(call GluonModel,TLWA801,tl-wa801nd-v2,tp-link-tl-wa801n-nd-v2)) # TL-WR841N/ND v3, v5, v7, v8, v9 From 9cff74b5a40cdf3f970eaa39787409e5f12a2f8e Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 1 Jul 2015 23:12:28 +0200 Subject: [PATCH 022/867] Update gluon packages --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index d6158f4d..3ebbce96 100644 --- a/modules +++ b/modules @@ -8,7 +8,7 @@ PACKAGES_OPENWRT_COMMIT=0716433f2e028d64bbdbbfd58f8bdafd2f7fcc48 PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git -PACKAGES_GLUON_COMMIT=dcc5a5ab74822492877eadcba5fc3ad845ee65db +PACKAGES_GLUON_COMMIT=1faf424b35f1c87994ef27638d2deb04793619de PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_COMMIT=fdd1fbf6e1605e8d76603c79be7e1c3d9e9148a2 From 0c6101a7ac8aef843db906adef0afdd63fcecc06 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 2 Jul 2015 00:20:12 +0200 Subject: [PATCH 023/867] Update modules --- modules | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules b/modules index 3ebbce96..13b97b1f 100644 --- a/modules +++ b/modules @@ -1,18 +1,18 @@ GLUON_FEEDS='openwrt gluon routing luci' OPENWRT_REPO=git://git.openwrt.org/15.05/openwrt.git -OPENWRT_COMMIT=45af270042373818324b9ed5b57cd77bede6cbf6 +OPENWRT_COMMIT=9349aab7b4824d588af068bc82784cfd56d3372c PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git -PACKAGES_OPENWRT_COMMIT=0716433f2e028d64bbdbbfd58f8bdafd2f7fcc48 +PACKAGES_OPENWRT_COMMIT=fa7ed79149b371294f12905210bb032610a11621 PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git PACKAGES_GLUON_COMMIT=1faf424b35f1c87994ef27638d2deb04793619de PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git -PACKAGES_ROUTING_COMMIT=fdd1fbf6e1605e8d76603c79be7e1c3d9e9148a2 +PACKAGES_ROUTING_COMMIT=6172dcef329e1b306149cded3340da8f28501266 PACKAGES_LUCI_REPO=git://github.com/openwrt/luci.git -PACKAGES_LUCI_COMMIT=8005ecb2b9e52baa4f276c6cdba01fefec78fc3f +PACKAGES_LUCI_COMMIT=cf2e3f6c20dbdfdc3d8c4d4115cf9c533444e61f PACKAGES_LUCI_BRANCH=for-15.05 From 99fbafdf0ca600de38e79f5581e91f5bc7d2a81c Mon Sep 17 00:00:00 2001 From: Neal Oakey Date: Sat, 4 Jul 2015 17:03:21 +0200 Subject: [PATCH 024/867] TP-Link TL-WA830RE v2: remove BROKEN --- targets/ar71xx-generic/profiles.mk | 2 -- 1 file changed, 2 deletions(-) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 9eb7b609..f02bef40 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -89,9 +89,7 @@ $(eval $(call GluonModel,TLWA750,tl-wa750re-v1,tp-link-tl-wa750re-v1)) # TL-WA830RE v1, v2 $(eval $(call GluonProfile,TLWA830)) $(eval $(call GluonModel,TLWA830,tl-wa830re-v1,tp-link-tl-wa830re-v1)) -ifeq ($(BROKEN),1) $(eval $(call GluonModel,TLWA830,tl-wa830re-v2,tp-link-tl-wa830re-v2)) -endif # TL-WA850RE v1 $(eval $(call GluonProfile,TLWA850)) From 1f3e66cf1447ae57e91ea457f15c17e26ec16eb4 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 2 Jul 2015 23:12:33 +0200 Subject: [PATCH 025/867] Update OpenWrt base --- modules | 2 +- .../0014-ar71xx-add-support-for-tp-link-wr740n-v5.0-EU.patch | 2 +- patches/openwrt/0015-ar71xx-add-support-for-TL-WR741ND-v5.patch | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules b/modules index 13b97b1f..f64e4605 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=9349aab7b4824d588af068bc82784cfd56d3372c +OPENWRT_COMMIT=54b2f42f724c287d720ca4e12b297e9ea76f8a4d PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git PACKAGES_OPENWRT_COMMIT=fa7ed79149b371294f12905210bb032610a11621 diff --git a/patches/openwrt/0014-ar71xx-add-support-for-tp-link-wr740n-v5.0-EU.patch b/patches/openwrt/0014-ar71xx-add-support-for-tp-link-wr740n-v5.0-EU.patch index a2a77083..017ec234 100644 --- a/patches/openwrt/0014-ar71xx-add-support-for-tp-link-wr740n-v5.0-EU.patch +++ b/patches/openwrt/0014-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 c8ed2ec..a233349 100644 +index a2a66b8..3cab3bd 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile @@ -459,6 +459,14 @@ define Device/tl-wr740n-v4 diff --git a/patches/openwrt/0015-ar71xx-add-support-for-TL-WR741ND-v5.patch b/patches/openwrt/0015-ar71xx-add-support-for-TL-WR741ND-v5.patch index d4c0f9d5..3ff0eab6 100644 --- a/patches/openwrt/0015-ar71xx-add-support-for-TL-WR741ND-v5.patch +++ b/patches/openwrt/0015-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 a233349..2615244 100644 +index 3cab3bd..8a2b964 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile @@ -489,6 +489,14 @@ define Device/tl-wr741nd-v4 From 66060cf08a79c8c5fc7df2dc3049875ede20819a Mon Sep 17 00:00:00 2001 From: Hans-Werner Hilse Date: Sun, 5 Jul 2015 22:25:54 +0200 Subject: [PATCH 026/867] gluon-neighbour-info: Do not use error() error() is a glibc specific function and should not be used in code meant to be portable. --- package/gluon-neighbour-info/src/gluon-neighbour-info.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/package/gluon-neighbour-info/src/gluon-neighbour-info.c b/package/gluon-neighbour-info/src/gluon-neighbour-info.c index d8536de6..192b736e 100644 --- a/package/gluon-neighbour-info/src/gluon-neighbour-info.c +++ b/package/gluon-neighbour-info/src/gluon-neighbour-info.c @@ -176,8 +176,10 @@ int main(int argc, char **argv) { fprintf(stderr, "Invalid parameter %c ignored.\n", c); } - if (request_string == NULL) - error(EXIT_FAILURE, 0, "No request string supplied"); + if (request_string == NULL) { + fprintf(stderr, "No request string supplied"); + exit(EXIT_FAILURE); + } if (sse) fputs("Content-Type: text/event-stream\n\n", stdout); From 1c4b179dd27b0ffadbac6194624b39cfa653a4e5 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Wed, 8 Jul 2015 23:18:38 +0200 Subject: [PATCH 027/867] =?UTF-8?q?gluon-config-mode-geo-location:=20trans?= =?UTF-8?q?late=20"altitude"=20to=20"H=C3=B6he"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 35 ------------------- .../gluon-config-mode-geo-location/i18n/de.po | 2 +- 2 files changed, 1 insertion(+), 36 deletions(-) delete mode 100644 README.md diff --git a/README.md b/README.md deleted file mode 100644 index 87750136..00000000 --- a/README.md +++ /dev/null @@ -1,35 +0,0 @@ -Documentation (incomplete at this time, contribute if you can!) may be found at -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). - -**Gluon IRC channel: `#gluon` in [hackint](http://hackint.org/)** - -## Issues & Feature requests - -Before opening an issue make sure to read 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! -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`. - -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. - -## Mailinglist - -To subscribe to the list, send a message to: - - gluon-subscribe@luebeck.freifunk.net - -To remove your address from the list, just send a message to -the address in the `List-Unsubscribe` header of any list -message. If you haven't changed addresses since subscribing, -you can also send a message to: - - gluon-unsubscribe@luebeck.freifunk.net diff --git a/package/gluon-config-mode-geo-location/i18n/de.po b/package/gluon-config-mode-geo-location/i18n/de.po index e83443dd..a2850d5b 100644 --- a/package/gluon-config-mode-geo-location/i18n/de.po +++ b/package/gluon-config-mode-geo-location/i18n/de.po @@ -27,7 +27,7 @@ msgid "Longitude" msgstr "Längengrad" msgid "Altitude" -msgstr "Höhenmeter über Normalnull" +msgstr "Höhe" msgid "Show node on the map" msgstr "Knoten auf der Karte anzeigen" From d8a6c16da274dc68fde20ef00dfa7bf35b0d5e75 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 8 Jul 2015 22:33:22 +0200 Subject: [PATCH 028/867] x86-generic: add kmod-e1000e network driver --- targets/x86-generic/profiles.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targets/x86-generic/profiles.mk b/targets/x86-generic/profiles.mk index 6bd9c94f..b6551a76 100644 --- a/targets/x86-generic/profiles.mk +++ b/targets/x86-generic/profiles.mk @@ -1,4 +1,4 @@ -X86_GENERIC_NETWORK_MODULES := kmod-3c59x kmod-e100 kmod-e1000 kmod-natsemi kmod-ne2k-pci kmod-pcnet32 kmod-8139too kmod-r8169 kmod-sis900 kmod-tg3 kmod-via-rhine kmod-via-velocity +X86_GENERIC_NETWORK_MODULES := kmod-3c59x kmod-e100 kmod-e1000 kmod-e1000e kmod-natsemi kmod-ne2k-pci kmod-pcnet32 kmod-8139too kmod-r8169 kmod-sis900 kmod-tg3 kmod-via-rhine kmod-via-velocity $(eval $(call GluonProfile,GENERIC,$(X86_GENERIC_NETWORK_MODULES))) From 961d82e37f3bd1d4971db84b4578a00ed92d99b1 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 8 Jul 2015 22:34:44 +0200 Subject: [PATCH 029/867] Add x86-64 target --- modules | 2 +- ...-it-breaks-ebtables-on-64bit-targets.patch | 73 +++++++++++++++++++ targets/targets.mk | 1 + targets/x86-64/config | 4 + targets/x86-64/profiles.mk | 17 +++++ targets/x86-64/vermagic | 1 + 6 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 patches/openwrt/0016-ebtables-remove-musl-build-fix-it-breaks-ebtables-on-64bit-targets.patch create mode 100644 targets/x86-64/config create mode 100644 targets/x86-64/profiles.mk create mode 100644 targets/x86-64/vermagic diff --git a/modules b/modules index f64e4605..2d7cb2ae 100644 --- a/modules +++ b/modules @@ -8,7 +8,7 @@ PACKAGES_OPENWRT_COMMIT=fa7ed79149b371294f12905210bb032610a11621 PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git -PACKAGES_GLUON_COMMIT=1faf424b35f1c87994ef27638d2deb04793619de +PACKAGES_GLUON_COMMIT=b06388df9aceb28082e02ad525a1e5ad7b2e1c4f PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_COMMIT=6172dcef329e1b306149cded3340da8f28501266 diff --git a/patches/openwrt/0016-ebtables-remove-musl-build-fix-it-breaks-ebtables-on-64bit-targets.patch b/patches/openwrt/0016-ebtables-remove-musl-build-fix-it-breaks-ebtables-on-64bit-targets.patch new file mode 100644 index 00000000..6831e74b --- /dev/null +++ b/patches/openwrt/0016-ebtables-remove-musl-build-fix-it-breaks-ebtables-on-64bit-targets.patch @@ -0,0 +1,73 @@ +From: Matthias Schiffer +Date: Thu, 9 Jul 2015 01:04:52 +0200 +Subject: ebtables: remove musl build fix, it breaks ebtables on 64bit targets + +diff --git a/package/network/utils/ebtables/Makefile b/package/network/utils/ebtables/Makefile +index 4f6d7f5..d3d714f 100644 +--- a/package/network/utils/ebtables/Makefile ++++ b/package/network/utils/ebtables/Makefile +@@ -49,7 +49,7 @@ endef + MAKE_VARS += EXT_LIBSI="$(LIBGCC_S)" + + MAKE_FLAGS += \ +- CFLAGS="$(TARGET_CFLAGS)" \ ++ CFLAGS="$(TARGET_CFLAGS) -g" \ + LIBDIR="/usr/lib/ebtables" + + define Package/ebtables/install +diff --git a/package/network/utils/ebtables/patches/100-musl_fix.patch b/package/network/utils/ebtables/patches/100-musl_fix.patch +deleted file mode 100644 +index 462fea6..0000000 +--- a/package/network/utils/ebtables/patches/100-musl_fix.patch ++++ /dev/null +@@ -1,50 +0,0 @@ +---- a/extensions/ebt_among.c +-+++ b/extensions/ebt_among.c +-@@ -13,7 +13,6 @@ +- #include +- #include +- #include "../include/ebtables_u.h" +--#include +- #include "../include/ethernetdb.h" +- #include +- #include +---- a/extensions/ebt_arpreply.c +-+++ b/extensions/ebt_arpreply.c +-@@ -12,7 +12,6 @@ +- #include +- #include +- #include "../include/ebtables_u.h" +--#include +- #include +- +- static int mac_supplied; +---- a/extensions/ebt_nat.c +-+++ b/extensions/ebt_nat.c +-@@ -11,7 +11,6 @@ +- #include +- #include +- #include "../include/ebtables_u.h" +--#include +- #include +- +- static int to_source_supplied, to_dest_supplied; +---- a/useful_functions.c +-+++ b/useful_functions.c +-@@ -25,7 +25,6 @@ +- #include "include/ebtables_u.h" +- #include "include/ethernetdb.h" +- #include +--#include +- #include +- #include +- #include +---- a/include/ebtables_u.h +-+++ b/include/ebtables_u.h +-@@ -23,6 +23,7 @@ +- +- #ifndef EBTABLES_U_H +- #define EBTABLES_U_H +-+#include +- #include +- #include +- #include diff --git a/targets/targets.mk b/targets/targets.mk index dba77e30..48b166d4 100644 --- a/targets/targets.mk +++ b/targets/targets.mk @@ -3,6 +3,7 @@ $(eval $(call GluonTarget,ar71xx,nand)) $(eval $(call GluonTarget,mpc85xx,generic)) $(eval $(call GluonTarget,x86,generic)) $(eval $(call GluonTarget,x86,kvm_guest)) +$(eval $(call GluonTarget,x86,64)) ifneq ($(BROKEN),) $(eval $(call GluonTarget,ramips,rt305x)) diff --git a/targets/x86-64/config b/targets/x86-64/config new file mode 100644 index 00000000..f00279eb --- /dev/null +++ b/targets/x86-64/config @@ -0,0 +1,4 @@ +CONFIG_TARGET_x86=y +CONFIG_TARGET_x86_64=y +CONFIG_VDI_IMAGES=y +CONFIG_VMDK_IMAGES=y diff --git a/targets/x86-64/profiles.mk b/targets/x86-64/profiles.mk new file mode 100644 index 00000000..49cf02ef --- /dev/null +++ b/targets/x86-64/profiles.mk @@ -0,0 +1,17 @@ +X86_64_NETWORK_MODULES := kmod-3c59x kmod-e100 kmod-e1000 kmod-e1000e kmod-natsemi kmod-ne2k-pci kmod-pcnet32 kmod-8139too kmod-r8169 kmod-sis900 kmod-tg3 kmod-via-rhine kmod-via-velocity + + +$(eval $(call GluonProfile,GENERIC,$(X86_64_NETWORK_MODULES))) +$(eval $(call GluonProfileFactorySuffix,GENERIC,-ext4,.img.gz)) +$(eval $(call GluonProfileSysupgradeSuffix,GENERIC,-ext4,.img.gz)) +$(eval $(call GluonModel,GENERIC,combined,x86-64)) + +$(eval $(call GluonProfile,VDI,$(X86_64_NETWORK_MODULES))) +$(eval $(call GluonProfileFactorySuffix,VDI,-ext4,.vdi)) +$(eval $(call GluonProfileSysupgradeSuffix,VDI)) +$(eval $(call GluonModel,VDI,combined,x86-64-virtualbox)) + +$(eval $(call GluonProfile,VMDK,$(X86_64_NETWORK_MODULES))) +$(eval $(call GluonProfileFactorySuffix,VMDK,-ext4,.vmdk)) +$(eval $(call GluonProfileSysupgradeSuffix,VMDK)) +$(eval $(call GluonModel,VMDK,combined,x86-64-vmware)) diff --git a/targets/x86-64/vermagic b/targets/x86-64/vermagic new file mode 100644 index 00000000..3f67824e --- /dev/null +++ b/targets/x86-64/vermagic @@ -0,0 +1 @@ +c98e41bf75d421d517bb83bb2dd9f0a4 From 9f91a5f8412b56a0e8cb71e05329c5f7983e2a9f Mon Sep 17 00:00:00 2001 From: Jan-Philipp Litza Date: Thu, 9 Jul 2015 20:18:11 +0200 Subject: [PATCH 030/867] gluon-neighbour-info: Support sub-second timeout --- .../gluon-neighbour-info/src/gluon-neighbour-info.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package/gluon-neighbour-info/src/gluon-neighbour-info.c b/package/gluon-neighbour-info/src/gluon-neighbour-info.c index 192b736e..46e6324d 100644 --- a/package/gluon-neighbour-info/src/gluon-neighbour-info.c +++ b/package/gluon-neighbour-info/src/gluon-neighbour-info.c @@ -78,7 +78,7 @@ ssize_t recvtimeout(int socket, void *buffer, size_t length, int flags, struct t return ret; } -int request(const int sock, const struct sockaddr_in6 *client_addr, const char *request, bool sse, int timeout) { +int request(const int sock, const struct sockaddr_in6 *client_addr, const char *request, bool sse, double timeout) { ssize_t ret; char buffer[8192]; @@ -90,8 +90,8 @@ int request(const int sock, const struct sockaddr_in6 *client_addr, const char * } struct timeval tv_timeout, tv_offset; - tv_timeout.tv_sec = timeout; - tv_timeout.tv_usec = 0; + tv_timeout.tv_sec = (int) timeout; + tv_timeout.tv_usec = ((int) (timeout * 1000000)) % 1000000; getclock(&tv_offset); @@ -137,7 +137,7 @@ int main(int argc, char **argv) { int port_set = 0; int destination_set = 0; - int timeout = 3; + double timeout = 3.0; bool sse = false; int c; @@ -163,7 +163,7 @@ int main(int argc, char **argv) { request_string = optarg; break; case 't': - timeout = atoi(optarg); + timeout = atof(optarg); break; case 's': sse = true; From 170741bf1c4d5d6298526f0cf2c178dae09973a7 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 10 Jul 2015 18:15:25 +0200 Subject: [PATCH 031/867] Restore README.md It seems to have been deleted accidentially. --- README.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 00000000..87750136 --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +Documentation (incomplete at this time, contribute if you can!) may be found at +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). + +**Gluon IRC channel: `#gluon` in [hackint](http://hackint.org/)** + +## Issues & Feature requests + +Before opening an issue make sure to read 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! +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`. + +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. + +## Mailinglist + +To subscribe to the list, send a message to: + + gluon-subscribe@luebeck.freifunk.net + +To remove your address from the list, just send a message to +the address in the `List-Unsubscribe` header of any list +message. If you haven't changed addresses since subscribing, +you can also send a message to: + + gluon-unsubscribe@luebeck.freifunk.net From 07d338919cc07f0f39619384c22eff34a1ace0d2 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 10 Jul 2015 17:41:07 +0200 Subject: [PATCH 032/867] build: copy all regular files from KERNEL_BUILD_DIR to BOARD_KDIR Fixes build for brcm2708 targets --- Makefile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 151ce012..6d21119c 100644 --- a/Makefile +++ b/Makefile @@ -282,10 +282,7 @@ packages: $(package/stamp-compile) prepare-image: FORCE rm -rf $(BOARD_KDIR) mkdir -p $(BOARD_KDIR) - $(foreach k, vmlinux vmlinux.elf \ - $(if $(KERNEL_IMAGES),$(KERNEL_IMAGES),$(filter-out dtbs,$(KERNELNAME))), \ - $(CP) $(KERNEL_BUILD_DIR)/$(k) $(BOARD_KDIR)/$(k); \ - ) + -cp $(KERNEL_BUILD_DIR)/* $(BOARD_KDIR)/ +$(SUBMAKE) -C $(TOPDIR)/target/linux/$(BOARD)/image image_prepare KDIR="$(BOARD_KDIR)" prepare: FORCE From cb40f149f3a4c8870f518d436800652558255db5 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 10 Jul 2015 18:19:18 +0200 Subject: [PATCH 033/867] Add support for brcm2708-bcm2708 and -bcm2709 targets Original patch by @MPW1412 --- modules | 2 +- ...08-respect-CONFIG_TARGET_IMAGES_GZIP.patch | 21 +++++++++++++++++++ targets/brcm2708-bcm2708/config | 2 ++ targets/brcm2708-bcm2708/profiles.mk | 4 ++++ targets/brcm2708-bcm2708/vermagic | 1 + targets/brcm2708-bcm2709/config | 2 ++ targets/brcm2708-bcm2709/profiles.mk | 4 ++++ targets/brcm2708-bcm2709/vermagic | 1 + targets/targets.mk | 4 +++- 9 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 patches/openwrt/0017-brcm2708-respect-CONFIG_TARGET_IMAGES_GZIP.patch create mode 100644 targets/brcm2708-bcm2708/config create mode 100644 targets/brcm2708-bcm2708/profiles.mk create mode 100644 targets/brcm2708-bcm2708/vermagic create mode 100644 targets/brcm2708-bcm2709/config create mode 100644 targets/brcm2708-bcm2709/profiles.mk create mode 100644 targets/brcm2708-bcm2709/vermagic diff --git a/modules b/modules index 2d7cb2ae..d5c33a86 100644 --- a/modules +++ b/modules @@ -8,7 +8,7 @@ PACKAGES_OPENWRT_COMMIT=fa7ed79149b371294f12905210bb032610a11621 PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git -PACKAGES_GLUON_COMMIT=b06388df9aceb28082e02ad525a1e5ad7b2e1c4f +PACKAGES_GLUON_COMMIT=9d5b304e95e00ce34811ad4a1ef17c3f4791bad3 PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_COMMIT=6172dcef329e1b306149cded3340da8f28501266 diff --git a/patches/openwrt/0017-brcm2708-respect-CONFIG_TARGET_IMAGES_GZIP.patch b/patches/openwrt/0017-brcm2708-respect-CONFIG_TARGET_IMAGES_GZIP.patch new file mode 100644 index 00000000..2b083cb9 --- /dev/null +++ b/patches/openwrt/0017-brcm2708-respect-CONFIG_TARGET_IMAGES_GZIP.patch @@ -0,0 +1,21 @@ +From: Matthias Schiffer +Date: Fri, 10 Jul 2015 18:41:11 +0200 +Subject: brcm2708: respect CONFIG_TARGET_IMAGES_GZIP + +As the brcm2708 images use ext4, they will be huge when uncompressed. + +diff --git a/target/linux/brcm2708/image/Makefile b/target/linux/brcm2708/image/Makefile +index e70bdd0..be667f3 100644 +--- a/target/linux/brcm2708/image/Makefile ++++ b/target/linux/brcm2708/image/Makefile +@@ -28,6 +28,10 @@ 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 -f9 $(BIN_DIR)/$(IMG_PREFIX)-sdcard-vfat-$(1).img ++ endif + endef + + define Image/Build diff --git a/targets/brcm2708-bcm2708/config b/targets/brcm2708-bcm2708/config new file mode 100644 index 00000000..5187248e --- /dev/null +++ b/targets/brcm2708-bcm2708/config @@ -0,0 +1,2 @@ +CONFIG_TARGET_brcm2708=y +CONFIG_TARGET_brcm2708_bcm2708=y diff --git a/targets/brcm2708-bcm2708/profiles.mk b/targets/brcm2708-bcm2708/profiles.mk new file mode 100644 index 00000000..7aa5efaa --- /dev/null +++ b/targets/brcm2708-bcm2708/profiles.mk @@ -0,0 +1,4 @@ +$(eval $(call GluonProfile,RaspberryPi,brcm2708-gpu-fw kmod-usb-hid kmod-sound-core kmod-sound-arm-bcm2835)) +$(eval $(call GluonProfileFactorySuffix,RaspberryPi,-vfat-ext4,.img.gz)) +$(eval $(call GluonProfileSysupgradeSuffix,RaspberryPi)) +$(eval $(call GluonModel,RaspberryPi,sdcard,raspberry-pi)) diff --git a/targets/brcm2708-bcm2708/vermagic b/targets/brcm2708-bcm2708/vermagic new file mode 100644 index 00000000..83031c6d --- /dev/null +++ b/targets/brcm2708-bcm2708/vermagic @@ -0,0 +1 @@ +acfd4d19ee84c79b9ab4c392f3e94cee diff --git a/targets/brcm2708-bcm2709/config b/targets/brcm2708-bcm2709/config new file mode 100644 index 00000000..681d3586 --- /dev/null +++ b/targets/brcm2708-bcm2709/config @@ -0,0 +1,2 @@ +CONFIG_TARGET_brcm2708=y +CONFIG_TARGET_brcm2708_bcm2709=y diff --git a/targets/brcm2708-bcm2709/profiles.mk b/targets/brcm2708-bcm2709/profiles.mk new file mode 100644 index 00000000..5c06814c --- /dev/null +++ b/targets/brcm2708-bcm2709/profiles.mk @@ -0,0 +1,4 @@ +$(eval $(call GluonProfile,RaspberryPi2,brcm2708-gpu-fw kmod-usb-hid kmod-sound-core kmod-sound-arm-bcm2835)) +$(eval $(call GluonProfileFactorySuffix,RaspberryPi2,-vfat-ext4,.img.gz)) +$(eval $(call GluonProfileSysupgradeSuffix,RaspberryPi2)) +$(eval $(call GluonModel,RaspberryPi2,sdcard,raspberry-pi-2)) diff --git a/targets/brcm2708-bcm2709/vermagic b/targets/brcm2708-bcm2709/vermagic new file mode 100644 index 00000000..8344ad20 --- /dev/null +++ b/targets/brcm2708-bcm2709/vermagic @@ -0,0 +1 @@ +3912f3ddca091e4dc503a2d535a0fae5 diff --git a/targets/targets.mk b/targets/targets.mk index 48b166d4..afe52c0b 100644 --- a/targets/targets.mk +++ b/targets/targets.mk @@ -6,5 +6,7 @@ $(eval $(call GluonTarget,x86,kvm_guest)) $(eval $(call GluonTarget,x86,64)) ifneq ($(BROKEN),) -$(eval $(call GluonTarget,ramips,rt305x)) +$(eval $(call GluonTarget,ramips,rt305x)) # BROKEN: No AP+IBSS support +$(eval $(call GluonTarget,brcm2708,bcm2708)) # BROKEN: Untested, no sysupgrade support +$(eval $(call GluonTarget,brcm2708,bcm2709)) # BROKEN: Untested, no sysupgrade support endif From d386ccdcf8e168c608bd0d43e77ece3b726c93b8 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 10 Jul 2015 20:22:27 +0200 Subject: [PATCH 034/867] Always use eth0 address as primary address on x86 and brcm2708 These targets don't have a WLAN adapter by default, so it doesn't make sense to default to the phy0 address. --- .../files/lib/gluon/upgrade/010-primary-mac | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac b/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac index d7c6e968..25c13bac 100755 --- a/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac +++ b/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac @@ -15,19 +15,18 @@ local util = require 'luci.util' local try_files = { - '/sys/class/ieee80211/phy0/macaddress', - '/sys/class/net/eth0/address', + '/sys/class/net/eth0/address' } +if not util.contains({'x86', 'brcm2708'}, platform.get_target()) then + table.insert(try_files, 1, '/sys/class/ieee80211/phy0/macaddress') +end + if platform.match('ar71xx', 'generic', {'tl-wdr3600', 'tl-wdr4300'}) then table.insert(try_files, 1, '/sys/class/ieee80211/phy1/macaddress') -end - -if platform.match('ar71xx', 'generic', {'unifi-outdoor-plus'}) then +elseif platform.match('ar71xx', 'generic', {'unifi-outdoor-plus'}) then table.insert(try_files, 1, '/sys/class/net/eth0/address') -end - -if platform.match('ar71xx', 'generic', {'archer-c5', 'archer-c7'}) then +elseif platform.match('ar71xx', 'generic', {'archer-c5', 'archer-c7'}) then table.insert(try_files, 1, '/sys/class/net/eth1/address') end From efbc88ddbac586494bd9ab012f52e51a67d35571 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 10 Jul 2015 20:34:11 +0200 Subject: [PATCH 035/867] Update modules --- modules | 8 +- ...8-respect-CONFIG_TARGET_IMAGES_GZIP.patch} | 0 ...-it-breaks-ebtables-on-64bit-targets.patch | 73 ------------------- 3 files changed, 4 insertions(+), 77 deletions(-) rename patches/openwrt/{0017-brcm2708-respect-CONFIG_TARGET_IMAGES_GZIP.patch => 0016-brcm2708-respect-CONFIG_TARGET_IMAGES_GZIP.patch} (100%) delete mode 100644 patches/openwrt/0016-ebtables-remove-musl-build-fix-it-breaks-ebtables-on-64bit-targets.patch diff --git a/modules b/modules index d5c33a86..dd6b94cc 100644 --- a/modules +++ b/modules @@ -1,18 +1,18 @@ GLUON_FEEDS='openwrt gluon routing luci' OPENWRT_REPO=git://git.openwrt.org/15.05/openwrt.git -OPENWRT_COMMIT=54b2f42f724c287d720ca4e12b297e9ea76f8a4d +OPENWRT_COMMIT=e5682a7ac77fc7c6ec13d72fb4726b15980f373b PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git -PACKAGES_OPENWRT_COMMIT=fa7ed79149b371294f12905210bb032610a11621 +PACKAGES_OPENWRT_COMMIT=62037ba35fda4ae07e89c33946f229da2a941d47 PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git PACKAGES_GLUON_COMMIT=9d5b304e95e00ce34811ad4a1ef17c3f4791bad3 PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git -PACKAGES_ROUTING_COMMIT=6172dcef329e1b306149cded3340da8f28501266 +PACKAGES_ROUTING_COMMIT=6c78c2ac2cb9ec3be25e68b1cef7b2e2e0e4a346 PACKAGES_LUCI_REPO=git://github.com/openwrt/luci.git -PACKAGES_LUCI_COMMIT=cf2e3f6c20dbdfdc3d8c4d4115cf9c533444e61f +PACKAGES_LUCI_COMMIT=218e8f608e4ef988a5c74a9fb499eba4926084be PACKAGES_LUCI_BRANCH=for-15.05 diff --git a/patches/openwrt/0017-brcm2708-respect-CONFIG_TARGET_IMAGES_GZIP.patch b/patches/openwrt/0016-brcm2708-respect-CONFIG_TARGET_IMAGES_GZIP.patch similarity index 100% rename from patches/openwrt/0017-brcm2708-respect-CONFIG_TARGET_IMAGES_GZIP.patch rename to patches/openwrt/0016-brcm2708-respect-CONFIG_TARGET_IMAGES_GZIP.patch diff --git a/patches/openwrt/0016-ebtables-remove-musl-build-fix-it-breaks-ebtables-on-64bit-targets.patch b/patches/openwrt/0016-ebtables-remove-musl-build-fix-it-breaks-ebtables-on-64bit-targets.patch deleted file mode 100644 index 6831e74b..00000000 --- a/patches/openwrt/0016-ebtables-remove-musl-build-fix-it-breaks-ebtables-on-64bit-targets.patch +++ /dev/null @@ -1,73 +0,0 @@ -From: Matthias Schiffer -Date: Thu, 9 Jul 2015 01:04:52 +0200 -Subject: ebtables: remove musl build fix, it breaks ebtables on 64bit targets - -diff --git a/package/network/utils/ebtables/Makefile b/package/network/utils/ebtables/Makefile -index 4f6d7f5..d3d714f 100644 ---- a/package/network/utils/ebtables/Makefile -+++ b/package/network/utils/ebtables/Makefile -@@ -49,7 +49,7 @@ endef - MAKE_VARS += EXT_LIBSI="$(LIBGCC_S)" - - MAKE_FLAGS += \ -- CFLAGS="$(TARGET_CFLAGS)" \ -+ CFLAGS="$(TARGET_CFLAGS) -g" \ - LIBDIR="/usr/lib/ebtables" - - define Package/ebtables/install -diff --git a/package/network/utils/ebtables/patches/100-musl_fix.patch b/package/network/utils/ebtables/patches/100-musl_fix.patch -deleted file mode 100644 -index 462fea6..0000000 ---- a/package/network/utils/ebtables/patches/100-musl_fix.patch -+++ /dev/null -@@ -1,50 +0,0 @@ ----- a/extensions/ebt_among.c --+++ b/extensions/ebt_among.c --@@ -13,7 +13,6 @@ -- #include -- #include -- #include "../include/ebtables_u.h" ---#include -- #include "../include/ethernetdb.h" -- #include -- #include ----- a/extensions/ebt_arpreply.c --+++ b/extensions/ebt_arpreply.c --@@ -12,7 +12,6 @@ -- #include -- #include -- #include "../include/ebtables_u.h" ---#include -- #include -- -- static int mac_supplied; ----- a/extensions/ebt_nat.c --+++ b/extensions/ebt_nat.c --@@ -11,7 +11,6 @@ -- #include -- #include -- #include "../include/ebtables_u.h" ---#include -- #include -- -- static int to_source_supplied, to_dest_supplied; ----- a/useful_functions.c --+++ b/useful_functions.c --@@ -25,7 +25,6 @@ -- #include "include/ebtables_u.h" -- #include "include/ethernetdb.h" -- #include ---#include -- #include -- #include -- #include ----- a/include/ebtables_u.h --+++ b/include/ebtables_u.h --@@ -23,6 +23,7 @@ -- -- #ifndef EBTABLES_U_H -- #define EBTABLES_U_H --+#include -- #include -- #include -- #include From f5764a4a7b68f2eb56c9c5f2995a6277bf1b4aaa Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 10 Jul 2015 20:58:46 +0200 Subject: [PATCH 036/867] gluon-mesh-batman-adv-core: adjust rssid config to renamed WLAN interfaces This should fix the signal strength indicators on the TP-Link CPE210/510. --- .../gluon/upgrade/350-gluon-mesh-batman-adv-core-rssid | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-core-rssid diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-core-rssid b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-core-rssid new file mode 100755 index 00000000..5ddb4f90 --- /dev/null +++ b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-core-rssid @@ -0,0 +1,10 @@ +#!/usr/bin/lua + +local uci = require('luci.model.uci').cursor() + +if uci:get('system', 'rssid_wlan0') then + uci:set('system', 'rssid_wlan0', 'dev', 'mesh0') + + uci:save('system') + uci:commit('system') +end From 34e0451e45e59ac1a1195efe3605ab6d72e241bf Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 11 Jul 2015 18:27:35 +0200 Subject: [PATCH 037/867] gluon-mesh-batman-adv-core: unconditionally set the WAN MAC address This fixes MAC address conflicts on devices which use the eth0 as primary address. --- .../gluon/upgrade/300-gluon-mesh-batman-adv-core-wan | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/300-gluon-mesh-batman-adv-core-wan b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/300-gluon-mesh-batman-adv-core-wan index f84a104d..c9084ea6 100755 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/300-gluon-mesh-batman-adv-core-wan +++ b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/300-gluon-mesh-batman-adv-core-wan @@ -1,14 +1,11 @@ #!/usr/bin/lua -local sysconfig = require 'gluon.sysconfig' local util = require 'gluon.util' local uci = require('luci.model.uci').cursor() -if sysconfig.wan_ifname:match('%.') then - -- fix up duplicate mac addresses (for mesh-on-WAN) - uci:set('network', 'wan', 'macaddr', util.generate_mac(1, 0)) - uci:save('network') - uci:commit('network') -end +-- fix up duplicate mac addresses (for mesh-on-WAN) +uci:set('network', 'wan', 'macaddr', util.generate_mac(1, 0)) +uci:save('network') +uci:commit('network') From e8781556011a94c3f6deea5063e80110d450eae3 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 12 Jul 2015 16:31:00 +0200 Subject: [PATCH 038/867] gluon-luci-admin: fix setting the password This was broken due to the switch to Chaos Calmer. --- .../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 5797b623..13840542 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 @@ -84,7 +84,7 @@ function m2.on_commit(map) if v1 and v2 then if v1 == v2 then if #v1 > 0 then - if luci.sys.user.setpasswd(luci.dispatcher.context.authuser, v1) == 0 then + if luci.sys.user.setpasswd('root', v1) == 0 then m2.message = translate("Password changed.") else m2.errmessage = translate("Unable to change the password.") From 71be522c02b9a71e5f29067f560df6cbd530ac39 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 12 Jul 2015 18:21:13 +0200 Subject: [PATCH 039/867] Update gluon packages --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index dd6b94cc..4d35df26 100644 --- a/modules +++ b/modules @@ -8,7 +8,7 @@ PACKAGES_OPENWRT_COMMIT=62037ba35fda4ae07e89c33946f229da2a941d47 PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git -PACKAGES_GLUON_COMMIT=9d5b304e95e00ce34811ad4a1ef17c3f4791bad3 +PACKAGES_GLUON_COMMIT=7d11ce79ed17c83afffc8395e8d21554a8d1f1a5 PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_COMMIT=6c78c2ac2cb9ec3be25e68b1cef7b2e2e0e4a346 From 7d7c093007fabfdad890fe5976e476ed25bce57f Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 12 Jul 2015 18:46:30 +0200 Subject: [PATCH 040/867] brcm2708-bcm2708/-bcm2709: remove unnecessary package list These packages are included by OpenWrt by default on this target and don't need to be specified manually. --- targets/brcm2708-bcm2708/profiles.mk | 2 +- targets/brcm2708-bcm2709/profiles.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/targets/brcm2708-bcm2708/profiles.mk b/targets/brcm2708-bcm2708/profiles.mk index 7aa5efaa..8aedd810 100644 --- a/targets/brcm2708-bcm2708/profiles.mk +++ b/targets/brcm2708-bcm2708/profiles.mk @@ -1,4 +1,4 @@ -$(eval $(call GluonProfile,RaspberryPi,brcm2708-gpu-fw kmod-usb-hid kmod-sound-core kmod-sound-arm-bcm2835)) +$(eval $(call GluonProfile,RaspberryPi)) $(eval $(call GluonProfileFactorySuffix,RaspberryPi,-vfat-ext4,.img.gz)) $(eval $(call GluonProfileSysupgradeSuffix,RaspberryPi)) $(eval $(call GluonModel,RaspberryPi,sdcard,raspberry-pi)) diff --git a/targets/brcm2708-bcm2709/profiles.mk b/targets/brcm2708-bcm2709/profiles.mk index 5c06814c..64f6168e 100644 --- a/targets/brcm2708-bcm2709/profiles.mk +++ b/targets/brcm2708-bcm2709/profiles.mk @@ -1,4 +1,4 @@ -$(eval $(call GluonProfile,RaspberryPi2,brcm2708-gpu-fw kmod-usb-hid kmod-sound-core kmod-sound-arm-bcm2835)) +$(eval $(call GluonProfile,RaspberryPi2)) $(eval $(call GluonProfileFactorySuffix,RaspberryPi2,-vfat-ext4,.img.gz)) $(eval $(call GluonProfileSysupgradeSuffix,RaspberryPi2)) $(eval $(call GluonModel,RaspberryPi2,sdcard,raspberry-pi-2)) From d4c6b314543acbd8ff4aa326356fd3000743b33d Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 12 Jul 2015 22:09:15 +0200 Subject: [PATCH 041/867] ar71xx-generic: remove unneeded CONFIG_TARGET_ROOTFS_JFFS2 option This default to n now by default --- targets/ar71xx-generic/config | 1 - 1 file changed, 1 deletion(-) diff --git a/targets/ar71xx-generic/config b/targets/ar71xx-generic/config index 916d18bf..4a04ed86 100644 --- a/targets/ar71xx-generic/config +++ b/targets/ar71xx-generic/config @@ -1,3 +1,2 @@ CONFIG_TARGET_ar71xx=y -CONFIG_TARGET_ROOTFS_JFFS2=n # CONFIG_PACKAGE_uboot-ar71xx-nbg460n_550n_550nh is not set From 843468608500ab25d5229b8d983b440996574db2 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 12 Jul 2015 22:37:09 +0200 Subject: [PATCH 042/867] build: implicitly configure board and subtarget options The file targets/$GLUON_TARGET/config becomes optional, as many targets only used it to set the board and subtarget. Also fix targets without subtarget. --- Makefile | 9 +++++++-- docs/dev/hardware.rst | 10 +++++----- targets/ar71xx-generic/config | 1 - targets/ar71xx-nand/config | 2 -- targets/brcm2708-bcm2708/config | 2 -- targets/brcm2708-bcm2709/config | 2 -- targets/mpc85xx-generic/config | 1 - targets/ramips-rt305x/config | 2 -- targets/x86-64/config | 2 -- targets/x86-generic/config | 1 - targets/x86-kvm_guest/config | 2 -- 11 files changed, 12 insertions(+), 22 deletions(-) delete mode 100644 targets/ar71xx-nand/config delete mode 100644 targets/brcm2708-bcm2708/config delete mode 100644 targets/brcm2708-bcm2709/config delete mode 100644 targets/mpc85xx-generic/config delete mode 100644 targets/ramips-rt305x/config delete mode 100644 targets/x86-kvm_guest/config diff --git a/Makefile b/Makefile index 6d21119c..187a5acb 100644 --- a/Makefile +++ b/Makefile @@ -52,7 +52,7 @@ include $(GLUONDIR)/include/toplevel.mk include $(GLUONDIR)/targets/targets.mk -CheckTarget := [ -n '$(GLUON_TARGET)' -a -n '$(GLUON_TARGET_$(GLUON_TARGET)_BOARD)' -a -n '$(GLUON_TARGET_$(GLUON_TARGET)_SUBTARGET)' ] \ +CheckTarget := [ -n '$(GLUON_TARGET)' -a -n '$(GLUON_TARGET_$(GLUON_TARGET)_BOARD)' ] \ || (echo -e 'Please set GLUON_TARGET to a valid target. Gluon supports the following targets:$(subst $(space),\n * ,$(GLUON_TARGETS))'; false) @@ -209,7 +209,12 @@ config: FORCE +$(NO_TRACE_MAKE) scripts/config/conf OPENWRT_BUILD= QUIET=0 +$(GLUONMAKE) prepare-tmpinfo ( \ - cat $(GLUONDIR)/include/config $(GLUONDIR)/targets/$(GLUON_TARGET)/config; \ + cat $(GLUONDIR)/include/config; \ + echo 'CONFIG_TARGET_$(GLUON_TARGET_$(GLUON_TARGET)_BOARD)=y'; \ + $(if $(GLUON_TARGET_$(GLUON_TARGET)_SUBTARGET), \ + echo 'CONFIG_TARGET_$(GLUON_TARGET_$(GLUON_TARGET)_BOARD)_$(GLUON_TARGET_$(GLUON_TARGET)_SUBTARGET)=y'; \ + ) \ + cat $(GLUONDIR)/targets/$(GLUON_TARGET)/config 2>/dev/null; \ echo 'CONFIG_BUILD_SUFFIX="gluon-$(GLUON_TARGET)"'; \ echo '$(patsubst %,CONFIG_PACKAGE_%=m,$(sort $(filter-out -%,$(GLUON_DEFAULT_PACKAGES) $(GLUON_SITE_PACKAGES) $(PROFILE_PACKAGES))))' \ | sed -e 's/ /\n/g'; \ diff --git a/docs/dev/hardware.rst b/docs/dev/hardware.rst index a1a7f31c..d2f3424a 100644 --- a/docs/dev/hardware.rst +++ b/docs/dev/hardware.rst @@ -73,14 +73,14 @@ won't run correctly without some adjustments, so better double check that everyt Add support to the build system ''''''''''''''''''''''''''''''' A directory for the new target must be created under ``targets``, and it must be added -to ``targets/targets.mk``. In the new target directory, three files must be created: +to ``targets/targets.mk``. In the new target directory, the following files must be created: -* config * profiles.mk * vermagic +* config (optional) -The file ``config`` can be used to add additional, target-specific options to the OpenWrt config. It -must at least select the correct target and subtarget. For ``profiles.mk``, see :ref:`hardware-adding-profiles`. +For ``profiles.mk``, see :ref:`hardware-adding-profiles`. +The file ``config`` can be used to add additional, target-specific options to the OpenWrt config. The files ``vermagic`` must have the correct content so kernel modules from the upstream repositories can be installed without dependency issues. The OpenWrt version a Gluon release is based on is defined by the upstream package repo URL in ``include/gluon.mk`` @@ -92,4 +92,4 @@ The content is a hash which is part of the version number of the kernel package. As the kernel package is called ``kernel_3.10.49-1-0114c71ed85677c9c1e4911437af4743_ar71xx.ipk``, the correct ``vermagic`` string is ``0114c71ed85677c9c1e4911437af4743``. -After this, is should be sufficient to call ``make GLUON_TARGET=-`` to build the images for the new target. +After this, is should be sufficient to call ``make GLUON_TARGET=`` to build the images for the new target. diff --git a/targets/ar71xx-generic/config b/targets/ar71xx-generic/config index 4a04ed86..acf4627a 100644 --- a/targets/ar71xx-generic/config +++ b/targets/ar71xx-generic/config @@ -1,2 +1 @@ -CONFIG_TARGET_ar71xx=y # CONFIG_PACKAGE_uboot-ar71xx-nbg460n_550n_550nh is not set diff --git a/targets/ar71xx-nand/config b/targets/ar71xx-nand/config deleted file mode 100644 index f6afe36f..00000000 --- a/targets/ar71xx-nand/config +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_TARGET_ar71xx=y -CONFIG_TARGET_ar71xx_nand=y diff --git a/targets/brcm2708-bcm2708/config b/targets/brcm2708-bcm2708/config deleted file mode 100644 index 5187248e..00000000 --- a/targets/brcm2708-bcm2708/config +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_TARGET_brcm2708=y -CONFIG_TARGET_brcm2708_bcm2708=y diff --git a/targets/brcm2708-bcm2709/config b/targets/brcm2708-bcm2709/config deleted file mode 100644 index 681d3586..00000000 --- a/targets/brcm2708-bcm2709/config +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_TARGET_brcm2708=y -CONFIG_TARGET_brcm2708_bcm2709=y diff --git a/targets/mpc85xx-generic/config b/targets/mpc85xx-generic/config deleted file mode 100644 index 83737ebe..00000000 --- a/targets/mpc85xx-generic/config +++ /dev/null @@ -1 +0,0 @@ -CONFIG_TARGET_mpc85xx=y diff --git a/targets/ramips-rt305x/config b/targets/ramips-rt305x/config deleted file mode 100644 index 8e9365fa..00000000 --- a/targets/ramips-rt305x/config +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_TARGET_ramips=y -CONFIG_TARGET_ramips_rt305x=y diff --git a/targets/x86-64/config b/targets/x86-64/config index f00279eb..85016e81 100644 --- a/targets/x86-64/config +++ b/targets/x86-64/config @@ -1,4 +1,2 @@ -CONFIG_TARGET_x86=y -CONFIG_TARGET_x86_64=y CONFIG_VDI_IMAGES=y CONFIG_VMDK_IMAGES=y diff --git a/targets/x86-generic/config b/targets/x86-generic/config index e70b7455..85016e81 100644 --- a/targets/x86-generic/config +++ b/targets/x86-generic/config @@ -1,3 +1,2 @@ -CONFIG_TARGET_x86=y CONFIG_VDI_IMAGES=y CONFIG_VMDK_IMAGES=y diff --git a/targets/x86-kvm_guest/config b/targets/x86-kvm_guest/config deleted file mode 100644 index a92fa472..00000000 --- a/targets/x86-kvm_guest/config +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_TARGET_x86=y -CONFIG_TARGET_x86_kvm_guest=y From 9b2d4a3535db047e5fc6537dd5f6281978b84790 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 13 Jul 2015 16:11:35 +0200 Subject: [PATCH 043/867] Update OpenWrt base --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 4d35df26..bd51fd06 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=e5682a7ac77fc7c6ec13d72fb4726b15980f373b +OPENWRT_COMMIT=7400cfec550b5fd3e12093006b3d42734ac2fd91 PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git PACKAGES_OPENWRT_COMMIT=62037ba35fda4ae07e89c33946f229da2a941d47 From 7be180d4196b8280fe6ab8f931444ea2bf2e00f5 Mon Sep 17 00:00:00 2001 From: Alexander Dahl Date: Tue, 14 Jul 2015 11:07:52 +0200 Subject: [PATCH 044/867] doc: remove "probability" from site doc (was removed in v2014.3) see: http://gluon.readthedocs.org/en/latest/releases/v2014.3.html Signed-off-by: Alexander Dahl --- docs/user/site.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/user/site.rst b/docs/user/site.rst index bf6c1650..50d1c224 100644 --- a/docs/user/site.rst +++ b/docs/user/site.rst @@ -149,7 +149,6 @@ autoupdater : package 'http://[fdca:ffee:babe:1::fec1]/firmware/stable/sysupgrade/', 'http://[fdca:ffee:babe:1::fec2]/firmware/stable/sysupgrade/', }, - probability = 0.08, good_signatures = 2, pubkeys = { 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', -- someguy From cee83c60c0ed326c7e1b75383e63664b675c05ff Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 15 Jul 2015 21:59:59 +0200 Subject: [PATCH 045/867] brcm2708: add sysupgrade support --- modules | 2 +- .../0016-brcm2708-Implement-sysupgrade.patch | 89 +++++++++++++++++++ ...08-respect-CONFIG_TARGET_IMAGES_GZIP.patch | 21 ----- targets/brcm2708-bcm2708/profiles.mk | 2 +- targets/brcm2708-bcm2709/profiles.mk | 2 +- targets/targets.mk | 4 +- 6 files changed, 94 insertions(+), 26 deletions(-) create mode 100644 patches/openwrt/0016-brcm2708-Implement-sysupgrade.patch delete mode 100644 patches/openwrt/0016-brcm2708-respect-CONFIG_TARGET_IMAGES_GZIP.patch diff --git a/modules b/modules index bd51fd06..13a627e8 100644 --- a/modules +++ b/modules @@ -8,7 +8,7 @@ PACKAGES_OPENWRT_COMMIT=62037ba35fda4ae07e89c33946f229da2a941d47 PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git -PACKAGES_GLUON_COMMIT=7d11ce79ed17c83afffc8395e8d21554a8d1f1a5 +PACKAGES_GLUON_COMMIT=5f0c86212d33d7c285197c67d288af4872d44d51 PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_COMMIT=6c78c2ac2cb9ec3be25e68b1cef7b2e2e0e4a346 diff --git a/patches/openwrt/0016-brcm2708-Implement-sysupgrade.patch b/patches/openwrt/0016-brcm2708-Implement-sysupgrade.patch new file mode 100644 index 00000000..7c69c554 --- /dev/null +++ b/patches/openwrt/0016-brcm2708-Implement-sysupgrade.patch @@ -0,0 +1,89 @@ +From: blogic +Date: Tue, 14 Jul 2015 07:39:10 +0000 +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 + +git-svn-id: svn://svn.openwrt.org/openwrt/trunk@46347 3c298f89-4303-0410-b956-a3cf2f4a3e73 + +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..0dd7b7d 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 -k -f9 $(BIN_DIR)/$(IMG_PREFIX)-sdcard-vfat-$(1).img ++ endif + endef + + define Image/Build diff --git a/patches/openwrt/0016-brcm2708-respect-CONFIG_TARGET_IMAGES_GZIP.patch b/patches/openwrt/0016-brcm2708-respect-CONFIG_TARGET_IMAGES_GZIP.patch deleted file mode 100644 index 2b083cb9..00000000 --- a/patches/openwrt/0016-brcm2708-respect-CONFIG_TARGET_IMAGES_GZIP.patch +++ /dev/null @@ -1,21 +0,0 @@ -From: Matthias Schiffer -Date: Fri, 10 Jul 2015 18:41:11 +0200 -Subject: brcm2708: respect CONFIG_TARGET_IMAGES_GZIP - -As the brcm2708 images use ext4, they will be huge when uncompressed. - -diff --git a/target/linux/brcm2708/image/Makefile b/target/linux/brcm2708/image/Makefile -index e70bdd0..be667f3 100644 ---- a/target/linux/brcm2708/image/Makefile -+++ b/target/linux/brcm2708/image/Makefile -@@ -28,6 +28,10 @@ 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 -f9 $(BIN_DIR)/$(IMG_PREFIX)-sdcard-vfat-$(1).img -+ endif - endef - - define Image/Build diff --git a/targets/brcm2708-bcm2708/profiles.mk b/targets/brcm2708-bcm2708/profiles.mk index 8aedd810..4261913a 100644 --- a/targets/brcm2708-bcm2708/profiles.mk +++ b/targets/brcm2708-bcm2708/profiles.mk @@ -1,4 +1,4 @@ $(eval $(call GluonProfile,RaspberryPi)) $(eval $(call GluonProfileFactorySuffix,RaspberryPi,-vfat-ext4,.img.gz)) -$(eval $(call GluonProfileSysupgradeSuffix,RaspberryPi)) +$(eval $(call GluonProfileSysupgradeSuffix,RaspberryPi,-vfat-ext4,.img.gz)) $(eval $(call GluonModel,RaspberryPi,sdcard,raspberry-pi)) diff --git a/targets/brcm2708-bcm2709/profiles.mk b/targets/brcm2708-bcm2709/profiles.mk index 64f6168e..74b17215 100644 --- a/targets/brcm2708-bcm2709/profiles.mk +++ b/targets/brcm2708-bcm2709/profiles.mk @@ -1,4 +1,4 @@ $(eval $(call GluonProfile,RaspberryPi2)) $(eval $(call GluonProfileFactorySuffix,RaspberryPi2,-vfat-ext4,.img.gz)) -$(eval $(call GluonProfileSysupgradeSuffix,RaspberryPi2)) +$(eval $(call GluonProfileSysupgradeSuffix,RaspberryPi2,-vfat-ext4,.img.gz)) $(eval $(call GluonModel,RaspberryPi2,sdcard,raspberry-pi-2)) diff --git a/targets/targets.mk b/targets/targets.mk index afe52c0b..c9aa0382 100644 --- a/targets/targets.mk +++ b/targets/targets.mk @@ -7,6 +7,6 @@ $(eval $(call GluonTarget,x86,64)) ifneq ($(BROKEN),) $(eval $(call GluonTarget,ramips,rt305x)) # BROKEN: No AP+IBSS support -$(eval $(call GluonTarget,brcm2708,bcm2708)) # BROKEN: Untested, no sysupgrade support -$(eval $(call GluonTarget,brcm2708,bcm2709)) # BROKEN: Untested, no sysupgrade support +$(eval $(call GluonTarget,brcm2708,bcm2708)) # BROKEN: Needs more testing +$(eval $(call GluonTarget,brcm2708,bcm2709)) # BROKEN: Needs more testing endif From 2eb59ddec0b8dc5decc9e0f607b263a357e57a72 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 16 Jul 2015 23:07:10 +0200 Subject: [PATCH 046/867] Add support for sunxi target and BananaPi profile (untested) --- modules | 2 +- ...017-sunxi-fix-uboot-install-location.patch | 131 ++++++++++++++++++ ...xi-respect-CONFIG_TARGET_IMAGES_GZIP.patch | 21 +++ targets/sunxi/profiles.mk | 4 + targets/sunxi/vermagic | 1 + targets/targets.mk | 1 + 6 files changed, 159 insertions(+), 1 deletion(-) create mode 100644 patches/openwrt/0017-sunxi-fix-uboot-install-location.patch create mode 100644 patches/openwrt/0018-sunxi-respect-CONFIG_TARGET_IMAGES_GZIP.patch create mode 100644 targets/sunxi/profiles.mk create mode 100644 targets/sunxi/vermagic diff --git a/modules b/modules index 13a627e8..99b180a6 100644 --- a/modules +++ b/modules @@ -8,7 +8,7 @@ PACKAGES_OPENWRT_COMMIT=62037ba35fda4ae07e89c33946f229da2a941d47 PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git -PACKAGES_GLUON_COMMIT=5f0c86212d33d7c285197c67d288af4872d44d51 +PACKAGES_GLUON_COMMIT=881036e1f2818d2f0f0a8a72bfdb9c59e67b0e48 PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_COMMIT=6c78c2ac2cb9ec3be25e68b1cef7b2e2e0e4a346 diff --git a/patches/openwrt/0017-sunxi-fix-uboot-install-location.patch b/patches/openwrt/0017-sunxi-fix-uboot-install-location.patch new file mode 100644 index 00000000..71824b76 --- /dev/null +++ b/patches/openwrt/0017-sunxi-fix-uboot-install-location.patch @@ -0,0 +1,131 @@ +From: Matthias Schiffer +Date: Thu, 16 Jul 2015 22:01:02 +0200 +Subject: sunxi: fix uboot install location + +Install uboot files to KERNEL_BUILD_DIR instead of BIN_DIR to fix the +ImageBuilder. Similar fixes are necessary for many (all?) other uboot +targets. + +Also remove the DTS copy command, BIN_DIR was unnecessarily cluttered with +DTS files unrelated to the chosen profile. + +diff --git a/package/boot/uboot-sunxi/Makefile b/package/boot/uboot-sunxi/Makefile +index 14ba922..9032600 100644 +--- a/package/boot/uboot-sunxi/Makefile ++++ b/package/boot/uboot-sunxi/Makefile +@@ -6,6 +6,7 @@ + # + + include $(TOPDIR)/rules.mk ++include $(INCLUDE_DIR)/kernel.mk + + PKG_NAME:=u-boot + PKG_VERSION:=2015.01 +@@ -16,7 +17,7 @@ PKG_SOURCE_URL:= \ + + PKG_MD5SUM:=7f08dc9e98a71652bd6968888ed6ec95 + +-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) ++PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + + PKG_LICENSE:=GPL-2.0 GPL-2.0+ + PKG_LICENSE_FILES:=Licenses/README +@@ -136,16 +137,16 @@ define Build/Compile + endef + + define Package/uboot/install/default +- $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1) + $(CP) $(PKG_BUILD_DIR)/u-boot.bin \ +- $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.bin ++ $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-u-boot.bin + $(CP) $(PKG_BUILD_DIR)/spl/sunxi-spl.bin \ +- $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-spl.bin ++ $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-spl.bin + $(CP) $(PKG_BUILD_DIR)/u-boot-sunxi-with-spl.bin \ +- $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot-with-spl.bin ++ $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-u-boot-with-spl.bin + $(CP) uEnv.txt \ +- $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-uEnv.txt +- mkimage -C none -A arm -T script -d $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-uEnv.txt $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-boot.scr ++ $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-uEnv.txt ++ mkimage -C none -A arm -T script -d $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-uEnv.txt \ ++ $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-boot.scr + endef + + define Package/uboot/install/template +diff --git a/target/linux/sunxi/image/Makefile b/target/linux/sunxi/image/Makefile +index 6fcd61f..19ab935 100644 +--- a/target/linux/sunxi/image/Makefile ++++ b/target/linux/sunxi/image/Makefile +@@ -11,28 +11,12 @@ include $(INCLUDE_DIR)/host.mk + FAT32_BLOCK_SIZE=1024 + FAT32_BLOCKS=$(shell echo $$(($(CONFIG_SUNXI_SD_BOOT_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE)))) + +-BOARDS:= \ +- sun4i-a10-cubieboard \ +- sun4i-a10-olinuxino-lime \ +- sun4i-a10-pcduino \ +- sun5i-a13-olinuxino \ +- sun6i-a31-colombus \ +- sun6i-a31-m9 \ +- sun7i-a20-bananapi \ +- sun7i-a20-bananapro \ +- sun7i-a20-cubieboard2 \ +- sun7i-a20-cubietruck \ +- sun7i-a20-olinuxino-lime \ +- sun7i-a20-olinuxino-micro \ +- sun7i-a20-pcduino3 \ +- sun7i-a20-lamobo-r1 +- + define Image/BuildKernel + mkimage -A arm -O linux -T kernel -C none \ + -a 0x40008000 -e 0x40008000 \ + -n 'ARM OpenWrt Linux-$(LINUX_VERSION)' \ + -d $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-uImage +- ++ + ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) + $(CP) $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs + echo -ne '\x00\x00\x00\x00' >> $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs +@@ -42,27 +26,23 @@ define Image/BuildKernel + $(BIN_DIR)/$(IMG_PREFIX)-uImage-initramfs \ + ) + endif +- +- $(foreach board,$(BOARDS), +- $(CP) $(DTS_DIR)/$(board).dtb $(BIN_DIR)/ +- ) + endef + + define Image/Build/SDCard + rm -f $(KDIR)/boot.img + mkdosfs $(KDIR)/boot.img -C $(FAT32_BLOCKS) +- +- mcopy -i $(KDIR)/boot.img $(BIN_DIR)/uboot-sunxi-$(PROFILE)/$(IMG_PREFIX)-$(PROFILE)-boot.scr ::boot.scr +- mcopy -i $(KDIR)/boot.img $(BIN_DIR)/$(2).dtb ::dtb ++ ++ mcopy -i $(KDIR)/boot.img $(KDIR)/uboot-sunxi-$(PROFILE)-boot.scr ::boot.scr ++ mcopy -i $(KDIR)/boot.img $(DTS_DIR)/$(2).dtb ::dtb + mcopy -i $(KDIR)/boot.img $(BIN_DIR)/$(IMG_PREFIX)-uImage ::uImage +- ++ + ./gen_sunxi_sdcard_img.sh \ + $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-sdcard-vfat-$(1).img \ + $(KDIR)/boot.img \ + $(KDIR)/root.$(1) \ + $(CONFIG_SUNXI_SD_BOOT_PARTSIZE) \ + $(CONFIG_TARGET_ROOTFS_PARTSIZE) \ +- $(BIN_DIR)/uboot-sunxi-$(PROFILE)/$(IMG_PREFIX)-$(PROFILE)-u-boot-with-spl.bin ++ $(KDIR)/uboot-sunxi-$(PROFILE)-u-boot-with-spl.bin + endef + + define Image/Build/Profile/A10-OLinuXino-Lime +@@ -124,7 +104,7 @@ endef + define Image/Build + $(call Image/Build/$(1),$(1)) + $(call Image/Build/Profile/$(PROFILE),$(1)) +- ++ + dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync + endef + diff --git a/patches/openwrt/0018-sunxi-respect-CONFIG_TARGET_IMAGES_GZIP.patch b/patches/openwrt/0018-sunxi-respect-CONFIG_TARGET_IMAGES_GZIP.patch new file mode 100644 index 00000000..d919e6e4 --- /dev/null +++ b/patches/openwrt/0018-sunxi-respect-CONFIG_TARGET_IMAGES_GZIP.patch @@ -0,0 +1,21 @@ +From: Matthias Schiffer +Date: Thu, 16 Jul 2015 22:13:59 +0200 +Subject: sunxi: respect CONFIG_TARGET_IMAGES_GZIP + +The ext4 images are huge uncompressed. + +diff --git a/target/linux/sunxi/image/Makefile b/target/linux/sunxi/image/Makefile +index 19ab935..d3f4409 100644 +--- a/target/linux/sunxi/image/Makefile ++++ b/target/linux/sunxi/image/Makefile +@@ -43,6 +43,10 @@ define Image/Build/SDCard + $(CONFIG_SUNXI_SD_BOOT_PARTSIZE) \ + $(CONFIG_TARGET_ROOTFS_PARTSIZE) \ + $(KDIR)/uboot-sunxi-$(PROFILE)-u-boot-with-spl.bin ++ ++ ifneq ($(CONFIG_TARGET_IMAGES_GZIP),) ++ gzip -f9n $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-sdcard-vfat-$(1).img ++ endif + endef + + define Image/Build/Profile/A10-OLinuXino-Lime diff --git a/targets/sunxi/profiles.mk b/targets/sunxi/profiles.mk new file mode 100644 index 00000000..b54eea7b --- /dev/null +++ b/targets/sunxi/profiles.mk @@ -0,0 +1,4 @@ +$(eval $(call GluonProfile,Bananapi,uboot-sunxi-Bananapi kmod-rtc-sunxi)) +$(eval $(call GluonProfileFactorySuffix,Bananapi,-sdcard-vfat-ext4,.img.gz)) +$(eval $(call GluonProfileSysupgradeSuffix,Bananapi)) +$(eval $(call GluonModel,Bananapi,Bananapi,lemaker-banana-pi)) diff --git a/targets/sunxi/vermagic b/targets/sunxi/vermagic new file mode 100644 index 00000000..bbd7639c --- /dev/null +++ b/targets/sunxi/vermagic @@ -0,0 +1 @@ +387b6785dd15f72fef42f2d121dafce9 diff --git a/targets/targets.mk b/targets/targets.mk index c9aa0382..3712eace 100644 --- a/targets/targets.mk +++ b/targets/targets.mk @@ -9,4 +9,5 @@ ifneq ($(BROKEN),) $(eval $(call GluonTarget,ramips,rt305x)) # BROKEN: No AP+IBSS support $(eval $(call GluonTarget,brcm2708,bcm2708)) # BROKEN: Needs more testing $(eval $(call GluonTarget,brcm2708,bcm2709)) # BROKEN: Needs more testing +$(eval $(call GluonTarget,sunxi)) # BROKEN: Untested, no sysupgrade support endif From 303712d4b4a6c3d9d943c590e198cdd831587698 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 17 Jul 2015 20:53:19 +0200 Subject: [PATCH 047/867] brcm2708: don't use gzip -k --- .../openwrt/0016-brcm2708-Implement-sysupgrade.patch | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/patches/openwrt/0016-brcm2708-Implement-sysupgrade.patch b/patches/openwrt/0016-brcm2708-Implement-sysupgrade.patch index 7c69c554..4c205284 100644 --- a/patches/openwrt/0016-brcm2708-Implement-sysupgrade.patch +++ b/patches/openwrt/0016-brcm2708-Implement-sysupgrade.patch @@ -1,5 +1,5 @@ -From: blogic -Date: Tue, 14 Jul 2015 07:39:10 +0000 +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: @@ -11,8 +11,6 @@ a lot of space (76M vs 6M), also similar to x86. Signed-off-by: Bruno Randolf -git-svn-id: svn://svn.openwrt.org/openwrt/trunk@46347 3c298f89-4303-0410-b956-a3cf2f4a3e73 - diff --git a/target/linux/brcm2708/Makefile b/target/linux/brcm2708/Makefile index 30f6e1d..015aa9c 100644 --- a/target/linux/brcm2708/Makefile @@ -74,7 +72,7 @@ index 0000000..3e1ee00 + umount /mnt +} diff --git a/target/linux/brcm2708/image/Makefile b/target/linux/brcm2708/image/Makefile -index e70bdd0..0dd7b7d 100644 +index e70bdd0..2c18baf 100644 --- a/target/linux/brcm2708/image/Makefile +++ b/target/linux/brcm2708/image/Makefile @@ -28,6 +28,9 @@ define Image/Build/RaspberryPi @@ -82,7 +80,7 @@ index e70bdd0..0dd7b7d 100644 ./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 -k -f9 $(BIN_DIR)/$(IMG_PREFIX)-sdcard-vfat-$(1).img ++ gzip -f9n $(BIN_DIR)/$(IMG_PREFIX)-sdcard-vfat-$(1).img + endif endef From f6498e8773fcc870b17e6b7e4b07520e8b90192a Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 18 Jul 2015 17:51:03 +0200 Subject: [PATCH 048/867] Update modules --- include/toplevel.mk | 2 +- modules | 8 +- .../files/lib/gluon/upgrade/110-network | 1 + .../310-gluon-mesh-batman-adv-core-mesh | 1 + ...g-PIOs-as-sent-by-some-apple-routers.patch | 34 --- ...-support-for-tp-link-wr740n-v5.0-EU.patch} | 0 ...sourcerouting-parameter-registration.patch | 18 -- ...r71xx-add-support-for-TL-WR741ND-v5.patch} | 0 ...sourcerouting-parameter-registration.patch | 18 -- ... 0011-brcm2708-Implement-sysupgrade.patch} | 0 ...eded-source-dest-routing-workarounds.patch | 214 ------------------ ...12-sunxi-fix-uboot-install-location.patch} | 0 ...SAS-fixes-for-source-specific-routes.patch | 108 --------- ...i-respect-CONFIG_TARGET_IMAGES_GZIP.patch} | 0 ...ourcefilter-to-disable-source-filter.patch | 62 +++++ 15 files changed, 69 insertions(+), 397 deletions(-) delete mode 100644 patches/openwrt/0009-Revert-odhcp6c-work-around-RIOs-matching-PIOs-as-sent-by-some-apple-routers.patch rename patches/openwrt/{0014-ar71xx-add-support-for-tp-link-wr740n-v5.0-EU.patch => 0009-ar71xx-add-support-for-tp-link-wr740n-v5.0-EU.patch} (100%) delete mode 100644 patches/openwrt/0010-Revert-6to4-Remove-sourcerouting-parameter-registration.patch rename patches/openwrt/{0015-ar71xx-add-support-for-TL-WR741ND-v5.patch => 0010-ar71xx-add-support-for-TL-WR741ND-v5.patch} (100%) delete mode 100644 patches/openwrt/0011-Revert-6rd-Remove-sourcerouting-parameter-registration.patch rename patches/openwrt/{0016-brcm2708-Implement-sysupgrade.patch => 0011-brcm2708-Implement-sysupgrade.patch} (100%) delete mode 100644 patches/openwrt/0012-Revert-ipv6-remove-now-unneeded-source-dest-routing-workarounds.patch rename patches/openwrt/{0017-sunxi-fix-uboot-install-location.patch => 0012-sunxi-fix-uboot-install-location.patch} (100%) delete mode 100644 patches/openwrt/0013-Revert-linux-backport-IPv6-SAS-fixes-for-source-specific-routes.patch rename patches/openwrt/{0018-sunxi-respect-CONFIG_TARGET_IMAGES_GZIP.patch => 0013-sunxi-respect-CONFIG_TARGET_IMAGES_GZIP.patch} (100%) create mode 100644 patches/openwrt/0014-odhcp6c-add-option-sourcefilter-to-disable-source-filter.patch diff --git a/include/toplevel.mk b/include/toplevel.mk index 72522da5..087a7a19 100644 --- a/include/toplevel.mk +++ b/include/toplevel.mk @@ -7,7 +7,7 @@ # See /LICENSE for more information. # -RELEASE:=Barrier Breaker +RELEASE:=Chaos Calmer PREP_MK= OPENWRT_BUILD= QUIET=0 export IS_TTY=$(shell tty -s && echo 1 || echo 0) diff --git a/modules b/modules index 99b180a6..b67364b7 100644 --- a/modules +++ b/modules @@ -1,18 +1,18 @@ GLUON_FEEDS='openwrt gluon routing luci' OPENWRT_REPO=git://git.openwrt.org/15.05/openwrt.git -OPENWRT_COMMIT=7400cfec550b5fd3e12093006b3d42734ac2fd91 +OPENWRT_COMMIT=12a75ad198a96ec39e98fa1fdd3740aa1316a255 PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git -PACKAGES_OPENWRT_COMMIT=62037ba35fda4ae07e89c33946f229da2a941d47 +PACKAGES_OPENWRT_COMMIT=bc424ae8577ec10808cc5645eea700ebddf5183f PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git PACKAGES_GLUON_COMMIT=881036e1f2818d2f0f0a8a72bfdb9c59e67b0e48 PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git -PACKAGES_ROUTING_COMMIT=6c78c2ac2cb9ec3be25e68b1cef7b2e2e0e4a346 +PACKAGES_ROUTING_COMMIT=7d4e4fe21d6a7315c86fb070f2aac422f3334920 PACKAGES_LUCI_REPO=git://github.com/openwrt/luci.git -PACKAGES_LUCI_COMMIT=218e8f608e4ef988a5c74a9fb499eba4926084be +PACKAGES_LUCI_COMMIT=69fd4f14eef783076b69315c71fe57baad1f8925 PACKAGES_LUCI_BRANCH=for-15.05 diff --git a/package/gluon-core/files/lib/gluon/upgrade/110-network b/package/gluon-core/files/lib/gluon/upgrade/110-network index 07961788..d83f6d65 100755 --- a/package/gluon-core/files/lib/gluon/upgrade/110-network +++ b/package/gluon-core/files/lib/gluon/upgrade/110-network @@ -25,6 +25,7 @@ uci:section('network', 'interface', 'wan6', ifname = 'br-wan', peerdns = 0, ip6table = 1, + sourcefilter = 0, } ) diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh index 43c4e4d4..892ef102 100755 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh +++ b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh @@ -41,6 +41,7 @@ end uci:set('network', 'client', 'igmp_snooping', 0) uci:set('network', 'client', 'macaddr', sysconfig.primary_mac) uci:set('network', 'client', 'peerdns', 1) +uci:set('network', 'client', 'sourcefilter', 0) uci:delete('network', 'bat0') uci:section('network', 'interface', 'bat0', diff --git a/patches/openwrt/0009-Revert-odhcp6c-work-around-RIOs-matching-PIOs-as-sent-by-some-apple-routers.patch b/patches/openwrt/0009-Revert-odhcp6c-work-around-RIOs-matching-PIOs-as-sent-by-some-apple-routers.patch deleted file mode 100644 index 65120445..00000000 --- a/patches/openwrt/0009-Revert-odhcp6c-work-around-RIOs-matching-PIOs-as-sent-by-some-apple-routers.patch +++ /dev/null @@ -1,34 +0,0 @@ -From: Matthias Schiffer -Date: Sun, 21 Jun 2015 05:47:46 +0200 -Subject: Revert "odhcp6c: work around RIOs matching PIOs as sent by some apple routers" - -This reverts commit c46402e106ee924e3861f9685d6187552e7f8f2b. - -diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile -index d0935eb..a90f5ce 100644 ---- a/package/network/ipv6/odhcp6c/Makefile -+++ b/package/network/ipv6/odhcp6c/Makefile -@@ -8,7 +8,7 @@ - include $(TOPDIR)/rules.mk - - PKG_NAME:=odhcp6c --PKG_VERSION:=2015-06-10 -+PKG_VERSION:=2015-06-09 - PKG_RELEASE=$(PKG_SOURCE_VERSION) - - PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.script b/package/network/ipv6/odhcp6c/files/dhcpv6.script -index 84eb706..650c9b2 100755 ---- a/package/network/ipv6/odhcp6c/files/dhcpv6.script -+++ b/package/network/ipv6/odhcp6c/files/dhcpv6.script -@@ -88,10 +88,6 @@ setup_interface () { - - if [ -z "$gw" ]; then - proto_add_ipv6_route "$addr" "$mask" "$gw" "$metric" "$valid" -- -- # work around if there is a PIO matching a RIO -- # Linux seems to prefer source-dest over dest-only even if metric is higher -- proto_add_ipv6_route "$addr" "$mask" "$gw" "$metric" "$valid" "$addr/$mask" - else - for prefix in $PREFIXES $ADDRESSES; do - local paddr="${prefix%%,*}" diff --git a/patches/openwrt/0014-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 similarity index 100% rename from patches/openwrt/0014-ar71xx-add-support-for-tp-link-wr740n-v5.0-EU.patch rename to patches/openwrt/0009-ar71xx-add-support-for-tp-link-wr740n-v5.0-EU.patch diff --git a/patches/openwrt/0010-Revert-6to4-Remove-sourcerouting-parameter-registration.patch b/patches/openwrt/0010-Revert-6to4-Remove-sourcerouting-parameter-registration.patch deleted file mode 100644 index 63d6b796..00000000 --- a/patches/openwrt/0010-Revert-6to4-Remove-sourcerouting-parameter-registration.patch +++ /dev/null @@ -1,18 +0,0 @@ -From: Matthias Schiffer -Date: Sun, 21 Jun 2015 05:47:54 +0200 -Subject: Revert "6to4: Remove sourcerouting parameter registration" - -This reverts commit b64e2fa3f75b9ae21d670a9084ca855ea39c25e6. - -diff --git a/package/network/ipv6/6to4/files/6to4.sh b/package/network/ipv6/6to4/files/6to4.sh -index a5d0567..57efc52 100755 ---- a/package/network/ipv6/6to4/files/6to4.sh -+++ b/package/network/ipv6/6to4/files/6to4.sh -@@ -91,6 +91,7 @@ proto_6to4_init_config() { - proto_config_add_int "mtu" - proto_config_add_int "ttl" - proto_config_add_string "tos" -+ proto_config_add_boolean "sourcerouting" - } - - [ -n "$INCLUDE_ONLY" ] || { diff --git a/patches/openwrt/0015-ar71xx-add-support-for-TL-WR741ND-v5.patch b/patches/openwrt/0010-ar71xx-add-support-for-TL-WR741ND-v5.patch similarity index 100% rename from patches/openwrt/0015-ar71xx-add-support-for-TL-WR741ND-v5.patch rename to patches/openwrt/0010-ar71xx-add-support-for-TL-WR741ND-v5.patch diff --git a/patches/openwrt/0011-Revert-6rd-Remove-sourcerouting-parameter-registration.patch b/patches/openwrt/0011-Revert-6rd-Remove-sourcerouting-parameter-registration.patch deleted file mode 100644 index 0be7d722..00000000 --- a/patches/openwrt/0011-Revert-6rd-Remove-sourcerouting-parameter-registration.patch +++ /dev/null @@ -1,18 +0,0 @@ -From: Matthias Schiffer -Date: Sun, 21 Jun 2015 05:48:01 +0200 -Subject: Revert "6rd: Remove sourcerouting parameter registration" - -This reverts commit cedaf068bf920099483adfad2e106e35737c964f. - -diff --git a/package/network/ipv6/6rd/files/6rd.sh b/package/network/ipv6/6rd/files/6rd.sh -index 62d35b6..6c68b3b 100644 ---- a/package/network/ipv6/6rd/files/6rd.sh -+++ b/package/network/ipv6/6rd/files/6rd.sh -@@ -94,6 +94,7 @@ proto_6rd_init_config() { - proto_config_add_string "ip6prefixlen" - proto_config_add_string "ip4prefixlen" - proto_config_add_string "tunlink" -+ proto_config_add_boolean "sourcerouting" - proto_config_add_string "zone" - } - diff --git a/patches/openwrt/0016-brcm2708-Implement-sysupgrade.patch b/patches/openwrt/0011-brcm2708-Implement-sysupgrade.patch similarity index 100% rename from patches/openwrt/0016-brcm2708-Implement-sysupgrade.patch rename to patches/openwrt/0011-brcm2708-Implement-sysupgrade.patch diff --git a/patches/openwrt/0012-Revert-ipv6-remove-now-unneeded-source-dest-routing-workarounds.patch b/patches/openwrt/0012-Revert-ipv6-remove-now-unneeded-source-dest-routing-workarounds.patch deleted file mode 100644 index 5c7b5d4c..00000000 --- a/patches/openwrt/0012-Revert-ipv6-remove-now-unneeded-source-dest-routing-workarounds.patch +++ /dev/null @@ -1,214 +0,0 @@ -From: Matthias Schiffer -Date: Sun, 21 Jun 2015 05:48:45 +0200 -Subject: Revert "ipv6: remove now unneeded source-dest-routing workarounds" - -This reverts commit 31214c38c8dd0f70366b523f9b0335145b9386bd. - -diff --git a/package/network/ipv6/6in4/Makefile b/package/network/ipv6/6in4/Makefile -index b7c2da7..21e69e6 100644 ---- a/package/network/ipv6/6in4/Makefile -+++ b/package/network/ipv6/6in4/Makefile -@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk - - PKG_NAME:=6in4 - PKG_VERSION:=21 --PKG_RELEASE:=2 -+PKG_RELEASE:=1 - PKG_LICENSE:=GPL-2.0 - - include $(INCLUDE_DIR)/package.mk -diff --git a/package/network/ipv6/6in4/files/6in4.sh b/package/network/ipv6/6in4/files/6in4.sh -index af2ddca..0289df3 100755 ---- a/package/network/ipv6/6in4/files/6in4.sh -+++ b/package/network/ipv6/6in4/files/6in4.sh -@@ -27,8 +27,8 @@ proto_6in4_setup() { - local iface="$2" - local link="6in4-$cfg" - -- local mtu ttl tos ipaddr peeraddr ip6addr ip6prefix tunnelid username password updatekey -- json_get_vars mtu ttl tos ipaddr peeraddr ip6addr ip6prefix tunnelid username password updatekey -+ local mtu ttl tos ipaddr peeraddr ip6addr ip6prefix tunnelid username password updatekey sourcerouting -+ json_get_vars mtu ttl tos ipaddr peeraddr ip6addr ip6prefix tunnelid username password updatekey sourcerouting - - [ -z "$peeraddr" ] && { - proto_notify_error "$cfg" "MISSING_ADDRESS" -@@ -48,17 +48,21 @@ proto_6in4_setup() { - - proto_init_update "$link" 1 - -+ local source="" -+ [ "$sourcerouting" != "0" ] && source="::/128" -+ proto_add_ipv6_route "::" 0 "" "" "" "$source" -+ - [ -n "$ip6addr" ] && { - local local6="${ip6addr%%/*}" - local mask6="${ip6addr##*/}" - [[ "$local6" = "$mask6" ]] && mask6= - proto_add_ipv6_address "$local6" "$mask6" -- proto_add_ipv6_route "::" 0 "" "" "" "$local6/$mask6" -+ [ "$sourcerouting" != "0" ] && proto_add_ipv6_route "::" 0 "" "" "" "$local6/$mask6" - } - - [ -n "$ip6prefix" ] && { - proto_add_ipv6_prefix "$ip6prefix" -- proto_add_ipv6_route "::" 0 "" "" "" "$ip6prefix" -+ [ "$sourcerouting" != "0" ] && proto_add_ipv6_route "::" 0 "" "" "" "$ip6prefix" - } - - proto_add_tunnel -@@ -142,6 +146,7 @@ proto_6in4_init_config() { - proto_config_add_int "mtu" - proto_config_add_int "ttl" - proto_config_add_string "tos" -+ proto_config_add_boolean "sourcerouting" - } - - [ -n "$INCLUDE_ONLY" ] || { -diff --git a/package/network/ipv6/6rd/Makefile b/package/network/ipv6/6rd/Makefile -index cde7117..f9b7eae 100644 ---- a/package/network/ipv6/6rd/Makefile -+++ b/package/network/ipv6/6rd/Makefile -@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk - - PKG_NAME:=6rd - PKG_VERSION:=9 --PKG_RELEASE:=2 -+PKG_RELEASE:=1 - PKG_LICENSE:=GPL-2.0 - - include $(INCLUDE_DIR)/package.mk -diff --git a/package/network/ipv6/6rd/files/6rd.sh b/package/network/ipv6/6rd/files/6rd.sh -index 6c68b3b..b485136 100644 ---- a/package/network/ipv6/6rd/files/6rd.sh -+++ b/package/network/ipv6/6rd/files/6rd.sh -@@ -14,8 +14,8 @@ proto_6rd_setup() { - local iface="$2" - local link="6rd-$cfg" - -- local mtu df ttl tos ipaddr peeraddr ip6prefix ip6prefixlen ip4prefixlen tunlink zone -- json_get_vars mtu df ttl tos ipaddr peeraddr ip6prefix ip6prefixlen ip4prefixlen tunlink zone -+ local mtu df ttl tos ipaddr peeraddr ip6prefix ip6prefixlen ip4prefixlen tunlink sourcerouting zone -+ json_get_vars mtu df ttl tos ipaddr peeraddr ip6prefix ip6prefixlen ip4prefixlen tunlink sourcerouting zone - - [ -z "$ip6prefix" -o -z "$peeraddr" ] && { - proto_notify_error "$cfg" "MISSING_ADDRESS" -@@ -54,8 +54,13 @@ proto_6rd_setup() { - proto_add_ipv6_address "$ip6addr" "$ip6prefixlen" - proto_add_ipv6_prefix "$ip6lanprefix" - -- proto_add_ipv6_route "::" 0 "::$peeraddr" 4096 "" "$ip6addr/$ip6prefixlen" -- proto_add_ipv6_route "::" 0 "::$peeraddr" 4096 "" "$ip6lanprefix" -+ if [ "$sourcerouting" != "0" ]; then -+ proto_add_ipv6_route "::" 0 "::$peeraddr" 4096 "" "::/128" -+ proto_add_ipv6_route "::" 0 "::$peeraddr" 4096 "" "$ip6addr/$ip6prefixlen" -+ proto_add_ipv6_route "::" 0 "::$peeraddr" 4096 "" "$ip6lanprefix" -+ else -+ proto_add_ipv6_route "::" 0 "::$peeraddr" 4096 -+ fi - - proto_add_tunnel - json_add_string mode sit -diff --git a/package/network/ipv6/6to4/Makefile b/package/network/ipv6/6to4/Makefile -index fcec90d..6be2cc5 100644 ---- a/package/network/ipv6/6to4/Makefile -+++ b/package/network/ipv6/6to4/Makefile -@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk - - PKG_NAME:=6to4 - PKG_VERSION:=12 --PKG_RELEASE:=2 -+PKG_RELEASE:=1 - PKG_LICENSE:=GPL-2.0 - - include $(INCLUDE_DIR)/package.mk -diff --git a/package/network/ipv6/6to4/files/6to4.sh b/package/network/ipv6/6to4/files/6to4.sh -index 57efc52..ce1de53 100755 ---- a/package/network/ipv6/6to4/files/6to4.sh -+++ b/package/network/ipv6/6to4/files/6to4.sh -@@ -34,8 +34,8 @@ proto_6to4_setup() { - local iface="$2" - local link="6to4-$cfg" - -- local mtu ttl tos ipaddr -- json_get_vars mtu ttl tos ipaddr -+ local mtu ttl tos ipaddr sourcerouting -+ json_get_vars mtu ttl tos ipaddr sourcerouting - - ( proto_add_host_dependency "$cfg" 0.0.0.0 ) - -@@ -65,8 +65,13 @@ proto_6to4_setup() { - proto_add_ipv6_address "$local6" 16 - proto_add_ipv6_prefix "$prefix6::/48" - -- proto_add_ipv6_route "::" 0 "::192.88.99.1" "" "" "$local6/16" -- proto_add_ipv6_route "::" 0 "::192.88.99.1" "" "" "$prefix6::/48" -+ if [ "$sourcerouting" != "0" ]; then -+ proto_add_ipv6_route "::" 0 "::192.88.99.1" "" "" "::/128" -+ proto_add_ipv6_route "::" 0 "::192.88.99.1" "" "" "$local6/16" -+ proto_add_ipv6_route "::" 0 "::192.88.99.1" "" "" "$prefix6::/48" -+ else -+ proto_add_ipv6_route "::" 0 "::192.88.99.1" -+ fi - - proto_add_tunnel - json_add_string mode sit -diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile -index a90f5ce..ddd6917 100644 ---- a/package/network/ipv6/odhcp6c/Makefile -+++ b/package/network/ipv6/odhcp6c/Makefile -@@ -8,7 +8,7 @@ - include $(TOPDIR)/rules.mk - - PKG_NAME:=odhcp6c --PKG_VERSION:=2015-06-09 -+PKG_VERSION:=2015-05-16 - PKG_RELEASE=$(PKG_SOURCE_VERSION) - - PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.script b/package/network/ipv6/odhcp6c/files/dhcpv6.script -index 650c9b2..6cd59fa 100755 ---- a/package/network/ipv6/odhcp6c/files/dhcpv6.script -+++ b/package/network/ipv6/odhcp6c/files/dhcpv6.script -@@ -86,9 +86,10 @@ setup_interface () { - entry="${entry#*,}" - local metric="${entry%%,*}" - -- if [ -z "$gw" ]; then -+ if [ -z "$SOURCE_ROUTING" -o -z "$gw" ]; then - proto_add_ipv6_route "$addr" "$mask" "$gw" "$metric" "$valid" - else -+ proto_add_ipv6_route "$addr" "$mask" "$gw" "$metric" "$valid" "::/128" - for prefix in $PREFIXES $ADDRESSES; do - local paddr="${prefix%%,*}" - proto_add_ipv6_route "$addr" "$mask" "$gw" "$metric" "$valid" "$paddr" -diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.sh b/package/network/ipv6/odhcp6c/files/dhcpv6.sh -index adcb100..9fb6fa3 100755 ---- a/package/network/ipv6/odhcp6c/files/dhcpv6.sh -+++ b/package/network/ipv6/odhcp6c/files/dhcpv6.sh -@@ -23,6 +23,7 @@ proto_dhcpv6_init_config() { - proto_config_add_string zone_464xlat - proto_config_add_string zone - proto_config_add_string 'ifaceid:ip6addr' -+ proto_config_add_string 'sourcerouting:bool' - proto_config_add_string "userclass" - proto_config_add_string "vendorclass" - proto_config_add_boolean delegate -@@ -34,8 +35,8 @@ proto_dhcpv6_setup() { - local config="$1" - local iface="$2" - -- local reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes -- json_get_vars reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes -+ local reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid sourcerouting userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes -+ json_get_vars reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid sourcerouting userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes - - - # Configure -@@ -69,6 +70,7 @@ proto_dhcpv6_setup() { - [ -n "$iface_dslite" ] && proto_export "IFACE_DSLITE=$iface_dslite" - [ -n "$iface_map" ] && proto_export "IFACE_MAP=$iface_map" - [ -n "$iface_464xlat" ] && proto_export "IFACE_464XLAT=$iface_464xlat" -+ [ "$sourcerouting" != "0" ] && proto_export "SOURCE_ROUTING=1" - [ "$delegate" = "0" ] && proto_export "IFACE_DSLITE_DELEGATE=0" - [ "$delegate" = "0" ] && proto_export "IFACE_MAP_DELEGATE=0" - [ -n "$zone_dslite" ] && proto_export "ZONE_DSLITE=$zone_dslite" diff --git a/patches/openwrt/0017-sunxi-fix-uboot-install-location.patch b/patches/openwrt/0012-sunxi-fix-uboot-install-location.patch similarity index 100% rename from patches/openwrt/0017-sunxi-fix-uboot-install-location.patch rename to patches/openwrt/0012-sunxi-fix-uboot-install-location.patch diff --git a/patches/openwrt/0013-Revert-linux-backport-IPv6-SAS-fixes-for-source-specific-routes.patch b/patches/openwrt/0013-Revert-linux-backport-IPv6-SAS-fixes-for-source-specific-routes.patch deleted file mode 100644 index 1bc94146..00000000 --- a/patches/openwrt/0013-Revert-linux-backport-IPv6-SAS-fixes-for-source-specific-routes.patch +++ /dev/null @@ -1,108 +0,0 @@ -From: Matthias Schiffer -Date: Sun, 21 Jun 2015 05:49:05 +0200 -Subject: Revert "linux: backport IPv6 SAS fixes for source-specific routes" - -This reverts commit 5168c9a5702648eb690d32ec821647aca80aeba9. - -diff --git a/target/linux/generic/patches-3.18/667-ipv6-Fixed-source-specific-default-route-handling.patch b/target/linux/generic/patches-3.18/667-ipv6-Fixed-source-specific-default-route-handling.patch -deleted file mode 100644 -index f67ef47..0000000 ---- a/target/linux/generic/patches-3.18/667-ipv6-Fixed-source-specific-default-route-handling.patch -+++ /dev/null -@@ -1,96 +0,0 @@ --From e16e888b525503be05b3aea64190e8b3bdef44d0 Mon Sep 17 00:00:00 2001 --From: Markus Stenberg --Date: Tue, 5 May 2015 13:36:59 +0300 --Subject: [PATCH] ipv6: Fixed source specific default route handling. -- --If there are only IPv6 source specific default routes present, the --host gets -ENETUNREACH on e.g. connect() because ip6_dst_lookup_tail --calls ip6_route_output first, and given source address any, it fails, --and ip6_route_get_saddr is never called. -- --The change is to use the ip6_route_get_saddr, even if the initial --ip6_route_output fails, and then doing ip6_route_output _again_ after --we have appropriate source address available. -- --Note that this is '99% fix' to the problem; a correct fix would be to --do route lookups only within addrconf.c when picking a source address, --and never call ip6_route_output before source address has been --populated. -- --Signed-off-by: Markus Stenberg --Signed-off-by: David S. Miller ----- -- net/ipv6/ip6_output.c | 39 +++++++++++++++++++++++++++++++-------- -- net/ipv6/route.c | 5 +++-- -- 2 files changed, 34 insertions(+), 10 deletions(-) -- ----- a/net/ipv6/ip6_output.c --+++ b/net/ipv6/ip6_output.c --@@ -898,21 +898,45 @@ static int ip6_dst_lookup_tail(struct so -- #endif -- int err; -- --- if (*dst == NULL) --- *dst = ip6_route_output(net, sk, fl6); --- --- if ((err = (*dst)->error)) --- goto out_err_release; --+ /* The correct way to handle this would be to do --+ * ip6_route_get_saddr, and then ip6_route_output; however, --+ * the route-specific preferred source forces the --+ * ip6_route_output call _before_ ip6_route_get_saddr. --+ * --+ * In source specific routing (no src=any default route), --+ * ip6_route_output will fail given src=any saddr, though, so --+ * that's why we try it again later. --+ */ --+ if (ipv6_addr_any(&fl6->saddr) && (!*dst || !(*dst)->error)) { --+ struct rt6_info *rt; --+ bool had_dst = *dst != NULL; -- --- if (ipv6_addr_any(&fl6->saddr)) { --- struct rt6_info *rt = (struct rt6_info *) *dst; --+ if (!had_dst) --+ *dst = ip6_route_output(net, sk, fl6); --+ rt = (*dst)->error ? NULL : (struct rt6_info *)*dst; -- err = ip6_route_get_saddr(net, rt, &fl6->daddr, -- sk ? inet6_sk(sk)->srcprefs : 0, -- &fl6->saddr); -- if (err) -- goto out_err_release; --+ --+ /* If we had an erroneous initial result, pretend it --+ * never existed and let the SA-enabled version take --+ * over. --+ */ --+ if (!had_dst && (*dst)->error) { --+ dst_release(*dst); --+ *dst = NULL; --+ } -- } -- --+ if (!*dst) --+ *dst = ip6_route_output(net, sk, fl6); --+ --+ err = (*dst)->error; --+ if (err) --+ goto out_err_release; --+ -- #ifdef CONFIG_IPV6_OPTIMISTIC_DAD -- /* -- * Here if the dst entry we've looked up ----- a/net/ipv6/route.c --+++ b/net/ipv6/route.c --@@ -2182,9 +2182,10 @@ int ip6_route_get_saddr(struct net *net, -- unsigned int prefs, -- struct in6_addr *saddr) -- { --- struct inet6_dev *idev = ip6_dst_idev((struct dst_entry *)rt); --+ struct inet6_dev *idev = --+ rt ? ip6_dst_idev((struct dst_entry *)rt) : NULL; -- int err = 0; --- if (rt->rt6i_prefsrc.plen) --+ if (rt && rt->rt6i_prefsrc.plen) -- *saddr = rt->rt6i_prefsrc.addr; -- else -- err = ipv6_dev_get_saddr(net, idev ? idev->dev : NULL, diff --git a/patches/openwrt/0018-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/0018-sunxi-respect-CONFIG_TARGET_IMAGES_GZIP.patch rename to patches/openwrt/0013-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/0014-odhcp6c-add-option-sourcefilter-to-disable-source-filter.patch new file mode 100644 index 00000000..56d3d547 --- /dev/null +++ b/patches/openwrt/0014-odhcp6c-add-option-sourcefilter-to-disable-source-filter.patch @@ -0,0 +1,62 @@ +From: Matthias Schiffer +Date: Sat, 18 Jul 2015 17:13:23 +0200 +Subject: odhcp6c: add option "sourcefilter" to disable source filter + +Signed-off-by: Steven Barth + +diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile +index 5bf43bd..75de54c 100644 +--- a/package/network/ipv6/odhcp6c/Makefile ++++ b/package/network/ipv6/odhcp6c/Makefile +@@ -8,7 +8,7 @@ + include $(TOPDIR)/rules.mk + + PKG_NAME:=odhcp6c +-PKG_VERSION:=2015-07-13 ++PKG_VERSION:=2015-07-18 + PKG_RELEASE=$(PKG_SOURCE_VERSION) + + PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.script b/package/network/ipv6/odhcp6c/files/dhcpv6.script +index b8cbddb..33f6d9b 100755 +--- a/package/network/ipv6/odhcp6c/files/dhcpv6.script ++++ b/package/network/ipv6/odhcp6c/files/dhcpv6.script +@@ -76,7 +76,7 @@ setup_interface () { + done + + for entry in $RA_ROUTES; do +- local duplicate=0 ++ local duplicate=$NOSOURCEFILTER + local addr="${entry%%/*}" + entry="${entry#*/}" + local mask="${entry%%,*}" +diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.sh b/package/network/ipv6/odhcp6c/files/dhcpv6.sh +index adcb100..4a453fd 100755 +--- a/package/network/ipv6/odhcp6c/files/dhcpv6.sh ++++ b/package/network/ipv6/odhcp6c/files/dhcpv6.sh +@@ -28,14 +28,15 @@ proto_dhcpv6_init_config() { + proto_config_add_boolean delegate + proto_config_add_int "soltimeout" + proto_config_add_boolean fakeroutes ++ proto_config_add_boolean sourcefilter + } + + proto_dhcpv6_setup() { + local config="$1" + local iface="$2" + +- local reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes +- json_get_vars reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes ++ local reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes sourcefilter ++ json_get_vars reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes sourcefilter + + + # Configure +@@ -76,6 +77,7 @@ proto_dhcpv6_setup() { + [ -n "$zone_464xlat" ] && proto_export "ZONE_464XLAT=$zone_464xlat" + [ -n "$zone" ] && proto_export "ZONE=$zone" + [ "$fakeroutes" != "0" ] && proto_export "FAKE_ROUTES=1" ++ [ "$sourcefilter" = "0" ] && proto_export "NOSOURCEFILTER=1" + + proto_export "INTERFACE=$config" + proto_run_command "$config" odhcp6c \ From 48054fc943e11467b0a2b93e0293a968dff09273 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 18 Jul 2015 21:21:06 +0200 Subject: [PATCH 049/867] Add update-vermagic make target --- Makefile | 21 +++++++++++++++++---- docs/dev/hardware.rst | 5 +++-- include/gluon.mk | 4 +++- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 187a5acb..d19354d8 100644 --- a/Makefile +++ b/Makefile @@ -103,6 +103,13 @@ manifest: FORCE mkdir -p $(GLUON_IMAGEDIR)/sysupgrade mv $(GLUON_BUILDDIR)/$(GLUON_BRANCH).manifest.tmp $(GLUON_IMAGEDIR)/sysupgrade/$(GLUON_BRANCH).manifest +update-vermagic: FORCE + @$(CheckExternal) + +($(foreach GLUON_TARGET,$(GLUON_TARGETS), \ + $(GLUONMAKE_EARLY) maybe-prepare-target GLUON_TARGET='$(GLUON_TARGET)' V=s$(OPENWRT_VERBOSE) && \ + $(GLUONMAKE) update-vermagic GLUON_TARGET='$(GLUON_TARGET)' V=s$(OPENWRT_VERBOSE) && \ + ) :) + dirclean : FORCE for dir in build_dir dl staging_dir tmp; do \ rm -rf $(GLUON_ORIGOPENWRTDIR)/$$dir; \ @@ -364,9 +371,7 @@ package_install: FORCE if [ ! -x $(TARGET_DIR)/bin/opkg ]; then rm -rf $(TARGET_DIR)/usr/lib/opkg; fi -ifeq ($(GLUON_OPKG_CONFIG),1) include $(INCLUDE_DIR)/version.mk -endif opkg_config: FORCE cp $(GLUON_OPENWRTDIR)/package/system/opkg/files/opkg.conf $(TARGET_DIR)/etc/opkg.conf @@ -382,7 +387,7 @@ image: FORCE cp -r $(BOARD_KDIR) $(PROFILE_KDIR) +$(GLUONMAKE) package_install - +$(GLUONMAKE) opkg_config GLUON_OPKG_CONFIG=1 + +$(GLUONMAKE) opkg_config $(call Image/mkfs/prepare) $(_SINGLE)$(NO_TRACE_MAKE) -C $(TOPDIR)/target/linux/$(BOARD)/image install TARGET_BUILD=1 IMG_PREFIX=gluon \ @@ -418,7 +423,15 @@ manifest: FORCE ) : \ ) >> $(GLUON_BUILDDIR)/$(GLUON_BRANCH).manifest.tmp +update-vermagic: FORCE + mkdir -p '$(BOARD_BUILDDIR)' + echo '$(DEFAULT_OPKG_REPO)' > '$(BOARD_BUILDDIR)/default_opkg_repo' + $(VERSION_SED) '$(BOARD_BUILDDIR)/default_opkg_repo' + wget -q -O- "$$(cat '$(BOARD_BUILDDIR)/default_opkg_repo')/base/Packages.gz" \ + | gzip -d \ + | awk '/Depends: kernel / { match($$3,/[[:xdigit:]]{32}/,m); print m[0]; exit }' \ + > $(GLUONDIR)/targets/$(GLUON_TARGET)/vermagic -.PHONY: all images prepare clean gluon-tools manifest +.PHONY: all images prepare clean gluon-tools manifest update-vermagic endif diff --git a/docs/dev/hardware.rst b/docs/dev/hardware.rst index d2f3424a..2e8e2491 100644 --- a/docs/dev/hardware.rst +++ b/docs/dev/hardware.rst @@ -84,8 +84,9 @@ The file ``config`` can be used to add additional, target-specific options to th The files ``vermagic`` must have the correct content so kernel modules from the upstream repositories can be installed without dependency issues. The OpenWrt version a Gluon release is based on is defined by the upstream package repo URL in ``include/gluon.mk`` -(in the variable ``CONFIG_VERSION_REPO``); at the time this documentation was written, this was ``barrier_breaker/14.07``; whenever -the package repo is updated, all ``vermagic`` files must be updated as well. +(in the variable ``DEFAULT_OPKG_REPO``); at the time this documentation was written, this was ``barrier_breaker/14.07``; whenever +the package repo is updated, all ``vermagic`` files must be updated as well. The command ``make update-vermagic`` can be used to get the correct +vermagic, or update the values when ``DEFAULT_OPKG_REPO`` has changed. The content is a hash which is part of the version number of the kernel package. So in the case of ``ar71xx-generic`` on ``barrier_breaker``, we look for the kernel package in the directory ``https://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/base/``. diff --git a/include/gluon.mk b/include/gluon.mk index 5047eb68..3373ab29 100644 --- a/include/gluon.mk +++ b/include/gluon.mk @@ -35,7 +35,9 @@ export GLUON_LANGS ifeq ($(OPENWRT_BUILD),1) ifeq ($(GLUON_TOOLS),1) -CONFIG_VERSION_REPO := $(shell $(GLUONDIR)/scripts/site.sh opkg_repo || echo http://downloads.openwrt.org/chaos_calmer/15.05-rc2/%S/packages) +DEFAULT_OPKG_REPO := http://downloads.openwrt.org/chaos_calmer/15.05-rc2/%S/packages + +CONFIG_VERSION_REPO := $(shell $(GLUONDIR)/scripts/site.sh opkg_repo || echo '$(DEFAULT_OPKG_REPO)') export CONFIG_VERSION_REPO GLUON_SITE_CODE := $(shell $(GLUONDIR)/scripts/site.sh site_code) From 508dca41eb36c8331a0abbc94653d53ca2f0a812 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 18 Jul 2015 21:22:21 +0200 Subject: [PATCH 050/867] Update DEFAULT_OPKG_REPO to 15.05-rc3 --- include/gluon.mk | 2 +- targets/ar71xx-generic/vermagic | 2 +- targets/ar71xx-nand/vermagic | 2 +- targets/brcm2708-bcm2708/vermagic | 2 +- targets/brcm2708-bcm2709/vermagic | 2 +- targets/mpc85xx-generic/vermagic | 2 +- targets/ramips-rt305x/vermagic | 2 +- targets/sunxi/vermagic | 2 +- targets/x86-64/vermagic | 2 +- targets/x86-generic/vermagic | 2 +- targets/x86-kvm_guest/vermagic | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/gluon.mk b/include/gluon.mk index 3373ab29..4f99ec1c 100644 --- a/include/gluon.mk +++ b/include/gluon.mk @@ -35,7 +35,7 @@ export GLUON_LANGS ifeq ($(OPENWRT_BUILD),1) ifeq ($(GLUON_TOOLS),1) -DEFAULT_OPKG_REPO := http://downloads.openwrt.org/chaos_calmer/15.05-rc2/%S/packages +DEFAULT_OPKG_REPO := http://downloads.openwrt.org/chaos_calmer/15.05-rc3/%S/packages CONFIG_VERSION_REPO := $(shell $(GLUONDIR)/scripts/site.sh opkg_repo || echo '$(DEFAULT_OPKG_REPO)') export CONFIG_VERSION_REPO diff --git a/targets/ar71xx-generic/vermagic b/targets/ar71xx-generic/vermagic index 43702d39..122a8aab 100644 --- a/targets/ar71xx-generic/vermagic +++ b/targets/ar71xx-generic/vermagic @@ -1 +1 @@ -47cf67747cc95dea86ac56de2508504c +5dcb66d04a38219f7fd91c748f0e9a32 diff --git a/targets/ar71xx-nand/vermagic b/targets/ar71xx-nand/vermagic index dbf5b2f8..f359f68a 100644 --- a/targets/ar71xx-nand/vermagic +++ b/targets/ar71xx-nand/vermagic @@ -1 +1 @@ -20a1d10ab1094c3fb87bfcaacac54d23 +08d628f1b60980ae837e80caaf2d7e37 diff --git a/targets/brcm2708-bcm2708/vermagic b/targets/brcm2708-bcm2708/vermagic index 83031c6d..f6eb6b84 100644 --- a/targets/brcm2708-bcm2708/vermagic +++ b/targets/brcm2708-bcm2708/vermagic @@ -1 +1 @@ -acfd4d19ee84c79b9ab4c392f3e94cee +a8463905834d64a3df8c231cf94ffc88 diff --git a/targets/brcm2708-bcm2709/vermagic b/targets/brcm2708-bcm2709/vermagic index 8344ad20..2964cf3e 100644 --- a/targets/brcm2708-bcm2709/vermagic +++ b/targets/brcm2708-bcm2709/vermagic @@ -1 +1 @@ -3912f3ddca091e4dc503a2d535a0fae5 +beebeea48e3792a20d2324a49f04b74d diff --git a/targets/mpc85xx-generic/vermagic b/targets/mpc85xx-generic/vermagic index 454f24d6..a29e7e74 100644 --- a/targets/mpc85xx-generic/vermagic +++ b/targets/mpc85xx-generic/vermagic @@ -1 +1 @@ -941b423bf2458808787f26bdb072a8f4 +682734a2bcc20cf580e27db161f6d0df diff --git a/targets/ramips-rt305x/vermagic b/targets/ramips-rt305x/vermagic index 28bebb91..a39462c9 100644 --- a/targets/ramips-rt305x/vermagic +++ b/targets/ramips-rt305x/vermagic @@ -1 +1 @@ -ced5b5a0a4b7d37ece0f2af5dad52992 +73d2b013e81727fe0664fd1b78bd291e diff --git a/targets/sunxi/vermagic b/targets/sunxi/vermagic index bbd7639c..21f65d6e 100644 --- a/targets/sunxi/vermagic +++ b/targets/sunxi/vermagic @@ -1 +1 @@ -387b6785dd15f72fef42f2d121dafce9 +67fc80824241f73ea9ef5de62059465a diff --git a/targets/x86-64/vermagic b/targets/x86-64/vermagic index 3f67824e..52037a9b 100644 --- a/targets/x86-64/vermagic +++ b/targets/x86-64/vermagic @@ -1 +1 @@ -c98e41bf75d421d517bb83bb2dd9f0a4 +fd9bfcbbba8366c338b3e2a3eb8448d5 diff --git a/targets/x86-generic/vermagic b/targets/x86-generic/vermagic index 128d11e3..bc39f47d 100644 --- a/targets/x86-generic/vermagic +++ b/targets/x86-generic/vermagic @@ -1 +1 @@ -f42c71e8114133916fd30f85470545e5 +efa451855d1db0df511f08a5ef56377c diff --git a/targets/x86-kvm_guest/vermagic b/targets/x86-kvm_guest/vermagic index f465d300..d4170ba5 100644 --- a/targets/x86-kvm_guest/vermagic +++ b/targets/x86-kvm_guest/vermagic @@ -1 +1 @@ -9023fccdcd64c8d92778dee7bd1576dc +77694101191b9fcdbf96b2622dd5d5a8 From bb869b800e5a07ee70a59a546a1127d672cd3807 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 21 Jul 2015 15:42:13 +0200 Subject: [PATCH 051/867] ar71xx-generic: add images for TL-WR940N These are identical to the TL-WR941ND (and identify as TL-WR941ND internally). --- targets/ar71xx-generic/profiles.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index f02bef40..a285a53b 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -61,7 +61,7 @@ $(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-WR941N/ND v2, v3, v4, v5, v6 +# 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)) $(eval $(call GluonModel,TLWR941,tl-wr941nd-v3,tp-link-tl-wr941n-nd-v3)) @@ -69,6 +69,10 @@ $(eval $(call GluonModel,TLWR941,tl-wr941nd-v4,tp-link-tl-wr941n-nd-v4)) $(eval $(call GluonModel,TLWR941,tl-wr941nd-v5,tp-link-tl-wr941n-nd-v5)) ifeq ($(BROKEN),1) $(eval $(call GluonModel,TLWR941,tl-wr941nd-v6,tp-link-tl-wr941n-nd-v6)) # BROKEN: untested + +$(eval $(call GluonModel,TLWR941,tl-wr941nd-v4,tp-link-tl-wr940n-nd-v1)) # BROKEN: untested +$(eval $(call GluonModel,TLWR941,tl-wr941nd-v5,tp-link-tl-wr940n-nd-v2)) # BROKEN: untested +$(eval $(call GluonModel,TLWR941,tl-wr941nd-v6,tp-link-tl-wr940n-nd-v3)) # BROKEN: untested endif # TL-WR1043N/ND v1, v2 From 6f1989d43ae2aef4410daff8c63d14ae1a49bd74 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 21 Jul 2015 15:43:56 +0200 Subject: [PATCH 052/867] ar71xx-generic: also provide images for the Ubiquiti Loco, Picostation and Rocket M While the images are the same that are used for the Bullet M, adding these copies will help users choose the correct image for their device. --- 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 a285a53b..4308b6f3 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -144,6 +144,10 @@ endif ## Ubiquiti (everything) $(eval $(call GluonProfile,UBNT)) $(eval $(call GluonModel,UBNT,ubnt-bullet-m,ubiquiti-bullet-m)) +$(eval $(call GluonModel,UBNT,ubnt-bullet-m,ubiquiti-loco-m)) +$(eval $(call GluonModel,UBNT,ubnt-bullet-m,ubiquiti-picostation-m)) +$(eval $(call GluonModel,UBNT,ubnt-bullet-m,ubiquiti-rocket-m)) + $(eval $(call GluonModel,UBNT,ubnt-loco-m-xw,ubiquiti-loco-m-xw)) $(eval $(call GluonModel,UBNT,ubnt-nano-m,ubiquiti-nanostation-m)) $(eval $(call GluonModel,UBNT,ubnt-nano-m-xw,ubiquiti-nanostation-m-xw)) From dfcac0aaa54997e2ba71a2e5523debe4c24f9519 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 23 Jul 2015 01:41:25 +0200 Subject: [PATCH 053/867] ar71xx: fix wndr3700_board_detect for some NETGEAR WNDR3700v2 --- ...d_detect-for-some-NETGEAR-WNDR3700v2.patch | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 patches/openwrt/0015-ar71xx-fix-wndr3700_board_detect-for-some-NETGEAR-WNDR3700v2.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 new file mode 100644 index 00000000..651045b4 --- /dev/null +++ b/patches/openwrt/0015-ar71xx-fix-wndr3700_board_detect-for-some-NETGEAR-WNDR3700v2.patch @@ -0,0 +1,26 @@ +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 8f4bb40..392f498 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 From 1195760cb6f3911f8076585afc71ba6326325c7f Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 23 Jul 2015 02:27:04 +0200 Subject: [PATCH 054/867] ath10k: update Candelatech firmware to v14 --- ...elatech-community-firmware-as-an-additional-choice.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/patches/openwrt/0005-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch b/patches/openwrt/0005-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch index 26090220..a7ea2438 100644 --- a/patches/openwrt/0005-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch +++ b/patches/openwrt/0005-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch @@ -3,18 +3,18 @@ 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 2af5d39..2d90aef 100644 +index 2af5d39..5b85971 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -604,6 +604,14 @@ This module adds support for wireless adapters based on Atheros USB AR9271 and AR7010 family of chipsets. endef -+ATH10K_CT_COMMUNITY_FW:=firmware-2-ct-full-community-13.bin ++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:=a3decc529b0171ae9ec4495089ab354a ++ MD5SUM:=800799459c20c1683138c74b3ba58f25 +endef +$(eval $(call Download,ath10k-firmware-ct-community)) + From 03ed475a42990fd76fab6f906b0a7fdb982a49ca Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Fri, 24 Jul 2015 21:54:41 +0200 Subject: [PATCH 055/867] openwrt/mac80211: set mcast-rate for mesh point interfaces --- ...mcast-rate-for-mesh-point-interfaces.patch | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 patches/openwrt/0016-mac80211-set-mcast-rate-for-mesh-point-interfaces.patch diff --git a/patches/openwrt/0016-mac80211-set-mcast-rate-for-mesh-point-interfaces.patch b/patches/openwrt/0016-mac80211-set-mcast-rate-for-mesh-point-interfaces.patch new file mode 100644 index 00000000..cb5d7b5e --- /dev/null +++ b/patches/openwrt/0016-mac80211-set-mcast-rate-for-mesh-point-interfaces.patch @@ -0,0 +1,47 @@ +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 c9bc3d6..8137b24 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 From 56e7753035bbffb604b869bfceaf35367bf88a17 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Sat, 25 Jul 2015 21:01:38 +0200 Subject: [PATCH 056/867] check_site: allow subcheck to be nil in need_table() --- scripts/check_site_lib.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/check_site_lib.lua b/scripts/check_site_lib.lua index ec2498ec..99489302 100644 --- a/scripts/check_site_lib.lua +++ b/scripts/check_site_lib.lua @@ -84,8 +84,10 @@ function need_table(varname, subcheck, required) assert_type(var, 'table', "site.conf error: expected `" .. varname .. "' to be a table") - for k, v in pairs(var) do - subcheck(k, v) + if subcheck then + for k, v in pairs(var) do + subcheck(k, v) + end end return var From 75cebd236db7674eaea64da60ede5c8d2049661c Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 27 Jul 2015 20:45:33 +0200 Subject: [PATCH 057/867] hostapd: prevent channel switch for 5GHz hostapd would switch the primary and secondary channel on 5GHz networks in certain circumstances, completely breaking the adhoc interfaces of the WLAN adapter (they would lose their configuration). As a temporary fix, disable this channel switch function. --- ...tapd-prevent-channel-switch-for-5GHz.patch | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 patches/openwrt/0017-hostapd-prevent-channel-switch-for-5GHz.patch diff --git a/patches/openwrt/0017-hostapd-prevent-channel-switch-for-5GHz.patch b/patches/openwrt/0017-hostapd-prevent-channel-switch-for-5GHz.patch new file mode 100644 index 00000000..03a24967 --- /dev/null +++ b/patches/openwrt/0017-hostapd-prevent-channel-switch-for-5GHz.patch @@ -0,0 +1,84 @@ +From: Matthias Schiffer +Date: Mon, 27 Jul 2015 20:42:50 +0200 +Subject: hostapd: prevent channel switch for 5GHz + +hostapd would switch the primary and secondary channel on 5GHz networks in +certain circumstances, completely breaking the adhoc interfaces of the WLAN +adapter (they would lose their configuration). + +As a temporary fix, disable this channel switch function. + +diff --git a/package/network/services/hostapd/patches/470-no_channel_switch.patch b/package/network/services/hostapd/patches/470-no_channel_switch.patch +new file mode 100644 +index 0000000..2eb1d7e +--- /dev/null ++++ b/package/network/services/hostapd/patches/470-no_channel_switch.patch +@@ -0,0 +1,68 @@ ++--- a/src/common/hw_features_common.c +++++ b/src/common/hw_features_common.c ++@@ -172,7 +172,6 @@ int check_40mhz_5g(struct hostapd_hw_mod ++ struct wpa_scan_results *scan_res, int pri_chan, ++ int sec_chan) ++ { ++- int pri_freq, sec_freq, pri_bss, sec_bss; ++ int bss_pri_chan, bss_sec_chan; ++ size_t i; ++ int match; ++@@ -183,57 +182,6 @@ int check_40mhz_5g(struct hostapd_hw_mod ++ if (pri_chan == sec_chan) ++ return 0; ++ ++- pri_freq = hw_get_freq(mode, pri_chan); ++- sec_freq = hw_get_freq(mode, sec_chan); ++- ++- /* ++- * Switch PRI/SEC channels if Beacons were detected on selected SEC ++- * channel, but not on selected PRI channel. ++- */ ++- pri_bss = sec_bss = 0; ++- for (i = 0; i < scan_res->num; i++) { ++- struct wpa_scan_res *bss = scan_res->res[i]; ++- if (bss->freq == pri_freq) ++- pri_bss++; ++- else if (bss->freq == sec_freq) ++- sec_bss++; ++- } ++- if (sec_bss && !pri_bss) { ++- wpa_printf(MSG_INFO, ++- "Switch own primary and secondary channel to get secondary channel with no Beacons from other BSSes"); ++- return 2; ++- } ++- ++- /* ++- * Match PRI/SEC channel with any existing HT40 BSS on the same ++- * channels that we are about to use (if already mixed order in ++- * existing BSSes, use own preference). ++- */ ++- match = 0; ++- for (i = 0; i < scan_res->num; i++) { ++- struct wpa_scan_res *bss = scan_res->res[i]; ++- get_pri_sec_chan(bss, &bss_pri_chan, &bss_sec_chan); ++- if (pri_chan == bss_pri_chan && ++- sec_chan == bss_sec_chan) { ++- match = 1; ++- break; ++- } ++- } ++- if (!match) { ++- for (i = 0; i < scan_res->num; i++) { ++- struct wpa_scan_res *bss = scan_res->res[i]; ++- get_pri_sec_chan(bss, &bss_pri_chan, &bss_sec_chan); ++- if (pri_chan == bss_sec_chan && ++- sec_chan == bss_pri_chan) { ++- wpa_printf(MSG_INFO, "Switch own primary and " ++- "secondary channel due to BSS " ++- "overlap with " MACSTR, ++- MAC2STR(bss->bssid)); ++- return 2; ++- } ++- } ++- } ++- ++ return 1; ++ } ++ From 3f2f37f098fb2d6303d607aee3bf55f987dde78d Mon Sep 17 00:00:00 2001 From: Neal Oakey Date: Thu, 30 Jul 2015 15:11:39 +0200 Subject: [PATCH 058/867] TP-Link TL-WA701ND v2: remove BROKEN --- targets/ar71xx-generic/profiles.mk | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 4308b6f3..a67fdeb5 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -12,9 +12,7 @@ $(eval $(call GluonModel,CPE510,cpe210-220-510-520,tp-link-cpe520-v1.0)) # TL-WA701N/ND v1, v2 $(eval $(call GluonProfile,TLWA701)) $(eval $(call GluonModel,TLWA701,tl-wa701n-v1,tp-link-tl-wa701n-nd-v1)) -ifeq ($(BROKEN),1) -$(eval $(call GluonModel,TLWA701,tl-wa701nd-v2,tp-link-tl-wa701n-nd-v2)) # BROKEN: untested -endif +$(eval $(call GluonModel,TLWA701,tl-wa701nd-v2,tp-link-tl-wa701n-nd-v2)) # TL-WR703N v1 $(eval $(call GluonProfile,TLWR703)) From 4e5b3354d2b845e47fe2c3a3662ce43a000b2270 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Litza Date: Mon, 3 Aug 2015 23:20:43 +0200 Subject: [PATCH 059/867] gluon-mesh-batman-adv-core: Only announce valid IPv6 addresses The nodeinfo/network/addresses announcement included deprecated and tentative addresses, which it clearly shouldn't as the host doesn't want to be contacted on those addresses. They are now filtered out. --- .../files/lib/gluon/announce/nodeinfo.d/network/addresses | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 index d55f8340..aa513b1c 100644 --- 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 @@ -1,10 +1,13 @@ 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', 4) .. '%s+([^%s]+)$') } - if matches[9] == 'br-client' then + 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 From d9df1186869662ccc2dc876cb263fd04589ad9b9 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Tue, 4 Aug 2015 22:51:40 +0200 Subject: [PATCH 060/867] gluon-wan-dnsmasq: fix usage of libpacketmark Using service_start requires exporting of environment variables. Fixes #397 --- package/gluon-wan-dnsmasq/files/etc/init.d/gluon-wan-dnsmasq | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package/gluon-wan-dnsmasq/files/etc/init.d/gluon-wan-dnsmasq b/package/gluon-wan-dnsmasq/files/etc/init.d/gluon-wan-dnsmasq index 22bed039..78799c9c 100755 --- a/package/gluon-wan-dnsmasq/files/etc/init.d/gluon-wan-dnsmasq +++ b/package/gluon-wan-dnsmasq/files/etc/init.d/gluon-wan-dnsmasq @@ -18,7 +18,10 @@ start() { mkdir -p $RESOLV_CONF_DIR /lib/gluon/wan-dnsmasq/update.lua - LD_PRELOAD=libpacketmark.so LIBPACKETMARK_MARK=$PACKET_MARK service_start /usr/sbin/dnsmasq -x $SERVICE_PID_FILE -u root -i lo -p $PORT -h -r $RESOLV_CONF + export LD_PRELOAD=libpacketmark.so + export LIBPACKETMARK_MARK=$PACKET_MARK + + service_start /usr/sbin/dnsmasq -x $SERVICE_PID_FILE -u root -i lo -p $PORT -h -r $RESOLV_CONF } stop() { From 2a93c580428d10724116b0d2d1238e2745715a14 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Sat, 25 Jul 2015 20:41:03 +0200 Subject: [PATCH 061/867] mesh-batadv-core: introduce 11s mesh, refactor wireless config This is a site.conf-breaking change in regard to the wireless config. Make sure to read http://gluon.readthedocs.org/en/latest/user/site.html and update your site.conf accordingly! Support for 802.11s mesh interfaces has been added. Gluon now supports three interface types: ap, ibss and mesh. All of them are now optional and may be configured independently in site.conf. A sample site.conf may look like this: wifi24 = { channel = 1, htmode = 'HT40+', ap = { ssid = 'luebeck.freifunk.net', }, ibss = { ssid = '02:d1:11:37:fc:38', bssid = '02:d1:11:37:fc:38', mcast_rate = 12000, }, mesh = { id = 'ffhl-mesh', mcast_rate = 12000, }, }, --- docs/site-example/site.conf | 38 ++-- docs/user/site.rst | 50 +++-- .../upgrade/350-gluon-mesh-batman-adv-14 | 26 ++- .../upgrade/350-gluon-mesh-batman-adv-15 | 26 ++- .../gluon-mesh-batman-adv-core/check_site.lua | 26 ++- .../320-gluon-mesh-batman-adv-core-wireless | 210 ++++++++++-------- 6 files changed, 230 insertions(+), 146 deletions(-) diff --git a/docs/site-example/site.conf b/docs/site-example/site.conf index 6cffded8..1580d901 100644 --- a/docs/site-example/site.conf +++ b/docs/site-example/site.conf @@ -35,9 +35,6 @@ -- Wireless channel. channel = 1, - -- ESSID used for client network. - ssid = 'entenhausen.freifunk.net', - -- Specifies the channel width in 802.11n and 802.11ac mode. -- Possible values are: -- HT20 (single 20MHz channel), @@ -45,32 +42,33 @@ -- HT40+ (2x 20MHz channels, secondary above) htmode = 'HT20', - -- Adjust these values! - mesh_ssid = 'xe:xx:xx:xx:xx:xx', -- ESSID used for mesh - mesh_bssid = 'xe:xx:xx:xx:xx:xx', -- BSSID used for mesh + -- ESSID used for client network. + ap = { + ssid = 'entenhausen.freifunk.net', + -- disabled = true, (optional) + }, - -- Bitrate used for multicast/broadcast packets. - mesh_mcast_rate = 12000, - - -- (optional) mesh VLAN on 802.11 ad-hoc interface (1-4095) - -- mesh_vlan = 14, - -- client_disabled = true, - -- mesh_disabled = false, + mesh = { + -- Adjust these values! + id = 'ffxx-mesh', + mcast_rate = 12000, + -- disabled = true, (optional) + }, }, -- Wireless configuration for 5 GHz interfaces. -- This should be equal to the 2.4 GHz variant, except -- for channel and htmode. wifi5 = { - ssid = 'entenhausen.freifunk.net', channel = 44, htmode = 'HT20', - mesh_ssid = 'xx:xx:xx:xx:xx:xx', - mesh_bssid = 'xx:xx:xx:xx:xx:xx', - mesh_mcast_rate = 12000, - -- mesh_vlan = 14, - -- client_disabled = true, - -- mesh_disabled = false, + ap = { + ssid = 'entenhausen.freifunk.net', + }, + mesh = { + id = 'ffxx-mesh', + mcast_rate = 12000, + }, }, -- The next node feature allows clients to always reach the node it is diff --git a/docs/user/site.rst b/docs/user/site.rst index 50d1c224..ff67a6a6 100644 --- a/docs/user/site.rst +++ b/docs/user/site.rst @@ -62,24 +62,46 @@ regdom regdom = 'DE' wifi24 - WLAN Configuration of your community in the 2.4Ghz radio. Consisting - of ``ssid`` of your client network, the ``channel`` your community is using, - ``htmode``, the adhoc ssid ``mesh_ssid`` used between devices, the adhoc - bssid ``mesh_bssid`` and the adhoc multicast rate ``mesh_mcast_rate``. - Optionally ``mesh_vlan`` can be used to setup VLAN on top of the 802.11 - ad-hoc interface. The options ``mesh_disabled`` and ``client_disabled`` - are optional, too. They allow to disable the SSID by default, e.g. for - preconfigured node. This only affects first configuraton. - Combined in an dictionary, e.g.: + WLAN configuration for 2.4 GHz devices. + ``channel`` must be set to a valid wireless channel for your radio. + ``htmode`` selects the desired htmode (e.g. HT20, HT40- or HT40+). + + There are currently three interface types available. You many choose to + configure any subset of them: + + - ``ap`` creates a master interface where clients may connect + - ``mesh`` creates an 802.11s mesh interface with forwarding disabled + - ``ibss`` creates an ad-hoc interface + + Each interface may be disabled by setting ``disabled`` to ``true``. + 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. + + ``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. :: wifi24 = { - ssid = 'entenhausen.freifunk.net', channel = 11, - htmode = 'HT40-', - mesh_ssid = 'ff:ff:ff:ee:ba:be', - mesh_bssid = 'ff:ff:ff:ee:ba:be', - mesh_mcast_rate = 12000, + htmode = 'HT20', + ap = { + ssid = 'entenhausen.freifunk.net', + }, + mesh = { + id = 'entenhausen-mesh', + mcast_rate = 12000, + }, + ibss = { + ssid = 'ff:ff:ff:ee:ba:be', + bssid = 'ff:ff:ff:ee:ba:be', + mcast_rate = 12000, + }, }, wifi5 diff --git a/package/gluon-mesh-batman-adv-14/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-14 b/package/gluon-mesh-batman-adv-14/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-14 index b3ed1e88..05776c30 100755 --- a/package/gluon-mesh-batman-adv-14/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-14 +++ b/package/gluon-mesh-batman-adv-14/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-14 @@ -5,14 +5,20 @@ local site = require 'gluon.site_config' local uci = require('luci.model.uci').cursor() -local function configure_mtu(radio, config) - local mesh = 'mesh_' .. radio +local function configure_mtu(radio, config, mtu) + if config.ibss then + local network = 'ibss_' .. radio - if config.mesh_vlan then - uci:set('network', mesh, 'mtu', 1532) - uci:set('network', mesh .. '_vlan', 'mtu', 1528) - else - uci:set('network', mesh, 'mtu', 1528) + if config.ibss.vlan then + uci:set('network', network, 'mtu', mtu + 4) + uci:set('network', network .. '_vlan', 'mtu', mtu) + else + uci:set('network', network, 'mtu', mtu) + end + end + + if config.mesh then + uci:set('network', 'mesh_' .. radio, 'mtu', mtu) end end @@ -25,13 +31,15 @@ uci:foreach('wireless', 'wifi-device', end ) +local mtu = 1528 + for _, radio in ipairs(radios) do local hwmode = uci:get('wireless', radio, 'hwmode') if hwmode == '11g' or hwmode == '11ng' then - configure_mtu(radio, site.wifi24) + configure_mtu(radio, site.wifi24, mtu) elseif hwmode == '11a' or hwmode == '11na' then - configure_mtu(radio, site.wifi5) + configure_mtu(radio, site.wifi5, mtu) end end diff --git a/package/gluon-mesh-batman-adv-15/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-15 b/package/gluon-mesh-batman-adv-15/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-15 index 96f7d310..f9f54003 100755 --- a/package/gluon-mesh-batman-adv-15/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-15 +++ b/package/gluon-mesh-batman-adv-15/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-15 @@ -5,14 +5,20 @@ local site = require 'gluon.site_config' local uci = require('luci.model.uci').cursor() -local function configure_mtu(radio, config) - local mesh = 'mesh_' .. radio +local function configure_mtu(radio, config, mtu) + if config.ibss then + local network = 'ibss_' .. radio - if config.mesh_vlan then - uci:set('network', mesh, 'mtu', 1536) - uci:set('network', mesh .. '_vlan', 'mtu', 1532) - else - uci:set('network', mesh, 'mtu', 1532) + if config.ibss.vlan then + uci:set('network', network, 'mtu', mtu + 4) + uci:set('network', network .. '_vlan', 'mtu', mtu) + else + uci:set('network', network, 'mtu', mtu) + end + end + + if config.mesh then + uci:set('network', 'mesh_' .. radio, 'mtu', mtu) end end @@ -25,13 +31,15 @@ uci:foreach('wireless', 'wifi-device', end ) +local mtu = 1532 + for _, radio in ipairs(radios) do local hwmode = uci:get('wireless', radio, 'hwmode') if hwmode == '11g' or hwmode == '11ng' then - configure_mtu(radio, site.wifi24) + configure_mtu(radio, site.wifi24, mtu) elseif hwmode == '11a' or hwmode == '11na' then - configure_mtu(radio, site.wifi5) + configure_mtu(radio, site.wifi5, mtu) end end diff --git a/package/gluon-mesh-batman-adv-core/check_site.lua b/package/gluon-mesh-batman-adv-core/check_site.lua index e76ca9e9..25ae9dff 100644 --- a/package/gluon-mesh-batman-adv-core/check_site.lua +++ b/package/gluon-mesh-batman-adv-core/check_site.lua @@ -1,15 +1,27 @@ need_string('regdom') for _, config in ipairs({'wifi24', 'wifi5'}) do - need_string(config .. '.ssid') need_number(config .. '.channel') need_string(config .. '.htmode') - need_string(config .. '.mesh_ssid') - need_string_match(config .. '.mesh_bssid', '^%x[02468aAcCeE]:%x%x:%x%x:%x%x:%x%x:%x%x$') - need_number(config .. '.mesh_mcast_rate') - need_number(config .. '.mesh_vlan', false) - need_boolean(config .. '.client_disabled', false) - need_boolean(config .. '.mesh_disabled', false) + + if need_table(config .. '.ap', nil, false) then + need_string(config .. '.ap.ssid') + need_boolean(config .. '.ap.disabled', false) + end + + if need_table(config .. '.ibss', nil, false) then + need_string(config .. '.ibss.ssid') + need_string_match(config .. '.ibss.bssid', '^%x[02468aAcCeE]:%x%x:%x%x:%x%x:%x%x:%x%x$') + need_number(config .. '.ibss.mcast_rate', false) + need_number(config .. '.ibss.vlan', false) + need_boolean(config .. '.ibss.disabled', false) + end + + if need_table(config .. '.mesh', nil, false) then + need_string(config .. '.mesh.id') + need_number(config .. '.mesh.mcast_rate', false) + need_boolean(config .. '.mesh.disabled', false) + end end need_boolean('mesh_on_wan', false) diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless index 50753c8b..cd9f885a 100755 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless +++ b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless @@ -6,110 +6,146 @@ local util = require 'gluon.util' local uci = require('luci.model.uci').cursor() +local function is_disabled(config, name) + local disabled = config and config.disabled + if uci:get('wireless', name) then + disabled = uci:get_bool('wireless', name, 'disabled') + end + + return disabled and 1 or 0 +end + +local function configure_client(config, radio, index, suffix) + local name = 'client_' .. radio + local disabled = is_disabled(config, name) + + uci:delete('wireless', name) + + if config then + uci:section('wireless', 'wifi-iface', name, + { + device = radio, + network = 'client', + mode = 'ap', + ssid = config.ssid, + macaddr = util.generate_mac(2, index), + ifname = suffix and 'client' .. suffix, + disabled = disabled, + } + ) + end +end + +local function configure_ibss(config, radio, index, suffix) + local name = 'ibss_' .. radio + local disabled = is_disabled(config, name) + + uci:delete('network', name) + uci:delete('network', name .. '_vlan') + uci:delete('wireless', name) + + if config then + if config.vlan then + uci:section('network', 'interface', name, + { + proto = 'none', + } + ) + + uci:section('network', 'interface', name .. '_vlan', + { + ifname = '@' .. name .. '.' .. config.vlan, + proto = 'batadv', + mesh = 'bat0', + } + ) + else + uci:section('network', 'interface', name, + { + proto = 'batadv', + mesh = 'bat0', + } + ) + end + + uci:section('wireless', 'wifi-iface', name, + { + device = radio, + network = name, + mode = 'adhoc', + ssid = config.ssid, + bssid = config.bssid, + macaddr = util.generate_mac(3, index), + mcast_rate = config.mcast_rate, + ifname = suffix and 'ibss' .. suffix, + disabled = disabled, + } + ) + end +end + +local function configure_mesh(config, radio, index, suffix) + local name = 'mesh_' .. radio + local disabled = is_disabled(config, name) + + uci:delete('network', name) + uci:delete('wireless', name) + + if config then + uci:section('network', 'interface', name, + { + proto = 'batadv', + mesh = 'bat0', + } + ) + + uci:section('wireless', 'wifi-iface', name, + { + device = radio, + network = name, + mode = 'mesh', + mesh_id = config.id, + mesh_fwding = 0, + macaddr = util.generate_mac(5, index), + mcast_rate = config.mcast_rate, + ifname = suffix and 'mesh' .. suffix, + disabled = disabled, + } + ) + end +end + local function configure_radio(radio, index, config) + local suffix = radio:match('^radio(%d+)$') + uci:delete('wireless', radio, 'disabled') uci:set('wireless', radio, 'channel', config.channel) uci:set('wireless', radio, 'htmode', config.htmode) uci:set('wireless', radio, 'country', site.regdom) - local client = 'client_' .. radio - local mesh = 'mesh_' .. radio - - local disable_state_client = false - local disable_state_mesh = false - - if uci:get('wireless', client) then - disable_state_client = uci:get_bool('wireless', client, "disabled") - elseif config.client_disabled then - disable_state_client = true - end - - if uci:get('wireless', mesh) then - disable_state_mesh = uci:get_bool('wireless', mesh, "disabled") - elseif config.mesh_disabled then - disable_state_mesh = true - end - - local client_ifname - local mesh_ifname - local radio_suffix = radio:match('^radio(%d+)$') - if radio_suffix then - client_ifname = 'client' .. radio_suffix - mesh_ifname = 'mesh' .. radio_suffix - end - - uci:delete('wireless', client) - uci:section('wireless', 'wifi-iface', client, - { - device = radio, - network = 'client', - mode = 'ap', - ssid = config.ssid, - macaddr = util.generate_mac(2, index), - ifname = client_ifname, - disabled = disable_state_client and 1 or 0, - } - ) - - uci:delete('network', mesh) - uci:delete('network', mesh .. '_vlan') - - if config.mesh_vlan then - uci:section('network', 'interface', mesh, - { - proto = 'none', - } - ) - uci:section('network', 'interface', mesh .. '_vlan', - { - ifname = '@' .. mesh .. '.' .. config.mesh_vlan, - proto = 'batadv', - mesh = 'bat0', - } - ) - else - uci:section('network', 'interface', mesh, - { - proto = 'batadv', - mesh = 'bat0', - } - ) - end - - uci:delete('wireless', mesh) - uci:section('wireless', 'wifi-iface', mesh, - { - device = radio, - network = mesh, - mode = 'adhoc', - ssid = config.mesh_ssid, - bssid = config.mesh_bssid, - macaddr = util.generate_mac(3, index), - mcast_rate = config.mesh_mcast_rate, - ifname = mesh_ifname, - disabled = disable_state_mesh and 1 or 0, - } - ) + configure_client(config.ap, radio, index, suffix) + configure_ibss(config.ibss, radio, index, suffix) + configure_mesh(config.mesh, radio, index, suffix) end local radios = {} uci:foreach('wireless', 'wifi-device', - function(s) - table.insert(radios, s['.name']) - end + function(s) + table.insert(radios, s['.name']) + end ) for index, radio in ipairs(radios) do - local hwmode = uci:get('wireless', radio, 'hwmode') + local hwmode = uci:get('wireless', radio, 'hwmode') - if hwmode == '11g' or hwmode == '11ng' then - configure_radio(radio, index, site.wifi24) - elseif hwmode == '11a' or hwmode == '11na' then - configure_radio(radio, index, site.wifi5) - end + if hwmode == '11g' or hwmode == '11ng' then + configure_radio(radio, index, site.wifi24) + elseif hwmode == '11a' or hwmode == '11na' then + configure_radio(radio, index, site.wifi5) + end end From 8ccb173992d738c410404107e31330401701dd07 Mon Sep 17 00:00:00 2001 From: Kokel Date: Thu, 6 Aug 2015 16:21:40 +0200 Subject: [PATCH 062/867] Add support for TP-Link TL-WR710N v2 Tested-by: @kokel --- targets/ar71xx-generic/profiles.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index a67fdeb5..c8329b9f 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -18,9 +18,10 @@ $(eval $(call GluonModel,TLWA701,tl-wa701nd-v2,tp-link-tl-wa701n-nd-v2)) $(eval $(call GluonProfile,TLWR703)) $(eval $(call GluonModel,TLWR703,tl-wr703n-v1,tp-link-tl-wr703n-v1)) -# TL-WR710N v1 +# TL-WR710N v1, v2 $(eval $(call GluonProfile,TLWR710)) $(eval $(call GluonModel,TLWR710,tl-wr710n-v1,tp-link-tl-wr710n-v1)) +$(eval $(call GluonModel,TLWR710,tl-wr710n-v2,tp-link-tl-wr710n-v2)) # TL-WR740N v1, v3, v4, v5 $(eval $(call GluonProfile,TLWR740)) From 912ab30d3a95bd244e9205d09fb04049bb020e33 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 6 Aug 2015 03:10:53 +0200 Subject: [PATCH 063/867] Update OpenWrt base --- modules | 2 +- ...le-fix-host-tools-build-dependencies.patch | 2 +- ...ity-firmware-as-an-additional-choice.patch | 20 ++++++++++++++++--- ...d-support-for-tp-link-wr740n-v5.0-EU.patch | 6 +++--- ...ar71xx-add-support-for-TL-WR741ND-v5.patch | 6 +++--- ...d_detect-for-some-NETGEAR-WNDR3700v2.patch | 2 +- 6 files changed, 26 insertions(+), 12 deletions(-) diff --git a/modules b/modules index b67364b7..dea7a051 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=12a75ad198a96ec39e98fa1fdd3740aa1316a255 +OPENWRT_COMMIT=48e7befbddb933d6cb046ec074470bbccdb060da PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git PACKAGES_OPENWRT_COMMIT=bc424ae8577ec10808cc5645eea700ebddf5183f diff --git a/patches/openwrt/0001-tools-Makefile-fix-host-tools-build-dependencies.patch b/patches/openwrt/0001-tools-Makefile-fix-host-tools-build-dependencies.patch index e400f28b..0db0eda7 100644 --- a/patches/openwrt/0001-tools-Makefile-fix-host-tools-build-dependencies.patch +++ b/patches/openwrt/0001-tools-Makefile-fix-host-tools-build-dependencies.patch @@ -3,7 +3,7 @@ Date: Sat, 26 Jul 2014 06:10:23 +0200 Subject: tools/Makefile: fix host tools build dependencies diff --git a/tools/Makefile b/tools/Makefile -index 2f516d2..9416069 100644 +index d2fe2ff..c6cded8 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -95,10 +95,16 @@ define PrepareStaging diff --git a/patches/openwrt/0005-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch b/patches/openwrt/0005-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch index a7ea2438..fffb01f1 100644 --- a/patches/openwrt/0005-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch +++ b/patches/openwrt/0005-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch @@ -3,7 +3,7 @@ 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 2af5d39..5b85971 100644 +index 1f15b40..c9cd289 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -604,6 +604,14 @@ This module adds support for wireless adapters based on @@ -21,7 +21,7 @@ index 2af5d39..5b85971 100644 define KernelPackage/ath10k $(call KernelPackage/mac80211/Default) TITLE:=Atheros 802.11ac wireless cards support -@@ -624,13 +632,31 @@ endef +@@ -624,21 +632,37 @@ endef define KernelPackage/ath10k/config if PACKAGE_kmod-ath10k @@ -51,11 +51,19 @@ index 2af5d39..5b85971 100644 + Supports both AP and IBSS (ad-hoc) mode. Doesn't support + encryption when using multiple VIFs. + config ATH10K_API2_FW + bool "Firmware optimized for AP operation (v10.1 / API v2)" +- default n +- depends on !ATH10K_STA_FW + help + Use the ath10k firmware from the 10.1 SDK using API v2 optimized + for access point operation if the default firmware keeps crashing. + + endchoice endif endef -@@ -1858,14 +1884,20 @@ define KernelPackage/ath10k/install +@@ -1866,18 +1890,25 @@ define KernelPackage/ath10k/install $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/ath10k/QCA988X/hw2.0/board.bin \ $(1)/lib/firmware/ath10k/QCA988X/hw2.0/ @@ -68,6 +76,12 @@ index 2af5d39..5b85971 100644 $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/main/firmware-2.bin_999.999.0.636 \ $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin +-else ifeq ($(CONFIG_ATH10K_API2_FW),y) ++endif ++ifeq ($(CONFIG_ATH10K_API2_FW),y) + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.1/firmware-2.bin_10.1.467.2-1 \ + $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin -else +endif +ifeq ($(CONFIG_ATH10K_CT_COMMUNITY_FW),y) 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 017ec234..98ff7264 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,10 +10,10 @@ 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 a2a66b8..3cab3bd 100644 +index 3c77465..8fc9f4c 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile -@@ -459,6 +459,14 @@ define Device/tl-wr740n-v4 +@@ -476,6 +476,14 @@ define Device/tl-wr740n-v4 CONSOLE := ttyATH0,115200 endef @@ -28,7 +28,7 @@ index a2a66b8..3cab3bd 100644 define Device/tl-wr741nd-v1 $(Device/tplink-4m) BOARDNAME := TL-WR741ND -@@ -488,7 +496,7 @@ define Device/tl-wr743nd-v2 +@@ -505,7 +513,7 @@ define Device/tl-wr743nd-v2 TPLINK_HWID := 0x07430002 CONSOLE := ttyATH0,115200 endef 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 3ff0eab6..a334ec57 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,10 +6,10 @@ 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 3cab3bd..8a2b964 100644 +index 8fc9f4c..b45f9b2 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile -@@ -489,6 +489,14 @@ define Device/tl-wr741nd-v4 +@@ -506,6 +506,14 @@ define Device/tl-wr741nd-v4 CONSOLE := ttyATH0,115200 endef @@ -24,7 +24,7 @@ index 3cab3bd..8a2b964 100644 define Device/tl-wr743nd-v2 $(Device/tplink-4mlzma) BOARDNAME := TL-WR741ND-v4 -@@ -496,7 +504,7 @@ define Device/tl-wr743nd-v2 +@@ -513,7 +521,7 @@ define Device/tl-wr743nd-v2 TPLINK_HWID := 0x07430002 CONSOLE := ttyATH0,115200 endef 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 index 651045b4..704b0c78 100644 --- 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 @@ -12,7 +12,7 @@ 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 8f4bb40..392f498 100755 +index 4c10ab2..5617aa6 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() { From be9182d3777ed9415f7268abb7b350f630760f49 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 6 Aug 2015 19:24:37 +0200 Subject: [PATCH 064/867] Backport some QCA953x fixes This might improve stability on the TL-WR841 v9. --- ...P-Link-TL-WR841N-ND-v9-Compex-WPJ531.patch | 57 ++ ...ar71xx-rework-patch-for-qca953x-956x.patch | 966 ++++++++++++++++++ 2 files changed, 1023 insertions(+) create mode 100644 patches/openwrt/0018-ar71xx-fix-ethernet-initialization-on-QCA953x-based-boards-TP-Link-TL-WR841N-ND-v9-Compex-WPJ531.patch create mode 100644 patches/openwrt/0019-ar71xx-rework-patch-for-qca953x-956x.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/0018-ar71xx-fix-ethernet-initialization-on-QCA953x-based-boards-TP-Link-TL-WR841N-ND-v9-Compex-WPJ531.patch new file mode 100644 index 00000000..f4413db2 --- /dev/null +++ b/patches/openwrt/0018-ar71xx-fix-ethernet-initialization-on-QCA953x-based-boards-TP-Link-TL-WR841N-ND-v9-Compex-WPJ531.patch @@ -0,0 +1,57 @@ +From: Matthias Schiffer +Date: Thu, 6 Aug 2015 03:01:38 +0200 +Subject: ar71xx: fix ethernet initialization on QCA953x-based boards (TP-Link TL-WR841N/ND v9, Compex WPJ531) + +The initialization routines for these boards were relying on some (wrong) +defaults for the QCA953x ethernet. Make these defaults explicit to prevent +breaking them when the QCA953x defaults are fixed. + +Signed-off-by: Matthias Schiffer + +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v9.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v9.c +index c28afc6..3e5c2a2 100644 +--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v9.c ++++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v9.c +@@ -109,12 +109,18 @@ static void __init tl_ap143_setup(void) + ath79_register_mdio(0, 0x0); + + /* LAN */ ++ ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; ++ ath79_eth1_data.duplex = DUPLEX_FULL; ++ ath79_switch_data.phy_poll_mask |= BIT(4); + ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0); + ath79_register_eth(1); + + /* WAN */ + ath79_switch_data.phy4_mii_en = 1; + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; ++ ath79_eth0_data.duplex = DUPLEX_FULL; ++ ath79_eth0_data.speed = SPEED_100; ++ ath79_eth0_data.phy_mask = BIT(4); + ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1); + ath79_register_eth(0); + +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c +index bc13d70..e665a2e 100644 +--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c ++++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c +@@ -105,12 +105,19 @@ static void __init common_setup(void) + ath79_register_mdio(0, 0x0); + + /* LAN */ ++ ath79_eth0_data.duplex = DUPLEX_FULL; ++ ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; ++ ath79_eth0_data.speed = SPEED_100; ++ ath79_eth0_data.phy_mask = BIT(4); + ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0); + ath79_register_eth(0); + + /* WAN */ + ath79_switch_data.phy4_mii_en = 1; ++ ath79_eth1_data.duplex = DUPLEX_FULL; + ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_MII; ++ ath79_eth1_data.speed = SPEED_100; ++ ath79_switch_data.phy_poll_mask |= BIT(4); + ath79_init_mac(ath79_eth1_data.mac_addr, mac, 1); + ath79_register_eth(1); + diff --git a/patches/openwrt/0019-ar71xx-rework-patch-for-qca953x-956x.patch b/patches/openwrt/0019-ar71xx-rework-patch-for-qca953x-956x.patch new file mode 100644 index 00000000..9fbfe838 --- /dev/null +++ b/patches/openwrt/0019-ar71xx-rework-patch-for-qca953x-956x.patch @@ -0,0 +1,966 @@ +From: Matthias Schiffer +Date: Thu, 6 Aug 2015 03:01:47 +0200 +Subject: ar71xx: rework patch for qca953x/956x + +Patch cherry-picked from the following location: +https://www.codeaurora.org/cgit/quic/qsdk/oss/system/openwrt/commit/?h=release/coconut_ioe4531_2.0&id=5c357bf6c763e4140dddcc9a3bc5f005525a9c0e + +Changelist, + - add more register defines + - add EHCI support + - fix GPIO pin count to 18 + - fix chained irq disabled + - fix GMAC0/GMAC1 initial + - fix WMAC irq number to 47 + - merge the changes of dev-eth.c from the patch to file. + +Signed-off-by: Miaoqing Pan +Signed-off-by: Matthias Schiffer + +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c +index ae3db4c..ff94e2e 100644 +--- a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c ++++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c +@@ -198,6 +198,8 @@ void __init ath79_register_mdio(unsigned int id, u32 phy_mask) + case ATH79_SOC_AR9330: + case ATH79_SOC_AR9331: + case ATH79_SOC_QCA9533: ++ case ATH79_SOC_QCA9561: ++ case ATH79_SOC_TP9343: + mdio_dev = &ath79_mdio1_device; + mdio_data = &ath79_mdio1_data; + break; +@@ -256,6 +258,8 @@ void __init ath79_register_mdio(unsigned int id, u32 phy_mask) + break; + + case ATH79_SOC_QCA9533: ++ case ATH79_SOC_QCA9561: ++ case ATH79_SOC_TP9343: + mdio_data->builtin_switch = 1; + break; + +@@ -571,6 +575,8 @@ static void __init ath79_init_eth_pll_data(unsigned int id) + case ATH79_SOC_QCA9533: + case ATH79_SOC_QCA9556: + case ATH79_SOC_QCA9558: ++ case ATH79_SOC_QCA9561: ++ case ATH79_SOC_TP9343: + pll_10 = AR934X_PLL_VAL_10; + pll_100 = AR934X_PLL_VAL_100; + pll_1000 = AR934X_PLL_VAL_1000; +@@ -627,6 +633,8 @@ static int __init ath79_setup_phy_if_mode(unsigned int id, + case ATH79_SOC_AR9330: + case ATH79_SOC_AR9331: + case ATH79_SOC_QCA9533: ++ case ATH79_SOC_QCA9561: ++ case ATH79_SOC_TP9343: + pdata->phy_if_mode = PHY_INTERFACE_MODE_MII; + break; + +@@ -687,7 +695,8 @@ static int __init ath79_setup_phy_if_mode(unsigned int id, + case ATH79_SOC_AR7241: + case ATH79_SOC_AR9330: + case ATH79_SOC_AR9331: +- case ATH79_SOC_QCA9533: ++ case ATH79_SOC_QCA9561: ++ case ATH79_SOC_TP9343: + pdata->phy_if_mode = PHY_INTERFACE_MODE_GMII; + break; + +@@ -697,6 +706,7 @@ static int __init ath79_setup_phy_if_mode(unsigned int id, + case ATH79_SOC_AR9341: + case ATH79_SOC_AR9342: + case ATH79_SOC_AR9344: ++ case ATH79_SOC_QCA9533: + switch (pdata->phy_if_mode) { + case PHY_INTERFACE_MODE_MII: + case PHY_INTERFACE_MODE_GMII: +@@ -986,6 +996,7 @@ void __init ath79_register_eth(unsigned int id) + case ATH79_SOC_AR9341: + case ATH79_SOC_AR9342: + case ATH79_SOC_AR9344: ++ case ATH79_SOC_QCA9533: + if (id == 0) { + pdata->reset_bit = AR934X_RESET_GE0_MAC | + AR934X_RESET_GE0_MDIO; +@@ -1017,7 +1028,8 @@ void __init ath79_register_eth(unsigned int id) + pdata->fifo_cfg3 = 0x01f00140; + break; + +- case ATH79_SOC_QCA9533: ++ case ATH79_SOC_QCA9561: ++ case ATH79_SOC_TP9343: + if (id == 0) { + pdata->reset_bit = AR933X_RESET_GE0_MAC | + AR933X_RESET_GE0_MDIO; +@@ -1123,6 +1135,8 @@ void __init ath79_register_eth(unsigned int id) + case ATH79_SOC_AR9330: + case ATH79_SOC_AR9331: + case ATH79_SOC_QCA9533: ++ case ATH79_SOC_QCA9561: ++ case ATH79_SOC_TP9343: + pdata->mii_bus_dev = &ath79_mdio1_device.dev; + 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 a24d496..2b35f27 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) ++ &ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2)); ++ } ++ +++static void __init qca953x_usb_setup(void) +++{ +++ u32 bootstrap; +++ +++ bootstrap = ath79_reset_rr(QCA953X_RESET_REG_BOOTSTRAP); +++ +++ ath79_device_reset_set(QCA953X_RESET_USBSUS_OVERRIDE); +++ udelay(1000); +++ +++ ath79_device_reset_clear(QCA953X_RESET_USB_PHY); +++ udelay(1000); +++ +++ ath79_device_reset_clear(QCA953X_RESET_USB_PHY_ANALOG); +++ udelay(1000); +++ +++ ath79_device_reset_clear(QCA953X_RESET_USB_HOST); +++ udelay(1000); +++ +++ ath79_usb_register("ehci-platform", -1, +++ QCA953X_EHCI_BASE, QCA953X_EHCI_SIZE, +++ ATH79_CPU_IRQ(3), +++ &ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2)); +++} +++ ++ static void qca955x_usb_reset_notifier(struct platform_device *pdev) ++ { ++ u32 base; ++@@ -286,6 +310,8 @@ void __init ath79_register_usb(void) ++ ar933x_usb_setup(); ++ else if (soc_is_ar934x()) ++ ar934x_usb_setup(); +++ else if (soc_is_qca953x()) +++ qca953x_usb_setup(); ++ else if (soc_is_qca955x()) ++ qca955x_usb_setup(); ++ else + --- 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; + + ath79_wmac_resources[0].end = QCA953X_WMAC_BASE + QCA953X_WMAC_SIZE - 1; +-+ ath79_wmac_resources[1].start = ATH79_CPU_IRQ(2); +-+ ath79_wmac_resources[1].end = ATH79_CPU_IRQ(2); +++ ath79_wmac_resources[1].start = ATH79_IP2_IRQ(1); +++ ath79_wmac_resources[1].end = ATH79_IP2_IRQ(1); + + + + 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) ++ soc_is_ar913x() || ++ soc_is_ar933x()) ++ reg = AR71XX_GPIO_REG_FUNC; ++- else if (soc_is_ar934x()) +++ else if (soc_is_ar934x() || soc_is_qca953x()) ++ reg = AR934X_GPIO_REG_FUNC; ++ else ++ BUG(); ++@@ -187,7 +187,7 @@ void __init ath79_gpio_output_select(unsigned gpio, u8 val) ++ unsigned int reg; ++ u32 t, s; ++ ++- BUG_ON(!soc_is_ar934x()); +++ BUG_ON(!soc_is_ar934x() && !soc_is_qca953x()); ++ ++ if (gpio >= AR934X_GPIO_COUNT) ++ return; + @@ -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. + soc_is_qca955x()) + ath79_misc_irq_chip.irq_ack = ar724x_misc_irq_ack; + else +-@@ -352,6 +353,9 @@ void __init arch_init_irq(void) ++@@ -153,6 +154,38 @@ static void ar934x_ip2_irq_init(void) ++ irq_set_chained_handler(ATH79_CPU_IRQ(2), ar934x_ip2_irq_dispatch); ++ } ++ +++static void qca953x_ip2_irq_dispatch(unsigned int irq, struct irq_desc *desc) +++{ +++ u32 status; +++ +++ disable_irq_nosync(irq); +++ +++ status = ath79_reset_rr(QCA953X_RESET_REG_PCIE_WMAC_INT_STATUS); +++ +++ if (status & QCA953X_PCIE_WMAC_INT_PCIE_ALL) { +++ ath79_ddr_wb_flush(QCA953X_DDR_REG_FLUSH_PCIE); +++ generic_handle_irq(ATH79_IP2_IRQ(0)); +++ } else if (status & QCA953X_PCIE_WMAC_INT_WMAC_ALL) { +++ ath79_ddr_wb_flush(QCA953X_DDR_REG_FLUSH_WMAC); +++ generic_handle_irq(ATH79_IP2_IRQ(1)); +++ } else { +++ spurious_interrupt(); +++ } +++ +++ enable_irq(irq); +++} +++ +++static void qca953x_irq_init(void) +++{ +++ int i; +++ +++ for (i = ATH79_IP2_IRQ_BASE; +++ i < ATH79_IP2_IRQ_BASE + ATH79_IP2_IRQ_COUNT; i++) +++ irq_set_chip_and_handler(i, &dummy_irq_chip, handle_level_irq); +++ +++ irq_set_chained_handler(ATH79_CPU_IRQ(2), qca953x_ip2_irq_dispatch); +++} +++ ++ static void qca955x_ip2_irq_dispatch(unsigned int irq, struct irq_desc *desc) ++ { ++ u32 status; ++@@ -335,6 +368,12 @@ static void ar934x_ip3_handler(void) ++ do_IRQ(ATH79_CPU_IRQ(3)); ++ } ++ +++static void qca953x_ip3_handler(void) +++{ +++ ath79_ddr_wb_flush(QCA953X_DDR_REG_FLUSH_USB); +++ do_IRQ(ATH79_CPU_IRQ(3)); +++} +++ ++ void __init arch_init_irq(void) ++ { ++ if (soc_is_ar71xx()) { ++@@ -352,6 +391,9 @@ void __init arch_init_irq(void) + } else if (soc_is_ar934x()) { + ath79_ip2_handler = ath79_default_ip2_handler; + ath79_ip3_handler = ar934x_ip3_handler; + + } else if (soc_is_qca953x()) { + + ath79_ip2_handler = ath79_default_ip2_handler; +-+ ath79_ip3_handler = ath79_default_ip3_handler; +++ ath79_ip3_handler = qca953x_ip3_handler; + } else if (soc_is_qca955x()) { + ath79_ip2_handler = ath79_default_ip2_handler; + ath79_ip3_handler = ath79_default_ip3_handler; ++@@ -365,6 +407,8 @@ void __init arch_init_irq(void) ++ ++ if (soc_is_ar934x()) ++ ar934x_ip2_irq_init(); +++ else if (soc_is_qca953x()) +++ qca953x_irq_init(); ++ else if (soc_is_qca955x()) ++ qca955x_irq_init(); ++ } + --- 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); + --- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h + +++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h +-@@ -105,6 +105,9 @@ ++@@ -105,6 +105,21 @@ + #define AR934X_SRIF_BASE (AR71XX_APB_BASE + 0x00116000) + #define AR934X_SRIF_SIZE 0x1000 + +++#define QCA953X_GMAC_BASE (AR71XX_APB_BASE + 0x00070000) +++#define QCA953X_GMAC_SIZE 0x14 + +#define QCA953X_WMAC_BASE (AR71XX_APB_BASE + 0x00100000) + +#define QCA953X_WMAC_SIZE 0x20000 +++#define QCA953X_EHCI_BASE 0x1b000000 +++#define QCA953X_EHCI_SIZE 0x200 +++#define QCA953X_SRIF_BASE (AR71XX_APB_BASE + 0x00116000) +++#define QCA953X_SRIF_SIZE 0x1000 +++ +++#define QCA953X_PCI_CFG_BASE0 0x14000000 +++#define QCA953X_PCI_CTRL_BASE0 (AR71XX_APB_BASE + 0x000f0000) +++#define QCA953X_PCI_CRP_BASE0 (AR71XX_APB_BASE + 0x000c0000) +++#define QCA953X_PCI_MEM_BASE0 0x10000000 +++#define QCA953X_PCI_MEM_SIZE 0x02000000 + + + #define QCA955X_PCI_MEM_BASE0 0x10000000 + #define QCA955X_PCI_MEM_BASE1 0x12000000 + #define QCA955X_PCI_MEM_SIZE 0x02000000 +-@@ -279,6 +282,43 @@ ++@@ -173,6 +188,12 @@ ++ #define AR934X_DDR_REG_FLUSH_PCIE 0xa8 ++ #define AR934X_DDR_REG_FLUSH_WMAC 0xac ++ +++#define QCA953X_DDR_REG_FLUSH_GE0 0x9c +++#define QCA953X_DDR_REG_FLUSH_GE1 0xa0 +++#define QCA953X_DDR_REG_FLUSH_USB 0xa4 +++#define QCA953X_DDR_REG_FLUSH_PCIE 0xa8 +++#define QCA953X_DDR_REG_FLUSH_WMAC 0xac +++ ++ /* ++ * PLL block ++ */ ++@@ -279,6 +300,44 @@ + + #define AR934X_PLL_SWITCH_CLOCK_CONTROL_MDIO_CLK_SEL BIT(6) + + +#define QCA953X_PLL_CPU_CONFIG_REG 0x00 + +#define QCA953X_PLL_DDR_CONFIG_REG 0x04 + +#define QCA953X_PLL_CLK_CTRL_REG 0x08 +++#define QCA953X_PLL_SWITCH_CLOCK_CONTROL_REG 0x24 + +#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. + +#define QCA953X_PLL_CPU_CONFIG_REFDIV_SHIFT 12 + +#define QCA953X_PLL_CPU_CONFIG_REFDIV_MASK 0x1f + +#define QCA953X_PLL_CPU_CONFIG_OUTDIV_SHIFT 19 +-+#define QCA953X_PLL_CPU_CONFIG_OUTDIV_MASK 0x3 +++#define QCA953X_PLL_CPU_CONFIG_OUTDIV_MASK 0x7 + + + +#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. + #define QCA955X_PLL_CPU_CONFIG_REG 0x00 + #define QCA955X_PLL_DDR_CONFIG_REG 0x04 + #define QCA955X_PLL_CLK_CTRL_REG 0x08 +-@@ -355,6 +395,10 @@ ++@@ -355,6 +414,10 @@ + #define AR934X_RESET_REG_BOOTSTRAP 0xb0 + #define AR934X_RESET_REG_PCIE_WMAC_INT_STATUS 0xac + + +#define QCA953X_RESET_REG_RESET_MODULE 0x1c + +#define QCA953X_RESET_REG_BOOTSTRAP 0xb0 +-+#define QCA953X_RESET_REG_EXT_INT_STATUS 0xac +++#define QCA953X_RESET_REG_PCIE_WMAC_INT_STATUS 0xac + + + #define QCA955X_RESET_REG_RESET_MODULE 0x1c + #define QCA955X_RESET_REG_BOOTSTRAP 0xb0 + #define QCA955X_RESET_REG_EXT_INT_STATUS 0xac +-@@ -503,6 +547,8 @@ ++@@ -450,6 +513,27 @@ ++ #define AR934X_RESET_MBOX BIT(1) ++ #define AR934X_RESET_I2S BIT(0) ++ +++#define QCA953X_RESET_USB_EXT_PWR BIT(29) +++#define QCA953X_RESET_EXTERNAL BIT(28) +++#define QCA953X_RESET_RTC BIT(27) +++#define QCA953X_RESET_FULL_CHIP BIT(24) +++#define QCA953X_RESET_GE1_MDIO BIT(23) +++#define QCA953X_RESET_GE0_MDIO BIT(22) +++#define QCA953X_RESET_CPU_NMI BIT(21) +++#define QCA953X_RESET_CPU_COLD BIT(20) +++#define QCA953X_RESET_DDR BIT(16) +++#define QCA953X_RESET_USB_PHY_PLL_PWD_EXT BIT(15) +++#define QCA953X_RESET_GE1_MAC BIT(13) +++#define QCA953X_RESET_ETH_SWITCH_ANALOG BIT(12) +++#define QCA953X_RESET_USB_PHY_ANALOG BIT(11) +++#define QCA953X_RESET_GE0_MAC BIT(9) +++#define QCA953X_RESET_ETH_SWITCH BIT(8) +++#define QCA953X_RESET_PCIE_PHY BIT(7) +++#define QCA953X_RESET_PCIE BIT(6) +++#define QCA953X_RESET_USB_HOST BIT(5) +++#define QCA953X_RESET_USB_PHY BIT(4) +++#define QCA953X_RESET_USBSUS_OVERRIDE BIT(3) +++ ++ #define QCA955X_RESET_HOST BIT(31) ++ #define QCA955X_RESET_SLIC BIT(30) ++ #define QCA955X_RESET_HDMA BIT(29) ++@@ -503,6 +587,13 @@ + #define AR934X_BOOTSTRAP_SDRAM_DISABLED BIT(1) + #define AR934X_BOOTSTRAP_DDR1 BIT(0) + +++#define QCA953X_BOOTSTRAP_SW_OPTION2 BIT(12) +++#define QCA953X_BOOTSTRAP_SW_OPTION1 BIT(11) +++#define QCA953X_BOOTSTRAP_EJTAG_MODE BIT(5) + +#define QCA953X_BOOTSTRAP_REF_CLK_40 BIT(4) +++#define QCA953X_BOOTSTRAP_SDRAM_DISABLED BIT(1) +++#define QCA953X_BOOTSTRAP_DDR1 BIT(0) + + + #define QCA955X_BOOTSTRAP_REF_CLK_40 BIT(4) + + #define AR934X_PCIE_WMAC_INT_WMAC_MISC BIT(0) +-@@ -565,6 +611,8 @@ ++@@ -523,6 +614,24 @@ ++ AR934X_PCIE_WMAC_INT_PCIE_RC1 | AR934X_PCIE_WMAC_INT_PCIE_RC2 | \ ++ AR934X_PCIE_WMAC_INT_PCIE_RC3) ++ +++#define QCA953X_PCIE_WMAC_INT_WMAC_MISC BIT(0) +++#define QCA953X_PCIE_WMAC_INT_WMAC_TX BIT(1) +++#define QCA953X_PCIE_WMAC_INT_WMAC_RXLP BIT(2) +++#define QCA953X_PCIE_WMAC_INT_WMAC_RXHP BIT(3) +++#define QCA953X_PCIE_WMAC_INT_PCIE_RC BIT(4) +++#define QCA953X_PCIE_WMAC_INT_PCIE_RC0 BIT(5) +++#define QCA953X_PCIE_WMAC_INT_PCIE_RC1 BIT(6) +++#define QCA953X_PCIE_WMAC_INT_PCIE_RC2 BIT(7) +++#define QCA953X_PCIE_WMAC_INT_PCIE_RC3 BIT(8) +++#define QCA953X_PCIE_WMAC_INT_WMAC_ALL \ +++ (QCA953X_PCIE_WMAC_INT_WMAC_MISC | QCA953X_PCIE_WMAC_INT_WMAC_TX | \ +++ QCA953X_PCIE_WMAC_INT_WMAC_RXLP | QCA953X_PCIE_WMAC_INT_WMAC_RXHP) +++ +++#define QCA953X_PCIE_WMAC_INT_PCIE_ALL \ +++ (QCA953X_PCIE_WMAC_INT_PCIE_RC | QCA953X_PCIE_WMAC_INT_PCIE_RC0 | \ +++ QCA953X_PCIE_WMAC_INT_PCIE_RC1 | QCA953X_PCIE_WMAC_INT_PCIE_RC2 | \ +++ QCA953X_PCIE_WMAC_INT_PCIE_RC3) +++ ++ #define QCA955X_EXT_INT_WMAC_MISC BIT(0) ++ #define QCA955X_EXT_INT_WMAC_TX BIT(1) ++ #define QCA955X_EXT_INT_WMAC_RXLP BIT(2) ++@@ -565,6 +674,8 @@ + #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. + #define REV_ID_MAJOR_QCA9556 0x0130 + #define REV_ID_MAJOR_QCA9558 0x1130 + +-@@ -587,6 +635,8 @@ ++@@ -587,6 +698,8 @@ + + #define AR934X_REV_ID_REVISION_MASK 0xf + +@@ -416,14 +617,81 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. + #define QCA955X_REV_ID_REVISION_MASK 0xf + + /* +-@@ -640,6 +690,7 @@ ++@@ -634,12 +747,32 @@ ++ #define AR934X_GPIO_REG_OUT_FUNC5 0x40 ++ #define AR934X_GPIO_REG_FUNC 0x6c ++ +++#define QCA953X_GPIO_REG_OUT_FUNC0 0x2c +++#define QCA953X_GPIO_REG_OUT_FUNC1 0x30 +++#define QCA953X_GPIO_REG_OUT_FUNC2 0x34 +++#define QCA953X_GPIO_REG_OUT_FUNC3 0x38 +++#define QCA953X_GPIO_REG_OUT_FUNC4 0x3c +++#define QCA953X_GPIO_REG_IN_ENABLE0 0x44 +++#define QCA953X_GPIO_REG_FUNC 0x6c +++ +++#define QCA953X_GPIO_OUT_MUX_SPI_CS1 10 +++#define QCA953X_GPIO_OUT_MUX_SPI_CS2 11 +++#define QCA953X_GPIO_OUT_MUX_SPI_CS0 9 +++#define QCA953X_GPIO_OUT_MUX_SPI_CLK 8 +++#define QCA953X_GPIO_OUT_MUX_SPI_MOSI 12 +++#define QCA953X_GPIO_OUT_MUX_LED_LINK1 41 +++#define QCA953X_GPIO_OUT_MUX_LED_LINK2 42 +++#define QCA953X_GPIO_OUT_MUX_LED_LINK3 43 +++#define QCA953X_GPIO_OUT_MUX_LED_LINK4 44 +++#define QCA953X_GPIO_OUT_MUX_LED_LINK5 45 +++ ++ #define AR71XX_GPIO_COUNT 16 ++ #define AR7240_GPIO_COUNT 18 ++ #define AR7241_GPIO_COUNT 20 + #define AR913X_GPIO_COUNT 22 + #define AR933X_GPIO_COUNT 30 + #define AR934X_GPIO_COUNT 23 +-+#define QCA953X_GPIO_COUNT 24 +++#define QCA953X_GPIO_COUNT 18 + #define QCA955X_GPIO_COUNT 24 + + /* ++@@ -663,6 +796,24 @@ ++ #define AR934X_SRIF_DPLL2_OUTDIV_SHIFT 13 ++ #define AR934X_SRIF_DPLL2_OUTDIV_MASK 0x7 ++ +++#define QCA953X_SRIF_CPU_DPLL1_REG 0x1c0 +++#define QCA953X_SRIF_CPU_DPLL2_REG 0x1c4 +++#define QCA953X_SRIF_CPU_DPLL3_REG 0x1c8 +++ +++#define QCA953X_SRIF_DDR_DPLL1_REG 0x240 +++#define QCA953X_SRIF_DDR_DPLL2_REG 0x244 +++#define QCA953X_SRIF_DDR_DPLL3_REG 0x248 +++ +++#define QCA953X_SRIF_DPLL1_REFDIV_SHIFT 27 +++#define QCA953X_SRIF_DPLL1_REFDIV_MASK 0x1f +++#define QCA953X_SRIF_DPLL1_NINT_SHIFT 18 +++#define QCA953X_SRIF_DPLL1_NINT_MASK 0x1ff +++#define QCA953X_SRIF_DPLL1_NFRAC_MASK 0x0003ffff +++ +++#define QCA953X_SRIF_DPLL2_LOCAL_PLL BIT(30) +++#define QCA953X_SRIF_DPLL2_OUTDIV_SHIFT 13 +++#define QCA953X_SRIF_DPLL2_OUTDIV_MASK 0x7 +++ ++ #define AR71XX_GPIO_FUNC_STEREO_EN BIT(17) ++ #define AR71XX_GPIO_FUNC_SLIC_EN BIT(16) ++ #define AR71XX_GPIO_FUNC_SPI_CS2_EN BIT(13) ++@@ -804,6 +955,16 @@ ++ #define AR934X_ETH_CFG_RDV_DELAY_SHIFT 16 ++ ++ /* +++ * QCA953X GMAC Interface +++ */ +++#define QCA953X_GMAC_REG_ETH_CFG 0x00 +++ +++#define QCA953X_ETH_CFG_SW_ONLY_MODE BIT(6) +++#define QCA953X_ETH_CFG_SW_PHY_SWAP BIT(7) +++#define QCA953X_ETH_CFG_SW_APB_ACCESS BIT(9) +++#define QCA953X_ETH_CFG_SW_ACC_MSB_FIRST BIT(13) +++ +++/* ++ * QCA955X GMAC Interface ++ */ ++ + --- a/arch/mips/include/asm/mach-ath79/ath79.h + +++ 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 90c9b33..027163f 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 +@@ -1,3 +1,27 @@ ++--- a/arch/mips/ath79/Kconfig +++++ b/arch/mips/ath79/Kconfig ++@@ -1213,6 +1213,12 @@ config SOC_QCA955X ++ select PCI_AR724X if PCI ++ def_bool n ++ +++config SOC_QCA956X +++ select USB_ARCH_HAS_EHCI +++ select HW_HAS_PCI +++ select PCI_AR724X if PCI +++ def_bool n +++ ++ config ATH79_DEV_M25P80 ++ select ATH79_DEV_SPI ++ def_bool n ++@@ -1250,7 +1256,7 @@ config ATH79_DEV_USB ++ def_bool n ++ ++ config ATH79_DEV_WMAC ++- depends on (SOC_AR913X || SOC_AR933X || SOC_AR934X || SOC_QCA953X || SOC_QCA955X) +++ depends on (SOC_AR913X || SOC_AR933X || SOC_AR934X || SOC_QCA953X || SOC_QCA955X || SOC_QCA956X) ++ def_bool n ++ ++ config ATH79_NVRAM + --- a/arch/mips/ath79/clock.c + +++ b/arch/mips/ath79/clock.c + @@ -520,6 +520,100 @@ static void __init qca955x_clocks_init(v +@@ -142,74 +166,9 @@ + ath79_uart_data[0].uartclk = uart_clk_rate; + platform_device_register(&ath79_uart_device); + } else if (soc_is_ar933x()) { +---- a/arch/mips/ath79/dev-eth.c +-+++ b/arch/mips/ath79/dev-eth.c +-@@ -198,6 +198,8 @@ void __init ath79_register_mdio(unsigned +- case ATH79_SOC_AR9330: +- case ATH79_SOC_AR9331: +- case ATH79_SOC_QCA9533: +-+ case ATH79_SOC_QCA9561: +-+ case ATH79_SOC_TP9343: +- mdio_dev = &ath79_mdio1_device; +- mdio_data = &ath79_mdio1_data; +- break; +-@@ -256,6 +258,8 @@ void __init ath79_register_mdio(unsigned +- break; +- +- case ATH79_SOC_QCA9533: +-+ case ATH79_SOC_QCA9561: +-+ case ATH79_SOC_TP9343: +- mdio_data->builtin_switch = 1; +- break; +- +-@@ -571,6 +575,8 @@ static void __init ath79_init_eth_pll_da +- case ATH79_SOC_QCA9533: +- case ATH79_SOC_QCA9556: +- case ATH79_SOC_QCA9558: +-+ case ATH79_SOC_QCA9561: +-+ case ATH79_SOC_TP9343: +- pll_10 = AR934X_PLL_VAL_10; +- pll_100 = AR934X_PLL_VAL_100; +- pll_1000 = AR934X_PLL_VAL_1000; +-@@ -627,6 +633,8 @@ static int __init ath79_setup_phy_if_mod +- case ATH79_SOC_AR9330: +- case ATH79_SOC_AR9331: +- case ATH79_SOC_QCA9533: +-+ case ATH79_SOC_QCA9561: +-+ case ATH79_SOC_TP9343: +- pdata->phy_if_mode = PHY_INTERFACE_MODE_MII; +- break; +- +-@@ -688,6 +696,8 @@ static int __init ath79_setup_phy_if_mod +- case ATH79_SOC_AR9330: +- case ATH79_SOC_AR9331: +- case ATH79_SOC_QCA9533: +-+ case ATH79_SOC_QCA9561: +-+ case ATH79_SOC_TP9343: +- pdata->phy_if_mode = PHY_INTERFACE_MODE_GMII; +- break; +- +-@@ -1018,6 +1028,8 @@ void __init ath79_register_eth(unsigned +- break; +- +- case ATH79_SOC_QCA9533: +-+ case ATH79_SOC_QCA9561: +-+ case ATH79_SOC_TP9343: +- if (id == 0) { +- pdata->reset_bit = AR933X_RESET_GE0_MAC | +- AR933X_RESET_GE0_MDIO; +-@@ -1123,6 +1135,8 @@ void __init ath79_register_eth(unsigned +- case ATH79_SOC_AR9330: +- case ATH79_SOC_AR9331: +- case ATH79_SOC_QCA9533: +-+ case ATH79_SOC_QCA9561: +-+ case ATH79_SOC_TP9343: +- pdata->mii_bus_dev = &ath79_mdio1_device.dev; +- break; +- + --- a/arch/mips/ath79/dev-usb.c + +++ b/arch/mips/ath79/dev-usb.c +-@@ -272,6 +272,19 @@ static void __init qca955x_usb_setup(voi ++@@ -296,6 +296,19 @@ static void __init qca955x_usb_setup(voi + &ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2)); + } + +@@ -229,8 +188,8 @@ + void __init ath79_register_usb(void) + { + if (soc_is_ar71xx()) +-@@ -288,6 +301,8 @@ void __init ath79_register_usb(void) +- ar934x_usb_setup(); ++@@ -314,6 +327,8 @@ void __init ath79_register_usb(void) ++ qca953x_usb_setup(); + else if (soc_is_qca955x()) + qca955x_usb_setup(); + + else if (soc_is_qca9561()) +@@ -291,9 +250,9 @@ + soc_is_ar913x() || + soc_is_ar933x()) + reg = AR71XX_GPIO_REG_FUNC; +-- else if (soc_is_ar934x()) ++- else if (soc_is_ar934x() || soc_is_qca953x()) + + else if (soc_is_ar934x() || +-+ soc_is_qca956x()) +++ soc_is_qca953x() || soc_is_qca956x()) + reg = AR934X_GPIO_REG_FUNC; + else + BUG(); +@@ -326,7 +285,7 @@ + ath79_misc_irq_chip.irq_ack = ar724x_misc_irq_ack; + else + BUG(); +-@@ -236,6 +237,99 @@ static void qca955x_irq_init(void) ++@@ -268,6 +269,97 @@ static void qca955x_irq_init(void) + irq_set_chained_handler(ATH79_CPU_IRQ(3), qca955x_ip3_irq_dispatch); + } + +@@ -406,15 +365,13 @@ + + + + for (i = ATH79_IP2_IRQ_BASE; + + i < ATH79_IP2_IRQ_BASE + ATH79_IP2_IRQ_COUNT; i++) +-+ irq_set_chip_and_handler(i, &dummy_irq_chip, +-+ handle_level_irq); +++ irq_set_chip_and_handler(i, &dummy_irq_chip, handle_level_irq); + + + + irq_set_chained_handler(ATH79_CPU_IRQ(2), qca956x_ip2_irq_dispatch); + + + + for (i = ATH79_IP3_IRQ_BASE; + + i < ATH79_IP3_IRQ_BASE + ATH79_IP3_IRQ_COUNT; i++) +-+ irq_set_chip_and_handler(i, &dummy_irq_chip, +-+ handle_level_irq); +++ irq_set_chip_and_handler(i, &dummy_irq_chip, handle_level_irq); + + + + irq_set_chained_handler(ATH79_CPU_IRQ(3), qca956x_ip3_irq_dispatch); + + +@@ -426,7 +383,7 @@ + asmlinkage void plat_irq_dispatch(void) + { + unsigned long pending; +-@@ -359,6 +453,9 @@ void __init arch_init_irq(void) ++@@ -397,6 +489,9 @@ void __init arch_init_irq(void) + } else if (soc_is_qca955x()) { + ath79_ip2_handler = ath79_default_ip2_handler; + ath79_ip3_handler = ath79_default_ip3_handler; +@@ -436,37 +393,13 @@ + } else { + BUG(); + } +-@@ -371,4 +468,6 @@ void __init arch_init_irq(void) +- ar934x_ip2_irq_init(); ++@@ -411,4 +506,6 @@ void __init arch_init_irq(void) ++ qca953x_irq_init(); + else if (soc_is_qca955x()) + qca955x_irq_init(); + + else if (soc_is_qca956x()) + + qca956x_irq_init(); + } +---- a/arch/mips/ath79/Kconfig +-+++ b/arch/mips/ath79/Kconfig +-@@ -1237,6 +1237,12 @@ config SOC_QCA955X +- select PCI_AR724X if PCI +- def_bool n +- +-+config SOC_QCA956X +-+ select USB_ARCH_HAS_EHCI +-+ select HW_HAS_PCI +-+ select PCI_AR724X if PCI +-+ def_bool n +-+ +- config ATH79_DEV_M25P80 +- select ATH79_DEV_SPI +- def_bool n +-@@ -1274,7 +1280,7 @@ config ATH79_DEV_USB +- def_bool n +- +- config ATH79_DEV_WMAC +-- depends on (SOC_AR913X || SOC_AR933X || SOC_AR934X || SOC_QCA953X || SOC_QCA955X) +-+ depends on (SOC_AR913X || SOC_AR933X || SOC_AR934X || SOC_QCA953X || SOC_QCA955X || SOC_QCA956X) +- def_bool n +- +- config ATH79_NVRAM + --- a/arch/mips/ath79/pci.c + +++ b/arch/mips/ath79/pci.c + @@ -68,6 +68,21 @@ static const struct ath79_pci_irq qca955 +@@ -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); + --- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h + +++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h +-@@ -131,6 +131,23 @@ ++@@ -143,6 +143,23 @@ + #define QCA955X_NFC_BASE 0x1b800200 + #define QCA955X_NFC_SIZE 0xb8 + +@@ -577,7 +510,7 @@ + #define AR9300_OTP_BASE 0x14000 + #define AR9300_OTP_STATUS 0x15f18 + #define AR9300_OTP_STATUS_TYPE 0x7 +-@@ -356,6 +373,49 @@ ++@@ -375,6 +392,49 @@ + #define QCA955X_PLL_CLK_CTRL_DDRCLK_FROM_DDRPLL BIT(21) + #define QCA955X_PLL_CLK_CTRL_AHBCLK_FROM_DDRPLL BIT(24) + +@@ -627,7 +560,7 @@ + /* + * USB_CONFIG block + */ +-@@ -403,6 +463,11 @@ ++@@ -422,6 +482,11 @@ + #define QCA955X_RESET_REG_BOOTSTRAP 0xb0 + #define QCA955X_RESET_REG_EXT_INT_STATUS 0xac + +@@ -639,7 +572,7 @@ + #define MISC_INT_ETHSW BIT(12) + #define MISC_INT_TIMER4 BIT(10) + #define MISC_INT_TIMER3 BIT(9) +-@@ -551,6 +616,8 @@ ++@@ -596,6 +661,8 @@ + + #define QCA955X_BOOTSTRAP_REF_CLK_40 BIT(4) + +@@ -648,7 +581,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) +-@@ -600,6 +667,37 @@ ++@@ -663,6 +730,37 @@ + QCA955X_EXT_INT_PCIE_RC2_INT1 | QCA955X_EXT_INT_PCIE_RC2_INT2 | \ + QCA955X_EXT_INT_PCIE_RC2_INT3) + +@@ -686,7 +619,7 @@ + #define REV_ID_MAJOR_MASK 0xfff0 + #define REV_ID_MAJOR_AR71XX 0x00a0 + #define REV_ID_MAJOR_AR913X 0x00b0 +-@@ -615,6 +713,8 @@ ++@@ -678,6 +776,8 @@ + #define REV_ID_MAJOR_QCA9533_V2 0x0160 + #define REV_ID_MAJOR_QCA9556 0x0130 + #define REV_ID_MAJOR_QCA9558 0x1130 +@@ -695,7 +628,7 @@ + + #define AR71XX_REV_ID_MINOR_MASK 0x3 + #define AR71XX_REV_ID_MINOR_AR7130 0x0 +-@@ -639,6 +739,8 @@ ++@@ -702,6 +802,8 @@ + + #define QCA955X_REV_ID_REVISION_MASK 0xf + +@@ -704,9 +637,9 @@ + /* + * SPI block + */ +-@@ -684,6 +786,19 @@ +- #define AR934X_GPIO_REG_OUT_FUNC5 0x40 +- #define AR934X_GPIO_REG_FUNC 0x6c ++@@ -766,6 +868,19 @@ ++ #define QCA953X_GPIO_OUT_MUX_LED_LINK4 44 ++ #define QCA953X_GPIO_OUT_MUX_LED_LINK5 45 + + +#define QCA956X_GPIO_REG_OUT_FUNC0 0x2c + +#define QCA956X_GPIO_REG_OUT_FUNC1 0x30 +@@ -724,9 +657,9 @@ + #define AR71XX_GPIO_COUNT 16 + #define AR7240_GPIO_COUNT 18 + #define AR7241_GPIO_COUNT 20 +-@@ -692,6 +807,7 @@ ++@@ -774,6 +889,7 @@ + #define AR934X_GPIO_COUNT 23 +- #define QCA953X_GPIO_COUNT 24 ++ #define QCA953X_GPIO_COUNT 18 + #define QCA955X_GPIO_COUNT 24 + +#define QCA956X_GPIO_COUNT 23 + +diff --git a/target/linux/ar71xx/patches-3.18/736-MIPS-ath79-fix-chained-irq-disable.patch b/target/linux/ar71xx/patches-3.18/736-MIPS-ath79-fix-chained-irq-disable.patch +index 8cb38d3..8c0cc95 100644 +--- a/target/linux/ar71xx/patches-3.18/736-MIPS-ath79-fix-chained-irq-disable.patch ++++ b/target/linux/ar71xx/patches-3.18/736-MIPS-ath79-fix-chained-irq-disable.patch +@@ -19,7 +19,16 @@ + + irq_set_chained_handler(ATH79_CPU_IRQ(2), ar934x_ip2_irq_dispatch); + } +-@@ -224,15 +225,13 @@ static void qca955x_irq_init(void) ++@@ -182,7 +183,7 @@ static void qca953x_irq_init(void) ++ ++ for (i = ATH79_IP2_IRQ_BASE; ++ i < ATH79_IP2_IRQ_BASE + ATH79_IP2_IRQ_COUNT; i++) ++- irq_set_chip_and_handler(i, &dummy_irq_chip, handle_level_irq); +++ irq_set_chip_and_handler(i, &ip2_chip, handle_level_irq); ++ ++ irq_set_chained_handler(ATH79_CPU_IRQ(2), qca953x_ip2_irq_dispatch); ++ } ++@@ -256,15 +257,13 @@ static void qca955x_irq_init(void) + + for (i = ATH79_IP2_IRQ_BASE; + i < ATH79_IP2_IRQ_BASE + ATH79_IP2_IRQ_COUNT; i++) +@@ -37,25 +46,23 @@ + + irq_set_chained_handler(ATH79_CPU_IRQ(3), qca955x_ip3_irq_dispatch); + } +-@@ -313,15 +312,13 @@ static void qca956x_irq_init(void) ++@@ -345,13 +344,13 @@ static void qca956x_irq_init(void) + + for (i = ATH79_IP2_IRQ_BASE; + i < ATH79_IP2_IRQ_BASE + ATH79_IP2_IRQ_COUNT; i++) +-- irq_set_chip_and_handler(i, &dummy_irq_chip, +-- handle_level_irq); ++- irq_set_chip_and_handler(i, &dummy_irq_chip, handle_level_irq); + + irq_set_chip_and_handler(i, &ip2_chip, handle_level_irq); + + irq_set_chained_handler(ATH79_CPU_IRQ(2), qca956x_ip2_irq_dispatch); + + for (i = ATH79_IP3_IRQ_BASE; + i < ATH79_IP3_IRQ_BASE + ATH79_IP3_IRQ_COUNT; i++) +-- irq_set_chip_and_handler(i, &dummy_irq_chip, +-- handle_level_irq); ++- irq_set_chip_and_handler(i, &dummy_irq_chip, handle_level_irq); + + irq_set_chip_and_handler(i, &ip3_chip, handle_level_irq); + + irq_set_chained_handler(ATH79_CPU_IRQ(3), qca956x_ip3_irq_dispatch); + +-@@ -430,8 +427,35 @@ static void ar934x_ip3_handler(void) ++@@ -466,8 +465,35 @@ static void qca953x_ip3_handler(void) + do_IRQ(ATH79_CPU_IRQ(3)); + } + From b408e1c99e1fdbb5520f66f1c9163313ea8cd02f Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 6 Aug 2015 21:30:45 +0200 Subject: [PATCH 065/867] batman-adv: decrease maximum fragment size This should workaround batman-adv's inability to deal with different MTUs which need fragmentation. Fixes #435 --- ...n-adv-decrease-maximum-fragment-size.patch | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 patches/packages/routing/0003-batman-adv-decrease-maximum-fragment-size.patch 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 new file mode 100644 index 00000000..07ec6a97 --- /dev/null +++ b/patches/packages/routing/0003-batman-adv-decrease-maximum-fragment-size.patch @@ -0,0 +1,21 @@ +From: Matthias Schiffer +Date: Thu, 6 Aug 2015 21:29:47 +0200 +Subject: batman-adv: decrease maximum fragment size + +diff --git a/batman-adv/patches/1000-batman-adv-decrease-maximum-fragment-size.patch b/batman-adv/patches/1000-batman-adv-decrease-maximum-fragment-size.patch +new file mode 100644 +index 0000000..a93b9fa +--- /dev/null ++++ b/batman-adv/patches/1000-batman-adv-decrease-maximum-fragment-size.patch +@@ -0,0 +1,11 @@ ++--- a/main.h +++++ b/main.h ++@@ -148,7 +148,7 @@ enum batadv_uev_type { ++ /* Maximum number of fragments for one packet */ ++ #define BATADV_FRAG_MAX_FRAGMENTS 16 ++ /* Maxumim size of each fragment */ ++-#define BATADV_FRAG_MAX_FRAG_SIZE 1400 +++#define BATADV_FRAG_MAX_FRAG_SIZE 1280 ++ /* Time to keep fragments while waiting for rest of the fragments */ ++ #define BATADV_FRAG_TIMEOUT 10000 ++ From 397d56e317bc02e6f44a116f510c501a19a47cd8 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 6 Aug 2015 21:42:48 +0200 Subject: [PATCH 066/867] batman-adv: fix patch ordering --- .../0002-batman-adv-introduce-no_rebroadcast-option.patch | 4 ++-- .../0003-batman-adv-decrease-maximum-fragment-size.patch | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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 6022d351..5343997f 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 @@ -28,11 +28,11 @@ index 632a209..01f567f 100644 proto_init_update "$iface" 1 proto_send_update "$config" } -diff --git a/batman-adv/patches/0001-batman-adv-introduce-no_rebroadcast-option.patch b/batman-adv/patches/0001-batman-adv-introduce-no_rebroadcast-option.patch +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..9fc9426 --- /dev/null -+++ b/batman-adv/patches/0001-batman-adv-introduce-no_rebroadcast-option.patch ++++ b/batman-adv/patches/1001-batman-adv-introduce-no_rebroadcast-option.patch @@ -0,0 +1,172 @@ +From 5ba3f1eac041857deabe39432fdfe1a584bbdd81 Mon Sep 17 00:00:00 2001 +Message-Id: <5ba3f1eac041857deabe39432fdfe1a584bbdd81.1420645650.git.mschiffer@universe-factory.net> 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 07ec6a97..3ac4a6bf 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 @@ -2,11 +2,11 @@ From: Matthias Schiffer Date: Thu, 6 Aug 2015 21:29:47 +0200 Subject: batman-adv: decrease maximum fragment size -diff --git a/batman-adv/patches/1000-batman-adv-decrease-maximum-fragment-size.patch b/batman-adv/patches/1000-batman-adv-decrease-maximum-fragment-size.patch +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..a93b9fa --- /dev/null -+++ b/batman-adv/patches/1000-batman-adv-decrease-maximum-fragment-size.patch ++++ b/batman-adv/patches/1002-batman-adv-decrease-maximum-fragment-size.patch @@ -0,0 +1,11 @@ +--- a/main.h ++++ b/main.h From aaac89c762912c07e82d8708c71017521e286cd2 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 6 Aug 2015 22:01:10 +0200 Subject: [PATCH 067/867] Update OpenWrt & LuCI packages --- modules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules b/modules index dea7a051..0c5b9bab 100644 --- a/modules +++ b/modules @@ -4,7 +4,7 @@ OPENWRT_REPO=git://git.openwrt.org/15.05/openwrt.git OPENWRT_COMMIT=48e7befbddb933d6cb046ec074470bbccdb060da PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git -PACKAGES_OPENWRT_COMMIT=bc424ae8577ec10808cc5645eea700ebddf5183f +PACKAGES_OPENWRT_COMMIT=1ee31bdfd26c53e41199c3d28cadca731d3bd372 PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git @@ -14,5 +14,5 @@ PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_COMMIT=7d4e4fe21d6a7315c86fb070f2aac422f3334920 PACKAGES_LUCI_REPO=git://github.com/openwrt/luci.git -PACKAGES_LUCI_COMMIT=69fd4f14eef783076b69315c71fe57baad1f8925 +PACKAGES_LUCI_COMMIT=3a7d738e2776e2ddaf6c127dbd9e2b90a77181d8 PACKAGES_LUCI_BRANCH=for-15.05 From 11bffa59db923e976587cfa981ee4d95d1307e5b Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 6 Aug 2015 22:31:28 +0200 Subject: [PATCH 068/867] Update routing packages This also updates batman-adv & alfred to 2015.1 --- modules | 2 +- .../0001-alfred-adjust-intervals.patch | 4 +- ...-adv-introduce-no_rebroadcast-option.patch | 86 +++++++++---------- ...n-adv-decrease-maximum-fragment-size.patch | 20 ++++- 4 files changed, 62 insertions(+), 50 deletions(-) diff --git a/modules b/modules index 0c5b9bab..e20e49b6 100644 --- a/modules +++ b/modules @@ -11,7 +11,7 @@ PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git PACKAGES_GLUON_COMMIT=881036e1f2818d2f0f0a8a72bfdb9c59e67b0e48 PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git -PACKAGES_ROUTING_COMMIT=7d4e4fe21d6a7315c86fb070f2aac422f3334920 +PACKAGES_ROUTING_COMMIT=15b6598e575a852b1dd94aae6d323ba4683d50fe PACKAGES_LUCI_REPO=git://github.com/openwrt/luci.git PACKAGES_LUCI_COMMIT=3a7d738e2776e2ddaf6c127dbd9e2b90a77181d8 diff --git a/patches/packages/routing/0001-alfred-adjust-intervals.patch b/patches/packages/routing/0001-alfred-adjust-intervals.patch index c8773add..aabb1659 100644 --- a/patches/packages/routing/0001-alfred-adjust-intervals.patch +++ b/patches/packages/routing/0001-alfred-adjust-intervals.patch @@ -4,13 +4,13 @@ Subject: alfred: adjust intervals diff --git a/alfred/patches/0001-alfred-adjust-intervals.patch b/alfred/patches/0001-alfred-adjust-intervals.patch new file mode 100644 -index 0000000..a8e0b4d +index 0000000..df70eea --- /dev/null +++ b/alfred/patches/0001-alfred-adjust-intervals.patch @@ -0,0 +1,15 @@ +--- a/alfred.h ++++ b/alfred.h -+@@ -32,10 +32,10 @@ ++@@ -33,10 +33,10 @@ + #include "list.h" + #include "packet.h" + 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 5343997f..f4745ca3 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,15 +30,15 @@ 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..9fc9426 +index 0000000..f461ddc --- /dev/null +++ b/batman-adv/patches/1001-batman-adv-introduce-no_rebroadcast-option.patch @@ -0,0 +1,172 @@ -+From 5ba3f1eac041857deabe39432fdfe1a584bbdd81 Mon Sep 17 00:00:00 2001 -+Message-Id: <5ba3f1eac041857deabe39432fdfe1a584bbdd81.1420645650.git.mschiffer@universe-factory.net> ++From a20c87779270f509227feecc4487e36a7d850c0f 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] batman-adv: introduce 'no_rebroadcast' option ++Subject: [PATCH 1/2] batman-adv: introduce 'no_rebroadcast' option +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit @@ -63,39 +63,15 @@ index 0000000..9fc9426 + +Signed-off-by: Linus Lüssing +--- -+ hard-interface.c | 2 ++ -+ send.c | 4 ++++ -+ sysfs-class-net-batman-adv | 10 ++++++++ -+ sysfs.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++ -+ types.h | 1 + ++ .../ABI/testing/sysfs-class-net-batman-adv | 10 ++++ ++ net/batman-adv/hard-interface.c | 2 + ++ net/batman-adv/send.c | 4 ++ ++ net/batman-adv/sysfs.c | 59 ++++++++++++++++++++++ ++ net/batman-adv/types.h | 1 + + 5 files changed, 76 insertions(+) + -+--- a/hard-interface.c -++++ b/hard-interface.c -+@@ -592,6 +592,8 @@ batadv_hardif_add_interface(struct net_d -+ /* extra reference for return */ -+ atomic_set(&hard_iface->refcount, 2); -+ -++ atomic_set(&hard_iface->no_rebroadcast, 0); -++ -+ batadv_check_known_mac_addr(hard_iface->net_dev); -+ list_add_tail_rcu(&hard_iface->list, &batadv_hardif_list); -+ -+--- a/send.c -++++ b/send.c -+@@ -513,6 +513,10 @@ static void batadv_send_outstanding_bcas -+ if (forw_packet->num_packets >= hard_iface->num_bcasts) -+ continue; -+ -++ if (atomic_read(&hard_iface->no_rebroadcast) && -++ forw_packet->skb->dev == hard_iface->net_dev) -++ continue; -++ -+ /* send a copy of the saved skb */ -+ skb1 = skb_clone(forw_packet->skb, GFP_ATOMIC); -+ if (skb1) -+--- a/sysfs-class-net-batman-adv -++++ b/sysfs-class-net-batman-adv ++--- a/Documentation/ABI/testing/sysfs-class-net-batman-adv +++++ b/Documentation/ABI/testing/sysfs-class-net-batman-adv +@@ -13,3 +13,13 @@ Description: + displays the batman mesh interface this + currently is associated with. @@ -110,9 +86,33 @@ index 0000000..9fc9426 ++ 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! -+--- a/sysfs.c -++++ b/sysfs.c -+@@ -110,6 +110,17 @@ struct batadv_attribute batadv_attr_vlan ++--- 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 ++ /* extra reference for return */ ++ atomic_set(&hard_iface->refcount, 2); ++ +++ atomic_set(&hard_iface->no_rebroadcast, 0); +++ ++ batadv_check_known_mac_addr(hard_iface->net_dev); ++ list_add_tail_rcu(&hard_iface->list, &batadv_hardif_list); ++ ++--- a/net/batman-adv/send.c +++++ b/net/batman-adv/send.c ++@@ -531,6 +531,10 @@ static void batadv_send_outstanding_bcas ++ if (forw_packet->num_packets >= hard_iface->num_bcasts) ++ continue; ++ +++ if (atomic_read(&hard_iface->no_rebroadcast) && +++ forw_packet->skb->dev == hard_iface->net_dev) +++ continue; +++ ++ /* send a copy of the saved skb */ ++ skb1 = skb_clone(forw_packet->skb, GFP_ATOMIC); ++ if (skb1) ++--- a/net/batman-adv/sysfs.c +++++ b/net/batman-adv/sysfs.c ++@@ -129,6 +129,17 @@ struct batadv_attribute batadv_attr_vlan + .store = _store, \ + } + @@ -130,7 +130,7 @@ index 0000000..9fc9426 + /* Use this, if you have customized show and store functions */ + #define BATADV_ATTR(_name, _mode, _show, _store) \ + struct batadv_attribute batadv_attr_##_name = { \ -+@@ -220,6 +231,52 @@ ssize_t batadv_show_vlan_##_name(struct ++@@ -239,6 +250,52 @@ ssize_t batadv_show_vlan_##_name(struct + static BATADV_ATTR_VLAN(_name, _mode, batadv_show_vlan_##_name, \ + batadv_store_vlan_##_name) + @@ -183,7 +183,7 @@ index 0000000..9fc9426 + static int batadv_store_bool_attr(char *buff, size_t count, + struct net_device *net_dev, + const char *attr_name, atomic_t *attr) -+@@ -843,10 +900,12 @@ static ssize_t batadv_show_iface_status( ++@@ -863,10 +920,12 @@ static ssize_t batadv_show_iface_status( + 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,9 +196,9 @@ index 0000000..9fc9426 + NULL, + }; + -+--- a/types.h -++++ b/types.h -+@@ -101,6 +101,7 @@ struct batadv_hard_iface { ++--- 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; 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 3ac4a6bf..e7b5580e 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,12 +4,24 @@ 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..a93b9fa +index 0000000..16cb023 --- /dev/null +++ b/batman-adv/patches/1002-batman-adv-decrease-maximum-fragment-size.patch -@@ -0,0 +1,11 @@ -+--- a/main.h -++++ b/main.h +@@ -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: ++From: Matthias Schiffer ++Date: Thu, 6 Aug 2015 22:27:01 +0200 ++Subject: [PATCH 2/2] batman-adv: decrease maximum fragment size ++ ++--- ++ net/batman-adv/main.h | 2 +- ++ 1 file changed, 1 insertion(+), 1 deletion(-) ++ ++--- a/net/batman-adv/main.h +++++ b/net/batman-adv/main.h +@@ -148,7 +148,7 @@ enum batadv_uev_type { + /* Maximum number of fragments for one packet */ + #define BATADV_FRAG_MAX_FRAGMENTS 16 From 86773d762829f0b8e8ac8d07559e78962c7f1f5b Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 7 Aug 2015 18:36:13 +0200 Subject: [PATCH 069/867] gluon-luci-wifi-config: add support for new WLAN configuration --- .../lua/luci/model/cbi/admin/wifi-config.lua | 52 +++++++++++++------ package/gluon-luci-wifi-config/i18n/de.po | 25 +++++---- .../i18n/gluon-luci-wifi-config.pot | 10 +++- 3 files changed, 59 insertions(+), 28 deletions(-) diff --git a/package/gluon-luci-wifi-config/files/usr/lib/lua/luci/model/cbi/admin/wifi-config.lua b/package/gluon-luci-wifi-config/files/usr/lib/lua/luci/model/cbi/admin/wifi-config.lua index 66393961..060fb22b 100644 --- a/package/gluon-luci-wifi-config/files/usr/lib/lua/luci/model/cbi/admin/wifi-config.lua +++ b/package/gluon-luci-wifi-config/files/usr/lib/lua/luci/model/cbi/admin/wifi-config.lua @@ -75,15 +75,23 @@ for _, radio in ipairs(radios) do if p then local o - --box for the client network - o = p:option(Flag, radio .. '_client_enabled', translate("Enable client network")) - o.default = uci:get_bool('wireless', 'client_' .. radio, "disabled") and o.disabled or o.enabled - o.rmempty = false + if uci:get('wireless', 'client_' .. radio) then + o = p:option(Flag, radio .. '_client_enabled', translate("Enable client network (access point)")) + o.default = uci:get_bool('wireless', 'client_' .. radio, "disabled") and o.disabled or o.enabled + o.rmempty = false + end - --box for the mesh network - o = p:option(Flag, radio .. '_mesh_enabled', translate("Enable mesh network")) - o.default = uci:get_bool('wireless', 'mesh_' .. radio, "disabled") and o.disabled or o.enabled - o.rmempty = false + if uci:get('wireless', 'mesh_' .. radio) then + o = p:option(Flag, radio .. '_mesh_enabled', translate("Enable mesh network (802.11s)")) + o.default = uci:get_bool('wireless', 'mesh_' .. radio, "disabled") and o.disabled or o.enabled + o.rmempty = false + end + + if uci:get('wireless', 'ibss_' .. radio) then + o = p:option(Flag, radio .. '_ibss_enabled', translate("Enable mesh network (IBSS)")) + o.default = uci:get_bool('wireless', 'ibss_' .. radio, "disabled") and o.disabled or o.enabled + o.rmempty = false + end local phy @@ -120,17 +128,29 @@ function f.handle(self, state, data) for _, radio in ipairs(radios) do - local clientdisabled = 0 - if data[radio .. '_client_enabled'] == '0' then - clientdisabled = 1 + if uci:get('wireless', 'client_' .. radio) then + local disabled = 0 + if data[radio .. '_client_enabled'] == '0' then + disabled = 1 + end + uci:set('wireless', 'client_' .. radio, "disabled", disabled) end - uci:set('wireless', 'client_' .. radio, "disabled", clientdisabled) - local meshdisabled = 0 - if data[radio .. '_mesh_enabled'] == '0' then - meshdisabled = 1 + if uci:get('wireless', 'mesh_' .. radio) then + local disabled = 0 + if data[radio .. '_mesh_enabled'] == '0' then + disabled = 1 + end + uci:set('wireless', 'mesh_' .. radio, "disabled", disabled) + end + + if uci:get('wireless', 'ibss_' .. radio) then + local disabled = 0 + if data[radio .. '_ibss_enabled'] == '0' then + disabled = 1 + end + uci:set('wireless', 'ibss_' .. radio, "disabled", disabled) end - uci:set('wireless', 'mesh_' .. radio, "disabled", meshdisabled) if data[radio .. '_txpower'] then if data[radio .. '_txpower'] == 'default' then diff --git a/package/gluon-luci-wifi-config/i18n/de.po b/package/gluon-luci-wifi-config/i18n/de.po index d633d84c..099e79b5 100644 --- a/package/gluon-luci-wifi-config/i18n/de.po +++ b/package/gluon-luci-wifi-config/i18n/de.po @@ -19,15 +19,21 @@ msgstr "2,4GHz-WLAN" msgid "5GHz WLAN" msgstr "5GHz-WLAN" -msgid "Enable client network" -msgstr "Client-Netz aktivieren" +msgid "Enable client network (access point)" +msgstr "Client-Netz aktivieren (Access Point)" -msgid "Enable mesh network" -msgstr "Mesh-Netz aktivieren" +msgid "Enable mesh network (802.11s)" +msgstr "Mesh-Netz aktivieren (802.11s)" + +msgid "Enable mesh network (IBSS)" +msgstr "Mesh-Netz aktivieren (IBSS)" msgid "Transmission power" msgstr "Sendeleistung" +msgid "WLAN" +msgstr "WLAN" + msgid "" "You can enable or disable your node's client and mesh network SSIDs here. " "Please don't disable the mesh network without a good reason, so other nodes " @@ -36,11 +42,10 @@ msgid "" "values include the antenna gain where available, but there are many devices " "for which the gain is unavailable or inaccurate." msgstr "" -"In diesem Abschnitt hast du die Möglichkeit, die SSIDs des Client- und " -"des Mesh-Netzes zu aktivieren bzw. deaktivieren. Bitte lass die SSID des " -"Mesh-Netzes aktiviert, damit sich andere Knoten mit deinem verbinden " -"können.

" -"Außerdem kann hier die Sendeleistung des WLAN-Adapters konfiguriert werden. " -"Wenn möglich, ist in den Werten der Sendeleistung der Antennengewinn " +"In diesem Abschnitt hast du die Möglichkeit, die SSIDs des Client- und des " +"Mesh-Netzes zu aktivieren bzw. deaktivieren. Bitte lass die SSID des Mesh-" +"Netzes aktiviert, damit sich andere Knoten mit deinem verbinden können.

Außerdem kann hier die Sendeleistung des WLAN-Adapters konfiguriert " +"werden. Wenn möglich, ist in den Werten der Sendeleistung der Antennengewinn " "enthalten; diese Werte sind allerdings für viele Geräte nicht verfügbar oder " "fehlerhaft." diff --git a/package/gluon-luci-wifi-config/i18n/gluon-luci-wifi-config.pot b/package/gluon-luci-wifi-config/i18n/gluon-luci-wifi-config.pot index fa61df18..9b1c8644 100644 --- a/package/gluon-luci-wifi-config/i18n/gluon-luci-wifi-config.pot +++ b/package/gluon-luci-wifi-config/i18n/gluon-luci-wifi-config.pot @@ -10,15 +10,21 @@ msgstr "" msgid "5GHz WLAN" msgstr "" -msgid "Enable client network" +msgid "Enable client network (access point)" msgstr "" -msgid "Enable mesh network" +msgid "Enable mesh network (802.11s)" +msgstr "" + +msgid "Enable mesh network (IBSS)" msgstr "" msgid "Transmission power" msgstr "" +msgid "WLAN" +msgstr "" + msgid "" "You can enable or disable your node's client and mesh network SSIDs here. " "Please don't disable the mesh network without a good reason, so other nodes " From 4b23674393e2a6a9377e6f2ab86c8b66b7711b72 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 7 Aug 2015 18:50:03 +0200 Subject: [PATCH 070/867] base-files: default_postinst: propagate the real postinst return code Fixes site.conf checks. --- ...pagate-the-real-postinst-return-code.patch | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 patches/openwrt/0020-base-files-default_postinst-propagate-the-real-postinst-return-code.patch diff --git a/patches/openwrt/0020-base-files-default_postinst-propagate-the-real-postinst-return-code.patch b/patches/openwrt/0020-base-files-default_postinst-propagate-the-real-postinst-return-code.patch new file mode 100644 index 00000000..5aa64854 --- /dev/null +++ b/patches/openwrt/0020-base-files-default_postinst-propagate-the-real-postinst-return-code.patch @@ -0,0 +1,44 @@ +From: Matthias Schiffer +Date: Fri, 7 Aug 2015 18:45:42 +0200 +Subject: base-files: default_postinst: propagate the real postinst return code + +Using the postinst script for sanity checks and expecting opkg to fail +if the postinst didn't return 0 was possible in Barrier Breaker, propagate +the real postinst return code through default_postinst to restore this +behaviour. + +diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh +index 8d045fa..2f78d67 100755 +--- a/package/base-files/files/lib/functions.sh ++++ b/package/base-files/files/lib/functions.sh +@@ -174,7 +174,8 @@ default_prerm() { + } + + default_postinst() { +- local pkgname rusers ++ local pkgname rusers ret ++ ret=0 + pkgname=$(basename ${1%.*}) + rusers=$(grep "Require-User:" ${IPKG_INSTROOT}/usr/lib/opkg/info/${pkgname}.control) + [ -n "$rusers" ] && { +@@ -215,7 +216,10 @@ default_postinst() { + done + } + +- [ -f ${IPKG_INSTROOT}/usr/lib/opkg/info/${pkgname}.postinst-pkg ] && ( . ${IPKG_INSTROOT}/usr/lib/opkg/info/${pkgname}.postinst-pkg ) ++ if [ -f ${IPKG_INSTROOT}/usr/lib/opkg/info/${pkgname}.postinst-pkg ]; then ++ ( . ${IPKG_INSTROOT}/usr/lib/opkg/info/${pkgname}.postinst-pkg ) ++ ret=$? ++ fi + [ -n "${IPKG_INSTROOT}" ] || rm -f /tmp/luci-indexcache 2>/dev/null + + [ "$PKG_UPGRADE" = "1" ] || for i in `cat ${IPKG_INSTROOT}/usr/lib/opkg/info/${pkgname}.list | grep "^/etc/init.d/"`; do +@@ -225,7 +229,7 @@ default_postinst() { + $i start + } + done +- return 0 ++ return $ret + } + + include() { From 5cc6e820eaf3208183c0a6d5d0b0ef1a281b1832 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 7 Aug 2015 20:56:43 +0200 Subject: [PATCH 071/867] Fix TL-MR3220 v2 image generation This broke due to a recent OpenWrt update. --- targets/ar71xx-generic/profiles.mk | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index c8329b9f..95a32748 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -116,13 +116,10 @@ $(eval $(call GluonProfile,TLMR3040)) $(eval $(call GluonModel,TLMR3040,tl-mr3040-v1,tp-link-tl-mr3040-v1)) $(eval $(call GluonModel,TLMR3040,tl-mr3040-v2,tp-link-tl-mr3040-v2)) -# TL-MR3220 v1 -$(eval $(call GluonProfile,TLMR3220V1)) -$(eval $(call GluonModel,TLMR3220V1,tl-mr3220-v1,tp-link-tl-mr3220-v1)) - -# TL-MR3220 v2 -$(eval $(call GluonProfile,TLMR3220V2)) -$(eval $(call GluonModel,TLMR3220V2,tl-mr3220-v2,tp-link-tl-mr3220-v2)) +# TL-MR3220 v1, v2 +$(eval $(call GluonProfile,TLMR3220)) +$(eval $(call GluonModel,TLMR3220,tl-mr3220-v1,tp-link-tl-mr3220-v1)) +$(eval $(call GluonModel,TLMR3220,tl-mr3220-v2,tp-link-tl-mr3220-v2)) # TL-MR3420 v1, v2 $(eval $(call GluonProfile,TLMR3420)) From 0f928b08d584437b20570877a9a03082b092ec33 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 9 Aug 2015 14:56:03 +0200 Subject: [PATCH 072/867] docs: import v2015.1.2 release notes and list of supported devices --- docs/index.rst | 10 +++++---- docs/releases/v2015.1.2.rst | 41 +++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 docs/releases/v2015.1.2.rst diff --git a/docs/index.rst b/docs/index.rst index 2235dc54..83b4d482 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -49,6 +49,7 @@ Releases .. toctree:: :maxdepth: 1 + releases/v2015.1.2 releases/v2015.1.1 releases/v2015.1 releases/v2014.4 @@ -101,9 +102,10 @@ ar71xx-generic - TL-MR3040 (v1, v2) - TL-MR3220 (v1, v2) - TL-MR3420 (v1, v2) - - TL-WA701N/ND (v1) + - TL-WA701N/ND (v1, v2) - TL-WA750RE (v1) - - TL-WA801N/ND (v2) + - TL-WA801N/ND (v1, v2) + - TL-WA830RE (v1, v2) - TL-WA850RE (v1) - TL-WA860RE (v1) - TL-WA901N/ND (v2, v3) @@ -113,8 +115,8 @@ ar71xx-generic - TL-WR1043N/ND (v1, v2) - TL-WR703N (v1) - TL-WR710N (v1) - - TL-WR740N (v1, v3, v4) - - TL-WR741N/ND (v1, v2, v4) + - TL-WR740N (v1, v3, v4, v5) + - TL-WR741N/ND (v1, v2, v4, v5) - TL-WR743N/ND (v1, v2) - TL-WR841N/ND (v3, v5, v7, v8, v9) - TL-WR842N/ND (v1, v2) diff --git a/docs/releases/v2015.1.2.rst b/docs/releases/v2015.1.2.rst new file mode 100644 index 00000000..97b97b35 --- /dev/null +++ b/docs/releases/v2015.1.2.rst @@ -0,0 +1,41 @@ +Gluon 2015.1.2 +============== + +Added hardware support +~~~~~~~~~~~~~~~~~~~~~~ +ar71xx-generic +^^^^^^^^^^^^^^ + +* TP-Link + + - TL-WA701N/ND (v2) + - TL-WA801N/ND (v1) + - TL-WA830RE (v2) + - TL-WR740N / TL-WR741ND (v5) + +New features +~~~~~~~~~~~~ + +* Ubiquiti Loco M, Picostation M and Rocket M now get their own images (which are just copies of the Bullet M image) + so it's more obvious for users which image to use +* The x86-generic images now contain the e1000e ethernet driver by default + +Bugfixes +~~~~~~~~ + +* Fix download of OpenSSL during build because of broken OpenSSL download servers (again...) +* Fix another ABI incompatiblity with the upstream kernel modules which prevented loading some filesystem-related modules +* Fix potential MAC address conflicts on x86 target when using mesh-on-wan/lan +* Fix signal strength indicators on TP-LINK CPE210/510 +* Fix the model name string on some NETGEAR WNDR3700v2 +* Fix 5GHz WLAN switching channels and losing connectivity when other WLANs using the same channel are detected (including other Gluon nodes...); see https://github.com/freifunk-gluon/gluon/issues/386 +* Fix DNS resolution for mesh VPN on IPv6-only WAN; see https://github.com/freifunk-gluon/gluon/issues/397 +* gluon-mesh-batman-adv-15: update batman-adv to 2015.0 with additional bugfixes (fixes various minor bugs) +* gluon-mesh-batman-adv-15: fix forwarding of fragmented frames over multiple links with different MTUs + + batman-adv compat 15 doesn't re-fragment frames that are fragmented already. In particular, + this breaks transmission of large packets which are first fragmented for mesh-on-lan/wan and are then sent + over the mesh VPN, which has an even smaller MTU. Work around this limitation by decreasing the maximum fragment + size to 1280, so they can always be forwarded as long there's no link with a MTU smaller than 1280. + + See https://github.com/freifunk-gluon/gluon/issues/435 From d432a0a2143c660a4588a8efc0dacbbb34c12585 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 9 Aug 2015 18:13:45 +0200 Subject: [PATCH 073/867] alfred: not only wait for the interface, but also a link-local address --- ...erface-but-also-a-link-local-address.patch | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 patches/packages/routing/0004-alfred-not-only-wait-for-the-interface-but-also-a-link-local-address.patch 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 new file mode 100644 index 00000000..e6873c7b --- /dev/null +++ b/patches/packages/routing/0004-alfred-not-only-wait-for-the-interface-but-also-a-link-local-address.patch @@ -0,0 +1,62 @@ +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 From a1071bc5d4116c52f961cbbf3e14611b5c323fb4 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 13 Aug 2015 20:27:07 +0200 Subject: [PATCH 074/867] Update modules --- modules | 8 ++++---- .../0006-base-files-disable-reset-button-handling.patch | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/modules b/modules index e20e49b6..0539a160 100644 --- a/modules +++ b/modules @@ -1,18 +1,18 @@ GLUON_FEEDS='openwrt gluon routing luci' OPENWRT_REPO=git://git.openwrt.org/15.05/openwrt.git -OPENWRT_COMMIT=48e7befbddb933d6cb046ec074470bbccdb060da +OPENWRT_COMMIT=b62dde9c1c7694b420b3d39823b3553032305409 PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git -PACKAGES_OPENWRT_COMMIT=1ee31bdfd26c53e41199c3d28cadca731d3bd372 +PACKAGES_OPENWRT_COMMIT=74a1d01651c035b28509babed6a11f34ef2c6ee5 PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git PACKAGES_GLUON_COMMIT=881036e1f2818d2f0f0a8a72bfdb9c59e67b0e48 PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git -PACKAGES_ROUTING_COMMIT=15b6598e575a852b1dd94aae6d323ba4683d50fe +PACKAGES_ROUTING_COMMIT=de2eacac7faf3aeac7b5be84a9ff7712faffeb29 PACKAGES_LUCI_REPO=git://github.com/openwrt/luci.git -PACKAGES_LUCI_COMMIT=3a7d738e2776e2ddaf6c127dbd9e2b90a77181d8 +PACKAGES_LUCI_COMMIT=c595f3095bd53e458984e410e24bf4d81a976aea PACKAGES_LUCI_BRANCH=for-15.05 diff --git a/patches/openwrt/0006-base-files-disable-reset-button-handling.patch b/patches/openwrt/0006-base-files-disable-reset-button-handling.patch index 4a601eda..a889df96 100644 --- a/patches/openwrt/0006-base-files-disable-reset-button-handling.patch +++ b/patches/openwrt/0006-base-files-disable-reset-button-handling.patch @@ -6,10 +6,10 @@ This conflicts with our reset button usage. diff --git a/package/base-files/files/etc/rc.button/reset b/package/base-files/files/etc/rc.button/reset deleted file mode 100755 -index 229b503..0000000 +index 3e24146..0000000 --- a/package/base-files/files/etc/rc.button/reset +++ /dev/null -@@ -1,18 +0,0 @@ +@@ -1,20 +0,0 @@ -#!/bin/sh - -[ "${ACTION}" = "released" ] || exit 0 @@ -28,3 +28,5 @@ index 229b503..0000000 - echo "FACTORY RESET" > /dev/console - jffs2reset -y && reboot & -fi +- +-return 0 From bd56af3bab86195d9e2615d9b884e07dcab3a060 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Sun, 16 Aug 2015 14:55:00 +0200 Subject: [PATCH 075/867] docs: introduce per-package documentation Documentation for packages should be placed in docs/packages/ and be added to docs/index.rst. --- docs/index.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/index.rst b/docs/index.rst index 83b4d482..19e174c9 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -43,6 +43,12 @@ Developer Documentation dev/wan dev/i18n +Packages +-------- + +.. toctree:: + :maxdepth: 1 + Releases -------- From 177086b88141784a44fea042d57d050979331475 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Sun, 16 Aug 2015 14:37:32 +0200 Subject: [PATCH 076/867] gluon-radio-config: basic wireless configuration Split basic radio configuration from gluon-mesh-batman-adv as this will be required for virtually any wireless mesh protocol. This package takes care of setting: - wireless channel, - htmode and - regulatory domain gluon-mesh-batman-adv-core depends on this package. --- docs/index.rst | 2 ++ docs/package/gluon-radio-config.rst | 20 ++++++++++++ .../files/usr/lib/lua/gluon/util.lua | 27 ++++++++++++++++ package/gluon-mesh-batman-adv-core/Makefile | 2 +- .../gluon-mesh-batman-adv-core/check_site.lua | 5 --- .../320-gluon-mesh-batman-adv-core-wireless | 26 +--------------- package/gluon-radio-config/Makefile | 31 +++++++++++++++++++ package/gluon-radio-config/check_site.lua | 6 ++++ .../lib/gluon/upgrade/250-gluon-radio-config | 18 +++++++++++ 9 files changed, 106 insertions(+), 31 deletions(-) create mode 100644 docs/package/gluon-radio-config.rst create mode 100644 package/gluon-radio-config/Makefile create mode 100644 package/gluon-radio-config/check_site.lua create mode 100755 package/gluon-radio-config/files/lib/gluon/upgrade/250-gluon-radio-config diff --git a/docs/index.rst b/docs/index.rst index 19e174c9..2b4bc8db 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -49,6 +49,8 @@ Packages .. toctree:: :maxdepth: 1 + package/gluon-radio-config + Releases -------- diff --git a/docs/package/gluon-radio-config.rst b/docs/package/gluon-radio-config.rst new file mode 100644 index 00000000..b253b154 --- /dev/null +++ b/docs/package/gluon-radio-config.rst @@ -0,0 +1,20 @@ +gluon-radio-config +================== + +This package takes care of setting basic wireless settings: + +- regulatory domain +- htmode +- channel + +site.conf +--------- + +regdom + regulatory domain (e.g. *de*) + +wifi24.channel / wifi5.channel + wireless channel for radio + +wifi24.htmode / wifi5.htmode + desired HT mode (e.g. *HT20*) diff --git a/package/gluon-core/files/usr/lib/lua/gluon/util.lua b/package/gluon-core/files/usr/lib/lua/gluon/util.lua index cf3677cb..7d7809b1 100644 --- a/package/gluon-core/files/usr/lib/lua/gluon/util.lua +++ b/package/gluon-core/files/usr/lib/lua/gluon/util.lua @@ -26,9 +26,13 @@ end local os = os local string = string local tonumber = tonumber +local ipairs = ipairs +local table = table local nixio = require 'nixio' local sysconfig = require 'gluon.sysconfig' +local site = require 'gluon.site_config' +local uci = require('luci.model.uci').cursor() module 'gluon.util' @@ -77,3 +81,26 @@ function generate_mac(f, i) return string.format('%02x:%02x:%02x:%s:%s:%s', m1, m2, m3, m4, m5, m6) end + +-- Iterate over all radios defined in UCI calling +-- f(radio, index, site.wifiX) for each radio found while passing +-- site.wifi24 for 2.4 GHz devices and site.wifi5 for 5 GHz ones. +function iterate_radios(f) + local radios = {} + + uci:foreach('wireless', 'wifi-device', + function(s) + table.insert(radios, s['.name']) + end + ) + + for index, radio in ipairs(radios) do + local hwmode = uci:get('wireless', radio, 'hwmode') + + if hwmode == '11g' or hwmode == '11ng' then + f(radio, index, site.wifi24) + elseif hwmode == '11a' or hwmode == '11na' then + f(radio, index, site.wifi5) + end + end +end diff --git a/package/gluon-mesh-batman-adv-core/Makefile b/package/gluon-mesh-batman-adv-core/Makefile index 8358089c..bb3dc537 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 +firewall +libiwinfo-lua + DEPENDS:=+gluon-core +gluon-radio-config +firewall +libiwinfo-lua endef define Build/Prepare diff --git a/package/gluon-mesh-batman-adv-core/check_site.lua b/package/gluon-mesh-batman-adv-core/check_site.lua index 25ae9dff..2c5badc2 100644 --- a/package/gluon-mesh-batman-adv-core/check_site.lua +++ b/package/gluon-mesh-batman-adv-core/check_site.lua @@ -1,9 +1,4 @@ -need_string('regdom') - for _, config in ipairs({'wifi24', 'wifi5'}) do - need_number(config .. '.channel') - need_string(config .. '.htmode') - if need_table(config .. '.ap', nil, false) then need_string(config .. '.ap.ssid') need_boolean(config .. '.ap.disabled', false) diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless index cd9f885a..2c16d0e0 100755 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless +++ b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless @@ -118,36 +118,12 @@ end local function configure_radio(radio, index, config) local suffix = radio:match('^radio(%d+)$') - uci:delete('wireless', radio, 'disabled') - - uci:set('wireless', radio, 'channel', config.channel) - uci:set('wireless', radio, 'htmode', config.htmode) - uci:set('wireless', radio, 'country', site.regdom) - configure_client(config.ap, radio, index, suffix) configure_ibss(config.ibss, radio, index, suffix) configure_mesh(config.mesh, radio, index, suffix) end - -local radios = {} - -uci:foreach('wireless', 'wifi-device', - function(s) - table.insert(radios, s['.name']) - end -) - -for index, radio in ipairs(radios) do - local hwmode = uci:get('wireless', radio, 'hwmode') - - if hwmode == '11g' or hwmode == '11ng' then - configure_radio(radio, index, site.wifi24) - elseif hwmode == '11a' or hwmode == '11na' then - configure_radio(radio, index, site.wifi5) - end -end - +util.iterate_radios(configure_radio) uci:save('wireless') uci:save('network') diff --git a/package/gluon-radio-config/Makefile b/package/gluon-radio-config/Makefile new file mode 100644 index 00000000..9157e804 --- /dev/null +++ b/package/gluon-radio-config/Makefile @@ -0,0 +1,31 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=gluon-radio-config +PKG_VERSION:=1 + +PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) + +include $(GLUONDIR)/include/package.mk + +define Package/gluon-radio-config + SECTION:=gluon + CATEGORY:=Gluon + TITLE:=Basic radio config (regdom, channel, htmode) + DEPENDS:=+gluon-core +endef + +define Build/Prepare + mkdir -p $(PKG_BUILD_DIR) +endef + +define Build/Configure +endef + +define Build/Compile +endef + +define Package/gluon-radio-config/install + $(CP) ./files/* $(1)/ +endef + +$(eval $(call BuildPackage,gluon-radio-config)) diff --git a/package/gluon-radio-config/check_site.lua b/package/gluon-radio-config/check_site.lua new file mode 100644 index 00000000..b804d9fe --- /dev/null +++ b/package/gluon-radio-config/check_site.lua @@ -0,0 +1,6 @@ +need_string('regdom') + +for _, config in ipairs({'wifi24', 'wifi5'}) do + need_number(config .. '.channel') + need_string(config .. '.htmode') +end diff --git a/package/gluon-radio-config/files/lib/gluon/upgrade/250-gluon-radio-config b/package/gluon-radio-config/files/lib/gluon/upgrade/250-gluon-radio-config new file mode 100755 index 00000000..62e6dcde --- /dev/null +++ b/package/gluon-radio-config/files/lib/gluon/upgrade/250-gluon-radio-config @@ -0,0 +1,18 @@ +#!/usr/bin/lua + +local util = require 'gluon.util' +local uci = require('luci.model.uci').cursor() +local site = require 'gluon.site_config' + +local function configure_radio(radio, index, config) + uci:delete('wireless', radio, 'disabled') + + uci:set('wireless', radio, 'channel', config.channel) + uci:set('wireless', radio, 'htmode', config.htmode) + uci:set('wireless', radio, 'country', site.regdom) +end + +util.iterate_radios(configure_radio) + +uci:save('wireless') +uci:commit('wireless') From 6906ef9de6c70cd13bb815190e41bd20b4ec711b Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Wed, 19 Aug 2015 21:12:53 +0200 Subject: [PATCH 077/867] gluon-radvd: use uradvd --- package/gluon-radvd/Makefile | 6 +- .../gluon-radvd/files/etc/init.d/gluon-radvd | 4 +- package/gluon-radvd/src/Makefile | 4 - package/gluon-radvd/src/gluon-radvd.c | 659 ------------------ 4 files changed, 3 insertions(+), 670 deletions(-) delete mode 100644 package/gluon-radvd/src/Makefile delete mode 100644 package/gluon-radvd/src/gluon-radvd.c diff --git a/package/gluon-radvd/Makefile b/package/gluon-radvd/Makefile index 4736af60..6695673c 100644 --- a/package/gluon-radvd/Makefile +++ b/package/gluon-radvd/Makefile @@ -11,7 +11,7 @@ define Package/gluon-radvd SECTION:=gluon CATEGORY:=Gluon TITLE:=Advertise an IPv6 prefix from the node - DEPENDS:=+gluon-core +gluon-ebtables +gluon-mesh-batman-adv +librt + DEPENDS:=+gluon-core +gluon-ebtables +gluon-mesh-batman-adv +uradvd endef define Package/gluon-radvd/description @@ -20,20 +20,16 @@ endef define Build/Prepare mkdir -p $(PKG_BUILD_DIR) - $(CP) ./src/* $(PKG_BUILD_DIR)/ endef define Build/Configure endef define Build/Compile - CFLAGS="$(TARGET_CFLAGS)" CPPFLAGS="$(TARGET_CPPFLAGS)" $(MAKE) -C $(PKG_BUILD_DIR) $(TARGET_CONFIGURE_OPTS) endef define Package/gluon-radvd/install $(CP) ./files/* $(1)/ - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/gluon-radvd $(1)/usr/sbin/ endef $(eval $(call BuildPackage,gluon-radvd)) diff --git a/package/gluon-radvd/files/etc/init.d/gluon-radvd b/package/gluon-radvd/files/etc/init.d/gluon-radvd index 14815e76..d7a981d4 100755 --- a/package/gluon-radvd/files/etc/init.d/gluon-radvd +++ b/package/gluon-radvd/files/etc/init.d/gluon-radvd @@ -7,9 +7,9 @@ SERVICE_DAEMONIZE=1 start() { - service_start /usr/sbin/gluon-radvd -i br-client -p $(lua -e 'print(require("gluon.site_config").prefix6)') + service_start /usr/sbin/uradvd -i br-client -p $(lua -e 'print(require("gluon.site_config").prefix6)') } stop() { - service_stop /usr/sbin/gluon-radvd + service_stop /usr/sbin/uradvd } diff --git a/package/gluon-radvd/src/Makefile b/package/gluon-radvd/src/Makefile deleted file mode 100644 index f0bc9034..00000000 --- a/package/gluon-radvd/src/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -all: gluon-radvd - -gluon-radvd: gluon-radvd.c - $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -Wall -o $@ $^ $(LDLIBS) -lrt diff --git a/package/gluon-radvd/src/gluon-radvd.c b/package/gluon-radvd/src/gluon-radvd.c deleted file mode 100644 index e146c4f5..00000000 --- a/package/gluon-radvd/src/gluon-radvd.c +++ /dev/null @@ -1,659 +0,0 @@ -/* - Copyright (c) 2014, 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. -*/ - - -#define _GNU_SOURCE - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include - -#include - -#include -#include - -#include -#include -#include -#include -#include - - -#define MAX_PREFIXES 8 - -/* These are in seconds */ -#define AdvValidLifetime 86400u -#define AdvPreferredLifetime 14400u -#define AdvDefaultLifetime 0u -#define AdvCurHopLimit 64u - -#define MinRtrAdvInterval 200u -#define MaxRtrAdvInterval 600u - -/* And these in milliseconds */ -#define MAX_RA_DELAY_TIME 500u -#define MIN_DELAY_BETWEEN_RAS 3000u - - -struct icmpv6_opt { - uint8_t type; - uint8_t length; - uint8_t data[6]; -}; - - -struct iface { - bool ok; - unsigned int ifindex; - struct in6_addr ifaddr; - uint8_t mac[6]; -}; - -static struct global { - struct iface iface; - - struct timespec time; - struct timespec next_advert; - struct timespec next_advert_earliest; - - int icmp_sock; - int rtnl_sock; - - const char *ifname; - - size_t n_prefixes; - struct in6_addr prefixes[MAX_PREFIXES]; - bool prefixes_onlink[MAX_PREFIXES]; -} G = { - .rtnl_sock = -1, - .icmp_sock = -1, -}; - - -static inline void exit_errno(const char *message) { - error(1, errno, "error: %s", message); -} - -static inline void warn_errno(const char *message) { - error(0, errno, "warning: %s", message); -} - - -static inline void update_time(void) { - clock_gettime(CLOCK_MONOTONIC, &G.time); -} - -/* Compares two timespecs and returns true if tp1 is after tp2 */ -static inline bool timespec_after(const struct timespec *tp1, const struct timespec *tp2) { - return (tp1->tv_sec > tp2->tv_sec || - (tp1->tv_sec == tp2->tv_sec && tp1->tv_nsec > tp2->tv_nsec)); -} - -/* Returns (tp1 - tp2) in milliseconds */ -static inline int timespec_diff(const struct timespec *tp1, const struct timespec *tp2) { - return ((tp1->tv_sec - tp2->tv_sec))*1000 + (tp1->tv_nsec - tp2->tv_nsec)/1e6; -} - -static inline void timespec_add(struct timespec *tp, unsigned int ms) { - tp->tv_sec += ms/1000; - tp->tv_nsec += (ms%1000) * 1e6; - - if (tp->tv_nsec >= 1e9) { - tp->tv_nsec -= 1e9; - tp->tv_sec++; - } -} - - -static inline int setsockopt_int(int socket, int level, int option, int value) { - return setsockopt(socket, level, option, &value, sizeof(value)); -} - - -static void init_random(void) { - unsigned int seed; - int fd = open("/dev/urandom", O_RDONLY); - if (fd < 0) - exit_errno("can't open /dev/urandom"); - - if (read(fd, &seed, sizeof(seed)) != sizeof(seed)) - exit_errno("can't read from /dev/urandom"); - - close(fd); - - srandom(seed); -} - -static inline int rand_range(int min, int max) { - unsigned int r = (unsigned int)random(); - return (r%(max-min) + min); -} - -static void init_icmp(void) { - G.icmp_sock = socket(AF_INET6, SOCK_RAW|SOCK_NONBLOCK, IPPROTO_ICMPV6); - if (G.icmp_sock < 0) - exit_errno("can't open ICMP socket"); - - setsockopt_int(G.icmp_sock, IPPROTO_RAW, IPV6_CHECKSUM, 2); - - setsockopt_int(G.icmp_sock, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, 255); - setsockopt_int(G.icmp_sock, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, 1); - - setsockopt_int(G.icmp_sock, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, 1); - - struct icmp6_filter filter; - ICMP6_FILTER_SETBLOCKALL(&filter); - ICMP6_FILTER_SETPASS(ND_ROUTER_SOLICIT, &filter); - setsockopt(G.icmp_sock, IPPROTO_ICMPV6, ICMP6_FILTER, &filter, sizeof(filter)); -} - -static void init_rtnl(void) { - G.rtnl_sock = socket(AF_NETLINK, SOCK_DGRAM|SOCK_NONBLOCK, NETLINK_ROUTE); - if (G.rtnl_sock < 0) - exit_errno("can't open RTNL socket"); - - struct sockaddr_nl snl = { - .nl_family = AF_NETLINK, - .nl_groups = RTMGRP_LINK | RTMGRP_IPV6_IFADDR, - }; - if (bind(G.rtnl_sock, (struct sockaddr *)&snl, sizeof(snl)) < 0) - exit_errno("can't bind RTNL socket"); -} - - -static void schedule_advert(bool nodelay) { - struct timespec t = G.time; - - if (nodelay) - timespec_add(&t, rand_range(0, MAX_RA_DELAY_TIME)); - else - timespec_add(&t, rand_range(MinRtrAdvInterval*1000, MaxRtrAdvInterval*1000)); - - if (timespec_after(&G.next_advert_earliest, &t)) - t = G.next_advert_earliest; - - if (!nodelay || timespec_after(&G.next_advert, &t)) - G.next_advert = t; -} - - -static int join_multicast(void) { - struct ipv6_mreq mreq = { - .ipv6mr_multiaddr = { - .s6_addr = { - /* all-routers address */ - 0xff, 0x02, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x02, - } - }, - .ipv6mr_interface = G.iface.ifindex, - }; - - if (setsockopt(G.icmp_sock, IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, &mreq, sizeof(mreq)) == 0) { - return 2; - } - else if (errno != EADDRINUSE) { - warn_errno("can't join multicast group"); - return 0; - } - - return 1; -} - -static void update_interface(void) { - struct iface old; - - memcpy(&old, &G.iface, sizeof(struct iface)); - memset(&G.iface, 0, sizeof(struct iface)); - - /* Update ifindex */ - G.iface.ifindex = if_nametoindex(G.ifname); - if (!G.iface.ifindex) - return; - - /* Update MAC address */ - struct ifreq ifr = {}; - strncpy(ifr.ifr_name, G.ifname, sizeof(ifr.ifr_name)-1); - if (ioctl(G.icmp_sock, SIOCGIFHWADDR, &ifr) < 0) - return; - - memcpy(G.iface.mac, ifr.ifr_hwaddr.sa_data, sizeof(G.iface.mac)); - - struct ifaddrs *addrs, *addr; - if (getifaddrs(&addrs) < 0) { - warn_errno("getifaddrs"); - return; - } - - memset(&G.iface.ifaddr, 0, sizeof(G.iface.ifaddr)); - - for (addr = addrs; addr; addr = addr->ifa_next) { - if (!addr->ifa_addr || addr->ifa_addr->sa_family != AF_INET6) - continue; - - const struct sockaddr_in6 *in6 = (const struct sockaddr_in6 *)addr->ifa_addr; - if (!IN6_IS_ADDR_LINKLOCAL(&in6->sin6_addr)) - continue; - - if (strncmp(addr->ifa_name, G.ifname, IFNAMSIZ-1) != 0) - continue; - - G.iface.ifaddr = in6->sin6_addr; - } - - freeifaddrs(addrs); - - if (IN6_IS_ADDR_UNSPECIFIED(&G.iface.ifaddr)) - return; - - int joined = join_multicast(); - if (!joined) - return; - - setsockopt(G.icmp_sock, SOL_SOCKET, SO_BINDTODEVICE, G.ifname, strnlen(G.ifname, IFNAMSIZ-1)); - - G.iface.ok = true; - - if (memcmp(&old, &G.iface, sizeof(struct iface)) != 0 || joined == 2) - schedule_advert(true); -} - - -static bool handle_rtnl_link(uint16_t type, const struct ifinfomsg *msg) { - switch (type) { - case RTM_NEWLINK: - if (!G.iface.ok) - return true; - - break; - - case RTM_SETLINK: - if ((unsigned)msg->ifi_index == G.iface.ifindex) - return true; - - if (!G.iface.ok) - return true; - - break; - - case RTM_DELLINK: - if (G.iface.ok && (unsigned)msg->ifi_index == G.iface.ifindex) - return true; - } - - return false; -} - -static bool handle_rtnl_addr(uint16_t type, const struct ifaddrmsg *msg) { - switch (type) { - case RTM_NEWADDR: - if (!G.iface.ok && (unsigned)msg->ifa_index == G.iface.ifindex) - return true; - - break; - - case RTM_DELADDR: - if (G.iface.ok && (unsigned)msg->ifa_index == G.iface.ifindex) - return true; - } - - return false; -} - -static bool handle_rtnl_msg(uint16_t type, const void *data) { - switch (type) { - case RTM_NEWLINK: - case RTM_DELLINK: - case RTM_SETLINK: - return handle_rtnl_link(type, data); - - case RTM_NEWADDR: - case RTM_DELADDR: - return handle_rtnl_addr(type, data); - - default: - return false; - } -} - -static void handle_rtnl(void) { - char buffer[4096]; - - ssize_t len = recv(G.rtnl_sock, buffer, sizeof(buffer), 0); - if (len < 0) { - warn_errno("recv"); - return; - } - - const struct nlmsghdr *nh; - for (nh = (struct nlmsghdr *)buffer; NLMSG_OK(nh, len); nh = NLMSG_NEXT(nh, len)) { - switch (nh->nlmsg_type) { - case NLMSG_DONE: - return; - - case NLMSG_ERROR: - error(1, 0, "error: netlink error"); - - default: - if (handle_rtnl_msg(nh->nlmsg_type, NLMSG_DATA(nh))) { - update_interface(); - return; - } - } - } -} - -static void add_pktinfo(struct msghdr *msg) { - struct cmsghdr *cmsg = (struct cmsghdr*)((char*)msg->msg_control + msg->msg_controllen); - - cmsg->cmsg_level = IPPROTO_IPV6; - cmsg->cmsg_type = IPV6_PKTINFO; - cmsg->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo)); - - msg->msg_controllen += cmsg->cmsg_len; - - struct in6_pktinfo pktinfo = { - .ipi6_addr = G.iface.ifaddr, - .ipi6_ifindex = G.iface.ifindex, - }; - - memcpy(CMSG_DATA(cmsg), &pktinfo, sizeof(pktinfo)); -} - - -static void handle_solicit(void) { - struct sockaddr_in6 addr; - - uint8_t buffer[1500] __attribute__((aligned(8))); - struct iovec vec = { .iov_base = buffer, .iov_len = sizeof(buffer) }; - - uint8_t cbuf[1024] __attribute__((aligned(8))); - - - struct msghdr msg = { - .msg_name = &addr, - .msg_namelen = sizeof(addr), - .msg_iov = &vec, - .msg_iovlen = 1, - .msg_control = cbuf, - .msg_controllen = sizeof(cbuf), - }; - - ssize_t len = recvmsg(G.icmp_sock, &msg, 0); - if (len < (ssize_t)sizeof(struct nd_router_solicit)) { - if (len < 0) - warn_errno("recvmsg"); - - return; - } - - struct cmsghdr *cmsg; - for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; cmsg = CMSG_NXTHDR(&msg, cmsg)) { - if (cmsg->cmsg_level != IPPROTO_IPV6) - continue; - - if (cmsg->cmsg_type != IPV6_HOPLIMIT) - continue; - - if (*(int*)CMSG_DATA(cmsg) != 255) - return; - - break; - } - - const struct nd_router_solicit *s = (struct nd_router_solicit *)buffer; - if (s->nd_rs_hdr.icmp6_type != ND_ROUTER_SOLICIT || s->nd_rs_hdr.icmp6_code != 0) - return; - - const struct icmpv6_opt *opt = (struct icmpv6_opt *)(buffer + sizeof(struct nd_router_solicit)), *end = (struct icmpv6_opt *)(buffer+len); - - for (; opt < end; opt += opt->length) { - if (opt+1 < end) - return; - - if (!opt->length) - return; - - if (opt+opt->length < end) - return; - - if (opt->type == ND_OPT_SOURCE_LINKADDR && IN6_IS_ADDR_UNSPECIFIED(&addr.sin6_addr)) - return; - } - - if (opt != end) - return; - - schedule_advert(true); -} - -static void send_advert(void) { - if (!G.iface.ok) - return; - - struct nd_router_advert advert = { - .nd_ra_hdr = { - .icmp6_type = ND_ROUTER_ADVERT, - .icmp6_dataun.icmp6_un_data8 = {AdvCurHopLimit, 0 /* Flags */, (AdvDefaultLifetime>>8) & 0xff, AdvDefaultLifetime & 0xff }, - }, - }; - - struct icmpv6_opt lladdr = {ND_OPT_SOURCE_LINKADDR, 1, {}}; - memcpy(lladdr.data, G.iface.mac, sizeof(G.iface.mac)); - - struct nd_opt_prefix_info prefixes[G.n_prefixes]; - - size_t i; - for (i = 0; i < G.n_prefixes; i++) { - uint8_t flags = ND_OPT_PI_FLAG_AUTO; - - if (G.prefixes_onlink[i]) - flags |= ND_OPT_PI_FLAG_ONLINK; - - prefixes[i] = (struct nd_opt_prefix_info){ - .nd_opt_pi_type = ND_OPT_PREFIX_INFORMATION, - .nd_opt_pi_len = 4, - .nd_opt_pi_prefix_len = 64, - .nd_opt_pi_flags_reserved = flags, - .nd_opt_pi_valid_time = htonl(AdvValidLifetime), - .nd_opt_pi_preferred_time = htonl(AdvPreferredLifetime), - .nd_opt_pi_prefix = G.prefixes[i], - }; - } - - struct iovec vec[3] = { - { .iov_base = &advert, .iov_len = sizeof(advert) }, - { .iov_base = &lladdr, .iov_len = sizeof(lladdr) }, - { .iov_base = prefixes, .iov_len = sizeof(prefixes) }, - }; - - struct sockaddr_in6 addr = { - .sin6_family = AF_INET6, - .sin6_addr = { - .s6_addr = { - /* all-nodes address */ - 0xff, 0x02, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, - } - }, - .sin6_scope_id = G.iface.ifindex, - }; - - uint8_t cbuf[1024] __attribute__((aligned(8))) = {}; - - struct msghdr msg = { - .msg_name = &addr, - .msg_namelen = sizeof(addr), - .msg_iov = vec, - .msg_iovlen = 3, - .msg_control = cbuf, - .msg_controllen = 0, - .msg_flags = 0, - }; - - add_pktinfo(&msg); - - if (sendmsg(G.icmp_sock, &msg, 0) < 0) { - G.iface.ok = false; - return; - } - - G.next_advert_earliest = G.time; - timespec_add(&G.next_advert_earliest, MIN_DELAY_BETWEEN_RAS); - - schedule_advert(false); -} - - -static void usage(void) { - fprintf(stderr, "Usage: gluon-radvd [-h] -i -a/-p [ -a/-p ... ]\n"); -} - -static void add_prefix(const char *prefix, bool adv_onlink) { - if (G.n_prefixes == MAX_PREFIXES) - error(1, 0, "maximum number of prefixes is %i.", MAX_PREFIXES); - - const size_t len = strlen(prefix)+1; - char prefix2[len]; - memcpy(prefix2, prefix, len); - - char *slash = strchr(prefix2, '/'); - if (slash) { - *slash = 0; - if (strcmp(slash+1, "64") != 0) - goto error; - } - - if (inet_pton(AF_INET6, prefix2, &G.prefixes[G.n_prefixes]) != 1) - goto error; - - static const uint8_t zero[8] = {}; - if (memcmp(G.prefixes[G.n_prefixes].s6_addr + 8, zero, 8) != 0) - goto error; - - G.prefixes_onlink[G.n_prefixes] = adv_onlink; - - G.n_prefixes++; - return; - - error: - error(1, 0, "invalid prefix %s (only prefixes of length 64 are supported).", prefix); -} - -static void parse_cmdline(int argc, char *argv[]) { - int c; - while ((c = getopt(argc, argv, "i:a:p:h")) != -1) { - switch(c) { - case 'i': - if (G.ifname) - error(1, 0, "multiple interfaces are not supported."); - - G.ifname = optarg; - - break; - - case 'a': - add_prefix(optarg, false); - break; - - case 'p': - add_prefix(optarg, true); - break; - - case 'h': - usage(); - exit(0); - - default: - usage(); - exit(1); - } - } -} - -int main(int argc, char *argv[]) { - parse_cmdline(argc, argv); - - if (!G.ifname || !G.n_prefixes) - error(1, 0, "interface and prefix arguments are required."); - - init_random(); - init_icmp(); - init_rtnl(); - - update_time(); - G.next_advert = G.next_advert_earliest = G.time; - - update_interface(); - - while (true) { - struct pollfd fds[2] = { - { .fd = G.icmp_sock, .events = POLLIN }, - { .fd = G.rtnl_sock, .events = POLLIN }, - }; - - int timeout = -1; - - if (G.iface.ok) { - timeout = timespec_diff(&G.next_advert, &G.time); - - if (timeout < 0) - timeout = 0; - } - - int ret = poll(fds, 2, timeout); - if (ret < 0) - exit_errno("poll"); - - update_time(); - - if (fds[0].revents & POLLIN) - handle_solicit(); - if (fds[1].revents & POLLIN) - handle_rtnl(); - - if (timespec_after(&G.time, &G.next_advert)) - send_advert(); - } -} From 5cd17b9b9bb4e6b01d3986bbb174beb3fbcccdee Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Wed, 19 Aug 2015 21:36:00 +0200 Subject: [PATCH 078/867] Update modules --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 0539a160..6031c54e 100644 --- a/modules +++ b/modules @@ -8,7 +8,7 @@ PACKAGES_OPENWRT_COMMIT=74a1d01651c035b28509babed6a11f34ef2c6ee5 PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git -PACKAGES_GLUON_COMMIT=881036e1f2818d2f0f0a8a72bfdb9c59e67b0e48 +PACKAGES_GLUON_COMMIT=dea803c392ef7ff99ce32c0599ace4ce0db9bf7b PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_COMMIT=de2eacac7faf3aeac7b5be84a9ff7712faffeb29 From 753c1f9e2ae0598b6cf1a1bb3fea83ff610cb188 Mon Sep 17 00:00:00 2001 From: kb-light Date: Sun, 23 Aug 2015 23:03:36 +0200 Subject: [PATCH 079/867] gluon-status-page: handle 11s interfaces --- .../files/lib/gluon/status-page/www/cgi-bin/status | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/status b/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/status index b31e2f73..f0c8cbd8 100755 --- a/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/status +++ b/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/status @@ -70,14 +70,12 @@ io.write("") io.write("

Neighbours

") -local interfaces = util.split(util.trim(util.exec("iw dev | grep IBSS -B 5 | grep Interface | cut -d' ' -f2"))) +local interfaces = util.split(util.trim(util.exec("iw dev | egrep 'type IBSS|type mesh' -B 5 | grep Interface | cut -d' ' -f2"))) for _, ifname in ipairs(interfaces) do io.write("

" .. escape_html(ifname) .. "

") io.write("
")
 
-  io.write(escape_html(sys.exec("iw dev " .. ifname .. " link")) .. "\n")
-
   for _, line in ipairs(util.split(util.exec("iw dev " .. ifname .. " station dump"))) do
     local mac = line:match("^Station (.*) %(on ")
     if mac then

From 0f427af474841636e71f2ee34a7eb90d7b17d4a3 Mon Sep 17 00:00:00 2001
From: Matthias Schiffer 
Date: Fri, 28 Aug 2015 10:48:23 +0200
Subject: [PATCH 080/867] Avoid build dependency on libopenssl

---
 ...ditional-libopenssl-build-dependency.patch | 22 +++++++++++++++++++
 ...ditional-libopenssl-build-dependency.patch | 22 +++++++++++++++++++
 2 files changed, 44 insertions(+)
 create mode 100644 patches/openwrt/0021-opkg-work-around-unconditional-libopenssl-build-dependency.patch
 create mode 100644 patches/openwrt/0022-hostapd-work-around-unconditional-libopenssl-build-dependency.patch

diff --git a/patches/openwrt/0021-opkg-work-around-unconditional-libopenssl-build-dependency.patch b/patches/openwrt/0021-opkg-work-around-unconditional-libopenssl-build-dependency.patch
new file mode 100644
index 00000000..e87afb85
--- /dev/null
+++ b/patches/openwrt/0021-opkg-work-around-unconditional-libopenssl-build-dependency.patch
@@ -0,0 +1,22 @@
+From: Matthias Schiffer 
+Date: Fri, 28 Aug 2015 10:43:55 +0200
+Subject: opkg: work around unconditional libopenssl build dependency
+
+As the OpenWrt build system only resolves build dependencies per directory,
+all opkg variants were causing libopenssl to be downloaded and built,
+not only opkg-smime. Fix this by applying the same workaround as in
+ustream-ssl.
+
+diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile
+index d38ed52..16ff225 100644
+--- a/package/system/opkg/Makefile
++++ b/package/system/opkg/Makefile
+@@ -70,7 +70,7 @@ endef
+ define Package/opkg-smime
+   $(call Package/opkg/Default)
+   TITLE+= (with S/MIME signature support)
+-  DEPENDS+=+libopenssl
++  DEPENDS+=+PACKAGE_opkg-smime:libopenssl
+   VARIANT:=smime
+ endef
+ 
diff --git a/patches/openwrt/0022-hostapd-work-around-unconditional-libopenssl-build-dependency.patch b/patches/openwrt/0022-hostapd-work-around-unconditional-libopenssl-build-dependency.patch
new file mode 100644
index 00000000..0d51e607
--- /dev/null
+++ b/patches/openwrt/0022-hostapd-work-around-unconditional-libopenssl-build-dependency.patch
@@ -0,0 +1,22 @@
+From: Matthias Schiffer 
+Date: Fri, 28 Aug 2015 10:46:11 +0200
+Subject: hostapd: work around unconditional libopenssl build dependency
+
+As the OpenWrt build system only resolves build dependencies per directory,
+all hostapd variants were causing libopenssl to be downloaded and built,
+not only wpad-mesh. Fix this by applying the same workaround as in
+ustream-ssl.
+
+diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile
+index 3dff7b4..d86bb43 100644
+--- a/package/network/services/hostapd/Makefile
++++ b/package/network/services/hostapd/Makefile
+@@ -177,7 +177,7 @@ endef
+ define Package/wpad-mesh
+ $(call Package/wpad/Default)
+   TITLE+= (with 802.11s mesh and SAE support)
+-  DEPENDS:=$(DRV_DEPENDS) +libubus +libopenssl +@CONFIG_WPA_SUPPLICANT_OPENSSL @(!TARGET_uml||BROKEN)
++  DEPENDS:=$(DRV_DEPENDS) +libubus +PACKAGE_wpad-mesh:libopenssl +@CONFIG_WPA_SUPPLICANT_OPENSSL @(!TARGET_uml||BROKEN)
+   CONFLICTS:=@WPA_SUPPLICANT_INTERNAL
+   VARIANT:=wpad-mesh
+ endef

From 3dbe4bc80fece006489e7d20388b7093125a30a1 Mon Sep 17 00:00:00 2001
From: Matthias Schiffer 
Date: Fri, 28 Aug 2015 19:31:41 +0200
Subject: [PATCH 081/867] Update modules

---
 modules                                                   | 8 ++++----
 ...atech-community-firmware-as-an-additional-choice.patch | 2 +-
 ...09-ar71xx-add-support-for-tp-link-wr740n-v5.0-EU.patch | 6 +++---
 .../0010-ar71xx-add-support-for-TL-WR741ND-v5.patch       | 6 +++---
 ...ndr3700_board_detect-for-some-NETGEAR-WNDR3700v2.patch | 2 +-
 .../0019-ar71xx-rework-patch-for-qca953x-956x.patch       | 8 ++++----
 6 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/modules b/modules
index 6031c54e..1d89ebd2 100644
--- a/modules
+++ b/modules
@@ -1,18 +1,18 @@
 GLUON_FEEDS='openwrt gluon routing luci'
 
 OPENWRT_REPO=git://git.openwrt.org/15.05/openwrt.git
-OPENWRT_COMMIT=b62dde9c1c7694b420b3d39823b3553032305409
+OPENWRT_COMMIT=81c67dc9c7ae92f2cbaa70c5633f3e8e6635e906
 
 PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git
-PACKAGES_OPENWRT_COMMIT=74a1d01651c035b28509babed6a11f34ef2c6ee5
+PACKAGES_OPENWRT_COMMIT=d32e986ef6ae6ac414a908d914a2230b1ecf482e
 PACKAGES_OPENWRT_BRANCH=for-15.05
 
 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git
 PACKAGES_GLUON_COMMIT=dea803c392ef7ff99ce32c0599ace4ce0db9bf7b
 
 PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git
-PACKAGES_ROUTING_COMMIT=de2eacac7faf3aeac7b5be84a9ff7712faffeb29
+PACKAGES_ROUTING_COMMIT=a845bb4b95bb6598bb1f04a578c47383ff2aaac2
 
 PACKAGES_LUCI_REPO=git://github.com/openwrt/luci.git
-PACKAGES_LUCI_COMMIT=c595f3095bd53e458984e410e24bf4d81a976aea
+PACKAGES_LUCI_COMMIT=791ca8b6d217cd17b563c008c86159f519874d72
 PACKAGES_LUCI_BRANCH=for-15.05
diff --git a/patches/openwrt/0005-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch b/patches/openwrt/0005-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch
index fffb01f1..9d937c29 100644
--- a/patches/openwrt/0005-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch
+++ b/patches/openwrt/0005-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch
@@ -3,7 +3,7 @@ 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 1f15b40..c9cd289 100644
+index a1eedce..1c0aebe 100644
 --- a/package/kernel/mac80211/Makefile
 +++ b/package/kernel/mac80211/Makefile
 @@ -604,6 +604,14 @@ This module adds support for wireless adapters based on
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 98ff7264..793e08d8 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,10 +10,10 @@ 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 3c77465..8fc9f4c 100644
+index bb5de17..1d5f4c0 100644
 --- a/target/linux/ar71xx/image/Makefile
 +++ b/target/linux/ar71xx/image/Makefile
-@@ -476,6 +476,14 @@ define Device/tl-wr740n-v4
+@@ -484,6 +484,14 @@ define Device/tl-wr740n-v4
      CONSOLE := ttyATH0,115200
  endef
  
@@ -28,7 +28,7 @@ index 3c77465..8fc9f4c 100644
  define Device/tl-wr741nd-v1
      $(Device/tplink-4m)
      BOARDNAME := TL-WR741ND
-@@ -505,7 +513,7 @@ define Device/tl-wr743nd-v2
+@@ -513,7 +521,7 @@ define Device/tl-wr743nd-v2
      TPLINK_HWID := 0x07430002
      CONSOLE := ttyATH0,115200
  endef
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 a334ec57..02009666 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,10 +6,10 @@ 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 8fc9f4c..b45f9b2 100644
+index 1d5f4c0..0600f98 100644
 --- a/target/linux/ar71xx/image/Makefile
 +++ b/target/linux/ar71xx/image/Makefile
-@@ -506,6 +506,14 @@ define Device/tl-wr741nd-v4
+@@ -514,6 +514,14 @@ define Device/tl-wr741nd-v4
      CONSOLE := ttyATH0,115200
  endef
  
@@ -24,7 +24,7 @@ index 8fc9f4c..b45f9b2 100644
  define Device/tl-wr743nd-v2
      $(Device/tplink-4mlzma)
      BOARDNAME := TL-WR741ND-v4
-@@ -513,7 +521,7 @@ define Device/tl-wr743nd-v2
+@@ -521,7 +529,7 @@ define Device/tl-wr743nd-v2
      TPLINK_HWID := 0x07430002
      CONSOLE := ttyATH0,115200
  endef
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
index 704b0c78..9c195a66 100644
--- 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
@@ -12,7 +12,7 @@ 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 4c10ab2..5617aa6 100755
+index cacf362..e1d03ea 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() {
diff --git a/patches/openwrt/0019-ar71xx-rework-patch-for-qca953x-956x.patch b/patches/openwrt/0019-ar71xx-rework-patch-for-qca953x-956x.patch
index 9fbfe838..dbab8b1b 100644
--- a/patches/openwrt/0019-ar71xx-rework-patch-for-qca953x-956x.patch
+++ b/patches/openwrt/0019-ar71xx-rework-patch-for-qca953x-956x.patch
@@ -103,7 +103,7 @@ 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 a24d496..2b35f27 100644
+index b44e884..d541939 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.
@@ -594,7 +594,7 @@ index a24d496..2b35f27 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 90c9b33..027163f 100644
+index 8f15790..027163f 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
 @@ -1,3 +1,27 @@
@@ -775,7 +775,7 @@ index 90c9b33..027163f 100644
   }
 ---- a/arch/mips/ath79/Kconfig
 -+++ b/arch/mips/ath79/Kconfig
--@@ -1237,6 +1237,12 @@ config SOC_QCA955X
+-@@ -1248,6 +1248,12 @@ config SOC_QCA955X
 - 	select PCI_AR724X if PCI
 - 	def_bool n
 - 
@@ -788,7 +788,7 @@ index 90c9b33..027163f 100644
 - config ATH79_DEV_M25P80
 - 	select ATH79_DEV_SPI
 - 	def_bool n
--@@ -1274,7 +1280,7 @@ config ATH79_DEV_USB
+-@@ -1285,7 +1291,7 @@ config ATH79_DEV_USB
 - 	def_bool n
 - 
 - config ATH79_DEV_WMAC

From ac439b8b64dc3901ad34a674967eed7789463b33 Mon Sep 17 00:00:00 2001
From: Nils Schneider 
Date: Sat, 29 Aug 2015 02:10:32 +0200
Subject: [PATCH 082/867] Update modules

---
 modules | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules b/modules
index 1d89ebd2..52aee2b1 100644
--- a/modules
+++ b/modules
@@ -8,7 +8,7 @@ PACKAGES_OPENWRT_COMMIT=d32e986ef6ae6ac414a908d914a2230b1ecf482e
 PACKAGES_OPENWRT_BRANCH=for-15.05
 
 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git
-PACKAGES_GLUON_COMMIT=dea803c392ef7ff99ce32c0599ace4ce0db9bf7b
+PACKAGES_GLUON_COMMIT=6c6fafa0bad263c220aef25a5dba69dee90353ba
 
 PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git
 PACKAGES_ROUTING_COMMIT=a845bb4b95bb6598bb1f04a578c47383ff2aaac2

From 15a80aaffdba9ed8bd6f97cacf6120de838946eb Mon Sep 17 00:00:00 2001
From: Jan-Philipp Litza 
Date: Sun, 30 Aug 2015 20:53:44 +0200
Subject: [PATCH 083/867] Switch from luci-lib-json to luci-lib-jsonc

Apart from replacing a patch for the former by two patches for latter,
this involved minimal adaptations of the lua scripts in the following
packages:

* gluon-announce
* gluon-announced
* gluon-mesh-batman-adv-core
* gluon-status-page
---
 package/gluon-announce/Makefile               |  2 +-
 .../files/lib/gluon/announce/collect.lua      |  5 +--
 .../files/usr/lib/lua/gluon/announce.lua      |  3 +-
 .../files/usr/lib/lua/gluon/announced.lua     |  6 +--
 .../lib/gluon/announce/neighbours.d/batadv    |  2 +-
 .../nodeinfo.d/network/mesh/bat0/interfaces   |  2 +-
 .../lib/gluon/announce/statistics.d/mesh_vpn  |  8 ++--
 package/gluon-status-page/Makefile            |  2 +-
 .../www/cgi-bin/dyn/neighbours-batadv         |  4 +-
 .../status-page/www/cgi-bin/dyn/stations      |  4 +-
 .../status-page/www/cgi-bin/dyn/statistics    |  4 +-
 .../gluon/status-page/www/cgi-bin/interfaces  |  4 +-
 .../gluon/status-page/www/cgi-bin/nodeinfo    |  4 +-
 .../lib/gluon/status-page/www/cgi-bin/status  |  8 ++--
 ...keys-to-allow-encoding-empty-objects.patch | 36 ------------------
 ...-non-string-or-number-keys-in-tables.patch | 32 ++++++++++++++++
 ...lib-jsonc-allow-encoding-empty-lists.patch | 38 +++++++++++++++++++
 17 files changed, 98 insertions(+), 66 deletions(-)
 delete mode 100644 patches/packages/luci/0004-luci-lib-json-ignore-null-keys-to-allow-encoding-empty-objects.patch
 create mode 100644 patches/packages/luci/0004-luci-lib-jsonc-Ignore-non-string-or-number-keys-in-tables.patch
 create mode 100644 patches/packages/luci/0005-luci-lib-jsonc-allow-encoding-empty-lists.patch

diff --git a/package/gluon-announce/Makefile b/package/gluon-announce/Makefile
index 3f62c889..d2742cf7 100644
--- a/package/gluon-announce/Makefile
+++ b/package/gluon-announce/Makefile
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/package.mk
 define Package/gluon-announce
   SECTION:=gluon
   CATEGORY:=Gluon
-  DEPENDS:=+gluon-core +luci-lib-json +lua-ethtool-stats
+  DEPENDS:=+gluon-core +luci-lib-jsonc +lua-ethtool-stats
   TITLE:=Lua scripts announcing various information
 endef
 
diff --git a/package/gluon-announce/files/lib/gluon/announce/collect.lua b/package/gluon-announce/files/lib/gluon/announce/collect.lua
index e2974b49..43392075 100755
--- a/package/gluon-announce/files/lib/gluon/announce/collect.lua
+++ b/package/gluon-announce/files/lib/gluon/announce/collect.lua
@@ -1,10 +1,9 @@
 #!/usr/bin/lua
 
 local announce = require 'gluon.announce'
-local json = require 'luci.json'
+local json = require 'luci.jsonc'
 local ltn12 = require 'luci.ltn12'
 
 local announce_dir = '/lib/gluon/announce/' .. arg[1] .. '.d'
 
-encoder = json.Encoder(announce.collect_dir(announce_dir))
-ltn12.pump.all(encoder:source(), ltn12.sink.file(io.stdout))
+print(json.stringify(announce.collect_dir(announce_dir)))
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 be855b3a..fdd2479e 100644
--- a/package/gluon-announce/files/usr/lib/lua/gluon/announce.lua
+++ b/package/gluon-announce/files/usr/lib/lua/gluon/announce.lua
@@ -3,7 +3,6 @@
 module('gluon.announce', package.seeall)
 
 fs = require 'nixio.fs'
-json = require 'luci.json'
 uci = require('luci.model.uci').cursor()
 util = require 'luci.util'
 
@@ -16,7 +15,7 @@ local function collect_entry(entry)
 end
 
 function collect_dir(dir)
-	local ret = { [json.null] = true }
+	local ret = { [{}] = true }
 
 	for entry in fs.dir(dir) do
 		if entry:sub(1, 1) ~= '.' then
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 99116b81..a9de80e6 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,6 @@
 local announce = require 'gluon.announce'
 local deflate = require 'deflate'
-local json = require 'luci.json'
+local json = require 'luci.jsonc'
 
 
 local function collect(type)
@@ -12,7 +12,7 @@ module('gluon.announced', package.seeall)
 
 function handle_request(query)
   if query:match('^nodeinfo$') then
-    return json.encode(collect('nodeinfo'))
+    return json.stringify(collect('nodeinfo'))
   end
 
   local m = query:match('^GET ([a-z ]+)$')
@@ -27,7 +27,7 @@ function handle_request(query)
     end
 
     if next(data) then
-      return deflate.compress(json.encode(data))
+      return deflate.compress(json.stringify(data))
     end
   end
 end
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 cfdd72dc..e83f188f 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
@@ -22,7 +22,7 @@ function batadv()
     if mac1 ~= nil and mac1 == mac2 then
       ifaddress = ifname2address(ifname)
       if interfaces[ifaddress] == nil then
-        interfaces[ifaddress] = { neighbours = { [json.null] = true } }
+        interfaces[ifaddress] = { neighbours = { [{}] = true } }
       end
 
       interfaces[ifaddress].neighbours[mac1] = { tq = tonumber(tq)
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
index e0c3c9ac..1ac22d30 100644
--- 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
@@ -49,5 +49,5 @@ return {
   wireless = nil_table(wireless),
   tunnel = nil_table(tunnel),
   other = nil_table(other),
-  [json.null] = true
+  [{}] = true
 }
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
index a67b9a07..0d6d66f0 100644
--- 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
@@ -1,4 +1,4 @@
-local json = require 'luci.json'
+local json = require 'luci.jsonc'
 local ltn12 = require 'luci.ltn12'
 local nixio = require 'nixio'
 local site = require 'gluon.site_config'
@@ -11,8 +11,8 @@ if not fastd_sock:connect(socket_path) then
   return nil
 end
 
-local decoder = json.Decoder()
-ltn12.pump.all(ltn12.source.file(fastd_sock), decoder:sink())
+local decoder = json.new()
+ltn12.pump.all(ltn12.source.file(fastd_sock), function(chunk) decoder:parse(chunk) end)
 
 local status = decoder:get()
 
@@ -27,7 +27,7 @@ local function peer_connection(config)
         established = peer.connection.established/1000
       }
     else
-      return json.null
+      return function()end -- nil
     end
   end
 end
diff --git a/package/gluon-status-page/Makefile b/package/gluon-status-page/Makefile
index 3d9edbfe..2543ea2a 100644
--- a/package/gluon-status-page/Makefile
+++ b/package/gluon-status-page/Makefile
@@ -12,7 +12,7 @@ define Package/gluon-status-page
   SECTION:=gluon
   CATEGORY:=Gluon
   TITLE:=Adds a status page showing information about the node.
-  DEPENDS:=+gluon-core +uhttpd +gluon-neighbour-info +gluon-announce +libiwinfo-lua
+  DEPENDS:=+gluon-core +uhttpd +gluon-neighbour-info +gluon-announce +libiwinfo-lua +luci-lib-jsonc
 endef
 
 define Package/gluon-status-page/description
diff --git a/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/dyn/neighbours-batadv b/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/dyn/neighbours-batadv
index addecd60..3bcdf89b 100755
--- a/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/dyn/neighbours-batadv
+++ b/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/dyn/neighbours-batadv
@@ -1,6 +1,6 @@
 #!/usr/bin/lua
 
-local json = require 'luci.json'
+local json = require 'luci.jsonc'
 local nixio = require 'nixio'
 
 function neighbours()
@@ -25,7 +25,7 @@ io.write("Access-Control-Allow-Origin: *\n")
 io.write("Content-type: text/event-stream\n\n")
 
 while true do
-  local neighbours = json.encode(neighbours())
+  local neighbours = json.stringify(neighbours())
   io.write("data: " .. neighbours .. "\n\n")
   io.flush()
   nixio.nanosleep(1, 0)
diff --git a/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/dyn/stations b/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/dyn/stations
index 4745c342..637de649 100755
--- a/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/dyn/stations
+++ b/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/dyn/stations
@@ -1,7 +1,7 @@
 #!/usr/bin/lua
 
 util = require 'luci.util'
-json = require 'luci.json'
+json = require 'luci.jsonc'
 nixio = require 'nixio'
 iwinfo = require 'iwinfo'
 
@@ -45,7 +45,7 @@ io.write("Access-Control-Allow-Origin: *\n")
 io.write("Content-type: text/event-stream\n\n")
 
 while true do
-  local stations = json.encode(get_stations(iw, ifname))
+  local stations = json.stringify(get_stations(iw, ifname))
   io.write("data: " .. stations .. "\n\n")
   io.flush()
   nixio.nanosleep(0, 150e6)
diff --git a/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/dyn/statistics b/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/dyn/statistics
index 7805afe8..194564b9 100755
--- a/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/dyn/statistics
+++ b/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/dyn/statistics
@@ -1,7 +1,7 @@
 #!/usr/bin/lua
 
 local announce = require 'gluon.announce'
-local json = require 'luci.json'
+local json = require 'luci.jsonc'
 local util = require 'luci.util'
 local nixio = require 'nixio'
 
@@ -11,7 +11,7 @@ io.write("Access-Control-Allow-Origin: *\n")
 io.write("Content-type: text/event-stream\n\n")
 
 while true do
-  local data = json.encode(announce.collect_dir(announce_dir))
+  local data = json.stringify(announce.collect_dir(announce_dir))
   io.write("data: " .. data .. "\n\n")
   io.flush()
   nixio.nanosleep(1, 0)
diff --git a/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/interfaces b/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/interfaces
index 2615ed82..4eabf815 100755
--- a/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/interfaces
+++ b/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/interfaces
@@ -1,7 +1,7 @@
 #!/usr/bin/lua
 
 util = require 'luci.util'
-json = require 'luci.json'
+json = require 'luci.jsonc'
 fs = require 'nixio.fs'
 
 io.write("Access-Control-Allow-Origin: *\n")
@@ -21,4 +21,4 @@ for _, line in ipairs(util.split(list)) do
   end
 end
 
-io.write(json.encode(interfaces))
+io.write(json.stringify(interfaces))
diff --git a/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/nodeinfo b/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/nodeinfo
index a2ef61c7..78789244 100755
--- a/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/nodeinfo
+++ b/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/nodeinfo
@@ -1,7 +1,7 @@
 #!/usr/bin/lua
 
 local announce = require 'gluon.announce'
-local json = require 'luci.json'
+local json = require 'luci.jsonc'
 local util = require 'luci.util'
 local nixio = require 'nixio'
 
@@ -10,6 +10,6 @@ local announce_dir = '/lib/gluon/announce/nodeinfo.d/'
 io.write("Access-Control-Allow-Origin: *\n")
 io.write("Content-type: application/json\n\n")
 
-local data = json.encode(announce.collect_dir(announce_dir))
+local data = json.stringify(announce.collect_dir(announce_dir))
 io.write(data)
 io.flush()
diff --git a/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/status b/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/status
index f0c8cbd8..fe4ba0af 100755
--- a/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/status
+++ b/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/status
@@ -4,7 +4,7 @@ local util = require("luci.util")
 local fs = require("nixio.fs")
 local ltn12 = require 'luci.ltn12'
 local sys = require("luci.sys")
-local json = require("luci.json")
+local json = require("luci.jsonc")
 local nixio = require 'nixio'
 local platform_info = require("platform_info")
 
@@ -20,7 +20,7 @@ function neighbours(ifname)
   local info = util.exec("gluon-neighbour-info -d ff02::2:1001 -p 1001 -r nodeinfo -t 3 -i " .. ifname)
   local macs = {}
   for _, line in ipairs(util.split(info)) do
-    local data = json.decode(line)
+    local data = json.parse(line)
     if data then
       local function add_macs(list)
         if list then
@@ -93,8 +93,8 @@ local stat, fastd_status = pcall(
     local fastd_sock = nixio.socket('unix', 'stream')
     assert(fastd_sock:connect('/var/run/fastd.mesh_vpn.socket'))
 
-    decoder = json.Decoder()
-    ltn12.pump.all(ltn12.source.file(fastd_sock), decoder:sink())
+    decoder = json.new()
+    ltn12.pump.all(ltn12.source.file(fastd_sock), function(chunk) decoder:parse(chunk) end)
     return decoder:get()
   end
 )
diff --git a/patches/packages/luci/0004-luci-lib-json-ignore-null-keys-to-allow-encoding-empty-objects.patch b/patches/packages/luci/0004-luci-lib-json-ignore-null-keys-to-allow-encoding-empty-objects.patch
deleted file mode 100644
index ab02429c..00000000
--- a/patches/packages/luci/0004-luci-lib-json-ignore-null-keys-to-allow-encoding-empty-objects.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From: Matthias Schiffer 
-Date: Thu, 4 Jun 2015 21:03:24 +0200
-Subject: luci-lib-json: ignore null keys to allow encoding empty objects
-
-There is currently no way to encode an empty object {}, as empty tables are
-encoded as empty lists [].
-
-With this patch, encode() will ignore table fields with the key json.null (which
-doesn't make sense anyways). This allows adding a field with key json.null to
-force encoding it as an object.
-
-Signed-off-by: Matthias Schiffer 
-
-diff --git a/libs/luci-lib-json/luasrc/json.lua b/libs/luci-lib-json/luasrc/json.lua
-index 416b25f..f7b57f9 100644
---- a/libs/luci-lib-json/luasrc/json.lua
-+++ b/libs/luci-lib-json/luasrc/json.lua
-@@ -149,11 +149,13 @@ function Encoder.parse_iter(self, obj)
- 		local first = true
- 
- 		for key, entry in pairs(obj) do
--			first = first or self:put(",")
--			first = first and false
--			self:parse_string(tostring(key))
--			self:put(":")
--			self:dispatch(entry)
-+			if key ~= null then
-+				first = first or self:put(",")
-+				first = first and false
-+				self:parse_string(tostring(key))
-+				self:put(":")
-+				self:dispatch(entry)
-+			end
- 		end
- 
- 		self:put("}")
diff --git a/patches/packages/luci/0004-luci-lib-jsonc-Ignore-non-string-or-number-keys-in-tables.patch b/patches/packages/luci/0004-luci-lib-jsonc-Ignore-non-string-or-number-keys-in-tables.patch
new file mode 100644
index 00000000..584a2fab
--- /dev/null
+++ b/patches/packages/luci/0004-luci-lib-jsonc-Ignore-non-string-or-number-keys-in-tables.patch
@@ -0,0 +1,32 @@
+From: Jan-Philipp Litza 
+Date: Sun, 30 Aug 2015 15:42:52 +0200
+Subject: luci-lib-jsonc: Ignore non-string-or-number keys in tables
+
+Previously, the following caused a segmentation fault:
+
+    json.stringify({[{}] = true})
+
+This was caused by lua_tostring() returning NULL for anything but
+strings and numbers, letting json_object_object_add crash.
+
+This patch makes jsonc ignore all keys which have no string
+representation altogether.
+
+Signed-off-by: Jan-Philipp Litza 
+
+diff --git a/libs/luci-lib-jsonc/src/jsonc.c b/libs/luci-lib-jsonc/src/jsonc.c
+index 49cb21f..827fde8 100644
+--- a/libs/luci-lib-jsonc/src/jsonc.c
++++ b/libs/luci-lib-jsonc/src/jsonc.c
+@@ -286,8 +286,9 @@ static struct json_object * _lua_to_json(lua_State *L, int index)
+ 			lua_pushvalue(L, -2);
+ 			key = lua_tostring(L, -1);
+ 
+-			json_object_object_add(obj, key,
+-								   _lua_to_json(L, lua_gettop(L) - 1));
++			if (key)
++				json_object_object_add(obj, key,
++				                       _lua_to_json(L, lua_gettop(L) - 1));
+ 
+ 			lua_pop(L, 2);
+ 		}
diff --git a/patches/packages/luci/0005-luci-lib-jsonc-allow-encoding-empty-lists.patch b/patches/packages/luci/0005-luci-lib-jsonc-allow-encoding-empty-lists.patch
new file mode 100644
index 00000000..8d6b6842
--- /dev/null
+++ b/patches/packages/luci/0005-luci-lib-jsonc-allow-encoding-empty-lists.patch
@@ -0,0 +1,38 @@
+From: Jan-Philipp Litza 
+Date: Sun, 30 Aug 2015 15:45:49 +0200
+Subject: luci-lib-jsonc: allow encoding empty lists
+
+To be consistent with the behavior of luci-lib-json, an empty Lua table
+should be encoded to an empty JSON list, not an empty JSON object.
+
+To still allow encoding empty JSON objects, the usage of anything other
+than a number or a string as a key (for example an empty table or a
+function) can be used to force encoding as an object:
+
+    json.stringify({})                  -- "[]"
+    json.stringify({[{}] = true})       -- "{}"
+
+Signed-off-by: Jan-Philipp Litza 
+
+diff --git a/libs/luci-lib-jsonc/src/jsonc.c b/libs/luci-lib-jsonc/src/jsonc.c
+index 827fde8..971fb12 100644
+--- a/libs/luci-lib-jsonc/src/jsonc.c
++++ b/libs/luci-lib-jsonc/src/jsonc.c
+@@ -222,7 +222,7 @@ static int _lua_test_array(lua_State *L, int index)
+ 
+ out:
+ 		lua_pop(L, 2);
+-		return 0;
++		return -1;
+ 	}
+ 
+ 	/* check for holes */
+@@ -254,7 +254,7 @@ static struct json_object * _lua_to_json(lua_State *L, int index)
+ 	case LUA_TTABLE:
+ 		max = _lua_test_array(L, index);
+ 
+-		if (max > 0)
++		if (max >= 0)
+ 		{
+ 			obj = json_object_new_array();
+ 

From eb590bdc128947324f9590b8c59d00660932de82 Mon Sep 17 00:00:00 2001
From: Jan-Philipp Litza 
Date: Sun, 30 Aug 2015 21:41:57 +0200
Subject: [PATCH 084/867] gluon-config-mode-mesh-vpn: Move display of key to
 translations

When rebooting the node in config mode, currently the fastd key is
forcefully displayed in a fixed format. This is confusing in communities
where fastd accepts all keys and no key submission is needed.
Furthermore, some communities might want to personalize the display of
the key (see #387).

This patch moves the displaying 
from the package's lua file to the translation files of the sample site configuration and mentiones the change in the release notes. --- docs/index.rst | 1 + docs/releases/v2015.2.rst | 37 +++++++++++++++++++ docs/site-example/i18n/de.po | 8 +++- docs/site-example/i18n/en.po | 8 +++- .../config-mode/reboot/0100-mesh-vpn.lua | 7 +--- 5 files changed, 53 insertions(+), 8 deletions(-) create mode 100644 docs/releases/v2015.2.rst diff --git a/docs/index.rst b/docs/index.rst index 2b4bc8db..1fd9d16d 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -57,6 +57,7 @@ Releases .. toctree:: :maxdepth: 1 + releases/v2015.2 releases/v2015.1.2 releases/v2015.1.1 releases/v2015.1 diff --git a/docs/releases/v2015.2.rst b/docs/releases/v2015.2.rst new file mode 100644 index 00000000..eda71390 --- /dev/null +++ b/docs/releases/v2015.2.rst @@ -0,0 +1,37 @@ +Gluon 2015.2 (in development) +============================= + +Added (and removed) hardware support +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +New features +~~~~~~~~~~~~ + + +Bugfixes +~~~~~~~~ + + +Site changes +~~~~~~~~~~~~ +* ``i18n/`` + + - The translations of ``gluon-config-mode:pubkey`` now have to show the fastd + public key itself if desired, making its format and whether it is shown at + all configurable. To retain the old format, add ``

`` to the beginning of + your translations and append:: + + "

" + "
" + " # <%= hostname %>" + "
" + "<%= pubkey %>" + "
" + +Internals +~~~~~~~~~ + + +Known Issues +~~~~~~~~~~~~ diff --git a/docs/site-example/i18n/de.po b/docs/site-example/i18n/de.po index ce27c813..c4a9f9dc 100644 --- a/docs/site-example/i18n/de.po +++ b/docs/site-example/i18n/de.po @@ -18,12 +18,18 @@ msgstr "" msgid "gluon-config-mode:pubkey" msgstr "" -"Dies ist der öffentliche Schlüssel deines Freifunk-Knotens. Erst nachdem " +"

Dies ist der öffentliche Schlüssel deines Freifunk-Knotens. Erst nachdem " "er auf den Servern des Entenhausener Freifunk-Projektes eingetragen wurde, " "kann sich dein Knoten mit dem Entenhausener Mesh-VPN zu verbinden. Bitte " "schicke dazu diesen Schlüssel und den Namen deines Knotens " "(<%=hostname%>) an " "keys@entenhausen.freifunk.net." +"

" +"
" +" # <%= hostname %>" +"
" +"<%= pubkey %>" +"
" msgid "gluon-config-mode:reboot" msgstr "" diff --git a/docs/site-example/i18n/en.po b/docs/site-example/i18n/en.po index dedc06e1..ac28fea5 100644 --- a/docs/site-example/i18n/en.po +++ b/docs/site-example/i18n/en.po @@ -17,11 +17,17 @@ msgstr "" msgid "gluon-config-mode:pubkey" msgstr "" -"This is your Freifunk node's public key. The node won't be able to " +"

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 " "keys@entenhausen.freifunk.net." +"

" +"
" +" # <%= hostname %>" +"
" +"<%= pubkey %>" +"
" msgid "gluon-config-mode:reboot" diff --git a/package/gluon-config-mode-mesh-vpn/files/lib/gluon/config-mode/reboot/0100-mesh-vpn.lua b/package/gluon-config-mode-mesh-vpn/files/lib/gluon/config-mode/reboot/0100-mesh-vpn.lua index 1b32c731..9bd31486 100644 --- a/package/gluon-config-mode-mesh-vpn/files/lib/gluon/config-mode/reboot/0100-mesh-vpn.lua +++ b/package/gluon-config-mode-mesh-vpn/files/lib/gluon/config-mode/reboot/0100-mesh-vpn.lua @@ -12,12 +12,7 @@ else local pubkey = util.trim(util.exec("/etc/init.d/fastd show_key " .. "mesh_vpn")) local hostname = uci:get_first("system", "system", "hostname") - local msg = [[

]] .. i18n.translate('gluon-config-mode:pubkey') .. [[

-
- # <%= hostname %> -
- <%= pubkey %> -
]] + local msg = i18n.translate('gluon-config-mode:pubkey') return function () luci.template.render_string(msg, { pubkey=pubkey From 222fd94ca7d05dc76ea9ebed51e03f5e63ec3825 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Litza Date: Sun, 30 Aug 2015 22:59:36 +0200 Subject: [PATCH 085/867] docs: Warn of empty msgstr in translations, hint at using comments --- docs/user/site.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/user/site.rst b/docs/user/site.rst index ff67a6a6..055d43ba 100644 --- a/docs/user/site.rst +++ b/docs/user/site.rst @@ -284,6 +284,15 @@ for the language files. The command ``msginit -l en -i ../../docs/site-example/i can be used from the ``i18n`` directory to create an initial PO file called ``en.po`` if the ``gettext`` utilities are installed. +.. note:: + + An empty ``msgstr``, as is the default after running ``msginit``, leads to + the ``msgid`` being printed as-is. It does *not* hide the whole text, as + might be expected. + + Depending on the context, you might be able to use comments like + ```` as translations to effectively hide the text. + Examples -------- From 89a9d8138c4b48726bd17abe9128385b3430af14 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Litza Date: Sat, 29 Aug 2015 23:37:40 +0200 Subject: [PATCH 086/867] gluon-mesh-batman-adv-core: Announce client count by frequency --- .../lib/gluon/announce/statistics.d/clients | 51 ++++++++++++++++--- 1 file changed, 43 insertions(+), 8 deletions(-) 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 index 235865ed..8e4506e9 100644 --- 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 @@ -1,20 +1,55 @@ -local list = io.lines("/sys/kernel/debug/batman_adv/bat0/transtable_local") +local iwinfo = require 'iwinfo' -local count = 0 -local wifi = 0 +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 - count = count + 1 + counts.total = counts.total + 1 + clients[mac:lower()] = true if flags:match('W') then - wifi = wifi +1 + counts.wifi = counts.wifi +1 end end end end -return { total = count - , wifi = wifi - } +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 From f5bef2ab0121e64b655979d1a47805c9284479e2 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 31 Aug 2015 00:45:52 +0200 Subject: [PATCH 087/867] docs: site-example/i18n/de.po: fix typo --- docs/site-example/i18n/de.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/site-example/i18n/de.po b/docs/site-example/i18n/de.po index c4a9f9dc..69cf1dd8 100644 --- a/docs/site-example/i18n/de.po +++ b/docs/site-example/i18n/de.po @@ -20,7 +20,7 @@ msgid "gluon-config-mode:pubkey" msgstr "" "

Dies ist der öffentliche Schlüssel deines Freifunk-Knotens. Erst nachdem " "er auf den Servern des Entenhausener Freifunk-Projektes eingetragen wurde, " -"kann sich dein Knoten mit dem Entenhausener Mesh-VPN zu verbinden. Bitte " +"kann sich dein Knoten mit dem Entenhausener Mesh-VPN verbinden. Bitte " "schicke dazu diesen Schlüssel und den Namen deines Knotens " "(<%=hostname%>) an " "keys@entenhausen.freifunk.net." From c6b551aeeb6e63a1f95c068da0f35d6910f087c4 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Litza Date: Mon, 31 Aug 2015 19:16:48 +0200 Subject: [PATCH 088/867] Add contribution guidelines --- CONTRIBUTING.md | 65 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..119fd8d3 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,65 @@ +Contribution Guidelines +======================= + +Because Gluon is such a universal software package that is used by several +different communities with different expectations and requirements, it is both +essential and difficult to have contributions from the communities. While they +are sometimes necessary to adapt Gluon to the needs of the communities, they +also have to be adaptable enough to fit as many needs as possible. On the other +hands, very special needs are better addressed in packages in [community +repositories], because the Gluon maintainers would not use or test them and +thus couldn't do their "job" of maintaining them. + +To ease the work for the maintainers and to reduce the frustration of +contributors, please adhere to the following guidelines: + +Discuss first, build later +-------------------------- +If you have some non-trivial enhancement like a new package, some modification +of what is announced by a node, it is often best to first discuss the precise +solution first. The maintainers might have hints as to how a solution could be +implemented easiest, point out solutions how the same thing can already be done +using other parts or why the proposed change breaks other parts of the system. +They might even refuse the idea altogether - after all, they have to sleep well +after merging the changes, too. + +The preferred way to discuss in the IRC channel ([#gluon] on irc.hackint.org) +or on the [mailing list], however, you can also open a new issue on Github to +discuss there. + +Develop on top of master +------------------------ +If you are not developing something specific to a release (like for example a +security fix to a feature that got completely rewritten since the release), +develop it on top of the master branch. New features and even feature changes +aren't usually backported to old releases, but will be included in the upcoming +release, which will be built from master. + +Use descriptive commit messages +------------------------------- +If you modify a single package, start the first line of your commit message +with the package name followed by a colon. The first line should be enough to +identify the commit a week later and still know roughly what it did. If you +fix some bug, detail in the remaining commit message exactly how it could be +triggered and what you did to fix it. If in question, have a glance at the +existing commit messages to get the idea. + +Squash commits +-------------- +Most changes are trivial enough to fit in one single commit in order to not +clutter the history. While developing a new feature, you are free to use +multiple commits, but if your feature is to be merged, reduce the number of +commits to a minimum. Even huge feature introductions like the 802.11s mesh +(commit 2a93c58) fit into a single commit. + +If you developed your change in multiple smaller commits, you can easily +[squash] those before opening the pull request. While discussing, it is okay to +do your changes using `git commit --amend` and force-push them to your head of +the pull request. This way, your change always consists of only one commit and +can be merged in the instant everybode is content with the whole thing. + + +[community repositories]: http://gluon.readthedocs.org/en/latest/user/site.html#packages +[#gluon]: irc://irc.hackint.org/gluon +[mailing list]: mailto:gluon@luebeck.freifunk.net +[squash]: https://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Squashing-Commits From 8e670bd3fd51601c45457b7b0aed90f982fe20b4 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Litza Date: Mon, 31 Aug 2015 19:56:00 +0200 Subject: [PATCH 089/867] Add patch "luci-lib-jsonc: Fix memory leak in stringify" --- ...-lib-jsonc-Fix-memory-leak-in-stringify.patch | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 patches/packages/luci/0006-luci-lib-jsonc-Fix-memory-leak-in-stringify.patch diff --git a/patches/packages/luci/0006-luci-lib-jsonc-Fix-memory-leak-in-stringify.patch b/patches/packages/luci/0006-luci-lib-jsonc-Fix-memory-leak-in-stringify.patch new file mode 100644 index 00000000..4e21055a --- /dev/null +++ b/patches/packages/luci/0006-luci-lib-jsonc-Fix-memory-leak-in-stringify.patch @@ -0,0 +1,16 @@ +From: Jan-Philipp Litza +Date: Mon, 31 Aug 2015 19:52:36 +0200 +Subject: luci-lib-jsonc: Fix memory leak in stringify() + +diff --git a/libs/luci-lib-jsonc/src/jsonc.c b/libs/luci-lib-jsonc/src/jsonc.c +index 971fb12..b857c97 100644 +--- a/libs/luci-lib-jsonc/src/jsonc.c ++++ b/libs/luci-lib-jsonc/src/jsonc.c +@@ -106,6 +106,7 @@ static int json_stringify(lua_State *L) + flags |= JSON_C_TO_STRING_PRETTY | JSON_C_TO_STRING_SPACED; + + lua_pushstring(L, json_object_to_json_string_ext(obj, flags)); ++ json_object_put(obj); + return 1; + } + From 280ea8d9bac70dfba6540ace409eeea470be3e47 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 1 Sep 2015 18:43:29 +0200 Subject: [PATCH 090/867] Update OpenWrt base --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 52aee2b1..275de030 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=81c67dc9c7ae92f2cbaa70c5633f3e8e6635e906 +OPENWRT_COMMIT=be73b965acbf449a10fe3e5d64238ca60cef71c3 PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git PACKAGES_OPENWRT_COMMIT=d32e986ef6ae6ac414a908d914a2230b1ecf482e From 91b3c1d371571cd67599a0f5649135d1e0899fcd Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 1 Sep 2015 19:55:43 +0200 Subject: [PATCH 091/867] mac80211: backport from trunk r46760 --- ...files-disable-reset-button-handling.patch} | 0 ...-mac80211-backport-from-trunk-r46760.patch | 20504 ++++++++++++++++ ...ditional-libopenssl-build-dependency.patch | 2 +- ...ty-firmware-as-an-additional-choice.patch} | 63 +- 4 files changed, 20526 insertions(+), 43 deletions(-) rename patches/openwrt/{0006-base-files-disable-reset-button-handling.patch => 0005-base-files-disable-reset-button-handling.patch} (100%) create mode 100644 patches/openwrt/0006-mac80211-backport-from-trunk-r46760.patch rename patches/openwrt/{0005-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch => 0023-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch} (63%) diff --git a/patches/openwrt/0006-base-files-disable-reset-button-handling.patch b/patches/openwrt/0005-base-files-disable-reset-button-handling.patch similarity index 100% rename from patches/openwrt/0006-base-files-disable-reset-button-handling.patch rename to patches/openwrt/0005-base-files-disable-reset-button-handling.patch diff --git a/patches/openwrt/0006-mac80211-backport-from-trunk-r46760.patch b/patches/openwrt/0006-mac80211-backport-from-trunk-r46760.patch new file mode 100644 index 00000000..03aa5c5e --- /dev/null +++ b/patches/openwrt/0006-mac80211-backport-from-trunk-r46760.patch @@ -0,0 +1,20504 @@ +From: Matthias Schiffer +Date: Tue, 1 Sep 2015 18:50:16 +0200 +Subject: mac80211: backport from trunk r46760 + +diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile +index a1eedce..04dfd3b 100644 +--- a/package/kernel/mac80211/Makefile ++++ b/package/kernel/mac80211/Makefile +@@ -10,11 +10,11 @@ include $(INCLUDE_DIR)/kernel.mk + + PKG_NAME:=mac80211 + +-PKG_VERSION:=2015-03-09 +-PKG_RELEASE:=3 ++PKG_VERSION:=2015-07-21 ++PKG_RELEASE:=1 + PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources + PKG_BACKPORT_VERSION:= +-PKG_MD5SUM:=6d4b04e4ce8a1f54dabfb04f4709453c ++PKG_MD5SUM:=ec529acfb9c942daf8116e5cff47c999 + + PKG_SOURCE:=compat-wireless-$(PKG_VERSION)$(PKG_BACKPORT_VERSION).tar.bz2 + PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/compat-wireless-$(PKG_VERSION) +@@ -31,7 +31,7 @@ PKG_DRIVERS = \ + mwl8k mwifiex-pcie net-hermes net-hermes-pci net-hermes-plx net-hermes-pcmcia \ + iwl-legacy iwl3945 iwl4965 iwlagn wlcore wl12xx wl18xx lib80211 \ + rtlwifi rtlwifi-pci rtlwifi-usb rtl8192c-common rtl8192ce rtl8192se \ +- rtl8192de rtl8192cu ++ rtl8192de rtl8192cu mt7601u + + PKG_CONFIG_DEPENDS:= \ + CONFIG_PACKAGE_kmod-mac80211 \ +@@ -60,7 +60,6 @@ define KernelPackage/mac80211/Default + SUBMENU:=$(WMENU) + URL:=https://wireless.wiki.kernel.org/ + MAINTAINER:=Felix Fietkau +- DEPENDS:=@!TARGET_uml + endef + + define KernelPackage/cfg80211 +@@ -79,7 +78,7 @@ endef + define KernelPackage/mac80211 + $(call KernelPackage/mac80211/Default) + TITLE:=Linux 802.11 Wireless Networking Stack +- DEPENDS+= +kmod-crypto-core +kmod-crypto-arc4 +kmod-crypto-aes +kmod-cfg80211 +hostapd-common ++ DEPENDS+= +kmod-crypto-core +kmod-crypto-arc4 +kmod-cfg80211 +hostapd-common + KCONFIG:=\ + CONFIG_AVERAGE=y + FILES:= $(PKG_BUILD_DIR)/net/mac80211/mac80211.ko +@@ -128,7 +127,7 @@ endef + $(eval $(call Download,linux-firmware)) + + PKG_ATH10K_LINUX_FIRMWARE_NAME:=ath10k-firmware +-PKG_ATH10K_LINUX_FIRMWARE_VERSION:=da0f85d924226ee30c46e037120621c9e192b39e ++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 +@@ -516,7 +515,7 @@ define KernelPackage/ath/config + bool "Atheros wireless debugging" + help + Say Y, if you want to debug atheros wireless drivers. +- Right now only ath9k makes use of this. ++ Only ath9k & ath10k make use of this. + + config PACKAGE_ATH_DFS + bool "Enable DFS support" +@@ -624,17 +623,9 @@ endef + define KernelPackage/ath10k/config + if PACKAGE_kmod-ath10k + +- config ATH10K_STA_FW +- bool "Firmware optimized for STA operation" +- default n +- help +- Use the ath10k firmware optimized for wireless client instead +- of access point operation. +- + config ATH10K_API2_FW + bool "Firmware optimized for AP operation (v10.1 / API v2)" + default n +- depends on !ATH10K_STA_FW + help + Use the ath10k firmware from the 10.1 SDK using API v2 optimized + for access point operation if the default firmware keeps crashing. +@@ -704,10 +695,31 @@ define KernelPackage/mac80211-hwsim + AUTOLOAD:=$(call AutoProbe,mac80211_hwsim) + endef + ++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)) ++ ++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 ++ + define KernelPackage/net-libipw + $(call KernelPackage/mac80211/Default) + TITLE:=libipw for ipw2100 and ipw2200 +- DEPENDS:=@PCI_SUPPORT +kmod-crypto-core +kmod-crypto-arc4 +kmod-crypto-aes +kmod-crypto-michael-mic +kmod-lib80211 +kmod-cfg80211 +@DRIVER_WEXT_SUPPORT @!BIG_ENDIAN ++ DEPENDS:=@PCI_SUPPORT +kmod-crypto-core +kmod-crypto-arc4 +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) + endef +@@ -1602,6 +1614,8 @@ config-$(CONFIG_BRCMFMAC_PCIE) += BRCMFMAC_PCIE + config-$(CONFIG_PACKAGE_BRCM80211_DEBUG) += BRCMDBG + + config-$(call config_package,mac80211-hwsim) += MAC80211_HWSIM ++config-$(call config_package,mt7601u) += MT7601U ++config-y += WL_MEDIATEK + + config-$(call config_package,rt2x00-lib) += RT2X00 RT2X00_LIB + config-$(call config_package,rt2x00-pci) += RT2X00_LIB_PCI +@@ -1704,6 +1718,7 @@ define Build/Prepare + $(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_ATH10K_LINUX_FIRMWARE_SOURCE) ++ $(TAR) -C $(PKG_BUILD_DIR) -xjf $(DL_DIR)/$(PKG_MT7601U_FW_SOURCE) + rm -rf \ + $(PKG_BUILD_DIR)/include/linux/ssb \ + $(PKG_BUILD_DIR)/include/linux/bcma \ +@@ -1866,21 +1881,24 @@ 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_STA_FW),y) +- $(INSTALL_DATA) \ +- $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/main/firmware-2.bin_999.999.0.636 \ +- $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin +-else ifeq ($(CONFIG_ATH10K_API2_FW),y) ++ifeq ($(CONFIG_ATH10K_API2_FW),y) + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.1/firmware-2.bin_10.1.467.2-1 \ + $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin + else + $(INSTALL_DATA) \ +- $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.2.4/firmware-4.bin_10.2.4.45 \ +- $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-4.bin ++ $(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 + 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) \ +@@ -2065,6 +2083,7 @@ $(eval $(call KernelPackage,rtl8192de)) + $(eval $(call KernelPackage,rtl8192cu)) + $(eval $(call KernelPackage,zd1211rw)) + $(eval $(call KernelPackage,mac80211-hwsim)) ++$(eval $(call KernelPackage,mt7601u)) + $(eval $(call KernelPackage,ath9k-common)) + $(eval $(call KernelPackage,ath9k)) + $(eval $(call KernelPackage,ath9k-htc)) +diff --git a/package/kernel/mac80211/files/regdb.txt b/package/kernel/mac80211/files/regdb.txt +index ba95fc6..84413fd 100644 +--- a/package/kernel/mac80211/files/regdb.txt ++++ b/package/kernel/mac80211/files/regdb.txt +@@ -6,7 +6,7 @@ country 00: + # 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 + (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 + (5170 - 5250 @ 80), (20), AUTO-BW + (5250 - 5330 @ 80), (20), DFS, AUTO-BW + (5490 - 5710 @ 160), (27), DFS ++ # 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 + (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 + (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 + + country RU: DFS-ETSI + (2402 - 2482 @ 40), (20) +- (5170 - 5250 @ 80), (20) +- (5250 - 5330 @ 80), (20), DFS +- (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) + + 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 + (5250 - 5330 @ 80), (20), DFS, AUTO-BW + (5490 - 5710 @ 160), (27), DFS + ++country WS: DFS-ETSI ++ (2402 - 2482 @ 40), (20) ++ (5170 - 5250 @ 40), (20) ++ (5250 - 5330 @ 40), (20), DFS ++ (5490 - 5710 @ 40), (27), DFS ++ + country YE: + (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 ++++ b/package/kernel/mac80211/patches/001-fix_build.patch +@@ -27,7 +27,7 @@ + @set -e ; test -f .local-symbols || ( \ + echo "/--------------" ;\ + echo "| You shouldn't run make in the backports tree, but only in" ;\ +-@@ -60,56 +62,60 @@ mrproper: ++@@ -60,57 +62,61 @@ mrproper: + echo "| (that isn't currently running.)" ;\ + echo "\\--" ;\ + false) +@@ -56,11 +56,12 @@ + - done \ + - ) > Kconfig.kernel ;\ + - kver=$$($(MAKE) --no-print-directory -C $(KLIB_BUILD) kernelversion | \ +-- sed 's/^\(\(3\|2\.6\)\.[0-9]\+\).*/\1/;t;d') ;\ ++- sed 's/^\(\([3-4]\|2\.6\)\.[0-9]\+\).*/\1/;t;d') ;\ + - test "$$kver" != "" || echo "Kernel version parse failed!" ;\ + - test "$$kver" != "" ;\ + - kvers="$$(seq 14 39 | sed 's/^/2.6./')" ;\ +-- kvers="$$kvers $$(seq 0 99 | sed 's/^/3./')" ;\ ++- kvers="$$kvers $$(seq 0 19 | sed 's/^/3./')" ;\ ++- kvers="$$kvers $$(seq 0 99 | sed 's/^/4./')" ;\ + - print=0 ;\ + - for v in $$kvers ; do \ + - if [ "$$print" = "1" ] ; then \ +@@ -111,11 +112,12 @@ + + + +Kconfig.versions: Kconfig.kernel + + @kver=$$($(MAKE) --no-print-directory -C $(KLIB_BUILD) kernelversion | \ +-+ sed 's/^\(\(3\|2\.6\)\.[0-9]\+\).*/\1/;t;d') ;\ +++ sed 's/^\(\([3-4]\|2\.6\)\.[0-9]\+\).*/\1/;t;d') ;\ + + test "$$kver" != "" || echo "Kernel version parse failed!" ;\ + + test "$$kver" != "" ;\ + + kvers="$$(seq 14 39 | sed 's/^/2.6./')" ;\ +-+ kvers="$$kvers $$(seq 0 99 | sed 's/^/3./')" ;\ +++ kvers="$$kvers $$(seq 0 19 | sed 's/^/3./')" ;\ +++ kvers="$$kvers $$(seq 0 99 | sed 's/^/4./')" ;\ + + print=0 ;\ + + for v in $$kvers ; do \ + + if [ "$$print" = "1" ] ; then \ +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 +--- a/package/kernel/mac80211/patches/004-backports_debugfs_fix.patch ++++ /dev/null +@@ -1,10 +0,0 @@ +---- a/backport-include/linux/debugfs.h +-+++ b/backport-include/linux/debugfs.h +-@@ -3,6 +3,7 @@ +- #include_next +- #include +- #include +-+#include +- +- #if defined(CONFIG_DEBUG_FS) +- struct dentry *debugfs_create_devm_seqfile(struct device *dev, const char *name, +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 +--- a/package/kernel/mac80211/patches/008-fix_netdev_unregister.patch ++++ /dev/null +@@ -1,16 +0,0 @@ +---- a/net/mac80211/iface.c +-+++ b/net/mac80211/iface.c +-@@ -1858,6 +1858,13 @@ void ieee80211_remove_interfaces(struct +- } +- mutex_unlock(&local->iflist_mtx); +- unregister_netdevice_many(&unreg_list); +-+#if (!(LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,45) && \ +-+ LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) && \ +-+ !(LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,9) && \ +-+ LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0)) && \ +-+ (LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0))) +-+ list_del(&unreg_list); +-+#endif +- +- list_for_each_entry_safe(sdata, tmp, &wdev_list, list) { +- list_del(&sdata->list); +diff --git a/package/kernel/mac80211/patches/020-add_mpls_h.patch b/package/kernel/mac80211/patches/020-add_mpls_h.patch +deleted file mode 100644 +index e5310bc..0000000 +--- a/package/kernel/mac80211/patches/020-add_mpls_h.patch ++++ /dev/null +@@ -1,37 +0,0 @@ +---- /dev/null +-+++ b/include/uapi/linux/mpls.h +-@@ -0,0 +1,34 @@ +-+#ifndef _UAPI_MPLS_H +-+#define _UAPI_MPLS_H +-+ +-+#include +-+#include +-+ +-+/* Reference: RFC 5462, RFC 3032 +-+ * +-+ * 0 1 2 3 +-+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+ * | Label | TC |S| TTL | +-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+ * +-+ * Label: Label Value, 20 bits +-+ * TC: Traffic Class field, 3 bits +-+ * S: Bottom of Stack, 1 bit +-+ * TTL: Time to Live, 8 bits +-+ */ +-+ +-+struct mpls_label { +-+ __be32 entry; +-+}; +-+ +-+#define MPLS_LS_LABEL_MASK 0xFFFFF000 +-+#define MPLS_LS_LABEL_SHIFT 12 +-+#define MPLS_LS_TC_MASK 0x00000E00 +-+#define MPLS_LS_TC_SHIFT 9 +-+#define MPLS_LS_S_MASK 0x00000100 +-+#define MPLS_LS_S_SHIFT 8 +-+#define MPLS_LS_TTL_MASK 0x000000FF +-+#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/045-bcma-from-4.1.patch b/package/kernel/mac80211/patches/045-bcma-from-4.1.patch +deleted file mode 100644 +index dce217f..0000000 +--- a/package/kernel/mac80211/patches/045-bcma-from-4.1.patch ++++ /dev/null +@@ -1,104 +0,0 @@ +---- a/drivers/bcma/driver_pci.c +-+++ b/drivers/bcma/driver_pci.c +-@@ -282,39 +282,6 @@ void bcma_core_pci_power_save(struct bcm +- } +- EXPORT_SYMBOL_GPL(bcma_core_pci_power_save); +- +--int bcma_core_pci_irq_ctl(struct bcma_bus *bus, struct bcma_device *core, +-- bool enable) +--{ +-- struct pci_dev *pdev; +-- u32 coremask, tmp; +-- int err = 0; +-- +-- if (bus->hosttype != BCMA_HOSTTYPE_PCI) { +-- /* This bcma device is not on a PCI host-bus. So the IRQs are +-- * not routed through the PCI core. +-- * So we must not enable routing through the PCI core. */ +-- goto out; +-- } +-- +-- pdev = bus->host_pci; +-- +-- err = pci_read_config_dword(pdev, BCMA_PCI_IRQMASK, &tmp); +-- if (err) +-- goto out; +-- +-- coremask = BIT(core->core_index) << 8; +-- if (enable) +-- tmp |= coremask; +-- else +-- tmp &= ~coremask; +-- +-- err = pci_write_config_dword(pdev, BCMA_PCI_IRQMASK, tmp); +-- +--out: +-- return err; +--} +--EXPORT_SYMBOL_GPL(bcma_core_pci_irq_ctl); +-- +- static void bcma_core_pci_extend_L1timer(struct bcma_drv_pci *pc, bool extend) +- { +- u32 w; +---- a/drivers/bcma/host_pci.c +-+++ b/drivers/bcma/host_pci.c +-@@ -351,3 +351,37 @@ void bcma_host_pci_down(struct bcma_bus +- bcma_core_pci_down(&bus->drv_pci[0]); +- } +- EXPORT_SYMBOL_GPL(bcma_host_pci_down); +-+ +-+/* See also si_pci_setup */ +-+int bcma_host_pci_irq_ctl(struct bcma_bus *bus, struct bcma_device *core, +-+ bool enable) +-+{ +-+ struct pci_dev *pdev; +-+ u32 coremask, tmp; +-+ int err = 0; +-+ +-+ if (bus->hosttype != BCMA_HOSTTYPE_PCI) { +-+ /* This bcma device is not on a PCI host-bus. So the IRQs are +-+ * not routed through the PCI core. +-+ * So we must not enable routing through the PCI core. */ +-+ goto out; +-+ } +-+ +-+ pdev = bus->host_pci; +-+ +-+ err = pci_read_config_dword(pdev, BCMA_PCI_IRQMASK, &tmp); +-+ if (err) +-+ goto out; +-+ +-+ coremask = BIT(core->core_index) << 8; +-+ if (enable) +-+ tmp |= coremask; +-+ else +-+ tmp &= ~coremask; +-+ +-+ err = pci_write_config_dword(pdev, BCMA_PCI_IRQMASK, tmp); +-+ +-+out: +-+ return err; +-+} +-+EXPORT_SYMBOL_GPL(bcma_host_pci_irq_ctl); +---- a/drivers/net/wireless/b43/main.c +-+++ b/drivers/net/wireless/b43/main.c +-@@ -4866,7 +4866,7 @@ static int b43_wireless_core_init(struct +- switch (dev->dev->bus_type) { +- #ifdef CPTCFG_B43_BCMA +- case B43_BUS_BCMA: +-- bcma_core_pci_irq_ctl(dev->dev->bdev->bus, +-+ bcma_host_pci_irq_ctl(dev->dev->bdev->bus, +- dev->dev->bdev, true); +- bcma_host_pci_up(dev->dev->bdev->bus); +- break; +---- a/drivers/net/wireless/brcm80211/brcmsmac/main.c +-+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c +-@@ -4959,7 +4959,7 @@ static int brcms_b_up_prep(struct brcms_ +- * Configure pci/pcmcia here instead of in brcms_c_attach() +- * to allow mfg hotswap: down, hotswap (chip power cycle), up. +- */ +-- bcma_core_pci_irq_ctl(wlc_hw->d11core->bus, wlc_hw->d11core, +-+ bcma_host_pci_irq_ctl(wlc_hw->d11core->bus, wlc_hw->d11core, +- true); +- +- /* +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 +--- 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 @@ + --- a/.local-symbols + +++ b/.local-symbols +-@@ -344,40 +344,3 @@ USB_CDC_PHONET= ++@@ -449,43 +449,6 @@ USB_CDC_PHONET= + USB_IPHETH= + USB_SIERRA_NET= + USB_VL600= +@@ -32,26 +32,18 @@ + -BCMA_BLOCKIO= + -BCMA_HOST_PCI_POSSIBLE= + -BCMA_HOST_PCI= +--BCMA_DRIVER_PCI_HOSTMODE= + -BCMA_HOST_SOC= + -BCMA_DRIVER_PCI= ++-BCMA_DRIVER_PCI_HOSTMODE= + -BCMA_DRIVER_MIPS= + -BCMA_SFLASH= + -BCMA_NFLASH= + -BCMA_DRIVER_GMAC_CMN= + -BCMA_DRIVER_GPIO= + -BCMA_DEBUG= +---- a/Makefile.kernel +-+++ b/Makefile.kernel +-@@ -38,8 +38,6 @@ obj-$(CPTCFG_MAC80211) += net/mac80211/ +- obj-$(CPTCFG_WLAN) += drivers/net/wireless/ +- #obj-$(CPTCFG_BT) += net/bluetooth/ +- #obj-$(CPTCFG_BT) += drivers/bluetooth/ +--obj-$(CPTCFG_SSB) += drivers/ssb/ +--obj-$(CPTCFG_BCMA) += drivers/bcma/ +- #obj-$(CPTCFG_ETHERNET) += drivers/net/ethernet/ +- obj-$(CPTCFG_USB_NET_RNDIS_WLAN) += drivers/net/usb/ +- #obj-$(CPTCFG_NFC) += net/nfc/ ++ NFC= ++ NFC_DIGITAL= ++ NFC_NCI= + --- a/drivers/net/wireless/b43/main.c + +++ b/drivers/net/wireless/b43/main.c + @@ -2866,7 +2866,7 @@ static struct ssb_device *b43_ssb_gpio_d +@@ -63,7 +55,7 @@ + return (bus->chipco.dev ? bus->chipco.dev : bus->pcicore.dev); + #else + return bus->chipco.dev; +-@@ -4907,7 +4907,7 @@ static int b43_wireless_core_init(struct ++@@ -4903,7 +4903,7 @@ static int b43_wireless_core_init(struct + } + if (sprom->boardflags_lo & B43_BFL_XTAL_NOSLOW) + hf |= B43_HF_DSCRQ; /* Disable slowclock requests from ucode. */ +@@ -116,12 +108,23 @@ + --- a/Kconfig.sources + +++ b/Kconfig.sources + @@ -9,9 +9,6 @@ source "$BACKPORT_DIR/drivers/net/wirele +- #source "$BACKPORT_DIR/drivers/net/ethernet/Kconfig" ++ source "$BACKPORT_DIR/drivers/net/ethernet/Kconfig" + source "$BACKPORT_DIR/drivers/net/usb/Kconfig" + + -source "$BACKPORT_DIR/drivers/ssb/Kconfig" + -source "$BACKPORT_DIR/drivers/bcma/Kconfig" + - +- #source "$BACKPORT_DIR/net/nfc/Kconfig" ++ source "$BACKPORT_DIR/net/nfc/Kconfig" + +- #source "$BACKPORT_DIR/drivers/media/Kconfig" ++ source "$BACKPORT_DIR/drivers/media/Kconfig" ++--- a/Makefile.kernel +++++ b/Makefile.kernel ++@@ -38,8 +38,6 @@ obj-$(CPTCFG_MAC80211) += net/mac80211/ ++ obj-$(CPTCFG_WLAN) += drivers/net/wireless/ ++ obj-$(CPTCFG_BT) += net/bluetooth/ ++ obj-$(CPTCFG_BT) += drivers/bluetooth/ ++-obj-$(CPTCFG_SSB) += drivers/ssb/ ++-obj-$(CPTCFG_BCMA) += drivers/bcma/ ++ 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/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 +--- a/package/kernel/mac80211/patches/090-linux_3_18_12_compat.patch ++++ /dev/null +@@ -1,29 +0,0 @@ +---- a/backport-include/linux/wait.h +-+++ b/backport-include/linux/wait.h +-@@ -23,7 +23,7 @@ backport_wait_on_bit_io(void *word, int +- +- #endif +- +--#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) +-+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,12) +- #define WQ_FLAG_WOKEN 0x02 +- +- #define wait_woken LINUX_BACKPORT(wait_woken) +---- a/compat/backport-3.19.c +-+++ b/compat/backport-3.19.c +-@@ -15,6 +15,7 @@ +- #include +- #include +- +-+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,12) +- static inline bool is_kthread_should_stop(void) +- { +- return (current->flags & PF_KTHREAD) && kthread_should_stop(); +-@@ -79,6 +80,7 @@ int woken_wake_function(wait_queue_t *wa +- return default_wake_function(wait, mode, sync, key); +- } +- EXPORT_SYMBOL(woken_wake_function); +-+#endif +- +- #ifdef __BACKPORT_NETDEV_RSS_KEY_FILL +- 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 +--- /dev/null ++++ b/package/kernel/mac80211/patches/100-remove-cryptoapi-dependencies.patch +@@ -0,0 +1,376 @@ ++--- a/net/mac80211/Kconfig +++++ b/net/mac80211/Kconfig ++@@ -5,8 +5,6 @@ config MAC80211 ++ depends on CRYPTO ++ depends on CRYPTO_ARC4 ++ depends on CRYPTO_AES ++- select BPAUTO_CRYPTO_CCM ++- depends on CRYPTO_GCM ++ depends on CRC32 ++ select BPAUTO_AVERAGE ++ ---help--- ++--- a/net/mac80211/Makefile +++++ b/net/mac80211/Makefile ++@@ -15,9 +15,7 @@ mac80211-y := \ ++ michael.o \ ++ tkip.o \ ++ aes_ccm.o \ ++- aes_gcm.o \ ++ aes_cmac.o \ ++- aes_gmac.o \ ++ cfg.o \ ++ ethtool.o \ ++ rx.o \ ++--- a/net/mac80211/aes_ccm.c +++++ b/net/mac80211/aes_ccm.c ++@@ -13,89 +13,132 @@ ++ #include ++ #include ++ #include +++#include ++ ++ #include ++ #include "key.h" ++ #include "aes_ccm.h" ++ ++-void ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, ++- u8 *data, size_t data_len, u8 *mic, ++- size_t mic_len) +++static void aes_ccm_prepare(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, u8 *s_0, +++ u8 *a, u8 *b) ++ { ++- struct scatterlist sg[3]; +++ int i; +++ +++ crypto_cipher_encrypt_one(tfm, b, b_0); +++ +++ /* Extra Authenticate-only data (always two AES blocks) */ +++ for (i = 0; i < AES_BLOCK_SIZE; i++) +++ aad[i] ^= b[i]; +++ crypto_cipher_encrypt_one(tfm, b, aad); +++ +++ aad += AES_BLOCK_SIZE; +++ +++ for (i = 0; i < AES_BLOCK_SIZE; i++) +++ aad[i] ^= b[i]; +++ crypto_cipher_encrypt_one(tfm, a, aad); ++ ++- char aead_req_data[sizeof(struct aead_request) + ++- crypto_aead_reqsize(tfm)] ++- __aligned(__alignof__(struct aead_request)); ++- struct aead_request *aead_req = (void *) aead_req_data; +++ /* Mask out bits from auth-only-b_0 */ +++ b_0[0] &= 0x07; ++ ++- memset(aead_req, 0, sizeof(aead_req_data)); +++ /* S_0 is used to encrypt T (= MIC) */ +++ b_0[14] = 0; +++ b_0[15] = 0; +++ crypto_cipher_encrypt_one(tfm, s_0, b_0); +++} ++ ++- sg_init_table(sg, 3); ++- sg_set_buf(&sg[0], &aad[2], be16_to_cpup((__be16 *)aad)); ++- sg_set_buf(&sg[1], data, data_len); ++- sg_set_buf(&sg[2], mic, mic_len); ++ ++- aead_request_set_tfm(aead_req, tfm); ++- aead_request_set_crypt(aead_req, sg, sg, data_len, b_0); ++- aead_request_set_ad(aead_req, sg[0].length); +++void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, +++ u8 *data, size_t data_len, u8 *mic, +++ size_t mic_len) +++{ +++ int i, j, last_len, num_blocks; +++ u8 b[AES_BLOCK_SIZE]; +++ u8 s_0[AES_BLOCK_SIZE]; +++ u8 e[AES_BLOCK_SIZE]; +++ u8 *pos, *cpos; +++ +++ num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_SIZE); +++ last_len = data_len % AES_BLOCK_SIZE; +++ aes_ccm_prepare(tfm, b_0, aad, s_0, b, b); +++ +++ /* Process payload blocks */ +++ pos = data; +++ cpos = data; +++ for (j = 1; j <= num_blocks; j++) { +++ int blen = (j == num_blocks && last_len) ? +++ last_len : AES_BLOCK_SIZE; +++ +++ /* Authentication followed by encryption */ +++ for (i = 0; i < blen; i++) +++ b[i] ^= pos[i]; +++ crypto_cipher_encrypt_one(tfm, b, b); +++ +++ b_0[14] = (j >> 8) & 0xff; +++ b_0[15] = j & 0xff; +++ crypto_cipher_encrypt_one(tfm, e, b_0); +++ for (i = 0; i < blen; i++) +++ *cpos++ = *pos++ ^ e[i]; +++ } ++ ++- crypto_aead_encrypt(aead_req); +++ for (i = 0; i < mic_len; i++) +++ mic[i] = b[i] ^ s_0[i]; ++ } ++ ++-int ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, +++int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, ++ u8 *data, size_t data_len, u8 *mic, ++ size_t mic_len) ++ { ++- struct scatterlist sg[3]; ++- char aead_req_data[sizeof(struct aead_request) + ++- crypto_aead_reqsize(tfm)] ++- __aligned(__alignof__(struct aead_request)); ++- struct aead_request *aead_req = (void *) aead_req_data; ++- ++- if (data_len == 0) ++- return -EINVAL; ++- ++- memset(aead_req, 0, sizeof(aead_req_data)); ++- ++- sg_init_table(sg, 3); ++- sg_set_buf(&sg[0], &aad[2], be16_to_cpup((__be16 *)aad)); ++- sg_set_buf(&sg[1], data, data_len); ++- sg_set_buf(&sg[2], mic, mic_len); ++- ++- aead_request_set_tfm(aead_req, tfm); ++- aead_request_set_crypt(aead_req, sg, sg, data_len + mic_len, b_0); ++- aead_request_set_ad(aead_req, sg[0].length); +++ int i, j, last_len, num_blocks; +++ u8 *pos, *cpos; +++ u8 a[AES_BLOCK_SIZE]; +++ u8 b[AES_BLOCK_SIZE]; +++ u8 s_0[AES_BLOCK_SIZE]; +++ +++ num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_SIZE); +++ last_len = data_len % AES_BLOCK_SIZE; +++ aes_ccm_prepare(tfm, b_0, aad, s_0, a, b); +++ +++ /* Process payload blocks */ +++ cpos = data; +++ pos = data; +++ for (j = 1; j <= num_blocks; j++) { +++ int blen = (j == num_blocks && last_len) ? +++ last_len : AES_BLOCK_SIZE; +++ +++ /* Decryption followed by authentication */ +++ b_0[14] = (j >> 8) & 0xff; +++ b_0[15] = j & 0xff; +++ crypto_cipher_encrypt_one(tfm, b, b_0); +++ for (i = 0; i < blen; i++) { +++ *pos = *cpos++ ^ b[i]; +++ a[i] ^= *pos++; +++ } +++ crypto_cipher_encrypt_one(tfm, a, a); +++ } +++ +++ for (i = 0; i < mic_len; i++) { +++ if ((mic[i] ^ s_0[i]) != a[i]) +++ return -1; +++ } ++ ++- return crypto_aead_decrypt(aead_req); +++ return 0; ++ } ++ ++-struct crypto_aead *ieee80211_aes_key_setup_encrypt(const u8 key[], ++- size_t key_len, ++- size_t mic_len) +++struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[], +++ size_t key_len, +++ size_t mic_len) ++ { ++- struct crypto_aead *tfm; ++- int err; +++ struct crypto_cipher *tfm; ++ ++- tfm = crypto_alloc_aead("ccm(aes)", 0, CRYPTO_ALG_ASYNC); ++- if (IS_ERR(tfm)) ++- return tfm; ++- ++- err = crypto_aead_setkey(tfm, key, key_len); ++- if (err) ++- goto free_aead; ++- err = crypto_aead_setauthsize(tfm, mic_len); ++- if (err) ++- goto free_aead; +++ tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC); +++ if (!IS_ERR(tfm)) +++ crypto_cipher_setkey(tfm, key, key_len); ++ ++ return tfm; ++- ++-free_aead: ++- crypto_free_aead(tfm); ++- return ERR_PTR(err); ++ } ++ ++-void ieee80211_aes_key_free(struct crypto_aead *tfm) +++ +++void ieee80211_aes_key_free(struct crypto_cipher *tfm) ++ { ++- crypto_free_aead(tfm); +++ crypto_free_cipher(tfm); ++ } ++--- a/net/mac80211/aes_ccm.h +++++ b/net/mac80211/aes_ccm.h ++@@ -12,15 +12,15 @@ ++ ++ #include ++ ++-struct crypto_aead *ieee80211_aes_key_setup_encrypt(const u8 key[], ++- size_t key_len, ++- size_t mic_len); ++-void ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, +++struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[], +++ size_t key_len, +++ size_t mic_len); +++void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, ++ u8 *data, size_t data_len, u8 *mic, ++ size_t mic_len); ++-int ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, +++int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, ++ u8 *data, size_t data_len, u8 *mic, ++ size_t mic_len); ++-void ieee80211_aes_key_free(struct crypto_aead *tfm); +++void ieee80211_aes_key_free(struct crypto_cipher *tfm); ++ ++ #endif /* AES_CCM_H */ ++--- a/net/mac80211/aes_gcm.h +++++ b/net/mac80211/aes_gcm.h ++@@ -11,12 +11,28 @@ ++ ++ #include ++ ++-void ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, ++- u8 *data, size_t data_len, u8 *mic); ++-int ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, ++- u8 *data, size_t data_len, u8 *mic); ++-struct crypto_aead *ieee80211_aes_gcm_key_setup_encrypt(const u8 key[], ++- size_t key_len); ++-void ieee80211_aes_gcm_key_free(struct crypto_aead *tfm); +++static inline void +++ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, +++ u8 *data, size_t data_len, u8 *mic) +++{ +++} +++ +++static inline int +++ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, +++ u8 *data, size_t data_len, u8 *mic) +++{ +++ return -EOPNOTSUPP; +++} +++ +++static inline struct crypto_aead * +++ieee80211_aes_gcm_key_setup_encrypt(const u8 key[], size_t key_len) +++{ +++ return NULL; +++} +++ +++static inline void +++ieee80211_aes_gcm_key_free(struct crypto_aead *tfm) +++{ +++} ++ ++ #endif /* AES_GCM_H */ ++--- a/net/mac80211/aes_gmac.h +++++ b/net/mac80211/aes_gmac.h ++@@ -11,10 +11,22 @@ ++ ++ #include ++ ++-struct crypto_aead *ieee80211_aes_gmac_key_setup(const u8 key[], ++- size_t key_len); ++-int ieee80211_aes_gmac(struct crypto_aead *tfm, const u8 *aad, u8 *nonce, ++- const u8 *data, size_t data_len, u8 *mic); ++-void ieee80211_aes_gmac_key_free(struct crypto_aead *tfm); +++static inline struct crypto_aead * +++ieee80211_aes_gmac_key_setup(const u8 key[], size_t key_len) +++{ +++ return NULL; +++} +++ +++static inline int +++ieee80211_aes_gmac(struct crypto_aead *tfm, const u8 *aad, u8 *nonce, +++ const u8 *data, size_t data_len, u8 *mic) +++{ +++ return -EOPNOTSUPP; +++} +++ +++static inline void +++ieee80211_aes_gmac_key_free(struct crypto_aead *tfm) +++{ +++} ++ ++ #endif /* AES_GMAC_H */ ++--- a/net/mac80211/key.h +++++ b/net/mac80211/key.h ++@@ -84,7 +84,7 @@ struct ieee80211_key { ++ * Management frames. ++ */ ++ u8 rx_pn[IEEE80211_NUM_TIDS + 1][IEEE80211_CCMP_PN_LEN]; ++- struct crypto_aead *tfm; +++ struct crypto_cipher *tfm; ++ u32 replays; /* dot11RSNAStatsCCMPReplays */ ++ } ccmp; ++ struct { ++--- a/net/mac80211/wpa.c +++++ b/net/mac80211/wpa.c ++@@ -304,7 +304,8 @@ ieee80211_crypto_tkip_decrypt(struct iee ++ } ++ ++ ++-static void ccmp_special_blocks(struct sk_buff *skb, u8 *pn, u8 *b_0, u8 *aad) +++static void ccmp_special_blocks(struct sk_buff *skb, u8 *pn, u8 *b_0, u8 *aad, +++ u16 data_len) ++ { ++ __le16 mask_fc; ++ int a4_included, mgmt; ++@@ -334,14 +335,8 @@ static void ccmp_special_blocks(struct s ++ else ++ qos_tid = 0; ++ ++- /* In CCM, the initial vectors (IV) used for CTR mode encryption and CBC ++- * mode authentication are not allowed to collide, yet both are derived ++- * from this vector b_0. We only set L := 1 here to indicate that the ++- * data size can be represented in (L+1) bytes. The CCM layer will take ++- * care of storing the data length in the top (L+1) bytes and setting ++- * and clearing the other bits as is required to derive the two IVs. ++- */ ++- b_0[0] = 0x1; +++ /* First block, b_0 */ +++ b_0[0] = 0x59; /* flags: Adata: 1, M: 011, L: 001 */ ++ ++ /* 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 ++ b_0[1] = qos_tid | (mgmt << 4); ++ memcpy(&b_0[2], hdr->addr2, ETH_ALEN); ++ memcpy(&b_0[8], pn, IEEE80211_CCMP_PN_LEN); +++ /* l(m) */ +++ put_unaligned_be16(data_len, &b_0[14]); ++ ++ /* 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 ++ return 0; ++ ++ pos += IEEE80211_CCMP_HDR_LEN; ++- ccmp_special_blocks(skb, pn, b_0, aad); +++ ccmp_special_blocks(skb, pn, b_0, aad, len); ++ 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 ++ u8 aad[2 * AES_BLOCK_SIZE]; ++ u8 b_0[AES_BLOCK_SIZE]; ++ /* hardware didn't decrypt/verify MIC */ ++- ccmp_special_blocks(skb, pn, b_0, aad); +++ ccmp_special_blocks(skb, pn, b_0, aad, data_len); ++ ++ if (ieee80211_aes_ccm_decrypt( ++ key->u.ccmp.tfm, b_0, aad, +diff --git a/package/kernel/mac80211/patches/100-revert-cryptoapi-ports.patch b/package/kernel/mac80211/patches/100-revert-cryptoapi-ports.patch +deleted file mode 100644 +index ceca952..0000000 +--- a/package/kernel/mac80211/patches/100-revert-cryptoapi-ports.patch ++++ /dev/null +@@ -1,2055 +0,0 @@ +-This patch reverts the following commits from wireless-testing: +- +-8ade538bf39b1ee53418528fdacd36b8e65621b9 +-56c52da2d554f081e8fce58ecbcf6a40c605b95b +-2b2ba0db1c820d04d5143452d70012cd44d7b578 +-00b9cfa3ff38401bd70c34b250ca13e5ea347b4a +-4f031fa9f188b2b0641ac20087d9e16bcfb4e49d +-6e1ee5d2e9e411892b5d84e3ea93e3fc88ac786c +-30ef7ef9672d92ab2cac37f60a31955c118321e7 +-f359d3fe832e49eeec2232b2af5a9e3aee6b4862 (only the changes in aes_cmac.{c,h}) +-7ec7c4a9a686c608315739ab6a2b0527a240883c +---- +- +---- a/include/linux/ieee80211.h +-+++ b/include/linux/ieee80211.h +-@@ -1017,15 +1017,6 @@ struct ieee80211_mmie { +- u8 mic[8]; +- } __packed; +- +--/* Management MIC information element (IEEE 802.11w) for GMAC and CMAC-256 */ +--struct ieee80211_mmie_16 { +-- u8 element_id; +-- u8 length; +-- __le16 key_id; +-- u8 sequence_number[6]; +-- u8 mic[16]; +--} __packed; +-- +- struct ieee80211_vendor_ie { +- u8 element_id; +- u8 len; +---- a/include/net/mac80211.h +-+++ b/include/net/mac80211.h +-@@ -1306,8 +1306,8 @@ struct ieee80211_vif *wdev_to_ieee80211_ +- * @IEEE80211_KEY_FLAG_PAIRWISE: Set by mac80211, this flag indicates +- * that the key is pairwise rather then a shared key. +- * @IEEE80211_KEY_FLAG_SW_MGMT_TX: This flag should be set by the driver for a +-- * CCMP/GCMP key if it requires CCMP/GCMP encryption of management frames +-- * (MFP) to be done in software. +-+ * CCMP key if it requires CCMP encryption of management frames (MFP) to +-+ * be done in software. +- * @IEEE80211_KEY_FLAG_PUT_IV_SPACE: This flag should be set by the driver +- * if space should be prepared for the IV, but the IV +- * itself should not be generated. Do not set together with +-@@ -1322,7 +1322,7 @@ struct ieee80211_vif *wdev_to_ieee80211_ +- * RX, if your crypto engine can't deal with TX you can also set the +- * %IEEE80211_KEY_FLAG_SW_MGMT_TX flag to encrypt such frames in SW. +- * @IEEE80211_KEY_FLAG_GENERATE_IV_MGMT: This flag should be set by the +-- * driver for a CCMP/GCMP key to indicate that is requires IV generation +-+ * driver for a CCMP key to indicate that is requires IV generation +- * only for managment frames (MFP). +- * @IEEE80211_KEY_FLAG_RESERVE_TAILROOM: This flag should be set by the +- * driver for a key to indicate that sufficient tailroom must always +-@@ -4112,10 +4112,6 @@ void ieee80211_aes_cmac_calculate_k1_k2( +- * reverse order than in packet) +- * @aes_cmac: PN data, most significant byte first (big endian, +- * reverse order than in packet) +-- * @aes_gmac: PN data, most significant byte first (big endian, +-- * reverse order than in packet) +-- * @gcmp: PN data, most significant byte first (big endian, +-- * reverse order than in packet) +- */ +- struct ieee80211_key_seq { +- union { +-@@ -4129,12 +4125,6 @@ struct ieee80211_key_seq { +- struct { +- u8 pn[6]; +- } aes_cmac; +-- struct { +-- u8 pn[6]; +-- } aes_gmac; +-- struct { +-- u8 pn[6]; +-- } gcmp; +- }; +- }; +- +-@@ -4159,7 +4149,7 @@ void ieee80211_get_key_tx_seq(struct iee +- * ieee80211_get_key_rx_seq - get key RX sequence counter +- * +- * @keyconf: the parameter passed with the set key +-- * @tid: The TID, or -1 for the management frame value (CCMP/GCMP only); +-+ * @tid: The TID, or -1 for the management frame value (CCMP only); +- * the value on TID 0 is also used for non-QoS frames. For +- * CMAC, only TID 0 is valid. +- * @seq: buffer to receive the sequence data +-@@ -4195,7 +4185,7 @@ void ieee80211_set_key_tx_seq(struct iee +- * ieee80211_set_key_rx_seq - set key RX sequence counter +- * +- * @keyconf: the parameter passed with the set key +-- * @tid: The TID, or -1 for the management frame value (CCMP/GCMP only); +-+ * @tid: The TID, or -1 for the management frame value (CCMP only); +- * the value on TID 0 is also used for non-QoS frames. For +- * CMAC, only TID 0 is valid. +- * @seq: new sequence data +---- a/net/mac80211/Kconfig +-+++ b/net/mac80211/Kconfig +-@@ -5,8 +5,6 @@ config MAC80211 +- depends on CRYPTO +- depends on CRYPTO_ARC4 +- depends on CRYPTO_AES +-- select BPAUTO_CRYPTO_CCM +-- depends on CRYPTO_GCM +- depends on CRC32 +- select BPAUTO_AVERAGE +- ---help--- +---- a/net/mac80211/Makefile +-+++ b/net/mac80211/Makefile +-@@ -15,9 +15,7 @@ mac80211-y := \ +- michael.o \ +- tkip.o \ +- aes_ccm.o \ +-- aes_gcm.o \ +- aes_cmac.o \ +-- aes_gmac.o \ +- cfg.o \ +- ethtool.o \ +- rx.o \ +---- a/net/mac80211/aes_ccm.c +-+++ b/net/mac80211/aes_ccm.c +-@@ -2,8 +2,6 @@ +- * Copyright 2003-2004, Instant802 Networks, Inc. +- * Copyright 2005-2006, Devicescape Software, Inc. +- * +-- * Rewrite: Copyright (C) 2013 Linaro Ltd +-- * +- * 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. +-@@ -19,82 +17,134 @@ +- #include "key.h" +- #include "aes_ccm.h" +- +--void ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, +-- u8 *data, size_t data_len, u8 *mic, +-- size_t mic_len) +-+static void aes_ccm_prepare(struct crypto_cipher *tfm, u8 *scratch, u8 *a) +-+{ +-+ int i; +-+ u8 *b_0, *aad, *b, *s_0; +-+ +-+ b_0 = scratch + 3 * AES_BLOCK_SIZE; +-+ aad = scratch + 4 * AES_BLOCK_SIZE; +-+ b = scratch; +-+ s_0 = scratch + AES_BLOCK_SIZE; +-+ +-+ crypto_cipher_encrypt_one(tfm, b, b_0); +-+ +-+ /* Extra Authenticate-only data (always two AES blocks) */ +-+ for (i = 0; i < AES_BLOCK_SIZE; i++) +-+ aad[i] ^= b[i]; +-+ crypto_cipher_encrypt_one(tfm, b, aad); +-+ +-+ aad += AES_BLOCK_SIZE; +-+ +-+ for (i = 0; i < AES_BLOCK_SIZE; i++) +-+ aad[i] ^= b[i]; +-+ crypto_cipher_encrypt_one(tfm, a, aad); +-+ +-+ /* Mask out bits from auth-only-b_0 */ +-+ b_0[0] &= 0x07; +-+ +-+ /* S_0 is used to encrypt T (= MIC) */ +-+ b_0[14] = 0; +-+ b_0[15] = 0; +-+ crypto_cipher_encrypt_one(tfm, s_0, b_0); +-+} +-+ +-+ +-+void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *scratch, +-+ u8 *data, size_t data_len, +-+ u8 *cdata, u8 *mic) +- { +-- struct scatterlist assoc, pt, ct[2]; +-+ int i, j, last_len, num_blocks; +-+ u8 *pos, *cpos, *b, *s_0, *e, *b_0; +- +-- char aead_req_data[sizeof(struct aead_request) + +-- crypto_aead_reqsize(tfm)] +-- __aligned(__alignof__(struct aead_request)); +-- struct aead_request *aead_req = (void *) aead_req_data; +-- +-- memset(aead_req, 0, sizeof(aead_req_data)); +-- +-- sg_init_one(&pt, data, data_len); +-- sg_init_one(&assoc, &aad[2], be16_to_cpup((__be16 *)aad)); +-- sg_init_table(ct, 2); +-- sg_set_buf(&ct[0], data, data_len); +-- sg_set_buf(&ct[1], mic, mic_len); +-- +-- aead_request_set_tfm(aead_req, tfm); +-- aead_request_set_assoc(aead_req, &assoc, assoc.length); +-- aead_request_set_crypt(aead_req, &pt, ct, data_len, b_0); +-+ b = scratch; +-+ s_0 = scratch + AES_BLOCK_SIZE; +-+ e = scratch + 2 * AES_BLOCK_SIZE; +-+ b_0 = scratch + 3 * AES_BLOCK_SIZE; +-+ +-+ num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_SIZE); +-+ last_len = data_len % AES_BLOCK_SIZE; +-+ aes_ccm_prepare(tfm, scratch, b); +-+ +-+ /* Process payload blocks */ +-+ pos = data; +-+ cpos = cdata; +-+ for (j = 1; j <= num_blocks; j++) { +-+ int blen = (j == num_blocks && last_len) ? +-+ last_len : AES_BLOCK_SIZE; +-+ +-+ /* Authentication followed by encryption */ +-+ for (i = 0; i < blen; i++) +-+ b[i] ^= pos[i]; +-+ crypto_cipher_encrypt_one(tfm, b, b); +-+ +-+ b_0[14] = (j >> 8) & 0xff; +-+ b_0[15] = j & 0xff; +-+ crypto_cipher_encrypt_one(tfm, e, b_0); +-+ for (i = 0; i < blen; i++) +-+ *cpos++ = *pos++ ^ e[i]; +-+ } +- +-- crypto_aead_encrypt(aead_req); +-+ for (i = 0; i < IEEE80211_CCMP_MIC_LEN; i++) +-+ mic[i] = b[i] ^ s_0[i]; +- } +- +--int ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, +-- u8 *data, size_t data_len, u8 *mic, +-- size_t mic_len) +-+ +-+int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *scratch, +-+ u8 *cdata, size_t data_len, u8 *mic, u8 *data) +- { +-- struct scatterlist assoc, pt, ct[2]; +-- char aead_req_data[sizeof(struct aead_request) + +-- crypto_aead_reqsize(tfm)] +-- __aligned(__alignof__(struct aead_request)); +-- struct aead_request *aead_req = (void *) aead_req_data; +-- +-- if (data_len == 0) +-- return -EINVAL; +-- +-- memset(aead_req, 0, sizeof(aead_req_data)); +-- +-- sg_init_one(&pt, data, data_len); +-- sg_init_one(&assoc, &aad[2], be16_to_cpup((__be16 *)aad)); +-- sg_init_table(ct, 2); +-- sg_set_buf(&ct[0], data, data_len); +-- sg_set_buf(&ct[1], mic, mic_len); +-- +-- aead_request_set_tfm(aead_req, tfm); +-- aead_request_set_assoc(aead_req, &assoc, assoc.length); +-- aead_request_set_crypt(aead_req, ct, &pt, data_len + mic_len, b_0); +-+ int i, j, last_len, num_blocks; +-+ u8 *pos, *cpos, *b, *s_0, *a, *b_0; +-+ +-+ b = scratch; +-+ s_0 = scratch + AES_BLOCK_SIZE; +-+ a = scratch + 2 * AES_BLOCK_SIZE; +-+ b_0 = scratch + 3 * AES_BLOCK_SIZE; +-+ +-+ num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_SIZE); +-+ last_len = data_len % AES_BLOCK_SIZE; +-+ aes_ccm_prepare(tfm, scratch, a); +-+ +-+ /* Process payload blocks */ +-+ cpos = cdata; +-+ pos = data; +-+ for (j = 1; j <= num_blocks; j++) { +-+ int blen = (j == num_blocks && last_len) ? +-+ last_len : AES_BLOCK_SIZE; +-+ +-+ /* Decryption followed by authentication */ +-+ b_0[14] = (j >> 8) & 0xff; +-+ b_0[15] = j & 0xff; +-+ crypto_cipher_encrypt_one(tfm, b, b_0); +-+ for (i = 0; i < blen; i++) { +-+ *pos = *cpos++ ^ b[i]; +-+ a[i] ^= *pos++; +-+ } +-+ crypto_cipher_encrypt_one(tfm, a, a); +-+ } +-+ +-+ for (i = 0; i < IEEE80211_CCMP_MIC_LEN; i++) { +-+ if ((mic[i] ^ s_0[i]) != a[i]) +-+ return -1; +-+ } +- +-- return crypto_aead_decrypt(aead_req); +-+ return 0; +- } +- +--struct crypto_aead *ieee80211_aes_key_setup_encrypt(const u8 key[], +-- size_t key_len, +-- size_t mic_len) +-+ +-+struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[]) +- { +-- struct crypto_aead *tfm; +-- int err; +-+ struct crypto_cipher *tfm; +- +-- tfm = crypto_alloc_aead("ccm(aes)", 0, CRYPTO_ALG_ASYNC); +-- if (IS_ERR(tfm)) +-- return tfm; +-- +-- err = crypto_aead_setkey(tfm, key, key_len); +-- if (!err) +-- err = crypto_aead_setauthsize(tfm, mic_len); +-- if (!err) +-- return tfm; +-+ tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC); +-+ if (!IS_ERR(tfm)) +-+ crypto_cipher_setkey(tfm, key, WLAN_KEY_LEN_CCMP); +- +-- crypto_free_aead(tfm); +-- return ERR_PTR(err); +-+ return tfm; +- } +- +--void ieee80211_aes_key_free(struct crypto_aead *tfm) +-+ +-+void ieee80211_aes_key_free(struct crypto_cipher *tfm) +- { +-- crypto_free_aead(tfm); +-+ crypto_free_cipher(tfm); +- } +---- a/net/mac80211/aes_ccm.h +-+++ b/net/mac80211/aes_ccm.h +-@@ -12,15 +12,13 @@ +- +- #include +- +--struct crypto_aead *ieee80211_aes_key_setup_encrypt(const u8 key[], +-- size_t key_len, +-- size_t mic_len); +--void ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, +-- u8 *data, size_t data_len, u8 *mic, +-- size_t mic_len); +--int ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, +-- u8 *data, size_t data_len, u8 *mic, +-- size_t mic_len); +--void ieee80211_aes_key_free(struct crypto_aead *tfm); +-+struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[]); +-+void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *scratch, +-+ u8 *data, size_t data_len, +-+ u8 *cdata, u8 *mic); +-+int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *scratch, +-+ u8 *cdata, size_t data_len, +-+ u8 *mic, u8 *data); +-+void ieee80211_aes_key_free(struct crypto_cipher *tfm); +- +- #endif /* AES_CCM_H */ +---- a/net/mac80211/aes_cmac.c +-+++ b/net/mac80211/aes_cmac.c +-@@ -18,8 +18,8 @@ +- #include "key.h" +- #include "aes_cmac.h" +- +-+#define AES_CMAC_KEY_LEN 16 +- #define CMAC_TLEN 8 /* CMAC TLen = 64 bits (8 octets) */ +--#define CMAC_TLEN_256 16 /* CMAC TLen = 128 bits (16 octets) */ +- #define AAD_LEN 20 +- +- +-@@ -35,9 +35,9 @@ static void gf_mulx(u8 *pad) +- pad[AES_BLOCK_SIZE - 1] ^= 0x87; +- } +- +--static void aes_cmac_vector(struct crypto_cipher *tfm, size_t num_elem, +-- const u8 *addr[], const size_t *len, u8 *mac, +-- size_t mac_len) +-+ +-+static void aes_128_cmac_vector(struct crypto_cipher *tfm, size_t num_elem, +-+ const u8 *addr[], const size_t *len, u8 *mac) +- { +- u8 cbc[AES_BLOCK_SIZE], pad[AES_BLOCK_SIZE]; +- const u8 *pos, *end; +-@@ -88,7 +88,7 @@ static void aes_cmac_vector(struct crypt +- for (i = 0; i < AES_BLOCK_SIZE; i++) +- pad[i] ^= cbc[i]; +- crypto_cipher_encrypt_one(tfm, pad, pad); +-- memcpy(mac, pad, mac_len); +-+ memcpy(mac, pad, CMAC_TLEN); +- } +- +- +-@@ -107,35 +107,17 @@ void ieee80211_aes_cmac(struct crypto_ci +- addr[2] = zero; +- len[2] = CMAC_TLEN; +- +-- aes_cmac_vector(tfm, 3, addr, len, mic, CMAC_TLEN); +-+ aes_128_cmac_vector(tfm, 3, addr, len, mic); +- } +- +--void ieee80211_aes_cmac_256(struct crypto_cipher *tfm, const u8 *aad, +-- const u8 *data, size_t data_len, u8 *mic) +--{ +-- const u8 *addr[3]; +-- size_t len[3]; +-- u8 zero[CMAC_TLEN_256]; +-- +-- memset(zero, 0, CMAC_TLEN_256); +-- addr[0] = aad; +-- len[0] = AAD_LEN; +-- addr[1] = data; +-- len[1] = data_len - CMAC_TLEN_256; +-- addr[2] = zero; +-- len[2] = CMAC_TLEN_256; +-- +-- aes_cmac_vector(tfm, 3, addr, len, mic, CMAC_TLEN_256); +--} +- +--struct crypto_cipher *ieee80211_aes_cmac_key_setup(const u8 key[], +-- size_t key_len) +-+struct crypto_cipher * ieee80211_aes_cmac_key_setup(const u8 key[]) +- { +- struct crypto_cipher *tfm; +- +- tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC); +- if (!IS_ERR(tfm)) +-- crypto_cipher_setkey(tfm, key, key_len); +-+ crypto_cipher_setkey(tfm, key, AES_CMAC_KEY_LEN); +- +- return tfm; +- } +---- a/net/mac80211/aes_cmac.h +-+++ b/net/mac80211/aes_cmac.h +-@@ -11,12 +11,9 @@ +- +- #include +- +--struct crypto_cipher *ieee80211_aes_cmac_key_setup(const u8 key[], +-- size_t key_len); +-+struct crypto_cipher * ieee80211_aes_cmac_key_setup(const u8 key[]); +- void ieee80211_aes_cmac(struct crypto_cipher *tfm, const u8 *aad, +- const u8 *data, size_t data_len, u8 *mic); +--void ieee80211_aes_cmac_256(struct crypto_cipher *tfm, const u8 *aad, +-- const u8 *data, size_t data_len, u8 *mic); +- void ieee80211_aes_cmac_key_free(struct crypto_cipher *tfm); +- +- #endif /* AES_CMAC_H */ +---- a/net/mac80211/aes_gcm.c +-+++ /dev/null +-@@ -1,95 +0,0 @@ +--/* +-- * Copyright 2014-2015, Qualcomm Atheros, Inc. +-- * +-- * 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 +--#include +--#include +--#include +-- +--#include +--#include "key.h" +--#include "aes_gcm.h" +-- +--void ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, +-- u8 *data, size_t data_len, u8 *mic) +--{ +-- struct scatterlist assoc, pt, ct[2]; +-- +-- char aead_req_data[sizeof(struct aead_request) + +-- crypto_aead_reqsize(tfm)] +-- __aligned(__alignof__(struct aead_request)); +-- struct aead_request *aead_req = (void *)aead_req_data; +-- +-- memset(aead_req, 0, sizeof(aead_req_data)); +-- +-- sg_init_one(&pt, data, data_len); +-- sg_init_one(&assoc, &aad[2], be16_to_cpup((__be16 *)aad)); +-- sg_init_table(ct, 2); +-- sg_set_buf(&ct[0], data, data_len); +-- sg_set_buf(&ct[1], mic, IEEE80211_GCMP_MIC_LEN); +-- +-- aead_request_set_tfm(aead_req, tfm); +-- aead_request_set_assoc(aead_req, &assoc, assoc.length); +-- aead_request_set_crypt(aead_req, &pt, ct, data_len, j_0); +-- +-- crypto_aead_encrypt(aead_req); +--} +-- +--int ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, +-- u8 *data, size_t data_len, u8 *mic) +--{ +-- struct scatterlist assoc, pt, ct[2]; +-- char aead_req_data[sizeof(struct aead_request) + +-- crypto_aead_reqsize(tfm)] +-- __aligned(__alignof__(struct aead_request)); +-- struct aead_request *aead_req = (void *)aead_req_data; +-- +-- if (data_len == 0) +-- return -EINVAL; +-- +-- memset(aead_req, 0, sizeof(aead_req_data)); +-- +-- sg_init_one(&pt, data, data_len); +-- sg_init_one(&assoc, &aad[2], be16_to_cpup((__be16 *)aad)); +-- sg_init_table(ct, 2); +-- sg_set_buf(&ct[0], data, data_len); +-- sg_set_buf(&ct[1], mic, IEEE80211_GCMP_MIC_LEN); +-- +-- aead_request_set_tfm(aead_req, tfm); +-- aead_request_set_assoc(aead_req, &assoc, assoc.length); +-- aead_request_set_crypt(aead_req, ct, &pt, +-- data_len + IEEE80211_GCMP_MIC_LEN, j_0); +-- +-- return crypto_aead_decrypt(aead_req); +--} +-- +--struct crypto_aead *ieee80211_aes_gcm_key_setup_encrypt(const u8 key[], +-- size_t key_len) +--{ +-- struct crypto_aead *tfm; +-- int err; +-- +-- tfm = crypto_alloc_aead("gcm(aes)", 0, CRYPTO_ALG_ASYNC); +-- if (IS_ERR(tfm)) +-- return tfm; +-- +-- err = crypto_aead_setkey(tfm, key, key_len); +-- if (!err) +-- err = crypto_aead_setauthsize(tfm, IEEE80211_GCMP_MIC_LEN); +-- if (!err) +-- return tfm; +-- +-- crypto_free_aead(tfm); +-- return ERR_PTR(err); +--} +-- +--void ieee80211_aes_gcm_key_free(struct crypto_aead *tfm) +--{ +-- crypto_free_aead(tfm); +--} +---- a/net/mac80211/aes_gcm.h +-+++ /dev/null +-@@ -1,22 +0,0 @@ +--/* +-- * Copyright 2014-2015, Qualcomm Atheros, Inc. +-- * +-- * 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. +-- */ +-- +--#ifndef AES_GCM_H +--#define AES_GCM_H +-- +--#include +-- +--void ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, +-- u8 *data, size_t data_len, u8 *mic); +--int ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, +-- u8 *data, size_t data_len, u8 *mic); +--struct crypto_aead *ieee80211_aes_gcm_key_setup_encrypt(const u8 key[], +-- size_t key_len); +--void ieee80211_aes_gcm_key_free(struct crypto_aead *tfm); +-- +--#endif /* AES_GCM_H */ +---- a/net/mac80211/aes_gmac.c +-+++ /dev/null +-@@ -1,84 +0,0 @@ +--/* +-- * AES-GMAC for IEEE 802.11 BIP-GMAC-128 and BIP-GMAC-256 +-- * Copyright 2015, Qualcomm Atheros, Inc. +-- * +-- * 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 +--#include +--#include +--#include +-- +--#include +--#include "key.h" +--#include "aes_gmac.h" +-- +--#define GMAC_MIC_LEN 16 +--#define GMAC_NONCE_LEN 12 +--#define AAD_LEN 20 +-- +--int ieee80211_aes_gmac(struct crypto_aead *tfm, const u8 *aad, u8 *nonce, +-- const u8 *data, size_t data_len, u8 *mic) +--{ +-- struct scatterlist sg[3], ct[1]; +-- char aead_req_data[sizeof(struct aead_request) + +-- crypto_aead_reqsize(tfm)] +-- __aligned(__alignof__(struct aead_request)); +-- struct aead_request *aead_req = (void *)aead_req_data; +-- u8 zero[GMAC_MIC_LEN], iv[AES_BLOCK_SIZE]; +-- +-- if (data_len < GMAC_MIC_LEN) +-- return -EINVAL; +-- +-- memset(aead_req, 0, sizeof(aead_req_data)); +-- +-- memset(zero, 0, GMAC_MIC_LEN); +-- sg_init_table(sg, 3); +-- sg_set_buf(&sg[0], aad, AAD_LEN); +-- sg_set_buf(&sg[1], data, data_len - GMAC_MIC_LEN); +-- sg_set_buf(&sg[2], zero, GMAC_MIC_LEN); +-- +-- memcpy(iv, nonce, GMAC_NONCE_LEN); +-- memset(iv + GMAC_NONCE_LEN, 0, sizeof(iv) - GMAC_NONCE_LEN); +-- iv[AES_BLOCK_SIZE - 1] = 0x01; +-- +-- sg_init_table(ct, 1); +-- sg_set_buf(&ct[0], mic, GMAC_MIC_LEN); +-- +-- aead_request_set_tfm(aead_req, tfm); +-- aead_request_set_assoc(aead_req, sg, AAD_LEN + data_len); +-- aead_request_set_crypt(aead_req, NULL, ct, 0, iv); +-- +-- crypto_aead_encrypt(aead_req); +-- +-- return 0; +--} +-- +--struct crypto_aead *ieee80211_aes_gmac_key_setup(const u8 key[], +-- size_t key_len) +--{ +-- struct crypto_aead *tfm; +-- int err; +-- +-- tfm = crypto_alloc_aead("gcm(aes)", 0, CRYPTO_ALG_ASYNC); +-- if (IS_ERR(tfm)) +-- return tfm; +-- +-- err = crypto_aead_setkey(tfm, key, key_len); +-- if (!err) +-- return tfm; +-- if (!err) +-- err = crypto_aead_setauthsize(tfm, GMAC_MIC_LEN); +-- +-- crypto_free_aead(tfm); +-- return ERR_PTR(err); +--} +-- +--void ieee80211_aes_gmac_key_free(struct crypto_aead *tfm) +--{ +-- crypto_free_aead(tfm); +--} +---- a/net/mac80211/aes_gmac.h +-+++ /dev/null +-@@ -1,20 +0,0 @@ +--/* +-- * Copyright 2015, Qualcomm Atheros, Inc. +-- * +-- * 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. +-- */ +-- +--#ifndef AES_GMAC_H +--#define AES_GMAC_H +-- +--#include +-- +--struct crypto_aead *ieee80211_aes_gmac_key_setup(const u8 key[], +-- size_t key_len); +--int ieee80211_aes_gmac(struct crypto_aead *tfm, const u8 *aad, u8 *nonce, +-- const u8 *data, size_t data_len, u8 *mic); +--void ieee80211_aes_gmac_key_free(struct crypto_aead *tfm); +-- +--#endif /* AES_GMAC_H */ +---- a/net/mac80211/cfg.c +-+++ b/net/mac80211/cfg.c +-@@ -162,13 +162,8 @@ static int ieee80211_add_key(struct wiph +- return -EINVAL; +- break; +- case WLAN_CIPHER_SUITE_CCMP: +-- case WLAN_CIPHER_SUITE_CCMP_256: +- case WLAN_CIPHER_SUITE_AES_CMAC: +-- case WLAN_CIPHER_SUITE_BIP_CMAC_256: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_128: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_256: +- case WLAN_CIPHER_SUITE_GCMP: +-- case WLAN_CIPHER_SUITE_GCMP_256: +- break; +- default: +- cs = ieee80211_cs_get(local, params->cipher, sdata->vif.type); +-@@ -353,7 +348,6 @@ static int ieee80211_get_key(struct wiph +- params.seq_len = 6; +- break; +- case WLAN_CIPHER_SUITE_CCMP: +-- case WLAN_CIPHER_SUITE_CCMP_256: +- pn64 = atomic64_read(&key->u.ccmp.tx_pn); +- seq[0] = pn64; +- seq[1] = pn64 >> 8; +-@@ -365,35 +359,10 @@ static int ieee80211_get_key(struct wiph +- params.seq_len = 6; +- break; +- case WLAN_CIPHER_SUITE_AES_CMAC: +-- case WLAN_CIPHER_SUITE_BIP_CMAC_256: +- pn64 = atomic64_read(&key->u.aes_cmac.tx_pn); +- seq[0] = pn64; +- seq[1] = pn64 >> 8; +- seq[2] = pn64 >> 16; +-- seq[3] = pn64 >> 24; +-- seq[4] = pn64 >> 32; +-- seq[5] = pn64 >> 40; +-- params.seq = seq; +-- params.seq_len = 6; +-- break; +-- case WLAN_CIPHER_SUITE_BIP_GMAC_128: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_256: +-- pn64 = atomic64_read(&key->u.aes_gmac.tx_pn); +-- seq[0] = pn64; +-- seq[1] = pn64 >> 8; +-- seq[2] = pn64 >> 16; +-- seq[3] = pn64 >> 24; +-- seq[4] = pn64 >> 32; +-- seq[5] = pn64 >> 40; +-- params.seq = seq; +-- params.seq_len = 6; +-- break; +-- case WLAN_CIPHER_SUITE_GCMP: +-- case WLAN_CIPHER_SUITE_GCMP_256: +-- pn64 = atomic64_read(&key->u.gcmp.tx_pn); +-- seq[0] = pn64; +-- seq[1] = pn64 >> 8; +-- seq[2] = pn64 >> 16; +- seq[3] = pn64 >> 24; +- seq[4] = pn64 >> 32; +- seq[5] = pn64 >> 40; +---- a/net/mac80211/debugfs_key.c +-+++ b/net/mac80211/debugfs_key.c +-@@ -94,33 +94,17 @@ static ssize_t key_tx_spec_read(struct f +- key->u.tkip.tx.iv16); +- break; +- case WLAN_CIPHER_SUITE_CCMP: +-- case WLAN_CIPHER_SUITE_CCMP_256: +- pn = atomic64_read(&key->u.ccmp.tx_pn); +- len = scnprintf(buf, sizeof(buf), "%02x%02x%02x%02x%02x%02x\n", +- (u8)(pn >> 40), (u8)(pn >> 32), (u8)(pn >> 24), +- (u8)(pn >> 16), (u8)(pn >> 8), (u8)pn); +- break; +- case WLAN_CIPHER_SUITE_AES_CMAC: +-- case WLAN_CIPHER_SUITE_BIP_CMAC_256: +- pn = atomic64_read(&key->u.aes_cmac.tx_pn); +- len = scnprintf(buf, sizeof(buf), "%02x%02x%02x%02x%02x%02x\n", +- (u8)(pn >> 40), (u8)(pn >> 32), (u8)(pn >> 24), +- (u8)(pn >> 16), (u8)(pn >> 8), (u8)pn); +- break; +-- case WLAN_CIPHER_SUITE_BIP_GMAC_128: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_256: +-- pn = atomic64_read(&key->u.aes_gmac.tx_pn); +-- len = scnprintf(buf, sizeof(buf), "%02x%02x%02x%02x%02x%02x\n", +-- (u8)(pn >> 40), (u8)(pn >> 32), (u8)(pn >> 24), +-- (u8)(pn >> 16), (u8)(pn >> 8), (u8)pn); +-- break; +-- case WLAN_CIPHER_SUITE_GCMP: +-- case WLAN_CIPHER_SUITE_GCMP_256: +-- pn = atomic64_read(&key->u.gcmp.tx_pn); +-- len = scnprintf(buf, sizeof(buf), "%02x%02x%02x%02x%02x%02x\n", +-- (u8)(pn >> 40), (u8)(pn >> 32), (u8)(pn >> 24), +-- (u8)(pn >> 16), (u8)(pn >> 8), (u8)pn); +-- break; +- default: +- return 0; +- } +-@@ -150,7 +134,6 @@ static ssize_t key_rx_spec_read(struct f +- len = p - buf; +- break; +- case WLAN_CIPHER_SUITE_CCMP: +-- case WLAN_CIPHER_SUITE_CCMP_256: +- for (i = 0; i < IEEE80211_NUM_TIDS + 1; i++) { +- rpn = key->u.ccmp.rx_pn[i]; +- p += scnprintf(p, sizeof(buf)+buf-p, +-@@ -161,7 +144,6 @@ static ssize_t key_rx_spec_read(struct f +- len = p - buf; +- break; +- case WLAN_CIPHER_SUITE_AES_CMAC: +-- case WLAN_CIPHER_SUITE_BIP_CMAC_256: +- rpn = key->u.aes_cmac.rx_pn; +- p += scnprintf(p, sizeof(buf)+buf-p, +- "%02x%02x%02x%02x%02x%02x\n", +-@@ -169,26 +151,6 @@ static ssize_t key_rx_spec_read(struct f +- rpn[3], rpn[4], rpn[5]); +- len = p - buf; +- break; +-- case WLAN_CIPHER_SUITE_BIP_GMAC_128: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_256: +-- rpn = key->u.aes_gmac.rx_pn; +-- p += scnprintf(p, sizeof(buf)+buf-p, +-- "%02x%02x%02x%02x%02x%02x\n", +-- rpn[0], rpn[1], rpn[2], +-- rpn[3], rpn[4], rpn[5]); +-- len = p - buf; +-- break; +-- case WLAN_CIPHER_SUITE_GCMP: +-- case WLAN_CIPHER_SUITE_GCMP_256: +-- for (i = 0; i < IEEE80211_NUM_TIDS + 1; i++) { +-- rpn = key->u.gcmp.rx_pn[i]; +-- p += scnprintf(p, sizeof(buf)+buf-p, +-- "%02x%02x%02x%02x%02x%02x\n", +-- rpn[0], rpn[1], rpn[2], +-- rpn[3], rpn[4], rpn[5]); +-- } +-- len = p - buf; +-- break; +- default: +- return 0; +- } +-@@ -205,23 +167,12 @@ static ssize_t key_replays_read(struct f +- +- switch (key->conf.cipher) { +- case WLAN_CIPHER_SUITE_CCMP: +-- case WLAN_CIPHER_SUITE_CCMP_256: +- len = scnprintf(buf, sizeof(buf), "%u\n", key->u.ccmp.replays); +- break; +- case WLAN_CIPHER_SUITE_AES_CMAC: +-- case WLAN_CIPHER_SUITE_BIP_CMAC_256: +- len = scnprintf(buf, sizeof(buf), "%u\n", +- key->u.aes_cmac.replays); +- break; +-- case WLAN_CIPHER_SUITE_BIP_GMAC_128: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_256: +-- len = scnprintf(buf, sizeof(buf), "%u\n", +-- key->u.aes_gmac.replays); +-- break; +-- case WLAN_CIPHER_SUITE_GCMP: +-- case WLAN_CIPHER_SUITE_GCMP_256: +-- len = scnprintf(buf, sizeof(buf), "%u\n", key->u.gcmp.replays); +-- break; +- default: +- return 0; +- } +-@@ -238,15 +189,9 @@ static ssize_t key_icverrors_read(struct +- +- switch (key->conf.cipher) { +- case WLAN_CIPHER_SUITE_AES_CMAC: +-- case WLAN_CIPHER_SUITE_BIP_CMAC_256: +- len = scnprintf(buf, sizeof(buf), "%u\n", +- key->u.aes_cmac.icverrors); +- break; +-- case WLAN_CIPHER_SUITE_BIP_GMAC_128: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_256: +-- len = scnprintf(buf, sizeof(buf), "%u\n", +-- key->u.aes_gmac.icverrors); +-- break; +- default: +- return 0; +- } +---- a/net/mac80211/key.c +-+++ b/net/mac80211/key.c +-@@ -24,8 +24,6 @@ +- #include "debugfs_key.h" +- #include "aes_ccm.h" +- #include "aes_cmac.h" +--#include "aes_gmac.h" +--#include "aes_gcm.h" +- +- +- /** +-@@ -164,13 +162,7 @@ static int ieee80211_key_enable_hw_accel +- case WLAN_CIPHER_SUITE_WEP104: +- case WLAN_CIPHER_SUITE_TKIP: +- case WLAN_CIPHER_SUITE_CCMP: +-- case WLAN_CIPHER_SUITE_CCMP_256: +- case WLAN_CIPHER_SUITE_AES_CMAC: +-- case WLAN_CIPHER_SUITE_BIP_CMAC_256: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_128: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_256: +-- case WLAN_CIPHER_SUITE_GCMP: +-- case WLAN_CIPHER_SUITE_GCMP_256: +- /* all of these we can do in software - if driver can */ +- if (ret == 1) +- return 0; +-@@ -394,26 +386,7 @@ ieee80211_key_alloc(u32 cipher, int idx, +- * Initialize AES key state here as an optimization so that +- * it does not need to be initialized for every packet. +- */ +-- key->u.ccmp.tfm = ieee80211_aes_key_setup_encrypt( +-- key_data, key_len, IEEE80211_CCMP_MIC_LEN); +-- if (IS_ERR(key->u.ccmp.tfm)) { +-- err = PTR_ERR(key->u.ccmp.tfm); +-- kfree(key); +-- return ERR_PTR(err); +-- } +-- break; +-- case WLAN_CIPHER_SUITE_CCMP_256: +-- key->conf.iv_len = IEEE80211_CCMP_256_HDR_LEN; +-- key->conf.icv_len = IEEE80211_CCMP_256_MIC_LEN; +-- for (i = 0; seq && i < IEEE80211_NUM_TIDS + 1; i++) +-- for (j = 0; j < IEEE80211_CCMP_256_PN_LEN; j++) +-- key->u.ccmp.rx_pn[i][j] = +-- seq[IEEE80211_CCMP_256_PN_LEN - j - 1]; +-- /* Initialize AES key state here as an optimization so that +-- * it does not need to be initialized for every packet. +-- */ +-- key->u.ccmp.tfm = ieee80211_aes_key_setup_encrypt( +-- key_data, key_len, IEEE80211_CCMP_256_MIC_LEN); +-+ key->u.ccmp.tfm = ieee80211_aes_key_setup_encrypt(key_data); +- if (IS_ERR(key->u.ccmp.tfm)) { +- err = PTR_ERR(key->u.ccmp.tfm); +- kfree(key); +-@@ -421,12 +394,8 @@ ieee80211_key_alloc(u32 cipher, int idx, +- } +- break; +- case WLAN_CIPHER_SUITE_AES_CMAC: +-- case WLAN_CIPHER_SUITE_BIP_CMAC_256: +- key->conf.iv_len = 0; +-- if (cipher == WLAN_CIPHER_SUITE_AES_CMAC) +-- key->conf.icv_len = sizeof(struct ieee80211_mmie); +-- else +-- key->conf.icv_len = sizeof(struct ieee80211_mmie_16); +-+ key->conf.icv_len = sizeof(struct ieee80211_mmie); +- if (seq) +- for (j = 0; j < IEEE80211_CMAC_PN_LEN; j++) +- key->u.aes_cmac.rx_pn[j] = +-@@ -436,51 +405,13 @@ ieee80211_key_alloc(u32 cipher, int idx, +- * it does not need to be initialized for every packet. +- */ +- key->u.aes_cmac.tfm = +-- ieee80211_aes_cmac_key_setup(key_data, key_len); +-+ ieee80211_aes_cmac_key_setup(key_data); +- if (IS_ERR(key->u.aes_cmac.tfm)) { +- err = PTR_ERR(key->u.aes_cmac.tfm); +- kfree(key); +- return ERR_PTR(err); +- } +- break; +-- case WLAN_CIPHER_SUITE_BIP_GMAC_128: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_256: +-- key->conf.iv_len = 0; +-- key->conf.icv_len = sizeof(struct ieee80211_mmie_16); +-- if (seq) +-- for (j = 0; j < IEEE80211_GMAC_PN_LEN; j++) +-- key->u.aes_gmac.rx_pn[j] = +-- seq[IEEE80211_GMAC_PN_LEN - j - 1]; +-- /* Initialize AES key state here as an optimization so that +-- * it does not need to be initialized for every packet. +-- */ +-- key->u.aes_gmac.tfm = +-- ieee80211_aes_gmac_key_setup(key_data, key_len); +-- if (IS_ERR(key->u.aes_gmac.tfm)) { +-- err = PTR_ERR(key->u.aes_gmac.tfm); +-- kfree(key); +-- return ERR_PTR(err); +-- } +-- break; +-- case WLAN_CIPHER_SUITE_GCMP: +-- case WLAN_CIPHER_SUITE_GCMP_256: +-- key->conf.iv_len = IEEE80211_GCMP_HDR_LEN; +-- key->conf.icv_len = IEEE80211_GCMP_MIC_LEN; +-- for (i = 0; seq && i < IEEE80211_NUM_TIDS + 1; i++) +-- for (j = 0; j < IEEE80211_GCMP_PN_LEN; j++) +-- key->u.gcmp.rx_pn[i][j] = +-- seq[IEEE80211_GCMP_PN_LEN - j - 1]; +-- /* Initialize AES key state here as an optimization so that +-- * it does not need to be initialized for every packet. +-- */ +-- key->u.gcmp.tfm = ieee80211_aes_gcm_key_setup_encrypt(key_data, +-- key_len); +-- if (IS_ERR(key->u.gcmp.tfm)) { +-- err = PTR_ERR(key->u.gcmp.tfm); +-- kfree(key); +-- return ERR_PTR(err); +-- } +-- break; +- default: +- if (cs) { +- size_t len = (seq_len > MAX_PN_LEN) ? +-@@ -502,24 +433,10 @@ ieee80211_key_alloc(u32 cipher, int idx, +- +- static void ieee80211_key_free_common(struct ieee80211_key *key) +- { +-- switch (key->conf.cipher) { +-- case WLAN_CIPHER_SUITE_CCMP: +-- case WLAN_CIPHER_SUITE_CCMP_256: +-+ if (key->conf.cipher == WLAN_CIPHER_SUITE_CCMP) +- ieee80211_aes_key_free(key->u.ccmp.tfm); +-- break; +-- case WLAN_CIPHER_SUITE_AES_CMAC: +-- case WLAN_CIPHER_SUITE_BIP_CMAC_256: +-+ if (key->conf.cipher == WLAN_CIPHER_SUITE_AES_CMAC) +- ieee80211_aes_cmac_key_free(key->u.aes_cmac.tfm); +-- break; +-- case WLAN_CIPHER_SUITE_BIP_GMAC_128: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_256: +-- ieee80211_aes_gmac_key_free(key->u.aes_gmac.tfm); +-- break; +-- case WLAN_CIPHER_SUITE_GCMP: +-- case WLAN_CIPHER_SUITE_GCMP_256: +-- ieee80211_aes_gcm_key_free(key->u.gcmp.tfm); +-- break; +-- } +- kzfree(key); +- } +- +-@@ -826,7 +743,6 @@ void ieee80211_get_key_tx_seq(struct iee +- seq->tkip.iv16 = key->u.tkip.tx.iv16; +- break; +- case WLAN_CIPHER_SUITE_CCMP: +-- case WLAN_CIPHER_SUITE_CCMP_256: +- pn64 = atomic64_read(&key->u.ccmp.tx_pn); +- seq->ccmp.pn[5] = pn64; +- seq->ccmp.pn[4] = pn64 >> 8; +-@@ -836,7 +752,6 @@ void ieee80211_get_key_tx_seq(struct iee +- seq->ccmp.pn[0] = pn64 >> 40; +- break; +- case WLAN_CIPHER_SUITE_AES_CMAC: +-- case WLAN_CIPHER_SUITE_BIP_CMAC_256: +- pn64 = atomic64_read(&key->u.aes_cmac.tx_pn); +- seq->ccmp.pn[5] = pn64; +- seq->ccmp.pn[4] = pn64 >> 8; +-@@ -845,26 +760,6 @@ void ieee80211_get_key_tx_seq(struct iee +- seq->ccmp.pn[1] = pn64 >> 32; +- seq->ccmp.pn[0] = pn64 >> 40; +- break; +-- case WLAN_CIPHER_SUITE_BIP_GMAC_128: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_256: +-- pn64 = atomic64_read(&key->u.aes_gmac.tx_pn); +-- seq->ccmp.pn[5] = pn64; +-- seq->ccmp.pn[4] = pn64 >> 8; +-- seq->ccmp.pn[3] = pn64 >> 16; +-- seq->ccmp.pn[2] = pn64 >> 24; +-- seq->ccmp.pn[1] = pn64 >> 32; +-- seq->ccmp.pn[0] = pn64 >> 40; +-- break; +-- case WLAN_CIPHER_SUITE_GCMP: +-- case WLAN_CIPHER_SUITE_GCMP_256: +-- pn64 = atomic64_read(&key->u.gcmp.tx_pn); +-- seq->gcmp.pn[5] = pn64; +-- seq->gcmp.pn[4] = pn64 >> 8; +-- seq->gcmp.pn[3] = pn64 >> 16; +-- seq->gcmp.pn[2] = pn64 >> 24; +-- seq->gcmp.pn[1] = pn64 >> 32; +-- seq->gcmp.pn[0] = pn64 >> 40; +-- break; +- default: +- WARN_ON(1); +- } +-@@ -887,7 +782,6 @@ void ieee80211_get_key_rx_seq(struct iee +- seq->tkip.iv16 = key->u.tkip.rx[tid].iv16; +- break; +- case WLAN_CIPHER_SUITE_CCMP: +-- case WLAN_CIPHER_SUITE_CCMP_256: +- if (WARN_ON(tid < -1 || tid >= IEEE80211_NUM_TIDS)) +- return; +- if (tid < 0) +-@@ -897,29 +791,11 @@ void ieee80211_get_key_rx_seq(struct iee +- memcpy(seq->ccmp.pn, pn, IEEE80211_CCMP_PN_LEN); +- break; +- case WLAN_CIPHER_SUITE_AES_CMAC: +-- case WLAN_CIPHER_SUITE_BIP_CMAC_256: +- if (WARN_ON(tid != 0)) +- return; +- pn = key->u.aes_cmac.rx_pn; +- memcpy(seq->aes_cmac.pn, pn, IEEE80211_CMAC_PN_LEN); +- break; +-- case WLAN_CIPHER_SUITE_BIP_GMAC_128: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_256: +-- if (WARN_ON(tid != 0)) +-- return; +-- pn = key->u.aes_gmac.rx_pn; +-- memcpy(seq->aes_gmac.pn, pn, IEEE80211_GMAC_PN_LEN); +-- break; +-- case WLAN_CIPHER_SUITE_GCMP: +-- case WLAN_CIPHER_SUITE_GCMP_256: +-- if (WARN_ON(tid < -1 || tid >= IEEE80211_NUM_TIDS)) +-- return; +-- if (tid < 0) +-- pn = key->u.gcmp.rx_pn[IEEE80211_NUM_TIDS]; +-- else +-- pn = key->u.gcmp.rx_pn[tid]; +-- memcpy(seq->gcmp.pn, pn, IEEE80211_GCMP_PN_LEN); +-- break; +- } +- } +- EXPORT_SYMBOL(ieee80211_get_key_rx_seq); +-@@ -938,7 +814,6 @@ void ieee80211_set_key_tx_seq(struct iee +- key->u.tkip.tx.iv16 = seq->tkip.iv16; +- break; +- case WLAN_CIPHER_SUITE_CCMP: +-- case WLAN_CIPHER_SUITE_CCMP_256: +- pn64 = (u64)seq->ccmp.pn[5] | +- ((u64)seq->ccmp.pn[4] << 8) | +- ((u64)seq->ccmp.pn[3] << 16) | +-@@ -948,7 +823,6 @@ void ieee80211_set_key_tx_seq(struct iee +- atomic64_set(&key->u.ccmp.tx_pn, pn64); +- break; +- case WLAN_CIPHER_SUITE_AES_CMAC: +-- case WLAN_CIPHER_SUITE_BIP_CMAC_256: +- pn64 = (u64)seq->aes_cmac.pn[5] | +- ((u64)seq->aes_cmac.pn[4] << 8) | +- ((u64)seq->aes_cmac.pn[3] << 16) | +-@@ -957,26 +831,6 @@ void ieee80211_set_key_tx_seq(struct iee +- ((u64)seq->aes_cmac.pn[0] << 40); +- atomic64_set(&key->u.aes_cmac.tx_pn, pn64); +- break; +-- case WLAN_CIPHER_SUITE_BIP_GMAC_128: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_256: +-- pn64 = (u64)seq->aes_gmac.pn[5] | +-- ((u64)seq->aes_gmac.pn[4] << 8) | +-- ((u64)seq->aes_gmac.pn[3] << 16) | +-- ((u64)seq->aes_gmac.pn[2] << 24) | +-- ((u64)seq->aes_gmac.pn[1] << 32) | +-- ((u64)seq->aes_gmac.pn[0] << 40); +-- atomic64_set(&key->u.aes_gmac.tx_pn, pn64); +-- break; +-- case WLAN_CIPHER_SUITE_GCMP: +-- case WLAN_CIPHER_SUITE_GCMP_256: +-- pn64 = (u64)seq->gcmp.pn[5] | +-- ((u64)seq->gcmp.pn[4] << 8) | +-- ((u64)seq->gcmp.pn[3] << 16) | +-- ((u64)seq->gcmp.pn[2] << 24) | +-- ((u64)seq->gcmp.pn[1] << 32) | +-- ((u64)seq->gcmp.pn[0] << 40); +-- atomic64_set(&key->u.gcmp.tx_pn, pn64); +-- break; +- default: +- WARN_ON(1); +- break; +-@@ -1000,7 +854,6 @@ void ieee80211_set_key_rx_seq(struct iee +- key->u.tkip.rx[tid].iv16 = seq->tkip.iv16; +- break; +- case WLAN_CIPHER_SUITE_CCMP: +-- case WLAN_CIPHER_SUITE_CCMP_256: +- if (WARN_ON(tid < -1 || tid >= IEEE80211_NUM_TIDS)) +- return; +- if (tid < 0) +-@@ -1010,29 +863,11 @@ void ieee80211_set_key_rx_seq(struct iee +- memcpy(pn, seq->ccmp.pn, IEEE80211_CCMP_PN_LEN); +- break; +- case WLAN_CIPHER_SUITE_AES_CMAC: +-- case WLAN_CIPHER_SUITE_BIP_CMAC_256: +- if (WARN_ON(tid != 0)) +- return; +- pn = key->u.aes_cmac.rx_pn; +- memcpy(pn, seq->aes_cmac.pn, IEEE80211_CMAC_PN_LEN); +- break; +-- case WLAN_CIPHER_SUITE_BIP_GMAC_128: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_256: +-- if (WARN_ON(tid != 0)) +-- return; +-- pn = key->u.aes_gmac.rx_pn; +-- memcpy(pn, seq->aes_gmac.pn, IEEE80211_GMAC_PN_LEN); +-- break; +-- case WLAN_CIPHER_SUITE_GCMP: +-- case WLAN_CIPHER_SUITE_GCMP_256: +-- if (WARN_ON(tid < -1 || tid >= IEEE80211_NUM_TIDS)) +-- return; +-- if (tid < 0) +-- pn = key->u.gcmp.rx_pn[IEEE80211_NUM_TIDS]; +-- else +-- pn = key->u.gcmp.rx_pn[tid]; +-- memcpy(pn, seq->gcmp.pn, IEEE80211_GCMP_PN_LEN); +-- break; +- default: +- WARN_ON(1); +- break; +---- a/net/mac80211/key.h +-+++ b/net/mac80211/key.h +-@@ -84,7 +84,7 @@ struct ieee80211_key { +- * Management frames. +- */ +- u8 rx_pn[IEEE80211_NUM_TIDS + 1][IEEE80211_CCMP_PN_LEN]; +-- struct crypto_aead *tfm; +-+ struct crypto_cipher *tfm; +- u32 replays; /* dot11RSNAStatsCCMPReplays */ +- } ccmp; +- struct { +-@@ -95,24 +95,6 @@ struct ieee80211_key { +- u32 icverrors; /* dot11RSNAStatsCMACICVErrors */ +- } aes_cmac; +- struct { +-- atomic64_t tx_pn; +-- u8 rx_pn[IEEE80211_GMAC_PN_LEN]; +-- struct crypto_aead *tfm; +-- u32 replays; /* dot11RSNAStatsCMACReplays */ +-- u32 icverrors; /* dot11RSNAStatsCMACICVErrors */ +-- } aes_gmac; +-- struct { +-- atomic64_t tx_pn; +-- /* Last received packet number. The first +-- * IEEE80211_NUM_TIDS counters are used with Data +-- * frames and the last counter is used with Robust +-- * Management frames. +-- */ +-- u8 rx_pn[IEEE80211_NUM_TIDS + 1][IEEE80211_GCMP_PN_LEN]; +-- struct crypto_aead *tfm; +-- u32 replays; /* dot11RSNAStatsGCMPReplays */ +-- } gcmp; +-- struct { +- /* generic cipher scheme */ +- u8 rx_pn[IEEE80211_NUM_TIDS + 1][MAX_PN_LEN]; +- } gen; +---- a/net/mac80211/main.c +-+++ b/net/mac80211/main.c +-@@ -666,15 +666,9 @@ static int ieee80211_init_cipher_suites( +- WLAN_CIPHER_SUITE_WEP104, +- WLAN_CIPHER_SUITE_TKIP, +- WLAN_CIPHER_SUITE_CCMP, +-- WLAN_CIPHER_SUITE_CCMP_256, +-- WLAN_CIPHER_SUITE_GCMP, +-- WLAN_CIPHER_SUITE_GCMP_256, +- +- /* keep last -- depends on hw flags! */ +-- WLAN_CIPHER_SUITE_AES_CMAC, +-- WLAN_CIPHER_SUITE_BIP_CMAC_256, +-- WLAN_CIPHER_SUITE_BIP_GMAC_128, +-- WLAN_CIPHER_SUITE_BIP_GMAC_256, +-+ WLAN_CIPHER_SUITE_AES_CMAC +- }; +- +- if (local->hw.flags & IEEE80211_HW_SW_CRYPTO_CONTROL || +-@@ -713,7 +707,7 @@ static int ieee80211_init_cipher_suites( +- local->hw.wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites); +- +- if (!have_mfp) +-- local->hw.wiphy->n_cipher_suites -= 4; +-+ local->hw.wiphy->n_cipher_suites--; +- +- if (!have_wep) { +- local->hw.wiphy->cipher_suites += 2; +-@@ -730,42 +724,32 @@ static int ieee80211_init_cipher_suites( +- /* Driver specifies cipher schemes only (but not cipher suites +- * including the schemes) +- * +-- * We start counting ciphers defined by schemes, TKIP, CCMP, +-- * CCMP-256, GCMP, and GCMP-256 +-+ * We start counting ciphers defined by schemes, TKIP and CCMP +- */ +-- n_suites = local->hw.n_cipher_schemes + 5; +-+ n_suites = local->hw.n_cipher_schemes + 2; +- +- /* check if we have WEP40 and WEP104 */ +- if (have_wep) +- n_suites += 2; +- +-- /* check if we have AES_CMAC, BIP-CMAC-256, BIP-GMAC-128, +-- * BIP-GMAC-256 +-- */ +-+ /* check if we have AES_CMAC */ +- if (have_mfp) +-- n_suites += 4; +-+ n_suites++; +- +- suites = kmalloc(sizeof(u32) * n_suites, GFP_KERNEL); +- if (!suites) +- return -ENOMEM; +- +- suites[w++] = WLAN_CIPHER_SUITE_CCMP; +-- suites[w++] = WLAN_CIPHER_SUITE_CCMP_256; +- suites[w++] = WLAN_CIPHER_SUITE_TKIP; +-- suites[w++] = WLAN_CIPHER_SUITE_GCMP; +-- suites[w++] = WLAN_CIPHER_SUITE_GCMP_256; +- +- if (have_wep) { +- suites[w++] = WLAN_CIPHER_SUITE_WEP40; +- suites[w++] = WLAN_CIPHER_SUITE_WEP104; +- } +- +-- if (have_mfp) { +-+ if (have_mfp) +- suites[w++] = WLAN_CIPHER_SUITE_AES_CMAC; +-- suites[w++] = WLAN_CIPHER_SUITE_BIP_CMAC_256; +-- suites[w++] = WLAN_CIPHER_SUITE_BIP_GMAC_128; +-- suites[w++] = WLAN_CIPHER_SUITE_BIP_GMAC_256; +-- } +- +- for (r = 0; r < local->hw.n_cipher_schemes; r++) +- suites[w++] = cs[r].cipher; +---- a/net/mac80211/rx.c +-+++ b/net/mac80211/rx.c +-@@ -647,7 +647,6 @@ static int ieee80211_get_mmie_keyidx(str +- { +- struct ieee80211_mgmt *hdr = (struct ieee80211_mgmt *) skb->data; +- struct ieee80211_mmie *mmie; +-- struct ieee80211_mmie_16 *mmie16; +- +- if (skb->len < 24 + sizeof(*mmie) || !is_multicast_ether_addr(hdr->da)) +- return -1; +-@@ -657,18 +656,11 @@ static int ieee80211_get_mmie_keyidx(str +- +- mmie = (struct ieee80211_mmie *) +- (skb->data + skb->len - sizeof(*mmie)); +-- if (mmie->element_id == WLAN_EID_MMIE && +-- mmie->length == sizeof(*mmie) - 2) +-- return le16_to_cpu(mmie->key_id); +-- +-- mmie16 = (struct ieee80211_mmie_16 *) +-- (skb->data + skb->len - sizeof(*mmie16)); +-- if (skb->len >= 24 + sizeof(*mmie16) && +-- mmie16->element_id == WLAN_EID_MMIE && +-- mmie16->length == sizeof(*mmie16) - 2) +-- return le16_to_cpu(mmie16->key_id); +-+ if (mmie->element_id != WLAN_EID_MMIE || +-+ mmie->length != sizeof(*mmie) - 2) +-+ return -1; +- +-- return -1; +-+ return le16_to_cpu(mmie->key_id); +- } +- +- static int iwl80211_get_cs_keyid(const struct ieee80211_cipher_scheme *cs, +-@@ -1658,27 +1650,11 @@ ieee80211_rx_h_decrypt(struct ieee80211_ +- result = ieee80211_crypto_tkip_decrypt(rx); +- break; +- case WLAN_CIPHER_SUITE_CCMP: +-- result = ieee80211_crypto_ccmp_decrypt( +-- rx, IEEE80211_CCMP_MIC_LEN); +-- break; +-- case WLAN_CIPHER_SUITE_CCMP_256: +-- result = ieee80211_crypto_ccmp_decrypt( +-- rx, IEEE80211_CCMP_256_MIC_LEN); +-+ result = ieee80211_crypto_ccmp_decrypt(rx); +- break; +- case WLAN_CIPHER_SUITE_AES_CMAC: +- result = ieee80211_crypto_aes_cmac_decrypt(rx); +- break; +-- case WLAN_CIPHER_SUITE_BIP_CMAC_256: +-- result = ieee80211_crypto_aes_cmac_256_decrypt(rx); +-- break; +-- case WLAN_CIPHER_SUITE_BIP_GMAC_128: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_256: +-- result = ieee80211_crypto_aes_gmac_decrypt(rx); +-- break; +-- case WLAN_CIPHER_SUITE_GCMP: +-- case WLAN_CIPHER_SUITE_GCMP_256: +-- result = ieee80211_crypto_gcmp_decrypt(rx); +-- break; +- default: +- result = ieee80211_crypto_hw_decrypt(rx); +- } +-@@ -1805,9 +1781,7 @@ ieee80211_rx_h_defragment(struct ieee802 +- /* This is the first fragment of a new frame. */ +- entry = ieee80211_reassemble_add(rx->sdata, frag, seq, +- rx->seqno_idx, &(rx->skb)); +-- if (rx->key && +-- (rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP || +-- rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP_256) && +-+ if (rx->key && rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP && +- ieee80211_has_protected(fc)) { +- int queue = rx->security_idx; +- /* Store CCMP PN so that we can verify that the next +-@@ -1836,9 +1810,7 @@ ieee80211_rx_h_defragment(struct ieee802 +- int i; +- u8 pn[IEEE80211_CCMP_PN_LEN], *rpn; +- int queue; +-- if (!rx->key || +-- (rx->key->conf.cipher != WLAN_CIPHER_SUITE_CCMP && +-- rx->key->conf.cipher != WLAN_CIPHER_SUITE_CCMP_256)) +-+ if (!rx->key || rx->key->conf.cipher != WLAN_CIPHER_SUITE_CCMP) +- return RX_DROP_UNUSABLE; +- memcpy(pn, entry->last_pn, IEEE80211_CCMP_PN_LEN); +- for (i = IEEE80211_CCMP_PN_LEN - 1; i >= 0; i--) { +---- a/net/mac80211/tx.c +-+++ b/net/mac80211/tx.c +-@@ -626,9 +626,6 @@ ieee80211_tx_h_select_key(struct ieee802 +- tx->key = NULL; +- break; +- case WLAN_CIPHER_SUITE_CCMP: +-- case WLAN_CIPHER_SUITE_CCMP_256: +-- case WLAN_CIPHER_SUITE_GCMP: +-- case WLAN_CIPHER_SUITE_GCMP_256: +- if (!ieee80211_is_data_present(hdr->frame_control) && +- !ieee80211_use_mfp(hdr->frame_control, tx->sta, +- tx->skb)) +-@@ -639,9 +636,6 @@ ieee80211_tx_h_select_key(struct ieee802 +- ieee80211_is_mgmt(hdr->frame_control); +- break; +- case WLAN_CIPHER_SUITE_AES_CMAC: +-- case WLAN_CIPHER_SUITE_BIP_CMAC_256: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_128: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_256: +- if (!ieee80211_is_mgmt(hdr->frame_control)) +- tx->key = NULL; +- break; +-@@ -1017,21 +1011,9 @@ ieee80211_tx_h_encrypt(struct ieee80211_ +- case WLAN_CIPHER_SUITE_TKIP: +- return ieee80211_crypto_tkip_encrypt(tx); +- case WLAN_CIPHER_SUITE_CCMP: +-- return ieee80211_crypto_ccmp_encrypt( +-- tx, IEEE80211_CCMP_MIC_LEN); +-- case WLAN_CIPHER_SUITE_CCMP_256: +-- return ieee80211_crypto_ccmp_encrypt( +-- tx, IEEE80211_CCMP_256_MIC_LEN); +-+ return ieee80211_crypto_ccmp_encrypt(tx); +- case WLAN_CIPHER_SUITE_AES_CMAC: +- return ieee80211_crypto_aes_cmac_encrypt(tx); +-- case WLAN_CIPHER_SUITE_BIP_CMAC_256: +-- return ieee80211_crypto_aes_cmac_256_encrypt(tx); +-- case WLAN_CIPHER_SUITE_BIP_GMAC_128: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_256: +-- return ieee80211_crypto_aes_gmac_encrypt(tx); +-- case WLAN_CIPHER_SUITE_GCMP: +-- case WLAN_CIPHER_SUITE_GCMP_256: +-- return ieee80211_crypto_gcmp_encrypt(tx); +- default: +- return ieee80211_crypto_hw_encrypt(tx); +- } +---- a/net/mac80211/wpa.c +-+++ b/net/mac80211/wpa.c +-@@ -22,8 +22,6 @@ +- #include "tkip.h" +- #include "aes_ccm.h" +- #include "aes_cmac.h" +--#include "aes_gmac.h" +--#include "aes_gcm.h" +- #include "wpa.h" +- +- ieee80211_tx_result +-@@ -304,15 +302,22 @@ ieee80211_crypto_tkip_decrypt(struct iee +- } +- +- +--static void ccmp_special_blocks(struct sk_buff *skb, u8 *pn, u8 *b_0, u8 *aad) +-+static void ccmp_special_blocks(struct sk_buff *skb, u8 *pn, u8 *scratch, +-+ int encrypted) +- { +- __le16 mask_fc; +- int a4_included, mgmt; +- u8 qos_tid; +-- u16 len_a; +-+ u8 *b_0, *aad; +-+ u16 data_len, len_a; +- unsigned int hdrlen; +- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; +- +-+ memset(scratch, 0, 6 * AES_BLOCK_SIZE); +-+ +-+ b_0 = scratch + 3 * AES_BLOCK_SIZE; +-+ aad = scratch + 4 * AES_BLOCK_SIZE; +-+ +- /* +- * Mask FC: zero subtype b4 b5 b6 (if not mgmt) +- * Retry, PwrMgt, MoreData; set Protected +-@@ -334,21 +339,20 @@ static void ccmp_special_blocks(struct s +- else +- qos_tid = 0; +- +-- /* In CCM, the initial vectors (IV) used for CTR mode encryption and CBC +-- * mode authentication are not allowed to collide, yet both are derived +-- * from this vector b_0. We only set L := 1 here to indicate that the +-- * data size can be represented in (L+1) bytes. The CCM layer will take +-- * care of storing the data length in the top (L+1) bytes and setting +-- * and clearing the other bits as is required to derive the two IVs. +-- */ +-- b_0[0] = 0x1; +-+ data_len = skb->len - hdrlen - IEEE80211_CCMP_HDR_LEN; +-+ if (encrypted) +-+ data_len -= IEEE80211_CCMP_MIC_LEN; +- +-+ /* First block, b_0 */ +-+ b_0[0] = 0x59; /* flags: Adata: 1, M: 011, L: 001 */ +- /* Nonce: Nonce Flags | A2 | PN +- * Nonce Flags: Priority (b0..b3) | Management (b4) | Reserved (b5..b7) +- */ +- b_0[1] = qos_tid | (mgmt << 4); +- memcpy(&b_0[2], hdr->addr2, ETH_ALEN); +- memcpy(&b_0[8], pn, IEEE80211_CCMP_PN_LEN); +-+ /* l(m) */ +-+ put_unaligned_be16(data_len, &b_0[14]); +- +- /* AAD (extra authenticate-only data) / masked 802.11 header +- * FC | A1 | A2 | A3 | SC | [A4] | [QC] */ +-@@ -395,8 +399,7 @@ static inline void ccmp_hdr2pn(u8 *pn, u +- } +- +- +--static int ccmp_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb, +-- unsigned int mic_len) +-+static int ccmp_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb) +- { +- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; +- struct ieee80211_key *key = tx->key; +-@@ -405,8 +408,7 @@ static int ccmp_encrypt_skb(struct ieee8 +- u8 *pos; +- u8 pn[6]; +- u64 pn64; +-- u8 aad[2 * AES_BLOCK_SIZE]; +-- u8 b_0[AES_BLOCK_SIZE]; +-+ u8 scratch[6 * AES_BLOCK_SIZE]; +- +- if (info->control.hw_key && +- !(info->control.hw_key->flags & IEEE80211_KEY_FLAG_GENERATE_IV) && +-@@ -427,7 +429,7 @@ static int ccmp_encrypt_skb(struct ieee8 +- if (info->control.hw_key) +- tail = 0; +- else +-- tail = mic_len; +-+ tail = IEEE80211_CCMP_MIC_LEN; +- +- if (WARN_ON(skb_tailroom(skb) < tail || +- skb_headroom(skb) < IEEE80211_CCMP_HDR_LEN)) +-@@ -460,24 +462,23 @@ static int ccmp_encrypt_skb(struct ieee8 +- return 0; +- +- pos += IEEE80211_CCMP_HDR_LEN; +-- ccmp_special_blocks(skb, pn, b_0, aad); +-- ieee80211_aes_ccm_encrypt(key->u.ccmp.tfm, b_0, aad, pos, len, +-- skb_put(skb, mic_len), mic_len); +-+ ccmp_special_blocks(skb, pn, scratch, 0); +-+ ieee80211_aes_ccm_encrypt(key->u.ccmp.tfm, scratch, pos, len, +-+ pos, skb_put(skb, IEEE80211_CCMP_MIC_LEN)); +- +- return 0; +- } +- +- +- ieee80211_tx_result +--ieee80211_crypto_ccmp_encrypt(struct ieee80211_tx_data *tx, +-- unsigned int mic_len) +-+ieee80211_crypto_ccmp_encrypt(struct ieee80211_tx_data *tx) +- { +- struct sk_buff *skb; +- +- ieee80211_tx_set_protected(tx); +- +- skb_queue_walk(&tx->skbs, skb) { +-- if (ccmp_encrypt_skb(tx, skb, mic_len) < 0) +-+ if (ccmp_encrypt_skb(tx, skb) < 0) +- return TX_DROP; +- } +- +-@@ -486,8 +487,7 @@ ieee80211_crypto_ccmp_encrypt(struct iee +- +- +- ieee80211_rx_result +--ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx, +-- unsigned int mic_len) +-+ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx) +- { +- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; +- int hdrlen; +-@@ -504,7 +504,8 @@ ieee80211_crypto_ccmp_decrypt(struct iee +- !ieee80211_is_robust_mgmt_frame(skb)) +- return RX_CONTINUE; +- +-- data_len = skb->len - hdrlen - IEEE80211_CCMP_HDR_LEN - mic_len; +-+ data_len = skb->len - hdrlen - IEEE80211_CCMP_HDR_LEN - +-+ IEEE80211_CCMP_MIC_LEN; +- if (!rx->sta || data_len < 0) +- return RX_DROP_UNUSABLE; +- +-@@ -526,23 +527,23 @@ ieee80211_crypto_ccmp_decrypt(struct iee +- } +- +- if (!(status->flag & RX_FLAG_DECRYPTED)) { +-- u8 aad[2 * AES_BLOCK_SIZE]; +-- u8 b_0[AES_BLOCK_SIZE]; +-+ u8 scratch[6 * AES_BLOCK_SIZE]; +- /* hardware didn't decrypt/verify MIC */ +-- ccmp_special_blocks(skb, pn, b_0, aad); +-+ ccmp_special_blocks(skb, pn, scratch, 1); +- +- if (ieee80211_aes_ccm_decrypt( +-- key->u.ccmp.tfm, b_0, aad, +-+ key->u.ccmp.tfm, scratch, +- skb->data + hdrlen + IEEE80211_CCMP_HDR_LEN, +- data_len, +-- skb->data + skb->len - mic_len, mic_len)) +-+ skb->data + skb->len - IEEE80211_CCMP_MIC_LEN, +-+ skb->data + hdrlen + IEEE80211_CCMP_HDR_LEN)) +- return RX_DROP_UNUSABLE; +- } +- +- memcpy(key->u.ccmp.rx_pn[queue], pn, IEEE80211_CCMP_PN_LEN); +- +- /* Remove CCMP header and MIC */ +-- if (pskb_trim(skb, skb->len - mic_len)) +-+ if (pskb_trim(skb, skb->len - IEEE80211_CCMP_MIC_LEN)) +- return RX_DROP_UNUSABLE; +- memmove(skb->data + IEEE80211_CCMP_HDR_LEN, skb->data, hdrlen); +- skb_pull(skb, IEEE80211_CCMP_HDR_LEN); +-@@ -550,229 +551,6 @@ ieee80211_crypto_ccmp_decrypt(struct iee +- return RX_CONTINUE; +- } +- +--static void gcmp_special_blocks(struct sk_buff *skb, u8 *pn, u8 *j_0, u8 *aad) +--{ +-- __le16 mask_fc; +-- u8 qos_tid; +-- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; +-- +-- memcpy(j_0, hdr->addr2, ETH_ALEN); +-- memcpy(&j_0[ETH_ALEN], pn, IEEE80211_GCMP_PN_LEN); +-- j_0[13] = 0; +-- j_0[14] = 0; +-- j_0[AES_BLOCK_SIZE - 1] = 0x01; +-- +-- /* AAD (extra authenticate-only data) / masked 802.11 header +-- * FC | A1 | A2 | A3 | SC | [A4] | [QC] +-- */ +-- put_unaligned_be16(ieee80211_hdrlen(hdr->frame_control) - 2, &aad[0]); +-- /* Mask FC: zero subtype b4 b5 b6 (if not mgmt) +-- * Retry, PwrMgt, MoreData; set Protected +-- */ +-- mask_fc = hdr->frame_control; +-- mask_fc &= ~cpu_to_le16(IEEE80211_FCTL_RETRY | +-- IEEE80211_FCTL_PM | IEEE80211_FCTL_MOREDATA); +-- if (!ieee80211_is_mgmt(hdr->frame_control)) +-- mask_fc &= ~cpu_to_le16(0x0070); +-- mask_fc |= cpu_to_le16(IEEE80211_FCTL_PROTECTED); +-- +-- put_unaligned(mask_fc, (__le16 *)&aad[2]); +-- memcpy(&aad[4], &hdr->addr1, 3 * ETH_ALEN); +-- +-- /* Mask Seq#, leave Frag# */ +-- aad[22] = *((u8 *)&hdr->seq_ctrl) & 0x0f; +-- aad[23] = 0; +-- +-- if (ieee80211_is_data_qos(hdr->frame_control)) +-- qos_tid = *ieee80211_get_qos_ctl(hdr) & +-- IEEE80211_QOS_CTL_TID_MASK; +-- else +-- qos_tid = 0; +-- +-- if (ieee80211_has_a4(hdr->frame_control)) { +-- memcpy(&aad[24], hdr->addr4, ETH_ALEN); +-- aad[30] = qos_tid; +-- aad[31] = 0; +-- } else { +-- memset(&aad[24], 0, ETH_ALEN + IEEE80211_QOS_CTL_LEN); +-- aad[24] = qos_tid; +-- } +--} +-- +--static inline void gcmp_pn2hdr(u8 *hdr, const u8 *pn, int key_id) +--{ +-- hdr[0] = pn[5]; +-- hdr[1] = pn[4]; +-- hdr[2] = 0; +-- hdr[3] = 0x20 | (key_id << 6); +-- hdr[4] = pn[3]; +-- hdr[5] = pn[2]; +-- hdr[6] = pn[1]; +-- hdr[7] = pn[0]; +--} +-- +--static inline void gcmp_hdr2pn(u8 *pn, const u8 *hdr) +--{ +-- pn[0] = hdr[7]; +-- pn[1] = hdr[6]; +-- pn[2] = hdr[5]; +-- pn[3] = hdr[4]; +-- pn[4] = hdr[1]; +-- pn[5] = hdr[0]; +--} +-- +--static int gcmp_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb) +--{ +-- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; +-- struct ieee80211_key *key = tx->key; +-- struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); +-- int hdrlen, len, tail; +-- u8 *pos; +-- u8 pn[6]; +-- u64 pn64; +-- u8 aad[2 * AES_BLOCK_SIZE]; +-- u8 j_0[AES_BLOCK_SIZE]; +-- +-- if (info->control.hw_key && +-- !(info->control.hw_key->flags & IEEE80211_KEY_FLAG_GENERATE_IV) && +-- !(info->control.hw_key->flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE) && +-- !((info->control.hw_key->flags & +-- IEEE80211_KEY_FLAG_GENERATE_IV_MGMT) && +-- ieee80211_is_mgmt(hdr->frame_control))) { +-- /* hwaccel has no need for preallocated room for GCMP +-- * header or MIC fields +-- */ +-- return 0; +-- } +-- +-- hdrlen = ieee80211_hdrlen(hdr->frame_control); +-- len = skb->len - hdrlen; +-- +-- if (info->control.hw_key) +-- tail = 0; +-- else +-- tail = IEEE80211_GCMP_MIC_LEN; +-- +-- if (WARN_ON(skb_tailroom(skb) < tail || +-- skb_headroom(skb) < IEEE80211_GCMP_HDR_LEN)) +-- return -1; +-- +-- pos = skb_push(skb, IEEE80211_GCMP_HDR_LEN); +-- memmove(pos, pos + IEEE80211_GCMP_HDR_LEN, hdrlen); +-- skb_set_network_header(skb, skb_network_offset(skb) + +-- IEEE80211_GCMP_HDR_LEN); +-- +-- /* the HW only needs room for the IV, but not the actual IV */ +-- if (info->control.hw_key && +-- (info->control.hw_key->flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE)) +-- return 0; +-- +-- hdr = (struct ieee80211_hdr *)pos; +-- pos += hdrlen; +-- +-- pn64 = atomic64_inc_return(&key->u.gcmp.tx_pn); +-- +-- pn[5] = pn64; +-- pn[4] = pn64 >> 8; +-- pn[3] = pn64 >> 16; +-- pn[2] = pn64 >> 24; +-- pn[1] = pn64 >> 32; +-- pn[0] = pn64 >> 40; +-- +-- gcmp_pn2hdr(pos, pn, key->conf.keyidx); +-- +-- /* hwaccel - with software GCMP header */ +-- if (info->control.hw_key) +-- return 0; +-- +-- pos += IEEE80211_GCMP_HDR_LEN; +-- gcmp_special_blocks(skb, pn, j_0, aad); +-- ieee80211_aes_gcm_encrypt(key->u.gcmp.tfm, j_0, aad, pos, len, +-- skb_put(skb, IEEE80211_GCMP_MIC_LEN)); +-- +-- return 0; +--} +-- +--ieee80211_tx_result +--ieee80211_crypto_gcmp_encrypt(struct ieee80211_tx_data *tx) +--{ +-- struct sk_buff *skb; +-- +-- ieee80211_tx_set_protected(tx); +-- +-- skb_queue_walk(&tx->skbs, skb) { +-- if (gcmp_encrypt_skb(tx, skb) < 0) +-- return TX_DROP; +-- } +-- +-- return TX_CONTINUE; +--} +-- +--ieee80211_rx_result +--ieee80211_crypto_gcmp_decrypt(struct ieee80211_rx_data *rx) +--{ +-- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; +-- int hdrlen; +-- struct ieee80211_key *key = rx->key; +-- struct sk_buff *skb = rx->skb; +-- struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); +-- u8 pn[IEEE80211_GCMP_PN_LEN]; +-- int data_len; +-- int queue; +-- +-- hdrlen = ieee80211_hdrlen(hdr->frame_control); +-- +-- if (!ieee80211_is_data(hdr->frame_control) && +-- !ieee80211_is_robust_mgmt_frame(skb)) +-- return RX_CONTINUE; +-- +-- data_len = skb->len - hdrlen - IEEE80211_GCMP_HDR_LEN - +-- IEEE80211_GCMP_MIC_LEN; +-- if (!rx->sta || data_len < 0) +-- return RX_DROP_UNUSABLE; +-- +-- if (status->flag & RX_FLAG_DECRYPTED) { +-- if (!pskb_may_pull(rx->skb, hdrlen + IEEE80211_GCMP_HDR_LEN)) +-- return RX_DROP_UNUSABLE; +-- } else { +-- if (skb_linearize(rx->skb)) +-- return RX_DROP_UNUSABLE; +-- } +-- +-- gcmp_hdr2pn(pn, skb->data + hdrlen); +-- +-- queue = rx->security_idx; +-- +-- if (memcmp(pn, key->u.gcmp.rx_pn[queue], IEEE80211_GCMP_PN_LEN) <= 0) { +-- key->u.gcmp.replays++; +-- return RX_DROP_UNUSABLE; +-- } +-- +-- if (!(status->flag & RX_FLAG_DECRYPTED)) { +-- u8 aad[2 * AES_BLOCK_SIZE]; +-- u8 j_0[AES_BLOCK_SIZE]; +-- /* hardware didn't decrypt/verify MIC */ +-- gcmp_special_blocks(skb, pn, j_0, aad); +-- +-- if (ieee80211_aes_gcm_decrypt( +-- key->u.gcmp.tfm, j_0, aad, +-- skb->data + hdrlen + IEEE80211_GCMP_HDR_LEN, +-- data_len, +-- skb->data + skb->len - IEEE80211_GCMP_MIC_LEN)) +-- return RX_DROP_UNUSABLE; +-- } +-- +-- memcpy(key->u.gcmp.rx_pn[queue], pn, IEEE80211_GCMP_PN_LEN); +-- +-- /* Remove GCMP header and MIC */ +-- if (pskb_trim(skb, skb->len - IEEE80211_GCMP_MIC_LEN)) +-- return RX_DROP_UNUSABLE; +-- memmove(skb->data + IEEE80211_GCMP_HDR_LEN, skb->data, hdrlen); +-- skb_pull(skb, IEEE80211_GCMP_HDR_LEN); +-- +-- return RX_CONTINUE; +--} +-- +- static ieee80211_tx_result +- ieee80211_crypto_cs_encrypt(struct ieee80211_tx_data *tx, +- struct sk_buff *skb) +-@@ -956,48 +734,6 @@ ieee80211_crypto_aes_cmac_encrypt(struct +- return TX_CONTINUE; +- } +- +--ieee80211_tx_result +--ieee80211_crypto_aes_cmac_256_encrypt(struct ieee80211_tx_data *tx) +--{ +-- struct sk_buff *skb; +-- struct ieee80211_tx_info *info; +-- struct ieee80211_key *key = tx->key; +-- struct ieee80211_mmie_16 *mmie; +-- u8 aad[20]; +-- u64 pn64; +-- +-- if (WARN_ON(skb_queue_len(&tx->skbs) != 1)) +-- return TX_DROP; +-- +-- skb = skb_peek(&tx->skbs); +-- +-- info = IEEE80211_SKB_CB(skb); +-- +-- if (info->control.hw_key) +-- return TX_CONTINUE; +-- +-- if (WARN_ON(skb_tailroom(skb) < sizeof(*mmie))) +-- return TX_DROP; +-- +-- mmie = (struct ieee80211_mmie_16 *)skb_put(skb, sizeof(*mmie)); +-- mmie->element_id = WLAN_EID_MMIE; +-- mmie->length = sizeof(*mmie) - 2; +-- mmie->key_id = cpu_to_le16(key->conf.keyidx); +-- +-- /* PN = PN + 1 */ +-- pn64 = atomic64_inc_return(&key->u.aes_cmac.tx_pn); +-- +-- bip_ipn_set64(mmie->sequence_number, pn64); +-- +-- bip_aad(skb, aad); +-- +-- /* MIC = AES-256-CMAC(IGTK, AAD || Management Frame Body || MMIE, 128) +-- */ +-- ieee80211_aes_cmac_256(key->u.aes_cmac.tfm, aad, +-- skb->data + 24, skb->len - 24, mmie->mic); +-- +-- return TX_CONTINUE; +--} +- +- ieee80211_rx_result +- ieee80211_crypto_aes_cmac_decrypt(struct ieee80211_rx_data *rx) +-@@ -1045,160 +781,6 @@ ieee80211_crypto_aes_cmac_decrypt(struct +- +- /* Remove MMIE */ +- skb_trim(skb, skb->len - sizeof(*mmie)); +-- +-- return RX_CONTINUE; +--} +-- +--ieee80211_rx_result +--ieee80211_crypto_aes_cmac_256_decrypt(struct ieee80211_rx_data *rx) +--{ +-- struct sk_buff *skb = rx->skb; +-- struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); +-- struct ieee80211_key *key = rx->key; +-- struct ieee80211_mmie_16 *mmie; +-- u8 aad[20], mic[16], ipn[6]; +-- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; +-- +-- if (!ieee80211_is_mgmt(hdr->frame_control)) +-- return RX_CONTINUE; +-- +-- /* management frames are already linear */ +-- +-- if (skb->len < 24 + sizeof(*mmie)) +-- return RX_DROP_UNUSABLE; +-- +-- mmie = (struct ieee80211_mmie_16 *) +-- (skb->data + skb->len - sizeof(*mmie)); +-- if (mmie->element_id != WLAN_EID_MMIE || +-- mmie->length != sizeof(*mmie) - 2) +-- return RX_DROP_UNUSABLE; /* Invalid MMIE */ +-- +-- bip_ipn_swap(ipn, mmie->sequence_number); +-- +-- if (memcmp(ipn, key->u.aes_cmac.rx_pn, 6) <= 0) { +-- key->u.aes_cmac.replays++; +-- return RX_DROP_UNUSABLE; +-- } +-- +-- if (!(status->flag & RX_FLAG_DECRYPTED)) { +-- /* hardware didn't decrypt/verify MIC */ +-- bip_aad(skb, aad); +-- ieee80211_aes_cmac_256(key->u.aes_cmac.tfm, aad, +-- skb->data + 24, skb->len - 24, mic); +-- if (memcmp(mic, mmie->mic, sizeof(mmie->mic)) != 0) { +-- key->u.aes_cmac.icverrors++; +-- return RX_DROP_UNUSABLE; +-- } +-- } +-- +-- memcpy(key->u.aes_cmac.rx_pn, ipn, 6); +-- +-- /* Remove MMIE */ +-- skb_trim(skb, skb->len - sizeof(*mmie)); +-- +-- return RX_CONTINUE; +--} +-- +--ieee80211_tx_result +--ieee80211_crypto_aes_gmac_encrypt(struct ieee80211_tx_data *tx) +--{ +-- struct sk_buff *skb; +-- struct ieee80211_tx_info *info; +-- struct ieee80211_key *key = tx->key; +-- struct ieee80211_mmie_16 *mmie; +-- struct ieee80211_hdr *hdr; +-- u8 aad[20]; +-- u64 pn64; +-- u8 nonce[12]; +-- +-- if (WARN_ON(skb_queue_len(&tx->skbs) != 1)) +-- return TX_DROP; +-- +-- skb = skb_peek(&tx->skbs); +-- +-- info = IEEE80211_SKB_CB(skb); +-- +-- if (info->control.hw_key) +-- return TX_CONTINUE; +-- +-- if (WARN_ON(skb_tailroom(skb) < sizeof(*mmie))) +-- return TX_DROP; +-- +-- mmie = (struct ieee80211_mmie_16 *)skb_put(skb, sizeof(*mmie)); +-- mmie->element_id = WLAN_EID_MMIE; +-- mmie->length = sizeof(*mmie) - 2; +-- mmie->key_id = cpu_to_le16(key->conf.keyidx); +-- +-- /* PN = PN + 1 */ +-- pn64 = atomic64_inc_return(&key->u.aes_gmac.tx_pn); +-- +-- bip_ipn_set64(mmie->sequence_number, pn64); +-- +-- bip_aad(skb, aad); +-- +-- hdr = (struct ieee80211_hdr *)skb->data; +-- memcpy(nonce, hdr->addr2, ETH_ALEN); +-- bip_ipn_swap(nonce + ETH_ALEN, mmie->sequence_number); +-- +-- /* MIC = AES-GMAC(IGTK, AAD || Management Frame Body || MMIE, 128) */ +-- if (ieee80211_aes_gmac(key->u.aes_gmac.tfm, aad, nonce, +-- skb->data + 24, skb->len - 24, mmie->mic) < 0) +-- return TX_DROP; +-- +-- return TX_CONTINUE; +--} +-- +--ieee80211_rx_result +--ieee80211_crypto_aes_gmac_decrypt(struct ieee80211_rx_data *rx) +--{ +-- struct sk_buff *skb = rx->skb; +-- struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); +-- struct ieee80211_key *key = rx->key; +-- struct ieee80211_mmie_16 *mmie; +-- u8 aad[20], mic[16], ipn[6], nonce[12]; +-- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; +-- +-- if (!ieee80211_is_mgmt(hdr->frame_control)) +-- return RX_CONTINUE; +-- +-- /* management frames are already linear */ +-- +-- if (skb->len < 24 + sizeof(*mmie)) +-- return RX_DROP_UNUSABLE; +-- +-- mmie = (struct ieee80211_mmie_16 *) +-- (skb->data + skb->len - sizeof(*mmie)); +-- if (mmie->element_id != WLAN_EID_MMIE || +-- mmie->length != sizeof(*mmie) - 2) +-- return RX_DROP_UNUSABLE; /* Invalid MMIE */ +-- +-- bip_ipn_swap(ipn, mmie->sequence_number); +-- +-- if (memcmp(ipn, key->u.aes_gmac.rx_pn, 6) <= 0) { +-- key->u.aes_gmac.replays++; +-- return RX_DROP_UNUSABLE; +-- } +-- +-- if (!(status->flag & RX_FLAG_DECRYPTED)) { +-- /* hardware didn't decrypt/verify MIC */ +-- bip_aad(skb, aad); +-- +-- memcpy(nonce, hdr->addr2, ETH_ALEN); +-- memcpy(nonce + ETH_ALEN, ipn, 6); +-- +-- if (ieee80211_aes_gmac(key->u.aes_gmac.tfm, aad, nonce, +-- skb->data + 24, skb->len - 24, +-- mic) < 0 || +-- memcmp(mic, mmie->mic, sizeof(mmie->mic)) != 0) { +-- key->u.aes_gmac.icverrors++; +-- return RX_DROP_UNUSABLE; +-- } +-- } +-- +-- memcpy(key->u.aes_gmac.rx_pn, ipn, 6); +-- +-- /* Remove MMIE */ +-- skb_trim(skb, skb->len - sizeof(*mmie)); +- +- return RX_CONTINUE; +- } +---- a/net/mac80211/wpa.h +-+++ b/net/mac80211/wpa.h +-@@ -24,32 +24,17 @@ ieee80211_rx_result +- ieee80211_crypto_tkip_decrypt(struct ieee80211_rx_data *rx); +- +- ieee80211_tx_result +--ieee80211_crypto_ccmp_encrypt(struct ieee80211_tx_data *tx, +-- unsigned int mic_len); +-+ieee80211_crypto_ccmp_encrypt(struct ieee80211_tx_data *tx); +- ieee80211_rx_result +--ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx, +-- unsigned int mic_len); +-+ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx); +- +- ieee80211_tx_result +- ieee80211_crypto_aes_cmac_encrypt(struct ieee80211_tx_data *tx); +--ieee80211_tx_result +--ieee80211_crypto_aes_cmac_256_encrypt(struct ieee80211_tx_data *tx); +- ieee80211_rx_result +- ieee80211_crypto_aes_cmac_decrypt(struct ieee80211_rx_data *rx); +--ieee80211_rx_result +--ieee80211_crypto_aes_cmac_256_decrypt(struct ieee80211_rx_data *rx); +--ieee80211_tx_result +--ieee80211_crypto_aes_gmac_encrypt(struct ieee80211_tx_data *tx); +--ieee80211_rx_result +--ieee80211_crypto_aes_gmac_decrypt(struct ieee80211_rx_data *rx); +- ieee80211_tx_result +- ieee80211_crypto_hw_encrypt(struct ieee80211_tx_data *tx); +- ieee80211_rx_result +- ieee80211_crypto_hw_decrypt(struct ieee80211_rx_data *rx); +- +--ieee80211_tx_result +--ieee80211_crypto_gcmp_encrypt(struct ieee80211_tx_data *tx); +--ieee80211_rx_result +--ieee80211_crypto_gcmp_decrypt(struct ieee80211_rx_data *rx); +-- +- #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 +--- 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 + + --- 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 + 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 +--- a/package/kernel/mac80211/patches/150-disable_addr_notifier.patch ++++ b/package/kernel/mac80211/patches/150-disable_addr_notifier.patch +@@ -18,7 +18,7 @@ + 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; + +@@ -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 + + return 0; + +@@ -52,7 +52,7 @@ + fail_ifa: + 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 + + pm_qos_remove_notifier(PM_QOS_NETWORK_LATENCY, + &local->network_latency_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 +--- 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 * + * the frames sent while scanning on other channel will be + * lost) + */ +diff --git a/package/kernel/mac80211/patches/300-ath9k-force-rx_clear-when-disabling-rx.patch b/package/kernel/mac80211/patches/300-ath9k-force-rx_clear-when-disabling-rx.patch +new file mode 100644 +index 0000000..bddb15a +--- /dev/null ++++ b/package/kernel/mac80211/patches/300-ath9k-force-rx_clear-when-disabling-rx.patch +@@ -0,0 +1,31 @@ ++From: Felix Fietkau ++Date: Sun, 7 Jun 2015 13:53:35 +0200 ++Subject: [PATCH] ath9k: force rx_clear when disabling rx ++ ++This makes stopping Rx more reliable and should reduce the frequency of ++Rx related DMA stop warnings ++ ++Cc: stable@vger.kernel.org ++Signed-off-by: Felix Fietkau ++--- ++ ++--- a/drivers/net/wireless/ath/ath9k/mac.c +++++ b/drivers/net/wireless/ath/ath9k/mac.c ++@@ -677,13 +677,15 @@ void ath9k_hw_startpcureceive(struct ath ++ ++ ath9k_ani_reset(ah, is_scanning); ++ ++- REG_CLR_BIT(ah, AR_DIAG_SW, (AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT)); +++ REG_CLR_BIT(ah, AR_DIAG_SW, +++ AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT | AR_DIAG_FORCE_RX_CLEAR); ++ } ++ EXPORT_SYMBOL(ath9k_hw_startpcureceive); ++ ++ void ath9k_hw_abortpcurecv(struct ath_hw *ah) ++ { ++- REG_SET_BIT(ah, AR_DIAG_SW, AR_DIAG_RX_ABORT | AR_DIAG_RX_DIS); +++ REG_SET_BIT(ah, AR_DIAG_SW, +++ AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT | AR_DIAG_FORCE_RX_CLEAR); ++ ++ ath9k_hw_disable_mib_counters(ah); ++ } +diff --git a/package/kernel/mac80211/patches/300-mac80211-add-an-intermediate-software-queue-implemen.patch b/package/kernel/mac80211/patches/300-mac80211-add-an-intermediate-software-queue-implemen.patch +deleted file mode 100644 +index 237121b..0000000 +--- a/package/kernel/mac80211/patches/300-mac80211-add-an-intermediate-software-queue-implemen.patch ++++ /dev/null +@@ -1,882 +0,0 @@ +-From: Felix Fietkau +-Date: Tue, 18 Nov 2014 23:58:51 +0100 +-Subject: [PATCH] mac80211: add an intermediate software queue implementation +- +-This allows drivers to request per-vif and per-sta-tid queues from which +-they can pull frames. This makes it easier to keep the hardware queues +-short, and to improve fairness between clients and vifs. +- +-The task of scheduling packet transmission is left up to the driver - +-queueing is controlled by mac80211. Drivers can only dequeue packets by +-calling ieee80211_tx_dequeue. This makes it possible to add active queue +-management later without changing drivers using this code. +- +-This can also be used as a starting point to implement A-MSDU +-aggregation in a way that does not add artificially induced latency. +- +-Signed-off-by: Felix Fietkau +---- +- +---- a/include/net/mac80211.h +-+++ b/include/net/mac80211.h +-@@ -84,6 +84,39 @@ +- * +- */ +- +-+/** +-+ * DOC: mac80211 software tx queueing +-+ * +-+ * mac80211 provides an optional intermediate queueing implementation designed +-+ * to allow the driver to keep hardware queues short and provide some fairness +-+ * between different stations/interfaces. +-+ * In this model, the driver pulls data frames from the mac80211 queue instead +-+ * of letting mac80211 push them via drv_tx(). +-+ * Other frames (e.g. control or management) are still pushed using drv_tx(). +-+ * +-+ * Drivers indicate that they use this model by implementing the .wake_tx_queue +-+ * driver operation. +-+ * +-+ * Intermediate queues (struct ieee80211_txq) are kept per-sta per-tid, with a +-+ * single per-vif queue for multicast data frames. +-+ * +-+ * The driver is expected to initialize its private per-queue data for stations +-+ * and interfaces in the .add_interface and .sta_add ops. +-+ * +-+ * The driver can't access the queue directly. To dequeue a frame, it calls +-+ * ieee80211_tx_dequeue(). Whenever mac80211 adds a new frame to a queue, it +-+ * calls the .wake_tx_queue driver op. +-+ * +-+ * For AP powersave TIM handling, the driver only needs to indicate if it has +-+ * buffered packets in the driver specific data structures by calling +-+ * ieee80211_sta_set_buffered(). For frames buffered in the ieee80211_txq +-+ * struct, mac80211 sets the appropriate TIM PVB bits and calls +-+ * .release_buffered_frames(). +-+ * In that callback the driver is therefore expected to release its own +-+ * buffered frames and afterwards also frames from the ieee80211_txq (obtained +-+ * via the usual ieee80211_tx_dequeue). +-+ */ +-+ +- struct device; +- +- /** +-@@ -1246,6 +1279,7 @@ enum ieee80211_vif_flags { +- * monitor interface (if that is requested.) +- * @drv_priv: data area for driver use, will always be aligned to +- * sizeof(void *). +-+ * @txq: the multicast data TX queue (if driver uses the TXQ abstraction) +- */ +- struct ieee80211_vif { +- enum nl80211_iftype type; +-@@ -1257,6 +1291,8 @@ struct ieee80211_vif { +- u8 cab_queue; +- u8 hw_queue[IEEE80211_NUM_ACS]; +- +-+ struct ieee80211_txq *txq; +-+ +- struct ieee80211_chanctx_conf __rcu *chanctx_conf; +- +- u32 driver_flags; +-@@ -1501,6 +1537,7 @@ struct ieee80211_sta_rates { +- * @tdls_initiator: indicates the STA is an initiator of the TDLS link. Only +- * valid if the STA is a TDLS peer in the first place. +- * @mfp: indicates whether the STA uses management frame protection or not. +-+ * @txq: per-TID data TX queues (if driver uses the TXQ abstraction) +- */ +- struct ieee80211_sta { +- u32 supp_rates[IEEE80211_NUM_BANDS]; +-@@ -1519,6 +1556,8 @@ struct ieee80211_sta { +- bool tdls_initiator; +- bool mfp; +- +-+ struct ieee80211_txq *txq[IEEE80211_NUM_TIDS]; +-+ +- /* must be last */ +- u8 drv_priv[0] __aligned(sizeof(void *)); +- }; +-@@ -1547,6 +1586,27 @@ struct ieee80211_tx_control { +- }; +- +- /** +-+ * struct ieee80211_txq - Software intermediate tx queue +-+ * +-+ * @vif: &struct ieee80211_vif pointer from the add_interface callback. +-+ * @sta: station table entry, %NULL for per-vif queue +-+ * @tid: the TID for this queue (unused for per-vif queue) +-+ * @ac: the AC for this queue +-+ * +-+ * The driver can obtain packets from this queue by calling +-+ * ieee80211_tx_dequeue(). +-+ */ +-+struct ieee80211_txq { +-+ struct ieee80211_vif *vif; +-+ struct ieee80211_sta *sta; +-+ u8 tid; +-+ u8 ac; +-+ +-+ /* must be last */ +-+ u8 drv_priv[0] __aligned(sizeof(void *)); +-+}; +-+ +-+/** +- * enum ieee80211_hw_flags - hardware flags +- * +- * These flags are used to indicate hardware capabilities to +-@@ -1770,6 +1830,8 @@ enum ieee80211_hw_flags { +- * within &struct ieee80211_sta. +- * @chanctx_data_size: size (in bytes) of the drv_priv data area +- * within &struct ieee80211_chanctx_conf. +-+ * @txq_data_size: size (in bytes) of the drv_priv data area +-+ * within @struct ieee80211_txq. +- * +- * @max_rates: maximum number of alternate rate retry stages the hw +- * can handle. +-@@ -1818,6 +1880,9 @@ enum ieee80211_hw_flags { +- * @n_cipher_schemes: a size of an array of cipher schemes definitions. +- * @cipher_schemes: a pointer to an array of cipher scheme definitions +- * supported by HW. +-+ * +-+ * @txq_ac_max_pending: maximum number of frames per AC pending in all txq +-+ * entries for a vif. +- */ +- struct ieee80211_hw { +- struct ieee80211_conf conf; +-@@ -1830,6 +1895,7 @@ struct ieee80211_hw { +- int vif_data_size; +- int sta_data_size; +- int chanctx_data_size; +-+ int txq_data_size; +- u16 queues; +- u16 max_listen_interval; +- s8 max_signal; +-@@ -1846,6 +1912,7 @@ struct ieee80211_hw { +- u8 uapsd_max_sp_len; +- u8 n_cipher_schemes; +- const struct ieee80211_cipher_scheme *cipher_schemes; +-+ int txq_ac_max_pending; +- }; +- +- /** +-@@ -3007,6 +3074,8 @@ enum ieee80211_reconfig_type { +- * response template is provided, together with the location of the +- * switch-timing IE within the template. The skb can only be used within +- * the function call. +-+ * +-+ * @wake_tx_queue: Called when new packets have been added to the queue. +- */ +- struct ieee80211_ops { +- void (*tx)(struct ieee80211_hw *hw, +-@@ -3238,6 +3307,9 @@ struct ieee80211_ops { +- void (*tdls_recv_channel_switch)(struct ieee80211_hw *hw, +- struct ieee80211_vif *vif, +- struct ieee80211_tdls_ch_sw_params *params); +-+ +-+ void (*wake_tx_queue)(struct ieee80211_hw *hw, +-+ struct ieee80211_txq *txq); +- }; +- +- /** +-@@ -5249,4 +5321,15 @@ void ieee80211_unreserve_tid(struct ieee +- */ +- size_t ieee80211_ie_split(const u8 *ies, size_t ielen, +- const u8 *ids, int n_ids, size_t offset); +-+ +-+/** +-+ * ieee80211_tx_dequeue - dequeue a packet from a software tx queue +-+ * +-+ * @hw: pointer as obtained from ieee80211_alloc_hw() +-+ * @txq: pointer obtained from station or virtual interface +-+ * +-+ * Returns the skb if successful, %NULL if no frame was available. +-+ */ +-+struct sk_buff *ieee80211_tx_dequeue(struct ieee80211_hw *hw, +-+ struct ieee80211_txq *txq); +- #endif /* MAC80211_H */ +---- a/net/mac80211/driver-ops.h +-+++ b/net/mac80211/driver-ops.h +-@@ -1367,4 +1367,16 @@ drv_tdls_recv_channel_switch(struct ieee +- trace_drv_return_void(local); +- } +- +-+static inline void drv_wake_tx_queue(struct ieee80211_local *local, +-+ struct txq_info *txq) +-+{ +-+ struct ieee80211_sub_if_data *sdata = vif_to_sdata(txq->txq.vif); +-+ +-+ if (!check_sdata_in_driver(sdata)) +-+ return; +-+ +-+ trace_drv_wake_tx_queue(local, sdata, txq); +-+ local->ops->wake_tx_queue(&local->hw, &txq->txq); +-+} +-+ +- #endif /* __MAC80211_DRIVER_OPS */ +---- a/net/mac80211/ieee80211_i.h +-+++ b/net/mac80211/ieee80211_i.h +-@@ -809,6 +809,19 @@ struct mac80211_qos_map { +- struct rcu_head rcu_head; +- }; +- +-+enum txq_info_flags { +-+ IEEE80211_TXQ_STOP, +-+ IEEE80211_TXQ_AMPDU, +-+}; +-+ +-+struct txq_info { +-+ struct sk_buff_head queue; +-+ unsigned long flags; +-+ +-+ /* keep last! */ +-+ struct ieee80211_txq txq; +-+}; +-+ +- struct ieee80211_sub_if_data { +- struct list_head list; +- +-@@ -853,6 +866,7 @@ struct ieee80211_sub_if_data { +- bool control_port_no_encrypt; +- int encrypt_headroom; +- +-+ atomic_t txqs_len[IEEE80211_NUM_ACS]; +- struct ieee80211_tx_queue_params tx_conf[IEEE80211_NUM_ACS]; +- struct mac80211_qos_map __rcu *qos_map; +- +-@@ -1453,6 +1467,10 @@ static inline struct ieee80211_local *hw +- return container_of(hw, struct ieee80211_local, hw); +- } +- +-+static inline struct txq_info *to_txq_info(struct ieee80211_txq *txq) +-+{ +-+ return container_of(txq, struct txq_info, txq); +-+} +- +- static inline int ieee80211_bssid_match(const u8 *raddr, const u8 *addr) +- { +-@@ -1905,6 +1923,9 @@ static inline bool ieee80211_can_run_wor +- return true; +- } +- +-+void ieee80211_init_tx_queue(struct ieee80211_sub_if_data *sdata, +-+ struct sta_info *sta, +-+ struct txq_info *txq, int tid); +- void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata, +- u16 transaction, u16 auth_alg, u16 status, +- const u8 *extra, size_t extra_len, const u8 *bssid, +---- a/net/mac80211/iface.c +-+++ b/net/mac80211/iface.c +-@@ -969,6 +969,13 @@ static void ieee80211_do_stop(struct iee +- } +- spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); +- +-+ if (sdata->vif.txq) { +-+ struct txq_info *txqi = to_txq_info(sdata->vif.txq); +-+ +-+ ieee80211_purge_tx_queue(&local->hw, &txqi->queue); +-+ atomic_set(&sdata->txqs_len[txqi->txq.ac], 0); +-+ } +-+ +- if (local->open_count == 0) +- ieee80211_clear_tx_pending(local); +- +-@@ -1674,6 +1681,7 @@ int ieee80211_if_add(struct ieee80211_lo +- { +- struct net_device *ndev = NULL; +- struct ieee80211_sub_if_data *sdata = NULL; +-+ struct txq_info *txqi; +- int ret, i; +- int txqs = 1; +- +-@@ -1693,10 +1701,18 @@ int ieee80211_if_add(struct ieee80211_lo +- ieee80211_assign_perm_addr(local, wdev->address, type); +- memcpy(sdata->vif.addr, wdev->address, ETH_ALEN); +- } else { +-+ int size = ALIGN(sizeof(*sdata) + local->hw.vif_data_size, +-+ sizeof(void *)); +-+ int txq_size = 0; +-+ +-+ if (local->ops->wake_tx_queue) +-+ txq_size += sizeof(struct txq_info) + +-+ local->hw.txq_data_size; +-+ +- if (local->hw.queues >= IEEE80211_NUM_ACS) +- txqs = IEEE80211_NUM_ACS; +- +-- ndev = alloc_netdev_mqs(sizeof(*sdata) + local->hw.vif_data_size, +-+ ndev = alloc_netdev_mqs(size + txq_size, +- name, NET_NAME_UNKNOWN, +- ieee80211_if_setup, txqs, 1); +- if (!ndev) +-@@ -1731,6 +1747,11 @@ int ieee80211_if_add(struct ieee80211_lo +- memcpy(sdata->vif.addr, ndev->dev_addr, ETH_ALEN); +- memcpy(sdata->name, ndev->name, IFNAMSIZ); +- +-+ if (txq_size) { +-+ txqi = netdev_priv(ndev) + size; +-+ ieee80211_init_tx_queue(sdata, NULL, txqi, 0); +-+ } +-+ +- sdata->dev = ndev; +- } +- +---- a/net/mac80211/main.c +-+++ b/net/mac80211/main.c +-@@ -1019,6 +1019,9 @@ int ieee80211_register_hw(struct ieee802 +- +- local->dynamic_ps_forced_timeout = -1; +- +-+ if (!local->hw.txq_ac_max_pending) +-+ local->hw.txq_ac_max_pending = 64; +-+ +- result = ieee80211_wep_init(local); +- if (result < 0) +- wiphy_debug(local->hw.wiphy, "Failed to initialize wep: %d\n", +---- a/net/mac80211/sta_info.c +-+++ b/net/mac80211/sta_info.c +-@@ -118,6 +118,16 @@ static void __cleanup_single_sta(struct +- atomic_dec(&ps->num_sta_ps); +- } +- +-+ if (sta->sta.txq[0]) { +-+ for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) { +-+ struct txq_info *txqi = to_txq_info(sta->sta.txq[i]); +-+ int n = skb_queue_len(&txqi->queue); +-+ +-+ ieee80211_purge_tx_queue(&local->hw, &txqi->queue); +-+ atomic_sub(n, &sdata->txqs_len[txqi->txq.ac]); +-+ } +-+ } +-+ +- for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) { +- local->total_ps_buffered -= skb_queue_len(&sta->ps_tx_buf[ac]); +- ieee80211_purge_tx_queue(&local->hw, &sta->ps_tx_buf[ac]); +-@@ -234,6 +244,8 @@ void sta_info_free(struct ieee80211_loca +- +- sta_dbg(sta->sdata, "Destroyed STA %pM\n", sta->sta.addr); +- +-+ if (sta->sta.txq[0]) +-+ kfree(to_txq_info(sta->sta.txq[0])); +- kfree(rcu_dereference_raw(sta->sta.rates)); +- kfree(sta); +- } +-@@ -285,11 +297,12 @@ struct sta_info *sta_info_alloc(struct i +- const u8 *addr, gfp_t gfp) +- { +- struct ieee80211_local *local = sdata->local; +-+ struct ieee80211_hw *hw = &local->hw; +- struct sta_info *sta; +- struct timespec uptime; +- int i; +- +-- sta = kzalloc(sizeof(*sta) + local->hw.sta_data_size, gfp); +-+ sta = kzalloc(sizeof(*sta) + hw->sta_data_size, gfp); +- if (!sta) +- return NULL; +- +-@@ -321,11 +334,25 @@ struct sta_info *sta_info_alloc(struct i +- for (i = 0; i < ARRAY_SIZE(sta->chain_signal_avg); i++) +- ewma_init(&sta->chain_signal_avg[i], 1024, 8); +- +-- if (sta_prepare_rate_control(local, sta, gfp)) { +-- kfree(sta); +-- return NULL; +-+ if (local->ops->wake_tx_queue) { +-+ void *txq_data; +-+ int size = sizeof(struct txq_info) + +-+ ALIGN(hw->txq_data_size, sizeof(void *)); +-+ +-+ txq_data = kcalloc(ARRAY_SIZE(sta->sta.txq), size, gfp); +-+ if (!txq_data) +-+ goto free; +-+ +-+ for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) { +-+ struct txq_info *txq = txq_data + i * size; +-+ +-+ ieee80211_init_tx_queue(sdata, sta, txq, i); +-+ } +- } +- +-+ if (sta_prepare_rate_control(local, sta, gfp)) +-+ goto free_txq; +-+ +- for (i = 0; i < IEEE80211_NUM_TIDS; i++) { +- /* +- * timer_to_tid must be initialized with identity mapping +-@@ -346,7 +373,7 @@ struct sta_info *sta_info_alloc(struct i +- if (sdata->vif.type == NL80211_IFTYPE_AP || +- sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { +- struct ieee80211_supported_band *sband = +-- local->hw.wiphy->bands[ieee80211_get_sdata_band(sdata)]; +-+ hw->wiphy->bands[ieee80211_get_sdata_band(sdata)]; +- u8 smps = (sband->ht_cap.cap & IEEE80211_HT_CAP_SM_PS) >> +- IEEE80211_HT_CAP_SM_PS_SHIFT; +- /* +-@@ -371,6 +398,13 @@ struct sta_info *sta_info_alloc(struct i +- sta_dbg(sdata, "Allocated STA %pM\n", sta->sta.addr); +- +- return sta; +-+ +-+free_txq: +-+ if (sta->sta.txq[0]) +-+ kfree(to_txq_info(sta->sta.txq[0])); +-+free: +-+ kfree(sta); +-+ return NULL; +- } +- +- static int sta_info_insert_check(struct sta_info *sta) +-@@ -640,6 +674,8 @@ static void __sta_info_recalc_tim(struct +- +- indicate_tim |= +- sta->driver_buffered_tids & tids; +-+ indicate_tim |= +-+ sta->txq_buffered_tids & tids; +- } +- +- done: +-@@ -1071,7 +1107,7 @@ void ieee80211_sta_ps_deliver_wakeup(str +- struct ieee80211_sub_if_data *sdata = sta->sdata; +- struct ieee80211_local *local = sdata->local; +- struct sk_buff_head pending; +-- int filtered = 0, buffered = 0, ac; +-+ int filtered = 0, buffered = 0, ac, i; +- unsigned long flags; +- struct ps_data *ps; +- +-@@ -1090,10 +1126,22 @@ void ieee80211_sta_ps_deliver_wakeup(str +- +- BUILD_BUG_ON(BITS_TO_LONGS(IEEE80211_NUM_TIDS) > 1); +- sta->driver_buffered_tids = 0; +-+ sta->txq_buffered_tids = 0; +- +- if (!(local->hw.flags & IEEE80211_HW_AP_LINK_PS)) +- drv_sta_notify(local, sdata, STA_NOTIFY_AWAKE, &sta->sta); +- +-+ if (sta->sta.txq[0]) { +-+ for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) { +-+ struct txq_info *txqi = to_txq_info(sta->sta.txq[i]); +-+ +-+ if (!skb_queue_len(&txqi->queue)) +-+ continue; +-+ +-+ drv_wake_tx_queue(local, txqi); +-+ } +-+ } +-+ +- skb_queue_head_init(&pending); +- +- /* sync with ieee80211_tx_h_unicast_ps_buf */ +-@@ -1275,8 +1323,10 @@ ieee80211_sta_ps_deliver_response(struct +- /* if we already have frames from software, then we can't also +- * release from hardware queues +- */ +-- if (skb_queue_empty(&frames)) +-+ if (skb_queue_empty(&frames)) { +- driver_release_tids |= sta->driver_buffered_tids & tids; +-+ driver_release_tids |= sta->txq_buffered_tids & tids; +-+ } +- +- if (driver_release_tids) { +- /* If the driver has data on more than one TID then +-@@ -1447,6 +1497,9 @@ ieee80211_sta_ps_deliver_response(struct +- +- sta_info_recalc_tim(sta); +- } else { +-+ unsigned long tids = sta->txq_buffered_tids & driver_release_tids; +-+ int tid; +-+ +- /* +- * We need to release a frame that is buffered somewhere in the +- * driver ... it'll have to handle that. +-@@ -1466,8 +1519,22 @@ ieee80211_sta_ps_deliver_response(struct +- * that the TID(s) became empty before returning here from the +- * release function. +- * Either way, however, when the driver tells us that the TID(s) +-- * became empty we'll do the TIM recalculation. +-+ * became empty or we find that a txq became empty, we'll do the +-+ * TIM recalculation. +- */ +-+ +-+ if (!sta->sta.txq[0]) +-+ return; +-+ +-+ for (tid = 0; tid < ARRAY_SIZE(sta->sta.txq); tid++) { +-+ struct txq_info *txqi = to_txq_info(sta->sta.txq[tid]); +-+ +-+ if (!(tids & BIT(tid)) || skb_queue_len(&txqi->queue)) +-+ continue; +-+ +-+ sta_info_recalc_tim(sta); +-+ break; +-+ } +- } +- } +- +---- a/net/mac80211/sta_info.h +-+++ b/net/mac80211/sta_info.h +-@@ -274,6 +274,7 @@ struct sta_ampdu_mlme { +- * entered power saving state, these are also delivered to +- * the station when it leaves powersave or polls for frames +- * @driver_buffered_tids: bitmap of TIDs the driver has data buffered on +-+ * @txq_buffered_tids: bitmap of TIDs that mac80211 has txq data buffered on +- * @rx_packets: Number of MSDUs received from this STA +- * @rx_bytes: Number of bytes received from this STA +- * @last_rx: time (in jiffies) when last frame was received from this STA +-@@ -368,6 +369,7 @@ struct sta_info { +- struct sk_buff_head ps_tx_buf[IEEE80211_NUM_ACS]; +- struct sk_buff_head tx_filtered[IEEE80211_NUM_ACS]; +- unsigned long driver_buffered_tids; +-+ unsigned long txq_buffered_tids; +- +- /* Updated from RX path only, no locking requirements */ +- unsigned long rx_packets; +---- a/net/mac80211/trace.h +-+++ b/net/mac80211/trace.h +-@@ -2312,6 +2312,37 @@ TRACE_EVENT(drv_tdls_recv_channel_switch +- ) +- ); +- +-+TRACE_EVENT(drv_wake_tx_queue, +-+ TP_PROTO(struct ieee80211_local *local, +-+ struct ieee80211_sub_if_data *sdata, +-+ struct txq_info *txq), +-+ +-+ TP_ARGS(local, sdata, txq), +-+ +-+ TP_STRUCT__entry( +-+ LOCAL_ENTRY +-+ VIF_ENTRY +-+ STA_ENTRY +-+ __field(u8, ac) +-+ __field(u8, tid) +-+ ), +-+ +-+ TP_fast_assign( +-+ struct ieee80211_sta *sta = txq->txq.sta; +-+ +-+ LOCAL_ASSIGN; +-+ VIF_ASSIGN; +-+ STA_ASSIGN; +-+ __entry->ac = txq->txq.ac; +-+ __entry->tid = txq->txq.tid; +-+ ), +-+ +-+ TP_printk( +-+ LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " ac:%d tid:%d", +-+ LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->ac, __entry->tid +-+ ) +-+); +-+ +- #ifdef CPTCFG_MAC80211_MESSAGE_TRACING +- #undef TRACE_SYSTEM +- #define TRACE_SYSTEM mac80211_msg +---- a/net/mac80211/tx.c +-+++ b/net/mac80211/tx.c +-@@ -776,12 +776,22 @@ ieee80211_tx_h_rate_ctrl(struct ieee8021 +- return TX_CONTINUE; +- } +- +-+static __le16 ieee80211_tx_next_seq(struct sta_info *sta, int tid) +-+{ +-+ u16 *seq = &sta->tid_seq[tid]; +-+ __le16 ret = cpu_to_le16(*seq); +-+ +-+ /* Increase the sequence number. */ +-+ *seq = (*seq + 0x10) & IEEE80211_SCTL_SEQ; +-+ +-+ return ret; +-+} +-+ +- static ieee80211_tx_result debug_noinline +- ieee80211_tx_h_sequence(struct ieee80211_tx_data *tx) +- { +- struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); +- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; +-- u16 *seq; +- u8 *qc; +- int tid; +- +-@@ -832,13 +842,10 @@ ieee80211_tx_h_sequence(struct ieee80211 +- +- qc = ieee80211_get_qos_ctl(hdr); +- tid = *qc & IEEE80211_QOS_CTL_TID_MASK; +-- seq = &tx->sta->tid_seq[tid]; +- tx->sta->tx_msdu[tid]++; +- +-- hdr->seq_ctrl = cpu_to_le16(*seq); +-- +-- /* Increase the sequence number. */ +-- *seq = (*seq + 0x10) & IEEE80211_SCTL_SEQ; +-+ if (!tx->sta->sta.txq[0]) +-+ hdr->seq_ctrl = ieee80211_tx_next_seq(tx->sta, tid); +- +- return TX_CONTINUE; +- } +-@@ -1067,7 +1074,7 @@ static bool ieee80211_tx_prep_agg(struct +- * nothing -- this aggregation session is being started +- * but that might still fail with the driver +- */ +-- } else { +-+ } else if (!tx->sta->sta.txq[tid]) { +- spin_lock(&tx->sta->lock); +- /* +- * Need to re-check now, because we may get here +-@@ -1201,13 +1208,102 @@ ieee80211_tx_prepare(struct ieee80211_su +- return TX_CONTINUE; +- } +- +-+static void ieee80211_drv_tx(struct ieee80211_local *local, +-+ struct ieee80211_vif *vif, +-+ struct ieee80211_sta *pubsta, +-+ struct sk_buff *skb) +-+{ +-+ struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; +-+ struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); +-+ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); +-+ struct ieee80211_tx_control control = { +-+ .sta = pubsta, +-+ }; +-+ struct ieee80211_txq *txq = NULL; +-+ struct txq_info *txqi; +-+ u8 ac; +-+ +-+ if (info->control.flags & IEEE80211_TX_CTRL_PS_RESPONSE) +-+ goto tx_normal; +-+ +-+ if (!ieee80211_is_data(hdr->frame_control)) +-+ goto tx_normal; +-+ +-+ if (pubsta) { +-+ u8 tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK; +-+ +-+ txq = pubsta->txq[tid]; +-+ } else if (vif) { +-+ txq = vif->txq; +-+ } +-+ +-+ if (!txq) +-+ goto tx_normal; +-+ +-+ ac = txq->ac; +-+ txqi = to_txq_info(txq); +-+ atomic_inc(&sdata->txqs_len[ac]); +-+ if (atomic_read(&sdata->txqs_len[ac]) >= local->hw.txq_ac_max_pending) +-+ netif_stop_subqueue(sdata->dev, ac); +-+ +-+ skb_queue_tail(&txqi->queue, skb); +-+ drv_wake_tx_queue(local, txqi); +-+ +-+ return; +-+ +-+tx_normal: +-+ drv_tx(local, &control, skb); +-+} +-+ +-+struct sk_buff *ieee80211_tx_dequeue(struct ieee80211_hw *hw, +-+ struct ieee80211_txq *txq) +-+{ +-+ struct ieee80211_local *local = hw_to_local(hw); +-+ struct ieee80211_sub_if_data *sdata = vif_to_sdata(txq->vif); +-+ struct txq_info *txqi = container_of(txq, struct txq_info, txq); +-+ struct ieee80211_hdr *hdr; +-+ struct sk_buff *skb = NULL; +-+ u8 ac = txq->ac; +-+ +-+ spin_lock_bh(&txqi->queue.lock); +-+ +-+ if (test_bit(IEEE80211_TXQ_STOP, &txqi->flags)) +-+ goto out; +-+ +-+ skb = __skb_dequeue(&txqi->queue); +-+ if (!skb) +-+ goto out; +-+ +-+ atomic_dec(&sdata->txqs_len[ac]); +-+ if (__netif_subqueue_stopped(sdata->dev, ac)) +-+ ieee80211_propagate_queue_wake(local, sdata->vif.hw_queue[ac]); +-+ +-+ hdr = (struct ieee80211_hdr *)skb->data; +-+ if (txq->sta && ieee80211_is_data_qos(hdr->frame_control)) { +-+ struct sta_info *sta = container_of(txq->sta, struct sta_info, +-+ sta); +-+ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); +-+ +-+ hdr->seq_ctrl = ieee80211_tx_next_seq(sta, txq->tid); +-+ if (test_bit(IEEE80211_TXQ_AMPDU, &txqi->flags)) +-+ info->flags |= IEEE80211_TX_CTL_AMPDU; +-+ else +-+ info->flags &= ~IEEE80211_TX_CTL_AMPDU; +-+ } +-+ +-+out: +-+ spin_unlock_bh(&txqi->queue.lock); +-+ +-+ return skb; +-+} +-+EXPORT_SYMBOL(ieee80211_tx_dequeue); +-+ +- static bool ieee80211_tx_frags(struct ieee80211_local *local, +- struct ieee80211_vif *vif, +- struct ieee80211_sta *sta, +- struct sk_buff_head *skbs, +- bool txpending) +- { +-- struct ieee80211_tx_control control; +- struct sk_buff *skb, *tmp; +- unsigned long flags; +- +-@@ -1265,10 +1361,9 @@ static bool ieee80211_tx_frags(struct ie +- spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); +- +- info->control.vif = vif; +-- control.sta = sta; +- +- __skb_unlink(skb, skbs); +-- drv_tx(local, &control, skb); +-+ ieee80211_drv_tx(local, vif, sta, skb); +- } +- +- return true; +---- a/net/mac80211/util.c +-+++ b/net/mac80211/util.c +-@@ -308,6 +308,11 @@ void ieee80211_propagate_queue_wake(stru +- for (ac = 0; ac < n_acs; ac++) { +- int ac_queue = sdata->vif.hw_queue[ac]; +- +-+ if (local->ops->wake_tx_queue && +-+ (atomic_read(&sdata->txqs_len[ac]) > +-+ local->hw.txq_ac_max_pending)) +-+ continue; +-+ +- if (ac_queue == queue || +- (sdata->vif.cab_queue == queue && +- local->queue_stop_reasons[ac_queue] == 0 && +-@@ -3307,3 +3312,20 @@ u8 *ieee80211_add_wmm_info_ie(u8 *buf, u +- +- return buf; +- } +-+ +-+void ieee80211_init_tx_queue(struct ieee80211_sub_if_data *sdata, +-+ struct sta_info *sta, +-+ struct txq_info *txqi, int tid) +-+{ +-+ skb_queue_head_init(&txqi->queue); +-+ txqi->txq.vif = &sdata->vif; +-+ +-+ if (sta) { +-+ txqi->txq.sta = &sta->sta; +-+ sta->sta.txq[tid] = &txqi->txq; +-+ txqi->txq.ac = ieee802_1d_to_ac[tid & 7]; +-+ } else { +-+ sdata->vif.txq = &txqi->txq; +-+ txqi->txq.ac = IEEE80211_AC_BE; +-+ } +-+} +---- a/net/mac80211/rx.c +-+++ b/net/mac80211/rx.c +-@@ -1176,6 +1176,7 @@ static void sta_ps_start(struct sta_info +- struct ieee80211_sub_if_data *sdata = sta->sdata; +- struct ieee80211_local *local = sdata->local; +- struct ps_data *ps; +-+ int tid; +- +- if (sta->sdata->vif.type == NL80211_IFTYPE_AP || +- sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN) +-@@ -1189,6 +1190,18 @@ static void sta_ps_start(struct sta_info +- drv_sta_notify(local, sdata, STA_NOTIFY_SLEEP, &sta->sta); +- ps_dbg(sdata, "STA %pM aid %d enters power save mode\n", +- sta->sta.addr, sta->sta.aid); +-+ +-+ if (!sta->sta.txq[0]) +-+ return; +-+ +-+ for (tid = 0; tid < ARRAY_SIZE(sta->sta.txq); tid++) { +-+ struct txq_info *txqi = to_txq_info(sta->sta.txq[tid]); +-+ +-+ if (!skb_queue_len(&txqi->queue)) +-+ set_bit(tid, &sta->txq_buffered_tids); +-+ else +-+ clear_bit(tid, &sta->txq_buffered_tids); +-+ } +- } +- +- static void sta_ps_end(struct sta_info *sta) +---- a/net/mac80211/agg-tx.c +-+++ b/net/mac80211/agg-tx.c +-@@ -188,6 +188,43 @@ ieee80211_wake_queue_agg(struct ieee8021 +- __release(agg_queue); +- } +- +-+static void +-+ieee80211_agg_stop_txq(struct sta_info *sta, int tid) +-+{ +-+ struct ieee80211_txq *txq = sta->sta.txq[tid]; +-+ struct txq_info *txqi; +-+ +-+ if (!txq) +-+ return; +-+ +-+ txqi = to_txq_info(txq); +-+ +-+ /* Lock here to protect against further seqno updates on dequeue */ +-+ spin_lock_bh(&txqi->queue.lock); +-+ set_bit(IEEE80211_TXQ_STOP, &txqi->flags); +-+ spin_unlock_bh(&txqi->queue.lock); +-+} +-+ +-+static void +-+ieee80211_agg_start_txq(struct sta_info *sta, int tid, bool enable) +-+{ +-+ struct ieee80211_txq *txq = sta->sta.txq[tid]; +-+ struct txq_info *txqi; +-+ +-+ if (!txq) +-+ return; +-+ +-+ txqi = to_txq_info(txq); +-+ +-+ if (enable) +-+ set_bit(IEEE80211_TXQ_AMPDU, &txqi->flags); +-+ else +-+ clear_bit(IEEE80211_TXQ_AMPDU, &txqi->flags); +-+ +-+ clear_bit(IEEE80211_TXQ_STOP, &txqi->flags); +-+ drv_wake_tx_queue(sta->sdata->local, txqi); +-+} +-+ +- /* +- * splice packets from the STA's pending to the local pending, +- * requires a call to ieee80211_agg_splice_finish later +-@@ -247,6 +284,7 @@ static void ieee80211_remove_tid_tx(stru +- ieee80211_assign_tid_tx(sta, tid, NULL); +- +- ieee80211_agg_splice_finish(sta->sdata, tid); +-+ ieee80211_agg_start_txq(sta, tid, false); +- +- kfree_rcu(tid_tx, rcu_head); +- } +-@@ -418,6 +456,8 @@ void ieee80211_tx_ba_session_handle_star +- */ +- clear_bit(HT_AGG_STATE_WANT_START, &tid_tx->state); +- +-+ ieee80211_agg_stop_txq(sta, tid); +-+ +- /* +- * Make sure no packets are being processed. This ensures that +- * we have a valid starting sequence number and that in-flight +-@@ -440,6 +480,8 @@ void ieee80211_tx_ba_session_handle_star +- ieee80211_agg_splice_finish(sdata, tid); +- spin_unlock_bh(&sta->lock); +- +-+ ieee80211_agg_start_txq(sta, tid, false); +-+ +- kfree_rcu(tid_tx, rcu_head); +- return; +- } +-@@ -666,6 +708,8 @@ static void ieee80211_agg_tx_operational +- ieee80211_agg_splice_finish(sta->sdata, tid); +- +- spin_unlock_bh(&sta->lock); +-+ +-+ ieee80211_agg_start_txq(sta, tid, true); +- } +- +- 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 +--- /dev/null ++++ b/package/kernel/mac80211/patches/301-ath9k-limit-retries-for-powersave-response-frames.patch +@@ -0,0 +1,121 @@ ++From: Felix Fietkau ++Date: Thu, 2 Jul 2015 15:20:56 +0200 ++Subject: [PATCH] ath9k: limit retries for powersave response frames ++ ++In some cases, the channel might be busy enough that an ath9k AP's ++response to PS-Poll frames might be too slow and the station has already ++gone to sleep. To avoid wasting too much airtime on this, limit the ++number of retries on such frames and ensure that no sample rate gets ++used. ++ ++Signed-off-by: Felix Fietkau ++--- ++ ++--- 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_ ++ } ++ ++ static void ath_set_rates(struct ieee80211_vif *vif, struct ieee80211_sta *sta, ++- struct ath_buf *bf) +++ struct ath_buf *bf, bool ps) ++ { +++ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(bf->bf_mpdu); +++ +++ if (ps) { +++ /* Clear the first rate to avoid using a sample rate for PS frames */ +++ info->control.rates[0].idx = -1; +++ info->control.rates[0].count = 0; +++ } +++ ++ ieee80211_get_tx_rates(vif, sta, bf->bf_mpdu, bf->rates, ++ ARRAY_SIZE(bf->rates)); +++ if (!ps) +++ return; +++ +++ if (bf->rates[0].count > 2) +++ bf->rates[0].count = 2; +++ +++ bf->rates[1].idx = -1; ++ } ++ ++ 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, ++ if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) ++ break; ++ ++- ath_set_rates(tid->an->vif, tid->an->sta, bf); +++ ath_set_rates(tid->an->vif, tid->an->sta, bf, false); ++ } while (1); ++ } ++ ++@@ -1461,7 +1476,7 @@ static bool ath_tx_sched_aggr(struct ath ++ return false; ++ } ++ ++- ath_set_rates(tid->an->vif, tid->an->sta, bf); +++ ath_set_rates(tid->an->vif, tid->an->sta, bf, false); ++ 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 ++ ++ __skb_unlink(bf->bf_mpdu, tid_q); ++ list_add_tail(&bf->list, &bf_q); ++- ath_set_rates(tid->an->vif, tid->an->sta, bf); +++ ath_set_rates(tid->an->vif, tid->an->sta, bf, true); ++ 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 ++ struct ath_txq *txq = txctl->txq; ++ struct ath_atx_tid *tid = NULL; ++ struct ath_buf *bf; ++- bool queue, skip_uapsd = false, ps_resp; +++ bool queue, ps_resp; ++ int q, ret; ++ ++ if (vif) ++@@ -2365,13 +2380,13 @@ int ath_tx_start(struct ieee80211_hw *hw ++ if (!txctl->an) ++ txctl->an = &avp->mcast_node; ++ queue = true; ++- skip_uapsd = true; +++ ps_resp = false; ++ } ++ ++ if (txctl->an && queue) ++ tid = ath_get_skb_tid(sc, txctl->an, skb); ++ ++- if (!skip_uapsd && ps_resp) { +++ if (ps_resp) { ++ 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 ++ if (txctl->paprd) ++ bf->bf_state.bfs_paprd_timestamp = jiffies; ++ ++- ath_set_rates(vif, sta, bf); +++ ath_set_rates(vif, sta, bf, ps_resp); ++ ath_tx_send_normal(sc, txq, tid, skb); ++ ++ out: ++@@ -2448,7 +2463,7 @@ void ath_tx_cabq(struct ieee80211_hw *hw ++ break; ++ ++ bf->bf_lastbf = bf; ++- ath_set_rates(vif, NULL, bf); +++ ath_set_rates(vif, NULL, bf, false); ++ 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 ++ return -EINVAL; ++ } ++ ++- ath_set_rates(sc->tx99_vif, NULL, bf); +++ ath_set_rates(sc->tx99_vif, NULL, bf, false); ++ ++ ath9k_hw_set_desc_link(sc->sc_ah, bf->bf_desc, bf->bf_daddr); ++ ath9k_hw_tx99_start(sc->sc_ah, txctl->txq->axq_qnum); +diff --git a/package/kernel/mac80211/patches/301-mac80211-lock-rate-control.patch b/package/kernel/mac80211/patches/301-mac80211-lock-rate-control.patch +deleted file mode 100644 +index 465d943..0000000 +--- a/package/kernel/mac80211/patches/301-mac80211-lock-rate-control.patch ++++ /dev/null +@@ -1,125 +0,0 @@ +-From: Johannes Berg +-Date: Wed, 11 Mar 2015 09:14:15 +0100 +-Subject: [PATCH] mac80211: lock rate control +- +-Both minstrel (reported by Sven Eckelmann) and the iwlwifi rate +-control aren't properly taking concurrency into account. It's +-likely that the same is true for other rate control algorithms. +- +-In the case of minstrel this manifests itself in crashes when an +-update and other data access are run concurrently, for example +-when the stations change bandwidth or similar. In iwlwifi, this +-can cause firmware crashes. +- +-Since fixing all rate control algorithms will be very difficult, +-just provide locking for invocations. This protects the internal +-data structures the algorithms maintain. +- +-I've manipulated hostapd to test this, by having it change its +-advertised bandwidth roughly ever 150ms. At the same time, I'm +-running a flood ping between the client and the AP, which causes +-this race of update vs. get_rate/status to easily happen on the +-client. With this change, the system survives this test. +- +-Reported-by: Sven Eckelmann +-Signed-off-by: Johannes Berg +---- +- +---- a/net/mac80211/rate.c +-+++ b/net/mac80211/rate.c +-@@ -683,7 +683,13 @@ void rate_control_get_rate(struct ieee80 +- if (sdata->local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL) +- return; +- +-- ref->ops->get_rate(ref->priv, ista, priv_sta, txrc); +-+ if (ista) { +-+ spin_lock_bh(&sta->rate_ctrl_lock); +-+ ref->ops->get_rate(ref->priv, ista, priv_sta, txrc); +-+ spin_unlock_bh(&sta->rate_ctrl_lock); +-+ } else { +-+ ref->ops->get_rate(ref->priv, NULL, NULL, txrc); +-+ } +- +- if (sdata->local->hw.flags & IEEE80211_HW_SUPPORTS_RC_TABLE) +- return; +---- a/net/mac80211/rate.h +-+++ b/net/mac80211/rate.h +-@@ -42,10 +42,12 @@ static inline void rate_control_tx_statu +- if (!ref || !test_sta_flag(sta, WLAN_STA_RATE_CONTROL)) +- return; +- +-+ spin_lock_bh(&sta->rate_ctrl_lock); +- if (ref->ops->tx_status) +- ref->ops->tx_status(ref->priv, sband, ista, priv_sta, skb); +- else +- ref->ops->tx_status_noskb(ref->priv, sband, ista, priv_sta, info); +-+ spin_unlock_bh(&sta->rate_ctrl_lock); +- } +- +- static inline void +-@@ -64,7 +66,9 @@ rate_control_tx_status_noskb(struct ieee +- if (WARN_ON_ONCE(!ref->ops->tx_status_noskb)) +- return; +- +-+ spin_lock_bh(&sta->rate_ctrl_lock); +- ref->ops->tx_status_noskb(ref->priv, sband, ista, priv_sta, info); +-+ spin_unlock_bh(&sta->rate_ctrl_lock); +- } +- +- static inline void rate_control_rate_init(struct sta_info *sta) +-@@ -91,8 +95,10 @@ static inline void rate_control_rate_ini +- +- 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); +- } +-@@ -115,18 +121,20 @@ static inline void rate_control_rate_upd +- 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); +- } +- +- static inline void *rate_control_alloc_sta(struct rate_control_ref *ref, +-- struct ieee80211_sta *sta, +-- gfp_t gfp) +-+ struct sta_info *sta, gfp_t gfp) +- { +-- return ref->ops->alloc_sta(ref->priv, sta, gfp); +-+ spin_lock_init(&sta->rate_ctrl_lock); +-+ return ref->ops->alloc_sta(ref->priv, &sta->sta, gfp); +- } +- +- static inline void rate_control_free_sta(struct sta_info *sta) +---- a/net/mac80211/sta_info.c +-+++ b/net/mac80211/sta_info.c +-@@ -286,7 +286,7 @@ static int sta_prepare_rate_control(stru +- +- sta->rate_ctrl = local->rate_ctrl; +- sta->rate_ctrl_priv = rate_control_alloc_sta(sta->rate_ctrl, +-- &sta->sta, gfp); +-+ sta, gfp); +- if (!sta->rate_ctrl_priv) +- return -ENOMEM; +- +---- a/net/mac80211/sta_info.h +-+++ b/net/mac80211/sta_info.h +-@@ -349,6 +349,7 @@ struct sta_info { +- u8 ptk_idx; +- struct rate_control_ref *rate_ctrl; +- void *rate_ctrl_priv; +-+ spinlock_t rate_ctrl_lock; +- 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 +--- a/package/kernel/mac80211/patches/302-ath9k-restart-only-triggering-DFS-detector-line.patch ++++ /dev/null +@@ -1,21 +0,0 @@ +-From: Zefir Kurtisi +-Date: Tue, 10 Mar 2015 17:49:29 +0100 +-Subject: [PATCH] ath9k: restart only triggering DFS detector line +- +-To support HT40 DFS mode, a triggering detector must +-reset only itself but not other detector lines. +- +-Signed-off-by: Zefir Kurtisi +---- +- +---- a/drivers/net/wireless/ath/dfs_pattern_detector.c +-+++ b/drivers/net/wireless/ath/dfs_pattern_detector.c +-@@ -289,7 +289,7 @@ dpd_add_pulse(struct dfs_pattern_detecto +- "count=%d, count_false=%d\n", +- event->freq, pd->rs->type_id, +- ps->pri, ps->count, ps->count_falses); +-- channel_detector_reset(dpd, cd); +-+ pd->reset(pd, dpd->last_pulse_ts); +- return true; +- } +- } +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 +--- a/package/kernel/mac80211/patches/303-ath9k-add-DFS-support-for-extension-channel.patch ++++ /dev/null +@@ -1,76 +0,0 @@ +-From: Zefir Kurtisi +-Date: Tue, 10 Mar 2015 17:49:30 +0100 +-Subject: [PATCH] ath9k: add DFS support for extension channel +- +-In HT40 modes, pulse events on primary and extension +-channel are processed individually. If valid, a pulse +-event will be fed into the detector +-* for primary frequency, or +-* for extension frequency (+/-20MHz based on HT40-mode) +-* or both +- +-With that, a 40MHz radar will result in two individual +-radar events. +- +-Signed-off-by: Zefir Kurtisi +---- +- +---- a/drivers/net/wireless/ath/ath9k/dfs.c +-+++ b/drivers/net/wireless/ath/ath9k/dfs.c +-@@ -126,8 +126,19 @@ ath9k_postprocess_radar_event(struct ath +- DFS_STAT_INC(sc, pulses_detected); +- return true; +- } +--#undef PRI_CH_RADAR_FOUND +--#undef EXT_CH_RADAR_FOUND +-+ +-+static void +-+ath9k_dfs_process_radar_pulse(struct ath_softc *sc, struct pulse_event *pe) +-+{ +-+ struct dfs_pattern_detector *pd = sc->dfs_detector; +-+ DFS_STAT_INC(sc, pulses_processed); +-+ if (pd == NULL) +-+ return; +-+ if (!pd->add_pulse(pd, pe)) +-+ return; +-+ DFS_STAT_INC(sc, radar_detected); +-+ ieee80211_radar_detected(sc->hw); +-+} +- +- /* +- * DFS: check PHY-error for radar pulse and feed the detector +-@@ -176,18 +187,21 @@ void ath9k_dfs_process_phyerr(struct ath +- ard.pulse_length_pri = vdata_end[-3]; +- pe.freq = ah->curchan->channel; +- pe.ts = mactime; +-- if (ath9k_postprocess_radar_event(sc, &ard, &pe)) { +-- struct dfs_pattern_detector *pd = sc->dfs_detector; +-- ath_dbg(common, DFS, +-- "ath9k_dfs_process_phyerr: channel=%d, ts=%llu, " +-- "width=%d, rssi=%d, delta_ts=%llu\n", +-- pe.freq, pe.ts, pe.width, pe.rssi, +-- pe.ts - sc->dfs_prev_pulse_ts); +-- sc->dfs_prev_pulse_ts = pe.ts; +-- DFS_STAT_INC(sc, pulses_processed); +-- if (pd != NULL && pd->add_pulse(pd, &pe)) { +-- DFS_STAT_INC(sc, radar_detected); +-- ieee80211_radar_detected(sc->hw); +-- } +-+ if (!ath9k_postprocess_radar_event(sc, &ard, &pe)) +-+ return; +-+ +-+ ath_dbg(common, DFS, +-+ "ath9k_dfs_process_phyerr: type=%d, freq=%d, ts=%llu, " +-+ "width=%d, rssi=%d, delta_ts=%llu\n", +-+ ard.pulse_bw_info, pe.freq, pe.ts, pe.width, pe.rssi, +-+ pe.ts - sc->dfs_prev_pulse_ts); +-+ sc->dfs_prev_pulse_ts = pe.ts; +-+ if (ard.pulse_bw_info & PRI_CH_RADAR_FOUND) +-+ ath9k_dfs_process_radar_pulse(sc, &pe); +-+ if (ard.pulse_bw_info & EXT_CH_RADAR_FOUND) { +-+ pe.freq += IS_CHAN_HT40PLUS(ah->curchan) ? 20 : -20; +-+ ath9k_dfs_process_radar_pulse(sc, &pe); +- } +- } +-+#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 +new file mode 100644 +index 0000000..139015c +--- /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 ++ ++Signed-off-by: Felix Fietkau ++--- ++ ++--- 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); ++ ++ if (ath9k_ps_enable) ++ ieee80211_hw_set(hw, SUPPORTS_PS); +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 +--- a/package/kernel/mac80211/patches/304-ath9k-allow-40MHz-radar-detection-width.patch ++++ /dev/null +@@ -1,19 +0,0 @@ +-From: Zefir Kurtisi +-Date: Tue, 10 Mar 2015 17:49:31 +0100 +-Subject: [PATCH] ath9k: allow 40MHz radar detection width +- +-Signed-off-by: Zefir Kurtisi +---- +- +---- a/drivers/net/wireless/ath/ath9k/init.c +-+++ b/drivers/net/wireless/ath/ath9k/init.c +-@@ -763,7 +763,8 @@ static const struct ieee80211_iface_comb +- .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_20) | +-+ BIT(NL80211_CHAN_WIDTH_40), +- } +- #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 +new file mode 100644 +index 0000000..9f04276 +--- /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 ++ ++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. ++ ++Signed-off-by: Felix Fietkau ++--- ++ ++--- 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; ++ } ++ } ++ ++@@ -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]; ++ } ++ } ++ ++ 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; ++ +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 +--- a/package/kernel/mac80211/patches/305-ath5k-channel-change-fix.patch ++++ /dev/null +@@ -1,137 +0,0 @@ +-From: Sergey Ryazanov +-Date: Wed, 4 Mar 2015 05:12:10 +0300 +-Subject: [PATCH] ath5k: channel change fix +- +-ath5k updates the channel pointer and after that it stops the Rx logic +-and apply channel to HW. In case of channel switch, such sequence +-creates a small window when a frame, which is received on the old +-channel is considered as a frame received on the new one. +- +-The most notable consequence of this situation occurs during the switch +-from 2 GHz band (CCK+OFDM) to the 5GHz band (OFDM-only). Frame received +-with CCK rate, e.g. beacon received at the 1mbps, causes the following +-warning: +- +- WARNING: at ath5k/base.c:589 ath5k_tasklet_rx+0x318/0x6ec [ath5k]() +- invalid hw_rix: 1a +- [..] +- Call Trace: +- [<802656a8>] show_stack+0x48/0x70 +- [<802dd92c>] warn_slowpath_common+0x88/0xbc +- [<802dd98c>] warn_slowpath_fmt+0x2c/0x38 +- [<81b51be8>] ath5k_tasklet_rx+0x318/0x6ec [ath5k] +- [<8028ac64>] tasklet_action+0x8c/0xf0 +- [<80075804>] __do_softirq+0x180/0x32c +- [<80196ce8>] irq_exit+0x54/0x70 +- [<80041848>] ret_from_irq+0x0/0x4 +- [<80182fdc>] ioread32+0x4/0xc +- [<81b4c42c>] ath5k_hw_set_sleep_clock+0x2ec/0x474 [ath5k] +- [<81b4cf28>] ath5k_hw_reset+0x50/0xeb8 [ath5k] +- [<81b50900>] ath5k_reset+0xd4/0x310 [ath5k] +- [<81b557e8>] ath5k_config+0x4c/0x104 [ath5k] +- [<80d01770>] ieee80211_hw_config+0x2f4/0x35c [mac80211] +- [<80d09aa8>] ieee80211_scan_work+0x2e4/0x414 [mac80211] +- [<8022c3f4>] process_one_work+0x28c/0x400 +- [<802df8f8>] worker_thread+0x258/0x3c0 +- [<801b5710>] kthread+0xe0/0xec +- [<800418a8>] ret_from_kernel_thread+0x14/0x1c +- +-The easiest way to reproduce this warning is to run scan with dualband +-NIC in noisy environments, when the channel 11 runs multiple APs. In my +-tests if the APs num >= 12, the warning appears in the first few +-seconds of scanning. +- +-In order to fix this, the Rx disable code moved to a higher level and +-placed before the channel pointer update. This is also makes the code a +-bit more symmetrical, since we disable and enable the Rx in the same +-function. +- +-In fact, at the pointer update time new frames should not appear, +-because interrupt generation at this point should already be disabled. +-The next patch should address this issue. +- +-CC: Jiri Slaby +-CC: Nick Kossifidis +-CC: Luis R. Rodriguez +-Reported-by: Christophe Prevotaux +-Tested-by: Christophe Prevotaux +-Tested-by: Eric Bree +-Signed-off-by: Sergey Ryazanov +---- +- +---- a/drivers/net/wireless/ath/ath5k/base.c +-+++ b/drivers/net/wireless/ath/ath5k/base.c +-@@ -2858,7 +2858,7 @@ ath5k_reset(struct ath5k_hw *ah, struct +- { +- struct ath_common *common = ath5k_hw_common(ah); +- int ret, ani_mode; +-- bool fast; +-+ bool fast = chan && modparam_fastchanswitch ? 1 : 0; +- +- ATH5K_DBG(ah, ATH5K_DEBUG_RESET, "resetting\n"); +- +-@@ -2876,11 +2876,29 @@ ath5k_reset(struct ath5k_hw *ah, struct +- * so we should also free any remaining +- * tx buffers */ +- ath5k_drain_tx_buffs(ah); +-+ +-+ /* Stop PCU */ +-+ ath5k_hw_stop_rx_pcu(ah); +-+ +-+ /* Stop DMA +-+ * +-+ * Note: If DMA didn't stop continue +-+ * since only a reset will fix it. +-+ */ +-+ ret = ath5k_hw_dma_stop(ah); +-+ +-+ /* RF Bus grant won't work if we have pending +-+ * frames +-+ */ +-+ if (ret && fast) { +-+ ATH5K_DBG(ah, ATH5K_DEBUG_RESET, +-+ "DMA didn't stop, falling back to normal reset\n"); +-+ fast = false; +-+ } +-+ +- if (chan) +- ah->curchan = chan; +- +-- fast = ((chan != NULL) && modparam_fastchanswitch) ? 1 : 0; +-- +- ret = ath5k_hw_reset(ah, ah->opmode, ah->curchan, fast, skip_pcu); +- if (ret) { +- ATH5K_ERR(ah, "can't reset hardware (%d)\n", ret); +---- a/drivers/net/wireless/ath/ath5k/reset.c +-+++ b/drivers/net/wireless/ath/ath5k/reset.c +-@@ -1169,30 +1169,6 @@ ath5k_hw_reset(struct ath5k_hw *ah, enum +- if (ah->ah_version == AR5K_AR5212) +- ath5k_hw_set_sleep_clock(ah, false); +- +-- /* +-- * Stop PCU +-- */ +-- ath5k_hw_stop_rx_pcu(ah); +-- +-- /* +-- * Stop DMA +-- * +-- * Note: If DMA didn't stop continue +-- * since only a reset will fix it. +-- */ +-- ret = ath5k_hw_dma_stop(ah); +-- +-- /* RF Bus grant won't work if we have pending +-- * frames */ +-- if (ret && fast) { +-- ATH5K_DBG(ah, ATH5K_DEBUG_RESET, +-- "DMA didn't stop, falling back to normal reset\n"); +-- fast = false; +-- /* Non fatal, just continue with +-- * normal reset */ +-- ret = 0; +-- } +-- +- 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 +new file mode 100644 +index 0000000..ec860dc +--- /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 ++ ++Use list_empty(&tid->list) instead ++ ++Signed-off-by: Felix Fietkau ++--- ++ ++--- 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 */ ++ ++ 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; ++ ++- if (tid->sched) ++- 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); ++ } ++ ++ static struct ath_frame_info *get_frame_info(struct sk_buff *skb) ++@@ -1556,15 +1553,14 @@ void ath_tx_aggr_sleep(struct ieee80211_ ++ ++ ath_txq_lock(sc, txq); ++ ++- if (!tid->sched) { +++ if (list_empty(&tid->list)) { ++ ath_txq_unlock(sc, txq); ++ continue; ++ } ++ ++ buffered = ath_tid_has_buffered(tid); ++ ++- tid->sched = false; ++- list_del(&tid->list); +++ list_del_init(&tid->list); ++ ++ ath_txq_unlock(sc, txq); ++ ++@@ -1944,8 +1940,7 @@ void ath_txq_schedule(struct ath_softc * ++ break; ++ ++ tid = list_first_entry(tid_list, struct ath_atx_tid, list); ++- list_del(&tid->list); ++- tid->sched = false; +++ list_del_init(&tid->list); ++ ++ 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 +--- a/package/kernel/mac80211/patches/306-ath5k-fix-reset-race.patch ++++ /dev/null +@@ -1,96 +0,0 @@ +-From: Sergey Ryazanov +-Date: Wed, 4 Mar 2015 05:12:11 +0300 +-Subject: [PATCH] ath5k: fix reset race +- +-To prepare for reset ath5k should finish all asynchronous tasks. At +-first, it disables the interrupt generation, then it waits for the +-interrupt handler and tasklets completion, and then proceeds to the HW +-configuration update. But it does not consider that the interrupt +-handler or tasklet re-enables the interrupt generation. And we fall in a +-situation when ath5k assumes that interrupts are disabled, but it is +-not. +- +-This can lead to different consequences, such as reception of the frame, +-when we do not expect it. Under certain circumstances, this can lead to +-the following warning: +- +- WARNING: at ath5k/base.c:589 ath5k_tasklet_rx+0x318/0x6ec [ath5k]() +- invalid hw_rix: 1a +- [..] +- Call Trace: +- [<802656a8>] show_stack+0x48/0x70 +- [<802dd92c>] warn_slowpath_common+0x88/0xbc +- [<802dd98c>] warn_slowpath_fmt+0x2c/0x38 +- [<81b51be8>] ath5k_tasklet_rx+0x318/0x6ec [ath5k] +- [<8028ac64>] tasklet_action+0x8c/0xf0 +- [<80075804>] __do_softirq+0x180/0x32c +- [<80196ce8>] irq_exit+0x54/0x70 +- [<80041848>] ret_from_irq+0x0/0x4 +- [<80182fdc>] ioread32+0x4/0xc +- [<81b4c42c>] ath5k_hw_set_sleep_clock+0x2ec/0x474 [ath5k] +- [<81b4cf28>] ath5k_hw_reset+0x50/0xeb8 [ath5k] +- [<81b50900>] ath5k_reset+0xd4/0x310 [ath5k] +- [<81b557e8>] ath5k_config+0x4c/0x104 [ath5k] +- [<80d01770>] ieee80211_hw_config+0x2f4/0x35c [mac80211] +- [<80d09aa8>] ieee80211_scan_work+0x2e4/0x414 [mac80211] +- [<8022c3f4>] process_one_work+0x28c/0x400 +- [<802df8f8>] worker_thread+0x258/0x3c0 +- [<801b5710>] kthread+0xe0/0xec +- [<800418a8>] ret_from_kernel_thread+0x14/0x1c +- +-Fix this issue by adding a new status flag, which forbids to re-enable +-the interrupt generation until the HW configuration is completed. +- +-Note: previous patch, which reorders the Rx disable code helps to avoid +-the above warning, but not fixes the root cause of unexpected frame +-receiving. +- +-CC: Jiri Slaby +-CC: Nick Kossifidis +-CC: Luis R. Rodriguez +-Reported-by: Christophe Prevotaux +-Tested-by: Christophe Prevotaux +-Tested-by: Eric Bree +-Signed-off-by: Sergey Ryazanov +---- +- +---- a/drivers/net/wireless/ath/ath5k/ath5k.h +-+++ b/drivers/net/wireless/ath/ath5k/ath5k.h +-@@ -1283,6 +1283,7 @@ struct ath5k_hw { +- #define ATH_STAT_PROMISC 1 +- #define ATH_STAT_LEDSOFT 2 /* enable LED gpio status */ +- #define ATH_STAT_STARTED 3 /* opened & irqs enabled */ +-+#define ATH_STAT_RESET 4 /* hw reset */ +- +- unsigned int filter_flags; /* HW flags, AR5K_RX_FILTER_* */ +- unsigned int fif_filter_flags; /* Current FIF_* filter flags */ +---- a/drivers/net/wireless/ath/ath5k/base.c +-+++ b/drivers/net/wireless/ath/ath5k/base.c +-@@ -1523,6 +1523,9 @@ ath5k_set_current_imask(struct ath5k_hw +- enum ath5k_int imask; +- unsigned long flags; +- +-+ if (test_bit(ATH_STAT_RESET, ah->status)) +-+ return; +-+ +- spin_lock_irqsave(&ah->irqlock, flags); +- imask = ah->imask; +- if (ah->rx_pending) +-@@ -2862,6 +2865,8 @@ ath5k_reset(struct ath5k_hw *ah, struct +- +- ATH5K_DBG(ah, ATH5K_DEBUG_RESET, "resetting\n"); +- +-+ __set_bit(ATH_STAT_RESET, ah->status); +-+ +- ath5k_hw_set_imr(ah, 0); +- synchronize_irq(ah->irq); +- ath5k_stop_tasklets(ah); +-@@ -2952,6 +2957,8 @@ ath5k_reset(struct ath5k_hw *ah, struct +- */ +- /* ath5k_chan_change(ah, c); */ +- +-+ __clear_bit(ATH_STAT_RESET, ah->status); +-+ +- 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 +new file mode 100644 +index 0000000..928c93b +--- /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 ++ ++With this .config: http://busybox.net/~vda/kernel_config, ++after deinlining these functions have sizes and callsite counts ++as follows: ++ ++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 ++--- ++ ++--- 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"); ++ +++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) +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 +--- a/package/kernel/mac80211/patches/307-ath9k-fix-tracking-of-enabled-AP-beacons.patch ++++ /dev/null +@@ -1,76 +0,0 @@ +-From: Felix Fietkau +-Date: Thu, 12 Mar 2015 17:10:50 +0100 +-Subject: [PATCH] ath9k: fix tracking of enabled AP beacons +- +-sc->nbcnvifs tracks assigned beacon slots, not enabled beacons. +-Therefore, it cannot be used to decide if cur_conf->enable_beacon (bool) +-should be updated, or if beacons have been enabled already. +-With the current code (depending on the order of calls), beacons often +-do not get enabled in an AP+STA setup. +-To fix tracking of enabled beacons, convert cur_conf->enable_beacon to a +-bitmask of enabled beacon slots. +- +-Cc: stable@vger.kernel.org +-Signed-off-by: Felix Fietkau +---- +- +---- a/drivers/net/wireless/ath/ath9k/beacon.c +-+++ b/drivers/net/wireless/ath/ath9k/beacon.c +-@@ -219,12 +219,15 @@ void ath9k_beacon_remove_slot(struct ath +- struct ath_common *common = ath9k_hw_common(sc->sc_ah); +- struct ath_vif *avp = (void *)vif->drv_priv; +- struct ath_buf *bf = avp->av_bcbuf; +-+ struct ath_beacon_config *cur_conf = &sc->cur_chan->beacon; +- +- ath_dbg(common, CONFIG, "Removing interface at beacon slot: %d\n", +- avp->av_bslot); +- +- tasklet_disable(&sc->bcon_tasklet); +- +-+ cur_conf->enable_beacon &= ~BIT(avp->av_bslot); +-+ +- if (bf && bf->bf_mpdu) { +- struct sk_buff *skb = bf->bf_mpdu; +- dma_unmap_single(sc->dev, bf->bf_buf_addr, +-@@ -521,8 +524,7 @@ static bool ath9k_allow_beacon_config(st +- } +- +- if (sc->sc_ah->opmode == NL80211_IFTYPE_AP) { +-- if ((vif->type != NL80211_IFTYPE_AP) || +-- (sc->nbcnvifs > 1)) { +-+ if (vif->type != NL80211_IFTYPE_AP) { +- ath_dbg(common, CONFIG, +- "An AP interface is already present !\n"); +- return false; +-@@ -616,12 +618,14 @@ void ath9k_beacon_config(struct ath_soft +- * enabling/disabling SWBA. +- */ +- if (changed & BSS_CHANGED_BEACON_ENABLED) { +-- if (!bss_conf->enable_beacon && +-- (sc->nbcnvifs <= 1)) { +-- cur_conf->enable_beacon = false; +-- } else if (bss_conf->enable_beacon) { +-- cur_conf->enable_beacon = true; +-- ath9k_cache_beacon_config(sc, ctx, bss_conf); +-+ bool enabled = cur_conf->enable_beacon; +-+ +-+ if (!bss_conf->enable_beacon) { +-+ cur_conf->enable_beacon &= ~BIT(avp->av_bslot); +-+ } else { +-+ cur_conf->enable_beacon |= BIT(avp->av_bslot); +-+ if (!enabled) +-+ ath9k_cache_beacon_config(sc, ctx, bss_conf); +- } +- } +- +---- a/drivers/net/wireless/ath/ath9k/common.h +-+++ b/drivers/net/wireless/ath/ath9k/common.h +-@@ -54,7 +54,7 @@ struct ath_beacon_config { +- u16 dtim_period; +- u16 bmiss_timeout; +- u8 dtim_count; +-- bool enable_beacon; +-+ u8 enable_beacon; +- 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 +new file mode 100644 +index 0000000..474c409 +--- /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 ++ ++With this .config: http://busybox.net/~vda/kernel_config, ++after deinlining the function size is 3132 bytes and there are ++7 callsites. ++ ++Total size reduction: about 20 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 ++--- ++ 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); +++ } +++ 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); ++ } ++ ++-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); ++ ++ 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 +--- a/package/kernel/mac80211/patches/308-mac80211-minstrel_ht-fix-rounding-issue-in-MCS-durat.patch ++++ /dev/null +@@ -1,43 +0,0 @@ +-From: Felix Fietkau +-Date: Fri, 13 Mar 2015 10:49:40 +0100 +-Subject: [PATCH] mac80211: minstrel_ht: fix rounding issue in MCS duration +- calculation +- +-On very high MCS bitrates, the calculated duration of rates that are +-next to each other can be very imprecise, due to the small packet size +-used as reference (1200 bytes). +-This is most visible in VHT80 nss=2 MCS8/9, for which minstrel shows the +-same throughput when the probability is also the same. This leads to a +-bad rate selection for such rates. +- +-Fix this issue by introducing an average A-MPDU size factor into the +-calculation. +- +-Signed-off-by: Felix Fietkau +---- +- +---- a/net/mac80211/rc80211_minstrel_ht.c +-+++ b/net/mac80211/rc80211_minstrel_ht.c +-@@ -17,10 +17,11 @@ +- #include "rc80211_minstrel.h" +- #include "rc80211_minstrel_ht.h" +- +-+#define AVG_AMPDU_SIZE 16 +- #define AVG_PKT_SIZE 1200 +- +- /* Number of bits for an average sized packet */ +--#define MCS_NBITS (AVG_PKT_SIZE << 3) +-+#define MCS_NBITS ((AVG_PKT_SIZE * AVG_AMPDU_SIZE) << 3) +- +- /* Number of symbols for a packet with (bps) bits per symbol */ +- #define MCS_NSYMS(bps) DIV_ROUND_UP(MCS_NBITS, (bps)) +-@@ -33,7 +34,8 @@ +- ) +- +- /* Transmit duration for the raw data part of an average sized packet */ +--#define MCS_DURATION(streams, sgi, bps) MCS_SYMBOL_TIME(sgi, MCS_NSYMS((streams) * (bps))) +-+#define MCS_DURATION(streams, sgi, bps) \ +-+ (MCS_SYMBOL_TIME(sgi, MCS_NSYMS((streams) * (bps))) / AVG_AMPDU_SIZE) +- +- #define BW_20 0 +- #define BW_40 1 +diff --git a/package/kernel/mac80211/patches/309-ath9k-disable-TPC-support-again-for-now.patch b/package/kernel/mac80211/patches/309-ath9k-disable-TPC-support-again-for-now.patch +deleted file mode 100644 +index 945fbce..0000000 +--- a/package/kernel/mac80211/patches/309-ath9k-disable-TPC-support-again-for-now.patch ++++ /dev/null +@@ -1,22 +0,0 @@ +-From: Felix Fietkau +-Date: Sun, 15 Mar 2015 08:02:37 +0100 +-Subject: [PATCH] ath9k: disable TPC support again (for now) +- +-TPC support has been observed to cause some tx power fluctuations on +-some devices with at least AR934x and AR938x chips. +-Disable it for now until the bugs have been found and fixed +- +-Signed-off-by: Felix Fietkau +---- +- +---- a/drivers/net/wireless/ath/ath9k/hw.c +-+++ b/drivers/net/wireless/ath/ath9k/hw.c +-@@ -424,7 +424,7 @@ static void ath9k_hw_init_defaults(struc +- ah->power_mode = ATH9K_PM_UNDEFINED; +- ah->htc_reset_init = true; +- +-- ah->tpc_enabled = true; +-+ ah->tpc_enabled = false; +- +- 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 +new file mode 100644 +index 0000000..e8e9617 +--- /dev/null ++++ b/package/kernel/mac80211/patches/309-mac80211-make-local-tx_headroom-a-multiple-of-4.patch +@@ -0,0 +1,20 @@ ++From: Felix Fietkau ++Date: Thu, 30 Jul 2015 14:12:25 +0200 ++Subject: [PATCH] mac80211: make local->tx_headroom a multiple of 4 ++ ++This ensures that mac80211 generated management frames and beacons are ++aligned before being passed to the driver ++ ++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); ++ +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 +--- a/package/kernel/mac80211/patches/310-mac80211-don-t-look-up-stations-for-multicast-addres.patch ++++ /dev/null +@@ -1,21 +0,0 @@ +-From: Johannes Berg +-Date: Tue, 24 Feb 2015 00:28:18 +0100 +-Subject: [PATCH] mac80211: don't look up stations for multicast addresses +- +-Since multicast addresses don't exist as stations, don't attempt +-to look them up in the hashtable on TX. +- +-Signed-off-by: Johannes Berg +---- +- +---- a/net/mac80211/tx.c +-+++ b/net/mac80211/tx.c +-@@ -1161,7 +1161,7 @@ ieee80211_tx_prepare(struct ieee80211_su +- tx->sdata->control_port_protocol == tx->skb->protocol) { +- tx->sta = sta_info_get_bss(sdata, hdr->addr1); +- } +-- if (!tx->sta) +-+ if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) +- 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 +new file mode 100644 +index 0000000..51a315c +--- /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() ++ ++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 ++--- ++ ++--- 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; ++ ++- 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; ++ } ++ ++ 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; ++- ++- 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); ++ +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 +--- a/package/kernel/mac80211/patches/311-mac80211-remove-drop_unencrypted-code.patch ++++ /dev/null +@@ -1,130 +0,0 @@ +-From: Johannes Berg +-Date: Fri, 20 Mar 2015 11:41:58 +0100 +-Subject: [PATCH] mac80211: remove drop_unencrypted code +- +-This mechanism was historic, and only ever used by IBSS, which +-also doesn't need to have it as it properly manages station's +-802.1X PAE state (or, with WEP, always has a key.) +- +-Remove the mechanism to clean up the code. +- +-Signed-off-by: Johannes Berg +---- +- +---- a/net/mac80211/debugfs.c +-+++ b/net/mac80211/debugfs.c +-@@ -274,8 +274,6 @@ void debugfs_hw_add(struct ieee80211_loc +- #ifdef CPTCFG_MAC80211_DEBUG_COUNTERS +- DEBUGFS_STATS_ADD(tx_handlers_drop, local->tx_handlers_drop); +- DEBUGFS_STATS_ADD(tx_handlers_queued, local->tx_handlers_queued); +-- DEBUGFS_STATS_ADD(tx_handlers_drop_unencrypted, +-- local->tx_handlers_drop_unencrypted); +- DEBUGFS_STATS_ADD(tx_handlers_drop_fragment, +- local->tx_handlers_drop_fragment); +- DEBUGFS_STATS_ADD(tx_handlers_drop_wep, +---- a/net/mac80211/debugfs_netdev.c +-+++ b/net/mac80211/debugfs_netdev.c +-@@ -177,7 +177,6 @@ static ssize_t ieee80211_if_write_##name +- IEEE80211_IF_FILE_R(name) +- +- /* common attributes */ +--IEEE80211_IF_FILE(drop_unencrypted, drop_unencrypted, DEC); +- IEEE80211_IF_FILE(rc_rateidx_mask_2ghz, rc_rateidx_mask[IEEE80211_BAND_2GHZ], +- HEX); +- IEEE80211_IF_FILE(rc_rateidx_mask_5ghz, rc_rateidx_mask[IEEE80211_BAND_5GHZ], +-@@ -562,7 +561,6 @@ IEEE80211_IF_FILE(dot11MeshAwakeWindowDu +- +- static void add_common_files(struct ieee80211_sub_if_data *sdata) +- { +-- DEBUGFS_ADD(drop_unencrypted); +- DEBUGFS_ADD(rc_rateidx_mask_2ghz); +- DEBUGFS_ADD(rc_rateidx_mask_5ghz); +- DEBUGFS_ADD(rc_rateidx_mcs_mask_2ghz); +---- a/net/mac80211/ibss.c +-+++ b/net/mac80211/ibss.c +-@@ -249,8 +249,6 @@ static void __ieee80211_sta_join_ibss(st +- if (presp) +- kfree_rcu(presp, rcu_head); +- +-- sdata->drop_unencrypted = capability & WLAN_CAPABILITY_PRIVACY ? 1 : 0; +-- +- /* make a copy of the chandef, it could be modified below. */ +- chandef = *req_chandef; +- chan = chandef.chan; +-@@ -1289,8 +1287,6 @@ static void ieee80211_sta_create_ibss(st +- +- if (ifibss->privacy) +- capability |= WLAN_CAPABILITY_PRIVACY; +-- else +-- sdata->drop_unencrypted = 0; +- +- __ieee80211_sta_join_ibss(sdata, bssid, sdata->vif.bss_conf.beacon_int, +- &ifibss->chandef, ifibss->basic_rates, +---- a/net/mac80211/ieee80211_i.h +-+++ b/net/mac80211/ieee80211_i.h +-@@ -842,8 +842,6 @@ struct ieee80211_sub_if_data { +- +- unsigned long state; +- +-- int drop_unencrypted; +-- +- char name[IFNAMSIZ]; +- +- /* Fragment table for host-based reassembly */ +-@@ -1289,7 +1287,6 @@ struct ieee80211_local { +- /* TX/RX handler statistics */ +- unsigned int tx_handlers_drop; +- unsigned int tx_handlers_queued; +-- unsigned int tx_handlers_drop_unencrypted; +- unsigned int tx_handlers_drop_fragment; +- unsigned int tx_handlers_drop_wep; +- unsigned int tx_handlers_drop_not_assoc; +---- a/net/mac80211/iface.c +-+++ b/net/mac80211/iface.c +-@@ -1535,7 +1535,6 @@ int ieee80211_if_change_type(struct ieee +- } +- +- /* reset some values that shouldn't be kept across type changes */ +-- sdata->drop_unencrypted = 0; +- if (type == NL80211_IFTYPE_STATION) +- sdata->u.mgd.use_4addr = false; +- +---- a/net/mac80211/rx.c +-+++ b/net/mac80211/rx.c +-@@ -1897,8 +1897,7 @@ static int ieee80211_drop_unencrypted(st +- /* Drop unencrypted frames if key is set. */ +- if (unlikely(!ieee80211_has_protected(fc) && +- !ieee80211_is_nullfunc(fc) && +-- ieee80211_is_data(fc) && +-- (rx->key || rx->sdata->drop_unencrypted))) +-+ ieee80211_is_data(fc) && rx->key)) +- return -EACCES; +- +- return 0; +---- a/net/mac80211/tx.c +-+++ b/net/mac80211/tx.c +-@@ -594,23 +594,8 @@ ieee80211_tx_h_select_key(struct ieee802 +- else if (!is_multicast_ether_addr(hdr->addr1) && +- (key = rcu_dereference(tx->sdata->default_unicast_key))) +- tx->key = key; +-- else if (info->flags & IEEE80211_TX_CTL_INJECTED) +-+ else +- tx->key = NULL; +-- else if (!tx->sdata->drop_unencrypted) +-- tx->key = NULL; +-- else if (tx->skb->protocol == tx->sdata->control_port_protocol) +-- tx->key = NULL; +-- else if (ieee80211_is_robust_mgmt_frame(tx->skb) && +-- !(ieee80211_is_action(hdr->frame_control) && +-- tx->sta && test_sta_flag(tx->sta, WLAN_STA_MFP))) +-- tx->key = NULL; +-- else if (ieee80211_is_mgmt(hdr->frame_control) && +-- !ieee80211_is_robust_mgmt_frame(tx->skb)) +-- tx->key = NULL; +-- else { +-- I802_DEBUG_INC(tx->local->tx_handlers_drop_unencrypted); +-- return TX_DROP; +-- } +- +- 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 +--- a/package/kernel/mac80211/patches/312-mac80211-don-t-look-up-destination-station-twice.patch ++++ /dev/null +@@ -1,71 +0,0 @@ +-From: Johannes Berg +-Date: Fri, 20 Mar 2015 16:24:21 +0100 +-Subject: [PATCH] mac80211: don't look up destination station twice +- +-There's no need to look up the destination station twice while +-building the 802.11 header for a given frame if the frame will +-actually be transmitted to the station we initially looked up. +- +-This happens for 4-addr VLAN interfaces and TDLS connections, which +-both directly send the frame to the station they looked up, though +-in the case of TDLS some station conditions need to be checked. +- +-To avoid that, add a variable indicating that we've looked up the +-station that the frame is going to be transmitted to, and avoid the +-lookup/flag checking if it already has been done. +- +-In the TDLS case, also move the authorized/wme_sta flag assignment +-to the correct place, i.e. only when that station is really used. +-Before this change, the new lookup should always have succeeded so +-that the potentially erroneous data would be overwritten. +- +-Signed-off-by: Johannes Berg +---- +- +---- a/net/mac80211/tx.c +-+++ b/net/mac80211/tx.c +-@@ -1894,6 +1894,7 @@ static struct sk_buff *ieee80211_build_h +- bool wme_sta = false, authorized = false, tdls_auth = false; +- bool tdls_peer = false, tdls_setup_frame = false; +- bool multicast; +-+ bool have_station = false; +- u16 info_id = 0; +- struct ieee80211_chanctx_conf *chanctx_conf; +- struct ieee80211_sub_if_data *ap_sdata; +-@@ -1918,6 +1919,7 @@ static struct sk_buff *ieee80211_build_h +- hdrlen = 30; +- authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); +- wme_sta = sta->sta.wme; +-+ have_station = true; +- } +- ap_sdata = container_of(sdata->bss, struct ieee80211_sub_if_data, +- u.ap); +-@@ -2034,9 +2036,6 @@ static struct sk_buff *ieee80211_build_h +- if (sdata->wdev.wiphy->flags & WIPHY_FLAG_SUPPORTS_TDLS) { +- sta = sta_info_get(sdata, skb->data); +- if (sta) { +-- authorized = test_sta_flag(sta, +-- WLAN_STA_AUTHORIZED); +-- wme_sta = sta->sta.wme; +- tdls_peer = test_sta_flag(sta, +- WLAN_STA_TDLS_PEER); +- tdls_auth = test_sta_flag(sta, +-@@ -2068,6 +2067,9 @@ static struct sk_buff *ieee80211_build_h +- memcpy(hdr.addr2, skb->data + ETH_ALEN, ETH_ALEN); +- memcpy(hdr.addr3, sdata->u.mgd.bssid, ETH_ALEN); +- hdrlen = 24; +-+ have_station = true; +-+ authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); +-+ wme_sta = sta->sta.wme; +- } else if (sdata->u.mgd.use_4addr && +- cpu_to_be16(ethertype) != sdata->control_port_protocol) { +- fc |= cpu_to_le16(IEEE80211_FCTL_FROMDS | +-@@ -2130,7 +2132,7 @@ static struct sk_buff *ieee80211_build_h +- * in AP mode) +- */ +- multicast = is_multicast_ether_addr(hdr.addr1); +-- if (!multicast) { +-+ if (!multicast && !have_station) { +- 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 +new file mode 100644 +index 0000000..baee295 +--- /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 ++ ++The interface combination provided by brcmfmac did not truly reflect ++the combinations supported by driver and/or firmware. ++ ++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 ++--- ++ ++--- 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] = ++ } ++ }; ++ +++/** +++ * 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 +--- a/package/kernel/mac80211/patches/313-mac80211-drop-4-addr-VLAN-frames-earlier-if-not-conn.patch ++++ /dev/null +@@ -1,27 +0,0 @@ +-From: Johannes Berg +-Date: Fri, 20 Mar 2015 16:24:22 +0100 +-Subject: [PATCH] mac80211: drop 4-addr VLAN frames earlier if not +- connected +- +-If there's no station on the 4-addr VLAN interface, then frames +-cannot be transmitted. Drop such frames earlier, before setting +-up all the information for them. +- +-We should keep the old check though since that code might be used +-for other internally-generated frames. +- +-Signed-off-by: Johannes Berg +---- +- +---- a/net/mac80211/tx.c +-+++ b/net/mac80211/tx.c +-@@ -1920,6 +1920,9 @@ static struct sk_buff *ieee80211_build_h +- authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); +- wme_sta = sta->sta.wme; +- have_station = true; +-+ } else if (sdata->wdev.use_4addr) { +-+ ret = -ENOLINK; +-+ goto free; +- } +- 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 +new file mode 100644 +index 0000000..9768ef2 +--- /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 ++ ++Expose ring buffer read/write pointers and other useful statistics ++through debugfs. ++ ++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 ++--- ++ ++--- 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 ++ } ++ } ++ +++#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; +++ +++ 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); +++ } +++ +++ 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: +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 +--- a/package/kernel/mac80211/patches/314-mac80211-mesh-avoid-pointless-station-lookup.patch ++++ /dev/null +@@ -1,33 +0,0 @@ +-From: Johannes Berg +-Date: Fri, 20 Mar 2015 16:24:23 +0100 +-Subject: [PATCH] mac80211: mesh: avoid pointless station lookup +- +-In ieee80211_build_hdr(), the station is looked up to build the +-header correctly (QoS field) and to check for authorization. For +-mesh, authorization isn't checked here, and QoS capability is +-mandatory, so the station lookup can be avoided. +- +-Signed-off-by: Johannes Berg +---- +- +---- a/net/mac80211/tx.c +-+++ b/net/mac80211/tx.c +-@@ -2130,12 +2130,14 @@ static struct sk_buff *ieee80211_build_h +- } +- +- /* +-- * There's no need to try to look up the destination +-- * if it is a multicast address (which can only happen +-- * in AP mode) +-+ * There's no need to try to look up the destination station +-+ * if it is a multicast address. In mesh, there's no need to +-+ * look up the station at all as it always must be QoS capable +-+ * and mesh mode checks authorization later. +- */ +- multicast = is_multicast_ether_addr(hdr.addr1); +-- if (!multicast && !have_station) { +-+ if (!multicast && !have_station && +-+ !ieee80211_vif_is_mesh(&sdata->vif)) { +- 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 +--- a/package/kernel/mac80211/patches/315-mac80211-avoid-duplicate-TX-path-station-lookup.patch ++++ /dev/null +@@ -1,267 +0,0 @@ +-From: Johannes Berg +-Date: Fri, 20 Mar 2015 14:18:27 +0100 +-Subject: [PATCH] mac80211: avoid duplicate TX path station lookup +- +-Instead of looking up the destination station twice in the TX path +-(first to build the header, and then for control processing), save +-it when building the header and use it later in the TX path. +- +-To avoid having to look up the station in the many callers, allow +-those to pass %NULL which keeps the existing lookup. +- +-Signed-off-by: Johannes Berg +---- +- +---- a/net/mac80211/cfg.c +-+++ b/net/mac80211/cfg.c +-@@ -3565,7 +3565,7 @@ static int ieee80211_probe_client(struct +- nullfunc->qos_ctrl = cpu_to_le16(7); +- +- local_bh_disable(); +-- ieee80211_xmit(sdata, skb); +-+ ieee80211_xmit(sdata, sta, skb); +- local_bh_enable(); +- rcu_read_unlock(); +- +---- a/net/mac80211/ieee80211_i.h +-+++ b/net/mac80211/ieee80211_i.h +-@@ -1775,7 +1775,8 @@ void mac80211_ev_michael_mic_failure(str +- gfp_t gfp); +- void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata, +- bool bss_notify); +--void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb); +-+void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, +-+ struct sta_info *sta, struct sk_buff *skb); +- +- void __ieee80211_tx_skb_tid_band(struct ieee80211_sub_if_data *sdata, +- struct sk_buff *skb, int tid, +---- a/net/mac80211/sta_info.c +-+++ b/net/mac80211/sta_info.c +-@@ -1279,7 +1279,7 @@ static void ieee80211_send_null_response +- } +- +- info->band = chanctx_conf->def.chan->band; +-- ieee80211_xmit(sdata, skb); +-+ ieee80211_xmit(sdata, sta, skb); +- rcu_read_unlock(); +- } +- +---- a/net/mac80211/tx.c +-+++ b/net/mac80211/tx.c +-@@ -1110,11 +1110,13 @@ static bool ieee80211_tx_prep_agg(struct +- +- /* +- * initialises @tx +-+ * pass %NULL for the station if unknown, a valid pointer if known +-+ * or an ERR_PTR() if the station is known not to exist +- */ +- static ieee80211_tx_result +- ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata, +- struct ieee80211_tx_data *tx, +-- struct sk_buff *skb) +-+ struct sta_info *sta, struct sk_buff *skb) +- { +- struct ieee80211_local *local = sdata->local; +- struct ieee80211_hdr *hdr; +-@@ -1137,17 +1139,22 @@ ieee80211_tx_prepare(struct ieee80211_su +- +- hdr = (struct ieee80211_hdr *) skb->data; +- +-- if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { +-- tx->sta = rcu_dereference(sdata->u.vlan.sta); +-- if (!tx->sta && sdata->dev->ieee80211_ptr->use_4addr) +-- return TX_DROP; +-- } else if (info->flags & (IEEE80211_TX_CTL_INJECTED | +-- IEEE80211_TX_INTFL_NL80211_FRAME_TX) || +-- tx->sdata->control_port_protocol == tx->skb->protocol) { +-- tx->sta = sta_info_get_bss(sdata, hdr->addr1); +-+ if (likely(sta)) { +-+ if (!IS_ERR(sta)) +-+ tx->sta = sta; +-+ } else { +-+ if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { +-+ tx->sta = rcu_dereference(sdata->u.vlan.sta); +-+ if (!tx->sta && sdata->wdev.use_4addr) +-+ return TX_DROP; +-+ } else if (info->flags & (IEEE80211_TX_INTFL_NL80211_FRAME_TX | +-+ IEEE80211_TX_CTL_INJECTED) || +-+ tx->sdata->control_port_protocol == tx->skb->protocol) { +-+ tx->sta = sta_info_get_bss(sdata, hdr->addr1); +-+ } +-+ if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) +-+ tx->sta = sta_info_get(sdata, hdr->addr1); +- } +-- if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) +-- tx->sta = sta_info_get(sdata, hdr->addr1); +- +- if (tx->sta && ieee80211_is_data_qos(hdr->frame_control) && +- !ieee80211_is_qos_nullfunc(hdr->frame_control) && +-@@ -1485,7 +1492,7 @@ bool ieee80211_tx_prepare_skb(struct iee +- struct ieee80211_tx_data tx; +- struct sk_buff *skb2; +- +-- if (ieee80211_tx_prepare(sdata, &tx, skb) == TX_DROP) +-+ if (ieee80211_tx_prepare(sdata, &tx, NULL, skb) == TX_DROP) +- return false; +- +- info->band = band; +-@@ -1518,7 +1525,8 @@ EXPORT_SYMBOL(ieee80211_tx_prepare_skb); +- * Returns false if the frame couldn't be transmitted but was queued instead. +- */ +- static bool ieee80211_tx(struct ieee80211_sub_if_data *sdata, +-- struct sk_buff *skb, bool txpending) +-+ struct sta_info *sta, struct sk_buff *skb, +-+ bool txpending) +- { +- struct ieee80211_local *local = sdata->local; +- struct ieee80211_tx_data tx; +-@@ -1534,7 +1542,7 @@ static bool ieee80211_tx(struct ieee8021 +- +- /* initialises tx */ +- led_len = skb->len; +-- res_prepare = ieee80211_tx_prepare(sdata, &tx, skb); +-+ res_prepare = ieee80211_tx_prepare(sdata, &tx, sta, skb); +- +- if (unlikely(res_prepare == TX_DROP)) { +- ieee80211_free_txskb(&local->hw, skb); +-@@ -1590,7 +1598,8 @@ static int ieee80211_skb_resize(struct i +- return 0; +- } +- +--void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb) +-+void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, +-+ struct sta_info *sta, struct sk_buff *skb) +- { +- struct ieee80211_local *local = sdata->local; +- struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); +-@@ -1625,7 +1634,7 @@ void ieee80211_xmit(struct ieee80211_sub +- } +- +- ieee80211_set_qos_hdr(sdata, skb); +-- ieee80211_tx(sdata, skb, false); +-+ ieee80211_tx(sdata, sta, skb, false); +- } +- +- static bool ieee80211_parse_tx_radiotap(struct sk_buff *skb) +-@@ -1846,7 +1855,7 @@ netdev_tx_t ieee80211_monitor_start_xmit +- goto fail_rcu; +- +- info->band = chandef->chan->band; +-- ieee80211_xmit(sdata, skb); +-+ ieee80211_xmit(sdata, NULL, skb); +- rcu_read_unlock(); +- +- return NETDEV_TX_OK; +-@@ -1877,7 +1886,8 @@ fail: +- * Returns: the (possibly reallocated) skb or an ERR_PTR() code +- */ +- static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata, +-- struct sk_buff *skb, u32 info_flags) +-+ struct sk_buff *skb, u32 info_flags, +-+ struct sta_info **sta_out) +- { +- struct ieee80211_local *local = sdata->local; +- struct ieee80211_tx_info *info; +-@@ -1920,6 +1930,7 @@ static struct sk_buff *ieee80211_build_h +- authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); +- wme_sta = sta->sta.wme; +- have_station = true; +-+ *sta_out = sta; +- } else if (sdata->wdev.use_4addr) { +- ret = -ENOLINK; +- goto free; +-@@ -2073,6 +2084,7 @@ static struct sk_buff *ieee80211_build_h +- have_station = true; +- authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); +- wme_sta = sta->sta.wme; +-+ *sta_out = sta; +- } else if (sdata->u.mgd.use_4addr && +- cpu_to_be16(ethertype) != sdata->control_port_protocol) { +- fc |= cpu_to_le16(IEEE80211_FCTL_FROMDS | +-@@ -2136,13 +2148,18 @@ static struct sk_buff *ieee80211_build_h +- * and mesh mode checks authorization later. +- */ +- multicast = is_multicast_ether_addr(hdr.addr1); +-- if (!multicast && !have_station && +-- !ieee80211_vif_is_mesh(&sdata->vif)) { +-- sta = sta_info_get(sdata, hdr.addr1); +-+ if (multicast) { +-+ *sta_out = ERR_PTR(-ENOENT); +-+ } else if (!have_station && !ieee80211_vif_is_mesh(&sdata->vif)) { +-+ if (sdata->control_port_protocol == skb->protocol) +-+ sta = sta_info_get_bss(sdata, hdr.addr1); +-+ else +-+ sta = sta_info_get(sdata, hdr.addr1); +- if (sta) { +- authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); +- wme_sta = sta->sta.wme; +- } +-+ *sta_out = sta ?: ERR_PTR(-ENOENT); +- } +- +- /* For mesh, the use of the QoS header is mandatory */ +-@@ -2320,6 +2337,7 @@ void __ieee80211_subif_start_xmit(struct +- u32 info_flags) +- { +- struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); +-+ struct sta_info *sta = NULL; +- +- if (unlikely(skb->len < ETH_HLEN)) { +- kfree_skb(skb); +-@@ -2328,7 +2346,7 @@ void __ieee80211_subif_start_xmit(struct +- +- rcu_read_lock(); +- +-- skb = ieee80211_build_hdr(sdata, skb, info_flags); +-+ skb = ieee80211_build_hdr(sdata, skb, info_flags, &sta); +- if (IS_ERR(skb)) +- goto out; +- +-@@ -2336,7 +2354,7 @@ void __ieee80211_subif_start_xmit(struct +- dev->stats.tx_bytes += skb->len; +- dev->trans_start = jiffies; +- +-- ieee80211_xmit(sdata, skb); +-+ ieee80211_xmit(sdata, sta, skb); +- out: +- rcu_read_unlock(); +- } +-@@ -2364,10 +2382,11 @@ ieee80211_build_data_template(struct iee +- .local = sdata->local, +- .sdata = sdata, +- }; +-+ struct sta_info *sta_ignore; +- +- rcu_read_lock(); +- +-- skb = ieee80211_build_hdr(sdata, skb, info_flags); +-+ skb = ieee80211_build_hdr(sdata, skb, info_flags, &sta_ignore); +- if (IS_ERR(skb)) +- goto out; +- +-@@ -2425,7 +2444,7 @@ static bool ieee80211_tx_pending_skb(str +- return true; +- } +- info->band = chanctx_conf->def.chan->band; +-- result = ieee80211_tx(sdata, skb, true); +-+ result = ieee80211_tx(sdata, NULL, skb, true); +- } else { +- struct sk_buff_head skbs; +- +-@@ -3163,7 +3182,7 @@ ieee80211_get_buffered_bc(struct ieee802 +- +- if (sdata->vif.type == NL80211_IFTYPE_AP) +- sdata = IEEE80211_DEV_TO_SUB_IF(skb->dev); +-- if (!ieee80211_tx_prepare(sdata, &tx, skb)) +-+ if (!ieee80211_tx_prepare(sdata, &tx, NULL, skb)) +- break; +- dev_kfree_skb_any(skb); +- } +-@@ -3295,6 +3314,6 @@ void __ieee80211_tx_skb_tid_band(struct +- */ +- local_bh_disable(); +- IEEE80211_SKB_CB(skb)->band = band; +-- ieee80211_xmit(sdata, skb); +-+ 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 +new file mode 100644 +index 0000000..2d5f7b9 +--- /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 ++ ++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. ++ ++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 ++--- ++ ++--- 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); ++ ++ ring = flow->rings[flowid]; +++ if (ring->blocked == blocked) { +++ spin_unlock_irqrestore(&flow->block_lock, flags); +++ return; +++ } ++ ifidx = brcmf_flowring_ifidx_get(flow, flowid); ++ ++ 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 +--- a/package/kernel/mac80211/patches/316-mac80211-reduce-log-spam-from-ieee80211_handle_pwr_c.patch ++++ /dev/null +@@ -1,38 +0,0 @@ +-From: John Linville +-Date: Tue, 31 Mar 2015 10:49:14 -0400 +-Subject: [PATCH] mac80211: reduce log spam from ieee80211_handle_pwr_constr +- +-This changes a couple of messages from sdata_info to sdata_dbg. +-This should reduce some log spam, as reported here: +- +- https://bugzilla.redhat.com/show_bug.cgi?id=1206468 +- +-Signed-off-by: John W. Linville +-Signed-off-by: Johannes Berg +---- +- +---- a/net/mac80211/mlme.c +-+++ b/net/mac80211/mlme.c +-@@ -1347,15 +1347,15 @@ static u32 ieee80211_handle_pwr_constr(s +- */ +- if (has_80211h_pwr && +- (!has_cisco_pwr || pwr_level_80211h <= pwr_level_cisco)) { +-- sdata_info(sdata, +-- "Limiting TX power to %d (%d - %d) dBm as advertised by %pM\n", +-- pwr_level_80211h, chan_pwr, pwr_reduction_80211h, +-- sdata->u.mgd.bssid); +-+ sdata_dbg(sdata, +-+ "Limiting TX power to %d (%d - %d) dBm as advertised by %pM\n", +-+ pwr_level_80211h, chan_pwr, pwr_reduction_80211h, +-+ sdata->u.mgd.bssid); +- new_ap_level = pwr_level_80211h; +- } else { /* has_cisco_pwr is always true here. */ +-- sdata_info(sdata, +-- "Limiting TX power to %d dBm as advertised by %pM\n", +-- pwr_level_cisco, sdata->u.mgd.bssid); +-+ sdata_dbg(sdata, +-+ "Limiting TX power to %d dBm as advertised by %pM\n", +-+ pwr_level_cisco, sdata->u.mgd.bssid); +- new_ap_level = pwr_level_cisco; +- } +- +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 +--- a/package/kernel/mac80211/patches/317-brcmfmac-Fix-race-condition-in-msgbuf-ioctl-processi.patch ++++ /dev/null +@@ -1,35 +0,0 @@ +-From: Hante Meuleman +-Date: Fri, 6 Mar 2015 18:40:41 +0100 +-Subject: [PATCH] brcmfmac: Fix race condition in msgbuf ioctl processing. +- +-Msgbuf is using a wait_event_timeout to wait for the response on +-an ioctl. The wakeup routine uses waitqueue_active to see if +-wait_event_timeout has been called. There is a chance that the +-response arrives before wait_event_timeout is called, this +-will result in situation that wait_event_timeout never gets +-woken again and assumed result will be a timeout. This patch +-removes that errornous situation by always setting the +-ctl_completed var before checking for queue active. +- +-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/msgbuf.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c +-@@ -481,10 +481,9 @@ static int brcmf_msgbuf_ioctl_resp_wait( +- +- static void brcmf_msgbuf_ioctl_resp_wake(struct brcmf_msgbuf *msgbuf) +- { +-- if (waitqueue_active(&msgbuf->ioctl_resp_wait)) { +-- msgbuf->ctl_completed = true; +-+ msgbuf->ctl_completed = true; +-+ if (waitqueue_active(&msgbuf->ioctl_resp_wait)) +- wake_up(&msgbuf->ioctl_resp_wait); +-- } +- } +- +- +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 +new file mode 100644 +index 0000000..7378401 +--- /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 ++ ++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. ++ ++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 ++--- ++ ++--- 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) ++ ++ #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 ++ +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 +--- a/package/kernel/mac80211/patches/318-brcmfmac-Update-msgbuf-commonring-size-for-improved-.patch ++++ /dev/null +@@ -1,30 +0,0 @@ +-From: Hante Meuleman +-Date: Wed, 18 Mar 2015 13:25:23 +0100 +-Subject: [PATCH] brcmfmac: Update msgbuf commonring size for improved +- throughput. +- +-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/msgbuf.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.h +-@@ -17,11 +17,11 @@ +- +- #ifdef CPTCFG_BRCMFMAC_PROTO_MSGBUF +- +--#define BRCMF_H2D_MSGRING_CONTROL_SUBMIT_MAX_ITEM 20 +--#define BRCMF_H2D_MSGRING_RXPOST_SUBMIT_MAX_ITEM 256 +--#define BRCMF_D2H_MSGRING_CONTROL_COMPLETE_MAX_ITEM 20 +-+#define BRCMF_H2D_MSGRING_CONTROL_SUBMIT_MAX_ITEM 64 +-+#define BRCMF_H2D_MSGRING_RXPOST_SUBMIT_MAX_ITEM 512 +-+#define BRCMF_D2H_MSGRING_CONTROL_COMPLETE_MAX_ITEM 64 +- #define BRCMF_D2H_MSGRING_TX_COMPLETE_MAX_ITEM 1024 +--#define BRCMF_D2H_MSGRING_RX_COMPLETE_MAX_ITEM 256 +-+#define BRCMF_D2H_MSGRING_RX_COMPLETE_MAX_ITEM 512 +- #define BRCMF_H2D_TXFLOWRING_MAX_ITEM 512 +- +- #define BRCMF_H2D_MSGRING_CONTROL_SUBMIT_ITEMSIZE 40 +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 +--- a/package/kernel/mac80211/patches/319-ath9k_htc-add-new-WMI_REG_RMW_CMDID-command.patch ++++ /dev/null +@@ -1,307 +0,0 @@ +-From: Oleksij Rempel +-Date: Sun, 22 Mar 2015 19:29:46 +0100 +-Subject: [PATCH] ath9k_htc: add new WMI_REG_RMW_CMDID command +- +-Since usb bus add extra delay on each request, a command +-with read + write requests is too expensive. We can dramtically +-reduce usb load by moving this command to firmware. +- +-In my tests, this patch will reduce channel scan time +-for about 5-10 seconds. +- +-Signed-off-by: Oleksij Rempel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/ath/ath.h +-+++ b/drivers/net/wireless/ath/ath.h +-@@ -131,6 +131,9 @@ struct ath_ops { +- void (*enable_write_buffer)(void *); +- void (*write_flush) (void *); +- u32 (*rmw)(void *, u32 reg_offset, u32 set, u32 clr); +-+ void (*enable_rmw_buffer)(void *); +-+ void (*rmw_flush) (void *); +-+ +- }; +- +- struct ath_common; +---- a/drivers/net/wireless/ath/ath9k/htc.h +-+++ b/drivers/net/wireless/ath/ath9k/htc.h +-@@ -444,6 +444,10 @@ static inline void ath9k_htc_stop_btcoex +- #define OP_BT_SCAN BIT(4) +- #define OP_TSF_RESET BIT(6) +- +-+enum htc_op_flags { +-+ HTC_FWFLAG_NO_RMW, +-+}; +-+ +- struct ath9k_htc_priv { +- struct device *dev; +- struct ieee80211_hw *hw; +-@@ -482,6 +486,7 @@ struct ath9k_htc_priv { +- bool reconfig_beacon; +- unsigned int rxfilter; +- unsigned long op_flags; +-+ unsigned long fw_flags; +- +- struct ath9k_hw_cal_data caldata; +- struct ath_spec_scan_priv spec_priv; +---- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c +-+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c +-@@ -376,17 +376,139 @@ static void ath9k_regwrite_flush(void *h +- mutex_unlock(&priv->wmi->multi_write_mutex); +- } +- +--static u32 ath9k_reg_rmw(void *hw_priv, u32 reg_offset, u32 set, u32 clr) +-+static void ath9k_reg_rmw_buffer(void *hw_priv, +-+ u32 reg_offset, u32 set, u32 clr) +-+{ +-+ struct ath_hw *ah = (struct ath_hw *) hw_priv; +-+ struct ath_common *common = ath9k_hw_common(ah); +-+ struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv; +-+ u32 rsp_status; +-+ int r; +-+ +-+ mutex_lock(&priv->wmi->multi_rmw_mutex); +-+ +-+ /* Store the register/value */ +-+ priv->wmi->multi_rmw[priv->wmi->multi_rmw_idx].reg = +-+ cpu_to_be32(reg_offset); +-+ priv->wmi->multi_rmw[priv->wmi->multi_rmw_idx].set = +-+ cpu_to_be32(set); +-+ priv->wmi->multi_rmw[priv->wmi->multi_rmw_idx].clr = +-+ cpu_to_be32(clr); +-+ +-+ priv->wmi->multi_rmw_idx++; +-+ +-+ /* If the buffer is full, send it out. */ +-+ if (priv->wmi->multi_rmw_idx == MAX_RMW_CMD_NUMBER) { +-+ r = ath9k_wmi_cmd(priv->wmi, WMI_REG_RMW_CMDID, +-+ (u8 *) &priv->wmi->multi_rmw, +-+ sizeof(struct register_write) * priv->wmi->multi_rmw_idx, +-+ (u8 *) &rsp_status, sizeof(rsp_status), +-+ 100); +-+ if (unlikely(r)) { +-+ ath_dbg(common, WMI, +-+ "REGISTER RMW FAILED, multi len: %d\n", +-+ priv->wmi->multi_rmw_idx); +-+ } +-+ priv->wmi->multi_rmw_idx = 0; +-+ } +-+ +-+ mutex_unlock(&priv->wmi->multi_rmw_mutex); +-+} +-+ +-+static void ath9k_reg_rmw_flush(void *hw_priv) +- { +-- u32 val; +-+ struct ath_hw *ah = (struct ath_hw *) hw_priv; +-+ struct ath_common *common = ath9k_hw_common(ah); +-+ struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv; +-+ u32 rsp_status; +-+ int r; +-+ +-+ if (test_bit(HTC_FWFLAG_NO_RMW, &priv->fw_flags)) +-+ return; +-+ +-+ atomic_dec(&priv->wmi->m_rmw_cnt); +-+ +-+ mutex_lock(&priv->wmi->multi_rmw_mutex); +-+ +-+ if (priv->wmi->multi_rmw_idx) { +-+ r = ath9k_wmi_cmd(priv->wmi, WMI_REG_RMW_CMDID, +-+ (u8 *) &priv->wmi->multi_rmw, +-+ sizeof(struct register_rmw) * priv->wmi->multi_rmw_idx, +-+ (u8 *) &rsp_status, sizeof(rsp_status), +-+ 100); +-+ if (unlikely(r)) { +-+ ath_dbg(common, WMI, +-+ "REGISTER RMW FAILED, multi len: %d\n", +-+ priv->wmi->multi_rmw_idx); +-+ } +-+ priv->wmi->multi_rmw_idx = 0; +-+ } +- +-- val = ath9k_regread(hw_priv, reg_offset); +-- val &= ~clr; +-- val |= set; +-- ath9k_regwrite(hw_priv, val, reg_offset); +-+ mutex_unlock(&priv->wmi->multi_rmw_mutex); +-+} +-+ +-+static void ath9k_enable_rmw_buffer(void *hw_priv) +-+{ +-+ struct ath_hw *ah = (struct ath_hw *) hw_priv; +-+ struct ath_common *common = ath9k_hw_common(ah); +-+ struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv; +-+ +-+ if (test_bit(HTC_FWFLAG_NO_RMW, &priv->fw_flags)) +-+ return; +-+ +-+ atomic_inc(&priv->wmi->m_rmw_cnt); +-+} +-+ +-+static u32 ath9k_reg_rmw_single(void *hw_priv, +-+ u32 reg_offset, u32 set, u32 clr) +-+{ +-+ struct ath_hw *ah = (struct ath_hw *) hw_priv; +-+ struct ath_common *common = ath9k_hw_common(ah); +-+ struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv; +-+ struct register_rmw buf, buf_ret; +-+ int ret; +-+ u32 val = 0; +-+ +-+ buf.reg = cpu_to_be32(reg_offset); +-+ buf.set = cpu_to_be32(set); +-+ buf.clr = cpu_to_be32(clr); +-+ +-+ ret = ath9k_wmi_cmd(priv->wmi, WMI_REG_RMW_CMDID, +-+ (u8 *) &buf, sizeof(buf), +-+ (u8 *) &buf_ret, sizeof(buf_ret), +-+ 100); +-+ if (unlikely(ret)) { +-+ ath_dbg(common, WMI, "REGISTER RMW FAILED:(0x%04x, %d)\n", +-+ reg_offset, ret); +-+ } +- return val; +- } +- +-+static u32 ath9k_reg_rmw(void *hw_priv, u32 reg_offset, u32 set, u32 clr) +-+{ +-+ struct ath_hw *ah = (struct ath_hw *) hw_priv; +-+ struct ath_common *common = ath9k_hw_common(ah); +-+ struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv; +-+ +-+ if (test_bit(HTC_FWFLAG_NO_RMW, &priv->fw_flags)) { +-+ u32 val; +-+ +-+ val = REG_READ(ah, reg_offset); +-+ val &= ~clr; +-+ val |= set; +-+ REG_WRITE(ah, reg_offset, val); +-+ +-+ return 0; +-+ } +-+ +-+ if (atomic_read(&priv->wmi->m_rmw_cnt)) +-+ ath9k_reg_rmw_buffer(hw_priv, reg_offset, set, clr); +-+ else +-+ ath9k_reg_rmw_single(hw_priv, reg_offset, set, clr); +-+ +-+ return 0; +-+} +-+ +- static void ath_usb_read_cachesize(struct ath_common *common, int *csz) +- { +- *csz = L1_CACHE_BYTES >> 2; +-@@ -501,6 +623,8 @@ static int ath9k_init_priv(struct ath9k_ +- ah->reg_ops.write = ath9k_regwrite; +- ah->reg_ops.enable_write_buffer = ath9k_enable_regwrite_buffer; +- ah->reg_ops.write_flush = ath9k_regwrite_flush; +-+ ah->reg_ops.enable_rmw_buffer = ath9k_enable_rmw_buffer; +-+ ah->reg_ops.rmw_flush = ath9k_reg_rmw_flush; +- ah->reg_ops.rmw = ath9k_reg_rmw; +- priv->ah = ah; +- +-@@ -686,6 +810,12 @@ static int ath9k_init_firmware_version(s +- return -EINVAL; +- } +- +-+ if (priv->fw_version_major == 1 && priv->fw_version_minor < 4) +-+ set_bit(HTC_FWFLAG_NO_RMW, &priv->fw_flags); +-+ +-+ dev_info(priv->dev, "FW RMW support: %s\n", +-+ test_bit(HTC_FWFLAG_NO_RMW, &priv->fw_flags) ? "Off" : "On"); +-+ +- return 0; +- } +- +---- a/drivers/net/wireless/ath/ath9k/hw.h +-+++ b/drivers/net/wireless/ath/ath9k/hw.h +-@@ -100,6 +100,18 @@ +- (_ah)->reg_ops.write_flush((_ah)); \ +- } while (0) +- +-+#define ENABLE_REG_RMW_BUFFER(_ah) \ +-+ do { \ +-+ if ((_ah)->reg_ops.enable_rmw_buffer) \ +-+ (_ah)->reg_ops.enable_rmw_buffer((_ah)); \ +-+ } while (0) +-+ +-+#define REG_RMW_BUFFER_FLUSH(_ah) \ +-+ do { \ +-+ if ((_ah)->reg_ops.rmw_flush) \ +-+ (_ah)->reg_ops.rmw_flush((_ah)); \ +-+ } while (0) +-+ +- #define PR_EEP(_s, _val) \ +- do { \ +- len += scnprintf(buf + len, size - len, "%20s : %10d\n",\ +---- a/drivers/net/wireless/ath/ath9k/wmi.c +-+++ b/drivers/net/wireless/ath/ath9k/wmi.c +-@@ -61,6 +61,8 @@ static const char *wmi_cmd_to_name(enum +- return "WMI_REG_READ_CMDID"; +- case WMI_REG_WRITE_CMDID: +- return "WMI_REG_WRITE_CMDID"; +-+ case WMI_REG_RMW_CMDID: +-+ return "WMI_REG_RMW_CMDID"; +- case WMI_RC_STATE_CHANGE_CMDID: +- return "WMI_RC_STATE_CHANGE_CMDID"; +- case WMI_RC_RATE_UPDATE_CMDID: +-@@ -101,6 +103,7 @@ struct wmi *ath9k_init_wmi(struct ath9k_ +- spin_lock_init(&wmi->event_lock); +- mutex_init(&wmi->op_mutex); +- mutex_init(&wmi->multi_write_mutex); +-+ mutex_init(&wmi->multi_rmw_mutex); +- init_completion(&wmi->cmd_wait); +- INIT_LIST_HEAD(&wmi->pending_tx_events); +- tasklet_init(&wmi->wmi_event_tasklet, ath9k_wmi_event_tasklet, +---- a/drivers/net/wireless/ath/ath9k/wmi.h +-+++ b/drivers/net/wireless/ath/ath9k/wmi.h +-@@ -112,6 +112,7 @@ enum wmi_cmd_id { +- WMI_TX_STATS_CMDID, +- WMI_RX_STATS_CMDID, +- WMI_BITRATE_MASK_CMDID, +-+ WMI_REG_RMW_CMDID, +- }; +- +- enum wmi_event_id { +-@@ -125,12 +126,19 @@ enum wmi_event_id { +- }; +- +- #define MAX_CMD_NUMBER 62 +-+#define MAX_RMW_CMD_NUMBER 15 +- +- struct register_write { +- __be32 reg; +- __be32 val; +- }; +- +-+struct register_rmw { +-+ __be32 reg; +-+ __be32 set; +-+ __be32 clr; +-+} __packed; +-+ +- struct ath9k_htc_tx_event { +- int count; +- struct __wmi_event_txstatus txs; +-@@ -156,10 +164,18 @@ struct wmi { +- +- spinlock_t wmi_lock; +- +-+ /* multi write section */ +- atomic_t mwrite_cnt; +- struct register_write multi_write[MAX_CMD_NUMBER]; +- u32 multi_write_idx; +- struct mutex multi_write_mutex; +-+ +-+ /* multi rmw section */ +-+ atomic_t m_rmw_cnt; +-+ struct register_rmw multi_rmw[MAX_RMW_CMD_NUMBER]; +-+ u32 multi_rmw_idx; +-+ struct mutex multi_rmw_mutex; +-+ +- }; +- +- 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 +new file mode 100644 +index 0000000..97444b3 +--- /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 ++ ++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. ++ ++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/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) ++ { ++ 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; ++ } ++- /* 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; +++ +++ *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) +++{ +++ 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]; +++} +++ ++ 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 ++ ++ /* 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; +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 +--- a/package/kernel/mac80211/patches/320-ath9k-ar9271_hw_pa_cal-use-defs-instead-of-magin-num.patch ++++ /dev/null +@@ -1,89 +0,0 @@ +-From: Oleksij Rempel +-Date: Sun, 22 Mar 2015 19:29:47 +0100 +-Subject: [PATCH] ath9k: ar9271_hw_pa_cal - use defs instead of magin +- numbers +- +-This function uses mixed styles for register names/numbers which +-is make harder reading and optimisation. +- +-Signed-off-by: Oleksij Rempel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c +-+++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c +-@@ -430,22 +430,22 @@ static void ar9271_hw_pa_cal(struct ath_ +- u32 regVal; +- unsigned int i; +- u32 regList[][2] = { +-- { 0x786c, 0 }, +-- { 0x7854, 0 }, +-- { 0x7820, 0 }, +-- { 0x7824, 0 }, +-- { 0x7868, 0 }, +-- { 0x783c, 0 }, +-- { 0x7838, 0 } , +-- { 0x7828, 0 } , +-+ { AR9285_AN_TOP3, 0 }, +-+ { AR9285_AN_RXTXBB1, 0 }, +-+ { AR9285_AN_RF2G1, 0 }, +-+ { AR9285_AN_RF2G2, 0 }, +-+ { AR9285_AN_TOP2, 0 }, +-+ { AR9285_AN_RF2G8, 0 }, +-+ { AR9285_AN_RF2G7, 0 } , +-+ { AR9285_AN_RF2G3, 0 } , +- }; +- +- for (i = 0; i < ARRAY_SIZE(regList); i++) +- regList[i][1] = REG_READ(ah, regList[i][0]); +- +-- regVal = REG_READ(ah, 0x7834); +-+ regVal = REG_READ(ah, AR9285_AN_RF2G6); +- regVal &= (~(0x1)); +-- REG_WRITE(ah, 0x7834, regVal); +-+ REG_WRITE(ah, AR9285_AN_RF2G6, regVal); +- regVal = REG_READ(ah, 0x9808); +- regVal |= (0x1 << 27); +- REG_WRITE(ah, 0x9808, regVal); +-@@ -477,7 +477,7 @@ static void ar9271_hw_pa_cal(struct ath_ +- * does not matter since we turn it off +- */ +- REG_RMW_FIELD(ah, AR9285_AN_RF2G7, AR9285_AN_RF2G7_PADRVGN2TAB0, 0); +-- +-+ /* 7828, b0-11, ccom=fff */ +- REG_RMW_FIELD(ah, AR9285_AN_RF2G3, AR9271_AN_RF2G3_CCOMP, 0xfff); +- +- /* Set: +-@@ -490,15 +490,16 @@ static void ar9271_hw_pa_cal(struct ath_ +- +- /* find off_6_1; */ +- for (i = 6; i > 0; i--) { +-- regVal = REG_READ(ah, 0x7834); +-+ regVal = REG_READ(ah, AR9285_AN_RF2G6); +- regVal |= (1 << (20 + i)); +-- REG_WRITE(ah, 0x7834, regVal); +-+ REG_WRITE(ah, AR9285_AN_RF2G6, regVal); +- udelay(1); +- /* regVal = REG_READ(ah, 0x7834); */ +- regVal &= (~(0x1 << (20 + i))); +-- regVal |= (MS(REG_READ(ah, 0x7840), AR9285_AN_RXTXBB1_SPARE9) +-+ regVal |= (MS(REG_READ(ah, AR9285_AN_RF2G9), +-+ AR9285_AN_RXTXBB1_SPARE9) +- << (20 + i)); +-- REG_WRITE(ah, 0x7834, regVal); +-+ REG_WRITE(ah, AR9285_AN_RF2G6, regVal); +- } +- +- regVal = (regVal >> 20) & 0x7f; +-@@ -517,9 +518,9 @@ static void ar9271_hw_pa_cal(struct ath_ +- +- ENABLE_REGWRITE_BUFFER(ah); +- +-- regVal = REG_READ(ah, 0x7834); +-+ regVal = REG_READ(ah, AR_AN_RF2G1_CH1); +- regVal |= 0x1; +-- REG_WRITE(ah, 0x7834, regVal); +-+ REG_WRITE(ah, AR_AN_RF2G1_CH1, regVal); +- 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 +new file mode 100644 +index 0000000..632714c +--- /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 ++ ++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 ++--- ++ ++--- 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 ++ } ++ ++ 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; +++ +++ /* assure protocol is always called with +++ * non-null initialized pointer. +++ */ +++ 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) +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 +--- a/package/kernel/mac80211/patches/321-ath9k-ar9271_hw_pa_cal-use-proper-makroses.patch ++++ /dev/null +@@ -1,79 +0,0 @@ +-From: Oleksij Rempel +-Date: Sun, 22 Mar 2015 19:29:48 +0100 +-Subject: [PATCH] ath9k: ar9271_hw_pa_cal: use proper makroses. +- +-Signed-off-by: Oleksij Rempel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c +-+++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c +-@@ -443,33 +443,30 @@ static void ar9271_hw_pa_cal(struct ath_ +- for (i = 0; i < ARRAY_SIZE(regList); i++) +- regList[i][1] = REG_READ(ah, regList[i][0]); +- +-- regVal = REG_READ(ah, AR9285_AN_RF2G6); +-- regVal &= (~(0x1)); +-- REG_WRITE(ah, AR9285_AN_RF2G6, regVal); +-- regVal = REG_READ(ah, 0x9808); +-- regVal |= (0x1 << 27); +-- REG_WRITE(ah, 0x9808, regVal); +-- +-+ /* 7834, b1=0 */ +-+ REG_CLR_BIT(ah, AR9285_AN_RF2G6, 1 << 0); +-+ /* 9808, b27=1 */ +-+ REG_SET_BIT(ah, 0x9808, 1 << 27); +- /* 786c,b23,1, pwddac=1 */ +-- REG_RMW_FIELD(ah, AR9285_AN_TOP3, AR9285_AN_TOP3_PWDDAC, 1); +-+ REG_SET_BIT(ah, AR9285_AN_TOP3, AR9285_AN_TOP3_PWDDAC); +- /* 7854, b5,1, pdrxtxbb=1 */ +-- REG_RMW_FIELD(ah, AR9285_AN_RXTXBB1, AR9285_AN_RXTXBB1_PDRXTXBB1, 1); +-+ REG_SET_BIT(ah, AR9285_AN_RXTXBB1, AR9285_AN_RXTXBB1_PDRXTXBB1); +- /* 7854, b7,1, pdv2i=1 */ +-- REG_RMW_FIELD(ah, AR9285_AN_RXTXBB1, AR9285_AN_RXTXBB1_PDV2I, 1); +-+ REG_SET_BIT(ah, AR9285_AN_RXTXBB1, AR9285_AN_RXTXBB1_PDV2I); +- /* 7854, b8,1, pddacinterface=1 */ +-- REG_RMW_FIELD(ah, AR9285_AN_RXTXBB1, AR9285_AN_RXTXBB1_PDDACIF, 1); +-+ REG_SET_BIT(ah, AR9285_AN_RXTXBB1, AR9285_AN_RXTXBB1_PDDACIF); +- /* 7824,b12,0, offcal=0 */ +-- REG_RMW_FIELD(ah, AR9285_AN_RF2G2, AR9285_AN_RF2G2_OFFCAL, 0); +-+ REG_CLR_BIT(ah, AR9285_AN_RF2G2, AR9285_AN_RF2G2_OFFCAL); +- /* 7838, b1,0, pwddb=0 */ +-- REG_RMW_FIELD(ah, AR9285_AN_RF2G7, AR9285_AN_RF2G7_PWDDB, 0); +-+ REG_CLR_BIT(ah, AR9285_AN_RF2G7, AR9285_AN_RF2G7_PWDDB); +- /* 7820,b11,0, enpacal=0 */ +-- REG_RMW_FIELD(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_ENPACAL, 0); +-+ REG_CLR_BIT(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_ENPACAL); +- /* 7820,b25,1, pdpadrv1=0 */ +-- REG_RMW_FIELD(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_PDPADRV1, 0); +-+ REG_CLR_BIT(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_PDPADRV1); +- /* 7820,b24,0, pdpadrv2=0 */ +-- REG_RMW_FIELD(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_PDPADRV2, 0); +-+ REG_CLR_BIT(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_PDPADRV2); +- /* 7820,b23,0, pdpaout=0 */ +-- REG_RMW_FIELD(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_PDPAOUT, 0); +-+ REG_CLR_BIT(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_PDPAOUT); +- /* 783c,b14-16,7, padrvgn2tab_0=7 */ +- REG_RMW_FIELD(ah, AR9285_AN_RF2G8, AR9285_AN_RF2G8_PADRVGN2TAB0, 7); +- /* +-@@ -516,15 +513,13 @@ static void ar9271_hw_pa_cal(struct ath_ +- ah->pacal_info.prev_offset = regVal; +- } +- +-- ENABLE_REGWRITE_BUFFER(ah); +- +-- regVal = REG_READ(ah, AR_AN_RF2G1_CH1); +-- regVal |= 0x1; +-- REG_WRITE(ah, AR_AN_RF2G1_CH1, regVal); +-- regVal = REG_READ(ah, 0x9808); +-- regVal &= (~(0x1 << 27)); +-- REG_WRITE(ah, 0x9808, regVal); +-+ /* 7834, b1=1 */ +-+ REG_SET_BIT(ah, AR9285_AN_RF2G6, 1 << 0); +-+ /* 9808, b27=0 */ +-+ REG_CLR_BIT(ah, 0x9808, 1 << 27); +- +-+ ENABLE_REGWRITE_BUFFER(ah); +- 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 +new file mode 100644 +index 0000000..3360cbc +--- /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() ++ ++Just pass the interface to be removed, ie. 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 ++--- ++ ++--- 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/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 ++ } ++ } ++ ++-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; +++ +++ brcmf_fws_del_interface(ifp); +++ brcmf_del_if(ifp->drvr, ifp->bssidx); ++ } ++ ++ 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 ++ { ++ 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); ++ } ++ +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 +--- a/package/kernel/mac80211/patches/322-ath9k-ar9271_hw_pa_cal-use-RMW-buffer.patch ++++ /dev/null +@@ -1,48 +0,0 @@ +-From: Oleksij Rempel +-Date: Sun, 22 Mar 2015 19:29:49 +0100 +-Subject: [PATCH] ath9k: ar9271_hw_pa_cal: use RMW buffer +- +-Signed-off-by: Oleksij Rempel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c +-+++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c +-@@ -436,13 +436,14 @@ static void ar9271_hw_pa_cal(struct ath_ +- { AR9285_AN_RF2G2, 0 }, +- { AR9285_AN_TOP2, 0 }, +- { AR9285_AN_RF2G8, 0 }, +-- { AR9285_AN_RF2G7, 0 } , +-- { AR9285_AN_RF2G3, 0 } , +-+ { AR9285_AN_RF2G7, 0 }, +-+ { AR9285_AN_RF2G3, 0 }, +- }; +- +- for (i = 0; i < ARRAY_SIZE(regList); i++) +- regList[i][1] = REG_READ(ah, regList[i][0]); +- +-+ ENABLE_REG_RMW_BUFFER(ah); +- /* 7834, b1=0 */ +- REG_CLR_BIT(ah, AR9285_AN_RF2G6, 1 << 0); +- /* 9808, b27=1 */ +-@@ -476,6 +477,7 @@ static void ar9271_hw_pa_cal(struct ath_ +- REG_RMW_FIELD(ah, AR9285_AN_RF2G7, AR9285_AN_RF2G7_PADRVGN2TAB0, 0); +- /* 7828, b0-11, ccom=fff */ +- REG_RMW_FIELD(ah, AR9285_AN_RF2G3, AR9271_AN_RF2G3_CCOMP, 0xfff); +-+ REG_RMW_BUFFER_FLUSH(ah); +- +- /* Set: +- * localmode=1,bmode=1,bmoderxtx=1,synthon=1, +-@@ -514,10 +516,12 @@ static void ar9271_hw_pa_cal(struct ath_ +- } +- +- +-+ ENABLE_REG_RMW_BUFFER(ah); +- /* 7834, b1=1 */ +- REG_SET_BIT(ah, AR9285_AN_RF2G6, 1 << 0); +- /* 9808, b27=0 */ +- REG_CLR_BIT(ah, 0x9808, 1 << 27); +-+ REG_RMW_BUFFER_FLUSH(ah); +- +- 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 +new file mode 100644 +index 0000000..2b61f4e +--- /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 ++ ++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: ++ ++ 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 ++--- ++ ++--- 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; +++ } ++ if (drvr->fws) { ++ brcmf_fws_del_interface(ifp); ++ brcmf_fws_deinit(drvr); +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 +--- a/package/kernel/mac80211/patches/323-ath9k-add-multi_read-to-be-compatible-with-ath9k_htc.patch ++++ /dev/null +@@ -1,35 +0,0 @@ +-From: Oleksij Rempel +-Date: Sun, 22 Mar 2015 19:29:50 +0100 +-Subject: [PATCH] ath9k: add multi_read to be compatible with ath9k_htc +- +-Signed-off-by: Oleksij Rempel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/ath/ath9k/init.c +-+++ b/drivers/net/wireless/ath/ath9k/init.c +-@@ -141,6 +141,16 @@ static unsigned int ath9k_ioread32(void +- return val; +- } +- +-+static void ath9k_multi_ioread32(void *hw_priv, u32 *addr, +-+ u32 *val, u16 count) +-+{ +-+ int i; +-+ +-+ for (i = 0; i < count; i++) +-+ val[i] = ath9k_ioread32(hw_priv, addr[i]); +-+} +-+ +-+ +- static unsigned int __ath9k_reg_rmw(struct ath_softc *sc, u32 reg_offset, +- u32 set, u32 clr) +- { +-@@ -530,6 +540,7 @@ static int ath9k_init_softc(u16 devid, s +- ah->hw = sc->hw; +- ah->hw_version.devid = devid; +- ah->reg_ops.read = ath9k_ioread32; +-+ ah->reg_ops.multi_read = ath9k_multi_ioread32; +- 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 +--- a/package/kernel/mac80211/patches/324-ath9k-add-new-function-ath9k_hw_read_array.patch ++++ /dev/null +@@ -1,69 +0,0 @@ +-From: Oleksij Rempel +-Date: Sun, 22 Mar 2015 19:29:51 +0100 +-Subject: [PATCH] ath9k: add new function ath9k_hw_read_array +- +-REG_READ generate most overhead on usb bus. It send and read micro packages +-and reduce usb bandwidth. To reduce this overhead we should read in batches. +- +-Signed-off-by: Oleksij Rempel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/ath/ath9k/hw.c +-+++ b/drivers/net/wireless/ath/ath9k/hw.c +-@@ -121,6 +121,36 @@ void ath9k_hw_write_array(struct ath_hw +- REGWRITE_BUFFER_FLUSH(ah); +- } +- +-+void ath9k_hw_read_array(struct ath_hw *ah, u32 array[][2], int size) +-+{ +-+ u32 *tmp_reg_list, *tmp_data; +-+ int i; +-+ +-+ tmp_reg_list = kmalloc(size * sizeof(u32), GFP_KERNEL); +-+ if (!tmp_reg_list) { +-+ dev_err(ah->dev, "%s: tmp_reg_list: alloc filed\n", __func__); +-+ return; +-+ } +-+ +-+ tmp_data = kmalloc(size * sizeof(u32), GFP_KERNEL); +-+ if (!tmp_data) { +-+ dev_err(ah->dev, "%s tmp_data: alloc filed\n", __func__); +-+ goto error_tmp_data; +-+ } +-+ +-+ for (i = 0; i < size; i++) +-+ tmp_reg_list[i] = array[i][0]; +-+ +-+ REG_READ_MULTI(ah, tmp_reg_list, tmp_data, size); +-+ +-+ for (i = 0; i < size; i++) +-+ array[i][1] = tmp_data[i]; +-+ +-+ kfree(tmp_data); +-+error_tmp_data: +-+ kfree(tmp_reg_list); +-+} +-+ +- u32 ath9k_hw_reverse_bits(u32 val, u32 n) +- { +- u32 retval; +---- a/drivers/net/wireless/ath/ath9k/hw.h +-+++ b/drivers/net/wireless/ath/ath9k/hw.h +-@@ -138,6 +138,8 @@ +- +- #define REG_WRITE_ARRAY(iniarray, column, regWr) \ +- ath9k_hw_write_array(ah, iniarray, column, &(regWr)) +-+#define REG_READ_ARRAY(ah, array, size) \ +-+ ath9k_hw_read_array(ah, array, size) +- +- #define AR_GPIO_OUTPUT_MUX_AS_OUTPUT 0 +- #define AR_GPIO_OUTPUT_MUX_AS_PCIE_ATTENTION_LED 1 +-@@ -1020,6 +1022,7 @@ void ath9k_hw_synth_delay(struct ath_hw +- bool ath9k_hw_wait(struct ath_hw *ah, u32 reg, u32 mask, u32 val, u32 timeout); +- void ath9k_hw_write_array(struct ath_hw *ah, const struct ar5416IniArray *array, +- int column, unsigned int *writecnt); +-+void ath9k_hw_read_array(struct ath_hw *ah, u32 array[][2], int size); +- 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 +new file mode 100644 +index 0000000..abd6681 +--- /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 ++ ++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. ++ ++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/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); ++ } +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 +--- a/package/kernel/mac80211/patches/325-ath9k-ar9271_hw_pa_cal-use-REG_READ_ARRAY.patch ++++ /dev/null +@@ -1,24 +0,0 @@ +-From: Oleksij Rempel +-Date: Sun, 22 Mar 2015 19:29:52 +0100 +-Subject: [PATCH] ath9k: ar9271_hw_pa_cal: use REG_READ_ARRAY +- +-insted of reading each register separatly +-and waste 4ms on each operation, we can +-use one shot read. +- +-Signed-off-by: Oleksij Rempel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c +-+++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c +-@@ -440,8 +440,7 @@ static void ar9271_hw_pa_cal(struct ath_ +- { AR9285_AN_RF2G3, 0 }, +- }; +- +-- for (i = 0; i < ARRAY_SIZE(regList); i++) +-- regList[i][1] = REG_READ(ah, regList[i][0]); +-+ REG_READ_ARRAY(ah, regList, ARRAY_SIZE(regList)); +- +- 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 +new file mode 100644 +index 0000000..23a7b6f +--- /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() ++ ++Most call sites of brcmf_txfinalize already have struct brcmf_if ++instance so pass that to brcmf_txfinalize() as the function ++needs it anyway. ++ ++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 ++@@ -560,17 +560,11 @@ void brcmf_rx_frame(struct device *dev, ++ brcmf_netif_rx(ifp, skb); ++ } ++ ++-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; ++ ++- ifp = drvr->iflist[ifidx]; ++- if (!ifp) ++- goto done; ++- ++ eh = (struct ethhdr *)(txp->data); ++ type = ntohs(eh->h_proto); ++ ++@@ -582,7 +576,7 @@ void brcmf_txfinalize(struct brcmf_pub * ++ ++ 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; ++ } ++ ++@@ -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? +++ */ +++ brcmf_txfinalize(brcmf_get_ifp(msgbuf->drvr, tx_status->msg.ifidx), +++ skb, true); ++ } ++ ++ +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 +--- a/package/kernel/mac80211/patches/326-ath9k-use-one-shot-read-in-ath9k_hw_update_mibstats.patch ++++ /dev/null +@@ -1,39 +0,0 @@ +-From: Oleksij Rempel +-Date: Sun, 22 Mar 2015 19:29:53 +0100 +-Subject: [PATCH] ath9k: use one shot read in ath9k_hw_update_mibstats +- +-this will reduce some overhead on usb bus. +- +-Signed-off-by: Oleksij Rempel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/ath/ath9k/ani.c +-+++ b/drivers/net/wireless/ath/ath9k/ani.c +-@@ -107,11 +107,21 @@ static const struct ani_cck_level_entry +- static void ath9k_hw_update_mibstats(struct ath_hw *ah, +- struct ath9k_mib_stats *stats) +- { +-- stats->ackrcv_bad += REG_READ(ah, AR_ACK_FAIL); +-- stats->rts_bad += REG_READ(ah, AR_RTS_FAIL); +-- stats->fcs_bad += REG_READ(ah, AR_FCS_FAIL); +-- stats->rts_good += REG_READ(ah, AR_RTS_OK); +-- stats->beacons += REG_READ(ah, AR_BEACON_CNT); +-+ u32 addr[5] = {AR_RTS_OK, AR_RTS_FAIL, AR_ACK_FAIL, +-+ AR_FCS_FAIL, AR_BEACON_CNT}; +-+ u32 data[5]; +-+ +-+ REG_READ_MULTI(ah, &addr[0], &data[0], 5); +-+ /* AR_RTS_OK */ +-+ stats->rts_good += data[0]; +-+ /* AR_RTS_FAIL */ +-+ stats->rts_bad += data[1]; +-+ /* AR_ACK_FAIL */ +-+ stats->ackrcv_bad += data[2]; +-+ /* AR_FCS_FAIL */ +-+ stats->fcs_bad += data[3]; +-+ /* AR_BEACON_CNT */ +-+ stats->beacons += data[4]; +- } +- +- 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 +--- a/package/kernel/mac80211/patches/327-ath9k-ath9k_hw_loadnf-use-REG_RMW.patch ++++ /dev/null +@@ -1,71 +0,0 @@ +-From: Oleksij Rempel +-Date: Sun, 22 Mar 2015 19:29:54 +0100 +-Subject: [PATCH] ath9k: ath9k_hw_loadnf: use REG_RMW +- +-Signed-off-by: Oleksij Rempel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/ath/ath9k/calib.c +-+++ b/drivers/net/wireless/ath/ath9k/calib.c +-@@ -238,7 +238,6 @@ int ath9k_hw_loadnf(struct ath_hw *ah, s +- { +- struct ath9k_nfcal_hist *h = NULL; +- unsigned i, j; +-- int32_t val; +- 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); +-@@ -246,6 +245,7 @@ int ath9k_hw_loadnf(struct ath_hw *ah, s +- if (ah->caldata) +- h = ah->caldata->nfCalHist; +- +-+ ENABLE_REG_RMW_BUFFER(ah); +- for (i = 0; i < NUM_NF_READINGS; i++) { +- if (chainmask & (1 << i)) { +- s16 nfval; +-@@ -258,10 +258,8 @@ int ath9k_hw_loadnf(struct ath_hw *ah, s +- else +- nfval = default_nf; +- +-- val = REG_READ(ah, ah->nf_regs[i]); +-- val &= 0xFFFFFE00; +-- val |= (((u32) nfval << 1) & 0x1ff); +-- REG_WRITE(ah, ah->nf_regs[i], val); +-+ REG_RMW(ah, ah->nf_regs[i], +-+ (((u32) nfval << 1) & 0x1ff), 0x1ff); +- } +- } +- +-@@ -274,6 +272,7 @@ int ath9k_hw_loadnf(struct ath_hw *ah, s +- REG_CLR_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); +- +- /* +- * Wait for load to complete, should be fast, a few 10s of us. +-@@ -309,19 +308,17 @@ int ath9k_hw_loadnf(struct ath_hw *ah, s +- * by the median we just loaded. This will be initial (and max) value +- * of next noise floor calibration the baseband does. +- */ +-- ENABLE_REGWRITE_BUFFER(ah); +-+ ENABLE_REG_RMW_BUFFER(ah); +- for (i = 0; i < NUM_NF_READINGS; i++) { +- if (chainmask & (1 << i)) { +- if ((i >= AR5416_MAX_CHAINS) && !IS_CHAN_HT40(chan)) +- continue; +- +-- val = REG_READ(ah, ah->nf_regs[i]); +-- val &= 0xFFFFFE00; +-- val |= (((u32) (-50) << 1) & 0x1ff); +-- REG_WRITE(ah, ah->nf_regs[i], val); +-+ REG_RMW(ah, ah->nf_regs[i], +-+ (((u32) (-50) << 1) & 0x1ff), 0x1ff); +- } +- } +-- REGWRITE_BUFFER_FLUSH(ah); +-+ REG_RMW_BUFFER_FLUSH(ah); +- +- 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 +new file mode 100644 +index 0000000..a0a798b +--- /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 ++ ++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. ++ ++Reviewed-by: Hante Meuleman ++Reviewed-by: Franky (Zhenhui) Lin ++Reviewed-by: Pieter-Paul Giesberts ++Reviewed-by: Pontus Fuchs ++Signed-off-by: Arend van Spriel ++--- ++ ++--- 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); ++ } ++ ++@@ -656,6 +656,9 @@ static void brcmf_pcie_bus_console_read( ++ u8 ch; ++ u32 newidx; ++ +++ if (!BRCMF_FWCON_ON()) +++ return; +++ ++ 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; +++ ++ 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) { +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 +--- a/package/kernel/mac80211/patches/328-ath9k-write-buffer-related-optimisation-in-ar5008_hw.patch ++++ /dev/null +@@ -1,27 +0,0 @@ +-From: Oleksij Rempel +-Date: Sun, 22 Mar 2015 19:29:55 +0100 +-Subject: [PATCH] ath9k: write buffer related optimisation in +- ar5008_hw_set_channel_regs +- +-Signed-off-by: Oleksij Rempel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c +-+++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c +-@@ -681,12 +681,13 @@ static void ar5008_hw_set_channel_regs(s +- phymode |= AR_PHY_FC_DYN2040_PRI_CH; +- +- } +-+ ENABLE_REGWRITE_BUFFER(ah); +- REG_WRITE(ah, AR_PHY_TURBO, phymode); +- +-+ /* This function do only REG_WRITE, so +-+ * we can include it to REGWRITE_BUFFER. */ +- ath9k_hw_set11nmac2040(ah, chan); +- +-- ENABLE_REGWRITE_BUFFER(ah); +-- +- 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 +new file mode 100644 +index 0000000..53e7ede +--- /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() ++ ++The brcmf_fws_txstatus_suppressed() function prototype specifies an ++ifidx parameter which is not used within the function implementation. ++ ++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/fwsignal.c +++++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c ++@@ -1398,7 +1398,7 @@ done: ++ } ++ ++ 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; ++ } ++ 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); +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 +--- a/package/kernel/mac80211/patches/329-ath9k-ath9k_hw_set_4k_power_cal_tabl-use-rmw-buffer.patch ++++ /dev/null +@@ -1,26 +0,0 @@ +-From: Oleksij Rempel +-Date: Sun, 22 Mar 2015 19:29:56 +0100 +-Subject: [PATCH] ath9k: ath9k_hw_set_4k_power_cal_tabl: use rmw buffer +- +-Signed-off-by: Oleksij Rempel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c +-+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c +-@@ -389,6 +389,7 @@ static void ath9k_hw_set_4k_power_cal_ta +- } +- } +- +-+ ENABLE_REG_RMW_BUFFER(ah); +- REG_RMW_FIELD(ah, AR_PHY_TPCRG1, AR_PHY_TPCRG1_NUM_PD_GAIN, +- (numXpdGain - 1) & 0x3); +- REG_RMW_FIELD(ah, AR_PHY_TPCRG1, AR_PHY_TPCRG1_PD_GAIN_1, +-@@ -396,6 +397,7 @@ static void ath9k_hw_set_4k_power_cal_ta +- REG_RMW_FIELD(ah, AR_PHY_TPCRG1, AR_PHY_TPCRG1_PD_GAIN_2, +- xpdGainValues[1]); +- REG_RMW_FIELD(ah, AR_PHY_TPCRG1, AR_PHY_TPCRG1_PD_GAIN_3, 0); +-+ REG_RMW_BUFFER_FLUSH(ah); +- +- 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 +new file mode 100644 +index 0000000..bb05235 +--- /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() ++ ++Instead of passing ifidx and drvr just pass struct brcmf_if pointer ++which holds both parameters. ++ ++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/bcdc.c +++++ b/drivers/net/wireless/brcm80211/brcmfmac/bcdc.c ++@@ -312,8 +312,7 @@ brcmf_proto_bcdc_hdrpull(struct brcmf_pu ++ ++ 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) ++ { ++ 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; ++ } ++ ++ 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); ++ ++ 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 +--- a/package/kernel/mac80211/patches/330-ath9k-use-rmw-buffer-in-ath9k_hw_set_operating_mode-.patch ++++ /dev/null +@@ -1,43 +0,0 @@ +-From: Oleksij Rempel +-Date: Sun, 22 Mar 2015 19:29:57 +0100 +-Subject: [PATCH] ath9k: use rmw buffer in ath9k_hw_set_operating_mode +- and ath9k_hw_reset +- +-Signed-off-by: Oleksij Rempel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/ath/ath9k/hw.c +-+++ b/drivers/net/wireless/ath/ath9k/hw.c +-@@ -1227,6 +1227,7 @@ static void ath9k_hw_set_operating_mode( +- u32 mask = AR_STA_ID1_STA_AP | AR_STA_ID1_ADHOC; +- u32 set = AR_STA_ID1_KSRCH_MODE; +- +-+ ENABLE_REG_RMW_BUFFER(ah); +- switch (opmode) { +- case NL80211_IFTYPE_ADHOC: +- if (!AR_SREV_9340_13(ah)) { +-@@ -1248,6 +1249,7 @@ static void ath9k_hw_set_operating_mode( +- break; +- } +- REG_RMW(ah, AR_STA_ID1, set, mask); +-+ REG_RMW_BUFFER_FLUSH(ah); +- } +- +- void ath9k_hw_get_delta_slope_vals(struct ath_hw *ah, u32 coef_scaled, +-@@ -1960,6 +1962,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st +- if (!ath9k_hw_mci_is_enabled(ah)) +- REG_WRITE(ah, AR_OBS, 8); +- +-+ ENABLE_REG_RMW_BUFFER(ah); +- if (ah->config.rx_intr_mitigation) { +- REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_LAST, ah->config.rimt_last); +- REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_FIRST, ah->config.rimt_first); +-@@ -1969,6 +1972,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st +- REG_RMW_FIELD(ah, AR_TIMT, AR_TIMT_LAST, 300); +- REG_RMW_FIELD(ah, AR_TIMT, AR_TIMT_FIRST, 750); +- } +-+ REG_RMW_BUFFER_FLUSH(ah); +- +- 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 +new file mode 100644 +index 0000000..0651a2f +--- /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 ++ ++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. ++ ++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 ++--- ++ ++--- 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; ++ ++- brcmf_free_vif(vif); +++ if (vif) +++ brcmf_free_vif(vif); ++ free_netdev(ndev); ++ } ++ ++--- 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 +--- a/package/kernel/mac80211/patches/331-ath9k-ath9k_hw_4k_set_board_values-use-rmw-buffer.patch ++++ /dev/null +@@ -1,26 +0,0 @@ +-From: Oleksij Rempel +-Date: Sun, 22 Mar 2015 19:29:58 +0100 +-Subject: [PATCH] ath9k: ath9k_hw_4k_set_board_values: use rmw buffer +- +-Signed-off-by: Oleksij Rempel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c +-+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c +-@@ -1082,6 +1082,7 @@ static void ath9k_hw_4k_set_board_values +- mask = BIT(0)|BIT(5)|BIT(10)|BIT(15)|BIT(20)|BIT(25); +- pwrctrl = mask * bb_desired_scale; +- clr = mask * 0x1f; +-+ ENABLE_REG_RMW_BUFFER(ah); +- REG_RMW(ah, AR_PHY_TX_PWRCTRL8, pwrctrl, clr); +- REG_RMW(ah, AR_PHY_TX_PWRCTRL10, pwrctrl, clr); +- REG_RMW(ah, AR_PHY_CH0_TX_PWRCTRL12, pwrctrl, clr); +-@@ -1096,6 +1097,7 @@ static void ath9k_hw_4k_set_board_values +- clr = mask * 0x1f; +- REG_RMW(ah, AR_PHY_CH0_TX_PWRCTRL11, pwrctrl, clr); +- REG_RMW(ah, AR_PHY_CH0_TX_PWRCTRL13, pwrctrl, clr); +-+ REG_RMW_BUFFER_FLUSH(ah); +- } +- } +- +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 +new file mode 100644 +index 0000000..5a7e447 +--- /dev/null ++++ b/package/kernel/mac80211/patches/331-brcmfmac-Reset-PCIE-devices-after-recognition.patch +@@ -0,0 +1,193 @@ ++From: Hante Meuleman ++Date: Thu, 27 Aug 2015 16:14:06 +0200 ++Subject: [PATCH] brcmfmac: Reset PCIE devices after recognition. ++ ++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. ++ ++Cc: Rafal Milecki ++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 ++--- ++ ++--- 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 ++ +++/* 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; ++ } +++ +++ if (ci->pub.ramsize > BRCMF_CHIP_MAX_MEMSIZE) { +++ brcmf_err("RAM size is incorrect\n"); +++ return -ENOMEM; +++ } +++ ++ return 0; ++ } ++ ++@@ -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); ++ } ++ ++--- 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); ++ }; ++--- 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 * ++ } ++ ++ +++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) ++ { ++@@ -1647,6 +1671,7 @@ static void brcmf_pcie_buscore_activate( ++ ++ 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); ++ ++ kfree(bus->bus_priv.pcie); ++ kfree(bus->msgbuf->flowrings); +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 +--- a/package/kernel/mac80211/patches/332-ath9k-ath9k_hw_analog_shift_rmw-use-REG_RMW.patch ++++ /dev/null +@@ -1,27 +0,0 @@ +-From: Oleksij Rempel +-Date: Sun, 22 Mar 2015 19:29:59 +0100 +-Subject: [PATCH] ath9k: ath9k_hw_analog_shift_rmw: use REG_RMW +- +-use REG_RMW in ath9k_hw_analog_shift_rmw. +-It will double execution speed on usb bus. +- +-Signed-off-by: Oleksij Rempel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/ath/ath9k/eeprom.c +-+++ b/drivers/net/wireless/ath/ath9k/eeprom.c +-@@ -27,12 +27,7 @@ void ath9k_hw_analog_shift_regwrite(stru +- void ath9k_hw_analog_shift_rmw(struct ath_hw *ah, u32 reg, u32 mask, +- u32 shift, u32 val) +- { +-- u32 regVal; +-- +-- regVal = REG_READ(ah, reg) & ~mask; +-- regVal |= (val << shift) & mask; +-- +-- REG_WRITE(ah, reg, regVal); +-+ REG_RMW(ah, reg, ((val << shift) & mask), mask); +- +- if (ah->config.analog_shiftreg) +- udelay(100); +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 +--- a/package/kernel/mac80211/patches/333-ath9k-use-REG_RMW-and-rmw-buffer-in-ath9k_hw_4k_set_.patch ++++ /dev/null +@@ -1,47 +0,0 @@ +-From: Oleksij Rempel +-Date: Sun, 22 Mar 2015 19:30:01 +0100 +-Subject: [PATCH] ath9k: use REG_RMW and rmw buffer in +- ath9k_hw_4k_set_gain +- +-it is possible to reduce time needed for this function +-by rplacing REG_WRITE with REG_RMW (plus dummy 0) and putt all commands +-in same buffer. +- +-Signed-off-by: Oleksij Rempel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c +-+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c +-@@ -772,15 +772,14 @@ static void ath9k_hw_4k_set_gain(struct +- struct ar5416_eeprom_4k *eep, +- u8 txRxAttenLocal) +- { +-- REG_WRITE(ah, AR_PHY_SWITCH_CHAIN_0, +-- pModal->antCtrlChain[0]); +-- +-- REG_WRITE(ah, AR_PHY_TIMING_CTRL4(0), +-- (REG_READ(ah, AR_PHY_TIMING_CTRL4(0)) & +-- ~(AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF | +-- AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF)) | +-- SM(pModal->iqCalICh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF) | +-- SM(pModal->iqCalQCh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF)); +-+ ENABLE_REG_RMW_BUFFER(ah); +-+ REG_RMW(ah, AR_PHY_SWITCH_CHAIN_0, +-+ pModal->antCtrlChain[0], 0); +-+ +-+ REG_RMW(ah, AR_PHY_TIMING_CTRL4(0), +-+ SM(pModal->iqCalICh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF) | +-+ SM(pModal->iqCalQCh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF), +-+ AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF | AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF); +- +- if ((eep->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK) >= +- AR5416_EEP_MINOR_VER_3) { +-@@ -819,6 +818,7 @@ static void ath9k_hw_4k_set_gain(struct +- AR9280_PHY_RXGAIN_TXRX_ATTEN, txRxAttenLocal); +- REG_RMW_FIELD(ah, AR_PHY_RXGAIN + 0x1000, +- AR9280_PHY_RXGAIN_TXRX_MARGIN, pModal->rxTxMarginCh[0]); +-+ REG_RMW_BUFFER_FLUSH(ah); +- } +- +- /* +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 +--- a/package/kernel/mac80211/patches/334-ath9k-use-REG_RMW-and-rmw-buffer-in-ath9k_hw_def_set.patch ++++ /dev/null +@@ -1,67 +0,0 @@ +-From: Oleksij Rempel +-Date: Sun, 22 Mar 2015 19:30:03 +0100 +-Subject: [PATCH] ath9k: use REG_RMW and rmw buffer in +- ath9k_hw_def_set_gain +- +-Signed-off-by: Oleksij Rempel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/ath/ath9k/eeprom_def.c +-+++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c +-@@ -466,6 +466,7 @@ static void ath9k_hw_def_set_gain(struct +- struct ar5416_eeprom_def *eep, +- u8 txRxAttenLocal, int regChainOffset, int i) +- { +-+ ENABLE_REG_RMW_BUFFER(ah); +- if (AR5416_VER_MASK >= AR5416_EEP_MINOR_VER_3) { +- txRxAttenLocal = pModal->txRxAttenCh[i]; +- +-@@ -483,16 +484,12 @@ static void ath9k_hw_def_set_gain(struct +- AR_PHY_GAIN_2GHZ_XATTEN2_DB, +- pModal->xatten2Db[i]); +- } else { +-- REG_WRITE(ah, AR_PHY_GAIN_2GHZ + regChainOffset, +-- (REG_READ(ah, AR_PHY_GAIN_2GHZ + regChainOffset) & +-- ~AR_PHY_GAIN_2GHZ_BSW_MARGIN) +-- | SM(pModal-> bswMargin[i], +-- AR_PHY_GAIN_2GHZ_BSW_MARGIN)); +-- REG_WRITE(ah, AR_PHY_GAIN_2GHZ + regChainOffset, +-- (REG_READ(ah, AR_PHY_GAIN_2GHZ + regChainOffset) & +-- ~AR_PHY_GAIN_2GHZ_BSW_ATTEN) +-- | SM(pModal->bswAtten[i], +-- AR_PHY_GAIN_2GHZ_BSW_ATTEN)); +-+ REG_RMW(ah, AR_PHY_GAIN_2GHZ + regChainOffset, +-+ SM(pModal-> bswMargin[i], AR_PHY_GAIN_2GHZ_BSW_MARGIN), +-+ AR_PHY_GAIN_2GHZ_BSW_MARGIN); +-+ REG_RMW(ah, AR_PHY_GAIN_2GHZ + regChainOffset, +-+ SM(pModal->bswAtten[i], AR_PHY_GAIN_2GHZ_BSW_ATTEN), +-+ AR_PHY_GAIN_2GHZ_BSW_ATTEN); +- } +- } +- +-@@ -504,17 +501,14 @@ static void ath9k_hw_def_set_gain(struct +- AR_PHY_RXGAIN + regChainOffset, +- AR9280_PHY_RXGAIN_TXRX_MARGIN, pModal->rxTxMarginCh[i]); +- } else { +-- REG_WRITE(ah, +-- AR_PHY_RXGAIN + regChainOffset, +-- (REG_READ(ah, AR_PHY_RXGAIN + regChainOffset) & +-- ~AR_PHY_RXGAIN_TXRX_ATTEN) +-- | SM(txRxAttenLocal, AR_PHY_RXGAIN_TXRX_ATTEN)); +-- REG_WRITE(ah, +-- AR_PHY_GAIN_2GHZ + regChainOffset, +-- (REG_READ(ah, AR_PHY_GAIN_2GHZ + regChainOffset) & +-- ~AR_PHY_GAIN_2GHZ_RXTX_MARGIN) | +-- SM(pModal->rxTxMarginCh[i], AR_PHY_GAIN_2GHZ_RXTX_MARGIN)); +-+ REG_RMW(ah, AR_PHY_RXGAIN + regChainOffset, +-+ SM(txRxAttenLocal, AR_PHY_RXGAIN_TXRX_ATTEN), +-+ AR_PHY_RXGAIN_TXRX_ATTEN); +-+ REG_RMW(ah, AR_PHY_GAIN_2GHZ + regChainOffset, +-+ SM(pModal->rxTxMarginCh[i], AR_PHY_GAIN_2GHZ_RXTX_MARGIN), +-+ AR_PHY_GAIN_2GHZ_RXTX_MARGIN); +- } +-+ REG_RMW_BUFFER_FLUSH(ah); +- } +- +- static void ath9k_hw_def_set_board_values(struct ath_hw *ah, +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 +deleted file mode 100644 +index 5e63a80..0000000 +--- a/package/kernel/mac80211/patches/335-brcmfmac-Fix-oops-when-SDIO-device-is-removed.patch ++++ /dev/null +@@ -1,44 +0,0 @@ +-From: Hante Meuleman +-Date: Fri, 6 Mar 2015 18:40:38 +0100 +-Subject: [PATCH] brcmfmac: Fix oops when SDIO device is removed. +- +-On removal of SDIO card both functions of card will be getting +-a remove call. When the first is hanging in ctrl frame xmit then +-the second will cause oops. This patch fixes the xmit ctrl +-handling in case of serious errors and also limits the handling +-for remove to function 1 only. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Daniel (Deognyoun) Kim +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +-@@ -1194,7 +1194,7 @@ static void brcmf_ops_sdio_remove(struct +- brcmf_dbg(SDIO, "sdio device ID: 0x%04x\n", func->device); +- brcmf_dbg(SDIO, "Function: %d\n", func->num); +- +-- if (func->num != 1 && func->num != 2) +-+ if (func->num != 1) +- return; +- +- bus_if = dev_get_drvdata(&func->dev); +---- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-@@ -2740,6 +2740,11 @@ static void brcmf_sdio_dpc(struct brcmf_ +- if ((bus->sdiodev->state != BRCMF_SDIOD_DATA) || (err != 0)) { +- brcmf_err("failed backplane access over SDIO, halting operation\n"); +- atomic_set(&bus->intstatus, 0); +-+ if (bus->ctrl_frame_stat) { +-+ bus->ctrl_frame_err = -ENODEV; +-+ bus->ctrl_frame_stat = false; +-+ brcmf_sdio_wait_event_wakeup(bus); +-+ } +- } else if (atomic_read(&bus->intstatus) || +- atomic_read(&bus->ipend) > 0 || +- (!atomic_read(&bus->fcstate) && +diff --git a/package/kernel/mac80211/patches/336-brcmfmac-Simplify-watchdog-sleep.patch b/package/kernel/mac80211/patches/336-brcmfmac-Simplify-watchdog-sleep.patch +deleted file mode 100644 +index 201da75..0000000 +--- a/package/kernel/mac80211/patches/336-brcmfmac-Simplify-watchdog-sleep.patch ++++ /dev/null +@@ -1,157 +0,0 @@ +-From: Hante Meuleman +-Date: Fri, 6 Mar 2015 18:40:39 +0100 +-Subject: [PATCH] brcmfmac: Simplify watchdog sleep. +- +-The watchdog thread is used to put the SDIO bus to sleep when the +-system is idling. This patch simplifies the way it is determined +-when sleep can be entered. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Daniel (Deognyoun) Kim +-Signed-off-by: Hante Meuleman +-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 +-@@ -485,10 +485,9 @@ struct brcmf_sdio { +- #endif /* DEBUG */ +- +- uint clkstate; /* State of sd and backplane clock(s) */ +-- bool activity; /* Activity flag for clock down */ +- s32 idletime; /* Control for activity timeout */ +-- s32 idlecount; /* Activity timeout counter */ +-- s32 idleclock; /* How to set bus driver when idle */ +-+ s32 idlecount; /* Activity timeout counter */ +-+ s32 idleclock; /* How to set bus driver when idle */ +- bool rxflow_mode; /* Rx flow control mode */ +- bool rxflow; /* Is rx flow control on */ +- bool alp_only; /* Don't use HT clock (ALP only) */ +-@@ -511,6 +510,7 @@ struct brcmf_sdio { +- struct workqueue_struct *brcmf_wq; +- struct work_struct datawork; +- atomic_t dpc_tskcnt; +-+ atomic_t dpc_running; +- +- bool txoff; /* Transmit flow-controlled */ +- struct brcmf_sdio_count sdcnt; +-@@ -959,13 +959,8 @@ static int brcmf_sdio_clkctl(struct brcm +- brcmf_dbg(SDIO, "Enter\n"); +- +- /* Early exit if we're already there */ +-- if (bus->clkstate == target) { +-- if (target == CLK_AVAIL) { +-- brcmf_sdio_wd_timer(bus, BRCMF_WD_POLL_MS); +-- bus->activity = true; +-- } +-+ if (bus->clkstate == target) +- return 0; +-- } +- +- switch (target) { +- case CLK_AVAIL: +-@@ -975,7 +970,6 @@ static int brcmf_sdio_clkctl(struct brcm +- /* Now request HT Avail on the backplane */ +- brcmf_sdio_htclk(bus, true, pendok); +- brcmf_sdio_wd_timer(bus, BRCMF_WD_POLL_MS); +-- bus->activity = true; +- break; +- +- case CLK_SDONLY: +-@@ -1024,17 +1018,6 @@ brcmf_sdio_bus_sleep(struct brcmf_sdio * +- +- /* Going to sleep */ +- if (sleep) { +-- /* Don't sleep if something is pending */ +-- if (atomic_read(&bus->intstatus) || +-- atomic_read(&bus->ipend) > 0 || +-- bus->ctrl_frame_stat || +-- (!atomic_read(&bus->fcstate) && +-- brcmu_pktq_mlen(&bus->txq, ~bus->flowcontrol) && +-- data_ok(bus))) { +-- err = -EBUSY; +-- goto done; +-- } +-- +- clkcsr = brcmf_sdiod_regrb(bus->sdiodev, +- SBSDIO_FUNC1_CHIPCLKCSR, +- &err); +-@@ -1045,11 +1028,7 @@ brcmf_sdio_bus_sleep(struct brcmf_sdio * +- SBSDIO_ALP_AVAIL_REQ, &err); +- } +- err = brcmf_sdio_kso_control(bus, false); +-- /* disable watchdog */ +-- if (!err) +-- brcmf_sdio_wd_timer(bus, 0); +- } else { +-- bus->idlecount = 0; +- err = brcmf_sdio_kso_control(bus, true); +- } +- if (err) { +-@@ -3566,7 +3545,7 @@ void brcmf_sdio_isr(struct brcmf_sdio *b +- queue_work(bus->brcmf_wq, &bus->datawork); +- } +- +--static bool brcmf_sdio_bus_watchdog(struct brcmf_sdio *bus) +-+static void brcmf_sdio_bus_watchdog(struct brcmf_sdio *bus) +- { +- brcmf_dbg(TIMER, "Enter\n"); +- +-@@ -3627,22 +3606,21 @@ static bool brcmf_sdio_bus_watchdog(stru +- #endif /* DEBUG */ +- +- /* On idle timeout clear activity flag and/or turn off clock */ +-- if ((bus->idletime > 0) && (bus->clkstate == CLK_AVAIL)) { +-- if (++bus->idlecount >= bus->idletime) { +-+ if ((atomic_read(&bus->dpc_tskcnt) == 0) && +-+ (atomic_read(&bus->dpc_running) == 0) && +-+ (bus->idletime > 0) && (bus->clkstate == CLK_AVAIL)) { +-+ bus->idlecount++; +-+ if (bus->idlecount > bus->idletime) { +-+ brcmf_dbg(SDIO, "idle\n"); +-+ sdio_claim_host(bus->sdiodev->func[1]); +-+ brcmf_sdio_wd_timer(bus, 0); +- bus->idlecount = 0; +-- if (bus->activity) { +-- bus->activity = false; +-- brcmf_sdio_wd_timer(bus, BRCMF_WD_POLL_MS); +-- } else { +-- brcmf_dbg(SDIO, "idle\n"); +-- sdio_claim_host(bus->sdiodev->func[1]); +-- brcmf_sdio_bus_sleep(bus, true, false); +-- sdio_release_host(bus->sdiodev->func[1]); +-- } +-+ brcmf_sdio_bus_sleep(bus, true, false); +-+ sdio_release_host(bus->sdiodev->func[1]); +- } +-+ } else { +-+ bus->idlecount = 0; +- } +-- +-- return (atomic_read(&bus->ipend) > 0); +- } +- +- static void brcmf_sdio_dataworker(struct work_struct *work) +-@@ -3651,8 +3629,11 @@ static void brcmf_sdio_dataworker(struct +- datawork); +- +- while (atomic_read(&bus->dpc_tskcnt)) { +-+ atomic_set(&bus->dpc_running, 1); +- atomic_set(&bus->dpc_tskcnt, 0); +- brcmf_sdio_dpc(bus); +-+ bus->idlecount = 0; +-+ atomic_set(&bus->dpc_running, 0); +- } +- if (brcmf_sdiod_freezing(bus->sdiodev)) { +- brcmf_sdiod_change_state(bus->sdiodev, BRCMF_SDIOD_DOWN); +-@@ -4154,6 +4135,7 @@ struct brcmf_sdio *brcmf_sdio_probe(stru +- } +- /* Initialize DPC thread */ +- atomic_set(&bus->dpc_tskcnt, 0); +-+ atomic_set(&bus->dpc_running, 0); +- +- /* 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 +deleted file mode 100644 +index 3a2de7a..0000000 +--- a/package/kernel/mac80211/patches/337-brcmfmac-Fix-possible-race-condition.patch ++++ /dev/null +@@ -1,83 +0,0 @@ +-From: Hante Meuleman +-Date: Fri, 6 Mar 2015 18:40:40 +0100 +-Subject: [PATCH] brcmfmac: Fix possible race-condition. +- +-SDIO is using a "shared" variable to handoff ctl frames to DPC +-and to see when they are done. In a timeout situation this can +-lead to erroneous situation where DPC started to handle the ctl +-frame while the timeout expired. This patch will fix this by +-adding locking around the shared variable. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Daniel (Deognyoun) Kim +-Signed-off-by: Hante Meuleman +-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 +-@@ -2700,11 +2700,13 @@ static void brcmf_sdio_dpc(struct brcmf_ +- if (bus->ctrl_frame_stat && (bus->clkstate == CLK_AVAIL) && +- data_ok(bus)) { +- sdio_claim_host(bus->sdiodev->func[1]); +-- err = brcmf_sdio_tx_ctrlframe(bus, bus->ctrl_frame_buf, +-- bus->ctrl_frame_len); +-+ if (bus->ctrl_frame_stat) { +-+ err = brcmf_sdio_tx_ctrlframe(bus, bus->ctrl_frame_buf, +-+ bus->ctrl_frame_len); +-+ bus->ctrl_frame_err = err; +-+ bus->ctrl_frame_stat = false; +-+ } +- sdio_release_host(bus->sdiodev->func[1]); +-- bus->ctrl_frame_err = err; +-- bus->ctrl_frame_stat = false; +- brcmf_sdio_wait_event_wakeup(bus); +- } +- /* Send queued frames (limit 1 if rx may still be pending) */ +-@@ -2720,9 +2722,13 @@ static void brcmf_sdio_dpc(struct brcmf_ +- brcmf_err("failed backplane access over SDIO, halting operation\n"); +- atomic_set(&bus->intstatus, 0); +- if (bus->ctrl_frame_stat) { +-- bus->ctrl_frame_err = -ENODEV; +-- bus->ctrl_frame_stat = false; +-- brcmf_sdio_wait_event_wakeup(bus); +-+ sdio_claim_host(bus->sdiodev->func[1]); +-+ if (bus->ctrl_frame_stat) { +-+ bus->ctrl_frame_err = -ENODEV; +-+ bus->ctrl_frame_stat = false; +-+ brcmf_sdio_wait_event_wakeup(bus); +-+ } +-+ sdio_release_host(bus->sdiodev->func[1]); +- } +- } else if (atomic_read(&bus->intstatus) || +- atomic_read(&bus->ipend) > 0 || +-@@ -2930,15 +2936,20 @@ brcmf_sdio_bus_txctl(struct device *dev, +- brcmf_sdio_trigger_dpc(bus); +- wait_event_interruptible_timeout(bus->ctrl_wait, !bus->ctrl_frame_stat, +- msecs_to_jiffies(CTL_DONE_TIMEOUT)); +-- +-- if (!bus->ctrl_frame_stat) { +-+ ret = 0; +-+ if (bus->ctrl_frame_stat) { +-+ sdio_claim_host(bus->sdiodev->func[1]); +-+ if (bus->ctrl_frame_stat) { +-+ brcmf_dbg(SDIO, "ctrl_frame timeout\n"); +-+ bus->ctrl_frame_stat = false; +-+ ret = -ETIMEDOUT; +-+ } +-+ sdio_release_host(bus->sdiodev->func[1]); +-+ } +-+ if (!ret) { +- brcmf_dbg(SDIO, "ctrl_frame complete, err=%d\n", +- bus->ctrl_frame_err); +- ret = bus->ctrl_frame_err; +-- } else { +-- brcmf_dbg(SDIO, "ctrl_frame timeout\n"); +-- bus->ctrl_frame_stat = false; +-- ret = -ETIMEDOUT; +- } +- +- if (ret) +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 +deleted file mode 100644 +index c9eb900..0000000 +--- a/package/kernel/mac80211/patches/338-brcmfmac-Add-support-for-BCM4345-SDIO-chipset.patch ++++ /dev/null +@@ -1,86 +0,0 @@ +-From: Syed Asifful Dayyan +-Date: Fri, 6 Mar 2015 18:40:42 +0100 +-Subject: [PATCH] brcmfmac: Add support for BCM4345 SDIO chipset. +- +-These changes add support for BCM4345 SDIO chipset. +- +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Hante Meuleman +-Reviewed-by: Daniel (Deognyoun) Kim +-Signed-off-by: Syed Asifful Dayyan +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +-@@ -1096,6 +1096,7 @@ static const struct sdio_device_id brcmf +- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43341), +- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43362), +- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4335_4339), +-+ BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4345), +- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4354), +- { /* end: all zeroes */ } +- }; +---- a/drivers/net/wireless/brcm80211/brcmfmac/chip.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c +-@@ -491,6 +491,10 @@ static void brcmf_chip_get_raminfo(struc +- case BRCM_CC_43362_CHIP_ID: +- ci->pub.ramsize = 0x3c000; +- break; +-+ case BRCM_CC_4345_CHIP_ID: +-+ ci->pub.ramsize = 0xc8000; +-+ ci->pub.rambase = 0x198000; +-+ break; +- case BRCM_CC_4339_CHIP_ID: +- case BRCM_CC_4354_CHIP_ID: +- case BRCM_CC_4356_CHIP_ID: +---- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-@@ -617,6 +617,8 @@ static const struct sdiod_drive_str sdio +- #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 BCM4345_FIRMWARE_NAME "brcm/brcmfmac4345-sdio.bin" +-+#define BCM4345_NVRAM_NAME "brcm/brcmfmac4345-sdio.txt" +- #define BCM4354_FIRMWARE_NAME "brcm/brcmfmac4354-sdio.bin" +- #define BCM4354_NVRAM_NAME "brcm/brcmfmac4354-sdio.txt" +- +-@@ -640,6 +642,8 @@ MODULE_FIRMWARE(BCM43362_FIRMWARE_NAME); +- MODULE_FIRMWARE(BCM43362_NVRAM_NAME); +- MODULE_FIRMWARE(BCM4339_FIRMWARE_NAME); +- MODULE_FIRMWARE(BCM4339_NVRAM_NAME); +-+MODULE_FIRMWARE(BCM4345_FIRMWARE_NAME); +-+MODULE_FIRMWARE(BCM4345_NVRAM_NAME); +- MODULE_FIRMWARE(BCM4354_FIRMWARE_NAME); +- MODULE_FIRMWARE(BCM4354_NVRAM_NAME); +- +-@@ -669,6 +673,7 @@ static const struct brcmf_firmware_names +- { 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_4345_CHIP_ID, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4345) }, +- { BRCM_CC_4354_CHIP_ID, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4354) } +- }; +- +---- a/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h +-+++ b/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h +-@@ -37,6 +37,7 @@ +- #define BRCM_CC_43362_CHIP_ID 43362 +- #define BRCM_CC_4335_CHIP_ID 0x4335 +- #define BRCM_CC_4339_CHIP_ID 0x4339 +-+#define BRCM_CC_4345_CHIP_ID 0x4345 +- #define BRCM_CC_4354_CHIP_ID 0x4354 +- #define BRCM_CC_4356_CHIP_ID 0x4356 +- #define BRCM_CC_43566_CHIP_ID 43566 +---- a/include/linux/mmc/sdio_ids.h +-+++ b/include/linux/mmc/sdio_ids.h +-@@ -33,6 +33,7 @@ +- #define SDIO_DEVICE_ID_BROADCOM_43341 0xa94d +- #define SDIO_DEVICE_ID_BROADCOM_4335_4339 0x4335 +- #define SDIO_DEVICE_ID_BROADCOM_43362 0xa962 +-+#define SDIO_DEVICE_ID_BROADCOM_4345 0x4345 +- #define SDIO_DEVICE_ID_BROADCOM_4354 0x4354 +- +- #define SDIO_VENDOR_ID_INTEL 0x0089 +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 +deleted file mode 100644 +index 7a688c4..0000000 +--- a/package/kernel/mac80211/patches/339-brcmfmac-remove-duplication-of-ramsize-info.patch ++++ /dev/null +@@ -1,48 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 11 Mar 2015 16:11:27 +0100 +-Subject: [PATCH] brcmfmac: remove duplication of ramsize info +- +-Removing the ramsize from the brcmf_sdio structure to avoid +-duplication. The information is available in brcmf_chip +-structure. +- +-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/sdio.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-@@ -432,8 +432,6 @@ struct brcmf_sdio { +- struct brcmf_sdio_dev *sdiodev; /* sdio device handler */ +- struct brcmf_chip *ci; /* Chip info struct */ +- +-- u32 ramsize; /* Size of RAM in SOCRAM (bytes) */ +-- +- u32 hostintmask; /* Copy of Host Interrupt Mask */ +- atomic_t intstatus; /* Intstatus bits (events) pending */ +- atomic_t fcstate; /* State of dongle flow-control */ +-@@ -1075,7 +1073,7 @@ static int brcmf_sdio_readshared(struct +- struct sdpcm_shared_le sh_le; +- __le32 addr_le; +- +-- shaddr = bus->ci->rambase + bus->ramsize - 4; +-+ shaddr = bus->ci->rambase + bus->ci->ramsize - 4; +- +- /* +- * Read last word in socram to determine +-@@ -3871,13 +3869,6 @@ brcmf_sdio_probe_attach(struct brcmf_sdi +- drivestrength = DEFAULT_SDIO_DRIVE_STRENGTH; +- brcmf_sdio_drivestrengthinit(bus->sdiodev, bus->ci, drivestrength); +- +-- /* Get info on the SOCRAM cores... */ +-- bus->ramsize = bus->ci->ramsize; +-- if (!(bus->ramsize)) { +-- brcmf_err("failed to find SOCRAM memory!\n"); +-- goto fail; +-- } +-- +- /* 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 +deleted file mode 100644 +index e2a2074..0000000 +--- a/package/kernel/mac80211/patches/340-brcmfmac-always-perform-cores-checks.patch ++++ /dev/null +@@ -1,74 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 11 Mar 2015 16:11:28 +0100 +-Subject: [PATCH] brcmfmac: always perform cores checks +- +-Instead of checking the cores in the chip only if CONFIG_BRCMDBG +-is selected perform the check always and extend it with more sanity +-checking. +- +-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/chip.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c +-@@ -419,13 +419,13 @@ static struct brcmf_core *brcmf_chip_add +- return &core->pub; +- } +- +--#ifdef DEBUG +- /* safety check for chipinfo */ +- static int brcmf_chip_cores_check(struct brcmf_chip_priv *ci) +- { +- struct brcmf_core_priv *core; +- bool need_socram = false; +- bool has_socram = false; +-+ bool cpu_found = false; +- int idx = 1; +- +- list_for_each_entry(core, &ci->cores, list) { +-@@ -435,12 +435,14 @@ static int brcmf_chip_cores_check(struct +- +- switch (core->pub.id) { +- case BCMA_CORE_ARM_CM3: +-+ cpu_found = true; +- need_socram = true; +- break; +- case BCMA_CORE_INTERNAL_MEM: +- has_socram = true; +- break; +- case BCMA_CORE_ARM_CR4: +-+ cpu_found = true; +- if (ci->pub.rambase == 0) { +- brcmf_err("RAM base not provided with ARM CR4 core\n"); +- return -ENOMEM; +-@@ -451,19 +453,21 @@ static int brcmf_chip_cores_check(struct +- } +- } +- +-+ if (!cpu_found) { +-+ brcmf_err("CPU core not detected\n"); +-+ return -ENXIO; +-+ } +- /* check RAM core presence for ARM CM3 core */ +- if (need_socram && !has_socram) { +- brcmf_err("RAM core not provided with ARM CM3 core\n"); +- return -ENODEV; +- } +-+ if (!ci->pub.ramsize) { +-+ brcmf_err("RAM size is undetermined\n"); +-+ return -ENOMEM; +-+ } +- return 0; +- } +--#else /* DEBUG */ +--static inline int brcmf_chip_cores_check(struct brcmf_chip_priv *ci) +--{ +-- return 0; +--} +--#endif +- +- 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 +deleted file mode 100644 +index a272800..0000000 +--- a/package/kernel/mac80211/patches/341-brcmfmac-rename-chip-download-functions.patch ++++ /dev/null +@@ -1,240 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 11 Mar 2015 16:11:29 +0100 +-Subject: [PATCH] brcmfmac: rename chip download functions +- +-The functions brcmf_chip_[enter/exit]_download() are not exclusively +-used for firmware download so rename these more appropriate. +- +-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/chip.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c +-@@ -807,7 +807,7 @@ struct brcmf_chip *brcmf_chip_attach(voi +- err = -EINVAL; +- if (WARN_ON(!ops->prepare)) +- err = -EINVAL; +-- if (WARN_ON(!ops->exit_dl)) +-+ if (WARN_ON(!ops->activate)) +- err = -EINVAL; +- if (err < 0) +- return ERR_PTR(-EINVAL); +-@@ -905,7 +905,7 @@ void brcmf_chip_resetcore(struct brcmf_c +- } +- +- static void +--brcmf_chip_cm3_enterdl(struct brcmf_chip_priv *chip) +-+brcmf_chip_cm3_set_passive(struct brcmf_chip_priv *chip) +- { +- struct brcmf_core *core; +- +-@@ -919,7 +919,7 @@ brcmf_chip_cm3_enterdl(struct brcmf_chip +- brcmf_chip_resetcore(core, 0, 0, 0); +- } +- +--static bool brcmf_chip_cm3_exitdl(struct brcmf_chip_priv *chip) +-+static bool brcmf_chip_cm3_set_active(struct brcmf_chip_priv *chip) +- { +- struct brcmf_core *core; +- +-@@ -929,7 +929,7 @@ static bool brcmf_chip_cm3_exitdl(struct +- return false; +- } +- +-- chip->ops->exit_dl(chip->ctx, &chip->pub, 0); +-+ chip->ops->activate(chip->ctx, &chip->pub, 0); +- +- core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_ARM_CM3); +- brcmf_chip_resetcore(core, 0, 0, 0); +-@@ -938,7 +938,7 @@ static bool brcmf_chip_cm3_exitdl(struct +- } +- +- static inline void +--brcmf_chip_cr4_enterdl(struct brcmf_chip_priv *chip) +-+brcmf_chip_cr4_set_passive(struct brcmf_chip_priv *chip) +- { +- struct brcmf_core *core; +- +-@@ -951,11 +951,11 @@ brcmf_chip_cr4_enterdl(struct brcmf_chip +- D11_BCMA_IOCTL_PHYCLOCKEN); +- } +- +--static bool brcmf_chip_cr4_exitdl(struct brcmf_chip_priv *chip, u32 rstvec) +-+static bool brcmf_chip_cr4_set_active(struct brcmf_chip_priv *chip, u32 rstvec) +- { +- struct brcmf_core *core; +- +-- chip->ops->exit_dl(chip->ctx, &chip->pub, rstvec); +-+ chip->ops->activate(chip->ctx, &chip->pub, rstvec); +- +- /* restore ARM */ +- core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_ARM_CR4); +-@@ -964,7 +964,7 @@ static bool brcmf_chip_cr4_exitdl(struct +- return true; +- } +- +--void brcmf_chip_enter_download(struct brcmf_chip *pub) +-+void brcmf_chip_set_passive(struct brcmf_chip *pub) +- { +- struct brcmf_chip_priv *chip; +- struct brcmf_core *arm; +-@@ -974,14 +974,14 @@ void brcmf_chip_enter_download(struct br +- chip = container_of(pub, struct brcmf_chip_priv, pub); +- arm = brcmf_chip_get_core(pub, BCMA_CORE_ARM_CR4); +- if (arm) { +-- brcmf_chip_cr4_enterdl(chip); +-+ brcmf_chip_cr4_set_passive(chip); +- return; +- } +- +-- brcmf_chip_cm3_enterdl(chip); +-+ brcmf_chip_cm3_set_passive(chip); +- } +- +--bool brcmf_chip_exit_download(struct brcmf_chip *pub, u32 rstvec) +-+bool brcmf_chip_set_active(struct brcmf_chip *pub, u32 rstvec) +- { +- struct brcmf_chip_priv *chip; +- struct brcmf_core *arm; +-@@ -991,9 +991,9 @@ bool brcmf_chip_exit_download(struct brc +- chip = container_of(pub, struct brcmf_chip_priv, pub); +- arm = brcmf_chip_get_core(pub, BCMA_CORE_ARM_CR4); +- if (arm) +-- return brcmf_chip_cr4_exitdl(chip, rstvec); +-+ return brcmf_chip_cr4_set_active(chip, rstvec); +- +-- return brcmf_chip_cm3_exitdl(chip); +-+ return brcmf_chip_cm3_set_active(chip); +- } +- +- bool brcmf_chip_sr_capable(struct brcmf_chip *pub) +---- a/drivers/net/wireless/brcm80211/brcmfmac/chip.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.h +-@@ -64,7 +64,7 @@ struct brcmf_core { +- * @write32: write 32-bit value over bus. +- * @prepare: prepare bus for core configuration. +- * @setup: bus-specific core setup. +-- * @exit_dl: exit download state. +-+ * @active: chip becomes active. +- * The callback should use the provided @rstvec when non-zero. +- */ +- struct brcmf_buscore_ops { +-@@ -72,7 +72,7 @@ struct brcmf_buscore_ops { +- void (*write32)(void *ctx, u32 addr, u32 value); +- int (*prepare)(void *ctx); +- int (*setup)(void *ctx, struct brcmf_chip *chip); +-- void (*exit_dl)(void *ctx, struct brcmf_chip *chip, u32 rstvec); +-+ void (*activate)(void *ctx, struct brcmf_chip *chip, u32 rstvec); +- }; +- +- struct brcmf_chip *brcmf_chip_attach(void *ctx, +-@@ -84,8 +84,8 @@ bool brcmf_chip_iscoreup(struct brcmf_co +- void brcmf_chip_coredisable(struct brcmf_core *core, u32 prereset, u32 reset); +- void brcmf_chip_resetcore(struct brcmf_core *core, u32 prereset, u32 reset, +- u32 postreset); +--void brcmf_chip_enter_download(struct brcmf_chip *ci); +--bool brcmf_chip_exit_download(struct brcmf_chip *ci, u32 rstvec); +-+void brcmf_chip_set_passive(struct brcmf_chip *ci); +-+bool brcmf_chip_set_active(struct brcmf_chip *ci, u32 rstvec); +- bool brcmf_chip_sr_capable(struct brcmf_chip *pub); +- +- #endif /* BRCMF_AXIDMP_H */ +---- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-@@ -509,7 +509,7 @@ static void brcmf_pcie_attach(struct brc +- +- static int brcmf_pcie_enter_download_state(struct brcmf_pciedev_info *devinfo) +- { +-- brcmf_chip_enter_download(devinfo->ci); +-+ brcmf_chip_set_passive(devinfo->ci); +- +- if (devinfo->ci->chip == BRCM_CC_43602_CHIP_ID) { +- brcmf_pcie_select_core(devinfo, BCMA_CORE_ARM_CR4); +-@@ -536,7 +536,7 @@ static int brcmf_pcie_exit_download_stat +- brcmf_chip_resetcore(core, 0, 0, 0); +- } +- +-- return !brcmf_chip_exit_download(devinfo->ci, resetintr); +-+ return !brcmf_chip_set_active(devinfo->ci, resetintr); +- } +- +- +-@@ -1566,8 +1566,8 @@ static int brcmf_pcie_buscoreprep(void * +- } +- +- +--static void brcmf_pcie_buscore_exitdl(void *ctx, struct brcmf_chip *chip, +-- u32 rstvec) +-+static void brcmf_pcie_buscore_activate(void *ctx, struct brcmf_chip *chip, +-+ u32 rstvec) +- { +- struct brcmf_pciedev_info *devinfo = (struct brcmf_pciedev_info *)ctx; +- +-@@ -1577,7 +1577,7 @@ static void brcmf_pcie_buscore_exitdl(vo +- +- static const struct brcmf_buscore_ops brcmf_pcie_buscore_ops = { +- .prepare = brcmf_pcie_buscoreprep, +-- .exit_dl = brcmf_pcie_buscore_exitdl, +-+ .activate = brcmf_pcie_buscore_activate, +- .read32 = brcmf_pcie_buscore_read32, +- .write32 = brcmf_pcie_buscore_write32, +- }; +---- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-@@ -3357,7 +3357,7 @@ static int brcmf_sdio_download_firmware( +- brcmf_sdio_clkctl(bus, CLK_AVAIL, false); +- +- /* Keep arm in reset */ +-- brcmf_chip_enter_download(bus->ci); +-+ brcmf_chip_set_passive(bus->ci); +- +- rstvec = get_unaligned_le32(fw->data); +- brcmf_dbg(SDIO, "firmware rstvec: %x\n", rstvec); +-@@ -3378,7 +3378,7 @@ static int brcmf_sdio_download_firmware( +- } +- +- /* Take arm out of reset */ +-- if (!brcmf_chip_exit_download(bus->ci, rstvec)) { +-+ if (!brcmf_chip_set_active(bus->ci, rstvec)) { +- brcmf_err("error getting out of ARM core reset\n"); +- goto err; +- } +-@@ -3771,8 +3771,8 @@ static int brcmf_sdio_buscoreprep(void * +- return 0; +- } +- +--static void brcmf_sdio_buscore_exitdl(void *ctx, struct brcmf_chip *chip, +-- u32 rstvec) +-+static void brcmf_sdio_buscore_activate(void *ctx, struct brcmf_chip *chip, +-+ u32 rstvec) +- { +- struct brcmf_sdio_dev *sdiodev = ctx; +- struct brcmf_core *core; +-@@ -3815,7 +3815,7 @@ static void brcmf_sdio_buscore_write32(v +- +- static const struct brcmf_buscore_ops brcmf_sdio_buscore_ops = { +- .prepare = brcmf_sdio_buscoreprep, +-- .exit_dl = brcmf_sdio_buscore_exitdl, +-+ .activate = brcmf_sdio_buscore_activate, +- .read32 = brcmf_sdio_buscore_read32, +- .write32 = brcmf_sdio_buscore_write32, +- }; +-@@ -4239,12 +4239,11 @@ void brcmf_sdio_remove(struct brcmf_sdio +- sdio_claim_host(bus->sdiodev->func[1]); +- brcmf_sdio_clkctl(bus, CLK_AVAIL, false); +- /* Leave the device in state where it is +-- * 'quiet'. This is done by putting it in +-- * download_state which essentially resets +-- * all necessary cores. +-+ * 'passive'. This is done by resetting all +-+ * necessary cores. +- */ +- msleep(20); +-- brcmf_chip_enter_download(bus->ci); +-+ brcmf_chip_set_passive(bus->ci); +- 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 +deleted file mode 100644 +index 6b1dd81..0000000 +--- a/package/kernel/mac80211/patches/342-brcmfmac-assure-device-is-ready-for-download-after-b.patch ++++ /dev/null +@@ -1,61 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 11 Mar 2015 16:11:30 +0100 +-Subject: [PATCH] brcmfmac: assure device is ready for download after +- brcmf_chip_attach() +- +-Make the brcmf_chip_attach() function responsible for putting the +-device in a state where it is accessible for firmware download. +- +-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/chip.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c +-@@ -786,12 +786,6 @@ static int brcmf_chip_setup(struct brcmf +- if (chip->ops->setup) +- ret = chip->ops->setup(chip->ctx, pub); +- +-- /* +-- * Make sure any on-chip ARM is off (in case strapping is wrong), +-- * or downloaded code was already running. +-- */ +-- brcmf_chip_disable_arm(chip, BCMA_CORE_ARM_CM3); +-- brcmf_chip_disable_arm(chip, BCMA_CORE_ARM_CR4); +- return ret; +- } +- +-@@ -833,6 +827,8 @@ struct brcmf_chip *brcmf_chip_attach(voi +- if (err < 0) +- goto fail; +- +-+ /* assure chip is passive for download */ +-+ brcmf_chip_set_passive(&chip->pub); +- return &chip->pub; +- +- fail: +---- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-@@ -509,8 +509,6 @@ static void brcmf_pcie_attach(struct brc +- +- static int brcmf_pcie_enter_download_state(struct brcmf_pciedev_info *devinfo) +- { +-- brcmf_chip_set_passive(devinfo->ci); +-- +- if (devinfo->ci->chip == BRCM_CC_43602_CHIP_ID) { +- brcmf_pcie_select_core(devinfo, BCMA_CORE_ARM_CR4); +- brcmf_pcie_write_reg32(devinfo, BRCMF_PCIE_ARMCR4REG_BANKIDX, +---- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-@@ -3356,9 +3356,6 @@ static int brcmf_sdio_download_firmware( +- sdio_claim_host(bus->sdiodev->func[1]); +- brcmf_sdio_clkctl(bus, CLK_AVAIL, false); +- +-- /* Keep arm in reset */ +-- brcmf_chip_set_passive(bus->ci); +-- +- 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 +deleted file mode 100644 +index bcc2ed4..0000000 +--- a/package/kernel/mac80211/patches/343-brcmfmac-extract-ram-size-info-from-internal-memory-.patch ++++ /dev/null +@@ -1,367 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 11 Mar 2015 16:11:31 +0100 +-Subject: [PATCH] brcmfmac: extract ram size info from internal memory +- registers +- +-Instead of hard-coded memory sizes it is possible to obtain that +-information from the internal memory registers. +- +-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/chip.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c +-@@ -100,9 +100,6 @@ +- #define BCM4329_CORE_SOCRAM_BASE 0x18003000 +- /* ARM Cortex M3 core, ID 0x82a */ +- #define BCM4329_CORE_ARM_BASE 0x18002000 +--#define BCM4329_RAMSIZE 0x48000 +--/* bcm43143 */ +--#define BCM43143_RAMSIZE 0x70000 +- +- #define CORE_SB(base, field) \ +- (base + SBCONFIGOFF + offsetof(struct sbconfig, field)) +-@@ -150,6 +147,78 @@ struct sbconfig { +- u32 sbidhigh; /* identification */ +- }; +- +-+/* bankidx and bankinfo reg defines corerev >= 8 */ +-+#define SOCRAM_BANKINFO_RETNTRAM_MASK 0x00010000 +-+#define SOCRAM_BANKINFO_SZMASK 0x0000007f +-+#define SOCRAM_BANKIDX_ROM_MASK 0x00000100 +-+ +-+#define SOCRAM_BANKIDX_MEMTYPE_SHIFT 8 +-+/* socram bankinfo memtype */ +-+#define SOCRAM_MEMTYPE_RAM 0 +-+#define SOCRAM_MEMTYPE_R0M 1 +-+#define SOCRAM_MEMTYPE_DEVRAM 2 +-+ +-+#define SOCRAM_BANKINFO_SZBASE 8192 +-+#define SRCI_LSS_MASK 0x00f00000 +-+#define SRCI_LSS_SHIFT 20 +-+#define SRCI_SRNB_MASK 0xf0 +-+#define SRCI_SRNB_SHIFT 4 +-+#define SRCI_SRBSZ_MASK 0xf +-+#define SRCI_SRBSZ_SHIFT 0 +-+#define SR_BSZ_BASE 14 +-+ +-+struct sbsocramregs { +-+ u32 coreinfo; +-+ u32 bwalloc; +-+ u32 extracoreinfo; +-+ u32 biststat; +-+ u32 bankidx; +-+ u32 standbyctrl; +-+ +-+ u32 errlogstatus; /* rev 6 */ +-+ u32 errlogaddr; /* rev 6 */ +-+ /* used for patching rev 3 & 5 */ +-+ u32 cambankidx; +-+ u32 cambankstandbyctrl; +-+ u32 cambankpatchctrl; +-+ u32 cambankpatchtblbaseaddr; +-+ u32 cambankcmdreg; +-+ u32 cambankdatareg; +-+ u32 cambankmaskreg; +-+ u32 PAD[1]; +-+ u32 bankinfo; /* corev 8 */ +-+ u32 bankpda; +-+ u32 PAD[14]; +-+ u32 extmemconfig; +-+ u32 extmemparitycsr; +-+ u32 extmemparityerrdata; +-+ u32 extmemparityerrcnt; +-+ u32 extmemwrctrlandsize; +-+ u32 PAD[84]; +-+ u32 workaround; +-+ u32 pwrctl; /* corerev >= 2 */ +-+ u32 PAD[133]; +-+ u32 sr_control; /* corerev >= 15 */ +-+ u32 sr_status; /* corerev >= 15 */ +-+ u32 sr_address; /* corerev >= 15 */ +-+ u32 sr_data; /* corerev >= 15 */ +-+}; +-+ +-+#define SOCRAMREGOFFS(_f) offsetof(struct sbsocramregs, _f) +-+ +-+#define ARMCR4_CAP (0x04) +-+#define ARMCR4_BANKIDX (0x40) +-+#define ARMCR4_BANKINFO (0x44) +-+#define ARMCR4_BANKPDA (0x4C) +-+ +-+#define ARMCR4_TCBBNB_MASK 0xf0 +-+#define ARMCR4_TCBBNB_SHIFT 4 +-+#define ARMCR4_TCBANB_MASK 0xf +-+#define ARMCR4_TCBANB_SHIFT 0 +-+ +-+#define ARMCR4_BSZ_MASK 0x3f +-+#define ARMCR4_BSZ_MULT 8192 +-+ +- struct brcmf_core_priv { +- struct brcmf_core pub; +- u32 wrapbase; +-@@ -443,10 +512,6 @@ static int brcmf_chip_cores_check(struct +- break; +- case BCMA_CORE_ARM_CR4: +- cpu_found = true; +-- if (ci->pub.rambase == 0) { +-- brcmf_err("RAM base not provided with ARM CR4 core\n"); +-- return -ENOMEM; +-- } +- break; +- default: +- break; +-@@ -462,60 +527,160 @@ static int brcmf_chip_cores_check(struct +- brcmf_err("RAM core not provided with ARM CM3 core\n"); +- return -ENODEV; +- } +-- if (!ci->pub.ramsize) { +-- brcmf_err("RAM size is undetermined\n"); +-- return -ENOMEM; +-- } +- return 0; +- } +- +--static void brcmf_chip_get_raminfo(struct brcmf_chip_priv *ci) +-+static u32 brcmf_chip_core_read32(struct brcmf_core_priv *core, u16 reg) +- { +-- switch (ci->pub.chip) { +-- case BRCM_CC_4329_CHIP_ID: +-- ci->pub.ramsize = BCM4329_RAMSIZE; +-- break; +-- case BRCM_CC_43143_CHIP_ID: +-- ci->pub.ramsize = BCM43143_RAMSIZE; +-- break; +-- case BRCM_CC_43241_CHIP_ID: +-- ci->pub.ramsize = 0x90000; +-- break; +-- case BRCM_CC_4330_CHIP_ID: +-- ci->pub.ramsize = 0x48000; +-- break; +-+ return core->chip->ops->read32(core->chip->ctx, core->pub.base + reg); +-+} +-+ +-+static void brcmf_chip_core_write32(struct brcmf_core_priv *core, +-+ u16 reg, u32 val) +-+{ +-+ core->chip->ops->write32(core->chip->ctx, core->pub.base + reg, val); +-+} +-+ +-+static bool brcmf_chip_socram_banksize(struct brcmf_core_priv *core, u8 idx, +-+ u32 *banksize) +-+{ +-+ u32 bankinfo; +-+ u32 bankidx = (SOCRAM_MEMTYPE_RAM << SOCRAM_BANKIDX_MEMTYPE_SHIFT); +-+ +-+ bankidx |= idx; +-+ brcmf_chip_core_write32(core, SOCRAMREGOFFS(bankidx), bankidx); +-+ bankinfo = brcmf_chip_core_read32(core, SOCRAMREGOFFS(bankinfo)); +-+ *banksize = (bankinfo & SOCRAM_BANKINFO_SZMASK) + 1; +-+ *banksize *= SOCRAM_BANKINFO_SZBASE; +-+ return !!(bankinfo & SOCRAM_BANKINFO_RETNTRAM_MASK); +-+} +-+ +-+static void brcmf_chip_socram_ramsize(struct brcmf_core_priv *sr, u32 *ramsize, +-+ u32 *srsize) +-+{ +-+ u32 coreinfo; +-+ uint nb, banksize, lss; +-+ bool retent; +-+ int i; +-+ +-+ *ramsize = 0; +-+ *srsize = 0; +-+ +-+ if (WARN_ON(sr->pub.rev < 4)) +-+ return; +-+ +-+ if (!brcmf_chip_iscoreup(&sr->pub)) +-+ brcmf_chip_resetcore(&sr->pub, 0, 0, 0); +-+ +-+ /* Get info for determining size */ +-+ coreinfo = brcmf_chip_core_read32(sr, SOCRAMREGOFFS(coreinfo)); +-+ nb = (coreinfo & SRCI_SRNB_MASK) >> SRCI_SRNB_SHIFT; +-+ +-+ if ((sr->pub.rev <= 7) || (sr->pub.rev == 12)) { +-+ banksize = (coreinfo & SRCI_SRBSZ_MASK); +-+ lss = (coreinfo & SRCI_LSS_MASK) >> SRCI_LSS_SHIFT; +-+ if (lss != 0) +-+ nb--; +-+ *ramsize = nb * (1 << (banksize + SR_BSZ_BASE)); +-+ if (lss != 0) +-+ *ramsize += (1 << ((lss - 1) + SR_BSZ_BASE)); +-+ } else { +-+ nb = (coreinfo & SRCI_SRNB_MASK) >> SRCI_SRNB_SHIFT; +-+ for (i = 0; i < nb; i++) { +-+ retent = brcmf_chip_socram_banksize(sr, i, &banksize); +-+ *ramsize += banksize; +-+ if (retent) +-+ *srsize += banksize; +-+ } +-+ } +-+ +-+ /* hardcoded save&restore memory sizes */ +-+ switch (sr->chip->pub.chip) { +- case BRCM_CC_4334_CHIP_ID: +-- case BRCM_CC_43340_CHIP_ID: +-- ci->pub.ramsize = 0x80000; +-+ if (sr->chip->pub.chiprev < 2) +-+ *srsize = (32 * 1024); +- break; +-- case BRCM_CC_4335_CHIP_ID: +-- ci->pub.ramsize = 0xc0000; +-- ci->pub.rambase = 0x180000; +-- break; +-- case BRCM_CC_43362_CHIP_ID: +-- ci->pub.ramsize = 0x3c000; +-+ default: +- break; +-+ } +-+} +-+ +-+/** Return the TCM-RAM size of the ARMCR4 core. */ +-+static u32 brcmf_chip_tcm_ramsize(struct brcmf_core_priv *cr4) +-+{ +-+ u32 corecap; +-+ u32 memsize = 0; +-+ u32 nab; +-+ u32 nbb; +-+ u32 totb; +-+ u32 bxinfo; +-+ u32 idx; +-+ +-+ corecap = brcmf_chip_core_read32(cr4, ARMCR4_CAP); +-+ +-+ nab = (corecap & ARMCR4_TCBANB_MASK) >> ARMCR4_TCBANB_SHIFT; +-+ nbb = (corecap & ARMCR4_TCBBNB_MASK) >> ARMCR4_TCBBNB_SHIFT; +-+ totb = nab + nbb; +-+ +-+ for (idx = 0; idx < totb; idx++) { +-+ brcmf_chip_core_write32(cr4, ARMCR4_BANKIDX, idx); +-+ bxinfo = brcmf_chip_core_read32(cr4, ARMCR4_BANKINFO); +-+ memsize += ((bxinfo & ARMCR4_BSZ_MASK) + 1) * ARMCR4_BSZ_MULT; +-+ } +-+ +-+ return memsize; +-+} +-+ +-+static u32 brcmf_chip_tcm_rambase(struct brcmf_chip_priv *ci) +-+{ +-+ switch (ci->pub.chip) { +- case BRCM_CC_4345_CHIP_ID: +-- ci->pub.ramsize = 0xc8000; +-- ci->pub.rambase = 0x198000; +-- break; +-+ return 0x198000; +-+ case BRCM_CC_4335_CHIP_ID: +- case BRCM_CC_4339_CHIP_ID: +- case BRCM_CC_4354_CHIP_ID: +- case BRCM_CC_4356_CHIP_ID: +- case BRCM_CC_43567_CHIP_ID: +- case BRCM_CC_43569_CHIP_ID: +- case BRCM_CC_43570_CHIP_ID: +-- ci->pub.ramsize = 0xc0000; +-- ci->pub.rambase = 0x180000; +-- break; +- case BRCM_CC_43602_CHIP_ID: +-- ci->pub.ramsize = 0xf0000; +-- ci->pub.rambase = 0x180000; +-- break; +-+ return 0x180000; +- default: +- brcmf_err("unknown chip: %s\n", ci->pub.name); +- break; +- } +-+ return 0; +-+} +-+ +-+static int brcmf_chip_get_raminfo(struct brcmf_chip_priv *ci) +-+{ +-+ struct brcmf_core_priv *mem_core; +-+ struct brcmf_core *mem; +-+ +-+ mem = brcmf_chip_get_core(&ci->pub, BCMA_CORE_ARM_CR4); +-+ if (mem) { +-+ mem_core = container_of(mem, struct brcmf_core_priv, pub); +-+ ci->pub.ramsize = brcmf_chip_tcm_ramsize(mem_core); +-+ ci->pub.rambase = brcmf_chip_tcm_rambase(ci); +-+ if (!ci->pub.rambase) { +-+ brcmf_err("RAM base not provided with ARM CR4 core\n"); +-+ 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); +-+ } +-+ 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, +-+ ci->pub.srsize, ci->pub.srsize); +-+ +-+ if (!ci->pub.ramsize) { +-+ brcmf_err("RAM size is undetermined\n"); +-+ return -ENOMEM; +-+ } +-+ return 0; +- } +- +- static u32 brcmf_chip_dmp_get_desc(struct brcmf_chip_priv *ci, u32 *eromaddr, +-@@ -668,6 +833,7 @@ static int brcmf_chip_recognition(struct +- struct brcmf_core *core; +- u32 regdata; +- u32 socitype; +-+ int ret; +- +- /* Get CC core rev +- * Chipid is assume to be at offset 0 from SI_ENUM_BASE +-@@ -720,9 +886,13 @@ static int brcmf_chip_recognition(struct +- return -ENODEV; +- } +- +-- brcmf_chip_get_raminfo(ci); +-- +-- return brcmf_chip_cores_check(ci); +-+ ret = brcmf_chip_cores_check(ci); +-+ if (ret) +-+ return ret; +-+ +-+ /* assure chip is passive for core access */ +-+ brcmf_chip_set_passive(&ci->pub); +-+ return brcmf_chip_get_raminfo(ci); +- } +- +- static void brcmf_chip_disable_arm(struct brcmf_chip_priv *chip, u16 id) +-@@ -827,8 +997,6 @@ struct brcmf_chip *brcmf_chip_attach(voi +- if (err < 0) +- goto fail; +- +-- /* assure chip is passive for download */ +-- brcmf_chip_set_passive(&chip->pub); +- return &chip->pub; +- +- fail: +---- a/drivers/net/wireless/brcm80211/brcmfmac/chip.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.h +-@@ -30,7 +30,8 @@ +- * @pmucaps: PMU capabilities. +- * @pmurev: PMU revision. +- * @rambase: RAM base address (only applicable for ARM CR4 chips). +-- * @ramsize: amount of RAM on chip. +-+ * @ramsize: amount of RAM on chip including retention. +-+ * @srsize: amount of retention RAM on chip. +- * @name: string representation of the chip identifier. +- */ +- struct brcmf_chip { +-@@ -41,6 +42,7 @@ struct brcmf_chip { +- u32 pmurev; +- u32 rambase; +- u32 ramsize; +-+ u32 srsize; +- 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 +deleted file mode 100644 +index 69618a7..0000000 +--- a/package/kernel/mac80211/patches/344-brcmfmac-take-save-restore-memory-into-account-for-S.patch ++++ /dev/null +@@ -1,96 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 11 Mar 2015 16:11:32 +0100 +-Subject: [PATCH] brcmfmac: take save&restore memory into account for SDIO +- shared info +- +-The firmware provides pointer to SDIO shared information at end of +-RAM during firmware initialization. End of RAM is obviously determined +-by the actual ram size, but part of that may be used for save&restore +-memory. In that case another location in RAM will hold the pointer. +- +-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/sdio.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-@@ -1067,44 +1067,47 @@ static inline bool brcmf_sdio_valid_shar +- static int brcmf_sdio_readshared(struct brcmf_sdio *bus, +- struct sdpcm_shared *sh) +- { +-- u32 addr; +-+ u32 addr = 0; +- int rv; +- u32 shaddr = 0; +- struct sdpcm_shared_le sh_le; +- __le32 addr_le; +- +-- shaddr = bus->ci->rambase + bus->ci->ramsize - 4; +-+ sdio_claim_host(bus->sdiodev->func[1]); +-+ brcmf_sdio_bus_sleep(bus, false, false); +- +- /* +- * Read last word in socram to determine +- * address of sdpcm_shared structure +- */ +-- sdio_claim_host(bus->sdiodev->func[1]); +-- brcmf_sdio_bus_sleep(bus, false, false); +-- rv = brcmf_sdiod_ramrw(bus->sdiodev, false, shaddr, (u8 *)&addr_le, 4); +-- sdio_release_host(bus->sdiodev->func[1]); +-+ shaddr = bus->ci->rambase + bus->ci->ramsize - 4; +-+ if (!bus->ci->rambase && brcmf_chip_sr_capable(bus->ci)) +-+ shaddr -= bus->ci->srsize; +-+ rv = brcmf_sdiod_ramrw(bus->sdiodev, false, shaddr, +-+ (u8 *)&addr_le, 4); +- if (rv < 0) +-- return rv; +-- +-- addr = le32_to_cpu(addr_le); +-- +-- brcmf_dbg(SDIO, "sdpcm_shared address 0x%08X\n", addr); +-+ goto fail; +- +- /* +- * Check if addr is valid. +- * NVRAM length at the end of memory should have been overwritten. +- */ +-+ addr = le32_to_cpu(addr_le); +- if (!brcmf_sdio_valid_shared_address(addr)) { +-- brcmf_err("invalid sdpcm_shared address 0x%08X\n", +-- addr); +-- return -EINVAL; +-+ brcmf_err("invalid sdpcm_shared address 0x%08X\n", addr); +-+ rv = -EINVAL; +-+ goto fail; +- } +- +-+ brcmf_dbg(INFO, "sdpcm_shared address 0x%08X\n", addr); +-+ +- /* Read hndrte_shared structure */ +- rv = brcmf_sdiod_ramrw(bus->sdiodev, false, addr, (u8 *)&sh_le, +- sizeof(struct sdpcm_shared_le)); +- if (rv < 0) +-- return rv; +-+ goto fail; +-+ +-+ sdio_release_host(bus->sdiodev->func[1]); +- +- /* Endianness */ +- sh->flags = le32_to_cpu(sh_le.flags); +-@@ -1121,8 +1124,13 @@ static int brcmf_sdio_readshared(struct +- sh->flags & SDPCM_SHARED_VERSION_MASK); +- return -EPROTO; +- } +-- +- return 0; +-+ +-+fail: +-+ brcmf_err("unable to obtain sdpcm_shared info: rv=%d (addr=0x%x)\n", +-+ rv, addr); +-+ sdio_release_host(bus->sdiodev->func[1]); +-+ return rv; +- } +- +- 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 +deleted file mode 100644 +index 1b10dbb..0000000 +--- a/package/kernel/mac80211/patches/345-brcmfmac-fix-watchdog-timer-regression.patch ++++ /dev/null +@@ -1,59 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 11 Mar 2015 16:11:33 +0100 +-Subject: [PATCH] brcmfmac: fix watchdog timer regression +- +-The watchdog timer is used to put the device in a low-power mode when +-it is idle for some time. This timer is stopped during that mode and +-should be restarted upon activity. This has been broken by commit +-d4150fced0365 ("brcmfmac: Simplify watchdog sleep."). This patch +-restores the behaviour as it was before that commit. +- +-Reported-by: Pontus Fuchs +-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/sdio.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-@@ -972,7 +972,6 @@ static int brcmf_sdio_clkctl(struct brcm +- brcmf_sdio_sdclk(bus, true); +- /* Now request HT Avail on the backplane */ +- brcmf_sdio_htclk(bus, true, pendok); +-- brcmf_sdio_wd_timer(bus, BRCMF_WD_POLL_MS); +- break; +- +- case CLK_SDONLY: +-@@ -984,7 +983,6 @@ static int brcmf_sdio_clkctl(struct brcm +- else +- brcmf_err("request for %d -> %d\n", +- bus->clkstate, target); +-- brcmf_sdio_wd_timer(bus, BRCMF_WD_POLL_MS); +- break; +- +- case CLK_NONE: +-@@ -993,7 +991,6 @@ static int brcmf_sdio_clkctl(struct brcm +- brcmf_sdio_htclk(bus, false, false); +- /* Now remove the SD clock */ +- brcmf_sdio_sdclk(bus, false); +-- brcmf_sdio_wd_timer(bus, 0); +- break; +- } +- #ifdef DEBUG +-@@ -1048,6 +1045,7 @@ end: +- brcmf_sdio_clkctl(bus, CLK_NONE, pendok); +- } else { +- brcmf_sdio_clkctl(bus, CLK_AVAIL, pendok); +-+ brcmf_sdio_wd_timer(bus, BRCMF_WD_POLL_MS); +- } +- bus->sleeping = sleep; +- brcmf_dbg(SDIO, "new state %s\n", +-@@ -4242,6 +4240,7 @@ void brcmf_sdio_remove(struct brcmf_sdio +- if (bus->ci) { +- if (bus->sdiodev->state != BRCMF_SDIOD_NOMEDIUM) { +- sdio_claim_host(bus->sdiodev->func[1]); +-+ brcmf_sdio_wd_timer(bus, 0); +- 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 +deleted file mode 100644 +index af76f13..0000000 +--- a/package/kernel/mac80211/patches/346-brcmfmac-avoid-runtime-pm-for-sdio-host-controller.patch ++++ /dev/null +@@ -1,44 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 18 Mar 2015 13:25:21 +0100 +-Subject: [PATCH] brcmfmac: avoid runtime-pm for sdio host controller +- +-Several host controllers supporting runtime-pm are causing issues +-with our sdio wireless cards because they disable the sdio interrupt +-upon going into runtime suspend. This patch avoids that by doing +-a pm_runtime_forbid() call during the probe. Tested with Sony Vaio +-Duo 13 which uses sdhci-acpi host controller. +- +-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/bcmsdh.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +-@@ -29,6 +29,7 @@ +- #include +- #include +- #include +-+#include +- #include +- #include +- #include +-@@ -1006,6 +1007,7 @@ static int brcmf_sdiod_remove(struct brc +- sg_free_table(&sdiodev->sgtable); +- sdiodev->sbwad = 0; +- +-+ pm_runtime_allow(sdiodev->func[1]->card->host->parent); +- return 0; +- } +- +-@@ -1074,7 +1076,7 @@ static int brcmf_sdiod_probe(struct brcm +- ret = -ENODEV; +- goto out; +- } +-- +-+ pm_runtime_forbid(host->parent); +- 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 +deleted file mode 100644 +index c419cc6..0000000 +--- a/package/kernel/mac80211/patches/347-brcmfmac-Add-necessary-memory-barriers-for-SDIO.patch ++++ /dev/null +@@ -1,171 +0,0 @@ +-From: Hante Meuleman +-Date: Wed, 18 Mar 2015 13:25:22 +0100 +-Subject: [PATCH] brcmfmac: Add necessary memory barriers for SDIO. +- +-SDIO uses a thread to handle all communication with the device, +-for this data is exchanged between threads. This data needs proper +-memory barriers to make sure that data "exchange" is going correct. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Daniel (Deognyoun) Kim +-Signed-off-by: Hante Meuleman +-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 +-@@ -507,8 +507,8 @@ struct brcmf_sdio { +- +- struct workqueue_struct *brcmf_wq; +- struct work_struct datawork; +-- atomic_t dpc_tskcnt; +-- atomic_t dpc_running; +-+ bool dpc_triggered; +-+ bool dpc_running; +- +- bool txoff; /* Transmit flow-controlled */ +- struct brcmf_sdio_count sdcnt; +-@@ -2713,6 +2713,7 @@ static void brcmf_sdio_dpc(struct brcmf_ +- err = brcmf_sdio_tx_ctrlframe(bus, bus->ctrl_frame_buf, +- bus->ctrl_frame_len); +- bus->ctrl_frame_err = err; +-+ wmb(); +- bus->ctrl_frame_stat = false; +- } +- sdio_release_host(bus->sdiodev->func[1]); +-@@ -2734,6 +2735,7 @@ static void brcmf_sdio_dpc(struct brcmf_ +- sdio_claim_host(bus->sdiodev->func[1]); +- if (bus->ctrl_frame_stat) { +- bus->ctrl_frame_err = -ENODEV; +-+ wmb(); +- bus->ctrl_frame_stat = false; +- brcmf_sdio_wait_event_wakeup(bus); +- } +-@@ -2744,7 +2746,7 @@ static void brcmf_sdio_dpc(struct brcmf_ +- (!atomic_read(&bus->fcstate) && +- brcmu_pktq_mlen(&bus->txq, ~bus->flowcontrol) && +- data_ok(bus))) { +-- atomic_inc(&bus->dpc_tskcnt); +-+ bus->dpc_triggered = true; +- } +- } +- +-@@ -2940,6 +2942,7 @@ brcmf_sdio_bus_txctl(struct device *dev, +- /* Send from dpc */ +- bus->ctrl_frame_buf = msg; +- bus->ctrl_frame_len = msglen; +-+ wmb(); +- bus->ctrl_frame_stat = true; +- +- brcmf_sdio_trigger_dpc(bus); +-@@ -2958,6 +2961,7 @@ brcmf_sdio_bus_txctl(struct device *dev, +- if (!ret) { +- brcmf_dbg(SDIO, "ctrl_frame complete, err=%d\n", +- bus->ctrl_frame_err); +-+ rmb(); +- ret = bus->ctrl_frame_err; +- } +- +-@@ -3526,8 +3530,8 @@ done: +- +- void brcmf_sdio_trigger_dpc(struct brcmf_sdio *bus) +- { +-- if (atomic_read(&bus->dpc_tskcnt) == 0) { +-- atomic_inc(&bus->dpc_tskcnt); +-+ if (!bus->dpc_triggered) { +-+ bus->dpc_triggered = true; +- queue_work(bus->brcmf_wq, &bus->datawork); +- } +- } +-@@ -3558,7 +3562,7 @@ void brcmf_sdio_isr(struct brcmf_sdio *b +- if (!bus->intr) +- brcmf_err("isr w/o interrupt configured!\n"); +- +-- atomic_inc(&bus->dpc_tskcnt); +-+ bus->dpc_triggered = true; +- queue_work(bus->brcmf_wq, &bus->datawork); +- } +- +-@@ -3578,7 +3582,7 @@ static void brcmf_sdio_bus_watchdog(stru +- if (!bus->intr || +- (bus->sdcnt.intrcount == bus->sdcnt.lastintrs)) { +- +-- if (atomic_read(&bus->dpc_tskcnt) == 0) { +-+ if (!bus->dpc_triggered) { +- u8 devpend; +- +- sdio_claim_host(bus->sdiodev->func[1]); +-@@ -3596,7 +3600,7 @@ static void brcmf_sdio_bus_watchdog(stru +- bus->sdcnt.pollcnt++; +- atomic_set(&bus->ipend, 1); +- +-- atomic_inc(&bus->dpc_tskcnt); +-+ bus->dpc_triggered = true; +- queue_work(bus->brcmf_wq, &bus->datawork); +- } +- } +-@@ -3623,17 +3627,21 @@ static void brcmf_sdio_bus_watchdog(stru +- #endif /* DEBUG */ +- +- /* On idle timeout clear activity flag and/or turn off clock */ +-- if ((atomic_read(&bus->dpc_tskcnt) == 0) && +-- (atomic_read(&bus->dpc_running) == 0) && +-- (bus->idletime > 0) && (bus->clkstate == CLK_AVAIL)) { +-- bus->idlecount++; +-- if (bus->idlecount > bus->idletime) { +-- brcmf_dbg(SDIO, "idle\n"); +-- sdio_claim_host(bus->sdiodev->func[1]); +-- brcmf_sdio_wd_timer(bus, 0); +-+ if (!bus->dpc_triggered) { +-+ rmb(); +-+ if ((!bus->dpc_running) && (bus->idletime > 0) && +-+ (bus->clkstate == CLK_AVAIL)) { +-+ bus->idlecount++; +-+ if (bus->idlecount > bus->idletime) { +-+ brcmf_dbg(SDIO, "idle\n"); +-+ sdio_claim_host(bus->sdiodev->func[1]); +-+ brcmf_sdio_wd_timer(bus, 0); +-+ bus->idlecount = 0; +-+ brcmf_sdio_bus_sleep(bus, true, false); +-+ sdio_release_host(bus->sdiodev->func[1]); +-+ } +-+ } else { +- bus->idlecount = 0; +-- brcmf_sdio_bus_sleep(bus, true, false); +-- sdio_release_host(bus->sdiodev->func[1]); +- } +- } else { +- bus->idlecount = 0; +-@@ -3645,13 +3653,14 @@ static void brcmf_sdio_dataworker(struct +- struct brcmf_sdio *bus = container_of(work, struct brcmf_sdio, +- datawork); +- +-- while (atomic_read(&bus->dpc_tskcnt)) { +-- atomic_set(&bus->dpc_running, 1); +-- atomic_set(&bus->dpc_tskcnt, 0); +-+ bus->dpc_running = true; +-+ wmb(); +-+ while (ACCESS_ONCE(bus->dpc_triggered)) { +-+ bus->dpc_triggered = false; +- brcmf_sdio_dpc(bus); +- bus->idlecount = 0; +-- atomic_set(&bus->dpc_running, 0); +- } +-+ bus->dpc_running = false; +- if (brcmf_sdiod_freezing(bus->sdiodev)) { +- brcmf_sdiod_change_state(bus->sdiodev, BRCMF_SDIOD_DOWN); +- brcmf_sdiod_try_freeze(bus->sdiodev); +-@@ -4144,8 +4153,8 @@ struct brcmf_sdio *brcmf_sdio_probe(stru +- bus->watchdog_tsk = NULL; +- } +- /* Initialize DPC thread */ +-- atomic_set(&bus->dpc_tskcnt, 0); +-- atomic_set(&bus->dpc_running, 0); +-+ bus->dpc_triggered = false; +-+ bus->dpc_running = false; +- +- /* 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 +deleted file mode 100644 +index 1bc98a0..0000000 +--- a/package/kernel/mac80211/patches/348-brcmfmac-Remove-unnecessary-new-line-in-pcie-console.patch ++++ /dev/null +@@ -1,26 +0,0 @@ +-From: Hante Meuleman +-Date: Wed, 18 Mar 2015 13:25:24 +0100 +-Subject: [PATCH] brcmfmac: Remove unnecessary new-line in pcie console +- logging. +- +-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/pcie.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-@@ -651,10 +651,9 @@ static void brcmf_pcie_bus_console_read( +- console->log_str[console->log_idx] = ch; +- console->log_idx++; +- } +-- +- if (ch == '\n') { +- console->log_str[console->log_idx] = 0; +-- brcmf_dbg(PCIE, "CONSOLE: %s\n", console->log_str); +-+ brcmf_dbg(PCIE, "CONSOLE: %s", console->log_str); +- 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 +deleted file mode 100644 +index fcf0bf3..0000000 +--- a/package/kernel/mac80211/patches/349-brcmfmac-add-MODULE_FIRMWARE-macros-for-bcm4356-PCIe.patch ++++ /dev/null +@@ -1,26 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 18 Mar 2015 13:25:25 +0100 +-Subject: [PATCH] brcmfmac: add MODULE_FIRMWARE() macros for bcm4356 PCIe +- device +- +-The BCM4356 PCIe wireless device was added recently but overlooked +-the fact that the MODULE_FIRMWARE() macros were missing for the +-firmwares needed by this device. +- +-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/pcie.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-@@ -189,6 +189,8 @@ MODULE_FIRMWARE(BRCMF_PCIE_43602_FW_NAME +- MODULE_FIRMWARE(BRCMF_PCIE_43602_NVRAM_NAME); +- MODULE_FIRMWARE(BRCMF_PCIE_4354_FW_NAME); +- MODULE_FIRMWARE(BRCMF_PCIE_4354_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); +- +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 +deleted file mode 100644 +index b3e9bc9..0000000 +--- a/package/kernel/mac80211/patches/350-brcmfmac-add-support-for-BCM43430-SDIO-chipset.patch ++++ /dev/null +@@ -1,138 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 18 Mar 2015 13:25:26 +0100 +-Subject: [PATCH] brcmfmac: add support for BCM43430 SDIO chipset +- +-This patch added support for the BCM43430 802.11n SDIO chipset. +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Daniel (Deognyoun) Kim +-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/bcmsdh.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +-@@ -1098,6 +1098,7 @@ static const struct sdio_device_id brcmf +- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43341), +- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43362), +- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4335_4339), +-+ BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43430), +- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4345), +- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4354), +- { /* end: all zeroes */ } +---- a/drivers/net/wireless/brcm80211/brcmfmac/chip.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c +-@@ -600,6 +600,12 @@ static void brcmf_chip_socram_ramsize(st +- if (sr->chip->pub.chiprev < 2) +- *srsize = (32 * 1024); +- break; +-+ case BRCM_CC_43430_CHIP_ID: +-+ /* assume sr for now as we can not check +-+ * firmware sr capability at this point. +-+ */ +-+ *srsize = (64 * 1024); +-+ break; +- default: +- break; +- } +-@@ -1072,6 +1078,7 @@ static void +- brcmf_chip_cm3_set_passive(struct brcmf_chip_priv *chip) +- { +- struct brcmf_core *core; +-+ struct brcmf_core_priv *sr; +- +- brcmf_chip_disable_arm(chip, BCMA_CORE_ARM_CM3); +- core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_80211); +-@@ -1081,6 +1088,13 @@ brcmf_chip_cm3_set_passive(struct brcmf_ +- D11_BCMA_IOCTL_PHYCLOCKEN); +- core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_INTERNAL_MEM); +- brcmf_chip_resetcore(core, 0, 0, 0); +-+ +-+ /* disable bank #3 remap for this device */ +-+ if (chip->pub.chip == BRCM_CC_43430_CHIP_ID) { +-+ sr = container_of(core, struct brcmf_core_priv, pub); +-+ brcmf_chip_core_write32(sr, SOCRAMREGOFFS(bankidx), 3); +-+ brcmf_chip_core_write32(sr, SOCRAMREGOFFS(bankpda), 0); +-+ } +- } +- +- static bool brcmf_chip_cm3_set_active(struct brcmf_chip_priv *chip) +-@@ -1188,6 +1202,10 @@ bool brcmf_chip_sr_capable(struct brcmf_ +- addr = CORE_CC_REG(base, chipcontrol_data); +- reg = chip->ops->read32(chip->ctx, addr); +- return (reg & pmu_cc3_mask) != 0; +-+ case BRCM_CC_43430_CHIP_ID: +-+ addr = CORE_CC_REG(base, sr_control1); +-+ reg = chip->ops->read32(chip->ctx, addr); +-+ return reg != 0; +- default: +- addr = CORE_CC_REG(base, pmucapabilities_ext); +- reg = chip->ops->read32(chip->ctx, addr); +---- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-@@ -615,6 +615,8 @@ static const struct sdiod_drive_str sdio +- #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 BCM4345_FIRMWARE_NAME "brcm/brcmfmac4345-sdio.bin" +- #define BCM4345_NVRAM_NAME "brcm/brcmfmac4345-sdio.txt" +- #define BCM4354_FIRMWARE_NAME "brcm/brcmfmac4354-sdio.bin" +-@@ -640,6 +642,8 @@ 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(BCM4345_FIRMWARE_NAME); +- MODULE_FIRMWARE(BCM4345_NVRAM_NAME); +- MODULE_FIRMWARE(BCM4354_FIRMWARE_NAME); +-@@ -671,6 +675,7 @@ static const struct brcmf_firmware_names +- { 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, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4345) }, +- { BRCM_CC_4354_CHIP_ID, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4354) } +- }; +---- a/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h +-+++ b/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h +-@@ -37,6 +37,7 @@ +- #define BRCM_CC_43362_CHIP_ID 43362 +- #define BRCM_CC_4335_CHIP_ID 0x4335 +- #define BRCM_CC_4339_CHIP_ID 0x4339 +-+#define BRCM_CC_43430_CHIP_ID 43430 +- #define BRCM_CC_4345_CHIP_ID 0x4345 +- #define BRCM_CC_4354_CHIP_ID 0x4354 +- #define BRCM_CC_4356_CHIP_ID 0x4356 +---- a/drivers/net/wireless/brcm80211/include/chipcommon.h +-+++ b/drivers/net/wireless/brcm80211/include/chipcommon.h +-@@ -183,7 +183,14 @@ struct chipcregs { +- u8 uart1lsr; +- u8 uart1msr; +- u8 uart1scratch; +-- u32 PAD[126]; +-+ u32 PAD[62]; +-+ +-+ /* save/restore, corerev >= 48 */ +-+ u32 sr_capability; /* 0x500 */ +-+ u32 sr_control0; /* 0x504 */ +-+ u32 sr_control1; /* 0x508 */ +-+ u32 gpio_control; /* 0x50C */ +-+ u32 PAD[60]; +- +- /* PMU registers (corerev >= 20) */ +- u32 pmucontrol; /* 0x600 */ +---- a/include/linux/mmc/sdio_ids.h +-+++ b/include/linux/mmc/sdio_ids.h +-@@ -33,6 +33,7 @@ +- #define SDIO_DEVICE_ID_BROADCOM_43341 0xa94d +- #define SDIO_DEVICE_ID_BROADCOM_4335_4339 0x4335 +- #define SDIO_DEVICE_ID_BROADCOM_43362 0xa962 +-+#define SDIO_DEVICE_ID_BROADCOM_43430 0xa9a6 +- #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 +deleted file mode 100644 +index c3d7bc2..0000000 +--- a/package/kernel/mac80211/patches/351-brcmfmac-only-support-the-BCM43455-7-device.patch ++++ /dev/null +@@ -1,50 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 18 Mar 2015 13:25:27 +0100 +-Subject: [PATCH] brcmfmac: only support the BCM43455/7 device +- +-Recently support was added for the BCM4345 SDIO chipset by +-commit 9c51026509d7 ("brcmfmac: Add support for BCM4345 SDIO chipset") +-however this was verified using a BCM43455 device, which is +-a more recent revision of the chip. This patch assure that +-older revisions are not probed as they would fail. +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Syed Asifful Dayyan +-Reviewed-by: Pieter-Paul Giesberts +-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 +-@@ -617,8 +617,8 @@ static const struct sdiod_drive_str sdio +- #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 BCM4345_FIRMWARE_NAME "brcm/brcmfmac4345-sdio.bin" +--#define BCM4345_NVRAM_NAME "brcm/brcmfmac4345-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" +- +-@@ -644,8 +644,8 @@ MODULE_FIRMWARE(BCM4339_FIRMWARE_NAME); +- MODULE_FIRMWARE(BCM4339_NVRAM_NAME); +- MODULE_FIRMWARE(BCM43430_FIRMWARE_NAME); +- MODULE_FIRMWARE(BCM43430_NVRAM_NAME); +--MODULE_FIRMWARE(BCM4345_FIRMWARE_NAME); +--MODULE_FIRMWARE(BCM4345_NVRAM_NAME); +-+MODULE_FIRMWARE(BCM43455_FIRMWARE_NAME); +-+MODULE_FIRMWARE(BCM43455_NVRAM_NAME); +- MODULE_FIRMWARE(BCM4354_FIRMWARE_NAME); +- MODULE_FIRMWARE(BCM4354_NVRAM_NAME); +- +-@@ -676,7 +676,7 @@ static const struct brcmf_firmware_names +- { 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, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4345) }, +-+ { BRCM_CC_4345_CHIP_ID, 0xFFFFFFC0, BRCMF_FIRMWARE_NVRAM(BCM43455) }, +- { 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 +deleted file mode 100644 +index a62cfdf..0000000 +--- a/package/kernel/mac80211/patches/352-brcmfmac-remove-support-for-unreleased-BCM4354-PCIe.patch ++++ /dev/null +@@ -1,52 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 18 Mar 2015 13:25:28 +0100 +-Subject: [PATCH] brcmfmac: remove support for unreleased BCM4354 PCIe +- +-There are no known BCM4354 PCIe devices released so removing +-support from the driver until proven otherwise. +- +-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/pcie.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-@@ -47,8 +47,6 @@ 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_4354_FW_NAME "brcm/brcmfmac4354-pcie.bin" +--#define BRCMF_PCIE_4354_NVRAM_NAME "brcm/brcmfmac4354-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" +-@@ -187,8 +185,6 @@ enum brcmf_pcie_state { +- +- MODULE_FIRMWARE(BRCMF_PCIE_43602_FW_NAME); +- MODULE_FIRMWARE(BRCMF_PCIE_43602_NVRAM_NAME); +--MODULE_FIRMWARE(BRCMF_PCIE_4354_FW_NAME); +--MODULE_FIRMWARE(BRCMF_PCIE_4354_NVRAM_NAME); +- MODULE_FIRMWARE(BRCMF_PCIE_4356_FW_NAME); +- MODULE_FIRMWARE(BRCMF_PCIE_4356_NVRAM_NAME); +- MODULE_FIRMWARE(BRCMF_PCIE_43570_FW_NAME); +-@@ -1327,10 +1323,6 @@ 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_4354_CHIP_ID: +-- fw_name = BRCMF_PCIE_4354_FW_NAME; +-- nvram_name = BRCMF_PCIE_4354_NVRAM_NAME; +-- break; +- case BRCM_CC_4356_CHIP_ID: +- fw_name = BRCMF_PCIE_4356_FW_NAME; +- nvram_name = BRCMF_PCIE_4356_NVRAM_NAME; +-@@ -1855,7 +1847,6 @@ 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_4354_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), +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 +deleted file mode 100644 +index 366ff85..0000000 +--- a/package/kernel/mac80211/patches/353-brcmfmac-disable-MBSS-feature-for-BCM43362.patch ++++ /dev/null +@@ -1,28 +0,0 @@ +-From: Arend van Spriel +-Date: Fri, 20 Mar 2015 22:18:17 +0100 +-Subject: [PATCH] brcmfmac: disable MBSS feature for BCM43362 +- +-The BCM43362 firmware falsely reports it is capable of providing +-MBSS. As a result AP mode no longer works for this device. Therefor +-disable MBSS in the driver for this chipset. +- +-Cc: stable@vger.kernel.org # 3.19.y +-Reported-by: Jorg Krause +-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/feature.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/feature.c +-@@ -126,7 +126,8 @@ void brcmf_feat_attach(struct brcmf_pub +- brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_MCHAN, "mchan"); +- if (drvr->bus_if->wowl_supported) +- brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_WOWL, "wowl"); +-- brcmf_feat_iovar_int_set(ifp, BRCMF_FEAT_MBSS, "mbss", 0); +-+ if (drvr->bus_if->chip != BRCM_CC_43362_CHIP_ID) +-+ brcmf_feat_iovar_int_set(ifp, BRCMF_FEAT_MBSS, "mbss", 0); +- +- /* 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 +deleted file mode 100644 +index 6e461f6..0000000 +--- a/package/kernel/mac80211/patches/354-brcmfmac-use-static-superset-of-channels-for-wiphy-b.patch ++++ /dev/null +@@ -1,300 +0,0 @@ +-From: Arend van Spriel +-Date: Tue, 14 Apr 2015 20:10:24 +0200 +-Subject: [PATCH] brcmfmac: use static superset of channels for wiphy +- bands +- +-The driver was constructing a list of channels per wiphy band +-by querying the device. This list is not what the hardware is +-able to do as it is already filtered by the country setting in +-the device. As user-space may change the country this would +-require updating the channel list which is not recommended [1]. +-This patch introduces a superset of channels. The individual +-channels are disabled appropriately by querying the device. +- +-[1] http://mid.gmane.org/1426706320.3001.21.camel@sipsolutions.net +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Daniel (Deognyoun) Kim +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Arend van Spriel +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-@@ -129,13 +129,47 @@ static struct ieee80211_rate __wl_rates[ +- RATETAB_ENT(BRCM_RATE_54M, 0), +- }; +- +--#define wl_a_rates (__wl_rates + 4) +--#define wl_a_rates_size 8 +- #define wl_g_rates (__wl_rates + 0) +--#define wl_g_rates_size 12 +-+#define wl_g_rates_size ARRAY_SIZE(__wl_rates) +-+#define wl_a_rates (__wl_rates + 4) +-+#define wl_a_rates_size (wl_g_rates_size - 4) +-+ +-+#define CHAN2G(_channel, _freq) { \ +-+ .band = IEEE80211_BAND_2GHZ, \ +-+ .center_freq = (_freq), \ +-+ .hw_value = (_channel), \ +-+ .flags = IEEE80211_CHAN_DISABLED, \ +-+ .max_antenna_gain = 0, \ +-+ .max_power = 30, \ +-+} +-+ +-+#define CHAN5G(_channel) { \ +-+ .band = IEEE80211_BAND_5GHZ, \ +-+ .center_freq = 5000 + (5 * (_channel)), \ +-+ .hw_value = (_channel), \ +-+ .flags = IEEE80211_CHAN_DISABLED, \ +-+ .max_antenna_gain = 0, \ +-+ .max_power = 30, \ +-+} +-+ +-+static struct ieee80211_channel __wl_2ghz_channels[] = { +-+ CHAN2G(1, 2412), CHAN2G(2, 2417), CHAN2G(3, 2422), CHAN2G(4, 2427), +-+ CHAN2G(5, 2432), CHAN2G(6, 2437), CHAN2G(7, 2442), CHAN2G(8, 2447), +-+ CHAN2G(9, 2452), CHAN2G(10, 2457), CHAN2G(11, 2462), CHAN2G(12, 2467), +-+ CHAN2G(13, 2472), CHAN2G(14, 2484) +-+}; +-+ +-+static struct ieee80211_channel __wl_5ghz_channels[] = { +-+ CHAN5G(34), CHAN5G(36), CHAN5G(38), CHAN5G(40), CHAN5G(42), +-+ CHAN5G(44), CHAN5G(46), CHAN5G(48), CHAN5G(52), CHAN5G(56), +-+ CHAN5G(60), CHAN5G(64), CHAN5G(100), CHAN5G(104), CHAN5G(108), +-+ CHAN5G(112), CHAN5G(116), CHAN5G(120), CHAN5G(124), CHAN5G(128), +-+ CHAN5G(132), CHAN5G(136), CHAN5G(140), CHAN5G(144), CHAN5G(149), +-+ CHAN5G(153), CHAN5G(157), CHAN5G(161), CHAN5G(165) +-+}; +- +- /* Band templates duplicated per wiphy. The channel info +-- * is filled in after querying the device. +-+ * above is added to the band during setup. +- */ +- static const struct ieee80211_supported_band __wl_band_2ghz = { +- .band = IEEE80211_BAND_2GHZ, +-@@ -143,7 +177,7 @@ static const struct ieee80211_supported_ +- .n_bitrates = wl_g_rates_size, +- }; +- +--static const struct ieee80211_supported_band __wl_band_5ghz_a = { +-+static const struct ieee80211_supported_band __wl_band_5ghz = { +- .band = IEEE80211_BAND_5GHZ, +- .bitrates = wl_a_rates, +- .n_bitrates = wl_a_rates_size, +-@@ -5252,40 +5286,6 @@ dongle_scantime_out: +- return err; +- } +- +--/* Filter the list of channels received from firmware counting only +-- * the 20MHz channels. The wiphy band data only needs those which get +-- * flagged to indicate if they can take part in higher bandwidth. +-- */ +--static void brcmf_count_20mhz_channels(struct brcmf_cfg80211_info *cfg, +-- struct brcmf_chanspec_list *chlist, +-- u32 chcnt[]) +--{ +-- u32 total = le32_to_cpu(chlist->count); +-- struct brcmu_chan ch; +-- int i; +-- +-- for (i = 0; i < total; i++) { +-- ch.chspec = (u16)le32_to_cpu(chlist->element[i]); +-- cfg->d11inf.decchspec(&ch); +-- +-- /* Firmware gives a ordered list. We skip non-20MHz +-- * channels is 2G. For 5G we can abort upon reaching +-- * a non-20MHz channel in the list. +-- */ +-- if (ch.bw != BRCMU_CHAN_BW_20) { +-- if (ch.band == BRCMU_CHAN_BAND_5G) +-- break; +-- else +-- continue; +-- } +-- +-- if (ch.band == BRCMU_CHAN_BAND_2G) +-- chcnt[0] += 1; +-- else if (ch.band == BRCMU_CHAN_BAND_5G) +-- chcnt[1] += 1; +-- } +--} +-- +- static void brcmf_update_bw40_channel_flag(struct ieee80211_channel *channel, +- struct brcmu_chan *ch) +- { +-@@ -5321,7 +5321,6 @@ static int brcmf_construct_chaninfo(stru +- u32 i, j; +- u32 total; +- u32 chaninfo; +-- u32 chcnt[2] = { 0, 0 }; +- u32 index; +- +- pbuf = kzalloc(BRCMF_DCMD_MEDLEN, GFP_KERNEL); +-@@ -5338,42 +5337,15 @@ static int brcmf_construct_chaninfo(stru +- goto fail_pbuf; +- } +- +-- brcmf_count_20mhz_channels(cfg, list, chcnt); +- wiphy = cfg_to_wiphy(cfg); +-- if (chcnt[0]) { +-- band = kmemdup(&__wl_band_2ghz, sizeof(__wl_band_2ghz), +-- GFP_KERNEL); +-- if (band == NULL) { +-- err = -ENOMEM; +-- goto fail_pbuf; +-- } +-- band->channels = kcalloc(chcnt[0], sizeof(*channel), +-- GFP_KERNEL); +-- if (band->channels == NULL) { +-- kfree(band); +-- err = -ENOMEM; +-- goto fail_pbuf; +-- } +-- band->n_channels = 0; +-- wiphy->bands[IEEE80211_BAND_2GHZ] = band; +-- } +-- if (chcnt[1]) { +-- band = kmemdup(&__wl_band_5ghz_a, sizeof(__wl_band_5ghz_a), +-- GFP_KERNEL); +-- if (band == NULL) { +-- err = -ENOMEM; +-- goto fail_band2g; +-- } +-- band->channels = kcalloc(chcnt[1], sizeof(*channel), +-- GFP_KERNEL); +-- if (band->channels == NULL) { +-- kfree(band); +-- err = -ENOMEM; +-- goto fail_band2g; +-- } +-- band->n_channels = 0; +-- wiphy->bands[IEEE80211_BAND_5GHZ] = band; +-- } +-+ band = wiphy->bands[IEEE80211_BAND_2GHZ]; +-+ if (band) +-+ for (i = 0; i < band->n_channels; i++) +-+ band->channels[i].flags = IEEE80211_CHAN_DISABLED; +-+ band = wiphy->bands[IEEE80211_BAND_5GHZ]; +-+ if (band) +-+ for (i = 0; i < band->n_channels; i++) +-+ band->channels[i].flags = IEEE80211_CHAN_DISABLED; +- +- total = le32_to_cpu(list->count); +- for (i = 0; i < total; i++) { +-@@ -5388,6 +5360,8 @@ static int brcmf_construct_chaninfo(stru +- brcmf_err("Invalid channel Spec. 0x%x.\n", ch.chspec); +- continue; +- } +-+ if (!band) +-+ continue; +- if (!(bw_cap[band->band] & WLC_BW_40MHZ_BIT) && +- ch.bw == BRCMU_CHAN_BW_40) +- continue; +-@@ -5415,9 +5389,9 @@ static int brcmf_construct_chaninfo(stru +- } else if (ch.bw == BRCMU_CHAN_BW_40) { +- brcmf_update_bw40_channel_flag(&channel[index], &ch); +- } else { +-- /* disable other bandwidths for now as mentioned +-- * order assure they are enabled for subsequent +-- * chanspecs. +-+ /* enable the channel and disable other bandwidths +-+ * for now as mentioned order assure they are enabled +-+ * for subsequent chanspecs. +- */ +- channel[index].flags = IEEE80211_CHAN_NO_HT40 | +- IEEE80211_CHAN_NO_80MHZ; +-@@ -5436,16 +5410,8 @@ static int brcmf_construct_chaninfo(stru +- IEEE80211_CHAN_NO_IR; +- } +- } +-- if (index == band->n_channels) +-- band->n_channels++; +- } +-- kfree(pbuf); +-- return 0; +- +--fail_band2g: +-- kfree(wiphy->bands[IEEE80211_BAND_2GHZ]->channels); +-- kfree(wiphy->bands[IEEE80211_BAND_2GHZ]); +-- wiphy->bands[IEEE80211_BAND_2GHZ] = NULL; +- fail_pbuf: +- kfree(pbuf); +- return err; +-@@ -5778,7 +5744,12 @@ static void brcmf_wiphy_wowl_params(stru +- +- static int brcmf_setup_wiphy(struct wiphy *wiphy, struct brcmf_if *ifp) +- { +-+ struct ieee80211_supported_band *band; +- struct ieee80211_iface_combination ifc_combo; +-+ __le32 bandlist[3]; +-+ u32 n_bands; +-+ int err, i; +-+ +- wiphy->max_scan_ssids = WL_NUM_SCAN_MAX; +- wiphy->max_scan_ie_len = BRCMF_SCAN_IE_LEN_MAX; +- wiphy->max_num_pmkids = WL_NUM_PMKIDS_MAX; +-@@ -5820,7 +5791,52 @@ static int brcmf_setup_wiphy(struct wiph +- if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_WOWL)) +- brcmf_wiphy_wowl_params(wiphy); +- +-- return brcmf_setup_wiphybands(wiphy); +-+ err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BANDLIST, &bandlist, +-+ sizeof(bandlist)); +-+ if (err) { +-+ brcmf_err("could not obtain band info: err=%d\n", err); +-+ return err; +-+ } +-+ /* first entry in bandlist is number of bands */ +-+ n_bands = le32_to_cpu(bandlist[0]); +-+ for (i = 1; i <= n_bands && i < ARRAY_SIZE(bandlist); i++) { +-+ if (bandlist[i] == cpu_to_le32(WLC_BAND_2G)) { +-+ band = kmemdup(&__wl_band_2ghz, sizeof(__wl_band_2ghz), +-+ GFP_KERNEL); +-+ if (!band) +-+ return -ENOMEM; +-+ +-+ band->channels = kmemdup(&__wl_2ghz_channels, +-+ sizeof(__wl_2ghz_channels), +-+ GFP_KERNEL); +-+ if (!band->channels) { +-+ kfree(band); +-+ return -ENOMEM; +-+ } +-+ +-+ band->n_channels = ARRAY_SIZE(__wl_2ghz_channels); +-+ wiphy->bands[IEEE80211_BAND_2GHZ] = band; +-+ } +-+ if (bandlist[i] == cpu_to_le32(WLC_BAND_5G)) { +-+ band = kmemdup(&__wl_band_5ghz, sizeof(__wl_band_5ghz), +-+ GFP_KERNEL); +-+ if (!band) +-+ return -ENOMEM; +-+ +-+ band->channels = kmemdup(&__wl_5ghz_channels, +-+ sizeof(__wl_5ghz_channels), +-+ GFP_KERNEL); +-+ if (!band->channels) { +-+ kfree(band); +-+ return -ENOMEM; +-+ } +-+ +-+ band->n_channels = ARRAY_SIZE(__wl_5ghz_channels); +-+ wiphy->bands[IEEE80211_BAND_5GHZ] = band; +-+ } +-+ } +-+ err = brcmf_setup_wiphybands(wiphy); +-+ return err; +- } +- +- static s32 brcmf_config_dongle(struct brcmf_cfg80211_info *cfg) +-@@ -6011,6 +6027,9 @@ static void brcmf_cfg80211_reg_notifier( +- +- static void brcmf_free_wiphy(struct wiphy *wiphy) +- { +-+ if (!wiphy) +-+ return; +-+ +- 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 +deleted file mode 100644 +index a0c22eb..0000000 +--- a/package/kernel/mac80211/patches/355-brcmfmac-update-wiphy-band-information-upon-updating.patch ++++ /dev/null +@@ -1,29 +0,0 @@ +-From: Arend van Spriel +-Date: Tue, 14 Apr 2015 20:10:25 +0200 +-Subject: [PATCH] brcmfmac: update wiphy band information upon updating +- regulatory domain +- +-When change the country code the available channels may change. So +-the wiphy bands should be updated accordingly. +- +-Reviewed-by: Daniel (Deognyoun) Kim +-Reviewed-by: Hante Meuleman +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Arend van Spriel +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-@@ -6022,7 +6022,11 @@ static void brcmf_cfg80211_reg_notifier( +- memset(&ccreq, 0, sizeof(ccreq)); +- ccreq.rev = cpu_to_le32(-1); +- memcpy(ccreq.ccode, req->alpha2, sizeof(req->alpha2)); +-- brcmf_fil_iovar_data_set(ifp, "country", &ccreq, sizeof(ccreq)); +-+ if (brcmf_fil_iovar_data_set(ifp, "country", &ccreq, sizeof(ccreq))) { +-+ brcmf_err("firmware rejected country setting\n"); +-+ return; +-+ } +-+ brcmf_setup_wiphybands(wiphy); +- } +- +- 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 +deleted file mode 100644 +index 193f507..0000000 +--- a/package/kernel/mac80211/patches/356-brcmfmac-add-description-for-feature-flags.patch ++++ /dev/null +@@ -1,24 +0,0 @@ +-From: Arend van Spriel +-Date: Tue, 14 Apr 2015 20:10:26 +0200 +-Subject: [PATCH] brcmfmac: add description for feature flags +- +-Some feature flags were not described in the header file. Adding +-the description. +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Arend van Spriel +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/feature.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/feature.h +-@@ -19,7 +19,9 @@ +- /* +- * Features: +- * +-+ * MBSS: multiple BSSID support (eg. guest network in AP mode). +- * MCHAN: multi-channel for concurrent P2P. +-+ * WOWL: Wake-On-WLAN. +- */ +- #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 +deleted file mode 100644 +index 42330b4..0000000 +--- a/package/kernel/mac80211/patches/357-brcmfmac-make-scheduled-scan-support-conditional.patch ++++ /dev/null +@@ -1,51 +0,0 @@ +-From: Arend van Spriel +-Date: Tue, 14 Apr 2015 20:10:27 +0200 +-Subject: [PATCH] brcmfmac: make scheduled scan support conditional +- +-The scheduled scan support depends on firmware supporting the PNO +-feature. This feature is optional so add a feature flag for this +-in the driver and announce scheduled scan support accordingly. +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Arend van Spriel +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-@@ -5782,7 +5782,8 @@ static int brcmf_setup_wiphy(struct wiph +- wiphy->flags |= WIPHY_FLAG_SUPPORTS_FW_ROAM; +- wiphy->mgmt_stypes = brcmf_txrx_stypes; +- wiphy->max_remain_on_channel_duration = 5000; +-- brcmf_wiphy_pno_params(wiphy); +-+ if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_PNO)) +-+ brcmf_wiphy_pno_params(wiphy); +- +- /* vendor commands/events support */ +- wiphy->vendor_commands = brcmf_vendor_cmds; +---- a/drivers/net/wireless/brcm80211/brcmfmac/feature.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/feature.c +-@@ -124,6 +124,7 @@ void brcmf_feat_attach(struct brcmf_pub +- struct brcmf_if *ifp = drvr->iflist[0]; +- +- brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_MCHAN, "mchan"); +-+ brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_PNO, "pfn"); +- if (drvr->bus_if->wowl_supported) +- brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_WOWL, "wowl"); +- if (drvr->bus_if->chip != BRCM_CC_43362_CHIP_ID) +---- a/drivers/net/wireless/brcm80211/brcmfmac/feature.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/feature.h +-@@ -21,11 +21,13 @@ +- * +- * MBSS: multiple BSSID support (eg. guest network in AP mode). +- * MCHAN: multi-channel for concurrent P2P. +-+ * PNO: preferred network offload. +- * WOWL: Wake-On-WLAN. +- */ +- #define BRCMF_FEAT_LIST \ +- BRCMF_FEAT_DEF(MBSS) \ +- BRCMF_FEAT_DEF(MCHAN) \ +-+ BRCMF_FEAT_DEF(PNO) \ +- 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 +deleted file mode 100644 +index b859d46..0000000 +--- a/package/kernel/mac80211/patches/358-brcmfmac-add-support-for-BCM4324-rev-B5-chipset.patch ++++ /dev/null +@@ -1,43 +0,0 @@ +-From: Arend van Spriel +-Date: Tue, 14 Apr 2015 20:10:28 +0200 +-Subject: [PATCH] brcmfmac: add support for BCM4324 rev B5 chipset +- +-This patch adds support for the BCM4324 B5 revision. This device +-is similar to BCM43241 from driver and firmware perspective. It +-is known to be used in Lenovo Thinkpad Tablet devices. +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Arend van Spriel +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-@@ -601,6 +601,8 @@ static const struct sdiod_drive_str sdio +- #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" +-@@ -628,6 +630,8 @@ 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); +-@@ -667,7 +671,8 @@ enum brcmf_firmware_type { +- 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, 0xFFFFFFE0, BRCMF_FIRMWARE_NVRAM(BCM43241B4) }, +-+ { 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) }, +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 +deleted file mode 100644 +index d420308..0000000 +--- a/package/kernel/mac80211/patches/359-brcmfmac-process-interrupt-regardless-sdiod-state.patch ++++ /dev/null +@@ -1,27 +0,0 @@ +-From: Arend van Spriel +-Date: Tue, 14 Apr 2015 20:10:29 +0200 +-Subject: [PATCH] brcmfmac: process interrupt regardless sdiod state +- +-When the sdio bus state is not ready to process we abort the +-interrupt service routine. This is not wanted as it keeps the +-interrupt source active. Better clear the interrupt source. +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Franky (Zhenhui) Lin +-Signed-off-by: Arend van Spriel +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-@@ -3555,10 +3555,6 @@ void brcmf_sdio_isr(struct brcmf_sdio *b +- return; +- } +- +-- if (bus->sdiodev->state != BRCMF_SDIOD_DATA) { +-- brcmf_err("bus is down. we have nothing to do\n"); +-- return; +-- } +- /* 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 +deleted file mode 100644 +index ac5584e..0000000 +--- a/package/kernel/mac80211/patches/360-brcmfmac-fix-sdio-suspend-and-resume.patch ++++ /dev/null +@@ -1,68 +0,0 @@ +-From: Arend van Spriel +-Date: Tue, 14 Apr 2015 20:10:30 +0200 +-Subject: [PATCH] brcmfmac: fix sdio suspend and resume +- +-commit 330b4e4be937 ("brcmfmac: Add wowl support for SDIO devices.") +-changed the behaviour by removing the MMC_PM_KEEP_POWER flag for +-non-wowl scenario, which needs to be restored. Another necessary +-change is to mark the card as being non-removable. With this in place +-the suspend resume test passes successfully doing: +- +- # echo devices > /sys/power/pm_test +- # echo mem > /sys/power/state +- +-Note that power may still be switched off when system is going +-in S3 state. +- +-Reported-by: Fu, Zhonghui < +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Franky (Zhenhui) Lin +-Signed-off-by: Arend van Spriel +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +-@@ -1011,6 +1011,14 @@ static int brcmf_sdiod_remove(struct brc +- return 0; +- } +- +-+static void brcmf_sdiod_host_fixup(struct mmc_host *host) +-+{ +-+ /* runtime-pm powers off the device */ +-+ pm_runtime_forbid(host->parent); +-+ /* avoid removal detection upon resume */ +-+ host->caps |= MMC_CAP_NONREMOVABLE; +-+} +-+ +- static int brcmf_sdiod_probe(struct brcmf_sdio_dev *sdiodev) +- { +- struct sdio_func *func; +-@@ -1076,7 +1084,7 @@ static int brcmf_sdiod_probe(struct brcm +- ret = -ENODEV; +- goto out; +- } +-- pm_runtime_forbid(host->parent); +-+ brcmf_sdiod_host_fixup(host); +- out: +- if (ret) +- brcmf_sdiod_remove(sdiodev); +-@@ -1246,15 +1254,15 @@ static int brcmf_ops_sdio_suspend(struct +- brcmf_sdiod_freezer_on(sdiodev); +- brcmf_sdio_wd_timer(sdiodev->bus, 0); +- +-+ sdio_flags = MMC_PM_KEEP_POWER; +- if (sdiodev->wowl_enabled) { +-- sdio_flags = MMC_PM_KEEP_POWER; +- if (sdiodev->pdata->oob_irq_supported) +- enable_irq_wake(sdiodev->pdata->oob_irq_nr); +- else +-- sdio_flags = MMC_PM_WAKE_SDIO_IRQ; +-- if (sdio_set_host_pm_flags(sdiodev->func[1], sdio_flags)) +-- brcmf_err("Failed to set pm_flags %x\n", sdio_flags); +-+ sdio_flags |= MMC_PM_WAKE_SDIO_IRQ; +- } +-+ if (sdio_set_host_pm_flags(sdiodev->func[1], sdio_flags)) +-+ brcmf_err("Failed to set pm_flags %x\n", sdio_flags); +- 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 +deleted file mode 100644 +index a521b65..0000000 +--- a/package/kernel/mac80211/patches/361-brcmfmac-add-support-for-BCM4358-PCIe-device.patch ++++ /dev/null +@@ -1,77 +0,0 @@ +-From: Arend van Spriel +-Date: Tue, 14 Apr 2015 20:10:31 +0200 +-Subject: [PATCH] brcmfmac: add support for BCM4358 PCIe device +- +-This patch adds support for the BCM4358 2x2 11ac device. +- +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Arend van Spriel +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/chip.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c +-@@ -649,6 +649,7 @@ static u32 brcmf_chip_tcm_rambase(struct +- case BRCM_CC_43567_CHIP_ID: +- case BRCM_CC_43569_CHIP_ID: +- case BRCM_CC_43570_CHIP_ID: +-+ case BRCM_CC_4358_CHIP_ID: +- case BRCM_CC_43602_CHIP_ID: +- return 0x180000; +- default: +---- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-@@ -51,6 +51,8 @@ enum brcmf_pcie_state { +- #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_FW_UP_TIMEOUT 2000 /* msec */ +- +-@@ -189,6 +191,8 @@ 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); +- +- +- struct brcmf_pcie_console { +-@@ -1333,6 +1337,10 @@ static int brcmf_pcie_get_fwnames(struct +- 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; +- default: +- brcmf_err("Unsupported chip 0x%04x\n", devinfo->ci->chip); +- return -ENODEV; +-@@ -1850,6 +1858,7 @@ static struct pci_device_id brcmf_pcie_d +- BRCMF_PCIE_DEVICE(BRCM_PCIE_4356_DEVICE_ID), +- 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_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 +-@@ -45,6 +45,7 @@ +- #define BRCM_CC_43567_CHIP_ID 43567 +- #define BRCM_CC_43569_CHIP_ID 43569 +- #define BRCM_CC_43570_CHIP_ID 43570 +-+#define BRCM_CC_4358_CHIP_ID 0x4358 +- #define BRCM_CC_43602_CHIP_ID 43602 +- +- /* USB Device IDs */ +-@@ -59,6 +60,7 @@ +- #define BRCM_PCIE_4356_DEVICE_ID 0x43ec +- #define BRCM_PCIE_43567_DEVICE_ID 0x43d3 +- #define BRCM_PCIE_43570_DEVICE_ID 0x43d9 +-+#define BRCM_PCIE_4358_DEVICE_ID 0x43e9 +- #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 +deleted file mode 100644 +index bcbb984..0000000 +--- a/package/kernel/mac80211/patches/362-brcmfmac-add-additional-43602-pcie-device-id.patch ++++ /dev/null +@@ -1,30 +0,0 @@ +-From: Hante Meuleman +-Date: Tue, 14 Apr 2015 20:10:32 +0200 +-Subject: [PATCH] brcmfmac: add additional 43602 pcie device id. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-@@ -1862,6 +1862,7 @@ static struct pci_device_id brcmf_pcie_d +- 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), +-+ BRCMF_PCIE_DEVICE(BRCM_PCIE_43602_RAW_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 +-@@ -64,6 +64,7 @@ +- #define BRCM_PCIE_43602_DEVICE_ID 0x43ba +- #define BRCM_PCIE_43602_2G_DEVICE_ID 0x43bb +- #define BRCM_PCIE_43602_5G_DEVICE_ID 0x43bc +-+#define BRCM_PCIE_43602_RAW_DEVICE_ID 43602 +- +- /* 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 +deleted file mode 100644 +index 5f9bbea..0000000 +--- a/package/kernel/mac80211/patches/363-brcmfmac-Add-support-for-multiple-PCIE-devices-in-nv.patch ++++ /dev/null +@@ -1,351 +0,0 @@ +-From: Hante Meuleman +-Date: Tue, 14 Apr 2015 20:10:33 +0200 +-Subject: [PATCH] brcmfmac: Add support for multiple PCIE devices in +- nvram. +- +-With PCIE it is possible to support multiple devices with the +-same device type. They all load the same nvram file. In order to +-support this the nvram can specify which part of the nvram is +-for which pcie device. This patch adds support for these new +-types of nvram files. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Daniel (Deognyoun) Kim +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/firmware.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/firmware.c +-@@ -23,6 +23,10 @@ +- #include "debug.h" +- #include "firmware.h" +- +-+#define BRCMF_FW_MAX_NVRAM_SIZE 64000 +-+#define BRCMF_FW_NVRAM_DEVPATH_LEN 19 /* devpath0=pcie/1/4/ */ +-+#define BRCMF_FW_NVRAM_PCIEDEV_LEN 9 /* pcie/1/4/ */ +-+ +- char brcmf_firmware_path[BRCMF_FW_PATH_LEN]; +- module_param_string(firmware_path, brcmf_firmware_path, +- BRCMF_FW_PATH_LEN, 0440); +-@@ -46,6 +50,8 @@ enum nvram_parser_state { +- * @column: current column in line. +- * @pos: byte offset in input buffer. +- * @entry: start position of key,value entry. +-+ * @multi_dev_v1: detect pcie multi device v1 (compressed). +-+ * @multi_dev_v2: detect pcie multi device v2. +- */ +- struct nvram_parser { +- enum nvram_parser_state state; +-@@ -56,6 +62,8 @@ struct nvram_parser { +- u32 column; +- u32 pos; +- u32 entry; +-+ bool multi_dev_v1; +-+ bool multi_dev_v2; +- }; +- +- static bool is_nvram_char(char c) +-@@ -108,6 +116,10 @@ static enum nvram_parser_state brcmf_nvr +- st = COMMENT; +- else +- st = VALUE; +-+ if (strncmp(&nvp->fwnv->data[nvp->entry], "devpath", 7) == 0) +-+ nvp->multi_dev_v1 = true; +-+ if (strncmp(&nvp->fwnv->data[nvp->entry], "pcie/", 5) == 0) +-+ nvp->multi_dev_v2 = true; +- } else if (!is_nvram_char(c)) { +- brcmf_dbg(INFO, "warning: ln=%d:col=%d: '=' expected, skip invalid key entry\n", +- nvp->line, nvp->column); +-@@ -133,6 +145,8 @@ brcmf_nvram_handle_value(struct nvram_pa +- ekv = (u8 *)&nvp->fwnv->data[nvp->pos]; +- skv = (u8 *)&nvp->fwnv->data[nvp->entry]; +- cplen = ekv - skv; +-+ if (nvp->nvram_len + cplen + 1 >= BRCMF_FW_MAX_NVRAM_SIZE) +-+ return END; +- /* copy to output buffer */ +- memcpy(&nvp->nvram[nvp->nvram_len], skv, cplen); +- nvp->nvram_len += cplen; +-@@ -180,10 +194,18 @@ static enum nvram_parser_state +- static int brcmf_init_nvram_parser(struct nvram_parser *nvp, +- const struct firmware *nv) +- { +-+ size_t size; +-+ +- memset(nvp, 0, sizeof(*nvp)); +- nvp->fwnv = nv; +-+ /* Limit size to MAX_NVRAM_SIZE, some files contain lot of comment */ +-+ if (nv->size > BRCMF_FW_MAX_NVRAM_SIZE) +-+ size = BRCMF_FW_MAX_NVRAM_SIZE; +-+ else +-+ size = nv->size; +- /* Alloc for extra 0 byte + roundup by 4 + length field */ +-- nvp->nvram = kzalloc(nv->size + 1 + 3 + sizeof(u32), GFP_KERNEL); +-+ size += 1 + 3 + sizeof(u32); +-+ nvp->nvram = kzalloc(size, GFP_KERNEL); +- if (!nvp->nvram) +- return -ENOMEM; +- +-@@ -192,12 +214,136 @@ static int brcmf_init_nvram_parser(struc +- return 0; +- } +- +-+/* brcmf_fw_strip_multi_v1 :Some nvram files contain settings for multiple +-+ * devices. Strip it down for one device, use domain_nr/bus_nr to determine +-+ * which data is to be returned. v1 is the version where nvram is stored +-+ * compressed and "devpath" maps to index for valid entries. +-+ */ +-+static void brcmf_fw_strip_multi_v1(struct nvram_parser *nvp, u16 domain_nr, +-+ u16 bus_nr) +-+{ +-+ u32 i, j; +-+ bool found; +-+ u8 *nvram; +-+ u8 id; +-+ +-+ nvram = kzalloc(nvp->nvram_len + 1 + 3 + sizeof(u32), GFP_KERNEL); +-+ if (!nvram) +-+ goto fail; +-+ +-+ /* min length: devpath0=pcie/1/4/ + 0:x=y */ +-+ if (nvp->nvram_len < BRCMF_FW_NVRAM_DEVPATH_LEN + 6) +-+ goto fail; +-+ +-+ /* First search for the devpathX and see if it is the configuration +-+ * for domain_nr/bus_nr. Search complete nvp +-+ */ +-+ found = false; +-+ i = 0; +-+ while (i < nvp->nvram_len - BRCMF_FW_NVRAM_DEVPATH_LEN) { +-+ /* Format: devpathX=pcie/Y/Z/ +-+ * Y = domain_nr, Z = bus_nr, X = virtual ID +-+ */ +-+ if ((strncmp(&nvp->nvram[i], "devpath", 7) == 0) && +-+ (strncmp(&nvp->nvram[i + 8], "=pcie/", 6) == 0)) { +-+ if (((nvp->nvram[i + 14] - '0') == domain_nr) && +-+ ((nvp->nvram[i + 16] - '0') == bus_nr)) { +-+ id = nvp->nvram[i + 7] - '0'; +-+ found = true; +-+ break; +-+ } +-+ } +-+ while (nvp->nvram[i] != 0) +-+ i++; +-+ i++; +-+ } +-+ if (!found) +-+ goto fail; +-+ +-+ /* Now copy all valid entries, release old nvram and assign new one */ +-+ i = 0; +-+ j = 0; +-+ while (i < nvp->nvram_len) { +-+ if ((nvp->nvram[i] - '0' == id) && (nvp->nvram[i + 1] == ':')) { +-+ i += 2; +-+ while (nvp->nvram[i] != 0) { +-+ nvram[j] = nvp->nvram[i]; +-+ i++; +-+ j++; +-+ } +-+ nvram[j] = 0; +-+ j++; +-+ } +-+ while (nvp->nvram[i] != 0) +-+ i++; +-+ i++; +-+ } +-+ kfree(nvp->nvram); +-+ nvp->nvram = nvram; +-+ nvp->nvram_len = j; +-+ return; +-+ +-+fail: +-+ kfree(nvram); +-+ nvp->nvram_len = 0; +-+} +-+ +-+/* brcmf_fw_strip_multi_v2 :Some nvram files contain settings for multiple +-+ * devices. Strip it down for one device, use domain_nr/bus_nr to determine +-+ * which data is to be returned. v2 is the version where nvram is stored +-+ * uncompressed, all relevant valid entries are identified by +-+ * pcie/domain_nr/bus_nr: +-+ */ +-+static void brcmf_fw_strip_multi_v2(struct nvram_parser *nvp, u16 domain_nr, +-+ u16 bus_nr) +-+{ +-+ u32 i, j; +-+ u8 *nvram; +-+ +-+ nvram = kzalloc(nvp->nvram_len + 1 + 3 + sizeof(u32), GFP_KERNEL); +-+ if (!nvram) +-+ goto fail; +-+ +-+ /* Copy all valid entries, release old nvram and assign new one. +-+ * Valid entries are of type pcie/X/Y/ where X = domain_nr and +-+ * Y = bus_nr. +-+ */ +-+ i = 0; +-+ j = 0; +-+ while (i < nvp->nvram_len - BRCMF_FW_NVRAM_PCIEDEV_LEN) { +-+ if ((strncmp(&nvp->nvram[i], "pcie/", 5) == 0) && +-+ (nvp->nvram[i + 6] == '/') && (nvp->nvram[i + 8] == '/') && +-+ ((nvp->nvram[i + 5] - '0') == domain_nr) && +-+ ((nvp->nvram[i + 7] - '0') == bus_nr)) { +-+ i += BRCMF_FW_NVRAM_PCIEDEV_LEN; +-+ while (nvp->nvram[i] != 0) { +-+ nvram[j] = nvp->nvram[i]; +-+ i++; +-+ j++; +-+ } +-+ nvram[j] = 0; +-+ j++; +-+ } +-+ while (nvp->nvram[i] != 0) +-+ i++; +-+ i++; +-+ } +-+ kfree(nvp->nvram); +-+ nvp->nvram = nvram; +-+ nvp->nvram_len = j; +-+ return; +-+fail: +-+ kfree(nvram); +-+ nvp->nvram_len = 0; +-+} +-+ +- /* brcmf_nvram_strip :Takes a buffer of "=\n" lines read from a fil +- * and ending in a NUL. Removes carriage returns, empty lines, comment lines, +- * and converts newlines to NULs. Shortens buffer as needed and pads with NULs. +- * End of buffer is completed with token identifying length of buffer. +- */ +--static void *brcmf_fw_nvram_strip(const struct firmware *nv, u32 *new_length) +-+static void *brcmf_fw_nvram_strip(const struct firmware *nv, u32 *new_length, +-+ u16 domain_nr, u16 bus_nr) +- { +- struct nvram_parser nvp; +- u32 pad; +-@@ -212,6 +358,16 @@ static void *brcmf_fw_nvram_strip(const +- if (nvp.state == END) +- break; +- } +-+ if (nvp.multi_dev_v1) +-+ brcmf_fw_strip_multi_v1(&nvp, domain_nr, bus_nr); +-+ else if (nvp.multi_dev_v2) +-+ brcmf_fw_strip_multi_v2(&nvp, domain_nr, bus_nr); +-+ +-+ if (nvp.nvram_len == 0) { +-+ kfree(nvp.nvram); +-+ return NULL; +-+ } +-+ +- pad = nvp.nvram_len; +- *new_length = roundup(nvp.nvram_len + 1, 4); +- while (pad != *new_length) { +-@@ -239,6 +395,8 @@ struct brcmf_fw { +- u16 flags; +- const struct firmware *code; +- const char *nvram_name; +-+ u16 domain_nr; +-+ u16 bus_nr; +- void (*done)(struct device *dev, const struct firmware *fw, +- void *nvram_image, u32 nvram_len); +- }; +-@@ -254,7 +412,8 @@ static void brcmf_fw_request_nvram_done( +- goto fail; +- +- if (fw) { +-- nvram = brcmf_fw_nvram_strip(fw, &nvram_length); +-+ nvram = brcmf_fw_nvram_strip(fw, &nvram_length, +-+ fwctx->domain_nr, fwctx->bus_nr); +- release_firmware(fw); +- if (!nvram && !(fwctx->flags & BRCMF_FW_REQ_NV_OPTIONAL)) +- goto fail; +-@@ -309,11 +468,12 @@ fail: +- kfree(fwctx); +- } +- +--int brcmf_fw_get_firmwares(struct device *dev, u16 flags, +-- const char *code, const char *nvram, +-- void (*fw_cb)(struct device *dev, +-- const struct firmware *fw, +-- void *nvram_image, u32 nvram_len)) +-+int brcmf_fw_get_firmwares_pcie(struct device *dev, u16 flags, +-+ const char *code, const char *nvram, +-+ void (*fw_cb)(struct device *dev, +-+ const struct firmware *fw, +-+ void *nvram_image, u32 nvram_len), +-+ u16 domain_nr, u16 bus_nr) +- { +- struct brcmf_fw *fwctx; +- +-@@ -333,8 +493,21 @@ int brcmf_fw_get_firmwares(struct device +- fwctx->done = fw_cb; +- if (flags & BRCMF_FW_REQUEST_NVRAM) +- fwctx->nvram_name = nvram; +-+ fwctx->domain_nr = domain_nr; +-+ fwctx->bus_nr = bus_nr; +- +- return request_firmware_nowait(THIS_MODULE, true, code, dev, +- GFP_KERNEL, fwctx, +- brcmf_fw_request_code_done); +- } +-+ +-+int brcmf_fw_get_firmwares(struct device *dev, u16 flags, +-+ const char *code, const char *nvram, +-+ void (*fw_cb)(struct device *dev, +-+ const struct firmware *fw, +-+ void *nvram_image, u32 nvram_len)) +-+{ +-+ return brcmf_fw_get_firmwares_pcie(dev, flags, code, nvram, fw_cb, 0, +-+ 0); +-+} +-+ +---- a/drivers/net/wireless/brcm80211/brcmfmac/firmware.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/firmware.h +-@@ -32,6 +32,12 @@ void brcmf_fw_nvram_free(void *nvram); +- * fails it will not use the callback, but call device_release_driver() +- * instead which will call the driver .remove() callback. +- */ +-+int brcmf_fw_get_firmwares_pcie(struct device *dev, u16 flags, +-+ const char *code, const char *nvram, +-+ void (*fw_cb)(struct device *dev, +-+ const struct firmware *fw, +-+ void *nvram_image, u32 nvram_len), +-+ u16 domain_nr, u16 bus_nr); +- int brcmf_fw_get_firmwares(struct device *dev, u16 flags, +- const char *code, const char *nvram, +- void (*fw_cb)(struct device *dev, +---- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-@@ -1649,8 +1649,13 @@ brcmf_pcie_probe(struct pci_dev *pdev, c +- struct brcmf_pciedev_info *devinfo; +- struct brcmf_pciedev *pcie_bus_dev; +- struct brcmf_bus *bus; +-+ u16 domain_nr; +-+ u16 bus_nr; +- +-- brcmf_dbg(PCIE, "Enter %x:%x\n", pdev->vendor, pdev->device); +-+ domain_nr = pci_domain_nr(pdev->bus) + 1; +-+ bus_nr = pdev->bus->number; +-+ brcmf_dbg(PCIE, "Enter %x:%x (%d/%d)\n", pdev->vendor, pdev->device, +-+ domain_nr, bus_nr); +- +- ret = -ENOMEM; +- devinfo = kzalloc(sizeof(*devinfo), GFP_KERNEL); +-@@ -1699,10 +1704,10 @@ brcmf_pcie_probe(struct pci_dev *pdev, c +- if (ret) +- goto fail_bus; +- +-- ret = brcmf_fw_get_firmwares(bus->dev, BRCMF_FW_REQUEST_NVRAM | +-- BRCMF_FW_REQ_NV_OPTIONAL, +-- devinfo->fw_name, devinfo->nvram_name, +-- brcmf_pcie_setup); +-+ ret = brcmf_fw_get_firmwares_pcie(bus->dev, BRCMF_FW_REQUEST_NVRAM | +-+ BRCMF_FW_REQ_NV_OPTIONAL, +-+ devinfo->fw_name, devinfo->nvram_name, +-+ brcmf_pcie_setup, domain_nr, bus_nr); +- 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 +deleted file mode 100644 +index d26e118..0000000 +--- a/package/kernel/mac80211/patches/364-brcmfmac-cleanup-a-sizeof.patch ++++ /dev/null +@@ -1,23 +0,0 @@ +-From: Dan Carpenter +-Date: Thu, 7 May 2015 12:59:19 +0300 +-Subject: [PATCH] brcmfmac: cleanup a sizeof() +- +-"flowrings" and "*flowrings" are both pointers so this always returns +-sizeof(void *) and the current code works fine. But "*flowrings" is +-intended here and static checkers complain, so lets change it. +- +-Signed-off-by: Dan Carpenter +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-@@ -1617,7 +1617,7 @@ static void brcmf_pcie_setup(struct devi +- bus->msgbuf->commonrings[i] = +- &devinfo->shared.commonrings[i]->commonring; +- +-- flowrings = kcalloc(devinfo->shared.nrof_flowrings, sizeof(flowrings), +-+ flowrings = kcalloc(devinfo->shared.nrof_flowrings, sizeof(*flowrings), +- 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 +deleted file mode 100644 +index 9b2880d..0000000 +--- a/package/kernel/mac80211/patches/365-brcmfmac-check-result-of-USB-firmware-request.patch ++++ /dev/null +@@ -1,33 +0,0 @@ +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Thu, 7 May 2015 14:13:03 +0200 +-Subject: [PATCH] brcmfmac: check result of USB firmware request +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-This prevents silence failures with driver waiting (infinitely) for a +-callback. +- +-Signed-off-by: Rafał Miłecki +-Acked-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 +-@@ -1270,8 +1270,13 @@ static int brcmf_usb_probe_cb(struct brc +- bus->chiprev = bus_pub->chiprev; +- +- /* request firmware here */ +-- brcmf_fw_get_firmwares(dev, 0, brcmf_usb_get_fwname(devinfo), NULL, +-- brcmf_usb_probe_phase2); +-+ ret = brcmf_fw_get_firmwares(dev, 0, brcmf_usb_get_fwname(devinfo), +-+ NULL, brcmf_usb_probe_phase2); +-+ if (ret) { +-+ brcmf_err("firmware request failed: %d\n", ret); +-+ goto fail; +-+ } +-+ +- 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 +deleted file mode 100644 +index d46b300..0000000 +--- a/package/kernel/mac80211/patches/366-brcmfmac-prohibit-ACPI-power-management-for-brcmfmac.patch ++++ /dev/null +@@ -1,47 +0,0 @@ +-From: "Fu, Zhonghui" +-Date: Mon, 11 May 2015 10:41:32 +0800 +-Subject: [PATCH] brcmfmac: prohibit ACPI power management for brcmfmac driver +- +-ACPI will manage WiFi chip's power state during suspend/resume +-process on some tablet platforms(such as ASUS T100TA). This is +-not supported by brcmfmac driver now, and the context of WiFi +-chip will be damaged after resume. This patch informs ACPI not +-to manage WiFi chip's power state. +- +-Signed-off-by: Zhonghui Fu +-Acked-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +-@@ -33,6 +33,7 @@ +- #include +- #include +- #include +-+#include +- #include +- +- #include +-@@ -1122,6 +1123,8 @@ static int brcmf_ops_sdio_probe(struct s +- int err; +- struct brcmf_sdio_dev *sdiodev; +- struct brcmf_bus *bus_if; +-+ struct device *dev; +-+ struct acpi_device *adev; +- +- brcmf_dbg(SDIO, "Enter\n"); +- brcmf_dbg(SDIO, "Class=%x\n", func->class); +-@@ -1129,6 +1132,12 @@ static int brcmf_ops_sdio_probe(struct s +- brcmf_dbg(SDIO, "sdio device ID: 0x%04x\n", func->device); +- brcmf_dbg(SDIO, "Function#: %d\n", func->num); +- +-+ /* prohibit ACPI power management for this device */ +-+ dev = &func->dev; +-+ adev = ACPI_COMPANION(dev); +-+ if (adev) +-+ adev->flags.power_manageable = 0; +-+ +- /* 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 +deleted file mode 100644 +index 9b4609f..0000000 +--- a/package/kernel/mac80211/patches/367-brcmfmac-avoid-gcc-5.1-warning.patch ++++ /dev/null +@@ -1,30 +0,0 @@ +-From: Arnd Bergmann +-Date: Tue, 12 May 2015 23:54:25 +0200 +-Subject: [PATCH] brcmfmac: avoid gcc-5.1 warning +- +-gcc-5.0 gained a new warning in the fwsignal portion of the brcmfmac +-driver: +- +-drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c: In function 'brcmf_fws_txs_process': +-drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c:1478:8: warning: 'skb' may be used uninitialized in this function [-Wmaybe-uninitialized] +- +-This is a false positive, and marking the brcmf_fws_hanger_poppkt function +-as 'static inline' makes the warning go away. I have checked the object +-file output and while a little code gets moved around, the size of +-the binary remains identical. +- +-Signed-off-by: Arnd Bergmann +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c +-@@ -635,7 +635,7 @@ static int brcmf_fws_hanger_pushpkt(stru +- return 0; +- } +- +--static int brcmf_fws_hanger_poppkt(struct brcmf_fws_hanger *h, +-+static inline int brcmf_fws_hanger_poppkt(struct brcmf_fws_hanger *h, +- 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 +deleted file mode 100644 +index b16782d..0000000 +--- a/package/kernel/mac80211/patches/368-brcmfmac-allow-device-tree-node-without-interrupts-p.patch ++++ /dev/null +@@ -1,45 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 20 May 2015 14:09:47 +0200 +-Subject: [PATCH] brcmfmac: allow device tree node without 'interrupts' +- property +- +-As described in the device tree bindings for 'brcm,bcm4329-fmac' +-nodes, the interrupts property is optional. So adding a check +-for the presence of this property before attempting to parse +-and map the interrupt. If not present or parsing fails return +-and fallback to in-band sdio interrupt. +- +-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/of.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/of.c +-@@ -39,10 +39,16 @@ void brcmf_of_probe(struct brcmf_sdio_de +- if (!sdiodev->pdata) +- return; +- +-+ if (of_property_read_u32(np, "brcm,drive-strength", &val) == 0) +-+ sdiodev->pdata->drive_strength = val; +-+ +-+ /* make sure there are interrupts defined in the node */ +-+ if (!of_find_property(np, "interrupts", NULL)) +-+ return; +-+ +- irq = irq_of_parse_and_map(np, 0); +- if (!irq) { +- brcmf_err("interrupt could not be mapped\n"); +-- devm_kfree(dev, sdiodev->pdata); +- return; +- } +- irqf = irqd_get_trigger_type(irq_get_irq_data(irq)); +-@@ -50,7 +56,4 @@ void brcmf_of_probe(struct brcmf_sdio_de +- sdiodev->pdata->oob_irq_supported = true; +- sdiodev->pdata->oob_irq_nr = irq; +- sdiodev->pdata->oob_irq_flags = irqf; +-- +-- 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 +deleted file mode 100644 +index f81250e..0000000 +--- a/package/kernel/mac80211/patches/369-brcmfmac-Improve-throughput-by-scheduling-msbug-flow.patch ++++ /dev/null +@@ -1,87 +0,0 @@ +-From: Hante Meuleman +-Date: Wed, 20 May 2015 14:09:48 +0200 +-Subject: [PATCH] brcmfmac: Improve throughput by scheduling msbug flow worker. +- +-The tx flow worker in msgbuf gets scheduled at tx till a certain +-threshold has been reached. Then the tx completes will take over +-the scheduling. When amsdu and ampdu is used the frames are +-transferred wireless in a very bulky fashion, in combination +-with this scheduling algorithm and buffer limiters in the stack +-this can result in limited throughput. This change causes the +-flow worker to be scheduled more frequently from tx. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Daniel (Deognyoun) Kim +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/flowring.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/flowring.c +-@@ -249,8 +249,8 @@ void brcmf_flowring_delete(struct brcmf_ +- } +- +- +--void brcmf_flowring_enqueue(struct brcmf_flowring *flow, u8 flowid, +-- struct sk_buff *skb) +-+u32 brcmf_flowring_enqueue(struct brcmf_flowring *flow, u8 flowid, +-+ struct sk_buff *skb) +- { +- struct brcmf_flowring_ring *ring; +- +-@@ -271,6 +271,7 @@ void brcmf_flowring_enqueue(struct brcmf +- if (skb_queue_len(&ring->skblist) < BRCMF_FLOWRING_LOW) +- brcmf_flowring_block(flow, flowid, false); +- } +-+ return skb_queue_len(&ring->skblist); +- } +- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/flowring.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/flowring.h +-@@ -64,8 +64,8 @@ u32 brcmf_flowring_create(struct brcmf_f +- 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); +--void brcmf_flowring_enqueue(struct brcmf_flowring *flow, u8 flowid, +-- struct sk_buff *skb); +-+u32 brcmf_flowring_enqueue(struct brcmf_flowring *flow, u8 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 *skb); +---- a/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c +-@@ -73,7 +73,7 @@ +- #define BRCMF_MSGBUF_TX_FLUSH_CNT1 32 +- #define BRCMF_MSGBUF_TX_FLUSH_CNT2 96 +- +--#define BRCMF_MSGBUF_DELAY_TXWORKER_THRS 64 +-+#define BRCMF_MSGBUF_DELAY_TXWORKER_THRS 96 +- #define BRCMF_MSGBUF_TRICKLE_TXWORKER_THRS 32 +- +- struct msgbuf_common_hdr { +-@@ -797,6 +797,8 @@ static int brcmf_msgbuf_txdata(struct br +- struct brcmf_flowring *flow = msgbuf->flow; +- struct ethhdr *eh = (struct ethhdr *)(skb->data); +- u32 flowid; +-+ u32 queue_count; +-+ bool force; +- +- flowid = brcmf_flowring_lookup(flow, eh->h_dest, skb->priority, ifidx); +- if (flowid == BRCMF_FLOWRING_INVALID_ID) { +-@@ -804,8 +806,9 @@ static int brcmf_msgbuf_txdata(struct br +- if (flowid == BRCMF_FLOWRING_INVALID_ID) +- return -ENOMEM; +- } +-- brcmf_flowring_enqueue(flow, flowid, skb); +-- brcmf_msgbuf_schedule_txdata(msgbuf, flowid, false); +-+ queue_count = brcmf_flowring_enqueue(flow, flowid, skb); +-+ force = ((queue_count % BRCMF_MSGBUF_TRICKLE_TXWORKER_THRS) == 0); +-+ brcmf_msgbuf_schedule_txdata(msgbuf, flowid, force); +- +- 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 +deleted file mode 100644 +index 61153c4..0000000 +--- a/package/kernel/mac80211/patches/370-brcmfmac-remove-pci-shared-structure-rev4-support.patch ++++ /dev/null +@@ -1,41 +0,0 @@ +-From: Franky Lin +-Date: Wed, 20 May 2015 14:09:49 +0200 +-Subject: [PATCH] brcmfmac: remove pci shared structure rev4 support +- +-All pcie full dongle chips supported by fmac are using rev 5+ shared +-structure. This patch removes the rev4 related code. +- +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Hante Meuleman +-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/pcie.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-@@ -112,10 +112,9 @@ enum brcmf_pcie_state { +- BRCMF_PCIE_MB_INT_D2H3_DB0 | \ +- BRCMF_PCIE_MB_INT_D2H3_DB1) +- +--#define BRCMF_PCIE_MIN_SHARED_VERSION 4 +-+#define BRCMF_PCIE_MIN_SHARED_VERSION 5 +- #define BRCMF_PCIE_MAX_SHARED_VERSION 5 +- #define BRCMF_PCIE_SHARED_VERSION_MASK 0x00FF +--#define BRCMF_PCIE_SHARED_TXPUSH_SUPPORT 0x4000 +- +- #define BRCMF_PCIE_FLAGS_HTOD_SPLIT 0x4000 +- #define BRCMF_PCIE_FLAGS_DTOH_SPLIT 0x8000 +-@@ -1280,11 +1279,6 @@ brcmf_pcie_init_share_ram_info(struct br +- brcmf_err("Unsupported PCIE version %d\n", version); +- return -EINVAL; +- } +-- if (shared->flags & BRCMF_PCIE_SHARED_TXPUSH_SUPPORT) { +-- brcmf_err("Unsupported legacy TX mode 0x%x\n", +-- shared->flags & BRCMF_PCIE_SHARED_TXPUSH_SUPPORT); +-- return -EINVAL; +-- } +- +- 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 +deleted file mode 100644 +index 8c8eebe..0000000 +--- a/package/kernel/mac80211/patches/371-brcmfmac-remove-dummy-cache-flush-invalidate-functio.patch ++++ /dev/null +@@ -1,120 +0,0 @@ +-From: Franky Lin +-Date: Wed, 20 May 2015 14:09:50 +0200 +-Subject: [PATCH] brcmfmac: remove dummy cache flush/invalidate function +- +-brcmf_dma_flush and brcmf_dma_invalidate_cache are not necessary and +-have never been implemented. +- +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Hante Meuleman +-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/commonring.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/commonring.c +-@@ -22,17 +22,6 @@ +- #include "core.h" +- #include "commonring.h" +- +-- +--/* dma flushing needs implementation for mips and arm platforms. Should +-- * be put in util. Note, this is not real flushing. It is virtual non +-- * cached memory. Only write buffers should have to be drained. Though +-- * this may be different depending on platform...... +-- * SEE ALSO msgbuf.c +-- */ +--#define brcmf_dma_flush(addr, len) +--#define brcmf_dma_invalidate_cache(addr, len) +-- +-- +- void brcmf_commonring_register_cb(struct brcmf_commonring *commonring, +- int (*cr_ring_bell)(void *ctx), +- int (*cr_update_rptr)(void *ctx), +-@@ -206,14 +195,9 @@ int brcmf_commonring_write_complete(stru +- address = commonring->buf_addr; +- address += (commonring->f_ptr * commonring->item_len); +- if (commonring->f_ptr > commonring->w_ptr) { +-- brcmf_dma_flush(address, +-- (commonring->depth - commonring->f_ptr) * +-- commonring->item_len); +- address = commonring->buf_addr; +- commonring->f_ptr = 0; +- } +-- brcmf_dma_flush(address, (commonring->w_ptr - commonring->f_ptr) * +-- commonring->item_len); +- +- commonring->f_ptr = commonring->w_ptr; +- +-@@ -258,8 +242,6 @@ void *brcmf_commonring_get_read_ptr(stru +- if (commonring->r_ptr == commonring->depth) +- commonring->r_ptr = 0; +- +-- brcmf_dma_invalidate_cache(ret_addr, *n_ items * commonring->item_len); +-- +- return ret_addr; +- } +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c +-@@ -278,16 +278,6 @@ struct brcmf_msgbuf_pktids { +- struct brcmf_msgbuf_pktid *array; +- }; +- +-- +--/* dma flushing needs implementation for mips and arm platforms. Should +-- * be put in util. Note, this is not real flushing. It is virtual non +-- * cached memory. Only write buffers should have to be drained. Though +-- * this may be different depending on platform...... +-- */ +--#define brcmf_dma_flush(addr, len) +--#define brcmf_dma_invalidate_cache(addr, len) +-- +-- +- static void brcmf_msgbuf_rxbuf_ioctlresp_post(struct brcmf_msgbuf *msgbuf); +- +- +-@@ -462,7 +452,6 @@ static int brcmf_msgbuf_tx_ioctl(struct +- memcpy(msgbuf->ioctbuf, buf, buf_len); +- else +- memset(msgbuf->ioctbuf, 0, buf_len); +-- brcmf_dma_flush(ioctl_buf, buf_len); +- +- err = brcmf_commonring_write_complete(commonring); +- brcmf_commonring_unlock(commonring); +---- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-@@ -276,15 +276,6 @@ static const u32 brcmf_ring_itemsize[BRC +- }; +- +- +--/* dma flushing needs implementation for mips and arm platforms. Should +-- * be put in util. Note, this is not real flushing. It is virtual non +-- * cached memory. Only write buffers should have to be drained. Though +-- * this may be different depending on platform...... +-- */ +--#define brcmf_dma_flush(addr, len) +--#define brcmf_dma_invalidate_cache(addr, len) +-- +-- +- static u32 +- brcmf_pcie_read_reg32(struct brcmf_pciedev_info *devinfo, u32 reg_offset) +- { +-@@ -1174,7 +1165,6 @@ static int brcmf_pcie_init_scratchbuffer +- goto fail; +- +- memset(devinfo->shared.scratch, 0, BRCMF_DMA_D2H_SCRATCH_BUF_LEN); +-- brcmf_dma_flush(devinfo->shared.scratch, BRCMF_DMA_D2H_SCRATCH_BUF_LEN); +- +- addr = devinfo->shared.tcm_base_address + +- BRCMF_SHARED_DMA_SCRATCH_ADDR_OFFSET; +-@@ -1192,7 +1182,6 @@ static int brcmf_pcie_init_scratchbuffer +- goto fail; +- +- memset(devinfo->shared.ringupd, 0, BRCMF_DMA_D2H_RINGUPD_BUF_LEN); +-- brcmf_dma_flush(devinfo->shared.ringupd, BRCMF_DMA_D2H_RINGUPD_BUF_LEN); +- +- 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 +deleted file mode 100644 +index 2f50abd..0000000 +--- a/package/kernel/mac80211/patches/372-brcmfmac-add-support-for-dma-indices-feature.patch ++++ /dev/null +@@ -1,270 +0,0 @@ +-From: Franky Lin +-Date: Wed, 20 May 2015 14:09:51 +0200 +-Subject: [PATCH] brcmfmac: add support for dma indices feature +- +-PCIe full dongle firmware can support a dma indices feature with which +-firmware can update/fetch the read/write indices of message buffer +-rings on both host to dongle and dongle to host directions. The support is +-announced by firmware through shared flags. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Franky Lin +-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 +-@@ -115,6 +115,8 @@ enum brcmf_pcie_state { +- #define BRCMF_PCIE_MIN_SHARED_VERSION 5 +- #define BRCMF_PCIE_MAX_SHARED_VERSION 5 +- #define BRCMF_PCIE_SHARED_VERSION_MASK 0x00FF +-+#define BRCMF_PCIE_SHARED_DMA_INDEX 0x10000 +-+#define BRCMF_PCIE_SHARED_DMA_2B_IDX 0x100000 +- +- #define BRCMF_PCIE_FLAGS_HTOD_SPLIT 0x4000 +- #define BRCMF_PCIE_FLAGS_DTOH_SPLIT 0x8000 +-@@ -146,6 +148,10 @@ enum brcmf_pcie_state { +- #define BRCMF_SHARED_RING_H2D_R_IDX_PTR_OFFSET 8 +- #define BRCMF_SHARED_RING_D2H_W_IDX_PTR_OFFSET 12 +- #define BRCMF_SHARED_RING_D2H_R_IDX_PTR_OFFSET 16 +-+#define BRCMF_SHARED_RING_H2D_WP_HADDR_OFFSET 20 +-+#define BRCMF_SHARED_RING_H2D_RP_HADDR_OFFSET 28 +-+#define BRCMF_SHARED_RING_D2H_WP_HADDR_OFFSET 36 +-+#define BRCMF_SHARED_RING_D2H_RP_HADDR_OFFSET 44 +- #define BRCMF_SHARED_RING_TCM_MEMLOC_OFFSET 0 +- #define BRCMF_SHARED_RING_MAX_SUB_QUEUES 52 +- +-@@ -247,6 +253,13 @@ struct brcmf_pciedev_info { +- bool mbdata_completed; +- bool irq_allocated; +- bool wowl_enabled; +-+ u8 dma_idx_sz; +-+ void *idxbuf; +-+ u32 idxbuf_sz; +-+ dma_addr_t idxbuf_dmahandle; +-+ u16 (*read_ptr)(struct brcmf_pciedev_info *devinfo, u32 mem_offset); +-+ void (*write_ptr)(struct brcmf_pciedev_info *devinfo, u32 mem_offset, +-+ u16 value); +- }; +- +- struct brcmf_pcie_ringbuf { +-@@ -323,6 +336,25 @@ brcmf_pcie_write_tcm16(struct brcmf_pcie +- } +- +- +-+static u16 +-+brcmf_pcie_read_idx(struct brcmf_pciedev_info *devinfo, u32 mem_offset) +-+{ +-+ u16 *address = devinfo->idxbuf + mem_offset; +-+ +-+ return (*(address)); +-+} +-+ +-+ +-+static void +-+brcmf_pcie_write_idx(struct brcmf_pciedev_info *devinfo, u32 mem_offset, +-+ u16 value) +-+{ +-+ u16 *address = devinfo->idxbuf + mem_offset; +-+ +-+ *(address) = value; +-+} +-+ +-+ +- static u32 +- brcmf_pcie_read_tcm32(struct brcmf_pciedev_info *devinfo, u32 mem_offset) +- { +-@@ -868,7 +900,7 @@ static int brcmf_pcie_ring_mb_write_rptr +- brcmf_dbg(PCIE, "W r_ptr %d (%d), ring %d\n", commonring->r_ptr, +- commonring->w_ptr, ring->id); +- +-- brcmf_pcie_write_tcm16(devinfo, ring->r_idx_addr, commonring->r_ptr); +-+ devinfo->write_ptr(devinfo, ring->r_idx_addr, commonring->r_ptr); +- +- return 0; +- } +-@@ -886,7 +918,7 @@ static int brcmf_pcie_ring_mb_write_wptr +- brcmf_dbg(PCIE, "W w_ptr %d (%d), ring %d\n", commonring->w_ptr, +- commonring->r_ptr, ring->id); +- +-- brcmf_pcie_write_tcm16(devinfo, ring->w_idx_addr, commonring->w_ptr); +-+ devinfo->write_ptr(devinfo, ring->w_idx_addr, commonring->w_ptr); +- +- return 0; +- } +-@@ -915,7 +947,7 @@ static int brcmf_pcie_ring_mb_update_rpt +- if (devinfo->state != BRCMFMAC_PCIE_STATE_UP) +- return -EIO; +- +-- commonring->r_ptr = brcmf_pcie_read_tcm16(devinfo, ring->r_idx_addr); +-+ commonring->r_ptr = devinfo->read_ptr(devinfo, ring->r_idx_addr); +- +- brcmf_dbg(PCIE, "R r_ptr %d (%d), ring %d\n", commonring->r_ptr, +- commonring->w_ptr, ring->id); +-@@ -933,7 +965,7 @@ static int brcmf_pcie_ring_mb_update_wpt +- if (devinfo->state != BRCMFMAC_PCIE_STATE_UP) +- return -EIO; +- +-- commonring->w_ptr = brcmf_pcie_read_tcm16(devinfo, ring->w_idx_addr); +-+ commonring->w_ptr = devinfo->read_ptr(devinfo, ring->w_idx_addr); +- +- brcmf_dbg(PCIE, "R w_ptr %d (%d), ring %d\n", commonring->w_ptr, +- commonring->r_ptr, ring->id); +-@@ -1038,6 +1070,13 @@ static void brcmf_pcie_release_ringbuffe +- } +- kfree(devinfo->shared.flowrings); +- devinfo->shared.flowrings = NULL; +-+ if (devinfo->idxbuf) { +-+ dma_free_coherent(&devinfo->pdev->dev, +-+ devinfo->idxbuf_sz, +-+ devinfo->idxbuf, +-+ devinfo->idxbuf_dmahandle); +-+ devinfo->idxbuf = NULL; +-+ } +- } +- +- +-@@ -1053,19 +1092,72 @@ static int brcmf_pcie_init_ringbuffers(s +- u32 addr; +- u32 ring_mem_ptr; +- u32 i; +-+ u64 address; +-+ u32 bufsz; +- u16 max_sub_queues; +-+ u8 idx_offset; +- +- ring_addr = devinfo->shared.ring_info_addr; +- brcmf_dbg(PCIE, "Base ring addr = 0x%08x\n", ring_addr); +-+ addr = ring_addr + BRCMF_SHARED_RING_MAX_SUB_QUEUES; +-+ max_sub_queues = brcmf_pcie_read_tcm16(devinfo, addr); +- +-- addr = ring_addr + BRCMF_SHARED_RING_D2H_W_IDX_PTR_OFFSET; +-- d2h_w_idx_ptr = brcmf_pcie_read_tcm32(devinfo, addr); +-- addr = ring_addr + BRCMF_SHARED_RING_D2H_R_IDX_PTR_OFFSET; +-- d2h_r_idx_ptr = brcmf_pcie_read_tcm32(devinfo, addr); +-- addr = ring_addr + BRCMF_SHARED_RING_H2D_W_IDX_PTR_OFFSET; +-- h2d_w_idx_ptr = brcmf_pcie_read_tcm32(devinfo, addr); +-- addr = ring_addr + BRCMF_SHARED_RING_H2D_R_IDX_PTR_OFFSET; +-- h2d_r_idx_ptr = brcmf_pcie_read_tcm32(devinfo, addr); +-+ if (devinfo->dma_idx_sz != 0) { +-+ bufsz = (BRCMF_NROF_D2H_COMMON_MSGRINGS + max_sub_queues) * +-+ devinfo->dma_idx_sz * 2; +-+ devinfo->idxbuf = dma_alloc_coherent(&devinfo->pdev->dev, bufsz, +-+ &devinfo->idxbuf_dmahandle, +-+ GFP_KERNEL); +-+ if (!devinfo->idxbuf) +-+ devinfo->dma_idx_sz = 0; +-+ } +-+ +-+ if (devinfo->dma_idx_sz == 0) { +-+ addr = ring_addr + BRCMF_SHARED_RING_D2H_W_IDX_PTR_OFFSET; +-+ d2h_w_idx_ptr = brcmf_pcie_read_tcm32(devinfo, addr); +-+ addr = ring_addr + BRCMF_SHARED_RING_D2H_R_IDX_PTR_OFFSET; +-+ d2h_r_idx_ptr = brcmf_pcie_read_tcm32(devinfo, addr); +-+ addr = ring_addr + BRCMF_SHARED_RING_H2D_W_IDX_PTR_OFFSET; +-+ h2d_w_idx_ptr = brcmf_pcie_read_tcm32(devinfo, addr); +-+ addr = ring_addr + BRCMF_SHARED_RING_H2D_R_IDX_PTR_OFFSET; +-+ h2d_r_idx_ptr = brcmf_pcie_read_tcm32(devinfo, addr); +-+ idx_offset = sizeof(u32); +-+ devinfo->write_ptr = brcmf_pcie_write_tcm16; +-+ devinfo->read_ptr = brcmf_pcie_read_tcm16; +-+ brcmf_dbg(PCIE, "Using TCM indices\n"); +-+ } else { +-+ memset(devinfo->idxbuf, 0, bufsz); +-+ devinfo->idxbuf_sz = bufsz; +-+ idx_offset = devinfo->dma_idx_sz; +-+ devinfo->write_ptr = brcmf_pcie_write_idx; +-+ devinfo->read_ptr = brcmf_pcie_read_idx; +-+ +-+ h2d_w_idx_ptr = 0; +-+ addr = ring_addr + BRCMF_SHARED_RING_H2D_WP_HADDR_OFFSET; +-+ address = (u64)devinfo->idxbuf_dmahandle; +-+ brcmf_pcie_write_tcm32(devinfo, addr, address & 0xffffffff); +-+ brcmf_pcie_write_tcm32(devinfo, addr + 4, address >> 32); +-+ +-+ h2d_r_idx_ptr = h2d_w_idx_ptr + max_sub_queues * idx_offset; +-+ addr = ring_addr + BRCMF_SHARED_RING_H2D_RP_HADDR_OFFSET; +-+ address += max_sub_queues * idx_offset; +-+ brcmf_pcie_write_tcm32(devinfo, addr, address & 0xffffffff); +-+ brcmf_pcie_write_tcm32(devinfo, addr + 4, address >> 32); +-+ +-+ d2h_w_idx_ptr = h2d_r_idx_ptr + max_sub_queues * idx_offset; +-+ addr = ring_addr + BRCMF_SHARED_RING_D2H_WP_HADDR_OFFSET; +-+ address += max_sub_queues * idx_offset; +-+ brcmf_pcie_write_tcm32(devinfo, addr, address & 0xffffffff); +-+ brcmf_pcie_write_tcm32(devinfo, addr + 4, address >> 32); +-+ +-+ d2h_r_idx_ptr = d2h_w_idx_ptr + +-+ BRCMF_NROF_D2H_COMMON_MSGRINGS * idx_offset; +-+ addr = ring_addr + BRCMF_SHARED_RING_D2H_RP_HADDR_OFFSET; +-+ address += BRCMF_NROF_D2H_COMMON_MSGRINGS * idx_offset; +-+ brcmf_pcie_write_tcm32(devinfo, addr, address & 0xffffffff); +-+ brcmf_pcie_write_tcm32(devinfo, addr + 4, address >> 32); +-+ brcmf_dbg(PCIE, "Using host memory indices\n"); +-+ } +- +- addr = ring_addr + BRCMF_SHARED_RING_TCM_MEMLOC_OFFSET; +- ring_mem_ptr = brcmf_pcie_read_tcm32(devinfo, addr); +-@@ -1079,8 +1171,8 @@ static int brcmf_pcie_init_ringbuffers(s +- ring->id = i; +- devinfo->shared.commonrings[i] = ring; +- +-- h2d_w_idx_ptr += sizeof(u32); +-- h2d_r_idx_ptr += sizeof(u32); +-+ h2d_w_idx_ptr += idx_offset; +-+ h2d_r_idx_ptr += idx_offset; +- ring_mem_ptr += BRCMF_RING_MEM_SZ; +- } +- +-@@ -1094,13 +1186,11 @@ static int brcmf_pcie_init_ringbuffers(s +- ring->id = i; +- devinfo->shared.commonrings[i] = ring; +- +-- d2h_w_idx_ptr += sizeof(u32); +-- d2h_r_idx_ptr += sizeof(u32); +-+ d2h_w_idx_ptr += idx_offset; +-+ d2h_r_idx_ptr += idx_offset; +- ring_mem_ptr += BRCMF_RING_MEM_SZ; +- } +- +-- addr = ring_addr + BRCMF_SHARED_RING_MAX_SUB_QUEUES; +-- max_sub_queues = brcmf_pcie_read_tcm16(devinfo, addr); +- devinfo->shared.nrof_flowrings = +- max_sub_queues - BRCMF_NROF_H2D_COMMON_MSGRINGS; +- rings = kcalloc(devinfo->shared.nrof_flowrings, sizeof(*ring), +-@@ -1124,15 +1214,15 @@ static int brcmf_pcie_init_ringbuffers(s +- ring); +- ring->w_idx_addr = h2d_w_idx_ptr; +- ring->r_idx_addr = h2d_r_idx_ptr; +-- h2d_w_idx_ptr += sizeof(u32); +-- h2d_r_idx_ptr += sizeof(u32); +-+ h2d_w_idx_ptr += idx_offset; +-+ h2d_r_idx_ptr += idx_offset; +- } +- devinfo->shared.flowrings = rings; +- +- return 0; +- +- fail: +-- brcmf_err("Allocating commonring buffers failed\n"); +-+ brcmf_err("Allocating ring buffers failed\n"); +- brcmf_pcie_release_ringbuffers(devinfo); +- return -ENOMEM; +- } +-@@ -1269,6 +1359,14 @@ brcmf_pcie_init_share_ram_info(struct br +- return -EINVAL; +- } +- +-+ /* check firmware support dma indicies */ +-+ if (shared->flags & BRCMF_PCIE_SHARED_DMA_INDEX) { +-+ if (shared->flags & BRCMF_PCIE_SHARED_DMA_2B_IDX) +-+ devinfo->dma_idx_sz = sizeof(u16); +-+ else +-+ devinfo->dma_idx_sz = sizeof(u32); +-+ } +-+ +- 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 +deleted file mode 100644 +index 28408d2..0000000 +--- a/package/kernel/mac80211/patches/373-brcmfmac-avoid-null-pointer-access-when-brcmf_msgbuf.patch ++++ /dev/null +@@ -1,102 +0,0 @@ +-From: Arend van Spriel +-Date: Tue, 26 May 2015 13:19:46 +0200 +-Subject: [PATCH] brcmfmac: avoid null pointer access when +- brcmf_msgbuf_get_pktid() fails +- +-The function brcmf_msgbuf_get_pktid() may return a NULL pointer so +-the callers should check the return pointer before accessing it to +-avoid the crash below (see [1]): +- +-brcmfmac: brcmf_msgbuf_get_pktid: Invalid packet id 273 (not in use) +-BUG: unable to handle kernel NULL pointer dereference at 0000000000000080 +-IP: [] skb_pull+0x5/0x50 +-PGD 0 +-Oops: 0000 [#1] PREEMPT SMP +-Modules linked in: pci_stub vboxpci(O) vboxnetflt(O) vboxnetadp(O) vboxdrv(O) +- snd_hda_codec_hdmi bnep mousedev hid_generic ushwmon msr ext4 crc16 mbcache +- jbd2 sd_mod uas usb_storage ahci libahci libata scsi_mod xhci_pci xhci_hcd +- usbcore usb_common +-CPU: 0 PID: 1661 Comm: irq/61-brcmf_pc Tainted: G O 4.0.1-MacbookPro-ARCH #1 +-Hardware name: Apple Inc. MacBookPro12,1/Mac-E43C1C25D4880AD6, +- BIOS MBP121.88Z.0167.B02.1503241251 03/24/2015 +-task: ffff880264203cc0 ti: ffff88025ffe4000 task.ti: ffff88025ffe4000 +-RIP: 0010:[] [] skb_pull+0x5/0x50 +-RSP: 0018:ffff88025ffe7d40 EFLAGS: 00010202 +-RAX: 0000000000000000 RBX: ffff88008a33c000 RCX: 0000000000000044 +-RDX: 0000000000000000 RSI: 000000000000004a RDI: 0000000000000000 +-RBP: ffff88025ffe7da8 R08: 0000000000000096 R09: 000000000000004a +-R10: 0000000000000000 R11: 000000000000048e R12: ffff88025ff14f00 +-R13: 0000000000000000 R14: ffff880263b48200 R15: ffff88008a33c000 +-FS: 0000000000000000(0000) GS:ffff88026ec00000(0000) knlGS:0000000000000000 +-CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 +-CR2: 0000000000000080 CR3: 000000000180b000 CR4: 00000000003407f0 +-Stack: +- ffffffffa06aed74 ffff88025ffe7dc8 ffff880263b48270 ffff880263b48278 +- 05ea88020000004a 0002ffff81014635 000000001720b2f6 ffff88026ec116c0 +- ffff880263b48200 0000000000010000 ffff880263b4ae00 ffff880264203cc0 +-Call Trace: +- [] ? brcmf_msgbuf_process_rx+0x404/0x480 [brcmfmac] +- [] ? irq_finalize_oneshot.part.30+0xf0/0xf0 +- [] brcmf_proto_msgbuf_rx_trigger+0x35/0xf0 [brcmfmac] +- [] brcmf_pcie_isr_thread_v2+0x8a/0x130 [brcmfmac] +- [] irq_thread_fn+0x20/0x50 +- [] irq_thread+0x13f/0x170 +- [] ? wake_threads_waitq+0x30/0x30 +- [] ? irq_thread_dtor+0xb0/0xb0 +- [] kthread+0xd8/0xf0 +- [] ? kthread_create_on_node+0x1c0/0x1c0 +- [] ret_from_fork+0x58/0x90 +- [] ? kthread_create_on_node+0x1c0/0x1c0 +-Code: 01 83 e2 f7 88 50 01 48 83 c4 08 5b 5d f3 c3 0f 1f 80 00 00 00 00 83 e2 +- f7 88 50 01 c3 66 0f 1f 84 00 00 00 00 00 0f 1f +-RIP [] skb_pull+0x5/0x50 +- RSP +-CR2: 0000000000000080 +----[ end trace b074c0f90e7c997d ]--- +- +-[1] http://mid.gmane.org/20150430193259.GA5630@googlemail.com +- +-Cc: # v3.18, v3.19, v4.0, v4.1 +-Reported-by: Michael Hornung +-Reviewed-by: Hante Meuleman +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Arend van Spriel +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c +-@@ -500,11 +500,9 @@ static int brcmf_msgbuf_query_dcmd(struc +- msgbuf->rx_pktids, +- msgbuf->ioctl_resp_pktid); +- if (msgbuf->ioctl_resp_ret_len != 0) { +-- if (!skb) { +-- brcmf_err("Invalid packet id idx recv'd %d\n", +-- msgbuf->ioctl_resp_pktid); +-+ if (!skb) +- return -EBADF; +-- } +-+ +- memcpy(buf, skb->data, (len < msgbuf->ioctl_resp_ret_len) ? +- len : msgbuf->ioctl_resp_ret_len); +- } +-@@ -866,10 +864,8 @@ brcmf_msgbuf_process_txstatus(struct brc +- flowid -= BRCMF_NROF_H2D_COMMON_MSGRINGS; +- skb = brcmf_msgbuf_get_pktid(msgbuf->drvr->bus_if->dev, +- msgbuf->tx_pktids, idx); +-- if (!skb) { +-- brcmf_err("Invalid packet id idx recv'd %d\n", idx); +-+ if (!skb) +- return; +-- } +- +- set_bit(flowid, msgbuf->txstatus_done_map); +- commonring = msgbuf->flowrings[flowid]; +-@@ -1148,6 +1144,8 @@ brcmf_msgbuf_process_rx_complete(struct +- +- skb = brcmf_msgbuf_get_pktid(msgbuf->drvr->bus_if->dev, +- msgbuf->rx_pktids, idx); +-+ if (!skb) +-+ return; +- +- 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 +deleted file mode 100644 +index f023034..0000000 +--- a/package/kernel/mac80211/patches/374-brcmfmac-fix-invalid-access-to-struct-acpi_device-fi.patch ++++ /dev/null +@@ -1,63 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 27 May 2015 19:31:41 +0200 +-Subject: [PATCH] brcmfmac: fix invalid access to struct acpi_device fields +- +-The fields of struct acpi_device are only known when CONFIG_ACPI is +-defined. Fix this by using a helper function. This will resolve the +-issue found in linux-next: +- +- ../brcmfmac/bcmsdh.c: In function 'brcmf_ops_sdio_probe': +- ../brcmfmac/bcmsdh.c:1139:7: error: dereferencing pointer to incomplete type +- adev->flags.power_manageable = 0; +- ^ +- +-Fixes: f0992ace680c ("brcmfmac: prohibit ACPI power management ...") +-Cc: Fu, Zhonghui +-Reported-by: Stephen Rothwell +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +-@@ -1117,6 +1117,18 @@ MODULE_DEVICE_TABLE(sdio, brcmf_sdmmc_id +- static struct brcmfmac_sdio_platform_data *brcmfmac_sdio_pdata; +- +- +-+static void brcmf_sdiod_acpi_set_power_manageable(struct device *dev, +-+ int val) +-+{ +-+#if IS_ENABLED(CONFIG_ACPI) +-+ struct acpi_device *adev; +-+ +-+ adev = ACPI_COMPANION(dev); +-+ if (adev) +-+ adev->flags.power_manageable = 0; +-+#endif +-+} +-+ +- static int brcmf_ops_sdio_probe(struct sdio_func *func, +- const struct sdio_device_id *id) +- { +-@@ -1124,7 +1136,6 @@ static int brcmf_ops_sdio_probe(struct s +- struct brcmf_sdio_dev *sdiodev; +- struct brcmf_bus *bus_if; +- struct device *dev; +-- struct acpi_device *adev; +- +- brcmf_dbg(SDIO, "Enter\n"); +- brcmf_dbg(SDIO, "Class=%x\n", func->class); +-@@ -1132,11 +1143,9 @@ static int brcmf_ops_sdio_probe(struct s +- brcmf_dbg(SDIO, "sdio device ID: 0x%04x\n", func->device); +- brcmf_dbg(SDIO, "Function#: %d\n", func->num); +- +-- /* prohibit ACPI power management for this device */ +- dev = &func->dev; +-- adev = ACPI_COMPANION(dev); +-- if (adev) +-- adev->flags.power_manageable = 0; +-+ /* prohibit ACPI power management for this device */ +-+ brcmf_sdiod_acpi_set_power_manageable(dev, 0); +- +- /* 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 +deleted file mode 100644 +index 2bfd44f..0000000 +--- a/package/kernel/mac80211/patches/375-brcmfmac-simplify-check-stripping-v2-NVRAM.patch ++++ /dev/null +@@ -1,56 +0,0 @@ +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Wed, 20 May 2015 09:34:21 +0200 +-Subject: [PATCH] brcmfmac: simplify check stripping v2 NVRAM +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-Comparing NVRAM entry with a full filtering string is simpler than +-comparing it with a short prefix and then checking random chars at magic +-offsets. The cost of snprintf relatively low, we execute it just once. +-Tested on BCM43602 with NVRAM hacked to use V2 format. +- +-Signed-off-by: Rafał Miłecki +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/firmware.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/firmware.c +-@@ -25,7 +25,7 @@ +- +- #define BRCMF_FW_MAX_NVRAM_SIZE 64000 +- #define BRCMF_FW_NVRAM_DEVPATH_LEN 19 /* devpath0=pcie/1/4/ */ +--#define BRCMF_FW_NVRAM_PCIEDEV_LEN 9 /* pcie/1/4/ */ +-+#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, +-@@ -297,6 +297,8 @@ fail: +- static void brcmf_fw_strip_multi_v2(struct nvram_parser *nvp, u16 domain_nr, +- u16 bus_nr) +- { +-+ char prefix[BRCMF_FW_NVRAM_PCIEDEV_LEN]; +-+ size_t len; +- u32 i, j; +- u8 *nvram; +- +-@@ -308,14 +310,13 @@ static void brcmf_fw_strip_multi_v2(stru +- * Valid entries are of type pcie/X/Y/ where X = domain_nr and +- * Y = bus_nr. +- */ +-+ snprintf(prefix, sizeof(prefix), "pcie/%d/%d/", domain_nr, bus_nr); +-+ len = strlen(prefix); +- i = 0; +- j = 0; +-- while (i < nvp->nvram_len - BRCMF_FW_NVRAM_PCIEDEV_LEN) { +-- if ((strncmp(&nvp->nvram[i], "pcie/", 5) == 0) && +-- (nvp->nvram[i + 6] == '/') && (nvp->nvram[i + 8] == '/') && +-- ((nvp->nvram[i + 5] - '0') == domain_nr) && +-- ((nvp->nvram[i + 7] - '0') == bus_nr)) { +-- i += BRCMF_FW_NVRAM_PCIEDEV_LEN; +-+ while (i < nvp->nvram_len - len) { +-+ if (strncmp(&nvp->nvram[i], prefix, len) == 0) { +-+ i += len; +- 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 +deleted file mode 100644 +index 0e65114..0000000 +--- a/package/kernel/mac80211/patches/376-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?= +-Date: Wed, 20 May 2015 11:01:08 +0200 +-Subject: [PATCH] brcmfmac: simplify check finding NVRAM v1 device path +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-With a simple use of snprintf and small buffer we can compare NVRAM +-entry value with a full string. This way we avoid checking random chars +-at magic offsets. +-Tested on BCM43602 with NVRAM hacked to use v1 format. +- +-Signed-off-by: Rafał Miłecki +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/firmware.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/firmware.c +-@@ -222,6 +222,10 @@ static int brcmf_init_nvram_parser(struc +- static void brcmf_fw_strip_multi_v1(struct nvram_parser *nvp, u16 domain_nr, +- u16 bus_nr) +- { +-+ /* Device path with a leading '=' key-value separator */ +-+ char pcie_path[] = "=pcie/?/?"; +-+ size_t pcie_len; +-+ +- u32 i, j; +- bool found; +- u8 *nvram; +-@@ -238,6 +242,9 @@ static void brcmf_fw_strip_multi_v1(stru +- /* First search for the devpathX and see if it is the configuration +- * for domain_nr/bus_nr. Search complete nvp +- */ +-+ snprintf(pcie_path, sizeof(pcie_path), "=pcie/%d/%d", domain_nr, +-+ bus_nr); +-+ pcie_len = strlen(pcie_path); +- found = false; +- i = 0; +- while (i < nvp->nvram_len - BRCMF_FW_NVRAM_DEVPATH_LEN) { +-@@ -245,13 +252,10 @@ static void brcmf_fw_strip_multi_v1(stru +- * Y = domain_nr, Z = bus_nr, X = virtual ID +- */ +- if ((strncmp(&nvp->nvram[i], "devpath", 7) == 0) && +-- (strncmp(&nvp->nvram[i + 8], "=pcie/", 6) == 0)) { +-- if (((nvp->nvram[i + 14] - '0') == domain_nr) && +-- ((nvp->nvram[i + 16] - '0') == bus_nr)) { +-- id = nvp->nvram[i + 7] - '0'; +-- found = true; +-- break; +-- } +-+ (strncmp(&nvp->nvram[i + 8], pcie_path, pcie_len) == 0)) { +-+ id = nvp->nvram[i + 7] - '0'; +-+ found = true; +-+ break; +- } +- 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 +deleted file mode 100644 +index dc174e5..0000000 +--- a/package/kernel/mac80211/patches/377-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?= +-Date: Wed, 20 May 2015 13:59:54 +0200 +-Subject: [PATCH] brcmfmac: treat \0 as end of comment when parsing NVRAM +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-This fixes brcmfmac dealing with NVRAM coming from platform e.g. from a +-flash MTD partition. In such cases entries are separated by \0 instead +-of \n which caused ignoring whole content after the first "comment". +-While platform NVRAM doesn't usually contain comments, we switch to +-COMMENT state after e.g. finding an unexpected char in key name. +- +-Signed-off-by: Rafał Miłecki +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/firmware.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/firmware.c +-@@ -162,17 +162,20 @@ brcmf_nvram_handle_value(struct nvram_pa +- static enum nvram_parser_state +- brcmf_nvram_handle_comment(struct nvram_parser *nvp) +- { +-- char *eol, *sol; +-+ char *eoc, *sol; +- +- sol = (char *)&nvp->fwnv->data[nvp->pos]; +-- eol = strchr(sol, '\n'); +-- if (eol == NULL) +-- return END; +-+ eoc = strchr(sol, '\n'); +-+ if (!eoc) { +-+ eoc = strchr(sol, '\0'); +-+ if (!eoc) +-+ return END; +-+ } +- +- /* eat all moving to next line */ +- nvp->line++; +- nvp->column = 1; +-- nvp->pos += (eol - sol) + 1; +-+ nvp->pos += (eoc - sol) + 1; +- 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 +deleted file mode 100644 +index 5700142..0000000 +--- a/package/kernel/mac80211/patches/378-brcmfmac-allow-NVRAM-values-to-contain-spaces.patch ++++ /dev/null +@@ -1,50 +0,0 @@ +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Sat, 23 May 2015 09:15:33 +0200 +-Subject: [PATCH] brcmfmac: allow NVRAM values to contain spaces +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-Platform NVRAMs often contain values with spaces. Even if right now most +-firmware-supported entries are simple values, we shouldn't reject these +-with spaces. It was semi-confirmed by Broadcom in the early patch adding +-support for platform NVRAMs. +- +-Signed-off-by: Rafał Miłecki +-Acked-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 +-@@ -66,6 +66,12 @@ struct nvram_parser { +- bool multi_dev_v2; +- }; +- +-+/** +-+ * is_nvram_char() - check if char is a valid one for NVRAM entry +-+ * +-+ * It accepts all printable ASCII chars except for '#' which opens a comment. +-+ * Please note that ' ' (space) while accepted is not a valid key name char. +-+ */ +- static bool is_nvram_char(char c) +- { +- /* comment marker excluded */ +-@@ -73,7 +79,7 @@ static bool is_nvram_char(char c) +- return false; +- +- /* key and value may have any other readable character */ +-- return (c > 0x20 && c < 0x7f); +-+ return (c >= 0x20 && c < 0x7f); +- } +- +- static bool is_whitespace(char c) +-@@ -120,7 +126,7 @@ static enum nvram_parser_state brcmf_nvr +- nvp->multi_dev_v1 = true; +- if (strncmp(&nvp->fwnv->data[nvp->entry], "pcie/", 5) == 0) +- nvp->multi_dev_v2 = true; +-- } else if (!is_nvram_char(c)) { +-+ } else if (!is_nvram_char(c) || c == ' ') { +- 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 +deleted file mode 100644 +index 814b0d7..0000000 +--- a/package/kernel/mac80211/patches/379-ath9k-fix-DMA-stop-sequence-for-AR9003.patch ++++ /dev/null +@@ -1,33 +0,0 @@ +-From: Felix Fietkau +-Date: Tue, 2 Jun 2015 10:35:46 +0200 +-Subject: [PATCH] ath9k: fix DMA stop sequence for AR9003+ +- +-AR93xx and newer needs to stop rx before tx to avoid getting the DMA +-engine or MAC into a stuck state. +-This should reduce/fix the occurence of "Failed to stop Tx DMA" logspam. +- +-Cc: stable@vger.kernel.org +-Signed-off-by: Felix Fietkau +---- +- +---- a/drivers/net/wireless/ath/ath9k/main.c +-+++ b/drivers/net/wireless/ath/ath9k/main.c +-@@ -216,11 +216,13 @@ static bool ath_prepare_reset(struct ath +- ath_stop_ani(sc); +- ath9k_hw_disable_interrupts(ah); +- +-- if (!ath_drain_all_txq(sc)) +-- ret = false; +-- +-- if (!ath_stoprecv(sc)) +-- ret = false; +-+ if (AR_SREV_9300_20_OR_LATER(ah)) { +-+ ret &= ath_stoprecv(sc); +-+ ret &= ath_drain_all_txq(sc); +-+ } else { +-+ ret &= ath_drain_all_txq(sc); +-+ ret &= ath_stoprecv(sc); +-+ } +- +- 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 +deleted file mode 100644 +index 7bbd57e..0000000 +--- a/package/kernel/mac80211/patches/380-brcmfmac-support-NVRAMs-containing-pci-devpaths-inst.patch ++++ /dev/null +@@ -1,56 +0,0 @@ +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Thu, 28 May 2015 14:19:21 +0200 +-Subject: [PATCH] brcmfmac: support NVRAMs containing pci devpaths (instead of +- pcie) +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-Recently Broadcom added support for NVRAMs with entries for multiple +-PCIe devices. One of the supported formats is based on prefixes defined +-like: devpath0=pcie/1/4/ and entries like 0:foo=bar 0:baz=qux etc. +- +-Unfortunately there are also a bit older devices using different way of +-defining prefixes, e.g. SmartRG SR400ac (2 x BCM43602) with entries: +-devpath0=pci/1/1/ +-devpath1=pci/2/1 +-Broadcom stated this old format will never be used/supported by brcmfmac +-but given the simplicity of this patch I'll insist on supporting it. +- +-Signed-off-by: Rafał Miłecki +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/firmware.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/firmware.c +-@@ -232,6 +232,8 @@ static void brcmf_fw_strip_multi_v1(stru +- u16 bus_nr) +- { +- /* Device path with a leading '=' key-value separator */ +-+ char pci_path[] = "=pci/?/?"; +-+ size_t pci_len; +- char pcie_path[] = "=pcie/?/?"; +- size_t pcie_len; +- +-@@ -251,6 +253,9 @@ static void brcmf_fw_strip_multi_v1(stru +- /* First search for the devpathX and see if it is the configuration +- * for domain_nr/bus_nr. Search complete nvp +- */ +-+ snprintf(pci_path, sizeof(pci_path), "=pci/%d/%d", domain_nr, +-+ bus_nr); +-+ pci_len = strlen(pci_path); +- snprintf(pcie_path, sizeof(pcie_path), "=pcie/%d/%d", domain_nr, +- bus_nr); +- pcie_len = strlen(pcie_path); +-@@ -260,8 +265,9 @@ static void brcmf_fw_strip_multi_v1(stru +- /* Format: devpathX=pcie/Y/Z/ +- * Y = domain_nr, Z = bus_nr, X = virtual ID +- */ +-- if ((strncmp(&nvp->nvram[i], "devpath", 7) == 0) && +-- (strncmp(&nvp->nvram[i + 8], pcie_path, pcie_len) == 0)) { +-+ if (strncmp(&nvp->nvram[i], "devpath", 7) == 0 && +-+ (!strncmp(&nvp->nvram[i + 8], pci_path, pci_len) || +-+ !strncmp(&nvp->nvram[i + 8], pcie_path, pcie_len))) { +- 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 +deleted file mode 100644 +index 1eff6ed..0000000 +--- a/package/kernel/mac80211/patches/381-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?= +-Date: Sun, 31 May 2015 02:52:26 +0200 +-Subject: [PATCH] brcmfmac: set wiphy perm_addr to hardware MAC address +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-This allows e.g. user space to use /sys/class/ieee80211/*/macaddress +- +-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 +-@@ -6070,6 +6070,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802 +- brcmf_err("Could not allocate wiphy device\n"); +- return NULL; +- } +-+ memcpy(wiphy->perm_addr, drvr->mac, ETH_ALEN); +- 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 +deleted file mode 100644 +index c6e83dd..0000000 +--- a/package/kernel/mac80211/patches/382-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?= +-Date: Thu, 4 Jun 2015 22:11:07 +0200 +-Subject: [PATCH] brcmfmac: use direct data pointer in NVRAM parser struct +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-As we plan to add support for platform NVRAM we should store direct +-data pointer without the extra struct firmware layer. This will allow +-us to support other sources with the only requirement being u8 buffer. +- +-Signed-off-by: Rafał Miłecki +-Acked-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 +-@@ -43,7 +43,7 @@ enum nvram_parser_state { +- * struct nvram_parser - internal info for parser. +- * +- * @state: current parser state. +-- * @fwnv: input buffer being parsed. +-+ * @data: input buffer being parsed. +- * @nvram: output buffer with parse result. +- * @nvram_len: lenght of parse result. +- * @line: current line. +-@@ -55,7 +55,7 @@ enum nvram_parser_state { +- */ +- struct nvram_parser { +- enum nvram_parser_state state; +-- const struct firmware *fwnv; +-+ const u8 *data; +- u8 *nvram; +- u32 nvram_len; +- u32 line; +-@@ -91,7 +91,7 @@ static enum nvram_parser_state brcmf_nvr +- { +- char c; +- +-- c = nvp->fwnv->data[nvp->pos]; +-+ c = nvp->data[nvp->pos]; +- if (c == '\n') +- return COMMENT; +- if (is_whitespace(c)) +-@@ -115,16 +115,16 @@ static enum nvram_parser_state brcmf_nvr +- enum nvram_parser_state st = nvp->state; +- char c; +- +-- c = nvp->fwnv->data[nvp->pos]; +-+ c = nvp->data[nvp->pos]; +- if (c == '=') { +- /* ignore RAW1 by treating as comment */ +-- if (strncmp(&nvp->fwnv->data[nvp->entry], "RAW1", 4) == 0) +-+ if (strncmp(&nvp->data[nvp->entry], "RAW1", 4) == 0) +- st = COMMENT; +- else +- st = VALUE; +-- if (strncmp(&nvp->fwnv->data[nvp->entry], "devpath", 7) == 0) +-+ if (strncmp(&nvp->data[nvp->entry], "devpath", 7) == 0) +- nvp->multi_dev_v1 = true; +-- if (strncmp(&nvp->fwnv->data[nvp->entry], "pcie/", 5) == 0) +-+ if (strncmp(&nvp->data[nvp->entry], "pcie/", 5) == 0) +- nvp->multi_dev_v2 = true; +- } else if (!is_nvram_char(c) || c == ' ') { +- brcmf_dbg(INFO, "warning: ln=%d:col=%d: '=' expected, skip invalid key entry\n", +-@@ -145,11 +145,11 @@ brcmf_nvram_handle_value(struct nvram_pa +- char *ekv; +- u32 cplen; +- +-- c = nvp->fwnv->data[nvp->pos]; +-+ c = nvp->data[nvp->pos]; +- if (!is_nvram_char(c)) { +- /* key,value pair complete */ +-- ekv = (u8 *)&nvp->fwnv->data[nvp->pos]; +-- skv = (u8 *)&nvp->fwnv->data[nvp->entry]; +-+ ekv = (u8 *)&nvp->data[nvp->pos]; +-+ skv = (u8 *)&nvp->data[nvp->entry]; +- cplen = ekv - skv; +- if (nvp->nvram_len + cplen + 1 >= BRCMF_FW_MAX_NVRAM_SIZE) +- return END; +-@@ -170,7 +170,7 @@ brcmf_nvram_handle_comment(struct nvram_ +- { +- char *eoc, *sol; +- +-- sol = (char *)&nvp->fwnv->data[nvp->pos]; +-+ sol = (char *)&nvp->data[nvp->pos]; +- eoc = strchr(sol, '\n'); +- if (!eoc) { +- eoc = strchr(sol, '\0'); +-@@ -201,17 +201,17 @@ static enum nvram_parser_state +- }; +- +- static int brcmf_init_nvram_parser(struct nvram_parser *nvp, +-- const struct firmware *nv) +-+ const u8 *data, size_t data_len) +- { +- size_t size; +- +- memset(nvp, 0, sizeof(*nvp)); +-- nvp->fwnv = nv; +-+ nvp->data = data; +- /* Limit size to MAX_NVRAM_SIZE, some files contain lot of comment */ +-- if (nv->size > BRCMF_FW_MAX_NVRAM_SIZE) +-+ if (data_len > BRCMF_FW_MAX_NVRAM_SIZE) +- size = BRCMF_FW_MAX_NVRAM_SIZE; +- else +-- size = nv->size; +-+ size = data_len; +- /* Alloc for extra 0 byte + roundup by 4 + length field */ +- size += 1 + 3 + sizeof(u32); +- nvp->nvram = kzalloc(size, GFP_KERNEL); +-@@ -362,18 +362,18 @@ fail: +- * and converts newlines to NULs. Shortens buffer as needed and pads with NULs. +- * End of buffer is completed with token identifying length of buffer. +- */ +--static void *brcmf_fw_nvram_strip(const struct firmware *nv, u32 *new_length, +-- u16 domain_nr, u16 bus_nr) +-+static void *brcmf_fw_nvram_strip(const u8 *data, size_t data_len, +-+ u32 *new_length, u16 domain_nr, u16 bus_nr) +- { +- struct nvram_parser nvp; +- u32 pad; +- u32 token; +- __le32 token_le; +- +-- if (brcmf_init_nvram_parser(&nvp, nv) < 0) +-+ if (brcmf_init_nvram_parser(&nvp, data, data_len) < 0) +- return NULL; +- +-- while (nvp.pos < nv->size) { +-+ while (nvp.pos < data_len) { +- nvp.state = nv_parser_states[nvp.state](&nvp); +- if (nvp.state == END) +- break; +-@@ -432,7 +432,7 @@ static void brcmf_fw_request_nvram_done( +- goto fail; +- +- if (fw) { +-- nvram = brcmf_fw_nvram_strip(fw, &nvram_length, +-+ nvram = brcmf_fw_nvram_strip(fw->data, fw->size, &nvram_length, +- 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 +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 ++++ /dev/null +@@ -1,32 +0,0 @@ +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Sat, 6 Jun 2015 22:45:59 +0200 +-Subject: [PATCH] b43: fix support for 14e4:4321 PCI dev with BCM4321 chipset +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-It seems Broadcom released two devices with conflicting device id. There +-are for sure 14e4:4321 PCI devices with BCM4321 (N-PHY) chipset, they +-can be found in routers, e.g. Netgear WNR834Bv2. However, according to +-Broadcom public sources 0x4321 is also used for 5 GHz BCM4306 (G-PHY). +-It's unsure if they meant PCI device id, or "virtual" id (from SPROM). +-To distinguish these devices lets check PHY type (G vs. N). +- +-Signed-off-by: Rafał Miłecki +-Cc: # 3.16+ +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/b43/main.c +-+++ b/drivers/net/wireless/b43/main.c +-@@ -5365,6 +5365,10 @@ static void b43_supported_bands(struct b +- *have_5ghz_phy = true; +- return; +- case 0x4321: /* BCM4306 */ +-+ /* There are 14e4:4321 PCI devs with 2.4 GHz BCM4321 (N-PHY) */ +-+ if (dev->phy.type != B43_PHYTYPE_G) +-+ break; +-+ /* fall through */ +- 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 +deleted file mode 100644 +index bddb15a..0000000 +--- a/package/kernel/mac80211/patches/384-ath9k-force-rx_clear-when-disabling-rx.patch ++++ /dev/null +@@ -1,31 +0,0 @@ +-From: Felix Fietkau +-Date: Sun, 7 Jun 2015 13:53:35 +0200 +-Subject: [PATCH] ath9k: force rx_clear when disabling rx +- +-This makes stopping Rx more reliable and should reduce the frequency of +-Rx related DMA stop warnings +- +-Cc: stable@vger.kernel.org +-Signed-off-by: Felix Fietkau +---- +- +---- a/drivers/net/wireless/ath/ath9k/mac.c +-+++ b/drivers/net/wireless/ath/ath9k/mac.c +-@@ -677,13 +677,15 @@ void ath9k_hw_startpcureceive(struct ath +- +- ath9k_ani_reset(ah, is_scanning); +- +-- REG_CLR_BIT(ah, AR_DIAG_SW, (AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT)); +-+ REG_CLR_BIT(ah, AR_DIAG_SW, +-+ AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT | AR_DIAG_FORCE_RX_CLEAR); +- } +- EXPORT_SYMBOL(ath9k_hw_startpcureceive); +- +- void ath9k_hw_abortpcurecv(struct ath_hw *ah) +- { +-- REG_SET_BIT(ah, AR_DIAG_SW, AR_DIAG_RX_ABORT | AR_DIAG_RX_DIS); +-+ REG_SET_BIT(ah, AR_DIAG_SW, +-+ AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT | AR_DIAG_FORCE_RX_CLEAR); +- +- 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 +deleted file mode 100644 +index 74df9f9..0000000 +--- a/package/kernel/mac80211/patches/385-brcmfmac-Update-msgbuf-read-pointer-quicker.patch ++++ /dev/null +@@ -1,109 +0,0 @@ +-From: Hante Meuleman +-Date: Mon, 8 Jun 2015 14:38:32 +0200 +-Subject: [PATCH] brcmfmac: Update msgbuf read pointer quicker. +- +-On device to host data using msgbuf the read pointer gets updated +-once all data is processed. Updating this pointer more frequently +-allows the firmware to add more data quicker. This will result in +-slightly higher and more stable throughput on CPU bounded host +-processors. +- +-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/commonring.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/commonring.c +-@@ -223,8 +223,6 @@ void brcmf_commonring_write_cancel(struc +- void *brcmf_commonring_get_read_ptr(struct brcmf_commonring *commonring, +- u16 *n_items) +- { +-- void *ret_addr; +-- +- if (commonring->cr_update_wptr) +- commonring->cr_update_wptr(commonring->cr_ctx); +- +-@@ -235,19 +233,18 @@ void *brcmf_commonring_get_read_ptr(stru +- if (*n_items == 0) +- return NULL; +- +-- ret_addr = commonring->buf_addr + +-- (commonring->r_ptr * commonring->item_len); +-- +-- commonring->r_ptr += *n_items; +-- if (commonring->r_ptr == commonring->depth) +-- commonring->r_ptr = 0; +-- +-- return ret_addr; +-+ return commonring->buf_addr + +-+ (commonring->r_ptr * commonring->item_len); +- } +- +- +--int brcmf_commonring_read_complete(struct brcmf_commonring *commonring) +-+int brcmf_commonring_read_complete(struct brcmf_commonring *commonring, +-+ u16 n_items) +- { +-+ commonring->r_ptr += n_items; +-+ if (commonring->r_ptr == commonring->depth) +-+ commonring->r_ptr = 0; +-+ +- if (commonring->cr_write_rptr) +- return commonring->cr_write_rptr(commonring->cr_ctx); +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/commonring.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/commonring.h +-@@ -62,7 +62,8 @@ void brcmf_commonring_write_cancel(struc +- u16 n_items); +- void *brcmf_commonring_get_read_ptr(struct brcmf_commonring *commonring, +- u16 *n_items); +--int brcmf_commonring_read_complete(struct brcmf_commonring *commonring); +-+int brcmf_commonring_read_complete(struct brcmf_commonring *commonring, +-+ u16 n_items); +- +- #define brcmf_commonring_n_items(commonring) (commonring->depth) +- #define brcmf_commonring_len_item(commonring) (commonring->item_len) +---- a/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c +-@@ -75,6 +75,8 @@ +- +- #define BRCMF_MSGBUF_DELAY_TXWORKER_THRS 96 +- #define BRCMF_MSGBUF_TRICKLE_TXWORKER_THRS 32 +-+#define BRCMF_MSGBUF_UPDATE_RX_PTR_THRS 48 +-+ +- +- struct msgbuf_common_hdr { +- u8 msgtype; +-@@ -1257,19 +1259,27 @@ static void brcmf_msgbuf_process_rx(stru +- { +- void *buf; +- u16 count; +-+ u16 processed; +- +- again: +- buf = brcmf_commonring_get_read_ptr(commonring, &count); +- if (buf == NULL) +- return; +- +-+ processed = 0; +- while (count) { +- brcmf_msgbuf_process_msgtype(msgbuf, +- buf + msgbuf->rx_dataoffset); +- buf += brcmf_commonring_len_item(commonring); +-+ processed++; +-+ if (processed == BRCMF_MSGBUF_UPDATE_RX_PTR_THRS) { +-+ brcmf_commonring_read_complete(commonring, processed); +-+ processed = 0; +-+ } +- count--; +- } +-- brcmf_commonring_read_complete(commonring); +-+ if (processed) +-+ brcmf_commonring_read_complete(commonring, processed); +- +- 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 +deleted file mode 100644 +index 9e5b486..0000000 +--- a/package/kernel/mac80211/patches/386-brcmfmac-remove-chipinfo-debugfs-entry.patch ++++ /dev/null +@@ -1,39 +0,0 @@ +-From: Arend van Spriel +-Date: Mon, 8 Jun 2015 14:38:33 +0200 +-Subject: [PATCH] brcmfmac: remove chipinfo debugfs entry +- +-The information provided by chipinfo is also provided by the +-revinfo debugfs entry. Removing it from debugfs. +- +-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.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/debug.c +-@@ -41,15 +41,6 @@ void brcmf_debugfs_exit(void) +- root_folder = NULL; +- } +- +--static int brcmf_debugfs_chipinfo_read(struct seq_file *seq, void *data) +--{ +-- struct brcmf_bus *bus = dev_get_drvdata(seq->private); +-- +-- seq_printf(seq, "chip: %x(%u) rev %u\n", +-- bus->chip, bus->chip, bus->chiprev); +-- return 0; +--} +-- +- int brcmf_debugfs_attach(struct brcmf_pub *drvr) +- { +- struct device *dev = drvr->bus_if->dev; +-@@ -58,7 +49,6 @@ int brcmf_debugfs_attach(struct brcmf_pu +- return -ENODEV; +- +- drvr->dbgfs_dir = debugfs_create_dir(dev_name(dev), root_folder); +-- brcmf_debugfs_add_entry(drvr, "chipinfo", brcmf_debugfs_chipinfo_read); +- +- 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 +deleted file mode 100644 +index c38b2cd..0000000 +--- a/package/kernel/mac80211/patches/387-brcmfmac-remove-watchdog-reset-from-brcmf_pcie_busco.patch ++++ /dev/null +@@ -1,53 +0,0 @@ +-From: Arend van Spriel +-Date: Mon, 8 Jun 2015 14:38:34 +0200 +-Subject: [PATCH] brcmfmac: remove watchdog reset from +- brcmf_pcie_buscoreprep() +- +-The watchdog reset as done in brcmf_pcie_buscoreprep() is not +-sufficient. It needs to modify PCIe core registers as well +-which is properly done by brcmf_pcie_reset_device() after the +-chip recognition is done. So the faulty watchdog reset can be +-removed as it was causing driver reload to fail and hang the +-system requiring a power-cycle. Instead the call to to the +-brcmf_pcie_reset_device() function is done twice in the unload. +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Daniel (Deognyoun) Kim +-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/pcie.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-@@ -1629,20 +1629,7 @@ static void brcmf_pcie_buscore_write32(v +- +- static int brcmf_pcie_buscoreprep(void *ctx) +- { +-- struct brcmf_pciedev_info *devinfo = (struct brcmf_pciedev_info *)ctx; +-- int err; +-- +-- err = brcmf_pcie_get_resource(devinfo); +-- if (err == 0) { +-- /* Set CC watchdog to reset all the cores on the chip to bring +-- * back dongle to a sane state. +-- */ +-- brcmf_pcie_buscore_write32(ctx, CORE_CC_REG(SI_ENUM_BASE, +-- watchdog), 4); +-- msleep(100); +-- } +-- +-- return err; +-+ return brcmf_pcie_get_resource(ctx); +- } +- +- +-@@ -1824,6 +1811,7 @@ brcmf_pcie_remove(struct pci_dev *pdev) +- brcmf_pcie_intr_disable(devinfo); +- +- brcmf_detach(&pdev->dev); +-+ brcmf_pcie_reset_device(devinfo); +- +- 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 +deleted file mode 100644 +index 756fbb2..0000000 +--- a/package/kernel/mac80211/patches/388-brcmfmac-use-debugfs_create_devm_seqfile-helper-func.patch ++++ /dev/null +@@ -1,69 +0,0 @@ +-From: Arend van Spriel +-Date: Mon, 8 Jun 2015 14:38:35 +0200 +-Subject: [PATCH] brcmfmac: use debugfs_create_devm_seqfile() helper +- function +- +-Some time ago the function debugfs_create_devm_seqfile() was +-introduced in debugfs. The caller simply needs to provide a +-device pointer and read function. The function brcmf_debugfs_add_entry() +-is now simply a wrapper only doing the work for CONFIG_BRCMDBG. +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Daniel (Deognyoun) Kim +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/debug.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/debug.c +-@@ -64,44 +64,12 @@ struct dentry *brcmf_debugfs_get_devdir( +- return drvr->dbgfs_dir; +- } +- +--struct brcmf_debugfs_entry { +-- int (*read)(struct seq_file *seq, void *data); +-- struct brcmf_pub *drvr; +--}; +-- +--static int brcmf_debugfs_entry_open(struct inode *inode, struct file *f) +--{ +-- struct brcmf_debugfs_entry *entry = inode->i_private; +-- +-- return single_open(f, entry->read, entry->drvr->bus_if->dev); +--} +-- +--static const struct file_operations brcmf_debugfs_def_ops = { +-- .owner = THIS_MODULE, +-- .open = brcmf_debugfs_entry_open, +-- .release = single_release, +-- .read = seq_read, +-- .llseek = seq_lseek +--}; +-- +- int brcmf_debugfs_add_entry(struct brcmf_pub *drvr, const char *fn, +- int (*read_fn)(struct seq_file *seq, void *data)) +- { +-- struct dentry *dentry = drvr->dbgfs_dir; +-- struct brcmf_debugfs_entry *entry; +-- +-- if (IS_ERR_OR_NULL(dentry)) +-- return -ENOENT; +-- +-- entry = devm_kzalloc(drvr->bus_if->dev, sizeof(*entry), GFP_KERNEL); +-- if (!entry) +-- return -ENOMEM; +-- +-- entry->read = read_fn; +-- entry->drvr = drvr; +-- +-- dentry = debugfs_create_file(fn, S_IRUGO, dentry, entry, +-- &brcmf_debugfs_def_ops); +-+ struct dentry *e; +- +-- return PTR_ERR_OR_ZERO(dentry); +-+ e = debugfs_create_devm_seqfile(drvr->bus_if->dev, fn, +-+ 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 +deleted file mode 100644 +index ff24a4a..0000000 +--- a/package/kernel/mac80211/patches/389-0001-brcmfmac-Check-if-firmware-supports-p2p.patch ++++ /dev/null +@@ -1,42 +0,0 @@ +-From: Pontus Fuchs +-Date: Thu, 11 Jun 2015 00:12:17 +0200 +-Subject: [PATCH] brcmfmac: Check if firmware supports p2p +- +-Add a feature flag to reflect the firmware's p2p capability. +- +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Hante Meuleman +-Reviewed-by: Arend Van Spriel +-Signed-off-by: Pontus Fuchs +-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 +-@@ -129,6 +129,7 @@ void brcmf_feat_attach(struct brcmf_pub +- brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_WOWL, "wowl"); +- 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"); +- +- /* set chip related quirks */ +- switch (drvr->bus_if->chip) { +---- a/drivers/net/wireless/brcm80211/brcmfmac/feature.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/feature.h +-@@ -23,12 +23,14 @@ +- * MCHAN: multi-channel for concurrent P2P. +- * PNO: preferred network offload. +- * WOWL: Wake-On-WLAN. +-+ * P2P: peer-to-peer +- */ +- #define BRCMF_FEAT_LIST \ +- BRCMF_FEAT_DEF(MBSS) \ +- BRCMF_FEAT_DEF(MCHAN) \ +- BRCMF_FEAT_DEF(PNO) \ +-- BRCMF_FEAT_DEF(WOWL) +-+ BRCMF_FEAT_DEF(WOWL) \ +-+ BRCMF_FEAT_DEF(P2P) +- /* +- * 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 +deleted file mode 100644 +index 3876ba0..0000000 +--- a/package/kernel/mac80211/patches/389-0002-brcmfmac-Build-wiphy-mode-and-interface-combinations.patch ++++ /dev/null +@@ -1,198 +0,0 @@ +-From: Pontus Fuchs +-Date: Thu, 11 Jun 2015 00:12:18 +0200 +-Subject: [PATCH] brcmfmac: Build wiphy mode and interface combinations +- dynamically +- +-Switch from using semi hard coded interface combinations. This makes +-it easier to announce what the firmware actually supports. This fixes +-the case where brcmfmac announces p2p but the firmware doesn't +-support it. +- +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Hante Meuleman +-Reviewed-by: Arend Van Spriel +-Signed-off-by: Pontus Fuchs +-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 +-@@ -52,8 +52,6 @@ +- #define BRCMF_PNO_SCAN_COMPLETE 1 +- #define BRCMF_PNO_SCAN_INCOMPLETE 0 +- +--#define BRCMF_IFACE_MAX_CNT 3 +-- +- #define WPA_OUI "\x00\x50\xF2" /* WPA OUI */ +- #define WPA_OUI_TYPE 1 +- #define RSN_OUI "\x00\x0F\xAC" /* RSN OUI */ +-@@ -5639,53 +5637,6 @@ static int brcmf_setup_wiphybands(struct +- return 0; +- } +- +--static const struct ieee80211_iface_limit brcmf_iface_limits_mbss[] = { +-- { +-- .max = 1, +-- .types = BIT(NL80211_IFTYPE_STATION) | +-- BIT(NL80211_IFTYPE_ADHOC) +-- }, +-- { +-- .max = 4, +-- .types = BIT(NL80211_IFTYPE_AP) +-- }, +-- { +-- .max = 1, +-- .types = BIT(NL80211_IFTYPE_P2P_CLIENT) | +-- BIT(NL80211_IFTYPE_P2P_GO) +-- }, +-- { +-- .max = 1, +-- .types = BIT(NL80211_IFTYPE_P2P_DEVICE) +-- } +--}; +-- +--static const struct ieee80211_iface_limit brcmf_iface_limits_sbss[] = { +-- { +-- .max = 2, +-- .types = BIT(NL80211_IFTYPE_STATION) | +-- BIT(NL80211_IFTYPE_ADHOC) | +-- BIT(NL80211_IFTYPE_AP) +-- }, +-- { +-- .max = 1, +-- .types = BIT(NL80211_IFTYPE_P2P_CLIENT) | +-- BIT(NL80211_IFTYPE_P2P_GO) +-- }, +-- { +-- .max = 1, +-- .types = BIT(NL80211_IFTYPE_P2P_DEVICE) +-- } +--}; +--static struct ieee80211_iface_combination brcmf_iface_combos[] = { +-- { +-- .max_interfaces = BRCMF_IFACE_MAX_CNT, +-- .num_different_channels = 1, +-- .n_limits = ARRAY_SIZE(brcmf_iface_limits_sbss), +-- .limits = brcmf_iface_limits_sbss, +-- } +--}; +-- +- static const struct ieee80211_txrx_stypes +- brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = { +- [NL80211_IFTYPE_STATION] = { +-@@ -5715,6 +5666,67 @@ brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = +- } +- }; +- +-+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; +-+ +-+ combo = kzalloc(sizeof(*combo), GFP_KERNEL); +-+ if (!combo) +-+ goto err; +-+ +-+ limits = kzalloc(sizeof(*limits) * 4, GFP_KERNEL); +-+ if (!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)) { +-+ 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; +-+ +-+ wiphy->iface_combinations = combo; +-+ wiphy->n_iface_combinations = 1; +-+ return 0; +-+ +-+err: +-+ kfree(limits); +-+ kfree(combo); +-+ return -ENOMEM; +-+} +-+ +- static void brcmf_wiphy_pno_params(struct wiphy *wiphy) +- { +- /* scheduled scan settings */ +-@@ -5745,7 +5757,6 @@ static void brcmf_wiphy_wowl_params(stru +- static int brcmf_setup_wiphy(struct wiphy *wiphy, struct brcmf_if *ifp) +- { +- struct ieee80211_supported_band *band; +-- struct ieee80211_iface_combination ifc_combo; +- __le32 bandlist[3]; +- u32 n_bands; +- int err, i; +-@@ -5753,24 +5764,11 @@ static int brcmf_setup_wiphy(struct wiph +- wiphy->max_scan_ssids = WL_NUM_SCAN_MAX; +- wiphy->max_scan_ie_len = BRCMF_SCAN_IE_LEN_MAX; +- wiphy->max_num_pmkids = WL_NUM_PMKIDS_MAX; +-- wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | +-- BIT(NL80211_IFTYPE_ADHOC) | +-- BIT(NL80211_IFTYPE_AP) | +-- BIT(NL80211_IFTYPE_P2P_CLIENT) | +-- BIT(NL80211_IFTYPE_P2P_GO) | +-- BIT(NL80211_IFTYPE_P2P_DEVICE); +-- /* need VSDB firmware feature for concurrent channels */ +-- ifc_combo = brcmf_iface_combos[0]; +-- if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MCHAN)) +-- ifc_combo.num_different_channels = 2; +-- if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS)) { +-- ifc_combo.n_limits = ARRAY_SIZE(brcmf_iface_limits_mbss), +-- ifc_combo.limits = brcmf_iface_limits_mbss; +-- } +-- wiphy->iface_combinations = kmemdup(&ifc_combo, +-- sizeof(ifc_combo), +-- GFP_KERNEL); +-- wiphy->n_iface_combinations = ARRAY_SIZE(brcmf_iface_combos); +-+ +-+ err = brcmf_setup_ifmodes(wiphy, ifp); +-+ if (err) +-+ return err; +-+ +- wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; +- wiphy->cipher_suites = __wl_cipher_suites; +- wiphy->n_cipher_suites = ARRAY_SIZE(__wl_cipher_suites); +-@@ -6035,6 +6033,8 @@ static void brcmf_free_wiphy(struct wiph +- if (!wiphy) +- return; +- +-+ if (wiphy->iface_combinations) +-+ kfree(wiphy->iface_combinations->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/389-0003-brcmfmac-rework-.get_station-callback.patch b/package/kernel/mac80211/patches/389-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 ++++ /dev/null +@@ -1,326 +0,0 @@ +-From: Arend van Spriel +-Date: Thu, 11 Jun 2015 00:12:19 +0200 +-Subject: [PATCH] brcmfmac: rework .get_station() callback +- +-The .get_station() cfg80211 callback is used in several scenarios. In +-managed mode it can obtain information about the access-point and its +-BSS parameters. In managed mode it can also obtain information about +-TDLS peers. In AP mode it can obtain information about connected +-clients. +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Daniel (Deognyoun) Kim +-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 +-@@ -2395,27 +2395,80 @@ brcmf_cfg80211_reconfigure_wep(struct br +- brcmf_err("set wsec error (%d)\n", err); +- } +- +-+static void brcmf_convert_sta_flags(u32 fw_sta_flags, struct station_info *si) +-+{ +-+ struct nl80211_sta_flag_update *sfu; +-+ +-+ brcmf_dbg(TRACE, "flags %08x\n", fw_sta_flags); +-+ si->filled |= BIT(NL80211_STA_INFO_STA_FLAGS); +-+ sfu = &si->sta_flags; +-+ sfu->mask = BIT(NL80211_STA_FLAG_WME) | +-+ BIT(NL80211_STA_FLAG_AUTHENTICATED) | +-+ BIT(NL80211_STA_FLAG_ASSOCIATED) | +-+ BIT(NL80211_STA_FLAG_AUTHORIZED); +-+ if (fw_sta_flags & BRCMF_STA_WME) +-+ sfu->set |= BIT(NL80211_STA_FLAG_WME); +-+ if (fw_sta_flags & BRCMF_STA_AUTHE) +-+ sfu->set |= BIT(NL80211_STA_FLAG_AUTHENTICATED); +-+ if (fw_sta_flags & BRCMF_STA_ASSOC) +-+ sfu->set |= BIT(NL80211_STA_FLAG_ASSOCIATED); +-+ if (fw_sta_flags & BRCMF_STA_AUTHO) +-+ sfu->set |= BIT(NL80211_STA_FLAG_AUTHORIZED); +-+} +-+ +-+static void brcmf_fill_bss_param(struct brcmf_if *ifp, struct station_info *si) +-+{ +-+ struct { +-+ __le32 len; +-+ struct brcmf_bss_info_le bss_le; +-+ } *buf; +-+ u16 capability; +-+ int err; +-+ +-+ buf = kzalloc(WL_BSS_INFO_MAX, GFP_KERNEL); +-+ if (!buf) +-+ return; +-+ +-+ buf->len = cpu_to_le32(WL_BSS_INFO_MAX); +-+ err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BSS_INFO, buf, +-+ WL_BSS_INFO_MAX); +-+ if (err) { +-+ brcmf_err("Failed to get bss info (%d)\n", err); +-+ return; +-+ } +-+ si->filled |= BIT(NL80211_STA_INFO_BSS_PARAM); +-+ si->bss_param.beacon_interval = le16_to_cpu(buf->bss_le.beacon_period); +-+ si->bss_param.dtim_period = buf->bss_le.dtim_period; +-+ capability = le16_to_cpu(buf->bss_le.capability); +-+ if (capability & IEEE80211_HT_STBC_PARAM_DUAL_CTS_PROT) +-+ si->bss_param.flags |= BSS_PARAM_FLAGS_CTS_PROT; +-+ if (capability & WLAN_CAPABILITY_SHORT_PREAMBLE) +-+ si->bss_param.flags |= BSS_PARAM_FLAGS_SHORT_PREAMBLE; +-+ if (capability & WLAN_CAPABILITY_SHORT_SLOT_TIME) +-+ si->bss_param.flags |= BSS_PARAM_FLAGS_SHORT_SLOT_TIME; +-+} +-+ +- static s32 +- brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev, +- const u8 *mac, struct station_info *sinfo) +- { +- struct brcmf_if *ifp = netdev_priv(ndev); +-- struct brcmf_cfg80211_profile *profile = &ifp->vif->profile; +-- struct brcmf_scb_val_le scb_val; +-- int rssi; +-- s32 rate; +- s32 err = 0; +-- u8 *bssid = profile->bssid; +- struct brcmf_sta_info_le sta_info_le; +-- u32 beacon_period; +-- u32 dtim_period; +-+ u32 sta_flags; +-+ u32 is_tdls_peer; +- +- brcmf_dbg(TRACE, "Enter, MAC %pM\n", mac); +- if (!check_vif_up(ifp->vif)) +- return -EIO; +- +-- if (brcmf_is_apmode(ifp->vif)) { +-- memcpy(&sta_info_le, mac, ETH_ALEN); +-+ memset(&sta_info_le, 0, sizeof(sta_info_le)); +-+ memcpy(&sta_info_le, mac, ETH_ALEN); +-+ err = brcmf_fil_iovar_data_get(ifp, "tdls_sta_info", +-+ &sta_info_le, +-+ sizeof(sta_info_le)); +-+ is_tdls_peer = !err; +-+ if (err) { +- err = brcmf_fil_iovar_data_get(ifp, "sta_info", +- &sta_info_le, +- sizeof(sta_info_le)); +-@@ -2423,73 +2476,48 @@ brcmf_cfg80211_get_station(struct wiphy +- brcmf_err("GET STA INFO failed, %d\n", err); +- goto done; +- } +-- sinfo->filled = BIT(NL80211_STA_INFO_INACTIVE_TIME); +-- sinfo->inactive_time = le32_to_cpu(sta_info_le.idle) * 1000; +-- if (le32_to_cpu(sta_info_le.flags) & BRCMF_STA_ASSOC) { +-- sinfo->filled |= BIT(NL80211_STA_INFO_CONNECTED_TIME); +-- sinfo->connected_time = le32_to_cpu(sta_info_le.in); +-- } +-- brcmf_dbg(TRACE, "STA idle time : %d ms, connected time :%d sec\n", +-- sinfo->inactive_time, sinfo->connected_time); +-- } else if (ifp->vif->wdev.iftype == NL80211_IFTYPE_STATION) { +-- if (memcmp(mac, bssid, ETH_ALEN)) { +-- brcmf_err("Wrong Mac address cfg_mac-%pM wl_bssid-%pM\n", +-- mac, bssid); +-- err = -ENOENT; +-- goto done; +-- } +-- /* Report the current tx rate */ +-- err = brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_RATE, &rate); +-- if (err) { +-- brcmf_err("Could not get rate (%d)\n", err); +-- goto done; +-- } else { +-+ } +-+ brcmf_dbg(TRACE, "version %d\n", le16_to_cpu(sta_info_le.ver)); +-+ sinfo->filled = BIT(NL80211_STA_INFO_INACTIVE_TIME); +-+ sinfo->inactive_time = le32_to_cpu(sta_info_le.idle) * 1000; +-+ sta_flags = le32_to_cpu(sta_info_le.flags); +-+ brcmf_convert_sta_flags(sta_flags, sinfo); +-+ sinfo->sta_flags.mask |= BIT(NL80211_STA_FLAG_TDLS_PEER); +-+ if (is_tdls_peer) +-+ sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_TDLS_PEER); +-+ else +-+ sinfo->sta_flags.set &= ~BIT(NL80211_STA_FLAG_TDLS_PEER); +-+ if (sta_flags & BRCMF_STA_ASSOC) { +-+ sinfo->filled |= BIT(NL80211_STA_INFO_CONNECTED_TIME); +-+ sinfo->connected_time = le32_to_cpu(sta_info_le.in); +-+ brcmf_fill_bss_param(ifp, sinfo); +-+ } +-+ if (sta_flags & BRCMF_STA_SCBSTATS) { +-+ sinfo->filled |= BIT(NL80211_STA_INFO_TX_FAILED); +-+ sinfo->tx_failed = le32_to_cpu(sta_info_le.tx_failures); +-+ sinfo->filled |= BIT(NL80211_STA_INFO_TX_PACKETS); +-+ sinfo->tx_packets = le32_to_cpu(sta_info_le.tx_pkts); +-+ sinfo->tx_packets += le32_to_cpu(sta_info_le.tx_mcast_pkts); +-+ sinfo->filled |= BIT(NL80211_STA_INFO_RX_PACKETS); +-+ sinfo->rx_packets = le32_to_cpu(sta_info_le.rx_ucast_pkts); +-+ 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 = rate * 5; +-- brcmf_dbg(CONN, "Rate %d Mbps\n", rate / 2); +-+ sinfo->txrate.legacy = le32_to_cpu(sta_info_le.tx_rate); +-+ sinfo->txrate.legacy /= 100; +- } +-- +-- if (test_bit(BRCMF_VIF_STATUS_CONNECTED, +-- &ifp->vif->sme_state)) { +-- memset(&scb_val, 0, sizeof(scb_val)); +-- err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_RSSI, +-- &scb_val, sizeof(scb_val)); +-- if (err) { +-- brcmf_err("Could not get rssi (%d)\n", err); +-- goto done; +-- } else { +-- rssi = le32_to_cpu(scb_val.val); +-- sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL); +-- sinfo->signal = rssi; +-- brcmf_dbg(CONN, "RSSI %d dBm\n", rssi); +-- } +-- err = brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_BCNPRD, +-- &beacon_period); +-- if (err) { +-- brcmf_err("Could not get beacon period (%d)\n", +-- err); +-- goto done; +-- } else { +-- sinfo->bss_param.beacon_interval = +-- beacon_period; +-- brcmf_dbg(CONN, "Beacon peroid %d\n", +-- beacon_period); +-- } +-- err = brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_DTIMPRD, +-- &dtim_period); +-- if (err) { +-- brcmf_err("Could not get DTIM period (%d)\n", +-- err); +-- goto done; +-- } else { +-- sinfo->bss_param.dtim_period = dtim_period; +-- brcmf_dbg(CONN, "DTIM peroid %d\n", +-- dtim_period); +-- } +-- sinfo->filled |= BIT(NL80211_STA_INFO_BSS_PARAM); +-+ 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; +-+ } +-+ if (le16_to_cpu(sta_info_le.ver) >= 4) { +-+ sinfo->filled |= BIT(NL80211_STA_INFO_TX_BYTES); +-+ sinfo->tx_bytes = le64_to_cpu(sta_info_le.tx_tot_bytes); +-+ sinfo->filled |= BIT(NL80211_STA_INFO_RX_BYTES); +-+ sinfo->rx_bytes = le64_to_cpu(sta_info_le.rx_tot_bytes); +- } +-- } else +-- err = -EPERM; +-+ } +- done: +- brcmf_dbg(TRACE, "Exit\n"); +- return err; +---- a/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h +-@@ -32,7 +32,11 @@ +- #define BRCMF_BSS_INFO_VERSION 109 /* curr ver of brcmf_bss_info_le struct */ +- #define BRCMF_BSS_RSSI_ON_CHANNEL 0x0002 +- +--#define BRCMF_STA_ASSOC 0x10 /* Associated */ +-+#define BRCMF_STA_WME 0x00000002 /* WMM association */ +-+#define BRCMF_STA_AUTHE 0x00000008 /* Authenticated */ +-+#define BRCMF_STA_ASSOC 0x00000010 /* Associated */ +-+#define BRCMF_STA_AUTHO 0x00000020 /* Authorized */ +-+#define BRCMF_STA_SCBSTATS 0x00004000 /* Per STA debug stats */ +- +- /* size of brcmf_scan_params not including variable length array */ +- #define BRCMF_SCAN_PARAMS_FIXED_SIZE 64 +-@@ -113,6 +117,7 @@ +- #define BRCMF_WOWL_MAXPATTERNSIZE 128 +- +- #define BRCMF_COUNTRY_BUF_SZ 4 +-+#define BRCMF_ANT_MAX 4 +- +- /* join preference types for join_pref iovar */ +- enum brcmf_join_pref_types { +-@@ -456,25 +461,61 @@ struct brcmf_channel_info_le { +- }; +- +- struct brcmf_sta_info_le { +-- __le16 ver; /* version of this struct */ +-- __le16 len; /* length in bytes of this structure */ +-- __le16 cap; /* sta's advertised capabilities */ +-- __le32 flags; /* flags defined below */ +-- __le32 idle; /* time since data pkt rx'd from sta */ +-- u8 ea[ETH_ALEN]; /* Station address */ +-- __le32 count; /* # rates in this set */ +-- u8 rates[BRCMF_MAXRATES_IN_SET]; /* rates in 500kbps units */ +-+ __le16 ver; /* version of this struct */ +-+ __le16 len; /* length in bytes of this structure */ +-+ __le16 cap; /* sta's advertised capabilities */ +-+ __le32 flags; /* flags defined below */ +-+ __le32 idle; /* time since data pkt rx'd from sta */ +-+ u8 ea[ETH_ALEN]; /* Station address */ +-+ __le32 count; /* # rates in this set */ +-+ u8 rates[BRCMF_MAXRATES_IN_SET]; /* rates in 500kbps units */ +- /* w/hi bit set if basic */ +-- __le32 in; /* seconds elapsed since associated */ +-- __le32 listen_interval_inms; /* Min Listen interval in ms for STA */ +-- __le32 tx_pkts; /* # of packets transmitted */ +-- __le32 tx_failures; /* # of packets failed */ +-- __le32 rx_ucast_pkts; /* # of unicast packets received */ +-- __le32 rx_mcast_pkts; /* # of multicast packets received */ +-- __le32 tx_rate; /* Rate of last successful tx frame */ +-- __le32 rx_rate; /* Rate of last successful rx frame */ +-- __le32 rx_decrypt_succeeds; /* # of packet decrypted successfully */ +-- __le32 rx_decrypt_failures; /* # of packet decrypted failed */ +-+ __le32 in; /* seconds elapsed since associated */ +-+ __le32 listen_interval_inms; /* Min Listen interval in ms for STA */ +-+ __le32 tx_pkts; /* # of packets transmitted */ +-+ __le32 tx_failures; /* # of packets failed */ +-+ __le32 rx_ucast_pkts; /* # of unicast packets received */ +-+ __le32 rx_mcast_pkts; /* # of multicast packets received */ +-+ __le32 tx_rate; /* Rate of last successful tx frame */ +-+ __le32 rx_rate; /* Rate of last successful rx frame */ +-+ __le32 rx_decrypt_succeeds; /* # of packet decrypted successfully */ +-+ __le32 rx_decrypt_failures; /* # of packet decrypted failed */ +-+ __le32 tx_tot_pkts; /* # of tx pkts (ucast + mcast) */ +-+ __le32 rx_tot_pkts; /* # of data packets recvd (uni + mcast) */ +-+ __le32 tx_mcast_pkts; /* # of mcast pkts txed */ +-+ __le64 tx_tot_bytes; /* data bytes txed (ucast + mcast) */ +-+ __le64 rx_tot_bytes; /* data bytes recvd (ucast + mcast) */ +-+ __le64 tx_ucast_bytes; /* data bytes txed (ucast) */ +-+ __le64 tx_mcast_bytes; /* # data bytes txed (mcast) */ +-+ __le64 rx_ucast_bytes; /* data bytes recvd (ucast) */ +-+ __le64 rx_mcast_bytes; /* data bytes recvd (mcast) */ +-+ s8 rssi[BRCMF_ANT_MAX]; /* per antenna rssi */ +-+ s8 nf[BRCMF_ANT_MAX]; /* per antenna noise floor */ +-+ __le16 aid; /* association ID */ +-+ __le16 ht_capabilities; /* advertised ht caps */ +-+ __le16 vht_flags; /* converted vht flags */ +-+ __le32 tx_pkts_retry_cnt; /* # of frames where a retry was +-+ * exhausted. +-+ */ +-+ __le32 tx_pkts_retry_exhausted; /* # of user frames where a retry +-+ * was exhausted +-+ */ +-+ s8 rx_lastpkt_rssi[BRCMF_ANT_MAX]; /* Per antenna RSSI of last +-+ * received data frame. +-+ */ +-+ /* TX WLAN retry/failure statistics: +-+ * Separated for host requested frames and locally generated frames. +-+ * Include unicast frame only where the retries/failures can be counted. +-+ */ +-+ __le32 tx_pkts_total; /* # user frames sent successfully */ +-+ __le32 tx_pkts_retries; /* # user frames retries */ +-+ __le32 tx_pkts_fw_total; /* # FW generated sent successfully */ +-+ __le32 tx_pkts_fw_retries; /* # retries for FW generated frames */ +-+ __le32 tx_pkts_fw_retry_exhausted; /* # FW generated where a retry +-+ * was exhausted +-+ */ +-+ __le32 rx_pkts_retried; /* # rx with retry bit set */ +-+ __le32 tx_rate_fallback; /* lowest fallback TX rate */ +- }; +- +- 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 +deleted file mode 100644 +index 302bc3e..0000000 +--- a/package/kernel/mac80211/patches/389-0004-brcmfmac-have-sdio-return-EIO-when-device-communicat.patch ++++ /dev/null +@@ -1,56 +0,0 @@ +-From: Arend van Spriel +-Date: Thu, 11 Jun 2015 00:12:20 +0200 +-Subject: [PATCH] brcmfmac: have sdio return -EIO when device communication +- is not possible +- +-The bus interface functions txctl and rxctl may be used while the device +-can not be accessed, eg. upon driver .remove() callback. This patch will +-immediately return -EIO when this is the case which speeds up the module +-unload. +- +-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/bcmsdh.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +-@@ -988,6 +988,7 @@ static void brcmf_sdiod_freezer_detach(s +- +- static int brcmf_sdiod_remove(struct brcmf_sdio_dev *sdiodev) +- { +-+ sdiodev->state = BRCMF_SDIOD_DOWN; +- if (sdiodev->bus) { +- brcmf_sdio_remove(sdiodev->bus); +- sdiodev->bus = NULL; +---- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-@@ -2820,6 +2820,8 @@ static int brcmf_sdio_bus_txdata(struct +- struct brcmf_sdio *bus = sdiodev->bus; +- +- brcmf_dbg(TRACE, "Enter: pkt: data %p len %d\n", pkt->data, pkt->len); +-+ if (sdiodev->state != BRCMF_SDIOD_DATA) +-+ return -EIO; +- +- /* Add space for the header */ +- skb_push(pkt, bus->tx_hdrlen); +-@@ -2948,6 +2950,8 @@ brcmf_sdio_bus_txctl(struct device *dev, +- int ret; +- +- brcmf_dbg(TRACE, "Enter\n"); +-+ if (sdiodev->state != BRCMF_SDIOD_DATA) +-+ return -EIO; +- +- /* Send from dpc */ +- bus->ctrl_frame_buf = msg; +-@@ -3238,6 +3242,8 @@ brcmf_sdio_bus_rxctl(struct device *dev, +- struct brcmf_sdio *bus = sdiodev->bus; +- +- brcmf_dbg(TRACE, "Enter\n"); +-+ if (sdiodev->state != BRCMF_SDIOD_DATA) +-+ return -EIO; +- +- /* 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 +deleted file mode 100644 +index 34af6d2..0000000 +--- a/package/kernel/mac80211/patches/389-0005-ath9k-make-DMA-stop-related-messages-debug-only.patch ++++ /dev/null +@@ -1,74 +0,0 @@ +-From: Felix Fietkau +-Date: Thu, 2 Jul 2015 13:35:05 +0200 +-Subject: [PATCH] ath9k: make DMA stop related messages debug-only +- +-A long time ago, ath9k had issues during reset where the DMA engine +-would stay active and could potentially corrupt memory. +-To debug those issues, the driver would print warnings whenever they +-occur. +- +-Nowadays, these issues are gone and the primary cause of these messages +-is if the MAC is stuck during reset or busy processing a long +-transmission. This is fairly harmless, yet these messages continue to +-worry users. +- +-To reduce the number of bogus bug reports, turn these messages into +-debug messages and count their occurence in the "reset" debugfs file. +- +-Signed-off-by: Felix Fietkau +---- +- +---- a/drivers/net/wireless/ath/ath9k/debug.c +-+++ b/drivers/net/wireless/ath/ath9k/debug.c +-@@ -765,6 +765,8 @@ static int read_file_reset(struct seq_fi +- [RESET_TYPE_BEACON_STUCK] = "Stuck Beacon", +- [RESET_TYPE_MCI] = "MCI Reset", +- [RESET_TYPE_CALIBRATION] = "Calibration error", +-+ [RESET_TX_DMA_ERROR] = "Tx DMA stop error", +-+ [RESET_RX_DMA_ERROR] = "Rx DMA stop error", +- }; +- int i; +- +---- a/drivers/net/wireless/ath/ath9k/debug.h +-+++ b/drivers/net/wireless/ath/ath9k/debug.h +-@@ -50,6 +50,8 @@ enum ath_reset_type { +- RESET_TYPE_BEACON_STUCK, +- RESET_TYPE_MCI, +- RESET_TYPE_CALIBRATION, +-+ RESET_TX_DMA_ERROR, +-+ RESET_RX_DMA_ERROR, +- __RESET_TYPE_MAX +- }; +- +---- a/drivers/net/wireless/ath/ath9k/recv.c +-+++ b/drivers/net/wireless/ath/ath9k/recv.c +-@@ -496,10 +496,9 @@ bool ath_stoprecv(struct ath_softc *sc) +- +- if (!(ah->ah_flags & AH_UNPLUGGED) && +- unlikely(!stopped)) { +-- ath_err(ath9k_hw_common(sc->sc_ah), +-- "Could not stop RX, we could be " +-- "confusing the DMA engine when we start RX up\n"); +-- ATH_DBG_WARN_ON_ONCE(!stopped); +-+ ath_dbg(ath9k_hw_common(sc->sc_ah), RESET, +-+ "Failed to stop Rx DMA\n"); +-+ RESET_STAT_INC(sc, RESET_RX_DMA_ERROR); +- } +- return stopped && !reset; +- } +---- a/drivers/net/wireless/ath/ath9k/xmit.c +-+++ b/drivers/net/wireless/ath/ath9k/xmit.c +-@@ -1896,8 +1896,11 @@ bool ath_drain_all_txq(struct ath_softc +- npend |= BIT(i); +- } +- +-- if (npend) +-- ath_err(common, "Failed to stop TX DMA, queues=0x%03x!\n", npend); +-+ if (npend) { +-+ RESET_STAT_INC(sc, RESET_TX_DMA_ERROR); +-+ ath_dbg(common, RESET, +-+ "Failed to stop TX DMA, queues=0x%03x!\n", npend); +-+ } +- +- 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 +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 ++++ /dev/null +@@ -1,44 +0,0 @@ +-From: Arend van Spriel +-Date: Thu, 11 Jun 2015 00:12:21 +0200 +-Subject: [PATCH] brcmfmac: free ifp for non-netdev interface in p2p module +- +-Making it more clear by freeing the ifp in same place where the +-vif object is freed. +- +-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/core.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c +-@@ -867,8 +867,6 @@ static void brcmf_del_if(struct brcmf_pu +- } +- /* unregister will take care of freeing it */ +- unregister_netdev(ifp->ndev); +-- } else { +-- kfree(ifp); +- } +- } +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +-@@ -2238,6 +2238,7 @@ static void brcmf_p2p_delete_p2pdev(stru +- { +- cfg80211_unregister_wdev(&vif->wdev); +- p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; +-+ kfree(vif->ifp); +- brcmf_free_vif(vif); +- } +- +-@@ -2361,6 +2362,8 @@ int brcmf_p2p_del_vif(struct wiphy *wiph +- break; +- +- case NL80211_IFTYPE_P2P_DEVICE: +-+ brcmf_p2p_cancel_remain_on_channel(vif->ifp); +-+ brcmf_p2p_deinit_discovery(p2p); +- 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 +deleted file mode 100644 +index 0a6e093..0000000 +--- a/package/kernel/mac80211/patches/389-0007-brcmfmac-move-p2p-attach-detach-functions.patch ++++ /dev/null +@@ -1,225 +0,0 @@ +-From: Arend van Spriel +-Date: Thu, 11 Jun 2015 00:12:22 +0200 +-Subject: [PATCH] brcmfmac: move p2p attach/detach functions +- +-Moving two functions in p2p.c as is so next change will be +-easier to review. +- +-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/p2p.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +-@@ -1908,105 +1908,6 @@ s32 brcmf_p2p_notify_rx_mgmt_p2p_probere +- +- +- /** +-- * brcmf_p2p_attach() - attach for P2P. +-- * +-- * @cfg: driver private data for cfg80211 interface. +-- */ +--s32 brcmf_p2p_attach(struct brcmf_cfg80211_info *cfg) +--{ +-- 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; +-- s32 err = 0; +-- +-- p2p = &cfg->p2p; +-- p2p->cfg = cfg; +-- +-- drvr = cfg->pub; +-- +-- pri_ifp = drvr->iflist[0]; +-- p2p_ifp = drvr->iflist[1]; +-- +-- p2p->bss_idx[P2PAPI_BSSCFG_PRIMARY].vif = pri_ifp->vif; +-- +-- 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); +-- +-- /* 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: +-- return err; +--} +-- +-- +--/** +-- * brcmf_p2p_detach() - detach P2P. +-- * +-- * @p2p: P2P specific data. +-- */ +--void brcmf_p2p_detach(struct brcmf_p2p_info *p2p) +--{ +-- struct brcmf_cfg80211_vif *vif; +-- +-- vif = p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif; +-- if (vif != NULL) { +-- brcmf_p2p_cancel_remain_on_channel(vif->ifp); +-- brcmf_p2p_deinit_discovery(p2p); +-- /* remove discovery interface */ +-- brcmf_free_vif(vif); +-- p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; +-- } +-- /* just set it all to zero */ +-- memset(p2p, 0, sizeof(*p2p)); +--} +-- +--/** +- * brcmf_p2p_get_current_chanspec() - Get current operation channel. +- * +- * @p2p: P2P specific data. +-@@ -2425,3 +2326,102 @@ void brcmf_p2p_stop_device(struct wiphy +- clear_bit(BRCMF_VIF_STATUS_READY, &vif->sme_state); +- mutex_unlock(&cfg->usr_sync); +- } +-+ +-+/** +-+ * brcmf_p2p_attach() - attach for P2P. +-+ * +-+ * @cfg: driver private data for cfg80211 interface. +-+ */ +-+s32 brcmf_p2p_attach(struct brcmf_cfg80211_info *cfg) +-+{ +-+ 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; +-+ s32 err = 0; +-+ +-+ p2p = &cfg->p2p; +-+ p2p->cfg = cfg; +-+ +-+ drvr = cfg->pub; +-+ +-+ pri_ifp = drvr->iflist[0]; +-+ p2p_ifp = drvr->iflist[1]; +-+ +-+ p2p->bss_idx[P2PAPI_BSSCFG_PRIMARY].vif = pri_ifp->vif; +-+ +-+ 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); +-+ +-+ /* 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: +-+ return err; +-+} +-+ +-+/** +-+ * brcmf_p2p_detach() - detach P2P. +-+ * +-+ * @p2p: P2P specific data. +-+ */ +-+void brcmf_p2p_detach(struct brcmf_p2p_info *p2p) +-+{ +-+ struct brcmf_cfg80211_vif *vif; +-+ +-+ vif = p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif; +-+ if (vif != NULL) { +-+ brcmf_p2p_cancel_remain_on_channel(vif->ifp); +-+ brcmf_p2p_deinit_discovery(p2p); +-+ /* remove discovery interface */ +-+ brcmf_free_vif(vif); +-+ p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; +-+ } +-+ /* just set it all to zero */ +-+ 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 +deleted file mode 100644 +index 72e8eed..0000000 +--- a/package/kernel/mac80211/patches/389-0008-brcmfmac-assure-p2pdev-is-unregistered-upon-driver-u.patch ++++ /dev/null +@@ -1,63 +0,0 @@ +-From: Arend van Spriel +-Date: Thu, 11 Jun 2015 00:12:23 +0200 +-Subject: [PATCH] brcmfmac: assure p2pdev is unregistered upon driver +- unload +- +-When unloading the driver with a p2pdev interface it resulted in +-a warning upon calling wiphy_unregister() and subsequently a crash +-in the driver. This patch assures the p2pdev is unregistered calling +-unregister_wdev() before doing the wiphy_unregister(). +- +-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 +-@@ -6206,10 +6206,8 @@ void brcmf_cfg80211_detach(struct brcmf_ +- if (!cfg) +- return; +- +-- WARN_ON(!list_empty(&cfg->vif_list)); +-- wiphy_unregister(cfg->wiphy); +- brcmf_btcoex_detach(cfg); +-- brcmf_p2p_detach(&cfg->p2p); +-+ wiphy_unregister(cfg->wiphy); +- wl_deinit_priv(cfg); +- brcmf_free_wiphy(cfg->wiphy); +- } +---- a/drivers/net/wireless/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c +-@@ -1098,6 +1098,7 @@ void brcmf_detach(struct device *dev) +- +- /* stop firmware event handling */ +- brcmf_fweh_detach(drvr); +-+ brcmf_p2p_detach(&drvr->config->p2p); +- +- brcmf_bus_change_state(bus_if, BRCMF_BUS_DOWN); +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +-@@ -16,6 +16,7 @@ +- #include +- #include +- #include +-+#include +- #include +- +- #include +-@@ -2418,8 +2419,9 @@ void brcmf_p2p_detach(struct brcmf_p2p_i +- brcmf_p2p_cancel_remain_on_channel(vif->ifp); +- brcmf_p2p_deinit_discovery(p2p); +- /* remove discovery interface */ +-- brcmf_free_vif(vif); +-- p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; +-+ rtnl_lock(); +-+ brcmf_p2p_delete_p2pdev(p2p, vif); +-+ rtnl_unlock(); +- } +- /* 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 +deleted file mode 100644 +index 179c77e..0000000 +--- a/package/kernel/mac80211/patches/390-0001-brcmfmac-fix-double-free-of-p2pdev-interface.patch ++++ /dev/null +@@ -1,27 +0,0 @@ +-From: Arend van Spriel +-Date: Mon, 15 Jun 2015 22:48:38 +0200 +-Subject: [PATCH] brcmfmac: fix double free of p2pdev interface +- +-When freeing the driver ifp pointer it should also be removed from +-the driver interface list, which is what brcmf_remove_interface() +-does. Otherwise, the ifp pointer will be freed twice triggering +-a kernel oops. +- +-Fixes: f37d69a4babc ("brcmfmac: free ifp for non-netdev interface in p2p module") +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-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 +-@@ -2140,7 +2140,7 @@ static void brcmf_p2p_delete_p2pdev(stru +- { +- cfg80211_unregister_wdev(&vif->wdev); +- p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; +-- kfree(vif->ifp); +-+ brcmf_remove_interface(vif->ifp->drvr, vif->ifp->bssidx); +- 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 +deleted file mode 100644 +index e4f88b5..0000000 +--- a/package/kernel/mac80211/patches/390-0002-brcmfmac-make-brcmf_p2p_detach-call-conditional.patch ++++ /dev/null +@@ -1,29 +0,0 @@ +-From: Arend van Spriel +-Date: Mon, 15 Jun 2015 22:48:39 +0200 +-Subject: [PATCH] brcmfmac: make brcmf_p2p_detach() call conditional +- +-During verification of error handling in brcmf_cfg80211_attach() a +-null pointer dereference occurred upon calling brcmf_p2p_detach() +-from brcmf_detach(). This should only be called when the +-brcmf_cfg80211_attach() has succeeded. +- +-Fixes: f7a40873d2fa ("brcmfmac: assure p2pdev is unregistered upon driver unload") +-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/core.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c +-@@ -1098,7 +1098,8 @@ void brcmf_detach(struct device *dev) +- +- /* stop firmware event handling */ +- brcmf_fweh_detach(drvr); +-- brcmf_p2p_detach(&drvr->config->p2p); +-+ if (drvr->config) +-+ brcmf_p2p_detach(&drvr->config->p2p); +- +- 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 +deleted file mode 100644 +index 0a81237..0000000 +--- a/package/kernel/mac80211/patches/391-brcmfmac-set-wiphy-s-addresses-to-provide-valid-MACs.patch ++++ /dev/null +@@ -1,67 +0,0 @@ +-From: Rafa? Mi?ecki +-Date: Thu, 9 Jul 2015 17:07:08 +0200 +-Subject: [PATCH] brcmfmac: set wiphy's addresses to provide valid MACs +- +-Broadcom's firmware requires every BSS to use MAC address with unique +-last few bits. The amount of bits may depend on a particular firmware, +-it was verified to be 2 for BCM43602 one. +-If this condition won't be fulfilled firmware will reject such MAC: +-brcmfmac: _brcmf_set_mac_address: Setting cur_etheraddr failed, -52 +- +-We don't want to simply set addr_mask as it would also disallow using +-locally administrated bit. Instead let's build a list of addresses +-manually enabling 0x2 bit for extra interfaces. +- +-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 +-@@ -5784,6 +5784,7 @@ 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; +- struct ieee80211_supported_band *band; +- __le32 bandlist[3]; +- u32 n_bands; +-@@ -5797,6 +5798,19 @@ 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++) { +-+ u8 *addr = drvr->addresses[i].addr; +-+ +-+ memcpy(addr, drvr->mac, ETH_ALEN); +-+ if (i) { +-+ addr[0] |= BIT(1); +-+ addr[ETH_ALEN - 1] ^= i; +-+ } +-+ } +-+ wiphy->addresses = drvr->addresses; +-+ wiphy->n_addresses = i; +-+ +- wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; +- wiphy->cipher_suites = __wl_cipher_suites; +- wiphy->n_cipher_suites = ARRAY_SIZE(__wl_cipher_suites); +---- a/drivers/net/wireless/brcm80211/brcmfmac/core.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.h +-@@ -21,6 +21,7 @@ +- #ifndef BRCMFMAC_CORE_H +- #define BRCMFMAC_CORE_H +- +-+#include +- #include "fweh.h" +- +- #define TOE_TX_CSUM_OL 0x00000001 +-@@ -118,6 +119,8 @@ struct brcmf_pub { +- /* Multicast data packets sent to dongle */ +- unsigned long tx_multicast; +- +-+ struct mac_address addresses[BRCMF_MAX_IFS]; +-+ +- 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 +deleted file mode 100644 +index e44f121..0000000 +--- a/package/kernel/mac80211/patches/392-brcmfmac-dhd_sdio.c-use-existing-atomic_or-primitive.patch ++++ /dev/null +@@ -1,45 +0,0 @@ +-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; +-- +-- 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); +- +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 +deleted file mode 100644 +index 76ca143..0000000 +--- a/package/kernel/mac80211/patches/393-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?= +-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 +-@@ -5785,7 +5785,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; +-@@ -5798,8 +5800,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/393-0002-brcmfmac-correct-interface-combination-info.patch b/package/kernel/mac80211/patches/393-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 ++++ /dev/null +@@ -1,204 +0,0 @@ +-From: Arend van Spriel +-Date: Thu, 20 Aug 2015 22:06:03 +0200 +-Subject: [PATCH] brcmfmac: correct interface combination info +- +-The interface combination provided by brcmfmac did not truly reflect +-the combinations supported by driver and/or firmware. +- +-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 +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-@@ -5694,63 +5694,132 @@ brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = +- } +- }; +- +-+/** +-+ * 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; +- } +-@@ -6079,11 +6148,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/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 +deleted file mode 100644 +index 9768ef2..0000000 +--- a/package/kernel/mac80211/patches/393-0003-brcmfmac-add-debugfs-entry-for-msgbuf-statistics.patch ++++ /dev/null +@@ -1,87 +0,0 @@ +-From: Franky Lin +-Date: Thu, 20 Aug 2015 22:06:04 +0200 +-Subject: [PATCH] brcmfmac: add debugfs entry for msgbuf statistics +- +-Expose ring buffer read/write pointers and other useful statistics +-through debugfs. +- +-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 +---- +- +---- 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 +- } +- } +- +-+#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; +-+ +-+ 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); +-+ } +-+ +-+ 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: +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 +deleted file mode 100644 +index 2b84cf9..0000000 +--- a/package/kernel/mac80211/patches/393-0004-brcmfmac-make-use-of-cfg80211_check_combinations.patch ++++ /dev/null +@@ -1,83 +0,0 @@ +-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) +-@@ -662,8 +692,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: +-@@ -822,8 +858,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/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 +deleted file mode 100644 +index 2d5f7b9..0000000 +--- a/package/kernel/mac80211/patches/393-0005-brcmfmac-block-the-correct-flowring-when-backup-queu.patch ++++ /dev/null +@@ -1,48 +0,0 @@ +-From: Franky Lin +-Date: Thu, 20 Aug 2015 22:06:06 +0200 +-Subject: [PATCH] brcmfmac: block the correct flowring when backup queue +- overflow +- +-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. +- +-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 +---- +- +---- 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); +- +- ring = flow->rings[flowid]; +-+ if (ring->blocked == blocked) { +-+ spin_unlock_irqrestore(&flow->block_lock, flags); +-+ return; +-+ } +- ifidx = brcmf_flowring_ifidx_get(flow, flowid); +- +- 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/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 +deleted file mode 100644 +index 7378401..0000000 +--- a/package/kernel/mac80211/patches/393-0006-brcmfmac-bump-highest-event-number-for-4339-firmware.patch ++++ /dev/null +@@ -1,52 +0,0 @@ +-From: Arend van Spriel +-Date: Thu, 20 Aug 2015 22:06:07 +0200 +-Subject: [PATCH] brcmfmac: bump highest event number for 4339 firmware +- +-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. +- +-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 +---- +- +---- 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) +- +- #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 +- +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 +deleted file mode 100644 +index 97444b3..0000000 +--- a/package/kernel/mac80211/patches/394-0001-brcmfmac-consolidate-ifp-lookup-in-driver-core.patch ++++ /dev/null +@@ -1,138 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 26 Aug 2015 22:14:53 +0200 +-Subject: [PATCH] brcmfmac: consolidate ifp lookup in driver core +- +-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. +- +-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/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) +- { +- 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; +- } +-- /* 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; +-+ +-+ *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) +-+{ +-+ 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]; +-+} +-+ +- 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 +- +- /* 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; +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 +deleted file mode 100644 +index 632714c..0000000 +--- a/package/kernel/mac80211/patches/394-0002-brcmfmac-make-brcmf_proto_hdrpull-return-struct-brcm.patch ++++ /dev/null +@@ -1,222 +0,0 @@ +-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 +- +-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 +---- +- +---- 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 +- } +- +- 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; +-+ +-+ /* assure protocol is always called with +-+ * non-null initialized pointer. +-+ */ +-+ 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) +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 +deleted file mode 100644 +index 2d15a77..0000000 +--- a/package/kernel/mac80211/patches/394-0003-brcmfmac-change-parameters-for-brcmf_remove_interfac.patch ++++ /dev/null +@@ -1,87 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 26 Aug 2015 22:14:55 +0200 +-Subject: [PATCH] brcmfmac: change parameters for +- brcmf_remove_interface() +- +-Just pass the interface to be removed, ie. 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 +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-@@ -4982,7 +4982,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/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 +- } +- } +- +--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; +-+ +-+ brcmf_fws_del_interface(ifp); +-+ brcmf_del_if(ifp->drvr, ifp->bssidx); +- } +- +- 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 +- { +- 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); +- } +- +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 +deleted file mode 100644 +index 2b61f4e..0000000 +--- a/package/kernel/mac80211/patches/394-0004-brcmfmac-only-call-brcmf_cfg80211_detach-when-attach.patch ++++ /dev/null +@@ -1,92 +0,0 @@ +-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 +- +-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: +- +- 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 +---- +- +---- 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; +-+ } +- 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 +deleted file mode 100644 +index 868b0a8..0000000 +--- a/package/kernel/mac80211/patches/394-0005-brcmfmac-correct-detection-of-p2pdev-interface-event.patch ++++ /dev/null +@@ -1,105 +0,0 @@ +-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/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 +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 ++++ /dev/null +@@ -1,126 +0,0 @@ +-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 +- +-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. +- +-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/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 +-@@ -6212,7 +6212,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); +- } +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 +deleted file mode 100644 +index 23a7b6f..0000000 +--- a/package/kernel/mac80211/patches/394-0007-brcmfmac-pass-struct-brcmf_if-instance-in-brcmf_txfi.patch ++++ /dev/null +@@ -1,122 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 26 Aug 2015 22:14:59 +0200 +-Subject: [PATCH] brcmfmac: pass struct brcmf_if instance in +- brcmf_txfinalize() +- +-Most call sites of brcmf_txfinalize already have struct brcmf_if +-instance so pass that to brcmf_txfinalize() as the function +-needs it anyway. +- +-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 +-@@ -560,17 +560,11 @@ void brcmf_rx_frame(struct device *dev, +- brcmf_netif_rx(ifp, skb); +- } +- +--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; +- +-- ifp = drvr->iflist[ifidx]; +-- if (!ifp) +-- goto done; +-- +- eh = (struct ethhdr *)(txp->data); +- type = ntohs(eh->h_proto); +- +-@@ -582,7 +576,7 @@ void brcmf_txfinalize(struct brcmf_pub * +- +- 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; +- } +- +-@@ -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? +-+ */ +-+ brcmf_txfinalize(brcmf_get_ifp(msgbuf->drvr, tx_status->msg.ifidx), +-+ skb, true); +- } +- +- +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 +deleted file mode 100644 +index 8ddc0a6..0000000 +--- a/package/kernel/mac80211/patches/394-0008-brcmfmac-add-mapping-for-interface-index-to-bsscfg-i.patch ++++ /dev/null +@@ -1,92 +0,0 @@ +-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/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 +deleted file mode 100644 +index a0a798b..0000000 +--- a/package/kernel/mac80211/patches/394-0009-brcmfmac-add-dedicated-debug-level-for-firmware-cons.patch ++++ /dev/null +@@ -1,103 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 26 Aug 2015 22:15:01 +0200 +-Subject: [PATCH] brcmfmac: add dedicated debug level for firmware +- console logging +- +-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. +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Pontus Fuchs +-Signed-off-by: Arend van Spriel +---- +- +---- 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); +- } +- +-@@ -656,6 +656,9 @@ static void brcmf_pcie_bus_console_read( +- u8 ch; +- u32 newidx; +- +-+ if (!BRCMF_FWCON_ON()) +-+ return; +-+ +- 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; +-+ +- 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) { +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 +deleted file mode 100644 +index 53e7ede..0000000 +--- a/package/kernel/mac80211/patches/394-0010-brcmfmac-remove-ifidx-parameter-from-brcmf_fws_txsta.patch ++++ /dev/null +@@ -1,34 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 26 Aug 2015 22:15:02 +0200 +-Subject: [PATCH] brcmfmac: remove ifidx parameter from +- brcmf_fws_txstatus_suppressed() +- +-The brcmf_fws_txstatus_suppressed() function prototype specifies an +-ifidx parameter which is not used within the function implementation. +- +-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/fwsignal.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c +-@@ -1398,7 +1398,7 @@ done: +- } +- +- 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; +- } +- 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); +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 +deleted file mode 100644 +index bb05235..0000000 +--- a/package/kernel/mac80211/patches/394-0011-brcmfmac-change-prototype-for-brcmf_fws_hdrpull.patch ++++ /dev/null +@@ -1,97 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 26 Aug 2015 22:15:03 +0200 +-Subject: [PATCH] brcmfmac: change prototype for brcmf_fws_hdrpull() +- +-Instead of passing ifidx and drvr just pass struct brcmf_if pointer +-which holds both parameters. +- +-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/bcdc.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcdc.c +-@@ -312,8 +312,7 @@ brcmf_proto_bcdc_hdrpull(struct brcmf_pu +- +- 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) +- { +- 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; +- } +- +- 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); +- +- 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 +deleted file mode 100644 +index ba92c67..0000000 +--- a/package/kernel/mac80211/patches/394-0012-brcmfmac-introduce-brcmf_net_detach-function.patch ++++ /dev/null +@@ -1,99 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 26 Aug 2015 22:15:04 +0200 +-Subject: [PATCH] brcmfmac: introduce brcmf_net_detach() function +- +-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. +- +-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 +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-@@ -4746,7 +4746,8 @@ void brcmf_cfg80211_free_netdev(struct n +- ifp = netdev_priv(ndev); +- vif = ifp->vif; +- +-- brcmf_free_vif(vif); +-+ if (vif) +-+ brcmf_free_vif(vif); +- free_netdev(ndev); +- } +- +---- 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/395-brcmfmac-Reset-PCIE-devices-after-recognition.patch b/package/kernel/mac80211/patches/395-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 ++++ /dev/null +@@ -1,193 +0,0 @@ +-From: Hante Meuleman +-Date: Thu, 27 Aug 2015 16:14:06 +0200 +-Subject: [PATCH] brcmfmac: Reset PCIE devices after recognition. +- +-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. +- +-Cc: Rafal Milecki +-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 +---- +- +---- 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 +- +-+/* 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; +- } +-+ +-+ if (ci->pub.ramsize > BRCMF_CHIP_MAX_MEMSIZE) { +-+ brcmf_err("RAM size is incorrect\n"); +-+ return -ENOMEM; +-+ } +-+ +- return 0; +- } +- +-@@ -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); +- } +- +---- 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); +- }; +---- 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 * +- } +- +- +-+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) +- { +-@@ -1647,6 +1671,7 @@ static void brcmf_pcie_buscore_activate( +- +- 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); +- +- kfree(bus->bus_priv.pcie); +- kfree(bus->msgbuf->flowrings); +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 ++++ b/package/kernel/mac80211/patches/400-ath_move_debug_code.patch +@@ -14,7 +14,7 @@ + ccflags-y += -D__CHECK_ENDIAN__ + --- a/drivers/net/wireless/ath/ath.h + +++ b/drivers/net/wireless/ath/ath.h +-@@ -316,13 +316,6 @@ void _ath_dbg(struct ath_common *common, ++@@ -318,13 +318,6 @@ void _ath_dbg(struct ath_common *common, + #endif /* CPTCFG_ATH_DEBUG */ + + /** 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 +--- a/package/kernel/mac80211/patches/402-ath_regd_optional.patch ++++ b/package/kernel/mac80211/patches/402-ath_regd_optional.patch +@@ -59,7 +59,7 @@ + ---help--- + --- a/.local-symbols + +++ b/.local-symbols +-@@ -89,6 +89,7 @@ RTL8187_LEDS= ++@@ -137,6 +137,7 @@ RTL8187_LEDS= + ATH_COMMON= + ATH_CARDS= + ATH_DEBUG= +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 +--- 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 + enum environment_cap env = ENVIRON_ANY; + struct regulatory_request *request = NULL, *lr; + +@@ -9,7 +9,7 @@ + /* 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( + + void regulatory_hint_disconnect(void) + { +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 ++++ b/package/kernel/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch +@@ -1,6 +1,6 @@ + --- a/drivers/net/wireless/ath/ath9k/init.c + +++ b/drivers/net/wireless/ath/ath9k/init.c +-@@ -715,6 +715,7 @@ static const struct ieee80211_iface_limi ++@@ -722,6 +722,7 @@ static const struct ieee80211_iface_limi + BIT(NL80211_IFTYPE_AP) }, + { .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 +--- 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 ++++++++++++++++++++++++++++++++ + debugfs_create_file("antenna", S_IWUSR | S_IRUSR, phydir, ah, + --- 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 { + u8 ah_coverage_class; + bool ah_ack_bitrate_high; + u8 ah_bwmode; +diff --git a/package/kernel/mac80211/patches/500-ath9k_eeprom_debugfs.patch b/package/kernel/mac80211/patches/500-ath9k_eeprom_debugfs.patch +index c6f50be..a7f9d9f 100644 +--- a/package/kernel/mac80211/patches/500-ath9k_eeprom_debugfs.patch ++++ b/package/kernel/mac80211/patches/500-ath9k_eeprom_debugfs.patch +@@ -1,6 +1,6 @@ + --- a/drivers/net/wireless/ath/ath9k/debug.c + +++ b/drivers/net/wireless/ath/ath9k/debug.c +-@@ -1299,6 +1299,53 @@ void ath9k_deinit_debug(struct ath_softc ++@@ -1301,6 +1301,53 @@ void ath9k_deinit_debug(struct ath_softc + ath9k_cmn_spectral_deinit_debug(&sc->spec_priv); + } + +@@ -54,7 +54,7 @@ + int ath9k_init_debug(struct ath_hw *ah) + { + struct ath_common *common = ath9k_hw_common(ah); +-@@ -1318,6 +1365,8 @@ int ath9k_init_debug(struct ath_hw *ah) ++@@ -1320,6 +1367,8 @@ int ath9k_init_debug(struct ath_hw *ah) + ath9k_tx99_init_debug(sc); + ath9k_cmn_spectral_init_debug(&sc->spec_priv, sc->debug.debugfs_phy); + +diff --git a/package/kernel/mac80211/patches/501-ath9k_ahb_init.patch b/package/kernel/mac80211/patches/501-ath9k_ahb_init.patch +index 0bdcae4..b4e9762 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 +-@@ -1023,23 +1023,23 @@ static int __init ath9k_init(void) ++@@ -1031,23 +1031,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 ++++ b/package/kernel/mac80211/patches/510-ath9k_intr_mitigation_tweak.patch +@@ -1,6 +1,6 @@ + --- a/drivers/net/wireless/ath/ath9k/hw.c + +++ b/drivers/net/wireless/ath/ath9k/hw.c +-@@ -389,13 +389,8 @@ static void ath9k_hw_init_config(struct ++@@ -390,13 +390,8 @@ static void ath9k_hw_init_config(struct + + ah->config.rx_intr_mitigation = true; + +@@ -14,5 +14,5 @@ + + ah->config.rimt_last = 250; + + ah->config.rimt_first = 500; + +- /* +- * We need this for PCI devices only (Cardbus, PCI, miniPCI) ++ if (AR_SREV_9462(ah) || AR_SREV_9565(ah)) ++ ah->config.pll_pwrsave = 7; +diff --git a/package/kernel/mac80211/patches/511-ath9k_reduce_rxbuf.patch b/package/kernel/mac80211/patches/511-ath9k_reduce_rxbuf.patch +index d4104f0..6766111 100644 +--- a/package/kernel/mac80211/patches/511-ath9k_reduce_rxbuf.patch ++++ b/package/kernel/mac80211/patches/511-ath9k_reduce_rxbuf.patch +@@ -1,6 +1,6 @@ + --- a/drivers/net/wireless/ath/ath9k/ath9k.h + +++ b/drivers/net/wireless/ath/ath9k/ath9k.h +-@@ -87,7 +87,7 @@ int ath_descdma_setup(struct ath_softc * ++@@ -88,7 +88,7 @@ int ath_descdma_setup(struct ath_softc * + (_l) &= ((_sz) - 1); \ + } while (0) + +diff --git a/package/kernel/mac80211/patches/512-ath9k_channelbw_debugfs.patch b/package/kernel/mac80211/patches/512-ath9k_channelbw_debugfs.patch +index c0fbf5e..5ecf528 100644 +--- a/package/kernel/mac80211/patches/512-ath9k_channelbw_debugfs.patch ++++ b/package/kernel/mac80211/patches/512-ath9k_channelbw_debugfs.patch +@@ -1,6 +1,6 @@ + --- a/drivers/net/wireless/ath/ath9k/debug.c + +++ b/drivers/net/wireless/ath/ath9k/debug.c +-@@ -1346,6 +1346,52 @@ static const struct file_operations fops ++@@ -1348,6 +1348,52 @@ static const struct file_operations fops + .owner = THIS_MODULE + }; + +@@ -53,7 +53,7 @@ + int ath9k_init_debug(struct ath_hw *ah) + { + struct ath_common *common = ath9k_hw_common(ah); +-@@ -1367,6 +1413,8 @@ int ath9k_init_debug(struct ath_hw *ah) ++@@ -1369,6 +1415,8 @@ int ath9k_init_debug(struct ath_hw *ah) + + debugfs_create_file("eeprom", S_IRUSR, sc->debug.debugfs_phy, sc, + &fops_eeprom); +diff --git a/package/kernel/mac80211/patches/513-ath9k_add_pci_ids.patch b/package/kernel/mac80211/patches/513-ath9k_add_pci_ids.patch +index 40b5c81..c84d1bc 100644 +--- a/package/kernel/mac80211/patches/513-ath9k_add_pci_ids.patch ++++ b/package/kernel/mac80211/patches/513-ath9k_add_pci_ids.patch +@@ -1,6 +1,6 @@ + --- a/drivers/net/wireless/ath/ath9k/hw.c + +++ b/drivers/net/wireless/ath/ath9k/hw.c +-@@ -647,6 +647,7 @@ int ath9k_hw_init(struct ath_hw *ah) ++@@ -651,6 +651,7 @@ int ath9k_hw_init(struct ath_hw *ah) + + /* 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 +--- a/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch ++++ b/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch +@@ -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 { + * + * @power_level: requested transmit power (in dBm), backward compatibility + * value only that is set to the minimum of all interfaces +@@ -26,7 +26,7 @@ + * + * @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 { + u32 flags; + int power_level, dynamic_ps_timeout; + int max_sleep_period; +@@ -36,7 +36,7 @@ + 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. + * +@@ -46,7 +46,7 @@ + * @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, + +@@ -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 + return 0; + } + +@@ -77,7 +77,7 @@ + static int ieee80211_set_wds_peer(struct wiphy *wiphy, struct net_device *dev, + const u8 *addr) + { +-@@ -3771,6 +3784,7 @@ const struct cfg80211_ops mac80211_confi ++@@ -3845,6 +3858,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, +@@ -87,7 +87,7 @@ + CFG80211_TESTMODE_CMD(ieee80211_testmode_cmd) + --- a/net/mac80211/ieee80211_i.h + +++ b/net/mac80211/ieee80211_i.h +-@@ -1333,6 +1333,7 @@ struct ieee80211_local { ++@@ -1318,6 +1318,7 @@ struct ieee80211_local { + int dynamic_ps_forced_timeout; + + int user_power_level; /* in dBm, for all interfaces */ +@@ -97,7 +97,7 @@ + + --- 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 + struct ieee80211_sub_if_data *sdata; + struct cfg80211_chan_def chandef = {}; + u32 changed = 0; +@@ -106,7 +106,7 @@ + u32 offchannel_flag; + + 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 + } + rcu_read_unlock(); + +@@ -119,7 +119,7 @@ + if (local->hw.conf.power_level != power) { + 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_ + IEEE80211_RADIOTAP_MCS_HAVE_BW; + local->hw.radiotap_vht_details = IEEE80211_RADIOTAP_VHT_KNOWN_GI | + IEEE80211_RADIOTAP_VHT_KNOWN_BANDWIDTH; +@@ -129,7 +129,7 @@ + local->user_power_level = IEEE80211_UNSET_POWER_LEVEL; + --- 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 + [NL80211_ATTR_NETNS_FD] = { .type = NLA_U32 }, + [NL80211_ATTR_SCHED_SCAN_DELAY] = { .type = NLA_U32 }, + [NL80211_ATTR_REG_INDOOR] = { .type = NLA_FLAG }, +@@ -137,7 +137,7 @@ + }; + + /* 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 + 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 b0fb9fe..8aab45a 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 { + 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 +-@@ -935,7 +935,7 @@ int ath9k_init_device(u16 devid, struct ++@@ -943,7 +943,7 @@ int ath9k_init_device(u16 devid, struct + + #ifdef CPTCFG_MAC80211_LEDS + /* must be initialized before ieee80211_register_hw */ +@@ -176,7 +176,7 @@ + #endif + --- a/drivers/net/wireless/ath/ath9k/debug.c + +++ b/drivers/net/wireless/ath/ath9k/debug.c +-@@ -1391,6 +1391,61 @@ static const struct file_operations fops ++@@ -1393,6 +1393,61 @@ static const struct file_operations fops + .llseek = default_llseek, + }; + +@@ -238,7 +238,7 @@ + + int ath9k_init_debug(struct ath_hw *ah) + { +-@@ -1415,6 +1470,10 @@ int ath9k_init_debug(struct ath_hw *ah) ++@@ -1417,6 +1472,10 @@ int ath9k_init_debug(struct ath_hw *ah) + &fops_eeprom); + debugfs_create_file("chanbw", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, + sc, &fops_chanbw); +diff --git a/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch b/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch +index 631a692..2b2c763 100644 +--- a/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch ++++ b/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch +@@ -1,6 +1,6 @@ + --- a/drivers/net/wireless/ath/ath9k/debug.c + +++ b/drivers/net/wireless/ath/ath9k/debug.c +-@@ -1447,6 +1447,50 @@ static const struct file_operations fops ++@@ -1449,6 +1449,50 @@ static const struct file_operations fops + #endif + + +@@ -51,7 +51,7 @@ + int ath9k_init_debug(struct ath_hw *ah) + { + struct ath_common *common = ath9k_hw_common(ah); +-@@ -1474,6 +1518,8 @@ int ath9k_init_debug(struct ath_hw *ah) ++@@ -1476,6 +1520,8 @@ int ath9k_init_debug(struct ath_hw *ah) + debugfs_create_file("gpio_led", S_IWUSR, + sc->debug.debugfs_phy, sc, &fops_gpio_led); + #endif +@@ -62,7 +62,7 @@ + debugfs_create_devm_seqfile(sc->dev, "interrupt", sc->debug.debugfs_phy, + --- a/drivers/net/wireless/ath/ath9k/hw.h + +++ b/drivers/net/wireless/ath/ath9k/hw.h +-@@ -513,6 +513,12 @@ enum { ++@@ -519,6 +519,12 @@ enum { + ATH9K_RESET_COLD, + }; + +@@ -75,7 +75,7 @@ + struct ath9k_hw_version { + u32 magic; + u16 devid; +-@@ -794,6 +800,8 @@ struct ath_hw { ++@@ -804,6 +810,8 @@ struct ath_hw { + u32 rfkill_polarity; + u32 ah_flags; + +@@ -84,7 +84,7 @@ + bool reset_power_on; + bool htc_reset_init; + +-@@ -1055,6 +1063,7 @@ void ath9k_hw_check_nav(struct ath_hw *a ++@@ -1066,6 +1074,7 @@ void ath9k_hw_check_nav(struct ath_hw *a + bool ath9k_hw_check_alive(struct ath_hw *ah); + + bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode); +@@ -94,7 +94,7 @@ + struct ath_gen_timer *ath_gen_timer_alloc(struct ath_hw *ah, + --- 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 + } + EXPORT_SYMBOL(ath9k_hw_get_tsf_offset); + +@@ -115,7 +115,7 @@ + int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, + 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 + 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 a8f1999..49b6367 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 @@ + --- a/drivers/net/wireless/ath/ath9k/hw.h + +++ b/drivers/net/wireless/ath/ath9k/hw.h +-@@ -710,6 +710,7 @@ struct ath_spec_scan { ++@@ -720,6 +720,7 @@ struct ath_spec_scan { + * @config_pci_powersave: + * @calibrate: periodic calibration for NF, ANI, IQ, ADC gain, ADC-DC + * +@@ -8,7 +8,7 @@ + * @spectral_scan_config: set parameters for spectral scan and enable/disable it + * @spectral_scan_trigger: trigger a spectral scan run + * @spectral_scan_wait: wait for a spectral scan run to finish +-@@ -732,6 +733,7 @@ struct ath_hw_ops { ++@@ -742,6 +743,7 @@ struct ath_hw_ops { + struct ath_hw_antcomb_conf *antconf); + void (*antdiv_comb_conf_set)(struct ath_hw *ah, + struct ath_hw_antcomb_conf *antconf); +@@ -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 + if (ah->caps.hw_caps & ATH9K_HW_CAP_5GHZ) + ath9k_init_band_txpower(sc, IEEE80211_BAND_5GHZ); + +@@ -65,7 +65,7 @@ + } + + static const struct ieee80211_iface_limit if_limits[] = { +-@@ -895,6 +896,18 @@ static void ath9k_set_hw_capab(struct at ++@@ -903,6 +904,18 @@ static void ath9k_set_hw_capab(struct at + SET_IEEE80211_PERM_ADDR(hw, common->macaddr); + } + +@@ -84,7 +84,7 @@ + int ath9k_init_device(u16 devid, struct ath_softc *sc, + const struct ath_bus_ops *bus_ops) + { +-@@ -940,6 +953,8 @@ int ath9k_init_device(u16 devid, struct ++@@ -948,6 +961,8 @@ int ath9k_init_device(u16 devid, struct + ARRAY_SIZE(ath9k_tpt_blink)); + #endif + +@@ -110,7 +110,7 @@ + static inline void ath9k_hw_set_bt_ant_diversity(struct ath_hw *ah, bool enable) + --- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c + +++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c +-@@ -1316,9 +1316,30 @@ void ar5008_hw_init_rate_txpower(struct ++@@ -1327,9 +1327,30 @@ void ar5008_hw_init_rate_txpower(struct + } + } + +@@ -141,7 +141,7 @@ + static const u32 ar5416_cca_regs[6] = { + AR_PHY_CCA, + AR_PHY_CH1_CCA, +-@@ -1333,6 +1354,8 @@ int ar5008_hw_attach_phy_ops(struct ath_ ++@@ -1344,6 +1365,8 @@ int ar5008_hw_attach_phy_ops(struct ath_ + if (ret) + 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 +--- 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 @@ + --- a/drivers/net/wireless/ath/ath9k/hw.c + +++ b/drivers/net/wireless/ath/ath9k/hw.c +-@@ -245,6 +245,19 @@ void ath9k_hw_get_channel_centers(struct ++@@ -246,6 +246,19 @@ void ath9k_hw_get_channel_centers(struct + centers->synth_center + (extoff * HT40_CHANNEL_CENTER_SHIFT); + } + +@@ -20,7 +20,7 @@ + /******************/ + /* 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 + if (AR_SREV_9100(ah)) + udelay(50); + +@@ -30,7 +30,7 @@ + return true; + } + +-@@ -1481,6 +1497,9 @@ static bool ath9k_hw_chip_reset(struct a ++@@ -1485,6 +1501,9 @@ static bool ath9k_hw_chip_reset(struct a + ar9003_hw_internal_regulator_apply(ah); + ath9k_hw_init_pll(ah, chan); + +@@ -40,7 +40,7 @@ + return true; + } + +-@@ -1782,8 +1801,14 @@ static int ath9k_hw_do_fastcc(struct ath ++@@ -1786,8 +1805,14 @@ static int ath9k_hw_do_fastcc(struct ath + if (AR_SREV_9271(ah)) + ar9002_hw_load_ani_reg(ah, chan); + +@@ -55,7 +55,7 @@ + return -EINVAL; + } + +-@@ -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 + 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 +--- 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 @@ + --- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c + +++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c +-@@ -945,55 +945,6 @@ static bool ar5008_hw_ani_control_new(st ++@@ -956,55 +956,6 @@ static bool ar5008_hw_ani_control_new(st + * on == 0 means more noise imm + */ + 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 +--- 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 +++++++++++ + 2 files changed, 11 insertions(+), 13 deletions(-) + +---- a/drivers/net/wireless/rt2x00/rt2800.h +-+++ b/drivers/net/wireless/rt2x00/rt2800.h +-@@ -2960,17 +2960,4 @@ enum rt2800_eeprom_word { +- */ +- #define BCN_TBTT_OFFSET 64 +- +--/* +-- * RT2800 driver data structure +-- */ +--struct rt2800_drv_data { +-- u8 calibration_bw20; +-- u8 calibration_bw40; +-- u8 bbp25; +-- u8 bbp26; +-- u8 txmixer_gain_24g; +-- u8 txmixer_gain_5g; +-- unsigned int tbtt_tick; +--}; +-- +- #endif /* RT2800_H */ + --- a/drivers/net/wireless/rt2x00/rt2800lib.h + +++ b/drivers/net/wireless/rt2x00/rt2800lib.h +-@@ -20,6 +20,17 @@ ++@@ -20,6 +20,20 @@ + #ifndef RT2800LIB_H + #define RT2800LIB_H + +++#include "rt2800.h" +++ + +/* RT2800 driver data structure */ + +struct rt2800_drv_data { + + u8 calibration_bw20; +@@ -55,8 +37,30 @@ Changes since v1: --- + + u8 txmixer_gain_24g; + + u8 txmixer_gain_5g; + + unsigned int tbtt_tick; +++ DECLARE_BITMAP(sta_ids, STA_IDS_SIZE); + +}; + + + 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 ++@@ -2969,18 +2969,4 @@ enum rt2800_eeprom_word { ++ #define WCID_END 222 ++ #define STA_IDS_SIZE (WCID_END - WCID_START + 2) ++ ++-/* ++- * RT2800 driver data structure ++- */ ++-struct rt2800_drv_data { ++- u8 calibration_bw20; ++- u8 calibration_bw40; ++- u8 bbp25; ++- u8 bbp26; ++- u8 txmixer_gain_24g; ++- u8 txmixer_gain_5g; ++- unsigned int tbtt_tick; ++- DECLARE_BITMAP(sta_ids, STA_IDS_SIZE); ++-}; ++- ++ #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 +--- 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: + + --- 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 + + int rt2800_probe_hw(struct rt2x00_dev *rt2x00dev) + { +@@ -32,7 +32,7 @@ Changes since v1: + int retval; + 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 + if (retval) + return retval; + +@@ -44,9 +44,9 @@ Changes since v1: + */ + --- a/drivers/net/wireless/rt2x00/rt2800lib.h + +++ b/drivers/net/wireless/rt2x00/rt2800lib.h +-@@ -20,6 +20,10 @@ +- #ifndef RT2800LIB_H +- #define RT2800LIB_H ++@@ -22,6 +22,10 @@ ++ ++ #include "rt2800.h" + + +enum rt2800_flag { + + RT2800_HAS_HIGH_SHARED_MEM, +@@ -55,16 +55,16 @@ Changes since v1: + /* RT2800 driver data structure */ + struct rt2800_drv_data { + u8 calibration_bw20; +-@@ -29,6 +33,8 @@ struct rt2800_drv_data { +- u8 txmixer_gain_24g; ++@@ -32,6 +36,8 @@ struct rt2800_drv_data { + u8 txmixer_gain_5g; + unsigned int tbtt_tick; ++ DECLARE_BITMAP(sta_ids, STA_IDS_SIZE); + + + + unsigned long rt2800_flags; + }; + + struct rt2800_ops { +-@@ -61,6 +67,13 @@ struct rt2800_ops { ++@@ -64,6 +70,13 @@ struct rt2800_ops { + __le32 *(*drv_get_txwi)(struct queue_entry *entry); + }; + +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 +--- 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 +@@ -175,7 +175,7 @@ Changes since v1: --- + + /* + * Update WCID information +-@@ -1437,8 +1467,11 @@ int rt2800_config_pairwise_key(struct rt ++@@ -1405,8 +1435,11 @@ int rt2800_config_pairwise_key(struct rt + sizeof(key_entry.rx_mic)); + + offset = PAIRWISE_KEY_ENTRY(key->hw_key_idx); +@@ -187,7 +187,7 @@ Changes since v1: --- + } + + /* +-@@ -4908,14 +4941,19 @@ static int rt2800_init_registers(struct ++@@ -4884,14 +4917,19 @@ static int rt2800_init_registers(struct + /* + * ASIC will keep garbage value after boot, clear encryption keys. + */ +@@ -207,7 +207,7 @@ Changes since v1: --- + } + + /* +-@@ -5041,8 +5079,10 @@ static int rt2800_wait_bbp_ready(struct ++@@ -5017,8 +5055,10 @@ static int rt2800_wait_bbp_ready(struct + * BBP was enabled after firmware was loaded, + * but we need to reactivate it now. + */ +@@ -218,7 +218,7 @@ Changes since v1: --- + msleep(1); + + 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 + /* + * Send signal during boot time to initialize firmware. + */ +@@ -239,7 +239,7 @@ Changes since v1: --- + msleep(1); + + /* +-@@ -7751,6 +7799,8 @@ int rt2800_probe_hw(struct rt2x00_dev *r ++@@ -7725,6 +7773,8 @@ int rt2800_probe_hw(struct rt2x00_dev *r + int retval; + u32 reg; + +@@ -248,22 +248,22 @@ Changes since v1: --- + retval = rt2800_probe_rt(rt2x00dev); + if (retval) + 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 ++ return; + +- offset = MAC_IVEIV_ENTRY(hw_key_idx); ++ offset = MAC_IVEIV_ENTRY(key->hw_key_idx); + + + + rt2800_shared_mem_lock(rt2x00dev); + rt2800_register_multiread(rt2x00dev, offset, + &iveiv_entry, sizeof(iveiv_entry)); + + rt2800_shared_mem_unlock(rt2x00dev); + +- 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 +-@@ -35,6 +35,11 @@ struct rt2800_drv_data { +- unsigned int tbtt_tick; ++@@ -38,6 +38,11 @@ struct rt2800_drv_data { ++ DECLARE_BITMAP(sta_ids, STA_IDS_SIZE); + + unsigned long rt2800_flags; + + +@@ -274,7 +274,7 @@ Changes since v1: --- + }; + + struct rt2800_ops { +-@@ -65,6 +70,10 @@ struct rt2800_ops { ++@@ -68,6 +73,10 @@ struct rt2800_ops { + const u8 *data, const size_t len); + int (*drv_init_registers)(struct rt2x00_dev *rt2x00dev); + __le32 *(*drv_get_txwi)(struct queue_entry *entry); +@@ -285,7 +285,7 @@ Changes since v1: --- + }; + + static inline bool rt2800_has_high_shared_mem(struct rt2x00_dev *rt2x00dev) +-@@ -74,6 +83,29 @@ static inline bool rt2800_has_high_share ++@@ -77,6 +86,29 @@ static inline bool rt2800_has_high_share + return test_bit(RT2800_HAS_HIGH_SHARED_MEM, &drv_data->rt2800_flags); + } + +@@ -486,7 +486,7 @@ Changes since v1: --- + /* + * Queue handlers. + */ +-@@ -294,8 +315,10 @@ static int rt2800usb_write_firmware(stru ++@@ -299,8 +320,10 @@ static int rt2800usb_write_firmware(stru + data + offset, length); + } + +@@ -497,7 +497,7 @@ Changes since v1: --- + + /* + * Send firmware request to device to load firmware, +-@@ -310,7 +333,10 @@ static int rt2800usb_write_firmware(stru ++@@ -315,7 +338,10 @@ static int rt2800usb_write_firmware(stru + } + + msleep(10); +@@ -508,7 +508,7 @@ Changes since v1: --- + + return 0; + } +-@@ -328,8 +354,10 @@ static int rt2800usb_init_registers(stru ++@@ -333,8 +359,10 @@ static int rt2800usb_init_registers(stru + if (rt2800_wait_csr_ready(rt2x00dev)) + return -EBUSY; + +@@ -519,7 +519,7 @@ Changes since v1: --- + + reg = 0; + rt2x00_set_field32(®, MAC_SYS_CTRL_RESET_CSR, 1); +-@@ -859,6 +887,9 @@ static const struct rt2800_ops rt2800usb ++@@ -863,6 +891,9 @@ static const struct rt2800_ops rt2800usb + .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-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 +--- 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 + + --- 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); + */ + static int rt2800_init_registers(struct rt2x00_dev *rt2x00dev) + { +@@ -32,7 +32,7 @@ Signed-off-by: Gabor Juhos + u32 reg; + 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 + /* + * Clear all beacons + */ +@@ -41,7 +41,7 @@ Signed-off-by: Gabor Juhos + rt2800_clear_beacon_register(rt2x00dev, i); + + 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 + 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 + */ + --- a/drivers/net/wireless/rt2x00/rt2800lib.h + +++ b/drivers/net/wireless/rt2x00/rt2800lib.h +-@@ -33,6 +33,7 @@ struct rt2800_drv_data { ++@@ -35,6 +35,7 @@ struct rt2800_drv_data { + u8 txmixer_gain_24g; + u8 txmixer_gain_5g; + unsigned int tbtt_tick; + + unsigned int hw_beacon_count; ++ DECLARE_BITMAP(sta_ids, STA_IDS_SIZE); + + 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 +--- 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 + */ + --- 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 + 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 +--- 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 + + --- 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 + if (rt2x00_rt(rt2x00dev, RT3593)) + __set_bit(RT2800_HAS_HIGH_SHARED_MEM, &drv_data->rt2800_flags); + +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 +--- 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 + + --- 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 + 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 +--- 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 + #define RF5370 0x5370 + --- 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 + {173, 0x61, 0, 9}, + }; + +@@ -98,7 +98,7 @@ Signed-off-by: Gabor Juhos + static const struct rf_channel rf_vals_5592_xtal20[] = { + /* 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 + 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 +--- 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 + + --- 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 + case RF3053: + case RF3070: + case RF3290: +@@ -18,7 +18,7 @@ Signed-off-by: Gabor Juhos + case RF5360: + 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 + 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 +--- 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 + + --- 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 + } + } + +@@ -223,7 +223,7 @@ Signed-off-by: Gabor Juhos + #define POWER_BOUND 0x27 + #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 + 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 +--- 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 + + --- 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 + 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 +--- 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 + #define RX_FILTER_CFG 0x1400 + --- 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 + rt2800_register_write(rt2x00dev, TX_SW_CFG2, + 0x00000000); + } +@@ -48,7 +48,7 @@ Signed-off-by: Gabor Juhos + } else if (rt2x00_rt(rt2x00dev, RT5390) || + 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 + + rt2800_register_read(rt2x00dev, MAX_LEN_CFG, ®); + rt2x00_set_field32(®, MAX_LEN_CFG_MAX_MPDU, AGGREGATION_SIZE); +@@ -63,7 +63,7 @@ Signed-off-by: Gabor Juhos + rt2x00_set_field32(®, MAX_LEN_CFG_MAX_PSDU, 2); + 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 + reg = rt2x00_rt(rt2x00dev, RT5592) ? 0x00000082 : 0x00000002; + rt2800_register_write(rt2x00dev, TXOP_HLDR_ET, reg); + +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 +--- 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 + + --- 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 + rt2800_bbp_write(rt2x00dev, 103, 0xc0); + } + +@@ -59,7 +59,7 @@ Signed-off-by: Gabor Juhos + static void rt2800_init_bbp_53xx(struct rt2x00_dev *rt2x00dev) + { + 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 + 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 +--- 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 + /* + --- 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 + /* TODO: enable stream mode support */ + } + +@@ -166,7 +166,7 @@ Signed-off-by: Gabor Juhos + static void rt2800_init_rfcsr_5390(struct rt2x00_dev *rt2x00dev) + { + 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 + case RT3390: + rt2800_init_rfcsr_3390(rt2x00dev); + break; +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 +--- 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 + + --- 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 + 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 +--- 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 + + --- 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 + return clamp_t(char, txpower, MIN_A_TXPOWER, MAX_A_TXPOWER); + } + +@@ -47,7 +47,7 @@ Signed-off-by: Gabor Juhos + static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev, + 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 + rt2800_txpower_to_dev(rt2x00dev, rf->channel, + info->default_power3); + +@@ -60,7 +60,7 @@ Signed-off-by: Gabor Juhos + switch (rt2x00dev->chip.rf) { + case RF2020: + case RF3020: +-@@ -3530,6 +3566,15 @@ static void rt2800_config_channel(struct ++@@ -3506,6 +3542,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); +@@ -76,7 +76,7 @@ Signed-off-by: Gabor Juhos + } else { + 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 + !rt2x00_rt(rt2x00dev, RT5392)) { + if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) { + rt2800_bbp_write(rt2x00dev, 82, 0x62); +@@ -84,7 +84,7 @@ Signed-off-by: Gabor Juhos + rt2800_bbp_write(rt2x00dev, 75, 0x46); + } 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 + rt2800_bbp_write(rt2x00dev, 82, 0x84); + rt2800_bbp_write(rt2x00dev, 75, 0x50); + } +@@ -110,7 +110,7 @@ Signed-off-by: Gabor Juhos + rt2800_bbp_write(rt2x00dev, 83, 0x9a); + + 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 + + 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 +--- 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 + + --- 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 + 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 +--- 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 + + --- 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 + 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 +--- 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 + + --- 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 + { + u16 word; + +@@ -21,7 +21,7 @@ Signed-off-by: Gabor Juhos + return 0; + + 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 + { + u16 word; + +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 +--- 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 + + --- 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 + 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 +--- 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 + + --- 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 + 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 +--- 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 + + --- 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 + rt2800_eeprom_read(rt2x00dev, EEPROM_LNA, &eeprom); + lna_gain = rt2x00_get_field16(eeprom, EEPROM_LNA_A0); + } else if (libconf->rf.channel <= 128) { +@@ -20,7 +20,7 @@ Signed-off-by: Gabor Juhos + rt2800_eeprom_read(rt2x00dev, EEPROM_EXT_LNA2, &eeprom); + 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 + 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 +--- 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 + + --- 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 + else + vgc = 0x2e + rt2x00dev->lna_gain; + } else { /* 5GHZ band */ +@@ -20,7 +20,7 @@ Signed-off-by: Gabor Juhos + vgc = 0x20 + (rt2x00dev->lna_gain * 5) / 3; + 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 + { + if (qual->vgc_level != vgc_level) { + if (rt2x00_rt(rt2x00dev, RT3572) || +@@ -30,7 +30,7 @@ Signed-off-by: Gabor Juhos + rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, + 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 + } + 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 +--- 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 + + --- 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 + 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); +@@ -20,7 +20,7 @@ Signed-off-by: Gabor Juhos + if (rt2x00_get_field16(word, EEPROM_RSSI_BG2_LNA_A1) == 0x00 || + 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 + 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); +@@ -30,7 +30,7 @@ Signed-off-by: Gabor Juhos + if (rt2x00_get_field16(word, EEPROM_RSSI_A2_LNA_A2) == 0x00 || + 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 + } + 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 +--- 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 + + --- 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 + 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 +--- 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 + + --- 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 + if (retval) + return retval; + +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 +--- a/package/kernel/mac80211/patches/603-rt2x00-introduce-rt2x00eeprom.patch ++++ b/package/kernel/mac80211/patches/603-rt2x00-introduce-rt2x00eeprom.patch +@@ -1,13 +1,13 @@ + --- a/.local-symbols + +++ b/.local-symbols +-@@ -263,6 +263,7 @@ RT2X00_LIB_FIRMWARE= ++@@ -312,6 +312,7 @@ RT2X00_LIB_FIRMWARE= + RT2X00_LIB_CRYPTO= + RT2X00_LIB_LEDS= + RT2X00_LIB_DEBUGFS= + +RT2X00_LIB_EEPROM= + RT2X00_DEBUG= +- RTL_CARDS= +- RTL8192CE= ++ WL_MEDIATEK= ++ MT7601U= + --- a/drivers/net/wireless/rt2x00/Kconfig + +++ b/drivers/net/wireless/rt2x00/Kconfig + @@ -69,6 +69,7 @@ config RT2800PCI +@@ -48,7 +48,7 @@ + obj-$(CPTCFG_RT2X00_LIB_MMIO) += rt2x00mmio.o + --- a/drivers/net/wireless/rt2x00/rt2800lib.h + +++ b/drivers/net/wireless/rt2x00/rt2800lib.h +-@@ -43,6 +43,8 @@ struct rt2800_drv_data { ++@@ -46,6 +46,8 @@ struct rt2800_drv_data { + } shmem_lock; + }; + +@@ -57,7 +57,7 @@ + struct rt2800_ops { + void (*register_read)(struct rt2x00_dev *rt2x00dev, + const unsigned int offset, u32 *value); +-@@ -176,6 +178,15 @@ static inline int rt2800_read_eeprom(str ++@@ -179,6 +181,15 @@ static inline int rt2800_read_eeprom(str + { + const struct rt2800_ops *rt2800ops = rt2x00dev->ops->drv; + +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 +--- 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 @@ + * 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 + 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/610-rt2x00-fix-rt3352-ext-pa.patch b/package/kernel/mac80211/patches/610-rt2x00-fix-rt3352-ext-pa.patch +index 067d2ea..39b1ccc 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 +-@@ -3552,11 +3552,18 @@ static void rt2800_config_channel(struct ++@@ -3528,11 +3528,18 @@ static void rt2800_config_channel(struct + /* + * Change BBP settings + */ +@@ -19,7 +19,7 @@ + } else if (rt2x00_rt(rt2x00dev, RT3593)) { + 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 + + static void rt2800_init_rfcsr_3352(struct rt2x00_dev *rt2x00dev) + { +@@ -32,7 +32,7 @@ + rt2800_rf_init_calibration(rt2x00dev, 30); + + 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 + rt2800_rfcsr_write(rt2x00dev, 31, 0x80); + rt2800_rfcsr_write(rt2x00dev, 32, 0x80); + rt2800_rfcsr_write(rt2x00dev, 33, 0x00); +@@ -66,7 +66,7 @@ + rt2800_rfcsr_write(rt2x00dev, 43, 0xdb); + 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 + rt2800_rfcsr_write(rt2x00dev, 47, 0x0d); + rt2800_rfcsr_write(rt2x00dev, 48, 0x14); + rt2800_rfcsr_write(rt2x00dev, 49, 0x00); +@@ -96,7 +96,7 @@ + rt2800_rfcsr_write(rt2x00dev, 59, 0x00); + 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 + * RT53xx: defined in "EEPROM_CHIP_ID" field + */ + if (rt2x00_rt(rt2x00dev, RT3290) || +@@ -104,7 +104,7 @@ + rt2x00_rt(rt2x00dev, RT5390) || + 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 + /* + * Detect if this device has Bluetooth co-existence. + */ +@@ -114,7 +114,7 @@ + __set_bit(CAPABILITY_BT_COEXIST, &rt2x00dev->cap_flags); + + /* +-@@ -7822,6 +7857,22 @@ static int rt2800_init_eeprom(struct rt2 ++@@ -7798,6 +7833,22 @@ static int rt2800_init_eeprom(struct rt2 + EIRP_MAX_TX_POWER_LIMIT) + __set_bit(CAPABILITY_POWER_LIMIT, &rt2x00dev->cap_flags); + +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 +--- 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 +-@@ -8209,6 +8209,27 @@ static const struct rf_channel rf_vals_5 ++@@ -8185,6 +8185,27 @@ static const struct rf_channel rf_vals_5 + {196, 83, 0, 12, 1}, + }; + +@@ -28,7 +28,7 @@ + static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev) + { + 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 + case RF5390: + case RF5392: + spec->num_channels = 14; +@@ -40,7 +40,7 @@ + break; + + case RF3052: +-@@ -8481,6 +8505,19 @@ static int rt2800_probe_rt(struct rt2x00 ++@@ -8455,6 +8479,19 @@ static int rt2800_probe_rt(struct rt2x00 + return 0; + } + +@@ -60,7 +60,7 @@ + int rt2800_probe_hw(struct rt2x00_dev *rt2x00dev) + { + 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 + rt2800_register_write(rt2x00dev, GPIO_CTRL, reg); + + /* +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 +--- a/package/kernel/mac80211/patches/615-rt2x00-fix_20mhz_clk.patch ++++ b/package/kernel/mac80211/patches/615-rt2x00-fix_20mhz_clk.patch +@@ -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 + + 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 +--- a/package/kernel/mac80211/patches/616-rt2x00-support-rt5350.patch ++++ b/package/kernel/mac80211/patches/616-rt2x00-support-rt5350.patch +@@ -10,7 +10,7 @@ + #define RF5370 0x5370 + --- 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 + + rt2800_rfcsr_write(rt2x00dev, 59, + r59_non_bt[idx]); +@@ -24,7 +24,7 @@ + } + } + } +-@@ -3516,6 +3523,7 @@ static void rt2800_config_channel(struct ++@@ -3492,6 +3499,7 @@ static void rt2800_config_channel(struct + rt2800_config_channel_rf3853(rt2x00dev, conf, rf, info); + break; + case RF3070: +@@ -32,7 +32,7 @@ + case RF5360: + case RF5362: + case RF5370: +-@@ -3534,6 +3542,7 @@ static void rt2800_config_channel(struct ++@@ -3510,6 +3518,7 @@ static void rt2800_config_channel(struct + if (rt2x00_rf(rt2x00dev, RF3070) || + rt2x00_rf(rt2x00dev, RF3290) || + rt2x00_rf(rt2x00dev, RF3322) || +@@ -40,7 +40,7 @@ + rt2x00_rf(rt2x00dev, RF5360) || + 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 + /* + * Clear update flag + */ +@@ -50,7 +50,7 @@ + rt2800_bbp_read(rt2x00dev, 49, &bbp); + 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 + case RF3070: + case RF3290: + case RF3853: +@@ -58,7 +58,7 @@ + case RF5360: + case RF5362: + case RF5370: +-@@ -5111,6 +5122,8 @@ static int rt2800_init_registers(struct ++@@ -5087,6 +5098,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); +@@ -67,7 +67,7 @@ + } else { + 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 + + rt2800_bbp_write(rt2x00dev, 82, 0x62); + +@@ -84,7 +84,7 @@ + + 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 + + rt2800_bbp_write(rt2x00dev, 104, 0x92); + +@@ -101,7 +101,7 @@ + + 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 + rt2800_bbp_write(rt2x00dev, 143, 0xa2); + + rt2800_bbp_write(rt2x00dev, 148, 0xc8); +@@ -115,7 +115,7 @@ + } + + 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 + rt2800_init_bbp_3290(rt2x00dev); + break; + case RT3352: +@@ -123,7 +123,7 @@ + rt2800_init_bbp_3352(rt2x00dev); + 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 + rt2800_rfcsr_write(rt2x00dev, 20, rfcsr); + } + +@@ -200,7 +200,7 @@ + static void rt2800_init_rfcsr_5390(struct rt2x00_dev *rt2x00dev) + { + 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 + case RT3593: + rt2800_init_rfcsr_3593(rt2x00dev); + break; +@@ -210,7 +210,7 @@ + case RT5390: + 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 + 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); +@@ -223,7 +223,7 @@ + } else if (rt2x00_rt(rt2x00dev, RT2860) || + 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 + rt2800_eeprom_read(rt2x00dev, EEPROM_CHIP_ID, &rf); + else if (rt2x00_rt(rt2x00dev, RT3883)) + rf = RF3853; +@@ -232,7 +232,7 @@ + else + 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 + case RF3320: + case RF3322: + case RF3853: +@@ -240,7 +240,7 @@ + case RF5360: + 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 + case RF3290: + case RF3320: + case RF3322: +@@ -248,7 +248,7 @@ + case RF5360: + 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 + case RF3070: + case RF3290: + case RF3853: +@@ -256,7 +256,7 @@ + case RF5360: + 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 + case RT3572: + case RT3593: + case RT3883: +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 +--- 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 +@@ -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 + rt2800_init_led(rt2x00dev, &rt2x00dev->led_assoc, LED_TYPE_ASSOC); + rt2800_init_led(rt2x00dev, &rt2x00dev->led_qual, LED_TYPE_QUALITY); + +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 +--- 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 +-@@ -7841,10 +7841,11 @@ static int rt2800_init_eeprom(struct rt2 ++@@ -7817,10 +7817,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 +--- 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 @@ + * RFCSR 31: + --- 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 + rt2x00_rf(rt2x00dev, RF5390) || + rt2x00_rf(rt2x00dev, RF5392)) { + rt2800_rfcsr_read(rt2x00dev, 30, &rfcsr); +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 +--- 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 + goto err_wiphy_new; + } + +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 +--- 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 + wdev->wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites); + wdev->wiphy->reg_notifier = lbs_reg_notifier; + +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 +--- a/package/kernel/mac80211/patches/820-b43-add-antenna-control.patch ++++ b/package/kernel/mac80211/patches/820-b43-add-antenna-control.patch +@@ -9,7 +9,7 @@ + antenna = b43_antenna_to_phyctl(antenna); + ctl = b43_shm_read16(dev, B43_SHM_SHARED, B43_SHM_SH_BEACPHYCTL); + /* We can't send beacons with short preamble. Would get PHY errors. */ +-@@ -3302,8 +3302,8 @@ static int b43_chip_init(struct b43_wlde ++@@ -3300,8 +3300,8 @@ static int b43_chip_init(struct b43_wlde + + /* Select the antennae */ + if (phy->ops->set_rx_antenna) +@@ -20,7 +20,7 @@ + + if (phy->type == B43_PHYTYPE_B) { + value16 = b43_read16(dev, 0x005E); +-@@ -4003,7 +4003,6 @@ static int b43_op_config(struct ieee8021 ++@@ -4001,7 +4001,6 @@ static int b43_op_config(struct ieee8021 + struct b43_wldev *dev = wl->current_dev; + struct b43_phy *phy = &dev->phy; + struct ieee80211_conf *conf = &hw->conf; +@@ -28,7 +28,7 @@ + int err = 0; + + mutex_lock(&wl->mutex); +-@@ -4046,11 +4045,9 @@ static int b43_op_config(struct ieee8021 ++@@ -4044,11 +4043,9 @@ static int b43_op_config(struct ieee8021 + } + + /* Antennas for RX and management frame TX. */ +@@ -42,7 +42,7 @@ + + if (wl->radio_enabled != phy->radio_on) { + if (wl->radio_enabled) { +-@@ -5213,6 +5210,47 @@ static int b43_op_get_survey(struct ieee ++@@ -5209,6 +5206,47 @@ static int b43_op_get_survey(struct ieee + return 0; + } + +@@ -90,7 +90,7 @@ + static const struct ieee80211_ops b43_hw_ops = { + .tx = b43_op_tx, + .conf_tx = b43_op_conf_tx, +-@@ -5234,6 +5272,8 @@ static const struct ieee80211_ops b43_hw ++@@ -5230,6 +5268,8 @@ static const struct ieee80211_ops b43_hw + .sw_scan_complete = b43_op_sw_scan_complete_notifier, + .get_survey = b43_op_get_survey, + .rfkill_poll = b43_rfkill_poll, +@@ -99,7 +99,7 @@ + }; + + /* Hard-reset the chip. Do not call this directly. +-@@ -5542,6 +5582,8 @@ static int b43_one_core_attach(struct b4 ++@@ -5538,6 +5578,8 @@ static int b43_one_core_attach(struct b4 + if (!wldev) + goto out; + +@@ -108,7 +108,7 @@ + wldev->use_pio = b43_modparam_pio; + wldev->dev = dev; + wldev->wl = wl; +-@@ -5632,6 +5674,9 @@ static struct b43_wl *b43_wireless_init( ++@@ -5628,6 +5670,9 @@ static struct b43_wl *b43_wireless_init( + + hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN; + +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 685a5f9..f9799ce 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 +-@@ -1213,6 +1213,7 @@ static int __init brcmfmac_module_init(v ++@@ -1189,6 +1189,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 +--- 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 ++@@ -692,9 +692,37 @@ static struct wireless_dev *brcmf_cfg802 + u32 *flags, + struct vif_params *params) + { +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 +--- a/package/kernel/mac80211/patches/900-wlcore-Add-support-for-DT-platform-data.patch ++++ /dev/null +@@ -1,139 +0,0 @@ +-When running with DT, we no longer have a board file that can set up the +-platform data for wlcore. Allow this data to be passed from DT. +- +-Since some platforms use a gpio-irq, add support for passing either the +-irq number or the gpio number. For the latter case, the driver will +-request the gpio and convert it to the irq number. If an irq is +-specified, it'll be used as is. +- +-[Arik - the pdev_data pointer does not belong to us and is freed when +-the device is released. Dereference to our private data first.] +- +-Signed-off-by: Ido Yariv +-Signed-off-by: Arik Nemtsov +---- +- drivers/net/wireless/ti/wlcore/sdio.c | 71 ++++++++++++++++++++++++++++++++--- +- include/linux/wl12xx.h | 3 +- +- 2 files changed, 67 insertions(+), 7 deletions(-) +- +---- a/drivers/net/wireless/ti/wlcore/sdio.c +-+++ b/drivers/net/wireless/ti/wlcore/sdio.c +-@@ -34,6 +34,7 @@ +- #include +- #include +- #include +-+#include +- +- #include "wlcore.h" +- #include "wl12xx_80211.h" +-@@ -214,6 +215,61 @@ static struct wl1271_if_operations sdio_ +- .set_block_size = wl1271_sdio_set_block_size, +- }; +- +-+static const struct of_device_id wlcore_of_match[] = { +-+ { +-+ .compatible = "wlcore", +-+ }, +-+ {} +-+}; +-+MODULE_DEVICE_TABLE(of, wlcore_of_match); +-+ +-+static struct wl12xx_platform_data *get_platform_data(struct device *dev) +-+{ +-+ struct wl12xx_platform_data *pdata; +-+ struct device_node *np; +-+ u32 gpio; +-+ +-+ pdata = wl12xx_get_platform_data(); +-+ if (!IS_ERR(pdata)) +-+ return kmemdup(pdata, sizeof(*pdata), GFP_KERNEL); +-+ +-+ np = of_find_matching_node(NULL, wlcore_of_match); +-+ if (!np) { +-+ dev_err(dev, "No platform data set\n"); +-+ return NULL; +-+ } +-+ +-+ pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); +-+ if (!pdata) { +-+ dev_err(dev, "Can't allocate platform data\n"); +-+ return NULL; +-+ } +-+ +-+ if (of_property_read_u32(np, "irq", &pdata->irq)) { +-+ if (!of_property_read_u32(np, "gpio", &gpio) && +-+ !gpio_request_one(gpio, GPIOF_IN, "wlcore_irq")) { +-+ pdata->gpio = gpio; +-+ pdata->irq = gpio_to_irq(gpio); +-+ } +-+ } +-+ +-+ /* Optional fields */ +-+ pdata->use_eeprom = of_property_read_bool(np, "use-eeprom"); +-+ of_property_read_u32(np, "board-ref-clock", &pdata->board_ref_clock); +-+ of_property_read_u32(np, "board-tcxo-clock", &pdata->board_tcxo_clock); +-+ of_property_read_u32(np, "platform-quirks", &pdata->platform_quirks); +-+ +-+ return pdata; +-+} +-+ +-+static void del_platform_data(struct wl12xx_platform_data *pdata) +-+{ +-+ if (pdata->gpio) +-+ gpio_free(pdata->gpio); +-+ +-+ kfree(pdata); +-+} +-+ +- static int wl1271_probe(struct sdio_func *func, +- const struct sdio_device_id *id) +- { +-@@ -245,10 +301,10 @@ static int wl1271_probe(struct sdio_func +- /* Use block mode for transferring over one block size of data */ +- func->card->quirks |= MMC_QUIRK_BLKSZ_FOR_BYTE_MODE; +- +-- pdev_data.pdata = wl12xx_get_platform_data(); +-- if (IS_ERR(pdev_data.pdata)) { +-- ret = PTR_ERR(pdev_data.pdata); +-- dev_err(glue->dev, "missing wlan platform data: %d\n", ret); +-+ pdev_data.pdata = get_platform_data(&func->dev); +-+ if (!pdev_data.pdata) { +-+ ret = -EINVAL; +-+ dev_err(glue->dev, "missing wlan platform data\n"); +- goto out_free_glue; +- } +- +-@@ -279,7 +335,7 @@ static int wl1271_probe(struct sdio_func +- if (!glue->core) { +- dev_err(glue->dev, "can't allocate platform_device"); +- ret = -ENOMEM; +-- goto out_free_glue; +-+ goto out_free_pdata; +- } +- +- glue->core->dev.parent = &func->dev; +-@@ -313,6 +369,9 @@ static int wl1271_probe(struct sdio_func +- out_dev_put: +- platform_device_put(glue->core); +- +-+out_free_pdata: +-+ del_platform_data(pdev_data->pdata); +-+ +- out_free_glue: +- kfree(glue); +- +-@@ -323,11 +382,14 @@ out: +- static void wl1271_remove(struct sdio_func *func) +- { +- struct wl12xx_sdio_glue *glue = sdio_get_drvdata(func); +-+ struct wlcore_platdev_data *pdev_data = glue->core->dev.platform_data; +-+ struct wl12xx_platform_data *pdata = pdev_data->pdata; +- +- /* Undo decrement done above in wl1271_probe */ +- pm_runtime_get_noresume(&func->dev); +- +- platform_device_unregister(glue->core); +-+ del_platform_data(pdata); +- kfree(glue); +- } +- +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 +--- a/package/kernel/mac80211/patches/910-01-add-support-for-mt7620.patch ++++ b/package/kernel/mac80211/patches/910-01-add-support-for-mt7620.patch +@@ -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 + rt2800_bbp_write(rt2x00dev, 196, (rf->channel <= 14) ? 0x19 : 0x7F); + } + +@@ -258,6 +258,7 @@ + + u32 mac_sys_ctrl, mac_status; + + u32 tx_pin = 0x00150F0F; + + struct hw_mode_spec *spec = &rt2x00dev->spec; +++ struct rt2800_drv_data *drv_data = rt2x00dev->drv_data; + + + + /* Frequeny plan setting */ + + /* +@@ -383,7 +384,6 @@ + + rfcsr &= (~0x4); + + rt2800_rfcsr_write(rt2x00dev, 28, rfcsr); + + +-+ struct rt2800_drv_data *drv_data = rt2x00dev->drv_data; + + /*if (bScan == FALSE)*/ + + if (conf_is_ht40(conf)) { + + txrx_agc_fc = rt2x00_get_field8(drv_data->calibration_bw40, +@@ -523,7 +523,7 @@ + static void rt2800_bbp_write_with_rx_chain(struct rt2x00_dev *rt2x00dev, + 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 + struct channel_info *info) + { + u32 reg; +@@ -532,7 +532,7 @@ + u8 bbp, rfcsr; + + 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 + case RF5592: + rt2800_config_channel_rf55xx(rt2x00dev, conf, rf, info); + break; +@@ -542,7 +542,7 @@ + default: + 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 + else if (rt2x00_rt(rt2x00dev, RT3593) || + rt2x00_rt(rt2x00dev, RT3883)) + rt2800_bbp_write(rt2x00dev, 82, 0x82); +@@ -551,7 +551,7 @@ + rt2800_bbp_write(rt2x00dev, 82, 0xf2); + + 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 + if (rt2x00_rt(rt2x00dev, RT3572)) + rt2800_rfcsr_write(rt2x00dev, 8, 0); + +@@ -560,7 +560,7 @@ + + 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 + + rt2x00_set_field32(&tx_pin, TX_PIN_CFG_RFTR_EN, 1); + rt2x00_set_field32(&tx_pin, TX_PIN_CFG_TRSW_EN, 1); +@@ -568,7 +568,7 @@ + + 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 + rt2x00_set_field8(&rfcsr, RFCSR3_VCOCAL_EN, 1); + rt2800_rfcsr_write(rt2x00dev, 3, rfcsr); + break; +@@ -583,7 +583,7 @@ + default: + return; + } +-@@ -5125,9 +5516,42 @@ static int rt2800_init_registers(struct ++@@ -5101,9 +5492,42 @@ static int rt2800_init_registers(struct + } else if (rt2x00_rt(rt2x00dev, RT5390) || + rt2x00_rt(rt2x00dev, RT5392) || + rt2x00_rt(rt2x00dev, RT5592)) { +@@ -629,7 +629,7 @@ + } else if (rt2x00_rt(rt2x00dev, RT5350)) { + 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 + rt2800_bbp_write(rt2x00dev, 103, 0xc0); + } + +@@ -855,7 +855,7 @@ + static void rt2800_init_bbp(struct rt2x00_dev *rt2x00dev) + { + 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 + return; + case RT5390: + case RT5392: +@@ -867,7 +867,7 @@ + break; + 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 + rt2800_led_open_drain_enable(rt2x00dev); + } + +@@ -875,6 +875,8 @@ + +{ + + u16 freq; + + u8 rfvalue; +++ struct hw_mode_spec *spec = &rt2x00dev->spec; +++ + + /* Initialize RF central register to default value */ + + rt2800_rfcsr_write(rt2x00dev, 0, 0x02); + + rt2800_rfcsr_write(rt2x00dev, 1, 0x03); +@@ -921,7 +923,6 @@ + + rt2800_rfcsr_write(rt2x00dev, 42, 0x5B); + + rt2800_rfcsr_write(rt2x00dev, 43, 0x00); + + +-+ struct hw_mode_spec *spec = &rt2x00dev->spec; + + rt2800_rfcsr_write(rt2x00dev, 11, 0x21); + + if (spec->clk_is_20mhz) + + rt2800_rfcsr_write(rt2x00dev, 13, 0x03); +@@ -1163,7 +1164,7 @@ + static void rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev) + { + 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 + rt2800_init_rfcsr_5350(rt2x00dev); + break; + case RT5390: +@@ -1175,7 +1176,7 @@ + break; + 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 + case RF5390: + case RF5392: + case RF5592: +@@ -1183,7 +1184,7 @@ + break; + 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 + case RF5372: + case RF5390: + case RF5392: +@@ -1191,7 +1192,7 @@ + spec->num_channels = 14; + 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 + case RF5372: + case RF5390: + case RF5392: +diff --git a/package/kernel/mac80211/patches/920-ath10k_allow_fallback_to_board_bin_on_empty_otp_stream.patch b/package/kernel/mac80211/patches/920-ath10k_allow_fallback_to_board_bin_on_empty_otp_stream.patch +deleted file mode 100644 +index 4c04d4f..0000000 +--- a/package/kernel/mac80211/patches/920-ath10k_allow_fallback_to_board_bin_on_empty_otp_stream.patch ++++ /dev/null +@@ -1,20 +0,0 @@ +---- a/drivers/net/wireless/ath/ath10k/core.c +-+++ b/drivers/net/wireless/ath/ath10k/core.c +-@@ -387,9 +387,14 @@ static int ath10k_download_and_run_otp(s +- +- ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot otp execute result %d\n", result); +- +-- if (!skip_otp && result != 0) { +-- ath10k_err(ar, "otp calibration failed: %d", result); +-- return -EINVAL; +-+ if (!skip_otp) { +-+ if (result == 2) { +-+ ath10k_warn(ar, "otp stream is empty, using board.bin contents"); +-+ return 0; +-+ } else if (result != 0) { +-+ ath10k_err(ar, "otp calibration failed: %d", result); +-+ return -EINVAL; +-+ } +- } +- +- 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 +--- 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 + + --- 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 * + 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 +--- 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 + return arvif_iter.arvif; + } + +@@ -22,7 +22,7 @@ + int ath10k_mac_register(struct ath10k *ar) + { + 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 + 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 +--- /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 ++ ++ priv->running_bsses = 0; ++ +++ wait_for_completion(&priv->firmware_loading_complete); +++ ++ return rc; ++ ++ err_stop_firmware: ++@@ -6294,8 +6296,6 @@ static void mwl8k_remove(struct pci_dev ++ return; ++ priv = hw->priv; ++ ++- wait_for_completion(&priv->firmware_loading_complete); ++- ++ if (priv->fw_state == FW_STATE_ERROR) { ++ mwl8k_hw_reset(priv); ++ goto unmap; diff --git a/patches/openwrt/0022-hostapd-work-around-unconditional-libopenssl-build-dependency.patch b/patches/openwrt/0022-hostapd-work-around-unconditional-libopenssl-build-dependency.patch index 0d51e607..289a94a1 100644 --- a/patches/openwrt/0022-hostapd-work-around-unconditional-libopenssl-build-dependency.patch +++ b/patches/openwrt/0022-hostapd-work-around-unconditional-libopenssl-build-dependency.patch @@ -8,7 +8,7 @@ not only wpad-mesh. Fix this by applying the same workaround as in ustream-ssl. diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile -index 3dff7b4..d86bb43 100644 +index c16cb11..c39b6b4 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -177,7 +177,7 @@ endef diff --git a/patches/openwrt/0005-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch b/patches/openwrt/0023-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch similarity index 63% rename from patches/openwrt/0005-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch rename to patches/openwrt/0023-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch index 9d937c29..1c700253 100644 --- a/patches/openwrt/0005-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch +++ b/patches/openwrt/0023-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch @@ -3,10 +3,10 @@ Date: Tue, 10 Mar 2015 13:17:14 +0100 Subject: ath10k: add Candelatech community firmware as an additional choice diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile -index a1eedce..1c0aebe 100644 +index 04dfd3b..5d77ebf 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile -@@ -604,6 +604,14 @@ This module adds support for wireless adapters based on +@@ -603,6 +603,14 @@ This module adds support for wireless adapters based on Atheros USB AR9271 and AR7010 family of chipsets. endef @@ -21,10 +21,10 @@ index a1eedce..1c0aebe 100644 define KernelPackage/ath10k $(call KernelPackage/mac80211/Default) TITLE:=Atheros 802.11ac wireless cards support -@@ -624,21 +632,37 @@ endef +@@ -622,6 +630,17 @@ endef + define KernelPackage/ath10k/config if PACKAGE_kmod-ath10k - + choice + prompt "ath10k firmware flavour" + default ATH10K_AP_FW @@ -36,60 +36,39 @@ index a1eedce..1c0aebe 100644 + help + Use the ath10k firmware optimized for access point operation. + Supports only AP mode, will crash in IBSS (ad-hoc) mode. -+ - config ATH10K_STA_FW - bool "Firmware optimized for STA operation" -- default n - help - Use the ath10k firmware optimized for wireless client instead -- of access point operation. -+ of access point operation. Might be unstable in AP mode. -+ + + config ATH10K_API2_FW + bool "Firmware optimized for AP operation (v10.1 / API v2)" +@@ -630,6 +649,13 @@ define KernelPackage/ath10k/config + Use the ath10k firmware from the 10.1 SDK using API v2 optimized + for access point operation if the default firmware keeps crashing. + + config ATH10K_CT_COMMUNITY_FW + bool "Firmware by Candela Technologies (community version)" + help + Supports both AP and IBSS (ad-hoc) mode. Doesn't support + encryption when using multiple VIFs. - - config ATH10K_API2_FW - bool "Firmware optimized for AP operation (v10.1 / API v2)" -- default n -- depends on !ATH10K_STA_FW - help - Use the ath10k firmware from the 10.1 SDK using API v2 optimized - for access point operation if the default firmware keeps crashing. - ++ + endchoice endif endef -@@ -1866,18 +1890,25 @@ define KernelPackage/ath10k/install - $(INSTALL_DATA) \ - $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/ath10k/QCA988X/hw2.0/board.bin \ - $(1)/lib/firmware/ath10k/QCA988X/hw2.0/ -+ifeq ($(CONFIG_ATH10K_AP_FW),y) -+ $(INSTALL_DATA) \ -+ $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.2.4/firmware-4.bin_10.2.4.45 \ -+ $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-4.bin -+endif - ifeq ($(CONFIG_ATH10K_STA_FW),y) - $(INSTALL_DATA) \ - $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/main/firmware-2.bin_999.999.0.636 \ - $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin --else ifeq ($(CONFIG_ATH10K_API2_FW),y) -+endif -+ifeq ($(CONFIG_ATH10K_API2_FW),y) +@@ -1885,11 +1911,17 @@ ifeq ($(CONFIG_ATH10K_API2_FW),y) $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.1/firmware-2.bin_10.1.467.2-1 \ $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin -else +endif -+ifeq ($(CONFIG_ATH10K_CT_COMMUNITY_FW),y) ++ifeq ($(CONFIG_ATH10K_AP_FW),y) $(INSTALL_DATA) \ -- $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.2.4/firmware-4.bin_10.2.4.45 \ -- $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-4.bin + $(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 ++endif endef + define KernelPackage/mt7601u/install From 6da1677d9232395618736ad59a8d56fc59982061 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 1 Sep 2015 20:59:34 +0200 Subject: [PATCH 092/867] ar71xx: fix TP-LINK TL-WR941ND v6 support --- ...-manual-peak-calibration-for-QCA9561.patch | 38 ++ ...k-add-correct-MAC-BB-name-for-ar9561.patch | 35 ++ ...xx-fix-TP-LINK-TL-WR941ND-v6-support.patch | 366 ++++++++++++++++++ targets/ar71xx-generic/profiles.mk | 6 +- 4 files changed, 442 insertions(+), 3 deletions(-) create mode 100644 patches/openwrt/0024-mac80211-ath9k-enable-hw-manual-peak-calibration-for-QCA9561.patch create mode 100644 patches/openwrt/0025-mac80211-ath9k-add-correct-MAC-BB-name-for-ar9561.patch create mode 100644 patches/openwrt/0026-ar71xx-fix-TP-LINK-TL-WR941ND-v6-support.patch diff --git a/patches/openwrt/0024-mac80211-ath9k-enable-hw-manual-peak-calibration-for-QCA9561.patch b/patches/openwrt/0024-mac80211-ath9k-enable-hw-manual-peak-calibration-for-QCA9561.patch new file mode 100644 index 00000000..946a4ac1 --- /dev/null +++ b/patches/openwrt/0024-mac80211-ath9k-enable-hw-manual-peak-calibration-for-QCA9561.patch @@ -0,0 +1,38 @@ +From: Miaoqing Pan +Date: Tue, 1 Sep 2015 12:21:27 +0800 +Subject: mac80211: ath9k: enable hw manual peak calibration for QCA9561 + +This patch fix https://lists.openwrt.org/pipermail/openwrt-devel/ +2015-August/034979.html. As the peak detect calibration is set +incorrectly. + +Signed-off-by: Miaoqing Pan + +diff --git a/package/kernel/mac80211/patches/546-ath9k_enable_hw_manual_peak_calibration.patch b/package/kernel/mac80211/patches/546-ath9k_enable_hw_manual_peak_calibration.patch +new file mode 100644 +index 0000000..8606493 +--- /dev/null ++++ b/package/kernel/mac80211/patches/546-ath9k_enable_hw_manual_peak_calibration.patch +@@ -0,0 +1,22 @@ ++--- 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(struct ath_hw *ah, u8 chain, bool is_2g) ++ REG_RMW_FIELD(ah, AR_PHY_65NM_RXRF_AGC(chain), ++ AR_PHY_65NM_RXRF_AGC_AGC2G_CALDAC_OVR, 0x0); ++ ++- 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(struct ath_hw *ah, ++ ++ 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; diff --git a/patches/openwrt/0025-mac80211-ath9k-add-correct-MAC-BB-name-for-ar9561.patch b/patches/openwrt/0025-mac80211-ath9k-add-correct-MAC-BB-name-for-ar9561.patch new file mode 100644 index 00000000..d84a6b68 --- /dev/null +++ b/patches/openwrt/0025-mac80211-ath9k-add-correct-MAC-BB-name-for-ar9561.patch @@ -0,0 +1,35 @@ +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/547-ath9k_add-correct-MAC-BB-name-for-ar9561.patch b/package/kernel/mac80211/patches/547-ath9k_add-correct-MAC-BB-name-for-ar9561.patch +new file mode 100644 +index 0000000..a2a2c78 +--- /dev/null ++++ b/package/kernel/mac80211/patches/547-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/0026-ar71xx-fix-TP-LINK-TL-WR941ND-v6-support.patch b/patches/openwrt/0026-ar71xx-fix-TP-LINK-TL-WR941ND-v6-support.patch new file mode 100644 index 00000000..7d3d65e8 --- /dev/null +++ b/patches/openwrt/0026-ar71xx-fix-TP-LINK-TL-WR941ND-v6-support.patch @@ -0,0 +1,366 @@ +From: Matthias Schiffer +Date: Tue, 1 Sep 2015 20:59:22 +0200 +Subject: ar71xx: fix TP-LINK TL-WR941ND v6 support + +The images currently generated for the TL-WR941ND v6 try to treat it like +a TL-WDR3500, which doesn't make any sense and causes the kernel to panic +in early boot. I don't think this has ever worked (the TL-WR941ND v6 has +a different SoC, uses another MDIO bus, has only one WMAC and no USB...). + +Fix this by adding proper support for the device. + +diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh +index ece7098..87e7eef 100644 +--- a/target/linux/ar71xx/base-files/etc/diag.sh ++++ b/target/linux/ar71xx/base-files/etc/diag.sh +@@ -273,7 +273,8 @@ get_status_led() { + tl-wdr4300 | \ + tl-wr703n | \ + tl-wr710n | \ +- tl-wr720n-v3) ++ tl-wr720n-v3 | \ ++ tl-wr941nd-v6) + status_led="tp-link:blue:system" + ;; + tl-wr841n-v9) +diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds +index d628f1a..1aacf5a 100644 +--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds ++++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds +@@ -452,6 +452,15 @@ tl-wr941nd-v5) + ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt" + ;; + ++tl-wr941nd-v6) ++ ucidef_set_led_netdev "wan" "WAN" "tp-link:blue:wan" "eth0" ++ ucidef_set_led_switch "lan1" "LAN1" "tp-link:blue:lan1" "switch0" "0x10" ++ ucidef_set_led_switch "lan2" "LAN2" "tp-link:blue:lan2" "switch0" "0x08" ++ ucidef_set_led_switch "lan3" "LAN3" "tp-link:blue:lan3" "switch0" "0x04" ++ ucidef_set_led_switch "lan4" "LAN4" "tp-link:blue:lan4" "switch0" "0x02" ++ ucidef_set_led_wlan "wlan" "WLAN" "tp-link:blue:wlan" "phy0tpt" ++ ;; ++ + tl-wa830re-v2) + 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 7e26886..3e52942 100644 +--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network ++++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network +@@ -225,6 +225,7 @@ tl-mr3420-v2 |\ + tl-wr841n-v8 |\ + tl-wr842n-v2 |\ + tl-wr941nd-v5 |\ ++tl-wr941nd-v6 |\ + wnr2000-v3 |\ + wnr2000-v4 |\ + wnr2200 |\ +diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh +index e1d03ea..7551697 100755 +--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh ++++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh +@@ -784,6 +784,9 @@ ar71xx_board_detect() { + *"TL-WR941N/ND v5") + name="tl-wr941nd-v5" + ;; ++ *"TL-WR941N/ND v6") ++ name="tl-wr941nd-v6" ++ ;; + *"TL-WR703N v1") + name="tl-wr703n" + ;; +diff --git a/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx b/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx +index f11ea8c..fd337e1 100644 +--- a/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx ++++ b/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx +@@ -35,6 +35,7 @@ set_preinit_iface() { + tl-wr720n-v3 |\ + tl-wr841n-v8 |\ + tl-wr842n-v2 |\ ++ tl-wr941nd-v6 |\ + wnr2000-v3 |\ + 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 e5376ef..88b02ee 100755 +--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh ++++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +@@ -351,6 +351,7 @@ platform_check_image() { + tl-wr842n-v2 | \ + tl-wr941nd | \ + tl-wr941nd-v5 | \ ++ tl-wr941nd-v6 | \ + tl-wr1041n-v2 | \ + tl-wr1043nd | \ + tl-wr1043nd-v2 | \ +diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18 +index d661aa7..bf618a4 100644 +--- a/target/linux/ar71xx/config-3.18 ++++ b/target/linux/ar71xx/config-3.18 +@@ -130,6 +130,7 @@ CONFIG_ATH79_MACH_TL_WR841N_V1=y + CONFIG_ATH79_MACH_TL_WR841N_V8=y + CONFIG_ATH79_MACH_TL_WR841N_V9=y + CONFIG_ATH79_MACH_TL_WR941ND=y ++CONFIG_ATH79_MACH_TL_WR941ND_V6=y + CONFIG_ATH79_MACH_TUBE2H=y + CONFIG_ATH79_MACH_UBNT=y + CONFIG_ATH79_MACH_UBNT_XM=y +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941nd-v6.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941nd-v6.c +new file mode 100644 +index 0000000..55b4c00 +--- /dev/null ++++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941nd-v6.c +@@ -0,0 +1,151 @@ ++/* ++ * TP-LINK TL-WR941N/ND v6 board support ++ * ++ * Copyright (C) 2015 Matthias Schiffer ++ * ++ * 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 ++ ++#include ++#include ++ ++#include "common.h" ++#include "dev-eth.h" ++#include "dev-gpio-buttons.h" ++#include "dev-leds-gpio.h" ++#include "dev-m25p80.h" ++#include "dev-wmac.h" ++#include "machtypes.h" ++ ++ ++#define TL_WR941ND_V6_GPIO_LED_QSS 3 ++#define TL_WR941ND_V6_GPIO_LED_WAN 14 ++#define TL_WR941ND_V6_GPIO_LED_WAN_RED 15 ++#define TL_WR941ND_V6_GPIO_LED_LAN1 7 ++#define TL_WR941ND_V6_GPIO_LED_LAN2 6 ++#define TL_WR941ND_V6_GPIO_LED_LAN3 5 ++#define TL_WR941ND_V6_GPIO_LED_LAN4 4 ++#define TL_WR941ND_V6_GPIO_LED_WLAN 8 ++#define TL_WR941ND_V6_GPIO_LED_SYSTEM 18 ++ ++#define TL_WR941ND_V6_GPIO_BTN_RESET 1 ++#define TL_WR941ND_V6_GPIO_BTN_RFKILL 2 ++ ++#define TL_WR941ND_V6_KEYS_POLL_INTERVAL 20 ++#define TL_WR941ND_V6_KEYS_DEBOUNCE_INTERVAL (3 * TL_WR941ND_V6_KEYS_POLL_INTERVAL) ++ ++ ++static struct gpio_led tl_wr941nd_v6_leds_gpio[] __initdata = { ++ { ++ .name = "tp-link:blue:qss", ++ .gpio = TL_WR941ND_V6_GPIO_LED_QSS, ++ .active_low = 1, ++ }, ++ { ++ .name = "tp-link:blue:wan", ++ .gpio = TL_WR941ND_V6_GPIO_LED_WAN, ++ .active_low = 1, ++ }, ++ { ++ .name = "tp-link:red:wan", ++ .gpio = TL_WR941ND_V6_GPIO_LED_WAN_RED, ++ .active_low = 0, ++ }, ++ { ++ .name = "tp-link:blue:lan1", ++ .gpio = TL_WR941ND_V6_GPIO_LED_LAN1, ++ .active_low = 1, ++ }, ++ { ++ .name = "tp-link:blue:lan2", ++ .gpio = TL_WR941ND_V6_GPIO_LED_LAN2, ++ .active_low = 1, ++ }, ++ { ++ .name = "tp-link:blue:lan3", ++ .gpio = TL_WR941ND_V6_GPIO_LED_LAN3, ++ .active_low = 1, ++ }, ++ { ++ .name = "tp-link:blue:lan4", ++ .gpio = TL_WR941ND_V6_GPIO_LED_LAN4, ++ .active_low = 1, ++ }, ++ { ++ .name = "tp-link:blue:wlan", ++ .gpio = TL_WR941ND_V6_GPIO_LED_WLAN, ++ .active_low = 1, ++ }, ++ { ++ .name = "tp-link:blue:system", ++ .gpio = TL_WR941ND_V6_GPIO_LED_SYSTEM, ++ .active_low = 1, ++ }, ++}; ++ ++static struct gpio_keys_button tl_wr941nd_v6_gpio_keys[] __initdata = { ++ { ++ .desc = "Reset button", ++ .type = EV_KEY, ++ .code = KEY_RESTART, ++ .debounce_interval = TL_WR941ND_V6_KEYS_DEBOUNCE_INTERVAL, ++ .gpio = TL_WR941ND_V6_GPIO_BTN_RESET, ++ .active_low = 1, ++ }, { ++ .desc = "RFKILL button", ++ .type = EV_KEY, ++ .code = KEY_RFKILL, ++ .debounce_interval = TL_WR941ND_V6_KEYS_DEBOUNCE_INTERVAL, ++ .gpio = TL_WR941ND_V6_GPIO_BTN_RFKILL, ++ .active_low = 1, ++ } ++}; ++ ++ ++static const char *tl_wr941n_v6_part_probes[] = { ++ "tp-link", ++ NULL, ++}; ++ ++static struct flash_platform_data tl_wr941n_v6_flash_data = { ++ .part_probes = tl_wr941n_v6_part_probes, ++}; ++ ++ ++static void __init tl_wr941nd_v6_setup(void) ++{ ++ u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); ++ u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000); ++ ++ ath79_register_m25p80(&tl_wr941n_v6_flash_data); ++ ++ ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr941nd_v6_leds_gpio), ++ tl_wr941nd_v6_leds_gpio); ++ ++ ath79_register_gpio_keys_polled(-1, TL_WR941ND_V6_KEYS_POLL_INTERVAL, ++ ARRAY_SIZE(tl_wr941nd_v6_gpio_keys), ++ tl_wr941nd_v6_gpio_keys); ++ ++ ath79_register_mdio(0, 0x0); ++ ++ ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1); ++ ath79_init_mac(ath79_eth1_data.mac_addr, mac, -1); ++ ++ ath79_switch_data.phy4_mii_en = 1; ++ ath79_switch_data.phy_poll_mask = BIT(0); ++ ath79_eth0_data.phy_mask = BIT(0); ++ ++ ath79_register_eth(0); ++ ath79_register_eth(1); ++ ++ ath79_register_wmac(ee, mac); ++ ++} ++ ++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 0600f98..9a6a794 100644 +--- a/target/linux/ar71xx/image/Makefile ++++ b/target/linux/ar71xx/image/Makefile +@@ -576,7 +576,7 @@ endef + + define Device/tl-wr941nd-v6 + $(Device/tplink-4mlzma) +- BOARDNAME := TL-WDR3500 ++ BOARDNAME := TL-WR941ND-v6 + DEVICE_PROFILE := TLWR941 + TPLINK_HWID := 0x09410006 + endef +diff --git a/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch b/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch +index 941cb49..d1246a9 100644 +--- a/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch ++++ b/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch +@@ -1,6 +1,6 @@ + --- a/arch/mips/ath79/machtypes.h + +++ b/arch/mips/ath79/machtypes.h +-@@ -16,22 +16,195 @@ ++@@ -16,22 +16,196 @@ + + enum ath79_mach_type { + ATH79_MACH_GENERIC = 0, +@@ -147,6 +147,7 @@ + + ATH79_MACH_TL_WR842N_V2, /* TP-LINK TL-WR842N/ND v2 */ + + ATH79_MACH_TL_WR941ND, /* TP-LINK TL-WR941ND */ + + ATH79_MACH_TL_WR941ND_V5, /* TP-LINK TL-WR941ND v5 */ +++ ATH79_MACH_TL_WR941ND_V6, /* TP-LINK TL-WR941ND v6 */ + + ATH79_MACH_TUBE2H, /* Alfa Network Tube2H */ + + ATH79_MACH_UBNT_AIRGW, /* Ubiquiti AirGateway */ + ATH79_MACH_UBNT_AIRROUTER, /* Ubiquiti AirRouter */ +@@ -269,7 +270,7 @@ + config ATH79_MACH_AP121 + bool "Atheros AP121 reference board" + select SOC_AR933X +-@@ -11,62 +75,1030 @@ config ATH79_MACH_AP121 ++@@ -11,62 +75,1039 @@ config ATH79_MACH_AP121 + select ATH79_DEV_M25P80 + select ATH79_DEV_USB + select ATH79_DEV_WMAC +@@ -1233,6 +1234,15 @@ + + select ATH79_DEV_M25P80 + + select ATH79_DEV_WMAC + + +++config ATH79_MACH_TL_WR941ND_V6 +++ bool "TP-LINK TL-WR941ND v6 support" +++ select SOC_QCA956X +++ select ATH79_DEV_ETH +++ select ATH79_DEV_GPIO_BUTTONS +++ select ATH79_DEV_LEDS_GPIO +++ select ATH79_DEV_M25P80 +++ select ATH79_DEV_WMAC +++ + +config ATH79_MACH_TL_WR1041N_V2 + + bool "TP-LINK TL-WR1041N v2 support" + + select SOC_AR934X +@@ -1328,7 +1338,7 @@ + + config ATH79_MACH_UBNT_XM + bool "Ubiquiti Networks XM/UniFi boards" +-@@ -83,6 +1115,97 @@ config ATH79_MACH_UBNT_XM ++@@ -83,6 +1124,97 @@ config ATH79_MACH_UBNT_XM + Say 'Y' here if you want your kernel to support the + Ubiquiti Networks XM (rev 1.0) board. + +@@ -1426,7 +1436,7 @@ + endmenu + + config SOC_AR71XX +-@@ -124,7 +1247,10 @@ config ATH79_DEV_DSA ++@@ -124,7 +1256,10 @@ config ATH79_DEV_DSA + config ATH79_DEV_ETH + def_bool n + +@@ -1438,7 +1448,7 @@ + def_bool n + + config ATH79_DEV_GPIO_BUTTONS +-@@ -154,6 +1280,11 @@ config ATH79_PCI_ATH9K_FIXUP ++@@ -154,6 +1289,11 @@ config ATH79_PCI_ATH9K_FIXUP + def_bool n + + config ATH79_ROUTERBOOT +@@ -1452,7 +1462,7 @@ + endif + --- a/arch/mips/ath79/Makefile + +++ b/arch/mips/ath79/Makefile +-@@ -38,9 +38,124 @@ obj-$(CONFIG_ATH79_ROUTERBOOT) += route ++@@ -38,9 +38,125 @@ obj-$(CONFIG_ATH79_ROUTERBOOT) += route + # + # Machines + # +@@ -1543,6 +1553,7 @@ + +obj-$(CONFIG_ATH79_MACH_TL_WR841N_V8) += mach-tl-wr841n-v8.o + +obj-$(CONFIG_ATH79_MACH_TL_WR841N_V9) += mach-tl-wr841n-v9.o + +obj-$(CONFIG_ATH79_MACH_TL_WR941ND) += mach-tl-wr941nd.o +++obj-$(CONFIG_ATH79_MACH_TL_WR941ND_V6) += mach-tl-wr941nd-v6.o + +obj-$(CONFIG_ATH79_MACH_TL_WR1041N_V2) += mach-tl-wr1041n-v2.o + +obj-$(CONFIG_ATH79_MACH_TL_WR1043ND) += mach-tl-wr1043nd.o + +obj-$(CONFIG_ATH79_MACH_TL_WR1043ND_V2) += mach-tl-wr1043nd-v2.o diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 95a32748..9e530f37 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -66,13 +66,13 @@ $(eval $(call GluonModel,TLWR941,tl-wr941nd-v2,tp-link-tl-wr941n-nd-v2)) $(eval $(call GluonModel,TLWR941,tl-wr941nd-v3,tp-link-tl-wr941n-nd-v3)) $(eval $(call GluonModel,TLWR941,tl-wr941nd-v4,tp-link-tl-wr941n-nd-v4)) $(eval $(call GluonModel,TLWR941,tl-wr941nd-v5,tp-link-tl-wr941n-nd-v5)) -ifeq ($(BROKEN),1) -$(eval $(call GluonModel,TLWR941,tl-wr941nd-v6,tp-link-tl-wr941n-nd-v6)) # BROKEN: untested +$(eval $(call GluonModel,TLWR941,tl-wr941nd-v6,tp-link-tl-wr941n-nd-v6)) +ifeq ($(BROKEN),1) $(eval $(call GluonModel,TLWR941,tl-wr941nd-v4,tp-link-tl-wr940n-nd-v1)) # BROKEN: untested $(eval $(call GluonModel,TLWR941,tl-wr941nd-v5,tp-link-tl-wr940n-nd-v2)) # BROKEN: untested -$(eval $(call GluonModel,TLWR941,tl-wr941nd-v6,tp-link-tl-wr940n-nd-v3)) # BROKEN: untested endif +$(eval $(call GluonModel,TLWR941,tl-wr941nd-v6,tp-link-tl-wr940n-nd-v3)) # TL-WR1043N/ND v1, v2 $(eval $(call GluonProfile,TLWR1043)) From 339a6c9959a12e931e66ccdb0109eb0c8be454d7 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Litza Date: Mon, 31 Aug 2015 18:10:23 +0200 Subject: [PATCH 093/867] Remove dependencies on luci.util (and partly nixio.fs) from announce scripts --- .../files/lib/gluon/announce/collect.lua | 1 - .../gluon/announce/nodeinfo.d/hardware/nproc | 4 +- .../announce/nodeinfo.d/software/firmware | 4 +- .../announce/nodeinfo.d/system/site_code | 4 +- .../lib/gluon/announce/statistics.d/idletime | 2 +- .../lib/gluon/announce/statistics.d/loadavg | 2 +- .../lib/gluon/announce/statistics.d/memory | 2 +- .../lib/gluon/announce/statistics.d/processes | 2 +- .../lib/gluon/announce/statistics.d/uptime | 2 +- .../files/usr/lib/lua/gluon/announce.lua | 2 +- .../files/usr/lib/lua/gluon/util.lua | 8 +++- .../lib/gluon/announce/neighbours.d/batadv | 2 +- .../lib/gluon/announce/neighbours.d/wifi | 21 +++++----- .../nodeinfo.d/network/mesh/bat0/interfaces | 41 ++++++++++--------- .../nodeinfo.d/network/mesh_interfaces | 20 ++++----- .../nodeinfo.d/software/batman-adv/version | 2 +- .../lib/gluon/announce/statistics.d/gateway | 13 +++++- .../gluon/announce/nodeinfo.d/software/fastd | 7 ++-- .../lib/gluon/announce/statistics.d/mesh_vpn | 1 - 19 files changed, 76 insertions(+), 64 deletions(-) diff --git a/package/gluon-announce/files/lib/gluon/announce/collect.lua b/package/gluon-announce/files/lib/gluon/announce/collect.lua index 43392075..3510fbf0 100755 --- a/package/gluon-announce/files/lib/gluon/announce/collect.lua +++ b/package/gluon-announce/files/lib/gluon/announce/collect.lua @@ -2,7 +2,6 @@ local announce = require 'gluon.announce' local json = require 'luci.jsonc' -local ltn12 = require 'luci.ltn12' local announce_dir = '/lib/gluon/announce/' .. arg[1] .. '.d' 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 index 3072f8f8..fc94bd5b 100644 --- a/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/hardware/nproc +++ b/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/hardware/nproc @@ -1,8 +1,8 @@ local n = 0 -local cpus = util.trim(fs.readfile('/sys/devices/system/cpu/online')) +local cpus = util.readline(io.open('/sys/devices/system/cpu/online')) -for _, entry in ipairs(cpus:split(',')) do +for entry in cpus:gmatch('([^,]+)') do local x, y = entry:match('(%d+)-(%d+)') if x then n = n + tonumber(y) - tonumber(x) + 1 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 index cf50f79f..53f6fbaf 100644 --- a/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/software/firmware +++ b/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/software/firmware @@ -1,4 +1,4 @@ return { - base = 'gluon-' .. util.trim(fs.readfile('/lib/gluon/gluon-version')), - release = util.trim(fs.readfile('/lib/gluon/release')), + 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 index 876fb6d8..fa7d9e80 100644 --- 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 @@ -1,3 +1 @@ -local site = require 'gluon.site_config' - -return site.site_code +return require('gluon.site_config').site_code diff --git a/package/gluon-announce/files/lib/gluon/announce/statistics.d/idletime b/package/gluon-announce/files/lib/gluon/announce/statistics.d/idletime index 845de268..61258820 100644 --- a/package/gluon-announce/files/lib/gluon/announce/statistics.d/idletime +++ b/package/gluon-announce/files/lib/gluon/announce/statistics.d/idletime @@ -1 +1 @@ -return tonumber(fs.readfile('/proc/uptime'):match('^[^ ]+ ([^ ]+)')) +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 index d79973aa..3548ac7a 100644 --- a/package/gluon-announce/files/lib/gluon/announce/statistics.d/loadavg +++ b/package/gluon-announce/files/lib/gluon/announce/statistics.d/loadavg @@ -1 +1 @@ -return tonumber(fs.readfile('/proc/loadavg'):match('^([^ ]+) ')) +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 index 7b07a107..2e880346 100644 --- a/package/gluon-announce/files/lib/gluon/announce/statistics.d/memory +++ b/package/gluon-announce/files/lib/gluon/announce/statistics.d/memory @@ -1,4 +1,4 @@ -local data = fs.readfile('/proc/meminfo') +local data = io.open('/proc/meminfo'):read('*a') local fields = {} for k, v in data:gmatch('([^\n:]+):%s*(%d+) kB') do diff --git a/package/gluon-announce/files/lib/gluon/announce/statistics.d/processes b/package/gluon-announce/files/lib/gluon/announce/statistics.d/processes index 33ecff66..30f09790 100644 --- a/package/gluon-announce/files/lib/gluon/announce/statistics.d/processes +++ b/package/gluon-announce/files/lib/gluon/announce/statistics.d/processes @@ -1,3 +1,3 @@ -local running, total = fs.readfile('/proc/loadavg'):match('^[^ ]+ [^ ]+ [^ ]+ (%d+)/(%d+)') +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/uptime b/package/gluon-announce/files/lib/gluon/announce/statistics.d/uptime index 0bc45bea..509d1470 100644 --- a/package/gluon-announce/files/lib/gluon/announce/statistics.d/uptime +++ b/package/gluon-announce/files/lib/gluon/announce/statistics.d/uptime @@ -1 +1 @@ -return tonumber(fs.readfile('/proc/uptime'):match('^([^ ]+) ')) +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 index fdd2479e..444dbd33 100644 --- a/package/gluon-announce/files/usr/lib/lua/gluon/announce.lua +++ b/package/gluon-announce/files/usr/lib/lua/gluon/announce.lua @@ -4,7 +4,7 @@ module('gluon.announce', package.seeall) fs = require 'nixio.fs' uci = require('luci.model.uci').cursor() -util = require 'luci.util' +util = require 'gluon.util' local function collect_entry(entry) if fs.stat(entry, 'type') == 'dir' then diff --git a/package/gluon-core/files/usr/lib/lua/gluon/util.lua b/package/gluon-core/files/usr/lib/lua/gluon/util.lua index 7d7809b1..86b86805 100644 --- a/package/gluon-core/files/usr/lib/lua/gluon/util.lua +++ b/package/gluon-core/files/usr/lib/lua/gluon/util.lua @@ -38,7 +38,7 @@ local uci = require('luci.model.uci').cursor() module 'gluon.util' function exec(...) - return os.execute(escape_args('', ...)) + return os.execute(escape_args('', 'exec', ...)) end -- Removes all lines starting with a prefix from a file, optionally adding a new one @@ -52,6 +52,12 @@ function replace_prefix(file, prefix, add) os.rename(tmp, file) end +function readline(fd) + local line = fd:read('*l') + fd:close() + return line +end + function lock(file) exec('lock', file) end 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 e83f188f..69b7981d 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 @@ -5,7 +5,7 @@ function ifname2address(ifname) if ifname_address_cache[ifname] ~= nil then ifaddress = ifname_address_cache[ifname] else - ifaddress = util.trim(fs.readfile("/sys/class/net/" .. ifname .. "/address")) + ifaddress = util.readline(io.open("/sys/class/net/" .. ifname .. "/address")) ifname_address_cache[ifname] = ifaddress end 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 index 26168003..bbe5fc96 100644 --- 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 @@ -16,18 +16,17 @@ end function interfaces() local interfaces = {} - for _, line in ipairs(util.split(util.exec('batctl if'))) do - ifname = line:match('^(.-): active') - if ifname ~= nil then - pcall(function() - local address = util.trim(fs.readfile('/sys/class/net/' .. ifname .. '/address')) - local wifitype = iwinfo.type(ifname) - if wifitype ~= nil then - interfaces[address] = { ifname = ifname, iw = iwinfo[wifitype] } - end - end) - end + local popen = io.popen('exec batctl if') + for ifname in popen:read('*a'):gmatch('([^%s]+): active') 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 + popen:close() return interfaces end 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 index 1ac22d30..b1d30efe 100644 --- 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 @@ -1,5 +1,3 @@ -local list = util.exec('batctl if') - local wireless = {} local tunnel = {} local other = {} @@ -7,21 +5,27 @@ local other = {} local function get_address(t, ifname) pcall( function() - table.insert(t, util.trim(fs.readfile('/sys/class/net/' .. ifname .. '/address'))) + table.insert(t, util.readline(io.open('/sys/class/net/' .. ifname .. '/address'))) end ) end -local function is_wireless(ifname) - local type = fs.stat('/sys/class/net/' .. ifname .. '/wireless', 'type') +local function file_exists(filename) + local f = io.open(filename) + if f == nil then + return false + else + f:close() + return true + end +end - return type == 'directory' +local function is_wireless(ifname) + return file_exists('/sys/class/net/' .. ifname .. '/wireless') end local function is_tuntap(ifname) - local type = fs.stat('/sys/class/net/' .. ifname .. '/tun_flags', 'type') - - return type == 'regular' + return file_exists('/sys/class/net/' .. ifname .. '/tun_flags') end local function nil_table(t) @@ -32,18 +36,17 @@ local function nil_table(t) end end -for _, line in ipairs(util.split(list)) do - local ifname = line:match('^(.-):') - if ifname ~= nil then - if is_wireless(ifname) then - get_address(wireless, ifname) - elseif is_tuntap(ifname) then - get_address(tunnel, ifname) - else - get_address(other, ifname) - end +local popen = io.popen('exec batctl if') +for ifname in popen:read('*a'):gmatch('([^%s]+): active') 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 +popen:close() return { wireless = nil_table(wireless), 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 index 1fef5e10..c69ca4ef 100644 --- 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 @@ -1,15 +1,13 @@ -local list = util.exec('batctl if') - local interfaces = {} -for _, line in ipairs(util.split(list)) do - local ifname = line:match('^(.-):') - if ifname ~= nil then - pcall( - function() - table.insert(interfaces, util.trim(fs.readfile('/sys/class/net/' .. ifname .. '/address'))) - end - ) - end + +local popen = io.popen('exec batctl if') +for ifname in popen:read('*a'):gmatch('([^%s]+): active') do + pcall( + function() + table.insert(interfaces, util.readline(io.open('/sys/class/net/' .. ifname .. '/address'))) + end + ) end +popen:close() 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 index abb317e9..e0f556cf 100644 --- 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 @@ -1 +1 @@ -return util.trim(fs.readfile('/sys/module/batman_adv/version')) +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/gateway b/package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/statistics.d/gateway index a1be9ac0..67623b0c 100644 --- 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 @@ -1,5 +1,14 @@ -local gateway = util.trim(util.exec("batctl -m bat0 gateways | awk '/^=>/ { print $2 }'")) +local gateway = '' + +local popen = io.popen("exec batctl -m bat0 gateways") +for line in popen:lines() do + if line:sub(1, 3) == '=> ' then + gateway = line:sub(4, 20) + break + end +end +popen:close() if gateway ~= '' then - return gateway + return gateway end 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 bbfbda08..7b1ff4bc 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,4 +1,5 @@ -return { - enabled = uci:get_bool('fastd', 'mesh_vpn', 'enabled'), - version = util.exec('fastd -v'):match('^[^%s]+%s+([^\n]+)'), +local ret = { + enabled = uci:get('fastd', 'mesh_vpn', 'enabled') ~= 0, + 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 index 0d6d66f0..42efe827 100644 --- 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 @@ -2,7 +2,6 @@ local json = require 'luci.jsonc' local ltn12 = require 'luci.ltn12' local nixio = require 'nixio' local site = require 'gluon.site_config' -local uci = require('luci.model.uci').cursor() local fastd_sock = nixio.socket('unix', 'stream') local socket_path = uci:get('fastd', 'mesh_vpn', 'status_socket') From 21935ffc8198f044ae69828b4aa7c099823ce94c Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Wed, 2 Sep 2015 21:19:41 +0200 Subject: [PATCH 094/867] gluon-status-page: set html encoding to utf-8 --- .../files/lib/gluon/status-page/www/cgi-bin/status | 1 + 1 file changed, 1 insertion(+) diff --git a/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/status b/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/status index fe4ba0af..ff89652d 100755 --- a/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/status +++ b/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/status @@ -51,6 +51,7 @@ io.write("Content-type: text/html\n\n") io.write("\n") io.write("") io.write("") +io.write("") io.write("") io.write("" .. escape_html(hostname) .. "") io.write("") From 740e8b67c5fe19908b80d81fb30bed8e461014aa Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 3 Sep 2015 15:22:25 +0200 Subject: [PATCH 095/867] Revert "ar71xx: fix TP-LINK TL-WR941ND v6 support" This reverts commit 6da1677d9232395618736ad59a8d56fc59982061. --- ...-manual-peak-calibration-for-QCA9561.patch | 38 -- ...k-add-correct-MAC-BB-name-for-ar9561.patch | 35 -- ...xx-fix-TP-LINK-TL-WR941ND-v6-support.patch | 366 ------------------ targets/ar71xx-generic/profiles.mk | 6 +- 4 files changed, 3 insertions(+), 442 deletions(-) delete mode 100644 patches/openwrt/0024-mac80211-ath9k-enable-hw-manual-peak-calibration-for-QCA9561.patch delete mode 100644 patches/openwrt/0025-mac80211-ath9k-add-correct-MAC-BB-name-for-ar9561.patch delete mode 100644 patches/openwrt/0026-ar71xx-fix-TP-LINK-TL-WR941ND-v6-support.patch diff --git a/patches/openwrt/0024-mac80211-ath9k-enable-hw-manual-peak-calibration-for-QCA9561.patch b/patches/openwrt/0024-mac80211-ath9k-enable-hw-manual-peak-calibration-for-QCA9561.patch deleted file mode 100644 index 946a4ac1..00000000 --- a/patches/openwrt/0024-mac80211-ath9k-enable-hw-manual-peak-calibration-for-QCA9561.patch +++ /dev/null @@ -1,38 +0,0 @@ -From: Miaoqing Pan -Date: Tue, 1 Sep 2015 12:21:27 +0800 -Subject: mac80211: ath9k: enable hw manual peak calibration for QCA9561 - -This patch fix https://lists.openwrt.org/pipermail/openwrt-devel/ -2015-August/034979.html. As the peak detect calibration is set -incorrectly. - -Signed-off-by: Miaoqing Pan - -diff --git a/package/kernel/mac80211/patches/546-ath9k_enable_hw_manual_peak_calibration.patch b/package/kernel/mac80211/patches/546-ath9k_enable_hw_manual_peak_calibration.patch -new file mode 100644 -index 0000000..8606493 ---- /dev/null -+++ b/package/kernel/mac80211/patches/546-ath9k_enable_hw_manual_peak_calibration.patch -@@ -0,0 +1,22 @@ -+--- 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(struct ath_hw *ah, u8 chain, bool is_2g) -+ REG_RMW_FIELD(ah, AR_PHY_65NM_RXRF_AGC(chain), -+ AR_PHY_65NM_RXRF_AGC_AGC2G_CALDAC_OVR, 0x0); -+ -+- 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(struct ath_hw *ah, -+ -+ 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; diff --git a/patches/openwrt/0025-mac80211-ath9k-add-correct-MAC-BB-name-for-ar9561.patch b/patches/openwrt/0025-mac80211-ath9k-add-correct-MAC-BB-name-for-ar9561.patch deleted file mode 100644 index d84a6b68..00000000 --- a/patches/openwrt/0025-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/547-ath9k_add-correct-MAC-BB-name-for-ar9561.patch b/package/kernel/mac80211/patches/547-ath9k_add-correct-MAC-BB-name-for-ar9561.patch -new file mode 100644 -index 0000000..a2a2c78 ---- /dev/null -+++ b/package/kernel/mac80211/patches/547-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/0026-ar71xx-fix-TP-LINK-TL-WR941ND-v6-support.patch b/patches/openwrt/0026-ar71xx-fix-TP-LINK-TL-WR941ND-v6-support.patch deleted file mode 100644 index 7d3d65e8..00000000 --- a/patches/openwrt/0026-ar71xx-fix-TP-LINK-TL-WR941ND-v6-support.patch +++ /dev/null @@ -1,366 +0,0 @@ -From: Matthias Schiffer -Date: Tue, 1 Sep 2015 20:59:22 +0200 -Subject: ar71xx: fix TP-LINK TL-WR941ND v6 support - -The images currently generated for the TL-WR941ND v6 try to treat it like -a TL-WDR3500, which doesn't make any sense and causes the kernel to panic -in early boot. I don't think this has ever worked (the TL-WR941ND v6 has -a different SoC, uses another MDIO bus, has only one WMAC and no USB...). - -Fix this by adding proper support for the device. - -diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh -index ece7098..87e7eef 100644 ---- a/target/linux/ar71xx/base-files/etc/diag.sh -+++ b/target/linux/ar71xx/base-files/etc/diag.sh -@@ -273,7 +273,8 @@ get_status_led() { - tl-wdr4300 | \ - tl-wr703n | \ - tl-wr710n | \ -- tl-wr720n-v3) -+ tl-wr720n-v3 | \ -+ tl-wr941nd-v6) - status_led="tp-link:blue:system" - ;; - tl-wr841n-v9) -diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds -index d628f1a..1aacf5a 100644 ---- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds -+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds -@@ -452,6 +452,15 @@ tl-wr941nd-v5) - ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt" - ;; - -+tl-wr941nd-v6) -+ ucidef_set_led_netdev "wan" "WAN" "tp-link:blue:wan" "eth0" -+ ucidef_set_led_switch "lan1" "LAN1" "tp-link:blue:lan1" "switch0" "0x10" -+ ucidef_set_led_switch "lan2" "LAN2" "tp-link:blue:lan2" "switch0" "0x08" -+ ucidef_set_led_switch "lan3" "LAN3" "tp-link:blue:lan3" "switch0" "0x04" -+ ucidef_set_led_switch "lan4" "LAN4" "tp-link:blue:lan4" "switch0" "0x02" -+ ucidef_set_led_wlan "wlan" "WLAN" "tp-link:blue:wlan" "phy0tpt" -+ ;; -+ - tl-wa830re-v2) - 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 7e26886..3e52942 100644 ---- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network -+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network -@@ -225,6 +225,7 @@ tl-mr3420-v2 |\ - tl-wr841n-v8 |\ - tl-wr842n-v2 |\ - tl-wr941nd-v5 |\ -+tl-wr941nd-v6 |\ - wnr2000-v3 |\ - wnr2000-v4 |\ - wnr2200 |\ -diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh -index e1d03ea..7551697 100755 ---- a/target/linux/ar71xx/base-files/lib/ar71xx.sh -+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh -@@ -784,6 +784,9 @@ ar71xx_board_detect() { - *"TL-WR941N/ND v5") - name="tl-wr941nd-v5" - ;; -+ *"TL-WR941N/ND v6") -+ name="tl-wr941nd-v6" -+ ;; - *"TL-WR703N v1") - name="tl-wr703n" - ;; -diff --git a/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx b/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx -index f11ea8c..fd337e1 100644 ---- a/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx -+++ b/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx -@@ -35,6 +35,7 @@ set_preinit_iface() { - tl-wr720n-v3 |\ - tl-wr841n-v8 |\ - tl-wr842n-v2 |\ -+ tl-wr941nd-v6 |\ - wnr2000-v3 |\ - 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 e5376ef..88b02ee 100755 ---- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh -+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh -@@ -351,6 +351,7 @@ platform_check_image() { - tl-wr842n-v2 | \ - tl-wr941nd | \ - tl-wr941nd-v5 | \ -+ tl-wr941nd-v6 | \ - tl-wr1041n-v2 | \ - tl-wr1043nd | \ - tl-wr1043nd-v2 | \ -diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18 -index d661aa7..bf618a4 100644 ---- a/target/linux/ar71xx/config-3.18 -+++ b/target/linux/ar71xx/config-3.18 -@@ -130,6 +130,7 @@ CONFIG_ATH79_MACH_TL_WR841N_V1=y - CONFIG_ATH79_MACH_TL_WR841N_V8=y - CONFIG_ATH79_MACH_TL_WR841N_V9=y - CONFIG_ATH79_MACH_TL_WR941ND=y -+CONFIG_ATH79_MACH_TL_WR941ND_V6=y - CONFIG_ATH79_MACH_TUBE2H=y - CONFIG_ATH79_MACH_UBNT=y - CONFIG_ATH79_MACH_UBNT_XM=y -diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941nd-v6.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941nd-v6.c -new file mode 100644 -index 0000000..55b4c00 ---- /dev/null -+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941nd-v6.c -@@ -0,0 +1,151 @@ -+/* -+ * TP-LINK TL-WR941N/ND v6 board support -+ * -+ * Copyright (C) 2015 Matthias Schiffer -+ * -+ * 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 -+ -+#include -+#include -+ -+#include "common.h" -+#include "dev-eth.h" -+#include "dev-gpio-buttons.h" -+#include "dev-leds-gpio.h" -+#include "dev-m25p80.h" -+#include "dev-wmac.h" -+#include "machtypes.h" -+ -+ -+#define TL_WR941ND_V6_GPIO_LED_QSS 3 -+#define TL_WR941ND_V6_GPIO_LED_WAN 14 -+#define TL_WR941ND_V6_GPIO_LED_WAN_RED 15 -+#define TL_WR941ND_V6_GPIO_LED_LAN1 7 -+#define TL_WR941ND_V6_GPIO_LED_LAN2 6 -+#define TL_WR941ND_V6_GPIO_LED_LAN3 5 -+#define TL_WR941ND_V6_GPIO_LED_LAN4 4 -+#define TL_WR941ND_V6_GPIO_LED_WLAN 8 -+#define TL_WR941ND_V6_GPIO_LED_SYSTEM 18 -+ -+#define TL_WR941ND_V6_GPIO_BTN_RESET 1 -+#define TL_WR941ND_V6_GPIO_BTN_RFKILL 2 -+ -+#define TL_WR941ND_V6_KEYS_POLL_INTERVAL 20 -+#define TL_WR941ND_V6_KEYS_DEBOUNCE_INTERVAL (3 * TL_WR941ND_V6_KEYS_POLL_INTERVAL) -+ -+ -+static struct gpio_led tl_wr941nd_v6_leds_gpio[] __initdata = { -+ { -+ .name = "tp-link:blue:qss", -+ .gpio = TL_WR941ND_V6_GPIO_LED_QSS, -+ .active_low = 1, -+ }, -+ { -+ .name = "tp-link:blue:wan", -+ .gpio = TL_WR941ND_V6_GPIO_LED_WAN, -+ .active_low = 1, -+ }, -+ { -+ .name = "tp-link:red:wan", -+ .gpio = TL_WR941ND_V6_GPIO_LED_WAN_RED, -+ .active_low = 0, -+ }, -+ { -+ .name = "tp-link:blue:lan1", -+ .gpio = TL_WR941ND_V6_GPIO_LED_LAN1, -+ .active_low = 1, -+ }, -+ { -+ .name = "tp-link:blue:lan2", -+ .gpio = TL_WR941ND_V6_GPIO_LED_LAN2, -+ .active_low = 1, -+ }, -+ { -+ .name = "tp-link:blue:lan3", -+ .gpio = TL_WR941ND_V6_GPIO_LED_LAN3, -+ .active_low = 1, -+ }, -+ { -+ .name = "tp-link:blue:lan4", -+ .gpio = TL_WR941ND_V6_GPIO_LED_LAN4, -+ .active_low = 1, -+ }, -+ { -+ .name = "tp-link:blue:wlan", -+ .gpio = TL_WR941ND_V6_GPIO_LED_WLAN, -+ .active_low = 1, -+ }, -+ { -+ .name = "tp-link:blue:system", -+ .gpio = TL_WR941ND_V6_GPIO_LED_SYSTEM, -+ .active_low = 1, -+ }, -+}; -+ -+static struct gpio_keys_button tl_wr941nd_v6_gpio_keys[] __initdata = { -+ { -+ .desc = "Reset button", -+ .type = EV_KEY, -+ .code = KEY_RESTART, -+ .debounce_interval = TL_WR941ND_V6_KEYS_DEBOUNCE_INTERVAL, -+ .gpio = TL_WR941ND_V6_GPIO_BTN_RESET, -+ .active_low = 1, -+ }, { -+ .desc = "RFKILL button", -+ .type = EV_KEY, -+ .code = KEY_RFKILL, -+ .debounce_interval = TL_WR941ND_V6_KEYS_DEBOUNCE_INTERVAL, -+ .gpio = TL_WR941ND_V6_GPIO_BTN_RFKILL, -+ .active_low = 1, -+ } -+}; -+ -+ -+static const char *tl_wr941n_v6_part_probes[] = { -+ "tp-link", -+ NULL, -+}; -+ -+static struct flash_platform_data tl_wr941n_v6_flash_data = { -+ .part_probes = tl_wr941n_v6_part_probes, -+}; -+ -+ -+static void __init tl_wr941nd_v6_setup(void) -+{ -+ u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); -+ u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000); -+ -+ ath79_register_m25p80(&tl_wr941n_v6_flash_data); -+ -+ ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr941nd_v6_leds_gpio), -+ tl_wr941nd_v6_leds_gpio); -+ -+ ath79_register_gpio_keys_polled(-1, TL_WR941ND_V6_KEYS_POLL_INTERVAL, -+ ARRAY_SIZE(tl_wr941nd_v6_gpio_keys), -+ tl_wr941nd_v6_gpio_keys); -+ -+ ath79_register_mdio(0, 0x0); -+ -+ ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1); -+ ath79_init_mac(ath79_eth1_data.mac_addr, mac, -1); -+ -+ ath79_switch_data.phy4_mii_en = 1; -+ ath79_switch_data.phy_poll_mask = BIT(0); -+ ath79_eth0_data.phy_mask = BIT(0); -+ -+ ath79_register_eth(0); -+ ath79_register_eth(1); -+ -+ ath79_register_wmac(ee, mac); -+ -+} -+ -+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 0600f98..9a6a794 100644 ---- a/target/linux/ar71xx/image/Makefile -+++ b/target/linux/ar71xx/image/Makefile -@@ -576,7 +576,7 @@ endef - - define Device/tl-wr941nd-v6 - $(Device/tplink-4mlzma) -- BOARDNAME := TL-WDR3500 -+ BOARDNAME := TL-WR941ND-v6 - DEVICE_PROFILE := TLWR941 - TPLINK_HWID := 0x09410006 - endef -diff --git a/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch b/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch -index 941cb49..d1246a9 100644 ---- a/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch -+++ b/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch -@@ -1,6 +1,6 @@ - --- a/arch/mips/ath79/machtypes.h - +++ b/arch/mips/ath79/machtypes.h --@@ -16,22 +16,195 @@ -+@@ -16,22 +16,196 @@ - - enum ath79_mach_type { - ATH79_MACH_GENERIC = 0, -@@ -147,6 +147,7 @@ - + ATH79_MACH_TL_WR842N_V2, /* TP-LINK TL-WR842N/ND v2 */ - + ATH79_MACH_TL_WR941ND, /* TP-LINK TL-WR941ND */ - + ATH79_MACH_TL_WR941ND_V5, /* TP-LINK TL-WR941ND v5 */ -++ ATH79_MACH_TL_WR941ND_V6, /* TP-LINK TL-WR941ND v6 */ - + ATH79_MACH_TUBE2H, /* Alfa Network Tube2H */ - + ATH79_MACH_UBNT_AIRGW, /* Ubiquiti AirGateway */ - ATH79_MACH_UBNT_AIRROUTER, /* Ubiquiti AirRouter */ -@@ -269,7 +270,7 @@ - config ATH79_MACH_AP121 - bool "Atheros AP121 reference board" - select SOC_AR933X --@@ -11,62 +75,1030 @@ config ATH79_MACH_AP121 -+@@ -11,62 +75,1039 @@ config ATH79_MACH_AP121 - select ATH79_DEV_M25P80 - select ATH79_DEV_USB - select ATH79_DEV_WMAC -@@ -1233,6 +1234,15 @@ - + select ATH79_DEV_M25P80 - + select ATH79_DEV_WMAC - + -++config ATH79_MACH_TL_WR941ND_V6 -++ bool "TP-LINK TL-WR941ND v6 support" -++ select SOC_QCA956X -++ select ATH79_DEV_ETH -++ select ATH79_DEV_GPIO_BUTTONS -++ select ATH79_DEV_LEDS_GPIO -++ select ATH79_DEV_M25P80 -++ select ATH79_DEV_WMAC -++ - +config ATH79_MACH_TL_WR1041N_V2 - + bool "TP-LINK TL-WR1041N v2 support" - + select SOC_AR934X -@@ -1328,7 +1338,7 @@ - - config ATH79_MACH_UBNT_XM - bool "Ubiquiti Networks XM/UniFi boards" --@@ -83,6 +1115,97 @@ config ATH79_MACH_UBNT_XM -+@@ -83,6 +1124,97 @@ config ATH79_MACH_UBNT_XM - Say 'Y' here if you want your kernel to support the - Ubiquiti Networks XM (rev 1.0) board. - -@@ -1426,7 +1436,7 @@ - endmenu - - config SOC_AR71XX --@@ -124,7 +1247,10 @@ config ATH79_DEV_DSA -+@@ -124,7 +1256,10 @@ config ATH79_DEV_DSA - config ATH79_DEV_ETH - def_bool n - -@@ -1438,7 +1448,7 @@ - def_bool n - - config ATH79_DEV_GPIO_BUTTONS --@@ -154,6 +1280,11 @@ config ATH79_PCI_ATH9K_FIXUP -+@@ -154,6 +1289,11 @@ config ATH79_PCI_ATH9K_FIXUP - def_bool n - - config ATH79_ROUTERBOOT -@@ -1452,7 +1462,7 @@ - endif - --- a/arch/mips/ath79/Makefile - +++ b/arch/mips/ath79/Makefile --@@ -38,9 +38,124 @@ obj-$(CONFIG_ATH79_ROUTERBOOT) += route -+@@ -38,9 +38,125 @@ obj-$(CONFIG_ATH79_ROUTERBOOT) += route - # - # Machines - # -@@ -1543,6 +1553,7 @@ - +obj-$(CONFIG_ATH79_MACH_TL_WR841N_V8) += mach-tl-wr841n-v8.o - +obj-$(CONFIG_ATH79_MACH_TL_WR841N_V9) += mach-tl-wr841n-v9.o - +obj-$(CONFIG_ATH79_MACH_TL_WR941ND) += mach-tl-wr941nd.o -++obj-$(CONFIG_ATH79_MACH_TL_WR941ND_V6) += mach-tl-wr941nd-v6.o - +obj-$(CONFIG_ATH79_MACH_TL_WR1041N_V2) += mach-tl-wr1041n-v2.o - +obj-$(CONFIG_ATH79_MACH_TL_WR1043ND) += mach-tl-wr1043nd.o - +obj-$(CONFIG_ATH79_MACH_TL_WR1043ND_V2) += mach-tl-wr1043nd-v2.o diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 9e530f37..8cfe724f 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -66,13 +66,13 @@ $(eval $(call GluonModel,TLWR941,tl-wr941nd-v2,tp-link-tl-wr941n-nd-v2)) $(eval $(call GluonModel,TLWR941,tl-wr941nd-v3,tp-link-tl-wr941n-nd-v3)) $(eval $(call GluonModel,TLWR941,tl-wr941nd-v4,tp-link-tl-wr941n-nd-v4)) $(eval $(call GluonModel,TLWR941,tl-wr941nd-v5,tp-link-tl-wr941n-nd-v5)) -$(eval $(call GluonModel,TLWR941,tl-wr941nd-v6,tp-link-tl-wr941n-nd-v6)) - ifeq ($(BROKEN),1) +# $(eval $(call GluonModel,TLWR941,tl-wr941nd-v6,tp-link-tl-wr941n-nd-v6)) # BROKEN: needs mac80211 update + $(eval $(call GluonModel,TLWR941,tl-wr941nd-v4,tp-link-tl-wr940n-nd-v1)) # BROKEN: untested $(eval $(call GluonModel,TLWR941,tl-wr941nd-v5,tp-link-tl-wr940n-nd-v2)) # BROKEN: untested +# $(eval $(call GluonModel,TLWR941,tl-wr941nd-v6,tp-link-tl-wr940n-nd-v3)) # BROKEN: needs mac80211 update endif -$(eval $(call GluonModel,TLWR941,tl-wr941nd-v6,tp-link-tl-wr940n-nd-v3)) # TL-WR1043N/ND v1, v2 $(eval $(call GluonProfile,TLWR1043)) From 501affad087137fd07b514664935eb4ad6e4d19e Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 3 Sep 2015 15:24:51 +0200 Subject: [PATCH 096/867] Revert "mac80211: backport from trunk r46760" This reverts commit 91b3c1d371571cd67599a0f5649135d1e0899fcd. --- ...ty-firmware-as-an-additional-choice.patch} | 63 +- ...files-disable-reset-button-handling.patch} | 0 ...-mac80211-backport-from-trunk-r46760.patch | 20504 ---------------- ...ditional-libopenssl-build-dependency.patch | 2 +- 4 files changed, 43 insertions(+), 20526 deletions(-) rename patches/openwrt/{0023-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch => 0005-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch} (63%) rename patches/openwrt/{0005-base-files-disable-reset-button-handling.patch => 0006-base-files-disable-reset-button-handling.patch} (100%) delete mode 100644 patches/openwrt/0006-mac80211-backport-from-trunk-r46760.patch diff --git a/patches/openwrt/0023-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch b/patches/openwrt/0005-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch similarity index 63% rename from patches/openwrt/0023-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch rename to patches/openwrt/0005-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch index 1c700253..9d937c29 100644 --- a/patches/openwrt/0023-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch +++ b/patches/openwrt/0005-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch @@ -3,10 +3,10 @@ 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 04dfd3b..5d77ebf 100644 +index a1eedce..1c0aebe 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile -@@ -603,6 +603,14 @@ This module adds support for wireless adapters based on +@@ -604,6 +604,14 @@ This module adds support for wireless adapters based on Atheros USB AR9271 and AR7010 family of chipsets. endef @@ -21,10 +21,10 @@ index 04dfd3b..5d77ebf 100644 define KernelPackage/ath10k $(call KernelPackage/mac80211/Default) TITLE:=Atheros 802.11ac wireless cards support -@@ -622,6 +630,17 @@ endef - +@@ -624,21 +632,37 @@ endef define KernelPackage/ath10k/config if PACKAGE_kmod-ath10k + + choice + prompt "ath10k firmware flavour" + default ATH10K_AP_FW @@ -36,39 +36,60 @@ index 04dfd3b..5d77ebf 100644 + help + Use the ath10k firmware optimized for access point operation. + Supports only AP mode, will crash in IBSS (ad-hoc) mode. - - config ATH10K_API2_FW - bool "Firmware optimized for AP operation (v10.1 / API v2)" -@@ -630,6 +649,13 @@ define KernelPackage/ath10k/config - Use the ath10k firmware from the 10.1 SDK using API v2 optimized - for access point operation if the default firmware keeps crashing. - ++ + config ATH10K_STA_FW + bool "Firmware optimized for STA operation" +- default n + help + Use the ath10k firmware optimized for wireless client instead +- of access point operation. ++ of access point operation. Might be unstable in AP mode. ++ + config ATH10K_CT_COMMUNITY_FW + bool "Firmware by Candela Technologies (community version)" + help + Supports both AP and IBSS (ad-hoc) mode. Doesn't support + encryption when using multiple VIFs. -+ + + config ATH10K_API2_FW + bool "Firmware optimized for AP operation (v10.1 / API v2)" +- default n +- depends on !ATH10K_STA_FW + help + Use the ath10k firmware from the 10.1 SDK using API v2 optimized + for access point operation if the default firmware keeps crashing. + + endchoice endif endef -@@ -1885,11 +1911,17 @@ ifeq ($(CONFIG_ATH10K_API2_FW),y) +@@ -1866,18 +1890,25 @@ define KernelPackage/ath10k/install + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/ath10k/QCA988X/hw2.0/board.bin \ + $(1)/lib/firmware/ath10k/QCA988X/hw2.0/ ++ifeq ($(CONFIG_ATH10K_AP_FW),y) ++ $(INSTALL_DATA) \ ++ $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.2.4/firmware-4.bin_10.2.4.45 \ ++ $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-4.bin ++endif + ifeq ($(CONFIG_ATH10K_STA_FW),y) + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/main/firmware-2.bin_999.999.0.636 \ + $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin +-else ifeq ($(CONFIG_ATH10K_API2_FW),y) ++endif ++ifeq ($(CONFIG_ATH10K_API2_FW),y) $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.1/firmware-2.bin_10.1.467.2-1 \ $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin -else +endif -+ifeq ($(CONFIG_ATH10K_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) \ + $(INSTALL_DATA) \ +- $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.2.4/firmware-4.bin_10.2.4.45 \ +- $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-4.bin + $(DL_DIR)/$(ATH10K_CT_COMMUNITY_FW) \ + $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin -+endif + endif endef - define KernelPackage/mt7601u/install diff --git a/patches/openwrt/0005-base-files-disable-reset-button-handling.patch b/patches/openwrt/0006-base-files-disable-reset-button-handling.patch similarity index 100% rename from patches/openwrt/0005-base-files-disable-reset-button-handling.patch rename to patches/openwrt/0006-base-files-disable-reset-button-handling.patch diff --git a/patches/openwrt/0006-mac80211-backport-from-trunk-r46760.patch b/patches/openwrt/0006-mac80211-backport-from-trunk-r46760.patch deleted file mode 100644 index 03aa5c5e..00000000 --- a/patches/openwrt/0006-mac80211-backport-from-trunk-r46760.patch +++ /dev/null @@ -1,20504 +0,0 @@ -From: Matthias Schiffer -Date: Tue, 1 Sep 2015 18:50:16 +0200 -Subject: mac80211: backport from trunk r46760 - -diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile -index a1eedce..04dfd3b 100644 ---- a/package/kernel/mac80211/Makefile -+++ b/package/kernel/mac80211/Makefile -@@ -10,11 +10,11 @@ include $(INCLUDE_DIR)/kernel.mk - - PKG_NAME:=mac80211 - --PKG_VERSION:=2015-03-09 --PKG_RELEASE:=3 -+PKG_VERSION:=2015-07-21 -+PKG_RELEASE:=1 - PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources - PKG_BACKPORT_VERSION:= --PKG_MD5SUM:=6d4b04e4ce8a1f54dabfb04f4709453c -+PKG_MD5SUM:=ec529acfb9c942daf8116e5cff47c999 - - PKG_SOURCE:=compat-wireless-$(PKG_VERSION)$(PKG_BACKPORT_VERSION).tar.bz2 - PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/compat-wireless-$(PKG_VERSION) -@@ -31,7 +31,7 @@ PKG_DRIVERS = \ - mwl8k mwifiex-pcie net-hermes net-hermes-pci net-hermes-plx net-hermes-pcmcia \ - iwl-legacy iwl3945 iwl4965 iwlagn wlcore wl12xx wl18xx lib80211 \ - rtlwifi rtlwifi-pci rtlwifi-usb rtl8192c-common rtl8192ce rtl8192se \ -- rtl8192de rtl8192cu -+ rtl8192de rtl8192cu mt7601u - - PKG_CONFIG_DEPENDS:= \ - CONFIG_PACKAGE_kmod-mac80211 \ -@@ -60,7 +60,6 @@ define KernelPackage/mac80211/Default - SUBMENU:=$(WMENU) - URL:=https://wireless.wiki.kernel.org/ - MAINTAINER:=Felix Fietkau -- DEPENDS:=@!TARGET_uml - endef - - define KernelPackage/cfg80211 -@@ -79,7 +78,7 @@ endef - define KernelPackage/mac80211 - $(call KernelPackage/mac80211/Default) - TITLE:=Linux 802.11 Wireless Networking Stack -- DEPENDS+= +kmod-crypto-core +kmod-crypto-arc4 +kmod-crypto-aes +kmod-cfg80211 +hostapd-common -+ DEPENDS+= +kmod-crypto-core +kmod-crypto-arc4 +kmod-cfg80211 +hostapd-common - KCONFIG:=\ - CONFIG_AVERAGE=y - FILES:= $(PKG_BUILD_DIR)/net/mac80211/mac80211.ko -@@ -128,7 +127,7 @@ endef - $(eval $(call Download,linux-firmware)) - - PKG_ATH10K_LINUX_FIRMWARE_NAME:=ath10k-firmware --PKG_ATH10K_LINUX_FIRMWARE_VERSION:=da0f85d924226ee30c46e037120621c9e192b39e -+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 -@@ -516,7 +515,7 @@ define KernelPackage/ath/config - bool "Atheros wireless debugging" - help - Say Y, if you want to debug atheros wireless drivers. -- Right now only ath9k makes use of this. -+ Only ath9k & ath10k make use of this. - - config PACKAGE_ATH_DFS - bool "Enable DFS support" -@@ -624,17 +623,9 @@ endef - define KernelPackage/ath10k/config - if PACKAGE_kmod-ath10k - -- config ATH10K_STA_FW -- bool "Firmware optimized for STA operation" -- default n -- help -- Use the ath10k firmware optimized for wireless client instead -- of access point operation. -- - config ATH10K_API2_FW - bool "Firmware optimized for AP operation (v10.1 / API v2)" - default n -- depends on !ATH10K_STA_FW - help - Use the ath10k firmware from the 10.1 SDK using API v2 optimized - for access point operation if the default firmware keeps crashing. -@@ -704,10 +695,31 @@ define KernelPackage/mac80211-hwsim - AUTOLOAD:=$(call AutoProbe,mac80211_hwsim) - endef - -+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)) -+ -+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 -+ - define KernelPackage/net-libipw - $(call KernelPackage/mac80211/Default) - TITLE:=libipw for ipw2100 and ipw2200 -- DEPENDS:=@PCI_SUPPORT +kmod-crypto-core +kmod-crypto-arc4 +kmod-crypto-aes +kmod-crypto-michael-mic +kmod-lib80211 +kmod-cfg80211 +@DRIVER_WEXT_SUPPORT @!BIG_ENDIAN -+ DEPENDS:=@PCI_SUPPORT +kmod-crypto-core +kmod-crypto-arc4 +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) - endef -@@ -1602,6 +1614,8 @@ config-$(CONFIG_BRCMFMAC_PCIE) += BRCMFMAC_PCIE - config-$(CONFIG_PACKAGE_BRCM80211_DEBUG) += BRCMDBG - - config-$(call config_package,mac80211-hwsim) += MAC80211_HWSIM -+config-$(call config_package,mt7601u) += MT7601U -+config-y += WL_MEDIATEK - - config-$(call config_package,rt2x00-lib) += RT2X00 RT2X00_LIB - config-$(call config_package,rt2x00-pci) += RT2X00_LIB_PCI -@@ -1704,6 +1718,7 @@ define Build/Prepare - $(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_ATH10K_LINUX_FIRMWARE_SOURCE) -+ $(TAR) -C $(PKG_BUILD_DIR) -xjf $(DL_DIR)/$(PKG_MT7601U_FW_SOURCE) - rm -rf \ - $(PKG_BUILD_DIR)/include/linux/ssb \ - $(PKG_BUILD_DIR)/include/linux/bcma \ -@@ -1866,21 +1881,24 @@ 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_STA_FW),y) -- $(INSTALL_DATA) \ -- $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/main/firmware-2.bin_999.999.0.636 \ -- $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin --else ifeq ($(CONFIG_ATH10K_API2_FW),y) -+ifeq ($(CONFIG_ATH10K_API2_FW),y) - $(INSTALL_DATA) \ - $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.1/firmware-2.bin_10.1.467.2-1 \ - $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin - else - $(INSTALL_DATA) \ -- $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.2.4/firmware-4.bin_10.2.4.45 \ -- $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-4.bin -+ $(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 - 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) \ -@@ -2065,6 +2083,7 @@ $(eval $(call KernelPackage,rtl8192de)) - $(eval $(call KernelPackage,rtl8192cu)) - $(eval $(call KernelPackage,zd1211rw)) - $(eval $(call KernelPackage,mac80211-hwsim)) -+$(eval $(call KernelPackage,mt7601u)) - $(eval $(call KernelPackage,ath9k-common)) - $(eval $(call KernelPackage,ath9k)) - $(eval $(call KernelPackage,ath9k-htc)) -diff --git a/package/kernel/mac80211/files/regdb.txt b/package/kernel/mac80211/files/regdb.txt -index ba95fc6..84413fd 100644 ---- a/package/kernel/mac80211/files/regdb.txt -+++ b/package/kernel/mac80211/files/regdb.txt -@@ -6,7 +6,7 @@ country 00: - # 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 - (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 - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS -+ # 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 - (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 - (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 - - country RU: DFS-ETSI - (2402 - 2482 @ 40), (20) -- (5170 - 5250 @ 80), (20) -- (5250 - 5330 @ 80), (20), DFS -- (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) - - 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 - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -+country WS: DFS-ETSI -+ (2402 - 2482 @ 40), (20) -+ (5170 - 5250 @ 40), (20) -+ (5250 - 5330 @ 40), (20), DFS -+ (5490 - 5710 @ 40), (27), DFS -+ - country YE: - (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 -+++ b/package/kernel/mac80211/patches/001-fix_build.patch -@@ -27,7 +27,7 @@ - @set -e ; test -f .local-symbols || ( \ - echo "/--------------" ;\ - echo "| You shouldn't run make in the backports tree, but only in" ;\ --@@ -60,56 +62,60 @@ mrproper: -+@@ -60,57 +62,61 @@ mrproper: - echo "| (that isn't currently running.)" ;\ - echo "\\--" ;\ - false) -@@ -56,11 +56,12 @@ - - done \ - - ) > Kconfig.kernel ;\ - - kver=$$($(MAKE) --no-print-directory -C $(KLIB_BUILD) kernelversion | \ --- sed 's/^\(\(3\|2\.6\)\.[0-9]\+\).*/\1/;t;d') ;\ -+- sed 's/^\(\([3-4]\|2\.6\)\.[0-9]\+\).*/\1/;t;d') ;\ - - test "$$kver" != "" || echo "Kernel version parse failed!" ;\ - - test "$$kver" != "" ;\ - - kvers="$$(seq 14 39 | sed 's/^/2.6./')" ;\ --- kvers="$$kvers $$(seq 0 99 | sed 's/^/3./')" ;\ -+- kvers="$$kvers $$(seq 0 19 | sed 's/^/3./')" ;\ -+- kvers="$$kvers $$(seq 0 99 | sed 's/^/4./')" ;\ - - print=0 ;\ - - for v in $$kvers ; do \ - - if [ "$$print" = "1" ] ; then \ -@@ -111,11 +112,12 @@ - + - +Kconfig.versions: Kconfig.kernel - + @kver=$$($(MAKE) --no-print-directory -C $(KLIB_BUILD) kernelversion | \ --+ sed 's/^\(\(3\|2\.6\)\.[0-9]\+\).*/\1/;t;d') ;\ -++ sed 's/^\(\([3-4]\|2\.6\)\.[0-9]\+\).*/\1/;t;d') ;\ - + test "$$kver" != "" || echo "Kernel version parse failed!" ;\ - + test "$$kver" != "" ;\ - + kvers="$$(seq 14 39 | sed 's/^/2.6./')" ;\ --+ kvers="$$kvers $$(seq 0 99 | sed 's/^/3./')" ;\ -++ kvers="$$kvers $$(seq 0 19 | sed 's/^/3./')" ;\ -++ kvers="$$kvers $$(seq 0 99 | sed 's/^/4./')" ;\ - + print=0 ;\ - + for v in $$kvers ; do \ - + if [ "$$print" = "1" ] ; then \ -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 ---- a/package/kernel/mac80211/patches/004-backports_debugfs_fix.patch -+++ /dev/null -@@ -1,10 +0,0 @@ ----- a/backport-include/linux/debugfs.h --+++ b/backport-include/linux/debugfs.h --@@ -3,6 +3,7 @@ -- #include_next -- #include -- #include --+#include -- -- #if defined(CONFIG_DEBUG_FS) -- struct dentry *debugfs_create_devm_seqfile(struct device *dev, const char *name, -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 ---- a/package/kernel/mac80211/patches/008-fix_netdev_unregister.patch -+++ /dev/null -@@ -1,16 +0,0 @@ ----- a/net/mac80211/iface.c --+++ b/net/mac80211/iface.c --@@ -1858,6 +1858,13 @@ void ieee80211_remove_interfaces(struct -- } -- mutex_unlock(&local->iflist_mtx); -- unregister_netdevice_many(&unreg_list); --+#if (!(LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,45) && \ --+ LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) && \ --+ !(LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,9) && \ --+ LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0)) && \ --+ (LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0))) --+ list_del(&unreg_list); --+#endif -- -- list_for_each_entry_safe(sdata, tmp, &wdev_list, list) { -- list_del(&sdata->list); -diff --git a/package/kernel/mac80211/patches/020-add_mpls_h.patch b/package/kernel/mac80211/patches/020-add_mpls_h.patch -deleted file mode 100644 -index e5310bc..0000000 ---- a/package/kernel/mac80211/patches/020-add_mpls_h.patch -+++ /dev/null -@@ -1,37 +0,0 @@ ----- /dev/null --+++ b/include/uapi/linux/mpls.h --@@ -0,0 +1,34 @@ --+#ifndef _UAPI_MPLS_H --+#define _UAPI_MPLS_H --+ --+#include --+#include --+ --+/* Reference: RFC 5462, RFC 3032 --+ * --+ * 0 1 2 3 --+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 --+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ --+ * | Label | TC |S| TTL | --+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ --+ * --+ * Label: Label Value, 20 bits --+ * TC: Traffic Class field, 3 bits --+ * S: Bottom of Stack, 1 bit --+ * TTL: Time to Live, 8 bits --+ */ --+ --+struct mpls_label { --+ __be32 entry; --+}; --+ --+#define MPLS_LS_LABEL_MASK 0xFFFFF000 --+#define MPLS_LS_LABEL_SHIFT 12 --+#define MPLS_LS_TC_MASK 0x00000E00 --+#define MPLS_LS_TC_SHIFT 9 --+#define MPLS_LS_S_MASK 0x00000100 --+#define MPLS_LS_S_SHIFT 8 --+#define MPLS_LS_TTL_MASK 0x000000FF --+#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/045-bcma-from-4.1.patch b/package/kernel/mac80211/patches/045-bcma-from-4.1.patch -deleted file mode 100644 -index dce217f..0000000 ---- a/package/kernel/mac80211/patches/045-bcma-from-4.1.patch -+++ /dev/null -@@ -1,104 +0,0 @@ ----- a/drivers/bcma/driver_pci.c --+++ b/drivers/bcma/driver_pci.c --@@ -282,39 +282,6 @@ void bcma_core_pci_power_save(struct bcm -- } -- EXPORT_SYMBOL_GPL(bcma_core_pci_power_save); -- ---int bcma_core_pci_irq_ctl(struct bcma_bus *bus, struct bcma_device *core, --- bool enable) ---{ --- struct pci_dev *pdev; --- u32 coremask, tmp; --- int err = 0; --- --- if (bus->hosttype != BCMA_HOSTTYPE_PCI) { --- /* This bcma device is not on a PCI host-bus. So the IRQs are --- * not routed through the PCI core. --- * So we must not enable routing through the PCI core. */ --- goto out; --- } --- --- pdev = bus->host_pci; --- --- err = pci_read_config_dword(pdev, BCMA_PCI_IRQMASK, &tmp); --- if (err) --- goto out; --- --- coremask = BIT(core->core_index) << 8; --- if (enable) --- tmp |= coremask; --- else --- tmp &= ~coremask; --- --- err = pci_write_config_dword(pdev, BCMA_PCI_IRQMASK, tmp); --- ---out: --- return err; ---} ---EXPORT_SYMBOL_GPL(bcma_core_pci_irq_ctl); --- -- static void bcma_core_pci_extend_L1timer(struct bcma_drv_pci *pc, bool extend) -- { -- u32 w; ----- a/drivers/bcma/host_pci.c --+++ b/drivers/bcma/host_pci.c --@@ -351,3 +351,37 @@ void bcma_host_pci_down(struct bcma_bus -- bcma_core_pci_down(&bus->drv_pci[0]); -- } -- EXPORT_SYMBOL_GPL(bcma_host_pci_down); --+ --+/* See also si_pci_setup */ --+int bcma_host_pci_irq_ctl(struct bcma_bus *bus, struct bcma_device *core, --+ bool enable) --+{ --+ struct pci_dev *pdev; --+ u32 coremask, tmp; --+ int err = 0; --+ --+ if (bus->hosttype != BCMA_HOSTTYPE_PCI) { --+ /* This bcma device is not on a PCI host-bus. So the IRQs are --+ * not routed through the PCI core. --+ * So we must not enable routing through the PCI core. */ --+ goto out; --+ } --+ --+ pdev = bus->host_pci; --+ --+ err = pci_read_config_dword(pdev, BCMA_PCI_IRQMASK, &tmp); --+ if (err) --+ goto out; --+ --+ coremask = BIT(core->core_index) << 8; --+ if (enable) --+ tmp |= coremask; --+ else --+ tmp &= ~coremask; --+ --+ err = pci_write_config_dword(pdev, BCMA_PCI_IRQMASK, tmp); --+ --+out: --+ return err; --+} --+EXPORT_SYMBOL_GPL(bcma_host_pci_irq_ctl); ----- a/drivers/net/wireless/b43/main.c --+++ b/drivers/net/wireless/b43/main.c --@@ -4866,7 +4866,7 @@ static int b43_wireless_core_init(struct -- switch (dev->dev->bus_type) { -- #ifdef CPTCFG_B43_BCMA -- case B43_BUS_BCMA: --- bcma_core_pci_irq_ctl(dev->dev->bdev->bus, --+ bcma_host_pci_irq_ctl(dev->dev->bdev->bus, -- dev->dev->bdev, true); -- bcma_host_pci_up(dev->dev->bdev->bus); -- break; ----- a/drivers/net/wireless/brcm80211/brcmsmac/main.c --+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c --@@ -4959,7 +4959,7 @@ static int brcms_b_up_prep(struct brcms_ -- * Configure pci/pcmcia here instead of in brcms_c_attach() -- * to allow mfg hotswap: down, hotswap (chip power cycle), up. -- */ --- bcma_core_pci_irq_ctl(wlc_hw->d11core->bus, wlc_hw->d11core, --+ bcma_host_pci_irq_ctl(wlc_hw->d11core->bus, wlc_hw->d11core, -- true); -- -- /* -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 ---- 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 @@ - --- a/.local-symbols - +++ b/.local-symbols --@@ -344,40 +344,3 @@ USB_CDC_PHONET= -+@@ -449,43 +449,6 @@ USB_CDC_PHONET= - USB_IPHETH= - USB_SIERRA_NET= - USB_VL600= -@@ -32,26 +32,18 @@ - -BCMA_BLOCKIO= - -BCMA_HOST_PCI_POSSIBLE= - -BCMA_HOST_PCI= ---BCMA_DRIVER_PCI_HOSTMODE= - -BCMA_HOST_SOC= - -BCMA_DRIVER_PCI= -+-BCMA_DRIVER_PCI_HOSTMODE= - -BCMA_DRIVER_MIPS= - -BCMA_SFLASH= - -BCMA_NFLASH= - -BCMA_DRIVER_GMAC_CMN= - -BCMA_DRIVER_GPIO= - -BCMA_DEBUG= ----- a/Makefile.kernel --+++ b/Makefile.kernel --@@ -38,8 +38,6 @@ obj-$(CPTCFG_MAC80211) += net/mac80211/ -- obj-$(CPTCFG_WLAN) += drivers/net/wireless/ -- #obj-$(CPTCFG_BT) += net/bluetooth/ -- #obj-$(CPTCFG_BT) += drivers/bluetooth/ ---obj-$(CPTCFG_SSB) += drivers/ssb/ ---obj-$(CPTCFG_BCMA) += drivers/bcma/ -- #obj-$(CPTCFG_ETHERNET) += drivers/net/ethernet/ -- obj-$(CPTCFG_USB_NET_RNDIS_WLAN) += drivers/net/usb/ -- #obj-$(CPTCFG_NFC) += net/nfc/ -+ NFC= -+ NFC_DIGITAL= -+ NFC_NCI= - --- a/drivers/net/wireless/b43/main.c - +++ b/drivers/net/wireless/b43/main.c - @@ -2866,7 +2866,7 @@ static struct ssb_device *b43_ssb_gpio_d -@@ -63,7 +55,7 @@ - return (bus->chipco.dev ? bus->chipco.dev : bus->pcicore.dev); - #else - return bus->chipco.dev; --@@ -4907,7 +4907,7 @@ static int b43_wireless_core_init(struct -+@@ -4903,7 +4903,7 @@ static int b43_wireless_core_init(struct - } - if (sprom->boardflags_lo & B43_BFL_XTAL_NOSLOW) - hf |= B43_HF_DSCRQ; /* Disable slowclock requests from ucode. */ -@@ -116,12 +108,23 @@ - --- a/Kconfig.sources - +++ b/Kconfig.sources - @@ -9,9 +9,6 @@ source "$BACKPORT_DIR/drivers/net/wirele -- #source "$BACKPORT_DIR/drivers/net/ethernet/Kconfig" -+ source "$BACKPORT_DIR/drivers/net/ethernet/Kconfig" - source "$BACKPORT_DIR/drivers/net/usb/Kconfig" - - -source "$BACKPORT_DIR/drivers/ssb/Kconfig" - -source "$BACKPORT_DIR/drivers/bcma/Kconfig" - - -- #source "$BACKPORT_DIR/net/nfc/Kconfig" -+ source "$BACKPORT_DIR/net/nfc/Kconfig" - -- #source "$BACKPORT_DIR/drivers/media/Kconfig" -+ source "$BACKPORT_DIR/drivers/media/Kconfig" -+--- a/Makefile.kernel -++++ b/Makefile.kernel -+@@ -38,8 +38,6 @@ obj-$(CPTCFG_MAC80211) += net/mac80211/ -+ obj-$(CPTCFG_WLAN) += drivers/net/wireless/ -+ obj-$(CPTCFG_BT) += net/bluetooth/ -+ obj-$(CPTCFG_BT) += drivers/bluetooth/ -+-obj-$(CPTCFG_SSB) += drivers/ssb/ -+-obj-$(CPTCFG_BCMA) += drivers/bcma/ -+ 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/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 ---- a/package/kernel/mac80211/patches/090-linux_3_18_12_compat.patch -+++ /dev/null -@@ -1,29 +0,0 @@ ----- a/backport-include/linux/wait.h --+++ b/backport-include/linux/wait.h --@@ -23,7 +23,7 @@ backport_wait_on_bit_io(void *word, int -- -- #endif -- ---#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) --+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,12) -- #define WQ_FLAG_WOKEN 0x02 -- -- #define wait_woken LINUX_BACKPORT(wait_woken) ----- a/compat/backport-3.19.c --+++ b/compat/backport-3.19.c --@@ -15,6 +15,7 @@ -- #include -- #include -- --+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,12) -- static inline bool is_kthread_should_stop(void) -- { -- return (current->flags & PF_KTHREAD) && kthread_should_stop(); --@@ -79,6 +80,7 @@ int woken_wake_function(wait_queue_t *wa -- return default_wake_function(wait, mode, sync, key); -- } -- EXPORT_SYMBOL(woken_wake_function); --+#endif -- -- #ifdef __BACKPORT_NETDEV_RSS_KEY_FILL -- 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 ---- /dev/null -+++ b/package/kernel/mac80211/patches/100-remove-cryptoapi-dependencies.patch -@@ -0,0 +1,376 @@ -+--- a/net/mac80211/Kconfig -++++ b/net/mac80211/Kconfig -+@@ -5,8 +5,6 @@ config MAC80211 -+ depends on CRYPTO -+ depends on CRYPTO_ARC4 -+ depends on CRYPTO_AES -+- select BPAUTO_CRYPTO_CCM -+- depends on CRYPTO_GCM -+ depends on CRC32 -+ select BPAUTO_AVERAGE -+ ---help--- -+--- a/net/mac80211/Makefile -++++ b/net/mac80211/Makefile -+@@ -15,9 +15,7 @@ mac80211-y := \ -+ michael.o \ -+ tkip.o \ -+ aes_ccm.o \ -+- aes_gcm.o \ -+ aes_cmac.o \ -+- aes_gmac.o \ -+ cfg.o \ -+ ethtool.o \ -+ rx.o \ -+--- a/net/mac80211/aes_ccm.c -++++ b/net/mac80211/aes_ccm.c -+@@ -13,89 +13,132 @@ -+ #include -+ #include -+ #include -++#include -+ -+ #include -+ #include "key.h" -+ #include "aes_ccm.h" -+ -+-void ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, -+- u8 *data, size_t data_len, u8 *mic, -+- size_t mic_len) -++static void aes_ccm_prepare(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, u8 *s_0, -++ u8 *a, u8 *b) -+ { -+- struct scatterlist sg[3]; -++ int i; -++ -++ crypto_cipher_encrypt_one(tfm, b, b_0); -++ -++ /* Extra Authenticate-only data (always two AES blocks) */ -++ for (i = 0; i < AES_BLOCK_SIZE; i++) -++ aad[i] ^= b[i]; -++ crypto_cipher_encrypt_one(tfm, b, aad); -++ -++ aad += AES_BLOCK_SIZE; -++ -++ for (i = 0; i < AES_BLOCK_SIZE; i++) -++ aad[i] ^= b[i]; -++ crypto_cipher_encrypt_one(tfm, a, aad); -+ -+- char aead_req_data[sizeof(struct aead_request) + -+- crypto_aead_reqsize(tfm)] -+- __aligned(__alignof__(struct aead_request)); -+- struct aead_request *aead_req = (void *) aead_req_data; -++ /* Mask out bits from auth-only-b_0 */ -++ b_0[0] &= 0x07; -+ -+- memset(aead_req, 0, sizeof(aead_req_data)); -++ /* S_0 is used to encrypt T (= MIC) */ -++ b_0[14] = 0; -++ b_0[15] = 0; -++ crypto_cipher_encrypt_one(tfm, s_0, b_0); -++} -+ -+- sg_init_table(sg, 3); -+- sg_set_buf(&sg[0], &aad[2], be16_to_cpup((__be16 *)aad)); -+- sg_set_buf(&sg[1], data, data_len); -+- sg_set_buf(&sg[2], mic, mic_len); -+ -+- aead_request_set_tfm(aead_req, tfm); -+- aead_request_set_crypt(aead_req, sg, sg, data_len, b_0); -+- aead_request_set_ad(aead_req, sg[0].length); -++void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, -++ u8 *data, size_t data_len, u8 *mic, -++ size_t mic_len) -++{ -++ int i, j, last_len, num_blocks; -++ u8 b[AES_BLOCK_SIZE]; -++ u8 s_0[AES_BLOCK_SIZE]; -++ u8 e[AES_BLOCK_SIZE]; -++ u8 *pos, *cpos; -++ -++ num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_SIZE); -++ last_len = data_len % AES_BLOCK_SIZE; -++ aes_ccm_prepare(tfm, b_0, aad, s_0, b, b); -++ -++ /* Process payload blocks */ -++ pos = data; -++ cpos = data; -++ for (j = 1; j <= num_blocks; j++) { -++ int blen = (j == num_blocks && last_len) ? -++ last_len : AES_BLOCK_SIZE; -++ -++ /* Authentication followed by encryption */ -++ for (i = 0; i < blen; i++) -++ b[i] ^= pos[i]; -++ crypto_cipher_encrypt_one(tfm, b, b); -++ -++ b_0[14] = (j >> 8) & 0xff; -++ b_0[15] = j & 0xff; -++ crypto_cipher_encrypt_one(tfm, e, b_0); -++ for (i = 0; i < blen; i++) -++ *cpos++ = *pos++ ^ e[i]; -++ } -+ -+- crypto_aead_encrypt(aead_req); -++ for (i = 0; i < mic_len; i++) -++ mic[i] = b[i] ^ s_0[i]; -+ } -+ -+-int ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, -++int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, -+ u8 *data, size_t data_len, u8 *mic, -+ size_t mic_len) -+ { -+- struct scatterlist sg[3]; -+- char aead_req_data[sizeof(struct aead_request) + -+- crypto_aead_reqsize(tfm)] -+- __aligned(__alignof__(struct aead_request)); -+- struct aead_request *aead_req = (void *) aead_req_data; -+- -+- if (data_len == 0) -+- return -EINVAL; -+- -+- memset(aead_req, 0, sizeof(aead_req_data)); -+- -+- sg_init_table(sg, 3); -+- sg_set_buf(&sg[0], &aad[2], be16_to_cpup((__be16 *)aad)); -+- sg_set_buf(&sg[1], data, data_len); -+- sg_set_buf(&sg[2], mic, mic_len); -+- -+- aead_request_set_tfm(aead_req, tfm); -+- aead_request_set_crypt(aead_req, sg, sg, data_len + mic_len, b_0); -+- aead_request_set_ad(aead_req, sg[0].length); -++ int i, j, last_len, num_blocks; -++ u8 *pos, *cpos; -++ u8 a[AES_BLOCK_SIZE]; -++ u8 b[AES_BLOCK_SIZE]; -++ u8 s_0[AES_BLOCK_SIZE]; -++ -++ num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_SIZE); -++ last_len = data_len % AES_BLOCK_SIZE; -++ aes_ccm_prepare(tfm, b_0, aad, s_0, a, b); -++ -++ /* Process payload blocks */ -++ cpos = data; -++ pos = data; -++ for (j = 1; j <= num_blocks; j++) { -++ int blen = (j == num_blocks && last_len) ? -++ last_len : AES_BLOCK_SIZE; -++ -++ /* Decryption followed by authentication */ -++ b_0[14] = (j >> 8) & 0xff; -++ b_0[15] = j & 0xff; -++ crypto_cipher_encrypt_one(tfm, b, b_0); -++ for (i = 0; i < blen; i++) { -++ *pos = *cpos++ ^ b[i]; -++ a[i] ^= *pos++; -++ } -++ crypto_cipher_encrypt_one(tfm, a, a); -++ } -++ -++ for (i = 0; i < mic_len; i++) { -++ if ((mic[i] ^ s_0[i]) != a[i]) -++ return -1; -++ } -+ -+- return crypto_aead_decrypt(aead_req); -++ return 0; -+ } -+ -+-struct crypto_aead *ieee80211_aes_key_setup_encrypt(const u8 key[], -+- size_t key_len, -+- size_t mic_len) -++struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[], -++ size_t key_len, -++ size_t mic_len) -+ { -+- struct crypto_aead *tfm; -+- int err; -++ struct crypto_cipher *tfm; -+ -+- tfm = crypto_alloc_aead("ccm(aes)", 0, CRYPTO_ALG_ASYNC); -+- if (IS_ERR(tfm)) -+- return tfm; -+- -+- err = crypto_aead_setkey(tfm, key, key_len); -+- if (err) -+- goto free_aead; -+- err = crypto_aead_setauthsize(tfm, mic_len); -+- if (err) -+- goto free_aead; -++ tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC); -++ if (!IS_ERR(tfm)) -++ crypto_cipher_setkey(tfm, key, key_len); -+ -+ return tfm; -+- -+-free_aead: -+- crypto_free_aead(tfm); -+- return ERR_PTR(err); -+ } -+ -+-void ieee80211_aes_key_free(struct crypto_aead *tfm) -++ -++void ieee80211_aes_key_free(struct crypto_cipher *tfm) -+ { -+- crypto_free_aead(tfm); -++ crypto_free_cipher(tfm); -+ } -+--- a/net/mac80211/aes_ccm.h -++++ b/net/mac80211/aes_ccm.h -+@@ -12,15 +12,15 @@ -+ -+ #include -+ -+-struct crypto_aead *ieee80211_aes_key_setup_encrypt(const u8 key[], -+- size_t key_len, -+- size_t mic_len); -+-void ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, -++struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[], -++ size_t key_len, -++ size_t mic_len); -++void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, -+ u8 *data, size_t data_len, u8 *mic, -+ size_t mic_len); -+-int ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, -++int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, -+ u8 *data, size_t data_len, u8 *mic, -+ size_t mic_len); -+-void ieee80211_aes_key_free(struct crypto_aead *tfm); -++void ieee80211_aes_key_free(struct crypto_cipher *tfm); -+ -+ #endif /* AES_CCM_H */ -+--- a/net/mac80211/aes_gcm.h -++++ b/net/mac80211/aes_gcm.h -+@@ -11,12 +11,28 @@ -+ -+ #include -+ -+-void ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, -+- u8 *data, size_t data_len, u8 *mic); -+-int ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, -+- u8 *data, size_t data_len, u8 *mic); -+-struct crypto_aead *ieee80211_aes_gcm_key_setup_encrypt(const u8 key[], -+- size_t key_len); -+-void ieee80211_aes_gcm_key_free(struct crypto_aead *tfm); -++static inline void -++ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, -++ u8 *data, size_t data_len, u8 *mic) -++{ -++} -++ -++static inline int -++ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, -++ u8 *data, size_t data_len, u8 *mic) -++{ -++ return -EOPNOTSUPP; -++} -++ -++static inline struct crypto_aead * -++ieee80211_aes_gcm_key_setup_encrypt(const u8 key[], size_t key_len) -++{ -++ return NULL; -++} -++ -++static inline void -++ieee80211_aes_gcm_key_free(struct crypto_aead *tfm) -++{ -++} -+ -+ #endif /* AES_GCM_H */ -+--- a/net/mac80211/aes_gmac.h -++++ b/net/mac80211/aes_gmac.h -+@@ -11,10 +11,22 @@ -+ -+ #include -+ -+-struct crypto_aead *ieee80211_aes_gmac_key_setup(const u8 key[], -+- size_t key_len); -+-int ieee80211_aes_gmac(struct crypto_aead *tfm, const u8 *aad, u8 *nonce, -+- const u8 *data, size_t data_len, u8 *mic); -+-void ieee80211_aes_gmac_key_free(struct crypto_aead *tfm); -++static inline struct crypto_aead * -++ieee80211_aes_gmac_key_setup(const u8 key[], size_t key_len) -++{ -++ return NULL; -++} -++ -++static inline int -++ieee80211_aes_gmac(struct crypto_aead *tfm, const u8 *aad, u8 *nonce, -++ const u8 *data, size_t data_len, u8 *mic) -++{ -++ return -EOPNOTSUPP; -++} -++ -++static inline void -++ieee80211_aes_gmac_key_free(struct crypto_aead *tfm) -++{ -++} -+ -+ #endif /* AES_GMAC_H */ -+--- a/net/mac80211/key.h -++++ b/net/mac80211/key.h -+@@ -84,7 +84,7 @@ struct ieee80211_key { -+ * Management frames. -+ */ -+ u8 rx_pn[IEEE80211_NUM_TIDS + 1][IEEE80211_CCMP_PN_LEN]; -+- struct crypto_aead *tfm; -++ struct crypto_cipher *tfm; -+ u32 replays; /* dot11RSNAStatsCCMPReplays */ -+ } ccmp; -+ struct { -+--- a/net/mac80211/wpa.c -++++ b/net/mac80211/wpa.c -+@@ -304,7 +304,8 @@ ieee80211_crypto_tkip_decrypt(struct iee -+ } -+ -+ -+-static void ccmp_special_blocks(struct sk_buff *skb, u8 *pn, u8 *b_0, u8 *aad) -++static void ccmp_special_blocks(struct sk_buff *skb, u8 *pn, u8 *b_0, u8 *aad, -++ u16 data_len) -+ { -+ __le16 mask_fc; -+ int a4_included, mgmt; -+@@ -334,14 +335,8 @@ static void ccmp_special_blocks(struct s -+ else -+ qos_tid = 0; -+ -+- /* In CCM, the initial vectors (IV) used for CTR mode encryption and CBC -+- * mode authentication are not allowed to collide, yet both are derived -+- * from this vector b_0. We only set L := 1 here to indicate that the -+- * data size can be represented in (L+1) bytes. The CCM layer will take -+- * care of storing the data length in the top (L+1) bytes and setting -+- * and clearing the other bits as is required to derive the two IVs. -+- */ -+- b_0[0] = 0x1; -++ /* First block, b_0 */ -++ b_0[0] = 0x59; /* flags: Adata: 1, M: 011, L: 001 */ -+ -+ /* 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 -+ b_0[1] = qos_tid | (mgmt << 4); -+ memcpy(&b_0[2], hdr->addr2, ETH_ALEN); -+ memcpy(&b_0[8], pn, IEEE80211_CCMP_PN_LEN); -++ /* l(m) */ -++ put_unaligned_be16(data_len, &b_0[14]); -+ -+ /* 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 -+ return 0; -+ -+ pos += IEEE80211_CCMP_HDR_LEN; -+- ccmp_special_blocks(skb, pn, b_0, aad); -++ ccmp_special_blocks(skb, pn, b_0, aad, len); -+ 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 -+ u8 aad[2 * AES_BLOCK_SIZE]; -+ u8 b_0[AES_BLOCK_SIZE]; -+ /* hardware didn't decrypt/verify MIC */ -+- ccmp_special_blocks(skb, pn, b_0, aad); -++ ccmp_special_blocks(skb, pn, b_0, aad, data_len); -+ -+ if (ieee80211_aes_ccm_decrypt( -+ key->u.ccmp.tfm, b_0, aad, -diff --git a/package/kernel/mac80211/patches/100-revert-cryptoapi-ports.patch b/package/kernel/mac80211/patches/100-revert-cryptoapi-ports.patch -deleted file mode 100644 -index ceca952..0000000 ---- a/package/kernel/mac80211/patches/100-revert-cryptoapi-ports.patch -+++ /dev/null -@@ -1,2055 +0,0 @@ --This patch reverts the following commits from wireless-testing: -- --8ade538bf39b1ee53418528fdacd36b8e65621b9 --56c52da2d554f081e8fce58ecbcf6a40c605b95b --2b2ba0db1c820d04d5143452d70012cd44d7b578 --00b9cfa3ff38401bd70c34b250ca13e5ea347b4a --4f031fa9f188b2b0641ac20087d9e16bcfb4e49d --6e1ee5d2e9e411892b5d84e3ea93e3fc88ac786c --30ef7ef9672d92ab2cac37f60a31955c118321e7 --f359d3fe832e49eeec2232b2af5a9e3aee6b4862 (only the changes in aes_cmac.{c,h}) --7ec7c4a9a686c608315739ab6a2b0527a240883c ----- -- ----- a/include/linux/ieee80211.h --+++ b/include/linux/ieee80211.h --@@ -1017,15 +1017,6 @@ struct ieee80211_mmie { -- u8 mic[8]; -- } __packed; -- ---/* Management MIC information element (IEEE 802.11w) for GMAC and CMAC-256 */ ---struct ieee80211_mmie_16 { --- u8 element_id; --- u8 length; --- __le16 key_id; --- u8 sequence_number[6]; --- u8 mic[16]; ---} __packed; --- -- struct ieee80211_vendor_ie { -- u8 element_id; -- u8 len; ----- a/include/net/mac80211.h --+++ b/include/net/mac80211.h --@@ -1306,8 +1306,8 @@ struct ieee80211_vif *wdev_to_ieee80211_ -- * @IEEE80211_KEY_FLAG_PAIRWISE: Set by mac80211, this flag indicates -- * that the key is pairwise rather then a shared key. -- * @IEEE80211_KEY_FLAG_SW_MGMT_TX: This flag should be set by the driver for a --- * CCMP/GCMP key if it requires CCMP/GCMP encryption of management frames --- * (MFP) to be done in software. --+ * CCMP key if it requires CCMP encryption of management frames (MFP) to --+ * be done in software. -- * @IEEE80211_KEY_FLAG_PUT_IV_SPACE: This flag should be set by the driver -- * if space should be prepared for the IV, but the IV -- * itself should not be generated. Do not set together with --@@ -1322,7 +1322,7 @@ struct ieee80211_vif *wdev_to_ieee80211_ -- * RX, if your crypto engine can't deal with TX you can also set the -- * %IEEE80211_KEY_FLAG_SW_MGMT_TX flag to encrypt such frames in SW. -- * @IEEE80211_KEY_FLAG_GENERATE_IV_MGMT: This flag should be set by the --- * driver for a CCMP/GCMP key to indicate that is requires IV generation --+ * driver for a CCMP key to indicate that is requires IV generation -- * only for managment frames (MFP). -- * @IEEE80211_KEY_FLAG_RESERVE_TAILROOM: This flag should be set by the -- * driver for a key to indicate that sufficient tailroom must always --@@ -4112,10 +4112,6 @@ void ieee80211_aes_cmac_calculate_k1_k2( -- * reverse order than in packet) -- * @aes_cmac: PN data, most significant byte first (big endian, -- * reverse order than in packet) --- * @aes_gmac: PN data, most significant byte first (big endian, --- * reverse order than in packet) --- * @gcmp: PN data, most significant byte first (big endian, --- * reverse order than in packet) -- */ -- struct ieee80211_key_seq { -- union { --@@ -4129,12 +4125,6 @@ struct ieee80211_key_seq { -- struct { -- u8 pn[6]; -- } aes_cmac; --- struct { --- u8 pn[6]; --- } aes_gmac; --- struct { --- u8 pn[6]; --- } gcmp; -- }; -- }; -- --@@ -4159,7 +4149,7 @@ void ieee80211_get_key_tx_seq(struct iee -- * ieee80211_get_key_rx_seq - get key RX sequence counter -- * -- * @keyconf: the parameter passed with the set key --- * @tid: The TID, or -1 for the management frame value (CCMP/GCMP only); --+ * @tid: The TID, or -1 for the management frame value (CCMP only); -- * the value on TID 0 is also used for non-QoS frames. For -- * CMAC, only TID 0 is valid. -- * @seq: buffer to receive the sequence data --@@ -4195,7 +4185,7 @@ void ieee80211_set_key_tx_seq(struct iee -- * ieee80211_set_key_rx_seq - set key RX sequence counter -- * -- * @keyconf: the parameter passed with the set key --- * @tid: The TID, or -1 for the management frame value (CCMP/GCMP only); --+ * @tid: The TID, or -1 for the management frame value (CCMP only); -- * the value on TID 0 is also used for non-QoS frames. For -- * CMAC, only TID 0 is valid. -- * @seq: new sequence data ----- a/net/mac80211/Kconfig --+++ b/net/mac80211/Kconfig --@@ -5,8 +5,6 @@ config MAC80211 -- depends on CRYPTO -- depends on CRYPTO_ARC4 -- depends on CRYPTO_AES --- select BPAUTO_CRYPTO_CCM --- depends on CRYPTO_GCM -- depends on CRC32 -- select BPAUTO_AVERAGE -- ---help--- ----- a/net/mac80211/Makefile --+++ b/net/mac80211/Makefile --@@ -15,9 +15,7 @@ mac80211-y := \ -- michael.o \ -- tkip.o \ -- aes_ccm.o \ --- aes_gcm.o \ -- aes_cmac.o \ --- aes_gmac.o \ -- cfg.o \ -- ethtool.o \ -- rx.o \ ----- a/net/mac80211/aes_ccm.c --+++ b/net/mac80211/aes_ccm.c --@@ -2,8 +2,6 @@ -- * Copyright 2003-2004, Instant802 Networks, Inc. -- * Copyright 2005-2006, Devicescape Software, Inc. -- * --- * Rewrite: Copyright (C) 2013 Linaro Ltd --- * -- * 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. --@@ -19,82 +17,134 @@ -- #include "key.h" -- #include "aes_ccm.h" -- ---void ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, --- u8 *data, size_t data_len, u8 *mic, --- size_t mic_len) --+static void aes_ccm_prepare(struct crypto_cipher *tfm, u8 *scratch, u8 *a) --+{ --+ int i; --+ u8 *b_0, *aad, *b, *s_0; --+ --+ b_0 = scratch + 3 * AES_BLOCK_SIZE; --+ aad = scratch + 4 * AES_BLOCK_SIZE; --+ b = scratch; --+ s_0 = scratch + AES_BLOCK_SIZE; --+ --+ crypto_cipher_encrypt_one(tfm, b, b_0); --+ --+ /* Extra Authenticate-only data (always two AES blocks) */ --+ for (i = 0; i < AES_BLOCK_SIZE; i++) --+ aad[i] ^= b[i]; --+ crypto_cipher_encrypt_one(tfm, b, aad); --+ --+ aad += AES_BLOCK_SIZE; --+ --+ for (i = 0; i < AES_BLOCK_SIZE; i++) --+ aad[i] ^= b[i]; --+ crypto_cipher_encrypt_one(tfm, a, aad); --+ --+ /* Mask out bits from auth-only-b_0 */ --+ b_0[0] &= 0x07; --+ --+ /* S_0 is used to encrypt T (= MIC) */ --+ b_0[14] = 0; --+ b_0[15] = 0; --+ crypto_cipher_encrypt_one(tfm, s_0, b_0); --+} --+ --+ --+void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *scratch, --+ u8 *data, size_t data_len, --+ u8 *cdata, u8 *mic) -- { --- struct scatterlist assoc, pt, ct[2]; --+ int i, j, last_len, num_blocks; --+ u8 *pos, *cpos, *b, *s_0, *e, *b_0; -- --- char aead_req_data[sizeof(struct aead_request) + --- crypto_aead_reqsize(tfm)] --- __aligned(__alignof__(struct aead_request)); --- struct aead_request *aead_req = (void *) aead_req_data; --- --- memset(aead_req, 0, sizeof(aead_req_data)); --- --- sg_init_one(&pt, data, data_len); --- sg_init_one(&assoc, &aad[2], be16_to_cpup((__be16 *)aad)); --- sg_init_table(ct, 2); --- sg_set_buf(&ct[0], data, data_len); --- sg_set_buf(&ct[1], mic, mic_len); --- --- aead_request_set_tfm(aead_req, tfm); --- aead_request_set_assoc(aead_req, &assoc, assoc.length); --- aead_request_set_crypt(aead_req, &pt, ct, data_len, b_0); --+ b = scratch; --+ s_0 = scratch + AES_BLOCK_SIZE; --+ e = scratch + 2 * AES_BLOCK_SIZE; --+ b_0 = scratch + 3 * AES_BLOCK_SIZE; --+ --+ num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_SIZE); --+ last_len = data_len % AES_BLOCK_SIZE; --+ aes_ccm_prepare(tfm, scratch, b); --+ --+ /* Process payload blocks */ --+ pos = data; --+ cpos = cdata; --+ for (j = 1; j <= num_blocks; j++) { --+ int blen = (j == num_blocks && last_len) ? --+ last_len : AES_BLOCK_SIZE; --+ --+ /* Authentication followed by encryption */ --+ for (i = 0; i < blen; i++) --+ b[i] ^= pos[i]; --+ crypto_cipher_encrypt_one(tfm, b, b); --+ --+ b_0[14] = (j >> 8) & 0xff; --+ b_0[15] = j & 0xff; --+ crypto_cipher_encrypt_one(tfm, e, b_0); --+ for (i = 0; i < blen; i++) --+ *cpos++ = *pos++ ^ e[i]; --+ } -- --- crypto_aead_encrypt(aead_req); --+ for (i = 0; i < IEEE80211_CCMP_MIC_LEN; i++) --+ mic[i] = b[i] ^ s_0[i]; -- } -- ---int ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, --- u8 *data, size_t data_len, u8 *mic, --- size_t mic_len) --+ --+int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *scratch, --+ u8 *cdata, size_t data_len, u8 *mic, u8 *data) -- { --- struct scatterlist assoc, pt, ct[2]; --- char aead_req_data[sizeof(struct aead_request) + --- crypto_aead_reqsize(tfm)] --- __aligned(__alignof__(struct aead_request)); --- struct aead_request *aead_req = (void *) aead_req_data; --- --- if (data_len == 0) --- return -EINVAL; --- --- memset(aead_req, 0, sizeof(aead_req_data)); --- --- sg_init_one(&pt, data, data_len); --- sg_init_one(&assoc, &aad[2], be16_to_cpup((__be16 *)aad)); --- sg_init_table(ct, 2); --- sg_set_buf(&ct[0], data, data_len); --- sg_set_buf(&ct[1], mic, mic_len); --- --- aead_request_set_tfm(aead_req, tfm); --- aead_request_set_assoc(aead_req, &assoc, assoc.length); --- aead_request_set_crypt(aead_req, ct, &pt, data_len + mic_len, b_0); --+ int i, j, last_len, num_blocks; --+ u8 *pos, *cpos, *b, *s_0, *a, *b_0; --+ --+ b = scratch; --+ s_0 = scratch + AES_BLOCK_SIZE; --+ a = scratch + 2 * AES_BLOCK_SIZE; --+ b_0 = scratch + 3 * AES_BLOCK_SIZE; --+ --+ num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_SIZE); --+ last_len = data_len % AES_BLOCK_SIZE; --+ aes_ccm_prepare(tfm, scratch, a); --+ --+ /* Process payload blocks */ --+ cpos = cdata; --+ pos = data; --+ for (j = 1; j <= num_blocks; j++) { --+ int blen = (j == num_blocks && last_len) ? --+ last_len : AES_BLOCK_SIZE; --+ --+ /* Decryption followed by authentication */ --+ b_0[14] = (j >> 8) & 0xff; --+ b_0[15] = j & 0xff; --+ crypto_cipher_encrypt_one(tfm, b, b_0); --+ for (i = 0; i < blen; i++) { --+ *pos = *cpos++ ^ b[i]; --+ a[i] ^= *pos++; --+ } --+ crypto_cipher_encrypt_one(tfm, a, a); --+ } --+ --+ for (i = 0; i < IEEE80211_CCMP_MIC_LEN; i++) { --+ if ((mic[i] ^ s_0[i]) != a[i]) --+ return -1; --+ } -- --- return crypto_aead_decrypt(aead_req); --+ return 0; -- } -- ---struct crypto_aead *ieee80211_aes_key_setup_encrypt(const u8 key[], --- size_t key_len, --- size_t mic_len) --+ --+struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[]) -- { --- struct crypto_aead *tfm; --- int err; --+ struct crypto_cipher *tfm; -- --- tfm = crypto_alloc_aead("ccm(aes)", 0, CRYPTO_ALG_ASYNC); --- if (IS_ERR(tfm)) --- return tfm; --- --- err = crypto_aead_setkey(tfm, key, key_len); --- if (!err) --- err = crypto_aead_setauthsize(tfm, mic_len); --- if (!err) --- return tfm; --+ tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC); --+ if (!IS_ERR(tfm)) --+ crypto_cipher_setkey(tfm, key, WLAN_KEY_LEN_CCMP); -- --- crypto_free_aead(tfm); --- return ERR_PTR(err); --+ return tfm; -- } -- ---void ieee80211_aes_key_free(struct crypto_aead *tfm) --+ --+void ieee80211_aes_key_free(struct crypto_cipher *tfm) -- { --- crypto_free_aead(tfm); --+ crypto_free_cipher(tfm); -- } ----- a/net/mac80211/aes_ccm.h --+++ b/net/mac80211/aes_ccm.h --@@ -12,15 +12,13 @@ -- -- #include -- ---struct crypto_aead *ieee80211_aes_key_setup_encrypt(const u8 key[], --- size_t key_len, --- size_t mic_len); ---void ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, --- u8 *data, size_t data_len, u8 *mic, --- size_t mic_len); ---int ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, --- u8 *data, size_t data_len, u8 *mic, --- size_t mic_len); ---void ieee80211_aes_key_free(struct crypto_aead *tfm); --+struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[]); --+void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *scratch, --+ u8 *data, size_t data_len, --+ u8 *cdata, u8 *mic); --+int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *scratch, --+ u8 *cdata, size_t data_len, --+ u8 *mic, u8 *data); --+void ieee80211_aes_key_free(struct crypto_cipher *tfm); -- -- #endif /* AES_CCM_H */ ----- a/net/mac80211/aes_cmac.c --+++ b/net/mac80211/aes_cmac.c --@@ -18,8 +18,8 @@ -- #include "key.h" -- #include "aes_cmac.h" -- --+#define AES_CMAC_KEY_LEN 16 -- #define CMAC_TLEN 8 /* CMAC TLen = 64 bits (8 octets) */ ---#define CMAC_TLEN_256 16 /* CMAC TLen = 128 bits (16 octets) */ -- #define AAD_LEN 20 -- -- --@@ -35,9 +35,9 @@ static void gf_mulx(u8 *pad) -- pad[AES_BLOCK_SIZE - 1] ^= 0x87; -- } -- ---static void aes_cmac_vector(struct crypto_cipher *tfm, size_t num_elem, --- const u8 *addr[], const size_t *len, u8 *mac, --- size_t mac_len) --+ --+static void aes_128_cmac_vector(struct crypto_cipher *tfm, size_t num_elem, --+ const u8 *addr[], const size_t *len, u8 *mac) -- { -- u8 cbc[AES_BLOCK_SIZE], pad[AES_BLOCK_SIZE]; -- const u8 *pos, *end; --@@ -88,7 +88,7 @@ static void aes_cmac_vector(struct crypt -- for (i = 0; i < AES_BLOCK_SIZE; i++) -- pad[i] ^= cbc[i]; -- crypto_cipher_encrypt_one(tfm, pad, pad); --- memcpy(mac, pad, mac_len); --+ memcpy(mac, pad, CMAC_TLEN); -- } -- -- --@@ -107,35 +107,17 @@ void ieee80211_aes_cmac(struct crypto_ci -- addr[2] = zero; -- len[2] = CMAC_TLEN; -- --- aes_cmac_vector(tfm, 3, addr, len, mic, CMAC_TLEN); --+ aes_128_cmac_vector(tfm, 3, addr, len, mic); -- } -- ---void ieee80211_aes_cmac_256(struct crypto_cipher *tfm, const u8 *aad, --- const u8 *data, size_t data_len, u8 *mic) ---{ --- const u8 *addr[3]; --- size_t len[3]; --- u8 zero[CMAC_TLEN_256]; --- --- memset(zero, 0, CMAC_TLEN_256); --- addr[0] = aad; --- len[0] = AAD_LEN; --- addr[1] = data; --- len[1] = data_len - CMAC_TLEN_256; --- addr[2] = zero; --- len[2] = CMAC_TLEN_256; --- --- aes_cmac_vector(tfm, 3, addr, len, mic, CMAC_TLEN_256); ---} -- ---struct crypto_cipher *ieee80211_aes_cmac_key_setup(const u8 key[], --- size_t key_len) --+struct crypto_cipher * ieee80211_aes_cmac_key_setup(const u8 key[]) -- { -- struct crypto_cipher *tfm; -- -- tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC); -- if (!IS_ERR(tfm)) --- crypto_cipher_setkey(tfm, key, key_len); --+ crypto_cipher_setkey(tfm, key, AES_CMAC_KEY_LEN); -- -- return tfm; -- } ----- a/net/mac80211/aes_cmac.h --+++ b/net/mac80211/aes_cmac.h --@@ -11,12 +11,9 @@ -- -- #include -- ---struct crypto_cipher *ieee80211_aes_cmac_key_setup(const u8 key[], --- size_t key_len); --+struct crypto_cipher * ieee80211_aes_cmac_key_setup(const u8 key[]); -- void ieee80211_aes_cmac(struct crypto_cipher *tfm, const u8 *aad, -- const u8 *data, size_t data_len, u8 *mic); ---void ieee80211_aes_cmac_256(struct crypto_cipher *tfm, const u8 *aad, --- const u8 *data, size_t data_len, u8 *mic); -- void ieee80211_aes_cmac_key_free(struct crypto_cipher *tfm); -- -- #endif /* AES_CMAC_H */ ----- a/net/mac80211/aes_gcm.c --+++ /dev/null --@@ -1,95 +0,0 @@ ---/* --- * Copyright 2014-2015, Qualcomm Atheros, Inc. --- * --- * 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 ---#include ---#include ---#include --- ---#include ---#include "key.h" ---#include "aes_gcm.h" --- ---void ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, --- u8 *data, size_t data_len, u8 *mic) ---{ --- struct scatterlist assoc, pt, ct[2]; --- --- char aead_req_data[sizeof(struct aead_request) + --- crypto_aead_reqsize(tfm)] --- __aligned(__alignof__(struct aead_request)); --- struct aead_request *aead_req = (void *)aead_req_data; --- --- memset(aead_req, 0, sizeof(aead_req_data)); --- --- sg_init_one(&pt, data, data_len); --- sg_init_one(&assoc, &aad[2], be16_to_cpup((__be16 *)aad)); --- sg_init_table(ct, 2); --- sg_set_buf(&ct[0], data, data_len); --- sg_set_buf(&ct[1], mic, IEEE80211_GCMP_MIC_LEN); --- --- aead_request_set_tfm(aead_req, tfm); --- aead_request_set_assoc(aead_req, &assoc, assoc.length); --- aead_request_set_crypt(aead_req, &pt, ct, data_len, j_0); --- --- crypto_aead_encrypt(aead_req); ---} --- ---int ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, --- u8 *data, size_t data_len, u8 *mic) ---{ --- struct scatterlist assoc, pt, ct[2]; --- char aead_req_data[sizeof(struct aead_request) + --- crypto_aead_reqsize(tfm)] --- __aligned(__alignof__(struct aead_request)); --- struct aead_request *aead_req = (void *)aead_req_data; --- --- if (data_len == 0) --- return -EINVAL; --- --- memset(aead_req, 0, sizeof(aead_req_data)); --- --- sg_init_one(&pt, data, data_len); --- sg_init_one(&assoc, &aad[2], be16_to_cpup((__be16 *)aad)); --- sg_init_table(ct, 2); --- sg_set_buf(&ct[0], data, data_len); --- sg_set_buf(&ct[1], mic, IEEE80211_GCMP_MIC_LEN); --- --- aead_request_set_tfm(aead_req, tfm); --- aead_request_set_assoc(aead_req, &assoc, assoc.length); --- aead_request_set_crypt(aead_req, ct, &pt, --- data_len + IEEE80211_GCMP_MIC_LEN, j_0); --- --- return crypto_aead_decrypt(aead_req); ---} --- ---struct crypto_aead *ieee80211_aes_gcm_key_setup_encrypt(const u8 key[], --- size_t key_len) ---{ --- struct crypto_aead *tfm; --- int err; --- --- tfm = crypto_alloc_aead("gcm(aes)", 0, CRYPTO_ALG_ASYNC); --- if (IS_ERR(tfm)) --- return tfm; --- --- err = crypto_aead_setkey(tfm, key, key_len); --- if (!err) --- err = crypto_aead_setauthsize(tfm, IEEE80211_GCMP_MIC_LEN); --- if (!err) --- return tfm; --- --- crypto_free_aead(tfm); --- return ERR_PTR(err); ---} --- ---void ieee80211_aes_gcm_key_free(struct crypto_aead *tfm) ---{ --- crypto_free_aead(tfm); ---} ----- a/net/mac80211/aes_gcm.h --+++ /dev/null --@@ -1,22 +0,0 @@ ---/* --- * Copyright 2014-2015, Qualcomm Atheros, Inc. --- * --- * 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. --- */ --- ---#ifndef AES_GCM_H ---#define AES_GCM_H --- ---#include --- ---void ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, --- u8 *data, size_t data_len, u8 *mic); ---int ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, --- u8 *data, size_t data_len, u8 *mic); ---struct crypto_aead *ieee80211_aes_gcm_key_setup_encrypt(const u8 key[], --- size_t key_len); ---void ieee80211_aes_gcm_key_free(struct crypto_aead *tfm); --- ---#endif /* AES_GCM_H */ ----- a/net/mac80211/aes_gmac.c --+++ /dev/null --@@ -1,84 +0,0 @@ ---/* --- * AES-GMAC for IEEE 802.11 BIP-GMAC-128 and BIP-GMAC-256 --- * Copyright 2015, Qualcomm Atheros, Inc. --- * --- * 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 ---#include ---#include ---#include --- ---#include ---#include "key.h" ---#include "aes_gmac.h" --- ---#define GMAC_MIC_LEN 16 ---#define GMAC_NONCE_LEN 12 ---#define AAD_LEN 20 --- ---int ieee80211_aes_gmac(struct crypto_aead *tfm, const u8 *aad, u8 *nonce, --- const u8 *data, size_t data_len, u8 *mic) ---{ --- struct scatterlist sg[3], ct[1]; --- char aead_req_data[sizeof(struct aead_request) + --- crypto_aead_reqsize(tfm)] --- __aligned(__alignof__(struct aead_request)); --- struct aead_request *aead_req = (void *)aead_req_data; --- u8 zero[GMAC_MIC_LEN], iv[AES_BLOCK_SIZE]; --- --- if (data_len < GMAC_MIC_LEN) --- return -EINVAL; --- --- memset(aead_req, 0, sizeof(aead_req_data)); --- --- memset(zero, 0, GMAC_MIC_LEN); --- sg_init_table(sg, 3); --- sg_set_buf(&sg[0], aad, AAD_LEN); --- sg_set_buf(&sg[1], data, data_len - GMAC_MIC_LEN); --- sg_set_buf(&sg[2], zero, GMAC_MIC_LEN); --- --- memcpy(iv, nonce, GMAC_NONCE_LEN); --- memset(iv + GMAC_NONCE_LEN, 0, sizeof(iv) - GMAC_NONCE_LEN); --- iv[AES_BLOCK_SIZE - 1] = 0x01; --- --- sg_init_table(ct, 1); --- sg_set_buf(&ct[0], mic, GMAC_MIC_LEN); --- --- aead_request_set_tfm(aead_req, tfm); --- aead_request_set_assoc(aead_req, sg, AAD_LEN + data_len); --- aead_request_set_crypt(aead_req, NULL, ct, 0, iv); --- --- crypto_aead_encrypt(aead_req); --- --- return 0; ---} --- ---struct crypto_aead *ieee80211_aes_gmac_key_setup(const u8 key[], --- size_t key_len) ---{ --- struct crypto_aead *tfm; --- int err; --- --- tfm = crypto_alloc_aead("gcm(aes)", 0, CRYPTO_ALG_ASYNC); --- if (IS_ERR(tfm)) --- return tfm; --- --- err = crypto_aead_setkey(tfm, key, key_len); --- if (!err) --- return tfm; --- if (!err) --- err = crypto_aead_setauthsize(tfm, GMAC_MIC_LEN); --- --- crypto_free_aead(tfm); --- return ERR_PTR(err); ---} --- ---void ieee80211_aes_gmac_key_free(struct crypto_aead *tfm) ---{ --- crypto_free_aead(tfm); ---} ----- a/net/mac80211/aes_gmac.h --+++ /dev/null --@@ -1,20 +0,0 @@ ---/* --- * Copyright 2015, Qualcomm Atheros, Inc. --- * --- * 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. --- */ --- ---#ifndef AES_GMAC_H ---#define AES_GMAC_H --- ---#include --- ---struct crypto_aead *ieee80211_aes_gmac_key_setup(const u8 key[], --- size_t key_len); ---int ieee80211_aes_gmac(struct crypto_aead *tfm, const u8 *aad, u8 *nonce, --- const u8 *data, size_t data_len, u8 *mic); ---void ieee80211_aes_gmac_key_free(struct crypto_aead *tfm); --- ---#endif /* AES_GMAC_H */ ----- a/net/mac80211/cfg.c --+++ b/net/mac80211/cfg.c --@@ -162,13 +162,8 @@ static int ieee80211_add_key(struct wiph -- return -EINVAL; -- break; -- case WLAN_CIPHER_SUITE_CCMP: --- case WLAN_CIPHER_SUITE_CCMP_256: -- case WLAN_CIPHER_SUITE_AES_CMAC: --- case WLAN_CIPHER_SUITE_BIP_CMAC_256: --- case WLAN_CIPHER_SUITE_BIP_GMAC_128: --- case WLAN_CIPHER_SUITE_BIP_GMAC_256: -- case WLAN_CIPHER_SUITE_GCMP: --- case WLAN_CIPHER_SUITE_GCMP_256: -- break; -- default: -- cs = ieee80211_cs_get(local, params->cipher, sdata->vif.type); --@@ -353,7 +348,6 @@ static int ieee80211_get_key(struct wiph -- params.seq_len = 6; -- break; -- case WLAN_CIPHER_SUITE_CCMP: --- case WLAN_CIPHER_SUITE_CCMP_256: -- pn64 = atomic64_read(&key->u.ccmp.tx_pn); -- seq[0] = pn64; -- seq[1] = pn64 >> 8; --@@ -365,35 +359,10 @@ static int ieee80211_get_key(struct wiph -- params.seq_len = 6; -- break; -- case WLAN_CIPHER_SUITE_AES_CMAC: --- case WLAN_CIPHER_SUITE_BIP_CMAC_256: -- pn64 = atomic64_read(&key->u.aes_cmac.tx_pn); -- seq[0] = pn64; -- seq[1] = pn64 >> 8; -- seq[2] = pn64 >> 16; --- seq[3] = pn64 >> 24; --- seq[4] = pn64 >> 32; --- seq[5] = pn64 >> 40; --- params.seq = seq; --- params.seq_len = 6; --- break; --- case WLAN_CIPHER_SUITE_BIP_GMAC_128: --- case WLAN_CIPHER_SUITE_BIP_GMAC_256: --- pn64 = atomic64_read(&key->u.aes_gmac.tx_pn); --- seq[0] = pn64; --- seq[1] = pn64 >> 8; --- seq[2] = pn64 >> 16; --- seq[3] = pn64 >> 24; --- seq[4] = pn64 >> 32; --- seq[5] = pn64 >> 40; --- params.seq = seq; --- params.seq_len = 6; --- break; --- case WLAN_CIPHER_SUITE_GCMP: --- case WLAN_CIPHER_SUITE_GCMP_256: --- pn64 = atomic64_read(&key->u.gcmp.tx_pn); --- seq[0] = pn64; --- seq[1] = pn64 >> 8; --- seq[2] = pn64 >> 16; -- seq[3] = pn64 >> 24; -- seq[4] = pn64 >> 32; -- seq[5] = pn64 >> 40; ----- a/net/mac80211/debugfs_key.c --+++ b/net/mac80211/debugfs_key.c --@@ -94,33 +94,17 @@ static ssize_t key_tx_spec_read(struct f -- key->u.tkip.tx.iv16); -- break; -- case WLAN_CIPHER_SUITE_CCMP: --- case WLAN_CIPHER_SUITE_CCMP_256: -- pn = atomic64_read(&key->u.ccmp.tx_pn); -- len = scnprintf(buf, sizeof(buf), "%02x%02x%02x%02x%02x%02x\n", -- (u8)(pn >> 40), (u8)(pn >> 32), (u8)(pn >> 24), -- (u8)(pn >> 16), (u8)(pn >> 8), (u8)pn); -- break; -- case WLAN_CIPHER_SUITE_AES_CMAC: --- case WLAN_CIPHER_SUITE_BIP_CMAC_256: -- pn = atomic64_read(&key->u.aes_cmac.tx_pn); -- len = scnprintf(buf, sizeof(buf), "%02x%02x%02x%02x%02x%02x\n", -- (u8)(pn >> 40), (u8)(pn >> 32), (u8)(pn >> 24), -- (u8)(pn >> 16), (u8)(pn >> 8), (u8)pn); -- break; --- case WLAN_CIPHER_SUITE_BIP_GMAC_128: --- case WLAN_CIPHER_SUITE_BIP_GMAC_256: --- pn = atomic64_read(&key->u.aes_gmac.tx_pn); --- len = scnprintf(buf, sizeof(buf), "%02x%02x%02x%02x%02x%02x\n", --- (u8)(pn >> 40), (u8)(pn >> 32), (u8)(pn >> 24), --- (u8)(pn >> 16), (u8)(pn >> 8), (u8)pn); --- break; --- case WLAN_CIPHER_SUITE_GCMP: --- case WLAN_CIPHER_SUITE_GCMP_256: --- pn = atomic64_read(&key->u.gcmp.tx_pn); --- len = scnprintf(buf, sizeof(buf), "%02x%02x%02x%02x%02x%02x\n", --- (u8)(pn >> 40), (u8)(pn >> 32), (u8)(pn >> 24), --- (u8)(pn >> 16), (u8)(pn >> 8), (u8)pn); --- break; -- default: -- return 0; -- } --@@ -150,7 +134,6 @@ static ssize_t key_rx_spec_read(struct f -- len = p - buf; -- break; -- case WLAN_CIPHER_SUITE_CCMP: --- case WLAN_CIPHER_SUITE_CCMP_256: -- for (i = 0; i < IEEE80211_NUM_TIDS + 1; i++) { -- rpn = key->u.ccmp.rx_pn[i]; -- p += scnprintf(p, sizeof(buf)+buf-p, --@@ -161,7 +144,6 @@ static ssize_t key_rx_spec_read(struct f -- len = p - buf; -- break; -- case WLAN_CIPHER_SUITE_AES_CMAC: --- case WLAN_CIPHER_SUITE_BIP_CMAC_256: -- rpn = key->u.aes_cmac.rx_pn; -- p += scnprintf(p, sizeof(buf)+buf-p, -- "%02x%02x%02x%02x%02x%02x\n", --@@ -169,26 +151,6 @@ static ssize_t key_rx_spec_read(struct f -- rpn[3], rpn[4], rpn[5]); -- len = p - buf; -- break; --- case WLAN_CIPHER_SUITE_BIP_GMAC_128: --- case WLAN_CIPHER_SUITE_BIP_GMAC_256: --- rpn = key->u.aes_gmac.rx_pn; --- p += scnprintf(p, sizeof(buf)+buf-p, --- "%02x%02x%02x%02x%02x%02x\n", --- rpn[0], rpn[1], rpn[2], --- rpn[3], rpn[4], rpn[5]); --- len = p - buf; --- break; --- case WLAN_CIPHER_SUITE_GCMP: --- case WLAN_CIPHER_SUITE_GCMP_256: --- for (i = 0; i < IEEE80211_NUM_TIDS + 1; i++) { --- rpn = key->u.gcmp.rx_pn[i]; --- p += scnprintf(p, sizeof(buf)+buf-p, --- "%02x%02x%02x%02x%02x%02x\n", --- rpn[0], rpn[1], rpn[2], --- rpn[3], rpn[4], rpn[5]); --- } --- len = p - buf; --- break; -- default: -- return 0; -- } --@@ -205,23 +167,12 @@ static ssize_t key_replays_read(struct f -- -- switch (key->conf.cipher) { -- case WLAN_CIPHER_SUITE_CCMP: --- case WLAN_CIPHER_SUITE_CCMP_256: -- len = scnprintf(buf, sizeof(buf), "%u\n", key->u.ccmp.replays); -- break; -- case WLAN_CIPHER_SUITE_AES_CMAC: --- case WLAN_CIPHER_SUITE_BIP_CMAC_256: -- len = scnprintf(buf, sizeof(buf), "%u\n", -- key->u.aes_cmac.replays); -- break; --- case WLAN_CIPHER_SUITE_BIP_GMAC_128: --- case WLAN_CIPHER_SUITE_BIP_GMAC_256: --- len = scnprintf(buf, sizeof(buf), "%u\n", --- key->u.aes_gmac.replays); --- break; --- case WLAN_CIPHER_SUITE_GCMP: --- case WLAN_CIPHER_SUITE_GCMP_256: --- len = scnprintf(buf, sizeof(buf), "%u\n", key->u.gcmp.replays); --- break; -- default: -- return 0; -- } --@@ -238,15 +189,9 @@ static ssize_t key_icverrors_read(struct -- -- switch (key->conf.cipher) { -- case WLAN_CIPHER_SUITE_AES_CMAC: --- case WLAN_CIPHER_SUITE_BIP_CMAC_256: -- len = scnprintf(buf, sizeof(buf), "%u\n", -- key->u.aes_cmac.icverrors); -- break; --- case WLAN_CIPHER_SUITE_BIP_GMAC_128: --- case WLAN_CIPHER_SUITE_BIP_GMAC_256: --- len = scnprintf(buf, sizeof(buf), "%u\n", --- key->u.aes_gmac.icverrors); --- break; -- default: -- return 0; -- } ----- a/net/mac80211/key.c --+++ b/net/mac80211/key.c --@@ -24,8 +24,6 @@ -- #include "debugfs_key.h" -- #include "aes_ccm.h" -- #include "aes_cmac.h" ---#include "aes_gmac.h" ---#include "aes_gcm.h" -- -- -- /** --@@ -164,13 +162,7 @@ static int ieee80211_key_enable_hw_accel -- case WLAN_CIPHER_SUITE_WEP104: -- case WLAN_CIPHER_SUITE_TKIP: -- case WLAN_CIPHER_SUITE_CCMP: --- case WLAN_CIPHER_SUITE_CCMP_256: -- case WLAN_CIPHER_SUITE_AES_CMAC: --- case WLAN_CIPHER_SUITE_BIP_CMAC_256: --- case WLAN_CIPHER_SUITE_BIP_GMAC_128: --- case WLAN_CIPHER_SUITE_BIP_GMAC_256: --- case WLAN_CIPHER_SUITE_GCMP: --- case WLAN_CIPHER_SUITE_GCMP_256: -- /* all of these we can do in software - if driver can */ -- if (ret == 1) -- return 0; --@@ -394,26 +386,7 @@ ieee80211_key_alloc(u32 cipher, int idx, -- * Initialize AES key state here as an optimization so that -- * it does not need to be initialized for every packet. -- */ --- key->u.ccmp.tfm = ieee80211_aes_key_setup_encrypt( --- key_data, key_len, IEEE80211_CCMP_MIC_LEN); --- if (IS_ERR(key->u.ccmp.tfm)) { --- err = PTR_ERR(key->u.ccmp.tfm); --- kfree(key); --- return ERR_PTR(err); --- } --- break; --- case WLAN_CIPHER_SUITE_CCMP_256: --- key->conf.iv_len = IEEE80211_CCMP_256_HDR_LEN; --- key->conf.icv_len = IEEE80211_CCMP_256_MIC_LEN; --- for (i = 0; seq && i < IEEE80211_NUM_TIDS + 1; i++) --- for (j = 0; j < IEEE80211_CCMP_256_PN_LEN; j++) --- key->u.ccmp.rx_pn[i][j] = --- seq[IEEE80211_CCMP_256_PN_LEN - j - 1]; --- /* Initialize AES key state here as an optimization so that --- * it does not need to be initialized for every packet. --- */ --- key->u.ccmp.tfm = ieee80211_aes_key_setup_encrypt( --- key_data, key_len, IEEE80211_CCMP_256_MIC_LEN); --+ key->u.ccmp.tfm = ieee80211_aes_key_setup_encrypt(key_data); -- if (IS_ERR(key->u.ccmp.tfm)) { -- err = PTR_ERR(key->u.ccmp.tfm); -- kfree(key); --@@ -421,12 +394,8 @@ ieee80211_key_alloc(u32 cipher, int idx, -- } -- break; -- case WLAN_CIPHER_SUITE_AES_CMAC: --- case WLAN_CIPHER_SUITE_BIP_CMAC_256: -- key->conf.iv_len = 0; --- if (cipher == WLAN_CIPHER_SUITE_AES_CMAC) --- key->conf.icv_len = sizeof(struct ieee80211_mmie); --- else --- key->conf.icv_len = sizeof(struct ieee80211_mmie_16); --+ key->conf.icv_len = sizeof(struct ieee80211_mmie); -- if (seq) -- for (j = 0; j < IEEE80211_CMAC_PN_LEN; j++) -- key->u.aes_cmac.rx_pn[j] = --@@ -436,51 +405,13 @@ ieee80211_key_alloc(u32 cipher, int idx, -- * it does not need to be initialized for every packet. -- */ -- key->u.aes_cmac.tfm = --- ieee80211_aes_cmac_key_setup(key_data, key_len); --+ ieee80211_aes_cmac_key_setup(key_data); -- if (IS_ERR(key->u.aes_cmac.tfm)) { -- err = PTR_ERR(key->u.aes_cmac.tfm); -- kfree(key); -- return ERR_PTR(err); -- } -- break; --- case WLAN_CIPHER_SUITE_BIP_GMAC_128: --- case WLAN_CIPHER_SUITE_BIP_GMAC_256: --- key->conf.iv_len = 0; --- key->conf.icv_len = sizeof(struct ieee80211_mmie_16); --- if (seq) --- for (j = 0; j < IEEE80211_GMAC_PN_LEN; j++) --- key->u.aes_gmac.rx_pn[j] = --- seq[IEEE80211_GMAC_PN_LEN - j - 1]; --- /* Initialize AES key state here as an optimization so that --- * it does not need to be initialized for every packet. --- */ --- key->u.aes_gmac.tfm = --- ieee80211_aes_gmac_key_setup(key_data, key_len); --- if (IS_ERR(key->u.aes_gmac.tfm)) { --- err = PTR_ERR(key->u.aes_gmac.tfm); --- kfree(key); --- return ERR_PTR(err); --- } --- break; --- case WLAN_CIPHER_SUITE_GCMP: --- case WLAN_CIPHER_SUITE_GCMP_256: --- key->conf.iv_len = IEEE80211_GCMP_HDR_LEN; --- key->conf.icv_len = IEEE80211_GCMP_MIC_LEN; --- for (i = 0; seq && i < IEEE80211_NUM_TIDS + 1; i++) --- for (j = 0; j < IEEE80211_GCMP_PN_LEN; j++) --- key->u.gcmp.rx_pn[i][j] = --- seq[IEEE80211_GCMP_PN_LEN - j - 1]; --- /* Initialize AES key state here as an optimization so that --- * it does not need to be initialized for every packet. --- */ --- key->u.gcmp.tfm = ieee80211_aes_gcm_key_setup_encrypt(key_data, --- key_len); --- if (IS_ERR(key->u.gcmp.tfm)) { --- err = PTR_ERR(key->u.gcmp.tfm); --- kfree(key); --- return ERR_PTR(err); --- } --- break; -- default: -- if (cs) { -- size_t len = (seq_len > MAX_PN_LEN) ? --@@ -502,24 +433,10 @@ ieee80211_key_alloc(u32 cipher, int idx, -- -- static void ieee80211_key_free_common(struct ieee80211_key *key) -- { --- switch (key->conf.cipher) { --- case WLAN_CIPHER_SUITE_CCMP: --- case WLAN_CIPHER_SUITE_CCMP_256: --+ if (key->conf.cipher == WLAN_CIPHER_SUITE_CCMP) -- ieee80211_aes_key_free(key->u.ccmp.tfm); --- break; --- case WLAN_CIPHER_SUITE_AES_CMAC: --- case WLAN_CIPHER_SUITE_BIP_CMAC_256: --+ if (key->conf.cipher == WLAN_CIPHER_SUITE_AES_CMAC) -- ieee80211_aes_cmac_key_free(key->u.aes_cmac.tfm); --- break; --- case WLAN_CIPHER_SUITE_BIP_GMAC_128: --- case WLAN_CIPHER_SUITE_BIP_GMAC_256: --- ieee80211_aes_gmac_key_free(key->u.aes_gmac.tfm); --- break; --- case WLAN_CIPHER_SUITE_GCMP: --- case WLAN_CIPHER_SUITE_GCMP_256: --- ieee80211_aes_gcm_key_free(key->u.gcmp.tfm); --- break; --- } -- kzfree(key); -- } -- --@@ -826,7 +743,6 @@ void ieee80211_get_key_tx_seq(struct iee -- seq->tkip.iv16 = key->u.tkip.tx.iv16; -- break; -- case WLAN_CIPHER_SUITE_CCMP: --- case WLAN_CIPHER_SUITE_CCMP_256: -- pn64 = atomic64_read(&key->u.ccmp.tx_pn); -- seq->ccmp.pn[5] = pn64; -- seq->ccmp.pn[4] = pn64 >> 8; --@@ -836,7 +752,6 @@ void ieee80211_get_key_tx_seq(struct iee -- seq->ccmp.pn[0] = pn64 >> 40; -- break; -- case WLAN_CIPHER_SUITE_AES_CMAC: --- case WLAN_CIPHER_SUITE_BIP_CMAC_256: -- pn64 = atomic64_read(&key->u.aes_cmac.tx_pn); -- seq->ccmp.pn[5] = pn64; -- seq->ccmp.pn[4] = pn64 >> 8; --@@ -845,26 +760,6 @@ void ieee80211_get_key_tx_seq(struct iee -- seq->ccmp.pn[1] = pn64 >> 32; -- seq->ccmp.pn[0] = pn64 >> 40; -- break; --- case WLAN_CIPHER_SUITE_BIP_GMAC_128: --- case WLAN_CIPHER_SUITE_BIP_GMAC_256: --- pn64 = atomic64_read(&key->u.aes_gmac.tx_pn); --- seq->ccmp.pn[5] = pn64; --- seq->ccmp.pn[4] = pn64 >> 8; --- seq->ccmp.pn[3] = pn64 >> 16; --- seq->ccmp.pn[2] = pn64 >> 24; --- seq->ccmp.pn[1] = pn64 >> 32; --- seq->ccmp.pn[0] = pn64 >> 40; --- break; --- case WLAN_CIPHER_SUITE_GCMP: --- case WLAN_CIPHER_SUITE_GCMP_256: --- pn64 = atomic64_read(&key->u.gcmp.tx_pn); --- seq->gcmp.pn[5] = pn64; --- seq->gcmp.pn[4] = pn64 >> 8; --- seq->gcmp.pn[3] = pn64 >> 16; --- seq->gcmp.pn[2] = pn64 >> 24; --- seq->gcmp.pn[1] = pn64 >> 32; --- seq->gcmp.pn[0] = pn64 >> 40; --- break; -- default: -- WARN_ON(1); -- } --@@ -887,7 +782,6 @@ void ieee80211_get_key_rx_seq(struct iee -- seq->tkip.iv16 = key->u.tkip.rx[tid].iv16; -- break; -- case WLAN_CIPHER_SUITE_CCMP: --- case WLAN_CIPHER_SUITE_CCMP_256: -- if (WARN_ON(tid < -1 || tid >= IEEE80211_NUM_TIDS)) -- return; -- if (tid < 0) --@@ -897,29 +791,11 @@ void ieee80211_get_key_rx_seq(struct iee -- memcpy(seq->ccmp.pn, pn, IEEE80211_CCMP_PN_LEN); -- break; -- case WLAN_CIPHER_SUITE_AES_CMAC: --- case WLAN_CIPHER_SUITE_BIP_CMAC_256: -- if (WARN_ON(tid != 0)) -- return; -- pn = key->u.aes_cmac.rx_pn; -- memcpy(seq->aes_cmac.pn, pn, IEEE80211_CMAC_PN_LEN); -- break; --- case WLAN_CIPHER_SUITE_BIP_GMAC_128: --- case WLAN_CIPHER_SUITE_BIP_GMAC_256: --- if (WARN_ON(tid != 0)) --- return; --- pn = key->u.aes_gmac.rx_pn; --- memcpy(seq->aes_gmac.pn, pn, IEEE80211_GMAC_PN_LEN); --- break; --- case WLAN_CIPHER_SUITE_GCMP: --- case WLAN_CIPHER_SUITE_GCMP_256: --- if (WARN_ON(tid < -1 || tid >= IEEE80211_NUM_TIDS)) --- return; --- if (tid < 0) --- pn = key->u.gcmp.rx_pn[IEEE80211_NUM_TIDS]; --- else --- pn = key->u.gcmp.rx_pn[tid]; --- memcpy(seq->gcmp.pn, pn, IEEE80211_GCMP_PN_LEN); --- break; -- } -- } -- EXPORT_SYMBOL(ieee80211_get_key_rx_seq); --@@ -938,7 +814,6 @@ void ieee80211_set_key_tx_seq(struct iee -- key->u.tkip.tx.iv16 = seq->tkip.iv16; -- break; -- case WLAN_CIPHER_SUITE_CCMP: --- case WLAN_CIPHER_SUITE_CCMP_256: -- pn64 = (u64)seq->ccmp.pn[5] | -- ((u64)seq->ccmp.pn[4] << 8) | -- ((u64)seq->ccmp.pn[3] << 16) | --@@ -948,7 +823,6 @@ void ieee80211_set_key_tx_seq(struct iee -- atomic64_set(&key->u.ccmp.tx_pn, pn64); -- break; -- case WLAN_CIPHER_SUITE_AES_CMAC: --- case WLAN_CIPHER_SUITE_BIP_CMAC_256: -- pn64 = (u64)seq->aes_cmac.pn[5] | -- ((u64)seq->aes_cmac.pn[4] << 8) | -- ((u64)seq->aes_cmac.pn[3] << 16) | --@@ -957,26 +831,6 @@ void ieee80211_set_key_tx_seq(struct iee -- ((u64)seq->aes_cmac.pn[0] << 40); -- atomic64_set(&key->u.aes_cmac.tx_pn, pn64); -- break; --- case WLAN_CIPHER_SUITE_BIP_GMAC_128: --- case WLAN_CIPHER_SUITE_BIP_GMAC_256: --- pn64 = (u64)seq->aes_gmac.pn[5] | --- ((u64)seq->aes_gmac.pn[4] << 8) | --- ((u64)seq->aes_gmac.pn[3] << 16) | --- ((u64)seq->aes_gmac.pn[2] << 24) | --- ((u64)seq->aes_gmac.pn[1] << 32) | --- ((u64)seq->aes_gmac.pn[0] << 40); --- atomic64_set(&key->u.aes_gmac.tx_pn, pn64); --- break; --- case WLAN_CIPHER_SUITE_GCMP: --- case WLAN_CIPHER_SUITE_GCMP_256: --- pn64 = (u64)seq->gcmp.pn[5] | --- ((u64)seq->gcmp.pn[4] << 8) | --- ((u64)seq->gcmp.pn[3] << 16) | --- ((u64)seq->gcmp.pn[2] << 24) | --- ((u64)seq->gcmp.pn[1] << 32) | --- ((u64)seq->gcmp.pn[0] << 40); --- atomic64_set(&key->u.gcmp.tx_pn, pn64); --- break; -- default: -- WARN_ON(1); -- break; --@@ -1000,7 +854,6 @@ void ieee80211_set_key_rx_seq(struct iee -- key->u.tkip.rx[tid].iv16 = seq->tkip.iv16; -- break; -- case WLAN_CIPHER_SUITE_CCMP: --- case WLAN_CIPHER_SUITE_CCMP_256: -- if (WARN_ON(tid < -1 || tid >= IEEE80211_NUM_TIDS)) -- return; -- if (tid < 0) --@@ -1010,29 +863,11 @@ void ieee80211_set_key_rx_seq(struct iee -- memcpy(pn, seq->ccmp.pn, IEEE80211_CCMP_PN_LEN); -- break; -- case WLAN_CIPHER_SUITE_AES_CMAC: --- case WLAN_CIPHER_SUITE_BIP_CMAC_256: -- if (WARN_ON(tid != 0)) -- return; -- pn = key->u.aes_cmac.rx_pn; -- memcpy(pn, seq->aes_cmac.pn, IEEE80211_CMAC_PN_LEN); -- break; --- case WLAN_CIPHER_SUITE_BIP_GMAC_128: --- case WLAN_CIPHER_SUITE_BIP_GMAC_256: --- if (WARN_ON(tid != 0)) --- return; --- pn = key->u.aes_gmac.rx_pn; --- memcpy(pn, seq->aes_gmac.pn, IEEE80211_GMAC_PN_LEN); --- break; --- case WLAN_CIPHER_SUITE_GCMP: --- case WLAN_CIPHER_SUITE_GCMP_256: --- if (WARN_ON(tid < -1 || tid >= IEEE80211_NUM_TIDS)) --- return; --- if (tid < 0) --- pn = key->u.gcmp.rx_pn[IEEE80211_NUM_TIDS]; --- else --- pn = key->u.gcmp.rx_pn[tid]; --- memcpy(pn, seq->gcmp.pn, IEEE80211_GCMP_PN_LEN); --- break; -- default: -- WARN_ON(1); -- break; ----- a/net/mac80211/key.h --+++ b/net/mac80211/key.h --@@ -84,7 +84,7 @@ struct ieee80211_key { -- * Management frames. -- */ -- u8 rx_pn[IEEE80211_NUM_TIDS + 1][IEEE80211_CCMP_PN_LEN]; --- struct crypto_aead *tfm; --+ struct crypto_cipher *tfm; -- u32 replays; /* dot11RSNAStatsCCMPReplays */ -- } ccmp; -- struct { --@@ -95,24 +95,6 @@ struct ieee80211_key { -- u32 icverrors; /* dot11RSNAStatsCMACICVErrors */ -- } aes_cmac; -- struct { --- atomic64_t tx_pn; --- u8 rx_pn[IEEE80211_GMAC_PN_LEN]; --- struct crypto_aead *tfm; --- u32 replays; /* dot11RSNAStatsCMACReplays */ --- u32 icverrors; /* dot11RSNAStatsCMACICVErrors */ --- } aes_gmac; --- struct { --- atomic64_t tx_pn; --- /* Last received packet number. The first --- * IEEE80211_NUM_TIDS counters are used with Data --- * frames and the last counter is used with Robust --- * Management frames. --- */ --- u8 rx_pn[IEEE80211_NUM_TIDS + 1][IEEE80211_GCMP_PN_LEN]; --- struct crypto_aead *tfm; --- u32 replays; /* dot11RSNAStatsGCMPReplays */ --- } gcmp; --- struct { -- /* generic cipher scheme */ -- u8 rx_pn[IEEE80211_NUM_TIDS + 1][MAX_PN_LEN]; -- } gen; ----- a/net/mac80211/main.c --+++ b/net/mac80211/main.c --@@ -666,15 +666,9 @@ static int ieee80211_init_cipher_suites( -- WLAN_CIPHER_SUITE_WEP104, -- WLAN_CIPHER_SUITE_TKIP, -- WLAN_CIPHER_SUITE_CCMP, --- WLAN_CIPHER_SUITE_CCMP_256, --- WLAN_CIPHER_SUITE_GCMP, --- WLAN_CIPHER_SUITE_GCMP_256, -- -- /* keep last -- depends on hw flags! */ --- WLAN_CIPHER_SUITE_AES_CMAC, --- WLAN_CIPHER_SUITE_BIP_CMAC_256, --- WLAN_CIPHER_SUITE_BIP_GMAC_128, --- WLAN_CIPHER_SUITE_BIP_GMAC_256, --+ WLAN_CIPHER_SUITE_AES_CMAC -- }; -- -- if (local->hw.flags & IEEE80211_HW_SW_CRYPTO_CONTROL || --@@ -713,7 +707,7 @@ static int ieee80211_init_cipher_suites( -- local->hw.wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites); -- -- if (!have_mfp) --- local->hw.wiphy->n_cipher_suites -= 4; --+ local->hw.wiphy->n_cipher_suites--; -- -- if (!have_wep) { -- local->hw.wiphy->cipher_suites += 2; --@@ -730,42 +724,32 @@ static int ieee80211_init_cipher_suites( -- /* Driver specifies cipher schemes only (but not cipher suites -- * including the schemes) -- * --- * We start counting ciphers defined by schemes, TKIP, CCMP, --- * CCMP-256, GCMP, and GCMP-256 --+ * We start counting ciphers defined by schemes, TKIP and CCMP -- */ --- n_suites = local->hw.n_cipher_schemes + 5; --+ n_suites = local->hw.n_cipher_schemes + 2; -- -- /* check if we have WEP40 and WEP104 */ -- if (have_wep) -- n_suites += 2; -- --- /* check if we have AES_CMAC, BIP-CMAC-256, BIP-GMAC-128, --- * BIP-GMAC-256 --- */ --+ /* check if we have AES_CMAC */ -- if (have_mfp) --- n_suites += 4; --+ n_suites++; -- -- suites = kmalloc(sizeof(u32) * n_suites, GFP_KERNEL); -- if (!suites) -- return -ENOMEM; -- -- suites[w++] = WLAN_CIPHER_SUITE_CCMP; --- suites[w++] = WLAN_CIPHER_SUITE_CCMP_256; -- suites[w++] = WLAN_CIPHER_SUITE_TKIP; --- suites[w++] = WLAN_CIPHER_SUITE_GCMP; --- suites[w++] = WLAN_CIPHER_SUITE_GCMP_256; -- -- if (have_wep) { -- suites[w++] = WLAN_CIPHER_SUITE_WEP40; -- suites[w++] = WLAN_CIPHER_SUITE_WEP104; -- } -- --- if (have_mfp) { --+ if (have_mfp) -- suites[w++] = WLAN_CIPHER_SUITE_AES_CMAC; --- suites[w++] = WLAN_CIPHER_SUITE_BIP_CMAC_256; --- suites[w++] = WLAN_CIPHER_SUITE_BIP_GMAC_128; --- suites[w++] = WLAN_CIPHER_SUITE_BIP_GMAC_256; --- } -- -- for (r = 0; r < local->hw.n_cipher_schemes; r++) -- suites[w++] = cs[r].cipher; ----- a/net/mac80211/rx.c --+++ b/net/mac80211/rx.c --@@ -647,7 +647,6 @@ static int ieee80211_get_mmie_keyidx(str -- { -- struct ieee80211_mgmt *hdr = (struct ieee80211_mgmt *) skb->data; -- struct ieee80211_mmie *mmie; --- struct ieee80211_mmie_16 *mmie16; -- -- if (skb->len < 24 + sizeof(*mmie) || !is_multicast_ether_addr(hdr->da)) -- return -1; --@@ -657,18 +656,11 @@ static int ieee80211_get_mmie_keyidx(str -- -- mmie = (struct ieee80211_mmie *) -- (skb->data + skb->len - sizeof(*mmie)); --- if (mmie->element_id == WLAN_EID_MMIE && --- mmie->length == sizeof(*mmie) - 2) --- return le16_to_cpu(mmie->key_id); --- --- mmie16 = (struct ieee80211_mmie_16 *) --- (skb->data + skb->len - sizeof(*mmie16)); --- if (skb->len >= 24 + sizeof(*mmie16) && --- mmie16->element_id == WLAN_EID_MMIE && --- mmie16->length == sizeof(*mmie16) - 2) --- return le16_to_cpu(mmie16->key_id); --+ if (mmie->element_id != WLAN_EID_MMIE || --+ mmie->length != sizeof(*mmie) - 2) --+ return -1; -- --- return -1; --+ return le16_to_cpu(mmie->key_id); -- } -- -- static int iwl80211_get_cs_keyid(const struct ieee80211_cipher_scheme *cs, --@@ -1658,27 +1650,11 @@ ieee80211_rx_h_decrypt(struct ieee80211_ -- result = ieee80211_crypto_tkip_decrypt(rx); -- break; -- case WLAN_CIPHER_SUITE_CCMP: --- result = ieee80211_crypto_ccmp_decrypt( --- rx, IEEE80211_CCMP_MIC_LEN); --- break; --- case WLAN_CIPHER_SUITE_CCMP_256: --- result = ieee80211_crypto_ccmp_decrypt( --- rx, IEEE80211_CCMP_256_MIC_LEN); --+ result = ieee80211_crypto_ccmp_decrypt(rx); -- break; -- case WLAN_CIPHER_SUITE_AES_CMAC: -- result = ieee80211_crypto_aes_cmac_decrypt(rx); -- break; --- case WLAN_CIPHER_SUITE_BIP_CMAC_256: --- result = ieee80211_crypto_aes_cmac_256_decrypt(rx); --- break; --- case WLAN_CIPHER_SUITE_BIP_GMAC_128: --- case WLAN_CIPHER_SUITE_BIP_GMAC_256: --- result = ieee80211_crypto_aes_gmac_decrypt(rx); --- break; --- case WLAN_CIPHER_SUITE_GCMP: --- case WLAN_CIPHER_SUITE_GCMP_256: --- result = ieee80211_crypto_gcmp_decrypt(rx); --- break; -- default: -- result = ieee80211_crypto_hw_decrypt(rx); -- } --@@ -1805,9 +1781,7 @@ ieee80211_rx_h_defragment(struct ieee802 -- /* This is the first fragment of a new frame. */ -- entry = ieee80211_reassemble_add(rx->sdata, frag, seq, -- rx->seqno_idx, &(rx->skb)); --- if (rx->key && --- (rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP || --- rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP_256) && --+ if (rx->key && rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP && -- ieee80211_has_protected(fc)) { -- int queue = rx->security_idx; -- /* Store CCMP PN so that we can verify that the next --@@ -1836,9 +1810,7 @@ ieee80211_rx_h_defragment(struct ieee802 -- int i; -- u8 pn[IEEE80211_CCMP_PN_LEN], *rpn; -- int queue; --- if (!rx->key || --- (rx->key->conf.cipher != WLAN_CIPHER_SUITE_CCMP && --- rx->key->conf.cipher != WLAN_CIPHER_SUITE_CCMP_256)) --+ if (!rx->key || rx->key->conf.cipher != WLAN_CIPHER_SUITE_CCMP) -- return RX_DROP_UNUSABLE; -- memcpy(pn, entry->last_pn, IEEE80211_CCMP_PN_LEN); -- for (i = IEEE80211_CCMP_PN_LEN - 1; i >= 0; i--) { ----- a/net/mac80211/tx.c --+++ b/net/mac80211/tx.c --@@ -626,9 +626,6 @@ ieee80211_tx_h_select_key(struct ieee802 -- tx->key = NULL; -- break; -- case WLAN_CIPHER_SUITE_CCMP: --- case WLAN_CIPHER_SUITE_CCMP_256: --- case WLAN_CIPHER_SUITE_GCMP: --- case WLAN_CIPHER_SUITE_GCMP_256: -- if (!ieee80211_is_data_present(hdr->frame_control) && -- !ieee80211_use_mfp(hdr->frame_control, tx->sta, -- tx->skb)) --@@ -639,9 +636,6 @@ ieee80211_tx_h_select_key(struct ieee802 -- ieee80211_is_mgmt(hdr->frame_control); -- break; -- case WLAN_CIPHER_SUITE_AES_CMAC: --- case WLAN_CIPHER_SUITE_BIP_CMAC_256: --- case WLAN_CIPHER_SUITE_BIP_GMAC_128: --- case WLAN_CIPHER_SUITE_BIP_GMAC_256: -- if (!ieee80211_is_mgmt(hdr->frame_control)) -- tx->key = NULL; -- break; --@@ -1017,21 +1011,9 @@ ieee80211_tx_h_encrypt(struct ieee80211_ -- case WLAN_CIPHER_SUITE_TKIP: -- return ieee80211_crypto_tkip_encrypt(tx); -- case WLAN_CIPHER_SUITE_CCMP: --- return ieee80211_crypto_ccmp_encrypt( --- tx, IEEE80211_CCMP_MIC_LEN); --- case WLAN_CIPHER_SUITE_CCMP_256: --- return ieee80211_crypto_ccmp_encrypt( --- tx, IEEE80211_CCMP_256_MIC_LEN); --+ return ieee80211_crypto_ccmp_encrypt(tx); -- case WLAN_CIPHER_SUITE_AES_CMAC: -- return ieee80211_crypto_aes_cmac_encrypt(tx); --- case WLAN_CIPHER_SUITE_BIP_CMAC_256: --- return ieee80211_crypto_aes_cmac_256_encrypt(tx); --- case WLAN_CIPHER_SUITE_BIP_GMAC_128: --- case WLAN_CIPHER_SUITE_BIP_GMAC_256: --- return ieee80211_crypto_aes_gmac_encrypt(tx); --- case WLAN_CIPHER_SUITE_GCMP: --- case WLAN_CIPHER_SUITE_GCMP_256: --- return ieee80211_crypto_gcmp_encrypt(tx); -- default: -- return ieee80211_crypto_hw_encrypt(tx); -- } ----- a/net/mac80211/wpa.c --+++ b/net/mac80211/wpa.c --@@ -22,8 +22,6 @@ -- #include "tkip.h" -- #include "aes_ccm.h" -- #include "aes_cmac.h" ---#include "aes_gmac.h" ---#include "aes_gcm.h" -- #include "wpa.h" -- -- ieee80211_tx_result --@@ -304,15 +302,22 @@ ieee80211_crypto_tkip_decrypt(struct iee -- } -- -- ---static void ccmp_special_blocks(struct sk_buff *skb, u8 *pn, u8 *b_0, u8 *aad) --+static void ccmp_special_blocks(struct sk_buff *skb, u8 *pn, u8 *scratch, --+ int encrypted) -- { -- __le16 mask_fc; -- int a4_included, mgmt; -- u8 qos_tid; --- u16 len_a; --+ u8 *b_0, *aad; --+ u16 data_len, len_a; -- unsigned int hdrlen; -- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; -- --+ memset(scratch, 0, 6 * AES_BLOCK_SIZE); --+ --+ b_0 = scratch + 3 * AES_BLOCK_SIZE; --+ aad = scratch + 4 * AES_BLOCK_SIZE; --+ -- /* -- * Mask FC: zero subtype b4 b5 b6 (if not mgmt) -- * Retry, PwrMgt, MoreData; set Protected --@@ -334,21 +339,20 @@ static void ccmp_special_blocks(struct s -- else -- qos_tid = 0; -- --- /* In CCM, the initial vectors (IV) used for CTR mode encryption and CBC --- * mode authentication are not allowed to collide, yet both are derived --- * from this vector b_0. We only set L := 1 here to indicate that the --- * data size can be represented in (L+1) bytes. The CCM layer will take --- * care of storing the data length in the top (L+1) bytes and setting --- * and clearing the other bits as is required to derive the two IVs. --- */ --- b_0[0] = 0x1; --+ data_len = skb->len - hdrlen - IEEE80211_CCMP_HDR_LEN; --+ if (encrypted) --+ data_len -= IEEE80211_CCMP_MIC_LEN; -- --+ /* First block, b_0 */ --+ b_0[0] = 0x59; /* flags: Adata: 1, M: 011, L: 001 */ -- /* Nonce: Nonce Flags | A2 | PN -- * Nonce Flags: Priority (b0..b3) | Management (b4) | Reserved (b5..b7) -- */ -- b_0[1] = qos_tid | (mgmt << 4); -- memcpy(&b_0[2], hdr->addr2, ETH_ALEN); -- memcpy(&b_0[8], pn, IEEE80211_CCMP_PN_LEN); --+ /* l(m) */ --+ put_unaligned_be16(data_len, &b_0[14]); -- -- /* AAD (extra authenticate-only data) / masked 802.11 header -- * FC | A1 | A2 | A3 | SC | [A4] | [QC] */ --@@ -395,8 +399,7 @@ static inline void ccmp_hdr2pn(u8 *pn, u -- } -- -- ---static int ccmp_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb, --- unsigned int mic_len) --+static int ccmp_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb) -- { -- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; -- struct ieee80211_key *key = tx->key; --@@ -405,8 +408,7 @@ static int ccmp_encrypt_skb(struct ieee8 -- u8 *pos; -- u8 pn[6]; -- u64 pn64; --- u8 aad[2 * AES_BLOCK_SIZE]; --- u8 b_0[AES_BLOCK_SIZE]; --+ u8 scratch[6 * AES_BLOCK_SIZE]; -- -- if (info->control.hw_key && -- !(info->control.hw_key->flags & IEEE80211_KEY_FLAG_GENERATE_IV) && --@@ -427,7 +429,7 @@ static int ccmp_encrypt_skb(struct ieee8 -- if (info->control.hw_key) -- tail = 0; -- else --- tail = mic_len; --+ tail = IEEE80211_CCMP_MIC_LEN; -- -- if (WARN_ON(skb_tailroom(skb) < tail || -- skb_headroom(skb) < IEEE80211_CCMP_HDR_LEN)) --@@ -460,24 +462,23 @@ static int ccmp_encrypt_skb(struct ieee8 -- return 0; -- -- pos += IEEE80211_CCMP_HDR_LEN; --- ccmp_special_blocks(skb, pn, b_0, aad); --- ieee80211_aes_ccm_encrypt(key->u.ccmp.tfm, b_0, aad, pos, len, --- skb_put(skb, mic_len), mic_len); --+ ccmp_special_blocks(skb, pn, scratch, 0); --+ ieee80211_aes_ccm_encrypt(key->u.ccmp.tfm, scratch, pos, len, --+ pos, skb_put(skb, IEEE80211_CCMP_MIC_LEN)); -- -- return 0; -- } -- -- -- ieee80211_tx_result ---ieee80211_crypto_ccmp_encrypt(struct ieee80211_tx_data *tx, --- unsigned int mic_len) --+ieee80211_crypto_ccmp_encrypt(struct ieee80211_tx_data *tx) -- { -- struct sk_buff *skb; -- -- ieee80211_tx_set_protected(tx); -- -- skb_queue_walk(&tx->skbs, skb) { --- if (ccmp_encrypt_skb(tx, skb, mic_len) < 0) --+ if (ccmp_encrypt_skb(tx, skb) < 0) -- return TX_DROP; -- } -- --@@ -486,8 +487,7 @@ ieee80211_crypto_ccmp_encrypt(struct iee -- -- -- ieee80211_rx_result ---ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx, --- unsigned int mic_len) --+ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx) -- { -- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; -- int hdrlen; --@@ -504,7 +504,8 @@ ieee80211_crypto_ccmp_decrypt(struct iee -- !ieee80211_is_robust_mgmt_frame(skb)) -- return RX_CONTINUE; -- --- data_len = skb->len - hdrlen - IEEE80211_CCMP_HDR_LEN - mic_len; --+ data_len = skb->len - hdrlen - IEEE80211_CCMP_HDR_LEN - --+ IEEE80211_CCMP_MIC_LEN; -- if (!rx->sta || data_len < 0) -- return RX_DROP_UNUSABLE; -- --@@ -526,23 +527,23 @@ ieee80211_crypto_ccmp_decrypt(struct iee -- } -- -- if (!(status->flag & RX_FLAG_DECRYPTED)) { --- u8 aad[2 * AES_BLOCK_SIZE]; --- u8 b_0[AES_BLOCK_SIZE]; --+ u8 scratch[6 * AES_BLOCK_SIZE]; -- /* hardware didn't decrypt/verify MIC */ --- ccmp_special_blocks(skb, pn, b_0, aad); --+ ccmp_special_blocks(skb, pn, scratch, 1); -- -- if (ieee80211_aes_ccm_decrypt( --- key->u.ccmp.tfm, b_0, aad, --+ key->u.ccmp.tfm, scratch, -- skb->data + hdrlen + IEEE80211_CCMP_HDR_LEN, -- data_len, --- skb->data + skb->len - mic_len, mic_len)) --+ skb->data + skb->len - IEEE80211_CCMP_MIC_LEN, --+ skb->data + hdrlen + IEEE80211_CCMP_HDR_LEN)) -- return RX_DROP_UNUSABLE; -- } -- -- memcpy(key->u.ccmp.rx_pn[queue], pn, IEEE80211_CCMP_PN_LEN); -- -- /* Remove CCMP header and MIC */ --- if (pskb_trim(skb, skb->len - mic_len)) --+ if (pskb_trim(skb, skb->len - IEEE80211_CCMP_MIC_LEN)) -- return RX_DROP_UNUSABLE; -- memmove(skb->data + IEEE80211_CCMP_HDR_LEN, skb->data, hdrlen); -- skb_pull(skb, IEEE80211_CCMP_HDR_LEN); --@@ -550,229 +551,6 @@ ieee80211_crypto_ccmp_decrypt(struct iee -- return RX_CONTINUE; -- } -- ---static void gcmp_special_blocks(struct sk_buff *skb, u8 *pn, u8 *j_0, u8 *aad) ---{ --- __le16 mask_fc; --- u8 qos_tid; --- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; --- --- memcpy(j_0, hdr->addr2, ETH_ALEN); --- memcpy(&j_0[ETH_ALEN], pn, IEEE80211_GCMP_PN_LEN); --- j_0[13] = 0; --- j_0[14] = 0; --- j_0[AES_BLOCK_SIZE - 1] = 0x01; --- --- /* AAD (extra authenticate-only data) / masked 802.11 header --- * FC | A1 | A2 | A3 | SC | [A4] | [QC] --- */ --- put_unaligned_be16(ieee80211_hdrlen(hdr->frame_control) - 2, &aad[0]); --- /* Mask FC: zero subtype b4 b5 b6 (if not mgmt) --- * Retry, PwrMgt, MoreData; set Protected --- */ --- mask_fc = hdr->frame_control; --- mask_fc &= ~cpu_to_le16(IEEE80211_FCTL_RETRY | --- IEEE80211_FCTL_PM | IEEE80211_FCTL_MOREDATA); --- if (!ieee80211_is_mgmt(hdr->frame_control)) --- mask_fc &= ~cpu_to_le16(0x0070); --- mask_fc |= cpu_to_le16(IEEE80211_FCTL_PROTECTED); --- --- put_unaligned(mask_fc, (__le16 *)&aad[2]); --- memcpy(&aad[4], &hdr->addr1, 3 * ETH_ALEN); --- --- /* Mask Seq#, leave Frag# */ --- aad[22] = *((u8 *)&hdr->seq_ctrl) & 0x0f; --- aad[23] = 0; --- --- if (ieee80211_is_data_qos(hdr->frame_control)) --- qos_tid = *ieee80211_get_qos_ctl(hdr) & --- IEEE80211_QOS_CTL_TID_MASK; --- else --- qos_tid = 0; --- --- if (ieee80211_has_a4(hdr->frame_control)) { --- memcpy(&aad[24], hdr->addr4, ETH_ALEN); --- aad[30] = qos_tid; --- aad[31] = 0; --- } else { --- memset(&aad[24], 0, ETH_ALEN + IEEE80211_QOS_CTL_LEN); --- aad[24] = qos_tid; --- } ---} --- ---static inline void gcmp_pn2hdr(u8 *hdr, const u8 *pn, int key_id) ---{ --- hdr[0] = pn[5]; --- hdr[1] = pn[4]; --- hdr[2] = 0; --- hdr[3] = 0x20 | (key_id << 6); --- hdr[4] = pn[3]; --- hdr[5] = pn[2]; --- hdr[6] = pn[1]; --- hdr[7] = pn[0]; ---} --- ---static inline void gcmp_hdr2pn(u8 *pn, const u8 *hdr) ---{ --- pn[0] = hdr[7]; --- pn[1] = hdr[6]; --- pn[2] = hdr[5]; --- pn[3] = hdr[4]; --- pn[4] = hdr[1]; --- pn[5] = hdr[0]; ---} --- ---static int gcmp_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb) ---{ --- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; --- struct ieee80211_key *key = tx->key; --- struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); --- int hdrlen, len, tail; --- u8 *pos; --- u8 pn[6]; --- u64 pn64; --- u8 aad[2 * AES_BLOCK_SIZE]; --- u8 j_0[AES_BLOCK_SIZE]; --- --- if (info->control.hw_key && --- !(info->control.hw_key->flags & IEEE80211_KEY_FLAG_GENERATE_IV) && --- !(info->control.hw_key->flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE) && --- !((info->control.hw_key->flags & --- IEEE80211_KEY_FLAG_GENERATE_IV_MGMT) && --- ieee80211_is_mgmt(hdr->frame_control))) { --- /* hwaccel has no need for preallocated room for GCMP --- * header or MIC fields --- */ --- return 0; --- } --- --- hdrlen = ieee80211_hdrlen(hdr->frame_control); --- len = skb->len - hdrlen; --- --- if (info->control.hw_key) --- tail = 0; --- else --- tail = IEEE80211_GCMP_MIC_LEN; --- --- if (WARN_ON(skb_tailroom(skb) < tail || --- skb_headroom(skb) < IEEE80211_GCMP_HDR_LEN)) --- return -1; --- --- pos = skb_push(skb, IEEE80211_GCMP_HDR_LEN); --- memmove(pos, pos + IEEE80211_GCMP_HDR_LEN, hdrlen); --- skb_set_network_header(skb, skb_network_offset(skb) + --- IEEE80211_GCMP_HDR_LEN); --- --- /* the HW only needs room for the IV, but not the actual IV */ --- if (info->control.hw_key && --- (info->control.hw_key->flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE)) --- return 0; --- --- hdr = (struct ieee80211_hdr *)pos; --- pos += hdrlen; --- --- pn64 = atomic64_inc_return(&key->u.gcmp.tx_pn); --- --- pn[5] = pn64; --- pn[4] = pn64 >> 8; --- pn[3] = pn64 >> 16; --- pn[2] = pn64 >> 24; --- pn[1] = pn64 >> 32; --- pn[0] = pn64 >> 40; --- --- gcmp_pn2hdr(pos, pn, key->conf.keyidx); --- --- /* hwaccel - with software GCMP header */ --- if (info->control.hw_key) --- return 0; --- --- pos += IEEE80211_GCMP_HDR_LEN; --- gcmp_special_blocks(skb, pn, j_0, aad); --- ieee80211_aes_gcm_encrypt(key->u.gcmp.tfm, j_0, aad, pos, len, --- skb_put(skb, IEEE80211_GCMP_MIC_LEN)); --- --- return 0; ---} --- ---ieee80211_tx_result ---ieee80211_crypto_gcmp_encrypt(struct ieee80211_tx_data *tx) ---{ --- struct sk_buff *skb; --- --- ieee80211_tx_set_protected(tx); --- --- skb_queue_walk(&tx->skbs, skb) { --- if (gcmp_encrypt_skb(tx, skb) < 0) --- return TX_DROP; --- } --- --- return TX_CONTINUE; ---} --- ---ieee80211_rx_result ---ieee80211_crypto_gcmp_decrypt(struct ieee80211_rx_data *rx) ---{ --- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; --- int hdrlen; --- struct ieee80211_key *key = rx->key; --- struct sk_buff *skb = rx->skb; --- struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); --- u8 pn[IEEE80211_GCMP_PN_LEN]; --- int data_len; --- int queue; --- --- hdrlen = ieee80211_hdrlen(hdr->frame_control); --- --- if (!ieee80211_is_data(hdr->frame_control) && --- !ieee80211_is_robust_mgmt_frame(skb)) --- return RX_CONTINUE; --- --- data_len = skb->len - hdrlen - IEEE80211_GCMP_HDR_LEN - --- IEEE80211_GCMP_MIC_LEN; --- if (!rx->sta || data_len < 0) --- return RX_DROP_UNUSABLE; --- --- if (status->flag & RX_FLAG_DECRYPTED) { --- if (!pskb_may_pull(rx->skb, hdrlen + IEEE80211_GCMP_HDR_LEN)) --- return RX_DROP_UNUSABLE; --- } else { --- if (skb_linearize(rx->skb)) --- return RX_DROP_UNUSABLE; --- } --- --- gcmp_hdr2pn(pn, skb->data + hdrlen); --- --- queue = rx->security_idx; --- --- if (memcmp(pn, key->u.gcmp.rx_pn[queue], IEEE80211_GCMP_PN_LEN) <= 0) { --- key->u.gcmp.replays++; --- return RX_DROP_UNUSABLE; --- } --- --- if (!(status->flag & RX_FLAG_DECRYPTED)) { --- u8 aad[2 * AES_BLOCK_SIZE]; --- u8 j_0[AES_BLOCK_SIZE]; --- /* hardware didn't decrypt/verify MIC */ --- gcmp_special_blocks(skb, pn, j_0, aad); --- --- if (ieee80211_aes_gcm_decrypt( --- key->u.gcmp.tfm, j_0, aad, --- skb->data + hdrlen + IEEE80211_GCMP_HDR_LEN, --- data_len, --- skb->data + skb->len - IEEE80211_GCMP_MIC_LEN)) --- return RX_DROP_UNUSABLE; --- } --- --- memcpy(key->u.gcmp.rx_pn[queue], pn, IEEE80211_GCMP_PN_LEN); --- --- /* Remove GCMP header and MIC */ --- if (pskb_trim(skb, skb->len - IEEE80211_GCMP_MIC_LEN)) --- return RX_DROP_UNUSABLE; --- memmove(skb->data + IEEE80211_GCMP_HDR_LEN, skb->data, hdrlen); --- skb_pull(skb, IEEE80211_GCMP_HDR_LEN); --- --- return RX_CONTINUE; ---} --- -- static ieee80211_tx_result -- ieee80211_crypto_cs_encrypt(struct ieee80211_tx_data *tx, -- struct sk_buff *skb) --@@ -956,48 +734,6 @@ ieee80211_crypto_aes_cmac_encrypt(struct -- return TX_CONTINUE; -- } -- ---ieee80211_tx_result ---ieee80211_crypto_aes_cmac_256_encrypt(struct ieee80211_tx_data *tx) ---{ --- struct sk_buff *skb; --- struct ieee80211_tx_info *info; --- struct ieee80211_key *key = tx->key; --- struct ieee80211_mmie_16 *mmie; --- u8 aad[20]; --- u64 pn64; --- --- if (WARN_ON(skb_queue_len(&tx->skbs) != 1)) --- return TX_DROP; --- --- skb = skb_peek(&tx->skbs); --- --- info = IEEE80211_SKB_CB(skb); --- --- if (info->control.hw_key) --- return TX_CONTINUE; --- --- if (WARN_ON(skb_tailroom(skb) < sizeof(*mmie))) --- return TX_DROP; --- --- mmie = (struct ieee80211_mmie_16 *)skb_put(skb, sizeof(*mmie)); --- mmie->element_id = WLAN_EID_MMIE; --- mmie->length = sizeof(*mmie) - 2; --- mmie->key_id = cpu_to_le16(key->conf.keyidx); --- --- /* PN = PN + 1 */ --- pn64 = atomic64_inc_return(&key->u.aes_cmac.tx_pn); --- --- bip_ipn_set64(mmie->sequence_number, pn64); --- --- bip_aad(skb, aad); --- --- /* MIC = AES-256-CMAC(IGTK, AAD || Management Frame Body || MMIE, 128) --- */ --- ieee80211_aes_cmac_256(key->u.aes_cmac.tfm, aad, --- skb->data + 24, skb->len - 24, mmie->mic); --- --- return TX_CONTINUE; ---} -- -- ieee80211_rx_result -- ieee80211_crypto_aes_cmac_decrypt(struct ieee80211_rx_data *rx) --@@ -1045,160 +781,6 @@ ieee80211_crypto_aes_cmac_decrypt(struct -- -- /* Remove MMIE */ -- skb_trim(skb, skb->len - sizeof(*mmie)); --- --- return RX_CONTINUE; ---} --- ---ieee80211_rx_result ---ieee80211_crypto_aes_cmac_256_decrypt(struct ieee80211_rx_data *rx) ---{ --- struct sk_buff *skb = rx->skb; --- struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); --- struct ieee80211_key *key = rx->key; --- struct ieee80211_mmie_16 *mmie; --- u8 aad[20], mic[16], ipn[6]; --- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; --- --- if (!ieee80211_is_mgmt(hdr->frame_control)) --- return RX_CONTINUE; --- --- /* management frames are already linear */ --- --- if (skb->len < 24 + sizeof(*mmie)) --- return RX_DROP_UNUSABLE; --- --- mmie = (struct ieee80211_mmie_16 *) --- (skb->data + skb->len - sizeof(*mmie)); --- if (mmie->element_id != WLAN_EID_MMIE || --- mmie->length != sizeof(*mmie) - 2) --- return RX_DROP_UNUSABLE; /* Invalid MMIE */ --- --- bip_ipn_swap(ipn, mmie->sequence_number); --- --- if (memcmp(ipn, key->u.aes_cmac.rx_pn, 6) <= 0) { --- key->u.aes_cmac.replays++; --- return RX_DROP_UNUSABLE; --- } --- --- if (!(status->flag & RX_FLAG_DECRYPTED)) { --- /* hardware didn't decrypt/verify MIC */ --- bip_aad(skb, aad); --- ieee80211_aes_cmac_256(key->u.aes_cmac.tfm, aad, --- skb->data + 24, skb->len - 24, mic); --- if (memcmp(mic, mmie->mic, sizeof(mmie->mic)) != 0) { --- key->u.aes_cmac.icverrors++; --- return RX_DROP_UNUSABLE; --- } --- } --- --- memcpy(key->u.aes_cmac.rx_pn, ipn, 6); --- --- /* Remove MMIE */ --- skb_trim(skb, skb->len - sizeof(*mmie)); --- --- return RX_CONTINUE; ---} --- ---ieee80211_tx_result ---ieee80211_crypto_aes_gmac_encrypt(struct ieee80211_tx_data *tx) ---{ --- struct sk_buff *skb; --- struct ieee80211_tx_info *info; --- struct ieee80211_key *key = tx->key; --- struct ieee80211_mmie_16 *mmie; --- struct ieee80211_hdr *hdr; --- u8 aad[20]; --- u64 pn64; --- u8 nonce[12]; --- --- if (WARN_ON(skb_queue_len(&tx->skbs) != 1)) --- return TX_DROP; --- --- skb = skb_peek(&tx->skbs); --- --- info = IEEE80211_SKB_CB(skb); --- --- if (info->control.hw_key) --- return TX_CONTINUE; --- --- if (WARN_ON(skb_tailroom(skb) < sizeof(*mmie))) --- return TX_DROP; --- --- mmie = (struct ieee80211_mmie_16 *)skb_put(skb, sizeof(*mmie)); --- mmie->element_id = WLAN_EID_MMIE; --- mmie->length = sizeof(*mmie) - 2; --- mmie->key_id = cpu_to_le16(key->conf.keyidx); --- --- /* PN = PN + 1 */ --- pn64 = atomic64_inc_return(&key->u.aes_gmac.tx_pn); --- --- bip_ipn_set64(mmie->sequence_number, pn64); --- --- bip_aad(skb, aad); --- --- hdr = (struct ieee80211_hdr *)skb->data; --- memcpy(nonce, hdr->addr2, ETH_ALEN); --- bip_ipn_swap(nonce + ETH_ALEN, mmie->sequence_number); --- --- /* MIC = AES-GMAC(IGTK, AAD || Management Frame Body || MMIE, 128) */ --- if (ieee80211_aes_gmac(key->u.aes_gmac.tfm, aad, nonce, --- skb->data + 24, skb->len - 24, mmie->mic) < 0) --- return TX_DROP; --- --- return TX_CONTINUE; ---} --- ---ieee80211_rx_result ---ieee80211_crypto_aes_gmac_decrypt(struct ieee80211_rx_data *rx) ---{ --- struct sk_buff *skb = rx->skb; --- struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); --- struct ieee80211_key *key = rx->key; --- struct ieee80211_mmie_16 *mmie; --- u8 aad[20], mic[16], ipn[6], nonce[12]; --- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; --- --- if (!ieee80211_is_mgmt(hdr->frame_control)) --- return RX_CONTINUE; --- --- /* management frames are already linear */ --- --- if (skb->len < 24 + sizeof(*mmie)) --- return RX_DROP_UNUSABLE; --- --- mmie = (struct ieee80211_mmie_16 *) --- (skb->data + skb->len - sizeof(*mmie)); --- if (mmie->element_id != WLAN_EID_MMIE || --- mmie->length != sizeof(*mmie) - 2) --- return RX_DROP_UNUSABLE; /* Invalid MMIE */ --- --- bip_ipn_swap(ipn, mmie->sequence_number); --- --- if (memcmp(ipn, key->u.aes_gmac.rx_pn, 6) <= 0) { --- key->u.aes_gmac.replays++; --- return RX_DROP_UNUSABLE; --- } --- --- if (!(status->flag & RX_FLAG_DECRYPTED)) { --- /* hardware didn't decrypt/verify MIC */ --- bip_aad(skb, aad); --- --- memcpy(nonce, hdr->addr2, ETH_ALEN); --- memcpy(nonce + ETH_ALEN, ipn, 6); --- --- if (ieee80211_aes_gmac(key->u.aes_gmac.tfm, aad, nonce, --- skb->data + 24, skb->len - 24, --- mic) < 0 || --- memcmp(mic, mmie->mic, sizeof(mmie->mic)) != 0) { --- key->u.aes_gmac.icverrors++; --- return RX_DROP_UNUSABLE; --- } --- } --- --- memcpy(key->u.aes_gmac.rx_pn, ipn, 6); --- --- /* Remove MMIE */ --- skb_trim(skb, skb->len - sizeof(*mmie)); -- -- return RX_CONTINUE; -- } ----- a/net/mac80211/wpa.h --+++ b/net/mac80211/wpa.h --@@ -24,32 +24,17 @@ ieee80211_rx_result -- ieee80211_crypto_tkip_decrypt(struct ieee80211_rx_data *rx); -- -- ieee80211_tx_result ---ieee80211_crypto_ccmp_encrypt(struct ieee80211_tx_data *tx, --- unsigned int mic_len); --+ieee80211_crypto_ccmp_encrypt(struct ieee80211_tx_data *tx); -- ieee80211_rx_result ---ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx, --- unsigned int mic_len); --+ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx); -- -- ieee80211_tx_result -- ieee80211_crypto_aes_cmac_encrypt(struct ieee80211_tx_data *tx); ---ieee80211_tx_result ---ieee80211_crypto_aes_cmac_256_encrypt(struct ieee80211_tx_data *tx); -- ieee80211_rx_result -- ieee80211_crypto_aes_cmac_decrypt(struct ieee80211_rx_data *rx); ---ieee80211_rx_result ---ieee80211_crypto_aes_cmac_256_decrypt(struct ieee80211_rx_data *rx); ---ieee80211_tx_result ---ieee80211_crypto_aes_gmac_encrypt(struct ieee80211_tx_data *tx); ---ieee80211_rx_result ---ieee80211_crypto_aes_gmac_decrypt(struct ieee80211_rx_data *rx); -- ieee80211_tx_result -- ieee80211_crypto_hw_encrypt(struct ieee80211_tx_data *tx); -- ieee80211_rx_result -- ieee80211_crypto_hw_decrypt(struct ieee80211_rx_data *rx); -- ---ieee80211_tx_result ---ieee80211_crypto_gcmp_encrypt(struct ieee80211_tx_data *tx); ---ieee80211_rx_result ---ieee80211_crypto_gcmp_decrypt(struct ieee80211_rx_data *rx); --- -- #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 ---- 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 - - --- 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 - 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 ---- a/package/kernel/mac80211/patches/150-disable_addr_notifier.patch -+++ b/package/kernel/mac80211/patches/150-disable_addr_notifier.patch -@@ -18,7 +18,7 @@ - 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; - -@@ -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 - - return 0; - -@@ -52,7 +52,7 @@ - fail_ifa: - 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 - - pm_qos_remove_notifier(PM_QOS_NETWORK_LATENCY, - &local->network_latency_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 ---- 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 * - * the frames sent while scanning on other channel will be - * lost) - */ -diff --git a/package/kernel/mac80211/patches/300-ath9k-force-rx_clear-when-disabling-rx.patch b/package/kernel/mac80211/patches/300-ath9k-force-rx_clear-when-disabling-rx.patch -new file mode 100644 -index 0000000..bddb15a ---- /dev/null -+++ b/package/kernel/mac80211/patches/300-ath9k-force-rx_clear-when-disabling-rx.patch -@@ -0,0 +1,31 @@ -+From: Felix Fietkau -+Date: Sun, 7 Jun 2015 13:53:35 +0200 -+Subject: [PATCH] ath9k: force rx_clear when disabling rx -+ -+This makes stopping Rx more reliable and should reduce the frequency of -+Rx related DMA stop warnings -+ -+Cc: stable@vger.kernel.org -+Signed-off-by: Felix Fietkau -+--- -+ -+--- a/drivers/net/wireless/ath/ath9k/mac.c -++++ b/drivers/net/wireless/ath/ath9k/mac.c -+@@ -677,13 +677,15 @@ void ath9k_hw_startpcureceive(struct ath -+ -+ ath9k_ani_reset(ah, is_scanning); -+ -+- REG_CLR_BIT(ah, AR_DIAG_SW, (AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT)); -++ REG_CLR_BIT(ah, AR_DIAG_SW, -++ AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT | AR_DIAG_FORCE_RX_CLEAR); -+ } -+ EXPORT_SYMBOL(ath9k_hw_startpcureceive); -+ -+ void ath9k_hw_abortpcurecv(struct ath_hw *ah) -+ { -+- REG_SET_BIT(ah, AR_DIAG_SW, AR_DIAG_RX_ABORT | AR_DIAG_RX_DIS); -++ REG_SET_BIT(ah, AR_DIAG_SW, -++ AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT | AR_DIAG_FORCE_RX_CLEAR); -+ -+ ath9k_hw_disable_mib_counters(ah); -+ } -diff --git a/package/kernel/mac80211/patches/300-mac80211-add-an-intermediate-software-queue-implemen.patch b/package/kernel/mac80211/patches/300-mac80211-add-an-intermediate-software-queue-implemen.patch -deleted file mode 100644 -index 237121b..0000000 ---- a/package/kernel/mac80211/patches/300-mac80211-add-an-intermediate-software-queue-implemen.patch -+++ /dev/null -@@ -1,882 +0,0 @@ --From: Felix Fietkau --Date: Tue, 18 Nov 2014 23:58:51 +0100 --Subject: [PATCH] mac80211: add an intermediate software queue implementation -- --This allows drivers to request per-vif and per-sta-tid queues from which --they can pull frames. This makes it easier to keep the hardware queues --short, and to improve fairness between clients and vifs. -- --The task of scheduling packet transmission is left up to the driver - --queueing is controlled by mac80211. Drivers can only dequeue packets by --calling ieee80211_tx_dequeue. This makes it possible to add active queue --management later without changing drivers using this code. -- --This can also be used as a starting point to implement A-MSDU --aggregation in a way that does not add artificially induced latency. -- --Signed-off-by: Felix Fietkau ----- -- ----- a/include/net/mac80211.h --+++ b/include/net/mac80211.h --@@ -84,6 +84,39 @@ -- * -- */ -- --+/** --+ * DOC: mac80211 software tx queueing --+ * --+ * mac80211 provides an optional intermediate queueing implementation designed --+ * to allow the driver to keep hardware queues short and provide some fairness --+ * between different stations/interfaces. --+ * In this model, the driver pulls data frames from the mac80211 queue instead --+ * of letting mac80211 push them via drv_tx(). --+ * Other frames (e.g. control or management) are still pushed using drv_tx(). --+ * --+ * Drivers indicate that they use this model by implementing the .wake_tx_queue --+ * driver operation. --+ * --+ * Intermediate queues (struct ieee80211_txq) are kept per-sta per-tid, with a --+ * single per-vif queue for multicast data frames. --+ * --+ * The driver is expected to initialize its private per-queue data for stations --+ * and interfaces in the .add_interface and .sta_add ops. --+ * --+ * The driver can't access the queue directly. To dequeue a frame, it calls --+ * ieee80211_tx_dequeue(). Whenever mac80211 adds a new frame to a queue, it --+ * calls the .wake_tx_queue driver op. --+ * --+ * For AP powersave TIM handling, the driver only needs to indicate if it has --+ * buffered packets in the driver specific data structures by calling --+ * ieee80211_sta_set_buffered(). For frames buffered in the ieee80211_txq --+ * struct, mac80211 sets the appropriate TIM PVB bits and calls --+ * .release_buffered_frames(). --+ * In that callback the driver is therefore expected to release its own --+ * buffered frames and afterwards also frames from the ieee80211_txq (obtained --+ * via the usual ieee80211_tx_dequeue). --+ */ --+ -- struct device; -- -- /** --@@ -1246,6 +1279,7 @@ enum ieee80211_vif_flags { -- * monitor interface (if that is requested.) -- * @drv_priv: data area for driver use, will always be aligned to -- * sizeof(void *). --+ * @txq: the multicast data TX queue (if driver uses the TXQ abstraction) -- */ -- struct ieee80211_vif { -- enum nl80211_iftype type; --@@ -1257,6 +1291,8 @@ struct ieee80211_vif { -- u8 cab_queue; -- u8 hw_queue[IEEE80211_NUM_ACS]; -- --+ struct ieee80211_txq *txq; --+ -- struct ieee80211_chanctx_conf __rcu *chanctx_conf; -- -- u32 driver_flags; --@@ -1501,6 +1537,7 @@ struct ieee80211_sta_rates { -- * @tdls_initiator: indicates the STA is an initiator of the TDLS link. Only -- * valid if the STA is a TDLS peer in the first place. -- * @mfp: indicates whether the STA uses management frame protection or not. --+ * @txq: per-TID data TX queues (if driver uses the TXQ abstraction) -- */ -- struct ieee80211_sta { -- u32 supp_rates[IEEE80211_NUM_BANDS]; --@@ -1519,6 +1556,8 @@ struct ieee80211_sta { -- bool tdls_initiator; -- bool mfp; -- --+ struct ieee80211_txq *txq[IEEE80211_NUM_TIDS]; --+ -- /* must be last */ -- u8 drv_priv[0] __aligned(sizeof(void *)); -- }; --@@ -1547,6 +1586,27 @@ struct ieee80211_tx_control { -- }; -- -- /** --+ * struct ieee80211_txq - Software intermediate tx queue --+ * --+ * @vif: &struct ieee80211_vif pointer from the add_interface callback. --+ * @sta: station table entry, %NULL for per-vif queue --+ * @tid: the TID for this queue (unused for per-vif queue) --+ * @ac: the AC for this queue --+ * --+ * The driver can obtain packets from this queue by calling --+ * ieee80211_tx_dequeue(). --+ */ --+struct ieee80211_txq { --+ struct ieee80211_vif *vif; --+ struct ieee80211_sta *sta; --+ u8 tid; --+ u8 ac; --+ --+ /* must be last */ --+ u8 drv_priv[0] __aligned(sizeof(void *)); --+}; --+ --+/** -- * enum ieee80211_hw_flags - hardware flags -- * -- * These flags are used to indicate hardware capabilities to --@@ -1770,6 +1830,8 @@ enum ieee80211_hw_flags { -- * within &struct ieee80211_sta. -- * @chanctx_data_size: size (in bytes) of the drv_priv data area -- * within &struct ieee80211_chanctx_conf. --+ * @txq_data_size: size (in bytes) of the drv_priv data area --+ * within @struct ieee80211_txq. -- * -- * @max_rates: maximum number of alternate rate retry stages the hw -- * can handle. --@@ -1818,6 +1880,9 @@ enum ieee80211_hw_flags { -- * @n_cipher_schemes: a size of an array of cipher schemes definitions. -- * @cipher_schemes: a pointer to an array of cipher scheme definitions -- * supported by HW. --+ * --+ * @txq_ac_max_pending: maximum number of frames per AC pending in all txq --+ * entries for a vif. -- */ -- struct ieee80211_hw { -- struct ieee80211_conf conf; --@@ -1830,6 +1895,7 @@ struct ieee80211_hw { -- int vif_data_size; -- int sta_data_size; -- int chanctx_data_size; --+ int txq_data_size; -- u16 queues; -- u16 max_listen_interval; -- s8 max_signal; --@@ -1846,6 +1912,7 @@ struct ieee80211_hw { -- u8 uapsd_max_sp_len; -- u8 n_cipher_schemes; -- const struct ieee80211_cipher_scheme *cipher_schemes; --+ int txq_ac_max_pending; -- }; -- -- /** --@@ -3007,6 +3074,8 @@ enum ieee80211_reconfig_type { -- * response template is provided, together with the location of the -- * switch-timing IE within the template. The skb can only be used within -- * the function call. --+ * --+ * @wake_tx_queue: Called when new packets have been added to the queue. -- */ -- struct ieee80211_ops { -- void (*tx)(struct ieee80211_hw *hw, --@@ -3238,6 +3307,9 @@ struct ieee80211_ops { -- void (*tdls_recv_channel_switch)(struct ieee80211_hw *hw, -- struct ieee80211_vif *vif, -- struct ieee80211_tdls_ch_sw_params *params); --+ --+ void (*wake_tx_queue)(struct ieee80211_hw *hw, --+ struct ieee80211_txq *txq); -- }; -- -- /** --@@ -5249,4 +5321,15 @@ void ieee80211_unreserve_tid(struct ieee -- */ -- size_t ieee80211_ie_split(const u8 *ies, size_t ielen, -- const u8 *ids, int n_ids, size_t offset); --+ --+/** --+ * ieee80211_tx_dequeue - dequeue a packet from a software tx queue --+ * --+ * @hw: pointer as obtained from ieee80211_alloc_hw() --+ * @txq: pointer obtained from station or virtual interface --+ * --+ * Returns the skb if successful, %NULL if no frame was available. --+ */ --+struct sk_buff *ieee80211_tx_dequeue(struct ieee80211_hw *hw, --+ struct ieee80211_txq *txq); -- #endif /* MAC80211_H */ ----- a/net/mac80211/driver-ops.h --+++ b/net/mac80211/driver-ops.h --@@ -1367,4 +1367,16 @@ drv_tdls_recv_channel_switch(struct ieee -- trace_drv_return_void(local); -- } -- --+static inline void drv_wake_tx_queue(struct ieee80211_local *local, --+ struct txq_info *txq) --+{ --+ struct ieee80211_sub_if_data *sdata = vif_to_sdata(txq->txq.vif); --+ --+ if (!check_sdata_in_driver(sdata)) --+ return; --+ --+ trace_drv_wake_tx_queue(local, sdata, txq); --+ local->ops->wake_tx_queue(&local->hw, &txq->txq); --+} --+ -- #endif /* __MAC80211_DRIVER_OPS */ ----- a/net/mac80211/ieee80211_i.h --+++ b/net/mac80211/ieee80211_i.h --@@ -809,6 +809,19 @@ struct mac80211_qos_map { -- struct rcu_head rcu_head; -- }; -- --+enum txq_info_flags { --+ IEEE80211_TXQ_STOP, --+ IEEE80211_TXQ_AMPDU, --+}; --+ --+struct txq_info { --+ struct sk_buff_head queue; --+ unsigned long flags; --+ --+ /* keep last! */ --+ struct ieee80211_txq txq; --+}; --+ -- struct ieee80211_sub_if_data { -- struct list_head list; -- --@@ -853,6 +866,7 @@ struct ieee80211_sub_if_data { -- bool control_port_no_encrypt; -- int encrypt_headroom; -- --+ atomic_t txqs_len[IEEE80211_NUM_ACS]; -- struct ieee80211_tx_queue_params tx_conf[IEEE80211_NUM_ACS]; -- struct mac80211_qos_map __rcu *qos_map; -- --@@ -1453,6 +1467,10 @@ static inline struct ieee80211_local *hw -- return container_of(hw, struct ieee80211_local, hw); -- } -- --+static inline struct txq_info *to_txq_info(struct ieee80211_txq *txq) --+{ --+ return container_of(txq, struct txq_info, txq); --+} -- -- static inline int ieee80211_bssid_match(const u8 *raddr, const u8 *addr) -- { --@@ -1905,6 +1923,9 @@ static inline bool ieee80211_can_run_wor -- return true; -- } -- --+void ieee80211_init_tx_queue(struct ieee80211_sub_if_data *sdata, --+ struct sta_info *sta, --+ struct txq_info *txq, int tid); -- void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata, -- u16 transaction, u16 auth_alg, u16 status, -- const u8 *extra, size_t extra_len, const u8 *bssid, ----- a/net/mac80211/iface.c --+++ b/net/mac80211/iface.c --@@ -969,6 +969,13 @@ static void ieee80211_do_stop(struct iee -- } -- spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); -- --+ if (sdata->vif.txq) { --+ struct txq_info *txqi = to_txq_info(sdata->vif.txq); --+ --+ ieee80211_purge_tx_queue(&local->hw, &txqi->queue); --+ atomic_set(&sdata->txqs_len[txqi->txq.ac], 0); --+ } --+ -- if (local->open_count == 0) -- ieee80211_clear_tx_pending(local); -- --@@ -1674,6 +1681,7 @@ int ieee80211_if_add(struct ieee80211_lo -- { -- struct net_device *ndev = NULL; -- struct ieee80211_sub_if_data *sdata = NULL; --+ struct txq_info *txqi; -- int ret, i; -- int txqs = 1; -- --@@ -1693,10 +1701,18 @@ int ieee80211_if_add(struct ieee80211_lo -- ieee80211_assign_perm_addr(local, wdev->address, type); -- memcpy(sdata->vif.addr, wdev->address, ETH_ALEN); -- } else { --+ int size = ALIGN(sizeof(*sdata) + local->hw.vif_data_size, --+ sizeof(void *)); --+ int txq_size = 0; --+ --+ if (local->ops->wake_tx_queue) --+ txq_size += sizeof(struct txq_info) + --+ local->hw.txq_data_size; --+ -- if (local->hw.queues >= IEEE80211_NUM_ACS) -- txqs = IEEE80211_NUM_ACS; -- --- ndev = alloc_netdev_mqs(sizeof(*sdata) + local->hw.vif_data_size, --+ ndev = alloc_netdev_mqs(size + txq_size, -- name, NET_NAME_UNKNOWN, -- ieee80211_if_setup, txqs, 1); -- if (!ndev) --@@ -1731,6 +1747,11 @@ int ieee80211_if_add(struct ieee80211_lo -- memcpy(sdata->vif.addr, ndev->dev_addr, ETH_ALEN); -- memcpy(sdata->name, ndev->name, IFNAMSIZ); -- --+ if (txq_size) { --+ txqi = netdev_priv(ndev) + size; --+ ieee80211_init_tx_queue(sdata, NULL, txqi, 0); --+ } --+ -- sdata->dev = ndev; -- } -- ----- a/net/mac80211/main.c --+++ b/net/mac80211/main.c --@@ -1019,6 +1019,9 @@ int ieee80211_register_hw(struct ieee802 -- -- local->dynamic_ps_forced_timeout = -1; -- --+ if (!local->hw.txq_ac_max_pending) --+ local->hw.txq_ac_max_pending = 64; --+ -- result = ieee80211_wep_init(local); -- if (result < 0) -- wiphy_debug(local->hw.wiphy, "Failed to initialize wep: %d\n", ----- a/net/mac80211/sta_info.c --+++ b/net/mac80211/sta_info.c --@@ -118,6 +118,16 @@ static void __cleanup_single_sta(struct -- atomic_dec(&ps->num_sta_ps); -- } -- --+ if (sta->sta.txq[0]) { --+ for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) { --+ struct txq_info *txqi = to_txq_info(sta->sta.txq[i]); --+ int n = skb_queue_len(&txqi->queue); --+ --+ ieee80211_purge_tx_queue(&local->hw, &txqi->queue); --+ atomic_sub(n, &sdata->txqs_len[txqi->txq.ac]); --+ } --+ } --+ -- for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) { -- local->total_ps_buffered -= skb_queue_len(&sta->ps_tx_buf[ac]); -- ieee80211_purge_tx_queue(&local->hw, &sta->ps_tx_buf[ac]); --@@ -234,6 +244,8 @@ void sta_info_free(struct ieee80211_loca -- -- sta_dbg(sta->sdata, "Destroyed STA %pM\n", sta->sta.addr); -- --+ if (sta->sta.txq[0]) --+ kfree(to_txq_info(sta->sta.txq[0])); -- kfree(rcu_dereference_raw(sta->sta.rates)); -- kfree(sta); -- } --@@ -285,11 +297,12 @@ struct sta_info *sta_info_alloc(struct i -- const u8 *addr, gfp_t gfp) -- { -- struct ieee80211_local *local = sdata->local; --+ struct ieee80211_hw *hw = &local->hw; -- struct sta_info *sta; -- struct timespec uptime; -- int i; -- --- sta = kzalloc(sizeof(*sta) + local->hw.sta_data_size, gfp); --+ sta = kzalloc(sizeof(*sta) + hw->sta_data_size, gfp); -- if (!sta) -- return NULL; -- --@@ -321,11 +334,25 @@ struct sta_info *sta_info_alloc(struct i -- for (i = 0; i < ARRAY_SIZE(sta->chain_signal_avg); i++) -- ewma_init(&sta->chain_signal_avg[i], 1024, 8); -- --- if (sta_prepare_rate_control(local, sta, gfp)) { --- kfree(sta); --- return NULL; --+ if (local->ops->wake_tx_queue) { --+ void *txq_data; --+ int size = sizeof(struct txq_info) + --+ ALIGN(hw->txq_data_size, sizeof(void *)); --+ --+ txq_data = kcalloc(ARRAY_SIZE(sta->sta.txq), size, gfp); --+ if (!txq_data) --+ goto free; --+ --+ for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) { --+ struct txq_info *txq = txq_data + i * size; --+ --+ ieee80211_init_tx_queue(sdata, sta, txq, i); --+ } -- } -- --+ if (sta_prepare_rate_control(local, sta, gfp)) --+ goto free_txq; --+ -- for (i = 0; i < IEEE80211_NUM_TIDS; i++) { -- /* -- * timer_to_tid must be initialized with identity mapping --@@ -346,7 +373,7 @@ struct sta_info *sta_info_alloc(struct i -- if (sdata->vif.type == NL80211_IFTYPE_AP || -- sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { -- struct ieee80211_supported_band *sband = --- local->hw.wiphy->bands[ieee80211_get_sdata_band(sdata)]; --+ hw->wiphy->bands[ieee80211_get_sdata_band(sdata)]; -- u8 smps = (sband->ht_cap.cap & IEEE80211_HT_CAP_SM_PS) >> -- IEEE80211_HT_CAP_SM_PS_SHIFT; -- /* --@@ -371,6 +398,13 @@ struct sta_info *sta_info_alloc(struct i -- sta_dbg(sdata, "Allocated STA %pM\n", sta->sta.addr); -- -- return sta; --+ --+free_txq: --+ if (sta->sta.txq[0]) --+ kfree(to_txq_info(sta->sta.txq[0])); --+free: --+ kfree(sta); --+ return NULL; -- } -- -- static int sta_info_insert_check(struct sta_info *sta) --@@ -640,6 +674,8 @@ static void __sta_info_recalc_tim(struct -- -- indicate_tim |= -- sta->driver_buffered_tids & tids; --+ indicate_tim |= --+ sta->txq_buffered_tids & tids; -- } -- -- done: --@@ -1071,7 +1107,7 @@ void ieee80211_sta_ps_deliver_wakeup(str -- struct ieee80211_sub_if_data *sdata = sta->sdata; -- struct ieee80211_local *local = sdata->local; -- struct sk_buff_head pending; --- int filtered = 0, buffered = 0, ac; --+ int filtered = 0, buffered = 0, ac, i; -- unsigned long flags; -- struct ps_data *ps; -- --@@ -1090,10 +1126,22 @@ void ieee80211_sta_ps_deliver_wakeup(str -- -- BUILD_BUG_ON(BITS_TO_LONGS(IEEE80211_NUM_TIDS) > 1); -- sta->driver_buffered_tids = 0; --+ sta->txq_buffered_tids = 0; -- -- if (!(local->hw.flags & IEEE80211_HW_AP_LINK_PS)) -- drv_sta_notify(local, sdata, STA_NOTIFY_AWAKE, &sta->sta); -- --+ if (sta->sta.txq[0]) { --+ for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) { --+ struct txq_info *txqi = to_txq_info(sta->sta.txq[i]); --+ --+ if (!skb_queue_len(&txqi->queue)) --+ continue; --+ --+ drv_wake_tx_queue(local, txqi); --+ } --+ } --+ -- skb_queue_head_init(&pending); -- -- /* sync with ieee80211_tx_h_unicast_ps_buf */ --@@ -1275,8 +1323,10 @@ ieee80211_sta_ps_deliver_response(struct -- /* if we already have frames from software, then we can't also -- * release from hardware queues -- */ --- if (skb_queue_empty(&frames)) --+ if (skb_queue_empty(&frames)) { -- driver_release_tids |= sta->driver_buffered_tids & tids; --+ driver_release_tids |= sta->txq_buffered_tids & tids; --+ } -- -- if (driver_release_tids) { -- /* If the driver has data on more than one TID then --@@ -1447,6 +1497,9 @@ ieee80211_sta_ps_deliver_response(struct -- -- sta_info_recalc_tim(sta); -- } else { --+ unsigned long tids = sta->txq_buffered_tids & driver_release_tids; --+ int tid; --+ -- /* -- * We need to release a frame that is buffered somewhere in the -- * driver ... it'll have to handle that. --@@ -1466,8 +1519,22 @@ ieee80211_sta_ps_deliver_response(struct -- * that the TID(s) became empty before returning here from the -- * release function. -- * Either way, however, when the driver tells us that the TID(s) --- * became empty we'll do the TIM recalculation. --+ * became empty or we find that a txq became empty, we'll do the --+ * TIM recalculation. -- */ --+ --+ if (!sta->sta.txq[0]) --+ return; --+ --+ for (tid = 0; tid < ARRAY_SIZE(sta->sta.txq); tid++) { --+ struct txq_info *txqi = to_txq_info(sta->sta.txq[tid]); --+ --+ if (!(tids & BIT(tid)) || skb_queue_len(&txqi->queue)) --+ continue; --+ --+ sta_info_recalc_tim(sta); --+ break; --+ } -- } -- } -- ----- a/net/mac80211/sta_info.h --+++ b/net/mac80211/sta_info.h --@@ -274,6 +274,7 @@ struct sta_ampdu_mlme { -- * entered power saving state, these are also delivered to -- * the station when it leaves powersave or polls for frames -- * @driver_buffered_tids: bitmap of TIDs the driver has data buffered on --+ * @txq_buffered_tids: bitmap of TIDs that mac80211 has txq data buffered on -- * @rx_packets: Number of MSDUs received from this STA -- * @rx_bytes: Number of bytes received from this STA -- * @last_rx: time (in jiffies) when last frame was received from this STA --@@ -368,6 +369,7 @@ struct sta_info { -- struct sk_buff_head ps_tx_buf[IEEE80211_NUM_ACS]; -- struct sk_buff_head tx_filtered[IEEE80211_NUM_ACS]; -- unsigned long driver_buffered_tids; --+ unsigned long txq_buffered_tids; -- -- /* Updated from RX path only, no locking requirements */ -- unsigned long rx_packets; ----- a/net/mac80211/trace.h --+++ b/net/mac80211/trace.h --@@ -2312,6 +2312,37 @@ TRACE_EVENT(drv_tdls_recv_channel_switch -- ) -- ); -- --+TRACE_EVENT(drv_wake_tx_queue, --+ TP_PROTO(struct ieee80211_local *local, --+ struct ieee80211_sub_if_data *sdata, --+ struct txq_info *txq), --+ --+ TP_ARGS(local, sdata, txq), --+ --+ TP_STRUCT__entry( --+ LOCAL_ENTRY --+ VIF_ENTRY --+ STA_ENTRY --+ __field(u8, ac) --+ __field(u8, tid) --+ ), --+ --+ TP_fast_assign( --+ struct ieee80211_sta *sta = txq->txq.sta; --+ --+ LOCAL_ASSIGN; --+ VIF_ASSIGN; --+ STA_ASSIGN; --+ __entry->ac = txq->txq.ac; --+ __entry->tid = txq->txq.tid; --+ ), --+ --+ TP_printk( --+ LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " ac:%d tid:%d", --+ LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->ac, __entry->tid --+ ) --+); --+ -- #ifdef CPTCFG_MAC80211_MESSAGE_TRACING -- #undef TRACE_SYSTEM -- #define TRACE_SYSTEM mac80211_msg ----- a/net/mac80211/tx.c --+++ b/net/mac80211/tx.c --@@ -776,12 +776,22 @@ ieee80211_tx_h_rate_ctrl(struct ieee8021 -- return TX_CONTINUE; -- } -- --+static __le16 ieee80211_tx_next_seq(struct sta_info *sta, int tid) --+{ --+ u16 *seq = &sta->tid_seq[tid]; --+ __le16 ret = cpu_to_le16(*seq); --+ --+ /* Increase the sequence number. */ --+ *seq = (*seq + 0x10) & IEEE80211_SCTL_SEQ; --+ --+ return ret; --+} --+ -- static ieee80211_tx_result debug_noinline -- ieee80211_tx_h_sequence(struct ieee80211_tx_data *tx) -- { -- struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); -- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; --- u16 *seq; -- u8 *qc; -- int tid; -- --@@ -832,13 +842,10 @@ ieee80211_tx_h_sequence(struct ieee80211 -- -- qc = ieee80211_get_qos_ctl(hdr); -- tid = *qc & IEEE80211_QOS_CTL_TID_MASK; --- seq = &tx->sta->tid_seq[tid]; -- tx->sta->tx_msdu[tid]++; -- --- hdr->seq_ctrl = cpu_to_le16(*seq); --- --- /* Increase the sequence number. */ --- *seq = (*seq + 0x10) & IEEE80211_SCTL_SEQ; --+ if (!tx->sta->sta.txq[0]) --+ hdr->seq_ctrl = ieee80211_tx_next_seq(tx->sta, tid); -- -- return TX_CONTINUE; -- } --@@ -1067,7 +1074,7 @@ static bool ieee80211_tx_prep_agg(struct -- * nothing -- this aggregation session is being started -- * but that might still fail with the driver -- */ --- } else { --+ } else if (!tx->sta->sta.txq[tid]) { -- spin_lock(&tx->sta->lock); -- /* -- * Need to re-check now, because we may get here --@@ -1201,13 +1208,102 @@ ieee80211_tx_prepare(struct ieee80211_su -- return TX_CONTINUE; -- } -- --+static void ieee80211_drv_tx(struct ieee80211_local *local, --+ struct ieee80211_vif *vif, --+ struct ieee80211_sta *pubsta, --+ struct sk_buff *skb) --+{ --+ struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; --+ struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); --+ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); --+ struct ieee80211_tx_control control = { --+ .sta = pubsta, --+ }; --+ struct ieee80211_txq *txq = NULL; --+ struct txq_info *txqi; --+ u8 ac; --+ --+ if (info->control.flags & IEEE80211_TX_CTRL_PS_RESPONSE) --+ goto tx_normal; --+ --+ if (!ieee80211_is_data(hdr->frame_control)) --+ goto tx_normal; --+ --+ if (pubsta) { --+ u8 tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK; --+ --+ txq = pubsta->txq[tid]; --+ } else if (vif) { --+ txq = vif->txq; --+ } --+ --+ if (!txq) --+ goto tx_normal; --+ --+ ac = txq->ac; --+ txqi = to_txq_info(txq); --+ atomic_inc(&sdata->txqs_len[ac]); --+ if (atomic_read(&sdata->txqs_len[ac]) >= local->hw.txq_ac_max_pending) --+ netif_stop_subqueue(sdata->dev, ac); --+ --+ skb_queue_tail(&txqi->queue, skb); --+ drv_wake_tx_queue(local, txqi); --+ --+ return; --+ --+tx_normal: --+ drv_tx(local, &control, skb); --+} --+ --+struct sk_buff *ieee80211_tx_dequeue(struct ieee80211_hw *hw, --+ struct ieee80211_txq *txq) --+{ --+ struct ieee80211_local *local = hw_to_local(hw); --+ struct ieee80211_sub_if_data *sdata = vif_to_sdata(txq->vif); --+ struct txq_info *txqi = container_of(txq, struct txq_info, txq); --+ struct ieee80211_hdr *hdr; --+ struct sk_buff *skb = NULL; --+ u8 ac = txq->ac; --+ --+ spin_lock_bh(&txqi->queue.lock); --+ --+ if (test_bit(IEEE80211_TXQ_STOP, &txqi->flags)) --+ goto out; --+ --+ skb = __skb_dequeue(&txqi->queue); --+ if (!skb) --+ goto out; --+ --+ atomic_dec(&sdata->txqs_len[ac]); --+ if (__netif_subqueue_stopped(sdata->dev, ac)) --+ ieee80211_propagate_queue_wake(local, sdata->vif.hw_queue[ac]); --+ --+ hdr = (struct ieee80211_hdr *)skb->data; --+ if (txq->sta && ieee80211_is_data_qos(hdr->frame_control)) { --+ struct sta_info *sta = container_of(txq->sta, struct sta_info, --+ sta); --+ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); --+ --+ hdr->seq_ctrl = ieee80211_tx_next_seq(sta, txq->tid); --+ if (test_bit(IEEE80211_TXQ_AMPDU, &txqi->flags)) --+ info->flags |= IEEE80211_TX_CTL_AMPDU; --+ else --+ info->flags &= ~IEEE80211_TX_CTL_AMPDU; --+ } --+ --+out: --+ spin_unlock_bh(&txqi->queue.lock); --+ --+ return skb; --+} --+EXPORT_SYMBOL(ieee80211_tx_dequeue); --+ -- static bool ieee80211_tx_frags(struct ieee80211_local *local, -- struct ieee80211_vif *vif, -- struct ieee80211_sta *sta, -- struct sk_buff_head *skbs, -- bool txpending) -- { --- struct ieee80211_tx_control control; -- struct sk_buff *skb, *tmp; -- unsigned long flags; -- --@@ -1265,10 +1361,9 @@ static bool ieee80211_tx_frags(struct ie -- spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); -- -- info->control.vif = vif; --- control.sta = sta; -- -- __skb_unlink(skb, skbs); --- drv_tx(local, &control, skb); --+ ieee80211_drv_tx(local, vif, sta, skb); -- } -- -- return true; ----- a/net/mac80211/util.c --+++ b/net/mac80211/util.c --@@ -308,6 +308,11 @@ void ieee80211_propagate_queue_wake(stru -- for (ac = 0; ac < n_acs; ac++) { -- int ac_queue = sdata->vif.hw_queue[ac]; -- --+ if (local->ops->wake_tx_queue && --+ (atomic_read(&sdata->txqs_len[ac]) > --+ local->hw.txq_ac_max_pending)) --+ continue; --+ -- if (ac_queue == queue || -- (sdata->vif.cab_queue == queue && -- local->queue_stop_reasons[ac_queue] == 0 && --@@ -3307,3 +3312,20 @@ u8 *ieee80211_add_wmm_info_ie(u8 *buf, u -- -- return buf; -- } --+ --+void ieee80211_init_tx_queue(struct ieee80211_sub_if_data *sdata, --+ struct sta_info *sta, --+ struct txq_info *txqi, int tid) --+{ --+ skb_queue_head_init(&txqi->queue); --+ txqi->txq.vif = &sdata->vif; --+ --+ if (sta) { --+ txqi->txq.sta = &sta->sta; --+ sta->sta.txq[tid] = &txqi->txq; --+ txqi->txq.ac = ieee802_1d_to_ac[tid & 7]; --+ } else { --+ sdata->vif.txq = &txqi->txq; --+ txqi->txq.ac = IEEE80211_AC_BE; --+ } --+} ----- a/net/mac80211/rx.c --+++ b/net/mac80211/rx.c --@@ -1176,6 +1176,7 @@ static void sta_ps_start(struct sta_info -- struct ieee80211_sub_if_data *sdata = sta->sdata; -- struct ieee80211_local *local = sdata->local; -- struct ps_data *ps; --+ int tid; -- -- if (sta->sdata->vif.type == NL80211_IFTYPE_AP || -- sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN) --@@ -1189,6 +1190,18 @@ static void sta_ps_start(struct sta_info -- drv_sta_notify(local, sdata, STA_NOTIFY_SLEEP, &sta->sta); -- ps_dbg(sdata, "STA %pM aid %d enters power save mode\n", -- sta->sta.addr, sta->sta.aid); --+ --+ if (!sta->sta.txq[0]) --+ return; --+ --+ for (tid = 0; tid < ARRAY_SIZE(sta->sta.txq); tid++) { --+ struct txq_info *txqi = to_txq_info(sta->sta.txq[tid]); --+ --+ if (!skb_queue_len(&txqi->queue)) --+ set_bit(tid, &sta->txq_buffered_tids); --+ else --+ clear_bit(tid, &sta->txq_buffered_tids); --+ } -- } -- -- static void sta_ps_end(struct sta_info *sta) ----- a/net/mac80211/agg-tx.c --+++ b/net/mac80211/agg-tx.c --@@ -188,6 +188,43 @@ ieee80211_wake_queue_agg(struct ieee8021 -- __release(agg_queue); -- } -- --+static void --+ieee80211_agg_stop_txq(struct sta_info *sta, int tid) --+{ --+ struct ieee80211_txq *txq = sta->sta.txq[tid]; --+ struct txq_info *txqi; --+ --+ if (!txq) --+ return; --+ --+ txqi = to_txq_info(txq); --+ --+ /* Lock here to protect against further seqno updates on dequeue */ --+ spin_lock_bh(&txqi->queue.lock); --+ set_bit(IEEE80211_TXQ_STOP, &txqi->flags); --+ spin_unlock_bh(&txqi->queue.lock); --+} --+ --+static void --+ieee80211_agg_start_txq(struct sta_info *sta, int tid, bool enable) --+{ --+ struct ieee80211_txq *txq = sta->sta.txq[tid]; --+ struct txq_info *txqi; --+ --+ if (!txq) --+ return; --+ --+ txqi = to_txq_info(txq); --+ --+ if (enable) --+ set_bit(IEEE80211_TXQ_AMPDU, &txqi->flags); --+ else --+ clear_bit(IEEE80211_TXQ_AMPDU, &txqi->flags); --+ --+ clear_bit(IEEE80211_TXQ_STOP, &txqi->flags); --+ drv_wake_tx_queue(sta->sdata->local, txqi); --+} --+ -- /* -- * splice packets from the STA's pending to the local pending, -- * requires a call to ieee80211_agg_splice_finish later --@@ -247,6 +284,7 @@ static void ieee80211_remove_tid_tx(stru -- ieee80211_assign_tid_tx(sta, tid, NULL); -- -- ieee80211_agg_splice_finish(sta->sdata, tid); --+ ieee80211_agg_start_txq(sta, tid, false); -- -- kfree_rcu(tid_tx, rcu_head); -- } --@@ -418,6 +456,8 @@ void ieee80211_tx_ba_session_handle_star -- */ -- clear_bit(HT_AGG_STATE_WANT_START, &tid_tx->state); -- --+ ieee80211_agg_stop_txq(sta, tid); --+ -- /* -- * Make sure no packets are being processed. This ensures that -- * we have a valid starting sequence number and that in-flight --@@ -440,6 +480,8 @@ void ieee80211_tx_ba_session_handle_star -- ieee80211_agg_splice_finish(sdata, tid); -- spin_unlock_bh(&sta->lock); -- --+ ieee80211_agg_start_txq(sta, tid, false); --+ -- kfree_rcu(tid_tx, rcu_head); -- return; -- } --@@ -666,6 +708,8 @@ static void ieee80211_agg_tx_operational -- ieee80211_agg_splice_finish(sta->sdata, tid); -- -- spin_unlock_bh(&sta->lock); --+ --+ ieee80211_agg_start_txq(sta, tid, true); -- } -- -- 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 ---- /dev/null -+++ b/package/kernel/mac80211/patches/301-ath9k-limit-retries-for-powersave-response-frames.patch -@@ -0,0 +1,121 @@ -+From: Felix Fietkau -+Date: Thu, 2 Jul 2015 15:20:56 +0200 -+Subject: [PATCH] ath9k: limit retries for powersave response frames -+ -+In some cases, the channel might be busy enough that an ath9k AP's -+response to PS-Poll frames might be too slow and the station has already -+gone to sleep. To avoid wasting too much airtime on this, limit the -+number of retries on such frames and ensure that no sample rate gets -+used. -+ -+Signed-off-by: Felix Fietkau -+--- -+ -+--- 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_ -+ } -+ -+ static void ath_set_rates(struct ieee80211_vif *vif, struct ieee80211_sta *sta, -+- struct ath_buf *bf) -++ struct ath_buf *bf, bool ps) -+ { -++ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(bf->bf_mpdu); -++ -++ if (ps) { -++ /* Clear the first rate to avoid using a sample rate for PS frames */ -++ info->control.rates[0].idx = -1; -++ info->control.rates[0].count = 0; -++ } -++ -+ ieee80211_get_tx_rates(vif, sta, bf->bf_mpdu, bf->rates, -+ ARRAY_SIZE(bf->rates)); -++ if (!ps) -++ return; -++ -++ if (bf->rates[0].count > 2) -++ bf->rates[0].count = 2; -++ -++ bf->rates[1].idx = -1; -+ } -+ -+ 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, -+ if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) -+ break; -+ -+- ath_set_rates(tid->an->vif, tid->an->sta, bf); -++ ath_set_rates(tid->an->vif, tid->an->sta, bf, false); -+ } while (1); -+ } -+ -+@@ -1461,7 +1476,7 @@ static bool ath_tx_sched_aggr(struct ath -+ return false; -+ } -+ -+- ath_set_rates(tid->an->vif, tid->an->sta, bf); -++ ath_set_rates(tid->an->vif, tid->an->sta, bf, false); -+ 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 -+ -+ __skb_unlink(bf->bf_mpdu, tid_q); -+ list_add_tail(&bf->list, &bf_q); -+- ath_set_rates(tid->an->vif, tid->an->sta, bf); -++ ath_set_rates(tid->an->vif, tid->an->sta, bf, true); -+ 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 -+ struct ath_txq *txq = txctl->txq; -+ struct ath_atx_tid *tid = NULL; -+ struct ath_buf *bf; -+- bool queue, skip_uapsd = false, ps_resp; -++ bool queue, ps_resp; -+ int q, ret; -+ -+ if (vif) -+@@ -2365,13 +2380,13 @@ int ath_tx_start(struct ieee80211_hw *hw -+ if (!txctl->an) -+ txctl->an = &avp->mcast_node; -+ queue = true; -+- skip_uapsd = true; -++ ps_resp = false; -+ } -+ -+ if (txctl->an && queue) -+ tid = ath_get_skb_tid(sc, txctl->an, skb); -+ -+- if (!skip_uapsd && ps_resp) { -++ if (ps_resp) { -+ 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 -+ if (txctl->paprd) -+ bf->bf_state.bfs_paprd_timestamp = jiffies; -+ -+- ath_set_rates(vif, sta, bf); -++ ath_set_rates(vif, sta, bf, ps_resp); -+ ath_tx_send_normal(sc, txq, tid, skb); -+ -+ out: -+@@ -2448,7 +2463,7 @@ void ath_tx_cabq(struct ieee80211_hw *hw -+ break; -+ -+ bf->bf_lastbf = bf; -+- ath_set_rates(vif, NULL, bf); -++ ath_set_rates(vif, NULL, bf, false); -+ 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 -+ return -EINVAL; -+ } -+ -+- ath_set_rates(sc->tx99_vif, NULL, bf); -++ ath_set_rates(sc->tx99_vif, NULL, bf, false); -+ -+ ath9k_hw_set_desc_link(sc->sc_ah, bf->bf_desc, bf->bf_daddr); -+ ath9k_hw_tx99_start(sc->sc_ah, txctl->txq->axq_qnum); -diff --git a/package/kernel/mac80211/patches/301-mac80211-lock-rate-control.patch b/package/kernel/mac80211/patches/301-mac80211-lock-rate-control.patch -deleted file mode 100644 -index 465d943..0000000 ---- a/package/kernel/mac80211/patches/301-mac80211-lock-rate-control.patch -+++ /dev/null -@@ -1,125 +0,0 @@ --From: Johannes Berg --Date: Wed, 11 Mar 2015 09:14:15 +0100 --Subject: [PATCH] mac80211: lock rate control -- --Both minstrel (reported by Sven Eckelmann) and the iwlwifi rate --control aren't properly taking concurrency into account. It's --likely that the same is true for other rate control algorithms. -- --In the case of minstrel this manifests itself in crashes when an --update and other data access are run concurrently, for example --when the stations change bandwidth or similar. In iwlwifi, this --can cause firmware crashes. -- --Since fixing all rate control algorithms will be very difficult, --just provide locking for invocations. This protects the internal --data structures the algorithms maintain. -- --I've manipulated hostapd to test this, by having it change its --advertised bandwidth roughly ever 150ms. At the same time, I'm --running a flood ping between the client and the AP, which causes --this race of update vs. get_rate/status to easily happen on the --client. With this change, the system survives this test. -- --Reported-by: Sven Eckelmann --Signed-off-by: Johannes Berg ----- -- ----- a/net/mac80211/rate.c --+++ b/net/mac80211/rate.c --@@ -683,7 +683,13 @@ void rate_control_get_rate(struct ieee80 -- if (sdata->local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL) -- return; -- --- ref->ops->get_rate(ref->priv, ista, priv_sta, txrc); --+ if (ista) { --+ spin_lock_bh(&sta->rate_ctrl_lock); --+ ref->ops->get_rate(ref->priv, ista, priv_sta, txrc); --+ spin_unlock_bh(&sta->rate_ctrl_lock); --+ } else { --+ ref->ops->get_rate(ref->priv, NULL, NULL, txrc); --+ } -- -- if (sdata->local->hw.flags & IEEE80211_HW_SUPPORTS_RC_TABLE) -- return; ----- a/net/mac80211/rate.h --+++ b/net/mac80211/rate.h --@@ -42,10 +42,12 @@ static inline void rate_control_tx_statu -- if (!ref || !test_sta_flag(sta, WLAN_STA_RATE_CONTROL)) -- return; -- --+ spin_lock_bh(&sta->rate_ctrl_lock); -- if (ref->ops->tx_status) -- ref->ops->tx_status(ref->priv, sband, ista, priv_sta, skb); -- else -- ref->ops->tx_status_noskb(ref->priv, sband, ista, priv_sta, info); --+ spin_unlock_bh(&sta->rate_ctrl_lock); -- } -- -- static inline void --@@ -64,7 +66,9 @@ rate_control_tx_status_noskb(struct ieee -- if (WARN_ON_ONCE(!ref->ops->tx_status_noskb)) -- return; -- --+ spin_lock_bh(&sta->rate_ctrl_lock); -- ref->ops->tx_status_noskb(ref->priv, sband, ista, priv_sta, info); --+ spin_unlock_bh(&sta->rate_ctrl_lock); -- } -- -- static inline void rate_control_rate_init(struct sta_info *sta) --@@ -91,8 +95,10 @@ static inline void rate_control_rate_ini -- -- 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); -- } --@@ -115,18 +121,20 @@ static inline void rate_control_rate_upd -- 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); -- } -- -- static inline void *rate_control_alloc_sta(struct rate_control_ref *ref, --- struct ieee80211_sta *sta, --- gfp_t gfp) --+ struct sta_info *sta, gfp_t gfp) -- { --- return ref->ops->alloc_sta(ref->priv, sta, gfp); --+ spin_lock_init(&sta->rate_ctrl_lock); --+ return ref->ops->alloc_sta(ref->priv, &sta->sta, gfp); -- } -- -- static inline void rate_control_free_sta(struct sta_info *sta) ----- a/net/mac80211/sta_info.c --+++ b/net/mac80211/sta_info.c --@@ -286,7 +286,7 @@ static int sta_prepare_rate_control(stru -- -- sta->rate_ctrl = local->rate_ctrl; -- sta->rate_ctrl_priv = rate_control_alloc_sta(sta->rate_ctrl, --- &sta->sta, gfp); --+ sta, gfp); -- if (!sta->rate_ctrl_priv) -- return -ENOMEM; -- ----- a/net/mac80211/sta_info.h --+++ b/net/mac80211/sta_info.h --@@ -349,6 +349,7 @@ struct sta_info { -- u8 ptk_idx; -- struct rate_control_ref *rate_ctrl; -- void *rate_ctrl_priv; --+ spinlock_t rate_ctrl_lock; -- 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 ---- a/package/kernel/mac80211/patches/302-ath9k-restart-only-triggering-DFS-detector-line.patch -+++ /dev/null -@@ -1,21 +0,0 @@ --From: Zefir Kurtisi --Date: Tue, 10 Mar 2015 17:49:29 +0100 --Subject: [PATCH] ath9k: restart only triggering DFS detector line -- --To support HT40 DFS mode, a triggering detector must --reset only itself but not other detector lines. -- --Signed-off-by: Zefir Kurtisi ----- -- ----- a/drivers/net/wireless/ath/dfs_pattern_detector.c --+++ b/drivers/net/wireless/ath/dfs_pattern_detector.c --@@ -289,7 +289,7 @@ dpd_add_pulse(struct dfs_pattern_detecto -- "count=%d, count_false=%d\n", -- event->freq, pd->rs->type_id, -- ps->pri, ps->count, ps->count_falses); --- channel_detector_reset(dpd, cd); --+ pd->reset(pd, dpd->last_pulse_ts); -- return true; -- } -- } -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 ---- a/package/kernel/mac80211/patches/303-ath9k-add-DFS-support-for-extension-channel.patch -+++ /dev/null -@@ -1,76 +0,0 @@ --From: Zefir Kurtisi --Date: Tue, 10 Mar 2015 17:49:30 +0100 --Subject: [PATCH] ath9k: add DFS support for extension channel -- --In HT40 modes, pulse events on primary and extension --channel are processed individually. If valid, a pulse --event will be fed into the detector --* for primary frequency, or --* for extension frequency (+/-20MHz based on HT40-mode) --* or both -- --With that, a 40MHz radar will result in two individual --radar events. -- --Signed-off-by: Zefir Kurtisi ----- -- ----- a/drivers/net/wireless/ath/ath9k/dfs.c --+++ b/drivers/net/wireless/ath/ath9k/dfs.c --@@ -126,8 +126,19 @@ ath9k_postprocess_radar_event(struct ath -- DFS_STAT_INC(sc, pulses_detected); -- return true; -- } ---#undef PRI_CH_RADAR_FOUND ---#undef EXT_CH_RADAR_FOUND --+ --+static void --+ath9k_dfs_process_radar_pulse(struct ath_softc *sc, struct pulse_event *pe) --+{ --+ struct dfs_pattern_detector *pd = sc->dfs_detector; --+ DFS_STAT_INC(sc, pulses_processed); --+ if (pd == NULL) --+ return; --+ if (!pd->add_pulse(pd, pe)) --+ return; --+ DFS_STAT_INC(sc, radar_detected); --+ ieee80211_radar_detected(sc->hw); --+} -- -- /* -- * DFS: check PHY-error for radar pulse and feed the detector --@@ -176,18 +187,21 @@ void ath9k_dfs_process_phyerr(struct ath -- ard.pulse_length_pri = vdata_end[-3]; -- pe.freq = ah->curchan->channel; -- pe.ts = mactime; --- if (ath9k_postprocess_radar_event(sc, &ard, &pe)) { --- struct dfs_pattern_detector *pd = sc->dfs_detector; --- ath_dbg(common, DFS, --- "ath9k_dfs_process_phyerr: channel=%d, ts=%llu, " --- "width=%d, rssi=%d, delta_ts=%llu\n", --- pe.freq, pe.ts, pe.width, pe.rssi, --- pe.ts - sc->dfs_prev_pulse_ts); --- sc->dfs_prev_pulse_ts = pe.ts; --- DFS_STAT_INC(sc, pulses_processed); --- if (pd != NULL && pd->add_pulse(pd, &pe)) { --- DFS_STAT_INC(sc, radar_detected); --- ieee80211_radar_detected(sc->hw); --- } --+ if (!ath9k_postprocess_radar_event(sc, &ard, &pe)) --+ return; --+ --+ ath_dbg(common, DFS, --+ "ath9k_dfs_process_phyerr: type=%d, freq=%d, ts=%llu, " --+ "width=%d, rssi=%d, delta_ts=%llu\n", --+ ard.pulse_bw_info, pe.freq, pe.ts, pe.width, pe.rssi, --+ pe.ts - sc->dfs_prev_pulse_ts); --+ sc->dfs_prev_pulse_ts = pe.ts; --+ if (ard.pulse_bw_info & PRI_CH_RADAR_FOUND) --+ ath9k_dfs_process_radar_pulse(sc, &pe); --+ if (ard.pulse_bw_info & EXT_CH_RADAR_FOUND) { --+ pe.freq += IS_CHAN_HT40PLUS(ah->curchan) ? 20 : -20; --+ ath9k_dfs_process_radar_pulse(sc, &pe); -- } -- } --+#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 -new file mode 100644 -index 0000000..139015c ---- /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 -+ -+Signed-off-by: Felix Fietkau -+--- -+ -+--- 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); -+ -+ if (ath9k_ps_enable) -+ ieee80211_hw_set(hw, SUPPORTS_PS); -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 ---- a/package/kernel/mac80211/patches/304-ath9k-allow-40MHz-radar-detection-width.patch -+++ /dev/null -@@ -1,19 +0,0 @@ --From: Zefir Kurtisi --Date: Tue, 10 Mar 2015 17:49:31 +0100 --Subject: [PATCH] ath9k: allow 40MHz radar detection width -- --Signed-off-by: Zefir Kurtisi ----- -- ----- a/drivers/net/wireless/ath/ath9k/init.c --+++ b/drivers/net/wireless/ath/ath9k/init.c --@@ -763,7 +763,8 @@ static const struct ieee80211_iface_comb -- .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_20) | --+ BIT(NL80211_CHAN_WIDTH_40), -- } -- #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 -new file mode 100644 -index 0000000..9f04276 ---- /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 -+ -+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. -+ -+Signed-off-by: Felix Fietkau -+--- -+ -+--- 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; -+ } -+ } -+ -+@@ -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]; -+ } -+ } -+ -+ 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; -+ -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 ---- a/package/kernel/mac80211/patches/305-ath5k-channel-change-fix.patch -+++ /dev/null -@@ -1,137 +0,0 @@ --From: Sergey Ryazanov --Date: Wed, 4 Mar 2015 05:12:10 +0300 --Subject: [PATCH] ath5k: channel change fix -- --ath5k updates the channel pointer and after that it stops the Rx logic --and apply channel to HW. In case of channel switch, such sequence --creates a small window when a frame, which is received on the old --channel is considered as a frame received on the new one. -- --The most notable consequence of this situation occurs during the switch --from 2 GHz band (CCK+OFDM) to the 5GHz band (OFDM-only). Frame received --with CCK rate, e.g. beacon received at the 1mbps, causes the following --warning: -- -- WARNING: at ath5k/base.c:589 ath5k_tasklet_rx+0x318/0x6ec [ath5k]() -- invalid hw_rix: 1a -- [..] -- Call Trace: -- [<802656a8>] show_stack+0x48/0x70 -- [<802dd92c>] warn_slowpath_common+0x88/0xbc -- [<802dd98c>] warn_slowpath_fmt+0x2c/0x38 -- [<81b51be8>] ath5k_tasklet_rx+0x318/0x6ec [ath5k] -- [<8028ac64>] tasklet_action+0x8c/0xf0 -- [<80075804>] __do_softirq+0x180/0x32c -- [<80196ce8>] irq_exit+0x54/0x70 -- [<80041848>] ret_from_irq+0x0/0x4 -- [<80182fdc>] ioread32+0x4/0xc -- [<81b4c42c>] ath5k_hw_set_sleep_clock+0x2ec/0x474 [ath5k] -- [<81b4cf28>] ath5k_hw_reset+0x50/0xeb8 [ath5k] -- [<81b50900>] ath5k_reset+0xd4/0x310 [ath5k] -- [<81b557e8>] ath5k_config+0x4c/0x104 [ath5k] -- [<80d01770>] ieee80211_hw_config+0x2f4/0x35c [mac80211] -- [<80d09aa8>] ieee80211_scan_work+0x2e4/0x414 [mac80211] -- [<8022c3f4>] process_one_work+0x28c/0x400 -- [<802df8f8>] worker_thread+0x258/0x3c0 -- [<801b5710>] kthread+0xe0/0xec -- [<800418a8>] ret_from_kernel_thread+0x14/0x1c -- --The easiest way to reproduce this warning is to run scan with dualband --NIC in noisy environments, when the channel 11 runs multiple APs. In my --tests if the APs num >= 12, the warning appears in the first few --seconds of scanning. -- --In order to fix this, the Rx disable code moved to a higher level and --placed before the channel pointer update. This is also makes the code a --bit more symmetrical, since we disable and enable the Rx in the same --function. -- --In fact, at the pointer update time new frames should not appear, --because interrupt generation at this point should already be disabled. --The next patch should address this issue. -- --CC: Jiri Slaby --CC: Nick Kossifidis --CC: Luis R. Rodriguez --Reported-by: Christophe Prevotaux --Tested-by: Christophe Prevotaux --Tested-by: Eric Bree --Signed-off-by: Sergey Ryazanov ----- -- ----- a/drivers/net/wireless/ath/ath5k/base.c --+++ b/drivers/net/wireless/ath/ath5k/base.c --@@ -2858,7 +2858,7 @@ ath5k_reset(struct ath5k_hw *ah, struct -- { -- struct ath_common *common = ath5k_hw_common(ah); -- int ret, ani_mode; --- bool fast; --+ bool fast = chan && modparam_fastchanswitch ? 1 : 0; -- -- ATH5K_DBG(ah, ATH5K_DEBUG_RESET, "resetting\n"); -- --@@ -2876,11 +2876,29 @@ ath5k_reset(struct ath5k_hw *ah, struct -- * so we should also free any remaining -- * tx buffers */ -- ath5k_drain_tx_buffs(ah); --+ --+ /* Stop PCU */ --+ ath5k_hw_stop_rx_pcu(ah); --+ --+ /* Stop DMA --+ * --+ * Note: If DMA didn't stop continue --+ * since only a reset will fix it. --+ */ --+ ret = ath5k_hw_dma_stop(ah); --+ --+ /* RF Bus grant won't work if we have pending --+ * frames --+ */ --+ if (ret && fast) { --+ ATH5K_DBG(ah, ATH5K_DEBUG_RESET, --+ "DMA didn't stop, falling back to normal reset\n"); --+ fast = false; --+ } --+ -- if (chan) -- ah->curchan = chan; -- --- fast = ((chan != NULL) && modparam_fastchanswitch) ? 1 : 0; --- -- ret = ath5k_hw_reset(ah, ah->opmode, ah->curchan, fast, skip_pcu); -- if (ret) { -- ATH5K_ERR(ah, "can't reset hardware (%d)\n", ret); ----- a/drivers/net/wireless/ath/ath5k/reset.c --+++ b/drivers/net/wireless/ath/ath5k/reset.c --@@ -1169,30 +1169,6 @@ ath5k_hw_reset(struct ath5k_hw *ah, enum -- if (ah->ah_version == AR5K_AR5212) -- ath5k_hw_set_sleep_clock(ah, false); -- --- /* --- * Stop PCU --- */ --- ath5k_hw_stop_rx_pcu(ah); --- --- /* --- * Stop DMA --- * --- * Note: If DMA didn't stop continue --- * since only a reset will fix it. --- */ --- ret = ath5k_hw_dma_stop(ah); --- --- /* RF Bus grant won't work if we have pending --- * frames */ --- if (ret && fast) { --- ATH5K_DBG(ah, ATH5K_DEBUG_RESET, --- "DMA didn't stop, falling back to normal reset\n"); --- fast = false; --- /* Non fatal, just continue with --- * normal reset */ --- ret = 0; --- } --- -- 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 -new file mode 100644 -index 0000000..ec860dc ---- /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 -+ -+Use list_empty(&tid->list) instead -+ -+Signed-off-by: Felix Fietkau -+--- -+ -+--- 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 */ -+ -+ 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; -+ -+- if (tid->sched) -+- 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); -+ } -+ -+ static struct ath_frame_info *get_frame_info(struct sk_buff *skb) -+@@ -1556,15 +1553,14 @@ void ath_tx_aggr_sleep(struct ieee80211_ -+ -+ ath_txq_lock(sc, txq); -+ -+- if (!tid->sched) { -++ if (list_empty(&tid->list)) { -+ ath_txq_unlock(sc, txq); -+ continue; -+ } -+ -+ buffered = ath_tid_has_buffered(tid); -+ -+- tid->sched = false; -+- list_del(&tid->list); -++ list_del_init(&tid->list); -+ -+ ath_txq_unlock(sc, txq); -+ -+@@ -1944,8 +1940,7 @@ void ath_txq_schedule(struct ath_softc * -+ break; -+ -+ tid = list_first_entry(tid_list, struct ath_atx_tid, list); -+- list_del(&tid->list); -+- tid->sched = false; -++ list_del_init(&tid->list); -+ -+ 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 ---- a/package/kernel/mac80211/patches/306-ath5k-fix-reset-race.patch -+++ /dev/null -@@ -1,96 +0,0 @@ --From: Sergey Ryazanov --Date: Wed, 4 Mar 2015 05:12:11 +0300 --Subject: [PATCH] ath5k: fix reset race -- --To prepare for reset ath5k should finish all asynchronous tasks. At --first, it disables the interrupt generation, then it waits for the --interrupt handler and tasklets completion, and then proceeds to the HW --configuration update. But it does not consider that the interrupt --handler or tasklet re-enables the interrupt generation. And we fall in a --situation when ath5k assumes that interrupts are disabled, but it is --not. -- --This can lead to different consequences, such as reception of the frame, --when we do not expect it. Under certain circumstances, this can lead to --the following warning: -- -- WARNING: at ath5k/base.c:589 ath5k_tasklet_rx+0x318/0x6ec [ath5k]() -- invalid hw_rix: 1a -- [..] -- Call Trace: -- [<802656a8>] show_stack+0x48/0x70 -- [<802dd92c>] warn_slowpath_common+0x88/0xbc -- [<802dd98c>] warn_slowpath_fmt+0x2c/0x38 -- [<81b51be8>] ath5k_tasklet_rx+0x318/0x6ec [ath5k] -- [<8028ac64>] tasklet_action+0x8c/0xf0 -- [<80075804>] __do_softirq+0x180/0x32c -- [<80196ce8>] irq_exit+0x54/0x70 -- [<80041848>] ret_from_irq+0x0/0x4 -- [<80182fdc>] ioread32+0x4/0xc -- [<81b4c42c>] ath5k_hw_set_sleep_clock+0x2ec/0x474 [ath5k] -- [<81b4cf28>] ath5k_hw_reset+0x50/0xeb8 [ath5k] -- [<81b50900>] ath5k_reset+0xd4/0x310 [ath5k] -- [<81b557e8>] ath5k_config+0x4c/0x104 [ath5k] -- [<80d01770>] ieee80211_hw_config+0x2f4/0x35c [mac80211] -- [<80d09aa8>] ieee80211_scan_work+0x2e4/0x414 [mac80211] -- [<8022c3f4>] process_one_work+0x28c/0x400 -- [<802df8f8>] worker_thread+0x258/0x3c0 -- [<801b5710>] kthread+0xe0/0xec -- [<800418a8>] ret_from_kernel_thread+0x14/0x1c -- --Fix this issue by adding a new status flag, which forbids to re-enable --the interrupt generation until the HW configuration is completed. -- --Note: previous patch, which reorders the Rx disable code helps to avoid --the above warning, but not fixes the root cause of unexpected frame --receiving. -- --CC: Jiri Slaby --CC: Nick Kossifidis --CC: Luis R. Rodriguez --Reported-by: Christophe Prevotaux --Tested-by: Christophe Prevotaux --Tested-by: Eric Bree --Signed-off-by: Sergey Ryazanov ----- -- ----- a/drivers/net/wireless/ath/ath5k/ath5k.h --+++ b/drivers/net/wireless/ath/ath5k/ath5k.h --@@ -1283,6 +1283,7 @@ struct ath5k_hw { -- #define ATH_STAT_PROMISC 1 -- #define ATH_STAT_LEDSOFT 2 /* enable LED gpio status */ -- #define ATH_STAT_STARTED 3 /* opened & irqs enabled */ --+#define ATH_STAT_RESET 4 /* hw reset */ -- -- unsigned int filter_flags; /* HW flags, AR5K_RX_FILTER_* */ -- unsigned int fif_filter_flags; /* Current FIF_* filter flags */ ----- a/drivers/net/wireless/ath/ath5k/base.c --+++ b/drivers/net/wireless/ath/ath5k/base.c --@@ -1523,6 +1523,9 @@ ath5k_set_current_imask(struct ath5k_hw -- enum ath5k_int imask; -- unsigned long flags; -- --+ if (test_bit(ATH_STAT_RESET, ah->status)) --+ return; --+ -- spin_lock_irqsave(&ah->irqlock, flags); -- imask = ah->imask; -- if (ah->rx_pending) --@@ -2862,6 +2865,8 @@ ath5k_reset(struct ath5k_hw *ah, struct -- -- ATH5K_DBG(ah, ATH5K_DEBUG_RESET, "resetting\n"); -- --+ __set_bit(ATH_STAT_RESET, ah->status); --+ -- ath5k_hw_set_imr(ah, 0); -- synchronize_irq(ah->irq); -- ath5k_stop_tasklets(ah); --@@ -2952,6 +2957,8 @@ ath5k_reset(struct ath5k_hw *ah, struct -- */ -- /* ath5k_chan_change(ah, c); */ -- --+ __clear_bit(ATH_STAT_RESET, ah->status); --+ -- 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 -new file mode 100644 -index 0000000..928c93b ---- /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 -+ -+With this .config: http://busybox.net/~vda/kernel_config, -+after deinlining these functions have sizes and callsite counts -+as follows: -+ -+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 -+--- -+ -+--- 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"); -+ -++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) -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 ---- a/package/kernel/mac80211/patches/307-ath9k-fix-tracking-of-enabled-AP-beacons.patch -+++ /dev/null -@@ -1,76 +0,0 @@ --From: Felix Fietkau --Date: Thu, 12 Mar 2015 17:10:50 +0100 --Subject: [PATCH] ath9k: fix tracking of enabled AP beacons -- --sc->nbcnvifs tracks assigned beacon slots, not enabled beacons. --Therefore, it cannot be used to decide if cur_conf->enable_beacon (bool) --should be updated, or if beacons have been enabled already. --With the current code (depending on the order of calls), beacons often --do not get enabled in an AP+STA setup. --To fix tracking of enabled beacons, convert cur_conf->enable_beacon to a --bitmask of enabled beacon slots. -- --Cc: stable@vger.kernel.org --Signed-off-by: Felix Fietkau ----- -- ----- a/drivers/net/wireless/ath/ath9k/beacon.c --+++ b/drivers/net/wireless/ath/ath9k/beacon.c --@@ -219,12 +219,15 @@ void ath9k_beacon_remove_slot(struct ath -- struct ath_common *common = ath9k_hw_common(sc->sc_ah); -- struct ath_vif *avp = (void *)vif->drv_priv; -- struct ath_buf *bf = avp->av_bcbuf; --+ struct ath_beacon_config *cur_conf = &sc->cur_chan->beacon; -- -- ath_dbg(common, CONFIG, "Removing interface at beacon slot: %d\n", -- avp->av_bslot); -- -- tasklet_disable(&sc->bcon_tasklet); -- --+ cur_conf->enable_beacon &= ~BIT(avp->av_bslot); --+ -- if (bf && bf->bf_mpdu) { -- struct sk_buff *skb = bf->bf_mpdu; -- dma_unmap_single(sc->dev, bf->bf_buf_addr, --@@ -521,8 +524,7 @@ static bool ath9k_allow_beacon_config(st -- } -- -- if (sc->sc_ah->opmode == NL80211_IFTYPE_AP) { --- if ((vif->type != NL80211_IFTYPE_AP) || --- (sc->nbcnvifs > 1)) { --+ if (vif->type != NL80211_IFTYPE_AP) { -- ath_dbg(common, CONFIG, -- "An AP interface is already present !\n"); -- return false; --@@ -616,12 +618,14 @@ void ath9k_beacon_config(struct ath_soft -- * enabling/disabling SWBA. -- */ -- if (changed & BSS_CHANGED_BEACON_ENABLED) { --- if (!bss_conf->enable_beacon && --- (sc->nbcnvifs <= 1)) { --- cur_conf->enable_beacon = false; --- } else if (bss_conf->enable_beacon) { --- cur_conf->enable_beacon = true; --- ath9k_cache_beacon_config(sc, ctx, bss_conf); --+ bool enabled = cur_conf->enable_beacon; --+ --+ if (!bss_conf->enable_beacon) { --+ cur_conf->enable_beacon &= ~BIT(avp->av_bslot); --+ } else { --+ cur_conf->enable_beacon |= BIT(avp->av_bslot); --+ if (!enabled) --+ ath9k_cache_beacon_config(sc, ctx, bss_conf); -- } -- } -- ----- a/drivers/net/wireless/ath/ath9k/common.h --+++ b/drivers/net/wireless/ath/ath9k/common.h --@@ -54,7 +54,7 @@ struct ath_beacon_config { -- u16 dtim_period; -- u16 bmiss_timeout; -- u8 dtim_count; --- bool enable_beacon; --+ u8 enable_beacon; -- 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 -new file mode 100644 -index 0000000..474c409 ---- /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 -+ -+With this .config: http://busybox.net/~vda/kernel_config, -+after deinlining the function size is 3132 bytes and there are -+7 callsites. -+ -+Total size reduction: about 20 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 -+--- -+ 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); -++ } -++ 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); -+ } -+ -+-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); -+ -+ 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 ---- a/package/kernel/mac80211/patches/308-mac80211-minstrel_ht-fix-rounding-issue-in-MCS-durat.patch -+++ /dev/null -@@ -1,43 +0,0 @@ --From: Felix Fietkau --Date: Fri, 13 Mar 2015 10:49:40 +0100 --Subject: [PATCH] mac80211: minstrel_ht: fix rounding issue in MCS duration -- calculation -- --On very high MCS bitrates, the calculated duration of rates that are --next to each other can be very imprecise, due to the small packet size --used as reference (1200 bytes). --This is most visible in VHT80 nss=2 MCS8/9, for which minstrel shows the --same throughput when the probability is also the same. This leads to a --bad rate selection for such rates. -- --Fix this issue by introducing an average A-MPDU size factor into the --calculation. -- --Signed-off-by: Felix Fietkau ----- -- ----- a/net/mac80211/rc80211_minstrel_ht.c --+++ b/net/mac80211/rc80211_minstrel_ht.c --@@ -17,10 +17,11 @@ -- #include "rc80211_minstrel.h" -- #include "rc80211_minstrel_ht.h" -- --+#define AVG_AMPDU_SIZE 16 -- #define AVG_PKT_SIZE 1200 -- -- /* Number of bits for an average sized packet */ ---#define MCS_NBITS (AVG_PKT_SIZE << 3) --+#define MCS_NBITS ((AVG_PKT_SIZE * AVG_AMPDU_SIZE) << 3) -- -- /* Number of symbols for a packet with (bps) bits per symbol */ -- #define MCS_NSYMS(bps) DIV_ROUND_UP(MCS_NBITS, (bps)) --@@ -33,7 +34,8 @@ -- ) -- -- /* Transmit duration for the raw data part of an average sized packet */ ---#define MCS_DURATION(streams, sgi, bps) MCS_SYMBOL_TIME(sgi, MCS_NSYMS((streams) * (bps))) --+#define MCS_DURATION(streams, sgi, bps) \ --+ (MCS_SYMBOL_TIME(sgi, MCS_NSYMS((streams) * (bps))) / AVG_AMPDU_SIZE) -- -- #define BW_20 0 -- #define BW_40 1 -diff --git a/package/kernel/mac80211/patches/309-ath9k-disable-TPC-support-again-for-now.patch b/package/kernel/mac80211/patches/309-ath9k-disable-TPC-support-again-for-now.patch -deleted file mode 100644 -index 945fbce..0000000 ---- a/package/kernel/mac80211/patches/309-ath9k-disable-TPC-support-again-for-now.patch -+++ /dev/null -@@ -1,22 +0,0 @@ --From: Felix Fietkau --Date: Sun, 15 Mar 2015 08:02:37 +0100 --Subject: [PATCH] ath9k: disable TPC support again (for now) -- --TPC support has been observed to cause some tx power fluctuations on --some devices with at least AR934x and AR938x chips. --Disable it for now until the bugs have been found and fixed -- --Signed-off-by: Felix Fietkau ----- -- ----- a/drivers/net/wireless/ath/ath9k/hw.c --+++ b/drivers/net/wireless/ath/ath9k/hw.c --@@ -424,7 +424,7 @@ static void ath9k_hw_init_defaults(struc -- ah->power_mode = ATH9K_PM_UNDEFINED; -- ah->htc_reset_init = true; -- --- ah->tpc_enabled = true; --+ ah->tpc_enabled = false; -- -- 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 -new file mode 100644 -index 0000000..e8e9617 ---- /dev/null -+++ b/package/kernel/mac80211/patches/309-mac80211-make-local-tx_headroom-a-multiple-of-4.patch -@@ -0,0 +1,20 @@ -+From: Felix Fietkau -+Date: Thu, 30 Jul 2015 14:12:25 +0200 -+Subject: [PATCH] mac80211: make local->tx_headroom a multiple of 4 -+ -+This ensures that mac80211 generated management frames and beacons are -+aligned before being passed to the driver -+ -+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); -+ -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 ---- a/package/kernel/mac80211/patches/310-mac80211-don-t-look-up-stations-for-multicast-addres.patch -+++ /dev/null -@@ -1,21 +0,0 @@ --From: Johannes Berg --Date: Tue, 24 Feb 2015 00:28:18 +0100 --Subject: [PATCH] mac80211: don't look up stations for multicast addresses -- --Since multicast addresses don't exist as stations, don't attempt --to look them up in the hashtable on TX. -- --Signed-off-by: Johannes Berg ----- -- ----- a/net/mac80211/tx.c --+++ b/net/mac80211/tx.c --@@ -1161,7 +1161,7 @@ ieee80211_tx_prepare(struct ieee80211_su -- tx->sdata->control_port_protocol == tx->skb->protocol) { -- tx->sta = sta_info_get_bss(sdata, hdr->addr1); -- } --- if (!tx->sta) --+ if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) -- 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 -new file mode 100644 -index 0000000..51a315c ---- /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() -+ -+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 -+--- -+ -+--- 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; -+ -+- 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; -+ } -+ -+ 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; -+- -+- 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); -+ -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 ---- a/package/kernel/mac80211/patches/311-mac80211-remove-drop_unencrypted-code.patch -+++ /dev/null -@@ -1,130 +0,0 @@ --From: Johannes Berg --Date: Fri, 20 Mar 2015 11:41:58 +0100 --Subject: [PATCH] mac80211: remove drop_unencrypted code -- --This mechanism was historic, and only ever used by IBSS, which --also doesn't need to have it as it properly manages station's --802.1X PAE state (or, with WEP, always has a key.) -- --Remove the mechanism to clean up the code. -- --Signed-off-by: Johannes Berg ----- -- ----- a/net/mac80211/debugfs.c --+++ b/net/mac80211/debugfs.c --@@ -274,8 +274,6 @@ void debugfs_hw_add(struct ieee80211_loc -- #ifdef CPTCFG_MAC80211_DEBUG_COUNTERS -- DEBUGFS_STATS_ADD(tx_handlers_drop, local->tx_handlers_drop); -- DEBUGFS_STATS_ADD(tx_handlers_queued, local->tx_handlers_queued); --- DEBUGFS_STATS_ADD(tx_handlers_drop_unencrypted, --- local->tx_handlers_drop_unencrypted); -- DEBUGFS_STATS_ADD(tx_handlers_drop_fragment, -- local->tx_handlers_drop_fragment); -- DEBUGFS_STATS_ADD(tx_handlers_drop_wep, ----- a/net/mac80211/debugfs_netdev.c --+++ b/net/mac80211/debugfs_netdev.c --@@ -177,7 +177,6 @@ static ssize_t ieee80211_if_write_##name -- IEEE80211_IF_FILE_R(name) -- -- /* common attributes */ ---IEEE80211_IF_FILE(drop_unencrypted, drop_unencrypted, DEC); -- IEEE80211_IF_FILE(rc_rateidx_mask_2ghz, rc_rateidx_mask[IEEE80211_BAND_2GHZ], -- HEX); -- IEEE80211_IF_FILE(rc_rateidx_mask_5ghz, rc_rateidx_mask[IEEE80211_BAND_5GHZ], --@@ -562,7 +561,6 @@ IEEE80211_IF_FILE(dot11MeshAwakeWindowDu -- -- static void add_common_files(struct ieee80211_sub_if_data *sdata) -- { --- DEBUGFS_ADD(drop_unencrypted); -- DEBUGFS_ADD(rc_rateidx_mask_2ghz); -- DEBUGFS_ADD(rc_rateidx_mask_5ghz); -- DEBUGFS_ADD(rc_rateidx_mcs_mask_2ghz); ----- a/net/mac80211/ibss.c --+++ b/net/mac80211/ibss.c --@@ -249,8 +249,6 @@ static void __ieee80211_sta_join_ibss(st -- if (presp) -- kfree_rcu(presp, rcu_head); -- --- sdata->drop_unencrypted = capability & WLAN_CAPABILITY_PRIVACY ? 1 : 0; --- -- /* make a copy of the chandef, it could be modified below. */ -- chandef = *req_chandef; -- chan = chandef.chan; --@@ -1289,8 +1287,6 @@ static void ieee80211_sta_create_ibss(st -- -- if (ifibss->privacy) -- capability |= WLAN_CAPABILITY_PRIVACY; --- else --- sdata->drop_unencrypted = 0; -- -- __ieee80211_sta_join_ibss(sdata, bssid, sdata->vif.bss_conf.beacon_int, -- &ifibss->chandef, ifibss->basic_rates, ----- a/net/mac80211/ieee80211_i.h --+++ b/net/mac80211/ieee80211_i.h --@@ -842,8 +842,6 @@ struct ieee80211_sub_if_data { -- -- unsigned long state; -- --- int drop_unencrypted; --- -- char name[IFNAMSIZ]; -- -- /* Fragment table for host-based reassembly */ --@@ -1289,7 +1287,6 @@ struct ieee80211_local { -- /* TX/RX handler statistics */ -- unsigned int tx_handlers_drop; -- unsigned int tx_handlers_queued; --- unsigned int tx_handlers_drop_unencrypted; -- unsigned int tx_handlers_drop_fragment; -- unsigned int tx_handlers_drop_wep; -- unsigned int tx_handlers_drop_not_assoc; ----- a/net/mac80211/iface.c --+++ b/net/mac80211/iface.c --@@ -1535,7 +1535,6 @@ int ieee80211_if_change_type(struct ieee -- } -- -- /* reset some values that shouldn't be kept across type changes */ --- sdata->drop_unencrypted = 0; -- if (type == NL80211_IFTYPE_STATION) -- sdata->u.mgd.use_4addr = false; -- ----- a/net/mac80211/rx.c --+++ b/net/mac80211/rx.c --@@ -1897,8 +1897,7 @@ static int ieee80211_drop_unencrypted(st -- /* Drop unencrypted frames if key is set. */ -- if (unlikely(!ieee80211_has_protected(fc) && -- !ieee80211_is_nullfunc(fc) && --- ieee80211_is_data(fc) && --- (rx->key || rx->sdata->drop_unencrypted))) --+ ieee80211_is_data(fc) && rx->key)) -- return -EACCES; -- -- return 0; ----- a/net/mac80211/tx.c --+++ b/net/mac80211/tx.c --@@ -594,23 +594,8 @@ ieee80211_tx_h_select_key(struct ieee802 -- else if (!is_multicast_ether_addr(hdr->addr1) && -- (key = rcu_dereference(tx->sdata->default_unicast_key))) -- tx->key = key; --- else if (info->flags & IEEE80211_TX_CTL_INJECTED) --+ else -- tx->key = NULL; --- else if (!tx->sdata->drop_unencrypted) --- tx->key = NULL; --- else if (tx->skb->protocol == tx->sdata->control_port_protocol) --- tx->key = NULL; --- else if (ieee80211_is_robust_mgmt_frame(tx->skb) && --- !(ieee80211_is_action(hdr->frame_control) && --- tx->sta && test_sta_flag(tx->sta, WLAN_STA_MFP))) --- tx->key = NULL; --- else if (ieee80211_is_mgmt(hdr->frame_control) && --- !ieee80211_is_robust_mgmt_frame(tx->skb)) --- tx->key = NULL; --- else { --- I802_DEBUG_INC(tx->local->tx_handlers_drop_unencrypted); --- return TX_DROP; --- } -- -- 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 ---- a/package/kernel/mac80211/patches/312-mac80211-don-t-look-up-destination-station-twice.patch -+++ /dev/null -@@ -1,71 +0,0 @@ --From: Johannes Berg --Date: Fri, 20 Mar 2015 16:24:21 +0100 --Subject: [PATCH] mac80211: don't look up destination station twice -- --There's no need to look up the destination station twice while --building the 802.11 header for a given frame if the frame will --actually be transmitted to the station we initially looked up. -- --This happens for 4-addr VLAN interfaces and TDLS connections, which --both directly send the frame to the station they looked up, though --in the case of TDLS some station conditions need to be checked. -- --To avoid that, add a variable indicating that we've looked up the --station that the frame is going to be transmitted to, and avoid the --lookup/flag checking if it already has been done. -- --In the TDLS case, also move the authorized/wme_sta flag assignment --to the correct place, i.e. only when that station is really used. --Before this change, the new lookup should always have succeeded so --that the potentially erroneous data would be overwritten. -- --Signed-off-by: Johannes Berg ----- -- ----- a/net/mac80211/tx.c --+++ b/net/mac80211/tx.c --@@ -1894,6 +1894,7 @@ static struct sk_buff *ieee80211_build_h -- bool wme_sta = false, authorized = false, tdls_auth = false; -- bool tdls_peer = false, tdls_setup_frame = false; -- bool multicast; --+ bool have_station = false; -- u16 info_id = 0; -- struct ieee80211_chanctx_conf *chanctx_conf; -- struct ieee80211_sub_if_data *ap_sdata; --@@ -1918,6 +1919,7 @@ static struct sk_buff *ieee80211_build_h -- hdrlen = 30; -- authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); -- wme_sta = sta->sta.wme; --+ have_station = true; -- } -- ap_sdata = container_of(sdata->bss, struct ieee80211_sub_if_data, -- u.ap); --@@ -2034,9 +2036,6 @@ static struct sk_buff *ieee80211_build_h -- if (sdata->wdev.wiphy->flags & WIPHY_FLAG_SUPPORTS_TDLS) { -- sta = sta_info_get(sdata, skb->data); -- if (sta) { --- authorized = test_sta_flag(sta, --- WLAN_STA_AUTHORIZED); --- wme_sta = sta->sta.wme; -- tdls_peer = test_sta_flag(sta, -- WLAN_STA_TDLS_PEER); -- tdls_auth = test_sta_flag(sta, --@@ -2068,6 +2067,9 @@ static struct sk_buff *ieee80211_build_h -- memcpy(hdr.addr2, skb->data + ETH_ALEN, ETH_ALEN); -- memcpy(hdr.addr3, sdata->u.mgd.bssid, ETH_ALEN); -- hdrlen = 24; --+ have_station = true; --+ authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); --+ wme_sta = sta->sta.wme; -- } else if (sdata->u.mgd.use_4addr && -- cpu_to_be16(ethertype) != sdata->control_port_protocol) { -- fc |= cpu_to_le16(IEEE80211_FCTL_FROMDS | --@@ -2130,7 +2132,7 @@ static struct sk_buff *ieee80211_build_h -- * in AP mode) -- */ -- multicast = is_multicast_ether_addr(hdr.addr1); --- if (!multicast) { --+ if (!multicast && !have_station) { -- 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 -new file mode 100644 -index 0000000..baee295 ---- /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 -+ -+The interface combination provided by brcmfmac did not truly reflect -+the combinations supported by driver and/or firmware. -+ -+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 -+--- -+ -+--- 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] = -+ } -+ }; -+ -++/** -++ * 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 ---- a/package/kernel/mac80211/patches/313-mac80211-drop-4-addr-VLAN-frames-earlier-if-not-conn.patch -+++ /dev/null -@@ -1,27 +0,0 @@ --From: Johannes Berg --Date: Fri, 20 Mar 2015 16:24:22 +0100 --Subject: [PATCH] mac80211: drop 4-addr VLAN frames earlier if not -- connected -- --If there's no station on the 4-addr VLAN interface, then frames --cannot be transmitted. Drop such frames earlier, before setting --up all the information for them. -- --We should keep the old check though since that code might be used --for other internally-generated frames. -- --Signed-off-by: Johannes Berg ----- -- ----- a/net/mac80211/tx.c --+++ b/net/mac80211/tx.c --@@ -1920,6 +1920,9 @@ static struct sk_buff *ieee80211_build_h -- authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); -- wme_sta = sta->sta.wme; -- have_station = true; --+ } else if (sdata->wdev.use_4addr) { --+ ret = -ENOLINK; --+ goto free; -- } -- 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 -new file mode 100644 -index 0000000..9768ef2 ---- /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 -+ -+Expose ring buffer read/write pointers and other useful statistics -+through debugfs. -+ -+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 -+--- -+ -+--- 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 -+ } -+ } -+ -++#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; -++ -++ 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); -++ } -++ -++ 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: -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 ---- a/package/kernel/mac80211/patches/314-mac80211-mesh-avoid-pointless-station-lookup.patch -+++ /dev/null -@@ -1,33 +0,0 @@ --From: Johannes Berg --Date: Fri, 20 Mar 2015 16:24:23 +0100 --Subject: [PATCH] mac80211: mesh: avoid pointless station lookup -- --In ieee80211_build_hdr(), the station is looked up to build the --header correctly (QoS field) and to check for authorization. For --mesh, authorization isn't checked here, and QoS capability is --mandatory, so the station lookup can be avoided. -- --Signed-off-by: Johannes Berg ----- -- ----- a/net/mac80211/tx.c --+++ b/net/mac80211/tx.c --@@ -2130,12 +2130,14 @@ static struct sk_buff *ieee80211_build_h -- } -- -- /* --- * There's no need to try to look up the destination --- * if it is a multicast address (which can only happen --- * in AP mode) --+ * There's no need to try to look up the destination station --+ * if it is a multicast address. In mesh, there's no need to --+ * look up the station at all as it always must be QoS capable --+ * and mesh mode checks authorization later. -- */ -- multicast = is_multicast_ether_addr(hdr.addr1); --- if (!multicast && !have_station) { --+ if (!multicast && !have_station && --+ !ieee80211_vif_is_mesh(&sdata->vif)) { -- 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 ---- a/package/kernel/mac80211/patches/315-mac80211-avoid-duplicate-TX-path-station-lookup.patch -+++ /dev/null -@@ -1,267 +0,0 @@ --From: Johannes Berg --Date: Fri, 20 Mar 2015 14:18:27 +0100 --Subject: [PATCH] mac80211: avoid duplicate TX path station lookup -- --Instead of looking up the destination station twice in the TX path --(first to build the header, and then for control processing), save --it when building the header and use it later in the TX path. -- --To avoid having to look up the station in the many callers, allow --those to pass %NULL which keeps the existing lookup. -- --Signed-off-by: Johannes Berg ----- -- ----- a/net/mac80211/cfg.c --+++ b/net/mac80211/cfg.c --@@ -3565,7 +3565,7 @@ static int ieee80211_probe_client(struct -- nullfunc->qos_ctrl = cpu_to_le16(7); -- -- local_bh_disable(); --- ieee80211_xmit(sdata, skb); --+ ieee80211_xmit(sdata, sta, skb); -- local_bh_enable(); -- rcu_read_unlock(); -- ----- a/net/mac80211/ieee80211_i.h --+++ b/net/mac80211/ieee80211_i.h --@@ -1775,7 +1775,8 @@ void mac80211_ev_michael_mic_failure(str -- gfp_t gfp); -- void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata, -- bool bss_notify); ---void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb); --+void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, --+ struct sta_info *sta, struct sk_buff *skb); -- -- void __ieee80211_tx_skb_tid_band(struct ieee80211_sub_if_data *sdata, -- struct sk_buff *skb, int tid, ----- a/net/mac80211/sta_info.c --+++ b/net/mac80211/sta_info.c --@@ -1279,7 +1279,7 @@ static void ieee80211_send_null_response -- } -- -- info->band = chanctx_conf->def.chan->band; --- ieee80211_xmit(sdata, skb); --+ ieee80211_xmit(sdata, sta, skb); -- rcu_read_unlock(); -- } -- ----- a/net/mac80211/tx.c --+++ b/net/mac80211/tx.c --@@ -1110,11 +1110,13 @@ static bool ieee80211_tx_prep_agg(struct -- -- /* -- * initialises @tx --+ * pass %NULL for the station if unknown, a valid pointer if known --+ * or an ERR_PTR() if the station is known not to exist -- */ -- static ieee80211_tx_result -- ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata, -- struct ieee80211_tx_data *tx, --- struct sk_buff *skb) --+ struct sta_info *sta, struct sk_buff *skb) -- { -- struct ieee80211_local *local = sdata->local; -- struct ieee80211_hdr *hdr; --@@ -1137,17 +1139,22 @@ ieee80211_tx_prepare(struct ieee80211_su -- -- hdr = (struct ieee80211_hdr *) skb->data; -- --- if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { --- tx->sta = rcu_dereference(sdata->u.vlan.sta); --- if (!tx->sta && sdata->dev->ieee80211_ptr->use_4addr) --- return TX_DROP; --- } else if (info->flags & (IEEE80211_TX_CTL_INJECTED | --- IEEE80211_TX_INTFL_NL80211_FRAME_TX) || --- tx->sdata->control_port_protocol == tx->skb->protocol) { --- tx->sta = sta_info_get_bss(sdata, hdr->addr1); --+ if (likely(sta)) { --+ if (!IS_ERR(sta)) --+ tx->sta = sta; --+ } else { --+ if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { --+ tx->sta = rcu_dereference(sdata->u.vlan.sta); --+ if (!tx->sta && sdata->wdev.use_4addr) --+ return TX_DROP; --+ } else if (info->flags & (IEEE80211_TX_INTFL_NL80211_FRAME_TX | --+ IEEE80211_TX_CTL_INJECTED) || --+ tx->sdata->control_port_protocol == tx->skb->protocol) { --+ tx->sta = sta_info_get_bss(sdata, hdr->addr1); --+ } --+ if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) --+ tx->sta = sta_info_get(sdata, hdr->addr1); -- } --- if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) --- tx->sta = sta_info_get(sdata, hdr->addr1); -- -- if (tx->sta && ieee80211_is_data_qos(hdr->frame_control) && -- !ieee80211_is_qos_nullfunc(hdr->frame_control) && --@@ -1485,7 +1492,7 @@ bool ieee80211_tx_prepare_skb(struct iee -- struct ieee80211_tx_data tx; -- struct sk_buff *skb2; -- --- if (ieee80211_tx_prepare(sdata, &tx, skb) == TX_DROP) --+ if (ieee80211_tx_prepare(sdata, &tx, NULL, skb) == TX_DROP) -- return false; -- -- info->band = band; --@@ -1518,7 +1525,8 @@ EXPORT_SYMBOL(ieee80211_tx_prepare_skb); -- * Returns false if the frame couldn't be transmitted but was queued instead. -- */ -- static bool ieee80211_tx(struct ieee80211_sub_if_data *sdata, --- struct sk_buff *skb, bool txpending) --+ struct sta_info *sta, struct sk_buff *skb, --+ bool txpending) -- { -- struct ieee80211_local *local = sdata->local; -- struct ieee80211_tx_data tx; --@@ -1534,7 +1542,7 @@ static bool ieee80211_tx(struct ieee8021 -- -- /* initialises tx */ -- led_len = skb->len; --- res_prepare = ieee80211_tx_prepare(sdata, &tx, skb); --+ res_prepare = ieee80211_tx_prepare(sdata, &tx, sta, skb); -- -- if (unlikely(res_prepare == TX_DROP)) { -- ieee80211_free_txskb(&local->hw, skb); --@@ -1590,7 +1598,8 @@ static int ieee80211_skb_resize(struct i -- return 0; -- } -- ---void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb) --+void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, --+ struct sta_info *sta, struct sk_buff *skb) -- { -- struct ieee80211_local *local = sdata->local; -- struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); --@@ -1625,7 +1634,7 @@ void ieee80211_xmit(struct ieee80211_sub -- } -- -- ieee80211_set_qos_hdr(sdata, skb); --- ieee80211_tx(sdata, skb, false); --+ ieee80211_tx(sdata, sta, skb, false); -- } -- -- static bool ieee80211_parse_tx_radiotap(struct sk_buff *skb) --@@ -1846,7 +1855,7 @@ netdev_tx_t ieee80211_monitor_start_xmit -- goto fail_rcu; -- -- info->band = chandef->chan->band; --- ieee80211_xmit(sdata, skb); --+ ieee80211_xmit(sdata, NULL, skb); -- rcu_read_unlock(); -- -- return NETDEV_TX_OK; --@@ -1877,7 +1886,8 @@ fail: -- * Returns: the (possibly reallocated) skb or an ERR_PTR() code -- */ -- static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata, --- struct sk_buff *skb, u32 info_flags) --+ struct sk_buff *skb, u32 info_flags, --+ struct sta_info **sta_out) -- { -- struct ieee80211_local *local = sdata->local; -- struct ieee80211_tx_info *info; --@@ -1920,6 +1930,7 @@ static struct sk_buff *ieee80211_build_h -- authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); -- wme_sta = sta->sta.wme; -- have_station = true; --+ *sta_out = sta; -- } else if (sdata->wdev.use_4addr) { -- ret = -ENOLINK; -- goto free; --@@ -2073,6 +2084,7 @@ static struct sk_buff *ieee80211_build_h -- have_station = true; -- authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); -- wme_sta = sta->sta.wme; --+ *sta_out = sta; -- } else if (sdata->u.mgd.use_4addr && -- cpu_to_be16(ethertype) != sdata->control_port_protocol) { -- fc |= cpu_to_le16(IEEE80211_FCTL_FROMDS | --@@ -2136,13 +2148,18 @@ static struct sk_buff *ieee80211_build_h -- * and mesh mode checks authorization later. -- */ -- multicast = is_multicast_ether_addr(hdr.addr1); --- if (!multicast && !have_station && --- !ieee80211_vif_is_mesh(&sdata->vif)) { --- sta = sta_info_get(sdata, hdr.addr1); --+ if (multicast) { --+ *sta_out = ERR_PTR(-ENOENT); --+ } else if (!have_station && !ieee80211_vif_is_mesh(&sdata->vif)) { --+ if (sdata->control_port_protocol == skb->protocol) --+ sta = sta_info_get_bss(sdata, hdr.addr1); --+ else --+ sta = sta_info_get(sdata, hdr.addr1); -- if (sta) { -- authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); -- wme_sta = sta->sta.wme; -- } --+ *sta_out = sta ?: ERR_PTR(-ENOENT); -- } -- -- /* For mesh, the use of the QoS header is mandatory */ --@@ -2320,6 +2337,7 @@ void __ieee80211_subif_start_xmit(struct -- u32 info_flags) -- { -- struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); --+ struct sta_info *sta = NULL; -- -- if (unlikely(skb->len < ETH_HLEN)) { -- kfree_skb(skb); --@@ -2328,7 +2346,7 @@ void __ieee80211_subif_start_xmit(struct -- -- rcu_read_lock(); -- --- skb = ieee80211_build_hdr(sdata, skb, info_flags); --+ skb = ieee80211_build_hdr(sdata, skb, info_flags, &sta); -- if (IS_ERR(skb)) -- goto out; -- --@@ -2336,7 +2354,7 @@ void __ieee80211_subif_start_xmit(struct -- dev->stats.tx_bytes += skb->len; -- dev->trans_start = jiffies; -- --- ieee80211_xmit(sdata, skb); --+ ieee80211_xmit(sdata, sta, skb); -- out: -- rcu_read_unlock(); -- } --@@ -2364,10 +2382,11 @@ ieee80211_build_data_template(struct iee -- .local = sdata->local, -- .sdata = sdata, -- }; --+ struct sta_info *sta_ignore; -- -- rcu_read_lock(); -- --- skb = ieee80211_build_hdr(sdata, skb, info_flags); --+ skb = ieee80211_build_hdr(sdata, skb, info_flags, &sta_ignore); -- if (IS_ERR(skb)) -- goto out; -- --@@ -2425,7 +2444,7 @@ static bool ieee80211_tx_pending_skb(str -- return true; -- } -- info->band = chanctx_conf->def.chan->band; --- result = ieee80211_tx(sdata, skb, true); --+ result = ieee80211_tx(sdata, NULL, skb, true); -- } else { -- struct sk_buff_head skbs; -- --@@ -3163,7 +3182,7 @@ ieee80211_get_buffered_bc(struct ieee802 -- -- if (sdata->vif.type == NL80211_IFTYPE_AP) -- sdata = IEEE80211_DEV_TO_SUB_IF(skb->dev); --- if (!ieee80211_tx_prepare(sdata, &tx, skb)) --+ if (!ieee80211_tx_prepare(sdata, &tx, NULL, skb)) -- break; -- dev_kfree_skb_any(skb); -- } --@@ -3295,6 +3314,6 @@ void __ieee80211_tx_skb_tid_band(struct -- */ -- local_bh_disable(); -- IEEE80211_SKB_CB(skb)->band = band; --- ieee80211_xmit(sdata, skb); --+ 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 -new file mode 100644 -index 0000000..2d5f7b9 ---- /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 -+ -+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. -+ -+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 -+--- -+ -+--- 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); -+ -+ ring = flow->rings[flowid]; -++ if (ring->blocked == blocked) { -++ spin_unlock_irqrestore(&flow->block_lock, flags); -++ return; -++ } -+ ifidx = brcmf_flowring_ifidx_get(flow, flowid); -+ -+ 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 ---- a/package/kernel/mac80211/patches/316-mac80211-reduce-log-spam-from-ieee80211_handle_pwr_c.patch -+++ /dev/null -@@ -1,38 +0,0 @@ --From: John Linville --Date: Tue, 31 Mar 2015 10:49:14 -0400 --Subject: [PATCH] mac80211: reduce log spam from ieee80211_handle_pwr_constr -- --This changes a couple of messages from sdata_info to sdata_dbg. --This should reduce some log spam, as reported here: -- -- https://bugzilla.redhat.com/show_bug.cgi?id=1206468 -- --Signed-off-by: John W. Linville --Signed-off-by: Johannes Berg ----- -- ----- a/net/mac80211/mlme.c --+++ b/net/mac80211/mlme.c --@@ -1347,15 +1347,15 @@ static u32 ieee80211_handle_pwr_constr(s -- */ -- if (has_80211h_pwr && -- (!has_cisco_pwr || pwr_level_80211h <= pwr_level_cisco)) { --- sdata_info(sdata, --- "Limiting TX power to %d (%d - %d) dBm as advertised by %pM\n", --- pwr_level_80211h, chan_pwr, pwr_reduction_80211h, --- sdata->u.mgd.bssid); --+ sdata_dbg(sdata, --+ "Limiting TX power to %d (%d - %d) dBm as advertised by %pM\n", --+ pwr_level_80211h, chan_pwr, pwr_reduction_80211h, --+ sdata->u.mgd.bssid); -- new_ap_level = pwr_level_80211h; -- } else { /* has_cisco_pwr is always true here. */ --- sdata_info(sdata, --- "Limiting TX power to %d dBm as advertised by %pM\n", --- pwr_level_cisco, sdata->u.mgd.bssid); --+ sdata_dbg(sdata, --+ "Limiting TX power to %d dBm as advertised by %pM\n", --+ pwr_level_cisco, sdata->u.mgd.bssid); -- new_ap_level = pwr_level_cisco; -- } -- -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 ---- a/package/kernel/mac80211/patches/317-brcmfmac-Fix-race-condition-in-msgbuf-ioctl-processi.patch -+++ /dev/null -@@ -1,35 +0,0 @@ --From: Hante Meuleman --Date: Fri, 6 Mar 2015 18:40:41 +0100 --Subject: [PATCH] brcmfmac: Fix race condition in msgbuf ioctl processing. -- --Msgbuf is using a wait_event_timeout to wait for the response on --an ioctl. The wakeup routine uses waitqueue_active to see if --wait_event_timeout has been called. There is a chance that the --response arrives before wait_event_timeout is called, this --will result in situation that wait_event_timeout never gets --woken again and assumed result will be a timeout. This patch --removes that errornous situation by always setting the --ctl_completed var before checking for queue active. -- --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/msgbuf.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c --@@ -481,10 +481,9 @@ static int brcmf_msgbuf_ioctl_resp_wait( -- -- static void brcmf_msgbuf_ioctl_resp_wake(struct brcmf_msgbuf *msgbuf) -- { --- if (waitqueue_active(&msgbuf->ioctl_resp_wait)) { --- msgbuf->ctl_completed = true; --+ msgbuf->ctl_completed = true; --+ if (waitqueue_active(&msgbuf->ioctl_resp_wait)) -- wake_up(&msgbuf->ioctl_resp_wait); --- } -- } -- -- -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 -new file mode 100644 -index 0000000..7378401 ---- /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 -+ -+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. -+ -+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 -+--- -+ -+--- 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) -+ -+ #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 -+ -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 ---- a/package/kernel/mac80211/patches/318-brcmfmac-Update-msgbuf-commonring-size-for-improved-.patch -+++ /dev/null -@@ -1,30 +0,0 @@ --From: Hante Meuleman --Date: Wed, 18 Mar 2015 13:25:23 +0100 --Subject: [PATCH] brcmfmac: Update msgbuf commonring size for improved -- throughput. -- --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/msgbuf.h --+++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.h --@@ -17,11 +17,11 @@ -- -- #ifdef CPTCFG_BRCMFMAC_PROTO_MSGBUF -- ---#define BRCMF_H2D_MSGRING_CONTROL_SUBMIT_MAX_ITEM 20 ---#define BRCMF_H2D_MSGRING_RXPOST_SUBMIT_MAX_ITEM 256 ---#define BRCMF_D2H_MSGRING_CONTROL_COMPLETE_MAX_ITEM 20 --+#define BRCMF_H2D_MSGRING_CONTROL_SUBMIT_MAX_ITEM 64 --+#define BRCMF_H2D_MSGRING_RXPOST_SUBMIT_MAX_ITEM 512 --+#define BRCMF_D2H_MSGRING_CONTROL_COMPLETE_MAX_ITEM 64 -- #define BRCMF_D2H_MSGRING_TX_COMPLETE_MAX_ITEM 1024 ---#define BRCMF_D2H_MSGRING_RX_COMPLETE_MAX_ITEM 256 --+#define BRCMF_D2H_MSGRING_RX_COMPLETE_MAX_ITEM 512 -- #define BRCMF_H2D_TXFLOWRING_MAX_ITEM 512 -- -- #define BRCMF_H2D_MSGRING_CONTROL_SUBMIT_ITEMSIZE 40 -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 ---- a/package/kernel/mac80211/patches/319-ath9k_htc-add-new-WMI_REG_RMW_CMDID-command.patch -+++ /dev/null -@@ -1,307 +0,0 @@ --From: Oleksij Rempel --Date: Sun, 22 Mar 2015 19:29:46 +0100 --Subject: [PATCH] ath9k_htc: add new WMI_REG_RMW_CMDID command -- --Since usb bus add extra delay on each request, a command --with read + write requests is too expensive. We can dramtically --reduce usb load by moving this command to firmware. -- --In my tests, this patch will reduce channel scan time --for about 5-10 seconds. -- --Signed-off-by: Oleksij Rempel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/ath/ath.h --+++ b/drivers/net/wireless/ath/ath.h --@@ -131,6 +131,9 @@ struct ath_ops { -- void (*enable_write_buffer)(void *); -- void (*write_flush) (void *); -- u32 (*rmw)(void *, u32 reg_offset, u32 set, u32 clr); --+ void (*enable_rmw_buffer)(void *); --+ void (*rmw_flush) (void *); --+ -- }; -- -- struct ath_common; ----- a/drivers/net/wireless/ath/ath9k/htc.h --+++ b/drivers/net/wireless/ath/ath9k/htc.h --@@ -444,6 +444,10 @@ static inline void ath9k_htc_stop_btcoex -- #define OP_BT_SCAN BIT(4) -- #define OP_TSF_RESET BIT(6) -- --+enum htc_op_flags { --+ HTC_FWFLAG_NO_RMW, --+}; --+ -- struct ath9k_htc_priv { -- struct device *dev; -- struct ieee80211_hw *hw; --@@ -482,6 +486,7 @@ struct ath9k_htc_priv { -- bool reconfig_beacon; -- unsigned int rxfilter; -- unsigned long op_flags; --+ unsigned long fw_flags; -- -- struct ath9k_hw_cal_data caldata; -- struct ath_spec_scan_priv spec_priv; ----- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c --+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c --@@ -376,17 +376,139 @@ static void ath9k_regwrite_flush(void *h -- mutex_unlock(&priv->wmi->multi_write_mutex); -- } -- ---static u32 ath9k_reg_rmw(void *hw_priv, u32 reg_offset, u32 set, u32 clr) --+static void ath9k_reg_rmw_buffer(void *hw_priv, --+ u32 reg_offset, u32 set, u32 clr) --+{ --+ struct ath_hw *ah = (struct ath_hw *) hw_priv; --+ struct ath_common *common = ath9k_hw_common(ah); --+ struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv; --+ u32 rsp_status; --+ int r; --+ --+ mutex_lock(&priv->wmi->multi_rmw_mutex); --+ --+ /* Store the register/value */ --+ priv->wmi->multi_rmw[priv->wmi->multi_rmw_idx].reg = --+ cpu_to_be32(reg_offset); --+ priv->wmi->multi_rmw[priv->wmi->multi_rmw_idx].set = --+ cpu_to_be32(set); --+ priv->wmi->multi_rmw[priv->wmi->multi_rmw_idx].clr = --+ cpu_to_be32(clr); --+ --+ priv->wmi->multi_rmw_idx++; --+ --+ /* If the buffer is full, send it out. */ --+ if (priv->wmi->multi_rmw_idx == MAX_RMW_CMD_NUMBER) { --+ r = ath9k_wmi_cmd(priv->wmi, WMI_REG_RMW_CMDID, --+ (u8 *) &priv->wmi->multi_rmw, --+ sizeof(struct register_write) * priv->wmi->multi_rmw_idx, --+ (u8 *) &rsp_status, sizeof(rsp_status), --+ 100); --+ if (unlikely(r)) { --+ ath_dbg(common, WMI, --+ "REGISTER RMW FAILED, multi len: %d\n", --+ priv->wmi->multi_rmw_idx); --+ } --+ priv->wmi->multi_rmw_idx = 0; --+ } --+ --+ mutex_unlock(&priv->wmi->multi_rmw_mutex); --+} --+ --+static void ath9k_reg_rmw_flush(void *hw_priv) -- { --- u32 val; --+ struct ath_hw *ah = (struct ath_hw *) hw_priv; --+ struct ath_common *common = ath9k_hw_common(ah); --+ struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv; --+ u32 rsp_status; --+ int r; --+ --+ if (test_bit(HTC_FWFLAG_NO_RMW, &priv->fw_flags)) --+ return; --+ --+ atomic_dec(&priv->wmi->m_rmw_cnt); --+ --+ mutex_lock(&priv->wmi->multi_rmw_mutex); --+ --+ if (priv->wmi->multi_rmw_idx) { --+ r = ath9k_wmi_cmd(priv->wmi, WMI_REG_RMW_CMDID, --+ (u8 *) &priv->wmi->multi_rmw, --+ sizeof(struct register_rmw) * priv->wmi->multi_rmw_idx, --+ (u8 *) &rsp_status, sizeof(rsp_status), --+ 100); --+ if (unlikely(r)) { --+ ath_dbg(common, WMI, --+ "REGISTER RMW FAILED, multi len: %d\n", --+ priv->wmi->multi_rmw_idx); --+ } --+ priv->wmi->multi_rmw_idx = 0; --+ } -- --- val = ath9k_regread(hw_priv, reg_offset); --- val &= ~clr; --- val |= set; --- ath9k_regwrite(hw_priv, val, reg_offset); --+ mutex_unlock(&priv->wmi->multi_rmw_mutex); --+} --+ --+static void ath9k_enable_rmw_buffer(void *hw_priv) --+{ --+ struct ath_hw *ah = (struct ath_hw *) hw_priv; --+ struct ath_common *common = ath9k_hw_common(ah); --+ struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv; --+ --+ if (test_bit(HTC_FWFLAG_NO_RMW, &priv->fw_flags)) --+ return; --+ --+ atomic_inc(&priv->wmi->m_rmw_cnt); --+} --+ --+static u32 ath9k_reg_rmw_single(void *hw_priv, --+ u32 reg_offset, u32 set, u32 clr) --+{ --+ struct ath_hw *ah = (struct ath_hw *) hw_priv; --+ struct ath_common *common = ath9k_hw_common(ah); --+ struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv; --+ struct register_rmw buf, buf_ret; --+ int ret; --+ u32 val = 0; --+ --+ buf.reg = cpu_to_be32(reg_offset); --+ buf.set = cpu_to_be32(set); --+ buf.clr = cpu_to_be32(clr); --+ --+ ret = ath9k_wmi_cmd(priv->wmi, WMI_REG_RMW_CMDID, --+ (u8 *) &buf, sizeof(buf), --+ (u8 *) &buf_ret, sizeof(buf_ret), --+ 100); --+ if (unlikely(ret)) { --+ ath_dbg(common, WMI, "REGISTER RMW FAILED:(0x%04x, %d)\n", --+ reg_offset, ret); --+ } -- return val; -- } -- --+static u32 ath9k_reg_rmw(void *hw_priv, u32 reg_offset, u32 set, u32 clr) --+{ --+ struct ath_hw *ah = (struct ath_hw *) hw_priv; --+ struct ath_common *common = ath9k_hw_common(ah); --+ struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv; --+ --+ if (test_bit(HTC_FWFLAG_NO_RMW, &priv->fw_flags)) { --+ u32 val; --+ --+ val = REG_READ(ah, reg_offset); --+ val &= ~clr; --+ val |= set; --+ REG_WRITE(ah, reg_offset, val); --+ --+ return 0; --+ } --+ --+ if (atomic_read(&priv->wmi->m_rmw_cnt)) --+ ath9k_reg_rmw_buffer(hw_priv, reg_offset, set, clr); --+ else --+ ath9k_reg_rmw_single(hw_priv, reg_offset, set, clr); --+ --+ return 0; --+} --+ -- static void ath_usb_read_cachesize(struct ath_common *common, int *csz) -- { -- *csz = L1_CACHE_BYTES >> 2; --@@ -501,6 +623,8 @@ static int ath9k_init_priv(struct ath9k_ -- ah->reg_ops.write = ath9k_regwrite; -- ah->reg_ops.enable_write_buffer = ath9k_enable_regwrite_buffer; -- ah->reg_ops.write_flush = ath9k_regwrite_flush; --+ ah->reg_ops.enable_rmw_buffer = ath9k_enable_rmw_buffer; --+ ah->reg_ops.rmw_flush = ath9k_reg_rmw_flush; -- ah->reg_ops.rmw = ath9k_reg_rmw; -- priv->ah = ah; -- --@@ -686,6 +810,12 @@ static int ath9k_init_firmware_version(s -- return -EINVAL; -- } -- --+ if (priv->fw_version_major == 1 && priv->fw_version_minor < 4) --+ set_bit(HTC_FWFLAG_NO_RMW, &priv->fw_flags); --+ --+ dev_info(priv->dev, "FW RMW support: %s\n", --+ test_bit(HTC_FWFLAG_NO_RMW, &priv->fw_flags) ? "Off" : "On"); --+ -- return 0; -- } -- ----- a/drivers/net/wireless/ath/ath9k/hw.h --+++ b/drivers/net/wireless/ath/ath9k/hw.h --@@ -100,6 +100,18 @@ -- (_ah)->reg_ops.write_flush((_ah)); \ -- } while (0) -- --+#define ENABLE_REG_RMW_BUFFER(_ah) \ --+ do { \ --+ if ((_ah)->reg_ops.enable_rmw_buffer) \ --+ (_ah)->reg_ops.enable_rmw_buffer((_ah)); \ --+ } while (0) --+ --+#define REG_RMW_BUFFER_FLUSH(_ah) \ --+ do { \ --+ if ((_ah)->reg_ops.rmw_flush) \ --+ (_ah)->reg_ops.rmw_flush((_ah)); \ --+ } while (0) --+ -- #define PR_EEP(_s, _val) \ -- do { \ -- len += scnprintf(buf + len, size - len, "%20s : %10d\n",\ ----- a/drivers/net/wireless/ath/ath9k/wmi.c --+++ b/drivers/net/wireless/ath/ath9k/wmi.c --@@ -61,6 +61,8 @@ static const char *wmi_cmd_to_name(enum -- return "WMI_REG_READ_CMDID"; -- case WMI_REG_WRITE_CMDID: -- return "WMI_REG_WRITE_CMDID"; --+ case WMI_REG_RMW_CMDID: --+ return "WMI_REG_RMW_CMDID"; -- case WMI_RC_STATE_CHANGE_CMDID: -- return "WMI_RC_STATE_CHANGE_CMDID"; -- case WMI_RC_RATE_UPDATE_CMDID: --@@ -101,6 +103,7 @@ struct wmi *ath9k_init_wmi(struct ath9k_ -- spin_lock_init(&wmi->event_lock); -- mutex_init(&wmi->op_mutex); -- mutex_init(&wmi->multi_write_mutex); --+ mutex_init(&wmi->multi_rmw_mutex); -- init_completion(&wmi->cmd_wait); -- INIT_LIST_HEAD(&wmi->pending_tx_events); -- tasklet_init(&wmi->wmi_event_tasklet, ath9k_wmi_event_tasklet, ----- a/drivers/net/wireless/ath/ath9k/wmi.h --+++ b/drivers/net/wireless/ath/ath9k/wmi.h --@@ -112,6 +112,7 @@ enum wmi_cmd_id { -- WMI_TX_STATS_CMDID, -- WMI_RX_STATS_CMDID, -- WMI_BITRATE_MASK_CMDID, --+ WMI_REG_RMW_CMDID, -- }; -- -- enum wmi_event_id { --@@ -125,12 +126,19 @@ enum wmi_event_id { -- }; -- -- #define MAX_CMD_NUMBER 62 --+#define MAX_RMW_CMD_NUMBER 15 -- -- struct register_write { -- __be32 reg; -- __be32 val; -- }; -- --+struct register_rmw { --+ __be32 reg; --+ __be32 set; --+ __be32 clr; --+} __packed; --+ -- struct ath9k_htc_tx_event { -- int count; -- struct __wmi_event_txstatus txs; --@@ -156,10 +164,18 @@ struct wmi { -- -- spinlock_t wmi_lock; -- --+ /* multi write section */ -- atomic_t mwrite_cnt; -- struct register_write multi_write[MAX_CMD_NUMBER]; -- u32 multi_write_idx; -- struct mutex multi_write_mutex; --+ --+ /* multi rmw section */ --+ atomic_t m_rmw_cnt; --+ struct register_rmw multi_rmw[MAX_RMW_CMD_NUMBER]; --+ u32 multi_rmw_idx; --+ struct mutex multi_rmw_mutex; --+ -- }; -- -- 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 -new file mode 100644 -index 0000000..97444b3 ---- /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 -+ -+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. -+ -+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/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) -+ { -+ 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; -+ } -+- /* 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; -++ -++ *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) -++{ -++ 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]; -++} -++ -+ 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 -+ -+ /* 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; -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 ---- a/package/kernel/mac80211/patches/320-ath9k-ar9271_hw_pa_cal-use-defs-instead-of-magin-num.patch -+++ /dev/null -@@ -1,89 +0,0 @@ --From: Oleksij Rempel --Date: Sun, 22 Mar 2015 19:29:47 +0100 --Subject: [PATCH] ath9k: ar9271_hw_pa_cal - use defs instead of magin -- numbers -- --This function uses mixed styles for register names/numbers which --is make harder reading and optimisation. -- --Signed-off-by: Oleksij Rempel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c --+++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c --@@ -430,22 +430,22 @@ static void ar9271_hw_pa_cal(struct ath_ -- u32 regVal; -- unsigned int i; -- u32 regList[][2] = { --- { 0x786c, 0 }, --- { 0x7854, 0 }, --- { 0x7820, 0 }, --- { 0x7824, 0 }, --- { 0x7868, 0 }, --- { 0x783c, 0 }, --- { 0x7838, 0 } , --- { 0x7828, 0 } , --+ { AR9285_AN_TOP3, 0 }, --+ { AR9285_AN_RXTXBB1, 0 }, --+ { AR9285_AN_RF2G1, 0 }, --+ { AR9285_AN_RF2G2, 0 }, --+ { AR9285_AN_TOP2, 0 }, --+ { AR9285_AN_RF2G8, 0 }, --+ { AR9285_AN_RF2G7, 0 } , --+ { AR9285_AN_RF2G3, 0 } , -- }; -- -- for (i = 0; i < ARRAY_SIZE(regList); i++) -- regList[i][1] = REG_READ(ah, regList[i][0]); -- --- regVal = REG_READ(ah, 0x7834); --+ regVal = REG_READ(ah, AR9285_AN_RF2G6); -- regVal &= (~(0x1)); --- REG_WRITE(ah, 0x7834, regVal); --+ REG_WRITE(ah, AR9285_AN_RF2G6, regVal); -- regVal = REG_READ(ah, 0x9808); -- regVal |= (0x1 << 27); -- REG_WRITE(ah, 0x9808, regVal); --@@ -477,7 +477,7 @@ static void ar9271_hw_pa_cal(struct ath_ -- * does not matter since we turn it off -- */ -- REG_RMW_FIELD(ah, AR9285_AN_RF2G7, AR9285_AN_RF2G7_PADRVGN2TAB0, 0); --- --+ /* 7828, b0-11, ccom=fff */ -- REG_RMW_FIELD(ah, AR9285_AN_RF2G3, AR9271_AN_RF2G3_CCOMP, 0xfff); -- -- /* Set: --@@ -490,15 +490,16 @@ static void ar9271_hw_pa_cal(struct ath_ -- -- /* find off_6_1; */ -- for (i = 6; i > 0; i--) { --- regVal = REG_READ(ah, 0x7834); --+ regVal = REG_READ(ah, AR9285_AN_RF2G6); -- regVal |= (1 << (20 + i)); --- REG_WRITE(ah, 0x7834, regVal); --+ REG_WRITE(ah, AR9285_AN_RF2G6, regVal); -- udelay(1); -- /* regVal = REG_READ(ah, 0x7834); */ -- regVal &= (~(0x1 << (20 + i))); --- regVal |= (MS(REG_READ(ah, 0x7840), AR9285_AN_RXTXBB1_SPARE9) --+ regVal |= (MS(REG_READ(ah, AR9285_AN_RF2G9), --+ AR9285_AN_RXTXBB1_SPARE9) -- << (20 + i)); --- REG_WRITE(ah, 0x7834, regVal); --+ REG_WRITE(ah, AR9285_AN_RF2G6, regVal); -- } -- -- regVal = (regVal >> 20) & 0x7f; --@@ -517,9 +518,9 @@ static void ar9271_hw_pa_cal(struct ath_ -- -- ENABLE_REGWRITE_BUFFER(ah); -- --- regVal = REG_READ(ah, 0x7834); --+ regVal = REG_READ(ah, AR_AN_RF2G1_CH1); -- regVal |= 0x1; --- REG_WRITE(ah, 0x7834, regVal); --+ REG_WRITE(ah, AR_AN_RF2G1_CH1, regVal); -- 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 -new file mode 100644 -index 0000000..632714c ---- /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 -+ -+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 -+--- -+ -+--- 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 -+ } -+ -+ 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; -++ -++ /* assure protocol is always called with -++ * non-null initialized pointer. -++ */ -++ 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) -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 ---- a/package/kernel/mac80211/patches/321-ath9k-ar9271_hw_pa_cal-use-proper-makroses.patch -+++ /dev/null -@@ -1,79 +0,0 @@ --From: Oleksij Rempel --Date: Sun, 22 Mar 2015 19:29:48 +0100 --Subject: [PATCH] ath9k: ar9271_hw_pa_cal: use proper makroses. -- --Signed-off-by: Oleksij Rempel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c --+++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c --@@ -443,33 +443,30 @@ static void ar9271_hw_pa_cal(struct ath_ -- for (i = 0; i < ARRAY_SIZE(regList); i++) -- regList[i][1] = REG_READ(ah, regList[i][0]); -- --- regVal = REG_READ(ah, AR9285_AN_RF2G6); --- regVal &= (~(0x1)); --- REG_WRITE(ah, AR9285_AN_RF2G6, regVal); --- regVal = REG_READ(ah, 0x9808); --- regVal |= (0x1 << 27); --- REG_WRITE(ah, 0x9808, regVal); --- --+ /* 7834, b1=0 */ --+ REG_CLR_BIT(ah, AR9285_AN_RF2G6, 1 << 0); --+ /* 9808, b27=1 */ --+ REG_SET_BIT(ah, 0x9808, 1 << 27); -- /* 786c,b23,1, pwddac=1 */ --- REG_RMW_FIELD(ah, AR9285_AN_TOP3, AR9285_AN_TOP3_PWDDAC, 1); --+ REG_SET_BIT(ah, AR9285_AN_TOP3, AR9285_AN_TOP3_PWDDAC); -- /* 7854, b5,1, pdrxtxbb=1 */ --- REG_RMW_FIELD(ah, AR9285_AN_RXTXBB1, AR9285_AN_RXTXBB1_PDRXTXBB1, 1); --+ REG_SET_BIT(ah, AR9285_AN_RXTXBB1, AR9285_AN_RXTXBB1_PDRXTXBB1); -- /* 7854, b7,1, pdv2i=1 */ --- REG_RMW_FIELD(ah, AR9285_AN_RXTXBB1, AR9285_AN_RXTXBB1_PDV2I, 1); --+ REG_SET_BIT(ah, AR9285_AN_RXTXBB1, AR9285_AN_RXTXBB1_PDV2I); -- /* 7854, b8,1, pddacinterface=1 */ --- REG_RMW_FIELD(ah, AR9285_AN_RXTXBB1, AR9285_AN_RXTXBB1_PDDACIF, 1); --+ REG_SET_BIT(ah, AR9285_AN_RXTXBB1, AR9285_AN_RXTXBB1_PDDACIF); -- /* 7824,b12,0, offcal=0 */ --- REG_RMW_FIELD(ah, AR9285_AN_RF2G2, AR9285_AN_RF2G2_OFFCAL, 0); --+ REG_CLR_BIT(ah, AR9285_AN_RF2G2, AR9285_AN_RF2G2_OFFCAL); -- /* 7838, b1,0, pwddb=0 */ --- REG_RMW_FIELD(ah, AR9285_AN_RF2G7, AR9285_AN_RF2G7_PWDDB, 0); --+ REG_CLR_BIT(ah, AR9285_AN_RF2G7, AR9285_AN_RF2G7_PWDDB); -- /* 7820,b11,0, enpacal=0 */ --- REG_RMW_FIELD(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_ENPACAL, 0); --+ REG_CLR_BIT(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_ENPACAL); -- /* 7820,b25,1, pdpadrv1=0 */ --- REG_RMW_FIELD(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_PDPADRV1, 0); --+ REG_CLR_BIT(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_PDPADRV1); -- /* 7820,b24,0, pdpadrv2=0 */ --- REG_RMW_FIELD(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_PDPADRV2, 0); --+ REG_CLR_BIT(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_PDPADRV2); -- /* 7820,b23,0, pdpaout=0 */ --- REG_RMW_FIELD(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_PDPAOUT, 0); --+ REG_CLR_BIT(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_PDPAOUT); -- /* 783c,b14-16,7, padrvgn2tab_0=7 */ -- REG_RMW_FIELD(ah, AR9285_AN_RF2G8, AR9285_AN_RF2G8_PADRVGN2TAB0, 7); -- /* --@@ -516,15 +513,13 @@ static void ar9271_hw_pa_cal(struct ath_ -- ah->pacal_info.prev_offset = regVal; -- } -- --- ENABLE_REGWRITE_BUFFER(ah); -- --- regVal = REG_READ(ah, AR_AN_RF2G1_CH1); --- regVal |= 0x1; --- REG_WRITE(ah, AR_AN_RF2G1_CH1, regVal); --- regVal = REG_READ(ah, 0x9808); --- regVal &= (~(0x1 << 27)); --- REG_WRITE(ah, 0x9808, regVal); --+ /* 7834, b1=1 */ --+ REG_SET_BIT(ah, AR9285_AN_RF2G6, 1 << 0); --+ /* 9808, b27=0 */ --+ REG_CLR_BIT(ah, 0x9808, 1 << 27); -- --+ ENABLE_REGWRITE_BUFFER(ah); -- 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 -new file mode 100644 -index 0000000..3360cbc ---- /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() -+ -+Just pass the interface to be removed, ie. 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 -+--- -+ -+--- 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/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 -+ } -+ } -+ -+-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; -++ -++ brcmf_fws_del_interface(ifp); -++ brcmf_del_if(ifp->drvr, ifp->bssidx); -+ } -+ -+ 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 -+ { -+ 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); -+ } -+ -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 ---- a/package/kernel/mac80211/patches/322-ath9k-ar9271_hw_pa_cal-use-RMW-buffer.patch -+++ /dev/null -@@ -1,48 +0,0 @@ --From: Oleksij Rempel --Date: Sun, 22 Mar 2015 19:29:49 +0100 --Subject: [PATCH] ath9k: ar9271_hw_pa_cal: use RMW buffer -- --Signed-off-by: Oleksij Rempel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c --+++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c --@@ -436,13 +436,14 @@ static void ar9271_hw_pa_cal(struct ath_ -- { AR9285_AN_RF2G2, 0 }, -- { AR9285_AN_TOP2, 0 }, -- { AR9285_AN_RF2G8, 0 }, --- { AR9285_AN_RF2G7, 0 } , --- { AR9285_AN_RF2G3, 0 } , --+ { AR9285_AN_RF2G7, 0 }, --+ { AR9285_AN_RF2G3, 0 }, -- }; -- -- for (i = 0; i < ARRAY_SIZE(regList); i++) -- regList[i][1] = REG_READ(ah, regList[i][0]); -- --+ ENABLE_REG_RMW_BUFFER(ah); -- /* 7834, b1=0 */ -- REG_CLR_BIT(ah, AR9285_AN_RF2G6, 1 << 0); -- /* 9808, b27=1 */ --@@ -476,6 +477,7 @@ static void ar9271_hw_pa_cal(struct ath_ -- REG_RMW_FIELD(ah, AR9285_AN_RF2G7, AR9285_AN_RF2G7_PADRVGN2TAB0, 0); -- /* 7828, b0-11, ccom=fff */ -- REG_RMW_FIELD(ah, AR9285_AN_RF2G3, AR9271_AN_RF2G3_CCOMP, 0xfff); --+ REG_RMW_BUFFER_FLUSH(ah); -- -- /* Set: -- * localmode=1,bmode=1,bmoderxtx=1,synthon=1, --@@ -514,10 +516,12 @@ static void ar9271_hw_pa_cal(struct ath_ -- } -- -- --+ ENABLE_REG_RMW_BUFFER(ah); -- /* 7834, b1=1 */ -- REG_SET_BIT(ah, AR9285_AN_RF2G6, 1 << 0); -- /* 9808, b27=0 */ -- REG_CLR_BIT(ah, 0x9808, 1 << 27); --+ REG_RMW_BUFFER_FLUSH(ah); -- -- 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 -new file mode 100644 -index 0000000..2b61f4e ---- /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 -+ -+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: -+ -+ 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 -+--- -+ -+--- 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; -++ } -+ if (drvr->fws) { -+ brcmf_fws_del_interface(ifp); -+ brcmf_fws_deinit(drvr); -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 ---- a/package/kernel/mac80211/patches/323-ath9k-add-multi_read-to-be-compatible-with-ath9k_htc.patch -+++ /dev/null -@@ -1,35 +0,0 @@ --From: Oleksij Rempel --Date: Sun, 22 Mar 2015 19:29:50 +0100 --Subject: [PATCH] ath9k: add multi_read to be compatible with ath9k_htc -- --Signed-off-by: Oleksij Rempel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/ath/ath9k/init.c --+++ b/drivers/net/wireless/ath/ath9k/init.c --@@ -141,6 +141,16 @@ static unsigned int ath9k_ioread32(void -- return val; -- } -- --+static void ath9k_multi_ioread32(void *hw_priv, u32 *addr, --+ u32 *val, u16 count) --+{ --+ int i; --+ --+ for (i = 0; i < count; i++) --+ val[i] = ath9k_ioread32(hw_priv, addr[i]); --+} --+ --+ -- static unsigned int __ath9k_reg_rmw(struct ath_softc *sc, u32 reg_offset, -- u32 set, u32 clr) -- { --@@ -530,6 +540,7 @@ static int ath9k_init_softc(u16 devid, s -- ah->hw = sc->hw; -- ah->hw_version.devid = devid; -- ah->reg_ops.read = ath9k_ioread32; --+ ah->reg_ops.multi_read = ath9k_multi_ioread32; -- 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 ---- a/package/kernel/mac80211/patches/324-ath9k-add-new-function-ath9k_hw_read_array.patch -+++ /dev/null -@@ -1,69 +0,0 @@ --From: Oleksij Rempel --Date: Sun, 22 Mar 2015 19:29:51 +0100 --Subject: [PATCH] ath9k: add new function ath9k_hw_read_array -- --REG_READ generate most overhead on usb bus. It send and read micro packages --and reduce usb bandwidth. To reduce this overhead we should read in batches. -- --Signed-off-by: Oleksij Rempel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/ath/ath9k/hw.c --+++ b/drivers/net/wireless/ath/ath9k/hw.c --@@ -121,6 +121,36 @@ void ath9k_hw_write_array(struct ath_hw -- REGWRITE_BUFFER_FLUSH(ah); -- } -- --+void ath9k_hw_read_array(struct ath_hw *ah, u32 array[][2], int size) --+{ --+ u32 *tmp_reg_list, *tmp_data; --+ int i; --+ --+ tmp_reg_list = kmalloc(size * sizeof(u32), GFP_KERNEL); --+ if (!tmp_reg_list) { --+ dev_err(ah->dev, "%s: tmp_reg_list: alloc filed\n", __func__); --+ return; --+ } --+ --+ tmp_data = kmalloc(size * sizeof(u32), GFP_KERNEL); --+ if (!tmp_data) { --+ dev_err(ah->dev, "%s tmp_data: alloc filed\n", __func__); --+ goto error_tmp_data; --+ } --+ --+ for (i = 0; i < size; i++) --+ tmp_reg_list[i] = array[i][0]; --+ --+ REG_READ_MULTI(ah, tmp_reg_list, tmp_data, size); --+ --+ for (i = 0; i < size; i++) --+ array[i][1] = tmp_data[i]; --+ --+ kfree(tmp_data); --+error_tmp_data: --+ kfree(tmp_reg_list); --+} --+ -- u32 ath9k_hw_reverse_bits(u32 val, u32 n) -- { -- u32 retval; ----- a/drivers/net/wireless/ath/ath9k/hw.h --+++ b/drivers/net/wireless/ath/ath9k/hw.h --@@ -138,6 +138,8 @@ -- -- #define REG_WRITE_ARRAY(iniarray, column, regWr) \ -- ath9k_hw_write_array(ah, iniarray, column, &(regWr)) --+#define REG_READ_ARRAY(ah, array, size) \ --+ ath9k_hw_read_array(ah, array, size) -- -- #define AR_GPIO_OUTPUT_MUX_AS_OUTPUT 0 -- #define AR_GPIO_OUTPUT_MUX_AS_PCIE_ATTENTION_LED 1 --@@ -1020,6 +1022,7 @@ void ath9k_hw_synth_delay(struct ath_hw -- bool ath9k_hw_wait(struct ath_hw *ah, u32 reg, u32 mask, u32 val, u32 timeout); -- void ath9k_hw_write_array(struct ath_hw *ah, const struct ar5416IniArray *array, -- int column, unsigned int *writecnt); --+void ath9k_hw_read_array(struct ath_hw *ah, u32 array[][2], int size); -- 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 -new file mode 100644 -index 0000000..abd6681 ---- /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 -+ -+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. -+ -+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/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); -+ } -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 ---- a/package/kernel/mac80211/patches/325-ath9k-ar9271_hw_pa_cal-use-REG_READ_ARRAY.patch -+++ /dev/null -@@ -1,24 +0,0 @@ --From: Oleksij Rempel --Date: Sun, 22 Mar 2015 19:29:52 +0100 --Subject: [PATCH] ath9k: ar9271_hw_pa_cal: use REG_READ_ARRAY -- --insted of reading each register separatly --and waste 4ms on each operation, we can --use one shot read. -- --Signed-off-by: Oleksij Rempel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c --+++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c --@@ -440,8 +440,7 @@ static void ar9271_hw_pa_cal(struct ath_ -- { AR9285_AN_RF2G3, 0 }, -- }; -- --- for (i = 0; i < ARRAY_SIZE(regList); i++) --- regList[i][1] = REG_READ(ah, regList[i][0]); --+ REG_READ_ARRAY(ah, regList, ARRAY_SIZE(regList)); -- -- 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 -new file mode 100644 -index 0000000..23a7b6f ---- /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() -+ -+Most call sites of brcmf_txfinalize already have struct brcmf_if -+instance so pass that to brcmf_txfinalize() as the function -+needs it anyway. -+ -+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 -+@@ -560,17 +560,11 @@ void brcmf_rx_frame(struct device *dev, -+ brcmf_netif_rx(ifp, skb); -+ } -+ -+-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; -+ -+- ifp = drvr->iflist[ifidx]; -+- if (!ifp) -+- goto done; -+- -+ eh = (struct ethhdr *)(txp->data); -+ type = ntohs(eh->h_proto); -+ -+@@ -582,7 +576,7 @@ void brcmf_txfinalize(struct brcmf_pub * -+ -+ 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; -+ } -+ -+@@ -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? -++ */ -++ brcmf_txfinalize(brcmf_get_ifp(msgbuf->drvr, tx_status->msg.ifidx), -++ skb, true); -+ } -+ -+ -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 ---- a/package/kernel/mac80211/patches/326-ath9k-use-one-shot-read-in-ath9k_hw_update_mibstats.patch -+++ /dev/null -@@ -1,39 +0,0 @@ --From: Oleksij Rempel --Date: Sun, 22 Mar 2015 19:29:53 +0100 --Subject: [PATCH] ath9k: use one shot read in ath9k_hw_update_mibstats -- --this will reduce some overhead on usb bus. -- --Signed-off-by: Oleksij Rempel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/ath/ath9k/ani.c --+++ b/drivers/net/wireless/ath/ath9k/ani.c --@@ -107,11 +107,21 @@ static const struct ani_cck_level_entry -- static void ath9k_hw_update_mibstats(struct ath_hw *ah, -- struct ath9k_mib_stats *stats) -- { --- stats->ackrcv_bad += REG_READ(ah, AR_ACK_FAIL); --- stats->rts_bad += REG_READ(ah, AR_RTS_FAIL); --- stats->fcs_bad += REG_READ(ah, AR_FCS_FAIL); --- stats->rts_good += REG_READ(ah, AR_RTS_OK); --- stats->beacons += REG_READ(ah, AR_BEACON_CNT); --+ u32 addr[5] = {AR_RTS_OK, AR_RTS_FAIL, AR_ACK_FAIL, --+ AR_FCS_FAIL, AR_BEACON_CNT}; --+ u32 data[5]; --+ --+ REG_READ_MULTI(ah, &addr[0], &data[0], 5); --+ /* AR_RTS_OK */ --+ stats->rts_good += data[0]; --+ /* AR_RTS_FAIL */ --+ stats->rts_bad += data[1]; --+ /* AR_ACK_FAIL */ --+ stats->ackrcv_bad += data[2]; --+ /* AR_FCS_FAIL */ --+ stats->fcs_bad += data[3]; --+ /* AR_BEACON_CNT */ --+ stats->beacons += data[4]; -- } -- -- 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 ---- a/package/kernel/mac80211/patches/327-ath9k-ath9k_hw_loadnf-use-REG_RMW.patch -+++ /dev/null -@@ -1,71 +0,0 @@ --From: Oleksij Rempel --Date: Sun, 22 Mar 2015 19:29:54 +0100 --Subject: [PATCH] ath9k: ath9k_hw_loadnf: use REG_RMW -- --Signed-off-by: Oleksij Rempel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/ath/ath9k/calib.c --+++ b/drivers/net/wireless/ath/ath9k/calib.c --@@ -238,7 +238,6 @@ int ath9k_hw_loadnf(struct ath_hw *ah, s -- { -- struct ath9k_nfcal_hist *h = NULL; -- unsigned i, j; --- int32_t val; -- 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); --@@ -246,6 +245,7 @@ int ath9k_hw_loadnf(struct ath_hw *ah, s -- if (ah->caldata) -- h = ah->caldata->nfCalHist; -- --+ ENABLE_REG_RMW_BUFFER(ah); -- for (i = 0; i < NUM_NF_READINGS; i++) { -- if (chainmask & (1 << i)) { -- s16 nfval; --@@ -258,10 +258,8 @@ int ath9k_hw_loadnf(struct ath_hw *ah, s -- else -- nfval = default_nf; -- --- val = REG_READ(ah, ah->nf_regs[i]); --- val &= 0xFFFFFE00; --- val |= (((u32) nfval << 1) & 0x1ff); --- REG_WRITE(ah, ah->nf_regs[i], val); --+ REG_RMW(ah, ah->nf_regs[i], --+ (((u32) nfval << 1) & 0x1ff), 0x1ff); -- } -- } -- --@@ -274,6 +272,7 @@ int ath9k_hw_loadnf(struct ath_hw *ah, s -- REG_CLR_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); -- -- /* -- * Wait for load to complete, should be fast, a few 10s of us. --@@ -309,19 +308,17 @@ int ath9k_hw_loadnf(struct ath_hw *ah, s -- * by the median we just loaded. This will be initial (and max) value -- * of next noise floor calibration the baseband does. -- */ --- ENABLE_REGWRITE_BUFFER(ah); --+ ENABLE_REG_RMW_BUFFER(ah); -- for (i = 0; i < NUM_NF_READINGS; i++) { -- if (chainmask & (1 << i)) { -- if ((i >= AR5416_MAX_CHAINS) && !IS_CHAN_HT40(chan)) -- continue; -- --- val = REG_READ(ah, ah->nf_regs[i]); --- val &= 0xFFFFFE00; --- val |= (((u32) (-50) << 1) & 0x1ff); --- REG_WRITE(ah, ah->nf_regs[i], val); --+ REG_RMW(ah, ah->nf_regs[i], --+ (((u32) (-50) << 1) & 0x1ff), 0x1ff); -- } -- } --- REGWRITE_BUFFER_FLUSH(ah); --+ REG_RMW_BUFFER_FLUSH(ah); -- -- 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 -new file mode 100644 -index 0000000..a0a798b ---- /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 -+ -+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. -+ -+Reviewed-by: Hante Meuleman -+Reviewed-by: Franky (Zhenhui) Lin -+Reviewed-by: Pieter-Paul Giesberts -+Reviewed-by: Pontus Fuchs -+Signed-off-by: Arend van Spriel -+--- -+ -+--- 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); -+ } -+ -+@@ -656,6 +656,9 @@ static void brcmf_pcie_bus_console_read( -+ u8 ch; -+ u32 newidx; -+ -++ if (!BRCMF_FWCON_ON()) -++ return; -++ -+ 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; -++ -+ 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) { -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 ---- a/package/kernel/mac80211/patches/328-ath9k-write-buffer-related-optimisation-in-ar5008_hw.patch -+++ /dev/null -@@ -1,27 +0,0 @@ --From: Oleksij Rempel --Date: Sun, 22 Mar 2015 19:29:55 +0100 --Subject: [PATCH] ath9k: write buffer related optimisation in -- ar5008_hw_set_channel_regs -- --Signed-off-by: Oleksij Rempel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c --+++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c --@@ -681,12 +681,13 @@ static void ar5008_hw_set_channel_regs(s -- phymode |= AR_PHY_FC_DYN2040_PRI_CH; -- -- } --+ ENABLE_REGWRITE_BUFFER(ah); -- REG_WRITE(ah, AR_PHY_TURBO, phymode); -- --+ /* This function do only REG_WRITE, so --+ * we can include it to REGWRITE_BUFFER. */ -- ath9k_hw_set11nmac2040(ah, chan); -- --- ENABLE_REGWRITE_BUFFER(ah); --- -- 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 -new file mode 100644 -index 0000000..53e7ede ---- /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() -+ -+The brcmf_fws_txstatus_suppressed() function prototype specifies an -+ifidx parameter which is not used within the function implementation. -+ -+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/fwsignal.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c -+@@ -1398,7 +1398,7 @@ done: -+ } -+ -+ 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; -+ } -+ 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); -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 ---- a/package/kernel/mac80211/patches/329-ath9k-ath9k_hw_set_4k_power_cal_tabl-use-rmw-buffer.patch -+++ /dev/null -@@ -1,26 +0,0 @@ --From: Oleksij Rempel --Date: Sun, 22 Mar 2015 19:29:56 +0100 --Subject: [PATCH] ath9k: ath9k_hw_set_4k_power_cal_tabl: use rmw buffer -- --Signed-off-by: Oleksij Rempel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c --+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c --@@ -389,6 +389,7 @@ static void ath9k_hw_set_4k_power_cal_ta -- } -- } -- --+ ENABLE_REG_RMW_BUFFER(ah); -- REG_RMW_FIELD(ah, AR_PHY_TPCRG1, AR_PHY_TPCRG1_NUM_PD_GAIN, -- (numXpdGain - 1) & 0x3); -- REG_RMW_FIELD(ah, AR_PHY_TPCRG1, AR_PHY_TPCRG1_PD_GAIN_1, --@@ -396,6 +397,7 @@ static void ath9k_hw_set_4k_power_cal_ta -- REG_RMW_FIELD(ah, AR_PHY_TPCRG1, AR_PHY_TPCRG1_PD_GAIN_2, -- xpdGainValues[1]); -- REG_RMW_FIELD(ah, AR_PHY_TPCRG1, AR_PHY_TPCRG1_PD_GAIN_3, 0); --+ REG_RMW_BUFFER_FLUSH(ah); -- -- 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 -new file mode 100644 -index 0000000..bb05235 ---- /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() -+ -+Instead of passing ifidx and drvr just pass struct brcmf_if pointer -+which holds both parameters. -+ -+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/bcdc.c -++++ b/drivers/net/wireless/brcm80211/brcmfmac/bcdc.c -+@@ -312,8 +312,7 @@ brcmf_proto_bcdc_hdrpull(struct brcmf_pu -+ -+ 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) -+ { -+ 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; -+ } -+ -+ 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); -+ -+ 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 ---- a/package/kernel/mac80211/patches/330-ath9k-use-rmw-buffer-in-ath9k_hw_set_operating_mode-.patch -+++ /dev/null -@@ -1,43 +0,0 @@ --From: Oleksij Rempel --Date: Sun, 22 Mar 2015 19:29:57 +0100 --Subject: [PATCH] ath9k: use rmw buffer in ath9k_hw_set_operating_mode -- and ath9k_hw_reset -- --Signed-off-by: Oleksij Rempel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/ath/ath9k/hw.c --+++ b/drivers/net/wireless/ath/ath9k/hw.c --@@ -1227,6 +1227,7 @@ static void ath9k_hw_set_operating_mode( -- u32 mask = AR_STA_ID1_STA_AP | AR_STA_ID1_ADHOC; -- u32 set = AR_STA_ID1_KSRCH_MODE; -- --+ ENABLE_REG_RMW_BUFFER(ah); -- switch (opmode) { -- case NL80211_IFTYPE_ADHOC: -- if (!AR_SREV_9340_13(ah)) { --@@ -1248,6 +1249,7 @@ static void ath9k_hw_set_operating_mode( -- break; -- } -- REG_RMW(ah, AR_STA_ID1, set, mask); --+ REG_RMW_BUFFER_FLUSH(ah); -- } -- -- void ath9k_hw_get_delta_slope_vals(struct ath_hw *ah, u32 coef_scaled, --@@ -1960,6 +1962,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st -- if (!ath9k_hw_mci_is_enabled(ah)) -- REG_WRITE(ah, AR_OBS, 8); -- --+ ENABLE_REG_RMW_BUFFER(ah); -- if (ah->config.rx_intr_mitigation) { -- REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_LAST, ah->config.rimt_last); -- REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_FIRST, ah->config.rimt_first); --@@ -1969,6 +1972,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st -- REG_RMW_FIELD(ah, AR_TIMT, AR_TIMT_LAST, 300); -- REG_RMW_FIELD(ah, AR_TIMT, AR_TIMT_FIRST, 750); -- } --+ REG_RMW_BUFFER_FLUSH(ah); -- -- 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 -new file mode 100644 -index 0000000..0651a2f ---- /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 -+ -+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. -+ -+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 -+--- -+ -+--- 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; -+ -+- brcmf_free_vif(vif); -++ if (vif) -++ brcmf_free_vif(vif); -+ free_netdev(ndev); -+ } -+ -+--- 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 ---- a/package/kernel/mac80211/patches/331-ath9k-ath9k_hw_4k_set_board_values-use-rmw-buffer.patch -+++ /dev/null -@@ -1,26 +0,0 @@ --From: Oleksij Rempel --Date: Sun, 22 Mar 2015 19:29:58 +0100 --Subject: [PATCH] ath9k: ath9k_hw_4k_set_board_values: use rmw buffer -- --Signed-off-by: Oleksij Rempel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c --+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c --@@ -1082,6 +1082,7 @@ static void ath9k_hw_4k_set_board_values -- mask = BIT(0)|BIT(5)|BIT(10)|BIT(15)|BIT(20)|BIT(25); -- pwrctrl = mask * bb_desired_scale; -- clr = mask * 0x1f; --+ ENABLE_REG_RMW_BUFFER(ah); -- REG_RMW(ah, AR_PHY_TX_PWRCTRL8, pwrctrl, clr); -- REG_RMW(ah, AR_PHY_TX_PWRCTRL10, pwrctrl, clr); -- REG_RMW(ah, AR_PHY_CH0_TX_PWRCTRL12, pwrctrl, clr); --@@ -1096,6 +1097,7 @@ static void ath9k_hw_4k_set_board_values -- clr = mask * 0x1f; -- REG_RMW(ah, AR_PHY_CH0_TX_PWRCTRL11, pwrctrl, clr); -- REG_RMW(ah, AR_PHY_CH0_TX_PWRCTRL13, pwrctrl, clr); --+ REG_RMW_BUFFER_FLUSH(ah); -- } -- } -- -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 -new file mode 100644 -index 0000000..5a7e447 ---- /dev/null -+++ b/package/kernel/mac80211/patches/331-brcmfmac-Reset-PCIE-devices-after-recognition.patch -@@ -0,0 +1,193 @@ -+From: Hante Meuleman -+Date: Thu, 27 Aug 2015 16:14:06 +0200 -+Subject: [PATCH] brcmfmac: Reset PCIE devices after recognition. -+ -+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. -+ -+Cc: Rafal Milecki -+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 -+--- -+ -+--- 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 -+ -++/* 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; -+ } -++ -++ if (ci->pub.ramsize > BRCMF_CHIP_MAX_MEMSIZE) { -++ brcmf_err("RAM size is incorrect\n"); -++ return -ENOMEM; -++ } -++ -+ return 0; -+ } -+ -+@@ -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); -+ } -+ -+--- 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); -+ }; -+--- 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 * -+ } -+ -+ -++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) -+ { -+@@ -1647,6 +1671,7 @@ static void brcmf_pcie_buscore_activate( -+ -+ 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); -+ -+ kfree(bus->bus_priv.pcie); -+ kfree(bus->msgbuf->flowrings); -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 ---- a/package/kernel/mac80211/patches/332-ath9k-ath9k_hw_analog_shift_rmw-use-REG_RMW.patch -+++ /dev/null -@@ -1,27 +0,0 @@ --From: Oleksij Rempel --Date: Sun, 22 Mar 2015 19:29:59 +0100 --Subject: [PATCH] ath9k: ath9k_hw_analog_shift_rmw: use REG_RMW -- --use REG_RMW in ath9k_hw_analog_shift_rmw. --It will double execution speed on usb bus. -- --Signed-off-by: Oleksij Rempel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/ath/ath9k/eeprom.c --+++ b/drivers/net/wireless/ath/ath9k/eeprom.c --@@ -27,12 +27,7 @@ void ath9k_hw_analog_shift_regwrite(stru -- void ath9k_hw_analog_shift_rmw(struct ath_hw *ah, u32 reg, u32 mask, -- u32 shift, u32 val) -- { --- u32 regVal; --- --- regVal = REG_READ(ah, reg) & ~mask; --- regVal |= (val << shift) & mask; --- --- REG_WRITE(ah, reg, regVal); --+ REG_RMW(ah, reg, ((val << shift) & mask), mask); -- -- if (ah->config.analog_shiftreg) -- udelay(100); -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 ---- a/package/kernel/mac80211/patches/333-ath9k-use-REG_RMW-and-rmw-buffer-in-ath9k_hw_4k_set_.patch -+++ /dev/null -@@ -1,47 +0,0 @@ --From: Oleksij Rempel --Date: Sun, 22 Mar 2015 19:30:01 +0100 --Subject: [PATCH] ath9k: use REG_RMW and rmw buffer in -- ath9k_hw_4k_set_gain -- --it is possible to reduce time needed for this function --by rplacing REG_WRITE with REG_RMW (plus dummy 0) and putt all commands --in same buffer. -- --Signed-off-by: Oleksij Rempel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c --+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c --@@ -772,15 +772,14 @@ static void ath9k_hw_4k_set_gain(struct -- struct ar5416_eeprom_4k *eep, -- u8 txRxAttenLocal) -- { --- REG_WRITE(ah, AR_PHY_SWITCH_CHAIN_0, --- pModal->antCtrlChain[0]); --- --- REG_WRITE(ah, AR_PHY_TIMING_CTRL4(0), --- (REG_READ(ah, AR_PHY_TIMING_CTRL4(0)) & --- ~(AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF | --- AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF)) | --- SM(pModal->iqCalICh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF) | --- SM(pModal->iqCalQCh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF)); --+ ENABLE_REG_RMW_BUFFER(ah); --+ REG_RMW(ah, AR_PHY_SWITCH_CHAIN_0, --+ pModal->antCtrlChain[0], 0); --+ --+ REG_RMW(ah, AR_PHY_TIMING_CTRL4(0), --+ SM(pModal->iqCalICh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF) | --+ SM(pModal->iqCalQCh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF), --+ AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF | AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF); -- -- if ((eep->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK) >= -- AR5416_EEP_MINOR_VER_3) { --@@ -819,6 +818,7 @@ static void ath9k_hw_4k_set_gain(struct -- AR9280_PHY_RXGAIN_TXRX_ATTEN, txRxAttenLocal); -- REG_RMW_FIELD(ah, AR_PHY_RXGAIN + 0x1000, -- AR9280_PHY_RXGAIN_TXRX_MARGIN, pModal->rxTxMarginCh[0]); --+ REG_RMW_BUFFER_FLUSH(ah); -- } -- -- /* -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 ---- a/package/kernel/mac80211/patches/334-ath9k-use-REG_RMW-and-rmw-buffer-in-ath9k_hw_def_set.patch -+++ /dev/null -@@ -1,67 +0,0 @@ --From: Oleksij Rempel --Date: Sun, 22 Mar 2015 19:30:03 +0100 --Subject: [PATCH] ath9k: use REG_RMW and rmw buffer in -- ath9k_hw_def_set_gain -- --Signed-off-by: Oleksij Rempel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/ath/ath9k/eeprom_def.c --+++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c --@@ -466,6 +466,7 @@ static void ath9k_hw_def_set_gain(struct -- struct ar5416_eeprom_def *eep, -- u8 txRxAttenLocal, int regChainOffset, int i) -- { --+ ENABLE_REG_RMW_BUFFER(ah); -- if (AR5416_VER_MASK >= AR5416_EEP_MINOR_VER_3) { -- txRxAttenLocal = pModal->txRxAttenCh[i]; -- --@@ -483,16 +484,12 @@ static void ath9k_hw_def_set_gain(struct -- AR_PHY_GAIN_2GHZ_XATTEN2_DB, -- pModal->xatten2Db[i]); -- } else { --- REG_WRITE(ah, AR_PHY_GAIN_2GHZ + regChainOffset, --- (REG_READ(ah, AR_PHY_GAIN_2GHZ + regChainOffset) & --- ~AR_PHY_GAIN_2GHZ_BSW_MARGIN) --- | SM(pModal-> bswMargin[i], --- AR_PHY_GAIN_2GHZ_BSW_MARGIN)); --- REG_WRITE(ah, AR_PHY_GAIN_2GHZ + regChainOffset, --- (REG_READ(ah, AR_PHY_GAIN_2GHZ + regChainOffset) & --- ~AR_PHY_GAIN_2GHZ_BSW_ATTEN) --- | SM(pModal->bswAtten[i], --- AR_PHY_GAIN_2GHZ_BSW_ATTEN)); --+ REG_RMW(ah, AR_PHY_GAIN_2GHZ + regChainOffset, --+ SM(pModal-> bswMargin[i], AR_PHY_GAIN_2GHZ_BSW_MARGIN), --+ AR_PHY_GAIN_2GHZ_BSW_MARGIN); --+ REG_RMW(ah, AR_PHY_GAIN_2GHZ + regChainOffset, --+ SM(pModal->bswAtten[i], AR_PHY_GAIN_2GHZ_BSW_ATTEN), --+ AR_PHY_GAIN_2GHZ_BSW_ATTEN); -- } -- } -- --@@ -504,17 +501,14 @@ static void ath9k_hw_def_set_gain(struct -- AR_PHY_RXGAIN + regChainOffset, -- AR9280_PHY_RXGAIN_TXRX_MARGIN, pModal->rxTxMarginCh[i]); -- } else { --- REG_WRITE(ah, --- AR_PHY_RXGAIN + regChainOffset, --- (REG_READ(ah, AR_PHY_RXGAIN + regChainOffset) & --- ~AR_PHY_RXGAIN_TXRX_ATTEN) --- | SM(txRxAttenLocal, AR_PHY_RXGAIN_TXRX_ATTEN)); --- REG_WRITE(ah, --- AR_PHY_GAIN_2GHZ + regChainOffset, --- (REG_READ(ah, AR_PHY_GAIN_2GHZ + regChainOffset) & --- ~AR_PHY_GAIN_2GHZ_RXTX_MARGIN) | --- SM(pModal->rxTxMarginCh[i], AR_PHY_GAIN_2GHZ_RXTX_MARGIN)); --+ REG_RMW(ah, AR_PHY_RXGAIN + regChainOffset, --+ SM(txRxAttenLocal, AR_PHY_RXGAIN_TXRX_ATTEN), --+ AR_PHY_RXGAIN_TXRX_ATTEN); --+ REG_RMW(ah, AR_PHY_GAIN_2GHZ + regChainOffset, --+ SM(pModal->rxTxMarginCh[i], AR_PHY_GAIN_2GHZ_RXTX_MARGIN), --+ AR_PHY_GAIN_2GHZ_RXTX_MARGIN); -- } --+ REG_RMW_BUFFER_FLUSH(ah); -- } -- -- static void ath9k_hw_def_set_board_values(struct ath_hw *ah, -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 -deleted file mode 100644 -index 5e63a80..0000000 ---- a/package/kernel/mac80211/patches/335-brcmfmac-Fix-oops-when-SDIO-device-is-removed.patch -+++ /dev/null -@@ -1,44 +0,0 @@ --From: Hante Meuleman --Date: Fri, 6 Mar 2015 18:40:38 +0100 --Subject: [PATCH] brcmfmac: Fix oops when SDIO device is removed. -- --On removal of SDIO card both functions of card will be getting --a remove call. When the first is hanging in ctrl frame xmit then --the second will cause oops. This patch fixes the xmit ctrl --handling in case of serious errors and also limits the handling --for remove to function 1 only. -- --Reviewed-by: Arend Van Spriel --Reviewed-by: Franky (Zhenhui) Lin --Reviewed-by: Pieter-Paul Giesberts --Reviewed-by: Daniel (Deognyoun) Kim --Signed-off-by: Hante Meuleman --Signed-off-by: Arend van Spriel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c --@@ -1194,7 +1194,7 @@ static void brcmf_ops_sdio_remove(struct -- brcmf_dbg(SDIO, "sdio device ID: 0x%04x\n", func->device); -- brcmf_dbg(SDIO, "Function: %d\n", func->num); -- --- if (func->num != 1 && func->num != 2) --+ if (func->num != 1) -- return; -- -- bus_if = dev_get_drvdata(&func->dev); ----- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --@@ -2740,6 +2740,11 @@ static void brcmf_sdio_dpc(struct brcmf_ -- if ((bus->sdiodev->state != BRCMF_SDIOD_DATA) || (err != 0)) { -- brcmf_err("failed backplane access over SDIO, halting operation\n"); -- atomic_set(&bus->intstatus, 0); --+ if (bus->ctrl_frame_stat) { --+ bus->ctrl_frame_err = -ENODEV; --+ bus->ctrl_frame_stat = false; --+ brcmf_sdio_wait_event_wakeup(bus); --+ } -- } else if (atomic_read(&bus->intstatus) || -- atomic_read(&bus->ipend) > 0 || -- (!atomic_read(&bus->fcstate) && -diff --git a/package/kernel/mac80211/patches/336-brcmfmac-Simplify-watchdog-sleep.patch b/package/kernel/mac80211/patches/336-brcmfmac-Simplify-watchdog-sleep.patch -deleted file mode 100644 -index 201da75..0000000 ---- a/package/kernel/mac80211/patches/336-brcmfmac-Simplify-watchdog-sleep.patch -+++ /dev/null -@@ -1,157 +0,0 @@ --From: Hante Meuleman --Date: Fri, 6 Mar 2015 18:40:39 +0100 --Subject: [PATCH] brcmfmac: Simplify watchdog sleep. -- --The watchdog thread is used to put the SDIO bus to sleep when the --system is idling. This patch simplifies the way it is determined --when sleep can be entered. -- --Reviewed-by: Arend Van Spriel --Reviewed-by: Franky (Zhenhui) Lin --Reviewed-by: Pieter-Paul Giesberts --Reviewed-by: Daniel (Deognyoun) Kim --Signed-off-by: Hante Meuleman --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 --@@ -485,10 +485,9 @@ struct brcmf_sdio { -- #endif /* DEBUG */ -- -- uint clkstate; /* State of sd and backplane clock(s) */ --- bool activity; /* Activity flag for clock down */ -- s32 idletime; /* Control for activity timeout */ --- s32 idlecount; /* Activity timeout counter */ --- s32 idleclock; /* How to set bus driver when idle */ --+ s32 idlecount; /* Activity timeout counter */ --+ s32 idleclock; /* How to set bus driver when idle */ -- bool rxflow_mode; /* Rx flow control mode */ -- bool rxflow; /* Is rx flow control on */ -- bool alp_only; /* Don't use HT clock (ALP only) */ --@@ -511,6 +510,7 @@ struct brcmf_sdio { -- struct workqueue_struct *brcmf_wq; -- struct work_struct datawork; -- atomic_t dpc_tskcnt; --+ atomic_t dpc_running; -- -- bool txoff; /* Transmit flow-controlled */ -- struct brcmf_sdio_count sdcnt; --@@ -959,13 +959,8 @@ static int brcmf_sdio_clkctl(struct brcm -- brcmf_dbg(SDIO, "Enter\n"); -- -- /* Early exit if we're already there */ --- if (bus->clkstate == target) { --- if (target == CLK_AVAIL) { --- brcmf_sdio_wd_timer(bus, BRCMF_WD_POLL_MS); --- bus->activity = true; --- } --+ if (bus->clkstate == target) -- return 0; --- } -- -- switch (target) { -- case CLK_AVAIL: --@@ -975,7 +970,6 @@ static int brcmf_sdio_clkctl(struct brcm -- /* Now request HT Avail on the backplane */ -- brcmf_sdio_htclk(bus, true, pendok); -- brcmf_sdio_wd_timer(bus, BRCMF_WD_POLL_MS); --- bus->activity = true; -- break; -- -- case CLK_SDONLY: --@@ -1024,17 +1018,6 @@ brcmf_sdio_bus_sleep(struct brcmf_sdio * -- -- /* Going to sleep */ -- if (sleep) { --- /* Don't sleep if something is pending */ --- if (atomic_read(&bus->intstatus) || --- atomic_read(&bus->ipend) > 0 || --- bus->ctrl_frame_stat || --- (!atomic_read(&bus->fcstate) && --- brcmu_pktq_mlen(&bus->txq, ~bus->flowcontrol) && --- data_ok(bus))) { --- err = -EBUSY; --- goto done; --- } --- -- clkcsr = brcmf_sdiod_regrb(bus->sdiodev, -- SBSDIO_FUNC1_CHIPCLKCSR, -- &err); --@@ -1045,11 +1028,7 @@ brcmf_sdio_bus_sleep(struct brcmf_sdio * -- SBSDIO_ALP_AVAIL_REQ, &err); -- } -- err = brcmf_sdio_kso_control(bus, false); --- /* disable watchdog */ --- if (!err) --- brcmf_sdio_wd_timer(bus, 0); -- } else { --- bus->idlecount = 0; -- err = brcmf_sdio_kso_control(bus, true); -- } -- if (err) { --@@ -3566,7 +3545,7 @@ void brcmf_sdio_isr(struct brcmf_sdio *b -- queue_work(bus->brcmf_wq, &bus->datawork); -- } -- ---static bool brcmf_sdio_bus_watchdog(struct brcmf_sdio *bus) --+static void brcmf_sdio_bus_watchdog(struct brcmf_sdio *bus) -- { -- brcmf_dbg(TIMER, "Enter\n"); -- --@@ -3627,22 +3606,21 @@ static bool brcmf_sdio_bus_watchdog(stru -- #endif /* DEBUG */ -- -- /* On idle timeout clear activity flag and/or turn off clock */ --- if ((bus->idletime > 0) && (bus->clkstate == CLK_AVAIL)) { --- if (++bus->idlecount >= bus->idletime) { --+ if ((atomic_read(&bus->dpc_tskcnt) == 0) && --+ (atomic_read(&bus->dpc_running) == 0) && --+ (bus->idletime > 0) && (bus->clkstate == CLK_AVAIL)) { --+ bus->idlecount++; --+ if (bus->idlecount > bus->idletime) { --+ brcmf_dbg(SDIO, "idle\n"); --+ sdio_claim_host(bus->sdiodev->func[1]); --+ brcmf_sdio_wd_timer(bus, 0); -- bus->idlecount = 0; --- if (bus->activity) { --- bus->activity = false; --- brcmf_sdio_wd_timer(bus, BRCMF_WD_POLL_MS); --- } else { --- brcmf_dbg(SDIO, "idle\n"); --- sdio_claim_host(bus->sdiodev->func[1]); --- brcmf_sdio_bus_sleep(bus, true, false); --- sdio_release_host(bus->sdiodev->func[1]); --- } --+ brcmf_sdio_bus_sleep(bus, true, false); --+ sdio_release_host(bus->sdiodev->func[1]); -- } --+ } else { --+ bus->idlecount = 0; -- } --- --- return (atomic_read(&bus->ipend) > 0); -- } -- -- static void brcmf_sdio_dataworker(struct work_struct *work) --@@ -3651,8 +3629,11 @@ static void brcmf_sdio_dataworker(struct -- datawork); -- -- while (atomic_read(&bus->dpc_tskcnt)) { --+ atomic_set(&bus->dpc_running, 1); -- atomic_set(&bus->dpc_tskcnt, 0); -- brcmf_sdio_dpc(bus); --+ bus->idlecount = 0; --+ atomic_set(&bus->dpc_running, 0); -- } -- if (brcmf_sdiod_freezing(bus->sdiodev)) { -- brcmf_sdiod_change_state(bus->sdiodev, BRCMF_SDIOD_DOWN); --@@ -4154,6 +4135,7 @@ struct brcmf_sdio *brcmf_sdio_probe(stru -- } -- /* Initialize DPC thread */ -- atomic_set(&bus->dpc_tskcnt, 0); --+ atomic_set(&bus->dpc_running, 0); -- -- /* 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 -deleted file mode 100644 -index 3a2de7a..0000000 ---- a/package/kernel/mac80211/patches/337-brcmfmac-Fix-possible-race-condition.patch -+++ /dev/null -@@ -1,83 +0,0 @@ --From: Hante Meuleman --Date: Fri, 6 Mar 2015 18:40:40 +0100 --Subject: [PATCH] brcmfmac: Fix possible race-condition. -- --SDIO is using a "shared" variable to handoff ctl frames to DPC --and to see when they are done. In a timeout situation this can --lead to erroneous situation where DPC started to handle the ctl --frame while the timeout expired. This patch will fix this by --adding locking around the shared variable. -- --Reviewed-by: Arend Van Spriel --Reviewed-by: Franky (Zhenhui) Lin --Reviewed-by: Pieter-Paul Giesberts --Reviewed-by: Daniel (Deognyoun) Kim --Signed-off-by: Hante Meuleman --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 --@@ -2700,11 +2700,13 @@ static void brcmf_sdio_dpc(struct brcmf_ -- if (bus->ctrl_frame_stat && (bus->clkstate == CLK_AVAIL) && -- data_ok(bus)) { -- sdio_claim_host(bus->sdiodev->func[1]); --- err = brcmf_sdio_tx_ctrlframe(bus, bus->ctrl_frame_buf, --- bus->ctrl_frame_len); --+ if (bus->ctrl_frame_stat) { --+ err = brcmf_sdio_tx_ctrlframe(bus, bus->ctrl_frame_buf, --+ bus->ctrl_frame_len); --+ bus->ctrl_frame_err = err; --+ bus->ctrl_frame_stat = false; --+ } -- sdio_release_host(bus->sdiodev->func[1]); --- bus->ctrl_frame_err = err; --- bus->ctrl_frame_stat = false; -- brcmf_sdio_wait_event_wakeup(bus); -- } -- /* Send queued frames (limit 1 if rx may still be pending) */ --@@ -2720,9 +2722,13 @@ static void brcmf_sdio_dpc(struct brcmf_ -- brcmf_err("failed backplane access over SDIO, halting operation\n"); -- atomic_set(&bus->intstatus, 0); -- if (bus->ctrl_frame_stat) { --- bus->ctrl_frame_err = -ENODEV; --- bus->ctrl_frame_stat = false; --- brcmf_sdio_wait_event_wakeup(bus); --+ sdio_claim_host(bus->sdiodev->func[1]); --+ if (bus->ctrl_frame_stat) { --+ bus->ctrl_frame_err = -ENODEV; --+ bus->ctrl_frame_stat = false; --+ brcmf_sdio_wait_event_wakeup(bus); --+ } --+ sdio_release_host(bus->sdiodev->func[1]); -- } -- } else if (atomic_read(&bus->intstatus) || -- atomic_read(&bus->ipend) > 0 || --@@ -2930,15 +2936,20 @@ brcmf_sdio_bus_txctl(struct device *dev, -- brcmf_sdio_trigger_dpc(bus); -- wait_event_interruptible_timeout(bus->ctrl_wait, !bus->ctrl_frame_stat, -- msecs_to_jiffies(CTL_DONE_TIMEOUT)); --- --- if (!bus->ctrl_frame_stat) { --+ ret = 0; --+ if (bus->ctrl_frame_stat) { --+ sdio_claim_host(bus->sdiodev->func[1]); --+ if (bus->ctrl_frame_stat) { --+ brcmf_dbg(SDIO, "ctrl_frame timeout\n"); --+ bus->ctrl_frame_stat = false; --+ ret = -ETIMEDOUT; --+ } --+ sdio_release_host(bus->sdiodev->func[1]); --+ } --+ if (!ret) { -- brcmf_dbg(SDIO, "ctrl_frame complete, err=%d\n", -- bus->ctrl_frame_err); -- ret = bus->ctrl_frame_err; --- } else { --- brcmf_dbg(SDIO, "ctrl_frame timeout\n"); --- bus->ctrl_frame_stat = false; --- ret = -ETIMEDOUT; -- } -- -- if (ret) -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 -deleted file mode 100644 -index c9eb900..0000000 ---- a/package/kernel/mac80211/patches/338-brcmfmac-Add-support-for-BCM4345-SDIO-chipset.patch -+++ /dev/null -@@ -1,86 +0,0 @@ --From: Syed Asifful Dayyan --Date: Fri, 6 Mar 2015 18:40:42 +0100 --Subject: [PATCH] brcmfmac: Add support for BCM4345 SDIO chipset. -- --These changes add support for BCM4345 SDIO chipset. -- --Reviewed-by: Pieter-Paul Giesberts --Reviewed-by: Arend Van Spriel --Reviewed-by: Hante Meuleman --Reviewed-by: Daniel (Deognyoun) Kim --Signed-off-by: Syed Asifful Dayyan --Signed-off-by: Arend van Spriel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c --@@ -1096,6 +1096,7 @@ static const struct sdio_device_id brcmf -- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43341), -- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43362), -- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4335_4339), --+ BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4345), -- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4354), -- { /* end: all zeroes */ } -- }; ----- a/drivers/net/wireless/brcm80211/brcmfmac/chip.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c --@@ -491,6 +491,10 @@ static void brcmf_chip_get_raminfo(struc -- case BRCM_CC_43362_CHIP_ID: -- ci->pub.ramsize = 0x3c000; -- break; --+ case BRCM_CC_4345_CHIP_ID: --+ ci->pub.ramsize = 0xc8000; --+ ci->pub.rambase = 0x198000; --+ break; -- case BRCM_CC_4339_CHIP_ID: -- case BRCM_CC_4354_CHIP_ID: -- case BRCM_CC_4356_CHIP_ID: ----- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --@@ -617,6 +617,8 @@ static const struct sdiod_drive_str sdio -- #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 BCM4345_FIRMWARE_NAME "brcm/brcmfmac4345-sdio.bin" --+#define BCM4345_NVRAM_NAME "brcm/brcmfmac4345-sdio.txt" -- #define BCM4354_FIRMWARE_NAME "brcm/brcmfmac4354-sdio.bin" -- #define BCM4354_NVRAM_NAME "brcm/brcmfmac4354-sdio.txt" -- --@@ -640,6 +642,8 @@ MODULE_FIRMWARE(BCM43362_FIRMWARE_NAME); -- MODULE_FIRMWARE(BCM43362_NVRAM_NAME); -- MODULE_FIRMWARE(BCM4339_FIRMWARE_NAME); -- MODULE_FIRMWARE(BCM4339_NVRAM_NAME); --+MODULE_FIRMWARE(BCM4345_FIRMWARE_NAME); --+MODULE_FIRMWARE(BCM4345_NVRAM_NAME); -- MODULE_FIRMWARE(BCM4354_FIRMWARE_NAME); -- MODULE_FIRMWARE(BCM4354_NVRAM_NAME); -- --@@ -669,6 +673,7 @@ static const struct brcmf_firmware_names -- { 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_4345_CHIP_ID, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4345) }, -- { BRCM_CC_4354_CHIP_ID, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4354) } -- }; -- ----- a/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h --+++ b/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h --@@ -37,6 +37,7 @@ -- #define BRCM_CC_43362_CHIP_ID 43362 -- #define BRCM_CC_4335_CHIP_ID 0x4335 -- #define BRCM_CC_4339_CHIP_ID 0x4339 --+#define BRCM_CC_4345_CHIP_ID 0x4345 -- #define BRCM_CC_4354_CHIP_ID 0x4354 -- #define BRCM_CC_4356_CHIP_ID 0x4356 -- #define BRCM_CC_43566_CHIP_ID 43566 ----- a/include/linux/mmc/sdio_ids.h --+++ b/include/linux/mmc/sdio_ids.h --@@ -33,6 +33,7 @@ -- #define SDIO_DEVICE_ID_BROADCOM_43341 0xa94d -- #define SDIO_DEVICE_ID_BROADCOM_4335_4339 0x4335 -- #define SDIO_DEVICE_ID_BROADCOM_43362 0xa962 --+#define SDIO_DEVICE_ID_BROADCOM_4345 0x4345 -- #define SDIO_DEVICE_ID_BROADCOM_4354 0x4354 -- -- #define SDIO_VENDOR_ID_INTEL 0x0089 -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 -deleted file mode 100644 -index 7a688c4..0000000 ---- a/package/kernel/mac80211/patches/339-brcmfmac-remove-duplication-of-ramsize-info.patch -+++ /dev/null -@@ -1,48 +0,0 @@ --From: Arend van Spriel --Date: Wed, 11 Mar 2015 16:11:27 +0100 --Subject: [PATCH] brcmfmac: remove duplication of ramsize info -- --Removing the ramsize from the brcmf_sdio structure to avoid --duplication. The information is available in brcmf_chip --structure. -- --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/sdio.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --@@ -432,8 +432,6 @@ struct brcmf_sdio { -- struct brcmf_sdio_dev *sdiodev; /* sdio device handler */ -- struct brcmf_chip *ci; /* Chip info struct */ -- --- u32 ramsize; /* Size of RAM in SOCRAM (bytes) */ --- -- u32 hostintmask; /* Copy of Host Interrupt Mask */ -- atomic_t intstatus; /* Intstatus bits (events) pending */ -- atomic_t fcstate; /* State of dongle flow-control */ --@@ -1075,7 +1073,7 @@ static int brcmf_sdio_readshared(struct -- struct sdpcm_shared_le sh_le; -- __le32 addr_le; -- --- shaddr = bus->ci->rambase + bus->ramsize - 4; --+ shaddr = bus->ci->rambase + bus->ci->ramsize - 4; -- -- /* -- * Read last word in socram to determine --@@ -3871,13 +3869,6 @@ brcmf_sdio_probe_attach(struct brcmf_sdi -- drivestrength = DEFAULT_SDIO_DRIVE_STRENGTH; -- brcmf_sdio_drivestrengthinit(bus->sdiodev, bus->ci, drivestrength); -- --- /* Get info on the SOCRAM cores... */ --- bus->ramsize = bus->ci->ramsize; --- if (!(bus->ramsize)) { --- brcmf_err("failed to find SOCRAM memory!\n"); --- goto fail; --- } --- -- /* 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 -deleted file mode 100644 -index e2a2074..0000000 ---- a/package/kernel/mac80211/patches/340-brcmfmac-always-perform-cores-checks.patch -+++ /dev/null -@@ -1,74 +0,0 @@ --From: Arend van Spriel --Date: Wed, 11 Mar 2015 16:11:28 +0100 --Subject: [PATCH] brcmfmac: always perform cores checks -- --Instead of checking the cores in the chip only if CONFIG_BRCMDBG --is selected perform the check always and extend it with more sanity --checking. -- --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/chip.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c --@@ -419,13 +419,13 @@ static struct brcmf_core *brcmf_chip_add -- return &core->pub; -- } -- ---#ifdef DEBUG -- /* safety check for chipinfo */ -- static int brcmf_chip_cores_check(struct brcmf_chip_priv *ci) -- { -- struct brcmf_core_priv *core; -- bool need_socram = false; -- bool has_socram = false; --+ bool cpu_found = false; -- int idx = 1; -- -- list_for_each_entry(core, &ci->cores, list) { --@@ -435,12 +435,14 @@ static int brcmf_chip_cores_check(struct -- -- switch (core->pub.id) { -- case BCMA_CORE_ARM_CM3: --+ cpu_found = true; -- need_socram = true; -- break; -- case BCMA_CORE_INTERNAL_MEM: -- has_socram = true; -- break; -- case BCMA_CORE_ARM_CR4: --+ cpu_found = true; -- if (ci->pub.rambase == 0) { -- brcmf_err("RAM base not provided with ARM CR4 core\n"); -- return -ENOMEM; --@@ -451,19 +453,21 @@ static int brcmf_chip_cores_check(struct -- } -- } -- --+ if (!cpu_found) { --+ brcmf_err("CPU core not detected\n"); --+ return -ENXIO; --+ } -- /* check RAM core presence for ARM CM3 core */ -- if (need_socram && !has_socram) { -- brcmf_err("RAM core not provided with ARM CM3 core\n"); -- return -ENODEV; -- } --+ if (!ci->pub.ramsize) { --+ brcmf_err("RAM size is undetermined\n"); --+ return -ENOMEM; --+ } -- return 0; -- } ---#else /* DEBUG */ ---static inline int brcmf_chip_cores_check(struct brcmf_chip_priv *ci) ---{ --- return 0; ---} ---#endif -- -- 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 -deleted file mode 100644 -index a272800..0000000 ---- a/package/kernel/mac80211/patches/341-brcmfmac-rename-chip-download-functions.patch -+++ /dev/null -@@ -1,240 +0,0 @@ --From: Arend van Spriel --Date: Wed, 11 Mar 2015 16:11:29 +0100 --Subject: [PATCH] brcmfmac: rename chip download functions -- --The functions brcmf_chip_[enter/exit]_download() are not exclusively --used for firmware download so rename these more appropriate. -- --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/chip.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c --@@ -807,7 +807,7 @@ struct brcmf_chip *brcmf_chip_attach(voi -- err = -EINVAL; -- if (WARN_ON(!ops->prepare)) -- err = -EINVAL; --- if (WARN_ON(!ops->exit_dl)) --+ if (WARN_ON(!ops->activate)) -- err = -EINVAL; -- if (err < 0) -- return ERR_PTR(-EINVAL); --@@ -905,7 +905,7 @@ void brcmf_chip_resetcore(struct brcmf_c -- } -- -- static void ---brcmf_chip_cm3_enterdl(struct brcmf_chip_priv *chip) --+brcmf_chip_cm3_set_passive(struct brcmf_chip_priv *chip) -- { -- struct brcmf_core *core; -- --@@ -919,7 +919,7 @@ brcmf_chip_cm3_enterdl(struct brcmf_chip -- brcmf_chip_resetcore(core, 0, 0, 0); -- } -- ---static bool brcmf_chip_cm3_exitdl(struct brcmf_chip_priv *chip) --+static bool brcmf_chip_cm3_set_active(struct brcmf_chip_priv *chip) -- { -- struct brcmf_core *core; -- --@@ -929,7 +929,7 @@ static bool brcmf_chip_cm3_exitdl(struct -- return false; -- } -- --- chip->ops->exit_dl(chip->ctx, &chip->pub, 0); --+ chip->ops->activate(chip->ctx, &chip->pub, 0); -- -- core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_ARM_CM3); -- brcmf_chip_resetcore(core, 0, 0, 0); --@@ -938,7 +938,7 @@ static bool brcmf_chip_cm3_exitdl(struct -- } -- -- static inline void ---brcmf_chip_cr4_enterdl(struct brcmf_chip_priv *chip) --+brcmf_chip_cr4_set_passive(struct brcmf_chip_priv *chip) -- { -- struct brcmf_core *core; -- --@@ -951,11 +951,11 @@ brcmf_chip_cr4_enterdl(struct brcmf_chip -- D11_BCMA_IOCTL_PHYCLOCKEN); -- } -- ---static bool brcmf_chip_cr4_exitdl(struct brcmf_chip_priv *chip, u32 rstvec) --+static bool brcmf_chip_cr4_set_active(struct brcmf_chip_priv *chip, u32 rstvec) -- { -- struct brcmf_core *core; -- --- chip->ops->exit_dl(chip->ctx, &chip->pub, rstvec); --+ chip->ops->activate(chip->ctx, &chip->pub, rstvec); -- -- /* restore ARM */ -- core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_ARM_CR4); --@@ -964,7 +964,7 @@ static bool brcmf_chip_cr4_exitdl(struct -- return true; -- } -- ---void brcmf_chip_enter_download(struct brcmf_chip *pub) --+void brcmf_chip_set_passive(struct brcmf_chip *pub) -- { -- struct brcmf_chip_priv *chip; -- struct brcmf_core *arm; --@@ -974,14 +974,14 @@ void brcmf_chip_enter_download(struct br -- chip = container_of(pub, struct brcmf_chip_priv, pub); -- arm = brcmf_chip_get_core(pub, BCMA_CORE_ARM_CR4); -- if (arm) { --- brcmf_chip_cr4_enterdl(chip); --+ brcmf_chip_cr4_set_passive(chip); -- return; -- } -- --- brcmf_chip_cm3_enterdl(chip); --+ brcmf_chip_cm3_set_passive(chip); -- } -- ---bool brcmf_chip_exit_download(struct brcmf_chip *pub, u32 rstvec) --+bool brcmf_chip_set_active(struct brcmf_chip *pub, u32 rstvec) -- { -- struct brcmf_chip_priv *chip; -- struct brcmf_core *arm; --@@ -991,9 +991,9 @@ bool brcmf_chip_exit_download(struct brc -- chip = container_of(pub, struct brcmf_chip_priv, pub); -- arm = brcmf_chip_get_core(pub, BCMA_CORE_ARM_CR4); -- if (arm) --- return brcmf_chip_cr4_exitdl(chip, rstvec); --+ return brcmf_chip_cr4_set_active(chip, rstvec); -- --- return brcmf_chip_cm3_exitdl(chip); --+ return brcmf_chip_cm3_set_active(chip); -- } -- -- bool brcmf_chip_sr_capable(struct brcmf_chip *pub) ----- a/drivers/net/wireless/brcm80211/brcmfmac/chip.h --+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.h --@@ -64,7 +64,7 @@ struct brcmf_core { -- * @write32: write 32-bit value over bus. -- * @prepare: prepare bus for core configuration. -- * @setup: bus-specific core setup. --- * @exit_dl: exit download state. --+ * @active: chip becomes active. -- * The callback should use the provided @rstvec when non-zero. -- */ -- struct brcmf_buscore_ops { --@@ -72,7 +72,7 @@ struct brcmf_buscore_ops { -- void (*write32)(void *ctx, u32 addr, u32 value); -- int (*prepare)(void *ctx); -- int (*setup)(void *ctx, struct brcmf_chip *chip); --- void (*exit_dl)(void *ctx, struct brcmf_chip *chip, u32 rstvec); --+ void (*activate)(void *ctx, struct brcmf_chip *chip, u32 rstvec); -- }; -- -- struct brcmf_chip *brcmf_chip_attach(void *ctx, --@@ -84,8 +84,8 @@ bool brcmf_chip_iscoreup(struct brcmf_co -- void brcmf_chip_coredisable(struct brcmf_core *core, u32 prereset, u32 reset); -- void brcmf_chip_resetcore(struct brcmf_core *core, u32 prereset, u32 reset, -- u32 postreset); ---void brcmf_chip_enter_download(struct brcmf_chip *ci); ---bool brcmf_chip_exit_download(struct brcmf_chip *ci, u32 rstvec); --+void brcmf_chip_set_passive(struct brcmf_chip *ci); --+bool brcmf_chip_set_active(struct brcmf_chip *ci, u32 rstvec); -- bool brcmf_chip_sr_capable(struct brcmf_chip *pub); -- -- #endif /* BRCMF_AXIDMP_H */ ----- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --@@ -509,7 +509,7 @@ static void brcmf_pcie_attach(struct brc -- -- static int brcmf_pcie_enter_download_state(struct brcmf_pciedev_info *devinfo) -- { --- brcmf_chip_enter_download(devinfo->ci); --+ brcmf_chip_set_passive(devinfo->ci); -- -- if (devinfo->ci->chip == BRCM_CC_43602_CHIP_ID) { -- brcmf_pcie_select_core(devinfo, BCMA_CORE_ARM_CR4); --@@ -536,7 +536,7 @@ static int brcmf_pcie_exit_download_stat -- brcmf_chip_resetcore(core, 0, 0, 0); -- } -- --- return !brcmf_chip_exit_download(devinfo->ci, resetintr); --+ return !brcmf_chip_set_active(devinfo->ci, resetintr); -- } -- -- --@@ -1566,8 +1566,8 @@ static int brcmf_pcie_buscoreprep(void * -- } -- -- ---static void brcmf_pcie_buscore_exitdl(void *ctx, struct brcmf_chip *chip, --- u32 rstvec) --+static void brcmf_pcie_buscore_activate(void *ctx, struct brcmf_chip *chip, --+ u32 rstvec) -- { -- struct brcmf_pciedev_info *devinfo = (struct brcmf_pciedev_info *)ctx; -- --@@ -1577,7 +1577,7 @@ static void brcmf_pcie_buscore_exitdl(vo -- -- static const struct brcmf_buscore_ops brcmf_pcie_buscore_ops = { -- .prepare = brcmf_pcie_buscoreprep, --- .exit_dl = brcmf_pcie_buscore_exitdl, --+ .activate = brcmf_pcie_buscore_activate, -- .read32 = brcmf_pcie_buscore_read32, -- .write32 = brcmf_pcie_buscore_write32, -- }; ----- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --@@ -3357,7 +3357,7 @@ static int brcmf_sdio_download_firmware( -- brcmf_sdio_clkctl(bus, CLK_AVAIL, false); -- -- /* Keep arm in reset */ --- brcmf_chip_enter_download(bus->ci); --+ brcmf_chip_set_passive(bus->ci); -- -- rstvec = get_unaligned_le32(fw->data); -- brcmf_dbg(SDIO, "firmware rstvec: %x\n", rstvec); --@@ -3378,7 +3378,7 @@ static int brcmf_sdio_download_firmware( -- } -- -- /* Take arm out of reset */ --- if (!brcmf_chip_exit_download(bus->ci, rstvec)) { --+ if (!brcmf_chip_set_active(bus->ci, rstvec)) { -- brcmf_err("error getting out of ARM core reset\n"); -- goto err; -- } --@@ -3771,8 +3771,8 @@ static int brcmf_sdio_buscoreprep(void * -- return 0; -- } -- ---static void brcmf_sdio_buscore_exitdl(void *ctx, struct brcmf_chip *chip, --- u32 rstvec) --+static void brcmf_sdio_buscore_activate(void *ctx, struct brcmf_chip *chip, --+ u32 rstvec) -- { -- struct brcmf_sdio_dev *sdiodev = ctx; -- struct brcmf_core *core; --@@ -3815,7 +3815,7 @@ static void brcmf_sdio_buscore_write32(v -- -- static const struct brcmf_buscore_ops brcmf_sdio_buscore_ops = { -- .prepare = brcmf_sdio_buscoreprep, --- .exit_dl = brcmf_sdio_buscore_exitdl, --+ .activate = brcmf_sdio_buscore_activate, -- .read32 = brcmf_sdio_buscore_read32, -- .write32 = brcmf_sdio_buscore_write32, -- }; --@@ -4239,12 +4239,11 @@ void brcmf_sdio_remove(struct brcmf_sdio -- sdio_claim_host(bus->sdiodev->func[1]); -- brcmf_sdio_clkctl(bus, CLK_AVAIL, false); -- /* Leave the device in state where it is --- * 'quiet'. This is done by putting it in --- * download_state which essentially resets --- * all necessary cores. --+ * 'passive'. This is done by resetting all --+ * necessary cores. -- */ -- msleep(20); --- brcmf_chip_enter_download(bus->ci); --+ brcmf_chip_set_passive(bus->ci); -- 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 -deleted file mode 100644 -index 6b1dd81..0000000 ---- a/package/kernel/mac80211/patches/342-brcmfmac-assure-device-is-ready-for-download-after-b.patch -+++ /dev/null -@@ -1,61 +0,0 @@ --From: Arend van Spriel --Date: Wed, 11 Mar 2015 16:11:30 +0100 --Subject: [PATCH] brcmfmac: assure device is ready for download after -- brcmf_chip_attach() -- --Make the brcmf_chip_attach() function responsible for putting the --device in a state where it is accessible for firmware download. -- --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/chip.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c --@@ -786,12 +786,6 @@ static int brcmf_chip_setup(struct brcmf -- if (chip->ops->setup) -- ret = chip->ops->setup(chip->ctx, pub); -- --- /* --- * Make sure any on-chip ARM is off (in case strapping is wrong), --- * or downloaded code was already running. --- */ --- brcmf_chip_disable_arm(chip, BCMA_CORE_ARM_CM3); --- brcmf_chip_disable_arm(chip, BCMA_CORE_ARM_CR4); -- return ret; -- } -- --@@ -833,6 +827,8 @@ struct brcmf_chip *brcmf_chip_attach(voi -- if (err < 0) -- goto fail; -- --+ /* assure chip is passive for download */ --+ brcmf_chip_set_passive(&chip->pub); -- return &chip->pub; -- -- fail: ----- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --@@ -509,8 +509,6 @@ static void brcmf_pcie_attach(struct brc -- -- static int brcmf_pcie_enter_download_state(struct brcmf_pciedev_info *devinfo) -- { --- brcmf_chip_set_passive(devinfo->ci); --- -- if (devinfo->ci->chip == BRCM_CC_43602_CHIP_ID) { -- brcmf_pcie_select_core(devinfo, BCMA_CORE_ARM_CR4); -- brcmf_pcie_write_reg32(devinfo, BRCMF_PCIE_ARMCR4REG_BANKIDX, ----- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --@@ -3356,9 +3356,6 @@ static int brcmf_sdio_download_firmware( -- sdio_claim_host(bus->sdiodev->func[1]); -- brcmf_sdio_clkctl(bus, CLK_AVAIL, false); -- --- /* Keep arm in reset */ --- brcmf_chip_set_passive(bus->ci); --- -- 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 -deleted file mode 100644 -index bcc2ed4..0000000 ---- a/package/kernel/mac80211/patches/343-brcmfmac-extract-ram-size-info-from-internal-memory-.patch -+++ /dev/null -@@ -1,367 +0,0 @@ --From: Arend van Spriel --Date: Wed, 11 Mar 2015 16:11:31 +0100 --Subject: [PATCH] brcmfmac: extract ram size info from internal memory -- registers -- --Instead of hard-coded memory sizes it is possible to obtain that --information from the internal memory registers. -- --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/chip.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c --@@ -100,9 +100,6 @@ -- #define BCM4329_CORE_SOCRAM_BASE 0x18003000 -- /* ARM Cortex M3 core, ID 0x82a */ -- #define BCM4329_CORE_ARM_BASE 0x18002000 ---#define BCM4329_RAMSIZE 0x48000 ---/* bcm43143 */ ---#define BCM43143_RAMSIZE 0x70000 -- -- #define CORE_SB(base, field) \ -- (base + SBCONFIGOFF + offsetof(struct sbconfig, field)) --@@ -150,6 +147,78 @@ struct sbconfig { -- u32 sbidhigh; /* identification */ -- }; -- --+/* bankidx and bankinfo reg defines corerev >= 8 */ --+#define SOCRAM_BANKINFO_RETNTRAM_MASK 0x00010000 --+#define SOCRAM_BANKINFO_SZMASK 0x0000007f --+#define SOCRAM_BANKIDX_ROM_MASK 0x00000100 --+ --+#define SOCRAM_BANKIDX_MEMTYPE_SHIFT 8 --+/* socram bankinfo memtype */ --+#define SOCRAM_MEMTYPE_RAM 0 --+#define SOCRAM_MEMTYPE_R0M 1 --+#define SOCRAM_MEMTYPE_DEVRAM 2 --+ --+#define SOCRAM_BANKINFO_SZBASE 8192 --+#define SRCI_LSS_MASK 0x00f00000 --+#define SRCI_LSS_SHIFT 20 --+#define SRCI_SRNB_MASK 0xf0 --+#define SRCI_SRNB_SHIFT 4 --+#define SRCI_SRBSZ_MASK 0xf --+#define SRCI_SRBSZ_SHIFT 0 --+#define SR_BSZ_BASE 14 --+ --+struct sbsocramregs { --+ u32 coreinfo; --+ u32 bwalloc; --+ u32 extracoreinfo; --+ u32 biststat; --+ u32 bankidx; --+ u32 standbyctrl; --+ --+ u32 errlogstatus; /* rev 6 */ --+ u32 errlogaddr; /* rev 6 */ --+ /* used for patching rev 3 & 5 */ --+ u32 cambankidx; --+ u32 cambankstandbyctrl; --+ u32 cambankpatchctrl; --+ u32 cambankpatchtblbaseaddr; --+ u32 cambankcmdreg; --+ u32 cambankdatareg; --+ u32 cambankmaskreg; --+ u32 PAD[1]; --+ u32 bankinfo; /* corev 8 */ --+ u32 bankpda; --+ u32 PAD[14]; --+ u32 extmemconfig; --+ u32 extmemparitycsr; --+ u32 extmemparityerrdata; --+ u32 extmemparityerrcnt; --+ u32 extmemwrctrlandsize; --+ u32 PAD[84]; --+ u32 workaround; --+ u32 pwrctl; /* corerev >= 2 */ --+ u32 PAD[133]; --+ u32 sr_control; /* corerev >= 15 */ --+ u32 sr_status; /* corerev >= 15 */ --+ u32 sr_address; /* corerev >= 15 */ --+ u32 sr_data; /* corerev >= 15 */ --+}; --+ --+#define SOCRAMREGOFFS(_f) offsetof(struct sbsocramregs, _f) --+ --+#define ARMCR4_CAP (0x04) --+#define ARMCR4_BANKIDX (0x40) --+#define ARMCR4_BANKINFO (0x44) --+#define ARMCR4_BANKPDA (0x4C) --+ --+#define ARMCR4_TCBBNB_MASK 0xf0 --+#define ARMCR4_TCBBNB_SHIFT 4 --+#define ARMCR4_TCBANB_MASK 0xf --+#define ARMCR4_TCBANB_SHIFT 0 --+ --+#define ARMCR4_BSZ_MASK 0x3f --+#define ARMCR4_BSZ_MULT 8192 --+ -- struct brcmf_core_priv { -- struct brcmf_core pub; -- u32 wrapbase; --@@ -443,10 +512,6 @@ static int brcmf_chip_cores_check(struct -- break; -- case BCMA_CORE_ARM_CR4: -- cpu_found = true; --- if (ci->pub.rambase == 0) { --- brcmf_err("RAM base not provided with ARM CR4 core\n"); --- return -ENOMEM; --- } -- break; -- default: -- break; --@@ -462,60 +527,160 @@ static int brcmf_chip_cores_check(struct -- brcmf_err("RAM core not provided with ARM CM3 core\n"); -- return -ENODEV; -- } --- if (!ci->pub.ramsize) { --- brcmf_err("RAM size is undetermined\n"); --- return -ENOMEM; --- } -- return 0; -- } -- ---static void brcmf_chip_get_raminfo(struct brcmf_chip_priv *ci) --+static u32 brcmf_chip_core_read32(struct brcmf_core_priv *core, u16 reg) -- { --- switch (ci->pub.chip) { --- case BRCM_CC_4329_CHIP_ID: --- ci->pub.ramsize = BCM4329_RAMSIZE; --- break; --- case BRCM_CC_43143_CHIP_ID: --- ci->pub.ramsize = BCM43143_RAMSIZE; --- break; --- case BRCM_CC_43241_CHIP_ID: --- ci->pub.ramsize = 0x90000; --- break; --- case BRCM_CC_4330_CHIP_ID: --- ci->pub.ramsize = 0x48000; --- break; --+ return core->chip->ops->read32(core->chip->ctx, core->pub.base + reg); --+} --+ --+static void brcmf_chip_core_write32(struct brcmf_core_priv *core, --+ u16 reg, u32 val) --+{ --+ core->chip->ops->write32(core->chip->ctx, core->pub.base + reg, val); --+} --+ --+static bool brcmf_chip_socram_banksize(struct brcmf_core_priv *core, u8 idx, --+ u32 *banksize) --+{ --+ u32 bankinfo; --+ u32 bankidx = (SOCRAM_MEMTYPE_RAM << SOCRAM_BANKIDX_MEMTYPE_SHIFT); --+ --+ bankidx |= idx; --+ brcmf_chip_core_write32(core, SOCRAMREGOFFS(bankidx), bankidx); --+ bankinfo = brcmf_chip_core_read32(core, SOCRAMREGOFFS(bankinfo)); --+ *banksize = (bankinfo & SOCRAM_BANKINFO_SZMASK) + 1; --+ *banksize *= SOCRAM_BANKINFO_SZBASE; --+ return !!(bankinfo & SOCRAM_BANKINFO_RETNTRAM_MASK); --+} --+ --+static void brcmf_chip_socram_ramsize(struct brcmf_core_priv *sr, u32 *ramsize, --+ u32 *srsize) --+{ --+ u32 coreinfo; --+ uint nb, banksize, lss; --+ bool retent; --+ int i; --+ --+ *ramsize = 0; --+ *srsize = 0; --+ --+ if (WARN_ON(sr->pub.rev < 4)) --+ return; --+ --+ if (!brcmf_chip_iscoreup(&sr->pub)) --+ brcmf_chip_resetcore(&sr->pub, 0, 0, 0); --+ --+ /* Get info for determining size */ --+ coreinfo = brcmf_chip_core_read32(sr, SOCRAMREGOFFS(coreinfo)); --+ nb = (coreinfo & SRCI_SRNB_MASK) >> SRCI_SRNB_SHIFT; --+ --+ if ((sr->pub.rev <= 7) || (sr->pub.rev == 12)) { --+ banksize = (coreinfo & SRCI_SRBSZ_MASK); --+ lss = (coreinfo & SRCI_LSS_MASK) >> SRCI_LSS_SHIFT; --+ if (lss != 0) --+ nb--; --+ *ramsize = nb * (1 << (banksize + SR_BSZ_BASE)); --+ if (lss != 0) --+ *ramsize += (1 << ((lss - 1) + SR_BSZ_BASE)); --+ } else { --+ nb = (coreinfo & SRCI_SRNB_MASK) >> SRCI_SRNB_SHIFT; --+ for (i = 0; i < nb; i++) { --+ retent = brcmf_chip_socram_banksize(sr, i, &banksize); --+ *ramsize += banksize; --+ if (retent) --+ *srsize += banksize; --+ } --+ } --+ --+ /* hardcoded save&restore memory sizes */ --+ switch (sr->chip->pub.chip) { -- case BRCM_CC_4334_CHIP_ID: --- case BRCM_CC_43340_CHIP_ID: --- ci->pub.ramsize = 0x80000; --+ if (sr->chip->pub.chiprev < 2) --+ *srsize = (32 * 1024); -- break; --- case BRCM_CC_4335_CHIP_ID: --- ci->pub.ramsize = 0xc0000; --- ci->pub.rambase = 0x180000; --- break; --- case BRCM_CC_43362_CHIP_ID: --- ci->pub.ramsize = 0x3c000; --+ default: -- break; --+ } --+} --+ --+/** Return the TCM-RAM size of the ARMCR4 core. */ --+static u32 brcmf_chip_tcm_ramsize(struct brcmf_core_priv *cr4) --+{ --+ u32 corecap; --+ u32 memsize = 0; --+ u32 nab; --+ u32 nbb; --+ u32 totb; --+ u32 bxinfo; --+ u32 idx; --+ --+ corecap = brcmf_chip_core_read32(cr4, ARMCR4_CAP); --+ --+ nab = (corecap & ARMCR4_TCBANB_MASK) >> ARMCR4_TCBANB_SHIFT; --+ nbb = (corecap & ARMCR4_TCBBNB_MASK) >> ARMCR4_TCBBNB_SHIFT; --+ totb = nab + nbb; --+ --+ for (idx = 0; idx < totb; idx++) { --+ brcmf_chip_core_write32(cr4, ARMCR4_BANKIDX, idx); --+ bxinfo = brcmf_chip_core_read32(cr4, ARMCR4_BANKINFO); --+ memsize += ((bxinfo & ARMCR4_BSZ_MASK) + 1) * ARMCR4_BSZ_MULT; --+ } --+ --+ return memsize; --+} --+ --+static u32 brcmf_chip_tcm_rambase(struct brcmf_chip_priv *ci) --+{ --+ switch (ci->pub.chip) { -- case BRCM_CC_4345_CHIP_ID: --- ci->pub.ramsize = 0xc8000; --- ci->pub.rambase = 0x198000; --- break; --+ return 0x198000; --+ case BRCM_CC_4335_CHIP_ID: -- case BRCM_CC_4339_CHIP_ID: -- case BRCM_CC_4354_CHIP_ID: -- case BRCM_CC_4356_CHIP_ID: -- case BRCM_CC_43567_CHIP_ID: -- case BRCM_CC_43569_CHIP_ID: -- case BRCM_CC_43570_CHIP_ID: --- ci->pub.ramsize = 0xc0000; --- ci->pub.rambase = 0x180000; --- break; -- case BRCM_CC_43602_CHIP_ID: --- ci->pub.ramsize = 0xf0000; --- ci->pub.rambase = 0x180000; --- break; --+ return 0x180000; -- default: -- brcmf_err("unknown chip: %s\n", ci->pub.name); -- break; -- } --+ return 0; --+} --+ --+static int brcmf_chip_get_raminfo(struct brcmf_chip_priv *ci) --+{ --+ struct brcmf_core_priv *mem_core; --+ struct brcmf_core *mem; --+ --+ mem = brcmf_chip_get_core(&ci->pub, BCMA_CORE_ARM_CR4); --+ if (mem) { --+ mem_core = container_of(mem, struct brcmf_core_priv, pub); --+ ci->pub.ramsize = brcmf_chip_tcm_ramsize(mem_core); --+ ci->pub.rambase = brcmf_chip_tcm_rambase(ci); --+ if (!ci->pub.rambase) { --+ brcmf_err("RAM base not provided with ARM CR4 core\n"); --+ 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); --+ } --+ 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, --+ ci->pub.srsize, ci->pub.srsize); --+ --+ if (!ci->pub.ramsize) { --+ brcmf_err("RAM size is undetermined\n"); --+ return -ENOMEM; --+ } --+ return 0; -- } -- -- static u32 brcmf_chip_dmp_get_desc(struct brcmf_chip_priv *ci, u32 *eromaddr, --@@ -668,6 +833,7 @@ static int brcmf_chip_recognition(struct -- struct brcmf_core *core; -- u32 regdata; -- u32 socitype; --+ int ret; -- -- /* Get CC core rev -- * Chipid is assume to be at offset 0 from SI_ENUM_BASE --@@ -720,9 +886,13 @@ static int brcmf_chip_recognition(struct -- return -ENODEV; -- } -- --- brcmf_chip_get_raminfo(ci); --- --- return brcmf_chip_cores_check(ci); --+ ret = brcmf_chip_cores_check(ci); --+ if (ret) --+ return ret; --+ --+ /* assure chip is passive for core access */ --+ brcmf_chip_set_passive(&ci->pub); --+ return brcmf_chip_get_raminfo(ci); -- } -- -- static void brcmf_chip_disable_arm(struct brcmf_chip_priv *chip, u16 id) --@@ -827,8 +997,6 @@ struct brcmf_chip *brcmf_chip_attach(voi -- if (err < 0) -- goto fail; -- --- /* assure chip is passive for download */ --- brcmf_chip_set_passive(&chip->pub); -- return &chip->pub; -- -- fail: ----- a/drivers/net/wireless/brcm80211/brcmfmac/chip.h --+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.h --@@ -30,7 +30,8 @@ -- * @pmucaps: PMU capabilities. -- * @pmurev: PMU revision. -- * @rambase: RAM base address (only applicable for ARM CR4 chips). --- * @ramsize: amount of RAM on chip. --+ * @ramsize: amount of RAM on chip including retention. --+ * @srsize: amount of retention RAM on chip. -- * @name: string representation of the chip identifier. -- */ -- struct brcmf_chip { --@@ -41,6 +42,7 @@ struct brcmf_chip { -- u32 pmurev; -- u32 rambase; -- u32 ramsize; --+ u32 srsize; -- 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 -deleted file mode 100644 -index 69618a7..0000000 ---- a/package/kernel/mac80211/patches/344-brcmfmac-take-save-restore-memory-into-account-for-S.patch -+++ /dev/null -@@ -1,96 +0,0 @@ --From: Arend van Spriel --Date: Wed, 11 Mar 2015 16:11:32 +0100 --Subject: [PATCH] brcmfmac: take save&restore memory into account for SDIO -- shared info -- --The firmware provides pointer to SDIO shared information at end of --RAM during firmware initialization. End of RAM is obviously determined --by the actual ram size, but part of that may be used for save&restore --memory. In that case another location in RAM will hold the pointer. -- --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/sdio.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --@@ -1067,44 +1067,47 @@ static inline bool brcmf_sdio_valid_shar -- static int brcmf_sdio_readshared(struct brcmf_sdio *bus, -- struct sdpcm_shared *sh) -- { --- u32 addr; --+ u32 addr = 0; -- int rv; -- u32 shaddr = 0; -- struct sdpcm_shared_le sh_le; -- __le32 addr_le; -- --- shaddr = bus->ci->rambase + bus->ci->ramsize - 4; --+ sdio_claim_host(bus->sdiodev->func[1]); --+ brcmf_sdio_bus_sleep(bus, false, false); -- -- /* -- * Read last word in socram to determine -- * address of sdpcm_shared structure -- */ --- sdio_claim_host(bus->sdiodev->func[1]); --- brcmf_sdio_bus_sleep(bus, false, false); --- rv = brcmf_sdiod_ramrw(bus->sdiodev, false, shaddr, (u8 *)&addr_le, 4); --- sdio_release_host(bus->sdiodev->func[1]); --+ shaddr = bus->ci->rambase + bus->ci->ramsize - 4; --+ if (!bus->ci->rambase && brcmf_chip_sr_capable(bus->ci)) --+ shaddr -= bus->ci->srsize; --+ rv = brcmf_sdiod_ramrw(bus->sdiodev, false, shaddr, --+ (u8 *)&addr_le, 4); -- if (rv < 0) --- return rv; --- --- addr = le32_to_cpu(addr_le); --- --- brcmf_dbg(SDIO, "sdpcm_shared address 0x%08X\n", addr); --+ goto fail; -- -- /* -- * Check if addr is valid. -- * NVRAM length at the end of memory should have been overwritten. -- */ --+ addr = le32_to_cpu(addr_le); -- if (!brcmf_sdio_valid_shared_address(addr)) { --- brcmf_err("invalid sdpcm_shared address 0x%08X\n", --- addr); --- return -EINVAL; --+ brcmf_err("invalid sdpcm_shared address 0x%08X\n", addr); --+ rv = -EINVAL; --+ goto fail; -- } -- --+ brcmf_dbg(INFO, "sdpcm_shared address 0x%08X\n", addr); --+ -- /* Read hndrte_shared structure */ -- rv = brcmf_sdiod_ramrw(bus->sdiodev, false, addr, (u8 *)&sh_le, -- sizeof(struct sdpcm_shared_le)); -- if (rv < 0) --- return rv; --+ goto fail; --+ --+ sdio_release_host(bus->sdiodev->func[1]); -- -- /* Endianness */ -- sh->flags = le32_to_cpu(sh_le.flags); --@@ -1121,8 +1124,13 @@ static int brcmf_sdio_readshared(struct -- sh->flags & SDPCM_SHARED_VERSION_MASK); -- return -EPROTO; -- } --- -- return 0; --+ --+fail: --+ brcmf_err("unable to obtain sdpcm_shared info: rv=%d (addr=0x%x)\n", --+ rv, addr); --+ sdio_release_host(bus->sdiodev->func[1]); --+ return rv; -- } -- -- 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 -deleted file mode 100644 -index 1b10dbb..0000000 ---- a/package/kernel/mac80211/patches/345-brcmfmac-fix-watchdog-timer-regression.patch -+++ /dev/null -@@ -1,59 +0,0 @@ --From: Arend van Spriel --Date: Wed, 11 Mar 2015 16:11:33 +0100 --Subject: [PATCH] brcmfmac: fix watchdog timer regression -- --The watchdog timer is used to put the device in a low-power mode when --it is idle for some time. This timer is stopped during that mode and --should be restarted upon activity. This has been broken by commit --d4150fced0365 ("brcmfmac: Simplify watchdog sleep."). This patch --restores the behaviour as it was before that commit. -- --Reported-by: Pontus Fuchs --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/sdio.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --@@ -972,7 +972,6 @@ static int brcmf_sdio_clkctl(struct brcm -- brcmf_sdio_sdclk(bus, true); -- /* Now request HT Avail on the backplane */ -- brcmf_sdio_htclk(bus, true, pendok); --- brcmf_sdio_wd_timer(bus, BRCMF_WD_POLL_MS); -- break; -- -- case CLK_SDONLY: --@@ -984,7 +983,6 @@ static int brcmf_sdio_clkctl(struct brcm -- else -- brcmf_err("request for %d -> %d\n", -- bus->clkstate, target); --- brcmf_sdio_wd_timer(bus, BRCMF_WD_POLL_MS); -- break; -- -- case CLK_NONE: --@@ -993,7 +991,6 @@ static int brcmf_sdio_clkctl(struct brcm -- brcmf_sdio_htclk(bus, false, false); -- /* Now remove the SD clock */ -- brcmf_sdio_sdclk(bus, false); --- brcmf_sdio_wd_timer(bus, 0); -- break; -- } -- #ifdef DEBUG --@@ -1048,6 +1045,7 @@ end: -- brcmf_sdio_clkctl(bus, CLK_NONE, pendok); -- } else { -- brcmf_sdio_clkctl(bus, CLK_AVAIL, pendok); --+ brcmf_sdio_wd_timer(bus, BRCMF_WD_POLL_MS); -- } -- bus->sleeping = sleep; -- brcmf_dbg(SDIO, "new state %s\n", --@@ -4242,6 +4240,7 @@ void brcmf_sdio_remove(struct brcmf_sdio -- if (bus->ci) { -- if (bus->sdiodev->state != BRCMF_SDIOD_NOMEDIUM) { -- sdio_claim_host(bus->sdiodev->func[1]); --+ brcmf_sdio_wd_timer(bus, 0); -- 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 -deleted file mode 100644 -index af76f13..0000000 ---- a/package/kernel/mac80211/patches/346-brcmfmac-avoid-runtime-pm-for-sdio-host-controller.patch -+++ /dev/null -@@ -1,44 +0,0 @@ --From: Arend van Spriel --Date: Wed, 18 Mar 2015 13:25:21 +0100 --Subject: [PATCH] brcmfmac: avoid runtime-pm for sdio host controller -- --Several host controllers supporting runtime-pm are causing issues --with our sdio wireless cards because they disable the sdio interrupt --upon going into runtime suspend. This patch avoids that by doing --a pm_runtime_forbid() call during the probe. Tested with Sony Vaio --Duo 13 which uses sdhci-acpi host controller. -- --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/bcmsdh.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c --@@ -29,6 +29,7 @@ -- #include -- #include -- #include --+#include -- #include -- #include -- #include --@@ -1006,6 +1007,7 @@ static int brcmf_sdiod_remove(struct brc -- sg_free_table(&sdiodev->sgtable); -- sdiodev->sbwad = 0; -- --+ pm_runtime_allow(sdiodev->func[1]->card->host->parent); -- return 0; -- } -- --@@ -1074,7 +1076,7 @@ static int brcmf_sdiod_probe(struct brcm -- ret = -ENODEV; -- goto out; -- } --- --+ pm_runtime_forbid(host->parent); -- 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 -deleted file mode 100644 -index c419cc6..0000000 ---- a/package/kernel/mac80211/patches/347-brcmfmac-Add-necessary-memory-barriers-for-SDIO.patch -+++ /dev/null -@@ -1,171 +0,0 @@ --From: Hante Meuleman --Date: Wed, 18 Mar 2015 13:25:22 +0100 --Subject: [PATCH] brcmfmac: Add necessary memory barriers for SDIO. -- --SDIO uses a thread to handle all communication with the device, --for this data is exchanged between threads. This data needs proper --memory barriers to make sure that data "exchange" is going correct. -- --Reviewed-by: Arend Van Spriel --Reviewed-by: Franky (Zhenhui) Lin --Reviewed-by: Pieter-Paul Giesberts --Reviewed-by: Daniel (Deognyoun) Kim --Signed-off-by: Hante Meuleman --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 --@@ -507,8 +507,8 @@ struct brcmf_sdio { -- -- struct workqueue_struct *brcmf_wq; -- struct work_struct datawork; --- atomic_t dpc_tskcnt; --- atomic_t dpc_running; --+ bool dpc_triggered; --+ bool dpc_running; -- -- bool txoff; /* Transmit flow-controlled */ -- struct brcmf_sdio_count sdcnt; --@@ -2713,6 +2713,7 @@ static void brcmf_sdio_dpc(struct brcmf_ -- err = brcmf_sdio_tx_ctrlframe(bus, bus->ctrl_frame_buf, -- bus->ctrl_frame_len); -- bus->ctrl_frame_err = err; --+ wmb(); -- bus->ctrl_frame_stat = false; -- } -- sdio_release_host(bus->sdiodev->func[1]); --@@ -2734,6 +2735,7 @@ static void brcmf_sdio_dpc(struct brcmf_ -- sdio_claim_host(bus->sdiodev->func[1]); -- if (bus->ctrl_frame_stat) { -- bus->ctrl_frame_err = -ENODEV; --+ wmb(); -- bus->ctrl_frame_stat = false; -- brcmf_sdio_wait_event_wakeup(bus); -- } --@@ -2744,7 +2746,7 @@ static void brcmf_sdio_dpc(struct brcmf_ -- (!atomic_read(&bus->fcstate) && -- brcmu_pktq_mlen(&bus->txq, ~bus->flowcontrol) && -- data_ok(bus))) { --- atomic_inc(&bus->dpc_tskcnt); --+ bus->dpc_triggered = true; -- } -- } -- --@@ -2940,6 +2942,7 @@ brcmf_sdio_bus_txctl(struct device *dev, -- /* Send from dpc */ -- bus->ctrl_frame_buf = msg; -- bus->ctrl_frame_len = msglen; --+ wmb(); -- bus->ctrl_frame_stat = true; -- -- brcmf_sdio_trigger_dpc(bus); --@@ -2958,6 +2961,7 @@ brcmf_sdio_bus_txctl(struct device *dev, -- if (!ret) { -- brcmf_dbg(SDIO, "ctrl_frame complete, err=%d\n", -- bus->ctrl_frame_err); --+ rmb(); -- ret = bus->ctrl_frame_err; -- } -- --@@ -3526,8 +3530,8 @@ done: -- -- void brcmf_sdio_trigger_dpc(struct brcmf_sdio *bus) -- { --- if (atomic_read(&bus->dpc_tskcnt) == 0) { --- atomic_inc(&bus->dpc_tskcnt); --+ if (!bus->dpc_triggered) { --+ bus->dpc_triggered = true; -- queue_work(bus->brcmf_wq, &bus->datawork); -- } -- } --@@ -3558,7 +3562,7 @@ void brcmf_sdio_isr(struct brcmf_sdio *b -- if (!bus->intr) -- brcmf_err("isr w/o interrupt configured!\n"); -- --- atomic_inc(&bus->dpc_tskcnt); --+ bus->dpc_triggered = true; -- queue_work(bus->brcmf_wq, &bus->datawork); -- } -- --@@ -3578,7 +3582,7 @@ static void brcmf_sdio_bus_watchdog(stru -- if (!bus->intr || -- (bus->sdcnt.intrcount == bus->sdcnt.lastintrs)) { -- --- if (atomic_read(&bus->dpc_tskcnt) == 0) { --+ if (!bus->dpc_triggered) { -- u8 devpend; -- -- sdio_claim_host(bus->sdiodev->func[1]); --@@ -3596,7 +3600,7 @@ static void brcmf_sdio_bus_watchdog(stru -- bus->sdcnt.pollcnt++; -- atomic_set(&bus->ipend, 1); -- --- atomic_inc(&bus->dpc_tskcnt); --+ bus->dpc_triggered = true; -- queue_work(bus->brcmf_wq, &bus->datawork); -- } -- } --@@ -3623,17 +3627,21 @@ static void brcmf_sdio_bus_watchdog(stru -- #endif /* DEBUG */ -- -- /* On idle timeout clear activity flag and/or turn off clock */ --- if ((atomic_read(&bus->dpc_tskcnt) == 0) && --- (atomic_read(&bus->dpc_running) == 0) && --- (bus->idletime > 0) && (bus->clkstate == CLK_AVAIL)) { --- bus->idlecount++; --- if (bus->idlecount > bus->idletime) { --- brcmf_dbg(SDIO, "idle\n"); --- sdio_claim_host(bus->sdiodev->func[1]); --- brcmf_sdio_wd_timer(bus, 0); --+ if (!bus->dpc_triggered) { --+ rmb(); --+ if ((!bus->dpc_running) && (bus->idletime > 0) && --+ (bus->clkstate == CLK_AVAIL)) { --+ bus->idlecount++; --+ if (bus->idlecount > bus->idletime) { --+ brcmf_dbg(SDIO, "idle\n"); --+ sdio_claim_host(bus->sdiodev->func[1]); --+ brcmf_sdio_wd_timer(bus, 0); --+ bus->idlecount = 0; --+ brcmf_sdio_bus_sleep(bus, true, false); --+ sdio_release_host(bus->sdiodev->func[1]); --+ } --+ } else { -- bus->idlecount = 0; --- brcmf_sdio_bus_sleep(bus, true, false); --- sdio_release_host(bus->sdiodev->func[1]); -- } -- } else { -- bus->idlecount = 0; --@@ -3645,13 +3653,14 @@ static void brcmf_sdio_dataworker(struct -- struct brcmf_sdio *bus = container_of(work, struct brcmf_sdio, -- datawork); -- --- while (atomic_read(&bus->dpc_tskcnt)) { --- atomic_set(&bus->dpc_running, 1); --- atomic_set(&bus->dpc_tskcnt, 0); --+ bus->dpc_running = true; --+ wmb(); --+ while (ACCESS_ONCE(bus->dpc_triggered)) { --+ bus->dpc_triggered = false; -- brcmf_sdio_dpc(bus); -- bus->idlecount = 0; --- atomic_set(&bus->dpc_running, 0); -- } --+ bus->dpc_running = false; -- if (brcmf_sdiod_freezing(bus->sdiodev)) { -- brcmf_sdiod_change_state(bus->sdiodev, BRCMF_SDIOD_DOWN); -- brcmf_sdiod_try_freeze(bus->sdiodev); --@@ -4144,8 +4153,8 @@ struct brcmf_sdio *brcmf_sdio_probe(stru -- bus->watchdog_tsk = NULL; -- } -- /* Initialize DPC thread */ --- atomic_set(&bus->dpc_tskcnt, 0); --- atomic_set(&bus->dpc_running, 0); --+ bus->dpc_triggered = false; --+ bus->dpc_running = false; -- -- /* 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 -deleted file mode 100644 -index 1bc98a0..0000000 ---- a/package/kernel/mac80211/patches/348-brcmfmac-Remove-unnecessary-new-line-in-pcie-console.patch -+++ /dev/null -@@ -1,26 +0,0 @@ --From: Hante Meuleman --Date: Wed, 18 Mar 2015 13:25:24 +0100 --Subject: [PATCH] brcmfmac: Remove unnecessary new-line in pcie console -- logging. -- --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/pcie.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --@@ -651,10 +651,9 @@ static void brcmf_pcie_bus_console_read( -- console->log_str[console->log_idx] = ch; -- console->log_idx++; -- } --- -- if (ch == '\n') { -- console->log_str[console->log_idx] = 0; --- brcmf_dbg(PCIE, "CONSOLE: %s\n", console->log_str); --+ brcmf_dbg(PCIE, "CONSOLE: %s", console->log_str); -- 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 -deleted file mode 100644 -index fcf0bf3..0000000 ---- a/package/kernel/mac80211/patches/349-brcmfmac-add-MODULE_FIRMWARE-macros-for-bcm4356-PCIe.patch -+++ /dev/null -@@ -1,26 +0,0 @@ --From: Arend van Spriel --Date: Wed, 18 Mar 2015 13:25:25 +0100 --Subject: [PATCH] brcmfmac: add MODULE_FIRMWARE() macros for bcm4356 PCIe -- device -- --The BCM4356 PCIe wireless device was added recently but overlooked --the fact that the MODULE_FIRMWARE() macros were missing for the --firmwares needed by this device. -- --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/pcie.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --@@ -189,6 +189,8 @@ MODULE_FIRMWARE(BRCMF_PCIE_43602_FW_NAME -- MODULE_FIRMWARE(BRCMF_PCIE_43602_NVRAM_NAME); -- MODULE_FIRMWARE(BRCMF_PCIE_4354_FW_NAME); -- MODULE_FIRMWARE(BRCMF_PCIE_4354_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); -- -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 -deleted file mode 100644 -index b3e9bc9..0000000 ---- a/package/kernel/mac80211/patches/350-brcmfmac-add-support-for-BCM43430-SDIO-chipset.patch -+++ /dev/null -@@ -1,138 +0,0 @@ --From: Arend van Spriel --Date: Wed, 18 Mar 2015 13:25:26 +0100 --Subject: [PATCH] brcmfmac: add support for BCM43430 SDIO chipset -- --This patch added support for the BCM43430 802.11n SDIO chipset. -- --Reviewed-by: Hante Meuleman --Reviewed-by: Daniel (Deognyoun) Kim --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/bcmsdh.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c --@@ -1098,6 +1098,7 @@ static const struct sdio_device_id brcmf -- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43341), -- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43362), -- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4335_4339), --+ BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43430), -- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4345), -- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4354), -- { /* end: all zeroes */ } ----- a/drivers/net/wireless/brcm80211/brcmfmac/chip.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c --@@ -600,6 +600,12 @@ static void brcmf_chip_socram_ramsize(st -- if (sr->chip->pub.chiprev < 2) -- *srsize = (32 * 1024); -- break; --+ case BRCM_CC_43430_CHIP_ID: --+ /* assume sr for now as we can not check --+ * firmware sr capability at this point. --+ */ --+ *srsize = (64 * 1024); --+ break; -- default: -- break; -- } --@@ -1072,6 +1078,7 @@ static void -- brcmf_chip_cm3_set_passive(struct brcmf_chip_priv *chip) -- { -- struct brcmf_core *core; --+ struct brcmf_core_priv *sr; -- -- brcmf_chip_disable_arm(chip, BCMA_CORE_ARM_CM3); -- core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_80211); --@@ -1081,6 +1088,13 @@ brcmf_chip_cm3_set_passive(struct brcmf_ -- D11_BCMA_IOCTL_PHYCLOCKEN); -- core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_INTERNAL_MEM); -- brcmf_chip_resetcore(core, 0, 0, 0); --+ --+ /* disable bank #3 remap for this device */ --+ if (chip->pub.chip == BRCM_CC_43430_CHIP_ID) { --+ sr = container_of(core, struct brcmf_core_priv, pub); --+ brcmf_chip_core_write32(sr, SOCRAMREGOFFS(bankidx), 3); --+ brcmf_chip_core_write32(sr, SOCRAMREGOFFS(bankpda), 0); --+ } -- } -- -- static bool brcmf_chip_cm3_set_active(struct brcmf_chip_priv *chip) --@@ -1188,6 +1202,10 @@ bool brcmf_chip_sr_capable(struct brcmf_ -- addr = CORE_CC_REG(base, chipcontrol_data); -- reg = chip->ops->read32(chip->ctx, addr); -- return (reg & pmu_cc3_mask) != 0; --+ case BRCM_CC_43430_CHIP_ID: --+ addr = CORE_CC_REG(base, sr_control1); --+ reg = chip->ops->read32(chip->ctx, addr); --+ return reg != 0; -- default: -- addr = CORE_CC_REG(base, pmucapabilities_ext); -- reg = chip->ops->read32(chip->ctx, addr); ----- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --@@ -615,6 +615,8 @@ static const struct sdiod_drive_str sdio -- #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 BCM4345_FIRMWARE_NAME "brcm/brcmfmac4345-sdio.bin" -- #define BCM4345_NVRAM_NAME "brcm/brcmfmac4345-sdio.txt" -- #define BCM4354_FIRMWARE_NAME "brcm/brcmfmac4354-sdio.bin" --@@ -640,6 +642,8 @@ 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(BCM4345_FIRMWARE_NAME); -- MODULE_FIRMWARE(BCM4345_NVRAM_NAME); -- MODULE_FIRMWARE(BCM4354_FIRMWARE_NAME); --@@ -671,6 +675,7 @@ static const struct brcmf_firmware_names -- { 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, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4345) }, -- { BRCM_CC_4354_CHIP_ID, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4354) } -- }; ----- a/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h --+++ b/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h --@@ -37,6 +37,7 @@ -- #define BRCM_CC_43362_CHIP_ID 43362 -- #define BRCM_CC_4335_CHIP_ID 0x4335 -- #define BRCM_CC_4339_CHIP_ID 0x4339 --+#define BRCM_CC_43430_CHIP_ID 43430 -- #define BRCM_CC_4345_CHIP_ID 0x4345 -- #define BRCM_CC_4354_CHIP_ID 0x4354 -- #define BRCM_CC_4356_CHIP_ID 0x4356 ----- a/drivers/net/wireless/brcm80211/include/chipcommon.h --+++ b/drivers/net/wireless/brcm80211/include/chipcommon.h --@@ -183,7 +183,14 @@ struct chipcregs { -- u8 uart1lsr; -- u8 uart1msr; -- u8 uart1scratch; --- u32 PAD[126]; --+ u32 PAD[62]; --+ --+ /* save/restore, corerev >= 48 */ --+ u32 sr_capability; /* 0x500 */ --+ u32 sr_control0; /* 0x504 */ --+ u32 sr_control1; /* 0x508 */ --+ u32 gpio_control; /* 0x50C */ --+ u32 PAD[60]; -- -- /* PMU registers (corerev >= 20) */ -- u32 pmucontrol; /* 0x600 */ ----- a/include/linux/mmc/sdio_ids.h --+++ b/include/linux/mmc/sdio_ids.h --@@ -33,6 +33,7 @@ -- #define SDIO_DEVICE_ID_BROADCOM_43341 0xa94d -- #define SDIO_DEVICE_ID_BROADCOM_4335_4339 0x4335 -- #define SDIO_DEVICE_ID_BROADCOM_43362 0xa962 --+#define SDIO_DEVICE_ID_BROADCOM_43430 0xa9a6 -- #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 -deleted file mode 100644 -index c3d7bc2..0000000 ---- a/package/kernel/mac80211/patches/351-brcmfmac-only-support-the-BCM43455-7-device.patch -+++ /dev/null -@@ -1,50 +0,0 @@ --From: Arend van Spriel --Date: Wed, 18 Mar 2015 13:25:27 +0100 --Subject: [PATCH] brcmfmac: only support the BCM43455/7 device -- --Recently support was added for the BCM4345 SDIO chipset by --commit 9c51026509d7 ("brcmfmac: Add support for BCM4345 SDIO chipset") --however this was verified using a BCM43455 device, which is --a more recent revision of the chip. This patch assure that --older revisions are not probed as they would fail. -- --Reviewed-by: Hante Meuleman --Reviewed-by: Syed Asifful Dayyan --Reviewed-by: Pieter-Paul Giesberts --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 --@@ -617,8 +617,8 @@ static const struct sdiod_drive_str sdio -- #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 BCM4345_FIRMWARE_NAME "brcm/brcmfmac4345-sdio.bin" ---#define BCM4345_NVRAM_NAME "brcm/brcmfmac4345-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" -- --@@ -644,8 +644,8 @@ MODULE_FIRMWARE(BCM4339_FIRMWARE_NAME); -- MODULE_FIRMWARE(BCM4339_NVRAM_NAME); -- MODULE_FIRMWARE(BCM43430_FIRMWARE_NAME); -- MODULE_FIRMWARE(BCM43430_NVRAM_NAME); ---MODULE_FIRMWARE(BCM4345_FIRMWARE_NAME); ---MODULE_FIRMWARE(BCM4345_NVRAM_NAME); --+MODULE_FIRMWARE(BCM43455_FIRMWARE_NAME); --+MODULE_FIRMWARE(BCM43455_NVRAM_NAME); -- MODULE_FIRMWARE(BCM4354_FIRMWARE_NAME); -- MODULE_FIRMWARE(BCM4354_NVRAM_NAME); -- --@@ -676,7 +676,7 @@ static const struct brcmf_firmware_names -- { 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, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4345) }, --+ { BRCM_CC_4345_CHIP_ID, 0xFFFFFFC0, BRCMF_FIRMWARE_NVRAM(BCM43455) }, -- { 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 -deleted file mode 100644 -index a62cfdf..0000000 ---- a/package/kernel/mac80211/patches/352-brcmfmac-remove-support-for-unreleased-BCM4354-PCIe.patch -+++ /dev/null -@@ -1,52 +0,0 @@ --From: Arend van Spriel --Date: Wed, 18 Mar 2015 13:25:28 +0100 --Subject: [PATCH] brcmfmac: remove support for unreleased BCM4354 PCIe -- --There are no known BCM4354 PCIe devices released so removing --support from the driver until proven otherwise. -- --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/pcie.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --@@ -47,8 +47,6 @@ 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_4354_FW_NAME "brcm/brcmfmac4354-pcie.bin" ---#define BRCMF_PCIE_4354_NVRAM_NAME "brcm/brcmfmac4354-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" --@@ -187,8 +185,6 @@ enum brcmf_pcie_state { -- -- MODULE_FIRMWARE(BRCMF_PCIE_43602_FW_NAME); -- MODULE_FIRMWARE(BRCMF_PCIE_43602_NVRAM_NAME); ---MODULE_FIRMWARE(BRCMF_PCIE_4354_FW_NAME); ---MODULE_FIRMWARE(BRCMF_PCIE_4354_NVRAM_NAME); -- MODULE_FIRMWARE(BRCMF_PCIE_4356_FW_NAME); -- MODULE_FIRMWARE(BRCMF_PCIE_4356_NVRAM_NAME); -- MODULE_FIRMWARE(BRCMF_PCIE_43570_FW_NAME); --@@ -1327,10 +1323,6 @@ 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_4354_CHIP_ID: --- fw_name = BRCMF_PCIE_4354_FW_NAME; --- nvram_name = BRCMF_PCIE_4354_NVRAM_NAME; --- break; -- case BRCM_CC_4356_CHIP_ID: -- fw_name = BRCMF_PCIE_4356_FW_NAME; -- nvram_name = BRCMF_PCIE_4356_NVRAM_NAME; --@@ -1855,7 +1847,6 @@ 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_4354_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), -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 -deleted file mode 100644 -index 366ff85..0000000 ---- a/package/kernel/mac80211/patches/353-brcmfmac-disable-MBSS-feature-for-BCM43362.patch -+++ /dev/null -@@ -1,28 +0,0 @@ --From: Arend van Spriel --Date: Fri, 20 Mar 2015 22:18:17 +0100 --Subject: [PATCH] brcmfmac: disable MBSS feature for BCM43362 -- --The BCM43362 firmware falsely reports it is capable of providing --MBSS. As a result AP mode no longer works for this device. Therefor --disable MBSS in the driver for this chipset. -- --Cc: stable@vger.kernel.org # 3.19.y --Reported-by: Jorg Krause --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/feature.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/feature.c --@@ -126,7 +126,8 @@ void brcmf_feat_attach(struct brcmf_pub -- brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_MCHAN, "mchan"); -- if (drvr->bus_if->wowl_supported) -- brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_WOWL, "wowl"); --- brcmf_feat_iovar_int_set(ifp, BRCMF_FEAT_MBSS, "mbss", 0); --+ if (drvr->bus_if->chip != BRCM_CC_43362_CHIP_ID) --+ brcmf_feat_iovar_int_set(ifp, BRCMF_FEAT_MBSS, "mbss", 0); -- -- /* 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 -deleted file mode 100644 -index 6e461f6..0000000 ---- a/package/kernel/mac80211/patches/354-brcmfmac-use-static-superset-of-channels-for-wiphy-b.patch -+++ /dev/null -@@ -1,300 +0,0 @@ --From: Arend van Spriel --Date: Tue, 14 Apr 2015 20:10:24 +0200 --Subject: [PATCH] brcmfmac: use static superset of channels for wiphy -- bands -- --The driver was constructing a list of channels per wiphy band --by querying the device. This list is not what the hardware is --able to do as it is already filtered by the country setting in --the device. As user-space may change the country this would --require updating the channel list which is not recommended [1]. --This patch introduces a superset of channels. The individual --channels are disabled appropriately by querying the device. -- --[1] http://mid.gmane.org/1426706320.3001.21.camel@sipsolutions.net -- --Reviewed-by: Hante Meuleman --Reviewed-by: Daniel (Deognyoun) Kim --Reviewed-by: Pieter-Paul Giesberts --Signed-off-by: Arend van Spriel ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c --@@ -129,13 +129,47 @@ static struct ieee80211_rate __wl_rates[ -- RATETAB_ENT(BRCM_RATE_54M, 0), -- }; -- ---#define wl_a_rates (__wl_rates + 4) ---#define wl_a_rates_size 8 -- #define wl_g_rates (__wl_rates + 0) ---#define wl_g_rates_size 12 --+#define wl_g_rates_size ARRAY_SIZE(__wl_rates) --+#define wl_a_rates (__wl_rates + 4) --+#define wl_a_rates_size (wl_g_rates_size - 4) --+ --+#define CHAN2G(_channel, _freq) { \ --+ .band = IEEE80211_BAND_2GHZ, \ --+ .center_freq = (_freq), \ --+ .hw_value = (_channel), \ --+ .flags = IEEE80211_CHAN_DISABLED, \ --+ .max_antenna_gain = 0, \ --+ .max_power = 30, \ --+} --+ --+#define CHAN5G(_channel) { \ --+ .band = IEEE80211_BAND_5GHZ, \ --+ .center_freq = 5000 + (5 * (_channel)), \ --+ .hw_value = (_channel), \ --+ .flags = IEEE80211_CHAN_DISABLED, \ --+ .max_antenna_gain = 0, \ --+ .max_power = 30, \ --+} --+ --+static struct ieee80211_channel __wl_2ghz_channels[] = { --+ CHAN2G(1, 2412), CHAN2G(2, 2417), CHAN2G(3, 2422), CHAN2G(4, 2427), --+ CHAN2G(5, 2432), CHAN2G(6, 2437), CHAN2G(7, 2442), CHAN2G(8, 2447), --+ CHAN2G(9, 2452), CHAN2G(10, 2457), CHAN2G(11, 2462), CHAN2G(12, 2467), --+ CHAN2G(13, 2472), CHAN2G(14, 2484) --+}; --+ --+static struct ieee80211_channel __wl_5ghz_channels[] = { --+ CHAN5G(34), CHAN5G(36), CHAN5G(38), CHAN5G(40), CHAN5G(42), --+ CHAN5G(44), CHAN5G(46), CHAN5G(48), CHAN5G(52), CHAN5G(56), --+ CHAN5G(60), CHAN5G(64), CHAN5G(100), CHAN5G(104), CHAN5G(108), --+ CHAN5G(112), CHAN5G(116), CHAN5G(120), CHAN5G(124), CHAN5G(128), --+ CHAN5G(132), CHAN5G(136), CHAN5G(140), CHAN5G(144), CHAN5G(149), --+ CHAN5G(153), CHAN5G(157), CHAN5G(161), CHAN5G(165) --+}; -- -- /* Band templates duplicated per wiphy. The channel info --- * is filled in after querying the device. --+ * above is added to the band during setup. -- */ -- static const struct ieee80211_supported_band __wl_band_2ghz = { -- .band = IEEE80211_BAND_2GHZ, --@@ -143,7 +177,7 @@ static const struct ieee80211_supported_ -- .n_bitrates = wl_g_rates_size, -- }; -- ---static const struct ieee80211_supported_band __wl_band_5ghz_a = { --+static const struct ieee80211_supported_band __wl_band_5ghz = { -- .band = IEEE80211_BAND_5GHZ, -- .bitrates = wl_a_rates, -- .n_bitrates = wl_a_rates_size, --@@ -5252,40 +5286,6 @@ dongle_scantime_out: -- return err; -- } -- ---/* Filter the list of channels received from firmware counting only --- * the 20MHz channels. The wiphy band data only needs those which get --- * flagged to indicate if they can take part in higher bandwidth. --- */ ---static void brcmf_count_20mhz_channels(struct brcmf_cfg80211_info *cfg, --- struct brcmf_chanspec_list *chlist, --- u32 chcnt[]) ---{ --- u32 total = le32_to_cpu(chlist->count); --- struct brcmu_chan ch; --- int i; --- --- for (i = 0; i < total; i++) { --- ch.chspec = (u16)le32_to_cpu(chlist->element[i]); --- cfg->d11inf.decchspec(&ch); --- --- /* Firmware gives a ordered list. We skip non-20MHz --- * channels is 2G. For 5G we can abort upon reaching --- * a non-20MHz channel in the list. --- */ --- if (ch.bw != BRCMU_CHAN_BW_20) { --- if (ch.band == BRCMU_CHAN_BAND_5G) --- break; --- else --- continue; --- } --- --- if (ch.band == BRCMU_CHAN_BAND_2G) --- chcnt[0] += 1; --- else if (ch.band == BRCMU_CHAN_BAND_5G) --- chcnt[1] += 1; --- } ---} --- -- static void brcmf_update_bw40_channel_flag(struct ieee80211_channel *channel, -- struct brcmu_chan *ch) -- { --@@ -5321,7 +5321,6 @@ static int brcmf_construct_chaninfo(stru -- u32 i, j; -- u32 total; -- u32 chaninfo; --- u32 chcnt[2] = { 0, 0 }; -- u32 index; -- -- pbuf = kzalloc(BRCMF_DCMD_MEDLEN, GFP_KERNEL); --@@ -5338,42 +5337,15 @@ static int brcmf_construct_chaninfo(stru -- goto fail_pbuf; -- } -- --- brcmf_count_20mhz_channels(cfg, list, chcnt); -- wiphy = cfg_to_wiphy(cfg); --- if (chcnt[0]) { --- band = kmemdup(&__wl_band_2ghz, sizeof(__wl_band_2ghz), --- GFP_KERNEL); --- if (band == NULL) { --- err = -ENOMEM; --- goto fail_pbuf; --- } --- band->channels = kcalloc(chcnt[0], sizeof(*channel), --- GFP_KERNEL); --- if (band->channels == NULL) { --- kfree(band); --- err = -ENOMEM; --- goto fail_pbuf; --- } --- band->n_channels = 0; --- wiphy->bands[IEEE80211_BAND_2GHZ] = band; --- } --- if (chcnt[1]) { --- band = kmemdup(&__wl_band_5ghz_a, sizeof(__wl_band_5ghz_a), --- GFP_KERNEL); --- if (band == NULL) { --- err = -ENOMEM; --- goto fail_band2g; --- } --- band->channels = kcalloc(chcnt[1], sizeof(*channel), --- GFP_KERNEL); --- if (band->channels == NULL) { --- kfree(band); --- err = -ENOMEM; --- goto fail_band2g; --- } --- band->n_channels = 0; --- wiphy->bands[IEEE80211_BAND_5GHZ] = band; --- } --+ band = wiphy->bands[IEEE80211_BAND_2GHZ]; --+ if (band) --+ for (i = 0; i < band->n_channels; i++) --+ band->channels[i].flags = IEEE80211_CHAN_DISABLED; --+ band = wiphy->bands[IEEE80211_BAND_5GHZ]; --+ if (band) --+ for (i = 0; i < band->n_channels; i++) --+ band->channels[i].flags = IEEE80211_CHAN_DISABLED; -- -- total = le32_to_cpu(list->count); -- for (i = 0; i < total; i++) { --@@ -5388,6 +5360,8 @@ static int brcmf_construct_chaninfo(stru -- brcmf_err("Invalid channel Spec. 0x%x.\n", ch.chspec); -- continue; -- } --+ if (!band) --+ continue; -- if (!(bw_cap[band->band] & WLC_BW_40MHZ_BIT) && -- ch.bw == BRCMU_CHAN_BW_40) -- continue; --@@ -5415,9 +5389,9 @@ static int brcmf_construct_chaninfo(stru -- } else if (ch.bw == BRCMU_CHAN_BW_40) { -- brcmf_update_bw40_channel_flag(&channel[index], &ch); -- } else { --- /* disable other bandwidths for now as mentioned --- * order assure they are enabled for subsequent --- * chanspecs. --+ /* enable the channel and disable other bandwidths --+ * for now as mentioned order assure they are enabled --+ * for subsequent chanspecs. -- */ -- channel[index].flags = IEEE80211_CHAN_NO_HT40 | -- IEEE80211_CHAN_NO_80MHZ; --@@ -5436,16 +5410,8 @@ static int brcmf_construct_chaninfo(stru -- IEEE80211_CHAN_NO_IR; -- } -- } --- if (index == band->n_channels) --- band->n_channels++; -- } --- kfree(pbuf); --- return 0; -- ---fail_band2g: --- kfree(wiphy->bands[IEEE80211_BAND_2GHZ]->channels); --- kfree(wiphy->bands[IEEE80211_BAND_2GHZ]); --- wiphy->bands[IEEE80211_BAND_2GHZ] = NULL; -- fail_pbuf: -- kfree(pbuf); -- return err; --@@ -5778,7 +5744,12 @@ static void brcmf_wiphy_wowl_params(stru -- -- static int brcmf_setup_wiphy(struct wiphy *wiphy, struct brcmf_if *ifp) -- { --+ struct ieee80211_supported_band *band; -- struct ieee80211_iface_combination ifc_combo; --+ __le32 bandlist[3]; --+ u32 n_bands; --+ int err, i; --+ -- wiphy->max_scan_ssids = WL_NUM_SCAN_MAX; -- wiphy->max_scan_ie_len = BRCMF_SCAN_IE_LEN_MAX; -- wiphy->max_num_pmkids = WL_NUM_PMKIDS_MAX; --@@ -5820,7 +5791,52 @@ static int brcmf_setup_wiphy(struct wiph -- if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_WOWL)) -- brcmf_wiphy_wowl_params(wiphy); -- --- return brcmf_setup_wiphybands(wiphy); --+ err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BANDLIST, &bandlist, --+ sizeof(bandlist)); --+ if (err) { --+ brcmf_err("could not obtain band info: err=%d\n", err); --+ return err; --+ } --+ /* first entry in bandlist is number of bands */ --+ n_bands = le32_to_cpu(bandlist[0]); --+ for (i = 1; i <= n_bands && i < ARRAY_SIZE(bandlist); i++) { --+ if (bandlist[i] == cpu_to_le32(WLC_BAND_2G)) { --+ band = kmemdup(&__wl_band_2ghz, sizeof(__wl_band_2ghz), --+ GFP_KERNEL); --+ if (!band) --+ return -ENOMEM; --+ --+ band->channels = kmemdup(&__wl_2ghz_channels, --+ sizeof(__wl_2ghz_channels), --+ GFP_KERNEL); --+ if (!band->channels) { --+ kfree(band); --+ return -ENOMEM; --+ } --+ --+ band->n_channels = ARRAY_SIZE(__wl_2ghz_channels); --+ wiphy->bands[IEEE80211_BAND_2GHZ] = band; --+ } --+ if (bandlist[i] == cpu_to_le32(WLC_BAND_5G)) { --+ band = kmemdup(&__wl_band_5ghz, sizeof(__wl_band_5ghz), --+ GFP_KERNEL); --+ if (!band) --+ return -ENOMEM; --+ --+ band->channels = kmemdup(&__wl_5ghz_channels, --+ sizeof(__wl_5ghz_channels), --+ GFP_KERNEL); --+ if (!band->channels) { --+ kfree(band); --+ return -ENOMEM; --+ } --+ --+ band->n_channels = ARRAY_SIZE(__wl_5ghz_channels); --+ wiphy->bands[IEEE80211_BAND_5GHZ] = band; --+ } --+ } --+ err = brcmf_setup_wiphybands(wiphy); --+ return err; -- } -- -- static s32 brcmf_config_dongle(struct brcmf_cfg80211_info *cfg) --@@ -6011,6 +6027,9 @@ static void brcmf_cfg80211_reg_notifier( -- -- static void brcmf_free_wiphy(struct wiphy *wiphy) -- { --+ if (!wiphy) --+ return; --+ -- 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 -deleted file mode 100644 -index a0c22eb..0000000 ---- a/package/kernel/mac80211/patches/355-brcmfmac-update-wiphy-band-information-upon-updating.patch -+++ /dev/null -@@ -1,29 +0,0 @@ --From: Arend van Spriel --Date: Tue, 14 Apr 2015 20:10:25 +0200 --Subject: [PATCH] brcmfmac: update wiphy band information upon updating -- regulatory domain -- --When change the country code the available channels may change. So --the wiphy bands should be updated accordingly. -- --Reviewed-by: Daniel (Deognyoun) Kim --Reviewed-by: Hante Meuleman --Reviewed-by: Pieter-Paul Giesberts --Signed-off-by: Arend van Spriel ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c --@@ -6022,7 +6022,11 @@ static void brcmf_cfg80211_reg_notifier( -- memset(&ccreq, 0, sizeof(ccreq)); -- ccreq.rev = cpu_to_le32(-1); -- memcpy(ccreq.ccode, req->alpha2, sizeof(req->alpha2)); --- brcmf_fil_iovar_data_set(ifp, "country", &ccreq, sizeof(ccreq)); --+ if (brcmf_fil_iovar_data_set(ifp, "country", &ccreq, sizeof(ccreq))) { --+ brcmf_err("firmware rejected country setting\n"); --+ return; --+ } --+ brcmf_setup_wiphybands(wiphy); -- } -- -- 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 -deleted file mode 100644 -index 193f507..0000000 ---- a/package/kernel/mac80211/patches/356-brcmfmac-add-description-for-feature-flags.patch -+++ /dev/null -@@ -1,24 +0,0 @@ --From: Arend van Spriel --Date: Tue, 14 Apr 2015 20:10:26 +0200 --Subject: [PATCH] brcmfmac: add description for feature flags -- --Some feature flags were not described in the header file. Adding --the description. -- --Reviewed-by: Hante Meuleman --Reviewed-by: Pieter-Paul Giesberts --Signed-off-by: Arend van Spriel ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/feature.h --+++ b/drivers/net/wireless/brcm80211/brcmfmac/feature.h --@@ -19,7 +19,9 @@ -- /* -- * Features: -- * --+ * MBSS: multiple BSSID support (eg. guest network in AP mode). -- * MCHAN: multi-channel for concurrent P2P. --+ * WOWL: Wake-On-WLAN. -- */ -- #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 -deleted file mode 100644 -index 42330b4..0000000 ---- a/package/kernel/mac80211/patches/357-brcmfmac-make-scheduled-scan-support-conditional.patch -+++ /dev/null -@@ -1,51 +0,0 @@ --From: Arend van Spriel --Date: Tue, 14 Apr 2015 20:10:27 +0200 --Subject: [PATCH] brcmfmac: make scheduled scan support conditional -- --The scheduled scan support depends on firmware supporting the PNO --feature. This feature is optional so add a feature flag for this --in the driver and announce scheduled scan support accordingly. -- --Reviewed-by: Hante Meuleman --Reviewed-by: Pieter-Paul Giesberts --Signed-off-by: Arend van Spriel ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c --@@ -5782,7 +5782,8 @@ static int brcmf_setup_wiphy(struct wiph -- wiphy->flags |= WIPHY_FLAG_SUPPORTS_FW_ROAM; -- wiphy->mgmt_stypes = brcmf_txrx_stypes; -- wiphy->max_remain_on_channel_duration = 5000; --- brcmf_wiphy_pno_params(wiphy); --+ if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_PNO)) --+ brcmf_wiphy_pno_params(wiphy); -- -- /* vendor commands/events support */ -- wiphy->vendor_commands = brcmf_vendor_cmds; ----- a/drivers/net/wireless/brcm80211/brcmfmac/feature.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/feature.c --@@ -124,6 +124,7 @@ void brcmf_feat_attach(struct brcmf_pub -- struct brcmf_if *ifp = drvr->iflist[0]; -- -- brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_MCHAN, "mchan"); --+ brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_PNO, "pfn"); -- if (drvr->bus_if->wowl_supported) -- brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_WOWL, "wowl"); -- if (drvr->bus_if->chip != BRCM_CC_43362_CHIP_ID) ----- a/drivers/net/wireless/brcm80211/brcmfmac/feature.h --+++ b/drivers/net/wireless/brcm80211/brcmfmac/feature.h --@@ -21,11 +21,13 @@ -- * -- * MBSS: multiple BSSID support (eg. guest network in AP mode). -- * MCHAN: multi-channel for concurrent P2P. --+ * PNO: preferred network offload. -- * WOWL: Wake-On-WLAN. -- */ -- #define BRCMF_FEAT_LIST \ -- BRCMF_FEAT_DEF(MBSS) \ -- BRCMF_FEAT_DEF(MCHAN) \ --+ BRCMF_FEAT_DEF(PNO) \ -- 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 -deleted file mode 100644 -index b859d46..0000000 ---- a/package/kernel/mac80211/patches/358-brcmfmac-add-support-for-BCM4324-rev-B5-chipset.patch -+++ /dev/null -@@ -1,43 +0,0 @@ --From: Arend van Spriel --Date: Tue, 14 Apr 2015 20:10:28 +0200 --Subject: [PATCH] brcmfmac: add support for BCM4324 rev B5 chipset -- --This patch adds support for the BCM4324 B5 revision. This device --is similar to BCM43241 from driver and firmware perspective. It --is known to be used in Lenovo Thinkpad Tablet devices. -- --Reviewed-by: Hante Meuleman --Reviewed-by: Pieter-Paul Giesberts --Signed-off-by: Arend van Spriel ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --@@ -601,6 +601,8 @@ static const struct sdiod_drive_str sdio -- #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" --@@ -628,6 +630,8 @@ 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); --@@ -667,7 +671,8 @@ enum brcmf_firmware_type { -- 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, 0xFFFFFFE0, BRCMF_FIRMWARE_NVRAM(BCM43241B4) }, --+ { 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) }, -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 -deleted file mode 100644 -index d420308..0000000 ---- a/package/kernel/mac80211/patches/359-brcmfmac-process-interrupt-regardless-sdiod-state.patch -+++ /dev/null -@@ -1,27 +0,0 @@ --From: Arend van Spriel --Date: Tue, 14 Apr 2015 20:10:29 +0200 --Subject: [PATCH] brcmfmac: process interrupt regardless sdiod state -- --When the sdio bus state is not ready to process we abort the --interrupt service routine. This is not wanted as it keeps the --interrupt source active. Better clear the interrupt source. -- --Reviewed-by: Hante Meuleman --Reviewed-by: Pieter-Paul Giesberts --Reviewed-by: Franky (Zhenhui) Lin --Signed-off-by: Arend van Spriel ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --@@ -3555,10 +3555,6 @@ void brcmf_sdio_isr(struct brcmf_sdio *b -- return; -- } -- --- if (bus->sdiodev->state != BRCMF_SDIOD_DATA) { --- brcmf_err("bus is down. we have nothing to do\n"); --- return; --- } -- /* 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 -deleted file mode 100644 -index ac5584e..0000000 ---- a/package/kernel/mac80211/patches/360-brcmfmac-fix-sdio-suspend-and-resume.patch -+++ /dev/null -@@ -1,68 +0,0 @@ --From: Arend van Spriel --Date: Tue, 14 Apr 2015 20:10:30 +0200 --Subject: [PATCH] brcmfmac: fix sdio suspend and resume -- --commit 330b4e4be937 ("brcmfmac: Add wowl support for SDIO devices.") --changed the behaviour by removing the MMC_PM_KEEP_POWER flag for --non-wowl scenario, which needs to be restored. Another necessary --change is to mark the card as being non-removable. With this in place --the suspend resume test passes successfully doing: -- -- # echo devices > /sys/power/pm_test -- # echo mem > /sys/power/state -- --Note that power may still be switched off when system is going --in S3 state. -- --Reported-by: Fu, Zhonghui < --Reviewed-by: Pieter-Paul Giesberts --Reviewed-by: Franky (Zhenhui) Lin --Signed-off-by: Arend van Spriel ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c --@@ -1011,6 +1011,14 @@ static int brcmf_sdiod_remove(struct brc -- return 0; -- } -- --+static void brcmf_sdiod_host_fixup(struct mmc_host *host) --+{ --+ /* runtime-pm powers off the device */ --+ pm_runtime_forbid(host->parent); --+ /* avoid removal detection upon resume */ --+ host->caps |= MMC_CAP_NONREMOVABLE; --+} --+ -- static int brcmf_sdiod_probe(struct brcmf_sdio_dev *sdiodev) -- { -- struct sdio_func *func; --@@ -1076,7 +1084,7 @@ static int brcmf_sdiod_probe(struct brcm -- ret = -ENODEV; -- goto out; -- } --- pm_runtime_forbid(host->parent); --+ brcmf_sdiod_host_fixup(host); -- out: -- if (ret) -- brcmf_sdiod_remove(sdiodev); --@@ -1246,15 +1254,15 @@ static int brcmf_ops_sdio_suspend(struct -- brcmf_sdiod_freezer_on(sdiodev); -- brcmf_sdio_wd_timer(sdiodev->bus, 0); -- --+ sdio_flags = MMC_PM_KEEP_POWER; -- if (sdiodev->wowl_enabled) { --- sdio_flags = MMC_PM_KEEP_POWER; -- if (sdiodev->pdata->oob_irq_supported) -- enable_irq_wake(sdiodev->pdata->oob_irq_nr); -- else --- sdio_flags = MMC_PM_WAKE_SDIO_IRQ; --- if (sdio_set_host_pm_flags(sdiodev->func[1], sdio_flags)) --- brcmf_err("Failed to set pm_flags %x\n", sdio_flags); --+ sdio_flags |= MMC_PM_WAKE_SDIO_IRQ; -- } --+ if (sdio_set_host_pm_flags(sdiodev->func[1], sdio_flags)) --+ brcmf_err("Failed to set pm_flags %x\n", sdio_flags); -- 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 -deleted file mode 100644 -index a521b65..0000000 ---- a/package/kernel/mac80211/patches/361-brcmfmac-add-support-for-BCM4358-PCIe-device.patch -+++ /dev/null -@@ -1,77 +0,0 @@ --From: Arend van Spriel --Date: Tue, 14 Apr 2015 20:10:31 +0200 --Subject: [PATCH] brcmfmac: add support for BCM4358 PCIe device -- --This patch adds support for the BCM4358 2x2 11ac device. -- --Reviewed-by: Pieter-Paul Giesberts --Signed-off-by: Arend van Spriel ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/chip.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c --@@ -649,6 +649,7 @@ static u32 brcmf_chip_tcm_rambase(struct -- case BRCM_CC_43567_CHIP_ID: -- case BRCM_CC_43569_CHIP_ID: -- case BRCM_CC_43570_CHIP_ID: --+ case BRCM_CC_4358_CHIP_ID: -- case BRCM_CC_43602_CHIP_ID: -- return 0x180000; -- default: ----- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --@@ -51,6 +51,8 @@ enum brcmf_pcie_state { -- #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_FW_UP_TIMEOUT 2000 /* msec */ -- --@@ -189,6 +191,8 @@ 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); -- -- -- struct brcmf_pcie_console { --@@ -1333,6 +1337,10 @@ static int brcmf_pcie_get_fwnames(struct -- 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; -- default: -- brcmf_err("Unsupported chip 0x%04x\n", devinfo->ci->chip); -- return -ENODEV; --@@ -1850,6 +1858,7 @@ static struct pci_device_id brcmf_pcie_d -- BRCMF_PCIE_DEVICE(BRCM_PCIE_4356_DEVICE_ID), -- 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_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 --@@ -45,6 +45,7 @@ -- #define BRCM_CC_43567_CHIP_ID 43567 -- #define BRCM_CC_43569_CHIP_ID 43569 -- #define BRCM_CC_43570_CHIP_ID 43570 --+#define BRCM_CC_4358_CHIP_ID 0x4358 -- #define BRCM_CC_43602_CHIP_ID 43602 -- -- /* USB Device IDs */ --@@ -59,6 +60,7 @@ -- #define BRCM_PCIE_4356_DEVICE_ID 0x43ec -- #define BRCM_PCIE_43567_DEVICE_ID 0x43d3 -- #define BRCM_PCIE_43570_DEVICE_ID 0x43d9 --+#define BRCM_PCIE_4358_DEVICE_ID 0x43e9 -- #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 -deleted file mode 100644 -index bcbb984..0000000 ---- a/package/kernel/mac80211/patches/362-brcmfmac-add-additional-43602-pcie-device-id.patch -+++ /dev/null -@@ -1,30 +0,0 @@ --From: Hante Meuleman --Date: Tue, 14 Apr 2015 20:10:32 +0200 --Subject: [PATCH] brcmfmac: add additional 43602 pcie device id. -- --Reviewed-by: Arend Van Spriel --Reviewed-by: Pieter-Paul Giesberts --Signed-off-by: Hante Meuleman --Signed-off-by: Arend van Spriel ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --@@ -1862,6 +1862,7 @@ static struct pci_device_id brcmf_pcie_d -- 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), --+ BRCMF_PCIE_DEVICE(BRCM_PCIE_43602_RAW_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 --@@ -64,6 +64,7 @@ -- #define BRCM_PCIE_43602_DEVICE_ID 0x43ba -- #define BRCM_PCIE_43602_2G_DEVICE_ID 0x43bb -- #define BRCM_PCIE_43602_5G_DEVICE_ID 0x43bc --+#define BRCM_PCIE_43602_RAW_DEVICE_ID 43602 -- -- /* 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 -deleted file mode 100644 -index 5f9bbea..0000000 ---- a/package/kernel/mac80211/patches/363-brcmfmac-Add-support-for-multiple-PCIE-devices-in-nv.patch -+++ /dev/null -@@ -1,351 +0,0 @@ --From: Hante Meuleman --Date: Tue, 14 Apr 2015 20:10:33 +0200 --Subject: [PATCH] brcmfmac: Add support for multiple PCIE devices in -- nvram. -- --With PCIE it is possible to support multiple devices with the --same device type. They all load the same nvram file. In order to --support this the nvram can specify which part of the nvram is --for which pcie device. This patch adds support for these new --types of nvram files. -- --Reviewed-by: Arend Van Spriel --Reviewed-by: Franky (Zhenhui) Lin --Reviewed-by: Pieter-Paul Giesberts --Reviewed-by: Daniel (Deognyoun) Kim --Signed-off-by: Hante Meuleman --Signed-off-by: Arend van Spriel ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/firmware.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/firmware.c --@@ -23,6 +23,10 @@ -- #include "debug.h" -- #include "firmware.h" -- --+#define BRCMF_FW_MAX_NVRAM_SIZE 64000 --+#define BRCMF_FW_NVRAM_DEVPATH_LEN 19 /* devpath0=pcie/1/4/ */ --+#define BRCMF_FW_NVRAM_PCIEDEV_LEN 9 /* pcie/1/4/ */ --+ -- char brcmf_firmware_path[BRCMF_FW_PATH_LEN]; -- module_param_string(firmware_path, brcmf_firmware_path, -- BRCMF_FW_PATH_LEN, 0440); --@@ -46,6 +50,8 @@ enum nvram_parser_state { -- * @column: current column in line. -- * @pos: byte offset in input buffer. -- * @entry: start position of key,value entry. --+ * @multi_dev_v1: detect pcie multi device v1 (compressed). --+ * @multi_dev_v2: detect pcie multi device v2. -- */ -- struct nvram_parser { -- enum nvram_parser_state state; --@@ -56,6 +62,8 @@ struct nvram_parser { -- u32 column; -- u32 pos; -- u32 entry; --+ bool multi_dev_v1; --+ bool multi_dev_v2; -- }; -- -- static bool is_nvram_char(char c) --@@ -108,6 +116,10 @@ static enum nvram_parser_state brcmf_nvr -- st = COMMENT; -- else -- st = VALUE; --+ if (strncmp(&nvp->fwnv->data[nvp->entry], "devpath", 7) == 0) --+ nvp->multi_dev_v1 = true; --+ if (strncmp(&nvp->fwnv->data[nvp->entry], "pcie/", 5) == 0) --+ nvp->multi_dev_v2 = true; -- } else if (!is_nvram_char(c)) { -- brcmf_dbg(INFO, "warning: ln=%d:col=%d: '=' expected, skip invalid key entry\n", -- nvp->line, nvp->column); --@@ -133,6 +145,8 @@ brcmf_nvram_handle_value(struct nvram_pa -- ekv = (u8 *)&nvp->fwnv->data[nvp->pos]; -- skv = (u8 *)&nvp->fwnv->data[nvp->entry]; -- cplen = ekv - skv; --+ if (nvp->nvram_len + cplen + 1 >= BRCMF_FW_MAX_NVRAM_SIZE) --+ return END; -- /* copy to output buffer */ -- memcpy(&nvp->nvram[nvp->nvram_len], skv, cplen); -- nvp->nvram_len += cplen; --@@ -180,10 +194,18 @@ static enum nvram_parser_state -- static int brcmf_init_nvram_parser(struct nvram_parser *nvp, -- const struct firmware *nv) -- { --+ size_t size; --+ -- memset(nvp, 0, sizeof(*nvp)); -- nvp->fwnv = nv; --+ /* Limit size to MAX_NVRAM_SIZE, some files contain lot of comment */ --+ if (nv->size > BRCMF_FW_MAX_NVRAM_SIZE) --+ size = BRCMF_FW_MAX_NVRAM_SIZE; --+ else --+ size = nv->size; -- /* Alloc for extra 0 byte + roundup by 4 + length field */ --- nvp->nvram = kzalloc(nv->size + 1 + 3 + sizeof(u32), GFP_KERNEL); --+ size += 1 + 3 + sizeof(u32); --+ nvp->nvram = kzalloc(size, GFP_KERNEL); -- if (!nvp->nvram) -- return -ENOMEM; -- --@@ -192,12 +214,136 @@ static int brcmf_init_nvram_parser(struc -- return 0; -- } -- --+/* brcmf_fw_strip_multi_v1 :Some nvram files contain settings for multiple --+ * devices. Strip it down for one device, use domain_nr/bus_nr to determine --+ * which data is to be returned. v1 is the version where nvram is stored --+ * compressed and "devpath" maps to index for valid entries. --+ */ --+static void brcmf_fw_strip_multi_v1(struct nvram_parser *nvp, u16 domain_nr, --+ u16 bus_nr) --+{ --+ u32 i, j; --+ bool found; --+ u8 *nvram; --+ u8 id; --+ --+ nvram = kzalloc(nvp->nvram_len + 1 + 3 + sizeof(u32), GFP_KERNEL); --+ if (!nvram) --+ goto fail; --+ --+ /* min length: devpath0=pcie/1/4/ + 0:x=y */ --+ if (nvp->nvram_len < BRCMF_FW_NVRAM_DEVPATH_LEN + 6) --+ goto fail; --+ --+ /* First search for the devpathX and see if it is the configuration --+ * for domain_nr/bus_nr. Search complete nvp --+ */ --+ found = false; --+ i = 0; --+ while (i < nvp->nvram_len - BRCMF_FW_NVRAM_DEVPATH_LEN) { --+ /* Format: devpathX=pcie/Y/Z/ --+ * Y = domain_nr, Z = bus_nr, X = virtual ID --+ */ --+ if ((strncmp(&nvp->nvram[i], "devpath", 7) == 0) && --+ (strncmp(&nvp->nvram[i + 8], "=pcie/", 6) == 0)) { --+ if (((nvp->nvram[i + 14] - '0') == domain_nr) && --+ ((nvp->nvram[i + 16] - '0') == bus_nr)) { --+ id = nvp->nvram[i + 7] - '0'; --+ found = true; --+ break; --+ } --+ } --+ while (nvp->nvram[i] != 0) --+ i++; --+ i++; --+ } --+ if (!found) --+ goto fail; --+ --+ /* Now copy all valid entries, release old nvram and assign new one */ --+ i = 0; --+ j = 0; --+ while (i < nvp->nvram_len) { --+ if ((nvp->nvram[i] - '0' == id) && (nvp->nvram[i + 1] == ':')) { --+ i += 2; --+ while (nvp->nvram[i] != 0) { --+ nvram[j] = nvp->nvram[i]; --+ i++; --+ j++; --+ } --+ nvram[j] = 0; --+ j++; --+ } --+ while (nvp->nvram[i] != 0) --+ i++; --+ i++; --+ } --+ kfree(nvp->nvram); --+ nvp->nvram = nvram; --+ nvp->nvram_len = j; --+ return; --+ --+fail: --+ kfree(nvram); --+ nvp->nvram_len = 0; --+} --+ --+/* brcmf_fw_strip_multi_v2 :Some nvram files contain settings for multiple --+ * devices. Strip it down for one device, use domain_nr/bus_nr to determine --+ * which data is to be returned. v2 is the version where nvram is stored --+ * uncompressed, all relevant valid entries are identified by --+ * pcie/domain_nr/bus_nr: --+ */ --+static void brcmf_fw_strip_multi_v2(struct nvram_parser *nvp, u16 domain_nr, --+ u16 bus_nr) --+{ --+ u32 i, j; --+ u8 *nvram; --+ --+ nvram = kzalloc(nvp->nvram_len + 1 + 3 + sizeof(u32), GFP_KERNEL); --+ if (!nvram) --+ goto fail; --+ --+ /* Copy all valid entries, release old nvram and assign new one. --+ * Valid entries are of type pcie/X/Y/ where X = domain_nr and --+ * Y = bus_nr. --+ */ --+ i = 0; --+ j = 0; --+ while (i < nvp->nvram_len - BRCMF_FW_NVRAM_PCIEDEV_LEN) { --+ if ((strncmp(&nvp->nvram[i], "pcie/", 5) == 0) && --+ (nvp->nvram[i + 6] == '/') && (nvp->nvram[i + 8] == '/') && --+ ((nvp->nvram[i + 5] - '0') == domain_nr) && --+ ((nvp->nvram[i + 7] - '0') == bus_nr)) { --+ i += BRCMF_FW_NVRAM_PCIEDEV_LEN; --+ while (nvp->nvram[i] != 0) { --+ nvram[j] = nvp->nvram[i]; --+ i++; --+ j++; --+ } --+ nvram[j] = 0; --+ j++; --+ } --+ while (nvp->nvram[i] != 0) --+ i++; --+ i++; --+ } --+ kfree(nvp->nvram); --+ nvp->nvram = nvram; --+ nvp->nvram_len = j; --+ return; --+fail: --+ kfree(nvram); --+ nvp->nvram_len = 0; --+} --+ -- /* brcmf_nvram_strip :Takes a buffer of "=\n" lines read from a fil -- * and ending in a NUL. Removes carriage returns, empty lines, comment lines, -- * and converts newlines to NULs. Shortens buffer as needed and pads with NULs. -- * End of buffer is completed with token identifying length of buffer. -- */ ---static void *brcmf_fw_nvram_strip(const struct firmware *nv, u32 *new_length) --+static void *brcmf_fw_nvram_strip(const struct firmware *nv, u32 *new_length, --+ u16 domain_nr, u16 bus_nr) -- { -- struct nvram_parser nvp; -- u32 pad; --@@ -212,6 +358,16 @@ static void *brcmf_fw_nvram_strip(const -- if (nvp.state == END) -- break; -- } --+ if (nvp.multi_dev_v1) --+ brcmf_fw_strip_multi_v1(&nvp, domain_nr, bus_nr); --+ else if (nvp.multi_dev_v2) --+ brcmf_fw_strip_multi_v2(&nvp, domain_nr, bus_nr); --+ --+ if (nvp.nvram_len == 0) { --+ kfree(nvp.nvram); --+ return NULL; --+ } --+ -- pad = nvp.nvram_len; -- *new_length = roundup(nvp.nvram_len + 1, 4); -- while (pad != *new_length) { --@@ -239,6 +395,8 @@ struct brcmf_fw { -- u16 flags; -- const struct firmware *code; -- const char *nvram_name; --+ u16 domain_nr; --+ u16 bus_nr; -- void (*done)(struct device *dev, const struct firmware *fw, -- void *nvram_image, u32 nvram_len); -- }; --@@ -254,7 +412,8 @@ static void brcmf_fw_request_nvram_done( -- goto fail; -- -- if (fw) { --- nvram = brcmf_fw_nvram_strip(fw, &nvram_length); --+ nvram = brcmf_fw_nvram_strip(fw, &nvram_length, --+ fwctx->domain_nr, fwctx->bus_nr); -- release_firmware(fw); -- if (!nvram && !(fwctx->flags & BRCMF_FW_REQ_NV_OPTIONAL)) -- goto fail; --@@ -309,11 +468,12 @@ fail: -- kfree(fwctx); -- } -- ---int brcmf_fw_get_firmwares(struct device *dev, u16 flags, --- const char *code, const char *nvram, --- void (*fw_cb)(struct device *dev, --- const struct firmware *fw, --- void *nvram_image, u32 nvram_len)) --+int brcmf_fw_get_firmwares_pcie(struct device *dev, u16 flags, --+ const char *code, const char *nvram, --+ void (*fw_cb)(struct device *dev, --+ const struct firmware *fw, --+ void *nvram_image, u32 nvram_len), --+ u16 domain_nr, u16 bus_nr) -- { -- struct brcmf_fw *fwctx; -- --@@ -333,8 +493,21 @@ int brcmf_fw_get_firmwares(struct device -- fwctx->done = fw_cb; -- if (flags & BRCMF_FW_REQUEST_NVRAM) -- fwctx->nvram_name = nvram; --+ fwctx->domain_nr = domain_nr; --+ fwctx->bus_nr = bus_nr; -- -- return request_firmware_nowait(THIS_MODULE, true, code, dev, -- GFP_KERNEL, fwctx, -- brcmf_fw_request_code_done); -- } --+ --+int brcmf_fw_get_firmwares(struct device *dev, u16 flags, --+ const char *code, const char *nvram, --+ void (*fw_cb)(struct device *dev, --+ const struct firmware *fw, --+ void *nvram_image, u32 nvram_len)) --+{ --+ return brcmf_fw_get_firmwares_pcie(dev, flags, code, nvram, fw_cb, 0, --+ 0); --+} --+ ----- a/drivers/net/wireless/brcm80211/brcmfmac/firmware.h --+++ b/drivers/net/wireless/brcm80211/brcmfmac/firmware.h --@@ -32,6 +32,12 @@ void brcmf_fw_nvram_free(void *nvram); -- * fails it will not use the callback, but call device_release_driver() -- * instead which will call the driver .remove() callback. -- */ --+int brcmf_fw_get_firmwares_pcie(struct device *dev, u16 flags, --+ const char *code, const char *nvram, --+ void (*fw_cb)(struct device *dev, --+ const struct firmware *fw, --+ void *nvram_image, u32 nvram_len), --+ u16 domain_nr, u16 bus_nr); -- int brcmf_fw_get_firmwares(struct device *dev, u16 flags, -- const char *code, const char *nvram, -- void (*fw_cb)(struct device *dev, ----- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --@@ -1649,8 +1649,13 @@ brcmf_pcie_probe(struct pci_dev *pdev, c -- struct brcmf_pciedev_info *devinfo; -- struct brcmf_pciedev *pcie_bus_dev; -- struct brcmf_bus *bus; --+ u16 domain_nr; --+ u16 bus_nr; -- --- brcmf_dbg(PCIE, "Enter %x:%x\n", pdev->vendor, pdev->device); --+ domain_nr = pci_domain_nr(pdev->bus) + 1; --+ bus_nr = pdev->bus->number; --+ brcmf_dbg(PCIE, "Enter %x:%x (%d/%d)\n", pdev->vendor, pdev->device, --+ domain_nr, bus_nr); -- -- ret = -ENOMEM; -- devinfo = kzalloc(sizeof(*devinfo), GFP_KERNEL); --@@ -1699,10 +1704,10 @@ brcmf_pcie_probe(struct pci_dev *pdev, c -- if (ret) -- goto fail_bus; -- --- ret = brcmf_fw_get_firmwares(bus->dev, BRCMF_FW_REQUEST_NVRAM | --- BRCMF_FW_REQ_NV_OPTIONAL, --- devinfo->fw_name, devinfo->nvram_name, --- brcmf_pcie_setup); --+ ret = brcmf_fw_get_firmwares_pcie(bus->dev, BRCMF_FW_REQUEST_NVRAM | --+ BRCMF_FW_REQ_NV_OPTIONAL, --+ devinfo->fw_name, devinfo->nvram_name, --+ brcmf_pcie_setup, domain_nr, bus_nr); -- 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 -deleted file mode 100644 -index d26e118..0000000 ---- a/package/kernel/mac80211/patches/364-brcmfmac-cleanup-a-sizeof.patch -+++ /dev/null -@@ -1,23 +0,0 @@ --From: Dan Carpenter --Date: Thu, 7 May 2015 12:59:19 +0300 --Subject: [PATCH] brcmfmac: cleanup a sizeof() -- --"flowrings" and "*flowrings" are both pointers so this always returns --sizeof(void *) and the current code works fine. But "*flowrings" is --intended here and static checkers complain, so lets change it. -- --Signed-off-by: Dan Carpenter --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --@@ -1617,7 +1617,7 @@ static void brcmf_pcie_setup(struct devi -- bus->msgbuf->commonrings[i] = -- &devinfo->shared.commonrings[i]->commonring; -- --- flowrings = kcalloc(devinfo->shared.nrof_flowrings, sizeof(flowrings), --+ flowrings = kcalloc(devinfo->shared.nrof_flowrings, sizeof(*flowrings), -- 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 -deleted file mode 100644 -index 9b2880d..0000000 ---- a/package/kernel/mac80211/patches/365-brcmfmac-check-result-of-USB-firmware-request.patch -+++ /dev/null -@@ -1,33 +0,0 @@ --From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= --Date: Thu, 7 May 2015 14:13:03 +0200 --Subject: [PATCH] brcmfmac: check result of USB firmware request --MIME-Version: 1.0 --Content-Type: text/plain; charset=UTF-8 --Content-Transfer-Encoding: 8bit -- --This prevents silence failures with driver waiting (infinitely) for a --callback. -- --Signed-off-by: Rafał Miłecki --Acked-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 --@@ -1270,8 +1270,13 @@ static int brcmf_usb_probe_cb(struct brc -- bus->chiprev = bus_pub->chiprev; -- -- /* request firmware here */ --- brcmf_fw_get_firmwares(dev, 0, brcmf_usb_get_fwname(devinfo), NULL, --- brcmf_usb_probe_phase2); --+ ret = brcmf_fw_get_firmwares(dev, 0, brcmf_usb_get_fwname(devinfo), --+ NULL, brcmf_usb_probe_phase2); --+ if (ret) { --+ brcmf_err("firmware request failed: %d\n", ret); --+ goto fail; --+ } --+ -- 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 -deleted file mode 100644 -index d46b300..0000000 ---- a/package/kernel/mac80211/patches/366-brcmfmac-prohibit-ACPI-power-management-for-brcmfmac.patch -+++ /dev/null -@@ -1,47 +0,0 @@ --From: "Fu, Zhonghui" --Date: Mon, 11 May 2015 10:41:32 +0800 --Subject: [PATCH] brcmfmac: prohibit ACPI power management for brcmfmac driver -- --ACPI will manage WiFi chip's power state during suspend/resume --process on some tablet platforms(such as ASUS T100TA). This is --not supported by brcmfmac driver now, and the context of WiFi --chip will be damaged after resume. This patch informs ACPI not --to manage WiFi chip's power state. -- --Signed-off-by: Zhonghui Fu --Acked-by: Arend van Spriel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c --@@ -33,6 +33,7 @@ -- #include -- #include -- #include --+#include -- #include -- -- #include --@@ -1122,6 +1123,8 @@ static int brcmf_ops_sdio_probe(struct s -- int err; -- struct brcmf_sdio_dev *sdiodev; -- struct brcmf_bus *bus_if; --+ struct device *dev; --+ struct acpi_device *adev; -- -- brcmf_dbg(SDIO, "Enter\n"); -- brcmf_dbg(SDIO, "Class=%x\n", func->class); --@@ -1129,6 +1132,12 @@ static int brcmf_ops_sdio_probe(struct s -- brcmf_dbg(SDIO, "sdio device ID: 0x%04x\n", func->device); -- brcmf_dbg(SDIO, "Function#: %d\n", func->num); -- --+ /* prohibit ACPI power management for this device */ --+ dev = &func->dev; --+ adev = ACPI_COMPANION(dev); --+ if (adev) --+ adev->flags.power_manageable = 0; --+ -- /* 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 -deleted file mode 100644 -index 9b4609f..0000000 ---- a/package/kernel/mac80211/patches/367-brcmfmac-avoid-gcc-5.1-warning.patch -+++ /dev/null -@@ -1,30 +0,0 @@ --From: Arnd Bergmann --Date: Tue, 12 May 2015 23:54:25 +0200 --Subject: [PATCH] brcmfmac: avoid gcc-5.1 warning -- --gcc-5.0 gained a new warning in the fwsignal portion of the brcmfmac --driver: -- --drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c: In function 'brcmf_fws_txs_process': --drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c:1478:8: warning: 'skb' may be used uninitialized in this function [-Wmaybe-uninitialized] -- --This is a false positive, and marking the brcmf_fws_hanger_poppkt function --as 'static inline' makes the warning go away. I have checked the object --file output and while a little code gets moved around, the size of --the binary remains identical. -- --Signed-off-by: Arnd Bergmann --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c --@@ -635,7 +635,7 @@ static int brcmf_fws_hanger_pushpkt(stru -- return 0; -- } -- ---static int brcmf_fws_hanger_poppkt(struct brcmf_fws_hanger *h, --+static inline int brcmf_fws_hanger_poppkt(struct brcmf_fws_hanger *h, -- 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 -deleted file mode 100644 -index b16782d..0000000 ---- a/package/kernel/mac80211/patches/368-brcmfmac-allow-device-tree-node-without-interrupts-p.patch -+++ /dev/null -@@ -1,45 +0,0 @@ --From: Arend van Spriel --Date: Wed, 20 May 2015 14:09:47 +0200 --Subject: [PATCH] brcmfmac: allow device tree node without 'interrupts' -- property -- --As described in the device tree bindings for 'brcm,bcm4329-fmac' --nodes, the interrupts property is optional. So adding a check --for the presence of this property before attempting to parse --and map the interrupt. If not present or parsing fails return --and fallback to in-band sdio interrupt. -- --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/of.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/of.c --@@ -39,10 +39,16 @@ void brcmf_of_probe(struct brcmf_sdio_de -- if (!sdiodev->pdata) -- return; -- --+ if (of_property_read_u32(np, "brcm,drive-strength", &val) == 0) --+ sdiodev->pdata->drive_strength = val; --+ --+ /* make sure there are interrupts defined in the node */ --+ if (!of_find_property(np, "interrupts", NULL)) --+ return; --+ -- irq = irq_of_parse_and_map(np, 0); -- if (!irq) { -- brcmf_err("interrupt could not be mapped\n"); --- devm_kfree(dev, sdiodev->pdata); -- return; -- } -- irqf = irqd_get_trigger_type(irq_get_irq_data(irq)); --@@ -50,7 +56,4 @@ void brcmf_of_probe(struct brcmf_sdio_de -- sdiodev->pdata->oob_irq_supported = true; -- sdiodev->pdata->oob_irq_nr = irq; -- sdiodev->pdata->oob_irq_flags = irqf; --- --- 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 -deleted file mode 100644 -index f81250e..0000000 ---- a/package/kernel/mac80211/patches/369-brcmfmac-Improve-throughput-by-scheduling-msbug-flow.patch -+++ /dev/null -@@ -1,87 +0,0 @@ --From: Hante Meuleman --Date: Wed, 20 May 2015 14:09:48 +0200 --Subject: [PATCH] brcmfmac: Improve throughput by scheduling msbug flow worker. -- --The tx flow worker in msgbuf gets scheduled at tx till a certain --threshold has been reached. Then the tx completes will take over --the scheduling. When amsdu and ampdu is used the frames are --transferred wireless in a very bulky fashion, in combination --with this scheduling algorithm and buffer limiters in the stack --this can result in limited throughput. This change causes the --flow worker to be scheduled more frequently from tx. -- --Reviewed-by: Arend Van Spriel --Reviewed-by: Franky (Zhenhui) Lin --Reviewed-by: Pieter-Paul Giesberts --Reviewed-by: Daniel (Deognyoun) Kim --Signed-off-by: Hante Meuleman --Signed-off-by: Arend van Spriel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/flowring.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/flowring.c --@@ -249,8 +249,8 @@ void brcmf_flowring_delete(struct brcmf_ -- } -- -- ---void brcmf_flowring_enqueue(struct brcmf_flowring *flow, u8 flowid, --- struct sk_buff *skb) --+u32 brcmf_flowring_enqueue(struct brcmf_flowring *flow, u8 flowid, --+ struct sk_buff *skb) -- { -- struct brcmf_flowring_ring *ring; -- --@@ -271,6 +271,7 @@ void brcmf_flowring_enqueue(struct brcmf -- if (skb_queue_len(&ring->skblist) < BRCMF_FLOWRING_LOW) -- brcmf_flowring_block(flow, flowid, false); -- } --+ return skb_queue_len(&ring->skblist); -- } -- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/flowring.h --+++ b/drivers/net/wireless/brcm80211/brcmfmac/flowring.h --@@ -64,8 +64,8 @@ u32 brcmf_flowring_create(struct brcmf_f -- 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); ---void brcmf_flowring_enqueue(struct brcmf_flowring *flow, u8 flowid, --- struct sk_buff *skb); --+u32 brcmf_flowring_enqueue(struct brcmf_flowring *flow, u8 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 *skb); ----- a/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c --@@ -73,7 +73,7 @@ -- #define BRCMF_MSGBUF_TX_FLUSH_CNT1 32 -- #define BRCMF_MSGBUF_TX_FLUSH_CNT2 96 -- ---#define BRCMF_MSGBUF_DELAY_TXWORKER_THRS 64 --+#define BRCMF_MSGBUF_DELAY_TXWORKER_THRS 96 -- #define BRCMF_MSGBUF_TRICKLE_TXWORKER_THRS 32 -- -- struct msgbuf_common_hdr { --@@ -797,6 +797,8 @@ static int brcmf_msgbuf_txdata(struct br -- struct brcmf_flowring *flow = msgbuf->flow; -- struct ethhdr *eh = (struct ethhdr *)(skb->data); -- u32 flowid; --+ u32 queue_count; --+ bool force; -- -- flowid = brcmf_flowring_lookup(flow, eh->h_dest, skb->priority, ifidx); -- if (flowid == BRCMF_FLOWRING_INVALID_ID) { --@@ -804,8 +806,9 @@ static int brcmf_msgbuf_txdata(struct br -- if (flowid == BRCMF_FLOWRING_INVALID_ID) -- return -ENOMEM; -- } --- brcmf_flowring_enqueue(flow, flowid, skb); --- brcmf_msgbuf_schedule_txdata(msgbuf, flowid, false); --+ queue_count = brcmf_flowring_enqueue(flow, flowid, skb); --+ force = ((queue_count % BRCMF_MSGBUF_TRICKLE_TXWORKER_THRS) == 0); --+ brcmf_msgbuf_schedule_txdata(msgbuf, flowid, force); -- -- 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 -deleted file mode 100644 -index 61153c4..0000000 ---- a/package/kernel/mac80211/patches/370-brcmfmac-remove-pci-shared-structure-rev4-support.patch -+++ /dev/null -@@ -1,41 +0,0 @@ --From: Franky Lin --Date: Wed, 20 May 2015 14:09:49 +0200 --Subject: [PATCH] brcmfmac: remove pci shared structure rev4 support -- --All pcie full dongle chips supported by fmac are using rev 5+ shared --structure. This patch removes the rev4 related code. -- --Reviewed-by: Pieter-Paul Giesberts --Reviewed-by: Hante Meuleman --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/pcie.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --@@ -112,10 +112,9 @@ enum brcmf_pcie_state { -- BRCMF_PCIE_MB_INT_D2H3_DB0 | \ -- BRCMF_PCIE_MB_INT_D2H3_DB1) -- ---#define BRCMF_PCIE_MIN_SHARED_VERSION 4 --+#define BRCMF_PCIE_MIN_SHARED_VERSION 5 -- #define BRCMF_PCIE_MAX_SHARED_VERSION 5 -- #define BRCMF_PCIE_SHARED_VERSION_MASK 0x00FF ---#define BRCMF_PCIE_SHARED_TXPUSH_SUPPORT 0x4000 -- -- #define BRCMF_PCIE_FLAGS_HTOD_SPLIT 0x4000 -- #define BRCMF_PCIE_FLAGS_DTOH_SPLIT 0x8000 --@@ -1280,11 +1279,6 @@ brcmf_pcie_init_share_ram_info(struct br -- brcmf_err("Unsupported PCIE version %d\n", version); -- return -EINVAL; -- } --- if (shared->flags & BRCMF_PCIE_SHARED_TXPUSH_SUPPORT) { --- brcmf_err("Unsupported legacy TX mode 0x%x\n", --- shared->flags & BRCMF_PCIE_SHARED_TXPUSH_SUPPORT); --- return -EINVAL; --- } -- -- 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 -deleted file mode 100644 -index 8c8eebe..0000000 ---- a/package/kernel/mac80211/patches/371-brcmfmac-remove-dummy-cache-flush-invalidate-functio.patch -+++ /dev/null -@@ -1,120 +0,0 @@ --From: Franky Lin --Date: Wed, 20 May 2015 14:09:50 +0200 --Subject: [PATCH] brcmfmac: remove dummy cache flush/invalidate function -- --brcmf_dma_flush and brcmf_dma_invalidate_cache are not necessary and --have never been implemented. -- --Reviewed-by: Pieter-Paul Giesberts --Reviewed-by: Hante Meuleman --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/commonring.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/commonring.c --@@ -22,17 +22,6 @@ -- #include "core.h" -- #include "commonring.h" -- --- ---/* dma flushing needs implementation for mips and arm platforms. Should --- * be put in util. Note, this is not real flushing. It is virtual non --- * cached memory. Only write buffers should have to be drained. Though --- * this may be different depending on platform...... --- * SEE ALSO msgbuf.c --- */ ---#define brcmf_dma_flush(addr, len) ---#define brcmf_dma_invalidate_cache(addr, len) --- --- -- void brcmf_commonring_register_cb(struct brcmf_commonring *commonring, -- int (*cr_ring_bell)(void *ctx), -- int (*cr_update_rptr)(void *ctx), --@@ -206,14 +195,9 @@ int brcmf_commonring_write_complete(stru -- address = commonring->buf_addr; -- address += (commonring->f_ptr * commonring->item_len); -- if (commonring->f_ptr > commonring->w_ptr) { --- brcmf_dma_flush(address, --- (commonring->depth - commonring->f_ptr) * --- commonring->item_len); -- address = commonring->buf_addr; -- commonring->f_ptr = 0; -- } --- brcmf_dma_flush(address, (commonring->w_ptr - commonring->f_ptr) * --- commonring->item_len); -- -- commonring->f_ptr = commonring->w_ptr; -- --@@ -258,8 +242,6 @@ void *brcmf_commonring_get_read_ptr(stru -- if (commonring->r_ptr == commonring->depth) -- commonring->r_ptr = 0; -- --- brcmf_dma_invalidate_cache(ret_addr, *n_ items * commonring->item_len); --- -- return ret_addr; -- } -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c --@@ -278,16 +278,6 @@ struct brcmf_msgbuf_pktids { -- struct brcmf_msgbuf_pktid *array; -- }; -- --- ---/* dma flushing needs implementation for mips and arm platforms. Should --- * be put in util. Note, this is not real flushing. It is virtual non --- * cached memory. Only write buffers should have to be drained. Though --- * this may be different depending on platform...... --- */ ---#define brcmf_dma_flush(addr, len) ---#define brcmf_dma_invalidate_cache(addr, len) --- --- -- static void brcmf_msgbuf_rxbuf_ioctlresp_post(struct brcmf_msgbuf *msgbuf); -- -- --@@ -462,7 +452,6 @@ static int brcmf_msgbuf_tx_ioctl(struct -- memcpy(msgbuf->ioctbuf, buf, buf_len); -- else -- memset(msgbuf->ioctbuf, 0, buf_len); --- brcmf_dma_flush(ioctl_buf, buf_len); -- -- err = brcmf_commonring_write_complete(commonring); -- brcmf_commonring_unlock(commonring); ----- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --@@ -276,15 +276,6 @@ static const u32 brcmf_ring_itemsize[BRC -- }; -- -- ---/* dma flushing needs implementation for mips and arm platforms. Should --- * be put in util. Note, this is not real flushing. It is virtual non --- * cached memory. Only write buffers should have to be drained. Though --- * this may be different depending on platform...... --- */ ---#define brcmf_dma_flush(addr, len) ---#define brcmf_dma_invalidate_cache(addr, len) --- --- -- static u32 -- brcmf_pcie_read_reg32(struct brcmf_pciedev_info *devinfo, u32 reg_offset) -- { --@@ -1174,7 +1165,6 @@ static int brcmf_pcie_init_scratchbuffer -- goto fail; -- -- memset(devinfo->shared.scratch, 0, BRCMF_DMA_D2H_SCRATCH_BUF_LEN); --- brcmf_dma_flush(devinfo->shared.scratch, BRCMF_DMA_D2H_SCRATCH_BUF_LEN); -- -- addr = devinfo->shared.tcm_base_address + -- BRCMF_SHARED_DMA_SCRATCH_ADDR_OFFSET; --@@ -1192,7 +1182,6 @@ static int brcmf_pcie_init_scratchbuffer -- goto fail; -- -- memset(devinfo->shared.ringupd, 0, BRCMF_DMA_D2H_RINGUPD_BUF_LEN); --- brcmf_dma_flush(devinfo->shared.ringupd, BRCMF_DMA_D2H_RINGUPD_BUF_LEN); -- -- 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 -deleted file mode 100644 -index 2f50abd..0000000 ---- a/package/kernel/mac80211/patches/372-brcmfmac-add-support-for-dma-indices-feature.patch -+++ /dev/null -@@ -1,270 +0,0 @@ --From: Franky Lin --Date: Wed, 20 May 2015 14:09:51 +0200 --Subject: [PATCH] brcmfmac: add support for dma indices feature -- --PCIe full dongle firmware can support a dma indices feature with which --firmware can update/fetch the read/write indices of message buffer --rings on both host to dongle and dongle to host directions. The support is --announced by firmware through shared flags. -- --Reviewed-by: Arend Van Spriel --Reviewed-by: Pieter-Paul Giesberts --Signed-off-by: Franky Lin --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 --@@ -115,6 +115,8 @@ enum brcmf_pcie_state { -- #define BRCMF_PCIE_MIN_SHARED_VERSION 5 -- #define BRCMF_PCIE_MAX_SHARED_VERSION 5 -- #define BRCMF_PCIE_SHARED_VERSION_MASK 0x00FF --+#define BRCMF_PCIE_SHARED_DMA_INDEX 0x10000 --+#define BRCMF_PCIE_SHARED_DMA_2B_IDX 0x100000 -- -- #define BRCMF_PCIE_FLAGS_HTOD_SPLIT 0x4000 -- #define BRCMF_PCIE_FLAGS_DTOH_SPLIT 0x8000 --@@ -146,6 +148,10 @@ enum brcmf_pcie_state { -- #define BRCMF_SHARED_RING_H2D_R_IDX_PTR_OFFSET 8 -- #define BRCMF_SHARED_RING_D2H_W_IDX_PTR_OFFSET 12 -- #define BRCMF_SHARED_RING_D2H_R_IDX_PTR_OFFSET 16 --+#define BRCMF_SHARED_RING_H2D_WP_HADDR_OFFSET 20 --+#define BRCMF_SHARED_RING_H2D_RP_HADDR_OFFSET 28 --+#define BRCMF_SHARED_RING_D2H_WP_HADDR_OFFSET 36 --+#define BRCMF_SHARED_RING_D2H_RP_HADDR_OFFSET 44 -- #define BRCMF_SHARED_RING_TCM_MEMLOC_OFFSET 0 -- #define BRCMF_SHARED_RING_MAX_SUB_QUEUES 52 -- --@@ -247,6 +253,13 @@ struct brcmf_pciedev_info { -- bool mbdata_completed; -- bool irq_allocated; -- bool wowl_enabled; --+ u8 dma_idx_sz; --+ void *idxbuf; --+ u32 idxbuf_sz; --+ dma_addr_t idxbuf_dmahandle; --+ u16 (*read_ptr)(struct brcmf_pciedev_info *devinfo, u32 mem_offset); --+ void (*write_ptr)(struct brcmf_pciedev_info *devinfo, u32 mem_offset, --+ u16 value); -- }; -- -- struct brcmf_pcie_ringbuf { --@@ -323,6 +336,25 @@ brcmf_pcie_write_tcm16(struct brcmf_pcie -- } -- -- --+static u16 --+brcmf_pcie_read_idx(struct brcmf_pciedev_info *devinfo, u32 mem_offset) --+{ --+ u16 *address = devinfo->idxbuf + mem_offset; --+ --+ return (*(address)); --+} --+ --+ --+static void --+brcmf_pcie_write_idx(struct brcmf_pciedev_info *devinfo, u32 mem_offset, --+ u16 value) --+{ --+ u16 *address = devinfo->idxbuf + mem_offset; --+ --+ *(address) = value; --+} --+ --+ -- static u32 -- brcmf_pcie_read_tcm32(struct brcmf_pciedev_info *devinfo, u32 mem_offset) -- { --@@ -868,7 +900,7 @@ static int brcmf_pcie_ring_mb_write_rptr -- brcmf_dbg(PCIE, "W r_ptr %d (%d), ring %d\n", commonring->r_ptr, -- commonring->w_ptr, ring->id); -- --- brcmf_pcie_write_tcm16(devinfo, ring->r_idx_addr, commonring->r_ptr); --+ devinfo->write_ptr(devinfo, ring->r_idx_addr, commonring->r_ptr); -- -- return 0; -- } --@@ -886,7 +918,7 @@ static int brcmf_pcie_ring_mb_write_wptr -- brcmf_dbg(PCIE, "W w_ptr %d (%d), ring %d\n", commonring->w_ptr, -- commonring->r_ptr, ring->id); -- --- brcmf_pcie_write_tcm16(devinfo, ring->w_idx_addr, commonring->w_ptr); --+ devinfo->write_ptr(devinfo, ring->w_idx_addr, commonring->w_ptr); -- -- return 0; -- } --@@ -915,7 +947,7 @@ static int brcmf_pcie_ring_mb_update_rpt -- if (devinfo->state != BRCMFMAC_PCIE_STATE_UP) -- return -EIO; -- --- commonring->r_ptr = brcmf_pcie_read_tcm16(devinfo, ring->r_idx_addr); --+ commonring->r_ptr = devinfo->read_ptr(devinfo, ring->r_idx_addr); -- -- brcmf_dbg(PCIE, "R r_ptr %d (%d), ring %d\n", commonring->r_ptr, -- commonring->w_ptr, ring->id); --@@ -933,7 +965,7 @@ static int brcmf_pcie_ring_mb_update_wpt -- if (devinfo->state != BRCMFMAC_PCIE_STATE_UP) -- return -EIO; -- --- commonring->w_ptr = brcmf_pcie_read_tcm16(devinfo, ring->w_idx_addr); --+ commonring->w_ptr = devinfo->read_ptr(devinfo, ring->w_idx_addr); -- -- brcmf_dbg(PCIE, "R w_ptr %d (%d), ring %d\n", commonring->w_ptr, -- commonring->r_ptr, ring->id); --@@ -1038,6 +1070,13 @@ static void brcmf_pcie_release_ringbuffe -- } -- kfree(devinfo->shared.flowrings); -- devinfo->shared.flowrings = NULL; --+ if (devinfo->idxbuf) { --+ dma_free_coherent(&devinfo->pdev->dev, --+ devinfo->idxbuf_sz, --+ devinfo->idxbuf, --+ devinfo->idxbuf_dmahandle); --+ devinfo->idxbuf = NULL; --+ } -- } -- -- --@@ -1053,19 +1092,72 @@ static int brcmf_pcie_init_ringbuffers(s -- u32 addr; -- u32 ring_mem_ptr; -- u32 i; --+ u64 address; --+ u32 bufsz; -- u16 max_sub_queues; --+ u8 idx_offset; -- -- ring_addr = devinfo->shared.ring_info_addr; -- brcmf_dbg(PCIE, "Base ring addr = 0x%08x\n", ring_addr); --+ addr = ring_addr + BRCMF_SHARED_RING_MAX_SUB_QUEUES; --+ max_sub_queues = brcmf_pcie_read_tcm16(devinfo, addr); -- --- addr = ring_addr + BRCMF_SHARED_RING_D2H_W_IDX_PTR_OFFSET; --- d2h_w_idx_ptr = brcmf_pcie_read_tcm32(devinfo, addr); --- addr = ring_addr + BRCMF_SHARED_RING_D2H_R_IDX_PTR_OFFSET; --- d2h_r_idx_ptr = brcmf_pcie_read_tcm32(devinfo, addr); --- addr = ring_addr + BRCMF_SHARED_RING_H2D_W_IDX_PTR_OFFSET; --- h2d_w_idx_ptr = brcmf_pcie_read_tcm32(devinfo, addr); --- addr = ring_addr + BRCMF_SHARED_RING_H2D_R_IDX_PTR_OFFSET; --- h2d_r_idx_ptr = brcmf_pcie_read_tcm32(devinfo, addr); --+ if (devinfo->dma_idx_sz != 0) { --+ bufsz = (BRCMF_NROF_D2H_COMMON_MSGRINGS + max_sub_queues) * --+ devinfo->dma_idx_sz * 2; --+ devinfo->idxbuf = dma_alloc_coherent(&devinfo->pdev->dev, bufsz, --+ &devinfo->idxbuf_dmahandle, --+ GFP_KERNEL); --+ if (!devinfo->idxbuf) --+ devinfo->dma_idx_sz = 0; --+ } --+ --+ if (devinfo->dma_idx_sz == 0) { --+ addr = ring_addr + BRCMF_SHARED_RING_D2H_W_IDX_PTR_OFFSET; --+ d2h_w_idx_ptr = brcmf_pcie_read_tcm32(devinfo, addr); --+ addr = ring_addr + BRCMF_SHARED_RING_D2H_R_IDX_PTR_OFFSET; --+ d2h_r_idx_ptr = brcmf_pcie_read_tcm32(devinfo, addr); --+ addr = ring_addr + BRCMF_SHARED_RING_H2D_W_IDX_PTR_OFFSET; --+ h2d_w_idx_ptr = brcmf_pcie_read_tcm32(devinfo, addr); --+ addr = ring_addr + BRCMF_SHARED_RING_H2D_R_IDX_PTR_OFFSET; --+ h2d_r_idx_ptr = brcmf_pcie_read_tcm32(devinfo, addr); --+ idx_offset = sizeof(u32); --+ devinfo->write_ptr = brcmf_pcie_write_tcm16; --+ devinfo->read_ptr = brcmf_pcie_read_tcm16; --+ brcmf_dbg(PCIE, "Using TCM indices\n"); --+ } else { --+ memset(devinfo->idxbuf, 0, bufsz); --+ devinfo->idxbuf_sz = bufsz; --+ idx_offset = devinfo->dma_idx_sz; --+ devinfo->write_ptr = brcmf_pcie_write_idx; --+ devinfo->read_ptr = brcmf_pcie_read_idx; --+ --+ h2d_w_idx_ptr = 0; --+ addr = ring_addr + BRCMF_SHARED_RING_H2D_WP_HADDR_OFFSET; --+ address = (u64)devinfo->idxbuf_dmahandle; --+ brcmf_pcie_write_tcm32(devinfo, addr, address & 0xffffffff); --+ brcmf_pcie_write_tcm32(devinfo, addr + 4, address >> 32); --+ --+ h2d_r_idx_ptr = h2d_w_idx_ptr + max_sub_queues * idx_offset; --+ addr = ring_addr + BRCMF_SHARED_RING_H2D_RP_HADDR_OFFSET; --+ address += max_sub_queues * idx_offset; --+ brcmf_pcie_write_tcm32(devinfo, addr, address & 0xffffffff); --+ brcmf_pcie_write_tcm32(devinfo, addr + 4, address >> 32); --+ --+ d2h_w_idx_ptr = h2d_r_idx_ptr + max_sub_queues * idx_offset; --+ addr = ring_addr + BRCMF_SHARED_RING_D2H_WP_HADDR_OFFSET; --+ address += max_sub_queues * idx_offset; --+ brcmf_pcie_write_tcm32(devinfo, addr, address & 0xffffffff); --+ brcmf_pcie_write_tcm32(devinfo, addr + 4, address >> 32); --+ --+ d2h_r_idx_ptr = d2h_w_idx_ptr + --+ BRCMF_NROF_D2H_COMMON_MSGRINGS * idx_offset; --+ addr = ring_addr + BRCMF_SHARED_RING_D2H_RP_HADDR_OFFSET; --+ address += BRCMF_NROF_D2H_COMMON_MSGRINGS * idx_offset; --+ brcmf_pcie_write_tcm32(devinfo, addr, address & 0xffffffff); --+ brcmf_pcie_write_tcm32(devinfo, addr + 4, address >> 32); --+ brcmf_dbg(PCIE, "Using host memory indices\n"); --+ } -- -- addr = ring_addr + BRCMF_SHARED_RING_TCM_MEMLOC_OFFSET; -- ring_mem_ptr = brcmf_pcie_read_tcm32(devinfo, addr); --@@ -1079,8 +1171,8 @@ static int brcmf_pcie_init_ringbuffers(s -- ring->id = i; -- devinfo->shared.commonrings[i] = ring; -- --- h2d_w_idx_ptr += sizeof(u32); --- h2d_r_idx_ptr += sizeof(u32); --+ h2d_w_idx_ptr += idx_offset; --+ h2d_r_idx_ptr += idx_offset; -- ring_mem_ptr += BRCMF_RING_MEM_SZ; -- } -- --@@ -1094,13 +1186,11 @@ static int brcmf_pcie_init_ringbuffers(s -- ring->id = i; -- devinfo->shared.commonrings[i] = ring; -- --- d2h_w_idx_ptr += sizeof(u32); --- d2h_r_idx_ptr += sizeof(u32); --+ d2h_w_idx_ptr += idx_offset; --+ d2h_r_idx_ptr += idx_offset; -- ring_mem_ptr += BRCMF_RING_MEM_SZ; -- } -- --- addr = ring_addr + BRCMF_SHARED_RING_MAX_SUB_QUEUES; --- max_sub_queues = brcmf_pcie_read_tcm16(devinfo, addr); -- devinfo->shared.nrof_flowrings = -- max_sub_queues - BRCMF_NROF_H2D_COMMON_MSGRINGS; -- rings = kcalloc(devinfo->shared.nrof_flowrings, sizeof(*ring), --@@ -1124,15 +1214,15 @@ static int brcmf_pcie_init_ringbuffers(s -- ring); -- ring->w_idx_addr = h2d_w_idx_ptr; -- ring->r_idx_addr = h2d_r_idx_ptr; --- h2d_w_idx_ptr += sizeof(u32); --- h2d_r_idx_ptr += sizeof(u32); --+ h2d_w_idx_ptr += idx_offset; --+ h2d_r_idx_ptr += idx_offset; -- } -- devinfo->shared.flowrings = rings; -- -- return 0; -- -- fail: --- brcmf_err("Allocating commonring buffers failed\n"); --+ brcmf_err("Allocating ring buffers failed\n"); -- brcmf_pcie_release_ringbuffers(devinfo); -- return -ENOMEM; -- } --@@ -1269,6 +1359,14 @@ brcmf_pcie_init_share_ram_info(struct br -- return -EINVAL; -- } -- --+ /* check firmware support dma indicies */ --+ if (shared->flags & BRCMF_PCIE_SHARED_DMA_INDEX) { --+ if (shared->flags & BRCMF_PCIE_SHARED_DMA_2B_IDX) --+ devinfo->dma_idx_sz = sizeof(u16); --+ else --+ devinfo->dma_idx_sz = sizeof(u32); --+ } --+ -- 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 -deleted file mode 100644 -index 28408d2..0000000 ---- a/package/kernel/mac80211/patches/373-brcmfmac-avoid-null-pointer-access-when-brcmf_msgbuf.patch -+++ /dev/null -@@ -1,102 +0,0 @@ --From: Arend van Spriel --Date: Tue, 26 May 2015 13:19:46 +0200 --Subject: [PATCH] brcmfmac: avoid null pointer access when -- brcmf_msgbuf_get_pktid() fails -- --The function brcmf_msgbuf_get_pktid() may return a NULL pointer so --the callers should check the return pointer before accessing it to --avoid the crash below (see [1]): -- --brcmfmac: brcmf_msgbuf_get_pktid: Invalid packet id 273 (not in use) --BUG: unable to handle kernel NULL pointer dereference at 0000000000000080 --IP: [] skb_pull+0x5/0x50 --PGD 0 --Oops: 0000 [#1] PREEMPT SMP --Modules linked in: pci_stub vboxpci(O) vboxnetflt(O) vboxnetadp(O) vboxdrv(O) -- snd_hda_codec_hdmi bnep mousedev hid_generic ushwmon msr ext4 crc16 mbcache -- jbd2 sd_mod uas usb_storage ahci libahci libata scsi_mod xhci_pci xhci_hcd -- usbcore usb_common --CPU: 0 PID: 1661 Comm: irq/61-brcmf_pc Tainted: G O 4.0.1-MacbookPro-ARCH #1 --Hardware name: Apple Inc. MacBookPro12,1/Mac-E43C1C25D4880AD6, -- BIOS MBP121.88Z.0167.B02.1503241251 03/24/2015 --task: ffff880264203cc0 ti: ffff88025ffe4000 task.ti: ffff88025ffe4000 --RIP: 0010:[] [] skb_pull+0x5/0x50 --RSP: 0018:ffff88025ffe7d40 EFLAGS: 00010202 --RAX: 0000000000000000 RBX: ffff88008a33c000 RCX: 0000000000000044 --RDX: 0000000000000000 RSI: 000000000000004a RDI: 0000000000000000 --RBP: ffff88025ffe7da8 R08: 0000000000000096 R09: 000000000000004a --R10: 0000000000000000 R11: 000000000000048e R12: ffff88025ff14f00 --R13: 0000000000000000 R14: ffff880263b48200 R15: ffff88008a33c000 --FS: 0000000000000000(0000) GS:ffff88026ec00000(0000) knlGS:0000000000000000 --CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 --CR2: 0000000000000080 CR3: 000000000180b000 CR4: 00000000003407f0 --Stack: -- ffffffffa06aed74 ffff88025ffe7dc8 ffff880263b48270 ffff880263b48278 -- 05ea88020000004a 0002ffff81014635 000000001720b2f6 ffff88026ec116c0 -- ffff880263b48200 0000000000010000 ffff880263b4ae00 ffff880264203cc0 --Call Trace: -- [] ? brcmf_msgbuf_process_rx+0x404/0x480 [brcmfmac] -- [] ? irq_finalize_oneshot.part.30+0xf0/0xf0 -- [] brcmf_proto_msgbuf_rx_trigger+0x35/0xf0 [brcmfmac] -- [] brcmf_pcie_isr_thread_v2+0x8a/0x130 [brcmfmac] -- [] irq_thread_fn+0x20/0x50 -- [] irq_thread+0x13f/0x170 -- [] ? wake_threads_waitq+0x30/0x30 -- [] ? irq_thread_dtor+0xb0/0xb0 -- [] kthread+0xd8/0xf0 -- [] ? kthread_create_on_node+0x1c0/0x1c0 -- [] ret_from_fork+0x58/0x90 -- [] ? kthread_create_on_node+0x1c0/0x1c0 --Code: 01 83 e2 f7 88 50 01 48 83 c4 08 5b 5d f3 c3 0f 1f 80 00 00 00 00 83 e2 -- f7 88 50 01 c3 66 0f 1f 84 00 00 00 00 00 0f 1f --RIP [] skb_pull+0x5/0x50 -- RSP --CR2: 0000000000000080 -----[ end trace b074c0f90e7c997d ]--- -- --[1] http://mid.gmane.org/20150430193259.GA5630@googlemail.com -- --Cc: # v3.18, v3.19, v4.0, v4.1 --Reported-by: Michael Hornung --Reviewed-by: Hante Meuleman --Reviewed-by: Pieter-Paul Giesberts --Signed-off-by: Arend van Spriel ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c --@@ -500,11 +500,9 @@ static int brcmf_msgbuf_query_dcmd(struc -- msgbuf->rx_pktids, -- msgbuf->ioctl_resp_pktid); -- if (msgbuf->ioctl_resp_ret_len != 0) { --- if (!skb) { --- brcmf_err("Invalid packet id idx recv'd %d\n", --- msgbuf->ioctl_resp_pktid); --+ if (!skb) -- return -EBADF; --- } --+ -- memcpy(buf, skb->data, (len < msgbuf->ioctl_resp_ret_len) ? -- len : msgbuf->ioctl_resp_ret_len); -- } --@@ -866,10 +864,8 @@ brcmf_msgbuf_process_txstatus(struct brc -- flowid -= BRCMF_NROF_H2D_COMMON_MSGRINGS; -- skb = brcmf_msgbuf_get_pktid(msgbuf->drvr->bus_if->dev, -- msgbuf->tx_pktids, idx); --- if (!skb) { --- brcmf_err("Invalid packet id idx recv'd %d\n", idx); --+ if (!skb) -- return; --- } -- -- set_bit(flowid, msgbuf->txstatus_done_map); -- commonring = msgbuf->flowrings[flowid]; --@@ -1148,6 +1144,8 @@ brcmf_msgbuf_process_rx_complete(struct -- -- skb = brcmf_msgbuf_get_pktid(msgbuf->drvr->bus_if->dev, -- msgbuf->rx_pktids, idx); --+ if (!skb) --+ return; -- -- 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 -deleted file mode 100644 -index f023034..0000000 ---- a/package/kernel/mac80211/patches/374-brcmfmac-fix-invalid-access-to-struct-acpi_device-fi.patch -+++ /dev/null -@@ -1,63 +0,0 @@ --From: Arend van Spriel --Date: Wed, 27 May 2015 19:31:41 +0200 --Subject: [PATCH] brcmfmac: fix invalid access to struct acpi_device fields -- --The fields of struct acpi_device are only known when CONFIG_ACPI is --defined. Fix this by using a helper function. This will resolve the --issue found in linux-next: -- -- ../brcmfmac/bcmsdh.c: In function 'brcmf_ops_sdio_probe': -- ../brcmfmac/bcmsdh.c:1139:7: error: dereferencing pointer to incomplete type -- adev->flags.power_manageable = 0; -- ^ -- --Fixes: f0992ace680c ("brcmfmac: prohibit ACPI power management ...") --Cc: Fu, Zhonghui --Reported-by: Stephen Rothwell --Signed-off-by: Arend van Spriel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c --@@ -1117,6 +1117,18 @@ MODULE_DEVICE_TABLE(sdio, brcmf_sdmmc_id -- static struct brcmfmac_sdio_platform_data *brcmfmac_sdio_pdata; -- -- --+static void brcmf_sdiod_acpi_set_power_manageable(struct device *dev, --+ int val) --+{ --+#if IS_ENABLED(CONFIG_ACPI) --+ struct acpi_device *adev; --+ --+ adev = ACPI_COMPANION(dev); --+ if (adev) --+ adev->flags.power_manageable = 0; --+#endif --+} --+ -- static int brcmf_ops_sdio_probe(struct sdio_func *func, -- const struct sdio_device_id *id) -- { --@@ -1124,7 +1136,6 @@ static int brcmf_ops_sdio_probe(struct s -- struct brcmf_sdio_dev *sdiodev; -- struct brcmf_bus *bus_if; -- struct device *dev; --- struct acpi_device *adev; -- -- brcmf_dbg(SDIO, "Enter\n"); -- brcmf_dbg(SDIO, "Class=%x\n", func->class); --@@ -1132,11 +1143,9 @@ static int brcmf_ops_sdio_probe(struct s -- brcmf_dbg(SDIO, "sdio device ID: 0x%04x\n", func->device); -- brcmf_dbg(SDIO, "Function#: %d\n", func->num); -- --- /* prohibit ACPI power management for this device */ -- dev = &func->dev; --- adev = ACPI_COMPANION(dev); --- if (adev) --- adev->flags.power_manageable = 0; --+ /* prohibit ACPI power management for this device */ --+ brcmf_sdiod_acpi_set_power_manageable(dev, 0); -- -- /* 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 -deleted file mode 100644 -index 2bfd44f..0000000 ---- a/package/kernel/mac80211/patches/375-brcmfmac-simplify-check-stripping-v2-NVRAM.patch -+++ /dev/null -@@ -1,56 +0,0 @@ --From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= --Date: Wed, 20 May 2015 09:34:21 +0200 --Subject: [PATCH] brcmfmac: simplify check stripping v2 NVRAM --MIME-Version: 1.0 --Content-Type: text/plain; charset=UTF-8 --Content-Transfer-Encoding: 8bit -- --Comparing NVRAM entry with a full filtering string is simpler than --comparing it with a short prefix and then checking random chars at magic --offsets. The cost of snprintf relatively low, we execute it just once. --Tested on BCM43602 with NVRAM hacked to use V2 format. -- --Signed-off-by: Rafał Miłecki --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/firmware.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/firmware.c --@@ -25,7 +25,7 @@ -- -- #define BRCMF_FW_MAX_NVRAM_SIZE 64000 -- #define BRCMF_FW_NVRAM_DEVPATH_LEN 19 /* devpath0=pcie/1/4/ */ ---#define BRCMF_FW_NVRAM_PCIEDEV_LEN 9 /* pcie/1/4/ */ --+#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, --@@ -297,6 +297,8 @@ fail: -- static void brcmf_fw_strip_multi_v2(struct nvram_parser *nvp, u16 domain_nr, -- u16 bus_nr) -- { --+ char prefix[BRCMF_FW_NVRAM_PCIEDEV_LEN]; --+ size_t len; -- u32 i, j; -- u8 *nvram; -- --@@ -308,14 +310,13 @@ static void brcmf_fw_strip_multi_v2(stru -- * Valid entries are of type pcie/X/Y/ where X = domain_nr and -- * Y = bus_nr. -- */ --+ snprintf(prefix, sizeof(prefix), "pcie/%d/%d/", domain_nr, bus_nr); --+ len = strlen(prefix); -- i = 0; -- j = 0; --- while (i < nvp->nvram_len - BRCMF_FW_NVRAM_PCIEDEV_LEN) { --- if ((strncmp(&nvp->nvram[i], "pcie/", 5) == 0) && --- (nvp->nvram[i + 6] == '/') && (nvp->nvram[i + 8] == '/') && --- ((nvp->nvram[i + 5] - '0') == domain_nr) && --- ((nvp->nvram[i + 7] - '0') == bus_nr)) { --- i += BRCMF_FW_NVRAM_PCIEDEV_LEN; --+ while (i < nvp->nvram_len - len) { --+ if (strncmp(&nvp->nvram[i], prefix, len) == 0) { --+ i += len; -- 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 -deleted file mode 100644 -index 0e65114..0000000 ---- a/package/kernel/mac80211/patches/376-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?= --Date: Wed, 20 May 2015 11:01:08 +0200 --Subject: [PATCH] brcmfmac: simplify check finding NVRAM v1 device path --MIME-Version: 1.0 --Content-Type: text/plain; charset=UTF-8 --Content-Transfer-Encoding: 8bit -- --With a simple use of snprintf and small buffer we can compare NVRAM --entry value with a full string. This way we avoid checking random chars --at magic offsets. --Tested on BCM43602 with NVRAM hacked to use v1 format. -- --Signed-off-by: Rafał Miłecki --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/firmware.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/firmware.c --@@ -222,6 +222,10 @@ static int brcmf_init_nvram_parser(struc -- static void brcmf_fw_strip_multi_v1(struct nvram_parser *nvp, u16 domain_nr, -- u16 bus_nr) -- { --+ /* Device path with a leading '=' key-value separator */ --+ char pcie_path[] = "=pcie/?/?"; --+ size_t pcie_len; --+ -- u32 i, j; -- bool found; -- u8 *nvram; --@@ -238,6 +242,9 @@ static void brcmf_fw_strip_multi_v1(stru -- /* First search for the devpathX and see if it is the configuration -- * for domain_nr/bus_nr. Search complete nvp -- */ --+ snprintf(pcie_path, sizeof(pcie_path), "=pcie/%d/%d", domain_nr, --+ bus_nr); --+ pcie_len = strlen(pcie_path); -- found = false; -- i = 0; -- while (i < nvp->nvram_len - BRCMF_FW_NVRAM_DEVPATH_LEN) { --@@ -245,13 +252,10 @@ static void brcmf_fw_strip_multi_v1(stru -- * Y = domain_nr, Z = bus_nr, X = virtual ID -- */ -- if ((strncmp(&nvp->nvram[i], "devpath", 7) == 0) && --- (strncmp(&nvp->nvram[i + 8], "=pcie/", 6) == 0)) { --- if (((nvp->nvram[i + 14] - '0') == domain_nr) && --- ((nvp->nvram[i + 16] - '0') == bus_nr)) { --- id = nvp->nvram[i + 7] - '0'; --- found = true; --- break; --- } --+ (strncmp(&nvp->nvram[i + 8], pcie_path, pcie_len) == 0)) { --+ id = nvp->nvram[i + 7] - '0'; --+ found = true; --+ break; -- } -- 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 -deleted file mode 100644 -index dc174e5..0000000 ---- a/package/kernel/mac80211/patches/377-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?= --Date: Wed, 20 May 2015 13:59:54 +0200 --Subject: [PATCH] brcmfmac: treat \0 as end of comment when parsing NVRAM --MIME-Version: 1.0 --Content-Type: text/plain; charset=UTF-8 --Content-Transfer-Encoding: 8bit -- --This fixes brcmfmac dealing with NVRAM coming from platform e.g. from a --flash MTD partition. In such cases entries are separated by \0 instead --of \n which caused ignoring whole content after the first "comment". --While platform NVRAM doesn't usually contain comments, we switch to --COMMENT state after e.g. finding an unexpected char in key name. -- --Signed-off-by: Rafał Miłecki --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/firmware.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/firmware.c --@@ -162,17 +162,20 @@ brcmf_nvram_handle_value(struct nvram_pa -- static enum nvram_parser_state -- brcmf_nvram_handle_comment(struct nvram_parser *nvp) -- { --- char *eol, *sol; --+ char *eoc, *sol; -- -- sol = (char *)&nvp->fwnv->data[nvp->pos]; --- eol = strchr(sol, '\n'); --- if (eol == NULL) --- return END; --+ eoc = strchr(sol, '\n'); --+ if (!eoc) { --+ eoc = strchr(sol, '\0'); --+ if (!eoc) --+ return END; --+ } -- -- /* eat all moving to next line */ -- nvp->line++; -- nvp->column = 1; --- nvp->pos += (eol - sol) + 1; --+ nvp->pos += (eoc - sol) + 1; -- 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 -deleted file mode 100644 -index 5700142..0000000 ---- a/package/kernel/mac80211/patches/378-brcmfmac-allow-NVRAM-values-to-contain-spaces.patch -+++ /dev/null -@@ -1,50 +0,0 @@ --From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= --Date: Sat, 23 May 2015 09:15:33 +0200 --Subject: [PATCH] brcmfmac: allow NVRAM values to contain spaces --MIME-Version: 1.0 --Content-Type: text/plain; charset=UTF-8 --Content-Transfer-Encoding: 8bit -- --Platform NVRAMs often contain values with spaces. Even if right now most --firmware-supported entries are simple values, we shouldn't reject these --with spaces. It was semi-confirmed by Broadcom in the early patch adding --support for platform NVRAMs. -- --Signed-off-by: Rafał Miłecki --Acked-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 --@@ -66,6 +66,12 @@ struct nvram_parser { -- bool multi_dev_v2; -- }; -- --+/** --+ * is_nvram_char() - check if char is a valid one for NVRAM entry --+ * --+ * It accepts all printable ASCII chars except for '#' which opens a comment. --+ * Please note that ' ' (space) while accepted is not a valid key name char. --+ */ -- static bool is_nvram_char(char c) -- { -- /* comment marker excluded */ --@@ -73,7 +79,7 @@ static bool is_nvram_char(char c) -- return false; -- -- /* key and value may have any other readable character */ --- return (c > 0x20 && c < 0x7f); --+ return (c >= 0x20 && c < 0x7f); -- } -- -- static bool is_whitespace(char c) --@@ -120,7 +126,7 @@ static enum nvram_parser_state brcmf_nvr -- nvp->multi_dev_v1 = true; -- if (strncmp(&nvp->fwnv->data[nvp->entry], "pcie/", 5) == 0) -- nvp->multi_dev_v2 = true; --- } else if (!is_nvram_char(c)) { --+ } else if (!is_nvram_char(c) || c == ' ') { -- 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 -deleted file mode 100644 -index 814b0d7..0000000 ---- a/package/kernel/mac80211/patches/379-ath9k-fix-DMA-stop-sequence-for-AR9003.patch -+++ /dev/null -@@ -1,33 +0,0 @@ --From: Felix Fietkau --Date: Tue, 2 Jun 2015 10:35:46 +0200 --Subject: [PATCH] ath9k: fix DMA stop sequence for AR9003+ -- --AR93xx and newer needs to stop rx before tx to avoid getting the DMA --engine or MAC into a stuck state. --This should reduce/fix the occurence of "Failed to stop Tx DMA" logspam. -- --Cc: stable@vger.kernel.org --Signed-off-by: Felix Fietkau ----- -- ----- a/drivers/net/wireless/ath/ath9k/main.c --+++ b/drivers/net/wireless/ath/ath9k/main.c --@@ -216,11 +216,13 @@ static bool ath_prepare_reset(struct ath -- ath_stop_ani(sc); -- ath9k_hw_disable_interrupts(ah); -- --- if (!ath_drain_all_txq(sc)) --- ret = false; --- --- if (!ath_stoprecv(sc)) --- ret = false; --+ if (AR_SREV_9300_20_OR_LATER(ah)) { --+ ret &= ath_stoprecv(sc); --+ ret &= ath_drain_all_txq(sc); --+ } else { --+ ret &= ath_drain_all_txq(sc); --+ ret &= ath_stoprecv(sc); --+ } -- -- 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 -deleted file mode 100644 -index 7bbd57e..0000000 ---- a/package/kernel/mac80211/patches/380-brcmfmac-support-NVRAMs-containing-pci-devpaths-inst.patch -+++ /dev/null -@@ -1,56 +0,0 @@ --From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= --Date: Thu, 28 May 2015 14:19:21 +0200 --Subject: [PATCH] brcmfmac: support NVRAMs containing pci devpaths (instead of -- pcie) --MIME-Version: 1.0 --Content-Type: text/plain; charset=UTF-8 --Content-Transfer-Encoding: 8bit -- --Recently Broadcom added support for NVRAMs with entries for multiple --PCIe devices. One of the supported formats is based on prefixes defined --like: devpath0=pcie/1/4/ and entries like 0:foo=bar 0:baz=qux etc. -- --Unfortunately there are also a bit older devices using different way of --defining prefixes, e.g. SmartRG SR400ac (2 x BCM43602) with entries: --devpath0=pci/1/1/ --devpath1=pci/2/1 --Broadcom stated this old format will never be used/supported by brcmfmac --but given the simplicity of this patch I'll insist on supporting it. -- --Signed-off-by: Rafał Miłecki --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/firmware.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/firmware.c --@@ -232,6 +232,8 @@ static void brcmf_fw_strip_multi_v1(stru -- u16 bus_nr) -- { -- /* Device path with a leading '=' key-value separator */ --+ char pci_path[] = "=pci/?/?"; --+ size_t pci_len; -- char pcie_path[] = "=pcie/?/?"; -- size_t pcie_len; -- --@@ -251,6 +253,9 @@ static void brcmf_fw_strip_multi_v1(stru -- /* First search for the devpathX and see if it is the configuration -- * for domain_nr/bus_nr. Search complete nvp -- */ --+ snprintf(pci_path, sizeof(pci_path), "=pci/%d/%d", domain_nr, --+ bus_nr); --+ pci_len = strlen(pci_path); -- snprintf(pcie_path, sizeof(pcie_path), "=pcie/%d/%d", domain_nr, -- bus_nr); -- pcie_len = strlen(pcie_path); --@@ -260,8 +265,9 @@ static void brcmf_fw_strip_multi_v1(stru -- /* Format: devpathX=pcie/Y/Z/ -- * Y = domain_nr, Z = bus_nr, X = virtual ID -- */ --- if ((strncmp(&nvp->nvram[i], "devpath", 7) == 0) && --- (strncmp(&nvp->nvram[i + 8], pcie_path, pcie_len) == 0)) { --+ if (strncmp(&nvp->nvram[i], "devpath", 7) == 0 && --+ (!strncmp(&nvp->nvram[i + 8], pci_path, pci_len) || --+ !strncmp(&nvp->nvram[i + 8], pcie_path, pcie_len))) { -- 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 -deleted file mode 100644 -index 1eff6ed..0000000 ---- a/package/kernel/mac80211/patches/381-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?= --Date: Sun, 31 May 2015 02:52:26 +0200 --Subject: [PATCH] brcmfmac: set wiphy perm_addr to hardware MAC address --MIME-Version: 1.0 --Content-Type: text/plain; charset=UTF-8 --Content-Transfer-Encoding: 8bit -- --This allows e.g. user space to use /sys/class/ieee80211/*/macaddress -- --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 --@@ -6070,6 +6070,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802 -- brcmf_err("Could not allocate wiphy device\n"); -- return NULL; -- } --+ memcpy(wiphy->perm_addr, drvr->mac, ETH_ALEN); -- 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 -deleted file mode 100644 -index c6e83dd..0000000 ---- a/package/kernel/mac80211/patches/382-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?= --Date: Thu, 4 Jun 2015 22:11:07 +0200 --Subject: [PATCH] brcmfmac: use direct data pointer in NVRAM parser struct --MIME-Version: 1.0 --Content-Type: text/plain; charset=UTF-8 --Content-Transfer-Encoding: 8bit -- --As we plan to add support for platform NVRAM we should store direct --data pointer without the extra struct firmware layer. This will allow --us to support other sources with the only requirement being u8 buffer. -- --Signed-off-by: Rafał Miłecki --Acked-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 --@@ -43,7 +43,7 @@ enum nvram_parser_state { -- * struct nvram_parser - internal info for parser. -- * -- * @state: current parser state. --- * @fwnv: input buffer being parsed. --+ * @data: input buffer being parsed. -- * @nvram: output buffer with parse result. -- * @nvram_len: lenght of parse result. -- * @line: current line. --@@ -55,7 +55,7 @@ enum nvram_parser_state { -- */ -- struct nvram_parser { -- enum nvram_parser_state state; --- const struct firmware *fwnv; --+ const u8 *data; -- u8 *nvram; -- u32 nvram_len; -- u32 line; --@@ -91,7 +91,7 @@ static enum nvram_parser_state brcmf_nvr -- { -- char c; -- --- c = nvp->fwnv->data[nvp->pos]; --+ c = nvp->data[nvp->pos]; -- if (c == '\n') -- return COMMENT; -- if (is_whitespace(c)) --@@ -115,16 +115,16 @@ static enum nvram_parser_state brcmf_nvr -- enum nvram_parser_state st = nvp->state; -- char c; -- --- c = nvp->fwnv->data[nvp->pos]; --+ c = nvp->data[nvp->pos]; -- if (c == '=') { -- /* ignore RAW1 by treating as comment */ --- if (strncmp(&nvp->fwnv->data[nvp->entry], "RAW1", 4) == 0) --+ if (strncmp(&nvp->data[nvp->entry], "RAW1", 4) == 0) -- st = COMMENT; -- else -- st = VALUE; --- if (strncmp(&nvp->fwnv->data[nvp->entry], "devpath", 7) == 0) --+ if (strncmp(&nvp->data[nvp->entry], "devpath", 7) == 0) -- nvp->multi_dev_v1 = true; --- if (strncmp(&nvp->fwnv->data[nvp->entry], "pcie/", 5) == 0) --+ if (strncmp(&nvp->data[nvp->entry], "pcie/", 5) == 0) -- nvp->multi_dev_v2 = true; -- } else if (!is_nvram_char(c) || c == ' ') { -- brcmf_dbg(INFO, "warning: ln=%d:col=%d: '=' expected, skip invalid key entry\n", --@@ -145,11 +145,11 @@ brcmf_nvram_handle_value(struct nvram_pa -- char *ekv; -- u32 cplen; -- --- c = nvp->fwnv->data[nvp->pos]; --+ c = nvp->data[nvp->pos]; -- if (!is_nvram_char(c)) { -- /* key,value pair complete */ --- ekv = (u8 *)&nvp->fwnv->data[nvp->pos]; --- skv = (u8 *)&nvp->fwnv->data[nvp->entry]; --+ ekv = (u8 *)&nvp->data[nvp->pos]; --+ skv = (u8 *)&nvp->data[nvp->entry]; -- cplen = ekv - skv; -- if (nvp->nvram_len + cplen + 1 >= BRCMF_FW_MAX_NVRAM_SIZE) -- return END; --@@ -170,7 +170,7 @@ brcmf_nvram_handle_comment(struct nvram_ -- { -- char *eoc, *sol; -- --- sol = (char *)&nvp->fwnv->data[nvp->pos]; --+ sol = (char *)&nvp->data[nvp->pos]; -- eoc = strchr(sol, '\n'); -- if (!eoc) { -- eoc = strchr(sol, '\0'); --@@ -201,17 +201,17 @@ static enum nvram_parser_state -- }; -- -- static int brcmf_init_nvram_parser(struct nvram_parser *nvp, --- const struct firmware *nv) --+ const u8 *data, size_t data_len) -- { -- size_t size; -- -- memset(nvp, 0, sizeof(*nvp)); --- nvp->fwnv = nv; --+ nvp->data = data; -- /* Limit size to MAX_NVRAM_SIZE, some files contain lot of comment */ --- if (nv->size > BRCMF_FW_MAX_NVRAM_SIZE) --+ if (data_len > BRCMF_FW_MAX_NVRAM_SIZE) -- size = BRCMF_FW_MAX_NVRAM_SIZE; -- else --- size = nv->size; --+ size = data_len; -- /* Alloc for extra 0 byte + roundup by 4 + length field */ -- size += 1 + 3 + sizeof(u32); -- nvp->nvram = kzalloc(size, GFP_KERNEL); --@@ -362,18 +362,18 @@ fail: -- * and converts newlines to NULs. Shortens buffer as needed and pads with NULs. -- * End of buffer is completed with token identifying length of buffer. -- */ ---static void *brcmf_fw_nvram_strip(const struct firmware *nv, u32 *new_length, --- u16 domain_nr, u16 bus_nr) --+static void *brcmf_fw_nvram_strip(const u8 *data, size_t data_len, --+ u32 *new_length, u16 domain_nr, u16 bus_nr) -- { -- struct nvram_parser nvp; -- u32 pad; -- u32 token; -- __le32 token_le; -- --- if (brcmf_init_nvram_parser(&nvp, nv) < 0) --+ if (brcmf_init_nvram_parser(&nvp, data, data_len) < 0) -- return NULL; -- --- while (nvp.pos < nv->size) { --+ while (nvp.pos < data_len) { -- nvp.state = nv_parser_states[nvp.state](&nvp); -- if (nvp.state == END) -- break; --@@ -432,7 +432,7 @@ static void brcmf_fw_request_nvram_done( -- goto fail; -- -- if (fw) { --- nvram = brcmf_fw_nvram_strip(fw, &nvram_length, --+ nvram = brcmf_fw_nvram_strip(fw->data, fw->size, &nvram_length, -- 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 -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 -+++ /dev/null -@@ -1,32 +0,0 @@ --From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= --Date: Sat, 6 Jun 2015 22:45:59 +0200 --Subject: [PATCH] b43: fix support for 14e4:4321 PCI dev with BCM4321 chipset --MIME-Version: 1.0 --Content-Type: text/plain; charset=UTF-8 --Content-Transfer-Encoding: 8bit -- --It seems Broadcom released two devices with conflicting device id. There --are for sure 14e4:4321 PCI devices with BCM4321 (N-PHY) chipset, they --can be found in routers, e.g. Netgear WNR834Bv2. However, according to --Broadcom public sources 0x4321 is also used for 5 GHz BCM4306 (G-PHY). --It's unsure if they meant PCI device id, or "virtual" id (from SPROM). --To distinguish these devices lets check PHY type (G vs. N). -- --Signed-off-by: Rafał Miłecki --Cc: # 3.16+ --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/b43/main.c --+++ b/drivers/net/wireless/b43/main.c --@@ -5365,6 +5365,10 @@ static void b43_supported_bands(struct b -- *have_5ghz_phy = true; -- return; -- case 0x4321: /* BCM4306 */ --+ /* There are 14e4:4321 PCI devs with 2.4 GHz BCM4321 (N-PHY) */ --+ if (dev->phy.type != B43_PHYTYPE_G) --+ break; --+ /* fall through */ -- 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 -deleted file mode 100644 -index bddb15a..0000000 ---- a/package/kernel/mac80211/patches/384-ath9k-force-rx_clear-when-disabling-rx.patch -+++ /dev/null -@@ -1,31 +0,0 @@ --From: Felix Fietkau --Date: Sun, 7 Jun 2015 13:53:35 +0200 --Subject: [PATCH] ath9k: force rx_clear when disabling rx -- --This makes stopping Rx more reliable and should reduce the frequency of --Rx related DMA stop warnings -- --Cc: stable@vger.kernel.org --Signed-off-by: Felix Fietkau ----- -- ----- a/drivers/net/wireless/ath/ath9k/mac.c --+++ b/drivers/net/wireless/ath/ath9k/mac.c --@@ -677,13 +677,15 @@ void ath9k_hw_startpcureceive(struct ath -- -- ath9k_ani_reset(ah, is_scanning); -- --- REG_CLR_BIT(ah, AR_DIAG_SW, (AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT)); --+ REG_CLR_BIT(ah, AR_DIAG_SW, --+ AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT | AR_DIAG_FORCE_RX_CLEAR); -- } -- EXPORT_SYMBOL(ath9k_hw_startpcureceive); -- -- void ath9k_hw_abortpcurecv(struct ath_hw *ah) -- { --- REG_SET_BIT(ah, AR_DIAG_SW, AR_DIAG_RX_ABORT | AR_DIAG_RX_DIS); --+ REG_SET_BIT(ah, AR_DIAG_SW, --+ AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT | AR_DIAG_FORCE_RX_CLEAR); -- -- 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 -deleted file mode 100644 -index 74df9f9..0000000 ---- a/package/kernel/mac80211/patches/385-brcmfmac-Update-msgbuf-read-pointer-quicker.patch -+++ /dev/null -@@ -1,109 +0,0 @@ --From: Hante Meuleman --Date: Mon, 8 Jun 2015 14:38:32 +0200 --Subject: [PATCH] brcmfmac: Update msgbuf read pointer quicker. -- --On device to host data using msgbuf the read pointer gets updated --once all data is processed. Updating this pointer more frequently --allows the firmware to add more data quicker. This will result in --slightly higher and more stable throughput on CPU bounded host --processors. -- --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/commonring.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/commonring.c --@@ -223,8 +223,6 @@ void brcmf_commonring_write_cancel(struc -- void *brcmf_commonring_get_read_ptr(struct brcmf_commonring *commonring, -- u16 *n_items) -- { --- void *ret_addr; --- -- if (commonring->cr_update_wptr) -- commonring->cr_update_wptr(commonring->cr_ctx); -- --@@ -235,19 +233,18 @@ void *brcmf_commonring_get_read_ptr(stru -- if (*n_items == 0) -- return NULL; -- --- ret_addr = commonring->buf_addr + --- (commonring->r_ptr * commonring->item_len); --- --- commonring->r_ptr += *n_items; --- if (commonring->r_ptr == commonring->depth) --- commonring->r_ptr = 0; --- --- return ret_addr; --+ return commonring->buf_addr + --+ (commonring->r_ptr * commonring->item_len); -- } -- -- ---int brcmf_commonring_read_complete(struct brcmf_commonring *commonring) --+int brcmf_commonring_read_complete(struct brcmf_commonring *commonring, --+ u16 n_items) -- { --+ commonring->r_ptr += n_items; --+ if (commonring->r_ptr == commonring->depth) --+ commonring->r_ptr = 0; --+ -- if (commonring->cr_write_rptr) -- return commonring->cr_write_rptr(commonring->cr_ctx); -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/commonring.h --+++ b/drivers/net/wireless/brcm80211/brcmfmac/commonring.h --@@ -62,7 +62,8 @@ void brcmf_commonring_write_cancel(struc -- u16 n_items); -- void *brcmf_commonring_get_read_ptr(struct brcmf_commonring *commonring, -- u16 *n_items); ---int brcmf_commonring_read_complete(struct brcmf_commonring *commonring); --+int brcmf_commonring_read_complete(struct brcmf_commonring *commonring, --+ u16 n_items); -- -- #define brcmf_commonring_n_items(commonring) (commonring->depth) -- #define brcmf_commonring_len_item(commonring) (commonring->item_len) ----- a/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c --@@ -75,6 +75,8 @@ -- -- #define BRCMF_MSGBUF_DELAY_TXWORKER_THRS 96 -- #define BRCMF_MSGBUF_TRICKLE_TXWORKER_THRS 32 --+#define BRCMF_MSGBUF_UPDATE_RX_PTR_THRS 48 --+ -- -- struct msgbuf_common_hdr { -- u8 msgtype; --@@ -1257,19 +1259,27 @@ static void brcmf_msgbuf_process_rx(stru -- { -- void *buf; -- u16 count; --+ u16 processed; -- -- again: -- buf = brcmf_commonring_get_read_ptr(commonring, &count); -- if (buf == NULL) -- return; -- --+ processed = 0; -- while (count) { -- brcmf_msgbuf_process_msgtype(msgbuf, -- buf + msgbuf->rx_dataoffset); -- buf += brcmf_commonring_len_item(commonring); --+ processed++; --+ if (processed == BRCMF_MSGBUF_UPDATE_RX_PTR_THRS) { --+ brcmf_commonring_read_complete(commonring, processed); --+ processed = 0; --+ } -- count--; -- } --- brcmf_commonring_read_complete(commonring); --+ if (processed) --+ brcmf_commonring_read_complete(commonring, processed); -- -- 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 -deleted file mode 100644 -index 9e5b486..0000000 ---- a/package/kernel/mac80211/patches/386-brcmfmac-remove-chipinfo-debugfs-entry.patch -+++ /dev/null -@@ -1,39 +0,0 @@ --From: Arend van Spriel --Date: Mon, 8 Jun 2015 14:38:33 +0200 --Subject: [PATCH] brcmfmac: remove chipinfo debugfs entry -- --The information provided by chipinfo is also provided by the --revinfo debugfs entry. Removing it from debugfs. -- --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.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/debug.c --@@ -41,15 +41,6 @@ void brcmf_debugfs_exit(void) -- root_folder = NULL; -- } -- ---static int brcmf_debugfs_chipinfo_read(struct seq_file *seq, void *data) ---{ --- struct brcmf_bus *bus = dev_get_drvdata(seq->private); --- --- seq_printf(seq, "chip: %x(%u) rev %u\n", --- bus->chip, bus->chip, bus->chiprev); --- return 0; ---} --- -- int brcmf_debugfs_attach(struct brcmf_pub *drvr) -- { -- struct device *dev = drvr->bus_if->dev; --@@ -58,7 +49,6 @@ int brcmf_debugfs_attach(struct brcmf_pu -- return -ENODEV; -- -- drvr->dbgfs_dir = debugfs_create_dir(dev_name(dev), root_folder); --- brcmf_debugfs_add_entry(drvr, "chipinfo", brcmf_debugfs_chipinfo_read); -- -- 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 -deleted file mode 100644 -index c38b2cd..0000000 ---- a/package/kernel/mac80211/patches/387-brcmfmac-remove-watchdog-reset-from-brcmf_pcie_busco.patch -+++ /dev/null -@@ -1,53 +0,0 @@ --From: Arend van Spriel --Date: Mon, 8 Jun 2015 14:38:34 +0200 --Subject: [PATCH] brcmfmac: remove watchdog reset from -- brcmf_pcie_buscoreprep() -- --The watchdog reset as done in brcmf_pcie_buscoreprep() is not --sufficient. It needs to modify PCIe core registers as well --which is properly done by brcmf_pcie_reset_device() after the --chip recognition is done. So the faulty watchdog reset can be --removed as it was causing driver reload to fail and hang the --system requiring a power-cycle. Instead the call to to the --brcmf_pcie_reset_device() function is done twice in the unload. -- --Reviewed-by: Hante Meuleman --Reviewed-by: Daniel (Deognyoun) Kim --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/pcie.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --@@ -1629,20 +1629,7 @@ static void brcmf_pcie_buscore_write32(v -- -- static int brcmf_pcie_buscoreprep(void *ctx) -- { --- struct brcmf_pciedev_info *devinfo = (struct brcmf_pciedev_info *)ctx; --- int err; --- --- err = brcmf_pcie_get_resource(devinfo); --- if (err == 0) { --- /* Set CC watchdog to reset all the cores on the chip to bring --- * back dongle to a sane state. --- */ --- brcmf_pcie_buscore_write32(ctx, CORE_CC_REG(SI_ENUM_BASE, --- watchdog), 4); --- msleep(100); --- } --- --- return err; --+ return brcmf_pcie_get_resource(ctx); -- } -- -- --@@ -1824,6 +1811,7 @@ brcmf_pcie_remove(struct pci_dev *pdev) -- brcmf_pcie_intr_disable(devinfo); -- -- brcmf_detach(&pdev->dev); --+ brcmf_pcie_reset_device(devinfo); -- -- 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 -deleted file mode 100644 -index 756fbb2..0000000 ---- a/package/kernel/mac80211/patches/388-brcmfmac-use-debugfs_create_devm_seqfile-helper-func.patch -+++ /dev/null -@@ -1,69 +0,0 @@ --From: Arend van Spriel --Date: Mon, 8 Jun 2015 14:38:35 +0200 --Subject: [PATCH] brcmfmac: use debugfs_create_devm_seqfile() helper -- function -- --Some time ago the function debugfs_create_devm_seqfile() was --introduced in debugfs. The caller simply needs to provide a --device pointer and read function. The function brcmf_debugfs_add_entry() --is now simply a wrapper only doing the work for CONFIG_BRCMDBG. -- --Reviewed-by: Hante Meuleman --Reviewed-by: Franky (Zhenhui) Lin --Reviewed-by: Daniel (Deognyoun) Kim --Reviewed-by: Pieter-Paul Giesberts --Signed-off-by: Arend van Spriel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/debug.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/debug.c --@@ -64,44 +64,12 @@ struct dentry *brcmf_debugfs_get_devdir( -- return drvr->dbgfs_dir; -- } -- ---struct brcmf_debugfs_entry { --- int (*read)(struct seq_file *seq, void *data); --- struct brcmf_pub *drvr; ---}; --- ---static int brcmf_debugfs_entry_open(struct inode *inode, struct file *f) ---{ --- struct brcmf_debugfs_entry *entry = inode->i_private; --- --- return single_open(f, entry->read, entry->drvr->bus_if->dev); ---} --- ---static const struct file_operations brcmf_debugfs_def_ops = { --- .owner = THIS_MODULE, --- .open = brcmf_debugfs_entry_open, --- .release = single_release, --- .read = seq_read, --- .llseek = seq_lseek ---}; --- -- int brcmf_debugfs_add_entry(struct brcmf_pub *drvr, const char *fn, -- int (*read_fn)(struct seq_file *seq, void *data)) -- { --- struct dentry *dentry = drvr->dbgfs_dir; --- struct brcmf_debugfs_entry *entry; --- --- if (IS_ERR_OR_NULL(dentry)) --- return -ENOENT; --- --- entry = devm_kzalloc(drvr->bus_if->dev, sizeof(*entry), GFP_KERNEL); --- if (!entry) --- return -ENOMEM; --- --- entry->read = read_fn; --- entry->drvr = drvr; --- --- dentry = debugfs_create_file(fn, S_IRUGO, dentry, entry, --- &brcmf_debugfs_def_ops); --+ struct dentry *e; -- --- return PTR_ERR_OR_ZERO(dentry); --+ e = debugfs_create_devm_seqfile(drvr->bus_if->dev, fn, --+ 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 -deleted file mode 100644 -index ff24a4a..0000000 ---- a/package/kernel/mac80211/patches/389-0001-brcmfmac-Check-if-firmware-supports-p2p.patch -+++ /dev/null -@@ -1,42 +0,0 @@ --From: Pontus Fuchs --Date: Thu, 11 Jun 2015 00:12:17 +0200 --Subject: [PATCH] brcmfmac: Check if firmware supports p2p -- --Add a feature flag to reflect the firmware's p2p capability. -- --Reviewed-by: Pieter-Paul Giesberts --Reviewed-by: Hante Meuleman --Reviewed-by: Arend Van Spriel --Signed-off-by: Pontus Fuchs --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 --@@ -129,6 +129,7 @@ void brcmf_feat_attach(struct brcmf_pub -- brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_WOWL, "wowl"); -- 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"); -- -- /* set chip related quirks */ -- switch (drvr->bus_if->chip) { ----- a/drivers/net/wireless/brcm80211/brcmfmac/feature.h --+++ b/drivers/net/wireless/brcm80211/brcmfmac/feature.h --@@ -23,12 +23,14 @@ -- * MCHAN: multi-channel for concurrent P2P. -- * PNO: preferred network offload. -- * WOWL: Wake-On-WLAN. --+ * P2P: peer-to-peer -- */ -- #define BRCMF_FEAT_LIST \ -- BRCMF_FEAT_DEF(MBSS) \ -- BRCMF_FEAT_DEF(MCHAN) \ -- BRCMF_FEAT_DEF(PNO) \ --- BRCMF_FEAT_DEF(WOWL) --+ BRCMF_FEAT_DEF(WOWL) \ --+ BRCMF_FEAT_DEF(P2P) -- /* -- * 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 -deleted file mode 100644 -index 3876ba0..0000000 ---- a/package/kernel/mac80211/patches/389-0002-brcmfmac-Build-wiphy-mode-and-interface-combinations.patch -+++ /dev/null -@@ -1,198 +0,0 @@ --From: Pontus Fuchs --Date: Thu, 11 Jun 2015 00:12:18 +0200 --Subject: [PATCH] brcmfmac: Build wiphy mode and interface combinations -- dynamically -- --Switch from using semi hard coded interface combinations. This makes --it easier to announce what the firmware actually supports. This fixes --the case where brcmfmac announces p2p but the firmware doesn't --support it. -- --Reviewed-by: Pieter-Paul Giesberts --Reviewed-by: Hante Meuleman --Reviewed-by: Arend Van Spriel --Signed-off-by: Pontus Fuchs --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 --@@ -52,8 +52,6 @@ -- #define BRCMF_PNO_SCAN_COMPLETE 1 -- #define BRCMF_PNO_SCAN_INCOMPLETE 0 -- ---#define BRCMF_IFACE_MAX_CNT 3 --- -- #define WPA_OUI "\x00\x50\xF2" /* WPA OUI */ -- #define WPA_OUI_TYPE 1 -- #define RSN_OUI "\x00\x0F\xAC" /* RSN OUI */ --@@ -5639,53 +5637,6 @@ static int brcmf_setup_wiphybands(struct -- return 0; -- } -- ---static const struct ieee80211_iface_limit brcmf_iface_limits_mbss[] = { --- { --- .max = 1, --- .types = BIT(NL80211_IFTYPE_STATION) | --- BIT(NL80211_IFTYPE_ADHOC) --- }, --- { --- .max = 4, --- .types = BIT(NL80211_IFTYPE_AP) --- }, --- { --- .max = 1, --- .types = BIT(NL80211_IFTYPE_P2P_CLIENT) | --- BIT(NL80211_IFTYPE_P2P_GO) --- }, --- { --- .max = 1, --- .types = BIT(NL80211_IFTYPE_P2P_DEVICE) --- } ---}; --- ---static const struct ieee80211_iface_limit brcmf_iface_limits_sbss[] = { --- { --- .max = 2, --- .types = BIT(NL80211_IFTYPE_STATION) | --- BIT(NL80211_IFTYPE_ADHOC) | --- BIT(NL80211_IFTYPE_AP) --- }, --- { --- .max = 1, --- .types = BIT(NL80211_IFTYPE_P2P_CLIENT) | --- BIT(NL80211_IFTYPE_P2P_GO) --- }, --- { --- .max = 1, --- .types = BIT(NL80211_IFTYPE_P2P_DEVICE) --- } ---}; ---static struct ieee80211_iface_combination brcmf_iface_combos[] = { --- { --- .max_interfaces = BRCMF_IFACE_MAX_CNT, --- .num_different_channels = 1, --- .n_limits = ARRAY_SIZE(brcmf_iface_limits_sbss), --- .limits = brcmf_iface_limits_sbss, --- } ---}; --- -- static const struct ieee80211_txrx_stypes -- brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = { -- [NL80211_IFTYPE_STATION] = { --@@ -5715,6 +5666,67 @@ brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = -- } -- }; -- --+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; --+ --+ combo = kzalloc(sizeof(*combo), GFP_KERNEL); --+ if (!combo) --+ goto err; --+ --+ limits = kzalloc(sizeof(*limits) * 4, GFP_KERNEL); --+ if (!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)) { --+ 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; --+ --+ wiphy->iface_combinations = combo; --+ wiphy->n_iface_combinations = 1; --+ return 0; --+ --+err: --+ kfree(limits); --+ kfree(combo); --+ return -ENOMEM; --+} --+ -- static void brcmf_wiphy_pno_params(struct wiphy *wiphy) -- { -- /* scheduled scan settings */ --@@ -5745,7 +5757,6 @@ static void brcmf_wiphy_wowl_params(stru -- static int brcmf_setup_wiphy(struct wiphy *wiphy, struct brcmf_if *ifp) -- { -- struct ieee80211_supported_band *band; --- struct ieee80211_iface_combination ifc_combo; -- __le32 bandlist[3]; -- u32 n_bands; -- int err, i; --@@ -5753,24 +5764,11 @@ static int brcmf_setup_wiphy(struct wiph -- wiphy->max_scan_ssids = WL_NUM_SCAN_MAX; -- wiphy->max_scan_ie_len = BRCMF_SCAN_IE_LEN_MAX; -- wiphy->max_num_pmkids = WL_NUM_PMKIDS_MAX; --- wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | --- BIT(NL80211_IFTYPE_ADHOC) | --- BIT(NL80211_IFTYPE_AP) | --- BIT(NL80211_IFTYPE_P2P_CLIENT) | --- BIT(NL80211_IFTYPE_P2P_GO) | --- BIT(NL80211_IFTYPE_P2P_DEVICE); --- /* need VSDB firmware feature for concurrent channels */ --- ifc_combo = brcmf_iface_combos[0]; --- if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MCHAN)) --- ifc_combo.num_different_channels = 2; --- if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS)) { --- ifc_combo.n_limits = ARRAY_SIZE(brcmf_iface_limits_mbss), --- ifc_combo.limits = brcmf_iface_limits_mbss; --- } --- wiphy->iface_combinations = kmemdup(&ifc_combo, --- sizeof(ifc_combo), --- GFP_KERNEL); --- wiphy->n_iface_combinations = ARRAY_SIZE(brcmf_iface_combos); --+ --+ err = brcmf_setup_ifmodes(wiphy, ifp); --+ if (err) --+ return err; --+ -- wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; -- wiphy->cipher_suites = __wl_cipher_suites; -- wiphy->n_cipher_suites = ARRAY_SIZE(__wl_cipher_suites); --@@ -6035,6 +6033,8 @@ static void brcmf_free_wiphy(struct wiph -- if (!wiphy) -- return; -- --+ if (wiphy->iface_combinations) --+ kfree(wiphy->iface_combinations->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/389-0003-brcmfmac-rework-.get_station-callback.patch b/package/kernel/mac80211/patches/389-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 -+++ /dev/null -@@ -1,326 +0,0 @@ --From: Arend van Spriel --Date: Thu, 11 Jun 2015 00:12:19 +0200 --Subject: [PATCH] brcmfmac: rework .get_station() callback -- --The .get_station() cfg80211 callback is used in several scenarios. In --managed mode it can obtain information about the access-point and its --BSS parameters. In managed mode it can also obtain information about --TDLS peers. In AP mode it can obtain information about connected --clients. -- --Reviewed-by: Hante Meuleman --Reviewed-by: Daniel (Deognyoun) Kim --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 --@@ -2395,27 +2395,80 @@ brcmf_cfg80211_reconfigure_wep(struct br -- brcmf_err("set wsec error (%d)\n", err); -- } -- --+static void brcmf_convert_sta_flags(u32 fw_sta_flags, struct station_info *si) --+{ --+ struct nl80211_sta_flag_update *sfu; --+ --+ brcmf_dbg(TRACE, "flags %08x\n", fw_sta_flags); --+ si->filled |= BIT(NL80211_STA_INFO_STA_FLAGS); --+ sfu = &si->sta_flags; --+ sfu->mask = BIT(NL80211_STA_FLAG_WME) | --+ BIT(NL80211_STA_FLAG_AUTHENTICATED) | --+ BIT(NL80211_STA_FLAG_ASSOCIATED) | --+ BIT(NL80211_STA_FLAG_AUTHORIZED); --+ if (fw_sta_flags & BRCMF_STA_WME) --+ sfu->set |= BIT(NL80211_STA_FLAG_WME); --+ if (fw_sta_flags & BRCMF_STA_AUTHE) --+ sfu->set |= BIT(NL80211_STA_FLAG_AUTHENTICATED); --+ if (fw_sta_flags & BRCMF_STA_ASSOC) --+ sfu->set |= BIT(NL80211_STA_FLAG_ASSOCIATED); --+ if (fw_sta_flags & BRCMF_STA_AUTHO) --+ sfu->set |= BIT(NL80211_STA_FLAG_AUTHORIZED); --+} --+ --+static void brcmf_fill_bss_param(struct brcmf_if *ifp, struct station_info *si) --+{ --+ struct { --+ __le32 len; --+ struct brcmf_bss_info_le bss_le; --+ } *buf; --+ u16 capability; --+ int err; --+ --+ buf = kzalloc(WL_BSS_INFO_MAX, GFP_KERNEL); --+ if (!buf) --+ return; --+ --+ buf->len = cpu_to_le32(WL_BSS_INFO_MAX); --+ err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BSS_INFO, buf, --+ WL_BSS_INFO_MAX); --+ if (err) { --+ brcmf_err("Failed to get bss info (%d)\n", err); --+ return; --+ } --+ si->filled |= BIT(NL80211_STA_INFO_BSS_PARAM); --+ si->bss_param.beacon_interval = le16_to_cpu(buf->bss_le.beacon_period); --+ si->bss_param.dtim_period = buf->bss_le.dtim_period; --+ capability = le16_to_cpu(buf->bss_le.capability); --+ if (capability & IEEE80211_HT_STBC_PARAM_DUAL_CTS_PROT) --+ si->bss_param.flags |= BSS_PARAM_FLAGS_CTS_PROT; --+ if (capability & WLAN_CAPABILITY_SHORT_PREAMBLE) --+ si->bss_param.flags |= BSS_PARAM_FLAGS_SHORT_PREAMBLE; --+ if (capability & WLAN_CAPABILITY_SHORT_SLOT_TIME) --+ si->bss_param.flags |= BSS_PARAM_FLAGS_SHORT_SLOT_TIME; --+} --+ -- static s32 -- brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev, -- const u8 *mac, struct station_info *sinfo) -- { -- struct brcmf_if *ifp = netdev_priv(ndev); --- struct brcmf_cfg80211_profile *profile = &ifp->vif->profile; --- struct brcmf_scb_val_le scb_val; --- int rssi; --- s32 rate; -- s32 err = 0; --- u8 *bssid = profile->bssid; -- struct brcmf_sta_info_le sta_info_le; --- u32 beacon_period; --- u32 dtim_period; --+ u32 sta_flags; --+ u32 is_tdls_peer; -- -- brcmf_dbg(TRACE, "Enter, MAC %pM\n", mac); -- if (!check_vif_up(ifp->vif)) -- return -EIO; -- --- if (brcmf_is_apmode(ifp->vif)) { --- memcpy(&sta_info_le, mac, ETH_ALEN); --+ memset(&sta_info_le, 0, sizeof(sta_info_le)); --+ memcpy(&sta_info_le, mac, ETH_ALEN); --+ err = brcmf_fil_iovar_data_get(ifp, "tdls_sta_info", --+ &sta_info_le, --+ sizeof(sta_info_le)); --+ is_tdls_peer = !err; --+ if (err) { -- err = brcmf_fil_iovar_data_get(ifp, "sta_info", -- &sta_info_le, -- sizeof(sta_info_le)); --@@ -2423,73 +2476,48 @@ brcmf_cfg80211_get_station(struct wiphy -- brcmf_err("GET STA INFO failed, %d\n", err); -- goto done; -- } --- sinfo->filled = BIT(NL80211_STA_INFO_INACTIVE_TIME); --- sinfo->inactive_time = le32_to_cpu(sta_info_le.idle) * 1000; --- if (le32_to_cpu(sta_info_le.flags) & BRCMF_STA_ASSOC) { --- sinfo->filled |= BIT(NL80211_STA_INFO_CONNECTED_TIME); --- sinfo->connected_time = le32_to_cpu(sta_info_le.in); --- } --- brcmf_dbg(TRACE, "STA idle time : %d ms, connected time :%d sec\n", --- sinfo->inactive_time, sinfo->connected_time); --- } else if (ifp->vif->wdev.iftype == NL80211_IFTYPE_STATION) { --- if (memcmp(mac, bssid, ETH_ALEN)) { --- brcmf_err("Wrong Mac address cfg_mac-%pM wl_bssid-%pM\n", --- mac, bssid); --- err = -ENOENT; --- goto done; --- } --- /* Report the current tx rate */ --- err = brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_RATE, &rate); --- if (err) { --- brcmf_err("Could not get rate (%d)\n", err); --- goto done; --- } else { --+ } --+ brcmf_dbg(TRACE, "version %d\n", le16_to_cpu(sta_info_le.ver)); --+ sinfo->filled = BIT(NL80211_STA_INFO_INACTIVE_TIME); --+ sinfo->inactive_time = le32_to_cpu(sta_info_le.idle) * 1000; --+ sta_flags = le32_to_cpu(sta_info_le.flags); --+ brcmf_convert_sta_flags(sta_flags, sinfo); --+ sinfo->sta_flags.mask |= BIT(NL80211_STA_FLAG_TDLS_PEER); --+ if (is_tdls_peer) --+ sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_TDLS_PEER); --+ else --+ sinfo->sta_flags.set &= ~BIT(NL80211_STA_FLAG_TDLS_PEER); --+ if (sta_flags & BRCMF_STA_ASSOC) { --+ sinfo->filled |= BIT(NL80211_STA_INFO_CONNECTED_TIME); --+ sinfo->connected_time = le32_to_cpu(sta_info_le.in); --+ brcmf_fill_bss_param(ifp, sinfo); --+ } --+ if (sta_flags & BRCMF_STA_SCBSTATS) { --+ sinfo->filled |= BIT(NL80211_STA_INFO_TX_FAILED); --+ sinfo->tx_failed = le32_to_cpu(sta_info_le.tx_failures); --+ sinfo->filled |= BIT(NL80211_STA_INFO_TX_PACKETS); --+ sinfo->tx_packets = le32_to_cpu(sta_info_le.tx_pkts); --+ sinfo->tx_packets += le32_to_cpu(sta_info_le.tx_mcast_pkts); --+ sinfo->filled |= BIT(NL80211_STA_INFO_RX_PACKETS); --+ sinfo->rx_packets = le32_to_cpu(sta_info_le.rx_ucast_pkts); --+ 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 = rate * 5; --- brcmf_dbg(CONN, "Rate %d Mbps\n", rate / 2); --+ sinfo->txrate.legacy = le32_to_cpu(sta_info_le.tx_rate); --+ sinfo->txrate.legacy /= 100; -- } --- --- if (test_bit(BRCMF_VIF_STATUS_CONNECTED, --- &ifp->vif->sme_state)) { --- memset(&scb_val, 0, sizeof(scb_val)); --- err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_RSSI, --- &scb_val, sizeof(scb_val)); --- if (err) { --- brcmf_err("Could not get rssi (%d)\n", err); --- goto done; --- } else { --- rssi = le32_to_cpu(scb_val.val); --- sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL); --- sinfo->signal = rssi; --- brcmf_dbg(CONN, "RSSI %d dBm\n", rssi); --- } --- err = brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_BCNPRD, --- &beacon_period); --- if (err) { --- brcmf_err("Could not get beacon period (%d)\n", --- err); --- goto done; --- } else { --- sinfo->bss_param.beacon_interval = --- beacon_period; --- brcmf_dbg(CONN, "Beacon peroid %d\n", --- beacon_period); --- } --- err = brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_DTIMPRD, --- &dtim_period); --- if (err) { --- brcmf_err("Could not get DTIM period (%d)\n", --- err); --- goto done; --- } else { --- sinfo->bss_param.dtim_period = dtim_period; --- brcmf_dbg(CONN, "DTIM peroid %d\n", --- dtim_period); --- } --- sinfo->filled |= BIT(NL80211_STA_INFO_BSS_PARAM); --+ 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; --+ } --+ if (le16_to_cpu(sta_info_le.ver) >= 4) { --+ sinfo->filled |= BIT(NL80211_STA_INFO_TX_BYTES); --+ sinfo->tx_bytes = le64_to_cpu(sta_info_le.tx_tot_bytes); --+ sinfo->filled |= BIT(NL80211_STA_INFO_RX_BYTES); --+ sinfo->rx_bytes = le64_to_cpu(sta_info_le.rx_tot_bytes); -- } --- } else --- err = -EPERM; --+ } -- done: -- brcmf_dbg(TRACE, "Exit\n"); -- return err; ----- a/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h --+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h --@@ -32,7 +32,11 @@ -- #define BRCMF_BSS_INFO_VERSION 109 /* curr ver of brcmf_bss_info_le struct */ -- #define BRCMF_BSS_RSSI_ON_CHANNEL 0x0002 -- ---#define BRCMF_STA_ASSOC 0x10 /* Associated */ --+#define BRCMF_STA_WME 0x00000002 /* WMM association */ --+#define BRCMF_STA_AUTHE 0x00000008 /* Authenticated */ --+#define BRCMF_STA_ASSOC 0x00000010 /* Associated */ --+#define BRCMF_STA_AUTHO 0x00000020 /* Authorized */ --+#define BRCMF_STA_SCBSTATS 0x00004000 /* Per STA debug stats */ -- -- /* size of brcmf_scan_params not including variable length array */ -- #define BRCMF_SCAN_PARAMS_FIXED_SIZE 64 --@@ -113,6 +117,7 @@ -- #define BRCMF_WOWL_MAXPATTERNSIZE 128 -- -- #define BRCMF_COUNTRY_BUF_SZ 4 --+#define BRCMF_ANT_MAX 4 -- -- /* join preference types for join_pref iovar */ -- enum brcmf_join_pref_types { --@@ -456,25 +461,61 @@ struct brcmf_channel_info_le { -- }; -- -- struct brcmf_sta_info_le { --- __le16 ver; /* version of this struct */ --- __le16 len; /* length in bytes of this structure */ --- __le16 cap; /* sta's advertised capabilities */ --- __le32 flags; /* flags defined below */ --- __le32 idle; /* time since data pkt rx'd from sta */ --- u8 ea[ETH_ALEN]; /* Station address */ --- __le32 count; /* # rates in this set */ --- u8 rates[BRCMF_MAXRATES_IN_SET]; /* rates in 500kbps units */ --+ __le16 ver; /* version of this struct */ --+ __le16 len; /* length in bytes of this structure */ --+ __le16 cap; /* sta's advertised capabilities */ --+ __le32 flags; /* flags defined below */ --+ __le32 idle; /* time since data pkt rx'd from sta */ --+ u8 ea[ETH_ALEN]; /* Station address */ --+ __le32 count; /* # rates in this set */ --+ u8 rates[BRCMF_MAXRATES_IN_SET]; /* rates in 500kbps units */ -- /* w/hi bit set if basic */ --- __le32 in; /* seconds elapsed since associated */ --- __le32 listen_interval_inms; /* Min Listen interval in ms for STA */ --- __le32 tx_pkts; /* # of packets transmitted */ --- __le32 tx_failures; /* # of packets failed */ --- __le32 rx_ucast_pkts; /* # of unicast packets received */ --- __le32 rx_mcast_pkts; /* # of multicast packets received */ --- __le32 tx_rate; /* Rate of last successful tx frame */ --- __le32 rx_rate; /* Rate of last successful rx frame */ --- __le32 rx_decrypt_succeeds; /* # of packet decrypted successfully */ --- __le32 rx_decrypt_failures; /* # of packet decrypted failed */ --+ __le32 in; /* seconds elapsed since associated */ --+ __le32 listen_interval_inms; /* Min Listen interval in ms for STA */ --+ __le32 tx_pkts; /* # of packets transmitted */ --+ __le32 tx_failures; /* # of packets failed */ --+ __le32 rx_ucast_pkts; /* # of unicast packets received */ --+ __le32 rx_mcast_pkts; /* # of multicast packets received */ --+ __le32 tx_rate; /* Rate of last successful tx frame */ --+ __le32 rx_rate; /* Rate of last successful rx frame */ --+ __le32 rx_decrypt_succeeds; /* # of packet decrypted successfully */ --+ __le32 rx_decrypt_failures; /* # of packet decrypted failed */ --+ __le32 tx_tot_pkts; /* # of tx pkts (ucast + mcast) */ --+ __le32 rx_tot_pkts; /* # of data packets recvd (uni + mcast) */ --+ __le32 tx_mcast_pkts; /* # of mcast pkts txed */ --+ __le64 tx_tot_bytes; /* data bytes txed (ucast + mcast) */ --+ __le64 rx_tot_bytes; /* data bytes recvd (ucast + mcast) */ --+ __le64 tx_ucast_bytes; /* data bytes txed (ucast) */ --+ __le64 tx_mcast_bytes; /* # data bytes txed (mcast) */ --+ __le64 rx_ucast_bytes; /* data bytes recvd (ucast) */ --+ __le64 rx_mcast_bytes; /* data bytes recvd (mcast) */ --+ s8 rssi[BRCMF_ANT_MAX]; /* per antenna rssi */ --+ s8 nf[BRCMF_ANT_MAX]; /* per antenna noise floor */ --+ __le16 aid; /* association ID */ --+ __le16 ht_capabilities; /* advertised ht caps */ --+ __le16 vht_flags; /* converted vht flags */ --+ __le32 tx_pkts_retry_cnt; /* # of frames where a retry was --+ * exhausted. --+ */ --+ __le32 tx_pkts_retry_exhausted; /* # of user frames where a retry --+ * was exhausted --+ */ --+ s8 rx_lastpkt_rssi[BRCMF_ANT_MAX]; /* Per antenna RSSI of last --+ * received data frame. --+ */ --+ /* TX WLAN retry/failure statistics: --+ * Separated for host requested frames and locally generated frames. --+ * Include unicast frame only where the retries/failures can be counted. --+ */ --+ __le32 tx_pkts_total; /* # user frames sent successfully */ --+ __le32 tx_pkts_retries; /* # user frames retries */ --+ __le32 tx_pkts_fw_total; /* # FW generated sent successfully */ --+ __le32 tx_pkts_fw_retries; /* # retries for FW generated frames */ --+ __le32 tx_pkts_fw_retry_exhausted; /* # FW generated where a retry --+ * was exhausted --+ */ --+ __le32 rx_pkts_retried; /* # rx with retry bit set */ --+ __le32 tx_rate_fallback; /* lowest fallback TX rate */ -- }; -- -- 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 -deleted file mode 100644 -index 302bc3e..0000000 ---- a/package/kernel/mac80211/patches/389-0004-brcmfmac-have-sdio-return-EIO-when-device-communicat.patch -+++ /dev/null -@@ -1,56 +0,0 @@ --From: Arend van Spriel --Date: Thu, 11 Jun 2015 00:12:20 +0200 --Subject: [PATCH] brcmfmac: have sdio return -EIO when device communication -- is not possible -- --The bus interface functions txctl and rxctl may be used while the device --can not be accessed, eg. upon driver .remove() callback. This patch will --immediately return -EIO when this is the case which speeds up the module --unload. -- --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/bcmsdh.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c --@@ -988,6 +988,7 @@ static void brcmf_sdiod_freezer_detach(s -- -- static int brcmf_sdiod_remove(struct brcmf_sdio_dev *sdiodev) -- { --+ sdiodev->state = BRCMF_SDIOD_DOWN; -- if (sdiodev->bus) { -- brcmf_sdio_remove(sdiodev->bus); -- sdiodev->bus = NULL; ----- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --@@ -2820,6 +2820,8 @@ static int brcmf_sdio_bus_txdata(struct -- struct brcmf_sdio *bus = sdiodev->bus; -- -- brcmf_dbg(TRACE, "Enter: pkt: data %p len %d\n", pkt->data, pkt->len); --+ if (sdiodev->state != BRCMF_SDIOD_DATA) --+ return -EIO; -- -- /* Add space for the header */ -- skb_push(pkt, bus->tx_hdrlen); --@@ -2948,6 +2950,8 @@ brcmf_sdio_bus_txctl(struct device *dev, -- int ret; -- -- brcmf_dbg(TRACE, "Enter\n"); --+ if (sdiodev->state != BRCMF_SDIOD_DATA) --+ return -EIO; -- -- /* Send from dpc */ -- bus->ctrl_frame_buf = msg; --@@ -3238,6 +3242,8 @@ brcmf_sdio_bus_rxctl(struct device *dev, -- struct brcmf_sdio *bus = sdiodev->bus; -- -- brcmf_dbg(TRACE, "Enter\n"); --+ if (sdiodev->state != BRCMF_SDIOD_DATA) --+ return -EIO; -- -- /* 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 -deleted file mode 100644 -index 34af6d2..0000000 ---- a/package/kernel/mac80211/patches/389-0005-ath9k-make-DMA-stop-related-messages-debug-only.patch -+++ /dev/null -@@ -1,74 +0,0 @@ --From: Felix Fietkau --Date: Thu, 2 Jul 2015 13:35:05 +0200 --Subject: [PATCH] ath9k: make DMA stop related messages debug-only -- --A long time ago, ath9k had issues during reset where the DMA engine --would stay active and could potentially corrupt memory. --To debug those issues, the driver would print warnings whenever they --occur. -- --Nowadays, these issues are gone and the primary cause of these messages --is if the MAC is stuck during reset or busy processing a long --transmission. This is fairly harmless, yet these messages continue to --worry users. -- --To reduce the number of bogus bug reports, turn these messages into --debug messages and count their occurence in the "reset" debugfs file. -- --Signed-off-by: Felix Fietkau ----- -- ----- a/drivers/net/wireless/ath/ath9k/debug.c --+++ b/drivers/net/wireless/ath/ath9k/debug.c --@@ -765,6 +765,8 @@ static int read_file_reset(struct seq_fi -- [RESET_TYPE_BEACON_STUCK] = "Stuck Beacon", -- [RESET_TYPE_MCI] = "MCI Reset", -- [RESET_TYPE_CALIBRATION] = "Calibration error", --+ [RESET_TX_DMA_ERROR] = "Tx DMA stop error", --+ [RESET_RX_DMA_ERROR] = "Rx DMA stop error", -- }; -- int i; -- ----- a/drivers/net/wireless/ath/ath9k/debug.h --+++ b/drivers/net/wireless/ath/ath9k/debug.h --@@ -50,6 +50,8 @@ enum ath_reset_type { -- RESET_TYPE_BEACON_STUCK, -- RESET_TYPE_MCI, -- RESET_TYPE_CALIBRATION, --+ RESET_TX_DMA_ERROR, --+ RESET_RX_DMA_ERROR, -- __RESET_TYPE_MAX -- }; -- ----- a/drivers/net/wireless/ath/ath9k/recv.c --+++ b/drivers/net/wireless/ath/ath9k/recv.c --@@ -496,10 +496,9 @@ bool ath_stoprecv(struct ath_softc *sc) -- -- if (!(ah->ah_flags & AH_UNPLUGGED) && -- unlikely(!stopped)) { --- ath_err(ath9k_hw_common(sc->sc_ah), --- "Could not stop RX, we could be " --- "confusing the DMA engine when we start RX up\n"); --- ATH_DBG_WARN_ON_ONCE(!stopped); --+ ath_dbg(ath9k_hw_common(sc->sc_ah), RESET, --+ "Failed to stop Rx DMA\n"); --+ RESET_STAT_INC(sc, RESET_RX_DMA_ERROR); -- } -- return stopped && !reset; -- } ----- a/drivers/net/wireless/ath/ath9k/xmit.c --+++ b/drivers/net/wireless/ath/ath9k/xmit.c --@@ -1896,8 +1896,11 @@ bool ath_drain_all_txq(struct ath_softc -- npend |= BIT(i); -- } -- --- if (npend) --- ath_err(common, "Failed to stop TX DMA, queues=0x%03x!\n", npend); --+ if (npend) { --+ RESET_STAT_INC(sc, RESET_TX_DMA_ERROR); --+ ath_dbg(common, RESET, --+ "Failed to stop TX DMA, queues=0x%03x!\n", npend); --+ } -- -- 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 -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 -+++ /dev/null -@@ -1,44 +0,0 @@ --From: Arend van Spriel --Date: Thu, 11 Jun 2015 00:12:21 +0200 --Subject: [PATCH] brcmfmac: free ifp for non-netdev interface in p2p module -- --Making it more clear by freeing the ifp in same place where the --vif object is freed. -- --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/core.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c --@@ -867,8 +867,6 @@ static void brcmf_del_if(struct brcmf_pu -- } -- /* unregister will take care of freeing it */ -- unregister_netdev(ifp->ndev); --- } else { --- kfree(ifp); -- } -- } -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c --@@ -2238,6 +2238,7 @@ static void brcmf_p2p_delete_p2pdev(stru -- { -- cfg80211_unregister_wdev(&vif->wdev); -- p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; --+ kfree(vif->ifp); -- brcmf_free_vif(vif); -- } -- --@@ -2361,6 +2362,8 @@ int brcmf_p2p_del_vif(struct wiphy *wiph -- break; -- -- case NL80211_IFTYPE_P2P_DEVICE: --+ brcmf_p2p_cancel_remain_on_channel(vif->ifp); --+ brcmf_p2p_deinit_discovery(p2p); -- 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 -deleted file mode 100644 -index 0a6e093..0000000 ---- a/package/kernel/mac80211/patches/389-0007-brcmfmac-move-p2p-attach-detach-functions.patch -+++ /dev/null -@@ -1,225 +0,0 @@ --From: Arend van Spriel --Date: Thu, 11 Jun 2015 00:12:22 +0200 --Subject: [PATCH] brcmfmac: move p2p attach/detach functions -- --Moving two functions in p2p.c as is so next change will be --easier to review. -- --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/p2p.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c --@@ -1908,105 +1908,6 @@ s32 brcmf_p2p_notify_rx_mgmt_p2p_probere -- -- -- /** --- * brcmf_p2p_attach() - attach for P2P. --- * --- * @cfg: driver private data for cfg80211 interface. --- */ ---s32 brcmf_p2p_attach(struct brcmf_cfg80211_info *cfg) ---{ --- 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; --- s32 err = 0; --- --- p2p = &cfg->p2p; --- p2p->cfg = cfg; --- --- drvr = cfg->pub; --- --- pri_ifp = drvr->iflist[0]; --- p2p_ifp = drvr->iflist[1]; --- --- p2p->bss_idx[P2PAPI_BSSCFG_PRIMARY].vif = pri_ifp->vif; --- --- 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); --- --- /* 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: --- return err; ---} --- --- ---/** --- * brcmf_p2p_detach() - detach P2P. --- * --- * @p2p: P2P specific data. --- */ ---void brcmf_p2p_detach(struct brcmf_p2p_info *p2p) ---{ --- struct brcmf_cfg80211_vif *vif; --- --- vif = p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif; --- if (vif != NULL) { --- brcmf_p2p_cancel_remain_on_channel(vif->ifp); --- brcmf_p2p_deinit_discovery(p2p); --- /* remove discovery interface */ --- brcmf_free_vif(vif); --- p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; --- } --- /* just set it all to zero */ --- memset(p2p, 0, sizeof(*p2p)); ---} --- ---/** -- * brcmf_p2p_get_current_chanspec() - Get current operation channel. -- * -- * @p2p: P2P specific data. --@@ -2425,3 +2326,102 @@ void brcmf_p2p_stop_device(struct wiphy -- clear_bit(BRCMF_VIF_STATUS_READY, &vif->sme_state); -- mutex_unlock(&cfg->usr_sync); -- } --+ --+/** --+ * brcmf_p2p_attach() - attach for P2P. --+ * --+ * @cfg: driver private data for cfg80211 interface. --+ */ --+s32 brcmf_p2p_attach(struct brcmf_cfg80211_info *cfg) --+{ --+ 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; --+ s32 err = 0; --+ --+ p2p = &cfg->p2p; --+ p2p->cfg = cfg; --+ --+ drvr = cfg->pub; --+ --+ pri_ifp = drvr->iflist[0]; --+ p2p_ifp = drvr->iflist[1]; --+ --+ p2p->bss_idx[P2PAPI_BSSCFG_PRIMARY].vif = pri_ifp->vif; --+ --+ 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); --+ --+ /* 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: --+ return err; --+} --+ --+/** --+ * brcmf_p2p_detach() - detach P2P. --+ * --+ * @p2p: P2P specific data. --+ */ --+void brcmf_p2p_detach(struct brcmf_p2p_info *p2p) --+{ --+ struct brcmf_cfg80211_vif *vif; --+ --+ vif = p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif; --+ if (vif != NULL) { --+ brcmf_p2p_cancel_remain_on_channel(vif->ifp); --+ brcmf_p2p_deinit_discovery(p2p); --+ /* remove discovery interface */ --+ brcmf_free_vif(vif); --+ p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; --+ } --+ /* just set it all to zero */ --+ 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 -deleted file mode 100644 -index 72e8eed..0000000 ---- a/package/kernel/mac80211/patches/389-0008-brcmfmac-assure-p2pdev-is-unregistered-upon-driver-u.patch -+++ /dev/null -@@ -1,63 +0,0 @@ --From: Arend van Spriel --Date: Thu, 11 Jun 2015 00:12:23 +0200 --Subject: [PATCH] brcmfmac: assure p2pdev is unregistered upon driver -- unload -- --When unloading the driver with a p2pdev interface it resulted in --a warning upon calling wiphy_unregister() and subsequently a crash --in the driver. This patch assures the p2pdev is unregistered calling --unregister_wdev() before doing the wiphy_unregister(). -- --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 --@@ -6206,10 +6206,8 @@ void brcmf_cfg80211_detach(struct brcmf_ -- if (!cfg) -- return; -- --- WARN_ON(!list_empty(&cfg->vif_list)); --- wiphy_unregister(cfg->wiphy); -- brcmf_btcoex_detach(cfg); --- brcmf_p2p_detach(&cfg->p2p); --+ wiphy_unregister(cfg->wiphy); -- wl_deinit_priv(cfg); -- brcmf_free_wiphy(cfg->wiphy); -- } ----- a/drivers/net/wireless/brcm80211/brcmfmac/core.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c --@@ -1098,6 +1098,7 @@ void brcmf_detach(struct device *dev) -- -- /* stop firmware event handling */ -- brcmf_fweh_detach(drvr); --+ brcmf_p2p_detach(&drvr->config->p2p); -- -- brcmf_bus_change_state(bus_if, BRCMF_BUS_DOWN); -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c --@@ -16,6 +16,7 @@ -- #include -- #include -- #include --+#include -- #include -- -- #include --@@ -2418,8 +2419,9 @@ void brcmf_p2p_detach(struct brcmf_p2p_i -- brcmf_p2p_cancel_remain_on_channel(vif->ifp); -- brcmf_p2p_deinit_discovery(p2p); -- /* remove discovery interface */ --- brcmf_free_vif(vif); --- p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; --+ rtnl_lock(); --+ brcmf_p2p_delete_p2pdev(p2p, vif); --+ rtnl_unlock(); -- } -- /* 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 -deleted file mode 100644 -index 179c77e..0000000 ---- a/package/kernel/mac80211/patches/390-0001-brcmfmac-fix-double-free-of-p2pdev-interface.patch -+++ /dev/null -@@ -1,27 +0,0 @@ --From: Arend van Spriel --Date: Mon, 15 Jun 2015 22:48:38 +0200 --Subject: [PATCH] brcmfmac: fix double free of p2pdev interface -- --When freeing the driver ifp pointer it should also be removed from --the driver interface list, which is what brcmf_remove_interface() --does. Otherwise, the ifp pointer will be freed twice triggering --a kernel oops. -- --Fixes: f37d69a4babc ("brcmfmac: free ifp for non-netdev interface in p2p module") --Reviewed-by: Pieter-Paul Giesberts --Reviewed-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 --@@ -2140,7 +2140,7 @@ static void brcmf_p2p_delete_p2pdev(stru -- { -- cfg80211_unregister_wdev(&vif->wdev); -- p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; --- kfree(vif->ifp); --+ brcmf_remove_interface(vif->ifp->drvr, vif->ifp->bssidx); -- 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 -deleted file mode 100644 -index e4f88b5..0000000 ---- a/package/kernel/mac80211/patches/390-0002-brcmfmac-make-brcmf_p2p_detach-call-conditional.patch -+++ /dev/null -@@ -1,29 +0,0 @@ --From: Arend van Spriel --Date: Mon, 15 Jun 2015 22:48:39 +0200 --Subject: [PATCH] brcmfmac: make brcmf_p2p_detach() call conditional -- --During verification of error handling in brcmf_cfg80211_attach() a --null pointer dereference occurred upon calling brcmf_p2p_detach() --from brcmf_detach(). This should only be called when the --brcmf_cfg80211_attach() has succeeded. -- --Fixes: f7a40873d2fa ("brcmfmac: assure p2pdev is unregistered upon driver unload") --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/core.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c --@@ -1098,7 +1098,8 @@ void brcmf_detach(struct device *dev) -- -- /* stop firmware event handling */ -- brcmf_fweh_detach(drvr); --- brcmf_p2p_detach(&drvr->config->p2p); --+ if (drvr->config) --+ brcmf_p2p_detach(&drvr->config->p2p); -- -- 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 -deleted file mode 100644 -index 0a81237..0000000 ---- a/package/kernel/mac80211/patches/391-brcmfmac-set-wiphy-s-addresses-to-provide-valid-MACs.patch -+++ /dev/null -@@ -1,67 +0,0 @@ --From: Rafa? Mi?ecki --Date: Thu, 9 Jul 2015 17:07:08 +0200 --Subject: [PATCH] brcmfmac: set wiphy's addresses to provide valid MACs -- --Broadcom's firmware requires every BSS to use MAC address with unique --last few bits. The amount of bits may depend on a particular firmware, --it was verified to be 2 for BCM43602 one. --If this condition won't be fulfilled firmware will reject such MAC: --brcmfmac: _brcmf_set_mac_address: Setting cur_etheraddr failed, -52 -- --We don't want to simply set addr_mask as it would also disallow using --locally administrated bit. Instead let's build a list of addresses --manually enabling 0x2 bit for extra interfaces. -- --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 --@@ -5784,6 +5784,7 @@ 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; -- struct ieee80211_supported_band *band; -- __le32 bandlist[3]; -- u32 n_bands; --@@ -5797,6 +5798,19 @@ 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++) { --+ u8 *addr = drvr->addresses[i].addr; --+ --+ memcpy(addr, drvr->mac, ETH_ALEN); --+ if (i) { --+ addr[0] |= BIT(1); --+ addr[ETH_ALEN - 1] ^= i; --+ } --+ } --+ wiphy->addresses = drvr->addresses; --+ wiphy->n_addresses = i; --+ -- wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; -- wiphy->cipher_suites = __wl_cipher_suites; -- wiphy->n_cipher_suites = ARRAY_SIZE(__wl_cipher_suites); ----- a/drivers/net/wireless/brcm80211/brcmfmac/core.h --+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.h --@@ -21,6 +21,7 @@ -- #ifndef BRCMFMAC_CORE_H -- #define BRCMFMAC_CORE_H -- --+#include -- #include "fweh.h" -- -- #define TOE_TX_CSUM_OL 0x00000001 --@@ -118,6 +119,8 @@ struct brcmf_pub { -- /* Multicast data packets sent to dongle */ -- unsigned long tx_multicast; -- --+ struct mac_address addresses[BRCMF_MAX_IFS]; --+ -- 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 -deleted file mode 100644 -index e44f121..0000000 ---- a/package/kernel/mac80211/patches/392-brcmfmac-dhd_sdio.c-use-existing-atomic_or-primitive.patch -+++ /dev/null -@@ -1,45 +0,0 @@ --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; --- --- 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); -- -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 -deleted file mode 100644 -index 76ca143..0000000 ---- a/package/kernel/mac80211/patches/393-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?= --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 --@@ -5785,7 +5785,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; --@@ -5798,8 +5800,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/393-0002-brcmfmac-correct-interface-combination-info.patch b/package/kernel/mac80211/patches/393-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 -+++ /dev/null -@@ -1,204 +0,0 @@ --From: Arend van Spriel --Date: Thu, 20 Aug 2015 22:06:03 +0200 --Subject: [PATCH] brcmfmac: correct interface combination info -- --The interface combination provided by brcmfmac did not truly reflect --the combinations supported by driver and/or firmware. -- --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 ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c --@@ -5694,63 +5694,132 @@ brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = -- } -- }; -- --+/** --+ * 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; -- } --@@ -6079,11 +6148,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/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 -deleted file mode 100644 -index 9768ef2..0000000 ---- a/package/kernel/mac80211/patches/393-0003-brcmfmac-add-debugfs-entry-for-msgbuf-statistics.patch -+++ /dev/null -@@ -1,87 +0,0 @@ --From: Franky Lin --Date: Thu, 20 Aug 2015 22:06:04 +0200 --Subject: [PATCH] brcmfmac: add debugfs entry for msgbuf statistics -- --Expose ring buffer read/write pointers and other useful statistics --through debugfs. -- --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 ----- -- ----- 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 -- } -- } -- --+#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; --+ --+ 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); --+ } --+ --+ 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: -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 -deleted file mode 100644 -index 2b84cf9..0000000 ---- a/package/kernel/mac80211/patches/393-0004-brcmfmac-make-use-of-cfg80211_check_combinations.patch -+++ /dev/null -@@ -1,83 +0,0 @@ --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) --@@ -662,8 +692,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: --@@ -822,8 +858,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/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 -deleted file mode 100644 -index 2d5f7b9..0000000 ---- a/package/kernel/mac80211/patches/393-0005-brcmfmac-block-the-correct-flowring-when-backup-queu.patch -+++ /dev/null -@@ -1,48 +0,0 @@ --From: Franky Lin --Date: Thu, 20 Aug 2015 22:06:06 +0200 --Subject: [PATCH] brcmfmac: block the correct flowring when backup queue -- overflow -- --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. -- --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 ----- -- ----- 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); -- -- ring = flow->rings[flowid]; --+ if (ring->blocked == blocked) { --+ spin_unlock_irqrestore(&flow->block_lock, flags); --+ return; --+ } -- ifidx = brcmf_flowring_ifidx_get(flow, flowid); -- -- 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/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 -deleted file mode 100644 -index 7378401..0000000 ---- a/package/kernel/mac80211/patches/393-0006-brcmfmac-bump-highest-event-number-for-4339-firmware.patch -+++ /dev/null -@@ -1,52 +0,0 @@ --From: Arend van Spriel --Date: Thu, 20 Aug 2015 22:06:07 +0200 --Subject: [PATCH] brcmfmac: bump highest event number for 4339 firmware -- --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. -- --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 ----- -- ----- 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) -- -- #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 -- -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 -deleted file mode 100644 -index 97444b3..0000000 ---- a/package/kernel/mac80211/patches/394-0001-brcmfmac-consolidate-ifp-lookup-in-driver-core.patch -+++ /dev/null -@@ -1,138 +0,0 @@ --From: Arend van Spriel --Date: Wed, 26 Aug 2015 22:14:53 +0200 --Subject: [PATCH] brcmfmac: consolidate ifp lookup in driver core -- --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. -- --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/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) -- { -- 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; -- } --- /* 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; --+ --+ *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) --+{ --+ 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]; --+} --+ -- 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 -- -- /* 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; -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 -deleted file mode 100644 -index 632714c..0000000 ---- a/package/kernel/mac80211/patches/394-0002-brcmfmac-make-brcmf_proto_hdrpull-return-struct-brcm.patch -+++ /dev/null -@@ -1,222 +0,0 @@ --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 -- --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 ----- -- ----- 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 -- } -- -- 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; --+ --+ /* assure protocol is always called with --+ * non-null initialized pointer. --+ */ --+ 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) -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 -deleted file mode 100644 -index 2d15a77..0000000 ---- a/package/kernel/mac80211/patches/394-0003-brcmfmac-change-parameters-for-brcmf_remove_interfac.patch -+++ /dev/null -@@ -1,87 +0,0 @@ --From: Arend van Spriel --Date: Wed, 26 Aug 2015 22:14:55 +0200 --Subject: [PATCH] brcmfmac: change parameters for -- brcmf_remove_interface() -- --Just pass the interface to be removed, ie. 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 ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c --@@ -4982,7 +4982,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/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 -- } -- } -- ---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; --+ --+ brcmf_fws_del_interface(ifp); --+ brcmf_del_if(ifp->drvr, ifp->bssidx); -- } -- -- 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 -- { -- 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); -- } -- -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 -deleted file mode 100644 -index 2b61f4e..0000000 ---- a/package/kernel/mac80211/patches/394-0004-brcmfmac-only-call-brcmf_cfg80211_detach-when-attach.patch -+++ /dev/null -@@ -1,92 +0,0 @@ --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 -- --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: -- -- 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 ----- -- ----- 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; --+ } -- 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 -deleted file mode 100644 -index 868b0a8..0000000 ---- a/package/kernel/mac80211/patches/394-0005-brcmfmac-correct-detection-of-p2pdev-interface-event.patch -+++ /dev/null -@@ -1,105 +0,0 @@ --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/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 -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 -+++ /dev/null -@@ -1,126 +0,0 @@ --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 -- --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. -- --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/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 --@@ -6212,7 +6212,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); -- } -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 -deleted file mode 100644 -index 23a7b6f..0000000 ---- a/package/kernel/mac80211/patches/394-0007-brcmfmac-pass-struct-brcmf_if-instance-in-brcmf_txfi.patch -+++ /dev/null -@@ -1,122 +0,0 @@ --From: Arend van Spriel --Date: Wed, 26 Aug 2015 22:14:59 +0200 --Subject: [PATCH] brcmfmac: pass struct brcmf_if instance in -- brcmf_txfinalize() -- --Most call sites of brcmf_txfinalize already have struct brcmf_if --instance so pass that to brcmf_txfinalize() as the function --needs it anyway. -- --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 --@@ -560,17 +560,11 @@ void brcmf_rx_frame(struct device *dev, -- brcmf_netif_rx(ifp, skb); -- } -- ---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; -- --- ifp = drvr->iflist[ifidx]; --- if (!ifp) --- goto done; --- -- eh = (struct ethhdr *)(txp->data); -- type = ntohs(eh->h_proto); -- --@@ -582,7 +576,7 @@ void brcmf_txfinalize(struct brcmf_pub * -- -- 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; -- } -- --@@ -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? --+ */ --+ brcmf_txfinalize(brcmf_get_ifp(msgbuf->drvr, tx_status->msg.ifidx), --+ skb, true); -- } -- -- -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 -deleted file mode 100644 -index 8ddc0a6..0000000 ---- a/package/kernel/mac80211/patches/394-0008-brcmfmac-add-mapping-for-interface-index-to-bsscfg-i.patch -+++ /dev/null -@@ -1,92 +0,0 @@ --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/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 -deleted file mode 100644 -index a0a798b..0000000 ---- a/package/kernel/mac80211/patches/394-0009-brcmfmac-add-dedicated-debug-level-for-firmware-cons.patch -+++ /dev/null -@@ -1,103 +0,0 @@ --From: Arend van Spriel --Date: Wed, 26 Aug 2015 22:15:01 +0200 --Subject: [PATCH] brcmfmac: add dedicated debug level for firmware -- console logging -- --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. -- --Reviewed-by: Hante Meuleman --Reviewed-by: Franky (Zhenhui) Lin --Reviewed-by: Pieter-Paul Giesberts --Reviewed-by: Pontus Fuchs --Signed-off-by: Arend van Spriel ----- -- ----- 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); -- } -- --@@ -656,6 +656,9 @@ static void brcmf_pcie_bus_console_read( -- u8 ch; -- u32 newidx; -- --+ if (!BRCMF_FWCON_ON()) --+ return; --+ -- 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; --+ -- 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) { -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 -deleted file mode 100644 -index 53e7ede..0000000 ---- a/package/kernel/mac80211/patches/394-0010-brcmfmac-remove-ifidx-parameter-from-brcmf_fws_txsta.patch -+++ /dev/null -@@ -1,34 +0,0 @@ --From: Arend van Spriel --Date: Wed, 26 Aug 2015 22:15:02 +0200 --Subject: [PATCH] brcmfmac: remove ifidx parameter from -- brcmf_fws_txstatus_suppressed() -- --The brcmf_fws_txstatus_suppressed() function prototype specifies an --ifidx parameter which is not used within the function implementation. -- --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/fwsignal.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c --@@ -1398,7 +1398,7 @@ done: -- } -- -- 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; -- } -- 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); -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 -deleted file mode 100644 -index bb05235..0000000 ---- a/package/kernel/mac80211/patches/394-0011-brcmfmac-change-prototype-for-brcmf_fws_hdrpull.patch -+++ /dev/null -@@ -1,97 +0,0 @@ --From: Arend van Spriel --Date: Wed, 26 Aug 2015 22:15:03 +0200 --Subject: [PATCH] brcmfmac: change prototype for brcmf_fws_hdrpull() -- --Instead of passing ifidx and drvr just pass struct brcmf_if pointer --which holds both parameters. -- --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/bcdc.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcdc.c --@@ -312,8 +312,7 @@ brcmf_proto_bcdc_hdrpull(struct brcmf_pu -- -- 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) -- { -- 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; -- } -- -- 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); -- -- 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 -deleted file mode 100644 -index ba92c67..0000000 ---- a/package/kernel/mac80211/patches/394-0012-brcmfmac-introduce-brcmf_net_detach-function.patch -+++ /dev/null -@@ -1,99 +0,0 @@ --From: Arend van Spriel --Date: Wed, 26 Aug 2015 22:15:04 +0200 --Subject: [PATCH] brcmfmac: introduce brcmf_net_detach() function -- --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. -- --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 ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c --@@ -4746,7 +4746,8 @@ void brcmf_cfg80211_free_netdev(struct n -- ifp = netdev_priv(ndev); -- vif = ifp->vif; -- --- brcmf_free_vif(vif); --+ if (vif) --+ brcmf_free_vif(vif); -- free_netdev(ndev); -- } -- ----- 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/395-brcmfmac-Reset-PCIE-devices-after-recognition.patch b/package/kernel/mac80211/patches/395-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 -+++ /dev/null -@@ -1,193 +0,0 @@ --From: Hante Meuleman --Date: Thu, 27 Aug 2015 16:14:06 +0200 --Subject: [PATCH] brcmfmac: Reset PCIE devices after recognition. -- --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. -- --Cc: Rafal Milecki --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 ----- -- ----- 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 -- --+/* 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; -- } --+ --+ if (ci->pub.ramsize > BRCMF_CHIP_MAX_MEMSIZE) { --+ brcmf_err("RAM size is incorrect\n"); --+ return -ENOMEM; --+ } --+ -- return 0; -- } -- --@@ -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); -- } -- ----- 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); -- }; ----- 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 * -- } -- -- --+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) -- { --@@ -1647,6 +1671,7 @@ static void brcmf_pcie_buscore_activate( -- -- 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); -- -- kfree(bus->bus_priv.pcie); -- kfree(bus->msgbuf->flowrings); -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 -+++ b/package/kernel/mac80211/patches/400-ath_move_debug_code.patch -@@ -14,7 +14,7 @@ - ccflags-y += -D__CHECK_ENDIAN__ - --- a/drivers/net/wireless/ath/ath.h - +++ b/drivers/net/wireless/ath/ath.h --@@ -316,13 +316,6 @@ void _ath_dbg(struct ath_common *common, -+@@ -318,13 +318,6 @@ void _ath_dbg(struct ath_common *common, - #endif /* CPTCFG_ATH_DEBUG */ - - /** 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 ---- a/package/kernel/mac80211/patches/402-ath_regd_optional.patch -+++ b/package/kernel/mac80211/patches/402-ath_regd_optional.patch -@@ -59,7 +59,7 @@ - ---help--- - --- a/.local-symbols - +++ b/.local-symbols --@@ -89,6 +89,7 @@ RTL8187_LEDS= -+@@ -137,6 +137,7 @@ RTL8187_LEDS= - ATH_COMMON= - ATH_CARDS= - ATH_DEBUG= -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 ---- 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 - enum environment_cap env = ENVIRON_ANY; - struct regulatory_request *request = NULL, *lr; - -@@ -9,7 +9,7 @@ - /* 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( - - void regulatory_hint_disconnect(void) - { -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 -+++ b/package/kernel/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch -@@ -1,6 +1,6 @@ - --- a/drivers/net/wireless/ath/ath9k/init.c - +++ b/drivers/net/wireless/ath/ath9k/init.c --@@ -715,6 +715,7 @@ static const struct ieee80211_iface_limi -+@@ -722,6 +722,7 @@ static const struct ieee80211_iface_limi - BIT(NL80211_IFTYPE_AP) }, - { .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 ---- 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 ++++++++++++++++++++++++++++++++ - debugfs_create_file("antenna", S_IWUSR | S_IRUSR, phydir, ah, - --- 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 { - u8 ah_coverage_class; - bool ah_ack_bitrate_high; - u8 ah_bwmode; -diff --git a/package/kernel/mac80211/patches/500-ath9k_eeprom_debugfs.patch b/package/kernel/mac80211/patches/500-ath9k_eeprom_debugfs.patch -index c6f50be..a7f9d9f 100644 ---- a/package/kernel/mac80211/patches/500-ath9k_eeprom_debugfs.patch -+++ b/package/kernel/mac80211/patches/500-ath9k_eeprom_debugfs.patch -@@ -1,6 +1,6 @@ - --- a/drivers/net/wireless/ath/ath9k/debug.c - +++ b/drivers/net/wireless/ath/ath9k/debug.c --@@ -1299,6 +1299,53 @@ void ath9k_deinit_debug(struct ath_softc -+@@ -1301,6 +1301,53 @@ void ath9k_deinit_debug(struct ath_softc - ath9k_cmn_spectral_deinit_debug(&sc->spec_priv); - } - -@@ -54,7 +54,7 @@ - int ath9k_init_debug(struct ath_hw *ah) - { - struct ath_common *common = ath9k_hw_common(ah); --@@ -1318,6 +1365,8 @@ int ath9k_init_debug(struct ath_hw *ah) -+@@ -1320,6 +1367,8 @@ int ath9k_init_debug(struct ath_hw *ah) - ath9k_tx99_init_debug(sc); - ath9k_cmn_spectral_init_debug(&sc->spec_priv, sc->debug.debugfs_phy); - -diff --git a/package/kernel/mac80211/patches/501-ath9k_ahb_init.patch b/package/kernel/mac80211/patches/501-ath9k_ahb_init.patch -index 0bdcae4..b4e9762 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 --@@ -1023,23 +1023,23 @@ static int __init ath9k_init(void) -+@@ -1031,23 +1031,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 -+++ b/package/kernel/mac80211/patches/510-ath9k_intr_mitigation_tweak.patch -@@ -1,6 +1,6 @@ - --- a/drivers/net/wireless/ath/ath9k/hw.c - +++ b/drivers/net/wireless/ath/ath9k/hw.c --@@ -389,13 +389,8 @@ static void ath9k_hw_init_config(struct -+@@ -390,13 +390,8 @@ static void ath9k_hw_init_config(struct - - ah->config.rx_intr_mitigation = true; - -@@ -14,5 +14,5 @@ - + ah->config.rimt_last = 250; - + ah->config.rimt_first = 500; - -- /* -- * We need this for PCI devices only (Cardbus, PCI, miniPCI) -+ if (AR_SREV_9462(ah) || AR_SREV_9565(ah)) -+ ah->config.pll_pwrsave = 7; -diff --git a/package/kernel/mac80211/patches/511-ath9k_reduce_rxbuf.patch b/package/kernel/mac80211/patches/511-ath9k_reduce_rxbuf.patch -index d4104f0..6766111 100644 ---- a/package/kernel/mac80211/patches/511-ath9k_reduce_rxbuf.patch -+++ b/package/kernel/mac80211/patches/511-ath9k_reduce_rxbuf.patch -@@ -1,6 +1,6 @@ - --- a/drivers/net/wireless/ath/ath9k/ath9k.h - +++ b/drivers/net/wireless/ath/ath9k/ath9k.h --@@ -87,7 +87,7 @@ int ath_descdma_setup(struct ath_softc * -+@@ -88,7 +88,7 @@ int ath_descdma_setup(struct ath_softc * - (_l) &= ((_sz) - 1); \ - } while (0) - -diff --git a/package/kernel/mac80211/patches/512-ath9k_channelbw_debugfs.patch b/package/kernel/mac80211/patches/512-ath9k_channelbw_debugfs.patch -index c0fbf5e..5ecf528 100644 ---- a/package/kernel/mac80211/patches/512-ath9k_channelbw_debugfs.patch -+++ b/package/kernel/mac80211/patches/512-ath9k_channelbw_debugfs.patch -@@ -1,6 +1,6 @@ - --- a/drivers/net/wireless/ath/ath9k/debug.c - +++ b/drivers/net/wireless/ath/ath9k/debug.c --@@ -1346,6 +1346,52 @@ static const struct file_operations fops -+@@ -1348,6 +1348,52 @@ static const struct file_operations fops - .owner = THIS_MODULE - }; - -@@ -53,7 +53,7 @@ - int ath9k_init_debug(struct ath_hw *ah) - { - struct ath_common *common = ath9k_hw_common(ah); --@@ -1367,6 +1413,8 @@ int ath9k_init_debug(struct ath_hw *ah) -+@@ -1369,6 +1415,8 @@ int ath9k_init_debug(struct ath_hw *ah) - - debugfs_create_file("eeprom", S_IRUSR, sc->debug.debugfs_phy, sc, - &fops_eeprom); -diff --git a/package/kernel/mac80211/patches/513-ath9k_add_pci_ids.patch b/package/kernel/mac80211/patches/513-ath9k_add_pci_ids.patch -index 40b5c81..c84d1bc 100644 ---- a/package/kernel/mac80211/patches/513-ath9k_add_pci_ids.patch -+++ b/package/kernel/mac80211/patches/513-ath9k_add_pci_ids.patch -@@ -1,6 +1,6 @@ - --- a/drivers/net/wireless/ath/ath9k/hw.c - +++ b/drivers/net/wireless/ath/ath9k/hw.c --@@ -647,6 +647,7 @@ int ath9k_hw_init(struct ath_hw *ah) -+@@ -651,6 +651,7 @@ int ath9k_hw_init(struct ath_hw *ah) - - /* 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 ---- a/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch -+++ b/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch -@@ -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 { - * - * @power_level: requested transmit power (in dBm), backward compatibility - * value only that is set to the minimum of all interfaces -@@ -26,7 +26,7 @@ - * - * @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 { - u32 flags; - int power_level, dynamic_ps_timeout; - int max_sleep_period; -@@ -36,7 +36,7 @@ - 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. - * -@@ -46,7 +46,7 @@ - * @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, - -@@ -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 - return 0; - } - -@@ -77,7 +77,7 @@ - static int ieee80211_set_wds_peer(struct wiphy *wiphy, struct net_device *dev, - const u8 *addr) - { --@@ -3771,6 +3784,7 @@ const struct cfg80211_ops mac80211_confi -+@@ -3845,6 +3858,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, -@@ -87,7 +87,7 @@ - CFG80211_TESTMODE_CMD(ieee80211_testmode_cmd) - --- a/net/mac80211/ieee80211_i.h - +++ b/net/mac80211/ieee80211_i.h --@@ -1333,6 +1333,7 @@ struct ieee80211_local { -+@@ -1318,6 +1318,7 @@ struct ieee80211_local { - int dynamic_ps_forced_timeout; - - int user_power_level; /* in dBm, for all interfaces */ -@@ -97,7 +97,7 @@ - - --- 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 - struct ieee80211_sub_if_data *sdata; - struct cfg80211_chan_def chandef = {}; - u32 changed = 0; -@@ -106,7 +106,7 @@ - u32 offchannel_flag; - - 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 - } - rcu_read_unlock(); - -@@ -119,7 +119,7 @@ - if (local->hw.conf.power_level != power) { - 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_ - IEEE80211_RADIOTAP_MCS_HAVE_BW; - local->hw.radiotap_vht_details = IEEE80211_RADIOTAP_VHT_KNOWN_GI | - IEEE80211_RADIOTAP_VHT_KNOWN_BANDWIDTH; -@@ -129,7 +129,7 @@ - local->user_power_level = IEEE80211_UNSET_POWER_LEVEL; - --- 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 - [NL80211_ATTR_NETNS_FD] = { .type = NLA_U32 }, - [NL80211_ATTR_SCHED_SCAN_DELAY] = { .type = NLA_U32 }, - [NL80211_ATTR_REG_INDOOR] = { .type = NLA_FLAG }, -@@ -137,7 +137,7 @@ - }; - - /* 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 - 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 b0fb9fe..8aab45a 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 { - 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 --@@ -935,7 +935,7 @@ int ath9k_init_device(u16 devid, struct -+@@ -943,7 +943,7 @@ int ath9k_init_device(u16 devid, struct - - #ifdef CPTCFG_MAC80211_LEDS - /* must be initialized before ieee80211_register_hw */ -@@ -176,7 +176,7 @@ - #endif - --- a/drivers/net/wireless/ath/ath9k/debug.c - +++ b/drivers/net/wireless/ath/ath9k/debug.c --@@ -1391,6 +1391,61 @@ static const struct file_operations fops -+@@ -1393,6 +1393,61 @@ static const struct file_operations fops - .llseek = default_llseek, - }; - -@@ -238,7 +238,7 @@ - - int ath9k_init_debug(struct ath_hw *ah) - { --@@ -1415,6 +1470,10 @@ int ath9k_init_debug(struct ath_hw *ah) -+@@ -1417,6 +1472,10 @@ int ath9k_init_debug(struct ath_hw *ah) - &fops_eeprom); - debugfs_create_file("chanbw", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, - sc, &fops_chanbw); -diff --git a/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch b/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch -index 631a692..2b2c763 100644 ---- a/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch -+++ b/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch -@@ -1,6 +1,6 @@ - --- a/drivers/net/wireless/ath/ath9k/debug.c - +++ b/drivers/net/wireless/ath/ath9k/debug.c --@@ -1447,6 +1447,50 @@ static const struct file_operations fops -+@@ -1449,6 +1449,50 @@ static const struct file_operations fops - #endif - - -@@ -51,7 +51,7 @@ - int ath9k_init_debug(struct ath_hw *ah) - { - struct ath_common *common = ath9k_hw_common(ah); --@@ -1474,6 +1518,8 @@ int ath9k_init_debug(struct ath_hw *ah) -+@@ -1476,6 +1520,8 @@ int ath9k_init_debug(struct ath_hw *ah) - debugfs_create_file("gpio_led", S_IWUSR, - sc->debug.debugfs_phy, sc, &fops_gpio_led); - #endif -@@ -62,7 +62,7 @@ - debugfs_create_devm_seqfile(sc->dev, "interrupt", sc->debug.debugfs_phy, - --- a/drivers/net/wireless/ath/ath9k/hw.h - +++ b/drivers/net/wireless/ath/ath9k/hw.h --@@ -513,6 +513,12 @@ enum { -+@@ -519,6 +519,12 @@ enum { - ATH9K_RESET_COLD, - }; - -@@ -75,7 +75,7 @@ - struct ath9k_hw_version { - u32 magic; - u16 devid; --@@ -794,6 +800,8 @@ struct ath_hw { -+@@ -804,6 +810,8 @@ struct ath_hw { - u32 rfkill_polarity; - u32 ah_flags; - -@@ -84,7 +84,7 @@ - bool reset_power_on; - bool htc_reset_init; - --@@ -1055,6 +1063,7 @@ void ath9k_hw_check_nav(struct ath_hw *a -+@@ -1066,6 +1074,7 @@ void ath9k_hw_check_nav(struct ath_hw *a - bool ath9k_hw_check_alive(struct ath_hw *ah); - - bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode); -@@ -94,7 +94,7 @@ - struct ath_gen_timer *ath_gen_timer_alloc(struct ath_hw *ah, - --- 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 - } - EXPORT_SYMBOL(ath9k_hw_get_tsf_offset); - -@@ -115,7 +115,7 @@ - int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, - 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 - 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 a8f1999..49b6367 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 @@ - --- a/drivers/net/wireless/ath/ath9k/hw.h - +++ b/drivers/net/wireless/ath/ath9k/hw.h --@@ -710,6 +710,7 @@ struct ath_spec_scan { -+@@ -720,6 +720,7 @@ struct ath_spec_scan { - * @config_pci_powersave: - * @calibrate: periodic calibration for NF, ANI, IQ, ADC gain, ADC-DC - * -@@ -8,7 +8,7 @@ - * @spectral_scan_config: set parameters for spectral scan and enable/disable it - * @spectral_scan_trigger: trigger a spectral scan run - * @spectral_scan_wait: wait for a spectral scan run to finish --@@ -732,6 +733,7 @@ struct ath_hw_ops { -+@@ -742,6 +743,7 @@ struct ath_hw_ops { - struct ath_hw_antcomb_conf *antconf); - void (*antdiv_comb_conf_set)(struct ath_hw *ah, - struct ath_hw_antcomb_conf *antconf); -@@ -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 - if (ah->caps.hw_caps & ATH9K_HW_CAP_5GHZ) - ath9k_init_band_txpower(sc, IEEE80211_BAND_5GHZ); - -@@ -65,7 +65,7 @@ - } - - static const struct ieee80211_iface_limit if_limits[] = { --@@ -895,6 +896,18 @@ static void ath9k_set_hw_capab(struct at -+@@ -903,6 +904,18 @@ static void ath9k_set_hw_capab(struct at - SET_IEEE80211_PERM_ADDR(hw, common->macaddr); - } - -@@ -84,7 +84,7 @@ - int ath9k_init_device(u16 devid, struct ath_softc *sc, - const struct ath_bus_ops *bus_ops) - { --@@ -940,6 +953,8 @@ int ath9k_init_device(u16 devid, struct -+@@ -948,6 +961,8 @@ int ath9k_init_device(u16 devid, struct - ARRAY_SIZE(ath9k_tpt_blink)); - #endif - -@@ -110,7 +110,7 @@ - static inline void ath9k_hw_set_bt_ant_diversity(struct ath_hw *ah, bool enable) - --- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c - +++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c --@@ -1316,9 +1316,30 @@ void ar5008_hw_init_rate_txpower(struct -+@@ -1327,9 +1327,30 @@ void ar5008_hw_init_rate_txpower(struct - } - } - -@@ -141,7 +141,7 @@ - static const u32 ar5416_cca_regs[6] = { - AR_PHY_CCA, - AR_PHY_CH1_CCA, --@@ -1333,6 +1354,8 @@ int ar5008_hw_attach_phy_ops(struct ath_ -+@@ -1344,6 +1365,8 @@ int ar5008_hw_attach_phy_ops(struct ath_ - if (ret) - 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 ---- 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 @@ - --- a/drivers/net/wireless/ath/ath9k/hw.c - +++ b/drivers/net/wireless/ath/ath9k/hw.c --@@ -245,6 +245,19 @@ void ath9k_hw_get_channel_centers(struct -+@@ -246,6 +246,19 @@ void ath9k_hw_get_channel_centers(struct - centers->synth_center + (extoff * HT40_CHANNEL_CENTER_SHIFT); - } - -@@ -20,7 +20,7 @@ - /******************/ - /* 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 - if (AR_SREV_9100(ah)) - udelay(50); - -@@ -30,7 +30,7 @@ - return true; - } - --@@ -1481,6 +1497,9 @@ static bool ath9k_hw_chip_reset(struct a -+@@ -1485,6 +1501,9 @@ static bool ath9k_hw_chip_reset(struct a - ar9003_hw_internal_regulator_apply(ah); - ath9k_hw_init_pll(ah, chan); - -@@ -40,7 +40,7 @@ - return true; - } - --@@ -1782,8 +1801,14 @@ static int ath9k_hw_do_fastcc(struct ath -+@@ -1786,8 +1805,14 @@ static int ath9k_hw_do_fastcc(struct ath - if (AR_SREV_9271(ah)) - ar9002_hw_load_ani_reg(ah, chan); - -@@ -55,7 +55,7 @@ - return -EINVAL; - } - --@@ -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 - 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 ---- 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 @@ - --- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c - +++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c --@@ -945,55 +945,6 @@ static bool ar5008_hw_ani_control_new(st -+@@ -956,55 +956,6 @@ static bool ar5008_hw_ani_control_new(st - * on == 0 means more noise imm - */ - 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 ---- 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 +++++++++++ - 2 files changed, 11 insertions(+), 13 deletions(-) - ----- a/drivers/net/wireless/rt2x00/rt2800.h --+++ b/drivers/net/wireless/rt2x00/rt2800.h --@@ -2960,17 +2960,4 @@ enum rt2800_eeprom_word { -- */ -- #define BCN_TBTT_OFFSET 64 -- ---/* --- * RT2800 driver data structure --- */ ---struct rt2800_drv_data { --- u8 calibration_bw20; --- u8 calibration_bw40; --- u8 bbp25; --- u8 bbp26; --- u8 txmixer_gain_24g; --- u8 txmixer_gain_5g; --- unsigned int tbtt_tick; ---}; --- -- #endif /* RT2800_H */ - --- a/drivers/net/wireless/rt2x00/rt2800lib.h - +++ b/drivers/net/wireless/rt2x00/rt2800lib.h --@@ -20,6 +20,17 @@ -+@@ -20,6 +20,20 @@ - #ifndef RT2800LIB_H - #define RT2800LIB_H - -++#include "rt2800.h" -++ - +/* RT2800 driver data structure */ - +struct rt2800_drv_data { - + u8 calibration_bw20; -@@ -55,8 +37,30 @@ Changes since v1: --- - + u8 txmixer_gain_24g; - + u8 txmixer_gain_5g; - + unsigned int tbtt_tick; -++ DECLARE_BITMAP(sta_ids, STA_IDS_SIZE); - +}; - + - 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 -+@@ -2969,18 +2969,4 @@ enum rt2800_eeprom_word { -+ #define WCID_END 222 -+ #define STA_IDS_SIZE (WCID_END - WCID_START + 2) -+ -+-/* -+- * RT2800 driver data structure -+- */ -+-struct rt2800_drv_data { -+- u8 calibration_bw20; -+- u8 calibration_bw40; -+- u8 bbp25; -+- u8 bbp26; -+- u8 txmixer_gain_24g; -+- u8 txmixer_gain_5g; -+- unsigned int tbtt_tick; -+- DECLARE_BITMAP(sta_ids, STA_IDS_SIZE); -+-}; -+- -+ #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 ---- 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: - - --- 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 - - int rt2800_probe_hw(struct rt2x00_dev *rt2x00dev) - { -@@ -32,7 +32,7 @@ Changes since v1: - int retval; - 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 - if (retval) - return retval; - -@@ -44,9 +44,9 @@ Changes since v1: - */ - --- a/drivers/net/wireless/rt2x00/rt2800lib.h - +++ b/drivers/net/wireless/rt2x00/rt2800lib.h --@@ -20,6 +20,10 @@ -- #ifndef RT2800LIB_H -- #define RT2800LIB_H -+@@ -22,6 +22,10 @@ -+ -+ #include "rt2800.h" - - +enum rt2800_flag { - + RT2800_HAS_HIGH_SHARED_MEM, -@@ -55,16 +55,16 @@ Changes since v1: - /* RT2800 driver data structure */ - struct rt2800_drv_data { - u8 calibration_bw20; --@@ -29,6 +33,8 @@ struct rt2800_drv_data { -- u8 txmixer_gain_24g; -+@@ -32,6 +36,8 @@ struct rt2800_drv_data { - u8 txmixer_gain_5g; - unsigned int tbtt_tick; -+ DECLARE_BITMAP(sta_ids, STA_IDS_SIZE); - + - + unsigned long rt2800_flags; - }; - - struct rt2800_ops { --@@ -61,6 +67,13 @@ struct rt2800_ops { -+@@ -64,6 +70,13 @@ struct rt2800_ops { - __le32 *(*drv_get_txwi)(struct queue_entry *entry); - }; - -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 ---- 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 -@@ -175,7 +175,7 @@ Changes since v1: --- - - /* - * Update WCID information --@@ -1437,8 +1467,11 @@ int rt2800_config_pairwise_key(struct rt -+@@ -1405,8 +1435,11 @@ int rt2800_config_pairwise_key(struct rt - sizeof(key_entry.rx_mic)); - - offset = PAIRWISE_KEY_ENTRY(key->hw_key_idx); -@@ -187,7 +187,7 @@ Changes since v1: --- - } - - /* --@@ -4908,14 +4941,19 @@ static int rt2800_init_registers(struct -+@@ -4884,14 +4917,19 @@ static int rt2800_init_registers(struct - /* - * ASIC will keep garbage value after boot, clear encryption keys. - */ -@@ -207,7 +207,7 @@ Changes since v1: --- - } - - /* --@@ -5041,8 +5079,10 @@ static int rt2800_wait_bbp_ready(struct -+@@ -5017,8 +5055,10 @@ static int rt2800_wait_bbp_ready(struct - * BBP was enabled after firmware was loaded, - * but we need to reactivate it now. - */ -@@ -218,7 +218,7 @@ Changes since v1: --- - msleep(1); - - 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 - /* - * Send signal during boot time to initialize firmware. - */ -@@ -239,7 +239,7 @@ Changes since v1: --- - msleep(1); - - /* --@@ -7751,6 +7799,8 @@ int rt2800_probe_hw(struct rt2x00_dev *r -+@@ -7725,6 +7773,8 @@ int rt2800_probe_hw(struct rt2x00_dev *r - int retval; - u32 reg; - -@@ -248,22 +248,22 @@ Changes since v1: --- - retval = rt2800_probe_rt(rt2x00dev); - if (retval) - 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 -+ return; - -- offset = MAC_IVEIV_ENTRY(hw_key_idx); -+ offset = MAC_IVEIV_ENTRY(key->hw_key_idx); - + - + rt2800_shared_mem_lock(rt2x00dev); - rt2800_register_multiread(rt2x00dev, offset, - &iveiv_entry, sizeof(iveiv_entry)); - + rt2800_shared_mem_unlock(rt2x00dev); - -- 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 --@@ -35,6 +35,11 @@ struct rt2800_drv_data { -- unsigned int tbtt_tick; -+@@ -38,6 +38,11 @@ struct rt2800_drv_data { -+ DECLARE_BITMAP(sta_ids, STA_IDS_SIZE); - - unsigned long rt2800_flags; - + -@@ -274,7 +274,7 @@ Changes since v1: --- - }; - - struct rt2800_ops { --@@ -65,6 +70,10 @@ struct rt2800_ops { -+@@ -68,6 +73,10 @@ struct rt2800_ops { - const u8 *data, const size_t len); - int (*drv_init_registers)(struct rt2x00_dev *rt2x00dev); - __le32 *(*drv_get_txwi)(struct queue_entry *entry); -@@ -285,7 +285,7 @@ Changes since v1: --- - }; - - static inline bool rt2800_has_high_shared_mem(struct rt2x00_dev *rt2x00dev) --@@ -74,6 +83,29 @@ static inline bool rt2800_has_high_share -+@@ -77,6 +86,29 @@ static inline bool rt2800_has_high_share - return test_bit(RT2800_HAS_HIGH_SHARED_MEM, &drv_data->rt2800_flags); - } - -@@ -486,7 +486,7 @@ Changes since v1: --- - /* - * Queue handlers. - */ --@@ -294,8 +315,10 @@ static int rt2800usb_write_firmware(stru -+@@ -299,8 +320,10 @@ static int rt2800usb_write_firmware(stru - data + offset, length); - } - -@@ -497,7 +497,7 @@ Changes since v1: --- - - /* - * Send firmware request to device to load firmware, --@@ -310,7 +333,10 @@ static int rt2800usb_write_firmware(stru -+@@ -315,7 +338,10 @@ static int rt2800usb_write_firmware(stru - } - - msleep(10); -@@ -508,7 +508,7 @@ Changes since v1: --- - - return 0; - } --@@ -328,8 +354,10 @@ static int rt2800usb_init_registers(stru -+@@ -333,8 +359,10 @@ static int rt2800usb_init_registers(stru - if (rt2800_wait_csr_ready(rt2x00dev)) - return -EBUSY; - -@@ -519,7 +519,7 @@ Changes since v1: --- - - reg = 0; - rt2x00_set_field32(®, MAC_SYS_CTRL_RESET_CSR, 1); --@@ -859,6 +887,9 @@ static const struct rt2800_ops rt2800usb -+@@ -863,6 +891,9 @@ static const struct rt2800_ops rt2800usb - .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-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 ---- 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 - - --- 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); - */ - static int rt2800_init_registers(struct rt2x00_dev *rt2x00dev) - { -@@ -32,7 +32,7 @@ Signed-off-by: Gabor Juhos - u32 reg; - 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 - /* - * Clear all beacons - */ -@@ -41,7 +41,7 @@ Signed-off-by: Gabor Juhos - rt2800_clear_beacon_register(rt2x00dev, i); - - 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 - 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 - */ - --- a/drivers/net/wireless/rt2x00/rt2800lib.h - +++ b/drivers/net/wireless/rt2x00/rt2800lib.h --@@ -33,6 +33,7 @@ struct rt2800_drv_data { -+@@ -35,6 +35,7 @@ struct rt2800_drv_data { - u8 txmixer_gain_24g; - u8 txmixer_gain_5g; - unsigned int tbtt_tick; - + unsigned int hw_beacon_count; -+ DECLARE_BITMAP(sta_ids, STA_IDS_SIZE); - - 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 ---- 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 - */ - --- 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 - 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 ---- 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 - - --- 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 - if (rt2x00_rt(rt2x00dev, RT3593)) - __set_bit(RT2800_HAS_HIGH_SHARED_MEM, &drv_data->rt2800_flags); - -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 ---- 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 - - --- 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 - 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 ---- 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 - #define RF5370 0x5370 - --- 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 - {173, 0x61, 0, 9}, - }; - -@@ -98,7 +98,7 @@ Signed-off-by: Gabor Juhos - static const struct rf_channel rf_vals_5592_xtal20[] = { - /* 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 - 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 ---- 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 - - --- 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 - case RF3053: - case RF3070: - case RF3290: -@@ -18,7 +18,7 @@ Signed-off-by: Gabor Juhos - case RF5360: - 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 - 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 ---- 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 - - --- 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 - } - } - -@@ -223,7 +223,7 @@ Signed-off-by: Gabor Juhos - #define POWER_BOUND 0x27 - #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 - 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 ---- 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 - - --- 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 - 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 ---- 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 - #define RX_FILTER_CFG 0x1400 - --- 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 - rt2800_register_write(rt2x00dev, TX_SW_CFG2, - 0x00000000); - } -@@ -48,7 +48,7 @@ Signed-off-by: Gabor Juhos - } else if (rt2x00_rt(rt2x00dev, RT5390) || - 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 - - rt2800_register_read(rt2x00dev, MAX_LEN_CFG, ®); - rt2x00_set_field32(®, MAX_LEN_CFG_MAX_MPDU, AGGREGATION_SIZE); -@@ -63,7 +63,7 @@ Signed-off-by: Gabor Juhos - rt2x00_set_field32(®, MAX_LEN_CFG_MAX_PSDU, 2); - 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 - reg = rt2x00_rt(rt2x00dev, RT5592) ? 0x00000082 : 0x00000002; - rt2800_register_write(rt2x00dev, TXOP_HLDR_ET, reg); - -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 ---- 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 - - --- 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 - rt2800_bbp_write(rt2x00dev, 103, 0xc0); - } - -@@ -59,7 +59,7 @@ Signed-off-by: Gabor Juhos - static void rt2800_init_bbp_53xx(struct rt2x00_dev *rt2x00dev) - { - 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 - 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 ---- 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 - /* - --- 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 - /* TODO: enable stream mode support */ - } - -@@ -166,7 +166,7 @@ Signed-off-by: Gabor Juhos - static void rt2800_init_rfcsr_5390(struct rt2x00_dev *rt2x00dev) - { - 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 - case RT3390: - rt2800_init_rfcsr_3390(rt2x00dev); - break; -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 ---- 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 - - --- 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 - 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 ---- 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 - - --- 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 - return clamp_t(char, txpower, MIN_A_TXPOWER, MAX_A_TXPOWER); - } - -@@ -47,7 +47,7 @@ Signed-off-by: Gabor Juhos - static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev, - 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 - rt2800_txpower_to_dev(rt2x00dev, rf->channel, - info->default_power3); - -@@ -60,7 +60,7 @@ Signed-off-by: Gabor Juhos - switch (rt2x00dev->chip.rf) { - case RF2020: - case RF3020: --@@ -3530,6 +3566,15 @@ static void rt2800_config_channel(struct -+@@ -3506,6 +3542,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); -@@ -76,7 +76,7 @@ Signed-off-by: Gabor Juhos - } else { - 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 - !rt2x00_rt(rt2x00dev, RT5392)) { - if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) { - rt2800_bbp_write(rt2x00dev, 82, 0x62); -@@ -84,7 +84,7 @@ Signed-off-by: Gabor Juhos - rt2800_bbp_write(rt2x00dev, 75, 0x46); - } 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 - rt2800_bbp_write(rt2x00dev, 82, 0x84); - rt2800_bbp_write(rt2x00dev, 75, 0x50); - } -@@ -110,7 +110,7 @@ Signed-off-by: Gabor Juhos - rt2800_bbp_write(rt2x00dev, 83, 0x9a); - - 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 - - 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 ---- 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 - - --- 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 - 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 ---- 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 - - --- 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 - 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 ---- 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 - - --- 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 - { - u16 word; - -@@ -21,7 +21,7 @@ Signed-off-by: Gabor Juhos - return 0; - - 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 - { - u16 word; - -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 ---- 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 - - --- 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 - 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 ---- 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 - - --- 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 - 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 ---- 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 - - --- 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 - rt2800_eeprom_read(rt2x00dev, EEPROM_LNA, &eeprom); - lna_gain = rt2x00_get_field16(eeprom, EEPROM_LNA_A0); - } else if (libconf->rf.channel <= 128) { -@@ -20,7 +20,7 @@ Signed-off-by: Gabor Juhos - rt2800_eeprom_read(rt2x00dev, EEPROM_EXT_LNA2, &eeprom); - 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 - 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 ---- 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 - - --- 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 - else - vgc = 0x2e + rt2x00dev->lna_gain; - } else { /* 5GHZ band */ -@@ -20,7 +20,7 @@ Signed-off-by: Gabor Juhos - vgc = 0x20 + (rt2x00dev->lna_gain * 5) / 3; - 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 - { - if (qual->vgc_level != vgc_level) { - if (rt2x00_rt(rt2x00dev, RT3572) || -@@ -30,7 +30,7 @@ Signed-off-by: Gabor Juhos - rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, - 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 - } - 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 ---- 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 - - --- 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 - 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); -@@ -20,7 +20,7 @@ Signed-off-by: Gabor Juhos - if (rt2x00_get_field16(word, EEPROM_RSSI_BG2_LNA_A1) == 0x00 || - 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 - 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); -@@ -30,7 +30,7 @@ Signed-off-by: Gabor Juhos - if (rt2x00_get_field16(word, EEPROM_RSSI_A2_LNA_A2) == 0x00 || - 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 - } - 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 ---- 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 - - --- 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 - 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 ---- 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 - - --- 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 - if (retval) - return retval; - -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 ---- a/package/kernel/mac80211/patches/603-rt2x00-introduce-rt2x00eeprom.patch -+++ b/package/kernel/mac80211/patches/603-rt2x00-introduce-rt2x00eeprom.patch -@@ -1,13 +1,13 @@ - --- a/.local-symbols - +++ b/.local-symbols --@@ -263,6 +263,7 @@ RT2X00_LIB_FIRMWARE= -+@@ -312,6 +312,7 @@ RT2X00_LIB_FIRMWARE= - RT2X00_LIB_CRYPTO= - RT2X00_LIB_LEDS= - RT2X00_LIB_DEBUGFS= - +RT2X00_LIB_EEPROM= - RT2X00_DEBUG= -- RTL_CARDS= -- RTL8192CE= -+ WL_MEDIATEK= -+ MT7601U= - --- a/drivers/net/wireless/rt2x00/Kconfig - +++ b/drivers/net/wireless/rt2x00/Kconfig - @@ -69,6 +69,7 @@ config RT2800PCI -@@ -48,7 +48,7 @@ - obj-$(CPTCFG_RT2X00_LIB_MMIO) += rt2x00mmio.o - --- a/drivers/net/wireless/rt2x00/rt2800lib.h - +++ b/drivers/net/wireless/rt2x00/rt2800lib.h --@@ -43,6 +43,8 @@ struct rt2800_drv_data { -+@@ -46,6 +46,8 @@ struct rt2800_drv_data { - } shmem_lock; - }; - -@@ -57,7 +57,7 @@ - struct rt2800_ops { - void (*register_read)(struct rt2x00_dev *rt2x00dev, - const unsigned int offset, u32 *value); --@@ -176,6 +178,15 @@ static inline int rt2800_read_eeprom(str -+@@ -179,6 +181,15 @@ static inline int rt2800_read_eeprom(str - { - const struct rt2800_ops *rt2800ops = rt2x00dev->ops->drv; - -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 ---- 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 @@ - * 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 - 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/610-rt2x00-fix-rt3352-ext-pa.patch b/package/kernel/mac80211/patches/610-rt2x00-fix-rt3352-ext-pa.patch -index 067d2ea..39b1ccc 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 --@@ -3552,11 +3552,18 @@ static void rt2800_config_channel(struct -+@@ -3528,11 +3528,18 @@ static void rt2800_config_channel(struct - /* - * Change BBP settings - */ -@@ -19,7 +19,7 @@ - } else if (rt2x00_rt(rt2x00dev, RT3593)) { - 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 - - static void rt2800_init_rfcsr_3352(struct rt2x00_dev *rt2x00dev) - { -@@ -32,7 +32,7 @@ - rt2800_rf_init_calibration(rt2x00dev, 30); - - 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 - rt2800_rfcsr_write(rt2x00dev, 31, 0x80); - rt2800_rfcsr_write(rt2x00dev, 32, 0x80); - rt2800_rfcsr_write(rt2x00dev, 33, 0x00); -@@ -66,7 +66,7 @@ - rt2800_rfcsr_write(rt2x00dev, 43, 0xdb); - 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 - rt2800_rfcsr_write(rt2x00dev, 47, 0x0d); - rt2800_rfcsr_write(rt2x00dev, 48, 0x14); - rt2800_rfcsr_write(rt2x00dev, 49, 0x00); -@@ -96,7 +96,7 @@ - rt2800_rfcsr_write(rt2x00dev, 59, 0x00); - 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 - * RT53xx: defined in "EEPROM_CHIP_ID" field - */ - if (rt2x00_rt(rt2x00dev, RT3290) || -@@ -104,7 +104,7 @@ - rt2x00_rt(rt2x00dev, RT5390) || - 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 - /* - * Detect if this device has Bluetooth co-existence. - */ -@@ -114,7 +114,7 @@ - __set_bit(CAPABILITY_BT_COEXIST, &rt2x00dev->cap_flags); - - /* --@@ -7822,6 +7857,22 @@ static int rt2800_init_eeprom(struct rt2 -+@@ -7798,6 +7833,22 @@ static int rt2800_init_eeprom(struct rt2 - EIRP_MAX_TX_POWER_LIMIT) - __set_bit(CAPABILITY_POWER_LIMIT, &rt2x00dev->cap_flags); - -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 ---- 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 --@@ -8209,6 +8209,27 @@ static const struct rf_channel rf_vals_5 -+@@ -8185,6 +8185,27 @@ static const struct rf_channel rf_vals_5 - {196, 83, 0, 12, 1}, - }; - -@@ -28,7 +28,7 @@ - static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev) - { - 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 - case RF5390: - case RF5392: - spec->num_channels = 14; -@@ -40,7 +40,7 @@ - break; - - case RF3052: --@@ -8481,6 +8505,19 @@ static int rt2800_probe_rt(struct rt2x00 -+@@ -8455,6 +8479,19 @@ static int rt2800_probe_rt(struct rt2x00 - return 0; - } - -@@ -60,7 +60,7 @@ - int rt2800_probe_hw(struct rt2x00_dev *rt2x00dev) - { - 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 - rt2800_register_write(rt2x00dev, GPIO_CTRL, reg); - - /* -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 ---- a/package/kernel/mac80211/patches/615-rt2x00-fix_20mhz_clk.patch -+++ b/package/kernel/mac80211/patches/615-rt2x00-fix_20mhz_clk.patch -@@ -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 - - 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 ---- a/package/kernel/mac80211/patches/616-rt2x00-support-rt5350.patch -+++ b/package/kernel/mac80211/patches/616-rt2x00-support-rt5350.patch -@@ -10,7 +10,7 @@ - #define RF5370 0x5370 - --- 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 - - rt2800_rfcsr_write(rt2x00dev, 59, - r59_non_bt[idx]); -@@ -24,7 +24,7 @@ - } - } - } --@@ -3516,6 +3523,7 @@ static void rt2800_config_channel(struct -+@@ -3492,6 +3499,7 @@ static void rt2800_config_channel(struct - rt2800_config_channel_rf3853(rt2x00dev, conf, rf, info); - break; - case RF3070: -@@ -32,7 +32,7 @@ - case RF5360: - case RF5362: - case RF5370: --@@ -3534,6 +3542,7 @@ static void rt2800_config_channel(struct -+@@ -3510,6 +3518,7 @@ static void rt2800_config_channel(struct - if (rt2x00_rf(rt2x00dev, RF3070) || - rt2x00_rf(rt2x00dev, RF3290) || - rt2x00_rf(rt2x00dev, RF3322) || -@@ -40,7 +40,7 @@ - rt2x00_rf(rt2x00dev, RF5360) || - 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 - /* - * Clear update flag - */ -@@ -50,7 +50,7 @@ - rt2800_bbp_read(rt2x00dev, 49, &bbp); - 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 - case RF3070: - case RF3290: - case RF3853: -@@ -58,7 +58,7 @@ - case RF5360: - case RF5362: - case RF5370: --@@ -5111,6 +5122,8 @@ static int rt2800_init_registers(struct -+@@ -5087,6 +5098,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); -@@ -67,7 +67,7 @@ - } else { - 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 - - rt2800_bbp_write(rt2x00dev, 82, 0x62); - -@@ -84,7 +84,7 @@ - - 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 - - rt2800_bbp_write(rt2x00dev, 104, 0x92); - -@@ -101,7 +101,7 @@ - - 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 - rt2800_bbp_write(rt2x00dev, 143, 0xa2); - - rt2800_bbp_write(rt2x00dev, 148, 0xc8); -@@ -115,7 +115,7 @@ - } - - 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 - rt2800_init_bbp_3290(rt2x00dev); - break; - case RT3352: -@@ -123,7 +123,7 @@ - rt2800_init_bbp_3352(rt2x00dev); - 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 - rt2800_rfcsr_write(rt2x00dev, 20, rfcsr); - } - -@@ -200,7 +200,7 @@ - static void rt2800_init_rfcsr_5390(struct rt2x00_dev *rt2x00dev) - { - 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 - case RT3593: - rt2800_init_rfcsr_3593(rt2x00dev); - break; -@@ -210,7 +210,7 @@ - case RT5390: - 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 - 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); -@@ -223,7 +223,7 @@ - } else if (rt2x00_rt(rt2x00dev, RT2860) || - 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 - rt2800_eeprom_read(rt2x00dev, EEPROM_CHIP_ID, &rf); - else if (rt2x00_rt(rt2x00dev, RT3883)) - rf = RF3853; -@@ -232,7 +232,7 @@ - else - 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 - case RF3320: - case RF3322: - case RF3853: -@@ -240,7 +240,7 @@ - case RF5360: - 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 - case RF3290: - case RF3320: - case RF3322: -@@ -248,7 +248,7 @@ - case RF5360: - 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 - case RF3070: - case RF3290: - case RF3853: -@@ -256,7 +256,7 @@ - case RF5360: - 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 - case RT3572: - case RT3593: - case RT3883: -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 ---- 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 -@@ -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 - rt2800_init_led(rt2x00dev, &rt2x00dev->led_assoc, LED_TYPE_ASSOC); - rt2800_init_led(rt2x00dev, &rt2x00dev->led_qual, LED_TYPE_QUALITY); - -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 ---- 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 --@@ -7841,10 +7841,11 @@ static int rt2800_init_eeprom(struct rt2 -+@@ -7817,10 +7817,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 ---- 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 @@ - * RFCSR 31: - --- 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 - rt2x00_rf(rt2x00dev, RF5390) || - rt2x00_rf(rt2x00dev, RF5392)) { - rt2800_rfcsr_read(rt2x00dev, 30, &rfcsr); -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 ---- 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 - goto err_wiphy_new; - } - -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 ---- 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 - wdev->wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites); - wdev->wiphy->reg_notifier = lbs_reg_notifier; - -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 ---- a/package/kernel/mac80211/patches/820-b43-add-antenna-control.patch -+++ b/package/kernel/mac80211/patches/820-b43-add-antenna-control.patch -@@ -9,7 +9,7 @@ - antenna = b43_antenna_to_phyctl(antenna); - ctl = b43_shm_read16(dev, B43_SHM_SHARED, B43_SHM_SH_BEACPHYCTL); - /* We can't send beacons with short preamble. Would get PHY errors. */ --@@ -3302,8 +3302,8 @@ static int b43_chip_init(struct b43_wlde -+@@ -3300,8 +3300,8 @@ static int b43_chip_init(struct b43_wlde - - /* Select the antennae */ - if (phy->ops->set_rx_antenna) -@@ -20,7 +20,7 @@ - - if (phy->type == B43_PHYTYPE_B) { - value16 = b43_read16(dev, 0x005E); --@@ -4003,7 +4003,6 @@ static int b43_op_config(struct ieee8021 -+@@ -4001,7 +4001,6 @@ static int b43_op_config(struct ieee8021 - struct b43_wldev *dev = wl->current_dev; - struct b43_phy *phy = &dev->phy; - struct ieee80211_conf *conf = &hw->conf; -@@ -28,7 +28,7 @@ - int err = 0; - - mutex_lock(&wl->mutex); --@@ -4046,11 +4045,9 @@ static int b43_op_config(struct ieee8021 -+@@ -4044,11 +4043,9 @@ static int b43_op_config(struct ieee8021 - } - - /* Antennas for RX and management frame TX. */ -@@ -42,7 +42,7 @@ - - if (wl->radio_enabled != phy->radio_on) { - if (wl->radio_enabled) { --@@ -5213,6 +5210,47 @@ static int b43_op_get_survey(struct ieee -+@@ -5209,6 +5206,47 @@ static int b43_op_get_survey(struct ieee - return 0; - } - -@@ -90,7 +90,7 @@ - static const struct ieee80211_ops b43_hw_ops = { - .tx = b43_op_tx, - .conf_tx = b43_op_conf_tx, --@@ -5234,6 +5272,8 @@ static const struct ieee80211_ops b43_hw -+@@ -5230,6 +5268,8 @@ static const struct ieee80211_ops b43_hw - .sw_scan_complete = b43_op_sw_scan_complete_notifier, - .get_survey = b43_op_get_survey, - .rfkill_poll = b43_rfkill_poll, -@@ -99,7 +99,7 @@ - }; - - /* Hard-reset the chip. Do not call this directly. --@@ -5542,6 +5582,8 @@ static int b43_one_core_attach(struct b4 -+@@ -5538,6 +5578,8 @@ static int b43_one_core_attach(struct b4 - if (!wldev) - goto out; - -@@ -108,7 +108,7 @@ - wldev->use_pio = b43_modparam_pio; - wldev->dev = dev; - wldev->wl = wl; --@@ -5632,6 +5674,9 @@ static struct b43_wl *b43_wireless_init( -+@@ -5628,6 +5670,9 @@ static struct b43_wl *b43_wireless_init( - - hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN; - -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 685a5f9..f9799ce 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 --@@ -1213,6 +1213,7 @@ static int __init brcmfmac_module_init(v -+@@ -1189,6 +1189,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 ---- 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 -+@@ -692,9 +692,37 @@ static struct wireless_dev *brcmf_cfg802 - u32 *flags, - struct vif_params *params) - { -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 ---- a/package/kernel/mac80211/patches/900-wlcore-Add-support-for-DT-platform-data.patch -+++ /dev/null -@@ -1,139 +0,0 @@ --When running with DT, we no longer have a board file that can set up the --platform data for wlcore. Allow this data to be passed from DT. -- --Since some platforms use a gpio-irq, add support for passing either the --irq number or the gpio number. For the latter case, the driver will --request the gpio and convert it to the irq number. If an irq is --specified, it'll be used as is. -- --[Arik - the pdev_data pointer does not belong to us and is freed when --the device is released. Dereference to our private data first.] -- --Signed-off-by: Ido Yariv --Signed-off-by: Arik Nemtsov ----- -- drivers/net/wireless/ti/wlcore/sdio.c | 71 ++++++++++++++++++++++++++++++++--- -- include/linux/wl12xx.h | 3 +- -- 2 files changed, 67 insertions(+), 7 deletions(-) -- ----- a/drivers/net/wireless/ti/wlcore/sdio.c --+++ b/drivers/net/wireless/ti/wlcore/sdio.c --@@ -34,6 +34,7 @@ -- #include -- #include -- #include --+#include -- -- #include "wlcore.h" -- #include "wl12xx_80211.h" --@@ -214,6 +215,61 @@ static struct wl1271_if_operations sdio_ -- .set_block_size = wl1271_sdio_set_block_size, -- }; -- --+static const struct of_device_id wlcore_of_match[] = { --+ { --+ .compatible = "wlcore", --+ }, --+ {} --+}; --+MODULE_DEVICE_TABLE(of, wlcore_of_match); --+ --+static struct wl12xx_platform_data *get_platform_data(struct device *dev) --+{ --+ struct wl12xx_platform_data *pdata; --+ struct device_node *np; --+ u32 gpio; --+ --+ pdata = wl12xx_get_platform_data(); --+ if (!IS_ERR(pdata)) --+ return kmemdup(pdata, sizeof(*pdata), GFP_KERNEL); --+ --+ np = of_find_matching_node(NULL, wlcore_of_match); --+ if (!np) { --+ dev_err(dev, "No platform data set\n"); --+ return NULL; --+ } --+ --+ pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); --+ if (!pdata) { --+ dev_err(dev, "Can't allocate platform data\n"); --+ return NULL; --+ } --+ --+ if (of_property_read_u32(np, "irq", &pdata->irq)) { --+ if (!of_property_read_u32(np, "gpio", &gpio) && --+ !gpio_request_one(gpio, GPIOF_IN, "wlcore_irq")) { --+ pdata->gpio = gpio; --+ pdata->irq = gpio_to_irq(gpio); --+ } --+ } --+ --+ /* Optional fields */ --+ pdata->use_eeprom = of_property_read_bool(np, "use-eeprom"); --+ of_property_read_u32(np, "board-ref-clock", &pdata->board_ref_clock); --+ of_property_read_u32(np, "board-tcxo-clock", &pdata->board_tcxo_clock); --+ of_property_read_u32(np, "platform-quirks", &pdata->platform_quirks); --+ --+ return pdata; --+} --+ --+static void del_platform_data(struct wl12xx_platform_data *pdata) --+{ --+ if (pdata->gpio) --+ gpio_free(pdata->gpio); --+ --+ kfree(pdata); --+} --+ -- static int wl1271_probe(struct sdio_func *func, -- const struct sdio_device_id *id) -- { --@@ -245,10 +301,10 @@ static int wl1271_probe(struct sdio_func -- /* Use block mode for transferring over one block size of data */ -- func->card->quirks |= MMC_QUIRK_BLKSZ_FOR_BYTE_MODE; -- --- pdev_data.pdata = wl12xx_get_platform_data(); --- if (IS_ERR(pdev_data.pdata)) { --- ret = PTR_ERR(pdev_data.pdata); --- dev_err(glue->dev, "missing wlan platform data: %d\n", ret); --+ pdev_data.pdata = get_platform_data(&func->dev); --+ if (!pdev_data.pdata) { --+ ret = -EINVAL; --+ dev_err(glue->dev, "missing wlan platform data\n"); -- goto out_free_glue; -- } -- --@@ -279,7 +335,7 @@ static int wl1271_probe(struct sdio_func -- if (!glue->core) { -- dev_err(glue->dev, "can't allocate platform_device"); -- ret = -ENOMEM; --- goto out_free_glue; --+ goto out_free_pdata; -- } -- -- glue->core->dev.parent = &func->dev; --@@ -313,6 +369,9 @@ static int wl1271_probe(struct sdio_func -- out_dev_put: -- platform_device_put(glue->core); -- --+out_free_pdata: --+ del_platform_data(pdev_data->pdata); --+ -- out_free_glue: -- kfree(glue); -- --@@ -323,11 +382,14 @@ out: -- static void wl1271_remove(struct sdio_func *func) -- { -- struct wl12xx_sdio_glue *glue = sdio_get_drvdata(func); --+ struct wlcore_platdev_data *pdev_data = glue->core->dev.platform_data; --+ struct wl12xx_platform_data *pdata = pdev_data->pdata; -- -- /* Undo decrement done above in wl1271_probe */ -- pm_runtime_get_noresume(&func->dev); -- -- platform_device_unregister(glue->core); --+ del_platform_data(pdata); -- kfree(glue); -- } -- -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 ---- a/package/kernel/mac80211/patches/910-01-add-support-for-mt7620.patch -+++ b/package/kernel/mac80211/patches/910-01-add-support-for-mt7620.patch -@@ -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 - rt2800_bbp_write(rt2x00dev, 196, (rf->channel <= 14) ? 0x19 : 0x7F); - } - -@@ -258,6 +258,7 @@ - + u32 mac_sys_ctrl, mac_status; - + u32 tx_pin = 0x00150F0F; - + struct hw_mode_spec *spec = &rt2x00dev->spec; -++ struct rt2800_drv_data *drv_data = rt2x00dev->drv_data; - + - + /* Frequeny plan setting */ - + /* -@@ -383,7 +384,6 @@ - + rfcsr &= (~0x4); - + rt2800_rfcsr_write(rt2x00dev, 28, rfcsr); - + --+ struct rt2800_drv_data *drv_data = rt2x00dev->drv_data; - + /*if (bScan == FALSE)*/ - + if (conf_is_ht40(conf)) { - + txrx_agc_fc = rt2x00_get_field8(drv_data->calibration_bw40, -@@ -523,7 +523,7 @@ - static void rt2800_bbp_write_with_rx_chain(struct rt2x00_dev *rt2x00dev, - 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 - struct channel_info *info) - { - u32 reg; -@@ -532,7 +532,7 @@ - u8 bbp, rfcsr; - - 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 - case RF5592: - rt2800_config_channel_rf55xx(rt2x00dev, conf, rf, info); - break; -@@ -542,7 +542,7 @@ - default: - 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 - else if (rt2x00_rt(rt2x00dev, RT3593) || - rt2x00_rt(rt2x00dev, RT3883)) - rt2800_bbp_write(rt2x00dev, 82, 0x82); -@@ -551,7 +551,7 @@ - rt2800_bbp_write(rt2x00dev, 82, 0xf2); - - 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 - if (rt2x00_rt(rt2x00dev, RT3572)) - rt2800_rfcsr_write(rt2x00dev, 8, 0); - -@@ -560,7 +560,7 @@ - - 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 - - rt2x00_set_field32(&tx_pin, TX_PIN_CFG_RFTR_EN, 1); - rt2x00_set_field32(&tx_pin, TX_PIN_CFG_TRSW_EN, 1); -@@ -568,7 +568,7 @@ - - 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 - rt2x00_set_field8(&rfcsr, RFCSR3_VCOCAL_EN, 1); - rt2800_rfcsr_write(rt2x00dev, 3, rfcsr); - break; -@@ -583,7 +583,7 @@ - default: - return; - } --@@ -5125,9 +5516,42 @@ static int rt2800_init_registers(struct -+@@ -5101,9 +5492,42 @@ static int rt2800_init_registers(struct - } else if (rt2x00_rt(rt2x00dev, RT5390) || - rt2x00_rt(rt2x00dev, RT5392) || - rt2x00_rt(rt2x00dev, RT5592)) { -@@ -629,7 +629,7 @@ - } else if (rt2x00_rt(rt2x00dev, RT5350)) { - 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 - rt2800_bbp_write(rt2x00dev, 103, 0xc0); - } - -@@ -855,7 +855,7 @@ - static void rt2800_init_bbp(struct rt2x00_dev *rt2x00dev) - { - 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 - return; - case RT5390: - case RT5392: -@@ -867,7 +867,7 @@ - break; - 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 - rt2800_led_open_drain_enable(rt2x00dev); - } - -@@ -875,6 +875,8 @@ - +{ - + u16 freq; - + u8 rfvalue; -++ struct hw_mode_spec *spec = &rt2x00dev->spec; -++ - + /* Initialize RF central register to default value */ - + rt2800_rfcsr_write(rt2x00dev, 0, 0x02); - + rt2800_rfcsr_write(rt2x00dev, 1, 0x03); -@@ -921,7 +923,6 @@ - + rt2800_rfcsr_write(rt2x00dev, 42, 0x5B); - + rt2800_rfcsr_write(rt2x00dev, 43, 0x00); - + --+ struct hw_mode_spec *spec = &rt2x00dev->spec; - + rt2800_rfcsr_write(rt2x00dev, 11, 0x21); - + if (spec->clk_is_20mhz) - + rt2800_rfcsr_write(rt2x00dev, 13, 0x03); -@@ -1163,7 +1164,7 @@ - static void rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev) - { - 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 - rt2800_init_rfcsr_5350(rt2x00dev); - break; - case RT5390: -@@ -1175,7 +1176,7 @@ - break; - 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 - case RF5390: - case RF5392: - case RF5592: -@@ -1183,7 +1184,7 @@ - break; - 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 - case RF5372: - case RF5390: - case RF5392: -@@ -1191,7 +1192,7 @@ - spec->num_channels = 14; - 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 - case RF5372: - case RF5390: - case RF5392: -diff --git a/package/kernel/mac80211/patches/920-ath10k_allow_fallback_to_board_bin_on_empty_otp_stream.patch b/package/kernel/mac80211/patches/920-ath10k_allow_fallback_to_board_bin_on_empty_otp_stream.patch -deleted file mode 100644 -index 4c04d4f..0000000 ---- a/package/kernel/mac80211/patches/920-ath10k_allow_fallback_to_board_bin_on_empty_otp_stream.patch -+++ /dev/null -@@ -1,20 +0,0 @@ ----- a/drivers/net/wireless/ath/ath10k/core.c --+++ b/drivers/net/wireless/ath/ath10k/core.c --@@ -387,9 +387,14 @@ static int ath10k_download_and_run_otp(s -- -- ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot otp execute result %d\n", result); -- --- if (!skip_otp && result != 0) { --- ath10k_err(ar, "otp calibration failed: %d", result); --- return -EINVAL; --+ if (!skip_otp) { --+ if (result == 2) { --+ ath10k_warn(ar, "otp stream is empty, using board.bin contents"); --+ return 0; --+ } else if (result != 0) { --+ ath10k_err(ar, "otp calibration failed: %d", result); --+ return -EINVAL; --+ } -- } -- -- 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 ---- 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 - - --- 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 * - 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 ---- 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 - return arvif_iter.arvif; - } - -@@ -22,7 +22,7 @@ - int ath10k_mac_register(struct ath10k *ar) - { - 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 - 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 ---- /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 -+ -+ priv->running_bsses = 0; -+ -++ wait_for_completion(&priv->firmware_loading_complete); -++ -+ return rc; -+ -+ err_stop_firmware: -+@@ -6294,8 +6296,6 @@ static void mwl8k_remove(struct pci_dev -+ return; -+ priv = hw->priv; -+ -+- wait_for_completion(&priv->firmware_loading_complete); -+- -+ if (priv->fw_state == FW_STATE_ERROR) { -+ mwl8k_hw_reset(priv); -+ goto unmap; diff --git a/patches/openwrt/0022-hostapd-work-around-unconditional-libopenssl-build-dependency.patch b/patches/openwrt/0022-hostapd-work-around-unconditional-libopenssl-build-dependency.patch index 289a94a1..0d51e607 100644 --- a/patches/openwrt/0022-hostapd-work-around-unconditional-libopenssl-build-dependency.patch +++ b/patches/openwrt/0022-hostapd-work-around-unconditional-libopenssl-build-dependency.patch @@ -8,7 +8,7 @@ not only wpad-mesh. Fix this by applying the same workaround as in ustream-ssl. diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile -index c16cb11..c39b6b4 100644 +index 3dff7b4..d86bb43 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -177,7 +177,7 @@ endef From bccf4f7b21202f7dbca683844102680ac6cbf749 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Litza Date: Wed, 2 Sep 2015 21:25:18 +0200 Subject: [PATCH 097/867] gluon-mesh-batman-adv-core: Add lua code for iface listing, don't fork --- .../files/lib/gluon/announce/neighbours.d/wifi | 5 ++--- .../nodeinfo.d/network/mesh/bat0/interfaces | 6 +++--- .../announce/nodeinfo.d/network/mesh_interfaces | 6 +++--- .../files/lib/gluon/announce/statistics.d/gateway | 4 +--- .../files/usr/lib/lua/gluon/batman_adv.lua | 15 +++++++++++++++ 5 files changed, 24 insertions(+), 12 deletions(-) create mode 100644 package/gluon-mesh-batman-adv-core/files/usr/lib/lua/gluon/batman_adv.lua 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 index bbe5fc96..1be59f8b 100644 --- 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 @@ -1,3 +1,4 @@ +local batman_adv = require 'gluon.batman_adv' local iwinfo = require 'iwinfo' function neighbours(iface) @@ -16,8 +17,7 @@ end function interfaces() local interfaces = {} - local popen = io.popen('exec batctl if') - for ifname in popen:read('*a'):gmatch('([^%s]+): active') do + 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) @@ -26,7 +26,6 @@ function interfaces() end end) end - popen:close() return interfaces end 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 index b1d30efe..6f63af2f 100644 --- 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 @@ -1,3 +1,5 @@ +local batman_adv = require 'gluon.batman_adv' + local wireless = {} local tunnel = {} local other = {} @@ -36,8 +38,7 @@ local function nil_table(t) end end -local popen = io.popen('exec batctl if') -for ifname in popen:read('*a'):gmatch('([^%s]+): active') do +for ifname in batman_adv.interfaces('bat0') do if is_wireless(ifname) then get_address(wireless, ifname) elseif is_tuntap(ifname) then @@ -46,7 +47,6 @@ for ifname in popen:read('*a'):gmatch('([^%s]+): active') do get_address(other, ifname) end end -popen:close() return { wireless = nil_table(wireless), 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 index c69ca4ef..0d66d603 100644 --- 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 @@ -1,13 +1,13 @@ +local batman_adv = require 'gluon.batman_adv' + local interfaces = {} -local popen = io.popen('exec batctl if') -for ifname in popen:read('*a'):gmatch('([^%s]+): active') do +for ifname in batman_adv.interfaces('bat0') do pcall( function() table.insert(interfaces, util.readline(io.open('/sys/class/net/' .. ifname .. '/address'))) end ) end -popen:close() return interfaces 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 index 67623b0c..b1909cf6 100644 --- 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 @@ -1,13 +1,11 @@ local gateway = '' -local popen = io.popen("exec batctl -m bat0 gateways") -for line in popen:lines() do +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 -popen:close() if gateway ~= '' then return gateway diff --git a/package/gluon-mesh-batman-adv-core/files/usr/lib/lua/gluon/batman_adv.lua b/package/gluon-mesh-batman-adv-core/files/usr/lib/lua/gluon/batman_adv.lua new file mode 100644 index 00000000..cd559fe5 --- /dev/null +++ b/package/gluon-mesh-batman-adv-core/files/usr/lib/lua/gluon/batman_adv.lua @@ -0,0 +1,15 @@ +local nixio = require 'nixio' + +module 'gluon.batman_adv' + +function interfaces(bat_if) + local iter = nixio.fs.glob('/sys/class/net/' .. bat_if .. '/lower_*') + return function() + local path = iter() + if path == nil then + return nil + end + local ifname = path:match('/lower_([^/]+)$') + return ifname + end +end From 40a1a3c16cf5a32079745a8f96f4577df945aeed Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Wed, 2 Sep 2015 18:39:46 +0200 Subject: [PATCH 098/867] odhcp6c: minor fixes --- .../openwrt/0027-odhcp6c-minor-fixes.patch | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 patches/openwrt/0027-odhcp6c-minor-fixes.patch diff --git a/patches/openwrt/0027-odhcp6c-minor-fixes.patch b/patches/openwrt/0027-odhcp6c-minor-fixes.patch new file mode 100644 index 00000000..2b0a56b8 --- /dev/null +++ b/patches/openwrt/0027-odhcp6c-minor-fixes.patch @@ -0,0 +1,77 @@ +From: Nils Schneider +Date: Thu, 3 Sep 2015 18:07:17 +0200 +Subject: odhcp6c: minor fixes + +Better synchronize RA & DHCPv6 events +Accumulate some events to avoid flooding +Restart softwires for address and prefix changes + +Signed-off-by: Steven Barth + +diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile +index 75de54c..aa81e02 100644 +--- a/package/network/ipv6/odhcp6c/Makefile ++++ b/package/network/ipv6/odhcp6c/Makefile +@@ -8,14 +8,14 @@ + include $(TOPDIR)/rules.mk + + PKG_NAME:=odhcp6c +-PKG_VERSION:=2015-07-18 ++PKG_VERSION:=2015-07-29 + PKG_RELEASE=$(PKG_SOURCE_VERSION) + + PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 + PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) + PKG_SOURCE_URL:=https://github.com/sbyx/odhcp6c.git + PKG_SOURCE_PROTO:=git +-PKG_SOURCE_VERSION:=024525798c5f6aba3af9b2ef7b3af2f3c14f1db8 ++PKG_SOURCE_VERSION:=dc186d6d2b0dd4ad23ca5fc69c00e81f796ff6d9 + PKG_MAINTAINER:=Steven Barth + PKG_LICENSE:=GPL-2.0 + +diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.script b/package/network/ipv6/odhcp6c/files/dhcpv6.script +index 33f6d9b..677d35f 100755 +--- a/package/network/ipv6/odhcp6c/files/dhcpv6.script ++++ b/package/network/ipv6/odhcp6c/files/dhcpv6.script +@@ -5,6 +5,8 @@ + + setup_interface () { + local device="$1" ++ local prefsig="" ++ local addrsig="" + proto_init_update "*" 1 + + # Merge RA-DNS +@@ -34,6 +36,7 @@ setup_interface () { + + for prefix in $PREFIXES; do + proto_add_ipv6_prefix "$prefix" ++ prefsig="$prefsig ${prefix%%,*}" + local entry="${prefix#*/}" + entry="${entry#*,}" + entry="${entry#*,}" +@@ -68,6 +71,7 @@ setup_interface () { + local valid="${entry%%,*}" + + proto_add_ipv6_address "$addr" "$mask" "$preferred" "$valid" 1 ++ addrsig="$addrsig $addr/$mask" + + if [ -z "$RA_ADDRESSES" -a -z "$RA_ROUTES" -a \ + -z "$RA_DNS" -a "$FAKE_ROUTES" = 1 ]; then +@@ -136,6 +140,8 @@ setup_interface () { + json_add_string ifname "@$INTERFACE" + json_add_string proto map + json_add_string type "$MAPTYPE" ++ json_add_string _prefsig "$prefsig" ++ [ "$MAPTYPE" = lw4o6 ] && json_add_string _addrsig "$addrsig" + json_add_string rule "$MAPRULE" + json_add_string tunlink "$INTERFACE" + [ -n "$ZONE_MAP" ] || ZONE_MAP=$ZONE +@@ -163,6 +169,7 @@ setup_interface () { + json_add_string ifname "@$INTERFACE" + json_add_string proto "464xlat" + json_add_string tunlink "$INTERFACE" ++ json_add_string _addrsig "$addrsig" + [ -n "$ZONE_464XLAT" ] || ZONE_464XLAT=$ZONE + [ -n "$ZONE_464XLAT" ] && json_add_string zone "$ZONE_464XLAT" + [ -n "$IFACE_464XLAT_DELEGATE" ] && json_add_boolean delegate "$IFACE_464XLAT_DELEGATE" From f0a6400d5d8acca4ff233c18f6c4c57fce5634b6 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 3 Sep 2015 22:03:46 +0200 Subject: [PATCH 099/867] Refresh OpenWrt patches --- ...-work-around-unconditional-libopenssl-build-dependency.patch | 2 +- ...odhcp6c-minor-fixes.patch => 0023-odhcp6c-minor-fixes.patch} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename patches/openwrt/{0027-odhcp6c-minor-fixes.patch => 0023-odhcp6c-minor-fixes.patch} (100%) diff --git a/patches/openwrt/0022-hostapd-work-around-unconditional-libopenssl-build-dependency.patch b/patches/openwrt/0022-hostapd-work-around-unconditional-libopenssl-build-dependency.patch index 0d51e607..289a94a1 100644 --- a/patches/openwrt/0022-hostapd-work-around-unconditional-libopenssl-build-dependency.patch +++ b/patches/openwrt/0022-hostapd-work-around-unconditional-libopenssl-build-dependency.patch @@ -8,7 +8,7 @@ not only wpad-mesh. Fix this by applying the same workaround as in ustream-ssl. diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile -index 3dff7b4..d86bb43 100644 +index c16cb11..c39b6b4 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -177,7 +177,7 @@ endef diff --git a/patches/openwrt/0027-odhcp6c-minor-fixes.patch b/patches/openwrt/0023-odhcp6c-minor-fixes.patch similarity index 100% rename from patches/openwrt/0027-odhcp6c-minor-fixes.patch rename to patches/openwrt/0023-odhcp6c-minor-fixes.patch From e3d89ee8c4ecf67892bd38cfe17116b9cf9a9495 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 3 Sep 2015 23:51:19 +0200 Subject: [PATCH 100/867] ath9k: add HSR tuner support for UniFi Outdoor Plus --- ...tuner-support-for-UniFi-Outdoor-Plus.patch | 399 ++++++++++++++++++ 1 file changed, 399 insertions(+) create mode 100644 patches/openwrt/0024-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch 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 new file mode 100644 index 00000000..98a85aaf --- /dev/null +++ b/patches/openwrt/0024-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch @@ -0,0 +1,399 @@ +From: Matthias Schiffer +Date: Thu, 3 Sep 2015 23:50:51 +0200 +Subject: ath9k: add HSR tuner support for UniFi Outdoor Plus + +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 +--- /dev/null ++++ b/package/kernel/mac80211/patches/931-ubnt-uap-plus-hsr.patch +@@ -0,0 +1,353 @@ ++--- a/drivers/net/wireless/ath/ath9k/channel.c +++++ b/drivers/net/wireless/ath/ath9k/channel.c ++@@ -15,6 +15,8 @@ ++ */ ++ ++ #include "ath9k.h" +++#include +++#include "hsr.h" ++ ++ /* Set/change channels. If the channel is really being changed, it's done ++ * by reseting the chip. To accomplish this we must first cleanup any pending ++@@ -22,6 +24,7 @@ ++ */ ++ static int ath_set_channel(struct ath_softc *sc) ++ { +++ struct ath9k_platform_data *pdata = sc->dev->platform_data; ++ struct ath_hw *ah = sc->sc_ah; ++ struct ath_common *common = ath9k_hw_common(ah); ++ struct ieee80211_hw *hw = sc->hw; ++@@ -41,6 +44,11 @@ static int ath_set_channel(struct ath_so ++ ath_dbg(common, CONFIG, "Set channel: %d MHz width: %d\n", ++ chan->center_freq, chandef->width); ++ +++ if (pdata && pdata->ubnt_hsr) { +++ hsr_enable(ah, chandef->width, chan->center_freq); +++ hsr_status(ah); +++ } +++ ++ /* update survey stats for the old channel before switching */ ++ spin_lock_bh(&common->cc_lock); ++ ath_update_survey_stats(sc); ++--- /dev/null +++++ b/drivers/net/wireless/ath/ath9k/hsr.c ++@@ -0,0 +1,220 @@ +++/* +++ * +++ * The MIT License (MIT) +++ * +++ * Copyright (c) 2015 Kirill Berezin +++ * +++ * Permission is hereby granted, free of charge, to any person obtaining a copy +++ * of this software and associated documentation files (the "Software"), to deal +++ * in the Software without restriction, including without limitation the rights +++ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +++ * copies of the Software, and to permit persons to whom the Software is +++ * furnished to do so, subject to the following conditions: +++ * +++ * The above copyright notice and this permission notice shall be included in all +++ * copies or substantial portions of the Software. +++ * +++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +++ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +++ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +++ * SOFTWARE. +++ * +++ */ +++ +++#include +++#include +++#include +++#include +++#include +++#include +++#include +++#include +++ +++#include "hw.h" +++#include "ath9k.h" +++ +++#define HSR_GPIO_CSN 8 +++#define HSR_GPIO_CLK 6 +++#define HSR_GPIO_DOUT 7 +++#define HSR_GPIO_DIN 5 +++ +++/* delays are in useconds */ +++#define HSR_DELAY_HALF_TICK 100 +++#define HSR_DELAY_PRE_WRITE 75 +++#define HSR_DELAY_FINAL 20000 +++#define HSR_DELAY_TRAILING 200 +++ +++ +++void hsr_init(struct ath_hw* ah) { +++ ath9k_hw_cfg_gpio_input(ah, HSR_GPIO_DIN); +++ ath9k_hw_cfg_output(ah, HSR_GPIO_CSN, AR_GPIO_OUTPUT_MUX_AS_OUTPUT); +++ ath9k_hw_cfg_output(ah, HSR_GPIO_CLK, AR_GPIO_OUTPUT_MUX_AS_OUTPUT); +++ ath9k_hw_cfg_output(ah, HSR_GPIO_DOUT, AR_GPIO_OUTPUT_MUX_AS_OUTPUT); +++ +++ ath9k_hw_set_gpio(ah, HSR_GPIO_CSN, 1); +++ ath9k_hw_set_gpio(ah, HSR_GPIO_CLK, 0); +++ ath9k_hw_set_gpio(ah, HSR_GPIO_DOUT, 0); +++ +++ udelay(HSR_DELAY_TRAILING); +++} +++ +++static u32 hsr_write_byte(struct ath_hw* ah, int delay, u32 value){ +++ struct ath_common *common = ath9k_hw_common(ah); +++ int i; +++ u32 rval = 0; +++ +++ udelay(delay); +++ +++ ath9k_hw_set_gpio(ah, HSR_GPIO_CLK, 0); +++ udelay(HSR_DELAY_HALF_TICK); +++ +++ ath9k_hw_set_gpio(ah, HSR_GPIO_CSN, 0); +++ udelay(HSR_DELAY_HALF_TICK); +++ +++ for( i = 0; i < 8; ++i) { +++ rval = rval << 1; +++ +++ // pattern is left to right, that is 7-th bit runs first +++ ath9k_hw_set_gpio(ah, HSR_GPIO_DOUT, (value >> (7 - i)) & 0x1); +++ udelay(HSR_DELAY_HALF_TICK); +++ +++ ath9k_hw_set_gpio(ah, HSR_GPIO_CLK, 1); +++ udelay(HSR_DELAY_HALF_TICK); +++ +++ rval |= ath9k_hw_gpio_get(ah, HSR_GPIO_DIN); +++ +++ ath9k_hw_set_gpio(ah, HSR_GPIO_CLK, 0); +++ udelay(HSR_DELAY_HALF_TICK); +++ } +++ +++ ath9k_hw_set_gpio(ah, HSR_GPIO_CSN, 1); +++ udelay(HSR_DELAY_HALF_TICK); +++ +++ ath_dbg(common, CONFIG, "hsr_write_byte: write byte %d return value is %d %c\n", +++ value, rval, rval > 32 ? rval : '-'); +++ +++ return rval & 0xff; +++} +++ +++static int hsr_write_a_chain(struct ath_hw* ah, char* chain, int items) { +++ int i = 0; +++ int status = 0; +++ +++ // a preamble +++ hsr_write_byte(ah, HSR_DELAY_PRE_WRITE, 0); +++ status = hsr_write_byte(ah, HSR_DELAY_PRE_WRITE, 0); +++ +++ // clear HSR's reply buffer +++ if (status) { +++ int loop = 0; +++ for ( loop = 0; (loop < 42) && status; ++loop) { +++ status = hsr_write_byte(ah, HSR_DELAY_PRE_WRITE, 0); +++ } +++ if ( loop >= 42) { +++ ATH_DBG_WARN(1, "hsr_write_a_chain: can't clear an output buffer after a 42 cycles.\n"); +++ return -1; +++ } +++ } +++ +++ for ( i =0; (i < items) && ( 0 != chain[i]); ++i) { +++ hsr_write_byte(ah, HSR_DELAY_PRE_WRITE, (u32)chain[i]); +++ } +++ +++ hsr_write_byte(ah, HSR_DELAY_PRE_WRITE, 0); +++ mdelay(HSR_DELAY_FINAL / 1000); +++ +++ // reply +++ memset(chain, 0, items); +++ +++ hsr_write_byte(ah, HSR_DELAY_PRE_WRITE, 0); +++ udelay(HSR_DELAY_TRAILING); +++ +++ for ( i = 0; i < (items - 1); ++i) { +++ u32 ret; +++ if ( 0 != (ret = hsr_write_byte(ah, HSR_DELAY_PRE_WRITE, 0))) { +++ chain[i] = (char)ret; +++ } else { +++ break; +++ } +++ udelay(HSR_DELAY_TRAILING); +++ } +++ +++ return (1 < i) ? simple_strtol(chain + 1, NULL, 10) : 0; +++} +++ +++int hsr_disable(struct ath_hw* ah) { +++ char cmd[10] = {'b', '4', '0', 0, 0, 0, 0, 0, 0, 0}; +++ int ret; +++ +++ ret = hsr_write_a_chain(ah, cmd, sizeof(cmd)); +++ if ( (ret > 0) && (*cmd == 'B')) { +++ return 0; +++ } +++ +++ return -1; +++} +++ +++int hsr_enable(struct ath_hw* ah, int bw, int fq) { +++ char cmd[10]; +++ int ret; +++ +++ /* Bandwidth argument is 0 sometimes. Assume default 802.11bgn +++ 20MHz on invalid values */ +++ if ( (bw != 5) && (bw != 10) && (bw != 20) && (bw != 40)) { +++ bw = 20; +++ } +++ +++ memset(cmd, 0, sizeof(cmd)); +++ *cmd = 'b'; // 98 +++ snprintf(cmd + 1, 3, "%02d", bw); +++ +++ ret = hsr_write_a_chain(ah, cmd, sizeof(cmd)); +++ if ( (*cmd != 'B') || (ret != bw)) { +++ ATH_DBG_WARN(1, "hsr_enable: failed changing bandwidth -> set (%d,%d) reply (%d, %d) \n", 'b', bw, *cmd, ret); +++ return -1; +++ } +++ +++ memset(cmd, 0, sizeof(cmd)); +++ *cmd = 'x'; // 120 +++ ret = hsr_write_a_chain(ah, cmd, sizeof(cmd)); +++ if ( *cmd != 'X') { +++ ATH_DBG_WARN(1, "hsr_enable: failed 'x' command -> reply (%d, %d) \n", *cmd, ret); +++ return -1; +++ } +++ +++ memset(cmd, 0, sizeof(cmd)); +++ *cmd = 'm'; // 109 +++ ret = hsr_write_a_chain(ah, cmd, sizeof(cmd)); +++ if ( *cmd != 'M') { +++ ATH_DBG_WARN(1, "hsr_enable: failed 'm' command -> reply (%d, %d) \n", *cmd, ret); +++ return -1; +++ } +++ +++ memset(cmd, 0, sizeof(cmd)); +++ *cmd = 'f'; // 102 +++ snprintf(cmd + 1, 6, "%05d", fq); +++ ret = hsr_write_a_chain(ah, cmd, sizeof(cmd)); +++ if ( (*cmd != 'F') && (ret != fq)) { +++ ATH_DBG_WARN(1, "hsr_enable: failed set frequency -> reply (%d, %d) \n", *cmd, ret); +++ return -1; +++ } +++ +++ return 0; +++} +++ +++int hsr_status(struct ath_hw* ah) { +++ char cmd[10] = {'s', 0, 0, 0, 0, 0, 0, 0, 0, 0}; // 115 +++ int ret; +++ +++ ret = hsr_write_a_chain(ah, cmd, sizeof(cmd)); +++ if ( (*cmd != 'S')) { +++ ATH_DBG_WARN(1, "hsr_status: returned %d,%d \n", *cmd, ret); +++ return -1; +++ } +++ +++ return 0; +++} +++ ++--- /dev/null +++++ b/drivers/net/wireless/ath/ath9k/hsr.h ++@@ -0,0 +1,40 @@ +++/* +++ * The MIT License (MIT) +++ * +++ * Copyright (c) 2015 Kirill Berezin +++ * +++ * Permission is hereby granted, free of charge, to any person obtaining a copy +++ * of this software and associated documentation files (the "Software"), to deal +++ * in the Software without restriction, including without limitation the rights +++ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +++ * copies of the Software, and to permit persons to whom the Software is +++ * furnished to do so, subject to the following conditions: +++ * +++ * The above copyright notice and this permission notice shall be included in all +++ * copies or substantial portions of the Software. +++ * +++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +++ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +++ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +++ * SOFTWARE. +++ */ +++ +++#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 +++++ b/drivers/net/wireless/ath/ath9k/main.c ++@@ -16,8 +16,10 @@ ++ ++ #include ++ #include +++#include ++ #include "ath9k.h" ++ #include "btcoex.h" +++#include "hsr.h" ++ ++ u8 ath9k_parse_mpdudensity(u8 mpdudensity) ++ { ++@@ -652,6 +654,7 @@ void ath_reset_work(struct work_struct * ++ static int ath9k_start(struct ieee80211_hw *hw) ++ { ++ struct ath_softc *sc = hw->priv; +++ struct ath9k_platform_data *pdata = sc->dev->platform_data; ++ struct ath_hw *ah = sc->sc_ah; ++ struct ath_common *common = ath9k_hw_common(ah); ++ struct ieee80211_channel *curchan = sc->cur_chan->chandef.chan; ++@@ -730,6 +733,11 @@ static int ath9k_start(struct ieee80211_ ++ (ah->config.led_active_high) ? 1 : 0); ++ } ++ +++ if (pdata && pdata->ubnt_hsr) { +++ hsr_init(ah); +++ hsr_disable(ah); +++ } +++ ++ /* ++ * Reset key cache to sane defaults (all entries cleared) instead of ++ * semi-random values after suspend/resume. ++--- a/drivers/net/wireless/ath/ath9k/Makefile +++++ b/drivers/net/wireless/ath/ath9k/Makefile ++@@ -6,7 +6,8 @@ ath9k-y += beacon.o \ ++ xmit.o \ ++ link.o \ ++ antenna.o \ ++- channel.o +++ channel.o \ +++ hsr.o ++ ++ ath9k-$(CPTCFG_ATH9K_BTCOEX_SUPPORT) += mci.o ++ ath9k-$(CPTCFG_ATH9K_PCI) += pci.o ++--- a/include/linux/ath9k_platform.h +++++ b/include/linux/ath9k_platform.h ++@@ -44,6 +44,8 @@ struct ath9k_platform_data { ++ ++ int num_leds; ++ const struct gpio_led *leds; +++ +++ bool ubnt_hsr; ++ }; ++ ++ #endif /* _LINUX_ATH9K_PLATFORM_H */ +diff --git a/target/linux/ar71xx/patches-3.18/608-MIPS-ath79-ubnt-xm-add-more-boards.patch b/target/linux/ar71xx/patches-3.18/608-MIPS-ath79-ubnt-xm-add-more-boards.patch +index 7803513..d865ed2 100644 +--- a/target/linux/ar71xx/patches-3.18/608-MIPS-ath79-ubnt-xm-add-more-boards.patch ++++ b/target/linux/ar71xx/patches-3.18/608-MIPS-ath79-ubnt-xm-add-more-boards.patch +@@ -254,6 +254,7 @@ + + ath79_register_eth(0); + + ath79_register_eth(1); + + +++ ap9x_pci_get_wmac_data(0)->ubnt_hsr = true; + + ap91_pci_init(ee, NULL); + + + + ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_unifi_outdoor_plus_leds_gpio), +diff --git a/target/linux/generic/patches-3.18/150-ath9k_ubnt_hsr_filter.patch b/target/linux/generic/patches-3.18/150-ath9k_ubnt_hsr_filter.patch +new file mode 100644 +index 0000000..a0ebbc7 +--- /dev/null ++++ b/target/linux/generic/patches-3.18/150-ath9k_ubnt_hsr_filter.patch +@@ -0,0 +1,16 @@ ++Flag that this platform is an Ubiquiti UniFi Outdoor Plus ++containing a RF filter in ath9k's receive path. ++ ++Signed-off-by: Stefan Rompf ++ ++--- a/include/linux/ath9k_platform.h +++++ b/include/linux/ath9k_platform.h ++@@ -44,6 +44,8 @@ struct ath9k_platform_data { ++ ++ int num_leds; ++ const struct gpio_led *leds; +++ +++ bool ubnt_hsr; ++ }; ++ ++ #endif /* _LINUX_ATH9K_PLATFORM_H */ From 961e6cc1c04f74d13dc332c1ac354516c17de810 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Litza Date: Tue, 1 Sep 2015 16:27:05 +0200 Subject: [PATCH 101/867] Add sink support to luci-lib-jsonc and use it where needed --- .../lib/gluon/announce/statistics.d/mesh_vpn | 2 +- .../lib/gluon/status-page/www/cgi-bin/status | 2 +- ...nc-Add-ltn12-compatible-sink-factory.patch | 133 ++++++++++++++++++ 3 files changed, 135 insertions(+), 2 deletions(-) create mode 100644 patches/packages/luci/0007-luci-lib-jsonc-Add-ltn12-compatible-sink-factory.patch 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 index 0d6d66f0..e4e3c63d 100644 --- 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 @@ -12,7 +12,7 @@ if not fastd_sock:connect(socket_path) then end local decoder = json.new() -ltn12.pump.all(ltn12.source.file(fastd_sock), function(chunk) decoder:parse(chunk) end) +ltn12.pump.all(ltn12.source.file(fastd_sock), decoder:sink()) local status = decoder:get() diff --git a/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/status b/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/status index fe4ba0af..e92efd0e 100755 --- a/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/status +++ b/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/status @@ -94,7 +94,7 @@ local stat, fastd_status = pcall( assert(fastd_sock:connect('/var/run/fastd.mesh_vpn.socket')) decoder = json.new() - ltn12.pump.all(ltn12.source.file(fastd_sock), function(chunk) decoder:parse(chunk) end) + ltn12.pump.all(ltn12.source.file(fastd_sock), decoder:sink()) return decoder:get() end ) diff --git a/patches/packages/luci/0007-luci-lib-jsonc-Add-ltn12-compatible-sink-factory.patch b/patches/packages/luci/0007-luci-lib-jsonc-Add-ltn12-compatible-sink-factory.patch new file mode 100644 index 00000000..34c51c17 --- /dev/null +++ b/patches/packages/luci/0007-luci-lib-jsonc-Add-ltn12-compatible-sink-factory.patch @@ -0,0 +1,133 @@ +From: Jan-Philipp Litza +Date: Tue, 1 Sep 2015 16:17:23 +0200 +Subject: luci-lib-jsonc: Add ltn12-compatible sink factory + +To use the luci-lib-jsonc parser as sink for an ltn12 pump (for example +from stdin), the following code will now do: + + require 'luci.ltn12' + require 'luci.jsonc' + + local parser = luci.jsonc.new() + luci.ltn12.pump.all(luci.ltn12.source.file(io.input()), parser:sink()) + print(parser:get()) + +Signed-off-by: Jan-Philipp Litza + +diff --git a/libs/luci-lib-jsonc/src/jsonc.c b/libs/luci-lib-jsonc/src/jsonc.c +index b857c97..ef11101 100644 +--- a/libs/luci-lib-jsonc/src/jsonc.c ++++ b/libs/luci-lib-jsonc/src/jsonc.c +@@ -328,6 +328,76 @@ static int json_parse_set(lua_State *L) + return 0; + } + ++static int json_parse_sink_closure(lua_State *L) ++{ ++ bool finished = lua_toboolean(L, lua_upvalueindex(2)); ++ if (lua_isnil(L, 1)) ++ { ++ // no more data available ++ if (finished) ++ { ++ // we were finished parsing ++ lua_pushboolean(L, true); ++ return 1; ++ } ++ else ++ { ++ lua_pushnil(L); ++ lua_pushstring(L, "Incomplete JSON data"); ++ return 2; ++ } ++ } ++ else ++ { ++ if (finished) ++ { ++ lua_pushnil(L); ++ lua_pushstring(L, "Unexpected data after complete JSON object"); ++ return 2; ++ } ++ else ++ { ++ // luci.jsonc.parser.chunk() ++ lua_pushcfunction(L, json_parse_chunk); ++ // parser object from closure ++ lua_pushvalue(L, lua_upvalueindex(1)); ++ // chunk ++ lua_pushvalue(L, 1); ++ lua_call(L, 2, 2); ++ ++ if (lua_isnil(L, -2)) ++ { ++ // an error occurred, leave (nil, errmsg) on the stack and return it ++ return 2; ++ } ++ else if (lua_toboolean(L, -2)) ++ { ++ // finished reading, set finished=true and return nil to prevent further input ++ lua_pop(L, 2); ++ lua_pushboolean(L, true); ++ lua_replace(L, lua_upvalueindex(2)); ++ lua_pushnil(L); ++ return 1; ++ } ++ else ++ { ++ // not finished reading, return true ++ lua_pop(L, 2); ++ lua_pushboolean(L, true); ++ return 1; ++ } ++ } ++ } ++} ++ ++static int json_parse_sink(lua_State *L) ++{ ++ luaL_checkudata(L, 1, LUCI_JSONC_PARSER); ++ lua_pushboolean(L, false); ++ lua_pushcclosure(L, json_parse_sink_closure, 2); ++ return 1; ++} ++ + static int json_tostring(lua_State *L) + { + struct json_state *s = luaL_checkudata(L, 1, LUCI_JSONC_PARSER); +@@ -367,6 +437,7 @@ static const luaL_reg jsonc_parser_methods[] = { + { "parse", json_parse_chunk }, + { "get", json_parse_get }, + { "set", json_parse_set }, ++ { "sink", json_parse_sink }, + { "stringify", json_tostring }, + + { "__gc", json_gc }, +diff --git a/libs/luci-lib-jsonc/src/jsonc.luadoc b/libs/luci-lib-jsonc/src/jsonc.luadoc +index 2ee9ceb..720b17d 100644 +--- a/libs/luci-lib-jsonc/src/jsonc.luadoc ++++ b/libs/luci-lib-jsonc/src/jsonc.luadoc +@@ -121,10 +121,22 @@ parser:set({ "some", "data" })` + ]] + + ---[[ +-Serialize current parser state as JSON. ++Generate an ltn12-compatible sink. + + @class function + @sort 4 ++@name parser.sink ++@return Returns a function that can be used as an ltn12 sink. ++@usage `parser = luci.jsonc.new() ++ltn12.pump.all(ltn12.source.file(io.input()), parser:sink()) ++print(parser:get())` ++]] ++ ++---[[ ++Serialize current parser state as JSON. ++ ++@class function ++@sort 5 + @name parser.stringify + @param pretty A boolean value indicating whether the resulting JSON should be pretty printed. + @return Returns the serialized JSON data of this parser instance. From 7c6703d84b22bbe1b95a740ceab4996f1ed3e741 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Mon, 17 Aug 2015 20:59:29 +0200 Subject: [PATCH 102/867] luci.model.uci: add add_to_set / remove_from_set --- ...l.uci-add-add_to_set-remove_from_set.patch | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 patches/packages/luci/0005-model.uci-add-add_to_set-remove_from_set.patch diff --git a/patches/packages/luci/0005-model.uci-add-add_to_set-remove_from_set.patch b/patches/packages/luci/0005-model.uci-add-add_to_set-remove_from_set.patch new file mode 100644 index 00000000..6c998311 --- /dev/null +++ b/patches/packages/luci/0005-model.uci-add-add_to_set-remove_from_set.patch @@ -0,0 +1,103 @@ +From: Nils Schneider +Date: Mon, 17 Aug 2015 20:39:58 +0200 +Subject: model.uci: add add_to_set / remove_from_set + +Adds two functions to simplify working with UCI lists: + +- add_to_set, which ensures a given value will be present in a list, and +- remove_from_set, which removes a value from list. + +I've called these methods "set" because they treat the list as a set, +i.e. duplicated values will be removed. Also, order is not preserved. + +Signed-off-by: Nils Schneider + +diff --git a/modules/luci-base/luasrc/model/uci.lua b/modules/luci-base/luasrc/model/uci.lua +index 1659137..d35b9d7 100644 +--- a/modules/luci-base/luasrc/model/uci.lua ++++ b/modules/luci-base/luasrc/model/uci.lua +@@ -9,7 +9,7 @@ local table = require "table" + + local setmetatable, rawget, rawset = setmetatable, rawget, rawset + local require, getmetatable = require, getmetatable +-local error, pairs, ipairs = error, pairs, ipairs ++local error, pairs, ipairs, next = error, pairs, ipairs, next + local type, tostring, tonumber, unpack = type, tostring, tonumber, unpack + + -- The typical workflow for UCI is: Get a cursor instance from the +@@ -147,6 +147,40 @@ function Cursor.set_list(self, config, section, option, value) + return false + end + ++function Cursor.add_to_set(self, config, section, option, value, remove) ++ local list = self:get_list(config, section, option) ++ ++ if not list then ++ return false ++ end ++ ++ local set = {} ++ for _, l in ipairs(list) do ++ set[l] = true ++ end ++ ++ if remove then ++ set[value] = nil ++ else ++ set[value] = true ++ end ++ ++ list = {} ++ for k, _ in pairs(set) do ++ table.insert(list, k) ++ end ++ ++ if next(list) == nil then ++ return self:delete(config, section, option) ++ else ++ return self:set(config, section, option, list) ++ end ++end ++ ++function Cursor.remove_from_set(self, config, section, option, value) ++ self:add_to_set(config, section, option, value, true) ++end ++ + -- Return a list of initscripts affected by configuration changes. + function Cursor._affected(self, configlist) + configlist = type(configlist) == "table" and configlist or {configlist} +diff --git a/modules/luci-base/luasrc/model/uci.luadoc b/modules/luci-base/luasrc/model/uci.luadoc +index 1c20866..281bdb2 100644 +--- a/modules/luci-base/luasrc/model/uci.luadoc ++++ b/modules/luci-base/luasrc/model/uci.luadoc +@@ -116,6 +116,30 @@ Set given values as list. + ]] + + ---[[ ++Add a given value to a list of unique values. ++ ++@class function ++@name Cursor.add_to_set ++@param config UCI config ++@param section UCI section name ++@param option UCI option ++@param value UCI value ++@return Boolean whether operation succeeded ++]] ++ ++---[[ ++Remove a given value from a list of unique values. ++ ++@class function ++@name Cursor.add_to_set ++@param config UCI config ++@param section UCI section name ++@param option UCI option ++@param value UCI value ++@return Boolean whether operation succeeded ++]] ++ ++---[[ + Create a sub-state of this cursor. The sub-state is tied to the parent + + curser, means it the parent unloads or loads configs, the sub state will From 34752c7e0b41048967bb87faf4728719251f3fcc Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Mon, 17 Aug 2015 21:29:37 +0200 Subject: [PATCH 103/867] br-client: convert option ifname to list ifname Convert option ifname in br-client to use a list instead. This simplifies adding and remove interfaces: uci:add_to_set("network", "client", "ifname", "eth0") uci:remove_from_set("network", "client", "ifname", "eth0") An option ifname will be automatically converted to a list when performing an upgrade. Packages affected: gluon-mesh-batman-adv-core, gluon-luci-portconfig --- .../lua/luci/model/cbi/admin/portconfig.lua | 4 +-- .../310-gluon-mesh-batman-adv-core-mesh | 30 +++++++++++-------- ...340-gluon-mesh-batman-adv-core-mesh-on-lan | 4 +-- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/package/gluon-luci-portconfig/files/usr/lib/lua/luci/model/cbi/admin/portconfig.lua b/package/gluon-luci-portconfig/files/usr/lib/lua/luci/model/cbi/admin/portconfig.lua index 8166539c..5f6cc77f 100644 --- a/package/gluon-luci-portconfig/files/usr/lib/lua/luci/model/cbi/admin/portconfig.lua +++ b/package/gluon-luci-portconfig/files/usr/lib/lua/luci/model/cbi/admin/portconfig.lua @@ -122,9 +122,9 @@ function f.handle(self, state, data) uci:set("network", "mesh_lan", "auto", data.mesh_lan) if data.mesh_lan == '1' then - uci:set("network", "client", "ifname", "bat0") + uci:remove_from_set("network", "client", "ifname", sysconfig.lan_ifname) else - uci:set("network", "client", "ifname", sysconfig.lan_ifname .. " bat0") + uci:add_to_set("network", "client", "ifname", sysconfig.lan_ifname) end end diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh index 892ef102..b35aa010 100755 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh +++ b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh @@ -20,22 +20,28 @@ uci:commit('batman-adv') if not uci:get('network', 'client') then - local ifname + uci:section('network', 'interface', 'client', + { + type = 'bridge', + proto = 'dhcpv6', + reqprefix = 'no', + } + ) + + uci:add_to_set('network', 'client', 'ifname', 'bat0') if sysconfig.lan_ifname and not site.mesh_on_lan then - ifname = sysconfig.lan_ifname .. ' bat0' - else - ifname = 'bat0' + uci:add_to_set('network', 'client', 'ifname', sysconfig.lan_ifname) end +end - uci:section('network', 'interface', 'client', - { - ifname = ifname, - type = 'bridge', - proto = 'dhcpv6', - reqprefix = 'no', - } - ) +local ifname = uci:get('network', 'client', 'ifname') + +if type(ifname) == 'string' then + uci:delete('network', 'client', 'ifname') + for x in ifname:gmatch("[^%s]+") do + uci:add_to_set('network', 'client', 'ifname', x) + end end uci:set('network', 'client', 'igmp_snooping', 0) 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 d9831bfc..c3deea29 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 @@ -11,9 +11,9 @@ if sysconfig.lan_ifname and not uci:get('network', 'mesh_lan') then local enable = site.mesh_on_lan if enable then - local interfaces = uci:get('network', 'client', 'ifname') + local interfaces = uci:get_list('network', 'client', 'ifname') - if interfaces and lutil.contains(interfaces:split(' '), sysconfig.lan_ifname) then + if interfaces and lutil.contains(interfaces, sysconfig.lan_ifname) then enable = false end end From 5e5dc5ab1852d3753649236e5bdd7774b0f45556 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Mon, 18 Aug 2014 14:58:16 +0200 Subject: [PATCH 104/867] gluon-status-page: new status page --- package/gluon-status-page/Makefile | 34 ++- .../lib/gluon/status-page/www/index.html | 12 - .../gluon-status-page/iconfont-config.json | 100 +++++++ package/gluon-status-page/src/build.js | 10 + .../gluon-status-page/src/css/animation.css | 85 ++++++ package/gluon-status-page/src/css/font.css | 53 ++++ package/gluon-status-page/src/css/main.css | 171 +++++++++++ package/gluon-status-page/src/css/menu.css | 60 ++++ package/gluon-status-page/src/css/reset.css | 86 ++++++ package/gluon-status-page/src/index.html.m4 | 17 ++ package/gluon-status-page/src/js/lib/gui.js | 157 ++++++++++ .../gluon-status-page/src/js/lib/gui/menu.js | 39 +++ .../src/js/lib/gui/neighbours.js | 275 ++++++++++++++++++ .../src/js/lib/gui/nodeinfo.js | 54 ++++ .../src/js/lib/gui/signal.js | 48 +++ .../src/js/lib/gui/signalgraph.js | 137 +++++++++ .../src/js/lib/gui/statistics.js | 272 +++++++++++++++++ .../gluon-status-page/src/js/lib/helper.js | 71 +++++ .../src/js/lib/neighbourstream.js | 132 +++++++++ .../gluon-status-page/src/js/lib/streams.js | 66 +++++ package/gluon-status-page/src/js/main.js | 108 +++++++ 21 files changed, 1973 insertions(+), 14 deletions(-) delete mode 100644 package/gluon-status-page/files/lib/gluon/status-page/www/index.html create mode 100644 package/gluon-status-page/iconfont-config.json create mode 100644 package/gluon-status-page/src/build.js create mode 100644 package/gluon-status-page/src/css/animation.css create mode 100644 package/gluon-status-page/src/css/font.css create mode 100644 package/gluon-status-page/src/css/main.css create mode 100644 package/gluon-status-page/src/css/menu.css create mode 100644 package/gluon-status-page/src/css/reset.css create mode 100644 package/gluon-status-page/src/index.html.m4 create mode 100644 package/gluon-status-page/src/js/lib/gui.js create mode 100644 package/gluon-status-page/src/js/lib/gui/menu.js create mode 100644 package/gluon-status-page/src/js/lib/gui/neighbours.js create mode 100644 package/gluon-status-page/src/js/lib/gui/nodeinfo.js create mode 100644 package/gluon-status-page/src/js/lib/gui/signal.js create mode 100644 package/gluon-status-page/src/js/lib/gui/signalgraph.js create mode 100644 package/gluon-status-page/src/js/lib/gui/statistics.js create mode 100644 package/gluon-status-page/src/js/lib/helper.js create mode 100644 package/gluon-status-page/src/js/lib/neighbourstream.js create mode 100644 package/gluon-status-page/src/js/lib/streams.js create mode 100644 package/gluon-status-page/src/js/main.js diff --git a/package/gluon-status-page/Makefile b/package/gluon-status-page/Makefile index 2543ea2a..60a267cf 100644 --- a/package/gluon-status-page/Makefile +++ b/package/gluon-status-page/Makefile @@ -4,10 +4,33 @@ PKG_NAME:=gluon-status-page PKG_VERSION:=1 PKG_RELEASE:=1 -PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) +PKG_BUILD_DEPENDS:=node/host include $(INCLUDE_DIR)/package.mk +define Download/rjs + FILE:=r.js + URL:=http://requirejs.org/docs/release/2.1.10 + MD5SUM:=270154b3f5d417c3a42f1e58d03e6607 +endef + +define Download/Bacon + FILE:=Bacon.js + URL:=http://cdnjs.cloudflare.com/ajax/libs/bacon.js/0.7.71 + MD5SUM:=4600a60e1d7ffdb2259dfcce97c860ed +endef + +define Download/almond + FILE:=almond.js + URL:=https://raw.githubusercontent.com/jrburke/almond/0.3.1 + MD5SUM:=aa66c0c0cb55a4627bb706df73f3aff5 +endef + +$(eval $(call Download,rjs)) +$(eval $(call Download,Bacon)) +$(eval $(call Download,almond)) + define Package/gluon-status-page SECTION:=gluon CATEGORY:=Gluon @@ -22,16 +45,23 @@ endef define Build/Prepare mkdir -p $(PKG_BUILD_DIR) + $(CP) -t $(PKG_BUILD_DIR) $(DL_DIR)/r.js $(DL_DIR)/Bacon.js $(DL_DIR)/almond.js endef define Build/Configure + $(CP) ./src/* $(PKG_BUILD_DIR)/ endef define Build/Compile + cd $(PKG_BUILD_DIR) && \ + node r.js -o build.js && \ + node r.js -o cssIn=css/main.css out=style.css && \ + $(M4) index.html.m4 > index.html endef define Package/gluon-status-page/install - $(CP) ./files/* $(1)/ + $(INSTALL_DIR) $(1)/lib/gluon/status-page/www/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/index.html $(1)/lib/gluon/status-page/www/ endef $(eval $(call BuildPackage,gluon-status-page)) diff --git a/package/gluon-status-page/files/lib/gluon/status-page/www/index.html b/package/gluon-status-page/files/lib/gluon/status-page/www/index.html deleted file mode 100644 index 75700015..00000000 --- a/package/gluon-status-page/files/lib/gluon/status-page/www/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - Redirecting... - - diff --git a/package/gluon-status-page/iconfont-config.json b/package/gluon-status-page/iconfont-config.json new file mode 100644 index 00000000..af8718cc --- /dev/null +++ b/package/gluon-status-page/iconfont-config.json @@ -0,0 +1,100 @@ +{ + "name": "statuspage", + "css_prefix_text": "icon-", + "css_use_suffix": false, + "hinting": true, + "units_per_em": 1000, + "ascent": 850, + "glyphs": [ + { + "uid": "12f4ece88e46abd864e40b35e05b11cd", + "css": "ok", + "code": 59397, + "src": "fontawesome" + }, + { + "uid": "5211af474d3a9848f67f945e2ccaf143", + "css": "cancel", + "code": 59399, + "src": "fontawesome" + }, + { + "uid": "e15f0d620a7897e2035c18c80142f6d9", + "css": "link-ext", + "code": 59407, + "src": "fontawesome" + }, + { + "uid": "c76b7947c957c9b78b11741173c8349b", + "css": "attention", + "code": 59403, + "src": "fontawesome" + }, + { + "uid": "559647a6f430b3aeadbecd67194451dd", + "css": "menu", + "code": 59392, + "src": "fontawesome" + }, + { + "uid": "2d6150442079cbda7df64522dc24f482", + "css": "down-dir", + "code": 59393, + "src": "fontawesome" + }, + { + "uid": "80cd1022bd9ea151d554bec1fa05f2de", + "css": "up-dir", + "code": 59394, + "src": "fontawesome" + }, + { + "uid": "9dc654095085167524602c9acc0c5570", + "css": "left-dir", + "code": 59395, + "src": "fontawesome" + }, + { + "uid": "fb1c799ffe5bf8fb7f8bcb647c8fe9e6", + "css": "right-dir", + "code": 59396, + "src": "fontawesome" + }, + { + "uid": "a73c5deb486c8d66249811642e5d719a", + "css": "arrows-cw", + "code": 59400, + "src": "fontawesome" + }, + { + "uid": "750058837a91edae64b03d60fc7e81a7", + "css": "ellipsis-vert", + "code": 59401, + "src": "fontawesome" + }, + { + "uid": "56a21935a5d4d79b2e91ec00f760b369", + "css": "sort", + "code": 59404, + "src": "fontawesome" + }, + { + "uid": "94103e1b3f1e8cf514178ec5912b4469", + "css": "sort-down", + "code": 59405, + "src": "fontawesome" + }, + { + "uid": "65b3ce930627cabfb6ac81ac60ec5ae4", + "css": "sort-up", + "code": 59406, + "src": "fontawesome" + }, + { + "uid": "cda0cdcfd38f5f1d9255e722dad42012", + "css": "spinner", + "code": 59402, + "src": "fontawesome" + } + ] +} \ No newline at end of file diff --git a/package/gluon-status-page/src/build.js b/package/gluon-status-page/src/build.js new file mode 100644 index 00000000..a1b1d703 --- /dev/null +++ b/package/gluon-status-page/src/build.js @@ -0,0 +1,10 @@ +({ + paths: { + "bacon": "../Bacon" + }, + baseUrl: "js/", + name: "../almond", + include: "main", + optimize: "uglify2", + out: "app.js", +}) diff --git a/package/gluon-status-page/src/css/animation.css b/package/gluon-status-page/src/css/animation.css new file mode 100644 index 00000000..ac5a9562 --- /dev/null +++ b/package/gluon-status-page/src/css/animation.css @@ -0,0 +1,85 @@ +/* + Animation example, for spinners +*/ +.animate-spin { + -moz-animation: spin 2s infinite linear; + -o-animation: spin 2s infinite linear; + -webkit-animation: spin 2s infinite linear; + animation: spin 2s infinite linear; + display: inline-block; +} +@-moz-keyframes spin { + 0% { + -moz-transform: rotate(0deg); + -o-transform: rotate(0deg); + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + + 100% { + -moz-transform: rotate(359deg); + -o-transform: rotate(359deg); + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} +@-webkit-keyframes spin { + 0% { + -moz-transform: rotate(0deg); + -o-transform: rotate(0deg); + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + + 100% { + -moz-transform: rotate(359deg); + -o-transform: rotate(359deg); + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} +@-o-keyframes spin { + 0% { + -moz-transform: rotate(0deg); + -o-transform: rotate(0deg); + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + + 100% { + -moz-transform: rotate(359deg); + -o-transform: rotate(359deg); + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} +@-ms-keyframes spin { + 0% { + -moz-transform: rotate(0deg); + -o-transform: rotate(0deg); + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + + 100% { + -moz-transform: rotate(359deg); + -o-transform: rotate(359deg); + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} +@keyframes spin { + 0% { + -moz-transform: rotate(0deg); + -o-transform: rotate(0deg); + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + + 100% { + -moz-transform: rotate(359deg); + -o-transform: rotate(359deg); + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} diff --git a/package/gluon-status-page/src/css/font.css b/package/gluon-status-page/src/css/font.css new file mode 100644 index 00000000..c26ee355 --- /dev/null +++ b/package/gluon-status-page/src/css/font.css @@ -0,0 +1,53 @@ +@font-face { + font-family: 'statuspage'; + src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABBIABEAAAAAGvAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABgAAAABwAAAAcbmIpTEdERUYAAAGcAAAAHQAAACAAQAAET1MvMgAAAbwAAABEAAAAVolbUzJjbWFwAAACAAAAAFAAAAFaNCnF72N2dCAAAAJQAAAACgAAAAoAAAAAZnBnbQAAAlwAAAWUAAALcIiQkFlnYXNwAAAH8AAAAAgAAAAIAAAAEGdseWYAAAf4AAAFIQAAB5Aqg1+6aGVhZAAADRwAAAAvAAAANgs/y+hoaGVhAAANTAAAAB8AAAAkD4gG32htdHgAAA1sAAAAOAAAAExf6AFkbG9jYQAADaQAAAAoAAAAKA0UDxRtYXhwAAANzAAAAB4AAAAgALUAX25hbWUAAA3sAAABUQAAAo4VwGZqcG9zdAAAD0AAAACYAAAAzEaEO/VwcmVwAAAP2AAAAGUAAAB73WsDhXdlYmYAABBAAAAABgAAAAaP4VXgAAAAAQAAAADMPaLPAAAAANAeRhwAAAAA0gZAYHjaY2BkYGDgA2IJBhBgYmAEQiEgZgHzGAAFEABFAAAAeNpjYGQNZpzAwMrAwirEOouBgVEeQjNfZ0hhEmBgYGJgZWbACgLSXFMYHFT/vOBnO/vvLMMOtrMMS4DCjCA5AKFmDF942mNgYGBmgGAZBkYGEAgB8hjBfBYGCyDNxcDBwASEDKp/XrC+4P//H6QIyGZ4wQ5i32KXYJFghuqFAkY2BrgAI1AnSDcKYGQY9gAAyR8MCgAAAAAAAAAAAAAAAHjarVZpcxNHEJ3VYcs2PoIPEjaBWcZyjHZWmMsIEMbsShbgHPKV7EKOXUt27otP/Ab9ml6RVJFv/LS8Hh3YYCdVVChK/ab37Uz3655ek9CSxF5Yj6TcfCmmtjZpZOdJSDdsWo7iQ9nZCylTTP4uiIJotdS+7TgkIhKBqnWFJYLY98jSJONDjzJatiW9alJu6Ul32RoP6q369tPQUY7dCSU1m6FD65EtqcKoEkUy7ZGSNi3D1V9JWuHnK8x81QwlgugkksabYQyP5GfjjFYZrcZ2HEWRTZYbRYpEMzyIIo+yWmKfXDFBQPmgGVJe+TSifIQfkRV7lNMKccl2mt/3JT/pHc6/JOJ6i7IlB/5AdmQHe6cr+SLS2grjpp1sR6GK8HR9J8Qjm5Pqn+xRXtNo4HZFpifNCJbKV5BY+Qll9g/JauF8ypc8GtWSg5wIWi9zYl/yDrQeR0yJaybIgu6OToig7pecodhj+rj4471dLBchBMg4lvWOSrgQRilhs5okbQQ5iJKyRZXUekdMnPI6LeItYb9O7ehLZ7RJqDsxnq2Hjq2cqOR4NKnTTKZO7aTm0ZQGUUo6Ezzm1wGUH9Ekr7axmsTKo2lsM2MkkVCghXNpKohlJ5Y0BdE8mtGbu2Gaa9eiRZo8UM89ek9vboWbOz2n7cA/a/xndSqmg70wnZ4OyEp8mna5SdG6fnqGfybxQ9YCKpEtNsOUxUO2fgfl5WNLjsJrA2z3nvMr6H32RMikgfgb8B4v1SkFTIWYVVAL3bTWtSzL1GpWi1Rk6rshTStf1mkCTTkOfWNfxjj+r5kZS0wJ3+/E6dkRl5659iXINIfcZl2P5nVqsV2AzmzP6TTL9n2d5th+oNM82/M6HWFr63SU7Yc6LbD9SKdjbC9oQZPuOwRyEYFcwAYSgbB1EAjbSwiErUIgbBcRCNsiAmG7hEDYfoxA2C4jELaXtayafippHDsTywBFiAOjOe7IZW4qV1PJpRKui0anNuQpcqukonhW/SsD/eKRN6yBtUC6RNb8ikmufFSV44+uaHnTxLkCjlV/e3NcnxMPZb9Y+FPwv9qaqqRXrHlkchV5I9CT40TXJhWPrunyuapH1/+Lig5rgX4DpRALRVmWDb6ZkPBRp9NQDVzlEDMbMw/X9bplzc/h/JsYIQvofvw3FBoL3INOWUlZ7WCv1dePZbm3B+WwJ1iSYr7M61vhi4zMSvtFZil7PvJ5wBUwKpVhqw1creDNexLzkOlN8kwQtxVlg6SNx5kgsYFjHjBvvpMgJExdtYHaKZywgbxgzCnY74RDVG+U5XB7oX0ejZR/a1fsyBkVTRD4bfZG2OuzUPJbrIGEJ7/U10BVIU3FuKmASyPlhmrwYVyt20YyTqCvqNgNy7KKDx9H3HdKjmUg+UgRq0dHP629Qp3Uuf3KKG7fO/0IgkFpYv72vpnioJR3tZJlVm0DU7calVPXmsPFqw7dzaPue8fZJ3LWNN10T9z0vqZVt4ODuVkQ7dsclKVMLqjrww4bqMvNpdDqZVyS3nYPMCwwoN+hFRv/V/dx+DxXqgqj40i9nagfo89iDPIPOH9H9QXo5zFMuYaU53uXE59u3MPZMl3FXayf4t/ArLXmZukacEPTDZiHrFodusoNfKcGOj3S3I70EPCx7grxAGATwGLwie5axvMpgPF8xhwf4HPmMGgyh8EWcxhsM2cNYIc5DHaZw2CPOQy+YM46wJfMYRAyh0HEHAZPmBMAPGUOg6+Yw+Br5jD4hjn3Ab5lDoOYOQwS5jDY13RrKHOLF3QXqG1QFejA9BMW97A41FQZsr/jhWF/bxCzfzCIqT9quj2k/sQLQ/3ZIKb+YhBTf9V0Z0j9jReG+rtBTP3DIKY+0y/GcpnBX0a+S4UDyi42n/P3xPsHwhpAtgABAAH//wAPeNp9VU1oG0cUnje7WlmKvJKsXa0dR9qMFK+symslki1VUezEgtiN6gajhkBFUcE9RSY1rZuWYoIIpqQmh+IkB9OmoYeS+lCCoTQ/t+TQlBB0aKGU4qan5pBLKD4EHOR13+zKpHFJdRjNmzfvm+/Nm/ctAbL9EwgpCHzcWpfWXCvET3SSJt6bA/He0C5RMFMjMJTLs0zYrSpSgsUMYXgop73EdqNtRqQJ3aRJtnFbT9L/sYoX9X5hcM9FfYD201OXIwM0Gb0cQS89tWRvWuIRhCBXqIlLwjqRifS9VwAzFXQoSW6QYgnAI0USGRC7LKIVwjgIKzzyIJ9qlISJg6EhxoqDIdoYeRgFDcKKFEfauFEZUXFIRltET0JND6MBKmKM9PcTG6NMFuiaS3uOEUKMHKYeVGweZYUigwNicixkEYU2dW4P7mmRiPmcB2IsIUYnYuziGMPBIYcGT8YwC5yIwjMxmyLR+109CDXKF0w7/gKh7jOuKaJifNBjcziMHDQPDnobBalc0K+w6l6Yok/w74qut5KsyjZ/0umKyb5kzLpO/2bsCnuLtZK6TgvMxj679dD1wJUi+xC7l2Pnh/IeMHYc4MHBz0/x4JAG4yyDKWuVIWwVZzDlHGitwpSu8xOsVfRW0f0orTt+mwH6MUav6dyv16IYw3EwZi8hFN9jTVqTiiROxknHD9lEr0DNlIqFz/LC+yEK2cy+fC6f07KZcAQoYbF9Cbc0CKHhLsIyopZvF4YXN3cYjHhMdEtuKQX8iVL7vVytNN9fBs+Ub7+3+4+AUrYGrXvXrPvzl/DylTL8BgevQZFbWFJmOSErj76wntoRf8k9MsfBkn01WVluKHO90O3zWE1roXHmsgamcL0DsnC28eElzYxguIlP8upVe2OP03lb63ADc9zuuVS8V/EJ7Z7jedk9FXd6LN+2E227CI7NEyqZa+YYHUmvpUfpS+a1h2aJjqYfmiN0jJ7ZduIS/QT3jPF5iZCO9r0v4CxIduPtD5BhMkomiHqk6+jYyKvZ/a8YLNKt+H0S7bAbMRPl7zaEjzgsA14/rmBLxQzgExm4y54MAvxrTxRkuu2JGfXlGXHu87nmR9/Mi3PfvcemP52ePl+Dewurn4mN2/PjJz+uipXGcSqXZ94Qj86VWO7YQTFTMX8sVcfEwrsF2pys15frdTp54gPX/NcI0joxXnvnQq3mYm83GrcajWfXiic5ypuwe7gsVqYrHSWx0FcQD1QOiAWrD2+gyvMXSNdWzf1EamL2cZLFmgwmoqpdE64WmTA2qlsGrnMJA0JKGKuSy4eGEgaWwS3hApYth+XjtqR2CbNd48fHFeF0MqWUEhuxvqOhlDAX6vb/ElCp6pX9z2S/N6TIf8qKPeSlcjyZjG/ceG0i3ocSOCHObj71Bmmnj8o+j8/naR3CwB7594CqBojTJ9+KSy6ujRHsk90hL6V2WbJtfTRQDIK2TNlS5yj0i3K5U/rW7TeNDkAJVOFXW8Y0LkPbeszPpEVHByn857ydB+xAdHRQqLV5t3VwB8kdpFDSX2Th5L7eQbBWCXIEcz+UjouYe0/7exUBu/cl1IAwfp9yqLN2z6htTQA8L2E4xDVcM9Lg6NndRaGPl6O1NjlDZ8vCjcm6GigH1LuLrfLiXUHupI8fKElGJ/hHpqDd39S8zHuuE4rCzfN3qMK3zrzeOjZZp7PH4DQvlHVp8c4d+Dmwiz6+j9JiRjZv6Xg9DzbDPt+5TkzlH7P8hqoAAAB42mNgZGBgAOI5Ufuj4vltvjLIczCAwCU2hwQE/T+Og4HtLJDLwcAEEgUACxEJCgB42mNgZGBgO/vvLMMODgYGhv//gCRQBAUIAwCOkwV5AHja42CAAKZVDAwsQJrtNpCeCMFMtxm8gJiBg4Ghm82doRYkx7iNgYGdASwmBFMHwkA+AwBxgwmlAAAAAAAAAAAACABWAHgAmgC8ANwBCgFQAcICDAKMAuQDHgNAA2IDyHjaY2BkYGAQZvBg4GAAASYwWQzEagyiICYAEIYBFQAAeNp1kU1OwlAUhc8TNP4kjAwDRx0YoxNEgsYw0mhwrgmOC1YoImKpJk6IC3ARrsA4dAHG+LMCXYRr8OvrowOCaW577rnn3nfuq6SCnpSTyS9I6hIpNlomS/EMmpHDOfgHh/Na1aPDsyrq1eE5ND8OL6qhX4eXtGYOHX5X0Yznf6hs7h3+1Lx5dvhLBfOS4u+cVsybDnSlge4UKVRbHcXytA67wbeisrZUBTVReChTVai+fPVgfN3Q0bGVIfkecU7Whw1Q9MAltXhfUo/Rx3QMOdFnTqBjog3TI4+mKqZx3kRfgyzpDu3JHp5LOJ/WeUT0rdq3Ds+y3Ya6RVGBjdkg2SKyrj3VJ/bxmJbUujAt+JK9tRi2pk2e//Y/hWlm1bHLur1TT/v4bNs737W1CtOqPDXwTvYvtnXBlICzBm7nwO5Xz6ae6BompBYlDv4AFmJmQgAAAHjabY1bDsIgFEQZrAV8G90GPyauwMR9NC0qKV4aHtblK/XXk8zM+RvG2Y8j+8/hGzAOjhkqzFFDQEJhgSVWWGODLXbYi0z2dL5eqqehLDs/ku5sqPNQRjpzS0VUsPfHZNz3ddtQa5xqQvBj1O24Ns7ZIdqoXyYkEQdLZIJqUjKUrKcq+pBUKV0OxGR5kM5Sr807fQBTyi/YeNpj8N7BcCIoYiMjY1/kBsadHAwcDMkFGxlYnTYyMGhBaA4UeicDAwMnMouZwWWjCmNHYMQGh46IjcwpLhvVQLxdHA0MjCwOHckhESAlkUCwkYFHawfj/9YNLL0bmRhcAAfTIrgAAAAAAVXgj+AAAA==) format('woff'); + font-weight: normal; + font-style: normal; +} + +[class^="icon-"]:before, [class*=" icon-"]:before { + font-family: "statuspage"; + font-style: normal; + font-weight: normal; + speak: none; + + display: inline-block; + text-decoration: inherit; + width: 1em; + margin-right: .2em; + text-align: center; + /* opacity: .8; */ + + /* For safety - reset parent styles, that can break glyph codes*/ + font-variant: normal; + text-transform: none; + + /* fix buttons height, for twitter bootstrap */ + line-height: 1em; + + /* Animation center compensation - margins should be symmetric */ + /* remove if not needed */ + margin-left: .2em; + + /* you can be more comfortable with increased icons size */ + /* font-size: 120%; */ + + /* Uncomment for 3D effect */ + /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */ +} + +.icon-menu:before { content: '\e800'; } /* '' */ +.icon-down-dir:before { content: '\e801'; } /* '' */ +.icon-up-dir:before { content: '\e802'; } /* '' */ +.icon-left-dir:before { content: '\e803'; } /* '' */ +.icon-right-dir:before { content: '\e804'; } /* '' */ +.icon-ok:before { content: '\e805'; } /* '' */ +.icon-cancel:before { content: '\e807'; } /* '' */ +.icon-arrows-cw:before { content: '\e808'; } /* '' */ +.icon-ellipsis-vert:before { content: '\e809'; } /* '' */ +.icon-spinner:before { content: '\e80a'; } /* '' */ +.icon-attention:before { content: '\e80b'; } /* '' */ +.icon-sort:before { content: '\e80c'; } /* '' */ +.icon-sort-down:before { content: '\e80d'; } /* '' */ +.icon-sort-up:before { content: '\e80e'; } /* '' */ +.icon-link-ext:before { content: '\e80f'; } /* '' */ diff --git a/package/gluon-status-page/src/css/main.css b/package/gluon-status-page/src/css/main.css new file mode 100644 index 00000000..0604802e --- /dev/null +++ b/package/gluon-status-page/src/css/main.css @@ -0,0 +1,171 @@ +@import "reset.css"; +@import "font.css"; +@import "menu.css"; +@import "animation.css"; + +body { + background: rgba(0, 0, 0, 0.12); + font-family: Roboto, Lucida Grande, sans, Arial; + color: rgba(0, 0, 0, 0.87); + font-size: 14px; +} + + +a { + color: rgba(220, 0, 103, 0.87); + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + +header { + display: flex; + padding: 0 14px; + background: #dc0067; + color: rgba(255, 255, 255, 0.98); + position: absolute; + top: 0; + width: 100%; + box-sizing: border-box; + height: 20vh; + z-index: -1; + box-shadow: 0px 5px 6px rgba(0, 0, 0, 0.16), 0px 1.5px 3px rgba(0, 0, 0, 0.23); + white-space: nowrap; +} + +header h1, header .icons { + font-size: 24px; + margin: 10px 0; + padding: 6px 0; +} + +header h1 { + text-overflow: ellipsis; + overflow: hidden; + flex: 1; +} + +header h1:hover { + text-decoration: underline; + cursor: pointer; +} + +h1 { + font-weight: bold; +} + +h2, h3 { + font-size: 16px; + color: rgba(0, 0, 0, 0.54); +} + +h2 { + padding: 16px 16px; +} + +h3 { + padding: 16px 16px 8px; +} + +.container { + max-width: 90vw; + margin: 64px auto 24px auto; + background: rgb(253, 253, 253); + box-shadow: 0px 5px 20px rgba(0, 0, 0, 0.19), 0px 3px 6px rgba(0, 0, 0, 0.23); +} + +.container .frame { + box-sizing: border-box; +} + +.vertical-split { + display: flex; +} + +.vertical-split > .frame { + flex: 1; + border-style: solid; + border-color: rgba(0, 0, 0, 0.12); +} + +.vertical-split > .frame + .frame { + border-width: 0 0 0 1px; +} + +dl, pre { + padding: 0 16px 16px; +} + +table { + margin: 0 16px; +} + +dt, th { + font-weight: bold; + color: rgba(0, 0, 0, 0.87); +} + +dt { + margin-bottom: 4px; +} + +th { + text-align: left; + padding: 4px 16px 4px 0; +} + +dd, td { + font-weight: normal; + font-size: 0.9em; + color: rgba(0, 0, 0, 0.54); +} + +dd { + padding-bottom: 16px; +} + +table.datatable { + width: calc(100% - 32px); +} + +table.datatable td { + font-size: 1em; + padding: 4px 0; +} + +table.datatable tr.inactive { + opacity: 0.33; +} + +table.datatable tr.highlight { + background: rgba(255, 180, 0, 0.25); +} + +div.signalgraph { + margin: 16px; +} + +@media only screen and (max-width: 1250px) { + .container { + max-width: none; + margin: 56px 0 0; + } + + header { + height: 56px; + z-index: 1; + position: fixed; + } +} + +@media only screen and (max-width: 700px) { + .vertical-split { + display: block; + } + + .vertical-split > .frame + .frame { + border-width: 1px 0 0 0; + } +} diff --git a/package/gluon-status-page/src/css/menu.css b/package/gluon-status-page/src/css/menu.css new file mode 100644 index 00000000..c865c648 --- /dev/null +++ b/package/gluon-status-page/src/css/menu.css @@ -0,0 +1,60 @@ +.noscroll { + overflow: hidden; +} + +.menu-background { + position: fixed; + top: 0; + left: 0; + width: 100vw; + height: 100vh; + z-index: 10; +} + +.menu { + background: rgba(255, 255, 255, 1); + position: fixed; + z-index: 11; + padding: 8px 0; + box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.24); + overflow-y: auto; + max-height: 80vh; + + transform-origin: top left; + -webkit-animation: new-menu-animation .08s ease-out forwards; + -moz-animation: new-menu-animation .08s ease-out forwards; +} + +@-webkit-keyframes new-menu-animation { + from { + transform: scaleY(0); + } + to { + transform: scaleY(1); + } +} + +@-moz-keyframes new-menu-animation { + from { + transform: scaleY(0); + } + to { + transform: scaleY(1); + } +} + +.menu li { + cursor: pointer; + display: block; + font-size: 16px; + padding: 16px 32px 16px 16px; + color: rgba(0, 0, 0, 0.87); +} + +.menu li:hover { + background: rgba(0, 0, 0, 0.07); +} + +.menu li:active { + background: rgba(0, 0, 0, 0.07); +} diff --git a/package/gluon-status-page/src/css/reset.css b/package/gluon-status-page/src/css/reset.css new file mode 100644 index 00000000..f6ca1484 --- /dev/null +++ b/package/gluon-status-page/src/css/reset.css @@ -0,0 +1,86 @@ +/* +html5doctor.com Reset Stylesheet v1.6.1 +Last Updated: 2010-09-17 +Author: Richard Clark - http://richclarkdesign.com +*/ +html, body, div, span, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +abbr, address, cite, code, +del, dfn, em, img, ins, kbd, q, samp, +small, strong, sub, sup, var, +b, i, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, figcaption, figure, +footer, header, hgroup, menu, nav, section, summary, +time, mark, audio, video { + margin:0; + padding:0; + border:0; + outline:0; + font-size:100%; + vertical-align:baseline; + background:transparent; +} +body { + line-height:1; +} +article,aside,details,figcaption,figure, +footer,header,hgroup,menu,nav,section { + display:block; +} +nav ul { + list-style:none; +} +blockquote, q { + quotes:none; +} +blockquote:before, blockquote:after, +q:before, q:after { + content:''; + content:none; +} +a { + margin:0; + padding:0; + font-size:100%; + vertical-align:baseline; + background:transparent; +} +/* change colours to suit your needs */ +ins { + background-color:#ff9; + color:#000; + text-decoration:none; +} +/* change colours to suit your needs */ +mark { + background-color:#ff9; + color:#000; + font-style:italic; + font-weight:bold; +} +del { + text-decoration: line-through; +} +abbr[title], dfn[title] { + border-bottom:1px dotted; + cursor:help; +} +table { + border-collapse:collapse; + border-spacing:0; +} +/* change border colour to suit your needs */ +hr { + display:block; + height:1px; + border:0; + border-top:1px solid #cccccc; + margin:1em 0; + padding:0; +} +input, select { + vertical-align:middle; +} diff --git a/package/gluon-status-page/src/index.html.m4 b/package/gluon-status-page/src/index.html.m4 new file mode 100644 index 00000000..489c1cf0 --- /dev/null +++ b/package/gluon-status-page/src/index.html.m4 @@ -0,0 +1,17 @@ + + + + + + + + + + + diff --git a/package/gluon-status-page/src/js/lib/gui.js b/package/gluon-status-page/src/js/lib/gui.js new file mode 100644 index 00000000..3d771005 --- /dev/null +++ b/package/gluon-status-page/src/js/lib/gui.js @@ -0,0 +1,157 @@ +"use strict" +define([ "lib/gui/nodeinfo" + , "lib/gui/statistics" + , "lib/gui/neighbours" + , "lib/gui/menu" + , "lib/streams" + , "lib/neighbourstream" + ], function ( NodeInfo + , Statistics + , Neighbours + , Menu + , Streams + , NeighbourStream + ) { + + function VerticalSplit(parent) { + var el = document.createElement("div") + el.className = "vertical-split" + parent.appendChild(el) + + el.push = function (child) { + var header = document.createElement("h2") + header.appendChild(child.title) + + var div = document.createElement("div") + div.className = "frame" + div.node = child + div.appendChild(header) + + el.appendChild(div) + + child.render(div) + + return function () { + div.node.destroy() + el.removeChild(div) + } + } + + el.clear = function () { + while (el.firstChild) { + el.firstChild.node.destroy() + el.removeChild(el.firstChild) + } + } + + return el + } + + var h1 + + return function (mgmtBus, nodesBus) { + function setTitle(node, state) { + var title = node ? node.hostname : "(not connected)" + + document.title = title + h1.textContent = title + + var icon = document.createElement("i") + icon.className = "icon-down-dir" + + h1.appendChild(icon) + + switch (state) { + case "connect": + stateIcon.className = "icon-arrows-cw animate-spin" + break + case "fail": + stateIcon.className = "icon-attention" + break + default: + stateIcon.className = "" + break + } + } + + var nodes = [] + + function nodeMenu() { + var myNodes = nodes.slice() + + myNodes.sort(function (a, b) { + a = a.hostname + b = b.hostname + return (a < b) ? -1 : (a > b) + }) + + var menu = myNodes.map(function (d) { + return [d.hostname, function () { + mgmtBus.pushEvent("goto", d) + }] + }) + + new Menu(menu).apply(this) + } + + var header = document.createElement("header") + h1 = document.createElement("h1") + header.appendChild(h1) + + h1.onclick = nodeMenu + + var icons = document.createElement("p") + icons.className = "icons" + header.appendChild(icons) + + var stateIcon = document.createElement("i") + icons.appendChild(stateIcon) + + document.body.appendChild(header) + + var container = document.createElement("div") + container.className = "container" + + document.body.appendChild(container) + + setTitle() + + var content = new VerticalSplit(container) + + function nodeChanged(nodeInfo) { + setTitle(nodeInfo, "connect") + + content.clear() + content.push(new NodeInfo(nodeInfo)) + } + + function nodeNotArrived(nodeInfo) { + setTitle(nodeInfo, "fail") + } + + function nodeArrived(nodeInfo, ip) { + setTitle(nodeInfo) + + var neighbourStream = new NeighbourStream(mgmtBus, nodesBus, ip) + var statisticsStream = new Streams.Statistics(ip) + + content.push(new Statistics(statisticsStream)) + content.push(new Neighbours(nodeInfo, neighbourStream, mgmtBus)) + } + + function newNodes(d) { + nodes = [] + for (var nodeId in d) + nodes.push(d[nodeId]) + } + + mgmtBus.onEvent({ "goto": nodeChanged + , "arrived": nodeArrived + , "gotoFailed": nodeNotArrived + }) + + nodesBus.map(".nodes").onValue(newNodes) + + return this + } +}) diff --git a/package/gluon-status-page/src/js/lib/gui/menu.js b/package/gluon-status-page/src/js/lib/gui/menu.js new file mode 100644 index 00000000..712f2d0f --- /dev/null +++ b/package/gluon-status-page/src/js/lib/gui/menu.js @@ -0,0 +1,39 @@ +"use strict" +define(function () { + return function (menu) { + return function () { + var background = document.createElement("div") + background.className = "menu-background" + document.body.appendChild(background) + document.body.classList.add("noscroll") + + var offset = this.getBoundingClientRect() + var container = document.createElement("ul") + container.className = "menu" + container.style.top = offset.top + "px" + container.style.left = offset.left + "px" + + background.onclick = destroy + + menu.forEach(function (item) { + var li = document.createElement("li") + li.textContent = item[0] + li.action = item[1] + li.onclick = function () { + destroy() + this.action() + } + + container.appendChild(li) + }) + + document.body.appendChild(container) + + function destroy() { + document.body.classList.remove("noscroll") + document.body.removeChild(background) + document.body.removeChild(container) + } + } + } +}) diff --git a/package/gluon-status-page/src/js/lib/gui/neighbours.js b/package/gluon-status-page/src/js/lib/gui/neighbours.js new file mode 100644 index 00000000..3c2aaca7 --- /dev/null +++ b/package/gluon-status-page/src/js/lib/gui/neighbours.js @@ -0,0 +1,275 @@ +"use strict" +define([ "lib/helper", "lib/gui/signalgraph", "lib/gui/signal"], +function (Helper, SignalGraph, Signal) { + + var graphColors = ["#396AB1", "#DA7C30", "#3E9651", "#CC2529", "#535154", "#6B4C9A", "#922428", "#948B3D"] + //graphColors = ["#7293CB", "#E1974C", "#84BA5B", "#D35E60", "#808585", "#9067A7", "#AB6857", "#CCC210"]; + + var inactiveTime = 200 + + function SignalEntry(graph, color, stream) { + var signal = new Signal(color) + var remove = graph.add(signal) + + var unsubscribe = stream.onValue(update) + + this.destroy = function () { + unsubscribe() + remove() + } + + this.getSignal = function () { + return signal + } + + return this + + function update(d) { + if ("wifi" in d) + signal.set(d.wifi.inactive > inactiveTime ? null : d.wifi.signal) + } + } + + function TableEntry(parent, nodeInfo, color, stream, mgmtBus, signal) { + var el = document.createElement("tr") + parent.appendChild(el) + + var tdHostname = document.createElement("td") + var tdTQ = document.createElement("td") + var tdSignal = document.createElement("td") + var tdDistance = document.createElement("td") + var tdInactive = document.createElement("td") + + el.appendChild(tdHostname) + el.appendChild(tdTQ) + el.appendChild(tdSignal) + el.appendChild(tdDistance) + el.appendChild(tdInactive) + + var marker = document.createElement("span") + marker.textContent = "⬤ " + marker.style.color = color + tdHostname.appendChild(marker) + + var hostname = document.createElement("span") + tdHostname.appendChild(hostname) + + var infoSet = false + var unsubscribe = stream.onValue(update) + + el.onmouseenter = function () { + el.classList.add("highlight") + signal.setHighlight(true) + } + + el.onmouseleave = function () { + el.classList.remove("highlight") + signal.setHighlight(false) + } + + el.destroy = function () { + unsubscribe() + parent.removeChild(el) + } + + return el + + function update(d) { + if ("wifi" in d) { + var signal = d.wifi.signal + var inactive = d.wifi.inactive + + el.classList.toggle("inactive", inactive > inactiveTime) + + tdSignal.textContent = signal + tdInactive.textContent = Math.round(inactive / 1000) + " s" + } + + if ("batadv" in d) + tdTQ.textContent = Math.round(d.batadv.tq / 2.55) + " %" + else + tdTQ.textContent = "‒" + + if (infoSet) + return + + if ("nodeInfo" in d) { + infoSet = true + + var link = document.createElement("a") + link.textContent = d.nodeInfo.hostname + link.href = "#" + link.nodeInfo = d.nodeInfo + link.onclick = function () { + mgmtBus.pushEvent("goto", this.nodeInfo) + return false + } + + while (hostname.firstChild) + hostname.removeChild(hostname.firstChild) + + hostname.appendChild(link) + + try { + var distance = Helper.haversine(nodeInfo.location.latitude, nodeInfo.location.longitude, + d.nodeInfo.location.latitude, d.nodeInfo.location.longitude) + + tdDistance.textContent = Math.round(distance * 1000) + " m" + } catch (e) { + tdDistance.textContent = "‒" + } + } else + hostname.textContent = d.id + } + } + + function Interface(parent, nodeInfo, iface, stream, mgmtBus) { + var colors = graphColors.slice(0) + + var el = document.createElement("div") + el.ifname = iface + parent.appendChild(el) + + var h = document.createElement("h3") + h.textContent = iface + el.appendChild(h) + + var table = document.createElement("table") + var tr = document.createElement("tr") + table.appendChild(tr) + table.classList.add("datatable") + + var th = document.createElement("th") + th.textContent = "Knoten" + tr.appendChild(th) + + th = document.createElement("th") + th.textContent = "TQ" + tr.appendChild(th) + + th = document.createElement("th") + th.textContent = "dBm" + tr.appendChild(th) + + th = document.createElement("th") + th.textContent = "Entfernung" + tr.appendChild(th) + + th = document.createElement("th") + th.textContent = "Inaktiv" + tr.appendChild(th) + + el.appendChild(table) + + var wrapper = document.createElement("div") + wrapper.className = "signalgraph" + el.appendChild(wrapper) + + var canvas = document.createElement("canvas") + canvas.className = "signal-history" + canvas.height = 200 + wrapper.appendChild(canvas) + + var graph = new SignalGraph(canvas, -100, 0, true) + + var stopStream = stream.skipDuplicates(sameKeys).onValue(update) + + var managedNeighbours = {} + + function update(d) { + var notUpdated = new Set() + var id + + for (id in managedNeighbours) + notUpdated.add(id) + + for (id in d) { + if (!(id in managedNeighbours)) { + var neighbourStream = stream.map("." + id).filter( function (d) { return d !== undefined }) + var color = colors.shift() + var signal = new SignalEntry(graph, color, neighbourStream) + managedNeighbours[id] = { views: [ signal, + new TableEntry(table, nodeInfo, color, neighbourStream, mgmtBus, signal.getSignal()) + ], + color: color + } + } + + notUpdated.delete(id) + } + + for (id in notUpdated) { + managedNeighbours[id].views.forEach( function (d) { d.destroy() }) + colors.push(managedNeighbours[id].color) + delete managedNeighbours[id] + } + } + + + el.destroy = function () { + stopStream() + + for (var id in managedNeighbours) + managedNeighbours[id].views.forEach( function (d) { d.destroy() }) + + el.removeChild(h) + el.removeChild(wrapper) + el.removeChild(table) + } + } + + function sameKeys(a, b) { + a = Object.keys(a).sort() + b = Object.keys(b).sort() + + return !(a < b || a > b) + } + + return function (nodeInfo, stream, mgmtBus) { + var stopStream, div + + function render(el) { + div = document.createElement("div") + el.appendChild(div) + + stopStream = stream.skipDuplicates(sameKeys).onValue(update) + + function update(d) { + var have = {} + var remove = [] + if (div.hasChildNodes()) { + var children = div.childNodes + for (var i = 0; i < children.length; i++) { + var a = children[i] + if (a.ifname in d) + have[a.ifname] = true + else { + a.destroy() + remove.push(a) + } + } + } + + remove.forEach(function (d) { div.removeChild(d) }) + + for (var k in d) + if (!(k in have)) + new Interface(div, nodeInfo, k, stream.map("." + k), mgmtBus) + } + } + + function destroy() { + stopStream() + + while (div.firstChild) { + div.firstChild.destroy() + div.removeChild(div.firstChild) + } + } + + return { title: document.createTextNode("Nachbarknoten") + , render: render + , destroy: destroy + } + } +}) diff --git a/package/gluon-status-page/src/js/lib/gui/nodeinfo.js b/package/gluon-status-page/src/js/lib/gui/nodeinfo.js new file mode 100644 index 00000000..75910aae --- /dev/null +++ b/package/gluon-status-page/src/js/lib/gui/nodeinfo.js @@ -0,0 +1,54 @@ +"use strict" +define(["lib/helper"], function (Helper) { + return function (nodeInfo) { + var el = document.createElement("div") + + update(nodeInfo) + + function dlEntry(dl, dict, key, prettyName) { + var v = Helper.dictGet(dict, key.split(".")) + + if (v === null) + return + + var dt = document.createElement("dt") + var dd = document.createElement("dd") + + dt.textContent = prettyName + if (v instanceof Array) { + var tn = v.map(function (d) { return document.createTextNode(d) }) + tn.forEach(function (node) { + if (dd.hasChildNodes()) + dd.appendChild(document.createElement("br")) + + dd.appendChild(node) + }) + } else + dd.textContent = v + + dl.appendChild(dt) + dl.appendChild(dd) + } + + function update(nodeInfo) { + var list = document.createElement("dl") + + dlEntry(list, nodeInfo, "hostname", "Knotenname") + dlEntry(list, nodeInfo, "owner.contact", "Kontakt") + dlEntry(list, nodeInfo, "hardware.model", "Modell") + dlEntry(list, nodeInfo, "network.mac", "Primäre MAC") + dlEntry(list, nodeInfo, "network.addresses", "IP-Adresse") + dlEntry(list, nodeInfo, "software.firmware.release", "Firmware") + dlEntry(list, nodeInfo, "software.fastd.enabled", "Mesh-VPN") + dlEntry(list, nodeInfo, "software.autoupdater.enabled", "Automatische Updates") + dlEntry(list, nodeInfo, "software.autoupdater.branch", "Branch") + + el.appendChild(list) + } + + return { title: document.createTextNode("Übersicht") + , render: function (d) { d.appendChild(el) } + , destroy: function () {} + } + } +}) diff --git a/package/gluon-status-page/src/js/lib/gui/signal.js b/package/gluon-status-page/src/js/lib/gui/signal.js new file mode 100644 index 00000000..d91c63fb --- /dev/null +++ b/package/gluon-status-page/src/js/lib/gui/signal.js @@ -0,0 +1,48 @@ +"use strict" +define(function () { + return function (color) { + var canvas = document.createElement("canvas") + var ctx = canvas.getContext("2d") + var v = null + var radius = 1.2 + var highlight = false + + function drawPixel(x, y) { + ctx.beginPath() + ctx.fillStyle = color + ctx.arc(x, y, radius, 0, Math.PI * 2, false) + ctx.closePath() + ctx.fill() + } + + this.resize = function (w, h) { + canvas.width = w + canvas.height = h + } + + this.draw = function (x, scale) { + var y = scale(v) + + ctx.clearRect(x, 0, 5, canvas.height) + + if (y) + drawPixel(x, y) + } + + this.canvas = canvas + + this.set = function (d) { + v = d + } + + this.setHighlight = function (d) { + highlight = d + } + + this.getHighlight = function () { + return highlight + } + + return this + } +}) diff --git a/package/gluon-status-page/src/js/lib/gui/signalgraph.js b/package/gluon-status-page/src/js/lib/gui/signalgraph.js new file mode 100644 index 00000000..83732158 --- /dev/null +++ b/package/gluon-status-page/src/js/lib/gui/signalgraph.js @@ -0,0 +1,137 @@ +"use strict" +define(function () { + return function (canvas, min, max) { + var i = 0 + var graphWidth + var last = 0 + + var signals = [] + + var ctx = canvas.getContext("2d") + + resize() + + window.addEventListener("resize", resize, false) + window.requestAnimationFrame(step) + + function step(timestamp) { + var delta = timestamp - last + + if (delta > 40) { + draw() + last = timestamp + } + + window.requestAnimationFrame(step) + } + + function drawGrid() { + var gridctx = ctx + var nLines = Math.floor(canvas.height / 40) + gridctx.save() + gridctx.lineWidth = 0.5 + gridctx.strokeStyle = "rgba(0, 0, 0, 0.25)" + gridctx.fillStyle = "rgba(0, 0, 0, 0.5)" + gridctx.textAlign = "end" + gridctx.textBaseline = "bottom" + + gridctx.beginPath() + + for (var i = 0; i < nLines; i++) { + var y = canvas.height - i * 40 + gridctx.moveTo(0, y - 0.5) + gridctx.lineTo(canvas.width, y - 0.5) + var dBm = Math.round(scaleInverse(y, min, max, canvas.height)) + " dBm" + + gridctx.save() + gridctx.strokeStyle = "rgba(255, 255, 255, 0.9)" + gridctx.lineWidth = 4 + gridctx.miterLimit = 2 + gridctx.strokeText(dBm, canvas.width - 5, y - 2.5) + gridctx.fillText(dBm, canvas.width - 5, y - 2.5) + gridctx.restore() + } + + gridctx.stroke() + + gridctx.strokeStyle = "rgba(0, 0, 0, 0.83)" + gridctx.lineWidth = 1.5 + gridctx.strokeRect(0.5, 0.5, canvas.width - 1, canvas.height - 1) + + gridctx.restore() + } + + function draw() { + var anyHighlight = signals.some( function (d) { return d.getHighlight() }) + + signals.forEach( function (d) { + d.draw(i, function (v) { + return scale(v, min, max, canvas.height) + }) + }) + + ctx.clearRect(0, 0, canvas.width, canvas.height) + + ctx.save() + + signals.forEach( function (d) { + if (anyHighlight) + ctx.globalAlpha = 0.1 + + if (d.getHighlight()) + ctx.globalAlpha = 1 + + ctx.drawImage(d.canvas, 0, 0) + }) + + ctx.restore() + + ctx.save() + ctx.beginPath() + ctx.strokeStyle = "rgba(255, 180, 0, 0.15)" + ctx.lineWidth = 5 + ctx.moveTo(i + 2.5, 0) + ctx.lineTo(i + 2.5, canvas.height) + ctx.stroke() + + drawGrid() + + i = (i + 1) % graphWidth + } + + function scaleInverse(n, min, max, height) { + return (min * n + max * height - max * n) / height + } + + function scale(n, min, max, height) { + return (1 - (n - min) / (max - min)) * height + } + + function resize() { + var newWidth = canvas.parentNode.clientWidth + + if (newWidth === 0) + return + + var lastImage = ctx.getImageData(0, 0, newWidth, canvas.height) + canvas.width = newWidth + graphWidth = canvas.width + ctx.putImageData(lastImage, 0, 0) + + signals.forEach( function (d) { + d.resize(canvas.width, canvas.height) + }) + } + + this.add = function (d) { + signals.push(d) + d.resize(canvas.width, canvas.height) + + return function () { + signals = signals.filter( function (e) { return e !== d } ) + } + } + + return this + } +}) diff --git a/package/gluon-status-page/src/js/lib/gui/statistics.js b/package/gluon-status-page/src/js/lib/gui/statistics.js new file mode 100644 index 00000000..33a845d8 --- /dev/null +++ b/package/gluon-status-page/src/js/lib/gui/statistics.js @@ -0,0 +1,272 @@ +"use strict" +define(["lib/helper"], function (Helper) { + function streamElement(type, stream) { + var el = document.createElement(type) + el.destroy = stream.onValue(update) + + function update(d) { + el.textContent = d + } + + return el + } + + function streamNode(stream) { + var el = document.createTextNode("") + el.destroy = stream.onValue(update) + + function update(d) { + el.textContent = d + } + + return el + } + + function mkRow(table, label, stream) { + var tr = document.createElement("tr") + var th = document.createElement("th") + var td = streamElement("td", stream) + th.textContent = label + tr.appendChild(th) + tr.appendChild(td) + table.appendChild(tr) + + tr.destroy = function () { + td.destroy() + table.removeChild(tr) + } + + return tr + } + + function mkTrafficRow(table, children, label, stream, selector) { + var tr = document.createElement("tr") + var th = document.createElement("th") + var td = document.createElement("td") + th.textContent = label + + var traffic = stream.slidingWindow(2, 2) + var pkts = streamNode(traffic.map(deltaUptime(selector + ".packets")).map(prettyPackets)) + var bw = streamNode(traffic.map(deltaUptime(selector + ".bytes")).map(prettyBits)) + var bytes = streamNode(stream.map(selector).map(".bytes").map(prettyBytes)) + + td.appendChild(pkts) + td.appendChild(document.createElement("br")) + td.appendChild(bw) + td.appendChild(document.createElement("br")) + td.appendChild(bytes) + + tr.appendChild(th) + tr.appendChild(td) + table.appendChild(tr) + + children.push(pkts) + children.push(bw) + children.push(bytes) + } + + function mkMeshVPN(el, stream) { + var children = {} + var init = false + var h = document.createElement("h3") + h.textContent = "Mesh-VPN" + + var table = document.createElement("table") + + var unsubscribe = stream.onValue( function (d) { + function addPeer(peer, path) { + return { peer: peer, path: path } + } + + function addPeers(d, path) { + if (!("peers" in d)) + return [] + + var peers = [] + + for (var peer in d.peers) + peers.push(addPeer(peer, path + ".peers." + peer)) + + return peers + } + + function addGroup(d, path) { + var peers = [] + + peers = peers.concat(addPeers(d, path)) + + if ("groups" in d) + for (var group in d.groups) + peers = peers.concat(addGroup(d.groups[group], path + ".groups." + group)) + + return peers + } + + if (d === undefined) + clear() + + else { + if (!init) { + init = true + el.appendChild(h) + el.appendChild(table) + } + + var peers = addGroup(d, "") + var paths = new Set(peers.map(function (d) { return d.path } )) + + for (var path in children) + if (!paths.has(path)) { + children[path].destroy() + delete children[path] + } + + peers.forEach( function (peer) { + if (!(peer.path in children)) + children[peer.path] = mkRow(table, peer.peer, + stream.startWith(d) + .map(peer.path) + .filter(function (d) { return d !== undefined }) + .map(prettyPeer)) + }) + } + }) + + function clear() { + if (init) { + init = false + el.removeChild(h) + el.removeChild(table) + } + + for (var peer in children) + children[peer].destroy() + + children = {} + } + + function destroy() { + unsubscribe() + clear() + } + + return { destroy: destroy } + } + + function deltaUptime(selector) { + return function (d) { + var deltaTime = d[1].uptime - d[0].uptime + var d0 = Helper.dictGet(d[0], selector.split(".").splice(1)) + var d1 = Helper.dictGet(d[1], selector.split(".").splice(1)) + + return (d1 - d0) / deltaTime + } + } + + function prettyPeer(d) { + if (d === null) + return "nicht verbunden" + else + return "verbunden (" + prettyUptime(d.established) + ")" + } + + function prettyPackets(d) { + var v = new Intl.NumberFormat("de-DE", {maximumFractionDigits: 0}).format(d) + return v + " Pakete/s" + } + + function prettyPrefix(prefixes, step, d) { + var prefix = 0 + + while (d > step && prefix < 4) { + d /= step + prefix++ + } + + d = new Intl.NumberFormat("de-DE", {maximumSignificantDigits: 3}).format(d) + return d + " " + prefixes[prefix] + } + + function prettyBits(d) { + return prettyPrefix([ "bps", "kbps", "Mbps", "Gbps" ], 1024, d * 8) + } + + function prettyBytes(d) { + return prettyPrefix([ "B", "kB", "MB", "GB" ], 1024, d) + } + + function prettyUptime(seconds) { + var minutes = Math.round(seconds / 60) + + var days = Math.floor(minutes / 1440) + var hours = Math.floor((minutes % 1440) / 60) + minutes = Math.floor(minutes % 60) + + var out = "" + + if (days === 1) + out += "1 Tag, " + else if (days > 1) + out += days + " Tage, " + + out += hours + ":" + + if (minutes < 10) + out += "0" + + out += minutes + + return out + } + + function prettyNVRAM(usage) { + return new Intl.NumberFormat("de-DE", {maximumSignificantDigits: 3}).format(usage * 100) + "% belegt" + } + + function prettyLoad(load) { + return new Intl.NumberFormat("de-DE", {maximumSignificantDigits: 3}).format(load) + } + + function prettyRAM(memory) { + var usage = 1 - (memory.free + memory.buffers + memory.cached) / memory.total + return prettyNVRAM(usage) + } + + return function (stream) { + var children = [] + var el = document.createElement("div") + var table = document.createElement("table") + + children.push(mkRow(table, "Laufzeit", stream.map(".uptime").map(prettyUptime))) + children.push(mkRow(table, "Systemlast", stream.map(".loadavg").map(prettyLoad))) + children.push(mkRow(table, "RAM", stream.map(".memory").map(prettyRAM))) + children.push(mkRow(table, "NVRAM", stream.map(".rootfs_usage").map(prettyNVRAM))) + children.push(mkRow(table, "Gateway", stream.map(".gateway"))) + children.push(mkRow(table, "Clients", stream.map(".clients.total"))) + + el.appendChild(table) + + var h = document.createElement("h3") + h.textContent = "Traffic" + el.appendChild(h) + + table = document.createElement("table") + + mkTrafficRow(table, children, "Gesendet", stream, ".traffic.rx") + mkTrafficRow(table, children, "Empfangen", stream, ".traffic.tx") + mkTrafficRow(table, children, "Weitergeleitet", stream, ".traffic.forward") + + el.appendChild(table) + + children.push(mkMeshVPN(el, stream.map(".mesh_vpn"))) + + function destroy() { + children.forEach(function (d) {d.destroy()}) + } + + return { title: document.createTextNode("Statistik") + , render: function (d) { d.appendChild(el) } + , destroy: destroy + } + } +}) diff --git a/package/gluon-status-page/src/js/lib/helper.js b/package/gluon-status-page/src/js/lib/helper.js new file mode 100644 index 00000000..6b39bc0a --- /dev/null +++ b/package/gluon-status-page/src/js/lib/helper.js @@ -0,0 +1,71 @@ +"use strict" +define([ "bacon" ], function (Bacon) { + function get(url) { + return Bacon.fromBinder(function(sink) { + var req = new XMLHttpRequest() + req.open("GET", url) + + req.onload = function() { + if (req.status === 200) + sink(new Bacon.Next(req.response)) + else + sink(new Bacon.Error(req.statusText)) + sink(new Bacon.End()) + } + + req.onerror = function() { + sink(new Bacon.Error("network error")) + sink(new Bacon.End()) + } + + req.send() + + return function () {} + }) + } + + function getJSON(url) { + return get(url).map(JSON.parse) + } + + function buildUrl(ip, object, param) { + var url = "http://[" + ip + "]/cgi-bin/" + object + if (param) url += "?" + param + + return url + } + + function request(ip, object, param) { + return getJSON(buildUrl(ip, object, param)) + } + + function dictGet(dict, key) { + var k = key.shift() + + if (!(k in dict)) + return null + + if (key.length === 0) + return dict[k] + + return dictGet(dict[k], key) + } + + function haversine() { + var radians = Array.prototype.map.call(arguments, function(deg) { return deg / 180.0 * Math.PI }) + var lat1 = radians[0], lon1 = radians[1], lat2 = radians[2], lon2 = radians[3] + var R = 6372.8 // km + var dLat = lat2 - lat1 + var dLon = lon2 - lon1 + var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.sin(dLon / 2) * Math.sin(dLon / 2) * Math.cos(lat1) * Math.cos(lat2) + var c = 2 * Math.asin(Math.sqrt(a)) + return R * c + } + + return { buildUrl: buildUrl + , request: request + , getJSON: getJSON + , dictGet: dictGet + , haversine: haversine + } +}) diff --git a/package/gluon-status-page/src/js/lib/neighbourstream.js b/package/gluon-status-page/src/js/lib/neighbourstream.js new file mode 100644 index 00000000..dbe42a34 --- /dev/null +++ b/package/gluon-status-page/src/js/lib/neighbourstream.js @@ -0,0 +1,132 @@ +"use strict" +define([ "bacon" + , "lib/helper" + , "lib/streams" + ], function(Bacon, Helper, Streams) { + + return function (mgmtBus, nodesBus, ip) { + function nodeQuerier() { + var asked = {} + var timeout = 6000 + + return function (ifname) { + var now = new Date().getTime() + + if (ifname in asked && now - asked[ifname] < timeout) + return Bacon.never() + + asked[ifname] = now + return Streams.nodeInfo(ip, ifname).map(function (d) { + return { "ifname": ifname + , "nodeInfo": d + } + }) + } + } + + var querierAsk = new Bacon.Bus() + var querier = querierAsk.flatMap(nodeQuerier()) + querier.map(".nodeInfo").onValue(mgmtBus, "pushEvent", "nodeinfo") + + function wrapIfname(ifname, d) { + return [ifname, d] + } + + function extractIfname(d) { + var r = {} + + for (var station in d) { + var ifname = d[station].ifname + delete d[station].ifname + + if (!(ifname in r)) + r[ifname] = {} + + r[ifname][station] = d[station] + } + + return r + } + + function stationsStream(ifname) { + return new Streams.Stations(ip, ifname).map(wrapIfname, ifname) + } + + function magic(interfaces) { + var ifnames = Object.keys(interfaces) + ifnames.forEach(querierAsk.push) + + var wifiStream = Bacon.fromArray(ifnames) + .flatMap(stationsStream) + .scan({}, function (a, b) { + a[b[0]] = b[1] + return a + }) + + var batadvStream = new Streams.Batadv(ip).toProperty({}) + + return Bacon.combineWith(combine, wifiStream + , batadvStream.map(extractIfname) + , nodesBus.map(".macs") + ) + } + + function combine(wifi, batadv, macs) { + var interfaces = combineWithIfnames(wifi, batadv) + + for (var ifname in interfaces) { + var stations = interfaces[ifname] + for (var station in stations) { + stations[station].id = station + + if (station in macs) + stations[station].nodeInfo = macs[station] + else + querierAsk.push(ifname) + } + } + + return interfaces + } + + function combineWithIfnames(wifi, batadv) { + var ifnames = Object.keys(wifi).concat(Object.keys(batadv)) + + // remove duplicates + ifnames.filter(function(e, i) { + return ifnames.indexOf(e) === i + }) + + var out = {} + + ifnames.forEach(function (ifname) { + out[ifname] = combineWifiBatadv(wifi[ifname], batadv[ifname]) + }) + + return out + } + + function combineWifiBatadv(wifi, batadv) { + var station + var out = {} + + for (station in batadv) { + if (!(station in out)) + out[station] = {} + + out[station].batadv = batadv[station] + } + + for (station in wifi) { + if (!(station in out)) + out[station] = {} + + out[station].wifi = wifi[station] + } + + return out + } + + return Helper.request(ip, "interfaces").flatMap(magic) + } +}) diff --git a/package/gluon-status-page/src/js/lib/streams.js b/package/gluon-status-page/src/js/lib/streams.js new file mode 100644 index 00000000..50286b74 --- /dev/null +++ b/package/gluon-status-page/src/js/lib/streams.js @@ -0,0 +1,66 @@ +"use strict" +define(["bacon", "lib/helper"], function(Bacon, Helper) { + function nodeInfo(ip, ifname) { + return Bacon.fromBinder(function (sink) { + var url = Helper.buildUrl(ip, "dyn/neighbours-nodeinfo", ifname) + var evtSource = new EventSource(url) + + evtSource.addEventListener("neighbour", function(e) { + var r = sink(new Bacon.Next(JSON.parse(e.data))) + + if (r === Bacon.noMore) + tearDown() + }, false) + + evtSource.addEventListener("eot", function() { + evtSource.close() + sink(new Bacon.End()) + }, false) + + function tearDown() { + evtSource.close() + } + + return tearDown + }) + } + + function simpleStream(url) { + return Bacon.fromBinder(function (sink) { + var evtSource = new EventSource(url) + + evtSource.onmessage = function (e) { + var r = sink(new Bacon.Next(JSON.parse(e.data))) + if (r === Bacon.noMore) + tearDown() + } + + function tearDown() { + evtSource.close() + } + + return tearDown + }) + } + + function batadv(ip) { + var url = Helper.buildUrl(ip, "dyn/neighbours-batadv") + return simpleStream(url) + } + + function stations(ip, ifname) { + var url = Helper.buildUrl(ip, "dyn/stations", ifname) + return simpleStream(url) + } + + function statistics(ip) { + var url = Helper.buildUrl(ip, "dyn/statistics") + return simpleStream(url) + } + + return { nodeInfo: nodeInfo + , Batadv: batadv + , Stations: stations + , Statistics: statistics + } +}) diff --git a/package/gluon-status-page/src/js/main.js b/package/gluon-status-page/src/js/main.js new file mode 100644 index 00000000..3bdbe2a0 --- /dev/null +++ b/package/gluon-status-page/src/js/main.js @@ -0,0 +1,108 @@ +"use strict" +require([ "bacon" + , "lib/helper" + , "lib/streams" + , "lib/gui" + ], function(Bacon, Helper, Streams, GUI) { + + var mgmtBus = new Bacon.Bus() + + mgmtBus.pushEvent = function (key, a) { + var v = [key].concat(a) + return this.push(v) + } + + mgmtBus.onEvent = function (events) { + return this.onValue(function (e) { + var d = e.slice() // shallow copy so calling shift doesn't change it + var ev = d.shift() + if (ev in events) + events[ev].apply(this, d) + }) + } + + var nodesBusIn = new Bacon.Bus() + + var nodesBus = nodesBusIn.scan({ "nodes": {} + , "macs": {} + }, scanNodeInfo) + + new GUI(mgmtBus, nodesBus) + + mgmtBus.onEvent({ "goto": gotoNode + , "nodeinfo": function (d) { nodesBusIn.push(d) } + }) + + function tryIp(ip) { + return Helper.request(ip, "nodeinfo").map(function () { return ip }) + } + + var gotoEpoch = 0 + + function onEpoch(epoch, f) { + return function (d) { + if (epoch === gotoEpoch) + return f(d) + } + } + + function gotoNode(nodeInfo) { + gotoEpoch++ + + var addresses = nodeInfo.network.addresses.filter(function (d) { return !/^fe80:/.test(d) }) + var race = Bacon.fromArray(addresses).flatMap(tryIp).withStateMachine([], function (acc, ev) { + if (ev.isError()) + return [acc.concat(ev.error), []] + else if (ev.isEnd() && acc.length > 0) + return [undefined, [new Bacon.Error(acc), ev]] + else if (ev.hasValue()) + return [[], [ev, new Bacon.End()]] + }) + + race.onValue(onEpoch(gotoEpoch, function (d) { + mgmtBus.pushEvent("arrived", [nodeInfo, d]) + })) + + race.onError(onEpoch(gotoEpoch, function () { + mgmtBus.pushEvent("gotoFailed", nodeInfo) + })) + } + + function scanNodeInfo(a, nodeInfo) { + a.nodes[nodeInfo.node_id] = nodeInfo + + var mesh = Helper.dictGet(nodeInfo, ["network", "mesh"]) + + if (mesh) + for (var m in mesh) + for (var ifname in mesh[m].interfaces) + mesh[m].interfaces[ifname].forEach( function (d) { + a.macs[d] = nodeInfo + }) + + return a + } + + if (localStorage.nodes) + JSON.parse(localStorage.nodes).forEach(nodesBusIn.push) + + nodesBus.map(".nodes").onValue(function (nodes) { + var out = [] + + for (var k in nodes) + out.push(nodes[k]) + + localStorage.nodes = JSON.stringify(out) + }) + + var bootstrap = Helper.getJSON(bootstrapUrl) + + bootstrap.onError(function () { + console.log("FIXME bootstrapping failed") + }) + + bootstrap.onValue(function (d) { + mgmtBus.pushEvent("nodeinfo", d) + mgmtBus.pushEvent("goto", d) + }) +}) From 431ac81407919f9e2a88ea1328cafaf3cdf30f2e Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Tue, 1 Sep 2015 20:08:13 +0200 Subject: [PATCH 105/867] gluon-status-page-api: split API from gluon-status-page This will make it easier to replace the API with C programs. --- package/gluon-status-page-api/Makefile | 31 +++++++++++++++++++ .../announce/nodeinfo.d/software/status-page | 0 .../www/cgi-bin/dyn/neighbours-batadv | 0 .../www/cgi-bin/dyn/neighbours-nodeinfo | 0 .../status-page/www/cgi-bin/dyn/stations | 0 .../status-page/www/cgi-bin/dyn/statistics | 0 .../gluon/status-page/www/cgi-bin/interfaces | 0 .../gluon/status-page/www/cgi-bin/nodeinfo | 0 .../lib/gluon/upgrade/500-status-page-api} | 0 package/gluon-status-page/Makefile | 4 +-- 10 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 package/gluon-status-page-api/Makefile rename package/{gluon-status-page => gluon-status-page-api}/files/lib/gluon/announce/nodeinfo.d/software/status-page (100%) rename package/{gluon-status-page => gluon-status-page-api}/files/lib/gluon/status-page/www/cgi-bin/dyn/neighbours-batadv (100%) rename package/{gluon-status-page => gluon-status-page-api}/files/lib/gluon/status-page/www/cgi-bin/dyn/neighbours-nodeinfo (100%) rename package/{gluon-status-page => gluon-status-page-api}/files/lib/gluon/status-page/www/cgi-bin/dyn/stations (100%) rename package/{gluon-status-page => gluon-status-page-api}/files/lib/gluon/status-page/www/cgi-bin/dyn/statistics (100%) rename package/{gluon-status-page => gluon-status-page-api}/files/lib/gluon/status-page/www/cgi-bin/interfaces (100%) rename package/{gluon-status-page => gluon-status-page-api}/files/lib/gluon/status-page/www/cgi-bin/nodeinfo (100%) rename package/{gluon-status-page/files/lib/gluon/upgrade/500-status-page => gluon-status-page-api/files/lib/gluon/upgrade/500-status-page-api} (100%) diff --git a/package/gluon-status-page-api/Makefile b/package/gluon-status-page-api/Makefile new file mode 100644 index 00000000..2b32a2ea --- /dev/null +++ b/package/gluon-status-page-api/Makefile @@ -0,0 +1,31 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=gluon-status-page-api +PKG_VERSION:=1 +PKG_RELEASE:=1 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +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-lua +luci-lib-jsonc +endef + +define Build/Prepare +endef + +define Build/Configure +endef + +define Build/Compile +endef + +define Package/gluon-status-page-api/install + $(CP) ./files/* $(1)/ +endef + +$(eval $(call BuildPackage,gluon-status-page-api)) diff --git a/package/gluon-status-page/files/lib/gluon/announce/nodeinfo.d/software/status-page b/package/gluon-status-page-api/files/lib/gluon/announce/nodeinfo.d/software/status-page similarity index 100% rename from package/gluon-status-page/files/lib/gluon/announce/nodeinfo.d/software/status-page rename to package/gluon-status-page-api/files/lib/gluon/announce/nodeinfo.d/software/status-page diff --git a/package/gluon-status-page/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 similarity index 100% rename from package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/dyn/neighbours-batadv rename to package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/dyn/neighbours-batadv diff --git a/package/gluon-status-page/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 similarity index 100% rename from package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/dyn/neighbours-nodeinfo rename to package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/dyn/neighbours-nodeinfo diff --git a/package/gluon-status-page/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 similarity index 100% rename from package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/dyn/stations rename to package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/dyn/stations diff --git a/package/gluon-status-page/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 similarity index 100% rename from package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/dyn/statistics rename to package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/dyn/statistics diff --git a/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/interfaces b/package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/interfaces similarity index 100% rename from package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/interfaces rename to package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/interfaces diff --git a/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/nodeinfo b/package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/nodeinfo similarity index 100% rename from package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/nodeinfo rename to package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/nodeinfo diff --git a/package/gluon-status-page/files/lib/gluon/upgrade/500-status-page b/package/gluon-status-page-api/files/lib/gluon/upgrade/500-status-page-api similarity index 100% rename from package/gluon-status-page/files/lib/gluon/upgrade/500-status-page rename to package/gluon-status-page-api/files/lib/gluon/upgrade/500-status-page-api diff --git a/package/gluon-status-page/Makefile b/package/gluon-status-page/Makefile index 2543ea2a..bfcdd91b 100644 --- a/package/gluon-status-page/Makefile +++ b/package/gluon-status-page/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gluon-status-page -PKG_VERSION:=1 +PKG_VERSION:=2 PKG_RELEASE:=1 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) @@ -12,7 +12,7 @@ define Package/gluon-status-page SECTION:=gluon CATEGORY:=Gluon TITLE:=Adds a status page showing information about the node. - DEPENDS:=+gluon-core +uhttpd +gluon-neighbour-info +gluon-announce +libiwinfo-lua +luci-lib-jsonc + DEPENDS:=+gluon-status-page-api endef define Package/gluon-status-page/description From 4b8f6c98355ebef8a6c56eacfbb93c7b1cfc414a Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Tue, 1 Sep 2015 22:49:26 +0200 Subject: [PATCH 106/867] gluon-status-page-api: rewrite neighbours-batadv in C --- package/gluon-status-page-api/Makefile | 12 ++-- .../www/cgi-bin/dyn/neighbours-batadv | 32 --------- package/gluon-status-page-api/src/Makefile | 7 ++ .../src/neighbours-batadv.c | 65 +++++++++++++++++++ 4 files changed, 77 insertions(+), 39 deletions(-) delete mode 100755 package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/dyn/neighbours-batadv create mode 100644 package/gluon-status-page-api/src/Makefile create mode 100755 package/gluon-status-page-api/src/neighbours-batadv.c diff --git a/package/gluon-status-page-api/Makefile b/package/gluon-status-page-api/Makefile index 2b32a2ea..863bbc39 100644 --- a/package/gluon-status-page-api/Makefile +++ b/package/gluon-status-page-api/Makefile @@ -12,19 +12,17 @@ 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-lua +luci-lib-jsonc + DEPENDS:=+gluon-core +uhttpd +gluon-neighbour-info +gluon-announced +libiwinfo +libjson-c endef define Build/Prepare -endef - -define Build/Configure -endef - -define Build/Compile + mkdir -p $(PKG_BUILD_DIR) + $(CP) ./src/* $(PKG_BUILD_DIR)/ 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/ $(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 deleted file mode 100755 index 3bcdf89b..00000000 --- a/package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/dyn/neighbours-batadv +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/lua - -local json = require 'luci.jsonc' -local nixio = require 'nixio' - -function neighbours() - local neighbours = {} - local list = io.lines("/sys/kernel/debug/batman_adv/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 - neighbours[mac1] = { tq = tonumber(tq) - , lastseen = tonumber(lastseen) - , ifname = ifname - } - end - end - - return neighbours -end - -io.write("Access-Control-Allow-Origin: *\n") -io.write("Content-type: text/event-stream\n\n") - -while true do - local neighbours = json.stringify(neighbours()) - io.write("data: " .. neighbours .. "\n\n") - io.flush() - nixio.nanosleep(1, 0) -end diff --git a/package/gluon-status-page-api/src/Makefile b/package/gluon-status-page-api/src/Makefile new file mode 100644 index 00000000..499bb55b --- /dev/null +++ b/package/gluon-status-page-api/src/Makefile @@ -0,0 +1,7 @@ +CFLAGS += $(shell pkg-config --cflags json-c) +LDFLAGS += $(shell pkg-config --libs json-c) + +all: neighbours-batadv + +neighbours-batadv: neighbours-batadv.c + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -Wall -o $@ $^ $(LDLIBS) diff --git a/package/gluon-status-page-api/src/neighbours-batadv.c b/package/gluon-status-page-api/src/neighbours-batadv.c new file mode 100755 index 00000000..a386b5e0 --- /dev/null +++ b/package/gluon-status-page-api/src/neighbours-batadv.c @@ -0,0 +1,65 @@ +#include +#include +#include +#include +#include + +#define STR(x) #x +#define XSTR(x) STR(x) + +static json_object *neighbours(void) { + struct json_object *obj = json_object_new_object(); + + FILE *f; + + f = fopen("/sys/kernel/debug/batman_adv/bat0/originators" , "r"); + + if (f == NULL) { + perror("Can not open bat0/originators"); + exit(1); + } + + while (!feof(f)) { + char mac1[18]; + char mac2[18]; + char ifname[IF_NAMESIZE+1]; + int tq; + double lastseen; + + int count = fscanf(f, "%17s%*[\t ]%lfs%*[\t (]%d) %17s%*[[ ]%" XSTR(IF_NAMESIZE) "[^]]]", mac1, &lastseen, &tq, mac2, ifname); + + if (count != 5) + continue; + + if (strcmp(mac1, mac2) == 0) { + struct json_object *neigh = json_object_new_object(); + + json_object_object_add(neigh, "tq", json_object_new_int(tq)); + json_object_object_add(neigh, "lastseen", json_object_new_double(lastseen)); + json_object_object_add(neigh, "ifname", json_object_new_string(ifname)); + + json_object_object_add(obj, mac1, neigh); + } + } + + fclose(f); + + return obj; +} + +int main(void) { + struct json_object *obj; + + printf("Access-Control-Allow-Origin: *\n"); + printf("Content-type: text/event-stream\n\n"); + + 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); + } + + return 0; +} From 8be372a590151b6d4f4dc7f37571e8acf5bf9944 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Wed, 2 Sep 2015 16:22:12 +0200 Subject: [PATCH 107/867] gluon-status-page-api: rewrite stations in C --- package/gluon-status-page-api/Makefile | 1 + .../status-page/www/cgi-bin/dyn/stations | 52 ----------- package/gluon-status-page-api/src/Makefile | 7 +- package/gluon-status-page-api/src/stations.c | 88 +++++++++++++++++++ 4 files changed, 95 insertions(+), 53 deletions(-) delete mode 100755 package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/dyn/stations create mode 100755 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 863bbc39..91a7095a 100644 --- a/package/gluon-status-page-api/Makefile +++ b/package/gluon-status-page-api/Makefile @@ -23,6 +23,7 @@ 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/ $(CP) ./files/* $(1)/ endef 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 deleted file mode 100755 index 637de649..00000000 --- a/package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/dyn/stations +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/lua - -util = require 'luci.util' -json = require 'luci.jsonc' -nixio = require 'nixio' -iwinfo = require 'iwinfo' - -function badrequest() - io.write("Status: 400 Bad Request\n\n") - os.exit(1) -end - -function get_stations(iw, ifname) - local stations = {} - - for k, v in pairs(iw.assoclist(ifname)) do - stations[k:lower()] = {signal = v.signal, noise = v.noise, inactive = v.inactive} - end - - return stations -end - -local ifname = os.getenv("QUERY_STRING") - -if ifname == nil then badrequest() end - -local list = util.exec('batctl if') -local found = false -for _, line in ipairs(util.split(list)) do - if ifname == line:match('^(.-):') then - found = true - break - end -end - -if found == false then badrequest() end - -local wifitype = iwinfo.type(ifname) - -if wifitype == nil then badrequest() end - -local iw = iwinfo[wifitype] - -io.write("Access-Control-Allow-Origin: *\n") -io.write("Content-type: text/event-stream\n\n") - -while true do - local stations = json.stringify(get_stations(iw, ifname)) - io.write("data: " .. stations .. "\n\n") - io.flush() - nixio.nanosleep(0, 150e6) -end diff --git a/package/gluon-status-page-api/src/Makefile b/package/gluon-status-page-api/src/Makefile index 499bb55b..f0bee975 100644 --- a/package/gluon-status-page-api/src/Makefile +++ b/package/gluon-status-page-api/src/Makefile @@ -1,7 +1,12 @@ +CFLAGS += -std=c99 -D_BSD_SOURCE + CFLAGS += $(shell pkg-config --cflags json-c) LDFLAGS += $(shell pkg-config --libs json-c) -all: neighbours-batadv +all: neighbours-batadv stations neighbours-batadv: neighbours-batadv.c $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -Wall -o $@ $^ $(LDLIBS) + +stations: stations.c + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -Wall -o $@ $^ $(LDLIBS) -liwinfo diff --git a/package/gluon-status-page-api/src/stations.c b/package/gluon-status-page-api/src/stations.c new file mode 100755 index 00000000..9cae3680 --- /dev/null +++ b/package/gluon-status-page-api/src/stations.c @@ -0,0 +1,88 @@ +#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; + char buf[IWINFO_BUFSIZE]; + struct json_object *stations = json_object_new_object(); + + if (iw->assoclist(ifname, buf, &len) == -1) + return stations; + + // This is just: for entry in assoclist(ifname) + for (struct iwinfo_assoclist_entry *entry = (struct iwinfo_assoclist_entry *)buf; + (char*)(entry+1) <= buf + len; entry++) { + struct json_object *station = json_object_new_object(); + + json_object_object_add(station, "signal", json_object_new_int(entry->signal)); + json_object_object_add(station, "noise", json_object_new_int(entry->noise)); + json_object_object_add(station, "inactive", json_object_new_int(entry->inactive)); + + char macstr[18]; + + snprintf(macstr, sizeof(macstr), "%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(stations, macstr, station); + } + + return stations; +} + +static void badrequest() { + printf("Status: 400 Bad Request\n\n"); + 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)) + badrequest(); + + 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) { + struct json_object *obj; + obj = get_stations(iw, ifname); + printf("data: %s\n\n", json_object_to_json_string_ext(obj, JSON_C_TO_STRING_PLAIN)); + fflush(stdout); + json_object_put(obj); + usleep(150000); + } + + return 0; +} From 014f5751c8730b83b5695f70a13facc9cd14d923 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Wed, 2 Sep 2015 16:25:32 +0200 Subject: [PATCH 108/867] gluon-status-page-api: increase uhttp.max_requests to 32 Now that the status page api has been rewritten in C CPU load and memory usage is much lower. Also, nodes with both ibss and 11s mesh and dual band wifi may require up to 9 connections for a single client, thus the previous limit of 12 seemed a little low. --- .../files/lib/gluon/upgrade/500-status-page-api | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/gluon-status-page-api/files/lib/gluon/upgrade/500-status-page-api b/package/gluon-status-page-api/files/lib/gluon/upgrade/500-status-page-api index 71eca5b1..a5000012 100755 --- a/package/gluon-status-page-api/files/lib/gluon/upgrade/500-status-page-api +++ b/package/gluon-status-page-api/files/lib/gluon/upgrade/500-status-page-api @@ -9,7 +9,7 @@ uci batch <<-EOF set uhttpd.main.home=/lib/gluon/status-page/www - set uhttpd.main.max_requests=12 + set uhttpd.main.max_requests=32 commit uhttpd EOF From a71ab2fb7221391c0f4f64a38a7f03aa6859e880 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 6 Sep 2015 01:36:56 +0200 Subject: [PATCH 109/867] Get rid of rpcd 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. Fixes #452 --- ...ency-from-luci-base-to-luci-mode-rpc.patch | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 patches/packages/luci/0009-Move-rpcd-dependency-from-luci-base-to-luci-mode-rpc.patch diff --git a/patches/packages/luci/0009-Move-rpcd-dependency-from-luci-base-to-luci-mode-rpc.patch b/patches/packages/luci/0009-Move-rpcd-dependency-from-luci-base-to-luci-mode-rpc.patch new file mode 100644 index 00000000..5c9445f9 --- /dev/null +++ b/patches/packages/luci/0009-Move-rpcd-dependency-from-luci-base-to-luci-mode-rpc.patch @@ -0,0 +1,33 @@ +From: Matthias Schiffer +Date: Sun, 6 Sep 2015 01:27:06 +0200 +Subject: Move rpcd dependency from luci-base to luci-mode-rpc + +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 +--- 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 + + PKG_SOURCE:=LuaSrcDiet-0.12.1.tar.bz2 + PKG_SOURCE_URL:=https://luasrcdiet.googlecode.com/files +diff --git a/modules/luci-mod-rpc/Makefile b/modules/luci-mod-rpc/Makefile +index e64c86c..5f64a14 100644 +--- a/modules/luci-mod-rpc/Makefile ++++ b/modules/luci-mod-rpc/Makefile +@@ -7,7 +7,7 @@ + include $(TOPDIR)/rules.mk + + LUCI_TITLE:=LuCI RPC - JSON-RPC API +-LUCI_DEPENDS:=+luci-lib-json ++LUCI_DEPENDS:=+luci-lib-json +rpcd + + include ../../luci.mk + From 2a9d7d82cbe487a599c880dbcb025fd86a4e6f9c Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Sat, 5 Sep 2015 19:15:34 +0200 Subject: [PATCH 110/867] contributing: mention "rejected features" wiki page --- CONTRIBUTING.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 119fd8d3..05aab92d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,7 +25,10 @@ after merging the changes, too. The preferred way to discuss in the IRC channel ([#gluon] on irc.hackint.org) or on the [mailing list], however, you can also open a new issue on Github to -discuss there. +discuss there. We maintain a [list of rejected +features](https://github.com/freifunk-gluon/gluon/issues?q=label%3Arejected) +and we'd like to kindly ask you to review it first. In general, looking for +duplicates may save you some time. Develop on top of master ------------------------ From b465504ae8501250274be98c61000106c67617ce Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 13 Sep 2015 14:32:53 +0200 Subject: [PATCH 111/867] add: info for 802.11s interface additional information for commit 2a93c580428d10724116b0d2d1238e2745715a14 --- package/gluon-core/files/usr/lib/lua/gluon/util.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/package/gluon-core/files/usr/lib/lua/gluon/util.lua b/package/gluon-core/files/usr/lib/lua/gluon/util.lua index 86b86805..d9df636f 100644 --- a/package/gluon-core/files/usr/lib/lua/gluon/util.lua +++ b/package/gluon-core/files/usr/lib/lua/gluon/util.lua @@ -79,6 +79,7 @@ end -- (2, n): client interface for the n'th radio -- (3, n): adhoc interface for n'th radio -- (4, 0): mesh VPN +-- (5, n): mesh interface for n'th radio (802.11s) function generate_mac(f, i) local m1, m2, m3, m4, m5, m6 = string.match(sysconfig.primary_mac, '(%x%x):(%x%x):(%x%x):(%x%x):(%x%x):(%x%x)') m1 = nixio.bit.bor(tonumber(m1, 16), 0x02) From f03ccf86d6e3d28548d1cad4d4e68f6735b78d22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20R=C3=BCttgers?= Date: Sat, 12 Sep 2015 16:17:14 +0200 Subject: [PATCH 112/867] Add support for x86-xen_domu target Config for rootfs and grub is not needed anymore (https://dev.openwrt.org/ticket/18074) Config file not needed anymore (set implicitly by gluon now) Avoid empty vars --- targets/targets.mk | 1 + targets/x86-xen_domu/profiles.mk | 4 ++++ targets/x86-xen_domu/vermagic | 1 + 3 files changed, 6 insertions(+) create mode 100644 targets/x86-xen_domu/profiles.mk create mode 100644 targets/x86-xen_domu/vermagic diff --git a/targets/targets.mk b/targets/targets.mk index 3712eace..95b868be 100644 --- a/targets/targets.mk +++ b/targets/targets.mk @@ -4,6 +4,7 @@ $(eval $(call GluonTarget,mpc85xx,generic)) $(eval $(call GluonTarget,x86,generic)) $(eval $(call GluonTarget,x86,kvm_guest)) $(eval $(call GluonTarget,x86,64)) +$(eval $(call GluonTarget,x86,xen_domu)) ifneq ($(BROKEN),) $(eval $(call GluonTarget,ramips,rt305x)) # BROKEN: No AP+IBSS support diff --git a/targets/x86-xen_domu/profiles.mk b/targets/x86-xen_domu/profiles.mk new file mode 100644 index 00000000..c104067b --- /dev/null +++ b/targets/x86-xen_domu/profiles.mk @@ -0,0 +1,4 @@ +$(eval $(call GluonProfile,GENERIC)) +$(eval $(call GluonProfileFactorySuffix,GENERIC,-ext4,.img.gz)) +$(eval $(call GluonProfileSysupgradeSuffix,GENERIC,-ext4,.img.gz)) +$(eval $(call GluonModel,GENERIC,combined,x86-xen)) diff --git a/targets/x86-xen_domu/vermagic b/targets/x86-xen_domu/vermagic new file mode 100644 index 00000000..1e646eda --- /dev/null +++ b/targets/x86-xen_domu/vermagic @@ -0,0 +1 @@ +bce85557e89d5a4f30d6d723503b1a61 From 439f00d576f14c9b9b0a9aaba374a8060a6db5f5 Mon Sep 17 00:00:00 2001 From: Ruben Barkow Date: Mon, 14 Sep 2015 11:40:10 +0200 Subject: [PATCH 113/867] Typo "everybode" --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 119fd8d3..ffd33759 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -56,7 +56,7 @@ If you developed your change in multiple smaller commits, you can easily [squash] those before opening the pull request. While discussing, it is okay to do your changes using `git commit --amend` and force-push them to your head of the pull request. This way, your change always consists of only one commit and -can be merged in the instant everybode is content with the whole thing. +can be merged in the instant everybody is content with the whole thing. [community repositories]: http://gluon.readthedocs.org/en/latest/user/site.html#packages From be49f755c718956f62aabdd18bf8b6410fc4f288 Mon Sep 17 00:00:00 2001 From: Ruben Barkow Date: Sat, 12 Sep 2015 17:32:31 +0200 Subject: [PATCH 114/867] docs: Suggest peer limit 1 instead of 2 --- docs/site-example/site.conf | 2 +- docs/user/site.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/site-example/site.conf b/docs/site-example/site.conf index 1580d901..a0e95ebd 100644 --- a/docs/site-example/site.conf +++ b/docs/site-example/site.conf @@ -94,7 +94,7 @@ groups = { backbone = { -- Limit number of connected peers to reduce bandwidth. - limit = 2, + limit = 1, -- List of peers. peers = { diff --git a/docs/user/site.rst b/docs/user/site.rst index 055d43ba..76cecd6b 100644 --- a/docs/user/site.rst +++ b/docs/user/site.rst @@ -141,7 +141,7 @@ fastd_mesh_vpn mtu = 1426, groups = { backbone = { - limit = 2, + limit = 1, peers = { peer1 = { key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', From 0035aa2989fcf0bb3f8f2049df9a91f4049f864a Mon Sep 17 00:00:00 2001 From: Ruben Barkow Date: Sat, 12 Sep 2015 17:31:26 +0200 Subject: [PATCH 115/867] docs: Suggest MTU 1280 to circumvent Kabel Deutschland problems --- docs/site-example/site.conf | 2 +- docs/user/site.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/site-example/site.conf b/docs/site-example/site.conf index 1580d901..cab80f96 100644 --- a/docs/site-example/site.conf +++ b/docs/site-example/site.conf @@ -90,7 +90,7 @@ -- enabled = true, -- configurable = true, - mtu = 1426, + mtu = 1280, groups = { backbone = { -- Limit number of connected peers to reduce bandwidth. diff --git a/docs/user/site.rst b/docs/user/site.rst index 055d43ba..9b402045 100644 --- a/docs/user/site.rst +++ b/docs/user/site.rst @@ -138,7 +138,7 @@ fastd_mesh_vpn methods = {'salsa2012+umac'}, -- enabled = true, -- configurable = true, - mtu = 1426, + mtu = 1280, groups = { backbone = { limit = 2, From 16888d214da2663684666600f13c0234ae4211f7 Mon Sep 17 00:00:00 2001 From: srauscher Date: Thu, 17 Sep 2015 07:28:09 +0200 Subject: [PATCH 116/867] Add french translation --- docs/site-example/i18n/fr.po | 43 +++++++ .../gluon-config-mode-autoupdater/i18n/fr.po | 17 +++ .../gluon-config-mode-contact-info/i18n/fr.po | 25 ++++ package/gluon-config-mode-core/i18n/fr.po | 23 ++++ .../gluon-config-mode-geo-location/i18n/fr.po | 35 ++++++ package/gluon-config-mode-hostname/i18n/fr.po | 14 +++ package/gluon-config-mode-mesh-vpn/i18n/fr.po | 36 ++++++ package/gluon-luci-admin/i18n/fr.po | 110 ++++++++++++++++++ package/gluon-luci-autoupdater/i18n/fr.po | 17 +++ package/gluon-luci-mesh-vpn-fastd/i18n/fr.po | 37 ++++++ package/gluon-luci-node-role/i18n/fr.po | 26 +++++ package/gluon-luci-portconfig/i18n/fr.po | 33 ++++++ package/gluon-luci-private-wifi/i18n/fr.po | 30 +++++ package/gluon-luci-wifi-config/i18n/fr.po | 48 ++++++++ 14 files changed, 494 insertions(+) create mode 100644 docs/site-example/i18n/fr.po create mode 100644 package/gluon-config-mode-autoupdater/i18n/fr.po create mode 100644 package/gluon-config-mode-contact-info/i18n/fr.po create mode 100644 package/gluon-config-mode-core/i18n/fr.po create mode 100644 package/gluon-config-mode-geo-location/i18n/fr.po create mode 100644 package/gluon-config-mode-hostname/i18n/fr.po create mode 100644 package/gluon-config-mode-mesh-vpn/i18n/fr.po create mode 100644 package/gluon-luci-admin/i18n/fr.po create mode 100644 package/gluon-luci-autoupdater/i18n/fr.po create mode 100644 package/gluon-luci-mesh-vpn-fastd/i18n/fr.po create mode 100644 package/gluon-luci-node-role/i18n/fr.po create mode 100644 package/gluon-luci-portconfig/i18n/fr.po create mode 100644 package/gluon-luci-private-wifi/i18n/fr.po create mode 100644 package/gluon-luci-wifi-config/i18n/fr.po diff --git a/docs/site-example/i18n/fr.po b/docs/site-example/i18n/fr.po new file mode 100644 index 00000000..e65d7410 --- /dev/null +++ b/docs/site-example/i18n/fr.po @@ -0,0 +1,43 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: PACKAGE VERSION\n" +"PO-Revision-Date: 2015-08-06 20:28+0100\n" +"Last-Translator: Tobias Bernot \n" +"Language-Team: French\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "gluon-config-mode:welcome" +msgstr "" +"Bienvenue dans l'assistant de configuration pour votre nouveau noeud " +"Freifunk. Remplissez le formulaire suivant en fonction de vos besoins " +"et enregistrez le" + +msgid "gluon-config-mode:pubkey" +msgstr "" +"

Ceci est la cl publique de votre noeud Freifunk. Seulment aprs que la cl soit " +"entre sur les serveurs de votre groupe de Freifunk votre noeud pourra se connecter " +"sur les serveur Mesh-VPN de votre groupe Freifunk. Veuillez envoyer la cl avec le " +"nom de votre noeud " +"(<%=hostname%>) " +"keys@entenhausen.freifunk.net." +"

" +"
" +" # <%= hostname %>" +"
" +"<%= pubkey %>" +"
" + +msgid "gluon-config-mode:reboot" +msgstr "" +"

Votre noeud es en train de redmarrer et va ensuite ssayer de se connecter " +"avec les autres noeuds du rseau Freifunk " +"Vous pourrez trouver plus d'informations sur votre groupe Freifunk sur la page " +" de ton groupe .

" +"

Pour retrouver cette page de configuration veuillier appuyez pendant le " +"fonctionement normal pendant 3 Secondes sur le bouton reset. L'appareil va ensuite " +"redmarer en mode configuration.

" +"

Profitez votre de noeud et amusez vous dcouvrir le rseau Freifunk!

" diff --git a/package/gluon-config-mode-autoupdater/i18n/fr.po b/package/gluon-config-mode-autoupdater/i18n/fr.po new file mode 100644 index 00000000..b79951d9 --- /dev/null +++ b/package/gluon-config-mode-autoupdater/i18n/fr.po @@ -0,0 +1,17 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: PACKAGE VERSION\n" +"PO-Revision-Date: 2015-08-04 20:20+0100\n" +"Last-Translator: Bernot Tobias \n" +"Language-Team: French\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "" +"This node will automatically update its firmware when a new version is " +"available." +msgstr "Ce noeud s'actualisera automatiquement quand une nouvelle " +"version sera disponible." diff --git a/package/gluon-config-mode-contact-info/i18n/fr.po b/package/gluon-config-mode-contact-info/i18n/fr.po new file mode 100644 index 00000000..e1022622 --- /dev/null +++ b/package/gluon-config-mode-contact-info/i18n/fr.po @@ -0,0 +1,25 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: PACKAGE VERSION\n" +"PO-Revision-Date: 2015-08-12 23:30+0100\n" +"Last-Translator:Tobias Bernot \n" +"Language-Team: French\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Contact info" +msgstr "Informations de Contact" + +msgid "" +"You can provide your contact information here to allow others to contact " +"you. Please note that this information will be visible publicly on " +"the internet together with your node's coordinates." +msgstr "" +"Ici vous pouvez donner des informations publiques pour permettre aux autres de vous contacter. " +"Ces informations seront affichées en ligne, avec les coordonnées du noeud." + +msgid "e.g. E-mail or phone number" +msgstr "Ex : E-mail ou numéro de téléphone" diff --git a/package/gluon-config-mode-core/i18n/fr.po b/package/gluon-config-mode-core/i18n/fr.po new file mode 100644 index 00000000..7c9bc012 --- /dev/null +++ b/package/gluon-config-mode-core/i18n/fr.po @@ -0,0 +1,23 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: PACKAGE VERSION\n" +"PO-Revision-Date: 2015-08-12 23:30+0100\n" +"Last-Translator:Tobias Bernot \n" +"Language-Team: French\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +#, fuzzy +msgid "Save & restart" +msgstr "Enregistrer & Redémarer" + +msgid "Welcome!" +msgstr "Bienvenue!" + +msgid "Wizard" +msgstr "Assistant" + +msgid "Your node's setup is now complete." +msgstr "La configuration de votre noeud est terminée." diff --git a/package/gluon-config-mode-geo-location/i18n/fr.po b/package/gluon-config-mode-geo-location/i18n/fr.po new file mode 100644 index 00000000..e34d8c05 --- /dev/null +++ b/package/gluon-config-mode-geo-location/i18n/fr.po @@ -0,0 +1,35 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: PACKAGE VERSION\n" +"PO-Revision-Date: 2015-08-12 23:30+0100\n" +"Last-Translator:Tobias Bernot \n" +"Language-Team: French\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "" +"If you want the location of your node to be displayed on the map, you can " +"enter its coordinates here. Specifying the altitude is optional and should " +"only be done if a proper value is known." +msgstr "" +"Pour Afficher votre noeud sur la Carte nous avons besoin de ses coordonnées. " +"Ici vous pouvez entrer sa position. La altitude est optionelle " +"et ne devrait que être ajoutée si la valeur exacte est connue. " + +msgid "Latitude" +msgstr "Latitude" + +msgid "Longitude" +msgstr "Longitude" + +msgid "Altitude" +msgstr "Hauteur" + +msgid "Show node on the map" +msgstr "Afficher le noeud sur la carte" + +msgid "e.g. %s" +msgstr "Ex: %s" diff --git a/package/gluon-config-mode-hostname/i18n/fr.po b/package/gluon-config-mode-hostname/i18n/fr.po new file mode 100644 index 00000000..611edbc0 --- /dev/null +++ b/package/gluon-config-mode-hostname/i18n/fr.po @@ -0,0 +1,14 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: PACKAGE VERSION\n" +"PO-Revision-Date: 2015-08-12 23:30+0100\n" +"Last-Translator:Tobias Bernot \n" +"Language-Team: French\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Node name" +msgstr "Nom du noeud" diff --git a/package/gluon-config-mode-mesh-vpn/i18n/fr.po b/package/gluon-config-mode-mesh-vpn/i18n/fr.po new file mode 100644 index 00000000..9c13fc13 --- /dev/null +++ b/package/gluon-config-mode-mesh-vpn/i18n/fr.po @@ -0,0 +1,36 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: PACKAGE VERSION\n" +"PO-Revision-Date: 2015-08-12 23:30+0100\n" +"Last-Translator:Tobias Bernot \n" +"Language-Team: French\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Downstream (kbit/s)" +msgstr "Débit déscendant (kbit/s)" + +msgid "Limit bandwidth" +msgstr "Limiter la bande passante" + +msgid "Upstream (kbit/s)" +msgstr "Débit ascendant (kbit/s)" + +msgid "Use internet connection (mesh VPN)" +msgstr "Utiliser la connection internet (Mesh-VPN)" + +msgid "" +"Your internet connection can be used to establish an encrypted connection " +"with other nodes. Enable this option if there are no other nodes reachable " +"over WLAN in your vicinity or you want to make a part of your connection's " +"bandwidth available for the network. You can limit how much bandwidth the " +"node will use at most." +msgstr "" +"Votre noeud peut partager votre accès internet grâce une communication encryptée " +"avec d'autres noeuds. Vous pouvez limiter la bande passante utilisée par ceci. " +"Active cette option, si vous n'avez pas d'autres noeuds atteignables par WLAN " +"ou si vous voulez partager votre bande passante pour le réseau MESH." + diff --git a/package/gluon-luci-admin/i18n/fr.po b/package/gluon-luci-admin/i18n/fr.po new file mode 100644 index 00000000..b69f4e2d --- /dev/null +++ b/package/gluon-luci-admin/i18n/fr.po @@ -0,0 +1,110 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: PACKAGE VERSION\n" +"PO-Revision-Date: 2015-08-19 20:20+0100\n" +"Last-Translator: Bernot Tobias \n" +"Language-Team: French\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "" +"Alternatively, you can set a password to access you node. Please choose a " +"secure password you don't use anywhere else.

If you set an empty " +"password, login via password will be disabled. This is the default." +msgstr "" +"Alternativement, vous pouvez mettre un mot de passe pour accéder à votre noeud, " +"Penseiz à choisir un mot de passe sûr, que vous n'utilisez nulle part ailleurs. " +"

Si vous n'entrez pas de mot de passe, la connexion par mot de passe " +"sera désactivée. La connexion par mot de passe est désactivée par défaut." + +msgid "Continue" +msgstr "Continuer" + +msgid "Don't switch off the device in any circumstance!" +msgstr "N'interrompez en aucun cas l'alimentation!" + +msgid "Expert Mode" +msgstr "Mode Expert" + +msgid "Firmware image" +msgstr "Fichier image" + +msgid "Firmware release" +msgstr "Version de la firmware" + +msgid "Gluon version" +msgstr "Version de Gluon" + +msgid "Hardware model" +msgstr "Modèle du Matériel" + +msgid "Information" +msgstr "Informations" + +msgid "MAC address" +msgstr "Adresse MAC" + +msgid "Password changed." +msgstr "Mot de passe changé." + +msgid "Password removed." +msgstr "Mot de passe effacé." + +msgid "Public VPN key" +msgstr "Clé VPN publique" + +msgid "Remote access" +msgstr "Accès à distance" + +msgid "SSH keys" +msgstr "Clé SSH" + +msgid "Site" +msgstr "Site" + +msgid "" +"The firmware image has been transmitted. Please ensure the MD5 checksum and " +"image size are correct and click \"continue\"." +msgstr "" +"L'image de firmware a été transmise. Vérifiez que la somme MD5 et la taille " +"de l'image correspondent, et appuiez ensuite sur \"continuer\"." + +msgid "The firmware is currently being upgraded." +msgstr "La firmware est en cours de mise à jour." + +msgid "The firmware is too big for your device's storage." +msgstr "La firmware est trop grande pour la mémoire de l'appareil." + +msgid "The password and the confirmation differ." +msgstr "Les deux mots de passe ne correspondent pas." + +msgid "The provided firmware image is not valid for this device." +msgstr "La firmware fournie n'est pas une image valide pour cet appareil." + +msgid "" +"The upgrade will take a few minutes. When it is finished, your node will " +"reboot automatically." +msgstr "" +"La mise à jour va prendre quelques minutes. Quand elle sera finie, " +"votre noeud va redémarrer automatiquement." + +msgid "Unable to change the password." +msgstr "Le mot de passe n'a pas pu être changé." + +msgid "Upgrade firmware" +msgstr "Mettre à jour la firmware" + +msgid "Upgrading firmware" +msgstr "Mise à jour de la firmware" + +msgid "Upload image" +msgstr "Transférer l'image" + +msgid "You can manually upgrade your firmware here." +msgstr "Ici vous pouvez changer manuellement votre firmware." + +msgid "You can provide your SSH keys here (one per line):" +msgstr "Ici vous pouvez entrer vos clés SSH (une par ligne):" diff --git a/package/gluon-luci-autoupdater/i18n/fr.po b/package/gluon-luci-autoupdater/i18n/fr.po new file mode 100644 index 00000000..28263806 --- /dev/null +++ b/package/gluon-luci-autoupdater/i18n/fr.po @@ -0,0 +1,17 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: PACKAGE VERSION\n" +"PO-Revision-Date: 2015-08-19 20:20+0100\n" +"Last-Translator: Bernot Tobias \n" +"Language-Team: French\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Automatic updates" +msgstr "Mise a jour automatique" + +msgid "Branch" +msgstr "Branche" diff --git a/package/gluon-luci-mesh-vpn-fastd/i18n/fr.po b/package/gluon-luci-mesh-vpn-fastd/i18n/fr.po new file mode 100644 index 00000000..0620d199 --- /dev/null +++ b/package/gluon-luci-mesh-vpn-fastd/i18n/fr.po @@ -0,0 +1,37 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: PACKAGE VERSION\n" +"PO-Revision-Date: 2015-08-19 20:20+0100\n" +"Last-Translator: Bernot Tobias \n" +"Language-Team: French\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "" +"In performance mode, no encryption is used. This usually allows for higher " +"throughput, but the data exchanged over your node is not protected against " +"eavesdropping." +msgstr "" +"En mode performance, aucune encryption est utilisé. Ceci permet un débit plus " +"élevé, mais toutes les données échangées ne sont pas protégées contre l'écoute." + +msgid "" +"In security mode, the mesh VPN uses an encrypted tunnel to connect to the " +"VPN servers. The encryption ensures that it is impossible for your internet " +"access provider to see what data is exchanged over your node." +msgstr "" +"En mode sécurité, le mesch VPN utilise un tunnel encrypté pour se connecter " +"aux serveurs VPN. L'encryption permet de rendre impossible a votre FAI de " +"voir quelles données sont échangées sur votre noeud." + +msgid "Mesh VPN" +msgstr "Mesh-VPN" + +msgid "Performance mode" +msgstr "Mode performance" + +msgid "Security mode" +msgstr "Mode sécurité" diff --git a/package/gluon-luci-node-role/i18n/fr.po b/package/gluon-luci-node-role/i18n/fr.po new file mode 100644 index 00000000..cc11d325 --- /dev/null +++ b/package/gluon-luci-node-role/i18n/fr.po @@ -0,0 +1,26 @@ +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-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Node role" +msgstr "Rôle du noeud" + +msgid "Role" +msgstr "Rôle" + +msgid "" +"If this node has a special role within the freifunk network you can specify " +"this role here. Please find out about the available roles and their impact " +"first. Only change the role if you know what you are doing." +msgstr "" +"Si votre noeud a un rôle spécial dans le réseau freifunk, vous pouvez spécifier ce " +"rôle ici. Avant de changer, informez vous sur les rôles disponibles et sur leur impacts. " +"Changez de rôle uniquement si vous comprenez ce que vous faites." diff --git a/package/gluon-luci-portconfig/i18n/fr.po b/package/gluon-luci-portconfig/i18n/fr.po new file mode 100644 index 00000000..b5f7405d --- /dev/null +++ b/package/gluon-luci-portconfig/i18n/fr.po @@ -0,0 +1,33 @@ +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-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + + +msgid "Automatic (DHCP)" +msgstr "Automatique (DHCP)" + +msgid "Automatic (RA/DHCPv6)" +msgstr "Automatique (RA/DHCPv6)" + +msgid "Enable meshing on the WAN interface" +msgstr "Activer le réseau MESH sur les ports WAN" + +msgid "Enable meshing on the LAN interface" +msgstr "Activer le réseau MESH sur le port LAN" + +msgid "Static" +msgstr "Statique" + +msgid "Static DNS servers" +msgstr "Adresse DNS statique" + +msgid "WAN connection" +msgstr "Connexion WAN" diff --git a/package/gluon-luci-private-wifi/i18n/fr.po b/package/gluon-luci-private-wifi/i18n/fr.po new file mode 100644 index 00000000..6f6d4c97 --- /dev/null +++ b/package/gluon-luci-private-wifi/i18n/fr.po @@ -0,0 +1,30 @@ +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-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "8-63 characters" +msgstr "8-63 charactères" + +msgid "Name (SSID)" +msgstr "Nom (SSID)" + +msgid "Private WLAN" +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 " +"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 noeud 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-wifi-config/i18n/fr.po b/package/gluon-luci-wifi-config/i18n/fr.po new file mode 100644 index 00000000..9921c904 --- /dev/null +++ b/package/gluon-luci-wifi-config/i18n/fr.po @@ -0,0 +1,48 @@ +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-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +msgid "(default)" +msgstr "(défaut)" + +msgid "2.4GHz WLAN" +msgstr "2,4GHz-WLAN" + +msgid "5GHz WLAN" +msgstr "5GHz-WLAN" + +msgid "Enable client network (access point)" +msgstr "Activer le réseau client (Access Point)" + +msgid "Enable mesh network (802.11s)" +msgstr "Activer le réseau MESH (802.11s)" + +msgid "Enable mesh network (IBSS)" +msgstr "Activer le réseau MESH (IBSS)" + +msgid "Transmission power" +msgstr "Puissance d'émission" + +msgid "WLAN" +msgstr "WLAN" + +msgid "" +"You can enable or disable your node's client and mesh network SSIDs here. " +"Please don't disable the mesh network without a good reason, so other nodes " +"can mesh with yours.

It is also possible to configure the WLAN " +"adapters transmission power here. Please note that the transmission power " +"values include the antenna gain where available, but there are many devices " +"for which the gain is unavailable or inaccurate." +msgstr "" +"Ici vous pouvez activer ou désactiver la SSID du client ou MESH. " +"Pensez a laisser la SSID du MESH activée pour que les autres noeuds puissent se connecter. " +"

Ici vous pouvez aussi configurer la puissance d'émmission se votre WLAN. " +"Prenez note que les valeurs fournies pour la puissance de transmission prennent " +"en compte les gains fournis par l'antenne, et que ces valeurs ne sont pas toujours disponibles ou exactes." From 3f72e682c5c282d4bfcea33f9ffa5534cc7b8253 Mon Sep 17 00:00:00 2001 From: Ronny Trommer Date: Thu, 10 Sep 2015 23:54:27 +0200 Subject: [PATCH 117/867] Update build dependency documentation Build requires Python 2 and libssl-dev --- docs/user/getting_started.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/user/getting_started.rst b/docs/user/getting_started.rst index 885a3887..10489978 100644 --- a/docs/user/getting_started.rst +++ b/docs/user/getting_started.rst @@ -27,11 +27,13 @@ freshly installed Debian Wheezy system the following packages are required: * `git` (to get Gluon and other dependencies) * `subversion` +* `python` (Python 3 doesn't work) * `build-essential` * `gawk` * `unzip` * `libncurses-dev` (actually `libncurses5-dev`) * `libz-dev` (actually `zlib1g-dev`) +* `libssl-dev` Building the images From 68459dab00c7ad7c6440800a39de77fc1e80818a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20M=C3=B6ller?= Date: Tue, 30 Dec 2014 05:52:23 +0100 Subject: [PATCH 118/867] contrib/sigtest.sh - testing signature --- contrib/sigtest.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 contrib/sigtest.sh diff --git a/contrib/sigtest.sh b/contrib/sigtest.sh new file mode 100755 index 00000000..2ed06d0f --- /dev/null +++ b/contrib/sigtest.sh @@ -0,0 +1,39 @@ +#!/bin/sh + +if [ $# -eq 0 -o "-h" = "$1" -o "-help" = "$1" -o "--help" = "$1" ]; then + cat < + +sigtest.sh checks if a manifest is signed by the public key . There is +no output, success or failure is indicated via the return code. + +See also: + * ecdsautils in https://github.com/tcatm/ecdsautils + * http://gluon.readthedocs.org/en/latest/features/autoupdater.html + +EOHELP + exit 1 +fi + +public="$1" +manifest="$2" +upper="$(mktemp)" +lower="$(mktemp)" +ret=1 + +awk "BEGIN { sep=0 } + /^---\$/ { sep=1; next } + { if(sep==0) print > \"$upper\"; + else print > \"$lower\"}" \ + "$manifest" + +while read line +do + if ecdsaverify -s "$line" -p "$public" "$upper"; then + ret=0 + break + fi +done < "$lower" + +rm -f "$upper" "$lower" +exit $ret From 46f996b4f02a3a235d39a4721c31901e7804f78c Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 21 Sep 2015 21:02:31 +0900 Subject: [PATCH 119/867] Update modules This also takes us past the OpenWrt 15.05 final release. --- include/gluon.mk | 2 +- modules | 10 +++++----- ...und-unconditional-libopenssl-build-dependency.patch | 4 ++-- targets/ar71xx-generic/vermagic | 2 +- targets/ar71xx-nand/vermagic | 2 +- targets/brcm2708-bcm2708/vermagic | 2 +- targets/brcm2708-bcm2709/vermagic | 2 +- targets/mpc85xx-generic/vermagic | 2 +- targets/ramips-rt305x/vermagic | 2 +- targets/sunxi/vermagic | 2 +- targets/x86-64/vermagic | 2 +- targets/x86-generic/vermagic | 2 +- targets/x86-kvm_guest/vermagic | 2 +- 13 files changed, 18 insertions(+), 18 deletions(-) diff --git a/include/gluon.mk b/include/gluon.mk index 4f99ec1c..8aca3f74 100644 --- a/include/gluon.mk +++ b/include/gluon.mk @@ -35,7 +35,7 @@ export GLUON_LANGS ifeq ($(OPENWRT_BUILD),1) ifeq ($(GLUON_TOOLS),1) -DEFAULT_OPKG_REPO := http://downloads.openwrt.org/chaos_calmer/15.05-rc3/%S/packages +DEFAULT_OPKG_REPO := http://downloads.openwrt.org/chaos_calmer/15.05/%S/packages CONFIG_VERSION_REPO := $(shell $(GLUONDIR)/scripts/site.sh opkg_repo || echo '$(DEFAULT_OPKG_REPO)') export CONFIG_VERSION_REPO diff --git a/modules b/modules index 275de030..47335984 100644 --- a/modules +++ b/modules @@ -1,18 +1,18 @@ GLUON_FEEDS='openwrt gluon routing luci' OPENWRT_REPO=git://git.openwrt.org/15.05/openwrt.git -OPENWRT_COMMIT=be73b965acbf449a10fe3e5d64238ca60cef71c3 +OPENWRT_COMMIT=8aa5672b43d5e6e4a768a0b703e918592a312cd0 PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git -PACKAGES_OPENWRT_COMMIT=d32e986ef6ae6ac414a908d914a2230b1ecf482e +PACKAGES_OPENWRT_COMMIT=9cadde21830c2e3ac66e4de1eafd5d9cfa006eec PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git -PACKAGES_GLUON_COMMIT=6c6fafa0bad263c220aef25a5dba69dee90353ba +PACKAGES_GLUON_COMMIT=fc35a19d2a054a9fb0a8b25c5924966cfb32d946 PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git -PACKAGES_ROUTING_COMMIT=a845bb4b95bb6598bb1f04a578c47383ff2aaac2 +PACKAGES_ROUTING_COMMIT=3b4de3e11226a12f29ccf333fc6a569ea0d48ff0 PACKAGES_LUCI_REPO=git://github.com/openwrt/luci.git -PACKAGES_LUCI_COMMIT=791ca8b6d217cd17b563c008c86159f519874d72 +PACKAGES_LUCI_COMMIT=30f6fe82af20fded9ab4100f0f2a652bf5881947 PACKAGES_LUCI_BRANCH=for-15.05 diff --git a/patches/openwrt/0021-opkg-work-around-unconditional-libopenssl-build-dependency.patch b/patches/openwrt/0021-opkg-work-around-unconditional-libopenssl-build-dependency.patch index e87afb85..b9eec309 100644 --- a/patches/openwrt/0021-opkg-work-around-unconditional-libopenssl-build-dependency.patch +++ b/patches/openwrt/0021-opkg-work-around-unconditional-libopenssl-build-dependency.patch @@ -8,10 +8,10 @@ not only opkg-smime. Fix this by applying the same workaround as in ustream-ssl. diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile -index d38ed52..16ff225 100644 +index 32bcf2b..4da4d46 100644 --- a/package/system/opkg/Makefile +++ b/package/system/opkg/Makefile -@@ -70,7 +70,7 @@ endef +@@ -72,7 +72,7 @@ endef define Package/opkg-smime $(call Package/opkg/Default) TITLE+= (with S/MIME signature support) diff --git a/targets/ar71xx-generic/vermagic b/targets/ar71xx-generic/vermagic index 122a8aab..ff475475 100644 --- a/targets/ar71xx-generic/vermagic +++ b/targets/ar71xx-generic/vermagic @@ -1 +1 @@ -5dcb66d04a38219f7fd91c748f0e9a32 +7bed08fa9c06eb8089e82c200340ec66 diff --git a/targets/ar71xx-nand/vermagic b/targets/ar71xx-nand/vermagic index f359f68a..bde150ed 100644 --- a/targets/ar71xx-nand/vermagic +++ b/targets/ar71xx-nand/vermagic @@ -1 +1 @@ -08d628f1b60980ae837e80caaf2d7e37 +a44d8090b8f752ec1d96871dbbb8988a diff --git a/targets/brcm2708-bcm2708/vermagic b/targets/brcm2708-bcm2708/vermagic index f6eb6b84..f6367189 100644 --- a/targets/brcm2708-bcm2708/vermagic +++ b/targets/brcm2708-bcm2708/vermagic @@ -1 +1 @@ -a8463905834d64a3df8c231cf94ffc88 +57d4b7d13c23edd1a689dd6d6adc65ad diff --git a/targets/brcm2708-bcm2709/vermagic b/targets/brcm2708-bcm2709/vermagic index 2964cf3e..5264819c 100644 --- a/targets/brcm2708-bcm2709/vermagic +++ b/targets/brcm2708-bcm2709/vermagic @@ -1 +1 @@ -beebeea48e3792a20d2324a49f04b74d +0fec8065ae15bf9934ffbe2512e8e39f diff --git a/targets/mpc85xx-generic/vermagic b/targets/mpc85xx-generic/vermagic index a29e7e74..5ca6009d 100644 --- a/targets/mpc85xx-generic/vermagic +++ b/targets/mpc85xx-generic/vermagic @@ -1 +1 @@ -682734a2bcc20cf580e27db161f6d0df +521812ea85032e662b3d3469a3a10df8 diff --git a/targets/ramips-rt305x/vermagic b/targets/ramips-rt305x/vermagic index a39462c9..3bc73d5e 100644 --- a/targets/ramips-rt305x/vermagic +++ b/targets/ramips-rt305x/vermagic @@ -1 +1 @@ -73d2b013e81727fe0664fd1b78bd291e +c8b57a131072a3198e594822481af3e0 diff --git a/targets/sunxi/vermagic b/targets/sunxi/vermagic index 21f65d6e..ef11e4c3 100644 --- a/targets/sunxi/vermagic +++ b/targets/sunxi/vermagic @@ -1 +1 @@ -67fc80824241f73ea9ef5de62059465a +3c199b535784c56bd7a6b4d6ad82b91f diff --git a/targets/x86-64/vermagic b/targets/x86-64/vermagic index 52037a9b..cc552ff2 100644 --- a/targets/x86-64/vermagic +++ b/targets/x86-64/vermagic @@ -1 +1 @@ -fd9bfcbbba8366c338b3e2a3eb8448d5 +30da46d39f906146155850351fa0acd9 diff --git a/targets/x86-generic/vermagic b/targets/x86-generic/vermagic index bc39f47d..3c2f8d1b 100644 --- a/targets/x86-generic/vermagic +++ b/targets/x86-generic/vermagic @@ -1 +1 @@ -efa451855d1db0df511f08a5ef56377c +8549f8163c15d79b053f26aa0d52e96f diff --git a/targets/x86-kvm_guest/vermagic b/targets/x86-kvm_guest/vermagic index d4170ba5..b0031811 100644 --- a/targets/x86-kvm_guest/vermagic +++ b/targets/x86-kvm_guest/vermagic @@ -1 +1 @@ -77694101191b9fcdbf96b2622dd5d5a8 +d0d2aab265f2535385cf8d756315d27c From 955dc886a8fa8b018fa7dbf3a948201dc5751ef2 Mon Sep 17 00:00:00 2001 From: kb-light Date: Sun, 13 Sep 2015 20:47:57 +0200 Subject: [PATCH 120/867] gluon-mesh-batman-adv-core: prepare for 802.11s mesh keep macfilter and maclist config after fw-update --- .../lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless index 2c16d0e0..b1423f46 100755 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless +++ b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless @@ -87,6 +87,8 @@ end local function configure_mesh(config, radio, index, suffix) local name = 'mesh_' .. radio local disabled = is_disabled(config, name) + local macfilter = uci:get('wireless', name, 'macfilter') + local maclist = uci:get('wireless', name, 'maclist') uci:delete('network', name) uci:delete('wireless', name) @@ -110,6 +112,8 @@ local function configure_mesh(config, radio, index, suffix) mcast_rate = config.mcast_rate, ifname = suffix and 'mesh' .. suffix, disabled = disabled, + macfilter = macfilter, + maclist = maclist, } ) end From 57a30161481ef4d2d16bac88263845b878fed63a Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 22 Sep 2015 20:53:49 +0900 Subject: [PATCH 121/867] Update OpenWrt base --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 47335984..e9a39c0a 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=8aa5672b43d5e6e4a768a0b703e918592a312cd0 +OPENWRT_COMMIT=ccbb0cbc95f7379f0a7ab719b21768e7ac270597 PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git PACKAGES_OPENWRT_COMMIT=9cadde21830c2e3ac66e4de1eafd5d9cfa006eec From 595e337d9aebb2ccae820da6ca054ca7b2dc5e57 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 8 Oct 2015 13:21:50 +0200 Subject: [PATCH 122/867] x86: include kmod-forcedeth into generic and 64 subtargets --- targets/x86-64/profiles.mk | 2 +- targets/x86-generic/profiles.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/targets/x86-64/profiles.mk b/targets/x86-64/profiles.mk index 49cf02ef..8f561fc1 100644 --- a/targets/x86-64/profiles.mk +++ b/targets/x86-64/profiles.mk @@ -1,4 +1,4 @@ -X86_64_NETWORK_MODULES := kmod-3c59x kmod-e100 kmod-e1000 kmod-e1000e kmod-natsemi kmod-ne2k-pci kmod-pcnet32 kmod-8139too kmod-r8169 kmod-sis900 kmod-tg3 kmod-via-rhine kmod-via-velocity +X86_64_NETWORK_MODULES := kmod-3c59x kmod-e100 kmod-e1000 kmod-e1000e kmod-natsemi kmod-ne2k-pci kmod-pcnet32 kmod-8139too kmod-r8169 kmod-sis900 kmod-tg3 kmod-via-rhine kmod-via-velocity kmod-forcedeth $(eval $(call GluonProfile,GENERIC,$(X86_64_NETWORK_MODULES))) diff --git a/targets/x86-generic/profiles.mk b/targets/x86-generic/profiles.mk index b6551a76..a8ca3dbb 100644 --- a/targets/x86-generic/profiles.mk +++ b/targets/x86-generic/profiles.mk @@ -1,4 +1,4 @@ -X86_GENERIC_NETWORK_MODULES := kmod-3c59x kmod-e100 kmod-e1000 kmod-e1000e kmod-natsemi kmod-ne2k-pci kmod-pcnet32 kmod-8139too kmod-r8169 kmod-sis900 kmod-tg3 kmod-via-rhine kmod-via-velocity +X86_GENERIC_NETWORK_MODULES := kmod-3c59x kmod-e100 kmod-e1000 kmod-e1000e kmod-natsemi kmod-ne2k-pci kmod-pcnet32 kmod-8139too kmod-r8169 kmod-sis900 kmod-tg3 kmod-via-rhine kmod-via-velocity kmod-forcedeth $(eval $(call GluonProfile,GENERIC,$(X86_GENERIC_NETWORK_MODULES))) From 8d71044aaf3aee4b4019c4bfa364a56d56327c49 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 8 Oct 2015 22:10:52 +0200 Subject: [PATCH 123/867] docs: site-example/i18n: fix encoding of french translation --- docs/site-example/i18n/fr.po | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/site-example/i18n/fr.po b/docs/site-example/i18n/fr.po index e65d7410..f1199ec6 100644 --- a/docs/site-example/i18n/fr.po +++ b/docs/site-example/i18n/fr.po @@ -18,11 +18,11 @@ msgstr "" msgid "gluon-config-mode:pubkey" msgstr "" -"

Ceci est la cl publique de votre noeud Freifunk. Seulment aprs que la cl soit " -"entre sur les serveurs de votre groupe de Freifunk votre noeud pourra se connecter " -"sur les serveur Mesh-VPN de votre groupe Freifunk. Veuillez envoyer la cl avec le " +"

Ceci est la clé publique de votre noeud Freifunk. Seulment après que la clé soit " +"entrée sur les serveurs de votre groupe de Freifunk votre noeud pourra se connecter " +"sur les serveur Mesh-VPN de votre groupe Freifunk. Veuillez envoyer la clé avec le " "nom de votre noeud " -"(<%=hostname%>) " +"(<%=hostname%>) à " "keys@entenhausen.freifunk.net." "

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

Votre noeud es en train de redmarrer et va ensuite ssayer de se connecter " -"avec les autres noeuds du rseau Freifunk " +"

Votre noeud es en train de redémarrer et va ensuite éssayer de se connecter " +"avec les autres noeuds du réseau Freifunk " "Vous pourrez trouver plus d'informations sur votre groupe Freifunk sur la page " " de ton groupe .

" "

Pour retrouver cette page de configuration veuillier appuyez pendant le " "fonctionement normal pendant 3 Secondes sur le bouton reset. L'appareil va ensuite " -"redmarer en mode configuration.

" -"

Profitez votre de noeud et amusez vous dcouvrir le rseau Freifunk!

" +"redémarer en mode configuration.

" +"

Profitez votre de noeud et amusez vous à découvrir le réseau Freifunk!

" From 98542b015d9467d8065bedf25d91370abb79e370 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 8 Oct 2015 22:15:53 +0200 Subject: [PATCH 124/867] =?UTF-8?q?i18n:=20s/noeud/n=C5=93ud/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/site-example/i18n/fr.po | 14 +++++++------- package/gluon-config-mode-autoupdater/i18n/fr.po | 2 +- package/gluon-config-mode-contact-info/i18n/fr.po | 2 +- package/gluon-config-mode-core/i18n/fr.po | 2 +- package/gluon-config-mode-geo-location/i18n/fr.po | 4 ++-- package/gluon-config-mode-hostname/i18n/fr.po | 2 +- package/gluon-config-mode-mesh-vpn/i18n/fr.po | 6 +++--- package/gluon-luci-admin/i18n/fr.po | 4 ++-- package/gluon-luci-mesh-vpn-fastd/i18n/fr.po | 2 +- package/gluon-luci-node-role/i18n/fr.po | 4 ++-- package/gluon-luci-private-wifi/i18n/fr.po | 2 +- package/gluon-luci-wifi-config/i18n/fr.po | 2 +- 12 files changed, 23 insertions(+), 23 deletions(-) diff --git a/docs/site-example/i18n/fr.po b/docs/site-example/i18n/fr.po index f1199ec6..30e21c50 100644 --- a/docs/site-example/i18n/fr.po +++ b/docs/site-example/i18n/fr.po @@ -12,16 +12,16 @@ msgstr "" msgid "gluon-config-mode:welcome" msgstr "" -"Bienvenue dans l'assistant de configuration pour votre nouveau noeud " +"Bienvenue dans l'assistant de configuration pour votre nouveau nœud " "Freifunk. Remplissez le formulaire suivant en fonction de vos besoins " "et enregistrez le" msgid "gluon-config-mode:pubkey" msgstr "" -"

Ceci est la clé publique de votre noeud Freifunk. Seulment après que la clé soit " -"entrée sur les serveurs de votre groupe de Freifunk votre noeud pourra se connecter " +"

Ceci est la clé publique de votre nœud Freifunk. Seulment après que la clé soit " +"entrée sur les serveurs de votre groupe de Freifunk votre nœud pourra se connecter " "sur les serveur Mesh-VPN de votre groupe Freifunk. Veuillez envoyer la clé avec le " -"nom de votre noeud " +"nom de votre nœud " "(<%=hostname%>) à " "keys@entenhausen.freifunk.net." "

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

Votre noeud es en train de redémarrer et va ensuite éssayer de se connecter " -"avec les autres noeuds du réseau Freifunk " +"

Votre nœud es en train de redémarrer et va ensuite éssayer de se connecter " +"avec les autres nœuds du réseau Freifunk " "Vous pourrez trouver plus d'informations sur votre groupe Freifunk sur la page " " de ton groupe .

" "

Pour retrouver cette page de configuration veuillier appuyez pendant le " "fonctionement normal pendant 3 Secondes sur le bouton reset. L'appareil va ensuite " "redémarer en mode configuration.

" -"

Profitez votre de noeud et amusez vous à découvrir le réseau Freifunk!

" +"

Profitez votre de nœud et amusez vous à découvrir le réseau Freifunk!

" diff --git a/package/gluon-config-mode-autoupdater/i18n/fr.po b/package/gluon-config-mode-autoupdater/i18n/fr.po index b79951d9..7ee64f46 100644 --- a/package/gluon-config-mode-autoupdater/i18n/fr.po +++ b/package/gluon-config-mode-autoupdater/i18n/fr.po @@ -13,5 +13,5 @@ msgstr "" msgid "" "This node will automatically update its firmware when a new version is " "available." -msgstr "Ce noeud s'actualisera automatiquement quand une nouvelle " +msgstr "Ce nœud s'actualisera automatiquement quand une nouvelle " "version sera disponible." diff --git a/package/gluon-config-mode-contact-info/i18n/fr.po b/package/gluon-config-mode-contact-info/i18n/fr.po index e1022622..779e15fe 100644 --- a/package/gluon-config-mode-contact-info/i18n/fr.po +++ b/package/gluon-config-mode-contact-info/i18n/fr.po @@ -19,7 +19,7 @@ msgid "" "the internet together with your node's coordinates." msgstr "" "Ici vous pouvez donner des informations publiques pour permettre aux autres de vous contacter. " -"Ces informations seront affichées en ligne, avec les coordonnées du noeud." +"Ces informations seront affichées en ligne, avec les coordonnées du nœud." msgid "e.g. E-mail or phone number" msgstr "Ex : E-mail ou numéro de téléphone" diff --git a/package/gluon-config-mode-core/i18n/fr.po b/package/gluon-config-mode-core/i18n/fr.po index 7c9bc012..f4f988cc 100644 --- a/package/gluon-config-mode-core/i18n/fr.po +++ b/package/gluon-config-mode-core/i18n/fr.po @@ -20,4 +20,4 @@ msgid "Wizard" msgstr "Assistant" msgid "Your node's setup is now complete." -msgstr "La configuration de votre noeud est terminée." +msgstr "La configuration de votre nœud est terminée." diff --git a/package/gluon-config-mode-geo-location/i18n/fr.po b/package/gluon-config-mode-geo-location/i18n/fr.po index e34d8c05..15d79e2b 100644 --- a/package/gluon-config-mode-geo-location/i18n/fr.po +++ b/package/gluon-config-mode-geo-location/i18n/fr.po @@ -15,7 +15,7 @@ msgid "" "enter its coordinates here. Specifying the altitude is optional and should " "only be done if a proper value is known." msgstr "" -"Pour Afficher votre noeud sur la Carte nous avons besoin de ses coordonnées. " +"Pour Afficher votre nœud sur la Carte nous avons besoin de ses coordonnées. " "Ici vous pouvez entrer sa position. La altitude est optionelle " "et ne devrait que être ajoutée si la valeur exacte est connue. " @@ -29,7 +29,7 @@ msgid "Altitude" msgstr "Hauteur" msgid "Show node on the map" -msgstr "Afficher le noeud sur la carte" +msgstr "Afficher le nœud sur la carte" msgid "e.g. %s" msgstr "Ex: %s" diff --git a/package/gluon-config-mode-hostname/i18n/fr.po b/package/gluon-config-mode-hostname/i18n/fr.po index 611edbc0..79702c06 100644 --- a/package/gluon-config-mode-hostname/i18n/fr.po +++ b/package/gluon-config-mode-hostname/i18n/fr.po @@ -11,4 +11,4 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "Node name" -msgstr "Nom du noeud" +msgstr "Nom du nœud" diff --git a/package/gluon-config-mode-mesh-vpn/i18n/fr.po b/package/gluon-config-mode-mesh-vpn/i18n/fr.po index 9c13fc13..fc854613 100644 --- a/package/gluon-config-mode-mesh-vpn/i18n/fr.po +++ b/package/gluon-config-mode-mesh-vpn/i18n/fr.po @@ -29,8 +29,8 @@ msgid "" "bandwidth available for the network. You can limit how much bandwidth the " "node will use at most." msgstr "" -"Votre noeud peut partager votre accès internet grâce une communication encryptée " -"avec d'autres noeuds. Vous pouvez limiter la bande passante utilisée par ceci. " -"Active cette option, si vous n'avez pas d'autres noeuds atteignables par WLAN " +"Votre nœud peut partager votre accès internet grâce une communication encryptée " +"avec d'autres nœuds. Vous pouvez limiter la bande passante utilisée par ceci. " +"Active cette option, si vous n'avez pas d'autres nœuds atteignables par WLAN " "ou si vous voulez partager votre bande passante pour le réseau MESH." diff --git a/package/gluon-luci-admin/i18n/fr.po b/package/gluon-luci-admin/i18n/fr.po index b69f4e2d..23eeb7ff 100644 --- a/package/gluon-luci-admin/i18n/fr.po +++ b/package/gluon-luci-admin/i18n/fr.po @@ -15,7 +15,7 @@ msgid "" "secure password you don't use anywhere else.

If you set an empty " "password, login via password will be disabled. This is the default." msgstr "" -"Alternativement, vous pouvez mettre un mot de passe pour accéder à votre noeud, " +"Alternativement, vous pouvez mettre un mot de passe pour accéder à votre nœud, " "Penseiz à choisir un mot de passe sûr, que vous n'utilisez nulle part ailleurs. " "

Si vous n'entrez pas de mot de passe, la connexion par mot de passe " "sera désactivée. La connexion par mot de passe est désactivée par défaut." @@ -89,7 +89,7 @@ msgid "" "reboot automatically." msgstr "" "La mise à jour va prendre quelques minutes. Quand elle sera finie, " -"votre noeud va redémarrer automatiquement." +"votre nœud va redémarrer automatiquement." msgid "Unable to change the password." msgstr "Le mot de passe n'a pas pu être changé." diff --git a/package/gluon-luci-mesh-vpn-fastd/i18n/fr.po b/package/gluon-luci-mesh-vpn-fastd/i18n/fr.po index 0620d199..d8f64e0a 100644 --- a/package/gluon-luci-mesh-vpn-fastd/i18n/fr.po +++ b/package/gluon-luci-mesh-vpn-fastd/i18n/fr.po @@ -25,7 +25,7 @@ msgid "" msgstr "" "En mode sécurité, le mesch VPN utilise un tunnel encrypté pour se connecter " "aux serveurs VPN. L'encryption permet de rendre impossible a votre FAI de " -"voir quelles données sont échangées sur votre noeud." +"voir quelles données sont échangées sur votre nœud." msgid "Mesh VPN" msgstr "Mesh-VPN" diff --git a/package/gluon-luci-node-role/i18n/fr.po b/package/gluon-luci-node-role/i18n/fr.po index cc11d325..a571f568 100644 --- a/package/gluon-luci-node-role/i18n/fr.po +++ b/package/gluon-luci-node-role/i18n/fr.po @@ -11,7 +11,7 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "Node role" -msgstr "Rôle du noeud" +msgstr "Rôle du nœud" msgid "Role" msgstr "Rôle" @@ -21,6 +21,6 @@ msgid "" "this role here. Please find out about the available roles and their impact " "first. Only change the role if you know what you are doing." msgstr "" -"Si votre noeud a un rôle spécial dans le réseau freifunk, vous pouvez spécifier ce " +"Si votre nœud a un rôle spécial dans le réseau freifunk, vous pouvez spécifier ce " "rôle ici. Avant de changer, informez vous sur les rôles disponibles et sur leur impacts. " "Changez de rôle uniquement si vous comprenez ce que vous faites." diff --git a/package/gluon-luci-private-wifi/i18n/fr.po b/package/gluon-luci-private-wifi/i18n/fr.po index 6f6d4c97..0ac38d43 100644 --- a/package/gluon-luci-private-wifi/i18n/fr.po +++ b/package/gluon-luci-private-wifi/i18n/fr.po @@ -25,6 +25,6 @@ msgid "" "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 noeud peut étendre votre réseau privé en interfaçant le WAN avec un WLAN séparé. " +"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-wifi-config/i18n/fr.po b/package/gluon-luci-wifi-config/i18n/fr.po index 9921c904..451772e7 100644 --- a/package/gluon-luci-wifi-config/i18n/fr.po +++ b/package/gluon-luci-wifi-config/i18n/fr.po @@ -42,7 +42,7 @@ msgid "" "for which the gain is unavailable or inaccurate." msgstr "" "Ici vous pouvez activer ou désactiver la SSID du client ou MESH. " -"Pensez a laisser la SSID du MESH activée pour que les autres noeuds puissent se connecter. " +"Pensez a laisser la SSID du MESH activée pour que les autres nœuds puissent se connecter. " "

Ici vous pouvez aussi configurer la puissance d'émmission se votre WLAN. " "Prenez note que les valeurs fournies pour la puissance de transmission prennent " "en compte les gains fournis par l'antenne, et que ces valeurs ne sont pas toujours disponibles ou exactes." From 3ced929698f0b7ff64122300f9b6a5bfeec2029a Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 8 Oct 2015 22:30:16 +0200 Subject: [PATCH 125/867] Update Gluon packages --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index e9a39c0a..bb4475ac 100644 --- a/modules +++ b/modules @@ -8,7 +8,7 @@ PACKAGES_OPENWRT_COMMIT=9cadde21830c2e3ac66e4de1eafd5d9cfa006eec PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git -PACKAGES_GLUON_COMMIT=fc35a19d2a054a9fb0a8b25c5924966cfb32d946 +PACKAGES_GLUON_COMMIT=6ddb1d3c0a208544345d3c9930d3e57381aeb640 PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_COMMIT=3b4de3e11226a12f29ccf333fc6a569ea0d48ff0 From 0f91fa6fa8c32b6b6a9d84af815a0b981e558046 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 8 Oct 2015 23:11:44 +0200 Subject: [PATCH 126/867] scripts/patch.sh: apply patches in a loop instead of a single `git am` command Using a loop makes the script a bit nicer, and it works around a git bug corrupting patch dates when multiple patches are applied at once. --- scripts/patch.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/patch.sh b/scripts/patch.sh index 479acd76..5f6e0b66 100755 --- a/scripts/patch.sh +++ b/scripts/patch.sh @@ -9,13 +9,13 @@ for module in $GLUON_MODULES; do cd "$GLUONDIR"/$module git checkout -B patching base - if [ "$(echo "$GLUONDIR"/patches/$module/*.patch)" ]; then - git -c user.name='Gluon Patch Manager' -c user.email='gluon@void.example.com' am --whitespace=nowarn "$GLUONDIR"/patches/$module/*.patch || ( + for patch in "$GLUONDIR"/patches/$module/*.patch; do + if ! git -c user.name='Gluon Patch Manager' -c user.email='gluon@void.example.com' am --whitespace=nowarn "$patch"; then git am --abort git checkout patched git branch -D patching - false - ) - fi + exit 1 + fi + done git branch -M patched done From 0c7d0cdb9104e68ce5c1436b45b456f838e9dbce Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 8 Oct 2015 23:13:28 +0200 Subject: [PATCH 127/867] Update modules --- modules | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules b/modules index bb4475ac..4abf024b 100644 --- a/modules +++ b/modules @@ -1,18 +1,18 @@ GLUON_FEEDS='openwrt gluon routing luci' OPENWRT_REPO=git://git.openwrt.org/15.05/openwrt.git -OPENWRT_COMMIT=ccbb0cbc95f7379f0a7ab719b21768e7ac270597 +OPENWRT_COMMIT=22ac8d66ba960a61520c3d80a277b2b774914c19 PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git -PACKAGES_OPENWRT_COMMIT=9cadde21830c2e3ac66e4de1eafd5d9cfa006eec +PACKAGES_OPENWRT_COMMIT=9f3881f1f35b11b4587ad6b7cca5136cad43c12a PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git PACKAGES_GLUON_COMMIT=6ddb1d3c0a208544345d3c9930d3e57381aeb640 PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git -PACKAGES_ROUTING_COMMIT=3b4de3e11226a12f29ccf333fc6a569ea0d48ff0 +PACKAGES_ROUTING_COMMIT=ae65d4fe027592652376f8dbd3ff2ef37f5a84bc PACKAGES_LUCI_REPO=git://github.com/openwrt/luci.git -PACKAGES_LUCI_COMMIT=30f6fe82af20fded9ab4100f0f2a652bf5881947 +PACKAGES_LUCI_COMMIT=8832d534e96d3a934bd02711884371fc78a0d506 PACKAGES_LUCI_BRANCH=for-15.05 From 06a2b2b1d1d69f88e21da8578aa8bff0cf1e670c Mon Sep 17 00:00:00 2001 From: Ruben Barkow Date: Fri, 9 Oct 2015 11:49:15 +0200 Subject: [PATCH 128/867] gluon-luci-private-wifi: typo seperaten --- package/gluon-luci-private-wifi/i18n/de.po | 4 ++-- package/gluon-luci-private-wifi/i18n/fr.po | 2 +- .../gluon-luci-private-wifi/i18n/gluon-luci-private-wifi.pot | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package/gluon-luci-private-wifi/i18n/de.po b/package/gluon-luci-private-wifi/i18n/de.po index ccf51341..5b2ac19d 100644 --- a/package/gluon-luci-private-wifi/i18n/de.po +++ b/package/gluon-luci-private-wifi/i18n/de.po @@ -21,12 +21,12 @@ 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 "" "Dein Knoten kann zusätzlich die Reichweite deines privaten Netzes erweitern. " -"Hierfür wird der WAN-Port mit einem seperaten WLAN gebridged. Diese " +"Hierfür wird der WAN-Port mit einem separaten WLAN gebridged. Diese " "Funktionalität ist völlig unabhängig von den Mesh-Funktionen des Knotens. " "Beachte, dass du nicht gleichzeitig das Meshen über den WAN-Port aktiviert " "haben solltest." diff --git a/package/gluon-luci-private-wifi/i18n/fr.po b/package/gluon-luci-private-wifi/i18n/fr.po index 0ac38d43..091aa87d 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 fda799582753223a6050cad8e827816ae88a1024 Mon Sep 17 00:00:00 2001 From: brueggemann Date: Fri, 9 Oct 2015 14:06:06 +0200 Subject: [PATCH 129/867] Add support for WHR-HP-G300N --- 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 8cfe724f..be40ff8b 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -183,6 +183,10 @@ $(eval $(call GluonModel,WZRHPG450H,wzr-hp-g450h,buffalo-wzr-hp-g450h)) $(eval $(call GluonProfile,WZRHPAG300H)) $(eval $(call GluonModel,WZRHPAG300H,wzr-hp-ag300h,buffalo-wzr-hp-ag300h-wzr-600dhp)) +# WHR-HP-G300N +$(eval $(call GluonProfile,WHRHPG300N)) +$(eval $(call GluonModel,WHRHPG300N,whr-hp-g300n,buffalo-whr-hp-g300n)) + ## Netgear # WNDR3700 (v1, v2) / WNDR3800 / WNDRMAC (v1, v2) From 61cb226523f4974bf1dff2a9fac664226d1d1a78 Mon Sep 17 00:00:00 2001 From: Franz Pletz Date: Sun, 6 Sep 2015 02:02:58 +0200 Subject: [PATCH 130/867] Add support for TP-Link TL-WA901ND v1 --- targets/ar71xx-generic/profiles.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 8cfe724f..fceb3eb0 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -104,6 +104,7 @@ $(eval $(call GluonModel,TLWA860,tl-wa860re-v1,tp-link-tl-wa860re-v1)) # TL-WA901N/ND v2 $(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)) $(eval $(call GluonModel,TLWA901,tl-wa901nd-v3,tp-link-tl-wa901n-nd-v3)) From ffc7baf9fb01c4dac14c0eb719a573870d58778c Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 11 Oct 2015 18:02:17 +0200 Subject: [PATCH 131/867] ar71xx: add support for TP-LINK TL-WR841N/ND v10 (untested) --- ...support-for-TP-LINK-TL-WR841N-ND-v10.patch | 31 +++++++++++++++++++ targets/ar71xx-generic/profiles.mk | 3 ++ 2 files changed, 34 insertions(+) create mode 100644 patches/openwrt/0025-ar71xx-add-support-for-TP-LINK-TL-WR841N-ND-v10.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 new file mode 100644 index 00000000..dc9f579b --- /dev/null +++ b/patches/openwrt/0025-ar71xx-add-support-for-TP-LINK-TL-WR841N-ND-v10.patch @@ -0,0 +1,31 @@ +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 0600f98..c9f25c1 100644 +--- a/target/linux/ar71xx/image/Makefile ++++ b/target/linux/ar71xx/image/Makefile +@@ -545,6 +545,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 +@@ -565,7 +572,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/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index cf4a598e..7ea0590d 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -54,6 +54,9 @@ $(eval $(call GluonModel,TLWR841,tl-wr841nd-v5,tp-link-tl-wr841n-nd-v5)) $(eval $(call GluonModel,TLWR841,tl-wr841nd-v7,tp-link-tl-wr841n-nd-v7)) $(eval $(call GluonModel,TLWR841,tl-wr841n-v8,tp-link-tl-wr841n-nd-v8)) $(eval $(call GluonModel,TLWR841,tl-wr841n-v9,tp-link-tl-wr841n-nd-v9)) +ifeq ($(BROKEN),1) +$(eval $(call GluonModel,TLWR841,tl-wr841n-v10,tp-link-tl-wr841n-nd-v10)) +endif # TL-WR842N/ND v1, v2 $(eval $(call GluonProfile,TLWR842)) From fddbc1df2ea3a3596b6a4cc39caed823cafef8ef Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 11 Oct 2015 18:14:08 +0200 Subject: [PATCH 132/867] base-files: add /etc/profile.d support --- ...base-files-add-etc-profile.d-support.patch | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 patches/openwrt/0026-base-files-add-etc-profile.d-support.patch diff --git a/patches/openwrt/0026-base-files-add-etc-profile.d-support.patch b/patches/openwrt/0026-base-files-add-etc-profile.d-support.patch new file mode 100644 index 00000000..93543e8e --- /dev/null +++ b/patches/openwrt/0026-base-files-add-etc-profile.d-support.patch @@ -0,0 +1,40 @@ +From: Matthias Schiffer +Date: Sun, 11 Oct 2015 18:13:35 +0200 +Subject: base-files: add /etc/profile.d support + +OpenWrt should support an optional /etc/profile.d directory like +most other Linux distributions. This allows packages to install +their own scripts into /etc/profile.d/ directory. + +The file suffix should make clear, that these scripts +are (sourced) shell-snippets. If the user needs e.g. php or lua, +one must make sure that the interpreter is called. +The reverse failsafe test makes sure, that the effective returncode is 0. + +A typcal usecase is the inclusion of private helpers, +special variables or aliases, which at the moment needs +patching the sourcecode and is not well maintainable. +Now the builder can simply add there files. + +v1 initial work of Hendrik Lüth +v2 changes regarding RFC (e.g. thomas.langer@lantiq.com) +v3 changes regarding RFC (e.g. mschiffer@universe-factory.net) +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 +--- a/package/base-files/files/etc/profile ++++ b/package/base-files/files/etc/profile +@@ -14,3 +14,10 @@ export PS1='\u@\h:\w\$ ' + + [ -x /usr/bin/arp ] || arp() { cat /proc/net/arp; } + [ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; } ++ ++[ -n "$FAILSAFE" ] || { ++ for FILE in /etc/profile.d/*.sh; do ++ [ -e "$FILE" ] && . "$FILE" ++ done ++ unset FILE ++} From 05f146f8171f6028e84752e4698d36e95e00ee89 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 11 Oct 2015 19:31:44 +0200 Subject: [PATCH 133/867] Validate section names from site.conf in various packages --- package/gluon-autoupdater/check_site.lua | 2 ++ package/gluon-mesh-vpn-fastd/check_site.lua | 4 ++++ package/gluon-simple-tc/check_site.lua | 2 ++ scripts/check_site_lib.lua | 6 ++++++ 4 files changed, 14 insertions(+) diff --git a/package/gluon-autoupdater/check_site.lua b/package/gluon-autoupdater/check_site.lua index 1d8996f0..9f443fec 100644 --- a/package/gluon-autoupdater/check_site.lua +++ b/package/gluon-autoupdater/check_site.lua @@ -1,6 +1,8 @@ need_string 'autoupdater.branch' local function check_branch(k, _) + assert_uci_name(k) + local prefix = string.format('autoupdater.branches[%q].', k) need_string(prefix .. 'name') diff --git a/package/gluon-mesh-vpn-fastd/check_site.lua b/package/gluon-mesh-vpn-fastd/check_site.lua index 7a2c4913..7960ea19 100644 --- a/package/gluon-mesh-vpn-fastd/check_site.lua +++ b/package/gluon-mesh-vpn-fastd/check_site.lua @@ -6,6 +6,8 @@ need_boolean('fastd_mesh_vpn.configurable', false) local function check_peer(prefix) return function(k, _) + assert_uci_name(k) + local table = string.format('%s[%q].', prefix, k) need_string(table .. 'key') @@ -15,6 +17,8 @@ end local function check_group(prefix) return function(k, _) + assert_uci_name(k) + local table = string.format('%s[%q].', prefix, k) need_number(table .. 'limit', false) diff --git a/package/gluon-simple-tc/check_site.lua b/package/gluon-simple-tc/check_site.lua index 95d4fd81..3b8ddc53 100644 --- a/package/gluon-simple-tc/check_site.lua +++ b/package/gluon-simple-tc/check_site.lua @@ -1,4 +1,6 @@ local function check_entry(k, _) + assert_uci_name(k) + local prefix = string.format('simple_tc[%q].', k) need_string(prefix .. 'ifname') diff --git a/scripts/check_site_lib.lua b/scripts/check_site_lib.lua index 99489302..766b94a9 100644 --- a/scripts/check_site_lib.lua +++ b/scripts/check_site_lib.lua @@ -12,6 +12,12 @@ local function assert_type(var, t, msg) end +function assert_uci_name(var) + -- We don't use character classes like %w here to be independent of the locale + assert(var:match('^[0-9a-zA-Z_]+$'), "site.conf error: `" .. var .. "' is not a valid config section name (only alphanumeric characters and the underscore are allowed)") +end + + function need_string(varname, required) local var = loadvar(varname) From 8ad3c88179734bf399f92daba927163122aa678a Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 11 Oct 2015 20:30:15 +0200 Subject: [PATCH 134/867] ar71xx: remove WZR-600DHP from Buffalo WZR-HP-AG300H/WZR-600DHP model name string for now We can't use the same image for these two devices, so as a workaround, remove ZR-600DHP from the name for now, so the autoupdater can work and users aren't confused. --- ...WZR-600DHP-model-name-string-for-now.patch | 31 +++++++++++++++++++ targets/ar71xx-generic/profiles.mk | 4 +-- 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 patches/openwrt/0027-ar71xx-remove-WZR-600DHP-from-Buffalo-WZR-HP-AG300H-WZR-600DHP-model-name-string-for-now.patch diff --git a/patches/openwrt/0027-ar71xx-remove-WZR-600DHP-from-Buffalo-WZR-HP-AG300H-WZR-600DHP-model-name-string-for-now.patch b/patches/openwrt/0027-ar71xx-remove-WZR-600DHP-from-Buffalo-WZR-HP-AG300H-WZR-600DHP-model-name-string-for-now.patch new file mode 100644 index 00000000..3085dc79 --- /dev/null +++ b/patches/openwrt/0027-ar71xx-remove-WZR-600DHP-from-Buffalo-WZR-HP-AG300H-WZR-600DHP-model-name-string-for-now.patch @@ -0,0 +1,31 @@ +From: Matthias Schiffer +Date: Sun, 11 Oct 2015 20:27:28 +0200 +Subject: ar71xx: remove WZR-600DHP from Buffalo WZR-HP-AG300H/WZR-600DHP model name string for now + +We can't use the same image for these two devices, so as a workaround, +remove ZR-600DHP from the name for now, so the autoupdater can work and +users aren't confused. + +diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh +index e1d03ea..1e50b5f 100755 +--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh ++++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh +@@ -886,7 +886,7 @@ ar71xx_board_detect() { + *"WZR-450HP2") + name="wzr-450hp2" + ;; +- *"WZR-HP-AG300H/WZR-600DHP") ++ *"WZR-HP-AG300H") + name="wzr-hp-ag300h" + ;; + *WZR-HP-G300NH) +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-wzr-hp-ag300h.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-wzr-hp-ag300h.c +index edd48f2..a016a3d 100644 +--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-wzr-hp-ag300h.c ++++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-wzr-hp-ag300h.c +@@ -202,4 +202,4 @@ static void __init wzrhpag300h_setup(void) + } + + MIPS_MACHINE(ATH79_MACH_WZR_HP_AG300H, "WZR-HP-AG300H", +- "Buffalo WZR-HP-AG300H/WZR-600DHP", wzrhpag300h_setup); ++ "Buffalo WZR-HP-AG300H", wzrhpag300h_setup); diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 7ea0590d..09260745 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -183,9 +183,9 @@ $(eval $(call GluonModel,WRT160NL,wrt160nl,linksys-wrt160nl)) $(eval $(call GluonProfile,WZRHPG450H)) $(eval $(call GluonModel,WZRHPG450H,wzr-hp-g450h,buffalo-wzr-hp-g450h)) -# WZR-HP-AG300H/WZR-600DHP +# WZR-HP-AG300H $(eval $(call GluonProfile,WZRHPAG300H)) -$(eval $(call GluonModel,WZRHPAG300H,wzr-hp-ag300h,buffalo-wzr-hp-ag300h-wzr-600dhp)) +$(eval $(call GluonModel,WZRHPAG300H,wzr-hp-ag300h,buffalo-wzr-hp-ag300h)) # WHR-HP-G300N $(eval $(call GluonProfile,WHRHPG300N)) From cd751b8b9e660d2c5153a4c7ec0d603c19ec4833 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 11 Oct 2015 20:56:53 +0200 Subject: [PATCH 135/867] Revert "ar71xx: remove WZR-600DHP from Buffalo WZR-HP-AG300H/WZR-600DHP model name string for now" This reverts commit 8ad3c88179734bf399f92daba927163122aa678a. --- ...WZR-600DHP-model-name-string-for-now.patch | 31 ------------------- targets/ar71xx-generic/profiles.mk | 4 +-- 2 files changed, 2 insertions(+), 33 deletions(-) delete mode 100644 patches/openwrt/0027-ar71xx-remove-WZR-600DHP-from-Buffalo-WZR-HP-AG300H-WZR-600DHP-model-name-string-for-now.patch diff --git a/patches/openwrt/0027-ar71xx-remove-WZR-600DHP-from-Buffalo-WZR-HP-AG300H-WZR-600DHP-model-name-string-for-now.patch b/patches/openwrt/0027-ar71xx-remove-WZR-600DHP-from-Buffalo-WZR-HP-AG300H-WZR-600DHP-model-name-string-for-now.patch deleted file mode 100644 index 3085dc79..00000000 --- a/patches/openwrt/0027-ar71xx-remove-WZR-600DHP-from-Buffalo-WZR-HP-AG300H-WZR-600DHP-model-name-string-for-now.patch +++ /dev/null @@ -1,31 +0,0 @@ -From: Matthias Schiffer -Date: Sun, 11 Oct 2015 20:27:28 +0200 -Subject: ar71xx: remove WZR-600DHP from Buffalo WZR-HP-AG300H/WZR-600DHP model name string for now - -We can't use the same image for these two devices, so as a workaround, -remove ZR-600DHP from the name for now, so the autoupdater can work and -users aren't confused. - -diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh -index e1d03ea..1e50b5f 100755 ---- a/target/linux/ar71xx/base-files/lib/ar71xx.sh -+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh -@@ -886,7 +886,7 @@ ar71xx_board_detect() { - *"WZR-450HP2") - name="wzr-450hp2" - ;; -- *"WZR-HP-AG300H/WZR-600DHP") -+ *"WZR-HP-AG300H") - name="wzr-hp-ag300h" - ;; - *WZR-HP-G300NH) -diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-wzr-hp-ag300h.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-wzr-hp-ag300h.c -index edd48f2..a016a3d 100644 ---- a/target/linux/ar71xx/files/arch/mips/ath79/mach-wzr-hp-ag300h.c -+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-wzr-hp-ag300h.c -@@ -202,4 +202,4 @@ static void __init wzrhpag300h_setup(void) - } - - MIPS_MACHINE(ATH79_MACH_WZR_HP_AG300H, "WZR-HP-AG300H", -- "Buffalo WZR-HP-AG300H/WZR-600DHP", wzrhpag300h_setup); -+ "Buffalo WZR-HP-AG300H", wzrhpag300h_setup); diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 09260745..7ea0590d 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -183,9 +183,9 @@ $(eval $(call GluonModel,WRT160NL,wrt160nl,linksys-wrt160nl)) $(eval $(call GluonProfile,WZRHPG450H)) $(eval $(call GluonModel,WZRHPG450H,wzr-hp-g450h,buffalo-wzr-hp-g450h)) -# WZR-HP-AG300H +# WZR-HP-AG300H/WZR-600DHP $(eval $(call GluonProfile,WZRHPAG300H)) -$(eval $(call GluonModel,WZRHPAG300H,wzr-hp-ag300h,buffalo-wzr-hp-ag300h)) +$(eval $(call GluonModel,WZRHPAG300H,wzr-hp-ag300h,buffalo-wzr-hp-ag300h-wzr-600dhp)) # WHR-HP-G300N $(eval $(call GluonProfile,WHRHPG300N)) From 6d92fcb50e1476a54738aca7eee4d4786a2aabec Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 11 Oct 2015 21:07:33 +0200 Subject: [PATCH 136/867] Make Gluon/OpenWrt profile mapping more flexible Add an optional third argument to the GluonProfile macro while contains the OpenWrt profile name. This allows creating different Gluon profiles (with different image names etc.) from the same OpenWrt profile. --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d19354d8..b01b7253 100644 --- a/Makefile +++ b/Makefile @@ -146,6 +146,7 @@ endef define GluonProfile PROFILES += $(1) PROFILE_PACKAGES += $(filter-out -%,$(2) $(GLUON_$(1)_SITE_PACKAGES)) +GLUON_$(1)_PROFILE := $(if $(3),$(3),$(1)) GLUON_$(1)_DEFAULT_PACKAGES := $(2) GLUON_$(1)_FACTORY_SUFFIX := -squashfs-factory GLUON_$(1)_SYSUPGRADE_SUFFIX := -squashfs-sysupgrade @@ -391,7 +392,7 @@ image: FORCE $(call Image/mkfs/prepare) $(_SINGLE)$(NO_TRACE_MAKE) -C $(TOPDIR)/target/linux/$(BOARD)/image install TARGET_BUILD=1 IMG_PREFIX=gluon \ - PROFILE="$(PROFILE)" KDIR="$(PROFILE_KDIR)" TARGET_DIR="$(TARGET_DIR)" BIN_DIR="$(BIN_DIR)" TMP_DIR="$(TMP_DIR)" + PROFILE="$(GLUON_$(PROFILE)_PROFILE)" KDIR="$(PROFILE_KDIR)" TARGET_DIR="$(TARGET_DIR)" BIN_DIR="$(BIN_DIR)" TMP_DIR="$(TMP_DIR)" $(foreach model,$(GLUON_$(PROFILE)_MODELS), \ $(if $(GLUON_$(PROFILE)_SYSUPGRADE_EXT), \ From fca6cb817ff187eb2e3a0682e87de5fdeef9dfeb Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 11 Oct 2015 21:08:57 +0200 Subject: [PATCH 137/867] Fix Buffalo WZR-600DHP support. Use the same image for sysupgrade on WZR-HP-AG300H and WZR-600DHP, but use different factory images. --- targets/ar71xx-generic/profiles.mk | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 7ea0590d..1721a467 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -183,9 +183,20 @@ $(eval $(call GluonModel,WRT160NL,wrt160nl,linksys-wrt160nl)) $(eval $(call GluonProfile,WZRHPG450H)) $(eval $(call GluonModel,WZRHPG450H,wzr-hp-g450h,buffalo-wzr-hp-g450h)) -# WZR-HP-AG300H/WZR-600DHP +# WZR-HP-AG300H (factory) $(eval $(call GluonProfile,WZRHPAG300H)) -$(eval $(call GluonModel,WZRHPAG300H,wzr-hp-ag300h,buffalo-wzr-hp-ag300h-wzr-600dhp)) +$(eval $(call GluonProfileSysupgradeSuffix,WZRHPAG300H)) +$(eval $(call GluonModel,WZRHPAG300H,wzr-hp-ag300h,buffalo-wzr-hp-ag300h)) + +# WZR-600DHP (factory) +$(eval $(call GluonProfile,WZR600DHP)) +$(eval $(call GluonProfileSysupgradeSuffix,WZR600DHP)) +$(eval $(call GluonModel,WZR600DHP,wzr-600dhp,buffalo-wzr-600dhp)) + +# WZR-HP-AG300H/WZR-600DHP (sysupgrade) +$(eval $(call GluonProfile,WZRHPAG300H_WZR600DHP,,WZRHPAG300H)) +$(eval $(call GluonProfileFactorySuffix,WZRHPAG300H_WZR600DHP)) +$(eval $(call GluonModel,WZRHPAG300H_WZR600DHP,wzr-hp-ag300h,buffalo-wzr-hp-ag300h-wzr-600dhp)) # WHR-HP-G300N $(eval $(call GluonProfile,WHRHPG300N)) From 12f9df7e866d8ebfab4e09694eaa1447c91f02c7 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 11 Oct 2015 21:19:28 +0200 Subject: [PATCH 138/867] gluon-config-mode-core: don't throw error when no config mode modules are installed The expert mode can still be useful without any cohfig mode modules. --- .../lib/lua/luci/model/cbi/gluon-config-mode/wizard.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/package/gluon-config-mode-core/files/usr/lib/lua/luci/model/cbi/gluon-config-mode/wizard.lua b/package/gluon-config-mode-core/files/usr/lib/lua/luci/model/cbi/gluon-config-mode/wizard.lua index dda5e58c..569dd60e 100644 --- a/package/gluon-config-mode-core/files/usr/lib/lua/luci/model/cbi/gluon-config-mode/wizard.lua +++ b/package/gluon-config-mode-core/files/usr/lib/lua/luci/model/cbi/gluon-config-mode/wizard.lua @@ -6,9 +6,12 @@ local util = require "nixio.util" local f, s local wizard = {} -local files = util.consume(fs.dir(wizard_dir)) +local files = {} -table.sort(files) +if fs.access(wizard_dir) then + files = util.consume(fs.dir(wizard_dir)) + table.sort(files) +end for _, entry in ipairs(files) do if entry:sub(1, 1) ~= '.' then From b88c9f7877a8572b1edf2b20435d6f4bba3f1731 Mon Sep 17 00:00:00 2001 From: "A.Kasper" Date: Mon, 12 Oct 2015 04:19:05 +0200 Subject: [PATCH 139/867] kernel: add kernel modules for rtl8150 and rtl8152 based usb-to-ethernet converters This patch adds the kernel modules to for the very common Realtek RTL8150 and Realtek 8152 based USB-to-Ethernet converters. After this patch the following packages can be added to targets (or site.mk): kmod-usb-net-rtl8150 kmod-usb-net-rtl8152 The modules are already available in openwrt trunk, but not in Chaos Calmer. This patch is just a temporary backport. The modules are needed for Futros with additional USB-Ethernet-Interface and VMs with dedicated USB-NIC --- ...152-based-USB-to-Ethernet-converters.patch | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 patches/openwrt/0027-Kernel-Realtek-8150-and-Realtek-8152-based-USB-to-Ethernet-converters.patch diff --git a/patches/openwrt/0027-Kernel-Realtek-8150-and-Realtek-8152-based-USB-to-Ethernet-converters.patch b/patches/openwrt/0027-Kernel-Realtek-8150-and-Realtek-8152-based-USB-to-Ethernet-converters.patch new file mode 100644 index 00000000..b726c97b --- /dev/null +++ b/patches/openwrt/0027-Kernel-Realtek-8150-and-Realtek-8152-based-USB-to-Ethernet-converters.patch @@ -0,0 +1,49 @@ +From: Andre Kasper +Date: Mon, 12 Oct 2015 02:31:05 +0200 +Subject: Kernel: Realtek 8150 and Realtek 8152 based USB-to-Ethernet converters + +This patch adds the kernel modules to for the very common Realtek RTL8150 and Realtek 8152 based USB-to-Ethernet converters. +After this patch the following packages can be added to targets (or site.mk): +kmod-usb-net-rtl8150 +kmod-usb-net-rtl8152 + +The modules are already available in openwrt trunk, but not in Chaos Calmer. This patch is just a temporary backport. +The modules are needed for Futros with additional USB-Ethernet-Interface and VMs with dedicated USB-NIC + +diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk +index d1ff455..86f452e 100644 +--- a/package/kernel/linux/modules/usb.mk ++++ b/package/kernel/linux/modules/usb.mk +@@ -1554,3 +1554,32 @@ define KernelPackage/usb3/description + endef + + $(eval $(call KernelPackage,usb3)) ++ ++define KernelPackage/usb-net-rtl8150 ++ TITLE:=Kernel module for USB-to-Ethernet Realtek convertors ++ KCONFIG:=CONFIG_USB_RTL8150 ++ FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/rtl8150.ko ++ AUTOLOAD:=$(call AutoProbe,rtl8150) ++ $(call AddDepends/usb-net) ++endef ++ ++define KernelPackage/usb-net-rtl8150/description ++ Kernel module for USB-to-Ethernet Realtek 8150 convertors ++endef ++ ++$(eval $(call KernelPackage,usb-net-rtl8150)) ++ ++ ++define KernelPackage/usb-net-rtl8152 ++ TITLE:=Kernel module for USB-to-Ethernet Realtek convertors ++ KCONFIG:=CONFIG_USB_RTL8152 ++ FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/r8152.ko ++ AUTOLOAD:=$(call AutoProbe,r8152) ++ $(call AddDepends/usb-net) ++endef ++ ++define KernelPackage/usb-net-rtl8152/description ++ Kernel module for USB-to-Ethernet Realtek 8152 USB2.0/3.0 convertors ++endef ++ ++$(eval $(call KernelPackage,usb-net-rtl8152)) From 23933b684271477a4bd6b0ac4ac020f54cc4699f Mon Sep 17 00:00:00 2001 From: Franz Pletz Date: Wed, 9 Sep 2015 22:32:52 +0200 Subject: [PATCH 140/867] Add support for Ubiquity Air Gateway --- targets/ar71xx-generic/profiles.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 8cfe724f..4b3c31cd 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -139,6 +139,8 @@ endif ## Ubiquiti (everything) $(eval $(call GluonProfile,UBNT)) +$(eval $(call GluonModel,UBNT,ubnt-air-gateway,ubiquiti-airgateway)) + $(eval $(call GluonModel,UBNT,ubnt-bullet-m,ubiquiti-bullet-m)) $(eval $(call GluonModel,UBNT,ubnt-bullet-m,ubiquiti-loco-m)) $(eval $(call GluonModel,UBNT,ubnt-bullet-m,ubiquiti-picostation-m)) From 435ded0c60906c6db23e6567da3ca2c13ce42eb6 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Mon, 31 Aug 2015 19:56:21 +0200 Subject: [PATCH 141/867] gluon-announce: build a tree of functions first collect_dir() will now pre-load all files and return a function that will collect all information. --- .../files/usr/lib/lua/gluon/announce.lua | 28 +++++++++++++------ .../files/usr/lib/lua/gluon/announced.lua | 7 ++++- 2 files changed, 26 insertions(+), 9 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 444dbd33..8a91e6f8 100644 --- a/package/gluon-announce/files/usr/lib/lua/gluon/announce.lua +++ b/package/gluon-announce/files/usr/lib/lua/gluon/announce.lua @@ -10,24 +10,36 @@ local function collect_entry(entry) if fs.stat(entry, 'type') == 'dir' then return collect_dir(entry) else - return setfenv(loadfile(entry), _M)() + return loadfile(entry) end end function collect_dir(dir) - local ret = { [{}] = true } + local fns = {} for entry in fs.dir(dir) do if entry:sub(1, 1) ~= '.' then - local ok, val = pcall(collect_entry, dir .. '/' .. entry) - if ok then - ret[entry] = val + local fn, err = collect_entry(dir .. '/' .. entry) + if fn then + fns[entry] = fn else - io.stderr:write(val, '\n') + io.stderr:write(err, '\n') end end end - return ret -end + return function () + local ret = { [{}] = true } + for k, v in pairs(fns) do + local ok, val = pcall(setfenv(v, _M)) + if ok then + ret[k] = val + else + io.stderr:write(val, '\n') + end + end + + 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 a9de80e6..af2291fe 100644 --- a/package/gluon-announced/files/usr/lib/lua/gluon/announced.lua +++ b/package/gluon-announced/files/usr/lib/lua/gluon/announced.lua @@ -2,9 +2,14 @@ local announce = require 'gluon.announce' local deflate = require 'deflate' local json = require 'luci.jsonc' +local memoize = {} local function collect(type) - return announce.collect_dir('/lib/gluon/announce/' .. type .. '.d') + if not memoize[type] then + memoize[type] = announce.collect_dir('/lib/gluon/announce/' .. type .. '.d') + end + + return memoize[type]() end From 9dffb1284ffed3b1efaccca292c6fbe009993f5b Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Tue, 1 Sep 2015 18:09:00 +0200 Subject: [PATCH 142/867] gluon-announce(d): preload functions, collectgarbage By calling collectgarbage() at various places I was able to reduce heap usage by ~270kb. --- .../files/usr/lib/lua/gluon/announce.lua | 6 ++++ .../files/usr/lib/lua/gluon/announced.lua | 30 +++++++++++++------ 2 files changed, 27 insertions(+), 9 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 8a91e6f8..29a1f817 100644 --- a/package/gluon-announce/files/usr/lib/lua/gluon/announce.lua +++ b/package/gluon-announce/files/usr/lib/lua/gluon/announce.lua @@ -19,7 +19,9 @@ function collect_dir(dir) 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 @@ -32,7 +34,9 @@ function collect_dir(dir) 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 @@ -40,6 +44,8 @@ function collect_dir(dir) end end + 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 af2291fe..f6863277 100644 --- a/package/gluon-announced/files/usr/lib/lua/gluon/announced.lua +++ b/package/gluon-announced/files/usr/lib/lua/gluon/announced.lua @@ -1,26 +1,29 @@ local announce = require 'gluon.announce' local deflate = require 'deflate' local json = require 'luci.jsonc' +local nixio = require 'nixio' +local fs = require 'nixio.fs' local memoize = {} -local function collect(type) - if not memoize[type] then - memoize[type] = announce.collect_dir('/lib/gluon/announce/' .. type .. '.d') - end +nixio.chdir('/lib/gluon/announce/') - return memoize[type]() +for dir in fs.glob('*.d') do + local name = dir:sub(1, -3) + memoize[name] = announce.collect_dir(dir) end +local function collect(type) + return memoize[type] and memoize[type]() +end module('gluon.announced', package.seeall) function handle_request(query) - if query:match('^nodeinfo$') then - return json.stringify(collect('nodeinfo')) - end + collectgarbage() local m = query:match('^GET ([a-z ]+)$') + local ret if m then local data = {} @@ -32,7 +35,16 @@ function handle_request(query) end if next(data) then - return deflate.compress(json.stringify(data)) + ret = deflate.compress(json.stringify(data)) + end + elseif query:match('^[a-z]+$') then + local ok, data = pcall(collect, query) + if ok then + ret = json.stringify(data) end end + + collectgarbage() + + return ret end From b46d4fd537845e135a4e635d2d4323a344f7f5d5 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 12 Oct 2015 20:56:26 +0200 Subject: [PATCH 143/867] gluon-mesh-batman-adv-core: make gateway selection class configurable Fixes #401 --- docs/site-example/site.conf | 12 ++++++++++++ docs/user/site.rst | 16 ++++++++++++++++ .../gluon-mesh-batman-adv-core/check_site.lua | 4 ++++ .../upgrade/310-gluon-mesh-batman-adv-core-mesh | 6 ++++++ 4 files changed, 38 insertions(+) diff --git a/docs/site-example/site.conf b/docs/site-example/site.conf index 9545b1be..f40f839d 100644 --- a/docs/site-example/site.conf +++ b/docs/site-example/site.conf @@ -82,6 +82,18 @@ mac = 'xe:xx:xx:xx:xx:xx', }, + -- Options specific to routing protocols (optional) + -- mesh = { + -- Options specific to the batman-adv routing protocol (optional) + -- batman_adv = { + -- Gateway selection class (optional) + -- The default class 20 is based on the link quality (TQ) only, + -- class 1 is calculated from both the TQ and the announced bandwidth + -- gw_sel_class = 1, + -- }, + -- }, + + next_node = { -- Refer to http://fastd.readthedocs.org/en/latest/ to better understand -- what these options do. fastd_mesh_vpn = { diff --git a/docs/user/site.rst b/docs/user/site.rst index 60024bf0..cb1528b1 100644 --- a/docs/user/site.rst +++ b/docs/user/site.rst @@ -117,6 +117,22 @@ next_node : package mac = 'ca:ff:ee:ba:be:00' } +mesh : optional + Options specific to routing protocols. + + At the moment, only the ``batman_adv`` routing protocol has such options: + + The optional value ``gw_sel_class`` sets the gateway selection class. The default + class 20 is based on the link quality (TQ) only, class 1 is calculated from + both the TQ and the announced bandwidth. + :: + + mesh = { + batman_adv = { + gw_sel_class = 1, + }, + } + fastd_mesh_vpn Remote server setup for the fastd-based mesh VPN. diff --git a/package/gluon-mesh-batman-adv-core/check_site.lua b/package/gluon-mesh-batman-adv-core/check_site.lua index 2c5badc2..49fff159 100644 --- a/package/gluon-mesh-batman-adv-core/check_site.lua +++ b/package/gluon-mesh-batman-adv-core/check_site.lua @@ -21,3 +21,7 @@ end need_boolean('mesh_on_wan', false) need_boolean('mesh_on_lan', false) + +if need_table('mesh', nil, false) and need_table('mesh.batman_adv', nil, false) then + need_number('mesh.batman_adv.gw_sel_class', false) +end diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh index b35aa010..fe576e33 100755 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh +++ b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh @@ -6,11 +6,17 @@ local site = require 'gluon.site_config' local uci = require('luci.model.uci').cursor() +local gw_sel_class +if site.mesh and site.mesh.batman_adv then + gw_sel_class = site.mesh.batman_adv.gw_sel_class +end + uci:delete('batman-adv', 'bat0') uci:section('batman-adv', 'mesh', 'bat0', { orig_interval = 5000, gw_mode = 'client', + gw_sel_class = gw_sel_class, hop_penalty = 15, multicast_mode = 0, } From 55b7b05db3ccac233e9687f28efecd459c591986 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 13 Oct 2015 01:34:40 +0200 Subject: [PATCH 144/867] ar71xx-generic: disable WHR-HP-G300N profile because of image size issues --- targets/ar71xx-generic/profiles.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 1721a467..59dbeb58 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -199,8 +199,8 @@ $(eval $(call GluonProfileFactorySuffix,WZRHPAG300H_WZR600DHP)) $(eval $(call GluonModel,WZRHPAG300H_WZR600DHP,wzr-hp-ag300h,buffalo-wzr-hp-ag300h-wzr-600dhp)) # WHR-HP-G300N -$(eval $(call GluonProfile,WHRHPG300N)) -$(eval $(call GluonModel,WHRHPG300N,whr-hp-g300n,buffalo-whr-hp-g300n)) +#$(eval $(call GluonProfile,WHRHPG300N)) +#$(eval $(call GluonModel,WHRHPG300N,whr-hp-g300n,buffalo-whr-hp-g300n)) ## Netgear From 69d18cc9e984abb30a4e1be64ca9e369cdba924a Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 13 Oct 2015 21:58:27 +0200 Subject: [PATCH 145/867] build: update opkg config generation to match upstream --- Makefile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index b01b7253..5271fd6d 100644 --- a/Makefile +++ b/Makefile @@ -375,11 +375,10 @@ package_install: FORCE include $(INCLUDE_DIR)/version.mk opkg_config: FORCE - cp $(GLUON_OPENWRTDIR)/package/system/opkg/files/opkg.conf $(TARGET_DIR)/etc/opkg.conf for d in base packages luci routing telephony management; do \ - echo "src/gz %n_$$d %U/$$d" >> $(TARGET_DIR)/etc/opkg.conf; \ - done - $(VERSION_SED) $(TARGET_DIR)/etc/opkg.conf + echo "src/gz %n_$$d %U/$$d"; \ + done > $(TARGET_DIR)/etc/opkg/distfeeds.conf + $(VERSION_SED) $(TARGET_DIR)/etc/opkg/distfeeds.conf image: FORCE From d5c334af6dc6ece74d2dc7dbef907f729d868db9 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 14 Oct 2015 02:55:13 +0200 Subject: [PATCH 146/867] gluon-core: replace opkg site configuration to make it more flexible The new options allow specifying custom repositories and are evaluated in an upgrade script, not during build. --- docs/user/site.rst | 27 ++++++++-- include/gluon.mk | 6 +-- package/gluon-core/Makefile | 1 + package/gluon-core/check_site.lua | 13 +++++ .../files/lib/gluon/upgrade/500-opkg | 49 +++++++++++++++++++ 5 files changed, 87 insertions(+), 9 deletions(-) create mode 100755 package/gluon-core/files/lib/gluon/upgrade/500-opkg diff --git a/docs/user/site.rst b/docs/user/site.rst index cb1528b1..70e6b5ff 100644 --- a/docs/user/site.rst +++ b/docs/user/site.rst @@ -46,14 +46,31 @@ ntp_server ntp_servers = {'1.ntp.services.ffeh','2.tnp.services.ffeh'} -opkg_repo : optional - Overwrite the default ``opkg`` repository server, e.g.: +opkg : optional + ``opkg`` package manager configuration. + + There are two optional fields in the ``opkg`` section: + + - ``openwrt`` overrides the default OpenWrt repository URL + - ``extra`` specifies a table of additional repositories (with arbitrary keys) + :: - opkg_repo = 'http://opkg.services.ffeh/attitude_adjustment/12.09/%S/packages' + opkg = { + openwrt = 'http://opkg.services.ffeh/openwrt/%n/%v/%S/packages', + extra = { + modules = 'http://opkg.services.ffeh/modules/gluon-%GS-%GR/%S', + }, + } - The `%S` is a variable, which is replaced with the platform of an device - during the build process. + There are various patterns which can be used in the URLs: + + - ``%n`` is replaced by the OpenWrt version codename (e.g. "chaos_calmer") + - ``%v`` is replaced by the OpenWrt version number (e.g. "15.05") + - ``%S`` is replaced by the target architecture (e.g. "ar71xx/generic") + - ``%GS`` is replaced by the Gluon site code (as specified in ``site.conf``) + - ``%GV`` is replaced by the Gluon version + - ``%GR`` is replaced by the Gluon release (as specified in ``site.mk``) regdom The wireless regulatory domain responsible for your area, e.g.: diff --git a/include/gluon.mk b/include/gluon.mk index 8aca3f74..44aad1ec 100644 --- a/include/gluon.mk +++ b/include/gluon.mk @@ -35,10 +35,8 @@ export GLUON_LANGS ifeq ($(OPENWRT_BUILD),1) ifeq ($(GLUON_TOOLS),1) -DEFAULT_OPKG_REPO := http://downloads.openwrt.org/chaos_calmer/15.05/%S/packages - -CONFIG_VERSION_REPO := $(shell $(GLUONDIR)/scripts/site.sh opkg_repo || echo '$(DEFAULT_OPKG_REPO)') -export CONFIG_VERSION_REPO +GLUON_OPENWRT_FEEDS := base packages luci routing telephony management +export GLUON_OPENWRT_FEEDS GLUON_SITE_CODE := $(shell $(GLUONDIR)/scripts/site.sh site_code) export GLUON_SITE_CODE diff --git a/package/gluon-core/Makefile b/package/gluon-core/Makefile index bf9768e2..ddf67dcd 100644 --- a/package/gluon-core/Makefile +++ b/package/gluon-core/Makefile @@ -32,6 +32,7 @@ endef define Package/gluon-core/install $(CP) ./files/* $(1)/ + $(SED) 's/__GLUON_OPENWRT_FEEDS__/{$(GLUON_OPENWRT_FEEDS:%="%",)}/' $(1)/lib/gluon/upgrade/500-opkg $(INSTALL_DIR) $(1)/lib/gluon echo "$(GLUON_VERSION)" > $(1)/lib/gluon/gluon-version diff --git a/package/gluon-core/check_site.lua b/package/gluon-core/check_site.lua index 1a6987a0..4217b626 100644 --- a/package/gluon-core/check_site.lua +++ b/package/gluon-core/check_site.lua @@ -1,6 +1,19 @@ need_string 'site_code' need_string 'site_name' +if need_table('opkg', nil, false) then + need_string('opkg.openwrt', false) + + function check_repo(k, _) + -- this is not actually a uci name, but using the same naming rules here is fine + assert_uci_name(k) + + need_string(string.format('opkg.extra[%q]', k)) + end + + need_table('opkg.extra', check_repo, false) +end + need_string('hostname_prefix', false) need_string 'timezone' diff --git a/package/gluon-core/files/lib/gluon/upgrade/500-opkg b/package/gluon-core/files/lib/gluon/upgrade/500-opkg new file mode 100755 index 00000000..4380050c --- /dev/null +++ b/package/gluon-core/files/lib/gluon/upgrade/500-opkg @@ -0,0 +1,49 @@ +#!/usr/bin/lua + +local fs = require 'nixio.fs' +local site = require 'gluon.site_config' +local util = require 'luci.util' + + +local subst = {} + +subst['%%v'] = util.trim(fs.readfile('/etc/openwrt_version')) +subst['%%n'], subst['%%S'] = util.exec('. /etc/openwrt_release; echo $DISTRIB_CODENAME; echo $DISTRIB_TARGET'):match('([^\n]*)\n([^\n]*)') +subst['%%GS'] = site.site_code +subst['%%GV'] = util.trim(fs.readfile('/lib/gluon/gluon-version')) +subst['%%GR'] = util.trim(fs.readfile('/lib/gluon/release')) + +function replace_patterns(url) + for k, v in pairs(subst) do + url = url:gsub(k, v) + end + + return url +end + + +if site.opkg then + if site.opkg.openwrt then + local url = replace_patterns(site.opkg.openwrt) + local f = io.open('/etc/opkg/distfeeds.conf', 'w') + + for _, v in ipairs(__GLUON_OPENWRT_FEEDS__) do + f:write(replace_patterns(string.format('src/gz %%n_%s %s/%s\n', v, site.opkg.openwrt, v))) + end + + f:close() + end + + if site.opkg.extra and next(site.opkg.extra) then + local f = io.open('/etc/opkg/gluon.conf', 'w') + + for k, v in pairs(site.opkg.extra) do + f:write(string.format('src/gz %s %s\n', k, replace_patterns(v))) + end + + f:close() + + else + os.remove('/etc/opkg/gluon.conf') + end +end From d2ff7d5c224466890f38b278ad356d7b54430807 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Litza Date: Tue, 1 Sep 2015 00:26:38 +0200 Subject: [PATCH 147/867] gluon-neighbour-info: Add -l and -c parameter, make event type for -s configurable --- .../src/gluon-neighbour-info.c | 53 ++++++++++++++----- .../www/cgi-bin/dyn/neighbours-nodeinfo | 2 +- 2 files changed, 41 insertions(+), 14 deletions(-) diff --git a/package/gluon-neighbour-info/src/gluon-neighbour-info.c b/package/gluon-neighbour-info/src/gluon-neighbour-info.c index 46e6324d..b2652bcc 100644 --- a/package/gluon-neighbour-info/src/gluon-neighbour-info.c +++ b/package/gluon-neighbour-info/src/gluon-neighbour-info.c @@ -36,13 +36,17 @@ #include void usage() { - puts("Usage: gluon-neighbour-info [-h] [-s] [-t ] -d -p -i -r "); + puts("Usage: gluon-neighbour-info [-h] [-s] [-l] [-c ] [-t ] -d -p -i -r "); puts(" -p UDP port"); puts(" -d multicast group, e.g. ff02:0:0:0:0:0:2:1001"); puts(" -i interface, e.g. eth0 "); puts(" -r request, e.g. nodeinfo"); puts(" -t timeout in seconds (default: 3)"); - puts(" -s output as server-sent events"); + puts(" -s output as server-sent events of type "); + puts(" or without type if is the empty string"); + puts(" -c only wait for at most replies"); + puts(" -l after timeout (or replies if -c is given),"); + puts(" send another request and loop forever"); puts(" -h this help\n"); } @@ -78,9 +82,10 @@ ssize_t recvtimeout(int socket, void *buffer, size_t length, int flags, struct t return ret; } -int request(const int sock, const struct sockaddr_in6 *client_addr, const char *request, bool sse, double timeout) { +int request(const int sock, const struct sockaddr_in6 *client_addr, const char *request, const char *sse, double timeout, unsigned int max_count) { ssize_t ret; char buffer[8192]; + unsigned int count = 0; ret = sendto(sock, request, strlen(request), 0, (struct sockaddr *)client_addr, sizeof(struct sockaddr_in6)); @@ -95,14 +100,17 @@ int request(const int sock, const struct sockaddr_in6 *client_addr, const char * getclock(&tv_offset); - while (1) { + do { ret = recvtimeout(sock, buffer, sizeof(buffer), 0, &tv_timeout, &tv_offset); if (ret < 0) break; - if (sse) - fputs("event: neighbour\ndata: ", stdout); + if (sse) { + if (sse[0] != '\0') + fprintf(stdout, "event: %s\n", sse); + fputs("data: ", stdout); + } fwrite(buffer, sizeof(char), ret, stdout); @@ -112,9 +120,13 @@ int request(const int sock, const struct sockaddr_in6 *client_addr, const char * fputs("\n", stdout); fflush(stdout); - } + count++; + } while (max_count == 0 || count < max_count); - return 0; + if ((max_count == 0 && count == 0) || count < max_count) + return EXIT_FAILURE; + else + return EXIT_SUCCESS; } int main(int argc, char **argv) { @@ -137,11 +149,14 @@ int main(int argc, char **argv) { int port_set = 0; int destination_set = 0; + unsigned int max_count = 0; double timeout = 3.0; - bool sse = false; + char *sse = NULL; + bool loop = false; + int ret = false; int c; - while ((c = getopt(argc, argv, "p:d:r:i:t:sh")) != -1) + while ((c = getopt(argc, argv, "p:d:r:i:t:s:c:lh")) != -1) switch (c) { case 'p': client_addr.sin6_port = htons(atoi(optarg)); @@ -166,7 +181,17 @@ int main(int argc, char **argv) { timeout = atof(optarg); break; case 's': - sse = true; + sse = optarg; + break; + case 'l': + loop = true; + break; + case 'c': + max_count = atoi(optarg); + if (max_count < 0) { + perror("Negative count not supported"); + exit(EXIT_FAILURE); + } break; case 'h': usage(); @@ -184,10 +209,12 @@ int main(int argc, char **argv) { if (sse) fputs("Content-Type: text/event-stream\n\n", stdout); - request(sock, &client_addr, request_string, sse, timeout); + do { + ret = request(sock, &client_addr, request_string, sse, timeout, max_count); + } while(loop); if (sse) fputs("event: eot\ndata: null\n\n", stdout); - return EXIT_SUCCESS; + return ret; } 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 34c1204e..4420570e 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 @@ -4,4 +4,4 @@ echo 'Access-Control-Allow-Origin: *' batctl if | cut -d: -f1 | grep -qxF "$QUERY_STRING" || exit 1 -exec /usr/bin/gluon-neighbour-info -s -i "$QUERY_STRING" -d ff02::2:1001 -p 1001 -r nodeinfo +exec /usr/bin/gluon-neighbour-info -s neighbour -i "$QUERY_STRING" -d ff02::2:1001 -p 1001 -r nodeinfo From bae65192796500bddebfa2db2b836aa41309ce39 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Litza Date: Mon, 31 Aug 2015 22:39:21 +0200 Subject: [PATCH 148/867] gluon-alfred/gluon-status-page: Query gluon-announced By not executing all scripts from gluon.announce themselves, both should be considerably faster and lighter on RAM usage. --- package/gluon-alfred/Makefile | 2 +- .../gluon-alfred/files/lib/gluon/cron/alfred | 2 +- .../status-page/www/cgi-bin/dyn/statistics | 19 +++---------------- .../gluon/status-page/www/cgi-bin/nodeinfo | 19 ++++++------------- 4 files changed, 11 insertions(+), 31 deletions(-) diff --git a/package/gluon-alfred/Makefile b/package/gluon-alfred/Makefile index bb6926a5..8ddabdd2 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-announce +gluon-cron +alfred + DEPENDS:=+gluon-core +gluon-announced +gluon-neighbour-info +gluon-cron +alfred TITLE:=Configure alfred endef diff --git a/package/gluon-alfred/files/lib/gluon/cron/alfred b/package/gluon-alfred/files/lib/gluon/cron/alfred index 9f79bc64..87c052b2 100644 --- a/package/gluon-alfred/files/lib/gluon/cron/alfred +++ b/package/gluon-alfred/files/lib/gluon/cron/alfred @@ -1 +1 @@ -* * * * * /lib/gluon/announce/collect.lua nodeinfo | gzip | alfred -s 158; /lib/gluon/announce/collect.lua statistics | gzip | alfred -s 159; /lib/gluon/announce/collect.lua neighbours | gzip | alfred -s 160 +* * * * * gluon-neighbour-info -d ::1 -p 1001 -t 1 -c 1 -r nodeinfo | gzip | alfred -s 158; gluon-neighbour-info -d ::1 -p 1001 -t 1 -c 1 -r statistics | gzip | alfred -s 159; gluon-neighbour-info -d ::1 -p 1001 -t 1 -c 1 -r neighbours | gzip | alfred -s 160 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 194564b9..f93a10b4 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,18 +1,5 @@ -#!/usr/bin/lua +#!/bin/sh -local announce = require 'gluon.announce' -local json = require 'luci.jsonc' -local util = require 'luci.util' -local nixio = require 'nixio' +echo "Access-Control-Allow-Origin: *" -local announce_dir = '/lib/gluon/announce/statistics.d/' - -io.write("Access-Control-Allow-Origin: *\n") -io.write("Content-type: text/event-stream\n\n") - -while true do - local data = json.stringify(announce.collect_dir(announce_dir)) - io.write("data: " .. data .. "\n\n") - io.flush() - nixio.nanosleep(1, 0) -end +exec gluon-neighbour-info -s "" -l -d ::1 -p 1001 -t 1 -r statistics diff --git a/package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/nodeinfo b/package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/nodeinfo index 78789244..d34381fa 100755 --- a/package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/nodeinfo +++ b/package/gluon-status-page-api/files/lib/gluon/status-page/www/cgi-bin/nodeinfo @@ -1,15 +1,8 @@ -#!/usr/bin/lua +#!/bin/sh -local announce = require 'gluon.announce' -local json = require 'luci.jsonc' -local util = require 'luci.util' -local nixio = require 'nixio' +cat < Date: Mon, 31 Aug 2015 22:40:25 +0200 Subject: [PATCH 149/867] gluon-announce: Remove now unused collect.lua The file promotes the probably unnecessary re-execution of the announce scripts. Instead, gluon-announced should be queried using gluon-neighbour-info -d ::1 -p 1001 -t0 -r nodeinfo if both gluon-announced and gluon-neighbour-info are present. But to not depend on any of those, no script for this one-liner is provided. --- .../gluon-announce/files/lib/gluon/announce/collect.lua | 8 -------- 1 file changed, 8 deletions(-) delete mode 100755 package/gluon-announce/files/lib/gluon/announce/collect.lua diff --git a/package/gluon-announce/files/lib/gluon/announce/collect.lua b/package/gluon-announce/files/lib/gluon/announce/collect.lua deleted file mode 100755 index 3510fbf0..00000000 --- a/package/gluon-announce/files/lib/gluon/announce/collect.lua +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/lua - -local announce = require 'gluon.announce' -local json = require 'luci.jsonc' - -local announce_dir = '/lib/gluon/announce/' .. arg[1] .. '.d' - -print(json.stringify(announce.collect_dir(announce_dir))) From 9f6009469b2e508191a010a44268a0f9349d34cb Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 14 Oct 2015 23:24:11 +0200 Subject: [PATCH 150/867] Update Gluon modules --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 4abf024b..dec568c4 100644 --- a/modules +++ b/modules @@ -8,7 +8,7 @@ PACKAGES_OPENWRT_COMMIT=9f3881f1f35b11b4587ad6b7cca5136cad43c12a PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git -PACKAGES_GLUON_COMMIT=6ddb1d3c0a208544345d3c9930d3e57381aeb640 +PACKAGES_GLUON_COMMIT=48cddbbb55691825596f7f640848dd24d4d4edff PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_COMMIT=ae65d4fe027592652376f8dbd3ff2ef37f5a84bc From 26682b24b358df9299322b961f09f3d03aaff7c2 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 14 Oct 2015 21:21:48 +0200 Subject: [PATCH 151/867] Replace gluon-simple-tc by non-Gluon-specific simple-tc The Gluon-specific functions of the gluon-simple-tc package are moved to gluon-mesh-vpn-fastd. --- docs/site-example/site.conf | 27 +- docs/user/site.rst | 26 +- package/gluon-config-mode-mesh-vpn/Makefile | 2 +- .../config-mode/wizard/0300-mesh-vpn.lua | 20 +- .../lib/gluon/upgrade/290-legacy-simple-tc | 6 +- package/gluon-mesh-vpn-fastd/Makefile | 2 +- package/gluon-mesh-vpn-fastd/check_site.lua | 7 + .../upgrade/420-mesh-vpn-fastd-simple-tc | 32 + package/gluon-simple-tc/Makefile | 47 - package/gluon-simple-tc/check_site.lua | 12 - .../files/etc/config/gluon-simple-tc | 7 - .../etc/hotplug.d/net/50-gluon-simple-tc | 26 - .../etc/modules-boot.d/30-gluon-simple-tc | 1 - .../files/etc/modules.d/30-gluon-simple-tc | 4 - .../gluon/upgrade/300-simple-tc-site-defaults | 23 - package/gluon-simple-tc/src/Makefile | 4 - package/gluon-simple-tc/src/gluon-simple-tc.c | 292 ------ .../src/include/linux/pkt_cls.h | 483 ---------- .../src/include/linux/pkt_sched.h | 846 ------------------ .../src/include/linux/rtnetlink.h | 639 ------------- 20 files changed, 77 insertions(+), 2429 deletions(-) create mode 100755 package/gluon-mesh-vpn-fastd/files/lib/gluon/upgrade/420-mesh-vpn-fastd-simple-tc delete mode 100644 package/gluon-simple-tc/Makefile delete mode 100644 package/gluon-simple-tc/check_site.lua delete mode 100644 package/gluon-simple-tc/files/etc/config/gluon-simple-tc delete mode 100644 package/gluon-simple-tc/files/etc/hotplug.d/net/50-gluon-simple-tc delete mode 120000 package/gluon-simple-tc/files/etc/modules-boot.d/30-gluon-simple-tc delete mode 100644 package/gluon-simple-tc/files/etc/modules.d/30-gluon-simple-tc delete mode 100755 package/gluon-simple-tc/files/lib/gluon/upgrade/300-simple-tc-site-defaults delete mode 100644 package/gluon-simple-tc/src/Makefile delete mode 100644 package/gluon-simple-tc/src/gluon-simple-tc.c delete mode 100644 package/gluon-simple-tc/src/include/linux/pkt_cls.h delete mode 100644 package/gluon-simple-tc/src/include/linux/pkt_sched.h delete mode 100644 package/gluon-simple-tc/src/include/linux/rtnetlink.h diff --git a/docs/site-example/site.conf b/docs/site-example/site.conf index f40f839d..88e9b734 100644 --- a/docs/site-example/site.conf +++ b/docs/site-example/site.conf @@ -136,6 +136,17 @@ -- ... -- }, }, + + bandwidth_limit = { + -- The bandwidth limit can be enabled by default here. + enabled = false, + + -- Default upload limit (kbit/s). + egress = 200, + + -- Default download limit (kbit/s). + ingress = 3000, + }, }, autoupdater = { @@ -177,22 +188,6 @@ -- }, -- }, - -- Bandwidth limiting - simple_tc = { - mesh_vpn = { - ifname = 'mesh-vpn', - - -- You may enable it by default here. - enabled = false, - - -- Default upload limit (kbit/s). - limit_egress = 200, - - -- Default download limit (kbit/s). - limit_ingress = 3000, - }, - }, - -- Skip setup mode (config mode) on first boot -- setup_mode = { -- skip = true, diff --git a/docs/user/site.rst b/docs/user/site.rst index cb1528b1..8ed774df 100644 --- a/docs/user/site.rst +++ b/docs/user/site.rst @@ -165,7 +165,18 @@ fastd_mesh_vpn }, } } - } + }, + + bandwidth_limit = { + -- The bandwidth limit can be enabled by default here. + enabled = false, + + -- Default upload limit (kbit/s). + egress = 200, + + -- Default download limit (kbit/s). + ingress = 3000, + }, } mesh_on_wan : optional @@ -220,19 +231,6 @@ roles : optional }, }, -simple_tc : package - Uplink traffic control, ingress and egress values are specified in kbit/s. - :: - - simple_tc = { - mesh_vpn = { - ifname = 'mesh-vpn', - enabled = false, - limit_egress = 200, - limit_ingress = 3000, - }, - }, - setup_mode : package Allows skipping setup mode (config mode) at first boot when attribute ``skip`` is set to ``true``. This is optional and may be left out. diff --git a/package/gluon-config-mode-mesh-vpn/Makefile b/package/gluon-config-mode-mesh-vpn/Makefile index 6a8a3f2c..35d53ea7 100644 --- a/package/gluon-config-mode-mesh-vpn/Makefile +++ b/package/gluon-config-mode-mesh-vpn/Makefile @@ -14,7 +14,7 @@ define Package/gluon-config-mode-mesh-vpn SECTION:=gluon CATEGORY:=Gluon TITLE:=Toggle mesh-vpn and bandwidth limit - DEPENDS:=gluon-config-mode-core-virtual +gluon-mesh-vpn-fastd +gluon-simple-tc + DEPENDS:=gluon-config-mode-core-virtual +gluon-mesh-vpn-fastd endef define Build/Prepare diff --git a/package/gluon-config-mode-mesh-vpn/files/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua b/package/gluon-config-mode-mesh-vpn/files/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua index 669a7bc3..9e2f4008 100644 --- a/package/gluon-config-mode-mesh-vpn/files/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua +++ b/package/gluon-config-mode-mesh-vpn/files/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua @@ -21,18 +21,18 @@ function M.section(form) o = s:option(cbi.Flag, "_limit_enabled", i18n.translate("Limit bandwidth")) o:depends("_meshvpn", "1") - o.default = uci:get_bool("gluon-simple-tc", "mesh_vpn", "enabled") and o.enabled or o.disabled + o.default = uci:get_bool("simple-tc", "mesh_vpn", "enabled") and o.enabled or o.disabled o.rmempty = false o = s:option(cbi.Value, "_limit_ingress", i18n.translate("Downstream (kbit/s)")) o:depends("_limit_enabled", "1") - o.value = uci:get("gluon-simple-tc", "mesh_vpn", "limit_ingress") + o.value = uci:get("simple-tc", "mesh_vpn", "limit_ingress") o.rmempty = false o.datatype = "integer" o = s:option(cbi.Value, "_limit_egress", i18n.translate("Upstream (kbit/s)")) o:depends("_limit_enabled", "1") - o.value = uci:get("gluon-simple-tc", "mesh_vpn", "limit_egress") + o.value = uci:get("simple-tc", "mesh_vpn", "limit_egress") o.rmempty = false o.datatype = "integer" end @@ -44,20 +44,20 @@ function M.handle(data) -- checks for nil needed due to o:depends(...) if data._limit_enabled ~= nil then - uci:set("gluon-simple-tc", "mesh_vpn", "interface") - uci:set("gluon-simple-tc", "mesh_vpn", "enabled", data._limit_enabled) - uci:set("gluon-simple-tc", "mesh_vpn", "ifname", "mesh-vpn") + uci:set("simple-tc", "mesh_vpn", "interface") + uci:set("simple-tc", "mesh_vpn", "enabled", data._limit_enabled) + uci:set("simple-tc", "mesh_vpn", "ifname", "mesh-vpn") if data._limit_ingress ~= nil then - uci:set("gluon-simple-tc", "mesh_vpn", "limit_ingress", data._limit_ingress) + uci:set("simple-tc", "mesh_vpn", "limit_ingress", data._limit_ingress) end if data._limit_egress ~= nil then - uci:set("gluon-simple-tc", "mesh_vpn", "limit_egress", data._limit_egress) + uci:set("simple-tc", "mesh_vpn", "limit_egress", data._limit_egress) end - uci:commit("gluon-simple-tc") - uci:commit("gluon-simple-tc") + uci:commit("simple-tc") + uci:commit("simple-tc") end end diff --git a/package/gluon-legacy/files/lib/gluon/upgrade/290-legacy-simple-tc b/package/gluon-legacy/files/lib/gluon/upgrade/290-legacy-simple-tc index c67afe14..56621887 100755 --- a/package/gluon-legacy/files/lib/gluon/upgrade/290-legacy-simple-tc +++ b/package/gluon-legacy/files/lib/gluon/upgrade/290-legacy-simple-tc @@ -11,7 +11,7 @@ if sysconfig.gluon_version == 'legacy' then local s = uci:get_first(config, 'bandwidth') if s then old = uci:get_all(config, s) - uci:section('gluon-simple-tc', 'interface', 'mesh_vpn', + uci:section('simple-tc', 'interface', 'mesh_vpn', { ifname = 'mesh-vpn', enabled = old.enabled, @@ -20,8 +20,8 @@ if sysconfig.gluon_version == 'legacy' then } ) - uci:save('gluon-simple-tc') - uci:commit('gluon-simple-tc') + uci:save('simple-tc') + uci:commit('simple-tc') break end diff --git a/package/gluon-mesh-vpn-fastd/Makefile b/package/gluon-mesh-vpn-fastd/Makefile index 775f92f1..4fdd608b 100644 --- a/package/gluon-mesh-vpn-fastd/Makefile +++ b/package/gluon-mesh-vpn-fastd/Makefile @@ -11,7 +11,7 @@ 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 + DEPENDS:=+gluon-core gluon-mesh-batman-adv +gluon-wan-dnsmasq +fastd +iptables-mod-extra +simple-tc endef define Package/gluon-mesh-vpn-fastd/description diff --git a/package/gluon-mesh-vpn-fastd/check_site.lua b/package/gluon-mesh-vpn-fastd/check_site.lua index 7960ea19..30cca11d 100644 --- a/package/gluon-mesh-vpn-fastd/check_site.lua +++ b/package/gluon-mesh-vpn-fastd/check_site.lua @@ -28,3 +28,10 @@ local function check_group(prefix) end need_table('fastd_mesh_vpn.groups', check_group('fastd_mesh_vpn.groups')) + + +if need_table('fastd_mesh_vpn.bandwidth_limit', nil, false) then + need_boolean('fastd_mesh_vpn.bandwidth_limit.enabled', false) + need_number('fastd_mesh_vpn.bandwidth_limit.ingress', false) + need_number('fastd_mesh_vpn.bandwidth_limit.egress', false) +end diff --git a/package/gluon-mesh-vpn-fastd/files/lib/gluon/upgrade/420-mesh-vpn-fastd-simple-tc b/package/gluon-mesh-vpn-fastd/files/lib/gluon/upgrade/420-mesh-vpn-fastd-simple-tc new file mode 100755 index 00000000..d4cfcdde --- /dev/null +++ b/package/gluon-mesh-vpn-fastd/files/lib/gluon/upgrade/420-mesh-vpn-fastd-simple-tc @@ -0,0 +1,32 @@ +#!/usr/bin/lua + +local site = require 'gluon.site_config' +local uci = require('luci.model.uci').cursor() +local fs = require 'nixio.fs' + + +if fs.access('/etc/config/gluon-simple-tc') then + os.rename('/etc/config/gluon-simple-tc', '/etc/config/simple-tc') +end + + +if not uci:get('simple-tc', 'mesh_vpn') then + local config = { + ifname = 'mesh-vpn', + enabled = 0, + } + + + if site.fastd_mesh_vpn.bandwidth_limit then + if site.fastd_mesh_vpn.bandwidth_limit.enabled then + config.enabled = 1 + end + + config.limit_ingress = site.fastd_mesh_vpn.bandwidth_limit.ingress + config.limit_egress = site.fastd_mesh_vpn.bandwidth_limit.egress + end + + uci:section('simple-tc', 'interface', 'mesh_vpn', config) + uci:save('simple-tc') + uci:commit('simple-tc') +end diff --git a/package/gluon-simple-tc/Makefile b/package/gluon-simple-tc/Makefile deleted file mode 100644 index b01b9641..00000000 --- a/package/gluon-simple-tc/Makefile +++ /dev/null @@ -1,47 +0,0 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=gluon-simple-tc -PKG_VERSION:=4 - -PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) - -include $(GLUONDIR)/include/package.mk - -define Package/gluon-simple-tc - SECTION:=gluon - CATEGORY:=Gluon - TITLE:=Bandwidth limit support - DEPENDS:=+gluon-core +kmod-sched +libnl-tiny -endef - -define Package/gluon-simple-tc/description - Gluon community wifi mesh firmware framework: tc support -endef - -define Build/Prepare - mkdir -p $(PKG_BUILD_DIR) - $(CP) ./src/* $(PKG_BUILD_DIR)/ -endef - -define Build/Configure -endef - - -TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/libnl-tiny - -define Build/Compile - CFLAGS="$(TARGET_CFLAGS)" CPPFLAGS="$(TARGET_CPPFLAGS)" $(MAKE) -C $(PKG_BUILD_DIR) $(TARGET_CONFIGURE_OPTS) -endef - -define Package/gluon-simple-tc/install - $(CP) ./files/* $(1)/ - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/gluon-simple-tc $(1)/usr/sbin/ -endef - -define Package/gluon-simple-tc/postinst -#!/bin/sh -$(call GluonCheckSite,check_site.lua) -endef - -$(eval $(call BuildPackage,gluon-simple-tc)) diff --git a/package/gluon-simple-tc/check_site.lua b/package/gluon-simple-tc/check_site.lua deleted file mode 100644 index 3b8ddc53..00000000 --- a/package/gluon-simple-tc/check_site.lua +++ /dev/null @@ -1,12 +0,0 @@ -local function check_entry(k, _) - assert_uci_name(k) - - local prefix = string.format('simple_tc[%q].', k) - - need_string(prefix .. 'ifname') - need_boolean(prefix .. 'enabled') - need_number(prefix .. 'limit_egress') - need_number(prefix .. 'limit_ingress') -end - -need_table('simple_tc', check_entry) diff --git a/package/gluon-simple-tc/files/etc/config/gluon-simple-tc b/package/gluon-simple-tc/files/etc/config/gluon-simple-tc deleted file mode 100644 index c9b784c6..00000000 --- a/package/gluon-simple-tc/files/etc/config/gluon-simple-tc +++ /dev/null @@ -1,7 +0,0 @@ -# Example config - -config interface 'example' - option enabled '0' - option ifname 'eth0' - option limit_egress '1000' # 1000 Kbit/s - option limit_ingress '5000' # 5000 Kbit/s diff --git a/package/gluon-simple-tc/files/etc/hotplug.d/net/50-gluon-simple-tc b/package/gluon-simple-tc/files/etc/hotplug.d/net/50-gluon-simple-tc deleted file mode 100644 index 8dd82781..00000000 --- a/package/gluon-simple-tc/files/etc/hotplug.d/net/50-gluon-simple-tc +++ /dev/null @@ -1,26 +0,0 @@ -[ "$ACTION" = 'add' ] || exit 0 - -config_load gluon-simple-tc - - -tc_interface() { - local iface="$1" - - config_get ifname "$iface" ifname - - [ "$INTERFACE" = "$ifname" ] || return - - config_get_bool enabled "$iface" enabled 0 - - [ "$enabled" -eq 1 ] || return - - config_get limit_ingress "$iface" limit_ingress - config_get limit_egress "$iface" limit_egress - - [ "$limit_ingress" ] || limit_ingress=- - [ "$limit_egress" ] || limit_egress=- - - gluon-simple-tc "$INTERFACE" "$limit_ingress" "$limit_egress" -} - -config_foreach tc_interface 'interface' diff --git a/package/gluon-simple-tc/files/etc/modules-boot.d/30-gluon-simple-tc b/package/gluon-simple-tc/files/etc/modules-boot.d/30-gluon-simple-tc deleted file mode 120000 index 44318d6e..00000000 --- a/package/gluon-simple-tc/files/etc/modules-boot.d/30-gluon-simple-tc +++ /dev/null @@ -1 +0,0 @@ -../modules.d/30-gluon-simple-tc \ No newline at end of file diff --git a/package/gluon-simple-tc/files/etc/modules.d/30-gluon-simple-tc b/package/gluon-simple-tc/files/etc/modules.d/30-gluon-simple-tc deleted file mode 100644 index 72b238c7..00000000 --- a/package/gluon-simple-tc/files/etc/modules.d/30-gluon-simple-tc +++ /dev/null @@ -1,4 +0,0 @@ -sch_ingress -sch_tbf -cls_basic -act_police diff --git a/package/gluon-simple-tc/files/lib/gluon/upgrade/300-simple-tc-site-defaults b/package/gluon-simple-tc/files/lib/gluon/upgrade/300-simple-tc-site-defaults deleted file mode 100755 index 037cb45f..00000000 --- a/package/gluon-simple-tc/files/lib/gluon/upgrade/300-simple-tc-site-defaults +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/lua - -local site = require 'gluon.site_config' -local uci = require 'luci.model.uci' - -local c = uci.cursor() - - -for name, config in pairs(site.simple_tc) do - if not c:get('gluon-simple-tc', name) then - c:section('gluon-simple-tc', 'interface', name, - { - ifname = config.ifname, - enabled = config.enabled and 1 or 0, - limit_egress = config.limit_egress, - limit_ingress = config.limit_ingress, - } - ) - end -end - -c:save('gluon-simple-tc') -c:commit('gluon-simple-tc') diff --git a/package/gluon-simple-tc/src/Makefile b/package/gluon-simple-tc/src/Makefile deleted file mode 100644 index 502c6232..00000000 --- a/package/gluon-simple-tc/src/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -all: gluon-simple-tc - -gluon-simple-tc: gluon-simple-tc.c - $(CC) -Iinclude $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -Wall -o $@ $^ $(LDLIBS) -lnl-tiny diff --git a/package/gluon-simple-tc/src/gluon-simple-tc.c b/package/gluon-simple-tc/src/gluon-simple-tc.c deleted file mode 100644 index 9e5bb206..00000000 --- a/package/gluon-simple-tc/src/gluon-simple-tc.c +++ /dev/null @@ -1,292 +0,0 @@ -/* - Copyright (c) 2014, 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. -*/ - - -#define _GNU_SOURCE - -#include -#include -#include -#include -#include -#include - -#include - -#include -#include - -#include - -#include -#include -#include -#include - - -#include -#include -#include - - -static struct nl_cb *cb; -static struct nl_sock *sock; -static double ticks; - -static unsigned ifindex; - -static bool nlexpect; -static int nlerror; - - -static inline void exit_errno(const char *message) { - error(1, errno, "error: %s", message); -} - -static inline void warn_errno(const char *message) { - error(0, errno, "warning: %s", message); -} - - -static void read_psched(void) { - uint32_t clock_res; - uint32_t t2us; - uint32_t us2t; - - FILE *f = fopen("/proc/net/psched", "r"); - if (!f || fscanf(f, "%08x %08x %08x", &t2us, &us2t, &clock_res) != 3) - exit_errno("error reading /proc/net/psched"); - fclose(f); - - /* compatibility hack from iproute... */ - if (clock_res == 1000000000) - t2us = us2t; - - ticks = (double)t2us / us2t * clock_res; -} - - -static struct nl_msg * prepare_tcmsg(int type, int flags, uint32_t parent, uint32_t handle, uint32_t info) { - struct nl_msg *msg = nlmsg_alloc_simple(type, flags); - if (!msg) - exit_errno("nlmsg_alloc_simple"); - - struct tcmsg tcmsg; - memset(&tcmsg, 0, sizeof(tcmsg)); - - tcmsg.tcm_family = AF_UNSPEC; - tcmsg.tcm_ifindex = ifindex; - tcmsg.tcm_parent = parent; - tcmsg.tcm_handle = handle; - tcmsg.tcm_info = info; - - nlmsg_append(msg, &tcmsg, sizeof(tcmsg), NLMSG_ALIGNTO); - - return msg; -} - - -static int error_handler(struct sockaddr_nl *nla __attribute__((unused)), struct nlmsgerr *nlerr, void *arg __attribute__((unused))) { - if (!nlexpect || (nlerr->error != -ENOENT && nlerr->error != -EINVAL)) - nlerror = -nlerr->error; - - return NL_STOP; -} - -static bool do_send(struct nl_msg *msg, bool expect) { - nlerror = 0; - nlexpect = expect; - - nl_send_auto_complete(sock, msg); - nlmsg_free(msg); - nl_wait_for_ack(sock); - - if (nlerror) { - error(0, nlerror, "netlink"); - errno = nlerror; - return false; - } - - return true; -} - - -static inline unsigned get_xmittime(double rate, unsigned size) { - return ticks * (size/rate); -} - - -static void complete_rate(struct tc_ratespec *r, uint32_t rtab[256]) { - r->linklayer = TC_LINKLAYER_ETHERNET; - r->cell_align = -1; - r->cell_log = 3; - - unsigned i; - for (i = 0; i < 256; i++) - rtab[i] = get_xmittime(r->rate, (i + 1) << 3); -} - - -static void do_ingress(double rate) { - if (!do_send(prepare_tcmsg(RTM_DELQDISC, 0, TC_H_INGRESS, 0xffff0000, 0), true)) - return; - - if (rate < 0) - return; - - - struct nl_msg *msg = prepare_tcmsg(RTM_NEWQDISC, NLM_F_CREATE | NLM_F_EXCL, TC_H_INGRESS, 0xffff0000, 0); - nla_put_string(msg, TCA_KIND, "ingress"); - - if (!do_send(msg, false)) - return; - - - msg = prepare_tcmsg(RTM_NEWTFILTER, NLM_F_CREATE | NLM_F_EXCL, 0xffff0000, 0, TC_H_MAKE(0, htons(ETH_P_ALL))); - - const unsigned buffer = 10240; - - struct tc_police p; - memset(&p, 0, sizeof(p)); - - /* Range check has been done in main() */ - p.rate.rate = rate; - p.burst = get_xmittime(p.rate.rate, buffer); - p.action = TC_POLICE_SHOT; - - uint32_t rtab[256]; - complete_rate(&p.rate, rtab); - - nla_put_string(msg, TCA_KIND, "basic"); - - struct nlattr *opts = nla_nest_start(msg, TCA_OPTIONS); - struct nlattr *police = nla_nest_start(msg, TCA_BASIC_POLICE); - - nla_put(msg, TCA_POLICE_TBF, sizeof(p), &p); - nla_put(msg, TCA_POLICE_RATE, sizeof(rtab), rtab); - - nla_nest_end(msg, police); - nla_nest_end(msg, opts); - - do_send(msg, false); -} - -static void do_egress(double rate) { - if (!do_send(prepare_tcmsg(RTM_DELQDISC, 0, TC_H_ROOT, 0, 0), true)) - return; - - if (rate < 0) - return; - - - struct nl_msg *msg = prepare_tcmsg(RTM_NEWQDISC, NLM_F_CREATE | NLM_F_EXCL, TC_H_ROOT, 0, 0); - const unsigned buffer = 2048; - - struct tc_tbf_qopt opt; - memset(&opt, 0, sizeof(opt)); - - /* Range check has been done in main() */ - opt.rate.rate = rate; - opt.limit = 0.05*rate + buffer; - opt.buffer = get_xmittime(opt.rate.rate, buffer); - - uint32_t rtab[256]; - complete_rate(&opt.rate, rtab); - - nla_put_string(msg, TCA_KIND, "tbf"); - - struct nlattr *opts = nla_nest_start(msg, TCA_OPTIONS); - nla_put(msg, TCA_TBF_PARMS, sizeof(opt), &opt); - nla_put(msg, TCA_TBF_BURST, sizeof(buffer), &buffer); - nla_put(msg, TCA_TBF_RTAB, sizeof(rtab), rtab); - nla_nest_end(msg, opts); - - do_send(msg, false); -} - - -static inline void usage(void) { - fprintf(stderr, "Usage: gluon-simple-tc |- |-\n"); - exit(1); -} - -static inline void maxrate(void) { - error(1, 0, "error: maximum allowed rate it about 2^25 Kbit/s"); -} - - -int main(int argc, char *argv[]) { - if (argc != 4) - usage(); - - double ingress = -1, egress = -1; - char *end; - - ifindex = if_nametoindex(argv[1]); - if (!ifindex) - error(1, 0, "invalid interface: %s", argv[1]); - - if (strcmp(argv[2], "-") != 0) { - ingress = strtod(argv[2], &end); - if (*end || ingress < 0) - usage(); - - ingress *= 125; - - if (ingress >= (1ull << 32)) - maxrate(); - } - - if (strcmp(argv[3], "-") != 0) { - egress = strtod(argv[3], &end); - if (*end || egress < 0) - usage(); - - egress *= 125; - - if (egress >= (1ull << 32)) - maxrate(); - } - - read_psched(); - - cb = nl_cb_alloc(NL_CB_DEFAULT); - nl_cb_err(cb, NL_CB_CUSTOM, error_handler, NULL); - - sock = nl_socket_alloc_cb(cb); - if (!sock) - exit_errno("nl_socket_alloc"); - - if (nl_connect(sock, NETLINK_ROUTE)) - exit_errno("nl_connect"); - - do_ingress(ingress); - do_egress(egress); - - nl_socket_free(sock); - nl_cb_put(cb); - - return 0; -} diff --git a/package/gluon-simple-tc/src/include/linux/pkt_cls.h b/package/gluon-simple-tc/src/include/linux/pkt_cls.h deleted file mode 100644 index 25731dfb..00000000 --- a/package/gluon-simple-tc/src/include/linux/pkt_cls.h +++ /dev/null @@ -1,483 +0,0 @@ -#ifndef __LINUX_PKT_CLS_H -#define __LINUX_PKT_CLS_H - -#include -#include - -/* I think i could have done better macros ; for now this is stolen from - * some arch/mips code - jhs -*/ -#define _TC_MAKE32(x) ((x)) - -#define _TC_MAKEMASK1(n) (_TC_MAKE32(1) << _TC_MAKE32(n)) -#define _TC_MAKEMASK(v,n) (_TC_MAKE32((_TC_MAKE32(1)<<(v))-1) << _TC_MAKE32(n)) -#define _TC_MAKEVALUE(v,n) (_TC_MAKE32(v) << _TC_MAKE32(n)) -#define _TC_GETVALUE(v,n,m) ((_TC_MAKE32(v) & _TC_MAKE32(m)) >> _TC_MAKE32(n)) - -/* verdict bit breakdown - * -bit 0: when set -> this packet has been munged already - -bit 1: when set -> It is ok to munge this packet - -bit 2,3,4,5: Reclassify counter - sort of reverse TTL - if exceeded -assume loop - -bit 6,7: Where this packet was last seen -0: Above the transmit example at the socket level -1: on the Ingress -2: on the Egress - -bit 8: when set --> Request not to classify on ingress. - -bits 9,10,11: redirect counter - redirect TTL. Loop avoidance - - * - * */ - -#define TC_MUNGED _TC_MAKEMASK1(0) -#define SET_TC_MUNGED(v) ( TC_MUNGED | (v & ~TC_MUNGED)) -#define CLR_TC_MUNGED(v) ( v & ~TC_MUNGED) - -#define TC_OK2MUNGE _TC_MAKEMASK1(1) -#define SET_TC_OK2MUNGE(v) ( TC_OK2MUNGE | (v & ~TC_OK2MUNGE)) -#define CLR_TC_OK2MUNGE(v) ( v & ~TC_OK2MUNGE) - -#define S_TC_VERD _TC_MAKE32(2) -#define M_TC_VERD _TC_MAKEMASK(4,S_TC_VERD) -#define G_TC_VERD(x) _TC_GETVALUE(x,S_TC_VERD,M_TC_VERD) -#define V_TC_VERD(x) _TC_MAKEVALUE(x,S_TC_VERD) -#define SET_TC_VERD(v,n) ((V_TC_VERD(n)) | (v & ~M_TC_VERD)) - -#define S_TC_FROM _TC_MAKE32(6) -#define M_TC_FROM _TC_MAKEMASK(2,S_TC_FROM) -#define G_TC_FROM(x) _TC_GETVALUE(x,S_TC_FROM,M_TC_FROM) -#define V_TC_FROM(x) _TC_MAKEVALUE(x,S_TC_FROM) -#define SET_TC_FROM(v,n) ((V_TC_FROM(n)) | (v & ~M_TC_FROM)) -#define AT_STACK 0x0 -#define AT_INGRESS 0x1 -#define AT_EGRESS 0x2 - -#define TC_NCLS _TC_MAKEMASK1(8) -#define SET_TC_NCLS(v) ( TC_NCLS | (v & ~TC_NCLS)) -#define CLR_TC_NCLS(v) ( v & ~TC_NCLS) - -#define S_TC_RTTL _TC_MAKE32(9) -#define M_TC_RTTL _TC_MAKEMASK(3,S_TC_RTTL) -#define G_TC_RTTL(x) _TC_GETVALUE(x,S_TC_RTTL,M_TC_RTTL) -#define V_TC_RTTL(x) _TC_MAKEVALUE(x,S_TC_RTTL) -#define SET_TC_RTTL(v,n) ((V_TC_RTTL(n)) | (v & ~M_TC_RTTL)) - -#define S_TC_AT _TC_MAKE32(12) -#define M_TC_AT _TC_MAKEMASK(2,S_TC_AT) -#define G_TC_AT(x) _TC_GETVALUE(x,S_TC_AT,M_TC_AT) -#define V_TC_AT(x) _TC_MAKEVALUE(x,S_TC_AT) -#define SET_TC_AT(v,n) ((V_TC_AT(n)) | (v & ~M_TC_AT)) - -/* Action attributes */ -enum { - TCA_ACT_UNSPEC, - TCA_ACT_KIND, - TCA_ACT_OPTIONS, - TCA_ACT_INDEX, - TCA_ACT_STATS, - __TCA_ACT_MAX -}; - -#define TCA_ACT_MAX __TCA_ACT_MAX -#define TCA_OLD_COMPAT (TCA_ACT_MAX+1) -#define TCA_ACT_MAX_PRIO 32 -#define TCA_ACT_BIND 1 -#define TCA_ACT_NOBIND 0 -#define TCA_ACT_UNBIND 1 -#define TCA_ACT_NOUNBIND 0 -#define TCA_ACT_REPLACE 1 -#define TCA_ACT_NOREPLACE 0 -#define MAX_REC_LOOP 4 -#define MAX_RED_LOOP 4 - -#define TC_ACT_UNSPEC (-1) -#define TC_ACT_OK 0 -#define TC_ACT_RECLASSIFY 1 -#define TC_ACT_SHOT 2 -#define TC_ACT_PIPE 3 -#define TC_ACT_STOLEN 4 -#define TC_ACT_QUEUED 5 -#define TC_ACT_REPEAT 6 -#define TC_ACT_JUMP 0x10000000 - -/* Action type identifiers*/ -enum { - TCA_ID_UNSPEC=0, - TCA_ID_POLICE=1, - /* other actions go here */ - __TCA_ID_MAX=255 -}; - -#define TCA_ID_MAX __TCA_ID_MAX - -struct tc_police { - __u32 index; - int action; -#define TC_POLICE_UNSPEC TC_ACT_UNSPEC -#define TC_POLICE_OK TC_ACT_OK -#define TC_POLICE_RECLASSIFY TC_ACT_RECLASSIFY -#define TC_POLICE_SHOT TC_ACT_SHOT -#define TC_POLICE_PIPE TC_ACT_PIPE - - __u32 limit; - __u32 burst; - __u32 mtu; - struct tc_ratespec rate; - struct tc_ratespec peakrate; - int refcnt; - int bindcnt; - __u32 capab; -}; - -struct tcf_t { - __u64 install; - __u64 lastuse; - __u64 expires; -}; - -struct tc_cnt { - int refcnt; - int bindcnt; -}; - -#define tc_gen \ - __u32 index; \ - __u32 capab; \ - int action; \ - int refcnt; \ - int bindcnt - -enum { - TCA_POLICE_UNSPEC, - TCA_POLICE_TBF, - TCA_POLICE_RATE, - TCA_POLICE_PEAKRATE, - TCA_POLICE_AVRATE, - TCA_POLICE_RESULT, - __TCA_POLICE_MAX -#define TCA_POLICE_RESULT TCA_POLICE_RESULT -}; - -#define TCA_POLICE_MAX (__TCA_POLICE_MAX - 1) - -/* U32 filters */ - -#define TC_U32_HTID(h) ((h)&0xFFF00000) -#define TC_U32_USERHTID(h) (TC_U32_HTID(h)>>20) -#define TC_U32_HASH(h) (((h)>>12)&0xFF) -#define TC_U32_NODE(h) ((h)&0xFFF) -#define TC_U32_KEY(h) ((h)&0xFFFFF) -#define TC_U32_UNSPEC 0 -#define TC_U32_ROOT (0xFFF00000) - -enum { - TCA_U32_UNSPEC, - TCA_U32_CLASSID, - TCA_U32_HASH, - TCA_U32_LINK, - TCA_U32_DIVISOR, - TCA_U32_SEL, - TCA_U32_POLICE, - TCA_U32_ACT, - TCA_U32_INDEV, - TCA_U32_PCNT, - TCA_U32_MARK, - __TCA_U32_MAX -}; - -#define TCA_U32_MAX (__TCA_U32_MAX - 1) - -struct tc_u32_key { - __be32 mask; - __be32 val; - int off; - int offmask; -}; - -struct tc_u32_sel { - unsigned char flags; - unsigned char offshift; - unsigned char nkeys; - - __be16 offmask; - __u16 off; - short offoff; - - short hoff; - __be32 hmask; - struct tc_u32_key keys[0]; -}; - -struct tc_u32_mark { - __u32 val; - __u32 mask; - __u32 success; -}; - -struct tc_u32_pcnt { - __u64 rcnt; - __u64 rhit; - __u64 kcnts[0]; -}; - -/* Flags */ - -#define TC_U32_TERMINAL 1 -#define TC_U32_OFFSET 2 -#define TC_U32_VAROFFSET 4 -#define TC_U32_EAT 8 - -#define TC_U32_MAXDEPTH 8 - - -/* RSVP filter */ - -enum { - TCA_RSVP_UNSPEC, - TCA_RSVP_CLASSID, - TCA_RSVP_DST, - TCA_RSVP_SRC, - TCA_RSVP_PINFO, - TCA_RSVP_POLICE, - TCA_RSVP_ACT, - __TCA_RSVP_MAX -}; - -#define TCA_RSVP_MAX (__TCA_RSVP_MAX - 1 ) - -struct tc_rsvp_gpi { - __u32 key; - __u32 mask; - int offset; -}; - -struct tc_rsvp_pinfo { - struct tc_rsvp_gpi dpi; - struct tc_rsvp_gpi spi; - __u8 protocol; - __u8 tunnelid; - __u8 tunnelhdr; - __u8 pad; -}; - -/* ROUTE filter */ - -enum { - TCA_ROUTE4_UNSPEC, - TCA_ROUTE4_CLASSID, - TCA_ROUTE4_TO, - TCA_ROUTE4_FROM, - TCA_ROUTE4_IIF, - TCA_ROUTE4_POLICE, - TCA_ROUTE4_ACT, - __TCA_ROUTE4_MAX -}; - -#define TCA_ROUTE4_MAX (__TCA_ROUTE4_MAX - 1) - - -/* FW filter */ - -enum { - TCA_FW_UNSPEC, - TCA_FW_CLASSID, - TCA_FW_POLICE, - TCA_FW_INDEV, /* used by CONFIG_NET_CLS_IND */ - TCA_FW_ACT, /* used by CONFIG_NET_CLS_ACT */ - TCA_FW_MASK, - __TCA_FW_MAX -}; - -#define TCA_FW_MAX (__TCA_FW_MAX - 1) - -/* TC index filter */ - -enum { - TCA_TCINDEX_UNSPEC, - TCA_TCINDEX_HASH, - TCA_TCINDEX_MASK, - TCA_TCINDEX_SHIFT, - TCA_TCINDEX_FALL_THROUGH, - TCA_TCINDEX_CLASSID, - TCA_TCINDEX_POLICE, - TCA_TCINDEX_ACT, - __TCA_TCINDEX_MAX -}; - -#define TCA_TCINDEX_MAX (__TCA_TCINDEX_MAX - 1) - -/* Flow filter */ - -enum { - FLOW_KEY_SRC, - FLOW_KEY_DST, - FLOW_KEY_PROTO, - FLOW_KEY_PROTO_SRC, - FLOW_KEY_PROTO_DST, - FLOW_KEY_IIF, - FLOW_KEY_PRIORITY, - FLOW_KEY_MARK, - FLOW_KEY_NFCT, - FLOW_KEY_NFCT_SRC, - FLOW_KEY_NFCT_DST, - FLOW_KEY_NFCT_PROTO_SRC, - FLOW_KEY_NFCT_PROTO_DST, - FLOW_KEY_RTCLASSID, - FLOW_KEY_SKUID, - FLOW_KEY_SKGID, - FLOW_KEY_VLAN_TAG, - FLOW_KEY_RXHASH, - __FLOW_KEY_MAX, -}; - -#define FLOW_KEY_MAX (__FLOW_KEY_MAX - 1) - -enum { - FLOW_MODE_MAP, - FLOW_MODE_HASH, -}; - -enum { - TCA_FLOW_UNSPEC, - TCA_FLOW_KEYS, - TCA_FLOW_MODE, - TCA_FLOW_BASECLASS, - TCA_FLOW_RSHIFT, - TCA_FLOW_ADDEND, - TCA_FLOW_MASK, - TCA_FLOW_XOR, - TCA_FLOW_DIVISOR, - TCA_FLOW_ACT, - TCA_FLOW_POLICE, - TCA_FLOW_EMATCHES, - TCA_FLOW_PERTURB, - __TCA_FLOW_MAX -}; - -#define TCA_FLOW_MAX (__TCA_FLOW_MAX - 1) - -/* Basic filter */ - -enum { - TCA_BASIC_UNSPEC, - TCA_BASIC_CLASSID, - TCA_BASIC_EMATCHES, - TCA_BASIC_ACT, - TCA_BASIC_POLICE, - __TCA_BASIC_MAX -}; - -#define TCA_BASIC_MAX (__TCA_BASIC_MAX - 1) - - -/* Cgroup classifier */ - -enum { - TCA_CGROUP_UNSPEC, - TCA_CGROUP_ACT, - TCA_CGROUP_POLICE, - TCA_CGROUP_EMATCHES, - __TCA_CGROUP_MAX, -}; - -#define TCA_CGROUP_MAX (__TCA_CGROUP_MAX - 1) - -/* BPF classifier */ - -enum { - TCA_BPF_UNSPEC, - TCA_BPF_ACT, - TCA_BPF_POLICE, - TCA_BPF_CLASSID, - TCA_BPF_OPS_LEN, - TCA_BPF_OPS, - __TCA_BPF_MAX, -}; - -#define TCA_BPF_MAX (__TCA_BPF_MAX - 1) - -/* Extended Matches */ - -struct tcf_ematch_tree_hdr { - __u16 nmatches; - __u16 progid; -}; - -enum { - TCA_EMATCH_TREE_UNSPEC, - TCA_EMATCH_TREE_HDR, - TCA_EMATCH_TREE_LIST, - __TCA_EMATCH_TREE_MAX -}; -#define TCA_EMATCH_TREE_MAX (__TCA_EMATCH_TREE_MAX - 1) - -struct tcf_ematch_hdr { - __u16 matchid; - __u16 kind; - __u16 flags; - __u16 pad; /* currently unused */ -}; - -/* 0 1 - * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 - * +-----------------------+-+-+---+ - * | Unused |S|I| R | - * +-----------------------+-+-+---+ - * - * R(2) ::= relation to next ematch - * where: 0 0 END (last ematch) - * 0 1 AND - * 1 0 OR - * 1 1 Unused (invalid) - * I(1) ::= invert result - * S(1) ::= simple payload - */ -#define TCF_EM_REL_END 0 -#define TCF_EM_REL_AND (1<<0) -#define TCF_EM_REL_OR (1<<1) -#define TCF_EM_INVERT (1<<2) -#define TCF_EM_SIMPLE (1<<3) - -#define TCF_EM_REL_MASK 3 -#define TCF_EM_REL_VALID(v) (((v) & TCF_EM_REL_MASK) != TCF_EM_REL_MASK) - -enum { - TCF_LAYER_LINK, - TCF_LAYER_NETWORK, - TCF_LAYER_TRANSPORT, - __TCF_LAYER_MAX -}; -#define TCF_LAYER_MAX (__TCF_LAYER_MAX - 1) - -/* Ematch type assignments - * 1..32767 Reserved for ematches inside kernel tree - * 32768..65535 Free to use, not reliable - */ -#define TCF_EM_CONTAINER 0 -#define TCF_EM_CMP 1 -#define TCF_EM_NBYTE 2 -#define TCF_EM_U32 3 -#define TCF_EM_META 4 -#define TCF_EM_TEXT 5 -#define TCF_EM_VLAN 6 -#define TCF_EM_CANID 7 -#define TCF_EM_IPSET 8 -#define TCF_EM_MAX 8 - -enum { - TCF_EM_PROG_TC -}; - -enum { - TCF_EM_OPND_EQ, - TCF_EM_OPND_GT, - TCF_EM_OPND_LT -}; - -#endif diff --git a/package/gluon-simple-tc/src/include/linux/pkt_sched.h b/package/gluon-simple-tc/src/include/linux/pkt_sched.h deleted file mode 100644 index d62316ba..00000000 --- a/package/gluon-simple-tc/src/include/linux/pkt_sched.h +++ /dev/null @@ -1,846 +0,0 @@ -#ifndef __LINUX_PKT_SCHED_H -#define __LINUX_PKT_SCHED_H - -#include - -/* Logical priority bands not depending on specific packet scheduler. - Every scheduler will map them to real traffic classes, if it has - no more precise mechanism to classify packets. - - These numbers have no special meaning, though their coincidence - with obsolete IPv6 values is not occasional :-). New IPv6 drafts - preferred full anarchy inspired by diffserv group. - - Note: TC_PRIO_BESTEFFORT does not mean that it is the most unhappy - class, actually, as rule it will be handled with more care than - filler or even bulk. - */ - -#define TC_PRIO_BESTEFFORT 0 -#define TC_PRIO_FILLER 1 -#define TC_PRIO_BULK 2 -#define TC_PRIO_INTERACTIVE_BULK 4 -#define TC_PRIO_INTERACTIVE 6 -#define TC_PRIO_CONTROL 7 - -#define TC_PRIO_MAX 15 - -/* Generic queue statistics, available for all the elements. - Particular schedulers may have also their private records. - */ - -struct tc_stats { - __u64 bytes; /* Number of enqueued bytes */ - __u32 packets; /* Number of enqueued packets */ - __u32 drops; /* Packets dropped because of lack of resources */ - __u32 overlimits; /* Number of throttle events when this - * flow goes out of allocated bandwidth */ - __u32 bps; /* Current flow byte rate */ - __u32 pps; /* Current flow packet rate */ - __u32 qlen; - __u32 backlog; -}; - -struct tc_estimator { - signed char interval; - unsigned char ewma_log; -}; - -/* "Handles" - --------- - - All the traffic control objects have 32bit identifiers, or "handles". - - They can be considered as opaque numbers from user API viewpoint, - but actually they always consist of two fields: major and - minor numbers, which are interpreted by kernel specially, - that may be used by applications, though not recommended. - - F.e. qdisc handles always have minor number equal to zero, - classes (or flows) have major equal to parent qdisc major, and - minor uniquely identifying class inside qdisc. - - Macros to manipulate handles: - */ - -#define TC_H_MAJ_MASK (0xFFFF0000U) -#define TC_H_MIN_MASK (0x0000FFFFU) -#define TC_H_MAJ(h) ((h)&TC_H_MAJ_MASK) -#define TC_H_MIN(h) ((h)&TC_H_MIN_MASK) -#define TC_H_MAKE(maj,min) (((maj)&TC_H_MAJ_MASK)|((min)&TC_H_MIN_MASK)) - -#define TC_H_UNSPEC (0U) -#define TC_H_ROOT (0xFFFFFFFFU) -#define TC_H_INGRESS (0xFFFFFFF1U) - -/* Need to corrospond to iproute2 tc/tc_core.h "enum link_layer" */ -enum tc_link_layer { - TC_LINKLAYER_UNAWARE, /* Indicate unaware old iproute2 util */ - TC_LINKLAYER_ETHERNET, - TC_LINKLAYER_ATM, -}; -#define TC_LINKLAYER_MASK 0x0F /* limit use to lower 4 bits */ - -struct tc_ratespec { - unsigned char cell_log; - __u8 linklayer; /* lower 4 bits */ - unsigned short overhead; - short cell_align; - unsigned short mpu; - __u32 rate; -}; - -#define TC_RTAB_SIZE 1024 - -struct tc_sizespec { - unsigned char cell_log; - unsigned char size_log; - short cell_align; - int overhead; - unsigned int linklayer; - unsigned int mpu; - unsigned int mtu; - unsigned int tsize; -}; - -enum { - TCA_STAB_UNSPEC, - TCA_STAB_BASE, - TCA_STAB_DATA, - __TCA_STAB_MAX -}; - -#define TCA_STAB_MAX (__TCA_STAB_MAX - 1) - -/* FIFO section */ - -struct tc_fifo_qopt { - __u32 limit; /* Queue length: bytes for bfifo, packets for pfifo */ -}; - -/* PRIO section */ - -#define TCQ_PRIO_BANDS 16 -#define TCQ_MIN_PRIO_BANDS 2 - -struct tc_prio_qopt { - int bands; /* Number of bands */ - __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */ -}; - -/* MULTIQ section */ - -struct tc_multiq_qopt { - __u16 bands; /* Number of bands */ - __u16 max_bands; /* Maximum number of queues */ -}; - -/* PLUG section */ - -#define TCQ_PLUG_BUFFER 0 -#define TCQ_PLUG_RELEASE_ONE 1 -#define TCQ_PLUG_RELEASE_INDEFINITE 2 -#define TCQ_PLUG_LIMIT 3 - -struct tc_plug_qopt { - /* TCQ_PLUG_BUFFER: Inset a plug into the queue and - * buffer any incoming packets - * TCQ_PLUG_RELEASE_ONE: Dequeue packets from queue head - * to beginning of the next plug. - * TCQ_PLUG_RELEASE_INDEFINITE: Dequeue all packets from queue. - * Stop buffering packets until the next TCQ_PLUG_BUFFER - * command is received (just act as a pass-thru queue). - * TCQ_PLUG_LIMIT: Increase/decrease queue size - */ - int action; - __u32 limit; -}; - -/* TBF section */ - -struct tc_tbf_qopt { - struct tc_ratespec rate; - struct tc_ratespec peakrate; - __u32 limit; - __u32 buffer; - __u32 mtu; -}; - -enum { - TCA_TBF_UNSPEC, - TCA_TBF_PARMS, - TCA_TBF_RTAB, - TCA_TBF_PTAB, - TCA_TBF_RATE64, - TCA_TBF_PRATE64, - TCA_TBF_BURST, - TCA_TBF_PBURST, - __TCA_TBF_MAX, -}; - -#define TCA_TBF_MAX (__TCA_TBF_MAX - 1) - - -/* TEQL section */ - -/* TEQL does not require any parameters */ - -/* SFQ section */ - -struct tc_sfq_qopt { - unsigned quantum; /* Bytes per round allocated to flow */ - int perturb_period; /* Period of hash perturbation */ - __u32 limit; /* Maximal packets in queue */ - unsigned divisor; /* Hash divisor */ - unsigned flows; /* Maximal number of flows */ -}; - -struct tc_sfqred_stats { - __u32 prob_drop; /* Early drops, below max threshold */ - __u32 forced_drop; /* Early drops, after max threshold */ - __u32 prob_mark; /* Marked packets, below max threshold */ - __u32 forced_mark; /* Marked packets, after max threshold */ - __u32 prob_mark_head; /* Marked packets, below max threshold */ - __u32 forced_mark_head;/* Marked packets, after max threshold */ -}; - -struct tc_sfq_qopt_v1 { - struct tc_sfq_qopt v0; - unsigned int depth; /* max number of packets per flow */ - unsigned int headdrop; -/* SFQRED parameters */ - __u32 limit; /* HARD maximal flow queue length (bytes) */ - __u32 qth_min; /* Min average length threshold (bytes) */ - __u32 qth_max; /* Max average length threshold (bytes) */ - unsigned char Wlog; /* log(W) */ - unsigned char Plog; /* log(P_max/(qth_max-qth_min)) */ - unsigned char Scell_log; /* cell size for idle damping */ - unsigned char flags; - __u32 max_P; /* probability, high resolution */ -/* SFQRED stats */ - struct tc_sfqred_stats stats; -}; - - -struct tc_sfq_xstats { - __s32 allot; -}; - -/* RED section */ - -enum { - TCA_RED_UNSPEC, - TCA_RED_PARMS, - TCA_RED_STAB, - TCA_RED_MAX_P, - __TCA_RED_MAX, -}; - -#define TCA_RED_MAX (__TCA_RED_MAX - 1) - -struct tc_red_qopt { - __u32 limit; /* HARD maximal queue length (bytes) */ - __u32 qth_min; /* Min average length threshold (bytes) */ - __u32 qth_max; /* Max average length threshold (bytes) */ - unsigned char Wlog; /* log(W) */ - unsigned char Plog; /* log(P_max/(qth_max-qth_min)) */ - unsigned char Scell_log; /* cell size for idle damping */ - unsigned char flags; -#define TC_RED_ECN 1 -#define TC_RED_HARDDROP 2 -#define TC_RED_ADAPTATIVE 4 -}; - -struct tc_red_xstats { - __u32 early; /* Early drops */ - __u32 pdrop; /* Drops due to queue limits */ - __u32 other; /* Drops due to drop() calls */ - __u32 marked; /* Marked packets */ -}; - -/* GRED section */ - -#define MAX_DPs 16 - -enum { - TCA_GRED_UNSPEC, - TCA_GRED_PARMS, - TCA_GRED_STAB, - TCA_GRED_DPS, - TCA_GRED_MAX_P, - __TCA_GRED_MAX, -}; - -#define TCA_GRED_MAX (__TCA_GRED_MAX - 1) - -struct tc_gred_qopt { - __u32 limit; /* HARD maximal queue length (bytes) */ - __u32 qth_min; /* Min average length threshold (bytes) */ - __u32 qth_max; /* Max average length threshold (bytes) */ - __u32 DP; /* up to 2^32 DPs */ - __u32 backlog; - __u32 qave; - __u32 forced; - __u32 early; - __u32 other; - __u32 pdrop; - __u8 Wlog; /* log(W) */ - __u8 Plog; /* log(P_max/(qth_max-qth_min)) */ - __u8 Scell_log; /* cell size for idle damping */ - __u8 prio; /* prio of this VQ */ - __u32 packets; - __u32 bytesin; -}; - -/* gred setup */ -struct tc_gred_sopt { - __u32 DPs; - __u32 def_DP; - __u8 grio; - __u8 flags; - __u16 pad1; -}; - -/* CHOKe section */ - -enum { - TCA_CHOKE_UNSPEC, - TCA_CHOKE_PARMS, - TCA_CHOKE_STAB, - TCA_CHOKE_MAX_P, - __TCA_CHOKE_MAX, -}; - -#define TCA_CHOKE_MAX (__TCA_CHOKE_MAX - 1) - -struct tc_choke_qopt { - __u32 limit; /* Hard queue length (packets) */ - __u32 qth_min; /* Min average threshold (packets) */ - __u32 qth_max; /* Max average threshold (packets) */ - unsigned char Wlog; /* log(W) */ - unsigned char Plog; /* log(P_max/(qth_max-qth_min)) */ - unsigned char Scell_log; /* cell size for idle damping */ - unsigned char flags; /* see RED flags */ -}; - -struct tc_choke_xstats { - __u32 early; /* Early drops */ - __u32 pdrop; /* Drops due to queue limits */ - __u32 other; /* Drops due to drop() calls */ - __u32 marked; /* Marked packets */ - __u32 matched; /* Drops due to flow match */ -}; - -/* HTB section */ -#define TC_HTB_NUMPRIO 8 -#define TC_HTB_MAXDEPTH 8 -#define TC_HTB_PROTOVER 3 /* the same as HTB and TC's major */ - -struct tc_htb_opt { - struct tc_ratespec rate; - struct tc_ratespec ceil; - __u32 buffer; - __u32 cbuffer; - __u32 quantum; - __u32 level; /* out only */ - __u32 prio; -}; -struct tc_htb_glob { - __u32 version; /* to match HTB/TC */ - __u32 rate2quantum; /* bps->quantum divisor */ - __u32 defcls; /* default class number */ - __u32 debug; /* debug flags */ - - /* stats */ - __u32 direct_pkts; /* count of non shaped packets */ -}; -enum { - TCA_HTB_UNSPEC, - TCA_HTB_PARMS, - TCA_HTB_INIT, - TCA_HTB_CTAB, - TCA_HTB_RTAB, - TCA_HTB_DIRECT_QLEN, - TCA_HTB_RATE64, - TCA_HTB_CEIL64, - __TCA_HTB_MAX, -}; - -#define TCA_HTB_MAX (__TCA_HTB_MAX - 1) - -struct tc_htb_xstats { - __u32 lends; - __u32 borrows; - __u32 giants; /* too big packets (rate will not be accurate) */ - __u32 tokens; - __u32 ctokens; -}; - -/* HFSC section */ - -struct tc_hfsc_qopt { - __u16 defcls; /* default class */ -}; - -struct tc_service_curve { - __u32 m1; /* slope of the first segment in bps */ - __u32 d; /* x-projection of the first segment in us */ - __u32 m2; /* slope of the second segment in bps */ -}; - -struct tc_hfsc_stats { - __u64 work; /* total work done */ - __u64 rtwork; /* work done by real-time criteria */ - __u32 period; /* current period */ - __u32 level; /* class level in hierarchy */ -}; - -enum { - TCA_HFSC_UNSPEC, - TCA_HFSC_RSC, - TCA_HFSC_FSC, - TCA_HFSC_USC, - __TCA_HFSC_MAX, -}; - -#define TCA_HFSC_MAX (__TCA_HFSC_MAX - 1) - - -/* CBQ section */ - -#define TC_CBQ_MAXPRIO 8 -#define TC_CBQ_MAXLEVEL 8 -#define TC_CBQ_DEF_EWMA 5 - -struct tc_cbq_lssopt { - unsigned char change; - unsigned char flags; -#define TCF_CBQ_LSS_BOUNDED 1 -#define TCF_CBQ_LSS_ISOLATED 2 - unsigned char ewma_log; - unsigned char level; -#define TCF_CBQ_LSS_FLAGS 1 -#define TCF_CBQ_LSS_EWMA 2 -#define TCF_CBQ_LSS_MAXIDLE 4 -#define TCF_CBQ_LSS_MINIDLE 8 -#define TCF_CBQ_LSS_OFFTIME 0x10 -#define TCF_CBQ_LSS_AVPKT 0x20 - __u32 maxidle; - __u32 minidle; - __u32 offtime; - __u32 avpkt; -}; - -struct tc_cbq_wrropt { - unsigned char flags; - unsigned char priority; - unsigned char cpriority; - unsigned char __reserved; - __u32 allot; - __u32 weight; -}; - -struct tc_cbq_ovl { - unsigned char strategy; -#define TC_CBQ_OVL_CLASSIC 0 -#define TC_CBQ_OVL_DELAY 1 -#define TC_CBQ_OVL_LOWPRIO 2 -#define TC_CBQ_OVL_DROP 3 -#define TC_CBQ_OVL_RCLASSIC 4 - unsigned char priority2; - __u16 pad; - __u32 penalty; -}; - -struct tc_cbq_police { - unsigned char police; - unsigned char __res1; - unsigned short __res2; -}; - -struct tc_cbq_fopt { - __u32 split; - __u32 defmap; - __u32 defchange; -}; - -struct tc_cbq_xstats { - __u32 borrows; - __u32 overactions; - __s32 avgidle; - __s32 undertime; -}; - -enum { - TCA_CBQ_UNSPEC, - TCA_CBQ_LSSOPT, - TCA_CBQ_WRROPT, - TCA_CBQ_FOPT, - TCA_CBQ_OVL_STRATEGY, - TCA_CBQ_RATE, - TCA_CBQ_RTAB, - TCA_CBQ_POLICE, - __TCA_CBQ_MAX, -}; - -#define TCA_CBQ_MAX (__TCA_CBQ_MAX - 1) - -/* dsmark section */ - -enum { - TCA_DSMARK_UNSPEC, - TCA_DSMARK_INDICES, - TCA_DSMARK_DEFAULT_INDEX, - TCA_DSMARK_SET_TC_INDEX, - TCA_DSMARK_MASK, - TCA_DSMARK_VALUE, - __TCA_DSMARK_MAX, -}; - -#define TCA_DSMARK_MAX (__TCA_DSMARK_MAX - 1) - -/* ATM section */ - -enum { - TCA_ATM_UNSPEC, - TCA_ATM_FD, /* file/socket descriptor */ - TCA_ATM_PTR, /* pointer to descriptor - later */ - TCA_ATM_HDR, /* LL header */ - TCA_ATM_EXCESS, /* excess traffic class (0 for CLP) */ - TCA_ATM_ADDR, /* PVC address (for output only) */ - TCA_ATM_STATE, /* VC state (ATM_VS_*; for output only) */ - __TCA_ATM_MAX, -}; - -#define TCA_ATM_MAX (__TCA_ATM_MAX - 1) - -/* Network emulator */ - -enum { - TCA_NETEM_UNSPEC, - TCA_NETEM_CORR, - TCA_NETEM_DELAY_DIST, - TCA_NETEM_REORDER, - TCA_NETEM_CORRUPT, - TCA_NETEM_LOSS, - TCA_NETEM_RATE, - TCA_NETEM_ECN, - TCA_NETEM_RATE64, - __TCA_NETEM_MAX, -}; - -#define TCA_NETEM_MAX (__TCA_NETEM_MAX - 1) - -struct tc_netem_qopt { - __u32 latency; /* added delay (us) */ - __u32 limit; /* fifo limit (packets) */ - __u32 loss; /* random packet loss (0=none ~0=100%) */ - __u32 gap; /* re-ordering gap (0 for none) */ - __u32 duplicate; /* random packet dup (0=none ~0=100%) */ - __u32 jitter; /* random jitter in latency (us) */ -}; - -struct tc_netem_corr { - __u32 delay_corr; /* delay correlation */ - __u32 loss_corr; /* packet loss correlation */ - __u32 dup_corr; /* duplicate correlation */ -}; - -struct tc_netem_reorder { - __u32 probability; - __u32 correlation; -}; - -struct tc_netem_corrupt { - __u32 probability; - __u32 correlation; -}; - -struct tc_netem_rate { - __u32 rate; /* byte/s */ - __s32 packet_overhead; - __u32 cell_size; - __s32 cell_overhead; -}; - -enum { - NETEM_LOSS_UNSPEC, - NETEM_LOSS_GI, /* General Intuitive - 4 state model */ - NETEM_LOSS_GE, /* Gilbert Elliot models */ - __NETEM_LOSS_MAX -}; -#define NETEM_LOSS_MAX (__NETEM_LOSS_MAX - 1) - -/* State transition probabilities for 4 state model */ -struct tc_netem_gimodel { - __u32 p13; - __u32 p31; - __u32 p32; - __u32 p14; - __u32 p23; -}; - -/* Gilbert-Elliot models */ -struct tc_netem_gemodel { - __u32 p; - __u32 r; - __u32 h; - __u32 k1; -}; - -#define NETEM_DIST_SCALE 8192 -#define NETEM_DIST_MAX 16384 - -/* DRR */ - -enum { - TCA_DRR_UNSPEC, - TCA_DRR_QUANTUM, - __TCA_DRR_MAX -}; - -#define TCA_DRR_MAX (__TCA_DRR_MAX - 1) - -struct tc_drr_stats { - __u32 deficit; -}; - -/* MQPRIO */ -#define TC_QOPT_BITMASK 15 -#define TC_QOPT_MAX_QUEUE 16 - -struct tc_mqprio_qopt { - __u8 num_tc; - __u8 prio_tc_map[TC_QOPT_BITMASK + 1]; - __u8 hw; - __u16 count[TC_QOPT_MAX_QUEUE]; - __u16 offset[TC_QOPT_MAX_QUEUE]; -}; - -/* SFB */ - -enum { - TCA_SFB_UNSPEC, - TCA_SFB_PARMS, - __TCA_SFB_MAX, -}; - -#define TCA_SFB_MAX (__TCA_SFB_MAX - 1) - -/* - * Note: increment, decrement are Q0.16 fixed-point values. - */ -struct tc_sfb_qopt { - __u32 rehash_interval; /* delay between hash move, in ms */ - __u32 warmup_time; /* double buffering warmup time in ms (warmup_time < rehash_interval) */ - __u32 max; /* max len of qlen_min */ - __u32 bin_size; /* maximum queue length per bin */ - __u32 increment; /* probability increment, (d1 in Blue) */ - __u32 decrement; /* probability decrement, (d2 in Blue) */ - __u32 limit; /* max SFB queue length */ - __u32 penalty_rate; /* inelastic flows are rate limited to 'rate' pps */ - __u32 penalty_burst; -}; - -struct tc_sfb_xstats { - __u32 earlydrop; - __u32 penaltydrop; - __u32 bucketdrop; - __u32 queuedrop; - __u32 childdrop; /* drops in child qdisc */ - __u32 marked; - __u32 maxqlen; - __u32 maxprob; - __u32 avgprob; -}; - -#define SFB_MAX_PROB 0xFFFF - -/* QFQ */ -enum { - TCA_QFQ_UNSPEC, - TCA_QFQ_WEIGHT, - TCA_QFQ_LMAX, - __TCA_QFQ_MAX -}; - -#define TCA_QFQ_MAX (__TCA_QFQ_MAX - 1) - -struct tc_qfq_stats { - __u32 weight; - __u32 lmax; -}; - -/* CODEL */ - -enum { - TCA_CODEL_UNSPEC, - TCA_CODEL_TARGET, - TCA_CODEL_LIMIT, - TCA_CODEL_INTERVAL, - TCA_CODEL_ECN, - __TCA_CODEL_MAX -}; - -#define TCA_CODEL_MAX (__TCA_CODEL_MAX - 1) - -struct tc_codel_xstats { - __u32 maxpacket; /* largest packet we've seen so far */ - __u32 count; /* how many drops we've done since the last time we - * entered dropping state - */ - __u32 lastcount; /* count at entry to dropping state */ - __u32 ldelay; /* in-queue delay seen by most recently dequeued packet */ - __s32 drop_next; /* time to drop next packet */ - __u32 drop_overlimit; /* number of time max qdisc packet limit was hit */ - __u32 ecn_mark; /* number of packets we ECN marked instead of dropped */ - __u32 dropping; /* are we in dropping state ? */ -}; - -/* FQ_CODEL */ - -enum { - TCA_FQ_CODEL_UNSPEC, - TCA_FQ_CODEL_TARGET, - TCA_FQ_CODEL_LIMIT, - TCA_FQ_CODEL_INTERVAL, - TCA_FQ_CODEL_ECN, - TCA_FQ_CODEL_FLOWS, - TCA_FQ_CODEL_QUANTUM, - __TCA_FQ_CODEL_MAX -}; - -#define TCA_FQ_CODEL_MAX (__TCA_FQ_CODEL_MAX - 1) - -enum { - TCA_FQ_CODEL_XSTATS_QDISC, - TCA_FQ_CODEL_XSTATS_CLASS, -}; - -struct tc_fq_codel_qd_stats { - __u32 maxpacket; /* largest packet we've seen so far */ - __u32 drop_overlimit; /* number of time max qdisc - * packet limit was hit - */ - __u32 ecn_mark; /* number of packets we ECN marked - * instead of being dropped - */ - __u32 new_flow_count; /* number of time packets - * created a 'new flow' - */ - __u32 new_flows_len; /* count of flows in new list */ - __u32 old_flows_len; /* count of flows in old list */ -}; - -struct tc_fq_codel_cl_stats { - __s32 deficit; - __u32 ldelay; /* in-queue delay seen by most recently - * dequeued packet - */ - __u32 count; - __u32 lastcount; - __u32 dropping; - __s32 drop_next; -}; - -struct tc_fq_codel_xstats { - __u32 type; - union { - struct tc_fq_codel_qd_stats qdisc_stats; - struct tc_fq_codel_cl_stats class_stats; - }; -}; - -/* FQ */ - -enum { - TCA_FQ_UNSPEC, - - TCA_FQ_PLIMIT, /* limit of total number of packets in queue */ - - TCA_FQ_FLOW_PLIMIT, /* limit of packets per flow */ - - TCA_FQ_QUANTUM, /* RR quantum */ - - TCA_FQ_INITIAL_QUANTUM, /* RR quantum for new flow */ - - TCA_FQ_RATE_ENABLE, /* enable/disable rate limiting */ - - TCA_FQ_FLOW_DEFAULT_RATE,/* obsolete, do not use */ - - TCA_FQ_FLOW_MAX_RATE, /* per flow max rate */ - - TCA_FQ_BUCKETS_LOG, /* log2(number of buckets) */ - - TCA_FQ_FLOW_REFILL_DELAY, /* flow credit refill delay in usec */ - - __TCA_FQ_MAX -}; - -#define TCA_FQ_MAX (__TCA_FQ_MAX - 1) - -struct tc_fq_qd_stats { - __u64 gc_flows; - __u64 highprio_packets; - __u64 tcp_retrans; - __u64 throttled; - __u64 flows_plimit; - __u64 pkts_too_long; - __u64 allocation_errors; - __s64 time_next_delayed_flow; - __u32 flows; - __u32 inactive_flows; - __u32 throttled_flows; - __u32 pad; -}; - -/* Heavy-Hitter Filter */ - -enum { - TCA_HHF_UNSPEC, - TCA_HHF_BACKLOG_LIMIT, - TCA_HHF_QUANTUM, - TCA_HHF_HH_FLOWS_LIMIT, - TCA_HHF_RESET_TIMEOUT, - TCA_HHF_ADMIT_BYTES, - TCA_HHF_EVICT_TIMEOUT, - TCA_HHF_NON_HH_WEIGHT, - __TCA_HHF_MAX -}; - -#define TCA_HHF_MAX (__TCA_HHF_MAX - 1) - -struct tc_hhf_xstats { - __u32 drop_overlimit; /* number of times max qdisc packet limit - * was hit - */ - __u32 hh_overlimit; /* number of times max heavy-hitters was hit */ - __u32 hh_tot_count; /* number of captured heavy-hitters so far */ - __u32 hh_cur_count; /* number of current heavy-hitters */ -}; - -/* PIE */ -enum { - TCA_PIE_UNSPEC, - TCA_PIE_TARGET, - TCA_PIE_LIMIT, - TCA_PIE_TUPDATE, - TCA_PIE_ALPHA, - TCA_PIE_BETA, - TCA_PIE_ECN, - TCA_PIE_BYTEMODE, - __TCA_PIE_MAX -}; -#define TCA_PIE_MAX (__TCA_PIE_MAX - 1) - -struct tc_pie_xstats { - __u32 prob; /* current probability */ - __u32 delay; /* current delay in ms */ - __u32 avg_dq_rate; /* current average dq_rate in bits/pie_time */ - __u32 packets_in; /* total number of packets enqueued */ - __u32 dropped; /* packets dropped due to pie_action */ - __u32 overlimit; /* dropped due to lack of space in queue */ - __u32 maxq; /* maximum queue size */ - __u32 ecn_mark; /* packets marked with ecn*/ -}; -#endif diff --git a/package/gluon-simple-tc/src/include/linux/rtnetlink.h b/package/gluon-simple-tc/src/include/linux/rtnetlink.h deleted file mode 100644 index 248fdd3f..00000000 --- a/package/gluon-simple-tc/src/include/linux/rtnetlink.h +++ /dev/null @@ -1,639 +0,0 @@ -#ifndef __LINUX_RTNETLINK_H -#define __LINUX_RTNETLINK_H - -#include -#include -#include -#include -#include - -/* rtnetlink families. Values up to 127 are reserved for real address - * families, values above 128 may be used arbitrarily. - */ -#define RTNL_FAMILY_IPMR 128 -#define RTNL_FAMILY_IP6MR 129 -#define RTNL_FAMILY_MAX 129 - -/**** - * Routing/neighbour discovery messages. - ****/ - -/* Types of messages */ - -enum { - RTM_BASE = 16, -#define RTM_BASE RTM_BASE - - RTM_NEWLINK = 16, -#define RTM_NEWLINK RTM_NEWLINK - RTM_DELLINK, -#define RTM_DELLINK RTM_DELLINK - RTM_GETLINK, -#define RTM_GETLINK RTM_GETLINK - RTM_SETLINK, -#define RTM_SETLINK RTM_SETLINK - - RTM_NEWADDR = 20, -#define RTM_NEWADDR RTM_NEWADDR - RTM_DELADDR, -#define RTM_DELADDR RTM_DELADDR - RTM_GETADDR, -#define RTM_GETADDR RTM_GETADDR - - RTM_NEWROUTE = 24, -#define RTM_NEWROUTE RTM_NEWROUTE - RTM_DELROUTE, -#define RTM_DELROUTE RTM_DELROUTE - RTM_GETROUTE, -#define RTM_GETROUTE RTM_GETROUTE - - RTM_NEWNEIGH = 28, -#define RTM_NEWNEIGH RTM_NEWNEIGH - RTM_DELNEIGH, -#define RTM_DELNEIGH RTM_DELNEIGH - RTM_GETNEIGH, -#define RTM_GETNEIGH RTM_GETNEIGH - - RTM_NEWRULE = 32, -#define RTM_NEWRULE RTM_NEWRULE - RTM_DELRULE, -#define RTM_DELRULE RTM_DELRULE - RTM_GETRULE, -#define RTM_GETRULE RTM_GETRULE - - RTM_NEWQDISC = 36, -#define RTM_NEWQDISC RTM_NEWQDISC - RTM_DELQDISC, -#define RTM_DELQDISC RTM_DELQDISC - RTM_GETQDISC, -#define RTM_GETQDISC RTM_GETQDISC - - RTM_NEWTCLASS = 40, -#define RTM_NEWTCLASS RTM_NEWTCLASS - RTM_DELTCLASS, -#define RTM_DELTCLASS RTM_DELTCLASS - RTM_GETTCLASS, -#define RTM_GETTCLASS RTM_GETTCLASS - - RTM_NEWTFILTER = 44, -#define RTM_NEWTFILTER RTM_NEWTFILTER - RTM_DELTFILTER, -#define RTM_DELTFILTER RTM_DELTFILTER - RTM_GETTFILTER, -#define RTM_GETTFILTER RTM_GETTFILTER - - RTM_NEWACTION = 48, -#define RTM_NEWACTION RTM_NEWACTION - RTM_DELACTION, -#define RTM_DELACTION RTM_DELACTION - RTM_GETACTION, -#define RTM_GETACTION RTM_GETACTION - - RTM_NEWPREFIX = 52, -#define RTM_NEWPREFIX RTM_NEWPREFIX - - RTM_GETMULTICAST = 58, -#define RTM_GETMULTICAST RTM_GETMULTICAST - - RTM_GETANYCAST = 62, -#define RTM_GETANYCAST RTM_GETANYCAST - - RTM_NEWNEIGHTBL = 64, -#define RTM_NEWNEIGHTBL RTM_NEWNEIGHTBL - RTM_GETNEIGHTBL = 66, -#define RTM_GETNEIGHTBL RTM_GETNEIGHTBL - RTM_SETNEIGHTBL, -#define RTM_SETNEIGHTBL RTM_SETNEIGHTBL - - RTM_NEWNDUSEROPT = 68, -#define RTM_NEWNDUSEROPT RTM_NEWNDUSEROPT - - RTM_NEWADDRLABEL = 72, -#define RTM_NEWADDRLABEL RTM_NEWADDRLABEL - RTM_DELADDRLABEL, -#define RTM_DELADDRLABEL RTM_DELADDRLABEL - RTM_GETADDRLABEL, -#define RTM_GETADDRLABEL RTM_GETADDRLABEL - - RTM_GETDCB = 78, -#define RTM_GETDCB RTM_GETDCB - RTM_SETDCB, -#define RTM_SETDCB RTM_SETDCB - - RTM_NEWNETCONF = 80, -#define RTM_NEWNETCONF RTM_NEWNETCONF - RTM_GETNETCONF = 82, -#define RTM_GETNETCONF RTM_GETNETCONF - - RTM_NEWMDB = 84, -#define RTM_NEWMDB RTM_NEWMDB - RTM_DELMDB = 85, -#define RTM_DELMDB RTM_DELMDB - RTM_GETMDB = 86, -#define RTM_GETMDB RTM_GETMDB - - __RTM_MAX, -#define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1) -}; - -#define RTM_NR_MSGTYPES (RTM_MAX + 1 - RTM_BASE) -#define RTM_NR_FAMILIES (RTM_NR_MSGTYPES >> 2) -#define RTM_FAM(cmd) (((cmd) - RTM_BASE) >> 2) - -/* - Generic structure for encapsulation of optional route information. - It is reminiscent of sockaddr, but with sa_family replaced - with attribute type. - */ - -struct rtattr { - unsigned short rta_len; - unsigned short rta_type; -}; - -/* Macros to handle rtattributes */ - -#define RTA_ALIGNTO 4 -#define RTA_ALIGN(len) ( ((len)+RTA_ALIGNTO-1) & ~(RTA_ALIGNTO-1) ) -#define RTA_OK(rta,len) ((len) >= (int)sizeof(struct rtattr) && \ - (rta)->rta_len >= sizeof(struct rtattr) && \ - (rta)->rta_len <= (len)) -#define RTA_NEXT(rta,attrlen) ((attrlen) -= RTA_ALIGN((rta)->rta_len), \ - (struct rtattr*)(((char*)(rta)) + RTA_ALIGN((rta)->rta_len))) -#define RTA_LENGTH(len) (RTA_ALIGN(sizeof(struct rtattr)) + (len)) -#define RTA_SPACE(len) RTA_ALIGN(RTA_LENGTH(len)) -#define RTA_DATA(rta) ((void*)(((char*)(rta)) + RTA_LENGTH(0))) -#define RTA_PAYLOAD(rta) ((int)((rta)->rta_len) - RTA_LENGTH(0)) - - - - -/****************************************************************************** - * Definitions used in routing table administration. - ****/ - -struct rtmsg { - unsigned char rtm_family; - unsigned char rtm_dst_len; - unsigned char rtm_src_len; - unsigned char rtm_tos; - - unsigned char rtm_table; /* Routing table id */ - unsigned char rtm_protocol; /* Routing protocol; see below */ - unsigned char rtm_scope; /* See below */ - unsigned char rtm_type; /* See below */ - - unsigned rtm_flags; -}; - -/* rtm_type */ - -enum { - RTN_UNSPEC, - RTN_UNICAST, /* Gateway or direct route */ - RTN_LOCAL, /* Accept locally */ - RTN_BROADCAST, /* Accept locally as broadcast, - send as broadcast */ - RTN_ANYCAST, /* Accept locally as broadcast, - but send as unicast */ - RTN_MULTICAST, /* Multicast route */ - RTN_BLACKHOLE, /* Drop */ - RTN_UNREACHABLE, /* Destination is unreachable */ - RTN_PROHIBIT, /* Administratively prohibited */ - RTN_THROW, /* Not in this table */ - RTN_NAT, /* Translate this address */ - RTN_XRESOLVE, /* Use external resolver */ - __RTN_MAX -}; - -#define RTN_MAX (__RTN_MAX - 1) - - -/* rtm_protocol */ - -#define RTPROT_UNSPEC 0 -#define RTPROT_REDIRECT 1 /* Route installed by ICMP redirects; - not used by current IPv4 */ -#define RTPROT_KERNEL 2 /* Route installed by kernel */ -#define RTPROT_BOOT 3 /* Route installed during boot */ -#define RTPROT_STATIC 4 /* Route installed by administrator */ - -/* Values of protocol >= RTPROT_STATIC are not interpreted by kernel; - they are just passed from user and back as is. - It will be used by hypothetical multiple routing daemons. - Note that protocol values should be standardized in order to - avoid conflicts. - */ - -#define RTPROT_GATED 8 /* Apparently, GateD */ -#define RTPROT_RA 9 /* RDISC/ND router advertisements */ -#define RTPROT_MRT 10 /* Merit MRT */ -#define RTPROT_ZEBRA 11 /* Zebra */ -#define RTPROT_BIRD 12 /* BIRD */ -#define RTPROT_DNROUTED 13 /* DECnet routing daemon */ -#define RTPROT_XORP 14 /* XORP */ -#define RTPROT_NTK 15 /* Netsukuku */ -#define RTPROT_DHCP 16 /* DHCP client */ -#define RTPROT_MROUTED 17 /* Multicast daemon */ - -/* rtm_scope - - Really it is not scope, but sort of distance to the destination. - NOWHERE are reserved for not existing destinations, HOST is our - local addresses, LINK are destinations, located on directly attached - link and UNIVERSE is everywhere in the Universe. - - Intermediate values are also possible f.e. interior routes - could be assigned a value between UNIVERSE and LINK. -*/ - -enum rt_scope_t { - RT_SCOPE_UNIVERSE=0, -/* User defined values */ - RT_SCOPE_SITE=200, - RT_SCOPE_LINK=253, - RT_SCOPE_HOST=254, - RT_SCOPE_NOWHERE=255 -}; - -/* rtm_flags */ - -#define RTM_F_NOTIFY 0x100 /* Notify user of route change */ -#define RTM_F_CLONED 0x200 /* This route is cloned */ -#define RTM_F_EQUALIZE 0x400 /* Multipath equalizer: NI */ -#define RTM_F_PREFIX 0x800 /* Prefix addresses */ - -/* Reserved table identifiers */ - -enum rt_class_t { - RT_TABLE_UNSPEC=0, -/* User defined values */ - RT_TABLE_COMPAT=252, - RT_TABLE_DEFAULT=253, - RT_TABLE_MAIN=254, - RT_TABLE_LOCAL=255, - RT_TABLE_MAX=0xFFFFFFFF -}; - - -/* Routing message attributes */ - -enum rtattr_type_t { - RTA_UNSPEC, - RTA_DST, - RTA_SRC, - RTA_IIF, - RTA_OIF, - RTA_GATEWAY, - RTA_PRIORITY, - RTA_PREFSRC, - RTA_METRICS, - RTA_MULTIPATH, - RTA_PROTOINFO, /* no longer used */ - RTA_FLOW, - RTA_CACHEINFO, - RTA_SESSION, /* no longer used */ - RTA_MP_ALGO, /* no longer used */ - RTA_TABLE, - RTA_MARK, - RTA_MFC_STATS, - __RTA_MAX -}; - -#define RTA_MAX (__RTA_MAX - 1) - -#define RTM_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct rtmsg)))) -#define RTM_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct rtmsg)) - -/* RTM_MULTIPATH --- array of struct rtnexthop. - * - * "struct rtnexthop" describes all necessary nexthop information, - * i.e. parameters of path to a destination via this nexthop. - * - * At the moment it is impossible to set different prefsrc, mtu, window - * and rtt for different paths from multipath. - */ - -struct rtnexthop { - unsigned short rtnh_len; - unsigned char rtnh_flags; - unsigned char rtnh_hops; - int rtnh_ifindex; -}; - -/* rtnh_flags */ - -#define RTNH_F_DEAD 1 /* Nexthop is dead (used by multipath) */ -#define RTNH_F_PERVASIVE 2 /* Do recursive gateway lookup */ -#define RTNH_F_ONLINK 4 /* Gateway is forced on link */ - -/* Macros to handle hexthops */ - -#define RTNH_ALIGNTO 4 -#define RTNH_ALIGN(len) ( ((len)+RTNH_ALIGNTO-1) & ~(RTNH_ALIGNTO-1) ) -#define RTNH_OK(rtnh,len) ((rtnh)->rtnh_len >= sizeof(struct rtnexthop) && \ - ((int)(rtnh)->rtnh_len) <= (len)) -#define RTNH_NEXT(rtnh) ((struct rtnexthop*)(((char*)(rtnh)) + RTNH_ALIGN((rtnh)->rtnh_len))) -#define RTNH_LENGTH(len) (RTNH_ALIGN(sizeof(struct rtnexthop)) + (len)) -#define RTNH_SPACE(len) RTNH_ALIGN(RTNH_LENGTH(len)) -#define RTNH_DATA(rtnh) ((struct rtattr*)(((char*)(rtnh)) + RTNH_LENGTH(0))) - -/* RTM_CACHEINFO */ - -struct rta_cacheinfo { - __u32 rta_clntref; - __u32 rta_lastuse; - __s32 rta_expires; - __u32 rta_error; - __u32 rta_used; - -#define RTNETLINK_HAVE_PEERINFO 1 - __u32 rta_id; - __u32 rta_ts; - __u32 rta_tsage; -}; - -/* RTM_METRICS --- array of struct rtattr with types of RTAX_* */ - -enum { - RTAX_UNSPEC, -#define RTAX_UNSPEC RTAX_UNSPEC - RTAX_LOCK, -#define RTAX_LOCK RTAX_LOCK - RTAX_MTU, -#define RTAX_MTU RTAX_MTU - RTAX_WINDOW, -#define RTAX_WINDOW RTAX_WINDOW - RTAX_RTT, -#define RTAX_RTT RTAX_RTT - RTAX_RTTVAR, -#define RTAX_RTTVAR RTAX_RTTVAR - RTAX_SSTHRESH, -#define RTAX_SSTHRESH RTAX_SSTHRESH - RTAX_CWND, -#define RTAX_CWND RTAX_CWND - RTAX_ADVMSS, -#define RTAX_ADVMSS RTAX_ADVMSS - RTAX_REORDERING, -#define RTAX_REORDERING RTAX_REORDERING - RTAX_HOPLIMIT, -#define RTAX_HOPLIMIT RTAX_HOPLIMIT - RTAX_INITCWND, -#define RTAX_INITCWND RTAX_INITCWND - RTAX_FEATURES, -#define RTAX_FEATURES RTAX_FEATURES - RTAX_RTO_MIN, -#define RTAX_RTO_MIN RTAX_RTO_MIN - RTAX_INITRWND, -#define RTAX_INITRWND RTAX_INITRWND - RTAX_QUICKACK, -#define RTAX_QUICKACK RTAX_QUICKACK - __RTAX_MAX -}; - -#define RTAX_MAX (__RTAX_MAX - 1) - -#define RTAX_FEATURE_ECN 0x00000001 -#define RTAX_FEATURE_SACK 0x00000002 -#define RTAX_FEATURE_TIMESTAMP 0x00000004 -#define RTAX_FEATURE_ALLFRAG 0x00000008 - -struct rta_session { - __u8 proto; - __u8 pad1; - __u16 pad2; - - union { - struct { - __u16 sport; - __u16 dport; - } ports; - - struct { - __u8 type; - __u8 code; - __u16 ident; - } icmpt; - - __u32 spi; - } u; -}; - -struct rta_mfc_stats { - __u64 mfcs_packets; - __u64 mfcs_bytes; - __u64 mfcs_wrong_if; -}; - -/**** - * General form of address family dependent message. - ****/ - -struct rtgenmsg { - unsigned char rtgen_family; -}; - -/***************************************************************** - * Link layer specific messages. - ****/ - -/* struct ifinfomsg - * passes link level specific information, not dependent - * on network protocol. - */ - -struct ifinfomsg { - unsigned char ifi_family; - unsigned char __ifi_pad; - unsigned short ifi_type; /* ARPHRD_* */ - int ifi_index; /* Link index */ - unsigned ifi_flags; /* IFF_* flags */ - unsigned ifi_change; /* IFF_* change mask */ -}; - -/******************************************************************** - * prefix information - ****/ - -struct prefixmsg { - unsigned char prefix_family; - unsigned char prefix_pad1; - unsigned short prefix_pad2; - int prefix_ifindex; - unsigned char prefix_type; - unsigned char prefix_len; - unsigned char prefix_flags; - unsigned char prefix_pad3; -}; - -enum -{ - PREFIX_UNSPEC, - PREFIX_ADDRESS, - PREFIX_CACHEINFO, - __PREFIX_MAX -}; - -#define PREFIX_MAX (__PREFIX_MAX - 1) - -struct prefix_cacheinfo { - __u32 preferred_time; - __u32 valid_time; -}; - - -/***************************************************************** - * Traffic control messages. - ****/ - -struct tcmsg { - unsigned char tcm_family; - unsigned char tcm__pad1; - unsigned short tcm__pad2; - int tcm_ifindex; - __u32 tcm_handle; - __u32 tcm_parent; - __u32 tcm_info; -}; - -enum { - TCA_UNSPEC, - TCA_KIND, - TCA_OPTIONS, - TCA_STATS, - TCA_XSTATS, - TCA_RATE, - TCA_FCNT, - TCA_STATS2, - TCA_STAB, - __TCA_MAX -}; - -#define TCA_MAX (__TCA_MAX - 1) - -#define TCA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcmsg)))) -#define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg)) - -/******************************************************************** - * Neighbor Discovery userland options - ****/ - -struct nduseroptmsg { - unsigned char nduseropt_family; - unsigned char nduseropt_pad1; - unsigned short nduseropt_opts_len; /* Total length of options */ - int nduseropt_ifindex; - __u8 nduseropt_icmp_type; - __u8 nduseropt_icmp_code; - unsigned short nduseropt_pad2; - unsigned int nduseropt_pad3; - /* Followed by one or more ND options */ -}; - -enum { - NDUSEROPT_UNSPEC, - NDUSEROPT_SRCADDR, - __NDUSEROPT_MAX -}; - -#define NDUSEROPT_MAX (__NDUSEROPT_MAX - 1) - -/* RTnetlink multicast groups - backwards compatibility for userspace */ -#define RTMGRP_LINK 1 -#define RTMGRP_NOTIFY 2 -#define RTMGRP_NEIGH 4 -#define RTMGRP_TC 8 - -#define RTMGRP_IPV4_IFADDR 0x10 -#define RTMGRP_IPV4_MROUTE 0x20 -#define RTMGRP_IPV4_ROUTE 0x40 -#define RTMGRP_IPV4_RULE 0x80 - -#define RTMGRP_IPV6_IFADDR 0x100 -#define RTMGRP_IPV6_MROUTE 0x200 -#define RTMGRP_IPV6_ROUTE 0x400 -#define RTMGRP_IPV6_IFINFO 0x800 - -#define RTMGRP_DECnet_IFADDR 0x1000 -#define RTMGRP_DECnet_ROUTE 0x4000 - -#define RTMGRP_IPV6_PREFIX 0x20000 - -/* RTnetlink multicast groups */ -enum rtnetlink_groups { - RTNLGRP_NONE, -#define RTNLGRP_NONE RTNLGRP_NONE - RTNLGRP_LINK, -#define RTNLGRP_LINK RTNLGRP_LINK - RTNLGRP_NOTIFY, -#define RTNLGRP_NOTIFY RTNLGRP_NOTIFY - RTNLGRP_NEIGH, -#define RTNLGRP_NEIGH RTNLGRP_NEIGH - RTNLGRP_TC, -#define RTNLGRP_TC RTNLGRP_TC - RTNLGRP_IPV4_IFADDR, -#define RTNLGRP_IPV4_IFADDR RTNLGRP_IPV4_IFADDR - RTNLGRP_IPV4_MROUTE, -#define RTNLGRP_IPV4_MROUTE RTNLGRP_IPV4_MROUTE - RTNLGRP_IPV4_ROUTE, -#define RTNLGRP_IPV4_ROUTE RTNLGRP_IPV4_ROUTE - RTNLGRP_IPV4_RULE, -#define RTNLGRP_IPV4_RULE RTNLGRP_IPV4_RULE - RTNLGRP_IPV6_IFADDR, -#define RTNLGRP_IPV6_IFADDR RTNLGRP_IPV6_IFADDR - RTNLGRP_IPV6_MROUTE, -#define RTNLGRP_IPV6_MROUTE RTNLGRP_IPV6_MROUTE - RTNLGRP_IPV6_ROUTE, -#define RTNLGRP_IPV6_ROUTE RTNLGRP_IPV6_ROUTE - RTNLGRP_IPV6_IFINFO, -#define RTNLGRP_IPV6_IFINFO RTNLGRP_IPV6_IFINFO - RTNLGRP_DECnet_IFADDR, -#define RTNLGRP_DECnet_IFADDR RTNLGRP_DECnet_IFADDR - RTNLGRP_NOP2, - RTNLGRP_DECnet_ROUTE, -#define RTNLGRP_DECnet_ROUTE RTNLGRP_DECnet_ROUTE - RTNLGRP_DECnet_RULE, -#define RTNLGRP_DECnet_RULE RTNLGRP_DECnet_RULE - RTNLGRP_NOP4, - RTNLGRP_IPV6_PREFIX, -#define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX - RTNLGRP_IPV6_RULE, -#define RTNLGRP_IPV6_RULE RTNLGRP_IPV6_RULE - RTNLGRP_ND_USEROPT, -#define RTNLGRP_ND_USEROPT RTNLGRP_ND_USEROPT - RTNLGRP_PHONET_IFADDR, -#define RTNLGRP_PHONET_IFADDR RTNLGRP_PHONET_IFADDR - RTNLGRP_PHONET_ROUTE, -#define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE - RTNLGRP_DCB, -#define RTNLGRP_DCB RTNLGRP_DCB - RTNLGRP_IPV4_NETCONF, -#define RTNLGRP_IPV4_NETCONF RTNLGRP_IPV4_NETCONF - RTNLGRP_IPV6_NETCONF, -#define RTNLGRP_IPV6_NETCONF RTNLGRP_IPV6_NETCONF - RTNLGRP_MDB, -#define RTNLGRP_MDB RTNLGRP_MDB - __RTNLGRP_MAX -}; -#define RTNLGRP_MAX (__RTNLGRP_MAX - 1) - -/* TC action piece */ -struct tcamsg { - unsigned char tca_family; - unsigned char tca__pad1; - unsigned short tca__pad2; -}; -#define TA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcamsg)))) -#define TA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcamsg)) -#define TCA_ACT_TAB 1 /* attr type must be >=1 */ -#define TCAA_MAX 1 - -/* New extended info filters for IFLA_EXT_MASK */ -#define RTEXT_FILTER_VF (1 << 0) -#define RTEXT_FILTER_BRVLAN (1 << 1) - -/* End of information exported to user level */ - - - -#endif /* __LINUX_RTNETLINK_H */ From 2fefdeee63e00c6862a405bae7df04f2d2c28a8e Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 15 Oct 2015 02:42:28 +0200 Subject: [PATCH 152/867] gluon-mesh-batman-adv-core: neighbours.d/wifi: output empty object instead of empty list when there are no neighbours on an interface --- .../files/lib/gluon/announce/neighbours.d/wifi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index 1be59f8b..4f2b0ce2 100644 --- 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 @@ -32,7 +32,7 @@ end local wifi = {} for address, iface in pairs(interfaces()) do - wifi[address] = { neighbours = neighbours(iface) } + wifi[address] = { [{}] = true, neighbours = neighbours(iface) } end if next(wifi) then From f292ba1d7ad9d7c18376576635a5a6ba5a6c5fb3 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 15 Oct 2015 12:17:24 +0200 Subject: [PATCH 153/867] ar71xx-generic: TL-WR841N/ND v10: remove BROKEN check --- targets/ar71xx-generic/profiles.mk | 2 -- 1 file changed, 2 deletions(-) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index be15eaf8..49fc162f 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -54,9 +54,7 @@ $(eval $(call GluonModel,TLWR841,tl-wr841nd-v5,tp-link-tl-wr841n-nd-v5)) $(eval $(call GluonModel,TLWR841,tl-wr841nd-v7,tp-link-tl-wr841n-nd-v7)) $(eval $(call GluonModel,TLWR841,tl-wr841n-v8,tp-link-tl-wr841n-nd-v8)) $(eval $(call GluonModel,TLWR841,tl-wr841n-v9,tp-link-tl-wr841n-nd-v9)) -ifeq ($(BROKEN),1) $(eval $(call GluonModel,TLWR841,tl-wr841n-v10,tp-link-tl-wr841n-nd-v10)) -endif # TL-WR842N/ND v1, v2 $(eval $(call GluonProfile,TLWR842)) From cad2e8e4b7960106362d3adea0409f8cb1a45c04 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 15 Oct 2015 22:03:20 +0200 Subject: [PATCH 154/867] ar71xx-generic: add support for CPE210/220/510/520 v1.1 (untested) --- ...tils-tplink-safeloader-clean-up-code.patch | 107 ++++++++++++++++++ ...k-safeloader-fix-support-list-format.patch | 60 ++++++++++ ...on-1.1-support-to-CPE210-220-510-520.patch | 38 +++++++ targets/ar71xx-generic/profiles.mk | 6 + 4 files changed, 211 insertions(+) create mode 100644 patches/openwrt/0028-tools-firmware-utils-tplink-safeloader-clean-up-code.patch create mode 100644 patches/openwrt/0029-tools-firmware-utils-tplink-safeloader-fix-support-list-format.patch create mode 100644 patches/openwrt/0030-tools-firmware-utils-tplink-safeloader-add-version-1.1-support-to-CPE210-220-510-520.patch diff --git a/patches/openwrt/0028-tools-firmware-utils-tplink-safeloader-clean-up-code.patch b/patches/openwrt/0028-tools-firmware-utils-tplink-safeloader-clean-up-code.patch new file mode 100644 index 00000000..00d2a184 --- /dev/null +++ b/patches/openwrt/0028-tools-firmware-utils-tplink-safeloader-clean-up-code.patch @@ -0,0 +1,107 @@ +From: Matthias Schiffer +Date: Thu, 15 Oct 2015 20:03:51 +0200 +Subject: tools/firmware-utils: tplink-safeloader: clean up code + +There is no reason for the internal functions not to be static. + +Signed-off-by: Matthias Schiffer + +diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c +index 9c5bb54..4607a1d 100644 +--- a/tools/firmware-utils/src/tplink-safeloader.c ++++ b/tools/firmware-utils/src/tplink-safeloader.c +@@ -152,7 +152,7 @@ static const unsigned char cpe510_support_list[] = + + + /** Allocates a new image partition */ +-struct image_partition_entry alloc_image_partition(const char *name, size_t len) { ++static struct image_partition_entry alloc_image_partition(const char *name, size_t len) { + struct image_partition_entry entry = {name, len, malloc(len)}; + if (!entry.data) + error(1, errno, "malloc"); +@@ -161,12 +161,12 @@ struct image_partition_entry alloc_image_partition(const char *name, size_t len) + } + + /** Frees an image partition */ +-void free_image_partition(struct image_partition_entry entry) { ++static void free_image_partition(struct image_partition_entry entry) { + free(entry.data); + } + + /** Generates the partition-table partition */ +-struct image_partition_entry make_partition_table(const struct flash_partition_entry *p) { ++static struct image_partition_entry make_partition_table(const struct flash_partition_entry *p) { + struct image_partition_entry entry = alloc_image_partition("partition-table", 0x800); + + char *s = (char *)entry.data, *end = (char *)(s+entry.size); +@@ -202,7 +202,7 @@ static inline uint8_t bcd(uint8_t v) { + + + /** Generates the soft-version partition */ +-struct image_partition_entry make_soft_version(uint32_t rev) { ++static struct image_partition_entry make_soft_version(uint32_t rev) { + struct image_partition_entry entry = alloc_image_partition("soft-version", sizeof(struct soft_version)); + struct soft_version *s = (struct soft_version *)entry.data; + +@@ -233,14 +233,14 @@ struct image_partition_entry make_soft_version(uint32_t rev) { + } + + /** Generates the support-list partition */ +-struct image_partition_entry make_support_list(const unsigned char *support_list, size_t len) { ++static struct image_partition_entry make_support_list(const unsigned char *support_list, size_t len) { + struct image_partition_entry entry = alloc_image_partition("support-list", len); + memcpy(entry.data, support_list, len); + return entry; + } + + /** Creates a new image partition with an arbitrary name from a file */ +-struct image_partition_entry read_file(const char *part_name, const char *filename, bool add_jffs2_eof) { ++static struct image_partition_entry read_file(const char *part_name, const char *filename, bool add_jffs2_eof) { + struct stat statbuf; + + if (stat(filename, &statbuf) < 0) +@@ -300,7 +300,7 @@ struct image_partition_entry read_file(const char *part_name, const char *filena + + I think partition-table must be the first partition in the firmware image. + */ +-void put_partitions(uint8_t *buffer, const struct image_partition_entry *parts) { ++static void put_partitions(uint8_t *buffer, const struct image_partition_entry *parts) { + size_t i; + char *image_pt = (char *)buffer, *end = image_pt + 0x800; + +@@ -325,7 +325,7 @@ void put_partitions(uint8_t *buffer, const struct image_partition_entry *parts) + } + + /** Generates and writes the image MD5 checksum */ +-void put_md5(uint8_t *md5, uint8_t *buffer, unsigned int len) { ++static void put_md5(uint8_t *md5, uint8_t *buffer, unsigned int len) { + MD5_CTX ctx; + + MD5_Init(&ctx); +@@ -349,7 +349,7 @@ void put_md5(uint8_t *md5, uint8_t *buffer, unsigned int len) { + 1014-1813 Image partition table (2048 bytes, padded with 0xff) + 1814-xxxx Firmware partitions + */ +-void * generate_factory_image(const unsigned char *vendor, size_t vendor_len, const struct image_partition_entry *parts, size_t *len) { ++static void * generate_factory_image(const unsigned char *vendor, size_t vendor_len, const struct image_partition_entry *parts, size_t *len) { + *len = 0x1814; + + size_t i; +@@ -381,7 +381,7 @@ void * generate_factory_image(const unsigned char *vendor, size_t vendor_len, co + should be generalized when TP-LINK starts building its safeloader into hardware with + different flash layouts. + */ +-void * generate_sysupgrade_image(const struct flash_partition_entry *flash_parts, const struct image_partition_entry *image_parts, size_t *len) { ++static void * generate_sysupgrade_image(const struct flash_partition_entry *flash_parts, const struct image_partition_entry *image_parts, size_t *len) { + const struct flash_partition_entry *flash_os_image = &flash_parts[5]; + const struct flash_partition_entry *flash_soft_version = &flash_parts[6]; + const struct flash_partition_entry *flash_support_list = &flash_parts[7]; +@@ -459,7 +459,7 @@ static void do_cpe510(const char *output, const char *kernel_image, const char * + + + /** Usage output */ +-void usage(const char *argv0) { ++static void usage(const char *argv0) { + fprintf(stderr, + "Usage: %s [OPTIONS...]\n" + "\n" diff --git a/patches/openwrt/0029-tools-firmware-utils-tplink-safeloader-fix-support-list-format.patch b/patches/openwrt/0029-tools-firmware-utils-tplink-safeloader-fix-support-list-format.patch new file mode 100644 index 00000000..60453f03 --- /dev/null +++ b/patches/openwrt/0029-tools-firmware-utils-tplink-safeloader-fix-support-list-format.patch @@ -0,0 +1,60 @@ +From: Matthias Schiffer +Date: Thu, 15 Oct 2015 21:01:25 +0200 +Subject: tools/firmware-utils: tplink-safeloader: fix support-list format + +The first 4 bytes of the support-list image partition are supposed to +contain the size of the hardware support list. + +Signed-off-by: Matthias Schiffer + +diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c +index 4607a1d..719ed4a 100644 +--- a/tools/firmware-utils/src/tplink-safeloader.c ++++ b/tools/firmware-utils/src/tplink-safeloader.c +@@ -133,14 +133,13 @@ static const struct flash_partition_entry cpe510_partitions[] = { + The stock images also contain strings for two more devices: BS510 and BS210. + At the moment, there exists no public information about these devices. + */ +-static const unsigned char cpe510_support_list[] = +- "\x00\x00\x00\xc8\x00\x00\x00\x00" ++static const char cpe510_support_list[] = + "SupportList:\r\n" + "CPE510(TP-LINK|UN|N300-5):1.0\r\n" + "CPE520(TP-LINK|UN|N300-5):1.0\r\n" + "CPE210(TP-LINK|UN|N300-2):1.0\r\n" + "CPE220(TP-LINK|UN|N300-2):1.0\r\n" +- "\r\n\xff"; ++ "\r\n"; + + #define error(_ret, _errno, _str, ...) \ + do { \ +@@ -233,9 +232,17 @@ static struct image_partition_entry make_soft_version(uint32_t rev) { + } + + /** Generates the support-list partition */ +-static struct image_partition_entry make_support_list(const unsigned char *support_list, size_t len) { +- struct image_partition_entry entry = alloc_image_partition("support-list", len); +- memcpy(entry.data, support_list, len); ++static struct image_partition_entry make_support_list(const char *support_list) { ++ size_t len = strlen(support_list); ++ struct image_partition_entry entry = alloc_image_partition("support-list", len + 9); ++ ++ uint32_t len32 = htonl(len); ++ ++ memcpy(entry.data, &len32, 4); ++ memset(entry.data+4, 0, 4); ++ memcpy(entry.data+8, support_list, len); ++ entry.data[len+8] = '\xff'; ++ + return entry; + } + +@@ -430,7 +437,7 @@ static void do_cpe510(const char *output, const char *kernel_image, const char * + + parts[0] = make_partition_table(cpe510_partitions); + parts[1] = make_soft_version(rev); +- parts[2] = make_support_list(cpe510_support_list, sizeof(cpe510_support_list)-1); ++ parts[2] = make_support_list(cpe510_support_list); + parts[3] = read_file("os-image", kernel_image, false); + parts[4] = read_file("file-system", rootfs_image, add_jffs2_eof); + 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/0030-tools-firmware-utils-tplink-safeloader-add-version-1.1-support-to-CPE210-220-510-520.patch new file mode 100644 index 00000000..e24ff841 --- /dev/null +++ b/patches/openwrt/0030-tools-firmware-utils-tplink-safeloader-add-version-1.1-support-to-CPE210-220-510-520.patch @@ -0,0 +1,38 @@ +From: Matthias Schiffer +Date: Thu, 15 Oct 2015 21:56:40 +0200 +Subject: tools/firmware-utils: tplink-safeloader: add version 1.1 support to CPE210/220/510/520 + +The hardware is identical to version 1.0, add the new models to the support +list. + +Also remove the empty line at the end of the support list, the current +stock images don't have it either. + +Signed-off-by: Matthias Schiffer + +diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c +index 719ed4a..27daacc 100644 +--- a/tools/firmware-utils/src/tplink-safeloader.c ++++ b/tools/firmware-utils/src/tplink-safeloader.c +@@ -129,17 +129,17 @@ static const struct flash_partition_entry cpe510_partitions[] = { + + /** + The support list for CPE210/220/510/520 +- +- The stock images also contain strings for two more devices: BS510 and BS210. +- At the moment, there exists no public information about these devices. + */ + static const char cpe510_support_list[] = + "SupportList:\r\n" + "CPE510(TP-LINK|UN|N300-5):1.0\r\n" ++ "CPE510(TP-LINK|UN|N300-5):1.1\r\n" + "CPE520(TP-LINK|UN|N300-5):1.0\r\n" ++ "CPE520(TP-LINK|UN|N300-5):1.1\r\n" + "CPE210(TP-LINK|UN|N300-2):1.0\r\n" ++ "CPE210(TP-LINK|UN|N300-2):1.1\r\n" + "CPE220(TP-LINK|UN|N300-2):1.0\r\n" +- "\r\n"; ++ "CPE220(TP-LINK|UN|N300-2):1.1\r\n"; + + #define error(_ret, _errno, _str, ...) \ + do { \ diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 49fc162f..e90ad19a 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -8,6 +8,12 @@ $(eval $(call GluonModel,CPE510,cpe210-220-510-520,tp-link-cpe210-v1.0)) $(eval $(call GluonModel,CPE510,cpe210-220-510-520,tp-link-cpe220-v1.0)) $(eval $(call GluonModel,CPE510,cpe210-220-510-520,tp-link-cpe510-v1.0)) $(eval $(call GluonModel,CPE510,cpe210-220-510-520,tp-link-cpe520-v1.0)) +ifeq ($(BROKEN),1) +$(eval $(call GluonModel,CPE510,cpe210-220-510-520,tp-link-cpe210-v1.1)) +$(eval $(call GluonModel,CPE510,cpe210-220-510-520,tp-link-cpe220-v1.1)) +$(eval $(call GluonModel,CPE510,cpe210-220-510-520,tp-link-cpe510-v1.1)) +$(eval $(call GluonModel,CPE510,cpe210-220-510-520,tp-link-cpe520-v1.1)) +endif # TL-WA701N/ND v1, v2 $(eval $(call GluonProfile,TLWA701)) From f2dd9ff6aca65b599790f4504c89ad71cd761b16 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 15 Oct 2015 23:52:22 +0200 Subject: [PATCH 155/867] Update Gluon packages --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index dec568c4..ecc8b808 100644 --- a/modules +++ b/modules @@ -8,7 +8,7 @@ PACKAGES_OPENWRT_COMMIT=9f3881f1f35b11b4587ad6b7cca5136cad43c12a PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git -PACKAGES_GLUON_COMMIT=48cddbbb55691825596f7f640848dd24d4d4edff +PACKAGES_GLUON_COMMIT=3b67a18a51ee0d3545fb6a3da3d5b30d9482ae7e PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_COMMIT=ae65d4fe027592652376f8dbd3ff2ef37f5a84bc From 53211b5b4637ea9d20fd3eb38c6757895a86e977 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 15 Oct 2015 23:52:30 +0200 Subject: [PATCH 156/867] Replace gluon-cron by micrond --- package/gluon-alfred/Makefile | 2 +- .../gluon/cron => usr/lib/micron.d}/alfred | 0 package/gluon-autoupdater/Makefile | 2 +- .../files/lib/gluon/upgrade/500-autoupdater | 2 +- package/gluon-cron/Makefile | 40 --- .../gluon-cron/files/etc/init.d/gluon-cron | 18 - package/gluon-cron/files/lib/gluon/cron/.keep | 0 package/gluon-cron/src/Makefile | 3 - package/gluon-cron/src/gluon-crond.c | 316 ------------------ 9 files changed, 3 insertions(+), 380 deletions(-) rename package/gluon-alfred/files/{lib/gluon/cron => usr/lib/micron.d}/alfred (100%) delete mode 100644 package/gluon-cron/Makefile delete mode 100755 package/gluon-cron/files/etc/init.d/gluon-cron delete mode 100644 package/gluon-cron/files/lib/gluon/cron/.keep delete mode 100644 package/gluon-cron/src/Makefile delete mode 100644 package/gluon-cron/src/gluon-crond.c diff --git a/package/gluon-alfred/Makefile b/package/gluon-alfred/Makefile index 8ddabdd2..54881c70 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 +gluon-cron +alfred + DEPENDS:=+gluon-core +gluon-announced +gluon-neighbour-info +micrond +alfred TITLE:=Configure alfred endef diff --git a/package/gluon-alfred/files/lib/gluon/cron/alfred b/package/gluon-alfred/files/usr/lib/micron.d/alfred similarity index 100% rename from package/gluon-alfred/files/lib/gluon/cron/alfred rename to package/gluon-alfred/files/usr/lib/micron.d/alfred diff --git a/package/gluon-autoupdater/Makefile b/package/gluon-autoupdater/Makefile index b33bada9..f4885ee0 100644 --- a/package/gluon-autoupdater/Makefile +++ b/package/gluon-autoupdater/Makefile @@ -11,7 +11,7 @@ include $(GLUONDIR)/include/package.mk define Package/gluon-autoupdater SECTION:=gluon CATEGORY:=Gluon - DEPENDS:=+gluon-core +gluon-cron +autoupdater + DEPENDS:=+gluon-core +micrond +autoupdater TITLE:=Automatically update firmware endef diff --git a/package/gluon-autoupdater/files/lib/gluon/upgrade/500-autoupdater b/package/gluon-autoupdater/files/lib/gluon/upgrade/500-autoupdater index fec313b3..b569f24e 100755 --- a/package/gluon-autoupdater/files/lib/gluon/upgrade/500-autoupdater +++ b/package/gluon-autoupdater/files/lib/gluon/upgrade/500-autoupdater @@ -51,7 +51,7 @@ autoupdater_util.randomseed() -- a fallback update (used after the regular updates haven't local minute = math.random(0, 59) -local f = io.open('/lib/gluon/cron/autoupdater', 'w') +local f = io.open('/usr/lib/micron.d/autoupdater', 'w') f:write(string.format('%i 4 * * * /usr/sbin/autoupdater\n', minute)) f:write(string.format('%i 0-3,5-23 * * * /usr/sbin/autoupdater --fallback\n', minute)) f:close() diff --git a/package/gluon-cron/Makefile b/package/gluon-cron/Makefile deleted file mode 100644 index ac92a92d..00000000 --- a/package/gluon-cron/Makefile +++ /dev/null @@ -1,40 +0,0 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=gluon-cron -PKG_VERSION:=1 -PKG_RELEASE:=1 - -PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) - -include $(INCLUDE_DIR)/package.mk - -define Package/gluon-cron - SECTION:=gluon - CATEGORY:=Gluon - TITLE:=Cron support - DEPENDS:=+gluon-core -endef - -define Package/gluon-cron/description - Gluon community wifi mesh firmware framework: cron support -endef - -define Build/Prepare - mkdir -p $(PKG_BUILD_DIR) - $(CP) ./src/* $(PKG_BUILD_DIR)/ -endef - -define Build/Configure -endef - -define Build/Compile - CFLAGS="$(TARGET_CFLAGS)" CPPFLAGS="$(TARGET_CPPFLAGS)" $(MAKE) -C $(PKG_BUILD_DIR) $(TARGET_CONFIGURE_OPTS) -endef - -define Package/gluon-cron/install - $(CP) ./files/* $(1)/ - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/gluon-crond $(1)/usr/sbin/ -endef - -$(eval $(call BuildPackage,gluon-cron)) diff --git a/package/gluon-cron/files/etc/init.d/gluon-cron b/package/gluon-cron/files/etc/init.d/gluon-cron deleted file mode 100755 index 27a05e1d..00000000 --- a/package/gluon-cron/files/etc/init.d/gluon-cron +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh /etc/rc.common -# Copyright (C) 2013 Project Gluon - -START=50 - -SERVICE_USE_PID=1 -SERVICE_WRITE_PID=1 -SERVICE_DAEMONIZE=1 - -CRONDIR=/lib/gluon/cron - -start () { - service_start /usr/sbin/gluon-crond "$CRONDIR" -} - -stop() { - service_stop /usr/sbin/gluon-crond -} diff --git a/package/gluon-cron/files/lib/gluon/cron/.keep b/package/gluon-cron/files/lib/gluon/cron/.keep deleted file mode 100644 index e69de29b..00000000 diff --git a/package/gluon-cron/src/Makefile b/package/gluon-cron/src/Makefile deleted file mode 100644 index 3f4c7a50..00000000 --- a/package/gluon-cron/src/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -all: gluon-crond - -gluon-crond: gluon-crond.c diff --git a/package/gluon-cron/src/gluon-crond.c b/package/gluon-cron/src/gluon-crond.c deleted file mode 100644 index 11a87c42..00000000 --- a/package/gluon-cron/src/gluon-crond.c +++ /dev/null @@ -1,316 +0,0 @@ -/* - Copyright (c) 2013, 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 - - -typedef struct job { - struct job *next; - - uint64_t minutes; - uint32_t hours; - uint32_t doms; - uint16_t months; - uint8_t dows; - - char *command; -} job_t; - - -static const char const *const MONTHS[12] = { - "jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec" -}; - -static const char const *const WEEKDAYS[7] = { - "sun", "mon", "tue", "wed", "thu", "fri", "sat" -}; - - -static const char *crondir; - -static job_t *jobs = NULL; - - -static void usage(void) { - fprintf(stderr, "Usage: gluon-crond \n"); -} - - -static inline uint64_t bit(unsigned b) { - return ((uint64_t)1) << b; -} - -static int strict_atoi(const char *s) { - char *end; - int ret = strtol(s, &end, 10); - - if (*end) - return -1; - else - return ret; -} - -static uint64_t parse_strings(const char *input, const char *const *strings, size_t n) { - size_t i; - for (i = 0; i < n; i++) { - if (strcasecmp(input, strings[i]) == 0) - return bit(i); - } - - return 0; -} - -static uint64_t parse_times(char *input, int min, int n) { - uint64_t ret = 0; - int step = 1; - - char *comma = strchr(input, ','); - if (comma) { - *comma = 0; - ret = parse_times(comma+1, min, n); - - if (!ret) - return 0; - } - - char *slash = strchr(input, '/'); - if (slash) { - *slash = 0; - step = strict_atoi(slash+1); - - if (step <= 0) - return 0; - } - - int begin, end; - char *minus = strchr(input, '-'); - if (minus) { - *minus = 0; - begin = strict_atoi(input); - end = strict_atoi(minus+1); - } - else if (strcmp(input, "*") == 0) { - begin = min; - end = min+n-1; - } - else { - begin = end = strict_atoi(input); - } - - if (begin < min || end < min) - return 0; - - int i; - for (i = begin-min; i <= end-min; i += step) - ret |= bit(i % n); - - return ret; -} - -static int handle_line(const char *line) { - job_t job = {}; - int ret = -1; - char *columns[5]; - int i; - int len; - - int matches = sscanf(line, "%ms %ms %ms %ms %ms %n", &columns[0], &columns[1], &columns[2], &columns[3], &columns[4], &len); - if (matches != 5 && matches != 6) { - if (matches <= 0) - ret = 0; - - goto end; - } - - job.minutes = parse_times(columns[0], 0, 60); - if (!job.minutes) - goto end; - - job.hours = parse_times(columns[1], 0, 24); - if (!job.hours) - goto end; - - job.doms = parse_times(columns[2], 1, 31); - if (!job.doms) - goto end; - - - job.months = parse_strings(columns[3], MONTHS, 12); - - if (!job.months) - job.months = parse_times(columns[3], 1, 12); - if (!job.months) - goto end; - - job.dows = parse_strings(columns[4], WEEKDAYS, 7); - if (!job.dows) - job.dows = parse_times(columns[4], 0, 7); - if (!job.dows) - goto end; - - job.command = strdup(line+len); - - job_t *jobp = malloc(sizeof(job_t)); - *jobp = job; - - jobp->next = jobs; - jobs = jobp; - - ret = 0; - - end: - for (i = 0; i < matches && i < 5; i++) - free(columns[i]); - - return ret; -} - - -static void read_crontab(const char *name) { - FILE *file = fopen(name, "r"); - if (!file) { - syslog(LOG_WARNING, "unable to read crontab `%s'", name); - return; - } - - char line[16384]; - unsigned lineno = 0; - - while (fgets(line, sizeof(line), file)) { - lineno++; - - char *comment = strchr(line, '#'); - if (comment) - *comment = 0; - - if (handle_line(line)) - syslog(LOG_WARNING, "syntax error in `%s', line %u", name, lineno); - } - - fclose(file); -} - - -static void read_crondir(void) { - DIR *dir; - - if (chdir(crondir) || ((dir = opendir(".")) == NULL)) { - fprintf(stderr, "Unable to read crondir `%s'\n", crondir); - usage(); - exit(1); - } - - struct dirent *ent; - while ((ent = readdir(dir)) != NULL) { - if (ent->d_name[0] == '.') - continue; - - read_crontab(ent->d_name); - } - - closedir(dir); -} - - -static void run_job(const job_t *job) { - pid_t pid = fork(); - if (pid == 0) { - execl("/bin/sh", "/bin/sh", "-c", job->command, (char*)NULL); - syslog(LOG_ERR, "unable to run job: exec failed"); - _exit(1); - } - else if (pid < 0) { - syslog(LOG_ERR, "unable to run job: fork failed"); - } -} - - -static void check_job(const job_t *job, const struct tm *tm) { - if (!(job->minutes & bit(tm->tm_min))) - return; - - if (!(job->hours & bit(tm->tm_hour))) - return; - - if (!(job->doms & bit(tm->tm_mday-1))) - return; - - if (!(job->months & bit(tm->tm_mon))) - return; - - if (!(job->dows & bit(tm->tm_wday))) - return; - - run_job(job); -} - - -int main(int argc, char *argv[]) { - if (argc != 2) { - usage(); - - exit(argc < 2 ? 0 : 1); - } - - crondir = argv[1]; - - signal(SIGCHLD, SIG_IGN); - - read_crondir(); - - time_t t = time(NULL); - struct tm *tm = localtime(&t); - int minute = tm->tm_min; - - while (1) { - sleep(60 - t%60); - - t = time(NULL); - tm = localtime(&t); - - minute = (minute+1)%60; - if (tm->tm_min != minute) { - /* clock has moved, don't execute jobs */ - minute = tm->tm_min; - continue; - } - - job_t *job; - for (job = jobs; job; job = job->next) - check_job(job, tm); - } -} From 162c4b0cdd21d492f9de7f2a5e8b1df0e66febec Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 16 Oct 2015 01:20:16 +0200 Subject: [PATCH 157/867] Update CPE210/510 v1.1 support patches Some more cleanup. --- ...t-format-clean-up-vendor-information.patch | 126 ++++++++++++++++++ ...k-safeloader-fix-support-list-format.patch | 60 --------- ...on-1.1-support-to-CPE210-220-510-520.patch | 2 +- 3 files changed, 127 insertions(+), 61 deletions(-) create mode 100644 patches/openwrt/0029-tools-firmware-utils-tplink-safeloader-fix-support-list-format-clean-up-vendor-information.patch delete mode 100644 patches/openwrt/0029-tools-firmware-utils-tplink-safeloader-fix-support-list-format.patch diff --git a/patches/openwrt/0029-tools-firmware-utils-tplink-safeloader-fix-support-list-format-clean-up-vendor-information.patch b/patches/openwrt/0029-tools-firmware-utils-tplink-safeloader-fix-support-list-format-clean-up-vendor-information.patch new file mode 100644 index 00000000..df0cf8c4 --- /dev/null +++ b/patches/openwrt/0029-tools-firmware-utils-tplink-safeloader-fix-support-list-format-clean-up-vendor-information.patch @@ -0,0 +1,126 @@ +From: Matthias Schiffer +Date: Thu, 15 Oct 2015 21:01:25 +0200 +Subject: tools/firmware-utils: tplink-safeloader: fix support-list format, clean up vendor information + +The first 4 bytes of the support list and the vendor information are +supposed to contain the length of these fields. + +Signed-off-by: Matthias Schiffer + +diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c +index 4607a1d..66658aa 100644 +--- a/tools/firmware-utils/src/tplink-safeloader.c ++++ b/tools/firmware-utils/src/tplink-safeloader.c +@@ -103,7 +103,7 @@ static const uint8_t md5_salt[16] = { + + + /** Vendor information for CPE210/220/510/520 */ +-static const unsigned char cpe510_vendor[] = "\x00\x00\x00\x1f""CPE510(TP-LINK|UN|N300-5):1.0\r\n"; ++static const char cpe510_vendor[] = "CPE510(TP-LINK|UN|N300-5):1.0\r\n"; + + + /** +@@ -133,14 +133,13 @@ static const struct flash_partition_entry cpe510_partitions[] = { + The stock images also contain strings for two more devices: BS510 and BS210. + At the moment, there exists no public information about these devices. + */ +-static const unsigned char cpe510_support_list[] = +- "\x00\x00\x00\xc8\x00\x00\x00\x00" ++static const char cpe510_support_list[] = + "SupportList:\r\n" + "CPE510(TP-LINK|UN|N300-5):1.0\r\n" + "CPE520(TP-LINK|UN|N300-5):1.0\r\n" + "CPE210(TP-LINK|UN|N300-2):1.0\r\n" + "CPE220(TP-LINK|UN|N300-2):1.0\r\n" +- "\r\n\xff"; ++ "\r\n"; + + #define error(_ret, _errno, _str, ...) \ + do { \ +@@ -151,6 +150,14 @@ static const unsigned char cpe510_support_list[] = + } while (0) + + ++/** Stores a uint32 as big endian */ ++static inline void put32(uint8_t *buf, uint32_t val) { ++ buf[0] = val >> 24; ++ buf[1] = val >> 16; ++ buf[2] = val >> 8; ++ buf[3] = val; ++} ++ + /** Allocates a new image partition */ + static struct image_partition_entry alloc_image_partition(const char *name, size_t len) { + struct image_partition_entry entry = {name, len, malloc(len)}; +@@ -233,9 +240,15 @@ static struct image_partition_entry make_soft_version(uint32_t rev) { + } + + /** Generates the support-list partition */ +-static struct image_partition_entry make_support_list(const unsigned char *support_list, size_t len) { +- struct image_partition_entry entry = alloc_image_partition("support-list", len); +- memcpy(entry.data, support_list, len); ++static struct image_partition_entry make_support_list(const char *support_list) { ++ size_t len = strlen(support_list); ++ struct image_partition_entry entry = alloc_image_partition("support-list", len + 9); ++ ++ put32(entry.data, len); ++ memset(entry.data+4, 0, 4); ++ memcpy(entry.data+8, support_list, len); ++ entry.data[len+8] = '\xff'; ++ + return entry; + } + +@@ -344,12 +357,13 @@ static void put_md5(uint8_t *md5, uint8_t *buffer, unsigned int len) { + ----------- ----- + 0000-0003 Image size (4 bytes, big endian) + 0004-0013 MD5 hash (hash of a 16 byte salt and the image data starting with byte 0x14) +- 0014-1013 Vendor information (4096 bytes, padded with 0xff; there seem to be older ++ 0014-0017 Vendor information length (without padding) (4 bytes, big endian) ++ 0018-1013 Vendor information (4092 bytes, padded with 0xff; there seem to be older + (VxWorks-based) TP-LINK devices which use a smaller vendor information block) + 1014-1813 Image partition table (2048 bytes, padded with 0xff) + 1814-xxxx Firmware partitions + */ +-static void * generate_factory_image(const unsigned char *vendor, size_t vendor_len, const struct image_partition_entry *parts, size_t *len) { ++static void * generate_factory_image(const char *vendor, const struct image_partition_entry *parts, size_t *len) { + *len = 0x1814; + + size_t i; +@@ -360,13 +374,12 @@ static void * generate_factory_image(const unsigned char *vendor, size_t vendor_ + if (!image) + error(1, errno, "malloc"); + +- image[0] = *len >> 24; +- image[1] = *len >> 16; +- image[2] = *len >> 8; +- image[3] = *len; ++ put32(image, *len); + +- memcpy(image+0x14, vendor, vendor_len); +- memset(image+0x14+vendor_len, 0xff, 4096-vendor_len); ++ size_t vendor_len = strlen(vendor); ++ put32(image+0x14, vendor_len); ++ memcpy(image+0x18, vendor, vendor_len); ++ memset(image+0x18+vendor_len, 0xff, 4092-vendor_len); + + put_partitions(image + 0x1014, parts); + put_md5(image+0x04, image+0x14, *len-0x14); +@@ -430,7 +443,7 @@ static void do_cpe510(const char *output, const char *kernel_image, const char * + + parts[0] = make_partition_table(cpe510_partitions); + parts[1] = make_soft_version(rev); +- parts[2] = make_support_list(cpe510_support_list, sizeof(cpe510_support_list)-1); ++ parts[2] = make_support_list(cpe510_support_list); + parts[3] = read_file("os-image", kernel_image, false); + parts[4] = read_file("file-system", rootfs_image, add_jffs2_eof); + +@@ -439,7 +452,7 @@ static void do_cpe510(const char *output, const char *kernel_image, const char * + if (sysupgrade) + image = generate_sysupgrade_image(cpe510_partitions, parts, &len); + else +- image = generate_factory_image(cpe510_vendor, sizeof(cpe510_vendor)-1, parts, &len); ++ image = generate_factory_image(cpe510_vendor, parts, &len); + + FILE *file = fopen(output, "wb"); + if (!file) diff --git a/patches/openwrt/0029-tools-firmware-utils-tplink-safeloader-fix-support-list-format.patch b/patches/openwrt/0029-tools-firmware-utils-tplink-safeloader-fix-support-list-format.patch deleted file mode 100644 index 60453f03..00000000 --- a/patches/openwrt/0029-tools-firmware-utils-tplink-safeloader-fix-support-list-format.patch +++ /dev/null @@ -1,60 +0,0 @@ -From: Matthias Schiffer -Date: Thu, 15 Oct 2015 21:01:25 +0200 -Subject: tools/firmware-utils: tplink-safeloader: fix support-list format - -The first 4 bytes of the support-list image partition are supposed to -contain the size of the hardware support list. - -Signed-off-by: Matthias Schiffer - -diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c -index 4607a1d..719ed4a 100644 ---- a/tools/firmware-utils/src/tplink-safeloader.c -+++ b/tools/firmware-utils/src/tplink-safeloader.c -@@ -133,14 +133,13 @@ static const struct flash_partition_entry cpe510_partitions[] = { - The stock images also contain strings for two more devices: BS510 and BS210. - At the moment, there exists no public information about these devices. - */ --static const unsigned char cpe510_support_list[] = -- "\x00\x00\x00\xc8\x00\x00\x00\x00" -+static const char cpe510_support_list[] = - "SupportList:\r\n" - "CPE510(TP-LINK|UN|N300-5):1.0\r\n" - "CPE520(TP-LINK|UN|N300-5):1.0\r\n" - "CPE210(TP-LINK|UN|N300-2):1.0\r\n" - "CPE220(TP-LINK|UN|N300-2):1.0\r\n" -- "\r\n\xff"; -+ "\r\n"; - - #define error(_ret, _errno, _str, ...) \ - do { \ -@@ -233,9 +232,17 @@ static struct image_partition_entry make_soft_version(uint32_t rev) { - } - - /** Generates the support-list partition */ --static struct image_partition_entry make_support_list(const unsigned char *support_list, size_t len) { -- struct image_partition_entry entry = alloc_image_partition("support-list", len); -- memcpy(entry.data, support_list, len); -+static struct image_partition_entry make_support_list(const char *support_list) { -+ size_t len = strlen(support_list); -+ struct image_partition_entry entry = alloc_image_partition("support-list", len + 9); -+ -+ uint32_t len32 = htonl(len); -+ -+ memcpy(entry.data, &len32, 4); -+ memset(entry.data+4, 0, 4); -+ memcpy(entry.data+8, support_list, len); -+ entry.data[len+8] = '\xff'; -+ - return entry; - } - -@@ -430,7 +437,7 @@ static void do_cpe510(const char *output, const char *kernel_image, const char * - - parts[0] = make_partition_table(cpe510_partitions); - parts[1] = make_soft_version(rev); -- parts[2] = make_support_list(cpe510_support_list, sizeof(cpe510_support_list)-1); -+ parts[2] = make_support_list(cpe510_support_list); - parts[3] = read_file("os-image", kernel_image, false); - parts[4] = read_file("file-system", rootfs_image, add_jffs2_eof); - 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/0030-tools-firmware-utils-tplink-safeloader-add-version-1.1-support-to-CPE210-220-510-520.patch index e24ff841..e35965c7 100644 --- a/patches/openwrt/0030-tools-firmware-utils-tplink-safeloader-add-version-1.1-support-to-CPE210-220-510-520.patch +++ b/patches/openwrt/0030-tools-firmware-utils-tplink-safeloader-add-version-1.1-support-to-CPE210-220-510-520.patch @@ -11,7 +11,7 @@ stock images don't have it either. Signed-off-by: Matthias Schiffer diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c -index 719ed4a..27daacc 100644 +index 66658aa..77a894b 100644 --- a/tools/firmware-utils/src/tplink-safeloader.c +++ b/tools/firmware-utils/src/tplink-safeloader.c @@ -129,17 +129,17 @@ static const struct flash_partition_entry cpe510_partitions[] = { From 3b4f15444570e40dcd62deae6f77bcc82cf4e761 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 16 Oct 2015 19:11:36 +0200 Subject: [PATCH 158/867] build: use symlinks instead of copies when multiple devices use identical images --- Makefile | 17 +++++++++++++++++ targets/ar71xx-generic/profiles.mk | 27 ++++++++++++++------------- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 5271fd6d..2910a4f3 100644 --- a/Makefile +++ b/Makefile @@ -168,6 +168,11 @@ endef define GluonModel GLUON_$(1)_MODELS += $(3) GLUON_$(1)_MODEL_$(3) := $(2) +GLUON_$(1)_MODEL_$(3)_ALIASES := +endef + +define GluonModelAlias +GLUON_$(1)_MODEL_$(2)_ALIASES += $(3) endef @@ -402,8 +407,20 @@ image: FORCE rm -f $(GLUON_IMAGEDIR)/factory/gluon-*-$(model)$(GLUON_$(PROFILE)_FACTORY_EXT) && \ cp $(BIN_DIR)/gluon-$(GLUON_$(PROFILE)_MODEL_$(model))$(GLUON_$(PROFILE)_FACTORY_SUFFIX)$(GLUON_$(PROFILE)_FACTORY_EXT) $(GLUON_IMAGEDIR)/factory/$(IMAGE_PREFIX)-$(model)$(GLUON_$(PROFILE)_FACTORY_EXT) && \ ) \ + \ + $(foreach alias,$(GLUON_$(PROFILE)_MODEL_$(model)_ALIASES), \ + $(if $(GLUON_$(PROFILE)_SYSUPGRADE_EXT), \ + rm -f $(GLUON_IMAGEDIR)/sysupgrade/gluon-*-$(alias)-sysupgrade$(GLUON_$(PROFILE)_SYSUPGRADE_EXT) && \ + ln -s $(IMAGE_PREFIX)-$(model)-sysupgrade$(GLUON_$(PROFILE)_SYSUPGRADE_EXT) $(GLUON_IMAGEDIR)/sysupgrade/$(IMAGE_PREFIX)-$(alias)-sysupgrade$(GLUON_$(PROFILE)_SYSUPGRADE_EXT) && \ + ) \ + $(if $(GLUON_$(PROFILE)_FACTORY_EXT), \ + rm -f $(GLUON_IMAGEDIR)/factory/gluon-*-$(alias)$(GLUON_$(PROFILE)_FACTORY_EXT) && \ + ln -s $(IMAGE_PREFIX)-$(model)$(GLUON_$(PROFILE)_FACTORY_EXT) $(GLUON_IMAGEDIR)/factory/$(IMAGE_PREFIX)-$(alias)$(GLUON_$(PROFILE)_FACTORY_EXT) && \ + ) \ + ) \ ) : + image/%: $(gluon_prepared_stamp) +$(GLUONMAKE) image PROFILE="$(patsubst image/%,%,$@)" V=s$(OPENWRT_VERBOSE) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index e90ad19a..b47276b6 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -4,15 +4,16 @@ # CPE210/220/510/520 $(eval $(call GluonProfile,CPE510,rssileds)) -$(eval $(call GluonModel,CPE510,cpe210-220-510-520,tp-link-cpe210-v1.0)) -$(eval $(call GluonModel,CPE510,cpe210-220-510-520,tp-link-cpe220-v1.0)) $(eval $(call GluonModel,CPE510,cpe210-220-510-520,tp-link-cpe510-v1.0)) -$(eval $(call GluonModel,CPE510,cpe210-220-510-520,tp-link-cpe520-v1.0)) + +$(eval $(call GluonModelAlias,CPE510,tp-link-cpe510-v1.0,tp-link-cpe210-v1.0)) +$(eval $(call GluonModelAlias,CPE510,tp-link-cpe510-v1.0,tp-link-cpe220-v1.0)) +$(eval $(call GluonModelAlias,CPE510,tp-link-cpe510-v1.0,tp-link-cpe520-v1.0)) ifeq ($(BROKEN),1) -$(eval $(call GluonModel,CPE510,cpe210-220-510-520,tp-link-cpe210-v1.1)) -$(eval $(call GluonModel,CPE510,cpe210-220-510-520,tp-link-cpe220-v1.1)) -$(eval $(call GluonModel,CPE510,cpe210-220-510-520,tp-link-cpe510-v1.1)) -$(eval $(call GluonModel,CPE510,cpe210-220-510-520,tp-link-cpe520-v1.1)) +$(eval $(call GluonModelAlias,CPE510,tp-link-cpe510-v1.0,tp-link-cpe210-v1.1)) +$(eval $(call GluonModelAlias,CPE510,tp-link-cpe510-v1.0,tp-link-cpe220-v1.1)) +$(eval $(call GluonModelAlias,CPE510,tp-link-cpe510-v1.0,tp-link-cpe510-v1.1)) +$(eval $(call GluonModelAlias,CPE510,tp-link-cpe510-v1.0,tp-link-cpe520-v1.1)) endif # TL-WA701N/ND v1, v2 @@ -76,9 +77,9 @@ $(eval $(call GluonModel,TLWR941,tl-wr941nd-v5,tp-link-tl-wr941n-nd-v5)) ifeq ($(BROKEN),1) # $(eval $(call GluonModel,TLWR941,tl-wr941nd-v6,tp-link-tl-wr941n-nd-v6)) # BROKEN: needs mac80211 update -$(eval $(call GluonModel,TLWR941,tl-wr941nd-v4,tp-link-tl-wr940n-nd-v1)) # BROKEN: untested -$(eval $(call GluonModel,TLWR941,tl-wr941nd-v5,tp-link-tl-wr940n-nd-v2)) # BROKEN: untested -# $(eval $(call GluonModel,TLWR941,tl-wr941nd-v6,tp-link-tl-wr940n-nd-v3)) # BROKEN: needs mac80211 update +$(eval $(call GluonModelAlias,TLWR941,tp-link-tl-wr941n-nd-v4,tp-link-tl-wr940n-nd-v1)) # BROKEN: untested +$(eval $(call GluonModelAlias,TLWR941,tp-link-tl-wr941n-nd-v5,tp-link-tl-wr940n-nd-v2)) # BROKEN: untested +# $(eval $(call GluonModelAlias,TLWR941,tp-link-tl-wr941n-nd-v6,tp-link-tl-wr940n-nd-v3)) # BROKEN: needs mac80211 update endif # TL-WR1043N/ND v1, v2 @@ -150,9 +151,9 @@ $(eval $(call GluonProfile,UBNT)) $(eval $(call GluonModel,UBNT,ubnt-air-gateway,ubiquiti-airgateway)) $(eval $(call GluonModel,UBNT,ubnt-bullet-m,ubiquiti-bullet-m)) -$(eval $(call GluonModel,UBNT,ubnt-bullet-m,ubiquiti-loco-m)) -$(eval $(call GluonModel,UBNT,ubnt-bullet-m,ubiquiti-picostation-m)) -$(eval $(call GluonModel,UBNT,ubnt-bullet-m,ubiquiti-rocket-m)) +$(eval $(call GluonModelAlias,UBNT,ubiquiti-bullet-m,ubiquiti-loco-m)) +$(eval $(call GluonModelAlias,UBNT,ubiquiti-bullet-m,ubiquiti-picostation-m)) +$(eval $(call GluonModelAlias,UBNT,ubiquiti-bullet-m,ubiquiti-rocket-m)) $(eval $(call GluonModel,UBNT,ubnt-loco-m-xw,ubiquiti-loco-m-xw)) $(eval $(call GluonModel,UBNT,ubnt-nano-m,ubiquiti-nanostation-m)) From 563f9afcc0b38766b6f1a2b776a44aa0f6e80908 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 17 Oct 2015 15:14:27 +0200 Subject: [PATCH 159/867] ar71xx-generic: remove BROKEN check for TP-LINK CPE210/510 v1.1 --- targets/ar71xx-generic/profiles.mk | 2 -- 1 file changed, 2 deletions(-) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index b47276b6..58136f19 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -9,12 +9,10 @@ $(eval $(call GluonModel,CPE510,cpe210-220-510-520,tp-link-cpe510-v1.0)) $(eval $(call GluonModelAlias,CPE510,tp-link-cpe510-v1.0,tp-link-cpe210-v1.0)) $(eval $(call GluonModelAlias,CPE510,tp-link-cpe510-v1.0,tp-link-cpe220-v1.0)) $(eval $(call GluonModelAlias,CPE510,tp-link-cpe510-v1.0,tp-link-cpe520-v1.0)) -ifeq ($(BROKEN),1) $(eval $(call GluonModelAlias,CPE510,tp-link-cpe510-v1.0,tp-link-cpe210-v1.1)) $(eval $(call GluonModelAlias,CPE510,tp-link-cpe510-v1.0,tp-link-cpe220-v1.1)) $(eval $(call GluonModelAlias,CPE510,tp-link-cpe510-v1.0,tp-link-cpe510-v1.1)) $(eval $(call GluonModelAlias,CPE510,tp-link-cpe510-v1.0,tp-link-cpe520-v1.1)) -endif # TL-WA701N/ND v1, v2 $(eval $(call GluonProfile,TLWA701)) From fe0fbcf2d5701949ebf72f7c0e8f73c9a9f0e946 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 22 Oct 2015 00:56:34 +0200 Subject: [PATCH 160/867] 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. --- ...h79_soc_rev-value-for-QCA9531-ver.-2.patch | 198 ++++++++++++++++++ 1 file changed, 198 insertions(+) create mode 100644 patches/openwrt/0031-ar71xx-fix-ath79_soc_rev-value-for-QCA9531-ver.-2.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 new file mode 100644 index 00000000..70e118ba --- /dev/null +++ b/patches/openwrt/0031-ar71xx-fix-ath79_soc_rev-value-for-QCA9531-ver.-2.patch @@ -0,0 +1,198 @@ +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 d541939..be53a5a 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 027163f..6e0b536 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 +@@ -1,6 +1,6 @@ + --- a/arch/mips/ath79/Kconfig + +++ b/arch/mips/ath79/Kconfig +-@@ -1213,6 +1213,12 @@ config SOC_QCA955X ++@@ -1248,6 +1248,12 @@ config SOC_QCA955X + select PCI_AR724X if PCI + def_bool n + +@@ -13,7 +13,7 @@ + config ATH79_DEV_M25P80 + select ATH79_DEV_SPI + def_bool n +-@@ -1250,7 +1256,7 @@ config ATH79_DEV_USB ++@@ -1285,7 +1291,7 @@ config ATH79_DEV_USB + def_bool n + + config ATH79_DEV_WMAC +@@ -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 @@ From 320967477ee4bec235e15ac372ff946ed3797f73 Mon Sep 17 00:00:00 2001 From: Tarnatos Date: Thu, 22 Oct 2015 23:53:20 +0200 Subject: [PATCH 161/867] docs: add TL-WR841 v10 to device list --- docs/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index 1fd9d16d..34ab893f 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -127,7 +127,7 @@ ar71xx-generic - TL-WR740N (v1, v3, v4, v5) - TL-WR741N/ND (v1, v2, v4, v5) - TL-WR743N/ND (v1, v2) - - TL-WR841N/ND (v3, v5, v7, v8, v9) + - TL-WR841N/ND (v3, v5, v7, v8, v9, v10) - TL-WR842N/ND (v1, v2) - TL-WR941N/ND (v2, v3, v4, v5) - TL-WR2543N/ND (v1) From fa9496f2f7176c833c40879a6cf5dc176ce4775c Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 25 Oct 2015 17:21:13 +0100 Subject: [PATCH 162/867] Update OpenWrt packages --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index ecc8b808..cc44c940 100644 --- a/modules +++ b/modules @@ -4,7 +4,7 @@ OPENWRT_REPO=git://git.openwrt.org/15.05/openwrt.git OPENWRT_COMMIT=22ac8d66ba960a61520c3d80a277b2b774914c19 PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git -PACKAGES_OPENWRT_COMMIT=9f3881f1f35b11b4587ad6b7cca5136cad43c12a +PACKAGES_OPENWRT_COMMIT=ffd3b199e11ec335ce4f6ddd4a1a3aaff370318d PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git From 400613cb8bec4960400bc464483b5e82ec924d4e Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 25 Oct 2015 17:32:30 +0100 Subject: [PATCH 163/867] libuecc: update to v6 --- .../openwrt/0001-libuecc-update-to-v6.patch | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 patches/packages/openwrt/0001-libuecc-update-to-v6.patch diff --git a/patches/packages/openwrt/0001-libuecc-update-to-v6.patch b/patches/packages/openwrt/0001-libuecc-update-to-v6.patch new file mode 100644 index 00000000..b83a6c6a --- /dev/null +++ b/patches/packages/openwrt/0001-libuecc-update-to-v6.patch @@ -0,0 +1,27 @@ +From: Matthias Schiffer +Date: Sun, 25 Oct 2015 17:11:30 +0100 +Subject: libuecc: update to v6 + +Signed-off-by: Matthias Schiffer + +diff --git a/libs/libuecc/Makefile b/libs/libuecc/Makefile +index 63b6ebe..fb26933 100644 +--- a/libs/libuecc/Makefile ++++ b/libs/libuecc/Makefile +@@ -8,13 +8,13 @@ + include $(TOPDIR)/rules.mk + + PKG_NAME:=libuecc +-PKG_VERSION:=5 ++PKG_VERSION:=6 + PKG_RELEASE:=1 + + PKG_MAINTAINER:=Matthias Schiffer + PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +-PKG_SOURCE_URL:=https://projects.universe-factory.net/attachments/download/80 +-PKG_MD5SUM:=cd03c947931c2f4b0eea0bf45654bd34 ++PKG_SOURCE_URL:=https://projects.universe-factory.net/attachments/download/83 ++PKG_MD5SUM:=cba68339ff46482ec4090303de18fff4 + + PKG_LICENSE:=BSD-2-Clause + PKG_LICENSE_FILES:=COPYRIGHT From 3d862afb1715c26a57543e73055ce66baa587948 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 26 Oct 2015 19:02:12 +0100 Subject: [PATCH 164/867] Update OpenWrt base --- modules | 2 +- ...0009-ar71xx-add-support-for-tp-link-wr740n-v5.0-EU.patch | 6 +++--- .../openwrt/0010-ar71xx-add-support-for-TL-WR741ND-v5.patch | 6 +++--- ...-wndr3700_board_detect-for-some-NETGEAR-WNDR3700v2.patch | 2 +- ...k-around-unconditional-libopenssl-build-dependency.patch | 2 +- ...25-ar71xx-add-support-for-TP-LINK-TL-WR841N-ND-v10.patch | 6 +++--- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules b/modules index cc44c940..954a349a 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=22ac8d66ba960a61520c3d80a277b2b774914c19 +OPENWRT_COMMIT=f42308c3edc6bb23ce0e5ba3682195842bfbfd5c PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git PACKAGES_OPENWRT_COMMIT=ffd3b199e11ec335ce4f6ddd4a1a3aaff370318d 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 793e08d8..20af4e8d 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,10 +10,10 @@ 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 bb5de17..1d5f4c0 100644 +index 013a215..37ce8a4 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile -@@ -484,6 +484,14 @@ define Device/tl-wr740n-v4 +@@ -501,6 +501,14 @@ define Device/tl-wr740n-v4 CONSOLE := ttyATH0,115200 endef @@ -28,7 +28,7 @@ index bb5de17..1d5f4c0 100644 define Device/tl-wr741nd-v1 $(Device/tplink-4m) BOARDNAME := TL-WR741ND -@@ -513,7 +521,7 @@ define Device/tl-wr743nd-v2 +@@ -530,7 +538,7 @@ define Device/tl-wr743nd-v2 TPLINK_HWID := 0x07430002 CONSOLE := ttyATH0,115200 endef 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 02009666..e8bf32dc 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,10 +6,10 @@ 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 1d5f4c0..0600f98 100644 +index 37ce8a4..8a25832 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile -@@ -514,6 +514,14 @@ define Device/tl-wr741nd-v4 +@@ -531,6 +531,14 @@ define Device/tl-wr741nd-v4 CONSOLE := ttyATH0,115200 endef @@ -24,7 +24,7 @@ index 1d5f4c0..0600f98 100644 define Device/tl-wr743nd-v2 $(Device/tplink-4mlzma) BOARDNAME := TL-WR741ND-v4 -@@ -521,7 +529,7 @@ define Device/tl-wr743nd-v2 +@@ -538,7 +546,7 @@ define Device/tl-wr743nd-v2 TPLINK_HWID := 0x07430002 CONSOLE := ttyATH0,115200 endef 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 index 9c195a66..743177ea 100644 --- 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 @@ -12,7 +12,7 @@ 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 cacf362..e1d03ea 100755 +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() { diff --git a/patches/openwrt/0021-opkg-work-around-unconditional-libopenssl-build-dependency.patch b/patches/openwrt/0021-opkg-work-around-unconditional-libopenssl-build-dependency.patch index b9eec309..77d8a05b 100644 --- a/patches/openwrt/0021-opkg-work-around-unconditional-libopenssl-build-dependency.patch +++ b/patches/openwrt/0021-opkg-work-around-unconditional-libopenssl-build-dependency.patch @@ -8,7 +8,7 @@ not only opkg-smime. Fix this by applying the same workaround as in ustream-ssl. diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile -index 32bcf2b..4da4d46 100644 +index 76688f5..3e39cf8 100644 --- a/package/system/opkg/Makefile +++ b/package/system/opkg/Makefile @@ -72,7 +72,7 @@ endef 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 index dc9f579b..84f6505c 100644 --- 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 @@ -3,10 +3,10 @@ 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 0600f98..c9f25c1 100644 +index 8a25832..3a17420 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile -@@ -545,6 +545,13 @@ define Device/tl-wr841n-v9 +@@ -562,6 +562,13 @@ define Device/tl-wr841n-v9 TPLINK_HWID := 0x08410009 endef @@ -20,7 +20,7 @@ index 0600f98..c9f25c1 100644 define Device/tl-wr842n-v2 $(Device/tplink-8mlzma) BOARDNAME := TL-WR842N-v2 -@@ -565,7 +572,7 @@ define Device/tl-wr847n-v8 +@@ -582,7 +589,7 @@ define Device/tl-wr847n-v8 DEVICE_PROFILE := TLWR841 TPLINK_HWID := 0x08470008 endef From 22130e84e88618b8cfb93fe8fbff859c3e0115fa Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 26 Oct 2015 20:59:56 +0100 Subject: [PATCH 165/867] Merge gluon-radio-config into gluon-core gluon-radio-config contained only a single file. The code has been adjusted to allow creating a Gluon configuration without WLAN support by removing the wifi24 and wifi5 sections from site.conf. --- docs/index.rst | 8 ----- docs/package/gluon-radio-config.rst | 20 ------------ docs/user/site.rst | 8 +++-- package/gluon-core/check_site.lua | 10 ++++++ .../files/lib/gluon/upgrade/200-wireless | 20 ++++++++++-- package/gluon-mesh-batman-adv-core/Makefile | 2 +- package/gluon-radio-config/Makefile | 31 ------------------- .../lib/gluon/upgrade/250-gluon-radio-config | 18 ----------- 8 files changed, 34 insertions(+), 83 deletions(-) delete mode 100644 docs/package/gluon-radio-config.rst delete mode 100644 package/gluon-radio-config/Makefile delete mode 100755 package/gluon-radio-config/files/lib/gluon/upgrade/250-gluon-radio-config diff --git a/docs/index.rst b/docs/index.rst index 34ab893f..8af06f4f 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -43,14 +43,6 @@ Developer Documentation dev/wan dev/i18n -Packages --------- - -.. toctree:: - :maxdepth: 1 - - package/gluon-radio-config - Releases -------- diff --git a/docs/package/gluon-radio-config.rst b/docs/package/gluon-radio-config.rst deleted file mode 100644 index b253b154..00000000 --- a/docs/package/gluon-radio-config.rst +++ /dev/null @@ -1,20 +0,0 @@ -gluon-radio-config -================== - -This package takes care of setting basic wireless settings: - -- regulatory domain -- htmode -- channel - -site.conf ---------- - -regdom - regulatory domain (e.g. *de*) - -wifi24.channel / wifi5.channel - wireless channel for radio - -wifi24.htmode / wifi5.htmode - desired HT mode (e.g. *HT20*) diff --git a/docs/user/site.rst b/docs/user/site.rst index bcffa86c..bcc81122 100644 --- a/docs/user/site.rst +++ b/docs/user/site.rst @@ -72,13 +72,15 @@ opkg : optional - ``%GV`` is replaced by the Gluon version - ``%GR`` is replaced by the Gluon release (as specified in ``site.mk``) -regdom +regdom : optional The wireless regulatory domain responsible for your area, e.g.: :: regdom = 'DE' -wifi24 + Setting ``regdom`` in mandatory if ``wifi24`` or ``wifi5`` is defined. + +wifi24 : optional WLAN configuration for 2.4 GHz devices. ``channel`` must be set to a valid wireless channel for your radio. ``htmode`` selects the desired htmode (e.g. HT20, HT40- or HT40+). @@ -121,7 +123,7 @@ wifi24 }, }, -wifi5 +wifi5 : optional Same as `wifi24` but for the 5Ghz radio. next_node : package diff --git a/package/gluon-core/check_site.lua b/package/gluon-core/check_site.lua index 4217b626..e752dd26 100644 --- a/package/gluon-core/check_site.lua +++ b/package/gluon-core/check_site.lua @@ -21,3 +21,13 @@ need_string_array('ntp_servers', false) need_string_match('prefix4', '^%d+.%d+.%d+.%d+/%d+$') need_string_match('prefix6', '^[%x:]+/%d+$') + + +for _, config in ipairs({'wifi24', 'wifi5'}) do + if need_table(config, nil, false) then + need_string('regdom') -- regdom is only required when wifi24 or wifi5 is configured + + need_number(config .. '.channel') + need_string(config .. '.htmode') + end +end diff --git a/package/gluon-core/files/lib/gluon/upgrade/200-wireless b/package/gluon-core/files/lib/gluon/upgrade/200-wireless index 219e505d..ad47bb01 100755 --- a/package/gluon-core/files/lib/gluon/upgrade/200-wireless +++ b/package/gluon-core/files/lib/gluon/upgrade/200-wireless @@ -1,5 +1,8 @@ #!/usr/bin/lua +local util = require 'gluon.util' +local uci = require('luci.model.uci').cursor() +local site = require 'gluon.site_config' local sysconfig = require 'gluon.sysconfig' -- Initial @@ -7,6 +10,19 @@ if not sysconfig.gluon_version then local uci = require('luci.model.uci').cursor() uci:delete_all('wireless', 'wifi-iface') - uci:save('wireless') - uci:commit('wireless') end + +local function configure_radio(radio, index, config) + if config then + uci:delete('wireless', radio, 'disabled') + + uci:set('wireless', radio, 'channel', config.channel) + uci:set('wireless', radio, 'htmode', config.htmode) + uci:set('wireless', radio, 'country', site.regdom) + end +end + +util.iterate_radios(configure_radio) + +uci:save('wireless') +uci:commit('wireless') diff --git a/package/gluon-mesh-batman-adv-core/Makefile b/package/gluon-mesh-batman-adv-core/Makefile index bb3dc537..8358089c 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-radio-config +firewall +libiwinfo-lua + DEPENDS:=+gluon-core +firewall +libiwinfo-lua endef define Build/Prepare diff --git a/package/gluon-radio-config/Makefile b/package/gluon-radio-config/Makefile deleted file mode 100644 index 9157e804..00000000 --- a/package/gluon-radio-config/Makefile +++ /dev/null @@ -1,31 +0,0 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=gluon-radio-config -PKG_VERSION:=1 - -PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) - -include $(GLUONDIR)/include/package.mk - -define Package/gluon-radio-config - SECTION:=gluon - CATEGORY:=Gluon - TITLE:=Basic radio config (regdom, channel, htmode) - DEPENDS:=+gluon-core -endef - -define Build/Prepare - mkdir -p $(PKG_BUILD_DIR) -endef - -define Build/Configure -endef - -define Build/Compile -endef - -define Package/gluon-radio-config/install - $(CP) ./files/* $(1)/ -endef - -$(eval $(call BuildPackage,gluon-radio-config)) diff --git a/package/gluon-radio-config/files/lib/gluon/upgrade/250-gluon-radio-config b/package/gluon-radio-config/files/lib/gluon/upgrade/250-gluon-radio-config deleted file mode 100755 index 62e6dcde..00000000 --- a/package/gluon-radio-config/files/lib/gluon/upgrade/250-gluon-radio-config +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/lua - -local util = require 'gluon.util' -local uci = require('luci.model.uci').cursor() -local site = require 'gluon.site_config' - -local function configure_radio(radio, index, config) - uci:delete('wireless', radio, 'disabled') - - uci:set('wireless', radio, 'channel', config.channel) - uci:set('wireless', radio, 'htmode', config.htmode) - uci:set('wireless', radio, 'country', site.regdom) -end - -util.iterate_radios(configure_radio) - -uci:save('wireless') -uci:commit('wireless') From 84b63749700d501157a28ec0b11cb018bb7b71e8 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Tue, 18 Aug 2015 00:53:40 +0200 Subject: [PATCH 166/867] gluon-client-bridge: basic br-client config and wireless AP This package provides br-client and sets up a wireless AP interface for clients. --- docs/index.rst | 8 ++++ docs/package/gluon-client-bridge.rst | 11 +++++ package/gluon-client-bridge/Makefile | 36 ++++++++++++++ package/gluon-client-bridge/check_site.lua | 6 +++ .../upgrade/300-gluon-client-bridge-network | 27 +++++++++++ .../upgrade/320-gluon-client-bridge-wireless | 48 +++++++++++++++++++ package/gluon-mesh-batman-adv-core/Makefile | 2 +- .../gluon-mesh-batman-adv-core/check_site.lua | 5 -- .../310-gluon-mesh-batman-adv-core-mesh | 23 ++------- .../320-gluon-mesh-batman-adv-core-wireless | 22 --------- 10 files changed, 140 insertions(+), 48 deletions(-) create mode 100644 docs/package/gluon-client-bridge.rst create mode 100644 package/gluon-client-bridge/Makefile create mode 100644 package/gluon-client-bridge/check_site.lua create mode 100755 package/gluon-client-bridge/files/lib/gluon/upgrade/300-gluon-client-bridge-network create mode 100755 package/gluon-client-bridge/files/lib/gluon/upgrade/320-gluon-client-bridge-wireless diff --git a/docs/index.rst b/docs/index.rst index 8af06f4f..1719c239 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -43,6 +43,14 @@ Developer Documentation dev/wan dev/i18n +Packages +-------- + +.. toctree:: + :maxdepth: 1 + + package/gluon-client-bridge + Releases -------- diff --git a/docs/package/gluon-client-bridge.rst b/docs/package/gluon-client-bridge.rst new file mode 100644 index 00000000..131072f6 --- /dev/null +++ b/docs/package/gluon-client-bridge.rst @@ -0,0 +1,11 @@ +gluon-client-bridge +=================== + +This package provides a bridge (*br-client*) for connecting clients. It will +also setup a wireless interface, provided it is configured in *site.conf*. + +site.conf +--------- + +wifi24.ap.ssid / wifi5.ap.ssid + SSID for the client network diff --git a/package/gluon-client-bridge/Makefile b/package/gluon-client-bridge/Makefile new file mode 100644 index 00000000..6bbfed64 --- /dev/null +++ b/package/gluon-client-bridge/Makefile @@ -0,0 +1,36 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=gluon-client-bridge +PKG_VERSION:=1 + +PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) + +include $(GLUONDIR)/include/package.mk + +define Package/gluon-client-bridge + SECTION:=gluon + CATEGORY:=Gluon + TITLE:=Provides a bridge and a wireless interface for clients to connect to + DEPENDS:=+gluon-core +endef + +define Build/Prepare + mkdir -p $(PKG_BUILD_DIR) +endef + +define Build/Configure +endef + +define Build/Compile +endef + +define Package/gluon-client-bridge/install + $(CP) ./files/* $(1)/ +endef + +define Package/gluon-client-bridge/postinst +#!/bin/sh +$(call GluonCheckSite,check_site.lua) +endef + +$(eval $(call BuildPackage,gluon-client-bridge)) diff --git a/package/gluon-client-bridge/check_site.lua b/package/gluon-client-bridge/check_site.lua new file mode 100644 index 00000000..3a7d81ee --- /dev/null +++ b/package/gluon-client-bridge/check_site.lua @@ -0,0 +1,6 @@ +for _, config in ipairs({'wifi24', 'wifi5'}) do + if need_table(config .. '.ap', nil, false) then + need_string(config .. '.ap.ssid') + need_boolean(config .. '.ap.disabled', false) + end +end diff --git a/package/gluon-client-bridge/files/lib/gluon/upgrade/300-gluon-client-bridge-network b/package/gluon-client-bridge/files/lib/gluon/upgrade/300-gluon-client-bridge-network new file mode 100755 index 00000000..5ee558cf --- /dev/null +++ b/package/gluon-client-bridge/files/lib/gluon/upgrade/300-gluon-client-bridge-network @@ -0,0 +1,27 @@ +#!/usr/bin/lua + +local sysconfig = require 'gluon.sysconfig' +local uci = require('luci.model.uci').cursor() + + +if not uci:get('network', 'client') then + uci:section('network', 'interface', 'client', + { + type = 'bridge', + } + ) +end + +local ifname = uci:get('network', 'client', 'ifname') + +if type(ifname) == 'string' then + uci:delete('network', 'client', 'ifname') + for x in ifname:gmatch("[^%s]+") do + uci:add_to_set('network', 'client', 'ifname', x) + end +end + +uci:set('network', 'client', 'macaddr', sysconfig.primary_mac) + +uci:save('network') +uci:commit('network') diff --git a/package/gluon-client-bridge/files/lib/gluon/upgrade/320-gluon-client-bridge-wireless b/package/gluon-client-bridge/files/lib/gluon/upgrade/320-gluon-client-bridge-wireless new file mode 100755 index 00000000..4eaccacb --- /dev/null +++ b/package/gluon-client-bridge/files/lib/gluon/upgrade/320-gluon-client-bridge-wireless @@ -0,0 +1,48 @@ +#!/usr/bin/lua + +local site = require 'gluon.site_config' +local util = require 'gluon.util' + +local uci = require('luci.model.uci').cursor() + + +local function is_disabled(config, name) + local disabled = config and config.disabled + if uci:get('wireless', name) then + disabled = uci:get_bool('wireless', name, 'disabled') + end + + return disabled and 1 or 0 +end + +local function configure_client(config, radio, index, suffix) + local name = 'client_' .. radio + local disabled = is_disabled(config, name) + + uci:delete('wireless', name) + + if config then + uci:section('wireless', 'wifi-iface', name, + { + device = radio, + network = 'client', + mode = 'ap', + ssid = config.ssid, + macaddr = util.generate_mac(2, index), + ifname = suffix and 'client' .. suffix, + disabled = disabled, + } + ) + end +end + +local function configure_radio(radio, index, config) + local suffix = radio:match('^radio(%d+)$') + + configure_client(config.ap, radio, index, suffix) +end + +util.iterate_radios(configure_radio) + +uci:save('wireless') +uci:commit('wireless') diff --git a/package/gluon-mesh-batman-adv-core/Makefile b/package/gluon-mesh-batman-adv-core/Makefile index 8358089c..c256ac93 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 +firewall +libiwinfo-lua + DEPENDS:=+gluon-core +gluon-client-bridge +firewall +libiwinfo-lua endef define Build/Prepare diff --git a/package/gluon-mesh-batman-adv-core/check_site.lua b/package/gluon-mesh-batman-adv-core/check_site.lua index 49fff159..19774871 100644 --- a/package/gluon-mesh-batman-adv-core/check_site.lua +++ b/package/gluon-mesh-batman-adv-core/check_site.lua @@ -1,9 +1,4 @@ for _, config in ipairs({'wifi24', 'wifi5'}) do - if need_table(config .. '.ap', nil, false) then - need_string(config .. '.ap.ssid') - need_boolean(config .. '.ap.disabled', false) - end - if need_table(config .. '.ibss', nil, false) then need_string(config .. '.ibss.ssid') need_string_match(config .. '.ibss.bssid', '^%x[02468aAcCeE]:%x%x:%x%x:%x%x:%x%x:%x%x$') diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh index fe576e33..9fd5b4b0 100755 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh +++ b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh @@ -24,16 +24,7 @@ uci:section('batman-adv', 'mesh', 'bat0', uci:save('batman-adv') uci:commit('batman-adv') - -if not uci:get('network', 'client') then - uci:section('network', 'interface', 'client', - { - type = 'bridge', - proto = 'dhcpv6', - reqprefix = 'no', - } - ) - +if not uci:get('network', 'client', 'ifname') then uci:add_to_set('network', 'client', 'ifname', 'bat0') if sysconfig.lan_ifname and not site.mesh_on_lan then @@ -41,17 +32,9 @@ if not uci:get('network', 'client') then end end -local ifname = uci:get('network', 'client', 'ifname') - -if type(ifname) == 'string' then - uci:delete('network', 'client', 'ifname') - for x in ifname:gmatch("[^%s]+") do - uci:add_to_set('network', 'client', 'ifname', x) - end -end - +uci:set('network', 'client', 'proto', 'dhcpv6') +uci:set('network', 'client', 'reqprefix', 'no') uci:set('network', 'client', 'igmp_snooping', 0) -uci:set('network', 'client', 'macaddr', sysconfig.primary_mac) uci:set('network', 'client', 'peerdns', 1) uci:set('network', 'client', 'sourcefilter', 0) diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless index b1423f46..66b438d8 100755 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless +++ b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless @@ -15,27 +15,6 @@ local function is_disabled(config, name) return disabled and 1 or 0 end -local function configure_client(config, radio, index, suffix) - local name = 'client_' .. radio - local disabled = is_disabled(config, name) - - uci:delete('wireless', name) - - if config then - uci:section('wireless', 'wifi-iface', name, - { - device = radio, - network = 'client', - mode = 'ap', - ssid = config.ssid, - macaddr = util.generate_mac(2, index), - ifname = suffix and 'client' .. suffix, - disabled = disabled, - } - ) - end -end - local function configure_ibss(config, radio, index, suffix) local name = 'ibss_' .. radio local disabled = is_disabled(config, name) @@ -122,7 +101,6 @@ end local function configure_radio(radio, index, config) local suffix = radio:match('^radio(%d+)$') - configure_client(config.ap, radio, index, suffix) configure_ibss(config.ibss, radio, index, suffix) configure_mesh(config.mesh, radio, index, suffix) end From 557a073dc72f4e5a5031e20c76c539cc7b7fddd8 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 26 Oct 2015 22:29:44 +0100 Subject: [PATCH 167/867] gluon-mesh-batman-adv-core/gluon-luci-portconfig: fix configuration of br-client ifname with multiple interfaces in lan_ifname There are a few devices on which lan_ifname contains multiple interface names separated by spaces. --- .../usr/lib/lua/luci/model/cbi/admin/portconfig.lua | 10 ++++++++-- .../gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh | 6 +++++- .../upgrade/340-gluon-mesh-batman-adv-core-mesh-on-lan | 9 +++++++-- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/package/gluon-luci-portconfig/files/usr/lib/lua/luci/model/cbi/admin/portconfig.lua b/package/gluon-luci-portconfig/files/usr/lib/lua/luci/model/cbi/admin/portconfig.lua index 5f6cc77f..c9b57d4b 100644 --- a/package/gluon-luci-portconfig/files/usr/lib/lua/luci/model/cbi/admin/portconfig.lua +++ b/package/gluon-luci-portconfig/files/usr/lib/lua/luci/model/cbi/admin/portconfig.lua @@ -13,6 +13,7 @@ $Id$ ]]-- local uci = luci.model.uci.cursor() +local lutil = require 'luci.util' local sysconfig = require 'gluon.sysconfig' local wan = uci:get_all("network", "wan") @@ -121,10 +122,15 @@ function f.handle(self, state, data) if sysconfig.lan_ifname then uci:set("network", "mesh_lan", "auto", data.mesh_lan) + local doit if data.mesh_lan == '1' then - uci:remove_from_set("network", "client", "ifname", sysconfig.lan_ifname) + doit = uci.remove_from_set else - uci:add_to_set("network", "client", "ifname", sysconfig.lan_ifname) + doit = uci.add_to_set + end + + for _, lanif in ipairs(lutil.split(sysconfig.lan_ifname, ' ')) do + doit(uci, "network", "client", "ifname", lanif) end end diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh index 9fd5b4b0..160b96ea 100755 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh +++ b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh @@ -3,7 +3,9 @@ local sysconfig = require 'gluon.sysconfig' local sysctl = require 'gluon.sysctl' local site = require 'gluon.site_config' + local uci = require('luci.model.uci').cursor() +local lutil = require 'luci.util' local gw_sel_class @@ -28,7 +30,9 @@ if not uci:get('network', 'client', 'ifname') then uci:add_to_set('network', 'client', 'ifname', 'bat0') if sysconfig.lan_ifname and not site.mesh_on_lan then - uci:add_to_set('network', 'client', 'ifname', sysconfig.lan_ifname) + for _, lanif in ipairs(lutil.split(sysconfig.lan_ifname, ' ')) do + uci:add_to_set('network', 'client', 'ifname', lanif) + end end 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 c3deea29..2d800546 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 @@ -13,8 +13,13 @@ if sysconfig.lan_ifname and not uci:get('network', 'mesh_lan') then if enable then local interfaces = uci:get_list('network', 'client', 'ifname') - if interfaces and lutil.contains(interfaces, sysconfig.lan_ifname) then - enable = false + if interfaces then + for _, lanif in ipairs(lutil.split(sysconfig.lan_ifname, ' ')) do + if lutil.contains(interfaces, lanif) then + enable = false + break + end + end end end From 3647cf1d18ee79ee5788aafca1d878c68a676778 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 27 Oct 2015 01:55:02 +0100 Subject: [PATCH 168/867] Remove leftover file from gluon-radio-config --- package/gluon-radio-config/check_site.lua | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 package/gluon-radio-config/check_site.lua diff --git a/package/gluon-radio-config/check_site.lua b/package/gluon-radio-config/check_site.lua deleted file mode 100644 index b804d9fe..00000000 --- a/package/gluon-radio-config/check_site.lua +++ /dev/null @@ -1,6 +0,0 @@ -need_string('regdom') - -for _, config in ipairs({'wifi24', 'wifi5'}) do - need_number(config .. '.channel') - need_string(config .. '.htmode') -end From 3ddcf50b800cfdfca92400a5922ff1575ff3a8a9 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 27 Oct 2015 01:56:10 +0100 Subject: [PATCH 169/867] Drop htmode field from config, always use HT20 Fixes #487 --- docs/site-example/site.conf | 10 +--------- docs/user/site.rst | 2 -- package/gluon-core/check_site.lua | 1 - .../gluon-core/files/lib/gluon/upgrade/200-wireless | 2 +- 4 files changed, 2 insertions(+), 13 deletions(-) diff --git a/docs/site-example/site.conf b/docs/site-example/site.conf index 88e9b734..c9381d93 100644 --- a/docs/site-example/site.conf +++ b/docs/site-example/site.conf @@ -35,13 +35,6 @@ -- Wireless channel. channel = 1, - -- Specifies the channel width in 802.11n and 802.11ac mode. - -- Possible values are: - -- HT20 (single 20MHz channel), - -- HT40- (2x 20MHz channels, secondary below) - -- HT40+ (2x 20MHz channels, secondary above) - htmode = 'HT20', - -- ESSID used for client network. ap = { ssid = 'entenhausen.freifunk.net', @@ -58,10 +51,9 @@ -- Wireless configuration for 5 GHz interfaces. -- This should be equal to the 2.4 GHz variant, except - -- for channel and htmode. + -- for channel. wifi5 = { channel = 44, - htmode = 'HT20', ap = { ssid = 'entenhausen.freifunk.net', }, diff --git a/docs/user/site.rst b/docs/user/site.rst index bcc81122..62190093 100644 --- a/docs/user/site.rst +++ b/docs/user/site.rst @@ -83,7 +83,6 @@ regdom : optional wifi24 : optional WLAN configuration for 2.4 GHz devices. ``channel`` must be set to a valid wireless channel for your radio. - ``htmode`` selects the desired htmode (e.g. HT20, HT40- or HT40+). There are currently three interface types available. You many choose to configure any subset of them: @@ -108,7 +107,6 @@ wifi24 : optional wifi24 = { channel = 11, - htmode = 'HT20', ap = { ssid = 'entenhausen.freifunk.net', }, diff --git a/package/gluon-core/check_site.lua b/package/gluon-core/check_site.lua index e752dd26..1647d778 100644 --- a/package/gluon-core/check_site.lua +++ b/package/gluon-core/check_site.lua @@ -28,6 +28,5 @@ for _, config in ipairs({'wifi24', 'wifi5'}) do need_string('regdom') -- regdom is only required when wifi24 or wifi5 is configured need_number(config .. '.channel') - need_string(config .. '.htmode') end end diff --git a/package/gluon-core/files/lib/gluon/upgrade/200-wireless b/package/gluon-core/files/lib/gluon/upgrade/200-wireless index ad47bb01..1225fefd 100755 --- a/package/gluon-core/files/lib/gluon/upgrade/200-wireless +++ b/package/gluon-core/files/lib/gluon/upgrade/200-wireless @@ -17,7 +17,7 @@ local function configure_radio(radio, index, config) uci:delete('wireless', radio, 'disabled') uci:set('wireless', radio, 'channel', config.channel) - uci:set('wireless', radio, 'htmode', config.htmode) + uci:set('wireless', radio, 'htmode', 'HT20') uci:set('wireless', radio, 'country', site.regdom) end end From 6061b0874abc21865946fa0c0c659431595922c5 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 27 Oct 2015 22:44:03 +0100 Subject: [PATCH 170/867] build: fix manifest generation for model aliases --- Makefile | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 2910a4f3..08c4babb 100644 --- a/Makefile +++ b/Makefile @@ -433,9 +433,16 @@ manifest: FORCE ( \ cd $(GLUON_IMAGEDIR)/sysupgrade; \ $(foreach profile,$(PROFILES), \ - $(foreach model,$(GLUON_$(profile)_MODELS), \ - file="$(IMAGE_PREFIX)-$(model)-sysupgrade$(GLUON_$(profile)_SYSUPGRADE_EXT)"; \ - [ -e "$$file" ] && echo '$(model)' "$(PREPARED_RELEASE)" "$$($(SHA512SUM) "$$file")" "$$file"; \ + $(if $(GLUON_$(profile)_SYSUPGRADE_EXT), \ + $(foreach model,$(GLUON_$(profile)_MODELS), \ + file="$(IMAGE_PREFIX)-$(model)-sysupgrade$(GLUON_$(profile)_SYSUPGRADE_EXT)"; \ + [ -e "$$file" ] && echo '$(model)' "$(PREPARED_RELEASE)" "$$($(SHA512SUM) "$$file")" "$$file"; \ + \ + $(foreach alias,$(GLUON_$(profile)_MODEL_$(model)_ALIASES), \ + file="$(IMAGE_PREFIX)-$(alias)-sysupgrade$(GLUON_$(profile)_SYSUPGRADE_EXT)"; \ + [ -e "$$file" ] && echo '$(alias)' "$(PREPARED_RELEASE)" "$$($(SHA512SUM) "$$file")" "$$file"; \ + ) \ + ) \ ) \ ) : \ ) >> $(GLUON_BUILDDIR)/$(GLUON_BRANCH).manifest.tmp From 74a6556f9c6b4d61015b2e08fa3b245bcbcf74d9 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 28 Oct 2015 00:03:07 +0100 Subject: [PATCH 171/867] docs: releases/v2015.2: update site migration guide --- docs/releases/v2015.2.rst | 110 +++++++++++++++++++++++++++++++++++++- 1 file changed, 109 insertions(+), 1 deletion(-) diff --git a/docs/releases/v2015.2.rst b/docs/releases/v2015.2.rst index eda71390..13af5b28 100644 --- a/docs/releases/v2015.2.rst +++ b/docs/releases/v2015.2.rst @@ -15,10 +15,118 @@ Bugfixes Site changes ~~~~~~~~~~~~ +* ``site.conf`` + + - New WLAN configuration + + ``wifi24`` and ``wifi5`` need to be updated to a new more flexible format. + A configuration using the old format + + :: + + { + channel = 1, + htmode = 'HT20' + ssid = 'entenhausen.freifunk.net', + mesh_ssid = 'xe:xx:xx:xx:xx:xx', + mesh_bssid = 'xe:xx:xx:xx:xx:xx', + mesh_mcast_rate = 12000, + } + + would look like this in the new format:: + + { + channel = 1, + ap = { + ssid = 'entenhausen.freifunk.net', + }, + ibss = { + ssid = 'xe:xx:xx:xx:xx:xx', + bssid = 'xe:xx:xx:xx:xx:xx', + mcast_rate = 12000, + }, + } + + The ``htmode`` option has been dropped, the channel width is now always set to 20MHz + (see https://github.com/freifunk-gluon/gluon/issues/487 for a discussion of this change). + + In addition to the old IBSS (Adhoc) based meshing, 802.11s-based meshing can be configured + using the ``mesh`` section. Example:: + + { + channel = 1, + ap = { + ssid = 'entenhausen.freifunk.net', + }, + mesh = { + id = 'mesh.entenhausen.freifunk.net', -- can by any string, human-readable or random + mcast_rate = 12000, + }, + } + + While using ``ibss`` and ``mesh`` at the same time is possible, is causes high load in + very active meshes, so it is advisable to avoid such configurations. + + - Bandwidth limitation defaults + + The old section ``simple_tc.mesh_vpn`` has been moved to ``fastd_mesh_vpn.bandwidth_limit`` and the ``ifname`` + field isn't used anymore. What looked like this + before + + :: + + simple_tc = { + mesh_vpn = { + ifname = 'mesh-vpn', + enabled = false, + limit_ingress = 3000, + limit_egress = 200, + } + } + + needs to be changed to + + :: + + fastd_mesh_vpn = { + -- ... + + bandwidth_limit = { + enabled = false, + ingress = 3000, + egress = 200, + }, + } + + - opkg repository configuration + + The opkg configuration has been changed to be more flexible and allow specifying custom repositories. + Example:: + + opkg = { + openwrt = 'http://opkg.services.ffeh/openwrt/%n/%v/%S/packages', + extra = { + modules = 'http://opkg.services.ffeh/modules/gluon-%GS-%GR/%S', + }, + } + + The keys of the ``extra`` table (like ``modules`` in this example) can be chosen arbitrarily. + + Instead of explicitly specifying the whole URL, using patterns is recommended. The following + patterns are understood: + + - ``%n`` is replaced by the OpenWrt version codename (e.g. "chaos_calmer") + - ``%v`` is replaced by the OpenWrt version number (e.g. "15.05") + - ``%S`` is replaced by the target architecture (e.g. "ar71xx/generic") + - ``%GS`` is replaced by the Gluon site code (as specified in ``site.conf``) + - ``%GV`` is replaced by the Gluon version + - ``%GR`` is replaced by the Gluon release (as specified in ``site.mk``) + + * ``i18n/`` - The translations of ``gluon-config-mode:pubkey`` now have to show the fastd - public key itself if desired, making its format and whether it is shown at + public key itself 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 0717ce007d31c6e6c9120ba148e4bbaba7fdeb87 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 28 Oct 2015 00:50:53 +0100 Subject: [PATCH 172/867] Update OpenWrt and Gluon packages --- modules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules b/modules index 954a349a..c9df6c49 100644 --- a/modules +++ b/modules @@ -4,11 +4,11 @@ OPENWRT_REPO=git://git.openwrt.org/15.05/openwrt.git OPENWRT_COMMIT=f42308c3edc6bb23ce0e5ba3682195842bfbfd5c PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git -PACKAGES_OPENWRT_COMMIT=ffd3b199e11ec335ce4f6ddd4a1a3aaff370318d +PACKAGES_OPENWRT_COMMIT=f8a70fc188673d0ae8739b0a3095f7f61335fc10 PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git -PACKAGES_GLUON_COMMIT=3b67a18a51ee0d3545fb6a3da3d5b30d9482ae7e +PACKAGES_GLUON_COMMIT=b4f04f51d53b151a45f0618eef6d89d32f52dae7 PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_COMMIT=ae65d4fe027592652376f8dbd3ff2ef37f5a84bc From 172ad68134d91699144a6b762c2c8dbf2b5af518 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 28 Oct 2015 01:15:03 +0100 Subject: [PATCH 173/867] node: add python/host to HOST_BUILD_DEPENDS as well --- ...on-host-to-HOST_BUILD_DEPENDS-as-well.patch | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 patches/packages/openwrt/0002-node-add-python-host-to-HOST_BUILD_DEPENDS-as-well.patch diff --git a/patches/packages/openwrt/0002-node-add-python-host-to-HOST_BUILD_DEPENDS-as-well.patch b/patches/packages/openwrt/0002-node-add-python-host-to-HOST_BUILD_DEPENDS-as-well.patch new file mode 100644 index 00000000..f0c746aa --- /dev/null +++ b/patches/packages/openwrt/0002-node-add-python-host-to-HOST_BUILD_DEPENDS-as-well.patch @@ -0,0 +1,18 @@ +From: Matthias Schiffer +Date: Wed, 28 Oct 2015 01:10:09 +0100 +Subject: node: add python/host to HOST_BUILD_DEPENDS as well + +Signed-off-by: Matthias Schiffer + +diff --git a/lang/node/Makefile b/lang/node/Makefile +index 65a5390..243c8a5 100644 +--- a/lang/node/Makefile ++++ b/lang/node/Makefile +@@ -14,6 +14,7 @@ PKG_RELEASE:=1 + PKG_SOURCE:=node-$(PKG_VERSION).tar.gz + PKG_SOURCE_URL:=http://nodejs.org/dist/${PKG_VERSION} + ++HOST_BUILD_DEPENDS:=python/host + PKG_BUILD_DEPENDS:=python/host + PKG_INSTALL:=1 + PKG_USE_MIPS16:=0 From 412e1ef147f8eaf8073daa11a876cc286bea7c1b Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 28 Oct 2015 17:06:29 +0100 Subject: [PATCH 174/867] gluon-core: fix removal of "OpenWrt" default WLAN interface Fixes #534 --- package/gluon-core/files/lib/gluon/upgrade/200-wireless | 2 -- 1 file changed, 2 deletions(-) diff --git a/package/gluon-core/files/lib/gluon/upgrade/200-wireless b/package/gluon-core/files/lib/gluon/upgrade/200-wireless index 1225fefd..b9495d89 100755 --- a/package/gluon-core/files/lib/gluon/upgrade/200-wireless +++ b/package/gluon-core/files/lib/gluon/upgrade/200-wireless @@ -7,8 +7,6 @@ local sysconfig = require 'gluon.sysconfig' -- Initial if not sysconfig.gluon_version then - local uci = require('luci.model.uci').cursor() - uci:delete_all('wireless', 'wifi-iface') end From 86bd5a1da5afcf02b45df2c8ea93c93f2e8676a2 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 28 Oct 2015 19:59:51 +0100 Subject: [PATCH 175/867] docs: improve wired mesh documentation Fixes #376 --- docs/features/mesh-on-wan.rst | 18 ---------- docs/features/wired-mesh.rst | 65 +++++++++++++++++++++++++++++++++++ docs/index.rst | 2 +- 3 files changed, 66 insertions(+), 19 deletions(-) delete mode 100644 docs/features/mesh-on-wan.rst create mode 100644 docs/features/wired-mesh.rst diff --git a/docs/features/mesh-on-wan.rst b/docs/features/mesh-on-wan.rst deleted file mode 100644 index 2f1a8a47..00000000 --- a/docs/features/mesh-on-wan.rst +++ /dev/null @@ -1,18 +0,0 @@ -Mesh on WAN -=========== - -It's possible to enable the mesh on the WAN port like this:: - - uci set network.mesh_wan.auto=1 - uci commit - -It may also be disabled again by running:: - - uci set network.mesh_wan.auto=0 - uci commit - -site.conf ---------- - -The optional option ``mesh_on_wan`` may be set to ``true`` (``false`` is the -default) to enable meshing on the WAN port without further configuration. diff --git a/docs/features/wired-mesh.rst b/docs/features/wired-mesh.rst new file mode 100644 index 00000000..93021638 --- /dev/null +++ b/docs/features/wired-mesh.rst @@ -0,0 +1,65 @@ +Wired mesh (Mesh-on-WAN/LAN) +============================ + +In addition to meshing over WLAN and VPN, it is also possible to +configured wired meshing over the LAN or WAN ports. This allows +nodes to be connected directly or over wireless bridges. + +Mesh-on-WAN can be enabled in addition to the mesh VPN, so multiple nodes +in the same local network that is used as VPN uplink can also mesh directly. +Enabling Mesh-on-WAN should be avoided if the local network is also bridged with +a WLAN access point, as meshing over batman-adv causes large amounts of +multicast traffic, which will take up a lot of airtime. + +Enabling Mesh-on-LAN will replace the normal "client network" function +of the LAN ports, as client network ports may never be connected (so care must be taken to always +enable Mesh-on-LAN before connecting two nodes' LAN ports). + +Configuration +~~~~~~~~~~~~~ + +Both Mesh-on-WAN and Mesh-on-LAN can be configured on the "Network" page +of the *Expert Mode* (if the package ``gluon-luci-portconfig`` is installed). + +It is also possible to enable Mesh-on-WAN and Mesh-on-LAN by default by +adding ``mesh_on_wan = true`` and ``mesh_on_lan = true`` to ``site.conf``. + +Commandline configuration +------------------------- + +Mesh-on-WAN +........... + +It's possible to enable Mesh-on-WAN like this:: + + uci set network.mesh_wan.auto=1 + uci commit + +It may be disabled by running:: + + uci set network.mesh_wan.auto=0 + uci commit + + +Mesh-on-LAN +........... + +Configuring Mesh-on-LAN is a bit more complicated:: + + uci set network.mesh_lan.auto=1 + for ifname in $(cat /lib/gluon/core/sysconfig/lan_ifname); do + uci del_list network.client.ifname=$ifname + done + uci commit + +It may be disabled by running:: + + uci set network.mesh_wan.auto=0 + for ifname in $(cat /lib/gluon/core/sysconfig/lan_ifname); do + uci add_list network.client.ifname=$ifname + 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 +settings. diff --git a/docs/index.rst b/docs/index.rst index 1719c239..692b2e50 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -25,7 +25,7 @@ Features features/configmode features/autoupdater features/private-wlan - features/mesh-on-wan + features/wired-mesh features/announce features/authorized-keys features/roles From 47dee86d8f5e7922c2eac56b3a99759e7807793f Mon Sep 17 00:00:00 2001 From: Alexander Dahl Date: Thu, 29 Oct 2015 14:33:24 +0100 Subject: [PATCH 176/867] doc: remove double opening next_node line in site.conf example I guess this is some copy and paste mistake which makes the example an invalid site.conf. In my case merging the changes of the example into our actual site.conf lead to an error because this line was merged to. --- docs/site-example/site.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/site-example/site.conf b/docs/site-example/site.conf index c9381d93..8ebb79ba 100644 --- a/docs/site-example/site.conf +++ b/docs/site-example/site.conf @@ -85,7 +85,6 @@ -- }, -- }, - next_node = { -- Refer to http://fastd.readthedocs.org/en/latest/ to better understand -- what these options do. fastd_mesh_vpn = { From cb404a944b419d61de18e1df4f0b68da048c2073 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 13 Oct 2015 00:57:10 +0200 Subject: [PATCH 177/867] build: remove vermagic hack As the Gluon kernel won't be compatible with the OpenWrt upstream anymore, we don't need the vermagic hack anymore. --- Makefile | 18 +----------------- docs/dev/hardware.rst | 12 ------------ include/Makefile.target | 2 +- targets/ar71xx-generic/vermagic | 1 - targets/ar71xx-nand/vermagic | 1 - targets/brcm2708-bcm2708/vermagic | 1 - targets/brcm2708-bcm2709/vermagic | 1 - targets/mpc85xx-generic/vermagic | 1 - targets/ramips-rt305x/vermagic | 1 - targets/sunxi/vermagic | 1 - targets/x86-64/vermagic | 1 - targets/x86-generic/vermagic | 1 - targets/x86-kvm_guest/vermagic | 1 - targets/x86-xen_domu/vermagic | 1 - 14 files changed, 2 insertions(+), 41 deletions(-) delete mode 100644 targets/ar71xx-generic/vermagic delete mode 100644 targets/ar71xx-nand/vermagic delete mode 100644 targets/brcm2708-bcm2708/vermagic delete mode 100644 targets/brcm2708-bcm2709/vermagic delete mode 100644 targets/mpc85xx-generic/vermagic delete mode 100644 targets/ramips-rt305x/vermagic delete mode 100644 targets/sunxi/vermagic delete mode 100644 targets/x86-64/vermagic delete mode 100644 targets/x86-generic/vermagic delete mode 100644 targets/x86-kvm_guest/vermagic delete mode 100644 targets/x86-xen_domu/vermagic diff --git a/Makefile b/Makefile index 08c4babb..d3e36862 100644 --- a/Makefile +++ b/Makefile @@ -103,13 +103,6 @@ manifest: FORCE mkdir -p $(GLUON_IMAGEDIR)/sysupgrade mv $(GLUON_BUILDDIR)/$(GLUON_BRANCH).manifest.tmp $(GLUON_IMAGEDIR)/sysupgrade/$(GLUON_BRANCH).manifest -update-vermagic: FORCE - @$(CheckExternal) - +($(foreach GLUON_TARGET,$(GLUON_TARGETS), \ - $(GLUONMAKE_EARLY) maybe-prepare-target GLUON_TARGET='$(GLUON_TARGET)' V=s$(OPENWRT_VERBOSE) && \ - $(GLUONMAKE) update-vermagic GLUON_TARGET='$(GLUON_TARGET)' V=s$(OPENWRT_VERBOSE) && \ - ) :) - dirclean : FORCE for dir in build_dir dl staging_dir tmp; do \ rm -rf $(GLUON_ORIGOPENWRTDIR)/$$dir; \ @@ -447,15 +440,6 @@ manifest: FORCE ) : \ ) >> $(GLUON_BUILDDIR)/$(GLUON_BRANCH).manifest.tmp -update-vermagic: FORCE - mkdir -p '$(BOARD_BUILDDIR)' - echo '$(DEFAULT_OPKG_REPO)' > '$(BOARD_BUILDDIR)/default_opkg_repo' - $(VERSION_SED) '$(BOARD_BUILDDIR)/default_opkg_repo' - wget -q -O- "$$(cat '$(BOARD_BUILDDIR)/default_opkg_repo')/base/Packages.gz" \ - | gzip -d \ - | awk '/Depends: kernel / { match($$3,/[[:xdigit:]]{32}/,m); print m[0]; exit }' \ - > $(GLUONDIR)/targets/$(GLUON_TARGET)/vermagic - -.PHONY: all images prepare clean gluon-tools manifest update-vermagic +.PHONY: all images prepare clean gluon-tools manifest endif diff --git a/docs/dev/hardware.rst b/docs/dev/hardware.rst index 2e8e2491..3bd62a3d 100644 --- a/docs/dev/hardware.rst +++ b/docs/dev/hardware.rst @@ -76,21 +76,9 @@ A directory for the new target must be created under ``targets``, and it must be to ``targets/targets.mk``. In the new target directory, the following files must be created: * profiles.mk -* vermagic * config (optional) For ``profiles.mk``, see :ref:`hardware-adding-profiles`. The file ``config`` can be used to add additional, target-specific options to the OpenWrt config. -The files ``vermagic`` must have the correct content so kernel modules from the upstream repositories -can be installed without dependency issues. The OpenWrt version a Gluon release is based on is defined by the upstream package repo URL in ``include/gluon.mk`` -(in the variable ``DEFAULT_OPKG_REPO``); at the time this documentation was written, this was ``barrier_breaker/14.07``; whenever -the package repo is updated, all ``vermagic`` files must be updated as well. The command ``make update-vermagic`` can be used to get the correct -vermagic, or update the values when ``DEFAULT_OPKG_REPO`` has changed. - -The content is a hash which is part of the version number of the kernel package. So in the case of ``ar71xx-generic`` on -``barrier_breaker``, we look for the kernel package in the directory ``https://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/base/``. -As the kernel package is called ``kernel_3.10.49-1-0114c71ed85677c9c1e4911437af4743_ar71xx.ipk``, the correct ``vermagic`` string -is ``0114c71ed85677c9c1e4911437af4743``. - After this, is should be sufficient to call ``make GLUON_TARGET=`` to build the images for the new target. diff --git a/include/Makefile.target b/include/Makefile.target index a78a4044..9a913f0c 100644 --- a/include/Makefile.target +++ b/include/Makefile.target @@ -12,7 +12,7 @@ override define Kernel/Configure $(call Kernel/SetNoInitramfs) rm -rf $(KERNEL_BUILD_DIR)/modules $(_SINGLE) [ -d $(LINUX_DIR)/user_headers ] || $(MAKE) $(KERNEL_MAKEOPTS) INSTALL_HDR_PATH=$(LINUX_DIR)/user_headers headers_install - cp $(GLUONDIR)/targets/$(GLUON_TARGET)/vermagic $(LINUX_DIR)/.vermagic + $(SH_FUNC) grep '=[ym]' $(LINUX_DIR)/.config | LC_ALL=C sort | md5s > $(LINUX_DIR)/.vermagic endef # The Makefile included here is $(TOPDIR)/target/linux/$(BOARD)/Makefile diff --git a/targets/ar71xx-generic/vermagic b/targets/ar71xx-generic/vermagic deleted file mode 100644 index ff475475..00000000 --- a/targets/ar71xx-generic/vermagic +++ /dev/null @@ -1 +0,0 @@ -7bed08fa9c06eb8089e82c200340ec66 diff --git a/targets/ar71xx-nand/vermagic b/targets/ar71xx-nand/vermagic deleted file mode 100644 index bde150ed..00000000 --- a/targets/ar71xx-nand/vermagic +++ /dev/null @@ -1 +0,0 @@ -a44d8090b8f752ec1d96871dbbb8988a diff --git a/targets/brcm2708-bcm2708/vermagic b/targets/brcm2708-bcm2708/vermagic deleted file mode 100644 index f6367189..00000000 --- a/targets/brcm2708-bcm2708/vermagic +++ /dev/null @@ -1 +0,0 @@ -57d4b7d13c23edd1a689dd6d6adc65ad diff --git a/targets/brcm2708-bcm2709/vermagic b/targets/brcm2708-bcm2709/vermagic deleted file mode 100644 index 5264819c..00000000 --- a/targets/brcm2708-bcm2709/vermagic +++ /dev/null @@ -1 +0,0 @@ -0fec8065ae15bf9934ffbe2512e8e39f diff --git a/targets/mpc85xx-generic/vermagic b/targets/mpc85xx-generic/vermagic deleted file mode 100644 index 5ca6009d..00000000 --- a/targets/mpc85xx-generic/vermagic +++ /dev/null @@ -1 +0,0 @@ -521812ea85032e662b3d3469a3a10df8 diff --git a/targets/ramips-rt305x/vermagic b/targets/ramips-rt305x/vermagic deleted file mode 100644 index 3bc73d5e..00000000 --- a/targets/ramips-rt305x/vermagic +++ /dev/null @@ -1 +0,0 @@ -c8b57a131072a3198e594822481af3e0 diff --git a/targets/sunxi/vermagic b/targets/sunxi/vermagic deleted file mode 100644 index ef11e4c3..00000000 --- a/targets/sunxi/vermagic +++ /dev/null @@ -1 +0,0 @@ -3c199b535784c56bd7a6b4d6ad82b91f diff --git a/targets/x86-64/vermagic b/targets/x86-64/vermagic deleted file mode 100644 index cc552ff2..00000000 --- a/targets/x86-64/vermagic +++ /dev/null @@ -1 +0,0 @@ -30da46d39f906146155850351fa0acd9 diff --git a/targets/x86-generic/vermagic b/targets/x86-generic/vermagic deleted file mode 100644 index 3c2f8d1b..00000000 --- a/targets/x86-generic/vermagic +++ /dev/null @@ -1 +0,0 @@ -8549f8163c15d79b053f26aa0d52e96f diff --git a/targets/x86-kvm_guest/vermagic b/targets/x86-kvm_guest/vermagic deleted file mode 100644 index b0031811..00000000 --- a/targets/x86-kvm_guest/vermagic +++ /dev/null @@ -1 +0,0 @@ -d0d2aab265f2535385cf8d756315d27c diff --git a/targets/x86-xen_domu/vermagic b/targets/x86-xen_domu/vermagic deleted file mode 100644 index 1e646eda..00000000 --- a/targets/x86-xen_domu/vermagic +++ /dev/null @@ -1 +0,0 @@ -bce85557e89d5a4f30d6d723503b1a61 From 515dfa2b507e391601b096159eee9ff195bba7bc Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 13 Oct 2015 01:00:46 +0200 Subject: [PATCH 178/867] Increment LINUX_RELEASE The upstream builds always use LINUX_RELEASE=1. By setting it to 2 we ensure that our modules are always preferred as long as our kernel version is at least as high as the upstream one. --- include/gluon.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/gluon.mk b/include/gluon.mk index 44aad1ec..3ef3f132 100644 --- a/include/gluon.mk +++ b/include/gluon.mk @@ -16,6 +16,11 @@ BOARD_KDIR = $(BOARD_BUILDDIR)/kernel export BOARD_BUILDDIR + +LINUX_RELEASE := 2 +export LINUX_RELEASE + + GLUON_OPENWRTDIR = $(BOARD_BUILDDIR)/openwrt From 53a7cf31f92230d0602811257ca96176a124818b Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 13 Oct 2015 01:18:03 +0200 Subject: [PATCH 179/867] build: add GLUON_OUTPUTDIR, move GLUON_IMAGEDIR default below it We'll soon have other output besides the images, having a single directory for all output makes sense. --- .gitignore | 2 +- docs/features/autoupdater.rst | 4 ++-- docs/user/getting_started.rst | 11 +++++++---- include/gluon.mk | 6 ++++-- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 7a4602a1..2b6cabec 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ *~ /build -/images +/output /site /openwrt /packages diff --git a/docs/features/autoupdater.rst b/docs/features/autoupdater.rst index fdc511d9..8f35efb8 100644 --- a/docs/features/autoupdater.rst +++ b/docs/features/autoupdater.rst @@ -30,10 +30,10 @@ A fully automated nightly build could use the following commands: make clean make -j5 GLUON_TARGET=ar71xx-generic GLUON_BRANCH=experimental make manifest GLUON_BRANCH=experimental - contrib/sign.sh $SECRETKEY images/sysupgrade/experimental.manifest + contrib/sign.sh $SECRETKEY output/images/sysupgrade/experimental.manifest rm -rf /where/to/put/this/experimental - cp -r images /where/to/put/this/experimental + cp -r output/images /where/to/put/this/experimental Infrastructure diff --git a/docs/user/getting_started.rst b/docs/user/getting_started.rst index 10489978..658d98c5 100644 --- a/docs/user/getting_started.rst +++ b/docs/user/getting_started.rst @@ -86,7 +86,7 @@ In case of errors read the messages carefully and try to fix the stated issues ( ``ar71xx-generic`` is the most common target and will generated 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 `images`. Of these, the factory +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 system. @@ -117,12 +117,15 @@ Gluon's build process can be controlled by various environment variables. GLUON_SITEDIR Path to the site configuration. Defaults to ``site/``. -GLUON_IMAGEDIR - Path where images will be stored. Defaults to ``images/``. - GLUON_BUILDDIR Working directory during build. Defaults to ``build/``. +GLUON_OUTPUTDIR + Path where output files will be stored. Defaults to ``output/``. + +GLUON_IMAGEDIR + Path where images will be stored. Defaults to ``$(GLUON_OUTPUTDIR)/images/``. + So all in all, to update and rebuild a Gluon build tree, the following commands should be used (repeat the ``make clean`` and ``make`` for all targets you want to build): diff --git a/include/gluon.mk b/include/gluon.mk index 3ef3f132..ceaa2850 100644 --- a/include/gluon.mk +++ b/include/gluon.mk @@ -2,13 +2,15 @@ ifneq ($(__gluon_inc),1) __gluon_inc=1 GLUON_SITEDIR ?= $(GLUONDIR)/site -GLUON_IMAGEDIR ?= $(GLUONDIR)/images GLUON_BUILDDIR ?= $(GLUONDIR)/build GLUON_ORIGOPENWRTDIR := $(GLUONDIR)/openwrt GLUON_SITE_CONFIG := $(GLUON_SITEDIR)/site.conf -export GLUONDIR GLUON_SITEDIR GLUON_SITE_CONFIG GLUON_IMAGEDIR GLUON_BUILDDIR +GLUON_OUTPUTDIR ?= $(GLUONDIR)/output +GLUON_IMAGEDIR ?= $(GLUON_OUTPUTDIR)/images + +export GLUONDIR GLUON_SITEDIR GLUON_BUILDDIR GLUON_SITE_CONFIG GLUON_OUTPUTDIR GLUON_IMAGEDIR BOARD_BUILDDIR = $(GLUON_BUILDDIR)/$(GLUON_TARGET) From cbe66e9388de22d21d3ab3ea8461f69b817d4ec6 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 13 Oct 2015 21:36:19 +0200 Subject: [PATCH 180/867] build: add `make modules` make target `make modules` will generate a opkg repository containing kernel modules matching the kernel of the Gluon images. --- Makefile | 31 +++++++++++++++++-------------- docs/user/getting_started.rst | 3 +++ include/Makefile.target | 19 ------------------- include/config | 2 +- include/gluon.mk | 3 ++- 5 files changed, 23 insertions(+), 35 deletions(-) delete mode 100644 include/Makefile.target diff --git a/Makefile b/Makefile index d3e36862..f548dd1d 100644 --- a/Makefile +++ b/Makefile @@ -68,11 +68,12 @@ prepare-target: FORCE all: prepare-target +@$(GLUONMAKE) prepare +@$(GLUONMAKE) images + +@$(GLUONMAKE) modules prepare: prepare-target +@$(GLUONMAKE) $@ -clean download images: FORCE +clean download images modules: FORCE @$(CheckExternal) @$(CheckTarget) +@$(GLUONMAKE_EARLY) maybe-prepare-target @@ -178,6 +179,10 @@ override SUBTARGET := $(GLUON_TARGET_$(GLUON_TARGET)_SUBTARGET) target_prepared_stamp := $(BOARD_BUILDDIR)/target-prepared gluon_prepared_stamp := $(BOARD_BUILDDIR)/prepared +PREPARED_RELEASE = $$(cat $(gluon_prepared_stamp)) +IMAGE_PREFIX = gluon-$(GLUON_SITE_CODE)-$(PREPARED_RELEASE) +MODULE_PREFIX = gluon-$(GLUON_SITE_CODE)-$(PREPARED_RELEASE) + include $(INCLUDE_DIR)/target.mk @@ -228,13 +233,6 @@ config: FORCE | sed -e 's/ /\n/g'; \ ) > $(BOARD_BUILDDIR)/config.tmp scripts/config/conf --defconfig=$(BOARD_BUILDDIR)/config.tmp Config.in - mv .config $(BOARD_BUILDDIR)/config - - echo 'CONFIG_ALL_KMODS=y' >> $(BOARD_BUILDDIR)/config.tmp - scripts/config/conf --defconfig=$(BOARD_BUILDDIR)/config.tmp Config.in - mv .config $(BOARD_BUILDDIR)/config-allmods - - cp $(BOARD_BUILDDIR)/config .config prepare-target: FORCE rm $(GLUON_OPENWRTDIR)/tmp || true @@ -284,8 +282,8 @@ toolchain: $(toolchain/stamp-install) $(tools/stamp-install) include $(INCLUDE_DIR)/kernel.mk kernel: FORCE - +$(NO_TRACE_MAKE) -C $(TOPDIR)/target/linux/$(BOARD) -f $(GLUONDIR)/include/Makefile.target $(LINUX_DIR)/.image TARGET_BUILD=1 - +$(NO_TRACE_MAKE) -C $(TOPDIR)/target/linux/$(BOARD) -f $(GLUONDIR)/include/Makefile.target $(LINUX_DIR)/.modules TARGET_BUILD=1 + +$(NO_TRACE_MAKE) -C $(TOPDIR)/target/linux/$(BOARD) $(LINUX_DIR)/.image TARGET_BUILD=1 + +$(NO_TRACE_MAKE) -C $(TOPDIR)/target/linux/$(BOARD) $(LINUX_DIR)/.modules TARGET_BUILD=1 packages: $(package/stamp-compile) $(_SINGLE)$(SUBMAKE) -r package/index @@ -313,6 +311,14 @@ prepare: FORCE $(gluon_prepared_stamp): +$(GLUONMAKE) prepare +modules: FORCE $(gluon_prepared_stamp) + -rm -f $(GLUON_MODULEDIR)/*/$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic)/* + -rmdir -p $(GLUON_MODULEDIR)/*/$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic) + mkdir -p $(GLUON_MODULEDIR)/$(MODULE_PREFIX)/$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic) + cp $(PACKAGE_DIR)/kmod-*.ipk $(GLUON_MODULEDIR)/$(MODULE_PREFIX)/$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic) + + $(_SINGLE)$(SUBMAKE) -r package/index PACKAGE_DIR=$(GLUON_MODULEDIR)/$(MODULE_PREFIX)/$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic) + include $(INCLUDE_DIR)/package-ipkg.mk @@ -325,9 +331,6 @@ BIN_DIR = $(PROFILE_BUILDDIR)/images TARGET_DIR = $(PROFILE_BUILDDIR)/root -PREPARED_RELEASE = $$(cat $(gluon_prepared_stamp)) -IMAGE_PREFIX = gluon-$(GLUON_SITE_CODE)-$(PREPARED_RELEASE) - OPKG:= \ IPKG_TMP="$(TMP_DIR)/ipkgtmp" \ IPKG_INSTROOT="$(TARGET_DIR)" \ @@ -440,6 +443,6 @@ manifest: FORCE ) : \ ) >> $(GLUON_BUILDDIR)/$(GLUON_BRANCH).manifest.tmp -.PHONY: all images prepare clean gluon-tools manifest +.PHONY: all images prepare modules clean gluon-tools manifest endif diff --git a/docs/user/getting_started.rst b/docs/user/getting_started.rst index 658d98c5..db038bd5 100644 --- a/docs/user/getting_started.rst +++ b/docs/user/getting_started.rst @@ -126,6 +126,9 @@ GLUON_OUTPUTDIR GLUON_IMAGEDIR Path where images will be stored. Defaults to ``$(GLUON_OUTPUTDIR)/images/``. +GLUON_MODULEDIR + Path where the kernel module opkg repository will be stored. Defaults to ``$(GLUON_OUTPUTDIR)/modules``. + So all in all, to update and rebuild a Gluon build tree, the following commands should be used (repeat the ``make clean`` and ``make`` for all targets you want to build): diff --git a/include/Makefile.target b/include/Makefile.target deleted file mode 100644 index 9a913f0c..00000000 --- a/include/Makefile.target +++ /dev/null @@ -1,19 +0,0 @@ -# code adjusted from openwrt/include/kernel-defaults.mk - -override define Kernel/Configure - $(LINUX_CONF_CMD) > $(LINUX_DIR)/.config.target -# copy CONFIG_KERNEL_* settings over to .config.target - awk '/^(#[[:space:]]+)?CONFIG_KERNEL/{sub("CONFIG_KERNEL_","CONFIG_");print}' $(BOARD_BUILDDIR)/config-allmods >> $(LINUX_DIR)/.config.target - echo "# CONFIG_KALLSYMS_EXTRA_PASS is not set" >> $(LINUX_DIR)/.config.target - echo "# CONFIG_KALLSYMS_ALL is not set" >> $(LINUX_DIR)/.config.target - echo "# CONFIG_KALLSYMS_UNCOMPRESSED is not set" >> $(LINUX_DIR)/.config.target - $(SCRIPT_DIR)/metadata.pl kconfig $(TMP_DIR)/.packageinfo $(BOARD_BUILDDIR)/config-allmods $(KERNEL_PATCHVER) > $(LINUX_DIR)/.config.override - $(SCRIPT_DIR)/kconfig.pl 'm+' '+' $(LINUX_DIR)/.config.target /dev/null $(LINUX_DIR)/.config.override > $(LINUX_DIR)/.config - $(call Kernel/SetNoInitramfs) - rm -rf $(KERNEL_BUILD_DIR)/modules - $(_SINGLE) [ -d $(LINUX_DIR)/user_headers ] || $(MAKE) $(KERNEL_MAKEOPTS) INSTALL_HDR_PATH=$(LINUX_DIR)/user_headers headers_install - $(SH_FUNC) grep '=[ym]' $(LINUX_DIR)/.config | LC_ALL=C sort | md5s > $(LINUX_DIR)/.vermagic -endef - -# The Makefile included here is $(TOPDIR)/target/linux/$(BOARD)/Makefile -include Makefile diff --git a/include/config b/include/config index ac1a4f8d..8476ec64 100644 --- a/include/config +++ b/include/config @@ -1,7 +1,7 @@ CONFIG_IMAGEOPT=y # CONFIG_PER_FEED_REPO is not set - CONFIG_DEVEL=y +CONFIG_ALL_KMODS=y CONFIG_BUSYBOX_CUSTOM=y CONFIG_BUSYBOX_CONFIG_SHA512SUM=y diff --git a/include/gluon.mk b/include/gluon.mk index ceaa2850..3534ae22 100644 --- a/include/gluon.mk +++ b/include/gluon.mk @@ -9,8 +9,9 @@ GLUON_SITE_CONFIG := $(GLUON_SITEDIR)/site.conf GLUON_OUTPUTDIR ?= $(GLUONDIR)/output GLUON_IMAGEDIR ?= $(GLUON_OUTPUTDIR)/images +GLUON_MODULEDIR ?= $(GLUON_OUTPUTDIR)/modules -export GLUONDIR GLUON_SITEDIR GLUON_BUILDDIR GLUON_SITE_CONFIG GLUON_OUTPUTDIR GLUON_IMAGEDIR +export GLUONDIR GLUON_SITEDIR GLUON_BUILDDIR GLUON_SITE_CONFIG GLUON_OUTPUTDIR GLUON_IMAGEDIR GLUON_MODULEDIR BOARD_BUILDDIR = $(GLUON_BUILDDIR)/$(GLUON_TARGET) From 4b120deaee5c15c47aab8b6155563febfc1bfb30 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 14 Oct 2015 20:12:52 +0200 Subject: [PATCH 181/867] build: improve handling of repository signing keys --- Makefile | 76 ++++++++++++++++++++++------------- docs/user/getting_started.rst | 46 +++++++++++++++++++-- include/gluon.mk | 2 + 3 files changed, 93 insertions(+), 31 deletions(-) diff --git a/Makefile b/Makefile index f548dd1d..890fdfc8 100644 --- a/Makefile +++ b/Makefile @@ -59,30 +59,37 @@ CheckTarget := [ -n '$(GLUON_TARGET)' -a -n '$(GLUON_TARGET_$(GLUON_TARGET)_BOAR CheckExternal := test -d $(GLUON_ORIGOPENWRTDIR) || (echo 'You don'"'"'t seem to have obtained the external repositories needed by Gluon; please call `make update` first!'; false) +create-key: FORCE + @$(CheckExternal) + +@$(GLUONMAKE_EARLY) create-key + prepare-target: FORCE @$(CheckExternal) @$(CheckTarget) +@$(GLUONMAKE_EARLY) prepare-target - all: prepare-target + +@$(GLUONMAKE) build-key +@$(GLUONMAKE) prepare +@$(GLUONMAKE) images +@$(GLUONMAKE) modules prepare: prepare-target + +@$(GLUONMAKE) build-key +@$(GLUONMAKE) $@ clean download images modules: FORCE @$(CheckExternal) @$(CheckTarget) +@$(GLUONMAKE_EARLY) maybe-prepare-target + +@$(GLUONMAKE) build-key +@$(GLUONMAKE) $@ toolchain/% package/% target/% image/%: FORCE @$(CheckExternal) @$(CheckTarget) +@$(GLUONMAKE_EARLY) maybe-prepare-target + +@$(GLUONMAKE) build-key +@$(GLUONMAKE) $@ manifest: FORCE @@ -170,23 +177,6 @@ GLUON_$(1)_MODEL_$(2)_ALIASES += $(3) endef -include $(GLUONDIR)/targets/targets.mk -include $(GLUONDIR)/targets/$(GLUON_TARGET)/profiles.mk - -BOARD := $(GLUON_TARGET_$(GLUON_TARGET)_BOARD) -override SUBTARGET := $(GLUON_TARGET_$(GLUON_TARGET)_SUBTARGET) - -target_prepared_stamp := $(BOARD_BUILDDIR)/target-prepared -gluon_prepared_stamp := $(BOARD_BUILDDIR)/prepared - -PREPARED_RELEASE = $$(cat $(gluon_prepared_stamp)) -IMAGE_PREFIX = gluon-$(GLUON_SITE_CODE)-$(PREPARED_RELEASE) -MODULE_PREFIX = gluon-$(GLUON_SITE_CODE)-$(PREPARED_RELEASE) - - -include $(INCLUDE_DIR)/target.mk - - prereq: FORCE +$(NO_TRACE_MAKE) prereq @@ -214,7 +204,43 @@ feeds: FORCE gluon-tools: FORCE +$(GLUONMAKE_EARLY) tools/sed/install - +$(GLUONMAKE_EARLY) package/lua/host/install + +$(GLUONMAKE_EARLY) package/lua/host/install package/usign/host/install + + +prepare-early: FORCE + for dir in build_dir dl staging_dir; do \ + mkdir -p $(GLUON_ORIGOPENWRTDIR)/$$dir; \ + done + + +$(GLUONMAKE_EARLY) feeds + +$(GLUONMAKE_EARLY) gluon-tools + +create-key: prepare-early + [ -s $(GLUON_OPKG_KEY) -a -s $(GLUON_OPKG_KEY).pub ] || \ + $(STAGING_DIR_HOST)/bin/usign -G -s $(GLUON_OPKG_KEY) -p $(GLUON_OPKG_KEY).pub -c "Gluon opkg key" + +include $(GLUONDIR)/targets/targets.mk + +ifneq ($(GLUON_TARGET),) + +include $(GLUONDIR)/targets/$(GLUON_TARGET)/profiles.mk + +BOARD := $(GLUON_TARGET_$(GLUON_TARGET)_BOARD) +override SUBTARGET := $(GLUON_TARGET_$(GLUON_TARGET)_SUBTARGET) + +target_prepared_stamp := $(BOARD_BUILDDIR)/target-prepared +gluon_prepared_stamp := $(BOARD_BUILDDIR)/prepared + +PREPARED_RELEASE = $$(cat $(gluon_prepared_stamp)) +IMAGE_PREFIX = gluon-$(GLUON_SITE_CODE)-$(PREPARED_RELEASE) +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 config: FORCE +$(NO_TRACE_MAKE) scripts/config/conf OPENWRT_BUILD= QUIET=0 @@ -234,23 +260,18 @@ config: FORCE ) > $(BOARD_BUILDDIR)/config.tmp scripts/config/conf --defconfig=$(BOARD_BUILDDIR)/config.tmp Config.in -prepare-target: FORCE +prepare-target: create-key rm $(GLUON_OPENWRTDIR)/tmp || true mkdir -p $(GLUON_OPENWRTDIR)/tmp - for dir in build_dir dl staging_dir; do \ - mkdir -p $(GLUON_ORIGOPENWRTDIR)/$$dir; \ - done for link in build_dir config Config.in dl include Makefile package rules.mk scripts staging_dir target toolchain tools; do \ ln -sf $(GLUON_ORIGOPENWRTDIR)/$$link $(GLUON_OPENWRTDIR); \ done - +$(GLUONMAKE_EARLY) feeds - +$(GLUONMAKE_EARLY) gluon-tools +$(GLUONMAKE) config touch $(target_prepared_stamp) -$(target_prepared_stamp): +$(target_prepared_stamp): create-key +$(GLUONMAKE_EARLY) prepare-target maybe-prepare-target: $(target_prepared_stamp) @@ -443,6 +464,7 @@ manifest: FORCE ) : \ ) >> $(GLUON_BUILDDIR)/$(GLUON_BRANCH).manifest.tmp -.PHONY: all images prepare modules clean gluon-tools manifest +.PHONY: all create-key prepare images modules clean gluon-tools manifest endif +endif diff --git a/docs/user/getting_started.rst b/docs/user/getting_started.rst index db038bd5..d7100e71 100644 --- a/docs/user/getting_started.rst +++ b/docs/user/getting_started.rst @@ -109,22 +109,60 @@ will clean the entire tree, so the toolchain will be rebuilt as well, which is not necessary in most cases, and will take a while. +opkg repositories +----------------- + +Gluon is mostly compatible with OpenWrt, so the normal OpenWrt package repositories +can be used for Gluon as well. It is advisable to setup a mirror or reverse proxy +reachable over IPv6 and add it to ``site.conf`` as http://downloads.openwrt.org/ does +not support IPv6. + +This is not true for kernel modules; the Gluon kernel is incompatible with the +kernel of the default OpenWrt images. Therefore, Gluon will not only generate images, +but also an opkg repositoy containing all kernel modules provided by OpenWrt/Gluon +for the kernel of the generated images. + +Signing keys +............ + +Gluon does not support HTTPS for downloading packages; fortunately, opkg deploys +public-key cryptography to ensure package integrity. + +The Gluon images will contain two public keys: the official OpenWrt signing key +(to allow installing userspace packages) and a Gluon-specific key (which is used +to sign the generated module repository). + +By default, Gluon will handle the generation and handling of the keys itself. +When making firmware releases based on Gluon, it might make sense to store the +the keypair, so updating the module repository later is possible. + +The location the keys are stored at and read from can be changed +(see :ref:`getting-started-environment-variables`). To only generate the keypair +at the configured location without doing a full build, use ``make create-key``. + +.. _getting-started-environment-variables: + Environment variables --------------------- Gluon's build process can be controlled by various environment variables. GLUON_SITEDIR - Path to the site configuration. Defaults to ``site/``. + Path to the site configuration. Defaults to ``site``. GLUON_BUILDDIR - Working directory during build. Defaults to ``build/``. + Working directory during build. Defaults to ``build``. + +GLUON_OPKG_KEY + Path key file used to sign the module opkg repository. Defaults to ``$(GLUON_BULDDIR)/gluon-opkg-key``. + + The private key will be stored as ``$(GLUON_OPKG_KEY)``, the public key as ``$(GLUON_OPKG_KEY).pub``. GLUON_OUTPUTDIR - Path where output files will be stored. Defaults to ``output/``. + Path where output files will be stored. Defaults to ``output``. GLUON_IMAGEDIR - Path where images will be stored. Defaults to ``$(GLUON_OUTPUTDIR)/images/``. + Path where images will be stored. Defaults to ``$(GLUON_OUTPUTDIR)/images``. GLUON_MODULEDIR Path where the kernel module opkg repository will be stored. Defaults to ``$(GLUON_OUTPUTDIR)/modules``. diff --git a/include/gluon.mk b/include/gluon.mk index 3534ae22..d49dc13f 100644 --- a/include/gluon.mk +++ b/include/gluon.mk @@ -11,6 +11,8 @@ GLUON_OUTPUTDIR ?= $(GLUONDIR)/output GLUON_IMAGEDIR ?= $(GLUON_OUTPUTDIR)/images GLUON_MODULEDIR ?= $(GLUON_OUTPUTDIR)/modules +GLUON_OPKG_KEY ?= $(GLUON_BUILDDIR)/gluon-opkg-key + export GLUONDIR GLUON_SITEDIR GLUON_BUILDDIR GLUON_SITE_CONFIG GLUON_OUTPUTDIR GLUON_IMAGEDIR GLUON_MODULEDIR From a56d252cbaaf5b941d134ac118dc7f034facf06f Mon Sep 17 00:00:00 2001 From: Stefan Rauscher Date: Fri, 30 Oct 2015 16:44:14 +0100 Subject: [PATCH 182/867] doc: remove duplicate article in getting_started.rst --- docs/user/getting_started.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user/getting_started.rst b/docs/user/getting_started.rst index d7100e71..435ff30f 100644 --- a/docs/user/getting_started.rst +++ b/docs/user/getting_started.rst @@ -133,7 +133,7 @@ The Gluon images will contain two public keys: the official OpenWrt signing key to sign the generated module repository). By default, Gluon will handle the generation and handling of the keys itself. -When making firmware releases based on Gluon, it might make sense to store the +When making firmware releases based on Gluon, it might make sense to store the keypair, so updating the module repository later is possible. The location the keys are stored at and read from can be changed From 4c4ca215455579bb70f07998a30bbf06443a1bd7 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 30 Oct 2015 20:06:09 +0100 Subject: [PATCH 183/867] build: fix creation of opkg key when BUILDDIR hasn't been created yet --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 890fdfc8..caea217b 100644 --- a/Makefile +++ b/Makefile @@ -217,7 +217,7 @@ prepare-early: FORCE create-key: prepare-early [ -s $(GLUON_OPKG_KEY) -a -s $(GLUON_OPKG_KEY).pub ] || \ - $(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" include $(GLUONDIR)/targets/targets.mk From 2df84fc47416b899209e33d1c387481560ea4d9d Mon Sep 17 00:00:00 2001 From: brokenbike Date: Fri, 30 Oct 2015 21:16:27 +0100 Subject: [PATCH 184/867] Update site.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Freifunk Münsterland firmware was formerly known as Freifunk Münster firmware - while the URL hasn't changed. In future, there will probably be subdomains with their own files, but for now this is state of the project. --- 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 62190093..05079997 100644 --- a/docs/user/site.rst +++ b/docs/user/site.rst @@ -373,7 +373,7 @@ This is a non-exhaustive list of site-repos from various communities: * `site-ffmwu `_ (Mainz, Wiesbaden & Umgebung) * `site-ffmyk `_ (Mayen-Koblenz) * `site-ffm `_ (München) -* `site-ffms `_ (Münster) +* `site-ffms `_ (Münsterland) * `site-ffnw `_ (Nordwest) * `site-ffpb `_ (Paderborn) * `site-ffka `_ (Karlsruhe) From 82a9d7904a57161e379dbc953913bdeb9dd3b524 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 31 Oct 2015 22:53:20 +0100 Subject: [PATCH 185/867] build: fix QUILT=1 option This broke due to the Makefile changes for building the module repo. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index caea217b..ae8fdf40 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ export LC_ALL LANG empty:= space:= $(empty) $(empty) -GLUONMAKE_EARLY = $(SUBMAKE) -C $(GLUON_ORIGOPENWRTDIR) -f $(GLUONDIR)/Makefile GLUON_TOOLS=0 +GLUONMAKE_EARLY = $(SUBMAKE) -C $(GLUON_ORIGOPENWRTDIR) -f $(GLUONDIR)/Makefile GLUON_TOOLS=0 QUILT= GLUONMAKE = $(SUBMAKE) -C $(GLUON_OPENWRTDIR) -f $(GLUONDIR)/Makefile ifneq ($(OPENWRT_BUILD),1) From 7475ef8f1428721d2f77530dd8c28607257039ea Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 2 Nov 2015 00:16:09 +0100 Subject: [PATCH 186/867] Update OpenWrt base Update kernel to 3.18.23 --- modules | 2 +- ...ar71xx-rework-patch-for-qca953x-956x.patch | 75 +++---------------- ...h79_soc_rev-value-for-QCA9531-ver.-2.patch | 21 +----- 3 files changed, 12 insertions(+), 86 deletions(-) diff --git a/modules b/modules index c9df6c49..5cb9b484 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=f42308c3edc6bb23ce0e5ba3682195842bfbfd5c +OPENWRT_COMMIT=363508bcabd8e9205f5fffc8ff282439e61d618f PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git PACKAGES_OPENWRT_COMMIT=f8a70fc188673d0ae8739b0a3095f7f61335fc10 diff --git a/patches/openwrt/0019-ar71xx-rework-patch-for-qca953x-956x.patch b/patches/openwrt/0019-ar71xx-rework-patch-for-qca953x-956x.patch index dbab8b1b..eb1d12f4 100644 --- a/patches/openwrt/0019-ar71xx-rework-patch-for-qca953x-956x.patch +++ b/patches/openwrt/0019-ar71xx-rework-patch-for-qca953x-956x.patch @@ -103,7 +103,7 @@ 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 b44e884..d541939 100644 +index 5041619..403897a 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. @@ -594,38 +594,10 @@ index b44e884..d541939 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 8f15790..027163f 100644 +index 491a7aa..2bdc744 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 -@@ -1,3 +1,27 @@ -+--- a/arch/mips/ath79/Kconfig -++++ b/arch/mips/ath79/Kconfig -+@@ -1213,6 +1213,12 @@ config SOC_QCA955X -+ select PCI_AR724X if PCI -+ def_bool n -+ -++config SOC_QCA956X -++ select USB_ARCH_HAS_EHCI -++ select HW_HAS_PCI -++ select PCI_AR724X if PCI -++ def_bool n -++ -+ config ATH79_DEV_M25P80 -+ select ATH79_DEV_SPI -+ def_bool n -+@@ -1250,7 +1256,7 @@ config ATH79_DEV_USB -+ def_bool n -+ -+ config ATH79_DEV_WMAC -+- depends on (SOC_AR913X || SOC_AR933X || SOC_AR934X || SOC_QCA953X || SOC_QCA955X) -++ depends on (SOC_AR913X || SOC_AR933X || SOC_AR934X || SOC_QCA953X || SOC_QCA955X || SOC_QCA956X) -+ def_bool n -+ -+ config ATH79_NVRAM - --- a/arch/mips/ath79/clock.c - +++ b/arch/mips/ath79/clock.c - @@ -520,6 +520,100 @@ static void __init qca955x_clocks_init(v -@@ -142,74 +166,9 @@ +@@ -142,74 +142,9 @@ ath79_uart_data[0].uartclk = uart_clk_rate; platform_device_register(&ath79_uart_device); } else if (soc_is_ar933x()) { @@ -701,7 +673,7 @@ index 8f15790..027163f 100644 &ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2)); } -@@ -229,8 +188,8 @@ +@@ -229,8 +164,8 @@ void __init ath79_register_usb(void) { if (soc_is_ar71xx()) @@ -712,7 +684,7 @@ index 8f15790..027163f 100644 else if (soc_is_qca955x()) qca955x_usb_setup(); + else if (soc_is_qca9561()) -@@ -291,9 +250,9 @@ +@@ -291,9 +226,9 @@ soc_is_ar913x() || soc_is_ar933x()) reg = AR71XX_GPIO_REG_FUNC; @@ -724,7 +696,7 @@ index 8f15790..027163f 100644 reg = AR934X_GPIO_REG_FUNC; else BUG(); -@@ -326,7 +285,7 @@ +@@ -326,7 +261,7 @@ ath79_misc_irq_chip.irq_ack = ar724x_misc_irq_ack; else BUG(); @@ -733,7 +705,7 @@ index 8f15790..027163f 100644 irq_set_chained_handler(ATH79_CPU_IRQ(3), qca955x_ip3_irq_dispatch); } -@@ -406,15 +365,13 @@ +@@ -406,15 +341,13 @@ + + for (i = ATH79_IP2_IRQ_BASE; + i < ATH79_IP2_IRQ_BASE + ATH79_IP2_IRQ_COUNT; i++) @@ -751,7 +723,7 @@ index 8f15790..027163f 100644 + + irq_set_chained_handler(ATH79_CPU_IRQ(3), qca956x_ip3_irq_dispatch); + -@@ -426,7 +383,7 @@ +@@ -426,7 +359,7 @@ asmlinkage void plat_irq_dispatch(void) { unsigned long pending; @@ -760,7 +732,7 @@ index 8f15790..027163f 100644 } else if (soc_is_qca955x()) { ath79_ip2_handler = ath79_default_ip2_handler; ath79_ip3_handler = ath79_default_ip3_handler; -@@ -436,37 +393,13 @@ +@@ -436,8 +369,8 @@ } else { BUG(); } @@ -771,35 +743,6 @@ index 8f15790..027163f 100644 else if (soc_is_qca955x()) qca955x_irq_init(); + else if (soc_is_qca956x()) - + qca956x_irq_init(); - } ----- a/arch/mips/ath79/Kconfig --+++ b/arch/mips/ath79/Kconfig --@@ -1248,6 +1248,12 @@ config SOC_QCA955X -- select PCI_AR724X if PCI -- def_bool n -- --+config SOC_QCA956X --+ select USB_ARCH_HAS_EHCI --+ select HW_HAS_PCI --+ select PCI_AR724X if PCI --+ def_bool n --+ -- config ATH79_DEV_M25P80 -- select ATH79_DEV_SPI -- def_bool n --@@ -1285,7 +1291,7 @@ config ATH79_DEV_USB -- def_bool n -- -- config ATH79_DEV_WMAC --- depends on (SOC_AR913X || SOC_AR933X || SOC_AR934X || SOC_QCA953X || SOC_QCA955X) --+ depends on (SOC_AR913X || SOC_AR933X || SOC_AR934X || SOC_QCA953X || SOC_QCA955X || SOC_QCA956X) -- def_bool n -- -- config ATH79_NVRAM - --- a/arch/mips/ath79/pci.c - +++ b/arch/mips/ath79/pci.c - @@ -68,6 +68,21 @@ static const struct ath79_pci_irq qca955 @@ -519,7 +452,7 @@ return -ENODEV; --- a/arch/mips/ath79/setup.c 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 index 70e118ba..e1b0ed2d 100644 --- 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 @@ -10,7 +10,7 @@ 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 d541939..be53a5a 100644 +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. @@ -140,26 +140,9 @@ index d541939..be53a5a 100644 +++ 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 027163f..6e0b536 100644 +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 -@@ -1,6 +1,6 @@ - --- a/arch/mips/ath79/Kconfig - +++ b/arch/mips/ath79/Kconfig --@@ -1213,6 +1213,12 @@ config SOC_QCA955X -+@@ -1248,6 +1248,12 @@ config SOC_QCA955X - select PCI_AR724X if PCI - def_bool n - -@@ -13,7 +13,7 @@ - config ATH79_DEV_M25P80 - select ATH79_DEV_SPI - def_bool n --@@ -1250,7 +1256,7 @@ config ATH79_DEV_USB -+@@ -1285,7 +1291,7 @@ config ATH79_DEV_USB - def_bool n - - config ATH79_DEV_WMAC @@ -452,7 +452,7 @@ return -ENODEV; --- a/arch/mips/ath79/setup.c From db6c50011d48c2d17fd06e0cd765a5a329bd486b Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 2 Nov 2015 00:53:00 +0100 Subject: [PATCH 187/867] build: make `make dirclean` remove the whole GLUON_OUTPUTDIR --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ae8fdf40..a59f6c7f 100644 --- a/Makefile +++ b/Makefile @@ -115,7 +115,7 @@ dirclean : FORCE for dir in build_dir dl staging_dir tmp; do \ rm -rf $(GLUON_ORIGOPENWRTDIR)/$$dir; \ done - rm -rf $(GLUON_BUILDDIR) $(GLUON_IMAGEDIR) + rm -rf $(GLUON_BUILDDIR) $(GLUON_OUTPUTDIR) else From 31d65173f26ad8b0aebc3876b2a7fe60bac1d0a5 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 2 Nov 2015 00:58:34 +0100 Subject: [PATCH 188/867] build: clean up key generation and early preparation This will fix the early preparation happening much too often and also fixes early preparation after `make clean`. --- Makefile | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index a59f6c7f..d32073ab 100644 --- a/Makefile +++ b/Makefile @@ -207,6 +207,8 @@ gluon-tools: FORCE +$(GLUONMAKE_EARLY) package/lua/host/install package/usign/host/install +early_prepared_stamp := $(GLUON_BUILDDIR)/prepared + prepare-early: FORCE for dir in build_dir dl staging_dir; do \ mkdir -p $(GLUON_ORIGOPENWRTDIR)/$$dir; \ @@ -215,10 +217,20 @@ prepare-early: FORCE +$(GLUONMAKE_EARLY) feeds +$(GLUONMAKE_EARLY) gluon-tools -create-key: prepare-early + mkdir -p $$(dirname $(early_prepared_stamp)) + touch $(early_prepared_stamp) + +$(early_prepared_stamp): + +$(GLUONMAKE_EARLY) prepare-early + +$(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" +$(GLUON_OPKG_KEY).pub: $(GLUON_OPKG_KEY) + +create-key: $(GLUON_OPKG_KEY).pub + include $(GLUONDIR)/targets/targets.mk ifneq ($(GLUON_TARGET),) @@ -259,8 +271,9 @@ config: FORCE | sed -e 's/ /\n/g'; \ ) > $(BOARD_BUILDDIR)/config.tmp scripts/config/conf --defconfig=$(BOARD_BUILDDIR)/config.tmp Config.in + +$(NO_TRACE_MAKE) tools/prepare -prepare-target: create-key +prepare-target: $(GLUON_OPKG_KEY).pub rm $(GLUON_OPENWRTDIR)/tmp || true mkdir -p $(GLUON_OPENWRTDIR)/tmp @@ -271,10 +284,10 @@ prepare-target: create-key +$(GLUONMAKE) config touch $(target_prepared_stamp) -$(target_prepared_stamp): create-key +$(target_prepared_stamp): +$(GLUONMAKE_EARLY) prepare-target -maybe-prepare-target: $(target_prepared_stamp) +maybe-prepare-target: $(GLUON_OPKG_KEY).pub $(target_prepared_stamp) $(BUILD_DIR)/.prepared: Makefile @mkdir -p $$(dirname $@) From 6be3893a7b998a7c9639b9906313fe1cbc9e6454 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 2 Nov 2015 02:02:37 +0100 Subject: [PATCH 189/867] ipv6: fix crash on ICMPv6 redirects with prohibited/blackholed source Fixes #540 --- ...ts-with-prohibited-blackholed-source.patch | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 patches/openwrt/0032-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch diff --git a/patches/openwrt/0032-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch b/patches/openwrt/0032-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch new file mode 100644 index 00000000..c1eaeefe --- /dev/null +++ b/patches/openwrt/0032-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch @@ -0,0 +1,57 @@ +From: Matthias Schiffer +Date: Mon, 2 Nov 2015 02:02:02 +0100 +Subject: ipv6: fix crash on ICMPv6 redirects with prohibited/blackholed source + +There are other error values besides ip6_null_entry that can be returned by +ip6_route_redirect(): fib6_rule_action() can also result in +ip6_blk_hole_entry and ip6_prohibit_entry if such ip rules are installed. + +Only checking for ip6_null_entry in rt6_do_redirect() causes ip6_ins_rt() +to be called with rt->rt6i_table == NULL in these cases, making the kernel +crash. + +diff --git a/target/linux/generic/patches-3.18/672-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch b/target/linux/generic/patches-3.18/672-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch +new file mode 100644 +index 0000000..6e4b3da +--- /dev/null ++++ b/target/linux/generic/patches-3.18/672-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch +@@ -0,0 +1,39 @@ ++From 7426eb388ade0f1ad800c408d7efa227d4f41408 Mon Sep 17 00:00:00 2001 ++Message-Id: <7426eb388ade0f1ad800c408d7efa227d4f41408.1446425986.git.mschiffer@universe-factory.net> ++From: Matthias Schiffer ++Date: Mon, 2 Nov 2015 01:05:15 +0100 ++Subject: [PATCH] ipv6: fix crash on ICMPv6 redirects with ++ prohibited/blackholed source ++ ++There are other error values besides ip6_null_entry that can be returned by ++ip6_route_redirect(): fib6_rule_action() can also result in ++ip6_blk_hole_entry and ip6_prohibit_entry if such ip rules are installed. ++ ++Only checking for ip6_null_entry in rt6_do_redirect() causes ip6_ins_rt() ++to be called with rt->rt6i_table == NULL in these cases, making the kernel ++crash. ++ ++Signed-off-by: Matthias Schiffer ++--- ++ net/ipv6/route.c | 3 +-- ++ 1 file changed, 1 insertion(+), 2 deletions(-) ++ ++--- a/net/ipv6/route.c +++++ b/net/ipv6/route.c ++@@ -1766,7 +1766,6 @@ static int ip6_route_del(struct fib6_con ++ ++ static void rt6_do_redirect(struct dst_entry *dst, struct sock *sk, struct sk_buff *skb) ++ { ++- struct net *net = dev_net(skb->dev); ++ struct netevent_redirect netevent; ++ struct rt6_info *rt, *nrt = NULL; ++ struct ndisc_options ndopts; ++@@ -1827,7 +1826,7 @@ static void rt6_do_redirect(struct dst_e ++ } ++ ++ rt = (struct rt6_info *) dst; ++- if (rt == net->ipv6.ip6_null_entry) { +++ if (rt->rt6i_flags & RTF_REJECT) { ++ net_dbg_ratelimited("rt6_redirect: source isn't a valid nexthop for redirect target\n"); ++ return; ++ } From 2c6484ca1550ab7d64865163cca332b2a2c10707 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 24 Oct 2015 22:24:30 +0200 Subject: [PATCH 190/867] mac80211: backport from trunk r47249 + additional patches --- ...ity-firmware-as-an-additional-choice.patch | 95 - ...files-disable-reset-button-handling.patch} | 0 ...-mac80211-backport-from-trunk-r47249.patch | 23813 ++++++++++++++++ ...mcast-rate-for-mesh-point-interfaces.patch | 2 +- ...sh-11s-VIF-together-with-another-VIF.patch | 82 + ...ity-firmware-as-an-additional-choice.patch | 70 + 6 files changed, 23966 insertions(+), 96 deletions(-) delete mode 100644 patches/openwrt/0005-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch rename patches/openwrt/{0006-base-files-disable-reset-button-handling.patch => 0005-base-files-disable-reset-button-handling.patch} (100%) create mode 100644 patches/openwrt/0006-mac80211-backport-from-trunk-r47249.patch create mode 100644 patches/openwrt/0033-mac80211-fix-crash-when-using-mesh-11s-VIF-together-with-another-VIF.patch create mode 100644 patches/openwrt/0034-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch diff --git a/patches/openwrt/0005-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch b/patches/openwrt/0005-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch deleted file mode 100644 index 9d937c29..00000000 --- a/patches/openwrt/0005-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch +++ /dev/null @@ -1,95 +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 a1eedce..1c0aebe 100644 ---- a/package/kernel/mac80211/Makefile -+++ b/package/kernel/mac80211/Makefile -@@ -604,6 +604,14 @@ This module adds support for wireless adapters based on - Atheros USB AR9271 and AR7010 family of chipsets. - endef - -+ATH10K_CT_COMMUNITY_FW:=firmware-2-ct-full-community-14.bin -+define Download/ath10k-firmware-ct-community -+ FILE:=$(ATH10K_CT_COMMUNITY_FW) -+ URL:=http://www.candelatech.com/downloads/ -+ MD5SUM:=800799459c20c1683138c74b3ba58f25 -+endef -+$(eval $(call Download,ath10k-firmware-ct-community)) -+ - define KernelPackage/ath10k - $(call KernelPackage/mac80211/Default) - TITLE:=Atheros 802.11ac wireless cards support -@@ -624,21 +632,37 @@ endef - define KernelPackage/ath10k/config - if PACKAGE_kmod-ath10k - -+ choice -+ prompt "ath10k firmware flavour" -+ default ATH10K_AP_FW -+ help -+ This option allows you to choose between different ath10k firmwares. -+ -+ config ATH10K_AP_FW -+ bool "Firmware optimized for AP operation" -+ help -+ Use the ath10k firmware optimized for access point operation. -+ Supports only AP mode, will crash in IBSS (ad-hoc) mode. -+ - config ATH10K_STA_FW - bool "Firmware optimized for STA operation" -- default n - help - Use the ath10k firmware optimized for wireless client instead -- of access point operation. -+ of access point operation. Might be unstable in AP mode. -+ -+ config ATH10K_CT_COMMUNITY_FW -+ bool "Firmware by Candela Technologies (community version)" -+ help -+ Supports both AP and IBSS (ad-hoc) mode. Doesn't support -+ encryption when using multiple VIFs. - - config ATH10K_API2_FW - bool "Firmware optimized for AP operation (v10.1 / API v2)" -- default n -- depends on !ATH10K_STA_FW - help - Use the ath10k firmware from the 10.1 SDK using API v2 optimized - for access point operation if the default firmware keeps crashing. - -+ endchoice - endif - endef - -@@ -1866,18 +1890,25 @@ define KernelPackage/ath10k/install - $(INSTALL_DATA) \ - $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/ath10k/QCA988X/hw2.0/board.bin \ - $(1)/lib/firmware/ath10k/QCA988X/hw2.0/ -+ifeq ($(CONFIG_ATH10K_AP_FW),y) -+ $(INSTALL_DATA) \ -+ $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.2.4/firmware-4.bin_10.2.4.45 \ -+ $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-4.bin -+endif - ifeq ($(CONFIG_ATH10K_STA_FW),y) - $(INSTALL_DATA) \ - $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/main/firmware-2.bin_999.999.0.636 \ - $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin --else ifeq ($(CONFIG_ATH10K_API2_FW),y) -+endif -+ifeq ($(CONFIG_ATH10K_API2_FW),y) - $(INSTALL_DATA) \ - $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.1/firmware-2.bin_10.1.467.2-1 \ - $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin --else -+endif -+ifeq ($(CONFIG_ATH10K_CT_COMMUNITY_FW),y) - $(INSTALL_DATA) \ -- $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.2.4/firmware-4.bin_10.2.4.45 \ -- $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-4.bin -+ $(DL_DIR)/$(ATH10K_CT_COMMUNITY_FW) \ -+ $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin - endif - endef - diff --git a/patches/openwrt/0006-base-files-disable-reset-button-handling.patch b/patches/openwrt/0005-base-files-disable-reset-button-handling.patch similarity index 100% rename from patches/openwrt/0006-base-files-disable-reset-button-handling.patch rename to patches/openwrt/0005-base-files-disable-reset-button-handling.patch diff --git a/patches/openwrt/0006-mac80211-backport-from-trunk-r47249.patch b/patches/openwrt/0006-mac80211-backport-from-trunk-r47249.patch new file mode 100644 index 00000000..40b516e4 --- /dev/null +++ b/patches/openwrt/0006-mac80211-backport-from-trunk-r47249.patch @@ -0,0 +1,23813 @@ +From: Matthias Schiffer +Date: Tue, 23 Dec 2014 18:57:16 +0100 +Subject: mac80211: backport from trunk r47249 + +diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile +index a1eedce..f332cbd 100644 +--- a/package/kernel/mac80211/Makefile ++++ b/package/kernel/mac80211/Makefile +@@ -10,11 +10,11 @@ include $(INCLUDE_DIR)/kernel.mk + + PKG_NAME:=mac80211 + +-PKG_VERSION:=2015-03-09 +-PKG_RELEASE:=3 ++PKG_VERSION:=2015-07-21 ++PKG_RELEASE:=1 + PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources + PKG_BACKPORT_VERSION:= +-PKG_MD5SUM:=6d4b04e4ce8a1f54dabfb04f4709453c ++PKG_MD5SUM:=ec529acfb9c942daf8116e5cff47c999 + + 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 + PKG_MAINTAINER:=Felix Fietkau + + PKG_DRIVERS = \ +- adm8211 ath5k libertas-usb libertas-sdio p54-common p54-pci p54-usb p54-spi \ +- rt2x00-lib rt2x00-pci rt2x00-usb rt2800-lib rt2400-pci rt2500-pci \ +- rt2500-usb rt61-pci rt73-usb rt2800-mmio rt2800-pci rt2800-usb rt2800-soc \ +- rtl8180 rtl8187 zd1211rw mac80211-hwsim carl9170 b43 b43legacy \ +- ath9k-common ath9k ath9k-htc ath10k ath net-libipw net-ipw2100 net-ipw2200 \ +- mwl8k mwifiex-pcie net-hermes net-hermes-pci net-hermes-plx net-hermes-pcmcia \ +- iwl-legacy iwl3945 iwl4965 iwlagn wlcore wl12xx wl18xx lib80211 \ ++ adm8211 \ ++ ath ath5k ath9k ath9k-common ath9k-htc ath10k \ ++ b43 b43legacy \ ++ carl9170 \ ++ hermes hermes-pci hermes-pcmcia hermes-plx\ ++ iwl-legacy iwl3945 iwl4965 iwlwifi \ ++ lib80211 \ ++ libipw ipw2100 ipw2200 \ ++ libertas-sdio libertas-usb \ ++ mac80211-hwsim \ ++ mt7601u \ ++ mwl8k mwifiex-pcie \ ++ p54-common p54-pci p54-spi p54-usb \ ++ rt2x00-lib rt2x00-pci rt2x00-usb \ ++ rt2400-pci rt2500-pci rt2500-usb \ ++ rt2800-lib rt2800-mmio rt2800-pci rt2800-soc rt2800-usb \ ++ rt61-pci rt73-usb \ ++ rtl8180 rtl8187 \ + rtlwifi rtlwifi-pci rtlwifi-usb rtl8192c-common rtl8192ce rtl8192se \ +- rtl8192de rtl8192cu ++ rtl8192de rtl8192cu \ ++ wlcore wl12xx wl18xx \ ++ zd1211rw + + PKG_CONFIG_DEPENDS:= \ + CONFIG_PACKAGE_kmod-mac80211 \ +@@ -60,7 +73,6 @@ define KernelPackage/mac80211/Default + SUBMENU:=$(WMENU) + URL:=https://wireless.wiki.kernel.org/ + MAINTAINER:=Felix Fietkau +- DEPENDS:=@!TARGET_uml + endef + + define KernelPackage/cfg80211 +@@ -79,7 +91,7 @@ endef + define KernelPackage/mac80211 + $(call KernelPackage/mac80211/Default) + TITLE:=Linux 802.11 Wireless Networking Stack +- DEPENDS+= +kmod-crypto-core +kmod-crypto-arc4 +kmod-crypto-aes +kmod-cfg80211 +hostapd-common ++ DEPENDS+= +kmod-cfg80211 +hostapd-common + KCONFIG:=\ + CONFIG_AVERAGE=y + FILES:= $(PKG_BUILD_DIR)/net/mac80211/mac80211.ko +@@ -109,8 +121,8 @@ Generic IEEE 802.11 Networking Stack (mac80211) + endef + + 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_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 +-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 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) ++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 +-$(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 KernelPackage/ath/config ++ if PACKAGE_kmod-ath ++ config ATH_USER_REGD ++ bool "Force Atheros drivers to respect the user's regdomain settings" ++ 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. + +-define Download/p54usb +- FILE:=$(P54USBFW) +- URL:=http://daemonizer.de/prism54/prism54-fw/fw-usb +- MD5SUM:=8e8ab005a4f8f0123bcdc51bc25b47f6 +-endef +-$(eval $(call Download,p54usb)) ++ 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_ATH_DEBUG ++ bool "Atheros wireless debugging" ++ help ++ 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_ATH_DFS ++ bool "Enable DFS support" ++ default y ++ help ++ 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 +-endef ++ Select this option if you want to use such channels. + +-define KernelPackage/p54/description +- Kernel module for Prism54 chipsets (mac80211) ++ 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/ath ++ $(call KernelPackage/mac80211/Default) ++ TITLE:=Atheros common driver part ++ DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ar71xx||TARGET_ath25 +kmod-mac80211 ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath.ko ++ 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/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/ath5k ++ $(call KernelPackage/mac80211/Default) ++ TITLE:=Atheros 5xxx wireless cards support ++ URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath5k ++ DEPENDS+= @PCI_SUPPORT||@TARGET_ath25 +kmod-ath ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath5k/ath5k.ko ++ 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/ath5k/description ++ This module adds support for wireless adapters based on ++ Atheros 5xxx chipset. + endef + +-define KernelPackage/rt2x00/Default ++define KernelPackage/ath9k-common + $(call KernelPackage/mac80211/Default) +- TITLE:=Ralink Drivers for RT2x00 cards ++ 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 ++ FILES:= \ ++ $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_common.ko \ ++ $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_hw.ko + 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 ++define KernelPackage/ath9k ++ $(call KernelPackage/mac80211/Default) ++ TITLE:=Atheros 802.11n PCI wireless cards support ++ URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k ++ DEPENDS+= @PCI_SUPPORT||TARGET_ar71xx +kmod-ath9k-common ++ FILES:= \ ++ $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k.ko ++ 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/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 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)) + +-define KernelPackage/rt2800-mmio +-$(call KernelPackage/rt2x00/Default) +- TITLE += (RT28xx/RT3xxx MMIO) +- DEPENDS += +kmod-rt2800-lib +kmod-rt2x00-mmio +- HIDDEN:=1 +- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800mmio.ko +-endef + +-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/rt2x00/rt2x00soc.ko \ +- $(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800soc.ko +- AUTOLOAD:=$(call AutoProbe,rt2800soc) +-endef ++#Broadcom firmware ++ifneq ($(CONFIG_B43_FW_6_30),) ++ PKG_B43_FWV4_NAME:=broadcom-wl ++ PKG_B43_FWV4_VERSION:=6.30.163.46 ++ PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).wl_apsta.o ++ PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2 ++ PKG_B43_FWV4_SOURCE_URL:=http://www.lwfinger.com/b43-firmware/ ++ PKG_B43_FWV4_MD5SUM:=6fe97e9368d25342a1ab943d3cf3496d ++else ++ifneq ($(CONFIG_B43_FW_5_10),) ++ PKG_B43_FWV4_NAME:=broadcom-wl ++ PKG_B43_FWV4_VERSION:=5.10.56.27.3 ++ PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/driver/wl_apsta/wl_prebuilt.o ++ PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)_mipsel.tar.bz2 ++ PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/ ++ PKG_B43_FWV4_MD5SUM:=3363e3a6b3d9d73c49dea870c7834eac ++else ++ifneq ($(CONFIG_B43_FW_4_178),) ++ PKG_B43_FWV4_NAME:=broadcom-wl ++ PKG_B43_FWV4_VERSION:=4.178.10.4 ++ PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/linux/wl_apsta.o ++ PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2 ++ PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/ ++ PKG_B43_FWV4_MD5SUM:=14477e8cbbb91b11896affac9b219fdb ++else ++ifneq ($(CONFIG_B43_FW_5_100_138),) ++ PKG_B43_FWV4_NAME:=broadcom-wl ++ PKG_B43_FWV4_VERSION:=5.100.138 ++ PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/linux/wl_apsta.o ++ PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2 ++ PKG_B43_FWV4_SOURCE_URL:=http://www.lwfinger.com/b43-firmware/ ++ PKG_B43_FWV4_MD5SUM:=f4e357b09eaf5d8b1f1920cf3493a555 ++else ++ PKG_B43_FWV4_NAME:=broadcom-wl ++ PKG_B43_FWV4_VERSION:=4.150.10.5 ++ PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/driver/wl_apsta_mimo.o ++ PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2 ++ PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/ ++ PKG_B43_FWV4_MD5SUM:=0c6ba9687114c6b598e8019e262d9a60 ++endif ++endif ++endif ++endif ++ifneq ($(CONFIG_B43_OPENFIRMWARE),) ++ PKG_B43_FWV4_NAME:=broadcom-wl ++ PKG_B43_FWV4_VERSION:=5.2 ++ PKG_B43_FWV4_OBJECT:=openfwwf-$(PKG_B43_FWV4_VERSION) ++ PKG_B43_FWV4_SOURCE:=openfwwf-$(PKG_B43_FWV4_VERSION).tar.gz ++ PKG_B43_FWV4_SOURCE_URL:=http://www.ing.unibs.it/openfwwf/firmware/ ++ 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 Download/b43 ++ FILE:=$(PKG_B43_FWV4_SOURCE) ++ URL:=$(PKG_B43_FWV4_SOURCE_URL) ++ MD5SUM:=$(PKG_B43_FWV4_MD5SUM) + 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/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:=Broadcom 43xx wireless support ++ URL:=https://wireless.wiki.kernel.org/en/users/drivers/b43 ++ KCONFIG:= \ ++ CONFIG_HW_RANDOM=y ++ # Depend on PCI_SUPPORT to make sure we can select kmod-bcma or kmod-ssb ++ DEPENDS += \ ++ @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 ++ 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) +- DEPENDS+= @PCI_SUPPORT +kmod-rtlwifi +- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl_pci.ko +- 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/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 +-endef ++ If unsure, select the "stable" firmware. + +-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 +-endef ++ config B43_FW_5_10 ++ bool "Firmware 508.1084 from driver 5.10.56.27" ++ help ++ Older firmware for BCM43xx devices. + +-define KernelPackage/rtl8192ce +- $(call KernelPackage/mac80211/Default) +- 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) +-endef ++ If unsure, select the "stable" firmware. + +-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 +-endef ++ 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/rtl8192se +- $(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) +-endef ++ This firmware currently gets most of the testing and is needed for some N-PHY 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. + +-define KernelPackage/rtl8192de +- $(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) +-endef ++ config B43_FW_6_30 ++ bool "Firmware 784.2 from driver 6.30.163.46 (experimental)" ++ help ++ Newer experimental 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. + +-define KernelPackage/rtl8192cu +- $(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) +-endef ++ If unsure, select the "stable" firmware. + +-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 ++ config B43_OPENFIRMWARE ++ bool "Open FirmWare for WiFi networks" ++ help ++ Opensource firmware for BCM43xx devices. + +-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)) ++ 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/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) +-endef ++ If unsure, select the "stable" firmware. + +-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 ++ endchoice ++ ++ config B43_FW_SQUASH ++ bool "Remove unnecessary firmware files" ++ depends on !B43_OPENFIRMWARE ++ default y ++ help ++ 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. ++ ++ If unsure, say Y. ++ ++ config B43_FW_SQUASH_COREREVS ++ string "Core revisions to include" ++ depends on B43_FW_SQUASH ++ default "5,6,7,8,9,10,11,13,15" if TARGET_brcm47xx_legacy ++ default "16,28,29,30" if TARGET_brcm47xx_mips74k ++ 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. ++ ++ Example (keep files for rev5 only): ++ 5 ++ ++ Example (keep files for rev5 and rev11): ++ 5,11 ++ ++ config B43_FW_SQUASH_PHYTYPES ++ string "PHY types to include" ++ depends on B43_FW_SQUASH ++ default "G,N,LP" if TARGET_brcm47xx_legacy ++ default "N,HT" if TARGET_brcm47xx_mips74k ++ default "G,N,LP,HT" ++ help ++ This is a comma seperated list of PHY types: ++ A => A-PHY ++ AG => Dual A-PHY G-PHY ++ G => G-PHY ++ LP => LP-PHY ++ N => N-PHY ++ HT => HT-PHY ++ LCN => LCN-PHY ++ LCN40 => LCN40-PHY ++ AC => AC-PHY ++ ++ Example (keep files for G-PHY only): ++ G ++ ++ Example (keep files for G-PHY and N-PHY): ++ G,N ++ ++ choice ++ prompt "Supported buses" ++ default PACKAGE_B43_BUSES_BCMA_AND_SSB ++ help ++ This allows choosing buses that b43 should support. ++ ++ config PACKAGE_B43_BUSES_BCMA_AND_SSB ++ depends on !TARGET_brcm47xx_legacy && !TARGET_brcm47xx_mips74k && !TARGET_bcm53xx ++ bool "BCMA and SSB" ++ ++ config PACKAGE_B43_BUSES_BCMA ++ depends on !TARGET_brcm47xx_legacy ++ bool "BCMA only" ++ ++ config PACKAGE_B43_BUSES_SSB ++ depends on !TARGET_brcm47xx_mips74k && !TARGET_bcm53xx ++ bool "SSB only" ++ ++ endchoice ++ ++ config PACKAGE_B43_DEBUG ++ bool "Enable debug output and debugfs for b43" ++ default n ++ help ++ Enable additional debug output and runtime sanity checks for b43 ++ and enables the debugfs interface. ++ ++ If unsure, say N. ++ ++ config PACKAGE_B43_PIO ++ bool "Enable support for PIO transfer mode" ++ default n ++ 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. + +- config PACKAGE_ATH_DEBUG +- bool "Atheros wireless debugging" ++ If unsure, say Y. ++ ++ config PACKAGE_B43_PHY_LP ++ bool "Enable support for LP-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 + +- 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 + 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 + +- Select this option if you want to use such channels. ++ Currently only 11g speed is available. + +- endif +-endef ++ If unsure, say Y. + +-define KernelPackage/ath +- $(call KernelPackage/mac80211/Default) +- TITLE:=Atheros common driver part +- DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ar71xx||TARGET_ath25 +kmod-mac80211 +- 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 ++ help ++ Currently broken. + +-define KernelPackage/ath/description +- This module contains some common parts needed by Atheros Wireless drivers. +-endef ++ If unsure, say N. + +-define KernelPackage/ath5k +- $(call KernelPackage/mac80211/Default) +- TITLE:=Atheros 5xxx wireless cards support +- URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath5k +- DEPENDS+= @PCI_SUPPORT||@TARGET_ath25 +kmod-ath +- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath5k/ath5k.ko +- AUTOLOAD:=$(call AutoProbe,ath5k) ++ endif + endef + +-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 + +-define KernelPackage/ath9k-common ++define KernelPackage/b43legacy + $(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 + +-define KernelPackage/ath9k +- $(call KernelPackage/mac80211/Default) +- TITLE:=Atheros 802.11n PCI wireless cards support +- URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k +- DEPENDS+= @PCI_SUPPORT||TARGET_ar71xx +kmod-ath9k-common +- FILES:= \ +- $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k.ko +- AUTOLOAD:=$(call AutoProbe,ath9k) +-endef ++define KernelPackage/b43legacy/config ++ if PACKAGE_kmod-b43legacy + +-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. + +-define KernelPackage/ath9k/config ++ If unsure, say Y. + +- 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/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) ++ Example (keep files for rev4 only): ++ 4 ++ ++ Example (keep files for rev2 and rev4): ++ 2,4 ++ ++ endif + endef + +-define KernelPackage/ath9k-htc/description +-This module adds support for wireless adapters based on +-Atheros USB AR9271 and AR7010 family of chipsets. ++define KernelPackage/b43legacy/description ++Kernel module for Broadcom 43xx-legacy wireless support (mac80211 stack) new + endef + +-define KernelPackage/ath10k ++ ++define KernelPackage/brcmutil + $(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 +- 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) ++ 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 ++ AUTOLOAD:=$(call AutoProbe,brcmutil) ++ MENU:=1 + endef + +-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. ++define KernelPackage/brcmutil/description ++ This module contains some common parts needed by Broadcom Wireless drivers brcmsmac and brcmfmac. + endef + +-define KernelPackage/ath10k/config +- if PACKAGE_kmod-ath10k +- +- config ATH10K_STA_FW +- bool "Firmware optimized for STA operation" +- default n +- help +- Use the ath10k firmware optimized for wireless client instead +- of access point operation. ++define KernelPackage/brcmutil/config ++ if PACKAGE_kmod-brcmutil + +- config ATH10K_API2_FW +- bool "Firmware optimized for AP operation (v10.1 / API v2)" +- default n +- depends on !ATH10K_STA_FW ++ config PACKAGE_BRCM80211_DEBUG ++ bool "Broadcom wireless driver debugging" + help +- Use the ath10k firmware from the 10.1 SDK using API v2 optimized +- for access point operation if the default firmware keeps crashing. ++ Say Y, if you want to debug brcmsmac and brcmfmac wireless driver. + + endif + endef + +-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 +- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/carl9170/carl9170.ko +- AUTOLOAD:=$(call AutoProbe,carl9170) ++PKG_BRCMSMAC_FW_NAME:=broadcom-wl ++PKG_BRCMSMAC_FW_VERSION:=5.100.138 ++PKG_BRCMSMAC_FW_OBJECT:=$(PKG_BRCMSMAC_FW_NAME)-$(PKG_BRCMSMAC_FW_VERSION)/linux/wl_apsta.o ++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 Download/brcmsmac ++ FILE:=$(PKG_BRCMSMAC_FW_SOURCE) ++ URL:=$(PKG_BRCMSMAC_FW_SOURCE_URL) ++ MD5SUM:=$(PKG_BRCMSMAC_FW_MD5SUM) + endef ++$(eval $(call Download,brcmsmac)) + +-define KernelPackage/lib80211 ++define KernelPackage/brcmsmac + $(call KernelPackage/mac80211/Default) +- TITLE:=802.11 Networking stack +- DEPENDS:=+kmod-cfg80211 +- FILES:= \ +- $(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 \ +- $(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_tkip.ko +- AUTOLOAD:=$(call AutoProbe, \ +- lib80211 \ +- lib80211_crypt_wep \ +- lib80211_crypt_ccmp \ +- lib80211_crypt_tkip \ +- ) ++ 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 ++ AUTOLOAD:=$(call AutoProbe,brcmsmac) ++ MENU:=1 + endef + +-define KernelPackage/lib80211/description +- Kernel modules for 802.11 Networking stack +- Includes: +- - lib80211 +- - lib80211_crypt_wep +- - lib80211_crypt_tkip +- - lib80211_crytp_ccmp ++define KernelPackage/brcmsmac/description ++ Kernel module for Broadcom IEEE802.11n PCIe Wireless cards + endef + +-define KernelPackage/libertas-usb +- $(call KernelPackage/mac80211/Default) +- DEPENDS+= @USB_SUPPORT +kmod-cfg80211 +kmod-usb-core +kmod-lib80211 +@DRIVER_WEXT_SUPPORT +- TITLE:=Marvell 88W8015 Wireless Driver +- FILES:= \ +- $(PKG_BUILD_DIR)/drivers/net/wireless/libertas/libertas.ko \ +- $(PKG_BUILD_DIR)/drivers/net/wireless/libertas/usb8xxx.ko +- AUTOLOAD:=$(call AutoProbe,libertas usb8xxx) +-endef ++define KernelPackage/brcmsmac/config ++ if PACKAGE_kmod-brcmsmac + +-define KernelPackage/libertas-sdio +- $(call KernelPackage/mac80211/Default) +- DEPENDS+= +kmod-cfg80211 +kmod-lib80211 +kmod-mmc +@DRIVER_WEXT_SUPPORT @!TARGET_uml +- 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 +- AUTOLOAD:=$(call AutoProbe,libertas libertas_sdio) ++ config BRCMSMAC_USE_FW_FROM_WL ++ bool "Use firmware extracted from broadcom proprietary driver" ++ default y ++ help ++ Instead of using the official brcmsmac firmware a firmware ++ 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) +- TITLE:=mac80211 HW simulation device +- DEPENDS+= +kmod-mac80211 +@DRIVER_11N_SUPPORT +- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mac80211_hwsim.ko +- AUTOLOAD:=$(call AutoProbe,mac80211_hwsim) +-endef + +-define KernelPackage/net-libipw ++define KernelPackage/brcmfmac + $(call KernelPackage/mac80211/Default) +- TITLE:=libipw for ipw2100 and ipw2200 +- DEPENDS:=@PCI_SUPPORT +kmod-crypto-core +kmod-crypto-arc4 +kmod-crypto-aes +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) ++ 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) + endef + +-define KernelPackage/net-libipw/description +- Hardware independent IEEE 802.11 networking stack for ipw2100 and ipw2200. ++define KernelPackage/brcmfmac/description ++ Kernel module for Broadcom IEEE802.11n USB Wireless cards + endef + +-IPW2100_NAME:=ipw2100-fw +-IPW2100_VERSION:=1.3 +- +-define Download/net-ipw2100 +- URL:=http://bughost.org/firmware/ +- FILE:=$(IPW2100_NAME)-$(IPW2100_VERSION).tgz +- MD5SUM=46aa75bcda1a00efa841f9707bbbd113 +-endef +-$(eval $(call Download,net-ipw2100)) ++define KernelPackage/brcmfmac/config ++ if PACKAGE_kmod-brcmfmac + +-define KernelPackage/net-ipw2100 +- $(call KernelPackage/mac80211/Default) +- TITLE:=Intel IPW2100 driver +- DEPENDS:=@PCI_SUPPORT +kmod-net-libipw +- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ipw2x00/ipw2100.ko +- AUTOLOAD:=$(call AutoProbe,ipw2100) +-endef ++ config BRCMFMAC_SDIO ++ bool "Enable SDIO bus interface support" ++ default n ++ help ++ Enable support for cards attached to an SDIO bus. ++ Select this option only if you are sure that your ++ board has a Broadcom wireless chip atacched to ++ that bus. + +-define KernelPackage/net-ipw2100/description +- Kernel support for Intel IPW2100 +- Includes: +- - ipw2100 +-endef ++ config BRCMFMAC_USB ++ bool "Enable USB bus interface support" ++ depends on USB_SUPPORT ++ default y ++ help ++ Supported USB connected chipsets: ++ BCM43235, BCM43236, BCM43238 (all in revision 3 only) ++ BCM43143, BCM43242, BCM43566, BCM43569 + +-IPW2200_NAME:=ipw2200-fw +-IPW2200_VERSION:=3.1 ++ config BRCMFMAC_PCIE ++ bool "Enable PCIE bus interface support" ++ depends on PCI_SUPPORT ++ default y ++ help ++ Supported PCIe connected chipsets: ++ BCM4354, BCM4356, BCM43567, BCM43570, BCM43602 + +-define Download/net-ipw2200 +- URL:=http://bughost.org/firmware/ +- FILE:=$(IPW2200_NAME)-$(IPW2200_VERSION).tgz +- MD5SUM=eaba788643c7cc7483dd67ace70f6e99 ++ endif + endef +-$(eval $(call Download,net-ipw2200)) + +-define KernelPackage/net-ipw2200 +- $(call KernelPackage/mac80211/Default) +- TITLE:=Intel IPW2200 driver +- DEPENDS:=@PCI_SUPPORT +kmod-net-libipw +- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ipw2x00/ipw2200.ko +- AUTOLOAD:=$(call AutoProbe,ipw2200) +-endef + +-define KernelPackage/net-ipw2200/description +- Kernel support for Intel IPW2200 +- Includes: +- - ipw2200 ++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 ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/carl9170/carl9170.ko ++ AUTOLOAD:=$(call AutoProbe,carl9170) + endef + + +-define KernelPackage/net-hermes ++define KernelPackage/hermes + $(call KernelPackage/mac80211/Default) + TITLE:=Hermes 802.11b chipset support +- DEPENDS:=@PCI_SUPPORT||PCMCIA_SUPPORT +kmod-cfg80211 +@DRIVER_WEXT_SUPPORT ++ DEPENDS:=@PCI_SUPPORT||PCMCIA_SUPPORT +kmod-cfg80211 +@DRIVER_WEXT_SUPPORT +kmod-crypto-michael-mic + FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco.ko + AUTOLOAD:=$(call AutoProbe,orinoco) + endef + +-define KernelPackage/net-hermes/description ++define KernelPackage/hermes/description + Kernel support for Hermes 802.11b chipsets + endef + +-define KernelPackage/net-hermes-pci ++define KernelPackage/hermes-pci + $(call KernelPackage/mac80211/Default) + TITLE:=Intersil Prism 2.5 PCI support +- DEPENDS:=@PCI_SUPPORT +kmod-net-hermes ++ DEPENDS:=@PCI_SUPPORT +kmod-hermes + FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco_pci.ko + AUTOLOAD:=$(call AutoProbe,orinoco_pci) + endef + +-define KernelPackage/net-hermes-pci/description ++define KernelPackage/hermes-pci/description + Kernel modules for Intersil Prism 2.5 PCI support + endef + +-define KernelPackage/net-hermes-plx ++define KernelPackage/hermes-plx + $(call KernelPackage/mac80211/Default) + TITLE:=PLX9052 based PCI adaptor +- DEPENDS:=@PCI_SUPPORT +kmod-net-hermes ++ DEPENDS:=@PCI_SUPPORT +kmod-hermes + FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco_plx.ko + AUTOLOAD:=$(call AutoProbe,orinoco_plx) + endef + +-define KernelPackage/net-hermes-plx/description ++define KernelPackage/hermes-plx/description + Kernel modules for Hermes in PLX9052 based PCI adaptors + endef + +-define KernelPackage/net-hermes-pcmcia ++define KernelPackage/hermes-pcmcia + $(call KernelPackage/mac80211/Default) + TITLE:=Hermes based PCMCIA adaptors +- DEPENDS:=@PCMCIA_SUPPORT +kmod-net-hermes @BROKEN ++ DEPENDS:=@PCMCIA_SUPPORT +kmod-hermes @BROKEN + FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco_cs.ko + AUTOLOAD:=$(call AutoProbe,orinoco_cs) + endef + +-define KernelPackage/net-hermes-pcmcia/description ++define KernelPackage/hermes-pcmcia/description + Kernel modules for Hermes based PCMCIA adaptors + endef + +-define KernelPackage/iwlagn ++ ++define KernelPackage/iwlwifi + $(call KernelPackage/mac80211/Default) + DEPENDS:= +kmod-mac80211 @PCI_SUPPORT +@DRIVER_11N_SUPPORT + TITLE:=Intel AGN Wireless support + FILES:= \ + $(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 ++ AUTOLOAD:=$(call AutoProbe,iwlwifi iwldvm iwlmvm) + MENU:=1 + endef + +-define KernelPackage/iwlagn/description +- iwlagn kernel module for Intel 5000/5150/1000/6000/6050/6005/6030/100 support +-endef ++define KernelPackage/iwlwifi/description ++ iwlwifi kernel module for ++ Intel Wireless WiFi Link 6250AGN Adapter ++ Intel 6000 Series Wi-Fi Adapters (6200AGN and 6300AGN) ++ Intel WiFi Link 1000BGN ++ Intel Wireless WiFi 5150AGN ++ Intel Wireless WiFi 5100AGN, 5300AGN, and 5350AGN ++ Intel 6005 Series Wi-Fi Adapters ++ Intel 6030 Series Wi-Fi Adapters ++ Intel Wireless WiFi Link 6150BGN 2 Adapter ++ Intel 100 Series Wi-Fi Adapters (100BGN and 130BGN) ++ Intel 2000 Series Wi-Fi Adapters ++ Intel 7260 Wi-Fi Adapter ++ Intel 3160 Wi-Fi Adapter ++ Intel 7265 Wi-Fi Adapter ++ Intel 8260 Wi-Fi Adapter ++ Intel 3165 Wi-Fi Adapter ++endef ++ ++define KernelPackage/iwlwifi/config ++ if PACKAGE_kmod-iwlwifi ++ ++ config PACKAGE_IWLWIFI_DEBUG ++ bool "Enable full debugging output in the iwlwifi driver" ++ default n ++ help ++ This option will enable debug tracing output for the iwlwifi drivers + +-define KernelPackage/iwlagn/config +- if PACKAGE_kmod-iwlagn ++ 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" +- default y ++ /sys/module/iwlwifi/parameters/debug ++ ++ This entry will only exist if this option is enabled. ++ ++ To set a value, simply echo an 8-byte hex value to the same file: ++ ++ % echo 0x43fff > /sys/module/iwlwifi/parameters/debug ++ ++ You can find the list of debug mask values in: ++ drivers/net/wireless/iwlwifi/iwl-debug.h ++ ++ 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 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 ++ 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: +- Intel Wireless 3160 ++ Intel Wireless Series 8260, 4165 ++ + endif + endef + +@@ -953,578 +1026,587 @@ endef + define KernelPackage/iwl3945 + $(call KernelPackage/mac80211/Default) + DEPENDS:= +kmod-mac80211 +kmod-iwl-legacy +- 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) +- 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 +- +-define KernelPackage/iwl4965/description +- iwl4965 kernel module for Intel 4965 support +-endef +- +- +-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 +- +-define KernelPackage/mwl8k/description +- Kernel modules for Marvell TOPDOG 802.11 Wireless cards +-endef +- +- +-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 +- +-define KernelPackage/mwifiex-pcie/description +- Kernel modules for Marvell 802.11n/802.11ac PCIe Wireless cards +-endef +- +- +-define KernelPackage/wlcore +- $(call KernelPackage/mac80211/Default) +- 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 +- +-define KernelPackage/wlcore/description +- This module contains some common parts needed by TI Wireless drivers. +-endef +- +-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) ++ TITLE:=Intel iwl3945 Wireless support ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/iwlegacy/iwl3945.ko ++ AUTOLOAD:=$(call AutoProbe,iwl3945) + endef + +-define KernelPackage/wl12xx/description +- Kernel modules for TI WL12xx ++define KernelPackage/iwl3945/description ++ iwl3945 kernel module for Intel 3945 support + endef + +-define KernelPackage/wl18xx ++define KernelPackage/iwl4965 + $(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 + +-define KernelPackage/wl18xx/description +- Kernel modules for TI WL18xx ++define KernelPackage/iwl4965/description ++ iwl4965 kernel module for Intel 4965 support + endef + + +-#Broadcom firmware +-ifneq ($(CONFIG_B43_FW_6_30),) +- PKG_B43_FWV4_NAME:=broadcom-wl +- PKG_B43_FWV4_VERSION:=6.30.163.46 +- PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).wl_apsta.o +- PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2 +- PKG_B43_FWV4_SOURCE_URL:=http://www.lwfinger.com/b43-firmware/ +- PKG_B43_FWV4_MD5SUM:=6fe97e9368d25342a1ab943d3cf3496d +-else +-ifneq ($(CONFIG_B43_FW_5_10),) +- PKG_B43_FWV4_NAME:=broadcom-wl +- PKG_B43_FWV4_VERSION:=5.10.56.27.3 +- PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/driver/wl_apsta/wl_prebuilt.o +- PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)_mipsel.tar.bz2 +- PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/ +- PKG_B43_FWV4_MD5SUM:=3363e3a6b3d9d73c49dea870c7834eac +-else +-ifneq ($(CONFIG_B43_FW_4_178),) +- PKG_B43_FWV4_NAME:=broadcom-wl +- PKG_B43_FWV4_VERSION:=4.178.10.4 +- PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/linux/wl_apsta.o +- PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2 +- PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/ +- PKG_B43_FWV4_MD5SUM:=14477e8cbbb91b11896affac9b219fdb +-else +-ifneq ($(CONFIG_B43_FW_5_100_138),) +- PKG_B43_FWV4_NAME:=broadcom-wl +- PKG_B43_FWV4_VERSION:=5.100.138 +- PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/linux/wl_apsta.o +- PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2 +- PKG_B43_FWV4_SOURCE_URL:=http://www.lwfinger.com/b43-firmware/ +- PKG_B43_FWV4_MD5SUM:=f4e357b09eaf5d8b1f1920cf3493a555 +-else +- PKG_B43_FWV4_NAME:=broadcom-wl +- PKG_B43_FWV4_VERSION:=4.150.10.5 +- PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/driver/wl_apsta_mimo.o +- PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2 +- PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/ +- PKG_B43_FWV4_MD5SUM:=0c6ba9687114c6b598e8019e262d9a60 +-endif +-endif +-endif +-endif +-ifneq ($(CONFIG_B43_OPENFIRMWARE),) +- PKG_B43_FWV4_NAME:=broadcom-wl +- PKG_B43_FWV4_VERSION:=5.2 +- PKG_B43_FWV4_OBJECT:=openfwwf-$(PKG_B43_FWV4_VERSION) +- PKG_B43_FWV4_SOURCE:=openfwwf-$(PKG_B43_FWV4_VERSION).tar.gz +- PKG_B43_FWV4_SOURCE_URL:=http://www.ing.unibs.it/openfwwf/firmware/ +- PKG_B43_FWV4_MD5SUM:=e045a135453274e439ae183f8498b0fa +-endif +- +- +-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 Download/b43 +- 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:= \ ++ $(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 \ ++ $(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_tkip.ko ++ AUTOLOAD:=$(call AutoProbe, \ ++ lib80211 \ ++ lib80211_crypt_wep \ ++ lib80211_crypt_ccmp \ ++ 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) +- TITLE:=Broadcom 43xx wireless support +- URL:=https://wireless.wiki.kernel.org/en/users/drivers/b43 +- KCONFIG:= \ +- CONFIG_HW_RANDOM=y +- # Depend on PCI_SUPPORT to make sure we can select kmod-bcma or kmod-ssb +- DEPENDS += \ +- @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 +- 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) + endef + +-define KernelPackage/b43/config +- +-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/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 ++IPW2100_NAME:=ipw2100-fw ++IPW2100_VERSION:=1.3 + +- if PACKAGE_kmod-b43 ++define Download/ipw2100 ++ URL:=http://bughost.org/firmware/ ++ FILE:=$(IPW2100_NAME)-$(IPW2100_VERSION).tgz ++ MD5SUM=46aa75bcda1a00efa841f9707bbbd113 ++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. ++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 ++ AUTOLOAD:=$(call AutoProbe,ipw2100) ++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/ipw2100/description ++ Kernel support for Intel IPW2100 ++ Includes: ++ - ipw2100 ++endef + +- If unsure, select this. ++IPW2200_NAME:=ipw2200-fw ++IPW2200_VERSION:=3.1 + +- config B43_FW_4_178 +- bool "Firmware 478.104 from driver 4.178.10.4" +- help +- Older firmware for BCM43xx devices. ++define Download/ipw2200 ++ URL:=http://bughost.org/firmware/ ++ FILE:=$(IPW2200_NAME)-$(IPW2200_VERSION).tgz ++ MD5SUM=eaba788643c7cc7483dd67ace70f6e99 ++endef ++$(eval $(call Download,ipw2200)) + +- If unsure, select the "stable" firmware. ++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 ++ 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. ++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)" +- help +- The currently default firmware for BCM43xx devices. ++define KernelPackage/libertas-usb ++ $(call KernelPackage/mac80211/Default) ++ DEPENDS+= @USB_SUPPORT +kmod-cfg80211 +kmod-usb-core +kmod-lib80211 +@DRIVER_WEXT_SUPPORT ++ TITLE:=Marvell 88W8015 Wireless Driver ++ FILES:= \ ++ $(PKG_BUILD_DIR)/drivers/net/wireless/libertas/libertas.ko \ ++ $(PKG_BUILD_DIR)/drivers/net/wireless/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. ++define KernelPackage/libertas-sdio ++ $(call KernelPackage/mac80211/Default) ++ DEPENDS+= +kmod-cfg80211 +kmod-lib80211 +kmod-mmc +@DRIVER_WEXT_SUPPORT @!TARGET_uml ++ 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 ++ AUTOLOAD:=$(call AutoProbe,libertas libertas_sdio) ++endef + +- If unsure, select the this firmware. ++define KernelPackage/mac80211-hwsim ++ $(call KernelPackage/mac80211/Default) ++ TITLE:=mac80211 HW simulation device ++ DEPENDS+= +kmod-mac80211 +@DRIVER_11N_SUPPORT ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mac80211_hwsim.ko ++ 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. + +- 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" +- depends on !B43_OPENFIRMWARE +- default y +- help +- 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 ++endef + +- If unsure, say Y. + +- config B43_FW_SQUASH_COREREVS +- string "Core revisions to include" +- depends on B43_FW_SQUASH +- default "5,6,7,8,9,10,11,13,15" if TARGET_brcm47xx_legacy +- default "16,28,29,30" if TARGET_brcm47xx_mips74k +- 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 ++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 ++endef ++$(eval $(call Download,p54pci)) + +- config B43_FW_SQUASH_PHYTYPES +- string "PHY types to include" +- depends on B43_FW_SQUASH +- default "G,N,LP" if TARGET_brcm47xx_legacy +- default "N,HT" if TARGET_brcm47xx_mips74k +- default "G,N,LP,HT" +- help +- This is a comma seperated list of PHY types: +- A => A-PHY +- AG => Dual A-PHY G-PHY +- G => G-PHY +- LP => LP-PHY +- N => N-PHY +- HT => HT-PHY +- LCN => LCN-PHY +- LCN40 => LCN40-PHY +- AC => AC-PHY ++define Download/p54spi ++ FILE:=$(P54SPIFW) ++ URL:=http://daemonizer.de/prism54/prism54-fw/stlc4560 ++ MD5SUM:=42661f8ecbadd88012807493f596081d ++endef ++$(eval $(call Download,p54spi)) + +- Example (keep files for G-PHY only): +- G ++define KernelPackage/p54/Default ++ $(call KernelPackage/mac80211/Default) ++ TITLE:=Prism54 Drivers ++endef + +- Example (keep files for G-PHY and N-PHY): +- G,N ++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. ++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 ++endef + +- config PACKAGE_B43_DEBUG +- bool "Enable debug output and debugfs for b43" +- default n +- 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 ++endef + +- If unsure, say N. ++define KernelPackage/rt2x00-lib/config ++ if PACKAGE_kmod-rt2x00-lib + +- 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 +- Enable support for using PIO instead of DMA. Unless you have DMA +- transfer problems you don't need this. +- +- 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. + +- 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 +- 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 + +- If unsure, say Y. ++ endif ++endef + +- config PACKAGE_B43_PHY_N +- bool "Enable support for N-PHYs" +- default y +- 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 + +- 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 + +- 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) ++endef + +- config PACKAGE_B43_PHY_LP +- bool "Enable support for LP-PHYs" +- default n if TARGET_brcm47xx_mips74k +- default y +- help +- Enable support for LP-PHY. This includes support for the following devices: +- PCI: BCM4312 +- SoC: BCM5354 ++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 ++endef + +- If unsure, say Y. ++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) ++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/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) ++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 ++ HIDDEN:=1 ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800mmio.ko ++endef + +- Currently only 11g speed is available. ++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/rt2x00/rt2x00soc.ko \ ++ $(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800soc.ko ++ AUTOLOAD:=$(call AutoProbe,rt2800soc) ++endef + +- If unsure, say Y. ++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) ++endef + +- config PACKAGE_B43_PHY_LCN +- bool "Enable support for LCN-PHYs" +- depends on BROKEN +- default n +- help +- Currently broken. ++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) ++endef + +- If unsure, say N. + +- endif ++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 + +-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) + endef + +-define KernelPackage/b43legacy ++ ++define KernelPackage/rtl818x/Default + $(call KernelPackage/mac80211/Default) +- 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 ++ TITLE:=Realtek Drivers for RTL818x devices ++ URL:=http://wireless.kernel.org/en/users/Drivers/rtl8187 ++ DEPENDS+= +kmod-eeprom-93cx6 +kmod-mac80211 + endef + +-define KernelPackage/b43legacy/config +- if PACKAGE_kmod-b43legacy +- +- 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. ++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) ++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 +- This is a comma seperated list of core revision numbers. ++ Say Y, if you want to debug realtek wireless drivers. + +- Example (keep files for rev4 only): +- 4 ++endef + +- Example (keep files for rev2 and rev4): +- 2,4 ++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 + +- 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 + 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 + 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 ++endef + +-define KernelPackage/brcmutil ++define KernelPackage/rtl8192ce + $(call KernelPackage/mac80211/Default) +- 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 +- 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) + 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 + endef + +-define KernelPackage/brcmutil/config +- if PACKAGE_kmod-brcmutil ++define KernelPackage/rtl8192se ++ $(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) ++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 ++endef + +- endif ++define KernelPackage/rtl8192de ++ $(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) + endef + +-PKG_BRCMSMAC_FW_NAME:=broadcom-wl +-PKG_BRCMSMAC_FW_VERSION:=5.100.138 +-PKG_BRCMSMAC_FW_OBJECT:=$(PKG_BRCMSMAC_FW_NAME)-$(PKG_BRCMSMAC_FW_VERSION)/linux/wl_apsta.o +-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 ++endef + +-define Download/brcmsmac +- FILE:=$(PKG_BRCMSMAC_FW_SOURCE) +- URL:=$(PKG_BRCMSMAC_FW_SOURCE_URL) +- MD5SUM:=$(PKG_BRCMSMAC_FW_MD5SUM) ++define KernelPackage/rtl8192cu ++ $(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) + 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 + $(call KernelPackage/mac80211/Default) +- 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 +- 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) + 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. + 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 + +- config BRCMSMAC_USE_FW_FROM_WL +- bool "Use firmware extracted from broadcom proprietary driver" +- default y +- help +- Instead of using the official brcmsmac firmware a firmware +- 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 + +- 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 + +- endif ++define KernelPackage/wl18xx/description ++ Kernel modules for TI WL18xx + endef + + +-define KernelPackage/brcmfmac +- $(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 + 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) + endef + +-define KernelPackage/brcmfmac/config +- if PACKAGE_kmod-brcmfmac +- +- config BRCMFMAC_SDIO +- bool "Enable SDIO bus interface support" +- default n +- help +- Enable support for cards attached to an SDIO bus. +- Select this option only if you are sure that your +- board has a Broadcom wireless chip atacched to +- that bus. +- +- config BRCMFMAC_USB +- bool "Enable USB bus interface support" +- depends on USB_SUPPORT +- default y +- help +- Supported USB connected chipsets: +- BCM43235, BCM43236, BCM43238 (all in revision 3 only) +- BCM43143, BCM43242, BCM43566, BCM43569 +- +- config BRCMFMAC_PCIE +- bool "Enable PCIE bus interface support" +- depends on PCI_SUPPORT +- default y +- help +- Supported PCIe connected chipsets: +- BCM4354, BCM4356, BCM43567, BCM43570, BCM43602 + +- endif +-endef + + config_package=$(if $(CONFIG_PACKAGE_kmod-$(1)),m) + +@@ -1602,6 +1684,8 @@ config-$(CONFIG_BRCMFMAC_PCIE) += BRCMFMAC_PCIE + config-$(CONFIG_PACKAGE_BRCM80211_DEBUG) += BRCMDBG + + config-$(call config_package,mac80211-hwsim) += MAC80211_HWSIM ++config-$(call config_package,mt7601u) += MT7601U ++config-y += WL_MEDIATEK + + 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 + config-y += RT2800PCI_RT33XX RT2800PCI_RT35XX RT2800PCI_RT53XX RT2800PCI_RT3290 + + config-$(call config_package,rt2800-usb) += RT2800USB +-config-y += RT2800USB_RT33XX RT2800USB_RT35XX RT2800USB_RT3573 RT2800USB_RT53XX RT2800USB_RT55XX ++config-y += RT2800USB_RT33XX RT2800USB_RT35XX RT2800USB_RT3573 RT2800USB_RT53XX RT2800USB_RT55XX RT2800USB_UNKNOWN + + config-$(call config_package,iwl-legacy) += IWLEGACY + config-$(call config_package,iwl3945) += IWL3945 + config-$(call config_package,iwl4965) += IWL4965 +-config-$(call config_package,iwlagn) += IWLWIFI IWLDVM ++config-$(call config_package,iwlwifi) += IWLWIFI IWLDVM IWLMVM ++config-$(CONFIG_PACKAGE_IWLWIFI_DEBUG)+= IWLWIFI_DEBUG ++config-$(CONFIG_PACKAGE_IWLWIFI_DEBUGFS)+= IWLWIFI_DEBUGFS + +-config-$(call config_package,net-libipw) += LIBIPW +-config-$(call config_package,net-ipw2100) += IPW2100 +-config-$(call config_package,net-ipw2200) += IPW2200 ++config-$(call config_package,libipw) += LIBIPW ++config-$(call config_package,ipw2100) += IPW2100 ++config-$(call config_package,ipw2200) += IPW2200 + + config-$(call config_package,p54-common) += P54_COMMON + config-$(call config_package,p54-pci) += P54_PCI + config-$(call config_package,p54-usb) += P54_USB + config-$(call config_package,p54-spi) += P54_SPI + +-config-$(call config_package,net-hermes) += HERMES +-config-$(call config_package,net-hermes-pci) += PCI_HERMES +-config-$(call config_package,net-hermes-plx) += PLX_HERMES +-config-$(call config_package,net-hermes-pcmcia) += PCMCIA_HERMES ++config-$(call config_package,hermes) += HERMES ++config-$(call config_package,hermes-pci) += PCI_HERMES ++config-$(call config_package,hermes-plx) += PLX_HERMES ++config-$(call config_package,hermes-pcmcia) += PCMCIA_HERMES + config-y += HERMES_PRISM + + config-$(call config_package,adm8211) += ADM8211 +@@ -1702,8 +1788,9 @@ 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) + 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) + 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) \ +- $(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/cfg80211/install +- $(INSTALL_DIR) $(1)/lib/wifi $(1)/lib/netifd/wireless +- $(INSTALL_DATA) ./files/lib/wifi/mac80211.sh $(1)/lib/wifi +- $(INSTALL_BIN) ./files/lib/netifd/wireless/mac80211.sh $(1)/lib/netifd/wireless +-endef +- +-define KernelPackage/p54-pci/install +- $(INSTALL_DIR) $(1)/lib/firmware +- $(INSTALL_DATA) $(DL_DIR)/$(P54PCIFW) $(1)/lib/firmware/isl3886pci +-endef +- +-define KernelPackage/p54-usb/install +- $(INSTALL_DIR) $(1)/lib/firmware +- $(INSTALL_DATA) $(DL_DIR)/$(P54USBFW) $(1)/lib/firmware/isl3887usb +-endef +- +-define KernelPackage/p54-spi/install +- $(INSTALL_DIR) $(1)/lib/firmware +- $(INSTALL_DATA) $(DL_DIR)/$(P54SPIFW) $(1)/lib/firmware/3826.arm +-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/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/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-conf.bin \ +- $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl18xx-fw-3.bin \ +- $(1)/lib/firmware/ti-connectivity +-endef +- +-define KernelPackage/zd1211rw/install +- $(INSTALL_DIR) $(1)/lib/firmware/zd1211 +- $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(ZD1211FW_NAME)/zd1211* $(1)/lib/firmware/zd1211 +-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/ath9k-htc/install +- $(INSTALL_DIR) $(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 +- +-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/ +-ifeq ($(CONFIG_ATH10K_STA_FW),y) +- $(INSTALL_DATA) \ +- $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/main/firmware-2.bin_999.999.0.636 \ +- $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin +-else ifeq ($(CONFIG_ATH10K_API2_FW),y) +- $(INSTALL_DATA) \ +- $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.1/firmware-2.bin_10.1.467.2-1 \ +- $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin +-else +- $(INSTALL_DATA) \ +- $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.2.4/firmware-4.bin_10.2.4.45 \ +- $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-4.bin +-endif +-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/net-ipw2100/install +- $(INSTALL_DIR) $(1)/lib/firmware +- $(INSTALL_DATA) $(PKG_BUILD_DIR)/ipw2100-$(IPW2100_VERSION)*.fw $(1)/lib/firmware +-endef +- +-define KernelPackage/net-ipw2200/install +- $(INSTALL_DIR) $(1)/lib/firmware +- $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(IPW2200_NAME)-$(IPW2200_VERSION)/ipw2200*.fw $(1)/lib/firmware +-endef +- +-define KernelPackage/iwlagn/install +- $(INSTALL_DIR) $(1)/lib/firmware +-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_IWL1000_FW),) +- $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-1000-5.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_IWL6050_FW),) +- $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-6050-5.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_IWL7260_FW),) +- $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-7260-9.ucode $(1)/lib/firmware +-endif +-ifneq ($(CONFIG_IWL7265_FW),) +- $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-7265-9.ucode $(1)/lib/firmware +-endif +-ifneq ($(CONFIG_IWL100_FW),) +- $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-100-5.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_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_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 + +-define KernelPackage/iwl3945/install ++ ++define KernelPackage/ath9k-htc/install + $(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 + +-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 + + define KernelPackage/b43/install +@@ -2028,13 +1919,237 @@ ifneq ($(CONFIG_BRCMFMAC_PCIE),) + 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/cfg80211/install ++ $(INSTALL_DIR) $(1)/lib/wifi $(1)/lib/netifd/wireless ++ $(INSTALL_DATA) ./files/lib/wifi/mac80211.sh $(1)/lib/wifi ++ $(INSTALL_BIN) ./files/lib/netifd/wireless/mac80211.sh $(1)/lib/netifd/wireless ++endef ++ ++define KernelPackage/ipw2100/install ++ $(INSTALL_DIR) $(1)/lib/firmware ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/ipw2100-$(IPW2100_VERSION)*.fw $(1)/lib/firmware ++endef ++ ++define KernelPackage/ipw2200/install ++ $(INSTALL_DIR) $(1)/lib/firmware ++ $(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 ++endef ++ ++define KernelPackage/p54-usb/install ++ $(INSTALL_DIR) $(1)/lib/firmware ++ $(INSTALL_DATA) $(DL_DIR)/$(P54USBFW) $(1)/lib/firmware/isl3887usb ++endef ++ ++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 ++ ++define KernelPackage/zd1211rw/install ++ $(INSTALL_DIR) $(1)/lib/firmware/zd1211 ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(ZD1211FW_NAME)/zd1211* $(1)/lib/firmware/zd1211 ++endef ++ ++ + $(eval $(call KernelPackage,adm8211)) ++$(eval $(call KernelPackage,ath)) ++$(eval $(call KernelPackage,ath10k)) + $(eval $(call KernelPackage,ath5k)) ++$(eval $(call KernelPackage,ath9k)) ++$(eval $(call KernelPackage,ath9k-common)) ++$(eval $(call KernelPackage,ath9k-htc)) ++$(eval $(call KernelPackage,b43)) ++$(eval $(call KernelPackage,b43legacy)) ++$(eval $(call KernelPackage,brcmsmac)) ++$(eval $(call KernelPackage,brcmfmac)) ++$(eval $(call KernelPackage,brcmutil)) ++$(eval $(call KernelPackage,carl9170)) ++$(eval $(call KernelPackage,cfg80211)) ++$(eval $(call KernelPackage,hermes)) ++$(eval $(call KernelPackage,hermes-pci)) ++$(eval $(call KernelPackage,hermes-plx)) ++$(eval $(call KernelPackage,hermes-pcmcia)) ++$(eval $(call KernelPackage,iwlwifi)) ++$(eval $(call KernelPackage,iwl-legacy)) ++$(eval $(call KernelPackage,iwl4965)) ++$(eval $(call KernelPackage,iwl3945)) + $(eval $(call KernelPackage,lib80211)) + $(eval $(call KernelPackage,libertas-usb)) + $(eval $(call KernelPackage,libertas-sdio)) +-$(eval $(call KernelPackage,cfg80211)) ++$(eval $(call KernelPackage,libipw)) ++$(eval $(call KernelPackage,ipw2100)) ++$(eval $(call KernelPackage,ipw2200)) + $(eval $(call KernelPackage,mac80211)) ++$(eval $(call KernelPackage,mac80211-hwsim)) ++$(eval $(call KernelPackage,mt7601u)) ++$(eval $(call KernelPackage,mwl8k)) ++$(eval $(call KernelPackage,mwifiex-pcie)) + $(eval $(call KernelPackage,p54-common)) + $(eval $(call KernelPackage,p54-pci)) + $(eval $(call KernelPackage,p54-usb)) +@@ -2047,12 +2162,12 @@ $(eval $(call KernelPackage,rt2800-lib)) + $(eval $(call KernelPackage,rt2400-pci)) + $(eval $(call KernelPackage,rt2500-pci)) + $(eval $(call KernelPackage,rt2500-usb)) +-$(eval $(call KernelPackage,rt61-pci)) +-$(eval $(call KernelPackage,rt73-usb)) + $(eval $(call KernelPackage,rt2800-mmio)) + $(eval $(call KernelPackage,rt2800-soc)) + $(eval $(call KernelPackage,rt2800-pci)) + $(eval $(call KernelPackage,rt2800-usb)) ++$(eval $(call KernelPackage,rt61-pci)) ++$(eval $(call KernelPackage,rt73-usb)) + $(eval $(call KernelPackage,rtl8180)) + $(eval $(call KernelPackage,rtl8187)) + $(eval $(call KernelPackage,rtlwifi)) +@@ -2063,32 +2178,7 @@ $(eval $(call KernelPackage,rtl8192ce)) + $(eval $(call KernelPackage,rtl8192se)) + $(eval $(call KernelPackage,rtl8192de)) + $(eval $(call KernelPackage,rtl8192cu)) +-$(eval $(call KernelPackage,zd1211rw)) +-$(eval $(call KernelPackage,mac80211-hwsim)) +-$(eval $(call KernelPackage,ath9k-common)) +-$(eval $(call KernelPackage,ath9k)) +-$(eval $(call KernelPackage,ath9k-htc)) +-$(eval $(call KernelPackage,ath10k)) +-$(eval $(call KernelPackage,ath)) +-$(eval $(call KernelPackage,carl9170)) +-$(eval $(call KernelPackage,b43)) +-$(eval $(call KernelPackage,b43legacy)) +-$(eval $(call KernelPackage,brcmutil)) +-$(eval $(call KernelPackage,brcmsmac)) +-$(eval $(call KernelPackage,brcmfmac)) +-$(eval $(call KernelPackage,net-libipw)) +-$(eval $(call KernelPackage,net-ipw2100)) +-$(eval $(call KernelPackage,net-ipw2200)) +-$(eval $(call KernelPackage,iwlagn)) +-$(eval $(call KernelPackage,iwl-legacy)) +-$(eval $(call KernelPackage,iwl4965)) +-$(eval $(call KernelPackage,iwl3945)) +-$(eval $(call KernelPackage,mwl8k)) +-$(eval $(call KernelPackage,mwifiex-pcie)) +-$(eval $(call KernelPackage,net-hermes)) +-$(eval $(call KernelPackage,net-hermes-pci)) +-$(eval $(call KernelPackage,net-hermes-plx)) +-$(eval $(call KernelPackage,net-hermes-pcmcia)) + $(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 c9bc3d6..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() { + # All interfaces must have unique mac addresses + # which can either be explicitly set in the device + # section, or automatically generated +- ifconfig "$ifname" hw ether "$macaddr" ++ ip link set dev "$ifname" address "$macaddr" + fi + + json_select .. +@@ -582,7 +582,7 @@ mac80211_setup_vif() { + json_get_vars mode + json_get_var vif_txpower txpower + +- ifconfig "$ifname" up || { ++ ip link set dev "$ifname" up || { + wireless_setup_vif_failed IFUP_ERROR + json_select .. + return +@@ -638,7 +638,7 @@ mac80211_interface_cleanup() { + local phy="$1" + + for wdev in $(list_phy_interfaces "$phy"); do +- ifconfig "$wdev" down 2>/dev/null ++ ip link set dev "$wdev" down 2>/dev/null + iw dev "$wdev" del + done + } +diff --git a/package/kernel/mac80211/files/regdb.txt b/package/kernel/mac80211/files/regdb.txt +index ba95fc6..84413fd 100644 +--- a/package/kernel/mac80211/files/regdb.txt ++++ b/package/kernel/mac80211/files/regdb.txt +@@ -6,7 +6,7 @@ country 00: + # 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 + (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 + (5170 - 5250 @ 80), (20), AUTO-BW + (5250 - 5330 @ 80), (20), DFS, AUTO-BW + (5490 - 5710 @ 160), (27), DFS ++ # 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 + (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 + (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 + + country RU: DFS-ETSI + (2402 - 2482 @ 40), (20) +- (5170 - 5250 @ 80), (20) +- (5250 - 5330 @ 80), (20), DFS +- (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) + + 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 + (5250 - 5330 @ 80), (20), DFS, AUTO-BW + (5490 - 5710 @ 160), (27), DFS + ++country WS: DFS-ETSI ++ (2402 - 2482 @ 40), (20) ++ (5170 - 5250 @ 40), (20) ++ (5250 - 5330 @ 40), (20), DFS ++ (5490 - 5710 @ 40), (27), DFS ++ + country YE: + (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 ++++ b/package/kernel/mac80211/patches/001-fix_build.patch +@@ -27,7 +27,7 @@ + @set -e ; test -f .local-symbols || ( \ + echo "/--------------" ;\ + echo "| You shouldn't run make in the backports tree, but only in" ;\ +-@@ -60,56 +62,60 @@ mrproper: ++@@ -60,57 +62,61 @@ mrproper: + echo "| (that isn't currently running.)" ;\ + echo "\\--" ;\ + false) +@@ -56,11 +56,12 @@ + - done \ + - ) > Kconfig.kernel ;\ + - kver=$$($(MAKE) --no-print-directory -C $(KLIB_BUILD) kernelversion | \ +-- sed 's/^\(\(3\|2\.6\)\.[0-9]\+\).*/\1/;t;d') ;\ ++- sed 's/^\(\([3-4]\|2\.6\)\.[0-9]\+\).*/\1/;t;d') ;\ + - test "$$kver" != "" || echo "Kernel version parse failed!" ;\ + - test "$$kver" != "" ;\ + - kvers="$$(seq 14 39 | sed 's/^/2.6./')" ;\ +-- kvers="$$kvers $$(seq 0 99 | sed 's/^/3./')" ;\ ++- kvers="$$kvers $$(seq 0 19 | sed 's/^/3./')" ;\ ++- kvers="$$kvers $$(seq 0 99 | sed 's/^/4./')" ;\ + - print=0 ;\ + - for v in $$kvers ; do \ + - if [ "$$print" = "1" ] ; then \ +@@ -111,11 +112,12 @@ + + + +Kconfig.versions: Kconfig.kernel + + @kver=$$($(MAKE) --no-print-directory -C $(KLIB_BUILD) kernelversion | \ +-+ sed 's/^\(\(3\|2\.6\)\.[0-9]\+\).*/\1/;t;d') ;\ +++ sed 's/^\(\([3-4]\|2\.6\)\.[0-9]\+\).*/\1/;t;d') ;\ + + test "$$kver" != "" || echo "Kernel version parse failed!" ;\ + + test "$$kver" != "" ;\ + + kvers="$$(seq 14 39 | sed 's/^/2.6./')" ;\ +-+ kvers="$$kvers $$(seq 0 99 | sed 's/^/3./')" ;\ +++ kvers="$$kvers $$(seq 0 19 | sed 's/^/3./')" ;\ +++ kvers="$$kvers $$(seq 0 99 | sed 's/^/4./')" ;\ + + print=0 ;\ + + for v in $$kvers ; do \ + + if [ "$$print" = "1" ] ; then \ +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 +--- a/package/kernel/mac80211/patches/004-backports_debugfs_fix.patch ++++ /dev/null +@@ -1,10 +0,0 @@ +---- a/backport-include/linux/debugfs.h +-+++ b/backport-include/linux/debugfs.h +-@@ -3,6 +3,7 @@ +- #include_next +- #include +- #include +-+#include +- +- #if defined(CONFIG_DEBUG_FS) +- struct dentry *debugfs_create_devm_seqfile(struct device *dev, const char *name, +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 +--- a/package/kernel/mac80211/patches/008-fix_netdev_unregister.patch ++++ /dev/null +@@ -1,16 +0,0 @@ +---- a/net/mac80211/iface.c +-+++ b/net/mac80211/iface.c +-@@ -1858,6 +1858,13 @@ void ieee80211_remove_interfaces(struct +- } +- mutex_unlock(&local->iflist_mtx); +- unregister_netdevice_many(&unreg_list); +-+#if (!(LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,45) && \ +-+ LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) && \ +-+ !(LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,9) && \ +-+ LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0)) && \ +-+ (LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0))) +-+ list_del(&unreg_list); +-+#endif +- +- list_for_each_entry_safe(sdata, tmp, &wdev_list, list) { +- list_del(&sdata->list); +diff --git a/package/kernel/mac80211/patches/020-add_mpls_h.patch b/package/kernel/mac80211/patches/020-add_mpls_h.patch +deleted file mode 100644 +index e5310bc..0000000 +--- a/package/kernel/mac80211/patches/020-add_mpls_h.patch ++++ /dev/null +@@ -1,37 +0,0 @@ +---- /dev/null +-+++ b/include/uapi/linux/mpls.h +-@@ -0,0 +1,34 @@ +-+#ifndef _UAPI_MPLS_H +-+#define _UAPI_MPLS_H +-+ +-+#include +-+#include +-+ +-+/* Reference: RFC 5462, RFC 3032 +-+ * +-+ * 0 1 2 3 +-+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+ * | Label | TC |S| TTL | +-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+ * +-+ * Label: Label Value, 20 bits +-+ * TC: Traffic Class field, 3 bits +-+ * S: Bottom of Stack, 1 bit +-+ * TTL: Time to Live, 8 bits +-+ */ +-+ +-+struct mpls_label { +-+ __be32 entry; +-+}; +-+ +-+#define MPLS_LS_LABEL_MASK 0xFFFFF000 +-+#define MPLS_LS_LABEL_SHIFT 12 +-+#define MPLS_LS_TC_MASK 0x00000E00 +-+#define MPLS_LS_TC_SHIFT 9 +-+#define MPLS_LS_S_MASK 0x00000100 +-+#define MPLS_LS_S_SHIFT 8 +-+#define MPLS_LS_TTL_MASK 0x000000FF +-+#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/045-bcma-from-4.1.patch b/package/kernel/mac80211/patches/045-bcma-from-4.1.patch +deleted file mode 100644 +index dce217f..0000000 +--- a/package/kernel/mac80211/patches/045-bcma-from-4.1.patch ++++ /dev/null +@@ -1,104 +0,0 @@ +---- a/drivers/bcma/driver_pci.c +-+++ b/drivers/bcma/driver_pci.c +-@@ -282,39 +282,6 @@ void bcma_core_pci_power_save(struct bcm +- } +- EXPORT_SYMBOL_GPL(bcma_core_pci_power_save); +- +--int bcma_core_pci_irq_ctl(struct bcma_bus *bus, struct bcma_device *core, +-- bool enable) +--{ +-- struct pci_dev *pdev; +-- u32 coremask, tmp; +-- int err = 0; +-- +-- if (bus->hosttype != BCMA_HOSTTYPE_PCI) { +-- /* This bcma device is not on a PCI host-bus. So the IRQs are +-- * not routed through the PCI core. +-- * So we must not enable routing through the PCI core. */ +-- goto out; +-- } +-- +-- pdev = bus->host_pci; +-- +-- err = pci_read_config_dword(pdev, BCMA_PCI_IRQMASK, &tmp); +-- if (err) +-- goto out; +-- +-- coremask = BIT(core->core_index) << 8; +-- if (enable) +-- tmp |= coremask; +-- else +-- tmp &= ~coremask; +-- +-- err = pci_write_config_dword(pdev, BCMA_PCI_IRQMASK, tmp); +-- +--out: +-- return err; +--} +--EXPORT_SYMBOL_GPL(bcma_core_pci_irq_ctl); +-- +- static void bcma_core_pci_extend_L1timer(struct bcma_drv_pci *pc, bool extend) +- { +- u32 w; +---- a/drivers/bcma/host_pci.c +-+++ b/drivers/bcma/host_pci.c +-@@ -351,3 +351,37 @@ void bcma_host_pci_down(struct bcma_bus +- bcma_core_pci_down(&bus->drv_pci[0]); +- } +- EXPORT_SYMBOL_GPL(bcma_host_pci_down); +-+ +-+/* See also si_pci_setup */ +-+int bcma_host_pci_irq_ctl(struct bcma_bus *bus, struct bcma_device *core, +-+ bool enable) +-+{ +-+ struct pci_dev *pdev; +-+ u32 coremask, tmp; +-+ int err = 0; +-+ +-+ if (bus->hosttype != BCMA_HOSTTYPE_PCI) { +-+ /* This bcma device is not on a PCI host-bus. So the IRQs are +-+ * not routed through the PCI core. +-+ * So we must not enable routing through the PCI core. */ +-+ goto out; +-+ } +-+ +-+ pdev = bus->host_pci; +-+ +-+ err = pci_read_config_dword(pdev, BCMA_PCI_IRQMASK, &tmp); +-+ if (err) +-+ goto out; +-+ +-+ coremask = BIT(core->core_index) << 8; +-+ if (enable) +-+ tmp |= coremask; +-+ else +-+ tmp &= ~coremask; +-+ +-+ err = pci_write_config_dword(pdev, BCMA_PCI_IRQMASK, tmp); +-+ +-+out: +-+ return err; +-+} +-+EXPORT_SYMBOL_GPL(bcma_host_pci_irq_ctl); +---- a/drivers/net/wireless/b43/main.c +-+++ b/drivers/net/wireless/b43/main.c +-@@ -4866,7 +4866,7 @@ static int b43_wireless_core_init(struct +- switch (dev->dev->bus_type) { +- #ifdef CPTCFG_B43_BCMA +- case B43_BUS_BCMA: +-- bcma_core_pci_irq_ctl(dev->dev->bdev->bus, +-+ bcma_host_pci_irq_ctl(dev->dev->bdev->bus, +- dev->dev->bdev, true); +- bcma_host_pci_up(dev->dev->bdev->bus); +- break; +---- a/drivers/net/wireless/brcm80211/brcmsmac/main.c +-+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c +-@@ -4959,7 +4959,7 @@ static int brcms_b_up_prep(struct brcms_ +- * Configure pci/pcmcia here instead of in brcms_c_attach() +- * to allow mfg hotswap: down, hotswap (chip power cycle), up. +- */ +-- bcma_core_pci_irq_ctl(wlc_hw->d11core->bus, wlc_hw->d11core, +-+ bcma_host_pci_irq_ctl(wlc_hw->d11core->bus, wlc_hw->d11core, +- true); +- +- /* +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 +--- 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 @@ + --- a/.local-symbols + +++ b/.local-symbols +-@@ -344,40 +344,3 @@ USB_CDC_PHONET= ++@@ -449,43 +449,6 @@ USB_CDC_PHONET= + USB_IPHETH= + USB_SIERRA_NET= + USB_VL600= +@@ -32,26 +32,18 @@ + -BCMA_BLOCKIO= + -BCMA_HOST_PCI_POSSIBLE= + -BCMA_HOST_PCI= +--BCMA_DRIVER_PCI_HOSTMODE= + -BCMA_HOST_SOC= + -BCMA_DRIVER_PCI= ++-BCMA_DRIVER_PCI_HOSTMODE= + -BCMA_DRIVER_MIPS= + -BCMA_SFLASH= + -BCMA_NFLASH= + -BCMA_DRIVER_GMAC_CMN= + -BCMA_DRIVER_GPIO= + -BCMA_DEBUG= +---- a/Makefile.kernel +-+++ b/Makefile.kernel +-@@ -38,8 +38,6 @@ obj-$(CPTCFG_MAC80211) += net/mac80211/ +- obj-$(CPTCFG_WLAN) += drivers/net/wireless/ +- #obj-$(CPTCFG_BT) += net/bluetooth/ +- #obj-$(CPTCFG_BT) += drivers/bluetooth/ +--obj-$(CPTCFG_SSB) += drivers/ssb/ +--obj-$(CPTCFG_BCMA) += drivers/bcma/ +- #obj-$(CPTCFG_ETHERNET) += drivers/net/ethernet/ +- obj-$(CPTCFG_USB_NET_RNDIS_WLAN) += drivers/net/usb/ +- #obj-$(CPTCFG_NFC) += net/nfc/ ++ NFC= ++ NFC_DIGITAL= ++ NFC_NCI= + --- a/drivers/net/wireless/b43/main.c + +++ b/drivers/net/wireless/b43/main.c + @@ -2866,7 +2866,7 @@ static struct ssb_device *b43_ssb_gpio_d +@@ -63,7 +55,7 @@ + return (bus->chipco.dev ? bus->chipco.dev : bus->pcicore.dev); + #else + return bus->chipco.dev; +-@@ -4907,7 +4907,7 @@ static int b43_wireless_core_init(struct ++@@ -4903,7 +4903,7 @@ static int b43_wireless_core_init(struct + } + if (sprom->boardflags_lo & B43_BFL_XTAL_NOSLOW) + hf |= B43_HF_DSCRQ; /* Disable slowclock requests from ucode. */ +@@ -116,12 +108,23 @@ + --- a/Kconfig.sources + +++ b/Kconfig.sources + @@ -9,9 +9,6 @@ source "$BACKPORT_DIR/drivers/net/wirele +- #source "$BACKPORT_DIR/drivers/net/ethernet/Kconfig" ++ source "$BACKPORT_DIR/drivers/net/ethernet/Kconfig" + source "$BACKPORT_DIR/drivers/net/usb/Kconfig" + + -source "$BACKPORT_DIR/drivers/ssb/Kconfig" + -source "$BACKPORT_DIR/drivers/bcma/Kconfig" + - +- #source "$BACKPORT_DIR/net/nfc/Kconfig" ++ source "$BACKPORT_DIR/net/nfc/Kconfig" + +- #source "$BACKPORT_DIR/drivers/media/Kconfig" ++ source "$BACKPORT_DIR/drivers/media/Kconfig" ++--- a/Makefile.kernel +++++ b/Makefile.kernel ++@@ -38,8 +38,6 @@ obj-$(CPTCFG_MAC80211) += net/mac80211/ ++ obj-$(CPTCFG_WLAN) += drivers/net/wireless/ ++ obj-$(CPTCFG_BT) += net/bluetooth/ ++ obj-$(CPTCFG_BT) += drivers/bluetooth/ ++-obj-$(CPTCFG_SSB) += drivers/ssb/ ++-obj-$(CPTCFG_BCMA) += drivers/bcma/ ++ 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/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 +--- a/package/kernel/mac80211/patches/090-linux_3_18_12_compat.patch ++++ /dev/null +@@ -1,29 +0,0 @@ +---- a/backport-include/linux/wait.h +-+++ b/backport-include/linux/wait.h +-@@ -23,7 +23,7 @@ backport_wait_on_bit_io(void *word, int +- +- #endif +- +--#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) +-+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,12) +- #define WQ_FLAG_WOKEN 0x02 +- +- #define wait_woken LINUX_BACKPORT(wait_woken) +---- a/compat/backport-3.19.c +-+++ b/compat/backport-3.19.c +-@@ -15,6 +15,7 @@ +- #include +- #include +- +-+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,12) +- static inline bool is_kthread_should_stop(void) +- { +- return (current->flags & PF_KTHREAD) && kthread_should_stop(); +-@@ -79,6 +80,7 @@ int woken_wake_function(wait_queue_t *wa +- return default_wake_function(wait, mode, sync, key); +- } +- EXPORT_SYMBOL(woken_wake_function); +-+#endif +- +- #ifdef __BACKPORT_NETDEV_RSS_KEY_FILL +- 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 +--- /dev/null ++++ b/package/kernel/mac80211/patches/100-remove-cryptoapi-dependencies.patch +@@ -0,0 +1,376 @@ ++--- a/net/mac80211/Kconfig +++++ b/net/mac80211/Kconfig ++@@ -5,8 +5,6 @@ config MAC80211 ++ depends on CRYPTO ++ depends on CRYPTO_ARC4 ++ depends on CRYPTO_AES ++- select BPAUTO_CRYPTO_CCM ++- depends on CRYPTO_GCM ++ depends on CRC32 ++ select BPAUTO_AVERAGE ++ ---help--- ++--- a/net/mac80211/Makefile +++++ b/net/mac80211/Makefile ++@@ -15,9 +15,7 @@ mac80211-y := \ ++ michael.o \ ++ tkip.o \ ++ aes_ccm.o \ ++- aes_gcm.o \ ++ aes_cmac.o \ ++- aes_gmac.o \ ++ cfg.o \ ++ ethtool.o \ ++ rx.o \ ++--- a/net/mac80211/aes_ccm.c +++++ b/net/mac80211/aes_ccm.c ++@@ -13,89 +13,132 @@ ++ #include ++ #include ++ #include +++#include ++ ++ #include ++ #include "key.h" ++ #include "aes_ccm.h" ++ ++-void ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, ++- u8 *data, size_t data_len, u8 *mic, ++- size_t mic_len) +++static void aes_ccm_prepare(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, u8 *s_0, +++ u8 *a, u8 *b) ++ { ++- struct scatterlist sg[3]; +++ int i; +++ +++ crypto_cipher_encrypt_one(tfm, b, b_0); +++ +++ /* Extra Authenticate-only data (always two AES blocks) */ +++ for (i = 0; i < AES_BLOCK_SIZE; i++) +++ aad[i] ^= b[i]; +++ crypto_cipher_encrypt_one(tfm, b, aad); +++ +++ aad += AES_BLOCK_SIZE; +++ +++ for (i = 0; i < AES_BLOCK_SIZE; i++) +++ aad[i] ^= b[i]; +++ crypto_cipher_encrypt_one(tfm, a, aad); ++ ++- char aead_req_data[sizeof(struct aead_request) + ++- crypto_aead_reqsize(tfm)] ++- __aligned(__alignof__(struct aead_request)); ++- struct aead_request *aead_req = (void *) aead_req_data; +++ /* Mask out bits from auth-only-b_0 */ +++ b_0[0] &= 0x07; ++ ++- memset(aead_req, 0, sizeof(aead_req_data)); +++ /* S_0 is used to encrypt T (= MIC) */ +++ b_0[14] = 0; +++ b_0[15] = 0; +++ crypto_cipher_encrypt_one(tfm, s_0, b_0); +++} ++ ++- sg_init_table(sg, 3); ++- sg_set_buf(&sg[0], &aad[2], be16_to_cpup((__be16 *)aad)); ++- sg_set_buf(&sg[1], data, data_len); ++- sg_set_buf(&sg[2], mic, mic_len); ++ ++- aead_request_set_tfm(aead_req, tfm); ++- aead_request_set_crypt(aead_req, sg, sg, data_len, b_0); ++- aead_request_set_ad(aead_req, sg[0].length); +++void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, +++ u8 *data, size_t data_len, u8 *mic, +++ size_t mic_len) +++{ +++ int i, j, last_len, num_blocks; +++ u8 b[AES_BLOCK_SIZE]; +++ u8 s_0[AES_BLOCK_SIZE]; +++ u8 e[AES_BLOCK_SIZE]; +++ u8 *pos, *cpos; +++ +++ num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_SIZE); +++ last_len = data_len % AES_BLOCK_SIZE; +++ aes_ccm_prepare(tfm, b_0, aad, s_0, b, b); +++ +++ /* Process payload blocks */ +++ pos = data; +++ cpos = data; +++ for (j = 1; j <= num_blocks; j++) { +++ int blen = (j == num_blocks && last_len) ? +++ last_len : AES_BLOCK_SIZE; +++ +++ /* Authentication followed by encryption */ +++ for (i = 0; i < blen; i++) +++ b[i] ^= pos[i]; +++ crypto_cipher_encrypt_one(tfm, b, b); +++ +++ b_0[14] = (j >> 8) & 0xff; +++ b_0[15] = j & 0xff; +++ crypto_cipher_encrypt_one(tfm, e, b_0); +++ for (i = 0; i < blen; i++) +++ *cpos++ = *pos++ ^ e[i]; +++ } ++ ++- crypto_aead_encrypt(aead_req); +++ for (i = 0; i < mic_len; i++) +++ mic[i] = b[i] ^ s_0[i]; ++ } ++ ++-int ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, +++int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, ++ u8 *data, size_t data_len, u8 *mic, ++ size_t mic_len) ++ { ++- struct scatterlist sg[3]; ++- char aead_req_data[sizeof(struct aead_request) + ++- crypto_aead_reqsize(tfm)] ++- __aligned(__alignof__(struct aead_request)); ++- struct aead_request *aead_req = (void *) aead_req_data; ++- ++- if (data_len == 0) ++- return -EINVAL; ++- ++- memset(aead_req, 0, sizeof(aead_req_data)); ++- ++- sg_init_table(sg, 3); ++- sg_set_buf(&sg[0], &aad[2], be16_to_cpup((__be16 *)aad)); ++- sg_set_buf(&sg[1], data, data_len); ++- sg_set_buf(&sg[2], mic, mic_len); ++- ++- aead_request_set_tfm(aead_req, tfm); ++- aead_request_set_crypt(aead_req, sg, sg, data_len + mic_len, b_0); ++- aead_request_set_ad(aead_req, sg[0].length); +++ int i, j, last_len, num_blocks; +++ u8 *pos, *cpos; +++ u8 a[AES_BLOCK_SIZE]; +++ u8 b[AES_BLOCK_SIZE]; +++ u8 s_0[AES_BLOCK_SIZE]; +++ +++ num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_SIZE); +++ last_len = data_len % AES_BLOCK_SIZE; +++ aes_ccm_prepare(tfm, b_0, aad, s_0, a, b); +++ +++ /* Process payload blocks */ +++ cpos = data; +++ pos = data; +++ for (j = 1; j <= num_blocks; j++) { +++ int blen = (j == num_blocks && last_len) ? +++ last_len : AES_BLOCK_SIZE; +++ +++ /* Decryption followed by authentication */ +++ b_0[14] = (j >> 8) & 0xff; +++ b_0[15] = j & 0xff; +++ crypto_cipher_encrypt_one(tfm, b, b_0); +++ for (i = 0; i < blen; i++) { +++ *pos = *cpos++ ^ b[i]; +++ a[i] ^= *pos++; +++ } +++ crypto_cipher_encrypt_one(tfm, a, a); +++ } +++ +++ for (i = 0; i < mic_len; i++) { +++ if ((mic[i] ^ s_0[i]) != a[i]) +++ return -1; +++ } ++ ++- return crypto_aead_decrypt(aead_req); +++ return 0; ++ } ++ ++-struct crypto_aead *ieee80211_aes_key_setup_encrypt(const u8 key[], ++- size_t key_len, ++- size_t mic_len) +++struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[], +++ size_t key_len, +++ size_t mic_len) ++ { ++- struct crypto_aead *tfm; ++- int err; +++ struct crypto_cipher *tfm; ++ ++- tfm = crypto_alloc_aead("ccm(aes)", 0, CRYPTO_ALG_ASYNC); ++- if (IS_ERR(tfm)) ++- return tfm; ++- ++- err = crypto_aead_setkey(tfm, key, key_len); ++- if (err) ++- goto free_aead; ++- err = crypto_aead_setauthsize(tfm, mic_len); ++- if (err) ++- goto free_aead; +++ tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC); +++ if (!IS_ERR(tfm)) +++ crypto_cipher_setkey(tfm, key, key_len); ++ ++ return tfm; ++- ++-free_aead: ++- crypto_free_aead(tfm); ++- return ERR_PTR(err); ++ } ++ ++-void ieee80211_aes_key_free(struct crypto_aead *tfm) +++ +++void ieee80211_aes_key_free(struct crypto_cipher *tfm) ++ { ++- crypto_free_aead(tfm); +++ crypto_free_cipher(tfm); ++ } ++--- a/net/mac80211/aes_ccm.h +++++ b/net/mac80211/aes_ccm.h ++@@ -12,15 +12,15 @@ ++ ++ #include ++ ++-struct crypto_aead *ieee80211_aes_key_setup_encrypt(const u8 key[], ++- size_t key_len, ++- size_t mic_len); ++-void ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, +++struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[], +++ size_t key_len, +++ size_t mic_len); +++void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, ++ u8 *data, size_t data_len, u8 *mic, ++ size_t mic_len); ++-int ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, +++int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, ++ u8 *data, size_t data_len, u8 *mic, ++ size_t mic_len); ++-void ieee80211_aes_key_free(struct crypto_aead *tfm); +++void ieee80211_aes_key_free(struct crypto_cipher *tfm); ++ ++ #endif /* AES_CCM_H */ ++--- a/net/mac80211/aes_gcm.h +++++ b/net/mac80211/aes_gcm.h ++@@ -11,12 +11,28 @@ ++ ++ #include ++ ++-void ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, ++- u8 *data, size_t data_len, u8 *mic); ++-int ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, ++- u8 *data, size_t data_len, u8 *mic); ++-struct crypto_aead *ieee80211_aes_gcm_key_setup_encrypt(const u8 key[], ++- size_t key_len); ++-void ieee80211_aes_gcm_key_free(struct crypto_aead *tfm); +++static inline void +++ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, +++ u8 *data, size_t data_len, u8 *mic) +++{ +++} +++ +++static inline int +++ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, +++ u8 *data, size_t data_len, u8 *mic) +++{ +++ return -EOPNOTSUPP; +++} +++ +++static inline struct crypto_aead * +++ieee80211_aes_gcm_key_setup_encrypt(const u8 key[], size_t key_len) +++{ +++ return NULL; +++} +++ +++static inline void +++ieee80211_aes_gcm_key_free(struct crypto_aead *tfm) +++{ +++} ++ ++ #endif /* AES_GCM_H */ ++--- a/net/mac80211/aes_gmac.h +++++ b/net/mac80211/aes_gmac.h ++@@ -11,10 +11,22 @@ ++ ++ #include ++ ++-struct crypto_aead *ieee80211_aes_gmac_key_setup(const u8 key[], ++- size_t key_len); ++-int ieee80211_aes_gmac(struct crypto_aead *tfm, const u8 *aad, u8 *nonce, ++- const u8 *data, size_t data_len, u8 *mic); ++-void ieee80211_aes_gmac_key_free(struct crypto_aead *tfm); +++static inline struct crypto_aead * +++ieee80211_aes_gmac_key_setup(const u8 key[], size_t key_len) +++{ +++ return NULL; +++} +++ +++static inline int +++ieee80211_aes_gmac(struct crypto_aead *tfm, const u8 *aad, u8 *nonce, +++ const u8 *data, size_t data_len, u8 *mic) +++{ +++ return -EOPNOTSUPP; +++} +++ +++static inline void +++ieee80211_aes_gmac_key_free(struct crypto_aead *tfm) +++{ +++} ++ ++ #endif /* AES_GMAC_H */ ++--- a/net/mac80211/key.h +++++ b/net/mac80211/key.h ++@@ -84,7 +84,7 @@ struct ieee80211_key { ++ * Management frames. ++ */ ++ u8 rx_pn[IEEE80211_NUM_TIDS + 1][IEEE80211_CCMP_PN_LEN]; ++- struct crypto_aead *tfm; +++ struct crypto_cipher *tfm; ++ u32 replays; /* dot11RSNAStatsCCMPReplays */ ++ } ccmp; ++ struct { ++--- a/net/mac80211/wpa.c +++++ b/net/mac80211/wpa.c ++@@ -304,7 +304,8 @@ ieee80211_crypto_tkip_decrypt(struct iee ++ } ++ ++ ++-static void ccmp_special_blocks(struct sk_buff *skb, u8 *pn, u8 *b_0, u8 *aad) +++static void ccmp_special_blocks(struct sk_buff *skb, u8 *pn, u8 *b_0, u8 *aad, +++ u16 data_len) ++ { ++ __le16 mask_fc; ++ int a4_included, mgmt; ++@@ -334,14 +335,8 @@ static void ccmp_special_blocks(struct s ++ else ++ qos_tid = 0; ++ ++- /* In CCM, the initial vectors (IV) used for CTR mode encryption and CBC ++- * mode authentication are not allowed to collide, yet both are derived ++- * from this vector b_0. We only set L := 1 here to indicate that the ++- * data size can be represented in (L+1) bytes. The CCM layer will take ++- * care of storing the data length in the top (L+1) bytes and setting ++- * and clearing the other bits as is required to derive the two IVs. ++- */ ++- b_0[0] = 0x1; +++ /* First block, b_0 */ +++ b_0[0] = 0x59; /* flags: Adata: 1, M: 011, L: 001 */ ++ ++ /* 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 ++ b_0[1] = qos_tid | (mgmt << 4); ++ memcpy(&b_0[2], hdr->addr2, ETH_ALEN); ++ memcpy(&b_0[8], pn, IEEE80211_CCMP_PN_LEN); +++ /* l(m) */ +++ put_unaligned_be16(data_len, &b_0[14]); ++ ++ /* 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 ++ return 0; ++ ++ pos += IEEE80211_CCMP_HDR_LEN; ++- ccmp_special_blocks(skb, pn, b_0, aad); +++ ccmp_special_blocks(skb, pn, b_0, aad, len); ++ 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 ++ u8 aad[2 * AES_BLOCK_SIZE]; ++ u8 b_0[AES_BLOCK_SIZE]; ++ /* hardware didn't decrypt/verify MIC */ ++- ccmp_special_blocks(skb, pn, b_0, aad); +++ ccmp_special_blocks(skb, pn, b_0, aad, data_len); ++ ++ if (ieee80211_aes_ccm_decrypt( ++ key->u.ccmp.tfm, b_0, aad, +diff --git a/package/kernel/mac80211/patches/100-revert-cryptoapi-ports.patch b/package/kernel/mac80211/patches/100-revert-cryptoapi-ports.patch +deleted file mode 100644 +index ceca952..0000000 +--- a/package/kernel/mac80211/patches/100-revert-cryptoapi-ports.patch ++++ /dev/null +@@ -1,2055 +0,0 @@ +-This patch reverts the following commits from wireless-testing: +- +-8ade538bf39b1ee53418528fdacd36b8e65621b9 +-56c52da2d554f081e8fce58ecbcf6a40c605b95b +-2b2ba0db1c820d04d5143452d70012cd44d7b578 +-00b9cfa3ff38401bd70c34b250ca13e5ea347b4a +-4f031fa9f188b2b0641ac20087d9e16bcfb4e49d +-6e1ee5d2e9e411892b5d84e3ea93e3fc88ac786c +-30ef7ef9672d92ab2cac37f60a31955c118321e7 +-f359d3fe832e49eeec2232b2af5a9e3aee6b4862 (only the changes in aes_cmac.{c,h}) +-7ec7c4a9a686c608315739ab6a2b0527a240883c +---- +- +---- a/include/linux/ieee80211.h +-+++ b/include/linux/ieee80211.h +-@@ -1017,15 +1017,6 @@ struct ieee80211_mmie { +- u8 mic[8]; +- } __packed; +- +--/* Management MIC information element (IEEE 802.11w) for GMAC and CMAC-256 */ +--struct ieee80211_mmie_16 { +-- u8 element_id; +-- u8 length; +-- __le16 key_id; +-- u8 sequence_number[6]; +-- u8 mic[16]; +--} __packed; +-- +- struct ieee80211_vendor_ie { +- u8 element_id; +- u8 len; +---- a/include/net/mac80211.h +-+++ b/include/net/mac80211.h +-@@ -1306,8 +1306,8 @@ struct ieee80211_vif *wdev_to_ieee80211_ +- * @IEEE80211_KEY_FLAG_PAIRWISE: Set by mac80211, this flag indicates +- * that the key is pairwise rather then a shared key. +- * @IEEE80211_KEY_FLAG_SW_MGMT_TX: This flag should be set by the driver for a +-- * CCMP/GCMP key if it requires CCMP/GCMP encryption of management frames +-- * (MFP) to be done in software. +-+ * CCMP key if it requires CCMP encryption of management frames (MFP) to +-+ * be done in software. +- * @IEEE80211_KEY_FLAG_PUT_IV_SPACE: This flag should be set by the driver +- * if space should be prepared for the IV, but the IV +- * itself should not be generated. Do not set together with +-@@ -1322,7 +1322,7 @@ struct ieee80211_vif *wdev_to_ieee80211_ +- * RX, if your crypto engine can't deal with TX you can also set the +- * %IEEE80211_KEY_FLAG_SW_MGMT_TX flag to encrypt such frames in SW. +- * @IEEE80211_KEY_FLAG_GENERATE_IV_MGMT: This flag should be set by the +-- * driver for a CCMP/GCMP key to indicate that is requires IV generation +-+ * driver for a CCMP key to indicate that is requires IV generation +- * only for managment frames (MFP). +- * @IEEE80211_KEY_FLAG_RESERVE_TAILROOM: This flag should be set by the +- * driver for a key to indicate that sufficient tailroom must always +-@@ -4112,10 +4112,6 @@ void ieee80211_aes_cmac_calculate_k1_k2( +- * reverse order than in packet) +- * @aes_cmac: PN data, most significant byte first (big endian, +- * reverse order than in packet) +-- * @aes_gmac: PN data, most significant byte first (big endian, +-- * reverse order than in packet) +-- * @gcmp: PN data, most significant byte first (big endian, +-- * reverse order than in packet) +- */ +- struct ieee80211_key_seq { +- union { +-@@ -4129,12 +4125,6 @@ struct ieee80211_key_seq { +- struct { +- u8 pn[6]; +- } aes_cmac; +-- struct { +-- u8 pn[6]; +-- } aes_gmac; +-- struct { +-- u8 pn[6]; +-- } gcmp; +- }; +- }; +- +-@@ -4159,7 +4149,7 @@ void ieee80211_get_key_tx_seq(struct iee +- * ieee80211_get_key_rx_seq - get key RX sequence counter +- * +- * @keyconf: the parameter passed with the set key +-- * @tid: The TID, or -1 for the management frame value (CCMP/GCMP only); +-+ * @tid: The TID, or -1 for the management frame value (CCMP only); +- * the value on TID 0 is also used for non-QoS frames. For +- * CMAC, only TID 0 is valid. +- * @seq: buffer to receive the sequence data +-@@ -4195,7 +4185,7 @@ void ieee80211_set_key_tx_seq(struct iee +- * ieee80211_set_key_rx_seq - set key RX sequence counter +- * +- * @keyconf: the parameter passed with the set key +-- * @tid: The TID, or -1 for the management frame value (CCMP/GCMP only); +-+ * @tid: The TID, or -1 for the management frame value (CCMP only); +- * the value on TID 0 is also used for non-QoS frames. For +- * CMAC, only TID 0 is valid. +- * @seq: new sequence data +---- a/net/mac80211/Kconfig +-+++ b/net/mac80211/Kconfig +-@@ -5,8 +5,6 @@ config MAC80211 +- depends on CRYPTO +- depends on CRYPTO_ARC4 +- depends on CRYPTO_AES +-- select BPAUTO_CRYPTO_CCM +-- depends on CRYPTO_GCM +- depends on CRC32 +- select BPAUTO_AVERAGE +- ---help--- +---- a/net/mac80211/Makefile +-+++ b/net/mac80211/Makefile +-@@ -15,9 +15,7 @@ mac80211-y := \ +- michael.o \ +- tkip.o \ +- aes_ccm.o \ +-- aes_gcm.o \ +- aes_cmac.o \ +-- aes_gmac.o \ +- cfg.o \ +- ethtool.o \ +- rx.o \ +---- a/net/mac80211/aes_ccm.c +-+++ b/net/mac80211/aes_ccm.c +-@@ -2,8 +2,6 @@ +- * Copyright 2003-2004, Instant802 Networks, Inc. +- * Copyright 2005-2006, Devicescape Software, Inc. +- * +-- * Rewrite: Copyright (C) 2013 Linaro Ltd +-- * +- * 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. +-@@ -19,82 +17,134 @@ +- #include "key.h" +- #include "aes_ccm.h" +- +--void ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, +-- u8 *data, size_t data_len, u8 *mic, +-- size_t mic_len) +-+static void aes_ccm_prepare(struct crypto_cipher *tfm, u8 *scratch, u8 *a) +-+{ +-+ int i; +-+ u8 *b_0, *aad, *b, *s_0; +-+ +-+ b_0 = scratch + 3 * AES_BLOCK_SIZE; +-+ aad = scratch + 4 * AES_BLOCK_SIZE; +-+ b = scratch; +-+ s_0 = scratch + AES_BLOCK_SIZE; +-+ +-+ crypto_cipher_encrypt_one(tfm, b, b_0); +-+ +-+ /* Extra Authenticate-only data (always two AES blocks) */ +-+ for (i = 0; i < AES_BLOCK_SIZE; i++) +-+ aad[i] ^= b[i]; +-+ crypto_cipher_encrypt_one(tfm, b, aad); +-+ +-+ aad += AES_BLOCK_SIZE; +-+ +-+ for (i = 0; i < AES_BLOCK_SIZE; i++) +-+ aad[i] ^= b[i]; +-+ crypto_cipher_encrypt_one(tfm, a, aad); +-+ +-+ /* Mask out bits from auth-only-b_0 */ +-+ b_0[0] &= 0x07; +-+ +-+ /* S_0 is used to encrypt T (= MIC) */ +-+ b_0[14] = 0; +-+ b_0[15] = 0; +-+ crypto_cipher_encrypt_one(tfm, s_0, b_0); +-+} +-+ +-+ +-+void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *scratch, +-+ u8 *data, size_t data_len, +-+ u8 *cdata, u8 *mic) +- { +-- struct scatterlist assoc, pt, ct[2]; +-+ int i, j, last_len, num_blocks; +-+ u8 *pos, *cpos, *b, *s_0, *e, *b_0; +- +-- char aead_req_data[sizeof(struct aead_request) + +-- crypto_aead_reqsize(tfm)] +-- __aligned(__alignof__(struct aead_request)); +-- struct aead_request *aead_req = (void *) aead_req_data; +-- +-- memset(aead_req, 0, sizeof(aead_req_data)); +-- +-- sg_init_one(&pt, data, data_len); +-- sg_init_one(&assoc, &aad[2], be16_to_cpup((__be16 *)aad)); +-- sg_init_table(ct, 2); +-- sg_set_buf(&ct[0], data, data_len); +-- sg_set_buf(&ct[1], mic, mic_len); +-- +-- aead_request_set_tfm(aead_req, tfm); +-- aead_request_set_assoc(aead_req, &assoc, assoc.length); +-- aead_request_set_crypt(aead_req, &pt, ct, data_len, b_0); +-+ b = scratch; +-+ s_0 = scratch + AES_BLOCK_SIZE; +-+ e = scratch + 2 * AES_BLOCK_SIZE; +-+ b_0 = scratch + 3 * AES_BLOCK_SIZE; +-+ +-+ num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_SIZE); +-+ last_len = data_len % AES_BLOCK_SIZE; +-+ aes_ccm_prepare(tfm, scratch, b); +-+ +-+ /* Process payload blocks */ +-+ pos = data; +-+ cpos = cdata; +-+ for (j = 1; j <= num_blocks; j++) { +-+ int blen = (j == num_blocks && last_len) ? +-+ last_len : AES_BLOCK_SIZE; +-+ +-+ /* Authentication followed by encryption */ +-+ for (i = 0; i < blen; i++) +-+ b[i] ^= pos[i]; +-+ crypto_cipher_encrypt_one(tfm, b, b); +-+ +-+ b_0[14] = (j >> 8) & 0xff; +-+ b_0[15] = j & 0xff; +-+ crypto_cipher_encrypt_one(tfm, e, b_0); +-+ for (i = 0; i < blen; i++) +-+ *cpos++ = *pos++ ^ e[i]; +-+ } +- +-- crypto_aead_encrypt(aead_req); +-+ for (i = 0; i < IEEE80211_CCMP_MIC_LEN; i++) +-+ mic[i] = b[i] ^ s_0[i]; +- } +- +--int ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, +-- u8 *data, size_t data_len, u8 *mic, +-- size_t mic_len) +-+ +-+int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *scratch, +-+ u8 *cdata, size_t data_len, u8 *mic, u8 *data) +- { +-- struct scatterlist assoc, pt, ct[2]; +-- char aead_req_data[sizeof(struct aead_request) + +-- crypto_aead_reqsize(tfm)] +-- __aligned(__alignof__(struct aead_request)); +-- struct aead_request *aead_req = (void *) aead_req_data; +-- +-- if (data_len == 0) +-- return -EINVAL; +-- +-- memset(aead_req, 0, sizeof(aead_req_data)); +-- +-- sg_init_one(&pt, data, data_len); +-- sg_init_one(&assoc, &aad[2], be16_to_cpup((__be16 *)aad)); +-- sg_init_table(ct, 2); +-- sg_set_buf(&ct[0], data, data_len); +-- sg_set_buf(&ct[1], mic, mic_len); +-- +-- aead_request_set_tfm(aead_req, tfm); +-- aead_request_set_assoc(aead_req, &assoc, assoc.length); +-- aead_request_set_crypt(aead_req, ct, &pt, data_len + mic_len, b_0); +-+ int i, j, last_len, num_blocks; +-+ u8 *pos, *cpos, *b, *s_0, *a, *b_0; +-+ +-+ b = scratch; +-+ s_0 = scratch + AES_BLOCK_SIZE; +-+ a = scratch + 2 * AES_BLOCK_SIZE; +-+ b_0 = scratch + 3 * AES_BLOCK_SIZE; +-+ +-+ num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_SIZE); +-+ last_len = data_len % AES_BLOCK_SIZE; +-+ aes_ccm_prepare(tfm, scratch, a); +-+ +-+ /* Process payload blocks */ +-+ cpos = cdata; +-+ pos = data; +-+ for (j = 1; j <= num_blocks; j++) { +-+ int blen = (j == num_blocks && last_len) ? +-+ last_len : AES_BLOCK_SIZE; +-+ +-+ /* Decryption followed by authentication */ +-+ b_0[14] = (j >> 8) & 0xff; +-+ b_0[15] = j & 0xff; +-+ crypto_cipher_encrypt_one(tfm, b, b_0); +-+ for (i = 0; i < blen; i++) { +-+ *pos = *cpos++ ^ b[i]; +-+ a[i] ^= *pos++; +-+ } +-+ crypto_cipher_encrypt_one(tfm, a, a); +-+ } +-+ +-+ for (i = 0; i < IEEE80211_CCMP_MIC_LEN; i++) { +-+ if ((mic[i] ^ s_0[i]) != a[i]) +-+ return -1; +-+ } +- +-- return crypto_aead_decrypt(aead_req); +-+ return 0; +- } +- +--struct crypto_aead *ieee80211_aes_key_setup_encrypt(const u8 key[], +-- size_t key_len, +-- size_t mic_len) +-+ +-+struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[]) +- { +-- struct crypto_aead *tfm; +-- int err; +-+ struct crypto_cipher *tfm; +- +-- tfm = crypto_alloc_aead("ccm(aes)", 0, CRYPTO_ALG_ASYNC); +-- if (IS_ERR(tfm)) +-- return tfm; +-- +-- err = crypto_aead_setkey(tfm, key, key_len); +-- if (!err) +-- err = crypto_aead_setauthsize(tfm, mic_len); +-- if (!err) +-- return tfm; +-+ tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC); +-+ if (!IS_ERR(tfm)) +-+ crypto_cipher_setkey(tfm, key, WLAN_KEY_LEN_CCMP); +- +-- crypto_free_aead(tfm); +-- return ERR_PTR(err); +-+ return tfm; +- } +- +--void ieee80211_aes_key_free(struct crypto_aead *tfm) +-+ +-+void ieee80211_aes_key_free(struct crypto_cipher *tfm) +- { +-- crypto_free_aead(tfm); +-+ crypto_free_cipher(tfm); +- } +---- a/net/mac80211/aes_ccm.h +-+++ b/net/mac80211/aes_ccm.h +-@@ -12,15 +12,13 @@ +- +- #include +- +--struct crypto_aead *ieee80211_aes_key_setup_encrypt(const u8 key[], +-- size_t key_len, +-- size_t mic_len); +--void ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, +-- u8 *data, size_t data_len, u8 *mic, +-- size_t mic_len); +--int ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, +-- u8 *data, size_t data_len, u8 *mic, +-- size_t mic_len); +--void ieee80211_aes_key_free(struct crypto_aead *tfm); +-+struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[]); +-+void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *scratch, +-+ u8 *data, size_t data_len, +-+ u8 *cdata, u8 *mic); +-+int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *scratch, +-+ u8 *cdata, size_t data_len, +-+ u8 *mic, u8 *data); +-+void ieee80211_aes_key_free(struct crypto_cipher *tfm); +- +- #endif /* AES_CCM_H */ +---- a/net/mac80211/aes_cmac.c +-+++ b/net/mac80211/aes_cmac.c +-@@ -18,8 +18,8 @@ +- #include "key.h" +- #include "aes_cmac.h" +- +-+#define AES_CMAC_KEY_LEN 16 +- #define CMAC_TLEN 8 /* CMAC TLen = 64 bits (8 octets) */ +--#define CMAC_TLEN_256 16 /* CMAC TLen = 128 bits (16 octets) */ +- #define AAD_LEN 20 +- +- +-@@ -35,9 +35,9 @@ static void gf_mulx(u8 *pad) +- pad[AES_BLOCK_SIZE - 1] ^= 0x87; +- } +- +--static void aes_cmac_vector(struct crypto_cipher *tfm, size_t num_elem, +-- const u8 *addr[], const size_t *len, u8 *mac, +-- size_t mac_len) +-+ +-+static void aes_128_cmac_vector(struct crypto_cipher *tfm, size_t num_elem, +-+ const u8 *addr[], const size_t *len, u8 *mac) +- { +- u8 cbc[AES_BLOCK_SIZE], pad[AES_BLOCK_SIZE]; +- const u8 *pos, *end; +-@@ -88,7 +88,7 @@ static void aes_cmac_vector(struct crypt +- for (i = 0; i < AES_BLOCK_SIZE; i++) +- pad[i] ^= cbc[i]; +- crypto_cipher_encrypt_one(tfm, pad, pad); +-- memcpy(mac, pad, mac_len); +-+ memcpy(mac, pad, CMAC_TLEN); +- } +- +- +-@@ -107,35 +107,17 @@ void ieee80211_aes_cmac(struct crypto_ci +- addr[2] = zero; +- len[2] = CMAC_TLEN; +- +-- aes_cmac_vector(tfm, 3, addr, len, mic, CMAC_TLEN); +-+ aes_128_cmac_vector(tfm, 3, addr, len, mic); +- } +- +--void ieee80211_aes_cmac_256(struct crypto_cipher *tfm, const u8 *aad, +-- const u8 *data, size_t data_len, u8 *mic) +--{ +-- const u8 *addr[3]; +-- size_t len[3]; +-- u8 zero[CMAC_TLEN_256]; +-- +-- memset(zero, 0, CMAC_TLEN_256); +-- addr[0] = aad; +-- len[0] = AAD_LEN; +-- addr[1] = data; +-- len[1] = data_len - CMAC_TLEN_256; +-- addr[2] = zero; +-- len[2] = CMAC_TLEN_256; +-- +-- aes_cmac_vector(tfm, 3, addr, len, mic, CMAC_TLEN_256); +--} +- +--struct crypto_cipher *ieee80211_aes_cmac_key_setup(const u8 key[], +-- size_t key_len) +-+struct crypto_cipher * ieee80211_aes_cmac_key_setup(const u8 key[]) +- { +- struct crypto_cipher *tfm; +- +- tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC); +- if (!IS_ERR(tfm)) +-- crypto_cipher_setkey(tfm, key, key_len); +-+ crypto_cipher_setkey(tfm, key, AES_CMAC_KEY_LEN); +- +- return tfm; +- } +---- a/net/mac80211/aes_cmac.h +-+++ b/net/mac80211/aes_cmac.h +-@@ -11,12 +11,9 @@ +- +- #include +- +--struct crypto_cipher *ieee80211_aes_cmac_key_setup(const u8 key[], +-- size_t key_len); +-+struct crypto_cipher * ieee80211_aes_cmac_key_setup(const u8 key[]); +- void ieee80211_aes_cmac(struct crypto_cipher *tfm, const u8 *aad, +- const u8 *data, size_t data_len, u8 *mic); +--void ieee80211_aes_cmac_256(struct crypto_cipher *tfm, const u8 *aad, +-- const u8 *data, size_t data_len, u8 *mic); +- void ieee80211_aes_cmac_key_free(struct crypto_cipher *tfm); +- +- #endif /* AES_CMAC_H */ +---- a/net/mac80211/aes_gcm.c +-+++ /dev/null +-@@ -1,95 +0,0 @@ +--/* +-- * Copyright 2014-2015, Qualcomm Atheros, Inc. +-- * +-- * 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 +--#include +--#include +--#include +-- +--#include +--#include "key.h" +--#include "aes_gcm.h" +-- +--void ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, +-- u8 *data, size_t data_len, u8 *mic) +--{ +-- struct scatterlist assoc, pt, ct[2]; +-- +-- char aead_req_data[sizeof(struct aead_request) + +-- crypto_aead_reqsize(tfm)] +-- __aligned(__alignof__(struct aead_request)); +-- struct aead_request *aead_req = (void *)aead_req_data; +-- +-- memset(aead_req, 0, sizeof(aead_req_data)); +-- +-- sg_init_one(&pt, data, data_len); +-- sg_init_one(&assoc, &aad[2], be16_to_cpup((__be16 *)aad)); +-- sg_init_table(ct, 2); +-- sg_set_buf(&ct[0], data, data_len); +-- sg_set_buf(&ct[1], mic, IEEE80211_GCMP_MIC_LEN); +-- +-- aead_request_set_tfm(aead_req, tfm); +-- aead_request_set_assoc(aead_req, &assoc, assoc.length); +-- aead_request_set_crypt(aead_req, &pt, ct, data_len, j_0); +-- +-- crypto_aead_encrypt(aead_req); +--} +-- +--int ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, +-- u8 *data, size_t data_len, u8 *mic) +--{ +-- struct scatterlist assoc, pt, ct[2]; +-- char aead_req_data[sizeof(struct aead_request) + +-- crypto_aead_reqsize(tfm)] +-- __aligned(__alignof__(struct aead_request)); +-- struct aead_request *aead_req = (void *)aead_req_data; +-- +-- if (data_len == 0) +-- return -EINVAL; +-- +-- memset(aead_req, 0, sizeof(aead_req_data)); +-- +-- sg_init_one(&pt, data, data_len); +-- sg_init_one(&assoc, &aad[2], be16_to_cpup((__be16 *)aad)); +-- sg_init_table(ct, 2); +-- sg_set_buf(&ct[0], data, data_len); +-- sg_set_buf(&ct[1], mic, IEEE80211_GCMP_MIC_LEN); +-- +-- aead_request_set_tfm(aead_req, tfm); +-- aead_request_set_assoc(aead_req, &assoc, assoc.length); +-- aead_request_set_crypt(aead_req, ct, &pt, +-- data_len + IEEE80211_GCMP_MIC_LEN, j_0); +-- +-- return crypto_aead_decrypt(aead_req); +--} +-- +--struct crypto_aead *ieee80211_aes_gcm_key_setup_encrypt(const u8 key[], +-- size_t key_len) +--{ +-- struct crypto_aead *tfm; +-- int err; +-- +-- tfm = crypto_alloc_aead("gcm(aes)", 0, CRYPTO_ALG_ASYNC); +-- if (IS_ERR(tfm)) +-- return tfm; +-- +-- err = crypto_aead_setkey(tfm, key, key_len); +-- if (!err) +-- err = crypto_aead_setauthsize(tfm, IEEE80211_GCMP_MIC_LEN); +-- if (!err) +-- return tfm; +-- +-- crypto_free_aead(tfm); +-- return ERR_PTR(err); +--} +-- +--void ieee80211_aes_gcm_key_free(struct crypto_aead *tfm) +--{ +-- crypto_free_aead(tfm); +--} +---- a/net/mac80211/aes_gcm.h +-+++ /dev/null +-@@ -1,22 +0,0 @@ +--/* +-- * Copyright 2014-2015, Qualcomm Atheros, Inc. +-- * +-- * 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. +-- */ +-- +--#ifndef AES_GCM_H +--#define AES_GCM_H +-- +--#include +-- +--void ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, +-- u8 *data, size_t data_len, u8 *mic); +--int ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, +-- u8 *data, size_t data_len, u8 *mic); +--struct crypto_aead *ieee80211_aes_gcm_key_setup_encrypt(const u8 key[], +-- size_t key_len); +--void ieee80211_aes_gcm_key_free(struct crypto_aead *tfm); +-- +--#endif /* AES_GCM_H */ +---- a/net/mac80211/aes_gmac.c +-+++ /dev/null +-@@ -1,84 +0,0 @@ +--/* +-- * AES-GMAC for IEEE 802.11 BIP-GMAC-128 and BIP-GMAC-256 +-- * Copyright 2015, Qualcomm Atheros, Inc. +-- * +-- * 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 +--#include +--#include +--#include +-- +--#include +--#include "key.h" +--#include "aes_gmac.h" +-- +--#define GMAC_MIC_LEN 16 +--#define GMAC_NONCE_LEN 12 +--#define AAD_LEN 20 +-- +--int ieee80211_aes_gmac(struct crypto_aead *tfm, const u8 *aad, u8 *nonce, +-- const u8 *data, size_t data_len, u8 *mic) +--{ +-- struct scatterlist sg[3], ct[1]; +-- char aead_req_data[sizeof(struct aead_request) + +-- crypto_aead_reqsize(tfm)] +-- __aligned(__alignof__(struct aead_request)); +-- struct aead_request *aead_req = (void *)aead_req_data; +-- u8 zero[GMAC_MIC_LEN], iv[AES_BLOCK_SIZE]; +-- +-- if (data_len < GMAC_MIC_LEN) +-- return -EINVAL; +-- +-- memset(aead_req, 0, sizeof(aead_req_data)); +-- +-- memset(zero, 0, GMAC_MIC_LEN); +-- sg_init_table(sg, 3); +-- sg_set_buf(&sg[0], aad, AAD_LEN); +-- sg_set_buf(&sg[1], data, data_len - GMAC_MIC_LEN); +-- sg_set_buf(&sg[2], zero, GMAC_MIC_LEN); +-- +-- memcpy(iv, nonce, GMAC_NONCE_LEN); +-- memset(iv + GMAC_NONCE_LEN, 0, sizeof(iv) - GMAC_NONCE_LEN); +-- iv[AES_BLOCK_SIZE - 1] = 0x01; +-- +-- sg_init_table(ct, 1); +-- sg_set_buf(&ct[0], mic, GMAC_MIC_LEN); +-- +-- aead_request_set_tfm(aead_req, tfm); +-- aead_request_set_assoc(aead_req, sg, AAD_LEN + data_len); +-- aead_request_set_crypt(aead_req, NULL, ct, 0, iv); +-- +-- crypto_aead_encrypt(aead_req); +-- +-- return 0; +--} +-- +--struct crypto_aead *ieee80211_aes_gmac_key_setup(const u8 key[], +-- size_t key_len) +--{ +-- struct crypto_aead *tfm; +-- int err; +-- +-- tfm = crypto_alloc_aead("gcm(aes)", 0, CRYPTO_ALG_ASYNC); +-- if (IS_ERR(tfm)) +-- return tfm; +-- +-- err = crypto_aead_setkey(tfm, key, key_len); +-- if (!err) +-- return tfm; +-- if (!err) +-- err = crypto_aead_setauthsize(tfm, GMAC_MIC_LEN); +-- +-- crypto_free_aead(tfm); +-- return ERR_PTR(err); +--} +-- +--void ieee80211_aes_gmac_key_free(struct crypto_aead *tfm) +--{ +-- crypto_free_aead(tfm); +--} +---- a/net/mac80211/aes_gmac.h +-+++ /dev/null +-@@ -1,20 +0,0 @@ +--/* +-- * Copyright 2015, Qualcomm Atheros, Inc. +-- * +-- * 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. +-- */ +-- +--#ifndef AES_GMAC_H +--#define AES_GMAC_H +-- +--#include +-- +--struct crypto_aead *ieee80211_aes_gmac_key_setup(const u8 key[], +-- size_t key_len); +--int ieee80211_aes_gmac(struct crypto_aead *tfm, const u8 *aad, u8 *nonce, +-- const u8 *data, size_t data_len, u8 *mic); +--void ieee80211_aes_gmac_key_free(struct crypto_aead *tfm); +-- +--#endif /* AES_GMAC_H */ +---- a/net/mac80211/cfg.c +-+++ b/net/mac80211/cfg.c +-@@ -162,13 +162,8 @@ static int ieee80211_add_key(struct wiph +- return -EINVAL; +- break; +- case WLAN_CIPHER_SUITE_CCMP: +-- case WLAN_CIPHER_SUITE_CCMP_256: +- case WLAN_CIPHER_SUITE_AES_CMAC: +-- case WLAN_CIPHER_SUITE_BIP_CMAC_256: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_128: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_256: +- case WLAN_CIPHER_SUITE_GCMP: +-- case WLAN_CIPHER_SUITE_GCMP_256: +- break; +- default: +- cs = ieee80211_cs_get(local, params->cipher, sdata->vif.type); +-@@ -353,7 +348,6 @@ static int ieee80211_get_key(struct wiph +- params.seq_len = 6; +- break; +- case WLAN_CIPHER_SUITE_CCMP: +-- case WLAN_CIPHER_SUITE_CCMP_256: +- pn64 = atomic64_read(&key->u.ccmp.tx_pn); +- seq[0] = pn64; +- seq[1] = pn64 >> 8; +-@@ -365,35 +359,10 @@ static int ieee80211_get_key(struct wiph +- params.seq_len = 6; +- break; +- case WLAN_CIPHER_SUITE_AES_CMAC: +-- case WLAN_CIPHER_SUITE_BIP_CMAC_256: +- pn64 = atomic64_read(&key->u.aes_cmac.tx_pn); +- seq[0] = pn64; +- seq[1] = pn64 >> 8; +- seq[2] = pn64 >> 16; +-- seq[3] = pn64 >> 24; +-- seq[4] = pn64 >> 32; +-- seq[5] = pn64 >> 40; +-- params.seq = seq; +-- params.seq_len = 6; +-- break; +-- case WLAN_CIPHER_SUITE_BIP_GMAC_128: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_256: +-- pn64 = atomic64_read(&key->u.aes_gmac.tx_pn); +-- seq[0] = pn64; +-- seq[1] = pn64 >> 8; +-- seq[2] = pn64 >> 16; +-- seq[3] = pn64 >> 24; +-- seq[4] = pn64 >> 32; +-- seq[5] = pn64 >> 40; +-- params.seq = seq; +-- params.seq_len = 6; +-- break; +-- case WLAN_CIPHER_SUITE_GCMP: +-- case WLAN_CIPHER_SUITE_GCMP_256: +-- pn64 = atomic64_read(&key->u.gcmp.tx_pn); +-- seq[0] = pn64; +-- seq[1] = pn64 >> 8; +-- seq[2] = pn64 >> 16; +- seq[3] = pn64 >> 24; +- seq[4] = pn64 >> 32; +- seq[5] = pn64 >> 40; +---- a/net/mac80211/debugfs_key.c +-+++ b/net/mac80211/debugfs_key.c +-@@ -94,33 +94,17 @@ static ssize_t key_tx_spec_read(struct f +- key->u.tkip.tx.iv16); +- break; +- case WLAN_CIPHER_SUITE_CCMP: +-- case WLAN_CIPHER_SUITE_CCMP_256: +- pn = atomic64_read(&key->u.ccmp.tx_pn); +- len = scnprintf(buf, sizeof(buf), "%02x%02x%02x%02x%02x%02x\n", +- (u8)(pn >> 40), (u8)(pn >> 32), (u8)(pn >> 24), +- (u8)(pn >> 16), (u8)(pn >> 8), (u8)pn); +- break; +- case WLAN_CIPHER_SUITE_AES_CMAC: +-- case WLAN_CIPHER_SUITE_BIP_CMAC_256: +- pn = atomic64_read(&key->u.aes_cmac.tx_pn); +- len = scnprintf(buf, sizeof(buf), "%02x%02x%02x%02x%02x%02x\n", +- (u8)(pn >> 40), (u8)(pn >> 32), (u8)(pn >> 24), +- (u8)(pn >> 16), (u8)(pn >> 8), (u8)pn); +- break; +-- case WLAN_CIPHER_SUITE_BIP_GMAC_128: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_256: +-- pn = atomic64_read(&key->u.aes_gmac.tx_pn); +-- len = scnprintf(buf, sizeof(buf), "%02x%02x%02x%02x%02x%02x\n", +-- (u8)(pn >> 40), (u8)(pn >> 32), (u8)(pn >> 24), +-- (u8)(pn >> 16), (u8)(pn >> 8), (u8)pn); +-- break; +-- case WLAN_CIPHER_SUITE_GCMP: +-- case WLAN_CIPHER_SUITE_GCMP_256: +-- pn = atomic64_read(&key->u.gcmp.tx_pn); +-- len = scnprintf(buf, sizeof(buf), "%02x%02x%02x%02x%02x%02x\n", +-- (u8)(pn >> 40), (u8)(pn >> 32), (u8)(pn >> 24), +-- (u8)(pn >> 16), (u8)(pn >> 8), (u8)pn); +-- break; +- default: +- return 0; +- } +-@@ -150,7 +134,6 @@ static ssize_t key_rx_spec_read(struct f +- len = p - buf; +- break; +- case WLAN_CIPHER_SUITE_CCMP: +-- case WLAN_CIPHER_SUITE_CCMP_256: +- for (i = 0; i < IEEE80211_NUM_TIDS + 1; i++) { +- rpn = key->u.ccmp.rx_pn[i]; +- p += scnprintf(p, sizeof(buf)+buf-p, +-@@ -161,7 +144,6 @@ static ssize_t key_rx_spec_read(struct f +- len = p - buf; +- break; +- case WLAN_CIPHER_SUITE_AES_CMAC: +-- case WLAN_CIPHER_SUITE_BIP_CMAC_256: +- rpn = key->u.aes_cmac.rx_pn; +- p += scnprintf(p, sizeof(buf)+buf-p, +- "%02x%02x%02x%02x%02x%02x\n", +-@@ -169,26 +151,6 @@ static ssize_t key_rx_spec_read(struct f +- rpn[3], rpn[4], rpn[5]); +- len = p - buf; +- break; +-- case WLAN_CIPHER_SUITE_BIP_GMAC_128: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_256: +-- rpn = key->u.aes_gmac.rx_pn; +-- p += scnprintf(p, sizeof(buf)+buf-p, +-- "%02x%02x%02x%02x%02x%02x\n", +-- rpn[0], rpn[1], rpn[2], +-- rpn[3], rpn[4], rpn[5]); +-- len = p - buf; +-- break; +-- case WLAN_CIPHER_SUITE_GCMP: +-- case WLAN_CIPHER_SUITE_GCMP_256: +-- for (i = 0; i < IEEE80211_NUM_TIDS + 1; i++) { +-- rpn = key->u.gcmp.rx_pn[i]; +-- p += scnprintf(p, sizeof(buf)+buf-p, +-- "%02x%02x%02x%02x%02x%02x\n", +-- rpn[0], rpn[1], rpn[2], +-- rpn[3], rpn[4], rpn[5]); +-- } +-- len = p - buf; +-- break; +- default: +- return 0; +- } +-@@ -205,23 +167,12 @@ static ssize_t key_replays_read(struct f +- +- switch (key->conf.cipher) { +- case WLAN_CIPHER_SUITE_CCMP: +-- case WLAN_CIPHER_SUITE_CCMP_256: +- len = scnprintf(buf, sizeof(buf), "%u\n", key->u.ccmp.replays); +- break; +- case WLAN_CIPHER_SUITE_AES_CMAC: +-- case WLAN_CIPHER_SUITE_BIP_CMAC_256: +- len = scnprintf(buf, sizeof(buf), "%u\n", +- key->u.aes_cmac.replays); +- break; +-- case WLAN_CIPHER_SUITE_BIP_GMAC_128: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_256: +-- len = scnprintf(buf, sizeof(buf), "%u\n", +-- key->u.aes_gmac.replays); +-- break; +-- case WLAN_CIPHER_SUITE_GCMP: +-- case WLAN_CIPHER_SUITE_GCMP_256: +-- len = scnprintf(buf, sizeof(buf), "%u\n", key->u.gcmp.replays); +-- break; +- default: +- return 0; +- } +-@@ -238,15 +189,9 @@ static ssize_t key_icverrors_read(struct +- +- switch (key->conf.cipher) { +- case WLAN_CIPHER_SUITE_AES_CMAC: +-- case WLAN_CIPHER_SUITE_BIP_CMAC_256: +- len = scnprintf(buf, sizeof(buf), "%u\n", +- key->u.aes_cmac.icverrors); +- break; +-- case WLAN_CIPHER_SUITE_BIP_GMAC_128: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_256: +-- len = scnprintf(buf, sizeof(buf), "%u\n", +-- key->u.aes_gmac.icverrors); +-- break; +- default: +- return 0; +- } +---- a/net/mac80211/key.c +-+++ b/net/mac80211/key.c +-@@ -24,8 +24,6 @@ +- #include "debugfs_key.h" +- #include "aes_ccm.h" +- #include "aes_cmac.h" +--#include "aes_gmac.h" +--#include "aes_gcm.h" +- +- +- /** +-@@ -164,13 +162,7 @@ static int ieee80211_key_enable_hw_accel +- case WLAN_CIPHER_SUITE_WEP104: +- case WLAN_CIPHER_SUITE_TKIP: +- case WLAN_CIPHER_SUITE_CCMP: +-- case WLAN_CIPHER_SUITE_CCMP_256: +- case WLAN_CIPHER_SUITE_AES_CMAC: +-- case WLAN_CIPHER_SUITE_BIP_CMAC_256: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_128: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_256: +-- case WLAN_CIPHER_SUITE_GCMP: +-- case WLAN_CIPHER_SUITE_GCMP_256: +- /* all of these we can do in software - if driver can */ +- if (ret == 1) +- return 0; +-@@ -394,26 +386,7 @@ ieee80211_key_alloc(u32 cipher, int idx, +- * Initialize AES key state here as an optimization so that +- * it does not need to be initialized for every packet. +- */ +-- key->u.ccmp.tfm = ieee80211_aes_key_setup_encrypt( +-- key_data, key_len, IEEE80211_CCMP_MIC_LEN); +-- if (IS_ERR(key->u.ccmp.tfm)) { +-- err = PTR_ERR(key->u.ccmp.tfm); +-- kfree(key); +-- return ERR_PTR(err); +-- } +-- break; +-- case WLAN_CIPHER_SUITE_CCMP_256: +-- key->conf.iv_len = IEEE80211_CCMP_256_HDR_LEN; +-- key->conf.icv_len = IEEE80211_CCMP_256_MIC_LEN; +-- for (i = 0; seq && i < IEEE80211_NUM_TIDS + 1; i++) +-- for (j = 0; j < IEEE80211_CCMP_256_PN_LEN; j++) +-- key->u.ccmp.rx_pn[i][j] = +-- seq[IEEE80211_CCMP_256_PN_LEN - j - 1]; +-- /* Initialize AES key state here as an optimization so that +-- * it does not need to be initialized for every packet. +-- */ +-- key->u.ccmp.tfm = ieee80211_aes_key_setup_encrypt( +-- key_data, key_len, IEEE80211_CCMP_256_MIC_LEN); +-+ key->u.ccmp.tfm = ieee80211_aes_key_setup_encrypt(key_data); +- if (IS_ERR(key->u.ccmp.tfm)) { +- err = PTR_ERR(key->u.ccmp.tfm); +- kfree(key); +-@@ -421,12 +394,8 @@ ieee80211_key_alloc(u32 cipher, int idx, +- } +- break; +- case WLAN_CIPHER_SUITE_AES_CMAC: +-- case WLAN_CIPHER_SUITE_BIP_CMAC_256: +- key->conf.iv_len = 0; +-- if (cipher == WLAN_CIPHER_SUITE_AES_CMAC) +-- key->conf.icv_len = sizeof(struct ieee80211_mmie); +-- else +-- key->conf.icv_len = sizeof(struct ieee80211_mmie_16); +-+ key->conf.icv_len = sizeof(struct ieee80211_mmie); +- if (seq) +- for (j = 0; j < IEEE80211_CMAC_PN_LEN; j++) +- key->u.aes_cmac.rx_pn[j] = +-@@ -436,51 +405,13 @@ ieee80211_key_alloc(u32 cipher, int idx, +- * it does not need to be initialized for every packet. +- */ +- key->u.aes_cmac.tfm = +-- ieee80211_aes_cmac_key_setup(key_data, key_len); +-+ ieee80211_aes_cmac_key_setup(key_data); +- if (IS_ERR(key->u.aes_cmac.tfm)) { +- err = PTR_ERR(key->u.aes_cmac.tfm); +- kfree(key); +- return ERR_PTR(err); +- } +- break; +-- case WLAN_CIPHER_SUITE_BIP_GMAC_128: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_256: +-- key->conf.iv_len = 0; +-- key->conf.icv_len = sizeof(struct ieee80211_mmie_16); +-- if (seq) +-- for (j = 0; j < IEEE80211_GMAC_PN_LEN; j++) +-- key->u.aes_gmac.rx_pn[j] = +-- seq[IEEE80211_GMAC_PN_LEN - j - 1]; +-- /* Initialize AES key state here as an optimization so that +-- * it does not need to be initialized for every packet. +-- */ +-- key->u.aes_gmac.tfm = +-- ieee80211_aes_gmac_key_setup(key_data, key_len); +-- if (IS_ERR(key->u.aes_gmac.tfm)) { +-- err = PTR_ERR(key->u.aes_gmac.tfm); +-- kfree(key); +-- return ERR_PTR(err); +-- } +-- break; +-- case WLAN_CIPHER_SUITE_GCMP: +-- case WLAN_CIPHER_SUITE_GCMP_256: +-- key->conf.iv_len = IEEE80211_GCMP_HDR_LEN; +-- key->conf.icv_len = IEEE80211_GCMP_MIC_LEN; +-- for (i = 0; seq && i < IEEE80211_NUM_TIDS + 1; i++) +-- for (j = 0; j < IEEE80211_GCMP_PN_LEN; j++) +-- key->u.gcmp.rx_pn[i][j] = +-- seq[IEEE80211_GCMP_PN_LEN - j - 1]; +-- /* Initialize AES key state here as an optimization so that +-- * it does not need to be initialized for every packet. +-- */ +-- key->u.gcmp.tfm = ieee80211_aes_gcm_key_setup_encrypt(key_data, +-- key_len); +-- if (IS_ERR(key->u.gcmp.tfm)) { +-- err = PTR_ERR(key->u.gcmp.tfm); +-- kfree(key); +-- return ERR_PTR(err); +-- } +-- break; +- default: +- if (cs) { +- size_t len = (seq_len > MAX_PN_LEN) ? +-@@ -502,24 +433,10 @@ ieee80211_key_alloc(u32 cipher, int idx, +- +- static void ieee80211_key_free_common(struct ieee80211_key *key) +- { +-- switch (key->conf.cipher) { +-- case WLAN_CIPHER_SUITE_CCMP: +-- case WLAN_CIPHER_SUITE_CCMP_256: +-+ if (key->conf.cipher == WLAN_CIPHER_SUITE_CCMP) +- ieee80211_aes_key_free(key->u.ccmp.tfm); +-- break; +-- case WLAN_CIPHER_SUITE_AES_CMAC: +-- case WLAN_CIPHER_SUITE_BIP_CMAC_256: +-+ if (key->conf.cipher == WLAN_CIPHER_SUITE_AES_CMAC) +- ieee80211_aes_cmac_key_free(key->u.aes_cmac.tfm); +-- break; +-- case WLAN_CIPHER_SUITE_BIP_GMAC_128: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_256: +-- ieee80211_aes_gmac_key_free(key->u.aes_gmac.tfm); +-- break; +-- case WLAN_CIPHER_SUITE_GCMP: +-- case WLAN_CIPHER_SUITE_GCMP_256: +-- ieee80211_aes_gcm_key_free(key->u.gcmp.tfm); +-- break; +-- } +- kzfree(key); +- } +- +-@@ -826,7 +743,6 @@ void ieee80211_get_key_tx_seq(struct iee +- seq->tkip.iv16 = key->u.tkip.tx.iv16; +- break; +- case WLAN_CIPHER_SUITE_CCMP: +-- case WLAN_CIPHER_SUITE_CCMP_256: +- pn64 = atomic64_read(&key->u.ccmp.tx_pn); +- seq->ccmp.pn[5] = pn64; +- seq->ccmp.pn[4] = pn64 >> 8; +-@@ -836,7 +752,6 @@ void ieee80211_get_key_tx_seq(struct iee +- seq->ccmp.pn[0] = pn64 >> 40; +- break; +- case WLAN_CIPHER_SUITE_AES_CMAC: +-- case WLAN_CIPHER_SUITE_BIP_CMAC_256: +- pn64 = atomic64_read(&key->u.aes_cmac.tx_pn); +- seq->ccmp.pn[5] = pn64; +- seq->ccmp.pn[4] = pn64 >> 8; +-@@ -845,26 +760,6 @@ void ieee80211_get_key_tx_seq(struct iee +- seq->ccmp.pn[1] = pn64 >> 32; +- seq->ccmp.pn[0] = pn64 >> 40; +- break; +-- case WLAN_CIPHER_SUITE_BIP_GMAC_128: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_256: +-- pn64 = atomic64_read(&key->u.aes_gmac.tx_pn); +-- seq->ccmp.pn[5] = pn64; +-- seq->ccmp.pn[4] = pn64 >> 8; +-- seq->ccmp.pn[3] = pn64 >> 16; +-- seq->ccmp.pn[2] = pn64 >> 24; +-- seq->ccmp.pn[1] = pn64 >> 32; +-- seq->ccmp.pn[0] = pn64 >> 40; +-- break; +-- case WLAN_CIPHER_SUITE_GCMP: +-- case WLAN_CIPHER_SUITE_GCMP_256: +-- pn64 = atomic64_read(&key->u.gcmp.tx_pn); +-- seq->gcmp.pn[5] = pn64; +-- seq->gcmp.pn[4] = pn64 >> 8; +-- seq->gcmp.pn[3] = pn64 >> 16; +-- seq->gcmp.pn[2] = pn64 >> 24; +-- seq->gcmp.pn[1] = pn64 >> 32; +-- seq->gcmp.pn[0] = pn64 >> 40; +-- break; +- default: +- WARN_ON(1); +- } +-@@ -887,7 +782,6 @@ void ieee80211_get_key_rx_seq(struct iee +- seq->tkip.iv16 = key->u.tkip.rx[tid].iv16; +- break; +- case WLAN_CIPHER_SUITE_CCMP: +-- case WLAN_CIPHER_SUITE_CCMP_256: +- if (WARN_ON(tid < -1 || tid >= IEEE80211_NUM_TIDS)) +- return; +- if (tid < 0) +-@@ -897,29 +791,11 @@ void ieee80211_get_key_rx_seq(struct iee +- memcpy(seq->ccmp.pn, pn, IEEE80211_CCMP_PN_LEN); +- break; +- case WLAN_CIPHER_SUITE_AES_CMAC: +-- case WLAN_CIPHER_SUITE_BIP_CMAC_256: +- if (WARN_ON(tid != 0)) +- return; +- pn = key->u.aes_cmac.rx_pn; +- memcpy(seq->aes_cmac.pn, pn, IEEE80211_CMAC_PN_LEN); +- break; +-- case WLAN_CIPHER_SUITE_BIP_GMAC_128: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_256: +-- if (WARN_ON(tid != 0)) +-- return; +-- pn = key->u.aes_gmac.rx_pn; +-- memcpy(seq->aes_gmac.pn, pn, IEEE80211_GMAC_PN_LEN); +-- break; +-- case WLAN_CIPHER_SUITE_GCMP: +-- case WLAN_CIPHER_SUITE_GCMP_256: +-- if (WARN_ON(tid < -1 || tid >= IEEE80211_NUM_TIDS)) +-- return; +-- if (tid < 0) +-- pn = key->u.gcmp.rx_pn[IEEE80211_NUM_TIDS]; +-- else +-- pn = key->u.gcmp.rx_pn[tid]; +-- memcpy(seq->gcmp.pn, pn, IEEE80211_GCMP_PN_LEN); +-- break; +- } +- } +- EXPORT_SYMBOL(ieee80211_get_key_rx_seq); +-@@ -938,7 +814,6 @@ void ieee80211_set_key_tx_seq(struct iee +- key->u.tkip.tx.iv16 = seq->tkip.iv16; +- break; +- case WLAN_CIPHER_SUITE_CCMP: +-- case WLAN_CIPHER_SUITE_CCMP_256: +- pn64 = (u64)seq->ccmp.pn[5] | +- ((u64)seq->ccmp.pn[4] << 8) | +- ((u64)seq->ccmp.pn[3] << 16) | +-@@ -948,7 +823,6 @@ void ieee80211_set_key_tx_seq(struct iee +- atomic64_set(&key->u.ccmp.tx_pn, pn64); +- break; +- case WLAN_CIPHER_SUITE_AES_CMAC: +-- case WLAN_CIPHER_SUITE_BIP_CMAC_256: +- pn64 = (u64)seq->aes_cmac.pn[5] | +- ((u64)seq->aes_cmac.pn[4] << 8) | +- ((u64)seq->aes_cmac.pn[3] << 16) | +-@@ -957,26 +831,6 @@ void ieee80211_set_key_tx_seq(struct iee +- ((u64)seq->aes_cmac.pn[0] << 40); +- atomic64_set(&key->u.aes_cmac.tx_pn, pn64); +- break; +-- case WLAN_CIPHER_SUITE_BIP_GMAC_128: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_256: +-- pn64 = (u64)seq->aes_gmac.pn[5] | +-- ((u64)seq->aes_gmac.pn[4] << 8) | +-- ((u64)seq->aes_gmac.pn[3] << 16) | +-- ((u64)seq->aes_gmac.pn[2] << 24) | +-- ((u64)seq->aes_gmac.pn[1] << 32) | +-- ((u64)seq->aes_gmac.pn[0] << 40); +-- atomic64_set(&key->u.aes_gmac.tx_pn, pn64); +-- break; +-- case WLAN_CIPHER_SUITE_GCMP: +-- case WLAN_CIPHER_SUITE_GCMP_256: +-- pn64 = (u64)seq->gcmp.pn[5] | +-- ((u64)seq->gcmp.pn[4] << 8) | +-- ((u64)seq->gcmp.pn[3] << 16) | +-- ((u64)seq->gcmp.pn[2] << 24) | +-- ((u64)seq->gcmp.pn[1] << 32) | +-- ((u64)seq->gcmp.pn[0] << 40); +-- atomic64_set(&key->u.gcmp.tx_pn, pn64); +-- break; +- default: +- WARN_ON(1); +- break; +-@@ -1000,7 +854,6 @@ void ieee80211_set_key_rx_seq(struct iee +- key->u.tkip.rx[tid].iv16 = seq->tkip.iv16; +- break; +- case WLAN_CIPHER_SUITE_CCMP: +-- case WLAN_CIPHER_SUITE_CCMP_256: +- if (WARN_ON(tid < -1 || tid >= IEEE80211_NUM_TIDS)) +- return; +- if (tid < 0) +-@@ -1010,29 +863,11 @@ void ieee80211_set_key_rx_seq(struct iee +- memcpy(pn, seq->ccmp.pn, IEEE80211_CCMP_PN_LEN); +- break; +- case WLAN_CIPHER_SUITE_AES_CMAC: +-- case WLAN_CIPHER_SUITE_BIP_CMAC_256: +- if (WARN_ON(tid != 0)) +- return; +- pn = key->u.aes_cmac.rx_pn; +- memcpy(pn, seq->aes_cmac.pn, IEEE80211_CMAC_PN_LEN); +- break; +-- case WLAN_CIPHER_SUITE_BIP_GMAC_128: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_256: +-- if (WARN_ON(tid != 0)) +-- return; +-- pn = key->u.aes_gmac.rx_pn; +-- memcpy(pn, seq->aes_gmac.pn, IEEE80211_GMAC_PN_LEN); +-- break; +-- case WLAN_CIPHER_SUITE_GCMP: +-- case WLAN_CIPHER_SUITE_GCMP_256: +-- if (WARN_ON(tid < -1 || tid >= IEEE80211_NUM_TIDS)) +-- return; +-- if (tid < 0) +-- pn = key->u.gcmp.rx_pn[IEEE80211_NUM_TIDS]; +-- else +-- pn = key->u.gcmp.rx_pn[tid]; +-- memcpy(pn, seq->gcmp.pn, IEEE80211_GCMP_PN_LEN); +-- break; +- default: +- WARN_ON(1); +- break; +---- a/net/mac80211/key.h +-+++ b/net/mac80211/key.h +-@@ -84,7 +84,7 @@ struct ieee80211_key { +- * Management frames. +- */ +- u8 rx_pn[IEEE80211_NUM_TIDS + 1][IEEE80211_CCMP_PN_LEN]; +-- struct crypto_aead *tfm; +-+ struct crypto_cipher *tfm; +- u32 replays; /* dot11RSNAStatsCCMPReplays */ +- } ccmp; +- struct { +-@@ -95,24 +95,6 @@ struct ieee80211_key { +- u32 icverrors; /* dot11RSNAStatsCMACICVErrors */ +- } aes_cmac; +- struct { +-- atomic64_t tx_pn; +-- u8 rx_pn[IEEE80211_GMAC_PN_LEN]; +-- struct crypto_aead *tfm; +-- u32 replays; /* dot11RSNAStatsCMACReplays */ +-- u32 icverrors; /* dot11RSNAStatsCMACICVErrors */ +-- } aes_gmac; +-- struct { +-- atomic64_t tx_pn; +-- /* Last received packet number. The first +-- * IEEE80211_NUM_TIDS counters are used with Data +-- * frames and the last counter is used with Robust +-- * Management frames. +-- */ +-- u8 rx_pn[IEEE80211_NUM_TIDS + 1][IEEE80211_GCMP_PN_LEN]; +-- struct crypto_aead *tfm; +-- u32 replays; /* dot11RSNAStatsGCMPReplays */ +-- } gcmp; +-- struct { +- /* generic cipher scheme */ +- u8 rx_pn[IEEE80211_NUM_TIDS + 1][MAX_PN_LEN]; +- } gen; +---- a/net/mac80211/main.c +-+++ b/net/mac80211/main.c +-@@ -666,15 +666,9 @@ static int ieee80211_init_cipher_suites( +- WLAN_CIPHER_SUITE_WEP104, +- WLAN_CIPHER_SUITE_TKIP, +- WLAN_CIPHER_SUITE_CCMP, +-- WLAN_CIPHER_SUITE_CCMP_256, +-- WLAN_CIPHER_SUITE_GCMP, +-- WLAN_CIPHER_SUITE_GCMP_256, +- +- /* keep last -- depends on hw flags! */ +-- WLAN_CIPHER_SUITE_AES_CMAC, +-- WLAN_CIPHER_SUITE_BIP_CMAC_256, +-- WLAN_CIPHER_SUITE_BIP_GMAC_128, +-- WLAN_CIPHER_SUITE_BIP_GMAC_256, +-+ WLAN_CIPHER_SUITE_AES_CMAC +- }; +- +- if (local->hw.flags & IEEE80211_HW_SW_CRYPTO_CONTROL || +-@@ -713,7 +707,7 @@ static int ieee80211_init_cipher_suites( +- local->hw.wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites); +- +- if (!have_mfp) +-- local->hw.wiphy->n_cipher_suites -= 4; +-+ local->hw.wiphy->n_cipher_suites--; +- +- if (!have_wep) { +- local->hw.wiphy->cipher_suites += 2; +-@@ -730,42 +724,32 @@ static int ieee80211_init_cipher_suites( +- /* Driver specifies cipher schemes only (but not cipher suites +- * including the schemes) +- * +-- * We start counting ciphers defined by schemes, TKIP, CCMP, +-- * CCMP-256, GCMP, and GCMP-256 +-+ * We start counting ciphers defined by schemes, TKIP and CCMP +- */ +-- n_suites = local->hw.n_cipher_schemes + 5; +-+ n_suites = local->hw.n_cipher_schemes + 2; +- +- /* check if we have WEP40 and WEP104 */ +- if (have_wep) +- n_suites += 2; +- +-- /* check if we have AES_CMAC, BIP-CMAC-256, BIP-GMAC-128, +-- * BIP-GMAC-256 +-- */ +-+ /* check if we have AES_CMAC */ +- if (have_mfp) +-- n_suites += 4; +-+ n_suites++; +- +- suites = kmalloc(sizeof(u32) * n_suites, GFP_KERNEL); +- if (!suites) +- return -ENOMEM; +- +- suites[w++] = WLAN_CIPHER_SUITE_CCMP; +-- suites[w++] = WLAN_CIPHER_SUITE_CCMP_256; +- suites[w++] = WLAN_CIPHER_SUITE_TKIP; +-- suites[w++] = WLAN_CIPHER_SUITE_GCMP; +-- suites[w++] = WLAN_CIPHER_SUITE_GCMP_256; +- +- if (have_wep) { +- suites[w++] = WLAN_CIPHER_SUITE_WEP40; +- suites[w++] = WLAN_CIPHER_SUITE_WEP104; +- } +- +-- if (have_mfp) { +-+ if (have_mfp) +- suites[w++] = WLAN_CIPHER_SUITE_AES_CMAC; +-- suites[w++] = WLAN_CIPHER_SUITE_BIP_CMAC_256; +-- suites[w++] = WLAN_CIPHER_SUITE_BIP_GMAC_128; +-- suites[w++] = WLAN_CIPHER_SUITE_BIP_GMAC_256; +-- } +- +- for (r = 0; r < local->hw.n_cipher_schemes; r++) +- suites[w++] = cs[r].cipher; +---- a/net/mac80211/rx.c +-+++ b/net/mac80211/rx.c +-@@ -647,7 +647,6 @@ static int ieee80211_get_mmie_keyidx(str +- { +- struct ieee80211_mgmt *hdr = (struct ieee80211_mgmt *) skb->data; +- struct ieee80211_mmie *mmie; +-- struct ieee80211_mmie_16 *mmie16; +- +- if (skb->len < 24 + sizeof(*mmie) || !is_multicast_ether_addr(hdr->da)) +- return -1; +-@@ -657,18 +656,11 @@ static int ieee80211_get_mmie_keyidx(str +- +- mmie = (struct ieee80211_mmie *) +- (skb->data + skb->len - sizeof(*mmie)); +-- if (mmie->element_id == WLAN_EID_MMIE && +-- mmie->length == sizeof(*mmie) - 2) +-- return le16_to_cpu(mmie->key_id); +-- +-- mmie16 = (struct ieee80211_mmie_16 *) +-- (skb->data + skb->len - sizeof(*mmie16)); +-- if (skb->len >= 24 + sizeof(*mmie16) && +-- mmie16->element_id == WLAN_EID_MMIE && +-- mmie16->length == sizeof(*mmie16) - 2) +-- return le16_to_cpu(mmie16->key_id); +-+ if (mmie->element_id != WLAN_EID_MMIE || +-+ mmie->length != sizeof(*mmie) - 2) +-+ return -1; +- +-- return -1; +-+ return le16_to_cpu(mmie->key_id); +- } +- +- static int iwl80211_get_cs_keyid(const struct ieee80211_cipher_scheme *cs, +-@@ -1658,27 +1650,11 @@ ieee80211_rx_h_decrypt(struct ieee80211_ +- result = ieee80211_crypto_tkip_decrypt(rx); +- break; +- case WLAN_CIPHER_SUITE_CCMP: +-- result = ieee80211_crypto_ccmp_decrypt( +-- rx, IEEE80211_CCMP_MIC_LEN); +-- break; +-- case WLAN_CIPHER_SUITE_CCMP_256: +-- result = ieee80211_crypto_ccmp_decrypt( +-- rx, IEEE80211_CCMP_256_MIC_LEN); +-+ result = ieee80211_crypto_ccmp_decrypt(rx); +- break; +- case WLAN_CIPHER_SUITE_AES_CMAC: +- result = ieee80211_crypto_aes_cmac_decrypt(rx); +- break; +-- case WLAN_CIPHER_SUITE_BIP_CMAC_256: +-- result = ieee80211_crypto_aes_cmac_256_decrypt(rx); +-- break; +-- case WLAN_CIPHER_SUITE_BIP_GMAC_128: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_256: +-- result = ieee80211_crypto_aes_gmac_decrypt(rx); +-- break; +-- case WLAN_CIPHER_SUITE_GCMP: +-- case WLAN_CIPHER_SUITE_GCMP_256: +-- result = ieee80211_crypto_gcmp_decrypt(rx); +-- break; +- default: +- result = ieee80211_crypto_hw_decrypt(rx); +- } +-@@ -1805,9 +1781,7 @@ ieee80211_rx_h_defragment(struct ieee802 +- /* This is the first fragment of a new frame. */ +- entry = ieee80211_reassemble_add(rx->sdata, frag, seq, +- rx->seqno_idx, &(rx->skb)); +-- if (rx->key && +-- (rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP || +-- rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP_256) && +-+ if (rx->key && rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP && +- ieee80211_has_protected(fc)) { +- int queue = rx->security_idx; +- /* Store CCMP PN so that we can verify that the next +-@@ -1836,9 +1810,7 @@ ieee80211_rx_h_defragment(struct ieee802 +- int i; +- u8 pn[IEEE80211_CCMP_PN_LEN], *rpn; +- int queue; +-- if (!rx->key || +-- (rx->key->conf.cipher != WLAN_CIPHER_SUITE_CCMP && +-- rx->key->conf.cipher != WLAN_CIPHER_SUITE_CCMP_256)) +-+ if (!rx->key || rx->key->conf.cipher != WLAN_CIPHER_SUITE_CCMP) +- return RX_DROP_UNUSABLE; +- memcpy(pn, entry->last_pn, IEEE80211_CCMP_PN_LEN); +- for (i = IEEE80211_CCMP_PN_LEN - 1; i >= 0; i--) { +---- a/net/mac80211/tx.c +-+++ b/net/mac80211/tx.c +-@@ -626,9 +626,6 @@ ieee80211_tx_h_select_key(struct ieee802 +- tx->key = NULL; +- break; +- case WLAN_CIPHER_SUITE_CCMP: +-- case WLAN_CIPHER_SUITE_CCMP_256: +-- case WLAN_CIPHER_SUITE_GCMP: +-- case WLAN_CIPHER_SUITE_GCMP_256: +- if (!ieee80211_is_data_present(hdr->frame_control) && +- !ieee80211_use_mfp(hdr->frame_control, tx->sta, +- tx->skb)) +-@@ -639,9 +636,6 @@ ieee80211_tx_h_select_key(struct ieee802 +- ieee80211_is_mgmt(hdr->frame_control); +- break; +- case WLAN_CIPHER_SUITE_AES_CMAC: +-- case WLAN_CIPHER_SUITE_BIP_CMAC_256: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_128: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_256: +- if (!ieee80211_is_mgmt(hdr->frame_control)) +- tx->key = NULL; +- break; +-@@ -1017,21 +1011,9 @@ ieee80211_tx_h_encrypt(struct ieee80211_ +- case WLAN_CIPHER_SUITE_TKIP: +- return ieee80211_crypto_tkip_encrypt(tx); +- case WLAN_CIPHER_SUITE_CCMP: +-- return ieee80211_crypto_ccmp_encrypt( +-- tx, IEEE80211_CCMP_MIC_LEN); +-- case WLAN_CIPHER_SUITE_CCMP_256: +-- return ieee80211_crypto_ccmp_encrypt( +-- tx, IEEE80211_CCMP_256_MIC_LEN); +-+ return ieee80211_crypto_ccmp_encrypt(tx); +- case WLAN_CIPHER_SUITE_AES_CMAC: +- return ieee80211_crypto_aes_cmac_encrypt(tx); +-- case WLAN_CIPHER_SUITE_BIP_CMAC_256: +-- return ieee80211_crypto_aes_cmac_256_encrypt(tx); +-- case WLAN_CIPHER_SUITE_BIP_GMAC_128: +-- case WLAN_CIPHER_SUITE_BIP_GMAC_256: +-- return ieee80211_crypto_aes_gmac_encrypt(tx); +-- case WLAN_CIPHER_SUITE_GCMP: +-- case WLAN_CIPHER_SUITE_GCMP_256: +-- return ieee80211_crypto_gcmp_encrypt(tx); +- default: +- return ieee80211_crypto_hw_encrypt(tx); +- } +---- a/net/mac80211/wpa.c +-+++ b/net/mac80211/wpa.c +-@@ -22,8 +22,6 @@ +- #include "tkip.h" +- #include "aes_ccm.h" +- #include "aes_cmac.h" +--#include "aes_gmac.h" +--#include "aes_gcm.h" +- #include "wpa.h" +- +- ieee80211_tx_result +-@@ -304,15 +302,22 @@ ieee80211_crypto_tkip_decrypt(struct iee +- } +- +- +--static void ccmp_special_blocks(struct sk_buff *skb, u8 *pn, u8 *b_0, u8 *aad) +-+static void ccmp_special_blocks(struct sk_buff *skb, u8 *pn, u8 *scratch, +-+ int encrypted) +- { +- __le16 mask_fc; +- int a4_included, mgmt; +- u8 qos_tid; +-- u16 len_a; +-+ u8 *b_0, *aad; +-+ u16 data_len, len_a; +- unsigned int hdrlen; +- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; +- +-+ memset(scratch, 0, 6 * AES_BLOCK_SIZE); +-+ +-+ b_0 = scratch + 3 * AES_BLOCK_SIZE; +-+ aad = scratch + 4 * AES_BLOCK_SIZE; +-+ +- /* +- * Mask FC: zero subtype b4 b5 b6 (if not mgmt) +- * Retry, PwrMgt, MoreData; set Protected +-@@ -334,21 +339,20 @@ static void ccmp_special_blocks(struct s +- else +- qos_tid = 0; +- +-- /* In CCM, the initial vectors (IV) used for CTR mode encryption and CBC +-- * mode authentication are not allowed to collide, yet both are derived +-- * from this vector b_0. We only set L := 1 here to indicate that the +-- * data size can be represented in (L+1) bytes. The CCM layer will take +-- * care of storing the data length in the top (L+1) bytes and setting +-- * and clearing the other bits as is required to derive the two IVs. +-- */ +-- b_0[0] = 0x1; +-+ data_len = skb->len - hdrlen - IEEE80211_CCMP_HDR_LEN; +-+ if (encrypted) +-+ data_len -= IEEE80211_CCMP_MIC_LEN; +- +-+ /* First block, b_0 */ +-+ b_0[0] = 0x59; /* flags: Adata: 1, M: 011, L: 001 */ +- /* Nonce: Nonce Flags | A2 | PN +- * Nonce Flags: Priority (b0..b3) | Management (b4) | Reserved (b5..b7) +- */ +- b_0[1] = qos_tid | (mgmt << 4); +- memcpy(&b_0[2], hdr->addr2, ETH_ALEN); +- memcpy(&b_0[8], pn, IEEE80211_CCMP_PN_LEN); +-+ /* l(m) */ +-+ put_unaligned_be16(data_len, &b_0[14]); +- +- /* AAD (extra authenticate-only data) / masked 802.11 header +- * FC | A1 | A2 | A3 | SC | [A4] | [QC] */ +-@@ -395,8 +399,7 @@ static inline void ccmp_hdr2pn(u8 *pn, u +- } +- +- +--static int ccmp_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb, +-- unsigned int mic_len) +-+static int ccmp_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb) +- { +- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; +- struct ieee80211_key *key = tx->key; +-@@ -405,8 +408,7 @@ static int ccmp_encrypt_skb(struct ieee8 +- u8 *pos; +- u8 pn[6]; +- u64 pn64; +-- u8 aad[2 * AES_BLOCK_SIZE]; +-- u8 b_0[AES_BLOCK_SIZE]; +-+ u8 scratch[6 * AES_BLOCK_SIZE]; +- +- if (info->control.hw_key && +- !(info->control.hw_key->flags & IEEE80211_KEY_FLAG_GENERATE_IV) && +-@@ -427,7 +429,7 @@ static int ccmp_encrypt_skb(struct ieee8 +- if (info->control.hw_key) +- tail = 0; +- else +-- tail = mic_len; +-+ tail = IEEE80211_CCMP_MIC_LEN; +- +- if (WARN_ON(skb_tailroom(skb) < tail || +- skb_headroom(skb) < IEEE80211_CCMP_HDR_LEN)) +-@@ -460,24 +462,23 @@ static int ccmp_encrypt_skb(struct ieee8 +- return 0; +- +- pos += IEEE80211_CCMP_HDR_LEN; +-- ccmp_special_blocks(skb, pn, b_0, aad); +-- ieee80211_aes_ccm_encrypt(key->u.ccmp.tfm, b_0, aad, pos, len, +-- skb_put(skb, mic_len), mic_len); +-+ ccmp_special_blocks(skb, pn, scratch, 0); +-+ ieee80211_aes_ccm_encrypt(key->u.ccmp.tfm, scratch, pos, len, +-+ pos, skb_put(skb, IEEE80211_CCMP_MIC_LEN)); +- +- return 0; +- } +- +- +- ieee80211_tx_result +--ieee80211_crypto_ccmp_encrypt(struct ieee80211_tx_data *tx, +-- unsigned int mic_len) +-+ieee80211_crypto_ccmp_encrypt(struct ieee80211_tx_data *tx) +- { +- struct sk_buff *skb; +- +- ieee80211_tx_set_protected(tx); +- +- skb_queue_walk(&tx->skbs, skb) { +-- if (ccmp_encrypt_skb(tx, skb, mic_len) < 0) +-+ if (ccmp_encrypt_skb(tx, skb) < 0) +- return TX_DROP; +- } +- +-@@ -486,8 +487,7 @@ ieee80211_crypto_ccmp_encrypt(struct iee +- +- +- ieee80211_rx_result +--ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx, +-- unsigned int mic_len) +-+ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx) +- { +- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; +- int hdrlen; +-@@ -504,7 +504,8 @@ ieee80211_crypto_ccmp_decrypt(struct iee +- !ieee80211_is_robust_mgmt_frame(skb)) +- return RX_CONTINUE; +- +-- data_len = skb->len - hdrlen - IEEE80211_CCMP_HDR_LEN - mic_len; +-+ data_len = skb->len - hdrlen - IEEE80211_CCMP_HDR_LEN - +-+ IEEE80211_CCMP_MIC_LEN; +- if (!rx->sta || data_len < 0) +- return RX_DROP_UNUSABLE; +- +-@@ -526,23 +527,23 @@ ieee80211_crypto_ccmp_decrypt(struct iee +- } +- +- if (!(status->flag & RX_FLAG_DECRYPTED)) { +-- u8 aad[2 * AES_BLOCK_SIZE]; +-- u8 b_0[AES_BLOCK_SIZE]; +-+ u8 scratch[6 * AES_BLOCK_SIZE]; +- /* hardware didn't decrypt/verify MIC */ +-- ccmp_special_blocks(skb, pn, b_0, aad); +-+ ccmp_special_blocks(skb, pn, scratch, 1); +- +- if (ieee80211_aes_ccm_decrypt( +-- key->u.ccmp.tfm, b_0, aad, +-+ key->u.ccmp.tfm, scratch, +- skb->data + hdrlen + IEEE80211_CCMP_HDR_LEN, +- data_len, +-- skb->data + skb->len - mic_len, mic_len)) +-+ skb->data + skb->len - IEEE80211_CCMP_MIC_LEN, +-+ skb->data + hdrlen + IEEE80211_CCMP_HDR_LEN)) +- return RX_DROP_UNUSABLE; +- } +- +- memcpy(key->u.ccmp.rx_pn[queue], pn, IEEE80211_CCMP_PN_LEN); +- +- /* Remove CCMP header and MIC */ +-- if (pskb_trim(skb, skb->len - mic_len)) +-+ if (pskb_trim(skb, skb->len - IEEE80211_CCMP_MIC_LEN)) +- return RX_DROP_UNUSABLE; +- memmove(skb->data + IEEE80211_CCMP_HDR_LEN, skb->data, hdrlen); +- skb_pull(skb, IEEE80211_CCMP_HDR_LEN); +-@@ -550,229 +551,6 @@ ieee80211_crypto_ccmp_decrypt(struct iee +- return RX_CONTINUE; +- } +- +--static void gcmp_special_blocks(struct sk_buff *skb, u8 *pn, u8 *j_0, u8 *aad) +--{ +-- __le16 mask_fc; +-- u8 qos_tid; +-- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; +-- +-- memcpy(j_0, hdr->addr2, ETH_ALEN); +-- memcpy(&j_0[ETH_ALEN], pn, IEEE80211_GCMP_PN_LEN); +-- j_0[13] = 0; +-- j_0[14] = 0; +-- j_0[AES_BLOCK_SIZE - 1] = 0x01; +-- +-- /* AAD (extra authenticate-only data) / masked 802.11 header +-- * FC | A1 | A2 | A3 | SC | [A4] | [QC] +-- */ +-- put_unaligned_be16(ieee80211_hdrlen(hdr->frame_control) - 2, &aad[0]); +-- /* Mask FC: zero subtype b4 b5 b6 (if not mgmt) +-- * Retry, PwrMgt, MoreData; set Protected +-- */ +-- mask_fc = hdr->frame_control; +-- mask_fc &= ~cpu_to_le16(IEEE80211_FCTL_RETRY | +-- IEEE80211_FCTL_PM | IEEE80211_FCTL_MOREDATA); +-- if (!ieee80211_is_mgmt(hdr->frame_control)) +-- mask_fc &= ~cpu_to_le16(0x0070); +-- mask_fc |= cpu_to_le16(IEEE80211_FCTL_PROTECTED); +-- +-- put_unaligned(mask_fc, (__le16 *)&aad[2]); +-- memcpy(&aad[4], &hdr->addr1, 3 * ETH_ALEN); +-- +-- /* Mask Seq#, leave Frag# */ +-- aad[22] = *((u8 *)&hdr->seq_ctrl) & 0x0f; +-- aad[23] = 0; +-- +-- if (ieee80211_is_data_qos(hdr->frame_control)) +-- qos_tid = *ieee80211_get_qos_ctl(hdr) & +-- IEEE80211_QOS_CTL_TID_MASK; +-- else +-- qos_tid = 0; +-- +-- if (ieee80211_has_a4(hdr->frame_control)) { +-- memcpy(&aad[24], hdr->addr4, ETH_ALEN); +-- aad[30] = qos_tid; +-- aad[31] = 0; +-- } else { +-- memset(&aad[24], 0, ETH_ALEN + IEEE80211_QOS_CTL_LEN); +-- aad[24] = qos_tid; +-- } +--} +-- +--static inline void gcmp_pn2hdr(u8 *hdr, const u8 *pn, int key_id) +--{ +-- hdr[0] = pn[5]; +-- hdr[1] = pn[4]; +-- hdr[2] = 0; +-- hdr[3] = 0x20 | (key_id << 6); +-- hdr[4] = pn[3]; +-- hdr[5] = pn[2]; +-- hdr[6] = pn[1]; +-- hdr[7] = pn[0]; +--} +-- +--static inline void gcmp_hdr2pn(u8 *pn, const u8 *hdr) +--{ +-- pn[0] = hdr[7]; +-- pn[1] = hdr[6]; +-- pn[2] = hdr[5]; +-- pn[3] = hdr[4]; +-- pn[4] = hdr[1]; +-- pn[5] = hdr[0]; +--} +-- +--static int gcmp_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb) +--{ +-- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; +-- struct ieee80211_key *key = tx->key; +-- struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); +-- int hdrlen, len, tail; +-- u8 *pos; +-- u8 pn[6]; +-- u64 pn64; +-- u8 aad[2 * AES_BLOCK_SIZE]; +-- u8 j_0[AES_BLOCK_SIZE]; +-- +-- if (info->control.hw_key && +-- !(info->control.hw_key->flags & IEEE80211_KEY_FLAG_GENERATE_IV) && +-- !(info->control.hw_key->flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE) && +-- !((info->control.hw_key->flags & +-- IEEE80211_KEY_FLAG_GENERATE_IV_MGMT) && +-- ieee80211_is_mgmt(hdr->frame_control))) { +-- /* hwaccel has no need for preallocated room for GCMP +-- * header or MIC fields +-- */ +-- return 0; +-- } +-- +-- hdrlen = ieee80211_hdrlen(hdr->frame_control); +-- len = skb->len - hdrlen; +-- +-- if (info->control.hw_key) +-- tail = 0; +-- else +-- tail = IEEE80211_GCMP_MIC_LEN; +-- +-- if (WARN_ON(skb_tailroom(skb) < tail || +-- skb_headroom(skb) < IEEE80211_GCMP_HDR_LEN)) +-- return -1; +-- +-- pos = skb_push(skb, IEEE80211_GCMP_HDR_LEN); +-- memmove(pos, pos + IEEE80211_GCMP_HDR_LEN, hdrlen); +-- skb_set_network_header(skb, skb_network_offset(skb) + +-- IEEE80211_GCMP_HDR_LEN); +-- +-- /* the HW only needs room for the IV, but not the actual IV */ +-- if (info->control.hw_key && +-- (info->control.hw_key->flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE)) +-- return 0; +-- +-- hdr = (struct ieee80211_hdr *)pos; +-- pos += hdrlen; +-- +-- pn64 = atomic64_inc_return(&key->u.gcmp.tx_pn); +-- +-- pn[5] = pn64; +-- pn[4] = pn64 >> 8; +-- pn[3] = pn64 >> 16; +-- pn[2] = pn64 >> 24; +-- pn[1] = pn64 >> 32; +-- pn[0] = pn64 >> 40; +-- +-- gcmp_pn2hdr(pos, pn, key->conf.keyidx); +-- +-- /* hwaccel - with software GCMP header */ +-- if (info->control.hw_key) +-- return 0; +-- +-- pos += IEEE80211_GCMP_HDR_LEN; +-- gcmp_special_blocks(skb, pn, j_0, aad); +-- ieee80211_aes_gcm_encrypt(key->u.gcmp.tfm, j_0, aad, pos, len, +-- skb_put(skb, IEEE80211_GCMP_MIC_LEN)); +-- +-- return 0; +--} +-- +--ieee80211_tx_result +--ieee80211_crypto_gcmp_encrypt(struct ieee80211_tx_data *tx) +--{ +-- struct sk_buff *skb; +-- +-- ieee80211_tx_set_protected(tx); +-- +-- skb_queue_walk(&tx->skbs, skb) { +-- if (gcmp_encrypt_skb(tx, skb) < 0) +-- return TX_DROP; +-- } +-- +-- return TX_CONTINUE; +--} +-- +--ieee80211_rx_result +--ieee80211_crypto_gcmp_decrypt(struct ieee80211_rx_data *rx) +--{ +-- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; +-- int hdrlen; +-- struct ieee80211_key *key = rx->key; +-- struct sk_buff *skb = rx->skb; +-- struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); +-- u8 pn[IEEE80211_GCMP_PN_LEN]; +-- int data_len; +-- int queue; +-- +-- hdrlen = ieee80211_hdrlen(hdr->frame_control); +-- +-- if (!ieee80211_is_data(hdr->frame_control) && +-- !ieee80211_is_robust_mgmt_frame(skb)) +-- return RX_CONTINUE; +-- +-- data_len = skb->len - hdrlen - IEEE80211_GCMP_HDR_LEN - +-- IEEE80211_GCMP_MIC_LEN; +-- if (!rx->sta || data_len < 0) +-- return RX_DROP_UNUSABLE; +-- +-- if (status->flag & RX_FLAG_DECRYPTED) { +-- if (!pskb_may_pull(rx->skb, hdrlen + IEEE80211_GCMP_HDR_LEN)) +-- return RX_DROP_UNUSABLE; +-- } else { +-- if (skb_linearize(rx->skb)) +-- return RX_DROP_UNUSABLE; +-- } +-- +-- gcmp_hdr2pn(pn, skb->data + hdrlen); +-- +-- queue = rx->security_idx; +-- +-- if (memcmp(pn, key->u.gcmp.rx_pn[queue], IEEE80211_GCMP_PN_LEN) <= 0) { +-- key->u.gcmp.replays++; +-- return RX_DROP_UNUSABLE; +-- } +-- +-- if (!(status->flag & RX_FLAG_DECRYPTED)) { +-- u8 aad[2 * AES_BLOCK_SIZE]; +-- u8 j_0[AES_BLOCK_SIZE]; +-- /* hardware didn't decrypt/verify MIC */ +-- gcmp_special_blocks(skb, pn, j_0, aad); +-- +-- if (ieee80211_aes_gcm_decrypt( +-- key->u.gcmp.tfm, j_0, aad, +-- skb->data + hdrlen + IEEE80211_GCMP_HDR_LEN, +-- data_len, +-- skb->data + skb->len - IEEE80211_GCMP_MIC_LEN)) +-- return RX_DROP_UNUSABLE; +-- } +-- +-- memcpy(key->u.gcmp.rx_pn[queue], pn, IEEE80211_GCMP_PN_LEN); +-- +-- /* Remove GCMP header and MIC */ +-- if (pskb_trim(skb, skb->len - IEEE80211_GCMP_MIC_LEN)) +-- return RX_DROP_UNUSABLE; +-- memmove(skb->data + IEEE80211_GCMP_HDR_LEN, skb->data, hdrlen); +-- skb_pull(skb, IEEE80211_GCMP_HDR_LEN); +-- +-- return RX_CONTINUE; +--} +-- +- static ieee80211_tx_result +- ieee80211_crypto_cs_encrypt(struct ieee80211_tx_data *tx, +- struct sk_buff *skb) +-@@ -956,48 +734,6 @@ ieee80211_crypto_aes_cmac_encrypt(struct +- return TX_CONTINUE; +- } +- +--ieee80211_tx_result +--ieee80211_crypto_aes_cmac_256_encrypt(struct ieee80211_tx_data *tx) +--{ +-- struct sk_buff *skb; +-- struct ieee80211_tx_info *info; +-- struct ieee80211_key *key = tx->key; +-- struct ieee80211_mmie_16 *mmie; +-- u8 aad[20]; +-- u64 pn64; +-- +-- if (WARN_ON(skb_queue_len(&tx->skbs) != 1)) +-- return TX_DROP; +-- +-- skb = skb_peek(&tx->skbs); +-- +-- info = IEEE80211_SKB_CB(skb); +-- +-- if (info->control.hw_key) +-- return TX_CONTINUE; +-- +-- if (WARN_ON(skb_tailroom(skb) < sizeof(*mmie))) +-- return TX_DROP; +-- +-- mmie = (struct ieee80211_mmie_16 *)skb_put(skb, sizeof(*mmie)); +-- mmie->element_id = WLAN_EID_MMIE; +-- mmie->length = sizeof(*mmie) - 2; +-- mmie->key_id = cpu_to_le16(key->conf.keyidx); +-- +-- /* PN = PN + 1 */ +-- pn64 = atomic64_inc_return(&key->u.aes_cmac.tx_pn); +-- +-- bip_ipn_set64(mmie->sequence_number, pn64); +-- +-- bip_aad(skb, aad); +-- +-- /* MIC = AES-256-CMAC(IGTK, AAD || Management Frame Body || MMIE, 128) +-- */ +-- ieee80211_aes_cmac_256(key->u.aes_cmac.tfm, aad, +-- skb->data + 24, skb->len - 24, mmie->mic); +-- +-- return TX_CONTINUE; +--} +- +- ieee80211_rx_result +- ieee80211_crypto_aes_cmac_decrypt(struct ieee80211_rx_data *rx) +-@@ -1045,160 +781,6 @@ ieee80211_crypto_aes_cmac_decrypt(struct +- +- /* Remove MMIE */ +- skb_trim(skb, skb->len - sizeof(*mmie)); +-- +-- return RX_CONTINUE; +--} +-- +--ieee80211_rx_result +--ieee80211_crypto_aes_cmac_256_decrypt(struct ieee80211_rx_data *rx) +--{ +-- struct sk_buff *skb = rx->skb; +-- struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); +-- struct ieee80211_key *key = rx->key; +-- struct ieee80211_mmie_16 *mmie; +-- u8 aad[20], mic[16], ipn[6]; +-- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; +-- +-- if (!ieee80211_is_mgmt(hdr->frame_control)) +-- return RX_CONTINUE; +-- +-- /* management frames are already linear */ +-- +-- if (skb->len < 24 + sizeof(*mmie)) +-- return RX_DROP_UNUSABLE; +-- +-- mmie = (struct ieee80211_mmie_16 *) +-- (skb->data + skb->len - sizeof(*mmie)); +-- if (mmie->element_id != WLAN_EID_MMIE || +-- mmie->length != sizeof(*mmie) - 2) +-- return RX_DROP_UNUSABLE; /* Invalid MMIE */ +-- +-- bip_ipn_swap(ipn, mmie->sequence_number); +-- +-- if (memcmp(ipn, key->u.aes_cmac.rx_pn, 6) <= 0) { +-- key->u.aes_cmac.replays++; +-- return RX_DROP_UNUSABLE; +-- } +-- +-- if (!(status->flag & RX_FLAG_DECRYPTED)) { +-- /* hardware didn't decrypt/verify MIC */ +-- bip_aad(skb, aad); +-- ieee80211_aes_cmac_256(key->u.aes_cmac.tfm, aad, +-- skb->data + 24, skb->len - 24, mic); +-- if (memcmp(mic, mmie->mic, sizeof(mmie->mic)) != 0) { +-- key->u.aes_cmac.icverrors++; +-- return RX_DROP_UNUSABLE; +-- } +-- } +-- +-- memcpy(key->u.aes_cmac.rx_pn, ipn, 6); +-- +-- /* Remove MMIE */ +-- skb_trim(skb, skb->len - sizeof(*mmie)); +-- +-- return RX_CONTINUE; +--} +-- +--ieee80211_tx_result +--ieee80211_crypto_aes_gmac_encrypt(struct ieee80211_tx_data *tx) +--{ +-- struct sk_buff *skb; +-- struct ieee80211_tx_info *info; +-- struct ieee80211_key *key = tx->key; +-- struct ieee80211_mmie_16 *mmie; +-- struct ieee80211_hdr *hdr; +-- u8 aad[20]; +-- u64 pn64; +-- u8 nonce[12]; +-- +-- if (WARN_ON(skb_queue_len(&tx->skbs) != 1)) +-- return TX_DROP; +-- +-- skb = skb_peek(&tx->skbs); +-- +-- info = IEEE80211_SKB_CB(skb); +-- +-- if (info->control.hw_key) +-- return TX_CONTINUE; +-- +-- if (WARN_ON(skb_tailroom(skb) < sizeof(*mmie))) +-- return TX_DROP; +-- +-- mmie = (struct ieee80211_mmie_16 *)skb_put(skb, sizeof(*mmie)); +-- mmie->element_id = WLAN_EID_MMIE; +-- mmie->length = sizeof(*mmie) - 2; +-- mmie->key_id = cpu_to_le16(key->conf.keyidx); +-- +-- /* PN = PN + 1 */ +-- pn64 = atomic64_inc_return(&key->u.aes_gmac.tx_pn); +-- +-- bip_ipn_set64(mmie->sequence_number, pn64); +-- +-- bip_aad(skb, aad); +-- +-- hdr = (struct ieee80211_hdr *)skb->data; +-- memcpy(nonce, hdr->addr2, ETH_ALEN); +-- bip_ipn_swap(nonce + ETH_ALEN, mmie->sequence_number); +-- +-- /* MIC = AES-GMAC(IGTK, AAD || Management Frame Body || MMIE, 128) */ +-- if (ieee80211_aes_gmac(key->u.aes_gmac.tfm, aad, nonce, +-- skb->data + 24, skb->len - 24, mmie->mic) < 0) +-- return TX_DROP; +-- +-- return TX_CONTINUE; +--} +-- +--ieee80211_rx_result +--ieee80211_crypto_aes_gmac_decrypt(struct ieee80211_rx_data *rx) +--{ +-- struct sk_buff *skb = rx->skb; +-- struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); +-- struct ieee80211_key *key = rx->key; +-- struct ieee80211_mmie_16 *mmie; +-- u8 aad[20], mic[16], ipn[6], nonce[12]; +-- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; +-- +-- if (!ieee80211_is_mgmt(hdr->frame_control)) +-- return RX_CONTINUE; +-- +-- /* management frames are already linear */ +-- +-- if (skb->len < 24 + sizeof(*mmie)) +-- return RX_DROP_UNUSABLE; +-- +-- mmie = (struct ieee80211_mmie_16 *) +-- (skb->data + skb->len - sizeof(*mmie)); +-- if (mmie->element_id != WLAN_EID_MMIE || +-- mmie->length != sizeof(*mmie) - 2) +-- return RX_DROP_UNUSABLE; /* Invalid MMIE */ +-- +-- bip_ipn_swap(ipn, mmie->sequence_number); +-- +-- if (memcmp(ipn, key->u.aes_gmac.rx_pn, 6) <= 0) { +-- key->u.aes_gmac.replays++; +-- return RX_DROP_UNUSABLE; +-- } +-- +-- if (!(status->flag & RX_FLAG_DECRYPTED)) { +-- /* hardware didn't decrypt/verify MIC */ +-- bip_aad(skb, aad); +-- +-- memcpy(nonce, hdr->addr2, ETH_ALEN); +-- memcpy(nonce + ETH_ALEN, ipn, 6); +-- +-- if (ieee80211_aes_gmac(key->u.aes_gmac.tfm, aad, nonce, +-- skb->data + 24, skb->len - 24, +-- mic) < 0 || +-- memcmp(mic, mmie->mic, sizeof(mmie->mic)) != 0) { +-- key->u.aes_gmac.icverrors++; +-- return RX_DROP_UNUSABLE; +-- } +-- } +-- +-- memcpy(key->u.aes_gmac.rx_pn, ipn, 6); +-- +-- /* Remove MMIE */ +-- skb_trim(skb, skb->len - sizeof(*mmie)); +- +- return RX_CONTINUE; +- } +---- a/net/mac80211/wpa.h +-+++ b/net/mac80211/wpa.h +-@@ -24,32 +24,17 @@ ieee80211_rx_result +- ieee80211_crypto_tkip_decrypt(struct ieee80211_rx_data *rx); +- +- ieee80211_tx_result +--ieee80211_crypto_ccmp_encrypt(struct ieee80211_tx_data *tx, +-- unsigned int mic_len); +-+ieee80211_crypto_ccmp_encrypt(struct ieee80211_tx_data *tx); +- ieee80211_rx_result +--ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx, +-- unsigned int mic_len); +-+ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx); +- +- ieee80211_tx_result +- ieee80211_crypto_aes_cmac_encrypt(struct ieee80211_tx_data *tx); +--ieee80211_tx_result +--ieee80211_crypto_aes_cmac_256_encrypt(struct ieee80211_tx_data *tx); +- ieee80211_rx_result +- ieee80211_crypto_aes_cmac_decrypt(struct ieee80211_rx_data *rx); +--ieee80211_rx_result +--ieee80211_crypto_aes_cmac_256_decrypt(struct ieee80211_rx_data *rx); +--ieee80211_tx_result +--ieee80211_crypto_aes_gmac_encrypt(struct ieee80211_tx_data *tx); +--ieee80211_rx_result +--ieee80211_crypto_aes_gmac_decrypt(struct ieee80211_rx_data *rx); +- ieee80211_tx_result +- ieee80211_crypto_hw_encrypt(struct ieee80211_tx_data *tx); +- ieee80211_rx_result +- ieee80211_crypto_hw_decrypt(struct ieee80211_rx_data *rx); +- +--ieee80211_tx_result +--ieee80211_crypto_gcmp_encrypt(struct ieee80211_tx_data *tx); +--ieee80211_rx_result +--ieee80211_crypto_gcmp_decrypt(struct ieee80211_rx_data *rx); +-- +- #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 +--- 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 + + --- 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 + 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 +--- a/package/kernel/mac80211/patches/150-disable_addr_notifier.patch ++++ b/package/kernel/mac80211/patches/150-disable_addr_notifier.patch +@@ -18,7 +18,7 @@ + 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; + +@@ -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 + + return 0; + +@@ -52,7 +52,7 @@ + fail_ifa: + 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 + + pm_qos_remove_notifier(PM_QOS_NETWORK_LATENCY, + &local->network_latency_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 +--- 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 * + * the frames sent while scanning on other channel will be + * lost) + */ +diff --git a/package/kernel/mac80211/patches/300-ath9k-force-rx_clear-when-disabling-rx.patch b/package/kernel/mac80211/patches/300-ath9k-force-rx_clear-when-disabling-rx.patch +new file mode 100644 +index 0000000..bddb15a +--- /dev/null ++++ b/package/kernel/mac80211/patches/300-ath9k-force-rx_clear-when-disabling-rx.patch +@@ -0,0 +1,31 @@ ++From: Felix Fietkau ++Date: Sun, 7 Jun 2015 13:53:35 +0200 ++Subject: [PATCH] ath9k: force rx_clear when disabling rx ++ ++This makes stopping Rx more reliable and should reduce the frequency of ++Rx related DMA stop warnings ++ ++Cc: stable@vger.kernel.org ++Signed-off-by: Felix Fietkau ++--- ++ ++--- a/drivers/net/wireless/ath/ath9k/mac.c +++++ b/drivers/net/wireless/ath/ath9k/mac.c ++@@ -677,13 +677,15 @@ void ath9k_hw_startpcureceive(struct ath ++ ++ ath9k_ani_reset(ah, is_scanning); ++ ++- REG_CLR_BIT(ah, AR_DIAG_SW, (AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT)); +++ REG_CLR_BIT(ah, AR_DIAG_SW, +++ AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT | AR_DIAG_FORCE_RX_CLEAR); ++ } ++ EXPORT_SYMBOL(ath9k_hw_startpcureceive); ++ ++ void ath9k_hw_abortpcurecv(struct ath_hw *ah) ++ { ++- REG_SET_BIT(ah, AR_DIAG_SW, AR_DIAG_RX_ABORT | AR_DIAG_RX_DIS); +++ REG_SET_BIT(ah, AR_DIAG_SW, +++ AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT | AR_DIAG_FORCE_RX_CLEAR); ++ ++ ath9k_hw_disable_mib_counters(ah); ++ } +diff --git a/package/kernel/mac80211/patches/300-mac80211-add-an-intermediate-software-queue-implemen.patch b/package/kernel/mac80211/patches/300-mac80211-add-an-intermediate-software-queue-implemen.patch +deleted file mode 100644 +index 237121b..0000000 +--- a/package/kernel/mac80211/patches/300-mac80211-add-an-intermediate-software-queue-implemen.patch ++++ /dev/null +@@ -1,882 +0,0 @@ +-From: Felix Fietkau +-Date: Tue, 18 Nov 2014 23:58:51 +0100 +-Subject: [PATCH] mac80211: add an intermediate software queue implementation +- +-This allows drivers to request per-vif and per-sta-tid queues from which +-they can pull frames. This makes it easier to keep the hardware queues +-short, and to improve fairness between clients and vifs. +- +-The task of scheduling packet transmission is left up to the driver - +-queueing is controlled by mac80211. Drivers can only dequeue packets by +-calling ieee80211_tx_dequeue. This makes it possible to add active queue +-management later without changing drivers using this code. +- +-This can also be used as a starting point to implement A-MSDU +-aggregation in a way that does not add artificially induced latency. +- +-Signed-off-by: Felix Fietkau +---- +- +---- a/include/net/mac80211.h +-+++ b/include/net/mac80211.h +-@@ -84,6 +84,39 @@ +- * +- */ +- +-+/** +-+ * DOC: mac80211 software tx queueing +-+ * +-+ * mac80211 provides an optional intermediate queueing implementation designed +-+ * to allow the driver to keep hardware queues short and provide some fairness +-+ * between different stations/interfaces. +-+ * In this model, the driver pulls data frames from the mac80211 queue instead +-+ * of letting mac80211 push them via drv_tx(). +-+ * Other frames (e.g. control or management) are still pushed using drv_tx(). +-+ * +-+ * Drivers indicate that they use this model by implementing the .wake_tx_queue +-+ * driver operation. +-+ * +-+ * Intermediate queues (struct ieee80211_txq) are kept per-sta per-tid, with a +-+ * single per-vif queue for multicast data frames. +-+ * +-+ * The driver is expected to initialize its private per-queue data for stations +-+ * and interfaces in the .add_interface and .sta_add ops. +-+ * +-+ * The driver can't access the queue directly. To dequeue a frame, it calls +-+ * ieee80211_tx_dequeue(). Whenever mac80211 adds a new frame to a queue, it +-+ * calls the .wake_tx_queue driver op. +-+ * +-+ * For AP powersave TIM handling, the driver only needs to indicate if it has +-+ * buffered packets in the driver specific data structures by calling +-+ * ieee80211_sta_set_buffered(). For frames buffered in the ieee80211_txq +-+ * struct, mac80211 sets the appropriate TIM PVB bits and calls +-+ * .release_buffered_frames(). +-+ * In that callback the driver is therefore expected to release its own +-+ * buffered frames and afterwards also frames from the ieee80211_txq (obtained +-+ * via the usual ieee80211_tx_dequeue). +-+ */ +-+ +- struct device; +- +- /** +-@@ -1246,6 +1279,7 @@ enum ieee80211_vif_flags { +- * monitor interface (if that is requested.) +- * @drv_priv: data area for driver use, will always be aligned to +- * sizeof(void *). +-+ * @txq: the multicast data TX queue (if driver uses the TXQ abstraction) +- */ +- struct ieee80211_vif { +- enum nl80211_iftype type; +-@@ -1257,6 +1291,8 @@ struct ieee80211_vif { +- u8 cab_queue; +- u8 hw_queue[IEEE80211_NUM_ACS]; +- +-+ struct ieee80211_txq *txq; +-+ +- struct ieee80211_chanctx_conf __rcu *chanctx_conf; +- +- u32 driver_flags; +-@@ -1501,6 +1537,7 @@ struct ieee80211_sta_rates { +- * @tdls_initiator: indicates the STA is an initiator of the TDLS link. Only +- * valid if the STA is a TDLS peer in the first place. +- * @mfp: indicates whether the STA uses management frame protection or not. +-+ * @txq: per-TID data TX queues (if driver uses the TXQ abstraction) +- */ +- struct ieee80211_sta { +- u32 supp_rates[IEEE80211_NUM_BANDS]; +-@@ -1519,6 +1556,8 @@ struct ieee80211_sta { +- bool tdls_initiator; +- bool mfp; +- +-+ struct ieee80211_txq *txq[IEEE80211_NUM_TIDS]; +-+ +- /* must be last */ +- u8 drv_priv[0] __aligned(sizeof(void *)); +- }; +-@@ -1547,6 +1586,27 @@ struct ieee80211_tx_control { +- }; +- +- /** +-+ * struct ieee80211_txq - Software intermediate tx queue +-+ * +-+ * @vif: &struct ieee80211_vif pointer from the add_interface callback. +-+ * @sta: station table entry, %NULL for per-vif queue +-+ * @tid: the TID for this queue (unused for per-vif queue) +-+ * @ac: the AC for this queue +-+ * +-+ * The driver can obtain packets from this queue by calling +-+ * ieee80211_tx_dequeue(). +-+ */ +-+struct ieee80211_txq { +-+ struct ieee80211_vif *vif; +-+ struct ieee80211_sta *sta; +-+ u8 tid; +-+ u8 ac; +-+ +-+ /* must be last */ +-+ u8 drv_priv[0] __aligned(sizeof(void *)); +-+}; +-+ +-+/** +- * enum ieee80211_hw_flags - hardware flags +- * +- * These flags are used to indicate hardware capabilities to +-@@ -1770,6 +1830,8 @@ enum ieee80211_hw_flags { +- * within &struct ieee80211_sta. +- * @chanctx_data_size: size (in bytes) of the drv_priv data area +- * within &struct ieee80211_chanctx_conf. +-+ * @txq_data_size: size (in bytes) of the drv_priv data area +-+ * within @struct ieee80211_txq. +- * +- * @max_rates: maximum number of alternate rate retry stages the hw +- * can handle. +-@@ -1818,6 +1880,9 @@ enum ieee80211_hw_flags { +- * @n_cipher_schemes: a size of an array of cipher schemes definitions. +- * @cipher_schemes: a pointer to an array of cipher scheme definitions +- * supported by HW. +-+ * +-+ * @txq_ac_max_pending: maximum number of frames per AC pending in all txq +-+ * entries for a vif. +- */ +- struct ieee80211_hw { +- struct ieee80211_conf conf; +-@@ -1830,6 +1895,7 @@ struct ieee80211_hw { +- int vif_data_size; +- int sta_data_size; +- int chanctx_data_size; +-+ int txq_data_size; +- u16 queues; +- u16 max_listen_interval; +- s8 max_signal; +-@@ -1846,6 +1912,7 @@ struct ieee80211_hw { +- u8 uapsd_max_sp_len; +- u8 n_cipher_schemes; +- const struct ieee80211_cipher_scheme *cipher_schemes; +-+ int txq_ac_max_pending; +- }; +- +- /** +-@@ -3007,6 +3074,8 @@ enum ieee80211_reconfig_type { +- * response template is provided, together with the location of the +- * switch-timing IE within the template. The skb can only be used within +- * the function call. +-+ * +-+ * @wake_tx_queue: Called when new packets have been added to the queue. +- */ +- struct ieee80211_ops { +- void (*tx)(struct ieee80211_hw *hw, +-@@ -3238,6 +3307,9 @@ struct ieee80211_ops { +- void (*tdls_recv_channel_switch)(struct ieee80211_hw *hw, +- struct ieee80211_vif *vif, +- struct ieee80211_tdls_ch_sw_params *params); +-+ +-+ void (*wake_tx_queue)(struct ieee80211_hw *hw, +-+ struct ieee80211_txq *txq); +- }; +- +- /** +-@@ -5249,4 +5321,15 @@ void ieee80211_unreserve_tid(struct ieee +- */ +- size_t ieee80211_ie_split(const u8 *ies, size_t ielen, +- const u8 *ids, int n_ids, size_t offset); +-+ +-+/** +-+ * ieee80211_tx_dequeue - dequeue a packet from a software tx queue +-+ * +-+ * @hw: pointer as obtained from ieee80211_alloc_hw() +-+ * @txq: pointer obtained from station or virtual interface +-+ * +-+ * Returns the skb if successful, %NULL if no frame was available. +-+ */ +-+struct sk_buff *ieee80211_tx_dequeue(struct ieee80211_hw *hw, +-+ struct ieee80211_txq *txq); +- #endif /* MAC80211_H */ +---- a/net/mac80211/driver-ops.h +-+++ b/net/mac80211/driver-ops.h +-@@ -1367,4 +1367,16 @@ drv_tdls_recv_channel_switch(struct ieee +- trace_drv_return_void(local); +- } +- +-+static inline void drv_wake_tx_queue(struct ieee80211_local *local, +-+ struct txq_info *txq) +-+{ +-+ struct ieee80211_sub_if_data *sdata = vif_to_sdata(txq->txq.vif); +-+ +-+ if (!check_sdata_in_driver(sdata)) +-+ return; +-+ +-+ trace_drv_wake_tx_queue(local, sdata, txq); +-+ local->ops->wake_tx_queue(&local->hw, &txq->txq); +-+} +-+ +- #endif /* __MAC80211_DRIVER_OPS */ +---- a/net/mac80211/ieee80211_i.h +-+++ b/net/mac80211/ieee80211_i.h +-@@ -809,6 +809,19 @@ struct mac80211_qos_map { +- struct rcu_head rcu_head; +- }; +- +-+enum txq_info_flags { +-+ IEEE80211_TXQ_STOP, +-+ IEEE80211_TXQ_AMPDU, +-+}; +-+ +-+struct txq_info { +-+ struct sk_buff_head queue; +-+ unsigned long flags; +-+ +-+ /* keep last! */ +-+ struct ieee80211_txq txq; +-+}; +-+ +- struct ieee80211_sub_if_data { +- struct list_head list; +- +-@@ -853,6 +866,7 @@ struct ieee80211_sub_if_data { +- bool control_port_no_encrypt; +- int encrypt_headroom; +- +-+ atomic_t txqs_len[IEEE80211_NUM_ACS]; +- struct ieee80211_tx_queue_params tx_conf[IEEE80211_NUM_ACS]; +- struct mac80211_qos_map __rcu *qos_map; +- +-@@ -1453,6 +1467,10 @@ static inline struct ieee80211_local *hw +- return container_of(hw, struct ieee80211_local, hw); +- } +- +-+static inline struct txq_info *to_txq_info(struct ieee80211_txq *txq) +-+{ +-+ return container_of(txq, struct txq_info, txq); +-+} +- +- static inline int ieee80211_bssid_match(const u8 *raddr, const u8 *addr) +- { +-@@ -1905,6 +1923,9 @@ static inline bool ieee80211_can_run_wor +- return true; +- } +- +-+void ieee80211_init_tx_queue(struct ieee80211_sub_if_data *sdata, +-+ struct sta_info *sta, +-+ struct txq_info *txq, int tid); +- void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata, +- u16 transaction, u16 auth_alg, u16 status, +- const u8 *extra, size_t extra_len, const u8 *bssid, +---- a/net/mac80211/iface.c +-+++ b/net/mac80211/iface.c +-@@ -969,6 +969,13 @@ static void ieee80211_do_stop(struct iee +- } +- spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); +- +-+ if (sdata->vif.txq) { +-+ struct txq_info *txqi = to_txq_info(sdata->vif.txq); +-+ +-+ ieee80211_purge_tx_queue(&local->hw, &txqi->queue); +-+ atomic_set(&sdata->txqs_len[txqi->txq.ac], 0); +-+ } +-+ +- if (local->open_count == 0) +- ieee80211_clear_tx_pending(local); +- +-@@ -1674,6 +1681,7 @@ int ieee80211_if_add(struct ieee80211_lo +- { +- struct net_device *ndev = NULL; +- struct ieee80211_sub_if_data *sdata = NULL; +-+ struct txq_info *txqi; +- int ret, i; +- int txqs = 1; +- +-@@ -1693,10 +1701,18 @@ int ieee80211_if_add(struct ieee80211_lo +- ieee80211_assign_perm_addr(local, wdev->address, type); +- memcpy(sdata->vif.addr, wdev->address, ETH_ALEN); +- } else { +-+ int size = ALIGN(sizeof(*sdata) + local->hw.vif_data_size, +-+ sizeof(void *)); +-+ int txq_size = 0; +-+ +-+ if (local->ops->wake_tx_queue) +-+ txq_size += sizeof(struct txq_info) + +-+ local->hw.txq_data_size; +-+ +- if (local->hw.queues >= IEEE80211_NUM_ACS) +- txqs = IEEE80211_NUM_ACS; +- +-- ndev = alloc_netdev_mqs(sizeof(*sdata) + local->hw.vif_data_size, +-+ ndev = alloc_netdev_mqs(size + txq_size, +- name, NET_NAME_UNKNOWN, +- ieee80211_if_setup, txqs, 1); +- if (!ndev) +-@@ -1731,6 +1747,11 @@ int ieee80211_if_add(struct ieee80211_lo +- memcpy(sdata->vif.addr, ndev->dev_addr, ETH_ALEN); +- memcpy(sdata->name, ndev->name, IFNAMSIZ); +- +-+ if (txq_size) { +-+ txqi = netdev_priv(ndev) + size; +-+ ieee80211_init_tx_queue(sdata, NULL, txqi, 0); +-+ } +-+ +- sdata->dev = ndev; +- } +- +---- a/net/mac80211/main.c +-+++ b/net/mac80211/main.c +-@@ -1019,6 +1019,9 @@ int ieee80211_register_hw(struct ieee802 +- +- local->dynamic_ps_forced_timeout = -1; +- +-+ if (!local->hw.txq_ac_max_pending) +-+ local->hw.txq_ac_max_pending = 64; +-+ +- result = ieee80211_wep_init(local); +- if (result < 0) +- wiphy_debug(local->hw.wiphy, "Failed to initialize wep: %d\n", +---- a/net/mac80211/sta_info.c +-+++ b/net/mac80211/sta_info.c +-@@ -118,6 +118,16 @@ static void __cleanup_single_sta(struct +- atomic_dec(&ps->num_sta_ps); +- } +- +-+ if (sta->sta.txq[0]) { +-+ for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) { +-+ struct txq_info *txqi = to_txq_info(sta->sta.txq[i]); +-+ int n = skb_queue_len(&txqi->queue); +-+ +-+ ieee80211_purge_tx_queue(&local->hw, &txqi->queue); +-+ atomic_sub(n, &sdata->txqs_len[txqi->txq.ac]); +-+ } +-+ } +-+ +- for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) { +- local->total_ps_buffered -= skb_queue_len(&sta->ps_tx_buf[ac]); +- ieee80211_purge_tx_queue(&local->hw, &sta->ps_tx_buf[ac]); +-@@ -234,6 +244,8 @@ void sta_info_free(struct ieee80211_loca +- +- sta_dbg(sta->sdata, "Destroyed STA %pM\n", sta->sta.addr); +- +-+ if (sta->sta.txq[0]) +-+ kfree(to_txq_info(sta->sta.txq[0])); +- kfree(rcu_dereference_raw(sta->sta.rates)); +- kfree(sta); +- } +-@@ -285,11 +297,12 @@ struct sta_info *sta_info_alloc(struct i +- const u8 *addr, gfp_t gfp) +- { +- struct ieee80211_local *local = sdata->local; +-+ struct ieee80211_hw *hw = &local->hw; +- struct sta_info *sta; +- struct timespec uptime; +- int i; +- +-- sta = kzalloc(sizeof(*sta) + local->hw.sta_data_size, gfp); +-+ sta = kzalloc(sizeof(*sta) + hw->sta_data_size, gfp); +- if (!sta) +- return NULL; +- +-@@ -321,11 +334,25 @@ struct sta_info *sta_info_alloc(struct i +- for (i = 0; i < ARRAY_SIZE(sta->chain_signal_avg); i++) +- ewma_init(&sta->chain_signal_avg[i], 1024, 8); +- +-- if (sta_prepare_rate_control(local, sta, gfp)) { +-- kfree(sta); +-- return NULL; +-+ if (local->ops->wake_tx_queue) { +-+ void *txq_data; +-+ int size = sizeof(struct txq_info) + +-+ ALIGN(hw->txq_data_size, sizeof(void *)); +-+ +-+ txq_data = kcalloc(ARRAY_SIZE(sta->sta.txq), size, gfp); +-+ if (!txq_data) +-+ goto free; +-+ +-+ for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) { +-+ struct txq_info *txq = txq_data + i * size; +-+ +-+ ieee80211_init_tx_queue(sdata, sta, txq, i); +-+ } +- } +- +-+ if (sta_prepare_rate_control(local, sta, gfp)) +-+ goto free_txq; +-+ +- for (i = 0; i < IEEE80211_NUM_TIDS; i++) { +- /* +- * timer_to_tid must be initialized with identity mapping +-@@ -346,7 +373,7 @@ struct sta_info *sta_info_alloc(struct i +- if (sdata->vif.type == NL80211_IFTYPE_AP || +- sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { +- struct ieee80211_supported_band *sband = +-- local->hw.wiphy->bands[ieee80211_get_sdata_band(sdata)]; +-+ hw->wiphy->bands[ieee80211_get_sdata_band(sdata)]; +- u8 smps = (sband->ht_cap.cap & IEEE80211_HT_CAP_SM_PS) >> +- IEEE80211_HT_CAP_SM_PS_SHIFT; +- /* +-@@ -371,6 +398,13 @@ struct sta_info *sta_info_alloc(struct i +- sta_dbg(sdata, "Allocated STA %pM\n", sta->sta.addr); +- +- return sta; +-+ +-+free_txq: +-+ if (sta->sta.txq[0]) +-+ kfree(to_txq_info(sta->sta.txq[0])); +-+free: +-+ kfree(sta); +-+ return NULL; +- } +- +- static int sta_info_insert_check(struct sta_info *sta) +-@@ -640,6 +674,8 @@ static void __sta_info_recalc_tim(struct +- +- indicate_tim |= +- sta->driver_buffered_tids & tids; +-+ indicate_tim |= +-+ sta->txq_buffered_tids & tids; +- } +- +- done: +-@@ -1071,7 +1107,7 @@ void ieee80211_sta_ps_deliver_wakeup(str +- struct ieee80211_sub_if_data *sdata = sta->sdata; +- struct ieee80211_local *local = sdata->local; +- struct sk_buff_head pending; +-- int filtered = 0, buffered = 0, ac; +-+ int filtered = 0, buffered = 0, ac, i; +- unsigned long flags; +- struct ps_data *ps; +- +-@@ -1090,10 +1126,22 @@ void ieee80211_sta_ps_deliver_wakeup(str +- +- BUILD_BUG_ON(BITS_TO_LONGS(IEEE80211_NUM_TIDS) > 1); +- sta->driver_buffered_tids = 0; +-+ sta->txq_buffered_tids = 0; +- +- if (!(local->hw.flags & IEEE80211_HW_AP_LINK_PS)) +- drv_sta_notify(local, sdata, STA_NOTIFY_AWAKE, &sta->sta); +- +-+ if (sta->sta.txq[0]) { +-+ for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) { +-+ struct txq_info *txqi = to_txq_info(sta->sta.txq[i]); +-+ +-+ if (!skb_queue_len(&txqi->queue)) +-+ continue; +-+ +-+ drv_wake_tx_queue(local, txqi); +-+ } +-+ } +-+ +- skb_queue_head_init(&pending); +- +- /* sync with ieee80211_tx_h_unicast_ps_buf */ +-@@ -1275,8 +1323,10 @@ ieee80211_sta_ps_deliver_response(struct +- /* if we already have frames from software, then we can't also +- * release from hardware queues +- */ +-- if (skb_queue_empty(&frames)) +-+ if (skb_queue_empty(&frames)) { +- driver_release_tids |= sta->driver_buffered_tids & tids; +-+ driver_release_tids |= sta->txq_buffered_tids & tids; +-+ } +- +- if (driver_release_tids) { +- /* If the driver has data on more than one TID then +-@@ -1447,6 +1497,9 @@ ieee80211_sta_ps_deliver_response(struct +- +- sta_info_recalc_tim(sta); +- } else { +-+ unsigned long tids = sta->txq_buffered_tids & driver_release_tids; +-+ int tid; +-+ +- /* +- * We need to release a frame that is buffered somewhere in the +- * driver ... it'll have to handle that. +-@@ -1466,8 +1519,22 @@ ieee80211_sta_ps_deliver_response(struct +- * that the TID(s) became empty before returning here from the +- * release function. +- * Either way, however, when the driver tells us that the TID(s) +-- * became empty we'll do the TIM recalculation. +-+ * became empty or we find that a txq became empty, we'll do the +-+ * TIM recalculation. +- */ +-+ +-+ if (!sta->sta.txq[0]) +-+ return; +-+ +-+ for (tid = 0; tid < ARRAY_SIZE(sta->sta.txq); tid++) { +-+ struct txq_info *txqi = to_txq_info(sta->sta.txq[tid]); +-+ +-+ if (!(tids & BIT(tid)) || skb_queue_len(&txqi->queue)) +-+ continue; +-+ +-+ sta_info_recalc_tim(sta); +-+ break; +-+ } +- } +- } +- +---- a/net/mac80211/sta_info.h +-+++ b/net/mac80211/sta_info.h +-@@ -274,6 +274,7 @@ struct sta_ampdu_mlme { +- * entered power saving state, these are also delivered to +- * the station when it leaves powersave or polls for frames +- * @driver_buffered_tids: bitmap of TIDs the driver has data buffered on +-+ * @txq_buffered_tids: bitmap of TIDs that mac80211 has txq data buffered on +- * @rx_packets: Number of MSDUs received from this STA +- * @rx_bytes: Number of bytes received from this STA +- * @last_rx: time (in jiffies) when last frame was received from this STA +-@@ -368,6 +369,7 @@ struct sta_info { +- struct sk_buff_head ps_tx_buf[IEEE80211_NUM_ACS]; +- struct sk_buff_head tx_filtered[IEEE80211_NUM_ACS]; +- unsigned long driver_buffered_tids; +-+ unsigned long txq_buffered_tids; +- +- /* Updated from RX path only, no locking requirements */ +- unsigned long rx_packets; +---- a/net/mac80211/trace.h +-+++ b/net/mac80211/trace.h +-@@ -2312,6 +2312,37 @@ TRACE_EVENT(drv_tdls_recv_channel_switch +- ) +- ); +- +-+TRACE_EVENT(drv_wake_tx_queue, +-+ TP_PROTO(struct ieee80211_local *local, +-+ struct ieee80211_sub_if_data *sdata, +-+ struct txq_info *txq), +-+ +-+ TP_ARGS(local, sdata, txq), +-+ +-+ TP_STRUCT__entry( +-+ LOCAL_ENTRY +-+ VIF_ENTRY +-+ STA_ENTRY +-+ __field(u8, ac) +-+ __field(u8, tid) +-+ ), +-+ +-+ TP_fast_assign( +-+ struct ieee80211_sta *sta = txq->txq.sta; +-+ +-+ LOCAL_ASSIGN; +-+ VIF_ASSIGN; +-+ STA_ASSIGN; +-+ __entry->ac = txq->txq.ac; +-+ __entry->tid = txq->txq.tid; +-+ ), +-+ +-+ TP_printk( +-+ LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " ac:%d tid:%d", +-+ LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->ac, __entry->tid +-+ ) +-+); +-+ +- #ifdef CPTCFG_MAC80211_MESSAGE_TRACING +- #undef TRACE_SYSTEM +- #define TRACE_SYSTEM mac80211_msg +---- a/net/mac80211/tx.c +-+++ b/net/mac80211/tx.c +-@@ -776,12 +776,22 @@ ieee80211_tx_h_rate_ctrl(struct ieee8021 +- return TX_CONTINUE; +- } +- +-+static __le16 ieee80211_tx_next_seq(struct sta_info *sta, int tid) +-+{ +-+ u16 *seq = &sta->tid_seq[tid]; +-+ __le16 ret = cpu_to_le16(*seq); +-+ +-+ /* Increase the sequence number. */ +-+ *seq = (*seq + 0x10) & IEEE80211_SCTL_SEQ; +-+ +-+ return ret; +-+} +-+ +- static ieee80211_tx_result debug_noinline +- ieee80211_tx_h_sequence(struct ieee80211_tx_data *tx) +- { +- struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); +- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; +-- u16 *seq; +- u8 *qc; +- int tid; +- +-@@ -832,13 +842,10 @@ ieee80211_tx_h_sequence(struct ieee80211 +- +- qc = ieee80211_get_qos_ctl(hdr); +- tid = *qc & IEEE80211_QOS_CTL_TID_MASK; +-- seq = &tx->sta->tid_seq[tid]; +- tx->sta->tx_msdu[tid]++; +- +-- hdr->seq_ctrl = cpu_to_le16(*seq); +-- +-- /* Increase the sequence number. */ +-- *seq = (*seq + 0x10) & IEEE80211_SCTL_SEQ; +-+ if (!tx->sta->sta.txq[0]) +-+ hdr->seq_ctrl = ieee80211_tx_next_seq(tx->sta, tid); +- +- return TX_CONTINUE; +- } +-@@ -1067,7 +1074,7 @@ static bool ieee80211_tx_prep_agg(struct +- * nothing -- this aggregation session is being started +- * but that might still fail with the driver +- */ +-- } else { +-+ } else if (!tx->sta->sta.txq[tid]) { +- spin_lock(&tx->sta->lock); +- /* +- * Need to re-check now, because we may get here +-@@ -1201,13 +1208,102 @@ ieee80211_tx_prepare(struct ieee80211_su +- return TX_CONTINUE; +- } +- +-+static void ieee80211_drv_tx(struct ieee80211_local *local, +-+ struct ieee80211_vif *vif, +-+ struct ieee80211_sta *pubsta, +-+ struct sk_buff *skb) +-+{ +-+ struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; +-+ struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); +-+ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); +-+ struct ieee80211_tx_control control = { +-+ .sta = pubsta, +-+ }; +-+ struct ieee80211_txq *txq = NULL; +-+ struct txq_info *txqi; +-+ u8 ac; +-+ +-+ if (info->control.flags & IEEE80211_TX_CTRL_PS_RESPONSE) +-+ goto tx_normal; +-+ +-+ if (!ieee80211_is_data(hdr->frame_control)) +-+ goto tx_normal; +-+ +-+ if (pubsta) { +-+ u8 tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK; +-+ +-+ txq = pubsta->txq[tid]; +-+ } else if (vif) { +-+ txq = vif->txq; +-+ } +-+ +-+ if (!txq) +-+ goto tx_normal; +-+ +-+ ac = txq->ac; +-+ txqi = to_txq_info(txq); +-+ atomic_inc(&sdata->txqs_len[ac]); +-+ if (atomic_read(&sdata->txqs_len[ac]) >= local->hw.txq_ac_max_pending) +-+ netif_stop_subqueue(sdata->dev, ac); +-+ +-+ skb_queue_tail(&txqi->queue, skb); +-+ drv_wake_tx_queue(local, txqi); +-+ +-+ return; +-+ +-+tx_normal: +-+ drv_tx(local, &control, skb); +-+} +-+ +-+struct sk_buff *ieee80211_tx_dequeue(struct ieee80211_hw *hw, +-+ struct ieee80211_txq *txq) +-+{ +-+ struct ieee80211_local *local = hw_to_local(hw); +-+ struct ieee80211_sub_if_data *sdata = vif_to_sdata(txq->vif); +-+ struct txq_info *txqi = container_of(txq, struct txq_info, txq); +-+ struct ieee80211_hdr *hdr; +-+ struct sk_buff *skb = NULL; +-+ u8 ac = txq->ac; +-+ +-+ spin_lock_bh(&txqi->queue.lock); +-+ +-+ if (test_bit(IEEE80211_TXQ_STOP, &txqi->flags)) +-+ goto out; +-+ +-+ skb = __skb_dequeue(&txqi->queue); +-+ if (!skb) +-+ goto out; +-+ +-+ atomic_dec(&sdata->txqs_len[ac]); +-+ if (__netif_subqueue_stopped(sdata->dev, ac)) +-+ ieee80211_propagate_queue_wake(local, sdata->vif.hw_queue[ac]); +-+ +-+ hdr = (struct ieee80211_hdr *)skb->data; +-+ if (txq->sta && ieee80211_is_data_qos(hdr->frame_control)) { +-+ struct sta_info *sta = container_of(txq->sta, struct sta_info, +-+ sta); +-+ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); +-+ +-+ hdr->seq_ctrl = ieee80211_tx_next_seq(sta, txq->tid); +-+ if (test_bit(IEEE80211_TXQ_AMPDU, &txqi->flags)) +-+ info->flags |= IEEE80211_TX_CTL_AMPDU; +-+ else +-+ info->flags &= ~IEEE80211_TX_CTL_AMPDU; +-+ } +-+ +-+out: +-+ spin_unlock_bh(&txqi->queue.lock); +-+ +-+ return skb; +-+} +-+EXPORT_SYMBOL(ieee80211_tx_dequeue); +-+ +- static bool ieee80211_tx_frags(struct ieee80211_local *local, +- struct ieee80211_vif *vif, +- struct ieee80211_sta *sta, +- struct sk_buff_head *skbs, +- bool txpending) +- { +-- struct ieee80211_tx_control control; +- struct sk_buff *skb, *tmp; +- unsigned long flags; +- +-@@ -1265,10 +1361,9 @@ static bool ieee80211_tx_frags(struct ie +- spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); +- +- info->control.vif = vif; +-- control.sta = sta; +- +- __skb_unlink(skb, skbs); +-- drv_tx(local, &control, skb); +-+ ieee80211_drv_tx(local, vif, sta, skb); +- } +- +- return true; +---- a/net/mac80211/util.c +-+++ b/net/mac80211/util.c +-@@ -308,6 +308,11 @@ void ieee80211_propagate_queue_wake(stru +- for (ac = 0; ac < n_acs; ac++) { +- int ac_queue = sdata->vif.hw_queue[ac]; +- +-+ if (local->ops->wake_tx_queue && +-+ (atomic_read(&sdata->txqs_len[ac]) > +-+ local->hw.txq_ac_max_pending)) +-+ continue; +-+ +- if (ac_queue == queue || +- (sdata->vif.cab_queue == queue && +- local->queue_stop_reasons[ac_queue] == 0 && +-@@ -3307,3 +3312,20 @@ u8 *ieee80211_add_wmm_info_ie(u8 *buf, u +- +- return buf; +- } +-+ +-+void ieee80211_init_tx_queue(struct ieee80211_sub_if_data *sdata, +-+ struct sta_info *sta, +-+ struct txq_info *txqi, int tid) +-+{ +-+ skb_queue_head_init(&txqi->queue); +-+ txqi->txq.vif = &sdata->vif; +-+ +-+ if (sta) { +-+ txqi->txq.sta = &sta->sta; +-+ sta->sta.txq[tid] = &txqi->txq; +-+ txqi->txq.ac = ieee802_1d_to_ac[tid & 7]; +-+ } else { +-+ sdata->vif.txq = &txqi->txq; +-+ txqi->txq.ac = IEEE80211_AC_BE; +-+ } +-+} +---- a/net/mac80211/rx.c +-+++ b/net/mac80211/rx.c +-@@ -1176,6 +1176,7 @@ static void sta_ps_start(struct sta_info +- struct ieee80211_sub_if_data *sdata = sta->sdata; +- struct ieee80211_local *local = sdata->local; +- struct ps_data *ps; +-+ int tid; +- +- if (sta->sdata->vif.type == NL80211_IFTYPE_AP || +- sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN) +-@@ -1189,6 +1190,18 @@ static void sta_ps_start(struct sta_info +- drv_sta_notify(local, sdata, STA_NOTIFY_SLEEP, &sta->sta); +- ps_dbg(sdata, "STA %pM aid %d enters power save mode\n", +- sta->sta.addr, sta->sta.aid); +-+ +-+ if (!sta->sta.txq[0]) +-+ return; +-+ +-+ for (tid = 0; tid < ARRAY_SIZE(sta->sta.txq); tid++) { +-+ struct txq_info *txqi = to_txq_info(sta->sta.txq[tid]); +-+ +-+ if (!skb_queue_len(&txqi->queue)) +-+ set_bit(tid, &sta->txq_buffered_tids); +-+ else +-+ clear_bit(tid, &sta->txq_buffered_tids); +-+ } +- } +- +- static void sta_ps_end(struct sta_info *sta) +---- a/net/mac80211/agg-tx.c +-+++ b/net/mac80211/agg-tx.c +-@@ -188,6 +188,43 @@ ieee80211_wake_queue_agg(struct ieee8021 +- __release(agg_queue); +- } +- +-+static void +-+ieee80211_agg_stop_txq(struct sta_info *sta, int tid) +-+{ +-+ struct ieee80211_txq *txq = sta->sta.txq[tid]; +-+ struct txq_info *txqi; +-+ +-+ if (!txq) +-+ return; +-+ +-+ txqi = to_txq_info(txq); +-+ +-+ /* Lock here to protect against further seqno updates on dequeue */ +-+ spin_lock_bh(&txqi->queue.lock); +-+ set_bit(IEEE80211_TXQ_STOP, &txqi->flags); +-+ spin_unlock_bh(&txqi->queue.lock); +-+} +-+ +-+static void +-+ieee80211_agg_start_txq(struct sta_info *sta, int tid, bool enable) +-+{ +-+ struct ieee80211_txq *txq = sta->sta.txq[tid]; +-+ struct txq_info *txqi; +-+ +-+ if (!txq) +-+ return; +-+ +-+ txqi = to_txq_info(txq); +-+ +-+ if (enable) +-+ set_bit(IEEE80211_TXQ_AMPDU, &txqi->flags); +-+ else +-+ clear_bit(IEEE80211_TXQ_AMPDU, &txqi->flags); +-+ +-+ clear_bit(IEEE80211_TXQ_STOP, &txqi->flags); +-+ drv_wake_tx_queue(sta->sdata->local, txqi); +-+} +-+ +- /* +- * splice packets from the STA's pending to the local pending, +- * requires a call to ieee80211_agg_splice_finish later +-@@ -247,6 +284,7 @@ static void ieee80211_remove_tid_tx(stru +- ieee80211_assign_tid_tx(sta, tid, NULL); +- +- ieee80211_agg_splice_finish(sta->sdata, tid); +-+ ieee80211_agg_start_txq(sta, tid, false); +- +- kfree_rcu(tid_tx, rcu_head); +- } +-@@ -418,6 +456,8 @@ void ieee80211_tx_ba_session_handle_star +- */ +- clear_bit(HT_AGG_STATE_WANT_START, &tid_tx->state); +- +-+ ieee80211_agg_stop_txq(sta, tid); +-+ +- /* +- * Make sure no packets are being processed. This ensures that +- * we have a valid starting sequence number and that in-flight +-@@ -440,6 +480,8 @@ void ieee80211_tx_ba_session_handle_star +- ieee80211_agg_splice_finish(sdata, tid); +- spin_unlock_bh(&sta->lock); +- +-+ ieee80211_agg_start_txq(sta, tid, false); +-+ +- kfree_rcu(tid_tx, rcu_head); +- return; +- } +-@@ -666,6 +708,8 @@ static void ieee80211_agg_tx_operational +- ieee80211_agg_splice_finish(sta->sdata, tid); +- +- spin_unlock_bh(&sta->lock); +-+ +-+ ieee80211_agg_start_txq(sta, tid, true); +- } +- +- 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 +--- /dev/null ++++ b/package/kernel/mac80211/patches/301-ath9k-limit-retries-for-powersave-response-frames.patch +@@ -0,0 +1,121 @@ ++From: Felix Fietkau ++Date: Thu, 2 Jul 2015 15:20:56 +0200 ++Subject: [PATCH] ath9k: limit retries for powersave response frames ++ ++In some cases, the channel might be busy enough that an ath9k AP's ++response to PS-Poll frames might be too slow and the station has already ++gone to sleep. To avoid wasting too much airtime on this, limit the ++number of retries on such frames and ensure that no sample rate gets ++used. ++ ++Signed-off-by: Felix Fietkau ++--- ++ ++--- 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_ ++ } ++ ++ static void ath_set_rates(struct ieee80211_vif *vif, struct ieee80211_sta *sta, ++- struct ath_buf *bf) +++ struct ath_buf *bf, bool ps) ++ { +++ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(bf->bf_mpdu); +++ +++ if (ps) { +++ /* Clear the first rate to avoid using a sample rate for PS frames */ +++ info->control.rates[0].idx = -1; +++ info->control.rates[0].count = 0; +++ } +++ ++ ieee80211_get_tx_rates(vif, sta, bf->bf_mpdu, bf->rates, ++ ARRAY_SIZE(bf->rates)); +++ if (!ps) +++ return; +++ +++ if (bf->rates[0].count > 2) +++ bf->rates[0].count = 2; +++ +++ bf->rates[1].idx = -1; ++ } ++ ++ 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, ++ if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) ++ break; ++ ++- ath_set_rates(tid->an->vif, tid->an->sta, bf); +++ ath_set_rates(tid->an->vif, tid->an->sta, bf, false); ++ } while (1); ++ } ++ ++@@ -1461,7 +1476,7 @@ static bool ath_tx_sched_aggr(struct ath ++ return false; ++ } ++ ++- ath_set_rates(tid->an->vif, tid->an->sta, bf); +++ ath_set_rates(tid->an->vif, tid->an->sta, bf, false); ++ 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 ++ ++ __skb_unlink(bf->bf_mpdu, tid_q); ++ list_add_tail(&bf->list, &bf_q); ++- ath_set_rates(tid->an->vif, tid->an->sta, bf); +++ ath_set_rates(tid->an->vif, tid->an->sta, bf, true); ++ 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 ++ struct ath_txq *txq = txctl->txq; ++ struct ath_atx_tid *tid = NULL; ++ struct ath_buf *bf; ++- bool queue, skip_uapsd = false, ps_resp; +++ bool queue, ps_resp; ++ int q, ret; ++ ++ if (vif) ++@@ -2365,13 +2380,13 @@ int ath_tx_start(struct ieee80211_hw *hw ++ if (!txctl->an) ++ txctl->an = &avp->mcast_node; ++ queue = true; ++- skip_uapsd = true; +++ ps_resp = false; ++ } ++ ++ if (txctl->an && queue) ++ tid = ath_get_skb_tid(sc, txctl->an, skb); ++ ++- if (!skip_uapsd && ps_resp) { +++ if (ps_resp) { ++ 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 ++ if (txctl->paprd) ++ bf->bf_state.bfs_paprd_timestamp = jiffies; ++ ++- ath_set_rates(vif, sta, bf); +++ ath_set_rates(vif, sta, bf, ps_resp); ++ ath_tx_send_normal(sc, txq, tid, skb); ++ ++ out: ++@@ -2448,7 +2463,7 @@ void ath_tx_cabq(struct ieee80211_hw *hw ++ break; ++ ++ bf->bf_lastbf = bf; ++- ath_set_rates(vif, NULL, bf); +++ ath_set_rates(vif, NULL, bf, false); ++ 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 ++ return -EINVAL; ++ } ++ ++- ath_set_rates(sc->tx99_vif, NULL, bf); +++ ath_set_rates(sc->tx99_vif, NULL, bf, false); ++ ++ ath9k_hw_set_desc_link(sc->sc_ah, bf->bf_desc, bf->bf_daddr); ++ ath9k_hw_tx99_start(sc->sc_ah, txctl->txq->axq_qnum); +diff --git a/package/kernel/mac80211/patches/301-mac80211-lock-rate-control.patch b/package/kernel/mac80211/patches/301-mac80211-lock-rate-control.patch +deleted file mode 100644 +index 465d943..0000000 +--- a/package/kernel/mac80211/patches/301-mac80211-lock-rate-control.patch ++++ /dev/null +@@ -1,125 +0,0 @@ +-From: Johannes Berg +-Date: Wed, 11 Mar 2015 09:14:15 +0100 +-Subject: [PATCH] mac80211: lock rate control +- +-Both minstrel (reported by Sven Eckelmann) and the iwlwifi rate +-control aren't properly taking concurrency into account. It's +-likely that the same is true for other rate control algorithms. +- +-In the case of minstrel this manifests itself in crashes when an +-update and other data access are run concurrently, for example +-when the stations change bandwidth or similar. In iwlwifi, this +-can cause firmware crashes. +- +-Since fixing all rate control algorithms will be very difficult, +-just provide locking for invocations. This protects the internal +-data structures the algorithms maintain. +- +-I've manipulated hostapd to test this, by having it change its +-advertised bandwidth roughly ever 150ms. At the same time, I'm +-running a flood ping between the client and the AP, which causes +-this race of update vs. get_rate/status to easily happen on the +-client. With this change, the system survives this test. +- +-Reported-by: Sven Eckelmann +-Signed-off-by: Johannes Berg +---- +- +---- a/net/mac80211/rate.c +-+++ b/net/mac80211/rate.c +-@@ -683,7 +683,13 @@ void rate_control_get_rate(struct ieee80 +- if (sdata->local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL) +- return; +- +-- ref->ops->get_rate(ref->priv, ista, priv_sta, txrc); +-+ if (ista) { +-+ spin_lock_bh(&sta->rate_ctrl_lock); +-+ ref->ops->get_rate(ref->priv, ista, priv_sta, txrc); +-+ spin_unlock_bh(&sta->rate_ctrl_lock); +-+ } else { +-+ ref->ops->get_rate(ref->priv, NULL, NULL, txrc); +-+ } +- +- if (sdata->local->hw.flags & IEEE80211_HW_SUPPORTS_RC_TABLE) +- return; +---- a/net/mac80211/rate.h +-+++ b/net/mac80211/rate.h +-@@ -42,10 +42,12 @@ static inline void rate_control_tx_statu +- if (!ref || !test_sta_flag(sta, WLAN_STA_RATE_CONTROL)) +- return; +- +-+ spin_lock_bh(&sta->rate_ctrl_lock); +- if (ref->ops->tx_status) +- ref->ops->tx_status(ref->priv, sband, ista, priv_sta, skb); +- else +- ref->ops->tx_status_noskb(ref->priv, sband, ista, priv_sta, info); +-+ spin_unlock_bh(&sta->rate_ctrl_lock); +- } +- +- static inline void +-@@ -64,7 +66,9 @@ rate_control_tx_status_noskb(struct ieee +- if (WARN_ON_ONCE(!ref->ops->tx_status_noskb)) +- return; +- +-+ spin_lock_bh(&sta->rate_ctrl_lock); +- ref->ops->tx_status_noskb(ref->priv, sband, ista, priv_sta, info); +-+ spin_unlock_bh(&sta->rate_ctrl_lock); +- } +- +- static inline void rate_control_rate_init(struct sta_info *sta) +-@@ -91,8 +95,10 @@ static inline void rate_control_rate_ini +- +- 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); +- } +-@@ -115,18 +121,20 @@ static inline void rate_control_rate_upd +- 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); +- } +- +- static inline void *rate_control_alloc_sta(struct rate_control_ref *ref, +-- struct ieee80211_sta *sta, +-- gfp_t gfp) +-+ struct sta_info *sta, gfp_t gfp) +- { +-- return ref->ops->alloc_sta(ref->priv, sta, gfp); +-+ spin_lock_init(&sta->rate_ctrl_lock); +-+ return ref->ops->alloc_sta(ref->priv, &sta->sta, gfp); +- } +- +- static inline void rate_control_free_sta(struct sta_info *sta) +---- a/net/mac80211/sta_info.c +-+++ b/net/mac80211/sta_info.c +-@@ -286,7 +286,7 @@ static int sta_prepare_rate_control(stru +- +- sta->rate_ctrl = local->rate_ctrl; +- sta->rate_ctrl_priv = rate_control_alloc_sta(sta->rate_ctrl, +-- &sta->sta, gfp); +-+ sta, gfp); +- if (!sta->rate_ctrl_priv) +- return -ENOMEM; +- +---- a/net/mac80211/sta_info.h +-+++ b/net/mac80211/sta_info.h +-@@ -349,6 +349,7 @@ struct sta_info { +- u8 ptk_idx; +- struct rate_control_ref *rate_ctrl; +- void *rate_ctrl_priv; +-+ spinlock_t rate_ctrl_lock; +- 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 +--- a/package/kernel/mac80211/patches/302-ath9k-restart-only-triggering-DFS-detector-line.patch ++++ /dev/null +@@ -1,21 +0,0 @@ +-From: Zefir Kurtisi +-Date: Tue, 10 Mar 2015 17:49:29 +0100 +-Subject: [PATCH] ath9k: restart only triggering DFS detector line +- +-To support HT40 DFS mode, a triggering detector must +-reset only itself but not other detector lines. +- +-Signed-off-by: Zefir Kurtisi +---- +- +---- a/drivers/net/wireless/ath/dfs_pattern_detector.c +-+++ b/drivers/net/wireless/ath/dfs_pattern_detector.c +-@@ -289,7 +289,7 @@ dpd_add_pulse(struct dfs_pattern_detecto +- "count=%d, count_false=%d\n", +- event->freq, pd->rs->type_id, +- ps->pri, ps->count, ps->count_falses); +-- channel_detector_reset(dpd, cd); +-+ pd->reset(pd, dpd->last_pulse_ts); +- return true; +- } +- } +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 +--- a/package/kernel/mac80211/patches/303-ath9k-add-DFS-support-for-extension-channel.patch ++++ /dev/null +@@ -1,76 +0,0 @@ +-From: Zefir Kurtisi +-Date: Tue, 10 Mar 2015 17:49:30 +0100 +-Subject: [PATCH] ath9k: add DFS support for extension channel +- +-In HT40 modes, pulse events on primary and extension +-channel are processed individually. If valid, a pulse +-event will be fed into the detector +-* for primary frequency, or +-* for extension frequency (+/-20MHz based on HT40-mode) +-* or both +- +-With that, a 40MHz radar will result in two individual +-radar events. +- +-Signed-off-by: Zefir Kurtisi +---- +- +---- a/drivers/net/wireless/ath/ath9k/dfs.c +-+++ b/drivers/net/wireless/ath/ath9k/dfs.c +-@@ -126,8 +126,19 @@ ath9k_postprocess_radar_event(struct ath +- DFS_STAT_INC(sc, pulses_detected); +- return true; +- } +--#undef PRI_CH_RADAR_FOUND +--#undef EXT_CH_RADAR_FOUND +-+ +-+static void +-+ath9k_dfs_process_radar_pulse(struct ath_softc *sc, struct pulse_event *pe) +-+{ +-+ struct dfs_pattern_detector *pd = sc->dfs_detector; +-+ DFS_STAT_INC(sc, pulses_processed); +-+ if (pd == NULL) +-+ return; +-+ if (!pd->add_pulse(pd, pe)) +-+ return; +-+ DFS_STAT_INC(sc, radar_detected); +-+ ieee80211_radar_detected(sc->hw); +-+} +- +- /* +- * DFS: check PHY-error for radar pulse and feed the detector +-@@ -176,18 +187,21 @@ void ath9k_dfs_process_phyerr(struct ath +- ard.pulse_length_pri = vdata_end[-3]; +- pe.freq = ah->curchan->channel; +- pe.ts = mactime; +-- if (ath9k_postprocess_radar_event(sc, &ard, &pe)) { +-- struct dfs_pattern_detector *pd = sc->dfs_detector; +-- ath_dbg(common, DFS, +-- "ath9k_dfs_process_phyerr: channel=%d, ts=%llu, " +-- "width=%d, rssi=%d, delta_ts=%llu\n", +-- pe.freq, pe.ts, pe.width, pe.rssi, +-- pe.ts - sc->dfs_prev_pulse_ts); +-- sc->dfs_prev_pulse_ts = pe.ts; +-- DFS_STAT_INC(sc, pulses_processed); +-- if (pd != NULL && pd->add_pulse(pd, &pe)) { +-- DFS_STAT_INC(sc, radar_detected); +-- ieee80211_radar_detected(sc->hw); +-- } +-+ if (!ath9k_postprocess_radar_event(sc, &ard, &pe)) +-+ return; +-+ +-+ ath_dbg(common, DFS, +-+ "ath9k_dfs_process_phyerr: type=%d, freq=%d, ts=%llu, " +-+ "width=%d, rssi=%d, delta_ts=%llu\n", +-+ ard.pulse_bw_info, pe.freq, pe.ts, pe.width, pe.rssi, +-+ pe.ts - sc->dfs_prev_pulse_ts); +-+ sc->dfs_prev_pulse_ts = pe.ts; +-+ if (ard.pulse_bw_info & PRI_CH_RADAR_FOUND) +-+ ath9k_dfs_process_radar_pulse(sc, &pe); +-+ if (ard.pulse_bw_info & EXT_CH_RADAR_FOUND) { +-+ pe.freq += IS_CHAN_HT40PLUS(ah->curchan) ? 20 : -20; +-+ ath9k_dfs_process_radar_pulse(sc, &pe); +- } +- } +-+#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 +new file mode 100644 +index 0000000..139015c +--- /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 ++ ++Signed-off-by: Felix Fietkau ++--- ++ ++--- 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); ++ ++ if (ath9k_ps_enable) ++ ieee80211_hw_set(hw, SUPPORTS_PS); +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 +--- a/package/kernel/mac80211/patches/304-ath9k-allow-40MHz-radar-detection-width.patch ++++ /dev/null +@@ -1,19 +0,0 @@ +-From: Zefir Kurtisi +-Date: Tue, 10 Mar 2015 17:49:31 +0100 +-Subject: [PATCH] ath9k: allow 40MHz radar detection width +- +-Signed-off-by: Zefir Kurtisi +---- +- +---- a/drivers/net/wireless/ath/ath9k/init.c +-+++ b/drivers/net/wireless/ath/ath9k/init.c +-@@ -763,7 +763,8 @@ static const struct ieee80211_iface_comb +- .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_20) | +-+ BIT(NL80211_CHAN_WIDTH_40), +- } +- #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 +new file mode 100644 +index 0000000..9f04276 +--- /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 ++ ++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. ++ ++Signed-off-by: Felix Fietkau ++--- ++ ++--- 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; ++ } ++ } ++ ++@@ -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]; ++ } ++ } ++ ++ 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; ++ +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 +--- a/package/kernel/mac80211/patches/305-ath5k-channel-change-fix.patch ++++ /dev/null +@@ -1,137 +0,0 @@ +-From: Sergey Ryazanov +-Date: Wed, 4 Mar 2015 05:12:10 +0300 +-Subject: [PATCH] ath5k: channel change fix +- +-ath5k updates the channel pointer and after that it stops the Rx logic +-and apply channel to HW. In case of channel switch, such sequence +-creates a small window when a frame, which is received on the old +-channel is considered as a frame received on the new one. +- +-The most notable consequence of this situation occurs during the switch +-from 2 GHz band (CCK+OFDM) to the 5GHz band (OFDM-only). Frame received +-with CCK rate, e.g. beacon received at the 1mbps, causes the following +-warning: +- +- WARNING: at ath5k/base.c:589 ath5k_tasklet_rx+0x318/0x6ec [ath5k]() +- invalid hw_rix: 1a +- [..] +- Call Trace: +- [<802656a8>] show_stack+0x48/0x70 +- [<802dd92c>] warn_slowpath_common+0x88/0xbc +- [<802dd98c>] warn_slowpath_fmt+0x2c/0x38 +- [<81b51be8>] ath5k_tasklet_rx+0x318/0x6ec [ath5k] +- [<8028ac64>] tasklet_action+0x8c/0xf0 +- [<80075804>] __do_softirq+0x180/0x32c +- [<80196ce8>] irq_exit+0x54/0x70 +- [<80041848>] ret_from_irq+0x0/0x4 +- [<80182fdc>] ioread32+0x4/0xc +- [<81b4c42c>] ath5k_hw_set_sleep_clock+0x2ec/0x474 [ath5k] +- [<81b4cf28>] ath5k_hw_reset+0x50/0xeb8 [ath5k] +- [<81b50900>] ath5k_reset+0xd4/0x310 [ath5k] +- [<81b557e8>] ath5k_config+0x4c/0x104 [ath5k] +- [<80d01770>] ieee80211_hw_config+0x2f4/0x35c [mac80211] +- [<80d09aa8>] ieee80211_scan_work+0x2e4/0x414 [mac80211] +- [<8022c3f4>] process_one_work+0x28c/0x400 +- [<802df8f8>] worker_thread+0x258/0x3c0 +- [<801b5710>] kthread+0xe0/0xec +- [<800418a8>] ret_from_kernel_thread+0x14/0x1c +- +-The easiest way to reproduce this warning is to run scan with dualband +-NIC in noisy environments, when the channel 11 runs multiple APs. In my +-tests if the APs num >= 12, the warning appears in the first few +-seconds of scanning. +- +-In order to fix this, the Rx disable code moved to a higher level and +-placed before the channel pointer update. This is also makes the code a +-bit more symmetrical, since we disable and enable the Rx in the same +-function. +- +-In fact, at the pointer update time new frames should not appear, +-because interrupt generation at this point should already be disabled. +-The next patch should address this issue. +- +-CC: Jiri Slaby +-CC: Nick Kossifidis +-CC: Luis R. Rodriguez +-Reported-by: Christophe Prevotaux +-Tested-by: Christophe Prevotaux +-Tested-by: Eric Bree +-Signed-off-by: Sergey Ryazanov +---- +- +---- a/drivers/net/wireless/ath/ath5k/base.c +-+++ b/drivers/net/wireless/ath/ath5k/base.c +-@@ -2858,7 +2858,7 @@ ath5k_reset(struct ath5k_hw *ah, struct +- { +- struct ath_common *common = ath5k_hw_common(ah); +- int ret, ani_mode; +-- bool fast; +-+ bool fast = chan && modparam_fastchanswitch ? 1 : 0; +- +- ATH5K_DBG(ah, ATH5K_DEBUG_RESET, "resetting\n"); +- +-@@ -2876,11 +2876,29 @@ ath5k_reset(struct ath5k_hw *ah, struct +- * so we should also free any remaining +- * tx buffers */ +- ath5k_drain_tx_buffs(ah); +-+ +-+ /* Stop PCU */ +-+ ath5k_hw_stop_rx_pcu(ah); +-+ +-+ /* Stop DMA +-+ * +-+ * Note: If DMA didn't stop continue +-+ * since only a reset will fix it. +-+ */ +-+ ret = ath5k_hw_dma_stop(ah); +-+ +-+ /* RF Bus grant won't work if we have pending +-+ * frames +-+ */ +-+ if (ret && fast) { +-+ ATH5K_DBG(ah, ATH5K_DEBUG_RESET, +-+ "DMA didn't stop, falling back to normal reset\n"); +-+ fast = false; +-+ } +-+ +- if (chan) +- ah->curchan = chan; +- +-- fast = ((chan != NULL) && modparam_fastchanswitch) ? 1 : 0; +-- +- ret = ath5k_hw_reset(ah, ah->opmode, ah->curchan, fast, skip_pcu); +- if (ret) { +- ATH5K_ERR(ah, "can't reset hardware (%d)\n", ret); +---- a/drivers/net/wireless/ath/ath5k/reset.c +-+++ b/drivers/net/wireless/ath/ath5k/reset.c +-@@ -1169,30 +1169,6 @@ ath5k_hw_reset(struct ath5k_hw *ah, enum +- if (ah->ah_version == AR5K_AR5212) +- ath5k_hw_set_sleep_clock(ah, false); +- +-- /* +-- * Stop PCU +-- */ +-- ath5k_hw_stop_rx_pcu(ah); +-- +-- /* +-- * Stop DMA +-- * +-- * Note: If DMA didn't stop continue +-- * since only a reset will fix it. +-- */ +-- ret = ath5k_hw_dma_stop(ah); +-- +-- /* RF Bus grant won't work if we have pending +-- * frames */ +-- if (ret && fast) { +-- ATH5K_DBG(ah, ATH5K_DEBUG_RESET, +-- "DMA didn't stop, falling back to normal reset\n"); +-- fast = false; +-- /* Non fatal, just continue with +-- * normal reset */ +-- ret = 0; +-- } +-- +- 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 +new file mode 100644 +index 0000000..ec860dc +--- /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 ++ ++Use list_empty(&tid->list) instead ++ ++Signed-off-by: Felix Fietkau ++--- ++ ++--- 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 */ ++ ++ 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; ++ ++- if (tid->sched) ++- 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); ++ } ++ ++ static struct ath_frame_info *get_frame_info(struct sk_buff *skb) ++@@ -1556,15 +1553,14 @@ void ath_tx_aggr_sleep(struct ieee80211_ ++ ++ ath_txq_lock(sc, txq); ++ ++- if (!tid->sched) { +++ if (list_empty(&tid->list)) { ++ ath_txq_unlock(sc, txq); ++ continue; ++ } ++ ++ buffered = ath_tid_has_buffered(tid); ++ ++- tid->sched = false; ++- list_del(&tid->list); +++ list_del_init(&tid->list); ++ ++ ath_txq_unlock(sc, txq); ++ ++@@ -1944,8 +1940,7 @@ void ath_txq_schedule(struct ath_softc * ++ break; ++ ++ tid = list_first_entry(tid_list, struct ath_atx_tid, list); ++- list_del(&tid->list); ++- tid->sched = false; +++ list_del_init(&tid->list); ++ ++ 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 +--- a/package/kernel/mac80211/patches/306-ath5k-fix-reset-race.patch ++++ /dev/null +@@ -1,96 +0,0 @@ +-From: Sergey Ryazanov +-Date: Wed, 4 Mar 2015 05:12:11 +0300 +-Subject: [PATCH] ath5k: fix reset race +- +-To prepare for reset ath5k should finish all asynchronous tasks. At +-first, it disables the interrupt generation, then it waits for the +-interrupt handler and tasklets completion, and then proceeds to the HW +-configuration update. But it does not consider that the interrupt +-handler or tasklet re-enables the interrupt generation. And we fall in a +-situation when ath5k assumes that interrupts are disabled, but it is +-not. +- +-This can lead to different consequences, such as reception of the frame, +-when we do not expect it. Under certain circumstances, this can lead to +-the following warning: +- +- WARNING: at ath5k/base.c:589 ath5k_tasklet_rx+0x318/0x6ec [ath5k]() +- invalid hw_rix: 1a +- [..] +- Call Trace: +- [<802656a8>] show_stack+0x48/0x70 +- [<802dd92c>] warn_slowpath_common+0x88/0xbc +- [<802dd98c>] warn_slowpath_fmt+0x2c/0x38 +- [<81b51be8>] ath5k_tasklet_rx+0x318/0x6ec [ath5k] +- [<8028ac64>] tasklet_action+0x8c/0xf0 +- [<80075804>] __do_softirq+0x180/0x32c +- [<80196ce8>] irq_exit+0x54/0x70 +- [<80041848>] ret_from_irq+0x0/0x4 +- [<80182fdc>] ioread32+0x4/0xc +- [<81b4c42c>] ath5k_hw_set_sleep_clock+0x2ec/0x474 [ath5k] +- [<81b4cf28>] ath5k_hw_reset+0x50/0xeb8 [ath5k] +- [<81b50900>] ath5k_reset+0xd4/0x310 [ath5k] +- [<81b557e8>] ath5k_config+0x4c/0x104 [ath5k] +- [<80d01770>] ieee80211_hw_config+0x2f4/0x35c [mac80211] +- [<80d09aa8>] ieee80211_scan_work+0x2e4/0x414 [mac80211] +- [<8022c3f4>] process_one_work+0x28c/0x400 +- [<802df8f8>] worker_thread+0x258/0x3c0 +- [<801b5710>] kthread+0xe0/0xec +- [<800418a8>] ret_from_kernel_thread+0x14/0x1c +- +-Fix this issue by adding a new status flag, which forbids to re-enable +-the interrupt generation until the HW configuration is completed. +- +-Note: previous patch, which reorders the Rx disable code helps to avoid +-the above warning, but not fixes the root cause of unexpected frame +-receiving. +- +-CC: Jiri Slaby +-CC: Nick Kossifidis +-CC: Luis R. Rodriguez +-Reported-by: Christophe Prevotaux +-Tested-by: Christophe Prevotaux +-Tested-by: Eric Bree +-Signed-off-by: Sergey Ryazanov +---- +- +---- a/drivers/net/wireless/ath/ath5k/ath5k.h +-+++ b/drivers/net/wireless/ath/ath5k/ath5k.h +-@@ -1283,6 +1283,7 @@ struct ath5k_hw { +- #define ATH_STAT_PROMISC 1 +- #define ATH_STAT_LEDSOFT 2 /* enable LED gpio status */ +- #define ATH_STAT_STARTED 3 /* opened & irqs enabled */ +-+#define ATH_STAT_RESET 4 /* hw reset */ +- +- unsigned int filter_flags; /* HW flags, AR5K_RX_FILTER_* */ +- unsigned int fif_filter_flags; /* Current FIF_* filter flags */ +---- a/drivers/net/wireless/ath/ath5k/base.c +-+++ b/drivers/net/wireless/ath/ath5k/base.c +-@@ -1523,6 +1523,9 @@ ath5k_set_current_imask(struct ath5k_hw +- enum ath5k_int imask; +- unsigned long flags; +- +-+ if (test_bit(ATH_STAT_RESET, ah->status)) +-+ return; +-+ +- spin_lock_irqsave(&ah->irqlock, flags); +- imask = ah->imask; +- if (ah->rx_pending) +-@@ -2862,6 +2865,8 @@ ath5k_reset(struct ath5k_hw *ah, struct +- +- ATH5K_DBG(ah, ATH5K_DEBUG_RESET, "resetting\n"); +- +-+ __set_bit(ATH_STAT_RESET, ah->status); +-+ +- ath5k_hw_set_imr(ah, 0); +- synchronize_irq(ah->irq); +- ath5k_stop_tasklets(ah); +-@@ -2952,6 +2957,8 @@ ath5k_reset(struct ath5k_hw *ah, struct +- */ +- /* ath5k_chan_change(ah, c); */ +- +-+ __clear_bit(ATH_STAT_RESET, ah->status); +-+ +- 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 +new file mode 100644 +index 0000000..928c93b +--- /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 ++ ++With this .config: http://busybox.net/~vda/kernel_config, ++after deinlining these functions have sizes and callsite counts ++as follows: ++ ++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 ++--- ++ ++--- 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"); ++ +++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) +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 +--- a/package/kernel/mac80211/patches/307-ath9k-fix-tracking-of-enabled-AP-beacons.patch ++++ /dev/null +@@ -1,76 +0,0 @@ +-From: Felix Fietkau +-Date: Thu, 12 Mar 2015 17:10:50 +0100 +-Subject: [PATCH] ath9k: fix tracking of enabled AP beacons +- +-sc->nbcnvifs tracks assigned beacon slots, not enabled beacons. +-Therefore, it cannot be used to decide if cur_conf->enable_beacon (bool) +-should be updated, or if beacons have been enabled already. +-With the current code (depending on the order of calls), beacons often +-do not get enabled in an AP+STA setup. +-To fix tracking of enabled beacons, convert cur_conf->enable_beacon to a +-bitmask of enabled beacon slots. +- +-Cc: stable@vger.kernel.org +-Signed-off-by: Felix Fietkau +---- +- +---- a/drivers/net/wireless/ath/ath9k/beacon.c +-+++ b/drivers/net/wireless/ath/ath9k/beacon.c +-@@ -219,12 +219,15 @@ void ath9k_beacon_remove_slot(struct ath +- struct ath_common *common = ath9k_hw_common(sc->sc_ah); +- struct ath_vif *avp = (void *)vif->drv_priv; +- struct ath_buf *bf = avp->av_bcbuf; +-+ struct ath_beacon_config *cur_conf = &sc->cur_chan->beacon; +- +- ath_dbg(common, CONFIG, "Removing interface at beacon slot: %d\n", +- avp->av_bslot); +- +- tasklet_disable(&sc->bcon_tasklet); +- +-+ cur_conf->enable_beacon &= ~BIT(avp->av_bslot); +-+ +- if (bf && bf->bf_mpdu) { +- struct sk_buff *skb = bf->bf_mpdu; +- dma_unmap_single(sc->dev, bf->bf_buf_addr, +-@@ -521,8 +524,7 @@ static bool ath9k_allow_beacon_config(st +- } +- +- if (sc->sc_ah->opmode == NL80211_IFTYPE_AP) { +-- if ((vif->type != NL80211_IFTYPE_AP) || +-- (sc->nbcnvifs > 1)) { +-+ if (vif->type != NL80211_IFTYPE_AP) { +- ath_dbg(common, CONFIG, +- "An AP interface is already present !\n"); +- return false; +-@@ -616,12 +618,14 @@ void ath9k_beacon_config(struct ath_soft +- * enabling/disabling SWBA. +- */ +- if (changed & BSS_CHANGED_BEACON_ENABLED) { +-- if (!bss_conf->enable_beacon && +-- (sc->nbcnvifs <= 1)) { +-- cur_conf->enable_beacon = false; +-- } else if (bss_conf->enable_beacon) { +-- cur_conf->enable_beacon = true; +-- ath9k_cache_beacon_config(sc, ctx, bss_conf); +-+ bool enabled = cur_conf->enable_beacon; +-+ +-+ if (!bss_conf->enable_beacon) { +-+ cur_conf->enable_beacon &= ~BIT(avp->av_bslot); +-+ } else { +-+ cur_conf->enable_beacon |= BIT(avp->av_bslot); +-+ if (!enabled) +-+ ath9k_cache_beacon_config(sc, ctx, bss_conf); +- } +- } +- +---- a/drivers/net/wireless/ath/ath9k/common.h +-+++ b/drivers/net/wireless/ath/ath9k/common.h +-@@ -54,7 +54,7 @@ struct ath_beacon_config { +- u16 dtim_period; +- u16 bmiss_timeout; +- u8 dtim_count; +-- bool enable_beacon; +-+ u8 enable_beacon; +- 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 +new file mode 100644 +index 0000000..474c409 +--- /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 ++ ++With this .config: http://busybox.net/~vda/kernel_config, ++after deinlining the function size is 3132 bytes and there are ++7 callsites. ++ ++Total size reduction: about 20 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 ++--- ++ 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); +++ } +++ 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); ++ } ++ ++-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); ++ ++ 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 +--- a/package/kernel/mac80211/patches/308-mac80211-minstrel_ht-fix-rounding-issue-in-MCS-durat.patch ++++ /dev/null +@@ -1,43 +0,0 @@ +-From: Felix Fietkau +-Date: Fri, 13 Mar 2015 10:49:40 +0100 +-Subject: [PATCH] mac80211: minstrel_ht: fix rounding issue in MCS duration +- calculation +- +-On very high MCS bitrates, the calculated duration of rates that are +-next to each other can be very imprecise, due to the small packet size +-used as reference (1200 bytes). +-This is most visible in VHT80 nss=2 MCS8/9, for which minstrel shows the +-same throughput when the probability is also the same. This leads to a +-bad rate selection for such rates. +- +-Fix this issue by introducing an average A-MPDU size factor into the +-calculation. +- +-Signed-off-by: Felix Fietkau +---- +- +---- a/net/mac80211/rc80211_minstrel_ht.c +-+++ b/net/mac80211/rc80211_minstrel_ht.c +-@@ -17,10 +17,11 @@ +- #include "rc80211_minstrel.h" +- #include "rc80211_minstrel_ht.h" +- +-+#define AVG_AMPDU_SIZE 16 +- #define AVG_PKT_SIZE 1200 +- +- /* Number of bits for an average sized packet */ +--#define MCS_NBITS (AVG_PKT_SIZE << 3) +-+#define MCS_NBITS ((AVG_PKT_SIZE * AVG_AMPDU_SIZE) << 3) +- +- /* Number of symbols for a packet with (bps) bits per symbol */ +- #define MCS_NSYMS(bps) DIV_ROUND_UP(MCS_NBITS, (bps)) +-@@ -33,7 +34,8 @@ +- ) +- +- /* Transmit duration for the raw data part of an average sized packet */ +--#define MCS_DURATION(streams, sgi, bps) MCS_SYMBOL_TIME(sgi, MCS_NSYMS((streams) * (bps))) +-+#define MCS_DURATION(streams, sgi, bps) \ +-+ (MCS_SYMBOL_TIME(sgi, MCS_NSYMS((streams) * (bps))) / AVG_AMPDU_SIZE) +- +- #define BW_20 0 +- #define BW_40 1 +diff --git a/package/kernel/mac80211/patches/309-ath9k-disable-TPC-support-again-for-now.patch b/package/kernel/mac80211/patches/309-ath9k-disable-TPC-support-again-for-now.patch +deleted file mode 100644 +index 945fbce..0000000 +--- a/package/kernel/mac80211/patches/309-ath9k-disable-TPC-support-again-for-now.patch ++++ /dev/null +@@ -1,22 +0,0 @@ +-From: Felix Fietkau +-Date: Sun, 15 Mar 2015 08:02:37 +0100 +-Subject: [PATCH] ath9k: disable TPC support again (for now) +- +-TPC support has been observed to cause some tx power fluctuations on +-some devices with at least AR934x and AR938x chips. +-Disable it for now until the bugs have been found and fixed +- +-Signed-off-by: Felix Fietkau +---- +- +---- a/drivers/net/wireless/ath/ath9k/hw.c +-+++ b/drivers/net/wireless/ath/ath9k/hw.c +-@@ -424,7 +424,7 @@ static void ath9k_hw_init_defaults(struc +- ah->power_mode = ATH9K_PM_UNDEFINED; +- ah->htc_reset_init = true; +- +-- ah->tpc_enabled = true; +-+ ah->tpc_enabled = false; +- +- 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 +new file mode 100644 +index 0000000..e8e9617 +--- /dev/null ++++ b/package/kernel/mac80211/patches/309-mac80211-make-local-tx_headroom-a-multiple-of-4.patch +@@ -0,0 +1,20 @@ ++From: Felix Fietkau ++Date: Thu, 30 Jul 2015 14:12:25 +0200 ++Subject: [PATCH] mac80211: make local->tx_headroom a multiple of 4 ++ ++This ensures that mac80211 generated management frames and beacons are ++aligned before being passed to the driver ++ ++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); ++ +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 +--- a/package/kernel/mac80211/patches/310-mac80211-don-t-look-up-stations-for-multicast-addres.patch ++++ /dev/null +@@ -1,21 +0,0 @@ +-From: Johannes Berg +-Date: Tue, 24 Feb 2015 00:28:18 +0100 +-Subject: [PATCH] mac80211: don't look up stations for multicast addresses +- +-Since multicast addresses don't exist as stations, don't attempt +-to look them up in the hashtable on TX. +- +-Signed-off-by: Johannes Berg +---- +- +---- a/net/mac80211/tx.c +-+++ b/net/mac80211/tx.c +-@@ -1161,7 +1161,7 @@ ieee80211_tx_prepare(struct ieee80211_su +- tx->sdata->control_port_protocol == tx->skb->protocol) { +- tx->sta = sta_info_get_bss(sdata, hdr->addr1); +- } +-- if (!tx->sta) +-+ if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) +- 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 +new file mode 100644 +index 0000000..51a315c +--- /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() ++ ++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 ++--- ++ ++--- 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; ++ ++- 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; ++ } ++ ++ 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; ++- ++- 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); ++ +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 +--- a/package/kernel/mac80211/patches/311-mac80211-remove-drop_unencrypted-code.patch ++++ /dev/null +@@ -1,130 +0,0 @@ +-From: Johannes Berg +-Date: Fri, 20 Mar 2015 11:41:58 +0100 +-Subject: [PATCH] mac80211: remove drop_unencrypted code +- +-This mechanism was historic, and only ever used by IBSS, which +-also doesn't need to have it as it properly manages station's +-802.1X PAE state (or, with WEP, always has a key.) +- +-Remove the mechanism to clean up the code. +- +-Signed-off-by: Johannes Berg +---- +- +---- a/net/mac80211/debugfs.c +-+++ b/net/mac80211/debugfs.c +-@@ -274,8 +274,6 @@ void debugfs_hw_add(struct ieee80211_loc +- #ifdef CPTCFG_MAC80211_DEBUG_COUNTERS +- DEBUGFS_STATS_ADD(tx_handlers_drop, local->tx_handlers_drop); +- DEBUGFS_STATS_ADD(tx_handlers_queued, local->tx_handlers_queued); +-- DEBUGFS_STATS_ADD(tx_handlers_drop_unencrypted, +-- local->tx_handlers_drop_unencrypted); +- DEBUGFS_STATS_ADD(tx_handlers_drop_fragment, +- local->tx_handlers_drop_fragment); +- DEBUGFS_STATS_ADD(tx_handlers_drop_wep, +---- a/net/mac80211/debugfs_netdev.c +-+++ b/net/mac80211/debugfs_netdev.c +-@@ -177,7 +177,6 @@ static ssize_t ieee80211_if_write_##name +- IEEE80211_IF_FILE_R(name) +- +- /* common attributes */ +--IEEE80211_IF_FILE(drop_unencrypted, drop_unencrypted, DEC); +- IEEE80211_IF_FILE(rc_rateidx_mask_2ghz, rc_rateidx_mask[IEEE80211_BAND_2GHZ], +- HEX); +- IEEE80211_IF_FILE(rc_rateidx_mask_5ghz, rc_rateidx_mask[IEEE80211_BAND_5GHZ], +-@@ -562,7 +561,6 @@ IEEE80211_IF_FILE(dot11MeshAwakeWindowDu +- +- static void add_common_files(struct ieee80211_sub_if_data *sdata) +- { +-- DEBUGFS_ADD(drop_unencrypted); +- DEBUGFS_ADD(rc_rateidx_mask_2ghz); +- DEBUGFS_ADD(rc_rateidx_mask_5ghz); +- DEBUGFS_ADD(rc_rateidx_mcs_mask_2ghz); +---- a/net/mac80211/ibss.c +-+++ b/net/mac80211/ibss.c +-@@ -249,8 +249,6 @@ static void __ieee80211_sta_join_ibss(st +- if (presp) +- kfree_rcu(presp, rcu_head); +- +-- sdata->drop_unencrypted = capability & WLAN_CAPABILITY_PRIVACY ? 1 : 0; +-- +- /* make a copy of the chandef, it could be modified below. */ +- chandef = *req_chandef; +- chan = chandef.chan; +-@@ -1289,8 +1287,6 @@ static void ieee80211_sta_create_ibss(st +- +- if (ifibss->privacy) +- capability |= WLAN_CAPABILITY_PRIVACY; +-- else +-- sdata->drop_unencrypted = 0; +- +- __ieee80211_sta_join_ibss(sdata, bssid, sdata->vif.bss_conf.beacon_int, +- &ifibss->chandef, ifibss->basic_rates, +---- a/net/mac80211/ieee80211_i.h +-+++ b/net/mac80211/ieee80211_i.h +-@@ -842,8 +842,6 @@ struct ieee80211_sub_if_data { +- +- unsigned long state; +- +-- int drop_unencrypted; +-- +- char name[IFNAMSIZ]; +- +- /* Fragment table for host-based reassembly */ +-@@ -1289,7 +1287,6 @@ struct ieee80211_local { +- /* TX/RX handler statistics */ +- unsigned int tx_handlers_drop; +- unsigned int tx_handlers_queued; +-- unsigned int tx_handlers_drop_unencrypted; +- unsigned int tx_handlers_drop_fragment; +- unsigned int tx_handlers_drop_wep; +- unsigned int tx_handlers_drop_not_assoc; +---- a/net/mac80211/iface.c +-+++ b/net/mac80211/iface.c +-@@ -1535,7 +1535,6 @@ int ieee80211_if_change_type(struct ieee +- } +- +- /* reset some values that shouldn't be kept across type changes */ +-- sdata->drop_unencrypted = 0; +- if (type == NL80211_IFTYPE_STATION) +- sdata->u.mgd.use_4addr = false; +- +---- a/net/mac80211/rx.c +-+++ b/net/mac80211/rx.c +-@@ -1897,8 +1897,7 @@ static int ieee80211_drop_unencrypted(st +- /* Drop unencrypted frames if key is set. */ +- if (unlikely(!ieee80211_has_protected(fc) && +- !ieee80211_is_nullfunc(fc) && +-- ieee80211_is_data(fc) && +-- (rx->key || rx->sdata->drop_unencrypted))) +-+ ieee80211_is_data(fc) && rx->key)) +- return -EACCES; +- +- return 0; +---- a/net/mac80211/tx.c +-+++ b/net/mac80211/tx.c +-@@ -594,23 +594,8 @@ ieee80211_tx_h_select_key(struct ieee802 +- else if (!is_multicast_ether_addr(hdr->addr1) && +- (key = rcu_dereference(tx->sdata->default_unicast_key))) +- tx->key = key; +-- else if (info->flags & IEEE80211_TX_CTL_INJECTED) +-+ else +- tx->key = NULL; +-- else if (!tx->sdata->drop_unencrypted) +-- tx->key = NULL; +-- else if (tx->skb->protocol == tx->sdata->control_port_protocol) +-- tx->key = NULL; +-- else if (ieee80211_is_robust_mgmt_frame(tx->skb) && +-- !(ieee80211_is_action(hdr->frame_control) && +-- tx->sta && test_sta_flag(tx->sta, WLAN_STA_MFP))) +-- tx->key = NULL; +-- else if (ieee80211_is_mgmt(hdr->frame_control) && +-- !ieee80211_is_robust_mgmt_frame(tx->skb)) +-- tx->key = NULL; +-- else { +-- I802_DEBUG_INC(tx->local->tx_handlers_drop_unencrypted); +-- return TX_DROP; +-- } +- +- 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 +--- a/package/kernel/mac80211/patches/312-mac80211-don-t-look-up-destination-station-twice.patch ++++ /dev/null +@@ -1,71 +0,0 @@ +-From: Johannes Berg +-Date: Fri, 20 Mar 2015 16:24:21 +0100 +-Subject: [PATCH] mac80211: don't look up destination station twice +- +-There's no need to look up the destination station twice while +-building the 802.11 header for a given frame if the frame will +-actually be transmitted to the station we initially looked up. +- +-This happens for 4-addr VLAN interfaces and TDLS connections, which +-both directly send the frame to the station they looked up, though +-in the case of TDLS some station conditions need to be checked. +- +-To avoid that, add a variable indicating that we've looked up the +-station that the frame is going to be transmitted to, and avoid the +-lookup/flag checking if it already has been done. +- +-In the TDLS case, also move the authorized/wme_sta flag assignment +-to the correct place, i.e. only when that station is really used. +-Before this change, the new lookup should always have succeeded so +-that the potentially erroneous data would be overwritten. +- +-Signed-off-by: Johannes Berg +---- +- +---- a/net/mac80211/tx.c +-+++ b/net/mac80211/tx.c +-@@ -1894,6 +1894,7 @@ static struct sk_buff *ieee80211_build_h +- bool wme_sta = false, authorized = false, tdls_auth = false; +- bool tdls_peer = false, tdls_setup_frame = false; +- bool multicast; +-+ bool have_station = false; +- u16 info_id = 0; +- struct ieee80211_chanctx_conf *chanctx_conf; +- struct ieee80211_sub_if_data *ap_sdata; +-@@ -1918,6 +1919,7 @@ static struct sk_buff *ieee80211_build_h +- hdrlen = 30; +- authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); +- wme_sta = sta->sta.wme; +-+ have_station = true; +- } +- ap_sdata = container_of(sdata->bss, struct ieee80211_sub_if_data, +- u.ap); +-@@ -2034,9 +2036,6 @@ static struct sk_buff *ieee80211_build_h +- if (sdata->wdev.wiphy->flags & WIPHY_FLAG_SUPPORTS_TDLS) { +- sta = sta_info_get(sdata, skb->data); +- if (sta) { +-- authorized = test_sta_flag(sta, +-- WLAN_STA_AUTHORIZED); +-- wme_sta = sta->sta.wme; +- tdls_peer = test_sta_flag(sta, +- WLAN_STA_TDLS_PEER); +- tdls_auth = test_sta_flag(sta, +-@@ -2068,6 +2067,9 @@ static struct sk_buff *ieee80211_build_h +- memcpy(hdr.addr2, skb->data + ETH_ALEN, ETH_ALEN); +- memcpy(hdr.addr3, sdata->u.mgd.bssid, ETH_ALEN); +- hdrlen = 24; +-+ have_station = true; +-+ authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); +-+ wme_sta = sta->sta.wme; +- } else if (sdata->u.mgd.use_4addr && +- cpu_to_be16(ethertype) != sdata->control_port_protocol) { +- fc |= cpu_to_le16(IEEE80211_FCTL_FROMDS | +-@@ -2130,7 +2132,7 @@ static struct sk_buff *ieee80211_build_h +- * in AP mode) +- */ +- multicast = is_multicast_ether_addr(hdr.addr1); +-- if (!multicast) { +-+ if (!multicast && !have_station) { +- 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 +new file mode 100644 +index 0000000..baee295 +--- /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 ++ ++The interface combination provided by brcmfmac did not truly reflect ++the combinations supported by driver and/or firmware. ++ ++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 ++--- ++ ++--- 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] = ++ } ++ }; ++ +++/** +++ * 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 +--- a/package/kernel/mac80211/patches/313-mac80211-drop-4-addr-VLAN-frames-earlier-if-not-conn.patch ++++ /dev/null +@@ -1,27 +0,0 @@ +-From: Johannes Berg +-Date: Fri, 20 Mar 2015 16:24:22 +0100 +-Subject: [PATCH] mac80211: drop 4-addr VLAN frames earlier if not +- connected +- +-If there's no station on the 4-addr VLAN interface, then frames +-cannot be transmitted. Drop such frames earlier, before setting +-up all the information for them. +- +-We should keep the old check though since that code might be used +-for other internally-generated frames. +- +-Signed-off-by: Johannes Berg +---- +- +---- a/net/mac80211/tx.c +-+++ b/net/mac80211/tx.c +-@@ -1920,6 +1920,9 @@ static struct sk_buff *ieee80211_build_h +- authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); +- wme_sta = sta->sta.wme; +- have_station = true; +-+ } else if (sdata->wdev.use_4addr) { +-+ ret = -ENOLINK; +-+ goto free; +- } +- 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 +new file mode 100644 +index 0000000..9768ef2 +--- /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 ++ ++Expose ring buffer read/write pointers and other useful statistics ++through debugfs. ++ ++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 ++--- ++ ++--- 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 ++ } ++ } ++ +++#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; +++ +++ 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); +++ } +++ +++ 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: +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 +--- a/package/kernel/mac80211/patches/314-mac80211-mesh-avoid-pointless-station-lookup.patch ++++ /dev/null +@@ -1,33 +0,0 @@ +-From: Johannes Berg +-Date: Fri, 20 Mar 2015 16:24:23 +0100 +-Subject: [PATCH] mac80211: mesh: avoid pointless station lookup +- +-In ieee80211_build_hdr(), the station is looked up to build the +-header correctly (QoS field) and to check for authorization. For +-mesh, authorization isn't checked here, and QoS capability is +-mandatory, so the station lookup can be avoided. +- +-Signed-off-by: Johannes Berg +---- +- +---- a/net/mac80211/tx.c +-+++ b/net/mac80211/tx.c +-@@ -2130,12 +2130,14 @@ static struct sk_buff *ieee80211_build_h +- } +- +- /* +-- * There's no need to try to look up the destination +-- * if it is a multicast address (which can only happen +-- * in AP mode) +-+ * There's no need to try to look up the destination station +-+ * if it is a multicast address. In mesh, there's no need to +-+ * look up the station at all as it always must be QoS capable +-+ * and mesh mode checks authorization later. +- */ +- multicast = is_multicast_ether_addr(hdr.addr1); +-- if (!multicast && !have_station) { +-+ if (!multicast && !have_station && +-+ !ieee80211_vif_is_mesh(&sdata->vif)) { +- 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 +--- a/package/kernel/mac80211/patches/315-mac80211-avoid-duplicate-TX-path-station-lookup.patch ++++ /dev/null +@@ -1,267 +0,0 @@ +-From: Johannes Berg +-Date: Fri, 20 Mar 2015 14:18:27 +0100 +-Subject: [PATCH] mac80211: avoid duplicate TX path station lookup +- +-Instead of looking up the destination station twice in the TX path +-(first to build the header, and then for control processing), save +-it when building the header and use it later in the TX path. +- +-To avoid having to look up the station in the many callers, allow +-those to pass %NULL which keeps the existing lookup. +- +-Signed-off-by: Johannes Berg +---- +- +---- a/net/mac80211/cfg.c +-+++ b/net/mac80211/cfg.c +-@@ -3565,7 +3565,7 @@ static int ieee80211_probe_client(struct +- nullfunc->qos_ctrl = cpu_to_le16(7); +- +- local_bh_disable(); +-- ieee80211_xmit(sdata, skb); +-+ ieee80211_xmit(sdata, sta, skb); +- local_bh_enable(); +- rcu_read_unlock(); +- +---- a/net/mac80211/ieee80211_i.h +-+++ b/net/mac80211/ieee80211_i.h +-@@ -1775,7 +1775,8 @@ void mac80211_ev_michael_mic_failure(str +- gfp_t gfp); +- void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata, +- bool bss_notify); +--void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb); +-+void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, +-+ struct sta_info *sta, struct sk_buff *skb); +- +- void __ieee80211_tx_skb_tid_band(struct ieee80211_sub_if_data *sdata, +- struct sk_buff *skb, int tid, +---- a/net/mac80211/sta_info.c +-+++ b/net/mac80211/sta_info.c +-@@ -1279,7 +1279,7 @@ static void ieee80211_send_null_response +- } +- +- info->band = chanctx_conf->def.chan->band; +-- ieee80211_xmit(sdata, skb); +-+ ieee80211_xmit(sdata, sta, skb); +- rcu_read_unlock(); +- } +- +---- a/net/mac80211/tx.c +-+++ b/net/mac80211/tx.c +-@@ -1110,11 +1110,13 @@ static bool ieee80211_tx_prep_agg(struct +- +- /* +- * initialises @tx +-+ * pass %NULL for the station if unknown, a valid pointer if known +-+ * or an ERR_PTR() if the station is known not to exist +- */ +- static ieee80211_tx_result +- ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata, +- struct ieee80211_tx_data *tx, +-- struct sk_buff *skb) +-+ struct sta_info *sta, struct sk_buff *skb) +- { +- struct ieee80211_local *local = sdata->local; +- struct ieee80211_hdr *hdr; +-@@ -1137,17 +1139,22 @@ ieee80211_tx_prepare(struct ieee80211_su +- +- hdr = (struct ieee80211_hdr *) skb->data; +- +-- if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { +-- tx->sta = rcu_dereference(sdata->u.vlan.sta); +-- if (!tx->sta && sdata->dev->ieee80211_ptr->use_4addr) +-- return TX_DROP; +-- } else if (info->flags & (IEEE80211_TX_CTL_INJECTED | +-- IEEE80211_TX_INTFL_NL80211_FRAME_TX) || +-- tx->sdata->control_port_protocol == tx->skb->protocol) { +-- tx->sta = sta_info_get_bss(sdata, hdr->addr1); +-+ if (likely(sta)) { +-+ if (!IS_ERR(sta)) +-+ tx->sta = sta; +-+ } else { +-+ if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { +-+ tx->sta = rcu_dereference(sdata->u.vlan.sta); +-+ if (!tx->sta && sdata->wdev.use_4addr) +-+ return TX_DROP; +-+ } else if (info->flags & (IEEE80211_TX_INTFL_NL80211_FRAME_TX | +-+ IEEE80211_TX_CTL_INJECTED) || +-+ tx->sdata->control_port_protocol == tx->skb->protocol) { +-+ tx->sta = sta_info_get_bss(sdata, hdr->addr1); +-+ } +-+ if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) +-+ tx->sta = sta_info_get(sdata, hdr->addr1); +- } +-- if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) +-- tx->sta = sta_info_get(sdata, hdr->addr1); +- +- if (tx->sta && ieee80211_is_data_qos(hdr->frame_control) && +- !ieee80211_is_qos_nullfunc(hdr->frame_control) && +-@@ -1485,7 +1492,7 @@ bool ieee80211_tx_prepare_skb(struct iee +- struct ieee80211_tx_data tx; +- struct sk_buff *skb2; +- +-- if (ieee80211_tx_prepare(sdata, &tx, skb) == TX_DROP) +-+ if (ieee80211_tx_prepare(sdata, &tx, NULL, skb) == TX_DROP) +- return false; +- +- info->band = band; +-@@ -1518,7 +1525,8 @@ EXPORT_SYMBOL(ieee80211_tx_prepare_skb); +- * Returns false if the frame couldn't be transmitted but was queued instead. +- */ +- static bool ieee80211_tx(struct ieee80211_sub_if_data *sdata, +-- struct sk_buff *skb, bool txpending) +-+ struct sta_info *sta, struct sk_buff *skb, +-+ bool txpending) +- { +- struct ieee80211_local *local = sdata->local; +- struct ieee80211_tx_data tx; +-@@ -1534,7 +1542,7 @@ static bool ieee80211_tx(struct ieee8021 +- +- /* initialises tx */ +- led_len = skb->len; +-- res_prepare = ieee80211_tx_prepare(sdata, &tx, skb); +-+ res_prepare = ieee80211_tx_prepare(sdata, &tx, sta, skb); +- +- if (unlikely(res_prepare == TX_DROP)) { +- ieee80211_free_txskb(&local->hw, skb); +-@@ -1590,7 +1598,8 @@ static int ieee80211_skb_resize(struct i +- return 0; +- } +- +--void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb) +-+void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, +-+ struct sta_info *sta, struct sk_buff *skb) +- { +- struct ieee80211_local *local = sdata->local; +- struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); +-@@ -1625,7 +1634,7 @@ void ieee80211_xmit(struct ieee80211_sub +- } +- +- ieee80211_set_qos_hdr(sdata, skb); +-- ieee80211_tx(sdata, skb, false); +-+ ieee80211_tx(sdata, sta, skb, false); +- } +- +- static bool ieee80211_parse_tx_radiotap(struct sk_buff *skb) +-@@ -1846,7 +1855,7 @@ netdev_tx_t ieee80211_monitor_start_xmit +- goto fail_rcu; +- +- info->band = chandef->chan->band; +-- ieee80211_xmit(sdata, skb); +-+ ieee80211_xmit(sdata, NULL, skb); +- rcu_read_unlock(); +- +- return NETDEV_TX_OK; +-@@ -1877,7 +1886,8 @@ fail: +- * Returns: the (possibly reallocated) skb or an ERR_PTR() code +- */ +- static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata, +-- struct sk_buff *skb, u32 info_flags) +-+ struct sk_buff *skb, u32 info_flags, +-+ struct sta_info **sta_out) +- { +- struct ieee80211_local *local = sdata->local; +- struct ieee80211_tx_info *info; +-@@ -1920,6 +1930,7 @@ static struct sk_buff *ieee80211_build_h +- authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); +- wme_sta = sta->sta.wme; +- have_station = true; +-+ *sta_out = sta; +- } else if (sdata->wdev.use_4addr) { +- ret = -ENOLINK; +- goto free; +-@@ -2073,6 +2084,7 @@ static struct sk_buff *ieee80211_build_h +- have_station = true; +- authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); +- wme_sta = sta->sta.wme; +-+ *sta_out = sta; +- } else if (sdata->u.mgd.use_4addr && +- cpu_to_be16(ethertype) != sdata->control_port_protocol) { +- fc |= cpu_to_le16(IEEE80211_FCTL_FROMDS | +-@@ -2136,13 +2148,18 @@ static struct sk_buff *ieee80211_build_h +- * and mesh mode checks authorization later. +- */ +- multicast = is_multicast_ether_addr(hdr.addr1); +-- if (!multicast && !have_station && +-- !ieee80211_vif_is_mesh(&sdata->vif)) { +-- sta = sta_info_get(sdata, hdr.addr1); +-+ if (multicast) { +-+ *sta_out = ERR_PTR(-ENOENT); +-+ } else if (!have_station && !ieee80211_vif_is_mesh(&sdata->vif)) { +-+ if (sdata->control_port_protocol == skb->protocol) +-+ sta = sta_info_get_bss(sdata, hdr.addr1); +-+ else +-+ sta = sta_info_get(sdata, hdr.addr1); +- if (sta) { +- authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); +- wme_sta = sta->sta.wme; +- } +-+ *sta_out = sta ?: ERR_PTR(-ENOENT); +- } +- +- /* For mesh, the use of the QoS header is mandatory */ +-@@ -2320,6 +2337,7 @@ void __ieee80211_subif_start_xmit(struct +- u32 info_flags) +- { +- struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); +-+ struct sta_info *sta = NULL; +- +- if (unlikely(skb->len < ETH_HLEN)) { +- kfree_skb(skb); +-@@ -2328,7 +2346,7 @@ void __ieee80211_subif_start_xmit(struct +- +- rcu_read_lock(); +- +-- skb = ieee80211_build_hdr(sdata, skb, info_flags); +-+ skb = ieee80211_build_hdr(sdata, skb, info_flags, &sta); +- if (IS_ERR(skb)) +- goto out; +- +-@@ -2336,7 +2354,7 @@ void __ieee80211_subif_start_xmit(struct +- dev->stats.tx_bytes += skb->len; +- dev->trans_start = jiffies; +- +-- ieee80211_xmit(sdata, skb); +-+ ieee80211_xmit(sdata, sta, skb); +- out: +- rcu_read_unlock(); +- } +-@@ -2364,10 +2382,11 @@ ieee80211_build_data_template(struct iee +- .local = sdata->local, +- .sdata = sdata, +- }; +-+ struct sta_info *sta_ignore; +- +- rcu_read_lock(); +- +-- skb = ieee80211_build_hdr(sdata, skb, info_flags); +-+ skb = ieee80211_build_hdr(sdata, skb, info_flags, &sta_ignore); +- if (IS_ERR(skb)) +- goto out; +- +-@@ -2425,7 +2444,7 @@ static bool ieee80211_tx_pending_skb(str +- return true; +- } +- info->band = chanctx_conf->def.chan->band; +-- result = ieee80211_tx(sdata, skb, true); +-+ result = ieee80211_tx(sdata, NULL, skb, true); +- } else { +- struct sk_buff_head skbs; +- +-@@ -3163,7 +3182,7 @@ ieee80211_get_buffered_bc(struct ieee802 +- +- if (sdata->vif.type == NL80211_IFTYPE_AP) +- sdata = IEEE80211_DEV_TO_SUB_IF(skb->dev); +-- if (!ieee80211_tx_prepare(sdata, &tx, skb)) +-+ if (!ieee80211_tx_prepare(sdata, &tx, NULL, skb)) +- break; +- dev_kfree_skb_any(skb); +- } +-@@ -3295,6 +3314,6 @@ void __ieee80211_tx_skb_tid_band(struct +- */ +- local_bh_disable(); +- IEEE80211_SKB_CB(skb)->band = band; +-- ieee80211_xmit(sdata, skb); +-+ 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 +new file mode 100644 +index 0000000..2d5f7b9 +--- /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 ++ ++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. ++ ++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 ++--- ++ ++--- 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); ++ ++ ring = flow->rings[flowid]; +++ if (ring->blocked == blocked) { +++ spin_unlock_irqrestore(&flow->block_lock, flags); +++ return; +++ } ++ ifidx = brcmf_flowring_ifidx_get(flow, flowid); ++ ++ 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 +--- a/package/kernel/mac80211/patches/316-mac80211-reduce-log-spam-from-ieee80211_handle_pwr_c.patch ++++ /dev/null +@@ -1,38 +0,0 @@ +-From: John Linville +-Date: Tue, 31 Mar 2015 10:49:14 -0400 +-Subject: [PATCH] mac80211: reduce log spam from ieee80211_handle_pwr_constr +- +-This changes a couple of messages from sdata_info to sdata_dbg. +-This should reduce some log spam, as reported here: +- +- https://bugzilla.redhat.com/show_bug.cgi?id=1206468 +- +-Signed-off-by: John W. Linville +-Signed-off-by: Johannes Berg +---- +- +---- a/net/mac80211/mlme.c +-+++ b/net/mac80211/mlme.c +-@@ -1347,15 +1347,15 @@ static u32 ieee80211_handle_pwr_constr(s +- */ +- if (has_80211h_pwr && +- (!has_cisco_pwr || pwr_level_80211h <= pwr_level_cisco)) { +-- sdata_info(sdata, +-- "Limiting TX power to %d (%d - %d) dBm as advertised by %pM\n", +-- pwr_level_80211h, chan_pwr, pwr_reduction_80211h, +-- sdata->u.mgd.bssid); +-+ sdata_dbg(sdata, +-+ "Limiting TX power to %d (%d - %d) dBm as advertised by %pM\n", +-+ pwr_level_80211h, chan_pwr, pwr_reduction_80211h, +-+ sdata->u.mgd.bssid); +- new_ap_level = pwr_level_80211h; +- } else { /* has_cisco_pwr is always true here. */ +-- sdata_info(sdata, +-- "Limiting TX power to %d dBm as advertised by %pM\n", +-- pwr_level_cisco, sdata->u.mgd.bssid); +-+ sdata_dbg(sdata, +-+ "Limiting TX power to %d dBm as advertised by %pM\n", +-+ pwr_level_cisco, sdata->u.mgd.bssid); +- new_ap_level = pwr_level_cisco; +- } +- +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 +--- a/package/kernel/mac80211/patches/317-brcmfmac-Fix-race-condition-in-msgbuf-ioctl-processi.patch ++++ /dev/null +@@ -1,35 +0,0 @@ +-From: Hante Meuleman +-Date: Fri, 6 Mar 2015 18:40:41 +0100 +-Subject: [PATCH] brcmfmac: Fix race condition in msgbuf ioctl processing. +- +-Msgbuf is using a wait_event_timeout to wait for the response on +-an ioctl. The wakeup routine uses waitqueue_active to see if +-wait_event_timeout has been called. There is a chance that the +-response arrives before wait_event_timeout is called, this +-will result in situation that wait_event_timeout never gets +-woken again and assumed result will be a timeout. This patch +-removes that errornous situation by always setting the +-ctl_completed var before checking for queue active. +- +-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/msgbuf.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c +-@@ -481,10 +481,9 @@ static int brcmf_msgbuf_ioctl_resp_wait( +- +- static void brcmf_msgbuf_ioctl_resp_wake(struct brcmf_msgbuf *msgbuf) +- { +-- if (waitqueue_active(&msgbuf->ioctl_resp_wait)) { +-- msgbuf->ctl_completed = true; +-+ msgbuf->ctl_completed = true; +-+ if (waitqueue_active(&msgbuf->ioctl_resp_wait)) +- wake_up(&msgbuf->ioctl_resp_wait); +-- } +- } +- +- +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 +new file mode 100644 +index 0000000..7378401 +--- /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 ++ ++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. ++ ++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 ++--- ++ ++--- 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) ++ ++ #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 ++ +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 +--- a/package/kernel/mac80211/patches/318-brcmfmac-Update-msgbuf-commonring-size-for-improved-.patch ++++ /dev/null +@@ -1,30 +0,0 @@ +-From: Hante Meuleman +-Date: Wed, 18 Mar 2015 13:25:23 +0100 +-Subject: [PATCH] brcmfmac: Update msgbuf commonring size for improved +- throughput. +- +-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/msgbuf.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.h +-@@ -17,11 +17,11 @@ +- +- #ifdef CPTCFG_BRCMFMAC_PROTO_MSGBUF +- +--#define BRCMF_H2D_MSGRING_CONTROL_SUBMIT_MAX_ITEM 20 +--#define BRCMF_H2D_MSGRING_RXPOST_SUBMIT_MAX_ITEM 256 +--#define BRCMF_D2H_MSGRING_CONTROL_COMPLETE_MAX_ITEM 20 +-+#define BRCMF_H2D_MSGRING_CONTROL_SUBMIT_MAX_ITEM 64 +-+#define BRCMF_H2D_MSGRING_RXPOST_SUBMIT_MAX_ITEM 512 +-+#define BRCMF_D2H_MSGRING_CONTROL_COMPLETE_MAX_ITEM 64 +- #define BRCMF_D2H_MSGRING_TX_COMPLETE_MAX_ITEM 1024 +--#define BRCMF_D2H_MSGRING_RX_COMPLETE_MAX_ITEM 256 +-+#define BRCMF_D2H_MSGRING_RX_COMPLETE_MAX_ITEM 512 +- #define BRCMF_H2D_TXFLOWRING_MAX_ITEM 512 +- +- #define BRCMF_H2D_MSGRING_CONTROL_SUBMIT_ITEMSIZE 40 +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 +--- a/package/kernel/mac80211/patches/319-ath9k_htc-add-new-WMI_REG_RMW_CMDID-command.patch ++++ /dev/null +@@ -1,307 +0,0 @@ +-From: Oleksij Rempel +-Date: Sun, 22 Mar 2015 19:29:46 +0100 +-Subject: [PATCH] ath9k_htc: add new WMI_REG_RMW_CMDID command +- +-Since usb bus add extra delay on each request, a command +-with read + write requests is too expensive. We can dramtically +-reduce usb load by moving this command to firmware. +- +-In my tests, this patch will reduce channel scan time +-for about 5-10 seconds. +- +-Signed-off-by: Oleksij Rempel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/ath/ath.h +-+++ b/drivers/net/wireless/ath/ath.h +-@@ -131,6 +131,9 @@ struct ath_ops { +- void (*enable_write_buffer)(void *); +- void (*write_flush) (void *); +- u32 (*rmw)(void *, u32 reg_offset, u32 set, u32 clr); +-+ void (*enable_rmw_buffer)(void *); +-+ void (*rmw_flush) (void *); +-+ +- }; +- +- struct ath_common; +---- a/drivers/net/wireless/ath/ath9k/htc.h +-+++ b/drivers/net/wireless/ath/ath9k/htc.h +-@@ -444,6 +444,10 @@ static inline void ath9k_htc_stop_btcoex +- #define OP_BT_SCAN BIT(4) +- #define OP_TSF_RESET BIT(6) +- +-+enum htc_op_flags { +-+ HTC_FWFLAG_NO_RMW, +-+}; +-+ +- struct ath9k_htc_priv { +- struct device *dev; +- struct ieee80211_hw *hw; +-@@ -482,6 +486,7 @@ struct ath9k_htc_priv { +- bool reconfig_beacon; +- unsigned int rxfilter; +- unsigned long op_flags; +-+ unsigned long fw_flags; +- +- struct ath9k_hw_cal_data caldata; +- struct ath_spec_scan_priv spec_priv; +---- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c +-+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c +-@@ -376,17 +376,139 @@ static void ath9k_regwrite_flush(void *h +- mutex_unlock(&priv->wmi->multi_write_mutex); +- } +- +--static u32 ath9k_reg_rmw(void *hw_priv, u32 reg_offset, u32 set, u32 clr) +-+static void ath9k_reg_rmw_buffer(void *hw_priv, +-+ u32 reg_offset, u32 set, u32 clr) +-+{ +-+ struct ath_hw *ah = (struct ath_hw *) hw_priv; +-+ struct ath_common *common = ath9k_hw_common(ah); +-+ struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv; +-+ u32 rsp_status; +-+ int r; +-+ +-+ mutex_lock(&priv->wmi->multi_rmw_mutex); +-+ +-+ /* Store the register/value */ +-+ priv->wmi->multi_rmw[priv->wmi->multi_rmw_idx].reg = +-+ cpu_to_be32(reg_offset); +-+ priv->wmi->multi_rmw[priv->wmi->multi_rmw_idx].set = +-+ cpu_to_be32(set); +-+ priv->wmi->multi_rmw[priv->wmi->multi_rmw_idx].clr = +-+ cpu_to_be32(clr); +-+ +-+ priv->wmi->multi_rmw_idx++; +-+ +-+ /* If the buffer is full, send it out. */ +-+ if (priv->wmi->multi_rmw_idx == MAX_RMW_CMD_NUMBER) { +-+ r = ath9k_wmi_cmd(priv->wmi, WMI_REG_RMW_CMDID, +-+ (u8 *) &priv->wmi->multi_rmw, +-+ sizeof(struct register_write) * priv->wmi->multi_rmw_idx, +-+ (u8 *) &rsp_status, sizeof(rsp_status), +-+ 100); +-+ if (unlikely(r)) { +-+ ath_dbg(common, WMI, +-+ "REGISTER RMW FAILED, multi len: %d\n", +-+ priv->wmi->multi_rmw_idx); +-+ } +-+ priv->wmi->multi_rmw_idx = 0; +-+ } +-+ +-+ mutex_unlock(&priv->wmi->multi_rmw_mutex); +-+} +-+ +-+static void ath9k_reg_rmw_flush(void *hw_priv) +- { +-- u32 val; +-+ struct ath_hw *ah = (struct ath_hw *) hw_priv; +-+ struct ath_common *common = ath9k_hw_common(ah); +-+ struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv; +-+ u32 rsp_status; +-+ int r; +-+ +-+ if (test_bit(HTC_FWFLAG_NO_RMW, &priv->fw_flags)) +-+ return; +-+ +-+ atomic_dec(&priv->wmi->m_rmw_cnt); +-+ +-+ mutex_lock(&priv->wmi->multi_rmw_mutex); +-+ +-+ if (priv->wmi->multi_rmw_idx) { +-+ r = ath9k_wmi_cmd(priv->wmi, WMI_REG_RMW_CMDID, +-+ (u8 *) &priv->wmi->multi_rmw, +-+ sizeof(struct register_rmw) * priv->wmi->multi_rmw_idx, +-+ (u8 *) &rsp_status, sizeof(rsp_status), +-+ 100); +-+ if (unlikely(r)) { +-+ ath_dbg(common, WMI, +-+ "REGISTER RMW FAILED, multi len: %d\n", +-+ priv->wmi->multi_rmw_idx); +-+ } +-+ priv->wmi->multi_rmw_idx = 0; +-+ } +- +-- val = ath9k_regread(hw_priv, reg_offset); +-- val &= ~clr; +-- val |= set; +-- ath9k_regwrite(hw_priv, val, reg_offset); +-+ mutex_unlock(&priv->wmi->multi_rmw_mutex); +-+} +-+ +-+static void ath9k_enable_rmw_buffer(void *hw_priv) +-+{ +-+ struct ath_hw *ah = (struct ath_hw *) hw_priv; +-+ struct ath_common *common = ath9k_hw_common(ah); +-+ struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv; +-+ +-+ if (test_bit(HTC_FWFLAG_NO_RMW, &priv->fw_flags)) +-+ return; +-+ +-+ atomic_inc(&priv->wmi->m_rmw_cnt); +-+} +-+ +-+static u32 ath9k_reg_rmw_single(void *hw_priv, +-+ u32 reg_offset, u32 set, u32 clr) +-+{ +-+ struct ath_hw *ah = (struct ath_hw *) hw_priv; +-+ struct ath_common *common = ath9k_hw_common(ah); +-+ struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv; +-+ struct register_rmw buf, buf_ret; +-+ int ret; +-+ u32 val = 0; +-+ +-+ buf.reg = cpu_to_be32(reg_offset); +-+ buf.set = cpu_to_be32(set); +-+ buf.clr = cpu_to_be32(clr); +-+ +-+ ret = ath9k_wmi_cmd(priv->wmi, WMI_REG_RMW_CMDID, +-+ (u8 *) &buf, sizeof(buf), +-+ (u8 *) &buf_ret, sizeof(buf_ret), +-+ 100); +-+ if (unlikely(ret)) { +-+ ath_dbg(common, WMI, "REGISTER RMW FAILED:(0x%04x, %d)\n", +-+ reg_offset, ret); +-+ } +- return val; +- } +- +-+static u32 ath9k_reg_rmw(void *hw_priv, u32 reg_offset, u32 set, u32 clr) +-+{ +-+ struct ath_hw *ah = (struct ath_hw *) hw_priv; +-+ struct ath_common *common = ath9k_hw_common(ah); +-+ struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv; +-+ +-+ if (test_bit(HTC_FWFLAG_NO_RMW, &priv->fw_flags)) { +-+ u32 val; +-+ +-+ val = REG_READ(ah, reg_offset); +-+ val &= ~clr; +-+ val |= set; +-+ REG_WRITE(ah, reg_offset, val); +-+ +-+ return 0; +-+ } +-+ +-+ if (atomic_read(&priv->wmi->m_rmw_cnt)) +-+ ath9k_reg_rmw_buffer(hw_priv, reg_offset, set, clr); +-+ else +-+ ath9k_reg_rmw_single(hw_priv, reg_offset, set, clr); +-+ +-+ return 0; +-+} +-+ +- static void ath_usb_read_cachesize(struct ath_common *common, int *csz) +- { +- *csz = L1_CACHE_BYTES >> 2; +-@@ -501,6 +623,8 @@ static int ath9k_init_priv(struct ath9k_ +- ah->reg_ops.write = ath9k_regwrite; +- ah->reg_ops.enable_write_buffer = ath9k_enable_regwrite_buffer; +- ah->reg_ops.write_flush = ath9k_regwrite_flush; +-+ ah->reg_ops.enable_rmw_buffer = ath9k_enable_rmw_buffer; +-+ ah->reg_ops.rmw_flush = ath9k_reg_rmw_flush; +- ah->reg_ops.rmw = ath9k_reg_rmw; +- priv->ah = ah; +- +-@@ -686,6 +810,12 @@ static int ath9k_init_firmware_version(s +- return -EINVAL; +- } +- +-+ if (priv->fw_version_major == 1 && priv->fw_version_minor < 4) +-+ set_bit(HTC_FWFLAG_NO_RMW, &priv->fw_flags); +-+ +-+ dev_info(priv->dev, "FW RMW support: %s\n", +-+ test_bit(HTC_FWFLAG_NO_RMW, &priv->fw_flags) ? "Off" : "On"); +-+ +- return 0; +- } +- +---- a/drivers/net/wireless/ath/ath9k/hw.h +-+++ b/drivers/net/wireless/ath/ath9k/hw.h +-@@ -100,6 +100,18 @@ +- (_ah)->reg_ops.write_flush((_ah)); \ +- } while (0) +- +-+#define ENABLE_REG_RMW_BUFFER(_ah) \ +-+ do { \ +-+ if ((_ah)->reg_ops.enable_rmw_buffer) \ +-+ (_ah)->reg_ops.enable_rmw_buffer((_ah)); \ +-+ } while (0) +-+ +-+#define REG_RMW_BUFFER_FLUSH(_ah) \ +-+ do { \ +-+ if ((_ah)->reg_ops.rmw_flush) \ +-+ (_ah)->reg_ops.rmw_flush((_ah)); \ +-+ } while (0) +-+ +- #define PR_EEP(_s, _val) \ +- do { \ +- len += scnprintf(buf + len, size - len, "%20s : %10d\n",\ +---- a/drivers/net/wireless/ath/ath9k/wmi.c +-+++ b/drivers/net/wireless/ath/ath9k/wmi.c +-@@ -61,6 +61,8 @@ static const char *wmi_cmd_to_name(enum +- return "WMI_REG_READ_CMDID"; +- case WMI_REG_WRITE_CMDID: +- return "WMI_REG_WRITE_CMDID"; +-+ case WMI_REG_RMW_CMDID: +-+ return "WMI_REG_RMW_CMDID"; +- case WMI_RC_STATE_CHANGE_CMDID: +- return "WMI_RC_STATE_CHANGE_CMDID"; +- case WMI_RC_RATE_UPDATE_CMDID: +-@@ -101,6 +103,7 @@ struct wmi *ath9k_init_wmi(struct ath9k_ +- spin_lock_init(&wmi->event_lock); +- mutex_init(&wmi->op_mutex); +- mutex_init(&wmi->multi_write_mutex); +-+ mutex_init(&wmi->multi_rmw_mutex); +- init_completion(&wmi->cmd_wait); +- INIT_LIST_HEAD(&wmi->pending_tx_events); +- tasklet_init(&wmi->wmi_event_tasklet, ath9k_wmi_event_tasklet, +---- a/drivers/net/wireless/ath/ath9k/wmi.h +-+++ b/drivers/net/wireless/ath/ath9k/wmi.h +-@@ -112,6 +112,7 @@ enum wmi_cmd_id { +- WMI_TX_STATS_CMDID, +- WMI_RX_STATS_CMDID, +- WMI_BITRATE_MASK_CMDID, +-+ WMI_REG_RMW_CMDID, +- }; +- +- enum wmi_event_id { +-@@ -125,12 +126,19 @@ enum wmi_event_id { +- }; +- +- #define MAX_CMD_NUMBER 62 +-+#define MAX_RMW_CMD_NUMBER 15 +- +- struct register_write { +- __be32 reg; +- __be32 val; +- }; +- +-+struct register_rmw { +-+ __be32 reg; +-+ __be32 set; +-+ __be32 clr; +-+} __packed; +-+ +- struct ath9k_htc_tx_event { +- int count; +- struct __wmi_event_txstatus txs; +-@@ -156,10 +164,18 @@ struct wmi { +- +- spinlock_t wmi_lock; +- +-+ /* multi write section */ +- atomic_t mwrite_cnt; +- struct register_write multi_write[MAX_CMD_NUMBER]; +- u32 multi_write_idx; +- struct mutex multi_write_mutex; +-+ +-+ /* multi rmw section */ +-+ atomic_t m_rmw_cnt; +-+ struct register_rmw multi_rmw[MAX_RMW_CMD_NUMBER]; +-+ u32 multi_rmw_idx; +-+ struct mutex multi_rmw_mutex; +-+ +- }; +- +- 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 +new file mode 100644 +index 0000000..97444b3 +--- /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 ++ ++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. ++ ++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/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) ++ { ++ 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; ++ } ++- /* 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; +++ +++ *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) +++{ +++ 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]; +++} +++ ++ 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 ++ ++ /* 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; +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 +--- a/package/kernel/mac80211/patches/320-ath9k-ar9271_hw_pa_cal-use-defs-instead-of-magin-num.patch ++++ /dev/null +@@ -1,89 +0,0 @@ +-From: Oleksij Rempel +-Date: Sun, 22 Mar 2015 19:29:47 +0100 +-Subject: [PATCH] ath9k: ar9271_hw_pa_cal - use defs instead of magin +- numbers +- +-This function uses mixed styles for register names/numbers which +-is make harder reading and optimisation. +- +-Signed-off-by: Oleksij Rempel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c +-+++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c +-@@ -430,22 +430,22 @@ static void ar9271_hw_pa_cal(struct ath_ +- u32 regVal; +- unsigned int i; +- u32 regList[][2] = { +-- { 0x786c, 0 }, +-- { 0x7854, 0 }, +-- { 0x7820, 0 }, +-- { 0x7824, 0 }, +-- { 0x7868, 0 }, +-- { 0x783c, 0 }, +-- { 0x7838, 0 } , +-- { 0x7828, 0 } , +-+ { AR9285_AN_TOP3, 0 }, +-+ { AR9285_AN_RXTXBB1, 0 }, +-+ { AR9285_AN_RF2G1, 0 }, +-+ { AR9285_AN_RF2G2, 0 }, +-+ { AR9285_AN_TOP2, 0 }, +-+ { AR9285_AN_RF2G8, 0 }, +-+ { AR9285_AN_RF2G7, 0 } , +-+ { AR9285_AN_RF2G3, 0 } , +- }; +- +- for (i = 0; i < ARRAY_SIZE(regList); i++) +- regList[i][1] = REG_READ(ah, regList[i][0]); +- +-- regVal = REG_READ(ah, 0x7834); +-+ regVal = REG_READ(ah, AR9285_AN_RF2G6); +- regVal &= (~(0x1)); +-- REG_WRITE(ah, 0x7834, regVal); +-+ REG_WRITE(ah, AR9285_AN_RF2G6, regVal); +- regVal = REG_READ(ah, 0x9808); +- regVal |= (0x1 << 27); +- REG_WRITE(ah, 0x9808, regVal); +-@@ -477,7 +477,7 @@ static void ar9271_hw_pa_cal(struct ath_ +- * does not matter since we turn it off +- */ +- REG_RMW_FIELD(ah, AR9285_AN_RF2G7, AR9285_AN_RF2G7_PADRVGN2TAB0, 0); +-- +-+ /* 7828, b0-11, ccom=fff */ +- REG_RMW_FIELD(ah, AR9285_AN_RF2G3, AR9271_AN_RF2G3_CCOMP, 0xfff); +- +- /* Set: +-@@ -490,15 +490,16 @@ static void ar9271_hw_pa_cal(struct ath_ +- +- /* find off_6_1; */ +- for (i = 6; i > 0; i--) { +-- regVal = REG_READ(ah, 0x7834); +-+ regVal = REG_READ(ah, AR9285_AN_RF2G6); +- regVal |= (1 << (20 + i)); +-- REG_WRITE(ah, 0x7834, regVal); +-+ REG_WRITE(ah, AR9285_AN_RF2G6, regVal); +- udelay(1); +- /* regVal = REG_READ(ah, 0x7834); */ +- regVal &= (~(0x1 << (20 + i))); +-- regVal |= (MS(REG_READ(ah, 0x7840), AR9285_AN_RXTXBB1_SPARE9) +-+ regVal |= (MS(REG_READ(ah, AR9285_AN_RF2G9), +-+ AR9285_AN_RXTXBB1_SPARE9) +- << (20 + i)); +-- REG_WRITE(ah, 0x7834, regVal); +-+ REG_WRITE(ah, AR9285_AN_RF2G6, regVal); +- } +- +- regVal = (regVal >> 20) & 0x7f; +-@@ -517,9 +518,9 @@ static void ar9271_hw_pa_cal(struct ath_ +- +- ENABLE_REGWRITE_BUFFER(ah); +- +-- regVal = REG_READ(ah, 0x7834); +-+ regVal = REG_READ(ah, AR_AN_RF2G1_CH1); +- regVal |= 0x1; +-- REG_WRITE(ah, 0x7834, regVal); +-+ REG_WRITE(ah, AR_AN_RF2G1_CH1, regVal); +- 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 +new file mode 100644 +index 0000000..632714c +--- /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 ++ ++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 ++--- ++ ++--- 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 ++ } ++ ++ 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; +++ +++ /* assure protocol is always called with +++ * non-null initialized pointer. +++ */ +++ 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) +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 +--- a/package/kernel/mac80211/patches/321-ath9k-ar9271_hw_pa_cal-use-proper-makroses.patch ++++ /dev/null +@@ -1,79 +0,0 @@ +-From: Oleksij Rempel +-Date: Sun, 22 Mar 2015 19:29:48 +0100 +-Subject: [PATCH] ath9k: ar9271_hw_pa_cal: use proper makroses. +- +-Signed-off-by: Oleksij Rempel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c +-+++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c +-@@ -443,33 +443,30 @@ static void ar9271_hw_pa_cal(struct ath_ +- for (i = 0; i < ARRAY_SIZE(regList); i++) +- regList[i][1] = REG_READ(ah, regList[i][0]); +- +-- regVal = REG_READ(ah, AR9285_AN_RF2G6); +-- regVal &= (~(0x1)); +-- REG_WRITE(ah, AR9285_AN_RF2G6, regVal); +-- regVal = REG_READ(ah, 0x9808); +-- regVal |= (0x1 << 27); +-- REG_WRITE(ah, 0x9808, regVal); +-- +-+ /* 7834, b1=0 */ +-+ REG_CLR_BIT(ah, AR9285_AN_RF2G6, 1 << 0); +-+ /* 9808, b27=1 */ +-+ REG_SET_BIT(ah, 0x9808, 1 << 27); +- /* 786c,b23,1, pwddac=1 */ +-- REG_RMW_FIELD(ah, AR9285_AN_TOP3, AR9285_AN_TOP3_PWDDAC, 1); +-+ REG_SET_BIT(ah, AR9285_AN_TOP3, AR9285_AN_TOP3_PWDDAC); +- /* 7854, b5,1, pdrxtxbb=1 */ +-- REG_RMW_FIELD(ah, AR9285_AN_RXTXBB1, AR9285_AN_RXTXBB1_PDRXTXBB1, 1); +-+ REG_SET_BIT(ah, AR9285_AN_RXTXBB1, AR9285_AN_RXTXBB1_PDRXTXBB1); +- /* 7854, b7,1, pdv2i=1 */ +-- REG_RMW_FIELD(ah, AR9285_AN_RXTXBB1, AR9285_AN_RXTXBB1_PDV2I, 1); +-+ REG_SET_BIT(ah, AR9285_AN_RXTXBB1, AR9285_AN_RXTXBB1_PDV2I); +- /* 7854, b8,1, pddacinterface=1 */ +-- REG_RMW_FIELD(ah, AR9285_AN_RXTXBB1, AR9285_AN_RXTXBB1_PDDACIF, 1); +-+ REG_SET_BIT(ah, AR9285_AN_RXTXBB1, AR9285_AN_RXTXBB1_PDDACIF); +- /* 7824,b12,0, offcal=0 */ +-- REG_RMW_FIELD(ah, AR9285_AN_RF2G2, AR9285_AN_RF2G2_OFFCAL, 0); +-+ REG_CLR_BIT(ah, AR9285_AN_RF2G2, AR9285_AN_RF2G2_OFFCAL); +- /* 7838, b1,0, pwddb=0 */ +-- REG_RMW_FIELD(ah, AR9285_AN_RF2G7, AR9285_AN_RF2G7_PWDDB, 0); +-+ REG_CLR_BIT(ah, AR9285_AN_RF2G7, AR9285_AN_RF2G7_PWDDB); +- /* 7820,b11,0, enpacal=0 */ +-- REG_RMW_FIELD(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_ENPACAL, 0); +-+ REG_CLR_BIT(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_ENPACAL); +- /* 7820,b25,1, pdpadrv1=0 */ +-- REG_RMW_FIELD(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_PDPADRV1, 0); +-+ REG_CLR_BIT(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_PDPADRV1); +- /* 7820,b24,0, pdpadrv2=0 */ +-- REG_RMW_FIELD(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_PDPADRV2, 0); +-+ REG_CLR_BIT(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_PDPADRV2); +- /* 7820,b23,0, pdpaout=0 */ +-- REG_RMW_FIELD(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_PDPAOUT, 0); +-+ REG_CLR_BIT(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_PDPAOUT); +- /* 783c,b14-16,7, padrvgn2tab_0=7 */ +- REG_RMW_FIELD(ah, AR9285_AN_RF2G8, AR9285_AN_RF2G8_PADRVGN2TAB0, 7); +- /* +-@@ -516,15 +513,13 @@ static void ar9271_hw_pa_cal(struct ath_ +- ah->pacal_info.prev_offset = regVal; +- } +- +-- ENABLE_REGWRITE_BUFFER(ah); +- +-- regVal = REG_READ(ah, AR_AN_RF2G1_CH1); +-- regVal |= 0x1; +-- REG_WRITE(ah, AR_AN_RF2G1_CH1, regVal); +-- regVal = REG_READ(ah, 0x9808); +-- regVal &= (~(0x1 << 27)); +-- REG_WRITE(ah, 0x9808, regVal); +-+ /* 7834, b1=1 */ +-+ REG_SET_BIT(ah, AR9285_AN_RF2G6, 1 << 0); +-+ /* 9808, b27=0 */ +-+ REG_CLR_BIT(ah, 0x9808, 1 << 27); +- +-+ ENABLE_REGWRITE_BUFFER(ah); +- 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 +new file mode 100644 +index 0000000..3360cbc +--- /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() ++ ++Just pass the interface to be removed, ie. 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 ++--- ++ ++--- 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/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 ++ } ++ } ++ ++-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; +++ +++ brcmf_fws_del_interface(ifp); +++ brcmf_del_if(ifp->drvr, ifp->bssidx); ++ } ++ ++ 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 ++ { ++ 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); ++ } ++ +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 +--- a/package/kernel/mac80211/patches/322-ath9k-ar9271_hw_pa_cal-use-RMW-buffer.patch ++++ /dev/null +@@ -1,48 +0,0 @@ +-From: Oleksij Rempel +-Date: Sun, 22 Mar 2015 19:29:49 +0100 +-Subject: [PATCH] ath9k: ar9271_hw_pa_cal: use RMW buffer +- +-Signed-off-by: Oleksij Rempel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c +-+++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c +-@@ -436,13 +436,14 @@ static void ar9271_hw_pa_cal(struct ath_ +- { AR9285_AN_RF2G2, 0 }, +- { AR9285_AN_TOP2, 0 }, +- { AR9285_AN_RF2G8, 0 }, +-- { AR9285_AN_RF2G7, 0 } , +-- { AR9285_AN_RF2G3, 0 } , +-+ { AR9285_AN_RF2G7, 0 }, +-+ { AR9285_AN_RF2G3, 0 }, +- }; +- +- for (i = 0; i < ARRAY_SIZE(regList); i++) +- regList[i][1] = REG_READ(ah, regList[i][0]); +- +-+ ENABLE_REG_RMW_BUFFER(ah); +- /* 7834, b1=0 */ +- REG_CLR_BIT(ah, AR9285_AN_RF2G6, 1 << 0); +- /* 9808, b27=1 */ +-@@ -476,6 +477,7 @@ static void ar9271_hw_pa_cal(struct ath_ +- REG_RMW_FIELD(ah, AR9285_AN_RF2G7, AR9285_AN_RF2G7_PADRVGN2TAB0, 0); +- /* 7828, b0-11, ccom=fff */ +- REG_RMW_FIELD(ah, AR9285_AN_RF2G3, AR9271_AN_RF2G3_CCOMP, 0xfff); +-+ REG_RMW_BUFFER_FLUSH(ah); +- +- /* Set: +- * localmode=1,bmode=1,bmoderxtx=1,synthon=1, +-@@ -514,10 +516,12 @@ static void ar9271_hw_pa_cal(struct ath_ +- } +- +- +-+ ENABLE_REG_RMW_BUFFER(ah); +- /* 7834, b1=1 */ +- REG_SET_BIT(ah, AR9285_AN_RF2G6, 1 << 0); +- /* 9808, b27=0 */ +- REG_CLR_BIT(ah, 0x9808, 1 << 27); +-+ REG_RMW_BUFFER_FLUSH(ah); +- +- 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 +new file mode 100644 +index 0000000..2b61f4e +--- /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 ++ ++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: ++ ++ 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 ++--- ++ ++--- 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; +++ } ++ if (drvr->fws) { ++ brcmf_fws_del_interface(ifp); ++ brcmf_fws_deinit(drvr); +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 +--- a/package/kernel/mac80211/patches/323-ath9k-add-multi_read-to-be-compatible-with-ath9k_htc.patch ++++ /dev/null +@@ -1,35 +0,0 @@ +-From: Oleksij Rempel +-Date: Sun, 22 Mar 2015 19:29:50 +0100 +-Subject: [PATCH] ath9k: add multi_read to be compatible with ath9k_htc +- +-Signed-off-by: Oleksij Rempel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/ath/ath9k/init.c +-+++ b/drivers/net/wireless/ath/ath9k/init.c +-@@ -141,6 +141,16 @@ static unsigned int ath9k_ioread32(void +- return val; +- } +- +-+static void ath9k_multi_ioread32(void *hw_priv, u32 *addr, +-+ u32 *val, u16 count) +-+{ +-+ int i; +-+ +-+ for (i = 0; i < count; i++) +-+ val[i] = ath9k_ioread32(hw_priv, addr[i]); +-+} +-+ +-+ +- static unsigned int __ath9k_reg_rmw(struct ath_softc *sc, u32 reg_offset, +- u32 set, u32 clr) +- { +-@@ -530,6 +540,7 @@ static int ath9k_init_softc(u16 devid, s +- ah->hw = sc->hw; +- ah->hw_version.devid = devid; +- ah->reg_ops.read = ath9k_ioread32; +-+ ah->reg_ops.multi_read = ath9k_multi_ioread32; +- 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 +--- a/package/kernel/mac80211/patches/324-ath9k-add-new-function-ath9k_hw_read_array.patch ++++ /dev/null +@@ -1,69 +0,0 @@ +-From: Oleksij Rempel +-Date: Sun, 22 Mar 2015 19:29:51 +0100 +-Subject: [PATCH] ath9k: add new function ath9k_hw_read_array +- +-REG_READ generate most overhead on usb bus. It send and read micro packages +-and reduce usb bandwidth. To reduce this overhead we should read in batches. +- +-Signed-off-by: Oleksij Rempel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/ath/ath9k/hw.c +-+++ b/drivers/net/wireless/ath/ath9k/hw.c +-@@ -121,6 +121,36 @@ void ath9k_hw_write_array(struct ath_hw +- REGWRITE_BUFFER_FLUSH(ah); +- } +- +-+void ath9k_hw_read_array(struct ath_hw *ah, u32 array[][2], int size) +-+{ +-+ u32 *tmp_reg_list, *tmp_data; +-+ int i; +-+ +-+ tmp_reg_list = kmalloc(size * sizeof(u32), GFP_KERNEL); +-+ if (!tmp_reg_list) { +-+ dev_err(ah->dev, "%s: tmp_reg_list: alloc filed\n", __func__); +-+ return; +-+ } +-+ +-+ tmp_data = kmalloc(size * sizeof(u32), GFP_KERNEL); +-+ if (!tmp_data) { +-+ dev_err(ah->dev, "%s tmp_data: alloc filed\n", __func__); +-+ goto error_tmp_data; +-+ } +-+ +-+ for (i = 0; i < size; i++) +-+ tmp_reg_list[i] = array[i][0]; +-+ +-+ REG_READ_MULTI(ah, tmp_reg_list, tmp_data, size); +-+ +-+ for (i = 0; i < size; i++) +-+ array[i][1] = tmp_data[i]; +-+ +-+ kfree(tmp_data); +-+error_tmp_data: +-+ kfree(tmp_reg_list); +-+} +-+ +- u32 ath9k_hw_reverse_bits(u32 val, u32 n) +- { +- u32 retval; +---- a/drivers/net/wireless/ath/ath9k/hw.h +-+++ b/drivers/net/wireless/ath/ath9k/hw.h +-@@ -138,6 +138,8 @@ +- +- #define REG_WRITE_ARRAY(iniarray, column, regWr) \ +- ath9k_hw_write_array(ah, iniarray, column, &(regWr)) +-+#define REG_READ_ARRAY(ah, array, size) \ +-+ ath9k_hw_read_array(ah, array, size) +- +- #define AR_GPIO_OUTPUT_MUX_AS_OUTPUT 0 +- #define AR_GPIO_OUTPUT_MUX_AS_PCIE_ATTENTION_LED 1 +-@@ -1020,6 +1022,7 @@ void ath9k_hw_synth_delay(struct ath_hw +- bool ath9k_hw_wait(struct ath_hw *ah, u32 reg, u32 mask, u32 val, u32 timeout); +- void ath9k_hw_write_array(struct ath_hw *ah, const struct ar5416IniArray *array, +- int column, unsigned int *writecnt); +-+void ath9k_hw_read_array(struct ath_hw *ah, u32 array[][2], int size); +- 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 +new file mode 100644 +index 0000000..abd6681 +--- /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 ++ ++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. ++ ++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/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); ++ } +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 +--- a/package/kernel/mac80211/patches/325-ath9k-ar9271_hw_pa_cal-use-REG_READ_ARRAY.patch ++++ /dev/null +@@ -1,24 +0,0 @@ +-From: Oleksij Rempel +-Date: Sun, 22 Mar 2015 19:29:52 +0100 +-Subject: [PATCH] ath9k: ar9271_hw_pa_cal: use REG_READ_ARRAY +- +-insted of reading each register separatly +-and waste 4ms on each operation, we can +-use one shot read. +- +-Signed-off-by: Oleksij Rempel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c +-+++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c +-@@ -440,8 +440,7 @@ static void ar9271_hw_pa_cal(struct ath_ +- { AR9285_AN_RF2G3, 0 }, +- }; +- +-- for (i = 0; i < ARRAY_SIZE(regList); i++) +-- regList[i][1] = REG_READ(ah, regList[i][0]); +-+ REG_READ_ARRAY(ah, regList, ARRAY_SIZE(regList)); +- +- 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 +new file mode 100644 +index 0000000..23a7b6f +--- /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() ++ ++Most call sites of brcmf_txfinalize already have struct brcmf_if ++instance so pass that to brcmf_txfinalize() as the function ++needs it anyway. ++ ++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 ++@@ -560,17 +560,11 @@ void brcmf_rx_frame(struct device *dev, ++ brcmf_netif_rx(ifp, skb); ++ } ++ ++-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; ++ ++- ifp = drvr->iflist[ifidx]; ++- if (!ifp) ++- goto done; ++- ++ eh = (struct ethhdr *)(txp->data); ++ type = ntohs(eh->h_proto); ++ ++@@ -582,7 +576,7 @@ void brcmf_txfinalize(struct brcmf_pub * ++ ++ 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; ++ } ++ ++@@ -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? +++ */ +++ brcmf_txfinalize(brcmf_get_ifp(msgbuf->drvr, tx_status->msg.ifidx), +++ skb, true); ++ } ++ ++ +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 +--- a/package/kernel/mac80211/patches/326-ath9k-use-one-shot-read-in-ath9k_hw_update_mibstats.patch ++++ /dev/null +@@ -1,39 +0,0 @@ +-From: Oleksij Rempel +-Date: Sun, 22 Mar 2015 19:29:53 +0100 +-Subject: [PATCH] ath9k: use one shot read in ath9k_hw_update_mibstats +- +-this will reduce some overhead on usb bus. +- +-Signed-off-by: Oleksij Rempel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/ath/ath9k/ani.c +-+++ b/drivers/net/wireless/ath/ath9k/ani.c +-@@ -107,11 +107,21 @@ static const struct ani_cck_level_entry +- static void ath9k_hw_update_mibstats(struct ath_hw *ah, +- struct ath9k_mib_stats *stats) +- { +-- stats->ackrcv_bad += REG_READ(ah, AR_ACK_FAIL); +-- stats->rts_bad += REG_READ(ah, AR_RTS_FAIL); +-- stats->fcs_bad += REG_READ(ah, AR_FCS_FAIL); +-- stats->rts_good += REG_READ(ah, AR_RTS_OK); +-- stats->beacons += REG_READ(ah, AR_BEACON_CNT); +-+ u32 addr[5] = {AR_RTS_OK, AR_RTS_FAIL, AR_ACK_FAIL, +-+ AR_FCS_FAIL, AR_BEACON_CNT}; +-+ u32 data[5]; +-+ +-+ REG_READ_MULTI(ah, &addr[0], &data[0], 5); +-+ /* AR_RTS_OK */ +-+ stats->rts_good += data[0]; +-+ /* AR_RTS_FAIL */ +-+ stats->rts_bad += data[1]; +-+ /* AR_ACK_FAIL */ +-+ stats->ackrcv_bad += data[2]; +-+ /* AR_FCS_FAIL */ +-+ stats->fcs_bad += data[3]; +-+ /* AR_BEACON_CNT */ +-+ stats->beacons += data[4]; +- } +- +- 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 +--- a/package/kernel/mac80211/patches/327-ath9k-ath9k_hw_loadnf-use-REG_RMW.patch ++++ /dev/null +@@ -1,71 +0,0 @@ +-From: Oleksij Rempel +-Date: Sun, 22 Mar 2015 19:29:54 +0100 +-Subject: [PATCH] ath9k: ath9k_hw_loadnf: use REG_RMW +- +-Signed-off-by: Oleksij Rempel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/ath/ath9k/calib.c +-+++ b/drivers/net/wireless/ath/ath9k/calib.c +-@@ -238,7 +238,6 @@ int ath9k_hw_loadnf(struct ath_hw *ah, s +- { +- struct ath9k_nfcal_hist *h = NULL; +- unsigned i, j; +-- int32_t val; +- 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); +-@@ -246,6 +245,7 @@ int ath9k_hw_loadnf(struct ath_hw *ah, s +- if (ah->caldata) +- h = ah->caldata->nfCalHist; +- +-+ ENABLE_REG_RMW_BUFFER(ah); +- for (i = 0; i < NUM_NF_READINGS; i++) { +- if (chainmask & (1 << i)) { +- s16 nfval; +-@@ -258,10 +258,8 @@ int ath9k_hw_loadnf(struct ath_hw *ah, s +- else +- nfval = default_nf; +- +-- val = REG_READ(ah, ah->nf_regs[i]); +-- val &= 0xFFFFFE00; +-- val |= (((u32) nfval << 1) & 0x1ff); +-- REG_WRITE(ah, ah->nf_regs[i], val); +-+ REG_RMW(ah, ah->nf_regs[i], +-+ (((u32) nfval << 1) & 0x1ff), 0x1ff); +- } +- } +- +-@@ -274,6 +272,7 @@ int ath9k_hw_loadnf(struct ath_hw *ah, s +- REG_CLR_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); +- +- /* +- * Wait for load to complete, should be fast, a few 10s of us. +-@@ -309,19 +308,17 @@ int ath9k_hw_loadnf(struct ath_hw *ah, s +- * by the median we just loaded. This will be initial (and max) value +- * of next noise floor calibration the baseband does. +- */ +-- ENABLE_REGWRITE_BUFFER(ah); +-+ ENABLE_REG_RMW_BUFFER(ah); +- for (i = 0; i < NUM_NF_READINGS; i++) { +- if (chainmask & (1 << i)) { +- if ((i >= AR5416_MAX_CHAINS) && !IS_CHAN_HT40(chan)) +- continue; +- +-- val = REG_READ(ah, ah->nf_regs[i]); +-- val &= 0xFFFFFE00; +-- val |= (((u32) (-50) << 1) & 0x1ff); +-- REG_WRITE(ah, ah->nf_regs[i], val); +-+ REG_RMW(ah, ah->nf_regs[i], +-+ (((u32) (-50) << 1) & 0x1ff), 0x1ff); +- } +- } +-- REGWRITE_BUFFER_FLUSH(ah); +-+ REG_RMW_BUFFER_FLUSH(ah); +- +- 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 +new file mode 100644 +index 0000000..a0a798b +--- /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 ++ ++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. ++ ++Reviewed-by: Hante Meuleman ++Reviewed-by: Franky (Zhenhui) Lin ++Reviewed-by: Pieter-Paul Giesberts ++Reviewed-by: Pontus Fuchs ++Signed-off-by: Arend van Spriel ++--- ++ ++--- 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); ++ } ++ ++@@ -656,6 +656,9 @@ static void brcmf_pcie_bus_console_read( ++ u8 ch; ++ u32 newidx; ++ +++ if (!BRCMF_FWCON_ON()) +++ return; +++ ++ 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; +++ ++ 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) { +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 +--- a/package/kernel/mac80211/patches/328-ath9k-write-buffer-related-optimisation-in-ar5008_hw.patch ++++ /dev/null +@@ -1,27 +0,0 @@ +-From: Oleksij Rempel +-Date: Sun, 22 Mar 2015 19:29:55 +0100 +-Subject: [PATCH] ath9k: write buffer related optimisation in +- ar5008_hw_set_channel_regs +- +-Signed-off-by: Oleksij Rempel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c +-+++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c +-@@ -681,12 +681,13 @@ static void ar5008_hw_set_channel_regs(s +- phymode |= AR_PHY_FC_DYN2040_PRI_CH; +- +- } +-+ ENABLE_REGWRITE_BUFFER(ah); +- REG_WRITE(ah, AR_PHY_TURBO, phymode); +- +-+ /* This function do only REG_WRITE, so +-+ * we can include it to REGWRITE_BUFFER. */ +- ath9k_hw_set11nmac2040(ah, chan); +- +-- ENABLE_REGWRITE_BUFFER(ah); +-- +- 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 +new file mode 100644 +index 0000000..53e7ede +--- /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() ++ ++The brcmf_fws_txstatus_suppressed() function prototype specifies an ++ifidx parameter which is not used within the function implementation. ++ ++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/fwsignal.c +++++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c ++@@ -1398,7 +1398,7 @@ done: ++ } ++ ++ 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; ++ } ++ 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); +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 +--- a/package/kernel/mac80211/patches/329-ath9k-ath9k_hw_set_4k_power_cal_tabl-use-rmw-buffer.patch ++++ /dev/null +@@ -1,26 +0,0 @@ +-From: Oleksij Rempel +-Date: Sun, 22 Mar 2015 19:29:56 +0100 +-Subject: [PATCH] ath9k: ath9k_hw_set_4k_power_cal_tabl: use rmw buffer +- +-Signed-off-by: Oleksij Rempel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c +-+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c +-@@ -389,6 +389,7 @@ static void ath9k_hw_set_4k_power_cal_ta +- } +- } +- +-+ ENABLE_REG_RMW_BUFFER(ah); +- REG_RMW_FIELD(ah, AR_PHY_TPCRG1, AR_PHY_TPCRG1_NUM_PD_GAIN, +- (numXpdGain - 1) & 0x3); +- REG_RMW_FIELD(ah, AR_PHY_TPCRG1, AR_PHY_TPCRG1_PD_GAIN_1, +-@@ -396,6 +397,7 @@ static void ath9k_hw_set_4k_power_cal_ta +- REG_RMW_FIELD(ah, AR_PHY_TPCRG1, AR_PHY_TPCRG1_PD_GAIN_2, +- xpdGainValues[1]); +- REG_RMW_FIELD(ah, AR_PHY_TPCRG1, AR_PHY_TPCRG1_PD_GAIN_3, 0); +-+ REG_RMW_BUFFER_FLUSH(ah); +- +- 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 +new file mode 100644 +index 0000000..bb05235 +--- /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() ++ ++Instead of passing ifidx and drvr just pass struct brcmf_if pointer ++which holds both parameters. ++ ++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/bcdc.c +++++ b/drivers/net/wireless/brcm80211/brcmfmac/bcdc.c ++@@ -312,8 +312,7 @@ brcmf_proto_bcdc_hdrpull(struct brcmf_pu ++ ++ 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) ++ { ++ 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; ++ } ++ ++ 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); ++ ++ 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 +--- a/package/kernel/mac80211/patches/330-ath9k-use-rmw-buffer-in-ath9k_hw_set_operating_mode-.patch ++++ /dev/null +@@ -1,43 +0,0 @@ +-From: Oleksij Rempel +-Date: Sun, 22 Mar 2015 19:29:57 +0100 +-Subject: [PATCH] ath9k: use rmw buffer in ath9k_hw_set_operating_mode +- and ath9k_hw_reset +- +-Signed-off-by: Oleksij Rempel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/ath/ath9k/hw.c +-+++ b/drivers/net/wireless/ath/ath9k/hw.c +-@@ -1227,6 +1227,7 @@ static void ath9k_hw_set_operating_mode( +- u32 mask = AR_STA_ID1_STA_AP | AR_STA_ID1_ADHOC; +- u32 set = AR_STA_ID1_KSRCH_MODE; +- +-+ ENABLE_REG_RMW_BUFFER(ah); +- switch (opmode) { +- case NL80211_IFTYPE_ADHOC: +- if (!AR_SREV_9340_13(ah)) { +-@@ -1248,6 +1249,7 @@ static void ath9k_hw_set_operating_mode( +- break; +- } +- REG_RMW(ah, AR_STA_ID1, set, mask); +-+ REG_RMW_BUFFER_FLUSH(ah); +- } +- +- void ath9k_hw_get_delta_slope_vals(struct ath_hw *ah, u32 coef_scaled, +-@@ -1960,6 +1962,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st +- if (!ath9k_hw_mci_is_enabled(ah)) +- REG_WRITE(ah, AR_OBS, 8); +- +-+ ENABLE_REG_RMW_BUFFER(ah); +- if (ah->config.rx_intr_mitigation) { +- REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_LAST, ah->config.rimt_last); +- REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_FIRST, ah->config.rimt_first); +-@@ -1969,6 +1972,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st +- REG_RMW_FIELD(ah, AR_TIMT, AR_TIMT_LAST, 300); +- REG_RMW_FIELD(ah, AR_TIMT, AR_TIMT_FIRST, 750); +- } +-+ REG_RMW_BUFFER_FLUSH(ah); +- +- 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 +new file mode 100644 +index 0000000..0651a2f +--- /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 ++ ++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. ++ ++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 ++--- ++ ++--- 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; ++ ++- brcmf_free_vif(vif); +++ if (vif) +++ brcmf_free_vif(vif); ++ free_netdev(ndev); ++ } ++ ++--- 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 +--- a/package/kernel/mac80211/patches/331-ath9k-ath9k_hw_4k_set_board_values-use-rmw-buffer.patch ++++ /dev/null +@@ -1,26 +0,0 @@ +-From: Oleksij Rempel +-Date: Sun, 22 Mar 2015 19:29:58 +0100 +-Subject: [PATCH] ath9k: ath9k_hw_4k_set_board_values: use rmw buffer +- +-Signed-off-by: Oleksij Rempel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c +-+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c +-@@ -1082,6 +1082,7 @@ static void ath9k_hw_4k_set_board_values +- mask = BIT(0)|BIT(5)|BIT(10)|BIT(15)|BIT(20)|BIT(25); +- pwrctrl = mask * bb_desired_scale; +- clr = mask * 0x1f; +-+ ENABLE_REG_RMW_BUFFER(ah); +- REG_RMW(ah, AR_PHY_TX_PWRCTRL8, pwrctrl, clr); +- REG_RMW(ah, AR_PHY_TX_PWRCTRL10, pwrctrl, clr); +- REG_RMW(ah, AR_PHY_CH0_TX_PWRCTRL12, pwrctrl, clr); +-@@ -1096,6 +1097,7 @@ static void ath9k_hw_4k_set_board_values +- clr = mask * 0x1f; +- REG_RMW(ah, AR_PHY_CH0_TX_PWRCTRL11, pwrctrl, clr); +- REG_RMW(ah, AR_PHY_CH0_TX_PWRCTRL13, pwrctrl, clr); +-+ REG_RMW_BUFFER_FLUSH(ah); +- } +- } +- +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 +new file mode 100644 +index 0000000..5a7e447 +--- /dev/null ++++ b/package/kernel/mac80211/patches/331-brcmfmac-Reset-PCIE-devices-after-recognition.patch +@@ -0,0 +1,193 @@ ++From: Hante Meuleman ++Date: Thu, 27 Aug 2015 16:14:06 +0200 ++Subject: [PATCH] brcmfmac: Reset PCIE devices after recognition. ++ ++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. ++ ++Cc: Rafal Milecki ++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 ++--- ++ ++--- 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 ++ +++/* 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; ++ } +++ +++ if (ci->pub.ramsize > BRCMF_CHIP_MAX_MEMSIZE) { +++ brcmf_err("RAM size is incorrect\n"); +++ return -ENOMEM; +++ } +++ ++ return 0; ++ } ++ ++@@ -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); ++ } ++ ++--- 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); ++ }; ++--- 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 * ++ } ++ ++ +++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) ++ { ++@@ -1647,6 +1671,7 @@ static void brcmf_pcie_buscore_activate( ++ ++ 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); ++ ++ 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 ++ ++ /* 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 +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 +--- a/package/kernel/mac80211/patches/332-ath9k-ath9k_hw_analog_shift_rmw-use-REG_RMW.patch ++++ /dev/null +@@ -1,27 +0,0 @@ +-From: Oleksij Rempel +-Date: Sun, 22 Mar 2015 19:29:59 +0100 +-Subject: [PATCH] ath9k: ath9k_hw_analog_shift_rmw: use REG_RMW +- +-use REG_RMW in ath9k_hw_analog_shift_rmw. +-It will double execution speed on usb bus. +- +-Signed-off-by: Oleksij Rempel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/ath/ath9k/eeprom.c +-+++ b/drivers/net/wireless/ath/ath9k/eeprom.c +-@@ -27,12 +27,7 @@ void ath9k_hw_analog_shift_regwrite(stru +- void ath9k_hw_analog_shift_rmw(struct ath_hw *ah, u32 reg, u32 mask, +- u32 shift, u32 val) +- { +-- u32 regVal; +-- +-- regVal = REG_READ(ah, reg) & ~mask; +-- regVal |= (val << shift) & mask; +-- +-- REG_WRITE(ah, reg, regVal); +-+ REG_RMW(ah, reg, ((val << shift) & mask), mask); +- +- 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 +new file mode 100644 +index 0000000..faf6cdc +--- /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 ++ ++This patch fix https://lists.openwrt.org/pipermail/openwrt-devel/ ++2015-August/034979.html. As the peak detect calibration is set ++incorrectly. ++ ++Signed-off-by: Miaoqing Pan ++--- ++ ++--- 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); ++ ++- 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; +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 +--- a/package/kernel/mac80211/patches/333-ath9k-use-REG_RMW-and-rmw-buffer-in-ath9k_hw_4k_set_.patch ++++ /dev/null +@@ -1,47 +0,0 @@ +-From: Oleksij Rempel +-Date: Sun, 22 Mar 2015 19:30:01 +0100 +-Subject: [PATCH] ath9k: use REG_RMW and rmw buffer in +- ath9k_hw_4k_set_gain +- +-it is possible to reduce time needed for this function +-by rplacing REG_WRITE with REG_RMW (plus dummy 0) and putt all commands +-in same buffer. +- +-Signed-off-by: Oleksij Rempel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c +-+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c +-@@ -772,15 +772,14 @@ static void ath9k_hw_4k_set_gain(struct +- struct ar5416_eeprom_4k *eep, +- u8 txRxAttenLocal) +- { +-- REG_WRITE(ah, AR_PHY_SWITCH_CHAIN_0, +-- pModal->antCtrlChain[0]); +-- +-- REG_WRITE(ah, AR_PHY_TIMING_CTRL4(0), +-- (REG_READ(ah, AR_PHY_TIMING_CTRL4(0)) & +-- ~(AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF | +-- AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF)) | +-- SM(pModal->iqCalICh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF) | +-- SM(pModal->iqCalQCh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF)); +-+ ENABLE_REG_RMW_BUFFER(ah); +-+ REG_RMW(ah, AR_PHY_SWITCH_CHAIN_0, +-+ pModal->antCtrlChain[0], 0); +-+ +-+ REG_RMW(ah, AR_PHY_TIMING_CTRL4(0), +-+ SM(pModal->iqCalICh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF) | +-+ SM(pModal->iqCalQCh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF), +-+ AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF | AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF); +- +- if ((eep->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK) >= +- AR5416_EEP_MINOR_VER_3) { +-@@ -819,6 +818,7 @@ static void ath9k_hw_4k_set_gain(struct +- AR9280_PHY_RXGAIN_TXRX_ATTEN, txRxAttenLocal); +- REG_RMW_FIELD(ah, AR_PHY_RXGAIN + 0x1000, +- AR9280_PHY_RXGAIN_TXRX_MARGIN, pModal->rxTxMarginCh[0]); +-+ REG_RMW_BUFFER_FLUSH(ah); +- } +- +- /* +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 +--- a/package/kernel/mac80211/patches/334-ath9k-use-REG_RMW-and-rmw-buffer-in-ath9k_hw_def_set.patch ++++ /dev/null +@@ -1,67 +0,0 @@ +-From: Oleksij Rempel +-Date: Sun, 22 Mar 2015 19:30:03 +0100 +-Subject: [PATCH] ath9k: use REG_RMW and rmw buffer in +- ath9k_hw_def_set_gain +- +-Signed-off-by: Oleksij Rempel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/ath/ath9k/eeprom_def.c +-+++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c +-@@ -466,6 +466,7 @@ static void ath9k_hw_def_set_gain(struct +- struct ar5416_eeprom_def *eep, +- u8 txRxAttenLocal, int regChainOffset, int i) +- { +-+ ENABLE_REG_RMW_BUFFER(ah); +- if (AR5416_VER_MASK >= AR5416_EEP_MINOR_VER_3) { +- txRxAttenLocal = pModal->txRxAttenCh[i]; +- +-@@ -483,16 +484,12 @@ static void ath9k_hw_def_set_gain(struct +- AR_PHY_GAIN_2GHZ_XATTEN2_DB, +- pModal->xatten2Db[i]); +- } else { +-- REG_WRITE(ah, AR_PHY_GAIN_2GHZ + regChainOffset, +-- (REG_READ(ah, AR_PHY_GAIN_2GHZ + regChainOffset) & +-- ~AR_PHY_GAIN_2GHZ_BSW_MARGIN) +-- | SM(pModal-> bswMargin[i], +-- AR_PHY_GAIN_2GHZ_BSW_MARGIN)); +-- REG_WRITE(ah, AR_PHY_GAIN_2GHZ + regChainOffset, +-- (REG_READ(ah, AR_PHY_GAIN_2GHZ + regChainOffset) & +-- ~AR_PHY_GAIN_2GHZ_BSW_ATTEN) +-- | SM(pModal->bswAtten[i], +-- AR_PHY_GAIN_2GHZ_BSW_ATTEN)); +-+ REG_RMW(ah, AR_PHY_GAIN_2GHZ + regChainOffset, +-+ SM(pModal-> bswMargin[i], AR_PHY_GAIN_2GHZ_BSW_MARGIN), +-+ AR_PHY_GAIN_2GHZ_BSW_MARGIN); +-+ REG_RMW(ah, AR_PHY_GAIN_2GHZ + regChainOffset, +-+ SM(pModal->bswAtten[i], AR_PHY_GAIN_2GHZ_BSW_ATTEN), +-+ AR_PHY_GAIN_2GHZ_BSW_ATTEN); +- } +- } +- +-@@ -504,17 +501,14 @@ static void ath9k_hw_def_set_gain(struct +- AR_PHY_RXGAIN + regChainOffset, +- AR9280_PHY_RXGAIN_TXRX_MARGIN, pModal->rxTxMarginCh[i]); +- } else { +-- REG_WRITE(ah, +-- AR_PHY_RXGAIN + regChainOffset, +-- (REG_READ(ah, AR_PHY_RXGAIN + regChainOffset) & +-- ~AR_PHY_RXGAIN_TXRX_ATTEN) +-- | SM(txRxAttenLocal, AR_PHY_RXGAIN_TXRX_ATTEN)); +-- REG_WRITE(ah, +-- AR_PHY_GAIN_2GHZ + regChainOffset, +-- (REG_READ(ah, AR_PHY_GAIN_2GHZ + regChainOffset) & +-- ~AR_PHY_GAIN_2GHZ_RXTX_MARGIN) | +-- SM(pModal->rxTxMarginCh[i], AR_PHY_GAIN_2GHZ_RXTX_MARGIN)); +-+ REG_RMW(ah, AR_PHY_RXGAIN + regChainOffset, +-+ SM(txRxAttenLocal, AR_PHY_RXGAIN_TXRX_ATTEN), +-+ AR_PHY_RXGAIN_TXRX_ATTEN); +-+ REG_RMW(ah, AR_PHY_GAIN_2GHZ + regChainOffset, +-+ SM(pModal->rxTxMarginCh[i], AR_PHY_GAIN_2GHZ_RXTX_MARGIN), +-+ AR_PHY_GAIN_2GHZ_RXTX_MARGIN); +- } +-+ REG_RMW_BUFFER_FLUSH(ah); +- } +- +- 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-brcmfmac-Fix-oops-when-SDIO-device-is-removed.patch b/package/kernel/mac80211/patches/335-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 ++++ /dev/null +@@ -1,44 +0,0 @@ +-From: Hante Meuleman +-Date: Fri, 6 Mar 2015 18:40:38 +0100 +-Subject: [PATCH] brcmfmac: Fix oops when SDIO device is removed. +- +-On removal of SDIO card both functions of card will be getting +-a remove call. When the first is hanging in ctrl frame xmit then +-the second will cause oops. This patch fixes the xmit ctrl +-handling in case of serious errors and also limits the handling +-for remove to function 1 only. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Daniel (Deognyoun) Kim +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +-@@ -1194,7 +1194,7 @@ static void brcmf_ops_sdio_remove(struct +- brcmf_dbg(SDIO, "sdio device ID: 0x%04x\n", func->device); +- brcmf_dbg(SDIO, "Function: %d\n", func->num); +- +-- if (func->num != 1 && func->num != 2) +-+ if (func->num != 1) +- return; +- +- bus_if = dev_get_drvdata(&func->dev); +---- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-@@ -2740,6 +2740,11 @@ static void brcmf_sdio_dpc(struct brcmf_ +- if ((bus->sdiodev->state != BRCMF_SDIOD_DATA) || (err != 0)) { +- brcmf_err("failed backplane access over SDIO, halting operation\n"); +- atomic_set(&bus->intstatus, 0); +-+ if (bus->ctrl_frame_stat) { +-+ bus->ctrl_frame_err = -ENODEV; +-+ bus->ctrl_frame_stat = false; +-+ brcmf_sdio_wait_event_wakeup(bus); +-+ } +- } 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 +deleted file mode 100644 +index 201da75..0000000 +--- a/package/kernel/mac80211/patches/336-brcmfmac-Simplify-watchdog-sleep.patch ++++ /dev/null +@@ -1,157 +0,0 @@ +-From: Hante Meuleman +-Date: Fri, 6 Mar 2015 18:40:39 +0100 +-Subject: [PATCH] brcmfmac: Simplify watchdog sleep. +- +-The watchdog thread is used to put the SDIO bus to sleep when the +-system is idling. This patch simplifies the way it is determined +-when sleep can be entered. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Daniel (Deognyoun) Kim +-Signed-off-by: Hante Meuleman +-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 +-@@ -485,10 +485,9 @@ struct brcmf_sdio { +- #endif /* DEBUG */ +- +- uint clkstate; /* State of sd and backplane clock(s) */ +-- bool activity; /* Activity flag for clock down */ +- s32 idletime; /* Control for activity timeout */ +-- s32 idlecount; /* Activity timeout counter */ +-- s32 idleclock; /* How to set bus driver when idle */ +-+ s32 idlecount; /* Activity timeout counter */ +-+ s32 idleclock; /* How to set bus driver when idle */ +- bool rxflow_mode; /* Rx flow control mode */ +- bool rxflow; /* Is rx flow control on */ +- bool alp_only; /* Don't use HT clock (ALP only) */ +-@@ -511,6 +510,7 @@ struct brcmf_sdio { +- struct workqueue_struct *brcmf_wq; +- struct work_struct datawork; +- atomic_t dpc_tskcnt; +-+ atomic_t dpc_running; +- +- bool txoff; /* Transmit flow-controlled */ +- struct brcmf_sdio_count sdcnt; +-@@ -959,13 +959,8 @@ static int brcmf_sdio_clkctl(struct brcm +- brcmf_dbg(SDIO, "Enter\n"); +- +- /* Early exit if we're already there */ +-- if (bus->clkstate == target) { +-- if (target == CLK_AVAIL) { +-- brcmf_sdio_wd_timer(bus, BRCMF_WD_POLL_MS); +-- bus->activity = true; +-- } +-+ if (bus->clkstate == target) +- return 0; +-- } +- +- switch (target) { +- case CLK_AVAIL: +-@@ -975,7 +970,6 @@ static int brcmf_sdio_clkctl(struct brcm +- /* Now request HT Avail on the backplane */ +- brcmf_sdio_htclk(bus, true, pendok); +- brcmf_sdio_wd_timer(bus, BRCMF_WD_POLL_MS); +-- bus->activity = true; +- break; +- +- case CLK_SDONLY: +-@@ -1024,17 +1018,6 @@ brcmf_sdio_bus_sleep(struct brcmf_sdio * +- +- /* Going to sleep */ +- if (sleep) { +-- /* Don't sleep if something is pending */ +-- if (atomic_read(&bus->intstatus) || +-- atomic_read(&bus->ipend) > 0 || +-- bus->ctrl_frame_stat || +-- (!atomic_read(&bus->fcstate) && +-- brcmu_pktq_mlen(&bus->txq, ~bus->flowcontrol) && +-- data_ok(bus))) { +-- err = -EBUSY; +-- goto done; +-- } +-- +- clkcsr = brcmf_sdiod_regrb(bus->sdiodev, +- SBSDIO_FUNC1_CHIPCLKCSR, +- &err); +-@@ -1045,11 +1028,7 @@ brcmf_sdio_bus_sleep(struct brcmf_sdio * +- SBSDIO_ALP_AVAIL_REQ, &err); +- } +- err = brcmf_sdio_kso_control(bus, false); +-- /* disable watchdog */ +-- if (!err) +-- brcmf_sdio_wd_timer(bus, 0); +- } else { +-- bus->idlecount = 0; +- err = brcmf_sdio_kso_control(bus, true); +- } +- if (err) { +-@@ -3566,7 +3545,7 @@ void brcmf_sdio_isr(struct brcmf_sdio *b +- queue_work(bus->brcmf_wq, &bus->datawork); +- } +- +--static bool brcmf_sdio_bus_watchdog(struct brcmf_sdio *bus) +-+static void brcmf_sdio_bus_watchdog(struct brcmf_sdio *bus) +- { +- brcmf_dbg(TIMER, "Enter\n"); +- +-@@ -3627,22 +3606,21 @@ static bool brcmf_sdio_bus_watchdog(stru +- #endif /* DEBUG */ +- +- /* On idle timeout clear activity flag and/or turn off clock */ +-- if ((bus->idletime > 0) && (bus->clkstate == CLK_AVAIL)) { +-- if (++bus->idlecount >= bus->idletime) { +-+ if ((atomic_read(&bus->dpc_tskcnt) == 0) && +-+ (atomic_read(&bus->dpc_running) == 0) && +-+ (bus->idletime > 0) && (bus->clkstate == CLK_AVAIL)) { +-+ bus->idlecount++; +-+ if (bus->idlecount > bus->idletime) { +-+ brcmf_dbg(SDIO, "idle\n"); +-+ sdio_claim_host(bus->sdiodev->func[1]); +-+ brcmf_sdio_wd_timer(bus, 0); +- bus->idlecount = 0; +-- if (bus->activity) { +-- bus->activity = false; +-- brcmf_sdio_wd_timer(bus, BRCMF_WD_POLL_MS); +-- } else { +-- brcmf_dbg(SDIO, "idle\n"); +-- sdio_claim_host(bus->sdiodev->func[1]); +-- brcmf_sdio_bus_sleep(bus, true, false); +-- sdio_release_host(bus->sdiodev->func[1]); +-- } +-+ brcmf_sdio_bus_sleep(bus, true, false); +-+ sdio_release_host(bus->sdiodev->func[1]); +- } +-+ } else { +-+ bus->idlecount = 0; +- } +-- +-- return (atomic_read(&bus->ipend) > 0); +- } +- +- static void brcmf_sdio_dataworker(struct work_struct *work) +-@@ -3651,8 +3629,11 @@ static void brcmf_sdio_dataworker(struct +- datawork); +- +- while (atomic_read(&bus->dpc_tskcnt)) { +-+ atomic_set(&bus->dpc_running, 1); +- atomic_set(&bus->dpc_tskcnt, 0); +- brcmf_sdio_dpc(bus); +-+ bus->idlecount = 0; +-+ atomic_set(&bus->dpc_running, 0); +- } +- if (brcmf_sdiod_freezing(bus->sdiodev)) { +- brcmf_sdiod_change_state(bus->sdiodev, BRCMF_SDIOD_DOWN); +-@@ -4154,6 +4135,7 @@ struct brcmf_sdio *brcmf_sdio_probe(stru +- } +- /* Initialize DPC thread */ +- atomic_set(&bus->dpc_tskcnt, 0); +-+ atomic_set(&bus->dpc_running, 0); +- +- /* 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 +deleted file mode 100644 +index 3a2de7a..0000000 +--- a/package/kernel/mac80211/patches/337-brcmfmac-Fix-possible-race-condition.patch ++++ /dev/null +@@ -1,83 +0,0 @@ +-From: Hante Meuleman +-Date: Fri, 6 Mar 2015 18:40:40 +0100 +-Subject: [PATCH] brcmfmac: Fix possible race-condition. +- +-SDIO is using a "shared" variable to handoff ctl frames to DPC +-and to see when they are done. In a timeout situation this can +-lead to erroneous situation where DPC started to handle the ctl +-frame while the timeout expired. This patch will fix this by +-adding locking around the shared variable. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Daniel (Deognyoun) Kim +-Signed-off-by: Hante Meuleman +-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 +-@@ -2700,11 +2700,13 @@ static void brcmf_sdio_dpc(struct brcmf_ +- if (bus->ctrl_frame_stat && (bus->clkstate == CLK_AVAIL) && +- data_ok(bus)) { +- sdio_claim_host(bus->sdiodev->func[1]); +-- err = brcmf_sdio_tx_ctrlframe(bus, bus->ctrl_frame_buf, +-- bus->ctrl_frame_len); +-+ if (bus->ctrl_frame_stat) { +-+ err = brcmf_sdio_tx_ctrlframe(bus, bus->ctrl_frame_buf, +-+ bus->ctrl_frame_len); +-+ bus->ctrl_frame_err = err; +-+ bus->ctrl_frame_stat = false; +-+ } +- sdio_release_host(bus->sdiodev->func[1]); +-- bus->ctrl_frame_err = err; +-- bus->ctrl_frame_stat = false; +- brcmf_sdio_wait_event_wakeup(bus); +- } +- /* Send queued frames (limit 1 if rx may still be pending) */ +-@@ -2720,9 +2722,13 @@ static void brcmf_sdio_dpc(struct brcmf_ +- brcmf_err("failed backplane access over SDIO, halting operation\n"); +- atomic_set(&bus->intstatus, 0); +- if (bus->ctrl_frame_stat) { +-- bus->ctrl_frame_err = -ENODEV; +-- bus->ctrl_frame_stat = false; +-- brcmf_sdio_wait_event_wakeup(bus); +-+ sdio_claim_host(bus->sdiodev->func[1]); +-+ if (bus->ctrl_frame_stat) { +-+ bus->ctrl_frame_err = -ENODEV; +-+ bus->ctrl_frame_stat = false; +-+ brcmf_sdio_wait_event_wakeup(bus); +-+ } +-+ sdio_release_host(bus->sdiodev->func[1]); +- } +- } else if (atomic_read(&bus->intstatus) || +- atomic_read(&bus->ipend) > 0 || +-@@ -2930,15 +2936,20 @@ brcmf_sdio_bus_txctl(struct device *dev, +- brcmf_sdio_trigger_dpc(bus); +- wait_event_interruptible_timeout(bus->ctrl_wait, !bus->ctrl_frame_stat, +- msecs_to_jiffies(CTL_DONE_TIMEOUT)); +-- +-- if (!bus->ctrl_frame_stat) { +-+ ret = 0; +-+ if (bus->ctrl_frame_stat) { +-+ sdio_claim_host(bus->sdiodev->func[1]); +-+ if (bus->ctrl_frame_stat) { +-+ brcmf_dbg(SDIO, "ctrl_frame timeout\n"); +-+ bus->ctrl_frame_stat = false; +-+ ret = -ETIMEDOUT; +-+ } +-+ sdio_release_host(bus->sdiodev->func[1]); +-+ } +-+ if (!ret) { +- brcmf_dbg(SDIO, "ctrl_frame complete, err=%d\n", +- bus->ctrl_frame_err); +- ret = bus->ctrl_frame_err; +-- } else { +-- brcmf_dbg(SDIO, "ctrl_frame timeout\n"); +-- bus->ctrl_frame_stat = false; +-- ret = -ETIMEDOUT; +- } +- +- 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 +deleted file mode 100644 +index c9eb900..0000000 +--- a/package/kernel/mac80211/patches/338-brcmfmac-Add-support-for-BCM4345-SDIO-chipset.patch ++++ /dev/null +@@ -1,86 +0,0 @@ +-From: Syed Asifful Dayyan +-Date: Fri, 6 Mar 2015 18:40:42 +0100 +-Subject: [PATCH] brcmfmac: Add support for BCM4345 SDIO chipset. +- +-These changes add support for BCM4345 SDIO chipset. +- +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Hante Meuleman +-Reviewed-by: Daniel (Deognyoun) Kim +-Signed-off-by: Syed Asifful Dayyan +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +-@@ -1096,6 +1096,7 @@ static const struct sdio_device_id brcmf +- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43341), +- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43362), +- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4335_4339), +-+ BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4345), +- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4354), +- { /* end: all zeroes */ } +- }; +---- a/drivers/net/wireless/brcm80211/brcmfmac/chip.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c +-@@ -491,6 +491,10 @@ static void brcmf_chip_get_raminfo(struc +- case BRCM_CC_43362_CHIP_ID: +- ci->pub.ramsize = 0x3c000; +- break; +-+ case BRCM_CC_4345_CHIP_ID: +-+ ci->pub.ramsize = 0xc8000; +-+ ci->pub.rambase = 0x198000; +-+ break; +- case BRCM_CC_4339_CHIP_ID: +- case BRCM_CC_4354_CHIP_ID: +- case BRCM_CC_4356_CHIP_ID: +---- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-@@ -617,6 +617,8 @@ static const struct sdiod_drive_str sdio +- #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 BCM4345_FIRMWARE_NAME "brcm/brcmfmac4345-sdio.bin" +-+#define BCM4345_NVRAM_NAME "brcm/brcmfmac4345-sdio.txt" +- #define BCM4354_FIRMWARE_NAME "brcm/brcmfmac4354-sdio.bin" +- #define BCM4354_NVRAM_NAME "brcm/brcmfmac4354-sdio.txt" +- +-@@ -640,6 +642,8 @@ MODULE_FIRMWARE(BCM43362_FIRMWARE_NAME); +- MODULE_FIRMWARE(BCM43362_NVRAM_NAME); +- MODULE_FIRMWARE(BCM4339_FIRMWARE_NAME); +- MODULE_FIRMWARE(BCM4339_NVRAM_NAME); +-+MODULE_FIRMWARE(BCM4345_FIRMWARE_NAME); +-+MODULE_FIRMWARE(BCM4345_NVRAM_NAME); +- MODULE_FIRMWARE(BCM4354_FIRMWARE_NAME); +- MODULE_FIRMWARE(BCM4354_NVRAM_NAME); +- +-@@ -669,6 +673,7 @@ static const struct brcmf_firmware_names +- { 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_4345_CHIP_ID, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4345) }, +- { BRCM_CC_4354_CHIP_ID, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4354) } +- }; +- +---- a/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h +-+++ b/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h +-@@ -37,6 +37,7 @@ +- #define BRCM_CC_43362_CHIP_ID 43362 +- #define BRCM_CC_4335_CHIP_ID 0x4335 +- #define BRCM_CC_4339_CHIP_ID 0x4339 +-+#define BRCM_CC_4345_CHIP_ID 0x4345 +- #define BRCM_CC_4354_CHIP_ID 0x4354 +- #define BRCM_CC_4356_CHIP_ID 0x4356 +- #define BRCM_CC_43566_CHIP_ID 43566 +---- a/include/linux/mmc/sdio_ids.h +-+++ b/include/linux/mmc/sdio_ids.h +-@@ -33,6 +33,7 @@ +- #define SDIO_DEVICE_ID_BROADCOM_43341 0xa94d +- #define SDIO_DEVICE_ID_BROADCOM_4335_4339 0x4335 +- #define SDIO_DEVICE_ID_BROADCOM_43362 0xa962 +-+#define SDIO_DEVICE_ID_BROADCOM_4345 0x4345 +- #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 +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-brcmfmac-remove-duplication-of-ramsize-info.patch b/package/kernel/mac80211/patches/339-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 ++++ /dev/null +@@ -1,48 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 11 Mar 2015 16:11:27 +0100 +-Subject: [PATCH] brcmfmac: remove duplication of ramsize info +- +-Removing the ramsize from the brcmf_sdio structure to avoid +-duplication. The information is available in brcmf_chip +-structure. +- +-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/sdio.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-@@ -432,8 +432,6 @@ struct brcmf_sdio { +- struct brcmf_sdio_dev *sdiodev; /* sdio device handler */ +- struct brcmf_chip *ci; /* Chip info struct */ +- +-- u32 ramsize; /* Size of RAM in SOCRAM (bytes) */ +-- +- u32 hostintmask; /* Copy of Host Interrupt Mask */ +- atomic_t intstatus; /* Intstatus bits (events) pending */ +- atomic_t fcstate; /* State of dongle flow-control */ +-@@ -1075,7 +1073,7 @@ static int brcmf_sdio_readshared(struct +- struct sdpcm_shared_le sh_le; +- __le32 addr_le; +- +-- shaddr = bus->ci->rambase + bus->ramsize - 4; +-+ shaddr = bus->ci->rambase + bus->ci->ramsize - 4; +- +- /* +- * Read last word in socram to determine +-@@ -3871,13 +3869,6 @@ brcmf_sdio_probe_attach(struct brcmf_sdi +- drivestrength = DEFAULT_SDIO_DRIVE_STRENGTH; +- brcmf_sdio_drivestrengthinit(bus->sdiodev, bus->ci, drivestrength); +- +-- /* Get info on the SOCRAM cores... */ +-- bus->ramsize = bus->ci->ramsize; +-- if (!(bus->ramsize)) { +-- brcmf_err("failed to find SOCRAM memory!\n"); +-- goto fail; +-- } +-- +- /* 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 +deleted file mode 100644 +index e2a2074..0000000 +--- a/package/kernel/mac80211/patches/340-brcmfmac-always-perform-cores-checks.patch ++++ /dev/null +@@ -1,74 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 11 Mar 2015 16:11:28 +0100 +-Subject: [PATCH] brcmfmac: always perform cores checks +- +-Instead of checking the cores in the chip only if CONFIG_BRCMDBG +-is selected perform the check always and extend it with more sanity +-checking. +- +-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/chip.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c +-@@ -419,13 +419,13 @@ static struct brcmf_core *brcmf_chip_add +- return &core->pub; +- } +- +--#ifdef DEBUG +- /* safety check for chipinfo */ +- static int brcmf_chip_cores_check(struct brcmf_chip_priv *ci) +- { +- struct brcmf_core_priv *core; +- bool need_socram = false; +- bool has_socram = false; +-+ bool cpu_found = false; +- int idx = 1; +- +- list_for_each_entry(core, &ci->cores, list) { +-@@ -435,12 +435,14 @@ static int brcmf_chip_cores_check(struct +- +- switch (core->pub.id) { +- case BCMA_CORE_ARM_CM3: +-+ cpu_found = true; +- need_socram = true; +- break; +- case BCMA_CORE_INTERNAL_MEM: +- has_socram = true; +- break; +- case BCMA_CORE_ARM_CR4: +-+ cpu_found = true; +- if (ci->pub.rambase == 0) { +- brcmf_err("RAM base not provided with ARM CR4 core\n"); +- return -ENOMEM; +-@@ -451,19 +453,21 @@ static int brcmf_chip_cores_check(struct +- } +- } +- +-+ if (!cpu_found) { +-+ brcmf_err("CPU core not detected\n"); +-+ return -ENXIO; +-+ } +- /* check RAM core presence for ARM CM3 core */ +- if (need_socram && !has_socram) { +- brcmf_err("RAM core not provided with ARM CM3 core\n"); +- return -ENODEV; +- } +-+ if (!ci->pub.ramsize) { +-+ brcmf_err("RAM size is undetermined\n"); +-+ return -ENOMEM; +-+ } +- return 0; +- } +--#else /* DEBUG */ +--static inline int brcmf_chip_cores_check(struct brcmf_chip_priv *ci) +--{ +-- return 0; +--} +--#endif +- +- 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 +deleted file mode 100644 +index a272800..0000000 +--- a/package/kernel/mac80211/patches/341-brcmfmac-rename-chip-download-functions.patch ++++ /dev/null +@@ -1,240 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 11 Mar 2015 16:11:29 +0100 +-Subject: [PATCH] brcmfmac: rename chip download functions +- +-The functions brcmf_chip_[enter/exit]_download() are not exclusively +-used for firmware download so rename these more appropriate. +- +-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/chip.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c +-@@ -807,7 +807,7 @@ struct brcmf_chip *brcmf_chip_attach(voi +- err = -EINVAL; +- if (WARN_ON(!ops->prepare)) +- err = -EINVAL; +-- if (WARN_ON(!ops->exit_dl)) +-+ if (WARN_ON(!ops->activate)) +- err = -EINVAL; +- if (err < 0) +- return ERR_PTR(-EINVAL); +-@@ -905,7 +905,7 @@ void brcmf_chip_resetcore(struct brcmf_c +- } +- +- static void +--brcmf_chip_cm3_enterdl(struct brcmf_chip_priv *chip) +-+brcmf_chip_cm3_set_passive(struct brcmf_chip_priv *chip) +- { +- struct brcmf_core *core; +- +-@@ -919,7 +919,7 @@ brcmf_chip_cm3_enterdl(struct brcmf_chip +- brcmf_chip_resetcore(core, 0, 0, 0); +- } +- +--static bool brcmf_chip_cm3_exitdl(struct brcmf_chip_priv *chip) +-+static bool brcmf_chip_cm3_set_active(struct brcmf_chip_priv *chip) +- { +- struct brcmf_core *core; +- +-@@ -929,7 +929,7 @@ static bool brcmf_chip_cm3_exitdl(struct +- return false; +- } +- +-- chip->ops->exit_dl(chip->ctx, &chip->pub, 0); +-+ chip->ops->activate(chip->ctx, &chip->pub, 0); +- +- core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_ARM_CM3); +- brcmf_chip_resetcore(core, 0, 0, 0); +-@@ -938,7 +938,7 @@ static bool brcmf_chip_cm3_exitdl(struct +- } +- +- static inline void +--brcmf_chip_cr4_enterdl(struct brcmf_chip_priv *chip) +-+brcmf_chip_cr4_set_passive(struct brcmf_chip_priv *chip) +- { +- struct brcmf_core *core; +- +-@@ -951,11 +951,11 @@ brcmf_chip_cr4_enterdl(struct brcmf_chip +- D11_BCMA_IOCTL_PHYCLOCKEN); +- } +- +--static bool brcmf_chip_cr4_exitdl(struct brcmf_chip_priv *chip, u32 rstvec) +-+static bool brcmf_chip_cr4_set_active(struct brcmf_chip_priv *chip, u32 rstvec) +- { +- struct brcmf_core *core; +- +-- chip->ops->exit_dl(chip->ctx, &chip->pub, rstvec); +-+ chip->ops->activate(chip->ctx, &chip->pub, rstvec); +- +- /* restore ARM */ +- core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_ARM_CR4); +-@@ -964,7 +964,7 @@ static bool brcmf_chip_cr4_exitdl(struct +- return true; +- } +- +--void brcmf_chip_enter_download(struct brcmf_chip *pub) +-+void brcmf_chip_set_passive(struct brcmf_chip *pub) +- { +- struct brcmf_chip_priv *chip; +- struct brcmf_core *arm; +-@@ -974,14 +974,14 @@ void brcmf_chip_enter_download(struct br +- chip = container_of(pub, struct brcmf_chip_priv, pub); +- arm = brcmf_chip_get_core(pub, BCMA_CORE_ARM_CR4); +- if (arm) { +-- brcmf_chip_cr4_enterdl(chip); +-+ brcmf_chip_cr4_set_passive(chip); +- return; +- } +- +-- brcmf_chip_cm3_enterdl(chip); +-+ brcmf_chip_cm3_set_passive(chip); +- } +- +--bool brcmf_chip_exit_download(struct brcmf_chip *pub, u32 rstvec) +-+bool brcmf_chip_set_active(struct brcmf_chip *pub, u32 rstvec) +- { +- struct brcmf_chip_priv *chip; +- struct brcmf_core *arm; +-@@ -991,9 +991,9 @@ bool brcmf_chip_exit_download(struct brc +- chip = container_of(pub, struct brcmf_chip_priv, pub); +- arm = brcmf_chip_get_core(pub, BCMA_CORE_ARM_CR4); +- if (arm) +-- return brcmf_chip_cr4_exitdl(chip, rstvec); +-+ return brcmf_chip_cr4_set_active(chip, rstvec); +- +-- return brcmf_chip_cm3_exitdl(chip); +-+ return brcmf_chip_cm3_set_active(chip); +- } +- +- bool brcmf_chip_sr_capable(struct brcmf_chip *pub) +---- a/drivers/net/wireless/brcm80211/brcmfmac/chip.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.h +-@@ -64,7 +64,7 @@ struct brcmf_core { +- * @write32: write 32-bit value over bus. +- * @prepare: prepare bus for core configuration. +- * @setup: bus-specific core setup. +-- * @exit_dl: exit download state. +-+ * @active: chip becomes active. +- * The callback should use the provided @rstvec when non-zero. +- */ +- struct brcmf_buscore_ops { +-@@ -72,7 +72,7 @@ struct brcmf_buscore_ops { +- void (*write32)(void *ctx, u32 addr, u32 value); +- int (*prepare)(void *ctx); +- int (*setup)(void *ctx, struct brcmf_chip *chip); +-- void (*exit_dl)(void *ctx, struct brcmf_chip *chip, u32 rstvec); +-+ void (*activate)(void *ctx, struct brcmf_chip *chip, u32 rstvec); +- }; +- +- struct brcmf_chip *brcmf_chip_attach(void *ctx, +-@@ -84,8 +84,8 @@ bool brcmf_chip_iscoreup(struct brcmf_co +- void brcmf_chip_coredisable(struct brcmf_core *core, u32 prereset, u32 reset); +- void brcmf_chip_resetcore(struct brcmf_core *core, u32 prereset, u32 reset, +- u32 postreset); +--void brcmf_chip_enter_download(struct brcmf_chip *ci); +--bool brcmf_chip_exit_download(struct brcmf_chip *ci, u32 rstvec); +-+void brcmf_chip_set_passive(struct brcmf_chip *ci); +-+bool brcmf_chip_set_active(struct brcmf_chip *ci, u32 rstvec); +- bool brcmf_chip_sr_capable(struct brcmf_chip *pub); +- +- #endif /* BRCMF_AXIDMP_H */ +---- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-@@ -509,7 +509,7 @@ static void brcmf_pcie_attach(struct brc +- +- static int brcmf_pcie_enter_download_state(struct brcmf_pciedev_info *devinfo) +- { +-- brcmf_chip_enter_download(devinfo->ci); +-+ brcmf_chip_set_passive(devinfo->ci); +- +- if (devinfo->ci->chip == BRCM_CC_43602_CHIP_ID) { +- brcmf_pcie_select_core(devinfo, BCMA_CORE_ARM_CR4); +-@@ -536,7 +536,7 @@ static int brcmf_pcie_exit_download_stat +- brcmf_chip_resetcore(core, 0, 0, 0); +- } +- +-- return !brcmf_chip_exit_download(devinfo->ci, resetintr); +-+ return !brcmf_chip_set_active(devinfo->ci, resetintr); +- } +- +- +-@@ -1566,8 +1566,8 @@ static int brcmf_pcie_buscoreprep(void * +- } +- +- +--static void brcmf_pcie_buscore_exitdl(void *ctx, struct brcmf_chip *chip, +-- u32 rstvec) +-+static void brcmf_pcie_buscore_activate(void *ctx, struct brcmf_chip *chip, +-+ u32 rstvec) +- { +- struct brcmf_pciedev_info *devinfo = (struct brcmf_pciedev_info *)ctx; +- +-@@ -1577,7 +1577,7 @@ static void brcmf_pcie_buscore_exitdl(vo +- +- static const struct brcmf_buscore_ops brcmf_pcie_buscore_ops = { +- .prepare = brcmf_pcie_buscoreprep, +-- .exit_dl = brcmf_pcie_buscore_exitdl, +-+ .activate = brcmf_pcie_buscore_activate, +- .read32 = brcmf_pcie_buscore_read32, +- .write32 = brcmf_pcie_buscore_write32, +- }; +---- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-@@ -3357,7 +3357,7 @@ static int brcmf_sdio_download_firmware( +- brcmf_sdio_clkctl(bus, CLK_AVAIL, false); +- +- /* Keep arm in reset */ +-- brcmf_chip_enter_download(bus->ci); +-+ brcmf_chip_set_passive(bus->ci); +- +- rstvec = get_unaligned_le32(fw->data); +- brcmf_dbg(SDIO, "firmware rstvec: %x\n", rstvec); +-@@ -3378,7 +3378,7 @@ static int brcmf_sdio_download_firmware( +- } +- +- /* Take arm out of reset */ +-- if (!brcmf_chip_exit_download(bus->ci, rstvec)) { +-+ if (!brcmf_chip_set_active(bus->ci, rstvec)) { +- brcmf_err("error getting out of ARM core reset\n"); +- goto err; +- } +-@@ -3771,8 +3771,8 @@ static int brcmf_sdio_buscoreprep(void * +- return 0; +- } +- +--static void brcmf_sdio_buscore_exitdl(void *ctx, struct brcmf_chip *chip, +-- u32 rstvec) +-+static void brcmf_sdio_buscore_activate(void *ctx, struct brcmf_chip *chip, +-+ u32 rstvec) +- { +- struct brcmf_sdio_dev *sdiodev = ctx; +- struct brcmf_core *core; +-@@ -3815,7 +3815,7 @@ static void brcmf_sdio_buscore_write32(v +- +- static const struct brcmf_buscore_ops brcmf_sdio_buscore_ops = { +- .prepare = brcmf_sdio_buscoreprep, +-- .exit_dl = brcmf_sdio_buscore_exitdl, +-+ .activate = brcmf_sdio_buscore_activate, +- .read32 = brcmf_sdio_buscore_read32, +- .write32 = brcmf_sdio_buscore_write32, +- }; +-@@ -4239,12 +4239,11 @@ void brcmf_sdio_remove(struct brcmf_sdio +- sdio_claim_host(bus->sdiodev->func[1]); +- brcmf_sdio_clkctl(bus, CLK_AVAIL, false); +- /* Leave the device in state where it is +-- * 'quiet'. This is done by putting it in +-- * download_state which essentially resets +-- * all necessary cores. +-+ * 'passive'. This is done by resetting all +-+ * necessary cores. +- */ +- msleep(20); +-- brcmf_chip_enter_download(bus->ci); +-+ brcmf_chip_set_passive(bus->ci); +- 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 +deleted file mode 100644 +index 6b1dd81..0000000 +--- a/package/kernel/mac80211/patches/342-brcmfmac-assure-device-is-ready-for-download-after-b.patch ++++ /dev/null +@@ -1,61 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 11 Mar 2015 16:11:30 +0100 +-Subject: [PATCH] brcmfmac: assure device is ready for download after +- brcmf_chip_attach() +- +-Make the brcmf_chip_attach() function responsible for putting the +-device in a state where it is accessible for firmware download. +- +-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/chip.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c +-@@ -786,12 +786,6 @@ static int brcmf_chip_setup(struct brcmf +- if (chip->ops->setup) +- ret = chip->ops->setup(chip->ctx, pub); +- +-- /* +-- * Make sure any on-chip ARM is off (in case strapping is wrong), +-- * or downloaded code was already running. +-- */ +-- brcmf_chip_disable_arm(chip, BCMA_CORE_ARM_CM3); +-- brcmf_chip_disable_arm(chip, BCMA_CORE_ARM_CR4); +- return ret; +- } +- +-@@ -833,6 +827,8 @@ struct brcmf_chip *brcmf_chip_attach(voi +- if (err < 0) +- goto fail; +- +-+ /* assure chip is passive for download */ +-+ brcmf_chip_set_passive(&chip->pub); +- return &chip->pub; +- +- fail: +---- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-@@ -509,8 +509,6 @@ static void brcmf_pcie_attach(struct brc +- +- static int brcmf_pcie_enter_download_state(struct brcmf_pciedev_info *devinfo) +- { +-- brcmf_chip_set_passive(devinfo->ci); +-- +- if (devinfo->ci->chip == BRCM_CC_43602_CHIP_ID) { +- brcmf_pcie_select_core(devinfo, BCMA_CORE_ARM_CR4); +- brcmf_pcie_write_reg32(devinfo, BRCMF_PCIE_ARMCR4REG_BANKIDX, +---- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-@@ -3356,9 +3356,6 @@ static int brcmf_sdio_download_firmware( +- sdio_claim_host(bus->sdiodev->func[1]); +- brcmf_sdio_clkctl(bus, CLK_AVAIL, false); +- +-- /* Keep arm in reset */ +-- brcmf_chip_set_passive(bus->ci); +-- +- 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 +deleted file mode 100644 +index bcc2ed4..0000000 +--- a/package/kernel/mac80211/patches/343-brcmfmac-extract-ram-size-info-from-internal-memory-.patch ++++ /dev/null +@@ -1,367 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 11 Mar 2015 16:11:31 +0100 +-Subject: [PATCH] brcmfmac: extract ram size info from internal memory +- registers +- +-Instead of hard-coded memory sizes it is possible to obtain that +-information from the internal memory registers. +- +-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/chip.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c +-@@ -100,9 +100,6 @@ +- #define BCM4329_CORE_SOCRAM_BASE 0x18003000 +- /* ARM Cortex M3 core, ID 0x82a */ +- #define BCM4329_CORE_ARM_BASE 0x18002000 +--#define BCM4329_RAMSIZE 0x48000 +--/* bcm43143 */ +--#define BCM43143_RAMSIZE 0x70000 +- +- #define CORE_SB(base, field) \ +- (base + SBCONFIGOFF + offsetof(struct sbconfig, field)) +-@@ -150,6 +147,78 @@ struct sbconfig { +- u32 sbidhigh; /* identification */ +- }; +- +-+/* bankidx and bankinfo reg defines corerev >= 8 */ +-+#define SOCRAM_BANKINFO_RETNTRAM_MASK 0x00010000 +-+#define SOCRAM_BANKINFO_SZMASK 0x0000007f +-+#define SOCRAM_BANKIDX_ROM_MASK 0x00000100 +-+ +-+#define SOCRAM_BANKIDX_MEMTYPE_SHIFT 8 +-+/* socram bankinfo memtype */ +-+#define SOCRAM_MEMTYPE_RAM 0 +-+#define SOCRAM_MEMTYPE_R0M 1 +-+#define SOCRAM_MEMTYPE_DEVRAM 2 +-+ +-+#define SOCRAM_BANKINFO_SZBASE 8192 +-+#define SRCI_LSS_MASK 0x00f00000 +-+#define SRCI_LSS_SHIFT 20 +-+#define SRCI_SRNB_MASK 0xf0 +-+#define SRCI_SRNB_SHIFT 4 +-+#define SRCI_SRBSZ_MASK 0xf +-+#define SRCI_SRBSZ_SHIFT 0 +-+#define SR_BSZ_BASE 14 +-+ +-+struct sbsocramregs { +-+ u32 coreinfo; +-+ u32 bwalloc; +-+ u32 extracoreinfo; +-+ u32 biststat; +-+ u32 bankidx; +-+ u32 standbyctrl; +-+ +-+ u32 errlogstatus; /* rev 6 */ +-+ u32 errlogaddr; /* rev 6 */ +-+ /* used for patching rev 3 & 5 */ +-+ u32 cambankidx; +-+ u32 cambankstandbyctrl; +-+ u32 cambankpatchctrl; +-+ u32 cambankpatchtblbaseaddr; +-+ u32 cambankcmdreg; +-+ u32 cambankdatareg; +-+ u32 cambankmaskreg; +-+ u32 PAD[1]; +-+ u32 bankinfo; /* corev 8 */ +-+ u32 bankpda; +-+ u32 PAD[14]; +-+ u32 extmemconfig; +-+ u32 extmemparitycsr; +-+ u32 extmemparityerrdata; +-+ u32 extmemparityerrcnt; +-+ u32 extmemwrctrlandsize; +-+ u32 PAD[84]; +-+ u32 workaround; +-+ u32 pwrctl; /* corerev >= 2 */ +-+ u32 PAD[133]; +-+ u32 sr_control; /* corerev >= 15 */ +-+ u32 sr_status; /* corerev >= 15 */ +-+ u32 sr_address; /* corerev >= 15 */ +-+ u32 sr_data; /* corerev >= 15 */ +-+}; +-+ +-+#define SOCRAMREGOFFS(_f) offsetof(struct sbsocramregs, _f) +-+ +-+#define ARMCR4_CAP (0x04) +-+#define ARMCR4_BANKIDX (0x40) +-+#define ARMCR4_BANKINFO (0x44) +-+#define ARMCR4_BANKPDA (0x4C) +-+ +-+#define ARMCR4_TCBBNB_MASK 0xf0 +-+#define ARMCR4_TCBBNB_SHIFT 4 +-+#define ARMCR4_TCBANB_MASK 0xf +-+#define ARMCR4_TCBANB_SHIFT 0 +-+ +-+#define ARMCR4_BSZ_MASK 0x3f +-+#define ARMCR4_BSZ_MULT 8192 +-+ +- struct brcmf_core_priv { +- struct brcmf_core pub; +- u32 wrapbase; +-@@ -443,10 +512,6 @@ static int brcmf_chip_cores_check(struct +- break; +- case BCMA_CORE_ARM_CR4: +- cpu_found = true; +-- if (ci->pub.rambase == 0) { +-- brcmf_err("RAM base not provided with ARM CR4 core\n"); +-- return -ENOMEM; +-- } +- break; +- default: +- break; +-@@ -462,60 +527,160 @@ static int brcmf_chip_cores_check(struct +- brcmf_err("RAM core not provided with ARM CM3 core\n"); +- return -ENODEV; +- } +-- if (!ci->pub.ramsize) { +-- brcmf_err("RAM size is undetermined\n"); +-- return -ENOMEM; +-- } +- return 0; +- } +- +--static void brcmf_chip_get_raminfo(struct brcmf_chip_priv *ci) +-+static u32 brcmf_chip_core_read32(struct brcmf_core_priv *core, u16 reg) +- { +-- switch (ci->pub.chip) { +-- case BRCM_CC_4329_CHIP_ID: +-- ci->pub.ramsize = BCM4329_RAMSIZE; +-- break; +-- case BRCM_CC_43143_CHIP_ID: +-- ci->pub.ramsize = BCM43143_RAMSIZE; +-- break; +-- case BRCM_CC_43241_CHIP_ID: +-- ci->pub.ramsize = 0x90000; +-- break; +-- case BRCM_CC_4330_CHIP_ID: +-- ci->pub.ramsize = 0x48000; +-- break; +-+ return core->chip->ops->read32(core->chip->ctx, core->pub.base + reg); +-+} +-+ +-+static void brcmf_chip_core_write32(struct brcmf_core_priv *core, +-+ u16 reg, u32 val) +-+{ +-+ core->chip->ops->write32(core->chip->ctx, core->pub.base + reg, val); +-+} +-+ +-+static bool brcmf_chip_socram_banksize(struct brcmf_core_priv *core, u8 idx, +-+ u32 *banksize) +-+{ +-+ u32 bankinfo; +-+ u32 bankidx = (SOCRAM_MEMTYPE_RAM << SOCRAM_BANKIDX_MEMTYPE_SHIFT); +-+ +-+ bankidx |= idx; +-+ brcmf_chip_core_write32(core, SOCRAMREGOFFS(bankidx), bankidx); +-+ bankinfo = brcmf_chip_core_read32(core, SOCRAMREGOFFS(bankinfo)); +-+ *banksize = (bankinfo & SOCRAM_BANKINFO_SZMASK) + 1; +-+ *banksize *= SOCRAM_BANKINFO_SZBASE; +-+ return !!(bankinfo & SOCRAM_BANKINFO_RETNTRAM_MASK); +-+} +-+ +-+static void brcmf_chip_socram_ramsize(struct brcmf_core_priv *sr, u32 *ramsize, +-+ u32 *srsize) +-+{ +-+ u32 coreinfo; +-+ uint nb, banksize, lss; +-+ bool retent; +-+ int i; +-+ +-+ *ramsize = 0; +-+ *srsize = 0; +-+ +-+ if (WARN_ON(sr->pub.rev < 4)) +-+ return; +-+ +-+ if (!brcmf_chip_iscoreup(&sr->pub)) +-+ brcmf_chip_resetcore(&sr->pub, 0, 0, 0); +-+ +-+ /* Get info for determining size */ +-+ coreinfo = brcmf_chip_core_read32(sr, SOCRAMREGOFFS(coreinfo)); +-+ nb = (coreinfo & SRCI_SRNB_MASK) >> SRCI_SRNB_SHIFT; +-+ +-+ if ((sr->pub.rev <= 7) || (sr->pub.rev == 12)) { +-+ banksize = (coreinfo & SRCI_SRBSZ_MASK); +-+ lss = (coreinfo & SRCI_LSS_MASK) >> SRCI_LSS_SHIFT; +-+ if (lss != 0) +-+ nb--; +-+ *ramsize = nb * (1 << (banksize + SR_BSZ_BASE)); +-+ if (lss != 0) +-+ *ramsize += (1 << ((lss - 1) + SR_BSZ_BASE)); +-+ } else { +-+ nb = (coreinfo & SRCI_SRNB_MASK) >> SRCI_SRNB_SHIFT; +-+ for (i = 0; i < nb; i++) { +-+ retent = brcmf_chip_socram_banksize(sr, i, &banksize); +-+ *ramsize += banksize; +-+ if (retent) +-+ *srsize += banksize; +-+ } +-+ } +-+ +-+ /* hardcoded save&restore memory sizes */ +-+ switch (sr->chip->pub.chip) { +- case BRCM_CC_4334_CHIP_ID: +-- case BRCM_CC_43340_CHIP_ID: +-- ci->pub.ramsize = 0x80000; +-+ if (sr->chip->pub.chiprev < 2) +-+ *srsize = (32 * 1024); +- break; +-- case BRCM_CC_4335_CHIP_ID: +-- ci->pub.ramsize = 0xc0000; +-- ci->pub.rambase = 0x180000; +-- break; +-- case BRCM_CC_43362_CHIP_ID: +-- ci->pub.ramsize = 0x3c000; +-+ default: +- break; +-+ } +-+} +-+ +-+/** Return the TCM-RAM size of the ARMCR4 core. */ +-+static u32 brcmf_chip_tcm_ramsize(struct brcmf_core_priv *cr4) +-+{ +-+ u32 corecap; +-+ u32 memsize = 0; +-+ u32 nab; +-+ u32 nbb; +-+ u32 totb; +-+ u32 bxinfo; +-+ u32 idx; +-+ +-+ corecap = brcmf_chip_core_read32(cr4, ARMCR4_CAP); +-+ +-+ nab = (corecap & ARMCR4_TCBANB_MASK) >> ARMCR4_TCBANB_SHIFT; +-+ nbb = (corecap & ARMCR4_TCBBNB_MASK) >> ARMCR4_TCBBNB_SHIFT; +-+ totb = nab + nbb; +-+ +-+ for (idx = 0; idx < totb; idx++) { +-+ brcmf_chip_core_write32(cr4, ARMCR4_BANKIDX, idx); +-+ bxinfo = brcmf_chip_core_read32(cr4, ARMCR4_BANKINFO); +-+ memsize += ((bxinfo & ARMCR4_BSZ_MASK) + 1) * ARMCR4_BSZ_MULT; +-+ } +-+ +-+ return memsize; +-+} +-+ +-+static u32 brcmf_chip_tcm_rambase(struct brcmf_chip_priv *ci) +-+{ +-+ switch (ci->pub.chip) { +- case BRCM_CC_4345_CHIP_ID: +-- ci->pub.ramsize = 0xc8000; +-- ci->pub.rambase = 0x198000; +-- break; +-+ return 0x198000; +-+ case BRCM_CC_4335_CHIP_ID: +- case BRCM_CC_4339_CHIP_ID: +- case BRCM_CC_4354_CHIP_ID: +- case BRCM_CC_4356_CHIP_ID: +- case BRCM_CC_43567_CHIP_ID: +- case BRCM_CC_43569_CHIP_ID: +- case BRCM_CC_43570_CHIP_ID: +-- ci->pub.ramsize = 0xc0000; +-- ci->pub.rambase = 0x180000; +-- break; +- case BRCM_CC_43602_CHIP_ID: +-- ci->pub.ramsize = 0xf0000; +-- ci->pub.rambase = 0x180000; +-- break; +-+ return 0x180000; +- default: +- brcmf_err("unknown chip: %s\n", ci->pub.name); +- break; +- } +-+ return 0; +-+} +-+ +-+static int brcmf_chip_get_raminfo(struct brcmf_chip_priv *ci) +-+{ +-+ struct brcmf_core_priv *mem_core; +-+ struct brcmf_core *mem; +-+ +-+ mem = brcmf_chip_get_core(&ci->pub, BCMA_CORE_ARM_CR4); +-+ if (mem) { +-+ mem_core = container_of(mem, struct brcmf_core_priv, pub); +-+ ci->pub.ramsize = brcmf_chip_tcm_ramsize(mem_core); +-+ ci->pub.rambase = brcmf_chip_tcm_rambase(ci); +-+ if (!ci->pub.rambase) { +-+ brcmf_err("RAM base not provided with ARM CR4 core\n"); +-+ 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); +-+ } +-+ 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, +-+ ci->pub.srsize, ci->pub.srsize); +-+ +-+ if (!ci->pub.ramsize) { +-+ brcmf_err("RAM size is undetermined\n"); +-+ return -ENOMEM; +-+ } +-+ return 0; +- } +- +- static u32 brcmf_chip_dmp_get_desc(struct brcmf_chip_priv *ci, u32 *eromaddr, +-@@ -668,6 +833,7 @@ static int brcmf_chip_recognition(struct +- struct brcmf_core *core; +- u32 regdata; +- u32 socitype; +-+ int ret; +- +- /* Get CC core rev +- * Chipid is assume to be at offset 0 from SI_ENUM_BASE +-@@ -720,9 +886,13 @@ static int brcmf_chip_recognition(struct +- return -ENODEV; +- } +- +-- brcmf_chip_get_raminfo(ci); +-- +-- return brcmf_chip_cores_check(ci); +-+ ret = brcmf_chip_cores_check(ci); +-+ if (ret) +-+ return ret; +-+ +-+ /* assure chip is passive for core access */ +-+ brcmf_chip_set_passive(&ci->pub); +-+ return brcmf_chip_get_raminfo(ci); +- } +- +- static void brcmf_chip_disable_arm(struct brcmf_chip_priv *chip, u16 id) +-@@ -827,8 +997,6 @@ struct brcmf_chip *brcmf_chip_attach(voi +- if (err < 0) +- goto fail; +- +-- /* assure chip is passive for download */ +-- brcmf_chip_set_passive(&chip->pub); +- return &chip->pub; +- +- fail: +---- a/drivers/net/wireless/brcm80211/brcmfmac/chip.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.h +-@@ -30,7 +30,8 @@ +- * @pmucaps: PMU capabilities. +- * @pmurev: PMU revision. +- * @rambase: RAM base address (only applicable for ARM CR4 chips). +-- * @ramsize: amount of RAM on chip. +-+ * @ramsize: amount of RAM on chip including retention. +-+ * @srsize: amount of retention RAM on chip. +- * @name: string representation of the chip identifier. +- */ +- struct brcmf_chip { +-@@ -41,6 +42,7 @@ struct brcmf_chip { +- u32 pmurev; +- u32 rambase; +- u32 ramsize; +-+ u32 srsize; +- 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 +deleted file mode 100644 +index 69618a7..0000000 +--- a/package/kernel/mac80211/patches/344-brcmfmac-take-save-restore-memory-into-account-for-S.patch ++++ /dev/null +@@ -1,96 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 11 Mar 2015 16:11:32 +0100 +-Subject: [PATCH] brcmfmac: take save&restore memory into account for SDIO +- shared info +- +-The firmware provides pointer to SDIO shared information at end of +-RAM during firmware initialization. End of RAM is obviously determined +-by the actual ram size, but part of that may be used for save&restore +-memory. In that case another location in RAM will hold the pointer. +- +-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/sdio.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-@@ -1067,44 +1067,47 @@ static inline bool brcmf_sdio_valid_shar +- static int brcmf_sdio_readshared(struct brcmf_sdio *bus, +- struct sdpcm_shared *sh) +- { +-- u32 addr; +-+ u32 addr = 0; +- int rv; +- u32 shaddr = 0; +- struct sdpcm_shared_le sh_le; +- __le32 addr_le; +- +-- shaddr = bus->ci->rambase + bus->ci->ramsize - 4; +-+ sdio_claim_host(bus->sdiodev->func[1]); +-+ brcmf_sdio_bus_sleep(bus, false, false); +- +- /* +- * Read last word in socram to determine +- * address of sdpcm_shared structure +- */ +-- sdio_claim_host(bus->sdiodev->func[1]); +-- brcmf_sdio_bus_sleep(bus, false, false); +-- rv = brcmf_sdiod_ramrw(bus->sdiodev, false, shaddr, (u8 *)&addr_le, 4); +-- sdio_release_host(bus->sdiodev->func[1]); +-+ shaddr = bus->ci->rambase + bus->ci->ramsize - 4; +-+ if (!bus->ci->rambase && brcmf_chip_sr_capable(bus->ci)) +-+ shaddr -= bus->ci->srsize; +-+ rv = brcmf_sdiod_ramrw(bus->sdiodev, false, shaddr, +-+ (u8 *)&addr_le, 4); +- if (rv < 0) +-- return rv; +-- +-- addr = le32_to_cpu(addr_le); +-- +-- brcmf_dbg(SDIO, "sdpcm_shared address 0x%08X\n", addr); +-+ goto fail; +- +- /* +- * Check if addr is valid. +- * NVRAM length at the end of memory should have been overwritten. +- */ +-+ addr = le32_to_cpu(addr_le); +- if (!brcmf_sdio_valid_shared_address(addr)) { +-- brcmf_err("invalid sdpcm_shared address 0x%08X\n", +-- addr); +-- return -EINVAL; +-+ brcmf_err("invalid sdpcm_shared address 0x%08X\n", addr); +-+ rv = -EINVAL; +-+ goto fail; +- } +- +-+ brcmf_dbg(INFO, "sdpcm_shared address 0x%08X\n", addr); +-+ +- /* Read hndrte_shared structure */ +- rv = brcmf_sdiod_ramrw(bus->sdiodev, false, addr, (u8 *)&sh_le, +- sizeof(struct sdpcm_shared_le)); +- if (rv < 0) +-- return rv; +-+ goto fail; +-+ +-+ sdio_release_host(bus->sdiodev->func[1]); +- +- /* Endianness */ +- sh->flags = le32_to_cpu(sh_le.flags); +-@@ -1121,8 +1124,13 @@ static int brcmf_sdio_readshared(struct +- sh->flags & SDPCM_SHARED_VERSION_MASK); +- return -EPROTO; +- } +-- +- return 0; +-+ +-+fail: +-+ brcmf_err("unable to obtain sdpcm_shared info: rv=%d (addr=0x%x)\n", +-+ rv, addr); +-+ sdio_release_host(bus->sdiodev->func[1]); +-+ return rv; +- } +- +- 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 +deleted file mode 100644 +index 1b10dbb..0000000 +--- a/package/kernel/mac80211/patches/345-brcmfmac-fix-watchdog-timer-regression.patch ++++ /dev/null +@@ -1,59 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 11 Mar 2015 16:11:33 +0100 +-Subject: [PATCH] brcmfmac: fix watchdog timer regression +- +-The watchdog timer is used to put the device in a low-power mode when +-it is idle for some time. This timer is stopped during that mode and +-should be restarted upon activity. This has been broken by commit +-d4150fced0365 ("brcmfmac: Simplify watchdog sleep."). This patch +-restores the behaviour as it was before that commit. +- +-Reported-by: Pontus Fuchs +-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/sdio.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-@@ -972,7 +972,6 @@ static int brcmf_sdio_clkctl(struct brcm +- brcmf_sdio_sdclk(bus, true); +- /* Now request HT Avail on the backplane */ +- brcmf_sdio_htclk(bus, true, pendok); +-- brcmf_sdio_wd_timer(bus, BRCMF_WD_POLL_MS); +- break; +- +- case CLK_SDONLY: +-@@ -984,7 +983,6 @@ static int brcmf_sdio_clkctl(struct brcm +- else +- brcmf_err("request for %d -> %d\n", +- bus->clkstate, target); +-- brcmf_sdio_wd_timer(bus, BRCMF_WD_POLL_MS); +- break; +- +- case CLK_NONE: +-@@ -993,7 +991,6 @@ static int brcmf_sdio_clkctl(struct brcm +- brcmf_sdio_htclk(bus, false, false); +- /* Now remove the SD clock */ +- brcmf_sdio_sdclk(bus, false); +-- brcmf_sdio_wd_timer(bus, 0); +- break; +- } +- #ifdef DEBUG +-@@ -1048,6 +1045,7 @@ end: +- brcmf_sdio_clkctl(bus, CLK_NONE, pendok); +- } else { +- brcmf_sdio_clkctl(bus, CLK_AVAIL, pendok); +-+ brcmf_sdio_wd_timer(bus, BRCMF_WD_POLL_MS); +- } +- bus->sleeping = sleep; +- brcmf_dbg(SDIO, "new state %s\n", +-@@ -4242,6 +4240,7 @@ void brcmf_sdio_remove(struct brcmf_sdio +- if (bus->ci) { +- if (bus->sdiodev->state != BRCMF_SDIOD_NOMEDIUM) { +- sdio_claim_host(bus->sdiodev->func[1]); +-+ brcmf_sdio_wd_timer(bus, 0); +- 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 +deleted file mode 100644 +index af76f13..0000000 +--- a/package/kernel/mac80211/patches/346-brcmfmac-avoid-runtime-pm-for-sdio-host-controller.patch ++++ /dev/null +@@ -1,44 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 18 Mar 2015 13:25:21 +0100 +-Subject: [PATCH] brcmfmac: avoid runtime-pm for sdio host controller +- +-Several host controllers supporting runtime-pm are causing issues +-with our sdio wireless cards because they disable the sdio interrupt +-upon going into runtime suspend. This patch avoids that by doing +-a pm_runtime_forbid() call during the probe. Tested with Sony Vaio +-Duo 13 which uses sdhci-acpi host controller. +- +-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/bcmsdh.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +-@@ -29,6 +29,7 @@ +- #include +- #include +- #include +-+#include +- #include +- #include +- #include +-@@ -1006,6 +1007,7 @@ static int brcmf_sdiod_remove(struct brc +- sg_free_table(&sdiodev->sgtable); +- sdiodev->sbwad = 0; +- +-+ pm_runtime_allow(sdiodev->func[1]->card->host->parent); +- return 0; +- } +- +-@@ -1074,7 +1076,7 @@ static int brcmf_sdiod_probe(struct brcm +- ret = -ENODEV; +- goto out; +- } +-- +-+ pm_runtime_forbid(host->parent); +- 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 +deleted file mode 100644 +index c419cc6..0000000 +--- a/package/kernel/mac80211/patches/347-brcmfmac-Add-necessary-memory-barriers-for-SDIO.patch ++++ /dev/null +@@ -1,171 +0,0 @@ +-From: Hante Meuleman +-Date: Wed, 18 Mar 2015 13:25:22 +0100 +-Subject: [PATCH] brcmfmac: Add necessary memory barriers for SDIO. +- +-SDIO uses a thread to handle all communication with the device, +-for this data is exchanged between threads. This data needs proper +-memory barriers to make sure that data "exchange" is going correct. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Daniel (Deognyoun) Kim +-Signed-off-by: Hante Meuleman +-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 +-@@ -507,8 +507,8 @@ struct brcmf_sdio { +- +- struct workqueue_struct *brcmf_wq; +- struct work_struct datawork; +-- atomic_t dpc_tskcnt; +-- atomic_t dpc_running; +-+ bool dpc_triggered; +-+ bool dpc_running; +- +- bool txoff; /* Transmit flow-controlled */ +- struct brcmf_sdio_count sdcnt; +-@@ -2713,6 +2713,7 @@ static void brcmf_sdio_dpc(struct brcmf_ +- err = brcmf_sdio_tx_ctrlframe(bus, bus->ctrl_frame_buf, +- bus->ctrl_frame_len); +- bus->ctrl_frame_err = err; +-+ wmb(); +- bus->ctrl_frame_stat = false; +- } +- sdio_release_host(bus->sdiodev->func[1]); +-@@ -2734,6 +2735,7 @@ static void brcmf_sdio_dpc(struct brcmf_ +- sdio_claim_host(bus->sdiodev->func[1]); +- if (bus->ctrl_frame_stat) { +- bus->ctrl_frame_err = -ENODEV; +-+ wmb(); +- bus->ctrl_frame_stat = false; +- brcmf_sdio_wait_event_wakeup(bus); +- } +-@@ -2744,7 +2746,7 @@ static void brcmf_sdio_dpc(struct brcmf_ +- (!atomic_read(&bus->fcstate) && +- brcmu_pktq_mlen(&bus->txq, ~bus->flowcontrol) && +- data_ok(bus))) { +-- atomic_inc(&bus->dpc_tskcnt); +-+ bus->dpc_triggered = true; +- } +- } +- +-@@ -2940,6 +2942,7 @@ brcmf_sdio_bus_txctl(struct device *dev, +- /* Send from dpc */ +- bus->ctrl_frame_buf = msg; +- bus->ctrl_frame_len = msglen; +-+ wmb(); +- bus->ctrl_frame_stat = true; +- +- brcmf_sdio_trigger_dpc(bus); +-@@ -2958,6 +2961,7 @@ brcmf_sdio_bus_txctl(struct device *dev, +- if (!ret) { +- brcmf_dbg(SDIO, "ctrl_frame complete, err=%d\n", +- bus->ctrl_frame_err); +-+ rmb(); +- ret = bus->ctrl_frame_err; +- } +- +-@@ -3526,8 +3530,8 @@ done: +- +- void brcmf_sdio_trigger_dpc(struct brcmf_sdio *bus) +- { +-- if (atomic_read(&bus->dpc_tskcnt) == 0) { +-- atomic_inc(&bus->dpc_tskcnt); +-+ if (!bus->dpc_triggered) { +-+ bus->dpc_triggered = true; +- queue_work(bus->brcmf_wq, &bus->datawork); +- } +- } +-@@ -3558,7 +3562,7 @@ void brcmf_sdio_isr(struct brcmf_sdio *b +- if (!bus->intr) +- brcmf_err("isr w/o interrupt configured!\n"); +- +-- atomic_inc(&bus->dpc_tskcnt); +-+ bus->dpc_triggered = true; +- queue_work(bus->brcmf_wq, &bus->datawork); +- } +- +-@@ -3578,7 +3582,7 @@ static void brcmf_sdio_bus_watchdog(stru +- if (!bus->intr || +- (bus->sdcnt.intrcount == bus->sdcnt.lastintrs)) { +- +-- if (atomic_read(&bus->dpc_tskcnt) == 0) { +-+ if (!bus->dpc_triggered) { +- u8 devpend; +- +- sdio_claim_host(bus->sdiodev->func[1]); +-@@ -3596,7 +3600,7 @@ static void brcmf_sdio_bus_watchdog(stru +- bus->sdcnt.pollcnt++; +- atomic_set(&bus->ipend, 1); +- +-- atomic_inc(&bus->dpc_tskcnt); +-+ bus->dpc_triggered = true; +- queue_work(bus->brcmf_wq, &bus->datawork); +- } +- } +-@@ -3623,17 +3627,21 @@ static void brcmf_sdio_bus_watchdog(stru +- #endif /* DEBUG */ +- +- /* On idle timeout clear activity flag and/or turn off clock */ +-- if ((atomic_read(&bus->dpc_tskcnt) == 0) && +-- (atomic_read(&bus->dpc_running) == 0) && +-- (bus->idletime > 0) && (bus->clkstate == CLK_AVAIL)) { +-- bus->idlecount++; +-- if (bus->idlecount > bus->idletime) { +-- brcmf_dbg(SDIO, "idle\n"); +-- sdio_claim_host(bus->sdiodev->func[1]); +-- brcmf_sdio_wd_timer(bus, 0); +-+ if (!bus->dpc_triggered) { +-+ rmb(); +-+ if ((!bus->dpc_running) && (bus->idletime > 0) && +-+ (bus->clkstate == CLK_AVAIL)) { +-+ bus->idlecount++; +-+ if (bus->idlecount > bus->idletime) { +-+ brcmf_dbg(SDIO, "idle\n"); +-+ sdio_claim_host(bus->sdiodev->func[1]); +-+ brcmf_sdio_wd_timer(bus, 0); +-+ bus->idlecount = 0; +-+ brcmf_sdio_bus_sleep(bus, true, false); +-+ sdio_release_host(bus->sdiodev->func[1]); +-+ } +-+ } else { +- bus->idlecount = 0; +-- brcmf_sdio_bus_sleep(bus, true, false); +-- sdio_release_host(bus->sdiodev->func[1]); +- } +- } else { +- bus->idlecount = 0; +-@@ -3645,13 +3653,14 @@ static void brcmf_sdio_dataworker(struct +- struct brcmf_sdio *bus = container_of(work, struct brcmf_sdio, +- datawork); +- +-- while (atomic_read(&bus->dpc_tskcnt)) { +-- atomic_set(&bus->dpc_running, 1); +-- atomic_set(&bus->dpc_tskcnt, 0); +-+ bus->dpc_running = true; +-+ wmb(); +-+ while (ACCESS_ONCE(bus->dpc_triggered)) { +-+ bus->dpc_triggered = false; +- brcmf_sdio_dpc(bus); +- bus->idlecount = 0; +-- atomic_set(&bus->dpc_running, 0); +- } +-+ bus->dpc_running = false; +- if (brcmf_sdiod_freezing(bus->sdiodev)) { +- brcmf_sdiod_change_state(bus->sdiodev, BRCMF_SDIOD_DOWN); +- brcmf_sdiod_try_freeze(bus->sdiodev); +-@@ -4144,8 +4153,8 @@ struct brcmf_sdio *brcmf_sdio_probe(stru +- bus->watchdog_tsk = NULL; +- } +- /* Initialize DPC thread */ +-- atomic_set(&bus->dpc_tskcnt, 0); +-- atomic_set(&bus->dpc_running, 0); +-+ bus->dpc_triggered = false; +-+ bus->dpc_running = false; +- +- /* 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 +deleted file mode 100644 +index 1bc98a0..0000000 +--- a/package/kernel/mac80211/patches/348-brcmfmac-Remove-unnecessary-new-line-in-pcie-console.patch ++++ /dev/null +@@ -1,26 +0,0 @@ +-From: Hante Meuleman +-Date: Wed, 18 Mar 2015 13:25:24 +0100 +-Subject: [PATCH] brcmfmac: Remove unnecessary new-line in pcie console +- logging. +- +-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/pcie.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-@@ -651,10 +651,9 @@ static void brcmf_pcie_bus_console_read( +- console->log_str[console->log_idx] = ch; +- console->log_idx++; +- } +-- +- if (ch == '\n') { +- console->log_str[console->log_idx] = 0; +-- brcmf_dbg(PCIE, "CONSOLE: %s\n", console->log_str); +-+ brcmf_dbg(PCIE, "CONSOLE: %s", console->log_str); +- 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 +deleted file mode 100644 +index fcf0bf3..0000000 +--- a/package/kernel/mac80211/patches/349-brcmfmac-add-MODULE_FIRMWARE-macros-for-bcm4356-PCIe.patch ++++ /dev/null +@@ -1,26 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 18 Mar 2015 13:25:25 +0100 +-Subject: [PATCH] brcmfmac: add MODULE_FIRMWARE() macros for bcm4356 PCIe +- device +- +-The BCM4356 PCIe wireless device was added recently but overlooked +-the fact that the MODULE_FIRMWARE() macros were missing for the +-firmwares needed by this device. +- +-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/pcie.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-@@ -189,6 +189,8 @@ MODULE_FIRMWARE(BRCMF_PCIE_43602_FW_NAME +- MODULE_FIRMWARE(BRCMF_PCIE_43602_NVRAM_NAME); +- MODULE_FIRMWARE(BRCMF_PCIE_4354_FW_NAME); +- MODULE_FIRMWARE(BRCMF_PCIE_4354_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); +- +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 +deleted file mode 100644 +index b3e9bc9..0000000 +--- a/package/kernel/mac80211/patches/350-brcmfmac-add-support-for-BCM43430-SDIO-chipset.patch ++++ /dev/null +@@ -1,138 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 18 Mar 2015 13:25:26 +0100 +-Subject: [PATCH] brcmfmac: add support for BCM43430 SDIO chipset +- +-This patch added support for the BCM43430 802.11n SDIO chipset. +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Daniel (Deognyoun) Kim +-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/bcmsdh.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +-@@ -1098,6 +1098,7 @@ static const struct sdio_device_id brcmf +- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43341), +- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43362), +- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4335_4339), +-+ BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43430), +- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4345), +- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4354), +- { /* end: all zeroes */ } +---- a/drivers/net/wireless/brcm80211/brcmfmac/chip.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c +-@@ -600,6 +600,12 @@ static void brcmf_chip_socram_ramsize(st +- if (sr->chip->pub.chiprev < 2) +- *srsize = (32 * 1024); +- break; +-+ case BRCM_CC_43430_CHIP_ID: +-+ /* assume sr for now as we can not check +-+ * firmware sr capability at this point. +-+ */ +-+ *srsize = (64 * 1024); +-+ break; +- default: +- break; +- } +-@@ -1072,6 +1078,7 @@ static void +- brcmf_chip_cm3_set_passive(struct brcmf_chip_priv *chip) +- { +- struct brcmf_core *core; +-+ struct brcmf_core_priv *sr; +- +- brcmf_chip_disable_arm(chip, BCMA_CORE_ARM_CM3); +- core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_80211); +-@@ -1081,6 +1088,13 @@ brcmf_chip_cm3_set_passive(struct brcmf_ +- D11_BCMA_IOCTL_PHYCLOCKEN); +- core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_INTERNAL_MEM); +- brcmf_chip_resetcore(core, 0, 0, 0); +-+ +-+ /* disable bank #3 remap for this device */ +-+ if (chip->pub.chip == BRCM_CC_43430_CHIP_ID) { +-+ sr = container_of(core, struct brcmf_core_priv, pub); +-+ brcmf_chip_core_write32(sr, SOCRAMREGOFFS(bankidx), 3); +-+ brcmf_chip_core_write32(sr, SOCRAMREGOFFS(bankpda), 0); +-+ } +- } +- +- static bool brcmf_chip_cm3_set_active(struct brcmf_chip_priv *chip) +-@@ -1188,6 +1202,10 @@ bool brcmf_chip_sr_capable(struct brcmf_ +- addr = CORE_CC_REG(base, chipcontrol_data); +- reg = chip->ops->read32(chip->ctx, addr); +- return (reg & pmu_cc3_mask) != 0; +-+ case BRCM_CC_43430_CHIP_ID: +-+ addr = CORE_CC_REG(base, sr_control1); +-+ reg = chip->ops->read32(chip->ctx, addr); +-+ return reg != 0; +- default: +- addr = CORE_CC_REG(base, pmucapabilities_ext); +- reg = chip->ops->read32(chip->ctx, addr); +---- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-@@ -615,6 +615,8 @@ static const struct sdiod_drive_str sdio +- #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 BCM4345_FIRMWARE_NAME "brcm/brcmfmac4345-sdio.bin" +- #define BCM4345_NVRAM_NAME "brcm/brcmfmac4345-sdio.txt" +- #define BCM4354_FIRMWARE_NAME "brcm/brcmfmac4354-sdio.bin" +-@@ -640,6 +642,8 @@ 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(BCM4345_FIRMWARE_NAME); +- MODULE_FIRMWARE(BCM4345_NVRAM_NAME); +- MODULE_FIRMWARE(BCM4354_FIRMWARE_NAME); +-@@ -671,6 +675,7 @@ static const struct brcmf_firmware_names +- { 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, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4345) }, +- { BRCM_CC_4354_CHIP_ID, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4354) } +- }; +---- a/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h +-+++ b/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h +-@@ -37,6 +37,7 @@ +- #define BRCM_CC_43362_CHIP_ID 43362 +- #define BRCM_CC_4335_CHIP_ID 0x4335 +- #define BRCM_CC_4339_CHIP_ID 0x4339 +-+#define BRCM_CC_43430_CHIP_ID 43430 +- #define BRCM_CC_4345_CHIP_ID 0x4345 +- #define BRCM_CC_4354_CHIP_ID 0x4354 +- #define BRCM_CC_4356_CHIP_ID 0x4356 +---- a/drivers/net/wireless/brcm80211/include/chipcommon.h +-+++ b/drivers/net/wireless/brcm80211/include/chipcommon.h +-@@ -183,7 +183,14 @@ struct chipcregs { +- u8 uart1lsr; +- u8 uart1msr; +- u8 uart1scratch; +-- u32 PAD[126]; +-+ u32 PAD[62]; +-+ +-+ /* save/restore, corerev >= 48 */ +-+ u32 sr_capability; /* 0x500 */ +-+ u32 sr_control0; /* 0x504 */ +-+ u32 sr_control1; /* 0x508 */ +-+ u32 gpio_control; /* 0x50C */ +-+ u32 PAD[60]; +- +- /* PMU registers (corerev >= 20) */ +- u32 pmucontrol; /* 0x600 */ +---- a/include/linux/mmc/sdio_ids.h +-+++ b/include/linux/mmc/sdio_ids.h +-@@ -33,6 +33,7 @@ +- #define SDIO_DEVICE_ID_BROADCOM_43341 0xa94d +- #define SDIO_DEVICE_ID_BROADCOM_4335_4339 0x4335 +- #define SDIO_DEVICE_ID_BROADCOM_43362 0xa962 +-+#define SDIO_DEVICE_ID_BROADCOM_43430 0xa9a6 +- #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 +deleted file mode 100644 +index c3d7bc2..0000000 +--- a/package/kernel/mac80211/patches/351-brcmfmac-only-support-the-BCM43455-7-device.patch ++++ /dev/null +@@ -1,50 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 18 Mar 2015 13:25:27 +0100 +-Subject: [PATCH] brcmfmac: only support the BCM43455/7 device +- +-Recently support was added for the BCM4345 SDIO chipset by +-commit 9c51026509d7 ("brcmfmac: Add support for BCM4345 SDIO chipset") +-however this was verified using a BCM43455 device, which is +-a more recent revision of the chip. This patch assure that +-older revisions are not probed as they would fail. +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Syed Asifful Dayyan +-Reviewed-by: Pieter-Paul Giesberts +-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 +-@@ -617,8 +617,8 @@ static const struct sdiod_drive_str sdio +- #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 BCM4345_FIRMWARE_NAME "brcm/brcmfmac4345-sdio.bin" +--#define BCM4345_NVRAM_NAME "brcm/brcmfmac4345-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" +- +-@@ -644,8 +644,8 @@ MODULE_FIRMWARE(BCM4339_FIRMWARE_NAME); +- MODULE_FIRMWARE(BCM4339_NVRAM_NAME); +- MODULE_FIRMWARE(BCM43430_FIRMWARE_NAME); +- MODULE_FIRMWARE(BCM43430_NVRAM_NAME); +--MODULE_FIRMWARE(BCM4345_FIRMWARE_NAME); +--MODULE_FIRMWARE(BCM4345_NVRAM_NAME); +-+MODULE_FIRMWARE(BCM43455_FIRMWARE_NAME); +-+MODULE_FIRMWARE(BCM43455_NVRAM_NAME); +- MODULE_FIRMWARE(BCM4354_FIRMWARE_NAME); +- MODULE_FIRMWARE(BCM4354_NVRAM_NAME); +- +-@@ -676,7 +676,7 @@ static const struct brcmf_firmware_names +- { 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, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4345) }, +-+ { BRCM_CC_4345_CHIP_ID, 0xFFFFFFC0, BRCMF_FIRMWARE_NVRAM(BCM43455) }, +- { 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 +deleted file mode 100644 +index a62cfdf..0000000 +--- a/package/kernel/mac80211/patches/352-brcmfmac-remove-support-for-unreleased-BCM4354-PCIe.patch ++++ /dev/null +@@ -1,52 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 18 Mar 2015 13:25:28 +0100 +-Subject: [PATCH] brcmfmac: remove support for unreleased BCM4354 PCIe +- +-There are no known BCM4354 PCIe devices released so removing +-support from the driver until proven otherwise. +- +-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/pcie.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-@@ -47,8 +47,6 @@ 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_4354_FW_NAME "brcm/brcmfmac4354-pcie.bin" +--#define BRCMF_PCIE_4354_NVRAM_NAME "brcm/brcmfmac4354-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" +-@@ -187,8 +185,6 @@ enum brcmf_pcie_state { +- +- MODULE_FIRMWARE(BRCMF_PCIE_43602_FW_NAME); +- MODULE_FIRMWARE(BRCMF_PCIE_43602_NVRAM_NAME); +--MODULE_FIRMWARE(BRCMF_PCIE_4354_FW_NAME); +--MODULE_FIRMWARE(BRCMF_PCIE_4354_NVRAM_NAME); +- MODULE_FIRMWARE(BRCMF_PCIE_4356_FW_NAME); +- MODULE_FIRMWARE(BRCMF_PCIE_4356_NVRAM_NAME); +- MODULE_FIRMWARE(BRCMF_PCIE_43570_FW_NAME); +-@@ -1327,10 +1323,6 @@ 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_4354_CHIP_ID: +-- fw_name = BRCMF_PCIE_4354_FW_NAME; +-- nvram_name = BRCMF_PCIE_4354_NVRAM_NAME; +-- break; +- case BRCM_CC_4356_CHIP_ID: +- fw_name = BRCMF_PCIE_4356_FW_NAME; +- nvram_name = BRCMF_PCIE_4356_NVRAM_NAME; +-@@ -1855,7 +1847,6 @@ 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_4354_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), +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 +deleted file mode 100644 +index 366ff85..0000000 +--- a/package/kernel/mac80211/patches/353-brcmfmac-disable-MBSS-feature-for-BCM43362.patch ++++ /dev/null +@@ -1,28 +0,0 @@ +-From: Arend van Spriel +-Date: Fri, 20 Mar 2015 22:18:17 +0100 +-Subject: [PATCH] brcmfmac: disable MBSS feature for BCM43362 +- +-The BCM43362 firmware falsely reports it is capable of providing +-MBSS. As a result AP mode no longer works for this device. Therefor +-disable MBSS in the driver for this chipset. +- +-Cc: stable@vger.kernel.org # 3.19.y +-Reported-by: Jorg Krause +-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/feature.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/feature.c +-@@ -126,7 +126,8 @@ void brcmf_feat_attach(struct brcmf_pub +- brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_MCHAN, "mchan"); +- if (drvr->bus_if->wowl_supported) +- brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_WOWL, "wowl"); +-- brcmf_feat_iovar_int_set(ifp, BRCMF_FEAT_MBSS, "mbss", 0); +-+ if (drvr->bus_if->chip != BRCM_CC_43362_CHIP_ID) +-+ brcmf_feat_iovar_int_set(ifp, BRCMF_FEAT_MBSS, "mbss", 0); +- +- /* 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 +deleted file mode 100644 +index 6e461f6..0000000 +--- a/package/kernel/mac80211/patches/354-brcmfmac-use-static-superset-of-channels-for-wiphy-b.patch ++++ /dev/null +@@ -1,300 +0,0 @@ +-From: Arend van Spriel +-Date: Tue, 14 Apr 2015 20:10:24 +0200 +-Subject: [PATCH] brcmfmac: use static superset of channels for wiphy +- bands +- +-The driver was constructing a list of channels per wiphy band +-by querying the device. This list is not what the hardware is +-able to do as it is already filtered by the country setting in +-the device. As user-space may change the country this would +-require updating the channel list which is not recommended [1]. +-This patch introduces a superset of channels. The individual +-channels are disabled appropriately by querying the device. +- +-[1] http://mid.gmane.org/1426706320.3001.21.camel@sipsolutions.net +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Daniel (Deognyoun) Kim +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Arend van Spriel +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-@@ -129,13 +129,47 @@ static struct ieee80211_rate __wl_rates[ +- RATETAB_ENT(BRCM_RATE_54M, 0), +- }; +- +--#define wl_a_rates (__wl_rates + 4) +--#define wl_a_rates_size 8 +- #define wl_g_rates (__wl_rates + 0) +--#define wl_g_rates_size 12 +-+#define wl_g_rates_size ARRAY_SIZE(__wl_rates) +-+#define wl_a_rates (__wl_rates + 4) +-+#define wl_a_rates_size (wl_g_rates_size - 4) +-+ +-+#define CHAN2G(_channel, _freq) { \ +-+ .band = IEEE80211_BAND_2GHZ, \ +-+ .center_freq = (_freq), \ +-+ .hw_value = (_channel), \ +-+ .flags = IEEE80211_CHAN_DISABLED, \ +-+ .max_antenna_gain = 0, \ +-+ .max_power = 30, \ +-+} +-+ +-+#define CHAN5G(_channel) { \ +-+ .band = IEEE80211_BAND_5GHZ, \ +-+ .center_freq = 5000 + (5 * (_channel)), \ +-+ .hw_value = (_channel), \ +-+ .flags = IEEE80211_CHAN_DISABLED, \ +-+ .max_antenna_gain = 0, \ +-+ .max_power = 30, \ +-+} +-+ +-+static struct ieee80211_channel __wl_2ghz_channels[] = { +-+ CHAN2G(1, 2412), CHAN2G(2, 2417), CHAN2G(3, 2422), CHAN2G(4, 2427), +-+ CHAN2G(5, 2432), CHAN2G(6, 2437), CHAN2G(7, 2442), CHAN2G(8, 2447), +-+ CHAN2G(9, 2452), CHAN2G(10, 2457), CHAN2G(11, 2462), CHAN2G(12, 2467), +-+ CHAN2G(13, 2472), CHAN2G(14, 2484) +-+}; +-+ +-+static struct ieee80211_channel __wl_5ghz_channels[] = { +-+ CHAN5G(34), CHAN5G(36), CHAN5G(38), CHAN5G(40), CHAN5G(42), +-+ CHAN5G(44), CHAN5G(46), CHAN5G(48), CHAN5G(52), CHAN5G(56), +-+ CHAN5G(60), CHAN5G(64), CHAN5G(100), CHAN5G(104), CHAN5G(108), +-+ CHAN5G(112), CHAN5G(116), CHAN5G(120), CHAN5G(124), CHAN5G(128), +-+ CHAN5G(132), CHAN5G(136), CHAN5G(140), CHAN5G(144), CHAN5G(149), +-+ CHAN5G(153), CHAN5G(157), CHAN5G(161), CHAN5G(165) +-+}; +- +- /* Band templates duplicated per wiphy. The channel info +-- * is filled in after querying the device. +-+ * above is added to the band during setup. +- */ +- static const struct ieee80211_supported_band __wl_band_2ghz = { +- .band = IEEE80211_BAND_2GHZ, +-@@ -143,7 +177,7 @@ static const struct ieee80211_supported_ +- .n_bitrates = wl_g_rates_size, +- }; +- +--static const struct ieee80211_supported_band __wl_band_5ghz_a = { +-+static const struct ieee80211_supported_band __wl_band_5ghz = { +- .band = IEEE80211_BAND_5GHZ, +- .bitrates = wl_a_rates, +- .n_bitrates = wl_a_rates_size, +-@@ -5252,40 +5286,6 @@ dongle_scantime_out: +- return err; +- } +- +--/* Filter the list of channels received from firmware counting only +-- * the 20MHz channels. The wiphy band data only needs those which get +-- * flagged to indicate if they can take part in higher bandwidth. +-- */ +--static void brcmf_count_20mhz_channels(struct brcmf_cfg80211_info *cfg, +-- struct brcmf_chanspec_list *chlist, +-- u32 chcnt[]) +--{ +-- u32 total = le32_to_cpu(chlist->count); +-- struct brcmu_chan ch; +-- int i; +-- +-- for (i = 0; i < total; i++) { +-- ch.chspec = (u16)le32_to_cpu(chlist->element[i]); +-- cfg->d11inf.decchspec(&ch); +-- +-- /* Firmware gives a ordered list. We skip non-20MHz +-- * channels is 2G. For 5G we can abort upon reaching +-- * a non-20MHz channel in the list. +-- */ +-- if (ch.bw != BRCMU_CHAN_BW_20) { +-- if (ch.band == BRCMU_CHAN_BAND_5G) +-- break; +-- else +-- continue; +-- } +-- +-- if (ch.band == BRCMU_CHAN_BAND_2G) +-- chcnt[0] += 1; +-- else if (ch.band == BRCMU_CHAN_BAND_5G) +-- chcnt[1] += 1; +-- } +--} +-- +- static void brcmf_update_bw40_channel_flag(struct ieee80211_channel *channel, +- struct brcmu_chan *ch) +- { +-@@ -5321,7 +5321,6 @@ static int brcmf_construct_chaninfo(stru +- u32 i, j; +- u32 total; +- u32 chaninfo; +-- u32 chcnt[2] = { 0, 0 }; +- u32 index; +- +- pbuf = kzalloc(BRCMF_DCMD_MEDLEN, GFP_KERNEL); +-@@ -5338,42 +5337,15 @@ static int brcmf_construct_chaninfo(stru +- goto fail_pbuf; +- } +- +-- brcmf_count_20mhz_channels(cfg, list, chcnt); +- wiphy = cfg_to_wiphy(cfg); +-- if (chcnt[0]) { +-- band = kmemdup(&__wl_band_2ghz, sizeof(__wl_band_2ghz), +-- GFP_KERNEL); +-- if (band == NULL) { +-- err = -ENOMEM; +-- goto fail_pbuf; +-- } +-- band->channels = kcalloc(chcnt[0], sizeof(*channel), +-- GFP_KERNEL); +-- if (band->channels == NULL) { +-- kfree(band); +-- err = -ENOMEM; +-- goto fail_pbuf; +-- } +-- band->n_channels = 0; +-- wiphy->bands[IEEE80211_BAND_2GHZ] = band; +-- } +-- if (chcnt[1]) { +-- band = kmemdup(&__wl_band_5ghz_a, sizeof(__wl_band_5ghz_a), +-- GFP_KERNEL); +-- if (band == NULL) { +-- err = -ENOMEM; +-- goto fail_band2g; +-- } +-- band->channels = kcalloc(chcnt[1], sizeof(*channel), +-- GFP_KERNEL); +-- if (band->channels == NULL) { +-- kfree(band); +-- err = -ENOMEM; +-- goto fail_band2g; +-- } +-- band->n_channels = 0; +-- wiphy->bands[IEEE80211_BAND_5GHZ] = band; +-- } +-+ band = wiphy->bands[IEEE80211_BAND_2GHZ]; +-+ if (band) +-+ for (i = 0; i < band->n_channels; i++) +-+ band->channels[i].flags = IEEE80211_CHAN_DISABLED; +-+ band = wiphy->bands[IEEE80211_BAND_5GHZ]; +-+ if (band) +-+ for (i = 0; i < band->n_channels; i++) +-+ band->channels[i].flags = IEEE80211_CHAN_DISABLED; +- +- total = le32_to_cpu(list->count); +- for (i = 0; i < total; i++) { +-@@ -5388,6 +5360,8 @@ static int brcmf_construct_chaninfo(stru +- brcmf_err("Invalid channel Spec. 0x%x.\n", ch.chspec); +- continue; +- } +-+ if (!band) +-+ continue; +- if (!(bw_cap[band->band] & WLC_BW_40MHZ_BIT) && +- ch.bw == BRCMU_CHAN_BW_40) +- continue; +-@@ -5415,9 +5389,9 @@ static int brcmf_construct_chaninfo(stru +- } else if (ch.bw == BRCMU_CHAN_BW_40) { +- brcmf_update_bw40_channel_flag(&channel[index], &ch); +- } else { +-- /* disable other bandwidths for now as mentioned +-- * order assure they are enabled for subsequent +-- * chanspecs. +-+ /* enable the channel and disable other bandwidths +-+ * for now as mentioned order assure they are enabled +-+ * for subsequent chanspecs. +- */ +- channel[index].flags = IEEE80211_CHAN_NO_HT40 | +- IEEE80211_CHAN_NO_80MHZ; +-@@ -5436,16 +5410,8 @@ static int brcmf_construct_chaninfo(stru +- IEEE80211_CHAN_NO_IR; +- } +- } +-- if (index == band->n_channels) +-- band->n_channels++; +- } +-- kfree(pbuf); +-- return 0; +- +--fail_band2g: +-- kfree(wiphy->bands[IEEE80211_BAND_2GHZ]->channels); +-- kfree(wiphy->bands[IEEE80211_BAND_2GHZ]); +-- wiphy->bands[IEEE80211_BAND_2GHZ] = NULL; +- fail_pbuf: +- kfree(pbuf); +- return err; +-@@ -5778,7 +5744,12 @@ static void brcmf_wiphy_wowl_params(stru +- +- static int brcmf_setup_wiphy(struct wiphy *wiphy, struct brcmf_if *ifp) +- { +-+ struct ieee80211_supported_band *band; +- struct ieee80211_iface_combination ifc_combo; +-+ __le32 bandlist[3]; +-+ u32 n_bands; +-+ int err, i; +-+ +- wiphy->max_scan_ssids = WL_NUM_SCAN_MAX; +- wiphy->max_scan_ie_len = BRCMF_SCAN_IE_LEN_MAX; +- wiphy->max_num_pmkids = WL_NUM_PMKIDS_MAX; +-@@ -5820,7 +5791,52 @@ static int brcmf_setup_wiphy(struct wiph +- if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_WOWL)) +- brcmf_wiphy_wowl_params(wiphy); +- +-- return brcmf_setup_wiphybands(wiphy); +-+ err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BANDLIST, &bandlist, +-+ sizeof(bandlist)); +-+ if (err) { +-+ brcmf_err("could not obtain band info: err=%d\n", err); +-+ return err; +-+ } +-+ /* first entry in bandlist is number of bands */ +-+ n_bands = le32_to_cpu(bandlist[0]); +-+ for (i = 1; i <= n_bands && i < ARRAY_SIZE(bandlist); i++) { +-+ if (bandlist[i] == cpu_to_le32(WLC_BAND_2G)) { +-+ band = kmemdup(&__wl_band_2ghz, sizeof(__wl_band_2ghz), +-+ GFP_KERNEL); +-+ if (!band) +-+ return -ENOMEM; +-+ +-+ band->channels = kmemdup(&__wl_2ghz_channels, +-+ sizeof(__wl_2ghz_channels), +-+ GFP_KERNEL); +-+ if (!band->channels) { +-+ kfree(band); +-+ return -ENOMEM; +-+ } +-+ +-+ band->n_channels = ARRAY_SIZE(__wl_2ghz_channels); +-+ wiphy->bands[IEEE80211_BAND_2GHZ] = band; +-+ } +-+ if (bandlist[i] == cpu_to_le32(WLC_BAND_5G)) { +-+ band = kmemdup(&__wl_band_5ghz, sizeof(__wl_band_5ghz), +-+ GFP_KERNEL); +-+ if (!band) +-+ return -ENOMEM; +-+ +-+ band->channels = kmemdup(&__wl_5ghz_channels, +-+ sizeof(__wl_5ghz_channels), +-+ GFP_KERNEL); +-+ if (!band->channels) { +-+ kfree(band); +-+ return -ENOMEM; +-+ } +-+ +-+ band->n_channels = ARRAY_SIZE(__wl_5ghz_channels); +-+ wiphy->bands[IEEE80211_BAND_5GHZ] = band; +-+ } +-+ } +-+ err = brcmf_setup_wiphybands(wiphy); +-+ return err; +- } +- +- static s32 brcmf_config_dongle(struct brcmf_cfg80211_info *cfg) +-@@ -6011,6 +6027,9 @@ static void brcmf_cfg80211_reg_notifier( +- +- static void brcmf_free_wiphy(struct wiphy *wiphy) +- { +-+ if (!wiphy) +-+ return; +-+ +- 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 +deleted file mode 100644 +index a0c22eb..0000000 +--- a/package/kernel/mac80211/patches/355-brcmfmac-update-wiphy-band-information-upon-updating.patch ++++ /dev/null +@@ -1,29 +0,0 @@ +-From: Arend van Spriel +-Date: Tue, 14 Apr 2015 20:10:25 +0200 +-Subject: [PATCH] brcmfmac: update wiphy band information upon updating +- regulatory domain +- +-When change the country code the available channels may change. So +-the wiphy bands should be updated accordingly. +- +-Reviewed-by: Daniel (Deognyoun) Kim +-Reviewed-by: Hante Meuleman +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Arend van Spriel +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-@@ -6022,7 +6022,11 @@ static void brcmf_cfg80211_reg_notifier( +- memset(&ccreq, 0, sizeof(ccreq)); +- ccreq.rev = cpu_to_le32(-1); +- memcpy(ccreq.ccode, req->alpha2, sizeof(req->alpha2)); +-- brcmf_fil_iovar_data_set(ifp, "country", &ccreq, sizeof(ccreq)); +-+ if (brcmf_fil_iovar_data_set(ifp, "country", &ccreq, sizeof(ccreq))) { +-+ brcmf_err("firmware rejected country setting\n"); +-+ return; +-+ } +-+ brcmf_setup_wiphybands(wiphy); +- } +- +- 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 +deleted file mode 100644 +index 193f507..0000000 +--- a/package/kernel/mac80211/patches/356-brcmfmac-add-description-for-feature-flags.patch ++++ /dev/null +@@ -1,24 +0,0 @@ +-From: Arend van Spriel +-Date: Tue, 14 Apr 2015 20:10:26 +0200 +-Subject: [PATCH] brcmfmac: add description for feature flags +- +-Some feature flags were not described in the header file. Adding +-the description. +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Arend van Spriel +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/feature.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/feature.h +-@@ -19,7 +19,9 @@ +- /* +- * Features: +- * +-+ * MBSS: multiple BSSID support (eg. guest network in AP mode). +- * MCHAN: multi-channel for concurrent P2P. +-+ * WOWL: Wake-On-WLAN. +- */ +- #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 +deleted file mode 100644 +index 42330b4..0000000 +--- a/package/kernel/mac80211/patches/357-brcmfmac-make-scheduled-scan-support-conditional.patch ++++ /dev/null +@@ -1,51 +0,0 @@ +-From: Arend van Spriel +-Date: Tue, 14 Apr 2015 20:10:27 +0200 +-Subject: [PATCH] brcmfmac: make scheduled scan support conditional +- +-The scheduled scan support depends on firmware supporting the PNO +-feature. This feature is optional so add a feature flag for this +-in the driver and announce scheduled scan support accordingly. +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Arend van Spriel +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-@@ -5782,7 +5782,8 @@ static int brcmf_setup_wiphy(struct wiph +- wiphy->flags |= WIPHY_FLAG_SUPPORTS_FW_ROAM; +- wiphy->mgmt_stypes = brcmf_txrx_stypes; +- wiphy->max_remain_on_channel_duration = 5000; +-- brcmf_wiphy_pno_params(wiphy); +-+ if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_PNO)) +-+ brcmf_wiphy_pno_params(wiphy); +- +- /* vendor commands/events support */ +- wiphy->vendor_commands = brcmf_vendor_cmds; +---- a/drivers/net/wireless/brcm80211/brcmfmac/feature.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/feature.c +-@@ -124,6 +124,7 @@ void brcmf_feat_attach(struct brcmf_pub +- struct brcmf_if *ifp = drvr->iflist[0]; +- +- brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_MCHAN, "mchan"); +-+ brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_PNO, "pfn"); +- if (drvr->bus_if->wowl_supported) +- brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_WOWL, "wowl"); +- if (drvr->bus_if->chip != BRCM_CC_43362_CHIP_ID) +---- a/drivers/net/wireless/brcm80211/brcmfmac/feature.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/feature.h +-@@ -21,11 +21,13 @@ +- * +- * MBSS: multiple BSSID support (eg. guest network in AP mode). +- * MCHAN: multi-channel for concurrent P2P. +-+ * PNO: preferred network offload. +- * WOWL: Wake-On-WLAN. +- */ +- #define BRCMF_FEAT_LIST \ +- BRCMF_FEAT_DEF(MBSS) \ +- BRCMF_FEAT_DEF(MCHAN) \ +-+ BRCMF_FEAT_DEF(PNO) \ +- 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 +deleted file mode 100644 +index b859d46..0000000 +--- a/package/kernel/mac80211/patches/358-brcmfmac-add-support-for-BCM4324-rev-B5-chipset.patch ++++ /dev/null +@@ -1,43 +0,0 @@ +-From: Arend van Spriel +-Date: Tue, 14 Apr 2015 20:10:28 +0200 +-Subject: [PATCH] brcmfmac: add support for BCM4324 rev B5 chipset +- +-This patch adds support for the BCM4324 B5 revision. This device +-is similar to BCM43241 from driver and firmware perspective. It +-is known to be used in Lenovo Thinkpad Tablet devices. +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Arend van Spriel +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-@@ -601,6 +601,8 @@ static const struct sdiod_drive_str sdio +- #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" +-@@ -628,6 +630,8 @@ 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); +-@@ -667,7 +671,8 @@ enum brcmf_firmware_type { +- 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, 0xFFFFFFE0, BRCMF_FIRMWARE_NVRAM(BCM43241B4) }, +-+ { 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) }, +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 +deleted file mode 100644 +index d420308..0000000 +--- a/package/kernel/mac80211/patches/359-brcmfmac-process-interrupt-regardless-sdiod-state.patch ++++ /dev/null +@@ -1,27 +0,0 @@ +-From: Arend van Spriel +-Date: Tue, 14 Apr 2015 20:10:29 +0200 +-Subject: [PATCH] brcmfmac: process interrupt regardless sdiod state +- +-When the sdio bus state is not ready to process we abort the +-interrupt service routine. This is not wanted as it keeps the +-interrupt source active. Better clear the interrupt source. +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Franky (Zhenhui) Lin +-Signed-off-by: Arend van Spriel +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-@@ -3555,10 +3555,6 @@ void brcmf_sdio_isr(struct brcmf_sdio *b +- return; +- } +- +-- if (bus->sdiodev->state != BRCMF_SDIOD_DATA) { +-- brcmf_err("bus is down. we have nothing to do\n"); +-- return; +-- } +- /* 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 +deleted file mode 100644 +index ac5584e..0000000 +--- a/package/kernel/mac80211/patches/360-brcmfmac-fix-sdio-suspend-and-resume.patch ++++ /dev/null +@@ -1,68 +0,0 @@ +-From: Arend van Spriel +-Date: Tue, 14 Apr 2015 20:10:30 +0200 +-Subject: [PATCH] brcmfmac: fix sdio suspend and resume +- +-commit 330b4e4be937 ("brcmfmac: Add wowl support for SDIO devices.") +-changed the behaviour by removing the MMC_PM_KEEP_POWER flag for +-non-wowl scenario, which needs to be restored. Another necessary +-change is to mark the card as being non-removable. With this in place +-the suspend resume test passes successfully doing: +- +- # echo devices > /sys/power/pm_test +- # echo mem > /sys/power/state +- +-Note that power may still be switched off when system is going +-in S3 state. +- +-Reported-by: Fu, Zhonghui < +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Franky (Zhenhui) Lin +-Signed-off-by: Arend van Spriel +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +-@@ -1011,6 +1011,14 @@ static int brcmf_sdiod_remove(struct brc +- return 0; +- } +- +-+static void brcmf_sdiod_host_fixup(struct mmc_host *host) +-+{ +-+ /* runtime-pm powers off the device */ +-+ pm_runtime_forbid(host->parent); +-+ /* avoid removal detection upon resume */ +-+ host->caps |= MMC_CAP_NONREMOVABLE; +-+} +-+ +- static int brcmf_sdiod_probe(struct brcmf_sdio_dev *sdiodev) +- { +- struct sdio_func *func; +-@@ -1076,7 +1084,7 @@ static int brcmf_sdiod_probe(struct brcm +- ret = -ENODEV; +- goto out; +- } +-- pm_runtime_forbid(host->parent); +-+ brcmf_sdiod_host_fixup(host); +- out: +- if (ret) +- brcmf_sdiod_remove(sdiodev); +-@@ -1246,15 +1254,15 @@ static int brcmf_ops_sdio_suspend(struct +- brcmf_sdiod_freezer_on(sdiodev); +- brcmf_sdio_wd_timer(sdiodev->bus, 0); +- +-+ sdio_flags = MMC_PM_KEEP_POWER; +- if (sdiodev->wowl_enabled) { +-- sdio_flags = MMC_PM_KEEP_POWER; +- if (sdiodev->pdata->oob_irq_supported) +- enable_irq_wake(sdiodev->pdata->oob_irq_nr); +- else +-- sdio_flags = MMC_PM_WAKE_SDIO_IRQ; +-- if (sdio_set_host_pm_flags(sdiodev->func[1], sdio_flags)) +-- brcmf_err("Failed to set pm_flags %x\n", sdio_flags); +-+ sdio_flags |= MMC_PM_WAKE_SDIO_IRQ; +- } +-+ if (sdio_set_host_pm_flags(sdiodev->func[1], sdio_flags)) +-+ brcmf_err("Failed to set pm_flags %x\n", sdio_flags); +- 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 +deleted file mode 100644 +index a521b65..0000000 +--- a/package/kernel/mac80211/patches/361-brcmfmac-add-support-for-BCM4358-PCIe-device.patch ++++ /dev/null +@@ -1,77 +0,0 @@ +-From: Arend van Spriel +-Date: Tue, 14 Apr 2015 20:10:31 +0200 +-Subject: [PATCH] brcmfmac: add support for BCM4358 PCIe device +- +-This patch adds support for the BCM4358 2x2 11ac device. +- +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Arend van Spriel +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/chip.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c +-@@ -649,6 +649,7 @@ static u32 brcmf_chip_tcm_rambase(struct +- case BRCM_CC_43567_CHIP_ID: +- case BRCM_CC_43569_CHIP_ID: +- case BRCM_CC_43570_CHIP_ID: +-+ case BRCM_CC_4358_CHIP_ID: +- case BRCM_CC_43602_CHIP_ID: +- return 0x180000; +- default: +---- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-@@ -51,6 +51,8 @@ enum brcmf_pcie_state { +- #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_FW_UP_TIMEOUT 2000 /* msec */ +- +-@@ -189,6 +191,8 @@ 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); +- +- +- struct brcmf_pcie_console { +-@@ -1333,6 +1337,10 @@ static int brcmf_pcie_get_fwnames(struct +- 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; +- default: +- brcmf_err("Unsupported chip 0x%04x\n", devinfo->ci->chip); +- return -ENODEV; +-@@ -1850,6 +1858,7 @@ static struct pci_device_id brcmf_pcie_d +- BRCMF_PCIE_DEVICE(BRCM_PCIE_4356_DEVICE_ID), +- 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_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 +-@@ -45,6 +45,7 @@ +- #define BRCM_CC_43567_CHIP_ID 43567 +- #define BRCM_CC_43569_CHIP_ID 43569 +- #define BRCM_CC_43570_CHIP_ID 43570 +-+#define BRCM_CC_4358_CHIP_ID 0x4358 +- #define BRCM_CC_43602_CHIP_ID 43602 +- +- /* USB Device IDs */ +-@@ -59,6 +60,7 @@ +- #define BRCM_PCIE_4356_DEVICE_ID 0x43ec +- #define BRCM_PCIE_43567_DEVICE_ID 0x43d3 +- #define BRCM_PCIE_43570_DEVICE_ID 0x43d9 +-+#define BRCM_PCIE_4358_DEVICE_ID 0x43e9 +- #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 +deleted file mode 100644 +index bcbb984..0000000 +--- a/package/kernel/mac80211/patches/362-brcmfmac-add-additional-43602-pcie-device-id.patch ++++ /dev/null +@@ -1,30 +0,0 @@ +-From: Hante Meuleman +-Date: Tue, 14 Apr 2015 20:10:32 +0200 +-Subject: [PATCH] brcmfmac: add additional 43602 pcie device id. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-@@ -1862,6 +1862,7 @@ static struct pci_device_id brcmf_pcie_d +- 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), +-+ BRCMF_PCIE_DEVICE(BRCM_PCIE_43602_RAW_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 +-@@ -64,6 +64,7 @@ +- #define BRCM_PCIE_43602_DEVICE_ID 0x43ba +- #define BRCM_PCIE_43602_2G_DEVICE_ID 0x43bb +- #define BRCM_PCIE_43602_5G_DEVICE_ID 0x43bc +-+#define BRCM_PCIE_43602_RAW_DEVICE_ID 43602 +- +- /* 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 +deleted file mode 100644 +index 5f9bbea..0000000 +--- a/package/kernel/mac80211/patches/363-brcmfmac-Add-support-for-multiple-PCIE-devices-in-nv.patch ++++ /dev/null +@@ -1,351 +0,0 @@ +-From: Hante Meuleman +-Date: Tue, 14 Apr 2015 20:10:33 +0200 +-Subject: [PATCH] brcmfmac: Add support for multiple PCIE devices in +- nvram. +- +-With PCIE it is possible to support multiple devices with the +-same device type. They all load the same nvram file. In order to +-support this the nvram can specify which part of the nvram is +-for which pcie device. This patch adds support for these new +-types of nvram files. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Daniel (Deognyoun) Kim +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/firmware.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/firmware.c +-@@ -23,6 +23,10 @@ +- #include "debug.h" +- #include "firmware.h" +- +-+#define BRCMF_FW_MAX_NVRAM_SIZE 64000 +-+#define BRCMF_FW_NVRAM_DEVPATH_LEN 19 /* devpath0=pcie/1/4/ */ +-+#define BRCMF_FW_NVRAM_PCIEDEV_LEN 9 /* pcie/1/4/ */ +-+ +- char brcmf_firmware_path[BRCMF_FW_PATH_LEN]; +- module_param_string(firmware_path, brcmf_firmware_path, +- BRCMF_FW_PATH_LEN, 0440); +-@@ -46,6 +50,8 @@ enum nvram_parser_state { +- * @column: current column in line. +- * @pos: byte offset in input buffer. +- * @entry: start position of key,value entry. +-+ * @multi_dev_v1: detect pcie multi device v1 (compressed). +-+ * @multi_dev_v2: detect pcie multi device v2. +- */ +- struct nvram_parser { +- enum nvram_parser_state state; +-@@ -56,6 +62,8 @@ struct nvram_parser { +- u32 column; +- u32 pos; +- u32 entry; +-+ bool multi_dev_v1; +-+ bool multi_dev_v2; +- }; +- +- static bool is_nvram_char(char c) +-@@ -108,6 +116,10 @@ static enum nvram_parser_state brcmf_nvr +- st = COMMENT; +- else +- st = VALUE; +-+ if (strncmp(&nvp->fwnv->data[nvp->entry], "devpath", 7) == 0) +-+ nvp->multi_dev_v1 = true; +-+ if (strncmp(&nvp->fwnv->data[nvp->entry], "pcie/", 5) == 0) +-+ nvp->multi_dev_v2 = true; +- } else if (!is_nvram_char(c)) { +- brcmf_dbg(INFO, "warning: ln=%d:col=%d: '=' expected, skip invalid key entry\n", +- nvp->line, nvp->column); +-@@ -133,6 +145,8 @@ brcmf_nvram_handle_value(struct nvram_pa +- ekv = (u8 *)&nvp->fwnv->data[nvp->pos]; +- skv = (u8 *)&nvp->fwnv->data[nvp->entry]; +- cplen = ekv - skv; +-+ if (nvp->nvram_len + cplen + 1 >= BRCMF_FW_MAX_NVRAM_SIZE) +-+ return END; +- /* copy to output buffer */ +- memcpy(&nvp->nvram[nvp->nvram_len], skv, cplen); +- nvp->nvram_len += cplen; +-@@ -180,10 +194,18 @@ static enum nvram_parser_state +- static int brcmf_init_nvram_parser(struct nvram_parser *nvp, +- const struct firmware *nv) +- { +-+ size_t size; +-+ +- memset(nvp, 0, sizeof(*nvp)); +- nvp->fwnv = nv; +-+ /* Limit size to MAX_NVRAM_SIZE, some files contain lot of comment */ +-+ if (nv->size > BRCMF_FW_MAX_NVRAM_SIZE) +-+ size = BRCMF_FW_MAX_NVRAM_SIZE; +-+ else +-+ size = nv->size; +- /* Alloc for extra 0 byte + roundup by 4 + length field */ +-- nvp->nvram = kzalloc(nv->size + 1 + 3 + sizeof(u32), GFP_KERNEL); +-+ size += 1 + 3 + sizeof(u32); +-+ nvp->nvram = kzalloc(size, GFP_KERNEL); +- if (!nvp->nvram) +- return -ENOMEM; +- +-@@ -192,12 +214,136 @@ static int brcmf_init_nvram_parser(struc +- return 0; +- } +- +-+/* brcmf_fw_strip_multi_v1 :Some nvram files contain settings for multiple +-+ * devices. Strip it down for one device, use domain_nr/bus_nr to determine +-+ * which data is to be returned. v1 is the version where nvram is stored +-+ * compressed and "devpath" maps to index for valid entries. +-+ */ +-+static void brcmf_fw_strip_multi_v1(struct nvram_parser *nvp, u16 domain_nr, +-+ u16 bus_nr) +-+{ +-+ u32 i, j; +-+ bool found; +-+ u8 *nvram; +-+ u8 id; +-+ +-+ nvram = kzalloc(nvp->nvram_len + 1 + 3 + sizeof(u32), GFP_KERNEL); +-+ if (!nvram) +-+ goto fail; +-+ +-+ /* min length: devpath0=pcie/1/4/ + 0:x=y */ +-+ if (nvp->nvram_len < BRCMF_FW_NVRAM_DEVPATH_LEN + 6) +-+ goto fail; +-+ +-+ /* First search for the devpathX and see if it is the configuration +-+ * for domain_nr/bus_nr. Search complete nvp +-+ */ +-+ found = false; +-+ i = 0; +-+ while (i < nvp->nvram_len - BRCMF_FW_NVRAM_DEVPATH_LEN) { +-+ /* Format: devpathX=pcie/Y/Z/ +-+ * Y = domain_nr, Z = bus_nr, X = virtual ID +-+ */ +-+ if ((strncmp(&nvp->nvram[i], "devpath", 7) == 0) && +-+ (strncmp(&nvp->nvram[i + 8], "=pcie/", 6) == 0)) { +-+ if (((nvp->nvram[i + 14] - '0') == domain_nr) && +-+ ((nvp->nvram[i + 16] - '0') == bus_nr)) { +-+ id = nvp->nvram[i + 7] - '0'; +-+ found = true; +-+ break; +-+ } +-+ } +-+ while (nvp->nvram[i] != 0) +-+ i++; +-+ i++; +-+ } +-+ if (!found) +-+ goto fail; +-+ +-+ /* Now copy all valid entries, release old nvram and assign new one */ +-+ i = 0; +-+ j = 0; +-+ while (i < nvp->nvram_len) { +-+ if ((nvp->nvram[i] - '0' == id) && (nvp->nvram[i + 1] == ':')) { +-+ i += 2; +-+ while (nvp->nvram[i] != 0) { +-+ nvram[j] = nvp->nvram[i]; +-+ i++; +-+ j++; +-+ } +-+ nvram[j] = 0; +-+ j++; +-+ } +-+ while (nvp->nvram[i] != 0) +-+ i++; +-+ i++; +-+ } +-+ kfree(nvp->nvram); +-+ nvp->nvram = nvram; +-+ nvp->nvram_len = j; +-+ return; +-+ +-+fail: +-+ kfree(nvram); +-+ nvp->nvram_len = 0; +-+} +-+ +-+/* brcmf_fw_strip_multi_v2 :Some nvram files contain settings for multiple +-+ * devices. Strip it down for one device, use domain_nr/bus_nr to determine +-+ * which data is to be returned. v2 is the version where nvram is stored +-+ * uncompressed, all relevant valid entries are identified by +-+ * pcie/domain_nr/bus_nr: +-+ */ +-+static void brcmf_fw_strip_multi_v2(struct nvram_parser *nvp, u16 domain_nr, +-+ u16 bus_nr) +-+{ +-+ u32 i, j; +-+ u8 *nvram; +-+ +-+ nvram = kzalloc(nvp->nvram_len + 1 + 3 + sizeof(u32), GFP_KERNEL); +-+ if (!nvram) +-+ goto fail; +-+ +-+ /* Copy all valid entries, release old nvram and assign new one. +-+ * Valid entries are of type pcie/X/Y/ where X = domain_nr and +-+ * Y = bus_nr. +-+ */ +-+ i = 0; +-+ j = 0; +-+ while (i < nvp->nvram_len - BRCMF_FW_NVRAM_PCIEDEV_LEN) { +-+ if ((strncmp(&nvp->nvram[i], "pcie/", 5) == 0) && +-+ (nvp->nvram[i + 6] == '/') && (nvp->nvram[i + 8] == '/') && +-+ ((nvp->nvram[i + 5] - '0') == domain_nr) && +-+ ((nvp->nvram[i + 7] - '0') == bus_nr)) { +-+ i += BRCMF_FW_NVRAM_PCIEDEV_LEN; +-+ while (nvp->nvram[i] != 0) { +-+ nvram[j] = nvp->nvram[i]; +-+ i++; +-+ j++; +-+ } +-+ nvram[j] = 0; +-+ j++; +-+ } +-+ while (nvp->nvram[i] != 0) +-+ i++; +-+ i++; +-+ } +-+ kfree(nvp->nvram); +-+ nvp->nvram = nvram; +-+ nvp->nvram_len = j; +-+ return; +-+fail: +-+ kfree(nvram); +-+ nvp->nvram_len = 0; +-+} +-+ +- /* brcmf_nvram_strip :Takes a buffer of "=\n" lines read from a fil +- * and ending in a NUL. Removes carriage returns, empty lines, comment lines, +- * and converts newlines to NULs. Shortens buffer as needed and pads with NULs. +- * End of buffer is completed with token identifying length of buffer. +- */ +--static void *brcmf_fw_nvram_strip(const struct firmware *nv, u32 *new_length) +-+static void *brcmf_fw_nvram_strip(const struct firmware *nv, u32 *new_length, +-+ u16 domain_nr, u16 bus_nr) +- { +- struct nvram_parser nvp; +- u32 pad; +-@@ -212,6 +358,16 @@ static void *brcmf_fw_nvram_strip(const +- if (nvp.state == END) +- break; +- } +-+ if (nvp.multi_dev_v1) +-+ brcmf_fw_strip_multi_v1(&nvp, domain_nr, bus_nr); +-+ else if (nvp.multi_dev_v2) +-+ brcmf_fw_strip_multi_v2(&nvp, domain_nr, bus_nr); +-+ +-+ if (nvp.nvram_len == 0) { +-+ kfree(nvp.nvram); +-+ return NULL; +-+ } +-+ +- pad = nvp.nvram_len; +- *new_length = roundup(nvp.nvram_len + 1, 4); +- while (pad != *new_length) { +-@@ -239,6 +395,8 @@ struct brcmf_fw { +- u16 flags; +- const struct firmware *code; +- const char *nvram_name; +-+ u16 domain_nr; +-+ u16 bus_nr; +- void (*done)(struct device *dev, const struct firmware *fw, +- void *nvram_image, u32 nvram_len); +- }; +-@@ -254,7 +412,8 @@ static void brcmf_fw_request_nvram_done( +- goto fail; +- +- if (fw) { +-- nvram = brcmf_fw_nvram_strip(fw, &nvram_length); +-+ nvram = brcmf_fw_nvram_strip(fw, &nvram_length, +-+ fwctx->domain_nr, fwctx->bus_nr); +- release_firmware(fw); +- if (!nvram && !(fwctx->flags & BRCMF_FW_REQ_NV_OPTIONAL)) +- goto fail; +-@@ -309,11 +468,12 @@ fail: +- kfree(fwctx); +- } +- +--int brcmf_fw_get_firmwares(struct device *dev, u16 flags, +-- const char *code, const char *nvram, +-- void (*fw_cb)(struct device *dev, +-- const struct firmware *fw, +-- void *nvram_image, u32 nvram_len)) +-+int brcmf_fw_get_firmwares_pcie(struct device *dev, u16 flags, +-+ const char *code, const char *nvram, +-+ void (*fw_cb)(struct device *dev, +-+ const struct firmware *fw, +-+ void *nvram_image, u32 nvram_len), +-+ u16 domain_nr, u16 bus_nr) +- { +- struct brcmf_fw *fwctx; +- +-@@ -333,8 +493,21 @@ int brcmf_fw_get_firmwares(struct device +- fwctx->done = fw_cb; +- if (flags & BRCMF_FW_REQUEST_NVRAM) +- fwctx->nvram_name = nvram; +-+ fwctx->domain_nr = domain_nr; +-+ fwctx->bus_nr = bus_nr; +- +- return request_firmware_nowait(THIS_MODULE, true, code, dev, +- GFP_KERNEL, fwctx, +- brcmf_fw_request_code_done); +- } +-+ +-+int brcmf_fw_get_firmwares(struct device *dev, u16 flags, +-+ const char *code, const char *nvram, +-+ void (*fw_cb)(struct device *dev, +-+ const struct firmware *fw, +-+ void *nvram_image, u32 nvram_len)) +-+{ +-+ return brcmf_fw_get_firmwares_pcie(dev, flags, code, nvram, fw_cb, 0, +-+ 0); +-+} +-+ +---- a/drivers/net/wireless/brcm80211/brcmfmac/firmware.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/firmware.h +-@@ -32,6 +32,12 @@ void brcmf_fw_nvram_free(void *nvram); +- * fails it will not use the callback, but call device_release_driver() +- * instead which will call the driver .remove() callback. +- */ +-+int brcmf_fw_get_firmwares_pcie(struct device *dev, u16 flags, +-+ const char *code, const char *nvram, +-+ void (*fw_cb)(struct device *dev, +-+ const struct firmware *fw, +-+ void *nvram_image, u32 nvram_len), +-+ u16 domain_nr, u16 bus_nr); +- int brcmf_fw_get_firmwares(struct device *dev, u16 flags, +- const char *code, const char *nvram, +- void (*fw_cb)(struct device *dev, +---- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-@@ -1649,8 +1649,13 @@ brcmf_pcie_probe(struct pci_dev *pdev, c +- struct brcmf_pciedev_info *devinfo; +- struct brcmf_pciedev *pcie_bus_dev; +- struct brcmf_bus *bus; +-+ u16 domain_nr; +-+ u16 bus_nr; +- +-- brcmf_dbg(PCIE, "Enter %x:%x\n", pdev->vendor, pdev->device); +-+ domain_nr = pci_domain_nr(pdev->bus) + 1; +-+ bus_nr = pdev->bus->number; +-+ brcmf_dbg(PCIE, "Enter %x:%x (%d/%d)\n", pdev->vendor, pdev->device, +-+ domain_nr, bus_nr); +- +- ret = -ENOMEM; +- devinfo = kzalloc(sizeof(*devinfo), GFP_KERNEL); +-@@ -1699,10 +1704,10 @@ brcmf_pcie_probe(struct pci_dev *pdev, c +- if (ret) +- goto fail_bus; +- +-- ret = brcmf_fw_get_firmwares(bus->dev, BRCMF_FW_REQUEST_NVRAM | +-- BRCMF_FW_REQ_NV_OPTIONAL, +-- devinfo->fw_name, devinfo->nvram_name, +-- brcmf_pcie_setup); +-+ ret = brcmf_fw_get_firmwares_pcie(bus->dev, BRCMF_FW_REQUEST_NVRAM | +-+ BRCMF_FW_REQ_NV_OPTIONAL, +-+ devinfo->fw_name, devinfo->nvram_name, +-+ brcmf_pcie_setup, domain_nr, bus_nr); +- 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 +deleted file mode 100644 +index d26e118..0000000 +--- a/package/kernel/mac80211/patches/364-brcmfmac-cleanup-a-sizeof.patch ++++ /dev/null +@@ -1,23 +0,0 @@ +-From: Dan Carpenter +-Date: Thu, 7 May 2015 12:59:19 +0300 +-Subject: [PATCH] brcmfmac: cleanup a sizeof() +- +-"flowrings" and "*flowrings" are both pointers so this always returns +-sizeof(void *) and the current code works fine. But "*flowrings" is +-intended here and static checkers complain, so lets change it. +- +-Signed-off-by: Dan Carpenter +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-@@ -1617,7 +1617,7 @@ static void brcmf_pcie_setup(struct devi +- bus->msgbuf->commonrings[i] = +- &devinfo->shared.commonrings[i]->commonring; +- +-- flowrings = kcalloc(devinfo->shared.nrof_flowrings, sizeof(flowrings), +-+ flowrings = kcalloc(devinfo->shared.nrof_flowrings, sizeof(*flowrings), +- 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 +deleted file mode 100644 +index 9b2880d..0000000 +--- a/package/kernel/mac80211/patches/365-brcmfmac-check-result-of-USB-firmware-request.patch ++++ /dev/null +@@ -1,33 +0,0 @@ +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Thu, 7 May 2015 14:13:03 +0200 +-Subject: [PATCH] brcmfmac: check result of USB firmware request +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-This prevents silence failures with driver waiting (infinitely) for a +-callback. +- +-Signed-off-by: Rafał Miłecki +-Acked-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 +-@@ -1270,8 +1270,13 @@ static int brcmf_usb_probe_cb(struct brc +- bus->chiprev = bus_pub->chiprev; +- +- /* request firmware here */ +-- brcmf_fw_get_firmwares(dev, 0, brcmf_usb_get_fwname(devinfo), NULL, +-- brcmf_usb_probe_phase2); +-+ ret = brcmf_fw_get_firmwares(dev, 0, brcmf_usb_get_fwname(devinfo), +-+ NULL, brcmf_usb_probe_phase2); +-+ if (ret) { +-+ brcmf_err("firmware request failed: %d\n", ret); +-+ goto fail; +-+ } +-+ +- 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 +deleted file mode 100644 +index d46b300..0000000 +--- a/package/kernel/mac80211/patches/366-brcmfmac-prohibit-ACPI-power-management-for-brcmfmac.patch ++++ /dev/null +@@ -1,47 +0,0 @@ +-From: "Fu, Zhonghui" +-Date: Mon, 11 May 2015 10:41:32 +0800 +-Subject: [PATCH] brcmfmac: prohibit ACPI power management for brcmfmac driver +- +-ACPI will manage WiFi chip's power state during suspend/resume +-process on some tablet platforms(such as ASUS T100TA). This is +-not supported by brcmfmac driver now, and the context of WiFi +-chip will be damaged after resume. This patch informs ACPI not +-to manage WiFi chip's power state. +- +-Signed-off-by: Zhonghui Fu +-Acked-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +-@@ -33,6 +33,7 @@ +- #include +- #include +- #include +-+#include +- #include +- +- #include +-@@ -1122,6 +1123,8 @@ static int brcmf_ops_sdio_probe(struct s +- int err; +- struct brcmf_sdio_dev *sdiodev; +- struct brcmf_bus *bus_if; +-+ struct device *dev; +-+ struct acpi_device *adev; +- +- brcmf_dbg(SDIO, "Enter\n"); +- brcmf_dbg(SDIO, "Class=%x\n", func->class); +-@@ -1129,6 +1132,12 @@ static int brcmf_ops_sdio_probe(struct s +- brcmf_dbg(SDIO, "sdio device ID: 0x%04x\n", func->device); +- brcmf_dbg(SDIO, "Function#: %d\n", func->num); +- +-+ /* prohibit ACPI power management for this device */ +-+ dev = &func->dev; +-+ adev = ACPI_COMPANION(dev); +-+ if (adev) +-+ adev->flags.power_manageable = 0; +-+ +- /* 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 +deleted file mode 100644 +index 9b4609f..0000000 +--- a/package/kernel/mac80211/patches/367-brcmfmac-avoid-gcc-5.1-warning.patch ++++ /dev/null +@@ -1,30 +0,0 @@ +-From: Arnd Bergmann +-Date: Tue, 12 May 2015 23:54:25 +0200 +-Subject: [PATCH] brcmfmac: avoid gcc-5.1 warning +- +-gcc-5.0 gained a new warning in the fwsignal portion of the brcmfmac +-driver: +- +-drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c: In function 'brcmf_fws_txs_process': +-drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c:1478:8: warning: 'skb' may be used uninitialized in this function [-Wmaybe-uninitialized] +- +-This is a false positive, and marking the brcmf_fws_hanger_poppkt function +-as 'static inline' makes the warning go away. I have checked the object +-file output and while a little code gets moved around, the size of +-the binary remains identical. +- +-Signed-off-by: Arnd Bergmann +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c +-@@ -635,7 +635,7 @@ static int brcmf_fws_hanger_pushpkt(stru +- return 0; +- } +- +--static int brcmf_fws_hanger_poppkt(struct brcmf_fws_hanger *h, +-+static inline int brcmf_fws_hanger_poppkt(struct brcmf_fws_hanger *h, +- 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 +deleted file mode 100644 +index b16782d..0000000 +--- a/package/kernel/mac80211/patches/368-brcmfmac-allow-device-tree-node-without-interrupts-p.patch ++++ /dev/null +@@ -1,45 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 20 May 2015 14:09:47 +0200 +-Subject: [PATCH] brcmfmac: allow device tree node without 'interrupts' +- property +- +-As described in the device tree bindings for 'brcm,bcm4329-fmac' +-nodes, the interrupts property is optional. So adding a check +-for the presence of this property before attempting to parse +-and map the interrupt. If not present or parsing fails return +-and fallback to in-band sdio interrupt. +- +-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/of.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/of.c +-@@ -39,10 +39,16 @@ void brcmf_of_probe(struct brcmf_sdio_de +- if (!sdiodev->pdata) +- return; +- +-+ if (of_property_read_u32(np, "brcm,drive-strength", &val) == 0) +-+ sdiodev->pdata->drive_strength = val; +-+ +-+ /* make sure there are interrupts defined in the node */ +-+ if (!of_find_property(np, "interrupts", NULL)) +-+ return; +-+ +- irq = irq_of_parse_and_map(np, 0); +- if (!irq) { +- brcmf_err("interrupt could not be mapped\n"); +-- devm_kfree(dev, sdiodev->pdata); +- return; +- } +- irqf = irqd_get_trigger_type(irq_get_irq_data(irq)); +-@@ -50,7 +56,4 @@ void brcmf_of_probe(struct brcmf_sdio_de +- sdiodev->pdata->oob_irq_supported = true; +- sdiodev->pdata->oob_irq_nr = irq; +- sdiodev->pdata->oob_irq_flags = irqf; +-- +-- 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 +deleted file mode 100644 +index f81250e..0000000 +--- a/package/kernel/mac80211/patches/369-brcmfmac-Improve-throughput-by-scheduling-msbug-flow.patch ++++ /dev/null +@@ -1,87 +0,0 @@ +-From: Hante Meuleman +-Date: Wed, 20 May 2015 14:09:48 +0200 +-Subject: [PATCH] brcmfmac: Improve throughput by scheduling msbug flow worker. +- +-The tx flow worker in msgbuf gets scheduled at tx till a certain +-threshold has been reached. Then the tx completes will take over +-the scheduling. When amsdu and ampdu is used the frames are +-transferred wireless in a very bulky fashion, in combination +-with this scheduling algorithm and buffer limiters in the stack +-this can result in limited throughput. This change causes the +-flow worker to be scheduled more frequently from tx. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Daniel (Deognyoun) Kim +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/flowring.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/flowring.c +-@@ -249,8 +249,8 @@ void brcmf_flowring_delete(struct brcmf_ +- } +- +- +--void brcmf_flowring_enqueue(struct brcmf_flowring *flow, u8 flowid, +-- struct sk_buff *skb) +-+u32 brcmf_flowring_enqueue(struct brcmf_flowring *flow, u8 flowid, +-+ struct sk_buff *skb) +- { +- struct brcmf_flowring_ring *ring; +- +-@@ -271,6 +271,7 @@ void brcmf_flowring_enqueue(struct brcmf +- if (skb_queue_len(&ring->skblist) < BRCMF_FLOWRING_LOW) +- brcmf_flowring_block(flow, flowid, false); +- } +-+ return skb_queue_len(&ring->skblist); +- } +- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/flowring.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/flowring.h +-@@ -64,8 +64,8 @@ u32 brcmf_flowring_create(struct brcmf_f +- 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); +--void brcmf_flowring_enqueue(struct brcmf_flowring *flow, u8 flowid, +-- struct sk_buff *skb); +-+u32 brcmf_flowring_enqueue(struct brcmf_flowring *flow, u8 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 *skb); +---- a/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c +-@@ -73,7 +73,7 @@ +- #define BRCMF_MSGBUF_TX_FLUSH_CNT1 32 +- #define BRCMF_MSGBUF_TX_FLUSH_CNT2 96 +- +--#define BRCMF_MSGBUF_DELAY_TXWORKER_THRS 64 +-+#define BRCMF_MSGBUF_DELAY_TXWORKER_THRS 96 +- #define BRCMF_MSGBUF_TRICKLE_TXWORKER_THRS 32 +- +- struct msgbuf_common_hdr { +-@@ -797,6 +797,8 @@ static int brcmf_msgbuf_txdata(struct br +- struct brcmf_flowring *flow = msgbuf->flow; +- struct ethhdr *eh = (struct ethhdr *)(skb->data); +- u32 flowid; +-+ u32 queue_count; +-+ bool force; +- +- flowid = brcmf_flowring_lookup(flow, eh->h_dest, skb->priority, ifidx); +- if (flowid == BRCMF_FLOWRING_INVALID_ID) { +-@@ -804,8 +806,9 @@ static int brcmf_msgbuf_txdata(struct br +- if (flowid == BRCMF_FLOWRING_INVALID_ID) +- return -ENOMEM; +- } +-- brcmf_flowring_enqueue(flow, flowid, skb); +-- brcmf_msgbuf_schedule_txdata(msgbuf, flowid, false); +-+ queue_count = brcmf_flowring_enqueue(flow, flowid, skb); +-+ force = ((queue_count % BRCMF_MSGBUF_TRICKLE_TXWORKER_THRS) == 0); +-+ brcmf_msgbuf_schedule_txdata(msgbuf, flowid, force); +- +- 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 +deleted file mode 100644 +index 61153c4..0000000 +--- a/package/kernel/mac80211/patches/370-brcmfmac-remove-pci-shared-structure-rev4-support.patch ++++ /dev/null +@@ -1,41 +0,0 @@ +-From: Franky Lin +-Date: Wed, 20 May 2015 14:09:49 +0200 +-Subject: [PATCH] brcmfmac: remove pci shared structure rev4 support +- +-All pcie full dongle chips supported by fmac are using rev 5+ shared +-structure. This patch removes the rev4 related code. +- +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Hante Meuleman +-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/pcie.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-@@ -112,10 +112,9 @@ enum brcmf_pcie_state { +- BRCMF_PCIE_MB_INT_D2H3_DB0 | \ +- BRCMF_PCIE_MB_INT_D2H3_DB1) +- +--#define BRCMF_PCIE_MIN_SHARED_VERSION 4 +-+#define BRCMF_PCIE_MIN_SHARED_VERSION 5 +- #define BRCMF_PCIE_MAX_SHARED_VERSION 5 +- #define BRCMF_PCIE_SHARED_VERSION_MASK 0x00FF +--#define BRCMF_PCIE_SHARED_TXPUSH_SUPPORT 0x4000 +- +- #define BRCMF_PCIE_FLAGS_HTOD_SPLIT 0x4000 +- #define BRCMF_PCIE_FLAGS_DTOH_SPLIT 0x8000 +-@@ -1280,11 +1279,6 @@ brcmf_pcie_init_share_ram_info(struct br +- brcmf_err("Unsupported PCIE version %d\n", version); +- return -EINVAL; +- } +-- if (shared->flags & BRCMF_PCIE_SHARED_TXPUSH_SUPPORT) { +-- brcmf_err("Unsupported legacy TX mode 0x%x\n", +-- shared->flags & BRCMF_PCIE_SHARED_TXPUSH_SUPPORT); +-- return -EINVAL; +-- } +- +- 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 +deleted file mode 100644 +index 8c8eebe..0000000 +--- a/package/kernel/mac80211/patches/371-brcmfmac-remove-dummy-cache-flush-invalidate-functio.patch ++++ /dev/null +@@ -1,120 +0,0 @@ +-From: Franky Lin +-Date: Wed, 20 May 2015 14:09:50 +0200 +-Subject: [PATCH] brcmfmac: remove dummy cache flush/invalidate function +- +-brcmf_dma_flush and brcmf_dma_invalidate_cache are not necessary and +-have never been implemented. +- +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Hante Meuleman +-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/commonring.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/commonring.c +-@@ -22,17 +22,6 @@ +- #include "core.h" +- #include "commonring.h" +- +-- +--/* dma flushing needs implementation for mips and arm platforms. Should +-- * be put in util. Note, this is not real flushing. It is virtual non +-- * cached memory. Only write buffers should have to be drained. Though +-- * this may be different depending on platform...... +-- * SEE ALSO msgbuf.c +-- */ +--#define brcmf_dma_flush(addr, len) +--#define brcmf_dma_invalidate_cache(addr, len) +-- +-- +- void brcmf_commonring_register_cb(struct brcmf_commonring *commonring, +- int (*cr_ring_bell)(void *ctx), +- int (*cr_update_rptr)(void *ctx), +-@@ -206,14 +195,9 @@ int brcmf_commonring_write_complete(stru +- address = commonring->buf_addr; +- address += (commonring->f_ptr * commonring->item_len); +- if (commonring->f_ptr > commonring->w_ptr) { +-- brcmf_dma_flush(address, +-- (commonring->depth - commonring->f_ptr) * +-- commonring->item_len); +- address = commonring->buf_addr; +- commonring->f_ptr = 0; +- } +-- brcmf_dma_flush(address, (commonring->w_ptr - commonring->f_ptr) * +-- commonring->item_len); +- +- commonring->f_ptr = commonring->w_ptr; +- +-@@ -258,8 +242,6 @@ void *brcmf_commonring_get_read_ptr(stru +- if (commonring->r_ptr == commonring->depth) +- commonring->r_ptr = 0; +- +-- brcmf_dma_invalidate_cache(ret_addr, *n_ items * commonring->item_len); +-- +- return ret_addr; +- } +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c +-@@ -278,16 +278,6 @@ struct brcmf_msgbuf_pktids { +- struct brcmf_msgbuf_pktid *array; +- }; +- +-- +--/* dma flushing needs implementation for mips and arm platforms. Should +-- * be put in util. Note, this is not real flushing. It is virtual non +-- * cached memory. Only write buffers should have to be drained. Though +-- * this may be different depending on platform...... +-- */ +--#define brcmf_dma_flush(addr, len) +--#define brcmf_dma_invalidate_cache(addr, len) +-- +-- +- static void brcmf_msgbuf_rxbuf_ioctlresp_post(struct brcmf_msgbuf *msgbuf); +- +- +-@@ -462,7 +452,6 @@ static int brcmf_msgbuf_tx_ioctl(struct +- memcpy(msgbuf->ioctbuf, buf, buf_len); +- else +- memset(msgbuf->ioctbuf, 0, buf_len); +-- brcmf_dma_flush(ioctl_buf, buf_len); +- +- err = brcmf_commonring_write_complete(commonring); +- brcmf_commonring_unlock(commonring); +---- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-@@ -276,15 +276,6 @@ static const u32 brcmf_ring_itemsize[BRC +- }; +- +- +--/* dma flushing needs implementation for mips and arm platforms. Should +-- * be put in util. Note, this is not real flushing. It is virtual non +-- * cached memory. Only write buffers should have to be drained. Though +-- * this may be different depending on platform...... +-- */ +--#define brcmf_dma_flush(addr, len) +--#define brcmf_dma_invalidate_cache(addr, len) +-- +-- +- static u32 +- brcmf_pcie_read_reg32(struct brcmf_pciedev_info *devinfo, u32 reg_offset) +- { +-@@ -1174,7 +1165,6 @@ static int brcmf_pcie_init_scratchbuffer +- goto fail; +- +- memset(devinfo->shared.scratch, 0, BRCMF_DMA_D2H_SCRATCH_BUF_LEN); +-- brcmf_dma_flush(devinfo->shared.scratch, BRCMF_DMA_D2H_SCRATCH_BUF_LEN); +- +- addr = devinfo->shared.tcm_base_address + +- BRCMF_SHARED_DMA_SCRATCH_ADDR_OFFSET; +-@@ -1192,7 +1182,6 @@ static int brcmf_pcie_init_scratchbuffer +- goto fail; +- +- memset(devinfo->shared.ringupd, 0, BRCMF_DMA_D2H_RINGUPD_BUF_LEN); +-- brcmf_dma_flush(devinfo->shared.ringupd, BRCMF_DMA_D2H_RINGUPD_BUF_LEN); +- +- 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 +deleted file mode 100644 +index 2f50abd..0000000 +--- a/package/kernel/mac80211/patches/372-brcmfmac-add-support-for-dma-indices-feature.patch ++++ /dev/null +@@ -1,270 +0,0 @@ +-From: Franky Lin +-Date: Wed, 20 May 2015 14:09:51 +0200 +-Subject: [PATCH] brcmfmac: add support for dma indices feature +- +-PCIe full dongle firmware can support a dma indices feature with which +-firmware can update/fetch the read/write indices of message buffer +-rings on both host to dongle and dongle to host directions. The support is +-announced by firmware through shared flags. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Franky Lin +-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 +-@@ -115,6 +115,8 @@ enum brcmf_pcie_state { +- #define BRCMF_PCIE_MIN_SHARED_VERSION 5 +- #define BRCMF_PCIE_MAX_SHARED_VERSION 5 +- #define BRCMF_PCIE_SHARED_VERSION_MASK 0x00FF +-+#define BRCMF_PCIE_SHARED_DMA_INDEX 0x10000 +-+#define BRCMF_PCIE_SHARED_DMA_2B_IDX 0x100000 +- +- #define BRCMF_PCIE_FLAGS_HTOD_SPLIT 0x4000 +- #define BRCMF_PCIE_FLAGS_DTOH_SPLIT 0x8000 +-@@ -146,6 +148,10 @@ enum brcmf_pcie_state { +- #define BRCMF_SHARED_RING_H2D_R_IDX_PTR_OFFSET 8 +- #define BRCMF_SHARED_RING_D2H_W_IDX_PTR_OFFSET 12 +- #define BRCMF_SHARED_RING_D2H_R_IDX_PTR_OFFSET 16 +-+#define BRCMF_SHARED_RING_H2D_WP_HADDR_OFFSET 20 +-+#define BRCMF_SHARED_RING_H2D_RP_HADDR_OFFSET 28 +-+#define BRCMF_SHARED_RING_D2H_WP_HADDR_OFFSET 36 +-+#define BRCMF_SHARED_RING_D2H_RP_HADDR_OFFSET 44 +- #define BRCMF_SHARED_RING_TCM_MEMLOC_OFFSET 0 +- #define BRCMF_SHARED_RING_MAX_SUB_QUEUES 52 +- +-@@ -247,6 +253,13 @@ struct brcmf_pciedev_info { +- bool mbdata_completed; +- bool irq_allocated; +- bool wowl_enabled; +-+ u8 dma_idx_sz; +-+ void *idxbuf; +-+ u32 idxbuf_sz; +-+ dma_addr_t idxbuf_dmahandle; +-+ u16 (*read_ptr)(struct brcmf_pciedev_info *devinfo, u32 mem_offset); +-+ void (*write_ptr)(struct brcmf_pciedev_info *devinfo, u32 mem_offset, +-+ u16 value); +- }; +- +- struct brcmf_pcie_ringbuf { +-@@ -323,6 +336,25 @@ brcmf_pcie_write_tcm16(struct brcmf_pcie +- } +- +- +-+static u16 +-+brcmf_pcie_read_idx(struct brcmf_pciedev_info *devinfo, u32 mem_offset) +-+{ +-+ u16 *address = devinfo->idxbuf + mem_offset; +-+ +-+ return (*(address)); +-+} +-+ +-+ +-+static void +-+brcmf_pcie_write_idx(struct brcmf_pciedev_info *devinfo, u32 mem_offset, +-+ u16 value) +-+{ +-+ u16 *address = devinfo->idxbuf + mem_offset; +-+ +-+ *(address) = value; +-+} +-+ +-+ +- static u32 +- brcmf_pcie_read_tcm32(struct brcmf_pciedev_info *devinfo, u32 mem_offset) +- { +-@@ -868,7 +900,7 @@ static int brcmf_pcie_ring_mb_write_rptr +- brcmf_dbg(PCIE, "W r_ptr %d (%d), ring %d\n", commonring->r_ptr, +- commonring->w_ptr, ring->id); +- +-- brcmf_pcie_write_tcm16(devinfo, ring->r_idx_addr, commonring->r_ptr); +-+ devinfo->write_ptr(devinfo, ring->r_idx_addr, commonring->r_ptr); +- +- return 0; +- } +-@@ -886,7 +918,7 @@ static int brcmf_pcie_ring_mb_write_wptr +- brcmf_dbg(PCIE, "W w_ptr %d (%d), ring %d\n", commonring->w_ptr, +- commonring->r_ptr, ring->id); +- +-- brcmf_pcie_write_tcm16(devinfo, ring->w_idx_addr, commonring->w_ptr); +-+ devinfo->write_ptr(devinfo, ring->w_idx_addr, commonring->w_ptr); +- +- return 0; +- } +-@@ -915,7 +947,7 @@ static int brcmf_pcie_ring_mb_update_rpt +- if (devinfo->state != BRCMFMAC_PCIE_STATE_UP) +- return -EIO; +- +-- commonring->r_ptr = brcmf_pcie_read_tcm16(devinfo, ring->r_idx_addr); +-+ commonring->r_ptr = devinfo->read_ptr(devinfo, ring->r_idx_addr); +- +- brcmf_dbg(PCIE, "R r_ptr %d (%d), ring %d\n", commonring->r_ptr, +- commonring->w_ptr, ring->id); +-@@ -933,7 +965,7 @@ static int brcmf_pcie_ring_mb_update_wpt +- if (devinfo->state != BRCMFMAC_PCIE_STATE_UP) +- return -EIO; +- +-- commonring->w_ptr = brcmf_pcie_read_tcm16(devinfo, ring->w_idx_addr); +-+ commonring->w_ptr = devinfo->read_ptr(devinfo, ring->w_idx_addr); +- +- brcmf_dbg(PCIE, "R w_ptr %d (%d), ring %d\n", commonring->w_ptr, +- commonring->r_ptr, ring->id); +-@@ -1038,6 +1070,13 @@ static void brcmf_pcie_release_ringbuffe +- } +- kfree(devinfo->shared.flowrings); +- devinfo->shared.flowrings = NULL; +-+ if (devinfo->idxbuf) { +-+ dma_free_coherent(&devinfo->pdev->dev, +-+ devinfo->idxbuf_sz, +-+ devinfo->idxbuf, +-+ devinfo->idxbuf_dmahandle); +-+ devinfo->idxbuf = NULL; +-+ } +- } +- +- +-@@ -1053,19 +1092,72 @@ static int brcmf_pcie_init_ringbuffers(s +- u32 addr; +- u32 ring_mem_ptr; +- u32 i; +-+ u64 address; +-+ u32 bufsz; +- u16 max_sub_queues; +-+ u8 idx_offset; +- +- ring_addr = devinfo->shared.ring_info_addr; +- brcmf_dbg(PCIE, "Base ring addr = 0x%08x\n", ring_addr); +-+ addr = ring_addr + BRCMF_SHARED_RING_MAX_SUB_QUEUES; +-+ max_sub_queues = brcmf_pcie_read_tcm16(devinfo, addr); +- +-- addr = ring_addr + BRCMF_SHARED_RING_D2H_W_IDX_PTR_OFFSET; +-- d2h_w_idx_ptr = brcmf_pcie_read_tcm32(devinfo, addr); +-- addr = ring_addr + BRCMF_SHARED_RING_D2H_R_IDX_PTR_OFFSET; +-- d2h_r_idx_ptr = brcmf_pcie_read_tcm32(devinfo, addr); +-- addr = ring_addr + BRCMF_SHARED_RING_H2D_W_IDX_PTR_OFFSET; +-- h2d_w_idx_ptr = brcmf_pcie_read_tcm32(devinfo, addr); +-- addr = ring_addr + BRCMF_SHARED_RING_H2D_R_IDX_PTR_OFFSET; +-- h2d_r_idx_ptr = brcmf_pcie_read_tcm32(devinfo, addr); +-+ if (devinfo->dma_idx_sz != 0) { +-+ bufsz = (BRCMF_NROF_D2H_COMMON_MSGRINGS + max_sub_queues) * +-+ devinfo->dma_idx_sz * 2; +-+ devinfo->idxbuf = dma_alloc_coherent(&devinfo->pdev->dev, bufsz, +-+ &devinfo->idxbuf_dmahandle, +-+ GFP_KERNEL); +-+ if (!devinfo->idxbuf) +-+ devinfo->dma_idx_sz = 0; +-+ } +-+ +-+ if (devinfo->dma_idx_sz == 0) { +-+ addr = ring_addr + BRCMF_SHARED_RING_D2H_W_IDX_PTR_OFFSET; +-+ d2h_w_idx_ptr = brcmf_pcie_read_tcm32(devinfo, addr); +-+ addr = ring_addr + BRCMF_SHARED_RING_D2H_R_IDX_PTR_OFFSET; +-+ d2h_r_idx_ptr = brcmf_pcie_read_tcm32(devinfo, addr); +-+ addr = ring_addr + BRCMF_SHARED_RING_H2D_W_IDX_PTR_OFFSET; +-+ h2d_w_idx_ptr = brcmf_pcie_read_tcm32(devinfo, addr); +-+ addr = ring_addr + BRCMF_SHARED_RING_H2D_R_IDX_PTR_OFFSET; +-+ h2d_r_idx_ptr = brcmf_pcie_read_tcm32(devinfo, addr); +-+ idx_offset = sizeof(u32); +-+ devinfo->write_ptr = brcmf_pcie_write_tcm16; +-+ devinfo->read_ptr = brcmf_pcie_read_tcm16; +-+ brcmf_dbg(PCIE, "Using TCM indices\n"); +-+ } else { +-+ memset(devinfo->idxbuf, 0, bufsz); +-+ devinfo->idxbuf_sz = bufsz; +-+ idx_offset = devinfo->dma_idx_sz; +-+ devinfo->write_ptr = brcmf_pcie_write_idx; +-+ devinfo->read_ptr = brcmf_pcie_read_idx; +-+ +-+ h2d_w_idx_ptr = 0; +-+ addr = ring_addr + BRCMF_SHARED_RING_H2D_WP_HADDR_OFFSET; +-+ address = (u64)devinfo->idxbuf_dmahandle; +-+ brcmf_pcie_write_tcm32(devinfo, addr, address & 0xffffffff); +-+ brcmf_pcie_write_tcm32(devinfo, addr + 4, address >> 32); +-+ +-+ h2d_r_idx_ptr = h2d_w_idx_ptr + max_sub_queues * idx_offset; +-+ addr = ring_addr + BRCMF_SHARED_RING_H2D_RP_HADDR_OFFSET; +-+ address += max_sub_queues * idx_offset; +-+ brcmf_pcie_write_tcm32(devinfo, addr, address & 0xffffffff); +-+ brcmf_pcie_write_tcm32(devinfo, addr + 4, address >> 32); +-+ +-+ d2h_w_idx_ptr = h2d_r_idx_ptr + max_sub_queues * idx_offset; +-+ addr = ring_addr + BRCMF_SHARED_RING_D2H_WP_HADDR_OFFSET; +-+ address += max_sub_queues * idx_offset; +-+ brcmf_pcie_write_tcm32(devinfo, addr, address & 0xffffffff); +-+ brcmf_pcie_write_tcm32(devinfo, addr + 4, address >> 32); +-+ +-+ d2h_r_idx_ptr = d2h_w_idx_ptr + +-+ BRCMF_NROF_D2H_COMMON_MSGRINGS * idx_offset; +-+ addr = ring_addr + BRCMF_SHARED_RING_D2H_RP_HADDR_OFFSET; +-+ address += BRCMF_NROF_D2H_COMMON_MSGRINGS * idx_offset; +-+ brcmf_pcie_write_tcm32(devinfo, addr, address & 0xffffffff); +-+ brcmf_pcie_write_tcm32(devinfo, addr + 4, address >> 32); +-+ brcmf_dbg(PCIE, "Using host memory indices\n"); +-+ } +- +- addr = ring_addr + BRCMF_SHARED_RING_TCM_MEMLOC_OFFSET; +- ring_mem_ptr = brcmf_pcie_read_tcm32(devinfo, addr); +-@@ -1079,8 +1171,8 @@ static int brcmf_pcie_init_ringbuffers(s +- ring->id = i; +- devinfo->shared.commonrings[i] = ring; +- +-- h2d_w_idx_ptr += sizeof(u32); +-- h2d_r_idx_ptr += sizeof(u32); +-+ h2d_w_idx_ptr += idx_offset; +-+ h2d_r_idx_ptr += idx_offset; +- ring_mem_ptr += BRCMF_RING_MEM_SZ; +- } +- +-@@ -1094,13 +1186,11 @@ static int brcmf_pcie_init_ringbuffers(s +- ring->id = i; +- devinfo->shared.commonrings[i] = ring; +- +-- d2h_w_idx_ptr += sizeof(u32); +-- d2h_r_idx_ptr += sizeof(u32); +-+ d2h_w_idx_ptr += idx_offset; +-+ d2h_r_idx_ptr += idx_offset; +- ring_mem_ptr += BRCMF_RING_MEM_SZ; +- } +- +-- addr = ring_addr + BRCMF_SHARED_RING_MAX_SUB_QUEUES; +-- max_sub_queues = brcmf_pcie_read_tcm16(devinfo, addr); +- devinfo->shared.nrof_flowrings = +- max_sub_queues - BRCMF_NROF_H2D_COMMON_MSGRINGS; +- rings = kcalloc(devinfo->shared.nrof_flowrings, sizeof(*ring), +-@@ -1124,15 +1214,15 @@ static int brcmf_pcie_init_ringbuffers(s +- ring); +- ring->w_idx_addr = h2d_w_idx_ptr; +- ring->r_idx_addr = h2d_r_idx_ptr; +-- h2d_w_idx_ptr += sizeof(u32); +-- h2d_r_idx_ptr += sizeof(u32); +-+ h2d_w_idx_ptr += idx_offset; +-+ h2d_r_idx_ptr += idx_offset; +- } +- devinfo->shared.flowrings = rings; +- +- return 0; +- +- fail: +-- brcmf_err("Allocating commonring buffers failed\n"); +-+ brcmf_err("Allocating ring buffers failed\n"); +- brcmf_pcie_release_ringbuffers(devinfo); +- return -ENOMEM; +- } +-@@ -1269,6 +1359,14 @@ brcmf_pcie_init_share_ram_info(struct br +- return -EINVAL; +- } +- +-+ /* check firmware support dma indicies */ +-+ if (shared->flags & BRCMF_PCIE_SHARED_DMA_INDEX) { +-+ if (shared->flags & BRCMF_PCIE_SHARED_DMA_2B_IDX) +-+ devinfo->dma_idx_sz = sizeof(u16); +-+ else +-+ devinfo->dma_idx_sz = sizeof(u32); +-+ } +-+ +- 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 +deleted file mode 100644 +index 28408d2..0000000 +--- a/package/kernel/mac80211/patches/373-brcmfmac-avoid-null-pointer-access-when-brcmf_msgbuf.patch ++++ /dev/null +@@ -1,102 +0,0 @@ +-From: Arend van Spriel +-Date: Tue, 26 May 2015 13:19:46 +0200 +-Subject: [PATCH] brcmfmac: avoid null pointer access when +- brcmf_msgbuf_get_pktid() fails +- +-The function brcmf_msgbuf_get_pktid() may return a NULL pointer so +-the callers should check the return pointer before accessing it to +-avoid the crash below (see [1]): +- +-brcmfmac: brcmf_msgbuf_get_pktid: Invalid packet id 273 (not in use) +-BUG: unable to handle kernel NULL pointer dereference at 0000000000000080 +-IP: [] skb_pull+0x5/0x50 +-PGD 0 +-Oops: 0000 [#1] PREEMPT SMP +-Modules linked in: pci_stub vboxpci(O) vboxnetflt(O) vboxnetadp(O) vboxdrv(O) +- snd_hda_codec_hdmi bnep mousedev hid_generic ushwmon msr ext4 crc16 mbcache +- jbd2 sd_mod uas usb_storage ahci libahci libata scsi_mod xhci_pci xhci_hcd +- usbcore usb_common +-CPU: 0 PID: 1661 Comm: irq/61-brcmf_pc Tainted: G O 4.0.1-MacbookPro-ARCH #1 +-Hardware name: Apple Inc. MacBookPro12,1/Mac-E43C1C25D4880AD6, +- BIOS MBP121.88Z.0167.B02.1503241251 03/24/2015 +-task: ffff880264203cc0 ti: ffff88025ffe4000 task.ti: ffff88025ffe4000 +-RIP: 0010:[] [] skb_pull+0x5/0x50 +-RSP: 0018:ffff88025ffe7d40 EFLAGS: 00010202 +-RAX: 0000000000000000 RBX: ffff88008a33c000 RCX: 0000000000000044 +-RDX: 0000000000000000 RSI: 000000000000004a RDI: 0000000000000000 +-RBP: ffff88025ffe7da8 R08: 0000000000000096 R09: 000000000000004a +-R10: 0000000000000000 R11: 000000000000048e R12: ffff88025ff14f00 +-R13: 0000000000000000 R14: ffff880263b48200 R15: ffff88008a33c000 +-FS: 0000000000000000(0000) GS:ffff88026ec00000(0000) knlGS:0000000000000000 +-CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 +-CR2: 0000000000000080 CR3: 000000000180b000 CR4: 00000000003407f0 +-Stack: +- ffffffffa06aed74 ffff88025ffe7dc8 ffff880263b48270 ffff880263b48278 +- 05ea88020000004a 0002ffff81014635 000000001720b2f6 ffff88026ec116c0 +- ffff880263b48200 0000000000010000 ffff880263b4ae00 ffff880264203cc0 +-Call Trace: +- [] ? brcmf_msgbuf_process_rx+0x404/0x480 [brcmfmac] +- [] ? irq_finalize_oneshot.part.30+0xf0/0xf0 +- [] brcmf_proto_msgbuf_rx_trigger+0x35/0xf0 [brcmfmac] +- [] brcmf_pcie_isr_thread_v2+0x8a/0x130 [brcmfmac] +- [] irq_thread_fn+0x20/0x50 +- [] irq_thread+0x13f/0x170 +- [] ? wake_threads_waitq+0x30/0x30 +- [] ? irq_thread_dtor+0xb0/0xb0 +- [] kthread+0xd8/0xf0 +- [] ? kthread_create_on_node+0x1c0/0x1c0 +- [] ret_from_fork+0x58/0x90 +- [] ? kthread_create_on_node+0x1c0/0x1c0 +-Code: 01 83 e2 f7 88 50 01 48 83 c4 08 5b 5d f3 c3 0f 1f 80 00 00 00 00 83 e2 +- f7 88 50 01 c3 66 0f 1f 84 00 00 00 00 00 0f 1f +-RIP [] skb_pull+0x5/0x50 +- RSP +-CR2: 0000000000000080 +----[ end trace b074c0f90e7c997d ]--- +- +-[1] http://mid.gmane.org/20150430193259.GA5630@googlemail.com +- +-Cc: # v3.18, v3.19, v4.0, v4.1 +-Reported-by: Michael Hornung +-Reviewed-by: Hante Meuleman +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Arend van Spriel +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c +-@@ -500,11 +500,9 @@ static int brcmf_msgbuf_query_dcmd(struc +- msgbuf->rx_pktids, +- msgbuf->ioctl_resp_pktid); +- if (msgbuf->ioctl_resp_ret_len != 0) { +-- if (!skb) { +-- brcmf_err("Invalid packet id idx recv'd %d\n", +-- msgbuf->ioctl_resp_pktid); +-+ if (!skb) +- return -EBADF; +-- } +-+ +- memcpy(buf, skb->data, (len < msgbuf->ioctl_resp_ret_len) ? +- len : msgbuf->ioctl_resp_ret_len); +- } +-@@ -866,10 +864,8 @@ brcmf_msgbuf_process_txstatus(struct brc +- flowid -= BRCMF_NROF_H2D_COMMON_MSGRINGS; +- skb = brcmf_msgbuf_get_pktid(msgbuf->drvr->bus_if->dev, +- msgbuf->tx_pktids, idx); +-- if (!skb) { +-- brcmf_err("Invalid packet id idx recv'd %d\n", idx); +-+ if (!skb) +- return; +-- } +- +- set_bit(flowid, msgbuf->txstatus_done_map); +- commonring = msgbuf->flowrings[flowid]; +-@@ -1148,6 +1144,8 @@ brcmf_msgbuf_process_rx_complete(struct +- +- skb = brcmf_msgbuf_get_pktid(msgbuf->drvr->bus_if->dev, +- msgbuf->rx_pktids, idx); +-+ if (!skb) +-+ return; +- +- 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 +deleted file mode 100644 +index f023034..0000000 +--- a/package/kernel/mac80211/patches/374-brcmfmac-fix-invalid-access-to-struct-acpi_device-fi.patch ++++ /dev/null +@@ -1,63 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 27 May 2015 19:31:41 +0200 +-Subject: [PATCH] brcmfmac: fix invalid access to struct acpi_device fields +- +-The fields of struct acpi_device are only known when CONFIG_ACPI is +-defined. Fix this by using a helper function. This will resolve the +-issue found in linux-next: +- +- ../brcmfmac/bcmsdh.c: In function 'brcmf_ops_sdio_probe': +- ../brcmfmac/bcmsdh.c:1139:7: error: dereferencing pointer to incomplete type +- adev->flags.power_manageable = 0; +- ^ +- +-Fixes: f0992ace680c ("brcmfmac: prohibit ACPI power management ...") +-Cc: Fu, Zhonghui +-Reported-by: Stephen Rothwell +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +-@@ -1117,6 +1117,18 @@ MODULE_DEVICE_TABLE(sdio, brcmf_sdmmc_id +- static struct brcmfmac_sdio_platform_data *brcmfmac_sdio_pdata; +- +- +-+static void brcmf_sdiod_acpi_set_power_manageable(struct device *dev, +-+ int val) +-+{ +-+#if IS_ENABLED(CONFIG_ACPI) +-+ struct acpi_device *adev; +-+ +-+ adev = ACPI_COMPANION(dev); +-+ if (adev) +-+ adev->flags.power_manageable = 0; +-+#endif +-+} +-+ +- static int brcmf_ops_sdio_probe(struct sdio_func *func, +- const struct sdio_device_id *id) +- { +-@@ -1124,7 +1136,6 @@ static int brcmf_ops_sdio_probe(struct s +- struct brcmf_sdio_dev *sdiodev; +- struct brcmf_bus *bus_if; +- struct device *dev; +-- struct acpi_device *adev; +- +- brcmf_dbg(SDIO, "Enter\n"); +- brcmf_dbg(SDIO, "Class=%x\n", func->class); +-@@ -1132,11 +1143,9 @@ static int brcmf_ops_sdio_probe(struct s +- brcmf_dbg(SDIO, "sdio device ID: 0x%04x\n", func->device); +- brcmf_dbg(SDIO, "Function#: %d\n", func->num); +- +-- /* prohibit ACPI power management for this device */ +- dev = &func->dev; +-- adev = ACPI_COMPANION(dev); +-- if (adev) +-- adev->flags.power_manageable = 0; +-+ /* prohibit ACPI power management for this device */ +-+ brcmf_sdiod_acpi_set_power_manageable(dev, 0); +- +- /* 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 +deleted file mode 100644 +index 2bfd44f..0000000 +--- a/package/kernel/mac80211/patches/375-brcmfmac-simplify-check-stripping-v2-NVRAM.patch ++++ /dev/null +@@ -1,56 +0,0 @@ +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Wed, 20 May 2015 09:34:21 +0200 +-Subject: [PATCH] brcmfmac: simplify check stripping v2 NVRAM +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-Comparing NVRAM entry with a full filtering string is simpler than +-comparing it with a short prefix and then checking random chars at magic +-offsets. The cost of snprintf relatively low, we execute it just once. +-Tested on BCM43602 with NVRAM hacked to use V2 format. +- +-Signed-off-by: Rafał Miłecki +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/firmware.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/firmware.c +-@@ -25,7 +25,7 @@ +- +- #define BRCMF_FW_MAX_NVRAM_SIZE 64000 +- #define BRCMF_FW_NVRAM_DEVPATH_LEN 19 /* devpath0=pcie/1/4/ */ +--#define BRCMF_FW_NVRAM_PCIEDEV_LEN 9 /* pcie/1/4/ */ +-+#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, +-@@ -297,6 +297,8 @@ fail: +- static void brcmf_fw_strip_multi_v2(struct nvram_parser *nvp, u16 domain_nr, +- u16 bus_nr) +- { +-+ char prefix[BRCMF_FW_NVRAM_PCIEDEV_LEN]; +-+ size_t len; +- u32 i, j; +- u8 *nvram; +- +-@@ -308,14 +310,13 @@ static void brcmf_fw_strip_multi_v2(stru +- * Valid entries are of type pcie/X/Y/ where X = domain_nr and +- * Y = bus_nr. +- */ +-+ snprintf(prefix, sizeof(prefix), "pcie/%d/%d/", domain_nr, bus_nr); +-+ len = strlen(prefix); +- i = 0; +- j = 0; +-- while (i < nvp->nvram_len - BRCMF_FW_NVRAM_PCIEDEV_LEN) { +-- if ((strncmp(&nvp->nvram[i], "pcie/", 5) == 0) && +-- (nvp->nvram[i + 6] == '/') && (nvp->nvram[i + 8] == '/') && +-- ((nvp->nvram[i + 5] - '0') == domain_nr) && +-- ((nvp->nvram[i + 7] - '0') == bus_nr)) { +-- i += BRCMF_FW_NVRAM_PCIEDEV_LEN; +-+ while (i < nvp->nvram_len - len) { +-+ if (strncmp(&nvp->nvram[i], prefix, len) == 0) { +-+ i += len; +- 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 +deleted file mode 100644 +index 0e65114..0000000 +--- a/package/kernel/mac80211/patches/376-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?= +-Date: Wed, 20 May 2015 11:01:08 +0200 +-Subject: [PATCH] brcmfmac: simplify check finding NVRAM v1 device path +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-With a simple use of snprintf and small buffer we can compare NVRAM +-entry value with a full string. This way we avoid checking random chars +-at magic offsets. +-Tested on BCM43602 with NVRAM hacked to use v1 format. +- +-Signed-off-by: Rafał Miłecki +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/firmware.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/firmware.c +-@@ -222,6 +222,10 @@ static int brcmf_init_nvram_parser(struc +- static void brcmf_fw_strip_multi_v1(struct nvram_parser *nvp, u16 domain_nr, +- u16 bus_nr) +- { +-+ /* Device path with a leading '=' key-value separator */ +-+ char pcie_path[] = "=pcie/?/?"; +-+ size_t pcie_len; +-+ +- u32 i, j; +- bool found; +- u8 *nvram; +-@@ -238,6 +242,9 @@ static void brcmf_fw_strip_multi_v1(stru +- /* First search for the devpathX and see if it is the configuration +- * for domain_nr/bus_nr. Search complete nvp +- */ +-+ snprintf(pcie_path, sizeof(pcie_path), "=pcie/%d/%d", domain_nr, +-+ bus_nr); +-+ pcie_len = strlen(pcie_path); +- found = false; +- i = 0; +- while (i < nvp->nvram_len - BRCMF_FW_NVRAM_DEVPATH_LEN) { +-@@ -245,13 +252,10 @@ static void brcmf_fw_strip_multi_v1(stru +- * Y = domain_nr, Z = bus_nr, X = virtual ID +- */ +- if ((strncmp(&nvp->nvram[i], "devpath", 7) == 0) && +-- (strncmp(&nvp->nvram[i + 8], "=pcie/", 6) == 0)) { +-- if (((nvp->nvram[i + 14] - '0') == domain_nr) && +-- ((nvp->nvram[i + 16] - '0') == bus_nr)) { +-- id = nvp->nvram[i + 7] - '0'; +-- found = true; +-- break; +-- } +-+ (strncmp(&nvp->nvram[i + 8], pcie_path, pcie_len) == 0)) { +-+ id = nvp->nvram[i + 7] - '0'; +-+ found = true; +-+ break; +- } +- 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 +deleted file mode 100644 +index dc174e5..0000000 +--- a/package/kernel/mac80211/patches/377-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?= +-Date: Wed, 20 May 2015 13:59:54 +0200 +-Subject: [PATCH] brcmfmac: treat \0 as end of comment when parsing NVRAM +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-This fixes brcmfmac dealing with NVRAM coming from platform e.g. from a +-flash MTD partition. In such cases entries are separated by \0 instead +-of \n which caused ignoring whole content after the first "comment". +-While platform NVRAM doesn't usually contain comments, we switch to +-COMMENT state after e.g. finding an unexpected char in key name. +- +-Signed-off-by: Rafał Miłecki +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/firmware.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/firmware.c +-@@ -162,17 +162,20 @@ brcmf_nvram_handle_value(struct nvram_pa +- static enum nvram_parser_state +- brcmf_nvram_handle_comment(struct nvram_parser *nvp) +- { +-- char *eol, *sol; +-+ char *eoc, *sol; +- +- sol = (char *)&nvp->fwnv->data[nvp->pos]; +-- eol = strchr(sol, '\n'); +-- if (eol == NULL) +-- return END; +-+ eoc = strchr(sol, '\n'); +-+ if (!eoc) { +-+ eoc = strchr(sol, '\0'); +-+ if (!eoc) +-+ return END; +-+ } +- +- /* eat all moving to next line */ +- nvp->line++; +- nvp->column = 1; +-- nvp->pos += (eol - sol) + 1; +-+ nvp->pos += (eoc - sol) + 1; +- 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 +deleted file mode 100644 +index 5700142..0000000 +--- a/package/kernel/mac80211/patches/378-brcmfmac-allow-NVRAM-values-to-contain-spaces.patch ++++ /dev/null +@@ -1,50 +0,0 @@ +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Sat, 23 May 2015 09:15:33 +0200 +-Subject: [PATCH] brcmfmac: allow NVRAM values to contain spaces +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-Platform NVRAMs often contain values with spaces. Even if right now most +-firmware-supported entries are simple values, we shouldn't reject these +-with spaces. It was semi-confirmed by Broadcom in the early patch adding +-support for platform NVRAMs. +- +-Signed-off-by: Rafał Miłecki +-Acked-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 +-@@ -66,6 +66,12 @@ struct nvram_parser { +- bool multi_dev_v2; +- }; +- +-+/** +-+ * is_nvram_char() - check if char is a valid one for NVRAM entry +-+ * +-+ * It accepts all printable ASCII chars except for '#' which opens a comment. +-+ * Please note that ' ' (space) while accepted is not a valid key name char. +-+ */ +- static bool is_nvram_char(char c) +- { +- /* comment marker excluded */ +-@@ -73,7 +79,7 @@ static bool is_nvram_char(char c) +- return false; +- +- /* key and value may have any other readable character */ +-- return (c > 0x20 && c < 0x7f); +-+ return (c >= 0x20 && c < 0x7f); +- } +- +- static bool is_whitespace(char c) +-@@ -120,7 +126,7 @@ static enum nvram_parser_state brcmf_nvr +- nvp->multi_dev_v1 = true; +- if (strncmp(&nvp->fwnv->data[nvp->entry], "pcie/", 5) == 0) +- nvp->multi_dev_v2 = true; +-- } else if (!is_nvram_char(c)) { +-+ } else if (!is_nvram_char(c) || c == ' ') { +- 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 +deleted file mode 100644 +index 814b0d7..0000000 +--- a/package/kernel/mac80211/patches/379-ath9k-fix-DMA-stop-sequence-for-AR9003.patch ++++ /dev/null +@@ -1,33 +0,0 @@ +-From: Felix Fietkau +-Date: Tue, 2 Jun 2015 10:35:46 +0200 +-Subject: [PATCH] ath9k: fix DMA stop sequence for AR9003+ +- +-AR93xx and newer needs to stop rx before tx to avoid getting the DMA +-engine or MAC into a stuck state. +-This should reduce/fix the occurence of "Failed to stop Tx DMA" logspam. +- +-Cc: stable@vger.kernel.org +-Signed-off-by: Felix Fietkau +---- +- +---- a/drivers/net/wireless/ath/ath9k/main.c +-+++ b/drivers/net/wireless/ath/ath9k/main.c +-@@ -216,11 +216,13 @@ static bool ath_prepare_reset(struct ath +- ath_stop_ani(sc); +- ath9k_hw_disable_interrupts(ah); +- +-- if (!ath_drain_all_txq(sc)) +-- ret = false; +-- +-- if (!ath_stoprecv(sc)) +-- ret = false; +-+ if (AR_SREV_9300_20_OR_LATER(ah)) { +-+ ret &= ath_stoprecv(sc); +-+ ret &= ath_drain_all_txq(sc); +-+ } else { +-+ ret &= ath_drain_all_txq(sc); +-+ ret &= ath_stoprecv(sc); +-+ } +- +- 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 +deleted file mode 100644 +index 7bbd57e..0000000 +--- a/package/kernel/mac80211/patches/380-brcmfmac-support-NVRAMs-containing-pci-devpaths-inst.patch ++++ /dev/null +@@ -1,56 +0,0 @@ +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Thu, 28 May 2015 14:19:21 +0200 +-Subject: [PATCH] brcmfmac: support NVRAMs containing pci devpaths (instead of +- pcie) +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-Recently Broadcom added support for NVRAMs with entries for multiple +-PCIe devices. One of the supported formats is based on prefixes defined +-like: devpath0=pcie/1/4/ and entries like 0:foo=bar 0:baz=qux etc. +- +-Unfortunately there are also a bit older devices using different way of +-defining prefixes, e.g. SmartRG SR400ac (2 x BCM43602) with entries: +-devpath0=pci/1/1/ +-devpath1=pci/2/1 +-Broadcom stated this old format will never be used/supported by brcmfmac +-but given the simplicity of this patch I'll insist on supporting it. +- +-Signed-off-by: Rafał Miłecki +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/firmware.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/firmware.c +-@@ -232,6 +232,8 @@ static void brcmf_fw_strip_multi_v1(stru +- u16 bus_nr) +- { +- /* Device path with a leading '=' key-value separator */ +-+ char pci_path[] = "=pci/?/?"; +-+ size_t pci_len; +- char pcie_path[] = "=pcie/?/?"; +- size_t pcie_len; +- +-@@ -251,6 +253,9 @@ static void brcmf_fw_strip_multi_v1(stru +- /* First search for the devpathX and see if it is the configuration +- * for domain_nr/bus_nr. Search complete nvp +- */ +-+ snprintf(pci_path, sizeof(pci_path), "=pci/%d/%d", domain_nr, +-+ bus_nr); +-+ pci_len = strlen(pci_path); +- snprintf(pcie_path, sizeof(pcie_path), "=pcie/%d/%d", domain_nr, +- bus_nr); +- pcie_len = strlen(pcie_path); +-@@ -260,8 +265,9 @@ static void brcmf_fw_strip_multi_v1(stru +- /* Format: devpathX=pcie/Y/Z/ +- * Y = domain_nr, Z = bus_nr, X = virtual ID +- */ +-- if ((strncmp(&nvp->nvram[i], "devpath", 7) == 0) && +-- (strncmp(&nvp->nvram[i + 8], pcie_path, pcie_len) == 0)) { +-+ if (strncmp(&nvp->nvram[i], "devpath", 7) == 0 && +-+ (!strncmp(&nvp->nvram[i + 8], pci_path, pci_len) || +-+ !strncmp(&nvp->nvram[i + 8], pcie_path, pcie_len))) { +- 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 +deleted file mode 100644 +index 1eff6ed..0000000 +--- a/package/kernel/mac80211/patches/381-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?= +-Date: Sun, 31 May 2015 02:52:26 +0200 +-Subject: [PATCH] brcmfmac: set wiphy perm_addr to hardware MAC address +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-This allows e.g. user space to use /sys/class/ieee80211/*/macaddress +- +-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 +-@@ -6070,6 +6070,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802 +- brcmf_err("Could not allocate wiphy device\n"); +- return NULL; +- } +-+ memcpy(wiphy->perm_addr, drvr->mac, ETH_ALEN); +- 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 +deleted file mode 100644 +index c6e83dd..0000000 +--- a/package/kernel/mac80211/patches/382-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?= +-Date: Thu, 4 Jun 2015 22:11:07 +0200 +-Subject: [PATCH] brcmfmac: use direct data pointer in NVRAM parser struct +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-As we plan to add support for platform NVRAM we should store direct +-data pointer without the extra struct firmware layer. This will allow +-us to support other sources with the only requirement being u8 buffer. +- +-Signed-off-by: Rafał Miłecki +-Acked-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 +-@@ -43,7 +43,7 @@ enum nvram_parser_state { +- * struct nvram_parser - internal info for parser. +- * +- * @state: current parser state. +-- * @fwnv: input buffer being parsed. +-+ * @data: input buffer being parsed. +- * @nvram: output buffer with parse result. +- * @nvram_len: lenght of parse result. +- * @line: current line. +-@@ -55,7 +55,7 @@ enum nvram_parser_state { +- */ +- struct nvram_parser { +- enum nvram_parser_state state; +-- const struct firmware *fwnv; +-+ const u8 *data; +- u8 *nvram; +- u32 nvram_len; +- u32 line; +-@@ -91,7 +91,7 @@ static enum nvram_parser_state brcmf_nvr +- { +- char c; +- +-- c = nvp->fwnv->data[nvp->pos]; +-+ c = nvp->data[nvp->pos]; +- if (c == '\n') +- return COMMENT; +- if (is_whitespace(c)) +-@@ -115,16 +115,16 @@ static enum nvram_parser_state brcmf_nvr +- enum nvram_parser_state st = nvp->state; +- char c; +- +-- c = nvp->fwnv->data[nvp->pos]; +-+ c = nvp->data[nvp->pos]; +- if (c == '=') { +- /* ignore RAW1 by treating as comment */ +-- if (strncmp(&nvp->fwnv->data[nvp->entry], "RAW1", 4) == 0) +-+ if (strncmp(&nvp->data[nvp->entry], "RAW1", 4) == 0) +- st = COMMENT; +- else +- st = VALUE; +-- if (strncmp(&nvp->fwnv->data[nvp->entry], "devpath", 7) == 0) +-+ if (strncmp(&nvp->data[nvp->entry], "devpath", 7) == 0) +- nvp->multi_dev_v1 = true; +-- if (strncmp(&nvp->fwnv->data[nvp->entry], "pcie/", 5) == 0) +-+ if (strncmp(&nvp->data[nvp->entry], "pcie/", 5) == 0) +- nvp->multi_dev_v2 = true; +- } else if (!is_nvram_char(c) || c == ' ') { +- brcmf_dbg(INFO, "warning: ln=%d:col=%d: '=' expected, skip invalid key entry\n", +-@@ -145,11 +145,11 @@ brcmf_nvram_handle_value(struct nvram_pa +- char *ekv; +- u32 cplen; +- +-- c = nvp->fwnv->data[nvp->pos]; +-+ c = nvp->data[nvp->pos]; +- if (!is_nvram_char(c)) { +- /* key,value pair complete */ +-- ekv = (u8 *)&nvp->fwnv->data[nvp->pos]; +-- skv = (u8 *)&nvp->fwnv->data[nvp->entry]; +-+ ekv = (u8 *)&nvp->data[nvp->pos]; +-+ skv = (u8 *)&nvp->data[nvp->entry]; +- cplen = ekv - skv; +- if (nvp->nvram_len + cplen + 1 >= BRCMF_FW_MAX_NVRAM_SIZE) +- return END; +-@@ -170,7 +170,7 @@ brcmf_nvram_handle_comment(struct nvram_ +- { +- char *eoc, *sol; +- +-- sol = (char *)&nvp->fwnv->data[nvp->pos]; +-+ sol = (char *)&nvp->data[nvp->pos]; +- eoc = strchr(sol, '\n'); +- if (!eoc) { +- eoc = strchr(sol, '\0'); +-@@ -201,17 +201,17 @@ static enum nvram_parser_state +- }; +- +- static int brcmf_init_nvram_parser(struct nvram_parser *nvp, +-- const struct firmware *nv) +-+ const u8 *data, size_t data_len) +- { +- size_t size; +- +- memset(nvp, 0, sizeof(*nvp)); +-- nvp->fwnv = nv; +-+ nvp->data = data; +- /* Limit size to MAX_NVRAM_SIZE, some files contain lot of comment */ +-- if (nv->size > BRCMF_FW_MAX_NVRAM_SIZE) +-+ if (data_len > BRCMF_FW_MAX_NVRAM_SIZE) +- size = BRCMF_FW_MAX_NVRAM_SIZE; +- else +-- size = nv->size; +-+ size = data_len; +- /* Alloc for extra 0 byte + roundup by 4 + length field */ +- size += 1 + 3 + sizeof(u32); +- nvp->nvram = kzalloc(size, GFP_KERNEL); +-@@ -362,18 +362,18 @@ fail: +- * and converts newlines to NULs. Shortens buffer as needed and pads with NULs. +- * End of buffer is completed with token identifying length of buffer. +- */ +--static void *brcmf_fw_nvram_strip(const struct firmware *nv, u32 *new_length, +-- u16 domain_nr, u16 bus_nr) +-+static void *brcmf_fw_nvram_strip(const u8 *data, size_t data_len, +-+ u32 *new_length, u16 domain_nr, u16 bus_nr) +- { +- struct nvram_parser nvp; +- u32 pad; +- u32 token; +- __le32 token_le; +- +-- if (brcmf_init_nvram_parser(&nvp, nv) < 0) +-+ if (brcmf_init_nvram_parser(&nvp, data, data_len) < 0) +- return NULL; +- +-- while (nvp.pos < nv->size) { +-+ while (nvp.pos < data_len) { +- nvp.state = nv_parser_states[nvp.state](&nvp); +- if (nvp.state == END) +- break; +-@@ -432,7 +432,7 @@ static void brcmf_fw_request_nvram_done( +- goto fail; +- +- if (fw) { +-- nvram = brcmf_fw_nvram_strip(fw, &nvram_length, +-+ nvram = brcmf_fw_nvram_strip(fw->data, fw->size, &nvram_length, +- 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 +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 ++++ /dev/null +@@ -1,32 +0,0 @@ +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Sat, 6 Jun 2015 22:45:59 +0200 +-Subject: [PATCH] b43: fix support for 14e4:4321 PCI dev with BCM4321 chipset +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-It seems Broadcom released two devices with conflicting device id. There +-are for sure 14e4:4321 PCI devices with BCM4321 (N-PHY) chipset, they +-can be found in routers, e.g. Netgear WNR834Bv2. However, according to +-Broadcom public sources 0x4321 is also used for 5 GHz BCM4306 (G-PHY). +-It's unsure if they meant PCI device id, or "virtual" id (from SPROM). +-To distinguish these devices lets check PHY type (G vs. N). +- +-Signed-off-by: Rafał Miłecki +-Cc: # 3.16+ +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/b43/main.c +-+++ b/drivers/net/wireless/b43/main.c +-@@ -5365,6 +5365,10 @@ static void b43_supported_bands(struct b +- *have_5ghz_phy = true; +- return; +- case 0x4321: /* BCM4306 */ +-+ /* There are 14e4:4321 PCI devs with 2.4 GHz BCM4321 (N-PHY) */ +-+ if (dev->phy.type != B43_PHYTYPE_G) +-+ break; +-+ /* fall through */ +- 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 +deleted file mode 100644 +index bddb15a..0000000 +--- a/package/kernel/mac80211/patches/384-ath9k-force-rx_clear-when-disabling-rx.patch ++++ /dev/null +@@ -1,31 +0,0 @@ +-From: Felix Fietkau +-Date: Sun, 7 Jun 2015 13:53:35 +0200 +-Subject: [PATCH] ath9k: force rx_clear when disabling rx +- +-This makes stopping Rx more reliable and should reduce the frequency of +-Rx related DMA stop warnings +- +-Cc: stable@vger.kernel.org +-Signed-off-by: Felix Fietkau +---- +- +---- a/drivers/net/wireless/ath/ath9k/mac.c +-+++ b/drivers/net/wireless/ath/ath9k/mac.c +-@@ -677,13 +677,15 @@ void ath9k_hw_startpcureceive(struct ath +- +- ath9k_ani_reset(ah, is_scanning); +- +-- REG_CLR_BIT(ah, AR_DIAG_SW, (AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT)); +-+ REG_CLR_BIT(ah, AR_DIAG_SW, +-+ AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT | AR_DIAG_FORCE_RX_CLEAR); +- } +- EXPORT_SYMBOL(ath9k_hw_startpcureceive); +- +- void ath9k_hw_abortpcurecv(struct ath_hw *ah) +- { +-- REG_SET_BIT(ah, AR_DIAG_SW, AR_DIAG_RX_ABORT | AR_DIAG_RX_DIS); +-+ REG_SET_BIT(ah, AR_DIAG_SW, +-+ AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT | AR_DIAG_FORCE_RX_CLEAR); +- +- 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 +deleted file mode 100644 +index 74df9f9..0000000 +--- a/package/kernel/mac80211/patches/385-brcmfmac-Update-msgbuf-read-pointer-quicker.patch ++++ /dev/null +@@ -1,109 +0,0 @@ +-From: Hante Meuleman +-Date: Mon, 8 Jun 2015 14:38:32 +0200 +-Subject: [PATCH] brcmfmac: Update msgbuf read pointer quicker. +- +-On device to host data using msgbuf the read pointer gets updated +-once all data is processed. Updating this pointer more frequently +-allows the firmware to add more data quicker. This will result in +-slightly higher and more stable throughput on CPU bounded host +-processors. +- +-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/commonring.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/commonring.c +-@@ -223,8 +223,6 @@ void brcmf_commonring_write_cancel(struc +- void *brcmf_commonring_get_read_ptr(struct brcmf_commonring *commonring, +- u16 *n_items) +- { +-- void *ret_addr; +-- +- if (commonring->cr_update_wptr) +- commonring->cr_update_wptr(commonring->cr_ctx); +- +-@@ -235,19 +233,18 @@ void *brcmf_commonring_get_read_ptr(stru +- if (*n_items == 0) +- return NULL; +- +-- ret_addr = commonring->buf_addr + +-- (commonring->r_ptr * commonring->item_len); +-- +-- commonring->r_ptr += *n_items; +-- if (commonring->r_ptr == commonring->depth) +-- commonring->r_ptr = 0; +-- +-- return ret_addr; +-+ return commonring->buf_addr + +-+ (commonring->r_ptr * commonring->item_len); +- } +- +- +--int brcmf_commonring_read_complete(struct brcmf_commonring *commonring) +-+int brcmf_commonring_read_complete(struct brcmf_commonring *commonring, +-+ u16 n_items) +- { +-+ commonring->r_ptr += n_items; +-+ if (commonring->r_ptr == commonring->depth) +-+ commonring->r_ptr = 0; +-+ +- if (commonring->cr_write_rptr) +- return commonring->cr_write_rptr(commonring->cr_ctx); +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/commonring.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/commonring.h +-@@ -62,7 +62,8 @@ void brcmf_commonring_write_cancel(struc +- u16 n_items); +- void *brcmf_commonring_get_read_ptr(struct brcmf_commonring *commonring, +- u16 *n_items); +--int brcmf_commonring_read_complete(struct brcmf_commonring *commonring); +-+int brcmf_commonring_read_complete(struct brcmf_commonring *commonring, +-+ u16 n_items); +- +- #define brcmf_commonring_n_items(commonring) (commonring->depth) +- #define brcmf_commonring_len_item(commonring) (commonring->item_len) +---- a/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c +-@@ -75,6 +75,8 @@ +- +- #define BRCMF_MSGBUF_DELAY_TXWORKER_THRS 96 +- #define BRCMF_MSGBUF_TRICKLE_TXWORKER_THRS 32 +-+#define BRCMF_MSGBUF_UPDATE_RX_PTR_THRS 48 +-+ +- +- struct msgbuf_common_hdr { +- u8 msgtype; +-@@ -1257,19 +1259,27 @@ static void brcmf_msgbuf_process_rx(stru +- { +- void *buf; +- u16 count; +-+ u16 processed; +- +- again: +- buf = brcmf_commonring_get_read_ptr(commonring, &count); +- if (buf == NULL) +- return; +- +-+ processed = 0; +- while (count) { +- brcmf_msgbuf_process_msgtype(msgbuf, +- buf + msgbuf->rx_dataoffset); +- buf += brcmf_commonring_len_item(commonring); +-+ processed++; +-+ if (processed == BRCMF_MSGBUF_UPDATE_RX_PTR_THRS) { +-+ brcmf_commonring_read_complete(commonring, processed); +-+ processed = 0; +-+ } +- count--; +- } +-- brcmf_commonring_read_complete(commonring); +-+ if (processed) +-+ brcmf_commonring_read_complete(commonring, processed); +- +- 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 +deleted file mode 100644 +index 9e5b486..0000000 +--- a/package/kernel/mac80211/patches/386-brcmfmac-remove-chipinfo-debugfs-entry.patch ++++ /dev/null +@@ -1,39 +0,0 @@ +-From: Arend van Spriel +-Date: Mon, 8 Jun 2015 14:38:33 +0200 +-Subject: [PATCH] brcmfmac: remove chipinfo debugfs entry +- +-The information provided by chipinfo is also provided by the +-revinfo debugfs entry. Removing it from debugfs. +- +-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.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/debug.c +-@@ -41,15 +41,6 @@ void brcmf_debugfs_exit(void) +- root_folder = NULL; +- } +- +--static int brcmf_debugfs_chipinfo_read(struct seq_file *seq, void *data) +--{ +-- struct brcmf_bus *bus = dev_get_drvdata(seq->private); +-- +-- seq_printf(seq, "chip: %x(%u) rev %u\n", +-- bus->chip, bus->chip, bus->chiprev); +-- return 0; +--} +-- +- int brcmf_debugfs_attach(struct brcmf_pub *drvr) +- { +- struct device *dev = drvr->bus_if->dev; +-@@ -58,7 +49,6 @@ int brcmf_debugfs_attach(struct brcmf_pu +- return -ENODEV; +- +- drvr->dbgfs_dir = debugfs_create_dir(dev_name(dev), root_folder); +-- brcmf_debugfs_add_entry(drvr, "chipinfo", brcmf_debugfs_chipinfo_read); +- +- 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 +deleted file mode 100644 +index c38b2cd..0000000 +--- a/package/kernel/mac80211/patches/387-brcmfmac-remove-watchdog-reset-from-brcmf_pcie_busco.patch ++++ /dev/null +@@ -1,53 +0,0 @@ +-From: Arend van Spriel +-Date: Mon, 8 Jun 2015 14:38:34 +0200 +-Subject: [PATCH] brcmfmac: remove watchdog reset from +- brcmf_pcie_buscoreprep() +- +-The watchdog reset as done in brcmf_pcie_buscoreprep() is not +-sufficient. It needs to modify PCIe core registers as well +-which is properly done by brcmf_pcie_reset_device() after the +-chip recognition is done. So the faulty watchdog reset can be +-removed as it was causing driver reload to fail and hang the +-system requiring a power-cycle. Instead the call to to the +-brcmf_pcie_reset_device() function is done twice in the unload. +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Daniel (Deognyoun) Kim +-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/pcie.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c +-@@ -1629,20 +1629,7 @@ static void brcmf_pcie_buscore_write32(v +- +- static int brcmf_pcie_buscoreprep(void *ctx) +- { +-- struct brcmf_pciedev_info *devinfo = (struct brcmf_pciedev_info *)ctx; +-- int err; +-- +-- err = brcmf_pcie_get_resource(devinfo); +-- if (err == 0) { +-- /* Set CC watchdog to reset all the cores on the chip to bring +-- * back dongle to a sane state. +-- */ +-- brcmf_pcie_buscore_write32(ctx, CORE_CC_REG(SI_ENUM_BASE, +-- watchdog), 4); +-- msleep(100); +-- } +-- +-- return err; +-+ return brcmf_pcie_get_resource(ctx); +- } +- +- +-@@ -1824,6 +1811,7 @@ brcmf_pcie_remove(struct pci_dev *pdev) +- brcmf_pcie_intr_disable(devinfo); +- +- brcmf_detach(&pdev->dev); +-+ brcmf_pcie_reset_device(devinfo); +- +- 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 +deleted file mode 100644 +index 756fbb2..0000000 +--- a/package/kernel/mac80211/patches/388-brcmfmac-use-debugfs_create_devm_seqfile-helper-func.patch ++++ /dev/null +@@ -1,69 +0,0 @@ +-From: Arend van Spriel +-Date: Mon, 8 Jun 2015 14:38:35 +0200 +-Subject: [PATCH] brcmfmac: use debugfs_create_devm_seqfile() helper +- function +- +-Some time ago the function debugfs_create_devm_seqfile() was +-introduced in debugfs. The caller simply needs to provide a +-device pointer and read function. The function brcmf_debugfs_add_entry() +-is now simply a wrapper only doing the work for CONFIG_BRCMDBG. +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Daniel (Deognyoun) Kim +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/debug.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/debug.c +-@@ -64,44 +64,12 @@ struct dentry *brcmf_debugfs_get_devdir( +- return drvr->dbgfs_dir; +- } +- +--struct brcmf_debugfs_entry { +-- int (*read)(struct seq_file *seq, void *data); +-- struct brcmf_pub *drvr; +--}; +-- +--static int brcmf_debugfs_entry_open(struct inode *inode, struct file *f) +--{ +-- struct brcmf_debugfs_entry *entry = inode->i_private; +-- +-- return single_open(f, entry->read, entry->drvr->bus_if->dev); +--} +-- +--static const struct file_operations brcmf_debugfs_def_ops = { +-- .owner = THIS_MODULE, +-- .open = brcmf_debugfs_entry_open, +-- .release = single_release, +-- .read = seq_read, +-- .llseek = seq_lseek +--}; +-- +- int brcmf_debugfs_add_entry(struct brcmf_pub *drvr, const char *fn, +- int (*read_fn)(struct seq_file *seq, void *data)) +- { +-- struct dentry *dentry = drvr->dbgfs_dir; +-- struct brcmf_debugfs_entry *entry; +-- +-- if (IS_ERR_OR_NULL(dentry)) +-- return -ENOENT; +-- +-- entry = devm_kzalloc(drvr->bus_if->dev, sizeof(*entry), GFP_KERNEL); +-- if (!entry) +-- return -ENOMEM; +-- +-- entry->read = read_fn; +-- entry->drvr = drvr; +-- +-- dentry = debugfs_create_file(fn, S_IRUGO, dentry, entry, +-- &brcmf_debugfs_def_ops); +-+ struct dentry *e; +- +-- return PTR_ERR_OR_ZERO(dentry); +-+ e = debugfs_create_devm_seqfile(drvr->bus_if->dev, fn, +-+ 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 +deleted file mode 100644 +index ff24a4a..0000000 +--- a/package/kernel/mac80211/patches/389-0001-brcmfmac-Check-if-firmware-supports-p2p.patch ++++ /dev/null +@@ -1,42 +0,0 @@ +-From: Pontus Fuchs +-Date: Thu, 11 Jun 2015 00:12:17 +0200 +-Subject: [PATCH] brcmfmac: Check if firmware supports p2p +- +-Add a feature flag to reflect the firmware's p2p capability. +- +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Hante Meuleman +-Reviewed-by: Arend Van Spriel +-Signed-off-by: Pontus Fuchs +-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 +-@@ -129,6 +129,7 @@ void brcmf_feat_attach(struct brcmf_pub +- brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_WOWL, "wowl"); +- 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"); +- +- /* set chip related quirks */ +- switch (drvr->bus_if->chip) { +---- a/drivers/net/wireless/brcm80211/brcmfmac/feature.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/feature.h +-@@ -23,12 +23,14 @@ +- * MCHAN: multi-channel for concurrent P2P. +- * PNO: preferred network offload. +- * WOWL: Wake-On-WLAN. +-+ * P2P: peer-to-peer +- */ +- #define BRCMF_FEAT_LIST \ +- BRCMF_FEAT_DEF(MBSS) \ +- BRCMF_FEAT_DEF(MCHAN) \ +- BRCMF_FEAT_DEF(PNO) \ +-- BRCMF_FEAT_DEF(WOWL) +-+ BRCMF_FEAT_DEF(WOWL) \ +-+ BRCMF_FEAT_DEF(P2P) +- /* +- * 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 +deleted file mode 100644 +index 3876ba0..0000000 +--- a/package/kernel/mac80211/patches/389-0002-brcmfmac-Build-wiphy-mode-and-interface-combinations.patch ++++ /dev/null +@@ -1,198 +0,0 @@ +-From: Pontus Fuchs +-Date: Thu, 11 Jun 2015 00:12:18 +0200 +-Subject: [PATCH] brcmfmac: Build wiphy mode and interface combinations +- dynamically +- +-Switch from using semi hard coded interface combinations. This makes +-it easier to announce what the firmware actually supports. This fixes +-the case where brcmfmac announces p2p but the firmware doesn't +-support it. +- +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Hante Meuleman +-Reviewed-by: Arend Van Spriel +-Signed-off-by: Pontus Fuchs +-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 +-@@ -52,8 +52,6 @@ +- #define BRCMF_PNO_SCAN_COMPLETE 1 +- #define BRCMF_PNO_SCAN_INCOMPLETE 0 +- +--#define BRCMF_IFACE_MAX_CNT 3 +-- +- #define WPA_OUI "\x00\x50\xF2" /* WPA OUI */ +- #define WPA_OUI_TYPE 1 +- #define RSN_OUI "\x00\x0F\xAC" /* RSN OUI */ +-@@ -5639,53 +5637,6 @@ static int brcmf_setup_wiphybands(struct +- return 0; +- } +- +--static const struct ieee80211_iface_limit brcmf_iface_limits_mbss[] = { +-- { +-- .max = 1, +-- .types = BIT(NL80211_IFTYPE_STATION) | +-- BIT(NL80211_IFTYPE_ADHOC) +-- }, +-- { +-- .max = 4, +-- .types = BIT(NL80211_IFTYPE_AP) +-- }, +-- { +-- .max = 1, +-- .types = BIT(NL80211_IFTYPE_P2P_CLIENT) | +-- BIT(NL80211_IFTYPE_P2P_GO) +-- }, +-- { +-- .max = 1, +-- .types = BIT(NL80211_IFTYPE_P2P_DEVICE) +-- } +--}; +-- +--static const struct ieee80211_iface_limit brcmf_iface_limits_sbss[] = { +-- { +-- .max = 2, +-- .types = BIT(NL80211_IFTYPE_STATION) | +-- BIT(NL80211_IFTYPE_ADHOC) | +-- BIT(NL80211_IFTYPE_AP) +-- }, +-- { +-- .max = 1, +-- .types = BIT(NL80211_IFTYPE_P2P_CLIENT) | +-- BIT(NL80211_IFTYPE_P2P_GO) +-- }, +-- { +-- .max = 1, +-- .types = BIT(NL80211_IFTYPE_P2P_DEVICE) +-- } +--}; +--static struct ieee80211_iface_combination brcmf_iface_combos[] = { +-- { +-- .max_interfaces = BRCMF_IFACE_MAX_CNT, +-- .num_different_channels = 1, +-- .n_limits = ARRAY_SIZE(brcmf_iface_limits_sbss), +-- .limits = brcmf_iface_limits_sbss, +-- } +--}; +-- +- static const struct ieee80211_txrx_stypes +- brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = { +- [NL80211_IFTYPE_STATION] = { +-@@ -5715,6 +5666,67 @@ brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = +- } +- }; +- +-+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; +-+ +-+ combo = kzalloc(sizeof(*combo), GFP_KERNEL); +-+ if (!combo) +-+ goto err; +-+ +-+ limits = kzalloc(sizeof(*limits) * 4, GFP_KERNEL); +-+ if (!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)) { +-+ 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; +-+ +-+ wiphy->iface_combinations = combo; +-+ wiphy->n_iface_combinations = 1; +-+ return 0; +-+ +-+err: +-+ kfree(limits); +-+ kfree(combo); +-+ return -ENOMEM; +-+} +-+ +- static void brcmf_wiphy_pno_params(struct wiphy *wiphy) +- { +- /* scheduled scan settings */ +-@@ -5745,7 +5757,6 @@ static void brcmf_wiphy_wowl_params(stru +- static int brcmf_setup_wiphy(struct wiphy *wiphy, struct brcmf_if *ifp) +- { +- struct ieee80211_supported_band *band; +-- struct ieee80211_iface_combination ifc_combo; +- __le32 bandlist[3]; +- u32 n_bands; +- int err, i; +-@@ -5753,24 +5764,11 @@ static int brcmf_setup_wiphy(struct wiph +- wiphy->max_scan_ssids = WL_NUM_SCAN_MAX; +- wiphy->max_scan_ie_len = BRCMF_SCAN_IE_LEN_MAX; +- wiphy->max_num_pmkids = WL_NUM_PMKIDS_MAX; +-- wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | +-- BIT(NL80211_IFTYPE_ADHOC) | +-- BIT(NL80211_IFTYPE_AP) | +-- BIT(NL80211_IFTYPE_P2P_CLIENT) | +-- BIT(NL80211_IFTYPE_P2P_GO) | +-- BIT(NL80211_IFTYPE_P2P_DEVICE); +-- /* need VSDB firmware feature for concurrent channels */ +-- ifc_combo = brcmf_iface_combos[0]; +-- if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MCHAN)) +-- ifc_combo.num_different_channels = 2; +-- if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS)) { +-- ifc_combo.n_limits = ARRAY_SIZE(brcmf_iface_limits_mbss), +-- ifc_combo.limits = brcmf_iface_limits_mbss; +-- } +-- wiphy->iface_combinations = kmemdup(&ifc_combo, +-- sizeof(ifc_combo), +-- GFP_KERNEL); +-- wiphy->n_iface_combinations = ARRAY_SIZE(brcmf_iface_combos); +-+ +-+ err = brcmf_setup_ifmodes(wiphy, ifp); +-+ if (err) +-+ return err; +-+ +- wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; +- wiphy->cipher_suites = __wl_cipher_suites; +- wiphy->n_cipher_suites = ARRAY_SIZE(__wl_cipher_suites); +-@@ -6035,6 +6033,8 @@ static void brcmf_free_wiphy(struct wiph +- if (!wiphy) +- return; +- +-+ if (wiphy->iface_combinations) +-+ kfree(wiphy->iface_combinations->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/389-0003-brcmfmac-rework-.get_station-callback.patch b/package/kernel/mac80211/patches/389-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 ++++ /dev/null +@@ -1,326 +0,0 @@ +-From: Arend van Spriel +-Date: Thu, 11 Jun 2015 00:12:19 +0200 +-Subject: [PATCH] brcmfmac: rework .get_station() callback +- +-The .get_station() cfg80211 callback is used in several scenarios. In +-managed mode it can obtain information about the access-point and its +-BSS parameters. In managed mode it can also obtain information about +-TDLS peers. In AP mode it can obtain information about connected +-clients. +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Daniel (Deognyoun) Kim +-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 +-@@ -2395,27 +2395,80 @@ brcmf_cfg80211_reconfigure_wep(struct br +- brcmf_err("set wsec error (%d)\n", err); +- } +- +-+static void brcmf_convert_sta_flags(u32 fw_sta_flags, struct station_info *si) +-+{ +-+ struct nl80211_sta_flag_update *sfu; +-+ +-+ brcmf_dbg(TRACE, "flags %08x\n", fw_sta_flags); +-+ si->filled |= BIT(NL80211_STA_INFO_STA_FLAGS); +-+ sfu = &si->sta_flags; +-+ sfu->mask = BIT(NL80211_STA_FLAG_WME) | +-+ BIT(NL80211_STA_FLAG_AUTHENTICATED) | +-+ BIT(NL80211_STA_FLAG_ASSOCIATED) | +-+ BIT(NL80211_STA_FLAG_AUTHORIZED); +-+ if (fw_sta_flags & BRCMF_STA_WME) +-+ sfu->set |= BIT(NL80211_STA_FLAG_WME); +-+ if (fw_sta_flags & BRCMF_STA_AUTHE) +-+ sfu->set |= BIT(NL80211_STA_FLAG_AUTHENTICATED); +-+ if (fw_sta_flags & BRCMF_STA_ASSOC) +-+ sfu->set |= BIT(NL80211_STA_FLAG_ASSOCIATED); +-+ if (fw_sta_flags & BRCMF_STA_AUTHO) +-+ sfu->set |= BIT(NL80211_STA_FLAG_AUTHORIZED); +-+} +-+ +-+static void brcmf_fill_bss_param(struct brcmf_if *ifp, struct station_info *si) +-+{ +-+ struct { +-+ __le32 len; +-+ struct brcmf_bss_info_le bss_le; +-+ } *buf; +-+ u16 capability; +-+ int err; +-+ +-+ buf = kzalloc(WL_BSS_INFO_MAX, GFP_KERNEL); +-+ if (!buf) +-+ return; +-+ +-+ buf->len = cpu_to_le32(WL_BSS_INFO_MAX); +-+ err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BSS_INFO, buf, +-+ WL_BSS_INFO_MAX); +-+ if (err) { +-+ brcmf_err("Failed to get bss info (%d)\n", err); +-+ return; +-+ } +-+ si->filled |= BIT(NL80211_STA_INFO_BSS_PARAM); +-+ si->bss_param.beacon_interval = le16_to_cpu(buf->bss_le.beacon_period); +-+ si->bss_param.dtim_period = buf->bss_le.dtim_period; +-+ capability = le16_to_cpu(buf->bss_le.capability); +-+ if (capability & IEEE80211_HT_STBC_PARAM_DUAL_CTS_PROT) +-+ si->bss_param.flags |= BSS_PARAM_FLAGS_CTS_PROT; +-+ if (capability & WLAN_CAPABILITY_SHORT_PREAMBLE) +-+ si->bss_param.flags |= BSS_PARAM_FLAGS_SHORT_PREAMBLE; +-+ if (capability & WLAN_CAPABILITY_SHORT_SLOT_TIME) +-+ si->bss_param.flags |= BSS_PARAM_FLAGS_SHORT_SLOT_TIME; +-+} +-+ +- static s32 +- brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev, +- const u8 *mac, struct station_info *sinfo) +- { +- struct brcmf_if *ifp = netdev_priv(ndev); +-- struct brcmf_cfg80211_profile *profile = &ifp->vif->profile; +-- struct brcmf_scb_val_le scb_val; +-- int rssi; +-- s32 rate; +- s32 err = 0; +-- u8 *bssid = profile->bssid; +- struct brcmf_sta_info_le sta_info_le; +-- u32 beacon_period; +-- u32 dtim_period; +-+ u32 sta_flags; +-+ u32 is_tdls_peer; +- +- brcmf_dbg(TRACE, "Enter, MAC %pM\n", mac); +- if (!check_vif_up(ifp->vif)) +- return -EIO; +- +-- if (brcmf_is_apmode(ifp->vif)) { +-- memcpy(&sta_info_le, mac, ETH_ALEN); +-+ memset(&sta_info_le, 0, sizeof(sta_info_le)); +-+ memcpy(&sta_info_le, mac, ETH_ALEN); +-+ err = brcmf_fil_iovar_data_get(ifp, "tdls_sta_info", +-+ &sta_info_le, +-+ sizeof(sta_info_le)); +-+ is_tdls_peer = !err; +-+ if (err) { +- err = brcmf_fil_iovar_data_get(ifp, "sta_info", +- &sta_info_le, +- sizeof(sta_info_le)); +-@@ -2423,73 +2476,48 @@ brcmf_cfg80211_get_station(struct wiphy +- brcmf_err("GET STA INFO failed, %d\n", err); +- goto done; +- } +-- sinfo->filled = BIT(NL80211_STA_INFO_INACTIVE_TIME); +-- sinfo->inactive_time = le32_to_cpu(sta_info_le.idle) * 1000; +-- if (le32_to_cpu(sta_info_le.flags) & BRCMF_STA_ASSOC) { +-- sinfo->filled |= BIT(NL80211_STA_INFO_CONNECTED_TIME); +-- sinfo->connected_time = le32_to_cpu(sta_info_le.in); +-- } +-- brcmf_dbg(TRACE, "STA idle time : %d ms, connected time :%d sec\n", +-- sinfo->inactive_time, sinfo->connected_time); +-- } else if (ifp->vif->wdev.iftype == NL80211_IFTYPE_STATION) { +-- if (memcmp(mac, bssid, ETH_ALEN)) { +-- brcmf_err("Wrong Mac address cfg_mac-%pM wl_bssid-%pM\n", +-- mac, bssid); +-- err = -ENOENT; +-- goto done; +-- } +-- /* Report the current tx rate */ +-- err = brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_RATE, &rate); +-- if (err) { +-- brcmf_err("Could not get rate (%d)\n", err); +-- goto done; +-- } else { +-+ } +-+ brcmf_dbg(TRACE, "version %d\n", le16_to_cpu(sta_info_le.ver)); +-+ sinfo->filled = BIT(NL80211_STA_INFO_INACTIVE_TIME); +-+ sinfo->inactive_time = le32_to_cpu(sta_info_le.idle) * 1000; +-+ sta_flags = le32_to_cpu(sta_info_le.flags); +-+ brcmf_convert_sta_flags(sta_flags, sinfo); +-+ sinfo->sta_flags.mask |= BIT(NL80211_STA_FLAG_TDLS_PEER); +-+ if (is_tdls_peer) +-+ sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_TDLS_PEER); +-+ else +-+ sinfo->sta_flags.set &= ~BIT(NL80211_STA_FLAG_TDLS_PEER); +-+ if (sta_flags & BRCMF_STA_ASSOC) { +-+ sinfo->filled |= BIT(NL80211_STA_INFO_CONNECTED_TIME); +-+ sinfo->connected_time = le32_to_cpu(sta_info_le.in); +-+ brcmf_fill_bss_param(ifp, sinfo); +-+ } +-+ if (sta_flags & BRCMF_STA_SCBSTATS) { +-+ sinfo->filled |= BIT(NL80211_STA_INFO_TX_FAILED); +-+ sinfo->tx_failed = le32_to_cpu(sta_info_le.tx_failures); +-+ sinfo->filled |= BIT(NL80211_STA_INFO_TX_PACKETS); +-+ sinfo->tx_packets = le32_to_cpu(sta_info_le.tx_pkts); +-+ sinfo->tx_packets += le32_to_cpu(sta_info_le.tx_mcast_pkts); +-+ sinfo->filled |= BIT(NL80211_STA_INFO_RX_PACKETS); +-+ sinfo->rx_packets = le32_to_cpu(sta_info_le.rx_ucast_pkts); +-+ 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 = rate * 5; +-- brcmf_dbg(CONN, "Rate %d Mbps\n", rate / 2); +-+ sinfo->txrate.legacy = le32_to_cpu(sta_info_le.tx_rate); +-+ sinfo->txrate.legacy /= 100; +- } +-- +-- if (test_bit(BRCMF_VIF_STATUS_CONNECTED, +-- &ifp->vif->sme_state)) { +-- memset(&scb_val, 0, sizeof(scb_val)); +-- err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_RSSI, +-- &scb_val, sizeof(scb_val)); +-- if (err) { +-- brcmf_err("Could not get rssi (%d)\n", err); +-- goto done; +-- } else { +-- rssi = le32_to_cpu(scb_val.val); +-- sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL); +-- sinfo->signal = rssi; +-- brcmf_dbg(CONN, "RSSI %d dBm\n", rssi); +-- } +-- err = brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_BCNPRD, +-- &beacon_period); +-- if (err) { +-- brcmf_err("Could not get beacon period (%d)\n", +-- err); +-- goto done; +-- } else { +-- sinfo->bss_param.beacon_interval = +-- beacon_period; +-- brcmf_dbg(CONN, "Beacon peroid %d\n", +-- beacon_period); +-- } +-- err = brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_DTIMPRD, +-- &dtim_period); +-- if (err) { +-- brcmf_err("Could not get DTIM period (%d)\n", +-- err); +-- goto done; +-- } else { +-- sinfo->bss_param.dtim_period = dtim_period; +-- brcmf_dbg(CONN, "DTIM peroid %d\n", +-- dtim_period); +-- } +-- sinfo->filled |= BIT(NL80211_STA_INFO_BSS_PARAM); +-+ 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; +-+ } +-+ if (le16_to_cpu(sta_info_le.ver) >= 4) { +-+ sinfo->filled |= BIT(NL80211_STA_INFO_TX_BYTES); +-+ sinfo->tx_bytes = le64_to_cpu(sta_info_le.tx_tot_bytes); +-+ sinfo->filled |= BIT(NL80211_STA_INFO_RX_BYTES); +-+ sinfo->rx_bytes = le64_to_cpu(sta_info_le.rx_tot_bytes); +- } +-- } else +-- err = -EPERM; +-+ } +- done: +- brcmf_dbg(TRACE, "Exit\n"); +- return err; +---- a/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h +-@@ -32,7 +32,11 @@ +- #define BRCMF_BSS_INFO_VERSION 109 /* curr ver of brcmf_bss_info_le struct */ +- #define BRCMF_BSS_RSSI_ON_CHANNEL 0x0002 +- +--#define BRCMF_STA_ASSOC 0x10 /* Associated */ +-+#define BRCMF_STA_WME 0x00000002 /* WMM association */ +-+#define BRCMF_STA_AUTHE 0x00000008 /* Authenticated */ +-+#define BRCMF_STA_ASSOC 0x00000010 /* Associated */ +-+#define BRCMF_STA_AUTHO 0x00000020 /* Authorized */ +-+#define BRCMF_STA_SCBSTATS 0x00004000 /* Per STA debug stats */ +- +- /* size of brcmf_scan_params not including variable length array */ +- #define BRCMF_SCAN_PARAMS_FIXED_SIZE 64 +-@@ -113,6 +117,7 @@ +- #define BRCMF_WOWL_MAXPATTERNSIZE 128 +- +- #define BRCMF_COUNTRY_BUF_SZ 4 +-+#define BRCMF_ANT_MAX 4 +- +- /* join preference types for join_pref iovar */ +- enum brcmf_join_pref_types { +-@@ -456,25 +461,61 @@ struct brcmf_channel_info_le { +- }; +- +- struct brcmf_sta_info_le { +-- __le16 ver; /* version of this struct */ +-- __le16 len; /* length in bytes of this structure */ +-- __le16 cap; /* sta's advertised capabilities */ +-- __le32 flags; /* flags defined below */ +-- __le32 idle; /* time since data pkt rx'd from sta */ +-- u8 ea[ETH_ALEN]; /* Station address */ +-- __le32 count; /* # rates in this set */ +-- u8 rates[BRCMF_MAXRATES_IN_SET]; /* rates in 500kbps units */ +-+ __le16 ver; /* version of this struct */ +-+ __le16 len; /* length in bytes of this structure */ +-+ __le16 cap; /* sta's advertised capabilities */ +-+ __le32 flags; /* flags defined below */ +-+ __le32 idle; /* time since data pkt rx'd from sta */ +-+ u8 ea[ETH_ALEN]; /* Station address */ +-+ __le32 count; /* # rates in this set */ +-+ u8 rates[BRCMF_MAXRATES_IN_SET]; /* rates in 500kbps units */ +- /* w/hi bit set if basic */ +-- __le32 in; /* seconds elapsed since associated */ +-- __le32 listen_interval_inms; /* Min Listen interval in ms for STA */ +-- __le32 tx_pkts; /* # of packets transmitted */ +-- __le32 tx_failures; /* # of packets failed */ +-- __le32 rx_ucast_pkts; /* # of unicast packets received */ +-- __le32 rx_mcast_pkts; /* # of multicast packets received */ +-- __le32 tx_rate; /* Rate of last successful tx frame */ +-- __le32 rx_rate; /* Rate of last successful rx frame */ +-- __le32 rx_decrypt_succeeds; /* # of packet decrypted successfully */ +-- __le32 rx_decrypt_failures; /* # of packet decrypted failed */ +-+ __le32 in; /* seconds elapsed since associated */ +-+ __le32 listen_interval_inms; /* Min Listen interval in ms for STA */ +-+ __le32 tx_pkts; /* # of packets transmitted */ +-+ __le32 tx_failures; /* # of packets failed */ +-+ __le32 rx_ucast_pkts; /* # of unicast packets received */ +-+ __le32 rx_mcast_pkts; /* # of multicast packets received */ +-+ __le32 tx_rate; /* Rate of last successful tx frame */ +-+ __le32 rx_rate; /* Rate of last successful rx frame */ +-+ __le32 rx_decrypt_succeeds; /* # of packet decrypted successfully */ +-+ __le32 rx_decrypt_failures; /* # of packet decrypted failed */ +-+ __le32 tx_tot_pkts; /* # of tx pkts (ucast + mcast) */ +-+ __le32 rx_tot_pkts; /* # of data packets recvd (uni + mcast) */ +-+ __le32 tx_mcast_pkts; /* # of mcast pkts txed */ +-+ __le64 tx_tot_bytes; /* data bytes txed (ucast + mcast) */ +-+ __le64 rx_tot_bytes; /* data bytes recvd (ucast + mcast) */ +-+ __le64 tx_ucast_bytes; /* data bytes txed (ucast) */ +-+ __le64 tx_mcast_bytes; /* # data bytes txed (mcast) */ +-+ __le64 rx_ucast_bytes; /* data bytes recvd (ucast) */ +-+ __le64 rx_mcast_bytes; /* data bytes recvd (mcast) */ +-+ s8 rssi[BRCMF_ANT_MAX]; /* per antenna rssi */ +-+ s8 nf[BRCMF_ANT_MAX]; /* per antenna noise floor */ +-+ __le16 aid; /* association ID */ +-+ __le16 ht_capabilities; /* advertised ht caps */ +-+ __le16 vht_flags; /* converted vht flags */ +-+ __le32 tx_pkts_retry_cnt; /* # of frames where a retry was +-+ * exhausted. +-+ */ +-+ __le32 tx_pkts_retry_exhausted; /* # of user frames where a retry +-+ * was exhausted +-+ */ +-+ s8 rx_lastpkt_rssi[BRCMF_ANT_MAX]; /* Per antenna RSSI of last +-+ * received data frame. +-+ */ +-+ /* TX WLAN retry/failure statistics: +-+ * Separated for host requested frames and locally generated frames. +-+ * Include unicast frame only where the retries/failures can be counted. +-+ */ +-+ __le32 tx_pkts_total; /* # user frames sent successfully */ +-+ __le32 tx_pkts_retries; /* # user frames retries */ +-+ __le32 tx_pkts_fw_total; /* # FW generated sent successfully */ +-+ __le32 tx_pkts_fw_retries; /* # retries for FW generated frames */ +-+ __le32 tx_pkts_fw_retry_exhausted; /* # FW generated where a retry +-+ * was exhausted +-+ */ +-+ __le32 rx_pkts_retried; /* # rx with retry bit set */ +-+ __le32 tx_rate_fallback; /* lowest fallback TX rate */ +- }; +- +- 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 +deleted file mode 100644 +index 302bc3e..0000000 +--- a/package/kernel/mac80211/patches/389-0004-brcmfmac-have-sdio-return-EIO-when-device-communicat.patch ++++ /dev/null +@@ -1,56 +0,0 @@ +-From: Arend van Spriel +-Date: Thu, 11 Jun 2015 00:12:20 +0200 +-Subject: [PATCH] brcmfmac: have sdio return -EIO when device communication +- is not possible +- +-The bus interface functions txctl and rxctl may be used while the device +-can not be accessed, eg. upon driver .remove() callback. This patch will +-immediately return -EIO when this is the case which speeds up the module +-unload. +- +-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/bcmsdh.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +-@@ -988,6 +988,7 @@ static void brcmf_sdiod_freezer_detach(s +- +- static int brcmf_sdiod_remove(struct brcmf_sdio_dev *sdiodev) +- { +-+ sdiodev->state = BRCMF_SDIOD_DOWN; +- if (sdiodev->bus) { +- brcmf_sdio_remove(sdiodev->bus); +- sdiodev->bus = NULL; +---- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c +-@@ -2820,6 +2820,8 @@ static int brcmf_sdio_bus_txdata(struct +- struct brcmf_sdio *bus = sdiodev->bus; +- +- brcmf_dbg(TRACE, "Enter: pkt: data %p len %d\n", pkt->data, pkt->len); +-+ if (sdiodev->state != BRCMF_SDIOD_DATA) +-+ return -EIO; +- +- /* Add space for the header */ +- skb_push(pkt, bus->tx_hdrlen); +-@@ -2948,6 +2950,8 @@ brcmf_sdio_bus_txctl(struct device *dev, +- int ret; +- +- brcmf_dbg(TRACE, "Enter\n"); +-+ if (sdiodev->state != BRCMF_SDIOD_DATA) +-+ return -EIO; +- +- /* Send from dpc */ +- bus->ctrl_frame_buf = msg; +-@@ -3238,6 +3242,8 @@ brcmf_sdio_bus_rxctl(struct device *dev, +- struct brcmf_sdio *bus = sdiodev->bus; +- +- brcmf_dbg(TRACE, "Enter\n"); +-+ if (sdiodev->state != BRCMF_SDIOD_DATA) +-+ return -EIO; +- +- /* 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 +deleted file mode 100644 +index 34af6d2..0000000 +--- a/package/kernel/mac80211/patches/389-0005-ath9k-make-DMA-stop-related-messages-debug-only.patch ++++ /dev/null +@@ -1,74 +0,0 @@ +-From: Felix Fietkau +-Date: Thu, 2 Jul 2015 13:35:05 +0200 +-Subject: [PATCH] ath9k: make DMA stop related messages debug-only +- +-A long time ago, ath9k had issues during reset where the DMA engine +-would stay active and could potentially corrupt memory. +-To debug those issues, the driver would print warnings whenever they +-occur. +- +-Nowadays, these issues are gone and the primary cause of these messages +-is if the MAC is stuck during reset or busy processing a long +-transmission. This is fairly harmless, yet these messages continue to +-worry users. +- +-To reduce the number of bogus bug reports, turn these messages into +-debug messages and count their occurence in the "reset" debugfs file. +- +-Signed-off-by: Felix Fietkau +---- +- +---- a/drivers/net/wireless/ath/ath9k/debug.c +-+++ b/drivers/net/wireless/ath/ath9k/debug.c +-@@ -765,6 +765,8 @@ static int read_file_reset(struct seq_fi +- [RESET_TYPE_BEACON_STUCK] = "Stuck Beacon", +- [RESET_TYPE_MCI] = "MCI Reset", +- [RESET_TYPE_CALIBRATION] = "Calibration error", +-+ [RESET_TX_DMA_ERROR] = "Tx DMA stop error", +-+ [RESET_RX_DMA_ERROR] = "Rx DMA stop error", +- }; +- int i; +- +---- a/drivers/net/wireless/ath/ath9k/debug.h +-+++ b/drivers/net/wireless/ath/ath9k/debug.h +-@@ -50,6 +50,8 @@ enum ath_reset_type { +- RESET_TYPE_BEACON_STUCK, +- RESET_TYPE_MCI, +- RESET_TYPE_CALIBRATION, +-+ RESET_TX_DMA_ERROR, +-+ RESET_RX_DMA_ERROR, +- __RESET_TYPE_MAX +- }; +- +---- a/drivers/net/wireless/ath/ath9k/recv.c +-+++ b/drivers/net/wireless/ath/ath9k/recv.c +-@@ -496,10 +496,9 @@ bool ath_stoprecv(struct ath_softc *sc) +- +- if (!(ah->ah_flags & AH_UNPLUGGED) && +- unlikely(!stopped)) { +-- ath_err(ath9k_hw_common(sc->sc_ah), +-- "Could not stop RX, we could be " +-- "confusing the DMA engine when we start RX up\n"); +-- ATH_DBG_WARN_ON_ONCE(!stopped); +-+ ath_dbg(ath9k_hw_common(sc->sc_ah), RESET, +-+ "Failed to stop Rx DMA\n"); +-+ RESET_STAT_INC(sc, RESET_RX_DMA_ERROR); +- } +- return stopped && !reset; +- } +---- a/drivers/net/wireless/ath/ath9k/xmit.c +-+++ b/drivers/net/wireless/ath/ath9k/xmit.c +-@@ -1896,8 +1896,11 @@ bool ath_drain_all_txq(struct ath_softc +- npend |= BIT(i); +- } +- +-- if (npend) +-- ath_err(common, "Failed to stop TX DMA, queues=0x%03x!\n", npend); +-+ if (npend) { +-+ RESET_STAT_INC(sc, RESET_TX_DMA_ERROR); +-+ ath_dbg(common, RESET, +-+ "Failed to stop TX DMA, queues=0x%03x!\n", npend); +-+ } +- +- 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 +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 ++++ /dev/null +@@ -1,44 +0,0 @@ +-From: Arend van Spriel +-Date: Thu, 11 Jun 2015 00:12:21 +0200 +-Subject: [PATCH] brcmfmac: free ifp for non-netdev interface in p2p module +- +-Making it more clear by freeing the ifp in same place where the +-vif object is freed. +- +-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/core.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c +-@@ -867,8 +867,6 @@ static void brcmf_del_if(struct brcmf_pu +- } +- /* unregister will take care of freeing it */ +- unregister_netdev(ifp->ndev); +-- } else { +-- kfree(ifp); +- } +- } +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +-@@ -2238,6 +2238,7 @@ static void brcmf_p2p_delete_p2pdev(stru +- { +- cfg80211_unregister_wdev(&vif->wdev); +- p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; +-+ kfree(vif->ifp); +- brcmf_free_vif(vif); +- } +- +-@@ -2361,6 +2362,8 @@ int brcmf_p2p_del_vif(struct wiphy *wiph +- break; +- +- case NL80211_IFTYPE_P2P_DEVICE: +-+ brcmf_p2p_cancel_remain_on_channel(vif->ifp); +-+ brcmf_p2p_deinit_discovery(p2p); +- 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 +deleted file mode 100644 +index 0a6e093..0000000 +--- a/package/kernel/mac80211/patches/389-0007-brcmfmac-move-p2p-attach-detach-functions.patch ++++ /dev/null +@@ -1,225 +0,0 @@ +-From: Arend van Spriel +-Date: Thu, 11 Jun 2015 00:12:22 +0200 +-Subject: [PATCH] brcmfmac: move p2p attach/detach functions +- +-Moving two functions in p2p.c as is so next change will be +-easier to review. +- +-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/p2p.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +-@@ -1908,105 +1908,6 @@ s32 brcmf_p2p_notify_rx_mgmt_p2p_probere +- +- +- /** +-- * brcmf_p2p_attach() - attach for P2P. +-- * +-- * @cfg: driver private data for cfg80211 interface. +-- */ +--s32 brcmf_p2p_attach(struct brcmf_cfg80211_info *cfg) +--{ +-- 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; +-- s32 err = 0; +-- +-- p2p = &cfg->p2p; +-- p2p->cfg = cfg; +-- +-- drvr = cfg->pub; +-- +-- pri_ifp = drvr->iflist[0]; +-- p2p_ifp = drvr->iflist[1]; +-- +-- p2p->bss_idx[P2PAPI_BSSCFG_PRIMARY].vif = pri_ifp->vif; +-- +-- 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); +-- +-- /* 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: +-- return err; +--} +-- +-- +--/** +-- * brcmf_p2p_detach() - detach P2P. +-- * +-- * @p2p: P2P specific data. +-- */ +--void brcmf_p2p_detach(struct brcmf_p2p_info *p2p) +--{ +-- struct brcmf_cfg80211_vif *vif; +-- +-- vif = p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif; +-- if (vif != NULL) { +-- brcmf_p2p_cancel_remain_on_channel(vif->ifp); +-- brcmf_p2p_deinit_discovery(p2p); +-- /* remove discovery interface */ +-- brcmf_free_vif(vif); +-- p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; +-- } +-- /* just set it all to zero */ +-- memset(p2p, 0, sizeof(*p2p)); +--} +-- +--/** +- * brcmf_p2p_get_current_chanspec() - Get current operation channel. +- * +- * @p2p: P2P specific data. +-@@ -2425,3 +2326,102 @@ void brcmf_p2p_stop_device(struct wiphy +- clear_bit(BRCMF_VIF_STATUS_READY, &vif->sme_state); +- mutex_unlock(&cfg->usr_sync); +- } +-+ +-+/** +-+ * brcmf_p2p_attach() - attach for P2P. +-+ * +-+ * @cfg: driver private data for cfg80211 interface. +-+ */ +-+s32 brcmf_p2p_attach(struct brcmf_cfg80211_info *cfg) +-+{ +-+ 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; +-+ s32 err = 0; +-+ +-+ p2p = &cfg->p2p; +-+ p2p->cfg = cfg; +-+ +-+ drvr = cfg->pub; +-+ +-+ pri_ifp = drvr->iflist[0]; +-+ p2p_ifp = drvr->iflist[1]; +-+ +-+ p2p->bss_idx[P2PAPI_BSSCFG_PRIMARY].vif = pri_ifp->vif; +-+ +-+ 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); +-+ +-+ /* 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: +-+ return err; +-+} +-+ +-+/** +-+ * brcmf_p2p_detach() - detach P2P. +-+ * +-+ * @p2p: P2P specific data. +-+ */ +-+void brcmf_p2p_detach(struct brcmf_p2p_info *p2p) +-+{ +-+ struct brcmf_cfg80211_vif *vif; +-+ +-+ vif = p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif; +-+ if (vif != NULL) { +-+ brcmf_p2p_cancel_remain_on_channel(vif->ifp); +-+ brcmf_p2p_deinit_discovery(p2p); +-+ /* remove discovery interface */ +-+ brcmf_free_vif(vif); +-+ p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; +-+ } +-+ /* just set it all to zero */ +-+ 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 +deleted file mode 100644 +index 72e8eed..0000000 +--- a/package/kernel/mac80211/patches/389-0008-brcmfmac-assure-p2pdev-is-unregistered-upon-driver-u.patch ++++ /dev/null +@@ -1,63 +0,0 @@ +-From: Arend van Spriel +-Date: Thu, 11 Jun 2015 00:12:23 +0200 +-Subject: [PATCH] brcmfmac: assure p2pdev is unregistered upon driver +- unload +- +-When unloading the driver with a p2pdev interface it resulted in +-a warning upon calling wiphy_unregister() and subsequently a crash +-in the driver. This patch assures the p2pdev is unregistered calling +-unregister_wdev() before doing the wiphy_unregister(). +- +-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 +-@@ -6206,10 +6206,8 @@ void brcmf_cfg80211_detach(struct brcmf_ +- if (!cfg) +- return; +- +-- WARN_ON(!list_empty(&cfg->vif_list)); +-- wiphy_unregister(cfg->wiphy); +- brcmf_btcoex_detach(cfg); +-- brcmf_p2p_detach(&cfg->p2p); +-+ wiphy_unregister(cfg->wiphy); +- wl_deinit_priv(cfg); +- brcmf_free_wiphy(cfg->wiphy); +- } +---- a/drivers/net/wireless/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c +-@@ -1098,6 +1098,7 @@ void brcmf_detach(struct device *dev) +- +- /* stop firmware event handling */ +- brcmf_fweh_detach(drvr); +-+ brcmf_p2p_detach(&drvr->config->p2p); +- +- brcmf_bus_change_state(bus_if, BRCMF_BUS_DOWN); +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +-@@ -16,6 +16,7 @@ +- #include +- #include +- #include +-+#include +- #include +- +- #include +-@@ -2418,8 +2419,9 @@ void brcmf_p2p_detach(struct brcmf_p2p_i +- brcmf_p2p_cancel_remain_on_channel(vif->ifp); +- brcmf_p2p_deinit_discovery(p2p); +- /* remove discovery interface */ +-- brcmf_free_vif(vif); +-- p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; +-+ rtnl_lock(); +-+ brcmf_p2p_delete_p2pdev(p2p, vif); +-+ rtnl_unlock(); +- } +- /* 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 +deleted file mode 100644 +index 179c77e..0000000 +--- a/package/kernel/mac80211/patches/390-0001-brcmfmac-fix-double-free-of-p2pdev-interface.patch ++++ /dev/null +@@ -1,27 +0,0 @@ +-From: Arend van Spriel +-Date: Mon, 15 Jun 2015 22:48:38 +0200 +-Subject: [PATCH] brcmfmac: fix double free of p2pdev interface +- +-When freeing the driver ifp pointer it should also be removed from +-the driver interface list, which is what brcmf_remove_interface() +-does. Otherwise, the ifp pointer will be freed twice triggering +-a kernel oops. +- +-Fixes: f37d69a4babc ("brcmfmac: free ifp for non-netdev interface in p2p module") +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-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 +-@@ -2140,7 +2140,7 @@ static void brcmf_p2p_delete_p2pdev(stru +- { +- cfg80211_unregister_wdev(&vif->wdev); +- p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; +-- kfree(vif->ifp); +-+ brcmf_remove_interface(vif->ifp->drvr, vif->ifp->bssidx); +- 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 +deleted file mode 100644 +index e4f88b5..0000000 +--- a/package/kernel/mac80211/patches/390-0002-brcmfmac-make-brcmf_p2p_detach-call-conditional.patch ++++ /dev/null +@@ -1,29 +0,0 @@ +-From: Arend van Spriel +-Date: Mon, 15 Jun 2015 22:48:39 +0200 +-Subject: [PATCH] brcmfmac: make brcmf_p2p_detach() call conditional +- +-During verification of error handling in brcmf_cfg80211_attach() a +-null pointer dereference occurred upon calling brcmf_p2p_detach() +-from brcmf_detach(). This should only be called when the +-brcmf_cfg80211_attach() has succeeded. +- +-Fixes: f7a40873d2fa ("brcmfmac: assure p2pdev is unregistered upon driver unload") +-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/core.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c +-@@ -1098,7 +1098,8 @@ void brcmf_detach(struct device *dev) +- +- /* stop firmware event handling */ +- brcmf_fweh_detach(drvr); +-- brcmf_p2p_detach(&drvr->config->p2p); +-+ if (drvr->config) +-+ brcmf_p2p_detach(&drvr->config->p2p); +- +- 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 +deleted file mode 100644 +index 0a81237..0000000 +--- a/package/kernel/mac80211/patches/391-brcmfmac-set-wiphy-s-addresses-to-provide-valid-MACs.patch ++++ /dev/null +@@ -1,67 +0,0 @@ +-From: Rafa? Mi?ecki +-Date: Thu, 9 Jul 2015 17:07:08 +0200 +-Subject: [PATCH] brcmfmac: set wiphy's addresses to provide valid MACs +- +-Broadcom's firmware requires every BSS to use MAC address with unique +-last few bits. The amount of bits may depend on a particular firmware, +-it was verified to be 2 for BCM43602 one. +-If this condition won't be fulfilled firmware will reject such MAC: +-brcmfmac: _brcmf_set_mac_address: Setting cur_etheraddr failed, -52 +- +-We don't want to simply set addr_mask as it would also disallow using +-locally administrated bit. Instead let's build a list of addresses +-manually enabling 0x2 bit for extra interfaces. +- +-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 +-@@ -5784,6 +5784,7 @@ 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; +- struct ieee80211_supported_band *band; +- __le32 bandlist[3]; +- u32 n_bands; +-@@ -5797,6 +5798,19 @@ 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++) { +-+ u8 *addr = drvr->addresses[i].addr; +-+ +-+ memcpy(addr, drvr->mac, ETH_ALEN); +-+ if (i) { +-+ addr[0] |= BIT(1); +-+ addr[ETH_ALEN - 1] ^= i; +-+ } +-+ } +-+ wiphy->addresses = drvr->addresses; +-+ wiphy->n_addresses = i; +-+ +- wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; +- wiphy->cipher_suites = __wl_cipher_suites; +- wiphy->n_cipher_suites = ARRAY_SIZE(__wl_cipher_suites); +---- a/drivers/net/wireless/brcm80211/brcmfmac/core.h +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.h +-@@ -21,6 +21,7 @@ +- #ifndef BRCMFMAC_CORE_H +- #define BRCMFMAC_CORE_H +- +-+#include +- #include "fweh.h" +- +- #define TOE_TX_CSUM_OL 0x00000001 +-@@ -118,6 +119,8 @@ struct brcmf_pub { +- /* Multicast data packets sent to dongle */ +- unsigned long tx_multicast; +- +-+ struct mac_address addresses[BRCMF_MAX_IFS]; +-+ +- 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 +deleted file mode 100644 +index e44f121..0000000 +--- a/package/kernel/mac80211/patches/392-brcmfmac-dhd_sdio.c-use-existing-atomic_or-primitive.patch ++++ /dev/null +@@ -1,45 +0,0 @@ +-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; +-- +-- 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); +- +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 +deleted file mode 100644 +index 76ca143..0000000 +--- a/package/kernel/mac80211/patches/393-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?= +-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 +-@@ -5785,7 +5785,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; +-@@ -5798,8 +5800,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/393-0002-brcmfmac-correct-interface-combination-info.patch b/package/kernel/mac80211/patches/393-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 ++++ /dev/null +@@ -1,204 +0,0 @@ +-From: Arend van Spriel +-Date: Thu, 20 Aug 2015 22:06:03 +0200 +-Subject: [PATCH] brcmfmac: correct interface combination info +- +-The interface combination provided by brcmfmac did not truly reflect +-the combinations supported by driver and/or firmware. +- +-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 +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-@@ -5694,63 +5694,132 @@ brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = +- } +- }; +- +-+/** +-+ * 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; +- } +-@@ -6079,11 +6148,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/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 +deleted file mode 100644 +index 9768ef2..0000000 +--- a/package/kernel/mac80211/patches/393-0003-brcmfmac-add-debugfs-entry-for-msgbuf-statistics.patch ++++ /dev/null +@@ -1,87 +0,0 @@ +-From: Franky Lin +-Date: Thu, 20 Aug 2015 22:06:04 +0200 +-Subject: [PATCH] brcmfmac: add debugfs entry for msgbuf statistics +- +-Expose ring buffer read/write pointers and other useful statistics +-through debugfs. +- +-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 +---- +- +---- 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 +- } +- } +- +-+#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; +-+ +-+ 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); +-+ } +-+ +-+ 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: +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 +deleted file mode 100644 +index 2b84cf9..0000000 +--- a/package/kernel/mac80211/patches/393-0004-brcmfmac-make-use-of-cfg80211_check_combinations.patch ++++ /dev/null +@@ -1,83 +0,0 @@ +-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) +-@@ -662,8 +692,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: +-@@ -822,8 +858,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/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 +deleted file mode 100644 +index 2d5f7b9..0000000 +--- a/package/kernel/mac80211/patches/393-0005-brcmfmac-block-the-correct-flowring-when-backup-queu.patch ++++ /dev/null +@@ -1,48 +0,0 @@ +-From: Franky Lin +-Date: Thu, 20 Aug 2015 22:06:06 +0200 +-Subject: [PATCH] brcmfmac: block the correct flowring when backup queue +- overflow +- +-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. +- +-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 +---- +- +---- 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); +- +- ring = flow->rings[flowid]; +-+ if (ring->blocked == blocked) { +-+ spin_unlock_irqrestore(&flow->block_lock, flags); +-+ return; +-+ } +- ifidx = brcmf_flowring_ifidx_get(flow, flowid); +- +- 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/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 +deleted file mode 100644 +index 7378401..0000000 +--- a/package/kernel/mac80211/patches/393-0006-brcmfmac-bump-highest-event-number-for-4339-firmware.patch ++++ /dev/null +@@ -1,52 +0,0 @@ +-From: Arend van Spriel +-Date: Thu, 20 Aug 2015 22:06:07 +0200 +-Subject: [PATCH] brcmfmac: bump highest event number for 4339 firmware +- +-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. +- +-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 +---- +- +---- 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) +- +- #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 +- +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 +deleted file mode 100644 +index 97444b3..0000000 +--- a/package/kernel/mac80211/patches/394-0001-brcmfmac-consolidate-ifp-lookup-in-driver-core.patch ++++ /dev/null +@@ -1,138 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 26 Aug 2015 22:14:53 +0200 +-Subject: [PATCH] brcmfmac: consolidate ifp lookup in driver core +- +-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. +- +-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/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) +- { +- 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; +- } +-- /* 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; +-+ +-+ *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) +-+{ +-+ 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]; +-+} +-+ +- 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 +- +- /* 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; +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 +deleted file mode 100644 +index 632714c..0000000 +--- a/package/kernel/mac80211/patches/394-0002-brcmfmac-make-brcmf_proto_hdrpull-return-struct-brcm.patch ++++ /dev/null +@@ -1,222 +0,0 @@ +-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 +- +-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 +---- +- +---- 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 +- } +- +- 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; +-+ +-+ /* assure protocol is always called with +-+ * non-null initialized pointer. +-+ */ +-+ 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) +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 +deleted file mode 100644 +index 2d15a77..0000000 +--- a/package/kernel/mac80211/patches/394-0003-brcmfmac-change-parameters-for-brcmf_remove_interfac.patch ++++ /dev/null +@@ -1,87 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 26 Aug 2015 22:14:55 +0200 +-Subject: [PATCH] brcmfmac: change parameters for +- brcmf_remove_interface() +- +-Just pass the interface to be removed, ie. 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 +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-@@ -4982,7 +4982,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/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 +- } +- } +- +--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; +-+ +-+ brcmf_fws_del_interface(ifp); +-+ brcmf_del_if(ifp->drvr, ifp->bssidx); +- } +- +- 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 +- { +- 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); +- } +- +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 +deleted file mode 100644 +index 2b61f4e..0000000 +--- a/package/kernel/mac80211/patches/394-0004-brcmfmac-only-call-brcmf_cfg80211_detach-when-attach.patch ++++ /dev/null +@@ -1,92 +0,0 @@ +-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 +- +-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: +- +- 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 +---- +- +---- 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; +-+ } +- 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 +deleted file mode 100644 +index 868b0a8..0000000 +--- a/package/kernel/mac80211/patches/394-0005-brcmfmac-correct-detection-of-p2pdev-interface-event.patch ++++ /dev/null +@@ -1,105 +0,0 @@ +-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/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 +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 ++++ /dev/null +@@ -1,126 +0,0 @@ +-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 +- +-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. +- +-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/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 +-@@ -6212,7 +6212,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); +- } +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 +deleted file mode 100644 +index 23a7b6f..0000000 +--- a/package/kernel/mac80211/patches/394-0007-brcmfmac-pass-struct-brcmf_if-instance-in-brcmf_txfi.patch ++++ /dev/null +@@ -1,122 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 26 Aug 2015 22:14:59 +0200 +-Subject: [PATCH] brcmfmac: pass struct brcmf_if instance in +- brcmf_txfinalize() +- +-Most call sites of brcmf_txfinalize already have struct brcmf_if +-instance so pass that to brcmf_txfinalize() as the function +-needs it anyway. +- +-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 +-@@ -560,17 +560,11 @@ void brcmf_rx_frame(struct device *dev, +- brcmf_netif_rx(ifp, skb); +- } +- +--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; +- +-- ifp = drvr->iflist[ifidx]; +-- if (!ifp) +-- goto done; +-- +- eh = (struct ethhdr *)(txp->data); +- type = ntohs(eh->h_proto); +- +-@@ -582,7 +576,7 @@ void brcmf_txfinalize(struct brcmf_pub * +- +- 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; +- } +- +-@@ -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? +-+ */ +-+ brcmf_txfinalize(brcmf_get_ifp(msgbuf->drvr, tx_status->msg.ifidx), +-+ skb, true); +- } +- +- +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 +deleted file mode 100644 +index 8ddc0a6..0000000 +--- a/package/kernel/mac80211/patches/394-0008-brcmfmac-add-mapping-for-interface-index-to-bsscfg-i.patch ++++ /dev/null +@@ -1,92 +0,0 @@ +-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/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 +deleted file mode 100644 +index a0a798b..0000000 +--- a/package/kernel/mac80211/patches/394-0009-brcmfmac-add-dedicated-debug-level-for-firmware-cons.patch ++++ /dev/null +@@ -1,103 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 26 Aug 2015 22:15:01 +0200 +-Subject: [PATCH] brcmfmac: add dedicated debug level for firmware +- console logging +- +-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. +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Pontus Fuchs +-Signed-off-by: Arend van Spriel +---- +- +---- 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); +- } +- +-@@ -656,6 +656,9 @@ static void brcmf_pcie_bus_console_read( +- u8 ch; +- u32 newidx; +- +-+ if (!BRCMF_FWCON_ON()) +-+ return; +-+ +- 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; +-+ +- 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) { +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 +deleted file mode 100644 +index 53e7ede..0000000 +--- a/package/kernel/mac80211/patches/394-0010-brcmfmac-remove-ifidx-parameter-from-brcmf_fws_txsta.patch ++++ /dev/null +@@ -1,34 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 26 Aug 2015 22:15:02 +0200 +-Subject: [PATCH] brcmfmac: remove ifidx parameter from +- brcmf_fws_txstatus_suppressed() +- +-The brcmf_fws_txstatus_suppressed() function prototype specifies an +-ifidx parameter which is not used within the function implementation. +- +-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/fwsignal.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c +-@@ -1398,7 +1398,7 @@ done: +- } +- +- 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; +- } +- 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); +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 +deleted file mode 100644 +index bb05235..0000000 +--- a/package/kernel/mac80211/patches/394-0011-brcmfmac-change-prototype-for-brcmf_fws_hdrpull.patch ++++ /dev/null +@@ -1,97 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 26 Aug 2015 22:15:03 +0200 +-Subject: [PATCH] brcmfmac: change prototype for brcmf_fws_hdrpull() +- +-Instead of passing ifidx and drvr just pass struct brcmf_if pointer +-which holds both parameters. +- +-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/bcdc.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcdc.c +-@@ -312,8 +312,7 @@ brcmf_proto_bcdc_hdrpull(struct brcmf_pu +- +- 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) +- { +- 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; +- } +- +- 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); +- +- 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 +deleted file mode 100644 +index ba92c67..0000000 +--- a/package/kernel/mac80211/patches/394-0012-brcmfmac-introduce-brcmf_net_detach-function.patch ++++ /dev/null +@@ -1,99 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 26 Aug 2015 22:15:04 +0200 +-Subject: [PATCH] brcmfmac: introduce brcmf_net_detach() function +- +-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. +- +-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 +---- +- +---- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +-@@ -4746,7 +4746,8 @@ void brcmf_cfg80211_free_netdev(struct n +- ifp = netdev_priv(ndev); +- vif = ifp->vif; +- +-- brcmf_free_vif(vif); +-+ if (vif) +-+ brcmf_free_vif(vif); +- free_netdev(ndev); +- } +- +---- 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/395-brcmfmac-Reset-PCIE-devices-after-recognition.patch b/package/kernel/mac80211/patches/395-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 ++++ /dev/null +@@ -1,193 +0,0 @@ +-From: Hante Meuleman +-Date: Thu, 27 Aug 2015 16:14:06 +0200 +-Subject: [PATCH] brcmfmac: Reset PCIE devices after recognition. +- +-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. +- +-Cc: Rafal Milecki +-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 +---- +- +---- 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 +- +-+/* 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; +- } +-+ +-+ if (ci->pub.ramsize > BRCMF_CHIP_MAX_MEMSIZE) { +-+ brcmf_err("RAM size is incorrect\n"); +-+ return -ENOMEM; +-+ } +-+ +- return 0; +- } +- +-@@ -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); +- } +- +---- 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); +- }; +---- 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 * +- } +- +- +-+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) +- { +-@@ -1647,6 +1671,7 @@ static void brcmf_pcie_buscore_activate( +- +- 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); +- +- 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 +deleted file mode 100644 +index f7b3e40..0000000 +--- a/package/kernel/mac80211/patches/396-ath10k-fix-DMA-related-firmware-crashes-on-multiple-.patch ++++ /dev/null +@@ -1,24 +0,0 @@ +-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 +-@@ -253,7 +253,7 @@ struct ath10k_pktlog_hdr { +- #define TARGET_10X_MAX_FRAG_ENTRIES 0 +- +- /* 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 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 +deleted file mode 100644 +index c420d20..0000000 +--- a/package/kernel/mac80211/patches/397-ath9k-declare-required-extra-tx-headroom.patch ++++ /dev/null +@@ -1,22 +0,0 @@ +-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 +-@@ -867,6 +867,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/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 +deleted file mode 100644 +index 1478efa..0000000 +--- a/package/kernel/mac80211/patches/398-mac80211-initialize-tid-field-in-struct-ieee80211_tx.patch ++++ /dev/null +@@ -1,21 +0,0 @@ +-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 +-@@ -3323,9 +3323,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/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 ++++ b/package/kernel/mac80211/patches/400-ath_move_debug_code.patch +@@ -14,7 +14,7 @@ + ccflags-y += -D__CHECK_ENDIAN__ + --- a/drivers/net/wireless/ath/ath.h + +++ b/drivers/net/wireless/ath/ath.h +-@@ -316,13 +316,6 @@ void _ath_dbg(struct ath_common *common, ++@@ -318,13 +318,6 @@ void _ath_dbg(struct ath_common *common, + #endif /* CPTCFG_ATH_DEBUG */ + + /** 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 +--- a/package/kernel/mac80211/patches/402-ath_regd_optional.patch ++++ b/package/kernel/mac80211/patches/402-ath_regd_optional.patch +@@ -59,7 +59,7 @@ + ---help--- + --- a/.local-symbols + +++ b/.local-symbols +-@@ -89,6 +89,7 @@ RTL8187_LEDS= ++@@ -137,6 +137,7 @@ RTL8187_LEDS= + ATH_COMMON= + ATH_CARDS= + ATH_DEBUG= +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 +--- 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 + enum environment_cap env = ENVIRON_ANY; + struct regulatory_request *request = NULL, *lr; + +@@ -9,7 +9,7 @@ + /* 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( + + void regulatory_hint_disconnect(void) + { +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 ++++ b/package/kernel/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch +@@ -1,6 +1,6 @@ + --- a/drivers/net/wireless/ath/ath9k/init.c + +++ b/drivers/net/wireless/ath/ath9k/init.c +-@@ -715,6 +715,7 @@ static const struct ieee80211_iface_limi ++@@ -722,6 +722,7 @@ static const struct ieee80211_iface_limi + BIT(NL80211_IFTYPE_AP) }, + { .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 +--- 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 ++++++++++++++++++++++++++++++++ + debugfs_create_file("antenna", S_IWUSR | S_IRUSR, phydir, ah, + --- 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 { + 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 ++++ b/package/kernel/mac80211/patches/510-ath9k_intr_mitigation_tweak.patch +@@ -1,6 +1,6 @@ + --- a/drivers/net/wireless/ath/ath9k/hw.c + +++ b/drivers/net/wireless/ath/ath9k/hw.c +-@@ -389,13 +389,8 @@ static void ath9k_hw_init_config(struct ++@@ -390,13 +390,8 @@ static void ath9k_hw_init_config(struct + + ah->config.rx_intr_mitigation = true; + +@@ -14,5 +14,5 @@ + + ah->config.rimt_last = 250; + + ah->config.rimt_first = 500; + +- /* +- * We need this for PCI devices only (Cardbus, PCI, miniPCI) ++ if (AR_SREV_9462(ah) || AR_SREV_9565(ah)) ++ ah->config.pll_pwrsave = 7; +diff --git a/package/kernel/mac80211/patches/511-ath9k_reduce_rxbuf.patch b/package/kernel/mac80211/patches/511-ath9k_reduce_rxbuf.patch +index d4104f0..6766111 100644 +--- a/package/kernel/mac80211/patches/511-ath9k_reduce_rxbuf.patch ++++ b/package/kernel/mac80211/patches/511-ath9k_reduce_rxbuf.patch +@@ -1,6 +1,6 @@ + --- a/drivers/net/wireless/ath/ath9k/ath9k.h + +++ b/drivers/net/wireless/ath/ath9k/ath9k.h +-@@ -87,7 +87,7 @@ int ath_descdma_setup(struct ath_softc * ++@@ -88,7 +88,7 @@ int ath_descdma_setup(struct ath_softc * + (_l) &= ((_sz) - 1); \ + } while (0) + +diff --git a/package/kernel/mac80211/patches/513-ath9k_add_pci_ids.patch b/package/kernel/mac80211/patches/513-ath9k_add_pci_ids.patch +index 40b5c81..c84d1bc 100644 +--- a/package/kernel/mac80211/patches/513-ath9k_add_pci_ids.patch ++++ b/package/kernel/mac80211/patches/513-ath9k_add_pci_ids.patch +@@ -1,6 +1,6 @@ + --- a/drivers/net/wireless/ath/ath9k/hw.c + +++ b/drivers/net/wireless/ath/ath9k/hw.c +-@@ -647,6 +647,7 @@ int ath9k_hw_init(struct ath_hw *ah) ++@@ -651,6 +651,7 @@ int ath9k_hw_init(struct ath_hw *ah) + + /* 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 +--- a/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch ++++ b/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch +@@ -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 { + * + * @power_level: requested transmit power (in dBm), backward compatibility + * value only that is set to the minimum of all interfaces +@@ -26,7 +26,7 @@ + * + * @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 { + u32 flags; + int power_level, dynamic_ps_timeout; + int max_sleep_period; +@@ -36,7 +36,7 @@ + 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. + * +@@ -46,7 +46,7 @@ + * @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, + +@@ -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 + return 0; + } + +@@ -77,7 +77,7 @@ + static int ieee80211_set_wds_peer(struct wiphy *wiphy, struct net_device *dev, + const u8 *addr) + { +-@@ -3771,6 +3784,7 @@ const struct cfg80211_ops mac80211_confi ++@@ -3845,6 +3858,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, +@@ -87,7 +87,7 @@ + CFG80211_TESTMODE_CMD(ieee80211_testmode_cmd) + --- a/net/mac80211/ieee80211_i.h + +++ b/net/mac80211/ieee80211_i.h +-@@ -1333,6 +1333,7 @@ struct ieee80211_local { ++@@ -1318,6 +1318,7 @@ struct ieee80211_local { + int dynamic_ps_forced_timeout; + + int user_power_level; /* in dBm, for all interfaces */ +@@ -97,7 +97,7 @@ + + --- 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 + struct ieee80211_sub_if_data *sdata; + struct cfg80211_chan_def chandef = {}; + u32 changed = 0; +@@ -106,7 +106,7 @@ + u32 offchannel_flag; + + 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 + } + rcu_read_unlock(); + +@@ -119,7 +119,7 @@ + if (local->hw.conf.power_level != power) { + 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_ + IEEE80211_RADIOTAP_MCS_HAVE_BW; + local->hw.radiotap_vht_details = IEEE80211_RADIOTAP_VHT_KNOWN_GI | + IEEE80211_RADIOTAP_VHT_KNOWN_BANDWIDTH; +@@ -129,7 +129,7 @@ + local->user_power_level = IEEE80211_UNSET_POWER_LEVEL; + --- 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 + [NL80211_ATTR_NETNS_FD] = { .type = NLA_U32 }, + [NL80211_ATTR_SCHED_SCAN_DELAY] = { .type = NLA_U32 }, + [NL80211_ATTR_REG_INDOOR] = { .type = NLA_FLAG }, +@@ -137,7 +137,7 @@ + }; + + /* 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 + 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 +--- 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 { + 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 + + #ifdef CPTCFG_MAC80211_LEDS + /* must be initialized before ieee80211_register_hw */ +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 +--- a/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch ++++ b/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch +@@ -62,7 +62,7 @@ + debugfs_create_devm_seqfile(sc->dev, "interrupt", sc->debug.debugfs_phy, + --- a/drivers/net/wireless/ath/ath9k/hw.h + +++ b/drivers/net/wireless/ath/ath9k/hw.h +-@@ -513,6 +513,12 @@ enum { ++@@ -519,6 +519,12 @@ enum { + ATH9K_RESET_COLD, + }; + +@@ -75,7 +75,7 @@ + struct ath9k_hw_version { + u32 magic; + u16 devid; +-@@ -794,6 +800,8 @@ struct ath_hw { ++@@ -804,6 +810,8 @@ struct ath_hw { + u32 rfkill_polarity; + u32 ah_flags; + +@@ -84,7 +84,7 @@ + bool reset_power_on; + bool htc_reset_init; + +-@@ -1055,6 +1063,7 @@ void ath9k_hw_check_nav(struct ath_hw *a ++@@ -1066,6 +1074,7 @@ void ath9k_hw_check_nav(struct ath_hw *a + bool ath9k_hw_check_alive(struct ath_hw *ah); + + bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode); +@@ -94,7 +94,7 @@ + struct ath_gen_timer *ath_gen_timer_alloc(struct ath_hw *ah, + --- 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 + } + EXPORT_SYMBOL(ath9k_hw_get_tsf_offset); + +@@ -115,7 +115,7 @@ + int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, + 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 + 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 +--- 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 @@ + --- a/drivers/net/wireless/ath/ath9k/hw.h + +++ b/drivers/net/wireless/ath/ath9k/hw.h +-@@ -710,6 +710,7 @@ struct ath_spec_scan { ++@@ -720,6 +720,7 @@ struct ath_spec_scan { + * @config_pci_powersave: + * @calibrate: periodic calibration for NF, ANI, IQ, ADC gain, ADC-DC + * +@@ -8,7 +8,7 @@ + * @spectral_scan_config: set parameters for spectral scan and enable/disable it + * @spectral_scan_trigger: trigger a spectral scan run + * @spectral_scan_wait: wait for a spectral scan run to finish +-@@ -732,6 +733,7 @@ struct ath_hw_ops { ++@@ -742,6 +743,7 @@ struct ath_hw_ops { + struct ath_hw_antcomb_conf *antconf); + void (*antdiv_comb_conf_set)(struct ath_hw *ah, + struct ath_hw_antcomb_conf *antconf); +@@ -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 + if (ah->caps.hw_caps & ATH9K_HW_CAP_5GHZ) + ath9k_init_band_txpower(sc, IEEE80211_BAND_5GHZ); + +@@ -65,7 +65,7 @@ + } + + 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 + SET_IEEE80211_PERM_ADDR(hw, common->macaddr); + } + +@@ -84,7 +84,7 @@ + int ath9k_init_device(u16 devid, struct ath_softc *sc, + 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 + ARRAY_SIZE(ath9k_tpt_blink)); + #endif + +@@ -110,7 +110,7 @@ + static inline void ath9k_hw_set_bt_ant_diversity(struct ath_hw *ah, bool enable) + --- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c + +++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c +-@@ -1316,9 +1316,30 @@ void ar5008_hw_init_rate_txpower(struct ++@@ -1327,9 +1327,30 @@ void ar5008_hw_init_rate_txpower(struct + } + } + +@@ -141,7 +141,7 @@ + static const u32 ar5416_cca_regs[6] = { + AR_PHY_CCA, + AR_PHY_CH1_CCA, +-@@ -1333,6 +1354,8 @@ int ar5008_hw_attach_phy_ops(struct ath_ ++@@ -1344,6 +1365,8 @@ int ar5008_hw_attach_phy_ops(struct ath_ + if (ret) + 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 +--- 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 @@ + --- a/drivers/net/wireless/ath/ath9k/hw.c + +++ b/drivers/net/wireless/ath/ath9k/hw.c +-@@ -245,6 +245,19 @@ void ath9k_hw_get_channel_centers(struct ++@@ -246,6 +246,19 @@ void ath9k_hw_get_channel_centers(struct + centers->synth_center + (extoff * HT40_CHANNEL_CENTER_SHIFT); + } + +@@ -20,7 +20,7 @@ + /******************/ + /* 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 + if (AR_SREV_9100(ah)) + udelay(50); + +@@ -30,7 +30,7 @@ + return true; + } + +-@@ -1481,6 +1497,9 @@ static bool ath9k_hw_chip_reset(struct a ++@@ -1485,6 +1501,9 @@ static bool ath9k_hw_chip_reset(struct a + ar9003_hw_internal_regulator_apply(ah); + ath9k_hw_init_pll(ah, chan); + +@@ -40,7 +40,7 @@ + return true; + } + +-@@ -1782,8 +1801,14 @@ static int ath9k_hw_do_fastcc(struct ath ++@@ -1786,8 +1805,14 @@ static int ath9k_hw_do_fastcc(struct ath + if (AR_SREV_9271(ah)) + ar9002_hw_load_ani_reg(ah, chan); + +@@ -55,7 +55,7 @@ + return -EINVAL; + } + +-@@ -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 + 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 +--- 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 @@ + --- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c + +++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c +-@@ -945,55 +945,6 @@ static bool ar5008_hw_ani_control_new(st ++@@ -956,55 +956,6 @@ static bool ar5008_hw_ani_control_new(st + * on == 0 means more noise imm + */ + 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 +--- 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 +++++++++++ + 2 files changed, 11 insertions(+), 13 deletions(-) + +---- a/drivers/net/wireless/rt2x00/rt2800.h +-+++ b/drivers/net/wireless/rt2x00/rt2800.h +-@@ -2960,17 +2960,4 @@ enum rt2800_eeprom_word { +- */ +- #define BCN_TBTT_OFFSET 64 +- +--/* +-- * RT2800 driver data structure +-- */ +--struct rt2800_drv_data { +-- u8 calibration_bw20; +-- u8 calibration_bw40; +-- u8 bbp25; +-- u8 bbp26; +-- u8 txmixer_gain_24g; +-- u8 txmixer_gain_5g; +-- unsigned int tbtt_tick; +--}; +-- +- #endif /* RT2800_H */ + --- a/drivers/net/wireless/rt2x00/rt2800lib.h + +++ b/drivers/net/wireless/rt2x00/rt2800lib.h +-@@ -20,6 +20,17 @@ ++@@ -20,6 +20,20 @@ + #ifndef RT2800LIB_H + #define RT2800LIB_H + +++#include "rt2800.h" +++ + +/* RT2800 driver data structure */ + +struct rt2800_drv_data { + + u8 calibration_bw20; +@@ -55,8 +37,30 @@ Changes since v1: --- + + u8 txmixer_gain_24g; + + u8 txmixer_gain_5g; + + unsigned int tbtt_tick; +++ DECLARE_BITMAP(sta_ids, STA_IDS_SIZE); + +}; + + + 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 ++@@ -2969,18 +2969,4 @@ enum rt2800_eeprom_word { ++ #define WCID_END 222 ++ #define STA_IDS_SIZE (WCID_END - WCID_START + 2) ++ ++-/* ++- * RT2800 driver data structure ++- */ ++-struct rt2800_drv_data { ++- u8 calibration_bw20; ++- u8 calibration_bw40; ++- u8 bbp25; ++- u8 bbp26; ++- u8 txmixer_gain_24g; ++- u8 txmixer_gain_5g; ++- unsigned int tbtt_tick; ++- DECLARE_BITMAP(sta_ids, STA_IDS_SIZE); ++-}; ++- ++ #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 +--- 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: + + --- 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 + + int rt2800_probe_hw(struct rt2x00_dev *rt2x00dev) + { +@@ -32,7 +32,7 @@ Changes since v1: + int retval; + 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 + if (retval) + return retval; + +@@ -44,9 +44,9 @@ Changes since v1: + */ + --- a/drivers/net/wireless/rt2x00/rt2800lib.h + +++ b/drivers/net/wireless/rt2x00/rt2800lib.h +-@@ -20,6 +20,10 @@ +- #ifndef RT2800LIB_H +- #define RT2800LIB_H ++@@ -22,6 +22,10 @@ ++ ++ #include "rt2800.h" + + +enum rt2800_flag { + + RT2800_HAS_HIGH_SHARED_MEM, +@@ -55,16 +55,16 @@ Changes since v1: + /* RT2800 driver data structure */ + struct rt2800_drv_data { + u8 calibration_bw20; +-@@ -29,6 +33,8 @@ struct rt2800_drv_data { +- u8 txmixer_gain_24g; ++@@ -32,6 +36,8 @@ struct rt2800_drv_data { + u8 txmixer_gain_5g; + unsigned int tbtt_tick; ++ DECLARE_BITMAP(sta_ids, STA_IDS_SIZE); + + + + unsigned long rt2800_flags; + }; + + struct rt2800_ops { +-@@ -61,6 +67,13 @@ struct rt2800_ops { ++@@ -64,6 +70,13 @@ struct rt2800_ops { + __le32 *(*drv_get_txwi)(struct queue_entry *entry); + }; + +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 +--- 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 +@@ -175,7 +175,7 @@ Changes since v1: --- + + /* + * Update WCID information +-@@ -1437,8 +1467,11 @@ int rt2800_config_pairwise_key(struct rt ++@@ -1405,8 +1435,11 @@ int rt2800_config_pairwise_key(struct rt + sizeof(key_entry.rx_mic)); + + offset = PAIRWISE_KEY_ENTRY(key->hw_key_idx); +@@ -187,7 +187,7 @@ Changes since v1: --- + } + + /* +-@@ -4908,14 +4941,19 @@ static int rt2800_init_registers(struct ++@@ -4884,14 +4917,19 @@ static int rt2800_init_registers(struct + /* + * ASIC will keep garbage value after boot, clear encryption keys. + */ +@@ -207,7 +207,7 @@ Changes since v1: --- + } + + /* +-@@ -5041,8 +5079,10 @@ static int rt2800_wait_bbp_ready(struct ++@@ -5017,8 +5055,10 @@ static int rt2800_wait_bbp_ready(struct + * BBP was enabled after firmware was loaded, + * but we need to reactivate it now. + */ +@@ -218,7 +218,7 @@ Changes since v1: --- + msleep(1); + + 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 + /* + * Send signal during boot time to initialize firmware. + */ +@@ -239,7 +239,7 @@ Changes since v1: --- + msleep(1); + + /* +-@@ -7751,6 +7799,8 @@ int rt2800_probe_hw(struct rt2x00_dev *r ++@@ -7725,6 +7773,8 @@ int rt2800_probe_hw(struct rt2x00_dev *r + int retval; + u32 reg; + +@@ -248,22 +248,22 @@ Changes since v1: --- + retval = rt2800_probe_rt(rt2x00dev); + if (retval) + 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 ++ return; + +- offset = MAC_IVEIV_ENTRY(hw_key_idx); ++ offset = MAC_IVEIV_ENTRY(key->hw_key_idx); + + + + rt2800_shared_mem_lock(rt2x00dev); + rt2800_register_multiread(rt2x00dev, offset, + &iveiv_entry, sizeof(iveiv_entry)); + + rt2800_shared_mem_unlock(rt2x00dev); + +- 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 +-@@ -35,6 +35,11 @@ struct rt2800_drv_data { +- unsigned int tbtt_tick; ++@@ -38,6 +38,11 @@ struct rt2800_drv_data { ++ DECLARE_BITMAP(sta_ids, STA_IDS_SIZE); + + unsigned long rt2800_flags; + + +@@ -274,7 +274,7 @@ Changes since v1: --- + }; + + struct rt2800_ops { +-@@ -65,6 +70,10 @@ struct rt2800_ops { ++@@ -68,6 +73,10 @@ struct rt2800_ops { + const u8 *data, const size_t len); + int (*drv_init_registers)(struct rt2x00_dev *rt2x00dev); + __le32 *(*drv_get_txwi)(struct queue_entry *entry); +@@ -285,7 +285,7 @@ Changes since v1: --- + }; + + static inline bool rt2800_has_high_shared_mem(struct rt2x00_dev *rt2x00dev) +-@@ -74,6 +83,29 @@ static inline bool rt2800_has_high_share ++@@ -77,6 +86,29 @@ static inline bool rt2800_has_high_share + return test_bit(RT2800_HAS_HIGH_SHARED_MEM, &drv_data->rt2800_flags); + } + +@@ -486,7 +486,7 @@ Changes since v1: --- + /* + * Queue handlers. + */ +-@@ -294,8 +315,10 @@ static int rt2800usb_write_firmware(stru ++@@ -299,8 +320,10 @@ static int rt2800usb_write_firmware(stru + data + offset, length); + } + +@@ -497,7 +497,7 @@ Changes since v1: --- + + /* + * Send firmware request to device to load firmware, +-@@ -310,7 +333,10 @@ static int rt2800usb_write_firmware(stru ++@@ -315,7 +338,10 @@ static int rt2800usb_write_firmware(stru + } + + msleep(10); +@@ -508,7 +508,7 @@ Changes since v1: --- + + return 0; + } +-@@ -328,8 +354,10 @@ static int rt2800usb_init_registers(stru ++@@ -333,8 +359,10 @@ static int rt2800usb_init_registers(stru + if (rt2800_wait_csr_ready(rt2x00dev)) + return -EBUSY; + +@@ -519,7 +519,7 @@ Changes since v1: --- + + reg = 0; + rt2x00_set_field32(®, MAC_SYS_CTRL_RESET_CSR, 1); +-@@ -859,6 +887,9 @@ static const struct rt2800_ops rt2800usb ++@@ -863,6 +891,9 @@ static const struct rt2800_ops rt2800usb + .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-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 +--- 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 + + --- 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); + */ + static int rt2800_init_registers(struct rt2x00_dev *rt2x00dev) + { +@@ -32,7 +32,7 @@ Signed-off-by: Gabor Juhos + u32 reg; + 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 + /* + * Clear all beacons + */ +@@ -41,7 +41,7 @@ Signed-off-by: Gabor Juhos + rt2800_clear_beacon_register(rt2x00dev, i); + + 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 + 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 + */ + --- a/drivers/net/wireless/rt2x00/rt2800lib.h + +++ b/drivers/net/wireless/rt2x00/rt2800lib.h +-@@ -33,6 +33,7 @@ struct rt2800_drv_data { ++@@ -35,6 +35,7 @@ struct rt2800_drv_data { + u8 txmixer_gain_24g; + u8 txmixer_gain_5g; + unsigned int tbtt_tick; + + unsigned int hw_beacon_count; ++ DECLARE_BITMAP(sta_ids, STA_IDS_SIZE); + + 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 +--- 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 + */ + --- 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 + 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 +--- 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 + + --- 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 + if (rt2x00_rt(rt2x00dev, RT3593)) + __set_bit(RT2800_HAS_HIGH_SHARED_MEM, &drv_data->rt2800_flags); + +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 +--- 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 + + --- 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 + 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 +--- 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 + #define RF5370 0x5370 + --- 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 + {173, 0x61, 0, 9}, + }; + +@@ -98,7 +98,7 @@ Signed-off-by: Gabor Juhos + static const struct rf_channel rf_vals_5592_xtal20[] = { + /* 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 + 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 +--- 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 + + --- 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 + case RF3053: + case RF3070: + case RF3290: +@@ -18,7 +18,7 @@ Signed-off-by: Gabor Juhos + case RF5360: + 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 + 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 +--- 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 + + --- 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 + } + } + +@@ -223,7 +223,7 @@ Signed-off-by: Gabor Juhos + #define POWER_BOUND 0x27 + #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 + 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 +--- 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 + + --- 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 + 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 +--- 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 + #define RX_FILTER_CFG 0x1400 + --- 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 + rt2800_register_write(rt2x00dev, TX_SW_CFG2, + 0x00000000); + } +@@ -48,7 +48,7 @@ Signed-off-by: Gabor Juhos + } else if (rt2x00_rt(rt2x00dev, RT5390) || + 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 + + rt2800_register_read(rt2x00dev, MAX_LEN_CFG, ®); + rt2x00_set_field32(®, MAX_LEN_CFG_MAX_MPDU, AGGREGATION_SIZE); +@@ -63,7 +63,7 @@ Signed-off-by: Gabor Juhos + rt2x00_set_field32(®, MAX_LEN_CFG_MAX_PSDU, 2); + 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 + reg = rt2x00_rt(rt2x00dev, RT5592) ? 0x00000082 : 0x00000002; + rt2800_register_write(rt2x00dev, TXOP_HLDR_ET, reg); + +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 +--- 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 + + --- 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 + rt2800_bbp_write(rt2x00dev, 103, 0xc0); + } + +@@ -59,7 +59,7 @@ Signed-off-by: Gabor Juhos + static void rt2800_init_bbp_53xx(struct rt2x00_dev *rt2x00dev) + { + 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 + 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 +--- 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 + /* + --- 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 + /* TODO: enable stream mode support */ + } + +@@ -166,7 +166,7 @@ Signed-off-by: Gabor Juhos + static void rt2800_init_rfcsr_5390(struct rt2x00_dev *rt2x00dev) + { + 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 + case RT3390: + rt2800_init_rfcsr_3390(rt2x00dev); + break; +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 +--- 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 + + --- 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 + 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 +--- 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 + + --- 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 + return clamp_t(char, txpower, MIN_A_TXPOWER, MAX_A_TXPOWER); + } + +@@ -47,7 +47,7 @@ Signed-off-by: Gabor Juhos + static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev, + 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 + rt2800_txpower_to_dev(rt2x00dev, rf->channel, + info->default_power3); + +@@ -60,7 +60,7 @@ Signed-off-by: Gabor Juhos + switch (rt2x00dev->chip.rf) { + case RF2020: + case RF3020: +-@@ -3530,6 +3566,15 @@ static void rt2800_config_channel(struct ++@@ -3506,6 +3542,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); +@@ -76,7 +76,7 @@ Signed-off-by: Gabor Juhos + } else { + 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 + !rt2x00_rt(rt2x00dev, RT5392)) { + if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) { + rt2800_bbp_write(rt2x00dev, 82, 0x62); +@@ -84,7 +84,7 @@ Signed-off-by: Gabor Juhos + rt2800_bbp_write(rt2x00dev, 75, 0x46); + } 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 + rt2800_bbp_write(rt2x00dev, 82, 0x84); + rt2800_bbp_write(rt2x00dev, 75, 0x50); + } +@@ -110,7 +110,7 @@ Signed-off-by: Gabor Juhos + rt2800_bbp_write(rt2x00dev, 83, 0x9a); + + 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 + + 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 +--- 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 + + --- 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 + 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 +--- 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 + + --- 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 + 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 +--- 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 + + --- 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 + { + u16 word; + +@@ -21,7 +21,7 @@ Signed-off-by: Gabor Juhos + return 0; + + 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 + { + u16 word; + +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 +--- 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 + + --- 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 + 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 +--- 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 + + --- 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 + 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 +--- 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 + + --- 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 + rt2800_eeprom_read(rt2x00dev, EEPROM_LNA, &eeprom); + lna_gain = rt2x00_get_field16(eeprom, EEPROM_LNA_A0); + } else if (libconf->rf.channel <= 128) { +@@ -20,7 +20,7 @@ Signed-off-by: Gabor Juhos + rt2800_eeprom_read(rt2x00dev, EEPROM_EXT_LNA2, &eeprom); + 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 + 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 +--- 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 + + --- 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 + else + vgc = 0x2e + rt2x00dev->lna_gain; + } else { /* 5GHZ band */ +@@ -20,7 +20,7 @@ Signed-off-by: Gabor Juhos + vgc = 0x20 + (rt2x00dev->lna_gain * 5) / 3; + 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 + { + if (qual->vgc_level != vgc_level) { + if (rt2x00_rt(rt2x00dev, RT3572) || +@@ -30,7 +30,7 @@ Signed-off-by: Gabor Juhos + rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, + 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 + } + 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 +--- 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 + + --- 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 + 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); +@@ -20,7 +20,7 @@ Signed-off-by: Gabor Juhos + if (rt2x00_get_field16(word, EEPROM_RSSI_BG2_LNA_A1) == 0x00 || + 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 + 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); +@@ -30,7 +30,7 @@ Signed-off-by: Gabor Juhos + if (rt2x00_get_field16(word, EEPROM_RSSI_A2_LNA_A2) == 0x00 || + 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 + } + 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 +--- 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 + + --- 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 + 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 +--- 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 + + --- 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 + if (retval) + return retval; + +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 +--- a/package/kernel/mac80211/patches/603-rt2x00-introduce-rt2x00eeprom.patch ++++ b/package/kernel/mac80211/patches/603-rt2x00-introduce-rt2x00eeprom.patch +@@ -1,13 +1,13 @@ + --- a/.local-symbols + +++ b/.local-symbols +-@@ -263,6 +263,7 @@ RT2X00_LIB_FIRMWARE= ++@@ -312,6 +312,7 @@ RT2X00_LIB_FIRMWARE= + RT2X00_LIB_CRYPTO= + RT2X00_LIB_LEDS= + RT2X00_LIB_DEBUGFS= + +RT2X00_LIB_EEPROM= + RT2X00_DEBUG= +- RTL_CARDS= +- RTL8192CE= ++ WL_MEDIATEK= ++ MT7601U= + --- a/drivers/net/wireless/rt2x00/Kconfig + +++ b/drivers/net/wireless/rt2x00/Kconfig + @@ -69,6 +69,7 @@ config RT2800PCI +@@ -48,7 +48,7 @@ + obj-$(CPTCFG_RT2X00_LIB_MMIO) += rt2x00mmio.o + --- a/drivers/net/wireless/rt2x00/rt2800lib.h + +++ b/drivers/net/wireless/rt2x00/rt2800lib.h +-@@ -43,6 +43,8 @@ struct rt2800_drv_data { ++@@ -46,6 +46,8 @@ struct rt2800_drv_data { + } shmem_lock; + }; + +@@ -57,7 +57,7 @@ + struct rt2800_ops { + void (*register_read)(struct rt2x00_dev *rt2x00dev, + const unsigned int offset, u32 *value); +-@@ -176,6 +178,15 @@ static inline int rt2800_read_eeprom(str ++@@ -179,6 +181,15 @@ static inline int rt2800_read_eeprom(str + { + const struct rt2800_ops *rt2800ops = rt2x00dev->ops->drv; + +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 +--- 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 @@ + * 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 + 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/610-rt2x00-fix-rt3352-ext-pa.patch b/package/kernel/mac80211/patches/610-rt2x00-fix-rt3352-ext-pa.patch +index 067d2ea..39b1ccc 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 +-@@ -3552,11 +3552,18 @@ static void rt2800_config_channel(struct ++@@ -3528,11 +3528,18 @@ static void rt2800_config_channel(struct + /* + * Change BBP settings + */ +@@ -19,7 +19,7 @@ + } else if (rt2x00_rt(rt2x00dev, RT3593)) { + 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 + + static void rt2800_init_rfcsr_3352(struct rt2x00_dev *rt2x00dev) + { +@@ -32,7 +32,7 @@ + rt2800_rf_init_calibration(rt2x00dev, 30); + + 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 + rt2800_rfcsr_write(rt2x00dev, 31, 0x80); + rt2800_rfcsr_write(rt2x00dev, 32, 0x80); + rt2800_rfcsr_write(rt2x00dev, 33, 0x00); +@@ -66,7 +66,7 @@ + rt2800_rfcsr_write(rt2x00dev, 43, 0xdb); + 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 + rt2800_rfcsr_write(rt2x00dev, 47, 0x0d); + rt2800_rfcsr_write(rt2x00dev, 48, 0x14); + rt2800_rfcsr_write(rt2x00dev, 49, 0x00); +@@ -96,7 +96,7 @@ + rt2800_rfcsr_write(rt2x00dev, 59, 0x00); + 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 + * RT53xx: defined in "EEPROM_CHIP_ID" field + */ + if (rt2x00_rt(rt2x00dev, RT3290) || +@@ -104,7 +104,7 @@ + rt2x00_rt(rt2x00dev, RT5390) || + 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 + /* + * Detect if this device has Bluetooth co-existence. + */ +@@ -114,7 +114,7 @@ + __set_bit(CAPABILITY_BT_COEXIST, &rt2x00dev->cap_flags); + + /* +-@@ -7822,6 +7857,22 @@ static int rt2800_init_eeprom(struct rt2 ++@@ -7798,6 +7833,22 @@ static int rt2800_init_eeprom(struct rt2 + EIRP_MAX_TX_POWER_LIMIT) + __set_bit(CAPABILITY_POWER_LIMIT, &rt2x00dev->cap_flags); + +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 +--- 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 +-@@ -8209,6 +8209,27 @@ static const struct rf_channel rf_vals_5 ++@@ -8185,6 +8185,27 @@ static const struct rf_channel rf_vals_5 + {196, 83, 0, 12, 1}, + }; + +@@ -28,7 +28,7 @@ + static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev) + { + 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 + case RF5390: + case RF5392: + spec->num_channels = 14; +@@ -40,7 +40,7 @@ + break; + + case RF3052: +-@@ -8481,6 +8505,19 @@ static int rt2800_probe_rt(struct rt2x00 ++@@ -8455,6 +8479,19 @@ static int rt2800_probe_rt(struct rt2x00 + return 0; + } + +@@ -60,7 +60,7 @@ + int rt2800_probe_hw(struct rt2x00_dev *rt2x00dev) + { + 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 + rt2800_register_write(rt2x00dev, GPIO_CTRL, reg); + + /* +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 +--- a/package/kernel/mac80211/patches/615-rt2x00-fix_20mhz_clk.patch ++++ b/package/kernel/mac80211/patches/615-rt2x00-fix_20mhz_clk.patch +@@ -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 + + 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 +--- a/package/kernel/mac80211/patches/616-rt2x00-support-rt5350.patch ++++ b/package/kernel/mac80211/patches/616-rt2x00-support-rt5350.patch +@@ -10,7 +10,7 @@ + #define RF5370 0x5370 + --- 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 + + rt2800_rfcsr_write(rt2x00dev, 59, + r59_non_bt[idx]); +@@ -24,7 +24,7 @@ + } + } + } +-@@ -3516,6 +3523,7 @@ static void rt2800_config_channel(struct ++@@ -3492,6 +3499,7 @@ static void rt2800_config_channel(struct + rt2800_config_channel_rf3853(rt2x00dev, conf, rf, info); + break; + case RF3070: +@@ -32,7 +32,7 @@ + case RF5360: + case RF5362: + case RF5370: +-@@ -3534,6 +3542,7 @@ static void rt2800_config_channel(struct ++@@ -3510,6 +3518,7 @@ static void rt2800_config_channel(struct + if (rt2x00_rf(rt2x00dev, RF3070) || + rt2x00_rf(rt2x00dev, RF3290) || + rt2x00_rf(rt2x00dev, RF3322) || +@@ -40,7 +40,7 @@ + rt2x00_rf(rt2x00dev, RF5360) || + 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 + /* + * Clear update flag + */ +@@ -50,7 +50,7 @@ + rt2800_bbp_read(rt2x00dev, 49, &bbp); + 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 + case RF3070: + case RF3290: + case RF3853: +@@ -58,7 +58,7 @@ + case RF5360: + case RF5362: + case RF5370: +-@@ -5111,6 +5122,8 @@ static int rt2800_init_registers(struct ++@@ -5087,6 +5098,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); +@@ -67,7 +67,7 @@ + } else { + 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 + + rt2800_bbp_write(rt2x00dev, 82, 0x62); + +@@ -84,7 +84,7 @@ + + 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 + + rt2800_bbp_write(rt2x00dev, 104, 0x92); + +@@ -101,7 +101,7 @@ + + 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 + rt2800_bbp_write(rt2x00dev, 143, 0xa2); + + rt2800_bbp_write(rt2x00dev, 148, 0xc8); +@@ -115,7 +115,7 @@ + } + + 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 + rt2800_init_bbp_3290(rt2x00dev); + break; + case RT3352: +@@ -123,7 +123,7 @@ + rt2800_init_bbp_3352(rt2x00dev); + 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 + rt2800_rfcsr_write(rt2x00dev, 20, rfcsr); + } + +@@ -200,7 +200,7 @@ + static void rt2800_init_rfcsr_5390(struct rt2x00_dev *rt2x00dev) + { + 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 + case RT3593: + rt2800_init_rfcsr_3593(rt2x00dev); + break; +@@ -210,7 +210,7 @@ + case RT5390: + 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 + 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); +@@ -223,7 +223,7 @@ + } else if (rt2x00_rt(rt2x00dev, RT2860) || + 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 + rt2800_eeprom_read(rt2x00dev, EEPROM_CHIP_ID, &rf); + else if (rt2x00_rt(rt2x00dev, RT3883)) + rf = RF3853; +@@ -232,7 +232,7 @@ + else + 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 + case RF3320: + case RF3322: + case RF3853: +@@ -240,7 +240,7 @@ + case RF5360: + 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 + case RF3290: + case RF3320: + case RF3322: +@@ -248,7 +248,7 @@ + case RF5360: + 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 + case RF3070: + case RF3290: + case RF3853: +@@ -256,7 +256,7 @@ + case RF5360: + 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 + case RT3572: + case RT3593: + case RT3883: +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 +--- 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 +@@ -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 + rt2800_init_led(rt2x00dev, &rt2x00dev->led_assoc, LED_TYPE_ASSOC); + rt2800_init_led(rt2x00dev, &rt2x00dev->led_qual, LED_TYPE_QUALITY); + +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 +--- 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 +-@@ -7841,10 +7841,11 @@ static int rt2800_init_eeprom(struct rt2 ++@@ -7817,10 +7817,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 +--- 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 @@ + * RFCSR 31: + --- 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 + rt2x00_rf(rt2x00dev, RF5390) || + rt2x00_rf(rt2x00dev, RF5392)) { + rt2800_rfcsr_read(rt2x00dev, 30, &rfcsr); +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 +--- 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 + goto err_wiphy_new; + } + +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 +--- 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 + wdev->wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites); + wdev->wiphy->reg_notifier = lbs_reg_notifier; + +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 +--- a/package/kernel/mac80211/patches/820-b43-add-antenna-control.patch ++++ b/package/kernel/mac80211/patches/820-b43-add-antenna-control.patch +@@ -9,7 +9,7 @@ + antenna = b43_antenna_to_phyctl(antenna); + ctl = b43_shm_read16(dev, B43_SHM_SHARED, B43_SHM_SH_BEACPHYCTL); + /* We can't send beacons with short preamble. Would get PHY errors. */ +-@@ -3302,8 +3302,8 @@ static int b43_chip_init(struct b43_wlde ++@@ -3300,8 +3300,8 @@ static int b43_chip_init(struct b43_wlde + + /* Select the antennae */ + if (phy->ops->set_rx_antenna) +@@ -20,7 +20,7 @@ + + if (phy->type == B43_PHYTYPE_B) { + value16 = b43_read16(dev, 0x005E); +-@@ -4003,7 +4003,6 @@ static int b43_op_config(struct ieee8021 ++@@ -4001,7 +4001,6 @@ static int b43_op_config(struct ieee8021 + struct b43_wldev *dev = wl->current_dev; + struct b43_phy *phy = &dev->phy; + struct ieee80211_conf *conf = &hw->conf; +@@ -28,7 +28,7 @@ + int err = 0; + + mutex_lock(&wl->mutex); +-@@ -4046,11 +4045,9 @@ static int b43_op_config(struct ieee8021 ++@@ -4044,11 +4043,9 @@ static int b43_op_config(struct ieee8021 + } + + /* Antennas for RX and management frame TX. */ +@@ -42,7 +42,7 @@ + + if (wl->radio_enabled != phy->radio_on) { + if (wl->radio_enabled) { +-@@ -5213,6 +5210,47 @@ static int b43_op_get_survey(struct ieee ++@@ -5209,6 +5206,47 @@ static int b43_op_get_survey(struct ieee + return 0; + } + +@@ -90,7 +90,7 @@ + static const struct ieee80211_ops b43_hw_ops = { + .tx = b43_op_tx, + .conf_tx = b43_op_conf_tx, +-@@ -5234,6 +5272,8 @@ static const struct ieee80211_ops b43_hw ++@@ -5230,6 +5268,8 @@ static const struct ieee80211_ops b43_hw + .sw_scan_complete = b43_op_sw_scan_complete_notifier, + .get_survey = b43_op_get_survey, + .rfkill_poll = b43_rfkill_poll, +@@ -99,7 +99,7 @@ + }; + + /* Hard-reset the chip. Do not call this directly. +-@@ -5542,6 +5582,8 @@ static int b43_one_core_attach(struct b4 ++@@ -5538,6 +5578,8 @@ static int b43_one_core_attach(struct b4 + if (!wldev) + goto out; + +@@ -108,7 +108,7 @@ + wldev->use_pio = b43_modparam_pio; + wldev->dev = dev; + wldev->wl = wl; +-@@ -5632,6 +5674,9 @@ static struct b43_wl *b43_wireless_init( ++@@ -5628,6 +5670,9 @@ static struct b43_wl *b43_wireless_init( + + hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN; + +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 +--- 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 ++@@ -692,9 +692,37 @@ static struct wireless_dev *brcmf_cfg802 + u32 *flags, + struct vif_params *params) + { +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 +--- a/package/kernel/mac80211/patches/900-wlcore-Add-support-for-DT-platform-data.patch ++++ /dev/null +@@ -1,139 +0,0 @@ +-When running with DT, we no longer have a board file that can set up the +-platform data for wlcore. Allow this data to be passed from DT. +- +-Since some platforms use a gpio-irq, add support for passing either the +-irq number or the gpio number. For the latter case, the driver will +-request the gpio and convert it to the irq number. If an irq is +-specified, it'll be used as is. +- +-[Arik - the pdev_data pointer does not belong to us and is freed when +-the device is released. Dereference to our private data first.] +- +-Signed-off-by: Ido Yariv +-Signed-off-by: Arik Nemtsov +---- +- drivers/net/wireless/ti/wlcore/sdio.c | 71 ++++++++++++++++++++++++++++++++--- +- include/linux/wl12xx.h | 3 +- +- 2 files changed, 67 insertions(+), 7 deletions(-) +- +---- a/drivers/net/wireless/ti/wlcore/sdio.c +-+++ b/drivers/net/wireless/ti/wlcore/sdio.c +-@@ -34,6 +34,7 @@ +- #include +- #include +- #include +-+#include +- +- #include "wlcore.h" +- #include "wl12xx_80211.h" +-@@ -214,6 +215,61 @@ static struct wl1271_if_operations sdio_ +- .set_block_size = wl1271_sdio_set_block_size, +- }; +- +-+static const struct of_device_id wlcore_of_match[] = { +-+ { +-+ .compatible = "wlcore", +-+ }, +-+ {} +-+}; +-+MODULE_DEVICE_TABLE(of, wlcore_of_match); +-+ +-+static struct wl12xx_platform_data *get_platform_data(struct device *dev) +-+{ +-+ struct wl12xx_platform_data *pdata; +-+ struct device_node *np; +-+ u32 gpio; +-+ +-+ pdata = wl12xx_get_platform_data(); +-+ if (!IS_ERR(pdata)) +-+ return kmemdup(pdata, sizeof(*pdata), GFP_KERNEL); +-+ +-+ np = of_find_matching_node(NULL, wlcore_of_match); +-+ if (!np) { +-+ dev_err(dev, "No platform data set\n"); +-+ return NULL; +-+ } +-+ +-+ pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); +-+ if (!pdata) { +-+ dev_err(dev, "Can't allocate platform data\n"); +-+ return NULL; +-+ } +-+ +-+ if (of_property_read_u32(np, "irq", &pdata->irq)) { +-+ if (!of_property_read_u32(np, "gpio", &gpio) && +-+ !gpio_request_one(gpio, GPIOF_IN, "wlcore_irq")) { +-+ pdata->gpio = gpio; +-+ pdata->irq = gpio_to_irq(gpio); +-+ } +-+ } +-+ +-+ /* Optional fields */ +-+ pdata->use_eeprom = of_property_read_bool(np, "use-eeprom"); +-+ of_property_read_u32(np, "board-ref-clock", &pdata->board_ref_clock); +-+ of_property_read_u32(np, "board-tcxo-clock", &pdata->board_tcxo_clock); +-+ of_property_read_u32(np, "platform-quirks", &pdata->platform_quirks); +-+ +-+ return pdata; +-+} +-+ +-+static void del_platform_data(struct wl12xx_platform_data *pdata) +-+{ +-+ if (pdata->gpio) +-+ gpio_free(pdata->gpio); +-+ +-+ kfree(pdata); +-+} +-+ +- static int wl1271_probe(struct sdio_func *func, +- const struct sdio_device_id *id) +- { +-@@ -245,10 +301,10 @@ static int wl1271_probe(struct sdio_func +- /* Use block mode for transferring over one block size of data */ +- func->card->quirks |= MMC_QUIRK_BLKSZ_FOR_BYTE_MODE; +- +-- pdev_data.pdata = wl12xx_get_platform_data(); +-- if (IS_ERR(pdev_data.pdata)) { +-- ret = PTR_ERR(pdev_data.pdata); +-- dev_err(glue->dev, "missing wlan platform data: %d\n", ret); +-+ pdev_data.pdata = get_platform_data(&func->dev); +-+ if (!pdev_data.pdata) { +-+ ret = -EINVAL; +-+ dev_err(glue->dev, "missing wlan platform data\n"); +- goto out_free_glue; +- } +- +-@@ -279,7 +335,7 @@ static int wl1271_probe(struct sdio_func +- if (!glue->core) { +- dev_err(glue->dev, "can't allocate platform_device"); +- ret = -ENOMEM; +-- goto out_free_glue; +-+ goto out_free_pdata; +- } +- +- glue->core->dev.parent = &func->dev; +-@@ -313,6 +369,9 @@ static int wl1271_probe(struct sdio_func +- out_dev_put: +- platform_device_put(glue->core); +- +-+out_free_pdata: +-+ del_platform_data(pdev_data->pdata); +-+ +- out_free_glue: +- kfree(glue); +- +-@@ -323,11 +382,14 @@ out: +- static void wl1271_remove(struct sdio_func *func) +- { +- struct wl12xx_sdio_glue *glue = sdio_get_drvdata(func); +-+ struct wlcore_platdev_data *pdev_data = glue->core->dev.platform_data; +-+ struct wl12xx_platform_data *pdata = pdev_data->pdata; +- +- /* Undo decrement done above in wl1271_probe */ +- pm_runtime_get_noresume(&func->dev); +- +- platform_device_unregister(glue->core); +-+ del_platform_data(pdata); +- kfree(glue); +- } +- +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 +--- a/package/kernel/mac80211/patches/910-01-add-support-for-mt7620.patch ++++ b/package/kernel/mac80211/patches/910-01-add-support-for-mt7620.patch +@@ -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 + rt2800_bbp_write(rt2x00dev, 196, (rf->channel <= 14) ? 0x19 : 0x7F); + } + +@@ -258,6 +258,7 @@ + + u32 mac_sys_ctrl, mac_status; + + u32 tx_pin = 0x00150F0F; + + struct hw_mode_spec *spec = &rt2x00dev->spec; +++ struct rt2800_drv_data *drv_data = rt2x00dev->drv_data; + + + + /* Frequeny plan setting */ + + /* +@@ -383,7 +384,6 @@ + + rfcsr &= (~0x4); + + rt2800_rfcsr_write(rt2x00dev, 28, rfcsr); + + +-+ struct rt2800_drv_data *drv_data = rt2x00dev->drv_data; + + /*if (bScan == FALSE)*/ + + if (conf_is_ht40(conf)) { + + txrx_agc_fc = rt2x00_get_field8(drv_data->calibration_bw40, +@@ -523,7 +523,7 @@ + static void rt2800_bbp_write_with_rx_chain(struct rt2x00_dev *rt2x00dev, + 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 + struct channel_info *info) + { + u32 reg; +@@ -532,7 +532,7 @@ + u8 bbp, rfcsr; + + 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 + case RF5592: + rt2800_config_channel_rf55xx(rt2x00dev, conf, rf, info); + break; +@@ -542,7 +542,7 @@ + default: + 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 + else if (rt2x00_rt(rt2x00dev, RT3593) || + rt2x00_rt(rt2x00dev, RT3883)) + rt2800_bbp_write(rt2x00dev, 82, 0x82); +@@ -551,7 +551,7 @@ + rt2800_bbp_write(rt2x00dev, 82, 0xf2); + + 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 + if (rt2x00_rt(rt2x00dev, RT3572)) + rt2800_rfcsr_write(rt2x00dev, 8, 0); + +@@ -560,7 +560,7 @@ + + 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 + + rt2x00_set_field32(&tx_pin, TX_PIN_CFG_RFTR_EN, 1); + rt2x00_set_field32(&tx_pin, TX_PIN_CFG_TRSW_EN, 1); +@@ -568,7 +568,7 @@ + + 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 + rt2x00_set_field8(&rfcsr, RFCSR3_VCOCAL_EN, 1); + rt2800_rfcsr_write(rt2x00dev, 3, rfcsr); + break; +@@ -583,7 +583,7 @@ + default: + return; + } +-@@ -5125,9 +5516,42 @@ static int rt2800_init_registers(struct ++@@ -5101,9 +5492,42 @@ static int rt2800_init_registers(struct + } else if (rt2x00_rt(rt2x00dev, RT5390) || + rt2x00_rt(rt2x00dev, RT5392) || + rt2x00_rt(rt2x00dev, RT5592)) { +@@ -629,7 +629,7 @@ + } else if (rt2x00_rt(rt2x00dev, RT5350)) { + 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 + rt2800_bbp_write(rt2x00dev, 103, 0xc0); + } + +@@ -855,7 +855,7 @@ + static void rt2800_init_bbp(struct rt2x00_dev *rt2x00dev) + { + 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 + return; + case RT5390: + case RT5392: +@@ -867,7 +867,7 @@ + break; + 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 + rt2800_led_open_drain_enable(rt2x00dev); + } + +@@ -875,6 +875,8 @@ + +{ + + u16 freq; + + u8 rfvalue; +++ struct hw_mode_spec *spec = &rt2x00dev->spec; +++ + + /* Initialize RF central register to default value */ + + rt2800_rfcsr_write(rt2x00dev, 0, 0x02); + + rt2800_rfcsr_write(rt2x00dev, 1, 0x03); +@@ -921,7 +923,6 @@ + + rt2800_rfcsr_write(rt2x00dev, 42, 0x5B); + + rt2800_rfcsr_write(rt2x00dev, 43, 0x00); + + +-+ struct hw_mode_spec *spec = &rt2x00dev->spec; + + rt2800_rfcsr_write(rt2x00dev, 11, 0x21); + + if (spec->clk_is_20mhz) + + rt2800_rfcsr_write(rt2x00dev, 13, 0x03); +@@ -1163,7 +1164,7 @@ + static void rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev) + { + 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 + rt2800_init_rfcsr_5350(rt2x00dev); + break; + case RT5390: +@@ -1175,7 +1176,7 @@ + break; + 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 + case RF5390: + case RF5392: + case RF5592: +@@ -1183,7 +1184,7 @@ + break; + 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 + case RF5372: + case RF5390: + case RF5392: +@@ -1191,7 +1192,7 @@ + spec->num_channels = 14; + 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 + case RF5372: + case RF5390: + case RF5392: +diff --git a/package/kernel/mac80211/patches/920-ath10k_allow_fallback_to_board_bin_on_empty_otp_stream.patch b/package/kernel/mac80211/patches/920-ath10k_allow_fallback_to_board_bin_on_empty_otp_stream.patch +deleted file mode 100644 +index 4c04d4f..0000000 +--- a/package/kernel/mac80211/patches/920-ath10k_allow_fallback_to_board_bin_on_empty_otp_stream.patch ++++ /dev/null +@@ -1,20 +0,0 @@ +---- a/drivers/net/wireless/ath/ath10k/core.c +-+++ b/drivers/net/wireless/ath/ath10k/core.c +-@@ -387,9 +387,14 @@ static int ath10k_download_and_run_otp(s +- +- ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot otp execute result %d\n", result); +- +-- if (!skip_otp && result != 0) { +-- ath10k_err(ar, "otp calibration failed: %d", result); +-- return -EINVAL; +-+ if (!skip_otp) { +-+ if (result == 2) { +-+ ath10k_warn(ar, "otp stream is empty, using board.bin contents"); +-+ return 0; +-+ } else if (result != 0) { +-+ ath10k_err(ar, "otp calibration failed: %d", result); +-+ return -EINVAL; +-+ } +- } +- +- 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 +--- 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 + + --- 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 * + 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 +--- 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 + return arvif_iter.arvif; + } + +@@ -22,7 +22,7 @@ + int ath10k_mac_register(struct ath10k *ar) + { + 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 + 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 +--- /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 ++ ++ priv->running_bsses = 0; ++ +++ wait_for_completion(&priv->firmware_loading_complete); +++ ++ return rc; ++ ++ err_stop_firmware: ++@@ -6294,8 +6296,6 @@ static void mwl8k_remove(struct pci_dev ++ return; ++ priv = hw->priv; ++ ++- wait_for_completion(&priv->firmware_loading_complete); ++- ++ if (priv->fw_state == FW_STATE_ERROR) { ++ mwl8k_hw_reset(priv); ++ goto unmap; +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 +--- a/package/kernel/mt76/patches/001-backport_ieee80211_hw_set.patch ++++ /dev/null +@@ -1,12 +0,0 @@ +---- a/init.c +-+++ b/init.c +-@@ -16,6 +16,9 @@ +- #include "eeprom.h" +- #include "mcu.h" +- +-+#define ieee80211_hw_set(hw, flag) \ +-+ do { (hw)->flags |= IEEE80211_HW_##flag; } while(0) +-+ +- static bool +- mt76_wait_for_mac(struct mt76_dev *dev) +- { diff --git a/patches/openwrt/0016-mac80211-set-mcast-rate-for-mesh-point-interfaces.patch b/patches/openwrt/0016-mac80211-set-mcast-rate-for-mesh-point-interfaces.patch index cb5d7b5e..2f57a812 100644 --- a/patches/openwrt/0016-mac80211-set-mcast-rate-for-mesh-point-interfaces.patch +++ b/patches/openwrt/0016-mac80211-set-mcast-rate-for-mesh-point-interfaces.patch @@ -14,7 +14,7 @@ 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 c9bc3d6..8137b24 100644 +index 2a8d2f9..8d31a80 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -455,12 +455,7 @@ mac80211_prepare_vif() { diff --git a/patches/openwrt/0033-mac80211-fix-crash-when-using-mesh-11s-VIF-together-with-another-VIF.patch b/patches/openwrt/0033-mac80211-fix-crash-when-using-mesh-11s-VIF-together-with-another-VIF.patch new file mode 100644 index 00000000..ce907a22 --- /dev/null +++ b/patches/openwrt/0033-mac80211-fix-crash-when-using-mesh-11s-VIF-together-with-another-VIF.patch @@ -0,0 +1,82 @@ +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-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch b/patches/openwrt/0034-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch new file mode 100644 index 00000000..d47cdd13 --- /dev/null +++ b/patches/openwrt/0034-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch @@ -0,0 +1,70 @@ +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 f332cbd..28f40c8 100644 +--- a/package/kernel/mac80211/Makefile ++++ b/package/kernel/mac80211/Makefile +@@ -270,6 +270,29 @@ Atheros IEEE 802.11ac family of chipsets. For now only + PCI is supported. + endef + ++define KernelPackage/ath10k/config ++ if PACKAGE_kmod-ath10k ++ choice ++ prompt "ath10k firmware flavour" ++ default ATH10K_AP_FW ++ help ++ This option allows you to choose between different ath10k firmwares. ++ ++ config ATH10K_AP_FW ++ bool "Firmware optimized for AP operation" ++ help ++ Use the ath10k firmware optimized for access point operation. ++ Supports only AP mode, will crash in IBSS (ad-hoc) mode. ++ ++ config ATH10K_CT_COMMUNITY_FW ++ bool "Firmware by Candela Technologies (community version)" ++ help ++ Supports both AP and IBSS (ad-hoc) mode. Doesn't support ++ encryption when using multiple VIFs. ++ endchoice ++ endif ++ endef ++ + PKG_ATH10K_LINUX_FIRMWARE_NAME:=ath10k-firmware + PKG_ATH10K_LINUX_FIRMWARE_VERSION:=b46f3e01a6c1f9150fb4612ef53611d714565842 + PKG_ATH10K_LINUX_FIRMWARE_SOURCE:=$(PKG_ATH10K_LINUX_FIRMWARE_NAME)-$(PKG_ATH10K_LINUX_FIRMWARE_VERSION).tar.bz2 +@@ -288,6 +311,14 @@ define Download/ath10k-firmware + endef + $(eval $(call Download,ath10k-firmware)) + ++ATH10K_CT_COMMUNITY_FW:=firmware-2-ct-full-community-14.bin ++define Download/ath10k-firmware-ct-community ++ FILE:=$(ATH10K_CT_COMMUNITY_FW) ++ URL:=http://www.candelatech.com/downloads/ ++ MD5SUM:=800799459c20c1683138c74b3ba58f25 ++endef ++$(eval $(call Download,ath10k-firmware-ct-community)) ++ + + #Broadcom firmware + ifneq ($(CONFIG_B43_FW_6_30),) +@@ -1854,9 +1885,16 @@ define KernelPackage/ath10k/install + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/ath10k/QCA988X/hw2.0/board.bin \ + $(1)/lib/firmware/ath10k/QCA988X/hw2.0/ ++ifeq ($(CONFIG_ATH10K_AP_FW),y) + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.2.4/untested/firmware-5.bin_10.2.4.70-2 \ + $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-5.bin ++endif ++ifeq ($(CONFIG_ATH10K_CT_COMMUNITY_FW),y) ++ $(INSTALL_DATA) \ ++ $(DL_DIR)/$(ATH10K_CT_COMMUNITY_FW) \ ++ $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin ++endif + endef + + define KernelPackage/b43/install From 34183c1cb261811fa71edf9326f674bc7815afef Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 2 Nov 2015 15:09:01 +0100 Subject: [PATCH 191/867] build: further fixes for clean builds usign has pulled in new dependencies, and OpenWrt doesn't like the command `make tools/prepare` in a clean build. --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d32073ab..b978e349 100644 --- a/Makefile +++ b/Makefile @@ -203,7 +203,9 @@ feeds: FORCE +$(GLUONMAKE_EARLY) prepare-tmpinfo gluon-tools: FORCE + +$(GLUONMAKE_EARLY) tools/patch/install +$(GLUONMAKE_EARLY) tools/sed/install + +$(GLUONMAKE_EARLY) tools/cmake/install +$(GLUONMAKE_EARLY) package/lua/host/install package/usign/host/install @@ -271,7 +273,7 @@ config: FORCE | sed -e 's/ /\n/g'; \ ) > $(BOARD_BUILDDIR)/config.tmp scripts/config/conf --defconfig=$(BOARD_BUILDDIR)/config.tmp Config.in - +$(NO_TRACE_MAKE) tools/prepare + +$(NO_TRACE_MAKE) tools/install prepare-target: $(GLUON_OPKG_KEY).pub rm $(GLUON_OPENWRTDIR)/tmp || true From 6e79982442b17de54a52ad4fc5e7ba1558475412 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 2 Nov 2015 17:40:29 +0100 Subject: [PATCH 192/867] build: improve logging of tool build --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b978e349..a1c2e7e6 100644 --- a/Makefile +++ b/Makefile @@ -273,7 +273,7 @@ config: FORCE | sed -e 's/ /\n/g'; \ ) > $(BOARD_BUILDDIR)/config.tmp scripts/config/conf --defconfig=$(BOARD_BUILDDIR)/config.tmp Config.in - +$(NO_TRACE_MAKE) tools/install + +$(SUBMAKE) tools/install prepare-target: $(GLUON_OPKG_KEY).pub rm $(GLUON_OPENWRTDIR)/tmp || true From a3feff21cfecacbcb3b492da9ac6a8c60fefb7bc Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 2 Nov 2015 19:26:15 +0100 Subject: [PATCH 193/867] ar71xx: add TP-LINK TL-WR941ND v6 support (again) --- ...k-add-correct-MAC-BB-name-for-ar9561.patch | 35 ++ ...-TL-WR941ND-v6-international-version.patch | 332 ++++++++++++++++++ targets/ar71xx-generic/profiles.mk | 6 +- 3 files changed, 370 insertions(+), 3 deletions(-) create mode 100644 patches/openwrt/0035-mac80211-ath9k-add-correct-MAC-BB-name-for-ar9561.patch create mode 100644 patches/openwrt/0036-ar71xx-add-support-for-TP-LINK-TL-WR941ND-v6-international-version.patch diff --git a/patches/openwrt/0035-mac80211-ath9k-add-correct-MAC-BB-name-for-ar9561.patch b/patches/openwrt/0035-mac80211-ath9k-add-correct-MAC-BB-name-for-ar9561.patch new file mode 100644 index 00000000..b82614fc --- /dev/null +++ b/patches/openwrt/0035-mac80211-ath9k-add-correct-MAC-BB-name-for-ar9561.patch @@ -0,0 +1,35 @@ +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-add-support-for-TP-LINK-TL-WR941ND-v6-international-version.patch b/patches/openwrt/0036-ar71xx-add-support-for-TP-LINK-TL-WR941ND-v6-international-version.patch new file mode 100644 index 00000000..e1e3b5a2 --- /dev/null +++ b/patches/openwrt/0036-ar71xx-add-support-for-TP-LINK-TL-WR941ND-v6-international-version.patch @@ -0,0 +1,332 @@ +From: Matthias Schiffer +Date: Mon, 2 Nov 2015 19:21:20 +0100 +Subject: ar71xx: add support for TP-LINK TL-WR941ND v6 (international version) + +diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh +index 89fe53c..3e80c32 100644 +--- a/target/linux/ar71xx/base-files/etc/diag.sh ++++ b/target/linux/ar71xx/base-files/etc/diag.sh +@@ -279,7 +279,8 @@ get_status_led() { + tl-wdr4300 | \ + tl-wr703n | \ + tl-wr710n | \ +- tl-wr720n-v3) ++ tl-wr720n-v3 | \ ++ tl-wr941nd-v6) + status_led="tp-link:blue:system" + ;; + tl-wr841n-v9) +diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds +index 5241db2..11b3fa0 100644 +--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds ++++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds +@@ -460,6 +460,15 @@ tl-wr941nd-v5) + ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt" + ;; + ++tl-wr941nd-v6) ++ ucidef_set_led_netdev "wan" "WAN" "tp-link:blue:wan" "eth0" ++ ucidef_set_led_switch "lan1" "LAN1" "tp-link:blue:lan1" "switch0" "0x10" ++ ucidef_set_led_switch "lan2" "LAN2" "tp-link:blue:lan2" "switch0" "0x08" ++ ucidef_set_led_switch "lan3" "LAN3" "tp-link:blue:lan3" "switch0" "0x04" ++ ucidef_set_led_switch "lan4" "LAN4" "tp-link:blue:lan4" "switch0" "0x02" ++ ucidef_set_led_wlan "wlan" "WLAN" "tp-link:blue:wlan" "phy0tpt" ++ ;; ++ + tl-wa830re-v2) + 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 +--- 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 |\ + tl-wr841n-v8 |\ + tl-wr842n-v2 |\ + tl-wr941nd-v5 |\ ++tl-wr941nd-v6 |\ + wnr2000-v3 |\ + 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 +--- 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() { + *"TL-WR941N/ND v5") + name="tl-wr941nd-v5" + ;; ++ *"TL-WR941N/ND v6") ++ name="tl-wr941nd-v6" ++ ;; + *"TL-WR703N v1") + name="tl-wr703n" + ;; +diff --git a/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx b/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx +index f11ea8c..fd337e1 100644 +--- a/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx ++++ b/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx +@@ -35,6 +35,7 @@ set_preinit_iface() { + tl-wr720n-v3 |\ + tl-wr841n-v8 |\ + tl-wr842n-v2 |\ ++ tl-wr941nd-v6 |\ + wnr2000-v3 |\ + 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 +--- 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() { + tl-wr842n-v2 | \ + tl-wr941nd | \ + tl-wr941nd-v5 | \ ++ tl-wr941nd-v6 | \ + tl-wr1041n-v2 | \ + tl-wr1043nd | \ + tl-wr1043nd-v2 | \ +diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18 +index e9b3c7c..84b5844 100644 +--- a/target/linux/ar71xx/config-3.18 ++++ b/target/linux/ar71xx/config-3.18 +@@ -132,6 +132,7 @@ CONFIG_ATH79_MACH_TL_WR841N_V1=y + CONFIG_ATH79_MACH_TL_WR841N_V8=y + CONFIG_ATH79_MACH_TL_WR841N_V9=y + CONFIG_ATH79_MACH_TL_WR941ND=y ++CONFIG_ATH79_MACH_TL_WR941ND_V6=y + CONFIG_ATH79_MACH_TUBE2H=y + CONFIG_ATH79_MACH_UBNT=y + CONFIG_ATH79_MACH_UBNT_XM=y +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941nd-v6.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941nd-v6.c +new file mode 100644 +index 0000000..55b4c00 +--- /dev/null ++++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941nd-v6.c +@@ -0,0 +1,151 @@ ++/* ++ * TP-LINK TL-WR941N/ND v6 board support ++ * ++ * Copyright (C) 2015 Matthias Schiffer ++ * ++ * 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 ++ ++#include ++#include ++ ++#include "common.h" ++#include "dev-eth.h" ++#include "dev-gpio-buttons.h" ++#include "dev-leds-gpio.h" ++#include "dev-m25p80.h" ++#include "dev-wmac.h" ++#include "machtypes.h" ++ ++ ++#define TL_WR941ND_V6_GPIO_LED_QSS 3 ++#define TL_WR941ND_V6_GPIO_LED_WAN 14 ++#define TL_WR941ND_V6_GPIO_LED_WAN_RED 15 ++#define TL_WR941ND_V6_GPIO_LED_LAN1 7 ++#define TL_WR941ND_V6_GPIO_LED_LAN2 6 ++#define TL_WR941ND_V6_GPIO_LED_LAN3 5 ++#define TL_WR941ND_V6_GPIO_LED_LAN4 4 ++#define TL_WR941ND_V6_GPIO_LED_WLAN 8 ++#define TL_WR941ND_V6_GPIO_LED_SYSTEM 18 ++ ++#define TL_WR941ND_V6_GPIO_BTN_RESET 1 ++#define TL_WR941ND_V6_GPIO_BTN_RFKILL 2 ++ ++#define TL_WR941ND_V6_KEYS_POLL_INTERVAL 20 ++#define TL_WR941ND_V6_KEYS_DEBOUNCE_INTERVAL (3 * TL_WR941ND_V6_KEYS_POLL_INTERVAL) ++ ++ ++static struct gpio_led tl_wr941nd_v6_leds_gpio[] __initdata = { ++ { ++ .name = "tp-link:blue:qss", ++ .gpio = TL_WR941ND_V6_GPIO_LED_QSS, ++ .active_low = 1, ++ }, ++ { ++ .name = "tp-link:blue:wan", ++ .gpio = TL_WR941ND_V6_GPIO_LED_WAN, ++ .active_low = 1, ++ }, ++ { ++ .name = "tp-link:red:wan", ++ .gpio = TL_WR941ND_V6_GPIO_LED_WAN_RED, ++ .active_low = 0, ++ }, ++ { ++ .name = "tp-link:blue:lan1", ++ .gpio = TL_WR941ND_V6_GPIO_LED_LAN1, ++ .active_low = 1, ++ }, ++ { ++ .name = "tp-link:blue:lan2", ++ .gpio = TL_WR941ND_V6_GPIO_LED_LAN2, ++ .active_low = 1, ++ }, ++ { ++ .name = "tp-link:blue:lan3", ++ .gpio = TL_WR941ND_V6_GPIO_LED_LAN3, ++ .active_low = 1, ++ }, ++ { ++ .name = "tp-link:blue:lan4", ++ .gpio = TL_WR941ND_V6_GPIO_LED_LAN4, ++ .active_low = 1, ++ }, ++ { ++ .name = "tp-link:blue:wlan", ++ .gpio = TL_WR941ND_V6_GPIO_LED_WLAN, ++ .active_low = 1, ++ }, ++ { ++ .name = "tp-link:blue:system", ++ .gpio = TL_WR941ND_V6_GPIO_LED_SYSTEM, ++ .active_low = 1, ++ }, ++}; ++ ++static struct gpio_keys_button tl_wr941nd_v6_gpio_keys[] __initdata = { ++ { ++ .desc = "Reset button", ++ .type = EV_KEY, ++ .code = KEY_RESTART, ++ .debounce_interval = TL_WR941ND_V6_KEYS_DEBOUNCE_INTERVAL, ++ .gpio = TL_WR941ND_V6_GPIO_BTN_RESET, ++ .active_low = 1, ++ }, { ++ .desc = "RFKILL button", ++ .type = EV_KEY, ++ .code = KEY_RFKILL, ++ .debounce_interval = TL_WR941ND_V6_KEYS_DEBOUNCE_INTERVAL, ++ .gpio = TL_WR941ND_V6_GPIO_BTN_RFKILL, ++ .active_low = 1, ++ } ++}; ++ ++ ++static const char *tl_wr941n_v6_part_probes[] = { ++ "tp-link", ++ NULL, ++}; ++ ++static struct flash_platform_data tl_wr941n_v6_flash_data = { ++ .part_probes = tl_wr941n_v6_part_probes, ++}; ++ ++ ++static void __init tl_wr941nd_v6_setup(void) ++{ ++ u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); ++ u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000); ++ ++ ath79_register_m25p80(&tl_wr941n_v6_flash_data); ++ ++ ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr941nd_v6_leds_gpio), ++ tl_wr941nd_v6_leds_gpio); ++ ++ ath79_register_gpio_keys_polled(-1, TL_WR941ND_V6_KEYS_POLL_INTERVAL, ++ ARRAY_SIZE(tl_wr941nd_v6_gpio_keys), ++ tl_wr941nd_v6_gpio_keys); ++ ++ ath79_register_mdio(0, 0x0); ++ ++ ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1); ++ ath79_init_mac(ath79_eth1_data.mac_addr, mac, -1); ++ ++ ath79_switch_data.phy4_mii_en = 1; ++ ath79_switch_data.phy_poll_mask = BIT(0); ++ ath79_eth0_data.phy_mask = BIT(0); ++ ++ ath79_register_eth(0); ++ ath79_register_eth(1); ++ ++ ath79_register_wmac(ee, mac); ++ ++} ++ ++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 +--- a/target/linux/ar71xx/image/Makefile ++++ b/target/linux/ar71xx/image/Makefile +@@ -600,7 +600,7 @@ endef + + define Device/tl-wr941nd-v6 + $(Device/tplink-4mlzma) +- BOARDNAME := TL-WDR3500 ++ BOARDNAME := TL-WR941ND-v6 + DEVICE_PROFILE := TLWR941 + TPLINK_HWID := 0x09410006 + endef +diff --git a/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch b/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch +index 2fa041b..185cb9c 100644 +--- a/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch ++++ b/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch +@@ -1,6 +1,6 @@ + --- a/arch/mips/ath79/machtypes.h + +++ b/arch/mips/ath79/machtypes.h +-@@ -16,22 +16,197 @@ ++@@ -16,22 +16,198 @@ + + enum ath79_mach_type { + ATH79_MACH_GENERIC = 0, +@@ -148,6 +148,7 @@ + + ATH79_MACH_TL_WR842N_V2, /* TP-LINK TL-WR842N/ND v2 */ + + ATH79_MACH_TL_WR941ND, /* TP-LINK TL-WR941ND */ + + ATH79_MACH_TL_WR941ND_V5, /* TP-LINK TL-WR941ND v5 */ +++ ATH79_MACH_TL_WR941ND_V6, /* TP-LINK TL-WR941ND v6 */ + + ATH79_MACH_TUBE2H, /* Alfa Network Tube2H */ + + ATH79_MACH_UBNT_AIRGW, /* Ubiquiti AirGateway */ + ATH79_MACH_UBNT_AIRROUTER, /* Ubiquiti AirRouter */ +@@ -271,7 +272,7 @@ + config ATH79_MACH_AP121 + bool "Atheros AP121 reference board" + select SOC_AR933X +-@@ -11,62 +75,1041 @@ config ATH79_MACH_AP121 ++@@ -11,62 +75,1050 @@ config ATH79_MACH_AP121 + select ATH79_DEV_M25P80 + select ATH79_DEV_USB + select ATH79_DEV_WMAC +@@ -1246,6 +1247,15 @@ + + select ATH79_DEV_M25P80 + + select ATH79_DEV_WMAC + + +++config ATH79_MACH_TL_WR941ND_V6 +++ bool "TP-LINK TL-WR941ND v6 support" +++ select SOC_QCA956X +++ select ATH79_DEV_ETH +++ select ATH79_DEV_GPIO_BUTTONS +++ select ATH79_DEV_LEDS_GPIO +++ select ATH79_DEV_M25P80 +++ select ATH79_DEV_WMAC +++ + +config ATH79_MACH_TL_WR1041N_V2 + + bool "TP-LINK TL-WR1041N v2 support" + + select SOC_AR934X +@@ -1474,7 +1484,7 @@ + endif + --- a/arch/mips/ath79/Makefile + +++ b/arch/mips/ath79/Makefile +-@@ -38,9 +38,126 @@ obj-$(CONFIG_ATH79_ROUTERBOOT) += route ++@@ -38,9 +38,127 @@ obj-$(CONFIG_ATH79_ROUTERBOOT) += route + # + # Machines + # +@@ -1566,6 +1576,7 @@ + +obj-$(CONFIG_ATH79_MACH_TL_WR841N_V8) += mach-tl-wr841n-v8.o + +obj-$(CONFIG_ATH79_MACH_TL_WR841N_V9) += mach-tl-wr841n-v9.o + +obj-$(CONFIG_ATH79_MACH_TL_WR941ND) += mach-tl-wr941nd.o +++obj-$(CONFIG_ATH79_MACH_TL_WR941ND_V6) += mach-tl-wr941nd-v6.o + +obj-$(CONFIG_ATH79_MACH_TL_WR1041N_V2) += mach-tl-wr1041n-v2.o + +obj-$(CONFIG_ATH79_MACH_TL_WR1043ND) += mach-tl-wr1043nd.o + +obj-$(CONFIG_ATH79_MACH_TL_WR1043ND_V2) += mach-tl-wr1043nd-v2.o diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 58136f19..9bde4de6 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -72,13 +72,13 @@ $(eval $(call GluonModel,TLWR941,tl-wr941nd-v2,tp-link-tl-wr941n-nd-v2)) $(eval $(call GluonModel,TLWR941,tl-wr941nd-v3,tp-link-tl-wr941n-nd-v3)) $(eval $(call GluonModel,TLWR941,tl-wr941nd-v4,tp-link-tl-wr941n-nd-v4)) $(eval $(call GluonModel,TLWR941,tl-wr941nd-v5,tp-link-tl-wr941n-nd-v5)) -ifeq ($(BROKEN),1) -# $(eval $(call GluonModel,TLWR941,tl-wr941nd-v6,tp-link-tl-wr941n-nd-v6)) # BROKEN: needs mac80211 update +$(eval $(call GluonModel,TLWR941,tl-wr941nd-v6,tp-link-tl-wr941n-nd-v6)) +ifeq ($(BROKEN),1) $(eval $(call GluonModelAlias,TLWR941,tp-link-tl-wr941n-nd-v4,tp-link-tl-wr940n-nd-v1)) # BROKEN: untested $(eval $(call GluonModelAlias,TLWR941,tp-link-tl-wr941n-nd-v5,tp-link-tl-wr940n-nd-v2)) # BROKEN: untested -# $(eval $(call GluonModelAlias,TLWR941,tp-link-tl-wr941n-nd-v6,tp-link-tl-wr940n-nd-v3)) # BROKEN: needs mac80211 update endif +$(eval $(call GluonModelAlias,TLWR941,tp-link-tl-wr941n-nd-v6,tp-link-tl-wr940n-nd-v3)) # TL-WR1043N/ND v1, v2 $(eval $(call GluonProfile,TLWR1043)) From 72e554fcff0c9f67c62630a41557eac30fa480a8 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 4 Nov 2015 14:53:37 +0100 Subject: [PATCH 194/867] Remove BROKEN for TL-LINK TL-WR940 v1 & v2 These devices are identical to the TL-WR941 v4 & v5, so we don't need to test them explicitly. --- targets/ar71xx-generic/profiles.mk | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 9bde4de6..2a89ba0a 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -74,10 +74,8 @@ $(eval $(call GluonModel,TLWR941,tl-wr941nd-v4,tp-link-tl-wr941n-nd-v4)) $(eval $(call GluonModel,TLWR941,tl-wr941nd-v5,tp-link-tl-wr941n-nd-v5)) $(eval $(call GluonModel,TLWR941,tl-wr941nd-v6,tp-link-tl-wr941n-nd-v6)) -ifeq ($(BROKEN),1) -$(eval $(call GluonModelAlias,TLWR941,tp-link-tl-wr941n-nd-v4,tp-link-tl-wr940n-nd-v1)) # BROKEN: untested -$(eval $(call GluonModelAlias,TLWR941,tp-link-tl-wr941n-nd-v5,tp-link-tl-wr940n-nd-v2)) # BROKEN: untested -endif +$(eval $(call GluonModelAlias,TLWR941,tp-link-tl-wr941n-nd-v4,tp-link-tl-wr940n-nd-v1)) +$(eval $(call GluonModelAlias,TLWR941,tp-link-tl-wr941n-nd-v5,tp-link-tl-wr940n-nd-v2)) $(eval $(call GluonModelAlias,TLWR941,tp-link-tl-wr941n-nd-v6,tp-link-tl-wr940n-nd-v3)) # TL-WR1043N/ND v1, v2 From b33635c47c3107d0257e32d8c399fb781d3e0570 Mon Sep 17 00:00:00 2001 From: Matthias Walther Date: Thu, 5 Nov 2015 16:19:55 +0100 Subject: [PATCH 195/867] Update wired-mesh.rst --- 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 93021638..f394464b 100644 --- a/docs/features/wired-mesh.rst +++ b/docs/features/wired-mesh.rst @@ -54,7 +54,7 @@ Configuring Mesh-on-LAN is a bit more complicated:: It may be disabled by running:: - uci set network.mesh_wan.auto=0 + uci set network.mesh_lan.auto=0 for ifname in $(cat /lib/gluon/core/sysconfig/lan_ifname); do uci add_list network.client.ifname=$ifname done From abd43c163ca1394de5f62565211b5c37f07280dc Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 5 Nov 2015 18:16:47 +0100 Subject: [PATCH 196/867] ar71xx: add support for TP-LINK TL-WR1043ND v3 --- ...d-support-for-TP-Link-TL-WR1043ND-v3.patch | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 patches/openwrt/0037-ar71xx-add-support-for-TP-Link-TL-WR1043ND-v3.patch diff --git a/patches/openwrt/0037-ar71xx-add-support-for-TP-Link-TL-WR1043ND-v3.patch b/patches/openwrt/0037-ar71xx-add-support-for-TP-Link-TL-WR1043ND-v3.patch new file mode 100644 index 00000000..5e781e21 --- /dev/null +++ b/patches/openwrt/0037-ar71xx-add-support-for-TP-Link-TL-WR1043ND-v3.patch @@ -0,0 +1,25 @@ +From: Andreas Ziegler +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 +--- 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 + $(eval $(call SingleProfile,TPLINK,64kraw,TLWR1043V1,tl-wr1043nd-v1,TL-WR1043ND,ttyS0,115200,0x10430001,1,8M)) + + $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR1043V2,tl-wr1043nd-v2,TL-WR1043ND-v2,ttyS0,115200,0x10430002,1,8M)) ++$(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR1043V3,tl-wr1043nd-v3,TL-WR1043ND-v2,ttyS0,115200,0x10430003,1,8M)) + $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR2543,tl-wr2543-v1,TL-WR2543N,ttyS0,115200,0x25430001,1,8Mlzma,-v 3.13.99)) + + $(eval $(call SingleProfile,TPLINK-SAFELOADER,64kraw,CPE510,cpe210-220-510-520,CPE510,ttyS0,115200,$$(cpe510_mtdlayout),CPE510)) +@@ -2087,7 +2088,7 @@ $(eval $(call MultiProfile,TLWR743,TLWR743NV1)) + $(eval $(call MultiProfile,TLWR841,TLWR841NV15 TLWR841NV3 TLWR841NV5 TLWR841NV7)) + $(eval $(call MultiProfile,TLWR842,TLWR842V1)) + $(eval $(call MultiProfile,TLWR941,TLWR941NV2 TLWR941NV3 TLWR941NV4)) +-$(eval $(call MultiProfile,TLWR1043,TLWR1043V1 TLWR1043V2)) ++$(eval $(call MultiProfile,TLWR1043,TLWR1043V1 TLWR1043V2 TLWR1043V3)) + $(eval $(call MultiProfile,TLWDR4300,TLWDR3500V1 TLWDR3600V1 TLWDR4300V1 TLWDR4300V1IL TLWDR4310V1 MW4530RV1)) + $(eval $(call MultiProfile,TUBE2H,TUBE2H8M TUBE2H16M)) + $(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTROCKETMXW UBNTNANOM UBNTNANOMXW UBNTLOCOXW UBNTUNIFI UBNTUNIFIOUTDOOR UBNTUNIFIOUTDOORPLUS UAPPRO UBNTAIRGW)) From 171b4847355f25713f5b601b9f6c7fad099859e0 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 5 Nov 2015 22:42:34 +0100 Subject: [PATCH 197/867] docs: improve user/getting_started, some minor fixes in user/site This commit basically does two things: it urges users always to use an own git repository to manage the site configuration, and it removed all mentions of "communities" from the "Getting started" page, as it was too Freifunk-specific. Other documentation pages (especially the site configuration docs) should probably be adjusted as well. --- docs/user/getting_started.rst | 48 ++++++++++++++++++----------------- docs/user/site.rst | 10 ++++---- 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/docs/user/getting_started.rst b/docs/user/getting_started.rst index 435ff30f..d1e7d254 100644 --- a/docs/user/getting_started.rst +++ b/docs/user/getting_started.rst @@ -4,18 +4,20 @@ Getting Started Selecting the right version --------------------------- -Gluon's releases are managed using `Git tags`_. If you're a community getting +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*. +e.g. *v2014.3*. 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 a matching site configuration for your community -is required. Due to new features being added (or sometimes being removed) -the format of the site configuration changes slightly between releases. +Please keep in mind that there is no "default Gluon" build; a site configuration +is required to adjust Gluon to your needs. Due to new features being added (or +sometimes being removed) the format of the site configuration changes slightly +between releases. Please refer to our release notes for instructions to update +an old site configuration to a newer release of Gluon. -Recent releases (starting with *v2014.3.1*) will come with an example -configuration located in *docs/site-example/*. +An example configuration can be found in the Gluon repository at *docs/site-example/*. .. _Git tags: http://git-scm.com/book/en/Git-Basics-Tagging .. _list of gluon releases: https://github.com/freifunk-gluon/gluon/releases @@ -49,32 +51,34 @@ version you'd like to checkout, e.g. *v2015.1*. This command will create a directory named *gluon/*. It might also tell a scary message about being in a *detached state*. **Don't panic!** Everything's fine. -Now, enter the freshly created directory: - -:: +Now, enter the freshly created directory:: cd gluon -It's time to add (or create) your site configuration. -So let's create the directory *site/*: +It's time to add (or create) your site configuration. If you already +have a site repository, just clone it:: -:: + git clone https://github.com/freifunk-duckburg/site-ffdb.git site + +If you want to build a new site, create a new git repository *site/*:: mkdir site cd site + git init -Copy *site.conf*, *site.mk* and *i18n* from *docs/site-example*: - -:: +Copy *site.conf*, *site.mk* and *i18n* from *docs/site-example*:: cp ../docs/site-example/site.conf . cp ../docs/site-example/site.mk . cp -r ../docs/site-example/i18n . -Edit these files to match your community, then go back to the top-level Gluon -directory and build Gluon: +Edit these files as you see fit and commit them into the site repository. +Extensive documentation about the site configuration can be found at: +:doc:`site`. The +site directory should always be a git repository by itself; committing site-specific files +to the Gluon main repository should be avoided, as it will make updates more complicated. -:: +Next go back to the top-level Gluon directory and build Gluon:: cd .. make update # Get other repositories used by Gluon @@ -83,7 +87,7 @@ directory and build Gluon: When calling make, the OpenWrt build environment is prepared/updated. In case of errors read the messages carefully and try to fix the stated issues (e.g. install tools not available yet). -``ar71xx-generic`` is the most common target and will generated images for most of the supported hardware. +``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 @@ -93,9 +97,7 @@ system. You should reserve about 10GB of disk space for each `GLUON_TARGET`. -There are two levels of `make clean`: - -:: +There are two levels of `make clean`:: make clean GLUON_TARGET=ar71xx-generic diff --git a/docs/user/site.rst b/docs/user/site.rst index 05079997..6b5a7cf5 100644 --- a/docs/user/site.rst +++ b/docs/user/site.rst @@ -1,5 +1,5 @@ -Site -==== +Site configuration +================== The ``site`` consists of the files ``site.conf`` and ``site.mk``. In the first community based values are defined, which both are processed @@ -279,8 +279,8 @@ 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 additional - to the ``gluon_core`` package. + Defines a list of packages which should installed in addition + to the ``gluon-core`` package. GLUON_RELEASE The current release version Gluon should use. @@ -308,7 +308,7 @@ gluon-config-mode:pubkey Information about the public VPN key on the reboot page. gluon-config-mode:reboot - General information about the reboot page. + General information shown on the reboot page. There is a POT file in the site example directory which can be used to create templates for the language files. The command ``msginit -l en -i ../../docs/site-example/i18n/gluon-site.pot`` From 7028c0e113ad5a4acc5d7a57ebb2f8dd1e8559f8 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 6 Nov 2015 13:17:06 +0100 Subject: [PATCH 198/867] ar71xx-generic: add profile for TL-WR1043ND v3 --- targets/ar71xx-generic/profiles.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 2a89ba0a..e723badb 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -78,10 +78,11 @@ $(eval $(call GluonModelAlias,TLWR941,tp-link-tl-wr941n-nd-v4,tp-link-tl-wr940n- $(eval $(call GluonModelAlias,TLWR941,tp-link-tl-wr941n-nd-v5,tp-link-tl-wr940n-nd-v2)) $(eval $(call GluonModelAlias,TLWR941,tp-link-tl-wr941n-nd-v6,tp-link-tl-wr940n-nd-v3)) -# TL-WR1043N/ND v1, v2 +# TL-WR1043N/ND v1, v2, v3 $(eval $(call GluonProfile,TLWR1043)) $(eval $(call GluonModel,TLWR1043,tl-wr1043nd-v1,tp-link-tl-wr1043n-nd-v1)) $(eval $(call GluonModel,TLWR1043,tl-wr1043nd-v2,tp-link-tl-wr1043n-nd-v2)) +$(eval $(call GluonModel,TLWR1043,tl-wr1043nd-v3,tp-link-tl-wr1043n-nd-v3)) # TL-WDR3500/3600/4300 v1 $(eval $(call GluonProfile,TLWDR4300)) From 0b77bee3d7ce19696dec8f88922afadfe45a5fa8 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 8 Nov 2015 20:48:17 +0100 Subject: [PATCH 199/867] ar71xx: fix TL-WR941ND v6 switch PHY mask Fixes #550 --- ...rt-for-TP-LINK-TL-WR941ND-v6-international-version.patch | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/patches/openwrt/0036-ar71xx-add-support-for-TP-LINK-TL-WR941ND-v6-international-version.patch b/patches/openwrt/0036-ar71xx-add-support-for-TP-LINK-TL-WR941ND-v6-international-version.patch index e1e3b5a2..8bc91f15 100644 --- a/patches/openwrt/0036-ar71xx-add-support-for-TP-LINK-TL-WR941ND-v6-international-version.patch +++ b/patches/openwrt/0036-ar71xx-add-support-for-TP-LINK-TL-WR941ND-v6-international-version.patch @@ -100,10 +100,10 @@ index e9b3c7c..84b5844 100644 CONFIG_ATH79_MACH_UBNT_XM=y diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941nd-v6.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941nd-v6.c new file mode 100644 -index 0000000..55b4c00 +index 0000000..8c788e2 --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941nd-v6.c -@@ -0,0 +1,151 @@ +@@ -0,0 +1,149 @@ +/* + * TP-LINK TL-WR941N/ND v6 board support + * @@ -243,8 +243,6 @@ index 0000000..55b4c00 + ath79_init_mac(ath79_eth1_data.mac_addr, mac, -1); + + ath79_switch_data.phy4_mii_en = 1; -+ ath79_switch_data.phy_poll_mask = BIT(0); -+ ath79_eth0_data.phy_mask = BIT(0); + + ath79_register_eth(0); + ath79_register_eth(1); From bc15b6c8101edec5dca358c597cd2f3fbe2399d3 Mon Sep 17 00:00:00 2001 From: Leo Krueger Date: Mon, 14 Sep 2015 23:31:34 +0200 Subject: [PATCH 200/867] 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 8ef02f33e9361556ed9c79ce47aad04608c52dec Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 18 Nov 2015 02:03:24 +0100 Subject: [PATCH 201/867] ar71xx: backport ath10k calibration data load changes --- ...ath10k-calibration-data-load-changes.patch | 197 ++++++++++++++++++ 1 file changed, 197 insertions(+) create mode 100644 patches/openwrt/0038-ar71xx-backport-ath10k-calibration-data-load-changes.patch diff --git a/patches/openwrt/0038-ar71xx-backport-ath10k-calibration-data-load-changes.patch b/patches/openwrt/0038-ar71xx-backport-ath10k-calibration-data-load-changes.patch new file mode 100644 index 00000000..0c99ddc2 --- /dev/null +++ b/patches/openwrt/0038-ar71xx-backport-ath10k-calibration-data-load-changes.patch @@ -0,0 +1,197 @@ +From: Matthias Schiffer +Date: Wed, 18 Nov 2015 02:01:55 +0100 +Subject: ar71xx: backport ath10k calibration data load changes + +The mac80211 update makes is necessary to backport this change as well for +ath10k to load. + +diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +index dd3f546..7111630 100644 +--- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata ++++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +@@ -8,50 +8,83 @@ ath10kcal_die() { + ath10kcal_from_file() { + local source=$1 + local offset=$2 +- local target=$3 ++ local count=$3 + +- dd if=$source of=$target bs=1 skip=$offset count=2116 2>/dev/null || \ ++ dd if=$source of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count 2>/dev/null || \ + ath10kcal_die "failed to extract calibration data from $source" + } + ++ath10kcal_extract() { ++ local part=$1 ++ local offset=$2 ++ local count=$3 ++ local mtd ++ ++ mtd=$(find_mtd_chardev $part) ++ [ -n "$mtd" ] || \ ++ ath10kcal_die "no mtd device found for partition $part" ++ ++ dd if=$mtd of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count 2>/dev/null || \ ++ ath10kcal_die "failed to extract calibration data from $mtd" ++} ++ ++ath10kcal_patch_mac() { ++ local mac=$1 ++ ++ [ -z "$mac" ] && return ++ ++ macaddr_2bin $mac | dd of=/lib/firmware/$FIRMWARE conv=notrunc bs=1 seek=6 count=6 ++} ++ + [ -e /lib/firmware/$FIRMWARE ] && exit 0 + + . /lib/ar71xx.sh + . /lib/functions.sh + . /lib/functions/system.sh + +-ath10kcal_mac="" +-ath10kcal_tmp="/tmp/ath10k-caldata.bin" +- + board=$(ar71xx_board_name) + + case "$FIRMWARE" in +-"ath10k/cal-pci-0000:01:00.0.bin") +- case $board in +- rb-911g-5hpacd) +- ath10kcal_from_file "/sys/firmware/routerboot/ext_wlan_data" 20480 $ath10kcal_tmp +- ;; +- esac +- ;; +- + "ath10k/cal-pci-0000:00:00.0.bin") + case $board in + dlan-pro-1200-ac) +- ath10kcal_from_file $(find_mtd_part "art") 20480 $ath10kcal_tmp ++ ath10kcal_extract "art" 20480 2116 ++ ;; ++ mc-mac1200r) ++ ath10kcal_extract "art" 20480 2116 ++ ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) -1) ++ ;; ++ r6100) ++ ath10kcal_extract "caldata" 20480 2116 ++ ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) +2) ++ ;; ++ qihoo-c301) ++ ath10kcal_extract "radiocfg" 20480 2116 ++ ath10kcal_patch_mac $(mtd_get_mac_ascii devdata wlan5mac) + ;; + esr1750 | \ + epg5000) +- ath10kcal_from_file $(find_mtd_part "caldata") 20480 $ath10kcal_tmp ++ ath10kcal_extract "caldata" 20480 2116 ++ ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1) ++ ;; ++ esac ++ ;; ++"ath10k/cal-pci-0000:01:00.0.bin") ++ case $board in ++ archer-c5 | \ ++ archer-c7) ++ ath10kcal_extract "art" 20480 2116 ++ ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) -2) ++ ;; ++ nbg6716) ++ ath10kcal_extract "RFdata" 20480 2116 ++ ;; ++ rb-911g-5hpacd) ++ ath10kcal_from_file "/sys/firmware/routerboot/ext_wlan_data" 20480 2116 + ;; + esac + ;; +- + *) + exit 1 + ;; + esac +- +-[ -f $ath10kcal_tmp ] && { +- cp $ath10kcal_tmp /lib/firmware/$FIRMWARE +- rm -f $ath10kcal_tmp +-} +diff --git a/target/linux/ar71xx/base-files/lib/preinit/81_load_ath10k_board_bin b/target/linux/ar71xx/base-files/lib/preinit/81_load_ath10k_board_bin +deleted file mode 100644 +index 9a32dfc..0000000 +--- a/target/linux/ar71xx/base-files/lib/preinit/81_load_ath10k_board_bin ++++ /dev/null +@@ -1,75 +0,0 @@ +-#!/bin/sh +- +-. /lib/functions/system.sh +-. /lib/ar71xx.sh +- +-do_load_ath10k_board_bin() { +- # load board.bin +- case $(ar71xx_board_name) in +- nbg6716) +- dd if=/dev/mtdblock2 \ +- bs=1 skip=20480 count=2116 \ +- of=/tmp/ath10k-board.bin +- ;; +- archer-c5 | \ +- archer-c7) +- local mac +- mac=$(macaddr_add $(cat /sys/class/net/eth1/address) -2) +- +- dd if=/dev/mtdblock4 \ +- bs=1 skip=20480 count=6 \ +- of=/tmp/ath10k-board.bin +- macaddr_2bin $mac >> /tmp/ath10k-board.bin +- dd if=/dev/mtdblock4 \ +- bs=1 skip=20492 count=2104 >> /tmp/ath10k-board.bin +- ;; +- mc-mac1200r) +- local mac +- mac=$(macaddr_add $(cat /sys/class/net/eth1/address) -1) +- +- dd if=/dev/mtdblock4 \ +- bs=1 skip=20480 count=6 \ +- of=/tmp/ath10k-board.bin +- macaddr_2bin $mac >> /tmp/ath10k-board.bin +- dd if=/dev/mtdblock4 \ +- bs=1 skip=20492 count=2104 >> /tmp/ath10k-board.bin +- ;; +- r6100) +- local mac +- mac=$(macaddr_add $(cat /sys/class/net/eth1/address) +2) +- +- dd if=/dev/mtdblock2 \ +- bs=1 skip=20480 count=6 \ +- of=/tmp/ath10k-board.bin +- macaddr_2bin $mac >> /tmp/ath10k-board.bin +- dd if=/dev/mtdblock2 \ +- bs=1 skip=20492 count=2104 >> /tmp/ath10k-board.bin +- ;; +- qihoo-c301) +- local mac +- +- mac=$(mtd_get_mac_ascii devdata wlan5mac) +- +- if [ -z "$mac" ]; then +- mac=$(macaddr_add $(cat /sys/class/net/eth0/address) -2) +- fi +- +- dd if=/dev/mtdblock10 \ +- bs=1 skip=20480 count=6 \ +- of=/tmp/ath10k-board.bin +- macaddr_2bin $mac >> /tmp/ath10k-board.bin +- dd if=/dev/mtdblock10 \ +- bs=1 skip=20492 count=2104 >> /tmp/ath10k-board.bin +- +- ;; +- esac +- [ -f /tmp/ath10k-board.bin ] || { +- return +- } +- cmp -s /tmp/ath10k-board.bin /lib/firmware/ath10k/QCA988X/hw2.0/board.bin || { +- cp /tmp/ath10k-board.bin /lib/firmware/ath10k/QCA988X/hw2.0/board.bin +- rm /tmp/ath10k-board.bin +- } +-} +- +-boot_hook_add preinit_main do_load_ath10k_board_bin From e5289771001b7b2edbda8149c35b644dfc083880 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 18 Nov 2015 02:36:29 +0100 Subject: [PATCH 202/867] gluon-site: set PKG_FILE_DEPENDS to site.conf and i18n/ only PKG_FILE_DEPENDS caused the whole site repo to be hashed to determine if gluon-site needed rebuilding. While this is normally no problem, alternative build setups sometimes put the Gluon repo inside the site repo, causing long build times and parallel build failures. --- package/gluon-site/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/gluon-site/Makefile b/package/gluon-site/Makefile index 7816c9d3..abd057c9 100644 --- a/package/gluon-site/Makefile +++ b/package/gluon-site/Makefile @@ -4,7 +4,7 @@ PKG_NAME:=gluon-site PKG_VERSION:=$(if $(GLUON_SITE_CODE),$(GLUON_SITE_CODE),1) PKG_RELEASE:=$(GLUON_RELEASE) -PKG_FILE_DEPENDS := $(GLUON_SITEDIR)/ +PKG_FILE_DEPENDS := $(GLUON_SITEDIR)/site.conf $(GLUON_SITEDIR)/i18n/ PKG_BUILD_DEPENDS := luci-base/host PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) From 0335ce10e2fe2ba40ac9a3f76236cbf83befd462 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 8 Nov 2015 21:54:45 +0100 Subject: [PATCH 203/867] gluon-mesh-batman-adv-core: keep disabled state even when the mesh interface section name is changed Is makes sense to always look for both ibss_radio* and mesh_radio* sections to determine if the meshing should be enabled when regenerating these sections. Doing this, the disabled state will survive updates changing the section name (either updating from pre-2015.2 while keeping IBSS, or changing from IBSS to 11s or vice-versa). If both ibss_radio* and mesh_radio* sections exist, the disabled state will be kept correctly for each section, the behaviour is changed only when creating a section that didn't exist before. Fixes #549 --- .../320-gluon-mesh-batman-adv-core-wireless | 48 ++++++++++++++----- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless index 66b438d8..8835c997 100755 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless +++ b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless @@ -6,18 +6,24 @@ local util = require 'gluon.util' local uci = require('luci.model.uci').cursor() -local function is_disabled(config, name) - local disabled = config and config.disabled +local function is_disabled(name) if uci:get('wireless', name) then - disabled = uci:get_bool('wireless', name, 'disabled') + return uci:get_bool('wireless', name, 'disabled') end - - return disabled and 1 or 0 end -local function configure_ibss(config, radio, index, suffix) +-- Returns the first argument that is not nil; don't call without any non-nil arguments! +local function first_non_nil(first, ...) + if first ~= nil then + return first + else + return first_non_nil(...) + end +end + + +local function configure_ibss(config, radio, index, suffix, disabled) local name = 'ibss_' .. radio - local disabled = is_disabled(config, name) uci:delete('network', name) uci:delete('network', name .. '_vlan') @@ -57,15 +63,14 @@ local function configure_ibss(config, radio, index, suffix) macaddr = util.generate_mac(3, index), mcast_rate = config.mcast_rate, ifname = suffix and 'ibss' .. suffix, - disabled = disabled, + disabled = disabled and 1 or 0, } ) end end -local function configure_mesh(config, radio, index, suffix) +local function configure_mesh(config, radio, index, suffix, disabled) local name = 'mesh_' .. radio - local disabled = is_disabled(config, name) local macfilter = uci:get('wireless', name, 'macfilter') local maclist = uci:get('wireless', name, 'maclist') @@ -90,7 +95,7 @@ local function configure_mesh(config, radio, index, suffix) macaddr = util.generate_mac(5, index), mcast_rate = config.mcast_rate, ifname = suffix and 'mesh' .. suffix, - disabled = disabled, + disabled = disabled and 1 or 0, macfilter = macfilter, maclist = maclist, } @@ -101,8 +106,25 @@ end local function configure_radio(radio, index, config) local suffix = radio:match('^radio(%d+)$') - configure_ibss(config.ibss, radio, index, suffix) - configure_mesh(config.mesh, radio, index, suffix) + local ibss_disabled = is_disabled('ibss_' .. radio) + local mesh_disabled = is_disabled('mesh_' .. radio) + + configure_ibss(config.ibss, radio, index, suffix, + first_non_nil( + ibss_disabled, + mesh_disabled, + (config.ibss or {}).disabled, -- will be nil if config.ibss or config.ibss.disabled is unset + false + ) + ) + configure_mesh(config.mesh, radio, index, suffix, + first_non_nil( + mesh_disabled, + ibss_disabled, + (config.mesh or {}).disabled, -- will be nil if config.mesh or config.mesh.disabled is unset + false + ) + ) end util.iterate_radios(configure_radio) From ef38d386cbd1aa9f6f23fcf2bb42d9a1d8fc415d Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 18 Nov 2015 23:07:46 +0100 Subject: [PATCH 204/867] Fix the mac80211 backport not to remove the dependencies on kmod-crypto-arc4 and kmod-crypto-aes The trunk version of mac80211 doesn't need these dependencies anymore as they are compiled into the kernel. While this didn't cause any issues for Gluon as we always build the kernel with all modules, this fix makes the patch work on a plain OpenWrt CC as well. --- .../0006-mac80211-backport-from-trunk-r47249.patch | 11 +---------- ...h-community-firmware-as-an-additional-choice.patch | 2 +- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/patches/openwrt/0006-mac80211-backport-from-trunk-r47249.patch b/patches/openwrt/0006-mac80211-backport-from-trunk-r47249.patch index 40b516e4..2f8fb79b 100644 --- a/patches/openwrt/0006-mac80211-backport-from-trunk-r47249.patch +++ b/patches/openwrt/0006-mac80211-backport-from-trunk-r47249.patch @@ -3,7 +3,7 @@ Date: Tue, 23 Dec 2014 18:57:16 +0100 Subject: mac80211: backport from trunk r47249 diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile -index a1eedce..f332cbd 100644 +index a1eedce..566e156 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -10,11 +10,11 @@ include $(INCLUDE_DIR)/kernel.mk @@ -66,15 +66,6 @@ index a1eedce..f332cbd 100644 endef define KernelPackage/cfg80211 -@@ -79,7 +91,7 @@ endef - define KernelPackage/mac80211 - $(call KernelPackage/mac80211/Default) - TITLE:=Linux 802.11 Wireless Networking Stack -- DEPENDS+= +kmod-crypto-core +kmod-crypto-arc4 +kmod-crypto-aes +kmod-cfg80211 +hostapd-common -+ DEPENDS+= +kmod-cfg80211 +hostapd-common - KCONFIG:=\ - CONFIG_AVERAGE=y - FILES:= $(PKG_BUILD_DIR)/net/mac80211/mac80211.ko @@ -109,8 +121,8 @@ Generic IEEE 802.11 Networking Stack (mac80211) endef diff --git a/patches/openwrt/0034-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch b/patches/openwrt/0034-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch index d47cdd13..335f550a 100644 --- a/patches/openwrt/0034-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch +++ b/patches/openwrt/0034-ath10k-add-Candelatech-community-firmware-as-an-additional-choice.patch @@ -3,7 +3,7 @@ Date: Tue, 10 Mar 2015 13:17:14 +0100 Subject: ath10k: add Candelatech community firmware as an additional choice diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile -index f332cbd..28f40c8 100644 +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 From 3f704405276c86db17052df234179bc5a7f24aae Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 20 Nov 2015 00:04:59 +0100 Subject: [PATCH 205/867] 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 206/867] 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 207/867] 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 208/867] 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 209/867] 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 210/867] 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 211/867] 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 212/867] 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 213/867] 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 214/867] -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 215/867] 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 216/867] 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 217/867] 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 218/867] 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 219/867] 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 220/867] 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 221/867] 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 222/867] 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 223/867] 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 224/867] 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 225/867] 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 226/867] 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 227/867] 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 228/867] 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 229/867] 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 230/867] 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 231/867] 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 232/867] 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 233/867] 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 234/867] 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 235/867] 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 236/867] 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 237/867] 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 238/867] 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 239/867] 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 240/867] 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 241/867] 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 242/867] 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 243/867] 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 244/867] 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 245/867] 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 246/867] 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 247/867] 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 248/867] 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 249/867] 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 250/867] 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 251/867] 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 252/867] 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 253/867] 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 254/867] 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 255/867] 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 256/867] 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 257/867] 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 258/867] 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 259/867] 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 260/867] 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 261/867] 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 262/867] 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 263/867] 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 264/867] 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 265/867] 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 266/867] 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 267/867] 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 268/867] 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 269/867] 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 270/867] 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 271/867] 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 272/867] 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 273/867] 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 274/867] 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 275/867] 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 276/867] 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 277/867] 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 278/867] 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 279/867] 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 280/867] 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 281/867] 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 282/867] 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 283/867] 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 284/867] 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 285/867] 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 286/867] 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 287/867] 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 288/867] 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 289/867] 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 290/867] 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 291/867] 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 292/867] 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 293/867] 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 294/867] 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 295/867] 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 296/867] 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 297/867] 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 298/867] 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 299/867] 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 388d264ff05c914296ce94aeb15cc1cc46f1523e Mon Sep 17 00:00:00 2001 From: Kokel Date: Sat, 6 Feb 2016 00:01:40 +0100 Subject: [PATCH 300/867] gluon-core: add preserve wifi channels feature This new feature introduces the new uci section 'gluon-core.wireless' with a preserve_channels option: * preserve_channels (boolean) By setting this option to 1 (true) wifi channels will be preserved during upgrades. --- docs/features/wlan-configuration.rst | 8 ++++++++ package/gluon-core/files/etc/config/gluon-core | 1 + .../gluon-core/files/lib/gluon/upgrade/200-wireless | 12 +++++++++++- 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 package/gluon-core/files/etc/config/gluon-core diff --git a/docs/features/wlan-configuration.rst b/docs/features/wlan-configuration.rst index ff280eba..1c1e3e54 100644 --- a/docs/features/wlan-configuration.rst +++ b/docs/features/wlan-configuration.rst @@ -24,3 +24,11 @@ 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. + +During upgrades the wifi channel of the 2.4GHz and 5GHz radio will be restored to the channel +configured in the site.conf. If you need to preserve a user defined wifi channel during upgrades +you can configure this via the uci section ``gluon-core.wireless``:: + + uci set gluon-core.@wireless[0].preserve_channels='1' + +Keep in mind that nodes running wifi interfaces on custom channels can't mesh with default nodes anymore! diff --git a/package/gluon-core/files/etc/config/gluon-core b/package/gluon-core/files/etc/config/gluon-core new file mode 100644 index 00000000..9787ccc9 --- /dev/null +++ b/package/gluon-core/files/etc/config/gluon-core @@ -0,0 +1 @@ +config wireless diff --git a/package/gluon-core/files/lib/gluon/upgrade/200-wireless b/package/gluon-core/files/lib/gluon/upgrade/200-wireless index b9495d89..2ada9b3c 100755 --- a/package/gluon-core/files/lib/gluon/upgrade/200-wireless +++ b/package/gluon-core/files/lib/gluon/upgrade/200-wireless @@ -10,11 +10,21 @@ if not sysconfig.gluon_version then uci:delete_all('wireless', 'wifi-iface') end +local function get_channel(radio, config) + if uci:get_first('gluon-core', 'wireless', 'preserve_channels') then + return uci:get('wireless', radio, 'channel') or config.channel + else + return config.channel + end +end + local function configure_radio(radio, index, config) if config then + local channel = get_channel(radio, config) + uci:delete('wireless', radio, 'disabled') - uci:set('wireless', radio, 'channel', config.channel) + uci:set('wireless', radio, 'channel', channel) uci:set('wireless', radio, 'htmode', 'HT20') uci:set('wireless', radio, 'country', site.regdom) end From 0fd4ff0a686a3b3b62eda308ed24a33e3cf14d56 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 13 Feb 2016 17:02:11 +0100 Subject: [PATCH 301/867] 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 a07419bbfec8198e6d57e0c44c6afe24fcd818b4 Mon Sep 17 00:00:00 2001 From: Neal Oakey Date: Sun, 14 Feb 2016 20:59:49 +0100 Subject: [PATCH 302/867] fix UBNT XM model detection --- .../0048-fix-UBNT-XM-model-detection.patch | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 patches/openwrt/0048-fix-UBNT-XM-model-detection.patch diff --git a/patches/openwrt/0048-fix-UBNT-XM-model-detection.patch b/patches/openwrt/0048-fix-UBNT-XM-model-detection.patch new file mode 100644 index 00000000..4fbdd403 --- /dev/null +++ b/patches/openwrt/0048-fix-UBNT-XM-model-detection.patch @@ -0,0 +1,74 @@ +From: Neal Oakey +Date: Sun, 14 Feb 2016 20:58:20 +0100 +Subject: fix UBNT XM model detection + +Signed-off-by: Neal Oakey + +diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh +index d0abf42..f345fae 100755 +--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh ++++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh +@@ -64,6 +64,40 @@ wndr3700_board_detect() { + AR71XX_MODEL="$machine" + } + ++ubnt_get_mtd_part_magic() { ++ ar71xx_get_mtd_offset_size_format EEPROM 4118 2 %02x ++} ++ ++ubnt_xm_board_detect() { ++ local model ++ local magic ++ ++ magic="$(ubnt_get_mtd_part_magic)" ++ case ${magic:0:3} in ++ "e00"|\ ++ "e01"|\ ++ "e80") # It seams that there are different Versions of the Nanostation ++ model="Ubiquiti NanoStation M" ++ ;; ++ "e0a") ++ model="Ubiquiti NanoStation loco M" ++ ;; ++ "e1b") # Note: the M5 has not been tested! ++ # and the Ti Versions are still missing ++ model="Ubiquiti Rocket M" ++ ;; ++ "e20"|\ ++ "e2d") # Bullet Ti M ++ model="Ubiquiti Bullet M" ++ ;; ++ "e30") ++ model="Ubiquiti PicoStation M" ++ ;; ++ esac ++ ++ [ ! -z "$model" ] && AR71XX_MODEL="${model}${magic:3:1}" ++} ++ + cybertan_get_hw_magic() { + local part + +@@ -472,12 +506,14 @@ ar71xx_board_detect() { + ;; + *"Bullet M") + name="bullet-m" ++ ubnt_xm_board_detect + ;; + *"Loco M XW") + name="loco-m-xw" + ;; + *"Nanostation M") + name="nanostation-m" ++ ubnt_xm_board_detect + ;; + *"Nanostation M XW") + name="nanostation-m-xw" +@@ -664,6 +700,7 @@ ar71xx_board_detect() { + ;; + *"Rocket M") + name="rocket-m" ++ ubnt_xm_board_detect + ;; + *"Rocket M XW") + name="rocket-m-xw" From a7c2f7ab59a7f9383cfada391539377bc9c586be Mon Sep 17 00:00:00 2001 From: Neal Oakey Date: Sun, 14 Feb 2016 23:11:03 +0100 Subject: [PATCH 303/867] add new UBNT images, as the detection now works --- targets/ar71xx-generic/profiles.mk | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 23eefdd1..9125d9bf 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -149,12 +149,19 @@ $(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)) -$(eval $(call GluonModelAlias,UBNT,ubiquiti-bullet-m,ubiquiti-picostation-m)) -$(eval $(call GluonModelAlias,UBNT,ubiquiti-bullet-m,ubiquiti-rocket-m)) +$(eval $(call GluonModelAlias,UBNT,ubiquiti-bullet-m,ubiquiti-nanostation-loco-m2)) +$(eval $(call GluonModelAlias,UBNT,ubiquiti-bullet-m,ubiquiti-nanostation-loco-m5)) +$(eval $(call GluonModelAlias,UBNT,ubiquiti-bullet-m,ubiquiti-rocket-m2)) +$(eval $(call GluonModelAlias,UBNT,ubiquiti-bullet-m,ubiquiti-rocket-m5)) +$(eval $(call GluonModelAlias,UBNT,ubiquiti-bullet-m,ubiquiti-bullet-m2)) +$(eval $(call GluonModelAlias,UBNT,ubiquiti-bullet-m,ubiquiti-bullet-m5)) +$(eval $(call GluonModelAlias,UBNT,ubiquiti-bullet-m,ubiquiti-picostation-m2)) + +$(eval $(call GluonModel,UBNT,ubnt-nano-m,ubiquiti-nanostation-m)) +$(eval $(call GluonModelAlias,UBNT,ubiquiti-nanostation-m,ubiquiti-nanostation-m2)) +$(eval $(call GluonModelAlias,UBNT,ubiquiti-nanostation-m,ubiquiti-nanostation-m5)) $(eval $(call GluonModel,UBNT,ubnt-loco-m-xw,ubiquiti-loco-m-xw)) -$(eval $(call GluonModel,UBNT,ubnt-nano-m,ubiquiti-nanostation-m)) $(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)) From f0ad8ed5cb165cb47a19c5432e7284166d649fd0 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 16 Feb 2016 23:25:03 +0100 Subject: [PATCH 304/867] 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 305/867] 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 From e4439a3fe40dc0b106c2c22e6c6c403e8a5a5c5e Mon Sep 17 00:00:00 2001 From: viisauksena Date: Tue, 23 Feb 2016 23:33:17 +0100 Subject: [PATCH 306/867] docs: fix typo in authorized keys config example --- docs/features/authorized-keys.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features/authorized-keys.rst b/docs/features/authorized-keys.rst index b3b0aaf6..2f23ded5 100644 --- a/docs/features/authorized-keys.rst +++ b/docs/features/authorized-keys.rst @@ -8,7 +8,7 @@ If you select this package, add a list of authorized keys to ``site.conf`` like { authorized_keys = { 'ssh-rsa AAA.... user1@host', - 'ssh-rsa AAA.... user2@host }, + 'ssh-rsa AAA.... user2@host' }, hostname_prefix = ... ... From 56f1cd5383b8cb44174f618dfb566c8fc9f2262f Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 25 Feb 2016 22:50:58 +0100 Subject: [PATCH 307/867] firmware-utils: mkfwimage: fix firmware_max_length for XM layout This should fix problems with flashing from AirOS 5.6.x. --- ...bvious-bugs-causing-compile-warnings.patch | 64 +++++++++++++++++++ ...s-split-ubdev01-flash-layout-from-XM.patch | 39 +++++++++++ ...ix-firmware_max_length-for-XM-layout.patch | 45 +++++++++++++ 3 files changed, 148 insertions(+) create mode 100644 patches/openwrt/0040-firmware-utils-mkfwimage-add-Wall-fix-obvious-bugs-causing-compile-warnings.patch create mode 100644 patches/openwrt/0041-ar71xx-firmware-utils-split-ubdev01-flash-layout-from-XM.patch create mode 100644 patches/openwrt/0042-firmware-utils-mkfwimage-fix-firmware_max_length-for-XM-layout.patch diff --git a/patches/openwrt/0040-firmware-utils-mkfwimage-add-Wall-fix-obvious-bugs-causing-compile-warnings.patch b/patches/openwrt/0040-firmware-utils-mkfwimage-add-Wall-fix-obvious-bugs-causing-compile-warnings.patch new file mode 100644 index 00000000..781fd5d4 --- /dev/null +++ b/patches/openwrt/0040-firmware-utils-mkfwimage-add-Wall-fix-obvious-bugs-causing-compile-warnings.patch @@ -0,0 +1,64 @@ +From: Matthias Schiffer +Date: Thu, 25 Feb 2016 21:39:03 +0100 +Subject: firmware-utils: mkfwimage: add -Wall, fix obvious bugs causing compile warnings + +Signed-off-by: Matthias Schiffer + +diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile +index bd69cb4..6d88845 100644 +--- a/tools/firmware-utils/Makefile ++++ b/tools/firmware-utils/Makefile +@@ -32,7 +32,7 @@ define Host/Compile + $(call cc,mkzynfw) + $(call cc,lzma2eva,-lz) + $(call cc,mkcasfw) +- $(call cc,mkfwimage,-lz) ++ $(call cc,mkfwimage,-lz -Wall) + $(call cc,mkfwimage2,-lz) + $(call cc,imagetag imagetag_cmdline cyg_crc32) + $(call cc,add_header) +diff --git a/tools/firmware-utils/src/mkfwimage.c b/tools/firmware-utils/src/mkfwimage.c +index e3a03c1..00bf439 100644 +--- a/tools/firmware-utils/src/mkfwimage.c ++++ b/tools/firmware-utils/src/mkfwimage.c +@@ -104,8 +104,6 @@ typedef struct part_data { + + #define OPTIONS "B:hv:m:o:r:k:" + +-static int debug = 0; +- + typedef struct image_info { + char magic[16]; + char version[256]; +@@ -236,9 +234,9 @@ static int create_image_layout(const char* kernelfile, const char* rootfsfile, c + fw_layout_t* p; + + p = &fw_layout_data[0]; +- while ((strlen(p->name) != 0) && (strncmp(p->name, board_name, sizeof(board_name)) != 0)) ++ while (*p->name && (strcmp(p->name, board_name) != 0)) + p++; +- if (p->name == NULL) { ++ if (!*p->name) { + printf("BUG! Unable to find default fw layout!\n"); + exit(-1); + } +@@ -247,7 +245,7 @@ static int create_image_layout(const char* kernelfile, const char* rootfsfile, c + strcpy(kernel->partition_name, "kernel"); + kernel->partition_index = 1; + kernel->partition_baseaddr = p->kern_start; +- if ( (kernel->partition_length = filelength(kernelfile)) < 0) return (-1); ++ if ( (kernel->partition_length = filelength(kernelfile)) == (u_int32_t)-1) return (-1); + kernel->partition_memaddr = p->kern_entry; + kernel->partition_entryaddr = p->kern_entry; + strncpy(kernel->filename, kernelfile, sizeof(kernel->filename)); +@@ -263,8 +261,8 @@ static int create_image_layout(const char* kernelfile, const char* rootfsfile, c + rootfs->partition_entryaddr = 0x00000000; + strncpy(rootfs->filename, rootfsfile, sizeof(rootfs->filename)); + +-printf("kernel: %d 0x%08x\n", kernel->partition_length, kernel->partition_baseaddr); +-printf("root: %d 0x%08x\n", rootfs->partition_length, rootfs->partition_baseaddr); ++ printf("kernel: %d 0x%08x\n", kernel->partition_length, kernel->partition_baseaddr); ++ printf("root: %d 0x%08x\n", rootfs->partition_length, rootfs->partition_baseaddr); + im->part_count = 2; + + return 0; diff --git a/patches/openwrt/0041-ar71xx-firmware-utils-split-ubdev01-flash-layout-from-XM.patch b/patches/openwrt/0041-ar71xx-firmware-utils-split-ubdev01-flash-layout-from-XM.patch new file mode 100644 index 00000000..aa94ff83 --- /dev/null +++ b/patches/openwrt/0041-ar71xx-firmware-utils-split-ubdev01-flash-layout-from-XM.patch @@ -0,0 +1,39 @@ +From: Matthias Schiffer +Date: Thu, 25 Feb 2016 21:40:19 +0100 +Subject: ar71xx, firmware-utils: split ubdev01 flash layout from XM + +The ubdev01 profile defines its own MTDPARTS with smaller firmware +partition, so give it its own UBNT_BOARD in mkfwimage. + +Signed-off-by: Matthias Schiffer + +diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile +index dd224d4..4aaa115 100644 +--- a/target/linux/ar71xx/image/Makefile ++++ b/target/linux/ar71xx/image/Makefile +@@ -2031,7 +2031,7 @@ $(eval $(call SingleProfile,TPLINK-SAFELOADER,64kraw,CPE510,cpe210-220-510-520,C + $(eval $(call SingleProfile,UAPPRO,64k,UAPPRO,ubnt-uap-pro,UAP-PRO,ttyS0,115200,BZ,BZ,ar934x)) + $(eval $(call SingleProfile,UAPPRO,64k,UBNTUNIFIOUTDOORPLUS,ubnt-unifi-outdoor-plus,UBNT-UOP,ttyS0,115200,BZ,BZ,ar7240)) + +-$(eval $(call SingleProfile,UBDEV,64kraw,UBDEV01,ubdev01,UBNT-UF,ttyS0,115200,XM,XM,ar7240)) ++$(eval $(call SingleProfile,UBDEV,64kraw,UBDEV01,ubdev01,UBNT-UF,ttyS0,115200,UBDEV01,XM,ar7240)) + + $(eval $(call SingleProfile,UBNT,64k,UBNTRS,ubnt-rs,UBNT-RS,ttyS0,115200,RS,RSx,ar7100)) + $(eval $(call SingleProfile,UBNT,64k,UBNTRSPRO,ubnt-rspro,UBNT-RSPRO,ttyS0,115200,RSPRO,RSPRO,ar7100pro)) +diff --git a/tools/firmware-utils/src/mkfwimage.c b/tools/firmware-utils/src/mkfwimage.c +index 00bf439..5dae284 100644 +--- a/tools/firmware-utils/src/mkfwimage.c ++++ b/tools/firmware-utils/src/mkfwimage.c +@@ -81,6 +81,12 @@ fw_layout_t fw_layout_data[] = { + .kern_entry = 0x80002000, + .firmware_max_length= 0x006A0000, + }, ++ { ++ .name = "UBDEV01", ++ .kern_start = 0x9f050000, ++ .kern_entry = 0x80002000, ++ .firmware_max_length= 0x006A0000, ++ }, + { .name = "", + }, + }; diff --git a/patches/openwrt/0042-firmware-utils-mkfwimage-fix-firmware_max_length-for-XM-layout.patch b/patches/openwrt/0042-firmware-utils-mkfwimage-fix-firmware_max_length-for-XM-layout.patch new file mode 100644 index 00000000..ab1c34db --- /dev/null +++ b/patches/openwrt/0042-firmware-utils-mkfwimage-fix-firmware_max_length-for-XM-layout.patch @@ -0,0 +1,45 @@ +From: Matthias Schiffer +Date: Thu, 25 Feb 2016 21:42:14 +0100 +Subject: firmware-utils: mkfwimage: fix firmware_max_length for XM layout + +The new u-boot version bundled with the 5.6.x firmwares from Ubiquiti gets +confused by the smaller rootfs partition size; this can lead to various +issues: + +1. We've gotten reports that flashing from the 5.6.x stock firmware to + OpenWrt will brick devices; I wasn't able to reproduce this myself +2. Flashing from 5.5.x stock firmware to OpenWrt and back to stock (via + TFTP recovery), following by an update to 5.6.x via web interface can + yield a bricked device with the following properties: + - It can't be booted without entering commands over a serial console, as + u-boot supplies the wrong MTD layout + - The web interface won't accept any image with the original flash + layout, so stock firmware upgrades are impossible + - As the TFTP recovery doesn't update u-boot, returning to the old + u-boot from firmware 5.5.x is impossible + +To recover from 2., creating an OpenWrt image which doesn't set u-boot as +read-only and flashing a backup of the old u-boot from there is the only +way known to me. (Fixing the mtdparts variable in u-boot-env from OpenWrt +might also work; settings this from u-boot over serial didn't have +any permanent effect.) + +Fix all of this by setting the correct flash layout also used by the stock +firmware. Flashing has been tested from both firmware 5.5.x and 5.6.x. The +fixed layout also matches the mtdparts defined by OpenWrt. + +Signed-off-by: Matthias Schiffer + +diff --git a/tools/firmware-utils/src/mkfwimage.c b/tools/firmware-utils/src/mkfwimage.c +index 5dae284..d8d5239 100644 +--- a/tools/firmware-utils/src/mkfwimage.c ++++ b/tools/firmware-utils/src/mkfwimage.c +@@ -79,7 +79,7 @@ fw_layout_t fw_layout_data[] = { + .name = "XM", + .kern_start = 0x9f050000, + .kern_entry = 0x80002000, +- .firmware_max_length= 0x006A0000, ++ .firmware_max_length= 0x00760000, + }, + { + .name = "UBDEV01", From 89b3dca8b5319657b37fa5ad736a65bef87f53e9 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 26 Feb 2016 04:39:50 +0100 Subject: [PATCH 308/867] kernel: disable software protection bits for macronix flash chips at init The bootloader of AirOS 5.6.x doesn't remove the flash protection for us, so we have to do this ourselves. --- ...its-for-macronix-flash-chips-at-init.patch | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 patches/openwrt/0043-kernel-disable-software-protection-bits-for-macronix-flash-chips-at-init.patch diff --git a/patches/openwrt/0043-kernel-disable-software-protection-bits-for-macronix-flash-chips-at-init.patch b/patches/openwrt/0043-kernel-disable-software-protection-bits-for-macronix-flash-chips-at-init.patch new file mode 100644 index 00000000..2b16474a --- /dev/null +++ b/patches/openwrt/0043-kernel-disable-software-protection-bits-for-macronix-flash-chips-at-init.patch @@ -0,0 +1,22 @@ +From: Matthias Schiffer +Date: Fri, 26 Feb 2016 04:24:06 +0100 +Subject: kernel: disable software protection bits for macronix flash chips at init + +Backport of r47626 + +diff --git a/target/linux/generic/patches-3.18/465-m25p80-mx-disable-software-protection.patch b/target/linux/generic/patches-3.18/465-m25p80-mx-disable-software-protection.patch +new file mode 100644 +index 0000000..d7d7eec +--- /dev/null ++++ b/target/linux/generic/patches-3.18/465-m25p80-mx-disable-software-protection.patch +@@ -0,0 +1,10 @@ ++--- a/drivers/mtd/spi-nor/spi-nor.c +++++ b/drivers/mtd/spi-nor/spi-nor.c ++@@ -962,6 +962,7 @@ int spi_nor_scan(struct spi_nor *nor, co ++ ++ if (JEDEC_MFR(info->jedec_id) == CFI_MFR_ATMEL || ++ JEDEC_MFR(info->jedec_id) == CFI_MFR_INTEL || +++ JEDEC_MFR(info->jedec_id) == CFI_MFR_MACRONIX || ++ JEDEC_MFR(info->jedec_id) == CFI_MFR_SST) { ++ write_enable(nor); ++ write_sr(nor, 0); From 88bdc981088faeba82adb888c4472bfc59c29d96 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 26 Feb 2016 05:34:23 +0100 Subject: [PATCH 309/867] gluon-status-page: don't reset signal graphs on resize events if width hasn't changed Mobile browsers will often show or hide the address bar while scrolling. This causes resize events which would often reset the signal graphs. Fixes #662 --- package/gluon-status-page/src/js/lib/gui/signalgraph.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/gluon-status-page/src/js/lib/gui/signalgraph.js b/package/gluon-status-page/src/js/lib/gui/signalgraph.js index 83732158..231ce628 100644 --- a/package/gluon-status-page/src/js/lib/gui/signalgraph.js +++ b/package/gluon-status-page/src/js/lib/gui/signalgraph.js @@ -110,7 +110,7 @@ define(function () { function resize() { var newWidth = canvas.parentNode.clientWidth - if (newWidth === 0) + if (newWidth === 0 || newWidth === canvas.width) return var lastImage = ctx.getImageData(0, 0, newWidth, canvas.height) From d2ab15660588e93be3bd4baa44988ea4c1dbed2b Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 28 Feb 2016 01:37:21 +0100 Subject: [PATCH 310/867] Update OpenWrt base --- modules | 2 +- ...-mac80211-backport-from-trunk-r48681.patch | 164 ++++++------------ 2 files changed, 56 insertions(+), 110 deletions(-) diff --git a/modules b/modules index 5d951303..471ff93d 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=c698aa66043a151ac76d19849be9ee24dfd78b72 +OPENWRT_COMMIT=a03a846c49c067048cd225d476a7adf91ef8ff03 PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git PACKAGES_OPENWRT_COMMIT=9622fe984bba3a4547f48bc507ebaba7637eb2b0 diff --git a/patches/openwrt/0007-mac80211-backport-from-trunk-r48681.patch b/patches/openwrt/0007-mac80211-backport-from-trunk-r48681.patch index 27c6da67..4c42c057 100644 --- a/patches/openwrt/0007-mac80211-backport-from-trunk-r48681.patch +++ b/patches/openwrt/0007-mac80211-backport-from-trunk-r48681.patch @@ -32234,69 +32234,14 @@ index 0000000..7ae8b1d ++#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 +index 8ec73d9..a74d9ee 100644 +--- 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 -@@ -0,0 +1,444 @@ -+--- a/drivers/bcma/driver_chipcommon.c -++++ b/drivers/bcma/driver_chipcommon.c +@@ -1,6 +1,40 @@ + --- a/drivers/bcma/driver_chipcommon.c + +++ b/drivers/bcma/driver_chipcommon.c +-@@ -190,6 +190,7 @@ u32 bcma_chipco_watchdog_timer_set(struc +@@ -15,6 +15,8 @@ + #include + #include @@ -32332,13 +32277,13 @@ index 0000000..a74d9ee +- 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); + struct bcma_bus *bus = cc->core->bus; + + if (bus->chipinfo.id != BCMA_CHIP_ID_BCM4707 && +@@ -8,6 +42,232 @@ + 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; + } @@ -32565,28 +32510,41 @@ index 0000000..a74d9ee ++ 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" }, -+ }; -+ + --- 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 +@@ -18,27 +278,6 @@ + { NULL }, + }; + +---- 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/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) }, + --- a/drivers/bcma/scan.c + +++ b/drivers/bcma/scan.c + @@ -98,6 +98,9 @@ static const struct bcma_device_id_name +@@ -51,6 +290,32 @@ + { 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: @@ -32613,25 +32571,13 @@ index 0000000..a74d9ee + 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.h + +++ b/include/linux/bcma/bcma.h + @@ -151,6 +151,8 @@ struct bcma_host_ops { +@@ -70,3 +335,110 @@ + #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 @@ From c9f7a17d3ad0d16e3ff79229ae120193ba480927 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 28 Feb 2016 02:30:34 +0100 Subject: [PATCH 311/867] brcm2708-gpu-fw: move pkg build dir to kernel build dir to fix rebuild bugs after cleaning the kernel tree Backport of r48732 --- ...-bugs-after-cleaning-the-kernel-tree.patch | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 patches/openwrt/0044-brcm2708-gpu-fw-move-pkg-build-dir-to-kernel-build-dir-to-fix-rebuild-bugs-after-cleaning-the-kernel-tree.patch diff --git a/patches/openwrt/0044-brcm2708-gpu-fw-move-pkg-build-dir-to-kernel-build-dir-to-fix-rebuild-bugs-after-cleaning-the-kernel-tree.patch b/patches/openwrt/0044-brcm2708-gpu-fw-move-pkg-build-dir-to-kernel-build-dir-to-fix-rebuild-bugs-after-cleaning-the-kernel-tree.patch new file mode 100644 index 00000000..1fab9e46 --- /dev/null +++ b/patches/openwrt/0044-brcm2708-gpu-fw-move-pkg-build-dir-to-kernel-build-dir-to-fix-rebuild-bugs-after-cleaning-the-kernel-tree.patch @@ -0,0 +1,19 @@ +From: Matthias Schiffer +Date: Sun, 28 Feb 2016 02:29:56 +0100 +Subject: brcm2708-gpu-fw: move pkg build dir to kernel build dir to fix rebuild bugs after cleaning the kernel tree + +Backport of r48732 + +diff --git a/package/kernel/brcm2708-gpu-fw/Makefile b/package/kernel/brcm2708-gpu-fw/Makefile +index eee85e0..286984b 100644 +--- a/package/kernel/brcm2708-gpu-fw/Makefile ++++ b/package/kernel/brcm2708-gpu-fw/Makefile +@@ -16,7 +16,7 @@ PKG_SOURCE:=$(PKG_REV).tar.gz + PKG_SOURCE_URL:=https://github.com/Hexxeh/rpi-firmware/archive/ + PKG_MD5SUM:=f5683c1dcb255714942f7c9fd61b3a0a + +-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/rpi-firmware-$(PKG_REV) ++PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)/rpi-firmware-$(PKG_REV) + + include $(INCLUDE_DIR)/package.mk + From 00b620ae516689a20e1e03b4e35225bded18ea8e Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 28 Feb 2016 03:27:49 +0100 Subject: [PATCH 312/867] Update mac80211 backport to r48810 --- ...mac80211-backport-from-trunk-r48810.patch} | 692 ++++++++++++++---- 1 file changed, 559 insertions(+), 133 deletions(-) rename patches/openwrt/{0007-mac80211-backport-from-trunk-r48681.patch => 0007-mac80211-backport-from-trunk-r48810.patch} (98%) diff --git a/patches/openwrt/0007-mac80211-backport-from-trunk-r48681.patch b/patches/openwrt/0007-mac80211-backport-from-trunk-r48810.patch similarity index 98% rename from patches/openwrt/0007-mac80211-backport-from-trunk-r48681.patch rename to patches/openwrt/0007-mac80211-backport-from-trunk-r48810.patch index 4c42c057..39e628b4 100644 --- a/patches/openwrt/0007-mac80211-backport-from-trunk-r48681.patch +++ b/patches/openwrt/0007-mac80211-backport-from-trunk-r48810.patch @@ -1,6 +1,6 @@ From: Matthias Schiffer -Date: Tue, 23 Dec 2014 18:57:16 +0100 -Subject: mac80211: backport from trunk r48681 +Date: Sun, 28 Feb 2016 03:14:24 +0100 +Subject: mac80211: backport from trunk r48810 Backport mac80211 and dependent drivers/firmwares from OpenWrt trunk. @@ -630,10 +630,10 @@ index 0000000..f5adfaf +$(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 +index 0000000..752a8e0 --- /dev/null +++ b/package/firmware/linux-firmware/marvell.mk -@@ -0,0 +1,46 @@ +@@ -0,0 +1,56 @@ +Package/mwl8k-firmware = $(call Package/firmware-default,Marvell 8366/8687 firmware) +define Package/mwl8k-firmware/install + $(INSTALL_DIR) $(1)/lib/firmware/mwl8k @@ -680,6 +680,16 @@ index 0000000..86c0e6f +endef +$(eval $(call BuildPackage,libertas-sdio-firmware)) + ++Package/libertas-spi-firmware = $(call Package/firmware-default,Marvell 8686 SPI firmware) ++define Package/libertas-spi-firmware/install ++ $(INSTALL_DIR) $(1)/lib/firmware/libertas ++ $(INSTALL_DATA) \ ++ $(PKG_BUILD_DIR)/libertas/gspi8686_v9_helper.bin \ ++ $(PKG_BUILD_DIR)/libertas/gspi8686_v9.bin \ ++ $(1)/lib/firmware/libertas ++endef ++$(eval $(call BuildPackage,libertas-spi-firmware)) ++ diff --git a/package/firmware/linux-firmware/mediatek.mk b/package/firmware/linux-firmware/mediatek.mk new file mode 100644 index 0000000..591ffee @@ -1150,7 +1160,7 @@ index 0000000..ee92b94 + int acx_recover_hw(acx_device_t *adev); + diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile -index a1eedce..156ea01 100644 +index a1eedce..525537c 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -10,11 +10,11 @@ include $(INCLUDE_DIR)/kernel.mk @@ -1187,7 +1197,7 @@ index a1eedce..156ea01 100644 + iwl-legacy iwl3945 iwl4965 iwlwifi \ + lib80211 \ + libipw ipw2100 ipw2200 \ -+ libertas-sdio libertas-usb \ ++ libertas-sdio libertas-usb libertas-spi \ + mac80211-hwsim \ + mt7601u \ + mwl8k mwifiex-pcie \ @@ -2623,7 +2633,7 @@ index a1eedce..156ea01 100644 AUTOLOAD:=$(call AutoProbe,iwl4965) endef -@@ -975,557 +867,562 @@ define KernelPackage/iwl4965/description +@@ -975,557 +867,576 @@ define KernelPackage/iwl4965/description endef @@ -2764,13 +2774,6 @@ index a1eedce..156ea01 100644 - FILE:=$(PKG_B43_FWV4_SOURCE) - URL:=$(PKG_B43_FWV4_SOURCE_URL) - MD5SUM:=$(PKG_B43_FWV4_MD5SUM) --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 \ @@ -2782,11 +2785,26 @@ index a1eedce..156ea01 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 -- $(call KernelPackage/mac80211/Default) ++define KernelPackage/libipw + $(call KernelPackage/mac80211/Default) - TITLE:=Broadcom 43xx wireless support - URL:=https://wireless.wiki.kernel.org/en/users/drivers/b43 - KCONFIG:= \ @@ -2799,15 +2817,8 @@ index a1eedce..156ea01 100644 - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/b43/b43.ko - AUTOLOAD:=$(call AutoProbe,b43) - MENU:=1 -+define KernelPackage/lib80211/description -+ Kernel modules for 802.11 Networking stack -+ Includes: -+ - lib80211 -+ - lib80211_crypt_wep -+ - lib80211_crypt_tkip -+ - lib80211_crytp_ccmp - endef - +-endef +- -define KernelPackage/b43/config - -config PACKAGE_B43_USE_SSB @@ -2825,36 +2836,29 @@ index a1eedce..156ea01 100644 - 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)" +- choice +- prompt "b43 firmware version" +- default B43_FW_5_100_138 - help -- Old stable firmware for BCM43xx devices. +- This option allows you to select the version of the b43 firmware. +define KernelPackage/libipw/description + Hardware independent IEEE 802.11 networking stack for ipw2100 and ipw2200. +endef -- If unsure, select this. +- config B43_FW_4_150 +- bool "Firmware 410.2160 from driver 4.150.10.5 (old stable)" +- help +- Old stable firmware for BCM43xx devices. +IPW2100_NAME:=ipw2100-fw +IPW2100_VERSION:=1.3 -- config B43_FW_4_178 -- bool "Firmware 478.104 from driver 4.178.10.4" -- help -- Older firmware for BCM43xx devices. +- If unsure, select this. +define Download/ipw2100 + URL:=http://bughost.org/firmware/ + FILE:=$(IPW2100_NAME)-$(IPW2100_VERSION).tgz @@ -2862,7 +2866,10 @@ index a1eedce..156ea01 100644 +endef +$(eval $(call Download,ipw2100)) -- If unsure, select the "stable" firmware. +- config B43_FW_4_178 +- bool "Firmware 478.104 from driver 4.178.10.4" +- help +- Older firmware for BCM43xx devices. +define KernelPackage/ipw2100 + $(call KernelPackage/mac80211/Default) + TITLE:=Intel IPW2100 driver @@ -2871,24 +2878,21 @@ index a1eedce..156ea01 100644 + AUTOLOAD:=$(call AutoProbe,ipw2100) +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 "stable" firmware. +define KernelPackage/ipw2100/description + Kernel support for Intel IPW2100 + Includes: + - ipw2100 +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. +IPW2200_NAME:=ipw2200-fw +IPW2200_VERSION:=3.1 -- config B43_FW_5_100_138 -- bool "Firmware 666.2 from driver 5.100.138 (stable)" -- help -- The currently default firmware for BCM43xx devices. +- If unsure, select the "stable" firmware. +define Download/ipw2200 + URL:=http://bughost.org/firmware/ + FILE:=$(IPW2200_NAME)-$(IPW2200_VERSION).tgz @@ -2896,7 +2900,10 @@ index a1eedce..156ea01 100644 +endef +$(eval $(call Download,ipw2200)) -- This firmware currently gets most of the testing and is needed for some N-PHY devices. +- 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/ipw2200 + $(call KernelPackage/mac80211/Default) + TITLE:=Intel IPW2200 driver @@ -2905,19 +2912,19 @@ index a1eedce..156ea01 100644 + AUTOLOAD:=$(call AutoProbe,ipw2200) +endef -- If unsure, select the this firmware. +- This firmware currently gets most of the testing and is needed for some N-PHY devices. +define KernelPackage/ipw2200/description + Kernel support for Intel IPW2200 + Includes: + - ipw2200 +endef +- If unsure, select the this firmware. + - config B43_FW_6_30 - bool "Firmware 784.2 from driver 6.30.163.46 (experimental)" - help - 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 +libertas-usb-firmware @@ -2928,7 +2935,7 @@ index a1eedce..156ea01 100644 + AUTOLOAD:=$(call AutoProbe,libertas usb8xxx) +endef -- If unsure, select the "stable" firmware. +- This firmware is mostly untested. +define KernelPackage/libertas-sdio + $(call KernelPackage/mac80211/Default) + DEPENDS+= +kmod-cfg80211 +kmod-lib80211 +kmod-mmc +@DRIVER_WEXT_SUPPORT @!TARGET_uml +libertas-sdio-firmware @@ -2939,6 +2946,21 @@ index a1eedce..156ea01 100644 + AUTOLOAD:=$(call AutoProbe,libertas libertas_sdio) +endef +- If unsure, select the "stable" firmware. ++define KernelPackage/libertas-spi ++ $(call KernelPackage/mac80211/Default) ++ SUBMENU:=Wireless Drivers ++ DEPENDS+= +kmod-cfg80211 +kmod-lib80211 +@DRIVER_WEXT_SUPPORT +libertas-spi-firmware ++ KCONFIG := \ ++ CONFIG_SPI=y \ ++ CONFIG_SPI_MASTER=y ++ TITLE:=Marvell 88W8686 SPI Wireless Driver ++ FILES:= \ ++ $(PKG_BUILD_DIR)/drivers/net/wireless/marvell/libertas/libertas.ko \ ++ $(PKG_BUILD_DIR)/drivers/net/wireless/marvell/libertas/libertas_spi.ko ++ AUTOLOAD:=$(call AutoProbe,libertas libertas_spi) ++endef + - config B43_OPENFIRMWARE - bool "Open FirmWare for WiFi networks" - help @@ -3632,7 +3654,7 @@ index a1eedce..156ea01 100644 config_package=$(if $(CONFIG_PACKAGE_kmod-$(1)),m) config-y:= \ -@@ -1538,6 +1435,20 @@ config-y:= \ +@@ -1538,6 +1449,20 @@ config-y:= \ MAC80211_RC_MINSTREL_HT \ MAC80211_RC_MINSTREL_VHT \ MAC80211_RC_DEFAULT_MINSTREL \ @@ -3653,7 +3675,7 @@ index a1eedce..156ea01 100644 config-$(call config_package,cfg80211) += CFG80211 -@@ -1554,6 +1465,16 @@ ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS +@@ -1554,6 +1479,16 @@ ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS ATH5K_DEBUG endif @@ -3670,7 +3692,7 @@ index a1eedce..156ea01 100644 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 +@@ -1602,6 +1537,8 @@ config-$(CONFIG_BRCMFMAC_PCIE) += BRCMFMAC_PCIE config-$(CONFIG_PACKAGE_BRCM80211_DEBUG) += BRCMDBG config-$(call config_package,mac80211-hwsim) += MAC80211_HWSIM @@ -3679,7 +3701,7 @@ index a1eedce..156ea01 100644 config-$(call config_package,rt2x00-lib) += RT2X00 RT2X00_LIB config-$(call config_package,rt2x00-pci) += RT2X00_LIB_PCI -@@ -1623,26 +1546,28 @@ config-$(call config_package,rt2800-pci) += RT2800PCI +@@ -1623,31 +1560,34 @@ config-$(call config_package,rt2800-pci) += RT2800PCI config-y += RT2800PCI_RT33XX RT2800PCI_RT35XX RT2800PCI_RT53XX RT2800PCI_RT3290 config-$(call config_package,rt2800-usb) += RT2800USB @@ -3717,7 +3739,13 @@ index a1eedce..156ea01 100644 config-y += HERMES_PRISM config-$(call config_package,adm8211) += ADM8211 -@@ -1668,12 +1593,15 @@ config-$(call config_package,rtl8192de) += RTL8192DE + config-$(call config_package,libertas-sdio) += LIBERTAS LIBERTAS_SDIO + config-$(call config_package,libertas-usb) += LIBERTAS LIBERTAS_USB ++config-$(call config_package,libertas-spi) += LIBERTAS LIBERTAS_SPI + config-$(call config_package,mwl8k) += MWL8K + config-$(call config_package,mwifiex-pcie) += MWIFIEX MWIFIEX_PCIE + config-$(call config_package,rtl8180) += RTL8180 +@@ -1668,12 +1608,15 @@ config-$(call config_package,rtl8192de) += RTL8192DE config-$(call config_package,rtl8192cu) += RTL8192CU config-$(CONFIG_PACKAGE_RTLWIFI_DEBUG) += RTLWIFI_DEBUG @@ -3734,7 +3762,7 @@ index a1eedce..156ea01 100644 KLIB_BUILD="$(LINUX_DIR)" \ MODPROBE=true \ KLIB=$(TARGET_MODULES_DIR) \ -@@ -1702,8 +1630,6 @@ define Build/Prepare +@@ -1702,8 +1645,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 @@ -3743,7 +3771,7 @@ index a1eedce..156ea01 100644 rm -rf \ $(PKG_BUILD_DIR)/include/linux/ssb \ $(PKG_BUILD_DIR)/include/linux/bcma \ -@@ -1715,7 +1641,8 @@ define Build/Prepare +@@ -1715,7 +1656,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 \ @@ -3753,7 +3781,7 @@ index a1eedce..156ea01 100644 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 +@@ -1753,220 +1695,6 @@ define Build/InstallDev rm -f $(1)/usr/include/mac80211-backport/linux/module.h endef @@ -3974,7 +4002,7 @@ index a1eedce..156ea01 100644 define KernelPackage/b43/install rm -rf $(1)/lib/firmware/ -@@ -1990,51 +1703,84 @@ ifneq ($(CONFIG_B43_FW_SQUASH),) +@@ -1990,51 +1718,85 @@ ifneq ($(CONFIG_B43_FW_SQUASH),) endif endef @@ -4077,6 +4105,7 @@ index a1eedce..156ea01 100644 $(eval $(call KernelPackage,libertas-usb)) $(eval $(call KernelPackage,libertas-sdio)) -$(eval $(call KernelPackage,cfg80211)) ++$(eval $(call KernelPackage,libertas-spi)) +$(eval $(call KernelPackage,libipw)) +$(eval $(call KernelPackage,ipw2100)) +$(eval $(call KernelPackage,ipw2200)) @@ -4088,7 +4117,7 @@ index a1eedce..156ea01 100644 $(eval $(call KernelPackage,p54-common)) $(eval $(call KernelPackage,p54-pci)) $(eval $(call KernelPackage,p54-usb)) -@@ -2047,12 +1793,12 @@ $(eval $(call KernelPackage,rt2800-lib)) +@@ -2047,12 +1809,12 @@ $(eval $(call KernelPackage,rt2800-lib)) $(eval $(call KernelPackage,rt2400-pci)) $(eval $(call KernelPackage,rt2500-pci)) $(eval $(call KernelPackage,rt2500-usb)) @@ -4103,7 +4132,7 @@ index a1eedce..156ea01 100644 $(eval $(call KernelPackage,rtl8180)) $(eval $(call KernelPackage,rtl8187)) $(eval $(call KernelPackage,rtlwifi)) -@@ -2063,32 +1809,8 @@ $(eval $(call KernelPackage,rtl8192ce)) +@@ -2063,32 +1825,8 @@ $(eval $(call KernelPackage,rtl8192ce)) $(eval $(call KernelPackage,rtl8192se)) $(eval $(call KernelPackage,rtl8192de)) $(eval $(call KernelPackage,rtl8192cu)) @@ -9606,6 +9635,155 @@ index d132636..0000000 - - #define BW_20 0 - #define BW_40 1 +diff --git a/package/kernel/mac80211/patches/309-01-brcmfmac-add-missing-include.patch b/package/kernel/mac80211/patches/309-01-brcmfmac-add-missing-include.patch +new file mode 100644 +index 0000000..d9511c8 +--- /dev/null ++++ b/package/kernel/mac80211/patches/309-01-brcmfmac-add-missing-include.patch +@@ -0,0 +1,19 @@ ++From: Felix Fietkau ++Date: Fri, 15 Jan 2016 15:59:45 +0100 ++Subject: [PATCH] brcmfmac: add missing include ++ ++linux/module.h is required for defining module parameters ++ ++Signed-off-by: Felix Fietkau ++--- ++ ++--- 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/309-02-brcmfmac-fix-sdio-sg-table-alloc-crash.patch b/package/kernel/mac80211/patches/309-02-brcmfmac-fix-sdio-sg-table-alloc-crash.patch +new file mode 100644 +index 0000000..711e019 +--- /dev/null ++++ b/package/kernel/mac80211/patches/309-02-brcmfmac-fix-sdio-sg-table-alloc-crash.patch +@@ -0,0 +1,118 @@ ++From: Hante Meuleman ++Date: Tue, 19 Jan 2016 12:39:24 +0100 ++Subject: [PATCH] brcmfmac: fix sdio sg table alloc crash ++ ++With commit 7d34b0560567 ("brcmfmac: Move all module parameters to ++one place") a bug was introduced causing a null pointer exception. ++This patch fixes the bug by initializing the sg table till after ++the settings have been initialized. ++ ++Fixes: 7d34b0560567 ("brcmfmac: Move all module parameters to one place") ++Reported-by: Marc Zyngier ++Tested-by: Marc Zyngier ++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/broadcom/brcm80211/brcmfmac/bcmsdh.c +++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c ++@@ -879,11 +879,24 @@ int brcmf_sdiod_abort(struct brcmf_sdio_ ++ return 0; ++ } ++ ++-static void brcmf_sdiod_sgtable_alloc(struct brcmf_sdio_dev *sdiodev) +++void brcmf_sdiod_sgtable_alloc(struct brcmf_sdio_dev *sdiodev) ++ { +++ struct sdio_func *func; +++ struct mmc_host *host; +++ uint max_blocks; ++ uint nents; ++ int err; ++ +++ func = sdiodev->func[2]; +++ host = func->card->host; +++ sdiodev->sg_support = host->max_segs > 1; +++ max_blocks = min_t(uint, host->max_blk_count, 511u); +++ sdiodev->max_request_size = min_t(uint, host->max_req_size, +++ max_blocks * func->cur_blksize); +++ sdiodev->max_segment_count = min_t(uint, host->max_segs, +++ SG_MAX_SINGLE_ALLOC); +++ sdiodev->max_segment_size = host->max_seg_size; +++ ++ if (!sdiodev->sg_support) ++ return; ++ ++@@ -1021,9 +1034,6 @@ static void brcmf_sdiod_host_fixup(struc ++ ++ static int brcmf_sdiod_probe(struct brcmf_sdio_dev *sdiodev) ++ { ++- struct sdio_func *func; ++- struct mmc_host *host; ++- uint max_blocks; ++ int ret = 0; ++ ++ sdiodev->num_funcs = 2; ++@@ -1054,26 +1064,6 @@ static int brcmf_sdiod_probe(struct brcm ++ goto out; ++ } ++ ++- /* ++- * determine host related variables after brcmf_sdiod_probe() ++- * as func->cur_blksize is properly set and F2 init has been ++- * completed successfully. ++- */ ++- func = sdiodev->func[2]; ++- host = func->card->host; ++- sdiodev->sg_support = host->max_segs > 1; ++- max_blocks = min_t(uint, host->max_blk_count, 511u); ++- sdiodev->max_request_size = min_t(uint, host->max_req_size, ++- max_blocks * func->cur_blksize); ++- sdiodev->max_segment_count = min_t(uint, host->max_segs, ++- SG_MAX_SINGLE_ALLOC); ++- sdiodev->max_segment_size = host->max_seg_size; ++- ++- /* allocate scatter-gather table. sg support ++- * will be disabled upon allocation failure. ++- */ ++- brcmf_sdiod_sgtable_alloc(sdiodev); ++- ++ ret = brcmf_sdiod_freezer_attach(sdiodev); ++ if (ret) ++ goto out; ++@@ -1084,7 +1074,7 @@ static int brcmf_sdiod_probe(struct brcm ++ ret = -ENODEV; ++ goto out; ++ } ++- brcmf_sdiod_host_fixup(host); +++ brcmf_sdiod_host_fixup(sdiodev->func[2]->card->host); ++ out: ++ if (ret) ++ brcmf_sdiod_remove(sdiodev); ++--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c ++@@ -4114,6 +4114,11 @@ struct brcmf_sdio *brcmf_sdio_probe(stru ++ goto fail; ++ } ++ +++ /* allocate scatter-gather table. sg support +++ * will be disabled upon allocation failure. +++ */ +++ brcmf_sdiod_sgtable_alloc(bus->sdiodev); +++ ++ /* Query the F2 block size, set roundup accordingly */ ++ bus->blocksize = bus->sdiodev->func[2]->cur_blksize; ++ bus->roundup = min(max_roundup, bus->blocksize); ++--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h +++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h ++@@ -342,6 +342,7 @@ int brcmf_sdiod_ramrw(struct brcmf_sdio_ ++ ++ /* Issue an abort to the specified function */ ++ int brcmf_sdiod_abort(struct brcmf_sdio_dev *sdiodev, uint fn); +++void brcmf_sdiod_sgtable_alloc(struct brcmf_sdio_dev *sdiodev); ++ void brcmf_sdiod_change_state(struct brcmf_sdio_dev *sdiodev, ++ enum brcmf_sdiod_state state); ++ #ifdef CONFIG_PM_SLEEP diff --git a/package/kernel/mac80211/patches/309-ath9k-disable-TPC-support-again-for-now.patch b/package/kernel/mac80211/patches/309-ath9k-disable-TPC-support-again-for-now.patch deleted file mode 100644 index 945fbce..0000000 @@ -9634,31 +9812,6 @@ 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-brcmfmac-add-missing-include.patch b/package/kernel/mac80211/patches/309-brcmfmac-add-missing-include.patch -new file mode 100644 -index 0000000..d9511c8 ---- /dev/null -+++ b/package/kernel/mac80211/patches/309-brcmfmac-add-missing-include.patch -@@ -0,0 +1,19 @@ -+From: Felix Fietkau -+Date: Fri, 15 Jan 2016 15:59:45 +0100 -+Subject: [PATCH] brcmfmac: add missing include -+ -+linux/module.h is required for defining module parameters -+ -+Signed-off-by: Felix Fietkau -+--- -+ -+--- 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 @@ -11953,10 +12106,10 @@ index 7247369..0000000 - for (i = 0; i < ARRAY_SIZE(regList); i++) 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..d55f772 +index 0000000..e7bfb9c --- /dev/null +++ b/package/kernel/mac80211/patches/322-mac80211-add-A-MSDU-tx-support.patch -@@ -0,0 +1,292 @@ +@@ -0,0 +1,317 @@ +From: Felix Fietkau +Date: Fri, 5 Feb 2016 01:38:51 +0100 +Subject: [PATCH] mac80211: add A-MSDU tx support @@ -11985,12 +12138,31 @@ index 0000000..d55f772 + }; + + /* -+@@ -1961,6 +1963,12 @@ struct ieee80211_txq { ++@@ -1728,6 +1730,7 @@ struct ieee80211_sta_rates { ++ * size is min(max_amsdu_len, 7935) bytes. ++ * Both additional HT limits must be enforced by the low level driver. ++ * This is defined by the spec (IEEE 802.11-2012 section 8.3.2.2 NOTE 2). +++ * @max_rc_amsdu_len: Maximum A-MSDU size in bytes recommended by rate control. ++ * @txq: per-TID data TX queues (if driver uses the TXQ abstraction) ++ */ ++ struct ieee80211_sta { ++@@ -1748,6 +1751,7 @@ struct ieee80211_sta { ++ bool mfp; ++ u8 max_amsdu_subframes; ++ u16 max_amsdu_len; +++ u16 max_rc_amsdu_len; ++ ++ struct ieee80211_txq *txq[IEEE80211_NUM_TIDS]; ++ ++@@ -1961,6 +1965,15 @@ 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. +++ * A-MSDU frames. Requires software tx queueing and fast-xmit support. +++ * When not using minstrel/minstrel_ht rate control, the driver should +++ * limit the maximum A-MSDU size based on the current tx rate by setting +++ * max_rc_amsdu_len in struct ieee80211_sta. ++ * ++ * @IEEE80211_HW_TX_FRAG_LIST: Hardware (or driver) supports sending frag_list ++ * skbs, needed for zero-copy software A-MSDU. @@ -11998,7 +12170,7 @@ index 0000000..d55f772 + * @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays + */ + enum ieee80211_hw_flags { -+@@ -1998,6 +2006,8 @@ enum ieee80211_hw_flags { ++@@ -1998,6 +2011,8 @@ enum ieee80211_hw_flags { + IEEE80211_HW_BEACON_TX_STATUS, + IEEE80211_HW_NEEDS_UNIQUE_STA_ADDR, + IEEE80211_HW_SUPPORTS_REORDERING_BUFFER, @@ -12007,16 +12179,17 @@ index 0000000..d55f772 + + /* keep last, obviously */ + NUM_IEEE80211_HW_FLAGS -+@@ -2070,6 +2080,8 @@ enum ieee80211_hw_flags { ++@@ -2070,6 +2085,9 @@ 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. +++ * @max_tx_fragments: maximum number of tx buffers per (A)-MSDU, sum +++ * of 1 + skb_shinfo(skb)->nr_frags for each skb in the frag_list. ++ * + * @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 { ++@@ -2124,6 +2142,7 @@ struct ieee80211_hw { + u8 max_rate_tries; + u8 max_rx_aggregation_subframes; + u8 max_tx_aggregation_subframes; @@ -12079,19 +12252,33 @@ index 0000000..d55f772 + return skb; + } + EXPORT_SYMBOL(ieee80211_tx_dequeue); -+@@ -2757,6 +2761,158 @@ void ieee80211_clear_fast_xmit(struct st ++@@ -2757,6 +2761,163 @@ 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) +++static bool ieee80211_amsdu_realloc_pad(struct ieee80211_local *local, +++ struct sk_buff *skb, int headroom, +++ int *subframe_len) ++{ -++ int amsdu_len = subframe_len + sizeof(struct ethhdr); +++ int amsdu_len = *subframe_len + sizeof(struct ethhdr); ++ int padding = (4 - amsdu_len) & 3; ++ -++ if (padding) -++ memset(skb_put(skb, padding), 0, padding); +++ if (skb_headroom(skb) < headroom || skb_tailroom(skb) < padding) { +++ I802_DEBUG_INC(local->tx_expand_skb_head); ++ -++ return padding; +++ if (pskb_expand_head(skb, headroom, padding, GFP_ATOMIC)) { +++ wiphy_debug(local->hw.wiphy, +++ "failed to reallocate TX buffer\n"); +++ return false; +++ } +++ } +++ +++ if (padding) { +++ *subframe_len += padding; +++ memset(skb_put(skb, padding), 0, padding); +++ } +++ +++ return true; ++} ++ ++static bool ieee80211_amsdu_prepare_head(struct ieee80211_sub_if_data *sdata, @@ -12107,20 +12294,15 @@ index 0000000..d55f772 ++ void *data; ++ u8 *qc; ++ +++ if (info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE) +++ return false; +++ ++ 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; -++ } -++ } -++ -++ subframe_len += ieee80211_amsdu_pad(skb, subframe_len); +++ if (!ieee80211_amsdu_realloc_pad(local, skb, sizeof(amsdu_hdr), +++ &subframe_len)) +++ return false; ++ ++ amsdu_hdr.h_proto = cpu_to_be16(subframe_len); ++ memcpy(amsdu_hdr.h_source, skb->data + fast_tx->sa_offs, ETH_ALEN); @@ -12152,7 +12334,7 @@ index 0000000..d55f772 ++ 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; +++ int max_amsdu_len = sta->sta.max_amsdu_len; ++ __be16 len; ++ void *data; ++ bool ret = false; @@ -12168,6 +12350,10 @@ index 0000000..d55f772 ++ if (test_bit(IEEE80211_TXQ_NO_AMSDU, &txqi->flags)) ++ return false; ++ +++ if (sta->sta.max_rc_amsdu_len) +++ max_amsdu_len = min_t(int, max_amsdu_len, +++ sta->sta.max_rc_amsdu_len); +++ ++ spin_lock_bh(&txqi->queue.lock); ++ ++ head = skb_peek_tail(&txqi->queue); @@ -12204,17 +12390,9 @@ index 0000000..d55f772 ++ 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); +++ if (!ieee80211_amsdu_realloc_pad(local, skb, sizeof(rfc1042_header) + 2, +++ &subframe_len)) +++ return false; ++ ++ ret = true; ++ data = skb_push(skb, ETH_ALEN + 2); @@ -12223,7 +12401,7 @@ index 0000000..d55f772 ++ data += 2 * ETH_ALEN; ++ len = cpu_to_be16(subframe_len); ++ memcpy(data, &len, 2); -++ memcpy(data + 2, rfc1042_header, ETH_ALEN); +++ memcpy(data + 2, rfc1042_header, sizeof(rfc1042_header)); ++ ++ head->len += skb->len; ++ head->data_len += skb->len; @@ -12238,7 +12416,7 @@ index 0000000..d55f772 + 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 ++@@ -2811,6 +2972,10 @@ static bool ieee80211_xmit_fast(struct i + + ieee80211_tx_stats(dev, skb->len + extra_head); + @@ -12249,6 +12427,76 @@ index 0000000..d55f772 + /* 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-0000-brcmfmac-fix-setting-primary-channel-for-80-MHz-widt.patch b/package/kernel/mac80211/patches/323-0000-brcmfmac-fix-setting-primary-channel-for-80-MHz-widt.patch +new file mode 100644 +index 0000000..9277b2c +--- /dev/null ++++ b/package/kernel/mac80211/patches/323-0000-brcmfmac-fix-setting-primary-channel-for-80-MHz-widt.patch +@@ -0,0 +1,64 @@ ++From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= ++Date: Wed, 20 Jan 2016 16:46:04 +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 ++Signed-off-by: Kalle Valo ++--- ++ ++--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c ++@@ -247,7 +247,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: ++@@ -256,24 +256,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/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 @@ -14193,6 +14441,48 @@ 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-wiphy-supported_band-access.patch b/package/kernel/mac80211/patches/334-mac80211-fix-wiphy-supported_band-access.patch +new file mode 100644 +index 0000000..f8f4f09 +--- /dev/null ++++ b/package/kernel/mac80211/patches/334-mac80211-fix-wiphy-supported_band-access.patch +@@ -0,0 +1,36 @@ ++From: Lorenzo Bianconi ++Date: Wed, 10 Feb 2016 16:08:17 +0100 ++Subject: [PATCH] mac80211: fix wiphy supported_band access ++ ++Fix wiphy supported_band access in tx radiotap parsing. In particular, ++info->band is always set to 0 (IEEE80211_BAND_2GHZ) since it has not ++assigned yet. This cause a kernel crash on 5GHz only devices. ++Move ieee80211_parse_tx_radiotap() after info->band assignment ++ ++Signed-off-by: Lorenzo Bianconi ++--- ++ ++--- a/net/mac80211/tx.c +++++ b/net/mac80211/tx.c ++@@ -1890,10 +1890,6 @@ netdev_tx_t ieee80211_monitor_start_xmit ++ info->flags = IEEE80211_TX_CTL_REQ_TX_STATUS | ++ IEEE80211_TX_CTL_INJECTED; ++ ++- /* process and remove the injection radiotap header */ ++- if (!ieee80211_parse_tx_radiotap(local, skb)) ++- goto fail; ++- ++ rcu_read_lock(); ++ ++ /* ++@@ -1955,6 +1951,10 @@ netdev_tx_t ieee80211_monitor_start_xmit ++ goto fail_rcu; ++ ++ info->band = chandef->chan->band; +++ /* process and remove the injection radiotap header */ +++ if (!ieee80211_parse_tx_radiotap(local, skb)) +++ goto fail_rcu; +++ ++ ieee80211_xmit(sdata, NULL, skb); ++ rcu_read_unlock(); ++ 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 @@ -14587,6 +14877,73 @@ 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-minstrel_ht-set-A-MSDU-tx-limits-based-on-s.patch b/package/kernel/mac80211/patches/335-mac80211-minstrel_ht-set-A-MSDU-tx-limits-based-on-s.patch +new file mode 100644 +index 0000000..acaacf7 +--- /dev/null ++++ b/package/kernel/mac80211/patches/335-mac80211-minstrel_ht-set-A-MSDU-tx-limits-based-on-s.patch +@@ -0,0 +1,61 @@ ++From: Felix Fietkau ++Date: Thu, 18 Feb 2016 19:30:05 +0100 ++Subject: [PATCH] mac80211: minstrel_ht: set A-MSDU tx limits based on selected ++ max_prob_rate ++ ++Prevents excessive A-MSDU aggregation at low data rates or bad ++conditions. ++ ++Signed-off-by: Felix Fietkau ++--- ++ ++--- a/net/mac80211/rc80211_minstrel_ht.c +++++ b/net/mac80211/rc80211_minstrel_ht.c ++@@ -883,6 +883,39 @@ minstrel_ht_set_rate(struct minstrel_pri ++ ratetbl->rate[offset].flags = flags; ++ } ++ +++static int +++minstrel_ht_get_max_amsdu_len(struct minstrel_ht_sta *mi) +++{ +++ int group = mi->max_prob_rate / MCS_GROUP_RATES; +++ const struct mcs_group *g = &minstrel_mcs_groups[group]; +++ int rate = mi->max_prob_rate % MCS_GROUP_RATES; +++ +++ /* Disable A-MSDU if max_prob_rate is bad */ +++ if (mi->groups[group].rates[rate].prob_ewma < MINSTREL_FRAC(50, 100)) +++ return 1; +++ +++ /* If the rate is slower than single-stream MCS1, make A-MSDU limit small */ +++ if (g->duration[rate] > MCS_DURATION(1, 0, 52)) +++ return 500; +++ +++ /* +++ * If the rate is slower than single-stream MCS4, limit A-MSDU to usual +++ * data packet size +++ */ +++ if (g->duration[rate] > MCS_DURATION(1, 0, 104)) +++ return 1500; +++ +++ /* +++ * If the rate is slower than single-stream MCS7, limit A-MSDU to twice +++ * the usual data packet size +++ */ +++ if (g->duration[rate] > MCS_DURATION(1, 0, 260)) +++ return 3000; +++ +++ /* unlimited */ +++ return 0; +++} +++ ++ static void ++ minstrel_ht_update_rates(struct minstrel_priv *mp, struct minstrel_ht_sta *mi) ++ { ++@@ -907,6 +940,7 @@ minstrel_ht_update_rates(struct minstrel ++ minstrel_ht_set_rate(mp, mi, rates, i++, mi->max_prob_rate); ++ } ++ +++ mi->sta->max_rc_amsdu_len = minstrel_ht_get_max_amsdu_len(mi); ++ rates->rate[i].idx = -1; ++ rate_control_set_rates(mp->hw, mi->sta, rates); ++ } 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 @@ -15574,6 +15931,43 @@ 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-mac80211-minstrel_ht-set-default-tx-aggregation-time.patch b/package/kernel/mac80211/patches/336-mac80211-minstrel_ht-set-default-tx-aggregation-time.patch +new file mode 100644 +index 0000000..32a2ad6 +--- /dev/null ++++ b/package/kernel/mac80211/patches/336-mac80211-minstrel_ht-set-default-tx-aggregation-time.patch +@@ -0,0 +1,31 @@ ++From: Felix Fietkau ++Date: Thu, 18 Feb 2016 19:45:33 +0100 ++Subject: [PATCH] mac80211: minstrel_ht: set default tx aggregation timeout to ++ 0 ++ ++The value 5000 was put here with the addition of the timeout field to ++ieee80211_start_tx_ba_session. It was originally added in mac80211 to ++save resources for drivers like iwlwifi, which only supports a limited ++number of concurrent aggregation sessions. ++ ++Since iwlwifi does not use minstrel_ht and other drivers don't need ++this, 0 is a better default - especially since there have been ++recent reports of aggregation setup related issues reproduced with ++ath9k. This should improve stability without causing any adverse ++effects. ++ ++Cc: stable@vger.kernel.org ++Signed-off-by: Felix Fietkau ++--- ++ ++--- a/net/mac80211/rc80211_minstrel_ht.c +++++ b/net/mac80211/rc80211_minstrel_ht.c ++@@ -692,7 +692,7 @@ minstrel_aggr_check(struct ieee80211_sta ++ if (likely(sta->ampdu_mlme.tid_tx[tid])) ++ return; ++ ++- ieee80211_start_tx_ba_session(pubsta, tid, 5000); +++ ieee80211_start_tx_ba_session(pubsta, tid, 0); ++ } ++ ++ static void 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 @@ -16123,6 +16517,38 @@ 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-mac80211-minstrel_ht-fix-a-logic-error-in-RTS-CTS-ha.patch b/package/kernel/mac80211/patches/337-mac80211-minstrel_ht-fix-a-logic-error-in-RTS-CTS-ha.patch +new file mode 100644 +index 0000000..229351b +--- /dev/null ++++ b/package/kernel/mac80211/patches/337-mac80211-minstrel_ht-fix-a-logic-error-in-RTS-CTS-ha.patch +@@ -0,0 +1,26 @@ ++From: Felix Fietkau ++Date: Wed, 24 Feb 2016 12:03:13 +0100 ++Subject: [PATCH] mac80211: minstrel_ht: fix a logic error in RTS/CTS handling ++MIME-Version: 1.0 ++Content-Type: text/plain; charset=UTF-8 ++Content-Transfer-Encoding: 8bit ++ ++RTS/CTS needs to be enabled if the rate is a fallback rate *or* if it's ++a dual-stream rate and the sta is in dynamic SMPS mode. ++ ++Fixes: a3ebb4e1b763 ("mac80211: minstrel_ht: handle peers in dynamic SMPS") ++Reported-by: Matías Richart ++Signed-off-by: Felix Fietkau ++--- ++ ++--- a/net/mac80211/rc80211_minstrel_ht.c +++++ b/net/mac80211/rc80211_minstrel_ht.c ++@@ -872,7 +872,7 @@ minstrel_ht_set_rate(struct minstrel_pri ++ * - if station is in dynamic SMPS (and streams > 1) ++ * - for fallback rates, to increase chances of getting through ++ */ ++- if (offset > 0 && +++ if (offset > 0 || ++ (mi->sta->smps_mode == IEEE80211_SMPS_DYNAMIC && ++ group->streams > 1)) { ++ ratetbl->rate[offset].count = ratetbl->rate[offset].count_rts; 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 @@ -31431,7 +31857,7 @@ index 14f8a00..95d93ae 100644 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..9aeb97e 100644 +index 32c4a6f..4295b4b 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 @@ -8,9 +8,9 @@ Content-Transfer-Encoding: 8bit @@ -31443,7 +31869,7 @@ index 32c4a6f..9aeb97e 100644 -@@ -608,9 +608,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 ++@@ -615,9 +615,37 @@ static struct wireless_dev *brcmf_cfg802 u32 *flags, struct vif_params *params) { From ec1c82566a20c10535a9aade5da0bfb6c8a1b09b Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 28 Feb 2016 03:30:14 +0100 Subject: [PATCH 313/867] scripts/patch.sh: add --committer-date-is-author-date to `git am` This option will make the generated commit IDs deterministic, greatly reducing the number of repository objects created when calling `make update` repeatedly. --- scripts/patch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/patch.sh b/scripts/patch.sh index 5f6e0b66..b89d6eb4 100755 --- a/scripts/patch.sh +++ b/scripts/patch.sh @@ -10,7 +10,7 @@ for module in $GLUON_MODULES; do git checkout -B patching base for patch in "$GLUONDIR"/patches/$module/*.patch; do - if ! git -c user.name='Gluon Patch Manager' -c user.email='gluon@void.example.com' am --whitespace=nowarn "$patch"; then + if ! git -c user.name='Gluon Patch Manager' -c user.email='gluon@void.example.com' am --whitespace=nowarn --committer-date-is-author-date "$patch"; then git am --abort git checkout patched git branch -D patching From b6c576645f4a4790e7ffe73bccf47c520a99e011 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 28 Feb 2016 04:41:39 +0100 Subject: [PATCH 314/867] kernel/gpio_keys: load module on pre-init fix rescue mode on wdr4900 Backport of r48793 --- ...el-gpio_keys-load-module-on-pre-init.patch | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 patches/openwrt/0045-kernel-gpio_keys-load-module-on-pre-init.patch diff --git a/patches/openwrt/0045-kernel-gpio_keys-load-module-on-pre-init.patch b/patches/openwrt/0045-kernel-gpio_keys-load-module-on-pre-init.patch new file mode 100644 index 00000000..cba048f6 --- /dev/null +++ b/patches/openwrt/0045-kernel-gpio_keys-load-module-on-pre-init.patch @@ -0,0 +1,21 @@ +From: Matthias Schiffer +Date: Sun, 28 Feb 2016 03:42:29 +0100 +Subject: kernel/gpio_keys: load module on pre-init + +fix rescue mode on wdr4900 + +Backport of r48793 + +diff --git a/package/kernel/linux/modules/input.mk b/package/kernel/linux/modules/input.mk +index 86ff33c..eed9aa2 100644 +--- a/package/kernel/linux/modules/input.mk ++++ b/package/kernel/linux/modules/input.mk +@@ -75,7 +75,7 @@ define KernelPackage/input-gpio-keys + CONFIG_KEYBOARD_GPIO \ + CONFIG_INPUT_KEYBOARD=y + FILES:=$(LINUX_DIR)/drivers/input/keyboard/gpio_keys.ko +- AUTOLOAD:=$(call AutoProbe,gpio_keys) ++ AUTOLOAD:=$(call AutoProbe,gpio_keys,1) + endef + + define KernelPackage/input-gpio-keys/description From ff574cfe6564374ac7e5cce57b2955039a029f44 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 28 Feb 2016 05:00:50 +0100 Subject: [PATCH 315/867] ar71xx/lzma-loader: fix O32 ABI conformance Backport of r48279 --- ...-lzma-loader-fix-O32-ABI-conformance.patch | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 patches/openwrt/0046-ar71xx-lzma-loader-fix-O32-ABI-conformance.patch diff --git a/patches/openwrt/0046-ar71xx-lzma-loader-fix-O32-ABI-conformance.patch b/patches/openwrt/0046-ar71xx-lzma-loader-fix-O32-ABI-conformance.patch new file mode 100644 index 00000000..2d08f3b4 --- /dev/null +++ b/patches/openwrt/0046-ar71xx-lzma-loader-fix-O32-ABI-conformance.patch @@ -0,0 +1,36 @@ +From: Matthias Schiffer +Date: Sun, 28 Feb 2016 04:49:51 +0100 +Subject: ar71xx/lzma-loader: fix O32 ABI conformance + +According to the calling convention of the o32 ABI the caller +function must reserve stack space for $a0-$a3 registers in case +the callee needs to save its arguments. + +The assembly code of the loader does not reserve stack space for +these registers thus when the 'loader_main' function needs to save +its arguments, those will be stored in the 'workspace' area instead +of the stack. + +Because the workspace area is also used by other part of the code, the +saved register values gets overwritten and this often leads to failed +kernel boots. + +Fix the code to reserve stack space for the registers to avoid this +error. + +Backport of r48279 + +diff --git a/target/linux/ar71xx/image/lzma-loader/src/head.S b/target/linux/ar71xx/image/lzma-loader/src/head.S +index 543996a..47a7c9b 100644 +--- a/target/linux/ar71xx/image/lzma-loader/src/head.S ++++ b/target/linux/ar71xx/image/lzma-loader/src/head.S +@@ -109,6 +109,9 @@ __bss_check: + /* Setup new "C" stack */ + la sp, _stack + ++ /* reserve stack space for a0-a3 registers */ ++ subu sp, 16 ++ + /* jump to the decompressor routine */ + la t0, loader_main + jr t0 From c7a957ca9f5b05803736e31d537d9a583fb9d8a5 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 27 Feb 2016 20:37:46 +0100 Subject: [PATCH 316/867] ar71xx-generic: add support for Onion Omega --- targets/ar71xx-generic/profiles.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index cb1d0ca4..7dd6bc5e 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -264,3 +264,9 @@ $(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)) + +## Onion + +# Omega +$(eval $(call GluonProfile,OMEGA)) +$(eval $(call GluonModel,OMEGA,onion-omega,onion-omega)) From 1e78665b12cc4fc7d5ea03c6b23f099c5ef44f3e Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 28 Feb 2016 20:01:19 +0100 Subject: [PATCH 317/867] Add contrib/depdot.sh This script will analyze the dependencies of Gluon's packages and output them as a dot graph. --- contrib/depdot.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 contrib/depdot.sh diff --git a/contrib/depdot.sh b/contrib/depdot.sh new file mode 100755 index 00000000..c065ea57 --- /dev/null +++ b/contrib/depdot.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +# Script to output the dependency graph of Gluon's packages +# Limitations: +# * Works only if directory names and package names are the same (true for all Gluon packages) +# * Doesn't show dependencies through virtual packages correctly + + + +shopt -s nullglob + + +pushd "$(dirname "$0")/.." >/dev/null + + +escape_name() { + echo -n "_$1" | tr -c '[:alnum:]' _ +} + +print_node () { + echo "$(escape_name "$1") [label=\"$1\", shape=box];" +} + +print_dep() { + echo "$(escape_name "$1") -> $(escape_name "$2");" +} + +echo 'digraph G {' + +for makefile in ./package/*/Makefile; do + dir="$(dirname "$makefile")" + package="$(basename "$dir")" + + deps=$(grep -w DEPENDS "$makefile" | cut -d= -f2 | tr -d +) + + print_node "$package" + for dep in $deps; do + print_node "$dep" + print_dep "$package" "$dep" + done +done | sort -u + +popd >/dev/null + +echo '}' From bb8d1783b38d1d1a1fcfb5500ef41d11cc978418 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 28 Feb 2016 22:38:19 +0100 Subject: [PATCH 318/867] gluon-config-mode-*, gluon-luci-portconfig: improve validation Make bandwidth limits unsigned; trim numbers, the validator accepts trailing whitespace. --- .../lib/gluon/config-mode/wizard/0400-geo-location.lua | 6 +++--- .../lib/gluon/config-mode/wizard/0300-mesh-vpn.lua | 8 ++++---- .../usr/lib/lua/luci/model/cbi/admin/portconfig.lua | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/package/gluon-config-mode-geo-location/files/lib/gluon/config-mode/wizard/0400-geo-location.lua b/package/gluon-config-mode-geo-location/files/lib/gluon/config-mode/wizard/0400-geo-location.lua index a3ac089d..e8c9976d 100644 --- a/package/gluon-config-mode-geo-location/files/lib/gluon/config-mode/wizard/0400-geo-location.lua +++ b/package/gluon-config-mode-geo-location/files/lib/gluon/config-mode/wizard/0400-geo-location.lua @@ -45,10 +45,10 @@ function M.handle(data) uci:set("gluon-node-info", sname, "share_location", data._location) if data._location and data._latitude ~= nil and data._longitude ~= nil then - uci:set("gluon-node-info", sname, "latitude", data._latitude) - uci:set("gluon-node-info", sname, "longitude", data._longitude) + uci:set("gluon-node-info", sname, "latitude", data._latitude:trim()) + uci:set("gluon-node-info", sname, "longitude", data._longitude:trim()) if data._altitude ~= nil then - uci:set("gluon-node-info", sname, "altitude", data._altitude) + uci:set("gluon-node-info", sname, "altitude", data._altitude:trim()) else uci:delete("gluon-node-info", sname, "altitude") end diff --git a/package/gluon-config-mode-mesh-vpn/files/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua b/package/gluon-config-mode-mesh-vpn/files/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua index 9e2f4008..104e2437 100644 --- a/package/gluon-config-mode-mesh-vpn/files/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua +++ b/package/gluon-config-mode-mesh-vpn/files/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua @@ -28,13 +28,13 @@ function M.section(form) o:depends("_limit_enabled", "1") o.value = uci:get("simple-tc", "mesh_vpn", "limit_ingress") o.rmempty = false - o.datatype = "integer" + o.datatype = "uinteger" o = s:option(cbi.Value, "_limit_egress", i18n.translate("Upstream (kbit/s)")) o:depends("_limit_enabled", "1") o.value = uci:get("simple-tc", "mesh_vpn", "limit_egress") o.rmempty = false - o.datatype = "integer" + o.datatype = "uinteger" end function M.handle(data) @@ -49,11 +49,11 @@ function M.handle(data) uci:set("simple-tc", "mesh_vpn", "ifname", "mesh-vpn") if data._limit_ingress ~= nil then - uci:set("simple-tc", "mesh_vpn", "limit_ingress", data._limit_ingress) + uci:set("simple-tc", "mesh_vpn", "limit_ingress", data._limit_ingress:trim()) end if data._limit_egress ~= nil then - uci:set("simple-tc", "mesh_vpn", "limit_egress", data._limit_egress) + uci:set("simple-tc", "mesh_vpn", "limit_egress", data._limit_egress:trim()) end uci:commit("simple-tc") diff --git a/package/gluon-luci-portconfig/files/usr/lib/lua/luci/model/cbi/admin/portconfig.lua b/package/gluon-luci-portconfig/files/usr/lib/lua/luci/model/cbi/admin/portconfig.lua index c9b57d4b..994f3077 100644 --- a/package/gluon-luci-portconfig/files/usr/lib/lua/luci/model/cbi/admin/portconfig.lua +++ b/package/gluon-luci-portconfig/files/usr/lib/lua/luci/model/cbi/admin/portconfig.lua @@ -99,9 +99,9 @@ function f.handle(self, state, data) if state == FORM_VALID then uci:set("network", "wan", "proto", data.ipv4) if data.ipv4 == "static" then - uci:set("network", "wan", "ipaddr", data.ipv4_addr) - uci:set("network", "wan", "netmask", data.ipv4_netmask) - uci:set("network", "wan", "gateway", data.ipv4_gateway) + uci:set("network", "wan", "ipaddr", data.ipv4_addr:trim()) + uci:set("network", "wan", "netmask", data.ipv4_netmask:trim()) + uci:set("network", "wan", "gateway", data.ipv4_gateway:trim()) else uci:delete("network", "wan", "ipaddr") uci:delete("network", "wan", "netmask") @@ -110,8 +110,8 @@ function f.handle(self, state, data) uci:set("network", "wan6", "proto", data.ipv6) if data.ipv6 == "static" then - uci:set("network", "wan6", "ip6addr", data.ipv6_addr) - uci:set("network", "wan6", "ip6gw", data.ipv6_gateway) + uci:set("network", "wan6", "ip6addr", data.ipv6_addr:trim()) + uci:set("network", "wan6", "ip6gw", data.ipv6_gateway:trim()) else uci:delete("network", "wan6", "ip6addr") uci:delete("network", "wan6", "ip6gw") From 79bc3a8d4b07f3ac3807d732edf14889174e63dd Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 29 Feb 2016 01:12:20 +0100 Subject: [PATCH 319/867] gluon-status-page: fix neighbour purging notUpdated is a Set, to a for-in loop doesn't work. Fixes #657 --- package/gluon-status-page/src/js/lib/gui/neighbours.js | 4 ++-- 1 file changed, 2 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 396c56fe..ff782506 100644 --- a/package/gluon-status-page/src/js/lib/gui/neighbours.js +++ b/package/gluon-status-page/src/js/lib/gui/neighbours.js @@ -198,11 +198,11 @@ function (Helper, SignalGraph, Signal) { notUpdated.delete(id) } - for (id in notUpdated) { + notUpdated.forEach(function (id) { managedNeighbours[id].views.forEach( function (d) { d.destroy() }) colors.push(managedNeighbours[id].color) delete managedNeighbours[id] - } + }) } From 19a7380e7496d3749997c16958a2a949d6517d7d Mon Sep 17 00:00:00 2001 From: Matthias Ludwig Date: Mon, 29 Feb 2016 11:23:01 +0100 Subject: [PATCH 320/867] ar71xx-generic: add support for TP-Link MR13U --- 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 7dd6bc5e..394722e8 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -117,6 +117,10 @@ $(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)) $(eval $(call GluonModel,TLWA901,tl-wa901nd-v3,tp-link-tl-wa901n-nd-v3)) +# TL-MR13U v1 +$(eval $(call GluonProfile,TLMR13U)) +$(eval $(call GluonModel,TLMR13U,tl-mr13u-v1,tp-link-tl-mr13u-v1)) + # TL-MR3020 v1 $(eval $(call GluonProfile,TLMR3020)) $(eval $(call GluonModel,TLMR3020,tl-mr3020-v1,tp-link-tl-mr3020-v1)) From 6e452f207a747adf64de2f1fa7250a6a7a663a30 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 24 Feb 2016 22:20:18 +0100 Subject: [PATCH 321/867] gluon-status-page: don't use internationalization API It is not supported by all browsers yet. Also change load display always to display 2 decimal digits (as it is read from the kernel with 2 decimal digits). Fixes #606 --- .../src/js/lib/gui/statistics.js | 8 +++---- .../gluon-status-page/src/js/lib/helper.js | 21 +++++++++++++++++++ 2 files changed, 25 insertions(+), 4 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 7f09323c..3dcf5a52 100644 --- a/package/gluon-status-page/src/js/lib/gui/statistics.js +++ b/package/gluon-status-page/src/js/lib/gui/statistics.js @@ -171,7 +171,7 @@ define(["lib/helper"], function (Helper) { } function prettyPackets(d) { - var v = new Intl.NumberFormat("de-DE", {maximumFractionDigits: 0}).format(d) + var v = Helper.formatNumberFixed(d, 0) return v + " Pakete/s" } @@ -183,7 +183,7 @@ define(["lib/helper"], function (Helper) { prefix++ } - d = new Intl.NumberFormat("de-DE", {maximumSignificantDigits: 3}).format(d) + d = Helper.formatNumber(d, 3) return d + " " + prefixes[prefix] } @@ -220,11 +220,11 @@ define(["lib/helper"], function (Helper) { } function prettyNVRAM(usage) { - return new Intl.NumberFormat("de-DE", {maximumSignificantDigits: 3}).format(usage * 100) + "% belegt" + return Helper.formatNumber(usage * 100, 3) + "% belegt" } function prettyLoad(load) { - return new Intl.NumberFormat("de-DE", {maximumSignificantDigits: 3}).format(load) + return Helper.formatNumberFixed(load, 2) } function prettyRAM(memory) { diff --git a/package/gluon-status-page/src/js/lib/helper.js b/package/gluon-status-page/src/js/lib/helper.js index 6b39bc0a..c0c0ce2f 100644 --- a/package/gluon-status-page/src/js/lib/helper.js +++ b/package/gluon-status-page/src/js/lib/helper.js @@ -51,6 +51,25 @@ define([ "bacon" ], function (Bacon) { return dictGet(dict[k], key) } + function localizeNumber(d) { + var sep = ',' + return d.replace('.', sep) + } + + function formatNumberFixed(d, digits) { + return localizeNumber(d.toFixed(digits)) + } + + function formatNumber(d, digits) { + digits-- + + for (var v = d; v >= 10 && digits > 0; v /= 10) + digits-- + + // avoid toPrecision as it might produce strings in exponential notation + return formatNumberFixed(d, digits) + } + function haversine() { var radians = Array.prototype.map.call(arguments, function(deg) { return deg / 180.0 * Math.PI }) var lat1 = radians[0], lon1 = radians[1], lat2 = radians[2], lon2 = radians[3] @@ -66,6 +85,8 @@ define([ "bacon" ], function (Bacon) { , request: request , getJSON: getJSON , dictGet: dictGet + , formatNumber: formatNumber + , formatNumberFixed: formatNumberFixed , haversine: haversine } }) From 289b5992339420757859432593cf8b31827b9978 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 24 Feb 2016 22:32:22 +0100 Subject: [PATCH 322/867] gluon-status-page: unify prefix list of prettyBytes and prettyBits --- package/gluon-status-page/src/js/lib/gui/statistics.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 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 3dcf5a52..af984e6e 100644 --- a/package/gluon-status-page/src/js/lib/gui/statistics.js +++ b/package/gluon-status-page/src/js/lib/gui/statistics.js @@ -178,7 +178,7 @@ define(["lib/helper"], function (Helper) { function prettyPrefix(prefixes, step, d) { var prefix = 0 - while (d > step && prefix < 4) { + while (d > step && prefix < prefixes.length - 1) { d /= step prefix++ } @@ -187,12 +187,16 @@ define(["lib/helper"], function (Helper) { return d + " " + prefixes[prefix] } + function prettySize(d) { + return prettyPrefix([ "", "k", "M", "G", "T" ], 1024, d) + } + function prettyBits(d) { - return prettyPrefix([ "bps", "kbps", "Mbps", "Gbps" ], 1024, d * 8) + return prettySize(d * 8) + "bps" } function prettyBytes(d) { - return prettyPrefix([ "B", "kB", "MB", "GB", "TB" ], 1024, d) + return prettySize(d) + "B" } function prettyUptime(seconds) { From 6f23ef9eb7d4187bfe3978e839f6a609f578f1bf Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 1 Mar 2016 12:52:12 +0100 Subject: [PATCH 323/867] Update OpenWrt base We got most of our patches backported by upstream :) --- modules | 2 +- ...a-Technologies-firmware-for-QCA988X.patch} | 8 +- ...l-filename-part-than-the-output-file.patch | 68 - ...1-ath10k-allow-simultaneous-AP-IBSS.patch} | 0 ...-mac80211-backport-from-trunk-r48810.patch | 33113 ---------------- ...te-NanoStation-Loco-txpower-offsets.patch} | 0 ...apd-prevent-channel-switch-for-5GHz.patch} | 0 ...uner-support-for-UniFi-Outdoor-Plus.patch} | 0 ...d-support-for-tp-link-wr740n-v5.0-EU.patch | 39 - ...s-with-prohibited-blackholed-source.patch} | 0 ...ar71xx-add-support-for-TL-WR741ND-v5.patch | 35 - ...tallation-of-headers-for-host-build.patch} | 0 ...alloc-instead-of-oom-kill-processes.patch} | 0 ...013-sunxi-fix-uboot-install-location.patch | 131 - ...=> 0014-fix-UBNT-XM-model-detection.patch} | 0 ...xi-respect-CONFIG_TARGET_IMAGES_GZIP.patch | 21 - ...ourcefilter-to-disable-source-filter.patch | 62 - ...P-Link-TL-WR841N-ND-v9-Compex-WPJ531.patch | 57 - ...ar71xx-rework-patch-for-qca953x-956x.patch | 807 - ...pagate-the-real-postinst-return-code.patch | 44 - ...ditional-libopenssl-build-dependency.patch | 22 - ...ditional-libopenssl-build-dependency.patch | 22 - .../openwrt/0022-odhcp6c-minor-fixes.patch | 77 - ...base-files-add-etc-profile.d-support.patch | 40 - ...152-based-USB-to-Ethernet-converters.patch | 49 - ...tils-tplink-safeloader-clean-up-code.patch | 107 - ...t-format-clean-up-vendor-information.patch | 126 - ...on-1.1-support-to-CPE210-220-510-520.patch | 38 - ...-TL-WR941ND-v6-international-version.patch | 330 - ...d-support-for-TP-Link-TL-WR1043ND-v3.patch | 25 - ...ath10k-calibration-data-load-changes.patch | 197 - ...ix-AR71XX_MODEL-on-TP-Link-TL-WR703N.patch | 20 - ...L-Added-source-old-to-PKG_SOURCE_URL.patch | 24 - ...37-x86-generic-refresh-kernel-config.patch | 48 - ...86-generic-enable-pata_atiixp-driver.patch | 22 - ...bvious-bugs-causing-compile-warnings.patch | 64 - ...s-split-ubdev01-flash-layout-from-XM.patch | 39 - ...ix-firmware_max_length-for-XM-layout.patch | 45 - ...its-for-macronix-flash-chips-at-init.patch | 22 - ...-bugs-after-cleaning-the-kernel-tree.patch | 19 - ...el-gpio_keys-load-module-on-pre-init.patch | 21 - ...-lzma-loader-fix-O32-ABI-conformance.patch | 36 - 42 files changed, 5 insertions(+), 35775 deletions(-) rename patches/openwrt/{0008-ath10k-firmware-add-Candela-Technologies-firmware-for-QCA988X.patch => 0006-ath10k-firmware-add-Candela-Technologies-firmware-for-QCA988X.patch} (90%) delete mode 100644 patches/openwrt/0006-build-add-support-for-choosing-a-different-url-filename-part-than-the-output-file.patch rename patches/openwrt/{0009-mac80211-ath10k-allow-simultaneous-AP-IBSS.patch => 0007-mac80211-ath10k-allow-simultaneous-AP-IBSS.patch} (100%) delete mode 100644 patches/openwrt/0007-mac80211-backport-from-trunk-r48810.patch rename patches/openwrt/{0010-iwinfo-update-NanoStation-Loco-txpower-offsets.patch => 0008-iwinfo-update-NanoStation-Loco-txpower-offsets.patch} (100%) rename patches/openwrt/{0016-hostapd-prevent-channel-switch-for-5GHz.patch => 0009-hostapd-prevent-channel-switch-for-5GHz.patch} (100%) rename patches/openwrt/{0023-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch => 0010-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch} (100%) delete mode 100644 patches/openwrt/0011-ar71xx-add-support-for-tp-link-wr740n-v5.0-EU.patch rename patches/openwrt/{0029-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch => 0011-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch} (100%) delete mode 100644 patches/openwrt/0012-ar71xx-add-support-for-TL-WR741ND-v5.patch rename patches/openwrt/{0035-lua-fix-installation-of-headers-for-host-build.patch => 0012-lua-fix-installation-of-headers-for-host-build.patch} (100%) rename patches/openwrt/{0036-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch => 0013-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch} (100%) delete mode 100644 patches/openwrt/0013-sunxi-fix-uboot-install-location.patch rename patches/openwrt/{0039-fix-UBNT-XM-model-detection.patch => 0014-fix-UBNT-XM-model-detection.patch} (100%) delete mode 100644 patches/openwrt/0014-sunxi-respect-CONFIG_TARGET_IMAGES_GZIP.patch delete mode 100644 patches/openwrt/0015-odhcp6c-add-option-sourcefilter-to-disable-source-filter.patch delete mode 100644 patches/openwrt/0017-ar71xx-fix-ethernet-initialization-on-QCA953x-based-boards-TP-Link-TL-WR841N-ND-v9-Compex-WPJ531.patch delete mode 100644 patches/openwrt/0018-ar71xx-rework-patch-for-qca953x-956x.patch delete mode 100644 patches/openwrt/0019-base-files-default_postinst-propagate-the-real-postinst-return-code.patch delete mode 100644 patches/openwrt/0020-opkg-work-around-unconditional-libopenssl-build-dependency.patch delete mode 100644 patches/openwrt/0021-hostapd-work-around-unconditional-libopenssl-build-dependency.patch delete mode 100644 patches/openwrt/0022-odhcp6c-minor-fixes.patch delete mode 100644 patches/openwrt/0024-base-files-add-etc-profile.d-support.patch delete mode 100644 patches/openwrt/0025-Kernel-Realtek-8150-and-Realtek-8152-based-USB-to-Ethernet-converters.patch delete mode 100644 patches/openwrt/0026-tools-firmware-utils-tplink-safeloader-clean-up-code.patch delete mode 100644 patches/openwrt/0027-tools-firmware-utils-tplink-safeloader-fix-support-list-format-clean-up-vendor-information.patch delete mode 100644 patches/openwrt/0028-tools-firmware-utils-tplink-safeloader-add-version-1.1-support-to-CPE210-220-510-520.patch delete mode 100644 patches/openwrt/0030-ar71xx-add-support-for-TP-LINK-TL-WR941ND-v6-international-version.patch delete mode 100644 patches/openwrt/0031-ar71xx-add-support-for-TP-Link-TL-WR1043ND-v3.patch delete mode 100644 patches/openwrt/0032-ar71xx-backport-ath10k-calibration-data-load-changes.patch delete mode 100644 patches/openwrt/0033-ar71xx-fix-AR71XX_MODEL-on-TP-Link-TL-WR703N.patch delete mode 100644 patches/openwrt/0034-OpenSSL-Added-source-old-to-PKG_SOURCE_URL.patch delete mode 100644 patches/openwrt/0037-x86-generic-refresh-kernel-config.patch delete mode 100644 patches/openwrt/0038-x86-generic-enable-pata_atiixp-driver.patch delete mode 100644 patches/openwrt/0040-firmware-utils-mkfwimage-add-Wall-fix-obvious-bugs-causing-compile-warnings.patch delete mode 100644 patches/openwrt/0041-ar71xx-firmware-utils-split-ubdev01-flash-layout-from-XM.patch delete mode 100644 patches/openwrt/0042-firmware-utils-mkfwimage-fix-firmware_max_length-for-XM-layout.patch delete mode 100644 patches/openwrt/0043-kernel-disable-software-protection-bits-for-macronix-flash-chips-at-init.patch delete mode 100644 patches/openwrt/0044-brcm2708-gpu-fw-move-pkg-build-dir-to-kernel-build-dir-to-fix-rebuild-bugs-after-cleaning-the-kernel-tree.patch delete mode 100644 patches/openwrt/0045-kernel-gpio_keys-load-module-on-pre-init.patch delete mode 100644 patches/openwrt/0046-ar71xx-lzma-loader-fix-O32-ABI-conformance.patch diff --git a/modules b/modules index 471ff93d..418420e0 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=a03a846c49c067048cd225d476a7adf91ef8ff03 +OPENWRT_COMMIT=8882c524d9b5e4c16ebfea10c0090f38b07c9da5 PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git PACKAGES_OPENWRT_COMMIT=9622fe984bba3a4547f48bc507ebaba7637eb2b0 diff --git a/patches/openwrt/0008-ath10k-firmware-add-Candela-Technologies-firmware-for-QCA988X.patch b/patches/openwrt/0006-ath10k-firmware-add-Candela-Technologies-firmware-for-QCA988X.patch similarity index 90% rename from patches/openwrt/0008-ath10k-firmware-add-Candela-Technologies-firmware-for-QCA988X.patch rename to patches/openwrt/0006-ath10k-firmware-add-Candela-Technologies-firmware-for-QCA988X.patch index 5f6976fe..725d5995 100644 --- a/patches/openwrt/0008-ath10k-firmware-add-Candela-Technologies-firmware-for-QCA988X.patch +++ b/patches/openwrt/0006-ath10k-firmware-add-Candela-Technologies-firmware-for-QCA988X.patch @@ -3,10 +3,10 @@ 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 +index b03d644..7d4d449 100644 --- a/package/firmware/ath10k-firmware/Makefile +++ b/package/firmware/ath10k-firmware/Makefile -@@ -46,6 +46,26 @@ define Download/ath10k-firmware-qca988x +@@ -44,6 +44,26 @@ define Download/ath10k-firmware-qca988x endef $(eval $(call Download,ath10k-firmware-qca988x)) @@ -33,7 +33,7 @@ index 882294c..c6e6f2d 100644 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 +@@ -79,6 +99,16 @@ define Package/ath10k-firmware-qca988x/install $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-5.bin endef @@ -50,7 +50,7 @@ index 882294c..c6e6f2d 100644 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 +@@ -98,5 +128,6 @@ define Package/ath10k-firmware-qca99x0/install endef $(eval $(call BuildPackage,ath10k-firmware-qca988x)) 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 deleted file mode 100644 index 67564c80..00000000 --- a/patches/openwrt/0006-build-add-support-for-choosing-a-different-url-filename-part-than-the-output-file.patch +++ /dev/null @@ -1,68 +0,0 @@ -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/0009-mac80211-ath10k-allow-simultaneous-AP-IBSS.patch b/patches/openwrt/0007-mac80211-ath10k-allow-simultaneous-AP-IBSS.patch similarity index 100% rename from patches/openwrt/0009-mac80211-ath10k-allow-simultaneous-AP-IBSS.patch rename to patches/openwrt/0007-mac80211-ath10k-allow-simultaneous-AP-IBSS.patch diff --git a/patches/openwrt/0007-mac80211-backport-from-trunk-r48810.patch b/patches/openwrt/0007-mac80211-backport-from-trunk-r48810.patch deleted file mode 100644 index 39e628b4..00000000 --- a/patches/openwrt/0007-mac80211-backport-from-trunk-r48810.patch +++ /dev/null @@ -1,33113 +0,0 @@ -From: Matthias Schiffer -Date: Sun, 28 Feb 2016 03:14:24 +0100 -Subject: mac80211: backport from trunk r48810 - -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..752a8e0 ---- /dev/null -+++ b/package/firmware/linux-firmware/marvell.mk -@@ -0,0 +1,56 @@ -+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)) -+ -+Package/libertas-spi-firmware = $(call Package/firmware-default,Marvell 8686 SPI firmware) -+define Package/libertas-spi-firmware/install -+ $(INSTALL_DIR) $(1)/lib/firmware/libertas -+ $(INSTALL_DATA) \ -+ $(PKG_BUILD_DIR)/libertas/gspi8686_v9_helper.bin \ -+ $(PKG_BUILD_DIR)/libertas/gspi8686_v9.bin \ -+ $(1)/lib/firmware/libertas -+endef -+$(eval $(call BuildPackage,libertas-spi-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..525537c 100644 ---- a/package/kernel/mac80211/Makefile -+++ b/package/kernel/mac80211/Makefile -@@ -10,11 +10,11 @@ include $(INCLUDE_DIR)/kernel.mk - - PKG_NAME:=mac80211 - --PKG_VERSION:=2015-03-09 --PKG_RELEASE:=3 -+PKG_VERSION:=2016-01-10 -+PKG_RELEASE:=1 - PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources - PKG_BACKPORT_VERSION:= --PKG_MD5SUM:=6d4b04e4ce8a1f54dabfb04f4709453c -+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,29 @@ PKG_BUILD_PARALLEL:=1 - PKG_MAINTAINER:=Felix Fietkau - - PKG_DRIVERS = \ -- adm8211 ath5k libertas-usb libertas-sdio p54-common p54-pci p54-usb p54-spi \ -- rt2x00-lib rt2x00-pci rt2x00-usb rt2800-lib rt2400-pci rt2500-pci \ -- rt2500-usb rt61-pci rt73-usb rt2800-mmio rt2800-pci rt2800-usb rt2800-soc \ -- rtl8180 rtl8187 zd1211rw mac80211-hwsim carl9170 b43 b43legacy \ -- ath9k-common ath9k ath9k-htc ath10k ath net-libipw net-ipw2100 net-ipw2200 \ -- mwl8k mwifiex-pcie net-hermes net-hermes-pci net-hermes-plx net-hermes-pcmcia \ -- iwl-legacy iwl3945 iwl4965 iwlagn wlcore wl12xx wl18xx lib80211 \ -+ adm8211 \ -+ ath ath5k ath9k ath9k-common ath9k-htc ath10k \ -+ b43 b43legacy \ -+ carl9170 \ -+ hermes hermes-pci hermes-pcmcia hermes-plx\ -+ iwl-legacy iwl3945 iwl4965 iwlwifi \ -+ lib80211 \ -+ libipw ipw2100 ipw2200 \ -+ libertas-sdio libertas-usb libertas-spi \ -+ mac80211-hwsim \ -+ mt7601u \ -+ mwl8k mwifiex-pcie \ -+ p54-common p54-pci p54-spi p54-usb \ -+ rt2x00-lib rt2x00-pci rt2x00-usb \ -+ rt2400-pci rt2500-pci rt2500-usb \ -+ rt2800-lib rt2800-mmio rt2800-pci rt2800-soc rt2800-usb \ -+ rt61-pci rt73-usb \ -+ rtl8180 rtl8187 \ - 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 +74,6 @@ define KernelPackage/mac80211/Default - SUBMENU:=$(WMENU) - URL:=https://wireless.wiki.kernel.org/ - MAINTAINER:=Felix Fietkau -- DEPENDS:=@!TARGET_uml - endef - - define KernelPackage/cfg80211 -@@ -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_VERSION:=f404336ba808cbd57547196e13367079a23b822c --PKG_LINUX_FIRMWARE_SOURCE:=$(PKG_LINUX_FIRMWARE_NAME)-2015-03-20-$(PKG_LINUX_FIRMWARE_VERSION).tar.bz2 --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 --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 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)) -- --# 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 -+ bool "Force Atheros drivers to respect the user's regdomain settings" -+ 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. - --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. - -- config PACKAGE_RT2X00_LIB_DEBUGFS -- bool "Enable rt2x00 debugfs support" -- depends on PACKAGE_MAC80211_DEBUGFS -+ config PACKAGE_ATH_DEBUG -+ bool "Atheros wireless debugging" - 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. - -- config PACKAGE_RT2X00_DEBUG -- bool "Enable rt2x00 debug output" -+ config PACKAGE_ATH_DFS -+ bool "Enable DFS support" -+ default y - 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. - -- endif --endef -+ Select this option if you want to use such channels. - --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/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 -+ DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ar71xx||TARGET_ath25 +kmod-mac80211 -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath.ko -+ MENU:=1 - endef - --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/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 -+ URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath5k -+ DEPENDS+= @PCI_SUPPORT||@TARGET_ath25 +kmod-ath -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath5k/ath5k.ko -+ AUTOLOAD:=$(call AutoProbe,ath5k) - 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/ath5k/description -+ This module adds support for wireless adapters based on -+ Atheros 5xxx chipset. - 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/ath9k-common -+ $(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 -+ FILES:= \ -+ $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_common.ko \ -+ $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_hw.ko - 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/ath9k -+ $(call KernelPackage/mac80211/Default) -+ TITLE:=Atheros 802.11n PCI wireless cards support -+ URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k -+ DEPENDS+= @PCI_SUPPORT||TARGET_ar71xx +kmod-ath9k-common -+ FILES:= \ -+ $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k.ko -+ AUTOLOAD:=$(call AutoProbe,ath9k) - 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) -+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) -- DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb -- TITLE+= (RT73 USB) -- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt73usb.ko -- AUTOLOAD:=$(call AutoProbe,rt73usb) --endef -+define KernelPackage/ath9k/config - --define KernelPackage/rt2800-mmio --$(call KernelPackage/rt2x00/Default) -- TITLE += (RT28xx/RT3xxx MMIO) -- DEPENDS += +kmod-rt2800-lib +kmod-rt2x00-mmio -- 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) -- 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) - 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),) -+ PKG_B43_FWV4_NAME:=broadcom-wl -+ PKG_B43_FWV4_VERSION:=6.30.163.46 -+ PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).wl_apsta.o -+ PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2 -+ PKG_B43_FWV4_SOURCE_URL:=http://www.lwfinger.com/b43-firmware/ -+ PKG_B43_FWV4_MD5SUM:=6fe97e9368d25342a1ab943d3cf3496d -+else -+ifneq ($(CONFIG_B43_FW_5_10),) -+ PKG_B43_FWV4_NAME:=broadcom-wl -+ PKG_B43_FWV4_VERSION:=5.10.56.27.3 -+ PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/driver/wl_apsta/wl_prebuilt.o -+ PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)_mipsel.tar.bz2 -+ PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/ -+ PKG_B43_FWV4_MD5SUM:=3363e3a6b3d9d73c49dea870c7834eac -+else -+ifneq ($(CONFIG_B43_FW_4_178),) -+ PKG_B43_FWV4_NAME:=broadcom-wl -+ PKG_B43_FWV4_VERSION:=4.178.10.4 -+ PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/linux/wl_apsta.o -+ PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2 -+ PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/ -+ PKG_B43_FWV4_MD5SUM:=14477e8cbbb91b11896affac9b219fdb -+else -+ifneq ($(CONFIG_B43_FW_5_100_138),) -+ PKG_B43_FWV4_NAME:=broadcom-wl -+ PKG_B43_FWV4_VERSION:=5.100.138 -+ PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/linux/wl_apsta.o -+ PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2 -+ PKG_B43_FWV4_SOURCE_URL:=http://www.lwfinger.com/b43-firmware/ -+ PKG_B43_FWV4_MD5SUM:=f4e357b09eaf5d8b1f1920cf3493a555 -+else -+ PKG_B43_FWV4_NAME:=broadcom-wl -+ PKG_B43_FWV4_VERSION:=4.150.10.5 -+ PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/driver/wl_apsta_mimo.o -+ PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2 -+ PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/ -+ PKG_B43_FWV4_MD5SUM:=0c6ba9687114c6b598e8019e262d9a60 -+endif -+endif -+endif -+endif -+ifneq ($(CONFIG_B43_OPENFIRMWARE),) -+ PKG_B43_FWV4_NAME:=broadcom-wl -+ PKG_B43_FWV4_VERSION:=5.2 -+ PKG_B43_FWV4_OBJECT:=openfwwf-$(PKG_B43_FWV4_VERSION) -+ PKG_B43_FWV4_SOURCE:=openfwwf-$(PKG_B43_FWV4_VERSION).tar.gz -+ PKG_B43_FWV4_SOURCE_URL:=http://www.ing.unibs.it/openfwwf/firmware/ -+ PKG_B43_FWV4_MD5SUM:=e045a135453274e439ae183f8498b0fa -+endif - --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) -+ MD5SUM:=$(PKG_B43_FWV4_MD5SUM) - endef -+$(eval $(call Download,b43)) - --define KernelPackage/rtlwifi -+define KernelPackage/b43 - $(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:=Broadcom 43xx wireless support -+ URL:=https://wireless.wiki.kernel.org/en/users/drivers/b43 -+ KCONFIG:= \ -+ CONFIG_HW_RANDOM=y -+ # Depend on PCI_SUPPORT to make sure we can select kmod-bcma or kmod-ssb -+ DEPENDS += \ -+ @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/broadcom/b43/b43.ko -+ AUTOLOAD:=$(call AutoProbe,b43) -+ MENU:=1 - endef - --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 --endef -+define KernelPackage/b43/config - --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 --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/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 --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 - --define KernelPackage/rtl8192ce -- $(call KernelPackage/mac80211/Default) -- 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) --endef -+ if PACKAGE_kmod-b43 - --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 --endef -+ 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/rtl8192se -- $(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) --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/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 this. - --define KernelPackage/rtl8192de -- $(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) --endef -+ config B43_FW_4_178 -+ bool "Firmware 478.104 from driver 4.178.10.4" -+ help -+ 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 -+ If unsure, select the "stable" firmware. - --define KernelPackage/rtl8192cu -- $(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) --endef -+ 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 -- $(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 -+ If unsure, select the "stable" firmware. - --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)) -+ 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) -- 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) --endef -+ This firmware currently gets most of the testing and is needed for some N-PHY devices. - --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 -+ 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 -+ bool "Remove unnecessary firmware files" -+ depends on !B43_OPENFIRMWARE -+ default y -+ help -+ 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. -+ -+ If unsure, say Y. -+ -+ config B43_FW_SQUASH_COREREVS -+ string "Core revisions to include" -+ depends on B43_FW_SQUASH -+ default "5,6,7,8,9,10,11,13,15" if TARGET_brcm47xx_legacy -+ default "16,28,29,30" if TARGET_brcm47xx_mips74k -+ 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. -+ -+ Example (keep files for rev5 only): -+ 5 -+ -+ Example (keep files for rev5 and rev11): -+ 5,11 -+ -+ config B43_FW_SQUASH_PHYTYPES -+ string "PHY types to include" -+ depends on B43_FW_SQUASH -+ default "G,N,LP" if TARGET_brcm47xx_legacy -+ default "N,HT" if TARGET_brcm47xx_mips74k -+ default "G,N,LP,HT" -+ help -+ This is a comma seperated list of PHY types: -+ A => A-PHY -+ AG => Dual A-PHY G-PHY -+ G => G-PHY -+ LP => LP-PHY -+ N => N-PHY -+ HT => HT-PHY -+ LCN => LCN-PHY -+ LCN40 => LCN40-PHY -+ AC => AC-PHY -+ -+ Example (keep files for G-PHY only): -+ G -+ -+ Example (keep files for G-PHY and N-PHY): -+ G,N -+ -+ choice -+ prompt "Supported buses" -+ default PACKAGE_B43_BUSES_BCMA_AND_SSB -+ help -+ This allows choosing buses that b43 should support. -+ -+ config PACKAGE_B43_BUSES_BCMA_AND_SSB -+ depends on !TARGET_brcm47xx_legacy && !TARGET_brcm47xx_mips74k && !TARGET_bcm53xx -+ bool "BCMA and SSB" -+ -+ config PACKAGE_B43_BUSES_BCMA -+ depends on !TARGET_brcm47xx_legacy -+ bool "BCMA only" -+ -+ config PACKAGE_B43_BUSES_SSB -+ depends on !TARGET_brcm47xx_mips74k && !TARGET_bcm53xx -+ bool "SSB only" -+ -+ endchoice -+ -+ config PACKAGE_B43_DEBUG -+ bool "Enable debug output and debugfs for b43" -+ default n -+ help -+ Enable additional debug output and runtime sanity checks for b43 -+ and enables the debugfs interface. -+ -+ If unsure, say N. -+ -+ config PACKAGE_B43_PIO -+ bool "Enable support for PIO transfer mode" -+ default n -+ help -+ Enable support for using PIO instead of DMA. Unless you have DMA -+ transfer problems you don't need this. - -- Select this option if you want the driver to respect the user's decision about -- regulatory settings. -+ If unsure, say N. - -- config PACKAGE_ATH_DEBUG -- bool "Atheros wireless debugging" -+ 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 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_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 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. - -- endif --endef -+ If unsure, say Y. - --define KernelPackage/ath -- $(call KernelPackage/mac80211/Default) -- TITLE:=Atheros common driver part -- DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ar71xx||TARGET_ath25 +kmod-mac80211 -- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath.ko -- MENU:=1 --endef -+ config PACKAGE_B43_PHY_LP -+ bool "Enable support for LP-PHYs" -+ default n if TARGET_brcm47xx_mips74k -+ default y -+ help -+ 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 Y. - --define KernelPackage/ath5k -- $(call KernelPackage/mac80211/Default) -- TITLE:=Atheros 5xxx wireless cards support -- URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath5k -- DEPENDS+= @PCI_SUPPORT||@TARGET_ath25 +kmod-ath -- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath5k/ath5k.ko -- AUTOLOAD:=$(call AutoProbe,ath5k) --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. --endef -+ Currently only 11g speed is available. - --define KernelPackage/ath9k-common -- $(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 --endef -+ If unsure, say Y. - --define KernelPackage/ath9k -- $(call KernelPackage/mac80211/Default) -- TITLE:=Atheros 802.11n PCI wireless cards support -- URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k -- DEPENDS+= @PCI_SUPPORT||TARGET_ar71xx +kmod-ath9k-common -- FILES:= \ -- $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k.ko -- AUTOLOAD:=$(call AutoProbe,ath9k) --endef -+ 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 -+ If unsure, say N. - --define KernelPackage/ath9k/config -+ endif -+endef - -- config ATH9K_SUPPORT_PCOEM -- bool "Support chips used in PC OEM cards" -- depends on PACKAGE_kmod-ath9k -- -+define KernelPackage/b43/description -+Kernel module for Broadcom 43xx wireless support (mac80211 stack) new - endef - --define KernelPackage/ath9k-htc -+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) -+ 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 --This module adds support for wireless adapters based on --Atheros USB AR9271 and AR7010 family of chipsets. -+define KernelPackage/b43legacy/description -+Kernel module for Broadcom 43xx-legacy wireless support (mac80211 stack) new - endef - --define KernelPackage/ath10k -+ -+define KernelPackage/brcmutil - $(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 -- 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) -+ 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/broadcom/brcm80211/brcmutil/brcmutil.ko -+ AUTOLOAD:=$(call AutoProbe,brcmutil) -+ MENU:=1 - endef - --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. -+define KernelPackage/brcmutil/description -+ This module contains some common parts needed by Broadcom Wireless drivers brcmsmac and brcmfmac. - endef - --define KernelPackage/ath10k/config -- if PACKAGE_kmod-ath10k -- -- config ATH10K_STA_FW -- bool "Firmware optimized for STA operation" -- default n -- help -- Use the ath10k firmware optimized for wireless client instead -- of access point operation. -+define KernelPackage/brcmutil/config -+ if PACKAGE_kmod-brcmutil - -- config ATH10K_API2_FW -- bool "Firmware optimized for AP operation (v10.1 / API v2)" -- default n -- depends on !ATH10K_STA_FW -+ config PACKAGE_BRCM80211_DEBUG -+ bool "Broadcom wireless driver debugging" - help -- Use the ath10k firmware from the 10.1 SDK using API v2 optimized -- for access point operation if the default firmware keeps crashing. -+ Say Y, if you want to debug brcmsmac and brcmfmac wireless driver. - - endif - endef - --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 -- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/carl9170/carl9170.ko -- AUTOLOAD:=$(call AutoProbe,carl9170) -+PKG_BRCMSMAC_FW_NAME:=broadcom-wl -+PKG_BRCMSMAC_FW_VERSION:=5.100.138 -+PKG_BRCMSMAC_FW_OBJECT:=$(PKG_BRCMSMAC_FW_NAME)-$(PKG_BRCMSMAC_FW_VERSION)/linux/wl_apsta.o -+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 Download/brcmsmac -+ FILE:=$(PKG_BRCMSMAC_FW_SOURCE) -+ URL:=$(PKG_BRCMSMAC_FW_SOURCE_URL) -+ MD5SUM:=$(PKG_BRCMSMAC_FW_MD5SUM) - endef -+$(eval $(call Download,brcmsmac)) - --define KernelPackage/lib80211 -+define KernelPackage/brcmsmac - $(call KernelPackage/mac80211/Default) -- TITLE:=802.11 Networking stack -- DEPENDS:=+kmod-cfg80211 -- FILES:= \ -- $(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 \ -- $(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_tkip.ko -- AUTOLOAD:=$(call AutoProbe, \ -- lib80211 \ -- lib80211_crypt_wep \ -- lib80211_crypt_ccmp \ -- lib80211_crypt_tkip \ -- ) -+ 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 +!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 - --define KernelPackage/lib80211/description -- Kernel modules for 802.11 Networking stack -- Includes: -- - lib80211 -- - lib80211_crypt_wep -- - lib80211_crypt_tkip -- - lib80211_crytp_ccmp -+define KernelPackage/brcmsmac/description -+ Kernel module for Broadcom IEEE802.11n PCIe Wireless cards - endef - --define KernelPackage/libertas-usb -- $(call KernelPackage/mac80211/Default) -- DEPENDS+= @USB_SUPPORT +kmod-cfg80211 +kmod-usb-core +kmod-lib80211 +@DRIVER_WEXT_SUPPORT -- TITLE:=Marvell 88W8015 Wireless Driver -- FILES:= \ -- $(PKG_BUILD_DIR)/drivers/net/wireless/libertas/libertas.ko \ -- $(PKG_BUILD_DIR)/drivers/net/wireless/libertas/usb8xxx.ko -- AUTOLOAD:=$(call AutoProbe,libertas usb8xxx) --endef -+define KernelPackage/brcmsmac/config -+ if PACKAGE_kmod-brcmsmac - --define KernelPackage/libertas-sdio -- $(call KernelPackage/mac80211/Default) -- DEPENDS+= +kmod-cfg80211 +kmod-lib80211 +kmod-mmc +@DRIVER_WEXT_SUPPORT @!TARGET_uml -- 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 -- AUTOLOAD:=$(call AutoProbe,libertas libertas_sdio) --endef -+ config BRCMSMAC_USE_FW_FROM_WL -+ bool "Use firmware extracted from broadcom proprietary driver" -+ default y -+ help -+ Instead of using the official brcmsmac firmware a firmware -+ 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/mac80211-hwsim -- $(call KernelPackage/mac80211/Default) -- TITLE:=mac80211 HW simulation device -- DEPENDS+= +kmod-mac80211 +@DRIVER_11N_SUPPORT -- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mac80211_hwsim.ko -- AUTOLOAD:=$(call AutoProbe,mac80211_hwsim) -+ If unsure, say Y. -+ -+ endif - endef - --define KernelPackage/net-libipw -+ -+define KernelPackage/brcmfmac - $(call KernelPackage/mac80211/Default) -- TITLE:=libipw for ipw2100 and ipw2200 -- DEPENDS:=@PCI_SUPPORT +kmod-crypto-core +kmod-crypto-arc4 +kmod-crypto-aes +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) -+ 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_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 - --define KernelPackage/net-libipw/description -- Hardware independent IEEE 802.11 networking stack for ipw2100 and ipw2200. -+define KernelPackage/brcmfmac/description -+ Kernel module for Broadcom IEEE802.11n USB Wireless cards - endef - --IPW2100_NAME:=ipw2100-fw --IPW2100_VERSION:=1.3 -- --define Download/net-ipw2100 -- URL:=http://bughost.org/firmware/ -- FILE:=$(IPW2100_NAME)-$(IPW2100_VERSION).tgz -- MD5SUM=46aa75bcda1a00efa841f9707bbbd113 --endef --$(eval $(call Download,net-ipw2100)) -+define KernelPackage/brcmfmac/config -+ if PACKAGE_kmod-brcmfmac - --define KernelPackage/net-ipw2100 -- $(call KernelPackage/mac80211/Default) -- TITLE:=Intel IPW2100 driver -- DEPENDS:=@PCI_SUPPORT +kmod-net-libipw -- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ipw2x00/ipw2100.ko -- AUTOLOAD:=$(call AutoProbe,ipw2100) --endef -+ config BRCMFMAC_SDIO -+ bool "Enable SDIO bus interface support" -+ default n -+ help -+ Enable support for cards attached to an SDIO bus. -+ Select this option only if you are sure that your -+ board has a Broadcom wireless chip atacched to -+ that bus. - --define KernelPackage/net-ipw2100/description -- Kernel support for Intel IPW2100 -- Includes: -- - ipw2100 --endef -+ config BRCMFMAC_USB -+ bool "Enable USB bus interface support" -+ depends on USB_SUPPORT -+ default y -+ help -+ Supported USB connected chipsets: -+ BCM43235, BCM43236, BCM43238 (all in revision 3 only) -+ BCM43143, BCM43242, BCM43566, BCM43569 - --IPW2200_NAME:=ipw2200-fw --IPW2200_VERSION:=3.1 -+ config BRCMFMAC_PCIE -+ bool "Enable PCIE bus interface support" -+ depends on PCI_SUPPORT -+ default y -+ help -+ Supported PCIe connected chipsets: -+ BCM4354, BCM4356, BCM43567, BCM43570, BCM43602 - --define Download/net-ipw2200 -- URL:=http://bughost.org/firmware/ -- FILE:=$(IPW2200_NAME)-$(IPW2200_VERSION).tgz -- MD5SUM=eaba788643c7cc7483dd67ace70f6e99 -+ endif - endef --$(eval $(call Download,net-ipw2200)) - --define KernelPackage/net-ipw2200 -- $(call KernelPackage/mac80211/Default) -- TITLE:=Intel IPW2200 driver -- DEPENDS:=@PCI_SUPPORT +kmod-net-libipw -- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ipw2x00/ipw2200.ko -- AUTOLOAD:=$(call AutoProbe,ipw2200) --endef - --define KernelPackage/net-ipw2200/description -- Kernel support for Intel IPW2200 -- Includes: -- - ipw2200 -+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 +carl9170-firmware -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/carl9170/carl9170.ko -+ AUTOLOAD:=$(call AutoProbe,carl9170) - endef - - --define KernelPackage/net-hermes -+define KernelPackage/hermes - $(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/intersil/orinoco/orinoco.ko - AUTOLOAD:=$(call AutoProbe,orinoco) - endef - --define KernelPackage/net-hermes/description -+define KernelPackage/hermes/description - Kernel support for Hermes 802.11b chipsets - endef - --define KernelPackage/net-hermes-pci -+define KernelPackage/hermes-pci - $(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/intersil/orinoco/orinoco_pci.ko - AUTOLOAD:=$(call AutoProbe,orinoco_pci) - endef - --define KernelPackage/net-hermes-pci/description -+define KernelPackage/hermes-pci/description - Kernel modules for Intersil Prism 2.5 PCI support - endef - --define KernelPackage/net-hermes-plx -+define KernelPackage/hermes-plx - $(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/intersil/orinoco/orinoco_plx.ko - AUTOLOAD:=$(call AutoProbe,orinoco_plx) - endef - --define KernelPackage/net-hermes-plx/description -+define KernelPackage/hermes-plx/description - Kernel modules for Hermes in PLX9052 based PCI adaptors - endef - --define KernelPackage/net-hermes-pcmcia -+define KernelPackage/hermes-pcmcia - $(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/intersil/orinoco/orinoco_cs.ko - AUTOLOAD:=$(call AutoProbe,orinoco_cs) - endef - --define KernelPackage/net-hermes-pcmcia/description -+define KernelPackage/hermes-pcmcia/description - Kernel modules for Hermes based PCMCIA adaptors - endef - --define KernelPackage/iwlagn -+ -+define KernelPackage/iwlwifi - $(call KernelPackage/mac80211/Default) -- 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/dvm/iwldvm.ko -- AUTOLOAD:=$(call AutoProbe,iwlwifi iwldvm) -+ $(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 - --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 -+ Intel 6000 Series Wi-Fi Adapters (6200AGN and 6300AGN) -+ Intel WiFi Link 1000BGN -+ Intel Wireless WiFi 5150AGN -+ Intel Wireless WiFi 5100AGN, 5300AGN, and 5350AGN -+ Intel 6005 Series Wi-Fi Adapters -+ Intel 6030 Series Wi-Fi Adapters -+ Intel Wireless WiFi Link 6150BGN 2 Adapter -+ Intel 100 Series Wi-Fi Adapters (100BGN and 130BGN) -+ Intel 2000 Series Wi-Fi Adapters -+ Intel 7260 Wi-Fi Adapter -+ Intel 3160 Wi-Fi Adapter -+ Intel 7265 Wi-Fi Adapter -+ Intel 8260 Wi-Fi Adapter -+ Intel 3165 Wi-Fi Adapter -+endef -+ -+define KernelPackage/iwlwifi/config -+ if PACKAGE_kmod-iwlwifi -+ -+ config PACKAGE_IWLWIFI_DEBUG -+ bool "Enable full debugging output in the iwlwifi driver" -+ default n - help -- Download and install firmware for: -- Intel Centrino Advanced-N 6205 -+ This option will enable debug tracing output for the iwlwifi drivers - -- 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 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/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 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 IWL3160_FW -- bool "Intel 3160 Firmware" -- default y -- help -- Download and install firmware for: -- Intel Wireless 3160 - endif - 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 -+ DEPENDS:= +kmod-mac80211 +kmod-iwl-legacy +iwl3945-firmware - TITLE:=Intel iwl3945 Wireless support -- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/iwlegacy/iwl3945.ko -+ 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 -+ 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 -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intel/iwlegacy/iwl4965.ko - AUTOLOAD:=$(call AutoProbe,iwl4965) - endef - -@@ -975,557 +867,576 @@ define KernelPackage/iwl4965/description - endef - - --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 -- --define KernelPackage/mwl8k/description -- Kernel modules for Marvell TOPDOG 802.11 Wireless cards --endef -- -- --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 -- --define KernelPackage/mwifiex-pcie/description -- Kernel modules for Marvell 802.11n/802.11ac PCIe Wireless cards --endef -- -- --define KernelPackage/wlcore -+define KernelPackage/lib80211 - $(call KernelPackage/mac80211/Default) -- TITLE:=TI common driver part -- DEPENDS+= @TARGET_omap +kmod-mac80211 +@DRIVER_11N_SUPPORT -+ 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) --endef -- --define KernelPackage/wlcore/description -- This module contains some common parts needed by TI Wireless drivers. --endef -- --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/wl12xx/description -- Kernel modules for TI WL12xx --endef -- --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 -- --define KernelPackage/wl18xx/description -- Kernel modules for TI WL18xx --endef -- -- --#Broadcom firmware --ifneq ($(CONFIG_B43_FW_6_30),) -- PKG_B43_FWV4_NAME:=broadcom-wl -- PKG_B43_FWV4_VERSION:=6.30.163.46 -- PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).wl_apsta.o -- PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2 -- PKG_B43_FWV4_SOURCE_URL:=http://www.lwfinger.com/b43-firmware/ -- PKG_B43_FWV4_MD5SUM:=6fe97e9368d25342a1ab943d3cf3496d --else --ifneq ($(CONFIG_B43_FW_5_10),) -- PKG_B43_FWV4_NAME:=broadcom-wl -- PKG_B43_FWV4_VERSION:=5.10.56.27.3 -- PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/driver/wl_apsta/wl_prebuilt.o -- PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)_mipsel.tar.bz2 -- PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/ -- PKG_B43_FWV4_MD5SUM:=3363e3a6b3d9d73c49dea870c7834eac --else --ifneq ($(CONFIG_B43_FW_4_178),) -- PKG_B43_FWV4_NAME:=broadcom-wl -- PKG_B43_FWV4_VERSION:=4.178.10.4 -- PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/linux/wl_apsta.o -- PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2 -- PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/ -- PKG_B43_FWV4_MD5SUM:=14477e8cbbb91b11896affac9b219fdb --else --ifneq ($(CONFIG_B43_FW_5_100_138),) -- PKG_B43_FWV4_NAME:=broadcom-wl -- PKG_B43_FWV4_VERSION:=5.100.138 -- PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/linux/wl_apsta.o -- PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2 -- PKG_B43_FWV4_SOURCE_URL:=http://www.lwfinger.com/b43-firmware/ -- PKG_B43_FWV4_MD5SUM:=f4e357b09eaf5d8b1f1920cf3493a555 --else -- PKG_B43_FWV4_NAME:=broadcom-wl -- PKG_B43_FWV4_VERSION:=4.150.10.5 -- PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/driver/wl_apsta_mimo.o -- PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2 -- PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/ -- PKG_B43_FWV4_MD5SUM:=0c6ba9687114c6b598e8019e262d9a60 --endif --endif --endif --endif --ifneq ($(CONFIG_B43_OPENFIRMWARE),) -- PKG_B43_FWV4_NAME:=broadcom-wl -- PKG_B43_FWV4_VERSION:=5.2 -- PKG_B43_FWV4_OBJECT:=openfwwf-$(PKG_B43_FWV4_VERSION) -- PKG_B43_FWV4_SOURCE:=openfwwf-$(PKG_B43_FWV4_VERSION).tar.gz -- PKG_B43_FWV4_SOURCE_URL:=http://www.ing.unibs.it/openfwwf/firmware/ -- PKG_B43_FWV4_MD5SUM:=e045a135453274e439ae183f8498b0fa --endif -- -- --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 Download/b43 -- FILE:=$(PKG_B43_FWV4_SOURCE) -- URL:=$(PKG_B43_FWV4_SOURCE_URL) -- MD5SUM:=$(PKG_B43_FWV4_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 \ -+ $(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_tkip.ko -+ AUTOLOAD:=$(call AutoProbe, \ -+ lib80211 \ -+ lib80211_crypt_wep \ -+ lib80211_crypt_ccmp \ -+ 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) -- TITLE:=Broadcom 43xx wireless support -- URL:=https://wireless.wiki.kernel.org/en/users/drivers/b43 -- KCONFIG:= \ -- CONFIG_HW_RANDOM=y -- # Depend on PCI_SUPPORT to make sure we can select kmod-bcma or kmod-ssb -- DEPENDS += \ -- @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 -- AUTOLOAD:=$(call AutoProbe,b43) -- MENU:=1 --endef -- --define KernelPackage/b43/config -- --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 -- --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 -+ 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 - -- 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/description -+ Hardware independent IEEE 802.11 networking stack for ipw2100 and ipw2200. -+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. -+IPW2100_NAME:=ipw2100-fw -+IPW2100_VERSION:=1.3 - -- If unsure, select this. -+define Download/ipw2100 -+ URL:=http://bughost.org/firmware/ -+ FILE:=$(IPW2100_NAME)-$(IPW2100_VERSION).tgz -+ MD5SUM=46aa75bcda1a00efa841f9707bbbd113 -+endef -+$(eval $(call Download,ipw2100)) - -- config B43_FW_4_178 -- bool "Firmware 478.104 from driver 4.178.10.4" -- help -- Older firmware for BCM43xx devices. -+define KernelPackage/ipw2100 -+ $(call KernelPackage/mac80211/Default) -+ TITLE:=Intel IPW2100 driver -+ DEPENDS:=@PCI_SUPPORT +kmod-libipw -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intel/ipw2x00/ipw2100.ko -+ AUTOLOAD:=$(call AutoProbe,ipw2100) -+endef - -- If unsure, select the "stable" firmware. -+define KernelPackage/ipw2100/description -+ Kernel support for Intel IPW2100 -+ Includes: -+ - ipw2100 -+endef - -- config B43_FW_5_10 -- bool "Firmware 508.1084 from driver 5.10.56.27" -- help -- Older firmware for BCM43xx devices. -+IPW2200_NAME:=ipw2200-fw -+IPW2200_VERSION:=3.1 - -- If unsure, select the "stable" firmware. -+define Download/ipw2200 -+ URL:=http://bughost.org/firmware/ -+ FILE:=$(IPW2200_NAME)-$(IPW2200_VERSION).tgz -+ MD5SUM=eaba788643c7cc7483dd67ace70f6e99 -+endef -+$(eval $(call Download,ipw2200)) - -- 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/ipw2200 -+ $(call KernelPackage/mac80211/Default) -+ TITLE:=Intel IPW2200 driver -+ DEPENDS:=@PCI_SUPPORT +kmod-libipw -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intel/ipw2x00/ipw2200.ko -+ AUTOLOAD:=$(call AutoProbe,ipw2200) -+endef - -- This firmware currently gets most of the testing and is needed for some N-PHY devices. -+define KernelPackage/ipw2200/description -+ Kernel support for Intel IPW2200 -+ Includes: -+ - ipw2200 -+endef - -- If unsure, select the this firmware. - -- config B43_FW_6_30 -- bool "Firmware 784.2 from driver 6.30.163.46 (experimental)" -- help -- Newer experimental firmware for BCM43xx devices. -+define KernelPackage/libertas-usb -+ $(call KernelPackage/mac80211/Default) -+ 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/marvell/libertas/libertas.ko \ -+ $(PKG_BUILD_DIR)/drivers/net/wireless/marvell/libertas/usb8xxx.ko -+ AUTOLOAD:=$(call AutoProbe,libertas usb8xxx) -+endef - -- This firmware is mostly untested. -+define KernelPackage/libertas-sdio -+ $(call KernelPackage/mac80211/Default) -+ 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/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 "stable" firmware. -+define KernelPackage/libertas-spi -+ $(call KernelPackage/mac80211/Default) -+ SUBMENU:=Wireless Drivers -+ DEPENDS+= +kmod-cfg80211 +kmod-lib80211 +@DRIVER_WEXT_SUPPORT +libertas-spi-firmware -+ KCONFIG := \ -+ CONFIG_SPI=y \ -+ CONFIG_SPI_MASTER=y -+ TITLE:=Marvell 88W8686 SPI Wireless Driver -+ FILES:= \ -+ $(PKG_BUILD_DIR)/drivers/net/wireless/marvell/libertas/libertas.ko \ -+ $(PKG_BUILD_DIR)/drivers/net/wireless/marvell/libertas/libertas_spi.ko -+ AUTOLOAD:=$(call AutoProbe,libertas libertas_spi) -+endef - -- 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 -+ DEPENDS+= +kmod-mac80211 +@DRIVER_11N_SUPPORT -+ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mac80211_hwsim.ko -+ AUTOLOAD:=$(call AutoProbe,mac80211_hwsim) -+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. - -- 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 - -- config B43_FW_SQUASH -- bool "Remove unnecessary firmware files" -- depends on !B43_OPENFIRMWARE -- default y -- help -- 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/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" -- depends on B43_FW_SQUASH -- default "5,6,7,8,9,10,11,13,15" if TARGET_brcm47xx_legacy -- default "16,28,29,30" if TARGET_brcm47xx_mips74k -- 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. - -- Example (keep files for rev5 only): -- 5 -+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 - -- Example (keep files for rev5 and rev11): -- 5,11 -+define KernelPackage/mwifiex-pcie/description -+ Kernel modules for Marvell 802.11n/802.11ac PCIe Wireless cards -+endef - -- config B43_FW_SQUASH_PHYTYPES -- string "PHY types to include" -- depends on B43_FW_SQUASH -- default "G,N,LP" if TARGET_brcm47xx_legacy -- default "N,HT" if TARGET_brcm47xx_mips74k -- default "G,N,LP,HT" -- help -- This is a comma seperated list of PHY types: -- A => A-PHY -- AG => Dual A-PHY G-PHY -- G => G-PHY -- LP => LP-PHY -- N => N-PHY -- HT => HT-PHY -- 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 -+ MD5SUM:=42661f8ecbadd88012807493f596081d -+endef -+$(eval $(call Download,p54spi)) - -- 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 - -- 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 - -- 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/intersil/p54/p54common.ko -+endef - -- config PACKAGE_B43_DEBUG -- bool "Enable debug output and debugfs for b43" -- default n -- help -- Enable additional debug output and runtime sanity checks for b43 -- and enables the debugfs interface. -+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/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 -- 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. -+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 -- help -- Enable support for G-PHY. This includes support for the following devices: -- PCI: BCM4306, BCM4311, BCM4318 -- SoC: BCM5352E, BCM4712 -+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. -+define KernelPackage/rt2x00-lib/config -+ if PACKAGE_kmod-rt2x00-lib - -- config PACKAGE_B43_PHY_N -- bool "Enable support for N-PHYs" -- default y -+ 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 -+ 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. -+ config PACKAGE_RT2X00_DEBUG -+ bool "Enable rt2x00 debug output" -+ help -+ Enable debugging output for all rt2x00 modules - -- If unsure, say Y. -+ endif -+endef - -- config PACKAGE_B43_PHY_LP -- bool "Enable support for LP-PHYs" -- default n if TARGET_brcm47xx_mips74k -- default y -- help -- Enable support for LP-PHY. This includes support for the following devices: -- PCI: BCM4312 -- SoC: BCM5354 -+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/ralink/rt2x00/rt2x00mmio.ko -+endef - -- If unsure, say Y. -+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/ralink/rt2x00/rt2x00pci.ko -+ AUTOLOAD:=$(call AutoProbe,rt2x00pci) -+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/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/ralink/rt2x00/rt2x00usb.ko -+ AUTOLOAD:=$(call AutoProbe,rt2x00usb) -+endef - -- Currently only 11g speed is available. -+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/ralink/rt2x00/rt2800lib.ko -+endef - -- If unsure, say Y. -+define KernelPackage/rt2400-pci -+$(call KernelPackage/rt2x00/Default) -+ 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 -- bool "Enable support for LCN-PHYs" -- depends on BROKEN -- default n -- help -- Currently broken. -+define KernelPackage/rt2500-pci -+$(call KernelPackage/rt2x00/Default) -+ 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/rt2800-mmio -+$(call KernelPackage/rt2x00/Default) -+ 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/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 -- $(call KernelPackage/mac80211/Default) -- 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 -+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 -- 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. -+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" -- help -- This is a comma seperated list of core revision numbers. -+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 - -- Example (keep files for rev2 and rev4): -- 2,4 -+define KernelPackage/rtl818x/Default -+ $(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 -+endef - -- endif -+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/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/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/rtlwifi - $(call KernelPackage/mac80211/Default) -- 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 -- AUTOLOAD:=$(call AutoProbe,brcmutil) -- MENU:=1 -+ 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/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/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/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/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/rtl8192ce -+ $(call KernelPackage/mac80211/Default) -+ 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 --PKG_BRCMSMAC_FW_VERSION:=5.100.138 --PKG_BRCMSMAC_FW_OBJECT:=$(PKG_BRCMSMAC_FW_NAME)-$(PKG_BRCMSMAC_FW_VERSION)/linux/wl_apsta.o --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/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/rtl8192de -+ $(call KernelPackage/mac80211/Default) -+ 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 - $(call KernelPackage/mac80211/Default) -- 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 -- AUTOLOAD:=$(call AutoProbe,brcmsmac) -- MENU:=1 -+ 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/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/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" -- default y -- help -- Instead of using the official brcmsmac firmware a firmware -- version 666.2 extracted from the proprietary Broadcom driver -- is used. This is needed to get core rev 17 used in bcm4716 -- to work. -+ 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. -+ 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 -+ Please report your results! - endef - - --define KernelPackage/brcmfmac -+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) -+ 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 - --define KernelPackage/brcmfmac/description -- Kernel module for Broadcom IEEE802.11n USB Wireless cards -+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 -- help -- Enable support for cards attached to an SDIO bus. -- 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 -- default y -- help -- 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 -- default y -- help -- Supported PCIe connected chipsets: -- BCM4354, BCM4356, BCM43567, BCM43570, BCM43602 -+define KernelPackage/wl18xx/description -+ Kernel modules for TI WL18xx -+endef - -- endif -+ -+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) - - config-y:= \ -@@ -1538,6 +1449,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 +1479,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 +1537,8 @@ config-$(CONFIG_BRCMFMAC_PCIE) += BRCMFMAC_PCIE - config-$(CONFIG_PACKAGE_BRCM80211_DEBUG) += BRCMDBG - - config-$(call config_package,mac80211-hwsim) += MAC80211_HWSIM -+config-$(call config_package,mt7601u) += MT7601U -+config-y += WL_MEDIATEK - - config-$(call config_package,rt2x00-lib) += RT2X00 RT2X00_LIB - config-$(call config_package,rt2x00-pci) += RT2X00_LIB_PCI -@@ -1623,31 +1560,34 @@ config-$(call config_package,rt2800-pci) += RT2800PCI - config-y += RT2800PCI_RT33XX RT2800PCI_RT35XX RT2800PCI_RT53XX RT2800PCI_RT3290 - - config-$(call config_package,rt2800-usb) += RT2800USB --config-y += RT2800USB_RT33XX RT2800USB_RT35XX RT2800USB_RT3573 RT2800USB_RT53XX RT2800USB_RT55XX -+config-y += RT2800USB_RT33XX RT2800USB_RT35XX RT2800USB_RT3573 RT2800USB_RT53XX RT2800USB_RT55XX RT2800USB_UNKNOWN - - config-$(call config_package,iwl-legacy) += IWLEGACY - config-$(call config_package,iwl3945) += IWL3945 - config-$(call config_package,iwl4965) += IWL4965 --config-$(call config_package,iwlagn) += IWLWIFI IWLDVM -+config-$(call config_package,iwlwifi) += IWLWIFI IWLDVM IWLMVM -+config-$(CONFIG_PACKAGE_IWLWIFI_DEBUG)+= IWLWIFI_DEBUG -+config-$(CONFIG_PACKAGE_IWLWIFI_DEBUGFS)+= IWLWIFI_DEBUGFS - --config-$(call config_package,net-libipw) += LIBIPW --config-$(call config_package,net-ipw2100) += IPW2100 --config-$(call config_package,net-ipw2200) += IPW2200 -+config-$(call config_package,libipw) += LIBIPW -+config-$(call config_package,ipw2100) += IPW2100 -+config-$(call config_package,ipw2200) += IPW2200 - - config-$(call config_package,p54-common) += P54_COMMON - config-$(call config_package,p54-pci) += P54_PCI - config-$(call config_package,p54-usb) += P54_USB - config-$(call config_package,p54-spi) += P54_SPI - --config-$(call config_package,net-hermes) += HERMES --config-$(call config_package,net-hermes-pci) += PCI_HERMES --config-$(call config_package,net-hermes-plx) += PLX_HERMES --config-$(call config_package,net-hermes-pcmcia) += PCMCIA_HERMES -+config-$(call config_package,hermes) += HERMES -+config-$(call config_package,hermes-pci) += PCI_HERMES -+config-$(call config_package,hermes-plx) += PLX_HERMES -+config-$(call config_package,hermes-pcmcia) += PCMCIA_HERMES - config-y += HERMES_PRISM - - config-$(call config_package,adm8211) += ADM8211 - config-$(call config_package,libertas-sdio) += LIBERTAS LIBERTAS_SDIO - config-$(call config_package,libertas-usb) += LIBERTAS LIBERTAS_USB -+config-$(call config_package,libertas-spi) += LIBERTAS LIBERTAS_SPI - config-$(call config_package,mwl8k) += MWL8K - config-$(call config_package,mwifiex-pcie) += MWIFIEX MWIFIEX_PCIE - config-$(call config_package,rtl8180) += RTL8180 -@@ -1668,12 +1608,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 +1645,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_ATH10K_LINUX_FIRMWARE_SOURCE) - rm -rf \ - $(PKG_BUILD_DIR)/include/linux/ssb \ - $(PKG_BUILD_DIR)/include/linux/bcma \ -@@ -1715,7 +1656,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 +1695,6 @@ define Build/InstallDev - rm -f $(1)/usr/include/mac80211-backport/linux/module.h - 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/cfg80211/install -- $(INSTALL_DIR) $(1)/lib/wifi $(1)/lib/netifd/wireless -- $(INSTALL_DATA) ./files/lib/wifi/mac80211.sh $(1)/lib/wifi -- $(INSTALL_BIN) ./files/lib/netifd/wireless/mac80211.sh $(1)/lib/netifd/wireless --endef -- --define KernelPackage/p54-pci/install -- $(INSTALL_DIR) $(1)/lib/firmware -- $(INSTALL_DATA) $(DL_DIR)/$(P54PCIFW) $(1)/lib/firmware/isl3886pci --endef -- --define KernelPackage/p54-usb/install -- $(INSTALL_DIR) $(1)/lib/firmware -- $(INSTALL_DATA) $(DL_DIR)/$(P54USBFW) $(1)/lib/firmware/isl3887usb --endef -- --define KernelPackage/p54-spi/install -- $(INSTALL_DIR) $(1)/lib/firmware -- $(INSTALL_DATA) $(DL_DIR)/$(P54SPIFW) $(1)/lib/firmware/3826.arm --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/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/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-conf.bin \ -- $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl18xx-fw-3.bin \ -- $(1)/lib/firmware/ti-connectivity --endef -- --define KernelPackage/zd1211rw/install -- $(INSTALL_DIR) $(1)/lib/firmware/zd1211 -- $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(ZD1211FW_NAME)/zd1211* $(1)/lib/firmware/zd1211 --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/ath9k-htc/install -- $(INSTALL_DIR) $(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 -- --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/ --ifeq ($(CONFIG_ATH10K_STA_FW),y) -- $(INSTALL_DATA) \ -- $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/main/firmware-2.bin_999.999.0.636 \ -- $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin --else ifeq ($(CONFIG_ATH10K_API2_FW),y) -- $(INSTALL_DATA) \ -- $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.1/firmware-2.bin_10.1.467.2-1 \ -- $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin --else -- $(INSTALL_DATA) \ -- $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.2.4/firmware-4.bin_10.2.4.45 \ -- $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-4.bin --endif --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/net-ipw2100/install -- $(INSTALL_DIR) $(1)/lib/firmware -- $(INSTALL_DATA) $(PKG_BUILD_DIR)/ipw2100-$(IPW2100_VERSION)*.fw $(1)/lib/firmware --endef -- --define KernelPackage/net-ipw2200/install -- $(INSTALL_DIR) $(1)/lib/firmware -- $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(IPW2200_NAME)-$(IPW2200_VERSION)/ipw2200*.fw $(1)/lib/firmware --endef -- --define KernelPackage/iwlagn/install -- $(INSTALL_DIR) $(1)/lib/firmware --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_IWL1000_FW),) -- $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-1000-5.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_IWL6050_FW),) -- $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-6050-5.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_IWL7260_FW),) -- $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-7260-9.ucode $(1)/lib/firmware --endif --ifneq ($(CONFIG_IWL7265_FW),) -- $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-7265-9.ucode $(1)/lib/firmware --endif --ifneq ($(CONFIG_IWL100_FW),) -- $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-100-5.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_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_IWL3160_FW),) -- $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-3160-9.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/b43/install - rm -rf $(1)/lib/firmware/ -@@ -1990,51 +1718,85 @@ ifneq ($(CONFIG_B43_FW_SQUASH),) - endif - 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 -+ $(INSTALL_BIN) ./files/lib/netifd/wireless/mac80211.sh $(1)/lib/netifd/wireless -+endef -+ -+define KernelPackage/ipw2100/install -+ $(INSTALL_DIR) $(1)/lib/firmware -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/ipw2100-$(IPW2100_VERSION)*.fw $(1)/lib/firmware -+endef -+ -+define KernelPackage/ipw2200/install -+ $(INSTALL_DIR) $(1)/lib/firmware -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(IPW2200_NAME)-$(IPW2200_VERSION)/ipw2200*.fw $(1)/lib/firmware -+endef -+ -+define KernelPackage/p54-pci/install -+ $(INSTALL_DIR) $(1)/lib/firmware -+ $(INSTALL_DATA) $(DL_DIR)/$(P54PCIFW) $(1)/lib/firmware/isl3886pci -+endef -+ -+define KernelPackage/p54-usb/install -+ $(INSTALL_DIR) $(1)/lib/firmware -+ $(INSTALL_DATA) $(DL_DIR)/$(P54USBFW) $(1)/lib/firmware/isl3887usb -+endef -+ -+define KernelPackage/p54-spi/install -+ $(INSTALL_DIR) $(1)/lib/firmware -+ $(INSTALL_DATA) $(DL_DIR)/$(P54SPIFW) $(1)/lib/firmware/3826.arm - endef - -+define KernelPackage/zd1211rw/install -+ $(INSTALL_DIR) $(1)/lib/firmware/zd1211 -+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(ZD1211FW_NAME)/zd1211* $(1)/lib/firmware/zd1211 -+endef -+ -+ - $(eval $(call KernelPackage,adm8211)) -+$(eval $(call KernelPackage,ath)) -+$(eval $(call KernelPackage,ath10k)) - $(eval $(call KernelPackage,ath5k)) -+$(eval $(call KernelPackage,ath9k)) -+$(eval $(call KernelPackage,ath9k-common)) -+$(eval $(call KernelPackage,ath9k-htc)) -+$(eval $(call KernelPackage,b43)) -+$(eval $(call KernelPackage,b43legacy)) -+$(eval $(call KernelPackage,brcmsmac)) -+$(eval $(call KernelPackage,brcmfmac)) -+$(eval $(call KernelPackage,brcmutil)) -+$(eval $(call KernelPackage,carl9170)) -+$(eval $(call KernelPackage,cfg80211)) -+$(eval $(call KernelPackage,hermes)) -+$(eval $(call KernelPackage,hermes-pci)) -+$(eval $(call KernelPackage,hermes-plx)) -+$(eval $(call KernelPackage,hermes-pcmcia)) -+$(eval $(call KernelPackage,iwlwifi)) -+$(eval $(call KernelPackage,iwl-legacy)) -+$(eval $(call KernelPackage,iwl4965)) -+$(eval $(call KernelPackage,iwl3945)) - $(eval $(call KernelPackage,lib80211)) - $(eval $(call KernelPackage,libertas-usb)) - $(eval $(call KernelPackage,libertas-sdio)) --$(eval $(call KernelPackage,cfg80211)) -+$(eval $(call KernelPackage,libertas-spi)) -+$(eval $(call KernelPackage,libipw)) -+$(eval $(call KernelPackage,ipw2100)) -+$(eval $(call KernelPackage,ipw2200)) - $(eval $(call KernelPackage,mac80211)) -+$(eval $(call KernelPackage,mac80211-hwsim)) -+$(eval $(call KernelPackage,mt7601u)) -+$(eval $(call KernelPackage,mwl8k)) -+$(eval $(call KernelPackage,mwifiex-pcie)) - $(eval $(call KernelPackage,p54-common)) - $(eval $(call KernelPackage,p54-pci)) - $(eval $(call KernelPackage,p54-usb)) -@@ -2047,12 +1809,12 @@ $(eval $(call KernelPackage,rt2800-lib)) - $(eval $(call KernelPackage,rt2400-pci)) - $(eval $(call KernelPackage,rt2500-pci)) - $(eval $(call KernelPackage,rt2500-usb)) --$(eval $(call KernelPackage,rt61-pci)) --$(eval $(call KernelPackage,rt73-usb)) - $(eval $(call KernelPackage,rt2800-mmio)) - $(eval $(call KernelPackage,rt2800-soc)) - $(eval $(call KernelPackage,rt2800-pci)) - $(eval $(call KernelPackage,rt2800-usb)) -+$(eval $(call KernelPackage,rt61-pci)) -+$(eval $(call KernelPackage,rt73-usb)) - $(eval $(call KernelPackage,rtl8180)) - $(eval $(call KernelPackage,rtl8187)) - $(eval $(call KernelPackage,rtlwifi)) -@@ -2063,32 +1825,8 @@ $(eval $(call KernelPackage,rtl8192ce)) - $(eval $(call KernelPackage,rtl8192se)) - $(eval $(call KernelPackage,rtl8192de)) - $(eval $(call KernelPackage,rtl8192cu)) --$(eval $(call KernelPackage,zd1211rw)) --$(eval $(call KernelPackage,mac80211-hwsim)) --$(eval $(call KernelPackage,ath9k-common)) --$(eval $(call KernelPackage,ath9k)) --$(eval $(call KernelPackage,ath9k-htc)) --$(eval $(call KernelPackage,ath10k)) --$(eval $(call KernelPackage,ath)) --$(eval $(call KernelPackage,carl9170)) --$(eval $(call KernelPackage,b43)) --$(eval $(call KernelPackage,b43legacy)) --$(eval $(call KernelPackage,brcmutil)) --$(eval $(call KernelPackage,brcmsmac)) --$(eval $(call KernelPackage,brcmfmac)) --$(eval $(call KernelPackage,net-libipw)) --$(eval $(call KernelPackage,net-ipw2100)) --$(eval $(call KernelPackage,net-ipw2200)) --$(eval $(call KernelPackage,iwlagn)) --$(eval $(call KernelPackage,iwl-legacy)) --$(eval $(call KernelPackage,iwl4965)) --$(eval $(call KernelPackage,iwl3945)) --$(eval $(call KernelPackage,mwl8k)) --$(eval $(call KernelPackage,mwifiex-pcie)) --$(eval $(call KernelPackage,net-hermes)) --$(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..02c195e 100644 ---- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh -+++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh -@@ -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 -- ifconfig "$ifname" hw ether "$macaddr" -+ ip link set dev "$ifname" address "$macaddr" - fi - - json_select .. -@@ -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+" - ;; -+ 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 - -- ifconfig "$ifname" up || { -+ ip link set dev "$ifname" up || { - wireless_setup_vif_failed IFUP_ERROR - json_select .. - return -@@ -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 -- ifconfig "$wdev" down 2>/dev/null -+ ip link set dev "$wdev" down 2>/dev/null - iw dev "$wdev" del - done - } -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 - } - -@@ -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 -+++ b/package/kernel/mac80211/patches/001-fix_build.patch -@@ -27,7 +27,7 @@ - @set -e ; test -f .local-symbols || ( \ - echo "/--------------" ;\ - echo "| You shouldn't run make in the backports tree, but only in" ;\ --@@ -60,56 +62,60 @@ mrproper: -+@@ -60,57 +62,61 @@ mrproper: - echo "| (that isn't currently running.)" ;\ - echo "\\--" ;\ - false) -@@ -56,11 +56,12 @@ - - done \ - - ) > Kconfig.kernel ;\ - - kver=$$($(MAKE) --no-print-directory -C $(KLIB_BUILD) kernelversion | \ --- sed 's/^\(\(3\|2\.6\)\.[0-9]\+\).*/\1/;t;d') ;\ -+- sed 's/^\(\([3-4]\|2\.6\)\.[0-9]\+\).*/\1/;t;d') ;\ - - test "$$kver" != "" || echo "Kernel version parse failed!" ;\ - - test "$$kver" != "" ;\ - - kvers="$$(seq 14 39 | sed 's/^/2.6./')" ;\ --- kvers="$$kvers $$(seq 0 99 | sed 's/^/3./')" ;\ -+- kvers="$$kvers $$(seq 0 19 | sed 's/^/3./')" ;\ -+- kvers="$$kvers $$(seq 0 99 | sed 's/^/4./')" ;\ - - print=0 ;\ - - for v in $$kvers ; do \ - - if [ "$$print" = "1" ] ; then \ -@@ -111,11 +112,12 @@ - + - +Kconfig.versions: Kconfig.kernel - + @kver=$$($(MAKE) --no-print-directory -C $(KLIB_BUILD) kernelversion | \ --+ sed 's/^\(\(3\|2\.6\)\.[0-9]\+\).*/\1/;t;d') ;\ -++ sed 's/^\(\([3-4]\|2\.6\)\.[0-9]\+\).*/\1/;t;d') ;\ - + test "$$kver" != "" || echo "Kernel version parse failed!" ;\ - + test "$$kver" != "" ;\ - + kvers="$$(seq 14 39 | sed 's/^/2.6./')" ;\ --+ kvers="$$kvers $$(seq 0 99 | sed 's/^/3./')" ;\ -++ kvers="$$kvers $$(seq 0 19 | sed 's/^/3./')" ;\ -++ kvers="$$kvers $$(seq 0 99 | sed 's/^/4./')" ;\ - + 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 ---- a/package/kernel/mac80211/patches/004-backports_debugfs_fix.patch -+++ /dev/null -@@ -1,10 +0,0 @@ ----- a/backport-include/linux/debugfs.h --+++ b/backport-include/linux/debugfs.h --@@ -3,6 +3,7 @@ -- #include_next -- #include -- #include --+#include -- -- #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 ---- a/package/kernel/mac80211/patches/008-fix_netdev_unregister.patch -+++ /dev/null -@@ -1,16 +0,0 @@ ----- a/net/mac80211/iface.c --+++ b/net/mac80211/iface.c --@@ -1858,6 +1858,13 @@ void ieee80211_remove_interfaces(struct -- } -- mutex_unlock(&local->iflist_mtx); -- unregister_netdevice_many(&unreg_list); --+#if (!(LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,45) && \ --+ LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) && \ --+ !(LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,9) && \ --+ LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0)) && \ --+ (LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0))) --+ list_del(&unreg_list); --+#endif -- -- list_for_each_entry_safe(sdata, tmp, &wdev_list, list) { -- list_del(&sdata->list); -diff --git a/package/kernel/mac80211/patches/020-add_mpls_h.patch b/package/kernel/mac80211/patches/020-add_mpls_h.patch -deleted file mode 100644 -index e5310bc..0000000 ---- a/package/kernel/mac80211/patches/020-add_mpls_h.patch -+++ /dev/null -@@ -1,37 +0,0 @@ ----- /dev/null --+++ b/include/uapi/linux/mpls.h --@@ -0,0 +1,34 @@ --+#ifndef _UAPI_MPLS_H --+#define _UAPI_MPLS_H --+ --+#include --+#include --+ --+/* Reference: RFC 5462, RFC 3032 --+ * --+ * 0 1 2 3 --+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 --+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ --+ * | Label | TC |S| TTL | --+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ --+ * --+ * Label: Label Value, 20 bits --+ * TC: Traffic Class field, 3 bits --+ * S: Bottom of Stack, 1 bit --+ * TTL: Time to Live, 8 bits --+ */ --+ --+struct mpls_label { --+ __be32 entry; --+}; --+ --+#define MPLS_LS_LABEL_MASK 0xFFFFF000 --+#define MPLS_LS_LABEL_SHIFT 12 --+#define MPLS_LS_TC_MASK 0x00000E00 --+#define MPLS_LS_TC_SHIFT 9 --+#define MPLS_LS_S_MASK 0x00000100 --+#define MPLS_LS_S_SHIFT 8 --+#define MPLS_LS_TTL_MASK 0x000000FF --+#define MPLS_LS_TTL_SHIFT 0 --+ --+#endif /* _UAPI_MPLS_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 ---- a/package/kernel/mac80211/patches/045-bcma-from-4.1.patch -+++ /dev/null -@@ -1,104 +0,0 @@ ----- a/drivers/bcma/driver_pci.c --+++ b/drivers/bcma/driver_pci.c --@@ -282,39 +282,6 @@ void bcma_core_pci_power_save(struct bcm -- } -- EXPORT_SYMBOL_GPL(bcma_core_pci_power_save); -- ---int bcma_core_pci_irq_ctl(struct bcma_bus *bus, struct bcma_device *core, --- bool enable) ---{ --- struct pci_dev *pdev; --- u32 coremask, tmp; --- int err = 0; --- --- if (bus->hosttype != BCMA_HOSTTYPE_PCI) { --- /* This bcma device is not on a PCI host-bus. So the IRQs are --- * not routed through the PCI core. --- * So we must not enable routing through the PCI core. */ --- goto out; --- } --- --- pdev = bus->host_pci; --- --- err = pci_read_config_dword(pdev, BCMA_PCI_IRQMASK, &tmp); --- if (err) --- goto out; --- --- coremask = BIT(core->core_index) << 8; --- if (enable) --- tmp |= coremask; --- else --- tmp &= ~coremask; --- --- err = pci_write_config_dword(pdev, BCMA_PCI_IRQMASK, tmp); --- ---out: --- return err; ---} ---EXPORT_SYMBOL_GPL(bcma_core_pci_irq_ctl); --- -- static void bcma_core_pci_extend_L1timer(struct bcma_drv_pci *pc, bool extend) -- { -- u32 w; ----- a/drivers/bcma/host_pci.c --+++ b/drivers/bcma/host_pci.c --@@ -351,3 +351,37 @@ void bcma_host_pci_down(struct bcma_bus -- bcma_core_pci_down(&bus->drv_pci[0]); -- } -- EXPORT_SYMBOL_GPL(bcma_host_pci_down); --+ --+/* See also si_pci_setup */ --+int bcma_host_pci_irq_ctl(struct bcma_bus *bus, struct bcma_device *core, --+ bool enable) --+{ --+ struct pci_dev *pdev; --+ u32 coremask, tmp; --+ int err = 0; --+ --+ if (bus->hosttype != BCMA_HOSTTYPE_PCI) { --+ /* This bcma device is not on a PCI host-bus. So the IRQs are --+ * not routed through the PCI core. --+ * So we must not enable routing through the PCI core. */ --+ goto out; --+ } --+ --+ pdev = bus->host_pci; --+ --+ err = pci_read_config_dword(pdev, BCMA_PCI_IRQMASK, &tmp); --+ if (err) --+ goto out; --+ --+ coremask = BIT(core->core_index) << 8; --+ if (enable) --+ tmp |= coremask; --+ else --+ tmp &= ~coremask; --+ --+ err = pci_write_config_dword(pdev, BCMA_PCI_IRQMASK, tmp); --+ --+out: --+ return err; --+} --+EXPORT_SYMBOL_GPL(bcma_host_pci_irq_ctl); ----- a/drivers/net/wireless/b43/main.c --+++ b/drivers/net/wireless/b43/main.c --@@ -4866,7 +4866,7 @@ static int b43_wireless_core_init(struct -- switch (dev->dev->bus_type) { -- #ifdef CPTCFG_B43_BCMA -- case B43_BUS_BCMA: --- bcma_core_pci_irq_ctl(dev->dev->bdev->bus, --+ bcma_host_pci_irq_ctl(dev->dev->bdev->bus, -- dev->dev->bdev, true); -- bcma_host_pci_up(dev->dev->bdev->bus); -- break; ----- a/drivers/net/wireless/brcm80211/brcmsmac/main.c --+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c --@@ -4959,7 +4959,7 @@ static int brcms_b_up_prep(struct brcms_ -- * Configure pci/pcmcia here instead of in brcms_c_attach() -- * to allow mfg hotswap: down, hotswap (chip power cycle), up. -- */ --- bcma_core_pci_irq_ctl(wlc_hw->d11core->bus, wlc_hw->d11core, --+ bcma_host_pci_irq_ctl(wlc_hw->d11core->bus, wlc_hw->d11core, -- 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..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,9 +1,9 @@ - --- a/.local-symbols - +++ b/.local-symbols --@@ -344,40 +344,3 @@ USB_CDC_PHONET= -- USB_IPHETH= -+@@ -476,44 +476,6 @@ USB_IPHETH= - USB_SIERRA_NET= - USB_VL600= -+ 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= ---BCMA_DRIVER_PCI_HOSTMODE= - -BCMA_HOST_SOC= - -BCMA_DRIVER_PCI= -+-BCMA_DRIVER_PCI_HOSTMODE= - -BCMA_DRIVER_MIPS= - -BCMA_SFLASH= - -BCMA_NFLASH= - -BCMA_DRIVER_GMAC_CMN= - -BCMA_DRIVER_GPIO= - -BCMA_DEBUG= ----- a/Makefile.kernel --+++ b/Makefile.kernel --@@ -38,8 +38,6 @@ obj-$(CPTCFG_MAC80211) += net/mac80211/ -- obj-$(CPTCFG_WLAN) += drivers/net/wireless/ -- #obj-$(CPTCFG_BT) += net/bluetooth/ -- #obj-$(CPTCFG_BT) += drivers/bluetooth/ ---obj-$(CPTCFG_SSB) += drivers/ssb/ ---obj-$(CPTCFG_BCMA) += drivers/bcma/ -- #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/broadcom/b43/main.c -++++ b/drivers/net/wireless/broadcom/b43/main.c - @@ -2866,7 +2866,7 @@ static struct ssb_device *b43_ssb_gpio_d - { - 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; --@@ -4907,7 +4907,7 @@ static int b43_wireless_core_init(struct -+@@ -4903,7 +4903,7 @@ static int b43_wireless_core_init(struct - } - if (sprom->boardflags_lo & B43_BFL_XTAL_NOSLOW) - hf |= B43_HF_DSCRQ; /* Disable slowclock requests from ucode. */ -@@ -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 -- #source "$BACKPORT_DIR/drivers/net/ethernet/Kconfig" -+ source "$BACKPORT_DIR/drivers/net/ethernet/Kconfig" - source "$BACKPORT_DIR/drivers/net/usb/Kconfig" - - -source "$BACKPORT_DIR/drivers/ssb/Kconfig" - -source "$BACKPORT_DIR/drivers/bcma/Kconfig" - - -- #source "$BACKPORT_DIR/net/nfc/Kconfig" -+ source "$BACKPORT_DIR/net/nfc/Kconfig" - -- #source "$BACKPORT_DIR/drivers/media/Kconfig" -+ source "$BACKPORT_DIR/drivers/media/Kconfig" -+--- a/Makefile.kernel -++++ b/Makefile.kernel -+@@ -38,8 +38,6 @@ obj-$(CPTCFG_MAC80211) += net/mac80211/ -+ obj-$(CPTCFG_WLAN) += drivers/net/wireless/ -+ obj-$(CPTCFG_BT) += net/bluetooth/ -+ obj-$(CPTCFG_BT) += drivers/bluetooth/ -+-obj-$(CPTCFG_SSB) += drivers/ssb/ -+-obj-$(CPTCFG_BCMA) += drivers/bcma/ -+ 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 ---- a/package/kernel/mac80211/patches/090-linux_3_18_12_compat.patch -+++ /dev/null -@@ -1,29 +0,0 @@ ----- a/backport-include/linux/wait.h --+++ b/backport-include/linux/wait.h --@@ -23,7 +23,7 @@ backport_wait_on_bit_io(void *word, int -- -- #endif -- ---#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) --+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,12) -- #define WQ_FLAG_WOKEN 0x02 -- -- #define wait_woken LINUX_BACKPORT(wait_woken) ----- a/compat/backport-3.19.c --+++ b/compat/backport-3.19.c --@@ -15,6 +15,7 @@ -- #include -- #include -- --+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,12) -- static inline bool is_kthread_should_stop(void) -- { -- return (current->flags & PF_KTHREAD) && kthread_should_stop(); --@@ -79,6 +80,7 @@ int woken_wake_function(wait_queue_t *wa -- return default_wake_function(wait, mode, sync, key); -- } -- EXPORT_SYMBOL(woken_wake_function); --+#endif -- -- #ifdef __BACKPORT_NETDEV_RSS_KEY_FILL -- 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..02f46c7 ---- /dev/null -+++ b/package/kernel/mac80211/patches/100-remove-cryptoapi-dependencies.patch -@@ -0,0 +1,376 @@ -+--- a/net/mac80211/Kconfig -++++ b/net/mac80211/Kconfig -+@@ -5,8 +5,6 @@ config MAC80211 -+ depends on CRYPTO -+ depends on CRYPTO_ARC4 -+ depends on CRYPTO_AES -+- select BPAUTO_CRYPTO_CCM -+- depends on CRYPTO_GCM -+ depends on CRC32 -+ ---help--- -+ This option enables the hardware independent IEEE 802.11 -+--- a/net/mac80211/Makefile -++++ b/net/mac80211/Makefile -+@@ -16,9 +16,7 @@ mac80211-y := \ -+ michael.o \ -+ tkip.o \ -+ aes_ccm.o \ -+- aes_gcm.o \ -+ aes_cmac.o \ -+- aes_gmac.o \ -+ cfg.o \ -+ ethtool.o \ -+ rx.o \ -+--- a/net/mac80211/aes_ccm.c -++++ b/net/mac80211/aes_ccm.c -+@@ -13,89 +13,132 @@ -+ #include -+ #include -+ #include -++#include -+ -+ #include -+ #include "key.h" -+ #include "aes_ccm.h" -+ -+-void ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, -+- u8 *data, size_t data_len, u8 *mic, -+- size_t mic_len) -++static void aes_ccm_prepare(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, u8 *s_0, -++ u8 *a, u8 *b) -+ { -+- struct scatterlist sg[3]; -++ int i; -++ -++ crypto_cipher_encrypt_one(tfm, b, b_0); -++ -++ /* Extra Authenticate-only data (always two AES blocks) */ -++ for (i = 0; i < AES_BLOCK_SIZE; i++) -++ aad[i] ^= b[i]; -++ crypto_cipher_encrypt_one(tfm, b, aad); -++ -++ aad += AES_BLOCK_SIZE; -++ -++ for (i = 0; i < AES_BLOCK_SIZE; i++) -++ aad[i] ^= b[i]; -++ crypto_cipher_encrypt_one(tfm, a, aad); -+ -+- char aead_req_data[sizeof(struct aead_request) + -+- crypto_aead_reqsize(tfm)] -+- __aligned(__alignof__(struct aead_request)); -+- struct aead_request *aead_req = (void *) aead_req_data; -++ /* Mask out bits from auth-only-b_0 */ -++ b_0[0] &= 0x07; -+ -+- memset(aead_req, 0, sizeof(aead_req_data)); -++ /* S_0 is used to encrypt T (= MIC) */ -++ b_0[14] = 0; -++ b_0[15] = 0; -++ crypto_cipher_encrypt_one(tfm, s_0, b_0); -++} -+ -+- sg_init_table(sg, 3); -+- sg_set_buf(&sg[0], &aad[2], be16_to_cpup((__be16 *)aad)); -+- sg_set_buf(&sg[1], data, data_len); -+- sg_set_buf(&sg[2], mic, mic_len); -+ -+- aead_request_set_tfm(aead_req, tfm); -+- aead_request_set_crypt(aead_req, sg, sg, data_len, b_0); -+- aead_request_set_ad(aead_req, sg[0].length); -++void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, -++ u8 *data, size_t data_len, u8 *mic, -++ size_t mic_len) -++{ -++ int i, j, last_len, num_blocks; -++ u8 b[AES_BLOCK_SIZE]; -++ u8 s_0[AES_BLOCK_SIZE]; -++ u8 e[AES_BLOCK_SIZE]; -++ u8 *pos, *cpos; -++ -++ num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_SIZE); -++ last_len = data_len % AES_BLOCK_SIZE; -++ aes_ccm_prepare(tfm, b_0, aad, s_0, b, b); -++ -++ /* Process payload blocks */ -++ pos = data; -++ cpos = data; -++ for (j = 1; j <= num_blocks; j++) { -++ int blen = (j == num_blocks && last_len) ? -++ last_len : AES_BLOCK_SIZE; -++ -++ /* Authentication followed by encryption */ -++ for (i = 0; i < blen; i++) -++ b[i] ^= pos[i]; -++ crypto_cipher_encrypt_one(tfm, b, b); -++ -++ b_0[14] = (j >> 8) & 0xff; -++ b_0[15] = j & 0xff; -++ crypto_cipher_encrypt_one(tfm, e, b_0); -++ for (i = 0; i < blen; i++) -++ *cpos++ = *pos++ ^ e[i]; -++ } -+ -+- crypto_aead_encrypt(aead_req); -++ for (i = 0; i < mic_len; i++) -++ mic[i] = b[i] ^ s_0[i]; -+ } -+ -+-int ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, -++int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, -+ u8 *data, size_t data_len, u8 *mic, -+ size_t mic_len) -+ { -+- struct scatterlist sg[3]; -+- char aead_req_data[sizeof(struct aead_request) + -+- crypto_aead_reqsize(tfm)] -+- __aligned(__alignof__(struct aead_request)); -+- struct aead_request *aead_req = (void *) aead_req_data; -+- -+- if (data_len == 0) -+- return -EINVAL; -+- -+- memset(aead_req, 0, sizeof(aead_req_data)); -+- -+- sg_init_table(sg, 3); -+- sg_set_buf(&sg[0], &aad[2], be16_to_cpup((__be16 *)aad)); -+- sg_set_buf(&sg[1], data, data_len); -+- sg_set_buf(&sg[2], mic, mic_len); -+- -+- aead_request_set_tfm(aead_req, tfm); -+- aead_request_set_crypt(aead_req, sg, sg, data_len + mic_len, b_0); -+- aead_request_set_ad(aead_req, sg[0].length); -++ int i, j, last_len, num_blocks; -++ u8 *pos, *cpos; -++ u8 a[AES_BLOCK_SIZE]; -++ u8 b[AES_BLOCK_SIZE]; -++ u8 s_0[AES_BLOCK_SIZE]; -++ -++ num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_SIZE); -++ last_len = data_len % AES_BLOCK_SIZE; -++ aes_ccm_prepare(tfm, b_0, aad, s_0, a, b); -++ -++ /* Process payload blocks */ -++ cpos = data; -++ pos = data; -++ for (j = 1; j <= num_blocks; j++) { -++ int blen = (j == num_blocks && last_len) ? -++ last_len : AES_BLOCK_SIZE; -++ -++ /* Decryption followed by authentication */ -++ b_0[14] = (j >> 8) & 0xff; -++ b_0[15] = j & 0xff; -++ crypto_cipher_encrypt_one(tfm, b, b_0); -++ for (i = 0; i < blen; i++) { -++ *pos = *cpos++ ^ b[i]; -++ a[i] ^= *pos++; -++ } -++ crypto_cipher_encrypt_one(tfm, a, a); -++ } -++ -++ for (i = 0; i < mic_len; i++) { -++ if ((mic[i] ^ s_0[i]) != a[i]) -++ return -1; -++ } -+ -+- return crypto_aead_decrypt(aead_req); -++ return 0; -+ } -+ -+-struct crypto_aead *ieee80211_aes_key_setup_encrypt(const u8 key[], -+- size_t key_len, -+- size_t mic_len) -++struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[], -++ size_t key_len, -++ size_t mic_len) -+ { -+- struct crypto_aead *tfm; -+- int err; -++ struct crypto_cipher *tfm; -+ -+- tfm = crypto_alloc_aead("ccm(aes)", 0, CRYPTO_ALG_ASYNC); -+- if (IS_ERR(tfm)) -+- return tfm; -+- -+- err = crypto_aead_setkey(tfm, key, key_len); -+- if (err) -+- goto free_aead; -+- err = crypto_aead_setauthsize(tfm, mic_len); -+- if (err) -+- goto free_aead; -++ tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC); -++ if (!IS_ERR(tfm)) -++ crypto_cipher_setkey(tfm, key, key_len); -+ -+ return tfm; -+- -+-free_aead: -+- crypto_free_aead(tfm); -+- return ERR_PTR(err); -+ } -+ -+-void ieee80211_aes_key_free(struct crypto_aead *tfm) -++ -++void ieee80211_aes_key_free(struct crypto_cipher *tfm) -+ { -+- crypto_free_aead(tfm); -++ crypto_free_cipher(tfm); -+ } -+--- a/net/mac80211/aes_ccm.h -++++ b/net/mac80211/aes_ccm.h -+@@ -12,15 +12,15 @@ -+ -+ #include -+ -+-struct crypto_aead *ieee80211_aes_key_setup_encrypt(const u8 key[], -+- size_t key_len, -+- size_t mic_len); -+-void ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, -++struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[], -++ size_t key_len, -++ size_t mic_len); -++void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, -+ u8 *data, size_t data_len, u8 *mic, -+ size_t mic_len); -+-int ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, -++int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, -+ u8 *data, size_t data_len, u8 *mic, -+ size_t mic_len); -+-void ieee80211_aes_key_free(struct crypto_aead *tfm); -++void ieee80211_aes_key_free(struct crypto_cipher *tfm); -+ -+ #endif /* AES_CCM_H */ -+--- a/net/mac80211/aes_gcm.h -++++ b/net/mac80211/aes_gcm.h -+@@ -11,12 +11,28 @@ -+ -+ #include -+ -+-void ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, -+- u8 *data, size_t data_len, u8 *mic); -+-int ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, -+- u8 *data, size_t data_len, u8 *mic); -+-struct crypto_aead *ieee80211_aes_gcm_key_setup_encrypt(const u8 key[], -+- size_t key_len); -+-void ieee80211_aes_gcm_key_free(struct crypto_aead *tfm); -++static inline void -++ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, -++ u8 *data, size_t data_len, u8 *mic) -++{ -++} -++ -++static inline int -++ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, -++ u8 *data, size_t data_len, u8 *mic) -++{ -++ return -EOPNOTSUPP; -++} -++ -++static inline struct crypto_aead * -++ieee80211_aes_gcm_key_setup_encrypt(const u8 key[], size_t key_len) -++{ -++ return NULL; -++} -++ -++static inline void -++ieee80211_aes_gcm_key_free(struct crypto_aead *tfm) -++{ -++} -+ -+ #endif /* AES_GCM_H */ -+--- a/net/mac80211/aes_gmac.h -++++ b/net/mac80211/aes_gmac.h -+@@ -11,10 +11,22 @@ -+ -+ #include -+ -+-struct crypto_aead *ieee80211_aes_gmac_key_setup(const u8 key[], -+- size_t key_len); -+-int ieee80211_aes_gmac(struct crypto_aead *tfm, const u8 *aad, u8 *nonce, -+- const u8 *data, size_t data_len, u8 *mic); -+-void ieee80211_aes_gmac_key_free(struct crypto_aead *tfm); -++static inline struct crypto_aead * -++ieee80211_aes_gmac_key_setup(const u8 key[], size_t key_len) -++{ -++ return NULL; -++} -++ -++static inline int -++ieee80211_aes_gmac(struct crypto_aead *tfm, const u8 *aad, u8 *nonce, -++ const u8 *data, size_t data_len, u8 *mic) -++{ -++ return -EOPNOTSUPP; -++} -++ -++static inline void -++ieee80211_aes_gmac_key_free(struct crypto_aead *tfm) -++{ -++} -+ -+ #endif /* AES_GMAC_H */ -+--- a/net/mac80211/key.h -++++ b/net/mac80211/key.h -+@@ -84,7 +84,7 @@ struct ieee80211_key { -+ * Management frames. -+ */ -+ u8 rx_pn[IEEE80211_NUM_TIDS + 1][IEEE80211_CCMP_PN_LEN]; -+- struct crypto_aead *tfm; -++ struct crypto_cipher *tfm; -+ u32 replays; /* dot11RSNAStatsCCMPReplays */ -+ } ccmp; -+ struct { -+--- a/net/mac80211/wpa.c -++++ b/net/mac80211/wpa.c -+@@ -307,7 +307,8 @@ ieee80211_crypto_tkip_decrypt(struct iee -+ } -+ -+ -+-static void ccmp_special_blocks(struct sk_buff *skb, u8 *pn, u8 *b_0, u8 *aad) -++static void ccmp_special_blocks(struct sk_buff *skb, u8 *pn, u8 *b_0, u8 *aad, -++ u16 data_len) -+ { -+ __le16 mask_fc; -+ int a4_included, mgmt; -+@@ -337,14 +338,8 @@ static void ccmp_special_blocks(struct s -+ else -+ qos_tid = 0; -+ -+- /* In CCM, the initial vectors (IV) used for CTR mode encryption and CBC -+- * mode authentication are not allowed to collide, yet both are derived -+- * from this vector b_0. We only set L := 1 here to indicate that the -+- * data size can be represented in (L+1) bytes. The CCM layer will take -+- * care of storing the data length in the top (L+1) bytes and setting -+- * and clearing the other bits as is required to derive the two IVs. -+- */ -+- b_0[0] = 0x1; -++ /* First block, b_0 */ -++ b_0[0] = 0x59; /* flags: Adata: 1, M: 011, L: 001 */ -+ -+ /* Nonce: Nonce Flags | A2 | PN -+ * Nonce Flags: Priority (b0..b3) | Management (b4) | Reserved (b5..b7) -+@@ -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); -++ /* l(m) */ -++ put_unaligned_be16(data_len, &b_0[14]); -+ -+ /* AAD (extra authenticate-only data) / masked 802.11 header -+ * FC | A1 | A2 | A3 | SC | [A4] | [QC] */ -+@@ -463,7 +460,7 @@ static int ccmp_encrypt_skb(struct ieee8 -+ return 0; -+ -+ pos += IEEE80211_CCMP_HDR_LEN; -+- ccmp_special_blocks(skb, pn, b_0, aad); -++ ccmp_special_blocks(skb, pn, b_0, aad, len); -+ ieee80211_aes_ccm_encrypt(key->u.ccmp.tfm, b_0, aad, pos, len, -+ skb_put(skb, mic_len), mic_len); -+ -+@@ -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 */ -+- ccmp_special_blocks(skb, pn, b_0, aad); -++ ccmp_special_blocks(skb, pn, b_0, aad, data_len); -+ -+ if (ieee80211_aes_ccm_decrypt( -+ key->u.ccmp.tfm, b_0, aad, -diff --git a/package/kernel/mac80211/patches/100-revert-cryptoapi-ports.patch b/package/kernel/mac80211/patches/100-revert-cryptoapi-ports.patch -deleted file mode 100644 -index ceca952..0000000 ---- a/package/kernel/mac80211/patches/100-revert-cryptoapi-ports.patch -+++ /dev/null -@@ -1,2055 +0,0 @@ --This patch reverts the following commits from wireless-testing: -- --8ade538bf39b1ee53418528fdacd36b8e65621b9 --56c52da2d554f081e8fce58ecbcf6a40c605b95b --2b2ba0db1c820d04d5143452d70012cd44d7b578 --00b9cfa3ff38401bd70c34b250ca13e5ea347b4a --4f031fa9f188b2b0641ac20087d9e16bcfb4e49d --6e1ee5d2e9e411892b5d84e3ea93e3fc88ac786c --30ef7ef9672d92ab2cac37f60a31955c118321e7 --f359d3fe832e49eeec2232b2af5a9e3aee6b4862 (only the changes in aes_cmac.{c,h}) --7ec7c4a9a686c608315739ab6a2b0527a240883c ----- -- ----- a/include/linux/ieee80211.h --+++ b/include/linux/ieee80211.h --@@ -1017,15 +1017,6 @@ struct ieee80211_mmie { -- u8 mic[8]; -- } __packed; -- ---/* Management MIC information element (IEEE 802.11w) for GMAC and CMAC-256 */ ---struct ieee80211_mmie_16 { --- u8 element_id; --- u8 length; --- __le16 key_id; --- u8 sequence_number[6]; --- u8 mic[16]; ---} __packed; --- -- struct ieee80211_vendor_ie { -- u8 element_id; -- u8 len; ----- a/include/net/mac80211.h --+++ b/include/net/mac80211.h --@@ -1306,8 +1306,8 @@ struct ieee80211_vif *wdev_to_ieee80211_ -- * @IEEE80211_KEY_FLAG_PAIRWISE: Set by mac80211, this flag indicates -- * that the key is pairwise rather then a shared key. -- * @IEEE80211_KEY_FLAG_SW_MGMT_TX: This flag should be set by the driver for a --- * CCMP/GCMP key if it requires CCMP/GCMP encryption of management frames --- * (MFP) to be done in software. --+ * CCMP key if it requires CCMP encryption of management frames (MFP) to --+ * be done in software. -- * @IEEE80211_KEY_FLAG_PUT_IV_SPACE: This flag should be set by the driver -- * if space should be prepared for the IV, but the IV -- * itself should not be generated. Do not set together with --@@ -1322,7 +1322,7 @@ struct ieee80211_vif *wdev_to_ieee80211_ -- * RX, if your crypto engine can't deal with TX you can also set the -- * %IEEE80211_KEY_FLAG_SW_MGMT_TX flag to encrypt such frames in SW. -- * @IEEE80211_KEY_FLAG_GENERATE_IV_MGMT: This flag should be set by the --- * driver for a CCMP/GCMP key to indicate that is requires IV generation --+ * driver for a CCMP key to indicate that is requires IV generation -- * only for managment frames (MFP). -- * @IEEE80211_KEY_FLAG_RESERVE_TAILROOM: This flag should be set by the -- * driver for a key to indicate that sufficient tailroom must always --@@ -4112,10 +4112,6 @@ void ieee80211_aes_cmac_calculate_k1_k2( -- * reverse order than in packet) -- * @aes_cmac: PN data, most significant byte first (big endian, -- * reverse order than in packet) --- * @aes_gmac: PN data, most significant byte first (big endian, --- * reverse order than in packet) --- * @gcmp: PN data, most significant byte first (big endian, --- * reverse order than in packet) -- */ -- struct ieee80211_key_seq { -- union { --@@ -4129,12 +4125,6 @@ struct ieee80211_key_seq { -- struct { -- u8 pn[6]; -- } aes_cmac; --- struct { --- u8 pn[6]; --- } aes_gmac; --- struct { --- u8 pn[6]; --- } gcmp; -- }; -- }; -- --@@ -4159,7 +4149,7 @@ void ieee80211_get_key_tx_seq(struct iee -- * ieee80211_get_key_rx_seq - get key RX sequence counter -- * -- * @keyconf: the parameter passed with the set key --- * @tid: The TID, or -1 for the management frame value (CCMP/GCMP only); --+ * @tid: The TID, or -1 for the management frame value (CCMP only); -- * the value on TID 0 is also used for non-QoS frames. For -- * CMAC, only TID 0 is valid. -- * @seq: buffer to receive the sequence data --@@ -4195,7 +4185,7 @@ void ieee80211_set_key_tx_seq(struct iee -- * ieee80211_set_key_rx_seq - set key RX sequence counter -- * -- * @keyconf: the parameter passed with the set key --- * @tid: The TID, or -1 for the management frame value (CCMP/GCMP only); --+ * @tid: The TID, or -1 for the management frame value (CCMP only); -- * the value on TID 0 is also used for non-QoS frames. For -- * CMAC, only TID 0 is valid. -- * @seq: new sequence data ----- a/net/mac80211/Kconfig --+++ b/net/mac80211/Kconfig --@@ -5,8 +5,6 @@ config MAC80211 -- depends on CRYPTO -- depends on CRYPTO_ARC4 -- depends on CRYPTO_AES --- select BPAUTO_CRYPTO_CCM --- depends on CRYPTO_GCM -- depends on CRC32 -- select BPAUTO_AVERAGE -- ---help--- ----- a/net/mac80211/Makefile --+++ b/net/mac80211/Makefile --@@ -15,9 +15,7 @@ mac80211-y := \ -- michael.o \ -- tkip.o \ -- aes_ccm.o \ --- aes_gcm.o \ -- aes_cmac.o \ --- aes_gmac.o \ -- cfg.o \ -- ethtool.o \ -- rx.o \ ----- a/net/mac80211/aes_ccm.c --+++ b/net/mac80211/aes_ccm.c --@@ -2,8 +2,6 @@ -- * Copyright 2003-2004, Instant802 Networks, Inc. -- * Copyright 2005-2006, Devicescape Software, Inc. -- * --- * Rewrite: Copyright (C) 2013 Linaro Ltd --- * -- * 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. --@@ -19,82 +17,134 @@ -- #include "key.h" -- #include "aes_ccm.h" -- ---void ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, --- u8 *data, size_t data_len, u8 *mic, --- size_t mic_len) --+static void aes_ccm_prepare(struct crypto_cipher *tfm, u8 *scratch, u8 *a) --+{ --+ int i; --+ u8 *b_0, *aad, *b, *s_0; --+ --+ b_0 = scratch + 3 * AES_BLOCK_SIZE; --+ aad = scratch + 4 * AES_BLOCK_SIZE; --+ b = scratch; --+ s_0 = scratch + AES_BLOCK_SIZE; --+ --+ crypto_cipher_encrypt_one(tfm, b, b_0); --+ --+ /* Extra Authenticate-only data (always two AES blocks) */ --+ for (i = 0; i < AES_BLOCK_SIZE; i++) --+ aad[i] ^= b[i]; --+ crypto_cipher_encrypt_one(tfm, b, aad); --+ --+ aad += AES_BLOCK_SIZE; --+ --+ for (i = 0; i < AES_BLOCK_SIZE; i++) --+ aad[i] ^= b[i]; --+ crypto_cipher_encrypt_one(tfm, a, aad); --+ --+ /* Mask out bits from auth-only-b_0 */ --+ b_0[0] &= 0x07; --+ --+ /* S_0 is used to encrypt T (= MIC) */ --+ b_0[14] = 0; --+ b_0[15] = 0; --+ crypto_cipher_encrypt_one(tfm, s_0, b_0); --+} --+ --+ --+void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *scratch, --+ u8 *data, size_t data_len, --+ u8 *cdata, u8 *mic) -- { --- struct scatterlist assoc, pt, ct[2]; --+ int i, j, last_len, num_blocks; --+ u8 *pos, *cpos, *b, *s_0, *e, *b_0; -- --- char aead_req_data[sizeof(struct aead_request) + --- crypto_aead_reqsize(tfm)] --- __aligned(__alignof__(struct aead_request)); --- struct aead_request *aead_req = (void *) aead_req_data; --- --- memset(aead_req, 0, sizeof(aead_req_data)); --- --- sg_init_one(&pt, data, data_len); --- sg_init_one(&assoc, &aad[2], be16_to_cpup((__be16 *)aad)); --- sg_init_table(ct, 2); --- sg_set_buf(&ct[0], data, data_len); --- sg_set_buf(&ct[1], mic, mic_len); --- --- aead_request_set_tfm(aead_req, tfm); --- aead_request_set_assoc(aead_req, &assoc, assoc.length); --- aead_request_set_crypt(aead_req, &pt, ct, data_len, b_0); --+ b = scratch; --+ s_0 = scratch + AES_BLOCK_SIZE; --+ e = scratch + 2 * AES_BLOCK_SIZE; --+ b_0 = scratch + 3 * AES_BLOCK_SIZE; --+ --+ num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_SIZE); --+ last_len = data_len % AES_BLOCK_SIZE; --+ aes_ccm_prepare(tfm, scratch, b); --+ --+ /* Process payload blocks */ --+ pos = data; --+ cpos = cdata; --+ for (j = 1; j <= num_blocks; j++) { --+ int blen = (j == num_blocks && last_len) ? --+ last_len : AES_BLOCK_SIZE; --+ --+ /* Authentication followed by encryption */ --+ for (i = 0; i < blen; i++) --+ b[i] ^= pos[i]; --+ crypto_cipher_encrypt_one(tfm, b, b); --+ --+ b_0[14] = (j >> 8) & 0xff; --+ b_0[15] = j & 0xff; --+ crypto_cipher_encrypt_one(tfm, e, b_0); --+ for (i = 0; i < blen; i++) --+ *cpos++ = *pos++ ^ e[i]; --+ } -- --- crypto_aead_encrypt(aead_req); --+ for (i = 0; i < IEEE80211_CCMP_MIC_LEN; i++) --+ mic[i] = b[i] ^ s_0[i]; -- } -- ---int ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, --- u8 *data, size_t data_len, u8 *mic, --- size_t mic_len) --+ --+int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *scratch, --+ u8 *cdata, size_t data_len, u8 *mic, u8 *data) -- { --- struct scatterlist assoc, pt, ct[2]; --- char aead_req_data[sizeof(struct aead_request) + --- crypto_aead_reqsize(tfm)] --- __aligned(__alignof__(struct aead_request)); --- struct aead_request *aead_req = (void *) aead_req_data; --- --- if (data_len == 0) --- return -EINVAL; --- --- memset(aead_req, 0, sizeof(aead_req_data)); --- --- sg_init_one(&pt, data, data_len); --- sg_init_one(&assoc, &aad[2], be16_to_cpup((__be16 *)aad)); --- sg_init_table(ct, 2); --- sg_set_buf(&ct[0], data, data_len); --- sg_set_buf(&ct[1], mic, mic_len); --- --- aead_request_set_tfm(aead_req, tfm); --- aead_request_set_assoc(aead_req, &assoc, assoc.length); --- aead_request_set_crypt(aead_req, ct, &pt, data_len + mic_len, b_0); --+ int i, j, last_len, num_blocks; --+ u8 *pos, *cpos, *b, *s_0, *a, *b_0; --+ --+ b = scratch; --+ s_0 = scratch + AES_BLOCK_SIZE; --+ a = scratch + 2 * AES_BLOCK_SIZE; --+ b_0 = scratch + 3 * AES_BLOCK_SIZE; --+ --+ num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_SIZE); --+ last_len = data_len % AES_BLOCK_SIZE; --+ aes_ccm_prepare(tfm, scratch, a); --+ --+ /* Process payload blocks */ --+ cpos = cdata; --+ pos = data; --+ for (j = 1; j <= num_blocks; j++) { --+ int blen = (j == num_blocks && last_len) ? --+ last_len : AES_BLOCK_SIZE; --+ --+ /* Decryption followed by authentication */ --+ b_0[14] = (j >> 8) & 0xff; --+ b_0[15] = j & 0xff; --+ crypto_cipher_encrypt_one(tfm, b, b_0); --+ for (i = 0; i < blen; i++) { --+ *pos = *cpos++ ^ b[i]; --+ a[i] ^= *pos++; --+ } --+ crypto_cipher_encrypt_one(tfm, a, a); --+ } --+ --+ for (i = 0; i < IEEE80211_CCMP_MIC_LEN; i++) { --+ if ((mic[i] ^ s_0[i]) != a[i]) --+ return -1; --+ } -- --- return crypto_aead_decrypt(aead_req); --+ return 0; -- } -- ---struct crypto_aead *ieee80211_aes_key_setup_encrypt(const u8 key[], --- size_t key_len, --- size_t mic_len) --+ --+struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[]) -- { --- struct crypto_aead *tfm; --- int err; --+ struct crypto_cipher *tfm; -- --- tfm = crypto_alloc_aead("ccm(aes)", 0, CRYPTO_ALG_ASYNC); --- if (IS_ERR(tfm)) --- return tfm; --- --- err = crypto_aead_setkey(tfm, key, key_len); --- if (!err) --- err = crypto_aead_setauthsize(tfm, mic_len); --- if (!err) --- return tfm; --+ tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC); --+ if (!IS_ERR(tfm)) --+ crypto_cipher_setkey(tfm, key, WLAN_KEY_LEN_CCMP); -- --- crypto_free_aead(tfm); --- return ERR_PTR(err); --+ return tfm; -- } -- ---void ieee80211_aes_key_free(struct crypto_aead *tfm) --+ --+void ieee80211_aes_key_free(struct crypto_cipher *tfm) -- { --- crypto_free_aead(tfm); --+ crypto_free_cipher(tfm); -- } ----- a/net/mac80211/aes_ccm.h --+++ b/net/mac80211/aes_ccm.h --@@ -12,15 +12,13 @@ -- -- #include -- ---struct crypto_aead *ieee80211_aes_key_setup_encrypt(const u8 key[], --- size_t key_len, --- size_t mic_len); ---void ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, --- u8 *data, size_t data_len, u8 *mic, --- size_t mic_len); ---int ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, --- u8 *data, size_t data_len, u8 *mic, --- size_t mic_len); ---void ieee80211_aes_key_free(struct crypto_aead *tfm); --+struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[]); --+void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *scratch, --+ u8 *data, size_t data_len, --+ u8 *cdata, u8 *mic); --+int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *scratch, --+ u8 *cdata, size_t data_len, --+ u8 *mic, u8 *data); --+void ieee80211_aes_key_free(struct crypto_cipher *tfm); -- -- #endif /* AES_CCM_H */ ----- a/net/mac80211/aes_cmac.c --+++ b/net/mac80211/aes_cmac.c --@@ -18,8 +18,8 @@ -- #include "key.h" -- #include "aes_cmac.h" -- --+#define AES_CMAC_KEY_LEN 16 -- #define CMAC_TLEN 8 /* CMAC TLen = 64 bits (8 octets) */ ---#define CMAC_TLEN_256 16 /* CMAC TLen = 128 bits (16 octets) */ -- #define AAD_LEN 20 -- -- --@@ -35,9 +35,9 @@ static void gf_mulx(u8 *pad) -- pad[AES_BLOCK_SIZE - 1] ^= 0x87; -- } -- ---static void aes_cmac_vector(struct crypto_cipher *tfm, size_t num_elem, --- const u8 *addr[], const size_t *len, u8 *mac, --- size_t mac_len) --+ --+static void aes_128_cmac_vector(struct crypto_cipher *tfm, size_t num_elem, --+ const u8 *addr[], const size_t *len, u8 *mac) -- { -- u8 cbc[AES_BLOCK_SIZE], pad[AES_BLOCK_SIZE]; -- const u8 *pos, *end; --@@ -88,7 +88,7 @@ static void aes_cmac_vector(struct crypt -- for (i = 0; i < AES_BLOCK_SIZE; i++) -- pad[i] ^= cbc[i]; -- crypto_cipher_encrypt_one(tfm, pad, pad); --- memcpy(mac, pad, mac_len); --+ memcpy(mac, pad, CMAC_TLEN); -- } -- -- --@@ -107,35 +107,17 @@ void ieee80211_aes_cmac(struct crypto_ci -- addr[2] = zero; -- len[2] = CMAC_TLEN; -- --- aes_cmac_vector(tfm, 3, addr, len, mic, CMAC_TLEN); --+ aes_128_cmac_vector(tfm, 3, addr, len, mic); -- } -- ---void ieee80211_aes_cmac_256(struct crypto_cipher *tfm, const u8 *aad, --- const u8 *data, size_t data_len, u8 *mic) ---{ --- const u8 *addr[3]; --- size_t len[3]; --- u8 zero[CMAC_TLEN_256]; --- --- memset(zero, 0, CMAC_TLEN_256); --- addr[0] = aad; --- len[0] = AAD_LEN; --- addr[1] = data; --- len[1] = data_len - CMAC_TLEN_256; --- addr[2] = zero; --- len[2] = CMAC_TLEN_256; --- --- aes_cmac_vector(tfm, 3, addr, len, mic, CMAC_TLEN_256); ---} -- ---struct crypto_cipher *ieee80211_aes_cmac_key_setup(const u8 key[], --- size_t key_len) --+struct crypto_cipher * ieee80211_aes_cmac_key_setup(const u8 key[]) -- { -- struct crypto_cipher *tfm; -- -- tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC); -- if (!IS_ERR(tfm)) --- crypto_cipher_setkey(tfm, key, key_len); --+ crypto_cipher_setkey(tfm, key, AES_CMAC_KEY_LEN); -- -- return tfm; -- } ----- a/net/mac80211/aes_cmac.h --+++ b/net/mac80211/aes_cmac.h --@@ -11,12 +11,9 @@ -- -- #include -- ---struct crypto_cipher *ieee80211_aes_cmac_key_setup(const u8 key[], --- size_t key_len); --+struct crypto_cipher * ieee80211_aes_cmac_key_setup(const u8 key[]); -- void ieee80211_aes_cmac(struct crypto_cipher *tfm, const u8 *aad, -- const u8 *data, size_t data_len, u8 *mic); ---void ieee80211_aes_cmac_256(struct crypto_cipher *tfm, const u8 *aad, --- const u8 *data, size_t data_len, u8 *mic); -- void ieee80211_aes_cmac_key_free(struct crypto_cipher *tfm); -- -- #endif /* AES_CMAC_H */ ----- a/net/mac80211/aes_gcm.c --+++ /dev/null --@@ -1,95 +0,0 @@ ---/* --- * Copyright 2014-2015, Qualcomm Atheros, Inc. --- * --- * 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 ---#include ---#include ---#include --- ---#include ---#include "key.h" ---#include "aes_gcm.h" --- ---void ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, --- u8 *data, size_t data_len, u8 *mic) ---{ --- struct scatterlist assoc, pt, ct[2]; --- --- char aead_req_data[sizeof(struct aead_request) + --- crypto_aead_reqsize(tfm)] --- __aligned(__alignof__(struct aead_request)); --- struct aead_request *aead_req = (void *)aead_req_data; --- --- memset(aead_req, 0, sizeof(aead_req_data)); --- --- sg_init_one(&pt, data, data_len); --- sg_init_one(&assoc, &aad[2], be16_to_cpup((__be16 *)aad)); --- sg_init_table(ct, 2); --- sg_set_buf(&ct[0], data, data_len); --- sg_set_buf(&ct[1], mic, IEEE80211_GCMP_MIC_LEN); --- --- aead_request_set_tfm(aead_req, tfm); --- aead_request_set_assoc(aead_req, &assoc, assoc.length); --- aead_request_set_crypt(aead_req, &pt, ct, data_len, j_0); --- --- crypto_aead_encrypt(aead_req); ---} --- ---int ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, --- u8 *data, size_t data_len, u8 *mic) ---{ --- struct scatterlist assoc, pt, ct[2]; --- char aead_req_data[sizeof(struct aead_request) + --- crypto_aead_reqsize(tfm)] --- __aligned(__alignof__(struct aead_request)); --- struct aead_request *aead_req = (void *)aead_req_data; --- --- if (data_len == 0) --- return -EINVAL; --- --- memset(aead_req, 0, sizeof(aead_req_data)); --- --- sg_init_one(&pt, data, data_len); --- sg_init_one(&assoc, &aad[2], be16_to_cpup((__be16 *)aad)); --- sg_init_table(ct, 2); --- sg_set_buf(&ct[0], data, data_len); --- sg_set_buf(&ct[1], mic, IEEE80211_GCMP_MIC_LEN); --- --- aead_request_set_tfm(aead_req, tfm); --- aead_request_set_assoc(aead_req, &assoc, assoc.length); --- aead_request_set_crypt(aead_req, ct, &pt, --- data_len + IEEE80211_GCMP_MIC_LEN, j_0); --- --- return crypto_aead_decrypt(aead_req); ---} --- ---struct crypto_aead *ieee80211_aes_gcm_key_setup_encrypt(const u8 key[], --- size_t key_len) ---{ --- struct crypto_aead *tfm; --- int err; --- --- tfm = crypto_alloc_aead("gcm(aes)", 0, CRYPTO_ALG_ASYNC); --- if (IS_ERR(tfm)) --- return tfm; --- --- err = crypto_aead_setkey(tfm, key, key_len); --- if (!err) --- err = crypto_aead_setauthsize(tfm, IEEE80211_GCMP_MIC_LEN); --- if (!err) --- return tfm; --- --- crypto_free_aead(tfm); --- return ERR_PTR(err); ---} --- ---void ieee80211_aes_gcm_key_free(struct crypto_aead *tfm) ---{ --- crypto_free_aead(tfm); ---} ----- a/net/mac80211/aes_gcm.h --+++ /dev/null --@@ -1,22 +0,0 @@ ---/* --- * Copyright 2014-2015, Qualcomm Atheros, Inc. --- * --- * 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. --- */ --- ---#ifndef AES_GCM_H ---#define AES_GCM_H --- ---#include --- ---void ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, --- u8 *data, size_t data_len, u8 *mic); ---int ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, --- u8 *data, size_t data_len, u8 *mic); ---struct crypto_aead *ieee80211_aes_gcm_key_setup_encrypt(const u8 key[], --- size_t key_len); ---void ieee80211_aes_gcm_key_free(struct crypto_aead *tfm); --- ---#endif /* AES_GCM_H */ ----- a/net/mac80211/aes_gmac.c --+++ /dev/null --@@ -1,84 +0,0 @@ ---/* --- * AES-GMAC for IEEE 802.11 BIP-GMAC-128 and BIP-GMAC-256 --- * Copyright 2015, Qualcomm Atheros, Inc. --- * --- * 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 ---#include ---#include ---#include --- ---#include ---#include "key.h" ---#include "aes_gmac.h" --- ---#define GMAC_MIC_LEN 16 ---#define GMAC_NONCE_LEN 12 ---#define AAD_LEN 20 --- ---int ieee80211_aes_gmac(struct crypto_aead *tfm, const u8 *aad, u8 *nonce, --- const u8 *data, size_t data_len, u8 *mic) ---{ --- struct scatterlist sg[3], ct[1]; --- char aead_req_data[sizeof(struct aead_request) + --- crypto_aead_reqsize(tfm)] --- __aligned(__alignof__(struct aead_request)); --- struct aead_request *aead_req = (void *)aead_req_data; --- u8 zero[GMAC_MIC_LEN], iv[AES_BLOCK_SIZE]; --- --- if (data_len < GMAC_MIC_LEN) --- return -EINVAL; --- --- memset(aead_req, 0, sizeof(aead_req_data)); --- --- memset(zero, 0, GMAC_MIC_LEN); --- sg_init_table(sg, 3); --- sg_set_buf(&sg[0], aad, AAD_LEN); --- sg_set_buf(&sg[1], data, data_len - GMAC_MIC_LEN); --- sg_set_buf(&sg[2], zero, GMAC_MIC_LEN); --- --- memcpy(iv, nonce, GMAC_NONCE_LEN); --- memset(iv + GMAC_NONCE_LEN, 0, sizeof(iv) - GMAC_NONCE_LEN); --- iv[AES_BLOCK_SIZE - 1] = 0x01; --- --- sg_init_table(ct, 1); --- sg_set_buf(&ct[0], mic, GMAC_MIC_LEN); --- --- aead_request_set_tfm(aead_req, tfm); --- aead_request_set_assoc(aead_req, sg, AAD_LEN + data_len); --- aead_request_set_crypt(aead_req, NULL, ct, 0, iv); --- --- crypto_aead_encrypt(aead_req); --- --- return 0; ---} --- ---struct crypto_aead *ieee80211_aes_gmac_key_setup(const u8 key[], --- size_t key_len) ---{ --- struct crypto_aead *tfm; --- int err; --- --- tfm = crypto_alloc_aead("gcm(aes)", 0, CRYPTO_ALG_ASYNC); --- if (IS_ERR(tfm)) --- return tfm; --- --- err = crypto_aead_setkey(tfm, key, key_len); --- if (!err) --- return tfm; --- if (!err) --- err = crypto_aead_setauthsize(tfm, GMAC_MIC_LEN); --- --- crypto_free_aead(tfm); --- return ERR_PTR(err); ---} --- ---void ieee80211_aes_gmac_key_free(struct crypto_aead *tfm) ---{ --- crypto_free_aead(tfm); ---} ----- a/net/mac80211/aes_gmac.h --+++ /dev/null --@@ -1,20 +0,0 @@ ---/* --- * Copyright 2015, Qualcomm Atheros, Inc. --- * --- * 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. --- */ --- ---#ifndef AES_GMAC_H ---#define AES_GMAC_H --- ---#include --- ---struct crypto_aead *ieee80211_aes_gmac_key_setup(const u8 key[], --- size_t key_len); ---int ieee80211_aes_gmac(struct crypto_aead *tfm, const u8 *aad, u8 *nonce, --- const u8 *data, size_t data_len, u8 *mic); ---void ieee80211_aes_gmac_key_free(struct crypto_aead *tfm); --- ---#endif /* AES_GMAC_H */ ----- a/net/mac80211/cfg.c --+++ b/net/mac80211/cfg.c --@@ -162,13 +162,8 @@ static int ieee80211_add_key(struct wiph -- return -EINVAL; -- break; -- case WLAN_CIPHER_SUITE_CCMP: --- case WLAN_CIPHER_SUITE_CCMP_256: -- case WLAN_CIPHER_SUITE_AES_CMAC: --- case WLAN_CIPHER_SUITE_BIP_CMAC_256: --- case WLAN_CIPHER_SUITE_BIP_GMAC_128: --- case WLAN_CIPHER_SUITE_BIP_GMAC_256: -- case WLAN_CIPHER_SUITE_GCMP: --- case WLAN_CIPHER_SUITE_GCMP_256: -- break; -- default: -- cs = ieee80211_cs_get(local, params->cipher, sdata->vif.type); --@@ -353,7 +348,6 @@ static int ieee80211_get_key(struct wiph -- params.seq_len = 6; -- break; -- case WLAN_CIPHER_SUITE_CCMP: --- case WLAN_CIPHER_SUITE_CCMP_256: -- pn64 = atomic64_read(&key->u.ccmp.tx_pn); -- seq[0] = pn64; -- seq[1] = pn64 >> 8; --@@ -365,35 +359,10 @@ static int ieee80211_get_key(struct wiph -- params.seq_len = 6; -- break; -- case WLAN_CIPHER_SUITE_AES_CMAC: --- case WLAN_CIPHER_SUITE_BIP_CMAC_256: -- pn64 = atomic64_read(&key->u.aes_cmac.tx_pn); -- seq[0] = pn64; -- seq[1] = pn64 >> 8; -- seq[2] = pn64 >> 16; --- seq[3] = pn64 >> 24; --- seq[4] = pn64 >> 32; --- seq[5] = pn64 >> 40; --- params.seq = seq; --- params.seq_len = 6; --- break; --- case WLAN_CIPHER_SUITE_BIP_GMAC_128: --- case WLAN_CIPHER_SUITE_BIP_GMAC_256: --- pn64 = atomic64_read(&key->u.aes_gmac.tx_pn); --- seq[0] = pn64; --- seq[1] = pn64 >> 8; --- seq[2] = pn64 >> 16; --- seq[3] = pn64 >> 24; --- seq[4] = pn64 >> 32; --- seq[5] = pn64 >> 40; --- params.seq = seq; --- params.seq_len = 6; --- break; --- case WLAN_CIPHER_SUITE_GCMP: --- case WLAN_CIPHER_SUITE_GCMP_256: --- pn64 = atomic64_read(&key->u.gcmp.tx_pn); --- seq[0] = pn64; --- seq[1] = pn64 >> 8; --- seq[2] = pn64 >> 16; -- seq[3] = pn64 >> 24; -- seq[4] = pn64 >> 32; -- seq[5] = pn64 >> 40; ----- a/net/mac80211/debugfs_key.c --+++ b/net/mac80211/debugfs_key.c --@@ -94,33 +94,17 @@ static ssize_t key_tx_spec_read(struct f -- key->u.tkip.tx.iv16); -- break; -- case WLAN_CIPHER_SUITE_CCMP: --- case WLAN_CIPHER_SUITE_CCMP_256: -- pn = atomic64_read(&key->u.ccmp.tx_pn); -- len = scnprintf(buf, sizeof(buf), "%02x%02x%02x%02x%02x%02x\n", -- (u8)(pn >> 40), (u8)(pn >> 32), (u8)(pn >> 24), -- (u8)(pn >> 16), (u8)(pn >> 8), (u8)pn); -- break; -- case WLAN_CIPHER_SUITE_AES_CMAC: --- case WLAN_CIPHER_SUITE_BIP_CMAC_256: -- pn = atomic64_read(&key->u.aes_cmac.tx_pn); -- len = scnprintf(buf, sizeof(buf), "%02x%02x%02x%02x%02x%02x\n", -- (u8)(pn >> 40), (u8)(pn >> 32), (u8)(pn >> 24), -- (u8)(pn >> 16), (u8)(pn >> 8), (u8)pn); -- break; --- case WLAN_CIPHER_SUITE_BIP_GMAC_128: --- case WLAN_CIPHER_SUITE_BIP_GMAC_256: --- pn = atomic64_read(&key->u.aes_gmac.tx_pn); --- len = scnprintf(buf, sizeof(buf), "%02x%02x%02x%02x%02x%02x\n", --- (u8)(pn >> 40), (u8)(pn >> 32), (u8)(pn >> 24), --- (u8)(pn >> 16), (u8)(pn >> 8), (u8)pn); --- break; --- case WLAN_CIPHER_SUITE_GCMP: --- case WLAN_CIPHER_SUITE_GCMP_256: --- pn = atomic64_read(&key->u.gcmp.tx_pn); --- len = scnprintf(buf, sizeof(buf), "%02x%02x%02x%02x%02x%02x\n", --- (u8)(pn >> 40), (u8)(pn >> 32), (u8)(pn >> 24), --- (u8)(pn >> 16), (u8)(pn >> 8), (u8)pn); --- break; -- default: -- return 0; -- } --@@ -150,7 +134,6 @@ static ssize_t key_rx_spec_read(struct f -- len = p - buf; -- break; -- case WLAN_CIPHER_SUITE_CCMP: --- case WLAN_CIPHER_SUITE_CCMP_256: -- for (i = 0; i < IEEE80211_NUM_TIDS + 1; i++) { -- rpn = key->u.ccmp.rx_pn[i]; -- p += scnprintf(p, sizeof(buf)+buf-p, --@@ -161,7 +144,6 @@ static ssize_t key_rx_spec_read(struct f -- len = p - buf; -- break; -- case WLAN_CIPHER_SUITE_AES_CMAC: --- case WLAN_CIPHER_SUITE_BIP_CMAC_256: -- rpn = key->u.aes_cmac.rx_pn; -- p += scnprintf(p, sizeof(buf)+buf-p, -- "%02x%02x%02x%02x%02x%02x\n", --@@ -169,26 +151,6 @@ static ssize_t key_rx_spec_read(struct f -- rpn[3], rpn[4], rpn[5]); -- len = p - buf; -- break; --- case WLAN_CIPHER_SUITE_BIP_GMAC_128: --- case WLAN_CIPHER_SUITE_BIP_GMAC_256: --- rpn = key->u.aes_gmac.rx_pn; --- p += scnprintf(p, sizeof(buf)+buf-p, --- "%02x%02x%02x%02x%02x%02x\n", --- rpn[0], rpn[1], rpn[2], --- rpn[3], rpn[4], rpn[5]); --- len = p - buf; --- break; --- case WLAN_CIPHER_SUITE_GCMP: --- case WLAN_CIPHER_SUITE_GCMP_256: --- for (i = 0; i < IEEE80211_NUM_TIDS + 1; i++) { --- rpn = key->u.gcmp.rx_pn[i]; --- p += scnprintf(p, sizeof(buf)+buf-p, --- "%02x%02x%02x%02x%02x%02x\n", --- rpn[0], rpn[1], rpn[2], --- rpn[3], rpn[4], rpn[5]); --- } --- len = p - buf; --- break; -- default: -- return 0; -- } --@@ -205,23 +167,12 @@ static ssize_t key_replays_read(struct f -- -- switch (key->conf.cipher) { -- case WLAN_CIPHER_SUITE_CCMP: --- case WLAN_CIPHER_SUITE_CCMP_256: -- len = scnprintf(buf, sizeof(buf), "%u\n", key->u.ccmp.replays); -- break; -- case WLAN_CIPHER_SUITE_AES_CMAC: --- case WLAN_CIPHER_SUITE_BIP_CMAC_256: -- len = scnprintf(buf, sizeof(buf), "%u\n", -- key->u.aes_cmac.replays); -- break; --- case WLAN_CIPHER_SUITE_BIP_GMAC_128: --- case WLAN_CIPHER_SUITE_BIP_GMAC_256: --- len = scnprintf(buf, sizeof(buf), "%u\n", --- key->u.aes_gmac.replays); --- break; --- case WLAN_CIPHER_SUITE_GCMP: --- case WLAN_CIPHER_SUITE_GCMP_256: --- len = scnprintf(buf, sizeof(buf), "%u\n", key->u.gcmp.replays); --- break; -- default: -- return 0; -- } --@@ -238,15 +189,9 @@ static ssize_t key_icverrors_read(struct -- -- switch (key->conf.cipher) { -- case WLAN_CIPHER_SUITE_AES_CMAC: --- case WLAN_CIPHER_SUITE_BIP_CMAC_256: -- len = scnprintf(buf, sizeof(buf), "%u\n", -- key->u.aes_cmac.icverrors); -- break; --- case WLAN_CIPHER_SUITE_BIP_GMAC_128: --- case WLAN_CIPHER_SUITE_BIP_GMAC_256: --- len = scnprintf(buf, sizeof(buf), "%u\n", --- key->u.aes_gmac.icverrors); --- break; -- default: -- return 0; -- } ----- a/net/mac80211/key.c --+++ b/net/mac80211/key.c --@@ -24,8 +24,6 @@ -- #include "debugfs_key.h" -- #include "aes_ccm.h" -- #include "aes_cmac.h" ---#include "aes_gmac.h" ---#include "aes_gcm.h" -- -- -- /** --@@ -164,13 +162,7 @@ static int ieee80211_key_enable_hw_accel -- case WLAN_CIPHER_SUITE_WEP104: -- case WLAN_CIPHER_SUITE_TKIP: -- case WLAN_CIPHER_SUITE_CCMP: --- case WLAN_CIPHER_SUITE_CCMP_256: -- case WLAN_CIPHER_SUITE_AES_CMAC: --- case WLAN_CIPHER_SUITE_BIP_CMAC_256: --- case WLAN_CIPHER_SUITE_BIP_GMAC_128: --- case WLAN_CIPHER_SUITE_BIP_GMAC_256: --- case WLAN_CIPHER_SUITE_GCMP: --- case WLAN_CIPHER_SUITE_GCMP_256: -- /* all of these we can do in software - if driver can */ -- if (ret == 1) -- return 0; --@@ -394,26 +386,7 @@ ieee80211_key_alloc(u32 cipher, int idx, -- * Initialize AES key state here as an optimization so that -- * it does not need to be initialized for every packet. -- */ --- key->u.ccmp.tfm = ieee80211_aes_key_setup_encrypt( --- key_data, key_len, IEEE80211_CCMP_MIC_LEN); --- if (IS_ERR(key->u.ccmp.tfm)) { --- err = PTR_ERR(key->u.ccmp.tfm); --- kfree(key); --- return ERR_PTR(err); --- } --- break; --- case WLAN_CIPHER_SUITE_CCMP_256: --- key->conf.iv_len = IEEE80211_CCMP_256_HDR_LEN; --- key->conf.icv_len = IEEE80211_CCMP_256_MIC_LEN; --- for (i = 0; seq && i < IEEE80211_NUM_TIDS + 1; i++) --- for (j = 0; j < IEEE80211_CCMP_256_PN_LEN; j++) --- key->u.ccmp.rx_pn[i][j] = --- seq[IEEE80211_CCMP_256_PN_LEN - j - 1]; --- /* Initialize AES key state here as an optimization so that --- * it does not need to be initialized for every packet. --- */ --- key->u.ccmp.tfm = ieee80211_aes_key_setup_encrypt( --- key_data, key_len, IEEE80211_CCMP_256_MIC_LEN); --+ key->u.ccmp.tfm = ieee80211_aes_key_setup_encrypt(key_data); -- if (IS_ERR(key->u.ccmp.tfm)) { -- err = PTR_ERR(key->u.ccmp.tfm); -- kfree(key); --@@ -421,12 +394,8 @@ ieee80211_key_alloc(u32 cipher, int idx, -- } -- break; -- case WLAN_CIPHER_SUITE_AES_CMAC: --- case WLAN_CIPHER_SUITE_BIP_CMAC_256: -- key->conf.iv_len = 0; --- if (cipher == WLAN_CIPHER_SUITE_AES_CMAC) --- key->conf.icv_len = sizeof(struct ieee80211_mmie); --- else --- key->conf.icv_len = sizeof(struct ieee80211_mmie_16); --+ key->conf.icv_len = sizeof(struct ieee80211_mmie); -- if (seq) -- for (j = 0; j < IEEE80211_CMAC_PN_LEN; j++) -- key->u.aes_cmac.rx_pn[j] = --@@ -436,51 +405,13 @@ ieee80211_key_alloc(u32 cipher, int idx, -- * it does not need to be initialized for every packet. -- */ -- key->u.aes_cmac.tfm = --- ieee80211_aes_cmac_key_setup(key_data, key_len); --+ ieee80211_aes_cmac_key_setup(key_data); -- if (IS_ERR(key->u.aes_cmac.tfm)) { -- err = PTR_ERR(key->u.aes_cmac.tfm); -- kfree(key); -- return ERR_PTR(err); -- } -- break; --- case WLAN_CIPHER_SUITE_BIP_GMAC_128: --- case WLAN_CIPHER_SUITE_BIP_GMAC_256: --- key->conf.iv_len = 0; --- key->conf.icv_len = sizeof(struct ieee80211_mmie_16); --- if (seq) --- for (j = 0; j < IEEE80211_GMAC_PN_LEN; j++) --- key->u.aes_gmac.rx_pn[j] = --- seq[IEEE80211_GMAC_PN_LEN - j - 1]; --- /* Initialize AES key state here as an optimization so that --- * it does not need to be initialized for every packet. --- */ --- key->u.aes_gmac.tfm = --- ieee80211_aes_gmac_key_setup(key_data, key_len); --- if (IS_ERR(key->u.aes_gmac.tfm)) { --- err = PTR_ERR(key->u.aes_gmac.tfm); --- kfree(key); --- return ERR_PTR(err); --- } --- break; --- case WLAN_CIPHER_SUITE_GCMP: --- case WLAN_CIPHER_SUITE_GCMP_256: --- key->conf.iv_len = IEEE80211_GCMP_HDR_LEN; --- key->conf.icv_len = IEEE80211_GCMP_MIC_LEN; --- for (i = 0; seq && i < IEEE80211_NUM_TIDS + 1; i++) --- for (j = 0; j < IEEE80211_GCMP_PN_LEN; j++) --- key->u.gcmp.rx_pn[i][j] = --- seq[IEEE80211_GCMP_PN_LEN - j - 1]; --- /* Initialize AES key state here as an optimization so that --- * it does not need to be initialized for every packet. --- */ --- key->u.gcmp.tfm = ieee80211_aes_gcm_key_setup_encrypt(key_data, --- key_len); --- if (IS_ERR(key->u.gcmp.tfm)) { --- err = PTR_ERR(key->u.gcmp.tfm); --- kfree(key); --- return ERR_PTR(err); --- } --- break; -- default: -- if (cs) { -- size_t len = (seq_len > MAX_PN_LEN) ? --@@ -502,24 +433,10 @@ ieee80211_key_alloc(u32 cipher, int idx, -- -- static void ieee80211_key_free_common(struct ieee80211_key *key) -- { --- switch (key->conf.cipher) { --- case WLAN_CIPHER_SUITE_CCMP: --- case WLAN_CIPHER_SUITE_CCMP_256: --+ if (key->conf.cipher == WLAN_CIPHER_SUITE_CCMP) -- ieee80211_aes_key_free(key->u.ccmp.tfm); --- break; --- case WLAN_CIPHER_SUITE_AES_CMAC: --- case WLAN_CIPHER_SUITE_BIP_CMAC_256: --+ if (key->conf.cipher == WLAN_CIPHER_SUITE_AES_CMAC) -- ieee80211_aes_cmac_key_free(key->u.aes_cmac.tfm); --- break; --- case WLAN_CIPHER_SUITE_BIP_GMAC_128: --- case WLAN_CIPHER_SUITE_BIP_GMAC_256: --- ieee80211_aes_gmac_key_free(key->u.aes_gmac.tfm); --- break; --- case WLAN_CIPHER_SUITE_GCMP: --- case WLAN_CIPHER_SUITE_GCMP_256: --- ieee80211_aes_gcm_key_free(key->u.gcmp.tfm); --- break; --- } -- kzfree(key); -- } -- --@@ -826,7 +743,6 @@ void ieee80211_get_key_tx_seq(struct iee -- seq->tkip.iv16 = key->u.tkip.tx.iv16; -- break; -- case WLAN_CIPHER_SUITE_CCMP: --- case WLAN_CIPHER_SUITE_CCMP_256: -- pn64 = atomic64_read(&key->u.ccmp.tx_pn); -- seq->ccmp.pn[5] = pn64; -- seq->ccmp.pn[4] = pn64 >> 8; --@@ -836,7 +752,6 @@ void ieee80211_get_key_tx_seq(struct iee -- seq->ccmp.pn[0] = pn64 >> 40; -- break; -- case WLAN_CIPHER_SUITE_AES_CMAC: --- case WLAN_CIPHER_SUITE_BIP_CMAC_256: -- pn64 = atomic64_read(&key->u.aes_cmac.tx_pn); -- seq->ccmp.pn[5] = pn64; -- seq->ccmp.pn[4] = pn64 >> 8; --@@ -845,26 +760,6 @@ void ieee80211_get_key_tx_seq(struct iee -- seq->ccmp.pn[1] = pn64 >> 32; -- seq->ccmp.pn[0] = pn64 >> 40; -- break; --- case WLAN_CIPHER_SUITE_BIP_GMAC_128: --- case WLAN_CIPHER_SUITE_BIP_GMAC_256: --- pn64 = atomic64_read(&key->u.aes_gmac.tx_pn); --- seq->ccmp.pn[5] = pn64; --- seq->ccmp.pn[4] = pn64 >> 8; --- seq->ccmp.pn[3] = pn64 >> 16; --- seq->ccmp.pn[2] = pn64 >> 24; --- seq->ccmp.pn[1] = pn64 >> 32; --- seq->ccmp.pn[0] = pn64 >> 40; --- break; --- case WLAN_CIPHER_SUITE_GCMP: --- case WLAN_CIPHER_SUITE_GCMP_256: --- pn64 = atomic64_read(&key->u.gcmp.tx_pn); --- seq->gcmp.pn[5] = pn64; --- seq->gcmp.pn[4] = pn64 >> 8; --- seq->gcmp.pn[3] = pn64 >> 16; --- seq->gcmp.pn[2] = pn64 >> 24; --- seq->gcmp.pn[1] = pn64 >> 32; --- seq->gcmp.pn[0] = pn64 >> 40; --- break; -- default: -- WARN_ON(1); -- } --@@ -887,7 +782,6 @@ void ieee80211_get_key_rx_seq(struct iee -- seq->tkip.iv16 = key->u.tkip.rx[tid].iv16; -- break; -- case WLAN_CIPHER_SUITE_CCMP: --- case WLAN_CIPHER_SUITE_CCMP_256: -- if (WARN_ON(tid < -1 || tid >= IEEE80211_NUM_TIDS)) -- return; -- if (tid < 0) --@@ -897,29 +791,11 @@ void ieee80211_get_key_rx_seq(struct iee -- memcpy(seq->ccmp.pn, pn, IEEE80211_CCMP_PN_LEN); -- break; -- case WLAN_CIPHER_SUITE_AES_CMAC: --- case WLAN_CIPHER_SUITE_BIP_CMAC_256: -- if (WARN_ON(tid != 0)) -- return; -- pn = key->u.aes_cmac.rx_pn; -- memcpy(seq->aes_cmac.pn, pn, IEEE80211_CMAC_PN_LEN); -- break; --- case WLAN_CIPHER_SUITE_BIP_GMAC_128: --- case WLAN_CIPHER_SUITE_BIP_GMAC_256: --- if (WARN_ON(tid != 0)) --- return; --- pn = key->u.aes_gmac.rx_pn; --- memcpy(seq->aes_gmac.pn, pn, IEEE80211_GMAC_PN_LEN); --- break; --- case WLAN_CIPHER_SUITE_GCMP: --- case WLAN_CIPHER_SUITE_GCMP_256: --- if (WARN_ON(tid < -1 || tid >= IEEE80211_NUM_TIDS)) --- return; --- if (tid < 0) --- pn = key->u.gcmp.rx_pn[IEEE80211_NUM_TIDS]; --- else --- pn = key->u.gcmp.rx_pn[tid]; --- memcpy(seq->gcmp.pn, pn, IEEE80211_GCMP_PN_LEN); --- break; -- } -- } -- EXPORT_SYMBOL(ieee80211_get_key_rx_seq); --@@ -938,7 +814,6 @@ void ieee80211_set_key_tx_seq(struct iee -- key->u.tkip.tx.iv16 = seq->tkip.iv16; -- break; -- case WLAN_CIPHER_SUITE_CCMP: --- case WLAN_CIPHER_SUITE_CCMP_256: -- pn64 = (u64)seq->ccmp.pn[5] | -- ((u64)seq->ccmp.pn[4] << 8) | -- ((u64)seq->ccmp.pn[3] << 16) | --@@ -948,7 +823,6 @@ void ieee80211_set_key_tx_seq(struct iee -- atomic64_set(&key->u.ccmp.tx_pn, pn64); -- break; -- case WLAN_CIPHER_SUITE_AES_CMAC: --- case WLAN_CIPHER_SUITE_BIP_CMAC_256: -- pn64 = (u64)seq->aes_cmac.pn[5] | -- ((u64)seq->aes_cmac.pn[4] << 8) | -- ((u64)seq->aes_cmac.pn[3] << 16) | --@@ -957,26 +831,6 @@ void ieee80211_set_key_tx_seq(struct iee -- ((u64)seq->aes_cmac.pn[0] << 40); -- atomic64_set(&key->u.aes_cmac.tx_pn, pn64); -- break; --- case WLAN_CIPHER_SUITE_BIP_GMAC_128: --- case WLAN_CIPHER_SUITE_BIP_GMAC_256: --- pn64 = (u64)seq->aes_gmac.pn[5] | --- ((u64)seq->aes_gmac.pn[4] << 8) | --- ((u64)seq->aes_gmac.pn[3] << 16) | --- ((u64)seq->aes_gmac.pn[2] << 24) | --- ((u64)seq->aes_gmac.pn[1] << 32) | --- ((u64)seq->aes_gmac.pn[0] << 40); --- atomic64_set(&key->u.aes_gmac.tx_pn, pn64); --- break; --- case WLAN_CIPHER_SUITE_GCMP: --- case WLAN_CIPHER_SUITE_GCMP_256: --- pn64 = (u64)seq->gcmp.pn[5] | --- ((u64)seq->gcmp.pn[4] << 8) | --- ((u64)seq->gcmp.pn[3] << 16) | --- ((u64)seq->gcmp.pn[2] << 24) | --- ((u64)seq->gcmp.pn[1] << 32) | --- ((u64)seq->gcmp.pn[0] << 40); --- atomic64_set(&key->u.gcmp.tx_pn, pn64); --- break; -- default: -- WARN_ON(1); -- break; --@@ -1000,7 +854,6 @@ void ieee80211_set_key_rx_seq(struct iee -- key->u.tkip.rx[tid].iv16 = seq->tkip.iv16; -- break; -- case WLAN_CIPHER_SUITE_CCMP: --- case WLAN_CIPHER_SUITE_CCMP_256: -- if (WARN_ON(tid < -1 || tid >= IEEE80211_NUM_TIDS)) -- return; -- if (tid < 0) --@@ -1010,29 +863,11 @@ void ieee80211_set_key_rx_seq(struct iee -- memcpy(pn, seq->ccmp.pn, IEEE80211_CCMP_PN_LEN); -- break; -- case WLAN_CIPHER_SUITE_AES_CMAC: --- case WLAN_CIPHER_SUITE_BIP_CMAC_256: -- if (WARN_ON(tid != 0)) -- return; -- pn = key->u.aes_cmac.rx_pn; -- memcpy(pn, seq->aes_cmac.pn, IEEE80211_CMAC_PN_LEN); -- break; --- case WLAN_CIPHER_SUITE_BIP_GMAC_128: --- case WLAN_CIPHER_SUITE_BIP_GMAC_256: --- if (WARN_ON(tid != 0)) --- return; --- pn = key->u.aes_gmac.rx_pn; --- memcpy(pn, seq->aes_gmac.pn, IEEE80211_GMAC_PN_LEN); --- break; --- case WLAN_CIPHER_SUITE_GCMP: --- case WLAN_CIPHER_SUITE_GCMP_256: --- if (WARN_ON(tid < -1 || tid >= IEEE80211_NUM_TIDS)) --- return; --- if (tid < 0) --- pn = key->u.gcmp.rx_pn[IEEE80211_NUM_TIDS]; --- else --- pn = key->u.gcmp.rx_pn[tid]; --- memcpy(pn, seq->gcmp.pn, IEEE80211_GCMP_PN_LEN); --- break; -- default: -- WARN_ON(1); -- break; ----- a/net/mac80211/key.h --+++ b/net/mac80211/key.h --@@ -84,7 +84,7 @@ struct ieee80211_key { -- * Management frames. -- */ -- u8 rx_pn[IEEE80211_NUM_TIDS + 1][IEEE80211_CCMP_PN_LEN]; --- struct crypto_aead *tfm; --+ struct crypto_cipher *tfm; -- u32 replays; /* dot11RSNAStatsCCMPReplays */ -- } ccmp; -- struct { --@@ -95,24 +95,6 @@ struct ieee80211_key { -- u32 icverrors; /* dot11RSNAStatsCMACICVErrors */ -- } aes_cmac; -- struct { --- atomic64_t tx_pn; --- u8 rx_pn[IEEE80211_GMAC_PN_LEN]; --- struct crypto_aead *tfm; --- u32 replays; /* dot11RSNAStatsCMACReplays */ --- u32 icverrors; /* dot11RSNAStatsCMACICVErrors */ --- } aes_gmac; --- struct { --- atomic64_t tx_pn; --- /* Last received packet number. The first --- * IEEE80211_NUM_TIDS counters are used with Data --- * frames and the last counter is used with Robust --- * Management frames. --- */ --- u8 rx_pn[IEEE80211_NUM_TIDS + 1][IEEE80211_GCMP_PN_LEN]; --- struct crypto_aead *tfm; --- u32 replays; /* dot11RSNAStatsGCMPReplays */ --- } gcmp; --- struct { -- /* generic cipher scheme */ -- u8 rx_pn[IEEE80211_NUM_TIDS + 1][MAX_PN_LEN]; -- } gen; ----- a/net/mac80211/main.c --+++ b/net/mac80211/main.c --@@ -666,15 +666,9 @@ static int ieee80211_init_cipher_suites( -- WLAN_CIPHER_SUITE_WEP104, -- WLAN_CIPHER_SUITE_TKIP, -- WLAN_CIPHER_SUITE_CCMP, --- WLAN_CIPHER_SUITE_CCMP_256, --- WLAN_CIPHER_SUITE_GCMP, --- WLAN_CIPHER_SUITE_GCMP_256, -- -- /* keep last -- depends on hw flags! */ --- WLAN_CIPHER_SUITE_AES_CMAC, --- WLAN_CIPHER_SUITE_BIP_CMAC_256, --- WLAN_CIPHER_SUITE_BIP_GMAC_128, --- WLAN_CIPHER_SUITE_BIP_GMAC_256, --+ WLAN_CIPHER_SUITE_AES_CMAC -- }; -- -- if (local->hw.flags & IEEE80211_HW_SW_CRYPTO_CONTROL || --@@ -713,7 +707,7 @@ static int ieee80211_init_cipher_suites( -- local->hw.wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites); -- -- if (!have_mfp) --- local->hw.wiphy->n_cipher_suites -= 4; --+ local->hw.wiphy->n_cipher_suites--; -- -- if (!have_wep) { -- local->hw.wiphy->cipher_suites += 2; --@@ -730,42 +724,32 @@ static int ieee80211_init_cipher_suites( -- /* Driver specifies cipher schemes only (but not cipher suites -- * including the schemes) -- * --- * We start counting ciphers defined by schemes, TKIP, CCMP, --- * CCMP-256, GCMP, and GCMP-256 --+ * We start counting ciphers defined by schemes, TKIP and CCMP -- */ --- n_suites = local->hw.n_cipher_schemes + 5; --+ n_suites = local->hw.n_cipher_schemes + 2; -- -- /* check if we have WEP40 and WEP104 */ -- if (have_wep) -- n_suites += 2; -- --- /* check if we have AES_CMAC, BIP-CMAC-256, BIP-GMAC-128, --- * BIP-GMAC-256 --- */ --+ /* check if we have AES_CMAC */ -- if (have_mfp) --- n_suites += 4; --+ n_suites++; -- -- suites = kmalloc(sizeof(u32) * n_suites, GFP_KERNEL); -- if (!suites) -- return -ENOMEM; -- -- suites[w++] = WLAN_CIPHER_SUITE_CCMP; --- suites[w++] = WLAN_CIPHER_SUITE_CCMP_256; -- suites[w++] = WLAN_CIPHER_SUITE_TKIP; --- suites[w++] = WLAN_CIPHER_SUITE_GCMP; --- suites[w++] = WLAN_CIPHER_SUITE_GCMP_256; -- -- if (have_wep) { -- suites[w++] = WLAN_CIPHER_SUITE_WEP40; -- suites[w++] = WLAN_CIPHER_SUITE_WEP104; -- } -- --- if (have_mfp) { --+ if (have_mfp) -- suites[w++] = WLAN_CIPHER_SUITE_AES_CMAC; --- suites[w++] = WLAN_CIPHER_SUITE_BIP_CMAC_256; --- suites[w++] = WLAN_CIPHER_SUITE_BIP_GMAC_128; --- suites[w++] = WLAN_CIPHER_SUITE_BIP_GMAC_256; --- } -- -- for (r = 0; r < local->hw.n_cipher_schemes; r++) -- suites[w++] = cs[r].cipher; ----- a/net/mac80211/rx.c --+++ b/net/mac80211/rx.c --@@ -647,7 +647,6 @@ static int ieee80211_get_mmie_keyidx(str -- { -- struct ieee80211_mgmt *hdr = (struct ieee80211_mgmt *) skb->data; -- struct ieee80211_mmie *mmie; --- struct ieee80211_mmie_16 *mmie16; -- -- if (skb->len < 24 + sizeof(*mmie) || !is_multicast_ether_addr(hdr->da)) -- return -1; --@@ -657,18 +656,11 @@ static int ieee80211_get_mmie_keyidx(str -- -- mmie = (struct ieee80211_mmie *) -- (skb->data + skb->len - sizeof(*mmie)); --- if (mmie->element_id == WLAN_EID_MMIE && --- mmie->length == sizeof(*mmie) - 2) --- return le16_to_cpu(mmie->key_id); --- --- mmie16 = (struct ieee80211_mmie_16 *) --- (skb->data + skb->len - sizeof(*mmie16)); --- if (skb->len >= 24 + sizeof(*mmie16) && --- mmie16->element_id == WLAN_EID_MMIE && --- mmie16->length == sizeof(*mmie16) - 2) --- return le16_to_cpu(mmie16->key_id); --+ if (mmie->element_id != WLAN_EID_MMIE || --+ mmie->length != sizeof(*mmie) - 2) --+ return -1; -- --- return -1; --+ return le16_to_cpu(mmie->key_id); -- } -- -- static int iwl80211_get_cs_keyid(const struct ieee80211_cipher_scheme *cs, --@@ -1658,27 +1650,11 @@ ieee80211_rx_h_decrypt(struct ieee80211_ -- result = ieee80211_crypto_tkip_decrypt(rx); -- break; -- case WLAN_CIPHER_SUITE_CCMP: --- result = ieee80211_crypto_ccmp_decrypt( --- rx, IEEE80211_CCMP_MIC_LEN); --- break; --- case WLAN_CIPHER_SUITE_CCMP_256: --- result = ieee80211_crypto_ccmp_decrypt( --- rx, IEEE80211_CCMP_256_MIC_LEN); --+ result = ieee80211_crypto_ccmp_decrypt(rx); -- break; -- case WLAN_CIPHER_SUITE_AES_CMAC: -- result = ieee80211_crypto_aes_cmac_decrypt(rx); -- break; --- case WLAN_CIPHER_SUITE_BIP_CMAC_256: --- result = ieee80211_crypto_aes_cmac_256_decrypt(rx); --- break; --- case WLAN_CIPHER_SUITE_BIP_GMAC_128: --- case WLAN_CIPHER_SUITE_BIP_GMAC_256: --- result = ieee80211_crypto_aes_gmac_decrypt(rx); --- break; --- case WLAN_CIPHER_SUITE_GCMP: --- case WLAN_CIPHER_SUITE_GCMP_256: --- result = ieee80211_crypto_gcmp_decrypt(rx); --- break; -- default: -- result = ieee80211_crypto_hw_decrypt(rx); -- } --@@ -1805,9 +1781,7 @@ ieee80211_rx_h_defragment(struct ieee802 -- /* This is the first fragment of a new frame. */ -- entry = ieee80211_reassemble_add(rx->sdata, frag, seq, -- rx->seqno_idx, &(rx->skb)); --- if (rx->key && --- (rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP || --- rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP_256) && --+ if (rx->key && rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP && -- ieee80211_has_protected(fc)) { -- int queue = rx->security_idx; -- /* Store CCMP PN so that we can verify that the next --@@ -1836,9 +1810,7 @@ ieee80211_rx_h_defragment(struct ieee802 -- int i; -- u8 pn[IEEE80211_CCMP_PN_LEN], *rpn; -- int queue; --- if (!rx->key || --- (rx->key->conf.cipher != WLAN_CIPHER_SUITE_CCMP && --- rx->key->conf.cipher != WLAN_CIPHER_SUITE_CCMP_256)) --+ if (!rx->key || rx->key->conf.cipher != WLAN_CIPHER_SUITE_CCMP) -- return RX_DROP_UNUSABLE; -- memcpy(pn, entry->last_pn, IEEE80211_CCMP_PN_LEN); -- for (i = IEEE80211_CCMP_PN_LEN - 1; i >= 0; i--) { ----- a/net/mac80211/tx.c --+++ b/net/mac80211/tx.c --@@ -626,9 +626,6 @@ ieee80211_tx_h_select_key(struct ieee802 -- tx->key = NULL; -- break; -- case WLAN_CIPHER_SUITE_CCMP: --- case WLAN_CIPHER_SUITE_CCMP_256: --- case WLAN_CIPHER_SUITE_GCMP: --- case WLAN_CIPHER_SUITE_GCMP_256: -- if (!ieee80211_is_data_present(hdr->frame_control) && -- !ieee80211_use_mfp(hdr->frame_control, tx->sta, -- tx->skb)) --@@ -639,9 +636,6 @@ ieee80211_tx_h_select_key(struct ieee802 -- ieee80211_is_mgmt(hdr->frame_control); -- break; -- case WLAN_CIPHER_SUITE_AES_CMAC: --- case WLAN_CIPHER_SUITE_BIP_CMAC_256: --- case WLAN_CIPHER_SUITE_BIP_GMAC_128: --- case WLAN_CIPHER_SUITE_BIP_GMAC_256: -- if (!ieee80211_is_mgmt(hdr->frame_control)) -- tx->key = NULL; -- break; --@@ -1017,21 +1011,9 @@ ieee80211_tx_h_encrypt(struct ieee80211_ -- case WLAN_CIPHER_SUITE_TKIP: -- return ieee80211_crypto_tkip_encrypt(tx); -- case WLAN_CIPHER_SUITE_CCMP: --- return ieee80211_crypto_ccmp_encrypt( --- tx, IEEE80211_CCMP_MIC_LEN); --- case WLAN_CIPHER_SUITE_CCMP_256: --- return ieee80211_crypto_ccmp_encrypt( --- tx, IEEE80211_CCMP_256_MIC_LEN); --+ return ieee80211_crypto_ccmp_encrypt(tx); -- case WLAN_CIPHER_SUITE_AES_CMAC: -- return ieee80211_crypto_aes_cmac_encrypt(tx); --- case WLAN_CIPHER_SUITE_BIP_CMAC_256: --- return ieee80211_crypto_aes_cmac_256_encrypt(tx); --- case WLAN_CIPHER_SUITE_BIP_GMAC_128: --- case WLAN_CIPHER_SUITE_BIP_GMAC_256: --- return ieee80211_crypto_aes_gmac_encrypt(tx); --- case WLAN_CIPHER_SUITE_GCMP: --- case WLAN_CIPHER_SUITE_GCMP_256: --- return ieee80211_crypto_gcmp_encrypt(tx); -- default: -- return ieee80211_crypto_hw_encrypt(tx); -- } ----- a/net/mac80211/wpa.c --+++ b/net/mac80211/wpa.c --@@ -22,8 +22,6 @@ -- #include "tkip.h" -- #include "aes_ccm.h" -- #include "aes_cmac.h" ---#include "aes_gmac.h" ---#include "aes_gcm.h" -- #include "wpa.h" -- -- ieee80211_tx_result --@@ -304,15 +302,22 @@ ieee80211_crypto_tkip_decrypt(struct iee -- } -- -- ---static void ccmp_special_blocks(struct sk_buff *skb, u8 *pn, u8 *b_0, u8 *aad) --+static void ccmp_special_blocks(struct sk_buff *skb, u8 *pn, u8 *scratch, --+ int encrypted) -- { -- __le16 mask_fc; -- int a4_included, mgmt; -- u8 qos_tid; --- u16 len_a; --+ u8 *b_0, *aad; --+ u16 data_len, len_a; -- unsigned int hdrlen; -- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; -- --+ memset(scratch, 0, 6 * AES_BLOCK_SIZE); --+ --+ b_0 = scratch + 3 * AES_BLOCK_SIZE; --+ aad = scratch + 4 * AES_BLOCK_SIZE; --+ -- /* -- * Mask FC: zero subtype b4 b5 b6 (if not mgmt) -- * Retry, PwrMgt, MoreData; set Protected --@@ -334,21 +339,20 @@ static void ccmp_special_blocks(struct s -- else -- qos_tid = 0; -- --- /* In CCM, the initial vectors (IV) used for CTR mode encryption and CBC --- * mode authentication are not allowed to collide, yet both are derived --- * from this vector b_0. We only set L := 1 here to indicate that the --- * data size can be represented in (L+1) bytes. The CCM layer will take --- * care of storing the data length in the top (L+1) bytes and setting --- * and clearing the other bits as is required to derive the two IVs. --- */ --- b_0[0] = 0x1; --+ data_len = skb->len - hdrlen - IEEE80211_CCMP_HDR_LEN; --+ if (encrypted) --+ data_len -= IEEE80211_CCMP_MIC_LEN; -- --+ /* First block, b_0 */ --+ b_0[0] = 0x59; /* flags: Adata: 1, M: 011, L: 001 */ -- /* Nonce: Nonce Flags | A2 | PN -- * Nonce Flags: Priority (b0..b3) | Management (b4) | Reserved (b5..b7) -- */ -- b_0[1] = qos_tid | (mgmt << 4); -- memcpy(&b_0[2], hdr->addr2, ETH_ALEN); -- memcpy(&b_0[8], pn, IEEE80211_CCMP_PN_LEN); --+ /* l(m) */ --+ put_unaligned_be16(data_len, &b_0[14]); -- -- /* AAD (extra authenticate-only data) / masked 802.11 header -- * FC | A1 | A2 | A3 | SC | [A4] | [QC] */ --@@ -395,8 +399,7 @@ static inline void ccmp_hdr2pn(u8 *pn, u -- } -- -- ---static int ccmp_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb, --- unsigned int mic_len) --+static int ccmp_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb) -- { -- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; -- struct ieee80211_key *key = tx->key; --@@ -405,8 +408,7 @@ static int ccmp_encrypt_skb(struct ieee8 -- u8 *pos; -- u8 pn[6]; -- u64 pn64; --- u8 aad[2 * AES_BLOCK_SIZE]; --- u8 b_0[AES_BLOCK_SIZE]; --+ u8 scratch[6 * AES_BLOCK_SIZE]; -- -- if (info->control.hw_key && -- !(info->control.hw_key->flags & IEEE80211_KEY_FLAG_GENERATE_IV) && --@@ -427,7 +429,7 @@ static int ccmp_encrypt_skb(struct ieee8 -- if (info->control.hw_key) -- tail = 0; -- else --- tail = mic_len; --+ tail = IEEE80211_CCMP_MIC_LEN; -- -- if (WARN_ON(skb_tailroom(skb) < tail || -- skb_headroom(skb) < IEEE80211_CCMP_HDR_LEN)) --@@ -460,24 +462,23 @@ static int ccmp_encrypt_skb(struct ieee8 -- return 0; -- -- pos += IEEE80211_CCMP_HDR_LEN; --- ccmp_special_blocks(skb, pn, b_0, aad); --- ieee80211_aes_ccm_encrypt(key->u.ccmp.tfm, b_0, aad, pos, len, --- skb_put(skb, mic_len), mic_len); --+ ccmp_special_blocks(skb, pn, scratch, 0); --+ ieee80211_aes_ccm_encrypt(key->u.ccmp.tfm, scratch, pos, len, --+ pos, skb_put(skb, IEEE80211_CCMP_MIC_LEN)); -- -- return 0; -- } -- -- -- ieee80211_tx_result ---ieee80211_crypto_ccmp_encrypt(struct ieee80211_tx_data *tx, --- unsigned int mic_len) --+ieee80211_crypto_ccmp_encrypt(struct ieee80211_tx_data *tx) -- { -- struct sk_buff *skb; -- -- ieee80211_tx_set_protected(tx); -- -- skb_queue_walk(&tx->skbs, skb) { --- if (ccmp_encrypt_skb(tx, skb, mic_len) < 0) --+ if (ccmp_encrypt_skb(tx, skb) < 0) -- return TX_DROP; -- } -- --@@ -486,8 +487,7 @@ ieee80211_crypto_ccmp_encrypt(struct iee -- -- -- ieee80211_rx_result ---ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx, --- unsigned int mic_len) --+ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx) -- { -- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; -- int hdrlen; --@@ -504,7 +504,8 @@ ieee80211_crypto_ccmp_decrypt(struct iee -- !ieee80211_is_robust_mgmt_frame(skb)) -- return RX_CONTINUE; -- --- data_len = skb->len - hdrlen - IEEE80211_CCMP_HDR_LEN - mic_len; --+ data_len = skb->len - hdrlen - IEEE80211_CCMP_HDR_LEN - --+ IEEE80211_CCMP_MIC_LEN; -- if (!rx->sta || data_len < 0) -- return RX_DROP_UNUSABLE; -- --@@ -526,23 +527,23 @@ ieee80211_crypto_ccmp_decrypt(struct iee -- } -- -- if (!(status->flag & RX_FLAG_DECRYPTED)) { --- u8 aad[2 * AES_BLOCK_SIZE]; --- u8 b_0[AES_BLOCK_SIZE]; --+ u8 scratch[6 * AES_BLOCK_SIZE]; -- /* hardware didn't decrypt/verify MIC */ --- ccmp_special_blocks(skb, pn, b_0, aad); --+ ccmp_special_blocks(skb, pn, scratch, 1); -- -- if (ieee80211_aes_ccm_decrypt( --- key->u.ccmp.tfm, b_0, aad, --+ key->u.ccmp.tfm, scratch, -- skb->data + hdrlen + IEEE80211_CCMP_HDR_LEN, -- data_len, --- skb->data + skb->len - mic_len, mic_len)) --+ skb->data + skb->len - IEEE80211_CCMP_MIC_LEN, --+ skb->data + hdrlen + IEEE80211_CCMP_HDR_LEN)) -- return RX_DROP_UNUSABLE; -- } -- -- memcpy(key->u.ccmp.rx_pn[queue], pn, IEEE80211_CCMP_PN_LEN); -- -- /* Remove CCMP header and MIC */ --- if (pskb_trim(skb, skb->len - mic_len)) --+ if (pskb_trim(skb, skb->len - IEEE80211_CCMP_MIC_LEN)) -- return RX_DROP_UNUSABLE; -- memmove(skb->data + IEEE80211_CCMP_HDR_LEN, skb->data, hdrlen); -- skb_pull(skb, IEEE80211_CCMP_HDR_LEN); --@@ -550,229 +551,6 @@ ieee80211_crypto_ccmp_decrypt(struct iee -- return RX_CONTINUE; -- } -- ---static void gcmp_special_blocks(struct sk_buff *skb, u8 *pn, u8 *j_0, u8 *aad) ---{ --- __le16 mask_fc; --- u8 qos_tid; --- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; --- --- memcpy(j_0, hdr->addr2, ETH_ALEN); --- memcpy(&j_0[ETH_ALEN], pn, IEEE80211_GCMP_PN_LEN); --- j_0[13] = 0; --- j_0[14] = 0; --- j_0[AES_BLOCK_SIZE - 1] = 0x01; --- --- /* AAD (extra authenticate-only data) / masked 802.11 header --- * FC | A1 | A2 | A3 | SC | [A4] | [QC] --- */ --- put_unaligned_be16(ieee80211_hdrlen(hdr->frame_control) - 2, &aad[0]); --- /* Mask FC: zero subtype b4 b5 b6 (if not mgmt) --- * Retry, PwrMgt, MoreData; set Protected --- */ --- mask_fc = hdr->frame_control; --- mask_fc &= ~cpu_to_le16(IEEE80211_FCTL_RETRY | --- IEEE80211_FCTL_PM | IEEE80211_FCTL_MOREDATA); --- if (!ieee80211_is_mgmt(hdr->frame_control)) --- mask_fc &= ~cpu_to_le16(0x0070); --- mask_fc |= cpu_to_le16(IEEE80211_FCTL_PROTECTED); --- --- put_unaligned(mask_fc, (__le16 *)&aad[2]); --- memcpy(&aad[4], &hdr->addr1, 3 * ETH_ALEN); --- --- /* Mask Seq#, leave Frag# */ --- aad[22] = *((u8 *)&hdr->seq_ctrl) & 0x0f; --- aad[23] = 0; --- --- if (ieee80211_is_data_qos(hdr->frame_control)) --- qos_tid = *ieee80211_get_qos_ctl(hdr) & --- IEEE80211_QOS_CTL_TID_MASK; --- else --- qos_tid = 0; --- --- if (ieee80211_has_a4(hdr->frame_control)) { --- memcpy(&aad[24], hdr->addr4, ETH_ALEN); --- aad[30] = qos_tid; --- aad[31] = 0; --- } else { --- memset(&aad[24], 0, ETH_ALEN + IEEE80211_QOS_CTL_LEN); --- aad[24] = qos_tid; --- } ---} --- ---static inline void gcmp_pn2hdr(u8 *hdr, const u8 *pn, int key_id) ---{ --- hdr[0] = pn[5]; --- hdr[1] = pn[4]; --- hdr[2] = 0; --- hdr[3] = 0x20 | (key_id << 6); --- hdr[4] = pn[3]; --- hdr[5] = pn[2]; --- hdr[6] = pn[1]; --- hdr[7] = pn[0]; ---} --- ---static inline void gcmp_hdr2pn(u8 *pn, const u8 *hdr) ---{ --- pn[0] = hdr[7]; --- pn[1] = hdr[6]; --- pn[2] = hdr[5]; --- pn[3] = hdr[4]; --- pn[4] = hdr[1]; --- pn[5] = hdr[0]; ---} --- ---static int gcmp_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb) ---{ --- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; --- struct ieee80211_key *key = tx->key; --- struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); --- int hdrlen, len, tail; --- u8 *pos; --- u8 pn[6]; --- u64 pn64; --- u8 aad[2 * AES_BLOCK_SIZE]; --- u8 j_0[AES_BLOCK_SIZE]; --- --- if (info->control.hw_key && --- !(info->control.hw_key->flags & IEEE80211_KEY_FLAG_GENERATE_IV) && --- !(info->control.hw_key->flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE) && --- !((info->control.hw_key->flags & --- IEEE80211_KEY_FLAG_GENERATE_IV_MGMT) && --- ieee80211_is_mgmt(hdr->frame_control))) { --- /* hwaccel has no need for preallocated room for GCMP --- * header or MIC fields --- */ --- return 0; --- } --- --- hdrlen = ieee80211_hdrlen(hdr->frame_control); --- len = skb->len - hdrlen; --- --- if (info->control.hw_key) --- tail = 0; --- else --- tail = IEEE80211_GCMP_MIC_LEN; --- --- if (WARN_ON(skb_tailroom(skb) < tail || --- skb_headroom(skb) < IEEE80211_GCMP_HDR_LEN)) --- return -1; --- --- pos = skb_push(skb, IEEE80211_GCMP_HDR_LEN); --- memmove(pos, pos + IEEE80211_GCMP_HDR_LEN, hdrlen); --- skb_set_network_header(skb, skb_network_offset(skb) + --- IEEE80211_GCMP_HDR_LEN); --- --- /* the HW only needs room for the IV, but not the actual IV */ --- if (info->control.hw_key && --- (info->control.hw_key->flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE)) --- return 0; --- --- hdr = (struct ieee80211_hdr *)pos; --- pos += hdrlen; --- --- pn64 = atomic64_inc_return(&key->u.gcmp.tx_pn); --- --- pn[5] = pn64; --- pn[4] = pn64 >> 8; --- pn[3] = pn64 >> 16; --- pn[2] = pn64 >> 24; --- pn[1] = pn64 >> 32; --- pn[0] = pn64 >> 40; --- --- gcmp_pn2hdr(pos, pn, key->conf.keyidx); --- --- /* hwaccel - with software GCMP header */ --- if (info->control.hw_key) --- return 0; --- --- pos += IEEE80211_GCMP_HDR_LEN; --- gcmp_special_blocks(skb, pn, j_0, aad); --- ieee80211_aes_gcm_encrypt(key->u.gcmp.tfm, j_0, aad, pos, len, --- skb_put(skb, IEEE80211_GCMP_MIC_LEN)); --- --- return 0; ---} --- ---ieee80211_tx_result ---ieee80211_crypto_gcmp_encrypt(struct ieee80211_tx_data *tx) ---{ --- struct sk_buff *skb; --- --- ieee80211_tx_set_protected(tx); --- --- skb_queue_walk(&tx->skbs, skb) { --- if (gcmp_encrypt_skb(tx, skb) < 0) --- return TX_DROP; --- } --- --- return TX_CONTINUE; ---} --- ---ieee80211_rx_result ---ieee80211_crypto_gcmp_decrypt(struct ieee80211_rx_data *rx) ---{ --- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; --- int hdrlen; --- struct ieee80211_key *key = rx->key; --- struct sk_buff *skb = rx->skb; --- struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); --- u8 pn[IEEE80211_GCMP_PN_LEN]; --- int data_len; --- int queue; --- --- hdrlen = ieee80211_hdrlen(hdr->frame_control); --- --- if (!ieee80211_is_data(hdr->frame_control) && --- !ieee80211_is_robust_mgmt_frame(skb)) --- return RX_CONTINUE; --- --- data_len = skb->len - hdrlen - IEEE80211_GCMP_HDR_LEN - --- IEEE80211_GCMP_MIC_LEN; --- if (!rx->sta || data_len < 0) --- return RX_DROP_UNUSABLE; --- --- if (status->flag & RX_FLAG_DECRYPTED) { --- if (!pskb_may_pull(rx->skb, hdrlen + IEEE80211_GCMP_HDR_LEN)) --- return RX_DROP_UNUSABLE; --- } else { --- if (skb_linearize(rx->skb)) --- return RX_DROP_UNUSABLE; --- } --- --- gcmp_hdr2pn(pn, skb->data + hdrlen); --- --- queue = rx->security_idx; --- --- if (memcmp(pn, key->u.gcmp.rx_pn[queue], IEEE80211_GCMP_PN_LEN) <= 0) { --- key->u.gcmp.replays++; --- return RX_DROP_UNUSABLE; --- } --- --- if (!(status->flag & RX_FLAG_DECRYPTED)) { --- u8 aad[2 * AES_BLOCK_SIZE]; --- u8 j_0[AES_BLOCK_SIZE]; --- /* hardware didn't decrypt/verify MIC */ --- gcmp_special_blocks(skb, pn, j_0, aad); --- --- if (ieee80211_aes_gcm_decrypt( --- key->u.gcmp.tfm, j_0, aad, --- skb->data + hdrlen + IEEE80211_GCMP_HDR_LEN, --- data_len, --- skb->data + skb->len - IEEE80211_GCMP_MIC_LEN)) --- return RX_DROP_UNUSABLE; --- } --- --- memcpy(key->u.gcmp.rx_pn[queue], pn, IEEE80211_GCMP_PN_LEN); --- --- /* Remove GCMP header and MIC */ --- if (pskb_trim(skb, skb->len - IEEE80211_GCMP_MIC_LEN)) --- return RX_DROP_UNUSABLE; --- memmove(skb->data + IEEE80211_GCMP_HDR_LEN, skb->data, hdrlen); --- skb_pull(skb, IEEE80211_GCMP_HDR_LEN); --- --- return RX_CONTINUE; ---} --- -- static ieee80211_tx_result -- ieee80211_crypto_cs_encrypt(struct ieee80211_tx_data *tx, -- struct sk_buff *skb) --@@ -956,48 +734,6 @@ ieee80211_crypto_aes_cmac_encrypt(struct -- return TX_CONTINUE; -- } -- ---ieee80211_tx_result ---ieee80211_crypto_aes_cmac_256_encrypt(struct ieee80211_tx_data *tx) ---{ --- struct sk_buff *skb; --- struct ieee80211_tx_info *info; --- struct ieee80211_key *key = tx->key; --- struct ieee80211_mmie_16 *mmie; --- u8 aad[20]; --- u64 pn64; --- --- if (WARN_ON(skb_queue_len(&tx->skbs) != 1)) --- return TX_DROP; --- --- skb = skb_peek(&tx->skbs); --- --- info = IEEE80211_SKB_CB(skb); --- --- if (info->control.hw_key) --- return TX_CONTINUE; --- --- if (WARN_ON(skb_tailroom(skb) < sizeof(*mmie))) --- return TX_DROP; --- --- mmie = (struct ieee80211_mmie_16 *)skb_put(skb, sizeof(*mmie)); --- mmie->element_id = WLAN_EID_MMIE; --- mmie->length = sizeof(*mmie) - 2; --- mmie->key_id = cpu_to_le16(key->conf.keyidx); --- --- /* PN = PN + 1 */ --- pn64 = atomic64_inc_return(&key->u.aes_cmac.tx_pn); --- --- bip_ipn_set64(mmie->sequence_number, pn64); --- --- bip_aad(skb, aad); --- --- /* MIC = AES-256-CMAC(IGTK, AAD || Management Frame Body || MMIE, 128) --- */ --- ieee80211_aes_cmac_256(key->u.aes_cmac.tfm, aad, --- skb->data + 24, skb->len - 24, mmie->mic); --- --- return TX_CONTINUE; ---} -- -- ieee80211_rx_result -- ieee80211_crypto_aes_cmac_decrypt(struct ieee80211_rx_data *rx) --@@ -1045,160 +781,6 @@ ieee80211_crypto_aes_cmac_decrypt(struct -- -- /* Remove MMIE */ -- skb_trim(skb, skb->len - sizeof(*mmie)); --- --- return RX_CONTINUE; ---} --- ---ieee80211_rx_result ---ieee80211_crypto_aes_cmac_256_decrypt(struct ieee80211_rx_data *rx) ---{ --- struct sk_buff *skb = rx->skb; --- struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); --- struct ieee80211_key *key = rx->key; --- struct ieee80211_mmie_16 *mmie; --- u8 aad[20], mic[16], ipn[6]; --- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; --- --- if (!ieee80211_is_mgmt(hdr->frame_control)) --- return RX_CONTINUE; --- --- /* management frames are already linear */ --- --- if (skb->len < 24 + sizeof(*mmie)) --- return RX_DROP_UNUSABLE; --- --- mmie = (struct ieee80211_mmie_16 *) --- (skb->data + skb->len - sizeof(*mmie)); --- if (mmie->element_id != WLAN_EID_MMIE || --- mmie->length != sizeof(*mmie) - 2) --- return RX_DROP_UNUSABLE; /* Invalid MMIE */ --- --- bip_ipn_swap(ipn, mmie->sequence_number); --- --- if (memcmp(ipn, key->u.aes_cmac.rx_pn, 6) <= 0) { --- key->u.aes_cmac.replays++; --- return RX_DROP_UNUSABLE; --- } --- --- if (!(status->flag & RX_FLAG_DECRYPTED)) { --- /* hardware didn't decrypt/verify MIC */ --- bip_aad(skb, aad); --- ieee80211_aes_cmac_256(key->u.aes_cmac.tfm, aad, --- skb->data + 24, skb->len - 24, mic); --- if (memcmp(mic, mmie->mic, sizeof(mmie->mic)) != 0) { --- key->u.aes_cmac.icverrors++; --- return RX_DROP_UNUSABLE; --- } --- } --- --- memcpy(key->u.aes_cmac.rx_pn, ipn, 6); --- --- /* Remove MMIE */ --- skb_trim(skb, skb->len - sizeof(*mmie)); --- --- return RX_CONTINUE; ---} --- ---ieee80211_tx_result ---ieee80211_crypto_aes_gmac_encrypt(struct ieee80211_tx_data *tx) ---{ --- struct sk_buff *skb; --- struct ieee80211_tx_info *info; --- struct ieee80211_key *key = tx->key; --- struct ieee80211_mmie_16 *mmie; --- struct ieee80211_hdr *hdr; --- u8 aad[20]; --- u64 pn64; --- u8 nonce[12]; --- --- if (WARN_ON(skb_queue_len(&tx->skbs) != 1)) --- return TX_DROP; --- --- skb = skb_peek(&tx->skbs); --- --- info = IEEE80211_SKB_CB(skb); --- --- if (info->control.hw_key) --- return TX_CONTINUE; --- --- if (WARN_ON(skb_tailroom(skb) < sizeof(*mmie))) --- return TX_DROP; --- --- mmie = (struct ieee80211_mmie_16 *)skb_put(skb, sizeof(*mmie)); --- mmie->element_id = WLAN_EID_MMIE; --- mmie->length = sizeof(*mmie) - 2; --- mmie->key_id = cpu_to_le16(key->conf.keyidx); --- --- /* PN = PN + 1 */ --- pn64 = atomic64_inc_return(&key->u.aes_gmac.tx_pn); --- --- bip_ipn_set64(mmie->sequence_number, pn64); --- --- bip_aad(skb, aad); --- --- hdr = (struct ieee80211_hdr *)skb->data; --- memcpy(nonce, hdr->addr2, ETH_ALEN); --- bip_ipn_swap(nonce + ETH_ALEN, mmie->sequence_number); --- --- /* MIC = AES-GMAC(IGTK, AAD || Management Frame Body || MMIE, 128) */ --- if (ieee80211_aes_gmac(key->u.aes_gmac.tfm, aad, nonce, --- skb->data + 24, skb->len - 24, mmie->mic) < 0) --- return TX_DROP; --- --- return TX_CONTINUE; ---} --- ---ieee80211_rx_result ---ieee80211_crypto_aes_gmac_decrypt(struct ieee80211_rx_data *rx) ---{ --- struct sk_buff *skb = rx->skb; --- struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); --- struct ieee80211_key *key = rx->key; --- struct ieee80211_mmie_16 *mmie; --- u8 aad[20], mic[16], ipn[6], nonce[12]; --- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; --- --- if (!ieee80211_is_mgmt(hdr->frame_control)) --- return RX_CONTINUE; --- --- /* management frames are already linear */ --- --- if (skb->len < 24 + sizeof(*mmie)) --- return RX_DROP_UNUSABLE; --- --- mmie = (struct ieee80211_mmie_16 *) --- (skb->data + skb->len - sizeof(*mmie)); --- if (mmie->element_id != WLAN_EID_MMIE || --- mmie->length != sizeof(*mmie) - 2) --- return RX_DROP_UNUSABLE; /* Invalid MMIE */ --- --- bip_ipn_swap(ipn, mmie->sequence_number); --- --- if (memcmp(ipn, key->u.aes_gmac.rx_pn, 6) <= 0) { --- key->u.aes_gmac.replays++; --- return RX_DROP_UNUSABLE; --- } --- --- if (!(status->flag & RX_FLAG_DECRYPTED)) { --- /* hardware didn't decrypt/verify MIC */ --- bip_aad(skb, aad); --- --- memcpy(nonce, hdr->addr2, ETH_ALEN); --- memcpy(nonce + ETH_ALEN, ipn, 6); --- --- if (ieee80211_aes_gmac(key->u.aes_gmac.tfm, aad, nonce, --- skb->data + 24, skb->len - 24, --- mic) < 0 || --- memcmp(mic, mmie->mic, sizeof(mmie->mic)) != 0) { --- key->u.aes_gmac.icverrors++; --- return RX_DROP_UNUSABLE; --- } --- } --- --- memcpy(key->u.aes_gmac.rx_pn, ipn, 6); --- --- /* Remove MMIE */ --- skb_trim(skb, skb->len - sizeof(*mmie)); -- -- return RX_CONTINUE; -- } ----- a/net/mac80211/wpa.h --+++ b/net/mac80211/wpa.h --@@ -24,32 +24,17 @@ ieee80211_rx_result -- ieee80211_crypto_tkip_decrypt(struct ieee80211_rx_data *rx); -- -- ieee80211_tx_result ---ieee80211_crypto_ccmp_encrypt(struct ieee80211_tx_data *tx, --- unsigned int mic_len); --+ieee80211_crypto_ccmp_encrypt(struct ieee80211_tx_data *tx); -- ieee80211_rx_result ---ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx, --- unsigned int mic_len); --+ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx); -- -- ieee80211_tx_result -- ieee80211_crypto_aes_cmac_encrypt(struct ieee80211_tx_data *tx); ---ieee80211_tx_result ---ieee80211_crypto_aes_cmac_256_encrypt(struct ieee80211_tx_data *tx); -- ieee80211_rx_result -- ieee80211_crypto_aes_cmac_decrypt(struct ieee80211_rx_data *rx); ---ieee80211_rx_result ---ieee80211_crypto_aes_cmac_256_decrypt(struct ieee80211_rx_data *rx); ---ieee80211_tx_result ---ieee80211_crypto_aes_gmac_encrypt(struct ieee80211_tx_data *tx); ---ieee80211_rx_result ---ieee80211_crypto_aes_gmac_decrypt(struct ieee80211_rx_data *rx); -- ieee80211_tx_result -- ieee80211_crypto_hw_encrypt(struct ieee80211_tx_data *tx); -- ieee80211_rx_result -- ieee80211_crypto_hw_decrypt(struct ieee80211_rx_data *rx); -- ---ieee80211_tx_result ---ieee80211_crypto_gcmp_encrypt(struct ieee80211_tx_data *tx); ---ieee80211_rx_result ---ieee80211_crypto_gcmp_decrypt(struct ieee80211_rx_data *rx); --- -- #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..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 - - --- a/net/mac80211/cfg.c - +++ b/net/mac80211/cfg.c --@@ -856,7 +856,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..2855a88 100644 ---- a/package/kernel/mac80211/patches/150-disable_addr_notifier.patch -+++ b/package/kernel/mac80211/patches/150-disable_addr_notifier.patch -@@ -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 -- 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 -+@@ -1103,13 +1103,13 @@ int ieee80211_register_hw(struct ieee802 - - return 0; - -@@ -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); --@@ -1124,10 +1124,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); - -#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..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 * -+@@ -1999,7 +1999,7 @@ static int ieee80211_scan(struct wiphy * - * the frames sent while scanning on other channel will be - * lost) - */ -diff --git a/package/kernel/mac80211/patches/300-ath9k-force-rx_clear-when-disabling-rx.patch b/package/kernel/mac80211/patches/300-ath9k-force-rx_clear-when-disabling-rx.patch -new file mode 100644 -index 0000000..bddb15a ---- /dev/null -+++ b/package/kernel/mac80211/patches/300-ath9k-force-rx_clear-when-disabling-rx.patch -@@ -0,0 +1,31 @@ -+From: Felix Fietkau -+Date: Sun, 7 Jun 2015 13:53:35 +0200 -+Subject: [PATCH] ath9k: force rx_clear when disabling rx -+ -+This makes stopping Rx more reliable and should reduce the frequency of -+Rx related DMA stop warnings -+ -+Cc: stable@vger.kernel.org -+Signed-off-by: Felix Fietkau -+--- -+ -+--- a/drivers/net/wireless/ath/ath9k/mac.c -++++ b/drivers/net/wireless/ath/ath9k/mac.c -+@@ -677,13 +677,15 @@ void ath9k_hw_startpcureceive(struct ath -+ -+ ath9k_ani_reset(ah, is_scanning); -+ -+- REG_CLR_BIT(ah, AR_DIAG_SW, (AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT)); -++ REG_CLR_BIT(ah, AR_DIAG_SW, -++ AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT | AR_DIAG_FORCE_RX_CLEAR); -+ } -+ EXPORT_SYMBOL(ath9k_hw_startpcureceive); -+ -+ void ath9k_hw_abortpcurecv(struct ath_hw *ah) -+ { -+- REG_SET_BIT(ah, AR_DIAG_SW, AR_DIAG_RX_ABORT | AR_DIAG_RX_DIS); -++ REG_SET_BIT(ah, AR_DIAG_SW, -++ AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT | AR_DIAG_FORCE_RX_CLEAR); -+ -+ ath9k_hw_disable_mib_counters(ah); -+ } -diff --git a/package/kernel/mac80211/patches/300-mac80211-add-an-intermediate-software-queue-implemen.patch b/package/kernel/mac80211/patches/300-mac80211-add-an-intermediate-software-queue-implemen.patch -deleted file mode 100644 -index 237121b..0000000 ---- a/package/kernel/mac80211/patches/300-mac80211-add-an-intermediate-software-queue-implemen.patch -+++ /dev/null -@@ -1,882 +0,0 @@ --From: Felix Fietkau --Date: Tue, 18 Nov 2014 23:58:51 +0100 --Subject: [PATCH] mac80211: add an intermediate software queue implementation -- --This allows drivers to request per-vif and per-sta-tid queues from which --they can pull frames. This makes it easier to keep the hardware queues --short, and to improve fairness between clients and vifs. -- --The task of scheduling packet transmission is left up to the driver - --queueing is controlled by mac80211. Drivers can only dequeue packets by --calling ieee80211_tx_dequeue. This makes it possible to add active queue --management later without changing drivers using this code. -- --This can also be used as a starting point to implement A-MSDU --aggregation in a way that does not add artificially induced latency. -- --Signed-off-by: Felix Fietkau ----- -- ----- a/include/net/mac80211.h --+++ b/include/net/mac80211.h --@@ -84,6 +84,39 @@ -- * -- */ -- --+/** --+ * DOC: mac80211 software tx queueing --+ * --+ * mac80211 provides an optional intermediate queueing implementation designed --+ * to allow the driver to keep hardware queues short and provide some fairness --+ * between different stations/interfaces. --+ * In this model, the driver pulls data frames from the mac80211 queue instead --+ * of letting mac80211 push them via drv_tx(). --+ * Other frames (e.g. control or management) are still pushed using drv_tx(). --+ * --+ * Drivers indicate that they use this model by implementing the .wake_tx_queue --+ * driver operation. --+ * --+ * Intermediate queues (struct ieee80211_txq) are kept per-sta per-tid, with a --+ * single per-vif queue for multicast data frames. --+ * --+ * The driver is expected to initialize its private per-queue data for stations --+ * and interfaces in the .add_interface and .sta_add ops. --+ * --+ * The driver can't access the queue directly. To dequeue a frame, it calls --+ * ieee80211_tx_dequeue(). Whenever mac80211 adds a new frame to a queue, it --+ * calls the .wake_tx_queue driver op. --+ * --+ * For AP powersave TIM handling, the driver only needs to indicate if it has --+ * buffered packets in the driver specific data structures by calling --+ * ieee80211_sta_set_buffered(). For frames buffered in the ieee80211_txq --+ * struct, mac80211 sets the appropriate TIM PVB bits and calls --+ * .release_buffered_frames(). --+ * In that callback the driver is therefore expected to release its own --+ * buffered frames and afterwards also frames from the ieee80211_txq (obtained --+ * via the usual ieee80211_tx_dequeue). --+ */ --+ -- struct device; -- -- /** --@@ -1246,6 +1279,7 @@ enum ieee80211_vif_flags { -- * monitor interface (if that is requested.) -- * @drv_priv: data area for driver use, will always be aligned to -- * sizeof(void *). --+ * @txq: the multicast data TX queue (if driver uses the TXQ abstraction) -- */ -- struct ieee80211_vif { -- enum nl80211_iftype type; --@@ -1257,6 +1291,8 @@ struct ieee80211_vif { -- u8 cab_queue; -- u8 hw_queue[IEEE80211_NUM_ACS]; -- --+ struct ieee80211_txq *txq; --+ -- struct ieee80211_chanctx_conf __rcu *chanctx_conf; -- -- u32 driver_flags; --@@ -1501,6 +1537,7 @@ struct ieee80211_sta_rates { -- * @tdls_initiator: indicates the STA is an initiator of the TDLS link. Only -- * valid if the STA is a TDLS peer in the first place. -- * @mfp: indicates whether the STA uses management frame protection or not. --+ * @txq: per-TID data TX queues (if driver uses the TXQ abstraction) -- */ -- struct ieee80211_sta { -- u32 supp_rates[IEEE80211_NUM_BANDS]; --@@ -1519,6 +1556,8 @@ struct ieee80211_sta { -- bool tdls_initiator; -- bool mfp; -- --+ struct ieee80211_txq *txq[IEEE80211_NUM_TIDS]; --+ -- /* must be last */ -- u8 drv_priv[0] __aligned(sizeof(void *)); -- }; --@@ -1547,6 +1586,27 @@ struct ieee80211_tx_control { -- }; -- -- /** --+ * struct ieee80211_txq - Software intermediate tx queue --+ * --+ * @vif: &struct ieee80211_vif pointer from the add_interface callback. --+ * @sta: station table entry, %NULL for per-vif queue --+ * @tid: the TID for this queue (unused for per-vif queue) --+ * @ac: the AC for this queue --+ * --+ * The driver can obtain packets from this queue by calling --+ * ieee80211_tx_dequeue(). --+ */ --+struct ieee80211_txq { --+ struct ieee80211_vif *vif; --+ struct ieee80211_sta *sta; --+ u8 tid; --+ u8 ac; --+ --+ /* must be last */ --+ u8 drv_priv[0] __aligned(sizeof(void *)); --+}; --+ --+/** -- * enum ieee80211_hw_flags - hardware flags -- * -- * These flags are used to indicate hardware capabilities to --@@ -1770,6 +1830,8 @@ enum ieee80211_hw_flags { -- * within &struct ieee80211_sta. -- * @chanctx_data_size: size (in bytes) of the drv_priv data area -- * within &struct ieee80211_chanctx_conf. --+ * @txq_data_size: size (in bytes) of the drv_priv data area --+ * within @struct ieee80211_txq. -- * -- * @max_rates: maximum number of alternate rate retry stages the hw -- * can handle. --@@ -1818,6 +1880,9 @@ enum ieee80211_hw_flags { -- * @n_cipher_schemes: a size of an array of cipher schemes definitions. -- * @cipher_schemes: a pointer to an array of cipher scheme definitions -- * supported by HW. --+ * --+ * @txq_ac_max_pending: maximum number of frames per AC pending in all txq --+ * entries for a vif. -- */ -- struct ieee80211_hw { -- struct ieee80211_conf conf; --@@ -1830,6 +1895,7 @@ struct ieee80211_hw { -- int vif_data_size; -- int sta_data_size; -- int chanctx_data_size; --+ int txq_data_size; -- u16 queues; -- u16 max_listen_interval; -- s8 max_signal; --@@ -1846,6 +1912,7 @@ struct ieee80211_hw { -- u8 uapsd_max_sp_len; -- u8 n_cipher_schemes; -- const struct ieee80211_cipher_scheme *cipher_schemes; --+ int txq_ac_max_pending; -- }; -- -- /** --@@ -3007,6 +3074,8 @@ enum ieee80211_reconfig_type { -- * response template is provided, together with the location of the -- * switch-timing IE within the template. The skb can only be used within -- * the function call. --+ * --+ * @wake_tx_queue: Called when new packets have been added to the queue. -- */ -- struct ieee80211_ops { -- void (*tx)(struct ieee80211_hw *hw, --@@ -3238,6 +3307,9 @@ struct ieee80211_ops { -- void (*tdls_recv_channel_switch)(struct ieee80211_hw *hw, -- struct ieee80211_vif *vif, -- struct ieee80211_tdls_ch_sw_params *params); --+ --+ void (*wake_tx_queue)(struct ieee80211_hw *hw, --+ struct ieee80211_txq *txq); -- }; -- -- /** --@@ -5249,4 +5321,15 @@ void ieee80211_unreserve_tid(struct ieee -- */ -- size_t ieee80211_ie_split(const u8 *ies, size_t ielen, -- const u8 *ids, int n_ids, size_t offset); --+ --+/** --+ * ieee80211_tx_dequeue - dequeue a packet from a software tx queue --+ * --+ * @hw: pointer as obtained from ieee80211_alloc_hw() --+ * @txq: pointer obtained from station or virtual interface --+ * --+ * Returns the skb if successful, %NULL if no frame was available. --+ */ --+struct sk_buff *ieee80211_tx_dequeue(struct ieee80211_hw *hw, --+ struct ieee80211_txq *txq); -- #endif /* MAC80211_H */ ----- a/net/mac80211/driver-ops.h --+++ b/net/mac80211/driver-ops.h --@@ -1367,4 +1367,16 @@ drv_tdls_recv_channel_switch(struct ieee -- trace_drv_return_void(local); -- } -- --+static inline void drv_wake_tx_queue(struct ieee80211_local *local, --+ struct txq_info *txq) --+{ --+ struct ieee80211_sub_if_data *sdata = vif_to_sdata(txq->txq.vif); --+ --+ if (!check_sdata_in_driver(sdata)) --+ return; --+ --+ trace_drv_wake_tx_queue(local, sdata, txq); --+ local->ops->wake_tx_queue(&local->hw, &txq->txq); --+} --+ -- #endif /* __MAC80211_DRIVER_OPS */ ----- a/net/mac80211/ieee80211_i.h --+++ b/net/mac80211/ieee80211_i.h --@@ -809,6 +809,19 @@ struct mac80211_qos_map { -- struct rcu_head rcu_head; -- }; -- --+enum txq_info_flags { --+ IEEE80211_TXQ_STOP, --+ IEEE80211_TXQ_AMPDU, --+}; --+ --+struct txq_info { --+ struct sk_buff_head queue; --+ unsigned long flags; --+ --+ /* keep last! */ --+ struct ieee80211_txq txq; --+}; --+ -- struct ieee80211_sub_if_data { -- struct list_head list; -- --@@ -853,6 +866,7 @@ struct ieee80211_sub_if_data { -- bool control_port_no_encrypt; -- int encrypt_headroom; -- --+ atomic_t txqs_len[IEEE80211_NUM_ACS]; -- struct ieee80211_tx_queue_params tx_conf[IEEE80211_NUM_ACS]; -- struct mac80211_qos_map __rcu *qos_map; -- --@@ -1453,6 +1467,10 @@ static inline struct ieee80211_local *hw -- return container_of(hw, struct ieee80211_local, hw); -- } -- --+static inline struct txq_info *to_txq_info(struct ieee80211_txq *txq) --+{ --+ return container_of(txq, struct txq_info, txq); --+} -- -- static inline int ieee80211_bssid_match(const u8 *raddr, const u8 *addr) -- { --@@ -1905,6 +1923,9 @@ static inline bool ieee80211_can_run_wor -- return true; -- } -- --+void ieee80211_init_tx_queue(struct ieee80211_sub_if_data *sdata, --+ struct sta_info *sta, --+ struct txq_info *txq, int tid); -- void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata, -- u16 transaction, u16 auth_alg, u16 status, -- const u8 *extra, size_t extra_len, const u8 *bssid, ----- a/net/mac80211/iface.c --+++ b/net/mac80211/iface.c --@@ -969,6 +969,13 @@ static void ieee80211_do_stop(struct iee -- } -- spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); -- --+ if (sdata->vif.txq) { --+ struct txq_info *txqi = to_txq_info(sdata->vif.txq); --+ --+ ieee80211_purge_tx_queue(&local->hw, &txqi->queue); --+ atomic_set(&sdata->txqs_len[txqi->txq.ac], 0); --+ } --+ -- if (local->open_count == 0) -- ieee80211_clear_tx_pending(local); -- --@@ -1674,6 +1681,7 @@ int ieee80211_if_add(struct ieee80211_lo -- { -- struct net_device *ndev = NULL; -- struct ieee80211_sub_if_data *sdata = NULL; --+ struct txq_info *txqi; -- int ret, i; -- int txqs = 1; -- --@@ -1693,10 +1701,18 @@ int ieee80211_if_add(struct ieee80211_lo -- ieee80211_assign_perm_addr(local, wdev->address, type); -- memcpy(sdata->vif.addr, wdev->address, ETH_ALEN); -- } else { --+ int size = ALIGN(sizeof(*sdata) + local->hw.vif_data_size, --+ sizeof(void *)); --+ int txq_size = 0; --+ --+ if (local->ops->wake_tx_queue) --+ txq_size += sizeof(struct txq_info) + --+ local->hw.txq_data_size; --+ -- if (local->hw.queues >= IEEE80211_NUM_ACS) -- txqs = IEEE80211_NUM_ACS; -- --- ndev = alloc_netdev_mqs(sizeof(*sdata) + local->hw.vif_data_size, --+ ndev = alloc_netdev_mqs(size + txq_size, -- name, NET_NAME_UNKNOWN, -- ieee80211_if_setup, txqs, 1); -- if (!ndev) --@@ -1731,6 +1747,11 @@ int ieee80211_if_add(struct ieee80211_lo -- memcpy(sdata->vif.addr, ndev->dev_addr, ETH_ALEN); -- memcpy(sdata->name, ndev->name, IFNAMSIZ); -- --+ if (txq_size) { --+ txqi = netdev_priv(ndev) + size; --+ ieee80211_init_tx_queue(sdata, NULL, txqi, 0); --+ } --+ -- sdata->dev = ndev; -- } -- ----- a/net/mac80211/main.c --+++ b/net/mac80211/main.c --@@ -1019,6 +1019,9 @@ int ieee80211_register_hw(struct ieee802 -- -- local->dynamic_ps_forced_timeout = -1; -- --+ if (!local->hw.txq_ac_max_pending) --+ local->hw.txq_ac_max_pending = 64; --+ -- result = ieee80211_wep_init(local); -- if (result < 0) -- wiphy_debug(local->hw.wiphy, "Failed to initialize wep: %d\n", ----- a/net/mac80211/sta_info.c --+++ b/net/mac80211/sta_info.c --@@ -118,6 +118,16 @@ static void __cleanup_single_sta(struct -- atomic_dec(&ps->num_sta_ps); -- } -- --+ if (sta->sta.txq[0]) { --+ for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) { --+ struct txq_info *txqi = to_txq_info(sta->sta.txq[i]); --+ int n = skb_queue_len(&txqi->queue); --+ --+ ieee80211_purge_tx_queue(&local->hw, &txqi->queue); --+ atomic_sub(n, &sdata->txqs_len[txqi->txq.ac]); --+ } --+ } --+ -- for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) { -- local->total_ps_buffered -= skb_queue_len(&sta->ps_tx_buf[ac]); -- ieee80211_purge_tx_queue(&local->hw, &sta->ps_tx_buf[ac]); --@@ -234,6 +244,8 @@ void sta_info_free(struct ieee80211_loca -- -- sta_dbg(sta->sdata, "Destroyed STA %pM\n", sta->sta.addr); -- --+ if (sta->sta.txq[0]) --+ kfree(to_txq_info(sta->sta.txq[0])); -- kfree(rcu_dereference_raw(sta->sta.rates)); -- kfree(sta); -- } --@@ -285,11 +297,12 @@ struct sta_info *sta_info_alloc(struct i -- const u8 *addr, gfp_t gfp) -- { -- struct ieee80211_local *local = sdata->local; --+ struct ieee80211_hw *hw = &local->hw; -- struct sta_info *sta; -- struct timespec uptime; -- int i; -- --- sta = kzalloc(sizeof(*sta) + local->hw.sta_data_size, gfp); --+ sta = kzalloc(sizeof(*sta) + hw->sta_data_size, gfp); -- if (!sta) -- return NULL; -- --@@ -321,11 +334,25 @@ struct sta_info *sta_info_alloc(struct i -- for (i = 0; i < ARRAY_SIZE(sta->chain_signal_avg); i++) -- ewma_init(&sta->chain_signal_avg[i], 1024, 8); -- --- if (sta_prepare_rate_control(local, sta, gfp)) { --- kfree(sta); --- return NULL; --+ if (local->ops->wake_tx_queue) { --+ void *txq_data; --+ int size = sizeof(struct txq_info) + --+ ALIGN(hw->txq_data_size, sizeof(void *)); --+ --+ txq_data = kcalloc(ARRAY_SIZE(sta->sta.txq), size, gfp); --+ if (!txq_data) --+ goto free; --+ --+ for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) { --+ struct txq_info *txq = txq_data + i * size; --+ --+ ieee80211_init_tx_queue(sdata, sta, txq, i); --+ } -- } -- --+ if (sta_prepare_rate_control(local, sta, gfp)) --+ goto free_txq; --+ -- for (i = 0; i < IEEE80211_NUM_TIDS; i++) { -- /* -- * timer_to_tid must be initialized with identity mapping --@@ -346,7 +373,7 @@ struct sta_info *sta_info_alloc(struct i -- if (sdata->vif.type == NL80211_IFTYPE_AP || -- sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { -- struct ieee80211_supported_band *sband = --- local->hw.wiphy->bands[ieee80211_get_sdata_band(sdata)]; --+ hw->wiphy->bands[ieee80211_get_sdata_band(sdata)]; -- u8 smps = (sband->ht_cap.cap & IEEE80211_HT_CAP_SM_PS) >> -- IEEE80211_HT_CAP_SM_PS_SHIFT; -- /* --@@ -371,6 +398,13 @@ struct sta_info *sta_info_alloc(struct i -- sta_dbg(sdata, "Allocated STA %pM\n", sta->sta.addr); -- -- return sta; --+ --+free_txq: --+ if (sta->sta.txq[0]) --+ kfree(to_txq_info(sta->sta.txq[0])); --+free: --+ kfree(sta); --+ return NULL; -- } -- -- static int sta_info_insert_check(struct sta_info *sta) --@@ -640,6 +674,8 @@ static void __sta_info_recalc_tim(struct -- -- indicate_tim |= -- sta->driver_buffered_tids & tids; --+ indicate_tim |= --+ sta->txq_buffered_tids & tids; -- } -- -- done: --@@ -1071,7 +1107,7 @@ void ieee80211_sta_ps_deliver_wakeup(str -- struct ieee80211_sub_if_data *sdata = sta->sdata; -- struct ieee80211_local *local = sdata->local; -- struct sk_buff_head pending; --- int filtered = 0, buffered = 0, ac; --+ int filtered = 0, buffered = 0, ac, i; -- unsigned long flags; -- struct ps_data *ps; -- --@@ -1090,10 +1126,22 @@ void ieee80211_sta_ps_deliver_wakeup(str -- -- BUILD_BUG_ON(BITS_TO_LONGS(IEEE80211_NUM_TIDS) > 1); -- sta->driver_buffered_tids = 0; --+ sta->txq_buffered_tids = 0; -- -- if (!(local->hw.flags & IEEE80211_HW_AP_LINK_PS)) -- drv_sta_notify(local, sdata, STA_NOTIFY_AWAKE, &sta->sta); -- --+ if (sta->sta.txq[0]) { --+ for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) { --+ struct txq_info *txqi = to_txq_info(sta->sta.txq[i]); --+ --+ if (!skb_queue_len(&txqi->queue)) --+ continue; --+ --+ drv_wake_tx_queue(local, txqi); --+ } --+ } --+ -- skb_queue_head_init(&pending); -- -- /* sync with ieee80211_tx_h_unicast_ps_buf */ --@@ -1275,8 +1323,10 @@ ieee80211_sta_ps_deliver_response(struct -- /* if we already have frames from software, then we can't also -- * release from hardware queues -- */ --- if (skb_queue_empty(&frames)) --+ if (skb_queue_empty(&frames)) { -- driver_release_tids |= sta->driver_buffered_tids & tids; --+ driver_release_tids |= sta->txq_buffered_tids & tids; --+ } -- -- if (driver_release_tids) { -- /* If the driver has data on more than one TID then --@@ -1447,6 +1497,9 @@ ieee80211_sta_ps_deliver_response(struct -- -- sta_info_recalc_tim(sta); -- } else { --+ unsigned long tids = sta->txq_buffered_tids & driver_release_tids; --+ int tid; --+ -- /* -- * We need to release a frame that is buffered somewhere in the -- * driver ... it'll have to handle that. --@@ -1466,8 +1519,22 @@ ieee80211_sta_ps_deliver_response(struct -- * that the TID(s) became empty before returning here from the -- * release function. -- * Either way, however, when the driver tells us that the TID(s) --- * became empty we'll do the TIM recalculation. --+ * became empty or we find that a txq became empty, we'll do the --+ * TIM recalculation. -- */ --+ --+ if (!sta->sta.txq[0]) --+ return; --+ --+ for (tid = 0; tid < ARRAY_SIZE(sta->sta.txq); tid++) { --+ struct txq_info *txqi = to_txq_info(sta->sta.txq[tid]); --+ --+ if (!(tids & BIT(tid)) || skb_queue_len(&txqi->queue)) --+ continue; --+ --+ sta_info_recalc_tim(sta); --+ break; --+ } -- } -- } -- ----- a/net/mac80211/sta_info.h --+++ b/net/mac80211/sta_info.h --@@ -274,6 +274,7 @@ struct sta_ampdu_mlme { -- * entered power saving state, these are also delivered to -- * the station when it leaves powersave or polls for frames -- * @driver_buffered_tids: bitmap of TIDs the driver has data buffered on --+ * @txq_buffered_tids: bitmap of TIDs that mac80211 has txq data buffered on -- * @rx_packets: Number of MSDUs received from this STA -- * @rx_bytes: Number of bytes received from this STA -- * @last_rx: time (in jiffies) when last frame was received from this STA --@@ -368,6 +369,7 @@ struct sta_info { -- struct sk_buff_head ps_tx_buf[IEEE80211_NUM_ACS]; -- struct sk_buff_head tx_filtered[IEEE80211_NUM_ACS]; -- unsigned long driver_buffered_tids; --+ unsigned long txq_buffered_tids; -- -- /* Updated from RX path only, no locking requirements */ -- unsigned long rx_packets; ----- a/net/mac80211/trace.h --+++ b/net/mac80211/trace.h --@@ -2312,6 +2312,37 @@ TRACE_EVENT(drv_tdls_recv_channel_switch -- ) -- ); -- --+TRACE_EVENT(drv_wake_tx_queue, --+ TP_PROTO(struct ieee80211_local *local, --+ struct ieee80211_sub_if_data *sdata, --+ struct txq_info *txq), --+ --+ TP_ARGS(local, sdata, txq), --+ --+ TP_STRUCT__entry( --+ LOCAL_ENTRY --+ VIF_ENTRY --+ STA_ENTRY --+ __field(u8, ac) --+ __field(u8, tid) --+ ), --+ --+ TP_fast_assign( --+ struct ieee80211_sta *sta = txq->txq.sta; --+ --+ LOCAL_ASSIGN; --+ VIF_ASSIGN; --+ STA_ASSIGN; --+ __entry->ac = txq->txq.ac; --+ __entry->tid = txq->txq.tid; --+ ), --+ --+ TP_printk( --+ LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " ac:%d tid:%d", --+ LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->ac, __entry->tid --+ ) --+); --+ -- #ifdef CPTCFG_MAC80211_MESSAGE_TRACING -- #undef TRACE_SYSTEM -- #define TRACE_SYSTEM mac80211_msg ----- a/net/mac80211/tx.c --+++ b/net/mac80211/tx.c --@@ -776,12 +776,22 @@ ieee80211_tx_h_rate_ctrl(struct ieee8021 -- return TX_CONTINUE; -- } -- --+static __le16 ieee80211_tx_next_seq(struct sta_info *sta, int tid) --+{ --+ u16 *seq = &sta->tid_seq[tid]; --+ __le16 ret = cpu_to_le16(*seq); --+ --+ /* Increase the sequence number. */ --+ *seq = (*seq + 0x10) & IEEE80211_SCTL_SEQ; --+ --+ return ret; --+} --+ -- static ieee80211_tx_result debug_noinline -- ieee80211_tx_h_sequence(struct ieee80211_tx_data *tx) -- { -- struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); -- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; --- u16 *seq; -- u8 *qc; -- int tid; -- --@@ -832,13 +842,10 @@ ieee80211_tx_h_sequence(struct ieee80211 -- -- qc = ieee80211_get_qos_ctl(hdr); -- tid = *qc & IEEE80211_QOS_CTL_TID_MASK; --- seq = &tx->sta->tid_seq[tid]; -- tx->sta->tx_msdu[tid]++; -- --- hdr->seq_ctrl = cpu_to_le16(*seq); --- --- /* Increase the sequence number. */ --- *seq = (*seq + 0x10) & IEEE80211_SCTL_SEQ; --+ if (!tx->sta->sta.txq[0]) --+ hdr->seq_ctrl = ieee80211_tx_next_seq(tx->sta, tid); -- -- return TX_CONTINUE; -- } --@@ -1067,7 +1074,7 @@ static bool ieee80211_tx_prep_agg(struct -- * nothing -- this aggregation session is being started -- * but that might still fail with the driver -- */ --- } else { --+ } else if (!tx->sta->sta.txq[tid]) { -- spin_lock(&tx->sta->lock); -- /* -- * Need to re-check now, because we may get here --@@ -1201,13 +1208,102 @@ ieee80211_tx_prepare(struct ieee80211_su -- return TX_CONTINUE; -- } -- --+static void ieee80211_drv_tx(struct ieee80211_local *local, --+ struct ieee80211_vif *vif, --+ struct ieee80211_sta *pubsta, --+ struct sk_buff *skb) --+{ --+ struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; --+ struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); --+ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); --+ struct ieee80211_tx_control control = { --+ .sta = pubsta, --+ }; --+ struct ieee80211_txq *txq = NULL; --+ struct txq_info *txqi; --+ u8 ac; --+ --+ if (info->control.flags & IEEE80211_TX_CTRL_PS_RESPONSE) --+ goto tx_normal; --+ --+ if (!ieee80211_is_data(hdr->frame_control)) --+ goto tx_normal; --+ --+ if (pubsta) { --+ u8 tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK; --+ --+ txq = pubsta->txq[tid]; --+ } else if (vif) { --+ txq = vif->txq; --+ } --+ --+ if (!txq) --+ goto tx_normal; --+ --+ ac = txq->ac; --+ txqi = to_txq_info(txq); --+ atomic_inc(&sdata->txqs_len[ac]); --+ if (atomic_read(&sdata->txqs_len[ac]) >= local->hw.txq_ac_max_pending) --+ netif_stop_subqueue(sdata->dev, ac); --+ --+ skb_queue_tail(&txqi->queue, skb); --+ drv_wake_tx_queue(local, txqi); --+ --+ return; --+ --+tx_normal: --+ drv_tx(local, &control, skb); --+} --+ --+struct sk_buff *ieee80211_tx_dequeue(struct ieee80211_hw *hw, --+ struct ieee80211_txq *txq) --+{ --+ struct ieee80211_local *local = hw_to_local(hw); --+ struct ieee80211_sub_if_data *sdata = vif_to_sdata(txq->vif); --+ struct txq_info *txqi = container_of(txq, struct txq_info, txq); --+ struct ieee80211_hdr *hdr; --+ struct sk_buff *skb = NULL; --+ u8 ac = txq->ac; --+ --+ spin_lock_bh(&txqi->queue.lock); --+ --+ if (test_bit(IEEE80211_TXQ_STOP, &txqi->flags)) --+ goto out; --+ --+ skb = __skb_dequeue(&txqi->queue); --+ if (!skb) --+ goto out; --+ --+ atomic_dec(&sdata->txqs_len[ac]); --+ if (__netif_subqueue_stopped(sdata->dev, ac)) --+ ieee80211_propagate_queue_wake(local, sdata->vif.hw_queue[ac]); --+ --+ hdr = (struct ieee80211_hdr *)skb->data; --+ if (txq->sta && ieee80211_is_data_qos(hdr->frame_control)) { --+ struct sta_info *sta = container_of(txq->sta, struct sta_info, --+ sta); --+ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); --+ --+ hdr->seq_ctrl = ieee80211_tx_next_seq(sta, txq->tid); --+ if (test_bit(IEEE80211_TXQ_AMPDU, &txqi->flags)) --+ info->flags |= IEEE80211_TX_CTL_AMPDU; --+ else --+ info->flags &= ~IEEE80211_TX_CTL_AMPDU; --+ } --+ --+out: --+ spin_unlock_bh(&txqi->queue.lock); --+ --+ return skb; --+} --+EXPORT_SYMBOL(ieee80211_tx_dequeue); --+ -- static bool ieee80211_tx_frags(struct ieee80211_local *local, -- struct ieee80211_vif *vif, -- struct ieee80211_sta *sta, -- struct sk_buff_head *skbs, -- bool txpending) -- { --- struct ieee80211_tx_control control; -- struct sk_buff *skb, *tmp; -- unsigned long flags; -- --@@ -1265,10 +1361,9 @@ static bool ieee80211_tx_frags(struct ie -- spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); -- -- info->control.vif = vif; --- control.sta = sta; -- -- __skb_unlink(skb, skbs); --- drv_tx(local, &control, skb); --+ ieee80211_drv_tx(local, vif, sta, skb); -- } -- -- return true; ----- a/net/mac80211/util.c --+++ b/net/mac80211/util.c --@@ -308,6 +308,11 @@ void ieee80211_propagate_queue_wake(stru -- for (ac = 0; ac < n_acs; ac++) { -- int ac_queue = sdata->vif.hw_queue[ac]; -- --+ if (local->ops->wake_tx_queue && --+ (atomic_read(&sdata->txqs_len[ac]) > --+ local->hw.txq_ac_max_pending)) --+ continue; --+ -- if (ac_queue == queue || -- (sdata->vif.cab_queue == queue && -- local->queue_stop_reasons[ac_queue] == 0 && --@@ -3307,3 +3312,20 @@ u8 *ieee80211_add_wmm_info_ie(u8 *buf, u -- -- return buf; -- } --+ --+void ieee80211_init_tx_queue(struct ieee80211_sub_if_data *sdata, --+ struct sta_info *sta, --+ struct txq_info *txqi, int tid) --+{ --+ skb_queue_head_init(&txqi->queue); --+ txqi->txq.vif = &sdata->vif; --+ --+ if (sta) { --+ txqi->txq.sta = &sta->sta; --+ sta->sta.txq[tid] = &txqi->txq; --+ txqi->txq.ac = ieee802_1d_to_ac[tid & 7]; --+ } else { --+ sdata->vif.txq = &txqi->txq; --+ txqi->txq.ac = IEEE80211_AC_BE; --+ } --+} ----- a/net/mac80211/rx.c --+++ b/net/mac80211/rx.c --@@ -1176,6 +1176,7 @@ static void sta_ps_start(struct sta_info -- struct ieee80211_sub_if_data *sdata = sta->sdata; -- struct ieee80211_local *local = sdata->local; -- struct ps_data *ps; --+ int tid; -- -- if (sta->sdata->vif.type == NL80211_IFTYPE_AP || -- sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN) --@@ -1189,6 +1190,18 @@ static void sta_ps_start(struct sta_info -- drv_sta_notify(local, sdata, STA_NOTIFY_SLEEP, &sta->sta); -- ps_dbg(sdata, "STA %pM aid %d enters power save mode\n", -- sta->sta.addr, sta->sta.aid); --+ --+ if (!sta->sta.txq[0]) --+ return; --+ --+ for (tid = 0; tid < ARRAY_SIZE(sta->sta.txq); tid++) { --+ struct txq_info *txqi = to_txq_info(sta->sta.txq[tid]); --+ --+ if (!skb_queue_len(&txqi->queue)) --+ set_bit(tid, &sta->txq_buffered_tids); --+ else --+ clear_bit(tid, &sta->txq_buffered_tids); --+ } -- } -- -- static void sta_ps_end(struct sta_info *sta) ----- a/net/mac80211/agg-tx.c --+++ b/net/mac80211/agg-tx.c --@@ -188,6 +188,43 @@ ieee80211_wake_queue_agg(struct ieee8021 -- __release(agg_queue); -- } -- --+static void --+ieee80211_agg_stop_txq(struct sta_info *sta, int tid) --+{ --+ struct ieee80211_txq *txq = sta->sta.txq[tid]; --+ struct txq_info *txqi; --+ --+ if (!txq) --+ return; --+ --+ txqi = to_txq_info(txq); --+ --+ /* Lock here to protect against further seqno updates on dequeue */ --+ spin_lock_bh(&txqi->queue.lock); --+ set_bit(IEEE80211_TXQ_STOP, &txqi->flags); --+ spin_unlock_bh(&txqi->queue.lock); --+} --+ --+static void --+ieee80211_agg_start_txq(struct sta_info *sta, int tid, bool enable) --+{ --+ struct ieee80211_txq *txq = sta->sta.txq[tid]; --+ struct txq_info *txqi; --+ --+ if (!txq) --+ return; --+ --+ txqi = to_txq_info(txq); --+ --+ if (enable) --+ set_bit(IEEE80211_TXQ_AMPDU, &txqi->flags); --+ else --+ clear_bit(IEEE80211_TXQ_AMPDU, &txqi->flags); --+ --+ clear_bit(IEEE80211_TXQ_STOP, &txqi->flags); --+ drv_wake_tx_queue(sta->sdata->local, txqi); --+} --+ -- /* -- * splice packets from the STA's pending to the local pending, -- * requires a call to ieee80211_agg_splice_finish later --@@ -247,6 +284,7 @@ static void ieee80211_remove_tid_tx(stru -- ieee80211_assign_tid_tx(sta, tid, NULL); -- -- ieee80211_agg_splice_finish(sta->sdata, tid); --+ ieee80211_agg_start_txq(sta, tid, false); -- -- kfree_rcu(tid_tx, rcu_head); -- } --@@ -418,6 +456,8 @@ void ieee80211_tx_ba_session_handle_star -- */ -- clear_bit(HT_AGG_STATE_WANT_START, &tid_tx->state); -- --+ ieee80211_agg_stop_txq(sta, tid); --+ -- /* -- * Make sure no packets are being processed. This ensures that -- * we have a valid starting sequence number and that in-flight --@@ -440,6 +480,8 @@ void ieee80211_tx_ba_session_handle_star -- ieee80211_agg_splice_finish(sdata, tid); -- spin_unlock_bh(&sta->lock); -- --+ ieee80211_agg_start_txq(sta, tid, false); --+ -- kfree_rcu(tid_tx, rcu_head); -- return; -- } --@@ -666,6 +708,8 @@ static void ieee80211_agg_tx_operational -- ieee80211_agg_splice_finish(sta->sdata, tid); -- -- spin_unlock_bh(&sta->lock); --+ --+ ieee80211_agg_start_txq(sta, tid, true); -- } -- -- 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..a160dc4 ---- /dev/null -+++ b/package/kernel/mac80211/patches/301-ath9k-limit-retries-for-powersave-response-frames.patch -@@ -0,0 +1,121 @@ -+From: Felix Fietkau -+Date: Thu, 2 Jul 2015 15:20:56 +0200 -+Subject: [PATCH] ath9k: limit retries for powersave response frames -+ -+In some cases, the channel might be busy enough that an ath9k AP's -+response to PS-Poll frames might be too slow and the station has already -+gone to sleep. To avoid wasting too much airtime on this, limit the -+number of retries on such frames and ensure that no sample rate gets -+used. -+ -+Signed-off-by: Felix Fietkau -+--- -+ -+--- a/drivers/net/wireless/ath/ath9k/xmit.c -++++ b/drivers/net/wireless/ath/ath9k/xmit.c -+@@ -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, -+- struct ath_buf *bf) -++ struct ath_buf *bf, bool ps) -+ { -++ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(bf->bf_mpdu); -++ -++ if (ps) { -++ /* Clear the first rate to avoid using a sample rate for PS frames */ -++ info->control.rates[0].idx = -1; -++ info->control.rates[0].count = 0; -++ } -++ -+ ieee80211_get_tx_rates(vif, sta, bf->bf_mpdu, bf->rates, -+ ARRAY_SIZE(bf->rates)); -++ if (!ps) -++ return; -++ -++ if (bf->rates[0].count > 2) -++ bf->rates[0].count = 2; -++ -++ bf->rates[1].idx = -1; -+ } -+ -+ static void ath_txq_skb_done(struct ath_softc *sc, struct ath_txq *txq, -+@@ -1419,7 +1434,7 @@ ath_tx_form_burst(struct ath_softc *sc, -+ if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) -+ break; -+ -+- ath_set_rates(tid->an->vif, tid->an->sta, bf); -++ ath_set_rates(tid->an->vif, tid->an->sta, bf, false); -+ } while (1); -+ } -+ -+@@ -1450,7 +1465,7 @@ static bool ath_tx_sched_aggr(struct ath -+ return false; -+ } -+ -+- ath_set_rates(tid->an->vif, tid->an->sta, bf); -++ ath_set_rates(tid->an->vif, tid->an->sta, bf, false); -+ if (aggr) -+ last = ath_tx_form_aggr(sc, txq, tid, &bf_q, bf, -+ tid_q, &aggr_len); -+@@ -1647,7 +1662,7 @@ void ath9k_release_buffered_frames(struc -+ -+ __skb_unlink(bf->bf_mpdu, tid_q); -+ list_add_tail(&bf->list, &bf_q); -+- ath_set_rates(tid->an->vif, tid->an->sta, bf); -++ ath_set_rates(tid->an->vif, tid->an->sta, bf, true); -+ if (bf_isampdu(bf)) { -+ ath_tx_addto_baw(sc, tid, bf); -+ bf->bf_state.bf_type &= ~BUF_AGGR; -+@@ -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; -+- bool queue, skip_uapsd = false, ps_resp; -++ bool queue, ps_resp; -+ int q, ret; -+ -+ if (vif) -+@@ -2346,13 +2361,13 @@ int ath_tx_start(struct ieee80211_hw *hw -+ if (!txctl->an) -+ txctl->an = &avp->mcast_node; -+ queue = true; -+- skip_uapsd = true; -++ ps_resp = false; -+ } -+ -+ if (txctl->an && queue) -+ tid = ath_get_skb_tid(sc, txctl->an, skb); -+ -+- if (!skip_uapsd && ps_resp) { -++ if (ps_resp) { -+ ath_txq_unlock(sc, txq); -+ txq = sc->tx.uapsdq; -+ ath_txq_lock(sc, txq); -+@@ -2390,7 +2405,7 @@ int ath_tx_start(struct ieee80211_hw *hw -+ if (txctl->paprd) -+ bf->bf_state.bfs_paprd_timestamp = jiffies; -+ -+- ath_set_rates(vif, sta, bf); -++ ath_set_rates(vif, sta, bf, ps_resp); -+ ath_tx_send_normal(sc, txq, tid, skb); -+ -+ out: -+@@ -2429,7 +2444,7 @@ void ath_tx_cabq(struct ieee80211_hw *hw -+ break; -+ -+ bf->bf_lastbf = bf; -+- ath_set_rates(vif, NULL, bf); -++ ath_set_rates(vif, NULL, bf, false); -+ ath_buf_set_rate(sc, bf, &info, fi->framelen, false); -+ duration += info.rates[0].PktDuration; -+ if (bf_tail) -+@@ -2932,7 +2947,7 @@ int ath9k_tx99_send(struct ath_softc *sc -+ return -EINVAL; -+ } -+ -+- ath_set_rates(sc->tx99_vif, NULL, bf); -++ ath_set_rates(sc->tx99_vif, NULL, bf, false); -+ -+ ath9k_hw_set_desc_link(sc->sc_ah, bf->bf_desc, bf->bf_daddr); -+ ath9k_hw_tx99_start(sc->sc_ah, txctl->txq->axq_qnum); -diff --git a/package/kernel/mac80211/patches/301-mac80211-lock-rate-control.patch b/package/kernel/mac80211/patches/301-mac80211-lock-rate-control.patch -deleted file mode 100644 -index 465d943..0000000 ---- a/package/kernel/mac80211/patches/301-mac80211-lock-rate-control.patch -+++ /dev/null -@@ -1,125 +0,0 @@ --From: Johannes Berg --Date: Wed, 11 Mar 2015 09:14:15 +0100 --Subject: [PATCH] mac80211: lock rate control -- --Both minstrel (reported by Sven Eckelmann) and the iwlwifi rate --control aren't properly taking concurrency into account. It's --likely that the same is true for other rate control algorithms. -- --In the case of minstrel this manifests itself in crashes when an --update and other data access are run concurrently, for example --when the stations change bandwidth or similar. In iwlwifi, this --can cause firmware crashes. -- --Since fixing all rate control algorithms will be very difficult, --just provide locking for invocations. This protects the internal --data structures the algorithms maintain. -- --I've manipulated hostapd to test this, by having it change its --advertised bandwidth roughly ever 150ms. At the same time, I'm --running a flood ping between the client and the AP, which causes --this race of update vs. get_rate/status to easily happen on the --client. With this change, the system survives this test. -- --Reported-by: Sven Eckelmann --Signed-off-by: Johannes Berg ----- -- ----- a/net/mac80211/rate.c --+++ b/net/mac80211/rate.c --@@ -683,7 +683,13 @@ void rate_control_get_rate(struct ieee80 -- if (sdata->local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL) -- return; -- --- ref->ops->get_rate(ref->priv, ista, priv_sta, txrc); --+ if (ista) { --+ spin_lock_bh(&sta->rate_ctrl_lock); --+ ref->ops->get_rate(ref->priv, ista, priv_sta, txrc); --+ spin_unlock_bh(&sta->rate_ctrl_lock); --+ } else { --+ ref->ops->get_rate(ref->priv, NULL, NULL, txrc); --+ } -- -- if (sdata->local->hw.flags & IEEE80211_HW_SUPPORTS_RC_TABLE) -- return; ----- a/net/mac80211/rate.h --+++ b/net/mac80211/rate.h --@@ -42,10 +42,12 @@ static inline void rate_control_tx_statu -- if (!ref || !test_sta_flag(sta, WLAN_STA_RATE_CONTROL)) -- return; -- --+ spin_lock_bh(&sta->rate_ctrl_lock); -- if (ref->ops->tx_status) -- ref->ops->tx_status(ref->priv, sband, ista, priv_sta, skb); -- else -- ref->ops->tx_status_noskb(ref->priv, sband, ista, priv_sta, info); --+ spin_unlock_bh(&sta->rate_ctrl_lock); -- } -- -- static inline void --@@ -64,7 +66,9 @@ rate_control_tx_status_noskb(struct ieee -- if (WARN_ON_ONCE(!ref->ops->tx_status_noskb)) -- return; -- --+ spin_lock_bh(&sta->rate_ctrl_lock); -- ref->ops->tx_status_noskb(ref->priv, sband, ista, priv_sta, info); --+ spin_unlock_bh(&sta->rate_ctrl_lock); -- } -- -- static inline void rate_control_rate_init(struct sta_info *sta) --@@ -91,8 +95,10 @@ static inline void rate_control_rate_ini -- -- 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); -- } --@@ -115,18 +121,20 @@ static inline void rate_control_rate_upd -- 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); -- } -- -- static inline void *rate_control_alloc_sta(struct rate_control_ref *ref, --- struct ieee80211_sta *sta, --- gfp_t gfp) --+ struct sta_info *sta, gfp_t gfp) -- { --- return ref->ops->alloc_sta(ref->priv, sta, gfp); --+ spin_lock_init(&sta->rate_ctrl_lock); --+ return ref->ops->alloc_sta(ref->priv, &sta->sta, gfp); -- } -- -- static inline void rate_control_free_sta(struct sta_info *sta) ----- a/net/mac80211/sta_info.c --+++ b/net/mac80211/sta_info.c --@@ -286,7 +286,7 @@ static int sta_prepare_rate_control(stru -- -- sta->rate_ctrl = local->rate_ctrl; -- sta->rate_ctrl_priv = rate_control_alloc_sta(sta->rate_ctrl, --- &sta->sta, gfp); --+ sta, gfp); -- if (!sta->rate_ctrl_priv) -- return -ENOMEM; -- ----- a/net/mac80211/sta_info.h --+++ b/net/mac80211/sta_info.h --@@ -349,6 +349,7 @@ struct sta_info { -- u8 ptk_idx; -- struct rate_control_ref *rate_ctrl; -- void *rate_ctrl_priv; --+ spinlock_t rate_ctrl_lock; -- spinlock_t lock; -- -- struct work_struct drv_deliver_wk; -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 ---- a/package/kernel/mac80211/patches/302-ath9k-restart-only-triggering-DFS-detector-line.patch -+++ /dev/null -@@ -1,21 +0,0 @@ --From: Zefir Kurtisi --Date: Tue, 10 Mar 2015 17:49:29 +0100 --Subject: [PATCH] ath9k: restart only triggering DFS detector line -- --To support HT40 DFS mode, a triggering detector must --reset only itself but not other detector lines. -- --Signed-off-by: Zefir Kurtisi ----- -- ----- a/drivers/net/wireless/ath/dfs_pattern_detector.c --+++ b/drivers/net/wireless/ath/dfs_pattern_detector.c --@@ -289,7 +289,7 @@ dpd_add_pulse(struct dfs_pattern_detecto -- "count=%d, count_false=%d\n", -- event->freq, pd->rs->type_id, -- ps->pri, ps->count, ps->count_falses); --- channel_detector_reset(dpd, cd); --+ pd->reset(pd, dpd->last_pulse_ts); -- 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 ---- a/package/kernel/mac80211/patches/303-ath9k-add-DFS-support-for-extension-channel.patch -+++ /dev/null -@@ -1,76 +0,0 @@ --From: Zefir Kurtisi --Date: Tue, 10 Mar 2015 17:49:30 +0100 --Subject: [PATCH] ath9k: add DFS support for extension channel -- --In HT40 modes, pulse events on primary and extension --channel are processed individually. If valid, a pulse --event will be fed into the detector --* for primary frequency, or --* for extension frequency (+/-20MHz based on HT40-mode) --* or both -- --With that, a 40MHz radar will result in two individual --radar events. -- --Signed-off-by: Zefir Kurtisi ----- -- ----- a/drivers/net/wireless/ath/ath9k/dfs.c --+++ b/drivers/net/wireless/ath/ath9k/dfs.c --@@ -126,8 +126,19 @@ ath9k_postprocess_radar_event(struct ath -- DFS_STAT_INC(sc, pulses_detected); -- return true; -- } ---#undef PRI_CH_RADAR_FOUND ---#undef EXT_CH_RADAR_FOUND --+ --+static void --+ath9k_dfs_process_radar_pulse(struct ath_softc *sc, struct pulse_event *pe) --+{ --+ struct dfs_pattern_detector *pd = sc->dfs_detector; --+ DFS_STAT_INC(sc, pulses_processed); --+ if (pd == NULL) --+ return; --+ if (!pd->add_pulse(pd, pe)) --+ return; --+ DFS_STAT_INC(sc, radar_detected); --+ ieee80211_radar_detected(sc->hw); --+} -- -- /* -- * DFS: check PHY-error for radar pulse and feed the detector --@@ -176,18 +187,21 @@ void ath9k_dfs_process_phyerr(struct ath -- ard.pulse_length_pri = vdata_end[-3]; -- pe.freq = ah->curchan->channel; -- pe.ts = mactime; --- if (ath9k_postprocess_radar_event(sc, &ard, &pe)) { --- struct dfs_pattern_detector *pd = sc->dfs_detector; --- ath_dbg(common, DFS, --- "ath9k_dfs_process_phyerr: channel=%d, ts=%llu, " --- "width=%d, rssi=%d, delta_ts=%llu\n", --- pe.freq, pe.ts, pe.width, pe.rssi, --- pe.ts - sc->dfs_prev_pulse_ts); --- sc->dfs_prev_pulse_ts = pe.ts; --- DFS_STAT_INC(sc, pulses_processed); --- if (pd != NULL && pd->add_pulse(pd, &pe)) { --- DFS_STAT_INC(sc, radar_detected); --- ieee80211_radar_detected(sc->hw); --- } --+ if (!ath9k_postprocess_radar_event(sc, &ard, &pe)) --+ return; --+ --+ ath_dbg(common, DFS, --+ "ath9k_dfs_process_phyerr: type=%d, freq=%d, ts=%llu, " --+ "width=%d, rssi=%d, delta_ts=%llu\n", --+ ard.pulse_bw_info, pe.freq, pe.ts, pe.width, pe.rssi, --+ pe.ts - sc->dfs_prev_pulse_ts); --+ sc->dfs_prev_pulse_ts = pe.ts; --+ if (ard.pulse_bw_info & PRI_CH_RADAR_FOUND) --+ ath9k_dfs_process_radar_pulse(sc, &pe); --+ if (ard.pulse_bw_info & EXT_CH_RADAR_FOUND) { --+ pe.freq += IS_CHAN_HT40PLUS(ah->curchan) ? 20 : -20; --+ ath9k_dfs_process_radar_pulse(sc, &pe); -- } -- } --+#undef PRI_CH_RADAR_FOUND --+#undef EXT_CH_RADAR_FOUND -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..7bb7435 ---- /dev/null -+++ 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 -+ -+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/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; -+ -+ /* -+ * 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 ---- a/package/kernel/mac80211/patches/304-ath9k-allow-40MHz-radar-detection-width.patch -+++ /dev/null -@@ -1,19 +0,0 @@ --From: Zefir Kurtisi --Date: Tue, 10 Mar 2015 17:49:31 +0100 --Subject: [PATCH] ath9k: allow 40MHz radar detection width -- --Signed-off-by: Zefir Kurtisi ----- -- ----- a/drivers/net/wireless/ath/ath9k/init.c --+++ b/drivers/net/wireless/ath/ath9k/init.c --@@ -763,7 +763,8 @@ static const struct ieee80211_iface_comb -- .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_20) | --+ BIT(NL80211_CHAN_WIDTH_40), -- } -- #endif -- }; -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..049059a ---- /dev/null -+++ 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 -+ -+Fixes commit 54da20d83f0e ("ath9k_hw: improve ANI processing and rx desensitizing parameters") -+ -+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/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); -+ } -+- ath9k_ani_restart(ah); -+ } -+ } -+ 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 ---- a/package/kernel/mac80211/patches/305-ath5k-channel-change-fix.patch -+++ /dev/null -@@ -1,137 +0,0 @@ --From: Sergey Ryazanov --Date: Wed, 4 Mar 2015 05:12:10 +0300 --Subject: [PATCH] ath5k: channel change fix -- --ath5k updates the channel pointer and after that it stops the Rx logic --and apply channel to HW. In case of channel switch, such sequence --creates a small window when a frame, which is received on the old --channel is considered as a frame received on the new one. -- --The most notable consequence of this situation occurs during the switch --from 2 GHz band (CCK+OFDM) to the 5GHz band (OFDM-only). Frame received --with CCK rate, e.g. beacon received at the 1mbps, causes the following --warning: -- -- WARNING: at ath5k/base.c:589 ath5k_tasklet_rx+0x318/0x6ec [ath5k]() -- invalid hw_rix: 1a -- [..] -- Call Trace: -- [<802656a8>] show_stack+0x48/0x70 -- [<802dd92c>] warn_slowpath_common+0x88/0xbc -- [<802dd98c>] warn_slowpath_fmt+0x2c/0x38 -- [<81b51be8>] ath5k_tasklet_rx+0x318/0x6ec [ath5k] -- [<8028ac64>] tasklet_action+0x8c/0xf0 -- [<80075804>] __do_softirq+0x180/0x32c -- [<80196ce8>] irq_exit+0x54/0x70 -- [<80041848>] ret_from_irq+0x0/0x4 -- [<80182fdc>] ioread32+0x4/0xc -- [<81b4c42c>] ath5k_hw_set_sleep_clock+0x2ec/0x474 [ath5k] -- [<81b4cf28>] ath5k_hw_reset+0x50/0xeb8 [ath5k] -- [<81b50900>] ath5k_reset+0xd4/0x310 [ath5k] -- [<81b557e8>] ath5k_config+0x4c/0x104 [ath5k] -- [<80d01770>] ieee80211_hw_config+0x2f4/0x35c [mac80211] -- [<80d09aa8>] ieee80211_scan_work+0x2e4/0x414 [mac80211] -- [<8022c3f4>] process_one_work+0x28c/0x400 -- [<802df8f8>] worker_thread+0x258/0x3c0 -- [<801b5710>] kthread+0xe0/0xec -- [<800418a8>] ret_from_kernel_thread+0x14/0x1c -- --The easiest way to reproduce this warning is to run scan with dualband --NIC in noisy environments, when the channel 11 runs multiple APs. In my --tests if the APs num >= 12, the warning appears in the first few --seconds of scanning. -- --In order to fix this, the Rx disable code moved to a higher level and --placed before the channel pointer update. This is also makes the code a --bit more symmetrical, since we disable and enable the Rx in the same --function. -- --In fact, at the pointer update time new frames should not appear, --because interrupt generation at this point should already be disabled. --The next patch should address this issue. -- --CC: Jiri Slaby --CC: Nick Kossifidis --CC: Luis R. Rodriguez --Reported-by: Christophe Prevotaux --Tested-by: Christophe Prevotaux --Tested-by: Eric Bree --Signed-off-by: Sergey Ryazanov ----- -- ----- a/drivers/net/wireless/ath/ath5k/base.c --+++ b/drivers/net/wireless/ath/ath5k/base.c --@@ -2858,7 +2858,7 @@ ath5k_reset(struct ath5k_hw *ah, struct -- { -- struct ath_common *common = ath5k_hw_common(ah); -- int ret, ani_mode; --- bool fast; --+ bool fast = chan && modparam_fastchanswitch ? 1 : 0; -- -- ATH5K_DBG(ah, ATH5K_DEBUG_RESET, "resetting\n"); -- --@@ -2876,11 +2876,29 @@ ath5k_reset(struct ath5k_hw *ah, struct -- * so we should also free any remaining -- * tx buffers */ -- ath5k_drain_tx_buffs(ah); --+ --+ /* Stop PCU */ --+ ath5k_hw_stop_rx_pcu(ah); --+ --+ /* Stop DMA --+ * --+ * Note: If DMA didn't stop continue --+ * since only a reset will fix it. --+ */ --+ ret = ath5k_hw_dma_stop(ah); --+ --+ /* RF Bus grant won't work if we have pending --+ * frames --+ */ --+ if (ret && fast) { --+ ATH5K_DBG(ah, ATH5K_DEBUG_RESET, --+ "DMA didn't stop, falling back to normal reset\n"); --+ fast = false; --+ } --+ -- if (chan) -- ah->curchan = chan; -- --- fast = ((chan != NULL) && modparam_fastchanswitch) ? 1 : 0; --- -- ret = ath5k_hw_reset(ah, ah->opmode, ah->curchan, fast, skip_pcu); -- if (ret) { -- ATH5K_ERR(ah, "can't reset hardware (%d)\n", ret); ----- a/drivers/net/wireless/ath/ath5k/reset.c --+++ b/drivers/net/wireless/ath/ath5k/reset.c --@@ -1169,30 +1169,6 @@ ath5k_hw_reset(struct ath5k_hw *ah, enum -- if (ah->ah_version == AR5K_AR5212) -- ath5k_hw_set_sleep_clock(ah, false); -- --- /* --- * Stop PCU --- */ --- ath5k_hw_stop_rx_pcu(ah); --- --- /* --- * Stop DMA --- * --- * Note: If DMA didn't stop continue --- * since only a reset will fix it. --- */ --- ret = ath5k_hw_dma_stop(ah); --- --- /* RF Bus grant won't work if we have pending --- * frames */ --- if (ret && fast) { --- ATH5K_DBG(ah, ATH5K_DEBUG_RESET, --- "DMA didn't stop, falling back to normal reset\n"); --- fast = false; --- /* Non fatal, just continue with --- * normal reset */ --- ret = 0; --- } --- -- mode = channel->hw_value; -- switch (mode) { -- case AR5K_MODE_11A: -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..a1ac67c ---- /dev/null -+++ 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 -+ -+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: Miaoqing Pan -+--- -+ -+--- 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 -+ -+ static void ath9k_ani_restart(struct ath_hw *ah) -+ { -+- struct ar5416AniState *aniState; -+- -+- if (!ah->curchan) -+- return; -++ struct ar5416AniState *aniState = &ah->ani; -+ -+- 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; -+- -+- aniState = &ah->ani; -++ struct ar5416AniState *aniState = &ah->ani; -+ -+ 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 -+ -+ 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 (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; -+ -+ /* 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; -+ -+- if (!ah->curchan) -++ if (!chan) -+ return; -+ -+ BUG_ON(aniState == NULL); -+@@ -416,14 +400,10 @@ static bool ath9k_hw_ani_read_counters(s -+ -+ 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; -+ -+- if (!ah->curchan) -+- return; -+- -+- aniState = &ah->ani; -+ if (!ath9k_hw_ani_read_counters(ah)) -+ return; -+ -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 ---- a/package/kernel/mac80211/patches/306-ath5k-fix-reset-race.patch -+++ /dev/null -@@ -1,96 +0,0 @@ --From: Sergey Ryazanov --Date: Wed, 4 Mar 2015 05:12:11 +0300 --Subject: [PATCH] ath5k: fix reset race -- --To prepare for reset ath5k should finish all asynchronous tasks. At --first, it disables the interrupt generation, then it waits for the --interrupt handler and tasklets completion, and then proceeds to the HW --configuration update. But it does not consider that the interrupt --handler or tasklet re-enables the interrupt generation. And we fall in a --situation when ath5k assumes that interrupts are disabled, but it is --not. -- --This can lead to different consequences, such as reception of the frame, --when we do not expect it. Under certain circumstances, this can lead to --the following warning: -- -- WARNING: at ath5k/base.c:589 ath5k_tasklet_rx+0x318/0x6ec [ath5k]() -- invalid hw_rix: 1a -- [..] -- Call Trace: -- [<802656a8>] show_stack+0x48/0x70 -- [<802dd92c>] warn_slowpath_common+0x88/0xbc -- [<802dd98c>] warn_slowpath_fmt+0x2c/0x38 -- [<81b51be8>] ath5k_tasklet_rx+0x318/0x6ec [ath5k] -- [<8028ac64>] tasklet_action+0x8c/0xf0 -- [<80075804>] __do_softirq+0x180/0x32c -- [<80196ce8>] irq_exit+0x54/0x70 -- [<80041848>] ret_from_irq+0x0/0x4 -- [<80182fdc>] ioread32+0x4/0xc -- [<81b4c42c>] ath5k_hw_set_sleep_clock+0x2ec/0x474 [ath5k] -- [<81b4cf28>] ath5k_hw_reset+0x50/0xeb8 [ath5k] -- [<81b50900>] ath5k_reset+0xd4/0x310 [ath5k] -- [<81b557e8>] ath5k_config+0x4c/0x104 [ath5k] -- [<80d01770>] ieee80211_hw_config+0x2f4/0x35c [mac80211] -- [<80d09aa8>] ieee80211_scan_work+0x2e4/0x414 [mac80211] -- [<8022c3f4>] process_one_work+0x28c/0x400 -- [<802df8f8>] worker_thread+0x258/0x3c0 -- [<801b5710>] kthread+0xe0/0xec -- [<800418a8>] ret_from_kernel_thread+0x14/0x1c -- --Fix this issue by adding a new status flag, which forbids to re-enable --the interrupt generation until the HW configuration is completed. -- --Note: previous patch, which reorders the Rx disable code helps to avoid --the above warning, but not fixes the root cause of unexpected frame --receiving. -- --CC: Jiri Slaby --CC: Nick Kossifidis --CC: Luis R. Rodriguez --Reported-by: Christophe Prevotaux --Tested-by: Christophe Prevotaux --Tested-by: Eric Bree --Signed-off-by: Sergey Ryazanov ----- -- ----- a/drivers/net/wireless/ath/ath5k/ath5k.h --+++ b/drivers/net/wireless/ath/ath5k/ath5k.h --@@ -1283,6 +1283,7 @@ struct ath5k_hw { -- #define ATH_STAT_PROMISC 1 -- #define ATH_STAT_LEDSOFT 2 /* enable LED gpio status */ -- #define ATH_STAT_STARTED 3 /* opened & irqs enabled */ --+#define ATH_STAT_RESET 4 /* hw reset */ -- -- unsigned int filter_flags; /* HW flags, AR5K_RX_FILTER_* */ -- unsigned int fif_filter_flags; /* Current FIF_* filter flags */ ----- a/drivers/net/wireless/ath/ath5k/base.c --+++ b/drivers/net/wireless/ath/ath5k/base.c --@@ -1523,6 +1523,9 @@ ath5k_set_current_imask(struct ath5k_hw -- enum ath5k_int imask; -- unsigned long flags; -- --+ if (test_bit(ATH_STAT_RESET, ah->status)) --+ return; --+ -- spin_lock_irqsave(&ah->irqlock, flags); -- imask = ah->imask; -- if (ah->rx_pending) --@@ -2862,6 +2865,8 @@ ath5k_reset(struct ath5k_hw *ah, struct -- -- ATH5K_DBG(ah, ATH5K_DEBUG_RESET, "resetting\n"); -- --+ __set_bit(ATH_STAT_RESET, ah->status); --+ -- ath5k_hw_set_imr(ah, 0); -- synchronize_irq(ah->irq); -- ath5k_stop_tasklets(ah); --@@ -2952,6 +2957,8 @@ ath5k_reset(struct ath5k_hw *ah, struct -- */ -- /* ath5k_chan_change(ah, c); */ -- --+ __clear_bit(ATH_STAT_RESET, ah->status); --+ -- ath5k_beacon_config(ah); -- /* intrs are enabled by ath5k_beacon_config */ -- -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..cf8194a ---- /dev/null -+++ 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 -+ -+BB panic(0x4000409) observed while AP enabling/disabling -+bursting. -+ -+Signed-off-by: Miaoqing Pan -+--- -+ -+--- 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. -+ */ -+ -+ /* -+@@ -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 ---- a/package/kernel/mac80211/patches/307-ath9k-fix-tracking-of-enabled-AP-beacons.patch -+++ /dev/null -@@ -1,76 +0,0 @@ --From: Felix Fietkau --Date: Thu, 12 Mar 2015 17:10:50 +0100 --Subject: [PATCH] ath9k: fix tracking of enabled AP beacons -- --sc->nbcnvifs tracks assigned beacon slots, not enabled beacons. --Therefore, it cannot be used to decide if cur_conf->enable_beacon (bool) --should be updated, or if beacons have been enabled already. --With the current code (depending on the order of calls), beacons often --do not get enabled in an AP+STA setup. --To fix tracking of enabled beacons, convert cur_conf->enable_beacon to a --bitmask of enabled beacon slots. -- --Cc: stable@vger.kernel.org --Signed-off-by: Felix Fietkau ----- -- ----- a/drivers/net/wireless/ath/ath9k/beacon.c --+++ b/drivers/net/wireless/ath/ath9k/beacon.c --@@ -219,12 +219,15 @@ void ath9k_beacon_remove_slot(struct ath -- struct ath_common *common = ath9k_hw_common(sc->sc_ah); -- struct ath_vif *avp = (void *)vif->drv_priv; -- struct ath_buf *bf = avp->av_bcbuf; --+ struct ath_beacon_config *cur_conf = &sc->cur_chan->beacon; -- -- ath_dbg(common, CONFIG, "Removing interface at beacon slot: %d\n", -- avp->av_bslot); -- -- tasklet_disable(&sc->bcon_tasklet); -- --+ cur_conf->enable_beacon &= ~BIT(avp->av_bslot); --+ -- if (bf && bf->bf_mpdu) { -- struct sk_buff *skb = bf->bf_mpdu; -- dma_unmap_single(sc->dev, bf->bf_buf_addr, --@@ -521,8 +524,7 @@ static bool ath9k_allow_beacon_config(st -- } -- -- if (sc->sc_ah->opmode == NL80211_IFTYPE_AP) { --- if ((vif->type != NL80211_IFTYPE_AP) || --- (sc->nbcnvifs > 1)) { --+ if (vif->type != NL80211_IFTYPE_AP) { -- ath_dbg(common, CONFIG, -- "An AP interface is already present !\n"); -- return false; --@@ -616,12 +618,14 @@ void ath9k_beacon_config(struct ath_soft -- * enabling/disabling SWBA. -- */ -- if (changed & BSS_CHANGED_BEACON_ENABLED) { --- if (!bss_conf->enable_beacon && --- (sc->nbcnvifs <= 1)) { --- cur_conf->enable_beacon = false; --- } else if (bss_conf->enable_beacon) { --- cur_conf->enable_beacon = true; --- ath9k_cache_beacon_config(sc, ctx, bss_conf); --+ bool enabled = cur_conf->enable_beacon; --+ --+ if (!bss_conf->enable_beacon) { --+ cur_conf->enable_beacon &= ~BIT(avp->av_bslot); --+ } else { --+ cur_conf->enable_beacon |= BIT(avp->av_bslot); --+ if (!enabled) --+ ath9k_cache_beacon_config(sc, ctx, bss_conf); -- } -- } -- ----- a/drivers/net/wireless/ath/ath9k/common.h --+++ b/drivers/net/wireless/ath/ath9k/common.h --@@ -54,7 +54,7 @@ struct ath_beacon_config { -- u16 dtim_period; -- u16 bmiss_timeout; -- u8 dtim_count; --- bool enable_beacon; --+ u8 enable_beacon; -- bool ibss_creator; -- u32 nexttbtt; -- u32 intval; -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..d408866 ---- /dev/null -+++ 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 -+ -+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. -+ -+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. -+ -+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 -+--- -+ -+--- 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); -++ } -++ -+ REG_WRITE(ah, AR_RTC_RC, rst_flags); -+ -+ 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 -+ -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 ---- a/package/kernel/mac80211/patches/308-mac80211-minstrel_ht-fix-rounding-issue-in-MCS-durat.patch -+++ /dev/null -@@ -1,43 +0,0 @@ --From: Felix Fietkau --Date: Fri, 13 Mar 2015 10:49:40 +0100 --Subject: [PATCH] mac80211: minstrel_ht: fix rounding issue in MCS duration -- calculation -- --On very high MCS bitrates, the calculated duration of rates that are --next to each other can be very imprecise, due to the small packet size --used as reference (1200 bytes). --This is most visible in VHT80 nss=2 MCS8/9, for which minstrel shows the --same throughput when the probability is also the same. This leads to a --bad rate selection for such rates. -- --Fix this issue by introducing an average A-MPDU size factor into the --calculation. -- --Signed-off-by: Felix Fietkau ----- -- ----- a/net/mac80211/rc80211_minstrel_ht.c --+++ b/net/mac80211/rc80211_minstrel_ht.c --@@ -17,10 +17,11 @@ -- #include "rc80211_minstrel.h" -- #include "rc80211_minstrel_ht.h" -- --+#define AVG_AMPDU_SIZE 16 -- #define AVG_PKT_SIZE 1200 -- -- /* Number of bits for an average sized packet */ ---#define MCS_NBITS (AVG_PKT_SIZE << 3) --+#define MCS_NBITS ((AVG_PKT_SIZE * AVG_AMPDU_SIZE) << 3) -- -- /* Number of symbols for a packet with (bps) bits per symbol */ -- #define MCS_NSYMS(bps) DIV_ROUND_UP(MCS_NBITS, (bps)) --@@ -33,7 +34,8 @@ -- ) -- -- /* Transmit duration for the raw data part of an average sized packet */ ---#define MCS_DURATION(streams, sgi, bps) MCS_SYMBOL_TIME(sgi, MCS_NSYMS((streams) * (bps))) --+#define MCS_DURATION(streams, sgi, bps) \ --+ (MCS_SYMBOL_TIME(sgi, MCS_NSYMS((streams) * (bps))) / AVG_AMPDU_SIZE) -- -- #define BW_20 0 -- #define BW_40 1 -diff --git a/package/kernel/mac80211/patches/309-01-brcmfmac-add-missing-include.patch b/package/kernel/mac80211/patches/309-01-brcmfmac-add-missing-include.patch -new file mode 100644 -index 0000000..d9511c8 ---- /dev/null -+++ b/package/kernel/mac80211/patches/309-01-brcmfmac-add-missing-include.patch -@@ -0,0 +1,19 @@ -+From: Felix Fietkau -+Date: Fri, 15 Jan 2016 15:59:45 +0100 -+Subject: [PATCH] brcmfmac: add missing include -+ -+linux/module.h is required for defining module parameters -+ -+Signed-off-by: Felix Fietkau -+--- -+ -+--- 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/309-02-brcmfmac-fix-sdio-sg-table-alloc-crash.patch b/package/kernel/mac80211/patches/309-02-brcmfmac-fix-sdio-sg-table-alloc-crash.patch -new file mode 100644 -index 0000000..711e019 ---- /dev/null -+++ b/package/kernel/mac80211/patches/309-02-brcmfmac-fix-sdio-sg-table-alloc-crash.patch -@@ -0,0 +1,118 @@ -+From: Hante Meuleman -+Date: Tue, 19 Jan 2016 12:39:24 +0100 -+Subject: [PATCH] brcmfmac: fix sdio sg table alloc crash -+ -+With commit 7d34b0560567 ("brcmfmac: Move all module parameters to -+one place") a bug was introduced causing a null pointer exception. -+This patch fixes the bug by initializing the sg table till after -+the settings have been initialized. -+ -+Fixes: 7d34b0560567 ("brcmfmac: Move all module parameters to one place") -+Reported-by: Marc Zyngier -+Tested-by: Marc Zyngier -+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/broadcom/brcm80211/brcmfmac/bcmsdh.c -++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c -+@@ -879,11 +879,24 @@ int brcmf_sdiod_abort(struct brcmf_sdio_ -+ return 0; -+ } -+ -+-static void brcmf_sdiod_sgtable_alloc(struct brcmf_sdio_dev *sdiodev) -++void brcmf_sdiod_sgtable_alloc(struct brcmf_sdio_dev *sdiodev) -+ { -++ struct sdio_func *func; -++ struct mmc_host *host; -++ uint max_blocks; -+ uint nents; -+ int err; -+ -++ func = sdiodev->func[2]; -++ host = func->card->host; -++ sdiodev->sg_support = host->max_segs > 1; -++ max_blocks = min_t(uint, host->max_blk_count, 511u); -++ sdiodev->max_request_size = min_t(uint, host->max_req_size, -++ max_blocks * func->cur_blksize); -++ sdiodev->max_segment_count = min_t(uint, host->max_segs, -++ SG_MAX_SINGLE_ALLOC); -++ sdiodev->max_segment_size = host->max_seg_size; -++ -+ if (!sdiodev->sg_support) -+ return; -+ -+@@ -1021,9 +1034,6 @@ static void brcmf_sdiod_host_fixup(struc -+ -+ static int brcmf_sdiod_probe(struct brcmf_sdio_dev *sdiodev) -+ { -+- struct sdio_func *func; -+- struct mmc_host *host; -+- uint max_blocks; -+ int ret = 0; -+ -+ sdiodev->num_funcs = 2; -+@@ -1054,26 +1064,6 @@ static int brcmf_sdiod_probe(struct brcm -+ goto out; -+ } -+ -+- /* -+- * determine host related variables after brcmf_sdiod_probe() -+- * as func->cur_blksize is properly set and F2 init has been -+- * completed successfully. -+- */ -+- func = sdiodev->func[2]; -+- host = func->card->host; -+- sdiodev->sg_support = host->max_segs > 1; -+- max_blocks = min_t(uint, host->max_blk_count, 511u); -+- sdiodev->max_request_size = min_t(uint, host->max_req_size, -+- max_blocks * func->cur_blksize); -+- sdiodev->max_segment_count = min_t(uint, host->max_segs, -+- SG_MAX_SINGLE_ALLOC); -+- sdiodev->max_segment_size = host->max_seg_size; -+- -+- /* allocate scatter-gather table. sg support -+- * will be disabled upon allocation failure. -+- */ -+- brcmf_sdiod_sgtable_alloc(sdiodev); -+- -+ ret = brcmf_sdiod_freezer_attach(sdiodev); -+ if (ret) -+ goto out; -+@@ -1084,7 +1074,7 @@ static int brcmf_sdiod_probe(struct brcm -+ ret = -ENODEV; -+ goto out; -+ } -+- brcmf_sdiod_host_fixup(host); -++ brcmf_sdiod_host_fixup(sdiodev->func[2]->card->host); -+ out: -+ if (ret) -+ brcmf_sdiod_remove(sdiodev); -+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c -++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c -+@@ -4114,6 +4114,11 @@ struct brcmf_sdio *brcmf_sdio_probe(stru -+ goto fail; -+ } -+ -++ /* allocate scatter-gather table. sg support -++ * will be disabled upon allocation failure. -++ */ -++ brcmf_sdiod_sgtable_alloc(bus->sdiodev); -++ -+ /* Query the F2 block size, set roundup accordingly */ -+ bus->blocksize = bus->sdiodev->func[2]->cur_blksize; -+ bus->roundup = min(max_roundup, bus->blocksize); -+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h -++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h -+@@ -342,6 +342,7 @@ int brcmf_sdiod_ramrw(struct brcmf_sdio_ -+ -+ /* Issue an abort to the specified function */ -+ int brcmf_sdiod_abort(struct brcmf_sdio_dev *sdiodev, uint fn); -++void brcmf_sdiod_sgtable_alloc(struct brcmf_sdio_dev *sdiodev); -+ void brcmf_sdiod_change_state(struct brcmf_sdio_dev *sdiodev, -+ enum brcmf_sdiod_state state); -+ #ifdef CONFIG_PM_SLEEP -diff --git a/package/kernel/mac80211/patches/309-ath9k-disable-TPC-support-again-for-now.patch b/package/kernel/mac80211/patches/309-ath9k-disable-TPC-support-again-for-now.patch -deleted file mode 100644 -index 945fbce..0000000 ---- a/package/kernel/mac80211/patches/309-ath9k-disable-TPC-support-again-for-now.patch -+++ /dev/null -@@ -1,22 +0,0 @@ --From: Felix Fietkau --Date: Sun, 15 Mar 2015 08:02:37 +0100 --Subject: [PATCH] ath9k: disable TPC support again (for now) -- --TPC support has been observed to cause some tx power fluctuations on --some devices with at least AR934x and AR938x chips. --Disable it for now until the bugs have been found and fixed -- --Signed-off-by: Felix Fietkau ----- -- ----- a/drivers/net/wireless/ath/ath9k/hw.c --+++ b/drivers/net/wireless/ath/ath9k/hw.c --@@ -424,7 +424,7 @@ static void ath9k_hw_init_defaults(struc -- ah->power_mode = ATH9K_PM_UNDEFINED; -- ah->htc_reset_init = true; -- --- ah->tpc_enabled = true; --+ ah->tpc_enabled = false; -- -- ah->ani_function = ATH9K_ANI_ALL; -- if (!AR_SREV_9300_20_OR_LATER(ah)) -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 ---- a/package/kernel/mac80211/patches/310-mac80211-don-t-look-up-stations-for-multicast-addres.patch -+++ /dev/null -@@ -1,21 +0,0 @@ --From: Johannes Berg --Date: Tue, 24 Feb 2015 00:28:18 +0100 --Subject: [PATCH] mac80211: don't look up stations for multicast addresses -- --Since multicast addresses don't exist as stations, don't attempt --to look them up in the hashtable on TX. -- --Signed-off-by: Johannes Berg ----- -- ----- a/net/mac80211/tx.c --+++ b/net/mac80211/tx.c --@@ -1161,7 +1161,7 @@ ieee80211_tx_prepare(struct ieee80211_su -- tx->sdata->control_port_protocol == tx->skb->protocol) { -- tx->sta = sta_info_get_bss(sdata, hdr->addr1); -- } --- if (!tx->sta) --+ if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) -- 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/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..070efa9 ---- /dev/null -+++ 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 -+ -+Signed-off-by: Felix Fietkau -+--- -+ -+--- 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 -+ -+ #endif /* CPTCFG_ATH9K_CHANNEL_CONTEXT */ -+ -+-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) }, -+-}; -+- -+ 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 ---- a/package/kernel/mac80211/patches/311-mac80211-remove-drop_unencrypted-code.patch -+++ /dev/null -@@ -1,130 +0,0 @@ --From: Johannes Berg --Date: Fri, 20 Mar 2015 11:41:58 +0100 --Subject: [PATCH] mac80211: remove drop_unencrypted code -- --This mechanism was historic, and only ever used by IBSS, which --also doesn't need to have it as it properly manages station's --802.1X PAE state (or, with WEP, always has a key.) -- --Remove the mechanism to clean up the code. -- --Signed-off-by: Johannes Berg ----- -- ----- a/net/mac80211/debugfs.c --+++ b/net/mac80211/debugfs.c --@@ -274,8 +274,6 @@ void debugfs_hw_add(struct ieee80211_loc -- #ifdef CPTCFG_MAC80211_DEBUG_COUNTERS -- DEBUGFS_STATS_ADD(tx_handlers_drop, local->tx_handlers_drop); -- DEBUGFS_STATS_ADD(tx_handlers_queued, local->tx_handlers_queued); --- DEBUGFS_STATS_ADD(tx_handlers_drop_unencrypted, --- local->tx_handlers_drop_unencrypted); -- DEBUGFS_STATS_ADD(tx_handlers_drop_fragment, -- local->tx_handlers_drop_fragment); -- DEBUGFS_STATS_ADD(tx_handlers_drop_wep, ----- a/net/mac80211/debugfs_netdev.c --+++ b/net/mac80211/debugfs_netdev.c --@@ -177,7 +177,6 @@ static ssize_t ieee80211_if_write_##name -- IEEE80211_IF_FILE_R(name) -- -- /* common attributes */ ---IEEE80211_IF_FILE(drop_unencrypted, drop_unencrypted, DEC); -- IEEE80211_IF_FILE(rc_rateidx_mask_2ghz, rc_rateidx_mask[IEEE80211_BAND_2GHZ], -- HEX); -- IEEE80211_IF_FILE(rc_rateidx_mask_5ghz, rc_rateidx_mask[IEEE80211_BAND_5GHZ], --@@ -562,7 +561,6 @@ IEEE80211_IF_FILE(dot11MeshAwakeWindowDu -- -- static void add_common_files(struct ieee80211_sub_if_data *sdata) -- { --- DEBUGFS_ADD(drop_unencrypted); -- DEBUGFS_ADD(rc_rateidx_mask_2ghz); -- DEBUGFS_ADD(rc_rateidx_mask_5ghz); -- DEBUGFS_ADD(rc_rateidx_mcs_mask_2ghz); ----- a/net/mac80211/ibss.c --+++ b/net/mac80211/ibss.c --@@ -249,8 +249,6 @@ static void __ieee80211_sta_join_ibss(st -- if (presp) -- kfree_rcu(presp, rcu_head); -- --- sdata->drop_unencrypted = capability & WLAN_CAPABILITY_PRIVACY ? 1 : 0; --- -- /* make a copy of the chandef, it could be modified below. */ -- chandef = *req_chandef; -- chan = chandef.chan; --@@ -1289,8 +1287,6 @@ static void ieee80211_sta_create_ibss(st -- -- if (ifibss->privacy) -- capability |= WLAN_CAPABILITY_PRIVACY; --- else --- sdata->drop_unencrypted = 0; -- -- __ieee80211_sta_join_ibss(sdata, bssid, sdata->vif.bss_conf.beacon_int, -- &ifibss->chandef, ifibss->basic_rates, ----- a/net/mac80211/ieee80211_i.h --+++ b/net/mac80211/ieee80211_i.h --@@ -842,8 +842,6 @@ struct ieee80211_sub_if_data { -- -- unsigned long state; -- --- int drop_unencrypted; --- -- char name[IFNAMSIZ]; -- -- /* Fragment table for host-based reassembly */ --@@ -1289,7 +1287,6 @@ struct ieee80211_local { -- /* TX/RX handler statistics */ -- unsigned int tx_handlers_drop; -- unsigned int tx_handlers_queued; --- unsigned int tx_handlers_drop_unencrypted; -- unsigned int tx_handlers_drop_fragment; -- unsigned int tx_handlers_drop_wep; -- unsigned int tx_handlers_drop_not_assoc; ----- a/net/mac80211/iface.c --+++ b/net/mac80211/iface.c --@@ -1535,7 +1535,6 @@ int ieee80211_if_change_type(struct ieee -- } -- -- /* reset some values that shouldn't be kept across type changes */ --- sdata->drop_unencrypted = 0; -- if (type == NL80211_IFTYPE_STATION) -- sdata->u.mgd.use_4addr = false; -- ----- a/net/mac80211/rx.c --+++ b/net/mac80211/rx.c --@@ -1897,8 +1897,7 @@ static int ieee80211_drop_unencrypted(st -- /* Drop unencrypted frames if key is set. */ -- if (unlikely(!ieee80211_has_protected(fc) && -- !ieee80211_is_nullfunc(fc) && --- ieee80211_is_data(fc) && --- (rx->key || rx->sdata->drop_unencrypted))) --+ ieee80211_is_data(fc) && rx->key)) -- return -EACCES; -- -- return 0; ----- a/net/mac80211/tx.c --+++ b/net/mac80211/tx.c --@@ -594,23 +594,8 @@ ieee80211_tx_h_select_key(struct ieee802 -- else if (!is_multicast_ether_addr(hdr->addr1) && -- (key = rcu_dereference(tx->sdata->default_unicast_key))) -- tx->key = key; --- else if (info->flags & IEEE80211_TX_CTL_INJECTED) --+ else -- tx->key = NULL; --- else if (!tx->sdata->drop_unencrypted) --- tx->key = NULL; --- else if (tx->skb->protocol == tx->sdata->control_port_protocol) --- tx->key = NULL; --- else if (ieee80211_is_robust_mgmt_frame(tx->skb) && --- !(ieee80211_is_action(hdr->frame_control) && --- tx->sta && test_sta_flag(tx->sta, WLAN_STA_MFP))) --- tx->key = NULL; --- else if (ieee80211_is_mgmt(hdr->frame_control) && --- !ieee80211_is_robust_mgmt_frame(tx->skb)) --- tx->key = NULL; --- else { --- I802_DEBUG_INC(tx->local->tx_handlers_drop_unencrypted); --- return TX_DROP; --- } -- -- if (tx->key) { -- bool skip_hw = false; -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 ---- a/package/kernel/mac80211/patches/312-mac80211-don-t-look-up-destination-station-twice.patch -+++ /dev/null -@@ -1,71 +0,0 @@ --From: Johannes Berg --Date: Fri, 20 Mar 2015 16:24:21 +0100 --Subject: [PATCH] mac80211: don't look up destination station twice -- --There's no need to look up the destination station twice while --building the 802.11 header for a given frame if the frame will --actually be transmitted to the station we initially looked up. -- --This happens for 4-addr VLAN interfaces and TDLS connections, which --both directly send the frame to the station they looked up, though --in the case of TDLS some station conditions need to be checked. -- --To avoid that, add a variable indicating that we've looked up the --station that the frame is going to be transmitted to, and avoid the --lookup/flag checking if it already has been done. -- --In the TDLS case, also move the authorized/wme_sta flag assignment --to the correct place, i.e. only when that station is really used. --Before this change, the new lookup should always have succeeded so --that the potentially erroneous data would be overwritten. -- --Signed-off-by: Johannes Berg ----- -- ----- a/net/mac80211/tx.c --+++ b/net/mac80211/tx.c --@@ -1894,6 +1894,7 @@ static struct sk_buff *ieee80211_build_h -- bool wme_sta = false, authorized = false, tdls_auth = false; -- bool tdls_peer = false, tdls_setup_frame = false; -- bool multicast; --+ bool have_station = false; -- u16 info_id = 0; -- struct ieee80211_chanctx_conf *chanctx_conf; -- struct ieee80211_sub_if_data *ap_sdata; --@@ -1918,6 +1919,7 @@ static struct sk_buff *ieee80211_build_h -- hdrlen = 30; -- authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); -- wme_sta = sta->sta.wme; --+ have_station = true; -- } -- ap_sdata = container_of(sdata->bss, struct ieee80211_sub_if_data, -- u.ap); --@@ -2034,9 +2036,6 @@ static struct sk_buff *ieee80211_build_h -- if (sdata->wdev.wiphy->flags & WIPHY_FLAG_SUPPORTS_TDLS) { -- sta = sta_info_get(sdata, skb->data); -- if (sta) { --- authorized = test_sta_flag(sta, --- WLAN_STA_AUTHORIZED); --- wme_sta = sta->sta.wme; -- tdls_peer = test_sta_flag(sta, -- WLAN_STA_TDLS_PEER); -- tdls_auth = test_sta_flag(sta, --@@ -2068,6 +2067,9 @@ static struct sk_buff *ieee80211_build_h -- memcpy(hdr.addr2, skb->data + ETH_ALEN, ETH_ALEN); -- memcpy(hdr.addr3, sdata->u.mgd.bssid, ETH_ALEN); -- hdrlen = 24; --+ have_station = true; --+ authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); --+ wme_sta = sta->sta.wme; -- } else if (sdata->u.mgd.use_4addr && -- cpu_to_be16(ethertype) != sdata->control_port_protocol) { -- fc |= cpu_to_le16(IEEE80211_FCTL_FROMDS | --@@ -2130,7 +2132,7 @@ static struct sk_buff *ieee80211_build_h -- * in AP mode) -- */ -- multicast = is_multicast_ether_addr(hdr.addr1); --- if (!multicast) { --+ if (!multicast && !have_station) { -- sta = sta_info_get(sdata, hdr.addr1); -- if (sta) { -- authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); -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..61cafc7 ---- /dev/null -+++ 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 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. -+ -+Fixes: ba8c3d6f16a1 ("mac80211: add an intermediate software queue implementation") -+Signed-off-by: Michal Kazior -+--- -+ -+--- 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); -+ } -+ -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 ---- a/package/kernel/mac80211/patches/313-mac80211-drop-4-addr-VLAN-frames-earlier-if-not-conn.patch -+++ /dev/null -@@ -1,27 +0,0 @@ --From: Johannes Berg --Date: Fri, 20 Mar 2015 16:24:22 +0100 --Subject: [PATCH] mac80211: drop 4-addr VLAN frames earlier if not -- connected -- --If there's no station on the 4-addr VLAN interface, then frames --cannot be transmitted. Drop such frames earlier, before setting --up all the information for them. -- --We should keep the old check though since that code might be used --for other internally-generated frames. -- --Signed-off-by: Johannes Berg ----- -- ----- a/net/mac80211/tx.c --+++ b/net/mac80211/tx.c --@@ -1920,6 +1920,9 @@ static struct sk_buff *ieee80211_build_h -- authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); -- wme_sta = sta->sta.wme; -- have_station = true; --+ } else if (sdata->wdev.use_4addr) { --+ ret = -ENOLINK; --+ goto free; -- } -- ap_sdata = container_of(sdata->bss, struct ieee80211_sub_if_data, -- u.ap); -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..844d43b ---- /dev/null -+++ 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 -+ -+The ieee80211_queue_stopped() expects hw queue -+number but it was given raw WMM AC number instead. -+ -+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/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); -+ } -+ } -+ -+--- 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); -++ -++ /* 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); -++ } -++ -+ 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 ---- a/package/kernel/mac80211/patches/314-mac80211-mesh-avoid-pointless-station-lookup.patch -+++ /dev/null -@@ -1,33 +0,0 @@ --From: Johannes Berg --Date: Fri, 20 Mar 2015 16:24:23 +0100 --Subject: [PATCH] mac80211: mesh: avoid pointless station lookup -- --In ieee80211_build_hdr(), the station is looked up to build the --header correctly (QoS field) and to check for authorization. For --mesh, authorization isn't checked here, and QoS capability is --mandatory, so the station lookup can be avoided. -- --Signed-off-by: Johannes Berg ----- -- ----- a/net/mac80211/tx.c --+++ b/net/mac80211/tx.c --@@ -2130,12 +2130,14 @@ static struct sk_buff *ieee80211_build_h -- } -- -- /* --- * There's no need to try to look up the destination --- * if it is a multicast address (which can only happen --- * in AP mode) --+ * There's no need to try to look up the destination station --+ * if it is a multicast address. In mesh, there's no need to --+ * look up the station at all as it always must be QoS capable --+ * and mesh mode checks authorization later. -- */ -- multicast = is_multicast_ether_addr(hdr.addr1); --- if (!multicast && !have_station) { --+ if (!multicast && !have_station && --+ !ieee80211_vif_is_mesh(&sdata->vif)) { -- 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-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 ---- a/package/kernel/mac80211/patches/315-mac80211-avoid-duplicate-TX-path-station-lookup.patch -+++ /dev/null -@@ -1,267 +0,0 @@ --From: Johannes Berg --Date: Fri, 20 Mar 2015 14:18:27 +0100 --Subject: [PATCH] mac80211: avoid duplicate TX path station lookup -- --Instead of looking up the destination station twice in the TX path --(first to build the header, and then for control processing), save --it when building the header and use it later in the TX path. -- --To avoid having to look up the station in the many callers, allow --those to pass %NULL which keeps the existing lookup. -- --Signed-off-by: Johannes Berg ----- -- ----- a/net/mac80211/cfg.c --+++ b/net/mac80211/cfg.c --@@ -3565,7 +3565,7 @@ static int ieee80211_probe_client(struct -- nullfunc->qos_ctrl = cpu_to_le16(7); -- -- local_bh_disable(); --- ieee80211_xmit(sdata, skb); --+ ieee80211_xmit(sdata, sta, skb); -- local_bh_enable(); -- rcu_read_unlock(); -- ----- a/net/mac80211/ieee80211_i.h --+++ b/net/mac80211/ieee80211_i.h --@@ -1775,7 +1775,8 @@ void mac80211_ev_michael_mic_failure(str -- gfp_t gfp); -- void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata, -- bool bss_notify); ---void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb); --+void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, --+ struct sta_info *sta, struct sk_buff *skb); -- -- void __ieee80211_tx_skb_tid_band(struct ieee80211_sub_if_data *sdata, -- struct sk_buff *skb, int tid, ----- a/net/mac80211/sta_info.c --+++ b/net/mac80211/sta_info.c --@@ -1279,7 +1279,7 @@ static void ieee80211_send_null_response -- } -- -- info->band = chanctx_conf->def.chan->band; --- ieee80211_xmit(sdata, skb); --+ ieee80211_xmit(sdata, sta, skb); -- rcu_read_unlock(); -- } -- ----- a/net/mac80211/tx.c --+++ b/net/mac80211/tx.c --@@ -1110,11 +1110,13 @@ static bool ieee80211_tx_prep_agg(struct -- -- /* -- * initialises @tx --+ * pass %NULL for the station if unknown, a valid pointer if known --+ * or an ERR_PTR() if the station is known not to exist -- */ -- static ieee80211_tx_result -- ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata, -- struct ieee80211_tx_data *tx, --- struct sk_buff *skb) --+ struct sta_info *sta, struct sk_buff *skb) -- { -- struct ieee80211_local *local = sdata->local; -- struct ieee80211_hdr *hdr; --@@ -1137,17 +1139,22 @@ ieee80211_tx_prepare(struct ieee80211_su -- -- hdr = (struct ieee80211_hdr *) skb->data; -- --- if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { --- tx->sta = rcu_dereference(sdata->u.vlan.sta); --- if (!tx->sta && sdata->dev->ieee80211_ptr->use_4addr) --- return TX_DROP; --- } else if (info->flags & (IEEE80211_TX_CTL_INJECTED | --- IEEE80211_TX_INTFL_NL80211_FRAME_TX) || --- tx->sdata->control_port_protocol == tx->skb->protocol) { --- tx->sta = sta_info_get_bss(sdata, hdr->addr1); --+ if (likely(sta)) { --+ if (!IS_ERR(sta)) --+ tx->sta = sta; --+ } else { --+ if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { --+ tx->sta = rcu_dereference(sdata->u.vlan.sta); --+ if (!tx->sta && sdata->wdev.use_4addr) --+ return TX_DROP; --+ } else if (info->flags & (IEEE80211_TX_INTFL_NL80211_FRAME_TX | --+ IEEE80211_TX_CTL_INJECTED) || --+ tx->sdata->control_port_protocol == tx->skb->protocol) { --+ tx->sta = sta_info_get_bss(sdata, hdr->addr1); --+ } --+ if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) --+ tx->sta = sta_info_get(sdata, hdr->addr1); -- } --- if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) --- tx->sta = sta_info_get(sdata, hdr->addr1); -- -- if (tx->sta && ieee80211_is_data_qos(hdr->frame_control) && -- !ieee80211_is_qos_nullfunc(hdr->frame_control) && --@@ -1485,7 +1492,7 @@ bool ieee80211_tx_prepare_skb(struct iee -- struct ieee80211_tx_data tx; -- struct sk_buff *skb2; -- --- if (ieee80211_tx_prepare(sdata, &tx, skb) == TX_DROP) --+ if (ieee80211_tx_prepare(sdata, &tx, NULL, skb) == TX_DROP) -- return false; -- -- info->band = band; --@@ -1518,7 +1525,8 @@ EXPORT_SYMBOL(ieee80211_tx_prepare_skb); -- * Returns false if the frame couldn't be transmitted but was queued instead. -- */ -- static bool ieee80211_tx(struct ieee80211_sub_if_data *sdata, --- struct sk_buff *skb, bool txpending) --+ struct sta_info *sta, struct sk_buff *skb, --+ bool txpending) -- { -- struct ieee80211_local *local = sdata->local; -- struct ieee80211_tx_data tx; --@@ -1534,7 +1542,7 @@ static bool ieee80211_tx(struct ieee8021 -- -- /* initialises tx */ -- led_len = skb->len; --- res_prepare = ieee80211_tx_prepare(sdata, &tx, skb); --+ res_prepare = ieee80211_tx_prepare(sdata, &tx, sta, skb); -- -- if (unlikely(res_prepare == TX_DROP)) { -- ieee80211_free_txskb(&local->hw, skb); --@@ -1590,7 +1598,8 @@ static int ieee80211_skb_resize(struct i -- return 0; -- } -- ---void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb) --+void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, --+ struct sta_info *sta, struct sk_buff *skb) -- { -- struct ieee80211_local *local = sdata->local; -- struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); --@@ -1625,7 +1634,7 @@ void ieee80211_xmit(struct ieee80211_sub -- } -- -- ieee80211_set_qos_hdr(sdata, skb); --- ieee80211_tx(sdata, skb, false); --+ ieee80211_tx(sdata, sta, skb, false); -- } -- -- static bool ieee80211_parse_tx_radiotap(struct sk_buff *skb) --@@ -1846,7 +1855,7 @@ netdev_tx_t ieee80211_monitor_start_xmit -- goto fail_rcu; -- -- info->band = chandef->chan->band; --- ieee80211_xmit(sdata, skb); --+ ieee80211_xmit(sdata, NULL, skb); -- rcu_read_unlock(); -- -- return NETDEV_TX_OK; --@@ -1877,7 +1886,8 @@ fail: -- * Returns: the (possibly reallocated) skb or an ERR_PTR() code -- */ -- static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata, --- struct sk_buff *skb, u32 info_flags) --+ struct sk_buff *skb, u32 info_flags, --+ struct sta_info **sta_out) -- { -- struct ieee80211_local *local = sdata->local; -- struct ieee80211_tx_info *info; --@@ -1920,6 +1930,7 @@ static struct sk_buff *ieee80211_build_h -- authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); -- wme_sta = sta->sta.wme; -- have_station = true; --+ *sta_out = sta; -- } else if (sdata->wdev.use_4addr) { -- ret = -ENOLINK; -- goto free; --@@ -2073,6 +2084,7 @@ static struct sk_buff *ieee80211_build_h -- have_station = true; -- authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); -- wme_sta = sta->sta.wme; --+ *sta_out = sta; -- } else if (sdata->u.mgd.use_4addr && -- cpu_to_be16(ethertype) != sdata->control_port_protocol) { -- fc |= cpu_to_le16(IEEE80211_FCTL_FROMDS | --@@ -2136,13 +2148,18 @@ static struct sk_buff *ieee80211_build_h -- * and mesh mode checks authorization later. -- */ -- multicast = is_multicast_ether_addr(hdr.addr1); --- if (!multicast && !have_station && --- !ieee80211_vif_is_mesh(&sdata->vif)) { --- sta = sta_info_get(sdata, hdr.addr1); --+ if (multicast) { --+ *sta_out = ERR_PTR(-ENOENT); --+ } else if (!have_station && !ieee80211_vif_is_mesh(&sdata->vif)) { --+ if (sdata->control_port_protocol == skb->protocol) --+ sta = sta_info_get_bss(sdata, hdr.addr1); --+ else --+ sta = sta_info_get(sdata, hdr.addr1); -- if (sta) { -- authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); -- wme_sta = sta->sta.wme; -- } --+ *sta_out = sta ?: ERR_PTR(-ENOENT); -- } -- -- /* For mesh, the use of the QoS header is mandatory */ --@@ -2320,6 +2337,7 @@ void __ieee80211_subif_start_xmit(struct -- u32 info_flags) -- { -- struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); --+ struct sta_info *sta = NULL; -- -- if (unlikely(skb->len < ETH_HLEN)) { -- kfree_skb(skb); --@@ -2328,7 +2346,7 @@ void __ieee80211_subif_start_xmit(struct -- -- rcu_read_lock(); -- --- skb = ieee80211_build_hdr(sdata, skb, info_flags); --+ skb = ieee80211_build_hdr(sdata, skb, info_flags, &sta); -- if (IS_ERR(skb)) -- goto out; -- --@@ -2336,7 +2354,7 @@ void __ieee80211_subif_start_xmit(struct -- dev->stats.tx_bytes += skb->len; -- dev->trans_start = jiffies; -- --- ieee80211_xmit(sdata, skb); --+ ieee80211_xmit(sdata, sta, skb); -- out: -- rcu_read_unlock(); -- } --@@ -2364,10 +2382,11 @@ ieee80211_build_data_template(struct iee -- .local = sdata->local, -- .sdata = sdata, -- }; --+ struct sta_info *sta_ignore; -- -- rcu_read_lock(); -- --- skb = ieee80211_build_hdr(sdata, skb, info_flags); --+ skb = ieee80211_build_hdr(sdata, skb, info_flags, &sta_ignore); -- if (IS_ERR(skb)) -- goto out; -- --@@ -2425,7 +2444,7 @@ static bool ieee80211_tx_pending_skb(str -- return true; -- } -- info->band = chanctx_conf->def.chan->band; --- result = ieee80211_tx(sdata, skb, true); --+ result = ieee80211_tx(sdata, NULL, skb, true); -- } else { -- struct sk_buff_head skbs; -- --@@ -3163,7 +3182,7 @@ ieee80211_get_buffered_bc(struct ieee802 -- -- if (sdata->vif.type == NL80211_IFTYPE_AP) -- sdata = IEEE80211_DEV_TO_SUB_IF(skb->dev); --- if (!ieee80211_tx_prepare(sdata, &tx, skb)) --+ if (!ieee80211_tx_prepare(sdata, &tx, NULL, skb)) -- break; -- dev_kfree_skb_any(skb); -- } --@@ -3295,6 +3314,6 @@ void __ieee80211_tx_skb_tid_band(struct -- */ -- local_bh_disable(); -- IEEE80211_SKB_CB(skb)->band = band; --- ieee80211_xmit(sdata, skb); --+ ieee80211_xmit(sdata, NULL, skb); -- local_bh_enable(); -- } -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..52fecb9 ---- /dev/null -+++ 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 -+ -+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. -+ -+Fixes: 76bed0f43b27 ("mac80211: IBSS fix scan request") -+Signed-off-by: Sara Sharon -+Signed-off-by: Emmanuel Grumbach -+--- -+ -+--- 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 -+ -+ 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; -+ -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 ---- a/package/kernel/mac80211/patches/316-mac80211-reduce-log-spam-from-ieee80211_handle_pwr_c.patch -+++ /dev/null -@@ -1,38 +0,0 @@ --From: John Linville --Date: Tue, 31 Mar 2015 10:49:14 -0400 --Subject: [PATCH] mac80211: reduce log spam from ieee80211_handle_pwr_constr -- --This changes a couple of messages from sdata_info to sdata_dbg. --This should reduce some log spam, as reported here: -- -- https://bugzilla.redhat.com/show_bug.cgi?id=1206468 -- --Signed-off-by: John W. Linville --Signed-off-by: Johannes Berg ----- -- ----- a/net/mac80211/mlme.c --+++ b/net/mac80211/mlme.c --@@ -1347,15 +1347,15 @@ static u32 ieee80211_handle_pwr_constr(s -- */ -- if (has_80211h_pwr && -- (!has_cisco_pwr || pwr_level_80211h <= pwr_level_cisco)) { --- sdata_info(sdata, --- "Limiting TX power to %d (%d - %d) dBm as advertised by %pM\n", --- pwr_level_80211h, chan_pwr, pwr_reduction_80211h, --- sdata->u.mgd.bssid); --+ sdata_dbg(sdata, --+ "Limiting TX power to %d (%d - %d) dBm as advertised by %pM\n", --+ pwr_level_80211h, chan_pwr, pwr_reduction_80211h, --+ sdata->u.mgd.bssid); -- new_ap_level = pwr_level_80211h; -- } else { /* has_cisco_pwr is always true here. */ --- sdata_info(sdata, --- "Limiting TX power to %d dBm as advertised by %pM\n", --- pwr_level_cisco, sdata->u.mgd.bssid); --+ sdata_dbg(sdata, --+ "Limiting TX power to %d dBm as advertised by %pM\n", --+ pwr_level_cisco, sdata->u.mgd.bssid); -- 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 ---- a/package/kernel/mac80211/patches/317-brcmfmac-Fix-race-condition-in-msgbuf-ioctl-processi.patch -+++ /dev/null -@@ -1,35 +0,0 @@ --From: Hante Meuleman --Date: Fri, 6 Mar 2015 18:40:41 +0100 --Subject: [PATCH] brcmfmac: Fix race condition in msgbuf ioctl processing. -- --Msgbuf is using a wait_event_timeout to wait for the response on --an ioctl. The wakeup routine uses waitqueue_active to see if --wait_event_timeout has been called. There is a chance that the --response arrives before wait_event_timeout is called, this --will result in situation that wait_event_timeout never gets --woken again and assumed result will be a timeout. This patch --removes that errornous situation by always setting the --ctl_completed var before checking for queue active. -- --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/msgbuf.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c --@@ -481,10 +481,9 @@ static int brcmf_msgbuf_ioctl_resp_wait( -- -- static void brcmf_msgbuf_ioctl_resp_wake(struct brcmf_msgbuf *msgbuf) -- { --- if (waitqueue_active(&msgbuf->ioctl_resp_wait)) { --- msgbuf->ctl_completed = true; --+ msgbuf->ctl_completed = true; --+ if (waitqueue_active(&msgbuf->ioctl_resp_wait)) -- wake_up(&msgbuf->ioctl_resp_wait); --- } -- } -- -- -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..5bf53b9 ---- /dev/null -+++ 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 -+ -+Patch fixes this splat -+ -+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/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; -+ -++ 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 ---- a/package/kernel/mac80211/patches/318-brcmfmac-Update-msgbuf-commonring-size-for-improved-.patch -+++ /dev/null -@@ -1,30 +0,0 @@ --From: Hante Meuleman --Date: Wed, 18 Mar 2015 13:25:23 +0100 --Subject: [PATCH] brcmfmac: Update msgbuf commonring size for improved -- throughput. -- --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/msgbuf.h --+++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.h --@@ -17,11 +17,11 @@ -- -- #ifdef CPTCFG_BRCMFMAC_PROTO_MSGBUF -- ---#define BRCMF_H2D_MSGRING_CONTROL_SUBMIT_MAX_ITEM 20 ---#define BRCMF_H2D_MSGRING_RXPOST_SUBMIT_MAX_ITEM 256 ---#define BRCMF_D2H_MSGRING_CONTROL_COMPLETE_MAX_ITEM 20 --+#define BRCMF_H2D_MSGRING_CONTROL_SUBMIT_MAX_ITEM 64 --+#define BRCMF_H2D_MSGRING_RXPOST_SUBMIT_MAX_ITEM 512 --+#define BRCMF_D2H_MSGRING_CONTROL_COMPLETE_MAX_ITEM 64 -- #define BRCMF_D2H_MSGRING_TX_COMPLETE_MAX_ITEM 1024 ---#define BRCMF_D2H_MSGRING_RX_COMPLETE_MAX_ITEM 256 --+#define BRCMF_D2H_MSGRING_RX_COMPLETE_MAX_ITEM 512 -- #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 ---- a/package/kernel/mac80211/patches/319-ath9k_htc-add-new-WMI_REG_RMW_CMDID-command.patch -+++ /dev/null -@@ -1,307 +0,0 @@ --From: Oleksij Rempel --Date: Sun, 22 Mar 2015 19:29:46 +0100 --Subject: [PATCH] ath9k_htc: add new WMI_REG_RMW_CMDID command -- --Since usb bus add extra delay on each request, a command --with read + write requests is too expensive. We can dramtically --reduce usb load by moving this command to firmware. -- --In my tests, this patch will reduce channel scan time --for about 5-10 seconds. -- --Signed-off-by: Oleksij Rempel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/ath/ath.h --+++ b/drivers/net/wireless/ath/ath.h --@@ -131,6 +131,9 @@ struct ath_ops { -- void (*enable_write_buffer)(void *); -- void (*write_flush) (void *); -- u32 (*rmw)(void *, u32 reg_offset, u32 set, u32 clr); --+ void (*enable_rmw_buffer)(void *); --+ void (*rmw_flush) (void *); --+ -- }; -- -- struct ath_common; ----- a/drivers/net/wireless/ath/ath9k/htc.h --+++ b/drivers/net/wireless/ath/ath9k/htc.h --@@ -444,6 +444,10 @@ static inline void ath9k_htc_stop_btcoex -- #define OP_BT_SCAN BIT(4) -- #define OP_TSF_RESET BIT(6) -- --+enum htc_op_flags { --+ HTC_FWFLAG_NO_RMW, --+}; --+ -- struct ath9k_htc_priv { -- struct device *dev; -- struct ieee80211_hw *hw; --@@ -482,6 +486,7 @@ struct ath9k_htc_priv { -- bool reconfig_beacon; -- unsigned int rxfilter; -- unsigned long op_flags; --+ unsigned long fw_flags; -- -- struct ath9k_hw_cal_data caldata; -- struct ath_spec_scan_priv spec_priv; ----- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c --+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c --@@ -376,17 +376,139 @@ static void ath9k_regwrite_flush(void *h -- mutex_unlock(&priv->wmi->multi_write_mutex); -- } -- ---static u32 ath9k_reg_rmw(void *hw_priv, u32 reg_offset, u32 set, u32 clr) --+static void ath9k_reg_rmw_buffer(void *hw_priv, --+ u32 reg_offset, u32 set, u32 clr) --+{ --+ struct ath_hw *ah = (struct ath_hw *) hw_priv; --+ struct ath_common *common = ath9k_hw_common(ah); --+ struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv; --+ u32 rsp_status; --+ int r; --+ --+ mutex_lock(&priv->wmi->multi_rmw_mutex); --+ --+ /* Store the register/value */ --+ priv->wmi->multi_rmw[priv->wmi->multi_rmw_idx].reg = --+ cpu_to_be32(reg_offset); --+ priv->wmi->multi_rmw[priv->wmi->multi_rmw_idx].set = --+ cpu_to_be32(set); --+ priv->wmi->multi_rmw[priv->wmi->multi_rmw_idx].clr = --+ cpu_to_be32(clr); --+ --+ priv->wmi->multi_rmw_idx++; --+ --+ /* If the buffer is full, send it out. */ --+ if (priv->wmi->multi_rmw_idx == MAX_RMW_CMD_NUMBER) { --+ r = ath9k_wmi_cmd(priv->wmi, WMI_REG_RMW_CMDID, --+ (u8 *) &priv->wmi->multi_rmw, --+ sizeof(struct register_write) * priv->wmi->multi_rmw_idx, --+ (u8 *) &rsp_status, sizeof(rsp_status), --+ 100); --+ if (unlikely(r)) { --+ ath_dbg(common, WMI, --+ "REGISTER RMW FAILED, multi len: %d\n", --+ priv->wmi->multi_rmw_idx); --+ } --+ priv->wmi->multi_rmw_idx = 0; --+ } --+ --+ mutex_unlock(&priv->wmi->multi_rmw_mutex); --+} --+ --+static void ath9k_reg_rmw_flush(void *hw_priv) -- { --- u32 val; --+ struct ath_hw *ah = (struct ath_hw *) hw_priv; --+ struct ath_common *common = ath9k_hw_common(ah); --+ struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv; --+ u32 rsp_status; --+ int r; --+ --+ if (test_bit(HTC_FWFLAG_NO_RMW, &priv->fw_flags)) --+ return; --+ --+ atomic_dec(&priv->wmi->m_rmw_cnt); --+ --+ mutex_lock(&priv->wmi->multi_rmw_mutex); --+ --+ if (priv->wmi->multi_rmw_idx) { --+ r = ath9k_wmi_cmd(priv->wmi, WMI_REG_RMW_CMDID, --+ (u8 *) &priv->wmi->multi_rmw, --+ sizeof(struct register_rmw) * priv->wmi->multi_rmw_idx, --+ (u8 *) &rsp_status, sizeof(rsp_status), --+ 100); --+ if (unlikely(r)) { --+ ath_dbg(common, WMI, --+ "REGISTER RMW FAILED, multi len: %d\n", --+ priv->wmi->multi_rmw_idx); --+ } --+ priv->wmi->multi_rmw_idx = 0; --+ } -- --- val = ath9k_regread(hw_priv, reg_offset); --- val &= ~clr; --- val |= set; --- ath9k_regwrite(hw_priv, val, reg_offset); --+ mutex_unlock(&priv->wmi->multi_rmw_mutex); --+} --+ --+static void ath9k_enable_rmw_buffer(void *hw_priv) --+{ --+ struct ath_hw *ah = (struct ath_hw *) hw_priv; --+ struct ath_common *common = ath9k_hw_common(ah); --+ struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv; --+ --+ if (test_bit(HTC_FWFLAG_NO_RMW, &priv->fw_flags)) --+ return; --+ --+ atomic_inc(&priv->wmi->m_rmw_cnt); --+} --+ --+static u32 ath9k_reg_rmw_single(void *hw_priv, --+ u32 reg_offset, u32 set, u32 clr) --+{ --+ struct ath_hw *ah = (struct ath_hw *) hw_priv; --+ struct ath_common *common = ath9k_hw_common(ah); --+ struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv; --+ struct register_rmw buf, buf_ret; --+ int ret; --+ u32 val = 0; --+ --+ buf.reg = cpu_to_be32(reg_offset); --+ buf.set = cpu_to_be32(set); --+ buf.clr = cpu_to_be32(clr); --+ --+ ret = ath9k_wmi_cmd(priv->wmi, WMI_REG_RMW_CMDID, --+ (u8 *) &buf, sizeof(buf), --+ (u8 *) &buf_ret, sizeof(buf_ret), --+ 100); --+ if (unlikely(ret)) { --+ ath_dbg(common, WMI, "REGISTER RMW FAILED:(0x%04x, %d)\n", --+ reg_offset, ret); --+ } -- return val; -- } -- --+static u32 ath9k_reg_rmw(void *hw_priv, u32 reg_offset, u32 set, u32 clr) --+{ --+ struct ath_hw *ah = (struct ath_hw *) hw_priv; --+ struct ath_common *common = ath9k_hw_common(ah); --+ struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv; --+ --+ if (test_bit(HTC_FWFLAG_NO_RMW, &priv->fw_flags)) { --+ u32 val; --+ --+ val = REG_READ(ah, reg_offset); --+ val &= ~clr; --+ val |= set; --+ REG_WRITE(ah, reg_offset, val); --+ --+ return 0; --+ } --+ --+ if (atomic_read(&priv->wmi->m_rmw_cnt)) --+ ath9k_reg_rmw_buffer(hw_priv, reg_offset, set, clr); --+ else --+ ath9k_reg_rmw_single(hw_priv, reg_offset, set, clr); --+ --+ return 0; --+} --+ -- static void ath_usb_read_cachesize(struct ath_common *common, int *csz) -- { -- *csz = L1_CACHE_BYTES >> 2; --@@ -501,6 +623,8 @@ static int ath9k_init_priv(struct ath9k_ -- ah->reg_ops.write = ath9k_regwrite; -- ah->reg_ops.enable_write_buffer = ath9k_enable_regwrite_buffer; -- ah->reg_ops.write_flush = ath9k_regwrite_flush; --+ ah->reg_ops.enable_rmw_buffer = ath9k_enable_rmw_buffer; --+ ah->reg_ops.rmw_flush = ath9k_reg_rmw_flush; -- ah->reg_ops.rmw = ath9k_reg_rmw; -- priv->ah = ah; -- --@@ -686,6 +810,12 @@ static int ath9k_init_firmware_version(s -- return -EINVAL; -- } -- --+ if (priv->fw_version_major == 1 && priv->fw_version_minor < 4) --+ set_bit(HTC_FWFLAG_NO_RMW, &priv->fw_flags); --+ --+ dev_info(priv->dev, "FW RMW support: %s\n", --+ test_bit(HTC_FWFLAG_NO_RMW, &priv->fw_flags) ? "Off" : "On"); --+ -- return 0; -- } -- ----- a/drivers/net/wireless/ath/ath9k/hw.h --+++ b/drivers/net/wireless/ath/ath9k/hw.h --@@ -100,6 +100,18 @@ -- (_ah)->reg_ops.write_flush((_ah)); \ -- } while (0) -- --+#define ENABLE_REG_RMW_BUFFER(_ah) \ --+ do { \ --+ if ((_ah)->reg_ops.enable_rmw_buffer) \ --+ (_ah)->reg_ops.enable_rmw_buffer((_ah)); \ --+ } while (0) --+ --+#define REG_RMW_BUFFER_FLUSH(_ah) \ --+ do { \ --+ if ((_ah)->reg_ops.rmw_flush) \ --+ (_ah)->reg_ops.rmw_flush((_ah)); \ --+ } while (0) --+ -- #define PR_EEP(_s, _val) \ -- do { \ -- len += scnprintf(buf + len, size - len, "%20s : %10d\n",\ ----- a/drivers/net/wireless/ath/ath9k/wmi.c --+++ b/drivers/net/wireless/ath/ath9k/wmi.c --@@ -61,6 +61,8 @@ static const char *wmi_cmd_to_name(enum -- return "WMI_REG_READ_CMDID"; -- case WMI_REG_WRITE_CMDID: -- return "WMI_REG_WRITE_CMDID"; --+ case WMI_REG_RMW_CMDID: --+ return "WMI_REG_RMW_CMDID"; -- case WMI_RC_STATE_CHANGE_CMDID: -- return "WMI_RC_STATE_CHANGE_CMDID"; -- case WMI_RC_RATE_UPDATE_CMDID: --@@ -101,6 +103,7 @@ struct wmi *ath9k_init_wmi(struct ath9k_ -- spin_lock_init(&wmi->event_lock); -- mutex_init(&wmi->op_mutex); -- mutex_init(&wmi->multi_write_mutex); --+ mutex_init(&wmi->multi_rmw_mutex); -- init_completion(&wmi->cmd_wait); -- INIT_LIST_HEAD(&wmi->pending_tx_events); -- tasklet_init(&wmi->wmi_event_tasklet, ath9k_wmi_event_tasklet, ----- a/drivers/net/wireless/ath/ath9k/wmi.h --+++ b/drivers/net/wireless/ath/ath9k/wmi.h --@@ -112,6 +112,7 @@ enum wmi_cmd_id { -- WMI_TX_STATS_CMDID, -- WMI_RX_STATS_CMDID, -- WMI_BITRATE_MASK_CMDID, --+ WMI_REG_RMW_CMDID, -- }; -- -- enum wmi_event_id { --@@ -125,12 +126,19 @@ enum wmi_event_id { -- }; -- -- #define MAX_CMD_NUMBER 62 --+#define MAX_RMW_CMD_NUMBER 15 -- -- struct register_write { -- __be32 reg; -- __be32 val; -- }; -- --+struct register_rmw { --+ __be32 reg; --+ __be32 set; --+ __be32 clr; --+} __packed; --+ -- struct ath9k_htc_tx_event { -- int count; -- struct __wmi_event_txstatus txs; --@@ -156,10 +164,18 @@ struct wmi { -- -- spinlock_t wmi_lock; -- --+ /* multi write section */ -- atomic_t mwrite_cnt; -- struct register_write multi_write[MAX_CMD_NUMBER]; -- u32 multi_write_idx; -- struct mutex multi_write_mutex; --+ --+ /* multi rmw section */ --+ atomic_t m_rmw_cnt; --+ struct register_rmw multi_rmw[MAX_RMW_CMD_NUMBER]; --+ u32 multi_rmw_idx; --+ struct mutex multi_rmw_mutex; --+ -- }; -- -- struct wmi *ath9k_init_wmi(struct ath9k_htc_priv *priv); -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..b646ab3 ---- /dev/null -+++ 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 -+ -+Use skb_copy_bits in preparation for allowing fragmented skbs -+ -+Signed-off-by: Felix Fietkau -+Signed-off-by: Johannes Berg -+--- -+ -+--- 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) -+ { -+- 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; -+ } -+ } -++ -++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)); -++ -+ return 0; -+ } -++ -++int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr, -++ enum nl80211_iftype iftype) -++{ -++ return __ieee80211_data_to_8023(skb, NULL, addr, iftype); -++} -+ EXPORT_SYMBOL(ieee80211_data_to_8023); -+ -+ 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 ---- a/package/kernel/mac80211/patches/320-ath9k-ar9271_hw_pa_cal-use-defs-instead-of-magin-num.patch -+++ /dev/null -@@ -1,89 +0,0 @@ --From: Oleksij Rempel --Date: Sun, 22 Mar 2015 19:29:47 +0100 --Subject: [PATCH] ath9k: ar9271_hw_pa_cal - use defs instead of magin -- numbers -- --This function uses mixed styles for register names/numbers which --is make harder reading and optimisation. -- --Signed-off-by: Oleksij Rempel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c --+++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c --@@ -430,22 +430,22 @@ static void ar9271_hw_pa_cal(struct ath_ -- u32 regVal; -- unsigned int i; -- u32 regList[][2] = { --- { 0x786c, 0 }, --- { 0x7854, 0 }, --- { 0x7820, 0 }, --- { 0x7824, 0 }, --- { 0x7868, 0 }, --- { 0x783c, 0 }, --- { 0x7838, 0 } , --- { 0x7828, 0 } , --+ { AR9285_AN_TOP3, 0 }, --+ { AR9285_AN_RXTXBB1, 0 }, --+ { AR9285_AN_RF2G1, 0 }, --+ { AR9285_AN_RF2G2, 0 }, --+ { AR9285_AN_TOP2, 0 }, --+ { AR9285_AN_RF2G8, 0 }, --+ { AR9285_AN_RF2G7, 0 } , --+ { AR9285_AN_RF2G3, 0 } , -- }; -- -- for (i = 0; i < ARRAY_SIZE(regList); i++) -- regList[i][1] = REG_READ(ah, regList[i][0]); -- --- regVal = REG_READ(ah, 0x7834); --+ regVal = REG_READ(ah, AR9285_AN_RF2G6); -- regVal &= (~(0x1)); --- REG_WRITE(ah, 0x7834, regVal); --+ REG_WRITE(ah, AR9285_AN_RF2G6, regVal); -- regVal = REG_READ(ah, 0x9808); -- regVal |= (0x1 << 27); -- REG_WRITE(ah, 0x9808, regVal); --@@ -477,7 +477,7 @@ static void ar9271_hw_pa_cal(struct ath_ -- * does not matter since we turn it off -- */ -- REG_RMW_FIELD(ah, AR9285_AN_RF2G7, AR9285_AN_RF2G7_PADRVGN2TAB0, 0); --- --+ /* 7828, b0-11, ccom=fff */ -- REG_RMW_FIELD(ah, AR9285_AN_RF2G3, AR9271_AN_RF2G3_CCOMP, 0xfff); -- -- /* Set: --@@ -490,15 +490,16 @@ static void ar9271_hw_pa_cal(struct ath_ -- -- /* find off_6_1; */ -- for (i = 6; i > 0; i--) { --- regVal = REG_READ(ah, 0x7834); --+ regVal = REG_READ(ah, AR9285_AN_RF2G6); -- regVal |= (1 << (20 + i)); --- REG_WRITE(ah, 0x7834, regVal); --+ REG_WRITE(ah, AR9285_AN_RF2G6, regVal); -- udelay(1); -- /* regVal = REG_READ(ah, 0x7834); */ -- regVal &= (~(0x1 << (20 + i))); --- regVal |= (MS(REG_READ(ah, 0x7840), AR9285_AN_RXTXBB1_SPARE9) --+ regVal |= (MS(REG_READ(ah, AR9285_AN_RF2G9), --+ AR9285_AN_RXTXBB1_SPARE9) -- << (20 + i)); --- REG_WRITE(ah, 0x7834, regVal); --+ REG_WRITE(ah, AR9285_AN_RF2G6, regVal); -- } -- -- regVal = (regVal >> 20) & 0x7f; --@@ -517,9 +518,9 @@ static void ar9271_hw_pa_cal(struct ath_ -- -- ENABLE_REGWRITE_BUFFER(ah); -- --- regVal = REG_READ(ah, 0x7834); --+ regVal = REG_READ(ah, AR_AN_RF2G1_CH1); -- regVal |= 0x1; --- REG_WRITE(ah, 0x7834, regVal); --+ REG_WRITE(ah, AR_AN_RF2G1_CH1, regVal); -- regVal = REG_READ(ah, 0x9808); -- regVal &= (~(0x1 << 27)); -- REG_WRITE(ah, 0x9808, regVal); -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..2eeed22 ---- /dev/null -+++ 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 -+ -+Signed-off-by: Felix Fietkau -+Signed-off-by: Johannes Berg -+--- -+ -+--- 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 struct sk_buff * -++__ieee80211_amsdu_copy(struct sk_buff *skb, unsigned int hlen, -++ int offset, int len) -++{ -++ struct sk_buff *frame; -++ -++ if (skb->len - offset < len) -++ return NULL; -++ -++ /* -++ * 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); -++ -++ 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 ---- a/package/kernel/mac80211/patches/321-ath9k-ar9271_hw_pa_cal-use-proper-makroses.patch -+++ /dev/null -@@ -1,79 +0,0 @@ --From: Oleksij Rempel --Date: Sun, 22 Mar 2015 19:29:48 +0100 --Subject: [PATCH] ath9k: ar9271_hw_pa_cal: use proper makroses. -- --Signed-off-by: Oleksij Rempel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c --+++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c --@@ -443,33 +443,30 @@ static void ar9271_hw_pa_cal(struct ath_ -- for (i = 0; i < ARRAY_SIZE(regList); i++) -- regList[i][1] = REG_READ(ah, regList[i][0]); -- --- regVal = REG_READ(ah, AR9285_AN_RF2G6); --- regVal &= (~(0x1)); --- REG_WRITE(ah, AR9285_AN_RF2G6, regVal); --- regVal = REG_READ(ah, 0x9808); --- regVal |= (0x1 << 27); --- REG_WRITE(ah, 0x9808, regVal); --- --+ /* 7834, b1=0 */ --+ REG_CLR_BIT(ah, AR9285_AN_RF2G6, 1 << 0); --+ /* 9808, b27=1 */ --+ REG_SET_BIT(ah, 0x9808, 1 << 27); -- /* 786c,b23,1, pwddac=1 */ --- REG_RMW_FIELD(ah, AR9285_AN_TOP3, AR9285_AN_TOP3_PWDDAC, 1); --+ REG_SET_BIT(ah, AR9285_AN_TOP3, AR9285_AN_TOP3_PWDDAC); -- /* 7854, b5,1, pdrxtxbb=1 */ --- REG_RMW_FIELD(ah, AR9285_AN_RXTXBB1, AR9285_AN_RXTXBB1_PDRXTXBB1, 1); --+ REG_SET_BIT(ah, AR9285_AN_RXTXBB1, AR9285_AN_RXTXBB1_PDRXTXBB1); -- /* 7854, b7,1, pdv2i=1 */ --- REG_RMW_FIELD(ah, AR9285_AN_RXTXBB1, AR9285_AN_RXTXBB1_PDV2I, 1); --+ REG_SET_BIT(ah, AR9285_AN_RXTXBB1, AR9285_AN_RXTXBB1_PDV2I); -- /* 7854, b8,1, pddacinterface=1 */ --- REG_RMW_FIELD(ah, AR9285_AN_RXTXBB1, AR9285_AN_RXTXBB1_PDDACIF, 1); --+ REG_SET_BIT(ah, AR9285_AN_RXTXBB1, AR9285_AN_RXTXBB1_PDDACIF); -- /* 7824,b12,0, offcal=0 */ --- REG_RMW_FIELD(ah, AR9285_AN_RF2G2, AR9285_AN_RF2G2_OFFCAL, 0); --+ REG_CLR_BIT(ah, AR9285_AN_RF2G2, AR9285_AN_RF2G2_OFFCAL); -- /* 7838, b1,0, pwddb=0 */ --- REG_RMW_FIELD(ah, AR9285_AN_RF2G7, AR9285_AN_RF2G7_PWDDB, 0); --+ REG_CLR_BIT(ah, AR9285_AN_RF2G7, AR9285_AN_RF2G7_PWDDB); -- /* 7820,b11,0, enpacal=0 */ --- REG_RMW_FIELD(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_ENPACAL, 0); --+ REG_CLR_BIT(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_ENPACAL); -- /* 7820,b25,1, pdpadrv1=0 */ --- REG_RMW_FIELD(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_PDPADRV1, 0); --+ REG_CLR_BIT(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_PDPADRV1); -- /* 7820,b24,0, pdpadrv2=0 */ --- REG_RMW_FIELD(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_PDPADRV2, 0); --+ REG_CLR_BIT(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_PDPADRV2); -- /* 7820,b23,0, pdpaout=0 */ --- REG_RMW_FIELD(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_PDPAOUT, 0); --+ REG_CLR_BIT(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_PDPAOUT); -- /* 783c,b14-16,7, padrvgn2tab_0=7 */ -- REG_RMW_FIELD(ah, AR9285_AN_RF2G8, AR9285_AN_RF2G8_PADRVGN2TAB0, 7); -- /* --@@ -516,15 +513,13 @@ static void ar9271_hw_pa_cal(struct ath_ -- ah->pacal_info.prev_offset = regVal; -- } -- --- ENABLE_REGWRITE_BUFFER(ah); -- --- regVal = REG_READ(ah, AR_AN_RF2G1_CH1); --- regVal |= 0x1; --- REG_WRITE(ah, AR_AN_RF2G1_CH1, regVal); --- regVal = REG_READ(ah, 0x9808); --- regVal &= (~(0x1 << 27)); --- REG_WRITE(ah, 0x9808, regVal); --+ /* 7834, b1=1 */ --+ REG_SET_BIT(ah, AR9285_AN_RF2G6, 1 << 0); --+ /* 9808, b27=0 */ --+ REG_CLR_BIT(ah, 0x9808, 1 << 27); -- --+ ENABLE_REGWRITE_BUFFER(ah); -- 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-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..c4155a1 ---- /dev/null -+++ 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 -+ -+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"). -+ -+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/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/net/mac80211/tx.c -++++ b/net/mac80211/tx.c -+@@ -710,6 +710,10 @@ ieee80211_tx_h_rate_ctrl(struct ieee8021 -+ -+ 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; -++ -+ 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); -+ } -+ -+-static bool ieee80211_parse_tx_radiotap(struct sk_buff *skb) -++static bool ieee80211_parse_tx_radiotap(struct ieee80211_local *local, -++ struct sk_buff *skb) -+ { -+ 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 ---- a/package/kernel/mac80211/patches/322-ath9k-ar9271_hw_pa_cal-use-RMW-buffer.patch -+++ /dev/null -@@ -1,48 +0,0 @@ --From: Oleksij Rempel --Date: Sun, 22 Mar 2015 19:29:49 +0100 --Subject: [PATCH] ath9k: ar9271_hw_pa_cal: use RMW buffer -- --Signed-off-by: Oleksij Rempel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c --+++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c --@@ -436,13 +436,14 @@ static void ar9271_hw_pa_cal(struct ath_ -- { AR9285_AN_RF2G2, 0 }, -- { AR9285_AN_TOP2, 0 }, -- { AR9285_AN_RF2G8, 0 }, --- { AR9285_AN_RF2G7, 0 } , --- { AR9285_AN_RF2G3, 0 } , --+ { AR9285_AN_RF2G7, 0 }, --+ { AR9285_AN_RF2G3, 0 }, -- }; -- -- for (i = 0; i < ARRAY_SIZE(regList); i++) -- regList[i][1] = REG_READ(ah, regList[i][0]); -- --+ ENABLE_REG_RMW_BUFFER(ah); -- /* 7834, b1=0 */ -- REG_CLR_BIT(ah, AR9285_AN_RF2G6, 1 << 0); -- /* 9808, b27=1 */ --@@ -476,6 +477,7 @@ static void ar9271_hw_pa_cal(struct ath_ -- REG_RMW_FIELD(ah, AR9285_AN_RF2G7, AR9285_AN_RF2G7_PADRVGN2TAB0, 0); -- /* 7828, b0-11, ccom=fff */ -- REG_RMW_FIELD(ah, AR9285_AN_RF2G3, AR9271_AN_RF2G3_CCOMP, 0xfff); --+ REG_RMW_BUFFER_FLUSH(ah); -- -- /* Set: -- * localmode=1,bmode=1,bmoderxtx=1,synthon=1, --@@ -514,10 +516,12 @@ static void ar9271_hw_pa_cal(struct ath_ -- } -- -- --+ ENABLE_REG_RMW_BUFFER(ah); -- /* 7834, b1=1 */ -- REG_SET_BIT(ah, AR9285_AN_RF2G6, 1 << 0); -- /* 9808, b27=0 */ -- REG_CLR_BIT(ah, 0x9808, 1 << 27); --+ REG_RMW_BUFFER_FLUSH(ah); -- -- ENABLE_REGWRITE_BUFFER(ah); -- for (i = 0; i < ARRAY_SIZE(regList); i++) -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..e7bfb9c ---- /dev/null -+++ b/package/kernel/mac80211/patches/322-mac80211-add-A-MSDU-tx-support.patch -@@ -0,0 +1,317 @@ -+From: Felix Fietkau -+Date: Fri, 5 Feb 2016 01:38:51 +0100 -+Subject: [PATCH] mac80211: add A-MSDU tx support -+ -+Requires software tx queueing support. frag_list support (for zero-copy) -+is optional. -+ -+Signed-off-by: Felix Fietkau -+--- -+ -+--- 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), -+ }; -+ -+ /* -+@@ -1728,6 +1730,7 @@ struct ieee80211_sta_rates { -+ * size is min(max_amsdu_len, 7935) bytes. -+ * Both additional HT limits must be enforced by the low level driver. -+ * This is defined by the spec (IEEE 802.11-2012 section 8.3.2.2 NOTE 2). -++ * @max_rc_amsdu_len: Maximum A-MSDU size in bytes recommended by rate control. -+ * @txq: per-TID data TX queues (if driver uses the TXQ abstraction) -+ */ -+ struct ieee80211_sta { -+@@ -1748,6 +1751,7 @@ struct ieee80211_sta { -+ bool mfp; -+ u8 max_amsdu_subframes; -+ u16 max_amsdu_len; -++ u16 max_rc_amsdu_len; -+ -+ struct ieee80211_txq *txq[IEEE80211_NUM_TIDS]; -+ -+@@ -1961,6 +1965,15 @@ 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 and fast-xmit support. -++ * When not using minstrel/minstrel_ht rate control, the driver should -++ * limit the maximum A-MSDU size based on the current tx rate by setting -++ * max_rc_amsdu_len in struct ieee80211_sta. -++ * -++ * @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 +2011,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 +2085,9 @@ 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 number of tx buffers per (A)-MSDU, sum -++ * of 1 + skb_shinfo(skb)->nr_frags for each skb in the frag_list. -++ * -+ * @offchannel_tx_hw_queue: HW queue ID to use for offchannel TX -+ * (if %IEEE80211_HW_QUEUE_CONTROL is set) -+ * -+@@ -2124,6 +2142,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,163 @@ void ieee80211_clear_fast_xmit(struct st -+ kfree_rcu(fast_tx, rcu_head); -+ } -+ -++static bool ieee80211_amsdu_realloc_pad(struct ieee80211_local *local, -++ struct sk_buff *skb, int headroom, -++ int *subframe_len) -++{ -++ int amsdu_len = *subframe_len + sizeof(struct ethhdr); -++ int padding = (4 - amsdu_len) & 3; -++ -++ if (skb_headroom(skb) < headroom || skb_tailroom(skb) < padding) { -++ I802_DEBUG_INC(local->tx_expand_skb_head); -++ -++ if (pskb_expand_head(skb, headroom, padding, GFP_ATOMIC)) { -++ wiphy_debug(local->hw.wiphy, -++ "failed to reallocate TX buffer\n"); -++ return false; -++ } -++ } -++ -++ if (padding) { -++ *subframe_len += padding; -++ memset(skb_put(skb, padding), 0, padding); -++ } -++ -++ return true; -++} -++ -++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->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE) -++ return false; -++ -++ if (info->control.flags & IEEE80211_TX_CTRL_AMSDU) -++ return true; -++ -++ if (!ieee80211_amsdu_realloc_pad(local, skb, sizeof(amsdu_hdr), -++ &subframe_len)) -++ return false; -++ -++ 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 = sta->sta.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; -++ -++ if (sta->sta.max_rc_amsdu_len) -++ max_amsdu_len = min_t(int, max_amsdu_len, -++ sta->sta.max_rc_amsdu_len); -++ -++ 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 (!ieee80211_amsdu_realloc_pad(local, skb, sizeof(rfc1042_header) + 2, -++ &subframe_len)) -++ return false; -++ -++ 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, sizeof(rfc1042_header)); -++ -++ 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 +2972,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-0000-brcmfmac-fix-setting-primary-channel-for-80-MHz-widt.patch b/package/kernel/mac80211/patches/323-0000-brcmfmac-fix-setting-primary-channel-for-80-MHz-widt.patch -new file mode 100644 -index 0000000..9277b2c ---- /dev/null -+++ b/package/kernel/mac80211/patches/323-0000-brcmfmac-fix-setting-primary-channel-for-80-MHz-widt.patch -@@ -0,0 +1,64 @@ -+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -+Date: Wed, 20 Jan 2016 16:46:04 +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 -+Signed-off-by: Kalle Valo -+--- -+ -+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -+@@ -247,7 +247,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: -+@@ -256,24 +256,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/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 ---- a/package/kernel/mac80211/patches/323-ath9k-add-multi_read-to-be-compatible-with-ath9k_htc.patch -+++ /dev/null -@@ -1,35 +0,0 @@ --From: Oleksij Rempel --Date: Sun, 22 Mar 2015 19:29:50 +0100 --Subject: [PATCH] ath9k: add multi_read to be compatible with ath9k_htc -- --Signed-off-by: Oleksij Rempel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/ath/ath9k/init.c --+++ b/drivers/net/wireless/ath/ath9k/init.c --@@ -141,6 +141,16 @@ static unsigned int ath9k_ioread32(void -- return val; -- } -- --+static void ath9k_multi_ioread32(void *hw_priv, u32 *addr, --+ u32 *val, u16 count) --+{ --+ int i; --+ --+ for (i = 0; i < count; i++) --+ val[i] = ath9k_ioread32(hw_priv, addr[i]); --+} --+ --+ -- static unsigned int __ath9k_reg_rmw(struct ath_softc *sc, u32 reg_offset, -- u32 set, u32 clr) -- { --@@ -530,6 +540,7 @@ static int ath9k_init_softc(u16 devid, s -- ah->hw = sc->hw; -- ah->hw_version.devid = devid; -- ah->reg_ops.read = ath9k_ioread32; --+ ah->reg_ops.multi_read = ath9k_multi_ioread32; -- ah->reg_ops.write = ath9k_iowrite32; -- ah->reg_ops.rmw = ath9k_reg_rmw; -- pCap = &ah->caps; -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 ---- a/package/kernel/mac80211/patches/324-ath9k-add-new-function-ath9k_hw_read_array.patch -+++ /dev/null -@@ -1,69 +0,0 @@ --From: Oleksij Rempel --Date: Sun, 22 Mar 2015 19:29:51 +0100 --Subject: [PATCH] ath9k: add new function ath9k_hw_read_array -- --REG_READ generate most overhead on usb bus. It send and read micro packages --and reduce usb bandwidth. To reduce this overhead we should read in batches. -- --Signed-off-by: Oleksij Rempel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/ath/ath9k/hw.c --+++ b/drivers/net/wireless/ath/ath9k/hw.c --@@ -121,6 +121,36 @@ void ath9k_hw_write_array(struct ath_hw -- REGWRITE_BUFFER_FLUSH(ah); -- } -- --+void ath9k_hw_read_array(struct ath_hw *ah, u32 array[][2], int size) --+{ --+ u32 *tmp_reg_list, *tmp_data; --+ int i; --+ --+ tmp_reg_list = kmalloc(size * sizeof(u32), GFP_KERNEL); --+ if (!tmp_reg_list) { --+ dev_err(ah->dev, "%s: tmp_reg_list: alloc filed\n", __func__); --+ return; --+ } --+ --+ tmp_data = kmalloc(size * sizeof(u32), GFP_KERNEL); --+ if (!tmp_data) { --+ dev_err(ah->dev, "%s tmp_data: alloc filed\n", __func__); --+ goto error_tmp_data; --+ } --+ --+ for (i = 0; i < size; i++) --+ tmp_reg_list[i] = array[i][0]; --+ --+ REG_READ_MULTI(ah, tmp_reg_list, tmp_data, size); --+ --+ for (i = 0; i < size; i++) --+ array[i][1] = tmp_data[i]; --+ --+ kfree(tmp_data); --+error_tmp_data: --+ kfree(tmp_reg_list); --+} --+ -- u32 ath9k_hw_reverse_bits(u32 val, u32 n) -- { -- u32 retval; ----- a/drivers/net/wireless/ath/ath9k/hw.h --+++ b/drivers/net/wireless/ath/ath9k/hw.h --@@ -138,6 +138,8 @@ -- -- #define REG_WRITE_ARRAY(iniarray, column, regWr) \ -- ath9k_hw_write_array(ah, iniarray, column, &(regWr)) --+#define REG_READ_ARRAY(ah, array, size) \ --+ ath9k_hw_read_array(ah, array, size) -- -- #define AR_GPIO_OUTPUT_MUX_AS_OUTPUT 0 -- #define AR_GPIO_OUTPUT_MUX_AS_PCIE_ATTENTION_LED 1 --@@ -1020,6 +1022,7 @@ void ath9k_hw_synth_delay(struct ath_hw -- bool ath9k_hw_wait(struct ath_hw *ah, u32 reg, u32 mask, u32 val, u32 timeout); -- void ath9k_hw_write_array(struct ath_hw *ah, const struct ar5416IniArray *array, -- int column, unsigned int *writecnt); --+void ath9k_hw_read_array(struct ath_hw *ah, u32 array[][2], int size); -- 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-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..6ce60f1 ---- /dev/null -+++ 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 -+ -+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. -+ -+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/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 ---- a/package/kernel/mac80211/patches/325-ath9k-ar9271_hw_pa_cal-use-REG_READ_ARRAY.patch -+++ /dev/null -@@ -1,24 +0,0 @@ --From: Oleksij Rempel --Date: Sun, 22 Mar 2015 19:29:52 +0100 --Subject: [PATCH] ath9k: ar9271_hw_pa_cal: use REG_READ_ARRAY -- --insted of reading each register separatly --and waste 4ms on each operation, we can --use one shot read. -- --Signed-off-by: Oleksij Rempel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c --+++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c --@@ -440,8 +440,7 @@ static void ar9271_hw_pa_cal(struct ath_ -- { AR9285_AN_RF2G3, 0 }, -- }; -- --- for (i = 0; i < ARRAY_SIZE(regList); i++) --- regList[i][1] = REG_READ(ah, regList[i][0]); --+ REG_READ_ARRAY(ah, regList, ARRAY_SIZE(regList)); -- -- ENABLE_REG_RMW_BUFFER(ah); -- /* 7834, b1=0 */ -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..012dea1 ---- /dev/null -+++ 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 -+ -+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. -+ -+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/broadcom/brcm80211/brcmfmac/sdio.c -++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c -+@@ -45,8 +45,8 @@ -+ #include "chip.h" -+ #include "firmware.h" -+ -+-#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) -+ -+ #ifdef DEBUG -+ -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 (ah->caldata) -+ h = ah->caldata->nfCalHist; -+@@ -264,6 +265,16 @@ int ath9k_hw_loadnf(struct ath_hw *ah, s -+ } -+ -+ /* -++ * stop NF cal if ongoing to ensure NF load completes immediately -++ * (or after end rx/tx frame if ongoing) -++ */ -++ 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 ---- a/package/kernel/mac80211/patches/326-ath9k-use-one-shot-read-in-ath9k_hw_update_mibstats.patch -+++ /dev/null -@@ -1,39 +0,0 @@ --From: Oleksij Rempel --Date: Sun, 22 Mar 2015 19:29:53 +0100 --Subject: [PATCH] ath9k: use one shot read in ath9k_hw_update_mibstats -- --this will reduce some overhead on usb bus. -- --Signed-off-by: Oleksij Rempel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/ath/ath9k/ani.c --+++ b/drivers/net/wireless/ath/ath9k/ani.c --@@ -107,11 +107,21 @@ static const struct ani_cck_level_entry -- static void ath9k_hw_update_mibstats(struct ath_hw *ah, -- struct ath9k_mib_stats *stats) -- { --- stats->ackrcv_bad += REG_READ(ah, AR_ACK_FAIL); --- stats->rts_bad += REG_READ(ah, AR_RTS_FAIL); --- stats->fcs_bad += REG_READ(ah, AR_FCS_FAIL); --- stats->rts_good += REG_READ(ah, AR_RTS_OK); --- stats->beacons += REG_READ(ah, AR_BEACON_CNT); --+ u32 addr[5] = {AR_RTS_OK, AR_RTS_FAIL, AR_ACK_FAIL, --+ AR_FCS_FAIL, AR_BEACON_CNT}; --+ u32 data[5]; --+ --+ REG_READ_MULTI(ah, &addr[0], &data[0], 5); --+ /* AR_RTS_OK */ --+ stats->rts_good += data[0]; --+ /* AR_RTS_FAIL */ --+ stats->rts_bad += data[1]; --+ /* AR_ACK_FAIL */ --+ stats->ackrcv_bad += data[2]; --+ /* AR_FCS_FAIL */ --+ stats->fcs_bad += data[3]; --+ /* AR_BEACON_CNT */ --+ stats->beacons += data[4]; -- } -- -- static void ath9k_ani_restart(struct ath_hw *ah) -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 ---- a/package/kernel/mac80211/patches/327-ath9k-ath9k_hw_loadnf-use-REG_RMW.patch -+++ /dev/null -@@ -1,71 +0,0 @@ --From: Oleksij Rempel --Date: Sun, 22 Mar 2015 19:29:54 +0100 --Subject: [PATCH] ath9k: ath9k_hw_loadnf: use REG_RMW -- --Signed-off-by: Oleksij Rempel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/ath/ath9k/calib.c --+++ b/drivers/net/wireless/ath/ath9k/calib.c --@@ -238,7 +238,6 @@ int ath9k_hw_loadnf(struct ath_hw *ah, s -- { -- struct ath9k_nfcal_hist *h = NULL; -- unsigned i, j; --- int32_t val; -- 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); --@@ -246,6 +245,7 @@ int ath9k_hw_loadnf(struct ath_hw *ah, s -- if (ah->caldata) -- h = ah->caldata->nfCalHist; -- --+ ENABLE_REG_RMW_BUFFER(ah); -- for (i = 0; i < NUM_NF_READINGS; i++) { -- if (chainmask & (1 << i)) { -- s16 nfval; --@@ -258,10 +258,8 @@ int ath9k_hw_loadnf(struct ath_hw *ah, s -- else -- nfval = default_nf; -- --- val = REG_READ(ah, ah->nf_regs[i]); --- val &= 0xFFFFFE00; --- val |= (((u32) nfval << 1) & 0x1ff); --- REG_WRITE(ah, ah->nf_regs[i], val); --+ REG_RMW(ah, ah->nf_regs[i], --+ (((u32) nfval << 1) & 0x1ff), 0x1ff); -- } -- } -- --@@ -274,6 +272,7 @@ int ath9k_hw_loadnf(struct ath_hw *ah, s -- REG_CLR_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); -- -- /* -- * Wait for load to complete, should be fast, a few 10s of us. --@@ -309,19 +308,17 @@ int ath9k_hw_loadnf(struct ath_hw *ah, s -- * by the median we just loaded. This will be initial (and max) value -- * of next noise floor calibration the baseband does. -- */ --- ENABLE_REGWRITE_BUFFER(ah); --+ ENABLE_REG_RMW_BUFFER(ah); -- for (i = 0; i < NUM_NF_READINGS; i++) { -- if (chainmask & (1 << i)) { -- if ((i >= AR5416_MAX_CHAINS) && !IS_CHAN_HT40(chan)) -- continue; -- --- val = REG_READ(ah, ah->nf_regs[i]); --- val &= 0xFFFFFE00; --- val |= (((u32) (-50) << 1) & 0x1ff); --- REG_WRITE(ah, ah->nf_regs[i], val); --+ REG_RMW(ah, ah->nf_regs[i], --+ (((u32) (-50) << 1) & 0x1ff), 0x1ff); -- } -- } --- REGWRITE_BUFFER_FLUSH(ah); --+ REG_RMW_BUFFER_FLUSH(ah); -- -- return 0; -- } -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..f7f9df9 ---- /dev/null -+++ 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 -+ -+Make the mesh_path_del() function remove all mpp table entries -+that are proxied by the removed mesh path. -+ -+Acked-by: Bob Copeland -+Signed-off-by: Henning Rogge -+Signed-off-by: Johannes Berg -+--- -+ -+--- 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(); -+ } -+ -++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; -++ -++ 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(); -++} -++ -+ 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 ---- a/package/kernel/mac80211/patches/328-ath9k-write-buffer-related-optimisation-in-ar5008_hw.patch -+++ /dev/null -@@ -1,27 +0,0 @@ --From: Oleksij Rempel --Date: Sun, 22 Mar 2015 19:29:55 +0100 --Subject: [PATCH] ath9k: write buffer related optimisation in -- ar5008_hw_set_channel_regs -- --Signed-off-by: Oleksij Rempel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c --+++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c --@@ -681,12 +681,13 @@ static void ar5008_hw_set_channel_regs(s -- phymode |= AR_PHY_FC_DYN2040_PRI_CH; -- -- } --+ ENABLE_REGWRITE_BUFFER(ah); -- REG_WRITE(ah, AR_PHY_TURBO, phymode); -- --+ /* This function do only REG_WRITE, so --+ * we can include it to REGWRITE_BUFFER. */ -- ath9k_hw_set11nmac2040(ah, chan); -- --- ENABLE_REGWRITE_BUFFER(ah); --- -- 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-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..740993c ---- /dev/null -+++ 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 -+ -+Remember the last time when a mpp table entry is used for -+rx or tx and remove them after MESH_PATH_EXPIRE time. -+ -+Acked-by: Bob Copeland -+Signed-off-by: Henning Rogge -+Signed-off-by: Johannes Berg -+--- -+ -+--- a/net/mac80211/mesh_pathtbl.c -++++ b/net/mac80211/mesh_pathtbl.c -+@@ -942,6 +942,46 @@ enddel: -+ } -+ -+ /** -++ * 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); -+ } -++ -++ 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 ---- a/package/kernel/mac80211/patches/329-ath9k-ath9k_hw_set_4k_power_cal_tabl-use-rmw-buffer.patch -+++ /dev/null -@@ -1,26 +0,0 @@ --From: Oleksij Rempel --Date: Sun, 22 Mar 2015 19:29:56 +0100 --Subject: [PATCH] ath9k: ath9k_hw_set_4k_power_cal_tabl: use rmw buffer -- --Signed-off-by: Oleksij Rempel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c --+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c --@@ -389,6 +389,7 @@ static void ath9k_hw_set_4k_power_cal_ta -- } -- } -- --+ ENABLE_REG_RMW_BUFFER(ah); -- REG_RMW_FIELD(ah, AR_PHY_TPCRG1, AR_PHY_TPCRG1_NUM_PD_GAIN, -- (numXpdGain - 1) & 0x3); -- REG_RMW_FIELD(ah, AR_PHY_TPCRG1, AR_PHY_TPCRG1_PD_GAIN_1, --@@ -396,6 +397,7 @@ static void ath9k_hw_set_4k_power_cal_ta -- REG_RMW_FIELD(ah, AR_PHY_TPCRG1, AR_PHY_TPCRG1_PD_GAIN_2, -- xpdGainValues[1]); -- REG_RMW_FIELD(ah, AR_PHY_TPCRG1, AR_PHY_TPCRG1_PD_GAIN_3, 0); --+ REG_RMW_BUFFER_FLUSH(ah); -- -- for (i = 0; i < AR5416_EEP4K_MAX_CHAINS; i++) { -- regChainOffset = i * 0x1000; -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..0c36b1d ---- /dev/null -+++ 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 -+ -+mpp_path_del() and mesh_path_del() are mostly the same function. -+Move common code into a new static function. -+ -+Acked-by: Bob Copeland -+Signed-off-by: Henning Rogge -+Signed-off-by: Johannes Berg -+--- -+ -+--- 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); -+ -+ -++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) -+ { -+- return rcu_dereference_protected(mesh_paths, -+- lockdep_is_held(&pathtbl_resize_lock)); -++ return resize_dereference_paths(mesh_paths); -+ } -+ -+ 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; -+ } -+ -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 ---- a/package/kernel/mac80211/patches/330-ath9k-use-rmw-buffer-in-ath9k_hw_set_operating_mode-.patch -+++ /dev/null -@@ -1,43 +0,0 @@ --From: Oleksij Rempel --Date: Sun, 22 Mar 2015 19:29:57 +0100 --Subject: [PATCH] ath9k: use rmw buffer in ath9k_hw_set_operating_mode -- and ath9k_hw_reset -- --Signed-off-by: Oleksij Rempel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/ath/ath9k/hw.c --+++ b/drivers/net/wireless/ath/ath9k/hw.c --@@ -1227,6 +1227,7 @@ static void ath9k_hw_set_operating_mode( -- u32 mask = AR_STA_ID1_STA_AP | AR_STA_ID1_ADHOC; -- u32 set = AR_STA_ID1_KSRCH_MODE; -- --+ ENABLE_REG_RMW_BUFFER(ah); -- switch (opmode) { -- case NL80211_IFTYPE_ADHOC: -- if (!AR_SREV_9340_13(ah)) { --@@ -1248,6 +1249,7 @@ static void ath9k_hw_set_operating_mode( -- break; -- } -- REG_RMW(ah, AR_STA_ID1, set, mask); --+ REG_RMW_BUFFER_FLUSH(ah); -- } -- -- void ath9k_hw_get_delta_slope_vals(struct ath_hw *ah, u32 coef_scaled, --@@ -1960,6 +1962,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st -- if (!ath9k_hw_mci_is_enabled(ah)) -- REG_WRITE(ah, AR_OBS, 8); -- --+ ENABLE_REG_RMW_BUFFER(ah); -- if (ah->config.rx_intr_mitigation) { -- REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_LAST, ah->config.rimt_last); -- REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_FIRST, ah->config.rimt_first); --@@ -1969,6 +1972,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st -- REG_RMW_FIELD(ah, AR_TIMT, AR_TIMT_LAST, 300); -- REG_RMW_FIELD(ah, AR_TIMT, AR_TIMT_FIRST, 750); -- } --+ REG_RMW_BUFFER_FLUSH(ah); -- -- ath9k_hw_init_bb(ah, chan); -- -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..4dc6d66 ---- /dev/null -+++ 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 -+ -+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: -+ -+ 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/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; -+ -+ 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; -+ } -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 ---- a/package/kernel/mac80211/patches/331-ath9k-ath9k_hw_4k_set_board_values-use-rmw-buffer.patch -+++ /dev/null -@@ -1,26 +0,0 @@ --From: Oleksij Rempel --Date: Sun, 22 Mar 2015 19:29:58 +0100 --Subject: [PATCH] ath9k: ath9k_hw_4k_set_board_values: use rmw buffer -- --Signed-off-by: Oleksij Rempel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c --+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c --@@ -1082,6 +1082,7 @@ static void ath9k_hw_4k_set_board_values -- mask = BIT(0)|BIT(5)|BIT(10)|BIT(15)|BIT(20)|BIT(25); -- pwrctrl = mask * bb_desired_scale; -- clr = mask * 0x1f; --+ ENABLE_REG_RMW_BUFFER(ah); -- REG_RMW(ah, AR_PHY_TX_PWRCTRL8, pwrctrl, clr); -- REG_RMW(ah, AR_PHY_TX_PWRCTRL10, pwrctrl, clr); -- REG_RMW(ah, AR_PHY_CH0_TX_PWRCTRL12, pwrctrl, clr); --@@ -1096,6 +1097,7 @@ static void ath9k_hw_4k_set_board_values -- clr = mask * 0x1f; -- REG_RMW(ah, AR_PHY_CH0_TX_PWRCTRL11, pwrctrl, clr); -- REG_RMW(ah, AR_PHY_CH0_TX_PWRCTRL13, pwrctrl, clr); --+ REG_RMW_BUFFER_FLUSH(ah); -- } -- } -- -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..1fd016f ---- /dev/null -+++ b/package/kernel/mac80211/patches/331-brcmfmac-Increase-nr-of-supported-flowrings.patch -@@ -0,0 +1,307 @@ -+From: Hante Meuleman -+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 -+ -+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 -+ -+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/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 -+ -+-#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 -+ } -+ 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 -+ } -+ -+ -+-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 -+ } -+ -+ -+-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; -+ }; -+ -+ 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 void brcmf_msgbuf_txflow(struct brcmf_msgbuf *msgbuf, u8 flowid) -++static void brcmf_msgbuf_txflow(struct brcmf_msgbuf *msgbuf, u16 flowid) -+ { -+ struct brcmf_flowring *flow = msgbuf->flow; -+ struct brcmf_commonring *commonring; -+@@ -1310,7 +1310,7 @@ int brcmf_proto_msgbuf_rx_trigger(struct -+ } -+ -+ -+-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; -+ -+ 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 @@ -+ -+ -+ 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 ---- a/package/kernel/mac80211/patches/332-ath9k-ath9k_hw_analog_shift_rmw-use-REG_RMW.patch -+++ /dev/null -@@ -1,27 +0,0 @@ --From: Oleksij Rempel --Date: Sun, 22 Mar 2015 19:29:59 +0100 --Subject: [PATCH] ath9k: ath9k_hw_analog_shift_rmw: use REG_RMW -- --use REG_RMW in ath9k_hw_analog_shift_rmw. --It will double execution speed on usb bus. -- --Signed-off-by: Oleksij Rempel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/ath/ath9k/eeprom.c --+++ b/drivers/net/wireless/ath/ath9k/eeprom.c --@@ -27,12 +27,7 @@ void ath9k_hw_analog_shift_regwrite(stru -- void ath9k_hw_analog_shift_rmw(struct ath_hw *ah, u32 reg, u32 mask, -- u32 shift, u32 val) -- { --- u32 regVal; --- --- regVal = REG_READ(ah, reg) & ~mask; --- regVal |= (val << shift) & mask; --- --- REG_WRITE(ah, reg, regVal); --+ REG_RMW(ah, reg, ((val << shift) & mask), mask); -- -- if (ah->config.analog_shiftreg) -- udelay(100); -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..e414f23 ---- /dev/null -+++ 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 -+ -+reuse_skb is set to true if the code decides to use the last segment. -+Fixes a memory leak -+ -+Signed-off-by: Felix Fietkau -+--- -+ -+--- 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 (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 ---- a/package/kernel/mac80211/patches/333-ath9k-use-REG_RMW-and-rmw-buffer-in-ath9k_hw_4k_set_.patch -+++ /dev/null -@@ -1,47 +0,0 @@ --From: Oleksij Rempel --Date: Sun, 22 Mar 2015 19:30:01 +0100 --Subject: [PATCH] ath9k: use REG_RMW and rmw buffer in -- ath9k_hw_4k_set_gain -- --it is possible to reduce time needed for this function --by rplacing REG_WRITE with REG_RMW (plus dummy 0) and putt all commands --in same buffer. -- --Signed-off-by: Oleksij Rempel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c --+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c --@@ -772,15 +772,14 @@ static void ath9k_hw_4k_set_gain(struct -- struct ar5416_eeprom_4k *eep, -- u8 txRxAttenLocal) -- { --- REG_WRITE(ah, AR_PHY_SWITCH_CHAIN_0, --- pModal->antCtrlChain[0]); --- --- REG_WRITE(ah, AR_PHY_TIMING_CTRL4(0), --- (REG_READ(ah, AR_PHY_TIMING_CTRL4(0)) & --- ~(AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF | --- AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF)) | --- SM(pModal->iqCalICh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF) | --- SM(pModal->iqCalQCh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF)); --+ ENABLE_REG_RMW_BUFFER(ah); --+ REG_RMW(ah, AR_PHY_SWITCH_CHAIN_0, --+ pModal->antCtrlChain[0], 0); --+ --+ REG_RMW(ah, AR_PHY_TIMING_CTRL4(0), --+ SM(pModal->iqCalICh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF) | --+ SM(pModal->iqCalQCh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF), --+ AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF | AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF); -- -- if ((eep->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK) >= -- AR5416_EEP_MINOR_VER_3) { --@@ -819,6 +818,7 @@ static void ath9k_hw_4k_set_gain(struct -- AR9280_PHY_RXGAIN_TXRX_ATTEN, txRxAttenLocal); -- REG_RMW_FIELD(ah, AR_PHY_RXGAIN + 0x1000, -- AR9280_PHY_RXGAIN_TXRX_MARGIN, pModal->rxTxMarginCh[0]); --+ REG_RMW_BUFFER_FLUSH(ah); -- } -- -- /* -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 ---- a/package/kernel/mac80211/patches/334-ath9k-use-REG_RMW-and-rmw-buffer-in-ath9k_hw_def_set.patch -+++ /dev/null -@@ -1,67 +0,0 @@ --From: Oleksij Rempel --Date: Sun, 22 Mar 2015 19:30:03 +0100 --Subject: [PATCH] ath9k: use REG_RMW and rmw buffer in -- ath9k_hw_def_set_gain -- --Signed-off-by: Oleksij Rempel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/ath/ath9k/eeprom_def.c --+++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c --@@ -466,6 +466,7 @@ static void ath9k_hw_def_set_gain(struct -- struct ar5416_eeprom_def *eep, -- u8 txRxAttenLocal, int regChainOffset, int i) -- { --+ ENABLE_REG_RMW_BUFFER(ah); -- if (AR5416_VER_MASK >= AR5416_EEP_MINOR_VER_3) { -- txRxAttenLocal = pModal->txRxAttenCh[i]; -- --@@ -483,16 +484,12 @@ static void ath9k_hw_def_set_gain(struct -- AR_PHY_GAIN_2GHZ_XATTEN2_DB, -- pModal->xatten2Db[i]); -- } else { --- REG_WRITE(ah, AR_PHY_GAIN_2GHZ + regChainOffset, --- (REG_READ(ah, AR_PHY_GAIN_2GHZ + regChainOffset) & --- ~AR_PHY_GAIN_2GHZ_BSW_MARGIN) --- | SM(pModal-> bswMargin[i], --- AR_PHY_GAIN_2GHZ_BSW_MARGIN)); --- REG_WRITE(ah, AR_PHY_GAIN_2GHZ + regChainOffset, --- (REG_READ(ah, AR_PHY_GAIN_2GHZ + regChainOffset) & --- ~AR_PHY_GAIN_2GHZ_BSW_ATTEN) --- | SM(pModal->bswAtten[i], --- AR_PHY_GAIN_2GHZ_BSW_ATTEN)); --+ REG_RMW(ah, AR_PHY_GAIN_2GHZ + regChainOffset, --+ SM(pModal-> bswMargin[i], AR_PHY_GAIN_2GHZ_BSW_MARGIN), --+ AR_PHY_GAIN_2GHZ_BSW_MARGIN); --+ REG_RMW(ah, AR_PHY_GAIN_2GHZ + regChainOffset, --+ SM(pModal->bswAtten[i], AR_PHY_GAIN_2GHZ_BSW_ATTEN), --+ AR_PHY_GAIN_2GHZ_BSW_ATTEN); -- } -- } -- --@@ -504,17 +501,14 @@ static void ath9k_hw_def_set_gain(struct -- AR_PHY_RXGAIN + regChainOffset, -- AR9280_PHY_RXGAIN_TXRX_MARGIN, pModal->rxTxMarginCh[i]); -- } else { --- REG_WRITE(ah, --- AR_PHY_RXGAIN + regChainOffset, --- (REG_READ(ah, AR_PHY_RXGAIN + regChainOffset) & --- ~AR_PHY_RXGAIN_TXRX_ATTEN) --- | SM(txRxAttenLocal, AR_PHY_RXGAIN_TXRX_ATTEN)); --- REG_WRITE(ah, --- AR_PHY_GAIN_2GHZ + regChainOffset, --- (REG_READ(ah, AR_PHY_GAIN_2GHZ + regChainOffset) & --- ~AR_PHY_GAIN_2GHZ_RXTX_MARGIN) | --- SM(pModal->rxTxMarginCh[i], AR_PHY_GAIN_2GHZ_RXTX_MARGIN)); --+ REG_RMW(ah, AR_PHY_RXGAIN + regChainOffset, --+ SM(txRxAttenLocal, AR_PHY_RXGAIN_TXRX_ATTEN), --+ AR_PHY_RXGAIN_TXRX_ATTEN); --+ REG_RMW(ah, AR_PHY_GAIN_2GHZ + regChainOffset, --+ SM(pModal->rxTxMarginCh[i], AR_PHY_GAIN_2GHZ_RXTX_MARGIN), --+ AR_PHY_GAIN_2GHZ_RXTX_MARGIN); -- } --+ REG_RMW_BUFFER_FLUSH(ah); -- } -- -- static void ath9k_hw_def_set_board_values(struct ath_hw *ah, -diff --git a/package/kernel/mac80211/patches/334-mac80211-fix-wiphy-supported_band-access.patch b/package/kernel/mac80211/patches/334-mac80211-fix-wiphy-supported_band-access.patch -new file mode 100644 -index 0000000..f8f4f09 ---- /dev/null -+++ b/package/kernel/mac80211/patches/334-mac80211-fix-wiphy-supported_band-access.patch -@@ -0,0 +1,36 @@ -+From: Lorenzo Bianconi -+Date: Wed, 10 Feb 2016 16:08:17 +0100 -+Subject: [PATCH] mac80211: fix wiphy supported_band access -+ -+Fix wiphy supported_band access in tx radiotap parsing. In particular, -+info->band is always set to 0 (IEEE80211_BAND_2GHZ) since it has not -+assigned yet. This cause a kernel crash on 5GHz only devices. -+Move ieee80211_parse_tx_radiotap() after info->band assignment -+ -+Signed-off-by: Lorenzo Bianconi -+--- -+ -+--- a/net/mac80211/tx.c -++++ b/net/mac80211/tx.c -+@@ -1890,10 +1890,6 @@ netdev_tx_t ieee80211_monitor_start_xmit -+ info->flags = IEEE80211_TX_CTL_REQ_TX_STATUS | -+ IEEE80211_TX_CTL_INJECTED; -+ -+- /* process and remove the injection radiotap header */ -+- if (!ieee80211_parse_tx_radiotap(local, skb)) -+- goto fail; -+- -+ rcu_read_lock(); -+ -+ /* -+@@ -1955,6 +1951,10 @@ netdev_tx_t ieee80211_monitor_start_xmit -+ goto fail_rcu; -+ -+ info->band = chandef->chan->band; -++ /* process and remove the injection radiotap header */ -++ if (!ieee80211_parse_tx_radiotap(local, skb)) -++ goto fail_rcu; -++ -+ ieee80211_xmit(sdata, NULL, skb); -+ rcu_read_unlock(); -+ -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-0001-brcmfmac-Fix-oops-when-SDIO-device-is-removed.patch -+++ /dev/null -@@ -1,44 +0,0 @@ --From: Hante Meuleman --Date: Fri, 6 Mar 2015 18:40:38 +0100 --Subject: [PATCH] brcmfmac: Fix oops when SDIO device is removed. -- --On removal of SDIO card both functions of card will be getting --a remove call. When the first is hanging in ctrl frame xmit then --the second will cause oops. This patch fixes the xmit ctrl --handling in case of serious errors and also limits the handling --for remove to function 1 only. -- --Reviewed-by: Arend Van Spriel --Reviewed-by: Franky (Zhenhui) Lin --Reviewed-by: Pieter-Paul Giesberts --Reviewed-by: Daniel (Deognyoun) Kim --Signed-off-by: Hante Meuleman --Signed-off-by: Arend van Spriel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c --@@ -1194,7 +1194,7 @@ static void brcmf_ops_sdio_remove(struct -- brcmf_dbg(SDIO, "sdio device ID: 0x%04x\n", func->device); -- brcmf_dbg(SDIO, "Function: %d\n", func->num); -- --- if (func->num != 1 && func->num != 2) --+ if (func->num != 1) -- return; -- -- bus_if = dev_get_drvdata(&func->dev); ----- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --@@ -2740,6 +2740,11 @@ static void brcmf_sdio_dpc(struct brcmf_ -- if ((bus->sdiodev->state != BRCMF_SDIOD_DATA) || (err != 0)) { -- brcmf_err("failed backplane access over SDIO, halting operation\n"); -- atomic_set(&bus->intstatus, 0); --+ if (bus->ctrl_frame_stat) { --+ bus->ctrl_frame_err = -ENODEV; --+ bus->ctrl_frame_stat = false; --+ brcmf_sdio_wait_event_wakeup(bus); --+ } -- } else if (atomic_read(&bus->intstatus) || -- atomic_read(&bus->ipend) > 0 || -- (!atomic_read(&bus->fcstate) && -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/335-0002-brcmfmac-Simplify-watchdog-sleep.patch -+++ /dev/null -@@ -1,157 +0,0 @@ --From: Hante Meuleman --Date: Fri, 6 Mar 2015 18:40:39 +0100 --Subject: [PATCH] brcmfmac: Simplify watchdog sleep. -- --The watchdog thread is used to put the SDIO bus to sleep when the --system is idling. This patch simplifies the way it is determined --when sleep can be entered. -- --Reviewed-by: Arend Van Spriel --Reviewed-by: Franky (Zhenhui) Lin --Reviewed-by: Pieter-Paul Giesberts --Reviewed-by: Daniel (Deognyoun) Kim --Signed-off-by: Hante Meuleman --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 --@@ -485,10 +485,9 @@ struct brcmf_sdio { -- #endif /* DEBUG */ -- -- uint clkstate; /* State of sd and backplane clock(s) */ --- bool activity; /* Activity flag for clock down */ -- s32 idletime; /* Control for activity timeout */ --- s32 idlecount; /* Activity timeout counter */ --- s32 idleclock; /* How to set bus driver when idle */ --+ s32 idlecount; /* Activity timeout counter */ --+ s32 idleclock; /* How to set bus driver when idle */ -- bool rxflow_mode; /* Rx flow control mode */ -- bool rxflow; /* Is rx flow control on */ -- bool alp_only; /* Don't use HT clock (ALP only) */ --@@ -511,6 +510,7 @@ struct brcmf_sdio { -- struct workqueue_struct *brcmf_wq; -- struct work_struct datawork; -- atomic_t dpc_tskcnt; --+ atomic_t dpc_running; -- -- bool txoff; /* Transmit flow-controlled */ -- struct brcmf_sdio_count sdcnt; --@@ -959,13 +959,8 @@ static int brcmf_sdio_clkctl(struct brcm -- brcmf_dbg(SDIO, "Enter\n"); -- -- /* Early exit if we're already there */ --- if (bus->clkstate == target) { --- if (target == CLK_AVAIL) { --- brcmf_sdio_wd_timer(bus, BRCMF_WD_POLL_MS); --- bus->activity = true; --- } --+ if (bus->clkstate == target) -- return 0; --- } -- -- switch (target) { -- case CLK_AVAIL: --@@ -975,7 +970,6 @@ static int brcmf_sdio_clkctl(struct brcm -- /* Now request HT Avail on the backplane */ -- brcmf_sdio_htclk(bus, true, pendok); -- brcmf_sdio_wd_timer(bus, BRCMF_WD_POLL_MS); --- bus->activity = true; -- break; -- -- case CLK_SDONLY: --@@ -1024,17 +1018,6 @@ brcmf_sdio_bus_sleep(struct brcmf_sdio * -- -- /* Going to sleep */ -- if (sleep) { --- /* Don't sleep if something is pending */ --- if (atomic_read(&bus->intstatus) || --- atomic_read(&bus->ipend) > 0 || --- bus->ctrl_frame_stat || --- (!atomic_read(&bus->fcstate) && --- brcmu_pktq_mlen(&bus->txq, ~bus->flowcontrol) && --- data_ok(bus))) { --- err = -EBUSY; --- goto done; --- } --- -- clkcsr = brcmf_sdiod_regrb(bus->sdiodev, -- SBSDIO_FUNC1_CHIPCLKCSR, -- &err); --@@ -1045,11 +1028,7 @@ brcmf_sdio_bus_sleep(struct brcmf_sdio * -- SBSDIO_ALP_AVAIL_REQ, &err); -- } -- err = brcmf_sdio_kso_control(bus, false); --- /* disable watchdog */ --- if (!err) --- brcmf_sdio_wd_timer(bus, 0); -- } else { --- bus->idlecount = 0; -- err = brcmf_sdio_kso_control(bus, true); -- } -- if (err) { --@@ -3566,7 +3545,7 @@ void brcmf_sdio_isr(struct brcmf_sdio *b -- queue_work(bus->brcmf_wq, &bus->datawork); -- } -- ---static bool brcmf_sdio_bus_watchdog(struct brcmf_sdio *bus) --+static void brcmf_sdio_bus_watchdog(struct brcmf_sdio *bus) -- { -- brcmf_dbg(TIMER, "Enter\n"); -- --@@ -3627,22 +3606,21 @@ static bool brcmf_sdio_bus_watchdog(stru -- #endif /* DEBUG */ -- -- /* On idle timeout clear activity flag and/or turn off clock */ --- if ((bus->idletime > 0) && (bus->clkstate == CLK_AVAIL)) { --- if (++bus->idlecount >= bus->idletime) { --+ if ((atomic_read(&bus->dpc_tskcnt) == 0) && --+ (atomic_read(&bus->dpc_running) == 0) && --+ (bus->idletime > 0) && (bus->clkstate == CLK_AVAIL)) { --+ bus->idlecount++; --+ if (bus->idlecount > bus->idletime) { --+ brcmf_dbg(SDIO, "idle\n"); --+ sdio_claim_host(bus->sdiodev->func[1]); --+ brcmf_sdio_wd_timer(bus, 0); -- bus->idlecount = 0; --- if (bus->activity) { --- bus->activity = false; --- brcmf_sdio_wd_timer(bus, BRCMF_WD_POLL_MS); --- } else { --- brcmf_dbg(SDIO, "idle\n"); --- sdio_claim_host(bus->sdiodev->func[1]); --- brcmf_sdio_bus_sleep(bus, true, false); --- sdio_release_host(bus->sdiodev->func[1]); --- } --+ brcmf_sdio_bus_sleep(bus, true, false); --+ sdio_release_host(bus->sdiodev->func[1]); -- } --+ } else { --+ bus->idlecount = 0; -- } --- --- return (atomic_read(&bus->ipend) > 0); -- } -- -- static void brcmf_sdio_dataworker(struct work_struct *work) --@@ -3651,8 +3629,11 @@ static void brcmf_sdio_dataworker(struct -- datawork); -- -- while (atomic_read(&bus->dpc_tskcnt)) { --+ atomic_set(&bus->dpc_running, 1); -- atomic_set(&bus->dpc_tskcnt, 0); -- brcmf_sdio_dpc(bus); --+ bus->idlecount = 0; --+ atomic_set(&bus->dpc_running, 0); -- } -- if (brcmf_sdiod_freezing(bus->sdiodev)) { -- brcmf_sdiod_change_state(bus->sdiodev, BRCMF_SDIOD_DOWN); --@@ -4154,6 +4135,7 @@ struct brcmf_sdio *brcmf_sdio_probe(stru -- } -- /* Initialize DPC thread */ -- atomic_set(&bus->dpc_tskcnt, 0); --+ atomic_set(&bus->dpc_running, 0); -- -- /* Assign bus interface call back */ -- bus->sdiodev->bus_if->dev = bus->sdiodev->dev; -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/335-0003-brcmfmac-Fix-possible-race-condition.patch -+++ /dev/null -@@ -1,83 +0,0 @@ --From: Hante Meuleman --Date: Fri, 6 Mar 2015 18:40:40 +0100 --Subject: [PATCH] brcmfmac: Fix possible race-condition. -- --SDIO is using a "shared" variable to handoff ctl frames to DPC --and to see when they are done. In a timeout situation this can --lead to erroneous situation where DPC started to handle the ctl --frame while the timeout expired. This patch will fix this by --adding locking around the shared variable. -- --Reviewed-by: Arend Van Spriel --Reviewed-by: Franky (Zhenhui) Lin --Reviewed-by: Pieter-Paul Giesberts --Reviewed-by: Daniel (Deognyoun) Kim --Signed-off-by: Hante Meuleman --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 --@@ -2700,11 +2700,13 @@ static void brcmf_sdio_dpc(struct brcmf_ -- if (bus->ctrl_frame_stat && (bus->clkstate == CLK_AVAIL) && -- data_ok(bus)) { -- sdio_claim_host(bus->sdiodev->func[1]); --- err = brcmf_sdio_tx_ctrlframe(bus, bus->ctrl_frame_buf, --- bus->ctrl_frame_len); --+ if (bus->ctrl_frame_stat) { --+ err = brcmf_sdio_tx_ctrlframe(bus, bus->ctrl_frame_buf, --+ bus->ctrl_frame_len); --+ bus->ctrl_frame_err = err; --+ bus->ctrl_frame_stat = false; --+ } -- sdio_release_host(bus->sdiodev->func[1]); --- bus->ctrl_frame_err = err; --- bus->ctrl_frame_stat = false; -- brcmf_sdio_wait_event_wakeup(bus); -- } -- /* Send queued frames (limit 1 if rx may still be pending) */ --@@ -2720,9 +2722,13 @@ static void brcmf_sdio_dpc(struct brcmf_ -- brcmf_err("failed backplane access over SDIO, halting operation\n"); -- atomic_set(&bus->intstatus, 0); -- if (bus->ctrl_frame_stat) { --- bus->ctrl_frame_err = -ENODEV; --- bus->ctrl_frame_stat = false; --- brcmf_sdio_wait_event_wakeup(bus); --+ sdio_claim_host(bus->sdiodev->func[1]); --+ if (bus->ctrl_frame_stat) { --+ bus->ctrl_frame_err = -ENODEV; --+ bus->ctrl_frame_stat = false; --+ brcmf_sdio_wait_event_wakeup(bus); --+ } --+ sdio_release_host(bus->sdiodev->func[1]); -- } -- } else if (atomic_read(&bus->intstatus) || -- atomic_read(&bus->ipend) > 0 || --@@ -2930,15 +2936,20 @@ brcmf_sdio_bus_txctl(struct device *dev, -- brcmf_sdio_trigger_dpc(bus); -- wait_event_interruptible_timeout(bus->ctrl_wait, !bus->ctrl_frame_stat, -- msecs_to_jiffies(CTL_DONE_TIMEOUT)); --- --- if (!bus->ctrl_frame_stat) { --+ ret = 0; --+ if (bus->ctrl_frame_stat) { --+ sdio_claim_host(bus->sdiodev->func[1]); --+ if (bus->ctrl_frame_stat) { --+ brcmf_dbg(SDIO, "ctrl_frame timeout\n"); --+ bus->ctrl_frame_stat = false; --+ ret = -ETIMEDOUT; --+ } --+ sdio_release_host(bus->sdiodev->func[1]); --+ } --+ if (!ret) { -- brcmf_dbg(SDIO, "ctrl_frame complete, err=%d\n", -- bus->ctrl_frame_err); -- ret = bus->ctrl_frame_err; --- } else { --- brcmf_dbg(SDIO, "ctrl_frame timeout\n"); --- bus->ctrl_frame_stat = false; --- ret = -ETIMEDOUT; -- } -- -- if (ret) -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/335-0004-brcmfmac-Add-support-for-BCM4345-SDIO-chipset.patch -+++ /dev/null -@@ -1,86 +0,0 @@ --From: Syed Asifful Dayyan --Date: Fri, 6 Mar 2015 18:40:42 +0100 --Subject: [PATCH] brcmfmac: Add support for BCM4345 SDIO chipset. -- --These changes add support for BCM4345 SDIO chipset. -- --Reviewed-by: Pieter-Paul Giesberts --Reviewed-by: Arend Van Spriel --Reviewed-by: Hante Meuleman --Reviewed-by: Daniel (Deognyoun) Kim --Signed-off-by: Syed Asifful Dayyan --Signed-off-by: Arend van Spriel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c --@@ -1096,6 +1096,7 @@ static const struct sdio_device_id brcmf -- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43341), -- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43362), -- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4335_4339), --+ BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4345), -- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4354), -- { /* end: all zeroes */ } -- }; ----- a/drivers/net/wireless/brcm80211/brcmfmac/chip.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c --@@ -491,6 +491,10 @@ static void brcmf_chip_get_raminfo(struc -- case BRCM_CC_43362_CHIP_ID: -- ci->pub.ramsize = 0x3c000; -- break; --+ case BRCM_CC_4345_CHIP_ID: --+ ci->pub.ramsize = 0xc8000; --+ ci->pub.rambase = 0x198000; --+ break; -- case BRCM_CC_4339_CHIP_ID: -- case BRCM_CC_4354_CHIP_ID: -- case BRCM_CC_4356_CHIP_ID: ----- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --@@ -617,6 +617,8 @@ static const struct sdiod_drive_str sdio -- #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 BCM4345_FIRMWARE_NAME "brcm/brcmfmac4345-sdio.bin" --+#define BCM4345_NVRAM_NAME "brcm/brcmfmac4345-sdio.txt" -- #define BCM4354_FIRMWARE_NAME "brcm/brcmfmac4354-sdio.bin" -- #define BCM4354_NVRAM_NAME "brcm/brcmfmac4354-sdio.txt" -- --@@ -640,6 +642,8 @@ MODULE_FIRMWARE(BCM43362_FIRMWARE_NAME); -- MODULE_FIRMWARE(BCM43362_NVRAM_NAME); -- MODULE_FIRMWARE(BCM4339_FIRMWARE_NAME); -- MODULE_FIRMWARE(BCM4339_NVRAM_NAME); --+MODULE_FIRMWARE(BCM4345_FIRMWARE_NAME); --+MODULE_FIRMWARE(BCM4345_NVRAM_NAME); -- MODULE_FIRMWARE(BCM4354_FIRMWARE_NAME); -- MODULE_FIRMWARE(BCM4354_NVRAM_NAME); -- --@@ -669,6 +673,7 @@ static const struct brcmf_firmware_names -- { 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_4345_CHIP_ID, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4345) }, -- { BRCM_CC_4354_CHIP_ID, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4354) } -- }; -- ----- a/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h --+++ b/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h --@@ -37,6 +37,7 @@ -- #define BRCM_CC_43362_CHIP_ID 43362 -- #define BRCM_CC_4335_CHIP_ID 0x4335 -- #define BRCM_CC_4339_CHIP_ID 0x4339 --+#define BRCM_CC_4345_CHIP_ID 0x4345 -- #define BRCM_CC_4354_CHIP_ID 0x4354 -- #define BRCM_CC_4356_CHIP_ID 0x4356 -- #define BRCM_CC_43566_CHIP_ID 43566 ----- a/include/linux/mmc/sdio_ids.h --+++ b/include/linux/mmc/sdio_ids.h --@@ -33,6 +33,7 @@ -- #define SDIO_DEVICE_ID_BROADCOM_43341 0xa94d -- #define SDIO_DEVICE_ID_BROADCOM_4335_4339 0x4335 -- #define SDIO_DEVICE_ID_BROADCOM_43362 0xa962 --+#define SDIO_DEVICE_ID_BROADCOM_4345 0x4345 -- #define SDIO_DEVICE_ID_BROADCOM_4354 0x4354 -- -- #define SDIO_VENDOR_ID_INTEL 0x0089 -diff --git a/package/kernel/mac80211/patches/335-mac80211-minstrel_ht-set-A-MSDU-tx-limits-based-on-s.patch b/package/kernel/mac80211/patches/335-mac80211-minstrel_ht-set-A-MSDU-tx-limits-based-on-s.patch -new file mode 100644 -index 0000000..acaacf7 ---- /dev/null -+++ b/package/kernel/mac80211/patches/335-mac80211-minstrel_ht-set-A-MSDU-tx-limits-based-on-s.patch -@@ -0,0 +1,61 @@ -+From: Felix Fietkau -+Date: Thu, 18 Feb 2016 19:30:05 +0100 -+Subject: [PATCH] mac80211: minstrel_ht: set A-MSDU tx limits based on selected -+ max_prob_rate -+ -+Prevents excessive A-MSDU aggregation at low data rates or bad -+conditions. -+ -+Signed-off-by: Felix Fietkau -+--- -+ -+--- a/net/mac80211/rc80211_minstrel_ht.c -++++ b/net/mac80211/rc80211_minstrel_ht.c -+@@ -883,6 +883,39 @@ minstrel_ht_set_rate(struct minstrel_pri -+ ratetbl->rate[offset].flags = flags; -+ } -+ -++static int -++minstrel_ht_get_max_amsdu_len(struct minstrel_ht_sta *mi) -++{ -++ int group = mi->max_prob_rate / MCS_GROUP_RATES; -++ const struct mcs_group *g = &minstrel_mcs_groups[group]; -++ int rate = mi->max_prob_rate % MCS_GROUP_RATES; -++ -++ /* Disable A-MSDU if max_prob_rate is bad */ -++ if (mi->groups[group].rates[rate].prob_ewma < MINSTREL_FRAC(50, 100)) -++ return 1; -++ -++ /* If the rate is slower than single-stream MCS1, make A-MSDU limit small */ -++ if (g->duration[rate] > MCS_DURATION(1, 0, 52)) -++ return 500; -++ -++ /* -++ * If the rate is slower than single-stream MCS4, limit A-MSDU to usual -++ * data packet size -++ */ -++ if (g->duration[rate] > MCS_DURATION(1, 0, 104)) -++ return 1500; -++ -++ /* -++ * If the rate is slower than single-stream MCS7, limit A-MSDU to twice -++ * the usual data packet size -++ */ -++ if (g->duration[rate] > MCS_DURATION(1, 0, 260)) -++ return 3000; -++ -++ /* unlimited */ -++ return 0; -++} -++ -+ static void -+ minstrel_ht_update_rates(struct minstrel_priv *mp, struct minstrel_ht_sta *mi) -+ { -+@@ -907,6 +940,7 @@ minstrel_ht_update_rates(struct minstrel -+ minstrel_ht_set_rate(mp, mi, rates, i++, mi->max_prob_rate); -+ } -+ -++ mi->sta->max_rc_amsdu_len = minstrel_ht_get_max_amsdu_len(mi); -+ rates->rate[i].idx = -1; -+ rate_control_set_rates(mp->hw, mi->sta, rates); -+ } -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/336-0001-brcmfmac-remove-duplication-of-ramsize-info.patch -+++ /dev/null -@@ -1,48 +0,0 @@ --From: Arend van Spriel --Date: Wed, 11 Mar 2015 16:11:27 +0100 --Subject: [PATCH] brcmfmac: remove duplication of ramsize info -- --Removing the ramsize from the brcmf_sdio structure to avoid --duplication. The information is available in brcmf_chip --structure. -- --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/sdio.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --@@ -432,8 +432,6 @@ struct brcmf_sdio { -- struct brcmf_sdio_dev *sdiodev; /* sdio device handler */ -- struct brcmf_chip *ci; /* Chip info struct */ -- --- u32 ramsize; /* Size of RAM in SOCRAM (bytes) */ --- -- u32 hostintmask; /* Copy of Host Interrupt Mask */ -- atomic_t intstatus; /* Intstatus bits (events) pending */ -- atomic_t fcstate; /* State of dongle flow-control */ --@@ -1075,7 +1073,7 @@ static int brcmf_sdio_readshared(struct -- struct sdpcm_shared_le sh_le; -- __le32 addr_le; -- --- shaddr = bus->ci->rambase + bus->ramsize - 4; --+ shaddr = bus->ci->rambase + bus->ci->ramsize - 4; -- -- /* -- * Read last word in socram to determine --@@ -3871,13 +3869,6 @@ brcmf_sdio_probe_attach(struct brcmf_sdi -- drivestrength = DEFAULT_SDIO_DRIVE_STRENGTH; -- brcmf_sdio_drivestrengthinit(bus->sdiodev, bus->ci, drivestrength); -- --- /* Get info on the SOCRAM cores... */ --- bus->ramsize = bus->ci->ramsize; --- if (!(bus->ramsize)) { --- brcmf_err("failed to find SOCRAM memory!\n"); --- goto fail; --- } --- -- /* 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/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/336-0002-brcmfmac-always-perform-cores-checks.patch -+++ /dev/null -@@ -1,74 +0,0 @@ --From: Arend van Spriel --Date: Wed, 11 Mar 2015 16:11:28 +0100 --Subject: [PATCH] brcmfmac: always perform cores checks -- --Instead of checking the cores in the chip only if CONFIG_BRCMDBG --is selected perform the check always and extend it with more sanity --checking. -- --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/chip.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c --@@ -419,13 +419,13 @@ static struct brcmf_core *brcmf_chip_add -- return &core->pub; -- } -- ---#ifdef DEBUG -- /* safety check for chipinfo */ -- static int brcmf_chip_cores_check(struct brcmf_chip_priv *ci) -- { -- struct brcmf_core_priv *core; -- bool need_socram = false; -- bool has_socram = false; --+ bool cpu_found = false; -- int idx = 1; -- -- list_for_each_entry(core, &ci->cores, list) { --@@ -435,12 +435,14 @@ static int brcmf_chip_cores_check(struct -- -- switch (core->pub.id) { -- case BCMA_CORE_ARM_CM3: --+ cpu_found = true; -- need_socram = true; -- break; -- case BCMA_CORE_INTERNAL_MEM: -- has_socram = true; -- break; -- case BCMA_CORE_ARM_CR4: --+ cpu_found = true; -- if (ci->pub.rambase == 0) { -- brcmf_err("RAM base not provided with ARM CR4 core\n"); -- return -ENOMEM; --@@ -451,19 +453,21 @@ static int brcmf_chip_cores_check(struct -- } -- } -- --+ if (!cpu_found) { --+ brcmf_err("CPU core not detected\n"); --+ return -ENXIO; --+ } -- /* check RAM core presence for ARM CM3 core */ -- if (need_socram && !has_socram) { -- brcmf_err("RAM core not provided with ARM CM3 core\n"); -- return -ENODEV; -- } --+ if (!ci->pub.ramsize) { --+ brcmf_err("RAM size is undetermined\n"); --+ return -ENOMEM; --+ } -- return 0; -- } ---#else /* DEBUG */ ---static inline int brcmf_chip_cores_check(struct brcmf_chip_priv *ci) ---{ --- return 0; ---} ---#endif -- -- static void brcmf_chip_get_raminfo(struct brcmf_chip_priv *ci) -- { -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/336-0003-brcmfmac-rename-chip-download-functions.patch -+++ /dev/null -@@ -1,240 +0,0 @@ --From: Arend van Spriel --Date: Wed, 11 Mar 2015 16:11:29 +0100 --Subject: [PATCH] brcmfmac: rename chip download functions -- --The functions brcmf_chip_[enter/exit]_download() are not exclusively --used for firmware download so rename these more appropriate. -- --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/chip.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c --@@ -807,7 +807,7 @@ struct brcmf_chip *brcmf_chip_attach(voi -- err = -EINVAL; -- if (WARN_ON(!ops->prepare)) -- err = -EINVAL; --- if (WARN_ON(!ops->exit_dl)) --+ if (WARN_ON(!ops->activate)) -- err = -EINVAL; -- if (err < 0) -- return ERR_PTR(-EINVAL); --@@ -905,7 +905,7 @@ void brcmf_chip_resetcore(struct brcmf_c -- } -- -- static void ---brcmf_chip_cm3_enterdl(struct brcmf_chip_priv *chip) --+brcmf_chip_cm3_set_passive(struct brcmf_chip_priv *chip) -- { -- struct brcmf_core *core; -- --@@ -919,7 +919,7 @@ brcmf_chip_cm3_enterdl(struct brcmf_chip -- brcmf_chip_resetcore(core, 0, 0, 0); -- } -- ---static bool brcmf_chip_cm3_exitdl(struct brcmf_chip_priv *chip) --+static bool brcmf_chip_cm3_set_active(struct brcmf_chip_priv *chip) -- { -- struct brcmf_core *core; -- --@@ -929,7 +929,7 @@ static bool brcmf_chip_cm3_exitdl(struct -- return false; -- } -- --- chip->ops->exit_dl(chip->ctx, &chip->pub, 0); --+ chip->ops->activate(chip->ctx, &chip->pub, 0); -- -- core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_ARM_CM3); -- brcmf_chip_resetcore(core, 0, 0, 0); --@@ -938,7 +938,7 @@ static bool brcmf_chip_cm3_exitdl(struct -- } -- -- static inline void ---brcmf_chip_cr4_enterdl(struct brcmf_chip_priv *chip) --+brcmf_chip_cr4_set_passive(struct brcmf_chip_priv *chip) -- { -- struct brcmf_core *core; -- --@@ -951,11 +951,11 @@ brcmf_chip_cr4_enterdl(struct brcmf_chip -- D11_BCMA_IOCTL_PHYCLOCKEN); -- } -- ---static bool brcmf_chip_cr4_exitdl(struct brcmf_chip_priv *chip, u32 rstvec) --+static bool brcmf_chip_cr4_set_active(struct brcmf_chip_priv *chip, u32 rstvec) -- { -- struct brcmf_core *core; -- --- chip->ops->exit_dl(chip->ctx, &chip->pub, rstvec); --+ chip->ops->activate(chip->ctx, &chip->pub, rstvec); -- -- /* restore ARM */ -- core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_ARM_CR4); --@@ -964,7 +964,7 @@ static bool brcmf_chip_cr4_exitdl(struct -- return true; -- } -- ---void brcmf_chip_enter_download(struct brcmf_chip *pub) --+void brcmf_chip_set_passive(struct brcmf_chip *pub) -- { -- struct brcmf_chip_priv *chip; -- struct brcmf_core *arm; --@@ -974,14 +974,14 @@ void brcmf_chip_enter_download(struct br -- chip = container_of(pub, struct brcmf_chip_priv, pub); -- arm = brcmf_chip_get_core(pub, BCMA_CORE_ARM_CR4); -- if (arm) { --- brcmf_chip_cr4_enterdl(chip); --+ brcmf_chip_cr4_set_passive(chip); -- return; -- } -- --- brcmf_chip_cm3_enterdl(chip); --+ brcmf_chip_cm3_set_passive(chip); -- } -- ---bool brcmf_chip_exit_download(struct brcmf_chip *pub, u32 rstvec) --+bool brcmf_chip_set_active(struct brcmf_chip *pub, u32 rstvec) -- { -- struct brcmf_chip_priv *chip; -- struct brcmf_core *arm; --@@ -991,9 +991,9 @@ bool brcmf_chip_exit_download(struct brc -- chip = container_of(pub, struct brcmf_chip_priv, pub); -- arm = brcmf_chip_get_core(pub, BCMA_CORE_ARM_CR4); -- if (arm) --- return brcmf_chip_cr4_exitdl(chip, rstvec); --+ return brcmf_chip_cr4_set_active(chip, rstvec); -- --- return brcmf_chip_cm3_exitdl(chip); --+ return brcmf_chip_cm3_set_active(chip); -- } -- -- bool brcmf_chip_sr_capable(struct brcmf_chip *pub) ----- a/drivers/net/wireless/brcm80211/brcmfmac/chip.h --+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.h --@@ -64,7 +64,7 @@ struct brcmf_core { -- * @write32: write 32-bit value over bus. -- * @prepare: prepare bus for core configuration. -- * @setup: bus-specific core setup. --- * @exit_dl: exit download state. --+ * @active: chip becomes active. -- * The callback should use the provided @rstvec when non-zero. -- */ -- struct brcmf_buscore_ops { --@@ -72,7 +72,7 @@ struct brcmf_buscore_ops { -- void (*write32)(void *ctx, u32 addr, u32 value); -- int (*prepare)(void *ctx); -- int (*setup)(void *ctx, struct brcmf_chip *chip); --- void (*exit_dl)(void *ctx, struct brcmf_chip *chip, u32 rstvec); --+ void (*activate)(void *ctx, struct brcmf_chip *chip, u32 rstvec); -- }; -- -- struct brcmf_chip *brcmf_chip_attach(void *ctx, --@@ -84,8 +84,8 @@ bool brcmf_chip_iscoreup(struct brcmf_co -- void brcmf_chip_coredisable(struct brcmf_core *core, u32 prereset, u32 reset); -- void brcmf_chip_resetcore(struct brcmf_core *core, u32 prereset, u32 reset, -- u32 postreset); ---void brcmf_chip_enter_download(struct brcmf_chip *ci); ---bool brcmf_chip_exit_download(struct brcmf_chip *ci, u32 rstvec); --+void brcmf_chip_set_passive(struct brcmf_chip *ci); --+bool brcmf_chip_set_active(struct brcmf_chip *ci, u32 rstvec); -- bool brcmf_chip_sr_capable(struct brcmf_chip *pub); -- -- #endif /* BRCMF_AXIDMP_H */ ----- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --@@ -509,7 +509,7 @@ static void brcmf_pcie_attach(struct brc -- -- static int brcmf_pcie_enter_download_state(struct brcmf_pciedev_info *devinfo) -- { --- brcmf_chip_enter_download(devinfo->ci); --+ brcmf_chip_set_passive(devinfo->ci); -- -- if (devinfo->ci->chip == BRCM_CC_43602_CHIP_ID) { -- brcmf_pcie_select_core(devinfo, BCMA_CORE_ARM_CR4); --@@ -536,7 +536,7 @@ static int brcmf_pcie_exit_download_stat -- brcmf_chip_resetcore(core, 0, 0, 0); -- } -- --- return !brcmf_chip_exit_download(devinfo->ci, resetintr); --+ return !brcmf_chip_set_active(devinfo->ci, resetintr); -- } -- -- --@@ -1566,8 +1566,8 @@ static int brcmf_pcie_buscoreprep(void * -- } -- -- ---static void brcmf_pcie_buscore_exitdl(void *ctx, struct brcmf_chip *chip, --- u32 rstvec) --+static void brcmf_pcie_buscore_activate(void *ctx, struct brcmf_chip *chip, --+ u32 rstvec) -- { -- struct brcmf_pciedev_info *devinfo = (struct brcmf_pciedev_info *)ctx; -- --@@ -1577,7 +1577,7 @@ static void brcmf_pcie_buscore_exitdl(vo -- -- static const struct brcmf_buscore_ops brcmf_pcie_buscore_ops = { -- .prepare = brcmf_pcie_buscoreprep, --- .exit_dl = brcmf_pcie_buscore_exitdl, --+ .activate = brcmf_pcie_buscore_activate, -- .read32 = brcmf_pcie_buscore_read32, -- .write32 = brcmf_pcie_buscore_write32, -- }; ----- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --@@ -3357,7 +3357,7 @@ static int brcmf_sdio_download_firmware( -- brcmf_sdio_clkctl(bus, CLK_AVAIL, false); -- -- /* Keep arm in reset */ --- brcmf_chip_enter_download(bus->ci); --+ brcmf_chip_set_passive(bus->ci); -- -- rstvec = get_unaligned_le32(fw->data); -- brcmf_dbg(SDIO, "firmware rstvec: %x\n", rstvec); --@@ -3378,7 +3378,7 @@ static int brcmf_sdio_download_firmware( -- } -- -- /* Take arm out of reset */ --- if (!brcmf_chip_exit_download(bus->ci, rstvec)) { --+ if (!brcmf_chip_set_active(bus->ci, rstvec)) { -- brcmf_err("error getting out of ARM core reset\n"); -- goto err; -- } --@@ -3771,8 +3771,8 @@ static int brcmf_sdio_buscoreprep(void * -- return 0; -- } -- ---static void brcmf_sdio_buscore_exitdl(void *ctx, struct brcmf_chip *chip, --- u32 rstvec) --+static void brcmf_sdio_buscore_activate(void *ctx, struct brcmf_chip *chip, --+ u32 rstvec) -- { -- struct brcmf_sdio_dev *sdiodev = ctx; -- struct brcmf_core *core; --@@ -3815,7 +3815,7 @@ static void brcmf_sdio_buscore_write32(v -- -- static const struct brcmf_buscore_ops brcmf_sdio_buscore_ops = { -- .prepare = brcmf_sdio_buscoreprep, --- .exit_dl = brcmf_sdio_buscore_exitdl, --+ .activate = brcmf_sdio_buscore_activate, -- .read32 = brcmf_sdio_buscore_read32, -- .write32 = brcmf_sdio_buscore_write32, -- }; --@@ -4239,12 +4239,11 @@ void brcmf_sdio_remove(struct brcmf_sdio -- sdio_claim_host(bus->sdiodev->func[1]); -- brcmf_sdio_clkctl(bus, CLK_AVAIL, false); -- /* Leave the device in state where it is --- * 'quiet'. This is done by putting it in --- * download_state which essentially resets --- * all necessary cores. --+ * 'passive'. This is done by resetting all --+ * necessary cores. -- */ -- msleep(20); --- brcmf_chip_enter_download(bus->ci); --+ brcmf_chip_set_passive(bus->ci); -- brcmf_sdio_clkctl(bus, CLK_NONE, false); -- sdio_release_host(bus->sdiodev->func[1]); -- } -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/336-0004-brcmfmac-assure-device-is-ready-for-download-after-b.patch -+++ /dev/null -@@ -1,61 +0,0 @@ --From: Arend van Spriel --Date: Wed, 11 Mar 2015 16:11:30 +0100 --Subject: [PATCH] brcmfmac: assure device is ready for download after -- brcmf_chip_attach() -- --Make the brcmf_chip_attach() function responsible for putting the --device in a state where it is accessible for firmware download. -- --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/chip.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c --@@ -786,12 +786,6 @@ static int brcmf_chip_setup(struct brcmf -- if (chip->ops->setup) -- ret = chip->ops->setup(chip->ctx, pub); -- --- /* --- * Make sure any on-chip ARM is off (in case strapping is wrong), --- * or downloaded code was already running. --- */ --- brcmf_chip_disable_arm(chip, BCMA_CORE_ARM_CM3); --- brcmf_chip_disable_arm(chip, BCMA_CORE_ARM_CR4); -- return ret; -- } -- --@@ -833,6 +827,8 @@ struct brcmf_chip *brcmf_chip_attach(voi -- if (err < 0) -- goto fail; -- --+ /* assure chip is passive for download */ --+ brcmf_chip_set_passive(&chip->pub); -- return &chip->pub; -- -- fail: ----- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --@@ -509,8 +509,6 @@ static void brcmf_pcie_attach(struct brc -- -- static int brcmf_pcie_enter_download_state(struct brcmf_pciedev_info *devinfo) -- { --- brcmf_chip_set_passive(devinfo->ci); --- -- if (devinfo->ci->chip == BRCM_CC_43602_CHIP_ID) { -- brcmf_pcie_select_core(devinfo, BCMA_CORE_ARM_CR4); -- brcmf_pcie_write_reg32(devinfo, BRCMF_PCIE_ARMCR4REG_BANKIDX, ----- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --@@ -3356,9 +3356,6 @@ static int brcmf_sdio_download_firmware( -- sdio_claim_host(bus->sdiodev->func[1]); -- brcmf_sdio_clkctl(bus, CLK_AVAIL, false); -- --- /* Keep arm in reset */ --- brcmf_chip_set_passive(bus->ci); --- -- rstvec = get_unaligned_le32(fw->data); -- brcmf_dbg(SDIO, "firmware rstvec: %x\n", rstvec); -- -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/336-0005-brcmfmac-extract-ram-size-info-from-internal-memory-.patch -+++ /dev/null -@@ -1,367 +0,0 @@ --From: Arend van Spriel --Date: Wed, 11 Mar 2015 16:11:31 +0100 --Subject: [PATCH] brcmfmac: extract ram size info from internal memory -- registers -- --Instead of hard-coded memory sizes it is possible to obtain that --information from the internal memory registers. -- --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/chip.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c --@@ -100,9 +100,6 @@ -- #define BCM4329_CORE_SOCRAM_BASE 0x18003000 -- /* ARM Cortex M3 core, ID 0x82a */ -- #define BCM4329_CORE_ARM_BASE 0x18002000 ---#define BCM4329_RAMSIZE 0x48000 ---/* bcm43143 */ ---#define BCM43143_RAMSIZE 0x70000 -- -- #define CORE_SB(base, field) \ -- (base + SBCONFIGOFF + offsetof(struct sbconfig, field)) --@@ -150,6 +147,78 @@ struct sbconfig { -- u32 sbidhigh; /* identification */ -- }; -- --+/* bankidx and bankinfo reg defines corerev >= 8 */ --+#define SOCRAM_BANKINFO_RETNTRAM_MASK 0x00010000 --+#define SOCRAM_BANKINFO_SZMASK 0x0000007f --+#define SOCRAM_BANKIDX_ROM_MASK 0x00000100 --+ --+#define SOCRAM_BANKIDX_MEMTYPE_SHIFT 8 --+/* socram bankinfo memtype */ --+#define SOCRAM_MEMTYPE_RAM 0 --+#define SOCRAM_MEMTYPE_R0M 1 --+#define SOCRAM_MEMTYPE_DEVRAM 2 --+ --+#define SOCRAM_BANKINFO_SZBASE 8192 --+#define SRCI_LSS_MASK 0x00f00000 --+#define SRCI_LSS_SHIFT 20 --+#define SRCI_SRNB_MASK 0xf0 --+#define SRCI_SRNB_SHIFT 4 --+#define SRCI_SRBSZ_MASK 0xf --+#define SRCI_SRBSZ_SHIFT 0 --+#define SR_BSZ_BASE 14 --+ --+struct sbsocramregs { --+ u32 coreinfo; --+ u32 bwalloc; --+ u32 extracoreinfo; --+ u32 biststat; --+ u32 bankidx; --+ u32 standbyctrl; --+ --+ u32 errlogstatus; /* rev 6 */ --+ u32 errlogaddr; /* rev 6 */ --+ /* used for patching rev 3 & 5 */ --+ u32 cambankidx; --+ u32 cambankstandbyctrl; --+ u32 cambankpatchctrl; --+ u32 cambankpatchtblbaseaddr; --+ u32 cambankcmdreg; --+ u32 cambankdatareg; --+ u32 cambankmaskreg; --+ u32 PAD[1]; --+ u32 bankinfo; /* corev 8 */ --+ u32 bankpda; --+ u32 PAD[14]; --+ u32 extmemconfig; --+ u32 extmemparitycsr; --+ u32 extmemparityerrdata; --+ u32 extmemparityerrcnt; --+ u32 extmemwrctrlandsize; --+ u32 PAD[84]; --+ u32 workaround; --+ u32 pwrctl; /* corerev >= 2 */ --+ u32 PAD[133]; --+ u32 sr_control; /* corerev >= 15 */ --+ u32 sr_status; /* corerev >= 15 */ --+ u32 sr_address; /* corerev >= 15 */ --+ u32 sr_data; /* corerev >= 15 */ --+}; --+ --+#define SOCRAMREGOFFS(_f) offsetof(struct sbsocramregs, _f) --+ --+#define ARMCR4_CAP (0x04) --+#define ARMCR4_BANKIDX (0x40) --+#define ARMCR4_BANKINFO (0x44) --+#define ARMCR4_BANKPDA (0x4C) --+ --+#define ARMCR4_TCBBNB_MASK 0xf0 --+#define ARMCR4_TCBBNB_SHIFT 4 --+#define ARMCR4_TCBANB_MASK 0xf --+#define ARMCR4_TCBANB_SHIFT 0 --+ --+#define ARMCR4_BSZ_MASK 0x3f --+#define ARMCR4_BSZ_MULT 8192 --+ -- struct brcmf_core_priv { -- struct brcmf_core pub; -- u32 wrapbase; --@@ -443,10 +512,6 @@ static int brcmf_chip_cores_check(struct -- break; -- case BCMA_CORE_ARM_CR4: -- cpu_found = true; --- if (ci->pub.rambase == 0) { --- brcmf_err("RAM base not provided with ARM CR4 core\n"); --- return -ENOMEM; --- } -- break; -- default: -- break; --@@ -462,60 +527,160 @@ static int brcmf_chip_cores_check(struct -- brcmf_err("RAM core not provided with ARM CM3 core\n"); -- return -ENODEV; -- } --- if (!ci->pub.ramsize) { --- brcmf_err("RAM size is undetermined\n"); --- return -ENOMEM; --- } -- return 0; -- } -- ---static void brcmf_chip_get_raminfo(struct brcmf_chip_priv *ci) --+static u32 brcmf_chip_core_read32(struct brcmf_core_priv *core, u16 reg) -- { --- switch (ci->pub.chip) { --- case BRCM_CC_4329_CHIP_ID: --- ci->pub.ramsize = BCM4329_RAMSIZE; --- break; --- case BRCM_CC_43143_CHIP_ID: --- ci->pub.ramsize = BCM43143_RAMSIZE; --- break; --- case BRCM_CC_43241_CHIP_ID: --- ci->pub.ramsize = 0x90000; --- break; --- case BRCM_CC_4330_CHIP_ID: --- ci->pub.ramsize = 0x48000; --- break; --+ return core->chip->ops->read32(core->chip->ctx, core->pub.base + reg); --+} --+ --+static void brcmf_chip_core_write32(struct brcmf_core_priv *core, --+ u16 reg, u32 val) --+{ --+ core->chip->ops->write32(core->chip->ctx, core->pub.base + reg, val); --+} --+ --+static bool brcmf_chip_socram_banksize(struct brcmf_core_priv *core, u8 idx, --+ u32 *banksize) --+{ --+ u32 bankinfo; --+ u32 bankidx = (SOCRAM_MEMTYPE_RAM << SOCRAM_BANKIDX_MEMTYPE_SHIFT); --+ --+ bankidx |= idx; --+ brcmf_chip_core_write32(core, SOCRAMREGOFFS(bankidx), bankidx); --+ bankinfo = brcmf_chip_core_read32(core, SOCRAMREGOFFS(bankinfo)); --+ *banksize = (bankinfo & SOCRAM_BANKINFO_SZMASK) + 1; --+ *banksize *= SOCRAM_BANKINFO_SZBASE; --+ return !!(bankinfo & SOCRAM_BANKINFO_RETNTRAM_MASK); --+} --+ --+static void brcmf_chip_socram_ramsize(struct brcmf_core_priv *sr, u32 *ramsize, --+ u32 *srsize) --+{ --+ u32 coreinfo; --+ uint nb, banksize, lss; --+ bool retent; --+ int i; --+ --+ *ramsize = 0; --+ *srsize = 0; --+ --+ if (WARN_ON(sr->pub.rev < 4)) --+ return; --+ --+ if (!brcmf_chip_iscoreup(&sr->pub)) --+ brcmf_chip_resetcore(&sr->pub, 0, 0, 0); --+ --+ /* Get info for determining size */ --+ coreinfo = brcmf_chip_core_read32(sr, SOCRAMREGOFFS(coreinfo)); --+ nb = (coreinfo & SRCI_SRNB_MASK) >> SRCI_SRNB_SHIFT; --+ --+ if ((sr->pub.rev <= 7) || (sr->pub.rev == 12)) { --+ banksize = (coreinfo & SRCI_SRBSZ_MASK); --+ lss = (coreinfo & SRCI_LSS_MASK) >> SRCI_LSS_SHIFT; --+ if (lss != 0) --+ nb--; --+ *ramsize = nb * (1 << (banksize + SR_BSZ_BASE)); --+ if (lss != 0) --+ *ramsize += (1 << ((lss - 1) + SR_BSZ_BASE)); --+ } else { --+ nb = (coreinfo & SRCI_SRNB_MASK) >> SRCI_SRNB_SHIFT; --+ for (i = 0; i < nb; i++) { --+ retent = brcmf_chip_socram_banksize(sr, i, &banksize); --+ *ramsize += banksize; --+ if (retent) --+ *srsize += banksize; --+ } --+ } --+ --+ /* hardcoded save&restore memory sizes */ --+ switch (sr->chip->pub.chip) { -- case BRCM_CC_4334_CHIP_ID: --- case BRCM_CC_43340_CHIP_ID: --- ci->pub.ramsize = 0x80000; --+ if (sr->chip->pub.chiprev < 2) --+ *srsize = (32 * 1024); -- break; --- case BRCM_CC_4335_CHIP_ID: --- ci->pub.ramsize = 0xc0000; --- ci->pub.rambase = 0x180000; --- break; --- case BRCM_CC_43362_CHIP_ID: --- ci->pub.ramsize = 0x3c000; --+ default: -- break; --+ } --+} --+ --+/** Return the TCM-RAM size of the ARMCR4 core. */ --+static u32 brcmf_chip_tcm_ramsize(struct brcmf_core_priv *cr4) --+{ --+ u32 corecap; --+ u32 memsize = 0; --+ u32 nab; --+ u32 nbb; --+ u32 totb; --+ u32 bxinfo; --+ u32 idx; --+ --+ corecap = brcmf_chip_core_read32(cr4, ARMCR4_CAP); --+ --+ nab = (corecap & ARMCR4_TCBANB_MASK) >> ARMCR4_TCBANB_SHIFT; --+ nbb = (corecap & ARMCR4_TCBBNB_MASK) >> ARMCR4_TCBBNB_SHIFT; --+ totb = nab + nbb; --+ --+ for (idx = 0; idx < totb; idx++) { --+ brcmf_chip_core_write32(cr4, ARMCR4_BANKIDX, idx); --+ bxinfo = brcmf_chip_core_read32(cr4, ARMCR4_BANKINFO); --+ memsize += ((bxinfo & ARMCR4_BSZ_MASK) + 1) * ARMCR4_BSZ_MULT; --+ } --+ --+ return memsize; --+} --+ --+static u32 brcmf_chip_tcm_rambase(struct brcmf_chip_priv *ci) --+{ --+ switch (ci->pub.chip) { -- case BRCM_CC_4345_CHIP_ID: --- ci->pub.ramsize = 0xc8000; --- ci->pub.rambase = 0x198000; --- break; --+ return 0x198000; --+ case BRCM_CC_4335_CHIP_ID: -- case BRCM_CC_4339_CHIP_ID: -- case BRCM_CC_4354_CHIP_ID: -- case BRCM_CC_4356_CHIP_ID: -- case BRCM_CC_43567_CHIP_ID: -- case BRCM_CC_43569_CHIP_ID: -- case BRCM_CC_43570_CHIP_ID: --- ci->pub.ramsize = 0xc0000; --- ci->pub.rambase = 0x180000; --- break; -- case BRCM_CC_43602_CHIP_ID: --- ci->pub.ramsize = 0xf0000; --- ci->pub.rambase = 0x180000; --- break; --+ return 0x180000; -- default: -- brcmf_err("unknown chip: %s\n", ci->pub.name); -- break; -- } --+ return 0; --+} --+ --+static int brcmf_chip_get_raminfo(struct brcmf_chip_priv *ci) --+{ --+ struct brcmf_core_priv *mem_core; --+ struct brcmf_core *mem; --+ --+ mem = brcmf_chip_get_core(&ci->pub, BCMA_CORE_ARM_CR4); --+ if (mem) { --+ mem_core = container_of(mem, struct brcmf_core_priv, pub); --+ ci->pub.ramsize = brcmf_chip_tcm_ramsize(mem_core); --+ ci->pub.rambase = brcmf_chip_tcm_rambase(ci); --+ if (!ci->pub.rambase) { --+ brcmf_err("RAM base not provided with ARM CR4 core\n"); --+ 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); --+ } --+ 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, --+ ci->pub.srsize, ci->pub.srsize); --+ --+ if (!ci->pub.ramsize) { --+ brcmf_err("RAM size is undetermined\n"); --+ return -ENOMEM; --+ } --+ return 0; -- } -- -- static u32 brcmf_chip_dmp_get_desc(struct brcmf_chip_priv *ci, u32 *eromaddr, --@@ -668,6 +833,7 @@ static int brcmf_chip_recognition(struct -- struct brcmf_core *core; -- u32 regdata; -- u32 socitype; --+ int ret; -- -- /* Get CC core rev -- * Chipid is assume to be at offset 0 from SI_ENUM_BASE --@@ -720,9 +886,13 @@ static int brcmf_chip_recognition(struct -- return -ENODEV; -- } -- --- brcmf_chip_get_raminfo(ci); --- --- return brcmf_chip_cores_check(ci); --+ ret = brcmf_chip_cores_check(ci); --+ if (ret) --+ return ret; --+ --+ /* assure chip is passive for core access */ --+ brcmf_chip_set_passive(&ci->pub); --+ return brcmf_chip_get_raminfo(ci); -- } -- -- static void brcmf_chip_disable_arm(struct brcmf_chip_priv *chip, u16 id) --@@ -827,8 +997,6 @@ struct brcmf_chip *brcmf_chip_attach(voi -- if (err < 0) -- goto fail; -- --- /* assure chip is passive for download */ --- brcmf_chip_set_passive(&chip->pub); -- return &chip->pub; -- -- fail: ----- a/drivers/net/wireless/brcm80211/brcmfmac/chip.h --+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.h --@@ -30,7 +30,8 @@ -- * @pmucaps: PMU capabilities. -- * @pmurev: PMU revision. -- * @rambase: RAM base address (only applicable for ARM CR4 chips). --- * @ramsize: amount of RAM on chip. --+ * @ramsize: amount of RAM on chip including retention. --+ * @srsize: amount of retention RAM on chip. -- * @name: string representation of the chip identifier. -- */ -- struct brcmf_chip { --@@ -41,6 +42,7 @@ struct brcmf_chip { -- u32 pmurev; -- u32 rambase; -- u32 ramsize; --+ u32 srsize; -- char name[8]; -- }; -- -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/336-0006-brcmfmac-take-save-restore-memory-into-account-for-S.patch -+++ /dev/null -@@ -1,96 +0,0 @@ --From: Arend van Spriel --Date: Wed, 11 Mar 2015 16:11:32 +0100 --Subject: [PATCH] brcmfmac: take save&restore memory into account for SDIO -- shared info -- --The firmware provides pointer to SDIO shared information at end of --RAM during firmware initialization. End of RAM is obviously determined --by the actual ram size, but part of that may be used for save&restore --memory. In that case another location in RAM will hold the pointer. -- --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/sdio.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --@@ -1067,44 +1067,47 @@ static inline bool brcmf_sdio_valid_shar -- static int brcmf_sdio_readshared(struct brcmf_sdio *bus, -- struct sdpcm_shared *sh) -- { --- u32 addr; --+ u32 addr = 0; -- int rv; -- u32 shaddr = 0; -- struct sdpcm_shared_le sh_le; -- __le32 addr_le; -- --- shaddr = bus->ci->rambase + bus->ci->ramsize - 4; --+ sdio_claim_host(bus->sdiodev->func[1]); --+ brcmf_sdio_bus_sleep(bus, false, false); -- -- /* -- * Read last word in socram to determine -- * address of sdpcm_shared structure -- */ --- sdio_claim_host(bus->sdiodev->func[1]); --- brcmf_sdio_bus_sleep(bus, false, false); --- rv = brcmf_sdiod_ramrw(bus->sdiodev, false, shaddr, (u8 *)&addr_le, 4); --- sdio_release_host(bus->sdiodev->func[1]); --+ shaddr = bus->ci->rambase + bus->ci->ramsize - 4; --+ if (!bus->ci->rambase && brcmf_chip_sr_capable(bus->ci)) --+ shaddr -= bus->ci->srsize; --+ rv = brcmf_sdiod_ramrw(bus->sdiodev, false, shaddr, --+ (u8 *)&addr_le, 4); -- if (rv < 0) --- return rv; --- --- addr = le32_to_cpu(addr_le); --- --- brcmf_dbg(SDIO, "sdpcm_shared address 0x%08X\n", addr); --+ goto fail; -- -- /* -- * Check if addr is valid. -- * NVRAM length at the end of memory should have been overwritten. -- */ --+ addr = le32_to_cpu(addr_le); -- if (!brcmf_sdio_valid_shared_address(addr)) { --- brcmf_err("invalid sdpcm_shared address 0x%08X\n", --- addr); --- return -EINVAL; --+ brcmf_err("invalid sdpcm_shared address 0x%08X\n", addr); --+ rv = -EINVAL; --+ goto fail; -- } -- --+ brcmf_dbg(INFO, "sdpcm_shared address 0x%08X\n", addr); --+ -- /* Read hndrte_shared structure */ -- rv = brcmf_sdiod_ramrw(bus->sdiodev, false, addr, (u8 *)&sh_le, -- sizeof(struct sdpcm_shared_le)); -- if (rv < 0) --- return rv; --+ goto fail; --+ --+ sdio_release_host(bus->sdiodev->func[1]); -- -- /* Endianness */ -- sh->flags = le32_to_cpu(sh_le.flags); --@@ -1121,8 +1124,13 @@ static int brcmf_sdio_readshared(struct -- sh->flags & SDPCM_SHARED_VERSION_MASK); -- return -EPROTO; -- } --- -- return 0; --+ --+fail: --+ brcmf_err("unable to obtain sdpcm_shared info: rv=%d (addr=0x%x)\n", --+ rv, addr); --+ sdio_release_host(bus->sdiodev->func[1]); --+ return rv; -- } -- -- static void brcmf_sdio_get_console_addr(struct brcmf_sdio *bus) -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/336-0007-brcmfmac-fix-watchdog-timer-regression.patch -+++ /dev/null -@@ -1,59 +0,0 @@ --From: Arend van Spriel --Date: Wed, 11 Mar 2015 16:11:33 +0100 --Subject: [PATCH] brcmfmac: fix watchdog timer regression -- --The watchdog timer is used to put the device in a low-power mode when --it is idle for some time. This timer is stopped during that mode and --should be restarted upon activity. This has been broken by commit --d4150fced0365 ("brcmfmac: Simplify watchdog sleep."). This patch --restores the behaviour as it was before that commit. -- --Reported-by: Pontus Fuchs --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/sdio.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --@@ -972,7 +972,6 @@ static int brcmf_sdio_clkctl(struct brcm -- brcmf_sdio_sdclk(bus, true); -- /* Now request HT Avail on the backplane */ -- brcmf_sdio_htclk(bus, true, pendok); --- brcmf_sdio_wd_timer(bus, BRCMF_WD_POLL_MS); -- break; -- -- case CLK_SDONLY: --@@ -984,7 +983,6 @@ static int brcmf_sdio_clkctl(struct brcm -- else -- brcmf_err("request for %d -> %d\n", -- bus->clkstate, target); --- brcmf_sdio_wd_timer(bus, BRCMF_WD_POLL_MS); -- break; -- -- case CLK_NONE: --@@ -993,7 +991,6 @@ static int brcmf_sdio_clkctl(struct brcm -- brcmf_sdio_htclk(bus, false, false); -- /* Now remove the SD clock */ -- brcmf_sdio_sdclk(bus, false); --- brcmf_sdio_wd_timer(bus, 0); -- break; -- } -- #ifdef DEBUG --@@ -1048,6 +1045,7 @@ end: -- brcmf_sdio_clkctl(bus, CLK_NONE, pendok); -- } else { -- brcmf_sdio_clkctl(bus, CLK_AVAIL, pendok); --+ brcmf_sdio_wd_timer(bus, BRCMF_WD_POLL_MS); -- } -- bus->sleeping = sleep; -- brcmf_dbg(SDIO, "new state %s\n", --@@ -4242,6 +4240,7 @@ void brcmf_sdio_remove(struct brcmf_sdio -- if (bus->ci) { -- if (bus->sdiodev->state != BRCMF_SDIOD_NOMEDIUM) { -- sdio_claim_host(bus->sdiodev->func[1]); --+ brcmf_sdio_wd_timer(bus, 0); -- 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-mac80211-minstrel_ht-set-default-tx-aggregation-time.patch b/package/kernel/mac80211/patches/336-mac80211-minstrel_ht-set-default-tx-aggregation-time.patch -new file mode 100644 -index 0000000..32a2ad6 ---- /dev/null -+++ b/package/kernel/mac80211/patches/336-mac80211-minstrel_ht-set-default-tx-aggregation-time.patch -@@ -0,0 +1,31 @@ -+From: Felix Fietkau -+Date: Thu, 18 Feb 2016 19:45:33 +0100 -+Subject: [PATCH] mac80211: minstrel_ht: set default tx aggregation timeout to -+ 0 -+ -+The value 5000 was put here with the addition of the timeout field to -+ieee80211_start_tx_ba_session. It was originally added in mac80211 to -+save resources for drivers like iwlwifi, which only supports a limited -+number of concurrent aggregation sessions. -+ -+Since iwlwifi does not use minstrel_ht and other drivers don't need -+this, 0 is a better default - especially since there have been -+recent reports of aggregation setup related issues reproduced with -+ath9k. This should improve stability without causing any adverse -+effects. -+ -+Cc: stable@vger.kernel.org -+Signed-off-by: Felix Fietkau -+--- -+ -+--- a/net/mac80211/rc80211_minstrel_ht.c -++++ b/net/mac80211/rc80211_minstrel_ht.c -+@@ -692,7 +692,7 @@ minstrel_aggr_check(struct ieee80211_sta -+ if (likely(sta->ampdu_mlme.tid_tx[tid])) -+ return; -+ -+- ieee80211_start_tx_ba_session(pubsta, tid, 5000); -++ ieee80211_start_tx_ba_session(pubsta, tid, 0); -+ } -+ -+ static void -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/337-0001-brcmfmac-avoid-runtime-pm-for-sdio-host-controller.patch -+++ /dev/null -@@ -1,44 +0,0 @@ --From: Arend van Spriel --Date: Wed, 18 Mar 2015 13:25:21 +0100 --Subject: [PATCH] brcmfmac: avoid runtime-pm for sdio host controller -- --Several host controllers supporting runtime-pm are causing issues --with our sdio wireless cards because they disable the sdio interrupt --upon going into runtime suspend. This patch avoids that by doing --a pm_runtime_forbid() call during the probe. Tested with Sony Vaio --Duo 13 which uses sdhci-acpi host controller. -- --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/bcmsdh.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c --@@ -29,6 +29,7 @@ -- #include -- #include -- #include --+#include -- #include -- #include -- #include --@@ -1006,6 +1007,7 @@ static int brcmf_sdiod_remove(struct brc -- sg_free_table(&sdiodev->sgtable); -- sdiodev->sbwad = 0; -- --+ pm_runtime_allow(sdiodev->func[1]->card->host->parent); -- return 0; -- } -- --@@ -1074,7 +1076,7 @@ static int brcmf_sdiod_probe(struct brcm -- ret = -ENODEV; -- goto out; -- } --- --+ pm_runtime_forbid(host->parent); -- out: -- if (ret) -- brcmf_sdiod_remove(sdiodev); -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/337-0002-brcmfmac-Add-necessary-memory-barriers-for-SDIO.patch -+++ /dev/null -@@ -1,171 +0,0 @@ --From: Hante Meuleman --Date: Wed, 18 Mar 2015 13:25:22 +0100 --Subject: [PATCH] brcmfmac: Add necessary memory barriers for SDIO. -- --SDIO uses a thread to handle all communication with the device, --for this data is exchanged between threads. This data needs proper --memory barriers to make sure that data "exchange" is going correct. -- --Reviewed-by: Arend Van Spriel --Reviewed-by: Franky (Zhenhui) Lin --Reviewed-by: Pieter-Paul Giesberts --Reviewed-by: Daniel (Deognyoun) Kim --Signed-off-by: Hante Meuleman --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 --@@ -507,8 +507,8 @@ struct brcmf_sdio { -- -- struct workqueue_struct *brcmf_wq; -- struct work_struct datawork; --- atomic_t dpc_tskcnt; --- atomic_t dpc_running; --+ bool dpc_triggered; --+ bool dpc_running; -- -- bool txoff; /* Transmit flow-controlled */ -- struct brcmf_sdio_count sdcnt; --@@ -2713,6 +2713,7 @@ static void brcmf_sdio_dpc(struct brcmf_ -- err = brcmf_sdio_tx_ctrlframe(bus, bus->ctrl_frame_buf, -- bus->ctrl_frame_len); -- bus->ctrl_frame_err = err; --+ wmb(); -- bus->ctrl_frame_stat = false; -- } -- sdio_release_host(bus->sdiodev->func[1]); --@@ -2734,6 +2735,7 @@ static void brcmf_sdio_dpc(struct brcmf_ -- sdio_claim_host(bus->sdiodev->func[1]); -- if (bus->ctrl_frame_stat) { -- bus->ctrl_frame_err = -ENODEV; --+ wmb(); -- bus->ctrl_frame_stat = false; -- brcmf_sdio_wait_event_wakeup(bus); -- } --@@ -2744,7 +2746,7 @@ static void brcmf_sdio_dpc(struct brcmf_ -- (!atomic_read(&bus->fcstate) && -- brcmu_pktq_mlen(&bus->txq, ~bus->flowcontrol) && -- data_ok(bus))) { --- atomic_inc(&bus->dpc_tskcnt); --+ bus->dpc_triggered = true; -- } -- } -- --@@ -2940,6 +2942,7 @@ brcmf_sdio_bus_txctl(struct device *dev, -- /* Send from dpc */ -- bus->ctrl_frame_buf = msg; -- bus->ctrl_frame_len = msglen; --+ wmb(); -- bus->ctrl_frame_stat = true; -- -- brcmf_sdio_trigger_dpc(bus); --@@ -2958,6 +2961,7 @@ brcmf_sdio_bus_txctl(struct device *dev, -- if (!ret) { -- brcmf_dbg(SDIO, "ctrl_frame complete, err=%d\n", -- bus->ctrl_frame_err); --+ rmb(); -- ret = bus->ctrl_frame_err; -- } -- --@@ -3526,8 +3530,8 @@ done: -- -- void brcmf_sdio_trigger_dpc(struct brcmf_sdio *bus) -- { --- if (atomic_read(&bus->dpc_tskcnt) == 0) { --- atomic_inc(&bus->dpc_tskcnt); --+ if (!bus->dpc_triggered) { --+ bus->dpc_triggered = true; -- queue_work(bus->brcmf_wq, &bus->datawork); -- } -- } --@@ -3558,7 +3562,7 @@ void brcmf_sdio_isr(struct brcmf_sdio *b -- if (!bus->intr) -- brcmf_err("isr w/o interrupt configured!\n"); -- --- atomic_inc(&bus->dpc_tskcnt); --+ bus->dpc_triggered = true; -- queue_work(bus->brcmf_wq, &bus->datawork); -- } -- --@@ -3578,7 +3582,7 @@ static void brcmf_sdio_bus_watchdog(stru -- if (!bus->intr || -- (bus->sdcnt.intrcount == bus->sdcnt.lastintrs)) { -- --- if (atomic_read(&bus->dpc_tskcnt) == 0) { --+ if (!bus->dpc_triggered) { -- u8 devpend; -- -- sdio_claim_host(bus->sdiodev->func[1]); --@@ -3596,7 +3600,7 @@ static void brcmf_sdio_bus_watchdog(stru -- bus->sdcnt.pollcnt++; -- atomic_set(&bus->ipend, 1); -- --- atomic_inc(&bus->dpc_tskcnt); --+ bus->dpc_triggered = true; -- queue_work(bus->brcmf_wq, &bus->datawork); -- } -- } --@@ -3623,17 +3627,21 @@ static void brcmf_sdio_bus_watchdog(stru -- #endif /* DEBUG */ -- -- /* On idle timeout clear activity flag and/or turn off clock */ --- if ((atomic_read(&bus->dpc_tskcnt) == 0) && --- (atomic_read(&bus->dpc_running) == 0) && --- (bus->idletime > 0) && (bus->clkstate == CLK_AVAIL)) { --- bus->idlecount++; --- if (bus->idlecount > bus->idletime) { --- brcmf_dbg(SDIO, "idle\n"); --- sdio_claim_host(bus->sdiodev->func[1]); --- brcmf_sdio_wd_timer(bus, 0); --+ if (!bus->dpc_triggered) { --+ rmb(); --+ if ((!bus->dpc_running) && (bus->idletime > 0) && --+ (bus->clkstate == CLK_AVAIL)) { --+ bus->idlecount++; --+ if (bus->idlecount > bus->idletime) { --+ brcmf_dbg(SDIO, "idle\n"); --+ sdio_claim_host(bus->sdiodev->func[1]); --+ brcmf_sdio_wd_timer(bus, 0); --+ bus->idlecount = 0; --+ brcmf_sdio_bus_sleep(bus, true, false); --+ sdio_release_host(bus->sdiodev->func[1]); --+ } --+ } else { -- bus->idlecount = 0; --- brcmf_sdio_bus_sleep(bus, true, false); --- sdio_release_host(bus->sdiodev->func[1]); -- } -- } else { -- bus->idlecount = 0; --@@ -3645,13 +3653,14 @@ static void brcmf_sdio_dataworker(struct -- struct brcmf_sdio *bus = container_of(work, struct brcmf_sdio, -- datawork); -- --- while (atomic_read(&bus->dpc_tskcnt)) { --- atomic_set(&bus->dpc_running, 1); --- atomic_set(&bus->dpc_tskcnt, 0); --+ bus->dpc_running = true; --+ wmb(); --+ while (ACCESS_ONCE(bus->dpc_triggered)) { --+ bus->dpc_triggered = false; -- brcmf_sdio_dpc(bus); -- bus->idlecount = 0; --- atomic_set(&bus->dpc_running, 0); -- } --+ bus->dpc_running = false; -- if (brcmf_sdiod_freezing(bus->sdiodev)) { -- brcmf_sdiod_change_state(bus->sdiodev, BRCMF_SDIOD_DOWN); -- brcmf_sdiod_try_freeze(bus->sdiodev); --@@ -4144,8 +4153,8 @@ struct brcmf_sdio *brcmf_sdio_probe(stru -- bus->watchdog_tsk = NULL; -- } -- /* Initialize DPC thread */ --- atomic_set(&bus->dpc_tskcnt, 0); --- atomic_set(&bus->dpc_running, 0); --+ bus->dpc_triggered = false; --+ bus->dpc_running = false; -- -- /* Assign bus interface call back */ -- bus->sdiodev->bus_if->dev = bus->sdiodev->dev; -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/337-0003-brcmfmac-Remove-unnecessary-new-line-in-pcie-console.patch -+++ /dev/null -@@ -1,26 +0,0 @@ --From: Hante Meuleman --Date: Wed, 18 Mar 2015 13:25:24 +0100 --Subject: [PATCH] brcmfmac: Remove unnecessary new-line in pcie console -- logging. -- --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/pcie.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --@@ -651,10 +651,9 @@ static void brcmf_pcie_bus_console_read( -- console->log_str[console->log_idx] = ch; -- console->log_idx++; -- } --- -- if (ch == '\n') { -- console->log_str[console->log_idx] = 0; --- brcmf_dbg(PCIE, "CONSOLE: %s\n", console->log_str); --+ brcmf_dbg(PCIE, "CONSOLE: %s", console->log_str); -- console->log_idx = 0; -- } -- } -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/337-0004-brcmfmac-add-MODULE_FIRMWARE-macros-for-bcm4356-PCIe.patch -+++ /dev/null -@@ -1,26 +0,0 @@ --From: Arend van Spriel --Date: Wed, 18 Mar 2015 13:25:25 +0100 --Subject: [PATCH] brcmfmac: add MODULE_FIRMWARE() macros for bcm4356 PCIe -- device -- --The BCM4356 PCIe wireless device was added recently but overlooked --the fact that the MODULE_FIRMWARE() macros were missing for the --firmwares needed by this device. -- --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/pcie.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --@@ -189,6 +189,8 @@ MODULE_FIRMWARE(BRCMF_PCIE_43602_FW_NAME -- MODULE_FIRMWARE(BRCMF_PCIE_43602_NVRAM_NAME); -- MODULE_FIRMWARE(BRCMF_PCIE_4354_FW_NAME); -- MODULE_FIRMWARE(BRCMF_PCIE_4354_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); -- -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/337-0005-brcmfmac-add-support-for-BCM43430-SDIO-chipset.patch -+++ /dev/null -@@ -1,138 +0,0 @@ --From: Arend van Spriel --Date: Wed, 18 Mar 2015 13:25:26 +0100 --Subject: [PATCH] brcmfmac: add support for BCM43430 SDIO chipset -- --This patch added support for the BCM43430 802.11n SDIO chipset. -- --Reviewed-by: Hante Meuleman --Reviewed-by: Daniel (Deognyoun) Kim --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/bcmsdh.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c --@@ -1098,6 +1098,7 @@ static const struct sdio_device_id brcmf -- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43341), -- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43362), -- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4335_4339), --+ BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43430), -- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4345), -- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4354), -- { /* end: all zeroes */ } ----- a/drivers/net/wireless/brcm80211/brcmfmac/chip.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c --@@ -600,6 +600,12 @@ static void brcmf_chip_socram_ramsize(st -- if (sr->chip->pub.chiprev < 2) -- *srsize = (32 * 1024); -- break; --+ case BRCM_CC_43430_CHIP_ID: --+ /* assume sr for now as we can not check --+ * firmware sr capability at this point. --+ */ --+ *srsize = (64 * 1024); --+ break; -- default: -- break; -- } --@@ -1072,6 +1078,7 @@ static void -- brcmf_chip_cm3_set_passive(struct brcmf_chip_priv *chip) -- { -- struct brcmf_core *core; --+ struct brcmf_core_priv *sr; -- -- brcmf_chip_disable_arm(chip, BCMA_CORE_ARM_CM3); -- core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_80211); --@@ -1081,6 +1088,13 @@ brcmf_chip_cm3_set_passive(struct brcmf_ -- D11_BCMA_IOCTL_PHYCLOCKEN); -- core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_INTERNAL_MEM); -- brcmf_chip_resetcore(core, 0, 0, 0); --+ --+ /* disable bank #3 remap for this device */ --+ if (chip->pub.chip == BRCM_CC_43430_CHIP_ID) { --+ sr = container_of(core, struct brcmf_core_priv, pub); --+ brcmf_chip_core_write32(sr, SOCRAMREGOFFS(bankidx), 3); --+ brcmf_chip_core_write32(sr, SOCRAMREGOFFS(bankpda), 0); --+ } -- } -- -- static bool brcmf_chip_cm3_set_active(struct brcmf_chip_priv *chip) --@@ -1188,6 +1202,10 @@ bool brcmf_chip_sr_capable(struct brcmf_ -- addr = CORE_CC_REG(base, chipcontrol_data); -- reg = chip->ops->read32(chip->ctx, addr); -- return (reg & pmu_cc3_mask) != 0; --+ case BRCM_CC_43430_CHIP_ID: --+ addr = CORE_CC_REG(base, sr_control1); --+ reg = chip->ops->read32(chip->ctx, addr); --+ return reg != 0; -- default: -- addr = CORE_CC_REG(base, pmucapabilities_ext); -- reg = chip->ops->read32(chip->ctx, addr); ----- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --@@ -615,6 +615,8 @@ static const struct sdiod_drive_str sdio -- #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 BCM4345_FIRMWARE_NAME "brcm/brcmfmac4345-sdio.bin" -- #define BCM4345_NVRAM_NAME "brcm/brcmfmac4345-sdio.txt" -- #define BCM4354_FIRMWARE_NAME "brcm/brcmfmac4354-sdio.bin" --@@ -640,6 +642,8 @@ 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(BCM4345_FIRMWARE_NAME); -- MODULE_FIRMWARE(BCM4345_NVRAM_NAME); -- MODULE_FIRMWARE(BCM4354_FIRMWARE_NAME); --@@ -671,6 +675,7 @@ static const struct brcmf_firmware_names -- { 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, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4345) }, -- { BRCM_CC_4354_CHIP_ID, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4354) } -- }; ----- a/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h --+++ b/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h --@@ -37,6 +37,7 @@ -- #define BRCM_CC_43362_CHIP_ID 43362 -- #define BRCM_CC_4335_CHIP_ID 0x4335 -- #define BRCM_CC_4339_CHIP_ID 0x4339 --+#define BRCM_CC_43430_CHIP_ID 43430 -- #define BRCM_CC_4345_CHIP_ID 0x4345 -- #define BRCM_CC_4354_CHIP_ID 0x4354 -- #define BRCM_CC_4356_CHIP_ID 0x4356 ----- a/drivers/net/wireless/brcm80211/include/chipcommon.h --+++ b/drivers/net/wireless/brcm80211/include/chipcommon.h --@@ -183,7 +183,14 @@ struct chipcregs { -- u8 uart1lsr; -- u8 uart1msr; -- u8 uart1scratch; --- u32 PAD[126]; --+ u32 PAD[62]; --+ --+ /* save/restore, corerev >= 48 */ --+ u32 sr_capability; /* 0x500 */ --+ u32 sr_control0; /* 0x504 */ --+ u32 sr_control1; /* 0x508 */ --+ u32 gpio_control; /* 0x50C */ --+ u32 PAD[60]; -- -- /* PMU registers (corerev >= 20) */ -- u32 pmucontrol; /* 0x600 */ ----- a/include/linux/mmc/sdio_ids.h --+++ b/include/linux/mmc/sdio_ids.h --@@ -33,6 +33,7 @@ -- #define SDIO_DEVICE_ID_BROADCOM_43341 0xa94d -- #define SDIO_DEVICE_ID_BROADCOM_4335_4339 0x4335 -- #define SDIO_DEVICE_ID_BROADCOM_43362 0xa962 --+#define SDIO_DEVICE_ID_BROADCOM_43430 0xa9a6 -- #define SDIO_DEVICE_ID_BROADCOM_4345 0x4345 -- #define SDIO_DEVICE_ID_BROADCOM_4354 0x4354 -- -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/337-0006-brcmfmac-only-support-the-BCM43455-7-device.patch -+++ /dev/null -@@ -1,50 +0,0 @@ --From: Arend van Spriel --Date: Wed, 18 Mar 2015 13:25:27 +0100 --Subject: [PATCH] brcmfmac: only support the BCM43455/7 device -- --Recently support was added for the BCM4345 SDIO chipset by --commit 9c51026509d7 ("brcmfmac: Add support for BCM4345 SDIO chipset") --however this was verified using a BCM43455 device, which is --a more recent revision of the chip. This patch assure that --older revisions are not probed as they would fail. -- --Reviewed-by: Hante Meuleman --Reviewed-by: Syed Asifful Dayyan --Reviewed-by: Pieter-Paul Giesberts --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 --@@ -617,8 +617,8 @@ static const struct sdiod_drive_str sdio -- #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 BCM4345_FIRMWARE_NAME "brcm/brcmfmac4345-sdio.bin" ---#define BCM4345_NVRAM_NAME "brcm/brcmfmac4345-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" -- --@@ -644,8 +644,8 @@ MODULE_FIRMWARE(BCM4339_FIRMWARE_NAME); -- MODULE_FIRMWARE(BCM4339_NVRAM_NAME); -- MODULE_FIRMWARE(BCM43430_FIRMWARE_NAME); -- MODULE_FIRMWARE(BCM43430_NVRAM_NAME); ---MODULE_FIRMWARE(BCM4345_FIRMWARE_NAME); ---MODULE_FIRMWARE(BCM4345_NVRAM_NAME); --+MODULE_FIRMWARE(BCM43455_FIRMWARE_NAME); --+MODULE_FIRMWARE(BCM43455_NVRAM_NAME); -- MODULE_FIRMWARE(BCM4354_FIRMWARE_NAME); -- MODULE_FIRMWARE(BCM4354_NVRAM_NAME); -- --@@ -676,7 +676,7 @@ static const struct brcmf_firmware_names -- { 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, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4345) }, --+ { BRCM_CC_4345_CHIP_ID, 0xFFFFFFC0, BRCMF_FIRMWARE_NVRAM(BCM43455) }, -- { BRCM_CC_4354_CHIP_ID, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4354) } -- }; -- -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/337-0007-brcmfmac-remove-support-for-unreleased-BCM4354-PCIe.patch -+++ /dev/null -@@ -1,52 +0,0 @@ --From: Arend van Spriel --Date: Wed, 18 Mar 2015 13:25:28 +0100 --Subject: [PATCH] brcmfmac: remove support for unreleased BCM4354 PCIe -- --There are no known BCM4354 PCIe devices released so removing --support from the driver until proven otherwise. -- --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/pcie.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --@@ -47,8 +47,6 @@ 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_4354_FW_NAME "brcm/brcmfmac4354-pcie.bin" ---#define BRCMF_PCIE_4354_NVRAM_NAME "brcm/brcmfmac4354-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" --@@ -187,8 +185,6 @@ enum brcmf_pcie_state { -- -- MODULE_FIRMWARE(BRCMF_PCIE_43602_FW_NAME); -- MODULE_FIRMWARE(BRCMF_PCIE_43602_NVRAM_NAME); ---MODULE_FIRMWARE(BRCMF_PCIE_4354_FW_NAME); ---MODULE_FIRMWARE(BRCMF_PCIE_4354_NVRAM_NAME); -- MODULE_FIRMWARE(BRCMF_PCIE_4356_FW_NAME); -- MODULE_FIRMWARE(BRCMF_PCIE_4356_NVRAM_NAME); -- MODULE_FIRMWARE(BRCMF_PCIE_43570_FW_NAME); --@@ -1327,10 +1323,6 @@ 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_4354_CHIP_ID: --- fw_name = BRCMF_PCIE_4354_FW_NAME; --- nvram_name = BRCMF_PCIE_4354_NVRAM_NAME; --- break; -- case BRCM_CC_4356_CHIP_ID: -- fw_name = BRCMF_PCIE_4356_FW_NAME; -- nvram_name = BRCMF_PCIE_4356_NVRAM_NAME; --@@ -1855,7 +1847,6 @@ 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_4354_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), -diff --git a/package/kernel/mac80211/patches/337-mac80211-minstrel_ht-fix-a-logic-error-in-RTS-CTS-ha.patch b/package/kernel/mac80211/patches/337-mac80211-minstrel_ht-fix-a-logic-error-in-RTS-CTS-ha.patch -new file mode 100644 -index 0000000..229351b ---- /dev/null -+++ b/package/kernel/mac80211/patches/337-mac80211-minstrel_ht-fix-a-logic-error-in-RTS-CTS-ha.patch -@@ -0,0 +1,26 @@ -+From: Felix Fietkau -+Date: Wed, 24 Feb 2016 12:03:13 +0100 -+Subject: [PATCH] mac80211: minstrel_ht: fix a logic error in RTS/CTS handling -+MIME-Version: 1.0 -+Content-Type: text/plain; charset=UTF-8 -+Content-Transfer-Encoding: 8bit -+ -+RTS/CTS needs to be enabled if the rate is a fallback rate *or* if it's -+a dual-stream rate and the sta is in dynamic SMPS mode. -+ -+Fixes: a3ebb4e1b763 ("mac80211: minstrel_ht: handle peers in dynamic SMPS") -+Reported-by: Matías Richart -+Signed-off-by: Felix Fietkau -+--- -+ -+--- a/net/mac80211/rc80211_minstrel_ht.c -++++ b/net/mac80211/rc80211_minstrel_ht.c -+@@ -872,7 +872,7 @@ minstrel_ht_set_rate(struct minstrel_pri -+ * - if station is in dynamic SMPS (and streams > 1) -+ * - for fallback rates, to increase chances of getting through -+ */ -+- if (offset > 0 && -++ if (offset > 0 || -+ (mi->sta->smps_mode == IEEE80211_SMPS_DYNAMIC && -+ group->streams > 1)) { -+ ratetbl->rate[offset].count = ratetbl->rate[offset].count_rts; -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/338-brcmfmac-disable-MBSS-feature-for-BCM43362.patch -+++ /dev/null -@@ -1,28 +0,0 @@ --From: Arend van Spriel --Date: Fri, 20 Mar 2015 22:18:17 +0100 --Subject: [PATCH] brcmfmac: disable MBSS feature for BCM43362 -- --The BCM43362 firmware falsely reports it is capable of providing --MBSS. As a result AP mode no longer works for this device. Therefor --disable MBSS in the driver for this chipset. -- --Cc: stable@vger.kernel.org # 3.19.y --Reported-by: Jorg Krause --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/feature.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/feature.c --@@ -126,7 +126,8 @@ void brcmf_feat_attach(struct brcmf_pub -- brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_MCHAN, "mchan"); -- if (drvr->bus_if->wowl_supported) -- brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_WOWL, "wowl"); --- brcmf_feat_iovar_int_set(ifp, BRCMF_FEAT_MBSS, "mbss", 0); --+ if (drvr->bus_if->chip != BRCM_CC_43362_CHIP_ID) --+ brcmf_feat_iovar_int_set(ifp, BRCMF_FEAT_MBSS, "mbss", 0); -- -- /* set chip related quirks */ -- switch (drvr->bus_if->chip) { -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/339-0001-brcmfmac-use-static-superset-of-channels-for-wiphy-b.patch -+++ /dev/null -@@ -1,300 +0,0 @@ --From: Arend van Spriel --Date: Tue, 14 Apr 2015 20:10:24 +0200 --Subject: [PATCH] brcmfmac: use static superset of channels for wiphy -- bands -- --The driver was constructing a list of channels per wiphy band --by querying the device. This list is not what the hardware is --able to do as it is already filtered by the country setting in --the device. As user-space may change the country this would --require updating the channel list which is not recommended [1]. --This patch introduces a superset of channels. The individual --channels are disabled appropriately by querying the device. -- --[1] http://mid.gmane.org/1426706320.3001.21.camel@sipsolutions.net -- --Reviewed-by: Hante Meuleman --Reviewed-by: Daniel (Deognyoun) Kim --Reviewed-by: Pieter-Paul Giesberts --Signed-off-by: Arend van Spriel ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c --@@ -129,13 +129,47 @@ static struct ieee80211_rate __wl_rates[ -- RATETAB_ENT(BRCM_RATE_54M, 0), -- }; -- ---#define wl_a_rates (__wl_rates + 4) ---#define wl_a_rates_size 8 -- #define wl_g_rates (__wl_rates + 0) ---#define wl_g_rates_size 12 --+#define wl_g_rates_size ARRAY_SIZE(__wl_rates) --+#define wl_a_rates (__wl_rates + 4) --+#define wl_a_rates_size (wl_g_rates_size - 4) --+ --+#define CHAN2G(_channel, _freq) { \ --+ .band = IEEE80211_BAND_2GHZ, \ --+ .center_freq = (_freq), \ --+ .hw_value = (_channel), \ --+ .flags = IEEE80211_CHAN_DISABLED, \ --+ .max_antenna_gain = 0, \ --+ .max_power = 30, \ --+} --+ --+#define CHAN5G(_channel) { \ --+ .band = IEEE80211_BAND_5GHZ, \ --+ .center_freq = 5000 + (5 * (_channel)), \ --+ .hw_value = (_channel), \ --+ .flags = IEEE80211_CHAN_DISABLED, \ --+ .max_antenna_gain = 0, \ --+ .max_power = 30, \ --+} --+ --+static struct ieee80211_channel __wl_2ghz_channels[] = { --+ CHAN2G(1, 2412), CHAN2G(2, 2417), CHAN2G(3, 2422), CHAN2G(4, 2427), --+ CHAN2G(5, 2432), CHAN2G(6, 2437), CHAN2G(7, 2442), CHAN2G(8, 2447), --+ CHAN2G(9, 2452), CHAN2G(10, 2457), CHAN2G(11, 2462), CHAN2G(12, 2467), --+ CHAN2G(13, 2472), CHAN2G(14, 2484) --+}; --+ --+static struct ieee80211_channel __wl_5ghz_channels[] = { --+ CHAN5G(34), CHAN5G(36), CHAN5G(38), CHAN5G(40), CHAN5G(42), --+ CHAN5G(44), CHAN5G(46), CHAN5G(48), CHAN5G(52), CHAN5G(56), --+ CHAN5G(60), CHAN5G(64), CHAN5G(100), CHAN5G(104), CHAN5G(108), --+ CHAN5G(112), CHAN5G(116), CHAN5G(120), CHAN5G(124), CHAN5G(128), --+ CHAN5G(132), CHAN5G(136), CHAN5G(140), CHAN5G(144), CHAN5G(149), --+ CHAN5G(153), CHAN5G(157), CHAN5G(161), CHAN5G(165) --+}; -- -- /* Band templates duplicated per wiphy. The channel info --- * is filled in after querying the device. --+ * above is added to the band during setup. -- */ -- static const struct ieee80211_supported_band __wl_band_2ghz = { -- .band = IEEE80211_BAND_2GHZ, --@@ -143,7 +177,7 @@ static const struct ieee80211_supported_ -- .n_bitrates = wl_g_rates_size, -- }; -- ---static const struct ieee80211_supported_band __wl_band_5ghz_a = { --+static const struct ieee80211_supported_band __wl_band_5ghz = { -- .band = IEEE80211_BAND_5GHZ, -- .bitrates = wl_a_rates, -- .n_bitrates = wl_a_rates_size, --@@ -5252,40 +5286,6 @@ dongle_scantime_out: -- return err; -- } -- ---/* Filter the list of channels received from firmware counting only --- * the 20MHz channels. The wiphy band data only needs those which get --- * flagged to indicate if they can take part in higher bandwidth. --- */ ---static void brcmf_count_20mhz_channels(struct brcmf_cfg80211_info *cfg, --- struct brcmf_chanspec_list *chlist, --- u32 chcnt[]) ---{ --- u32 total = le32_to_cpu(chlist->count); --- struct brcmu_chan ch; --- int i; --- --- for (i = 0; i < total; i++) { --- ch.chspec = (u16)le32_to_cpu(chlist->element[i]); --- cfg->d11inf.decchspec(&ch); --- --- /* Firmware gives a ordered list. We skip non-20MHz --- * channels is 2G. For 5G we can abort upon reaching --- * a non-20MHz channel in the list. --- */ --- if (ch.bw != BRCMU_CHAN_BW_20) { --- if (ch.band == BRCMU_CHAN_BAND_5G) --- break; --- else --- continue; --- } --- --- if (ch.band == BRCMU_CHAN_BAND_2G) --- chcnt[0] += 1; --- else if (ch.band == BRCMU_CHAN_BAND_5G) --- chcnt[1] += 1; --- } ---} --- -- static void brcmf_update_bw40_channel_flag(struct ieee80211_channel *channel, -- struct brcmu_chan *ch) -- { --@@ -5321,7 +5321,6 @@ static int brcmf_construct_chaninfo(stru -- u32 i, j; -- u32 total; -- u32 chaninfo; --- u32 chcnt[2] = { 0, 0 }; -- u32 index; -- -- pbuf = kzalloc(BRCMF_DCMD_MEDLEN, GFP_KERNEL); --@@ -5338,42 +5337,15 @@ static int brcmf_construct_chaninfo(stru -- goto fail_pbuf; -- } -- --- brcmf_count_20mhz_channels(cfg, list, chcnt); -- wiphy = cfg_to_wiphy(cfg); --- if (chcnt[0]) { --- band = kmemdup(&__wl_band_2ghz, sizeof(__wl_band_2ghz), --- GFP_KERNEL); --- if (band == NULL) { --- err = -ENOMEM; --- goto fail_pbuf; --- } --- band->channels = kcalloc(chcnt[0], sizeof(*channel), --- GFP_KERNEL); --- if (band->channels == NULL) { --- kfree(band); --- err = -ENOMEM; --- goto fail_pbuf; --- } --- band->n_channels = 0; --- wiphy->bands[IEEE80211_BAND_2GHZ] = band; --- } --- if (chcnt[1]) { --- band = kmemdup(&__wl_band_5ghz_a, sizeof(__wl_band_5ghz_a), --- GFP_KERNEL); --- if (band == NULL) { --- err = -ENOMEM; --- goto fail_band2g; --- } --- band->channels = kcalloc(chcnt[1], sizeof(*channel), --- GFP_KERNEL); --- if (band->channels == NULL) { --- kfree(band); --- err = -ENOMEM; --- goto fail_band2g; --- } --- band->n_channels = 0; --- wiphy->bands[IEEE80211_BAND_5GHZ] = band; --- } --+ band = wiphy->bands[IEEE80211_BAND_2GHZ]; --+ if (band) --+ for (i = 0; i < band->n_channels; i++) --+ band->channels[i].flags = IEEE80211_CHAN_DISABLED; --+ band = wiphy->bands[IEEE80211_BAND_5GHZ]; --+ if (band) --+ for (i = 0; i < band->n_channels; i++) --+ band->channels[i].flags = IEEE80211_CHAN_DISABLED; -- -- total = le32_to_cpu(list->count); -- for (i = 0; i < total; i++) { --@@ -5388,6 +5360,8 @@ static int brcmf_construct_chaninfo(stru -- brcmf_err("Invalid channel Spec. 0x%x.\n", ch.chspec); -- continue; -- } --+ if (!band) --+ continue; -- if (!(bw_cap[band->band] & WLC_BW_40MHZ_BIT) && -- ch.bw == BRCMU_CHAN_BW_40) -- continue; --@@ -5415,9 +5389,9 @@ static int brcmf_construct_chaninfo(stru -- } else if (ch.bw == BRCMU_CHAN_BW_40) { -- brcmf_update_bw40_channel_flag(&channel[index], &ch); -- } else { --- /* disable other bandwidths for now as mentioned --- * order assure they are enabled for subsequent --- * chanspecs. --+ /* enable the channel and disable other bandwidths --+ * for now as mentioned order assure they are enabled --+ * for subsequent chanspecs. -- */ -- channel[index].flags = IEEE80211_CHAN_NO_HT40 | -- IEEE80211_CHAN_NO_80MHZ; --@@ -5436,16 +5410,8 @@ static int brcmf_construct_chaninfo(stru -- IEEE80211_CHAN_NO_IR; -- } -- } --- if (index == band->n_channels) --- band->n_channels++; -- } --- kfree(pbuf); --- return 0; -- ---fail_band2g: --- kfree(wiphy->bands[IEEE80211_BAND_2GHZ]->channels); --- kfree(wiphy->bands[IEEE80211_BAND_2GHZ]); --- wiphy->bands[IEEE80211_BAND_2GHZ] = NULL; -- fail_pbuf: -- kfree(pbuf); -- return err; --@@ -5778,7 +5744,12 @@ static void brcmf_wiphy_wowl_params(stru -- -- static int brcmf_setup_wiphy(struct wiphy *wiphy, struct brcmf_if *ifp) -- { --+ struct ieee80211_supported_band *band; -- struct ieee80211_iface_combination ifc_combo; --+ __le32 bandlist[3]; --+ u32 n_bands; --+ int err, i; --+ -- wiphy->max_scan_ssids = WL_NUM_SCAN_MAX; -- wiphy->max_scan_ie_len = BRCMF_SCAN_IE_LEN_MAX; -- wiphy->max_num_pmkids = WL_NUM_PMKIDS_MAX; --@@ -5820,7 +5791,52 @@ static int brcmf_setup_wiphy(struct wiph -- if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_WOWL)) -- brcmf_wiphy_wowl_params(wiphy); -- --- return brcmf_setup_wiphybands(wiphy); --+ err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BANDLIST, &bandlist, --+ sizeof(bandlist)); --+ if (err) { --+ brcmf_err("could not obtain band info: err=%d\n", err); --+ return err; --+ } --+ /* first entry in bandlist is number of bands */ --+ n_bands = le32_to_cpu(bandlist[0]); --+ for (i = 1; i <= n_bands && i < ARRAY_SIZE(bandlist); i++) { --+ if (bandlist[i] == cpu_to_le32(WLC_BAND_2G)) { --+ band = kmemdup(&__wl_band_2ghz, sizeof(__wl_band_2ghz), --+ GFP_KERNEL); --+ if (!band) --+ return -ENOMEM; --+ --+ band->channels = kmemdup(&__wl_2ghz_channels, --+ sizeof(__wl_2ghz_channels), --+ GFP_KERNEL); --+ if (!band->channels) { --+ kfree(band); --+ return -ENOMEM; --+ } --+ --+ band->n_channels = ARRAY_SIZE(__wl_2ghz_channels); --+ wiphy->bands[IEEE80211_BAND_2GHZ] = band; --+ } --+ if (bandlist[i] == cpu_to_le32(WLC_BAND_5G)) { --+ band = kmemdup(&__wl_band_5ghz, sizeof(__wl_band_5ghz), --+ GFP_KERNEL); --+ if (!band) --+ return -ENOMEM; --+ --+ band->channels = kmemdup(&__wl_5ghz_channels, --+ sizeof(__wl_5ghz_channels), --+ GFP_KERNEL); --+ if (!band->channels) { --+ kfree(band); --+ return -ENOMEM; --+ } --+ --+ band->n_channels = ARRAY_SIZE(__wl_5ghz_channels); --+ wiphy->bands[IEEE80211_BAND_5GHZ] = band; --+ } --+ } --+ err = brcmf_setup_wiphybands(wiphy); --+ return err; -- } -- -- static s32 brcmf_config_dongle(struct brcmf_cfg80211_info *cfg) --@@ -6011,6 +6027,9 @@ static void brcmf_cfg80211_reg_notifier( -- -- static void brcmf_free_wiphy(struct wiphy *wiphy) -- { --+ if (!wiphy) --+ return; --+ -- kfree(wiphy->iface_combinations); -- if (wiphy->bands[IEEE80211_BAND_2GHZ]) { -- kfree(wiphy->bands[IEEE80211_BAND_2GHZ]->channels); -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/339-0002-brcmfmac-update-wiphy-band-information-upon-updating.patch -+++ /dev/null -@@ -1,29 +0,0 @@ --From: Arend van Spriel --Date: Tue, 14 Apr 2015 20:10:25 +0200 --Subject: [PATCH] brcmfmac: update wiphy band information upon updating -- regulatory domain -- --When change the country code the available channels may change. So --the wiphy bands should be updated accordingly. -- --Reviewed-by: Daniel (Deognyoun) Kim --Reviewed-by: Hante Meuleman --Reviewed-by: Pieter-Paul Giesberts --Signed-off-by: Arend van Spriel ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c --@@ -6022,7 +6022,11 @@ static void brcmf_cfg80211_reg_notifier( -- memset(&ccreq, 0, sizeof(ccreq)); -- ccreq.rev = cpu_to_le32(-1); -- memcpy(ccreq.ccode, req->alpha2, sizeof(req->alpha2)); --- brcmf_fil_iovar_data_set(ifp, "country", &ccreq, sizeof(ccreq)); --+ if (brcmf_fil_iovar_data_set(ifp, "country", &ccreq, sizeof(ccreq))) { --+ brcmf_err("firmware rejected country setting\n"); --+ return; --+ } --+ brcmf_setup_wiphybands(wiphy); -- } -- -- static void brcmf_free_wiphy(struct wiphy *wiphy) -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/339-0003-brcmfmac-add-description-for-feature-flags.patch -+++ /dev/null -@@ -1,24 +0,0 @@ --From: Arend van Spriel --Date: Tue, 14 Apr 2015 20:10:26 +0200 --Subject: [PATCH] brcmfmac: add description for feature flags -- --Some feature flags were not described in the header file. Adding --the description. -- --Reviewed-by: Hante Meuleman --Reviewed-by: Pieter-Paul Giesberts --Signed-off-by: Arend van Spriel ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/feature.h --+++ b/drivers/net/wireless/brcm80211/brcmfmac/feature.h --@@ -19,7 +19,9 @@ -- /* -- * Features: -- * --+ * MBSS: multiple BSSID support (eg. guest network in AP mode). -- * MCHAN: multi-channel for concurrent P2P. --+ * WOWL: Wake-On-WLAN. -- */ -- #define BRCMF_FEAT_LIST \ -- BRCMF_FEAT_DEF(MBSS) \ -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/339-0004-brcmfmac-make-scheduled-scan-support-conditional.patch -+++ /dev/null -@@ -1,51 +0,0 @@ --From: Arend van Spriel --Date: Tue, 14 Apr 2015 20:10:27 +0200 --Subject: [PATCH] brcmfmac: make scheduled scan support conditional -- --The scheduled scan support depends on firmware supporting the PNO --feature. This feature is optional so add a feature flag for this --in the driver and announce scheduled scan support accordingly. -- --Reviewed-by: Hante Meuleman --Reviewed-by: Pieter-Paul Giesberts --Signed-off-by: Arend van Spriel ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c --@@ -5782,7 +5782,8 @@ static int brcmf_setup_wiphy(struct wiph -- wiphy->flags |= WIPHY_FLAG_SUPPORTS_FW_ROAM; -- wiphy->mgmt_stypes = brcmf_txrx_stypes; -- wiphy->max_remain_on_channel_duration = 5000; --- brcmf_wiphy_pno_params(wiphy); --+ if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_PNO)) --+ brcmf_wiphy_pno_params(wiphy); -- -- /* vendor commands/events support */ -- wiphy->vendor_commands = brcmf_vendor_cmds; ----- a/drivers/net/wireless/brcm80211/brcmfmac/feature.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/feature.c --@@ -124,6 +124,7 @@ void brcmf_feat_attach(struct brcmf_pub -- struct brcmf_if *ifp = drvr->iflist[0]; -- -- brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_MCHAN, "mchan"); --+ brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_PNO, "pfn"); -- if (drvr->bus_if->wowl_supported) -- brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_WOWL, "wowl"); -- if (drvr->bus_if->chip != BRCM_CC_43362_CHIP_ID) ----- a/drivers/net/wireless/brcm80211/brcmfmac/feature.h --+++ b/drivers/net/wireless/brcm80211/brcmfmac/feature.h --@@ -21,11 +21,13 @@ -- * -- * MBSS: multiple BSSID support (eg. guest network in AP mode). -- * MCHAN: multi-channel for concurrent P2P. --+ * PNO: preferred network offload. -- * WOWL: Wake-On-WLAN. -- */ -- #define BRCMF_FEAT_LIST \ -- BRCMF_FEAT_DEF(MBSS) \ -- BRCMF_FEAT_DEF(MCHAN) \ --+ BRCMF_FEAT_DEF(PNO) \ -- BRCMF_FEAT_DEF(WOWL) -- /* -- * Quirks: -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/339-0005-brcmfmac-add-support-for-BCM4324-rev-B5-chipset.patch -+++ /dev/null -@@ -1,43 +0,0 @@ --From: Arend van Spriel --Date: Tue, 14 Apr 2015 20:10:28 +0200 --Subject: [PATCH] brcmfmac: add support for BCM4324 rev B5 chipset -- --This patch adds support for the BCM4324 B5 revision. This device --is similar to BCM43241 from driver and firmware perspective. It --is known to be used in Lenovo Thinkpad Tablet devices. -- --Reviewed-by: Hante Meuleman --Reviewed-by: Pieter-Paul Giesberts --Signed-off-by: Arend van Spriel ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --@@ -601,6 +601,8 @@ static const struct sdiod_drive_str sdio -- #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" --@@ -628,6 +630,8 @@ 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); --@@ -667,7 +671,8 @@ enum brcmf_firmware_type { -- 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, 0xFFFFFFE0, BRCMF_FIRMWARE_NVRAM(BCM43241B4) }, --+ { 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) }, -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/339-0006-brcmfmac-process-interrupt-regardless-sdiod-state.patch -+++ /dev/null -@@ -1,27 +0,0 @@ --From: Arend van Spriel --Date: Tue, 14 Apr 2015 20:10:29 +0200 --Subject: [PATCH] brcmfmac: process interrupt regardless sdiod state -- --When the sdio bus state is not ready to process we abort the --interrupt service routine. This is not wanted as it keeps the --interrupt source active. Better clear the interrupt source. -- --Reviewed-by: Hante Meuleman --Reviewed-by: Pieter-Paul Giesberts --Reviewed-by: Franky (Zhenhui) Lin --Signed-off-by: Arend van Spriel ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --@@ -3555,10 +3555,6 @@ void brcmf_sdio_isr(struct brcmf_sdio *b -- return; -- } -- --- if (bus->sdiodev->state != BRCMF_SDIOD_DATA) { --- brcmf_err("bus is down. we have nothing to do\n"); --- return; --- } -- /* Count the interrupt call */ -- bus->sdcnt.intrcount++; -- if (in_interrupt()) -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/339-0007-brcmfmac-fix-sdio-suspend-and-resume.patch -+++ /dev/null -@@ -1,68 +0,0 @@ --From: Arend van Spriel --Date: Tue, 14 Apr 2015 20:10:30 +0200 --Subject: [PATCH] brcmfmac: fix sdio suspend and resume -- --commit 330b4e4be937 ("brcmfmac: Add wowl support for SDIO devices.") --changed the behaviour by removing the MMC_PM_KEEP_POWER flag for --non-wowl scenario, which needs to be restored. Another necessary --change is to mark the card as being non-removable. With this in place --the suspend resume test passes successfully doing: -- -- # echo devices > /sys/power/pm_test -- # echo mem > /sys/power/state -- --Note that power may still be switched off when system is going --in S3 state. -- --Reported-by: Fu, Zhonghui < --Reviewed-by: Pieter-Paul Giesberts --Reviewed-by: Franky (Zhenhui) Lin --Signed-off-by: Arend van Spriel ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c --@@ -1011,6 +1011,14 @@ static int brcmf_sdiod_remove(struct brc -- return 0; -- } -- --+static void brcmf_sdiod_host_fixup(struct mmc_host *host) --+{ --+ /* runtime-pm powers off the device */ --+ pm_runtime_forbid(host->parent); --+ /* avoid removal detection upon resume */ --+ host->caps |= MMC_CAP_NONREMOVABLE; --+} --+ -- static int brcmf_sdiod_probe(struct brcmf_sdio_dev *sdiodev) -- { -- struct sdio_func *func; --@@ -1076,7 +1084,7 @@ static int brcmf_sdiod_probe(struct brcm -- ret = -ENODEV; -- goto out; -- } --- pm_runtime_forbid(host->parent); --+ brcmf_sdiod_host_fixup(host); -- out: -- if (ret) -- brcmf_sdiod_remove(sdiodev); --@@ -1246,15 +1254,15 @@ static int brcmf_ops_sdio_suspend(struct -- brcmf_sdiod_freezer_on(sdiodev); -- brcmf_sdio_wd_timer(sdiodev->bus, 0); -- --+ sdio_flags = MMC_PM_KEEP_POWER; -- if (sdiodev->wowl_enabled) { --- sdio_flags = MMC_PM_KEEP_POWER; -- if (sdiodev->pdata->oob_irq_supported) -- enable_irq_wake(sdiodev->pdata->oob_irq_nr); -- else --- sdio_flags = MMC_PM_WAKE_SDIO_IRQ; --- if (sdio_set_host_pm_flags(sdiodev->func[1], sdio_flags)) --- brcmf_err("Failed to set pm_flags %x\n", sdio_flags); --+ sdio_flags |= MMC_PM_WAKE_SDIO_IRQ; -- } --+ if (sdio_set_host_pm_flags(sdiodev->func[1], sdio_flags)) --+ brcmf_err("Failed to set pm_flags %x\n", sdio_flags); -- return 0; -- } -- -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/339-0008-brcmfmac-add-support-for-BCM4358-PCIe-device.patch -+++ /dev/null -@@ -1,77 +0,0 @@ --From: Arend van Spriel --Date: Tue, 14 Apr 2015 20:10:31 +0200 --Subject: [PATCH] brcmfmac: add support for BCM4358 PCIe device -- --This patch adds support for the BCM4358 2x2 11ac device. -- --Reviewed-by: Pieter-Paul Giesberts --Signed-off-by: Arend van Spriel ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/chip.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c --@@ -649,6 +649,7 @@ static u32 brcmf_chip_tcm_rambase(struct -- case BRCM_CC_43567_CHIP_ID: -- case BRCM_CC_43569_CHIP_ID: -- case BRCM_CC_43570_CHIP_ID: --+ case BRCM_CC_4358_CHIP_ID: -- case BRCM_CC_43602_CHIP_ID: -- return 0x180000; -- default: ----- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --@@ -51,6 +51,8 @@ enum brcmf_pcie_state { -- #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_FW_UP_TIMEOUT 2000 /* msec */ -- --@@ -189,6 +191,8 @@ 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); -- -- -- struct brcmf_pcie_console { --@@ -1333,6 +1337,10 @@ static int brcmf_pcie_get_fwnames(struct -- 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; -- default: -- brcmf_err("Unsupported chip 0x%04x\n", devinfo->ci->chip); -- return -ENODEV; --@@ -1850,6 +1858,7 @@ static struct pci_device_id brcmf_pcie_d -- BRCMF_PCIE_DEVICE(BRCM_PCIE_4356_DEVICE_ID), -- 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_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 --@@ -45,6 +45,7 @@ -- #define BRCM_CC_43567_CHIP_ID 43567 -- #define BRCM_CC_43569_CHIP_ID 43569 -- #define BRCM_CC_43570_CHIP_ID 43570 --+#define BRCM_CC_4358_CHIP_ID 0x4358 -- #define BRCM_CC_43602_CHIP_ID 43602 -- -- /* USB Device IDs */ --@@ -59,6 +60,7 @@ -- #define BRCM_PCIE_4356_DEVICE_ID 0x43ec -- #define BRCM_PCIE_43567_DEVICE_ID 0x43d3 -- #define BRCM_PCIE_43570_DEVICE_ID 0x43d9 --+#define BRCM_PCIE_4358_DEVICE_ID 0x43e9 -- #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/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/339-0009-brcmfmac-add-additional-43602-pcie-device-id.patch -+++ /dev/null -@@ -1,30 +0,0 @@ --From: Hante Meuleman --Date: Tue, 14 Apr 2015 20:10:32 +0200 --Subject: [PATCH] brcmfmac: add additional 43602 pcie device id. -- --Reviewed-by: Arend Van Spriel --Reviewed-by: Pieter-Paul Giesberts --Signed-off-by: Hante Meuleman --Signed-off-by: Arend van Spriel ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --@@ -1862,6 +1862,7 @@ static struct pci_device_id brcmf_pcie_d -- 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), --+ BRCMF_PCIE_DEVICE(BRCM_PCIE_43602_RAW_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 --@@ -64,6 +64,7 @@ -- #define BRCM_PCIE_43602_DEVICE_ID 0x43ba -- #define BRCM_PCIE_43602_2G_DEVICE_ID 0x43bb -- #define BRCM_PCIE_43602_5G_DEVICE_ID 0x43bc --+#define BRCM_PCIE_43602_RAW_DEVICE_ID 43602 -- -- /* brcmsmac IDs */ -- #define BCM4313_D11N2G_ID 0x4727 /* 4313 802.11n 2.4G device */ -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/339-0010-brcmfmac-Add-support-for-multiple-PCIE-devices-in-nv.patch -+++ /dev/null -@@ -1,351 +0,0 @@ --From: Hante Meuleman --Date: Tue, 14 Apr 2015 20:10:33 +0200 --Subject: [PATCH] brcmfmac: Add support for multiple PCIE devices in -- nvram. -- --With PCIE it is possible to support multiple devices with the --same device type. They all load the same nvram file. In order to --support this the nvram can specify which part of the nvram is --for which pcie device. This patch adds support for these new --types of nvram files. -- --Reviewed-by: Arend Van Spriel --Reviewed-by: Franky (Zhenhui) Lin --Reviewed-by: Pieter-Paul Giesberts --Reviewed-by: Daniel (Deognyoun) Kim --Signed-off-by: Hante Meuleman --Signed-off-by: Arend van Spriel ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/firmware.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/firmware.c --@@ -23,6 +23,10 @@ -- #include "debug.h" -- #include "firmware.h" -- --+#define BRCMF_FW_MAX_NVRAM_SIZE 64000 --+#define BRCMF_FW_NVRAM_DEVPATH_LEN 19 /* devpath0=pcie/1/4/ */ --+#define BRCMF_FW_NVRAM_PCIEDEV_LEN 9 /* pcie/1/4/ */ --+ -- char brcmf_firmware_path[BRCMF_FW_PATH_LEN]; -- module_param_string(firmware_path, brcmf_firmware_path, -- BRCMF_FW_PATH_LEN, 0440); --@@ -46,6 +50,8 @@ enum nvram_parser_state { -- * @column: current column in line. -- * @pos: byte offset in input buffer. -- * @entry: start position of key,value entry. --+ * @multi_dev_v1: detect pcie multi device v1 (compressed). --+ * @multi_dev_v2: detect pcie multi device v2. -- */ -- struct nvram_parser { -- enum nvram_parser_state state; --@@ -56,6 +62,8 @@ struct nvram_parser { -- u32 column; -- u32 pos; -- u32 entry; --+ bool multi_dev_v1; --+ bool multi_dev_v2; -- }; -- -- static bool is_nvram_char(char c) --@@ -108,6 +116,10 @@ static enum nvram_parser_state brcmf_nvr -- st = COMMENT; -- else -- st = VALUE; --+ if (strncmp(&nvp->fwnv->data[nvp->entry], "devpath", 7) == 0) --+ nvp->multi_dev_v1 = true; --+ if (strncmp(&nvp->fwnv->data[nvp->entry], "pcie/", 5) == 0) --+ nvp->multi_dev_v2 = true; -- } else if (!is_nvram_char(c)) { -- brcmf_dbg(INFO, "warning: ln=%d:col=%d: '=' expected, skip invalid key entry\n", -- nvp->line, nvp->column); --@@ -133,6 +145,8 @@ brcmf_nvram_handle_value(struct nvram_pa -- ekv = (u8 *)&nvp->fwnv->data[nvp->pos]; -- skv = (u8 *)&nvp->fwnv->data[nvp->entry]; -- cplen = ekv - skv; --+ if (nvp->nvram_len + cplen + 1 >= BRCMF_FW_MAX_NVRAM_SIZE) --+ return END; -- /* copy to output buffer */ -- memcpy(&nvp->nvram[nvp->nvram_len], skv, cplen); -- nvp->nvram_len += cplen; --@@ -180,10 +194,18 @@ static enum nvram_parser_state -- static int brcmf_init_nvram_parser(struct nvram_parser *nvp, -- const struct firmware *nv) -- { --+ size_t size; --+ -- memset(nvp, 0, sizeof(*nvp)); -- nvp->fwnv = nv; --+ /* Limit size to MAX_NVRAM_SIZE, some files contain lot of comment */ --+ if (nv->size > BRCMF_FW_MAX_NVRAM_SIZE) --+ size = BRCMF_FW_MAX_NVRAM_SIZE; --+ else --+ size = nv->size; -- /* Alloc for extra 0 byte + roundup by 4 + length field */ --- nvp->nvram = kzalloc(nv->size + 1 + 3 + sizeof(u32), GFP_KERNEL); --+ size += 1 + 3 + sizeof(u32); --+ nvp->nvram = kzalloc(size, GFP_KERNEL); -- if (!nvp->nvram) -- return -ENOMEM; -- --@@ -192,12 +214,136 @@ static int brcmf_init_nvram_parser(struc -- return 0; -- } -- --+/* brcmf_fw_strip_multi_v1 :Some nvram files contain settings for multiple --+ * devices. Strip it down for one device, use domain_nr/bus_nr to determine --+ * which data is to be returned. v1 is the version where nvram is stored --+ * compressed and "devpath" maps to index for valid entries. --+ */ --+static void brcmf_fw_strip_multi_v1(struct nvram_parser *nvp, u16 domain_nr, --+ u16 bus_nr) --+{ --+ u32 i, j; --+ bool found; --+ u8 *nvram; --+ u8 id; --+ --+ nvram = kzalloc(nvp->nvram_len + 1 + 3 + sizeof(u32), GFP_KERNEL); --+ if (!nvram) --+ goto fail; --+ --+ /* min length: devpath0=pcie/1/4/ + 0:x=y */ --+ if (nvp->nvram_len < BRCMF_FW_NVRAM_DEVPATH_LEN + 6) --+ goto fail; --+ --+ /* First search for the devpathX and see if it is the configuration --+ * for domain_nr/bus_nr. Search complete nvp --+ */ --+ found = false; --+ i = 0; --+ while (i < nvp->nvram_len - BRCMF_FW_NVRAM_DEVPATH_LEN) { --+ /* Format: devpathX=pcie/Y/Z/ --+ * Y = domain_nr, Z = bus_nr, X = virtual ID --+ */ --+ if ((strncmp(&nvp->nvram[i], "devpath", 7) == 0) && --+ (strncmp(&nvp->nvram[i + 8], "=pcie/", 6) == 0)) { --+ if (((nvp->nvram[i + 14] - '0') == domain_nr) && --+ ((nvp->nvram[i + 16] - '0') == bus_nr)) { --+ id = nvp->nvram[i + 7] - '0'; --+ found = true; --+ break; --+ } --+ } --+ while (nvp->nvram[i] != 0) --+ i++; --+ i++; --+ } --+ if (!found) --+ goto fail; --+ --+ /* Now copy all valid entries, release old nvram and assign new one */ --+ i = 0; --+ j = 0; --+ while (i < nvp->nvram_len) { --+ if ((nvp->nvram[i] - '0' == id) && (nvp->nvram[i + 1] == ':')) { --+ i += 2; --+ while (nvp->nvram[i] != 0) { --+ nvram[j] = nvp->nvram[i]; --+ i++; --+ j++; --+ } --+ nvram[j] = 0; --+ j++; --+ } --+ while (nvp->nvram[i] != 0) --+ i++; --+ i++; --+ } --+ kfree(nvp->nvram); --+ nvp->nvram = nvram; --+ nvp->nvram_len = j; --+ return; --+ --+fail: --+ kfree(nvram); --+ nvp->nvram_len = 0; --+} --+ --+/* brcmf_fw_strip_multi_v2 :Some nvram files contain settings for multiple --+ * devices. Strip it down for one device, use domain_nr/bus_nr to determine --+ * which data is to be returned. v2 is the version where nvram is stored --+ * uncompressed, all relevant valid entries are identified by --+ * pcie/domain_nr/bus_nr: --+ */ --+static void brcmf_fw_strip_multi_v2(struct nvram_parser *nvp, u16 domain_nr, --+ u16 bus_nr) --+{ --+ u32 i, j; --+ u8 *nvram; --+ --+ nvram = kzalloc(nvp->nvram_len + 1 + 3 + sizeof(u32), GFP_KERNEL); --+ if (!nvram) --+ goto fail; --+ --+ /* Copy all valid entries, release old nvram and assign new one. --+ * Valid entries are of type pcie/X/Y/ where X = domain_nr and --+ * Y = bus_nr. --+ */ --+ i = 0; --+ j = 0; --+ while (i < nvp->nvram_len - BRCMF_FW_NVRAM_PCIEDEV_LEN) { --+ if ((strncmp(&nvp->nvram[i], "pcie/", 5) == 0) && --+ (nvp->nvram[i + 6] == '/') && (nvp->nvram[i + 8] == '/') && --+ ((nvp->nvram[i + 5] - '0') == domain_nr) && --+ ((nvp->nvram[i + 7] - '0') == bus_nr)) { --+ i += BRCMF_FW_NVRAM_PCIEDEV_LEN; --+ while (nvp->nvram[i] != 0) { --+ nvram[j] = nvp->nvram[i]; --+ i++; --+ j++; --+ } --+ nvram[j] = 0; --+ j++; --+ } --+ while (nvp->nvram[i] != 0) --+ i++; --+ i++; --+ } --+ kfree(nvp->nvram); --+ nvp->nvram = nvram; --+ nvp->nvram_len = j; --+ return; --+fail: --+ kfree(nvram); --+ nvp->nvram_len = 0; --+} --+ -- /* brcmf_nvram_strip :Takes a buffer of "=\n" lines read from a fil -- * and ending in a NUL. Removes carriage returns, empty lines, comment lines, -- * and converts newlines to NULs. Shortens buffer as needed and pads with NULs. -- * End of buffer is completed with token identifying length of buffer. -- */ ---static void *brcmf_fw_nvram_strip(const struct firmware *nv, u32 *new_length) --+static void *brcmf_fw_nvram_strip(const struct firmware *nv, u32 *new_length, --+ u16 domain_nr, u16 bus_nr) -- { -- struct nvram_parser nvp; -- u32 pad; --@@ -212,6 +358,16 @@ static void *brcmf_fw_nvram_strip(const -- if (nvp.state == END) -- break; -- } --+ if (nvp.multi_dev_v1) --+ brcmf_fw_strip_multi_v1(&nvp, domain_nr, bus_nr); --+ else if (nvp.multi_dev_v2) --+ brcmf_fw_strip_multi_v2(&nvp, domain_nr, bus_nr); --+ --+ if (nvp.nvram_len == 0) { --+ kfree(nvp.nvram); --+ return NULL; --+ } --+ -- pad = nvp.nvram_len; -- *new_length = roundup(nvp.nvram_len + 1, 4); -- while (pad != *new_length) { --@@ -239,6 +395,8 @@ struct brcmf_fw { -- u16 flags; -- const struct firmware *code; -- const char *nvram_name; --+ u16 domain_nr; --+ u16 bus_nr; -- void (*done)(struct device *dev, const struct firmware *fw, -- void *nvram_image, u32 nvram_len); -- }; --@@ -254,7 +412,8 @@ static void brcmf_fw_request_nvram_done( -- goto fail; -- -- if (fw) { --- nvram = brcmf_fw_nvram_strip(fw, &nvram_length); --+ nvram = brcmf_fw_nvram_strip(fw, &nvram_length, --+ fwctx->domain_nr, fwctx->bus_nr); -- release_firmware(fw); -- if (!nvram && !(fwctx->flags & BRCMF_FW_REQ_NV_OPTIONAL)) -- goto fail; --@@ -309,11 +468,12 @@ fail: -- kfree(fwctx); -- } -- ---int brcmf_fw_get_firmwares(struct device *dev, u16 flags, --- const char *code, const char *nvram, --- void (*fw_cb)(struct device *dev, --- const struct firmware *fw, --- void *nvram_image, u32 nvram_len)) --+int brcmf_fw_get_firmwares_pcie(struct device *dev, u16 flags, --+ const char *code, const char *nvram, --+ void (*fw_cb)(struct device *dev, --+ const struct firmware *fw, --+ void *nvram_image, u32 nvram_len), --+ u16 domain_nr, u16 bus_nr) -- { -- struct brcmf_fw *fwctx; -- --@@ -333,8 +493,21 @@ int brcmf_fw_get_firmwares(struct device -- fwctx->done = fw_cb; -- if (flags & BRCMF_FW_REQUEST_NVRAM) -- fwctx->nvram_name = nvram; --+ fwctx->domain_nr = domain_nr; --+ fwctx->bus_nr = bus_nr; -- -- return request_firmware_nowait(THIS_MODULE, true, code, dev, -- GFP_KERNEL, fwctx, -- brcmf_fw_request_code_done); -- } --+ --+int brcmf_fw_get_firmwares(struct device *dev, u16 flags, --+ const char *code, const char *nvram, --+ void (*fw_cb)(struct device *dev, --+ const struct firmware *fw, --+ void *nvram_image, u32 nvram_len)) --+{ --+ return brcmf_fw_get_firmwares_pcie(dev, flags, code, nvram, fw_cb, 0, --+ 0); --+} --+ ----- a/drivers/net/wireless/brcm80211/brcmfmac/firmware.h --+++ b/drivers/net/wireless/brcm80211/brcmfmac/firmware.h --@@ -32,6 +32,12 @@ void brcmf_fw_nvram_free(void *nvram); -- * fails it will not use the callback, but call device_release_driver() -- * instead which will call the driver .remove() callback. -- */ --+int brcmf_fw_get_firmwares_pcie(struct device *dev, u16 flags, --+ const char *code, const char *nvram, --+ void (*fw_cb)(struct device *dev, --+ const struct firmware *fw, --+ void *nvram_image, u32 nvram_len), --+ u16 domain_nr, u16 bus_nr); -- int brcmf_fw_get_firmwares(struct device *dev, u16 flags, -- const char *code, const char *nvram, -- void (*fw_cb)(struct device *dev, ----- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --@@ -1649,8 +1649,13 @@ brcmf_pcie_probe(struct pci_dev *pdev, c -- struct brcmf_pciedev_info *devinfo; -- struct brcmf_pciedev *pcie_bus_dev; -- struct brcmf_bus *bus; --+ u16 domain_nr; --+ u16 bus_nr; -- --- brcmf_dbg(PCIE, "Enter %x:%x\n", pdev->vendor, pdev->device); --+ domain_nr = pci_domain_nr(pdev->bus) + 1; --+ bus_nr = pdev->bus->number; --+ brcmf_dbg(PCIE, "Enter %x:%x (%d/%d)\n", pdev->vendor, pdev->device, --+ domain_nr, bus_nr); -- -- ret = -ENOMEM; -- devinfo = kzalloc(sizeof(*devinfo), GFP_KERNEL); --@@ -1699,10 +1704,10 @@ brcmf_pcie_probe(struct pci_dev *pdev, c -- if (ret) -- goto fail_bus; -- --- ret = brcmf_fw_get_firmwares(bus->dev, BRCMF_FW_REQUEST_NVRAM | --- BRCMF_FW_REQ_NV_OPTIONAL, --- devinfo->fw_name, devinfo->nvram_name, --- brcmf_pcie_setup); --+ ret = brcmf_fw_get_firmwares_pcie(bus->dev, BRCMF_FW_REQUEST_NVRAM | --+ BRCMF_FW_REQ_NV_OPTIONAL, --+ devinfo->fw_name, devinfo->nvram_name, --+ brcmf_pcie_setup, domain_nr, bus_nr); -- if (ret == 0) -- return 0; -- fail_bus: -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/340-brcmfmac-cleanup-a-sizeof.patch -+++ /dev/null -@@ -1,23 +0,0 @@ --From: Dan Carpenter --Date: Thu, 7 May 2015 12:59:19 +0300 --Subject: [PATCH] brcmfmac: cleanup a sizeof() -- --"flowrings" and "*flowrings" are both pointers so this always returns --sizeof(void *) and the current code works fine. But "*flowrings" is --intended here and static checkers complain, so lets change it. -- --Signed-off-by: Dan Carpenter --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --@@ -1617,7 +1617,7 @@ static void brcmf_pcie_setup(struct devi -- bus->msgbuf->commonrings[i] = -- &devinfo->shared.commonrings[i]->commonring; -- --- flowrings = kcalloc(devinfo->shared.nrof_flowrings, sizeof(flowrings), --+ flowrings = kcalloc(devinfo->shared.nrof_flowrings, sizeof(*flowrings), -- GFP_KERNEL); -- if (!flowrings) -- goto fail; -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/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?= --Date: Thu, 7 May 2015 14:13:03 +0200 --Subject: [PATCH] brcmfmac: check result of USB firmware request --MIME-Version: 1.0 --Content-Type: text/plain; charset=UTF-8 --Content-Transfer-Encoding: 8bit -- --This prevents silence failures with driver waiting (infinitely) for a --callback. -- --Signed-off-by: Rafał Miłecki --Acked-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 --@@ -1270,8 +1270,13 @@ static int brcmf_usb_probe_cb(struct brc -- bus->chiprev = bus_pub->chiprev; -- -- /* request firmware here */ --- brcmf_fw_get_firmwares(dev, 0, brcmf_usb_get_fwname(devinfo), NULL, --- brcmf_usb_probe_phase2); --+ ret = brcmf_fw_get_firmwares(dev, 0, brcmf_usb_get_fwname(devinfo), --+ NULL, brcmf_usb_probe_phase2); --+ if (ret) { --+ brcmf_err("firmware request failed: %d\n", ret); --+ goto fail; --+ } --+ -- return 0; -- -- fail: -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/342-brcmfmac-prohibit-ACPI-power-management-for-brcmfmac.patch -+++ /dev/null -@@ -1,47 +0,0 @@ --From: "Fu, Zhonghui" --Date: Mon, 11 May 2015 10:41:32 +0800 --Subject: [PATCH] brcmfmac: prohibit ACPI power management for brcmfmac driver -- --ACPI will manage WiFi chip's power state during suspend/resume --process on some tablet platforms(such as ASUS T100TA). This is --not supported by brcmfmac driver now, and the context of WiFi --chip will be damaged after resume. This patch informs ACPI not --to manage WiFi chip's power state. -- --Signed-off-by: Zhonghui Fu --Acked-by: Arend van Spriel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c --@@ -33,6 +33,7 @@ -- #include -- #include -- #include --+#include -- #include -- -- #include --@@ -1122,6 +1123,8 @@ static int brcmf_ops_sdio_probe(struct s -- int err; -- struct brcmf_sdio_dev *sdiodev; -- struct brcmf_bus *bus_if; --+ struct device *dev; --+ struct acpi_device *adev; -- -- brcmf_dbg(SDIO, "Enter\n"); -- brcmf_dbg(SDIO, "Class=%x\n", func->class); --@@ -1129,6 +1132,12 @@ static int brcmf_ops_sdio_probe(struct s -- brcmf_dbg(SDIO, "sdio device ID: 0x%04x\n", func->device); -- brcmf_dbg(SDIO, "Function#: %d\n", func->num); -- --+ /* prohibit ACPI power management for this device */ --+ dev = &func->dev; --+ adev = ACPI_COMPANION(dev); --+ if (adev) --+ adev->flags.power_manageable = 0; --+ -- /* Consume func num 1 but dont do anything with it. */ -- if (func->num == 1) -- return 0; -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/343-brcmfmac-avoid-gcc-5.1-warning.patch -+++ /dev/null -@@ -1,30 +0,0 @@ --From: Arnd Bergmann --Date: Tue, 12 May 2015 23:54:25 +0200 --Subject: [PATCH] brcmfmac: avoid gcc-5.1 warning -- --gcc-5.0 gained a new warning in the fwsignal portion of the brcmfmac --driver: -- --drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c: In function 'brcmf_fws_txs_process': --drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c:1478:8: warning: 'skb' may be used uninitialized in this function [-Wmaybe-uninitialized] -- --This is a false positive, and marking the brcmf_fws_hanger_poppkt function --as 'static inline' makes the warning go away. I have checked the object --file output and while a little code gets moved around, the size of --the binary remains identical. -- --Signed-off-by: Arnd Bergmann --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c --@@ -635,7 +635,7 @@ static int brcmf_fws_hanger_pushpkt(stru -- return 0; -- } -- ---static int brcmf_fws_hanger_poppkt(struct brcmf_fws_hanger *h, --+static inline int brcmf_fws_hanger_poppkt(struct brcmf_fws_hanger *h, -- u32 slot_id, struct sk_buff **pktout, -- bool remove_item) -- { -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/344-0001-brcmfmac-allow-device-tree-node-without-interrupts-p.patch -+++ /dev/null -@@ -1,45 +0,0 @@ --From: Arend van Spriel --Date: Wed, 20 May 2015 14:09:47 +0200 --Subject: [PATCH] brcmfmac: allow device tree node without 'interrupts' -- property -- --As described in the device tree bindings for 'brcm,bcm4329-fmac' --nodes, the interrupts property is optional. So adding a check --for the presence of this property before attempting to parse --and map the interrupt. If not present or parsing fails return --and fallback to in-band sdio interrupt. -- --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/of.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/of.c --@@ -39,10 +39,16 @@ void brcmf_of_probe(struct brcmf_sdio_de -- if (!sdiodev->pdata) -- return; -- --+ if (of_property_read_u32(np, "brcm,drive-strength", &val) == 0) --+ sdiodev->pdata->drive_strength = val; --+ --+ /* make sure there are interrupts defined in the node */ --+ if (!of_find_property(np, "interrupts", NULL)) --+ return; --+ -- irq = irq_of_parse_and_map(np, 0); -- if (!irq) { -- brcmf_err("interrupt could not be mapped\n"); --- devm_kfree(dev, sdiodev->pdata); -- return; -- } -- irqf = irqd_get_trigger_type(irq_get_irq_data(irq)); --@@ -50,7 +56,4 @@ void brcmf_of_probe(struct brcmf_sdio_de -- sdiodev->pdata->oob_irq_supported = true; -- sdiodev->pdata->oob_irq_nr = irq; -- sdiodev->pdata->oob_irq_flags = irqf; --- --- if (of_property_read_u32(np, "brcm,drive-strength", &val) == 0) --- sdiodev->pdata->drive_strength = val; -- } -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/344-0002-brcmfmac-Improve-throughput-by-scheduling-msbug-flow.patch -+++ /dev/null -@@ -1,87 +0,0 @@ --From: Hante Meuleman --Date: Wed, 20 May 2015 14:09:48 +0200 --Subject: [PATCH] brcmfmac: Improve throughput by scheduling msbug flow worker. -- --The tx flow worker in msgbuf gets scheduled at tx till a certain --threshold has been reached. Then the tx completes will take over --the scheduling. When amsdu and ampdu is used the frames are --transferred wireless in a very bulky fashion, in combination --with this scheduling algorithm and buffer limiters in the stack --this can result in limited throughput. This change causes the --flow worker to be scheduled more frequently from tx. -- --Reviewed-by: Arend Van Spriel --Reviewed-by: Franky (Zhenhui) Lin --Reviewed-by: Pieter-Paul Giesberts --Reviewed-by: Daniel (Deognyoun) Kim --Signed-off-by: Hante Meuleman --Signed-off-by: Arend van Spriel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/flowring.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/flowring.c --@@ -249,8 +249,8 @@ void brcmf_flowring_delete(struct brcmf_ -- } -- -- ---void brcmf_flowring_enqueue(struct brcmf_flowring *flow, u8 flowid, --- struct sk_buff *skb) --+u32 brcmf_flowring_enqueue(struct brcmf_flowring *flow, u8 flowid, --+ struct sk_buff *skb) -- { -- struct brcmf_flowring_ring *ring; -- --@@ -271,6 +271,7 @@ void brcmf_flowring_enqueue(struct brcmf -- if (skb_queue_len(&ring->skblist) < BRCMF_FLOWRING_LOW) -- brcmf_flowring_block(flow, flowid, false); -- } --+ return skb_queue_len(&ring->skblist); -- } -- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/flowring.h --+++ b/drivers/net/wireless/brcm80211/brcmfmac/flowring.h --@@ -64,8 +64,8 @@ u32 brcmf_flowring_create(struct brcmf_f -- 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); ---void brcmf_flowring_enqueue(struct brcmf_flowring *flow, u8 flowid, --- struct sk_buff *skb); --+u32 brcmf_flowring_enqueue(struct brcmf_flowring *flow, u8 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 *skb); ----- a/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c --@@ -73,7 +73,7 @@ -- #define BRCMF_MSGBUF_TX_FLUSH_CNT1 32 -- #define BRCMF_MSGBUF_TX_FLUSH_CNT2 96 -- ---#define BRCMF_MSGBUF_DELAY_TXWORKER_THRS 64 --+#define BRCMF_MSGBUF_DELAY_TXWORKER_THRS 96 -- #define BRCMF_MSGBUF_TRICKLE_TXWORKER_THRS 32 -- -- struct msgbuf_common_hdr { --@@ -797,6 +797,8 @@ static int brcmf_msgbuf_txdata(struct br -- struct brcmf_flowring *flow = msgbuf->flow; -- struct ethhdr *eh = (struct ethhdr *)(skb->data); -- u32 flowid; --+ u32 queue_count; --+ bool force; -- -- flowid = brcmf_flowring_lookup(flow, eh->h_dest, skb->priority, ifidx); -- if (flowid == BRCMF_FLOWRING_INVALID_ID) { --@@ -804,8 +806,9 @@ static int brcmf_msgbuf_txdata(struct br -- if (flowid == BRCMF_FLOWRING_INVALID_ID) -- return -ENOMEM; -- } --- brcmf_flowring_enqueue(flow, flowid, skb); --- brcmf_msgbuf_schedule_txdata(msgbuf, flowid, false); --+ queue_count = brcmf_flowring_enqueue(flow, flowid, skb); --+ force = ((queue_count % BRCMF_MSGBUF_TRICKLE_TXWORKER_THRS) == 0); --+ brcmf_msgbuf_schedule_txdata(msgbuf, flowid, force); -- -- return 0; -- } -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/344-0003-brcmfmac-remove-pci-shared-structure-rev4-support.patch -+++ /dev/null -@@ -1,41 +0,0 @@ --From: Franky Lin --Date: Wed, 20 May 2015 14:09:49 +0200 --Subject: [PATCH] brcmfmac: remove pci shared structure rev4 support -- --All pcie full dongle chips supported by fmac are using rev 5+ shared --structure. This patch removes the rev4 related code. -- --Reviewed-by: Pieter-Paul Giesberts --Reviewed-by: Hante Meuleman --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/pcie.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --@@ -112,10 +112,9 @@ enum brcmf_pcie_state { -- BRCMF_PCIE_MB_INT_D2H3_DB0 | \ -- BRCMF_PCIE_MB_INT_D2H3_DB1) -- ---#define BRCMF_PCIE_MIN_SHARED_VERSION 4 --+#define BRCMF_PCIE_MIN_SHARED_VERSION 5 -- #define BRCMF_PCIE_MAX_SHARED_VERSION 5 -- #define BRCMF_PCIE_SHARED_VERSION_MASK 0x00FF ---#define BRCMF_PCIE_SHARED_TXPUSH_SUPPORT 0x4000 -- -- #define BRCMF_PCIE_FLAGS_HTOD_SPLIT 0x4000 -- #define BRCMF_PCIE_FLAGS_DTOH_SPLIT 0x8000 --@@ -1280,11 +1279,6 @@ brcmf_pcie_init_share_ram_info(struct br -- brcmf_err("Unsupported PCIE version %d\n", version); -- return -EINVAL; -- } --- if (shared->flags & BRCMF_PCIE_SHARED_TXPUSH_SUPPORT) { --- brcmf_err("Unsupported legacy TX mode 0x%x\n", --- shared->flags & BRCMF_PCIE_SHARED_TXPUSH_SUPPORT); --- return -EINVAL; --- } -- -- addr = sharedram_addr + BRCMF_SHARED_MAX_RXBUFPOST_OFFSET; -- shared->max_rxbufpost = brcmf_pcie_read_tcm16(devinfo, addr); -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/344-0004-brcmfmac-remove-dummy-cache-flush-invalidate-functio.patch -+++ /dev/null -@@ -1,120 +0,0 @@ --From: Franky Lin --Date: Wed, 20 May 2015 14:09:50 +0200 --Subject: [PATCH] brcmfmac: remove dummy cache flush/invalidate function -- --brcmf_dma_flush and brcmf_dma_invalidate_cache are not necessary and --have never been implemented. -- --Reviewed-by: Pieter-Paul Giesberts --Reviewed-by: Hante Meuleman --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/commonring.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/commonring.c --@@ -22,17 +22,6 @@ -- #include "core.h" -- #include "commonring.h" -- --- ---/* dma flushing needs implementation for mips and arm platforms. Should --- * be put in util. Note, this is not real flushing. It is virtual non --- * cached memory. Only write buffers should have to be drained. Though --- * this may be different depending on platform...... --- * SEE ALSO msgbuf.c --- */ ---#define brcmf_dma_flush(addr, len) ---#define brcmf_dma_invalidate_cache(addr, len) --- --- -- void brcmf_commonring_register_cb(struct brcmf_commonring *commonring, -- int (*cr_ring_bell)(void *ctx), -- int (*cr_update_rptr)(void *ctx), --@@ -206,14 +195,9 @@ int brcmf_commonring_write_complete(stru -- address = commonring->buf_addr; -- address += (commonring->f_ptr * commonring->item_len); -- if (commonring->f_ptr > commonring->w_ptr) { --- brcmf_dma_flush(address, --- (commonring->depth - commonring->f_ptr) * --- commonring->item_len); -- address = commonring->buf_addr; -- commonring->f_ptr = 0; -- } --- brcmf_dma_flush(address, (commonring->w_ptr - commonring->f_ptr) * --- commonring->item_len); -- -- commonring->f_ptr = commonring->w_ptr; -- --@@ -258,8 +242,6 @@ void *brcmf_commonring_get_read_ptr(stru -- if (commonring->r_ptr == commonring->depth) -- commonring->r_ptr = 0; -- --- brcmf_dma_invalidate_cache(ret_addr, *n_ items * commonring->item_len); --- -- return ret_addr; -- } -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c --@@ -278,16 +278,6 @@ struct brcmf_msgbuf_pktids { -- struct brcmf_msgbuf_pktid *array; -- }; -- --- ---/* dma flushing needs implementation for mips and arm platforms. Should --- * be put in util. Note, this is not real flushing. It is virtual non --- * cached memory. Only write buffers should have to be drained. Though --- * this may be different depending on platform...... --- */ ---#define brcmf_dma_flush(addr, len) ---#define brcmf_dma_invalidate_cache(addr, len) --- --- -- static void brcmf_msgbuf_rxbuf_ioctlresp_post(struct brcmf_msgbuf *msgbuf); -- -- --@@ -462,7 +452,6 @@ static int brcmf_msgbuf_tx_ioctl(struct -- memcpy(msgbuf->ioctbuf, buf, buf_len); -- else -- memset(msgbuf->ioctbuf, 0, buf_len); --- brcmf_dma_flush(ioctl_buf, buf_len); -- -- err = brcmf_commonring_write_complete(commonring); -- brcmf_commonring_unlock(commonring); ----- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --@@ -276,15 +276,6 @@ static const u32 brcmf_ring_itemsize[BRC -- }; -- -- ---/* dma flushing needs implementation for mips and arm platforms. Should --- * be put in util. Note, this is not real flushing. It is virtual non --- * cached memory. Only write buffers should have to be drained. Though --- * this may be different depending on platform...... --- */ ---#define brcmf_dma_flush(addr, len) ---#define brcmf_dma_invalidate_cache(addr, len) --- --- -- static u32 -- brcmf_pcie_read_reg32(struct brcmf_pciedev_info *devinfo, u32 reg_offset) -- { --@@ -1174,7 +1165,6 @@ static int brcmf_pcie_init_scratchbuffer -- goto fail; -- -- memset(devinfo->shared.scratch, 0, BRCMF_DMA_D2H_SCRATCH_BUF_LEN); --- brcmf_dma_flush(devinfo->shared.scratch, BRCMF_DMA_D2H_SCRATCH_BUF_LEN); -- -- addr = devinfo->shared.tcm_base_address + -- BRCMF_SHARED_DMA_SCRATCH_ADDR_OFFSET; --@@ -1192,7 +1182,6 @@ static int brcmf_pcie_init_scratchbuffer -- goto fail; -- -- memset(devinfo->shared.ringupd, 0, BRCMF_DMA_D2H_RINGUPD_BUF_LEN); --- brcmf_dma_flush(devinfo->shared.ringupd, BRCMF_DMA_D2H_RINGUPD_BUF_LEN); -- -- addr = devinfo->shared.tcm_base_address + -- BRCMF_SHARED_DMA_RINGUPD_ADDR_OFFSET; -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/344-0005-brcmfmac-add-support-for-dma-indices-feature.patch -+++ /dev/null -@@ -1,270 +0,0 @@ --From: Franky Lin --Date: Wed, 20 May 2015 14:09:51 +0200 --Subject: [PATCH] brcmfmac: add support for dma indices feature -- --PCIe full dongle firmware can support a dma indices feature with which --firmware can update/fetch the read/write indices of message buffer --rings on both host to dongle and dongle to host directions. The support is --announced by firmware through shared flags. -- --Reviewed-by: Arend Van Spriel --Reviewed-by: Pieter-Paul Giesberts --Signed-off-by: Franky Lin --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 --@@ -115,6 +115,8 @@ enum brcmf_pcie_state { -- #define BRCMF_PCIE_MIN_SHARED_VERSION 5 -- #define BRCMF_PCIE_MAX_SHARED_VERSION 5 -- #define BRCMF_PCIE_SHARED_VERSION_MASK 0x00FF --+#define BRCMF_PCIE_SHARED_DMA_INDEX 0x10000 --+#define BRCMF_PCIE_SHARED_DMA_2B_IDX 0x100000 -- -- #define BRCMF_PCIE_FLAGS_HTOD_SPLIT 0x4000 -- #define BRCMF_PCIE_FLAGS_DTOH_SPLIT 0x8000 --@@ -146,6 +148,10 @@ enum brcmf_pcie_state { -- #define BRCMF_SHARED_RING_H2D_R_IDX_PTR_OFFSET 8 -- #define BRCMF_SHARED_RING_D2H_W_IDX_PTR_OFFSET 12 -- #define BRCMF_SHARED_RING_D2H_R_IDX_PTR_OFFSET 16 --+#define BRCMF_SHARED_RING_H2D_WP_HADDR_OFFSET 20 --+#define BRCMF_SHARED_RING_H2D_RP_HADDR_OFFSET 28 --+#define BRCMF_SHARED_RING_D2H_WP_HADDR_OFFSET 36 --+#define BRCMF_SHARED_RING_D2H_RP_HADDR_OFFSET 44 -- #define BRCMF_SHARED_RING_TCM_MEMLOC_OFFSET 0 -- #define BRCMF_SHARED_RING_MAX_SUB_QUEUES 52 -- --@@ -247,6 +253,13 @@ struct brcmf_pciedev_info { -- bool mbdata_completed; -- bool irq_allocated; -- bool wowl_enabled; --+ u8 dma_idx_sz; --+ void *idxbuf; --+ u32 idxbuf_sz; --+ dma_addr_t idxbuf_dmahandle; --+ u16 (*read_ptr)(struct brcmf_pciedev_info *devinfo, u32 mem_offset); --+ void (*write_ptr)(struct brcmf_pciedev_info *devinfo, u32 mem_offset, --+ u16 value); -- }; -- -- struct brcmf_pcie_ringbuf { --@@ -323,6 +336,25 @@ brcmf_pcie_write_tcm16(struct brcmf_pcie -- } -- -- --+static u16 --+brcmf_pcie_read_idx(struct brcmf_pciedev_info *devinfo, u32 mem_offset) --+{ --+ u16 *address = devinfo->idxbuf + mem_offset; --+ --+ return (*(address)); --+} --+ --+ --+static void --+brcmf_pcie_write_idx(struct brcmf_pciedev_info *devinfo, u32 mem_offset, --+ u16 value) --+{ --+ u16 *address = devinfo->idxbuf + mem_offset; --+ --+ *(address) = value; --+} --+ --+ -- static u32 -- brcmf_pcie_read_tcm32(struct brcmf_pciedev_info *devinfo, u32 mem_offset) -- { --@@ -868,7 +900,7 @@ static int brcmf_pcie_ring_mb_write_rptr -- brcmf_dbg(PCIE, "W r_ptr %d (%d), ring %d\n", commonring->r_ptr, -- commonring->w_ptr, ring->id); -- --- brcmf_pcie_write_tcm16(devinfo, ring->r_idx_addr, commonring->r_ptr); --+ devinfo->write_ptr(devinfo, ring->r_idx_addr, commonring->r_ptr); -- -- return 0; -- } --@@ -886,7 +918,7 @@ static int brcmf_pcie_ring_mb_write_wptr -- brcmf_dbg(PCIE, "W w_ptr %d (%d), ring %d\n", commonring->w_ptr, -- commonring->r_ptr, ring->id); -- --- brcmf_pcie_write_tcm16(devinfo, ring->w_idx_addr, commonring->w_ptr); --+ devinfo->write_ptr(devinfo, ring->w_idx_addr, commonring->w_ptr); -- -- return 0; -- } --@@ -915,7 +947,7 @@ static int brcmf_pcie_ring_mb_update_rpt -- if (devinfo->state != BRCMFMAC_PCIE_STATE_UP) -- return -EIO; -- --- commonring->r_ptr = brcmf_pcie_read_tcm16(devinfo, ring->r_idx_addr); --+ commonring->r_ptr = devinfo->read_ptr(devinfo, ring->r_idx_addr); -- -- brcmf_dbg(PCIE, "R r_ptr %d (%d), ring %d\n", commonring->r_ptr, -- commonring->w_ptr, ring->id); --@@ -933,7 +965,7 @@ static int brcmf_pcie_ring_mb_update_wpt -- if (devinfo->state != BRCMFMAC_PCIE_STATE_UP) -- return -EIO; -- --- commonring->w_ptr = brcmf_pcie_read_tcm16(devinfo, ring->w_idx_addr); --+ commonring->w_ptr = devinfo->read_ptr(devinfo, ring->w_idx_addr); -- -- brcmf_dbg(PCIE, "R w_ptr %d (%d), ring %d\n", commonring->w_ptr, -- commonring->r_ptr, ring->id); --@@ -1038,6 +1070,13 @@ static void brcmf_pcie_release_ringbuffe -- } -- kfree(devinfo->shared.flowrings); -- devinfo->shared.flowrings = NULL; --+ if (devinfo->idxbuf) { --+ dma_free_coherent(&devinfo->pdev->dev, --+ devinfo->idxbuf_sz, --+ devinfo->idxbuf, --+ devinfo->idxbuf_dmahandle); --+ devinfo->idxbuf = NULL; --+ } -- } -- -- --@@ -1053,19 +1092,72 @@ static int brcmf_pcie_init_ringbuffers(s -- u32 addr; -- u32 ring_mem_ptr; -- u32 i; --+ u64 address; --+ u32 bufsz; -- u16 max_sub_queues; --+ u8 idx_offset; -- -- ring_addr = devinfo->shared.ring_info_addr; -- brcmf_dbg(PCIE, "Base ring addr = 0x%08x\n", ring_addr); --+ addr = ring_addr + BRCMF_SHARED_RING_MAX_SUB_QUEUES; --+ max_sub_queues = brcmf_pcie_read_tcm16(devinfo, addr); -- --- addr = ring_addr + BRCMF_SHARED_RING_D2H_W_IDX_PTR_OFFSET; --- d2h_w_idx_ptr = brcmf_pcie_read_tcm32(devinfo, addr); --- addr = ring_addr + BRCMF_SHARED_RING_D2H_R_IDX_PTR_OFFSET; --- d2h_r_idx_ptr = brcmf_pcie_read_tcm32(devinfo, addr); --- addr = ring_addr + BRCMF_SHARED_RING_H2D_W_IDX_PTR_OFFSET; --- h2d_w_idx_ptr = brcmf_pcie_read_tcm32(devinfo, addr); --- addr = ring_addr + BRCMF_SHARED_RING_H2D_R_IDX_PTR_OFFSET; --- h2d_r_idx_ptr = brcmf_pcie_read_tcm32(devinfo, addr); --+ if (devinfo->dma_idx_sz != 0) { --+ bufsz = (BRCMF_NROF_D2H_COMMON_MSGRINGS + max_sub_queues) * --+ devinfo->dma_idx_sz * 2; --+ devinfo->idxbuf = dma_alloc_coherent(&devinfo->pdev->dev, bufsz, --+ &devinfo->idxbuf_dmahandle, --+ GFP_KERNEL); --+ if (!devinfo->idxbuf) --+ devinfo->dma_idx_sz = 0; --+ } --+ --+ if (devinfo->dma_idx_sz == 0) { --+ addr = ring_addr + BRCMF_SHARED_RING_D2H_W_IDX_PTR_OFFSET; --+ d2h_w_idx_ptr = brcmf_pcie_read_tcm32(devinfo, addr); --+ addr = ring_addr + BRCMF_SHARED_RING_D2H_R_IDX_PTR_OFFSET; --+ d2h_r_idx_ptr = brcmf_pcie_read_tcm32(devinfo, addr); --+ addr = ring_addr + BRCMF_SHARED_RING_H2D_W_IDX_PTR_OFFSET; --+ h2d_w_idx_ptr = brcmf_pcie_read_tcm32(devinfo, addr); --+ addr = ring_addr + BRCMF_SHARED_RING_H2D_R_IDX_PTR_OFFSET; --+ h2d_r_idx_ptr = brcmf_pcie_read_tcm32(devinfo, addr); --+ idx_offset = sizeof(u32); --+ devinfo->write_ptr = brcmf_pcie_write_tcm16; --+ devinfo->read_ptr = brcmf_pcie_read_tcm16; --+ brcmf_dbg(PCIE, "Using TCM indices\n"); --+ } else { --+ memset(devinfo->idxbuf, 0, bufsz); --+ devinfo->idxbuf_sz = bufsz; --+ idx_offset = devinfo->dma_idx_sz; --+ devinfo->write_ptr = brcmf_pcie_write_idx; --+ devinfo->read_ptr = brcmf_pcie_read_idx; --+ --+ h2d_w_idx_ptr = 0; --+ addr = ring_addr + BRCMF_SHARED_RING_H2D_WP_HADDR_OFFSET; --+ address = (u64)devinfo->idxbuf_dmahandle; --+ brcmf_pcie_write_tcm32(devinfo, addr, address & 0xffffffff); --+ brcmf_pcie_write_tcm32(devinfo, addr + 4, address >> 32); --+ --+ h2d_r_idx_ptr = h2d_w_idx_ptr + max_sub_queues * idx_offset; --+ addr = ring_addr + BRCMF_SHARED_RING_H2D_RP_HADDR_OFFSET; --+ address += max_sub_queues * idx_offset; --+ brcmf_pcie_write_tcm32(devinfo, addr, address & 0xffffffff); --+ brcmf_pcie_write_tcm32(devinfo, addr + 4, address >> 32); --+ --+ d2h_w_idx_ptr = h2d_r_idx_ptr + max_sub_queues * idx_offset; --+ addr = ring_addr + BRCMF_SHARED_RING_D2H_WP_HADDR_OFFSET; --+ address += max_sub_queues * idx_offset; --+ brcmf_pcie_write_tcm32(devinfo, addr, address & 0xffffffff); --+ brcmf_pcie_write_tcm32(devinfo, addr + 4, address >> 32); --+ --+ d2h_r_idx_ptr = d2h_w_idx_ptr + --+ BRCMF_NROF_D2H_COMMON_MSGRINGS * idx_offset; --+ addr = ring_addr + BRCMF_SHARED_RING_D2H_RP_HADDR_OFFSET; --+ address += BRCMF_NROF_D2H_COMMON_MSGRINGS * idx_offset; --+ brcmf_pcie_write_tcm32(devinfo, addr, address & 0xffffffff); --+ brcmf_pcie_write_tcm32(devinfo, addr + 4, address >> 32); --+ brcmf_dbg(PCIE, "Using host memory indices\n"); --+ } -- -- addr = ring_addr + BRCMF_SHARED_RING_TCM_MEMLOC_OFFSET; -- ring_mem_ptr = brcmf_pcie_read_tcm32(devinfo, addr); --@@ -1079,8 +1171,8 @@ static int brcmf_pcie_init_ringbuffers(s -- ring->id = i; -- devinfo->shared.commonrings[i] = ring; -- --- h2d_w_idx_ptr += sizeof(u32); --- h2d_r_idx_ptr += sizeof(u32); --+ h2d_w_idx_ptr += idx_offset; --+ h2d_r_idx_ptr += idx_offset; -- ring_mem_ptr += BRCMF_RING_MEM_SZ; -- } -- --@@ -1094,13 +1186,11 @@ static int brcmf_pcie_init_ringbuffers(s -- ring->id = i; -- devinfo->shared.commonrings[i] = ring; -- --- d2h_w_idx_ptr += sizeof(u32); --- d2h_r_idx_ptr += sizeof(u32); --+ d2h_w_idx_ptr += idx_offset; --+ d2h_r_idx_ptr += idx_offset; -- ring_mem_ptr += BRCMF_RING_MEM_SZ; -- } -- --- addr = ring_addr + BRCMF_SHARED_RING_MAX_SUB_QUEUES; --- max_sub_queues = brcmf_pcie_read_tcm16(devinfo, addr); -- devinfo->shared.nrof_flowrings = -- max_sub_queues - BRCMF_NROF_H2D_COMMON_MSGRINGS; -- rings = kcalloc(devinfo->shared.nrof_flowrings, sizeof(*ring), --@@ -1124,15 +1214,15 @@ static int brcmf_pcie_init_ringbuffers(s -- ring); -- ring->w_idx_addr = h2d_w_idx_ptr; -- ring->r_idx_addr = h2d_r_idx_ptr; --- h2d_w_idx_ptr += sizeof(u32); --- h2d_r_idx_ptr += sizeof(u32); --+ h2d_w_idx_ptr += idx_offset; --+ h2d_r_idx_ptr += idx_offset; -- } -- devinfo->shared.flowrings = rings; -- -- return 0; -- -- fail: --- brcmf_err("Allocating commonring buffers failed\n"); --+ brcmf_err("Allocating ring buffers failed\n"); -- brcmf_pcie_release_ringbuffers(devinfo); -- return -ENOMEM; -- } --@@ -1269,6 +1359,14 @@ brcmf_pcie_init_share_ram_info(struct br -- return -EINVAL; -- } -- --+ /* check firmware support dma indicies */ --+ if (shared->flags & BRCMF_PCIE_SHARED_DMA_INDEX) { --+ if (shared->flags & BRCMF_PCIE_SHARED_DMA_2B_IDX) --+ devinfo->dma_idx_sz = sizeof(u16); --+ else --+ devinfo->dma_idx_sz = sizeof(u32); --+ } --+ -- 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/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/345-brcmfmac-avoid-null-pointer-access-when-brcmf_msgbuf.patch -+++ /dev/null -@@ -1,102 +0,0 @@ --From: Arend van Spriel --Date: Tue, 26 May 2015 13:19:46 +0200 --Subject: [PATCH] brcmfmac: avoid null pointer access when -- brcmf_msgbuf_get_pktid() fails -- --The function brcmf_msgbuf_get_pktid() may return a NULL pointer so --the callers should check the return pointer before accessing it to --avoid the crash below (see [1]): -- --brcmfmac: brcmf_msgbuf_get_pktid: Invalid packet id 273 (not in use) --BUG: unable to handle kernel NULL pointer dereference at 0000000000000080 --IP: [] skb_pull+0x5/0x50 --PGD 0 --Oops: 0000 [#1] PREEMPT SMP --Modules linked in: pci_stub vboxpci(O) vboxnetflt(O) vboxnetadp(O) vboxdrv(O) -- snd_hda_codec_hdmi bnep mousedev hid_generic ushwmon msr ext4 crc16 mbcache -- jbd2 sd_mod uas usb_storage ahci libahci libata scsi_mod xhci_pci xhci_hcd -- usbcore usb_common --CPU: 0 PID: 1661 Comm: irq/61-brcmf_pc Tainted: G O 4.0.1-MacbookPro-ARCH #1 --Hardware name: Apple Inc. MacBookPro12,1/Mac-E43C1C25D4880AD6, -- BIOS MBP121.88Z.0167.B02.1503241251 03/24/2015 --task: ffff880264203cc0 ti: ffff88025ffe4000 task.ti: ffff88025ffe4000 --RIP: 0010:[] [] skb_pull+0x5/0x50 --RSP: 0018:ffff88025ffe7d40 EFLAGS: 00010202 --RAX: 0000000000000000 RBX: ffff88008a33c000 RCX: 0000000000000044 --RDX: 0000000000000000 RSI: 000000000000004a RDI: 0000000000000000 --RBP: ffff88025ffe7da8 R08: 0000000000000096 R09: 000000000000004a --R10: 0000000000000000 R11: 000000000000048e R12: ffff88025ff14f00 --R13: 0000000000000000 R14: ffff880263b48200 R15: ffff88008a33c000 --FS: 0000000000000000(0000) GS:ffff88026ec00000(0000) knlGS:0000000000000000 --CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 --CR2: 0000000000000080 CR3: 000000000180b000 CR4: 00000000003407f0 --Stack: -- ffffffffa06aed74 ffff88025ffe7dc8 ffff880263b48270 ffff880263b48278 -- 05ea88020000004a 0002ffff81014635 000000001720b2f6 ffff88026ec116c0 -- ffff880263b48200 0000000000010000 ffff880263b4ae00 ffff880264203cc0 --Call Trace: -- [] ? brcmf_msgbuf_process_rx+0x404/0x480 [brcmfmac] -- [] ? irq_finalize_oneshot.part.30+0xf0/0xf0 -- [] brcmf_proto_msgbuf_rx_trigger+0x35/0xf0 [brcmfmac] -- [] brcmf_pcie_isr_thread_v2+0x8a/0x130 [brcmfmac] -- [] irq_thread_fn+0x20/0x50 -- [] irq_thread+0x13f/0x170 -- [] ? wake_threads_waitq+0x30/0x30 -- [] ? irq_thread_dtor+0xb0/0xb0 -- [] kthread+0xd8/0xf0 -- [] ? kthread_create_on_node+0x1c0/0x1c0 -- [] ret_from_fork+0x58/0x90 -- [] ? kthread_create_on_node+0x1c0/0x1c0 --Code: 01 83 e2 f7 88 50 01 48 83 c4 08 5b 5d f3 c3 0f 1f 80 00 00 00 00 83 e2 -- f7 88 50 01 c3 66 0f 1f 84 00 00 00 00 00 0f 1f --RIP [] skb_pull+0x5/0x50 -- RSP --CR2: 0000000000000080 -----[ end trace b074c0f90e7c997d ]--- -- --[1] http://mid.gmane.org/20150430193259.GA5630@googlemail.com -- --Cc: # v3.18, v3.19, v4.0, v4.1 --Reported-by: Michael Hornung --Reviewed-by: Hante Meuleman --Reviewed-by: Pieter-Paul Giesberts --Signed-off-by: Arend van Spriel ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c --@@ -500,11 +500,9 @@ static int brcmf_msgbuf_query_dcmd(struc -- msgbuf->rx_pktids, -- msgbuf->ioctl_resp_pktid); -- if (msgbuf->ioctl_resp_ret_len != 0) { --- if (!skb) { --- brcmf_err("Invalid packet id idx recv'd %d\n", --- msgbuf->ioctl_resp_pktid); --+ if (!skb) -- return -EBADF; --- } --+ -- memcpy(buf, skb->data, (len < msgbuf->ioctl_resp_ret_len) ? -- len : msgbuf->ioctl_resp_ret_len); -- } --@@ -866,10 +864,8 @@ brcmf_msgbuf_process_txstatus(struct brc -- flowid -= BRCMF_NROF_H2D_COMMON_MSGRINGS; -- skb = brcmf_msgbuf_get_pktid(msgbuf->drvr->bus_if->dev, -- msgbuf->tx_pktids, idx); --- if (!skb) { --- brcmf_err("Invalid packet id idx recv'd %d\n", idx); --+ if (!skb) -- return; --- } -- -- set_bit(flowid, msgbuf->txstatus_done_map); -- commonring = msgbuf->flowrings[flowid]; --@@ -1148,6 +1144,8 @@ brcmf_msgbuf_process_rx_complete(struct -- -- skb = brcmf_msgbuf_get_pktid(msgbuf->drvr->bus_if->dev, -- msgbuf->rx_pktids, idx); --+ if (!skb) --+ return; -- -- if (data_offset) -- skb_pull(skb, data_offset); -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/346-brcmfmac-fix-invalid-access-to-struct-acpi_device-fi.patch -+++ /dev/null -@@ -1,63 +0,0 @@ --From: Arend van Spriel --Date: Wed, 27 May 2015 19:31:41 +0200 --Subject: [PATCH] brcmfmac: fix invalid access to struct acpi_device fields -- --The fields of struct acpi_device are only known when CONFIG_ACPI is --defined. Fix this by using a helper function. This will resolve the --issue found in linux-next: -- -- ../brcmfmac/bcmsdh.c: In function 'brcmf_ops_sdio_probe': -- ../brcmfmac/bcmsdh.c:1139:7: error: dereferencing pointer to incomplete type -- adev->flags.power_manageable = 0; -- ^ -- --Fixes: f0992ace680c ("brcmfmac: prohibit ACPI power management ...") --Cc: Fu, Zhonghui --Reported-by: Stephen Rothwell --Signed-off-by: Arend van Spriel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c --@@ -1117,6 +1117,18 @@ MODULE_DEVICE_TABLE(sdio, brcmf_sdmmc_id -- static struct brcmfmac_sdio_platform_data *brcmfmac_sdio_pdata; -- -- --+static void brcmf_sdiod_acpi_set_power_manageable(struct device *dev, --+ int val) --+{ --+#if IS_ENABLED(CONFIG_ACPI) --+ struct acpi_device *adev; --+ --+ adev = ACPI_COMPANION(dev); --+ if (adev) --+ adev->flags.power_manageable = 0; --+#endif --+} --+ -- static int brcmf_ops_sdio_probe(struct sdio_func *func, -- const struct sdio_device_id *id) -- { --@@ -1124,7 +1136,6 @@ static int brcmf_ops_sdio_probe(struct s -- struct brcmf_sdio_dev *sdiodev; -- struct brcmf_bus *bus_if; -- struct device *dev; --- struct acpi_device *adev; -- -- brcmf_dbg(SDIO, "Enter\n"); -- brcmf_dbg(SDIO, "Class=%x\n", func->class); --@@ -1132,11 +1143,9 @@ static int brcmf_ops_sdio_probe(struct s -- brcmf_dbg(SDIO, "sdio device ID: 0x%04x\n", func->device); -- brcmf_dbg(SDIO, "Function#: %d\n", func->num); -- --- /* prohibit ACPI power management for this device */ -- dev = &func->dev; --- adev = ACPI_COMPANION(dev); --- if (adev) --- adev->flags.power_manageable = 0; --+ /* prohibit ACPI power management for this device */ --+ brcmf_sdiod_acpi_set_power_manageable(dev, 0); -- -- /* Consume func num 1 but dont do anything with it. */ -- if (func->num == 1) -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/347-brcmfmac-simplify-check-stripping-v2-NVRAM.patch -+++ /dev/null -@@ -1,56 +0,0 @@ --From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= --Date: Wed, 20 May 2015 09:34:21 +0200 --Subject: [PATCH] brcmfmac: simplify check stripping v2 NVRAM --MIME-Version: 1.0 --Content-Type: text/plain; charset=UTF-8 --Content-Transfer-Encoding: 8bit -- --Comparing NVRAM entry with a full filtering string is simpler than --comparing it with a short prefix and then checking random chars at magic --offsets. The cost of snprintf relatively low, we execute it just once. --Tested on BCM43602 with NVRAM hacked to use V2 format. -- --Signed-off-by: Rafał Miłecki --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/firmware.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/firmware.c --@@ -25,7 +25,7 @@ -- -- #define BRCMF_FW_MAX_NVRAM_SIZE 64000 -- #define BRCMF_FW_NVRAM_DEVPATH_LEN 19 /* devpath0=pcie/1/4/ */ ---#define BRCMF_FW_NVRAM_PCIEDEV_LEN 9 /* pcie/1/4/ */ --+#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, --@@ -297,6 +297,8 @@ fail: -- static void brcmf_fw_strip_multi_v2(struct nvram_parser *nvp, u16 domain_nr, -- u16 bus_nr) -- { --+ char prefix[BRCMF_FW_NVRAM_PCIEDEV_LEN]; --+ size_t len; -- u32 i, j; -- u8 *nvram; -- --@@ -308,14 +310,13 @@ static void brcmf_fw_strip_multi_v2(stru -- * Valid entries are of type pcie/X/Y/ where X = domain_nr and -- * Y = bus_nr. -- */ --+ snprintf(prefix, sizeof(prefix), "pcie/%d/%d/", domain_nr, bus_nr); --+ len = strlen(prefix); -- i = 0; -- j = 0; --- while (i < nvp->nvram_len - BRCMF_FW_NVRAM_PCIEDEV_LEN) { --- if ((strncmp(&nvp->nvram[i], "pcie/", 5) == 0) && --- (nvp->nvram[i + 6] == '/') && (nvp->nvram[i + 8] == '/') && --- ((nvp->nvram[i + 5] - '0') == domain_nr) && --- ((nvp->nvram[i + 7] - '0') == bus_nr)) { --- i += BRCMF_FW_NVRAM_PCIEDEV_LEN; --+ while (i < nvp->nvram_len - len) { --+ if (strncmp(&nvp->nvram[i], prefix, len) == 0) { --+ i += len; -- while (nvp->nvram[i] != 0) { -- nvram[j] = nvp->nvram[i]; -- i++; -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/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?= --Date: Wed, 20 May 2015 11:01:08 +0200 --Subject: [PATCH] brcmfmac: simplify check finding NVRAM v1 device path --MIME-Version: 1.0 --Content-Type: text/plain; charset=UTF-8 --Content-Transfer-Encoding: 8bit -- --With a simple use of snprintf and small buffer we can compare NVRAM --entry value with a full string. This way we avoid checking random chars --at magic offsets. --Tested on BCM43602 with NVRAM hacked to use v1 format. -- --Signed-off-by: Rafał Miłecki --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/firmware.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/firmware.c --@@ -222,6 +222,10 @@ static int brcmf_init_nvram_parser(struc -- static void brcmf_fw_strip_multi_v1(struct nvram_parser *nvp, u16 domain_nr, -- u16 bus_nr) -- { --+ /* Device path with a leading '=' key-value separator */ --+ char pcie_path[] = "=pcie/?/?"; --+ size_t pcie_len; --+ -- u32 i, j; -- bool found; -- u8 *nvram; --@@ -238,6 +242,9 @@ static void brcmf_fw_strip_multi_v1(stru -- /* First search for the devpathX and see if it is the configuration -- * for domain_nr/bus_nr. Search complete nvp -- */ --+ snprintf(pcie_path, sizeof(pcie_path), "=pcie/%d/%d", domain_nr, --+ bus_nr); --+ pcie_len = strlen(pcie_path); -- found = false; -- i = 0; -- while (i < nvp->nvram_len - BRCMF_FW_NVRAM_DEVPATH_LEN) { --@@ -245,13 +252,10 @@ static void brcmf_fw_strip_multi_v1(stru -- * Y = domain_nr, Z = bus_nr, X = virtual ID -- */ -- if ((strncmp(&nvp->nvram[i], "devpath", 7) == 0) && --- (strncmp(&nvp->nvram[i + 8], "=pcie/", 6) == 0)) { --- if (((nvp->nvram[i + 14] - '0') == domain_nr) && --- ((nvp->nvram[i + 16] - '0') == bus_nr)) { --- id = nvp->nvram[i + 7] - '0'; --- found = true; --- break; --- } --+ (strncmp(&nvp->nvram[i + 8], pcie_path, pcie_len) == 0)) { --+ id = nvp->nvram[i + 7] - '0'; --+ found = true; --+ break; -- } -- while (nvp->nvram[i] != 0) -- i++; -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/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?= --Date: Wed, 20 May 2015 13:59:54 +0200 --Subject: [PATCH] brcmfmac: treat \0 as end of comment when parsing NVRAM --MIME-Version: 1.0 --Content-Type: text/plain; charset=UTF-8 --Content-Transfer-Encoding: 8bit -- --This fixes brcmfmac dealing with NVRAM coming from platform e.g. from a --flash MTD partition. In such cases entries are separated by \0 instead --of \n which caused ignoring whole content after the first "comment". --While platform NVRAM doesn't usually contain comments, we switch to --COMMENT state after e.g. finding an unexpected char in key name. -- --Signed-off-by: Rafał Miłecki --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/firmware.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/firmware.c --@@ -162,17 +162,20 @@ brcmf_nvram_handle_value(struct nvram_pa -- static enum nvram_parser_state -- brcmf_nvram_handle_comment(struct nvram_parser *nvp) -- { --- char *eol, *sol; --+ char *eoc, *sol; -- -- sol = (char *)&nvp->fwnv->data[nvp->pos]; --- eol = strchr(sol, '\n'); --- if (eol == NULL) --- return END; --+ eoc = strchr(sol, '\n'); --+ if (!eoc) { --+ eoc = strchr(sol, '\0'); --+ if (!eoc) --+ return END; --+ } -- -- /* eat all moving to next line */ -- nvp->line++; -- nvp->column = 1; --- nvp->pos += (eol - sol) + 1; --+ nvp->pos += (eoc - sol) + 1; -- return IDLE; -- } -- -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/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?= --Date: Sat, 23 May 2015 09:15:33 +0200 --Subject: [PATCH] brcmfmac: allow NVRAM values to contain spaces --MIME-Version: 1.0 --Content-Type: text/plain; charset=UTF-8 --Content-Transfer-Encoding: 8bit -- --Platform NVRAMs often contain values with spaces. Even if right now most --firmware-supported entries are simple values, we shouldn't reject these --with spaces. It was semi-confirmed by Broadcom in the early patch adding --support for platform NVRAMs. -- --Signed-off-by: Rafał Miłecki --Acked-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 --@@ -66,6 +66,12 @@ struct nvram_parser { -- bool multi_dev_v2; -- }; -- --+/** --+ * is_nvram_char() - check if char is a valid one for NVRAM entry --+ * --+ * It accepts all printable ASCII chars except for '#' which opens a comment. --+ * Please note that ' ' (space) while accepted is not a valid key name char. --+ */ -- static bool is_nvram_char(char c) -- { -- /* comment marker excluded */ --@@ -73,7 +79,7 @@ static bool is_nvram_char(char c) -- return false; -- -- /* key and value may have any other readable character */ --- return (c > 0x20 && c < 0x7f); --+ return (c >= 0x20 && c < 0x7f); -- } -- -- static bool is_whitespace(char c) --@@ -120,7 +126,7 @@ static enum nvram_parser_state brcmf_nvr -- nvp->multi_dev_v1 = true; -- if (strncmp(&nvp->fwnv->data[nvp->entry], "pcie/", 5) == 0) -- nvp->multi_dev_v2 = true; --- } else if (!is_nvram_char(c)) { --+ } else if (!is_nvram_char(c) || c == ' ') { -- 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/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/351-ath9k-fix-DMA-stop-sequence-for-AR9003.patch -+++ /dev/null -@@ -1,33 +0,0 @@ --From: Felix Fietkau --Date: Tue, 2 Jun 2015 10:35:46 +0200 --Subject: [PATCH] ath9k: fix DMA stop sequence for AR9003+ -- --AR93xx and newer needs to stop rx before tx to avoid getting the DMA --engine or MAC into a stuck state. --This should reduce/fix the occurence of "Failed to stop Tx DMA" logspam. -- --Cc: stable@vger.kernel.org --Signed-off-by: Felix Fietkau ----- -- ----- a/drivers/net/wireless/ath/ath9k/main.c --+++ b/drivers/net/wireless/ath/ath9k/main.c --@@ -216,11 +216,13 @@ static bool ath_prepare_reset(struct ath -- ath_stop_ani(sc); -- ath9k_hw_disable_interrupts(ah); -- --- if (!ath_drain_all_txq(sc)) --- ret = false; --- --- if (!ath_stoprecv(sc)) --- ret = false; --+ if (AR_SREV_9300_20_OR_LATER(ah)) { --+ ret &= ath_stoprecv(sc); --+ ret &= ath_drain_all_txq(sc); --+ } else { --+ ret &= ath_drain_all_txq(sc); --+ ret &= ath_stoprecv(sc); --+ } -- -- return ret; -- } -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/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?= --Date: Thu, 28 May 2015 14:19:21 +0200 --Subject: [PATCH] brcmfmac: support NVRAMs containing pci devpaths (instead of -- pcie) --MIME-Version: 1.0 --Content-Type: text/plain; charset=UTF-8 --Content-Transfer-Encoding: 8bit -- --Recently Broadcom added support for NVRAMs with entries for multiple --PCIe devices. One of the supported formats is based on prefixes defined --like: devpath0=pcie/1/4/ and entries like 0:foo=bar 0:baz=qux etc. -- --Unfortunately there are also a bit older devices using different way of --defining prefixes, e.g. SmartRG SR400ac (2 x BCM43602) with entries: --devpath0=pci/1/1/ --devpath1=pci/2/1 --Broadcom stated this old format will never be used/supported by brcmfmac --but given the simplicity of this patch I'll insist on supporting it. -- --Signed-off-by: Rafał Miłecki --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/firmware.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/firmware.c --@@ -232,6 +232,8 @@ static void brcmf_fw_strip_multi_v1(stru -- u16 bus_nr) -- { -- /* Device path with a leading '=' key-value separator */ --+ char pci_path[] = "=pci/?/?"; --+ size_t pci_len; -- char pcie_path[] = "=pcie/?/?"; -- size_t pcie_len; -- --@@ -251,6 +253,9 @@ static void brcmf_fw_strip_multi_v1(stru -- /* First search for the devpathX and see if it is the configuration -- * for domain_nr/bus_nr. Search complete nvp -- */ --+ snprintf(pci_path, sizeof(pci_path), "=pci/%d/%d", domain_nr, --+ bus_nr); --+ pci_len = strlen(pci_path); -- snprintf(pcie_path, sizeof(pcie_path), "=pcie/%d/%d", domain_nr, -- bus_nr); -- pcie_len = strlen(pcie_path); --@@ -260,8 +265,9 @@ static void brcmf_fw_strip_multi_v1(stru -- /* Format: devpathX=pcie/Y/Z/ -- * Y = domain_nr, Z = bus_nr, X = virtual ID -- */ --- if ((strncmp(&nvp->nvram[i], "devpath", 7) == 0) && --- (strncmp(&nvp->nvram[i + 8], pcie_path, pcie_len) == 0)) { --+ if (strncmp(&nvp->nvram[i], "devpath", 7) == 0 && --+ (!strncmp(&nvp->nvram[i + 8], pci_path, pci_len) || --+ !strncmp(&nvp->nvram[i + 8], pcie_path, pcie_len))) { -- id = nvp->nvram[i + 7] - '0'; -- found = true; -- break; -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/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?= --Date: Sun, 31 May 2015 02:52:26 +0200 --Subject: [PATCH] brcmfmac: set wiphy perm_addr to hardware MAC address --MIME-Version: 1.0 --Content-Type: text/plain; charset=UTF-8 --Content-Transfer-Encoding: 8bit -- --This allows e.g. user space to use /sys/class/ieee80211/*/macaddress -- --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 --@@ -6070,6 +6070,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802 -- brcmf_err("Could not allocate wiphy device\n"); -- return NULL; -- } --+ memcpy(wiphy->perm_addr, drvr->mac, ETH_ALEN); -- set_wiphy_dev(wiphy, busdev); -- -- cfg = wiphy_priv(wiphy); -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/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?= --Date: Thu, 4 Jun 2015 22:11:07 +0200 --Subject: [PATCH] brcmfmac: use direct data pointer in NVRAM parser struct --MIME-Version: 1.0 --Content-Type: text/plain; charset=UTF-8 --Content-Transfer-Encoding: 8bit -- --As we plan to add support for platform NVRAM we should store direct --data pointer without the extra struct firmware layer. This will allow --us to support other sources with the only requirement being u8 buffer. -- --Signed-off-by: Rafał Miłecki --Acked-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 --@@ -43,7 +43,7 @@ enum nvram_parser_state { -- * struct nvram_parser - internal info for parser. -- * -- * @state: current parser state. --- * @fwnv: input buffer being parsed. --+ * @data: input buffer being parsed. -- * @nvram: output buffer with parse result. -- * @nvram_len: lenght of parse result. -- * @line: current line. --@@ -55,7 +55,7 @@ enum nvram_parser_state { -- */ -- struct nvram_parser { -- enum nvram_parser_state state; --- const struct firmware *fwnv; --+ const u8 *data; -- u8 *nvram; -- u32 nvram_len; -- u32 line; --@@ -91,7 +91,7 @@ static enum nvram_parser_state brcmf_nvr -- { -- char c; -- --- c = nvp->fwnv->data[nvp->pos]; --+ c = nvp->data[nvp->pos]; -- if (c == '\n') -- return COMMENT; -- if (is_whitespace(c)) --@@ -115,16 +115,16 @@ static enum nvram_parser_state brcmf_nvr -- enum nvram_parser_state st = nvp->state; -- char c; -- --- c = nvp->fwnv->data[nvp->pos]; --+ c = nvp->data[nvp->pos]; -- if (c == '=') { -- /* ignore RAW1 by treating as comment */ --- if (strncmp(&nvp->fwnv->data[nvp->entry], "RAW1", 4) == 0) --+ if (strncmp(&nvp->data[nvp->entry], "RAW1", 4) == 0) -- st = COMMENT; -- else -- st = VALUE; --- if (strncmp(&nvp->fwnv->data[nvp->entry], "devpath", 7) == 0) --+ if (strncmp(&nvp->data[nvp->entry], "devpath", 7) == 0) -- nvp->multi_dev_v1 = true; --- if (strncmp(&nvp->fwnv->data[nvp->entry], "pcie/", 5) == 0) --+ if (strncmp(&nvp->data[nvp->entry], "pcie/", 5) == 0) -- nvp->multi_dev_v2 = true; -- } else if (!is_nvram_char(c) || c == ' ') { -- brcmf_dbg(INFO, "warning: ln=%d:col=%d: '=' expected, skip invalid key entry\n", --@@ -145,11 +145,11 @@ brcmf_nvram_handle_value(struct nvram_pa -- char *ekv; -- u32 cplen; -- --- c = nvp->fwnv->data[nvp->pos]; --+ c = nvp->data[nvp->pos]; -- if (!is_nvram_char(c)) { -- /* key,value pair complete */ --- ekv = (u8 *)&nvp->fwnv->data[nvp->pos]; --- skv = (u8 *)&nvp->fwnv->data[nvp->entry]; --+ ekv = (u8 *)&nvp->data[nvp->pos]; --+ skv = (u8 *)&nvp->data[nvp->entry]; -- cplen = ekv - skv; -- if (nvp->nvram_len + cplen + 1 >= BRCMF_FW_MAX_NVRAM_SIZE) -- return END; --@@ -170,7 +170,7 @@ brcmf_nvram_handle_comment(struct nvram_ -- { -- char *eoc, *sol; -- --- sol = (char *)&nvp->fwnv->data[nvp->pos]; --+ sol = (char *)&nvp->data[nvp->pos]; -- eoc = strchr(sol, '\n'); -- if (!eoc) { -- eoc = strchr(sol, '\0'); --@@ -201,17 +201,17 @@ static enum nvram_parser_state -- }; -- -- static int brcmf_init_nvram_parser(struct nvram_parser *nvp, --- const struct firmware *nv) --+ const u8 *data, size_t data_len) -- { -- size_t size; -- -- memset(nvp, 0, sizeof(*nvp)); --- nvp->fwnv = nv; --+ nvp->data = data; -- /* Limit size to MAX_NVRAM_SIZE, some files contain lot of comment */ --- if (nv->size > BRCMF_FW_MAX_NVRAM_SIZE) --+ if (data_len > BRCMF_FW_MAX_NVRAM_SIZE) -- size = BRCMF_FW_MAX_NVRAM_SIZE; -- else --- size = nv->size; --+ size = data_len; -- /* Alloc for extra 0 byte + roundup by 4 + length field */ -- size += 1 + 3 + sizeof(u32); -- nvp->nvram = kzalloc(size, GFP_KERNEL); --@@ -362,18 +362,18 @@ fail: -- * and converts newlines to NULs. Shortens buffer as needed and pads with NULs. -- * End of buffer is completed with token identifying length of buffer. -- */ ---static void *brcmf_fw_nvram_strip(const struct firmware *nv, u32 *new_length, --- u16 domain_nr, u16 bus_nr) --+static void *brcmf_fw_nvram_strip(const u8 *data, size_t data_len, --+ u32 *new_length, u16 domain_nr, u16 bus_nr) -- { -- struct nvram_parser nvp; -- u32 pad; -- u32 token; -- __le32 token_le; -- --- if (brcmf_init_nvram_parser(&nvp, nv) < 0) --+ if (brcmf_init_nvram_parser(&nvp, data, data_len) < 0) -- return NULL; -- --- while (nvp.pos < nv->size) { --+ while (nvp.pos < data_len) { -- nvp.state = nv_parser_states[nvp.state](&nvp); -- if (nvp.state == END) -- break; --@@ -432,7 +432,7 @@ static void brcmf_fw_request_nvram_done( -- goto fail; -- -- if (fw) { --- nvram = brcmf_fw_nvram_strip(fw, &nvram_length, --+ nvram = brcmf_fw_nvram_strip(fw->data, fw->size, &nvram_length, -- 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/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/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?= --Date: Sat, 6 Jun 2015 22:45:59 +0200 --Subject: [PATCH] b43: fix support for 14e4:4321 PCI dev with BCM4321 chipset --MIME-Version: 1.0 --Content-Type: text/plain; charset=UTF-8 --Content-Transfer-Encoding: 8bit -- --It seems Broadcom released two devices with conflicting device id. There --are for sure 14e4:4321 PCI devices with BCM4321 (N-PHY) chipset, they --can be found in routers, e.g. Netgear WNR834Bv2. However, according to --Broadcom public sources 0x4321 is also used for 5 GHz BCM4306 (G-PHY). --It's unsure if they meant PCI device id, or "virtual" id (from SPROM). --To distinguish these devices lets check PHY type (G vs. N). -- --Signed-off-by: Rafał Miłecki --Cc: # 3.16+ --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/b43/main.c --+++ b/drivers/net/wireless/b43/main.c --@@ -5365,6 +5365,10 @@ static void b43_supported_bands(struct b -- *have_5ghz_phy = true; -- return; -- case 0x4321: /* BCM4306 */ --+ /* There are 14e4:4321 PCI devs with 2.4 GHz BCM4321 (N-PHY) */ --+ if (dev->phy.type != B43_PHYTYPE_G) --+ break; --+ /* fall through */ -- case 0x4313: /* BCM4311 */ -- case 0x431a: /* BCM4318 */ -- case 0x432a: /* BCM4321 */ -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/356-ath9k-force-rx_clear-when-disabling-rx.patch -+++ /dev/null -@@ -1,31 +0,0 @@ --From: Felix Fietkau --Date: Sun, 7 Jun 2015 13:53:35 +0200 --Subject: [PATCH] ath9k: force rx_clear when disabling rx -- --This makes stopping Rx more reliable and should reduce the frequency of --Rx related DMA stop warnings -- --Cc: stable@vger.kernel.org --Signed-off-by: Felix Fietkau ----- -- ----- a/drivers/net/wireless/ath/ath9k/mac.c --+++ b/drivers/net/wireless/ath/ath9k/mac.c --@@ -677,13 +677,15 @@ void ath9k_hw_startpcureceive(struct ath -- -- ath9k_ani_reset(ah, is_scanning); -- --- REG_CLR_BIT(ah, AR_DIAG_SW, (AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT)); --+ REG_CLR_BIT(ah, AR_DIAG_SW, --+ AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT | AR_DIAG_FORCE_RX_CLEAR); -- } -- EXPORT_SYMBOL(ath9k_hw_startpcureceive); -- -- void ath9k_hw_abortpcurecv(struct ath_hw *ah) -- { --- REG_SET_BIT(ah, AR_DIAG_SW, AR_DIAG_RX_ABORT | AR_DIAG_RX_DIS); --+ REG_SET_BIT(ah, AR_DIAG_SW, --+ AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT | AR_DIAG_FORCE_RX_CLEAR); -- -- ath9k_hw_disable_mib_counters(ah); -- } -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/357-0001-brcmfmac-Update-msgbuf-read-pointer-quicker.patch -+++ /dev/null -@@ -1,109 +0,0 @@ --From: Hante Meuleman --Date: Mon, 8 Jun 2015 14:38:32 +0200 --Subject: [PATCH] brcmfmac: Update msgbuf read pointer quicker. -- --On device to host data using msgbuf the read pointer gets updated --once all data is processed. Updating this pointer more frequently --allows the firmware to add more data quicker. This will result in --slightly higher and more stable throughput on CPU bounded host --processors. -- --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/commonring.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/commonring.c --@@ -223,8 +223,6 @@ void brcmf_commonring_write_cancel(struc -- void *brcmf_commonring_get_read_ptr(struct brcmf_commonring *commonring, -- u16 *n_items) -- { --- void *ret_addr; --- -- if (commonring->cr_update_wptr) -- commonring->cr_update_wptr(commonring->cr_ctx); -- --@@ -235,19 +233,18 @@ void *brcmf_commonring_get_read_ptr(stru -- if (*n_items == 0) -- return NULL; -- --- ret_addr = commonring->buf_addr + --- (commonring->r_ptr * commonring->item_len); --- --- commonring->r_ptr += *n_items; --- if (commonring->r_ptr == commonring->depth) --- commonring->r_ptr = 0; --- --- return ret_addr; --+ return commonring->buf_addr + --+ (commonring->r_ptr * commonring->item_len); -- } -- -- ---int brcmf_commonring_read_complete(struct brcmf_commonring *commonring) --+int brcmf_commonring_read_complete(struct brcmf_commonring *commonring, --+ u16 n_items) -- { --+ commonring->r_ptr += n_items; --+ if (commonring->r_ptr == commonring->depth) --+ commonring->r_ptr = 0; --+ -- if (commonring->cr_write_rptr) -- return commonring->cr_write_rptr(commonring->cr_ctx); -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/commonring.h --+++ b/drivers/net/wireless/brcm80211/brcmfmac/commonring.h --@@ -62,7 +62,8 @@ void brcmf_commonring_write_cancel(struc -- u16 n_items); -- void *brcmf_commonring_get_read_ptr(struct brcmf_commonring *commonring, -- u16 *n_items); ---int brcmf_commonring_read_complete(struct brcmf_commonring *commonring); --+int brcmf_commonring_read_complete(struct brcmf_commonring *commonring, --+ u16 n_items); -- -- #define brcmf_commonring_n_items(commonring) (commonring->depth) -- #define brcmf_commonring_len_item(commonring) (commonring->item_len) ----- a/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c --@@ -75,6 +75,8 @@ -- -- #define BRCMF_MSGBUF_DELAY_TXWORKER_THRS 96 -- #define BRCMF_MSGBUF_TRICKLE_TXWORKER_THRS 32 --+#define BRCMF_MSGBUF_UPDATE_RX_PTR_THRS 48 --+ -- -- struct msgbuf_common_hdr { -- u8 msgtype; --@@ -1257,19 +1259,27 @@ static void brcmf_msgbuf_process_rx(stru -- { -- void *buf; -- u16 count; --+ u16 processed; -- -- again: -- buf = brcmf_commonring_get_read_ptr(commonring, &count); -- if (buf == NULL) -- return; -- --+ processed = 0; -- while (count) { -- brcmf_msgbuf_process_msgtype(msgbuf, -- buf + msgbuf->rx_dataoffset); -- buf += brcmf_commonring_len_item(commonring); --+ processed++; --+ if (processed == BRCMF_MSGBUF_UPDATE_RX_PTR_THRS) { --+ brcmf_commonring_read_complete(commonring, processed); --+ processed = 0; --+ } -- count--; -- } --- brcmf_commonring_read_complete(commonring); --+ if (processed) --+ brcmf_commonring_read_complete(commonring, processed); -- -- if (commonring->r_ptr == 0) -- goto again; -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/357-0002-brcmfmac-remove-chipinfo-debugfs-entry.patch -+++ /dev/null -@@ -1,39 +0,0 @@ --From: Arend van Spriel --Date: Mon, 8 Jun 2015 14:38:33 +0200 --Subject: [PATCH] brcmfmac: remove chipinfo debugfs entry -- --The information provided by chipinfo is also provided by the --revinfo debugfs entry. Removing it from debugfs. -- --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.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/debug.c --@@ -41,15 +41,6 @@ void brcmf_debugfs_exit(void) -- root_folder = NULL; -- } -- ---static int brcmf_debugfs_chipinfo_read(struct seq_file *seq, void *data) ---{ --- struct brcmf_bus *bus = dev_get_drvdata(seq->private); --- --- seq_printf(seq, "chip: %x(%u) rev %u\n", --- bus->chip, bus->chip, bus->chiprev); --- return 0; ---} --- -- int brcmf_debugfs_attach(struct brcmf_pub *drvr) -- { -- struct device *dev = drvr->bus_if->dev; --@@ -58,7 +49,6 @@ int brcmf_debugfs_attach(struct brcmf_pu -- return -ENODEV; -- -- drvr->dbgfs_dir = debugfs_create_dir(dev_name(dev), root_folder); --- brcmf_debugfs_add_entry(drvr, "chipinfo", brcmf_debugfs_chipinfo_read); -- -- return PTR_ERR_OR_ZERO(drvr->dbgfs_dir); -- } -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/357-0003-brcmfmac-remove-watchdog-reset-from-brcmf_pcie_busco.patch -+++ /dev/null -@@ -1,53 +0,0 @@ --From: Arend van Spriel --Date: Mon, 8 Jun 2015 14:38:34 +0200 --Subject: [PATCH] brcmfmac: remove watchdog reset from -- brcmf_pcie_buscoreprep() -- --The watchdog reset as done in brcmf_pcie_buscoreprep() is not --sufficient. It needs to modify PCIe core registers as well --which is properly done by brcmf_pcie_reset_device() after the --chip recognition is done. So the faulty watchdog reset can be --removed as it was causing driver reload to fail and hang the --system requiring a power-cycle. Instead the call to to the --brcmf_pcie_reset_device() function is done twice in the unload. -- --Reviewed-by: Hante Meuleman --Reviewed-by: Daniel (Deognyoun) Kim --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/pcie.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c --@@ -1629,20 +1629,7 @@ static void brcmf_pcie_buscore_write32(v -- -- static int brcmf_pcie_buscoreprep(void *ctx) -- { --- struct brcmf_pciedev_info *devinfo = (struct brcmf_pciedev_info *)ctx; --- int err; --- --- err = brcmf_pcie_get_resource(devinfo); --- if (err == 0) { --- /* Set CC watchdog to reset all the cores on the chip to bring --- * back dongle to a sane state. --- */ --- brcmf_pcie_buscore_write32(ctx, CORE_CC_REG(SI_ENUM_BASE, --- watchdog), 4); --- msleep(100); --- } --- --- return err; --+ return brcmf_pcie_get_resource(ctx); -- } -- -- --@@ -1824,6 +1811,7 @@ brcmf_pcie_remove(struct pci_dev *pdev) -- brcmf_pcie_intr_disable(devinfo); -- -- brcmf_detach(&pdev->dev); --+ brcmf_pcie_reset_device(devinfo); -- -- kfree(bus->bus_priv.pcie); -- kfree(bus->msgbuf->flowrings); -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/357-0004-brcmfmac-use-debugfs_create_devm_seqfile-helper-func.patch -+++ /dev/null -@@ -1,69 +0,0 @@ --From: Arend van Spriel --Date: Mon, 8 Jun 2015 14:38:35 +0200 --Subject: [PATCH] brcmfmac: use debugfs_create_devm_seqfile() helper -- function -- --Some time ago the function debugfs_create_devm_seqfile() was --introduced in debugfs. The caller simply needs to provide a --device pointer and read function. The function brcmf_debugfs_add_entry() --is now simply a wrapper only doing the work for CONFIG_BRCMDBG. -- --Reviewed-by: Hante Meuleman --Reviewed-by: Franky (Zhenhui) Lin --Reviewed-by: Daniel (Deognyoun) Kim --Reviewed-by: Pieter-Paul Giesberts --Signed-off-by: Arend van Spriel --Signed-off-by: Kalle Valo ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/debug.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/debug.c --@@ -64,44 +64,12 @@ struct dentry *brcmf_debugfs_get_devdir( -- return drvr->dbgfs_dir; -- } -- ---struct brcmf_debugfs_entry { --- int (*read)(struct seq_file *seq, void *data); --- struct brcmf_pub *drvr; ---}; --- ---static int brcmf_debugfs_entry_open(struct inode *inode, struct file *f) ---{ --- struct brcmf_debugfs_entry *entry = inode->i_private; --- --- return single_open(f, entry->read, entry->drvr->bus_if->dev); ---} --- ---static const struct file_operations brcmf_debugfs_def_ops = { --- .owner = THIS_MODULE, --- .open = brcmf_debugfs_entry_open, --- .release = single_release, --- .read = seq_read, --- .llseek = seq_lseek ---}; --- -- int brcmf_debugfs_add_entry(struct brcmf_pub *drvr, const char *fn, -- int (*read_fn)(struct seq_file *seq, void *data)) -- { --- struct dentry *dentry = drvr->dbgfs_dir; --- struct brcmf_debugfs_entry *entry; --- --- if (IS_ERR_OR_NULL(dentry)) --- return -ENOENT; --- --- entry = devm_kzalloc(drvr->bus_if->dev, sizeof(*entry), GFP_KERNEL); --- if (!entry) --- return -ENOMEM; --- --- entry->read = read_fn; --- entry->drvr = drvr; --- --- dentry = debugfs_create_file(fn, S_IRUGO, dentry, entry, --- &brcmf_debugfs_def_ops); --+ struct dentry *e; -- --- return PTR_ERR_OR_ZERO(dentry); --+ e = debugfs_create_devm_seqfile(drvr->bus_if->dev, fn, --+ drvr->dbgfs_dir, read_fn); --+ return PTR_ERR_OR_ZERO(e); -- } -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/359-0001-brcmfmac-Check-if-firmware-supports-p2p.patch -+++ /dev/null -@@ -1,42 +0,0 @@ --From: Pontus Fuchs --Date: Thu, 11 Jun 2015 00:12:17 +0200 --Subject: [PATCH] brcmfmac: Check if firmware supports p2p -- --Add a feature flag to reflect the firmware's p2p capability. -- --Reviewed-by: Pieter-Paul Giesberts --Reviewed-by: Hante Meuleman --Reviewed-by: Arend Van Spriel --Signed-off-by: Pontus Fuchs --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 --@@ -129,6 +129,7 @@ void brcmf_feat_attach(struct brcmf_pub -- brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_WOWL, "wowl"); -- 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"); -- -- /* set chip related quirks */ -- switch (drvr->bus_if->chip) { ----- a/drivers/net/wireless/brcm80211/brcmfmac/feature.h --+++ b/drivers/net/wireless/brcm80211/brcmfmac/feature.h --@@ -23,12 +23,14 @@ -- * MCHAN: multi-channel for concurrent P2P. -- * PNO: preferred network offload. -- * WOWL: Wake-On-WLAN. --+ * P2P: peer-to-peer -- */ -- #define BRCMF_FEAT_LIST \ -- BRCMF_FEAT_DEF(MBSS) \ -- BRCMF_FEAT_DEF(MCHAN) \ -- BRCMF_FEAT_DEF(PNO) \ --- BRCMF_FEAT_DEF(WOWL) --+ BRCMF_FEAT_DEF(WOWL) \ --+ BRCMF_FEAT_DEF(P2P) -- /* -- * Quirks: -- * -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/359-0002-brcmfmac-Build-wiphy-mode-and-interface-combinations.patch -+++ /dev/null -@@ -1,198 +0,0 @@ --From: Pontus Fuchs --Date: Thu, 11 Jun 2015 00:12:18 +0200 --Subject: [PATCH] brcmfmac: Build wiphy mode and interface combinations -- dynamically -- --Switch from using semi hard coded interface combinations. This makes --it easier to announce what the firmware actually supports. This fixes --the case where brcmfmac announces p2p but the firmware doesn't --support it. -- --Reviewed-by: Pieter-Paul Giesberts --Reviewed-by: Hante Meuleman --Reviewed-by: Arend Van Spriel --Signed-off-by: Pontus Fuchs --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 --@@ -52,8 +52,6 @@ -- #define BRCMF_PNO_SCAN_COMPLETE 1 -- #define BRCMF_PNO_SCAN_INCOMPLETE 0 -- ---#define BRCMF_IFACE_MAX_CNT 3 --- -- #define WPA_OUI "\x00\x50\xF2" /* WPA OUI */ -- #define WPA_OUI_TYPE 1 -- #define RSN_OUI "\x00\x0F\xAC" /* RSN OUI */ --@@ -5639,53 +5637,6 @@ static int brcmf_setup_wiphybands(struct -- return 0; -- } -- ---static const struct ieee80211_iface_limit brcmf_iface_limits_mbss[] = { --- { --- .max = 1, --- .types = BIT(NL80211_IFTYPE_STATION) | --- BIT(NL80211_IFTYPE_ADHOC) --- }, --- { --- .max = 4, --- .types = BIT(NL80211_IFTYPE_AP) --- }, --- { --- .max = 1, --- .types = BIT(NL80211_IFTYPE_P2P_CLIENT) | --- BIT(NL80211_IFTYPE_P2P_GO) --- }, --- { --- .max = 1, --- .types = BIT(NL80211_IFTYPE_P2P_DEVICE) --- } ---}; --- ---static const struct ieee80211_iface_limit brcmf_iface_limits_sbss[] = { --- { --- .max = 2, --- .types = BIT(NL80211_IFTYPE_STATION) | --- BIT(NL80211_IFTYPE_ADHOC) | --- BIT(NL80211_IFTYPE_AP) --- }, --- { --- .max = 1, --- .types = BIT(NL80211_IFTYPE_P2P_CLIENT) | --- BIT(NL80211_IFTYPE_P2P_GO) --- }, --- { --- .max = 1, --- .types = BIT(NL80211_IFTYPE_P2P_DEVICE) --- } ---}; ---static struct ieee80211_iface_combination brcmf_iface_combos[] = { --- { --- .max_interfaces = BRCMF_IFACE_MAX_CNT, --- .num_different_channels = 1, --- .n_limits = ARRAY_SIZE(brcmf_iface_limits_sbss), --- .limits = brcmf_iface_limits_sbss, --- } ---}; --- -- static const struct ieee80211_txrx_stypes -- brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = { -- [NL80211_IFTYPE_STATION] = { --@@ -5715,6 +5666,67 @@ brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = -- } -- }; -- --+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; --+ --+ combo = kzalloc(sizeof(*combo), GFP_KERNEL); --+ if (!combo) --+ goto err; --+ --+ limits = kzalloc(sizeof(*limits) * 4, GFP_KERNEL); --+ if (!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)) { --+ 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; --+ --+ wiphy->iface_combinations = combo; --+ wiphy->n_iface_combinations = 1; --+ return 0; --+ --+err: --+ kfree(limits); --+ kfree(combo); --+ return -ENOMEM; --+} --+ -- static void brcmf_wiphy_pno_params(struct wiphy *wiphy) -- { -- /* scheduled scan settings */ --@@ -5745,7 +5757,6 @@ static void brcmf_wiphy_wowl_params(stru -- static int brcmf_setup_wiphy(struct wiphy *wiphy, struct brcmf_if *ifp) -- { -- struct ieee80211_supported_band *band; --- struct ieee80211_iface_combination ifc_combo; -- __le32 bandlist[3]; -- u32 n_bands; -- int err, i; --@@ -5753,24 +5764,11 @@ static int brcmf_setup_wiphy(struct wiph -- wiphy->max_scan_ssids = WL_NUM_SCAN_MAX; -- wiphy->max_scan_ie_len = BRCMF_SCAN_IE_LEN_MAX; -- wiphy->max_num_pmkids = WL_NUM_PMKIDS_MAX; --- wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | --- BIT(NL80211_IFTYPE_ADHOC) | --- BIT(NL80211_IFTYPE_AP) | --- BIT(NL80211_IFTYPE_P2P_CLIENT) | --- BIT(NL80211_IFTYPE_P2P_GO) | --- BIT(NL80211_IFTYPE_P2P_DEVICE); --- /* need VSDB firmware feature for concurrent channels */ --- ifc_combo = brcmf_iface_combos[0]; --- if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MCHAN)) --- ifc_combo.num_different_channels = 2; --- if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS)) { --- ifc_combo.n_limits = ARRAY_SIZE(brcmf_iface_limits_mbss), --- ifc_combo.limits = brcmf_iface_limits_mbss; --- } --- wiphy->iface_combinations = kmemdup(&ifc_combo, --- sizeof(ifc_combo), --- GFP_KERNEL); --- wiphy->n_iface_combinations = ARRAY_SIZE(brcmf_iface_combos); --+ --+ err = brcmf_setup_ifmodes(wiphy, ifp); --+ if (err) --+ return err; --+ -- wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; -- wiphy->cipher_suites = __wl_cipher_suites; -- wiphy->n_cipher_suites = ARRAY_SIZE(__wl_cipher_suites); --@@ -6035,6 +6033,8 @@ static void brcmf_free_wiphy(struct wiph -- if (!wiphy) -- return; -- --+ if (wiphy->iface_combinations) --+ kfree(wiphy->iface_combinations->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/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/359-0003-brcmfmac-rework-.get_station-callback.patch -+++ /dev/null -@@ -1,326 +0,0 @@ --From: Arend van Spriel --Date: Thu, 11 Jun 2015 00:12:19 +0200 --Subject: [PATCH] brcmfmac: rework .get_station() callback -- --The .get_station() cfg80211 callback is used in several scenarios. In --managed mode it can obtain information about the access-point and its --BSS parameters. In managed mode it can also obtain information about --TDLS peers. In AP mode it can obtain information about connected --clients. -- --Reviewed-by: Hante Meuleman --Reviewed-by: Daniel (Deognyoun) Kim --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 --@@ -2395,27 +2395,80 @@ brcmf_cfg80211_reconfigure_wep(struct br -- brcmf_err("set wsec error (%d)\n", err); -- } -- --+static void brcmf_convert_sta_flags(u32 fw_sta_flags, struct station_info *si) --+{ --+ struct nl80211_sta_flag_update *sfu; --+ --+ brcmf_dbg(TRACE, "flags %08x\n", fw_sta_flags); --+ si->filled |= BIT(NL80211_STA_INFO_STA_FLAGS); --+ sfu = &si->sta_flags; --+ sfu->mask = BIT(NL80211_STA_FLAG_WME) | --+ BIT(NL80211_STA_FLAG_AUTHENTICATED) | --+ BIT(NL80211_STA_FLAG_ASSOCIATED) | --+ BIT(NL80211_STA_FLAG_AUTHORIZED); --+ if (fw_sta_flags & BRCMF_STA_WME) --+ sfu->set |= BIT(NL80211_STA_FLAG_WME); --+ if (fw_sta_flags & BRCMF_STA_AUTHE) --+ sfu->set |= BIT(NL80211_STA_FLAG_AUTHENTICATED); --+ if (fw_sta_flags & BRCMF_STA_ASSOC) --+ sfu->set |= BIT(NL80211_STA_FLAG_ASSOCIATED); --+ if (fw_sta_flags & BRCMF_STA_AUTHO) --+ sfu->set |= BIT(NL80211_STA_FLAG_AUTHORIZED); --+} --+ --+static void brcmf_fill_bss_param(struct brcmf_if *ifp, struct station_info *si) --+{ --+ struct { --+ __le32 len; --+ struct brcmf_bss_info_le bss_le; --+ } *buf; --+ u16 capability; --+ int err; --+ --+ buf = kzalloc(WL_BSS_INFO_MAX, GFP_KERNEL); --+ if (!buf) --+ return; --+ --+ buf->len = cpu_to_le32(WL_BSS_INFO_MAX); --+ err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BSS_INFO, buf, --+ WL_BSS_INFO_MAX); --+ if (err) { --+ brcmf_err("Failed to get bss info (%d)\n", err); --+ return; --+ } --+ si->filled |= BIT(NL80211_STA_INFO_BSS_PARAM); --+ si->bss_param.beacon_interval = le16_to_cpu(buf->bss_le.beacon_period); --+ si->bss_param.dtim_period = buf->bss_le.dtim_period; --+ capability = le16_to_cpu(buf->bss_le.capability); --+ if (capability & IEEE80211_HT_STBC_PARAM_DUAL_CTS_PROT) --+ si->bss_param.flags |= BSS_PARAM_FLAGS_CTS_PROT; --+ if (capability & WLAN_CAPABILITY_SHORT_PREAMBLE) --+ si->bss_param.flags |= BSS_PARAM_FLAGS_SHORT_PREAMBLE; --+ if (capability & WLAN_CAPABILITY_SHORT_SLOT_TIME) --+ si->bss_param.flags |= BSS_PARAM_FLAGS_SHORT_SLOT_TIME; --+} --+ -- static s32 -- brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev, -- const u8 *mac, struct station_info *sinfo) -- { -- struct brcmf_if *ifp = netdev_priv(ndev); --- struct brcmf_cfg80211_profile *profile = &ifp->vif->profile; --- struct brcmf_scb_val_le scb_val; --- int rssi; --- s32 rate; -- s32 err = 0; --- u8 *bssid = profile->bssid; -- struct brcmf_sta_info_le sta_info_le; --- u32 beacon_period; --- u32 dtim_period; --+ u32 sta_flags; --+ u32 is_tdls_peer; -- -- brcmf_dbg(TRACE, "Enter, MAC %pM\n", mac); -- if (!check_vif_up(ifp->vif)) -- return -EIO; -- --- if (brcmf_is_apmode(ifp->vif)) { --- memcpy(&sta_info_le, mac, ETH_ALEN); --+ memset(&sta_info_le, 0, sizeof(sta_info_le)); --+ memcpy(&sta_info_le, mac, ETH_ALEN); --+ err = brcmf_fil_iovar_data_get(ifp, "tdls_sta_info", --+ &sta_info_le, --+ sizeof(sta_info_le)); --+ is_tdls_peer = !err; --+ if (err) { -- err = brcmf_fil_iovar_data_get(ifp, "sta_info", -- &sta_info_le, -- sizeof(sta_info_le)); --@@ -2423,73 +2476,48 @@ brcmf_cfg80211_get_station(struct wiphy -- brcmf_err("GET STA INFO failed, %d\n", err); -- goto done; -- } --- sinfo->filled = BIT(NL80211_STA_INFO_INACTIVE_TIME); --- sinfo->inactive_time = le32_to_cpu(sta_info_le.idle) * 1000; --- if (le32_to_cpu(sta_info_le.flags) & BRCMF_STA_ASSOC) { --- sinfo->filled |= BIT(NL80211_STA_INFO_CONNECTED_TIME); --- sinfo->connected_time = le32_to_cpu(sta_info_le.in); --- } --- brcmf_dbg(TRACE, "STA idle time : %d ms, connected time :%d sec\n", --- sinfo->inactive_time, sinfo->connected_time); --- } else if (ifp->vif->wdev.iftype == NL80211_IFTYPE_STATION) { --- if (memcmp(mac, bssid, ETH_ALEN)) { --- brcmf_err("Wrong Mac address cfg_mac-%pM wl_bssid-%pM\n", --- mac, bssid); --- err = -ENOENT; --- goto done; --- } --- /* Report the current tx rate */ --- err = brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_RATE, &rate); --- if (err) { --- brcmf_err("Could not get rate (%d)\n", err); --- goto done; --- } else { --+ } --+ brcmf_dbg(TRACE, "version %d\n", le16_to_cpu(sta_info_le.ver)); --+ sinfo->filled = BIT(NL80211_STA_INFO_INACTIVE_TIME); --+ sinfo->inactive_time = le32_to_cpu(sta_info_le.idle) * 1000; --+ sta_flags = le32_to_cpu(sta_info_le.flags); --+ brcmf_convert_sta_flags(sta_flags, sinfo); --+ sinfo->sta_flags.mask |= BIT(NL80211_STA_FLAG_TDLS_PEER); --+ if (is_tdls_peer) --+ sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_TDLS_PEER); --+ else --+ sinfo->sta_flags.set &= ~BIT(NL80211_STA_FLAG_TDLS_PEER); --+ if (sta_flags & BRCMF_STA_ASSOC) { --+ sinfo->filled |= BIT(NL80211_STA_INFO_CONNECTED_TIME); --+ sinfo->connected_time = le32_to_cpu(sta_info_le.in); --+ brcmf_fill_bss_param(ifp, sinfo); --+ } --+ if (sta_flags & BRCMF_STA_SCBSTATS) { --+ sinfo->filled |= BIT(NL80211_STA_INFO_TX_FAILED); --+ sinfo->tx_failed = le32_to_cpu(sta_info_le.tx_failures); --+ sinfo->filled |= BIT(NL80211_STA_INFO_TX_PACKETS); --+ sinfo->tx_packets = le32_to_cpu(sta_info_le.tx_pkts); --+ sinfo->tx_packets += le32_to_cpu(sta_info_le.tx_mcast_pkts); --+ sinfo->filled |= BIT(NL80211_STA_INFO_RX_PACKETS); --+ sinfo->rx_packets = le32_to_cpu(sta_info_le.rx_ucast_pkts); --+ 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 = rate * 5; --- brcmf_dbg(CONN, "Rate %d Mbps\n", rate / 2); --+ sinfo->txrate.legacy = le32_to_cpu(sta_info_le.tx_rate); --+ sinfo->txrate.legacy /= 100; -- } --- --- if (test_bit(BRCMF_VIF_STATUS_CONNECTED, --- &ifp->vif->sme_state)) { --- memset(&scb_val, 0, sizeof(scb_val)); --- err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_RSSI, --- &scb_val, sizeof(scb_val)); --- if (err) { --- brcmf_err("Could not get rssi (%d)\n", err); --- goto done; --- } else { --- rssi = le32_to_cpu(scb_val.val); --- sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL); --- sinfo->signal = rssi; --- brcmf_dbg(CONN, "RSSI %d dBm\n", rssi); --- } --- err = brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_BCNPRD, --- &beacon_period); --- if (err) { --- brcmf_err("Could not get beacon period (%d)\n", --- err); --- goto done; --- } else { --- sinfo->bss_param.beacon_interval = --- beacon_period; --- brcmf_dbg(CONN, "Beacon peroid %d\n", --- beacon_period); --- } --- err = brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_DTIMPRD, --- &dtim_period); --- if (err) { --- brcmf_err("Could not get DTIM period (%d)\n", --- err); --- goto done; --- } else { --- sinfo->bss_param.dtim_period = dtim_period; --- brcmf_dbg(CONN, "DTIM peroid %d\n", --- dtim_period); --- } --- sinfo->filled |= BIT(NL80211_STA_INFO_BSS_PARAM); --+ 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; --+ } --+ if (le16_to_cpu(sta_info_le.ver) >= 4) { --+ sinfo->filled |= BIT(NL80211_STA_INFO_TX_BYTES); --+ sinfo->tx_bytes = le64_to_cpu(sta_info_le.tx_tot_bytes); --+ sinfo->filled |= BIT(NL80211_STA_INFO_RX_BYTES); --+ sinfo->rx_bytes = le64_to_cpu(sta_info_le.rx_tot_bytes); -- } --- } else --- err = -EPERM; --+ } -- done: -- brcmf_dbg(TRACE, "Exit\n"); -- return err; ----- a/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h --+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h --@@ -32,7 +32,11 @@ -- #define BRCMF_BSS_INFO_VERSION 109 /* curr ver of brcmf_bss_info_le struct */ -- #define BRCMF_BSS_RSSI_ON_CHANNEL 0x0002 -- ---#define BRCMF_STA_ASSOC 0x10 /* Associated */ --+#define BRCMF_STA_WME 0x00000002 /* WMM association */ --+#define BRCMF_STA_AUTHE 0x00000008 /* Authenticated */ --+#define BRCMF_STA_ASSOC 0x00000010 /* Associated */ --+#define BRCMF_STA_AUTHO 0x00000020 /* Authorized */ --+#define BRCMF_STA_SCBSTATS 0x00004000 /* Per STA debug stats */ -- -- /* size of brcmf_scan_params not including variable length array */ -- #define BRCMF_SCAN_PARAMS_FIXED_SIZE 64 --@@ -113,6 +117,7 @@ -- #define BRCMF_WOWL_MAXPATTERNSIZE 128 -- -- #define BRCMF_COUNTRY_BUF_SZ 4 --+#define BRCMF_ANT_MAX 4 -- -- /* join preference types for join_pref iovar */ -- enum brcmf_join_pref_types { --@@ -456,25 +461,61 @@ struct brcmf_channel_info_le { -- }; -- -- struct brcmf_sta_info_le { --- __le16 ver; /* version of this struct */ --- __le16 len; /* length in bytes of this structure */ --- __le16 cap; /* sta's advertised capabilities */ --- __le32 flags; /* flags defined below */ --- __le32 idle; /* time since data pkt rx'd from sta */ --- u8 ea[ETH_ALEN]; /* Station address */ --- __le32 count; /* # rates in this set */ --- u8 rates[BRCMF_MAXRATES_IN_SET]; /* rates in 500kbps units */ --+ __le16 ver; /* version of this struct */ --+ __le16 len; /* length in bytes of this structure */ --+ __le16 cap; /* sta's advertised capabilities */ --+ __le32 flags; /* flags defined below */ --+ __le32 idle; /* time since data pkt rx'd from sta */ --+ u8 ea[ETH_ALEN]; /* Station address */ --+ __le32 count; /* # rates in this set */ --+ u8 rates[BRCMF_MAXRATES_IN_SET]; /* rates in 500kbps units */ -- /* w/hi bit set if basic */ --- __le32 in; /* seconds elapsed since associated */ --- __le32 listen_interval_inms; /* Min Listen interval in ms for STA */ --- __le32 tx_pkts; /* # of packets transmitted */ --- __le32 tx_failures; /* # of packets failed */ --- __le32 rx_ucast_pkts; /* # of unicast packets received */ --- __le32 rx_mcast_pkts; /* # of multicast packets received */ --- __le32 tx_rate; /* Rate of last successful tx frame */ --- __le32 rx_rate; /* Rate of last successful rx frame */ --- __le32 rx_decrypt_succeeds; /* # of packet decrypted successfully */ --- __le32 rx_decrypt_failures; /* # of packet decrypted failed */ --+ __le32 in; /* seconds elapsed since associated */ --+ __le32 listen_interval_inms; /* Min Listen interval in ms for STA */ --+ __le32 tx_pkts; /* # of packets transmitted */ --+ __le32 tx_failures; /* # of packets failed */ --+ __le32 rx_ucast_pkts; /* # of unicast packets received */ --+ __le32 rx_mcast_pkts; /* # of multicast packets received */ --+ __le32 tx_rate; /* Rate of last successful tx frame */ --+ __le32 rx_rate; /* Rate of last successful rx frame */ --+ __le32 rx_decrypt_succeeds; /* # of packet decrypted successfully */ --+ __le32 rx_decrypt_failures; /* # of packet decrypted failed */ --+ __le32 tx_tot_pkts; /* # of tx pkts (ucast + mcast) */ --+ __le32 rx_tot_pkts; /* # of data packets recvd (uni + mcast) */ --+ __le32 tx_mcast_pkts; /* # of mcast pkts txed */ --+ __le64 tx_tot_bytes; /* data bytes txed (ucast + mcast) */ --+ __le64 rx_tot_bytes; /* data bytes recvd (ucast + mcast) */ --+ __le64 tx_ucast_bytes; /* data bytes txed (ucast) */ --+ __le64 tx_mcast_bytes; /* # data bytes txed (mcast) */ --+ __le64 rx_ucast_bytes; /* data bytes recvd (ucast) */ --+ __le64 rx_mcast_bytes; /* data bytes recvd (mcast) */ --+ s8 rssi[BRCMF_ANT_MAX]; /* per antenna rssi */ --+ s8 nf[BRCMF_ANT_MAX]; /* per antenna noise floor */ --+ __le16 aid; /* association ID */ --+ __le16 ht_capabilities; /* advertised ht caps */ --+ __le16 vht_flags; /* converted vht flags */ --+ __le32 tx_pkts_retry_cnt; /* # of frames where a retry was --+ * exhausted. --+ */ --+ __le32 tx_pkts_retry_exhausted; /* # of user frames where a retry --+ * was exhausted --+ */ --+ s8 rx_lastpkt_rssi[BRCMF_ANT_MAX]; /* Per antenna RSSI of last --+ * received data frame. --+ */ --+ /* TX WLAN retry/failure statistics: --+ * Separated for host requested frames and locally generated frames. --+ * Include unicast frame only where the retries/failures can be counted. --+ */ --+ __le32 tx_pkts_total; /* # user frames sent successfully */ --+ __le32 tx_pkts_retries; /* # user frames retries */ --+ __le32 tx_pkts_fw_total; /* # FW generated sent successfully */ --+ __le32 tx_pkts_fw_retries; /* # retries for FW generated frames */ --+ __le32 tx_pkts_fw_retry_exhausted; /* # FW generated where a retry --+ * was exhausted --+ */ --+ __le32 rx_pkts_retried; /* # rx with retry bit set */ --+ __le32 tx_rate_fallback; /* lowest fallback TX rate */ -- }; -- -- struct brcmf_chanspec_list { -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/359-0004-brcmfmac-have-sdio-return-EIO-when-device-communicat.patch -+++ /dev/null -@@ -1,56 +0,0 @@ --From: Arend van Spriel --Date: Thu, 11 Jun 2015 00:12:20 +0200 --Subject: [PATCH] brcmfmac: have sdio return -EIO when device communication -- is not possible -- --The bus interface functions txctl and rxctl may be used while the device --can not be accessed, eg. upon driver .remove() callback. This patch will --immediately return -EIO when this is the case which speeds up the module --unload. -- --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/bcmsdh.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c --@@ -988,6 +988,7 @@ static void brcmf_sdiod_freezer_detach(s -- -- static int brcmf_sdiod_remove(struct brcmf_sdio_dev *sdiodev) -- { --+ sdiodev->state = BRCMF_SDIOD_DOWN; -- if (sdiodev->bus) { -- brcmf_sdio_remove(sdiodev->bus); -- sdiodev->bus = NULL; ----- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c --@@ -2820,6 +2820,8 @@ static int brcmf_sdio_bus_txdata(struct -- struct brcmf_sdio *bus = sdiodev->bus; -- -- brcmf_dbg(TRACE, "Enter: pkt: data %p len %d\n", pkt->data, pkt->len); --+ if (sdiodev->state != BRCMF_SDIOD_DATA) --+ return -EIO; -- -- /* Add space for the header */ -- skb_push(pkt, bus->tx_hdrlen); --@@ -2948,6 +2950,8 @@ brcmf_sdio_bus_txctl(struct device *dev, -- int ret; -- -- brcmf_dbg(TRACE, "Enter\n"); --+ if (sdiodev->state != BRCMF_SDIOD_DATA) --+ return -EIO; -- -- /* Send from dpc */ -- bus->ctrl_frame_buf = msg; --@@ -3238,6 +3242,8 @@ brcmf_sdio_bus_rxctl(struct device *dev, -- struct brcmf_sdio *bus = sdiodev->bus; -- -- brcmf_dbg(TRACE, "Enter\n"); --+ if (sdiodev->state != BRCMF_SDIOD_DATA) --+ return -EIO; -- -- /* Wait until control frame is available */ -- timeleft = brcmf_sdio_dcmd_resp_wait(bus, &bus->rxlen, &pending); -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/359-0005-ath9k-make-DMA-stop-related-messages-debug-only.patch -+++ /dev/null -@@ -1,74 +0,0 @@ --From: Felix Fietkau --Date: Thu, 2 Jul 2015 13:35:05 +0200 --Subject: [PATCH] ath9k: make DMA stop related messages debug-only -- --A long time ago, ath9k had issues during reset where the DMA engine --would stay active and could potentially corrupt memory. --To debug those issues, the driver would print warnings whenever they --occur. -- --Nowadays, these issues are gone and the primary cause of these messages --is if the MAC is stuck during reset or busy processing a long --transmission. This is fairly harmless, yet these messages continue to --worry users. -- --To reduce the number of bogus bug reports, turn these messages into --debug messages and count their occurence in the "reset" debugfs file. -- --Signed-off-by: Felix Fietkau ----- -- ----- a/drivers/net/wireless/ath/ath9k/debug.c --+++ b/drivers/net/wireless/ath/ath9k/debug.c --@@ -765,6 +765,8 @@ static int read_file_reset(struct seq_fi -- [RESET_TYPE_BEACON_STUCK] = "Stuck Beacon", -- [RESET_TYPE_MCI] = "MCI Reset", -- [RESET_TYPE_CALIBRATION] = "Calibration error", --+ [RESET_TX_DMA_ERROR] = "Tx DMA stop error", --+ [RESET_RX_DMA_ERROR] = "Rx DMA stop error", -- }; -- int i; -- ----- a/drivers/net/wireless/ath/ath9k/debug.h --+++ b/drivers/net/wireless/ath/ath9k/debug.h --@@ -50,6 +50,8 @@ enum ath_reset_type { -- RESET_TYPE_BEACON_STUCK, -- RESET_TYPE_MCI, -- RESET_TYPE_CALIBRATION, --+ RESET_TX_DMA_ERROR, --+ RESET_RX_DMA_ERROR, -- __RESET_TYPE_MAX -- }; -- ----- a/drivers/net/wireless/ath/ath9k/recv.c --+++ b/drivers/net/wireless/ath/ath9k/recv.c --@@ -496,10 +496,9 @@ bool ath_stoprecv(struct ath_softc *sc) -- -- if (!(ah->ah_flags & AH_UNPLUGGED) && -- unlikely(!stopped)) { --- ath_err(ath9k_hw_common(sc->sc_ah), --- "Could not stop RX, we could be " --- "confusing the DMA engine when we start RX up\n"); --- ATH_DBG_WARN_ON_ONCE(!stopped); --+ ath_dbg(ath9k_hw_common(sc->sc_ah), RESET, --+ "Failed to stop Rx DMA\n"); --+ RESET_STAT_INC(sc, RESET_RX_DMA_ERROR); -- } -- return stopped && !reset; -- } ----- a/drivers/net/wireless/ath/ath9k/xmit.c --+++ b/drivers/net/wireless/ath/ath9k/xmit.c --@@ -1896,8 +1896,11 @@ bool ath_drain_all_txq(struct ath_softc -- npend |= BIT(i); -- } -- --- if (npend) --- ath_err(common, "Failed to stop TX DMA, queues=0x%03x!\n", npend); --+ if (npend) { --+ RESET_STAT_INC(sc, RESET_TX_DMA_ERROR); --+ ath_dbg(common, RESET, --+ "Failed to stop TX DMA, queues=0x%03x!\n", npend); --+ } -- -- for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) { -- if (!ATH_TXQ_SETUP(sc, i)) -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/359-0006-brcmfmac-free-ifp-for-non-netdev-interface-in-p2p-mo.patch -+++ /dev/null -@@ -1,44 +0,0 @@ --From: Arend van Spriel --Date: Thu, 11 Jun 2015 00:12:21 +0200 --Subject: [PATCH] brcmfmac: free ifp for non-netdev interface in p2p module -- --Making it more clear by freeing the ifp in same place where the --vif object is freed. -- --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/core.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c --@@ -867,8 +867,6 @@ static void brcmf_del_if(struct brcmf_pu -- } -- /* unregister will take care of freeing it */ -- unregister_netdev(ifp->ndev); --- } else { --- kfree(ifp); -- } -- } -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c --@@ -2238,6 +2238,7 @@ static void brcmf_p2p_delete_p2pdev(stru -- { -- cfg80211_unregister_wdev(&vif->wdev); -- p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; --+ kfree(vif->ifp); -- brcmf_free_vif(vif); -- } -- --@@ -2361,6 +2362,8 @@ int brcmf_p2p_del_vif(struct wiphy *wiph -- break; -- -- case NL80211_IFTYPE_P2P_DEVICE: --+ brcmf_p2p_cancel_remain_on_channel(vif->ifp); --+ brcmf_p2p_deinit_discovery(p2p); -- brcmf_p2p_delete_p2pdev(p2p, vif); -- return 0; -- default: -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/359-0007-brcmfmac-move-p2p-attach-detach-functions.patch -+++ /dev/null -@@ -1,225 +0,0 @@ --From: Arend van Spriel --Date: Thu, 11 Jun 2015 00:12:22 +0200 --Subject: [PATCH] brcmfmac: move p2p attach/detach functions -- --Moving two functions in p2p.c as is so next change will be --easier to review. -- --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/p2p.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c --@@ -1908,105 +1908,6 @@ s32 brcmf_p2p_notify_rx_mgmt_p2p_probere -- -- -- /** --- * brcmf_p2p_attach() - attach for P2P. --- * --- * @cfg: driver private data for cfg80211 interface. --- */ ---s32 brcmf_p2p_attach(struct brcmf_cfg80211_info *cfg) ---{ --- 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; --- s32 err = 0; --- --- p2p = &cfg->p2p; --- p2p->cfg = cfg; --- --- drvr = cfg->pub; --- --- pri_ifp = drvr->iflist[0]; --- p2p_ifp = drvr->iflist[1]; --- --- p2p->bss_idx[P2PAPI_BSSCFG_PRIMARY].vif = pri_ifp->vif; --- --- 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); --- --- /* 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: --- return err; ---} --- --- ---/** --- * brcmf_p2p_detach() - detach P2P. --- * --- * @p2p: P2P specific data. --- */ ---void brcmf_p2p_detach(struct brcmf_p2p_info *p2p) ---{ --- struct brcmf_cfg80211_vif *vif; --- --- vif = p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif; --- if (vif != NULL) { --- brcmf_p2p_cancel_remain_on_channel(vif->ifp); --- brcmf_p2p_deinit_discovery(p2p); --- /* remove discovery interface */ --- brcmf_free_vif(vif); --- p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; --- } --- /* just set it all to zero */ --- memset(p2p, 0, sizeof(*p2p)); ---} --- ---/** -- * brcmf_p2p_get_current_chanspec() - Get current operation channel. -- * -- * @p2p: P2P specific data. --@@ -2425,3 +2326,102 @@ void brcmf_p2p_stop_device(struct wiphy -- clear_bit(BRCMF_VIF_STATUS_READY, &vif->sme_state); -- mutex_unlock(&cfg->usr_sync); -- } --+ --+/** --+ * brcmf_p2p_attach() - attach for P2P. --+ * --+ * @cfg: driver private data for cfg80211 interface. --+ */ --+s32 brcmf_p2p_attach(struct brcmf_cfg80211_info *cfg) --+{ --+ 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; --+ s32 err = 0; --+ --+ p2p = &cfg->p2p; --+ p2p->cfg = cfg; --+ --+ drvr = cfg->pub; --+ --+ pri_ifp = drvr->iflist[0]; --+ p2p_ifp = drvr->iflist[1]; --+ --+ p2p->bss_idx[P2PAPI_BSSCFG_PRIMARY].vif = pri_ifp->vif; --+ --+ 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); --+ --+ /* 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: --+ return err; --+} --+ --+/** --+ * brcmf_p2p_detach() - detach P2P. --+ * --+ * @p2p: P2P specific data. --+ */ --+void brcmf_p2p_detach(struct brcmf_p2p_info *p2p) --+{ --+ struct brcmf_cfg80211_vif *vif; --+ --+ vif = p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif; --+ if (vif != NULL) { --+ brcmf_p2p_cancel_remain_on_channel(vif->ifp); --+ brcmf_p2p_deinit_discovery(p2p); --+ /* remove discovery interface */ --+ brcmf_free_vif(vif); --+ p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; --+ } --+ /* just set it all to zero */ --+ memset(p2p, 0, sizeof(*p2p)); --+} --+ -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/359-0008-brcmfmac-assure-p2pdev-is-unregistered-upon-driver-u.patch -+++ /dev/null -@@ -1,63 +0,0 @@ --From: Arend van Spriel --Date: Thu, 11 Jun 2015 00:12:23 +0200 --Subject: [PATCH] brcmfmac: assure p2pdev is unregistered upon driver -- unload -- --When unloading the driver with a p2pdev interface it resulted in --a warning upon calling wiphy_unregister() and subsequently a crash --in the driver. This patch assures the p2pdev is unregistered calling --unregister_wdev() before doing the wiphy_unregister(). -- --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 --@@ -6206,10 +6206,8 @@ void brcmf_cfg80211_detach(struct brcmf_ -- if (!cfg) -- return; -- --- WARN_ON(!list_empty(&cfg->vif_list)); --- wiphy_unregister(cfg->wiphy); -- brcmf_btcoex_detach(cfg); --- brcmf_p2p_detach(&cfg->p2p); --+ wiphy_unregister(cfg->wiphy); -- wl_deinit_priv(cfg); -- brcmf_free_wiphy(cfg->wiphy); -- } ----- a/drivers/net/wireless/brcm80211/brcmfmac/core.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c --@@ -1098,6 +1098,7 @@ void brcmf_detach(struct device *dev) -- -- /* stop firmware event handling */ -- brcmf_fweh_detach(drvr); --+ brcmf_p2p_detach(&drvr->config->p2p); -- -- brcmf_bus_change_state(bus_if, BRCMF_BUS_DOWN); -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c --@@ -16,6 +16,7 @@ -- #include -- #include -- #include --+#include -- #include -- -- #include --@@ -2418,8 +2419,9 @@ void brcmf_p2p_detach(struct brcmf_p2p_i -- brcmf_p2p_cancel_remain_on_channel(vif->ifp); -- brcmf_p2p_deinit_discovery(p2p); -- /* remove discovery interface */ --- brcmf_free_vif(vif); --- p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; --+ rtnl_lock(); --+ brcmf_p2p_delete_p2pdev(p2p, vif); --+ rtnl_unlock(); -- } -- /* just set it all to zero */ -- memset(p2p, 0, sizeof(*p2p)); -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/360-0001-brcmfmac-fix-double-free-of-p2pdev-interface.patch -+++ /dev/null -@@ -1,27 +0,0 @@ --From: Arend van Spriel --Date: Mon, 15 Jun 2015 22:48:38 +0200 --Subject: [PATCH] brcmfmac: fix double free of p2pdev interface -- --When freeing the driver ifp pointer it should also be removed from --the driver interface list, which is what brcmf_remove_interface() --does. Otherwise, the ifp pointer will be freed twice triggering --a kernel oops. -- --Fixes: f37d69a4babc ("brcmfmac: free ifp for non-netdev interface in p2p module") --Reviewed-by: Pieter-Paul Giesberts --Reviewed-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 --@@ -2140,7 +2140,7 @@ static void brcmf_p2p_delete_p2pdev(stru -- { -- cfg80211_unregister_wdev(&vif->wdev); -- p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; --- kfree(vif->ifp); --+ brcmf_remove_interface(vif->ifp->drvr, vif->ifp->bssidx); -- brcmf_free_vif(vif); -- } -- -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/360-0002-brcmfmac-make-brcmf_p2p_detach-call-conditional.patch -+++ /dev/null -@@ -1,29 +0,0 @@ --From: Arend van Spriel --Date: Mon, 15 Jun 2015 22:48:39 +0200 --Subject: [PATCH] brcmfmac: make brcmf_p2p_detach() call conditional -- --During verification of error handling in brcmf_cfg80211_attach() a --null pointer dereference occurred upon calling brcmf_p2p_detach() --from brcmf_detach(). This should only be called when the --brcmf_cfg80211_attach() has succeeded. -- --Fixes: f7a40873d2fa ("brcmfmac: assure p2pdev is unregistered upon driver unload") --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/core.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c --@@ -1098,7 +1098,8 @@ void brcmf_detach(struct device *dev) -- -- /* stop firmware event handling */ -- brcmf_fweh_detach(drvr); --- brcmf_p2p_detach(&drvr->config->p2p); --+ if (drvr->config) --+ brcmf_p2p_detach(&drvr->config->p2p); -- -- brcmf_bus_change_state(bus_if, BRCMF_BUS_DOWN); -- -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/361-brcmfmac-set-wiphy-s-addresses-to-provide-valid-MACs.patch -+++ /dev/null -@@ -1,67 +0,0 @@ --From: Rafa? Mi?ecki --Date: Thu, 9 Jul 2015 17:07:08 +0200 --Subject: [PATCH] brcmfmac: set wiphy's addresses to provide valid MACs -- --Broadcom's firmware requires every BSS to use MAC address with unique --last few bits. The amount of bits may depend on a particular firmware, --it was verified to be 2 for BCM43602 one. --If this condition won't be fulfilled firmware will reject such MAC: --brcmfmac: _brcmf_set_mac_address: Setting cur_etheraddr failed, -52 -- --We don't want to simply set addr_mask as it would also disallow using --locally administrated bit. Instead let's build a list of addresses --manually enabling 0x2 bit for extra interfaces. -- --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 --@@ -5784,6 +5784,7 @@ 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; -- struct ieee80211_supported_band *band; -- __le32 bandlist[3]; -- u32 n_bands; --@@ -5797,6 +5798,19 @@ 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++) { --+ u8 *addr = drvr->addresses[i].addr; --+ --+ memcpy(addr, drvr->mac, ETH_ALEN); --+ if (i) { --+ addr[0] |= BIT(1); --+ addr[ETH_ALEN - 1] ^= i; --+ } --+ } --+ wiphy->addresses = drvr->addresses; --+ wiphy->n_addresses = i; --+ -- wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; -- wiphy->cipher_suites = __wl_cipher_suites; -- wiphy->n_cipher_suites = ARRAY_SIZE(__wl_cipher_suites); ----- a/drivers/net/wireless/brcm80211/brcmfmac/core.h --+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.h --@@ -21,6 +21,7 @@ -- #ifndef BRCMFMAC_CORE_H -- #define BRCMFMAC_CORE_H -- --+#include -- #include "fweh.h" -- -- #define TOE_TX_CSUM_OL 0x00000001 --@@ -118,6 +119,8 @@ struct brcmf_pub { -- /* Multicast data packets sent to dongle */ -- unsigned long tx_multicast; -- --+ struct mac_address addresses[BRCMF_MAX_IFS]; --+ -- struct brcmf_if *iflist[BRCMF_MAX_IFS]; -- -- struct mutex proto_block; -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/362-brcmfmac-dhd_sdio.c-use-existing-atomic_or-primitive.patch -+++ /dev/null -@@ -1,45 +0,0 @@ --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; --- --- 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); -- -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/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?= --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 --@@ -5785,7 +5785,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; --@@ -5798,8 +5800,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/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/363-0002-brcmfmac-correct-interface-combination-info.patch -+++ /dev/null -@@ -1,204 +0,0 @@ --From: Arend van Spriel --Date: Thu, 20 Aug 2015 22:06:03 +0200 --Subject: [PATCH] brcmfmac: correct interface combination info -- --The interface combination provided by brcmfmac did not truly reflect --the combinations supported by driver and/or firmware. -- --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 ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c --@@ -5694,63 +5694,132 @@ brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = -- } -- }; -- --+/** --+ * 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; -- } --@@ -6079,11 +6148,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/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/363-0003-brcmfmac-add-debugfs-entry-for-msgbuf-statistics.patch -+++ /dev/null -@@ -1,87 +0,0 @@ --From: Franky Lin --Date: Thu, 20 Aug 2015 22:06:04 +0200 --Subject: [PATCH] brcmfmac: add debugfs entry for msgbuf statistics -- --Expose ring buffer read/write pointers and other useful statistics --through debugfs. -- --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 ----- -- ----- 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 -- } -- } -- --+#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; --+ --+ 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); --+ } --+ --+ 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: -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/363-0004-brcmfmac-make-use-of-cfg80211_check_combinations.patch -+++ /dev/null -@@ -1,83 +0,0 @@ --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) --@@ -662,8 +692,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: --@@ -822,8 +858,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/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/363-0005-brcmfmac-block-the-correct-flowring-when-backup-queu.patch -+++ /dev/null -@@ -1,48 +0,0 @@ --From: Franky Lin --Date: Thu, 20 Aug 2015 22:06:06 +0200 --Subject: [PATCH] brcmfmac: block the correct flowring when backup queue -- overflow -- --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. -- --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 ----- -- ----- 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); -- -- ring = flow->rings[flowid]; --+ if (ring->blocked == blocked) { --+ spin_unlock_irqrestore(&flow->block_lock, flags); --+ return; --+ } -- ifidx = brcmf_flowring_ifidx_get(flow, flowid); -- -- 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/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/363-0006-brcmfmac-bump-highest-event-number-for-4339-firmware.patch -+++ /dev/null -@@ -1,52 +0,0 @@ --From: Arend van Spriel --Date: Thu, 20 Aug 2015 22:06:07 +0200 --Subject: [PATCH] brcmfmac: bump highest event number for 4339 firmware -- --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. -- --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 ----- -- ----- 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) -- -- #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 -- -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/365-0001-brcmfmac-consolidate-ifp-lookup-in-driver-core.patch -+++ /dev/null -@@ -1,138 +0,0 @@ --From: Arend van Spriel --Date: Wed, 26 Aug 2015 22:14:53 +0200 --Subject: [PATCH] brcmfmac: consolidate ifp lookup in driver core -- --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. -- --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/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) -- { -- 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; -- } --- /* 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; --+ --+ *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) --+{ --+ 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]; --+} --+ -- 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 -- -- /* 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; -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/365-0002-brcmfmac-make-brcmf_proto_hdrpull-return-struct-brcm.patch -+++ /dev/null -@@ -1,222 +0,0 @@ --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 -- --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 ----- -- ----- 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 -- } -- -- 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; --+ --+ /* assure protocol is always called with --+ * non-null initialized pointer. --+ */ --+ 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) -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/365-0003-brcmfmac-change-parameters-for-brcmf_remove_interfac.patch -+++ /dev/null -@@ -1,87 +0,0 @@ --From: Arend van Spriel --Date: Wed, 26 Aug 2015 22:14:55 +0200 --Subject: [PATCH] brcmfmac: change parameters for -- brcmf_remove_interface() -- --Just pass the interface to be removed, ie. 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 ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c --@@ -4982,7 +4982,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/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 -- } -- } -- ---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; --+ --+ brcmf_fws_del_interface(ifp); --+ brcmf_del_if(ifp->drvr, ifp->bssidx); -- } -- -- 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 -- { -- 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); -- } -- -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/365-0004-brcmfmac-only-call-brcmf_cfg80211_detach-when-attach.patch -+++ /dev/null -@@ -1,92 +0,0 @@ --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 -- --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: -- -- 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 ----- -- ----- 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; --+ } -- if (drvr->fws) { -- brcmf_fws_del_interface(ifp); -- brcmf_fws_deinit(drvr); -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/365-0005-brcmfmac-correct-detection-of-p2pdev-interface-event.patch -+++ /dev/null -@@ -1,105 +0,0 @@ --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/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/365-0006-brcmfmac-use-brcmf_get_ifp-to-map-ifidx-to-struct-br.patch -+++ /dev/null -@@ -1,126 +0,0 @@ --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 -- --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. -- --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/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 --@@ -6212,7 +6212,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); -- } -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/365-0007-brcmfmac-pass-struct-brcmf_if-instance-in-brcmf_txfi.patch -+++ /dev/null -@@ -1,122 +0,0 @@ --From: Arend van Spriel --Date: Wed, 26 Aug 2015 22:14:59 +0200 --Subject: [PATCH] brcmfmac: pass struct brcmf_if instance in -- brcmf_txfinalize() -- --Most call sites of brcmf_txfinalize already have struct brcmf_if --instance so pass that to brcmf_txfinalize() as the function --needs it anyway. -- --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 --@@ -560,17 +560,11 @@ void brcmf_rx_frame(struct device *dev, -- brcmf_netif_rx(ifp, skb); -- } -- ---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; -- --- ifp = drvr->iflist[ifidx]; --- if (!ifp) --- goto done; --- -- eh = (struct ethhdr *)(txp->data); -- type = ntohs(eh->h_proto); -- --@@ -582,7 +576,7 @@ void brcmf_txfinalize(struct brcmf_pub * -- -- 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; -- } -- --@@ -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? --+ */ --+ brcmf_txfinalize(brcmf_get_ifp(msgbuf->drvr, tx_status->msg.ifidx), --+ skb, true); -- } -- -- -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/365-0008-brcmfmac-add-mapping-for-interface-index-to-bsscfg-i.patch -+++ /dev/null -@@ -1,92 +0,0 @@ --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/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/365-0009-brcmfmac-add-dedicated-debug-level-for-firmware-cons.patch -+++ /dev/null -@@ -1,103 +0,0 @@ --From: Arend van Spriel --Date: Wed, 26 Aug 2015 22:15:01 +0200 --Subject: [PATCH] brcmfmac: add dedicated debug level for firmware -- console logging -- --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. -- --Reviewed-by: Hante Meuleman --Reviewed-by: Franky (Zhenhui) Lin --Reviewed-by: Pieter-Paul Giesberts --Reviewed-by: Pontus Fuchs --Signed-off-by: Arend van Spriel ----- -- ----- 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); -- } -- --@@ -656,6 +656,9 @@ static void brcmf_pcie_bus_console_read( -- u8 ch; -- u32 newidx; -- --+ if (!BRCMF_FWCON_ON()) --+ return; --+ -- 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; --+ -- 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) { -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/365-0010-brcmfmac-remove-ifidx-parameter-from-brcmf_fws_txsta.patch -+++ /dev/null -@@ -1,34 +0,0 @@ --From: Arend van Spriel --Date: Wed, 26 Aug 2015 22:15:02 +0200 --Subject: [PATCH] brcmfmac: remove ifidx parameter from -- brcmf_fws_txstatus_suppressed() -- --The brcmf_fws_txstatus_suppressed() function prototype specifies an --ifidx parameter which is not used within the function implementation. -- --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/fwsignal.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c --@@ -1398,7 +1398,7 @@ done: -- } -- -- 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; -- } -- 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); -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/365-0011-brcmfmac-change-prototype-for-brcmf_fws_hdrpull.patch -+++ /dev/null -@@ -1,97 +0,0 @@ --From: Arend van Spriel --Date: Wed, 26 Aug 2015 22:15:03 +0200 --Subject: [PATCH] brcmfmac: change prototype for brcmf_fws_hdrpull() -- --Instead of passing ifidx and drvr just pass struct brcmf_if pointer --which holds both parameters. -- --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/bcdc.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcdc.c --@@ -312,8 +312,7 @@ brcmf_proto_bcdc_hdrpull(struct brcmf_pu -- -- 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) -- { -- 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; -- } -- -- 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); -- -- void brcmf_fws_reset_interface(struct brcmf_if *ifp); -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/365-0012-brcmfmac-introduce-brcmf_net_detach-function.patch -+++ /dev/null -@@ -1,99 +0,0 @@ --From: Arend van Spriel --Date: Wed, 26 Aug 2015 22:15:04 +0200 --Subject: [PATCH] brcmfmac: introduce brcmf_net_detach() function -- --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. -- --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 ----- -- ----- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c --+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c --@@ -4746,7 +4746,8 @@ void brcmf_cfg80211_free_netdev(struct n -- ifp = netdev_priv(ndev); -- vif = ifp->vif; -- --- brcmf_free_vif(vif); --+ if (vif) --+ brcmf_free_vif(vif); -- free_netdev(ndev); -- } -- ----- 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/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/366-brcmfmac-Reset-PCIE-devices-after-recognition.patch -+++ /dev/null -@@ -1,193 +0,0 @@ --From: Hante Meuleman --Date: Thu, 27 Aug 2015 16:14:06 +0200 --Subject: [PATCH] brcmfmac: Reset PCIE devices after recognition. -- --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. -- --Cc: Rafal Milecki --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 ----- -- ----- 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 -- --+/* 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; -- } --+ --+ if (ci->pub.ramsize > BRCMF_CHIP_MAX_MEMSIZE) { --+ brcmf_err("RAM size is incorrect\n"); --+ return -ENOMEM; --+ } --+ -- return 0; -- } -- --@@ -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); -- } -- ----- 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); -- }; ----- 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 * -- } -- -- --+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) -- { --@@ -1647,6 +1671,7 @@ static void brcmf_pcie_buscore_activate( -- -- 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); -- -- kfree(bus->bus_priv.pcie); -- kfree(bus->msgbuf->flowrings); -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/367-ath10k-fix-DMA-related-firmware-crashes-on-multiple-.patch -+++ /dev/null -@@ -1,24 +0,0 @@ --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 --@@ -253,7 +253,7 @@ struct ath10k_pktlog_hdr { -- #define TARGET_10X_MAX_FRAG_ENTRIES 0 -- -- /* 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 3 -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/368-ath9k-declare-required-extra-tx-headroom.patch -+++ /dev/null -@@ -1,22 +0,0 @@ --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 --@@ -867,6 +867,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/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/369-mac80211-initialize-tid-field-in-struct-ieee80211_tx.patch -+++ /dev/null -@@ -1,21 +0,0 @@ --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 --@@ -3323,9 +3323,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/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 -+++ b/package/kernel/mac80211/patches/400-ath_move_debug_code.patch -@@ -14,7 +14,7 @@ - ccflags-y += -D__CHECK_ENDIAN__ - --- a/drivers/net/wireless/ath/ath.h - +++ b/drivers/net/wireless/ath/ath.h --@@ -316,13 +316,6 @@ void _ath_dbg(struct ath_common *common, -+@@ -318,13 +318,6 @@ void _ath_dbg(struct ath_common *common, - #endif /* CPTCFG_ATH_DEBUG */ - - /** 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..7351353 100644 ---- a/package/kernel/mac80211/patches/402-ath_regd_optional.patch -+++ b/package/kernel/mac80211/patches/402-ath_regd_optional.patch -@@ -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= -+@@ -125,6 +125,7 @@ ADM8211= - ATH_COMMON= -- 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..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 -+@@ -2411,6 +2411,8 @@ void regulatory_hint_country_ie(struct w - enum environment_cap env = ENVIRON_ANY; - struct regulatory_request *request = NULL, *lr; - -@@ -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( -+@@ -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 -+++ b/package/kernel/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch -@@ -1,6 +1,6 @@ - --- a/drivers/net/wireless/ath/ath9k/init.c - +++ b/drivers/net/wireless/ath/ath9k/init.c --@@ -715,6 +715,7 @@ static const struct ieee80211_iface_limi -+@@ -722,6 +722,7 @@ static const struct ieee80211_iface_limi - BIT(NL80211_IFTYPE_AP) }, - { .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..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 ++++++++++++++++++++++++++++++++ - debugfs_create_file("antenna", S_IWUSR | S_IRUSR, phydir, ah, - --- a/drivers/net/wireless/ath/ath5k/ath5k.h - +++ b/drivers/net/wireless/ath/ath5k/ath5k.h --@@ -1371,6 +1371,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/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 -+++ b/package/kernel/mac80211/patches/510-ath9k_intr_mitigation_tweak.patch -@@ -1,6 +1,6 @@ - --- a/drivers/net/wireless/ath/ath9k/hw.c - +++ b/drivers/net/wireless/ath/ath9k/hw.c --@@ -389,13 +389,8 @@ static void ath9k_hw_init_config(struct -+@@ -390,13 +390,8 @@ static void ath9k_hw_init_config(struct - - ah->config.rx_intr_mitigation = true; - -@@ -14,5 +14,5 @@ - + ah->config.rimt_last = 250; - + ah->config.rimt_first = 500; - -- /* -- * We need this for PCI devices only (Cardbus, PCI, miniPCI) -+ if (AR_SREV_9462(ah) || AR_SREV_9565(ah)) -+ ah->config.pll_pwrsave = 7; -diff --git a/package/kernel/mac80211/patches/511-ath9k_reduce_rxbuf.patch b/package/kernel/mac80211/patches/511-ath9k_reduce_rxbuf.patch -index d4104f0..6766111 100644 ---- a/package/kernel/mac80211/patches/511-ath9k_reduce_rxbuf.patch -+++ b/package/kernel/mac80211/patches/511-ath9k_reduce_rxbuf.patch -@@ -1,6 +1,6 @@ - --- a/drivers/net/wireless/ath/ath9k/ath9k.h - +++ b/drivers/net/wireless/ath/ath9k/ath9k.h --@@ -87,7 +87,7 @@ int ath_descdma_setup(struct ath_softc * -+@@ -88,7 +88,7 @@ int ath_descdma_setup(struct ath_softc * - (_l) &= ((_sz) - 1); \ - } while (0) - -diff --git a/package/kernel/mac80211/patches/513-ath9k_add_pci_ids.patch b/package/kernel/mac80211/patches/513-ath9k_add_pci_ids.patch -index 40b5c81..c84d1bc 100644 ---- a/package/kernel/mac80211/patches/513-ath9k_add_pci_ids.patch -+++ b/package/kernel/mac80211/patches/513-ath9k_add_pci_ids.patch -@@ -1,6 +1,6 @@ - --- a/drivers/net/wireless/ath/ath9k/hw.c - +++ b/drivers/net/wireless/ath/ath9k/hw.c --@@ -647,6 +647,7 @@ int ath9k_hw_init(struct ath_hw *ah) -+@@ -651,6 +651,7 @@ int ath9k_hw_init(struct ath_hw *ah) - - /* 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..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 { -+@@ -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,19 +26,19 @@ - * - * @chandef: the channel definition to tune to - * @radar_enabled: whether radar detection is enabled --@@ -1192,6 +1193,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; - + 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 { -- * @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. - * - + * @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 { -- -- 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 -+@@ -2229,6 +2229,19 @@ static int ieee80211_get_tx_power(struct - return 0; - } - -@@ -77,7 +77,7 @@ - static int ieee80211_set_wds_peer(struct wiphy *wiphy, struct net_device *dev, - const u8 *addr) - { --@@ -3771,6 +3784,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, -@@ -87,7 +87,7 @@ - CFG80211_TESTMODE_CMD(ieee80211_testmode_cmd) - --- a/net/mac80211/ieee80211_i.h - +++ b/net/mac80211/ieee80211_i.h --@@ -1333,6 +1333,7 @@ struct ieee80211_local { -+@@ -1318,6 +1318,7 @@ struct ieee80211_local { - int dynamic_ps_forced_timeout; - - int user_power_level; /* in dBm, for all interfaces */ -@@ -97,7 +97,7 @@ - - --- a/net/mac80211/main.c - +++ b/net/mac80211/main.c --@@ -98,7 +98,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; -@@ -106,7 +106,7 @@ - u32 offchannel_flag; - - offchannel_flag = local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL; --@@ -155,6 +155,12 @@ static u32 ieee80211_hw_conf_chan(struct -+@@ -150,6 +150,12 @@ static u32 ieee80211_hw_conf_chan(struct - } - rcu_read_unlock(); - -@@ -119,7 +119,7 @@ - if (local->hw.conf.power_level != power) { - changed |= IEEE80211_CONF_CHANGE_POWER; - local->hw.conf.power_level = power; --@@ -578,6 +584,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; -@@ -129,7 +129,7 @@ - local->user_power_level = IEEE80211_UNSET_POWER_LEVEL; - --- a/net/wireless/nl80211.c - +++ b/net/wireless/nl80211.c --@@ -400,6 +400,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 }, -@@ -137,7 +137,7 @@ - }; - - /* policy for the key attributes */ --@@ -2206,6 +2207,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..5a5e464 100644 ---- a/package/kernel/mac80211/patches/530-ath9k_extra_leds.patch -+++ b/package/kernel/mac80211/patches/530-ath9k_extra_leds.patch -@@ -24,7 +24,7 @@ - struct ath_softc { - struct ieee80211_hw *hw; - struct device *dev; --@@ -1004,9 +1014,8 @@ struct ath_softc { -+@@ -1005,9 +1015,8 @@ struct ath_softc { - spinlock_t chan_lock; - - #ifdef CPTCFG_MAC80211_LEDS -@@ -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); - - - 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..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 @@ - debugfs_create_devm_seqfile(sc->dev, "interrupt", sc->debug.debugfs_phy, - --- a/drivers/net/wireless/ath/ath9k/hw.h - +++ b/drivers/net/wireless/ath/ath9k/hw.h --@@ -513,6 +513,12 @@ enum { -+@@ -519,6 +519,12 @@ enum { - ATH9K_RESET_COLD, - }; - -@@ -75,7 +75,7 @@ - struct ath9k_hw_version { - u32 magic; - u16 devid; --@@ -794,6 +800,8 @@ struct ath_hw { -+@@ -804,6 +810,8 @@ struct ath_hw { - u32 rfkill_polarity; - u32 ah_flags; - -@@ -84,7 +84,7 @@ - bool reset_power_on; - bool htc_reset_init; - --@@ -1055,6 +1063,7 @@ void ath9k_hw_check_nav(struct ath_hw *a -+@@ -1066,6 +1074,7 @@ void ath9k_hw_check_nav(struct ath_hw *a - bool ath9k_hw_check_alive(struct ath_hw *ah); - - bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode); -@@ -94,7 +94,7 @@ - struct ath_gen_timer *ath_gen_timer_alloc(struct ath_hw *ah, - --- 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 -+@@ -1819,6 +1819,20 @@ u32 ath9k_hw_get_tsf_offset(struct times - } - EXPORT_SYMBOL(ath9k_hw_get_tsf_offset); - -@@ -115,7 +115,7 @@ - int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, - struct ath9k_hw_cal_data *caldata, bool fastcc) - { --@@ -2012,6 +2026,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..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 @@ - --- a/drivers/net/wireless/ath/ath9k/hw.h - +++ b/drivers/net/wireless/ath/ath9k/hw.h --@@ -710,6 +710,7 @@ struct ath_spec_scan { -+@@ -720,6 +720,7 @@ struct ath_spec_scan { - * @config_pci_powersave: - * @calibrate: periodic calibration for NF, ANI, IQ, ADC gain, ADC-DC - * -@@ -8,7 +8,7 @@ - * @spectral_scan_config: set parameters for spectral scan and enable/disable it - * @spectral_scan_trigger: trigger a spectral scan run - * @spectral_scan_wait: wait for a spectral scan run to finish --@@ -732,6 +733,7 @@ struct ath_hw_ops { -+@@ -742,6 +743,7 @@ struct ath_hw_ops { - 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 -+@@ -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); - -@@ -65,7 +65,7 @@ - } - - static const struct ieee80211_iface_limit if_limits[] = { --@@ -896,6 +897,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); - } - -@@ -84,7 +84,7 @@ - int ath9k_init_device(u16 devid, struct ath_softc *sc, - const struct ath_bus_ops *bus_ops) - { --@@ -941,6 +954,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 - -@@ -110,7 +110,7 @@ - static inline void ath9k_hw_set_bt_ant_diversity(struct ath_hw *ah, bool enable) - --- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c - +++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c --@@ -1316,9 +1316,30 @@ void ar5008_hw_init_rate_txpower(struct -+@@ -1327,9 +1327,30 @@ void ar5008_hw_init_rate_txpower(struct - } - } - -@@ -141,7 +141,7 @@ - static const u32 ar5416_cca_regs[6] = { - AR_PHY_CCA, - AR_PHY_CH1_CCA, --@@ -1333,6 +1354,8 @@ int ar5008_hw_attach_phy_ops(struct ath_ -+@@ -1344,6 +1365,8 @@ int ar5008_hw_attach_phy_ops(struct ath_ - if (ret) - 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..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 @@ - --- a/drivers/net/wireless/ath/ath9k/hw.c - +++ b/drivers/net/wireless/ath/ath9k/hw.c --@@ -245,6 +245,19 @@ void ath9k_hw_get_channel_centers(struct -+@@ -246,6 +246,19 @@ void ath9k_hw_get_channel_centers(struct - centers->synth_center + (extoff * HT40_CHANNEL_CENTER_SHIFT); - } - -@@ -20,7 +20,7 @@ - /******************/ - /* Chip Revisions */ - /******************/ --@@ -1382,6 +1395,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); - -@@ -30,7 +30,7 @@ - return true; - } - --@@ -1481,6 +1497,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); - -@@ -40,7 +40,7 @@ - return true; - } - --@@ -1782,8 +1801,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); - -@@ -55,7 +55,7 @@ - return -EINVAL; - } - --@@ -2037,6 +2062,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..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 @@ - --- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c - +++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c --@@ -945,55 +945,6 @@ static bool ar5008_hw_ani_control_new(st -+@@ -956,55 +956,6 @@ static bool ar5008_hw_ani_control_new(st - * 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..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 -@@ -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 --+++ b/drivers/net/wireless/rt2x00/rt2800.h --@@ -2960,17 +2960,4 @@ enum rt2800_eeprom_word { -- */ -- #define BCN_TBTT_OFFSET 64 -- ---/* --- * RT2800 driver data structure --- */ ---struct rt2800_drv_data { --- u8 calibration_bw20; --- u8 calibration_bw40; --- u8 bbp25; --- u8 bbp26; --- u8 txmixer_gain_24g; --- u8 txmixer_gain_5g; --- unsigned int tbtt_tick; ---}; --- -- #endif /* RT2800_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 - -++#include "rt2800.h" -++ - +/* RT2800 driver data structure */ - +struct rt2800_drv_data { - + u8 calibration_bw20; -@@ -55,8 +37,30 @@ Changes since v1: --- - + u8 txmixer_gain_24g; - + u8 txmixer_gain_5g; - + unsigned int tbtt_tick; -++ DECLARE_BITMAP(sta_ids, STA_IDS_SIZE); - +}; - + - struct rt2800_ops { - void (*register_read)(struct rt2x00_dev *rt2x00dev, - const unsigned int offset, u32 *value); -+--- 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) -+ -+-/* -+- * RT2800 driver data structure -+- */ -+-struct rt2800_drv_data { -+- u8 calibration_bw20; -+- u8 calibration_bw40; -+- u8 bbp25; -+- u8 bbp26; -+- u8 txmixer_gain_24g; -+- u8 txmixer_gain_5g; -+- unsigned int tbtt_tick; -+- DECLARE_BITMAP(sta_ids, STA_IDS_SIZE); -+-}; -+- -+ #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..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 -@@ -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 --@@ -7747,6 +7747,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) - { -@@ -32,7 +32,7 @@ Changes since v1: - int retval; - u32 reg; - --@@ -7754,6 +7755,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; - -@@ -42,11 +42,11 @@ Changes since v1: - /* - * Allocate eeprom data. - */ ----- 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" - - +enum rt2800_flag { - + RT2800_HAS_HIGH_SHARED_MEM, -@@ -55,16 +55,16 @@ Changes since v1: - /* RT2800 driver data structure */ - struct rt2800_drv_data { - u8 calibration_bw20; --@@ -29,6 +33,8 @@ struct rt2800_drv_data { -- u8 txmixer_gain_24g; -+@@ -32,6 +36,8 @@ struct rt2800_drv_data { - u8 txmixer_gain_5g; - unsigned int tbtt_tick; -+ DECLARE_BITMAP(sta_ids, STA_IDS_SIZE); - + - + unsigned long rt2800_flags; - }; - - struct rt2800_ops { --@@ -61,6 +67,13 @@ struct rt2800_ops { -+@@ -64,6 +70,13 @@ struct rt2800_ops { - __le32 *(*drv_get_txwi)(struct queue_entry *entry); - }; - -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..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: --- - - /* - * Update WCID information --@@ -1437,8 +1467,11 @@ int rt2800_config_pairwise_key(struct rt -+@@ -1405,8 +1435,11 @@ int rt2800_config_pairwise_key(struct rt - sizeof(key_entry.rx_mic)); - - offset = PAIRWISE_KEY_ENTRY(key->hw_key_idx); -@@ -187,7 +187,7 @@ Changes since v1: --- - } - - /* --@@ -4908,14 +4941,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. - */ -@@ -207,7 +207,7 @@ Changes since v1: --- - } - - /* --@@ -5041,8 +5079,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. - */ -@@ -218,7 +218,7 @@ Changes since v1: --- - msleep(1); - - for (i = 0; i < REGISTER_BUSY_COUNT; i++) { --@@ -6738,11 +6778,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. - */ -@@ -239,7 +239,7 @@ Changes since v1: --- - msleep(1); - - /* --@@ -7751,6 +7799,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; - -@@ -248,22 +248,22 @@ Changes since v1: --- - retval = rt2800_probe_rt(rt2x00dev); - if (retval) - return retval; --@@ -7830,8 +7880,11 @@ void rt2800_get_tkip_seq(struct ieee8021 -- u32 offset; -+@@ -7809,8 +7859,11 @@ void rt2800_get_key_seq(struct ieee80211 -+ return; - -- offset = MAC_IVEIV_ENTRY(hw_key_idx); -+ offset = MAC_IVEIV_ENTRY(key->hw_key_idx); - + - + rt2800_shared_mem_lock(rt2x00dev); - rt2800_register_multiread(rt2x00dev, offset, - &iveiv_entry, sizeof(iveiv_entry)); - + rt2800_shared_mem_unlock(rt2x00dev); - -- memcpy(iv16, &iveiv_entry.iv[0], sizeof(*iv16)); -- memcpy(iv32, &iveiv_entry.iv[4], sizeof(*iv32)); ----- 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); - - unsigned long rt2800_flags; - + -@@ -274,7 +274,7 @@ Changes since v1: --- - }; - - struct rt2800_ops { --@@ -65,6 +70,10 @@ struct rt2800_ops { -+@@ -68,6 +73,10 @@ struct rt2800_ops { - const u8 *data, const size_t len); - int (*drv_init_registers)(struct rt2x00_dev *rt2x00dev); - __le32 *(*drv_get_txwi)(struct queue_entry *entry); -@@ -285,7 +285,7 @@ Changes since v1: --- - }; - - static inline bool rt2800_has_high_shared_mem(struct rt2x00_dev *rt2x00dev) --@@ -74,6 +83,29 @@ static inline bool rt2800_has_high_share -+@@ -77,6 +86,29 @@ static inline bool rt2800_has_high_share - 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. - */ --@@ -294,8 +315,10 @@ static int rt2800usb_write_firmware(stru -+@@ -299,8 +320,10 @@ static int rt2800usb_write_firmware(stru - data + offset, length); - } - -@@ -497,7 +497,7 @@ Changes since v1: --- - - /* - * Send firmware request to device to load firmware, --@@ -310,7 +333,10 @@ static int rt2800usb_write_firmware(stru -+@@ -315,7 +338,10 @@ static int rt2800usb_write_firmware(stru - } - - msleep(10); -@@ -508,7 +508,7 @@ Changes since v1: --- - - return 0; - } --@@ -328,8 +354,10 @@ static int rt2800usb_init_registers(stru -+@@ -333,8 +359,10 @@ static int rt2800usb_init_registers(stru - if (rt2800_wait_csr_ready(rt2x00dev)) - return -EBUSY; - -@@ -519,7 +519,7 @@ Changes since v1: --- - - reg = 0; - rt2x00_set_field32(®, MAC_SYS_CTRL_RESET_CSR, 1); --@@ -859,6 +887,9 @@ static const struct rt2800_ops rt2800usb -+@@ -863,6 +891,9 @@ static const struct rt2800_ops rt2800usb - .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..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 -@@ -18,13 +18,13 @@ new field with the actually used value. - - 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); -+--- 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) - { -@@ -32,7 +32,7 @@ Signed-off-by: Gabor Juhos - u32 reg; - u16 eeprom; - unsigned int i; --@@ -5003,7 +5004,7 @@ static int rt2800_init_registers(struct -+@@ -4980,7 +4981,7 @@ static int rt2800_init_registers(struct - /* - * Clear all beacons - */ -@@ -41,7 +41,7 @@ Signed-off-by: Gabor Juhos - rt2800_clear_beacon_register(rt2x00dev, i); - - if (rt2x00_is_usb(rt2x00dev)) { --@@ -7852,6 +7853,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); - -@@ -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 --@@ -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; - unsigned int tbtt_tick; - + unsigned int hw_beacon_count; -+ DECLARE_BITMAP(sta_ids, STA_IDS_SIZE); - - 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..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 -@@ -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 @@ - */ - #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 -+--- 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..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 -@@ -5,12 +5,12 @@ Subject: [PATCH] rt2x00: rt2800lib: fix max supported beacon count for RT3593 - - 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 -+--- 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..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 -@@ -5,12 +5,12 @@ Subject: [PATCH] rt2x00: rt2800lib: enable support 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 --@@ -7847,6 +7847,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..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 -@@ -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 --@@ -7465,6 +7465,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}, - }; - -@@ -98,7 +98,7 @@ Signed-off-by: Gabor Juhos - static const struct rf_channel rf_vals_5592_xtal20[] = { - /* Channel, N, K, mod, R */ - {1, 482, 4, 10, 3}, --@@ -7694,6 +7754,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..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 -@@ -5,12 +5,12 @@ Subject: [PATCH] rt2x00: rt2800lib: enable VCO calibration for RF3853 - - 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 -+--- 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: -@@ -18,7 +18,7 @@ Signed-off-by: Gabor Juhos - case RF5360: - case RF5362: - case RF5370: --@@ -7873,6 +7874,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..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 -@@ -6,12 +6,12 @@ Subject: [PATCH] rt2x00: rt2800lib: add channel configuration function for - - 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 -+--- 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 - } - } - -@@ -223,7 +223,7 @@ Signed-off-by: Gabor Juhos - #define POWER_BOUND 0x27 - #define POWER_BOUND_5G 0x2b - --@@ -3261,6 +3466,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..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 -@@ -5,12 +5,12 @@ Subject: [PATCH] rt2x00: rt2800lib: enable RF3853 support - - 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 -+--- 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..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 -@@ -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 --@@ -5005,6 +5005,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); - } -@@ -48,7 +48,7 @@ Signed-off-by: Gabor Juhos - } else if (rt2x00_rt(rt2x00dev, RT5390) || - rt2x00_rt(rt2x00dev, RT5392) || - rt2x00_rt(rt2x00dev, RT5592)) { --@@ -5035,9 +5041,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); -@@ -63,7 +63,7 @@ Signed-off-by: Gabor Juhos - rt2x00_set_field32(®, MAX_LEN_CFG_MAX_PSDU, 2); - else - rt2x00_set_field32(®, MAX_LEN_CFG_MAX_PSDU, 1); --@@ -5190,6 +5198,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..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 -@@ -6,12 +6,12 @@ Subject: [PATCH] rt2x00: rt2800lib: add BBP register initialization for - - 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 -+--- 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); - } - -@@ -59,7 +59,7 @@ Signed-off-by: Gabor Juhos - static void rt2800_init_bbp_53xx(struct rt2x00_dev *rt2x00dev) - { - int ant, div_mode; --@@ -6026,6 +6067,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..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 -@@ -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 { - /* - * 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 -+--- 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 */ - } - -@@ -166,7 +166,7 @@ Signed-off-by: Gabor Juhos - static void rt2800_init_rfcsr_5390(struct rt2x00_dev *rt2x00dev) - { - rt2800_rf_init_calibration(rt2x00dev, 2); --@@ -7074,6 +7212,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..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 -@@ -5,12 +5,12 @@ Subject: [PATCH] rt2x00: rt2800lib: force rf type to RF3853 on RT3883 - - 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 -+--- 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..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 -@@ -5,12 +5,12 @@ Subject: [PATCH] rt2x00: rt2800lib: add channel configuration code for RT3883 - - 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 -+--- 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); - } - -@@ -47,7 +47,7 @@ Signed-off-by: Gabor Juhos - static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev, - struct ieee80211_conf *conf, - struct rf_channel *rf, --@@ -3447,6 +3477,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); - -@@ -60,7 +60,7 @@ Signed-off-by: Gabor Juhos - switch (rt2x00dev->chip.rf) { - case RF2020: - case RF3020: --@@ -3530,6 +3566,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); -@@ -76,7 +76,7 @@ Signed-off-by: Gabor Juhos - } else { - 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 -+@@ -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); -@@ -84,7 +84,7 @@ Signed-off-by: Gabor Juhos - rt2800_bbp_write(rt2x00dev, 75, 0x46); - } else { - if (rt2x00_rt(rt2x00dev, RT3593)) --@@ -3550,19 +3596,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); - } -@@ -110,7 +110,7 @@ Signed-off-by: Gabor Juhos - rt2800_bbp_write(rt2x00dev, 83, 0x9a); - - if (rt2x00_has_cap_external_lna_a(rt2x00dev)) --@@ -3684,6 +3733,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..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 -@@ -5,12 +5,12 @@ Subject: [PATCH] rt2x00: rt2800lib: fix txpower_to_dev function for RT3883 - - 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 -+--- 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..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 -@@ -6,12 +6,12 @@ Subject: [PATCH] rt2x00: rt2800lib: use correct txpower calculation function - - 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 -+--- 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..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 -@@ -6,12 +6,12 @@ Subject: [PATCH] rt2x00: rt2800lib: hardcode txmixer gain values to zero for - - 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 -+--- 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; - -@@ -21,7 +21,7 @@ Signed-off-by: Gabor Juhos - return 0; - - rt2800_eeprom_read(rt2x00dev, EEPROM_TXMIXER_GAIN_BG, &word); --@@ -7507,7 +7508,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..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 -@@ -5,12 +5,12 @@ Subject: [PATCH] rt2x00: rt2800lib: use correct beacon count 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 --@@ -8428,7 +8428,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..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 -@@ -5,12 +5,12 @@ Subject: [PATCH] rt2x00: rt2800lib: fix antenna configuration 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 --@@ -1961,7 +1961,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..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 -@@ -5,12 +5,12 @@ Subject: [PATCH] rt2x00: rt2800lib: fix LNA gain configuration for RT3883 - - 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 -+--- 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) { -@@ -20,7 +20,7 @@ Signed-off-by: Gabor Juhos - rt2800_eeprom_read(rt2x00dev, EEPROM_EXT_LNA2, &eeprom); - lna_gain = rt2x00_get_field16(eeprom, - EEPROM_EXT_LNA2_A1); --@@ -1994,7 +1995,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..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 -@@ -5,12 +5,12 @@ Subject: [PATCH] rt2x00: rt2800lib: fix VGC setup for RT3883 - - 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 -+--- 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 */ -@@ -20,7 +20,7 @@ Signed-off-by: Gabor Juhos - vgc = 0x20 + (rt2x00dev->lna_gain * 5) / 3; - else if (rt2x00_rt(rt2x00dev, RT5592)) - vgc = 0x24 + (2 * rt2x00dev->lna_gain); --@@ -4855,7 +4856,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) || -@@ -30,7 +30,7 @@ Signed-off-by: Gabor Juhos - rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, - vgc_level); - } else if (rt2x00_rt(rt2x00dev, RT5592)) { --@@ -4902,6 +4904,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..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 -@@ -5,12 +5,12 @@ Subject: [PATCH] rt2x00: rt2800lib: fix EEPROM LNA validation for RT3883 - - 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 -+--- 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); -@@ -20,7 +20,7 @@ Signed-off-by: Gabor Juhos - if (rt2x00_get_field16(word, EEPROM_RSSI_BG2_LNA_A1) == 0x00 || - 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 -+@@ -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); -@@ -30,7 +30,7 @@ Signed-off-by: Gabor Juhos - if (rt2x00_get_field16(word, EEPROM_RSSI_A2_LNA_A2) == 0x00 || - 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 -+@@ -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..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 -@@ -5,12 +5,12 @@ Subject: [PATCH] rt2x00: rt2800lib: fix txpower compensation 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, 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 -+--- 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..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 -@@ -6,12 +6,12 @@ Subject: [PATCH] rt2x00: rt2800lib: enable RT2800_HAS_HIGH_SHARED_MEM for - - 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 -+--- 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..bc056cd 100644 ---- a/package/kernel/mac80211/patches/603-rt2x00-introduce-rt2x00eeprom.patch -+++ b/package/kernel/mac80211/patches/603-rt2x00-introduce-rt2x00eeprom.patch -@@ -1,15 +1,15 @@ - --- a/.local-symbols - +++ b/.local-symbols --@@ -263,6 +263,7 @@ RT2X00_LIB_FIRMWARE= -+@@ -329,6 +329,7 @@ RT2X00_LIB_FIRMWARE= - RT2X00_LIB_CRYPTO= - RT2X00_LIB_LEDS= - RT2X00_LIB_DEBUGFS= - +RT2X00_LIB_EEPROM= - RT2X00_DEBUG= -- RTL_CARDS= -- RTL8192CE= ----- 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 - 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 --@@ -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; - }; - -@@ -57,7 +57,7 @@ - struct rt2800_ops { - void (*register_read)(struct rt2x00_dev *rt2x00dev, - const unsigned int offset, u32 *value); --@@ -176,6 +178,15 @@ static inline int rt2800_read_eeprom(str -+@@ -179,6 +181,15 @@ static inline int rt2800_read_eeprom(str - { - 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..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 -@@ -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 -+--- 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; -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..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 --@@ -3552,11 +3552,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 - */ -@@ -19,7 +19,7 @@ - } else if (rt2x00_rt(rt2x00dev, RT3593)) { - if (rf->channel > 14) { - /* Disable CCK Packet detection on 5GHz */ --@@ -6618,6 +6625,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) - { -@@ -32,7 +32,7 @@ - rt2800_rf_init_calibration(rt2x00dev, 30); - - rt2800_rfcsr_write(rt2x00dev, 0, 0xf0); --@@ -6653,15 +6666,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); -@@ -66,7 +66,7 @@ - rt2800_rfcsr_write(rt2x00dev, 43, 0xdb); - rt2800_rfcsr_write(rt2x00dev, 44, 0xdb); - rt2800_rfcsr_write(rt2x00dev, 45, 0xdb); --@@ -6669,15 +6697,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); -@@ -96,7 +96,7 @@ - rt2800_rfcsr_write(rt2x00dev, 59, 0x00); - rt2800_rfcsr_write(rt2x00dev, 60, 0x00); - rt2800_rfcsr_write(rt2x00dev, 61, 0x00); --@@ -7698,6 +7731,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) || -@@ -104,7 +104,7 @@ - rt2x00_rt(rt2x00dev, RT5390) || - rt2x00_rt(rt2x00dev, RT5392)) - rt2800_eeprom_read(rt2x00dev, EEPROM_CHIP_ID, &rf); --@@ -7793,7 +7827,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. - */ -@@ -114,7 +114,7 @@ - __set_bit(CAPABILITY_BT_COEXIST, &rt2x00dev->cap_flags); - - /* --@@ -7822,6 +7857,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..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 --@@ -8209,6 +8209,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}, - }; - -@@ -28,7 +28,7 @@ - static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev) - { - struct hw_mode_spec *spec = &rt2x00dev->spec; --@@ -8297,7 +8318,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; -@@ -40,7 +40,7 @@ - break; - - case RF3052: --@@ -8481,6 +8505,19 @@ static int rt2800_probe_rt(struct rt2x00 -+@@ -8456,6 +8480,19 @@ static int rt2800_probe_rt(struct rt2x00 - return 0; - } - -@@ -60,7 +60,7 @@ - int rt2800_probe_hw(struct rt2x00_dev *rt2x00dev) - { - struct rt2800_drv_data *drv_data = rt2x00dev->drv_data; --@@ -8523,6 +8560,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..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 -+@@ -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..faa5879 100644 ---- a/package/kernel/mac80211/patches/616-rt2x00-support-rt5350.patch -+++ b/package/kernel/mac80211/patches/616-rt2x00-support-rt5350.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 - @@ -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 --@@ -3038,6 +3038,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]); -@@ -24,7 +24,7 @@ - } - } - } --@@ -3516,6 +3523,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: -@@ -32,7 +32,7 @@ - case RF5360: - case RF5362: - case RF5370: --@@ -3534,6 +3542,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) || -@@ -40,7 +40,7 @@ - rt2x00_rf(rt2x00dev, RF5360) || - rt2x00_rf(rt2x00dev, RF5362) || - rt2x00_rf(rt2x00dev, RF5370) || --@@ -3812,7 +3821,8 @@ static void rt2800_config_channel(struct -+@@ -3789,7 +3798,8 @@ static void rt2800_config_channel(struct - /* - * Clear update flag - */ -@@ -50,7 +50,7 @@ - rt2800_bbp_read(rt2x00dev, 49, &bbp); - rt2x00_set_field8(&bbp, BBP49_UPDATE_FLAG, 0); - rt2800_bbp_write(rt2x00dev, 49, bbp); --@@ -4698,6 +4708,7 @@ void rt2800_vco_calibration(struct rt2x0 -+@@ -4675,6 +4685,7 @@ void rt2800_vco_calibration(struct rt2x0 - case RF3070: - case RF3290: - case RF3853: -@@ -58,7 +58,7 @@ - case RF5360: - case RF5362: - case RF5370: --@@ -5111,6 +5122,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); -@@ -67,7 +67,7 @@ - } else { - 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 -+@@ -5743,9 +5756,13 @@ static void rt2800_init_bbp_3352(struct - - rt2800_bbp_write(rt2x00dev, 82, 0x62); - -@@ -84,7 +84,7 @@ - - rt2800_bbp_write(rt2x00dev, 86, 0x38); - --@@ -5782,9 +5799,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); - -@@ -101,7 +101,7 @@ - - rt2800_bbp_write(rt2x00dev, 120, 0x50); - --@@ -5809,6 +5830,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); -@@ -115,7 +115,7 @@ - } - - static void rt2800_init_bbp_3390(struct rt2x00_dev *rt2x00dev) --@@ -6150,6 +6178,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: -@@ -123,7 +123,7 @@ - rt2800_init_bbp_3352(rt2x00dev); - break; - case RT3390: --@@ -7101,6 +7130,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); - } - -@@ -200,7 +200,7 @@ - static void rt2800_init_rfcsr_5390(struct rt2x00_dev *rt2x00dev) - { - rt2800_rf_init_calibration(rt2x00dev, 2); --@@ -7341,6 +7440,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; -@@ -210,7 +210,7 @@ - case RT5390: - rt2800_init_rfcsr_5390(rt2x00dev); - break; --@@ -7600,6 +7702,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); -@@ -223,7 +223,7 @@ - } else if (rt2x00_rt(rt2x00dev, RT2860) || - rt2x00_rt(rt2x00dev, RT2872)) { - /* --@@ -7738,6 +7846,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; -@@ -232,7 +232,7 @@ - else - rf = rt2x00_get_field16(eeprom, EEPROM_NIC_CONF0_RF_TYPE); - --@@ -7757,6 +7867,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: -@@ -240,7 +240,7 @@ - case RF5360: - case RF5362: - case RF5370: --@@ -8312,6 +8423,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: -@@ -248,7 +248,7 @@ - case RF5360: - case RF5362: - case RF5370: --@@ -8451,6 +8563,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: -@@ -256,7 +256,7 @@ - case RF5360: - case RF5362: - case RF5370: --@@ -8491,6 +8604,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..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 -+@@ -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..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 --@@ -7841,10 +7841,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..e3e4c98 100644 ---- a/package/kernel/mac80211/patches/621-rt2x00-ht20_40_fix.patch -+++ b/package/kernel/mac80211/patches/621-rt2x00-ht20_40_fix.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 - @@ -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 --@@ -3551,8 +3551,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..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,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..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,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..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); - /* We can't send beacons with short preamble. Would get PHY errors. */ --@@ -3302,8 +3302,8 @@ static int b43_chip_init(struct b43_wlde -+@@ -3300,8 +3300,8 @@ static int b43_chip_init(struct b43_wlde - - /* Select the antennae */ - if (phy->ops->set_rx_antenna) -@@ -20,7 +20,7 @@ - - if (phy->type == B43_PHYTYPE_B) { - value16 = b43_read16(dev, 0x005E); --@@ -4003,7 +4003,6 @@ static int b43_op_config(struct ieee8021 -+@@ -4001,7 +4001,6 @@ static int b43_op_config(struct ieee8021 - struct b43_wldev *dev = wl->current_dev; - struct b43_phy *phy = &dev->phy; - struct ieee80211_conf *conf = &hw->conf; -@@ -28,7 +28,7 @@ - int err = 0; - - mutex_lock(&wl->mutex); --@@ -4046,11 +4045,9 @@ static int b43_op_config(struct ieee8021 -+@@ -4044,11 +4043,9 @@ static int b43_op_config(struct ieee8021 - } - - /* Antennas for RX and management frame TX. */ -@@ -42,7 +42,7 @@ - - if (wl->radio_enabled != phy->radio_on) { - if (wl->radio_enabled) { --@@ -5213,6 +5210,47 @@ static int b43_op_get_survey(struct ieee -+@@ -5209,6 +5206,47 @@ static int b43_op_get_survey(struct ieee - return 0; - } - -@@ -90,7 +90,7 @@ - static const struct ieee80211_ops b43_hw_ops = { - .tx = b43_op_tx, - .conf_tx = b43_op_conf_tx, --@@ -5234,6 +5272,8 @@ static const struct ieee80211_ops b43_hw -+@@ -5230,6 +5268,8 @@ static const struct ieee80211_ops b43_hw - .sw_scan_complete = b43_op_sw_scan_complete_notifier, - .get_survey = b43_op_get_survey, - .rfkill_poll = b43_rfkill_poll, -@@ -99,7 +99,7 @@ - }; - - /* Hard-reset the chip. Do not call this directly. --@@ -5542,6 +5582,8 @@ static int b43_one_core_attach(struct b4 -+@@ -5538,6 +5578,8 @@ static int b43_one_core_attach(struct b4 - if (!wldev) - goto out; - -@@ -108,7 +108,7 @@ - wldev->use_pio = b43_modparam_pio; - wldev->dev = dev; - wldev->wl = wl; --@@ -5632,6 +5674,9 @@ static struct b43_wl *b43_wireless_init( -+@@ -5628,6 +5670,9 @@ static struct b43_wl *b43_wireless_init( - - 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 -deleted file mode 100644 -index 44bb779..0000000 ---- a/package/kernel/mac80211/patches/860-brcmfmac-use-bcm47xx-platform-NVRAM-as-fallback.patch -+++ /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() */ -- --+#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..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 -@@ -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 --@@ -1226,6 +1226,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..4295b4b 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 -@@ -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 --@@ -608,9 +608,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 -+@@ -615,9 +615,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 ---- a/package/kernel/mac80211/patches/900-wlcore-Add-support-for-DT-platform-data.patch -+++ /dev/null -@@ -1,139 +0,0 @@ --When running with DT, we no longer have a board file that can set up the --platform data for wlcore. Allow this data to be passed from DT. -- --Since some platforms use a gpio-irq, add support for passing either the --irq number or the gpio number. For the latter case, the driver will --request the gpio and convert it to the irq number. If an irq is --specified, it'll be used as is. -- --[Arik - the pdev_data pointer does not belong to us and is freed when --the device is released. Dereference to our private data first.] -- --Signed-off-by: Ido Yariv --Signed-off-by: Arik Nemtsov ----- -- drivers/net/wireless/ti/wlcore/sdio.c | 71 ++++++++++++++++++++++++++++++++--- -- include/linux/wl12xx.h | 3 +- -- 2 files changed, 67 insertions(+), 7 deletions(-) -- ----- a/drivers/net/wireless/ti/wlcore/sdio.c --+++ b/drivers/net/wireless/ti/wlcore/sdio.c --@@ -34,6 +34,7 @@ -- #include -- #include -- #include --+#include -- -- #include "wlcore.h" -- #include "wl12xx_80211.h" --@@ -214,6 +215,61 @@ static struct wl1271_if_operations sdio_ -- .set_block_size = wl1271_sdio_set_block_size, -- }; -- --+static const struct of_device_id wlcore_of_match[] = { --+ { --+ .compatible = "wlcore", --+ }, --+ {} --+}; --+MODULE_DEVICE_TABLE(of, wlcore_of_match); --+ --+static struct wl12xx_platform_data *get_platform_data(struct device *dev) --+{ --+ struct wl12xx_platform_data *pdata; --+ struct device_node *np; --+ u32 gpio; --+ --+ pdata = wl12xx_get_platform_data(); --+ if (!IS_ERR(pdata)) --+ return kmemdup(pdata, sizeof(*pdata), GFP_KERNEL); --+ --+ np = of_find_matching_node(NULL, wlcore_of_match); --+ if (!np) { --+ dev_err(dev, "No platform data set\n"); --+ return NULL; --+ } --+ --+ pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); --+ if (!pdata) { --+ dev_err(dev, "Can't allocate platform data\n"); --+ return NULL; --+ } --+ --+ if (of_property_read_u32(np, "irq", &pdata->irq)) { --+ if (!of_property_read_u32(np, "gpio", &gpio) && --+ !gpio_request_one(gpio, GPIOF_IN, "wlcore_irq")) { --+ pdata->gpio = gpio; --+ pdata->irq = gpio_to_irq(gpio); --+ } --+ } --+ --+ /* Optional fields */ --+ pdata->use_eeprom = of_property_read_bool(np, "use-eeprom"); --+ of_property_read_u32(np, "board-ref-clock", &pdata->board_ref_clock); --+ of_property_read_u32(np, "board-tcxo-clock", &pdata->board_tcxo_clock); --+ of_property_read_u32(np, "platform-quirks", &pdata->platform_quirks); --+ --+ return pdata; --+} --+ --+static void del_platform_data(struct wl12xx_platform_data *pdata) --+{ --+ if (pdata->gpio) --+ gpio_free(pdata->gpio); --+ --+ kfree(pdata); --+} --+ -- static int wl1271_probe(struct sdio_func *func, -- const struct sdio_device_id *id) -- { --@@ -245,10 +301,10 @@ static int wl1271_probe(struct sdio_func -- /* Use block mode for transferring over one block size of data */ -- func->card->quirks |= MMC_QUIRK_BLKSZ_FOR_BYTE_MODE; -- --- pdev_data.pdata = wl12xx_get_platform_data(); --- if (IS_ERR(pdev_data.pdata)) { --- ret = PTR_ERR(pdev_data.pdata); --- dev_err(glue->dev, "missing wlan platform data: %d\n", ret); --+ pdev_data.pdata = get_platform_data(&func->dev); --+ if (!pdev_data.pdata) { --+ ret = -EINVAL; --+ dev_err(glue->dev, "missing wlan platform data\n"); -- goto out_free_glue; -- } -- --@@ -279,7 +335,7 @@ static int wl1271_probe(struct sdio_func -- if (!glue->core) { -- dev_err(glue->dev, "can't allocate platform_device"); -- ret = -ENOMEM; --- goto out_free_glue; --+ goto out_free_pdata; -- } -- -- glue->core->dev.parent = &func->dev; --@@ -313,6 +369,9 @@ static int wl1271_probe(struct sdio_func -- out_dev_put: -- platform_device_put(glue->core); -- --+out_free_pdata: --+ del_platform_data(pdev_data->pdata); --+ -- out_free_glue: -- kfree(glue); -- --@@ -323,11 +382,14 @@ out: -- static void wl1271_remove(struct sdio_func *func) -- { -- struct wl12xx_sdio_glue *glue = sdio_get_drvdata(func); --+ struct wlcore_platdev_data *pdev_data = glue->core->dev.platform_data; --+ struct wl12xx_platform_data *pdata = pdev_data->pdata; -- -- /* Undo decrement done above in wl1271_probe */ -- pm_runtime_get_noresume(&func->dev); -- -- platform_device_unregister(glue->core); --+ del_platform_data(pdata); -- 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..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 -+@@ -3303,6 +3376,312 @@ static void rt2800_config_channel_rf55xx - rt2800_bbp_write(rt2x00dev, 196, (rf->channel <= 14) ? 0x19 : 0x7F); - } - -@@ -258,6 +258,7 @@ - + u32 mac_sys_ctrl, mac_status; - + u32 tx_pin = 0x00150F0F; - + struct hw_mode_spec *spec = &rt2x00dev->spec; -++ struct rt2800_drv_data *drv_data = rt2x00dev->drv_data; - + - + /* Frequeny plan setting */ - + /* -@@ -383,7 +384,6 @@ - + rfcsr &= (~0x4); - + rt2800_rfcsr_write(rt2x00dev, 28, rfcsr); - + --+ struct rt2800_drv_data *drv_data = rt2x00dev->drv_data; - + /*if (bScan == FALSE)*/ - + if (conf_is_ht40(conf)) { - + txrx_agc_fc = rt2x00_get_field8(drv_data->calibration_bw40, -@@ -523,7 +523,7 @@ - static void rt2800_bbp_write_with_rx_chain(struct rt2x00_dev *rt2x00dev, - const unsigned int word, - const u8 value) --@@ -3482,7 +3861,7 @@ static void rt2800_config_channel(struct -+@@ -3459,7 +3838,7 @@ static void rt2800_config_channel(struct - struct channel_info *info) - { - u32 reg; -@@ -532,7 +532,7 @@ - u8 bbp, rfcsr; - - info->default_power1 = rt2800_txpower_to_dev(rt2x00dev, rf->channel, --@@ -3536,6 +3915,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; -@@ -542,7 +542,7 @@ - default: - rt2800_config_channel_rf2xxx(rt2x00dev, conf, rf, info); - } --@@ -3638,7 +4020,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); -@@ -551,7 +551,7 @@ - rt2800_bbp_write(rt2x00dev, 82, 0xf2); - - if (rt2x00_rt(rt2x00dev, RT3593) || --@@ -3660,7 +4042,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); - -@@ -560,7 +560,7 @@ - - switch (rt2x00dev->default_ant.tx_chain_num) { - case 3: --@@ -3709,6 +4091,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); -@@ -568,7 +568,7 @@ - - rt2800_register_write(rt2x00dev, TX_PIN_CFG, tx_pin); - --@@ -4725,6 +5108,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; -@@ -583,7 +583,7 @@ - default: - return; - } --@@ -5125,9 +5516,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)) { -@@ -629,7 +629,7 @@ - } else if (rt2x00_rt(rt2x00dev, RT5350)) { - rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000404); - } else { --@@ -6159,6 +6583,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); - } - -@@ -855,7 +855,7 @@ - static void rt2800_init_bbp(struct rt2x00_dev *rt2x00dev) - { - unsigned int i; --@@ -6201,7 +6844,10 @@ static void rt2800_init_bbp(struct rt2x0 -+@@ -6178,7 +6821,10 @@ static void rt2800_init_bbp(struct rt2x0 - return; - case RT5390: - case RT5392: -@@ -867,7 +867,7 @@ - break; - case RT5592: - rt2800_init_bbp_5592(rt2x00dev); --@@ -7415,6 +8061,295 @@ static void rt2800_init_rfcsr_5592(struc -+@@ -7392,6 +8038,296 @@ static void rt2800_init_rfcsr_5592(struc - rt2800_led_open_drain_enable(rt2x00dev); - } - -@@ -875,6 +875,8 @@ - +{ - + u16 freq; - + u8 rfvalue; -++ struct hw_mode_spec *spec = &rt2x00dev->spec; -++ - + /* Initialize RF central register to default value */ - + rt2800_rfcsr_write(rt2x00dev, 0, 0x02); - + rt2800_rfcsr_write(rt2x00dev, 1, 0x03); -@@ -921,7 +923,6 @@ - + rt2800_rfcsr_write(rt2x00dev, 42, 0x5B); - + rt2800_rfcsr_write(rt2x00dev, 43, 0x00); - + --+ struct hw_mode_spec *spec = &rt2x00dev->spec; - + rt2800_rfcsr_write(rt2x00dev, 11, 0x21); - + if (spec->clk_is_20mhz) - + rt2800_rfcsr_write(rt2x00dev, 13, 0x03); -@@ -1163,7 +1164,7 @@ - static void rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev) - { - if (rt2800_is_305x_soc(rt2x00dev)) { --@@ -7450,7 +8385,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: -@@ -1175,7 +1176,7 @@ - break; - case RT5392: - rt2800_init_rfcsr_5392(rt2x00dev); --@@ -7882,6 +8820,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: -@@ -1183,7 +1184,7 @@ - break; - default: - rt2x00_err(rt2x00dev, "Invalid RF chipset 0x%04x detected\n", --@@ -8448,6 +9387,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: -@@ -1191,7 +1192,7 @@ - spec->num_channels = 14; - if (spec->clk_is_20mhz) - spec->channels = rf_vals_xtal20mhz_3x; --@@ -8588,6 +9528,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: -diff --git a/package/kernel/mac80211/patches/920-ath10k_allow_fallback_to_board_bin_on_empty_otp_stream.patch b/package/kernel/mac80211/patches/920-ath10k_allow_fallback_to_board_bin_on_empty_otp_stream.patch -deleted file mode 100644 -index 4c04d4f..0000000 ---- a/package/kernel/mac80211/patches/920-ath10k_allow_fallback_to_board_bin_on_empty_otp_stream.patch -+++ /dev/null -@@ -1,20 +0,0 @@ ----- a/drivers/net/wireless/ath/ath10k/core.c --+++ b/drivers/net/wireless/ath/ath10k/core.c --@@ -387,9 +387,14 @@ static int ath10k_download_and_run_otp(s -- -- ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot otp execute result %d\n", result); -- --- if (!skip_otp && result != 0) { --- ath10k_err(ar, "otp calibration failed: %d", result); --- return -EINVAL; --+ if (!skip_otp) { --+ if (result == 2) { --+ ath10k_warn(ar, "otp stream is empty, using board.bin contents"); --+ return 0; --+ } else if (result != 0) { --+ ath10k_err(ar, "otp calibration failed: %d", result); --+ return -EINVAL; --+ } -- } -- -- 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..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 - - --- 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 * -+@@ -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..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 -+@@ -7141,6 +7141,21 @@ struct ath10k_vif *ath10k_get_arvif(stru - return arvif_iter.arvif; - } - -@@ -22,7 +22,7 @@ - int ath10k_mac_register(struct ath10k *ar) - { - static const u32 cipher_suites[] = { --@@ -5590,6 +5605,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..357faee ---- /dev/null -+++ b/package/kernel/mac80211/patches/940-mwl8k_init_devices_synchronously.patch -@@ -0,0 +1,20 @@ -+--- 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; -+ -++ wait_for_completion(&priv->firmware_loading_complete); -++ -+ return rc; -+ -+ err_stop_firmware: -+@@ -6297,8 +6299,6 @@ static void mwl8k_remove(struct pci_dev -+ return; -+ priv = hw->priv; -+ -+- wait_for_completion(&priv->firmware_loading_complete); -+- -+ 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 ---- a/package/kernel/mt76/patches/001-backport_ieee80211_hw_set.patch -+++ /dev/null -@@ -1,12 +0,0 @@ ----- a/init.c --+++ b/init.c --@@ -16,6 +16,9 @@ -- #include "eeprom.h" -- #include "mcu.h" -- --+#define ieee80211_hw_set(hw, flag) \ --+ do { (hw)->flags |= IEEE80211_HW_##flag; } while(0) --+ -- 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/032-bcma-from-4.6.patch b/target/linux/generic/patches-3.18/032-bcma-from-4.6.patch -index 8ec73d9..a74d9ee 100644 ---- 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 -@@ -1,6 +1,40 @@ - --- a/drivers/bcma/driver_chipcommon.c - +++ b/drivers/bcma/driver_chipcommon.c --@@ -190,6 +190,7 @@ u32 bcma_chipco_watchdog_timer_set(struc -+@@ -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 && -@@ -8,6 +42,232 @@ - 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 -@@ -18,27 +278,6 @@ - { NULL }, - }; - ----- 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/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) }, - --- a/drivers/bcma/scan.c - +++ b/drivers/bcma/scan.c - @@ -98,6 +98,9 @@ static const struct bcma_device_id_name -@@ -51,6 +290,32 @@ - { 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 { -@@ -70,3 +335,110 @@ - #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/0010-iwinfo-update-NanoStation-Loco-txpower-offsets.patch b/patches/openwrt/0008-iwinfo-update-NanoStation-Loco-txpower-offsets.patch similarity index 100% rename from patches/openwrt/0010-iwinfo-update-NanoStation-Loco-txpower-offsets.patch rename to patches/openwrt/0008-iwinfo-update-NanoStation-Loco-txpower-offsets.patch diff --git a/patches/openwrt/0016-hostapd-prevent-channel-switch-for-5GHz.patch b/patches/openwrt/0009-hostapd-prevent-channel-switch-for-5GHz.patch similarity index 100% rename from patches/openwrt/0016-hostapd-prevent-channel-switch-for-5GHz.patch rename to patches/openwrt/0009-hostapd-prevent-channel-switch-for-5GHz.patch diff --git a/patches/openwrt/0023-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch b/patches/openwrt/0010-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch similarity index 100% rename from patches/openwrt/0023-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch rename to patches/openwrt/0010-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch diff --git a/patches/openwrt/0011-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 deleted file mode 100644 index 903e7e5f..00000000 --- a/patches/openwrt/0011-ar71xx-add-support-for-tp-link-wr740n-v5.0-EU.patch +++ /dev/null @@ -1,39 +0,0 @@ -From: Matthias Schiffer -Date: Sun, 21 Jun 2015 22:50:48 +0200 -Subject: ar71xx: add support for tp-link wr740n v5.0 (EU) - -TP-Link ships wr740n v5.0 to Romania (so probably everywhere except -China) with 4 MB flash and 32 MB memory (confirmed by their local -support). This patch adds support for the v5.0 clone of v4, i just -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 4336697..1fe88d5 100644 ---- a/target/linux/ar71xx/image/Makefile -+++ b/target/linux/ar71xx/image/Makefile -@@ -501,6 +501,14 @@ define Device/tl-wr740n-v4 - CONSOLE := ttyATH0,115200 - endef - -+define Device/tl-wr740n-v5 -+ $(Device/tplink-4mlzma) -+ BOARDNAME := TL-WR741ND-v4 -+ DEVICE_PROFILE := TLWR740 -+ TPLINK_HWID := 0x07400005 -+ CONSOLE := ttyATH0,115200 -+endef -+ - define Device/tl-wr741nd-v1 - $(Device/tplink-4m) - BOARDNAME := TL-WR741ND -@@ -530,7 +538,7 @@ define Device/tl-wr743nd-v2 - TPLINK_HWID := 0x07430002 - CONSOLE := ttyATH0,115200 - endef --TARGET_DEVICES += tl-wr740n-v4 tl-wr741nd-v1 tl-wr741nd-v2 tl-wr741nd-v4 tl-wr743nd-v2 -+TARGET_DEVICES += tl-wr740n-v4 tl-wr740n-v5 tl-wr741nd-v1 tl-wr741nd-v2 tl-wr741nd-v4 tl-wr743nd-v2 - - define Device/tl-wr841n-v8 - $(Device/tplink-4mlzma) diff --git a/patches/openwrt/0029-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch b/patches/openwrt/0011-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch similarity index 100% rename from patches/openwrt/0029-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch rename to patches/openwrt/0011-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch diff --git a/patches/openwrt/0012-ar71xx-add-support-for-TL-WR741ND-v5.patch b/patches/openwrt/0012-ar71xx-add-support-for-TL-WR741ND-v5.patch deleted file mode 100644 index 94af335c..00000000 --- a/patches/openwrt/0012-ar71xx-add-support-for-TL-WR741ND-v5.patch +++ /dev/null @@ -1,35 +0,0 @@ -From: Matthias Schiffer -Date: Sun, 21 Jun 2015 22:48:04 +0200 -Subject: ar71xx: add support for TL-WR741ND v5 - -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 1fe88d5..78d35e1 100644 ---- a/target/linux/ar71xx/image/Makefile -+++ b/target/linux/ar71xx/image/Makefile -@@ -531,6 +531,14 @@ define Device/tl-wr741nd-v4 - CONSOLE := ttyATH0,115200 - endef - -+define Device/tl-wr741nd-v5 -+ $(Device/tplink-4mlzma) -+ BOARDNAME := TL-WR741ND-v4 -+ DEVICE_PROFILE := TLWR741 -+ TPLINK_HWID := 0x07400005 -+ CONSOLE := ttyATH0,115200 -+endef -+ - define Device/tl-wr743nd-v2 - $(Device/tplink-4mlzma) - BOARDNAME := TL-WR741ND-v4 -@@ -538,7 +546,7 @@ define Device/tl-wr743nd-v2 - TPLINK_HWID := 0x07430002 - CONSOLE := ttyATH0,115200 - endef --TARGET_DEVICES += tl-wr740n-v4 tl-wr740n-v5 tl-wr741nd-v1 tl-wr741nd-v2 tl-wr741nd-v4 tl-wr743nd-v2 -+TARGET_DEVICES += tl-wr740n-v4 tl-wr740n-v5 tl-wr741nd-v1 tl-wr741nd-v2 tl-wr741nd-v4 tl-wr741nd-v5 tl-wr743nd-v2 - - define Device/tl-wr841n-v8 - $(Device/tplink-4mlzma) diff --git a/patches/openwrt/0035-lua-fix-installation-of-headers-for-host-build.patch b/patches/openwrt/0012-lua-fix-installation-of-headers-for-host-build.patch similarity index 100% rename from patches/openwrt/0035-lua-fix-installation-of-headers-for-host-build.patch rename to patches/openwrt/0012-lua-fix-installation-of-headers-for-host-build.patch diff --git a/patches/openwrt/0036-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch b/patches/openwrt/0013-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch similarity index 100% rename from patches/openwrt/0036-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch rename to patches/openwrt/0013-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch diff --git a/patches/openwrt/0013-sunxi-fix-uboot-install-location.patch b/patches/openwrt/0013-sunxi-fix-uboot-install-location.patch deleted file mode 100644 index 71824b76..00000000 --- a/patches/openwrt/0013-sunxi-fix-uboot-install-location.patch +++ /dev/null @@ -1,131 +0,0 @@ -From: Matthias Schiffer -Date: Thu, 16 Jul 2015 22:01:02 +0200 -Subject: sunxi: fix uboot install location - -Install uboot files to KERNEL_BUILD_DIR instead of BIN_DIR to fix the -ImageBuilder. Similar fixes are necessary for many (all?) other uboot -targets. - -Also remove the DTS copy command, BIN_DIR was unnecessarily cluttered with -DTS files unrelated to the chosen profile. - -diff --git a/package/boot/uboot-sunxi/Makefile b/package/boot/uboot-sunxi/Makefile -index 14ba922..9032600 100644 ---- a/package/boot/uboot-sunxi/Makefile -+++ b/package/boot/uboot-sunxi/Makefile -@@ -6,6 +6,7 @@ - # - - include $(TOPDIR)/rules.mk -+include $(INCLUDE_DIR)/kernel.mk - - PKG_NAME:=u-boot - PKG_VERSION:=2015.01 -@@ -16,7 +17,7 @@ PKG_SOURCE_URL:= \ - - PKG_MD5SUM:=7f08dc9e98a71652bd6968888ed6ec95 - --PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) -+PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) - - PKG_LICENSE:=GPL-2.0 GPL-2.0+ - PKG_LICENSE_FILES:=Licenses/README -@@ -136,16 +137,16 @@ define Build/Compile - endef - - define Package/uboot/install/default -- $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1) - $(CP) $(PKG_BUILD_DIR)/u-boot.bin \ -- $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.bin -+ $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-u-boot.bin - $(CP) $(PKG_BUILD_DIR)/spl/sunxi-spl.bin \ -- $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-spl.bin -+ $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-spl.bin - $(CP) $(PKG_BUILD_DIR)/u-boot-sunxi-with-spl.bin \ -- $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot-with-spl.bin -+ $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-u-boot-with-spl.bin - $(CP) uEnv.txt \ -- $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-uEnv.txt -- mkimage -C none -A arm -T script -d $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-uEnv.txt $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-boot.scr -+ $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-uEnv.txt -+ mkimage -C none -A arm -T script -d $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-uEnv.txt \ -+ $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-boot.scr - endef - - define Package/uboot/install/template -diff --git a/target/linux/sunxi/image/Makefile b/target/linux/sunxi/image/Makefile -index 6fcd61f..19ab935 100644 ---- a/target/linux/sunxi/image/Makefile -+++ b/target/linux/sunxi/image/Makefile -@@ -11,28 +11,12 @@ include $(INCLUDE_DIR)/host.mk - FAT32_BLOCK_SIZE=1024 - FAT32_BLOCKS=$(shell echo $$(($(CONFIG_SUNXI_SD_BOOT_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE)))) - --BOARDS:= \ -- sun4i-a10-cubieboard \ -- sun4i-a10-olinuxino-lime \ -- sun4i-a10-pcduino \ -- sun5i-a13-olinuxino \ -- sun6i-a31-colombus \ -- sun6i-a31-m9 \ -- sun7i-a20-bananapi \ -- sun7i-a20-bananapro \ -- sun7i-a20-cubieboard2 \ -- sun7i-a20-cubietruck \ -- sun7i-a20-olinuxino-lime \ -- sun7i-a20-olinuxino-micro \ -- sun7i-a20-pcduino3 \ -- sun7i-a20-lamobo-r1 -- - define Image/BuildKernel - mkimage -A arm -O linux -T kernel -C none \ - -a 0x40008000 -e 0x40008000 \ - -n 'ARM OpenWrt Linux-$(LINUX_VERSION)' \ - -d $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-uImage -- -+ - ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) - $(CP) $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs - echo -ne '\x00\x00\x00\x00' >> $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs -@@ -42,27 +26,23 @@ define Image/BuildKernel - $(BIN_DIR)/$(IMG_PREFIX)-uImage-initramfs \ - ) - endif -- -- $(foreach board,$(BOARDS), -- $(CP) $(DTS_DIR)/$(board).dtb $(BIN_DIR)/ -- ) - endef - - define Image/Build/SDCard - rm -f $(KDIR)/boot.img - mkdosfs $(KDIR)/boot.img -C $(FAT32_BLOCKS) -- -- mcopy -i $(KDIR)/boot.img $(BIN_DIR)/uboot-sunxi-$(PROFILE)/$(IMG_PREFIX)-$(PROFILE)-boot.scr ::boot.scr -- mcopy -i $(KDIR)/boot.img $(BIN_DIR)/$(2).dtb ::dtb -+ -+ mcopy -i $(KDIR)/boot.img $(KDIR)/uboot-sunxi-$(PROFILE)-boot.scr ::boot.scr -+ mcopy -i $(KDIR)/boot.img $(DTS_DIR)/$(2).dtb ::dtb - mcopy -i $(KDIR)/boot.img $(BIN_DIR)/$(IMG_PREFIX)-uImage ::uImage -- -+ - ./gen_sunxi_sdcard_img.sh \ - $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-sdcard-vfat-$(1).img \ - $(KDIR)/boot.img \ - $(KDIR)/root.$(1) \ - $(CONFIG_SUNXI_SD_BOOT_PARTSIZE) \ - $(CONFIG_TARGET_ROOTFS_PARTSIZE) \ -- $(BIN_DIR)/uboot-sunxi-$(PROFILE)/$(IMG_PREFIX)-$(PROFILE)-u-boot-with-spl.bin -+ $(KDIR)/uboot-sunxi-$(PROFILE)-u-boot-with-spl.bin - endef - - define Image/Build/Profile/A10-OLinuXino-Lime -@@ -124,7 +104,7 @@ endef - define Image/Build - $(call Image/Build/$(1),$(1)) - $(call Image/Build/Profile/$(PROFILE),$(1)) -- -+ - dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync - endef - diff --git a/patches/openwrt/0039-fix-UBNT-XM-model-detection.patch b/patches/openwrt/0014-fix-UBNT-XM-model-detection.patch similarity index 100% rename from patches/openwrt/0039-fix-UBNT-XM-model-detection.patch rename to patches/openwrt/0014-fix-UBNT-XM-model-detection.patch diff --git a/patches/openwrt/0014-sunxi-respect-CONFIG_TARGET_IMAGES_GZIP.patch b/patches/openwrt/0014-sunxi-respect-CONFIG_TARGET_IMAGES_GZIP.patch deleted file mode 100644 index d919e6e4..00000000 --- a/patches/openwrt/0014-sunxi-respect-CONFIG_TARGET_IMAGES_GZIP.patch +++ /dev/null @@ -1,21 +0,0 @@ -From: Matthias Schiffer -Date: Thu, 16 Jul 2015 22:13:59 +0200 -Subject: sunxi: respect CONFIG_TARGET_IMAGES_GZIP - -The ext4 images are huge uncompressed. - -diff --git a/target/linux/sunxi/image/Makefile b/target/linux/sunxi/image/Makefile -index 19ab935..d3f4409 100644 ---- a/target/linux/sunxi/image/Makefile -+++ b/target/linux/sunxi/image/Makefile -@@ -43,6 +43,10 @@ define Image/Build/SDCard - $(CONFIG_SUNXI_SD_BOOT_PARTSIZE) \ - $(CONFIG_TARGET_ROOTFS_PARTSIZE) \ - $(KDIR)/uboot-sunxi-$(PROFILE)-u-boot-with-spl.bin -+ -+ ifneq ($(CONFIG_TARGET_IMAGES_GZIP),) -+ gzip -f9n $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-sdcard-vfat-$(1).img -+ endif - endef - - define Image/Build/Profile/A10-OLinuXino-Lime diff --git a/patches/openwrt/0015-odhcp6c-add-option-sourcefilter-to-disable-source-filter.patch b/patches/openwrt/0015-odhcp6c-add-option-sourcefilter-to-disable-source-filter.patch deleted file mode 100644 index 56d3d547..00000000 --- a/patches/openwrt/0015-odhcp6c-add-option-sourcefilter-to-disable-source-filter.patch +++ /dev/null @@ -1,62 +0,0 @@ -From: Matthias Schiffer -Date: Sat, 18 Jul 2015 17:13:23 +0200 -Subject: odhcp6c: add option "sourcefilter" to disable source filter - -Signed-off-by: Steven Barth - -diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile -index 5bf43bd..75de54c 100644 ---- a/package/network/ipv6/odhcp6c/Makefile -+++ b/package/network/ipv6/odhcp6c/Makefile -@@ -8,7 +8,7 @@ - include $(TOPDIR)/rules.mk - - PKG_NAME:=odhcp6c --PKG_VERSION:=2015-07-13 -+PKG_VERSION:=2015-07-18 - PKG_RELEASE=$(PKG_SOURCE_VERSION) - - PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.script b/package/network/ipv6/odhcp6c/files/dhcpv6.script -index b8cbddb..33f6d9b 100755 ---- a/package/network/ipv6/odhcp6c/files/dhcpv6.script -+++ b/package/network/ipv6/odhcp6c/files/dhcpv6.script -@@ -76,7 +76,7 @@ setup_interface () { - done - - for entry in $RA_ROUTES; do -- local duplicate=0 -+ local duplicate=$NOSOURCEFILTER - local addr="${entry%%/*}" - entry="${entry#*/}" - local mask="${entry%%,*}" -diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.sh b/package/network/ipv6/odhcp6c/files/dhcpv6.sh -index adcb100..4a453fd 100755 ---- a/package/network/ipv6/odhcp6c/files/dhcpv6.sh -+++ b/package/network/ipv6/odhcp6c/files/dhcpv6.sh -@@ -28,14 +28,15 @@ proto_dhcpv6_init_config() { - proto_config_add_boolean delegate - proto_config_add_int "soltimeout" - proto_config_add_boolean fakeroutes -+ proto_config_add_boolean sourcefilter - } - - proto_dhcpv6_setup() { - local config="$1" - local iface="$2" - -- local reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes -- json_get_vars reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes -+ local reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes sourcefilter -+ json_get_vars reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes sourcefilter - - - # Configure -@@ -76,6 +77,7 @@ proto_dhcpv6_setup() { - [ -n "$zone_464xlat" ] && proto_export "ZONE_464XLAT=$zone_464xlat" - [ -n "$zone" ] && proto_export "ZONE=$zone" - [ "$fakeroutes" != "0" ] && proto_export "FAKE_ROUTES=1" -+ [ "$sourcefilter" = "0" ] && proto_export "NOSOURCEFILTER=1" - - proto_export "INTERFACE=$config" - proto_run_command "$config" odhcp6c \ diff --git a/patches/openwrt/0017-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 deleted file mode 100644 index f4413db2..00000000 --- a/patches/openwrt/0017-ar71xx-fix-ethernet-initialization-on-QCA953x-based-boards-TP-Link-TL-WR841N-ND-v9-Compex-WPJ531.patch +++ /dev/null @@ -1,57 +0,0 @@ -From: Matthias Schiffer -Date: Thu, 6 Aug 2015 03:01:38 +0200 -Subject: ar71xx: fix ethernet initialization on QCA953x-based boards (TP-Link TL-WR841N/ND v9, Compex WPJ531) - -The initialization routines for these boards were relying on some (wrong) -defaults for the QCA953x ethernet. Make these defaults explicit to prevent -breaking them when the QCA953x defaults are fixed. - -Signed-off-by: Matthias Schiffer - -diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v9.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v9.c -index c28afc6..3e5c2a2 100644 ---- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v9.c -+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v9.c -@@ -109,12 +109,18 @@ static void __init tl_ap143_setup(void) - ath79_register_mdio(0, 0x0); - - /* LAN */ -+ ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; -+ ath79_eth1_data.duplex = DUPLEX_FULL; -+ ath79_switch_data.phy_poll_mask |= BIT(4); - ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0); - ath79_register_eth(1); - - /* WAN */ - ath79_switch_data.phy4_mii_en = 1; - ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; -+ ath79_eth0_data.duplex = DUPLEX_FULL; -+ ath79_eth0_data.speed = SPEED_100; -+ ath79_eth0_data.phy_mask = BIT(4); - ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1); - ath79_register_eth(0); - -diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c -index bc13d70..e665a2e 100644 ---- a/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c -+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c -@@ -105,12 +105,19 @@ static void __init common_setup(void) - ath79_register_mdio(0, 0x0); - - /* LAN */ -+ ath79_eth0_data.duplex = DUPLEX_FULL; -+ ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; -+ ath79_eth0_data.speed = SPEED_100; -+ ath79_eth0_data.phy_mask = BIT(4); - ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0); - ath79_register_eth(0); - - /* WAN */ - ath79_switch_data.phy4_mii_en = 1; -+ ath79_eth1_data.duplex = DUPLEX_FULL; - ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_MII; -+ ath79_eth1_data.speed = SPEED_100; -+ ath79_switch_data.phy_poll_mask |= BIT(4); - ath79_init_mac(ath79_eth1_data.mac_addr, mac, 1); - ath79_register_eth(1); - diff --git a/patches/openwrt/0018-ar71xx-rework-patch-for-qca953x-956x.patch b/patches/openwrt/0018-ar71xx-rework-patch-for-qca953x-956x.patch deleted file mode 100644 index 5b2b234f..00000000 --- a/patches/openwrt/0018-ar71xx-rework-patch-for-qca953x-956x.patch +++ /dev/null @@ -1,807 +0,0 @@ -From: Matthias Schiffer -Date: Thu, 6 Aug 2015 03:01:47 +0200 -Subject: ar71xx: rework patch for qca953x/956x - -Patch cherry-picked from the following location: -https://www.codeaurora.org/cgit/quic/qsdk/oss/system/openwrt/commit/?h=release/coconut_ioe4531_2.0&id=5c357bf6c763e4140dddcc9a3bc5f005525a9c0e - -Changelist, - - add more register defines - - add EHCI support - - fix GPIO pin count to 18 - - fix chained irq disabled - - fix GMAC0/GMAC1 initial - - fix WMAC irq number to 47 - - merge the changes of dev-eth.c from the patch to file. - -Signed-off-by: Miaoqing Pan -Signed-off-by: Matthias Schiffer - -diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c -index ae3db4c..ff94e2e 100644 ---- a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c -+++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c -@@ -198,6 +198,8 @@ void __init ath79_register_mdio(unsigned int id, u32 phy_mask) - case ATH79_SOC_AR9330: - case ATH79_SOC_AR9331: - case ATH79_SOC_QCA9533: -+ case ATH79_SOC_QCA9561: -+ case ATH79_SOC_TP9343: - mdio_dev = &ath79_mdio1_device; - mdio_data = &ath79_mdio1_data; - break; -@@ -256,6 +258,8 @@ void __init ath79_register_mdio(unsigned int id, u32 phy_mask) - break; - - case ATH79_SOC_QCA9533: -+ case ATH79_SOC_QCA9561: -+ case ATH79_SOC_TP9343: - mdio_data->builtin_switch = 1; - break; - -@@ -571,6 +575,8 @@ static void __init ath79_init_eth_pll_data(unsigned int id) - case ATH79_SOC_QCA9533: - case ATH79_SOC_QCA9556: - case ATH79_SOC_QCA9558: -+ case ATH79_SOC_QCA9561: -+ case ATH79_SOC_TP9343: - pll_10 = AR934X_PLL_VAL_10; - pll_100 = AR934X_PLL_VAL_100; - pll_1000 = AR934X_PLL_VAL_1000; -@@ -627,6 +633,8 @@ static int __init ath79_setup_phy_if_mode(unsigned int id, - case ATH79_SOC_AR9330: - case ATH79_SOC_AR9331: - case ATH79_SOC_QCA9533: -+ case ATH79_SOC_QCA9561: -+ case ATH79_SOC_TP9343: - pdata->phy_if_mode = PHY_INTERFACE_MODE_MII; - break; - -@@ -687,7 +695,8 @@ static int __init ath79_setup_phy_if_mode(unsigned int id, - case ATH79_SOC_AR7241: - case ATH79_SOC_AR9330: - case ATH79_SOC_AR9331: -- case ATH79_SOC_QCA9533: -+ case ATH79_SOC_QCA9561: -+ case ATH79_SOC_TP9343: - pdata->phy_if_mode = PHY_INTERFACE_MODE_GMII; - break; - -@@ -697,6 +706,7 @@ static int __init ath79_setup_phy_if_mode(unsigned int id, - case ATH79_SOC_AR9341: - case ATH79_SOC_AR9342: - case ATH79_SOC_AR9344: -+ case ATH79_SOC_QCA9533: - switch (pdata->phy_if_mode) { - case PHY_INTERFACE_MODE_MII: - case PHY_INTERFACE_MODE_GMII: -@@ -986,6 +996,7 @@ void __init ath79_register_eth(unsigned int id) - case ATH79_SOC_AR9341: - case ATH79_SOC_AR9342: - case ATH79_SOC_AR9344: -+ case ATH79_SOC_QCA9533: - if (id == 0) { - pdata->reset_bit = AR934X_RESET_GE0_MAC | - AR934X_RESET_GE0_MDIO; -@@ -1017,7 +1028,8 @@ void __init ath79_register_eth(unsigned int id) - pdata->fifo_cfg3 = 0x01f00140; - break; - -- case ATH79_SOC_QCA9533: -+ case ATH79_SOC_QCA9561: -+ case ATH79_SOC_TP9343: - if (id == 0) { - pdata->reset_bit = AR933X_RESET_GE0_MAC | - AR933X_RESET_GE0_MDIO; -@@ -1123,6 +1135,8 @@ void __init ath79_register_eth(unsigned int id) - case ATH79_SOC_AR9330: - case ATH79_SOC_AR9331: - case ATH79_SOC_QCA9533: -+ case ATH79_SOC_QCA9561: -+ case ATH79_SOC_TP9343: - pdata->mii_bus_dev = &ath79_mdio1_device.dev; - 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 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 -@@ -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 -+ &ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2)); -+ } -+ -++static void __init qca953x_usb_setup(void) -++{ -++ u32 bootstrap; -++ -++ bootstrap = ath79_reset_rr(QCA953X_RESET_REG_BOOTSTRAP); -++ -++ ath79_device_reset_set(QCA953X_RESET_USBSUS_OVERRIDE); -++ udelay(1000); -++ -++ ath79_device_reset_clear(QCA953X_RESET_USB_PHY); -++ udelay(1000); -++ -++ ath79_device_reset_clear(QCA953X_RESET_USB_PHY_ANALOG); -++ udelay(1000); -++ -++ ath79_device_reset_clear(QCA953X_RESET_USB_HOST); -++ udelay(1000); -++ -++ ath79_usb_register("ehci-platform", -1, -++ QCA953X_EHCI_BASE, QCA953X_EHCI_SIZE, -++ ATH79_CPU_IRQ(3), -++ &ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2)); -++} -++ -+ static void qca955x_usb_reset_notifier(struct platform_device *pdev) -+ { -+ u32 base; -+@@ -286,6 +310,8 @@ void __init ath79_register_usb(void) -+ ar933x_usb_setup(); -+ else if (soc_is_ar934x()) -+ ar934x_usb_setup(); -++ else if (soc_is_qca953x()) -++ qca953x_usb_setup(); -+ else if (soc_is_qca955x()) -+ qca955x_usb_setup(); -+ else - --- a/arch/mips/ath79/dev-wmac.c - +++ b/arch/mips/ath79/dev-wmac.c - @@ -101,7 +101,7 @@ static int ar933x_wmac_reset(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; - + ath79_wmac_resources[0].end = QCA953X_WMAC_BASE + QCA953X_WMAC_SIZE - 1; --+ ath79_wmac_resources[1].start = ATH79_CPU_IRQ(2); --+ ath79_wmac_resources[1].end = ATH79_CPU_IRQ(2); -++ ath79_wmac_resources[1].start = ATH79_IP2_IRQ(1); -++ ath79_wmac_resources[1].end = ATH79_IP2_IRQ(1); - + - + t = ath79_reset_rr(QCA953X_RESET_REG_BOOTSTRAP); - + if (t & QCA953X_BOOTSTRAP_REF_CLK_40) -@@ -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_func -+ soc_is_ar913x() || -+ soc_is_ar933x()) -+ reg = AR71XX_GPIO_REG_FUNC; -+- else if (soc_is_ar934x()) -++ else if (soc_is_ar934x() || soc_is_qca953x()) -+ reg = AR934X_GPIO_REG_FUNC; -+ else -+ BUG(); -+@@ -187,7 +187,7 @@ void __init ath79_gpio_output_select(uns -+ unsigned int reg; -+ u32 t, s; -+ -+- BUG_ON(!soc_is_ar934x()); -++ BUG_ON(!soc_is_ar934x() && !soc_is_qca953x()); -+ -+ if (gpio >= AR934X_GPIO_COUNT) -+ return; - @@ -224,6 +224,8 @@ void __init ath79_gpio_init(void) - ath79_gpio_count = AR933X_GPIO_COUNT; - else if (soc_is_ar934x()) -@@ -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 --@@ -352,6 +353,9 @@ void __init arch_init_irq(void) -+@@ -153,6 +154,38 @@ static void ar934x_ip2_irq_init(void) -+ irq_set_chained_handler(ATH79_CPU_IRQ(2), ar934x_ip2_irq_dispatch); -+ } -+ -++static void qca953x_ip2_irq_dispatch(unsigned int irq, struct irq_desc *desc) -++{ -++ u32 status; -++ -++ disable_irq_nosync(irq); -++ -++ status = ath79_reset_rr(QCA953X_RESET_REG_PCIE_WMAC_INT_STATUS); -++ -++ if (status & QCA953X_PCIE_WMAC_INT_PCIE_ALL) { -++ ath79_ddr_wb_flush(QCA953X_DDR_REG_FLUSH_PCIE); -++ generic_handle_irq(ATH79_IP2_IRQ(0)); -++ } else if (status & QCA953X_PCIE_WMAC_INT_WMAC_ALL) { -++ ath79_ddr_wb_flush(QCA953X_DDR_REG_FLUSH_WMAC); -++ generic_handle_irq(ATH79_IP2_IRQ(1)); -++ } else { -++ spurious_interrupt(); -++ } -++ -++ enable_irq(irq); -++} -++ -++static void qca953x_irq_init(void) -++{ -++ int i; -++ -++ for (i = ATH79_IP2_IRQ_BASE; -++ i < ATH79_IP2_IRQ_BASE + ATH79_IP2_IRQ_COUNT; i++) -++ irq_set_chip_and_handler(i, &dummy_irq_chip, handle_level_irq); -++ -++ irq_set_chained_handler(ATH79_CPU_IRQ(2), qca953x_ip2_irq_dispatch); -++} -++ -+ static void qca955x_ip2_irq_dispatch(unsigned int irq, struct irq_desc *desc) -+ { -+ u32 status; -+@@ -335,6 +368,12 @@ static void ar934x_ip3_handler(void) -+ do_IRQ(ATH79_CPU_IRQ(3)); -+ } -+ -++static void qca953x_ip3_handler(void) -++{ -++ ath79_ddr_wb_flush(QCA953X_DDR_REG_FLUSH_USB); -++ do_IRQ(ATH79_CPU_IRQ(3)); -++} -++ -+ void __init arch_init_irq(void) -+ { -+ if (soc_is_ar71xx()) { -+@@ -352,6 +391,9 @@ void __init arch_init_irq(void) - } else if (soc_is_ar934x()) { - ath79_ip2_handler = ath79_default_ip2_handler; - ath79_ip3_handler = ar934x_ip3_handler; - + } else if (soc_is_qca953x()) { - + ath79_ip2_handler = ath79_default_ip2_handler; --+ ath79_ip3_handler = ath79_default_ip3_handler; -++ ath79_ip3_handler = qca953x_ip3_handler; - } else if (soc_is_qca955x()) { - ath79_ip2_handler = ath79_default_ip2_handler; - ath79_ip3_handler = ath79_default_ip3_handler; -+@@ -365,6 +407,8 @@ void __init arch_init_irq(void) -+ -+ if (soc_is_ar934x()) -+ ar934x_ip2_irq_init(); -++ else if (soc_is_qca953x()) -++ qca953x_irq_init(); -+ else if (soc_is_qca955x()) -+ qca955x_irq_init(); -+ } - --- a/arch/mips/ath79/setup.c - +++ b/arch/mips/ath79/setup.c - @@ -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 @@ -+@@ -105,6 +105,21 @@ - #define AR934X_SRIF_BASE (AR71XX_APB_BASE + 0x00116000) - #define AR934X_SRIF_SIZE 0x1000 - -++#define QCA953X_GMAC_BASE (AR71XX_APB_BASE + 0x00070000) -++#define QCA953X_GMAC_SIZE 0x14 - +#define QCA953X_WMAC_BASE (AR71XX_APB_BASE + 0x00100000) - +#define QCA953X_WMAC_SIZE 0x20000 -++#define QCA953X_EHCI_BASE 0x1b000000 -++#define QCA953X_EHCI_SIZE 0x200 -++#define QCA953X_SRIF_BASE (AR71XX_APB_BASE + 0x00116000) -++#define QCA953X_SRIF_SIZE 0x1000 -++ -++#define QCA953X_PCI_CFG_BASE0 0x14000000 -++#define QCA953X_PCI_CTRL_BASE0 (AR71XX_APB_BASE + 0x000f0000) -++#define QCA953X_PCI_CRP_BASE0 (AR71XX_APB_BASE + 0x000c0000) -++#define QCA953X_PCI_MEM_BASE0 0x10000000 -++#define QCA953X_PCI_MEM_SIZE 0x02000000 - + - #define QCA955X_PCI_MEM_BASE0 0x10000000 - #define QCA955X_PCI_MEM_BASE1 0x12000000 - #define QCA955X_PCI_MEM_SIZE 0x02000000 --@@ -279,6 +282,43 @@ -+@@ -173,6 +188,12 @@ -+ #define AR934X_DDR_REG_FLUSH_PCIE 0xa8 -+ #define AR934X_DDR_REG_FLUSH_WMAC 0xac -+ -++#define QCA953X_DDR_REG_FLUSH_GE0 0x9c -++#define QCA953X_DDR_REG_FLUSH_GE1 0xa0 -++#define QCA953X_DDR_REG_FLUSH_USB 0xa4 -++#define QCA953X_DDR_REG_FLUSH_PCIE 0xa8 -++#define QCA953X_DDR_REG_FLUSH_WMAC 0xac -++ -+ /* -+ * PLL block -+ */ -+@@ -279,6 +300,44 @@ - - #define AR934X_PLL_SWITCH_CLOCK_CONTROL_MDIO_CLK_SEL BIT(6) - - +#define QCA953X_PLL_CPU_CONFIG_REG 0x00 - +#define QCA953X_PLL_DDR_CONFIG_REG 0x04 - +#define QCA953X_PLL_CLK_CTRL_REG 0x08 -++#define QCA953X_PLL_SWITCH_CLOCK_CONTROL_REG 0x24 - +#define QCA953X_PLL_ETH_XMII_CONTROL_REG 0x2c - +#define QCA953X_PLL_ETH_SGMII_CONTROL_REG 0x48 - + -@@ -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 --+#define QCA953X_PLL_CPU_CONFIG_OUTDIV_MASK 0x3 -++#define QCA953X_PLL_CPU_CONFIG_OUTDIV_MASK 0x7 - + - +#define QCA953X_PLL_DDR_CONFIG_NFRAC_SHIFT 0 - +#define QCA953X_PLL_DDR_CONFIG_NFRAC_MASK 0x3ff -@@ -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 --@@ -355,6 +395,10 @@ -+@@ -355,6 +414,10 @@ - #define AR934X_RESET_REG_BOOTSTRAP 0xb0 - #define AR934X_RESET_REG_PCIE_WMAC_INT_STATUS 0xac - - +#define QCA953X_RESET_REG_RESET_MODULE 0x1c - +#define QCA953X_RESET_REG_BOOTSTRAP 0xb0 --+#define QCA953X_RESET_REG_EXT_INT_STATUS 0xac -++#define QCA953X_RESET_REG_PCIE_WMAC_INT_STATUS 0xac - + - #define QCA955X_RESET_REG_RESET_MODULE 0x1c - #define QCA955X_RESET_REG_BOOTSTRAP 0xb0 - #define QCA955X_RESET_REG_EXT_INT_STATUS 0xac --@@ -503,6 +547,8 @@ -+@@ -450,6 +513,27 @@ -+ #define AR934X_RESET_MBOX BIT(1) -+ #define AR934X_RESET_I2S BIT(0) -+ -++#define QCA953X_RESET_USB_EXT_PWR BIT(29) -++#define QCA953X_RESET_EXTERNAL BIT(28) -++#define QCA953X_RESET_RTC BIT(27) -++#define QCA953X_RESET_FULL_CHIP BIT(24) -++#define QCA953X_RESET_GE1_MDIO BIT(23) -++#define QCA953X_RESET_GE0_MDIO BIT(22) -++#define QCA953X_RESET_CPU_NMI BIT(21) -++#define QCA953X_RESET_CPU_COLD BIT(20) -++#define QCA953X_RESET_DDR BIT(16) -++#define QCA953X_RESET_USB_PHY_PLL_PWD_EXT BIT(15) -++#define QCA953X_RESET_GE1_MAC BIT(13) -++#define QCA953X_RESET_ETH_SWITCH_ANALOG BIT(12) -++#define QCA953X_RESET_USB_PHY_ANALOG BIT(11) -++#define QCA953X_RESET_GE0_MAC BIT(9) -++#define QCA953X_RESET_ETH_SWITCH BIT(8) -++#define QCA953X_RESET_PCIE_PHY BIT(7) -++#define QCA953X_RESET_PCIE BIT(6) -++#define QCA953X_RESET_USB_HOST BIT(5) -++#define QCA953X_RESET_USB_PHY BIT(4) -++#define QCA953X_RESET_USBSUS_OVERRIDE BIT(3) -++ -+ #define QCA955X_RESET_HOST BIT(31) -+ #define QCA955X_RESET_SLIC BIT(30) -+ #define QCA955X_RESET_HDMA BIT(29) -+@@ -503,6 +587,13 @@ - #define AR934X_BOOTSTRAP_SDRAM_DISABLED BIT(1) - #define AR934X_BOOTSTRAP_DDR1 BIT(0) - -++#define QCA953X_BOOTSTRAP_SW_OPTION2 BIT(12) -++#define QCA953X_BOOTSTRAP_SW_OPTION1 BIT(11) -++#define QCA953X_BOOTSTRAP_EJTAG_MODE BIT(5) - +#define QCA953X_BOOTSTRAP_REF_CLK_40 BIT(4) -++#define QCA953X_BOOTSTRAP_SDRAM_DISABLED BIT(1) -++#define QCA953X_BOOTSTRAP_DDR1 BIT(0) - + - #define QCA955X_BOOTSTRAP_REF_CLK_40 BIT(4) - - #define AR934X_PCIE_WMAC_INT_WMAC_MISC BIT(0) --@@ -565,6 +611,8 @@ -+@@ -523,6 +614,24 @@ -+ AR934X_PCIE_WMAC_INT_PCIE_RC1 | AR934X_PCIE_WMAC_INT_PCIE_RC2 | \ -+ AR934X_PCIE_WMAC_INT_PCIE_RC3) -+ -++#define QCA953X_PCIE_WMAC_INT_WMAC_MISC BIT(0) -++#define QCA953X_PCIE_WMAC_INT_WMAC_TX BIT(1) -++#define QCA953X_PCIE_WMAC_INT_WMAC_RXLP BIT(2) -++#define QCA953X_PCIE_WMAC_INT_WMAC_RXHP BIT(3) -++#define QCA953X_PCIE_WMAC_INT_PCIE_RC BIT(4) -++#define QCA953X_PCIE_WMAC_INT_PCIE_RC0 BIT(5) -++#define QCA953X_PCIE_WMAC_INT_PCIE_RC1 BIT(6) -++#define QCA953X_PCIE_WMAC_INT_PCIE_RC2 BIT(7) -++#define QCA953X_PCIE_WMAC_INT_PCIE_RC3 BIT(8) -++#define QCA953X_PCIE_WMAC_INT_WMAC_ALL \ -++ (QCA953X_PCIE_WMAC_INT_WMAC_MISC | QCA953X_PCIE_WMAC_INT_WMAC_TX | \ -++ QCA953X_PCIE_WMAC_INT_WMAC_RXLP | QCA953X_PCIE_WMAC_INT_WMAC_RXHP) -++ -++#define QCA953X_PCIE_WMAC_INT_PCIE_ALL \ -++ (QCA953X_PCIE_WMAC_INT_PCIE_RC | QCA953X_PCIE_WMAC_INT_PCIE_RC0 | \ -++ QCA953X_PCIE_WMAC_INT_PCIE_RC1 | QCA953X_PCIE_WMAC_INT_PCIE_RC2 | \ -++ QCA953X_PCIE_WMAC_INT_PCIE_RC3) -++ -+ #define QCA955X_EXT_INT_WMAC_MISC BIT(0) -+ #define QCA955X_EXT_INT_WMAC_TX BIT(1) -+ #define QCA955X_EXT_INT_WMAC_RXLP BIT(2) -+@@ -565,6 +674,8 @@ - #define REV_ID_MAJOR_AR9341 0x0120 - #define REV_ID_MAJOR_AR9342 0x1120 - #define REV_ID_MAJOR_AR9344 0x2120 -@@ -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 - --@@ -587,6 +635,8 @@ -+@@ -587,6 +698,8 @@ - - #define AR934X_REV_ID_REVISION_MASK 0xf - -@@ -421,14 +626,81 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. - #define QCA955X_REV_ID_REVISION_MASK 0xf - - /* --@@ -640,6 +690,7 @@ -+@@ -634,12 +747,32 @@ -+ #define AR934X_GPIO_REG_OUT_FUNC5 0x40 -+ #define AR934X_GPIO_REG_FUNC 0x6c -+ -++#define QCA953X_GPIO_REG_OUT_FUNC0 0x2c -++#define QCA953X_GPIO_REG_OUT_FUNC1 0x30 -++#define QCA953X_GPIO_REG_OUT_FUNC2 0x34 -++#define QCA953X_GPIO_REG_OUT_FUNC3 0x38 -++#define QCA953X_GPIO_REG_OUT_FUNC4 0x3c -++#define QCA953X_GPIO_REG_IN_ENABLE0 0x44 -++#define QCA953X_GPIO_REG_FUNC 0x6c -++ -++#define QCA953X_GPIO_OUT_MUX_SPI_CS1 10 -++#define QCA953X_GPIO_OUT_MUX_SPI_CS2 11 -++#define QCA953X_GPIO_OUT_MUX_SPI_CS0 9 -++#define QCA953X_GPIO_OUT_MUX_SPI_CLK 8 -++#define QCA953X_GPIO_OUT_MUX_SPI_MOSI 12 -++#define QCA953X_GPIO_OUT_MUX_LED_LINK1 41 -++#define QCA953X_GPIO_OUT_MUX_LED_LINK2 42 -++#define QCA953X_GPIO_OUT_MUX_LED_LINK3 43 -++#define QCA953X_GPIO_OUT_MUX_LED_LINK4 44 -++#define QCA953X_GPIO_OUT_MUX_LED_LINK5 45 -++ -+ #define AR71XX_GPIO_COUNT 16 -+ #define AR7240_GPIO_COUNT 18 -+ #define AR7241_GPIO_COUNT 20 - #define AR913X_GPIO_COUNT 22 - #define AR933X_GPIO_COUNT 30 - #define AR934X_GPIO_COUNT 23 --+#define QCA953X_GPIO_COUNT 24 -++#define QCA953X_GPIO_COUNT 18 - #define QCA955X_GPIO_COUNT 24 - - /* -+@@ -663,6 +796,24 @@ -+ #define AR934X_SRIF_DPLL2_OUTDIV_SHIFT 13 -+ #define AR934X_SRIF_DPLL2_OUTDIV_MASK 0x7 -+ -++#define QCA953X_SRIF_CPU_DPLL1_REG 0x1c0 -++#define QCA953X_SRIF_CPU_DPLL2_REG 0x1c4 -++#define QCA953X_SRIF_CPU_DPLL3_REG 0x1c8 -++ -++#define QCA953X_SRIF_DDR_DPLL1_REG 0x240 -++#define QCA953X_SRIF_DDR_DPLL2_REG 0x244 -++#define QCA953X_SRIF_DDR_DPLL3_REG 0x248 -++ -++#define QCA953X_SRIF_DPLL1_REFDIV_SHIFT 27 -++#define QCA953X_SRIF_DPLL1_REFDIV_MASK 0x1f -++#define QCA953X_SRIF_DPLL1_NINT_SHIFT 18 -++#define QCA953X_SRIF_DPLL1_NINT_MASK 0x1ff -++#define QCA953X_SRIF_DPLL1_NFRAC_MASK 0x0003ffff -++ -++#define QCA953X_SRIF_DPLL2_LOCAL_PLL BIT(30) -++#define QCA953X_SRIF_DPLL2_OUTDIV_SHIFT 13 -++#define QCA953X_SRIF_DPLL2_OUTDIV_MASK 0x7 -++ -+ #define AR71XX_GPIO_FUNC_STEREO_EN BIT(17) -+ #define AR71XX_GPIO_FUNC_SLIC_EN BIT(16) -+ #define AR71XX_GPIO_FUNC_SPI_CS2_EN BIT(13) -+@@ -804,6 +955,16 @@ -+ #define AR934X_ETH_CFG_RDV_DELAY_SHIFT 16 -+ -+ /* -++ * QCA953X GMAC Interface -++ */ -++#define QCA953X_GMAC_REG_ETH_CFG 0x00 -++ -++#define QCA953X_ETH_CFG_SW_ONLY_MODE BIT(6) -++#define QCA953X_ETH_CFG_SW_PHY_SWAP BIT(7) -++#define QCA953X_ETH_CFG_SW_APB_ACCESS BIT(9) -++#define QCA953X_ETH_CFG_SW_ACC_MSB_FIRST BIT(13) -++ -++/* -+ * QCA955X GMAC Interface -+ */ -+ - --- a/arch/mips/include/asm/mach-ath79/ath79.h - +++ 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 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 @@ - ath79_uart_data[0].uartclk = uart_clk_rate; - platform_device_register(&ath79_uart_device); - } else if (soc_is_ar933x()) { ----- a/arch/mips/ath79/dev-eth.c --+++ b/arch/mips/ath79/dev-eth.c --@@ -198,6 +198,8 @@ void __init ath79_register_mdio(unsigned -- case ATH79_SOC_AR9330: -- case ATH79_SOC_AR9331: -- case ATH79_SOC_QCA9533: --+ case ATH79_SOC_QCA9561: --+ case ATH79_SOC_TP9343: -- mdio_dev = &ath79_mdio1_device; -- mdio_data = &ath79_mdio1_data; -- break; --@@ -256,6 +258,8 @@ void __init ath79_register_mdio(unsigned -- break; -- -- case ATH79_SOC_QCA9533: --+ case ATH79_SOC_QCA9561: --+ case ATH79_SOC_TP9343: -- mdio_data->builtin_switch = 1; -- break; -- --@@ -571,6 +575,8 @@ static void __init ath79_init_eth_pll_da -- case ATH79_SOC_QCA9533: -- case ATH79_SOC_QCA9556: -- case ATH79_SOC_QCA9558: --+ case ATH79_SOC_QCA9561: --+ case ATH79_SOC_TP9343: -- pll_10 = AR934X_PLL_VAL_10; -- pll_100 = AR934X_PLL_VAL_100; -- pll_1000 = AR934X_PLL_VAL_1000; --@@ -627,6 +633,8 @@ static int __init ath79_setup_phy_if_mod -- case ATH79_SOC_AR9330: -- case ATH79_SOC_AR9331: -- case ATH79_SOC_QCA9533: --+ case ATH79_SOC_QCA9561: --+ case ATH79_SOC_TP9343: -- pdata->phy_if_mode = PHY_INTERFACE_MODE_MII; -- break; -- --@@ -688,6 +696,8 @@ static int __init ath79_setup_phy_if_mod -- case ATH79_SOC_AR9330: -- case ATH79_SOC_AR9331: -- case ATH79_SOC_QCA9533: --+ case ATH79_SOC_QCA9561: --+ case ATH79_SOC_TP9343: -- pdata->phy_if_mode = PHY_INTERFACE_MODE_GMII; -- break; -- --@@ -1018,6 +1028,8 @@ void __init ath79_register_eth(unsigned -- break; -- -- case ATH79_SOC_QCA9533: --+ case ATH79_SOC_QCA9561: --+ case ATH79_SOC_TP9343: -- if (id == 0) { -- pdata->reset_bit = AR933X_RESET_GE0_MAC | -- AR933X_RESET_GE0_MDIO; --@@ -1123,6 +1135,8 @@ void __init ath79_register_eth(unsigned -- case ATH79_SOC_AR9330: -- case ATH79_SOC_AR9331: -- case ATH79_SOC_QCA9533: --+ case ATH79_SOC_QCA9561: --+ case ATH79_SOC_TP9343: -- pdata->mii_bus_dev = &ath79_mdio1_device.dev; -- break; -- - --- a/arch/mips/ath79/dev-usb.c - +++ b/arch/mips/ath79/dev-usb.c --@@ -272,6 +272,19 @@ static void __init qca955x_usb_setup(voi -+@@ -296,6 +296,19 @@ static void __init qca955x_usb_setup(voi - &ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2)); - } - -@@ -229,8 +164,8 @@ - void __init ath79_register_usb(void) - { - if (soc_is_ar71xx()) --@@ -288,6 +301,8 @@ void __init ath79_register_usb(void) -- ar934x_usb_setup(); -+@@ -314,6 +327,8 @@ void __init ath79_register_usb(void) -+ qca953x_usb_setup(); - else if (soc_is_qca955x()) - qca955x_usb_setup(); - + else if (soc_is_qca9561()) -@@ -291,9 +226,9 @@ - soc_is_ar913x() || - soc_is_ar933x()) - reg = AR71XX_GPIO_REG_FUNC; --- else if (soc_is_ar934x()) -+- else if (soc_is_ar934x() || soc_is_qca953x()) - + else if (soc_is_ar934x() || --+ soc_is_qca956x()) -++ soc_is_qca953x() || soc_is_qca956x()) - reg = AR934X_GPIO_REG_FUNC; - else - BUG(); -@@ -326,7 +261,7 @@ - ath79_misc_irq_chip.irq_ack = ar724x_misc_irq_ack; - else - BUG(); --@@ -236,6 +237,99 @@ static void qca955x_irq_init(void) -+@@ -268,6 +269,97 @@ static void qca955x_irq_init(void) - irq_set_chained_handler(ATH79_CPU_IRQ(3), qca955x_ip3_irq_dispatch); - } - -@@ -406,15 +341,13 @@ - + - + for (i = ATH79_IP2_IRQ_BASE; - + i < ATH79_IP2_IRQ_BASE + ATH79_IP2_IRQ_COUNT; i++) --+ irq_set_chip_and_handler(i, &dummy_irq_chip, --+ handle_level_irq); -++ irq_set_chip_and_handler(i, &dummy_irq_chip, handle_level_irq); - + - + irq_set_chained_handler(ATH79_CPU_IRQ(2), qca956x_ip2_irq_dispatch); - + - + for (i = ATH79_IP3_IRQ_BASE; - + i < ATH79_IP3_IRQ_BASE + ATH79_IP3_IRQ_COUNT; i++) --+ irq_set_chip_and_handler(i, &dummy_irq_chip, --+ handle_level_irq); -++ irq_set_chip_and_handler(i, &dummy_irq_chip, handle_level_irq); - + - + irq_set_chained_handler(ATH79_CPU_IRQ(3), qca956x_ip3_irq_dispatch); - + -@@ -426,7 +359,7 @@ - asmlinkage void plat_irq_dispatch(void) - { - unsigned long pending; --@@ -359,6 +453,9 @@ void __init arch_init_irq(void) -+@@ -397,6 +489,9 @@ void __init arch_init_irq(void) - } else if (soc_is_qca955x()) { - ath79_ip2_handler = ath79_default_ip2_handler; - ath79_ip3_handler = ath79_default_ip3_handler; -@@ -436,8 +369,8 @@ - } else { - BUG(); - } --@@ -371,4 +468,6 @@ void __init arch_init_irq(void) -- ar934x_ip2_irq_init(); -+@@ -411,4 +506,6 @@ void __init arch_init_irq(void) -+ qca953x_irq_init(); - else if (soc_is_qca955x()) - qca955x_irq_init(); - + else if (soc_is_qca956x()) -@@ -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 @@ -+@@ -143,6 +143,23 @@ - #define QCA955X_NFC_BASE 0x1b800200 - #define QCA955X_NFC_SIZE 0xb8 - -@@ -578,7 +511,7 @@ - #define AR9300_OTP_BASE 0x14000 - #define AR9300_OTP_STATUS 0x15f18 - #define AR9300_OTP_STATUS_TYPE 0x7 --@@ -356,6 +373,49 @@ -+@@ -375,6 +392,49 @@ - #define QCA955X_PLL_CLK_CTRL_DDRCLK_FROM_DDRPLL BIT(21) - #define QCA955X_PLL_CLK_CTRL_AHBCLK_FROM_DDRPLL BIT(24) - -@@ -628,7 +561,7 @@ - /* - * USB_CONFIG block - */ --@@ -403,6 +463,11 @@ -+@@ -422,6 +482,11 @@ - #define QCA955X_RESET_REG_BOOTSTRAP 0xb0 - #define QCA955X_RESET_REG_EXT_INT_STATUS 0xac - -@@ -640,7 +573,7 @@ - #define MISC_INT_ETHSW BIT(12) - #define MISC_INT_TIMER4 BIT(10) - #define MISC_INT_TIMER3 BIT(9) --@@ -551,6 +616,8 @@ -+@@ -596,6 +661,8 @@ - - #define QCA955X_BOOTSTRAP_REF_CLK_40 BIT(4) - -@@ -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) --@@ -600,6 +667,37 @@ -+@@ -663,6 +730,37 @@ - QCA955X_EXT_INT_PCIE_RC2_INT1 | QCA955X_EXT_INT_PCIE_RC2_INT2 | \ - QCA955X_EXT_INT_PCIE_RC2_INT3) - -@@ -687,7 +620,7 @@ - #define REV_ID_MAJOR_MASK 0xfff0 - #define REV_ID_MAJOR_AR71XX 0x00a0 - #define REV_ID_MAJOR_AR913X 0x00b0 --@@ -615,6 +713,8 @@ -+@@ -678,6 +776,8 @@ - #define REV_ID_MAJOR_QCA9533_V2 0x0160 - #define REV_ID_MAJOR_QCA9556 0x0130 - #define REV_ID_MAJOR_QCA9558 0x1130 -@@ -696,7 +629,7 @@ - - #define AR71XX_REV_ID_MINOR_MASK 0x3 - #define AR71XX_REV_ID_MINOR_AR7130 0x0 --@@ -639,6 +739,8 @@ -+@@ -702,6 +802,8 @@ - - #define QCA955X_REV_ID_REVISION_MASK 0xf - -@@ -705,9 +638,9 @@ - /* - * SPI block - */ --@@ -684,6 +786,19 @@ -- #define AR934X_GPIO_REG_OUT_FUNC5 0x40 -- #define AR934X_GPIO_REG_FUNC 0x6c -+@@ -766,6 +868,19 @@ -+ #define QCA953X_GPIO_OUT_MUX_LED_LINK4 44 -+ #define QCA953X_GPIO_OUT_MUX_LED_LINK5 45 - - +#define QCA956X_GPIO_REG_OUT_FUNC0 0x2c - +#define QCA956X_GPIO_REG_OUT_FUNC1 0x30 -@@ -725,9 +658,9 @@ - #define AR71XX_GPIO_COUNT 16 - #define AR7240_GPIO_COUNT 18 - #define AR7241_GPIO_COUNT 20 --@@ -692,6 +807,7 @@ -+@@ -774,6 +889,7 @@ - #define AR934X_GPIO_COUNT 23 -- #define QCA953X_GPIO_COUNT 24 -+ #define QCA953X_GPIO_COUNT 18 - #define QCA955X_GPIO_COUNT 24 - +#define QCA956X_GPIO_COUNT 23 - -diff --git a/target/linux/ar71xx/patches-3.18/736-MIPS-ath79-fix-chained-irq-disable.patch b/target/linux/ar71xx/patches-3.18/736-MIPS-ath79-fix-chained-irq-disable.patch -index 8cb38d3..8c0cc95 100644 ---- a/target/linux/ar71xx/patches-3.18/736-MIPS-ath79-fix-chained-irq-disable.patch -+++ b/target/linux/ar71xx/patches-3.18/736-MIPS-ath79-fix-chained-irq-disable.patch -@@ -19,7 +19,16 @@ - - irq_set_chained_handler(ATH79_CPU_IRQ(2), ar934x_ip2_irq_dispatch); - } --@@ -224,15 +225,13 @@ static void qca955x_irq_init(void) -+@@ -182,7 +183,7 @@ static void qca953x_irq_init(void) -+ -+ for (i = ATH79_IP2_IRQ_BASE; -+ i < ATH79_IP2_IRQ_BASE + ATH79_IP2_IRQ_COUNT; i++) -+- irq_set_chip_and_handler(i, &dummy_irq_chip, handle_level_irq); -++ irq_set_chip_and_handler(i, &ip2_chip, handle_level_irq); -+ -+ irq_set_chained_handler(ATH79_CPU_IRQ(2), qca953x_ip2_irq_dispatch); -+ } -+@@ -256,15 +257,13 @@ static void qca955x_irq_init(void) - - for (i = ATH79_IP2_IRQ_BASE; - i < ATH79_IP2_IRQ_BASE + ATH79_IP2_IRQ_COUNT; i++) -@@ -37,25 +46,23 @@ - - irq_set_chained_handler(ATH79_CPU_IRQ(3), qca955x_ip3_irq_dispatch); - } --@@ -313,15 +312,13 @@ static void qca956x_irq_init(void) -+@@ -345,13 +344,13 @@ static void qca956x_irq_init(void) - - for (i = ATH79_IP2_IRQ_BASE; - i < ATH79_IP2_IRQ_BASE + ATH79_IP2_IRQ_COUNT; i++) --- irq_set_chip_and_handler(i, &dummy_irq_chip, --- handle_level_irq); -+- irq_set_chip_and_handler(i, &dummy_irq_chip, handle_level_irq); - + irq_set_chip_and_handler(i, &ip2_chip, handle_level_irq); - - irq_set_chained_handler(ATH79_CPU_IRQ(2), qca956x_ip2_irq_dispatch); - - for (i = ATH79_IP3_IRQ_BASE; - i < ATH79_IP3_IRQ_BASE + ATH79_IP3_IRQ_COUNT; i++) --- irq_set_chip_and_handler(i, &dummy_irq_chip, --- handle_level_irq); -+- irq_set_chip_and_handler(i, &dummy_irq_chip, handle_level_irq); - + irq_set_chip_and_handler(i, &ip3_chip, handle_level_irq); - - irq_set_chained_handler(ATH79_CPU_IRQ(3), qca956x_ip3_irq_dispatch); - --@@ -430,8 +427,35 @@ static void ar934x_ip3_handler(void) -+@@ -466,8 +465,35 @@ static void qca953x_ip3_handler(void) - do_IRQ(ATH79_CPU_IRQ(3)); - } - diff --git a/patches/openwrt/0019-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 deleted file mode 100644 index 5aa64854..00000000 --- a/patches/openwrt/0019-base-files-default_postinst-propagate-the-real-postinst-return-code.patch +++ /dev/null @@ -1,44 +0,0 @@ -From: Matthias Schiffer -Date: Fri, 7 Aug 2015 18:45:42 +0200 -Subject: base-files: default_postinst: propagate the real postinst return code - -Using the postinst script for sanity checks and expecting opkg to fail -if the postinst didn't return 0 was possible in Barrier Breaker, propagate -the real postinst return code through default_postinst to restore this -behaviour. - -diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh -index 8d045fa..2f78d67 100755 ---- a/package/base-files/files/lib/functions.sh -+++ b/package/base-files/files/lib/functions.sh -@@ -174,7 +174,8 @@ default_prerm() { - } - - default_postinst() { -- local pkgname rusers -+ local pkgname rusers ret -+ ret=0 - pkgname=$(basename ${1%.*}) - rusers=$(grep "Require-User:" ${IPKG_INSTROOT}/usr/lib/opkg/info/${pkgname}.control) - [ -n "$rusers" ] && { -@@ -215,7 +216,10 @@ default_postinst() { - done - } - -- [ -f ${IPKG_INSTROOT}/usr/lib/opkg/info/${pkgname}.postinst-pkg ] && ( . ${IPKG_INSTROOT}/usr/lib/opkg/info/${pkgname}.postinst-pkg ) -+ if [ -f ${IPKG_INSTROOT}/usr/lib/opkg/info/${pkgname}.postinst-pkg ]; then -+ ( . ${IPKG_INSTROOT}/usr/lib/opkg/info/${pkgname}.postinst-pkg ) -+ ret=$? -+ fi - [ -n "${IPKG_INSTROOT}" ] || rm -f /tmp/luci-indexcache 2>/dev/null - - [ "$PKG_UPGRADE" = "1" ] || for i in `cat ${IPKG_INSTROOT}/usr/lib/opkg/info/${pkgname}.list | grep "^/etc/init.d/"`; do -@@ -225,7 +229,7 @@ default_postinst() { - $i start - } - done -- return 0 -+ return $ret - } - - include() { diff --git a/patches/openwrt/0020-opkg-work-around-unconditional-libopenssl-build-dependency.patch b/patches/openwrt/0020-opkg-work-around-unconditional-libopenssl-build-dependency.patch deleted file mode 100644 index 77d8a05b..00000000 --- a/patches/openwrt/0020-opkg-work-around-unconditional-libopenssl-build-dependency.patch +++ /dev/null @@ -1,22 +0,0 @@ -From: Matthias Schiffer -Date: Fri, 28 Aug 2015 10:43:55 +0200 -Subject: opkg: work around unconditional libopenssl build dependency - -As the OpenWrt build system only resolves build dependencies per directory, -all opkg variants were causing libopenssl to be downloaded and built, -not only opkg-smime. Fix this by applying the same workaround as in -ustream-ssl. - -diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile -index 76688f5..3e39cf8 100644 ---- a/package/system/opkg/Makefile -+++ b/package/system/opkg/Makefile -@@ -72,7 +72,7 @@ endef - define Package/opkg-smime - $(call Package/opkg/Default) - TITLE+= (with S/MIME signature support) -- DEPENDS+=+libopenssl -+ DEPENDS+=+PACKAGE_opkg-smime:libopenssl - VARIANT:=smime - endef - diff --git a/patches/openwrt/0021-hostapd-work-around-unconditional-libopenssl-build-dependency.patch b/patches/openwrt/0021-hostapd-work-around-unconditional-libopenssl-build-dependency.patch deleted file mode 100644 index 289a94a1..00000000 --- a/patches/openwrt/0021-hostapd-work-around-unconditional-libopenssl-build-dependency.patch +++ /dev/null @@ -1,22 +0,0 @@ -From: Matthias Schiffer -Date: Fri, 28 Aug 2015 10:46:11 +0200 -Subject: hostapd: work around unconditional libopenssl build dependency - -As the OpenWrt build system only resolves build dependencies per directory, -all hostapd variants were causing libopenssl to be downloaded and built, -not only wpad-mesh. Fix this by applying the same workaround as in -ustream-ssl. - -diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile -index c16cb11..c39b6b4 100644 ---- a/package/network/services/hostapd/Makefile -+++ b/package/network/services/hostapd/Makefile -@@ -177,7 +177,7 @@ endef - define Package/wpad-mesh - $(call Package/wpad/Default) - TITLE+= (with 802.11s mesh and SAE support) -- DEPENDS:=$(DRV_DEPENDS) +libubus +libopenssl +@CONFIG_WPA_SUPPLICANT_OPENSSL @(!TARGET_uml||BROKEN) -+ DEPENDS:=$(DRV_DEPENDS) +libubus +PACKAGE_wpad-mesh:libopenssl +@CONFIG_WPA_SUPPLICANT_OPENSSL @(!TARGET_uml||BROKEN) - CONFLICTS:=@WPA_SUPPLICANT_INTERNAL - VARIANT:=wpad-mesh - endef diff --git a/patches/openwrt/0022-odhcp6c-minor-fixes.patch b/patches/openwrt/0022-odhcp6c-minor-fixes.patch deleted file mode 100644 index 2b0a56b8..00000000 --- a/patches/openwrt/0022-odhcp6c-minor-fixes.patch +++ /dev/null @@ -1,77 +0,0 @@ -From: Nils Schneider -Date: Thu, 3 Sep 2015 18:07:17 +0200 -Subject: odhcp6c: minor fixes - -Better synchronize RA & DHCPv6 events -Accumulate some events to avoid flooding -Restart softwires for address and prefix changes - -Signed-off-by: Steven Barth - -diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile -index 75de54c..aa81e02 100644 ---- a/package/network/ipv6/odhcp6c/Makefile -+++ b/package/network/ipv6/odhcp6c/Makefile -@@ -8,14 +8,14 @@ - include $(TOPDIR)/rules.mk - - PKG_NAME:=odhcp6c --PKG_VERSION:=2015-07-18 -+PKG_VERSION:=2015-07-29 - PKG_RELEASE=$(PKG_SOURCE_VERSION) - - PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 - PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) - PKG_SOURCE_URL:=https://github.com/sbyx/odhcp6c.git - PKG_SOURCE_PROTO:=git --PKG_SOURCE_VERSION:=024525798c5f6aba3af9b2ef7b3af2f3c14f1db8 -+PKG_SOURCE_VERSION:=dc186d6d2b0dd4ad23ca5fc69c00e81f796ff6d9 - PKG_MAINTAINER:=Steven Barth - PKG_LICENSE:=GPL-2.0 - -diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.script b/package/network/ipv6/odhcp6c/files/dhcpv6.script -index 33f6d9b..677d35f 100755 ---- a/package/network/ipv6/odhcp6c/files/dhcpv6.script -+++ b/package/network/ipv6/odhcp6c/files/dhcpv6.script -@@ -5,6 +5,8 @@ - - setup_interface () { - local device="$1" -+ local prefsig="" -+ local addrsig="" - proto_init_update "*" 1 - - # Merge RA-DNS -@@ -34,6 +36,7 @@ setup_interface () { - - for prefix in $PREFIXES; do - proto_add_ipv6_prefix "$prefix" -+ prefsig="$prefsig ${prefix%%,*}" - local entry="${prefix#*/}" - entry="${entry#*,}" - entry="${entry#*,}" -@@ -68,6 +71,7 @@ setup_interface () { - local valid="${entry%%,*}" - - proto_add_ipv6_address "$addr" "$mask" "$preferred" "$valid" 1 -+ addrsig="$addrsig $addr/$mask" - - if [ -z "$RA_ADDRESSES" -a -z "$RA_ROUTES" -a \ - -z "$RA_DNS" -a "$FAKE_ROUTES" = 1 ]; then -@@ -136,6 +140,8 @@ setup_interface () { - json_add_string ifname "@$INTERFACE" - json_add_string proto map - json_add_string type "$MAPTYPE" -+ json_add_string _prefsig "$prefsig" -+ [ "$MAPTYPE" = lw4o6 ] && json_add_string _addrsig "$addrsig" - json_add_string rule "$MAPRULE" - json_add_string tunlink "$INTERFACE" - [ -n "$ZONE_MAP" ] || ZONE_MAP=$ZONE -@@ -163,6 +169,7 @@ setup_interface () { - json_add_string ifname "@$INTERFACE" - json_add_string proto "464xlat" - json_add_string tunlink "$INTERFACE" -+ json_add_string _addrsig "$addrsig" - [ -n "$ZONE_464XLAT" ] || ZONE_464XLAT=$ZONE - [ -n "$ZONE_464XLAT" ] && json_add_string zone "$ZONE_464XLAT" - [ -n "$IFACE_464XLAT_DELEGATE" ] && json_add_boolean delegate "$IFACE_464XLAT_DELEGATE" diff --git a/patches/openwrt/0024-base-files-add-etc-profile.d-support.patch b/patches/openwrt/0024-base-files-add-etc-profile.d-support.patch deleted file mode 100644 index 0295626e..00000000 --- a/patches/openwrt/0024-base-files-add-etc-profile.d-support.patch +++ /dev/null @@ -1,40 +0,0 @@ -From: Matthias Schiffer -Date: Sun, 11 Oct 2015 18:13:35 +0200 -Subject: base-files: add /etc/profile.d support - -OpenWrt should support an optional /etc/profile.d directory like -most other Linux distributions. This allows packages to install -their own scripts into /etc/profile.d/ directory. - -The file suffix should make clear, that these scripts -are (sourced) shell-snippets. If the user needs e.g. php or lua, -one must make sure that the interpreter is called. -The reverse failsafe test makes sure, that the effective returncode is 0. - -A typcal usecase is the inclusion of private helpers, -special variables or aliases, which at the moment needs -patching the sourcecode and is not well maintainable. -Now the builder can simply add there files. - -v1 initial work of Hendrik Lüth -v2 changes regarding RFC (e.g. thomas.langer@lantiq.com) -v3 changes regarding RFC (e.g. mschiffer@universe-factory.net) -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 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\$ ' - - [ -x /usr/bin/arp ] || arp() { cat /proc/net/arp; } - [ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; } -+ -+[ -n "$FAILSAFE" ] || { -+ for FILE in /etc/profile.d/*.sh; do -+ [ -e "$FILE" ] && . "$FILE" -+ done -+ unset FILE -+} diff --git a/patches/openwrt/0025-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 deleted file mode 100644 index b726c97b..00000000 --- a/patches/openwrt/0025-Kernel-Realtek-8150-and-Realtek-8152-based-USB-to-Ethernet-converters.patch +++ /dev/null @@ -1,49 +0,0 @@ -From: Andre Kasper -Date: Mon, 12 Oct 2015 02:31:05 +0200 -Subject: Kernel: Realtek 8150 and Realtek 8152 based USB-to-Ethernet converters - -This patch adds the kernel modules to for the very common Realtek RTL8150 and Realtek 8152 based USB-to-Ethernet converters. -After this patch the following packages can be added to targets (or site.mk): -kmod-usb-net-rtl8150 -kmod-usb-net-rtl8152 - -The modules are already available in openwrt trunk, but not in Chaos Calmer. This patch is just a temporary backport. -The modules are needed for Futros with additional USB-Ethernet-Interface and VMs with dedicated USB-NIC - -diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk -index d1ff455..86f452e 100644 ---- a/package/kernel/linux/modules/usb.mk -+++ b/package/kernel/linux/modules/usb.mk -@@ -1554,3 +1554,32 @@ define KernelPackage/usb3/description - endef - - $(eval $(call KernelPackage,usb3)) -+ -+define KernelPackage/usb-net-rtl8150 -+ TITLE:=Kernel module for USB-to-Ethernet Realtek convertors -+ KCONFIG:=CONFIG_USB_RTL8150 -+ FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/rtl8150.ko -+ AUTOLOAD:=$(call AutoProbe,rtl8150) -+ $(call AddDepends/usb-net) -+endef -+ -+define KernelPackage/usb-net-rtl8150/description -+ Kernel module for USB-to-Ethernet Realtek 8150 convertors -+endef -+ -+$(eval $(call KernelPackage,usb-net-rtl8150)) -+ -+ -+define KernelPackage/usb-net-rtl8152 -+ TITLE:=Kernel module for USB-to-Ethernet Realtek convertors -+ KCONFIG:=CONFIG_USB_RTL8152 -+ FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/r8152.ko -+ AUTOLOAD:=$(call AutoProbe,r8152) -+ $(call AddDepends/usb-net) -+endef -+ -+define KernelPackage/usb-net-rtl8152/description -+ Kernel module for USB-to-Ethernet Realtek 8152 USB2.0/3.0 convertors -+endef -+ -+$(eval $(call KernelPackage,usb-net-rtl8152)) diff --git a/patches/openwrt/0026-tools-firmware-utils-tplink-safeloader-clean-up-code.patch b/patches/openwrt/0026-tools-firmware-utils-tplink-safeloader-clean-up-code.patch deleted file mode 100644 index 00d2a184..00000000 --- a/patches/openwrt/0026-tools-firmware-utils-tplink-safeloader-clean-up-code.patch +++ /dev/null @@ -1,107 +0,0 @@ -From: Matthias Schiffer -Date: Thu, 15 Oct 2015 20:03:51 +0200 -Subject: tools/firmware-utils: tplink-safeloader: clean up code - -There is no reason for the internal functions not to be static. - -Signed-off-by: Matthias Schiffer - -diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c -index 9c5bb54..4607a1d 100644 ---- a/tools/firmware-utils/src/tplink-safeloader.c -+++ b/tools/firmware-utils/src/tplink-safeloader.c -@@ -152,7 +152,7 @@ static const unsigned char cpe510_support_list[] = - - - /** Allocates a new image partition */ --struct image_partition_entry alloc_image_partition(const char *name, size_t len) { -+static struct image_partition_entry alloc_image_partition(const char *name, size_t len) { - struct image_partition_entry entry = {name, len, malloc(len)}; - if (!entry.data) - error(1, errno, "malloc"); -@@ -161,12 +161,12 @@ struct image_partition_entry alloc_image_partition(const char *name, size_t len) - } - - /** Frees an image partition */ --void free_image_partition(struct image_partition_entry entry) { -+static void free_image_partition(struct image_partition_entry entry) { - free(entry.data); - } - - /** Generates the partition-table partition */ --struct image_partition_entry make_partition_table(const struct flash_partition_entry *p) { -+static struct image_partition_entry make_partition_table(const struct flash_partition_entry *p) { - struct image_partition_entry entry = alloc_image_partition("partition-table", 0x800); - - char *s = (char *)entry.data, *end = (char *)(s+entry.size); -@@ -202,7 +202,7 @@ static inline uint8_t bcd(uint8_t v) { - - - /** Generates the soft-version partition */ --struct image_partition_entry make_soft_version(uint32_t rev) { -+static struct image_partition_entry make_soft_version(uint32_t rev) { - struct image_partition_entry entry = alloc_image_partition("soft-version", sizeof(struct soft_version)); - struct soft_version *s = (struct soft_version *)entry.data; - -@@ -233,14 +233,14 @@ struct image_partition_entry make_soft_version(uint32_t rev) { - } - - /** Generates the support-list partition */ --struct image_partition_entry make_support_list(const unsigned char *support_list, size_t len) { -+static struct image_partition_entry make_support_list(const unsigned char *support_list, size_t len) { - struct image_partition_entry entry = alloc_image_partition("support-list", len); - memcpy(entry.data, support_list, len); - return entry; - } - - /** Creates a new image partition with an arbitrary name from a file */ --struct image_partition_entry read_file(const char *part_name, const char *filename, bool add_jffs2_eof) { -+static struct image_partition_entry read_file(const char *part_name, const char *filename, bool add_jffs2_eof) { - struct stat statbuf; - - if (stat(filename, &statbuf) < 0) -@@ -300,7 +300,7 @@ struct image_partition_entry read_file(const char *part_name, const char *filena - - I think partition-table must be the first partition in the firmware image. - */ --void put_partitions(uint8_t *buffer, const struct image_partition_entry *parts) { -+static void put_partitions(uint8_t *buffer, const struct image_partition_entry *parts) { - size_t i; - char *image_pt = (char *)buffer, *end = image_pt + 0x800; - -@@ -325,7 +325,7 @@ void put_partitions(uint8_t *buffer, const struct image_partition_entry *parts) - } - - /** Generates and writes the image MD5 checksum */ --void put_md5(uint8_t *md5, uint8_t *buffer, unsigned int len) { -+static void put_md5(uint8_t *md5, uint8_t *buffer, unsigned int len) { - MD5_CTX ctx; - - MD5_Init(&ctx); -@@ -349,7 +349,7 @@ void put_md5(uint8_t *md5, uint8_t *buffer, unsigned int len) { - 1014-1813 Image partition table (2048 bytes, padded with 0xff) - 1814-xxxx Firmware partitions - */ --void * generate_factory_image(const unsigned char *vendor, size_t vendor_len, const struct image_partition_entry *parts, size_t *len) { -+static void * generate_factory_image(const unsigned char *vendor, size_t vendor_len, const struct image_partition_entry *parts, size_t *len) { - *len = 0x1814; - - size_t i; -@@ -381,7 +381,7 @@ void * generate_factory_image(const unsigned char *vendor, size_t vendor_len, co - should be generalized when TP-LINK starts building its safeloader into hardware with - different flash layouts. - */ --void * generate_sysupgrade_image(const struct flash_partition_entry *flash_parts, const struct image_partition_entry *image_parts, size_t *len) { -+static void * generate_sysupgrade_image(const struct flash_partition_entry *flash_parts, const struct image_partition_entry *image_parts, size_t *len) { - const struct flash_partition_entry *flash_os_image = &flash_parts[5]; - const struct flash_partition_entry *flash_soft_version = &flash_parts[6]; - const struct flash_partition_entry *flash_support_list = &flash_parts[7]; -@@ -459,7 +459,7 @@ static void do_cpe510(const char *output, const char *kernel_image, const char * - - - /** Usage output */ --void usage(const char *argv0) { -+static void usage(const char *argv0) { - fprintf(stderr, - "Usage: %s [OPTIONS...]\n" - "\n" diff --git a/patches/openwrt/0027-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 deleted file mode 100644 index df0cf8c4..00000000 --- a/patches/openwrt/0027-tools-firmware-utils-tplink-safeloader-fix-support-list-format-clean-up-vendor-information.patch +++ /dev/null @@ -1,126 +0,0 @@ -From: Matthias Schiffer -Date: Thu, 15 Oct 2015 21:01:25 +0200 -Subject: tools/firmware-utils: tplink-safeloader: fix support-list format, clean up vendor information - -The first 4 bytes of the support list and the vendor information are -supposed to contain the length of these fields. - -Signed-off-by: Matthias Schiffer - -diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c -index 4607a1d..66658aa 100644 ---- a/tools/firmware-utils/src/tplink-safeloader.c -+++ b/tools/firmware-utils/src/tplink-safeloader.c -@@ -103,7 +103,7 @@ static const uint8_t md5_salt[16] = { - - - /** Vendor information for CPE210/220/510/520 */ --static const unsigned char cpe510_vendor[] = "\x00\x00\x00\x1f""CPE510(TP-LINK|UN|N300-5):1.0\r\n"; -+static const char cpe510_vendor[] = "CPE510(TP-LINK|UN|N300-5):1.0\r\n"; - - - /** -@@ -133,14 +133,13 @@ static const struct flash_partition_entry cpe510_partitions[] = { - The stock images also contain strings for two more devices: BS510 and BS210. - At the moment, there exists no public information about these devices. - */ --static const unsigned char cpe510_support_list[] = -- "\x00\x00\x00\xc8\x00\x00\x00\x00" -+static const char cpe510_support_list[] = - "SupportList:\r\n" - "CPE510(TP-LINK|UN|N300-5):1.0\r\n" - "CPE520(TP-LINK|UN|N300-5):1.0\r\n" - "CPE210(TP-LINK|UN|N300-2):1.0\r\n" - "CPE220(TP-LINK|UN|N300-2):1.0\r\n" -- "\r\n\xff"; -+ "\r\n"; - - #define error(_ret, _errno, _str, ...) \ - do { \ -@@ -151,6 +150,14 @@ static const unsigned char cpe510_support_list[] = - } while (0) - - -+/** Stores a uint32 as big endian */ -+static inline void put32(uint8_t *buf, uint32_t val) { -+ buf[0] = val >> 24; -+ buf[1] = val >> 16; -+ buf[2] = val >> 8; -+ buf[3] = val; -+} -+ - /** Allocates a new image partition */ - static struct image_partition_entry alloc_image_partition(const char *name, size_t len) { - struct image_partition_entry entry = {name, len, malloc(len)}; -@@ -233,9 +240,15 @@ static struct image_partition_entry make_soft_version(uint32_t rev) { - } - - /** Generates the support-list partition */ --static struct image_partition_entry make_support_list(const unsigned char *support_list, size_t len) { -- struct image_partition_entry entry = alloc_image_partition("support-list", len); -- memcpy(entry.data, support_list, len); -+static struct image_partition_entry make_support_list(const char *support_list) { -+ size_t len = strlen(support_list); -+ struct image_partition_entry entry = alloc_image_partition("support-list", len + 9); -+ -+ put32(entry.data, len); -+ memset(entry.data+4, 0, 4); -+ memcpy(entry.data+8, support_list, len); -+ entry.data[len+8] = '\xff'; -+ - return entry; - } - -@@ -344,12 +357,13 @@ static void put_md5(uint8_t *md5, uint8_t *buffer, unsigned int len) { - ----------- ----- - 0000-0003 Image size (4 bytes, big endian) - 0004-0013 MD5 hash (hash of a 16 byte salt and the image data starting with byte 0x14) -- 0014-1013 Vendor information (4096 bytes, padded with 0xff; there seem to be older -+ 0014-0017 Vendor information length (without padding) (4 bytes, big endian) -+ 0018-1013 Vendor information (4092 bytes, padded with 0xff; there seem to be older - (VxWorks-based) TP-LINK devices which use a smaller vendor information block) - 1014-1813 Image partition table (2048 bytes, padded with 0xff) - 1814-xxxx Firmware partitions - */ --static void * generate_factory_image(const unsigned char *vendor, size_t vendor_len, const struct image_partition_entry *parts, size_t *len) { -+static void * generate_factory_image(const char *vendor, const struct image_partition_entry *parts, size_t *len) { - *len = 0x1814; - - size_t i; -@@ -360,13 +374,12 @@ static void * generate_factory_image(const unsigned char *vendor, size_t vendor_ - if (!image) - error(1, errno, "malloc"); - -- image[0] = *len >> 24; -- image[1] = *len >> 16; -- image[2] = *len >> 8; -- image[3] = *len; -+ put32(image, *len); - -- memcpy(image+0x14, vendor, vendor_len); -- memset(image+0x14+vendor_len, 0xff, 4096-vendor_len); -+ size_t vendor_len = strlen(vendor); -+ put32(image+0x14, vendor_len); -+ memcpy(image+0x18, vendor, vendor_len); -+ memset(image+0x18+vendor_len, 0xff, 4092-vendor_len); - - put_partitions(image + 0x1014, parts); - put_md5(image+0x04, image+0x14, *len-0x14); -@@ -430,7 +443,7 @@ static void do_cpe510(const char *output, const char *kernel_image, const char * - - parts[0] = make_partition_table(cpe510_partitions); - parts[1] = make_soft_version(rev); -- parts[2] = make_support_list(cpe510_support_list, sizeof(cpe510_support_list)-1); -+ parts[2] = make_support_list(cpe510_support_list); - parts[3] = read_file("os-image", kernel_image, false); - parts[4] = read_file("file-system", rootfs_image, add_jffs2_eof); - -@@ -439,7 +452,7 @@ static void do_cpe510(const char *output, const char *kernel_image, const char * - if (sysupgrade) - image = generate_sysupgrade_image(cpe510_partitions, parts, &len); - else -- image = generate_factory_image(cpe510_vendor, sizeof(cpe510_vendor)-1, parts, &len); -+ image = generate_factory_image(cpe510_vendor, parts, &len); - - FILE *file = fopen(output, "wb"); - if (!file) diff --git a/patches/openwrt/0028-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 deleted file mode 100644 index e35965c7..00000000 --- a/patches/openwrt/0028-tools-firmware-utils-tplink-safeloader-add-version-1.1-support-to-CPE210-220-510-520.patch +++ /dev/null @@ -1,38 +0,0 @@ -From: Matthias Schiffer -Date: Thu, 15 Oct 2015 21:56:40 +0200 -Subject: tools/firmware-utils: tplink-safeloader: add version 1.1 support to CPE210/220/510/520 - -The hardware is identical to version 1.0, add the new models to the support -list. - -Also remove the empty line at the end of the support list, the current -stock images don't have it either. - -Signed-off-by: Matthias Schiffer - -diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c -index 66658aa..77a894b 100644 ---- a/tools/firmware-utils/src/tplink-safeloader.c -+++ b/tools/firmware-utils/src/tplink-safeloader.c -@@ -129,17 +129,17 @@ static const struct flash_partition_entry cpe510_partitions[] = { - - /** - The support list for CPE210/220/510/520 -- -- The stock images also contain strings for two more devices: BS510 and BS210. -- At the moment, there exists no public information about these devices. - */ - static const char cpe510_support_list[] = - "SupportList:\r\n" - "CPE510(TP-LINK|UN|N300-5):1.0\r\n" -+ "CPE510(TP-LINK|UN|N300-5):1.1\r\n" - "CPE520(TP-LINK|UN|N300-5):1.0\r\n" -+ "CPE520(TP-LINK|UN|N300-5):1.1\r\n" - "CPE210(TP-LINK|UN|N300-2):1.0\r\n" -+ "CPE210(TP-LINK|UN|N300-2):1.1\r\n" - "CPE220(TP-LINK|UN|N300-2):1.0\r\n" -- "\r\n"; -+ "CPE220(TP-LINK|UN|N300-2):1.1\r\n"; - - #define error(_ret, _errno, _str, ...) \ - do { \ diff --git a/patches/openwrt/0030-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 deleted file mode 100644 index f74c7922..00000000 --- a/patches/openwrt/0030-ar71xx-add-support-for-TP-LINK-TL-WR941ND-v6-international-version.patch +++ /dev/null @@ -1,330 +0,0 @@ -From: Matthias Schiffer -Date: Mon, 2 Nov 2015 19:21:20 +0100 -Subject: ar71xx: add support for TP-LINK TL-WR941ND v6 (international version) - -diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh -index 89fe53c..3e80c32 100644 ---- a/target/linux/ar71xx/base-files/etc/diag.sh -+++ b/target/linux/ar71xx/base-files/etc/diag.sh -@@ -279,7 +279,8 @@ get_status_led() { - tl-wdr4300 | \ - tl-wr703n | \ - tl-wr710n | \ -- tl-wr720n-v3) -+ tl-wr720n-v3 | \ -+ tl-wr941nd-v6) - status_led="tp-link:blue:system" - ;; - tl-wr841n-v9) -diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds -index 5241db2..11b3fa0 100644 ---- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds -+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds -@@ -460,6 +460,15 @@ tl-wr941nd-v5) - ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt" - ;; - -+tl-wr941nd-v6) -+ ucidef_set_led_netdev "wan" "WAN" "tp-link:blue:wan" "eth0" -+ ucidef_set_led_switch "lan1" "LAN1" "tp-link:blue:lan1" "switch0" "0x10" -+ ucidef_set_led_switch "lan2" "LAN2" "tp-link:blue:lan2" "switch0" "0x08" -+ ucidef_set_led_switch "lan3" "LAN3" "tp-link:blue:lan3" "switch0" "0x04" -+ ucidef_set_led_switch "lan4" "LAN4" "tp-link:blue:lan4" "switch0" "0x02" -+ ucidef_set_led_wlan "wlan" "WLAN" "tp-link:blue:wlan" "phy0tpt" -+ ;; -+ - tl-wa830re-v2) - 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 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 |\ - tl-wr841n-v8 |\ - tl-wr842n-v2 |\ - tl-wr941nd-v5 |\ -+tl-wr941nd-v6 |\ - wnr2000-v3 |\ - wnr2000-v4 |\ - wnr2200 |\ -diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh -index 0b2857d..46af69a 100755 ---- a/target/linux/ar71xx/base-files/lib/ar71xx.sh -+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh -@@ -800,6 +800,9 @@ ar71xx_board_detect() { - *"TL-WR941N/ND v5") - name="tl-wr941nd-v5" - ;; -+ *"TL-WR941N/ND v6") -+ name="tl-wr941nd-v6" -+ ;; - *"TL-WR703N v1") - name="tl-wr703n" - ;; -diff --git a/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx b/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx -index f11ea8c..fd337e1 100644 ---- a/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx -+++ b/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx -@@ -35,6 +35,7 @@ set_preinit_iface() { - tl-wr720n-v3 |\ - tl-wr841n-v8 |\ - tl-wr842n-v2 |\ -+ tl-wr941nd-v6 |\ - wnr2000-v3 |\ - 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 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() { - tl-wr842n-v2 | \ - tl-wr941nd | \ - tl-wr941nd-v5 | \ -+ tl-wr941nd-v6 | \ - tl-wr1041n-v2 | \ - tl-wr1043nd | \ - tl-wr1043nd-v2 | \ -diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18 -index e9b3c7c..84b5844 100644 ---- a/target/linux/ar71xx/config-3.18 -+++ b/target/linux/ar71xx/config-3.18 -@@ -132,6 +132,7 @@ CONFIG_ATH79_MACH_TL_WR841N_V1=y - CONFIG_ATH79_MACH_TL_WR841N_V8=y - CONFIG_ATH79_MACH_TL_WR841N_V9=y - CONFIG_ATH79_MACH_TL_WR941ND=y -+CONFIG_ATH79_MACH_TL_WR941ND_V6=y - CONFIG_ATH79_MACH_TUBE2H=y - CONFIG_ATH79_MACH_UBNT=y - CONFIG_ATH79_MACH_UBNT_XM=y -diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941nd-v6.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941nd-v6.c -new file mode 100644 -index 0000000..8c788e2 ---- /dev/null -+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941nd-v6.c -@@ -0,0 +1,149 @@ -+/* -+ * TP-LINK TL-WR941N/ND v6 board support -+ * -+ * Copyright (C) 2015 Matthias Schiffer -+ * -+ * 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 -+ -+#include -+#include -+ -+#include "common.h" -+#include "dev-eth.h" -+#include "dev-gpio-buttons.h" -+#include "dev-leds-gpio.h" -+#include "dev-m25p80.h" -+#include "dev-wmac.h" -+#include "machtypes.h" -+ -+ -+#define TL_WR941ND_V6_GPIO_LED_QSS 3 -+#define TL_WR941ND_V6_GPIO_LED_WAN 14 -+#define TL_WR941ND_V6_GPIO_LED_WAN_RED 15 -+#define TL_WR941ND_V6_GPIO_LED_LAN1 7 -+#define TL_WR941ND_V6_GPIO_LED_LAN2 6 -+#define TL_WR941ND_V6_GPIO_LED_LAN3 5 -+#define TL_WR941ND_V6_GPIO_LED_LAN4 4 -+#define TL_WR941ND_V6_GPIO_LED_WLAN 8 -+#define TL_WR941ND_V6_GPIO_LED_SYSTEM 18 -+ -+#define TL_WR941ND_V6_GPIO_BTN_RESET 1 -+#define TL_WR941ND_V6_GPIO_BTN_RFKILL 2 -+ -+#define TL_WR941ND_V6_KEYS_POLL_INTERVAL 20 -+#define TL_WR941ND_V6_KEYS_DEBOUNCE_INTERVAL (3 * TL_WR941ND_V6_KEYS_POLL_INTERVAL) -+ -+ -+static struct gpio_led tl_wr941nd_v6_leds_gpio[] __initdata = { -+ { -+ .name = "tp-link:blue:qss", -+ .gpio = TL_WR941ND_V6_GPIO_LED_QSS, -+ .active_low = 1, -+ }, -+ { -+ .name = "tp-link:blue:wan", -+ .gpio = TL_WR941ND_V6_GPIO_LED_WAN, -+ .active_low = 1, -+ }, -+ { -+ .name = "tp-link:red:wan", -+ .gpio = TL_WR941ND_V6_GPIO_LED_WAN_RED, -+ .active_low = 0, -+ }, -+ { -+ .name = "tp-link:blue:lan1", -+ .gpio = TL_WR941ND_V6_GPIO_LED_LAN1, -+ .active_low = 1, -+ }, -+ { -+ .name = "tp-link:blue:lan2", -+ .gpio = TL_WR941ND_V6_GPIO_LED_LAN2, -+ .active_low = 1, -+ }, -+ { -+ .name = "tp-link:blue:lan3", -+ .gpio = TL_WR941ND_V6_GPIO_LED_LAN3, -+ .active_low = 1, -+ }, -+ { -+ .name = "tp-link:blue:lan4", -+ .gpio = TL_WR941ND_V6_GPIO_LED_LAN4, -+ .active_low = 1, -+ }, -+ { -+ .name = "tp-link:blue:wlan", -+ .gpio = TL_WR941ND_V6_GPIO_LED_WLAN, -+ .active_low = 1, -+ }, -+ { -+ .name = "tp-link:blue:system", -+ .gpio = TL_WR941ND_V6_GPIO_LED_SYSTEM, -+ .active_low = 1, -+ }, -+}; -+ -+static struct gpio_keys_button tl_wr941nd_v6_gpio_keys[] __initdata = { -+ { -+ .desc = "Reset button", -+ .type = EV_KEY, -+ .code = KEY_RESTART, -+ .debounce_interval = TL_WR941ND_V6_KEYS_DEBOUNCE_INTERVAL, -+ .gpio = TL_WR941ND_V6_GPIO_BTN_RESET, -+ .active_low = 1, -+ }, { -+ .desc = "RFKILL button", -+ .type = EV_KEY, -+ .code = KEY_RFKILL, -+ .debounce_interval = TL_WR941ND_V6_KEYS_DEBOUNCE_INTERVAL, -+ .gpio = TL_WR941ND_V6_GPIO_BTN_RFKILL, -+ .active_low = 1, -+ } -+}; -+ -+ -+static const char *tl_wr941n_v6_part_probes[] = { -+ "tp-link", -+ NULL, -+}; -+ -+static struct flash_platform_data tl_wr941n_v6_flash_data = { -+ .part_probes = tl_wr941n_v6_part_probes, -+}; -+ -+ -+static void __init tl_wr941nd_v6_setup(void) -+{ -+ u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); -+ u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000); -+ -+ ath79_register_m25p80(&tl_wr941n_v6_flash_data); -+ -+ ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr941nd_v6_leds_gpio), -+ tl_wr941nd_v6_leds_gpio); -+ -+ ath79_register_gpio_keys_polled(-1, TL_WR941ND_V6_KEYS_POLL_INTERVAL, -+ ARRAY_SIZE(tl_wr941nd_v6_gpio_keys), -+ tl_wr941nd_v6_gpio_keys); -+ -+ ath79_register_mdio(0, 0x0); -+ -+ ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1); -+ ath79_init_mac(ath79_eth1_data.mac_addr, mac, -1); -+ -+ ath79_switch_data.phy4_mii_en = 1; -+ -+ ath79_register_eth(0); -+ ath79_register_eth(1); -+ -+ ath79_register_wmac(ee, mac); -+ -+} -+ -+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 78d35e1..11fb568 100644 ---- a/target/linux/ar71xx/image/Makefile -+++ b/target/linux/ar71xx/image/Makefile -@@ -600,7 +600,7 @@ endef - - define Device/tl-wr941nd-v6 - $(Device/tplink-4mlzma) -- BOARDNAME := TL-WDR3500 -+ BOARDNAME := TL-WR941ND-v6 - DEVICE_PROFILE := TLWR941 - TPLINK_HWID := 0x09410006 - endef -diff --git a/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch b/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch -index 2fa041b..185cb9c 100644 ---- a/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch -+++ b/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch -@@ -1,6 +1,6 @@ - --- a/arch/mips/ath79/machtypes.h - +++ b/arch/mips/ath79/machtypes.h --@@ -16,22 +16,197 @@ -+@@ -16,22 +16,198 @@ - - enum ath79_mach_type { - ATH79_MACH_GENERIC = 0, -@@ -148,6 +148,7 @@ - + ATH79_MACH_TL_WR842N_V2, /* TP-LINK TL-WR842N/ND v2 */ - + ATH79_MACH_TL_WR941ND, /* TP-LINK TL-WR941ND */ - + ATH79_MACH_TL_WR941ND_V5, /* TP-LINK TL-WR941ND v5 */ -++ ATH79_MACH_TL_WR941ND_V6, /* TP-LINK TL-WR941ND v6 */ - + ATH79_MACH_TUBE2H, /* Alfa Network Tube2H */ - + ATH79_MACH_UBNT_AIRGW, /* Ubiquiti AirGateway */ - ATH79_MACH_UBNT_AIRROUTER, /* Ubiquiti AirRouter */ -@@ -271,7 +272,7 @@ - config ATH79_MACH_AP121 - bool "Atheros AP121 reference board" - select SOC_AR933X --@@ -11,62 +75,1041 @@ config ATH79_MACH_AP121 -+@@ -11,62 +75,1050 @@ config ATH79_MACH_AP121 - select ATH79_DEV_M25P80 - select ATH79_DEV_USB - select ATH79_DEV_WMAC -@@ -1246,6 +1247,15 @@ - + select ATH79_DEV_M25P80 - + select ATH79_DEV_WMAC - + -++config ATH79_MACH_TL_WR941ND_V6 -++ bool "TP-LINK TL-WR941ND v6 support" -++ select SOC_QCA956X -++ select ATH79_DEV_ETH -++ select ATH79_DEV_GPIO_BUTTONS -++ select ATH79_DEV_LEDS_GPIO -++ select ATH79_DEV_M25P80 -++ select ATH79_DEV_WMAC -++ - +config ATH79_MACH_TL_WR1041N_V2 - + bool "TP-LINK TL-WR1041N v2 support" - + select SOC_AR934X -@@ -1474,7 +1484,7 @@ - endif - --- a/arch/mips/ath79/Makefile - +++ b/arch/mips/ath79/Makefile --@@ -38,9 +38,126 @@ obj-$(CONFIG_ATH79_ROUTERBOOT) += route -+@@ -38,9 +38,127 @@ obj-$(CONFIG_ATH79_ROUTERBOOT) += route - # - # Machines - # -@@ -1566,6 +1576,7 @@ - +obj-$(CONFIG_ATH79_MACH_TL_WR841N_V8) += mach-tl-wr841n-v8.o - +obj-$(CONFIG_ATH79_MACH_TL_WR841N_V9) += mach-tl-wr841n-v9.o - +obj-$(CONFIG_ATH79_MACH_TL_WR941ND) += mach-tl-wr941nd.o -++obj-$(CONFIG_ATH79_MACH_TL_WR941ND_V6) += mach-tl-wr941nd-v6.o - +obj-$(CONFIG_ATH79_MACH_TL_WR1041N_V2) += mach-tl-wr1041n-v2.o - +obj-$(CONFIG_ATH79_MACH_TL_WR1043ND) += mach-tl-wr1043nd.o - +obj-$(CONFIG_ATH79_MACH_TL_WR1043ND_V2) += mach-tl-wr1043nd-v2.o diff --git a/patches/openwrt/0031-ar71xx-add-support-for-TP-Link-TL-WR1043ND-v3.patch b/patches/openwrt/0031-ar71xx-add-support-for-TP-Link-TL-WR1043ND-v3.patch deleted file mode 100644 index 0518a00b..00000000 --- a/patches/openwrt/0031-ar71xx-add-support-for-TP-Link-TL-WR1043ND-v3.patch +++ /dev/null @@ -1,25 +0,0 @@ -From: Andreas Ziegler -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 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 - $(eval $(call SingleProfile,TPLINK,64kraw,TLWR1043V1,tl-wr1043nd-v1,TL-WR1043ND,ttyS0,115200,0x10430001,1,8M)) - - $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR1043V2,tl-wr1043nd-v2,TL-WR1043ND-v2,ttyS0,115200,0x10430002,1,8M)) -+$(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR1043V3,tl-wr1043nd-v3,TL-WR1043ND-v2,ttyS0,115200,0x10430003,1,8M)) - $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR2543,tl-wr2543-v1,TL-WR2543N,ttyS0,115200,0x25430001,1,8Mlzma,-v 3.13.99)) - - $(eval $(call SingleProfile,TPLINK-SAFELOADER,64kraw,CPE510,cpe210-220-510-520,CPE510,ttyS0,115200,$$(cpe510_mtdlayout),CPE510)) -@@ -2087,7 +2088,7 @@ $(eval $(call MultiProfile,TLWR743,TLWR743NV1)) - $(eval $(call MultiProfile,TLWR841,TLWR841NV15 TLWR841NV3 TLWR841NV5 TLWR841NV7)) - $(eval $(call MultiProfile,TLWR842,TLWR842V1)) - $(eval $(call MultiProfile,TLWR941,TLWR941NV2 TLWR941NV3 TLWR941NV4)) --$(eval $(call MultiProfile,TLWR1043,TLWR1043V1 TLWR1043V2)) -+$(eval $(call MultiProfile,TLWR1043,TLWR1043V1 TLWR1043V2 TLWR1043V3)) - $(eval $(call MultiProfile,TLWDR4300,TLWDR3500V1 TLWDR3600V1 TLWDR4300V1 TLWDR4300V1IL TLWDR4310V1 MW4530RV1)) - $(eval $(call MultiProfile,TUBE2H,TUBE2H8M TUBE2H16M)) - $(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTROCKETMXW UBNTNANOM UBNTNANOMXW UBNTLOCOXW UBNTUNIFI UBNTUNIFIOUTDOOR UBNTUNIFIOUTDOORPLUS UAPPRO UBNTAIRGW)) diff --git a/patches/openwrt/0032-ar71xx-backport-ath10k-calibration-data-load-changes.patch b/patches/openwrt/0032-ar71xx-backport-ath10k-calibration-data-load-changes.patch deleted file mode 100644 index 0c99ddc2..00000000 --- a/patches/openwrt/0032-ar71xx-backport-ath10k-calibration-data-load-changes.patch +++ /dev/null @@ -1,197 +0,0 @@ -From: Matthias Schiffer -Date: Wed, 18 Nov 2015 02:01:55 +0100 -Subject: ar71xx: backport ath10k calibration data load changes - -The mac80211 update makes is necessary to backport this change as well for -ath10k to load. - -diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata -index dd3f546..7111630 100644 ---- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata -+++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata -@@ -8,50 +8,83 @@ ath10kcal_die() { - ath10kcal_from_file() { - local source=$1 - local offset=$2 -- local target=$3 -+ local count=$3 - -- dd if=$source of=$target bs=1 skip=$offset count=2116 2>/dev/null || \ -+ dd if=$source of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count 2>/dev/null || \ - ath10kcal_die "failed to extract calibration data from $source" - } - -+ath10kcal_extract() { -+ local part=$1 -+ local offset=$2 -+ local count=$3 -+ local mtd -+ -+ mtd=$(find_mtd_chardev $part) -+ [ -n "$mtd" ] || \ -+ ath10kcal_die "no mtd device found for partition $part" -+ -+ dd if=$mtd of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count 2>/dev/null || \ -+ ath10kcal_die "failed to extract calibration data from $mtd" -+} -+ -+ath10kcal_patch_mac() { -+ local mac=$1 -+ -+ [ -z "$mac" ] && return -+ -+ macaddr_2bin $mac | dd of=/lib/firmware/$FIRMWARE conv=notrunc bs=1 seek=6 count=6 -+} -+ - [ -e /lib/firmware/$FIRMWARE ] && exit 0 - - . /lib/ar71xx.sh - . /lib/functions.sh - . /lib/functions/system.sh - --ath10kcal_mac="" --ath10kcal_tmp="/tmp/ath10k-caldata.bin" -- - board=$(ar71xx_board_name) - - case "$FIRMWARE" in --"ath10k/cal-pci-0000:01:00.0.bin") -- case $board in -- rb-911g-5hpacd) -- ath10kcal_from_file "/sys/firmware/routerboot/ext_wlan_data" 20480 $ath10kcal_tmp -- ;; -- esac -- ;; -- - "ath10k/cal-pci-0000:00:00.0.bin") - case $board in - dlan-pro-1200-ac) -- ath10kcal_from_file $(find_mtd_part "art") 20480 $ath10kcal_tmp -+ ath10kcal_extract "art" 20480 2116 -+ ;; -+ mc-mac1200r) -+ ath10kcal_extract "art" 20480 2116 -+ ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) -1) -+ ;; -+ r6100) -+ ath10kcal_extract "caldata" 20480 2116 -+ ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) +2) -+ ;; -+ qihoo-c301) -+ ath10kcal_extract "radiocfg" 20480 2116 -+ ath10kcal_patch_mac $(mtd_get_mac_ascii devdata wlan5mac) - ;; - esr1750 | \ - epg5000) -- ath10kcal_from_file $(find_mtd_part "caldata") 20480 $ath10kcal_tmp -+ ath10kcal_extract "caldata" 20480 2116 -+ ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1) -+ ;; -+ esac -+ ;; -+"ath10k/cal-pci-0000:01:00.0.bin") -+ case $board in -+ archer-c5 | \ -+ archer-c7) -+ ath10kcal_extract "art" 20480 2116 -+ ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) -2) -+ ;; -+ nbg6716) -+ ath10kcal_extract "RFdata" 20480 2116 -+ ;; -+ rb-911g-5hpacd) -+ ath10kcal_from_file "/sys/firmware/routerboot/ext_wlan_data" 20480 2116 - ;; - esac - ;; -- - *) - exit 1 - ;; - esac -- --[ -f $ath10kcal_tmp ] && { -- cp $ath10kcal_tmp /lib/firmware/$FIRMWARE -- rm -f $ath10kcal_tmp --} -diff --git a/target/linux/ar71xx/base-files/lib/preinit/81_load_ath10k_board_bin b/target/linux/ar71xx/base-files/lib/preinit/81_load_ath10k_board_bin -deleted file mode 100644 -index 9a32dfc..0000000 ---- a/target/linux/ar71xx/base-files/lib/preinit/81_load_ath10k_board_bin -+++ /dev/null -@@ -1,75 +0,0 @@ --#!/bin/sh -- --. /lib/functions/system.sh --. /lib/ar71xx.sh -- --do_load_ath10k_board_bin() { -- # load board.bin -- case $(ar71xx_board_name) in -- nbg6716) -- dd if=/dev/mtdblock2 \ -- bs=1 skip=20480 count=2116 \ -- of=/tmp/ath10k-board.bin -- ;; -- archer-c5 | \ -- archer-c7) -- local mac -- mac=$(macaddr_add $(cat /sys/class/net/eth1/address) -2) -- -- dd if=/dev/mtdblock4 \ -- bs=1 skip=20480 count=6 \ -- of=/tmp/ath10k-board.bin -- macaddr_2bin $mac >> /tmp/ath10k-board.bin -- dd if=/dev/mtdblock4 \ -- bs=1 skip=20492 count=2104 >> /tmp/ath10k-board.bin -- ;; -- mc-mac1200r) -- local mac -- mac=$(macaddr_add $(cat /sys/class/net/eth1/address) -1) -- -- dd if=/dev/mtdblock4 \ -- bs=1 skip=20480 count=6 \ -- of=/tmp/ath10k-board.bin -- macaddr_2bin $mac >> /tmp/ath10k-board.bin -- dd if=/dev/mtdblock4 \ -- bs=1 skip=20492 count=2104 >> /tmp/ath10k-board.bin -- ;; -- r6100) -- local mac -- mac=$(macaddr_add $(cat /sys/class/net/eth1/address) +2) -- -- dd if=/dev/mtdblock2 \ -- bs=1 skip=20480 count=6 \ -- of=/tmp/ath10k-board.bin -- macaddr_2bin $mac >> /tmp/ath10k-board.bin -- dd if=/dev/mtdblock2 \ -- bs=1 skip=20492 count=2104 >> /tmp/ath10k-board.bin -- ;; -- qihoo-c301) -- local mac -- -- mac=$(mtd_get_mac_ascii devdata wlan5mac) -- -- if [ -z "$mac" ]; then -- mac=$(macaddr_add $(cat /sys/class/net/eth0/address) -2) -- fi -- -- dd if=/dev/mtdblock10 \ -- bs=1 skip=20480 count=6 \ -- of=/tmp/ath10k-board.bin -- macaddr_2bin $mac >> /tmp/ath10k-board.bin -- dd if=/dev/mtdblock10 \ -- bs=1 skip=20492 count=2104 >> /tmp/ath10k-board.bin -- -- ;; -- esac -- [ -f /tmp/ath10k-board.bin ] || { -- return -- } -- cmp -s /tmp/ath10k-board.bin /lib/firmware/ath10k/QCA988X/hw2.0/board.bin || { -- cp /tmp/ath10k-board.bin /lib/firmware/ath10k/QCA988X/hw2.0/board.bin -- rm /tmp/ath10k-board.bin -- } --} -- --boot_hook_add preinit_main do_load_ath10k_board_bin diff --git a/patches/openwrt/0033-ar71xx-fix-AR71XX_MODEL-on-TP-Link-TL-WR703N.patch b/patches/openwrt/0033-ar71xx-fix-AR71XX_MODEL-on-TP-Link-TL-WR703N.patch deleted file mode 100644 index 9916aa81..00000000 --- a/patches/openwrt/0033-ar71xx-fix-AR71XX_MODEL-on-TP-Link-TL-WR703N.patch +++ /dev/null @@ -1,20 +0,0 @@ -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 46af69a..d0abf42 100755 ---- a/target/linux/ar71xx/base-files/lib/ar71xx.sh -+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh -@@ -123,7 +123,7 @@ tplink_board_detect() { - "3C0002"*) - model="MINIBOX_V1" - ;; -- "070300"*) -+ "070301"*) - model="TP-Link TL-WR703N" - ;; - "071000"*) diff --git a/patches/openwrt/0034-OpenSSL-Added-source-old-to-PKG_SOURCE_URL.patch b/patches/openwrt/0034-OpenSSL-Added-source-old-to-PKG_SOURCE_URL.patch deleted file mode 100644 index 4d18a727..00000000 --- a/patches/openwrt/0034-OpenSSL-Added-source-old-to-PKG_SOURCE_URL.patch +++ /dev/null @@ -1,24 +0,0 @@ -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 ad93678..9a16599 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:=b3bf73f507172be9292ea2a8c28b659d diff --git a/patches/openwrt/0037-x86-generic-refresh-kernel-config.patch b/patches/openwrt/0037-x86-generic-refresh-kernel-config.patch deleted file mode 100644 index a650e115..00000000 --- a/patches/openwrt/0037-x86-generic-refresh-kernel-config.patch +++ /dev/null @@ -1,48 +0,0 @@ -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/0038-x86-generic-enable-pata_atiixp-driver.patch b/patches/openwrt/0038-x86-generic-enable-pata_atiixp-driver.patch deleted file mode 100644 index 6a489761..00000000 --- a/patches/openwrt/0038-x86-generic-enable-pata_atiixp-driver.patch +++ /dev/null @@ -1,22 +0,0 @@ -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 diff --git a/patches/openwrt/0040-firmware-utils-mkfwimage-add-Wall-fix-obvious-bugs-causing-compile-warnings.patch b/patches/openwrt/0040-firmware-utils-mkfwimage-add-Wall-fix-obvious-bugs-causing-compile-warnings.patch deleted file mode 100644 index 781fd5d4..00000000 --- a/patches/openwrt/0040-firmware-utils-mkfwimage-add-Wall-fix-obvious-bugs-causing-compile-warnings.patch +++ /dev/null @@ -1,64 +0,0 @@ -From: Matthias Schiffer -Date: Thu, 25 Feb 2016 21:39:03 +0100 -Subject: firmware-utils: mkfwimage: add -Wall, fix obvious bugs causing compile warnings - -Signed-off-by: Matthias Schiffer - -diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile -index bd69cb4..6d88845 100644 ---- a/tools/firmware-utils/Makefile -+++ b/tools/firmware-utils/Makefile -@@ -32,7 +32,7 @@ define Host/Compile - $(call cc,mkzynfw) - $(call cc,lzma2eva,-lz) - $(call cc,mkcasfw) -- $(call cc,mkfwimage,-lz) -+ $(call cc,mkfwimage,-lz -Wall) - $(call cc,mkfwimage2,-lz) - $(call cc,imagetag imagetag_cmdline cyg_crc32) - $(call cc,add_header) -diff --git a/tools/firmware-utils/src/mkfwimage.c b/tools/firmware-utils/src/mkfwimage.c -index e3a03c1..00bf439 100644 ---- a/tools/firmware-utils/src/mkfwimage.c -+++ b/tools/firmware-utils/src/mkfwimage.c -@@ -104,8 +104,6 @@ typedef struct part_data { - - #define OPTIONS "B:hv:m:o:r:k:" - --static int debug = 0; -- - typedef struct image_info { - char magic[16]; - char version[256]; -@@ -236,9 +234,9 @@ static int create_image_layout(const char* kernelfile, const char* rootfsfile, c - fw_layout_t* p; - - p = &fw_layout_data[0]; -- while ((strlen(p->name) != 0) && (strncmp(p->name, board_name, sizeof(board_name)) != 0)) -+ while (*p->name && (strcmp(p->name, board_name) != 0)) - p++; -- if (p->name == NULL) { -+ if (!*p->name) { - printf("BUG! Unable to find default fw layout!\n"); - exit(-1); - } -@@ -247,7 +245,7 @@ static int create_image_layout(const char* kernelfile, const char* rootfsfile, c - strcpy(kernel->partition_name, "kernel"); - kernel->partition_index = 1; - kernel->partition_baseaddr = p->kern_start; -- if ( (kernel->partition_length = filelength(kernelfile)) < 0) return (-1); -+ if ( (kernel->partition_length = filelength(kernelfile)) == (u_int32_t)-1) return (-1); - kernel->partition_memaddr = p->kern_entry; - kernel->partition_entryaddr = p->kern_entry; - strncpy(kernel->filename, kernelfile, sizeof(kernel->filename)); -@@ -263,8 +261,8 @@ static int create_image_layout(const char* kernelfile, const char* rootfsfile, c - rootfs->partition_entryaddr = 0x00000000; - strncpy(rootfs->filename, rootfsfile, sizeof(rootfs->filename)); - --printf("kernel: %d 0x%08x\n", kernel->partition_length, kernel->partition_baseaddr); --printf("root: %d 0x%08x\n", rootfs->partition_length, rootfs->partition_baseaddr); -+ printf("kernel: %d 0x%08x\n", kernel->partition_length, kernel->partition_baseaddr); -+ printf("root: %d 0x%08x\n", rootfs->partition_length, rootfs->partition_baseaddr); - im->part_count = 2; - - return 0; diff --git a/patches/openwrt/0041-ar71xx-firmware-utils-split-ubdev01-flash-layout-from-XM.patch b/patches/openwrt/0041-ar71xx-firmware-utils-split-ubdev01-flash-layout-from-XM.patch deleted file mode 100644 index aa94ff83..00000000 --- a/patches/openwrt/0041-ar71xx-firmware-utils-split-ubdev01-flash-layout-from-XM.patch +++ /dev/null @@ -1,39 +0,0 @@ -From: Matthias Schiffer -Date: Thu, 25 Feb 2016 21:40:19 +0100 -Subject: ar71xx, firmware-utils: split ubdev01 flash layout from XM - -The ubdev01 profile defines its own MTDPARTS with smaller firmware -partition, so give it its own UBNT_BOARD in mkfwimage. - -Signed-off-by: Matthias Schiffer - -diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile -index dd224d4..4aaa115 100644 ---- a/target/linux/ar71xx/image/Makefile -+++ b/target/linux/ar71xx/image/Makefile -@@ -2031,7 +2031,7 @@ $(eval $(call SingleProfile,TPLINK-SAFELOADER,64kraw,CPE510,cpe210-220-510-520,C - $(eval $(call SingleProfile,UAPPRO,64k,UAPPRO,ubnt-uap-pro,UAP-PRO,ttyS0,115200,BZ,BZ,ar934x)) - $(eval $(call SingleProfile,UAPPRO,64k,UBNTUNIFIOUTDOORPLUS,ubnt-unifi-outdoor-plus,UBNT-UOP,ttyS0,115200,BZ,BZ,ar7240)) - --$(eval $(call SingleProfile,UBDEV,64kraw,UBDEV01,ubdev01,UBNT-UF,ttyS0,115200,XM,XM,ar7240)) -+$(eval $(call SingleProfile,UBDEV,64kraw,UBDEV01,ubdev01,UBNT-UF,ttyS0,115200,UBDEV01,XM,ar7240)) - - $(eval $(call SingleProfile,UBNT,64k,UBNTRS,ubnt-rs,UBNT-RS,ttyS0,115200,RS,RSx,ar7100)) - $(eval $(call SingleProfile,UBNT,64k,UBNTRSPRO,ubnt-rspro,UBNT-RSPRO,ttyS0,115200,RSPRO,RSPRO,ar7100pro)) -diff --git a/tools/firmware-utils/src/mkfwimage.c b/tools/firmware-utils/src/mkfwimage.c -index 00bf439..5dae284 100644 ---- a/tools/firmware-utils/src/mkfwimage.c -+++ b/tools/firmware-utils/src/mkfwimage.c -@@ -81,6 +81,12 @@ fw_layout_t fw_layout_data[] = { - .kern_entry = 0x80002000, - .firmware_max_length= 0x006A0000, - }, -+ { -+ .name = "UBDEV01", -+ .kern_start = 0x9f050000, -+ .kern_entry = 0x80002000, -+ .firmware_max_length= 0x006A0000, -+ }, - { .name = "", - }, - }; diff --git a/patches/openwrt/0042-firmware-utils-mkfwimage-fix-firmware_max_length-for-XM-layout.patch b/patches/openwrt/0042-firmware-utils-mkfwimage-fix-firmware_max_length-for-XM-layout.patch deleted file mode 100644 index ab1c34db..00000000 --- a/patches/openwrt/0042-firmware-utils-mkfwimage-fix-firmware_max_length-for-XM-layout.patch +++ /dev/null @@ -1,45 +0,0 @@ -From: Matthias Schiffer -Date: Thu, 25 Feb 2016 21:42:14 +0100 -Subject: firmware-utils: mkfwimage: fix firmware_max_length for XM layout - -The new u-boot version bundled with the 5.6.x firmwares from Ubiquiti gets -confused by the smaller rootfs partition size; this can lead to various -issues: - -1. We've gotten reports that flashing from the 5.6.x stock firmware to - OpenWrt will brick devices; I wasn't able to reproduce this myself -2. Flashing from 5.5.x stock firmware to OpenWrt and back to stock (via - TFTP recovery), following by an update to 5.6.x via web interface can - yield a bricked device with the following properties: - - It can't be booted without entering commands over a serial console, as - u-boot supplies the wrong MTD layout - - The web interface won't accept any image with the original flash - layout, so stock firmware upgrades are impossible - - As the TFTP recovery doesn't update u-boot, returning to the old - u-boot from firmware 5.5.x is impossible - -To recover from 2., creating an OpenWrt image which doesn't set u-boot as -read-only and flashing a backup of the old u-boot from there is the only -way known to me. (Fixing the mtdparts variable in u-boot-env from OpenWrt -might also work; settings this from u-boot over serial didn't have -any permanent effect.) - -Fix all of this by setting the correct flash layout also used by the stock -firmware. Flashing has been tested from both firmware 5.5.x and 5.6.x. The -fixed layout also matches the mtdparts defined by OpenWrt. - -Signed-off-by: Matthias Schiffer - -diff --git a/tools/firmware-utils/src/mkfwimage.c b/tools/firmware-utils/src/mkfwimage.c -index 5dae284..d8d5239 100644 ---- a/tools/firmware-utils/src/mkfwimage.c -+++ b/tools/firmware-utils/src/mkfwimage.c -@@ -79,7 +79,7 @@ fw_layout_t fw_layout_data[] = { - .name = "XM", - .kern_start = 0x9f050000, - .kern_entry = 0x80002000, -- .firmware_max_length= 0x006A0000, -+ .firmware_max_length= 0x00760000, - }, - { - .name = "UBDEV01", diff --git a/patches/openwrt/0043-kernel-disable-software-protection-bits-for-macronix-flash-chips-at-init.patch b/patches/openwrt/0043-kernel-disable-software-protection-bits-for-macronix-flash-chips-at-init.patch deleted file mode 100644 index 2b16474a..00000000 --- a/patches/openwrt/0043-kernel-disable-software-protection-bits-for-macronix-flash-chips-at-init.patch +++ /dev/null @@ -1,22 +0,0 @@ -From: Matthias Schiffer -Date: Fri, 26 Feb 2016 04:24:06 +0100 -Subject: kernel: disable software protection bits for macronix flash chips at init - -Backport of r47626 - -diff --git a/target/linux/generic/patches-3.18/465-m25p80-mx-disable-software-protection.patch b/target/linux/generic/patches-3.18/465-m25p80-mx-disable-software-protection.patch -new file mode 100644 -index 0000000..d7d7eec ---- /dev/null -+++ b/target/linux/generic/patches-3.18/465-m25p80-mx-disable-software-protection.patch -@@ -0,0 +1,10 @@ -+--- a/drivers/mtd/spi-nor/spi-nor.c -++++ b/drivers/mtd/spi-nor/spi-nor.c -+@@ -962,6 +962,7 @@ int spi_nor_scan(struct spi_nor *nor, co -+ -+ if (JEDEC_MFR(info->jedec_id) == CFI_MFR_ATMEL || -+ JEDEC_MFR(info->jedec_id) == CFI_MFR_INTEL || -++ JEDEC_MFR(info->jedec_id) == CFI_MFR_MACRONIX || -+ JEDEC_MFR(info->jedec_id) == CFI_MFR_SST) { -+ write_enable(nor); -+ write_sr(nor, 0); diff --git a/patches/openwrt/0044-brcm2708-gpu-fw-move-pkg-build-dir-to-kernel-build-dir-to-fix-rebuild-bugs-after-cleaning-the-kernel-tree.patch b/patches/openwrt/0044-brcm2708-gpu-fw-move-pkg-build-dir-to-kernel-build-dir-to-fix-rebuild-bugs-after-cleaning-the-kernel-tree.patch deleted file mode 100644 index 1fab9e46..00000000 --- a/patches/openwrt/0044-brcm2708-gpu-fw-move-pkg-build-dir-to-kernel-build-dir-to-fix-rebuild-bugs-after-cleaning-the-kernel-tree.patch +++ /dev/null @@ -1,19 +0,0 @@ -From: Matthias Schiffer -Date: Sun, 28 Feb 2016 02:29:56 +0100 -Subject: brcm2708-gpu-fw: move pkg build dir to kernel build dir to fix rebuild bugs after cleaning the kernel tree - -Backport of r48732 - -diff --git a/package/kernel/brcm2708-gpu-fw/Makefile b/package/kernel/brcm2708-gpu-fw/Makefile -index eee85e0..286984b 100644 ---- a/package/kernel/brcm2708-gpu-fw/Makefile -+++ b/package/kernel/brcm2708-gpu-fw/Makefile -@@ -16,7 +16,7 @@ PKG_SOURCE:=$(PKG_REV).tar.gz - PKG_SOURCE_URL:=https://github.com/Hexxeh/rpi-firmware/archive/ - PKG_MD5SUM:=f5683c1dcb255714942f7c9fd61b3a0a - --PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/rpi-firmware-$(PKG_REV) -+PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)/rpi-firmware-$(PKG_REV) - - include $(INCLUDE_DIR)/package.mk - diff --git a/patches/openwrt/0045-kernel-gpio_keys-load-module-on-pre-init.patch b/patches/openwrt/0045-kernel-gpio_keys-load-module-on-pre-init.patch deleted file mode 100644 index cba048f6..00000000 --- a/patches/openwrt/0045-kernel-gpio_keys-load-module-on-pre-init.patch +++ /dev/null @@ -1,21 +0,0 @@ -From: Matthias Schiffer -Date: Sun, 28 Feb 2016 03:42:29 +0100 -Subject: kernel/gpio_keys: load module on pre-init - -fix rescue mode on wdr4900 - -Backport of r48793 - -diff --git a/package/kernel/linux/modules/input.mk b/package/kernel/linux/modules/input.mk -index 86ff33c..eed9aa2 100644 ---- a/package/kernel/linux/modules/input.mk -+++ b/package/kernel/linux/modules/input.mk -@@ -75,7 +75,7 @@ define KernelPackage/input-gpio-keys - CONFIG_KEYBOARD_GPIO \ - CONFIG_INPUT_KEYBOARD=y - FILES:=$(LINUX_DIR)/drivers/input/keyboard/gpio_keys.ko -- AUTOLOAD:=$(call AutoProbe,gpio_keys) -+ AUTOLOAD:=$(call AutoProbe,gpio_keys,1) - endef - - define KernelPackage/input-gpio-keys/description diff --git a/patches/openwrt/0046-ar71xx-lzma-loader-fix-O32-ABI-conformance.patch b/patches/openwrt/0046-ar71xx-lzma-loader-fix-O32-ABI-conformance.patch deleted file mode 100644 index 2d08f3b4..00000000 --- a/patches/openwrt/0046-ar71xx-lzma-loader-fix-O32-ABI-conformance.patch +++ /dev/null @@ -1,36 +0,0 @@ -From: Matthias Schiffer -Date: Sun, 28 Feb 2016 04:49:51 +0100 -Subject: ar71xx/lzma-loader: fix O32 ABI conformance - -According to the calling convention of the o32 ABI the caller -function must reserve stack space for $a0-$a3 registers in case -the callee needs to save its arguments. - -The assembly code of the loader does not reserve stack space for -these registers thus when the 'loader_main' function needs to save -its arguments, those will be stored in the 'workspace' area instead -of the stack. - -Because the workspace area is also used by other part of the code, the -saved register values gets overwritten and this often leads to failed -kernel boots. - -Fix the code to reserve stack space for the registers to avoid this -error. - -Backport of r48279 - -diff --git a/target/linux/ar71xx/image/lzma-loader/src/head.S b/target/linux/ar71xx/image/lzma-loader/src/head.S -index 543996a..47a7c9b 100644 ---- a/target/linux/ar71xx/image/lzma-loader/src/head.S -+++ b/target/linux/ar71xx/image/lzma-loader/src/head.S -@@ -109,6 +109,9 @@ __bss_check: - /* Setup new "C" stack */ - la sp, _stack - -+ /* reserve stack space for a0-a3 registers */ -+ subu sp, 16 -+ - /* jump to the decompressor routine */ - la t0, loader_main - jr t0 From 45e238aa05be02631de380813a577e191b8043e4 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 1 Mar 2016 17:07:18 +0100 Subject: [PATCH 324/867] Update OpenWrt base --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 418420e0..af734c2e 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=8882c524d9b5e4c16ebfea10c0090f38b07c9da5 +OPENWRT_COMMIT=f4368a72353194fbe998a02baeb3690d3a83174b PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git PACKAGES_OPENWRT_COMMIT=9622fe984bba3a4547f48bc507ebaba7637eb2b0 From 595cba1bfa9ba0627e310e613b5ea86c65889cb4 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 1 Mar 2016 23:33:00 +0100 Subject: [PATCH 325/867] Update OpenWrt base --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index af734c2e..08733cba 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=f4368a72353194fbe998a02baeb3690d3a83174b +OPENWRT_COMMIT=e982dbdada8e73bac6b205c546e18ab89de29cf5 PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git PACKAGES_OPENWRT_COMMIT=9622fe984bba3a4547f48bc507ebaba7637eb2b0 From 6f4ca79d0143efa823ceb89298af9697e3a25cfb Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 2 Mar 2016 01:03:33 +0100 Subject: [PATCH 326/867] docs: update list of supported hardware --- docs/index.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/index.rst b/docs/index.rst index feac0979..c099306a 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -106,12 +106,17 @@ ar71xx-generic - WNDR3800 - WNDRMAC (v2) +* Onion + + - Omega + * TP-Link - CPE210 (v1.0, v1.1) - CPE220 (v1.0, v1.1) - CPE510 (v1.0, v1.1) - CPE520 (v1.0, v1.1) + - TL-MR13U (v1) - TL-MR3020 (v1) - TL-MR3040 (v1, v2) - TL-MR3220 (v1, v2) From 0320b4da0385523e63549eb4b2eeb75a118ac11c Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 2 Mar 2016 00:58:26 +0100 Subject: [PATCH 327/867] docs, README: add release notes for v2016.1.1, update version numbers --- README.md | 2 +- docs/index.rst | 1 + docs/releases/v2016.1.1.rst | 64 +++++++++++++++++++++++++++++++++++ docs/user/getting_started.rst | 4 +-- 4 files changed, 68 insertions(+), 3 deletions(-) create mode 100644 docs/releases/v2016.1.1.rst diff --git a/README.md b/README.md index b20fe40f..cc8ce8f4 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 v2016.1 && make update`. +and switch to one by running `git checkout v2016.1.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/index.rst b/docs/index.rst index c099306a..cbe1c5d4 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -60,6 +60,7 @@ Releases .. toctree:: :maxdepth: 1 + releases/v2016.1.1 releases/v2016.1 releases/v2015.1.2 releases/v2015.1.1 diff --git a/docs/releases/v2016.1.1.rst b/docs/releases/v2016.1.1.rst new file mode 100644 index 00000000..59ca2504 --- /dev/null +++ b/docs/releases/v2016.1.1.rst @@ -0,0 +1,64 @@ +Gluon 2016.1.1 +============== + +Added hardware support +~~~~~~~~~~~~~~~~~~~~~~ + +ar71xx-generic +^^^^^^^^^^^^^^ + +* Onion Omega +* TP-Link TL-MR13U v1 + + +Bugfixes +~~~~~~~~ + +Build +^^^^^ + +Don't overwrite the opkg repository key on each build. + +AirOS 5.6.x compatiblity +^^^^^^^^^^^^^^^^^^^^^^^^ + +Downgrading to AirOS 5.5.x before flashing Gluon on Airmax M XM/XW devices +(NanoStation, Bullet, ...) is not necessary anymore. + +Status page +^^^^^^^^^^^ + +* Fix purging of disappered neighbours from the list +* Don't clear the signal graphs when scrolling in mobile browsers +* Improve browser compability (don't assume the Internationalization API is available, + fixes the display of numbers in Firefox for Android) + +Config mode +^^^^^^^^^^^ + +* Strip trailing whitespace from number input fields (LuCI's validator doesn't catch this) +* Don't allow negative bandwidth limits + +Failsafe mode +^^^^^^^^^^^^^ + +* Fix entering the failsafe mode on the TL-WDR4900. + +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. + +* 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 eventually. The old API will still be supported for a while. + +* Nondeterministic production of broken images for some (very old) hardware (`#669 `_) + + At the moment it seems like only the TL-WR841N v5 is affected. diff --git a/docs/user/getting_started.rst b/docs/user/getting_started.rst index f10f9acf..a989344c 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. *v2016.1*. Always get Gluon using git and don't try to download it +e.g. *v2016.1.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. *v2016.1*. +version you'd like to checkout, e.g. *v2016.1.1*. :: From 8272a8f8071a01aa62a610af770d62373815d150 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 3 Mar 2016 23:49:58 +0100 Subject: [PATCH 328/867] Update OpenWrt base --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 08733cba..73c240c3 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=e982dbdada8e73bac6b205c546e18ab89de29cf5 +OPENWRT_COMMIT=efc26cc8e0513b3ec703ba540a554fde2c717cf6 PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git PACKAGES_OPENWRT_COMMIT=9622fe984bba3a4547f48bc507ebaba7637eb2b0 From 3b61a768b90aa59365d8703724e2c25789f22b4e Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 4 Mar 2016 00:51:28 +0100 Subject: [PATCH 329/867] Update Gluon packages --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 73c240c3..40ce211c 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=06f2a62b97a25ddd1b9919d084c626d42cef5489 +PACKAGES_GLUON_COMMIT=fea8f67d5d5cccac39b5020a69106f8665d41e58 PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_COMMIT=2a8338559de5c4b077cde7a83f43f4700a17d5cc From 1f06d20705c55f8ff51e5ff01f199f02e756d5ff Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 4 Mar 2016 17:38:58 +0100 Subject: [PATCH 330/867] ath10k: remove hard dependency on ath10k-firmware-qca988x We use our own firmware package. --- ...-Candela-Technologies-firmware-for-QCA988X.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/patches/openwrt/0006-ath10k-firmware-add-Candela-Technologies-firmware-for-QCA988X.patch b/patches/openwrt/0006-ath10k-firmware-add-Candela-Technologies-firmware-for-QCA988X.patch index 725d5995..5baf2712 100644 --- a/patches/openwrt/0006-ath10k-firmware-add-Candela-Technologies-firmware-for-QCA988X.patch +++ b/patches/openwrt/0006-ath10k-firmware-add-Candela-Technologies-firmware-for-QCA988X.patch @@ -57,3 +57,16 @@ index b03d644..7d4d449 100644 +$(eval $(call BuildPackage,ath10k-firmware-qca988x-ct)) $(eval $(call BuildPackage,ath10k-firmware-qca99x0)) $(eval $(call BuildPackage,ath10k-firmware-qca6174)) +diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile +index 30da1cf..cd8d670 100644 +--- a/package/kernel/mac80211/Makefile ++++ b/package/kernel/mac80211/Makefile +@@ -247,7 +247,7 @@ 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 +@KERNEL_RELAY +ath10k-firmware-qca988x ++ 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 From 13658879e5e4bd9622196af88cc3f0d7e092f6a4 Mon Sep 17 00:00:00 2001 From: Johannes Rudolph Date: Sun, 6 Mar 2016 03:09:09 +0100 Subject: [PATCH 331/867] git submodules Possibility to work with git submodules --- scripts/update.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/update.sh b/scripts/update.sh index 5f0e684e..fa5f4316 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -16,4 +16,5 @@ for module in $GLUON_MODULES; do git checkout $commit 2>/dev/null || git fetch $repo $branch git checkout -B base $commit + git submodule update --init --recursive done From 01878f4bbc94622c91e8789e96ea73967fa45830 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 7 Mar 2016 06:08:32 +0100 Subject: [PATCH 332/867] Backport GPIO control support Backport of rr46271 and r46922. Based-on-patch-by: Julian Kornberger --- ...files-implemented-basic-GPIO-control.patch | 133 ++++++++++++++++++ ...-pin-for-Ubiquiti-Nanostation-models.patch | 32 +++++ 2 files changed, 165 insertions(+) create mode 100644 patches/openwrt/0015-base-files-implemented-basic-GPIO-control.patch create mode 100644 patches/openwrt/0016-ar71xx-assign-proper-GPIO-pin-for-Ubiquiti-Nanostation-models.patch diff --git a/patches/openwrt/0015-base-files-implemented-basic-GPIO-control.patch b/patches/openwrt/0015-base-files-implemented-basic-GPIO-control.patch new file mode 100644 index 00000000..c3f6c8d5 --- /dev/null +++ b/patches/openwrt/0015-base-files-implemented-basic-GPIO-control.patch @@ -0,0 +1,133 @@ +From: Matthias Schiffer +Date: Mon, 7 Mar 2016 06:07:21 +0100 +Subject: base-files: implemented basic GPIO control + +Internal GPIO pins are used for PoE passthrough setups in multi-port +routers. This patch implemnets control over this hardware feature for +Ubiquiti Nanostations and TP-Link CPE510. + +Signed-off-by: Lars Kruse + +Backport of r46271 + +diff --git a/package/base-files/files/etc/init.d/gpio_switch b/package/base-files/files/etc/init.d/gpio_switch +new file mode 100755 +index 0000000..1f1b44b +--- /dev/null ++++ b/package/base-files/files/etc/init.d/gpio_switch +@@ -0,0 +1,42 @@ ++#!/bin/sh /etc/rc.common ++# Copyright (C) 2015 OpenWrt.org ++ ++START=98 ++STOP=10 ++USE_PROCD=1 ++ ++ ++load_gpio_switch() ++{ ++ local name ++ local gpio_pin ++ local value ++ ++ config_get gpio_pin "$1" gpio_pin ++ config_get name "$1" name ++ config_get value "$1" value 0 ++ ++ local gpio_path="/sys/class/gpio/gpio${gpio_pin}" ++ # export GPIO pin for access ++ [ -d "$gpio_path" ] || { ++ echo "$gpio_pin" >/sys/class/gpio/export ++ # we need to wait a bit until the GPIO appears ++ [ -d "$gpio_path" ] || sleep 1 ++ echo out >"$gpio_path/direction" ++ } ++ # write 0 or 1 to the "value" field ++ { [ "$value" = "0" ] && echo "0" || echo "1"; } >"$gpio_path/value" ++} ++ ++service_triggers() ++{ ++ procd_add_reload_trigger "system" ++} ++ ++start_service() ++{ ++ [ -e /sys/class/gpio/ ] && { ++ config_load system ++ config_foreach load_gpio_switch gpio_switch ++ } ++} +diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh +index 5a8809d..6577ecd 100644 +--- a/package/base-files/files/lib/functions/uci-defaults.sh ++++ b/package/base-files/files/lib/functions/uci-defaults.sh +@@ -2,6 +2,7 @@ + # Copyright (C) 2011 OpenWrt.org + + UCIDEF_LEDS_CHANGED=0 ++UCIDEF_GPIO_SWITCHES_CHANGED=0 + + ucidef_set_led_netdev() { + local cfg="led_$1" +@@ -180,6 +181,29 @@ ucidef_commit_leds() + [ "$UCIDEF_LEDS_CHANGED" = "1" ] && uci commit system + } + ++ucidef_set_gpio_switch() { ++ local cfg="gpio_switch_$1" ++ local name="$2" ++ local gpio_pin="$3" ++ # use "0" as default value ++ local default="${4:-0}" ++ ++ uci -q get "system.$cfg" && return 0 ++ ++ uci batch < +Date: Mon, 7 Mar 2016 06:07:59 +0100 +Subject: ar71xx: assign proper GPIO pin for Ubiquiti Nanostation models + +The GPIO pins for "POE passthrough" of Ubiquiti Nanostation models are the +following: +* Ubiquiti Nanostation M XM: Pin 8 +* Ubiquiti Nanostation M XW: Pin 2 + +The previous definition of the pins was mixed up between XM and XW model. + +Signed-off-by: Lars Kruse + +Backport of r46922 + +diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_gpio-switches b/target/linux/ar71xx/base-files/etc/uci-defaults/01_gpio-switches +index 81d3982..b41f275 100644 +--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_gpio-switches ++++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_gpio-switches +@@ -10,10 +10,10 @@ board=$(ar71xx_board_name) + + case "$board" in + nanostation-m) +- ucidef_set_gpio_switch "poe_passthrough" "PoE Passthrough" "2" ++ ucidef_set_gpio_switch "poe_passthrough" "PoE Passthrough" "8" + ;; + nanostation-m-xw) +- ucidef_set_gpio_switch "poe_passthrough" "PoE Passthrough" "8" ++ ucidef_set_gpio_switch "poe_passthrough" "PoE Passthrough" "2" + ;; + cpe510) + ucidef_set_gpio_switch "poe_passthrough" "PoE Passthrough" "20" From ca9a6f34f35817bf14575d6e54590287afad5d5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20L=C3=BCssing?= Date: Tue, 8 Mar 2016 07:55:55 +0100 Subject: [PATCH 333/867] gluon-mesh-batman-adv-core: Always forward towards mesh/batman-adv MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An IGMP/MLD domain split will prevent us from being able to track multicast listeners on other nodes. Therefore we need to always hand any multicast packets we received from local clients to batman-adv. With bridge multicast snooping disabled, the current setting in Gluon, this is already the case. However, in preparation to enabling multicast snooping, we need to enforce forwarding towards batman-adv by setting the bridge port option "multicast_router" to 2. Signed-off-by: Linus Lüssing --- .../files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh | 1 + 1 file changed, 1 insertion(+) diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh index 160b96ea..0843e937 100755 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh +++ b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh @@ -48,6 +48,7 @@ uci:section('network', 'interface', 'bat0', ifname = 'bat0', proto = 'none', macaddr = sysconfig.primary_mac, + multicast_router = 2, } ) From 0fc9e1d966980881d72cff26ec8ca3c2b7f7846c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20L=C3=BCssing?= Date: Tue, 8 Mar 2016 07:55:55 +0100 Subject: [PATCH 334/867] update config: "firewall: Allow IGMP and MLD input on WAN" (r45613) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adopt the according modifications to the default firewall settings of the WAN interface from OpenWRT, revision 45613. Signed-off-by: Linus Lüssing --- .../files/lib/gluon/upgrade/110-network | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/package/gluon-core/files/lib/gluon/upgrade/110-network b/package/gluon-core/files/lib/gluon/upgrade/110-network index d83f6d65..5de2f1f4 100755 --- a/package/gluon-core/files/lib/gluon/upgrade/110-network +++ b/package/gluon-core/files/lib/gluon/upgrade/110-network @@ -56,5 +56,31 @@ uci:save('network') uci:commit('network') +uci:section('firewall', 'rule', 'wan_igmp', + { + name = 'Allow-IGMP', + src = 'wan', + proto = 'igmp', + family = 'ipv4', + target = 'ACCEPT', + } +) + +uci:section('firewall', 'rule', 'wan_mld', + { + name = 'Allow-MLD', + src = 'wan', + proto = 'icmp', + src_ip = 'fe80::/10', + icmp_type = { '130/0', '131/0', '132/0', '143/0', }, + family = 'ipv6', + target = 'ACCEPT', + } +) + +uci:save('firewall') +uci:commit('firewall') + + sysctl.set('net.ipv6.conf.all.accept_ra', 0) sysctl.set('net.ipv6.conf.default.accept_ra', 0) From fc6d4d6c9789b6600e6208b1dc14866e03ccdc15 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 8 Mar 2016 07:57:06 +0100 Subject: [PATCH 335/867] gluon-mesh-batman-adv-core: respondd: add uci.h include This include wasn't actually missing, but well hidden behind the iwinfo.h include. Make this more obvious. --- package/gluon-mesh-batman-adv-core/src/respondd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/package/gluon-mesh-batman-adv-core/src/respondd.c b/package/gluon-mesh-batman-adv-core/src/respondd.c index 83f25e30..f0085457 100644 --- a/package/gluon-mesh-batman-adv-core/src/respondd.c +++ b/package/gluon-mesh-batman-adv-core/src/respondd.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include From e729d33bab0ad48a4d6b9397c05b1fe44a023429 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 9 Mar 2016 06:47:53 +0100 Subject: [PATCH 336/867] netifd: update to latest git master --- ...7-netifd-update-to-latest-git-master.patch | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 patches/openwrt/0017-netifd-update-to-latest-git-master.patch diff --git a/patches/openwrt/0017-netifd-update-to-latest-git-master.patch b/patches/openwrt/0017-netifd-update-to-latest-git-master.patch new file mode 100644 index 00000000..3a173661 --- /dev/null +++ b/patches/openwrt/0017-netifd-update-to-latest-git-master.patch @@ -0,0 +1,55 @@ +From: Matthias Schiffer +Date: Wed, 9 Mar 2016 06:46:44 +0100 +Subject: netifd: update to latest git master + +diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile +index 619024b..f7563d5 100644 +--- a/package/network/config/netifd/Makefile ++++ b/package/network/config/netifd/Makefile +@@ -1,13 +1,13 @@ + include $(TOPDIR)/rules.mk + + PKG_NAME:=netifd +-PKG_VERSION:=2015-12-16 ++PKG_VERSION:=2016-03-07 + PKG_RELEASE=$(PKG_SOURCE_VERSION) + + PKG_SOURCE_PROTO:=git +-PKG_SOURCE_URL:=http://git.openwrt.org/project/netifd.git ++PKG_SOURCE_URL=$(OPENWRT_GIT)/project/netifd.git + PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +-PKG_SOURCE_VERSION:=245527193e90906451be35c2b8e972b8712ea6ab ++PKG_SOURCE_VERSION:=bd1ee3efb46ae013d81b1aec51668e7595274e69 + PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz + PKG_MAINTAINER:=Felix Fietkau + # PKG_MIRROR_MD5SUM:= +diff --git a/package/network/config/netifd/files/etc/init.d/network b/package/network/config/netifd/files/etc/init.d/network +index 542fc08..bdadbbc 100755 +--- a/package/network/config/netifd/files/etc/init.d/network ++++ b/package/network/config/netifd/files/etc/init.d/network +@@ -21,7 +21,6 @@ start_service() { + procd_set_param watch network.interface + [ -e /proc/sys/kernel/core_pattern ] && { + procd_set_param limits core="unlimited" +- echo '/tmp/%e.%p.%s.%t.core' > /proc/sys/kernel/core_pattern + } + procd_close_instance + } +diff --git a/package/network/config/netifd/files/sbin/ifup b/package/network/config/netifd/files/sbin/ifup +index af3aaa8..5515b91 100755 +--- a/package/network/config/netifd/files/sbin/ifup ++++ b/package/network/config/netifd/files/sbin/ifup +@@ -67,12 +67,10 @@ if [ -n "$setup_wifi" ] && grep -sq config /etc/config/wireless; then + fi + } + +- local radio_devs +- local network="$1" ++ network="$1" + config_load wireless + config_foreach find_related_radios wifi-iface + +- local dev + for dev in $(echo "$radio_devs" | sort -u); do + /sbin/wifi up "$dev" + done From 2ee35f310212816bfc61ca8c694b01fbe2d15f67 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 8 Mar 2016 06:51:47 +0100 Subject: [PATCH 337/867] docs, README: add release notes for v2016.1.2, update version numbers --- README.md | 2 +- docs/index.rst | 1 + docs/releases/v2016.1.2.rst | 29 +++++++++++++++++++++++++++++ docs/user/getting_started.rst | 4 ++-- 4 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 docs/releases/v2016.1.2.rst diff --git a/README.md b/README.md index cc8ce8f4..51dec098 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 v2016.1.1 && make update`. +and switch to one by running `git checkout v2016.1.2 && 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/index.rst b/docs/index.rst index cbe1c5d4..6ebb2a10 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -60,6 +60,7 @@ Releases .. toctree:: :maxdepth: 1 + releases/v2016.1.2 releases/v2016.1.1 releases/v2016.1 releases/v2015.1.2 diff --git a/docs/releases/v2016.1.2.rst b/docs/releases/v2016.1.2.rst new file mode 100644 index 00000000..77f7efb8 --- /dev/null +++ b/docs/releases/v2016.1.2.rst @@ -0,0 +1,29 @@ +Gluon 2016.1.2 +============== + +Added hardware support +~~~~~~~~~~~~~~~~~~~~~~ + +The *x86-generic* images now contain the ATIIXP PATA driver, adding support for +FUTRO Thin Clients. + +Bugfixes +~~~~~~~~ + +A nondeterministic boot hang (`#669 `_) has been fixed. +The TL-WR841N v5 seems to be affected in particular, but the kernel bug is not hardware-specific per se. + +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. + +* 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 API (`#522 `_) + + The current API is inconsistent and will be replaced eventually. The old API will still be supported for a while. diff --git a/docs/user/getting_started.rst b/docs/user/getting_started.rst index a989344c..544ee2a3 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. *v2016.1.1*. Always get Gluon using git and don't try to download it +e.g. *v2016.1.2*. 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. *v2016.1.1*. +version you'd like to checkout, e.g. *v2016.1.2*. :: From ea90788315ac3dcb5ab211f4fb481081afa29a7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20F=C3=B6rster?= Date: Wed, 9 Mar 2016 22:17:06 +0100 Subject: [PATCH 338/867] Add support for TP-Link TL-WA7510N This CPE is supported by OpenWRT and already running in Chemnitz --- docs/index.rst | 1 + targets/ar71xx-generic/profiles.mk | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/docs/index.rst b/docs/index.rst index 6ebb2a10..2c0a50e2 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -125,6 +125,7 @@ ar71xx-generic - TL-MR3420 (v1, v2) - TL-WA701N/ND (v1, v2) - TL-WA750RE (v1) + - TL-WA7510N (v1) - TL-WA801N/ND (v1, v2) - TL-WA830RE (v1, v2) - TL-WA850RE (v1) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 394722e8..916f7b4c 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -19,6 +19,10 @@ $(eval $(call GluonProfile,TLWA701)) $(eval $(call GluonModel,TLWA701,tl-wa701n-v1,tp-link-tl-wa701n-nd-v1)) $(eval $(call GluonModel,TLWA701,tl-wa701nd-v2,tp-link-tl-wa701n-nd-v2)) +# TL-WA7510 v1 +$(eval $(call GluonProfile,TLWA7510)) +$(eval $(call GluonModel,TLWA7510,tl-wa7510n,tp-link-tl-wa7510n-v1)) + # TL-WR703N v1 $(eval $(call GluonProfile,TLWR703)) $(eval $(call GluonModel,TLWR703,tl-wr703n-v1,tp-link-tl-wr703n-v1)) From 4511da0aee68a215b350f2035d198667703f2f4f Mon Sep 17 00:00:00 2001 From: kb-light Date: Thu, 10 Mar 2016 00:38:19 +0100 Subject: [PATCH 339/867] docs: fix typo in upgrade.rst --- docs/dev/upgrade.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/dev/upgrade.rst b/docs/dev/upgrade.rst index 3cd57950..28377235 100644 --- a/docs/dev/upgrade.rst +++ b/docs/dev/upgrade.rst @@ -23,7 +23,7 @@ Best practices This allows using the same code to create the initial configuration and upgrade configurations on upgrades. * If it is unavoidable to run different code during the initial installation, the ``sysconfig.gluon_version`` variable - can be checked. This variable in ``nil`` during the initial installation and contains the previously install Gluon + can be checked. This variable is ``nil`` during the initial installation and contains the previously install Gluon version otherwise. The package ``gluon-legacy`` (which is responsible for upgrades from the old firmwares of Hamburg/Kiel/Lübeck) uses the special value ``legacy``; other packages should handle this value just as any other string. From 4d00c804c0988bc957580b6813fcd283dbb0d6fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20L=C3=BCssing?= Date: Tue, 8 Mar 2016 09:34:22 +0100 Subject: [PATCH 340/867] bridge: Lower IGMP/MLD query intervals for br-client MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are some devices not acting properly to roaming events, in that they do not timely reissue IGMP/MLD reports after reconnecting. To compensate for that this commit reduces the query interval from 125 seconds to 20 and the query response interval from 20 seconds to 5. This reduces a timeout to 20+5 seconds in the worst-case (12.5s average) after a roaming event for such broken devices. This should be below the 30s "impatient user threshold" and below any connection timeout. Until the bridge multicast snooping + querier gets re-enabled this is a no-op. Signed-off-by: Linus Lüssing --- .../files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh index 160b96ea..aabbcbbb 100755 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh +++ b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh @@ -39,6 +39,8 @@ end uci:set('network', 'client', 'proto', 'dhcpv6') uci:set('network', 'client', 'reqprefix', 'no') uci:set('network', 'client', 'igmp_snooping', 0) +uci:set('network', 'client', 'query_interval', 2000) +uci:set('network', 'client', 'query_response_interval', 500) uci:set('network', 'client', 'peerdns', 1) uci:set('network', 'client', 'sourcefilter', 0) From c9aa2672bd1b078d4866ddf59366f9e3da6a0715 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20L=C3=BCssing?= Date: Thu, 10 Mar 2016 16:40:46 +0100 Subject: [PATCH 341/867] bridge: Increase IGMP/MLD robustness parameter to three for br-client MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We are mostly dealing with the 2.4GHz crap-band here, so increasing the IGMP/MLD robustness parameter to three to be able to compensate for up to two consecutive instead of just one lost packet. Signed-off-by: Linus Lüssing --- .../files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh | 1 + 1 file changed, 1 insertion(+) diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh index aabbcbbb..fd1bbf7a 100755 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh +++ b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh @@ -39,6 +39,7 @@ end uci:set('network', 'client', 'proto', 'dhcpv6') uci:set('network', 'client', 'reqprefix', 'no') uci:set('network', 'client', 'igmp_snooping', 0) +uci:set('network', 'client', 'robustness', 3) uci:set('network', 'client', 'query_interval', 2000) uci:set('network', 'client', 'query_response_interval', 500) uci:set('network', 'client', 'peerdns', 1) From 4e2423c0818444744b3e8aa74fb074f3d348f0bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20F=C3=B6rster?= Date: Sun, 13 Mar 2016 15:59:47 +0100 Subject: [PATCH 342/867] Add Support for the ALFA Hornet UB and similar devices The Hornet UB is sold at least in the varieties. Without case it is a Hornet UB, with case and without connected USB port it is called AP121. If the USB port is present this device is called AP121U. We have a AP121U in our mesh http://meshviewer.chemnitz.freifunk.net/#!v:m;n:00c0ca6efffa --- docs/index.rst | 6 ++++++ targets/ar71xx-generic/profiles.mk | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/docs/index.rst b/docs/index.rst index 2c0a50e2..7ab22df2 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -77,6 +77,12 @@ Supported Devices & Architectures ar71xx-generic ^^^^^^^^^^^^^^ +* ALFA Network + + - AP121 + - AP121U + - Hornet-UB + * Allnet - ALL0315N diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 916f7b4c..d74e1861 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -278,3 +278,12 @@ $(eval $(call GluonModel,MYNETN750,mynet-n750,wd-my-net-n750)) # Omega $(eval $(call GluonProfile,OMEGA)) $(eval $(call GluonModel,OMEGA,onion-omega,onion-omega)) + +## ALFA + +# Hornet-UB +$(eval $(call GluonProfile,HORNETUB)) +$(eval $(call GluonModel,HORNETUB,hornet-ub,alfa-hornet-ub)) +$(eval $(call GluonModelAlias,HORNETUB,alfa-hornet-ub,alfa-ap121)) +$(eval $(call GluonModelAlias,HORNETUB,alfa-hornet-ub,alfa-ap121u)) + From d2b74b4cf048ecb8706809021332ed3e7c72b2f3 Mon Sep 17 00:00:00 2001 From: Alexander Dahl Date: Thu, 17 Mar 2016 22:12:44 +0100 Subject: [PATCH 343/867] openwrt: add patch fixing sysupgrade on Xen DomU Patch tested on v2016.1.x branch with Freifunk Magdeburg firmware on Debian Jessie amd64 Xen host. See the same patch in our gluon fork here: https://github.com/FreifunkMD/gluon/blob/fix-sysupgrade-xen/patches/openwrt/0058-x86-fix-platform_export_bootpart-for-Xen-virtual-disks.patch Sysupgrade was tested successfully by manually making the change before upgrading in the filesystem of the running node and upgrading to the fixed FFMD experimental build in config mode via expert settings in webgui. Patch also submitted to OpenWRT trunk already. Signed-off-by: Alexander Dahl --- ...xport_bootpart-for-Xen-virtual-disks.patch | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 patches/openwrt/0018-x86-fix-platform_export_bootpart-for-Xen-virtual-disks.patch diff --git a/patches/openwrt/0018-x86-fix-platform_export_bootpart-for-Xen-virtual-disks.patch b/patches/openwrt/0018-x86-fix-platform_export_bootpart-for-Xen-virtual-disks.patch new file mode 100644 index 00000000..4e0ce138 --- /dev/null +++ b/patches/openwrt/0018-x86-fix-platform_export_bootpart-for-Xen-virtual-disks.patch @@ -0,0 +1,25 @@ +From: Alexander Dahl +Date: Thu, 17 Mar 2016 15:04:09 +0100 +Subject: x86: fix platform_export_bootpart() for Xen virtual disks + +Virtual disk devices in a Xen virtual machine (DomU) can be /dev/xvda, +/dev/xvdb and so on with partitions like /dev/xdva1. Devices named like +this where not considered before. This resulted in a non working +sysupgrade, because the boot partition could not be found. + +Signed-off-by: Alexander Dahl +Suggested-by: Matthias Schiffer + +diff --git a/target/linux/x86/base-files/lib/upgrade/platform.sh b/target/linux/x86/base-files/lib/upgrade/platform.sh +index 73ab5ef..adc119c 100644 +--- a/target/linux/x86/base-files/lib/upgrade/platform.sh ++++ b/target/linux/x86/base-files/lib/upgrade/platform.sh +@@ -17,7 +17,7 @@ platform_export_bootpart() { + PARTUUID=[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]-02) + uuid="${disk#PARTUUID=}" + uuid="${uuid%-02}" +- for disk in /dev/[hsv]d[a-z]; do ++ for disk in /dev/[hsv]d[a-z] /dev/xvd[a-z]; do + set -- $(dd if=$disk bs=1 skip=440 count=4 2>/dev/null | hexdump -v -e '4/1 "%02x "') + if [ "$4$3$2$1" = "$uuid" ]; then + export BOOTPART="${disk}1" From 67fe2318059af82639ae9f53662f53ab3f37eebd Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Mon, 21 Mar 2016 22:31:46 +0100 Subject: [PATCH 344/867] docs: add 2016 copyright year to sphinx conf file --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 1f634eb2..fd329bda 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -47,7 +47,7 @@ master_doc = 'index' # General information about the project. project = 'Gluon' -copyright = '2015, Project Gluon' +copyright = '2015-2016, Project Gluon' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the From 86894548c5dbaa8673dfa8e8ded3a658a63c9c6e Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 22 Mar 2016 13:01:18 +0100 Subject: [PATCH 345/867] Explicitly set SHELL to bash MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes some messages if /bin/sh doesn't support 'echo -e'. Suggested-by: Steffen Möller --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index dfc0f001..04131381 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,8 @@ LC_ALL:=C LANG:=C export LC_ALL LANG +export SHELL:=/usr/bin/env bash + empty:= space:= $(empty) $(empty) From a26f78140478c9c9bdf10874ecfcb13e988250cd Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 24 Mar 2016 18:34:34 +0100 Subject: [PATCH 346/867] ar71xx: make bootconsole wait for both THRE and TEMT Original commit message: MIPS: ath79: make bootconsole wait for both THRE and TEMT This makes the ath79 bootconsole behave the same way as the generic 8250 bootconsole. Also waiting for TEMT (transmit buffer is empty) instead of just THRE (transmit buffer is not full) ensures that all characters have been transmitted before the real serial driver starts reconfiguring the serial controller (which would sometimes result in garbage being transmitted.) This change does not cause a visible performance loss. In addition, this seems to fix a hang observed in certain configurations on many AR7xxx/AR9xxx SoCs during autoconfig of the real serial driver. A more complete follow-up patch will disable 8250 autoconfig for ath79 altogether (the serial controller is detected as a 16550A, which is not fully compatible with the ath79 serial, and the autoconfig may lead to undefined behavior on ath79.) --- ...tconsole-wait-for-both-THRE-and-TEMT.patch | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 patches/openwrt/0019-ar71xx-make-bootconsole-wait-for-both-THRE-and-TEMT.patch diff --git a/patches/openwrt/0019-ar71xx-make-bootconsole-wait-for-both-THRE-and-TEMT.patch b/patches/openwrt/0019-ar71xx-make-bootconsole-wait-for-both-THRE-and-TEMT.patch new file mode 100644 index 00000000..76a41dce --- /dev/null +++ b/patches/openwrt/0019-ar71xx-make-bootconsole-wait-for-both-THRE-and-TEMT.patch @@ -0,0 +1,85 @@ +From: Matthias Schiffer +Date: Thu, 24 Mar 2016 18:30:26 +0100 +Subject: ar71xx: make bootconsole wait for both THRE and TEMT + +Original commit message: + + MIPS: ath79: make bootconsole wait for both THRE and TEMT + + This makes the ath79 bootconsole behave the same way as the generic 8250 + bootconsole. + + Also waiting for TEMT (transmit buffer is empty) instead of just THRE + (transmit buffer is not full) ensures that all characters have been + transmitted before the real serial driver starts reconfiguring the serial + controller (which would sometimes result in garbage being transmitted.) + This change does not cause a visible performance loss. + + In addition, this seems to fix a hang observed in certain configurations on + many AR7xxx/AR9xxx SoCs during autoconfig of the real serial driver. + + A more complete follow-up patch will disable 8250 autoconfig for ath79 + altogether (the serial controller is detected as a 16550A, which is not + fully compatible with the ath79 serial, and the autoconfig may lead to + undefined behavior on ath79.) + +diff --git a/target/linux/ar71xx/patches-3.18/103-MIPS-ath79-make-bootconsole-wait-for-both-THRE-and-T.patch b/target/linux/ar71xx/patches-3.18/103-MIPS-ath79-make-bootconsole-wait-for-both-THRE-and-T.patch +new file mode 100644 +index 0000000..7be14ab +--- /dev/null ++++ b/target/linux/ar71xx/patches-3.18/103-MIPS-ath79-make-bootconsole-wait-for-both-THRE-and-T.patch +@@ -0,0 +1,54 @@ ++From f1ba020af5076172c9d29006a747ccf40027fedc Mon Sep 17 00:00:00 2001 ++Message-Id: ++From: Matthias Schiffer ++Date: Thu, 24 Mar 2016 15:34:05 +0100 ++Subject: [PATCH] MIPS: ath79: make bootconsole wait for both THRE and TEMT ++ ++This makes the ath79 bootconsole behave the same way as the generic 8250 ++bootconsole. ++ ++Also waiting for TEMT (transmit buffer is empty) instead of just THRE ++(transmit buffer is not full) ensures that all characters have been ++transmitted before the real serial driver starts reconfiguring the serial ++controller (which would sometimes result in garbage being transmitted.) ++This change does not cause a visible performance loss. ++ ++In addition, this seems to fix a hang observed in certain configurations on ++many AR7xxx/AR9xxx SoCs during autoconfig of the real serial driver. ++ ++A more complete follow-up patch will disable 8250 autoconfig for ath79 ++altogether (the serial controller is detected as a 16550A, which is not ++fully compatible with the ath79 serial, and the autoconfig may lead to ++undefined behavior on ath79.) ++ ++Cc: ++Signed-off-by: Matthias Schiffer ++--- ++ arch/mips/ath79/early_printk.c | 6 ++++-- ++ 1 file changed, 4 insertions(+), 2 deletions(-) ++ ++diff --git a/arch/mips/ath79/early_printk.c b/arch/mips/ath79/early_printk.c ++index b955faf..d1adc59 100644 ++--- a/arch/mips/ath79/early_printk.c +++++ b/arch/mips/ath79/early_printk.c ++@@ -31,13 +31,15 @@ static inline void prom_putchar_wait(void __iomem *reg, u32 mask, u32 val) ++ } while (1); ++ } ++ +++#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) +++ ++ static void prom_putchar_ar71xx(unsigned char ch) ++ { ++ void __iomem *base = (void __iomem *)(KSEG1ADDR(AR71XX_UART_BASE)); ++ ++- prom_putchar_wait(base + UART_LSR * 4, UART_LSR_THRE, UART_LSR_THRE); +++ prom_putchar_wait(base + UART_LSR * 4, BOTH_EMPTY, BOTH_EMPTY); ++ __raw_writel(ch, base + UART_TX * 4); ++- prom_putchar_wait(base + UART_LSR * 4, UART_LSR_THRE, UART_LSR_THRE); +++ prom_putchar_wait(base + UART_LSR * 4, BOTH_EMPTY, BOTH_EMPTY); ++ } ++ ++ static void prom_putchar_ar933x(unsigned char ch) ++-- ++2.7.4 ++ From 33d028783fe62d89fa4d0f52b07ae0bdf52a7e10 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 25 Mar 2016 23:57:15 +0100 Subject: [PATCH 347/867] build: remove rather useless "patch" and "unpatch" make targets --- Makefile | 6 ------ scripts/unpatch.sh | 10 ---------- 2 files changed, 16 deletions(-) delete mode 100755 scripts/unpatch.sh diff --git a/Makefile b/Makefile index 04131381..e71f2be4 100644 --- a/Makefile +++ b/Makefile @@ -26,12 +26,6 @@ update: FORCE $(GLUONDIR)/scripts/update.sh $(GLUONDIR)/scripts/patch.sh -patch: FORCE - $(GLUONDIR)/scripts/patch.sh - -unpatch: FORCE - $(GLUONDIR)/scripts/unpatch.sh - update-patches: FORCE $(GLUONDIR)/scripts/update.sh $(GLUONDIR)/scripts/update-patches.sh diff --git a/scripts/unpatch.sh b/scripts/unpatch.sh deleted file mode 100755 index 1f0f6f12..00000000 --- a/scripts/unpatch.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -set -e - -. "$GLUONDIR"/scripts/modules.sh - -for module in $GLUON_MODULES; do - cd "$GLUONDIR"/$module - git checkout base -done From d5f5ce74e8a2f7645b72bdf55ce45b86756914d6 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 26 Mar 2016 00:00:35 +0100 Subject: [PATCH 348/867] build: add module separators/headings to patch/update/update-patches scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Suggested-by: Steffen Möller --- scripts/patch.sh | 2 ++ scripts/update-patches.sh | 2 ++ scripts/update.sh | 1 + 3 files changed, 5 insertions(+) diff --git a/scripts/patch.sh b/scripts/patch.sh index b89d6eb4..6b0fa23f 100755 --- a/scripts/patch.sh +++ b/scripts/patch.sh @@ -6,6 +6,8 @@ shopt -s nullglob . "$GLUONDIR"/scripts/modules.sh for module in $GLUON_MODULES; do + echo "--- Patching module '$module' ---" + cd "$GLUONDIR"/$module git checkout -B patching base diff --git a/scripts/update-patches.sh b/scripts/update-patches.sh index 4c9eaa95..cfdeb58e 100755 --- a/scripts/update-patches.sh +++ b/scripts/update-patches.sh @@ -6,6 +6,8 @@ shopt -s nullglob . "$GLUONDIR"/scripts/modules.sh for module in $GLUON_MODULES; do + echo "--- Updating patches for module '$module' ---" + rm -f "$GLUONDIR"/patches/$module/*.patch mkdir -p "$GLUONDIR"/patches/$module diff --git a/scripts/update.sh b/scripts/update.sh index fa5f4316..86c69628 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -5,6 +5,7 @@ set -e . "$GLUONDIR"/scripts/modules.sh for module in $GLUON_MODULES; do + echo "--- Updating module '$module' ---" var=$(echo $module | tr '[:lower:]/' '[:upper:]_') eval repo=\${${var}_REPO} eval branch=\${${var}_BRANCH} From 1ccd24df770f24d5660885d264b3a2af51bf6d1e Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 26 Mar 2016 13:22:05 +0100 Subject: [PATCH 349/867] generic: mtd: spi-nor: always disable software protection Fixes unwriteable flash when the bootloader leaves it protected. --- ...r-always-disable-software-protection.patch | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 patches/openwrt/0020-generic-mtd-spi-nor-always-disable-software-protection.patch diff --git a/patches/openwrt/0020-generic-mtd-spi-nor-always-disable-software-protection.patch b/patches/openwrt/0020-generic-mtd-spi-nor-always-disable-software-protection.patch new file mode 100644 index 00000000..abe68d72 --- /dev/null +++ b/patches/openwrt/0020-generic-mtd-spi-nor-always-disable-software-protection.patch @@ -0,0 +1,50 @@ +From: Matthias Schiffer +Date: Sat, 26 Mar 2016 13:20:41 +0100 +Subject: generic: mtd: spi-nor: always disable software protection + +Fixes unwriteable flash when the bootloader leaves it protected. + +diff --git a/target/linux/generic/patches-3.18/462-m25p80-always-disable-software-protection.patch b/target/linux/generic/patches-3.18/462-m25p80-always-disable-software-protection.patch +new file mode 100644 +index 0000000..7be7d0f +--- /dev/null ++++ b/target/linux/generic/patches-3.18/462-m25p80-always-disable-software-protection.patch +@@ -0,0 +1,22 @@ ++--- a/drivers/mtd/spi-nor/spi-nor.c +++++ b/drivers/mtd/spi-nor/spi-nor.c ++@@ -957,15 +957,11 @@ int spi_nor_scan(struct spi_nor *nor, co ++ ++ /* ++ * Atmel, SST and Intel/Numonyx serial nor tend to power ++- * up with the software protection bits set +++ * up with the software protection bits set; +++ * others may be left protected by the bootloader ++ */ ++- ++- if (JEDEC_MFR(info->jedec_id) == CFI_MFR_ATMEL || ++- JEDEC_MFR(info->jedec_id) == CFI_MFR_INTEL || ++- JEDEC_MFR(info->jedec_id) == CFI_MFR_SST) { ++- write_enable(nor); ++- write_sr(nor, 0); ++- } +++ write_enable(nor); +++ write_sr(nor, 0); ++ ++ if (!mtd->name) ++ mtd->name = dev_name(dev); +diff --git a/target/linux/generic/patches-3.18/462-m25p80-mx-disable-software-protection.patch b/target/linux/generic/patches-3.18/462-m25p80-mx-disable-software-protection.patch +deleted file mode 100644 +index d7d7eec..0000000 +--- a/target/linux/generic/patches-3.18/462-m25p80-mx-disable-software-protection.patch ++++ /dev/null +@@ -1,10 +0,0 @@ +---- a/drivers/mtd/spi-nor/spi-nor.c +-+++ b/drivers/mtd/spi-nor/spi-nor.c +-@@ -962,6 +962,7 @@ int spi_nor_scan(struct spi_nor *nor, co +- +- if (JEDEC_MFR(info->jedec_id) == CFI_MFR_ATMEL || +- JEDEC_MFR(info->jedec_id) == CFI_MFR_INTEL || +-+ JEDEC_MFR(info->jedec_id) == CFI_MFR_MACRONIX || +- JEDEC_MFR(info->jedec_id) == CFI_MFR_SST) { +- write_enable(nor); +- write_sr(nor, 0); From d4d9c349a21888a4f567a6a749fc160b4c20d5e2 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 26 Mar 2016 14:28:26 +0100 Subject: [PATCH 350/867] Revert "generic: mtd: spi-nor: always disable software protection" This reverts commit 1ccd24df770f24d5660885d264b3a2af51bf6d1e. This commit probably causes problems with some flash chips: http://patchwork.ozlabs.org/patch/549173/ http://patchwork.ozlabs.org/patch/553683/ --- ...r-always-disable-software-protection.patch | 50 ------------------- 1 file changed, 50 deletions(-) delete mode 100644 patches/openwrt/0020-generic-mtd-spi-nor-always-disable-software-protection.patch diff --git a/patches/openwrt/0020-generic-mtd-spi-nor-always-disable-software-protection.patch b/patches/openwrt/0020-generic-mtd-spi-nor-always-disable-software-protection.patch deleted file mode 100644 index abe68d72..00000000 --- a/patches/openwrt/0020-generic-mtd-spi-nor-always-disable-software-protection.patch +++ /dev/null @@ -1,50 +0,0 @@ -From: Matthias Schiffer -Date: Sat, 26 Mar 2016 13:20:41 +0100 -Subject: generic: mtd: spi-nor: always disable software protection - -Fixes unwriteable flash when the bootloader leaves it protected. - -diff --git a/target/linux/generic/patches-3.18/462-m25p80-always-disable-software-protection.patch b/target/linux/generic/patches-3.18/462-m25p80-always-disable-software-protection.patch -new file mode 100644 -index 0000000..7be7d0f ---- /dev/null -+++ b/target/linux/generic/patches-3.18/462-m25p80-always-disable-software-protection.patch -@@ -0,0 +1,22 @@ -+--- a/drivers/mtd/spi-nor/spi-nor.c -++++ b/drivers/mtd/spi-nor/spi-nor.c -+@@ -957,15 +957,11 @@ int spi_nor_scan(struct spi_nor *nor, co -+ -+ /* -+ * Atmel, SST and Intel/Numonyx serial nor tend to power -+- * up with the software protection bits set -++ * up with the software protection bits set; -++ * others may be left protected by the bootloader -+ */ -+- -+- if (JEDEC_MFR(info->jedec_id) == CFI_MFR_ATMEL || -+- JEDEC_MFR(info->jedec_id) == CFI_MFR_INTEL || -+- JEDEC_MFR(info->jedec_id) == CFI_MFR_SST) { -+- write_enable(nor); -+- write_sr(nor, 0); -+- } -++ write_enable(nor); -++ write_sr(nor, 0); -+ -+ if (!mtd->name) -+ mtd->name = dev_name(dev); -diff --git a/target/linux/generic/patches-3.18/462-m25p80-mx-disable-software-protection.patch b/target/linux/generic/patches-3.18/462-m25p80-mx-disable-software-protection.patch -deleted file mode 100644 -index d7d7eec..0000000 ---- a/target/linux/generic/patches-3.18/462-m25p80-mx-disable-software-protection.patch -+++ /dev/null -@@ -1,10 +0,0 @@ ----- a/drivers/mtd/spi-nor/spi-nor.c --+++ b/drivers/mtd/spi-nor/spi-nor.c --@@ -962,6 +962,7 @@ int spi_nor_scan(struct spi_nor *nor, co -- -- if (JEDEC_MFR(info->jedec_id) == CFI_MFR_ATMEL || -- JEDEC_MFR(info->jedec_id) == CFI_MFR_INTEL || --+ JEDEC_MFR(info->jedec_id) == CFI_MFR_MACRONIX || -- JEDEC_MFR(info->jedec_id) == CFI_MFR_SST) { -- write_enable(nor); -- write_sr(nor, 0); From 0b252759769c66192c2c0e3c1df9f5ce5b99c7f9 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 29 Mar 2016 00:35:02 +0200 Subject: [PATCH 351/867] Update to libuecc v7 and fastd v18 --- ...-host-to-HOST_BUILD_DEPENDS-as-well.patch} | 0 ...02-lua-cjson-add-host-build-support.patch} | 0 ....patch => 0003-libuecc-update-to-v7.patch} | 17 ++-- .../openwrt/0004-fastd-update-to-v18.patch | 88 +++++++++++++++++++ 4 files changed, 100 insertions(+), 5 deletions(-) rename patches/packages/openwrt/{0002-node-add-python-host-to-HOST_BUILD_DEPENDS-as-well.patch => 0001-node-add-python-host-to-HOST_BUILD_DEPENDS-as-well.patch} (100%) rename patches/packages/openwrt/{0003-lua-cjson-add-host-build-support.patch => 0002-lua-cjson-add-host-build-support.patch} (100%) rename patches/packages/openwrt/{0001-libuecc-update-to-v6.patch => 0003-libuecc-update-to-v7.patch} (67%) create mode 100644 patches/packages/openwrt/0004-fastd-update-to-v18.patch diff --git a/patches/packages/openwrt/0002-node-add-python-host-to-HOST_BUILD_DEPENDS-as-well.patch b/patches/packages/openwrt/0001-node-add-python-host-to-HOST_BUILD_DEPENDS-as-well.patch similarity index 100% rename from patches/packages/openwrt/0002-node-add-python-host-to-HOST_BUILD_DEPENDS-as-well.patch rename to patches/packages/openwrt/0001-node-add-python-host-to-HOST_BUILD_DEPENDS-as-well.patch diff --git a/patches/packages/openwrt/0003-lua-cjson-add-host-build-support.patch b/patches/packages/openwrt/0002-lua-cjson-add-host-build-support.patch similarity index 100% rename from patches/packages/openwrt/0003-lua-cjson-add-host-build-support.patch rename to patches/packages/openwrt/0002-lua-cjson-add-host-build-support.patch diff --git a/patches/packages/openwrt/0001-libuecc-update-to-v6.patch b/patches/packages/openwrt/0003-libuecc-update-to-v7.patch similarity index 67% rename from patches/packages/openwrt/0001-libuecc-update-to-v6.patch rename to patches/packages/openwrt/0003-libuecc-update-to-v7.patch index b83a6c6a..379e0a27 100644 --- a/patches/packages/openwrt/0001-libuecc-update-to-v6.patch +++ b/patches/packages/openwrt/0003-libuecc-update-to-v7.patch @@ -1,27 +1,34 @@ From: Matthias Schiffer Date: Sun, 25 Oct 2015 17:11:30 +0100 -Subject: libuecc: update to v6 +Subject: libuecc: update to v7 Signed-off-by: Matthias Schiffer diff --git a/libs/libuecc/Makefile b/libs/libuecc/Makefile -index 63b6ebe..fb26933 100644 +index 63b6ebe..c1ba53f 100644 --- a/libs/libuecc/Makefile +++ b/libs/libuecc/Makefile +@@ -1,5 +1,5 @@ + # +-# Copyright (C) 2012-2015 OpenWrt.org ++# Copyright (C) 2012-2016 OpenWrt.org + # + # This is free software, licensed under the GNU General Public License v2. + # See /LICENSE for more information. @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libuecc -PKG_VERSION:=5 -+PKG_VERSION:=6 ++PKG_VERSION:=7 PKG_RELEASE:=1 PKG_MAINTAINER:=Matthias Schiffer PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_SOURCE_URL:=https://projects.universe-factory.net/attachments/download/80 -PKG_MD5SUM:=cd03c947931c2f4b0eea0bf45654bd34 -+PKG_SOURCE_URL:=https://projects.universe-factory.net/attachments/download/83 -+PKG_MD5SUM:=cba68339ff46482ec4090303de18fff4 ++PKG_SOURCE_URL:=https://projects.universe-factory.net/attachments/download/85 ++PKG_MD5SUM:=5cd543cb8e7bce83a22c07a0579c95a1 PKG_LICENSE:=BSD-2-Clause PKG_LICENSE_FILES:=COPYRIGHT diff --git a/patches/packages/openwrt/0004-fastd-update-to-v18.patch b/patches/packages/openwrt/0004-fastd-update-to-v18.patch new file mode 100644 index 00000000..fd947214 --- /dev/null +++ b/patches/packages/openwrt/0004-fastd-update-to-v18.patch @@ -0,0 +1,88 @@ +From: Matthias Schiffer +Date: Tue, 29 Mar 2016 00:24:00 +0200 +Subject: fastd: update to v18 + +Signed-off-by: Matthias Schiffer + +diff --git a/net/fastd/Config.in b/net/fastd/Config.in +index 5820b97..3350eb3 100644 +--- a/net/fastd/Config.in ++++ b/net/fastd/Config.in +@@ -74,6 +74,12 @@ config FASTD_ENABLE_MAC_UHASH + default y + + ++config FASTD_WITH_CAPABILITIES ++ bool "Enable POSIX capability support" ++ depends on PACKAGE_fastd ++ default n ++ ++ + config FASTD_WITH_CMDLINE_USER + bool "Include support for setting user/group related options on the command line" + depends on PACKAGE_fastd +diff --git a/net/fastd/Makefile b/net/fastd/Makefile +index 027f549..5c550d8 100644 +--- a/net/fastd/Makefile ++++ b/net/fastd/Makefile +@@ -8,13 +8,13 @@ + include $(TOPDIR)/rules.mk + + PKG_NAME:=fastd +-PKG_VERSION:=17 ++PKG_VERSION:=18 + PKG_RELEASE:=1 + + PKG_MAINTAINER:=Matthias Schiffer + PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +-PKG_SOURCE_URL:=https://projects.universe-factory.net/attachments/download/81 +-PKG_MD5SUM:=bad4f1948702f418b799578f83a0edb8 ++PKG_SOURCE_URL:=https://projects.universe-factory.net/attachments/download/86 ++PKG_MD5SUM:=e53236d3049f64f7955ad9556da099eb + + PKG_LICENSE:=BSD-2-Clause + PKG_LICENSE_FILES:=COPYRIGHT +@@ -34,6 +34,7 @@ PKG_CONFIG_DEPENDS:=\ + CONFIG_FASTD_ENABLE_CIPHER_SALSA2012 \ + CONFIG_FASTD_ENABLE_MAC_GHASH \ + CONFIG_FASTD_ENABLE_MAC_UHASH \ ++ CONFIG_FASTD_WITH_CAPABILITIES \ + CONFIG_FASTD_WITH_CMDLINE_USER \ + CONFIG_FASTD_WITH_CMDLINE_LOGGING \ + CONFIG_FASTD_WITH_CMDLINE_OPERATION \ +@@ -50,7 +51,7 @@ include $(INCLUDE_DIR)/cmake.mk + define Package/fastd + SECTION:=net + CATEGORY:=Network +- DEPENDS:=+kmod-tun +librt +libpthread +FASTD_WITH_STATUS_SOCKET:libjson-c ++ DEPENDS:=+kmod-tun +librt +libpthread +FASTD_WITH_STATUS_SOCKET:libjson-c +FASTD_WITH_CAPABILITIES:libcap + TITLE:=Fast and Secure Tunneling Daemon + URL:=https://projects.universe-factory.net/projects/fastd + SUBMENU:=VPN +@@ -79,13 +80,13 @@ CMAKE_OPTIONS += \ + -DWITH_CIPHER_SALSA2012:BOOL=FALSE \ + -DWITH_MAC_GHASH:BOOL=FALSE \ + -DWITH_MAC_UHASH:BOOL=FALSE \ ++ -DWITH_CAPABILITIES:BOOL=FALSE \ + -DWITH_CMDLINE_USER:BOOL=FALSE \ + -DWITH_CMDLINE_LOGGING:BOOL=FALSE \ + -DWITH_CMDLINE_OPERATION:BOOL=FALSE \ + -DWITH_CMDLINE_COMMANDS:BOOL=FALSE \ + -DWITH_DYNAMIC_PEERS:BOOL=FALSE \ + -DWITH_STATUS_SOCKET:BOOL=FALSE \ +- -DWITH_CAPABILITIES:BOOL=FALSE \ + -DENABLE_SYSTEMD:BOOL=FALSE \ + -DENABLE_LIBSODIUM:BOOL=FALSE \ + -DENABLE_LTO:BOOL=TRUE +@@ -150,6 +151,11 @@ CMAKE_OPTIONS += -DWITH_MAC_UHASH:BOOL=TRUE + endif + + ++ifeq ($(CONFIG_FASTD_WITH_CAPABILITIES),y) ++CMAKE_OPTIONS += -DWITH_CAPABILITIES:BOOL=TRUE ++endif ++ ++ + ifeq ($(CONFIG_FASTD_WITH_CMDLINE_USER),y) + CMAKE_OPTIONS += -DWITH_CMDLINE_USER:BOOL=TRUE + endif From 954e378a5ffbf3e0a8d4f6dbdd91cf8d231f7f6c Mon Sep 17 00:00:00 2001 From: kb-light Date: Tue, 29 Mar 2016 12:41:26 +0200 Subject: [PATCH 352/867] docs: Freifunk Paderborn is now called Freifunk Hochstift link to site-repo updated --- 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 b26a28a1..8ae8600c 100644 --- a/docs/user/site.rst +++ b/docs/user/site.rst @@ -393,6 +393,7 @@ This is a non-exhaustive list of site-repos from various communities: * `site-ffda `_ (Darmstadt) * `site-ffgoe `_ (Göttingen) * `site-ffhh `_ (Hamburg) +* `site-ffho `_ (Hochstift) * `site-ffhgw `_ (Greifswald) * `site-ffhl `_ (Lübeck) * `site-ffmd `_ (Magdeburg) @@ -401,7 +402,6 @@ This is a non-exhaustive list of site-repos from various communities: * `site-ffm `_ (München) * `site-ffms `_ (Münsterland) * `site-ffnw `_ (Nordwest) -* `site-ffpb `_ (Paderborn) * `site-ffka `_ (Karlsruhe) * `site-ffrl `_ (Rheinland) * `site-ffrg `_ (Ruhrgebiet) From d9ca449ed0109651d748b22e6a6421867b1e9ae9 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 29 Mar 2016 22:00:58 +0200 Subject: [PATCH 353/867] generic: mtd: spi-nor: disable protection for Winbond flash at startup --- ...tection-for-Winbond-flash-at-startup.patch | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 patches/openwrt/0020-generic-mtd-spi-nor-disable-protection-for-Winbond-flash-at-startup.patch diff --git a/patches/openwrt/0020-generic-mtd-spi-nor-disable-protection-for-Winbond-flash-at-startup.patch b/patches/openwrt/0020-generic-mtd-spi-nor-disable-protection-for-Winbond-flash-at-startup.patch new file mode 100644 index 00000000..e69735e6 --- /dev/null +++ b/patches/openwrt/0020-generic-mtd-spi-nor-disable-protection-for-Winbond-flash-at-startup.patch @@ -0,0 +1,94 @@ +From: Matthias Schiffer +Date: Tue, 29 Mar 2016 21:58:53 +0200 +Subject: generic: mtd: spi-nor: disable protection for Winbond flash at startup + +diff --git a/target/linux/generic/patches-3.18/463-mtd-spi-nor-wait-until-lock-unlock-operations-are-re.patch b/target/linux/generic/patches-3.18/463-mtd-spi-nor-wait-until-lock-unlock-operations-are-re.patch +new file mode 100644 +index 0000000..c906425 +--- /dev/null ++++ b/target/linux/generic/patches-3.18/463-mtd-spi-nor-wait-until-lock-unlock-operations-are-re.patch +@@ -0,0 +1,47 @@ ++From 26e4790ddad59038ece16c8b89ad856bee946d75 Mon Sep 17 00:00:00 2001 ++Message-Id: <26e4790ddad59038ece16c8b89ad856bee946d75.1459281384.git.mschiffer@universe-factory.net> ++From: Matthias Schiffer ++Date: Tue, 29 Mar 2016 21:51:10 +0200 ++Subject: [PATCH 1/2] mtd: spi-nor: wait until lock/unlock operations are ready ++ ++Upstream commits: ++ ++32321e950d8a237d7e8f3a9b76220007dfa87544 ++edf891ef9ab773363f8e58022a26d7d31604aed6 ++--- ++ drivers/mtd/spi-nor/spi-nor.c | 5 +++++ ++ 1 file changed, 5 insertions(+) ++ ++diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c ++index ef783a4..1ab6e24 100644 ++--- a/drivers/mtd/spi-nor/spi-nor.c +++++ b/drivers/mtd/spi-nor/spi-nor.c ++@@ -370,6 +370,8 @@ static int spi_nor_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len) ++ ret = write_sr(nor, status_new); ++ if (ret) ++ goto err; +++ +++ ret = wait_till_ready(nor); ++ } ++ ++ err: ++@@ -417,6 +419,8 @@ static int spi_nor_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len) ++ ret = write_sr(nor, status_new); ++ if (ret) ++ goto err; +++ +++ ret = wait_till_ready(nor); ++ } ++ ++ err: ++@@ -966,6 +970,7 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode) ++ JEDEC_MFR(info->jedec_id) == CFI_MFR_SST) { ++ write_enable(nor); ++ write_sr(nor, 0); +++ wait_till_ready(nor); ++ } ++ ++ if (!mtd->name) ++-- ++2.7.4 ++ +diff --git a/target/linux/generic/patches-3.18/464-mtd-spi-nor-disable-protection-for-Winbond-flash-at-.patch b/target/linux/generic/patches-3.18/464-mtd-spi-nor-disable-protection-for-Winbond-flash-at-.patch +new file mode 100644 +index 0000000..7b45666 +--- /dev/null ++++ b/target/linux/generic/patches-3.18/464-mtd-spi-nor-disable-protection-for-Winbond-flash-at-.patch +@@ -0,0 +1,31 @@ ++From 03485b7e91a8f6e69e4945f937f266c59c1376d0 Mon Sep 17 00:00:00 2001 ++Message-Id: <03485b7e91a8f6e69e4945f937f266c59c1376d0.1459281384.git.mschiffer@universe-factory.net> ++In-Reply-To: <26e4790ddad59038ece16c8b89ad856bee946d75.1459281384.git.mschiffer@universe-factory.net> ++References: <26e4790ddad59038ece16c8b89ad856bee946d75.1459281384.git.mschiffer@universe-factory.net> ++From: Matthias Schiffer ++Date: Tue, 29 Mar 2016 21:55:55 +0200 ++Subject: [PATCH 2/2] mtd: spi-nor: disable protection for Winbond flash at ++ startup ++ ++Upstream commit: c6fc2171b249e73745c497b578b417a2946f1b2f ++--- ++ drivers/mtd/spi-nor/spi-nor.c | 3 ++- ++ 1 file changed, 2 insertions(+), 1 deletion(-) ++ ++diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c ++index 1ab6e24..ea7fa30 100644 ++--- a/drivers/mtd/spi-nor/spi-nor.c +++++ b/drivers/mtd/spi-nor/spi-nor.c ++@@ -967,7 +967,8 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode) ++ if (JEDEC_MFR(info->jedec_id) == CFI_MFR_ATMEL || ++ JEDEC_MFR(info->jedec_id) == CFI_MFR_INTEL || ++ JEDEC_MFR(info->jedec_id) == CFI_MFR_MACRONIX || ++- JEDEC_MFR(info->jedec_id) == CFI_MFR_SST) { +++ JEDEC_MFR(info->jedec_id) == CFI_MFR_SST || +++ JEDEC_MFR(info->jedec_id) == CFI_MFR_WINBOND) { ++ write_enable(nor); ++ write_sr(nor, 0); ++ wait_till_ready(nor); ++-- ++2.7.4 ++ From f4208f2a2b758818b1a1b4248d4d5a26d859fc4e Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 30 Mar 2016 02:59:46 +0200 Subject: [PATCH 354/867] build: support LibreSSL as provider of openssl Fixes #709 --- ...port-LibreSSL-as-provider-of-openssl.patch | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 patches/openwrt/0021-Support-LibreSSL-as-provider-of-openssl.patch diff --git a/patches/openwrt/0021-Support-LibreSSL-as-provider-of-openssl.patch b/patches/openwrt/0021-Support-LibreSSL-as-provider-of-openssl.patch new file mode 100644 index 00000000..cf627622 --- /dev/null +++ b/patches/openwrt/0021-Support-LibreSSL-as-provider-of-openssl.patch @@ -0,0 +1,27 @@ +From: Matthias Schiffer +Date: Wed, 30 Mar 2016 02:59:19 +0200 +Subject: Support LibreSSL as provider of openssl + +The build scripts check for openssl by grepping the string "OpenSSL" in +the output of openssl version command. LibreSSL fails this test as it +outputs something like "LibreSSL 2.2.4". This patch fix the +prereq-bulid.mk file so that it accepts LibreSSL as openssl provider as +well. + +Signed-off-by: Marek Behun + +Backport of r48267 + +diff --git a/include/prereq-build.mk b/include/prereq-build.mk +index 32c4ada..f36d57c 100644 +--- a/include/prereq-build.mk ++++ b/include/prereq-build.mk +@@ -151,7 +151,7 @@ $(eval $(call SetupHostCommand,file,Please install the 'file' package, \ + file --version 2>&1 | grep file)) + + $(eval $(call SetupHostCommand,openssl,Please install the 'openssl' utility, \ +- openssl version | grep OpenSSL)) ++ openssl version | grep '\(OpenSSL\|LibreSSL\)')) + + + # Install ldconfig stub From d7eb477ef56a86574a46e7507711f9a2318fa777 Mon Sep 17 00:00:00 2001 From: mokkin Date: Thu, 31 Mar 2016 20:54:08 +0200 Subject: [PATCH 355/867] added site for Leipzig --- docs/user/site.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/user/site.rst b/docs/user/site.rst index 8ae8600c..ed4706ee 100644 --- a/docs/user/site.rst +++ b/docs/user/site.rst @@ -395,6 +395,7 @@ This is a non-exhaustive list of site-repos from various communities: * `site-ffhh `_ (Hamburg) * `site-ffho `_ (Hochstift) * `site-ffhgw `_ (Greifswald) +* `site-ffl `_ (Leipzig) * `site-ffhl `_ (Lübeck) * `site-ffmd `_ (Magdeburg) * `site-ffmwu `_ (Mainz, Wiesbaden & Umgebung) From b78a53c5af53cc73d6be3066c0fe339f25e6a907 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 31 Mar 2016 20:45:35 +0200 Subject: [PATCH 356/867] docs, README: Gluon v2016.1.3 --- README.md | 2 +- docs/index.rst | 1 + docs/releases/v2016.1.3.rst | 43 +++++++++++++++++++++++++++++++++++ docs/user/getting_started.rst | 4 ++-- 4 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 docs/releases/v2016.1.3.rst diff --git a/README.md b/README.md index 51dec098..cf4b7bbf 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 v2016.1.2 && make update`. +and switch to one by running `git checkout v2016.1.3 && 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/index.rst b/docs/index.rst index 7ab22df2..697fb67d 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -60,6 +60,7 @@ Releases .. toctree:: :maxdepth: 1 + releases/v2016.1.3 releases/v2016.1.2 releases/v2016.1.1 releases/v2016.1 diff --git a/docs/releases/v2016.1.3.rst b/docs/releases/v2016.1.3.rst new file mode 100644 index 00000000..ba5b9672 --- /dev/null +++ b/docs/releases/v2016.1.3.rst @@ -0,0 +1,43 @@ +Gluon 2016.1.3 +============== + +Added hardware support +~~~~~~~~~~~~~~~~~~~~~~ + +ar71xx-generic +^^^^^^^^^^^^^^ + +* ALFA Hornet UB / AP121 / AP121U +* TP-Link TL-WA7510N + +Bugfixes +~~~~~~~~ + +* The nondeterministic boot hang (`#669 `_) that was thought to + be fixed in Gluon v2016.1.2 has resurfaced on other hardware. We believe it is now fixed properly. +* Sysupgrades on the Xen DomU have been fixed. +* Gluon can now be built on systems that use LibreSSL instead of OpenSSL. + +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. + +* 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 API (`#522 `_) + + The current API is inconsistent and will be replaced eventually. The old API will still be supported for a while. + +* Unwritable flash on some Ubiquiti PicoStations (`#687 `_) + + Gluon v2016.1.1 added support for Ubiquiti AirMAX devices with AirOS 5.6.x without downgrading AirOS first before + flashing Gluon. It was discovered that on Ubiquiti PicoStations, this downgrade is still necessary, as the + flash is not correctly unlocked, leaving the device unable to leave Config Mode and making regular sysupgrades + impossible. + + TFTP recovery can be used in this state to flash a new firmware. diff --git a/docs/user/getting_started.rst b/docs/user/getting_started.rst index 544ee2a3..0d54eda0 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. *v2016.1.2*. Always get Gluon using git and don't try to download it +e.g. *v2016.1.3*. 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. *v2016.1.2*. +version you'd like to checkout, e.g. *v2016.1.3*. :: From 4f051061de9ece4368fc82d43836a78187c722e7 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 1 Apr 2016 21:09:29 +0200 Subject: [PATCH 357/867] Update OpenWrt base --- modules | 2 +- patches/openwrt/0014-fix-UBNT-XM-model-detection.patch | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules b/modules index 40ce211c..582d6bf2 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=efc26cc8e0513b3ec703ba540a554fde2c717cf6 +OPENWRT_COMMIT=23395d539f4a45d8bed611e7f9c64275cd1cce0e PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git PACKAGES_OPENWRT_COMMIT=9622fe984bba3a4547f48bc507ebaba7637eb2b0 diff --git a/patches/openwrt/0014-fix-UBNT-XM-model-detection.patch b/patches/openwrt/0014-fix-UBNT-XM-model-detection.patch index 4fbdd403..79180b40 100644 --- a/patches/openwrt/0014-fix-UBNT-XM-model-detection.patch +++ b/patches/openwrt/0014-fix-UBNT-XM-model-detection.patch @@ -5,7 +5,7 @@ Subject: fix UBNT XM model detection Signed-off-by: Neal Oakey diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh -index d0abf42..f345fae 100755 +index 5768286..7f50d8a 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -64,6 +64,40 @@ wndr3700_board_detect() { @@ -49,7 +49,7 @@ index d0abf42..f345fae 100755 cybertan_get_hw_magic() { local part -@@ -472,12 +506,14 @@ ar71xx_board_detect() { +@@ -475,12 +509,14 @@ ar71xx_board_detect() { ;; *"Bullet M") name="bullet-m" @@ -64,7 +64,7 @@ index d0abf42..f345fae 100755 ;; *"Nanostation M XW") name="nanostation-m-xw" -@@ -664,6 +700,7 @@ ar71xx_board_detect() { +@@ -667,6 +703,7 @@ ar71xx_board_detect() { ;; *"Rocket M") name="rocket-m" From 196722663ac79ed87b9d41b4935d4fd41f785586 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 2 Apr 2016 00:54:07 +0200 Subject: [PATCH 358/867] ar71xx-generic: backport a few TP-Link model detection and upgrade check patches --- ...HWREV-on-upgrades-of-TP-LINK-devices.patch | 48 +++++++++++++++++++ ...a-space-on-some-TP-LINK-like-devices.patch | 45 +++++++++++++++++ ...XX_MODEL-to-match-labels-image-names.patch | 39 +++++++++++++++ 3 files changed, 132 insertions(+) create mode 100644 patches/openwrt/0022-ar71xx-check-both-HWID-and-HWREV-on-upgrades-of-TP-LINK-devices.patch create mode 100644 patches/openwrt/0023-ar71xx-avoid-AR71XX_MODEL-ending-with-a-space-on-some-TP-LINK-like-devices.patch create mode 100644 patches/openwrt/0024-ar71xx-fix-the-revision-of-a-few-TP-LINK-devices-in-AR71XX_MODEL-to-match-labels-image-names.patch diff --git a/patches/openwrt/0022-ar71xx-check-both-HWID-and-HWREV-on-upgrades-of-TP-LINK-devices.patch b/patches/openwrt/0022-ar71xx-check-both-HWID-and-HWREV-on-upgrades-of-TP-LINK-devices.patch new file mode 100644 index 00000000..416de969 --- /dev/null +++ b/patches/openwrt/0022-ar71xx-check-both-HWID-and-HWREV-on-upgrades-of-TP-LINK-devices.patch @@ -0,0 +1,48 @@ +From: Matthias Schiffer +Date: Fri, 1 Apr 2016 23:16:13 +0200 +Subject: ar71xx: check both HWID and HWREV on upgrades of TP-LINK devices + +There's no reason for us to be more lenient than the stock firmware, so +better check the HWREV as well to avoid bricked devices. + +Signed-off-by: Matthias Schiffer + +Backport of r49105 + +diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +index 2fc1d10..420b794 100755 +--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh ++++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +@@ -66,6 +66,10 @@ tplink_get_image_hwid() { + get_image "$@" | dd bs=4 count=1 skip=16 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"' + } + ++tplink_get_image_mid() { ++ get_image "$@" | dd bs=4 count=1 skip=17 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"' ++} ++ + tplink_get_image_boot_size() { + get_image "$@" | dd bs=4 count=1 skip=37 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"' + } +@@ -365,13 +369,17 @@ platform_check_image() { + } + + local hwid +- local imageid ++ local mid ++ local imagehwid ++ local imagemid + + hwid=$(tplink_get_hwid) +- imageid=$(tplink_get_image_hwid "$1") ++ mid=$(tplink_get_mid) ++ imagehwid=$(tplink_get_image_hwid "$1") ++ imagemid=$(tplink_get_image_mid "$1") + +- [ "$hwid" != "$imageid" ] && { +- echo "Invalid image, hardware ID mismatch, hw:$hwid image:$imageid." ++ [ "$hwid" != "$imagehwid" -o "$mid" != "$imagemid" ] && { ++ echo "Invalid image, hardware ID mismatch, hw:$hwid $mid image:$imagehwid $imagemid." + return 1 + } + diff --git a/patches/openwrt/0023-ar71xx-avoid-AR71XX_MODEL-ending-with-a-space-on-some-TP-LINK-like-devices.patch b/patches/openwrt/0023-ar71xx-avoid-AR71XX_MODEL-ending-with-a-space-on-some-TP-LINK-like-devices.patch new file mode 100644 index 00000000..520b1d7a --- /dev/null +++ b/patches/openwrt/0023-ar71xx-avoid-AR71XX_MODEL-ending-with-a-space-on-some-TP-LINK-like-devices.patch @@ -0,0 +1,45 @@ +From: Matthias Schiffer +Date: Fri, 1 Apr 2016 23:19:16 +0200 +Subject: ar71xx: avoid AR71XX_MODEL ending with a space on some TP-LINK-like devices + +Instead of adding the space when combining $model and $hwver, add the space +to the beginning of $hwver, so the resulting string won't end with a space +when $hwver is set to the empty string. + +Signed-off-by: Matthias Schiffer + +Backport of r49106 + +diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh +index 7f50d8a..9d650a1 100755 +--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh ++++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh +@@ -133,7 +133,7 @@ tplink_board_detect() { + hwid=$(tplink_get_hwid) + mid=$(tplink_get_mid) + hwver=${hwid:6:2} +- hwver="v${hwver#0}" ++ hwver=" v${hwver#0}" + + case "$hwid" in + "015000"*) +@@ -196,8 +196,8 @@ tplink_board_detect() { + "083000"*) + model="TP-Link TL-WA830RE" + +- if [ "$hwver" = 'v10' ]; then +- hwver='v1' ++ if [ "$hwver" = ' v10' ]; then ++ hwver=' v1' + fi + ;; + "084100"*) +@@ -296,7 +296,7 @@ tplink_board_detect() { + ;; + esac + +- AR71XX_MODEL="$model $hwver" ++ AR71XX_MODEL="$model$hwver" + } + + tplink_pharos_get_model_string() { diff --git a/patches/openwrt/0024-ar71xx-fix-the-revision-of-a-few-TP-LINK-devices-in-AR71XX_MODEL-to-match-labels-image-names.patch b/patches/openwrt/0024-ar71xx-fix-the-revision-of-a-few-TP-LINK-devices-in-AR71XX_MODEL-to-match-labels-image-names.patch new file mode 100644 index 00000000..e7d1ad12 --- /dev/null +++ b/patches/openwrt/0024-ar71xx-fix-the-revision-of-a-few-TP-LINK-devices-in-AR71XX_MODEL-to-match-labels-image-names.patch @@ -0,0 +1,39 @@ +From: Matthias Schiffer +Date: Fri, 1 Apr 2016 23:21:32 +0200 +Subject: ar71xx: fix the revision of a few TP-LINK devices in AR71XX_MODEL to match labels/image names + +Let's not confuse users about the revisions of their devices when we can +easily avoid it. + +Not tested on real hardware. + +Signed-off-by: Matthias Schiffer + +Backport of r49107 + +diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh +index 9d650a1..52ca255 100755 +--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh ++++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh +@@ -162,6 +162,10 @@ tplink_board_detect() { + ;; + "071000"*) + model="TP-Link TL-WR710N" ++ ++ if [ "$hwid" = '07100002' -a "$mid" = '00000002' ]; then ++ hwver=' v2.1' ++ fi + ;; + "072001"*) + model="TP-Link TL-WR720N" +@@ -202,6 +206,10 @@ tplink_board_detect() { + ;; + "084100"*) + model="TP-Link TL-WR841N/ND" ++ ++ if [ "$hwid" = '08410002' -a "$mid" = '00000002' ]; then ++ hwver=' v1.5' ++ fi + ;; + "084200"*) + model="TP-Link TL-WR842N/ND" From 3732c26e95b758503484beced62e01d1273d25d2 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 2 Apr 2016 00:59:19 +0200 Subject: [PATCH 359/867] ar71xx-generic: add support for TP-Link TL-WR710N v2.1 --- ...r71xx-build-image-for-TL-WR710N-v2.1.patch | 41 +++++++++++++++++++ targets/ar71xx-generic/profiles.mk | 3 +- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 patches/openwrt/0025-ar71xx-build-image-for-TL-WR710N-v2.1.patch diff --git a/patches/openwrt/0025-ar71xx-build-image-for-TL-WR710N-v2.1.patch b/patches/openwrt/0025-ar71xx-build-image-for-TL-WR710N-v2.1.patch new file mode 100644 index 00000000..99e1e9ce --- /dev/null +++ b/patches/openwrt/0025-ar71xx-build-image-for-TL-WR710N-v2.1.patch @@ -0,0 +1,41 @@ +From: Matthias Schiffer +Date: Sat, 2 Apr 2016 00:56:50 +0200 +Subject: ar71xx: build image for TL-WR710N v2.1 + +This patch just extends target/linux/ar71xx/image/Makefile to build +images also for version 2.1 of TL-WR710N +patch against the latest git + +Signed off by: Norbert Wegener + +Backport of r47849 + +diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile +index 1a399ab..9ac405c 100644 +--- a/target/linux/ar71xx/image/Makefile ++++ b/target/linux/ar71xx/image/Makefile +@@ -476,6 +476,15 @@ define Device/tl-wr710n-v2 + CONSOLE := ttyATH0,115200 + endef + ++define Device/tl-wr710n-v2.1 ++ $(Device/tplink-8mlzma) ++ BOARDNAME := TL-WR710N ++ DEVICE_PROFILE := TLWR710 ++ TPLINK_HWID := 0x07100002 ++ TPLINK_HWREV := 0x00000002 ++ CONSOLE := ttyATH0,115200 ++endef ++ + define Device/tl-wr720n-v3 + $(Device/tplink-4mlzma) + BOARDNAME := TL-WR720N-v3 +@@ -491,7 +500,7 @@ define Device/tl-wr720n-v4 + TPLINK_HWID := 0x07200104 + CONSOLE := ttyATH0,115200 + endef +-TARGET_DEVICES += tl-wr703n-v1 tl-wr710n-v1 tl-wr710n-v2 tl-wr720n-v3 tl-wr720n-v4 ++TARGET_DEVICES += tl-wr703n-v1 tl-wr710n-v1 tl-wr710n-v2 tl-wr710n-v2.1 tl-wr720n-v3 tl-wr720n-v4 + + define Device/tl-wr740n-v4 + $(Device/tplink-4mlzma) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index d74e1861..068facfe 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -27,10 +27,11 @@ $(eval $(call GluonModel,TLWA7510,tl-wa7510n,tp-link-tl-wa7510n-v1)) $(eval $(call GluonProfile,TLWR703)) $(eval $(call GluonModel,TLWR703,tl-wr703n-v1,tp-link-tl-wr703n-v1)) -# TL-WR710N v1, v2 +# TL-WR710N v1, v2, v2.1 $(eval $(call GluonProfile,TLWR710)) $(eval $(call GluonModel,TLWR710,tl-wr710n-v1,tp-link-tl-wr710n-v1)) $(eval $(call GluonModel,TLWR710,tl-wr710n-v2,tp-link-tl-wr710n-v2)) +$(eval $(call GluonModel,TLWR710,tl-wr710n-v2.1,tp-link-tl-wr710n-v2.1)) # TL-WR740N v1, v3, v4, v5 $(eval $(call GluonProfile,TLWR740)) From 24d8695d8ceeb09d6c84bcd6ee4ffe087c9b386b Mon Sep 17 00:00:00 2001 From: kb-light Date: Sat, 2 Apr 2016 03:35:29 +0200 Subject: [PATCH 360/867] ar71xx-generic: update profiles.mk to match new naming Update the naming of some TP-Link devices corresponding to commit 0fd48fd7dab066db8a46e51775579c9ef507ca25 within git.openwrt.org/15.05/openwrt.git --- targets/ar71xx-generic/profiles.mk | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index d74e1861..7e8d4ebf 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -16,7 +16,7 @@ $(eval $(call GluonModelAlias,CPE510,tp-link-cpe510-v1.0,tp-link-cpe520-v1.1)) # TL-WA701N/ND v1, v2 $(eval $(call GluonProfile,TLWA701)) -$(eval $(call GluonModel,TLWA701,tl-wa701n-v1,tp-link-tl-wa701n-nd-v1)) +$(eval $(call GluonModel,TLWA701,tl-wa701nd-v1,tp-link-tl-wa701n-nd-v1)) $(eval $(call GluonModel,TLWA701,tl-wa701nd-v2,tp-link-tl-wa701n-nd-v2)) # TL-WA7510 v1 @@ -56,14 +56,14 @@ $(eval $(call GluonProfile,TLWA801)) $(eval $(call GluonModel,TLWA801,tl-wa801nd-v1,tp-link-tl-wa801n-nd-v1)) $(eval $(call GluonModel,TLWA801,tl-wa801nd-v2,tp-link-tl-wa801n-nd-v2)) -# TL-WR841N/ND v3, v5, v7, v8, v9 +# TL-WR841N/ND v3, v5, v7, v8, v9, v10 $(eval $(call GluonProfile,TLWR841)) -$(eval $(call GluonModel,TLWR841,tl-wr841nd-v3,tp-link-tl-wr841n-nd-v3)) -$(eval $(call GluonModel,TLWR841,tl-wr841nd-v5,tp-link-tl-wr841n-nd-v5)) -$(eval $(call GluonModel,TLWR841,tl-wr841nd-v7,tp-link-tl-wr841n-nd-v7)) -$(eval $(call GluonModel,TLWR841,tl-wr841n-v8,tp-link-tl-wr841n-nd-v8)) -$(eval $(call GluonModel,TLWR841,tl-wr841n-v9,tp-link-tl-wr841n-nd-v9)) -$(eval $(call GluonModel,TLWR841,tl-wr841n-v10,tp-link-tl-wr841n-nd-v10)) +$(eval $(call GluonModel,TLWR841,tl-wr841-v3,tp-link-tl-wr841n-nd-v3)) +$(eval $(call GluonModel,TLWR841,tl-wr841-v5,tp-link-tl-wr841n-nd-v5)) +$(eval $(call GluonModel,TLWR841,tl-wr841-v7,tp-link-tl-wr841n-nd-v7)) +$(eval $(call GluonModel,TLWR841,tl-wr841-v8,tp-link-tl-wr841n-nd-v8)) +$(eval $(call GluonModel,TLWR841,tl-wr841-v9,tp-link-tl-wr841n-nd-v9)) +$(eval $(call GluonModel,TLWR841,tl-wr841-v10,tp-link-tl-wr841n-nd-v10)) # TL-WR842N/ND v1, v2 $(eval $(call GluonProfile,TLWR842)) From 19f248c7551b351cee2bf33a755afbd0b7b9122c Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 2 Apr 2016 04:31:50 +0200 Subject: [PATCH 361/867] build: ensure the early path doesn't leak into later build steps Leads to broken symlink setup by OpenWrt, usually breaking the build with a "Too many levels of symbolic links" message. Fixes #716. --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index e71f2be4..88fc8345 100644 --- a/Makefile +++ b/Makefile @@ -6,11 +6,14 @@ export LC_ALL LANG export SHELL:=/usr/bin/env bash +GLUONPATH ?= $(PATH) +export GLUONPATH := $(GLUONPATH) + empty:= space:= $(empty) $(empty) -GLUONMAKE_EARLY = $(SUBMAKE) -C $(GLUON_ORIGOPENWRTDIR) -f $(GLUONDIR)/Makefile GLUON_TOOLS=0 QUILT= -GLUONMAKE = $(SUBMAKE) -C $(GLUON_OPENWRTDIR) -f $(GLUONDIR)/Makefile +GLUONMAKE_EARLY = PATH=$(GLUONPATH) $(SUBMAKE) -C $(GLUON_ORIGOPENWRTDIR) -f $(GLUONDIR)/Makefile GLUON_TOOLS=0 QUILT= +GLUONMAKE = PATH=$(GLUONPATH) $(SUBMAKE) -C $(GLUON_OPENWRTDIR) -f $(GLUONDIR)/Makefile ifneq ($(OPENWRT_BUILD),1) From 827d81aab33df98bfdb2a14da778154bd5ddd45e Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 2 Apr 2016 17:53:36 +0200 Subject: [PATCH 362/867] gluon-config-mode-mesh-vpn: fix save() call for traffic limits It doesn't seem like this mistake had any effect. --- .../files/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/gluon-config-mode-mesh-vpn/files/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua b/package/gluon-config-mode-mesh-vpn/files/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua index 104e2437..f0172421 100644 --- a/package/gluon-config-mode-mesh-vpn/files/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua +++ b/package/gluon-config-mode-mesh-vpn/files/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua @@ -56,7 +56,7 @@ function M.handle(data) uci:set("simple-tc", "mesh_vpn", "limit_egress", data._limit_egress:trim()) end - uci:commit("simple-tc") + uci:save("simple-tc") uci:commit("simple-tc") end end From 4658afb2c6d50f17f0be2c7b346551d94019ff01 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 2 Apr 2016 18:54:33 +0200 Subject: [PATCH 363/867] gluon-core: commit all UCI configs at the end Avoid commiting configs inbetween to decrease number of flash writes. Fixes #714. --- .../gluon-alfred/files/lib/gluon/upgrade/500-enable-alfred | 1 - .../gluon-autoupdater/files/lib/gluon/upgrade/500-autoupdater | 1 - .../files/lib/gluon/upgrade/300-gluon-client-bridge-network | 1 - .../files/lib/gluon/upgrade/320-gluon-client-bridge-wireless | 1 - package/gluon-core/files/lib/gluon/upgrade/020-interfaces | 1 - package/gluon-core/files/lib/gluon/upgrade/030-system | 1 - package/gluon-core/files/lib/gluon/upgrade/110-network | 2 -- package/gluon-core/files/lib/gluon/upgrade/120-ntp-servers | 1 - package/gluon-core/files/lib/gluon/upgrade/140-firewall-rules | 1 - package/gluon-core/files/lib/gluon/upgrade/200-wireless | 1 - package/gluon-core/files/lib/gluon/upgrade/998-commit | 3 +++ .../files/lib/gluon/upgrade/019-legacy-interfaces | 1 - .../gluon-legacy/files/lib/gluon/upgrade/210-legacy-wireless | 1 - .../files/lib/gluon/upgrade/290-legacy-setup-mode | 2 -- .../gluon-legacy/files/lib/gluon/upgrade/290-legacy-simple-tc | 1 - .../files/lib/gluon/upgrade/390-legacy-mesh-vpn-fastd | 1 - .../files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-14 | 1 - .../files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-15 | 1 - .../lib/gluon/upgrade/300-gluon-mesh-batman-adv-core-wan | 1 - .../lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh | 4 ---- .../lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless | 2 -- .../gluon/upgrade/330-gluon-mesh-batman-adv-core-mesh-on-wan | 1 - .../gluon/upgrade/340-gluon-mesh-batman-adv-core-mesh-on-lan | 1 - .../lib/gluon/upgrade/350-gluon-mesh-batman-adv-core-rssid | 1 - .../files/lib/gluon/upgrade/400-mesh-vpn-fastd | 3 --- .../lib/gluon/upgrade/410-mesh-vpn-fastd-generate-secret | 1 - .../files/lib/gluon/upgrade/420-mesh-vpn-fastd-simple-tc | 1 - .../files/lib/gluon/upgrade/400-neighbour-info-firewall | 1 - package/gluon-next-node/files/lib/gluon/upgrade/400-next-node | 2 -- .../files/lib/gluon/upgrade/500-node-info-system | 1 - .../files/lib/gluon/upgrade/510-node-info-role | 1 - .../files/lib/gluon/upgrade/400-respondd-firewall | 1 - .../gluon-setup-mode/files/lib/gluon/upgrade/300-setup-mode | 1 - .../files/lib/gluon/upgrade/310-setup-mode-migrate | 1 - .../files/lib/gluon/upgrade/500-status-page-api | 2 -- 35 files changed, 3 insertions(+), 44 deletions(-) create mode 100755 package/gluon-core/files/lib/gluon/upgrade/998-commit diff --git a/package/gluon-alfred/files/lib/gluon/upgrade/500-enable-alfred b/package/gluon-alfred/files/lib/gluon/upgrade/500-enable-alfred index 8c52d8a6..d3802d8a 100755 --- a/package/gluon-alfred/files/lib/gluon/upgrade/500-enable-alfred +++ b/package/gluon-alfred/files/lib/gluon/upgrade/500-enable-alfred @@ -16,4 +16,3 @@ c:section('alfred', 'alfred', 'alfred', ) c:save('alfred') -c:commit('alfred') diff --git a/package/gluon-autoupdater/files/lib/gluon/upgrade/500-autoupdater b/package/gluon-autoupdater/files/lib/gluon/upgrade/500-autoupdater index b569f24e..17006b70 100755 --- a/package/gluon-autoupdater/files/lib/gluon/upgrade/500-autoupdater +++ b/package/gluon-autoupdater/files/lib/gluon/upgrade/500-autoupdater @@ -40,7 +40,6 @@ end c:set('autoupdater', 'settings', 'version_file', '/lib/gluon/release') c:save('autoupdater') -c:commit('autoupdater') local autoupdater_util = require 'autoupdater.util' diff --git a/package/gluon-client-bridge/files/lib/gluon/upgrade/300-gluon-client-bridge-network b/package/gluon-client-bridge/files/lib/gluon/upgrade/300-gluon-client-bridge-network index 5ee558cf..4a897f74 100755 --- a/package/gluon-client-bridge/files/lib/gluon/upgrade/300-gluon-client-bridge-network +++ b/package/gluon-client-bridge/files/lib/gluon/upgrade/300-gluon-client-bridge-network @@ -24,4 +24,3 @@ end uci:set('network', 'client', 'macaddr', sysconfig.primary_mac) uci:save('network') -uci:commit('network') diff --git a/package/gluon-client-bridge/files/lib/gluon/upgrade/320-gluon-client-bridge-wireless b/package/gluon-client-bridge/files/lib/gluon/upgrade/320-gluon-client-bridge-wireless index 4eaccacb..8d5c7181 100755 --- a/package/gluon-client-bridge/files/lib/gluon/upgrade/320-gluon-client-bridge-wireless +++ b/package/gluon-client-bridge/files/lib/gluon/upgrade/320-gluon-client-bridge-wireless @@ -45,4 +45,3 @@ end util.iterate_radios(configure_radio) uci:save('wireless') -uci:commit('wireless') diff --git a/package/gluon-core/files/lib/gluon/upgrade/020-interfaces b/package/gluon-core/files/lib/gluon/upgrade/020-interfaces index a051c738..1818ad00 100755 --- a/package/gluon-core/files/lib/gluon/upgrade/020-interfaces +++ b/package/gluon-core/files/lib/gluon/upgrade/020-interfaces @@ -32,5 +32,4 @@ if not (sysconfig.lan_ifname or sysconfig.wan_ifname) then uci:delete('network', 'wan') uci:save('network') - uci:commit('network') end diff --git a/package/gluon-core/files/lib/gluon/upgrade/030-system b/package/gluon-core/files/lib/gluon/upgrade/030-system index d7a66605..0086a5dc 100755 --- a/package/gluon-core/files/lib/gluon/upgrade/030-system +++ b/package/gluon-core/files/lib/gluon/upgrade/030-system @@ -14,5 +14,4 @@ if not sysconfig.gluon_version then uci:set('system', system, 'timezone', site.timezone) uci:save('system') - uci:commit('system') end diff --git a/package/gluon-core/files/lib/gluon/upgrade/110-network b/package/gluon-core/files/lib/gluon/upgrade/110-network index 5de2f1f4..bf87d47f 100755 --- a/package/gluon-core/files/lib/gluon/upgrade/110-network +++ b/package/gluon-core/files/lib/gluon/upgrade/110-network @@ -53,7 +53,6 @@ uci:section('network', 'route6', 'wan6_unreachable', ) uci:save('network') -uci:commit('network') uci:section('firewall', 'rule', 'wan_igmp', @@ -79,7 +78,6 @@ uci:section('firewall', 'rule', 'wan_mld', ) uci:save('firewall') -uci:commit('firewall') sysctl.set('net.ipv6.conf.all.accept_ra', 0) diff --git a/package/gluon-core/files/lib/gluon/upgrade/120-ntp-servers b/package/gluon-core/files/lib/gluon/upgrade/120-ntp-servers index 2b3a2df6..f38c1f5d 100755 --- a/package/gluon-core/files/lib/gluon/upgrade/120-ntp-servers +++ b/package/gluon-core/files/lib/gluon/upgrade/120-ntp-servers @@ -11,4 +11,3 @@ local c = uci.cursor() c:delete('system', 'ntp', 'server') c:set_list('system', 'ntp', 'server', site.ntp_servers) c:save('system') -c:commit('system') diff --git a/package/gluon-core/files/lib/gluon/upgrade/140-firewall-rules b/package/gluon-core/files/lib/gluon/upgrade/140-firewall-rules index 792e06a2..abd45381 100755 --- a/package/gluon-core/files/lib/gluon/upgrade/140-firewall-rules +++ b/package/gluon-core/files/lib/gluon/upgrade/140-firewall-rules @@ -27,4 +27,3 @@ c:section('firewall', 'rule', 'wan_ssh', ) c:save('firewall') -c:commit('firewall') diff --git a/package/gluon-core/files/lib/gluon/upgrade/200-wireless b/package/gluon-core/files/lib/gluon/upgrade/200-wireless index 2ada9b3c..5a4ec0a4 100755 --- a/package/gluon-core/files/lib/gluon/upgrade/200-wireless +++ b/package/gluon-core/files/lib/gluon/upgrade/200-wireless @@ -33,4 +33,3 @@ end util.iterate_radios(configure_radio) uci:save('wireless') -uci:commit('wireless') diff --git a/package/gluon-core/files/lib/gluon/upgrade/998-commit b/package/gluon-core/files/lib/gluon/upgrade/998-commit new file mode 100755 index 00000000..5f1f7332 --- /dev/null +++ b/package/gluon-core/files/lib/gluon/upgrade/998-commit @@ -0,0 +1,3 @@ +#!/bin/sh + +uci commit diff --git a/package/gluon-legacy/files/lib/gluon/upgrade/019-legacy-interfaces b/package/gluon-legacy/files/lib/gluon/upgrade/019-legacy-interfaces index b48e42b8..691e4ad7 100755 --- a/package/gluon-legacy/files/lib/gluon/upgrade/019-legacy-interfaces +++ b/package/gluon-legacy/files/lib/gluon/upgrade/019-legacy-interfaces @@ -34,7 +34,6 @@ if sysconfig.gluon_version == 'legacy' then uci:delete('network', 'wan') uci:save('network') - uci:commit('network') end diff --git a/package/gluon-legacy/files/lib/gluon/upgrade/210-legacy-wireless b/package/gluon-legacy/files/lib/gluon/upgrade/210-legacy-wireless index 36da0632..d8fd1720 100755 --- a/package/gluon-legacy/files/lib/gluon/upgrade/210-legacy-wireless +++ b/package/gluon-legacy/files/lib/gluon/upgrade/210-legacy-wireless @@ -20,5 +20,4 @@ if sysconfig.gluon_version == 'legacy' then uci:delete_all('wireless', 'wifi-iface', delete_legacy_iface) uci:save('wireless') - uci:commit('wireless') end diff --git a/package/gluon-legacy/files/lib/gluon/upgrade/290-legacy-setup-mode b/package/gluon-legacy/files/lib/gluon/upgrade/290-legacy-setup-mode index 0b97e120..d2a67484 100755 --- a/package/gluon-legacy/files/lib/gluon/upgrade/290-legacy-setup-mode +++ b/package/gluon-legacy/files/lib/gluon/upgrade/290-legacy-setup-mode @@ -12,9 +12,7 @@ if sysconfig.gluon_version == 'legacy' then if old == '1' then local setup_mode = uci:get_first('gluon-setup-mode', 'setup_mode') uci:set('gluon-setup-mode', setup_mode, 'configured', '1') - uci:save('gluon-setup-mode') - uci:commit('gluon-setup-mode') break end diff --git a/package/gluon-legacy/files/lib/gluon/upgrade/290-legacy-simple-tc b/package/gluon-legacy/files/lib/gluon/upgrade/290-legacy-simple-tc index 56621887..652c53c9 100755 --- a/package/gluon-legacy/files/lib/gluon/upgrade/290-legacy-simple-tc +++ b/package/gluon-legacy/files/lib/gluon/upgrade/290-legacy-simple-tc @@ -21,7 +21,6 @@ if sysconfig.gluon_version == 'legacy' then ) uci:save('simple-tc') - uci:commit('simple-tc') break end diff --git a/package/gluon-legacy/files/lib/gluon/upgrade/390-legacy-mesh-vpn-fastd b/package/gluon-legacy/files/lib/gluon/upgrade/390-legacy-mesh-vpn-fastd index 468a35a6..21f95e07 100755 --- a/package/gluon-legacy/files/lib/gluon/upgrade/390-legacy-mesh-vpn-fastd +++ b/package/gluon-legacy/files/lib/gluon/upgrade/390-legacy-mesh-vpn-fastd @@ -33,5 +33,4 @@ if sysconfig.gluon_version == 'legacy' then end uci:save('fastd') - uci:commit('fastd') end diff --git a/package/gluon-mesh-batman-adv-14/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-14 b/package/gluon-mesh-batman-adv-14/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-14 index 05776c30..30e2682b 100755 --- a/package/gluon-mesh-batman-adv-14/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-14 +++ b/package/gluon-mesh-batman-adv-14/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-14 @@ -45,4 +45,3 @@ end uci:save('network') -uci:commit('network') diff --git a/package/gluon-mesh-batman-adv-15/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-15 b/package/gluon-mesh-batman-adv-15/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-15 index f9f54003..7148d42c 100755 --- a/package/gluon-mesh-batman-adv-15/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-15 +++ b/package/gluon-mesh-batman-adv-15/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-15 @@ -45,4 +45,3 @@ end uci:save('network') -uci:commit('network') diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/300-gluon-mesh-batman-adv-core-wan b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/300-gluon-mesh-batman-adv-core-wan index c9084ea6..00b16414 100755 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/300-gluon-mesh-batman-adv-core-wan +++ b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/300-gluon-mesh-batman-adv-core-wan @@ -7,5 +7,4 @@ local uci = require('luci.model.uci').cursor() -- fix up duplicate mac addresses (for mesh-on-WAN) uci:set('network', 'wan', 'macaddr', util.generate_mac(1, 0)) uci:save('network') -uci:commit('network') diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh index 0843e937..d9999456 100755 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh +++ b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh @@ -24,7 +24,6 @@ uci:section('batman-adv', 'mesh', 'bat0', } ) uci:save('batman-adv') -uci:commit('batman-adv') if not uci:get('network', 'client', 'ifname') then uci:add_to_set('network', 'client', 'ifname', 'bat0') @@ -53,7 +52,6 @@ uci:section('network', 'interface', 'bat0', ) uci:save('network') -uci:commit('network') uci:delete('firewall', 'client') @@ -77,7 +75,6 @@ uci:section('firewall', 'rule', 'client_dns', ) uci:save('firewall') -uci:commit('firewall') local dnsmasq = uci:get_first('dhcp', 'dnsmasq') @@ -94,7 +91,6 @@ uci:section('dhcp', 'dhcp', 'client', ) uci:save('dhcp') -uci:commit('dhcp') sysctl.set('net.ipv6.conf.br-client.forwarding', 0) diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless index 8835c997..a73912b8 100755 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless +++ b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless @@ -131,5 +131,3 @@ util.iterate_radios(configure_radio) uci:save('wireless') uci:save('network') -uci:commit('wireless') -uci:commit('network') 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 8db95145..7a964ee2 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 @@ -16,4 +16,3 @@ if not c:get('network', 'mesh_wan') then end c:save('network') -c:commit('network') 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 8b192adb..27c1935b 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 @@ -33,5 +33,4 @@ if sysconfig.lan_ifname and not uci:get('network', 'mesh_lan') then }) uci:save('network') - uci:commit('network') end diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-core-rssid b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-core-rssid index 5ddb4f90..10b67171 100755 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-core-rssid +++ b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-core-rssid @@ -6,5 +6,4 @@ if uci:get('system', 'rssid_wlan0') then uci:set('system', 'rssid_wlan0', 'dev', 'mesh0') uci:save('system') - uci:commit('system') end diff --git a/package/gluon-mesh-vpn-fastd/files/lib/gluon/upgrade/400-mesh-vpn-fastd b/package/gluon-mesh-vpn-fastd/files/lib/gluon/upgrade/400-mesh-vpn-fastd index 316546bc..902f1ccd 100755 --- a/package/gluon-mesh-vpn-fastd/files/lib/gluon/upgrade/400-mesh-vpn-fastd +++ b/package/gluon-mesh-vpn-fastd/files/lib/gluon/upgrade/400-mesh-vpn-fastd @@ -119,7 +119,6 @@ add_groups('mesh_vpn', site.fastd_mesh_vpn.groups) uci:save('fastd') -uci:commit('fastd') uci:section('network', 'interface', 'mesh_vpn', @@ -133,7 +132,6 @@ uci:section('network', 'interface', 'mesh_vpn', ) uci:save('network') -uci:commit('network') uci:section('firewall', 'include', 'mesh_vpn_dns', @@ -145,4 +143,3 @@ uci:section('firewall', 'include', 'mesh_vpn_dns', ) uci:save('firewall') -uci:commit('firewall') diff --git a/package/gluon-mesh-vpn-fastd/files/lib/gluon/upgrade/410-mesh-vpn-fastd-generate-secret b/package/gluon-mesh-vpn-fastd/files/lib/gluon/upgrade/410-mesh-vpn-fastd-generate-secret index 68a2fe67..e581dea8 100755 --- a/package/gluon-mesh-vpn-fastd/files/lib/gluon/upgrade/410-mesh-vpn-fastd-generate-secret +++ b/package/gluon-mesh-vpn-fastd/files/lib/gluon/upgrade/410-mesh-vpn-fastd-generate-secret @@ -9,5 +9,4 @@ local secret = c:get("fastd", "mesh_vpn", "secret") if not secret or not secret:match(("%x"):rep(64)) then c:set("fastd", "mesh_vpn", "secret", "generate") c:save("fastd") - c:commit("fastd") end diff --git a/package/gluon-mesh-vpn-fastd/files/lib/gluon/upgrade/420-mesh-vpn-fastd-simple-tc b/package/gluon-mesh-vpn-fastd/files/lib/gluon/upgrade/420-mesh-vpn-fastd-simple-tc index d4cfcdde..3c3e10a4 100755 --- a/package/gluon-mesh-vpn-fastd/files/lib/gluon/upgrade/420-mesh-vpn-fastd-simple-tc +++ b/package/gluon-mesh-vpn-fastd/files/lib/gluon/upgrade/420-mesh-vpn-fastd-simple-tc @@ -28,5 +28,4 @@ if not uci:get('simple-tc', 'mesh_vpn') then uci:section('simple-tc', 'interface', 'mesh_vpn', config) uci:save('simple-tc') - uci:commit('simple-tc') end 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 index a6d7f490..373f166a 100755 --- 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 @@ -17,4 +17,3 @@ uci:section('firewall', 'rule', 'wan_respondd_reply', ) uci:save('firewall') -uci:commit('firewall') diff --git a/package/gluon-next-node/files/lib/gluon/upgrade/400-next-node b/package/gluon-next-node/files/lib/gluon/upgrade/400-next-node index 0ff959fe..79cc0369 100755 --- a/package/gluon-next-node/files/lib/gluon/upgrade/400-next-node +++ b/package/gluon-next-node/files/lib/gluon/upgrade/400-next-node @@ -39,7 +39,6 @@ c:section('network', 'route6', 'local_node_route6', ) c:save('network') -c:commit('network') c:delete('firewall', 'local_node') c:section('firewall', 'zone', 'local_node', @@ -52,4 +51,3 @@ c:section('firewall', 'zone', 'local_node', } ) c:save('firewall') -c:commit('firewall') diff --git a/package/gluon-node-info/files/lib/gluon/upgrade/500-node-info-system b/package/gluon-node-info/files/lib/gluon/upgrade/500-node-info-system index a17b9461..a70eb282 100755 --- a/package/gluon-node-info/files/lib/gluon/upgrade/500-node-info-system +++ b/package/gluon-node-info/files/lib/gluon/upgrade/500-node-info-system @@ -7,5 +7,4 @@ local config = 'gluon-node-info' if not uci:get_first(config, 'system') then uci:section(config, 'system') uci:save(config) - uci:commit(config) end diff --git a/package/gluon-node-info/files/lib/gluon/upgrade/510-node-info-role b/package/gluon-node-info/files/lib/gluon/upgrade/510-node-info-role index 6e54a234..06d42f8e 100755 --- a/package/gluon-node-info/files/lib/gluon/upgrade/510-node-info-role +++ b/package/gluon-node-info/files/lib/gluon/upgrade/510-node-info-role @@ -15,5 +15,4 @@ end if not role then uci:set(config, uci:get_first(config, 'system'), 'role', default_role) uci:save(config) - uci:commit(config) end 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 c5076830..a78cfb3d 100755 --- a/package/gluon-respondd/files/lib/gluon/upgrade/400-respondd-firewall +++ b/package/gluon-respondd/files/lib/gluon/upgrade/400-respondd-firewall @@ -29,4 +29,3 @@ uci:section('firewall', 'rule', 'client_respondd', ) uci:save('firewall') -uci:commit('firewall') diff --git a/package/gluon-setup-mode/files/lib/gluon/upgrade/300-setup-mode b/package/gluon-setup-mode/files/lib/gluon/upgrade/300-setup-mode index ae59c7aa..481a4fa0 100755 --- a/package/gluon-setup-mode/files/lib/gluon/upgrade/300-setup-mode +++ b/package/gluon-setup-mode/files/lib/gluon/upgrade/300-setup-mode @@ -11,6 +11,5 @@ if site.setup_mode local name = c:get_first("gluon-setup-mode", "setup_mode") c:set("gluon-setup-mode", name, "configured", 1) c:save('gluon-setup-mode') - c:commit('gluon-setup-mode') end diff --git a/package/gluon-setup-mode/files/lib/gluon/upgrade/310-setup-mode-migrate b/package/gluon-setup-mode/files/lib/gluon/upgrade/310-setup-mode-migrate index 9d3b9b0a..3b5165c4 100755 --- a/package/gluon-setup-mode/files/lib/gluon/upgrade/310-setup-mode-migrate +++ b/package/gluon-setup-mode/files/lib/gluon/upgrade/310-setup-mode-migrate @@ -12,7 +12,6 @@ if old == '1' then c:set('gluon-setup-mode', setup_mode, 'configured', '1') c:save('gluon-setup-mode') - c:commit('gluon-setup-mode') end os.remove('/etc/config/gluon-config-mode') diff --git a/package/gluon-status-page-api/files/lib/gluon/upgrade/500-status-page-api b/package/gluon-status-page-api/files/lib/gluon/upgrade/500-status-page-api index a5000012..a11fac9b 100755 --- a/package/gluon-status-page-api/files/lib/gluon/upgrade/500-status-page-api +++ b/package/gluon-status-page-api/files/lib/gluon/upgrade/500-status-page-api @@ -10,6 +10,4 @@ uci batch <<-EOF set uhttpd.main.home=/lib/gluon/status-page/www set uhttpd.main.max_requests=32 - - commit uhttpd EOF From 3a3c922a4dadd2f7556c63ee96a145d93c798784 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Litza Date: Sun, 3 Apr 2016 16:14:48 +0200 Subject: [PATCH 364/867] gluon-core: use exec on uci commit --- package/gluon-core/files/lib/gluon/upgrade/998-commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/gluon-core/files/lib/gluon/upgrade/998-commit b/package/gluon-core/files/lib/gluon/upgrade/998-commit index 5f1f7332..db578a78 100755 --- a/package/gluon-core/files/lib/gluon/upgrade/998-commit +++ b/package/gluon-core/files/lib/gluon/upgrade/998-commit @@ -1,3 +1,3 @@ #!/bin/sh -uci commit +exec uci commit From 1e1363f17e1b7f02f3deba551d9f09586d133486 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Sat, 4 Apr 2015 22:36:36 +0200 Subject: [PATCH 365/867] ar71xx: Meraki MR12/MR62/MR16/MR66 support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OpenWRT now supports the CISCO Meraki enterprise class routers MR12, MR16, MR62 and MR66. The fabric firmware demands the yearly renewal of a support license. This firmware was successfully tested by @Garunda for the MR62 (and the MR12 with it for which this is an alias). The initial firmware pre OpenWRT adoption was prepared and adapted for Gluon by @tcatm. The confirmation of the functionality of the image for the MR66 (and the aliased MR16 with it) is still pending. The devices are of strategic interest to the Freifunk community as they are making a rock-solid impression. However, these come with fairly hefty annual license. The Freifunk may offer an escape route for those who had signed up and want to keep their investment into the similarly expensive hardware. Used evices sell for $60 on eBay/Amazon in the US. Here in the old world it is all >300 €, still. Credits go to @Garunda for testing, to @tcatm for finding the OpenWRT patch prior to its adoption and preparing the initial Gluon adaptation, to @smoe for the update once that patch had arrived in OpenWRT, and to @NeoRaider for his review and advice to use GluonModelAlias for MR62 and MR66 to point to MR12 and MR16, respectively. --- docs/index.rst | 5 +++++ targets/ar71xx-generic/profiles.mk | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/docs/index.rst b/docs/index.rst index 697fb67d..0af70fa0 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -94,6 +94,11 @@ ar71xx-generic - WZR-HP-G300NH - WZR-HP-G450H +* Cisco Meraki + + - MR12 / MR62 + - MR16 / MR66 + * D-Link - DIR-505 (A1) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 3b3e89d9..c1ff0912 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -288,3 +288,16 @@ $(eval $(call GluonModel,HORNETUB,hornet-ub,alfa-hornet-ub)) $(eval $(call GluonModelAlias,HORNETUB,alfa-hornet-ub,alfa-ap121)) $(eval $(call GluonModelAlias,HORNETUB,alfa-hornet-ub,alfa-ap121u)) +## Meraki + +# Meraki MR12/MR62 +$(eval $(call GluonProfile,MR12,rssileds)) +$(eval $(call GluonProfileFactorySuffix,MR12)) +$(eval $(call GluonModel,MR12,mr12,meraki-mr12)) +$(eval $(call GluonModelAlias,MR12,meraki-mr12,meraki-mr62)) + +# Meraki MR16/MR66 +$(eval $(call GluonProfile,MR16,rssileds)) +$(eval $(call GluonProfileFactorySuffix,MR16)) +$(eval $(call GluonModel,MR16,mr16,meraki-mr16)) +$(eval $(call GluonModelAlias,MR16,meraki-mr16,meraki-mr66)) From 8fec2e9286b2ec7d1ee1da821d5c195848e584a2 Mon Sep 17 00:00:00 2001 From: kb-light Date: Mon, 4 Apr 2016 00:13:42 +0200 Subject: [PATCH 366/867] CONTRIBUTING.md: update links link "packages" instead of "community repositories" add link for rejected features to bottom link list link "#gluon" to webirc link the mentioned commit 2a93c58 --- CONTRIBUTING.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d5357198..824362d7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,8 +6,8 @@ different communities with different expectations and requirements, it is both essential and difficult to have contributions from the communities. While they are sometimes necessary to adapt Gluon to the needs of the communities, they also have to be adaptable enough to fit as many needs as possible. On the other -hands, very special needs are better addressed in packages in [community -repositories], because the Gluon maintainers would not use or test them and +hands, very special needs are better addressed in [packages] in community +repositories, because the Gluon maintainers would not use or test them and thus couldn't do their "job" of maintaining them. To ease the work for the maintainers and to reduce the frustration of @@ -25,10 +25,9 @@ after merging the changes, too. The preferred way to discuss in the IRC channel ([#gluon] on irc.hackint.org) or on the [mailing list], however, you can also open a new issue on Github to -discuss there. We maintain a [list of rejected -features](https://github.com/freifunk-gluon/gluon/issues?q=label%3Arejected) -and we'd like to kindly ask you to review it first. In general, looking for -duplicates may save you some time. +discuss there. We maintain a [list of rejected features] and we'd like to +kindly ask you to review it first. In general, looking for duplicates may save +you some time. Develop on top of master ------------------------ @@ -53,7 +52,7 @@ Most changes are trivial enough to fit in one single commit in order to not clutter the history. While developing a new feature, you are free to use multiple commits, but if your feature is to be merged, reduce the number of commits to a minimum. Even huge feature introductions like the 802.11s mesh -(commit 2a93c58) fit into a single commit. +(commit [2a93c58]) fit into a single commit. If you developed your change in multiple smaller commits, you can easily [squash] those before opening the pull request. While discussing, it is okay to @@ -62,7 +61,9 @@ the pull request. This way, your change always consists of only one commit and can be merged in the instant everybody is content with the whole thing. -[community repositories]: http://gluon.readthedocs.org/en/latest/user/site.html#packages -[#gluon]: irc://irc.hackint.org/gluon +[packages]: http://gluon.readthedocs.org/en/latest/user/site.html#packages +[#gluon]: https://webirc.hackint.org/#gluon [mailing list]: mailto:gluon@luebeck.freifunk.net +[list of rejected features]: https://github.com/freifunk-gluon/gluon/issues?q=label%3Arejected +[2a93c58]: https://github.com/freifunk-gluon/gluon/commit/2a93c580428d10724116b0d2d1238e2745715a14 [squash]: https://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Squashing-Commits From b46589a637cca1d8cef502eae350f41c2929a1dd Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 5 Apr 2016 20:55:35 +0200 Subject: [PATCH 367/867] xtables-addons: build: fix configure compatiblity with POSIX shells Fixes #710. --- ...igure-compatiblity-with-POSIX-shells.patch | 2026 +++++++++++++++++ 1 file changed, 2026 insertions(+) create mode 100644 patches/openwrt/0026-xtables-addons-build-fix-configure-compatiblity-with-POSIX-shells.patch diff --git a/patches/openwrt/0026-xtables-addons-build-fix-configure-compatiblity-with-POSIX-shells.patch b/patches/openwrt/0026-xtables-addons-build-fix-configure-compatiblity-with-POSIX-shells.patch new file mode 100644 index 00000000..fa4b76a5 --- /dev/null +++ b/patches/openwrt/0026-xtables-addons-build-fix-configure-compatiblity-with-POSIX-shells.patch @@ -0,0 +1,2026 @@ +From: Matthias Schiffer +Date: Tue, 5 Apr 2016 20:30:56 +0200 +Subject: xtables-addons: build: fix configure compatiblity with POSIX shells + +diff --git a/package/network/utils/xtables-addons/patches/001-build-fix-configure-compatiblity-with-POSIX-shells.patch b/package/network/utils/xtables-addons/patches/001-build-fix-configure-compatiblity-with-POSIX-shells.patch +new file mode 100644 +index 0000000..e0b11b5 +--- /dev/null ++++ b/package/network/utils/xtables-addons/patches/001-build-fix-configure-compatiblity-with-POSIX-shells.patch +@@ -0,0 +1,51 @@ ++From f07a0a5cb8b3c5e1aee8b30c7fa21ccfbf24a95a Mon Sep 17 00:00:00 2001 ++Message-Id: ++From: Matthias Schiffer ++Date: Fri, 1 Apr 2016 22:24:00 +0200 ++Subject: [PATCH] build: fix configure compatiblity with POSIX shells ++ ++The kernel version detection code uses some bashisms, which makes the build ++fail on Debian systems where /bin/sh links to dash. Replace with POSIX- ++conforming commands at the cost of requiring awk. ++--- ++ configure.ac | 24 +++++++++--------------- ++ 1 file changed, 9 insertions(+), 15 deletions(-) ++ ++diff --git a/configure.ac b/configure.ac ++index 82a1355..5a5ea57 100644 ++--- a/configure.ac +++++ b/configure.ac ++@@ -44,21 +44,15 @@ regular_CFLAGS="-Wall -Waggregate-return -Wmissing-declarations \ ++ ++ if test -n "$kbuilddir"; then ++ AC_MSG_CHECKING([kernel version that we will build against]) ++- krel="$(make -sC "$kbuilddir" M=$PWD kernelrelease)"; ++- kmajor="${krel%%[[^0-9]]*}"; ++- kmajor="$(($kmajor+0))"; ++- krel="${krel:${#kmajor}}"; ++- krel="${krel#.}"; ++- kminor="${krel%%[[^0-9]]*}"; ++- kminor="$(($kminor+0))"; ++- krel="${krel:${#kminor}}"; ++- krel="${krel#.}"; ++- kmicro="${krel%%[[^0-9]]*}"; ++- kmicro="$(($kmicro+0))"; ++- krel="${krel:${#kmicro}}"; ++- krel="${krel#.}"; ++- kstable="${krel%%[[^0-9]]*}"; ++- kstable="$(($kstable+0))"; +++ krel="$(make -sC "$kbuilddir" M=$PWD kernelrelease | $AWK -v 'FS=[[^0-9.]]' '{print $1; exit}')"; +++ save_IFS=$IFS; +++ IFS='.'; +++ set x $krel; +++ IFS=$save_IFS; +++ kmajor="$(($2+0))"; +++ kminor="$(($3+0))"; +++ kmicro="$(($4+0))"; +++ kstable="$(($5+0))"; ++ if test -z "$kmajor" -o -z "$kminor" -o -z "$kmicro"; then ++ echo "WARNING: Version detection did not succeed. Continue at own luck."; ++ else ++-- ++2.8.0 ++ +diff --git a/package/network/utils/xtables-addons/patches/002-fix-kernel-version-detection.patch b/package/network/utils/xtables-addons/patches/002-fix-kernel-version-detection.patch +index d3b7caa..6a7a099 100644 +--- a/package/network/utils/xtables-addons/patches/002-fix-kernel-version-detection.patch ++++ b/package/network/utils/xtables-addons/patches/002-fix-kernel-version-detection.patch +@@ -1,1954 +1,11 @@ +---- a/configure +-+++ b/configure +-@@ -1,9 +1,11 @@ +- #! /bin/sh +- # Guess values for system-dependent variables and create Makefiles. +--# Generated by GNU Autoconf 2.69 for xtables-addons 2.5. +-+# Generated by GNU Autoconf 2.68 for xtables-addons 2.5. +- # +- # +--# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +-+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +-+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software +-+# Foundation, Inc. +- # +- # +- # This configure script is free software; the Free Software Foundation +-@@ -132,31 +134,6 @@ export LANGUAGE +- # CDPATH. +- (unset CDPATH) >/dev/null 2>&1 && unset CDPATH +- +--# Use a proper internal environment variable to ensure we don't fall +-- # into an infinite loop, continuously re-executing ourselves. +-- if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then +-- _as_can_reexec=no; export _as_can_reexec; +-- # We cannot yet assume a decent shell, so we have to provide a +--# neutralization value for shells without unset; and this also +--# works around shells that cannot unset nonexistent variables. +--# Preserve -v and -x to the replacement shell. +--BASH_ENV=/dev/null +--ENV=/dev/null +--(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +--case $- in # (((( +-- *v*x* | *x*v* ) as_opts=-vx ;; +-- *v* ) as_opts=-v ;; +-- *x* ) as_opts=-x ;; +-- * ) as_opts= ;; +--esac +--exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +--# Admittedly, this is quite paranoid, since all the known shells bail +--# out after a failed `exec'. +--$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +--as_fn_exit 255 +-- fi +-- # We don't want this to propagate to other subprocesses. +-- { _as_can_reexec=; unset _as_can_reexec;} +- if test "x$CONFIG_SHELL" = x; then +- as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : +- emulate sh +-@@ -190,8 +167,7 @@ if ( set x; as_fn_ret_success y && test +- else +- exitcode=1; echo positional parameters were not saved. +- fi +--test x\$exitcode = x0 || exit 1 +--test -x / || exit 1" +-+test x\$exitcode = x0 || exit 1" +- as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO +- as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO +- eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && +-@@ -244,25 +220,21 @@ IFS=$as_save_IFS +- +- +- if test "x$CONFIG_SHELL" != x; then : +-- export CONFIG_SHELL +-- # We cannot yet assume a decent shell, so we have to provide a +--# neutralization value for shells without unset; and this also +--# works around shells that cannot unset nonexistent variables. +--# Preserve -v and -x to the replacement shell. +--BASH_ENV=/dev/null +--ENV=/dev/null +--(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +--case $- in # (((( +-- *v*x* | *x*v* ) as_opts=-vx ;; +-- *v* ) as_opts=-v ;; +-- *x* ) as_opts=-x ;; +-- * ) as_opts= ;; +--esac +--exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +--# Admittedly, this is quite paranoid, since all the known shells bail +--# out after a failed `exec'. +--$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +--exit 255 +-+ # We cannot yet assume a decent shell, so we have to provide a +-+ # neutralization value for shells without unset; and this also +-+ # works around shells that cannot unset nonexistent variables. +-+ # Preserve -v and -x to the replacement shell. +-+ BASH_ENV=/dev/null +-+ ENV=/dev/null +-+ (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +-+ export CONFIG_SHELL +-+ case $- in # (((( +-+ *v*x* | *x*v* ) as_opts=-vx ;; +-+ *v* ) as_opts=-v ;; +-+ *x* ) as_opts=-x ;; +-+ * ) as_opts= ;; +-+ esac +-+ exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} +- fi +- +- if test x$as_have_required = xno; then : +-@@ -364,14 +336,6 @@ $as_echo X"$as_dir" | +- +- +- } # as_fn_mkdir_p +-- +--# as_fn_executable_p FILE +--# ----------------------- +--# Test if FILE is an executable regular file. +--as_fn_executable_p () +--{ +-- test -f "$1" && test -x "$1" +--} # as_fn_executable_p +- # as_fn_append VAR VALUE +- # ---------------------- +- # Append the text in VALUE to the end of the definition contained in VAR. Take +-@@ -493,10 +457,6 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits +- chmod +x "$as_me.lineno" || +- { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } +- +-- # If we had to re-execute with $CONFIG_SHELL, we're ensured to have +-- # already done that, so ensure we don't try to do so again and fall +-- # in an infinite loop. This has already happened in practice. +-- _as_can_reexec=no; export _as_can_reexec +- # Don't try to exec as it changes $[0], causing all sort of problems +- # (the dirname of $[0] is not the place where we might find the +- # original and so on. Autoconf is especially sensitive to this). +-@@ -531,16 +491,16 @@ if (echo >conf$$.file) 2>/dev/null; then +- # ... but there are two gotchas: +- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. +- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. +-- # In both cases, we have to default to `cp -pR'. +-+ # In both cases, we have to default to `cp -p'. +- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || +-- as_ln_s='cp -pR' +-+ as_ln_s='cp -p' +- elif ln conf$$.file conf$$ 2>/dev/null; then +- as_ln_s=ln +- else +-- as_ln_s='cp -pR' +-+ as_ln_s='cp -p' +- fi +- else +-- as_ln_s='cp -pR' +-+ as_ln_s='cp -p' +- fi +- rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +- rmdir conf$$.dir 2>/dev/null +-@@ -552,8 +512,28 @@ else +- as_mkdir_p=false +- fi +- +--as_test_x='test -x' +--as_executable_p=as_fn_executable_p +-+if test -x / >/dev/null 2>&1; then +-+ as_test_x='test -x' +-+else +-+ if ls -dL / >/dev/null 2>&1; then +-+ as_ls_L_option=L +-+ else +-+ as_ls_L_option= +-+ fi +-+ as_test_x=' +-+ eval sh -c '\'' +-+ if test -d "$1"; then +-+ test -d "$1/."; +-+ else +-+ case $1 in #( +-+ -*)set "./$1";; +-+ esac; +-+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( +-+ ???[sx]*):;;*)false;;esac;fi +-+ '\'' sh +-+ ' +-+fi +-+as_executable_p=$as_test_x +- +- # Sed expression to map a string onto a valid CPP name. +- as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +-@@ -688,10 +668,6 @@ CPPFLAGS +- LDFLAGS +- CFLAGS +- CC +--AM_BACKSLASH +--AM_DEFAULT_VERBOSITY +--AM_DEFAULT_V +--AM_V +- am__untar +- am__tar +- AMTAR +-@@ -756,7 +732,6 @@ SHELL' +- ac_subst_files='' +- ac_user_opts=' +- enable_option_checking +--enable_silent_rules +- enable_dependency_tracking +- enable_static +- enable_shared +-@@ -1237,6 +1212,8 @@ target=$target_alias +- if test "x$host_alias" != x; then +- if test "x$build_alias" = x; then +- cross_compiling=maybe +-+ $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. +-+ If a cross compiler is detected then cross compile mode will be used" >&2 +- elif test "x$build_alias" != "x$host_alias"; then +- cross_compiling=yes +- fi +-@@ -1400,12 +1377,8 @@ Optional Features: +- --disable-option-checking ignore unrecognized --enable/--with options +- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) +- --enable-FEATURE[=ARG] include FEATURE [ARG=yes] +-- --enable-silent-rules less verbose build output (undo: "make V=1") +-- --disable-silent-rules verbose build output (undo: "make V=0") +-- --enable-dependency-tracking +-- do not reject slow dependency extractors +-- --disable-dependency-tracking +-- speeds up one-time build +-+ --disable-dependency-tracking speeds up one-time build +-+ --enable-dependency-tracking do not reject slow dependency extractors +- --enable-static[=PKGS] build static libraries [default=no] +- --enable-shared[=PKGS] build shared libraries [default=yes] +- --enable-fast-install[=PKGS] +-@@ -1415,7 +1388,7 @@ Optional Features: +- Optional Packages: +- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] +- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) +-- --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use +-+ --with-pic try to use only PIC/non-PIC objects [default=use +- both] +- --with-gnu-ld assume the C compiler uses GNU ld [default=no] +- --with-sysroot=DIR Search for dependent libraries within DIR +-@@ -1512,9 +1485,9 @@ test -n "$ac_init_help" && exit $ac_stat +- if $ac_init_version; then +- cat <<\_ACEOF +- xtables-addons configure 2.5 +--generated by GNU Autoconf 2.69 +-+generated by GNU Autoconf 2.68 +- +--Copyright (C) 2012 Free Software Foundation, Inc. +-+Copyright (C) 2010 Free Software Foundation, Inc. +- This configure script is free software; the Free Software Foundation +- gives unlimited permission to copy, distribute and modify it. +- _ACEOF +-@@ -1590,7 +1563,7 @@ $as_echo "$ac_try_echo"; } >&5 +- test ! -s conftest.err +- } && test -s conftest$ac_exeext && { +- test "$cross_compiling" = yes || +-- test -x conftest$ac_exeext +-+ $as_test_x conftest$ac_exeext +- }; then : +- ac_retval=0 +- else +-@@ -1877,7 +1850,7 @@ This file contains any messages produced +- running configure, to aid debugging if configure makes a mistake. +- +- It was created by xtables-addons $as_me 2.5, which was +--generated by GNU Autoconf 2.69. Invocation command line was +-+generated by GNU Autoconf 2.68. Invocation command line was +- +- $ $0 $@ +- +-@@ -2293,7 +2266,7 @@ case $as_dir/ in #(( +- # by default. +- for ac_prog in ginstall scoinst install; do +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then +- if test $ac_prog = install && +- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then +- # AIX install. It has an incompatible calling convention. +-@@ -2349,10 +2322,13 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCR +- +- test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' +- +--am__api_version='1.14' +-+am__api_version='1.11' +- +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +- $as_echo_n "checking whether build environment is sane... " >&6; } +-+# Just in case +-+sleep 1 +-+echo timestamp > conftest.file +- # Reject unsafe characters in $srcdir or the absolute working directory +- # name. Accept space and tab only in the latter. +- am_lf=' +-@@ -2363,40 +2339,32 @@ case `pwd` in +- esac +- case $srcdir in +- *[\\\"\#\$\&\'\`$am_lf\ \ ]*) +-- as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +-+ as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; +- esac +- +--# Do 'set' in a subshell so we don't clobber the current shell's +-+# Do `set' in a subshell so we don't clobber the current shell's +- # arguments. Must try -L first in case configure is actually a +- # symlink; some systems play weird games with the mod time of symlinks +- # (eg FreeBSD returns the mod time of the symlink's containing +- # directory). +- if ( +-- am_has_slept=no +-- for am_try in 1 2; do +-- echo "timestamp, slept: $am_has_slept" > conftest.file +-- set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` +-- if test "$*" = "X"; then +-- # -L didn't work. +-- set X `ls -t "$srcdir/configure" conftest.file` +-- fi +-- if test "$*" != "X $srcdir/configure conftest.file" \ +-- && test "$*" != "X conftest.file $srcdir/configure"; then +-+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` +-+ if test "$*" = "X"; then +-+ # -L didn't work. +-+ set X `ls -t "$srcdir/configure" conftest.file` +-+ fi +-+ rm -f conftest.file +-+ if test "$*" != "X $srcdir/configure conftest.file" \ +-+ && test "$*" != "X conftest.file $srcdir/configure"; then +-+ +-+ # If neither matched, then we have a broken ls. This can happen +-+ # if, for instance, CONFIG_SHELL is bash and it inherits a +-+ # broken ls alias from the environment. This has actually +-+ # happened. Such a system could not be considered "sane". +-+ as_fn_error $? "ls -t appears to fail. Make sure there is not a broken +-+alias in your environment" "$LINENO" 5 +-+ fi +- +-- # If neither matched, then we have a broken ls. This can happen +-- # if, for instance, CONFIG_SHELL is bash and it inherits a +-- # broken ls alias from the environment. This has actually +-- # happened. Such a system could not be considered "sane". +-- as_fn_error $? "ls -t appears to fail. Make sure there is not a broken +-- alias in your environment" "$LINENO" 5 +-- fi +-- if test "$2" = conftest.file || test $am_try -eq 2; then +-- break +-- fi +-- # Just in case. +-- sleep 1 +-- am_has_slept=yes +-- done +- test "$2" = conftest.file +- ) +- then +-@@ -2408,16 +2376,6 @@ Check your system clock" "$LINENO" 5 +- fi +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +- $as_echo "yes" >&6; } +--# If we didn't sleep, we still need to ensure time stamps of config.status and +--# generated files are strictly newer. +--am_sleep_pid= +--if grep 'slept: no' conftest.file >/dev/null 2>&1; then +-- ( sleep 1 ) & +-- am_sleep_pid=$! +--fi +-- +--rm -f conftest.file +-- +- test "$program_prefix" != NONE && +- program_transform_name="s&^&$program_prefix&;$program_transform_name" +- # Use a double $ so make ignores it. +-@@ -2440,12 +2398,12 @@ if test x"${MISSING+set}" != xset; then +- esac +- fi +- # Use eval to expand $SHELL +--if eval "$MISSING --is-lightweight"; then +-- am_missing_run="$MISSING " +-+if eval "$MISSING --run true"; then +-+ am_missing_run="$MISSING --run " +- else +- am_missing_run= +-- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +--$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +-+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +-+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +- fi +- +- if test x"${install_sh}" != xset; then +-@@ -2457,10 +2415,10 @@ if test x"${install_sh}" != xset; then +- esac +- fi +- +--# Installed binaries are usually stripped using 'strip' when the user +--# run "make install-strip". However 'strip' might not be the right +-+# Installed binaries are usually stripped using `strip' when the user +-+# run `make install-strip'. However `strip' might not be the right +- # tool to use in cross-compilation environments, therefore Automake +--# will honor the 'STRIP' environment variable to overrule this program. +-+# will honor the `STRIP' environment variable to overrule this program. +- if test "$cross_compiling" != no; then +- if test -n "$ac_tool_prefix"; then +- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +-@@ -2479,7 +2437,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_STRIP="${ac_tool_prefix}strip" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -2519,7 +2477,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_ac_ct_STRIP="strip" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -2570,7 +2528,7 @@ do +- test -z "$as_dir" && as_dir=. +- for ac_prog in mkdir gmkdir; do +- for ac_exec_ext in '' $ac_executable_extensions; do +-- as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue +-+ { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue +- case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( +- 'mkdir (GNU coreutils) '* | \ +- 'mkdir (coreutils) '* | \ +-@@ -2599,6 +2557,12 @@ fi +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +- $as_echo "$MKDIR_P" >&6; } +- +-+mkdir_p="$MKDIR_P" +-+case $mkdir_p in +-+ [\\/$]* | ?:[\\/]*) ;; +-+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +-+esac +-+ +- for ac_prog in gawk mawk nawk awk +- do +- # Extract the first word of "$ac_prog", so it can be a program name with args. +-@@ -2617,7 +2581,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_AWK="$ac_prog" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -2681,45 +2645,6 @@ else +- fi +- rmdir .tst 2>/dev/null +- +--# Check whether --enable-silent-rules was given. +--if test "${enable_silent_rules+set}" = set; then : +-- enableval=$enable_silent_rules; +--fi +-- +--case $enable_silent_rules in # ((( +-- yes) AM_DEFAULT_VERBOSITY=0;; +-- no) AM_DEFAULT_VERBOSITY=1;; +-- *) AM_DEFAULT_VERBOSITY=1;; +--esac +--am_make=${MAKE-make} +--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +--$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +--if ${am_cv_make_support_nested_variables+:} false; then : +-- $as_echo_n "(cached) " >&6 +--else +-- if $as_echo 'TRUE=$(BAR$(V)) +--BAR0=false +--BAR1=true +--V=1 +--am__doit: +-- @$(TRUE) +--.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then +-- am_cv_make_support_nested_variables=yes +--else +-- am_cv_make_support_nested_variables=no +--fi +--fi +--{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +--$as_echo "$am_cv_make_support_nested_variables" >&6; } +--if test $am_cv_make_support_nested_variables = yes; then +-- AM_V='$(V)' +-- AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +--else +-- AM_V=$AM_DEFAULT_VERBOSITY +-- AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +--fi +--AM_BACKSLASH='\' +-- +- if test "`cd $srcdir && pwd`" != "`pwd`"; then +- # Use -I$(srcdir) only when $(srcdir) != ., so that make's output +- # is not polluted with repeated "-I." +-@@ -2770,111 +2695,18 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_ru +- +- MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} +- +--# For better backward compatibility. To be removed once Automake 1.9.x +--# dies out for good. For more background, see: +--# +--# +--mkdir_p='$(MKDIR_P)' +-- +- # We need awk for the "check" target. The system "awk" is bad on +- # some platforms. +- # Always define AMTAR for backward compatibility. Yes, it's still used +- # in the wild :-( We should find a proper way to deprecate it ... +- AMTAR='$${TAR-tar}' +- +-- +--# We'll loop over all known methods to create a tar archive until one works. +--_am_tools='gnutar pax cpio none' +-- +- am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' +- +- +- +- +- +-- +--# POSIX will say in a future version that running "rm -f" with no argument +--# is OK; and we want to be able to make that assumption in our Makefile +--# recipes. So use an aggressive probe to check that the usage we want is +--# actually supported "in the wild" to an acceptable degree. +--# See automake bug#10828. +--# To make any issue more visible, cause the running configure to be aborted +--# by default if the 'rm' program in use doesn't match our expectations; the +--# user can still override this though. +--if rm -f && rm -fr && rm -rf; then : OK; else +-- cat >&2 <<'END' +--Oops! +-- +--Your 'rm' program seems unable to run without file operands specified +--on the command line, even when the '-f' option is present. This is contrary +--to the behaviour of most rm programs out there, and not conforming with +--the upcoming POSIX standard: +-- +--Please tell bug-automake@gnu.org about your system, including the value +--of your $PATH and any error possibly output before this message. This +--can help us improve future automake versions. +-- +--END +-- if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then +-- echo 'Configuration will proceed anyway, since you have set the' >&2 +-- echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 +-- echo >&2 +-- else +-- cat >&2 <<'END' +--Aborting the configuration process, to ensure you take notice of the issue. +-- +--You can download and install GNU coreutils to get an 'rm' implementation +--that behaves properly: . +-- +--If you want to complete the configuration process using your problematic +--'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +--to "yes", and re-run configure. +-- +--END +-- as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 +-- fi +--fi +-- +--# Check whether --enable-silent-rules was given. +--if test "${enable_silent_rules+set}" = set; then : +-- enableval=$enable_silent_rules; +--fi +-- +--case $enable_silent_rules in # ((( +-- yes) AM_DEFAULT_VERBOSITY=0;; +-- no) AM_DEFAULT_VERBOSITY=1;; +-- *) AM_DEFAULT_VERBOSITY=0;; +--esac +--am_make=${MAKE-make} +--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +--$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +--if ${am_cv_make_support_nested_variables+:} false; then : +-- $as_echo_n "(cached) " >&6 +--else +-- if $as_echo 'TRUE=$(BAR$(V)) +--BAR0=false +--BAR1=true +--V=1 +--am__doit: +-- @$(TRUE) +--.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then +-- am_cv_make_support_nested_variables=yes +--else +-- am_cv_make_support_nested_variables=no +--fi +--fi +--{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +--$as_echo "$am_cv_make_support_nested_variables" >&6; } +--if test $am_cv_make_support_nested_variables = yes; then +-- AM_V='$(V)' +-- AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +--else +-- AM_V=$AM_DEFAULT_VERBOSITY +-- AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +--fi +--AM_BACKSLASH='\' +-- +-- +- ac_ext=c +- ac_cpp='$CPP $CPPFLAGS' +- ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +-@@ -2897,7 +2729,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_CC="${ac_tool_prefix}gcc" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -2937,7 +2769,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_ac_ct_CC="gcc" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -2990,7 +2822,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_CC="${ac_tool_prefix}cc" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -3031,7 +2863,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then +- ac_prog_rejected=yes +- continue +-@@ -3089,7 +2921,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_CC="$ac_tool_prefix$ac_prog" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -3133,7 +2965,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_ac_ct_CC="$ac_prog" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -3579,7 +3411,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ +- /* end confdefs.h. */ +- #include +- #include +--struct stat; +-+#include +-+#include +- /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +- struct buf { int x; }; +- FILE * (*rcsopen) (struct buf *, struct stat *, int); +-@@ -3663,65 +3496,6 @@ ac_cpp='$CPP $CPPFLAGS' +- ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +- ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +- ac_compiler_gnu=$ac_cv_c_compiler_gnu +-- +--ac_ext=c +--ac_cpp='$CPP $CPPFLAGS' +--ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +--ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +--ac_compiler_gnu=$ac_cv_c_compiler_gnu +--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +--$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +--if ${am_cv_prog_cc_c_o+:} false; then : +-- $as_echo_n "(cached) " >&6 +--else +-- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +--/* end confdefs.h. */ +-- +--int +--main () +--{ +-- +-- ; +-- return 0; +--} +--_ACEOF +-- # Make sure it works both with $CC and with simple cc. +-- # Following AC_PROG_CC_C_O, we do the test twice because some +-- # compilers refuse to overwrite an existing .o file with -o, +-- # though they will create one. +-- am_cv_prog_cc_c_o=yes +-- for am_i in 1 2; do +-- if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 +-- ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 +-- ac_status=$? +-- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +-- (exit $ac_status); } \ +-- && test -f conftest2.$ac_objext; then +-- : OK +-- else +-- am_cv_prog_cc_c_o=no +-- break +-- fi +-- done +-- rm -f core conftest* +-- unset am_i +--fi +--{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +--$as_echo "$am_cv_prog_cc_c_o" >&6; } +--if test "$am_cv_prog_cc_c_o" != yes; then +-- # Losing compiler, so override with the script. +-- # FIXME: It is wrong to rewrite CC. +-- # But if we don't then we get into trouble of one sort or another. +-- # A longer-term fix would be to have automake use am__CC in this case, +-- # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" +-- CC="$am_aux_dir/compile $CC" +--fi +--ac_ext=c +--ac_cpp='$CPP $CPPFLAGS' +--ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +--ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +--ac_compiler_gnu=$ac_cv_c_compiler_gnu +-- +- DEPDIR="${am__leading_dot}deps" +- +- ac_config_commands="$ac_config_commands depfiles" +-@@ -3741,7 +3515,7 @@ am__quote= +- _am_result=none +- # First try GNU make style include. +- echo "include confinc" > confmf +--# Ignore all kinds of additional output from 'make'. +-+# Ignore all kinds of additional output from `make'. +- case `$am_make -s -f confmf 2> /dev/null` in #( +- *the\ am__doit\ target*) +- am__include=include +-@@ -3797,8 +3571,8 @@ else +- # We make a subdir and do the tests there. Otherwise we can end up +- # making bogus files that we don't know about and never remove. For +- # instance it was reported that on HP-UX the gcc test will end up +-- # making a dummy file named 'D' -- because '-MD' means "put the output +-- # in D". +-+ # making a dummy file named `D' -- because `-MD' means `put the output +-+ # in D'. +- rm -rf conftest.dir +- mkdir conftest.dir +- # Copy depcomp to subdir because otherwise we won't find it if we're +-@@ -3833,16 +3607,16 @@ else +- : > sub/conftest.c +- for i in 1 2 3 4 5 6; do +- echo '#include "conftst'$i'.h"' >> sub/conftest.c +-- # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with +-- # Solaris 10 /bin/sh. +-- echo '/* dummy */' > sub/conftst$i.h +-+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with +-+ # Solaris 8's {/usr,}/bin/sh. +-+ touch sub/conftst$i.h +- done +- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf +- +-- # We check with '-c' and '-o' for the sake of the "dashmstdout" +-+ # We check with `-c' and `-o' for the sake of the "dashmstdout" +- # mode. It turns out that the SunPro C++ compiler does not properly +-- # handle '-M -o', and we need to detect this. Also, some Intel +-- # versions had trouble with output in subdirs. +-+ # handle `-M -o', and we need to detect this. Also, some Intel +-+ # versions had trouble with output in subdirs +- am__obj=sub/conftest.${OBJEXT-o} +- am__minus_obj="-o $am__obj" +- case $depmode in +-@@ -3851,8 +3625,8 @@ else +- test "$am__universal" = false || continue +- ;; +- nosideeffect) +-- # After this tag, mechanisms are not by side-effect, so they'll +-- # only be used when explicitly requested. +-+ # after this tag, mechanisms are not by side-effect, so they'll +-+ # only be used when explicitly requested +- if test "x$enable_dependency_tracking" = xyes; then +- continue +- else +-@@ -3860,7 +3634,7 @@ else +- fi +- ;; +- msvc7 | msvc7msys | msvisualcpp | msvcmsys) +-- # This compiler won't grok '-c -o', but also, the minuso test has +-+ # This compiler won't grok `-c -o', but also, the minuso test has +- # not run yet. These depmodes are late enough in the game, and +- # so weak that their functioning should not be impacted. +- am__obj=conftest.${OBJEXT-o} +-@@ -3914,6 +3688,131 @@ else +- fi +- +- +-+if test "x$CC" != xcc; then +-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 +-+$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } +-+else +-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 +-+$as_echo_n "checking whether cc understands -c and -o together... " >&6; } +-+fi +-+set dummy $CC; ac_cc=`$as_echo "$2" | +-+ sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +-+if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then : +-+ $as_echo_n "(cached) " >&6 +-+else +-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-+/* end confdefs.h. */ +-+ +-+int +-+main () +-+{ +-+ +-+ ; +-+ return 0; +-+} +-+_ACEOF +-+# Make sure it works both with $CC and with simple cc. +-+# We do the test twice because some compilers refuse to overwrite an +-+# existing .o file with -o, though they will create one. +-+ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' +-+rm -f conftest2.* +-+if { { case "(($ac_try" in +-+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; +-+ *) ac_try_echo=$ac_try;; +-+esac +-+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +-+$as_echo "$ac_try_echo"; } >&5 +-+ (eval "$ac_try") 2>&5 +-+ ac_status=$? +-+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 +-+ test $ac_status = 0; } && +-+ test -f conftest2.$ac_objext && { { case "(($ac_try" in +-+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; +-+ *) ac_try_echo=$ac_try;; +-+esac +-+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +-+$as_echo "$ac_try_echo"; } >&5 +-+ (eval "$ac_try") 2>&5 +-+ ac_status=$? +-+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 +-+ test $ac_status = 0; }; +-+then +-+ eval ac_cv_prog_cc_${ac_cc}_c_o=yes +-+ if test "x$CC" != xcc; then +-+ # Test first that cc exists at all. +-+ if { ac_try='cc -c conftest.$ac_ext >&5' +-+ { { case "(($ac_try" in +-+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; +-+ *) ac_try_echo=$ac_try;; +-+esac +-+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +-+$as_echo "$ac_try_echo"; } >&5 +-+ (eval "$ac_try") 2>&5 +-+ ac_status=$? +-+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 +-+ test $ac_status = 0; }; }; then +-+ ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' +-+ rm -f conftest2.* +-+ if { { case "(($ac_try" in +-+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; +-+ *) ac_try_echo=$ac_try;; +-+esac +-+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +-+$as_echo "$ac_try_echo"; } >&5 +-+ (eval "$ac_try") 2>&5 +-+ ac_status=$? +-+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 +-+ test $ac_status = 0; } && +-+ test -f conftest2.$ac_objext && { { case "(($ac_try" in +-+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; +-+ *) ac_try_echo=$ac_try;; +-+esac +-+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +-+$as_echo "$ac_try_echo"; } >&5 +-+ (eval "$ac_try") 2>&5 +-+ ac_status=$? +-+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 +-+ test $ac_status = 0; }; +-+ then +-+ # cc works too. +-+ : +-+ else +-+ # cc exists but doesn't like -o. +-+ eval ac_cv_prog_cc_${ac_cc}_c_o=no +-+ fi +-+ fi +-+ fi +-+else +-+ eval ac_cv_prog_cc_${ac_cc}_c_o=no +-+fi +-+rm -f core conftest* +-+ +-+fi +-+if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then +-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-+$as_echo "yes" >&6; } +-+else +-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-+$as_echo "no" >&6; } +-+ +-+$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h +-+ +-+fi +-+ +-+# FIXME: we rely on the cache variable name because +-+# there is no other way. +-+set dummy $CC +-+am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +-+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +-+if test "$am_t" != yes; then +-+ # Losing compiler, so override with the script. +-+ # FIXME: It is wrong to rewrite CC. +-+ # But if we don't then we get into trouble of one sort or another. +-+ # A longer-term fix would be to have automake use am__CC in this case, +-+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" +-+ CC="$am_aux_dir/compile $CC" +-+fi +-+ +- +- +- if test -n "$ac_tool_prefix"; then +-@@ -3935,7 +3834,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_AR="$ac_tool_prefix$ac_prog" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -3979,7 +3878,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_ac_ct_AR="$ac_prog" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -4023,13 +3922,7 @@ $as_echo_n "checking the archiver ($AR) +- if ${am_cv_ar_interface+:} false; then : +- $as_echo_n "(cached) " >&6 +- else +-- ac_ext=c +--ac_cpp='$CPP $CPPFLAGS' +--ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +--ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +--ac_compiler_gnu=$ac_cv_c_compiler_gnu +-- +-- am_cv_ar_interface=ar +-+ am_cv_ar_interface=ar +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +- /* end confdefs.h. */ +- int some_variable = 0; +-@@ -4060,11 +3953,6 @@ if ac_fn_c_try_compile "$LINENO"; then : +- +- fi +- rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +-- ac_ext=c +--ac_cpp='$CPP $CPPFLAGS' +--ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +--ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +--ac_compiler_gnu=$ac_cv_c_compiler_gnu +- +- fi +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 +-@@ -4126,8 +4014,8 @@ esac +- +- +- +--macro_version='2.4.2' +--macro_revision='1.3337' +-+macro_version='2.4' +-+macro_revision='1.3293' +- +- +- +-@@ -4305,7 +4193,7 @@ do +- for ac_prog in sed gsed; do +- for ac_exec_ext in '' $ac_executable_extensions; do +- ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" +-- as_fn_executable_p "$ac_path_SED" || continue +-+ { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue +- # Check for GNU ac_path_SED and select it if it is found. +- # Check for GNU $ac_path_SED +- case `"$ac_path_SED" --version 2>&1` in +-@@ -4381,7 +4269,7 @@ do +- for ac_prog in grep ggrep; do +- for ac_exec_ext in '' $ac_executable_extensions; do +- ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" +-- as_fn_executable_p "$ac_path_GREP" || continue +-+ { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +- # Check for GNU ac_path_GREP and select it if it is found. +- # Check for GNU $ac_path_GREP +- case `"$ac_path_GREP" --version 2>&1` in +-@@ -4447,7 +4335,7 @@ do +- for ac_prog in egrep; do +- for ac_exec_ext in '' $ac_executable_extensions; do +- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" +-- as_fn_executable_p "$ac_path_EGREP" || continue +-+ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +- # Check for GNU ac_path_EGREP and select it if it is found. +- # Check for GNU $ac_path_EGREP +- case `"$ac_path_EGREP" --version 2>&1` in +-@@ -4514,7 +4402,7 @@ do +- for ac_prog in fgrep; do +- for ac_exec_ext in '' $ac_executable_extensions; do +- ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" +-- as_fn_executable_p "$ac_path_FGREP" || continue +-+ { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue +- # Check for GNU ac_path_FGREP and select it if it is found. +- # Check for GNU $ac_path_FGREP +- case `"$ac_path_FGREP" --version 2>&1` in +-@@ -4770,7 +4658,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -4814,7 +4702,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -4972,11 +4860,6 @@ else +- lt_cv_sys_max_cmd_len=196608 +- ;; +- +-- os2*) +-- # The test takes a long time on OS/2. +-- lt_cv_sys_max_cmd_len=8192 +-- ;; +-- +- osf*) +- # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure +- # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not +-@@ -5016,7 +4899,7 @@ else +- # If test is not a shell built-in, we'll probably end up computing a +- # maximum length that is only half of the actual maximum length, but +- # we can't tell. +-- while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ +-+ while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ +- = "X$teststring$teststring"; } >/dev/null 2>&1 && +- test $i != 17 # 1/2 MB should be enough +- do +-@@ -5238,7 +5121,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -5278,7 +5161,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_ac_ct_OBJDUMP="objdump" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -5445,7 +5328,7 @@ irix5* | irix6* | nonstopux*) +- lt_cv_deplibs_check_method=pass_all +- ;; +- +--# This must be glibc/ELF. +-+# This must be Linux ELF. +- linux* | k*bsd*-gnu | kopensolaris*-gnu) +- lt_cv_deplibs_check_method=pass_all +- ;; +-@@ -5584,7 +5467,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -5624,7 +5507,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_ac_ct_DLLTOOL="dlltool" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -5727,7 +5610,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_AR="$ac_tool_prefix$ac_prog" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -5771,7 +5654,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_ac_ct_AR="$ac_prog" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -5896,7 +5779,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_STRIP="${ac_tool_prefix}strip" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -5936,7 +5819,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_ac_ct_STRIP="strip" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -5995,7 +5878,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -6035,7 +5918,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_ac_ct_RANLIB="ranlib" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -6085,13 +5968,13 @@ old_postuninstall_cmds= +- if test -n "$RANLIB"; then +- case $host_os in +- openbsd*) +-- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" +-+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" +- ;; +- *) +-- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" +-+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" +- ;; +- esac +-- old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +-+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +- fi +- +- case $host_os in +-@@ -6238,7 +6121,6 @@ for ac_symprfx in "" "_"; do +- # which start with @ or ?. +- lt_cv_sys_global_symbol_pipe="$AWK '"\ +- " {last_section=section; section=\$ 3};"\ +--" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +- " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +- " \$ 0!~/External *\|/{next};"\ +- " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +-@@ -6627,7 +6509,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; } +- CFLAGS="$SAVE_CFLAGS" +- fi +- ;; +--*-*solaris*) +-+sparc*-*solaris*) +- # Find out which ABI we are using. +- echo 'int i;' > conftest.$ac_ext +- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 +-@@ -6638,20 +6520,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; } +- case `/usr/bin/file conftest.o` in +- *64-bit*) +- case $lt_cv_prog_gnu_ld in +-- yes*) +-- case $host in +-- i?86-*-solaris*) +-- LD="${LD-ld} -m elf_x86_64" +-- ;; +-- sparc*-*-solaris*) +-- LD="${LD-ld} -m elf64_sparc" +-- ;; +-- esac +-- # GNU ld 2.21 introduced _sol2 emulations. Use them if available. +-- if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then +-- LD="${LD-ld}_sol2" +-- fi +-- ;; +-+ yes*) LD="${LD-ld} -m elf64_sparc" ;; +- *) +- if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then +- LD="${LD-ld} -64" +-@@ -6684,7 +6553,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -6724,7 +6593,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -6804,7 +6673,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -6844,7 +6713,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -6896,7 +6765,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -6936,7 +6805,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_ac_ct_NMEDIT="nmedit" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -6988,7 +6857,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_LIPO="${ac_tool_prefix}lipo" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -7028,7 +6897,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_ac_ct_LIPO="lipo" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -7080,7 +6949,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_OTOOL="${ac_tool_prefix}otool" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -7120,7 +6989,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_ac_ct_OTOOL="otool" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -7172,7 +7041,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -7212,7 +7081,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_ac_ct_OTOOL64="otool64" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -7291,13 +7160,7 @@ else +- $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +- -dynamiclib -Wl,-single_module conftest.c 2>conftest.err +- _lt_result=$? +-- # If there is a non-empty error log, and "single_module" +-- # appears in it, assume the flag caused a linker warning +-- if test -s conftest.err && $GREP single_module conftest.err; then +-- cat conftest.err >&5 +-- # Otherwise, if the output was created with a 0 exit code from +-- # the compiler, it worked. +-- elif test -f libconftest.dylib && test $_lt_result -eq 0; then +-+ if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then +- lt_cv_apple_cc_single_mod=yes +- else +- cat conftest.err >&5 +-@@ -7308,7 +7171,6 @@ else +- fi +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +- $as_echo "$lt_cv_apple_cc_single_mod" >&6; } +-- +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +- $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +- if ${lt_cv_ld_exported_symbols_list+:} false; then : +-@@ -7341,7 +7203,6 @@ rm -f core conftest.err conftest.$ac_obj +- fi +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +- $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } +-- +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +- $as_echo_n "checking for -force_load linker flag... " >&6; } +- if ${lt_cv_ld_force_load+:} false; then : +-@@ -7363,9 +7224,7 @@ _LT_EOF +- echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 +- $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err +- _lt_result=$? +-- if test -s conftest.err && $GREP force_load conftest.err; then +-- cat conftest.err >&5 +-- elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then +-+ if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then +- lt_cv_ld_force_load=yes +- else +- cat conftest.err >&5 +-@@ -7740,22 +7599,7 @@ fi +- +- # Check whether --with-pic was given. +- if test "${with_pic+set}" = set; then : +-- withval=$with_pic; lt_p=${PACKAGE-default} +-- case $withval in +-- yes|no) pic_mode=$withval ;; +-- *) +-- pic_mode=default +-- # Look at the argument we got. We use all the common list separators. +-- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," +-- for lt_pkg in $withval; do +-- IFS="$lt_save_ifs" +-- if test "X$lt_pkg" = "X$lt_p"; then +-- pic_mode=yes +-- fi +-- done +-- IFS="$lt_save_ifs" +-- ;; +-- esac +-+ withval=$with_pic; pic_mode="$withval" +- else +- pic_mode=default +- fi +-@@ -7833,10 +7677,6 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtoo +- +- +- +-- +-- +-- +-- +- test -z "$LN_S" && LN_S="ln -s" +- +- +-@@ -8126,10 +7966,6 @@ _lt_linker_boilerplate=`cat conftest.err +- $RM -r conftest* +- +- +--## CAVEAT EMPTOR: +--## There is no encapsulation within the following macros, do not change +--## the running order or otherwise move them around unless you know exactly +--## what you are doing... +- if test -n "$compiler"; then +- +- lt_prog_compiler_no_builtin_flag= +-@@ -8296,9 +8132,7 @@ lt_prog_compiler_static= +- case $cc_basename in +- nvcc*) # Cuda Compiler Driver 2.2 +- lt_prog_compiler_wl='-Xlinker ' +-- if test -n "$lt_prog_compiler_pic"; then +-- lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" +-- fi +-+ lt_prog_compiler_pic='-Xcompiler -fPIC' +- ;; +- esac +- else +-@@ -8389,33 +8223,18 @@ lt_prog_compiler_static= +- ;; +- *) +- case `$CC -V 2>&1 | sed 5q` in +-- *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) +-+ *Sun\ F* | *Sun*Fortran*) +- # Sun Fortran 8.3 passes all unrecognized flags to the linker +- lt_prog_compiler_pic='-KPIC' +- lt_prog_compiler_static='-Bstatic' +- lt_prog_compiler_wl='' +- ;; +-- *Sun\ F* | *Sun*Fortran*) +-- lt_prog_compiler_pic='-KPIC' +-- lt_prog_compiler_static='-Bstatic' +-- lt_prog_compiler_wl='-Qoption ld ' +-- ;; +- *Sun\ C*) +- # Sun C 5.9 +- lt_prog_compiler_pic='-KPIC' +- lt_prog_compiler_static='-Bstatic' +- lt_prog_compiler_wl='-Wl,' +- ;; +-- *Intel*\ [CF]*Compiler*) +-- lt_prog_compiler_wl='-Wl,' +-- lt_prog_compiler_pic='-fPIC' +-- lt_prog_compiler_static='-static' +-- ;; +-- *Portland\ Group*) +-- lt_prog_compiler_wl='-Wl,' +-- lt_prog_compiler_pic='-fpic' +-- lt_prog_compiler_static='-Bstatic' +-- ;; +- esac +- ;; +- esac +-@@ -8777,6 +8596,7 @@ $as_echo_n "checking whether the $compil +- hardcode_direct=no +- hardcode_direct_absolute=no +- hardcode_libdir_flag_spec= +-+ hardcode_libdir_flag_spec_ld= +- hardcode_libdir_separator= +- hardcode_minus_L=no +- hardcode_shlibpath_var=unsupported +-@@ -9026,7 +8846,8 @@ _LT_EOF +- xlf* | bgf* | bgxlf* | mpixlf*) +- # IBM XL Fortran 10.1 on PPC cannot create shared libs itself +- whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' +-- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' +-+ hardcode_libdir_flag_spec= +-+ hardcode_libdir_flag_spec_ld='-rpath $libdir' +- archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' +- if test "x$supports_anon_versioning" = xyes; then +- archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ +-@@ -9405,7 +9226,6 @@ fi +- # The linker will not automatically build a static lib if we build a DLL. +- # _LT_TAGVAR(old_archive_from_new_cmds, )='true' +- enable_shared_with_static_runtimes=yes +-- exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' +- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' +- # Don't use ranlib +- old_postinstall_cmds='chmod 644 $oldlib' +-@@ -9451,7 +9271,6 @@ fi +- hardcode_shlibpath_var=unsupported +- if test "$lt_cv_ld_force_load" = "yes"; then +- whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' +-- +- else +- whole_archive_flag_spec='' +- fi +-@@ -9480,6 +9299,10 @@ fi +- hardcode_shlibpath_var=no +- ;; +- +-+ freebsd1*) +-+ ld_shlibs=no +-+ ;; +-+ +- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor +- # support. Future versions do this automatically, but an explicit c++rt0.o +- # does not break anything, and helps significantly (at the cost of a little +-@@ -9492,7 +9315,7 @@ fi +- ;; +- +- # Unfortunately, older versions of FreeBSD 2 do not have this feature. +-- freebsd2.*) +-+ freebsd2*) +- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' +- hardcode_direct=yes +- hardcode_minus_L=yes +-@@ -9531,6 +9354,7 @@ fi +- fi +- if test "$with_gnu_ld" = no; then +- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' +-+ hardcode_libdir_flag_spec_ld='+b $libdir' +- hardcode_libdir_separator=: +- hardcode_direct=yes +- hardcode_direct_absolute=yes +-@@ -10154,6 +9978,11 @@ esac +- +- +- +-+ +-+ +-+ +-+ +-+ +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +- $as_echo_n "checking dynamic linker characteristics... " >&6; } +- +-@@ -10243,7 +10072,7 @@ need_version=unknown +- +- case $host_os in +- aix3*) +-- version_type=linux # correct to gnu/linux during the next big refactor +-+ version_type=linux +- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' +- shlibpath_var=LIBPATH +- +-@@ -10252,7 +10081,7 @@ aix3*) +- ;; +- +- aix[4-9]*) +-- version_type=linux # correct to gnu/linux during the next big refactor +-+ version_type=linux +- need_lib_prefix=no +- need_version=no +- hardcode_into_libs=yes +-@@ -10317,7 +10146,7 @@ beos*) +- ;; +- +- bsdi[45]*) +-- version_type=linux # correct to gnu/linux during the next big refactor +-+ version_type=linux +- need_version=no +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +-@@ -10456,7 +10285,7 @@ darwin* | rhapsody*) +- ;; +- +- dgux*) +-- version_type=linux # correct to gnu/linux during the next big refactor +-+ version_type=linux +- need_lib_prefix=no +- need_version=no +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' +-@@ -10464,6 +10293,10 @@ dgux*) +- shlibpath_var=LD_LIBRARY_PATH +- ;; +- +-+freebsd1*) +-+ dynamic_linker=no +-+ ;; +-+ +- freebsd* | dragonfly*) +- # DragonFly does not have aout. When/if they implement a new +- # versioning mechanism, adjust this. +-@@ -10471,7 +10304,7 @@ freebsd* | dragonfly*) +- objformat=`/usr/bin/objformat` +- else +- case $host_os in +-- freebsd[23].*) objformat=aout ;; +-+ freebsd[123]*) objformat=aout ;; +- *) objformat=elf ;; +- esac +- fi +-@@ -10489,7 +10322,7 @@ freebsd* | dragonfly*) +- esac +- shlibpath_var=LD_LIBRARY_PATH +- case $host_os in +-- freebsd2.*) +-+ freebsd2*) +- shlibpath_overrides_runpath=yes +- ;; +- freebsd3.[01]* | freebsdelf3.[01]*) +-@@ -10509,18 +10342,17 @@ freebsd* | dragonfly*) +- ;; +- +- gnu*) +-- version_type=linux # correct to gnu/linux during the next big refactor +-+ version_type=linux +- need_lib_prefix=no +- need_version=no +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- shlibpath_var=LD_LIBRARY_PATH +-- shlibpath_overrides_runpath=no +- hardcode_into_libs=yes +- ;; +- +- haiku*) +-- version_type=linux # correct to gnu/linux during the next big refactor +-+ version_type=linux +- need_lib_prefix=no +- need_version=no +- dynamic_linker="$host_os runtime_loader" +-@@ -10581,7 +10413,7 @@ hpux9* | hpux10* | hpux11*) +- ;; +- +- interix[3-9]*) +-- version_type=linux # correct to gnu/linux during the next big refactor +-+ version_type=linux +- need_lib_prefix=no +- need_version=no +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' +-@@ -10597,7 +10429,7 @@ irix5* | irix6* | nonstopux*) +- nonstopux*) version_type=nonstopux ;; +- *) +- if test "$lt_cv_prog_gnu_ld" = yes; then +-- version_type=linux # correct to gnu/linux during the next big refactor +-+ version_type=linux +- else +- version_type=irix +- fi ;; +-@@ -10634,9 +10466,9 @@ linux*oldld* | linux*aout* | linux*coff* +- dynamic_linker=no +- ;; +- +--# This must be glibc/ELF. +-+# This must be Linux ELF. +- linux* | k*bsd*-gnu | kopensolaris*-gnu) +-- version_type=linux # correct to gnu/linux during the next big refactor +-+ version_type=linux +- need_lib_prefix=no +- need_version=no +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +-@@ -10718,7 +10550,7 @@ netbsd*) +- ;; +- +- newsos6) +-- version_type=linux # correct to gnu/linux during the next big refactor +-+ version_type=linux +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=yes +-@@ -10787,7 +10619,7 @@ rdos*) +- ;; +- +- solaris*) +-- version_type=linux # correct to gnu/linux during the next big refactor +-+ version_type=linux +- need_lib_prefix=no +- need_version=no +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +-@@ -10812,7 +10644,7 @@ sunos4*) +- ;; +- +- sysv4 | sysv4.3*) +-- version_type=linux # correct to gnu/linux during the next big refactor +-+ version_type=linux +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- shlibpath_var=LD_LIBRARY_PATH +-@@ -10836,7 +10668,7 @@ sysv4 | sysv4.3*) +- +- sysv4*MP*) +- if test -d /usr/nec ;then +-- version_type=linux # correct to gnu/linux during the next big refactor +-+ version_type=linux +- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' +- soname_spec='$libname${shared_ext}.$major' +- shlibpath_var=LD_LIBRARY_PATH +-@@ -10867,7 +10699,7 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* +- +- tpf*) +- # TPF is a cross-target only. Preferred cross-host = GNU/Linux. +-- version_type=linux # correct to gnu/linux during the next big refactor +-+ version_type=linux +- need_lib_prefix=no +- need_version=no +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +-@@ -10877,7 +10709,7 @@ tpf*) +- ;; +- +- uts4*) +-- version_type=linux # correct to gnu/linux during the next big refactor +-+ version_type=linux +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- shlibpath_var=LD_LIBRARY_PATH +-@@ -11659,8 +11491,6 @@ CC="$lt_save_CC" +- +- +- +-- +-- +- ac_config_commands="$ac_config_commands libtool" +- +- +-@@ -11726,7 +11556,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -11769,7 +11599,7 @@ do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +-- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +-@@ -11932,7 +11762,7 @@ regular_CFLAGS="-Wall -Waggregate-return +- if test -n "$kbuilddir"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking kernel version that we will build against" >&5 +- $as_echo_n "checking kernel version that we will build against... " >&6; } +-- krel="$(make -sC "$kbuilddir" M=$PWD kernelrelease)"; +-+ krel="$(make -sC "$kbuilddir" M=$PWD kernelversion)"; +- kmajor="${krel%%[^0-9]*}"; +- kmajor="$(($kmajor+0))"; +- krel="${krel:${#kmajor}}"; +-@@ -12076,14 +11906,6 @@ LIBOBJS=$ac_libobjs +- LTLIBOBJS=$ac_ltlibobjs +- +- +--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +--$as_echo_n "checking that generated files are newer than configure... " >&6; } +-- if test -n "$am_sleep_pid"; then +-- # Hide warnings about reused PIDs. +-- wait $am_sleep_pid 2>/dev/null +-- fi +-- { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +--$as_echo "done" >&6; } +- if test -n "$EXEEXT"; then +- am__EXEEXT_TRUE= +- am__EXEEXT_FALSE='#' +-@@ -12398,16 +12220,16 @@ if (echo >conf$$.file) 2>/dev/null; then +- # ... but there are two gotchas: +- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. +- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. +-- # In both cases, we have to default to `cp -pR'. +-+ # In both cases, we have to default to `cp -p'. +- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || +-- as_ln_s='cp -pR' +-+ as_ln_s='cp -p' +- elif ln conf$$.file conf$$ 2>/dev/null; then +- as_ln_s=ln +- else +-- as_ln_s='cp -pR' +-+ as_ln_s='cp -p' +- fi +- else +-- as_ln_s='cp -pR' +-+ as_ln_s='cp -p' +- fi +- rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +- rmdir conf$$.dir 2>/dev/null +-@@ -12467,16 +12289,28 @@ else +- as_mkdir_p=false +- fi +- +-- +--# as_fn_executable_p FILE +--# ----------------------- +--# Test if FILE is an executable regular file. +--as_fn_executable_p () +--{ +-- test -f "$1" && test -x "$1" +--} # as_fn_executable_p +--as_test_x='test -x' +--as_executable_p=as_fn_executable_p +-+if test -x / >/dev/null 2>&1; then +-+ as_test_x='test -x' +-+else +-+ if ls -dL / >/dev/null 2>&1; then +-+ as_ls_L_option=L +-+ else +-+ as_ls_L_option= +-+ fi +-+ as_test_x=' +-+ eval sh -c '\'' +-+ if test -d "$1"; then +-+ test -d "$1/."; +-+ else +-+ case $1 in #( +-+ -*)set "./$1";; +-+ esac; +-+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( +-+ ???[sx]*):;;*)false;;esac;fi +-+ '\'' sh +-+ ' +-+fi +-+as_executable_p=$as_test_x +- +- # Sed expression to map a string onto a valid CPP name. +- as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +-@@ -12498,7 +12332,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri +- # values after options handling. +- ac_log=" +- This file was extended by xtables-addons $as_me 2.5, which was +--generated by GNU Autoconf 2.69. Invocation command line was +-+generated by GNU Autoconf 2.68. Invocation command line was +- +- CONFIG_FILES = $CONFIG_FILES +- CONFIG_HEADERS = $CONFIG_HEADERS +-@@ -12564,10 +12398,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_writ +- ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +- ac_cs_version="\\ +- xtables-addons config.status 2.5 +--configured by $0, generated by GNU Autoconf 2.69, +-+configured by $0, generated by GNU Autoconf 2.68, +- with options \\"\$ac_cs_config\\" +- +--Copyright (C) 2012 Free Software Foundation, Inc. +-+Copyright (C) 2010 Free Software Foundation, Inc. +- This config.status script is free software; the Free Software Foundation +- gives unlimited permission to copy, distribute and modify it." +- +-@@ -12658,7 +12492,7 @@ fi +- _ACEOF +- cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +- if \$ac_cs_recheck; then +-- set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +-+ set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +- shift +- \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 +- CONFIG_SHELL='$SHELL' +-@@ -12700,7 +12534,6 @@ pic_mode='`$ECHO "$pic_mode" | $SED "$de +- enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +- SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +- ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +--PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' +- host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +- host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +- host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +-@@ -12783,6 +12616,7 @@ with_gnu_ld='`$ECHO "$with_gnu_ld" | $SE +- allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +- no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +- hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +-+hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' +- hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +- hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +- hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +-@@ -12838,7 +12672,6 @@ _LTECHO_EOF' +- # Quote evaled strings. +- for var in SHELL \ +- ECHO \ +--PATH_SEPARATOR \ +- SED \ +- GREP \ +- EGREP \ +-@@ -12889,6 +12722,7 @@ with_gnu_ld \ +- allow_undefined_flag \ +- no_undefined_flag \ +- hardcode_libdir_flag_spec \ +-+hardcode_libdir_flag_spec_ld \ +- hardcode_libdir_separator \ +- exclude_expsyms \ +- include_expsyms \ +-@@ -13575,7 +13409,7 @@ $as_echo "$as_me: executing $ac_file com +- +- case $ac_file$ac_mode in +- "depfiles":C) test x"$AMDEP_TRUE" != x"" || { +-- # Older Autoconf quotes --file arguments for eval, but not when files +-+ # Autoconf 2.62 quotes --file arguments for eval, but not when files +- # are listed without --file. Let's play safe and only enable the eval +- # if we detect the quoting. +- case $CONFIG_FILES in +-@@ -13588,7 +13422,7 @@ $as_echo "$as_me: executing $ac_file com +- # Strip MF so we end up with the name of the file. +- mf=`echo "$mf" | sed -e 's/:.*$//'` +- # Check whether this is an Automake generated Makefile or not. +-- # We used to match only the files named 'Makefile.in', but +-+ # We used to match only the files named `Makefile.in', but +- # some people rename them; so instead we look at the file content. +- # Grep'ing the first line is not enough: some people post-process +- # each Makefile.in and add a new line on top of each file to say so. +-@@ -13622,19 +13456,21 @@ $as_echo X"$mf" | +- continue +- fi +- # Extract the definition of DEPDIR, am__include, and am__quote +-- # from the Makefile without running 'make'. +-+ # from the Makefile without running `make'. +- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` +- test -z "$DEPDIR" && continue +- am__include=`sed -n 's/^am__include = //p' < "$mf"` +-- test -z "$am__include" && continue +-+ test -z "am__include" && continue +- am__quote=`sed -n 's/^am__quote = //p' < "$mf"` +-+ # When using ansi2knr, U may be empty or an underscore; expand it +-+ U=`sed -n 's/^U = //p' < "$mf"` +- # Find all dependency output files, they are included files with +- # $(DEPDIR) in their names. We invoke sed twice because it is the +- # simplest approach to changing $(DEPDIR) to its actual value in the +- # expansion. +- for file in `sed -n " +- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ +-- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do +-+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do +- # Make sure the directory exists. +- test -f "$dirpart/$file" && continue +- fdir=`$as_dirname -- "$file" || +-@@ -13688,8 +13524,8 @@ $as_echo X"$file" | +- # NOTE: Changes made to this file will be lost: look at ltmain.sh. +- # +- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +--# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +--# Foundation, Inc. +-+# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +-+# Inc. +- # Written by Gordon Matzigkeit, 1996 +- # +- # This file is part of GNU Libtool. +-@@ -13743,9 +13579,6 @@ SHELL=$lt_SHELL +- # An echo program that protects backslashes. +- ECHO=$lt_ECHO +- +--# The PATH separator for the build system. +--PATH_SEPARATOR=$lt_PATH_SEPARATOR +-- +- # The host system. +- host_alias=$host_alias +- host=$host +-@@ -14047,6 +13880,10 @@ no_undefined_flag=$lt_no_undefined_flag +- # This must work even if \$libdir does not exist +- hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec +- +-+# If ld is used when linking, flag to hardcode \$libdir into a binary +-+# during linking. This must work even if \$libdir does not exist. +-+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld +-+ +- # Whether we need a single "-rpath" flag with a separated argument. +- hardcode_libdir_separator=$lt_hardcode_libdir_separator +- + --- a/configure.ac + +++ b/configure.ac +-@@ -44,7 +44,7 @@ regular_CFLAGS="-Wall -Waggregate-return ++@@ -44,7 +44,7 @@ regular_CFLAGS="-Wall -Waggregate-return -Wmissing-declarations \ + + if test -n "$kbuilddir"; then + AC_MSG_CHECKING([kernel version that we will build against]) +-- krel="$(make -sC "$kbuilddir" M=$PWD kernelrelease)"; +-+ krel="$(make -sC "$kbuilddir" M=$PWD kernelversion)"; +- kmajor="${krel%%[[^0-9]]*}"; +- kmajor="$(($kmajor+0))"; +- krel="${krel:${#kmajor}}"; ++- krel="$(make -sC "$kbuilddir" M=$PWD kernelrelease | $AWK -v 'FS=[[^0-9.]]' '{print $1; exit}')"; +++ krel="$(make -sC "$kbuilddir" M=$PWD kernelversion | $AWK -v 'FS=[[^0-9.]]' '{print $1; exit}')"; ++ save_IFS=$IFS; ++ IFS='.'; ++ set x $krel; From 5bfb06fe36348305e91cdf975c0d9d97d8cd14a2 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 7 Apr 2016 18:08:43 +0200 Subject: [PATCH 368/867] ar71xx-generic: add support for UBNT Rocket M XW (untested) --- targets/ar71xx-generic/profiles.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index c1ff0912..ce8d3f25 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -183,6 +183,7 @@ $(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-rocket-m-xw,ubiquiti-rocket-m-xw)) # BROKEN: Untested endif From 271e864005be79f68e30a7fc10beb6725ccf3699 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Fri, 8 Apr 2016 14:17:45 +0200 Subject: [PATCH 369/867] docs/user/site.rst: typo --- 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 ed4706ee..146e991f 100644 --- a/docs/user/site.rst +++ b/docs/user/site.rst @@ -44,7 +44,7 @@ ntp_server List of NTP servers available in your community or used by your community, e.g.: :: - ntp_servers = {'1.ntp.services.ffeh','2.tnp.services.ffeh'} + ntp_servers = {'1.ntp.services.ffeh','2.ntp.services.ffeh'} opkg : optional ``opkg`` package manager configuration. From 80515c087d7e2311a4c090d8d6fc606096a5450c Mon Sep 17 00:00:00 2001 From: corvusmo Date: Fri, 8 Apr 2016 21:23:56 +0200 Subject: [PATCH 370/867] gluon-status-page: sort gateways alphabetically Fixes #698 --- .../src/js/lib/gui/statistics.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 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 af984e6e..59a7c560 100644 --- a/package/gluon-status-page/src/js/lib/gui/statistics.js +++ b/package/gluon-status-page/src/js/lib/gui/statistics.js @@ -22,18 +22,27 @@ define(["lib/helper"], function (Helper) { return el } - function mkRow(table, label, stream) { - var tr = document.createElement("tr") + function mkRow(table, label, stream, sorted) { + + var i = -1 + + if (sorted) { + for (i = 0; i < table.rows.length; i++) { + if (label < table.rows[i].firstChild.textContent) + break + } + } + + var tr = table.insertRow(i) var th = document.createElement("th") var td = streamElement("td", stream) th.textContent = label tr.appendChild(th) tr.appendChild(td) - table.appendChild(tr) tr.destroy = function () { td.destroy() - table.removeChild(tr) + table.tBodies[0].removeChild(tr) } return tr @@ -127,7 +136,7 @@ define(["lib/helper"], function (Helper) { stream.startWith(d) .map(peer.path) .filter(function (d) { return d !== undefined }) - .map(prettyPeer)) + .map(prettyPeer), true) }) } }) From 9260a8fa154b6bba559f0e46bf5597cbfaad7928 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 19 Apr 2016 05:54:19 +0200 Subject: [PATCH 371/867] docs: add info about IPv6 and DNS requirements for NTP/autoupdater --- docs/user/faq.rst | 14 ++++++++++++++ docs/user/site.rst | 6 ++++++ 2 files changed, 20 insertions(+) diff --git a/docs/user/faq.rst b/docs/user/faq.rst index 9da15270..f2e694e4 100644 --- a/docs/user/faq.rst +++ b/docs/user/faq.rst @@ -1,3 +1,17 @@ Frequently Asked Questions ========================== +.. _faq-dns: + +DNS does not work on the nodes +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Gluon nodes will ignore the DNS server on the WAN port for evenything except +the mesh VPN, which can lead to confusion. + +All normal services on the nodes exclusively use the DNS server on the mesh +interface. This DNS server must be announced in router advertisements (using +*radvd* or a similar software) from one or more central servers in meshes based +on *batman-adv*. If your mesh does not have global IPv6 connectivity, you can setup +your *radvd* not to announce a default route by setting the *default lifetime* to 0; +in this case, the *radvd* is only used to announce the DNS server. diff --git a/docs/user/site.rst b/docs/user/site.rst index 146e991f..b757644c 100644 --- a/docs/user/site.rst +++ b/docs/user/site.rst @@ -46,6 +46,9 @@ ntp_server ntp_servers = {'1.ntp.services.ffeh','2.ntp.services.ffeh'} + This NTP servers must be reachable via IPv6 from the nodes. If you don't want to set an IPv6 address + explicitly, but use a hostname (which is recommended), see also the :ref:`FAQ `. + opkg : optional ``opkg`` package manager configuration. @@ -249,6 +252,9 @@ autoupdater : package } } + All configured mirrors must be reachable from the nodes via IPv6. If you don't want to set an IPv6 address + explicitly, but use a hostname (which is recommended), see also the :ref:`FAQ `. + roles : optional Optional role definitions. Nodes will announce their role inside the mesh. This will allow in the backend to distinguish between normal, backbone and From fe1b887f491424a31f7247659d306e17893e7392 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 19 Apr 2016 05:56:18 +0200 Subject: [PATCH 372/867] docs: user/site: fix formatting of definition list Newer versions of Sphinx would break lines at the colons. --- docs/user/site.rst | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/user/site.rst b/docs/user/site.rst index b757644c..7f56150d 100644 --- a/docs/user/site.rst +++ b/docs/user/site.rst @@ -49,7 +49,7 @@ ntp_server This NTP servers must be reachable via IPv6 from the nodes. If you don't want to set an IPv6 address explicitly, but use a hostname (which is recommended), see also the :ref:`FAQ `. -opkg : optional +opkg \: optional ``opkg`` package manager configuration. There are two optional fields in the ``opkg`` section: @@ -75,7 +75,7 @@ opkg : optional - ``%GV`` is replaced by the Gluon version - ``%GR`` is replaced by the Gluon release (as specified in ``site.mk``) -regdom : optional +regdom \: optional The wireless regulatory domain responsible for your area, e.g.: :: @@ -83,7 +83,7 @@ regdom : optional Setting ``regdom`` in mandatory if ``wifi24`` or ``wifi5`` is defined. -wifi24 : optional +wifi24 \: optional WLAN configuration for 2.4 GHz devices. ``channel`` must be set to a valid wireless channel for your radio. @@ -126,10 +126,10 @@ wifi24 : optional }, }, -wifi5 : optional +wifi5 \: optional Same as `wifi24` but for the 5Ghz radio. -next_node : package +next_node \: package Configuration of the local node feature of Gluon :: @@ -139,7 +139,7 @@ next_node : package mac = 'ca:ff:ee:ba:be:00' } -mesh : optional +mesh \: optional Options specific to routing protocols. At the moment, only the ``batman_adv`` routing protocol has such options: @@ -223,13 +223,13 @@ fastd_mesh_vpn }, } -mesh_on_wan : optional +mesh_on_wan \: optional Enables the mesh on the WAN port (``true`` or ``false``). -mesh_on_lan : optional +mesh_on_lan \: optional Enables the mesh on the LAN port (``true`` or ``false``). -autoupdater : package +autoupdater \: package Configuration for the autoupdater feature of Gluon. :: @@ -255,7 +255,7 @@ autoupdater : package All configured mirrors must be reachable from the nodes via IPv6. If you don't want to set an IPv6 address explicitly, but use a hostname (which is recommended), see also the :ref:`FAQ `. -roles : optional +roles \: optional 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 @@ -279,7 +279,7 @@ roles : optional }, }, -setup_mode : package +setup_mode \: package Allows skipping setup mode (config mode) at first boot when attribute ``skip`` is set to ``true``. This is optional and may be left out. :: @@ -288,7 +288,7 @@ setup_mode : package skip = true, }, -legacy : package +legacy \: package Configuration for the legacy upgrade path. This is only required in communities upgrading from Lübeck's LFF-0.3.x. :: From ff95dd9650bde7bf31305e3e96423ae0d6d48d2d Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 22 Apr 2016 07:29:53 +0200 Subject: [PATCH 373/867] docs: user/faq: fix typo --- docs/user/faq.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user/faq.rst b/docs/user/faq.rst index f2e694e4..40a4e521 100644 --- a/docs/user/faq.rst +++ b/docs/user/faq.rst @@ -6,7 +6,7 @@ Frequently Asked Questions DNS does not work on the nodes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Gluon nodes will ignore the DNS server on the WAN port for evenything except +Gluon nodes will ignore the DNS server on the WAN port for everything except the mesh VPN, which can lead to confusion. All normal services on the nodes exclusively use the DNS server on the mesh From bdcd166c7cf5b7e5219597683efc7b8fa369f5b4 Mon Sep 17 00:00:00 2001 From: Jan Niehusmann Date: Wed, 20 Apr 2016 15:49:41 +0200 Subject: [PATCH 374/867] ar71xx-generic: add support for Carambola 2 Device information can be found at: http://www.8devices.com/products/carambola-2 https://wiki.openwrt.org/toh/8devices/carambola2 I only did some minimal testing of gluon on the carambola 2 development board: - Config mode works - Connects to Wifi Mesh - Allows clients to connect Notably, autoupgrade has not yet been tested. Change to 010-primary-mac is necessary as the mac address printed on the sticker is the one of eth0, not the wifi mac. --- docs/index.rst | 4 ++++ package/gluon-core/files/lib/gluon/upgrade/010-primary-mac | 2 +- targets/ar71xx-generic/profiles.mk | 7 +++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index 0af70fa0..07777460 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -78,6 +78,10 @@ Supported Devices & Architectures ar71xx-generic ^^^^^^^^^^^^^^ +* 8devices + + - Carambola 2 + * ALFA Network - AP121 diff --git a/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac b/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac index 25c13bac..a913db90 100755 --- a/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac +++ b/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac @@ -24,7 +24,7 @@ end if platform.match('ar71xx', 'generic', {'tl-wdr3600', 'tl-wdr4300'}) then table.insert(try_files, 1, '/sys/class/ieee80211/phy1/macaddress') -elseif platform.match('ar71xx', 'generic', {'unifi-outdoor-plus'}) then +elseif platform.match('ar71xx', 'generic', {'unifi-outdoor-plus', 'carambola2'}) then table.insert(try_files, 1, '/sys/class/net/eth0/address') elseif platform.match('ar71xx', 'generic', {'archer-c5', 'archer-c7'}) then table.insert(try_files, 1, '/sys/class/net/eth1/address') diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index ce8d3f25..89d486ce 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -302,3 +302,10 @@ $(eval $(call GluonProfile,MR16,rssileds)) $(eval $(call GluonProfileFactorySuffix,MR16)) $(eval $(call GluonModel,MR16,mr16,meraki-mr16)) $(eval $(call GluonModelAlias,MR16,meraki-mr16,meraki-mr66)) + +## 8devices + +# Carambola 2 +$(eval $(call GluonProfile,CARAMBOLA2)) +$(eval $(call GluonModel,CARAMBOLA2,carambola2,8devices-carambola2-board)) +$(eval $(call GluonProfileFactorySuffix,CARAMBOLA2)) From 7f1c11cf7ee30be5837c5086c1d7f17b270d101c Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 24 Apr 2016 09:11:20 +0200 Subject: [PATCH 375/867] Backport parallel download locking support Fixes #733 --- ...was-only-added-in-the-latest-version.patch | 81 +++++++++++++++++++ ...compile-flock-before-everything-else.patch | 31 +++++++ ...-fall-back-to-unlocked-shell-command.patch | 32 ++++++++ ...ce-conditions-with-multiple-variants.patch | 20 +++++ ...ix-packed-checkout-mirroring-support.patch | 26 ++++++ 5 files changed, 190 insertions(+) create mode 100644 patches/openwrt/0027-tools-add-tar-host-build-required-for-sort-name-which-was-only-added-in-the-latest-version.patch create mode 100644 patches/openwrt/0028-tools-compile-flock-before-everything-else.patch create mode 100644 patches/openwrt/0029-rules.mk-make-the-locked-template-available-even-if-flock-has-not-been-built-yet-fall-back-to-unlocked-shell-command.patch create mode 100644 patches/openwrt/0030-build-add-locking-for-downloads-fixes-race-conditions-with-multiple-variants.patch create mode 100644 patches/openwrt/0031-download.mk-fix-packed-checkout-mirroring-support.patch diff --git a/patches/openwrt/0027-tools-add-tar-host-build-required-for-sort-name-which-was-only-added-in-the-latest-version.patch b/patches/openwrt/0027-tools-add-tar-host-build-required-for-sort-name-which-was-only-added-in-the-latest-version.patch new file mode 100644 index 00000000..52fb08db --- /dev/null +++ b/patches/openwrt/0027-tools-add-tar-host-build-required-for-sort-name-which-was-only-added-in-the-latest-version.patch @@ -0,0 +1,81 @@ +From: Matthias Schiffer +Date: Sun, 24 Apr 2016 08:44:30 +0200 +Subject: tools: add tar host build, required for --sort=name which was only added in the latest version + +Signed-off-by: Felix Fietkau + +Backport of r46876 + +diff --git a/tools/Makefile b/tools/Makefile +index c6cded8..98ce8c5 100644 +--- a/tools/Makefile ++++ b/tools/Makefile +@@ -81,6 +81,9 @@ endif + # dependency for tools which have patches directory + $(foreach tool, $(tools-y), $(if $(wildcard $(curdir)/$(tool)/patches),$(eval $(curdir)/$(tool)/compile += $(curdir)/patch/install))) + ++$(foreach tool, $(tools-y), $(eval $(curdir)/$(tool)/compile += $(curdir)/tar/install)) ++tools-y += tar ++ + $(curdir)/builddirs := $(tools-y) $(tools-dep) $(tools-) + $(curdir)/builddirs-default := $(tools-y) + +diff --git a/tools/tar/Makefile b/tools/tar/Makefile +new file mode 100644 +index 0000000..975e783 +--- /dev/null ++++ b/tools/tar/Makefile +@@ -0,0 +1,30 @@ ++# ++# 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:=tar ++PKG_VERSION:=1.28 ++ ++PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz ++PKG_SOURCE_URL:=@GNU/tar ++PKG_MD5SUM:=49b6306167724fe48f419a33a5beb857 ++ ++HOST_BUILD_PARALLEL := 1 ++ ++include $(INCLUDE_DIR)/host-build.mk ++ ++HOSTCC := $(HOSTCC_NOCACHE) ++HOSTCXX := $(HOSTCXX_NOCACHE) ++ ++HOST_CONFIGURE_ARGS += \ ++ --without-posix-acls \ ++ --without-selinux \ ++ --without-xattrs \ ++ --disable-acl \ ++ --disable-nls ++ ++$(eval $(call HostBuild)) +diff --git a/tools/tar/patches/100-fix_xattr_disable.patch b/tools/tar/patches/100-fix_xattr_disable.patch +new file mode 100644 +index 0000000..5735bd2 +--- /dev/null ++++ b/tools/tar/patches/100-fix_xattr_disable.patch +@@ -0,0 +1,17 @@ ++--- a/lib/xattr-at.c +++++ b/lib/xattr-at.c ++@@ -18,6 +18,8 @@ ++ ++ #include ++ +++#ifdef HAVE_XATTRS +++ ++ #include "xattr-at.h" ++ #include "openat.h" ++ ++@@ -108,3 +110,5 @@ ++ #undef AT_FUNC_RESULT ++ #undef AT_FUNC_POST_FILE_PARAM_DECLS ++ #undef AT_FUNC_POST_FILE_ARGS +++ +++#endif diff --git a/patches/openwrt/0028-tools-compile-flock-before-everything-else.patch b/patches/openwrt/0028-tools-compile-flock-before-everything-else.patch new file mode 100644 index 00000000..c9291166 --- /dev/null +++ b/patches/openwrt/0028-tools-compile-flock-before-everything-else.patch @@ -0,0 +1,31 @@ +From: Matthias Schiffer +Date: Sun, 24 Apr 2016 08:44:47 +0200 +Subject: tools: compile flock before everything else + +Signed-off-by: Felix Fietkau + +Backport of r48413 + +diff --git a/tools/Makefile b/tools/Makefile +index 98ce8c5..3402c08 100644 +--- a/tools/Makefile ++++ b/tools/Makefile +@@ -26,7 +26,7 @@ endif + tools-$(BUILD_TOOLCHAIN) += gmp mpfr mpc libelf + tools-y += m4 libtool autoconf automake flex bison pkg-config sed mklibs + tools-y += sstrip make-ext4fs e2fsprogs mtd-utils mkimage +-tools-y += firmware-utils patch-image patch quilt yaffs2 flock padjffs2 ++tools-y += firmware-utils patch-image patch quilt yaffs2 padjffs2 + tools-y += mm-macros missing-macros xz cmake scons bc findutils gengetopt patchelf + tools-$(CONFIG_TARGET_orion_generic) += wrt350nv2-builder upslug2 + tools-$(CONFIG_powerpc) += upx +@@ -84,6 +84,9 @@ $(foreach tool, $(tools-y), $(if $(wildcard $(curdir)/$(tool)/patches),$(eval $( + $(foreach tool, $(tools-y), $(eval $(curdir)/$(tool)/compile += $(curdir)/tar/install)) + tools-y += tar + ++$(curdir)/tar/compile := $(curdir)/flock/install ++tools-y += flock ++ + $(curdir)/builddirs := $(tools-y) $(tools-dep) $(tools-) + $(curdir)/builddirs-default := $(tools-y) + diff --git a/patches/openwrt/0029-rules.mk-make-the-locked-template-available-even-if-flock-has-not-been-built-yet-fall-back-to-unlocked-shell-command.patch b/patches/openwrt/0029-rules.mk-make-the-locked-template-available-even-if-flock-has-not-been-built-yet-fall-back-to-unlocked-shell-command.patch new file mode 100644 index 00000000..5e851cdf --- /dev/null +++ b/patches/openwrt/0029-rules.mk-make-the-locked-template-available-even-if-flock-has-not-been-built-yet-fall-back-to-unlocked-shell-command.patch @@ -0,0 +1,32 @@ +From: Matthias Schiffer +Date: Sun, 24 Apr 2016 08:45:44 +0200 +Subject: rules.mk: make the locked template available even if flock has not been built yet (fall back to unlocked shell command) + +Signed-off-by: Felix Fietkau + +Backport of r48414 + +diff --git a/rules.mk b/rules.mk +index 9d0134d..ece5026 100644 +--- a/rules.mk ++++ b/rules.mk +@@ -310,12 +310,16 @@ endef + # Execute commands under flock + # $(1) => The shell expression. + # $(2) => The lock name. If not given, the global lock will be used. +-define locked ++ifneq ($(wildcard $(STAGING_DIR_HOST)/bin/flock),) ++ define locked + SHELL= \ +- $(STAGING_DIR_HOST)/bin/flock \ ++ flock \ + $(TMP_DIR)/.$(if $(2),$(strip $(2)),global).flock \ + -c '$(subst ','\'',$(1))' +-endef ++ endef ++else ++ locked=$(1) ++endif + + # Recursively copy paths into another directory, purge dangling + # symlinks before. diff --git a/patches/openwrt/0030-build-add-locking-for-downloads-fixes-race-conditions-with-multiple-variants.patch b/patches/openwrt/0030-build-add-locking-for-downloads-fixes-race-conditions-with-multiple-variants.patch new file mode 100644 index 00000000..ffa18527 --- /dev/null +++ b/patches/openwrt/0030-build-add-locking-for-downloads-fixes-race-conditions-with-multiple-variants.patch @@ -0,0 +1,20 @@ +From: Matthias Schiffer +Date: Sun, 24 Apr 2016 08:48:45 +0200 +Subject: build: add locking for downloads (fixes race conditions with multiple variants) + +Signed-off-by: Felix Fietkau + +Backport of r48416 + +diff --git a/include/download.mk b/include/download.mk +index e518cce..9176b11 100644 +--- a/include/download.mk ++++ b/include/download.mk +@@ -182,6 +182,6 @@ define Download + + $(DL_DIR)/$(FILE): + mkdir -p $(DL_DIR) +- $(if $(DownloadMethod/$(call dl_method,$(URL),$(PROTO))),$(DownloadMethod/$(call dl_method,$(URL),$(PROTO))),$(DownloadMethod/unknown)) ++ $(call locked,$(if $(DownloadMethod/$(call dl_method,$(URL),$(PROTO))),$(DownloadMethod/$(call dl_method,$(URL),$(PROTO))),$(DownloadMethod/unknown)),$(FILE)) + + endef diff --git a/patches/openwrt/0031-download.mk-fix-packed-checkout-mirroring-support.patch b/patches/openwrt/0031-download.mk-fix-packed-checkout-mirroring-support.patch new file mode 100644 index 00000000..5c0572c1 --- /dev/null +++ b/patches/openwrt/0031-download.mk-fix-packed-checkout-mirroring-support.patch @@ -0,0 +1,26 @@ +From: Matthias Schiffer +Date: Sun, 24 Apr 2016 08:49:27 +0200 +Subject: download.mk: fix packed checkout mirroring support + +Changeset r48416 broke the downloading of mirrored, packed scm checkouts. + +Fix this by removing the "@" sign in front of the download command which is +now executed as part of a larger shell command under flock. + +Signed-off-by: Jo-Philipp Wich + +Backport of r48733 + +diff --git a/include/download.mk b/include/download.mk +index 9176b11..130bbc5 100644 +--- a/include/download.mk ++++ b/include/download.mk +@@ -48,7 +48,7 @@ define DownloadMethod/default + 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 From f38bbf0d2cd43e3698b4b36d1583b31e56d6e4c2 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 24 Apr 2016 09:47:06 +0200 Subject: [PATCH 376/867] gluon-mesh-batman-adv-core: remove 'gluon.batman_adv' Lua module It is not used anymore. --- .../files/usr/lib/lua/gluon/batman_adv.lua | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 package/gluon-mesh-batman-adv-core/files/usr/lib/lua/gluon/batman_adv.lua diff --git a/package/gluon-mesh-batman-adv-core/files/usr/lib/lua/gluon/batman_adv.lua b/package/gluon-mesh-batman-adv-core/files/usr/lib/lua/gluon/batman_adv.lua deleted file mode 100644 index cd559fe5..00000000 --- a/package/gluon-mesh-batman-adv-core/files/usr/lib/lua/gluon/batman_adv.lua +++ /dev/null @@ -1,15 +0,0 @@ -local nixio = require 'nixio' - -module 'gluon.batman_adv' - -function interfaces(bat_if) - local iter = nixio.fs.glob('/sys/class/net/' .. bat_if .. '/lower_*') - return function() - local path = iter() - if path == nil then - return nil - end - local ifname = path:match('/lower_([^/]+)$') - return ifname - end -end From 10a469bcfce55a8fb001082cad2494a6e7d787a4 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 24 Apr 2016 11:54:32 +0200 Subject: [PATCH 377/867] Update OpenWrt base --- modules | 2 +- ...tconsole-wait-for-both-THRE-and-TEMT.patch | 85 ------------------- ...ection-for-Winbond-flash-at-startup.patch} | 0 ...ort-LibreSSL-as-provider-of-openssl.patch} | 0 ...WREV-on-upgrades-of-TP-LINK-devices.patch} | 0 ...-space-on-some-TP-LINK-like-devices.patch} | 0 ...X_MODEL-to-match-labels-image-names.patch} | 0 ...71xx-build-image-for-TL-WR710N-v2.1.patch} | 0 ...gure-compatiblity-with-POSIX-shells.patch} | 0 ...as-only-added-in-the-latest-version.patch} | 0 ...ompile-flock-before-everything-else.patch} | 0 ...fall-back-to-unlocked-shell-command.patch} | 0 ...e-conditions-with-multiple-variants.patch} | 0 ...x-packed-checkout-mirroring-support.patch} | 0 14 files changed, 1 insertion(+), 86 deletions(-) delete mode 100644 patches/openwrt/0019-ar71xx-make-bootconsole-wait-for-both-THRE-and-TEMT.patch rename patches/openwrt/{0020-generic-mtd-spi-nor-disable-protection-for-Winbond-flash-at-startup.patch => 0019-generic-mtd-spi-nor-disable-protection-for-Winbond-flash-at-startup.patch} (100%) rename patches/openwrt/{0021-Support-LibreSSL-as-provider-of-openssl.patch => 0020-Support-LibreSSL-as-provider-of-openssl.patch} (100%) rename patches/openwrt/{0022-ar71xx-check-both-HWID-and-HWREV-on-upgrades-of-TP-LINK-devices.patch => 0021-ar71xx-check-both-HWID-and-HWREV-on-upgrades-of-TP-LINK-devices.patch} (100%) rename patches/openwrt/{0023-ar71xx-avoid-AR71XX_MODEL-ending-with-a-space-on-some-TP-LINK-like-devices.patch => 0022-ar71xx-avoid-AR71XX_MODEL-ending-with-a-space-on-some-TP-LINK-like-devices.patch} (100%) rename patches/openwrt/{0024-ar71xx-fix-the-revision-of-a-few-TP-LINK-devices-in-AR71XX_MODEL-to-match-labels-image-names.patch => 0023-ar71xx-fix-the-revision-of-a-few-TP-LINK-devices-in-AR71XX_MODEL-to-match-labels-image-names.patch} (100%) rename patches/openwrt/{0025-ar71xx-build-image-for-TL-WR710N-v2.1.patch => 0024-ar71xx-build-image-for-TL-WR710N-v2.1.patch} (100%) rename patches/openwrt/{0026-xtables-addons-build-fix-configure-compatiblity-with-POSIX-shells.patch => 0025-xtables-addons-build-fix-configure-compatiblity-with-POSIX-shells.patch} (100%) rename patches/openwrt/{0027-tools-add-tar-host-build-required-for-sort-name-which-was-only-added-in-the-latest-version.patch => 0026-tools-add-tar-host-build-required-for-sort-name-which-was-only-added-in-the-latest-version.patch} (100%) rename patches/openwrt/{0028-tools-compile-flock-before-everything-else.patch => 0027-tools-compile-flock-before-everything-else.patch} (100%) rename patches/openwrt/{0029-rules.mk-make-the-locked-template-available-even-if-flock-has-not-been-built-yet-fall-back-to-unlocked-shell-command.patch => 0028-rules.mk-make-the-locked-template-available-even-if-flock-has-not-been-built-yet-fall-back-to-unlocked-shell-command.patch} (100%) rename patches/openwrt/{0030-build-add-locking-for-downloads-fixes-race-conditions-with-multiple-variants.patch => 0029-build-add-locking-for-downloads-fixes-race-conditions-with-multiple-variants.patch} (100%) rename patches/openwrt/{0031-download.mk-fix-packed-checkout-mirroring-support.patch => 0030-download.mk-fix-packed-checkout-mirroring-support.patch} (100%) diff --git a/modules b/modules index 582d6bf2..ba40edc7 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=23395d539f4a45d8bed611e7f9c64275cd1cce0e +OPENWRT_COMMIT=ba0cac08164150e74567787251e44b4d0d0dc140 PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git PACKAGES_OPENWRT_COMMIT=9622fe984bba3a4547f48bc507ebaba7637eb2b0 diff --git a/patches/openwrt/0019-ar71xx-make-bootconsole-wait-for-both-THRE-and-TEMT.patch b/patches/openwrt/0019-ar71xx-make-bootconsole-wait-for-both-THRE-and-TEMT.patch deleted file mode 100644 index 76a41dce..00000000 --- a/patches/openwrt/0019-ar71xx-make-bootconsole-wait-for-both-THRE-and-TEMT.patch +++ /dev/null @@ -1,85 +0,0 @@ -From: Matthias Schiffer -Date: Thu, 24 Mar 2016 18:30:26 +0100 -Subject: ar71xx: make bootconsole wait for both THRE and TEMT - -Original commit message: - - MIPS: ath79: make bootconsole wait for both THRE and TEMT - - This makes the ath79 bootconsole behave the same way as the generic 8250 - bootconsole. - - Also waiting for TEMT (transmit buffer is empty) instead of just THRE - (transmit buffer is not full) ensures that all characters have been - transmitted before the real serial driver starts reconfiguring the serial - controller (which would sometimes result in garbage being transmitted.) - This change does not cause a visible performance loss. - - In addition, this seems to fix a hang observed in certain configurations on - many AR7xxx/AR9xxx SoCs during autoconfig of the real serial driver. - - A more complete follow-up patch will disable 8250 autoconfig for ath79 - altogether (the serial controller is detected as a 16550A, which is not - fully compatible with the ath79 serial, and the autoconfig may lead to - undefined behavior on ath79.) - -diff --git a/target/linux/ar71xx/patches-3.18/103-MIPS-ath79-make-bootconsole-wait-for-both-THRE-and-T.patch b/target/linux/ar71xx/patches-3.18/103-MIPS-ath79-make-bootconsole-wait-for-both-THRE-and-T.patch -new file mode 100644 -index 0000000..7be14ab ---- /dev/null -+++ b/target/linux/ar71xx/patches-3.18/103-MIPS-ath79-make-bootconsole-wait-for-both-THRE-and-T.patch -@@ -0,0 +1,54 @@ -+From f1ba020af5076172c9d29006a747ccf40027fedc Mon Sep 17 00:00:00 2001 -+Message-Id: -+From: Matthias Schiffer -+Date: Thu, 24 Mar 2016 15:34:05 +0100 -+Subject: [PATCH] MIPS: ath79: make bootconsole wait for both THRE and TEMT -+ -+This makes the ath79 bootconsole behave the same way as the generic 8250 -+bootconsole. -+ -+Also waiting for TEMT (transmit buffer is empty) instead of just THRE -+(transmit buffer is not full) ensures that all characters have been -+transmitted before the real serial driver starts reconfiguring the serial -+controller (which would sometimes result in garbage being transmitted.) -+This change does not cause a visible performance loss. -+ -+In addition, this seems to fix a hang observed in certain configurations on -+many AR7xxx/AR9xxx SoCs during autoconfig of the real serial driver. -+ -+A more complete follow-up patch will disable 8250 autoconfig for ath79 -+altogether (the serial controller is detected as a 16550A, which is not -+fully compatible with the ath79 serial, and the autoconfig may lead to -+undefined behavior on ath79.) -+ -+Cc: -+Signed-off-by: Matthias Schiffer -+--- -+ arch/mips/ath79/early_printk.c | 6 ++++-- -+ 1 file changed, 4 insertions(+), 2 deletions(-) -+ -+diff --git a/arch/mips/ath79/early_printk.c b/arch/mips/ath79/early_printk.c -+index b955faf..d1adc59 100644 -+--- a/arch/mips/ath79/early_printk.c -++++ b/arch/mips/ath79/early_printk.c -+@@ -31,13 +31,15 @@ static inline void prom_putchar_wait(void __iomem *reg, u32 mask, u32 val) -+ } while (1); -+ } -+ -++#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) -++ -+ static void prom_putchar_ar71xx(unsigned char ch) -+ { -+ void __iomem *base = (void __iomem *)(KSEG1ADDR(AR71XX_UART_BASE)); -+ -+- prom_putchar_wait(base + UART_LSR * 4, UART_LSR_THRE, UART_LSR_THRE); -++ prom_putchar_wait(base + UART_LSR * 4, BOTH_EMPTY, BOTH_EMPTY); -+ __raw_writel(ch, base + UART_TX * 4); -+- prom_putchar_wait(base + UART_LSR * 4, UART_LSR_THRE, UART_LSR_THRE); -++ prom_putchar_wait(base + UART_LSR * 4, BOTH_EMPTY, BOTH_EMPTY); -+ } -+ -+ static void prom_putchar_ar933x(unsigned char ch) -+-- -+2.7.4 -+ diff --git a/patches/openwrt/0020-generic-mtd-spi-nor-disable-protection-for-Winbond-flash-at-startup.patch b/patches/openwrt/0019-generic-mtd-spi-nor-disable-protection-for-Winbond-flash-at-startup.patch similarity index 100% rename from patches/openwrt/0020-generic-mtd-spi-nor-disable-protection-for-Winbond-flash-at-startup.patch rename to patches/openwrt/0019-generic-mtd-spi-nor-disable-protection-for-Winbond-flash-at-startup.patch diff --git a/patches/openwrt/0021-Support-LibreSSL-as-provider-of-openssl.patch b/patches/openwrt/0020-Support-LibreSSL-as-provider-of-openssl.patch similarity index 100% rename from patches/openwrt/0021-Support-LibreSSL-as-provider-of-openssl.patch rename to patches/openwrt/0020-Support-LibreSSL-as-provider-of-openssl.patch diff --git a/patches/openwrt/0022-ar71xx-check-both-HWID-and-HWREV-on-upgrades-of-TP-LINK-devices.patch b/patches/openwrt/0021-ar71xx-check-both-HWID-and-HWREV-on-upgrades-of-TP-LINK-devices.patch similarity index 100% rename from patches/openwrt/0022-ar71xx-check-both-HWID-and-HWREV-on-upgrades-of-TP-LINK-devices.patch rename to patches/openwrt/0021-ar71xx-check-both-HWID-and-HWREV-on-upgrades-of-TP-LINK-devices.patch diff --git a/patches/openwrt/0023-ar71xx-avoid-AR71XX_MODEL-ending-with-a-space-on-some-TP-LINK-like-devices.patch b/patches/openwrt/0022-ar71xx-avoid-AR71XX_MODEL-ending-with-a-space-on-some-TP-LINK-like-devices.patch similarity index 100% rename from patches/openwrt/0023-ar71xx-avoid-AR71XX_MODEL-ending-with-a-space-on-some-TP-LINK-like-devices.patch rename to patches/openwrt/0022-ar71xx-avoid-AR71XX_MODEL-ending-with-a-space-on-some-TP-LINK-like-devices.patch diff --git a/patches/openwrt/0024-ar71xx-fix-the-revision-of-a-few-TP-LINK-devices-in-AR71XX_MODEL-to-match-labels-image-names.patch b/patches/openwrt/0023-ar71xx-fix-the-revision-of-a-few-TP-LINK-devices-in-AR71XX_MODEL-to-match-labels-image-names.patch similarity index 100% rename from patches/openwrt/0024-ar71xx-fix-the-revision-of-a-few-TP-LINK-devices-in-AR71XX_MODEL-to-match-labels-image-names.patch rename to patches/openwrt/0023-ar71xx-fix-the-revision-of-a-few-TP-LINK-devices-in-AR71XX_MODEL-to-match-labels-image-names.patch diff --git a/patches/openwrt/0025-ar71xx-build-image-for-TL-WR710N-v2.1.patch b/patches/openwrt/0024-ar71xx-build-image-for-TL-WR710N-v2.1.patch similarity index 100% rename from patches/openwrt/0025-ar71xx-build-image-for-TL-WR710N-v2.1.patch rename to patches/openwrt/0024-ar71xx-build-image-for-TL-WR710N-v2.1.patch diff --git a/patches/openwrt/0026-xtables-addons-build-fix-configure-compatiblity-with-POSIX-shells.patch b/patches/openwrt/0025-xtables-addons-build-fix-configure-compatiblity-with-POSIX-shells.patch similarity index 100% rename from patches/openwrt/0026-xtables-addons-build-fix-configure-compatiblity-with-POSIX-shells.patch rename to patches/openwrt/0025-xtables-addons-build-fix-configure-compatiblity-with-POSIX-shells.patch diff --git a/patches/openwrt/0027-tools-add-tar-host-build-required-for-sort-name-which-was-only-added-in-the-latest-version.patch b/patches/openwrt/0026-tools-add-tar-host-build-required-for-sort-name-which-was-only-added-in-the-latest-version.patch similarity index 100% rename from patches/openwrt/0027-tools-add-tar-host-build-required-for-sort-name-which-was-only-added-in-the-latest-version.patch rename to patches/openwrt/0026-tools-add-tar-host-build-required-for-sort-name-which-was-only-added-in-the-latest-version.patch diff --git a/patches/openwrt/0028-tools-compile-flock-before-everything-else.patch b/patches/openwrt/0027-tools-compile-flock-before-everything-else.patch similarity index 100% rename from patches/openwrt/0028-tools-compile-flock-before-everything-else.patch rename to patches/openwrt/0027-tools-compile-flock-before-everything-else.patch diff --git a/patches/openwrt/0029-rules.mk-make-the-locked-template-available-even-if-flock-has-not-been-built-yet-fall-back-to-unlocked-shell-command.patch b/patches/openwrt/0028-rules.mk-make-the-locked-template-available-even-if-flock-has-not-been-built-yet-fall-back-to-unlocked-shell-command.patch similarity index 100% rename from patches/openwrt/0029-rules.mk-make-the-locked-template-available-even-if-flock-has-not-been-built-yet-fall-back-to-unlocked-shell-command.patch rename to patches/openwrt/0028-rules.mk-make-the-locked-template-available-even-if-flock-has-not-been-built-yet-fall-back-to-unlocked-shell-command.patch diff --git a/patches/openwrt/0030-build-add-locking-for-downloads-fixes-race-conditions-with-multiple-variants.patch b/patches/openwrt/0029-build-add-locking-for-downloads-fixes-race-conditions-with-multiple-variants.patch similarity index 100% rename from patches/openwrt/0030-build-add-locking-for-downloads-fixes-race-conditions-with-multiple-variants.patch rename to patches/openwrt/0029-build-add-locking-for-downloads-fixes-race-conditions-with-multiple-variants.patch diff --git a/patches/openwrt/0031-download.mk-fix-packed-checkout-mirroring-support.patch b/patches/openwrt/0030-download.mk-fix-packed-checkout-mirroring-support.patch similarity index 100% rename from patches/openwrt/0031-download.mk-fix-packed-checkout-mirroring-support.patch rename to patches/openwrt/0030-download.mk-fix-packed-checkout-mirroring-support.patch From 069bcb33279235fd97dd4faee1217d6b25b3a976 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 24 Apr 2016 13:22:43 +0200 Subject: [PATCH 378/867] Update Gluon packages --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index ba40edc7..ffccb902 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=fea8f67d5d5cccac39b5020a69106f8665d41e58 +PACKAGES_GLUON_COMMIT=9134a42c9347c4216058cbbabc93145405c062db PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_COMMIT=2a8338559de5c4b077cde7a83f43f4700a17d5cc From c18d43d2cbc078efeadcaa2a1f907565c1961db6 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 24 Apr 2016 15:28:35 +0200 Subject: [PATCH 379/867] gluon-core: use correct file variable in get_site_config() --- package/gluon-core/files/usr/lib/lua/gluon/site_config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 6f01b066..4c0a2d22 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 @@ -7,7 +7,7 @@ local function get_site_config() local file = assert(io.open(config)) local decoder = json.new() - ltn12.pump.all(ltn12.source.file(io.open(config)), decoder:sink()) + ltn12.pump.all(ltn12.source.file(file), decoder:sink()) file:close() From 8f6cc2dadd7ba90a46dda88905a0ef86bec68870 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 25 Apr 2016 18:18:56 +0200 Subject: [PATCH 380/867] ar71xx-generic: add TP-LINK TL-WR841ND v11 support Fixes #721 --- ...-ar71xx-Add-TL-WR841N-ND-v11-support.patch | 43 +++++++++++++++++++ targets/ar71xx-generic/profiles.mk | 5 ++- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 patches/openwrt/0031-ar71xx-Add-TL-WR841N-ND-v11-support.patch diff --git a/patches/openwrt/0031-ar71xx-Add-TL-WR841N-ND-v11-support.patch b/patches/openwrt/0031-ar71xx-Add-TL-WR841N-ND-v11-support.patch new file mode 100644 index 00000000..d4c406f0 --- /dev/null +++ b/patches/openwrt/0031-ar71xx-Add-TL-WR841N-ND-v11-support.patch @@ -0,0 +1,43 @@ +From: Matthias Schiffer +Date: Mon, 25 Apr 2016 18:07:13 +0200 +Subject: ar71xx: Add TL-WR841N/ND v11 support + +This patch adds support for the TP-Link TL-WR841N/ND to trunk. It is +similar to the already supported v10 - see [1]. I have added support +based on that topic; in the meantime it has been confirmed working +(see the forum thread, and also [2]). + +Signed-off by Stijn Segers + +[1]: https://forum.openwrt.org/viewtopic.php?id=61309 +[2]: https://forum.openwrt.org/viewtopic.php?id=63657 + +Backport of r49099 + +diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile +index 9ac405c..1b4e6db 100644 +--- a/target/linux/ar71xx/image/Makefile ++++ b/target/linux/ar71xx/image/Makefile +@@ -578,6 +578,13 @@ define Device/tl-wr841-v10 + TPLINK_HWID := 0x08410010 + endef + ++define Device/tl-wr841-v11 ++ $(Device/tplink-4mlzma) ++ BOARDNAME := TL-WR841N-v9 ++ DEVICE_PROFILE := TLWR841 ++ TPLINK_HWID := 0x08410011 ++endef ++ + define Device/tl-wr842n-v2 + $(Device/tplink-8mlzma) + BOARDNAME := TL-WR842N-v2 +@@ -598,7 +605,7 @@ define Device/tl-wr847n-v8 + DEVICE_PROFILE := TLWR841 + TPLINK_HWID := 0x08470008 + endef +-TARGET_DEVICES += tl-wr841-v8 tl-wr841-v9 tl-wr841-v10 tl-wr842n-v2 tl-wr843nd-v1 tl-wr847n-v8 ++TARGET_DEVICES += tl-wr841-v8 tl-wr841-v9 tl-wr841-v10 tl-wr841-v11 tl-wr842n-v2 tl-wr843nd-v1 tl-wr847n-v8 + + define Device/tl-wr941nd-v5 + $(Device/tplink-4mlzma) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 89d486ce..dd3aa2cb 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -57,7 +57,7 @@ $(eval $(call GluonProfile,TLWA801)) $(eval $(call GluonModel,TLWA801,tl-wa801nd-v1,tp-link-tl-wa801n-nd-v1)) $(eval $(call GluonModel,TLWA801,tl-wa801nd-v2,tp-link-tl-wa801n-nd-v2)) -# TL-WR841N/ND v3, v5, v7, v8, v9, v10 +# TL-WR841N/ND v3, v5, v7, v8, v9, v10, v11 $(eval $(call GluonProfile,TLWR841)) $(eval $(call GluonModel,TLWR841,tl-wr841-v3,tp-link-tl-wr841n-nd-v3)) $(eval $(call GluonModel,TLWR841,tl-wr841-v5,tp-link-tl-wr841n-nd-v5)) @@ -65,6 +65,9 @@ $(eval $(call GluonModel,TLWR841,tl-wr841-v7,tp-link-tl-wr841n-nd-v7)) $(eval $(call GluonModel,TLWR841,tl-wr841-v8,tp-link-tl-wr841n-nd-v8)) $(eval $(call GluonModel,TLWR841,tl-wr841-v9,tp-link-tl-wr841n-nd-v9)) $(eval $(call GluonModel,TLWR841,tl-wr841-v10,tp-link-tl-wr841n-nd-v10)) +ifeq ($(BROKEN),1) +$(eval $(call GluonModel,TLWR841,tl-wr841-v11,tp-link-tl-wr841n-nd-v11)) # BROKEN: untested +endif # TL-WR842N/ND v1, v2 $(eval $(call GluonProfile,TLWR842)) From 7f2b93e7f099d6202a5c9f15099d756f699a9524 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 26 Apr 2016 21:29:48 +0200 Subject: [PATCH 381/867] gluon-status-page: remove old status page We have Git for history, there's no reason to keep old files that aren't used anymore. --- .../lib/gluon/status-page/www/cgi-bin/status | 160 ------------------ .../files/lib/gluon/status-page/www/status.js | 9 - 2 files changed, 169 deletions(-) delete mode 100755 package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/status delete mode 100644 package/gluon-status-page/files/lib/gluon/status-page/www/status.js diff --git a/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/status b/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/status deleted file mode 100755 index ea520e22..00000000 --- a/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/status +++ /dev/null @@ -1,160 +0,0 @@ -#!/usr/bin/lua - -local util = require("luci.util") -local fs = require("nixio.fs") -local ltn12 = require 'luci.ltn12' -local sys = require("luci.sys") -local json = require("luci.jsonc") -local nixio = require 'nixio' -local platform_info = require("platform_info") - -local hostname = sys.hostname() -local model = platform_info.get_model() -local release = util.trim(fs.readfile("/lib/gluon/release") or "") - -function escape_html(s) - return (s:gsub('&', '&'):gsub('<', '<'):gsub('>', '>'):gsub('"', '"')) -end - -function neighbours(ifname) - local info = util.exec("gluon-neighbour-info -d ff02::2:1001 -p 1001 -r nodeinfo -t 3 -i " .. ifname) - local macs = {} - for _, line in ipairs(util.split(info)) do - local data = json.parse(line) - if data then - local function add_macs(list) - if list then - for _, mac in ipairs(list) do - macs[mac] = data - end - end - end - - if data["network"] then - add_macs(data["network"]["mesh_interfaces"]) - - if data["network"]["mesh"] and data["network"]["mesh"]["bat0"] and - data["network"]["mesh"]["bat0"]["interfaces"] then - local interfaces = data["network"]["mesh"]["bat0"]["interfaces"] - add_macs(interfaces["other"]) - add_macs(interfaces["wireless"]) - add_macs(interfaces["tunnel"]) - end - end - end - end - - return macs -end - -io.write("Content-type: text/html\n\n") -io.write("\n") -io.write("") -io.write("") -io.write("") -io.write("") -io.write("" .. escape_html(hostname) .. "") -io.write("") -io.write("") - -io.write("

" .. escape_html(hostname) .. "

") -io.write("
")
-
-io.write("Model: " .. escape_html(model) .. "\n")
-io.write("Firmware release: " .. escape_html(release) .. "\n\n")
-
-io.write(escape_html(util.trim(sys.exec("uptime | sed 's/^ \+//'"))) .. "\n\n")
-io.write(escape_html(sys.exec("ip address show dev br-client")) .. "\n")
-io.write(escape_html(sys.exec("free -m")) .. "\n")
-io.write(escape_html(sys.exec("df /rom /overlay")))
-io.write("
") - -io.write("

Neighbours

") - -local interfaces = util.split(util.trim(util.exec("iw dev | egrep 'type IBSS|type mesh' -B 5 | grep Interface | cut -d' ' -f2"))) - -for _, ifname in ipairs(interfaces) do - io.write("

" .. escape_html(ifname) .. "

") - io.write("
")
-
-  for _, line in ipairs(util.split(util.exec("iw dev " .. ifname .. " station dump"))) do
-    local mac = line:match("^Station (.*) %(on ")
-    if mac then
-      io.write("Station " .. mac .. " (on " .. escape_html(ifname) .. ")\n")
-    else
-      io.write(escape_html(line) .. "\n")
-    end
-  end
-
-  io.write("
") -end - -local stat, fastd_status = pcall( - function() - local fastd_sock = nixio.socket('unix', 'stream') - assert(fastd_sock:connect('/var/run/fastd.mesh_vpn.socket')) - - decoder = json.new() - ltn12.pump.all(ltn12.source.file(fastd_sock), decoder:sink()) - return decoder:get() - end -) - -io.write("

VPN status

") -io.write("
")
-
-if stat then
-  io.write(string.format("fastd running for %.3f seconds\n", fastd_status.uptime/1000))
-
-  local peers = 0
-  local connections = 0
-
-  for key, peer in pairs(fastd_status.peers) do
-    peers = peers+1
-
-    if peer.connection then
-      connections = connections+1
-    end
-  end
-
-  io.write(string.format("There are %i peers configured, of which %i are connected:\n\n", peers, connections))
-
-  for key, peer in pairs(fastd_status.peers) do
-    io.write(string.format("%s: ", escape_html(peer.name)))
-
-    if peer.connection then
-      io.write(string.format("connected for %.3f seconds\n", peer.connection.established/1000))
-    else
-      io.write("not connected\n")
-    end
-  end
-
-else
-  io.write("fastd not running")
-end
-
-io.write("
") - -io.write("") -io.write("") -io.write("") diff --git a/package/gluon-status-page/files/lib/gluon/status-page/www/status.js b/package/gluon-status-page/files/lib/gluon/status-page/www/status.js deleted file mode 100644 index e17102d0..00000000 --- a/package/gluon-status-page/files/lib/gluon/status-page/www/status.js +++ /dev/null @@ -1,9 +0,0 @@ -function update_node(id, ip, hostname) { - var el = document.getElementById(id); - - if (!el) - return; - - el.href = "http://[" + ip + "]/"; - el.textContent += " (" + hostname + ")"; -} From 82b5b5a8d28f56c95709a998248e4e4c721c8c0f Mon Sep 17 00:00:00 2001 From: corvusmo Date: Wed, 27 Apr 2016 08:40:13 +0200 Subject: [PATCH 382/867] gluon-status-page: refactor creation of table rows and cells (#738) --- .../src/js/lib/gui/neighbours.js | 24 +++++++------------ .../src/js/lib/gui/statistics.js | 9 +++---- 2 files changed, 11 insertions(+), 22 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 ff782506..56933667 100644 --- a/package/gluon-status-page/src/js/lib/gui/neighbours.js +++ b/package/gluon-status-page/src/js/lib/gui/neighbours.js @@ -31,20 +31,13 @@ function (Helper, SignalGraph, Signal) { } function TableEntry(parent, nodeInfo, color, stream, mgmtBus, signal) { - var el = document.createElement("tr") - parent.appendChild(el) + var el = parent.insertRow() - var tdHostname = document.createElement("td") - var tdTQ = document.createElement("td") - var tdSignal = document.createElement("td") - var tdDistance = document.createElement("td") - var tdInactive = document.createElement("td") - - el.appendChild(tdHostname) - el.appendChild(tdTQ) - el.appendChild(tdSignal) - el.appendChild(tdDistance) - el.appendChild(tdInactive) + var tdHostname = el.insertCell() + var tdTQ = el.insertCell() + var tdSignal = el.insertCell() + var tdDistance = el.insertCell() + var tdInactive = el.insertCell() var marker = document.createElement("span") marker.textContent = "⬤ " @@ -69,7 +62,7 @@ function (Helper, SignalGraph, Signal) { el.destroy = function () { unsubscribe() - parent.removeChild(el) + parent.tBodies[0].removeChild(el) } return el @@ -135,8 +128,7 @@ function (Helper, SignalGraph, Signal) { el.appendChild(h) var table = document.createElement("table") - var tr = document.createElement("tr") - table.appendChild(tr) + var tr = table.insertRow() table.classList.add("datatable") var th = document.createElement("th") 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 59a7c560..244a2e96 100644 --- a/package/gluon-status-page/src/js/lib/gui/statistics.js +++ b/package/gluon-status-page/src/js/lib/gui/statistics.js @@ -49,10 +49,11 @@ define(["lib/helper"], function (Helper) { } function mkTrafficRow(table, children, label, stream, selector) { - var tr = document.createElement("tr") + var tr = table.insertRow() var th = document.createElement("th") - var td = document.createElement("td") th.textContent = label + tr.appendChild(th) + var td = tr.insertCell() var traffic = stream.slidingWindow(2, 2) var pkts = streamNode(traffic.map(deltaUptime(selector + ".packets")).map(prettyPackets)) @@ -65,10 +66,6 @@ define(["lib/helper"], function (Helper) { td.appendChild(document.createElement("br")) td.appendChild(bytes) - tr.appendChild(th) - tr.appendChild(td) - table.appendChild(tr) - children.push(pkts) children.push(bw) children.push(bytes) From c73a12e0ea9fd6bb48927f0a03367354b5897ddc Mon Sep 17 00:00:00 2001 From: lemoer Date: Wed, 27 Apr 2016 12:16:39 +0200 Subject: [PATCH 383/867] Change MAC schema generation (#715) While ath9k/ath10k devices can supprt VIFs with any combination of MAC addresses, there are also adapters which have a hardware MAC filter which only allows a few bits to differ. This commit changes the addresses of all VIFs to ony differ in the last 3 bits, which is required to support many Ralink/Mediatek based WLAN adapters. Technically, the new addresses are generated by calculating an MD5 hash of the primary MAC address and using a part of this hash as a prefix for the MAC addresses. The addresses (BSSIDs) of the AP VIFs are also reused for the LAN and WAN interfaces in mesh-on-LAN/WAN mode to reduce the number of needed addresses, and thus reduce the chance of collisions. This is not a problem as the MAC addresses of the AP VIFs are never used except as BSSID, and thus not seen by routing protocols like batman-adv. Fixes #648 [Matthias Schiffer: rewrote commit message] --- .../upgrade/320-gluon-client-bridge-wireless | 6 ++- package/gluon-core/Makefile | 2 +- .../files/usr/lib/lua/gluon/util.lua | 46 +++++++++++++------ .../300-gluon-mesh-batman-adv-core-wan | 2 +- .../320-gluon-mesh-batman-adv-core-wireless | 12 +++-- ...340-gluon-mesh-batman-adv-core-mesh-on-lan | 2 +- .../lib/gluon/upgrade/400-mesh-vpn-fastd | 2 +- 7 files changed, 47 insertions(+), 25 deletions(-) diff --git a/package/gluon-client-bridge/files/lib/gluon/upgrade/320-gluon-client-bridge-wireless b/package/gluon-client-bridge/files/lib/gluon/upgrade/320-gluon-client-bridge-wireless index 8d5c7181..6fc8a72a 100755 --- a/package/gluon-client-bridge/files/lib/gluon/upgrade/320-gluon-client-bridge-wireless +++ b/package/gluon-client-bridge/files/lib/gluon/upgrade/320-gluon-client-bridge-wireless @@ -21,14 +21,16 @@ local function configure_client(config, radio, index, suffix) uci:delete('wireless', name) - if config then + macaddr = util.generate_mac(3*index) + + if config and macaddr then uci:section('wireless', 'wifi-iface', name, { device = radio, network = 'client', mode = 'ap', ssid = config.ssid, - macaddr = util.generate_mac(2, index), + macaddr = macaddr, ifname = suffix and 'client' .. suffix, disabled = disabled, } diff --git a/package/gluon-core/Makefile b/package/gluon-core/Makefile index de54283b..725fb737 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 +libgluonutil +lua-platform-info +luci-base +luci-lib-jsonc +odhcp6c +firewall + DEPENDS:=+gluon-site +libgluonutil +lua-platform-info +lua-hash +luci-base +luci-lib-jsonc +odhcp6c +firewall endef diff --git a/package/gluon-core/files/usr/lib/lua/gluon/util.lua b/package/gluon-core/files/usr/lib/lua/gluon/util.lua index d9df636f..72b6220d 100644 --- a/package/gluon-core/files/usr/lib/lua/gluon/util.lua +++ b/package/gluon-core/files/usr/lib/lua/gluon/util.lua @@ -30,6 +30,7 @@ local ipairs = ipairs local table = table local nixio = require 'nixio' +local hash = require 'hash' local sysconfig = require 'gluon.sysconfig' local site = require 'gluon.site_config' local uci = require('luci.model.uci').cursor() @@ -71,22 +72,37 @@ function node_id() end -- Generates a (hopefully) unique MAC address --- The first parameter defines the function and the second --- parameter an ID to add to the MAC address --- Functions and IDs defined so far: --- (1, 0): WAN (for mesh-on-WAN) --- (1, 1): LAN (for mesh-on-LAN) --- (2, n): client interface for the n'th radio --- (3, n): adhoc interface for n'th radio --- (4, 0): mesh VPN --- (5, n): mesh interface for n'th radio (802.11s) -function generate_mac(f, i) - local m1, m2, m3, m4, m5, m6 = string.match(sysconfig.primary_mac, '(%x%x):(%x%x):(%x%x):(%x%x):(%x%x):(%x%x)') - m1 = nixio.bit.bor(tonumber(m1, 16), 0x02) - m2 = (tonumber(m2, 16)+f) % 0x100 - m3 = (tonumber(m3, 16)+i) % 0x100 +-- The parameter defines the ID to add to the mac addr +-- +-- IDs defined so far: +-- 0: client0; mesh-vpn +-- 1: mesh0 +-- 2: ibss0 +-- 3: client1; mesh-on-wan +-- 4: mesh1 +-- 5: ibss1 +-- 6: mesh-on-lan +-- 7: unused +function generate_mac(i) + if i > 7 or i < 0 then return nil end -- max allowed id (0b111) - return string.format('%02x:%02x:%02x:%s:%s:%s', m1, m2, m3, m4, m5, m6) + local hashed = string.sub(hash.md5(sysconfig.primary_mac), 0, 12) + local m1, m2, m3, m4, m5, m6 = string.match(hashed, '(%x%x)(%x%x)(%x%x)(%x%x)(%x%x)(%x%x)') + + m1 = tonumber(m1, 16) + m6 = tonumber(m6, 16) + + m1 = nixio.bit.bor(m1, 0x02) -- set locally administered bit + m1 = nixio.bit.band(m1, 0xFE) -- unset the multicast bit + + -- It's necessary that the first 45 bits of the mac do + -- not vary on a single hardware interface, since some chips are using + -- a hardware mac filter. (e.g 'ramips-rt305x') + + m6 = nixio.bit.band(m6, 0xF8) -- zero the last three bits (space needed for counting) + m6 = m6 + i -- add virtual interface id + + return string.format('%02x:%s:%s:%s:%s:%02x', m1, m2, m3, m4, m5, m6) end -- Iterate over all radios defined in UCI calling diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/300-gluon-mesh-batman-adv-core-wan b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/300-gluon-mesh-batman-adv-core-wan index 00b16414..be96c012 100755 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/300-gluon-mesh-batman-adv-core-wan +++ b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/300-gluon-mesh-batman-adv-core-wan @@ -5,6 +5,6 @@ local uci = require('luci.model.uci').cursor() -- fix up duplicate mac addresses (for mesh-on-WAN) -uci:set('network', 'wan', 'macaddr', util.generate_mac(1, 0)) +uci:set('network', 'wan', 'macaddr', util.generate_mac(3)) uci:save('network') diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless index a73912b8..05462c6f 100755 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless +++ b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless @@ -29,7 +29,9 @@ local function configure_ibss(config, radio, index, suffix, disabled) uci:delete('network', name .. '_vlan') uci:delete('wireless', name) - if config then + macaddr = util.generate_mac(3*index+2) + + if config and macaddr then if config.vlan then uci:section('network', 'interface', name, { @@ -60,7 +62,7 @@ local function configure_ibss(config, radio, index, suffix, disabled) mode = 'adhoc', ssid = config.ssid, bssid = config.bssid, - macaddr = util.generate_mac(3, index), + macaddr = macaddr, mcast_rate = config.mcast_rate, ifname = suffix and 'ibss' .. suffix, disabled = disabled and 1 or 0, @@ -77,7 +79,9 @@ local function configure_mesh(config, radio, index, suffix, disabled) uci:delete('network', name) uci:delete('wireless', name) - if config then + macaddr = util.generate_mac(3*index+1) + + if config and macaddr then uci:section('network', 'interface', name, { proto = 'batadv', @@ -92,7 +96,7 @@ local function configure_mesh(config, radio, index, suffix, disabled) mode = 'mesh', mesh_id = config.id, mesh_fwding = 0, - macaddr = util.generate_mac(5, index), + macaddr = macaddr, mcast_rate = config.mcast_rate, ifname = suffix and 'mesh' .. suffix, disabled = disabled and 1 or 0, 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 27c1935b..cbc9cd94 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 @@ -28,7 +28,7 @@ if sysconfig.lan_ifname and not uci:get('network', 'mesh_lan') then , proto = 'batadv' , mesh = 'bat0' , mesh_no_rebroadcast = '1' - , macaddr = util.generate_mac(1, 1) + , macaddr = util.generate_mac(6) , auto = enable and 1 or 0 }) diff --git a/package/gluon-mesh-vpn-fastd/files/lib/gluon/upgrade/400-mesh-vpn-fastd b/package/gluon-mesh-vpn-fastd/files/lib/gluon/upgrade/400-mesh-vpn-fastd index 902f1ccd..77f2e6f2 100755 --- a/package/gluon-mesh-vpn-fastd/files/lib/gluon/upgrade/400-mesh-vpn-fastd +++ b/package/gluon-mesh-vpn-fastd/files/lib/gluon/upgrade/400-mesh-vpn-fastd @@ -127,7 +127,7 @@ uci:section('network', 'interface', 'mesh_vpn', proto = 'batadv', mesh = 'bat0', mesh_no_rebroadcast = 1, - macaddr = util.generate_mac(4, 0), + macaddr = util.generate_mac(0), } ) From 937fe715c76258c2ba0e3335b8e3f7a6d58ee636 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 27 Apr 2016 12:20:27 +0200 Subject: [PATCH 384/867] gluon-mesh-batman-adv-core: make mesh_lan config a bridge There are a few devices which have more than one LAN interface (for example some revision of the TL-WR941ND, which uses a DSA-based switch, so each switch port has its own netdev.) On these devices we need a bridge for mesh-on-lan (as the alternative of adding them to batman-adv individually would need too many MAC addresses.) --- ...340-gluon-mesh-batman-adv-core-mesh-on-lan | 35 +++++++++++-------- 1 file changed, 21 insertions(+), 14 deletions(-) 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 cbc9cd94..99ca4213 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 @@ -7,7 +7,21 @@ local sysconfig = require 'gluon.sysconfig' local uci = require('luci.model.uci').cursor() local lutil = require 'luci.util' -if sysconfig.lan_ifname and not uci:get('network', 'mesh_lan') then +if not sysconfig.lan_ifname then + os.exit(0) +end + +uci:section('network', 'interface', 'mesh_lan', { + ifname = sysconfig.lan_ifname, + type = 'bridge', + igmp_snooping = 0, + proto = 'batadv', + mesh = 'bat0', + mesh_no_rebroadcast = '1', + macaddr = util.generate_mac(6), +}) + +if uci:get('network', 'mesh_lan', 'auto') == nil then local enable = site.mesh_on_lan if enable then @@ -15,22 +29,15 @@ if sysconfig.lan_ifname and not uci:get('network', 'mesh_lan') then if interfaces then for _, lanif in ipairs(lutil.split(sysconfig.lan_ifname, ' ')) do - if lutil.contains(interfaces, lanif) then - enable = false - break + if lutil.contains(interfaces, lanif) then + enable = false + break end end end end - uci:section('network', 'interface', 'mesh_lan', - { ifname = sysconfig.lan_ifname - , proto = 'batadv' - , mesh = 'bat0' - , mesh_no_rebroadcast = '1' - , macaddr = util.generate_mac(6) - , auto = enable and 1 or 0 - }) - - uci:save('network') + uci:set('network', 'mesh_lan', 'auto', enable and 1 or 0) end + +uci:save('network') From 269a8fbdd4aecad4d4fca0af59c1052d55f1e3f6 Mon Sep 17 00:00:00 2001 From: kb-light Date: Wed, 27 Apr 2016 12:37:30 +0200 Subject: [PATCH 385/867] gluon-config-mode-geo-location: add ability to hide the altitude field (#693) --- docs/index.rst | 1 + .../gluon-config-mode-geo-location.rst | 14 ++++++++ docs/site-example/site.conf | 7 ++++ .../gluon-config-mode-geo-location/Makefile | 5 +++ .../check_site.lua | 3 ++ .../config-mode/wizard/0400-geo-location.lua | 36 +++++++++++++------ .../gluon-config-mode-geo-location/i18n/de.po | 14 +++++--- .../gluon-config-mode-geo-location/i18n/fr.po | 13 ++++--- .../i18n/gluon-config-mode-geo-location.pot | 8 +++-- 9 files changed, 80 insertions(+), 21 deletions(-) create mode 100644 docs/package/gluon-config-mode-geo-location.rst create mode 100644 package/gluon-config-mode-geo-location/check_site.lua diff --git a/docs/index.rst b/docs/index.rst index 07777460..1b68d027 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -51,6 +51,7 @@ Packages :maxdepth: 1 package/gluon-client-bridge + package/gluon-config-mode-geo-location package/gluon-ebtables-filter-multicast package/gluon-ebtables-filter-ra-dhcp diff --git a/docs/package/gluon-config-mode-geo-location.rst b/docs/package/gluon-config-mode-geo-location.rst new file mode 100644 index 00000000..83ca238b --- /dev/null +++ b/docs/package/gluon-config-mode-geo-location.rst @@ -0,0 +1,14 @@ +gluon-config-mode-geo-location +============================== + +This package enables the user to set latitude, longitude and altitude of their +node within config mode. As the usage of the altitude is not well defined the +corresponding field can be disabled. + +site.conf +--------- + +config_mode.geo_location.show_altitude : optional + - ``true`` enables the altitude field + - ``false`` disables the altitude field if altitude has not yet been set + - defaults to ``true`` diff --git a/docs/site-example/site.conf b/docs/site-example/site.conf index acabadb2..45719b94 100644 --- a/docs/site-example/site.conf +++ b/docs/site-example/site.conf @@ -183,4 +183,11 @@ -- setup_mode = { -- skip = true, -- }, + + -- Show/hide the altitude field + -- config_mode = { + -- geo_location = { + -- show_altitude = false, + -- }, + -- }, } diff --git a/package/gluon-config-mode-geo-location/Makefile b/package/gluon-config-mode-geo-location/Makefile index 28d34764..03812e54 100644 --- a/package/gluon-config-mode-geo-location/Makefile +++ b/package/gluon-config-mode-geo-location/Makefile @@ -33,4 +33,9 @@ define Package/gluon-config-mode-geo-location/install $(call GluonInstallI18N,gluon-config-mode-geo-location,$(1)) endef +define Package/gluon-config-mode-geo-location/postinst +#!/bin/sh +$(call GluonCheckSite,check_site.lua) +endef + $(eval $(call BuildPackage,gluon-config-mode-geo-location)) diff --git a/package/gluon-config-mode-geo-location/check_site.lua b/package/gluon-config-mode-geo-location/check_site.lua new file mode 100644 index 00000000..509226fe --- /dev/null +++ b/package/gluon-config-mode-geo-location/check_site.lua @@ -0,0 +1,3 @@ +if need_table('config_mode', nil, false) and need_table('config_mode.geo_location', nil, false) then + need_boolean('config_mode.geo_location.show_altitude', false) +end diff --git a/package/gluon-config-mode-geo-location/files/lib/gluon/config-mode/wizard/0400-geo-location.lua b/package/gluon-config-mode-geo-location/files/lib/gluon/config-mode/wizard/0400-geo-location.lua index e8c9976d..9bc70301 100644 --- a/package/gluon-config-mode-geo-location/files/lib/gluon/config-mode/wizard/0400-geo-location.lua +++ b/package/gluon-config-mode-geo-location/files/lib/gluon/config-mode/wizard/0400-geo-location.lua @@ -1,14 +1,28 @@ local cbi = require "luci.cbi" local i18n = require "luci.i18n" local uci = luci.model.uci.cursor() +local site = require 'gluon.site_config' local M = {} +local function show_altitude() + if ((site.config_mode or {}).geo_location or {}).show_altitude ~= false then + return true + end + if uci:get_first("gluon-node-info", "location", "altitude") then + return true + end + return false +end + function M.section(form) - local s = form:section(cbi.SimpleSection, nil, i18n.translate( - 'If you want the location of your node to be displayed on the map, ' - .. 'you can enter its coordinates here. Specifying the altitude ' - .. 'is optional and should only be done if a proper value is known.')) + local text = i18n.translate('If you want the location of your node to ' + .. 'be displayed on the map, you can enter its coordinates here.') + if show_altitude() then + text = text .. ' ' .. i18n.translate('Specifying the altitude is ' + .. 'optional and should only be done if a proper value is known.') + end + local s = form:section(cbi.SimpleSection, nil, text) local o @@ -31,12 +45,14 @@ function M.section(form) o.datatype = "float" o.description = i18n.translatef("e.g. %s", "10.689901") - o = s:option(cbi.Value, "_altitude", i18n.translate("Altitude")) - o.default = uci:get_first("gluon-node-info", "location", "altitude") - o:depends("_location", "1") - o.rmempty = true - o.datatype = "float" - o.description = i18n.translatef("e.g. %s", "11.51") + if show_altitude() then + o = s:option(cbi.Value, "_altitude", i18n.translate("Altitude")) + o.default = uci:get_first("gluon-node-info", "location", "altitude") + o:depends("_location", "1") + o.rmempty = true + o.datatype = "float" + o.description = i18n.translatef("e.g. %s", "11.51") + end end diff --git a/package/gluon-config-mode-geo-location/i18n/de.po b/package/gluon-config-mode-geo-location/i18n/de.po index a2850d5b..3580732b 100644 --- a/package/gluon-config-mode-geo-location/i18n/de.po +++ b/package/gluon-config-mode-geo-location/i18n/de.po @@ -12,13 +12,17 @@ msgstr "" msgid "" "If you want the location of your node to be displayed on the map, you can " -"enter its coordinates here. Specifying the altitude is optional and should " -"only be done if a proper value is known." +"enter its coordinates here." msgstr "" "Um deinen Knoten auf der Karte anzeigen zu können, benötigen wir seine " -"Koordinaten. Hier hast du die Möglichkeit, diese zu hinterlegen. Die " -"Höhenangabe ist optional und sollte nur gesetzt werden, wenn ein exakter " -"Wert bekannt ist." +"Koordinaten. Hier hast du die Möglichkeit, diese zu hinterlegen." + +msgid "" +"Specifying the altitude is optional and should only be done if a proper " +"value is known." +msgstr "" +"Die Höhenangabe ist optional und sollte nur gesetzt werden, wenn ein " +"exakter Wert bekannt ist." msgid "Latitude" msgstr "Breitengrad" diff --git a/package/gluon-config-mode-geo-location/i18n/fr.po b/package/gluon-config-mode-geo-location/i18n/fr.po index 15d79e2b..b239c84c 100644 --- a/package/gluon-config-mode-geo-location/i18n/fr.po +++ b/package/gluon-config-mode-geo-location/i18n/fr.po @@ -12,12 +12,17 @@ msgstr "" msgid "" "If you want the location of your node to be displayed on the map, you can " -"enter its coordinates here. Specifying the altitude is optional and should " -"only be done if a proper value is known." +"enter its coordinates here." msgstr "" "Pour Afficher votre nœud sur la Carte nous avons besoin de ses coordonnées. " -"Ici vous pouvez entrer sa position. La altitude est optionelle " -"et ne devrait que être ajoutée si la valeur exacte est connue. " +"Ici vous pouvez entrer sa position." + +msgid "" +"Specifying the altitude is optional and should only be done if a proper " +"value is known." +msgstr "" +"La altitude est optionelle et ne devrait que être ajoutée si la valeur " +"exacte est connue." msgid "Latitude" msgstr "Latitude" diff --git a/package/gluon-config-mode-geo-location/i18n/gluon-config-mode-geo-location.pot b/package/gluon-config-mode-geo-location/i18n/gluon-config-mode-geo-location.pot index a2be4fdf..48f26f70 100644 --- a/package/gluon-config-mode-geo-location/i18n/gluon-config-mode-geo-location.pot +++ b/package/gluon-config-mode-geo-location/i18n/gluon-config-mode-geo-location.pot @@ -3,8 +3,12 @@ msgstr "Content-Type: text/plain; charset=UTF-8" msgid "" "If you want the location of your node to be displayed on the map, you can " -"enter its coordinates here. Specifying the altitude is optional and should " -"only be done if a proper value is known." +"enter its coordinates here." +msgstr "" + +msgid "" +"Specifying the altitude is optional and should only be done if a proper " +"value is known." msgstr "" msgid "Latitude" From d8092bce62a01a94a5c617294c96637237fb97e9 Mon Sep 17 00:00:00 2001 From: kb-light Date: Wed, 27 Apr 2016 17:08:42 +0200 Subject: [PATCH 386/867] gluon-config-mode-mesh-vpn: provide contact-information for reboot-message (#671) --- .../files/lib/gluon/config-mode/reboot/0100-mesh-vpn.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/gluon-config-mode-mesh-vpn/files/lib/gluon/config-mode/reboot/0100-mesh-vpn.lua b/package/gluon-config-mode-mesh-vpn/files/lib/gluon/config-mode/reboot/0100-mesh-vpn.lua index 9bd31486..c6e06975 100644 --- a/package/gluon-config-mode-mesh-vpn/files/lib/gluon/config-mode/reboot/0100-mesh-vpn.lua +++ b/package/gluon-config-mode-mesh-vpn/files/lib/gluon/config-mode/reboot/0100-mesh-vpn.lua @@ -11,6 +11,7 @@ else local pubkey = util.trim(util.exec("/etc/init.d/fastd show_key " .. "mesh_vpn")) local hostname = uci:get_first("system", "system", "hostname") + local contact = uci:get_first("gluon-node-info", "owner", "contact") local msg = i18n.translate('gluon-config-mode:pubkey') @@ -19,6 +20,7 @@ else , hostname=hostname , site=site , sysconfig=sysconfig + , contact=contact }) end end From 9b63127aa55fea47135b6dc4a4e3d459d30fd1cf Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 27 Apr 2016 20:27:26 +0200 Subject: [PATCH 387/867] build: fix race condition on `make clean` without preceeding normal make --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 88fc8345..90ea36f3 100644 --- a/Makefile +++ b/Makefile @@ -298,7 +298,8 @@ prepare-target: $(GLUON_OPKG_KEY).pub $(target_prepared_stamp): +$(GLUONMAKE_EARLY) prepare-target -maybe-prepare-target: $(GLUON_OPKG_KEY).pub $(target_prepared_stamp) +maybe-prepare-target: $(target_prepared_stamp) + +$(GLUONMAKE_EARLY) $(GLUON_OPKG_KEY).pub $(BUILD_DIR)/.prepared: Makefile @mkdir -p $$(dirname $@) From d77bfe9da9214b93e35c89687b32dc856a3ef7ed Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 27 Apr 2016 21:07:46 +0200 Subject: [PATCH 388/867] gluon-mesh-batman-adv-core: fix rssid for setups without 11s --- .../lib/gluon/upgrade/350-gluon-mesh-batman-adv-core-rssid | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-core-rssid b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-core-rssid index 10b67171..b6b16574 100755 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-core-rssid +++ b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-core-rssid @@ -3,7 +3,11 @@ local uci = require('luci.model.uci').cursor() if uci:get('system', 'rssid_wlan0') then - uci:set('system', 'rssid_wlan0', 'dev', 'mesh0') + if uci:get('wireless', 'mesh_radio0') then + uci:set('system', 'rssid_wlan0', 'dev', 'mesh0') + else + uci:set('system', 'rssid_wlan0', 'dev', 'ibss0') + end uci:save('system') end From 32f40303f0fb660ecadc4f50807f834a31bd2c44 Mon Sep 17 00:00:00 2001 From: lemoer Date: Wed, 27 Apr 2016 22:48:18 +0200 Subject: [PATCH 389/867] build: fix inconsistent handling of BROKEN variable. --- targets/ar71xx-generic/profiles.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index dd3aa2cb..df92ac28 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -65,7 +65,7 @@ $(eval $(call GluonModel,TLWR841,tl-wr841-v7,tp-link-tl-wr841n-nd-v7)) $(eval $(call GluonModel,TLWR841,tl-wr841-v8,tp-link-tl-wr841n-nd-v8)) $(eval $(call GluonModel,TLWR841,tl-wr841-v9,tp-link-tl-wr841n-nd-v9)) $(eval $(call GluonModel,TLWR841,tl-wr841-v10,tp-link-tl-wr841n-nd-v10)) -ifeq ($(BROKEN),1) +ifneq ($(BROKEN),) $(eval $(call GluonModel,TLWR841,tl-wr841-v11,tp-link-tl-wr841n-nd-v11)) # BROKEN: untested endif @@ -152,7 +152,7 @@ $(eval $(call GluonModel,TLMR3420,tl-mr3420-v2,tp-link-tl-mr3420-v2)) $(eval $(call GluonProfile,TLWR2543)) $(eval $(call GluonModel,TLWR2543,tl-wr2543-v1,tp-link-tl-wr2543n-nd-v1)) -ifeq ($(BROKEN),1) +ifneq ($(BROKEN),) # Archer C5 v1, C7 v2 $(eval $(call GluonProfile,ARCHERC7,kmod-ath10k ath10k-firmware-qca988x-ct)) $(eval $(call GluonModel,ARCHERC7,archer-c5,tp-link-archer-c5-v1)) # BROKEN: ath10k @@ -184,7 +184,7 @@ $(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) +ifneq ($(BROKEN),) $(eval $(call GluonModel,UBNT,ubnt-ls-sr71,ubiquiti-ls-sr71)) # BROKEN: Untested $(eval $(call GluonModel,UBNT,ubnt-rocket-m-xw,ubiquiti-rocket-m-xw)) # BROKEN: Untested endif @@ -249,7 +249,7 @@ $(eval $(call GluonProfileFactorySuffix,WNDR3700,-squashfs-factory,.img)) $(eval $(call GluonModel,WNDR3700,wndr3700,netgear-wndr3700)) $(eval $(call GluonModel,WNDR3700,wndr3700v2,netgear-wndr3700v2)) $(eval $(call GluonModel,WNDR3700,wndr3800,netgear-wndr3800)) -ifeq ($(BROKEN),1) +ifneq ($(BROKEN),) $(eval $(call GluonModel,WNDR3700,wndrmac,netgear-wndrmac)) # BROKEN: untested endif $(eval $(call GluonModel,WNDR3700,wndrmacv2,netgear-wndrmacv2)) From f68a5662b6fb9361e4f4f815abf9c152fb3c870b Mon Sep 17 00:00:00 2001 From: kb-light Date: Thu, 28 Apr 2016 09:34:33 +0200 Subject: [PATCH 390/867] gluon-node-info: add a script to fix whitespaces within the coordinates Signed-off-by: kb-light --- .../lib/gluon/upgrade/520-node-info-whitespace-fix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 package/gluon-node-info/files/lib/gluon/upgrade/520-node-info-whitespace-fix diff --git a/package/gluon-node-info/files/lib/gluon/upgrade/520-node-info-whitespace-fix b/package/gluon-node-info/files/lib/gluon/upgrade/520-node-info-whitespace-fix new file mode 100755 index 00000000..49e7053d --- /dev/null +++ b/package/gluon-node-info/files/lib/gluon/upgrade/520-node-info-whitespace-fix @@ -0,0 +1,14 @@ +#!/usr/bin/lua +local uci = require('luci.model.uci').cursor() + +local sname = uci:get_first('gluon-node-info', 'location') +if sname then + local options = {'longitude', 'latitude', 'altitude'} + for _, option in ipairs(options) do + local value = uci:get('gluon-node-info', sname, option) + if value then + uci:set('gluon-node-info', sname, option, value:trim()) + end + end + uci:save('gluon-node-info') +end From 086a10676d83fa897f8d42de97ab6953548aa9cb Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 25 Apr 2016 10:17:06 +0200 Subject: [PATCH 391/867] docs, README: Gluon v2016.1.4 --- README.md | 2 +- docs/index.rst | 1 + docs/releases/v2016.1.4.rst | 46 +++++++++++++++++++++++++++++++++++ docs/user/getting_started.rst | 4 +-- 4 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 docs/releases/v2016.1.4.rst diff --git a/README.md b/README.md index cf4b7bbf..72113cb0 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 v2016.1.3 && make update`. +and switch to one by running `git checkout v2016.1.4 && 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/index.rst b/docs/index.rst index 1b68d027..33c430e5 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -61,6 +61,7 @@ Releases .. toctree:: :maxdepth: 1 + releases/v2016.1.4 releases/v2016.1.3 releases/v2016.1.2 releases/v2016.1.1 diff --git a/docs/releases/v2016.1.4.rst b/docs/releases/v2016.1.4.rst new file mode 100644 index 00000000..0d8d2019 --- /dev/null +++ b/docs/releases/v2016.1.4.rst @@ -0,0 +1,46 @@ +Gluon 2016.1.4 +============== + +Added hardware support +~~~~~~~~~~~~~~~~~~~~~~ + +ar71xx-generic +^^^^^^^^^^^^^^ + +* 8devices Carambola 2 +* Meraki MR12/MR62/MR16/MR66 + +Bugfixes +~~~~~~~~ + +* Major update of all WLAN drivers + + We've taken the unusual step of updating the WLAN drivers ("wireless-backports") to a much newer version, as + it was reported that the new version fixes unstable WLAN seen in many setups +* Build fix: a race condition causing parallel builds to fail has been fixed +* Build fix: the Gluon tree could get into a state in which all commands fail with "Too many levels of symbolic links" +* Build fix: allow building Gluon on systems with certain versions of *dash* as */bin/sh* + +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. + +* 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 API (`#522 `_) + + The current API is inconsistent and will be replaced eventually. The old API will still be supported for a while. + +* Unwritable flash on some Ubiquiti PicoStations (`#687 `_) + + Gluon v2016.1.1 added support for Ubiquiti AirMAX devices with AirOS 5.6.x without downgrading AirOS first before + flashing Gluon. It was discovered that on Ubiquiti PicoStations, this downgrade is still necessary, as the + flash is not correctly unlocked, leaving the device unable to leave Config Mode and making regular sysupgrades + impossible. + + TFTP recovery can be used in this state to flash a new firmware. diff --git a/docs/user/getting_started.rst b/docs/user/getting_started.rst index 0d54eda0..6c614d70 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. *v2016.1.3*. Always get Gluon using git and don't try to download it +e.g. *v2016.1.4*. 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. *v2016.1.3*. +version you'd like to checkout, e.g. *v2016.1.4*. :: From ce563f25adf08d6284ea92c81b6d30c0601df3b8 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 29 Apr 2016 17:44:04 +0200 Subject: [PATCH 392/867] ar71xx-generic: remove BROKEN for TL-WR841N/ND v11 --- docs/index.rst | 2 +- targets/ar71xx-generic/profiles.mk | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 33c430e5..f6dcd4cd 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -158,7 +158,7 @@ ar71xx-generic - 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-WR841N/ND (v3, v5, v7, v8, v9, v10, v11) - TL-WR842N/ND (v1, v2) - TL-WR843N/ND (v1) - TL-WR940N (v1, v2, v3) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index df92ac28..c5f76daf 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -65,9 +65,7 @@ $(eval $(call GluonModel,TLWR841,tl-wr841-v7,tp-link-tl-wr841n-nd-v7)) $(eval $(call GluonModel,TLWR841,tl-wr841-v8,tp-link-tl-wr841n-nd-v8)) $(eval $(call GluonModel,TLWR841,tl-wr841-v9,tp-link-tl-wr841n-nd-v9)) $(eval $(call GluonModel,TLWR841,tl-wr841-v10,tp-link-tl-wr841n-nd-v10)) -ifneq ($(BROKEN),) -$(eval $(call GluonModel,TLWR841,tl-wr841-v11,tp-link-tl-wr841n-nd-v11)) # BROKEN: untested -endif +$(eval $(call GluonModel,TLWR841,tl-wr841-v11,tp-link-tl-wr841n-nd-v11)) # TL-WR842N/ND v1, v2 $(eval $(call GluonProfile,TLWR842)) From 7fd60ac48a0b31042f4e936113f630ba501a8243 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 29 Apr 2016 17:54:12 +0200 Subject: [PATCH 393/867] Update OpenWrt base This also reverts commit 24d8695d8ceeb09d6c84bcd6ee4ffe087c9b386b... --- modules | 2 +- .../0014-fix-UBNT-XM-model-detection.patch | 2 +- ...HWREV-on-upgrades-of-TP-LINK-devices.patch | 4 +- ...a-space-on-some-TP-LINK-like-devices.patch | 2 +- ...XX_MODEL-to-match-labels-image-names.patch | 2 +- ...r71xx-build-image-for-TL-WR710N-v2.1.patch | 2 +- ...-ar71xx-Add-TL-WR841N-ND-v11-support.patch | 43 ------------------- targets/ar71xx-generic/profiles.mk | 16 +++---- 8 files changed, 15 insertions(+), 58 deletions(-) delete mode 100644 patches/openwrt/0031-ar71xx-Add-TL-WR841N-ND-v11-support.patch diff --git a/modules b/modules index ffccb902..8159d364 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=ba0cac08164150e74567787251e44b4d0d0dc140 +OPENWRT_COMMIT=eadf19c0b43d2f75f196ea8d875a08c7c348530c PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git PACKAGES_OPENWRT_COMMIT=9622fe984bba3a4547f48bc507ebaba7637eb2b0 diff --git a/patches/openwrt/0014-fix-UBNT-XM-model-detection.patch b/patches/openwrt/0014-fix-UBNT-XM-model-detection.patch index 79180b40..08240588 100644 --- a/patches/openwrt/0014-fix-UBNT-XM-model-detection.patch +++ b/patches/openwrt/0014-fix-UBNT-XM-model-detection.patch @@ -5,7 +5,7 @@ Subject: fix UBNT XM model detection Signed-off-by: Neal Oakey diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh -index 5768286..7f50d8a 100755 +index dab4d2c..e7b3cd2 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -64,6 +64,40 @@ wndr3700_board_detect() { diff --git a/patches/openwrt/0021-ar71xx-check-both-HWID-and-HWREV-on-upgrades-of-TP-LINK-devices.patch b/patches/openwrt/0021-ar71xx-check-both-HWID-and-HWREV-on-upgrades-of-TP-LINK-devices.patch index 416de969..77b47675 100644 --- a/patches/openwrt/0021-ar71xx-check-both-HWID-and-HWREV-on-upgrades-of-TP-LINK-devices.patch +++ b/patches/openwrt/0021-ar71xx-check-both-HWID-and-HWREV-on-upgrades-of-TP-LINK-devices.patch @@ -10,7 +10,7 @@ Signed-off-by: Matthias Schiffer Backport of r49105 diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh -index 2fc1d10..420b794 100755 +index d025632..c5c1871 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -66,6 +66,10 @@ tplink_get_image_hwid() { @@ -24,7 +24,7 @@ index 2fc1d10..420b794 100755 tplink_get_image_boot_size() { get_image "$@" | dd bs=4 count=1 skip=37 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"' } -@@ -365,13 +369,17 @@ platform_check_image() { +@@ -366,13 +370,17 @@ platform_check_image() { } local hwid diff --git a/patches/openwrt/0022-ar71xx-avoid-AR71XX_MODEL-ending-with-a-space-on-some-TP-LINK-like-devices.patch b/patches/openwrt/0022-ar71xx-avoid-AR71XX_MODEL-ending-with-a-space-on-some-TP-LINK-like-devices.patch index 520b1d7a..70b3a004 100644 --- a/patches/openwrt/0022-ar71xx-avoid-AR71XX_MODEL-ending-with-a-space-on-some-TP-LINK-like-devices.patch +++ b/patches/openwrt/0022-ar71xx-avoid-AR71XX_MODEL-ending-with-a-space-on-some-TP-LINK-like-devices.patch @@ -11,7 +11,7 @@ Signed-off-by: Matthias Schiffer Backport of r49106 diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh -index 7f50d8a..9d650a1 100755 +index e7b3cd2..180a075 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -133,7 +133,7 @@ tplink_board_detect() { diff --git a/patches/openwrt/0023-ar71xx-fix-the-revision-of-a-few-TP-LINK-devices-in-AR71XX_MODEL-to-match-labels-image-names.patch b/patches/openwrt/0023-ar71xx-fix-the-revision-of-a-few-TP-LINK-devices-in-AR71XX_MODEL-to-match-labels-image-names.patch index e7d1ad12..9330e547 100644 --- a/patches/openwrt/0023-ar71xx-fix-the-revision-of-a-few-TP-LINK-devices-in-AR71XX_MODEL-to-match-labels-image-names.patch +++ b/patches/openwrt/0023-ar71xx-fix-the-revision-of-a-few-TP-LINK-devices-in-AR71XX_MODEL-to-match-labels-image-names.patch @@ -12,7 +12,7 @@ Signed-off-by: Matthias Schiffer Backport of r49107 diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh -index 9d650a1..52ca255 100755 +index 180a075..ddd6611 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -162,6 +162,10 @@ tplink_board_detect() { diff --git a/patches/openwrt/0024-ar71xx-build-image-for-TL-WR710N-v2.1.patch b/patches/openwrt/0024-ar71xx-build-image-for-TL-WR710N-v2.1.patch index 99e1e9ce..5a225d7d 100644 --- a/patches/openwrt/0024-ar71xx-build-image-for-TL-WR710N-v2.1.patch +++ b/patches/openwrt/0024-ar71xx-build-image-for-TL-WR710N-v2.1.patch @@ -11,7 +11,7 @@ Signed off by: Norbert Wegener Backport of r47849 diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile -index 1a399ab..9ac405c 100644 +index 9a7acbd..d42ceef 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile @@ -476,6 +476,15 @@ define Device/tl-wr710n-v2 diff --git a/patches/openwrt/0031-ar71xx-Add-TL-WR841N-ND-v11-support.patch b/patches/openwrt/0031-ar71xx-Add-TL-WR841N-ND-v11-support.patch deleted file mode 100644 index d4c406f0..00000000 --- a/patches/openwrt/0031-ar71xx-Add-TL-WR841N-ND-v11-support.patch +++ /dev/null @@ -1,43 +0,0 @@ -From: Matthias Schiffer -Date: Mon, 25 Apr 2016 18:07:13 +0200 -Subject: ar71xx: Add TL-WR841N/ND v11 support - -This patch adds support for the TP-Link TL-WR841N/ND to trunk. It is -similar to the already supported v10 - see [1]. I have added support -based on that topic; in the meantime it has been confirmed working -(see the forum thread, and also [2]). - -Signed-off by Stijn Segers - -[1]: https://forum.openwrt.org/viewtopic.php?id=61309 -[2]: https://forum.openwrt.org/viewtopic.php?id=63657 - -Backport of r49099 - -diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile -index 9ac405c..1b4e6db 100644 ---- a/target/linux/ar71xx/image/Makefile -+++ b/target/linux/ar71xx/image/Makefile -@@ -578,6 +578,13 @@ define Device/tl-wr841-v10 - TPLINK_HWID := 0x08410010 - endef - -+define Device/tl-wr841-v11 -+ $(Device/tplink-4mlzma) -+ BOARDNAME := TL-WR841N-v9 -+ DEVICE_PROFILE := TLWR841 -+ TPLINK_HWID := 0x08410011 -+endef -+ - define Device/tl-wr842n-v2 - $(Device/tplink-8mlzma) - BOARDNAME := TL-WR842N-v2 -@@ -598,7 +605,7 @@ define Device/tl-wr847n-v8 - DEVICE_PROFILE := TLWR841 - TPLINK_HWID := 0x08470008 - endef --TARGET_DEVICES += tl-wr841-v8 tl-wr841-v9 tl-wr841-v10 tl-wr842n-v2 tl-wr843nd-v1 tl-wr847n-v8 -+TARGET_DEVICES += tl-wr841-v8 tl-wr841-v9 tl-wr841-v10 tl-wr841-v11 tl-wr842n-v2 tl-wr843nd-v1 tl-wr847n-v8 - - define Device/tl-wr941nd-v5 - $(Device/tplink-4mlzma) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index c5f76daf..1d908432 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -16,7 +16,7 @@ $(eval $(call GluonModelAlias,CPE510,tp-link-cpe510-v1.0,tp-link-cpe520-v1.1)) # TL-WA701N/ND v1, v2 $(eval $(call GluonProfile,TLWA701)) -$(eval $(call GluonModel,TLWA701,tl-wa701nd-v1,tp-link-tl-wa701n-nd-v1)) +$(eval $(call GluonModel,TLWA701,tl-wa701n-v1,tp-link-tl-wa701n-nd-v1)) $(eval $(call GluonModel,TLWA701,tl-wa701nd-v2,tp-link-tl-wa701n-nd-v2)) # TL-WA7510 v1 @@ -59,13 +59,13 @@ $(eval $(call GluonModel,TLWA801,tl-wa801nd-v2,tp-link-tl-wa801n-nd-v2)) # TL-WR841N/ND v3, v5, v7, v8, v9, v10, v11 $(eval $(call GluonProfile,TLWR841)) -$(eval $(call GluonModel,TLWR841,tl-wr841-v3,tp-link-tl-wr841n-nd-v3)) -$(eval $(call GluonModel,TLWR841,tl-wr841-v5,tp-link-tl-wr841n-nd-v5)) -$(eval $(call GluonModel,TLWR841,tl-wr841-v7,tp-link-tl-wr841n-nd-v7)) -$(eval $(call GluonModel,TLWR841,tl-wr841-v8,tp-link-tl-wr841n-nd-v8)) -$(eval $(call GluonModel,TLWR841,tl-wr841-v9,tp-link-tl-wr841n-nd-v9)) -$(eval $(call GluonModel,TLWR841,tl-wr841-v10,tp-link-tl-wr841n-nd-v10)) -$(eval $(call GluonModel,TLWR841,tl-wr841-v11,tp-link-tl-wr841n-nd-v11)) +$(eval $(call GluonModel,TLWR841,tl-wr841nd-v3,tp-link-tl-wr841n-nd-v3)) +$(eval $(call GluonModel,TLWR841,tl-wr841nd-v5,tp-link-tl-wr841n-nd-v5)) +$(eval $(call GluonModel,TLWR841,tl-wr841nd-v7,tp-link-tl-wr841n-nd-v7)) +$(eval $(call GluonModel,TLWR841,tl-wr841n-v8,tp-link-tl-wr841n-nd-v8)) +$(eval $(call GluonModel,TLWR841,tl-wr841n-v9,tp-link-tl-wr841n-nd-v9)) +$(eval $(call GluonModel,TLWR841,tl-wr841n-v10,tp-link-tl-wr841n-nd-v10)) +$(eval $(call GluonModel,TLWR841,tl-wr841n-v11,tp-link-tl-wr841n-nd-v11)) # TL-WR842N/ND v1, v2 $(eval $(call GluonProfile,TLWR842)) From 794738b26883087935d48f8491b6a1ca5e0fbe7b Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 29 Apr 2016 18:33:52 +0200 Subject: [PATCH 394/867] ar71xx-generic: add support for TP-LINK TL-WA901ND v4 Fixes #731 --- targets/ar71xx-generic/profiles.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 1d908432..d161e15a 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -117,11 +117,14 @@ $(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 v1, v2, v3 +# TL-WA901N/ND v1, v2, v3, v4 $(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)) $(eval $(call GluonModel,TLWA901,tl-wa901nd-v3,tp-link-tl-wa901n-nd-v3)) +ifneq ($(BROKEN),) +$(eval $(call GluonModel,TLWA901,tl-wa901nd-v4,tp-link-tl-wa901n-nd-v4)) # BROKEN: untested +endif # TL-MR13U v1 $(eval $(call GluonProfile,TLMR13U)) From 46991e927f5069b3976768b04c2a02aacea2fc97 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Mon, 2 May 2016 11:27:05 +0200 Subject: [PATCH 395/867] Update Gluon packages --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 8159d364..2a52cdf1 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=9134a42c9347c4216058cbbabc93145405c062db +PACKAGES_GLUON_COMMIT=087eef9e684fdef066e63c8f64dddfbfd02141a5 PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_COMMIT=2a8338559de5c4b077cde7a83f43f4700a17d5cc From d79bc0b39891f201f33390e61c9da7a7d1096bcb Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 3 May 2016 19:30:43 +0200 Subject: [PATCH 396/867] README: add Roadmap link --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 72113cb0..321817b6 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,9 @@ 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. +We maintain a [Roadmap](https://github.com/freifunk-gluon/gluon/wiki/Roadmap) for +the future development of Gluon. + ## Use a release! Please refrain from using the `master` branch for anything else but development purposes! From 80d5f5f995f131ce1444587318e544bfca337b0d Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 5 May 2016 22:23:24 +0200 Subject: [PATCH 397/867] netifd: update and revert problematic patch Fixes VLANs with shell protos on top of WLAN devices. Fixes #754 --- ...7-netifd-update-to-latest-git-master.patch | 133 +++++++++++++++++- 1 file changed, 130 insertions(+), 3 deletions(-) diff --git a/patches/openwrt/0017-netifd-update-to-latest-git-master.patch b/patches/openwrt/0017-netifd-update-to-latest-git-master.patch index 3a173661..8128cfb0 100644 --- a/patches/openwrt/0017-netifd-update-to-latest-git-master.patch +++ b/patches/openwrt/0017-netifd-update-to-latest-git-master.patch @@ -3,7 +3,7 @@ Date: Wed, 9 Mar 2016 06:46:44 +0100 Subject: netifd: update to latest git master diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile -index 619024b..f7563d5 100644 +index 619024b..84a4592 100644 --- a/package/network/config/netifd/Makefile +++ b/package/network/config/netifd/Makefile @@ -1,13 +1,13 @@ @@ -11,7 +11,7 @@ index 619024b..f7563d5 100644 PKG_NAME:=netifd -PKG_VERSION:=2015-12-16 -+PKG_VERSION:=2016-03-07 ++PKG_VERSION:=2016-03-31 PKG_RELEASE=$(PKG_SOURCE_VERSION) PKG_SOURCE_PROTO:=git @@ -19,7 +19,7 @@ index 619024b..f7563d5 100644 +PKG_SOURCE_URL=$(OPENWRT_GIT)/project/netifd.git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_VERSION:=245527193e90906451be35c2b8e972b8712ea6ab -+PKG_SOURCE_VERSION:=bd1ee3efb46ae013d81b1aec51668e7595274e69 ++PKG_SOURCE_VERSION:=6fd6be6b7f3fc4883fdc464fcbcb2b5e8d8e8174 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz PKG_MAINTAINER:=Felix Fietkau # PKG_MIRROR_MD5SUM:= @@ -53,3 +53,130 @@ index af3aaa8..5515b91 100755 for dev in $(echo "$radio_devs" | sort -u); do /sbin/wifi up "$dev" done +diff --git a/package/network/config/netifd/patches/0001-Revert-device-Don-t-process-link-events-anymore-in-d.patch b/package/network/config/netifd/patches/0001-Revert-device-Don-t-process-link-events-anymore-in-d.patch +new file mode 100644 +index 0000000..312964f +--- /dev/null ++++ b/package/network/config/netifd/patches/0001-Revert-device-Don-t-process-link-events-anymore-in-d.patch +@@ -0,0 +1,121 @@ ++From e0f19fdae88f3ef505e22533915f8328f4793980 Mon Sep 17 00:00:00 2001 ++Message-Id: ++From: Matthias Schiffer ++Date: Thu, 5 May 2016 21:49:33 +0200 ++Subject: [PATCH] Revert "device: Don't process link events anymore in device ++ user specific callback handlers" ++ ++This reverts commit 4902ba2999dec02e82066d70ab6096b852a33007. ++--- ++ device.h | 2 ++ ++ macvlan.c | 8 ++++++++ ++ system-linux.c | 2 +- ++ vlan.c | 6 ++++++ ++ vlandev.c | 8 ++++++++ ++ 5 files changed, 25 insertions(+), 1 deletion(-) ++ ++diff --git a/device.h b/device.h ++index ac77cfb..ef1c608 100644 ++--- a/device.h +++++ b/device.h ++@@ -59,6 +59,8 @@ struct device_type { ++ struct list_head list; ++ const char *name; ++ +++ bool keep_link_status; +++ ++ const struct uci_blob_param_list *config_params; ++ ++ struct device *(*create)(const char *name, struct blob_attr *attr); ++diff --git a/macvlan.c b/macvlan.c ++index a0f11ae..051fe05 100644 ++--- a/macvlan.c +++++ b/macvlan.c ++@@ -72,6 +72,12 @@ macvlan_base_cb(struct device_user *dev, enum device_event ev) ++ case DEV_EVENT_REMOVE: ++ device_set_present(&mvdev->dev, false); ++ break; +++ case DEV_EVENT_LINK_UP: +++ device_set_link(&mvdev->dev, true); +++ break; +++ case DEV_EVENT_LINK_DOWN: +++ device_set_link(&mvdev->dev, false); +++ break; ++ default: ++ return; ++ } ++@@ -255,6 +261,8 @@ macvlan_create(const char *name, struct blob_attr *attr) ++ const struct device_type macvlan_device_type = { ++ .name = "MAC VLAN", ++ .config_params = &macvlan_attr_list, +++ .keep_link_status = true, +++ ++ .create = macvlan_create, ++ .config_init = macvlan_config_init, ++ .reload = macvlan_reload, ++diff --git a/system-linux.c b/system-linux.c ++index 351a994..794c1dd 100644 ++--- a/system-linux.c +++++ b/system-linux.c ++@@ -464,7 +464,7 @@ static int cb_rtnl_event(struct nl_msg *msg, void *arg) ++ goto out; ++ ++ struct device *dev = device_get(nla_data(nla[IFLA_IFNAME]), false); ++- if (!dev) +++ if (!dev || dev->type->keep_link_status) ++ goto out; ++ ++ if (!system_get_dev_sysctl("/sys/class/net/%s/carrier", dev->ifname, buf, sizeof(buf))) ++diff --git a/vlan.c b/vlan.c ++index ac434ce..8d93799 100644 ++--- a/vlan.c +++++ b/vlan.c ++@@ -79,6 +79,11 @@ static void vlan_dev_cb(struct device_user *dep, enum device_event ev) ++ case DEV_EVENT_REMOVE: ++ device_set_present(&vldev->dev, new_state); ++ break; +++ case DEV_EVENT_LINK_UP: +++ new_state = true; +++ case DEV_EVENT_LINK_DOWN: +++ device_set_link(&vldev->dev, new_state); +++ break; ++ case DEV_EVENT_UPDATE_IFNAME: ++ vlan_dev_set_name(vldev, dep->dev); ++ device_broadcast_event(&vldev->dev, ev); ++@@ -97,6 +102,7 @@ static struct device *get_vlan_device(struct device *dev, int id, bool create) ++ static const struct device_type vlan_type = { ++ .name = "VLAN", ++ .config_params = &device_attr_list, +++ .keep_link_status = true, ++ .free = free_vlan_if, ++ }; ++ struct vlan_device *vldev; ++diff --git a/vlandev.c b/vlandev.c ++index b93527c..884e6ef 100644 ++--- a/vlandev.c +++++ b/vlandev.c ++@@ -63,6 +63,12 @@ vlandev_base_cb(struct device_user *dev, enum device_event ev) ++ case DEV_EVENT_REMOVE: ++ device_set_present(&mvdev->dev, false); ++ break; +++ case DEV_EVENT_LINK_UP: +++ device_set_link(&mvdev->dev, true); +++ break; +++ case DEV_EVENT_LINK_DOWN: +++ device_set_link(&mvdev->dev, false); +++ break; ++ default: ++ return; ++ } ++@@ -243,6 +249,8 @@ vlandev_create(const char *name, struct blob_attr *attr) ++ const struct device_type vlandev_device_type = { ++ .name = "VLANDEV", ++ .config_params = &vlandev_attr_list, +++ .keep_link_status = true, +++ ++ .create = vlandev_create, ++ .config_init = vlandev_config_init, ++ .reload = vlandev_reload, ++-- ++2.8.2 ++ From fdc43ff7210155ac1fc306751f10b0bb6ccbcc25 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 6 May 2016 20:10:25 +0200 Subject: [PATCH 398/867] ar71xx-generic: remove BROKEN for Ubiquiti Rocket M XW --- targets/ar71xx-generic/profiles.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index d161e15a..48e7f422 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -180,6 +180,7 @@ $(eval $(call GluonModelAlias,UBNT,ubiquiti-nanostation-m,ubiquiti-nanostation-m $(eval $(call GluonModel,UBNT,ubnt-loco-m-xw,ubiquiti-loco-m-xw)) $(eval $(call GluonModel,UBNT,ubnt-nano-m-xw,ubiquiti-nanostation-m-xw)) +$(eval $(call GluonModel,UBNT,ubnt-rocket-m-xw,ubiquiti-rocket-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)) @@ -187,7 +188,6 @@ $(eval $(call GluonModel,UBNT,ubnt-unifi-outdoor-plus,ubiquiti-unifiap-outdoor+) ifneq ($(BROKEN),) $(eval $(call GluonModel,UBNT,ubnt-ls-sr71,ubiquiti-ls-sr71)) # BROKEN: Untested -$(eval $(call GluonModel,UBNT,ubnt-rocket-m-xw,ubiquiti-rocket-m-xw)) # BROKEN: Untested endif From 8bd0ecd9b30c100e9d77370eda3c653e982176fd Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 6 May 2016 20:16:44 +0200 Subject: [PATCH 399/867] docs: clean up and update Ubiquiti hardware support list --- docs/index.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index f6dcd4cd..ff692844 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -171,11 +171,13 @@ ar71xx-generic - Air Gateway - Air Router - Bullet M + - Loco M + - Loco M XW - Nanostation M - Nanostation M XW - - Loco M XW - Picostation M - Rocket M + - Rocket M XW - UniFi AP - UniFi AP Pro - UniFi AP Outdoor From 40d087de848be28ad456777a727177f7b31334ff Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 7 May 2016 00:48:34 +0200 Subject: [PATCH 400/867] kernel: backport spi-nor driver from 4.4.9 Fixes #687 --- ...ort-LibreSSL-as-provider-of-openssl.patch} | 0 ...tection-for-Winbond-flash-at-startup.patch | 94 - ...WREV-on-upgrades-of-TP-LINK-devices.patch} | 0 ...-space-on-some-TP-LINK-like-devices.patch} | 0 ...X_MODEL-to-match-labels-image-names.patch} | 0 ...71xx-build-image-for-TL-WR710N-v2.1.patch} | 0 ...gure-compatiblity-with-POSIX-shells.patch} | 0 ...as-only-added-in-the-latest-version.patch} | 0 ...ompile-flock-before-everything-else.patch} | 0 ...fall-back-to-unlocked-shell-command.patch} | 0 ...e-conditions-with-multiple-variants.patch} | 0 ...x-packed-checkout-mirroring-support.patch} | 0 ...l-backport-spi-nor-driver-from-4.4.9.patch | 2012 +++++++++++++++++ ...til-status-register-writes-are-ready.patch | 115 + ...el-mtd-spi-nor-unlock-Winbond-flashs.patch | 56 + 15 files changed, 2183 insertions(+), 94 deletions(-) rename patches/openwrt/{0020-Support-LibreSSL-as-provider-of-openssl.patch => 0019-Support-LibreSSL-as-provider-of-openssl.patch} (100%) delete mode 100644 patches/openwrt/0019-generic-mtd-spi-nor-disable-protection-for-Winbond-flash-at-startup.patch rename patches/openwrt/{0021-ar71xx-check-both-HWID-and-HWREV-on-upgrades-of-TP-LINK-devices.patch => 0020-ar71xx-check-both-HWID-and-HWREV-on-upgrades-of-TP-LINK-devices.patch} (100%) rename patches/openwrt/{0022-ar71xx-avoid-AR71XX_MODEL-ending-with-a-space-on-some-TP-LINK-like-devices.patch => 0021-ar71xx-avoid-AR71XX_MODEL-ending-with-a-space-on-some-TP-LINK-like-devices.patch} (100%) rename patches/openwrt/{0023-ar71xx-fix-the-revision-of-a-few-TP-LINK-devices-in-AR71XX_MODEL-to-match-labels-image-names.patch => 0022-ar71xx-fix-the-revision-of-a-few-TP-LINK-devices-in-AR71XX_MODEL-to-match-labels-image-names.patch} (100%) rename patches/openwrt/{0024-ar71xx-build-image-for-TL-WR710N-v2.1.patch => 0023-ar71xx-build-image-for-TL-WR710N-v2.1.patch} (100%) rename patches/openwrt/{0025-xtables-addons-build-fix-configure-compatiblity-with-POSIX-shells.patch => 0024-xtables-addons-build-fix-configure-compatiblity-with-POSIX-shells.patch} (100%) rename patches/openwrt/{0026-tools-add-tar-host-build-required-for-sort-name-which-was-only-added-in-the-latest-version.patch => 0025-tools-add-tar-host-build-required-for-sort-name-which-was-only-added-in-the-latest-version.patch} (100%) rename patches/openwrt/{0027-tools-compile-flock-before-everything-else.patch => 0026-tools-compile-flock-before-everything-else.patch} (100%) rename patches/openwrt/{0028-rules.mk-make-the-locked-template-available-even-if-flock-has-not-been-built-yet-fall-back-to-unlocked-shell-command.patch => 0027-rules.mk-make-the-locked-template-available-even-if-flock-has-not-been-built-yet-fall-back-to-unlocked-shell-command.patch} (100%) rename patches/openwrt/{0029-build-add-locking-for-downloads-fixes-race-conditions-with-multiple-variants.patch => 0028-build-add-locking-for-downloads-fixes-race-conditions-with-multiple-variants.patch} (100%) rename patches/openwrt/{0030-download.mk-fix-packed-checkout-mirroring-support.patch => 0029-download.mk-fix-packed-checkout-mirroring-support.patch} (100%) create mode 100644 patches/openwrt/0030-kernel-backport-spi-nor-driver-from-4.4.9.patch create mode 100644 patches/openwrt/0031-kernel-mtd-spi-nor-wait-until-status-register-writes-are-ready.patch create mode 100644 patches/openwrt/0032-kernel-mtd-spi-nor-unlock-Winbond-flashs.patch diff --git a/patches/openwrt/0020-Support-LibreSSL-as-provider-of-openssl.patch b/patches/openwrt/0019-Support-LibreSSL-as-provider-of-openssl.patch similarity index 100% rename from patches/openwrt/0020-Support-LibreSSL-as-provider-of-openssl.patch rename to patches/openwrt/0019-Support-LibreSSL-as-provider-of-openssl.patch diff --git a/patches/openwrt/0019-generic-mtd-spi-nor-disable-protection-for-Winbond-flash-at-startup.patch b/patches/openwrt/0019-generic-mtd-spi-nor-disable-protection-for-Winbond-flash-at-startup.patch deleted file mode 100644 index e69735e6..00000000 --- a/patches/openwrt/0019-generic-mtd-spi-nor-disable-protection-for-Winbond-flash-at-startup.patch +++ /dev/null @@ -1,94 +0,0 @@ -From: Matthias Schiffer -Date: Tue, 29 Mar 2016 21:58:53 +0200 -Subject: generic: mtd: spi-nor: disable protection for Winbond flash at startup - -diff --git a/target/linux/generic/patches-3.18/463-mtd-spi-nor-wait-until-lock-unlock-operations-are-re.patch b/target/linux/generic/patches-3.18/463-mtd-spi-nor-wait-until-lock-unlock-operations-are-re.patch -new file mode 100644 -index 0000000..c906425 ---- /dev/null -+++ b/target/linux/generic/patches-3.18/463-mtd-spi-nor-wait-until-lock-unlock-operations-are-re.patch -@@ -0,0 +1,47 @@ -+From 26e4790ddad59038ece16c8b89ad856bee946d75 Mon Sep 17 00:00:00 2001 -+Message-Id: <26e4790ddad59038ece16c8b89ad856bee946d75.1459281384.git.mschiffer@universe-factory.net> -+From: Matthias Schiffer -+Date: Tue, 29 Mar 2016 21:51:10 +0200 -+Subject: [PATCH 1/2] mtd: spi-nor: wait until lock/unlock operations are ready -+ -+Upstream commits: -+ -+32321e950d8a237d7e8f3a9b76220007dfa87544 -+edf891ef9ab773363f8e58022a26d7d31604aed6 -+--- -+ drivers/mtd/spi-nor/spi-nor.c | 5 +++++ -+ 1 file changed, 5 insertions(+) -+ -+diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c -+index ef783a4..1ab6e24 100644 -+--- a/drivers/mtd/spi-nor/spi-nor.c -++++ b/drivers/mtd/spi-nor/spi-nor.c -+@@ -370,6 +370,8 @@ static int spi_nor_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len) -+ ret = write_sr(nor, status_new); -+ if (ret) -+ goto err; -++ -++ ret = wait_till_ready(nor); -+ } -+ -+ err: -+@@ -417,6 +419,8 @@ static int spi_nor_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len) -+ ret = write_sr(nor, status_new); -+ if (ret) -+ goto err; -++ -++ ret = wait_till_ready(nor); -+ } -+ -+ err: -+@@ -966,6 +970,7 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode) -+ JEDEC_MFR(info->jedec_id) == CFI_MFR_SST) { -+ write_enable(nor); -+ write_sr(nor, 0); -++ wait_till_ready(nor); -+ } -+ -+ if (!mtd->name) -+-- -+2.7.4 -+ -diff --git a/target/linux/generic/patches-3.18/464-mtd-spi-nor-disable-protection-for-Winbond-flash-at-.patch b/target/linux/generic/patches-3.18/464-mtd-spi-nor-disable-protection-for-Winbond-flash-at-.patch -new file mode 100644 -index 0000000..7b45666 ---- /dev/null -+++ b/target/linux/generic/patches-3.18/464-mtd-spi-nor-disable-protection-for-Winbond-flash-at-.patch -@@ -0,0 +1,31 @@ -+From 03485b7e91a8f6e69e4945f937f266c59c1376d0 Mon Sep 17 00:00:00 2001 -+Message-Id: <03485b7e91a8f6e69e4945f937f266c59c1376d0.1459281384.git.mschiffer@universe-factory.net> -+In-Reply-To: <26e4790ddad59038ece16c8b89ad856bee946d75.1459281384.git.mschiffer@universe-factory.net> -+References: <26e4790ddad59038ece16c8b89ad856bee946d75.1459281384.git.mschiffer@universe-factory.net> -+From: Matthias Schiffer -+Date: Tue, 29 Mar 2016 21:55:55 +0200 -+Subject: [PATCH 2/2] mtd: spi-nor: disable protection for Winbond flash at -+ startup -+ -+Upstream commit: c6fc2171b249e73745c497b578b417a2946f1b2f -+--- -+ drivers/mtd/spi-nor/spi-nor.c | 3 ++- -+ 1 file changed, 2 insertions(+), 1 deletion(-) -+ -+diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c -+index 1ab6e24..ea7fa30 100644 -+--- a/drivers/mtd/spi-nor/spi-nor.c -++++ b/drivers/mtd/spi-nor/spi-nor.c -+@@ -967,7 +967,8 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode) -+ if (JEDEC_MFR(info->jedec_id) == CFI_MFR_ATMEL || -+ JEDEC_MFR(info->jedec_id) == CFI_MFR_INTEL || -+ JEDEC_MFR(info->jedec_id) == CFI_MFR_MACRONIX || -+- JEDEC_MFR(info->jedec_id) == CFI_MFR_SST) { -++ JEDEC_MFR(info->jedec_id) == CFI_MFR_SST || -++ JEDEC_MFR(info->jedec_id) == CFI_MFR_WINBOND) { -+ write_enable(nor); -+ write_sr(nor, 0); -+ wait_till_ready(nor); -+-- -+2.7.4 -+ diff --git a/patches/openwrt/0021-ar71xx-check-both-HWID-and-HWREV-on-upgrades-of-TP-LINK-devices.patch b/patches/openwrt/0020-ar71xx-check-both-HWID-and-HWREV-on-upgrades-of-TP-LINK-devices.patch similarity index 100% rename from patches/openwrt/0021-ar71xx-check-both-HWID-and-HWREV-on-upgrades-of-TP-LINK-devices.patch rename to patches/openwrt/0020-ar71xx-check-both-HWID-and-HWREV-on-upgrades-of-TP-LINK-devices.patch diff --git a/patches/openwrt/0022-ar71xx-avoid-AR71XX_MODEL-ending-with-a-space-on-some-TP-LINK-like-devices.patch b/patches/openwrt/0021-ar71xx-avoid-AR71XX_MODEL-ending-with-a-space-on-some-TP-LINK-like-devices.patch similarity index 100% rename from patches/openwrt/0022-ar71xx-avoid-AR71XX_MODEL-ending-with-a-space-on-some-TP-LINK-like-devices.patch rename to patches/openwrt/0021-ar71xx-avoid-AR71XX_MODEL-ending-with-a-space-on-some-TP-LINK-like-devices.patch diff --git a/patches/openwrt/0023-ar71xx-fix-the-revision-of-a-few-TP-LINK-devices-in-AR71XX_MODEL-to-match-labels-image-names.patch b/patches/openwrt/0022-ar71xx-fix-the-revision-of-a-few-TP-LINK-devices-in-AR71XX_MODEL-to-match-labels-image-names.patch similarity index 100% rename from patches/openwrt/0023-ar71xx-fix-the-revision-of-a-few-TP-LINK-devices-in-AR71XX_MODEL-to-match-labels-image-names.patch rename to patches/openwrt/0022-ar71xx-fix-the-revision-of-a-few-TP-LINK-devices-in-AR71XX_MODEL-to-match-labels-image-names.patch diff --git a/patches/openwrt/0024-ar71xx-build-image-for-TL-WR710N-v2.1.patch b/patches/openwrt/0023-ar71xx-build-image-for-TL-WR710N-v2.1.patch similarity index 100% rename from patches/openwrt/0024-ar71xx-build-image-for-TL-WR710N-v2.1.patch rename to patches/openwrt/0023-ar71xx-build-image-for-TL-WR710N-v2.1.patch diff --git a/patches/openwrt/0025-xtables-addons-build-fix-configure-compatiblity-with-POSIX-shells.patch b/patches/openwrt/0024-xtables-addons-build-fix-configure-compatiblity-with-POSIX-shells.patch similarity index 100% rename from patches/openwrt/0025-xtables-addons-build-fix-configure-compatiblity-with-POSIX-shells.patch rename to patches/openwrt/0024-xtables-addons-build-fix-configure-compatiblity-with-POSIX-shells.patch diff --git a/patches/openwrt/0026-tools-add-tar-host-build-required-for-sort-name-which-was-only-added-in-the-latest-version.patch b/patches/openwrt/0025-tools-add-tar-host-build-required-for-sort-name-which-was-only-added-in-the-latest-version.patch similarity index 100% rename from patches/openwrt/0026-tools-add-tar-host-build-required-for-sort-name-which-was-only-added-in-the-latest-version.patch rename to patches/openwrt/0025-tools-add-tar-host-build-required-for-sort-name-which-was-only-added-in-the-latest-version.patch diff --git a/patches/openwrt/0027-tools-compile-flock-before-everything-else.patch b/patches/openwrt/0026-tools-compile-flock-before-everything-else.patch similarity index 100% rename from patches/openwrt/0027-tools-compile-flock-before-everything-else.patch rename to patches/openwrt/0026-tools-compile-flock-before-everything-else.patch diff --git a/patches/openwrt/0028-rules.mk-make-the-locked-template-available-even-if-flock-has-not-been-built-yet-fall-back-to-unlocked-shell-command.patch b/patches/openwrt/0027-rules.mk-make-the-locked-template-available-even-if-flock-has-not-been-built-yet-fall-back-to-unlocked-shell-command.patch similarity index 100% rename from patches/openwrt/0028-rules.mk-make-the-locked-template-available-even-if-flock-has-not-been-built-yet-fall-back-to-unlocked-shell-command.patch rename to patches/openwrt/0027-rules.mk-make-the-locked-template-available-even-if-flock-has-not-been-built-yet-fall-back-to-unlocked-shell-command.patch diff --git a/patches/openwrt/0029-build-add-locking-for-downloads-fixes-race-conditions-with-multiple-variants.patch b/patches/openwrt/0028-build-add-locking-for-downloads-fixes-race-conditions-with-multiple-variants.patch similarity index 100% rename from patches/openwrt/0029-build-add-locking-for-downloads-fixes-race-conditions-with-multiple-variants.patch rename to patches/openwrt/0028-build-add-locking-for-downloads-fixes-race-conditions-with-multiple-variants.patch diff --git a/patches/openwrt/0030-download.mk-fix-packed-checkout-mirroring-support.patch b/patches/openwrt/0029-download.mk-fix-packed-checkout-mirroring-support.patch similarity index 100% rename from patches/openwrt/0030-download.mk-fix-packed-checkout-mirroring-support.patch rename to patches/openwrt/0029-download.mk-fix-packed-checkout-mirroring-support.patch diff --git a/patches/openwrt/0030-kernel-backport-spi-nor-driver-from-4.4.9.patch b/patches/openwrt/0030-kernel-backport-spi-nor-driver-from-4.4.9.patch new file mode 100644 index 00000000..f66699ca --- /dev/null +++ b/patches/openwrt/0030-kernel-backport-spi-nor-driver-from-4.4.9.patch @@ -0,0 +1,2012 @@ +From: Matthias Schiffer +Date: Sat, 7 May 2016 00:07:51 +0200 +Subject: kernel: backport spi-nor driver from 4.4.9 + +diff --git a/target/linux/ar71xx/patches-3.18/407-mtd-m25p80-allow-to-pass-probe-types-via-platform-data.patch b/target/linux/ar71xx/patches-3.18/407-mtd-m25p80-allow-to-pass-probe-types-via-platform-data.patch +index 568f516..6a91320 100644 +--- a/target/linux/ar71xx/patches-3.18/407-mtd-m25p80-allow-to-pass-probe-types-via-platform-data.patch ++++ b/target/linux/ar71xx/patches-3.18/407-mtd-m25p80-allow-to-pass-probe-types-via-platform-data.patch +@@ -1,11 +1,11 @@ + --- a/drivers/mtd/devices/m25p80.c + +++ b/drivers/mtd/devices/m25p80.c +-@@ -246,7 +246,9 @@ static int m25p_probe(struct spi_device ++@@ -229,7 +229,9 @@ static int m25p_probe(struct spi_device + + ppdata.of_node = spi->dev.of_node; + +-- return mtd_device_parse_register(&flash->mtd, NULL, &ppdata, +-+ return mtd_device_parse_register(&flash->mtd, ++- return mtd_device_parse_register(&nor->mtd, NULL, &ppdata, +++ return mtd_device_parse_register(&nor->mtd, + + data ? data->part_probes : NULL, + + &ppdata, + data ? data->parts : NULL, +diff --git a/target/linux/ar71xx/patches-3.18/412-mtd-m25p80-zero-partition-parser-data.patch b/target/linux/ar71xx/patches-3.18/412-mtd-m25p80-zero-partition-parser-data.patch +index d51694d..175acf6 100644 +--- a/target/linux/ar71xx/patches-3.18/412-mtd-m25p80-zero-partition-parser-data.patch ++++ b/target/linux/ar71xx/patches-3.18/412-mtd-m25p80-zero-partition-parser-data.patch +@@ -1,10 +1,10 @@ + --- a/drivers/mtd/devices/m25p80.c + +++ b/drivers/mtd/devices/m25p80.c +-@@ -244,6 +244,7 @@ static int m25p_probe(struct spi_device ++@@ -227,6 +227,7 @@ static int m25p_probe(struct spi_device + if (ret) + return ret; + + + memset(&ppdata, '\0', sizeof(ppdata)); + ppdata.of_node = spi->dev.of_node; + +- return mtd_device_parse_register(&flash->mtd, ++ return mtd_device_parse_register(&nor->mtd, +diff --git a/target/linux/ar71xx/patches-3.18/462-mtd-m25p80-set-spi-transfer-type.patch b/target/linux/ar71xx/patches-3.18/462-mtd-m25p80-set-spi-transfer-type.patch +index 3320e5b..11bf9ff 100644 +--- a/target/linux/ar71xx/patches-3.18/462-mtd-m25p80-set-spi-transfer-type.patch ++++ b/target/linux/ar71xx/patches-3.18/462-mtd-m25p80-set-spi-transfer-type.patch +@@ -1,6 +1,6 @@ + --- a/drivers/mtd/devices/m25p80.c + +++ b/drivers/mtd/devices/m25p80.c +-@@ -142,10 +142,12 @@ static int m25p80_read(struct spi_nor *n ++@@ -137,10 +137,12 @@ static int m25p80_read(struct spi_nor *n + flash->command[0] = nor->read_opcode; + m25p_addr2cmd(nor, from, flash->command); + +diff --git a/target/linux/ar71xx/patches-3.18/464-spi-ath79-fix-fast-flash-read.patch b/target/linux/ar71xx/patches-3.18/464-spi-ath79-fix-fast-flash-read.patch +index e48665d..758d231 100644 +--- a/target/linux/ar71xx/patches-3.18/464-spi-ath79-fix-fast-flash-read.patch ++++ b/target/linux/ar71xx/patches-3.18/464-spi-ath79-fix-fast-flash-read.patch +@@ -1,6 +1,6 @@ + --- a/drivers/mtd/devices/m25p80.c + +++ b/drivers/mtd/devices/m25p80.c +-@@ -142,6 +142,9 @@ static int m25p80_read(struct spi_nor *n ++@@ -137,6 +137,9 @@ static int m25p80_read(struct spi_nor *n + flash->command[0] = nor->read_opcode; + m25p_addr2cmd(nor, from, flash->command); + +@@ -25,7 +25,7 @@ + while (len--) { + --- a/include/linux/spi/spi.h + +++ b/include/linux/spi/spi.h +-@@ -637,6 +637,7 @@ struct spi_transfer { ++@@ -633,6 +633,7 @@ struct spi_transfer { + u16 delay_usecs; + u32 speed_hz; + enum spi_transfer_type type; +diff --git a/target/linux/brcm63xx/patches-3.18/202-MTD-DEVICES-m25p80-use-parsers-if-provided-in-flash-.patch b/target/linux/brcm63xx/patches-3.18/202-MTD-DEVICES-m25p80-use-parsers-if-provided-in-flash-.patch +index b949694..be62e67 100644 +--- a/target/linux/brcm63xx/patches-3.18/202-MTD-DEVICES-m25p80-use-parsers-if-provided-in-flash-.patch ++++ b/target/linux/brcm63xx/patches-3.18/202-MTD-DEVICES-m25p80-use-parsers-if-provided-in-flash-.patch +@@ -11,12 +11,12 @@ Signed-off-by: Jonas Gorski + + --- a/drivers/mtd/devices/m25p80.c + +++ b/drivers/mtd/devices/m25p80.c +-@@ -246,7 +246,8 @@ static int m25p_probe(struct spi_device ++@@ -229,7 +229,8 @@ static int m25p_probe(struct spi_device + + ppdata.of_node = spi->dev.of_node; + +-- return mtd_device_parse_register(&flash->mtd, NULL, &ppdata, +-+ return mtd_device_parse_register(&flash->mtd, ++- return mtd_device_parse_register(&nor->mtd, NULL, &ppdata, +++ return mtd_device_parse_register(&nor->mtd, + + data ? data->part_probe_types : NULL, &ppdata, + data ? data->parts : NULL, + data ? data->nr_parts : 0); +diff --git a/target/linux/brcm63xx/patches-3.18/203-MTD-DEVICES-m25p80-add-support-for-limiting-reads.patch b/target/linux/brcm63xx/patches-3.18/203-MTD-DEVICES-m25p80-add-support-for-limiting-reads.patch +index 740fb2d..3877442 100644 +--- a/target/linux/brcm63xx/patches-3.18/203-MTD-DEVICES-m25p80-add-support-for-limiting-reads.patch ++++ b/target/linux/brcm63xx/patches-3.18/203-MTD-DEVICES-m25p80-add-support-for-limiting-reads.patch +@@ -11,15 +11,15 @@ Signed-off-by: Jonas Gorski + + --- a/drivers/mtd/devices/m25p80.c + +++ b/drivers/mtd/devices/m25p80.c +-@@ -32,6 +32,7 @@ struct m25p { ++@@ -31,6 +31,7 @@ ++ struct m25p { + struct spi_device *spi; + struct spi_nor spi_nor; +- struct mtd_info mtd; + + int max_transfer_len; + u8 command[MAX_CMD_SIZE]; + }; + +-@@ -121,7 +122,7 @@ static inline unsigned int m25p80_rx_nbi ++@@ -119,7 +120,7 @@ static inline unsigned int m25p80_rx_nbi + * Read an address range from the nor chip. The address range + * may be any size provided it is within the physical boundaries. + */ +@@ -28,7 +28,7 @@ Signed-off-by: Jonas Gorski + size_t *retlen, u_char *buf) + { + struct m25p *flash = nor->priv; +-@@ -157,6 +158,29 @@ static int m25p80_read(struct spi_nor *n ++@@ -152,6 +153,29 @@ static int m25p80_read(struct spi_nor *n + return 0; + } + +@@ -58,7 +58,7 @@ Signed-off-by: Jonas Gorski + static int m25p80_erase(struct spi_nor *nor, loff_t offset) + { + struct m25p *flash = nor->priv; +-@@ -240,6 +264,9 @@ static int m25p_probe(struct spi_device ++@@ -223,6 +247,9 @@ static int m25p_probe(struct spi_device + else + flash_name = spi->modalias; + +diff --git a/target/linux/brcm63xx/patches-3.18/414-MTD-m25p80-allow-passing-pp_data.patch b/target/linux/brcm63xx/patches-3.18/414-MTD-m25p80-allow-passing-pp_data.patch +index b7bf57f..e421e9a 100644 +--- a/target/linux/brcm63xx/patches-3.18/414-MTD-m25p80-allow-passing-pp_data.patch ++++ b/target/linux/brcm63xx/patches-3.18/414-MTD-m25p80-allow-passing-pp_data.patch +@@ -10,7 +10,7 @@ Subject: [PATCH 64/79] MTD: m25p80: allow passing pp_data + + --- a/drivers/mtd/devices/m25p80.c + +++ b/drivers/mtd/devices/m25p80.c +-@@ -267,6 +267,9 @@ static int m25p_probe(struct spi_device ++@@ -250,6 +250,9 @@ static int m25p_probe(struct spi_device + if (data) + flash->max_transfer_len = data->max_transfer_len; + +diff --git a/target/linux/generic/patches-3.18/043-mtd_GD25Q128B_support_backport_from_3.19.patch b/target/linux/generic/patches-3.18/043-mtd_GD25Q128B_support_backport_from_3.19.patch +deleted file mode 100644 +index 4d0403b..0000000 +--- a/target/linux/generic/patches-3.18/043-mtd_GD25Q128B_support_backport_from_3.19.patch ++++ /dev/null +@@ -1,10 +0,0 @@ +---- a/drivers/mtd/spi-nor/spi-nor.c +-+++ b/drivers/mtd/spi-nor/spi-nor.c +-@@ -510,6 +510,7 @@ static const struct spi_device_id spi_no +- /* GigaDevice */ +- { "gd25q32", INFO(0xc84016, 0, 64 * 1024, 64, SECT_4K) }, +- { "gd25q64", INFO(0xc84017, 0, 64 * 1024, 128, SECT_4K) }, +-+ { "gd25q128", INFO(0xc84018, 0, 64 * 1024, 256, SECT_4K) }, +- +- /* Intel/Numonyx -- xxxs33b */ +- { "160s33b", INFO(0x898911, 0, 64 * 1024, 32, 0) }, +diff --git a/target/linux/generic/patches-3.18/093-m25p80_spi-nor_update_to_4.4.9.patch b/target/linux/generic/patches-3.18/093-m25p80_spi-nor_update_to_4.4.9.patch +new file mode 100644 +index 0000000..5f74d3a +--- /dev/null ++++ b/target/linux/generic/patches-3.18/093-m25p80_spi-nor_update_to_4.4.9.patch +@@ -0,0 +1,1579 @@ ++--- a/drivers/mtd/devices/m25p80.c +++++ b/drivers/mtd/devices/m25p80.c ++@@ -31,7 +31,6 @@ ++ struct m25p { ++ struct spi_device *spi; ++ struct spi_nor spi_nor; ++- struct mtd_info mtd; ++ u8 command[MAX_CMD_SIZE]; ++ }; ++ ++@@ -62,8 +61,7 @@ static int m25p_cmdsz(struct spi_nor *no ++ return 1 + nor->addr_width; ++ } ++ ++-static int m25p80_write_reg(struct spi_nor *nor, u8 opcode, u8 *buf, int len, ++- int wr_en) +++static int m25p80_write_reg(struct spi_nor *nor, u8 opcode, u8 *buf, int len) ++ { ++ struct m25p *flash = nor->priv; ++ struct spi_device *spi = flash->spi; ++@@ -128,13 +126,10 @@ static int m25p80_read(struct spi_nor *n ++ struct spi_device *spi = flash->spi; ++ struct spi_transfer t[2]; ++ struct spi_message m; ++- int dummy = nor->read_dummy; ++- int ret; +++ unsigned int dummy = nor->read_dummy; ++ ++- /* Wait till previous write/erase is done. */ ++- ret = nor->wait_till_ready(nor); ++- if (ret) ++- return ret; +++ /* convert the dummy cycles to the number of bytes */ +++ dummy /= 8; ++ ++ spi_message_init(&m); ++ memset(t, 0, (sizeof t)); ++@@ -160,20 +155,9 @@ static int m25p80_read(struct spi_nor *n ++ static int m25p80_erase(struct spi_nor *nor, loff_t offset) ++ { ++ struct m25p *flash = nor->priv; ++- int ret; ++ ++ dev_dbg(nor->dev, "%dKiB at 0x%08x\n", ++- flash->mtd.erasesize / 1024, (u32)offset); ++- ++- /* Wait until finished previous write command. */ ++- ret = nor->wait_till_ready(nor); ++- if (ret) ++- return ret; ++- ++- /* Send write enable, then erase commands. */ ++- ret = nor->write_reg(nor, SPINOR_OP_WREN, NULL, 0, 0); ++- if (ret) ++- return ret; +++ flash->spi_nor.mtd.erasesize / 1024, (u32)offset); ++ ++ /* Set up command buffer. */ ++ flash->command[0] = nor->erase_opcode; ++@@ -215,11 +199,10 @@ static int m25p_probe(struct spi_device ++ nor->read_reg = m25p80_read_reg; ++ ++ nor->dev = &spi->dev; ++- nor->mtd = &flash->mtd; +++ nor->flash_node = spi->dev.of_node; ++ nor->priv = flash; ++ ++ spi_set_drvdata(spi, flash); ++- flash->mtd.priv = nor; ++ flash->spi = spi; ++ ++ if (spi->mode & SPI_RX_QUAD) ++@@ -228,7 +211,7 @@ static int m25p_probe(struct spi_device ++ mode = SPI_NOR_DUAL; ++ ++ if (data && data->name) ++- flash->mtd.name = data->name; +++ nor->mtd.name = data->name; ++ ++ /* For some (historical?) reason many platforms provide two different ++ * names in flash_platform_data: "name" and "type". Quite often name is ++@@ -246,7 +229,7 @@ static int m25p_probe(struct spi_device ++ ++ ppdata.of_node = spi->dev.of_node; ++ ++- return mtd_device_parse_register(&flash->mtd, NULL, &ppdata, +++ return mtd_device_parse_register(&nor->mtd, NULL, &ppdata, ++ data ? data->parts : NULL, ++ data ? data->nr_parts : 0); ++ } ++@@ -257,64 +240,68 @@ static int m25p_remove(struct spi_device ++ struct m25p *flash = spi_get_drvdata(spi); ++ ++ /* Clean up MTD stuff. */ ++- return mtd_device_unregister(&flash->mtd); +++ return mtd_device_unregister(&flash->spi_nor.mtd); ++ } ++ ++- ++ /* ++- * XXX This needs to be kept in sync with spi_nor_ids. We can't share ++- * it with spi-nor, because if this is built as a module then modpost ++- * won't be able to read it and add appropriate aliases. +++ * Do NOT add to this array without reading the following: +++ * +++ * Historically, many flash devices are bound to this driver by their name. But +++ * since most of these flash are compatible to some extent, and their +++ * differences can often be differentiated by the JEDEC read-ID command, we +++ * encourage new users to add support to the spi-nor library, and simply bind +++ * against a generic string here (e.g., "jedec,spi-nor"). +++ * +++ * Many flash names are kept here in this list (as well as in spi-nor.c) to +++ * keep them available as module aliases for existing platforms. ++ */ ++ static const struct spi_device_id m25p_ids[] = { ++- {"at25fs010"}, {"at25fs040"}, {"at25df041a"}, {"at25df321a"}, ++- {"at25df641"}, {"at26f004"}, {"at26df081a"}, {"at26df161a"}, ++- {"at26df321"}, {"at45db081d"}, ++- {"en25f32"}, {"en25p32"}, {"en25q32b"}, {"en25p64"}, ++- {"en25q64"}, {"en25qh128"}, {"en25qh256"}, ++- {"f25l32pa"}, ++- {"mr25h256"}, {"mr25h10"}, ++- {"gd25q32"}, {"gd25q64"}, ++- {"160s33b"}, {"320s33b"}, {"640s33b"}, ++- {"mx25l2005a"}, {"mx25l4005a"}, {"mx25l8005"}, {"mx25l1606e"}, ++- {"mx25l3205d"}, {"mx25l3255e"}, {"mx25l6405d"}, {"mx25l12805d"}, ++- {"mx25l12855e"},{"mx25l25635e"},{"mx25l25655e"},{"mx66l51235l"}, ++- {"mx66l1g55g"}, ++- {"n25q064"}, {"n25q128a11"}, {"n25q128a13"}, {"n25q256a"}, ++- {"n25q512a"}, {"n25q512ax3"}, {"n25q00"}, ++- {"pm25lv512"}, {"pm25lv010"}, {"pm25lq032"}, ++- {"s25sl032p"}, {"s25sl064p"}, {"s25fl256s0"}, {"s25fl256s1"}, ++- {"s25fl512s"}, {"s70fl01gs"}, {"s25sl12800"}, {"s25sl12801"}, ++- {"s25fl129p0"}, {"s25fl129p1"}, {"s25sl004a"}, {"s25sl008a"}, ++- {"s25sl016a"}, {"s25sl032a"}, {"s25sl064a"}, {"s25fl008k"}, ++- {"s25fl016k"}, {"s25fl064k"}, ++- {"sst25vf040b"},{"sst25vf080b"},{"sst25vf016b"},{"sst25vf032b"}, ++- {"sst25vf064c"},{"sst25wf512"}, {"sst25wf010"}, {"sst25wf020"}, ++- {"sst25wf040"}, ++- {"m25p05"}, {"m25p10"}, {"m25p20"}, {"m25p40"}, ++- {"m25p80"}, {"m25p16"}, {"m25p32"}, {"m25p64"}, ++- {"m25p128"}, {"n25q032"}, +++ /* +++ * Entries not used in DTs that should be safe to drop after replacing +++ * them with "nor-jedec" in platform data. +++ */ +++ {"s25sl064a"}, {"w25x16"}, {"m25p10"}, {"m25px64"}, +++ +++ /* +++ * Entries that were used in DTs without "nor-jedec" fallback and should +++ * be kept for backward compatibility. +++ */ +++ {"at25df321a"}, {"at25df641"}, {"at26df081a"}, +++ {"mr25h256"}, +++ {"mx25l4005a"}, {"mx25l1606e"}, {"mx25l6405d"}, {"mx25l12805d"}, +++ {"mx25l25635e"},{"mx66l51235l"}, +++ {"n25q064"}, {"n25q128a11"}, {"n25q128a13"}, {"n25q512a"}, +++ {"s25fl256s1"}, {"s25fl512s"}, {"s25sl12801"}, {"s25fl008k"}, +++ {"s25fl064k"}, +++ {"sst25vf040b"},{"sst25vf016b"},{"sst25vf032b"},{"sst25wf040"}, +++ {"m25p40"}, {"m25p80"}, {"m25p16"}, {"m25p32"}, +++ {"m25p64"}, {"m25p128"}, +++ {"w25x80"}, {"w25x32"}, {"w25q32"}, {"w25q32dw"}, +++ {"w25q80bl"}, {"w25q128"}, {"w25q256"}, +++ +++ /* Flashes that can't be detected using JEDEC */ ++ {"m25p05-nonjedec"}, {"m25p10-nonjedec"}, {"m25p20-nonjedec"}, ++ {"m25p40-nonjedec"}, {"m25p80-nonjedec"}, {"m25p16-nonjedec"}, ++ {"m25p32-nonjedec"}, {"m25p64-nonjedec"}, {"m25p128-nonjedec"}, ++- {"m45pe10"}, {"m45pe80"}, {"m45pe16"}, ++- {"m25pe20"}, {"m25pe80"}, {"m25pe16"}, ++- {"m25px16"}, {"m25px32"}, {"m25px32-s0"}, {"m25px32-s1"}, ++- {"m25px64"}, {"m25px80"}, ++- {"w25x10"}, {"w25x20"}, {"w25x40"}, {"w25x80"}, ++- {"w25x16"}, {"w25x32"}, {"w25q32"}, {"w25q32dw"}, ++- {"w25x64"}, {"w25q64"}, {"w25q80"}, {"w25q80bl"}, ++- {"w25q128"}, {"w25q256"}, {"cat25c11"}, ++- {"cat25c03"}, {"cat25c09"}, {"cat25c17"}, {"cat25128"}, +++ ++ { }, ++ }; ++ MODULE_DEVICE_TABLE(spi, m25p_ids); ++ +++static const struct of_device_id m25p_of_table[] = { +++ /* +++ * Generic compatibility for SPI NOR that can be identified by the +++ * JEDEC READ ID opcode (0x9F). Use this, if possible. +++ */ +++ { .compatible = "jedec,spi-nor" }, +++ {} +++}; +++MODULE_DEVICE_TABLE(of, m25p_of_table); ++ ++ static struct spi_driver m25p80_driver = { ++ .driver = { ++ .name = "m25p80", ++- .owner = THIS_MODULE, +++ .of_match_table = m25p_of_table, ++ }, ++ .id_table = m25p_ids, ++ .probe = m25p_probe, ++--- a/drivers/mtd/spi-nor/spi-nor.c +++++ b/drivers/mtd/spi-nor/spi-nor.c ++@@ -16,19 +16,63 @@ ++ #include ++ #include ++ #include +++#include ++ ++-#include ++ #include ++ #include ++ #include ++ #include ++ ++ /* Define max times to check status register before we give up. */ ++-#define MAX_READY_WAIT_JIFFIES (40 * HZ) /* M25P16 specs 40s max chip erase */ ++ ++-#define JEDEC_MFR(_jedec_id) ((_jedec_id) >> 16) +++/* +++ * For everything but full-chip erase; probably could be much smaller, but kept +++ * around for safety for now +++ */ +++#define DEFAULT_READY_WAIT_JIFFIES (40UL * HZ) +++ +++/* +++ * For full-chip erase, calibrated to a 2MB flash (M25P16); should be scaled up +++ * for larger flash +++ */ +++#define CHIP_ERASE_2MB_READY_WAIT_JIFFIES (40UL * HZ) +++ +++#define SPI_NOR_MAX_ID_LEN 6 +++ +++struct flash_info { +++ char *name; +++ +++ /* +++ * This array stores the ID bytes. +++ * The first three bytes are the JEDIC ID. +++ * JEDEC ID zero means "no ID" (mostly older chips). +++ */ +++ u8 id[SPI_NOR_MAX_ID_LEN]; +++ u8 id_len; +++ +++ /* The size listed here is what works with SPINOR_OP_SE, which isn't +++ * necessarily called a "sector" by the vendor. +++ */ +++ unsigned sector_size; +++ u16 n_sectors; +++ +++ u16 page_size; +++ u16 addr_width; +++ +++ u16 flags; +++#define SECT_4K 0x01 /* SPINOR_OP_BE_4K works uniformly */ +++#define SPI_NOR_NO_ERASE 0x02 /* No erase command needed */ +++#define SST_WRITE 0x04 /* use SST byte programming */ +++#define SPI_NOR_NO_FR 0x08 /* Can't do fastread */ +++#define SECT_4K_PMC 0x10 /* SPINOR_OP_BE_4K_PMC works uniformly */ +++#define SPI_NOR_DUAL_READ 0x20 /* Flash supports Dual Read */ +++#define SPI_NOR_QUAD_READ 0x40 /* Flash supports Quad Read */ +++#define USE_FSR 0x80 /* use flag status register */ +++}; ++ ++-static const struct spi_device_id *spi_nor_match_id(const char *name); +++#define JEDEC_MFR(info) ((info)->id[0]) +++ +++static const struct flash_info *spi_nor_match_id(const char *name); ++ ++ /* ++ * Read the status register, returning its value in the location ++@@ -98,7 +142,7 @@ static inline int spi_nor_read_dummy_cyc ++ case SPI_NOR_FAST: ++ case SPI_NOR_DUAL: ++ case SPI_NOR_QUAD: ++- return 1; +++ return 8; ++ case SPI_NOR_NORMAL: ++ return 0; ++ } ++@@ -112,7 +156,7 @@ static inline int spi_nor_read_dummy_cyc ++ static inline int write_sr(struct spi_nor *nor, u8 val) ++ { ++ nor->cmd_buf[0] = val; ++- return nor->write_reg(nor, SPINOR_OP_WRSR, nor->cmd_buf, 1, 0); +++ return nor->write_reg(nor, SPINOR_OP_WRSR, nor->cmd_buf, 1); ++ } ++ ++ /* ++@@ -121,7 +165,7 @@ static inline int write_sr(struct spi_no ++ */ ++ static inline int write_enable(struct spi_nor *nor) ++ { ++- return nor->write_reg(nor, SPINOR_OP_WREN, NULL, 0, 0); +++ return nor->write_reg(nor, SPINOR_OP_WREN, NULL, 0); ++ } ++ ++ /* ++@@ -129,7 +173,7 @@ static inline int write_enable(struct sp ++ */ ++ static inline int write_disable(struct spi_nor *nor) ++ { ++- return nor->write_reg(nor, SPINOR_OP_WRDI, NULL, 0, 0); +++ return nor->write_reg(nor, SPINOR_OP_WRDI, NULL, 0); ++ } ++ ++ static inline struct spi_nor *mtd_to_spi_nor(struct mtd_info *mtd) ++@@ -138,23 +182,24 @@ static inline struct spi_nor *mtd_to_spi ++ } ++ ++ /* Enable/disable 4-byte addressing mode. */ ++-static inline int set_4byte(struct spi_nor *nor, u32 jedec_id, int enable) +++static inline int set_4byte(struct spi_nor *nor, const struct flash_info *info, +++ int enable) ++ { ++ int status; ++ bool need_wren = false; ++ u8 cmd; ++ ++- switch (JEDEC_MFR(jedec_id)) { ++- case CFI_MFR_ST: /* Micron, actually */ +++ switch (JEDEC_MFR(info)) { +++ case SNOR_MFR_MICRON: ++ /* Some Micron need WREN command; all will accept it */ ++ need_wren = true; ++- case CFI_MFR_MACRONIX: ++- case 0xEF /* winbond */: +++ case SNOR_MFR_MACRONIX: +++ case SNOR_MFR_WINBOND: ++ if (need_wren) ++ write_enable(nor); ++ ++ cmd = enable ? SPINOR_OP_EN4B : SPINOR_OP_EX4B; ++- status = nor->write_reg(nor, cmd, NULL, 0, 0); +++ status = nor->write_reg(nor, cmd, NULL, 0); ++ if (need_wren) ++ write_disable(nor); ++ ++@@ -162,63 +207,73 @@ static inline int set_4byte(struct spi_n ++ default: ++ /* Spansion style */ ++ nor->cmd_buf[0] = enable << 7; ++- return nor->write_reg(nor, SPINOR_OP_BRWR, nor->cmd_buf, 1, 0); +++ return nor->write_reg(nor, SPINOR_OP_BRWR, nor->cmd_buf, 1); ++ } ++ } ++- ++-static int spi_nor_wait_till_ready(struct spi_nor *nor) +++static inline int spi_nor_sr_ready(struct spi_nor *nor) ++ { ++- unsigned long deadline; ++- int sr; ++- ++- deadline = jiffies + MAX_READY_WAIT_JIFFIES; ++- ++- do { ++- cond_resched(); +++ int sr = read_sr(nor); +++ if (sr < 0) +++ return sr; +++ else +++ return !(sr & SR_WIP); +++} ++ ++- sr = read_sr(nor); ++- if (sr < 0) ++- break; ++- else if (!(sr & SR_WIP)) ++- return 0; ++- } while (!time_after_eq(jiffies, deadline)); +++static inline int spi_nor_fsr_ready(struct spi_nor *nor) +++{ +++ int fsr = read_fsr(nor); +++ if (fsr < 0) +++ return fsr; +++ else +++ return fsr & FSR_READY; +++} ++ ++- return -ETIMEDOUT; +++static int spi_nor_ready(struct spi_nor *nor) +++{ +++ int sr, fsr; +++ sr = spi_nor_sr_ready(nor); +++ if (sr < 0) +++ return sr; +++ fsr = nor->flags & SNOR_F_USE_FSR ? spi_nor_fsr_ready(nor) : 1; +++ if (fsr < 0) +++ return fsr; +++ return sr && fsr; ++ } ++ ++-static int spi_nor_wait_till_fsr_ready(struct spi_nor *nor) +++/* +++ * Service routine to read status register until ready, or timeout occurs. +++ * Returns non-zero if error. +++ */ +++static int spi_nor_wait_till_ready_with_timeout(struct spi_nor *nor, +++ unsigned long timeout_jiffies) ++ { ++ unsigned long deadline; ++- int sr; ++- int fsr; +++ int timeout = 0, ret; ++ ++- deadline = jiffies + MAX_READY_WAIT_JIFFIES; +++ deadline = jiffies + timeout_jiffies; +++ +++ while (!timeout) { +++ if (time_after_eq(jiffies, deadline)) +++ timeout = 1; +++ +++ ret = spi_nor_ready(nor); +++ if (ret < 0) +++ return ret; +++ if (ret) +++ return 0; ++ ++- do { ++ cond_resched(); +++ } ++ ++- sr = read_sr(nor); ++- if (sr < 0) { ++- break; ++- } else if (!(sr & SR_WIP)) { ++- fsr = read_fsr(nor); ++- if (fsr < 0) ++- break; ++- if (fsr & FSR_READY) ++- return 0; ++- } ++- } while (!time_after_eq(jiffies, deadline)); +++ dev_err(nor->dev, "flash operation timed out\n"); ++ ++ return -ETIMEDOUT; ++ } ++ ++-/* ++- * Service routine to read status register until ready, or timeout occurs. ++- * Returns non-zero if error. ++- */ ++-static int wait_till_ready(struct spi_nor *nor) +++static int spi_nor_wait_till_ready(struct spi_nor *nor) ++ { ++- return nor->wait_till_ready(nor); +++ return spi_nor_wait_till_ready_with_timeout(nor, +++ DEFAULT_READY_WAIT_JIFFIES); ++ } ++ ++ /* ++@@ -228,19 +283,9 @@ static int wait_till_ready(struct spi_no ++ */ ++ static int erase_chip(struct spi_nor *nor) ++ { ++- int ret; ++- ++- dev_dbg(nor->dev, " %lldKiB\n", (long long)(nor->mtd->size >> 10)); +++ dev_dbg(nor->dev, " %lldKiB\n", (long long)(nor->mtd.size >> 10)); ++ ++- /* Wait until finished previous write command. */ ++- ret = wait_till_ready(nor); ++- if (ret) ++- return ret; ++- ++- /* Send write enable, then erase commands. */ ++- write_enable(nor); ++- ++- return nor->write_reg(nor, SPINOR_OP_CHIP_ERASE, NULL, 0, 0); +++ return nor->write_reg(nor, SPINOR_OP_CHIP_ERASE, NULL, 0); ++ } ++ ++ static int spi_nor_lock_and_prep(struct spi_nor *nor, enum spi_nor_ops ops) ++@@ -294,11 +339,28 @@ static int spi_nor_erase(struct mtd_info ++ ++ /* whole-chip erase? */ ++ if (len == mtd->size) { +++ unsigned long timeout; +++ +++ write_enable(nor); +++ ++ if (erase_chip(nor)) { ++ ret = -EIO; ++ goto erase_err; ++ } ++ +++ /* +++ * Scale the timeout linearly with the size of the flash, with +++ * a minimum calibrated to an old 2MB flash. We could try to +++ * pull these from CFI/SFDP, but these values should be good +++ * enough for now. +++ */ +++ timeout = max(CHIP_ERASE_2MB_READY_WAIT_JIFFIES, +++ CHIP_ERASE_2MB_READY_WAIT_JIFFIES * +++ (unsigned long)(mtd->size / SZ_2M)); +++ ret = spi_nor_wait_till_ready_with_timeout(nor, timeout); +++ if (ret) +++ goto erase_err; +++ ++ /* REVISIT in some cases we could speed up erasing large regions ++ * by using SPINOR_OP_SE instead of SPINOR_OP_BE_4K. We may have set up ++ * to use "small sector erase", but that's not always optimal. ++@@ -307,6 +369,8 @@ static int spi_nor_erase(struct mtd_info ++ /* "sector"-at-a-time erase */ ++ } else { ++ while (len) { +++ write_enable(nor); +++ ++ if (nor->erase(nor, addr)) { ++ ret = -EIO; ++ goto erase_err; ++@@ -314,9 +378,15 @@ static int spi_nor_erase(struct mtd_info ++ ++ addr += mtd->erasesize; ++ len -= mtd->erasesize; +++ +++ ret = spi_nor_wait_till_ready(nor); +++ if (ret) +++ goto erase_err; ++ } ++ } ++ +++ write_disable(nor); +++ ++ spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_ERASE); ++ ++ instr->state = MTD_ERASE_DONE; ++@@ -330,152 +400,267 @@ erase_err: ++ return ret; ++ } ++ ++-static int spi_nor_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len) +++static void stm_get_locked_range(struct spi_nor *nor, u8 sr, loff_t *ofs, +++ uint64_t *len) ++ { ++- struct spi_nor *nor = mtd_to_spi_nor(mtd); ++- uint32_t offset = ofs; ++- uint8_t status_old, status_new; ++- int ret = 0; +++ struct mtd_info *mtd = &nor->mtd; +++ u8 mask = SR_BP2 | SR_BP1 | SR_BP0; +++ int shift = ffs(mask) - 1; +++ int pow; +++ +++ if (!(sr & mask)) { +++ /* No protection */ +++ *ofs = 0; +++ *len = 0; +++ } else { +++ pow = ((sr & mask) ^ mask) >> shift; +++ *len = mtd->size >> pow; +++ *ofs = mtd->size - *len; +++ } +++} ++ ++- ret = spi_nor_lock_and_prep(nor, SPI_NOR_OPS_LOCK); ++- if (ret) ++- return ret; +++/* +++ * Return 1 if the entire region is locked, 0 otherwise +++ */ +++static int stm_is_locked_sr(struct spi_nor *nor, loff_t ofs, uint64_t len, +++ u8 sr) +++{ +++ loff_t lock_offs; +++ uint64_t lock_len; ++ ++- /* Wait until finished previous command */ ++- ret = wait_till_ready(nor); ++- if (ret) ++- goto err; +++ stm_get_locked_range(nor, sr, &lock_offs, &lock_len); +++ +++ return (ofs + len <= lock_offs + lock_len) && (ofs >= lock_offs); +++} +++ +++/* +++ * Lock a region of the flash. Compatible with ST Micro and similar flash. +++ * Supports only the block protection bits BP{0,1,2} in the status register +++ * (SR). Does not support these features found in newer SR bitfields: +++ * - TB: top/bottom protect - only handle TB=0 (top protect) +++ * - SEC: sector/block protect - only handle SEC=0 (block protect) +++ * - CMP: complement protect - only support CMP=0 (range is not complemented) +++ * +++ * Sample table portion for 8MB flash (Winbond w25q64fw): +++ * +++ * SEC | TB | BP2 | BP1 | BP0 | Prot Length | Protected Portion +++ * -------------------------------------------------------------------------- +++ * X | X | 0 | 0 | 0 | NONE | NONE +++ * 0 | 0 | 0 | 0 | 1 | 128 KB | Upper 1/64 +++ * 0 | 0 | 0 | 1 | 0 | 256 KB | Upper 1/32 +++ * 0 | 0 | 0 | 1 | 1 | 512 KB | Upper 1/16 +++ * 0 | 0 | 1 | 0 | 0 | 1 MB | Upper 1/8 +++ * 0 | 0 | 1 | 0 | 1 | 2 MB | Upper 1/4 +++ * 0 | 0 | 1 | 1 | 0 | 4 MB | Upper 1/2 +++ * X | X | 1 | 1 | 1 | 8 MB | ALL +++ * +++ * Returns negative on errors, 0 on success. +++ */ +++static int stm_lock(struct spi_nor *nor, loff_t ofs, uint64_t len) +++{ +++ struct mtd_info *mtd = &nor->mtd; +++ u8 status_old, status_new; +++ u8 mask = SR_BP2 | SR_BP1 | SR_BP0; +++ u8 shift = ffs(mask) - 1, pow, val; ++ ++ status_old = read_sr(nor); ++ ++- if (offset < mtd->size - (mtd->size / 2)) ++- status_new = status_old | SR_BP2 | SR_BP1 | SR_BP0; ++- else if (offset < mtd->size - (mtd->size / 4)) ++- status_new = (status_old & ~SR_BP0) | SR_BP2 | SR_BP1; ++- else if (offset < mtd->size - (mtd->size / 8)) ++- status_new = (status_old & ~SR_BP1) | SR_BP2 | SR_BP0; ++- else if (offset < mtd->size - (mtd->size / 16)) ++- status_new = (status_old & ~(SR_BP0 | SR_BP1)) | SR_BP2; ++- else if (offset < mtd->size - (mtd->size / 32)) ++- status_new = (status_old & ~SR_BP2) | SR_BP1 | SR_BP0; ++- else if (offset < mtd->size - (mtd->size / 64)) ++- status_new = (status_old & ~(SR_BP2 | SR_BP0)) | SR_BP1; ++- else ++- status_new = (status_old & ~(SR_BP2 | SR_BP1)) | SR_BP0; +++ /* SPI NOR always locks to the end */ +++ if (ofs + len != mtd->size) { +++ /* Does combined region extend to end? */ +++ if (!stm_is_locked_sr(nor, ofs + len, mtd->size - ofs - len, +++ status_old)) +++ return -EINVAL; +++ len = mtd->size - ofs; +++ } +++ +++ /* +++ * Need smallest pow such that: +++ * +++ * 1 / (2^pow) <= (len / size) +++ * +++ * so (assuming power-of-2 size) we do: +++ * +++ * pow = ceil(log2(size / len)) = log2(size) - floor(log2(len)) +++ */ +++ pow = ilog2(mtd->size) - ilog2(len); +++ val = mask - (pow << shift); +++ if (val & ~mask) +++ return -EINVAL; +++ /* Don't "lock" with no region! */ +++ if (!(val & mask)) +++ return -EINVAL; +++ +++ status_new = (status_old & ~mask) | val; ++ ++ /* Only modify protection if it will not unlock other areas */ ++- if ((status_new & (SR_BP2 | SR_BP1 | SR_BP0)) > ++- (status_old & (SR_BP2 | SR_BP1 | SR_BP0))) { ++- write_enable(nor); ++- ret = write_sr(nor, status_new); ++- if (ret) ++- goto err; +++ if ((status_new & mask) <= (status_old & mask)) +++ return -EINVAL; +++ +++ write_enable(nor); +++ return write_sr(nor, status_new); +++} +++ +++/* +++ * Unlock a region of the flash. See stm_lock() for more info +++ * +++ * Returns negative on errors, 0 on success. +++ */ +++static int stm_unlock(struct spi_nor *nor, loff_t ofs, uint64_t len) +++{ +++ struct mtd_info *mtd = &nor->mtd; +++ uint8_t status_old, status_new; +++ u8 mask = SR_BP2 | SR_BP1 | SR_BP0; +++ u8 shift = ffs(mask) - 1, pow, val; +++ +++ status_old = read_sr(nor); +++ +++ /* Cannot unlock; would unlock larger region than requested */ +++ if (stm_is_locked_sr(nor, ofs - mtd->erasesize, mtd->erasesize, +++ status_old)) +++ return -EINVAL; +++ +++ /* +++ * Need largest pow such that: +++ * +++ * 1 / (2^pow) >= (len / size) +++ * +++ * so (assuming power-of-2 size) we do: +++ * +++ * pow = floor(log2(size / len)) = log2(size) - ceil(log2(len)) +++ */ +++ pow = ilog2(mtd->size) - order_base_2(mtd->size - (ofs + len)); +++ if (ofs + len == mtd->size) { +++ val = 0; /* fully unlocked */ +++ } else { +++ val = mask - (pow << shift); +++ /* Some power-of-two sizes are not supported */ +++ if (val & ~mask) +++ return -EINVAL; ++ } ++ ++-err: ++- spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_LOCK); ++- return ret; +++ status_new = (status_old & ~mask) | val; +++ +++ /* Only modify protection if it will not lock other areas */ +++ if ((status_new & mask) >= (status_old & mask)) +++ return -EINVAL; +++ +++ write_enable(nor); +++ return write_sr(nor, status_new); ++ } ++ ++-static int spi_nor_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len) +++/* +++ * Check if a region of the flash is (completely) locked. See stm_lock() for +++ * more info. +++ * +++ * Returns 1 if entire region is locked, 0 if any portion is unlocked, and +++ * negative on errors. +++ */ +++static int stm_is_locked(struct spi_nor *nor, loff_t ofs, uint64_t len) +++{ +++ int status; +++ +++ status = read_sr(nor); +++ if (status < 0) +++ return status; +++ +++ return stm_is_locked_sr(nor, ofs, len, status); +++} +++ +++static int spi_nor_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len) ++ { ++ struct spi_nor *nor = mtd_to_spi_nor(mtd); ++- uint32_t offset = ofs; ++- uint8_t status_old, status_new; ++- int ret = 0; +++ int ret; ++ ++- ret = spi_nor_lock_and_prep(nor, SPI_NOR_OPS_UNLOCK); +++ ret = spi_nor_lock_and_prep(nor, SPI_NOR_OPS_LOCK); ++ if (ret) ++ return ret; ++ ++- /* Wait until finished previous command */ ++- ret = wait_till_ready(nor); ++- if (ret) ++- goto err; +++ ret = nor->flash_lock(nor, ofs, len); ++ ++- status_old = read_sr(nor); +++ spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_UNLOCK); +++ return ret; +++} ++ ++- if (offset+len > mtd->size - (mtd->size / 64)) ++- status_new = status_old & ~(SR_BP2 | SR_BP1 | SR_BP0); ++- else if (offset+len > mtd->size - (mtd->size / 32)) ++- status_new = (status_old & ~(SR_BP2 | SR_BP1)) | SR_BP0; ++- else if (offset+len > mtd->size - (mtd->size / 16)) ++- status_new = (status_old & ~(SR_BP2 | SR_BP0)) | SR_BP1; ++- else if (offset+len > mtd->size - (mtd->size / 8)) ++- status_new = (status_old & ~SR_BP2) | SR_BP1 | SR_BP0; ++- else if (offset+len > mtd->size - (mtd->size / 4)) ++- status_new = (status_old & ~(SR_BP0 | SR_BP1)) | SR_BP2; ++- else if (offset+len > mtd->size - (mtd->size / 2)) ++- status_new = (status_old & ~SR_BP1) | SR_BP2 | SR_BP0; ++- else ++- status_new = (status_old & ~SR_BP0) | SR_BP2 | SR_BP1; +++static int spi_nor_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len) +++{ +++ struct spi_nor *nor = mtd_to_spi_nor(mtd); +++ int ret; ++ ++- /* Only modify protection if it will not lock other areas */ ++- if ((status_new & (SR_BP2 | SR_BP1 | SR_BP0)) < ++- (status_old & (SR_BP2 | SR_BP1 | SR_BP0))) { ++- write_enable(nor); ++- ret = write_sr(nor, status_new); ++- if (ret) ++- goto err; ++- } +++ ret = spi_nor_lock_and_prep(nor, SPI_NOR_OPS_UNLOCK); +++ if (ret) +++ return ret; ++ ++-err: ++- spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_UNLOCK); +++ ret = nor->flash_unlock(nor, ofs, len); +++ +++ spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_LOCK); ++ return ret; ++ } ++ ++-struct flash_info { ++- /* JEDEC id zero means "no ID" (most older chips); otherwise it has ++- * a high byte of zero plus three data bytes: the manufacturer id, ++- * then a two byte device id. ++- */ ++- u32 jedec_id; ++- u16 ext_id; +++static int spi_nor_is_locked(struct mtd_info *mtd, loff_t ofs, uint64_t len) +++{ +++ struct spi_nor *nor = mtd_to_spi_nor(mtd); +++ int ret; ++ ++- /* The size listed here is what works with SPINOR_OP_SE, which isn't ++- * necessarily called a "sector" by the vendor. ++- */ ++- unsigned sector_size; ++- u16 n_sectors; +++ ret = spi_nor_lock_and_prep(nor, SPI_NOR_OPS_UNLOCK); +++ if (ret) +++ return ret; ++ ++- u16 page_size; ++- u16 addr_width; +++ ret = nor->flash_is_locked(nor, ofs, len); ++ ++- u16 flags; ++-#define SECT_4K 0x01 /* SPINOR_OP_BE_4K works uniformly */ ++-#define SPI_NOR_NO_ERASE 0x02 /* No erase command needed */ ++-#define SST_WRITE 0x04 /* use SST byte programming */ ++-#define SPI_NOR_NO_FR 0x08 /* Can't do fastread */ ++-#define SECT_4K_PMC 0x10 /* SPINOR_OP_BE_4K_PMC works uniformly */ ++-#define SPI_NOR_DUAL_READ 0x20 /* Flash supports Dual Read */ ++-#define SPI_NOR_QUAD_READ 0x40 /* Flash supports Quad Read */ ++-#define USE_FSR 0x80 /* use flag status register */ ++-}; +++ spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_LOCK); +++ return ret; +++} ++ +++/* Used when the "_ext_id" is two bytes at most */ ++ #define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors, _flags) \ ++- ((kernel_ulong_t)&(struct flash_info) { \ ++- .jedec_id = (_jedec_id), \ ++- .ext_id = (_ext_id), \ +++ .id = { \ +++ ((_jedec_id) >> 16) & 0xff, \ +++ ((_jedec_id) >> 8) & 0xff, \ +++ (_jedec_id) & 0xff, \ +++ ((_ext_id) >> 8) & 0xff, \ +++ (_ext_id) & 0xff, \ +++ }, \ +++ .id_len = (!(_jedec_id) ? 0 : (3 + ((_ext_id) ? 2 : 0))), \ +++ .sector_size = (_sector_size), \ +++ .n_sectors = (_n_sectors), \ +++ .page_size = 256, \ +++ .flags = (_flags), +++ +++#define INFO6(_jedec_id, _ext_id, _sector_size, _n_sectors, _flags) \ +++ .id = { \ +++ ((_jedec_id) >> 16) & 0xff, \ +++ ((_jedec_id) >> 8) & 0xff, \ +++ (_jedec_id) & 0xff, \ +++ ((_ext_id) >> 16) & 0xff, \ +++ ((_ext_id) >> 8) & 0xff, \ +++ (_ext_id) & 0xff, \ +++ }, \ +++ .id_len = 6, \ ++ .sector_size = (_sector_size), \ ++ .n_sectors = (_n_sectors), \ ++ .page_size = 256, \ ++- .flags = (_flags), \ ++- }) +++ .flags = (_flags), ++ ++ #define CAT25_INFO(_sector_size, _n_sectors, _page_size, _addr_width, _flags) \ ++- ((kernel_ulong_t)&(struct flash_info) { \ ++ .sector_size = (_sector_size), \ ++ .n_sectors = (_n_sectors), \ ++ .page_size = (_page_size), \ ++ .addr_width = (_addr_width), \ ++- .flags = (_flags), \ ++- }) +++ .flags = (_flags), ++ ++ /* NOTE: double check command sets and memory organization when you add ++ * more nor chips. This current list focusses on newer chips, which ++ * have been converging on command sets which including JEDEC ID. +++ * +++ * All newly added entries should describe *hardware* and should use SECT_4K +++ * (or SECT_4K_PMC) if hardware supports erasing 4 KiB sectors. For usage +++ * scenarios excluding small sectors there is config option that can be +++ * disabled: CONFIG_MTD_SPI_NOR_USE_4K_SECTORS. +++ * For historical (and compatibility) reasons (before we got above config) some +++ * old entries may be missing 4K flag. ++ */ ++-static const struct spi_device_id spi_nor_ids[] = { +++static const struct flash_info spi_nor_ids[] = { ++ /* Atmel -- some are (confusingly) marketed as "DataFlash" */ ++ { "at25fs010", INFO(0x1f6601, 0, 32 * 1024, 4, SECT_4K) }, ++ { "at25fs040", INFO(0x1f6604, 0, 64 * 1024, 8, SECT_4K) }, ++@@ -499,6 +684,7 @@ static const struct spi_device_id spi_no ++ { "en25q64", INFO(0x1c3017, 0, 64 * 1024, 128, SECT_4K) }, ++ { "en25qh128", INFO(0x1c7018, 0, 64 * 1024, 256, 0) }, ++ { "en25qh256", INFO(0x1c7019, 0, 64 * 1024, 512, 0) }, +++ { "en25s64", INFO(0x1c3817, 0, 64 * 1024, 128, SECT_4K) }, ++ ++ /* ESMT */ ++ { "f25l32pa", INFO(0x8c2016, 0, 64 * 1024, 64, SECT_4K) }, ++@@ -507,16 +693,24 @@ static const struct spi_device_id spi_no ++ { "mr25h256", CAT25_INFO( 32 * 1024, 1, 256, 2, SPI_NOR_NO_ERASE | SPI_NOR_NO_FR) }, ++ { "mr25h10", CAT25_INFO(128 * 1024, 1, 256, 3, SPI_NOR_NO_ERASE | SPI_NOR_NO_FR) }, ++ +++ /* Fujitsu */ +++ { "mb85rs1mt", INFO(0x047f27, 0, 128 * 1024, 1, SPI_NOR_NO_ERASE) }, +++ ++ /* GigaDevice */ ++ { "gd25q32", INFO(0xc84016, 0, 64 * 1024, 64, SECT_4K) }, ++ { "gd25q64", INFO(0xc84017, 0, 64 * 1024, 128, SECT_4K) }, +++ { "gd25q128", INFO(0xc84018, 0, 64 * 1024, 256, SECT_4K) }, ++ ++ /* Intel/Numonyx -- xxxs33b */ ++ { "160s33b", INFO(0x898911, 0, 64 * 1024, 32, 0) }, ++ { "320s33b", INFO(0x898912, 0, 64 * 1024, 64, 0) }, ++ { "640s33b", INFO(0x898913, 0, 64 * 1024, 128, 0) }, ++ +++ /* ISSI */ +++ { "is25cd512", INFO(0x7f9d20, 0, 32 * 1024, 2, SECT_4K) }, +++ ++ /* Macronix */ +++ { "mx25l512e", INFO(0xc22010, 0, 64 * 1024, 1, SECT_4K) }, ++ { "mx25l2005a", INFO(0xc22012, 0, 64 * 1024, 4, SECT_4K) }, ++ { "mx25l4005a", INFO(0xc22013, 0, 64 * 1024, 8, SECT_4K) }, ++ { "mx25l8005", INFO(0xc22014, 0, 64 * 1024, 16, 0) }, ++@@ -524,6 +718,7 @@ static const struct spi_device_id spi_no ++ { "mx25l3205d", INFO(0xc22016, 0, 64 * 1024, 64, 0) }, ++ { "mx25l3255e", INFO(0xc29e16, 0, 64 * 1024, 64, SECT_4K) }, ++ { "mx25l6405d", INFO(0xc22017, 0, 64 * 1024, 128, 0) }, +++ { "mx25u6435f", INFO(0xc22537, 0, 64 * 1024, 128, SECT_4K) }, ++ { "mx25l12805d", INFO(0xc22018, 0, 64 * 1024, 256, 0) }, ++ { "mx25l12855e", INFO(0xc22618, 0, 64 * 1024, 256, 0) }, ++ { "mx25l25635e", INFO(0xc22019, 0, 64 * 1024, 512, 0) }, ++@@ -532,13 +727,16 @@ static const struct spi_device_id spi_no ++ { "mx66l1g55g", INFO(0xc2261b, 0, 64 * 1024, 2048, SPI_NOR_QUAD_READ) }, ++ ++ /* Micron */ ++- { "n25q064", INFO(0x20ba17, 0, 64 * 1024, 128, 0) }, ++- { "n25q128a11", INFO(0x20bb18, 0, 64 * 1024, 256, 0) }, ++- { "n25q128a13", INFO(0x20ba18, 0, 64 * 1024, 256, 0) }, ++- { "n25q256a", INFO(0x20ba19, 0, 64 * 1024, 512, SECT_4K) }, ++- { "n25q512a", INFO(0x20bb20, 0, 64 * 1024, 1024, SECT_4K) }, ++- { "n25q512ax3", INFO(0x20ba20, 0, 64 * 1024, 1024, USE_FSR) }, ++- { "n25q00", INFO(0x20ba21, 0, 64 * 1024, 2048, USE_FSR) }, +++ { "n25q032", INFO(0x20ba16, 0, 64 * 1024, 64, SPI_NOR_QUAD_READ) }, +++ { "n25q032a", INFO(0x20bb16, 0, 64 * 1024, 64, SPI_NOR_QUAD_READ) }, +++ { "n25q064", INFO(0x20ba17, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_QUAD_READ) }, +++ { "n25q064a", INFO(0x20bb17, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_QUAD_READ) }, +++ { "n25q128a11", INFO(0x20bb18, 0, 64 * 1024, 256, SPI_NOR_QUAD_READ) }, +++ { "n25q128a13", INFO(0x20ba18, 0, 64 * 1024, 256, SPI_NOR_QUAD_READ) }, +++ { "n25q256a", INFO(0x20ba19, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_QUAD_READ) }, +++ { "n25q512a", INFO(0x20bb20, 0, 64 * 1024, 1024, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ) }, +++ { "n25q512ax3", INFO(0x20ba20, 0, 64 * 1024, 1024, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ) }, +++ { "n25q00", INFO(0x20ba21, 0, 64 * 1024, 2048, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ) }, ++ ++ /* PMC */ ++ { "pm25lv512", INFO(0, 0, 32 * 1024, 2, SECT_4K_PMC) }, ++@@ -549,23 +747,28 @@ static const struct spi_device_id spi_no ++ * for the chips listed here (without boot sectors). ++ */ ++ { "s25sl032p", INFO(0x010215, 0x4d00, 64 * 1024, 64, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, ++- { "s25sl064p", INFO(0x010216, 0x4d00, 64 * 1024, 128, 0) }, +++ { "s25sl064p", INFO(0x010216, 0x4d00, 64 * 1024, 128, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, ++ { "s25fl256s0", INFO(0x010219, 0x4d00, 256 * 1024, 128, 0) }, ++ { "s25fl256s1", INFO(0x010219, 0x4d01, 64 * 1024, 512, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, ++ { "s25fl512s", INFO(0x010220, 0x4d00, 256 * 1024, 256, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, ++ { "s70fl01gs", INFO(0x010221, 0x4d00, 256 * 1024, 256, 0) }, ++ { "s25sl12800", INFO(0x012018, 0x0300, 256 * 1024, 64, 0) }, ++ { "s25sl12801", INFO(0x012018, 0x0301, 64 * 1024, 256, 0) }, ++- { "s25fl129p0", INFO(0x012018, 0x4d00, 256 * 1024, 64, 0) }, ++- { "s25fl129p1", INFO(0x012018, 0x4d01, 64 * 1024, 256, 0) }, +++ { "s25fl128s", INFO6(0x012018, 0x4d0180, 64 * 1024, 256, SECT_4K | SPI_NOR_QUAD_READ) }, +++ { "s25fl129p0", INFO(0x012018, 0x4d00, 256 * 1024, 64, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, +++ { "s25fl129p1", INFO(0x012018, 0x4d01, 64 * 1024, 256, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, ++ { "s25sl004a", INFO(0x010212, 0, 64 * 1024, 8, 0) }, ++ { "s25sl008a", INFO(0x010213, 0, 64 * 1024, 16, 0) }, ++ { "s25sl016a", INFO(0x010214, 0, 64 * 1024, 32, 0) }, ++ { "s25sl032a", INFO(0x010215, 0, 64 * 1024, 64, 0) }, ++ { "s25sl064a", INFO(0x010216, 0, 64 * 1024, 128, 0) }, ++- { "s25fl008k", INFO(0xef4014, 0, 64 * 1024, 16, SECT_4K) }, ++- { "s25fl016k", INFO(0xef4015, 0, 64 * 1024, 32, SECT_4K) }, +++ { "s25fl004k", INFO(0xef4013, 0, 64 * 1024, 8, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, +++ { "s25fl008k", INFO(0xef4014, 0, 64 * 1024, 16, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, +++ { "s25fl016k", INFO(0xef4015, 0, 64 * 1024, 32, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, ++ { "s25fl064k", INFO(0xef4017, 0, 64 * 1024, 128, SECT_4K) }, +++ { "s25fl132k", INFO(0x014016, 0, 64 * 1024, 64, SECT_4K) }, +++ { "s25fl164k", INFO(0x014017, 0, 64 * 1024, 128, SECT_4K) }, +++ { "s25fl204k", INFO(0x014013, 0, 64 * 1024, 8, SECT_4K | SPI_NOR_DUAL_READ) }, ++ ++ /* SST -- large erase sizes are "overlays", "sectors" are 4K */ ++ { "sst25vf040b", INFO(0xbf258d, 0, 64 * 1024, 8, SECT_4K | SST_WRITE) }, ++@@ -576,7 +779,10 @@ static const struct spi_device_id spi_no ++ { "sst25wf512", INFO(0xbf2501, 0, 64 * 1024, 1, SECT_4K | SST_WRITE) }, ++ { "sst25wf010", INFO(0xbf2502, 0, 64 * 1024, 2, SECT_4K | SST_WRITE) }, ++ { "sst25wf020", INFO(0xbf2503, 0, 64 * 1024, 4, SECT_4K | SST_WRITE) }, +++ { "sst25wf020a", INFO(0x621612, 0, 64 * 1024, 4, SECT_4K) }, +++ { "sst25wf040b", INFO(0x621613, 0, 64 * 1024, 8, SECT_4K) }, ++ { "sst25wf040", INFO(0xbf2504, 0, 64 * 1024, 8, SECT_4K | SST_WRITE) }, +++ { "sst25wf080", INFO(0xbf2505, 0, 64 * 1024, 16, SECT_4K | SST_WRITE) }, ++ ++ /* ST Microelectronics -- newer production may have feature updates */ ++ { "m25p05", INFO(0x202010, 0, 32 * 1024, 2, 0) }, ++@@ -588,7 +794,6 @@ static const struct spi_device_id spi_no ++ { "m25p32", INFO(0x202016, 0, 64 * 1024, 64, 0) }, ++ { "m25p64", INFO(0x202017, 0, 64 * 1024, 128, 0) }, ++ { "m25p128", INFO(0x202018, 0, 256 * 1024, 64, 0) }, ++- { "n25q032", INFO(0x20ba16, 0, 64 * 1024, 64, 0) }, ++ ++ { "m25p05-nonjedec", INFO(0, 0, 32 * 1024, 2, 0) }, ++ { "m25p10-nonjedec", INFO(0, 0, 32 * 1024, 4, 0) }, ++@@ -616,6 +821,7 @@ static const struct spi_device_id spi_no ++ { "m25px80", INFO(0x207114, 0, 64 * 1024, 16, 0) }, ++ ++ /* Winbond -- w25x "blocks" are 64K, "sectors" are 4KiB */ +++ { "w25x05", INFO(0xef3010, 0, 64 * 1024, 1, SECT_4K) }, ++ { "w25x10", INFO(0xef3011, 0, 64 * 1024, 2, SECT_4K) }, ++ { "w25x20", INFO(0xef3012, 0, 64 * 1024, 4, SECT_4K) }, ++ { "w25x40", INFO(0xef3013, 0, 64 * 1024, 8, SECT_4K) }, ++@@ -623,9 +829,11 @@ static const struct spi_device_id spi_no ++ { "w25x16", INFO(0xef3015, 0, 64 * 1024, 32, SECT_4K) }, ++ { "w25x32", INFO(0xef3016, 0, 64 * 1024, 64, SECT_4K) }, ++ { "w25q32", INFO(0xef4016, 0, 64 * 1024, 64, SECT_4K) }, ++- { "w25q32dw", INFO(0xef6016, 0, 64 * 1024, 64, SECT_4K) }, +++ { "w25q32dw", INFO(0xef6016, 0, 64 * 1024, 64, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, ++ { "w25x64", INFO(0xef3017, 0, 64 * 1024, 128, SECT_4K) }, ++ { "w25q64", INFO(0xef4017, 0, 64 * 1024, 128, SECT_4K) }, +++ { "w25q64dw", INFO(0xef6017, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, +++ { "w25q128fw", INFO(0xef6018, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, ++ { "w25q80", INFO(0xef5014, 0, 64 * 1024, 16, SECT_4K) }, ++ { "w25q80bl", INFO(0xef4014, 0, 64 * 1024, 16, SECT_4K) }, ++ { "w25q128", INFO(0xef4018, 0, 64 * 1024, 256, SECT_4K) }, ++@@ -640,35 +848,27 @@ static const struct spi_device_id spi_no ++ { }, ++ }; ++ ++-static const struct spi_device_id *spi_nor_read_id(struct spi_nor *nor) +++static const struct flash_info *spi_nor_read_id(struct spi_nor *nor) ++ { ++ int tmp; ++- u8 id[5]; ++- u32 jedec; ++- u16 ext_jedec; ++- struct flash_info *info; +++ u8 id[SPI_NOR_MAX_ID_LEN]; +++ const struct flash_info *info; ++ ++- tmp = nor->read_reg(nor, SPINOR_OP_RDID, id, 5); +++ tmp = nor->read_reg(nor, SPINOR_OP_RDID, id, SPI_NOR_MAX_ID_LEN); ++ if (tmp < 0) { ++ dev_dbg(nor->dev, " error %d reading JEDEC ID\n", tmp); ++ return ERR_PTR(tmp); ++ } ++- jedec = id[0]; ++- jedec = jedec << 8; ++- jedec |= id[1]; ++- jedec = jedec << 8; ++- jedec |= id[2]; ++- ++- ext_jedec = id[3] << 8 | id[4]; ++ ++ for (tmp = 0; tmp < ARRAY_SIZE(spi_nor_ids) - 1; tmp++) { ++- info = (void *)spi_nor_ids[tmp].driver_data; ++- if (info->jedec_id == jedec) { ++- if (info->ext_id == 0 || info->ext_id == ext_jedec) +++ info = &spi_nor_ids[tmp]; +++ if (info->id_len) { +++ if (!memcmp(info->id, id, info->id_len)) ++ return &spi_nor_ids[tmp]; ++ } ++ } ++- dev_err(nor->dev, "unrecognized JEDEC id %06x\n", jedec); +++ dev_err(nor->dev, "unrecognized JEDEC id bytes: %02x, %2x, %2x\n", +++ id[0], id[1], id[2]); ++ return ERR_PTR(-ENODEV); ++ } ++ ++@@ -703,11 +903,6 @@ static int sst_write(struct mtd_info *mt ++ if (ret) ++ return ret; ++ ++- /* Wait until finished previous write command. */ ++- ret = wait_till_ready(nor); ++- if (ret) ++- goto time_out; ++- ++ write_enable(nor); ++ ++ nor->sst_write_second = false; ++@@ -719,7 +914,7 @@ static int sst_write(struct mtd_info *mt ++ ++ /* write one byte. */ ++ nor->write(nor, to, 1, retlen, buf); ++- ret = wait_till_ready(nor); +++ ret = spi_nor_wait_till_ready(nor); ++ if (ret) ++ goto time_out; ++ } ++@@ -731,7 +926,7 @@ static int sst_write(struct mtd_info *mt ++ ++ /* write two bytes. */ ++ nor->write(nor, to, 2, retlen, buf + actual); ++- ret = wait_till_ready(nor); +++ ret = spi_nor_wait_till_ready(nor); ++ if (ret) ++ goto time_out; ++ to += 2; ++@@ -740,7 +935,7 @@ static int sst_write(struct mtd_info *mt ++ nor->sst_write_second = false; ++ ++ write_disable(nor); ++- ret = wait_till_ready(nor); +++ ret = spi_nor_wait_till_ready(nor); ++ if (ret) ++ goto time_out; ++ ++@@ -751,7 +946,7 @@ static int sst_write(struct mtd_info *mt ++ nor->program_opcode = SPINOR_OP_BP; ++ nor->write(nor, to, 1, retlen, buf + actual); ++ ++- ret = wait_till_ready(nor); +++ ret = spi_nor_wait_till_ready(nor); ++ if (ret) ++ goto time_out; ++ write_disable(nor); ++@@ -779,11 +974,6 @@ static int spi_nor_write(struct mtd_info ++ if (ret) ++ return ret; ++ ++- /* Wait until finished previous write command. */ ++- ret = wait_till_ready(nor); ++- if (ret) ++- goto write_err; ++- ++ write_enable(nor); ++ ++ page_offset = to & (nor->page_size - 1); ++@@ -802,16 +992,20 @@ static int spi_nor_write(struct mtd_info ++ if (page_size > nor->page_size) ++ page_size = nor->page_size; ++ ++- wait_till_ready(nor); +++ ret = spi_nor_wait_till_ready(nor); +++ if (ret) +++ goto write_err; +++ ++ write_enable(nor); ++ ++ nor->write(nor, to + i, page_size, retlen, buf + i); ++ } ++ } ++ +++ ret = spi_nor_wait_till_ready(nor); ++ write_err: ++ spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_WRITE); ++- return 0; +++ return ret; ++ } ++ ++ static int macronix_quad_enable(struct spi_nor *nor) ++@@ -821,10 +1015,9 @@ static int macronix_quad_enable(struct s ++ val = read_sr(nor); ++ write_enable(nor); ++ ++- nor->cmd_buf[0] = val | SR_QUAD_EN_MX; ++- nor->write_reg(nor, SPINOR_OP_WRSR, nor->cmd_buf, 1, 0); +++ write_sr(nor, val | SR_QUAD_EN_MX); ++ ++- if (wait_till_ready(nor)) +++ if (spi_nor_wait_till_ready(nor)) ++ return 1; ++ ++ ret = read_sr(nor); ++@@ -847,7 +1040,7 @@ static int write_sr_cr(struct spi_nor *n ++ nor->cmd_buf[0] = val & 0xff; ++ nor->cmd_buf[1] = (val >> 8); ++ ++- return nor->write_reg(nor, SPINOR_OP_WRSR, nor->cmd_buf, 2, 0); +++ return nor->write_reg(nor, SPINOR_OP_WRSR, nor->cmd_buf, 2); ++ } ++ ++ static int spansion_quad_enable(struct spi_nor *nor) ++@@ -874,18 +1067,20 @@ static int spansion_quad_enable(struct s ++ return 0; ++ } ++ ++-static int set_quad_mode(struct spi_nor *nor, u32 jedec_id) +++static int set_quad_mode(struct spi_nor *nor, const struct flash_info *info) ++ { ++ int status; ++ ++- switch (JEDEC_MFR(jedec_id)) { ++- case CFI_MFR_MACRONIX: +++ switch (JEDEC_MFR(info)) { +++ case SNOR_MFR_MACRONIX: ++ status = macronix_quad_enable(nor); ++ if (status) { ++ dev_err(nor->dev, "Macronix quad-read not enabled\n"); ++ return -EINVAL; ++ } ++ return status; +++ case SNOR_MFR_MICRON: +++ return 0; ++ default: ++ status = spansion_quad_enable(nor); ++ if (status) { ++@@ -904,21 +1099,15 @@ static int spi_nor_check(struct spi_nor ++ return -EINVAL; ++ } ++ ++- if (!nor->read_id) ++- nor->read_id = spi_nor_read_id; ++- if (!nor->wait_till_ready) ++- nor->wait_till_ready = spi_nor_wait_till_ready; ++- ++ return 0; ++ } ++ ++ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode) ++ { ++- const struct spi_device_id *id = NULL; ++- struct flash_info *info; +++ const struct flash_info *info = NULL; ++ struct device *dev = nor->dev; ++- struct mtd_info *mtd = nor->mtd; ++- struct device_node *np = dev->of_node; +++ struct mtd_info *mtd = &nor->mtd; +++ struct device_node *np = nor->flash_node; ++ int ret; ++ int i; ++ ++@@ -926,19 +1115,25 @@ int spi_nor_scan(struct spi_nor *nor, co ++ if (ret) ++ return ret; ++ ++- id = spi_nor_match_id(name); ++- if (!id) +++ if (name) +++ info = spi_nor_match_id(name); +++ /* Try to auto-detect if chip name wasn't specified or not found */ +++ if (!info) +++ info = spi_nor_read_id(nor); +++ if (IS_ERR_OR_NULL(info)) ++ return -ENOENT; ++ ++- info = (void *)id->driver_data; ++- ++- if (info->jedec_id) { ++- const struct spi_device_id *jid; +++ /* +++ * If caller has specified name of flash model that can normally be +++ * detected using JEDEC, let's verify it. +++ */ +++ if (name && info->id_len) { +++ const struct flash_info *jinfo; ++ ++- jid = nor->read_id(nor); ++- if (IS_ERR(jid)) { ++- return PTR_ERR(jid); ++- } else if (jid != id) { +++ jinfo = spi_nor_read_id(nor); +++ if (IS_ERR(jinfo)) { +++ return PTR_ERR(jinfo); +++ } else if (jinfo != info) { ++ /* ++ * JEDEC knows better, so overwrite platform ID. We ++ * can't trust partitions any longer, but we'll let ++@@ -947,28 +1142,28 @@ int spi_nor_scan(struct spi_nor *nor, co ++ * information, even if it's not 100% accurate. ++ */ ++ dev_warn(dev, "found %s, expected %s\n", ++- jid->name, id->name); ++- id = jid; ++- info = (void *)jid->driver_data; +++ jinfo->name, info->name); +++ info = jinfo; ++ } ++ } ++ ++ mutex_init(&nor->lock); ++ ++ /* ++- * Atmel, SST and Intel/Numonyx serial nor tend to power ++- * up with the software protection bits set +++ * Atmel, SST, Intel/Numonyx, and others serial NOR tend to power up +++ * with the software protection bits set ++ */ ++ ++- if (JEDEC_MFR(info->jedec_id) == CFI_MFR_ATMEL || ++- JEDEC_MFR(info->jedec_id) == CFI_MFR_INTEL || ++- JEDEC_MFR(info->jedec_id) == CFI_MFR_SST) { +++ if (JEDEC_MFR(info) == SNOR_MFR_ATMEL || +++ JEDEC_MFR(info) == SNOR_MFR_INTEL || +++ JEDEC_MFR(info) == SNOR_MFR_SST) { ++ write_enable(nor); ++ write_sr(nor, 0); ++ } ++ ++ if (!mtd->name) ++ mtd->name = dev_name(dev); +++ mtd->priv = nor; ++ mtd->type = MTD_NORFLASH; ++ mtd->writesize = 1; ++ mtd->flags = MTD_CAP_NORFLASH; ++@@ -976,10 +1171,17 @@ int spi_nor_scan(struct spi_nor *nor, co ++ mtd->_erase = spi_nor_erase; ++ mtd->_read = spi_nor_read; ++ ++- /* nor protection support for STmicro chips */ ++- if (JEDEC_MFR(info->jedec_id) == CFI_MFR_ST) { +++ /* NOR protection support for STmicro/Micron chips and similar */ +++ if (JEDEC_MFR(info) == SNOR_MFR_MICRON) { +++ nor->flash_lock = stm_lock; +++ nor->flash_unlock = stm_unlock; +++ nor->flash_is_locked = stm_is_locked; +++ } +++ +++ if (nor->flash_lock && nor->flash_unlock && nor->flash_is_locked) { ++ mtd->_lock = spi_nor_lock; ++ mtd->_unlock = spi_nor_unlock; +++ mtd->_is_locked = spi_nor_is_locked; ++ } ++ ++ /* sst nor chips use AAI word program */ ++@@ -988,9 +1190,8 @@ int spi_nor_scan(struct spi_nor *nor, co ++ else ++ mtd->_write = spi_nor_write; ++ ++- if ((info->flags & USE_FSR) && ++- nor->wait_till_ready == spi_nor_wait_till_ready) ++- nor->wait_till_ready = spi_nor_wait_till_fsr_ready; +++ if (info->flags & USE_FSR) +++ nor->flags |= SNOR_F_USE_FSR; ++ ++ #ifdef CONFIG_MTD_SPI_NOR_USE_4K_SECTORS ++ /* prefer "small sector" erase if possible */ ++@@ -1031,7 +1232,7 @@ int spi_nor_scan(struct spi_nor *nor, co ++ ++ /* Quad/Dual-read mode takes precedence over fast/normal */ ++ if (mode == SPI_NOR_QUAD && info->flags & SPI_NOR_QUAD_READ) { ++- ret = set_quad_mode(nor, info->jedec_id); +++ ret = set_quad_mode(nor, info); ++ if (ret) { ++ dev_err(dev, "quad mode not supported\n"); ++ return ret; ++@@ -1067,7 +1268,7 @@ int spi_nor_scan(struct spi_nor *nor, co ++ else if (mtd->size > 0x1000000) { ++ /* enable 4-byte addressing if the device exceeds 16MiB */ ++ nor->addr_width = 4; ++- if (JEDEC_MFR(info->jedec_id) == CFI_MFR_AMD) { +++ if (JEDEC_MFR(info) == SNOR_MFR_SPANSION) { ++ /* Dedicated 4-byte command set */ ++ switch (nor->flash_read) { ++ case SPI_NOR_QUAD: ++@@ -1088,14 +1289,14 @@ int spi_nor_scan(struct spi_nor *nor, co ++ nor->erase_opcode = SPINOR_OP_SE_4B; ++ mtd->erasesize = info->sector_size; ++ } else ++- set_4byte(nor, info->jedec_id, 1); +++ set_4byte(nor, info, 1); ++ } else { ++ nor->addr_width = 3; ++ } ++ ++ nor->read_dummy = spi_nor_read_dummy_cycles(nor); ++ ++- dev_info(dev, "%s (%lld Kbytes)\n", id->name, +++ dev_info(dev, "%s (%lld Kbytes)\n", info->name, ++ (long long)mtd->size >> 10); ++ ++ dev_dbg(dev, ++@@ -1118,11 +1319,11 @@ int spi_nor_scan(struct spi_nor *nor, co ++ } ++ EXPORT_SYMBOL_GPL(spi_nor_scan); ++ ++-static const struct spi_device_id *spi_nor_match_id(const char *name) +++static const struct flash_info *spi_nor_match_id(const char *name) ++ { ++- const struct spi_device_id *id = spi_nor_ids; +++ const struct flash_info *id = spi_nor_ids; ++ ++- while (id->name[0]) { +++ while (id->name) { ++ if (!strcmp(name, id->name)) ++ return id; ++ id++; ++--- a/include/linux/mtd/spi-nor.h +++++ b/include/linux/mtd/spi-nor.h ++@@ -10,6 +10,23 @@ ++ #ifndef __LINUX_MTD_SPI_NOR_H ++ #define __LINUX_MTD_SPI_NOR_H ++ +++#include +++#include +++ +++/* +++ * Manufacturer IDs +++ * +++ * The first byte returned from the flash after sending opcode SPINOR_OP_RDID. +++ * Sometimes these are the same as CFI IDs, but sometimes they aren't. +++ */ +++#define SNOR_MFR_ATMEL CFI_MFR_ATMEL +++#define SNOR_MFR_INTEL CFI_MFR_INTEL +++#define SNOR_MFR_MICRON CFI_MFR_ST /* ST Micro <--> Micron */ +++#define SNOR_MFR_MACRONIX CFI_MFR_MACRONIX +++#define SNOR_MFR_SPANSION CFI_MFR_AMD +++#define SNOR_MFR_SST CFI_MFR_SST +++#define SNOR_MFR_WINBOND 0xef /* Also used by some Spansion */ +++ ++ /* ++ * Note on opcode nomenclature: some opcodes have a format like ++ * SPINOR_OP_FUNCTION{4,}_x_y_z. The numbers x, y, and z stand for the number ++@@ -56,22 +73,29 @@ ++ /* Used for Spansion flashes only. */ ++ #define SPINOR_OP_BRWR 0x17 /* Bank register write */ ++ +++/* Used for Micron flashes only. */ +++#define SPINOR_OP_RD_EVCR 0x65 /* Read EVCR register */ +++#define SPINOR_OP_WD_EVCR 0x61 /* Write EVCR register */ +++ ++ /* Status Register bits. */ ++-#define SR_WIP 1 /* Write in progress */ ++-#define SR_WEL 2 /* Write enable latch */ +++#define SR_WIP BIT(0) /* Write in progress */ +++#define SR_WEL BIT(1) /* Write enable latch */ ++ /* meaning of other SR_* bits may differ between vendors */ ++-#define SR_BP0 4 /* Block protect 0 */ ++-#define SR_BP1 8 /* Block protect 1 */ ++-#define SR_BP2 0x10 /* Block protect 2 */ ++-#define SR_SRWD 0x80 /* SR write protect */ +++#define SR_BP0 BIT(2) /* Block protect 0 */ +++#define SR_BP1 BIT(3) /* Block protect 1 */ +++#define SR_BP2 BIT(4) /* Block protect 2 */ +++#define SR_SRWD BIT(7) /* SR write protect */ +++ +++#define SR_QUAD_EN_MX BIT(6) /* Macronix Quad I/O */ ++ ++-#define SR_QUAD_EN_MX 0x40 /* Macronix Quad I/O */ +++/* Enhanced Volatile Configuration Register bits */ +++#define EVCR_QUAD_EN_MICRON BIT(7) /* Micron Quad I/O */ ++ ++ /* Flag Status Register bits */ ++-#define FSR_READY 0x80 +++#define FSR_READY BIT(7) ++ ++ /* Configuration Register bits. */ ++-#define CR_QUAD_EN_SPAN 0x2 /* Spansion Quad I/O */ +++#define CR_QUAD_EN_SPAN BIT(1) /* Spansion Quad I/O */ ++ ++ enum read_mode { ++ SPI_NOR_NORMAL = 0, ++@@ -80,33 +104,6 @@ enum read_mode { ++ SPI_NOR_QUAD, ++ }; ++ ++-/** ++- * struct spi_nor_xfer_cfg - Structure for defining a Serial Flash transfer ++- * @wren: command for "Write Enable", or 0x00 for not required ++- * @cmd: command for operation ++- * @cmd_pins: number of pins to send @cmd (1, 2, 4) ++- * @addr: address for operation ++- * @addr_pins: number of pins to send @addr (1, 2, 4) ++- * @addr_width: number of address bytes ++- * (3,4, or 0 for address not required) ++- * @mode: mode data ++- * @mode_pins: number of pins to send @mode (1, 2, 4) ++- * @mode_cycles: number of mode cycles (0 for mode not required) ++- * @dummy_cycles: number of dummy cycles (0 for dummy not required) ++- */ ++-struct spi_nor_xfer_cfg { ++- u8 wren; ++- u8 cmd; ++- u8 cmd_pins; ++- u32 addr; ++- u8 addr_pins; ++- u8 addr_width; ++- u8 mode; ++- u8 mode_pins; ++- u8 mode_cycles; ++- u8 dummy_cycles; ++-}; ++- ++ #define SPI_NOR_MAX_CMD_SIZE 8 ++ enum spi_nor_ops { ++ SPI_NOR_OPS_READ = 0, ++@@ -116,11 +113,18 @@ enum spi_nor_ops { ++ SPI_NOR_OPS_UNLOCK, ++ }; ++ +++enum spi_nor_option_flags { +++ SNOR_F_USE_FSR = BIT(0), +++}; +++ +++struct mtd_info; +++ ++ /** ++ * struct spi_nor - Structure for defining a the SPI NOR layer ++ * @mtd: point to a mtd_info structure ++ * @lock: the lock for the read/write/erase/lock/unlock operations ++ * @dev: point to a spi device, or a spi nor controller device. +++ * @flash_node: point to a device node describing this flash instance. ++ * @page_size: the page size of the SPI NOR ++ * @addr_width: number of address bytes ++ * @erase_opcode: the opcode for erasing a sector ++@@ -129,29 +133,29 @@ enum spi_nor_ops { ++ * @program_opcode: the program opcode ++ * @flash_read: the mode of the read ++ * @sst_write_second: used by the SST write operation ++- * @cfg: used by the read_xfer/write_xfer +++ * @flags: flag options for the current SPI-NOR (SNOR_F_*) ++ * @cmd_buf: used by the write_reg ++ * @prepare: [OPTIONAL] do some preparations for the ++ * read/write/erase/lock/unlock operations ++ * @unprepare: [OPTIONAL] do some post work after the ++ * read/write/erase/lock/unlock operations ++- * @read_xfer: [OPTIONAL] the read fundamental primitive ++- * @write_xfer: [OPTIONAL] the writefundamental primitive ++ * @read_reg: [DRIVER-SPECIFIC] read out the register ++ * @write_reg: [DRIVER-SPECIFIC] write data to the register ++- * @read_id: [REPLACEABLE] read out the ID data, and find ++- * the proper spi_device_id ++- * @wait_till_ready: [REPLACEABLE] wait till the NOR becomes ready ++ * @read: [DRIVER-SPECIFIC] read data from the SPI NOR ++ * @write: [DRIVER-SPECIFIC] write data to the SPI NOR ++ * @erase: [DRIVER-SPECIFIC] erase a sector of the SPI NOR ++ * at the offset @offs +++ * @flash_lock: [FLASH-SPECIFIC] lock a region of the SPI NOR +++ * @flash_unlock: [FLASH-SPECIFIC] unlock a region of the SPI NOR +++ * @flash_is_locked: [FLASH-SPECIFIC] check if a region of the SPI NOR is +++ * completely locked ++ * @priv: the private data ++ */ ++ struct spi_nor { ++- struct mtd_info *mtd; +++ struct mtd_info mtd; ++ struct mutex lock; ++ struct device *dev; +++ struct device_node *flash_node; ++ u32 page_size; ++ u8 addr_width; ++ u8 erase_opcode; ++@@ -160,20 +164,13 @@ struct spi_nor { ++ u8 program_opcode; ++ enum read_mode flash_read; ++ bool sst_write_second; ++- struct spi_nor_xfer_cfg cfg; +++ u32 flags; ++ u8 cmd_buf[SPI_NOR_MAX_CMD_SIZE]; ++ ++ int (*prepare)(struct spi_nor *nor, enum spi_nor_ops ops); ++ void (*unprepare)(struct spi_nor *nor, enum spi_nor_ops ops); ++- int (*read_xfer)(struct spi_nor *nor, struct spi_nor_xfer_cfg *cfg, ++- u8 *buf, size_t len); ++- int (*write_xfer)(struct spi_nor *nor, struct spi_nor_xfer_cfg *cfg, ++- u8 *buf, size_t len); ++ int (*read_reg)(struct spi_nor *nor, u8 opcode, u8 *buf, int len); ++- int (*write_reg)(struct spi_nor *nor, u8 opcode, u8 *buf, int len, ++- int write_enable); ++- const struct spi_device_id *(*read_id)(struct spi_nor *nor); ++- int (*wait_till_ready)(struct spi_nor *nor); +++ int (*write_reg)(struct spi_nor *nor, u8 opcode, u8 *buf, int len); ++ ++ int (*read)(struct spi_nor *nor, loff_t from, ++ size_t len, size_t *retlen, u_char *read_buf); ++@@ -181,6 +178,10 @@ struct spi_nor { ++ size_t len, size_t *retlen, const u_char *write_buf); ++ int (*erase)(struct spi_nor *nor, loff_t offs); ++ +++ int (*flash_lock)(struct spi_nor *nor, loff_t ofs, uint64_t len); +++ int (*flash_unlock)(struct spi_nor *nor, loff_t ofs, uint64_t len); +++ int (*flash_is_locked)(struct spi_nor *nor, loff_t ofs, uint64_t len); +++ ++ void *priv; ++ }; ++ +diff --git a/target/linux/generic/patches-3.18/462-m25p80-mx-disable-software-protection.patch b/target/linux/generic/patches-3.18/462-m25p80-mx-disable-software-protection.patch +index fef483a..eb99609 100644 +--- a/target/linux/generic/patches-3.18/462-m25p80-mx-disable-software-protection.patch ++++ b/target/linux/generic/patches-3.18/462-m25p80-mx-disable-software-protection.patch +@@ -1,10 +1,14 @@ ++Disable software protection bits for Macronix flashes. ++ ++Signed-off-by: Felix Fietkau ++ + --- a/drivers/mtd/spi-nor/spi-nor.c + +++ b/drivers/mtd/spi-nor/spi-nor.c +-@@ -963,6 +963,7 @@ int spi_nor_scan(struct spi_nor *nor, co ++@@ -1164,6 +1164,7 @@ int spi_nor_scan(struct spi_nor *nor, co + +- if (JEDEC_MFR(info->jedec_id) == CFI_MFR_ATMEL || +- JEDEC_MFR(info->jedec_id) == CFI_MFR_INTEL || +-+ JEDEC_MFR(info->jedec_id) == CFI_MFR_MACRONIX || +- JEDEC_MFR(info->jedec_id) == CFI_MFR_SST) { ++ if (JEDEC_MFR(info) == SNOR_MFR_ATMEL || ++ JEDEC_MFR(info) == SNOR_MFR_INTEL || +++ JEDEC_MFR(info) == SNOR_MFR_MACRONIX || ++ JEDEC_MFR(info) == SNOR_MFR_SST) { + write_enable(nor); + write_sr(nor, 0); +diff --git a/target/linux/generic/patches-3.18/472-mtd-m25p80-add-support-for-Winbond-W25X05-flash.patch b/target/linux/generic/patches-3.18/472-mtd-m25p80-add-support-for-Winbond-W25X05-flash.patch +deleted file mode 100644 +index dca6895..0000000 +--- a/target/linux/generic/patches-3.18/472-mtd-m25p80-add-support-for-Winbond-W25X05-flash.patch ++++ /dev/null +@@ -1,20 +0,0 @@ +-From eef9dfc4e821408af1af13aa0cc707fc496fb7c6 Mon Sep 17 00:00:00 2001 +-From: Gabor Juhos +-Date: Wed, 11 Dec 2013 19:05:59 +0100 +-Subject: [PATCH] m25p80: add support for the Winbond W25X05 flash +- +-Signed-off-by: Gabor Juhos +---- +- drivers/mtd/devices/m25p80.c | 1 + +- 1 file changed, 1 insertion(+) +- +---- a/drivers/mtd/spi-nor/spi-nor.c +-+++ b/drivers/mtd/spi-nor/spi-nor.c +-@@ -617,6 +617,7 @@ static const struct spi_device_id spi_no +- { "m25px80", INFO(0x207114, 0, 64 * 1024, 16, 0) }, +- +- /* Winbond -- w25x "blocks" are 64K, "sectors" are 4KiB */ +-+ { "w25x05", INFO(0xef3010, 0, 64 * 1024, 1, SECT_4K) }, +- { "w25x10", INFO(0xef3011, 0, 64 * 1024, 2, SECT_4K) }, +- { "w25x20", INFO(0xef3012, 0, 64 * 1024, 4, SECT_4K) }, +- { "w25x40", INFO(0xef3013, 0, 64 * 1024, 8, SECT_4K) }, +diff --git a/target/linux/generic/patches-3.18/473-mtd-spi-nor-add-support-for-the-Macronix-MX25L512E-S.patch b/target/linux/generic/patches-3.18/473-mtd-spi-nor-add-support-for-the-Macronix-MX25L512E-S.patch +deleted file mode 100644 +index 9ba7a4a..0000000 +--- a/target/linux/generic/patches-3.18/473-mtd-spi-nor-add-support-for-the-Macronix-MX25L512E-S.patch ++++ /dev/null +@@ -1,21 +0,0 @@ +-From 0d7388de0911c1a4fc4a8a3898ef9d0ab818ca08 Mon Sep 17 00:00:00 2001 +-From: Gabor Juhos +-Date: Tue, 7 Apr 2015 18:35:15 +0200 +-Subject: [PATCH] mtd: spi-nor: add support for the Macronix MX25L512E SPI +- flash chip +- +-Signed-off-by: Gabor Juhos +---- +- drivers/mtd/spi-nor/spi-nor.c | 1 + +- 1 file changed, 1 insertion(+) +- +---- a/drivers/mtd/spi-nor/spi-nor.c +-+++ b/drivers/mtd/spi-nor/spi-nor.c +-@@ -518,6 +518,7 @@ static const struct spi_device_id spi_no +- { "640s33b", INFO(0x898913, 0, 64 * 1024, 128, 0) }, +- +- /* Macronix */ +-+ { "mx25l512e", INFO(0xc22010, 0, 64 * 1024, 1, SECT_4K) }, +- { "mx25l2005a", INFO(0xc22012, 0, 64 * 1024, 4, SECT_4K) }, +- { "mx25l4005a", INFO(0xc22013, 0, 64 * 1024, 8, SECT_4K) }, +- { "mx25l8005", INFO(0xc22014, 0, 64 * 1024, 16, 0) }, +diff --git a/target/linux/generic/patches-3.18/474-mtd-spi-nor-add-support-for-the-ISSI-SI25CD512-SPI-f.patch b/target/linux/generic/patches-3.18/474-mtd-spi-nor-add-support-for-the-ISSI-SI25CD512-SPI-f.patch +deleted file mode 100644 +index b06ac73..0000000 +--- a/target/linux/generic/patches-3.18/474-mtd-spi-nor-add-support-for-the-ISSI-SI25CD512-SPI-f.patch ++++ /dev/null +@@ -1,22 +0,0 @@ +-From 34e2b403040a2f9d3ba071d95a7f42457e2950f9 Mon Sep 17 00:00:00 2001 +-From: Gabor Juhos +-Date: Tue, 7 Apr 2015 18:35:15 +0200 +-Subject: [PATCH] mtd: spi-nor: add support for the ISSI SI25CD512 SPI flash +- +-Signed-off-by: Gabor Juhos +---- +- drivers/mtd/spi-nor/spi-nor.c | 3 +++ +- 1 file changed, 3 insertions(+) +- +---- a/drivers/mtd/spi-nor/spi-nor.c +-+++ b/drivers/mtd/spi-nor/spi-nor.c +-@@ -517,6 +517,9 @@ static const struct spi_device_id spi_no +- { "320s33b", INFO(0x898912, 0, 64 * 1024, 64, 0) }, +- { "640s33b", INFO(0x898913, 0, 64 * 1024, 128, 0) }, +- +-+ /* ISSI */ +-+ { "is25cd512", INFO(0x7f9d20, 0, 32 * 1024, 2, SECT_4K) }, +-+ +- /* Macronix */ +- { "mx25l512e", INFO(0xc22010, 0, 64 * 1024, 1, SECT_4K) }, +- { "mx25l2005a", INFO(0xc22012, 0, 64 * 1024, 4, SECT_4K) }, +diff --git a/target/linux/lantiq/patches-3.18/0022-MTD-m25p80-allow-loading-mtd-name-from-OF.patch b/target/linux/lantiq/patches-3.18/0022-MTD-m25p80-allow-loading-mtd-name-from-OF.patch +deleted file mode 100644 +index 203eb94..0000000 +--- a/target/linux/lantiq/patches-3.18/0022-MTD-m25p80-allow-loading-mtd-name-from-OF.patch ++++ /dev/null +@@ -1,44 +0,0 @@ +-From 4400e1f593ea40a51912128adb4f53d59e62cad8 Mon Sep 17 00:00:00 2001 +-From: John Crispin +-Date: Wed, 10 Sep 2014 22:40:18 +0200 +-Subject: [PATCH 22/36] MTD: m25p80: allow loading mtd name from OF +- +-In accordance with the physmap flash we should honour the linux,mtd-name +-property when deciding what name the mtd device has. +- +-Signed-off-by: Thomas Langer +-Signed-off-by: John Crispin +---- +- drivers/mtd/devices/m25p80.c | 6 ++++++ +- 1 file changed, 6 insertions(+) +- +---- a/drivers/mtd/devices/m25p80.c +-+++ b/drivers/mtd/devices/m25p80.c +-@@ -19,6 +19,7 @@ +- #include +- #include +- #include +-+#include +- +- #include +- #include +-@@ -198,6 +199,10 @@ static int m25p_probe(struct spi_device +- enum read_mode mode = SPI_NOR_NORMAL; +- char *flash_name = NULL; +- int ret; +-+ const char __maybe_unused *of_mtd_name = NULL; +-+ +-+ of_property_read_string(spi->dev.of_node, +-+ "linux,mtd-name", &of_mtd_name); +- +- data = dev_get_platdata(&spi->dev); +- +-@@ -229,6 +234,8 @@ static int m25p_probe(struct spi_device +- +- if (data && data->name) +- flash->mtd.name = data->name; +-+ else if (of_mtd_name) +-+ flash->mtd.name = of_mtd_name; +- +- /* For some (historical?) reason many platforms provide two different +- * names in flash_platform_data: "name" and "type". Quite often name is +diff --git a/target/linux/ramips/patches-3.18/0044-mtd-add-chunked-read-io-to-m25p80.patch b/target/linux/ramips/patches-3.18/0044-mtd-add-chunked-read-io-to-m25p80.patch +deleted file mode 100644 +index 1716e1c..0000000 +--- a/target/linux/ramips/patches-3.18/0044-mtd-add-chunked-read-io-to-m25p80.patch ++++ /dev/null +@@ -1,103 +0,0 @@ +---- a/drivers/mtd/devices/m25p80.c +-+++ b/drivers/mtd/devices/m25p80.c +-@@ -19,6 +19,7 @@ +- #include +- #include +- #include +-+#include +- +- #include +- #include +-@@ -32,6 +33,7 @@ struct m25p { +- struct spi_device *spi; +- struct spi_nor spi_nor; +- struct mtd_info mtd; +-+ u16 chunk_size; +- u8 command[MAX_CMD_SIZE]; +- }; +- +-@@ -157,6 +159,61 @@ static int m25p80_read(struct spi_nor *n +- return 0; +- } +- +-+static void m25p80_chunked_write(struct spi_nor *nor, loff_t _from, size_t _len, +-+ size_t *_retlen, const u_char *_buf) +-+{ +-+ struct m25p *flash = nor->priv; +-+ int chunk_size; +-+ int retlen = 0; +-+ +-+ chunk_size = flash->chunk_size; +-+ if (!chunk_size) +-+ chunk_size = _len; +-+ +-+ if (nor->addr_width > 3) +-+ chunk_size -= nor->addr_width - 3; +-+ +-+ while (retlen < _len) { +-+ size_t len = min_t(int, chunk_size, _len - retlen); +-+ const u_char *buf = _buf + retlen; +-+ loff_t from = _from + retlen; +-+ +-+ nor->wait_till_ready(nor); +-+ nor->write_reg(nor, SPINOR_OP_WREN, NULL, 0, 0); +-+ +-+ m25p80_write(nor, from, len, &retlen, buf); +-+ } +-+ *_retlen += retlen; +-+} +-+ +-+static int m25p80_chunked_read(struct spi_nor *nor, loff_t _from, size_t _len, +-+ size_t *_retlen, u_char *_buf) +-+{ +-+ struct m25p *flash = nor->priv; +-+ int chunk_size; +-+ +-+ chunk_size = flash->chunk_size; +-+ if (!chunk_size) +-+ chunk_size = _len; +-+ +-+ *_retlen = 0; +-+ +-+ while (*_retlen < _len) { +-+ size_t len = min_t(int, chunk_size, _len - *_retlen); +-+ u_char *buf = _buf + *_retlen; +-+ loff_t from = _from + *_retlen; +-+ int retlen = 0; +-+ int ret = m25p80_read(nor, from, len, &retlen, buf); +-+ +-+ if (ret) +-+ return ret; +-+ +-+ *_retlen += retlen; +-+ } +-+ +-+ return 0; +-+} +-+ +- static int m25p80_erase(struct spi_nor *nor, loff_t offset) +- { +- struct m25p *flash = nor->priv; +-@@ -197,6 +254,7 @@ static int m25p_probe(struct spi_device +- struct spi_nor *nor; +- enum read_mode mode = SPI_NOR_NORMAL; +- char *flash_name = NULL; +-+ u32 val; +- int ret; +- +- data = dev_get_platdata(&spi->dev); +-@@ -244,6 +302,14 @@ static int m25p_probe(struct spi_device +- if (ret) +- return ret; +- +-+ if (spi->dev.of_node && +-+ !of_property_read_u32(spi->dev.of_node, "m25p,chunked-io", &val)) { +-+ dev_warn(&spi->dev, "using chunked io\n"); +-+ nor->read = m25p80_chunked_read; +-+ nor->write = m25p80_chunked_write; +-+ flash->chunk_size = val; +-+ } +-+ +- ppdata.of_node = spi->dev.of_node; +- +- return mtd_device_parse_register(&flash->mtd, NULL, &ppdata, diff --git a/patches/openwrt/0031-kernel-mtd-spi-nor-wait-until-status-register-writes-are-ready.patch b/patches/openwrt/0031-kernel-mtd-spi-nor-wait-until-status-register-writes-are-ready.patch new file mode 100644 index 00000000..f90f9c61 --- /dev/null +++ b/patches/openwrt/0031-kernel-mtd-spi-nor-wait-until-status-register-writes-are-ready.patch @@ -0,0 +1,115 @@ +From: Matthias Schiffer +Date: Sat, 7 May 2016 00:17:55 +0200 +Subject: kernel: mtd: spi-nor: wait until status register writes are ready + +diff --git a/target/linux/generic/patches-3.18/094-0001-mtd-spi-nor-wait-until-lock-unlock-operations-are-re.patch b/target/linux/generic/patches-3.18/094-0001-mtd-spi-nor-wait-until-lock-unlock-operations-are-re.patch +new file mode 100644 +index 0000000..2c2e5f3 +--- /dev/null ++++ b/target/linux/generic/patches-3.18/094-0001-mtd-spi-nor-wait-until-lock-unlock-operations-are-re.patch +@@ -0,0 +1,66 @@ ++From 32321e950d8a237d7e8f3a9b76220007dfa87544 Mon Sep 17 00:00:00 2001 ++Message-Id: <32321e950d8a237d7e8f3a9b76220007dfa87544.1462572686.git.mschiffer@universe-factory.net> ++From: =?UTF-8?q?Ezequiel=20Garc=C3=ADa?= ++Date: Mon, 28 Dec 2015 17:54:51 -0300 ++Subject: [PATCH] mtd: spi-nor: wait until lock/unlock operations are ready ++ ++On Micron and Numonyx devices, the status register write command ++(WRSR), raises a work-in-progress bit (WIP) on the status register. ++The datasheets for these devices specify that while the status ++register write is in progress, the status register WIP bit can still ++be read to check the end of the operation. ++ ++This commit adds a wait_till_ready call on lock/unlock operations, ++which is required for Micron and Numonyx but should be harmless for ++others. This is needed to prevent applications from issuing erase or ++program operations before the unlock operation is completed. ++ ++Reported-by: Stas Sergeev ++Signed-off-by: Ezequiel Garcia ++Signed-off-by: Brian Norris ++--- ++ drivers/mtd/spi-nor/spi-nor.c | 12 ++++++++++-- ++ 1 file changed, 10 insertions(+), 2 deletions(-) ++ ++--- a/drivers/mtd/spi-nor/spi-nor.c +++++ b/drivers/mtd/spi-nor/spi-nor.c ++@@ -462,6 +462,7 @@ static int stm_lock(struct spi_nor *nor, ++ u8 status_old, status_new; ++ u8 mask = SR_BP2 | SR_BP1 | SR_BP0; ++ u8 shift = ffs(mask) - 1, pow, val; +++ int ret; ++ ++ status_old = read_sr(nor); ++ ++@@ -498,7 +499,10 @@ static int stm_lock(struct spi_nor *nor, ++ return -EINVAL; ++ ++ write_enable(nor); ++- return write_sr(nor, status_new); +++ ret = write_sr(nor, status_new); +++ if (ret) +++ return ret; +++ return spi_nor_wait_till_ready(nor); ++ } ++ ++ /* ++@@ -512,6 +516,7 @@ static int stm_unlock(struct spi_nor *no ++ uint8_t status_old, status_new; ++ u8 mask = SR_BP2 | SR_BP1 | SR_BP0; ++ u8 shift = ffs(mask) - 1, pow, val; +++ int ret; ++ ++ status_old = read_sr(nor); ++ ++@@ -546,7 +551,10 @@ static int stm_unlock(struct spi_nor *no ++ return -EINVAL; ++ ++ write_enable(nor); ++- return write_sr(nor, status_new); +++ ret = write_sr(nor, status_new); +++ if (ret) +++ return ret; +++ return spi_nor_wait_till_ready(nor); ++ } ++ ++ /* +diff --git a/target/linux/generic/patches-3.18/094-0002-mtd-spi-nor-wait-for-SR_WIP-to-clear-on-initial-unlo.patch b/target/linux/generic/patches-3.18/094-0002-mtd-spi-nor-wait-for-SR_WIP-to-clear-on-initial-unlo.patch +new file mode 100644 +index 0000000..a0573d5 +--- /dev/null ++++ b/target/linux/generic/patches-3.18/094-0002-mtd-spi-nor-wait-for-SR_WIP-to-clear-on-initial-unlo.patch +@@ -0,0 +1,33 @@ ++From edf891ef9ab773363f8e58022a26d7d31604aed6 Mon Sep 17 00:00:00 2001 ++Message-Id: ++From: Brian Norris ++Date: Fri, 29 Jan 2016 11:25:30 -0800 ++Subject: [PATCH] mtd: spi-nor: wait for SR_WIP to clear on initial unlock ++ ++Fixup a piece leftover by commit 32321e950d8a ("mtd: spi-nor: wait until ++lock/unlock operations are ready"). That commit made us wait for the WIP ++bit to settle after lock/unlock operations, but it missed the open-coded ++"unlock" that happens at probe() time. ++ ++We should probably have this code utilize the unlock() routines in the ++future, to avoid duplication, but unfortunately, flash which need to be ++unlocked don't all have a proper ->flash_unlock() callback. ++ ++Signed-off-by: Brian Norris ++Cc: Stas Sergeev ++Reviewed-by: Ezequiel Garcia ++Tested-by: Ezequiel Garcia ++--- ++ drivers/mtd/spi-nor/spi-nor.c | 1 + ++ 1 file changed, 1 insertion(+) ++ ++--- a/drivers/mtd/spi-nor/spi-nor.c +++++ b/drivers/mtd/spi-nor/spi-nor.c ++@@ -1167,6 +1167,7 @@ int spi_nor_scan(struct spi_nor *nor, co ++ JEDEC_MFR(info) == SNOR_MFR_SST) { ++ write_enable(nor); ++ write_sr(nor, 0); +++ spi_nor_wait_till_ready(nor); ++ } ++ ++ if (!mtd->name) diff --git a/patches/openwrt/0032-kernel-mtd-spi-nor-unlock-Winbond-flashs.patch b/patches/openwrt/0032-kernel-mtd-spi-nor-unlock-Winbond-flashs.patch new file mode 100644 index 00000000..655f9ab1 --- /dev/null +++ b/patches/openwrt/0032-kernel-mtd-spi-nor-unlock-Winbond-flashs.patch @@ -0,0 +1,56 @@ +From: Matthias Schiffer +Date: Sat, 7 May 2016 00:29:06 +0200 +Subject: kernel: mtd: spi-nor: unlock Winbond flashs + +diff --git a/target/linux/generic/patches-3.18/463-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch b/target/linux/generic/patches-3.18/463-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch +new file mode 100644 +index 0000000..4682b7a +--- /dev/null ++++ b/target/linux/generic/patches-3.18/463-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch +@@ -0,0 +1,46 @@ ++From 20bbd73b6b04677a73933830363ab3178adc2ce9 Mon Sep 17 00:00:00 2001 ++Message-Id: <20bbd73b6b04677a73933830363ab3178adc2ce9.1462573588.git.mschiffer@universe-factory.net> ++From: Matthias Schiffer ++Date: Sat, 7 May 2016 00:26:23 +0200 ++Subject: [PATCH] Revert "mtd: spi-nor: fix Spansion regressions (aliased with ++ Winbond)" ++ ++This reverts commit 67b9bcd36906e12a15ffec19463afbbd6a41660e. ++--- ++ drivers/mtd/spi-nor/spi-nor.c | 6 ++++-- ++ include/linux/mtd/spi-nor.h | 2 +- ++ 2 files changed, 5 insertions(+), 3 deletions(-) ++ ++--- a/drivers/mtd/spi-nor/spi-nor.c +++++ b/drivers/mtd/spi-nor/spi-nor.c ++@@ -1165,7 +1165,8 @@ int spi_nor_scan(struct spi_nor *nor, co ++ if (JEDEC_MFR(info) == SNOR_MFR_ATMEL || ++ JEDEC_MFR(info) == SNOR_MFR_INTEL || ++ JEDEC_MFR(info) == SNOR_MFR_MACRONIX || ++- JEDEC_MFR(info) == SNOR_MFR_SST) { +++ JEDEC_MFR(info) == SNOR_MFR_SST || +++ JEDEC_MFR(info) == SNOR_MFR_WINBOND) { ++ write_enable(nor); ++ write_sr(nor, 0); ++ spi_nor_wait_till_ready(nor); ++@@ -1182,7 +1183,8 @@ int spi_nor_scan(struct spi_nor *nor, co ++ mtd->_read = spi_nor_read; ++ ++ /* NOR protection support for STmicro/Micron chips and similar */ ++- if (JEDEC_MFR(info) == SNOR_MFR_MICRON) { +++ if (JEDEC_MFR(info) == SNOR_MFR_MICRON || +++ JEDEC_MFR(info) == SNOR_MFR_WINBOND) { ++ nor->flash_lock = stm_lock; ++ nor->flash_unlock = stm_unlock; ++ nor->flash_is_locked = stm_is_locked; ++--- a/include/linux/mtd/spi-nor.h +++++ b/include/linux/mtd/spi-nor.h ++@@ -25,7 +25,7 @@ ++ #define SNOR_MFR_MACRONIX CFI_MFR_MACRONIX ++ #define SNOR_MFR_SPANSION CFI_MFR_AMD ++ #define SNOR_MFR_SST CFI_MFR_SST ++-#define SNOR_MFR_WINBOND 0xef /* Also used by some Spansion */ +++#define SNOR_MFR_WINBOND 0xef ++ ++ /* ++ * Note on opcode nomenclature: some opcodes have a format like From 340df0dbee0a274601f47c6984064da4d0121c89 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 9 May 2016 17:09:00 +0200 Subject: [PATCH 401/867] Fix build with GCC 6 Make pkg-config, mkimage and gcc build with GCC 6 as host compiler. Fix miscompilation of node. Fixes #755 --- ...ools-pkg-config-fix-build-with-GCC-6.patch | 37 + ...linux-compiler-.h-with-u-boot-master.patch | 815 ++++++++++++++++++ ...5-toolchain-gcc-fix-build-with-GCC-6.patch | 144 ++++ .../openwrt/0005-node-update-to-v4.4.4.patch | 110 +++ ...ur-leading-to-broken-code-with-GCC-6.patch | 80 ++ 5 files changed, 1186 insertions(+) create mode 100644 patches/openwrt/0033-tools-pkg-config-fix-build-with-GCC-6.patch create mode 100644 patches/openwrt/0034-tools-mkimage-sync-include-linux-compiler-.h-with-u-boot-master.patch create mode 100644 patches/openwrt/0035-toolchain-gcc-fix-build-with-GCC-6.patch create mode 100644 patches/packages/openwrt/0005-node-update-to-v4.4.4.patch create mode 100644 patches/packages/openwrt/0006-node-fix-undefined-behaviour-leading-to-broken-code-with-GCC-6.patch diff --git a/patches/openwrt/0033-tools-pkg-config-fix-build-with-GCC-6.patch b/patches/openwrt/0033-tools-pkg-config-fix-build-with-GCC-6.patch new file mode 100644 index 00000000..840b8b60 --- /dev/null +++ b/patches/openwrt/0033-tools-pkg-config-fix-build-with-GCC-6.patch @@ -0,0 +1,37 @@ +From: Matthias Schiffer +Date: Sun, 8 May 2016 15:53:14 +0200 +Subject: tools: pkg-config: fix build with GCC 6 + +Fixes the following error: + +gdate.c: In function ‘g_date_strftime’: +gdate.c:2497:7: error: format not a string literal, format string not checked [-Werror=format-nonliteral] + tmplen = strftime (tmpbuf, tmpbufsize, locale_format, &tm); + ^~~~~~ + +Signed-off-by: Matthias Schiffer + +diff --git a/tools/pkg-config/patches/001-glib-gdate-suppress-string-format-literal-warning.patch b/tools/pkg-config/patches/001-glib-gdate-suppress-string-format-literal-warning.patch +new file mode 100644 +index 0000000..6849299 +--- /dev/null ++++ b/tools/pkg-config/patches/001-glib-gdate-suppress-string-format-literal-warning.patch +@@ -0,0 +1,18 @@ ++--- a/glib/glib/gdate.c +++++ b/glib/glib/gdate.c ++@@ -2439,6 +2439,9 @@ win32_strftime_helper (const GDate *d, ++ * ++ * Returns: number of characters written to the buffer, or 0 the buffer was too small ++ */ +++#pragma GCC diagnostic push +++#pragma GCC diagnostic ignored "-Wformat-nonliteral" +++ ++ gsize ++ g_date_strftime (gchar *s, ++ gsize slen, ++@@ -2549,3 +2552,5 @@ g_date_strftime (gchar *s, ++ return retval; ++ #endif ++ } +++ +++#pragma GCC diagnostic pop diff --git a/patches/openwrt/0034-tools-mkimage-sync-include-linux-compiler-.h-with-u-boot-master.patch b/patches/openwrt/0034-tools-mkimage-sync-include-linux-compiler-.h-with-u-boot-master.patch new file mode 100644 index 00000000..edca566c --- /dev/null +++ b/patches/openwrt/0034-tools-mkimage-sync-include-linux-compiler-.h-with-u-boot-master.patch @@ -0,0 +1,815 @@ +From: Matthias Schiffer +Date: Sun, 8 May 2016 22:06:51 +0200 +Subject: tools: mkimage: sync include/linux/compiler*.h with u-boot master + +Fixes build with GCC 6. + +Signed-off-by: Matthias Schiffer + +diff --git a/tools/mkimage/patches/200-compiler-support.patch b/tools/mkimage/patches/200-compiler-support.patch +new file mode 100644 +index 0000000..ca9c5b5 +--- /dev/null ++++ b/tools/mkimage/patches/200-compiler-support.patch +@@ -0,0 +1,702 @@ ++diff --git b/include/linux/compiler-gcc.h a/include/linux/compiler-gcc.h ++index e057bd2..22ab246 100644 ++--- b/include/linux/compiler-gcc.h +++++ a/include/linux/compiler-gcc.h ++@@ -5,14 +5,28 @@ ++ /* ++ * Common definitions for all gcc versions go here. ++ */ ++-#define GCC_VERSION (__GNUC__ * 10000 \ ++- + __GNUC_MINOR__ * 100 \ ++- + __GNUC_PATCHLEVEL__) ++- +++#define GCC_VERSION (__GNUC__ * 10000 \ +++ + __GNUC_MINOR__ * 100 \ +++ + __GNUC_PATCHLEVEL__) ++ ++ /* Optimization barrier */ +++ ++ /* The "volatile" is due to gcc bugs */ ++ #define barrier() __asm__ __volatile__("": : :"memory") +++/* +++ * This version is i.e. to prevent dead stores elimination on @ptr +++ * where gcc and llvm may behave differently when otherwise using +++ * normal barrier(): while gcc behavior gets along with a normal +++ * barrier(), llvm needs an explicit input variable to be assumed +++ * clobbered. The issue is as follows: while the inline asm might +++ * access any memory it wants, the compiler could have fit all of +++ * @ptr into memory registers instead, and since @ptr never escaped +++ * from that, it proofed that the inline asm wasn't touching any of +++ * it. This version works well with both compilers, i.e. we're telling +++ * the compiler that the inline asm absolutely may see the contents +++ * of @ptr. See also: https://llvm.org/bugs/show_bug.cgi?id=15495 +++ */ +++#define barrier_data(ptr) __asm__ __volatile__("": :"r"(ptr) :"memory") ++ ++ /* ++ * This macro obfuscates arithmetic on a variable address so that gcc ++@@ -32,58 +46,63 @@ ++ * the inline assembly constraint from =g to =r, in this particular ++ * case either is valid. ++ */ ++-#define RELOC_HIDE(ptr, off) \ ++- ({ unsigned long __ptr; \ ++- __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \ ++- (typeof(ptr)) (__ptr + (off)); }) +++#define RELOC_HIDE(ptr, off) \ +++({ \ +++ unsigned long __ptr; \ +++ __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \ +++ (typeof(ptr)) (__ptr + (off)); \ +++}) ++ ++ /* Make the optimizer believe the variable can be manipulated arbitrarily. */ ++-#define OPTIMIZER_HIDE_VAR(var) __asm__ ("" : "=r" (var) : "0" (var)) +++#define OPTIMIZER_HIDE_VAR(var) \ +++ __asm__ ("" : "=r" (var) : "0" (var)) ++ ++ #ifdef __CHECKER__ ++-#define __must_be_array(arr) 0 +++#define __must_be_array(a) 0 ++ #else ++ /* &a[0] degrades to a pointer: a different type from an array */ ++-#define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) +++#define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) ++ #endif ++ ++ /* ++ * Force always-inline if the user requests it so via the .config, ++ * or if gcc is too old: ++ */ ++-#if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \ +++#if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \ ++ !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4) ++-# define inline inline __attribute__((always_inline)) notrace ++-# define __inline__ __inline__ __attribute__((always_inline)) notrace ++-# define __inline __inline __attribute__((always_inline)) notrace +++#define inline inline __attribute__((always_inline)) notrace +++#define __inline__ __inline__ __attribute__((always_inline)) notrace +++#define __inline __inline __attribute__((always_inline)) notrace ++ #else ++ /* A lot of inline functions can cause havoc with function tracing */ ++-# define inline inline notrace ++-# define __inline__ __inline__ notrace ++-# define __inline __inline notrace +++#define inline inline notrace +++#define __inline__ __inline__ notrace +++#define __inline __inline notrace ++ #endif ++ ++-#define __deprecated __attribute__((deprecated)) ++-#ifndef __packed ++-#define __packed __attribute__((packed)) ++-#endif ++-#ifndef __weak ++-#define __weak __attribute__((weak)) ++-#endif +++#define __always_inline inline __attribute__((always_inline)) +++#define noinline __attribute__((noinline)) +++ +++#define __deprecated __attribute__((deprecated)) +++#define __packed __attribute__((packed)) +++#define __weak __attribute__((weak)) +++#define __alias(symbol) __attribute__((alias(#symbol))) ++ ++ /* ++- * it doesn't make sense on ARM (currently the only user of __naked) to trace ++- * naked functions because then mcount is called without stack and frame pointer ++- * being set up and there is no chance to restore the lr register to the value ++- * before mcount was called. +++ * it doesn't make sense on ARM (currently the only user of __naked) +++ * to trace naked functions because then mcount is called without +++ * stack and frame pointer being set up and there is no chance to +++ * restore the lr register to the value before mcount was called. +++ * +++ * The asm() bodies of naked functions often depend on standard calling +++ * conventions, therefore they must be noinline and noclone. ++ * ++- * The asm() bodies of naked functions often depend on standard calling conventions, ++- * therefore they must be noinline and noclone. GCC 4.[56] currently fail to enforce ++- * this, so we must do so ourselves. See GCC PR44290. +++ * GCC 4.[56] currently fail to enforce this, so we must do so ourselves. +++ * See GCC PR44290. ++ */ ++-#define __naked __attribute__((naked)) noinline __noclone notrace +++#define __naked __attribute__((naked)) noinline __noclone notrace ++ ++-#define __noreturn __attribute__((noreturn)) +++#define __noreturn __attribute__((noreturn)) ++ ++ /* ++ * From the GCC manual: ++@@ -95,34 +114,170 @@ ++ * would be. ++ * [...] ++ */ ++-#ifndef __pure ++-#define __pure __attribute__((pure)) +++#define __pure __attribute__((pure)) +++#define __aligned(x) __attribute__((aligned(x))) +++#define __printf(a, b) __attribute__((format(printf, a, b))) +++#define __scanf(a, b) __attribute__((format(scanf, a, b))) +++#define __attribute_const__ __attribute__((__const__)) +++#define __maybe_unused __attribute__((unused)) +++#define __always_unused __attribute__((unused)) +++ +++/* gcc version specific checks */ +++ +++#if GCC_VERSION < 30200 +++# error Sorry, your compiler is too old - please upgrade it. +++#endif +++ +++#if GCC_VERSION < 30300 +++# define __used __attribute__((__unused__)) +++#else +++# define __used __attribute__((__used__)) +++#endif +++ +++#ifdef CONFIG_GCOV_KERNEL +++# if GCC_VERSION < 30400 +++# error "GCOV profiling support for gcc versions below 3.4 not included" +++# endif /* __GNUC_MINOR__ */ +++#endif /* CONFIG_GCOV_KERNEL */ +++ +++#if GCC_VERSION >= 30400 +++#define __must_check __attribute__((warn_unused_result)) +++#endif +++ +++#if GCC_VERSION >= 40000 +++ +++/* GCC 4.1.[01] miscompiles __weak */ +++#ifdef __KERNEL__ +++# if GCC_VERSION >= 40100 && GCC_VERSION <= 40101 +++# error Your version of gcc miscompiles the __weak directive +++# endif +++#endif +++ +++#define __used __attribute__((__used__)) +++#define __compiler_offsetof(a, b) \ +++ __builtin_offsetof(a, b) +++ +++#if GCC_VERSION >= 40100 && GCC_VERSION < 40600 +++# define __compiletime_object_size(obj) __builtin_object_size(obj, 0) +++#endif +++ +++#if GCC_VERSION >= 40300 +++/* Mark functions as cold. gcc will assume any path leading to a call +++ * to them will be unlikely. This means a lot of manual unlikely()s +++ * are unnecessary now for any paths leading to the usual suspects +++ * like BUG(), printk(), panic() etc. [but let's keep them for now for +++ * older compilers] +++ * +++ * Early snapshots of gcc 4.3 don't support this and we can't detect this +++ * in the preprocessor, but we can live with this because they're unreleased. +++ * Maketime probing would be overkill here. +++ * +++ * gcc also has a __attribute__((__hot__)) to move hot functions into +++ * a special section, but I don't see any sense in this right now in +++ * the kernel context +++ */ +++#define __cold __attribute__((__cold__)) +++ +++#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) +++ +++#ifndef __CHECKER__ +++# define __compiletime_warning(message) __attribute__((warning(message))) +++# define __compiletime_error(message) __attribute__((error(message))) +++#endif /* __CHECKER__ */ +++#endif /* GCC_VERSION >= 40300 */ +++ +++#if GCC_VERSION >= 40500 +++/* +++ * Mark a position in code as unreachable. This can be used to +++ * suppress control flow warnings after asm blocks that transfer +++ * control elsewhere. +++ * +++ * Early snapshots of gcc 4.5 don't support this and we can't detect +++ * this in the preprocessor, but we can live with this because they're +++ * unreleased. Really, we need to have autoconf for the kernel. +++ */ +++#define unreachable() __builtin_unreachable() +++ +++/* Mark a function definition as prohibited from being cloned. */ +++#define __noclone __attribute__((__noclone__)) +++ +++#endif /* GCC_VERSION >= 40500 */ +++ +++#if GCC_VERSION >= 40600 +++/* +++ * When used with Link Time Optimization, gcc can optimize away C functions or +++ * variables which are referenced only from assembly code. __visible tells the +++ * optimizer that something else uses this function or variable, thus preventing +++ * this. +++ */ +++#define __visible __attribute__((externally_visible)) ++ #endif ++-#ifndef __aligned ++-#define __aligned(x) __attribute__((aligned(x))) +++ +++ +++#if GCC_VERSION >= 40900 && !defined(__CHECKER__) +++/* +++ * __assume_aligned(n, k): Tell the optimizer that the returned +++ * pointer can be assumed to be k modulo n. The second argument is +++ * optional (default 0), so we use a variadic macro to make the +++ * shorthand. +++ * +++ * Beware: Do not apply this to functions which may return +++ * ERR_PTRs. Also, it is probably unwise to apply it to functions +++ * returning extra information in the low bits (but in that case the +++ * compiler should see some alignment anyway, when the return value is +++ * massaged by 'flags = ptr & 3; ptr &= ~3;'). +++ */ +++#define __assume_aligned(a, ...) __attribute__((__assume_aligned__(a, ## __VA_ARGS__))) ++ #endif ++-#define __printf(a, b) __attribute__((format(printf, a, b))) ++-#define __scanf(a, b) __attribute__((format(scanf, a, b))) ++-#define noinline __attribute__((noinline)) ++-#define __attribute_const__ __attribute__((__const__)) ++-#define __maybe_unused __attribute__((unused)) ++-#define __always_unused __attribute__((unused)) ++ ++-#define __gcc_header(x) #x ++-#define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h) ++-#define gcc_header(x) _gcc_header(x) ++-#include gcc_header(__GNUC__) +++/* +++ * GCC 'asm goto' miscompiles certain code sequences: +++ * +++ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670 +++ * +++ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek. +++ * +++ * (asm goto is automatically volatile - the naming reflects this.) +++ */ +++#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) +++ +++#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP +++#if GCC_VERSION >= 40400 +++#define __HAVE_BUILTIN_BSWAP32__ +++#define __HAVE_BUILTIN_BSWAP64__ +++#endif +++#if GCC_VERSION >= 40800 || (defined(__powerpc__) && GCC_VERSION >= 40600) +++#define __HAVE_BUILTIN_BSWAP16__ +++#endif +++#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ +++ +++#if GCC_VERSION >= 50000 +++#define KASAN_ABI_VERSION 4 +++#elif GCC_VERSION >= 40902 +++#define KASAN_ABI_VERSION 3 +++#endif +++ +++#if GCC_VERSION >= 40902 +++/* +++ * Tell the compiler that address safety instrumentation (KASAN) +++ * should not be applied to that function. +++ * Conflicts with inlining: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368 +++ */ +++#define __no_sanitize_address __attribute__((no_sanitize_address)) +++#endif +++ +++#endif /* gcc version >= 40000 specific checks */ ++ ++ #if !defined(__noclone) ++ #define __noclone /* not needed */ ++ #endif ++ +++#if !defined(__no_sanitize_address) +++#define __no_sanitize_address +++#endif +++ ++ /* ++ * A trick to suppress uninitialized variable warning without generating any ++ * code ++ */ ++ #define uninitialized_var(x) x = x ++- ++-#ifndef __always_inline ++-#define __always_inline inline __attribute__((always_inline)) ++-#endif ++diff --git b/include/linux/compiler-gcc3.h a/include/linux/compiler-gcc3.h ++deleted file mode 100644 ++index 7d89feb..0000000 ++--- b/include/linux/compiler-gcc3.h +++++ /dev/null ++@@ -1,23 +0,0 @@ ++-#ifndef __LINUX_COMPILER_H ++-#error "Please don't include directly, include instead." ++-#endif ++- ++-#if GCC_VERSION < 30200 ++-# error Sorry, your compiler is too old - please upgrade it. ++-#endif ++- ++-#if GCC_VERSION >= 30300 ++-# define __used __attribute__((__used__)) ++-#else ++-# define __used __attribute__((__unused__)) ++-#endif ++- ++-#if GCC_VERSION >= 30400 ++-#define __must_check __attribute__((warn_unused_result)) ++-#endif ++- ++-#ifdef CONFIG_GCOV_KERNEL ++-# if GCC_VERSION < 30400 ++-# error "GCOV profiling support for gcc versions below 3.4 not included" ++-# endif /* __GNUC_MINOR__ */ ++-#endif /* CONFIG_GCOV_KERNEL */ ++diff --git b/include/linux/compiler-gcc4.h a/include/linux/compiler-gcc4.h ++deleted file mode 100644 ++index c982a09..0000000 ++--- b/include/linux/compiler-gcc4.h +++++ /dev/null ++@@ -1,81 +0,0 @@ ++-#ifndef __LINUX_COMPILER_H ++-#error "Please don't include directly, include instead." ++-#endif ++- ++-#define __used __attribute__((__used__)) ++-#define __must_check __attribute__((warn_unused_result)) ++-#define __compiler_offsetof(a,b) __builtin_offsetof(a,b) ++- ++-#if GCC_VERSION >= 40100 && GCC_VERSION < 40600 ++-# define __compiletime_object_size(obj) __builtin_object_size(obj, 0) ++-#endif ++- ++-#if GCC_VERSION >= 40300 ++-/* Mark functions as cold. gcc will assume any path leading to a call ++- to them will be unlikely. This means a lot of manual unlikely()s ++- are unnecessary now for any paths leading to the usual suspects ++- like BUG(), printk(), panic() etc. [but let's keep them for now for ++- older compilers] ++- ++- Early snapshots of gcc 4.3 don't support this and we can't detect this ++- in the preprocessor, but we can live with this because they're unreleased. ++- Maketime probing would be overkill here. ++- ++- gcc also has a __attribute__((__hot__)) to move hot functions into ++- a special section, but I don't see any sense in this right now in ++- the kernel context */ ++-#define __cold __attribute__((__cold__)) ++- ++-#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) ++- ++-#ifndef __CHECKER__ ++-# define __compiletime_warning(message) __attribute__((warning(message))) ++-# define __compiletime_error(message) __attribute__((error(message))) ++-#endif /* __CHECKER__ */ ++-#endif /* GCC_VERSION >= 40300 */ ++- ++-#if GCC_VERSION >= 40500 ++-/* ++- * Mark a position in code as unreachable. This can be used to ++- * suppress control flow warnings after asm blocks that transfer ++- * control elsewhere. ++- * ++- * Early snapshots of gcc 4.5 don't support this and we can't detect ++- * this in the preprocessor, but we can live with this because they're ++- * unreleased. Really, we need to have autoconf for the kernel. ++- */ ++-#define unreachable() __builtin_unreachable() ++- ++-/* Mark a function definition as prohibited from being cloned. */ ++-#define __noclone __attribute__((__noclone__)) ++- ++-#endif /* GCC_VERSION >= 40500 */ ++- ++-#if GCC_VERSION >= 40600 ++-/* ++- * Tell the optimizer that something else uses this function or variable. ++- */ ++-#define __visible __attribute__((externally_visible)) ++-#endif ++- ++-/* ++- * GCC 'asm goto' miscompiles certain code sequences: ++- * ++- * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670 ++- * ++- * Work it around via a compiler barrier quirk suggested by Jakub Jelinek. ++- * Fixed in GCC 4.8.2 and later versions. ++- * ++- * (asm goto is automatically volatile - the naming reflects this.) ++- */ ++-#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) ++- ++-#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP ++-#if GCC_VERSION >= 40400 ++-#define __HAVE_BUILTIN_BSWAP32__ ++-#define __HAVE_BUILTIN_BSWAP64__ ++-#endif ++-#if GCC_VERSION >= 40800 || (defined(__powerpc__) && GCC_VERSION >= 40600) ++-#define __HAVE_BUILTIN_BSWAP16__ ++-#endif ++-#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ ++diff --git b/include/linux/compiler-intel.h a/include/linux/compiler-intel.h ++index ba147a1..d4c7113 100644 ++--- b/include/linux/compiler-intel.h +++++ a/include/linux/compiler-intel.h ++@@ -13,9 +13,14 @@ ++ /* Intel ECC compiler doesn't support gcc specific asm stmts. ++ * It uses intrinsics to do the equivalent things. ++ */ +++#undef barrier +++#undef barrier_data ++ #undef RELOC_HIDE ++ #undef OPTIMIZER_HIDE_VAR ++ +++#define barrier() __memory_barrier() +++#define barrier_data(ptr) barrier() +++ ++ #define RELOC_HIDE(ptr, off) \ ++ ({ unsigned long __ptr; \ ++ __ptr = (unsigned long) (ptr); \ ++diff --git b/include/linux/compiler.h a/include/linux/compiler.h ++index d5ad7b1..020ad16 100644 ++--- b/include/linux/compiler.h +++++ a/include/linux/compiler.h ++@@ -17,6 +17,7 @@ ++ # define __release(x) __context__(x,-1) ++ # define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0) ++ # define __percpu __attribute__((noderef, address_space(3))) +++# define __pmem __attribute__((noderef, address_space(5))) ++ #ifdef CONFIG_SPARSE_RCU_POINTER ++ # define __rcu __attribute__((noderef, address_space(4))) ++ #else ++@@ -42,6 +43,7 @@ extern void __chk_io_ptr(const volatile void __iomem *); ++ # define __cond_lock(x,c) (c) ++ # define __percpu ++ # define __rcu +++# define __pmem ++ #endif ++ ++ /* Indirect macros required for expanded argument pasting, eg. __LINE__. */ ++@@ -54,7 +56,11 @@ extern void __chk_io_ptr(const volatile void __iomem *); ++ #include ++ #endif ++ +++#if defined(CC_USING_HOTPATCH) && !defined(__CHECKER__) +++#define notrace __attribute__((hotpatch(0,0))) +++#else ++ #define notrace __attribute__((no_instrument_function)) +++#endif ++ ++ /* Intel compiler defines __GNUC__. So we will overwrite implementations ++ * coming from above header files here ++@@ -138,7 +144,7 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); ++ */ ++ #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) ) ++ #define __trace_if(cond) \ ++- if (__builtin_constant_p((cond)) ? !!(cond) : \ +++ if (__builtin_constant_p(!!(cond)) ? !!(cond) : \ ++ ({ \ ++ int ______r; \ ++ static struct ftrace_branch_data \ ++@@ -165,6 +171,10 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); ++ # define barrier() __memory_barrier() ++ #endif ++ +++#ifndef barrier_data +++# define barrier_data(ptr) barrier() +++#endif +++ ++ /* Unreachable code */ ++ #ifndef unreachable ++ # define unreachable() do { } while (1) ++@@ -186,6 +196,126 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); ++ # define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __LINE__) ++ #endif ++ +++#include +++ +++#define __READ_ONCE_SIZE \ +++({ \ +++ switch (size) { \ +++ case 1: *(__u8 *)res = *(volatile __u8 *)p; break; \ +++ case 2: *(__u16 *)res = *(volatile __u16 *)p; break; \ +++ case 4: *(__u32 *)res = *(volatile __u32 *)p; break; \ +++ case 8: *(__u64 *)res = *(volatile __u64 *)p; break; \ +++ default: \ +++ barrier(); \ +++ __builtin_memcpy((void *)res, (const void *)p, size); \ +++ barrier(); \ +++ } \ +++}) +++ +++static __always_inline +++void __read_once_size(const volatile void *p, void *res, int size) +++{ +++ __READ_ONCE_SIZE; +++} +++ +++#ifdef CONFIG_KASAN +++/* +++ * This function is not 'inline' because __no_sanitize_address confilcts +++ * with inlining. Attempt to inline it may cause a build failure. +++ * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368 +++ * '__maybe_unused' allows us to avoid defined-but-not-used warnings. +++ */ +++static __no_sanitize_address __maybe_unused +++void __read_once_size_nocheck(const volatile void *p, void *res, int size) +++{ +++ __READ_ONCE_SIZE; +++} +++#else +++static __always_inline +++void __read_once_size_nocheck(const volatile void *p, void *res, int size) +++{ +++ __READ_ONCE_SIZE; +++} +++#endif +++ +++static __always_inline void __write_once_size(volatile void *p, void *res, int size) +++{ +++ switch (size) { +++ case 1: *(volatile __u8 *)p = *(__u8 *)res; break; +++ case 2: *(volatile __u16 *)p = *(__u16 *)res; break; +++ case 4: *(volatile __u32 *)p = *(__u32 *)res; break; +++ case 8: *(volatile __u64 *)p = *(__u64 *)res; break; +++ default: +++ barrier(); +++ __builtin_memcpy((void *)p, (const void *)res, size); +++ barrier(); +++ } +++} +++ +++/* +++ * Prevent the compiler from merging or refetching reads or writes. The +++ * compiler is also forbidden from reordering successive instances of +++ * READ_ONCE, WRITE_ONCE and ACCESS_ONCE (see below), but only when the +++ * compiler is aware of some particular ordering. One way to make the +++ * compiler aware of ordering is to put the two invocations of READ_ONCE, +++ * WRITE_ONCE or ACCESS_ONCE() in different C statements. +++ * +++ * In contrast to ACCESS_ONCE these two macros will also work on aggregate +++ * data types like structs or unions. If the size of the accessed data +++ * type exceeds the word size of the machine (e.g., 32 bits or 64 bits) +++ * READ_ONCE() and WRITE_ONCE() will fall back to memcpy and print a +++ * compile-time warning. +++ * +++ * Their two major use cases are: (1) Mediating communication between +++ * process-level code and irq/NMI handlers, all running on the same CPU, +++ * and (2) Ensuring that the compiler does not fold, spindle, or otherwise +++ * mutilate accesses that either do not require ordering or that interact +++ * with an explicit memory barrier or atomic instruction that provides the +++ * required ordering. +++ */ +++ +++#define __READ_ONCE(x, check) \ +++({ \ +++ union { typeof(x) __val; char __c[1]; } __u; \ +++ if (check) \ +++ __read_once_size(&(x), __u.__c, sizeof(x)); \ +++ else \ +++ __read_once_size_nocheck(&(x), __u.__c, sizeof(x)); \ +++ __u.__val; \ +++}) +++#define READ_ONCE(x) __READ_ONCE(x, 1) +++ +++/* +++ * Use READ_ONCE_NOCHECK() instead of READ_ONCE() if you need +++ * to hide memory access from KASAN. +++ */ +++#define READ_ONCE_NOCHECK(x) __READ_ONCE(x, 0) +++ +++#define WRITE_ONCE(x, val) \ +++({ \ +++ union { typeof(x) __val; char __c[1]; } __u = \ +++ { .__val = (__force typeof(x)) (val) }; \ +++ __write_once_size(&(x), __u.__c, sizeof(x)); \ +++ __u.__val; \ +++}) +++ +++/** +++ * smp_cond_acquire() - Spin wait for cond with ACQUIRE ordering +++ * @cond: boolean expression to wait for +++ * +++ * Equivalent to using smp_load_acquire() on the condition variable but employs +++ * the control dependency of the wait to reduce the barrier on many platforms. +++ * +++ * The control dependency provides a LOAD->STORE order, the additional RMB +++ * provides LOAD->LOAD order, together they provide LOAD->{LOAD,STORE} order, +++ * aka. ACQUIRE. +++ */ +++#define smp_cond_acquire(cond) do { \ +++ while (!(cond)) \ +++ cpu_relax(); \ +++ smp_rmb(); /* ctrl + rmb := acquire */ \ +++} while (0) +++ ++ #endif /* __KERNEL__ */ ++ ++ #endif /* __ASSEMBLY__ */ ++@@ -304,6 +434,14 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); ++ #define __visible ++ #endif ++ +++/* +++ * Assume alignment of return value. +++ */ +++#ifndef __assume_aligned +++#define __assume_aligned(a, ...) +++#endif +++ +++ ++ /* Are two types/vars the same type (ignoring qualifiers)? */ ++ #ifndef __same_type ++ # define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) ++@@ -311,7 +449,7 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); ++ ++ /* Is this type a native word size -- useful for atomic operations */ ++ #ifndef __native_word ++-# define __native_word(t) (sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long)) +++# define __native_word(t) (sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long)) ++ #endif ++ ++ /* Compile time object size, -1 for unknown */ ++@@ -373,12 +511,38 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); ++ * to make the compiler aware of ordering is to put the two invocations of ++ * ACCESS_ONCE() in different C statements. ++ * ++- * This macro does absolutely -nothing- to prevent the CPU from reordering, ++- * merging, or refetching absolutely anything at any time. Its main intended ++- * use is to mediate communication between process-level code and irq/NMI ++- * handlers, all running on the same CPU. +++ * ACCESS_ONCE will only work on scalar types. For union types, ACCESS_ONCE +++ * on a union member will work as long as the size of the member matches the +++ * size of the union and the size is smaller than word size. +++ * +++ * The major use cases of ACCESS_ONCE used to be (1) Mediating communication +++ * between process-level code and irq/NMI handlers, all running on the same CPU, +++ * and (2) Ensuring that the compiler does not fold, spindle, or otherwise +++ * mutilate accesses that either do not require ordering or that interact +++ * with an explicit memory barrier or atomic instruction that provides the +++ * required ordering. +++ * +++ * If possible use READ_ONCE()/WRITE_ONCE() instead. +++ */ +++#define __ACCESS_ONCE(x) ({ \ +++ __maybe_unused typeof(x) __var = (__force typeof(x)) 0; \ +++ (volatile typeof(x) *)&(x); }) +++#define ACCESS_ONCE(x) (*__ACCESS_ONCE(x)) +++ +++/** +++ * lockless_dereference() - safely load a pointer for later dereference +++ * @p: The pointer to load +++ * +++ * Similar to rcu_dereference(), but for situations where the pointed-to +++ * object's lifetime is managed by something other than RCU. That +++ * "something other" might be reference counting or simple immortality. ++ */ ++-#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x)) +++#define lockless_dereference(p) \ +++({ \ +++ typeof(p) _________p1 = READ_ONCE(p); \ +++ smp_read_barrier_depends(); /* Dependency order vs. p above. */ \ +++ (_________p1); \ +++}) ++ ++ /* Ignore/forbid kprobes attach on very low level functions marked by this attribute: */ ++ #ifdef CONFIG_KPROBES +diff --git a/tools/mkimage/patches/200-gcc5_compat.patch b/tools/mkimage/patches/200-gcc5_compat.patch +deleted file mode 100644 +index 4d55f00..0000000 +--- a/tools/mkimage/patches/200-gcc5_compat.patch ++++ /dev/null +@@ -1,93 +0,0 @@ +-From 478b02f1a7043b673565075ea5016376f3293b23 Mon Sep 17 00:00:00 2001 +-From: Hans de Goede +-Date: Sat, 7 Feb 2015 22:52:40 +0100 +-Subject: [PATCH] Add linux/compiler-gcc5.h to fix builds with gcc5 +- +-Add linux/compiler-gcc5/h from the kernel sources at: +- +-commit 5631b8fba640a4ab2f8a954f63a603fa34eda96b +-Author: Steven Noonan +-Date: Sat Oct 25 15:09:42 2014 -0700 +- +- compiler/gcc4+: Remove inaccurate comment about 'asm goto' miscompiles +- +-Signed-off-by: Hans de Goede +---- +- include/linux/compiler-gcc5.h | 65 +++++++++++++++++++++++++++++++++++++++++ +- 1 file changed, 65 insertions(+) +- create mode 100644 include/linux/compiler-gcc5.h +- +-diff --git a/include/linux/compiler-gcc5.h b/include/linux/compiler-gcc5.h +-new file mode 100644 +-index 0000000..c8c5659 +---- /dev/null +-+++ b/include/linux/compiler-gcc5.h +-@@ -0,0 +1,65 @@ +-+#ifndef __LINUX_COMPILER_H +-+#error "Please don't include directly, include instead." +-+#endif +-+ +-+#define __used __attribute__((__used__)) +-+#define __must_check __attribute__((warn_unused_result)) +-+#define __compiler_offsetof(a, b) __builtin_offsetof(a, b) +-+ +-+/* Mark functions as cold. gcc will assume any path leading to a call +-+ to them will be unlikely. This means a lot of manual unlikely()s +-+ are unnecessary now for any paths leading to the usual suspects +-+ like BUG(), printk(), panic() etc. [but let's keep them for now for +-+ older compilers] +-+ +-+ Early snapshots of gcc 4.3 don't support this and we can't detect this +-+ in the preprocessor, but we can live with this because they're unreleased. +-+ Maketime probing would be overkill here. +-+ +-+ gcc also has a __attribute__((__hot__)) to move hot functions into +-+ a special section, but I don't see any sense in this right now in +-+ the kernel context */ +-+#define __cold __attribute__((__cold__)) +-+ +-+#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) +-+ +-+#ifndef __CHECKER__ +-+# define __compiletime_warning(message) __attribute__((warning(message))) +-+# define __compiletime_error(message) __attribute__((error(message))) +-+#endif /* __CHECKER__ */ +-+ +-+/* +-+ * Mark a position in code as unreachable. This can be used to +-+ * suppress control flow warnings after asm blocks that transfer +-+ * control elsewhere. +-+ * +-+ * Early snapshots of gcc 4.5 don't support this and we can't detect +-+ * this in the preprocessor, but we can live with this because they're +-+ * unreleased. Really, we need to have autoconf for the kernel. +-+ */ +-+#define unreachable() __builtin_unreachable() +-+ +-+/* Mark a function definition as prohibited from being cloned. */ +-+#define __noclone __attribute__((__noclone__)) +-+ +-+/* +-+ * Tell the optimizer that something else uses this function or variable. +-+ */ +-+#define __visible __attribute__((externally_visible)) +-+ +-+/* +-+ * GCC 'asm goto' miscompiles certain code sequences: +-+ * +-+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670 +-+ * +-+ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek. +-+ * +-+ * (asm goto is automatically volatile - the naming reflects this.) +-+ */ +-+#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) +-+ +-+#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP +-+#define __HAVE_BUILTIN_BSWAP32__ +-+#define __HAVE_BUILTIN_BSWAP64__ +-+#define __HAVE_BUILTIN_BSWAP16__ +-+#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ +--- +-1.7.10.4 +- diff --git a/patches/openwrt/0035-toolchain-gcc-fix-build-with-GCC-6.patch b/patches/openwrt/0035-toolchain-gcc-fix-build-with-GCC-6.patch new file mode 100644 index 00000000..e828631b --- /dev/null +++ b/patches/openwrt/0035-toolchain-gcc-fix-build-with-GCC-6.patch @@ -0,0 +1,144 @@ +From: Matthias Schiffer +Date: Mon, 9 May 2016 00:16:38 +0200 +Subject: toolchain: gcc: fix build with GCC 6 + +At least for GCC 4.8, which is used by most targets. + +Signed-off-by: Matthias Schiffer + +diff --git a/toolchain/gcc/patches/4.8-linaro/030-gcc-6-compile.patch b/toolchain/gcc/patches/4.8-linaro/030-gcc-6-compile.patch +new file mode 100644 +index 0000000..c74f2aa +--- /dev/null ++++ b/toolchain/gcc/patches/4.8-linaro/030-gcc-6-compile.patch +@@ -0,0 +1,130 @@ ++Upstream commit r233721 ++ ++diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in ++index bd1c1d7..a0ea0d4 100644 ++--- a/gcc/cp/Make-lang.in +++++ b/gcc/cp/Make-lang.in ++@@ -111,7 +111,7 @@ else ++ # deleting the $(srcdir)/cp/cfns.h file. ++ $(srcdir)/cp/cfns.h: ++ endif ++- gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \ +++ gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L C++ \ ++ $(srcdir)/cp/cfns.gperf --output-file $(srcdir)/cp/cfns.h ++ ++ # ++diff --git a/gcc/cp/cfns.gperf b/gcc/cp/cfns.gperf ++index 05ca753..d9b16b8 100644 ++--- a/gcc/cp/cfns.gperf +++++ b/gcc/cp/cfns.gperf ++@@ -1,3 +1,5 @@ +++%language=C++ +++%define class-name libc_name ++ %{ ++ /* Copyright (C) 2000-2014 Free Software Foundation, Inc. ++ ++@@ -16,14 +18,6 @@ for more details. ++ You should have received a copy of the GNU General Public License ++ along with GCC; see the file COPYING3. If not see ++ . */ ++-#ifdef __GNUC__ ++-__inline ++-#endif ++-static unsigned int hash (const char *, unsigned int); ++-#ifdef __GNUC__ ++-__inline ++-#endif ++-const char * libc_name_p (const char *, unsigned int); ++ %} ++ %% ++ # The standard C library functions, for feeding to gperf; the result is used ++diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h ++index c845ddf..65801d1 100644 ++--- a/gcc/cp/cfns.h +++++ b/gcc/cp/cfns.h ++@@ -1,5 +1,5 @@ ++-/* ANSI-C code produced by gperf version 3.0.3 */ ++-/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L ANSI-C cfns.gperf */ +++/* C++ code produced by gperf version 3.0.4 */ +++/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L C++ --output-file cfns.h cfns.gperf */ ++ ++ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ ++ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ ++@@ -28,7 +28,7 @@ ++ #error "gperf generated tables don't work with this execution character set. Please report a bug to ." ++ #endif ++ ++-#line 1 "cfns.gperf" +++#line 3 "cfns.gperf" ++ ++ /* Copyright (C) 2000-2014 Free Software Foundation, Inc. ++ ++@@ -47,25 +47,18 @@ for more details. ++ You should have received a copy of the GNU General Public License ++ along with GCC; see the file COPYING3. If not see ++ . */ ++-#ifdef __GNUC__ ++-__inline ++-#endif ++-static unsigned int hash (const char *, unsigned int); ++-#ifdef __GNUC__ ++-__inline ++-#endif ++-const char * libc_name_p (const char *, unsigned int); ++ /* maximum key range = 391, duplicates = 0 */ ++ ++-#ifdef __GNUC__ ++-__inline ++-#else ++-#ifdef __cplusplus ++-inline ++-#endif ++-#endif ++-static unsigned int ++-hash (register const char *str, register unsigned int len) +++class libc_name +++{ +++private: +++ static inline unsigned int hash (const char *str, unsigned int len); +++public: +++ static const char *libc_name_p (const char *str, unsigned int len); +++}; +++ +++inline unsigned int +++libc_name::hash (register const char *str, register unsigned int len) ++ { ++ static const unsigned short asso_values[] = ++ { ++@@ -122,14 +115,8 @@ hash (register const char *str, register unsigned int len) ++ return hval + asso_values[(unsigned char)str[len - 1]]; ++ } ++ ++-#ifdef __GNUC__ ++-__inline ++-#ifdef __GNUC_STDC_INLINE__ ++-__attribute__ ((__gnu_inline__)) ++-#endif ++-#endif ++ const char * ++-libc_name_p (register const char *str, register unsigned int len) +++libc_name::libc_name_p (register const char *str, register unsigned int len) ++ { ++ enum ++ { ++diff --git a/gcc/cp/except.c b/gcc/cp/except.c ++index 221971a..32340f5 100644 ++--- a/gcc/cp/except.c +++++ b/gcc/cp/except.c ++@@ -1030,7 +1030,8 @@ nothrow_libfn_p (const_tree fn) ++ unless the system headers are playing rename tricks, and if ++ they are, we don't want to be confused by them. */ ++ id = DECL_NAME (fn); ++- return !!libc_name_p (IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id)); +++ return !!libc_name::libc_name_p (IDENTIFIER_POINTER (id), +++ IDENTIFIER_LENGTH (id)); ++ } ++ ++ /* Returns nonzero if an exception of type FROM will be caught by a ++-- ++1.7.1 ++ diff --git a/patches/packages/openwrt/0005-node-update-to-v4.4.4.patch b/patches/packages/openwrt/0005-node-update-to-v4.4.4.patch new file mode 100644 index 00000000..8c431944 --- /dev/null +++ b/patches/packages/openwrt/0005-node-update-to-v4.4.4.patch @@ -0,0 +1,110 @@ +From: Matthias Schiffer +Date: Mon, 9 May 2016 15:57:18 +0200 +Subject: node: update to v4.4.4 + +While we're at it, also enable parallel builds. + +Signed-off-by: Matthias Schiffer + +diff --git a/lang/node/Makefile b/lang/node/Makefile +index 243c8a5..71cf55b 100644 +--- a/lang/node/Makefile ++++ b/lang/node/Makefile +@@ -8,17 +8,21 @@ + include $(TOPDIR)/rules.mk + + PKG_NAME:=node +-PKG_VERSION:=v0.12.7 ++PKG_VERSION:=v4.4.4 + PKG_RELEASE:=1 + +-PKG_SOURCE:=node-$(PKG_VERSION).tar.gz ++PKG_SOURCE:=node-$(PKG_VERSION).tar.xz + PKG_SOURCE_URL:=http://nodejs.org/dist/${PKG_VERSION} ++PKG_MD5SUM:=1ad7915688df85f62a57f43860dc54c6 + + HOST_BUILD_DEPENDS:=python/host + PKG_BUILD_DEPENDS:=python/host + PKG_INSTALL:=1 + PKG_USE_MIPS16:=0 + ++HOST_BUILD_PARALLEL:=1 ++PKG_BUILD_PARALLEL:=1 ++ + PKG_MAINTAINER:=John Crispin + PKG_LICENSE:= + +@@ -31,7 +35,7 @@ define Package/node + SUBMENU:=Node.js + TITLE:=Node.js is a platform built on Chrome's JavaScript runtime + URL:=http://nodejs.org/ +- DEPENDS:=+libpthread +librt +libstdcpp +libopenssl +libuv ++ DEPENDS:=+libpthread +librt +libstdcpp +libopenssl +libuv +zlib + endef + + define Package/node/description +diff --git a/lang/node/patches/001-hardfloat.patch b/lang/node/patches/001-hardfloat.patch +new file mode 100644 +index 0000000..1bb2493 +--- /dev/null ++++ b/lang/node/patches/001-hardfloat.patch +@@ -0,0 +1,12 @@ ++diff --git a/deps/v8/src/base/cpu.cc b/deps/v8/src/base/cpu.cc ++index 4f58720..1f3071e 100644 ++--- a/deps/v8/src/base/cpu.cc +++++ b/deps/v8/src/base/cpu.cc ++@@ -143,6 +143,7 @@ int __detect_fp64_mode(void) { ++ ".set push\n\t" ++ ".set noreorder\n\t" ++ ".set oddspreg\n\t" +++ ".set hardfloat\n\t" ++ "lui $t0, 0x3FF0\n\t" ++ "ldc1 $f0, %0\n\t" ++ "mtc1 $t0, $f1\n\t" +diff --git a/lang/node/patches/001-mips-no-fpu.patch b/lang/node/patches/001-mips-no-fpu.patch +deleted file mode 100644 +index 5bf8142..0000000 +--- a/lang/node/patches/001-mips-no-fpu.patch ++++ /dev/null +@@ -1,15 +0,0 @@ +---- a/deps/v8/build/toolchain.gypi +-+++ b/deps/v8/build/toolchain.gypi +-@@ -50,10 +50,10 @@ +- 'arm_test_noprobe%': 'off', +- +- # Similar to vfp but on MIPS. +-- 'v8_can_use_fpu_instructions%': 'true', +-+ 'v8_can_use_fpu_instructions%': 'false', +- +- # Similar to the ARM hard float ABI but on MIPS. +-- 'v8_use_mips_abi_hardfloat%': 'true', +-+ 'v8_use_mips_abi_hardfloat%': 'false', +- +- # Default arch variant for MIPS. +- 'mips_arch_variant%': 'r2', +diff --git a/lang/node/patches/002-addr_info.patch b/lang/node/patches/002-addr_info.patch +index 78225db..0aa02da 100644 +--- a/lang/node/patches/002-addr_info.patch ++++ b/lang/node/patches/002-addr_info.patch +@@ -1,6 +1,6 @@ + --- a/deps/uv/src/unix/getaddrinfo.c + +++ b/deps/uv/src/unix/getaddrinfo.c +-@@ -99,6 +99,7 @@ ++@@ -99,6 +99,7 @@ static void uv__getaddrinfo_work(struct + int err; + + req = container_of(w, uv_getaddrinfo_t, work_req); +diff --git a/lang/node/patches/003-path.patch b/lang/node/patches/003-path.patch +index 723fe9d..01a71c6 100644 +--- a/lang/node/patches/003-path.patch ++++ b/lang/node/patches/003-path.patch +@@ -1,7 +1,7 @@ + --- a/lib/module.js + +++ b/lib/module.js +-@@ -512,7 +512,8 @@ +- var homeDir = process.env.HOME; ++@@ -453,7 +453,8 @@ Module._initPaths = function() { ++ homeDir = process.env.HOME; + } + + - var paths = [path.resolve(process.execPath, '..', '..', 'lib', 'node')]; diff --git a/patches/packages/openwrt/0006-node-fix-undefined-behaviour-leading-to-broken-code-with-GCC-6.patch b/patches/packages/openwrt/0006-node-fix-undefined-behaviour-leading-to-broken-code-with-GCC-6.patch new file mode 100644 index 00000000..12d6bcd2 --- /dev/null +++ b/patches/packages/openwrt/0006-node-fix-undefined-behaviour-leading-to-broken-code-with-GCC-6.patch @@ -0,0 +1,80 @@ +From: Matthias Schiffer +Date: Mon, 9 May 2016 16:21:57 +0200 +Subject: node: fix undefined behaviour leading to broken code with GCC 6 + +Fixes segfaults occuring in the node host build when GCC 6 is used. + +Backport of upstream commit 96198d5bc710a4e3ca49eeeb3b3fa7b8cb61547d. + +Signed-off-by: Matthias Schiffer + +diff --git a/lang/node/patches/004-gcc6-undefined-behaviour.patch b/lang/node/patches/004-gcc6-undefined-behaviour.patch +new file mode 100644 +index 0000000..11b0132 +--- /dev/null ++++ b/lang/node/patches/004-gcc6-undefined-behaviour.patch +@@ -0,0 +1,64 @@ ++diff --git a/deps/v8/src/heap/incremental-marking.cc b/deps/v8/src/heap/incremental-marking.cc ++index 58eb0aa..b2b796f 100644 ++--- a/deps/v8/src/heap/incremental-marking.cc +++++ b/deps/v8/src/heap/incremental-marking.cc ++@@ -364,7 +364,7 @@ void IncrementalMarking::DeactivateIncrementalWriteBarrier() { ++ DeactivateIncrementalWriteBarrierForSpace(heap_->new_space()); ++ ++ LargePage* lop = heap_->lo_space()->first_page(); ++- while (lop->is_valid()) { +++ while (LargePage::IsValid(lop)) { ++ SetOldSpacePageFlags(lop, false, false); ++ lop = lop->next_page(); ++ } ++@@ -396,7 +396,7 @@ void IncrementalMarking::ActivateIncrementalWriteBarrier() { ++ ActivateIncrementalWriteBarrier(heap_->new_space()); ++ ++ LargePage* lop = heap_->lo_space()->first_page(); ++- while (lop->is_valid()) { +++ while (LargePage::IsValid(lop)) { ++ SetOldSpacePageFlags(lop, true, is_compacting_); ++ lop = lop->next_page(); ++ } ++diff --git a/deps/v8/src/heap/spaces-inl.h b/deps/v8/src/heap/spaces-inl.h ++index c2c4d12..d63ee63 100644 ++--- a/deps/v8/src/heap/spaces-inl.h +++++ b/deps/v8/src/heap/spaces-inl.h ++@@ -155,7 +155,7 @@ Page* Page::Initialize(Heap* heap, MemoryChunk* chunk, Executability executable, ++ ++ bool PagedSpace::Contains(Address addr) { ++ Page* p = Page::FromAddress(addr); ++- if (!p->is_valid()) return false; +++ if (!Page::IsValid(p)) return false; ++ return p->owner() == this; ++ } ++ ++diff --git a/deps/v8/src/heap/spaces.cc b/deps/v8/src/heap/spaces.cc ++index 0806b25..c0e109b 100644 ++--- a/deps/v8/src/heap/spaces.cc +++++ b/deps/v8/src/heap/spaces.cc ++@@ -2953,7 +2953,7 @@ LargePage* LargeObjectSpace::FindPage(Address a) { ++ if (e != NULL) { ++ DCHECK(e->value != NULL); ++ LargePage* page = reinterpret_cast(e->value); ++- DCHECK(page->is_valid()); +++ DCHECK(LargePage::IsValid(page)); ++ if (page->Contains(a)) { ++ return page; ++ } ++diff --git a/deps/v8/src/heap/spaces.h b/deps/v8/src/heap/spaces.h ++index 3461de3..e35c057 100644 ++--- a/deps/v8/src/heap/spaces.h +++++ b/deps/v8/src/heap/spaces.h ++@@ -278,9 +278,9 @@ class MemoryChunk { ++ // Only works for addresses in pointer spaces, not data or code spaces. ++ static inline MemoryChunk* FromAnyPointerAddress(Heap* heap, Address addr); ++ ++- Address address() { return reinterpret_cast
(this); } +++ static bool IsValid(MemoryChunk* chunk) { return chunk != nullptr; } ++ ++- bool is_valid() { return address() != NULL; } +++ Address address() { return reinterpret_cast
(this); } ++ ++ MemoryChunk* next_chunk() const { ++ return reinterpret_cast(base::Acquire_Load(&next_chunk_)); From c05f28d1a34824cedc5bfd1f54ce21f4980ab6e2 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 11 May 2016 12:01:57 +0200 Subject: [PATCH 402/867] mpc85xx-generic: fix flash detection after spi-nor backport --- ...-kernel-backport-spi-nor-driver-from-4.4.9.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/patches/openwrt/0030-kernel-backport-spi-nor-driver-from-4.4.9.patch b/patches/openwrt/0030-kernel-backport-spi-nor-driver-from-4.4.9.patch index f66699ca..7e3ca845 100644 --- a/patches/openwrt/0030-kernel-backport-spi-nor-driver-from-4.4.9.patch +++ b/patches/openwrt/0030-kernel-backport-spi-nor-driver-from-4.4.9.patch @@ -1901,6 +1901,19 @@ index 203eb94..0000000 - - /* For some (historical?) reason many platforms provide two different - * names in flash_platform_data: "name" and "type". Quite often name is +diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts +index 2beb39c..21f823d 100644 +--- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts ++++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts +@@ -37,7 +37,7 @@ + flash@0 { + #address-cells = <1>; + #size-cells = <1>; +- compatible = "spansion,s25fl129p1"; ++ compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + diff --git a/target/linux/ramips/patches-3.18/0044-mtd-add-chunked-read-io-to-m25p80.patch b/target/linux/ramips/patches-3.18/0044-mtd-add-chunked-read-io-to-m25p80.patch deleted file mode 100644 index 1716e1c..0000000 From 86ef9b0e97ff77f33d83775562f8f72e6b2a3cd5 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 14 May 2016 00:15:23 +0200 Subject: [PATCH 403/867] Fix creation of IBSS interfaces on devices with two radios Lua's tables are 1-based, so we must decrement the index by 1 to get the desired MAC addresses. By not doing this, the second IBSS interface would get the address with index 8, but only indices 0..7 are available. Fixes: c73a12e0ea9fd6bb48927f0a03367354b5897ddc --- .../files/lib/gluon/upgrade/320-gluon-client-bridge-wireless | 2 +- .../lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package/gluon-client-bridge/files/lib/gluon/upgrade/320-gluon-client-bridge-wireless b/package/gluon-client-bridge/files/lib/gluon/upgrade/320-gluon-client-bridge-wireless index 6fc8a72a..3edb39d8 100755 --- a/package/gluon-client-bridge/files/lib/gluon/upgrade/320-gluon-client-bridge-wireless +++ b/package/gluon-client-bridge/files/lib/gluon/upgrade/320-gluon-client-bridge-wireless @@ -21,7 +21,7 @@ local function configure_client(config, radio, index, suffix) uci:delete('wireless', name) - macaddr = util.generate_mac(3*index) + macaddr = util.generate_mac(3*(index-1)) if config and macaddr then uci:section('wireless', 'wifi-iface', name, diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless index 05462c6f..dd3354de 100755 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless +++ b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless @@ -29,7 +29,7 @@ local function configure_ibss(config, radio, index, suffix, disabled) uci:delete('network', name .. '_vlan') uci:delete('wireless', name) - macaddr = util.generate_mac(3*index+2) + macaddr = util.generate_mac(3*(index-1)+2) if config and macaddr then if config.vlan then @@ -79,7 +79,7 @@ local function configure_mesh(config, radio, index, suffix, disabled) uci:delete('network', name) uci:delete('wireless', name) - macaddr = util.generate_mac(3*index+1) + macaddr = util.generate_mac(3*(index-1)+1) if config and macaddr then uci:section('network', 'interface', name, From 087112a09bdb18127a389bda45fdbdabdd53c079 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 14 May 2016 00:13:15 +0200 Subject: [PATCH 404/867] ar71xx-generic: add support for UniFi AC PRO/LITE (LITE untested) Also backport some patches improving QCA956x support. --- .../files/lib/gluon/upgrade/020-interfaces | 2 +- .../files/lib/gluon/upgrade/320-setup-ifname | 2 +- ...9561-set-phy-interface-mode-and-mask.patch | 46 ++ ...ion-register-bitmask-for-QCA956x-SoC.patch | 33 + .../0038-ar71xx-update-QCA956x-support.patch | 381 ++++++++++++ ...or-QCA956x-ethernet.patch-into-files.patch | 176 ++++++ ...ar71xx-fix-MDIO-bus-probe-on-QCA956x.patch | 22 + ...-fix-qca956x-ethernet-initialization.patch | 64 ++ ...upport-for-Ubiquiti-UniFi-AP-AC-LITE.patch | 562 ++++++++++++++++++ ...th0-support-for-Ubiquiti-UniFi-AP-AC.patch | 21 + ...r71xx-Rename-unifiac-to-unifiac-lite.patch | 192 ++++++ ...support-for-Ubiquiti-UniFi-AP-AC-PRO.patch | 274 +++++++++ targets/ar71xx-generic/profiles.mk | 12 +- 13 files changed, 1784 insertions(+), 3 deletions(-) create mode 100644 patches/openwrt/0036-ath79-dev-eth-fix-QCA9561-set-phy-interface-mode-and-mask.patch create mode 100644 patches/openwrt/0037-ar71xx-use-correct-PLL-configuration-register-bitmask-for-QCA956x-SoC.patch create mode 100644 patches/openwrt/0038-ar71xx-update-QCA956x-support.patch create mode 100644 patches/openwrt/0039-ar71xx-fold-patch-622-MIPS-ath79-add-support-for-QCA956x-ethernet.patch-into-files.patch create mode 100644 patches/openwrt/0040-ar71xx-fix-MDIO-bus-probe-on-QCA956x.patch create mode 100644 patches/openwrt/0041-ar71xx-fix-qca956x-ethernet-initialization.patch create mode 100644 patches/openwrt/0042-ar71xx-Support-for-Ubiquiti-UniFi-AP-AC-LITE.patch create mode 100644 patches/openwrt/0043-ar71xx-Fix-eth0-support-for-Ubiquiti-UniFi-AP-AC.patch create mode 100644 patches/openwrt/0044-ar71xx-Rename-unifiac-to-unifiac-lite.patch create mode 100644 patches/openwrt/0045-ar71xx-Add-support-for-Ubiquiti-UniFi-AP-AC-PRO.patch diff --git a/package/gluon-core/files/lib/gluon/upgrade/020-interfaces b/package/gluon-core/files/lib/gluon/upgrade/020-interfaces index 1818ad00..49831266 100755 --- a/package/gluon-core/files/lib/gluon/upgrade/020-interfaces +++ b/package/gluon-core/files/lib/gluon/upgrade/020-interfaces @@ -16,7 +16,7 @@ if not (sysconfig.lan_ifname or sysconfig.wan_ifname) then local lan_ifname = uci:get('network', 'lan', 'ifname') local wan_ifname = uci:get('network', 'wan', 'ifname') - if platform.match('ar71xx', 'generic', {'cpe510', 'nanostation-m', 'nanostation-m-xw', 'unifi-outdoor-plus'}) then + if platform.match('ar71xx', 'generic', {'cpe510', 'nanostation-m', 'nanostation-m-xw', 'unifi-outdoor-plus', 'unifiac-pro'}) then lan_ifname, wan_ifname = wan_ifname, lan_ifname end diff --git a/package/gluon-setup-mode/files/lib/gluon/upgrade/320-setup-ifname b/package/gluon-setup-mode/files/lib/gluon/upgrade/320-setup-ifname index 3c4a8afe..cae60e71 100755 --- a/package/gluon-setup-mode/files/lib/gluon/upgrade/320-setup-ifname +++ b/package/gluon-setup-mode/files/lib/gluon/upgrade/320-setup-ifname @@ -8,7 +8,7 @@ if sysconfig.setup_ifname then os.exit(0) end -if platform.match('ar71xx', 'generic', {'cpe510', 'nanostation-m', 'nanostation-m-xw', 'unifi-outdoor-plus'}) then +if platform.match('ar71xx', 'generic', {'cpe510', 'nanostation-m', 'nanostation-m-xw', 'unifi-outdoor-plus', 'unifiac-pro'}) then sysconfig.setup_ifname = sysconfig.config_ifname or sysconfig.wan_ifname or sysconfig.lan_ifname else sysconfig.setup_ifname = sysconfig.config_ifname or sysconfig.lan_ifname or sysconfig.wan_ifname diff --git a/patches/openwrt/0036-ath79-dev-eth-fix-QCA9561-set-phy-interface-mode-and-mask.patch b/patches/openwrt/0036-ath79-dev-eth-fix-QCA9561-set-phy-interface-mode-and-mask.patch new file mode 100644 index 00000000..f7c393a3 --- /dev/null +++ b/patches/openwrt/0036-ath79-dev-eth-fix-QCA9561-set-phy-interface-mode-and-mask.patch @@ -0,0 +1,46 @@ +From: Matthias Schiffer +Date: Fri, 13 May 2016 20:59:44 +0200 +Subject: ath79: dev-eth: fix QCA9561 set phy interface mode and mask + +QCA9563 and QCA9561 are two series of Qualcomm SoC Dragonfly. The only different +is QCA9563 w/o internal switch. It has one GMAC with SGMII interface. But they +have the same device ID(0x1150). So they share the same codes. + +Signed-off-by: Miaoqing Pan + +Backport of OpenWrt r46971 + +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c +index ff94e2e..31d2438 100644 +--- a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c ++++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c +@@ -633,7 +633,6 @@ static int __init ath79_setup_phy_if_mode(unsigned int id, + case ATH79_SOC_AR9330: + case ATH79_SOC_AR9331: + case ATH79_SOC_QCA9533: +- case ATH79_SOC_QCA9561: + case ATH79_SOC_TP9343: + pdata->phy_if_mode = PHY_INTERFACE_MODE_MII; + break; +@@ -667,6 +666,11 @@ static int __init ath79_setup_phy_if_mode(unsigned int id, + } + break; + ++ case ATH79_SOC_QCA9561: ++ if (!pdata->phy_if_mode) ++ pdata->phy_if_mode = PHY_INTERFACE_MODE_MII; ++ break; ++ + default: + BUG(); + } +@@ -1035,7 +1039,8 @@ void __init ath79_register_eth(unsigned int id) + AR933X_RESET_GE0_MDIO; + pdata->set_speed = ath79_set_speed_dummy; + +- pdata->phy_mask = BIT(4); ++ if (!pdata->phy_mask) ++ pdata->phy_mask = BIT(4); + } else { + pdata->reset_bit = AR933X_RESET_GE1_MAC | + AR933X_RESET_GE1_MDIO; diff --git a/patches/openwrt/0037-ar71xx-use-correct-PLL-configuration-register-bitmask-for-QCA956x-SoC.patch b/patches/openwrt/0037-ar71xx-use-correct-PLL-configuration-register-bitmask-for-QCA956x-SoC.patch new file mode 100644 index 00000000..3a9968e3 --- /dev/null +++ b/patches/openwrt/0037-ar71xx-use-correct-PLL-configuration-register-bitmask-for-QCA956x-SoC.patch @@ -0,0 +1,33 @@ +From: Matthias Schiffer +Date: Fri, 13 May 2016 22:58:50 +0200 +Subject: ar71xx: use correct PLL configuration register bitmask for QCA956x SoC. + +Incorrect value causes clock inaccuracy as huge as 1/60. + +Signed-off-by: Dmitry Ivanov +Signed-off-by: Felix Fietkau + +Backport of OpenWrt r47363 + +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 b5c88e9..d3a14b2 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 +@@ -529,7 +529,7 @@ + +#define QCA956X_PLL_CPU_CONFIG1_NFRAC_L_SHIFT 0 + +#define QCA956X_PLL_CPU_CONFIG1_NFRAC_L_MASK 0x1f + +#define QCA956X_PLL_CPU_CONFIG1_NFRAC_H_SHIFT 5 +-+#define QCA956X_PLL_CPU_CONFIG1_NFRAC_H_MASK 0x3fff +++#define QCA956X_PLL_CPU_CONFIG1_NFRAC_H_MASK 0x1fff + +#define QCA956X_PLL_CPU_CONFIG1_NINT_SHIFT 18 + +#define QCA956X_PLL_CPU_CONFIG1_NINT_MASK 0x1ff + + +@@ -541,7 +541,7 @@ + +#define QCA956X_PLL_DDR_CONFIG1_NFRAC_L_SHIFT 0 + +#define QCA956X_PLL_DDR_CONFIG1_NFRAC_L_MASK 0x1f + +#define QCA956X_PLL_DDR_CONFIG1_NFRAC_H_SHIFT 5 +-+#define QCA956X_PLL_DDR_CONFIG1_NFRAC_H_MASK 0x3fff +++#define QCA956X_PLL_DDR_CONFIG1_NFRAC_H_MASK 0x1fff + +#define QCA956X_PLL_DDR_CONFIG1_NINT_SHIFT 18 + +#define QCA956X_PLL_DDR_CONFIG1_NINT_MASK 0x1ff + + diff --git a/patches/openwrt/0038-ar71xx-update-QCA956x-support.patch b/patches/openwrt/0038-ar71xx-update-QCA956x-support.patch new file mode 100644 index 00000000..3ae6c249 --- /dev/null +++ b/patches/openwrt/0038-ar71xx-update-QCA956x-support.patch @@ -0,0 +1,381 @@ +From: Matthias Schiffer +Date: Fri, 13 May 2016 22:18:40 +0200 +Subject: ar71xx: update QCA956x support + +- separate qca956x and tp9343 (they use different IDs) +- rename qca9561->qca956x for consistency +- add missing bits (device reset, gpio output select) +- fix wmac setup + +Signed-off-by: Roman Yeryomin + +Backport of OpenWrt r47981 + +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 d3a14b2..61b8976 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 +@@ -105,7 +105,7 @@ + qca953x_clocks_init(); + else if (soc_is_qca955x()) + qca955x_clocks_init(); +-+ else if (soc_is_qca956x()) +++ else if (soc_is_qca956x() || soc_is_tp9343()) + + qca956x_clocks_init(); + else + BUG(); +@@ -116,7 +116,7 @@ + reg = QCA953X_RESET_REG_RESET_MODULE; + else if (soc_is_qca955x()) + reg = QCA955X_RESET_REG_RESET_MODULE; +-+ else if (soc_is_qca956x()) +++ else if (soc_is_qca956x() || soc_is_tp9343()) + + reg = QCA956X_RESET_REG_RESET_MODULE; + else + panic("Reset register not defined for this SOC"); +@@ -125,20 +125,30 @@ + reg = QCA953X_RESET_REG_RESET_MODULE; + else if (soc_is_qca955x()) + reg = QCA955X_RESET_REG_RESET_MODULE; +-+ else if (soc_is_qca956x()) +++ else if (soc_is_qca956x() || soc_is_tp9343()) + + reg = QCA956X_RESET_REG_RESET_MODULE; + else + panic("Reset register not defined for this SOC"); + ++@@ -133,6 +137,8 @@ u32 ath79_device_reset_get(u32 mask) ++ reg = AR933X_RESET_REG_RESET_MODULE; ++ else if (soc_is_ar934x()) ++ reg = AR934X_RESET_REG_RESET_MODULE; +++ else if (soc_is_qca956x() || soc_is_tp9343()) +++ reg = QCA956X_RESET_REG_RESET_MODULE; ++ else ++ BUG(); ++ + --- a/arch/mips/ath79/dev-common.c + +++ b/arch/mips/ath79/dev-common.c +-@@ -94,7 +94,8 @@ void __init ath79_register_uart(void) ++@@ -94,7 +94,9 @@ void __init ath79_register_uart(void) + soc_is_ar913x() || + soc_is_ar934x() || + soc_is_qca953x() || + - soc_is_qca955x()) { + + soc_is_qca955x() || +-+ soc_is_qca956x()) { +++ soc_is_qca956x() || +++ soc_is_tp9343()) { + ath79_uart_data[0].uartclk = uart_clk_rate; + platform_device_register(&ath79_uart_device); + } else if (soc_is_ar933x()) { +@@ -168,14 +178,14 @@ + qca953x_usb_setup(); + else if (soc_is_qca955x()) + qca955x_usb_setup(); +-+ else if (soc_is_qca9561()) +++ else if (soc_is_qca956x()) + + qca956x_usb_setup(); + else + BUG(); + } + --- a/arch/mips/ath79/dev-wmac.c + +++ b/arch/mips/ath79/dev-wmac.c +-@@ -189,6 +189,24 @@ static void qca955x_wmac_setup(void) ++@@ -189,6 +189,26 @@ static void qca955x_wmac_setup(void) + ath79_wmac_data.is_clk_25mhz = true; + } + +@@ -195,16 +205,18 @@ + + ath79_wmac_data.is_clk_25mhz = false; + + else + + ath79_wmac_data.is_clk_25mhz = true; +++ +++ ath79_wmac_data.get_mac_revision = ar93xx_get_soc_revision; + +} + + + static bool __init + ar93xx_wmac_otp_read_word(void __iomem *base, int addr, u32 *data) + { +-@@ -392,6 +410,8 @@ void __init ath79_register_wmac(u8 *cal_ ++@@ -392,6 +412,8 @@ void __init ath79_register_wmac(u8 *cal_ + qca953x_wmac_setup(); + else if (soc_is_qca955x()) + qca955x_wmac_setup(); +-+ else if (soc_is_qca956x()) +++ else if (soc_is_qca956x() || soc_is_tp9343()) + + qca956x_wmac_setup(); + else + BUG(); +@@ -216,27 +228,38 @@ + case REV_ID_MAJOR_QCA9556: + case REV_ID_MAJOR_QCA9558: + + case REV_ID_MAJOR_TP9343: +-+ case REV_ID_MAJOR_QCA9561: +++ case REV_ID_MAJOR_QCA956X: + _prom_putchar = prom_putchar_ar71xx; + break; + + --- a/arch/mips/ath79/gpio.c + +++ b/arch/mips/ath79/gpio.c +-@@ -148,7 +148,8 @@ static void __iomem *ath79_gpio_get_func ++@@ -148,7 +148,10 @@ static void __iomem *ath79_gpio_get_func + soc_is_ar913x() || + soc_is_ar933x()) + reg = AR71XX_GPIO_REG_FUNC; + - else if (soc_is_ar934x() || soc_is_qca953x()) + + else if (soc_is_ar934x() || +-+ soc_is_qca953x() || soc_is_qca956x()) +++ soc_is_qca953x() || +++ soc_is_qca956x() || +++ soc_is_tp9343()) + reg = AR934X_GPIO_REG_FUNC; + else + BUG(); +-@@ -228,12 +229,15 @@ void __init ath79_gpio_init(void) ++@@ -187,7 +190,7 @@ void __init ath79_gpio_output_select(uns ++ unsigned int reg; ++ u32 t, s; ++ ++- BUG_ON(!soc_is_ar934x() && !soc_is_qca953x()); +++ BUG_ON(!soc_is_ar934x() && !soc_is_qca953x() && !soc_is_qca956x()); ++ ++ if (gpio >= AR934X_GPIO_COUNT) ++ return; ++@@ -228,12 +231,15 @@ void __init ath79_gpio_init(void) + ath79_gpio_count = QCA953X_GPIO_COUNT; + else if (soc_is_qca955x()) + ath79_gpio_count = QCA955X_GPIO_COUNT; +-+ else if (soc_is_qca956x()) +++ else if (soc_is_qca956x() || soc_is_tp9343()) + + ath79_gpio_count = QCA956X_GPIO_COUNT; + else + BUG(); +@@ -245,23 +268,24 @@ + ath79_gpio_chip.ngpio = ath79_gpio_count; + - if (soc_is_ar934x() || soc_is_qca953x() || soc_is_qca955x()) { + + if (soc_is_ar934x() || soc_is_qca953x() || soc_is_qca955x() || +-+ soc_is_qca956x()) { +++ soc_is_qca956x() || soc_is_tp9343()) { + ath79_gpio_chip.direction_input = ar934x_gpio_direction_input; + ath79_gpio_chip.direction_output = ar934x_gpio_direction_output; + } + --- a/arch/mips/ath79/irq.c + +++ b/arch/mips/ath79/irq.c +-@@ -107,7 +107,8 @@ static void __init ath79_misc_irq_init(v ++@@ -107,7 +107,9 @@ static void __init ath79_misc_irq_init(v + soc_is_ar933x() || + soc_is_ar934x() || + soc_is_qca953x() || + - soc_is_qca955x()) + + soc_is_qca955x() || +-+ soc_is_qca956x()) +++ soc_is_qca956x() || +++ soc_is_tp9343()) + ath79_misc_irq_chip.irq_ack = ar724x_misc_irq_ack; + else + BUG(); +-@@ -268,6 +269,97 @@ static void qca955x_irq_init(void) ++@@ -268,6 +270,97 @@ static void qca955x_irq_init(void) + irq_set_chained_handler(ATH79_CPU_IRQ(3), qca955x_ip3_irq_dispatch); + } + +@@ -359,21 +383,21 @@ + asmlinkage void plat_irq_dispatch(void) + { + unsigned long pending; +-@@ -397,6 +489,9 @@ void __init arch_init_irq(void) ++@@ -397,6 +490,9 @@ void __init arch_init_irq(void) + } else if (soc_is_qca955x()) { + ath79_ip2_handler = ath79_default_ip2_handler; + ath79_ip3_handler = ath79_default_ip3_handler; +-+ } else if (soc_is_qca956x()) { +++ } else if (soc_is_qca956x() || soc_is_tp9343()) { + + ath79_ip2_handler = ath79_default_ip2_handler; + + ath79_ip3_handler = ath79_default_ip3_handler; + } else { + BUG(); + } +-@@ -411,4 +506,6 @@ void __init arch_init_irq(void) ++@@ -411,4 +507,6 @@ void __init arch_init_irq(void) + qca953x_irq_init(); + else if (soc_is_qca955x()) + qca955x_irq_init(); +-+ else if (soc_is_qca956x()) +++ else if (soc_is_qca956x() || soc_is_tp9343()) + + qca956x_irq_init(); + } + --- a/arch/mips/ath79/Kconfig +@@ -428,7 +452,7 @@ + } else if (soc_is_qca955x()) { + ath79_pci_irq_map = qca955x_pci_irq_map; + ath79_pci_nr_irqs = ARRAY_SIZE(qca955x_pci_irq_map); +-+ } else if (soc_is_qca9561()) { +++ } else if (soc_is_qca956x()) { + + ath79_pci_irq_map = qca956x_pci_irq_map; + + ath79_pci_nr_irqs = ARRAY_SIZE(qca956x_pci_irq_map); + } else { +@@ -438,7 +462,7 @@ + QCA955X_PCI_MEM_SIZE, + 1, + ATH79_IP3_IRQ(2)); +-+ } else if (soc_is_qca9561()) { +++ } else if (soc_is_qca956x()) { + + pdev = ath79_register_pci_ar724x(0, + + QCA956X_PCI_CFG_BASE1, + + QCA956X_PCI_CTRL_BASE1, +@@ -456,15 +480,15 @@ + rev = id & QCA955X_REV_ID_REVISION_MASK; + break; + +-+ case REV_ID_MAJOR_TP9343: +-+ ath79_soc = ATH79_SOC_TP9343; +-+ chip = "9343"; +++ case REV_ID_MAJOR_QCA956X: +++ ath79_soc = ATH79_SOC_QCA956X; +++ chip = "956X"; + + rev = id & QCA956X_REV_ID_REVISION_MASK; + + break; + + +-+ case REV_ID_MAJOR_QCA9561: +-+ ath79_soc = ATH79_SOC_QCA9561; +-+ chip = "9561"; +++ case REV_ID_MAJOR_TP9343: +++ ath79_soc = ATH79_SOC_TP9343; +++ chip = "9343"; + + rev = id & QCA956X_REV_ID_REVISION_MASK; + + break; + + +@@ -476,7 +500,7 @@ + ath79_soc_rev = rev; + + - if (soc_is_qca953x() || soc_is_qca955x()) +-+ if (soc_is_qca953x() || soc_is_qca955x() || soc_is_qca9561()) +++ if (soc_is_qca953x() || soc_is_qca955x() || soc_is_qca956x()) + sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s ver %u rev %u", + chip, ver, rev); + + else if (soc_is_tp9343()) +@@ -511,7 +535,21 @@ + #define AR9300_OTP_BASE 0x14000 + #define AR9300_OTP_STATUS 0x15f18 + #define AR9300_OTP_STATUS_TYPE 0x7 +-@@ -375,6 +392,49 @@ ++@@ -152,6 +169,13 @@ ++ #define AR9300_OTP_READ_DATA 0x15f1c ++ ++ /* +++ * Hidden Registers +++ */ +++#define QCA956X_DAM_RESET_OFFSET 0xb90001bc +++#define QCA956X_DAM_RESET_SIZE 0x4 +++#define QCA956X_INLINE_CHKSUM_ENG BIT(27) +++ +++/* ++ * DDR_CTRL block ++ */ ++ #define AR71XX_DDR_REG_PCI_WIN0 0x7c ++@@ -375,6 +399,49 @@ + #define QCA955X_PLL_CLK_CTRL_DDRCLK_FROM_DDRPLL BIT(21) + #define QCA955X_PLL_CLK_CTRL_AHBCLK_FROM_DDRPLL BIT(24) + +@@ -561,7 +599,7 @@ + /* + * USB_CONFIG block + */ +-@@ -422,6 +482,11 @@ ++@@ -422,6 +489,11 @@ + #define QCA955X_RESET_REG_BOOTSTRAP 0xb0 + #define QCA955X_RESET_REG_EXT_INT_STATUS 0xac + +@@ -573,7 +611,7 @@ + #define MISC_INT_ETHSW BIT(12) + #define MISC_INT_TIMER4 BIT(10) + #define MISC_INT_TIMER3 BIT(9) +-@@ -596,6 +661,8 @@ ++@@ -596,6 +668,8 @@ + + #define QCA955X_BOOTSTRAP_REF_CLK_40 BIT(4) + +@@ -582,7 +620,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) +-@@ -663,6 +730,37 @@ ++@@ -663,6 +737,37 @@ + QCA955X_EXT_INT_PCIE_RC2_INT1 | QCA955X_EXT_INT_PCIE_RC2_INT2 | \ + QCA955X_EXT_INT_PCIE_RC2_INT3) + +@@ -620,16 +658,16 @@ + #define REV_ID_MAJOR_MASK 0xfff0 + #define REV_ID_MAJOR_AR71XX 0x00a0 + #define REV_ID_MAJOR_AR913X 0x00b0 +-@@ -678,6 +776,8 @@ ++@@ -678,6 +783,8 @@ + #define REV_ID_MAJOR_QCA9533_V2 0x0160 + #define REV_ID_MAJOR_QCA9556 0x0130 + #define REV_ID_MAJOR_QCA9558 0x1130 + +#define REV_ID_MAJOR_TP9343 0x0150 +-+#define REV_ID_MAJOR_QCA9561 0x1150 +++#define REV_ID_MAJOR_QCA956X 0x1150 + + #define AR71XX_REV_ID_MINOR_MASK 0x3 + #define AR71XX_REV_ID_MINOR_AR7130 0x0 +-@@ -702,6 +802,8 @@ ++@@ -702,6 +809,8 @@ + + #define QCA955X_REV_ID_REVISION_MASK 0xf + +@@ -638,7 +676,7 @@ + /* + * SPI block + */ +-@@ -766,6 +868,19 @@ ++@@ -766,6 +875,19 @@ + #define QCA953X_GPIO_OUT_MUX_LED_LINK4 44 + #define QCA953X_GPIO_OUT_MUX_LED_LINK5 45 + +@@ -658,7 +696,7 @@ + #define AR71XX_GPIO_COUNT 16 + #define AR7240_GPIO_COUNT 18 + #define AR7241_GPIO_COUNT 20 +-@@ -774,6 +889,7 @@ ++@@ -774,6 +896,7 @@ + #define AR934X_GPIO_COUNT 23 + #define QCA953X_GPIO_COUNT 18 + #define QCA955X_GPIO_COUNT 24 +@@ -673,11 +711,11 @@ + ATH79_SOC_QCA9556, + ATH79_SOC_QCA9558, + + ATH79_SOC_TP9343, +-+ ATH79_SOC_QCA9561, +++ ATH79_SOC_QCA956X, + }; + + extern enum ath79_soc_type ath79_soc; +-@@ -126,6 +128,21 @@ static inline int soc_is_qca955x(void) ++@@ -126,6 +128,26 @@ static inline int soc_is_qca955x(void) + return soc_is_qca9556() || soc_is_qca9558(); + } + +@@ -685,15 +723,20 @@ + +{ + + return ath79_soc == ATH79_SOC_TP9343; + +} +-+ +++ + +static inline int soc_is_qca9561(void) + +{ +-+ return ath79_soc == ATH79_SOC_QCA9561; +++ return ath79_soc == ATH79_SOC_QCA956X; +++} +++ +++static inline int soc_is_qca9563(void) +++{ +++ return ath79_soc == ATH79_SOC_QCA956X; + +} + + + +static inline int soc_is_qca956x(void) + +{ +-+ return soc_is_tp9343() || soc_is_qca9561(); +++ return soc_is_qca9561() || soc_is_qca9563(); + +} + + + extern void __iomem *ath79_ddr_base; diff --git a/patches/openwrt/0039-ar71xx-fold-patch-622-MIPS-ath79-add-support-for-QCA956x-ethernet.patch-into-files.patch b/patches/openwrt/0039-ar71xx-fold-patch-622-MIPS-ath79-add-support-for-QCA956x-ethernet.patch-into-files.patch new file mode 100644 index 00000000..13161242 --- /dev/null +++ b/patches/openwrt/0039-ar71xx-fold-patch-622-MIPS-ath79-add-support-for-QCA956x-ethernet.patch-into-files.patch @@ -0,0 +1,176 @@ +From: Matthias Schiffer +Date: Fri, 13 May 2016 21:00:16 +0200 +Subject: ar71xx: fold patch 622-MIPS-ath79-add-support-for-QCA956x-ethernet.patch into files/ + +Signed-off-by: Felix Fietkau + +Backport of OpenWrt r48650 + +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c +index 31d2438..2efb9c7 100644 +--- a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c ++++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c +@@ -198,7 +198,6 @@ void __init ath79_register_mdio(unsigned int id, u32 phy_mask) + case ATH79_SOC_AR9330: + case ATH79_SOC_AR9331: + case ATH79_SOC_QCA9533: +- case ATH79_SOC_QCA9561: + case ATH79_SOC_TP9343: + mdio_dev = &ath79_mdio1_device; + mdio_data = &ath79_mdio1_data; +@@ -209,6 +208,7 @@ void __init ath79_register_mdio(unsigned int id, u32 phy_mask) + case ATH79_SOC_AR9344: + case ATH79_SOC_QCA9556: + case ATH79_SOC_QCA9558: ++ case ATH79_SOC_QCA956X: + if (id == 0) { + mdio_dev = &ath79_mdio0_device; + mdio_data = &ath79_mdio0_data; +@@ -258,7 +258,6 @@ void __init ath79_register_mdio(unsigned int id, u32 phy_mask) + break; + + case ATH79_SOC_QCA9533: +- case ATH79_SOC_QCA9561: + case ATH79_SOC_TP9343: + mdio_data->builtin_switch = 1; + break; +@@ -268,6 +267,11 @@ void __init ath79_register_mdio(unsigned int id, u32 phy_mask) + mdio_data->is_ar934x = 1; + break; + ++ case ATH79_SOC_QCA956X: ++ if (id == 1) ++ mdio_data->builtin_switch = 1; ++ break; ++ + default: + break; + } +@@ -387,6 +391,16 @@ static void qca955x_set_speed_sgmii(int speed) + iounmap(base); + } + ++static void qca956x_set_speed_sgmii(int speed) ++{ ++ void __iomem *base; ++ u32 val = ath79_get_eth_pll(0, speed); ++ ++ base = ioremap_nocache(AR71XX_PLL_BASE, AR71XX_PLL_SIZE); ++ __raw_writel(val, base + QCA955X_PLL_ETH_SGMII_CONTROL_REG); ++ iounmap(base); ++} ++ + static void ath79_set_speed_dummy(int speed) + { + } +@@ -517,6 +531,10 @@ struct ag71xx_switch_platform_data ath79_switch_data; + #define AR934X_PLL_VAL_100 0x00000101 + #define AR934X_PLL_VAL_10 0x00001616 + ++#define QCA956X_PLL_VAL_1000 0x03000000 ++#define QCA956X_PLL_VAL_100 0x00000101 ++#define QCA956X_PLL_VAL_10 0x00001919 ++ + static void __init ath79_init_eth_pll_data(unsigned int id) + { + struct ath79_eth_pll_data *pll_data; +@@ -575,13 +593,18 @@ static void __init ath79_init_eth_pll_data(unsigned int id) + case ATH79_SOC_QCA9533: + case ATH79_SOC_QCA9556: + case ATH79_SOC_QCA9558: +- case ATH79_SOC_QCA9561: + case ATH79_SOC_TP9343: + pll_10 = AR934X_PLL_VAL_10; + pll_100 = AR934X_PLL_VAL_100; + pll_1000 = AR934X_PLL_VAL_1000; + break; + ++ case ATH79_SOC_QCA956X: ++ pll_10 = QCA956X_PLL_VAL_10; ++ pll_100 = QCA956X_PLL_VAL_100; ++ pll_1000 = QCA956X_PLL_VAL_1000; ++ break; ++ + default: + BUG(); + } +@@ -656,6 +679,7 @@ static int __init ath79_setup_phy_if_mode(unsigned int id, + + case ATH79_SOC_QCA9556: + case ATH79_SOC_QCA9558: ++ case ATH79_SOC_QCA956X: + switch (pdata->phy_if_mode) { + case PHY_INTERFACE_MODE_MII: + case PHY_INTERFACE_MODE_RGMII: +@@ -666,11 +690,6 @@ static int __init ath79_setup_phy_if_mode(unsigned int id, + } + break; + +- case ATH79_SOC_QCA9561: +- if (!pdata->phy_if_mode) +- pdata->phy_if_mode = PHY_INTERFACE_MODE_MII; +- break; +- + default: + BUG(); + } +@@ -699,7 +718,7 @@ static int __init ath79_setup_phy_if_mode(unsigned int id, + case ATH79_SOC_AR7241: + case ATH79_SOC_AR9330: + case ATH79_SOC_AR9331: +- case ATH79_SOC_QCA9561: ++ case ATH79_SOC_QCA956X: + case ATH79_SOC_TP9343: + pdata->phy_if_mode = PHY_INTERFACE_MODE_GMII; + break; +@@ -1032,7 +1051,6 @@ void __init ath79_register_eth(unsigned int id) + pdata->fifo_cfg3 = 0x01f00140; + break; + +- case ATH79_SOC_QCA9561: + case ATH79_SOC_TP9343: + if (id == 0) { + pdata->reset_bit = AR933X_RESET_GE0_MAC | +@@ -1100,6 +1118,34 @@ void __init ath79_register_eth(unsigned int id) + pdata->fifo_cfg3 = 0x01f00140; + break; + ++ case ATH79_SOC_QCA956X: ++ if (id == 0) { ++ pdata->reset_bit = QCA955X_RESET_GE0_MAC | ++ QCA955X_RESET_GE0_MDIO; ++ if (pdata->phy_if_mode == PHY_INTERFACE_MODE_SGMII) ++ pdata->set_speed = qca956x_set_speed_sgmii; ++ else ++ /* FIXME */ ++ pdata->set_speed = ath79_set_speed_dummy; ++ } else { ++ pdata->reset_bit = QCA955X_RESET_GE1_MAC | ++ QCA955X_RESET_GE1_MDIO; ++ /* FIXME */ ++ pdata->set_speed = ath79_set_speed_dummy; ++ } ++ ++ pdata->ddr_flush = ath79_ddr_no_flush; ++ pdata->has_gbit = 1; ++ pdata->is_ar724x = 1; ++ ++ if (!pdata->fifo_cfg1) ++ pdata->fifo_cfg1 = 0x0010ffff; ++ if (!pdata->fifo_cfg2) ++ pdata->fifo_cfg2 = 0x015500aa; ++ if (!pdata->fifo_cfg3) ++ pdata->fifo_cfg3 = 0x01f00140; ++ break; ++ + default: + BUG(); + } +@@ -1140,7 +1186,6 @@ void __init ath79_register_eth(unsigned int id) + case ATH79_SOC_AR9330: + case ATH79_SOC_AR9331: + case ATH79_SOC_QCA9533: +- case ATH79_SOC_QCA9561: + case ATH79_SOC_TP9343: + pdata->mii_bus_dev = &ath79_mdio1_device.dev; + break; diff --git a/patches/openwrt/0040-ar71xx-fix-MDIO-bus-probe-on-QCA956x.patch b/patches/openwrt/0040-ar71xx-fix-MDIO-bus-probe-on-QCA956x.patch new file mode 100644 index 00000000..7594cf2f --- /dev/null +++ b/patches/openwrt/0040-ar71xx-fix-MDIO-bus-probe-on-QCA956x.patch @@ -0,0 +1,22 @@ +From: Matthias Schiffer +Date: Fri, 13 May 2016 21:00:41 +0200 +Subject: ar71xx: fix MDIO bus probe on QCA956x + +Signed-off-by: Felix Fietkau + +Backport of OpenWrt r48651 + +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c +index 2efb9c7..12a376e 100644 +--- a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c ++++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c +@@ -183,7 +183,8 @@ void __init ath79_register_mdio(unsigned int id, u32 phy_mask) + ath79_soc == ATH79_SOC_AR9342 || + ath79_soc == ATH79_SOC_AR9344 || + ath79_soc == ATH79_SOC_QCA9556 || +- ath79_soc == ATH79_SOC_QCA9558) ++ ath79_soc == ATH79_SOC_QCA9558 || ++ ath79_soc == ATH79_SOC_QCA956X) + max_id = 1; + else + max_id = 0; diff --git a/patches/openwrt/0041-ar71xx-fix-qca956x-ethernet-initialization.patch b/patches/openwrt/0041-ar71xx-fix-qca956x-ethernet-initialization.patch new file mode 100644 index 00000000..6cc5e950 --- /dev/null +++ b/patches/openwrt/0041-ar71xx-fix-qca956x-ethernet-initialization.patch @@ -0,0 +1,64 @@ +From: Matthias Schiffer +Date: Fri, 13 May 2016 21:01:19 +0200 +Subject: ar71xx: fix qca956x ethernet initialization + +Complete internal switch initialization for QCA956X. +Set default mdio device if the interface mode of GE0 is not SGMII (fix ticket #21520). + +Signed-off-by: Weijie Gao + +Backport of OpenWrt r48937 + +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c +index 12a376e..b43c80a 100644 +--- a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c ++++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c +@@ -271,6 +271,7 @@ void __init ath79_register_mdio(unsigned int id, u32 phy_mask) + case ATH79_SOC_QCA956X: + if (id == 1) + mdio_data->builtin_switch = 1; ++ mdio_data->is_ar934x = 1; + break; + + default: +@@ -1123,16 +1124,25 @@ void __init ath79_register_eth(unsigned int id) + if (id == 0) { + pdata->reset_bit = QCA955X_RESET_GE0_MAC | + QCA955X_RESET_GE0_MDIO; ++ + if (pdata->phy_if_mode == PHY_INTERFACE_MODE_SGMII) + pdata->set_speed = qca956x_set_speed_sgmii; + else +- /* FIXME */ +- pdata->set_speed = ath79_set_speed_dummy; ++ pdata->set_speed = ath79_set_speed_ge0; + } else { + pdata->reset_bit = QCA955X_RESET_GE1_MAC | + QCA955X_RESET_GE1_MDIO; +- /* FIXME */ ++ + pdata->set_speed = ath79_set_speed_dummy; ++ ++ pdata->switch_data = &ath79_switch_data; ++ ++ pdata->speed = SPEED_1000; ++ pdata->duplex = DUPLEX_FULL; ++ ++ /* reset the built-in switch */ ++ ath79_device_reset_set(AR934X_RESET_ETH_SWITCH); ++ ath79_device_reset_clear(AR934X_RESET_ETH_SWITCH); + } + + pdata->ddr_flush = ath79_ddr_no_flush; +@@ -1196,6 +1206,11 @@ void __init ath79_register_eth(unsigned int id) + /* don't assign any MDIO device by default */ + break; + ++ case ATH79_SOC_QCA956X: ++ if (pdata->phy_if_mode != PHY_INTERFACE_MODE_SGMII) ++ pdata->mii_bus_dev = &ath79_mdio1_device.dev; ++ break; ++ + default: + pdata->mii_bus_dev = &ath79_mdio0_device.dev; + break; diff --git a/patches/openwrt/0042-ar71xx-Support-for-Ubiquiti-UniFi-AP-AC-LITE.patch b/patches/openwrt/0042-ar71xx-Support-for-Ubiquiti-UniFi-AP-AC-LITE.patch new file mode 100644 index 00000000..21390fc7 --- /dev/null +++ b/patches/openwrt/0042-ar71xx-Support-for-Ubiquiti-UniFi-AP-AC-LITE.patch @@ -0,0 +1,562 @@ +From: Matthias Schiffer +Date: Fri, 13 May 2016 20:47:26 +0200 +Subject: ar71xx: Support for Ubiquiti UniFi AP AC LITE + +Add support for the Ubiquiti UniFi AP AC LITE +Signed-off-by: P.Wassi + +Backport of OpenWrt r48711 + +diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh +index 5a184cd..8c6ac9a 100644 +--- a/target/linux/ar71xx/base-files/etc/diag.sh ++++ b/target/linux/ar71xx/base-files/etc/diag.sh +@@ -296,7 +296,8 @@ get_status_led() { + unifi) + status_led="ubnt:green:dome" + ;; +- uap-pro) ++ uap-pro | \ ++ unifiac) + status_led="ubnt:white:dome" + ;; + unifi-outdoor-plus) +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 b2e15bb..e4a1473 100755 +--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network ++++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network +@@ -366,6 +366,7 @@ tl-wa901nd-v3 |\ + tl-wa901nd-v4 |\ + tl-wr703n |\ + tube2h |\ ++unifiac |\ + wndap360 |\ + mynet-rext |\ + wp543) +diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh +index ddd6611..8670583 100755 +--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh ++++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh +@@ -881,6 +881,9 @@ ar71xx_board_detect() { + *UniFi) + name="unifi" + ;; ++ *"UniFi-AC") ++ name="unifiac" ++ ;; + *"UniFi AP Pro") + name="uap-pro" + ;; +diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +index c5c1871..4c43166 100755 +--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh ++++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +@@ -251,6 +251,7 @@ platform_check_image() { + wlae-ag300n | \ + nbg460n_550n_550nh | \ + unifi | \ ++ unifiac | \ + unifi-outdoor | \ + carambola2 | \ + weio ) +diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18 +index e2ff826..9a81911 100644 +--- a/target/linux/ar71xx/config-3.18 ++++ b/target/linux/ar71xx/config-3.18 +@@ -137,6 +137,7 @@ CONFIG_ATH79_MACH_TL_WR941ND=y + CONFIG_ATH79_MACH_TL_WR941ND_V6=y + CONFIG_ATH79_MACH_TUBE2H=y + CONFIG_ATH79_MACH_UBNT=y ++CONFIG_ATH79_MACH_UBNT_UNIFIAC=y + CONFIG_ATH79_MACH_UBNT_XM=y + CONFIG_ATH79_MACH_WEIO=y + CONFIG_ATH79_MACH_WHR_HP_G300N=y +@@ -320,7 +321,7 @@ CONFIG_SOC_AR933X=y + CONFIG_SOC_AR934X=y + CONFIG_SOC_QCA953X=y + CONFIG_SOC_QCA955X=y +-# CONFIG_SOC_QCA956X is not set ++CONFIG_SOC_QCA956X=y + CONFIG_SPI=y + CONFIG_SPI_AP83=y + CONFIG_SPI_ATH79=y +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-unifiac.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-unifiac.c +new file mode 100644 +index 0000000..3617ca7 +--- /dev/null ++++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-unifiac.c +@@ -0,0 +1,109 @@ ++/* ++ * Ubiquiti UniFi AC (LITE) board support ++ * ++ * Copyright (C) 2015-2016 P. Wassi ++ * ++ * Derived from: mach-ubnt-xm.c ++ * ++ * 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 ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++#include ++ ++#include "common.h" ++#include "dev-ap9x-pci.h" ++#include "dev-eth.h" ++#include "dev-gpio-buttons.h" ++#include "dev-leds-gpio.h" ++#include "dev-m25p80.h" ++#include "dev-wmac.h" ++#include "machtypes.h" ++ ++ ++#define UNIFIAC_KEYS_POLL_INTERVAL 20 ++#define UNIFIAC_KEYS_DEBOUNCE_INTERVAL (3 * UNIFIAC_KEYS_POLL_INTERVAL) ++ ++#define UNIFIAC_GPIO_LED_WHITE 7 ++#define UNIFIAC_GPIO_LED_BLUE 8 ++ ++#define UNIFIAC_GPIO_BTN_RESET 2 ++ ++#define UNIFIAC_MAC0_OFFSET 0x0000 ++#define UNIFIAC_WMAC_CALDATA_OFFSET 0x1000 ++#define UNIFIAC_PCI_CALDATA_OFFSET 0x5000 ++ ++ ++static struct flash_platform_data ubnt_unifiac_flash_data = { ++ /* mx25l12805d and mx25l12835f have the same JEDEC ID */ ++ .type = "mx25l12805d", ++}; ++ ++static struct gpio_led ubnt_unifiac_leds_gpio[] __initdata = { ++ { ++ .name = "ubnt:white:dome", ++ .gpio = UNIFIAC_GPIO_LED_WHITE, ++ .active_low = 0, ++ }, { ++ .name = "ubnt:blue:dome", ++ .gpio = UNIFIAC_GPIO_LED_BLUE, ++ .active_low = 0, ++ } ++}; ++ ++static struct gpio_keys_button ubnt_unifiac_gpio_keys[] __initdata = { ++ { ++ .desc = "reset", ++ .type = EV_KEY, ++ .code = KEY_RESTART, ++ .debounce_interval = UNIFIAC_KEYS_DEBOUNCE_INTERVAL, ++ .gpio = UNIFIAC_GPIO_BTN_RESET, ++ .active_low = 1, ++ } ++}; ++ ++static void __init ubnt_unifiac_setup(void) ++{ ++ u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff0000); ++ ++ ath79_register_m25p80(&ubnt_unifiac_flash_data); ++ ++ ++ ath79_init_mac(ath79_eth0_data.mac_addr, ++ eeprom + UNIFIAC_MAC0_OFFSET, 0); ++ ++ ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_SGMII; ++ ath79_eth0_data.phy_mask = BIT(4); ++ ath79_eth0_pll_data.pll_10 = 0x00001313; ++ ++ ath79_register_mdio(0, ~BIT(4)); ++ ath79_register_eth(0); ++ ++ ++ ath79_register_wmac(eeprom + UNIFIAC_WMAC_CALDATA_OFFSET, NULL); ++ ++ ++ ap91_pci_init(eeprom + UNIFIAC_PCI_CALDATA_OFFSET, NULL); ++ ++ ++ ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_unifiac_leds_gpio), ++ ubnt_unifiac_leds_gpio); ++ ++ ath79_register_gpio_keys_polled(-1, UNIFIAC_KEYS_POLL_INTERVAL, ++ ARRAY_SIZE(ubnt_unifiac_gpio_keys), ++ ubnt_unifiac_gpio_keys); ++} ++ ++MIPS_MACHINE(ATH79_MACH_UBNT_UNIFIAC, "UBNT-UF-AC", "Ubiquiti UniFi-AC", ++ ubnt_unifiac_setup); +diff --git a/target/linux/ar71xx/generic/profiles/ubnt.mk b/target/linux/ar71xx/generic/profiles/ubnt.mk +index d8e24d0..94eff18 100644 +--- a/target/linux/ar71xx/generic/profiles/ubnt.mk ++++ b/target/linux/ar71xx/generic/profiles/ubnt.mk +@@ -38,6 +38,17 @@ endef + + $(eval $(call Profile,UBNTUNIFI)) + ++define Profile/UBNTUNIFIAC ++ NAME:=Ubiquiti UniFi AP AC ++ PACKAGES:=kmod-ath10k ath10k-firmware-qca988x ++endef ++ ++define Profile/UBNTUNIFIAC/Description ++ Package set optimized for the Ubiquiti UniFi AP AC. ++endef ++ ++$(eval $(call Profile,UBNTUNIFIAC)) ++ + define Profile/UBNTUNIFIOUTDOOR + NAME:=Ubiquiti UniFiAP Outdoor + PACKAGES:= +diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile +index d42ceef..dd59f2d 100644 +--- a/target/linux/ar71xx/image/Makefile ++++ b/target/linux/ar71xx/image/Makefile +@@ -740,6 +740,16 @@ define Device/oolite + endef + TARGET_DEVICES += oolite + ++define Device/ubnt-unifiac ++ DEVICE_PROFILE := UBNT UBNTUNIFIAC ++ IMAGE_SIZE := 7744k ++ MTDPARTS = spi0.0:384k(u-boot)ro,64k(u-boot-env)ro,7744k(firmware),7744k(ubnt-airos)ro,128k(bs)ro,256k(cfg)ro,64k(EEPROM)ro ++ IMAGES := sysupgrade.bin ++ IMAGE/sysupgrade.bin = append-kernel $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) ++ BOARDNAME := UBNT-UF-AC ++endef ++TARGET_DEVICES += ubnt-unifiac ++ + rootfs_type=$(patsubst jffs2-%,jffs2,$(patsubst squashfs-%,squashfs,$(1))) + + # $(1): rootfs type. +diff --git a/target/linux/ar71xx/mikrotik/config-default b/target/linux/ar71xx/mikrotik/config-default +index b8a7bf1..2b1fe24 100644 +--- a/target/linux/ar71xx/mikrotik/config-default ++++ b/target/linux/ar71xx/mikrotik/config-default +@@ -97,6 +97,7 @@ CONFIG_ATH79_MACH_RBSXTLITE=y + # CONFIG_ATH79_MACH_TUBE2H is not set + # CONFIG_ATH79_MACH_UBNT is not set + # CONFIG_ATH79_MACH_UBNT_XM is not set ++# CONFIG_ATH79_MACH_UBNT_UNIFIAC is not set + # CONFIG_ATH79_MACH_WHR_HP_G300N is not set + # CONFIG_ATH79_MACH_WLAE_AG300N is not set + # CONFIG_ATH79_MACH_WLR8100 is not set +diff --git a/target/linux/ar71xx/nand/config-default b/target/linux/ar71xx/nand/config-default +index 626d676..f62cf1a 100644 +--- a/target/linux/ar71xx/nand/config-default ++++ b/target/linux/ar71xx/nand/config-default +@@ -59,6 +59,7 @@ + # CONFIG_ATH79_MACH_TL_WR941ND is not set + # CONFIG_ATH79_MACH_UBNT is not set + # CONFIG_ATH79_MACH_UBNT_XM is not set ++# CONFIG_ATH79_MACH_UBNT_UNIFIAC is not set + # CONFIG_ATH79_MACH_WHR_HP_G300N is not set + # CONFIG_ATH79_MACH_WLAE_AG300N is not set + # CONFIG_ATH79_MACH_WNDAP360 is not set +diff --git a/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch b/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch +index d6e786d..5a7a72c 100644 +--- a/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch ++++ b/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch +@@ -1,6 +1,6 @@ + --- a/arch/mips/ath79/machtypes.h + +++ b/arch/mips/ath79/machtypes.h +-@@ -16,22 +16,199 @@ ++@@ -16,22 +16,200 @@ + + enum ath79_mach_type { + ATH79_MACH_GENERIC = 0, +@@ -164,6 +164,7 @@ + + ATH79_MACH_UBNT_RS, /* Ubiquiti RouterStation */ + ATH79_MACH_UBNT_UAP_PRO, /* Ubiquiti UniFi AP Pro */ + ATH79_MACH_UBNT_UNIFI, /* Ubiquiti Unifi */ +++ ATH79_MACH_UBNT_UNIFIAC, /* Ubiquiti Unifi AC */ + ATH79_MACH_UBNT_UNIFI_OUTDOOR, /* Ubiquiti UnifiAP Outdoor */ + + ATH79_MACH_UBNT_UNIFI_OUTDOOR_PLUS, /* Ubiquiti UnifiAP Outdoor+ */ + ATH79_MACH_UBNT_XM, /* Ubiquiti Networks XM board rev 1.0 */ +@@ -1097,10 +1098,7 @@ + + select ATH79_DEV_M25P80 + + select ATH79_DEV_USB + + select ATH79_DEV_WMAC +- +--config ATH79_MACH_AP136 +-- bool "Atheros AP136/AP135 reference board" +-- select SOC_QCA955X +++ + +config ATH79_MACH_TL_WA7210N_V2 + + bool "TP-LINK TL-WA7210N v2 support" + + select SOC_AR724X +@@ -1115,19 +1113,12 @@ + + bool "TP-LINK TL-WA830RE v2 support" + + select SOC_AR934X + + select ATH79_DEV_ETH +- select ATH79_DEV_GPIO_BUTTONS +- select ATH79_DEV_LEDS_GPIO +-- select ATH79_DEV_NFC +-- select ATH79_DEV_SPI +++ select ATH79_DEV_GPIO_BUTTONS +++ select ATH79_DEV_LEDS_GPIO + + select ATH79_DEV_M25P80 +- select ATH79_DEV_USB +- select ATH79_DEV_WMAC +-- help +-- Say 'Y' here if you want your kernel to support the +-- Atheros AP136 or AP135 reference boards. +- +--config ATH79_MACH_AP81 +-- bool "Atheros AP81 reference board" +++ select ATH79_DEV_USB +++ select ATH79_DEV_WMAC +++ + +config ATH79_MACH_TL_WA901ND + + bool "TP-LINK TL-WA901ND/TL-WA7510N support" + + select SOC_AR724X +@@ -1139,11 +1130,11 @@ + + + +config ATH79_MACH_TL_WA901ND_V2 + + bool "TP-LINK TL-WA901ND v2 support" +- select SOC_AR913X +- select ATH79_DEV_ETH +- select ATH79_DEV_GPIO_BUTTONS +- select ATH79_DEV_LEDS_GPIO +- select ATH79_DEV_M25P80 +++ select SOC_AR913X +++ select ATH79_DEV_ETH +++ select ATH79_DEV_GPIO_BUTTONS +++ select ATH79_DEV_LEDS_GPIO +++ select ATH79_DEV_M25P80 + + select ATH79_DEV_WMAC + + + +config ATH79_MACH_TL_WDR3500 +@@ -1154,34 +1145,13 @@ + + select ATH79_DEV_GPIO_BUTTONS + + select ATH79_DEV_LEDS_GPIO + + select ATH79_DEV_M25P80 +- select ATH79_DEV_USB +- select ATH79_DEV_WMAC +-- help +-- Say 'Y' here if you want your kernel to support the +-- Atheros AP81 reference board. +- +--config ATH79_MACH_DB120 +-- bool "Atheros DB120 reference board" +++ select ATH79_DEV_USB +++ select ATH79_DEV_WMAC +++ + +config ATH79_MACH_TL_WDR4300 + + bool "TP-LINK TL-WDR3600/4300/4310 board support" +- select SOC_AR934X +- select ATH79_DEV_AP9X_PCI if PCI +- select ATH79_DEV_ETH +- select ATH79_DEV_GPIO_BUTTONS +- select ATH79_DEV_LEDS_GPIO +- select ATH79_DEV_M25P80 +-- select ATH79_DEV_NFC +- select ATH79_DEV_USB +- select ATH79_DEV_WMAC +-- help +-- Say 'Y' here if you want your kernel to support the +-- Atheros DB120 reference board. +- +--config ATH79_MACH_PB44 +-- bool "Atheros PB44 reference board" +-+config ATH79_MACH_TL_WR703N +-+ bool "TP-LINK TL-WR703N/TL-WR710N/TL-MR10U support" +-+ select SOC_AR933X +++ select SOC_AR934X +++ select ATH79_DEV_AP9X_PCI if PCI + + select ATH79_DEV_ETH + + select ATH79_DEV_GPIO_BUTTONS + + select ATH79_DEV_LEDS_GPIO +@@ -1189,8 +1159,8 @@ + + select ATH79_DEV_USB + + select ATH79_DEV_WMAC + + +-+config ATH79_MACH_TL_WR720N_V3 +-+ bool "TP-LINK TL-WR720N v3/v4 support" +++config ATH79_MACH_TL_WR703N +++ bool "TP-LINK TL-WR703N/TL-WR710N/TL-MR10U support" + + select SOC_AR933X + + select ATH79_DEV_ETH + + select ATH79_DEV_GPIO_BUTTONS +@@ -1198,7 +1168,28 @@ + + select ATH79_DEV_M25P80 + + select ATH79_DEV_USB + + select ATH79_DEV_WMAC +-+ ++ ++-config ATH79_MACH_AP136 ++- bool "Atheros AP136/AP135 reference board" ++- select SOC_QCA955X +++config ATH79_MACH_TL_WR720N_V3 +++ bool "TP-LINK TL-WR720N v3/v4 support" +++ select SOC_AR933X +++ select ATH79_DEV_ETH ++ select ATH79_DEV_GPIO_BUTTONS ++ select ATH79_DEV_LEDS_GPIO ++- select ATH79_DEV_NFC ++- select ATH79_DEV_SPI +++ select ATH79_DEV_M25P80 ++ select ATH79_DEV_USB ++ select ATH79_DEV_WMAC ++- help ++- Say 'Y' here if you want your kernel to support the ++- Atheros AP136 or AP135 reference boards. ++ ++-config ATH79_MACH_AP81 ++- bool "Atheros AP81 reference board" ++- select SOC_AR913X + +config ATH79_MACH_TL_WR741ND + + bool "TP-LINK TL-WR741ND support" + + select SOC_AR724X +@@ -1211,21 +1202,25 @@ + +config ATH79_MACH_TL_WR741ND_V4 + + bool "TP-LINK TL-WR741ND v4/TL-MR3220 v2 support" + + select SOC_AR933X +-+ select ATH79_DEV_ETH +-+ select ATH79_DEV_GPIO_BUTTONS +-+ select ATH79_DEV_LEDS_GPIO +-+ select ATH79_DEV_M25P80 +-+ select ATH79_DEV_USB +-+ select ATH79_DEV_WMAC +-+ +-+config ATH79_MACH_TL_WR841N_V1 +-+ bool "TP-LINK TL-WR841N v1 support" +- select SOC_AR71XX +-+ select ATH79_DEV_DSA + select ATH79_DEV_ETH + select ATH79_DEV_GPIO_BUTTONS + select ATH79_DEV_LEDS_GPIO +-- select ATH79_DEV_SPI ++ select ATH79_DEV_M25P80 ++ select ATH79_DEV_USB ++ select ATH79_DEV_WMAC ++- help ++- Say 'Y' here if you want your kernel to support the ++- Atheros AP81 reference board. ++ ++-config ATH79_MACH_DB120 ++- bool "Atheros DB120 reference board" +++config ATH79_MACH_TL_WR841N_V1 +++ bool "TP-LINK TL-WR841N v1 support" +++ select SOC_AR71XX +++ select ATH79_DEV_DSA +++ select ATH79_DEV_ETH +++ select ATH79_DEV_GPIO_BUTTONS +++ select ATH79_DEV_LEDS_GPIO + + select ATH79_DEV_M25P80 + + + +config ATH79_MACH_TL_WR841N_V8 +@@ -1268,15 +1263,21 @@ + + + +config ATH79_MACH_TL_WR1041N_V2 + + bool "TP-LINK TL-WR1041N v2 support" +-+ select SOC_AR934X +-+ select ATH79_DEV_AP9X_PCI if PCI +-+ select ATH79_DEV_ETH +-+ select ATH79_DEV_GPIO_BUTTONS +-+ select ATH79_DEV_LEDS_GPIO +-+ select ATH79_DEV_M25P80 +-+ select ATH79_DEV_USB +-+ select ATH79_DEV_WMAC +-+ ++ select SOC_AR934X ++ select ATH79_DEV_AP9X_PCI if PCI ++ select ATH79_DEV_ETH ++ select ATH79_DEV_GPIO_BUTTONS ++ select ATH79_DEV_LEDS_GPIO ++ select ATH79_DEV_M25P80 ++- select ATH79_DEV_NFC ++ select ATH79_DEV_USB ++ select ATH79_DEV_WMAC ++- help ++- Say 'Y' here if you want your kernel to support the ++- Atheros DB120 reference board. ++ ++-config ATH79_MACH_PB44 ++- bool "Atheros PB44 reference board" + +config ATH79_MACH_TL_WR1043ND + + bool "TP-LINK TL-WR1043ND support" + + select SOC_AR913X +@@ -1319,11 +1320,12 @@ + + + +config ATH79_MACH_TEW_673GRU + + bool "TRENDnet TEW-673GRU support" +-+ select SOC_AR71XX ++ select SOC_AR71XX + + select ATH79_DEV_AP9X_PCI if PCI +-+ select ATH79_DEV_ETH +-+ select ATH79_DEV_GPIO_BUTTONS +-+ select ATH79_DEV_LEDS_GPIO ++ select ATH79_DEV_ETH ++ select ATH79_DEV_GPIO_BUTTONS ++ select ATH79_DEV_LEDS_GPIO ++- select ATH79_DEV_SPI + + select ATH79_DEV_M25P80 + + select ATH79_DEV_USB + + select ATH79_NVRAM +@@ -1361,10 +1363,20 @@ + + config ATH79_MACH_UBNT_XM + bool "Ubiquiti Networks XM/UniFi boards" +-@@ -83,6 +1144,106 @@ config ATH79_MACH_UBNT_XM ++@@ -83,6 +1144,116 @@ config ATH79_MACH_UBNT_XM + Say 'Y' here if you want your kernel to support the + Ubiquiti Networks XM (rev 1.0) board. + +++config ATH79_MACH_UBNT_UNIFIAC +++ bool "Ubiquiti UniFi AC (LITE) support" +++ select SOC_QCA956X +++ select ATH79_DEV_AP9X_PCI if PCI +++ select ATH79_DEV_ETH +++ select ATH79_DEV_GPIO_BUTTONS +++ select ATH79_DEV_LEDS_GPIO +++ select ATH79_DEV_M25P80 +++ select ATH79_DEV_WMAC +++ + +config ATH79_MACH_WEIO + + bool "WeIO board" + + select SOC_AR933X +@@ -1468,7 +1480,7 @@ + endmenu + + config SOC_AR71XX +-@@ -124,7 +1285,10 @@ config ATH79_DEV_DSA ++@@ -124,7 +1295,10 @@ config ATH79_DEV_DSA + config ATH79_DEV_ETH + def_bool n + +@@ -1480,7 +1492,7 @@ + def_bool n + + config ATH79_DEV_GPIO_BUTTONS +-@@ -154,6 +1318,11 @@ config ATH79_PCI_ATH9K_FIXUP ++@@ -154,6 +1328,11 @@ config ATH79_PCI_ATH9K_FIXUP + def_bool n + + config ATH79_ROUTERBOOT +@@ -1494,7 +1506,7 @@ + endif + --- a/arch/mips/ath79/Makefile + +++ b/arch/mips/ath79/Makefile +-@@ -38,9 +38,128 @@ obj-$(CONFIG_ATH79_ROUTERBOOT) += route ++@@ -38,9 +38,129 @@ obj-$(CONFIG_ATH79_ROUTERBOOT) += route + # + # Machines + # +@@ -1596,6 +1608,7 @@ + +obj-$(CONFIG_ATH79_MACH_TL_WR720N_V3) += mach-tl-wr720n-v3.o + +obj-$(CONFIG_ATH79_MACH_TUBE2H) += mach-tube2h.o + +obj-$(CONFIG_ATH79_MACH_UBNT) += mach-ubnt.o +++obj-$(CONFIG_ATH79_MACH_UBNT_UNIFIAC) += mach-ubnt-unifiac.o + obj-$(CONFIG_ATH79_MACH_UBNT_XM) += mach-ubnt-xm.o + +obj-$(CONFIG_ATH79_MACH_WEIO) += mach-weio.o + +obj-$(CONFIG_ATH79_MACH_WHR_HP_G300N) += mach-whr-hp-g300n.o diff --git a/patches/openwrt/0043-ar71xx-Fix-eth0-support-for-Ubiquiti-UniFi-AP-AC.patch b/patches/openwrt/0043-ar71xx-Fix-eth0-support-for-Ubiquiti-UniFi-AP-AC.patch new file mode 100644 index 00000000..bae7f32e --- /dev/null +++ b/patches/openwrt/0043-ar71xx-Fix-eth0-support-for-Ubiquiti-UniFi-AP-AC.patch @@ -0,0 +1,21 @@ +From: Matthias Schiffer +Date: Fri, 13 May 2016 21:02:55 +0200 +Subject: ar71xx: Fix eth0 support for Ubiquiti UniFi AP AC + +Fix eth0 support for the Ubiquiti UniFi AP AC +Signed-off-by: Paul Wassi + +Backport of OpenWrt r49277 + +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-unifiac.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-unifiac.c +index 3617ca7..072cf12 100644 +--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-unifiac.c ++++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-unifiac.c +@@ -84,6 +84,7 @@ static void __init ubnt_unifiac_setup(void) + eeprom + UNIFIAC_MAC0_OFFSET, 0); + + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_SGMII; ++ ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; + ath79_eth0_data.phy_mask = BIT(4); + ath79_eth0_pll_data.pll_10 = 0x00001313; + diff --git a/patches/openwrt/0044-ar71xx-Rename-unifiac-to-unifiac-lite.patch b/patches/openwrt/0044-ar71xx-Rename-unifiac-to-unifiac-lite.patch new file mode 100644 index 00000000..cbd40637 --- /dev/null +++ b/patches/openwrt/0044-ar71xx-Rename-unifiac-to-unifiac-lite.patch @@ -0,0 +1,192 @@ +From: Matthias Schiffer +Date: Fri, 13 May 2016 21:24:44 +0200 +Subject: ar71xx: Rename unifiac to unifiac-lite + +To avoid confusion with different unifiac devices, rename existing target +"unifiac" to "unifiac-lite", before "unifiac-pro" is introduced. + +Signed-off-by: P.Wassi + +Backport of LEDE c855e70491fbd5d432915c4cbeb3b80f3a117e30 + +diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh +index 8c6ac9a..3d711ca 100644 +--- a/target/linux/ar71xx/base-files/etc/diag.sh ++++ b/target/linux/ar71xx/base-files/etc/diag.sh +@@ -297,7 +297,7 @@ get_status_led() { + status_led="ubnt:green:dome" + ;; + uap-pro | \ +- unifiac) ++ unifiac-lite) + status_led="ubnt:white:dome" + ;; + unifi-outdoor-plus) +diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +index e6fcec8..fa8a2c8 100644 +--- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata ++++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +@@ -75,7 +75,7 @@ case "$FIRMWARE" in + ath10kcal_extract "ART" 20480 2116 + ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16) + ;; +- unifiac) ++ unifiac-lite) + ath10kcal_extract "EEPROM" 20480 2116 + ;; + esac +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 e4a1473..0269e6d 100755 +--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network ++++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network +@@ -366,7 +366,7 @@ tl-wa901nd-v3 |\ + tl-wa901nd-v4 |\ + tl-wr703n |\ + tube2h |\ +-unifiac |\ ++unifiac-lite |\ + wndap360 |\ + mynet-rext |\ + wp543) +diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh +index 8670583..d3e6db9 100755 +--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh ++++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh +@@ -881,8 +881,8 @@ ar71xx_board_detect() { + *UniFi) + name="unifi" + ;; +- *"UniFi-AC") +- name="unifiac" ++ *"UniFi-AC-LITE") ++ name="unifiac-lite" + ;; + *"UniFi AP Pro") + name="uap-pro" +diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +index 4c43166..a1b65b7 100755 +--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh ++++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +@@ -251,7 +251,7 @@ platform_check_image() { + wlae-ag300n | \ + nbg460n_550n_550nh | \ + unifi | \ +- unifiac | \ ++ unifiac-lite | \ + unifi-outdoor | \ + carambola2 | \ + weio ) +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-unifiac.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-unifiac.c +index 072cf12..31cbe30 100644 +--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-unifiac.c ++++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-unifiac.c +@@ -73,7 +73,7 @@ static struct gpio_keys_button ubnt_unifiac_gpio_keys[] __initdata = { + } + }; + +-static void __init ubnt_unifiac_setup(void) ++static void __init ubnt_unifiac_lite_setup(void) + { + u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff0000); + +@@ -81,7 +81,7 @@ static void __init ubnt_unifiac_setup(void) + + + ath79_init_mac(ath79_eth0_data.mac_addr, +- eeprom + UNIFIAC_MAC0_OFFSET, 0); ++ eeprom + UNIFIAC_MAC0_OFFSET, 0); + + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_SGMII; + ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; +@@ -99,12 +99,12 @@ static void __init ubnt_unifiac_setup(void) + + + ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_unifiac_leds_gpio), +- ubnt_unifiac_leds_gpio); ++ ubnt_unifiac_leds_gpio); + + ath79_register_gpio_keys_polled(-1, UNIFIAC_KEYS_POLL_INTERVAL, +- ARRAY_SIZE(ubnt_unifiac_gpio_keys), +- ubnt_unifiac_gpio_keys); ++ ARRAY_SIZE(ubnt_unifiac_gpio_keys), ++ ubnt_unifiac_gpio_keys); + } + +-MIPS_MACHINE(ATH79_MACH_UBNT_UNIFIAC, "UBNT-UF-AC", "Ubiquiti UniFi-AC", +- ubnt_unifiac_setup); ++MIPS_MACHINE(ATH79_MACH_UBNT_UNIFIAC_LITE, "UBNT-UF-AC-LITE", "Ubiquiti UniFi-AC-LITE", ++ ubnt_unifiac_lite_setup); +diff --git a/target/linux/ar71xx/generic/profiles/ubnt.mk b/target/linux/ar71xx/generic/profiles/ubnt.mk +index 94eff18..eac0240 100644 +--- a/target/linux/ar71xx/generic/profiles/ubnt.mk ++++ b/target/linux/ar71xx/generic/profiles/ubnt.mk +@@ -38,16 +38,16 @@ endef + + $(eval $(call Profile,UBNTUNIFI)) + +-define Profile/UBNTUNIFIAC +- NAME:=Ubiquiti UniFi AP AC ++define Profile/UBNTUNIFIACLITE ++ NAME:=Ubiquiti UniFi AP AC LITE/LR + PACKAGES:=kmod-ath10k ath10k-firmware-qca988x + endef + +-define Profile/UBNTUNIFIAC/Description +- Package set optimized for the Ubiquiti UniFi AP AC. ++define Profile/UBNTUNIFIACLITE/Description ++ Package set optimized for the Ubiquiti UniFi AP AC LITE/LR. + endef + +-$(eval $(call Profile,UBNTUNIFIAC)) ++$(eval $(call Profile,UBNTUNIFIACLITE)) + + define Profile/UBNTUNIFIOUTDOOR + NAME:=Ubiquiti UniFiAP Outdoor +diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile +index dd59f2d..31aff78 100644 +--- a/target/linux/ar71xx/image/Makefile ++++ b/target/linux/ar71xx/image/Makefile +@@ -741,14 +741,19 @@ endef + TARGET_DEVICES += oolite + + define Device/ubnt-unifiac +- DEVICE_PROFILE := UBNT UBNTUNIFIAC ++ DEVICE_PROFILE := UBNT + IMAGE_SIZE := 7744k + MTDPARTS = spi0.0:384k(u-boot)ro,64k(u-boot-env)ro,7744k(firmware),7744k(ubnt-airos)ro,128k(bs)ro,256k(cfg)ro,64k(EEPROM)ro + IMAGES := sysupgrade.bin + IMAGE/sysupgrade.bin = append-kernel $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) ++endef ++ ++define Device/ubnt-unifiac-lite ++ $(Device/ubnt-unifiac) ++ DEVICE_PROFILE := UBNT UBNTUNIFIACLITE + BOARDNAME := UBNT-UF-AC + endef +-TARGET_DEVICES += ubnt-unifiac ++TARGET_DEVICES += ubnt-unifiac-lite + + rootfs_type=$(patsubst jffs2-%,jffs2,$(patsubst squashfs-%,squashfs,$(1))) + +diff --git a/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch b/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch +index 5a7a72c..0ade403 100644 +--- a/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch ++++ b/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch +@@ -164,7 +164,7 @@ + + ATH79_MACH_UBNT_RS, /* Ubiquiti RouterStation */ + ATH79_MACH_UBNT_UAP_PRO, /* Ubiquiti UniFi AP Pro */ + ATH79_MACH_UBNT_UNIFI, /* Ubiquiti Unifi */ +-+ ATH79_MACH_UBNT_UNIFIAC, /* Ubiquiti Unifi AC */ +++ ATH79_MACH_UBNT_UNIFIAC_LITE, /* Ubiquiti Unifi AC LITE/LR */ + ATH79_MACH_UBNT_UNIFI_OUTDOOR, /* Ubiquiti UnifiAP Outdoor */ + + ATH79_MACH_UBNT_UNIFI_OUTDOOR_PLUS, /* Ubiquiti UnifiAP Outdoor+ */ + ATH79_MACH_UBNT_XM, /* Ubiquiti Networks XM board rev 1.0 */ +@@ -1368,7 +1368,7 @@ + Ubiquiti Networks XM (rev 1.0) board. + + +config ATH79_MACH_UBNT_UNIFIAC +-+ bool "Ubiquiti UniFi AC (LITE) support" +++ bool "Ubiquiti UniFi AC (LITE/LR) support" + + select SOC_QCA956X + + select ATH79_DEV_AP9X_PCI if PCI + + select ATH79_DEV_ETH diff --git a/patches/openwrt/0045-ar71xx-Add-support-for-Ubiquiti-UniFi-AP-AC-PRO.patch b/patches/openwrt/0045-ar71xx-Add-support-for-Ubiquiti-UniFi-AP-AC-PRO.patch new file mode 100644 index 00000000..30cf6d46 --- /dev/null +++ b/patches/openwrt/0045-ar71xx-Add-support-for-Ubiquiti-UniFi-AP-AC-PRO.patch @@ -0,0 +1,274 @@ +From: Matthias Schiffer +Date: Fri, 13 May 2016 21:34:05 +0200 +Subject: ar71xx: Add support for Ubiquiti UniFi AP AC PRO + +Add support for the Ubiquiti UniFi AP AC PRO +Signed-off-by: P.Wassi + +Backport of LEDE 8307c2fe686ded345c80318359d5b6679e581fa2 + +diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh +index 3d711ca..775aac6 100644 +--- a/target/linux/ar71xx/base-files/etc/diag.sh ++++ b/target/linux/ar71xx/base-files/etc/diag.sh +@@ -297,7 +297,8 @@ get_status_led() { + status_led="ubnt:green:dome" + ;; + uap-pro | \ +- unifiac-lite) ++ unifiac-lite | \ ++ unifiac-pro) + status_led="ubnt:white:dome" + ;; + unifi-outdoor-plus) +diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +index fa8a2c8..cde7aaf 100644 +--- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata ++++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +@@ -75,7 +75,8 @@ case "$FIRMWARE" in + ath10kcal_extract "ART" 20480 2116 + ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16) + ;; +- unifiac-lite) ++ unifiac-lite | \ ++ unifiac-pro) + ath10kcal_extract "EEPROM" 20480 2116 + ;; + esac +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 0269e6d..0a23756 100755 +--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network ++++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network +@@ -398,6 +398,13 @@ wpj344) + ucidef_add_switch_vlan "switch0" "2" "0t 2" + ;; + ++unifiac-pro) ++ ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" ++ ucidef_add_switch "switch0" "1" "1" ++ ucidef_add_switch_vlan "switch0" "1" "0t 2" ++ ucidef_add_switch_vlan "switch0" "2" "0t 3" ++ ;; ++ + wpj531) + ucidef_set_interfaces_lan_wan "eth0" "eth1" + ;; +diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh +index d3e6db9..7fc951a 100755 +--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh ++++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh +@@ -884,6 +884,9 @@ ar71xx_board_detect() { + *"UniFi-AC-LITE") + name="unifiac-lite" + ;; ++ *"UniFi-AC-PRO") ++ name="unifiac-pro" ++ ;; + *"UniFi AP Pro") + name="uap-pro" + ;; +diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +index a1b65b7..0e9833d 100755 +--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh ++++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +@@ -252,6 +252,7 @@ platform_check_image() { + nbg460n_550n_550nh | \ + unifi | \ + unifiac-lite | \ ++ unifiac-pro | \ + unifi-outdoor | \ + carambola2 | \ + weio ) +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-unifiac.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-unifiac.c +index 31cbe30..9194bc1 100644 +--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-unifiac.c ++++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-unifiac.c +@@ -21,6 +21,7 @@ + #include + + #include ++#include + + #include "common.h" + #include "dev-ap9x-pci.h" +@@ -29,6 +30,7 @@ + #include "dev-leds-gpio.h" + #include "dev-m25p80.h" + #include "dev-wmac.h" ++#include "dev-usb.h" + #include "machtypes.h" + + +@@ -108,3 +110,70 @@ static void __init ubnt_unifiac_lite_setup(void) + + MIPS_MACHINE(ATH79_MACH_UBNT_UNIFIAC_LITE, "UBNT-UF-AC-LITE", "Ubiquiti UniFi-AC-LITE", + ubnt_unifiac_lite_setup); ++ ++static struct ar8327_pad_cfg ubnt_unifiac_pro_ar8327_pad0_cfg = { ++ .mode = AR8327_PAD_MAC_SGMII, ++ .sgmii_delay_en = true, ++}; ++ ++static struct ar8327_platform_data ubnt_unifiac_pro_ar8327_data = { ++ .pad0_cfg = &ubnt_unifiac_pro_ar8327_pad0_cfg, ++ .port0_cfg = { ++ .force_link = 1, ++ .speed = AR8327_PORT_SPEED_1000, ++ .duplex = 1, ++ .txpause = 1, ++ .rxpause = 1, ++ }, ++}; ++ ++ ++static struct mdio_board_info ubnt_unifiac_pro_mdio0_info[] = { ++ { ++ .bus_id = "ag71xx-mdio.0", ++ .phy_addr = 0, ++ .platform_data = &ubnt_unifiac_pro_ar8327_data, ++ }, ++}; ++ ++static void __init ubnt_unifiac_pro_setup(void) ++{ ++ u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff0000); ++ ++ ath79_register_m25p80(&ubnt_unifiac_flash_data); ++ ++ ++ ath79_init_mac(ath79_eth0_data.mac_addr, ++ eeprom + UNIFIAC_MAC0_OFFSET, 0); ++ ++ ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_SGMII; ++ ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; ++ ath79_eth0_data.phy_mask = BIT(0); ++ ++ mdiobus_register_board_info(ubnt_unifiac_pro_mdio0_info, ++ ARRAY_SIZE(ubnt_unifiac_pro_mdio0_info)); ++ ++ ath79_register_mdio(0, 0x00); ++ ath79_register_eth(0); ++ ++ ++ ath79_register_usb(); ++ ++ ++ ath79_register_wmac(eeprom + UNIFIAC_WMAC_CALDATA_OFFSET, NULL); ++ ++ ++ ap91_pci_init(eeprom + UNIFIAC_PCI_CALDATA_OFFSET, NULL); ++ ++ ++ ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_unifiac_leds_gpio), ++ ubnt_unifiac_leds_gpio); ++ ++ ath79_register_gpio_keys_polled(-1, UNIFIAC_KEYS_POLL_INTERVAL, ++ ARRAY_SIZE(ubnt_unifiac_gpio_keys), ++ ubnt_unifiac_gpio_keys); ++} ++ ++ ++MIPS_MACHINE(ATH79_MACH_UBNT_UNIFIAC_PRO, "UBNT-UF-AC-PRO", "Ubiquiti UniFi-AC-PRO", ++ ubnt_unifiac_pro_setup); +diff --git a/target/linux/ar71xx/generic/profiles/ubnt.mk b/target/linux/ar71xx/generic/profiles/ubnt.mk +index eac0240..69b8398 100644 +--- a/target/linux/ar71xx/generic/profiles/ubnt.mk ++++ b/target/linux/ar71xx/generic/profiles/ubnt.mk +@@ -49,6 +49,17 @@ endef + + $(eval $(call Profile,UBNTUNIFIACLITE)) + ++define Profile/UBNTUNIFIACPRO ++ NAME:=Ubiquiti UniFi AP AC PRO ++ PACKAGES:=kmod-ath10k ath10k-firmware-qca988x kmod-usb-core kmod-usb-ohci kmod-usb2 ++endef ++ ++define Profile/UBNTUNIFIACPRO/Description ++ Package set optimized for the Ubiquiti UniFi AP AC PRO. ++endef ++ ++$(eval $(call Profile,UBNTUNIFIACPRO)) ++ + define Profile/UBNTUNIFIOUTDOOR + NAME:=Ubiquiti UniFiAP Outdoor + PACKAGES:= +diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile +index 31aff78..916d4e2 100644 +--- a/target/linux/ar71xx/image/Makefile ++++ b/target/linux/ar71xx/image/Makefile +@@ -753,7 +753,13 @@ define Device/ubnt-unifiac-lite + DEVICE_PROFILE := UBNT UBNTUNIFIACLITE + BOARDNAME := UBNT-UF-AC + endef +-TARGET_DEVICES += ubnt-unifiac-lite ++ ++define Device/ubnt-unifiac-pro ++ $(Device/ubnt-unifiac) ++ DEVICE_PROFILE := UBNT UBNTUNIFIACPRO ++ BOARDNAME := UBNT-UF-AC-PRO ++endef ++TARGET_DEVICES += ubnt-unifiac-lite ubnt-unifiac-pro + + rootfs_type=$(patsubst jffs2-%,jffs2,$(patsubst squashfs-%,squashfs,$(1))) + +diff --git a/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch b/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch +index 0ade403..dbd3fca 100644 +--- a/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch ++++ b/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch +@@ -1,6 +1,6 @@ + --- a/arch/mips/ath79/machtypes.h + +++ b/arch/mips/ath79/machtypes.h +-@@ -16,22 +16,200 @@ ++@@ -16,22 +16,201 @@ + + enum ath79_mach_type { + ATH79_MACH_GENERIC = 0, +@@ -165,6 +165,7 @@ + ATH79_MACH_UBNT_UAP_PRO, /* Ubiquiti UniFi AP Pro */ + ATH79_MACH_UBNT_UNIFI, /* Ubiquiti Unifi */ + + ATH79_MACH_UBNT_UNIFIAC_LITE, /* Ubiquiti Unifi AC LITE/LR */ +++ ATH79_MACH_UBNT_UNIFIAC_PRO, /* Ubiquiti Unifi AC PRO */ + ATH79_MACH_UBNT_UNIFI_OUTDOOR, /* Ubiquiti UnifiAP Outdoor */ + + ATH79_MACH_UBNT_UNIFI_OUTDOOR_PLUS, /* Ubiquiti UnifiAP Outdoor+ */ + ATH79_MACH_UBNT_XM, /* Ubiquiti Networks XM board rev 1.0 */ +@@ -1363,12 +1364,12 @@ + + config ATH79_MACH_UBNT_XM + bool "Ubiquiti Networks XM/UniFi boards" +-@@ -83,6 +1144,116 @@ config ATH79_MACH_UBNT_XM ++@@ -83,6 +1144,117 @@ config ATH79_MACH_UBNT_XM + Say 'Y' here if you want your kernel to support the + Ubiquiti Networks XM (rev 1.0) board. + + +config ATH79_MACH_UBNT_UNIFIAC +-+ bool "Ubiquiti UniFi AC (LITE/LR) support" +++ bool "Ubiquiti UniFi AC (LITE/LR/PRO) support" + + select SOC_QCA956X + + select ATH79_DEV_AP9X_PCI if PCI + + select ATH79_DEV_ETH +@@ -1376,6 +1377,7 @@ + + select ATH79_DEV_LEDS_GPIO + + select ATH79_DEV_M25P80 + + select ATH79_DEV_WMAC +++ select ATH79_DEV_USB + + + +config ATH79_MACH_WEIO + + bool "WeIO board" +@@ -1480,7 +1482,7 @@ + endmenu + + config SOC_AR71XX +-@@ -124,7 +1295,10 @@ config ATH79_DEV_DSA ++@@ -124,7 +1296,10 @@ config ATH79_DEV_DSA + config ATH79_DEV_ETH + def_bool n + +@@ -1492,7 +1494,7 @@ + def_bool n + + config ATH79_DEV_GPIO_BUTTONS +-@@ -154,6 +1328,11 @@ config ATH79_PCI_ATH9K_FIXUP ++@@ -154,6 +1329,11 @@ config ATH79_PCI_ATH9K_FIXUP + def_bool n + + config ATH79_ROUTERBOOT diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 48e7f422..292f2c0c 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -160,7 +160,7 @@ $(eval $(call GluonModel,ARCHERC7,archer-c5,tp-link-archer-c5-v1)) # BROKEN: ath $(eval $(call GluonModel,ARCHERC7,archer-c7-v2,tp-link-archer-c7-v2)) # BROKEN: ath10k endif -## Ubiquiti (everything) +## Ubiquiti (almost everything) $(eval $(call GluonProfile,UBNT)) $(eval $(call GluonModel,UBNT,ubnt-air-gateway,ubiquiti-airgateway)) $(eval $(call GluonModel,UBNT,ubnt-airrouter,ubiquiti-airrouter)) @@ -190,6 +190,16 @@ ifneq ($(BROKEN),) $(eval $(call GluonModel,UBNT,ubnt-ls-sr71,ubiquiti-ls-sr71)) # BROKEN: Untested endif +# Ubiquiti (ath10k) +ifneq ($(BROKEN),) +$(eval $(call GluonProfile,UBNTUNIFIACLITE,kmod-ath10k ath10k-firmware-qca988x-ct)) +$(eval $(call GluonProfileFactorySuffix,UBNTUNIFIACLITE)) +$(eval $(call GluonModel,UBNTUNIFIACLITE,ubnt-unifiac-lite,ubiquiti-unifi-ac-lite)) # BROKEN: untested, ath10k + +$(eval $(call GluonProfile,UBNTUNIFIACPRO,kmod-ath10k ath10k-firmware-qca988x-ct)) +$(eval $(call GluonProfileFactorySuffix,UBNTUNIFIACPRO)) +$(eval $(call GluonModel,UBNTUNIFIACPRO,ubnt-unifiac-pro,ubiquiti-unifi-ac-pro)) # BROKEN: ath10k +endif ## D-Link From cab23b18381b593a72a6f70b737f7c4f34b75ffa Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 14 May 2016 01:02:25 +0200 Subject: [PATCH 405/867] ar71xx-generic: switch default WAN/LAN assignment on Ubiquiti UAP Pro Fixes #764 --- package/gluon-core/files/lib/gluon/upgrade/020-interfaces | 2 +- .../gluon-setup-mode/files/lib/gluon/upgrade/320-setup-ifname | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/gluon-core/files/lib/gluon/upgrade/020-interfaces b/package/gluon-core/files/lib/gluon/upgrade/020-interfaces index 49831266..34e1c8bb 100755 --- a/package/gluon-core/files/lib/gluon/upgrade/020-interfaces +++ b/package/gluon-core/files/lib/gluon/upgrade/020-interfaces @@ -16,7 +16,7 @@ if not (sysconfig.lan_ifname or sysconfig.wan_ifname) then local lan_ifname = uci:get('network', 'lan', 'ifname') local wan_ifname = uci:get('network', 'wan', 'ifname') - if platform.match('ar71xx', 'generic', {'cpe510', 'nanostation-m', 'nanostation-m-xw', 'unifi-outdoor-plus', 'unifiac-pro'}) then + if platform.match('ar71xx', 'generic', {'cpe510', 'nanostation-m', 'nanostation-m-xw', 'unifi-outdoor-plus', 'uap-pro', 'unifiac-pro'}) then lan_ifname, wan_ifname = wan_ifname, lan_ifname end diff --git a/package/gluon-setup-mode/files/lib/gluon/upgrade/320-setup-ifname b/package/gluon-setup-mode/files/lib/gluon/upgrade/320-setup-ifname index cae60e71..a2b4f796 100755 --- a/package/gluon-setup-mode/files/lib/gluon/upgrade/320-setup-ifname +++ b/package/gluon-setup-mode/files/lib/gluon/upgrade/320-setup-ifname @@ -8,7 +8,7 @@ if sysconfig.setup_ifname then os.exit(0) end -if platform.match('ar71xx', 'generic', {'cpe510', 'nanostation-m', 'nanostation-m-xw', 'unifi-outdoor-plus', 'unifiac-pro'}) then +if platform.match('ar71xx', 'generic', {'cpe510', 'nanostation-m', 'nanostation-m-xw', 'unifi-outdoor-plus', 'uap-pro', 'unifiac-pro'}) then sysconfig.setup_ifname = sysconfig.config_ifname or sysconfig.wan_ifname or sysconfig.lan_ifname else sysconfig.setup_ifname = sysconfig.config_ifname or sysconfig.lan_ifname or sysconfig.wan_ifname From 54bc175cc190daceec89e3d13c87861d1e2681a4 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 16 May 2016 02:17:39 +0200 Subject: [PATCH 406/867] Update Gluon packages --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 2a52cdf1..1336e245 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=087eef9e684fdef066e63c8f64dddfbfd02141a5 +PACKAGES_GLUON_COMMIT=63376e23c81e53c21d3c5250c3fb7444a90dc019 PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_COMMIT=2a8338559de5c4b077cde7a83f43f4700a17d5cc From d30a6ff1dbf8c18a5b73c47286c0a5438566111d Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Mon, 16 May 2016 13:17:29 +0200 Subject: [PATCH 407/867] gluon-luci-admin: Fix uploaded image validation The image validation currently fails on some devices (tested OpenMesh) because it isn't done via sysupgrade. But the checks depend partially on the integration in sysupgrade (e.g. via loops that can be stopped via "break statements"). Instead of hacking its own version check, it is easier and better tested to just use 'sysupgrade -T' like it is already done by LuCI. Signed-off-by: Sven Eckelmann --- .../files/usr/lib/lua/luci/controller/admin/upgrade.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/package/gluon-luci-admin/files/usr/lib/lua/luci/controller/admin/upgrade.lua b/package/gluon-luci-admin/files/usr/lib/lua/luci/controller/admin/upgrade.lua index 29aecb95..2365f02c 100644 --- a/package/gluon-luci-admin/files/usr/lib/lua/luci/controller/admin/upgrade.lua +++ b/package/gluon-luci-admin/files/usr/lib/lua/luci/controller/admin/upgrade.lua @@ -101,9 +101,7 @@ end function image_supported(tmpfile) -- XXX: yay... return ( 0 == os.execute( - ". /lib/functions.sh; " .. - "include /lib/upgrade; " .. - "platform_check_image %q >/dev/null" + "/sbin/sysupgrade -T %q >/dev/null" % tmpfile ) ) end From a5c8e60172f90f4d03643a49a2faa2109e0cdfda Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Sat, 14 May 2016 21:59:23 +0200 Subject: [PATCH 408/867] ar71xx-generic: Add support for OpenMesh devices Integrate OpenMesh devices available in OpenWrt Chaos Calmer: - MR600 - MR600v2 - MR900 - MR900v2 - OM2P - OM2P-HS - OM2P-HSv2 - OM2P-LC - OM2Pv2 - OM5P - OM5P-AN Signed-off-by: Sven Eckelmann --- docs/index.rst | 10 ++++++++++ targets/ar71xx-generic/profiles.mk | 29 +++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/docs/index.rst b/docs/index.rst index ff692844..3e99ef6a 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -130,6 +130,16 @@ ar71xx-generic - Omega +* OpenMesh + + - MR600 (v1, v2) + - MR900 (v1, v2) + - OM2P (v1, v2) + - OM2P-HS (v1, v2) + - OM2P-LC + - OM5P + - OM5P-AN + * TP-Link - CPE210 (v1.0, v1.1) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 292f2c0c..1b04068c 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -295,6 +295,35 @@ $(eval $(call GluonModel,MYNETN750,mynet-n750,wd-my-net-n750)) $(eval $(call GluonProfile,OMEGA)) $(eval $(call GluonModel,OMEGA,onion-omega,onion-omega)) +## OpenMesh + +# MR600 +$(eval $(call GluonProfile,MR600,om-watchdog uboot-envtools)) +$(eval $(call GluonProfileSysupgradeSuffix,MR600,-squashfs-factory,.bin)) +$(eval $(call GluonModel,MR600,mr600,openmesh-mr600)) +$(eval $(call GluonModelAlias,MR600,openmesh-mr600,openmesh-mr600-v2)) + +# MR900 +$(eval $(call GluonProfile,MR900,om-watchdog uboot-envtools)) +$(eval $(call GluonProfileSysupgradeSuffix,MR900,-squashfs-factory,.bin)) +$(eval $(call GluonModel,MR900,mr900,openmesh-mr900)) +$(eval $(call GluonModelAlias,MR900,openmesh-mr900,openmesh-mr900-v2)) + +# OM2P +$(eval $(call GluonProfile,OM2P,om-watchdog uboot-envtools)) +$(eval $(call GluonProfileSysupgradeSuffix,OM2P,-squashfs-factory,.bin)) +$(eval $(call GluonModel,OM2P,om2p,openmesh-om2p)) +$(eval $(call GluonModelAlias,OM2P,openmesh-om2p,openmesh-om2p-v2)) +$(eval $(call GluonModelAlias,OM2P,openmesh-om2p,openmesh-om2p-hs)) +$(eval $(call GluonModelAlias,OM2P,openmesh-om2p,openmesh-om2p-hs-v2)) +$(eval $(call GluonModelAlias,OM2P,openmesh-om2p,openmesh-om2p-lc)) + +# OM5P +$(eval $(call GluonProfile,OM5P,om-watchdog uboot-envtools)) +$(eval $(call GluonProfileSysupgradeSuffix,OM5P,-squashfs-factory,.bin)) +$(eval $(call GluonModel,OM5P,om5p,openmesh-om5p)) +$(eval $(call GluonModelAlias,OM5P,openmesh-om5p,openmesh-om5p-an)) + ## ALFA # Hornet-UB From 4a60e5a02a2438a5f22d4110585bb673d15c08d6 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 18 May 2016 01:24:11 +0200 Subject: [PATCH 409/867] gluon-mesh-vpn-fastd: add missing iptables dependency confusing Kconfig This was causing "recursive dependency" errors and potentially broken configurations. --- package/gluon-mesh-vpn-fastd/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/gluon-mesh-vpn-fastd/Makefile b/package/gluon-mesh-vpn-fastd/Makefile index 0875e485..bb33257e 100644 --- a/package/gluon-mesh-vpn-fastd/Makefile +++ b/package/gluon-mesh-vpn-fastd/Makefile @@ -12,7 +12,7 @@ define Package/gluon-mesh-vpn-fastd SECTION:=gluon CATEGORY:=Gluon TITLE:=Support for connecting batman-adv meshes via fastd - DEPENDS:=+gluon-core +libgluonutil gluon-mesh-batman-adv +gluon-wan-dnsmasq +fastd +iptables-mod-extra +simple-tc + DEPENDS:=+gluon-core +libgluonutil gluon-mesh-batman-adv +gluon-wan-dnsmasq +fastd +iptables +iptables-mod-extra +simple-tc endef define Build/Prepare From 97879e80adfa0df18c59908333c2d3ddca69e7dc Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 19 May 2016 15:31:47 +0200 Subject: [PATCH 410/867] gluon-config-mode-core: clean up reboot handling Don't fork reboot process before all package hooks have been handled and rendering is complete. Replace debug.setfenv hack to close stdout with nixio.dup. Fixes #772 --- .../controller/gluon-config-mode/index.lua | 51 +++++++++---------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/package/gluon-config-mode-core/files/usr/lib/lua/luci/controller/gluon-config-mode/index.lua b/package/gluon-config-mode-core/files/usr/lib/lua/luci/controller/gluon-config-mode/index.lua index 39ba00a9..68c14746 100644 --- a/package/gluon-config-mode-core/files/usr/lib/lua/luci/controller/gluon-config-mode/index.lua +++ b/package/gluon-config-mode-core/files/usr/lib/lua/luci/controller/gluon-config-mode/index.lua @@ -48,43 +48,42 @@ function action_reboot() uci:save("gluon-setup-mode") uci:commit("gluon-setup-mode") - if nixio.fork() ~= 0 then - local fs = require "nixio.fs" - local util = require "nixio.util" + local fs = require "nixio.fs" + local util = require "nixio.util" - local parts_dir = "/lib/gluon/config-mode/reboot/" - local files = util.consume(fs.dir(parts_dir)) + local parts_dir = "/lib/gluon/config-mode/reboot/" + local files = util.consume(fs.dir(parts_dir)) - table.sort(files) + table.sort(files) - local parts = {} + local parts = {} - for _, entry in ipairs(files) do - if entry:sub(1, 1) ~= '.' then - local f = dofile(parts_dir .. '/' .. entry) - if f ~= nil then - table.insert(parts, f) - end + for _, entry in ipairs(files) do + if entry:sub(1, 1) ~= '.' then + local f = dofile(parts_dir .. '/' .. entry) + if f ~= nil then + table.insert(parts, f) end end + end - local hostname = uci:get_first("system", "system", "hostname") + local hostname = uci:get_first("system", "system", "hostname") - luci.template.render("gluon/config-mode/reboot", { parts=parts - , hostname=hostname - }) - else - debug.setfenv(io.stdout, debug.getfenv(io.open '/dev/null')) - io.stdout:close() + luci.template.render("gluon/config-mode/reboot", + { + parts = parts, + hostname = hostname, + } + ) + + if nixio.fork() == 0 then + -- Replace stdout with /dev/null + nixio.dup(nixio.open('/dev/null', 'w'), nixio.stdout) -- Sleep a little so the browser can fetch everything required to -- display the reboot page, then reboot the device. - nixio.nanosleep(2) + nixio.nanosleep(1) - -- Run reboot with popen so it gets its own std filehandles. - io.popen("reboot") - - -- Prevent any further execution in this child. - os.exit() + nixio.execp("reboot") end end From 62feb04fe12706ffc62933463ed917a19329687b Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Thu, 19 May 2016 20:59:34 +0200 Subject: [PATCH 411/867] ar71xx-generic: Generate OpenMesh sysupgrades in OpenWrt The workaround to generate sysupgrade images for OpenMesh devices in gluon is replaced in LEDE/OpenWrt by a special patch. It is therefore better to drop the workaround and use the upstream version. Reported-by: Matthias Schiffer Signed-off-by: Sven Eckelmann --- ...sysupgrade-images-for-OpenMesh-devic.patch | 30 +++++++++++++++++++ targets/ar71xx-generic/profiles.mk | 4 --- 2 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 patches/openwrt/0046-ar71xx-Generate-sysupgrade-images-for-OpenMesh-devic.patch diff --git a/patches/openwrt/0046-ar71xx-Generate-sysupgrade-images-for-OpenMesh-devic.patch b/patches/openwrt/0046-ar71xx-Generate-sysupgrade-images-for-OpenMesh-devic.patch new file mode 100644 index 00000000..6470646d --- /dev/null +++ b/patches/openwrt/0046-ar71xx-Generate-sysupgrade-images-for-OpenMesh-devic.patch @@ -0,0 +1,30 @@ +From: Sven Eckelmann +Date: Tue, 17 May 2016 16:38:29 +0200 +Subject: ar71xx: Generate sysupgrade images for OpenMesh devices + +Some OpenWrt based firmwares like Gluon expect that a sysupgrade image +exists when a device firmware can be updated via sysupgrade. This image +wasn't created until now because OpenMesh devices use the same image for +factory and sysupgrade flash. Copying the image from *factory.bin to +*sysupgrade.bin is therefore enough to make the sysupgrade functionality +visible. + +Reported-by: Matthias Schiffer +Signed-off-by: Sven Eckelmann + +Forwarded: https://patchwork.ozlabs.org/patch/624172/ + +diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile +index 916d4e2..f91e20e 100644 +--- a/target/linux/ar71xx/image/Makefile ++++ b/target/linux/ar71xx/image/Makefile +@@ -1877,6 +1877,9 @@ define Image/Build/OpenMesh + "$(BUILD_DIR)/fwupgrade.cfg-$(4)" "fwupgrade.cfg" \ + "$(KDIR_TMP)/vmlinux-$(2).uImage" "kernel" \ + "$(KDIR)/root.$(1)" "rootfs" ++ if [ -e "$(call factoryname,$(1),$(2))" ]; then \ ++ cp "$(call factoryname,$(1),$(2))" "$(call sysupname,$(1),$(2))"; \ ++ fi + endef + + diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 1b04068c..f5a57da7 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -299,19 +299,16 @@ $(eval $(call GluonModel,OMEGA,onion-omega,onion-omega)) # MR600 $(eval $(call GluonProfile,MR600,om-watchdog uboot-envtools)) -$(eval $(call GluonProfileSysupgradeSuffix,MR600,-squashfs-factory,.bin)) $(eval $(call GluonModel,MR600,mr600,openmesh-mr600)) $(eval $(call GluonModelAlias,MR600,openmesh-mr600,openmesh-mr600-v2)) # MR900 $(eval $(call GluonProfile,MR900,om-watchdog uboot-envtools)) -$(eval $(call GluonProfileSysupgradeSuffix,MR900,-squashfs-factory,.bin)) $(eval $(call GluonModel,MR900,mr900,openmesh-mr900)) $(eval $(call GluonModelAlias,MR900,openmesh-mr900,openmesh-mr900-v2)) # OM2P $(eval $(call GluonProfile,OM2P,om-watchdog uboot-envtools)) -$(eval $(call GluonProfileSysupgradeSuffix,OM2P,-squashfs-factory,.bin)) $(eval $(call GluonModel,OM2P,om2p,openmesh-om2p)) $(eval $(call GluonModelAlias,OM2P,openmesh-om2p,openmesh-om2p-v2)) $(eval $(call GluonModelAlias,OM2P,openmesh-om2p,openmesh-om2p-hs)) @@ -320,7 +317,6 @@ $(eval $(call GluonModelAlias,OM2P,openmesh-om2p,openmesh-om2p-lc)) # OM5P $(eval $(call GluonProfile,OM5P,om-watchdog uboot-envtools)) -$(eval $(call GluonProfileSysupgradeSuffix,OM5P,-squashfs-factory,.bin)) $(eval $(call GluonModel,OM5P,om5p,openmesh-om5p)) $(eval $(call GluonModelAlias,OM5P,openmesh-om5p,openmesh-om5p-an)) From 8e891b2cc4b0e21e886f1d8c5994e1091d0b8353 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20L=C3=BCssing?= Date: Tue, 8 Mar 2016 08:10:19 +0100 Subject: [PATCH 412/867] ebtables-filter-mcast: Remove redundant allow-filter for hop-by-hop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ebtables actually skips any IPv6 extension headers like the hop-by-hop one. So this rule is actually void. The intend back then was to allow passing MLD messages into the mesh. Since extension headers are skipped, the general icmpv6 rule will actually match MLD messages. So the hop-by-hop rule is unnecessary, too. Signed-off-by: Linus Lüssing --- .../files/lib/gluon/ebtables/110-mcast-allow-icmpv6 | 2 -- 1 file changed, 2 deletions(-) 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 8d3b7ec2..cb358157 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,5 +1,3 @@ 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 4199b216c6fef21788c0bba7a59ff2a98da9f4cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20L=C3=BCssing?= Date: Tue, 8 Mar 2016 08:10:20 +0100 Subject: [PATCH 413/867] ebtables-segment-mld: Segment IGMP/MLD domain MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch adds a new gluon-ebtables package to filter IGMP/MLD messages via ebtables. For one thing this reduces multicast overhead: About one third of all ICMPv6 multicast traffic in Lübeck or Hamburg is MLD. Furthermore it removes a potential Distributed Denial-of-Service vector (see Gluon ticket #553). Finally, it is a prerequisite for enabling bridge multicast snooping in a decentral and robust fashion. Note that IGMP/MLD are filtered for multicast traffic coming from the mesh, too (new MULTICAST_IN), as unfortunately there seem to be other queriers somewhere in the mesh at least for Freifunk Lübeck. Also adding these rules to be prepared to anyone intentionally or unintentionally disabling these filters on his/her node. Node operators not running Gluon (for instance gateway nodes) should make sure to either enable multicast_router towards bat0 or disable multicast snooping entirely if they have a bridge on top of bat0. Signed-off-by: Linus Lüssing --- docs/package/gluon-ebtables-segment-mld.rst | 16 ++++++ .../files/lib/gluon/ebtables/100-mcast-chain | 1 - .../lib/gluon/ebtables/110-mcast-allow-icmpv6 | 6 +-- .../files/lib/gluon/ebtables/300-mcast | 2 - .../files/lib/gluon/ebtables/355-mcast-drop | 1 + package/gluon-ebtables-segment-mld/Makefile | 51 +++++++++++++++++++ .../lib/gluon/ebtables/100-mcast-in-chain | 2 + .../lib/gluon/ebtables/101-mcast-in-rule | 2 + .../lib/gluon/ebtables/105-mcast-drop-igmp | 2 + .../lib/gluon/ebtables/105-mcast-drop-mld | 9 ++++ .../files/etc/init.d/gluon-ebtables | 15 +++--- .../files/lib/gluon/ebtables/100-dir-chain | 3 ++ .../lib/gluon/ebtables/350-mcast-dir-rules | 4 ++ 13 files changed, 102 insertions(+), 12 deletions(-) create mode 100644 docs/package/gluon-ebtables-segment-mld.rst delete mode 100644 package/gluon-ebtables-filter-multicast/files/lib/gluon/ebtables/100-mcast-chain delete mode 100644 package/gluon-ebtables-filter-multicast/files/lib/gluon/ebtables/300-mcast create mode 100644 package/gluon-ebtables-filter-multicast/files/lib/gluon/ebtables/355-mcast-drop create mode 100644 package/gluon-ebtables-segment-mld/Makefile create mode 100644 package/gluon-ebtables-segment-mld/files/lib/gluon/ebtables/100-mcast-in-chain create mode 100644 package/gluon-ebtables-segment-mld/files/lib/gluon/ebtables/101-mcast-in-rule create mode 100644 package/gluon-ebtables-segment-mld/files/lib/gluon/ebtables/105-mcast-drop-igmp create mode 100644 package/gluon-ebtables-segment-mld/files/lib/gluon/ebtables/105-mcast-drop-mld create mode 100644 package/gluon-ebtables/files/lib/gluon/ebtables/350-mcast-dir-rules diff --git a/docs/package/gluon-ebtables-segment-mld.rst b/docs/package/gluon-ebtables-segment-mld.rst new file mode 100644 index 00000000..7e197ece --- /dev/null +++ b/docs/package/gluon-ebtables-segment-mld.rst @@ -0,0 +1,16 @@ +gluon-ebtables-segment-mld +========================== + +These filters drop IGMP/MLD packets before they enter the mesh and +filter any IGMP/MLD packets coming from the mesh. + +IGMP/MLD have the concept of a local, elected Querier. For more +decentralization and increased robustness, the idea of this package is +to split the IGMP/MLD domain a querier is responsible for, allowing to +have a querier per node. The split IGMP/MLD domain will also reduce +overhead for this packet type, increasing scalability. + +Beware of the consequences of using this package though: You might need +to explicitly, manually mark ports on snooping switches leading towards +your mesh node as multicast router ports for now (Multicast Router +Discovery, MRD, not implemented yet). diff --git a/package/gluon-ebtables-filter-multicast/files/lib/gluon/ebtables/100-mcast-chain b/package/gluon-ebtables-filter-multicast/files/lib/gluon/ebtables/100-mcast-chain deleted file mode 100644 index ec0013a3..00000000 --- a/package/gluon-ebtables-filter-multicast/files/lib/gluon/ebtables/100-mcast-chain +++ /dev/null @@ -1 +0,0 @@ -chain('MULTICAST_OUT', 'DROP') 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 cb358157..0058ed86 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,3 +1,3 @@ -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_ICMPV6 -p IPv6 --ip6-protocol ipv6-icmp --ip6-icmp-type echo-request -j RETURN' +rule 'MULTICAST_OUT_ICMPV6 -p IPv6 --ip6-protocol ipv6-icmp --ip6-icmp-type 139 -j RETURN' -- ICMP Node Information Query +rule 'MULTICAST_OUT_ICMPV6 -j ACCEPT' diff --git a/package/gluon-ebtables-filter-multicast/files/lib/gluon/ebtables/300-mcast b/package/gluon-ebtables-filter-multicast/files/lib/gluon/ebtables/300-mcast deleted file mode 100644 index c52f122f..00000000 --- a/package/gluon-ebtables-filter-multicast/files/lib/gluon/ebtables/300-mcast +++ /dev/null @@ -1,2 +0,0 @@ -rule 'FORWARD --logical-out br-client -o bat0 -d Multicast -j MULTICAST_OUT' -rule 'OUTPUT --logical-out br-client -o bat0 -d Multicast -j MULTICAST_OUT' diff --git a/package/gluon-ebtables-filter-multicast/files/lib/gluon/ebtables/355-mcast-drop b/package/gluon-ebtables-filter-multicast/files/lib/gluon/ebtables/355-mcast-drop new file mode 100644 index 00000000..46ac01a5 --- /dev/null +++ b/package/gluon-ebtables-filter-multicast/files/lib/gluon/ebtables/355-mcast-drop @@ -0,0 +1 @@ +rule ('MULTICAST_OUT -j DROP') diff --git a/package/gluon-ebtables-segment-mld/Makefile b/package/gluon-ebtables-segment-mld/Makefile new file mode 100644 index 00000000..e3aacde1 --- /dev/null +++ b/package/gluon-ebtables-segment-mld/Makefile @@ -0,0 +1,51 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=gluon-ebtables-segment-mld +PKG_VERSION:=1 +PKG_RELEASE:=1 + +PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/gluon-ebtables-segment-mld + SECTION:=gluon + CATEGORY:=Gluon + TITLE:=Ebtables filters for IGMP/MLD packets + DEPENDS:=+gluon-core +gluon-ebtables +endef + +define Package/gluon-ebtables-segment-mld/description + Gluon community wifi mesh firmware framework: Ebtables filters for + IGMP/MLD packets + + These filters drop IGMP/MLD packets before they enter the mesh and + filter any IGMP/MLD packets coming from the mesh. + + IGMP/MLD have the concept of a local, elected Querier. For more + decentralization and increased robustness, the idea of this package is + to split the IGMP/MLD domain a querier is responsible for, allowing to + have a querier per node. The split IGMP/MLD domain will also reduce + overhead for this packet type, increasing scalability. + + Beware of the consequences of using this package though: You might need + to explicitly, manually mark ports on snooping switches leading towards + your mesh node as multicast router ports for now (Multicast Router + Discovery, MRD, not implemented yet). +endef + +define Build/Prepare + mkdir -p $(PKG_BUILD_DIR) +endef + +define Build/Configure +endef + +define Build/Compile +endef + +define Package/gluon-ebtables-segment-mld/install + $(CP) ./files/* $(1)/ +endef + +$(eval $(call BuildPackage,gluon-ebtables-segment-mld)) diff --git a/package/gluon-ebtables-segment-mld/files/lib/gluon/ebtables/100-mcast-in-chain b/package/gluon-ebtables-segment-mld/files/lib/gluon/ebtables/100-mcast-in-chain new file mode 100644 index 00000000..69d6bf18 --- /dev/null +++ b/package/gluon-ebtables-segment-mld/files/lib/gluon/ebtables/100-mcast-in-chain @@ -0,0 +1,2 @@ +chain('MULTICAST_IN', 'RETURN', 'nat') +chain('MULTICAST_IN_ICMPV6', 'RETURN', 'nat') diff --git a/package/gluon-ebtables-segment-mld/files/lib/gluon/ebtables/101-mcast-in-rule b/package/gluon-ebtables-segment-mld/files/lib/gluon/ebtables/101-mcast-in-rule new file mode 100644 index 00000000..4eef2e7e --- /dev/null +++ b/package/gluon-ebtables-segment-mld/files/lib/gluon/ebtables/101-mcast-in-rule @@ -0,0 +1,2 @@ +rule ('PREROUTING -d Multicast --logical-in br-client -i bat0 -j MULTICAST_IN', 'nat') +rule ('MULTICAST_IN -p IPv6 --ip6-protocol ipv6-icmp -j MULTICAST_IN_ICMPV6', 'nat') diff --git a/package/gluon-ebtables-segment-mld/files/lib/gluon/ebtables/105-mcast-drop-igmp b/package/gluon-ebtables-segment-mld/files/lib/gluon/ebtables/105-mcast-drop-igmp new file mode 100644 index 00000000..08052721 --- /dev/null +++ b/package/gluon-ebtables-segment-mld/files/lib/gluon/ebtables/105-mcast-drop-igmp @@ -0,0 +1,2 @@ +rule('MULTICAST_OUT -p IPv4 --ip-protocol igmp -j DROP') +rule('MULTICAST_IN -p IPv4 --ip-protocol igmp -j DROP', 'nat') diff --git a/package/gluon-ebtables-segment-mld/files/lib/gluon/ebtables/105-mcast-drop-mld b/package/gluon-ebtables-segment-mld/files/lib/gluon/ebtables/105-mcast-drop-mld new file mode 100644 index 00000000..b6090c22 --- /dev/null +++ b/package/gluon-ebtables-segment-mld/files/lib/gluon/ebtables/105-mcast-drop-mld @@ -0,0 +1,9 @@ +rule('MULTICAST_OUT_ICMPV6 -p IPv6 --ip6-protocol ipv6-icmp --ip6-icmp-type 130 -j DROP') -- MLD Query +rule('MULTICAST_OUT_ICMPV6 -p IPv6 --ip6-protocol ipv6-icmp --ip6-icmp-type 131 -j DROP') -- MLDv1 Report +rule('MULTICAST_OUT_ICMPV6 -p IPv6 --ip6-protocol ipv6-icmp --ip6-icmp-type 132 -j DROP') -- MLDv1 Done +rule('MULTICAST_OUT_ICMPV6 -p IPv6 --ip6-protocol ipv6-icmp --ip6-icmp-type 143 -j DROP') -- MLDv2 Report + +rule('MULTICAST_IN_ICMPV6 -p IPv6 --ip6-protocol ipv6-icmp --ip6-icmp-type 130 -j DROP', 'nat') -- MLD Query +rule('MULTICAST_IN_ICMPV6 -p IPv6 --ip6-protocol ipv6-icmp --ip6-icmp-type 131 -j DROP', 'nat') -- MLDv1 Report +rule('MULTICAST_IN_ICMPV6 -p IPv6 --ip6-protocol ipv6-icmp --ip6-icmp-type 132 -j DROP', 'nat') -- MLDv1 Done +rule('MULTICAST_IN_ICMPV6 -p IPv6 --ip6-protocol ipv6-icmp --ip6-icmp-type 143 -j DROP', 'nat') -- MLDv2 Report diff --git a/package/gluon-ebtables/files/etc/init.d/gluon-ebtables b/package/gluon-ebtables/files/etc/init.d/gluon-ebtables index 5a770452..e6bffe96 100755 --- a/package/gluon-ebtables/files/etc/init.d/gluon-ebtables +++ b/package/gluon-ebtables/files/etc/init.d/gluon-ebtables @@ -24,12 +24,15 @@ exec_file() { local file="$1" /usr/bin/lua -e " - function rule(command) + function rule(command, table) + table = table or 'filter' os.execute($EBTABLES_RULE) end - function chain(name, policy) + function chain(name, policy, table) + table = table or 'filter' os.execute($EBTABLES_CHAIN) end + " "$file" } @@ -48,8 +51,8 @@ exec_all() { start() { ( - export EBTABLES_RULE='"ebtables -A " .. command' - export EBTABLES_CHAIN='"ebtables -N " .. name .. " -P " .. policy' + export EBTABLES_RULE='"ebtables -t " .. table .. " -A " .. command' + export EBTABLES_CHAIN='"ebtables -t " .. table .. " -N " .. name .. " -P " .. policy' if [ -z "$1" ]; then exec_all '' @@ -61,8 +64,8 @@ start() { stop() { ( - export EBTABLES_RULE='"ebtables -D " .. command' - export EBTABLES_CHAIN='"ebtables -X " .. name' + export EBTABLES_RULE='"ebtables -t " .. table .. " -D " .. command' + export EBTABLES_CHAIN='"ebtables -t " .. table .. " -X " .. name' if [ -z "$1" ]; then exec_all '-r' diff --git a/package/gluon-ebtables/files/lib/gluon/ebtables/100-dir-chain b/package/gluon-ebtables/files/lib/gluon/ebtables/100-dir-chain index 31c19c53..e6bf98e3 100644 --- a/package/gluon-ebtables/files/lib/gluon/ebtables/100-dir-chain +++ b/package/gluon-ebtables/files/lib/gluon/ebtables/100-dir-chain @@ -1,2 +1,5 @@ chain('IN_ONLY', 'RETURN') chain('OUT_ONLY', 'RETURN') + +chain('MULTICAST_OUT', 'RETURN') +chain('MULTICAST_OUT_ICMPV6', 'RETURN') diff --git a/package/gluon-ebtables/files/lib/gluon/ebtables/350-mcast-dir-rules b/package/gluon-ebtables/files/lib/gluon/ebtables/350-mcast-dir-rules new file mode 100644 index 00000000..01609068 --- /dev/null +++ b/package/gluon-ebtables/files/lib/gluon/ebtables/350-mcast-dir-rules @@ -0,0 +1,4 @@ +rule 'OUTPUT -d Multicast --logical-out br-client -o bat0 -j MULTICAST_OUT' +rule 'FORWARD -d Multicast --logical-out br-client -o bat0 -j MULTICAST_OUT' + +rule 'MULTICAST_OUT -p IPv6 --ip6-protocol ipv6-icmp -j MULTICAST_OUT_ICMPV6' From 38f70cfd813e3fc627b053cd1c65488845ded756 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 22 May 2016 19:06:01 +0200 Subject: [PATCH 414/867] docs: typo repositoy -> repository (#779) --- docs/user/getting_started.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user/getting_started.rst b/docs/user/getting_started.rst index 6c614d70..abb8f8ba 100644 --- a/docs/user/getting_started.rst +++ b/docs/user/getting_started.rst @@ -130,7 +130,7 @@ not support IPv6. This is not true for kernel modules; the Gluon kernel is incompatible with the kernel of the default OpenWrt images. Therefore, Gluon will not only generate images, -but also an opkg repositoy containing all kernel modules provided by OpenWrt/Gluon +but also an opkg repository containing all kernel modules provided by OpenWrt/Gluon for the kernel of the generated images. Signing keys From 69ce1234576395e3aca0e0ce5854d32ed6d12662 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Thu, 19 May 2016 21:09:10 +0200 Subject: [PATCH 415/867] ar71xx-generic: Add support for OpenMesh MR1750/OM5P-AC The new ath9k/ath10k based devices are only available in OpenWrt trunk. The relevant patches have to backported to add support for them in Gluon Signed-off-by: Sven Eckelmann --- docs/index.rst | 2 + ...l-support-for-the-OpenMesh-MR1750-bo.patch | 202 ++++++++++++ ...space-support-for-the-OpenMesh-MR175.patch | 67 ++++ ...radecfg-gen.sh-add-support-for-the-M.patch | 32 ++ ...e-sysupgrade-for-the-OpenMesh-MR1750.patch | 55 ++++ ...watchdog-add-OpenMesh-MR1750-support.patch | 23 ++ ...envtools-add-OpenMesh-MR1750-support.patch | 22 ++ ...ofile-and-build-image-for-the-OpenMe.patch | 57 ++++ ...e-list-of-bits-in-QCA955X_GMAC_REG_E.patch | 47 +++ ...cfg-helper-for-Open-Mesh-MR900-board.patch | 49 +++ ...use-ath79_gpio_output_select-on-QCA9.patch | 79 +++++ ...rt-for-ath79_gpio_function_-on-QCA95.patch | 32 ++ ...5X-GPIO-mux-and-function-definitions.patch | 159 ++++++++++ ...x-Use-PHY-fixups-for-Open-Mesh-MR900.patch | 78 +++++ ...-Use-PHY-fixups-for-Open-Mesh-MR1750.patch | 77 +++++ ...te-version-of-ath79_setup_qca955x_et.patch | 58 ++++ ...te-version-of-ath79_setup_qca955x_et.patch | 58 ++++ ...radecfg-gen.sh-Fix-u-boot-image-md5s.patch | 43 +++ ...radecfg-gen.sh-Generate-sha256sum-fo.patch | 50 +++ ...l-support-for-the-OpenMesh-OM5P-AC-b.patch | 265 ++++++++++++++++ ...space-support-for-the-OpenMesh-OM5P-.patch | 54 ++++ ...radecfg-gen.sh-add-support-for-the-O.patch | 32 ++ ...-sysupgrade-for-the-OpenMesh-OM5P-AC.patch | 59 ++++ ...atchdog-add-OpenMesh-OM5P-AC-support.patch | 24 ++ ...nvtools-add-OpenMesh-OM5P-AC-support.patch | 22 ++ ...th10k-wifi-board.bin-for-the-OpenMes.patch | 25 ++ ...ofile-and-build-image-for-the-OpenMe.patch | 53 ++++ ...l-support-for-the-OpenMesh-OM5P-ACv2.patch | 289 ++++++++++++++++++ ...space-support-for-the-OpenMesh-OM5P-.patch | 38 +++ ...ysupgrade-for-the-OpenMesh-OM5P-ACv2.patch | 46 +++ ...chdog-add-OpenMesh-OM5P-ACv2-support.patch | 23 ++ ...tools-add-OpenMesh-OM5P-ACv2-support.patch | 22 ++ ...th10k-wifi-board.bin-for-the-OpenMes.patch | 24 ++ ...add-OM5P-ACv2-to-the-OM5P-AC-profile.patch | 29 ++ targets/ar71xx-generic/profiles.mk | 9 + 35 files changed, 2204 insertions(+) create mode 100644 patches/openwrt/0047-ar71xx-add-kernel-support-for-the-OpenMesh-MR1750-bo.patch create mode 100644 patches/openwrt/0048-ar71xx-add-user-space-support-for-the-OpenMesh-MR175.patch create mode 100644 patches/openwrt/0049-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-M.patch create mode 100644 patches/openwrt/0050-ar71xx-enable-sysupgrade-for-the-OpenMesh-MR1750.patch create mode 100644 patches/openwrt/0051-package-om-watchdog-add-OpenMesh-MR1750-support.patch create mode 100644 patches/openwrt/0052-package-uboot-envtools-add-OpenMesh-MR1750-support.patch create mode 100644 patches/openwrt/0053-ar71xx-create-profile-and-build-image-for-the-OpenMe.patch create mode 100644 patches/openwrt/0054-ar71xx-Extend-the-list-of-bits-in-QCA955X_GMAC_REG_E.patch create mode 100644 patches/openwrt/0055-ar71xx-Use-_eth_cfg-helper-for-Open-Mesh-MR900-board.patch create mode 100644 patches/openwrt/0056-ar71xx-Allow-to-use-ath79_gpio_output_select-on-QCA9.patch create mode 100644 patches/openwrt/0057-ar71xx-Add-support-for-ath79_gpio_function_-on-QCA95.patch create mode 100644 patches/openwrt/0058-ar71xx-Add-QCA955X-GPIO-mux-and-function-definitions.patch create mode 100644 patches/openwrt/0059-ar71xx-Use-PHY-fixups-for-Open-Mesh-MR900.patch create mode 100644 patches/openwrt/0060-ar71xx-Use-PHY-fixups-for-Open-Mesh-MR1750.patch create mode 100644 patches/openwrt/0061-ar71xx-Use-private-version-of-ath79_setup_qca955x_et.patch create mode 100644 patches/openwrt/0062-ar71xx-Use-private-version-of-ath79_setup_qca955x_et.patch create mode 100644 patches/openwrt/0063-scripts-om-fwupgradecfg-gen.sh-Fix-u-boot-image-md5s.patch create mode 100644 patches/openwrt/0064-scripts-om-fwupgradecfg-gen.sh-Generate-sha256sum-fo.patch create mode 100644 patches/openwrt/0065-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-AC-b.patch create mode 100644 patches/openwrt/0066-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-.patch create mode 100644 patches/openwrt/0067-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-O.patch create mode 100644 patches/openwrt/0068-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM5P-AC.patch create mode 100644 patches/openwrt/0069-om-watchdog-add-OpenMesh-OM5P-AC-support.patch create mode 100644 patches/openwrt/0070-uboot-envtools-add-OpenMesh-OM5P-AC-support.patch create mode 100644 patches/openwrt/0071-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMes.patch create mode 100644 patches/openwrt/0072-ar71xx-create-profile-and-build-image-for-the-OpenMe.patch create mode 100644 patches/openwrt/0073-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-ACv2.patch create mode 100644 patches/openwrt/0074-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-.patch create mode 100644 patches/openwrt/0075-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM5P-ACv2.patch create mode 100644 patches/openwrt/0076-om-watchdog-add-OpenMesh-OM5P-ACv2-support.patch create mode 100644 patches/openwrt/0077-uboot-envtools-add-OpenMesh-OM5P-ACv2-support.patch create mode 100644 patches/openwrt/0078-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMes.patch create mode 100644 patches/openwrt/0079-ar71xx-add-OM5P-ACv2-to-the-OM5P-AC-profile.patch diff --git a/docs/index.rst b/docs/index.rst index 3e99ef6a..6123a1e7 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -132,12 +132,14 @@ ar71xx-generic * OpenMesh + - MR1750 - MR600 (v1, v2) - MR900 (v1, v2) - OM2P (v1, v2) - OM2P-HS (v1, v2) - OM2P-LC - OM5P + - OM5P-AC (v1, v2) - OM5P-AN * TP-Link diff --git a/patches/openwrt/0047-ar71xx-add-kernel-support-for-the-OpenMesh-MR1750-bo.patch b/patches/openwrt/0047-ar71xx-add-kernel-support-for-the-OpenMesh-MR1750-bo.patch new file mode 100644 index 00000000..35dcac61 --- /dev/null +++ b/patches/openwrt/0047-ar71xx-add-kernel-support-for-the-OpenMesh-MR1750-bo.patch @@ -0,0 +1,202 @@ +From: Sven Eckelmann +Date: Mon, 14 Sep 2015 20:10:43 +0000 +Subject: ar71xx: add kernel support for the OpenMesh MR1750 board + +Signed-off-by: Sven Eckelmann + +Backport of r46926 + +Forwarded: https://patchwork.ozlabs.org/patch/624173/ + +diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18 +index 9a81911..c5a3c9a 100644 +--- a/target/linux/ar71xx/config-3.18 ++++ b/target/linux/ar71xx/config-3.18 +@@ -79,6 +79,7 @@ CONFIG_ATH79_MACH_JWAP003=y + CONFIG_ATH79_MACH_MC_MAC1200R=y + CONFIG_ATH79_MACH_MR16=y + CONFIG_ATH79_MACH_MR12=y ++CONFIG_ATH79_MACH_MR1750=y + CONFIG_ATH79_MACH_MR600=y + CONFIG_ATH79_MACH_MR900=y + CONFIG_ATH79_MACH_MYNET_N600=y +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c +new file mode 100644 +index 0000000..8ace02f +--- /dev/null ++++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c +@@ -0,0 +1,129 @@ ++/* ++ * MR1750 board support ++ * ++ * Copyright (c) 2012 Qualcomm Atheros ++ * Copyright (c) 2012-2013 Marek Lindner ++ * ++ * Permission to use, copy, modify, and/or distribute this software for any ++ * purpose with or without fee is hereby granted, provided that the above ++ * copyright notice and this permission notice appear in all copies. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES ++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF ++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF ++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ++ * ++ */ ++ ++#include ++#include ++ ++#include ++ ++#include "common.h" ++#include "dev-ap9x-pci.h" ++#include "dev-gpio-buttons.h" ++#include "dev-eth.h" ++#include "dev-leds-gpio.h" ++#include "dev-m25p80.h" ++#include "dev-wmac.h" ++#include "machtypes.h" ++#include "pci.h" ++ ++#define MR1750_GPIO_LED_LAN 12 ++#define MR1750_GPIO_LED_WLAN_2G 13 ++#define MR1750_GPIO_LED_STATUS_GREEN 19 ++#define MR1750_GPIO_LED_STATUS_RED 21 ++#define MR1750_GPIO_LED_POWER 22 ++#define MR1750_GPIO_LED_WLAN_5G 23 ++ ++#define MR1750_GPIO_BTN_RESET 17 ++ ++#define MR1750_KEYS_POLL_INTERVAL 20 /* msecs */ ++#define MR1750_KEYS_DEBOUNCE_INTERVAL (3 * MR1750_KEYS_POLL_INTERVAL) ++ ++#define MR1750_MAC0_OFFSET 0 ++#define MR1750_WMAC_CALDATA_OFFSET 0x1000 ++ ++static struct gpio_led mr1750_leds_gpio[] __initdata = { ++ { ++ .name = "mr1750:blue:power", ++ .gpio = MR1750_GPIO_LED_POWER, ++ .active_low = 1, ++ }, ++ { ++ .name = "mr1750:blue:wan", ++ .gpio = MR1750_GPIO_LED_LAN, ++ .active_low = 1, ++ }, ++ { ++ .name = "mr1750:blue:wlan24", ++ .gpio = MR1750_GPIO_LED_WLAN_2G, ++ .active_low = 1, ++ }, ++ { ++ .name = "mr1750:blue:wlan58", ++ .gpio = MR1750_GPIO_LED_WLAN_5G, ++ .active_low = 1, ++ }, ++ { ++ .name = "mr1750:green:status", ++ .gpio = MR1750_GPIO_LED_STATUS_GREEN, ++ .active_low = 1, ++ }, ++ { ++ .name = "mr1750:red:status", ++ .gpio = MR1750_GPIO_LED_STATUS_RED, ++ .active_low = 1, ++ }, ++}; ++ ++static struct gpio_keys_button mr1750_gpio_keys[] __initdata = { ++ { ++ .desc = "Reset button", ++ .type = EV_KEY, ++ .code = KEY_RESTART, ++ .debounce_interval = MR1750_KEYS_DEBOUNCE_INTERVAL, ++ .gpio = MR1750_GPIO_BTN_RESET, ++ .active_low = 1, ++ }, ++}; ++ ++static void __init mr1750_setup(void) ++{ ++ u8 *art = (u8 *)KSEG1ADDR(0x1fff0000); ++ u8 mac[6]; ++ ++ ath79_eth0_pll_data.pll_1000 = 0xbe000101; ++ ath79_eth0_pll_data.pll_100 = 0x80000101; ++ ath79_eth0_pll_data.pll_10 = 0x80001313; ++ ++ ath79_register_m25p80(NULL); ++ ++ ath79_register_leds_gpio(-1, ARRAY_SIZE(mr1750_leds_gpio), ++ mr1750_leds_gpio); ++ ath79_register_gpio_keys_polled(-1, MR1750_KEYS_POLL_INTERVAL, ++ ARRAY_SIZE(mr1750_gpio_keys), ++ mr1750_gpio_keys); ++ ++ ath79_init_mac(mac, art + MR1750_MAC0_OFFSET, 1); ++ ath79_register_wmac(art + MR1750_WMAC_CALDATA_OFFSET, mac); ++ ath79_register_pci(); ++ ++ ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN); ++ ath79_register_mdio(0, 0x0); ++ ++ ath79_init_mac(ath79_eth0_data.mac_addr, art + MR1750_MAC0_OFFSET, 0); ++ ++ /* GMAC0 is connected to the RMGII interface */ ++ ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII; ++ ath79_eth0_data.phy_mask = BIT(5); ++ ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; ++ ++ ath79_register_eth(0); ++} ++ ++MIPS_MACHINE(ATH79_MACH_MR1750, "MR1750", "OpenMesh MR1750", mr1750_setup); +diff --git a/target/linux/ar71xx/patches-3.18/815-MIPS-ath79-add-mr1750-support.patch b/target/linux/ar71xx/patches-3.18/815-MIPS-ath79-add-mr1750-support.patch +new file mode 100644 +index 0000000..d802a12 +--- /dev/null ++++ b/target/linux/ar71xx/patches-3.18/815-MIPS-ath79-add-mr1750-support.patch +@@ -0,0 +1,39 @@ ++--- a/arch/mips/ath79/Kconfig +++++ b/arch/mips/ath79/Kconfig ++@@ -763,6 +763,16 @@ config ATH79_MACH_CAP4200AG ++ select ATH79_DEV_M25P80 ++ select ATH79_DEV_WMAC ++ +++config ATH79_MACH_MR1750 +++ bool "OpenMesh MR1750 board support" +++ select SOC_QCA955X +++ select ATH79_DEV_AP9X_PCI if PCI +++ select ATH79_DEV_ETH +++ select ATH79_DEV_GPIO_BUTTONS +++ select ATH79_DEV_LEDS_GPIO +++ select ATH79_DEV_M25P80 +++ select ATH79_DEV_WMAC +++ ++ config ATH79_MACH_MR900 ++ bool "OpenMesh MR900 board support" ++ select SOC_QCA955X ++--- a/arch/mips/ath79/Makefile +++++ b/arch/mips/ath79/Makefile ++@@ -80,6 +80,7 @@ obj-$(CONFIG_ATH79_MACH_HORNET_UB) += ma ++ obj-$(CONFIG_ATH79_MACH_MC_MAC1200R) += mach-mc-mac1200r.o ++ obj-$(CONFIG_ATH79_MACH_MR12) += mach-mr12.o ++ obj-$(CONFIG_ATH79_MACH_MR16) += mach-mr16.o +++obj-$(CONFIG_ATH79_MACH_MR1750) += mach-mr1750.o ++ obj-$(CONFIG_ATH79_MACH_MR600) += mach-mr600.o ++ obj-$(CONFIG_ATH79_MACH_MR900) += mach-mr900.o ++ obj-$(CONFIG_ATH79_MACH_MYNET_N600) += mach-mynet-n600.o ++--- a/arch/mips/ath79/machtypes.h +++++ b/arch/mips/ath79/machtypes.h ++@@ -69,6 +69,7 @@ enum ath79_mach_type { ++ ATH79_MACH_HORNET_UB, /* ALFA Networks Hornet-UB */ ++ ATH79_MACH_MR12, /* Cisco Meraki MR12 */ ++ ATH79_MACH_MR16, /* Cisco Meraki MR16 */ +++ ATH79_MACH_MR1750, /* OpenMesh MR1750 */ ++ ATH79_MACH_MR600V2, /* OpenMesh MR600v2 */ ++ ATH79_MACH_MR600, /* OpenMesh MR600 */ ++ ATH79_MACH_MR900, /* OpenMesh MR900 */ diff --git a/patches/openwrt/0048-ar71xx-add-user-space-support-for-the-OpenMesh-MR175.patch b/patches/openwrt/0048-ar71xx-add-user-space-support-for-the-OpenMesh-MR175.patch new file mode 100644 index 00000000..3e6363c7 --- /dev/null +++ b/patches/openwrt/0048-ar71xx-add-user-space-support-for-the-OpenMesh-MR175.patch @@ -0,0 +1,67 @@ +From: Sven Eckelmann +Date: Mon, 14 Sep 2015 20:11:01 +0000 +Subject: ar71xx: add user-space support for the OpenMesh MR1750 board + +Signed-off-by: Sven Eckelmann + +Backport of r46927 + +Forwarded: https://patchwork.ozlabs.org/patch/624174/ + +diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh +index 775aac6..44d2ddf 100644 +--- a/target/linux/ar71xx/base-files/etc/diag.sh ++++ b/target/linux/ar71xx/base-files/etc/diag.sh +@@ -143,6 +143,9 @@ get_status_led() { + mr600v2) + status_led="mr600:blue:power" + ;; ++ mr1750) ++ status_led="mr1750:blue:power" ++ ;; + mr900 | \ + mr900v2) + status_led="mr900:blue:power" +diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds +index a4b355a..c451124 100644 +--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds ++++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds +@@ -239,6 +239,12 @@ mr600) + ucidef_set_led_wlan "wlan58" "WLAN58" "mr600:green:wlan58" "phy0tpt" + ;; + ++mr1750) ++ ucidef_set_led_netdev "lan" "LAN" "mr1750:blue:wan" "eth0" ++ ucidef_set_led_wlan "wlan58" "WLAN58" "mr1750:blue:wlan58" "phy0tpt" ++ ucidef_set_led_wlan "wlan24" "WLAN24" "mr1750:blue:wlan24" "phy1tpt" ++ ;; ++ + mr900 | \ + mr900v2) + ucidef_set_led_netdev "lan" "LAN" "mr900:blue:wan" "eth0" +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 0a23756..4066506 100755 +--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network ++++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network +@@ -334,6 +334,7 @@ eap300v2 |\ + eap7660d |\ + el-mini |\ + loco-m-xw |\ ++mr1750 |\ + mr600 |\ + mr600v2 |\ + mr900 |\ +diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh +index 7fc951a..587d029 100755 +--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh ++++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh +@@ -562,6 +562,9 @@ ar71xx_board_detect() { + *MR600v2) + name="mr600v2" + ;; ++ *MR1750) ++ name="mr1750" ++ ;; + *MR600) + name="mr600" + ;; diff --git a/patches/openwrt/0049-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-M.patch b/patches/openwrt/0049-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-M.patch new file mode 100644 index 00000000..66b0bc4f --- /dev/null +++ b/patches/openwrt/0049-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-M.patch @@ -0,0 +1,32 @@ +From: Sven Eckelmann +Date: Mon, 14 Sep 2015 20:11:18 +0000 +Subject: scripts/om-fwupgradecfg-gen.sh: add support for the MR1750 + +Signed-off-by: Sven Eckelmann + +Backport of r46928 + +Forwarded: https://patchwork.ozlabs.org/patch/624175/ + +diff --git a/scripts/om-fwupgradecfg-gen.sh b/scripts/om-fwupgradecfg-gen.sh +index e132954..c790214 100644 +--- a/scripts/om-fwupgradecfg-gen.sh ++++ b/scripts/om-fwupgradecfg-gen.sh +@@ -7,7 +7,7 @@ + # + + usage() { +- echo "Usage: $0 " ++ echo "Usage: $0 " + rm -f $CFG_OUT + exit 1 + } +@@ -26,7 +26,7 @@ case $CE_TYPE in + FLASH_BS=262144 + MD5_SKIP_BLOCKS=1 + ;; +- OM5P|MR600|MR900) ++ OM5P|MR600|MR900|MR1750) + MAX_PART_SIZE=7808 + KERNEL_FLASH_ADDR=0xb0000 + FLASH_BS=65536 diff --git a/patches/openwrt/0050-ar71xx-enable-sysupgrade-for-the-OpenMesh-MR1750.patch b/patches/openwrt/0050-ar71xx-enable-sysupgrade-for-the-OpenMesh-MR1750.patch new file mode 100644 index 00000000..dc595593 --- /dev/null +++ b/patches/openwrt/0050-ar71xx-enable-sysupgrade-for-the-OpenMesh-MR1750.patch @@ -0,0 +1,55 @@ +From: Sven Eckelmann +Date: Mon, 14 Sep 2015 20:11:24 +0000 +Subject: ar71xx: enable sysupgrade for the OpenMesh MR1750 + +Signed-off-by: Sven Eckelmann + +Backport of r46929 + +Forwarded: https://patchwork.ozlabs.org/patch/624176/ + +diff --git a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh +index 547116e..9ca0f5b 100644 +--- a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh ++++ b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh +@@ -72,6 +72,11 @@ platform_check_image_openmesh() + echo "Invalid image board target ($img_board_target) for this platform: $board. Use the correct image for this platform" + return 1 + ;; ++ MR1750) ++ [ "$board" = "mr1750" ] && break ++ echo "Invalid image board target ($img_board_target) for this platform: $board. Use the correct image for this platform" ++ return 1 ++ ;; + MR600) + [ "$board" = "mr600" ] && break + [ "$board" = "mr600v2" ] && break +@@ -157,7 +162,7 @@ platform_do_upgrade_openmesh() + kernel_start_addr1=0x9f1c0000 + kernel_start_addr2=0x9f8c0000 + ;; +- OM5P|MR600|MR900) ++ OM5P|MR600|MR900|MR1750) + block_size=$((64 * 1024)) + total_size=7995392 + kernel_start_addr1=0x9f0b0000 +diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +index 0e9833d..ac060ea 100755 +--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh ++++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +@@ -296,6 +296,7 @@ platform_check_image() { + + return 0; + ;; ++ mr1750 | \ + mr600 | \ + mr600v2 | \ + mr900 | \ +@@ -528,6 +529,7 @@ platform_do_upgrade() { + tew-673gru) + platform_do_upgrade_dir825b "$ARGV" + ;; ++ mr1750 | \ + mr600 | \ + mr600v2 | \ + mr900 | \ diff --git a/patches/openwrt/0051-package-om-watchdog-add-OpenMesh-MR1750-support.patch b/patches/openwrt/0051-package-om-watchdog-add-OpenMesh-MR1750-support.patch new file mode 100644 index 00000000..e16fb3ef --- /dev/null +++ b/patches/openwrt/0051-package-om-watchdog-add-OpenMesh-MR1750-support.patch @@ -0,0 +1,23 @@ +From: Sven Eckelmann +Date: Mon, 14 Sep 2015 20:11:35 +0000 +Subject: package/om-watchdog: add OpenMesh MR1750 support + +Signed-off-by: Sven Eckelmann + +Backport of r46930 + +Forwarded: https://patchwork.ozlabs.org/patch/624177/ + +diff --git a/package/kernel/om-watchdog/files/om-watchdog.init b/package/kernel/om-watchdog/files/om-watchdog.init +index 135fef7..c792968 100644 +--- a/package/kernel/om-watchdog/files/om-watchdog.init ++++ b/package/kernel/om-watchdog/files/om-watchdog.init +@@ -25,7 +25,7 @@ boot() { + "mr600v2") + service_start /sbin/om-watchdog 15 + ;; +- "mr900"|"mr900v2") ++ "mr900"|"mr900v2"|"mr1750") + service_start /sbin/om-watchdog 16 + ;; + esac diff --git a/patches/openwrt/0052-package-uboot-envtools-add-OpenMesh-MR1750-support.patch b/patches/openwrt/0052-package-uboot-envtools-add-OpenMesh-MR1750-support.patch new file mode 100644 index 00000000..8e975a1c --- /dev/null +++ b/patches/openwrt/0052-package-uboot-envtools-add-OpenMesh-MR1750-support.patch @@ -0,0 +1,22 @@ +From: Sven Eckelmann +Date: Mon, 14 Sep 2015 20:11:43 +0000 +Subject: package/uboot-envtools: add OpenMesh MR1750 support + +Signed-off-by: Sven Eckelmann + +Backport of r46931 + +Forwarded: https://patchwork.ozlabs.org/patch/624178/ + +diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx +index ec8541c..ef00f17 100644 +--- a/package/boot/uboot-envtools/files/ar71xx ++++ b/package/boot/uboot-envtools/files/ar71xx +@@ -21,6 +21,7 @@ carambola2 | \ + eap300v2 | \ + hornet-ub | \ + hornet-ub-x2 | \ ++mr1750 | \ + mr600 | \ + mr600v2 | \ + mr900 | \ diff --git a/patches/openwrt/0053-ar71xx-create-profile-and-build-image-for-the-OpenMe.patch b/patches/openwrt/0053-ar71xx-create-profile-and-build-image-for-the-OpenMe.patch new file mode 100644 index 00000000..2a166e16 --- /dev/null +++ b/patches/openwrt/0053-ar71xx-create-profile-and-build-image-for-the-OpenMe.patch @@ -0,0 +1,57 @@ +From: Sven Eckelmann +Date: Mon, 14 Sep 2015 20:11:51 +0000 +Subject: ar71xx: create profile and build image for the OpenMesh MR1750 board + +Signed-off-by: Sven Eckelmann + +Backport of r46932 + +Forwarded: https://patchwork.ozlabs.org/patch/624179/ + +diff --git a/target/linux/ar71xx/generic/profiles/openmesh.mk b/target/linux/ar71xx/generic/profiles/openmesh.mk +index 41b462e..06cf135 100644 +--- a/target/linux/ar71xx/generic/profiles/openmesh.mk ++++ b/target/linux/ar71xx/generic/profiles/openmesh.mk +@@ -49,9 +49,20 @@ endef + + $(eval $(call Profile,MR900)) + ++define Profile/MR1750 ++ NAME:=OpenMesh MR1750 ++ PACKAGES:=kmod-ath9k kmod-ath10k ath10k-firmware-qca988x ++endef ++ ++define Profile/MR1750/Description ++ Package set optimized for the OpenMesh MR1750. ++endef ++ ++$(eval $(call Profile,MR1750)) ++ + define Profile/OPENMESH + NAME:=OpenMesh products +- PACKAGES:=kmod-ath9k om-watchdog ++ PACKAGES:=kmod-ath9k kmod-ath10k om-watchdog + endef + + define Profile/OPENMESH/Description +diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile +index f91e20e..b74aa45 100644 +--- a/target/linux/ar71xx/image/Makefile ++++ b/target/linux/ar71xx/image/Makefile +@@ -2045,6 +2045,7 @@ $(eval $(call SingleProfile,OpenMesh,squashfs-only,OM2P,om2p,,,,OM2P)) + $(eval $(call SingleProfile,OpenMesh,squashfs-only,OM5P,om5p,,,,OM5P)) + $(eval $(call SingleProfile,OpenMesh,squashfs-only,MR600,mr600,,,,MR600)) + $(eval $(call SingleProfile,OpenMesh,squashfs-only,MR900,mr900,,,,MR900)) ++$(eval $(call SingleProfile,OpenMesh,squashfs-only,MR1750,mr1750,,,,MR1750)) + + $(eval $(call SingleProfile,PB4X,128k,ALL0305,all0305,ALL0305,ttyS0,115200)) + $(eval $(call SingleProfile,PB4X,128k,EAP7660D,eap7660d,EAP7660D,ttyS0,115200)) +@@ -2138,7 +2139,7 @@ $(eval $(call MultiProfile,AP121,AP121_2M AP121_4M)) + $(eval $(call MultiProfile,DIR615IX,DIR615I1 DIR615I3)) + $(eval $(call MultiProfile,AP136,AP136_010 AP136_020)) + $(eval $(call MultiProfile,EWDORIN, EWDORINAP EWDORINRT EWDORIN16M)) +-$(eval $(call MultiProfile,OPENMESH,OM2P OM5P MR600 MR900)) ++$(eval $(call MultiProfile,OPENMESH,OM2P OM5P MR600 MR900 MR1750)) + $(eval $(call MultiProfile,TEW652BRP,TEW652BRP_FW TEW652BRP_RECOVERY)) + $(eval $(call MultiProfile,TLMR3220,TLMR3220V1)) + $(eval $(call MultiProfile,TLMR3420,TLMR3420V1)) diff --git a/patches/openwrt/0054-ar71xx-Extend-the-list-of-bits-in-QCA955X_GMAC_REG_E.patch b/patches/openwrt/0054-ar71xx-Extend-the-list-of-bits-in-QCA955X_GMAC_REG_E.patch new file mode 100644 index 00000000..efe4b609 --- /dev/null +++ b/patches/openwrt/0054-ar71xx-Extend-the-list-of-bits-in-QCA955X_GMAC_REG_E.patch @@ -0,0 +1,47 @@ +From: Sven Eckelmann +Date: Wed, 16 Mar 2016 09:27:01 +0000 +Subject: ar71xx: Extend the list of bits in QCA955X_GMAC_REG_ETH_CFG + +Signed-off-by: Sven Eckelmann + +Backport of r49027 + +Forwarded: https://patchwork.ozlabs.org/patch/624180/ + +diff --git a/target/linux/ar71xx/patches-3.18/601-MIPS-ath79-add-more-register-defines.patch b/target/linux/ar71xx/patches-3.18/601-MIPS-ath79-add-more-register-defines.patch +index 8bf7658..797977f 100644 +--- a/target/linux/ar71xx/patches-3.18/601-MIPS-ath79-add-more-register-defines.patch ++++ b/target/linux/ar71xx/patches-3.18/601-MIPS-ath79-add-more-register-defines.patch +@@ -207,7 +207,7 @@ + #define AR934X_GPIO_REG_FUNC 0x6c + + #define AR71XX_GPIO_COUNT 16 +-@@ -560,4 +663,153 @@ ++@@ -560,4 +663,170 @@ + #define AR934X_SRIF_DPLL2_OUTDIV_SHIFT 13 + #define AR934X_SRIF_DPLL2_OUTDIV_MASK 0x7 + +@@ -358,6 +358,23 @@ + +#define QCA955X_GMAC_REG_ETH_CFG 0x00 + + + +#define QCA955X_ETH_CFG_RGMII_EN BIT(0) +++#define QCA955X_ETH_CFG_MII_GE0 BIT(1) +++#define QCA955X_ETH_CFG_GMII_GE0 BIT(2) +++#define QCA955X_ETH_CFG_MII_GE0_MASTER BIT(3) +++#define QCA955X_ETH_CFG_MII_GE0_SLAVE BIT(4) +++#define QCA955X_ETH_CFG_GE0_ERR_EN BIT(5) + +#define QCA955X_ETH_CFG_GE0_SGMII BIT(6) +++#define QCA955X_ETH_CFG_RMII_GE0 BIT(10) +++#define QCA955X_ETH_CFG_MII_CNTL_SPEED BIT(11) +++#define QCA955X_ETH_CFG_RMII_GE0_MASTER BIT(12) +++#define QCA955X_ETH_CFG_RXD_DELAY_MASK 0x3 +++#define QCA955X_ETH_CFG_RXD_DELAY_SHIFT 14 +++#define QCA955X_ETH_CFG_RDV_DELAY BIT(16) +++#define QCA955X_ETH_CFG_RDV_DELAY_MASK 0x3 +++#define QCA955X_ETH_CFG_RDV_DELAY_SHIFT 16 +++#define QCA955X_ETH_CFG_TXD_DELAY_MASK 0x3 +++#define QCA955X_ETH_CFG_TXD_DELAY_SHIFT 18 +++#define QCA955X_ETH_CFG_TXE_DELAY_MASK 0x3 +++#define QCA955X_ETH_CFG_TXE_DELAY_SHIFT 20 + + + #endif /* __ASM_MACH_AR71XX_REGS_H */ diff --git a/patches/openwrt/0055-ar71xx-Use-_eth_cfg-helper-for-Open-Mesh-MR900-board.patch b/patches/openwrt/0055-ar71xx-Use-_eth_cfg-helper-for-Open-Mesh-MR900-board.patch new file mode 100644 index 00000000..43a876d2 --- /dev/null +++ b/patches/openwrt/0055-ar71xx-Use-_eth_cfg-helper-for-Open-Mesh-MR900-board.patch @@ -0,0 +1,49 @@ +From: Sven Eckelmann +Date: Tue, 7 Jul 2015 13:47:39 +0000 +Subject: ar71xx: Use *_eth_cfg helper for Open Mesh MR900 boards + +Signed-off-by: Sven Eckelmann + +Backport of r46241 + +Forwarded: https://patchwork.ozlabs.org/patch/624181/ + +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr900.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr900.c +index fe3e1fa..9c3164d 100644 +--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr900.c ++++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr900.c +@@ -94,24 +94,6 @@ static struct gpio_keys_button mr900_gpio_keys[] __initdata = { + }, + }; + +- +-static void __init mr900_gmac_setup(void) +-{ +- void __iomem *base; +- u32 t; +- +- base = ioremap(QCA955X_GMAC_BASE, QCA955X_GMAC_SIZE); +- +- t = __raw_readl(base + QCA955X_GMAC_REG_ETH_CFG); +- +- t &= ~(QCA955X_ETH_CFG_RGMII_EN | QCA955X_ETH_CFG_GE0_SGMII); +- t |= QCA955X_ETH_CFG_RGMII_EN; +- +- __raw_writel(t, base + QCA955X_GMAC_REG_ETH_CFG); +- +- iounmap(base); +-} +- + static void __init mr900_setup(void) + { + u8 *art = (u8 *)KSEG1ADDR(0x1fff0000); +@@ -141,8 +123,7 @@ static void __init mr900_setup(void) + } + pdata->use_eeprom = true; + +- mr900_gmac_setup(); +- ++ ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN); + ath79_register_mdio(0, 0x0); + + ath79_init_mac(ath79_eth0_data.mac_addr, art + MR900_MAC0_OFFSET, 0); diff --git a/patches/openwrt/0056-ar71xx-Allow-to-use-ath79_gpio_output_select-on-QCA9.patch b/patches/openwrt/0056-ar71xx-Allow-to-use-ath79_gpio_output_select-on-QCA9.patch new file mode 100644 index 00000000..137aa9d4 --- /dev/null +++ b/patches/openwrt/0056-ar71xx-Allow-to-use-ath79_gpio_output_select-on-QCA9.patch @@ -0,0 +1,79 @@ +From: Sven Eckelmann +Date: Fri, 24 Jul 2015 09:10:00 +0000 +Subject: ar71xx: Allow to use ath79_gpio_output_select on QCA955x + +Signed-off-by: Sven Eckelmann + +Backport of r46459 + +Forwarded: https://patchwork.ozlabs.org/patch/624182/ + +diff --git a/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch b/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch +new file mode 100644 +index 0000000..e71b6e2 +--- /dev/null ++++ b/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch +@@ -0,0 +1,63 @@ ++--- a/arch/mips/ath79/gpio.c +++++ b/arch/mips/ath79/gpio.c ++@@ -187,15 +187,30 @@ void __init ath79_gpio_output_select(uns ++ { ++ void __iomem *base = ath79_gpio_base; ++ unsigned long flags; ++- unsigned int reg; +++ unsigned int reg, reg_base; +++ unsigned long gpio_count; ++ u32 t, s; ++ ++- BUG_ON(!soc_is_ar934x() && !soc_is_qca953x() && !soc_is_qca956x()); +++ if (soc_is_ar934x()) { +++ gpio_count = AR934X_GPIO_COUNT; +++ reg_base = AR934X_GPIO_REG_OUT_FUNC0; +++ } else if (soc_is_qca953x()) { +++ gpio_count = QCA953X_GPIO_COUNT; +++ reg_base = QCA953X_GPIO_REG_OUT_FUNC0; +++ } else if (soc_is_qca955x()) { +++ gpio_count = QCA955X_GPIO_COUNT; +++ reg_base = QCA955X_GPIO_REG_OUT_FUNC0; +++ } else if (soc_is_qca956x()) { +++ gpio_count = QCA956X_GPIO_COUNT; +++ reg_base = QCA956X_GPIO_REG_OUT_FUNC0; +++ } else { +++ BUG(); +++ } ++ ++- if (gpio >= AR934X_GPIO_COUNT) +++ if (gpio >= gpio_count) ++ return; ++ ++- reg = AR934X_GPIO_REG_OUT_FUNC0 + 4 * (gpio / 4); +++ reg = reg_base + 4 * (gpio / 4); ++ s = 8 * (gpio % 4); ++ ++ spin_lock_irqsave(&ath79_gpio_lock, flags); ++--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h +++++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h ++@@ -875,6 +875,14 @@ ++ #define QCA953X_GPIO_OUT_MUX_LED_LINK4 44 ++ #define QCA953X_GPIO_OUT_MUX_LED_LINK5 45 ++ +++#define QCA955X_GPIO_REG_OUT_FUNC0 0x2c +++#define QCA955X_GPIO_REG_OUT_FUNC1 0x30 +++#define QCA955X_GPIO_REG_OUT_FUNC2 0x34 +++#define QCA955X_GPIO_REG_OUT_FUNC3 0x38 +++#define QCA955X_GPIO_REG_OUT_FUNC4 0x3c +++#define QCA955X_GPIO_REG_OUT_FUNC5 0x40 +++#define QCA955X_GPIO_REG_FUNC 0x6c +++ ++ #define QCA956X_GPIO_REG_OUT_FUNC0 0x2c ++ #define QCA956X_GPIO_REG_OUT_FUNC1 0x30 ++ #define QCA956X_GPIO_REG_OUT_FUNC2 0x34 ++@@ -1014,6 +1022,8 @@ ++ #define AR934X_GPIO_OUT_EXT_LNA0 46 ++ #define AR934X_GPIO_OUT_EXT_LNA1 47 ++ +++#define QCA955X_GPIO_OUT_GPIO 0 +++ ++ /* ++ * MII_CTRL block ++ */ diff --git a/patches/openwrt/0057-ar71xx-Add-support-for-ath79_gpio_function_-on-QCA95.patch b/patches/openwrt/0057-ar71xx-Add-support-for-ath79_gpio_function_-on-QCA95.patch new file mode 100644 index 00000000..23b42cb6 --- /dev/null +++ b/patches/openwrt/0057-ar71xx-Add-support-for-ath79_gpio_function_-on-QCA95.patch @@ -0,0 +1,32 @@ +From: Sven Eckelmann +Date: Wed, 23 Mar 2016 12:52:27 +0000 +Subject: ar71xx: Add support for ath79_gpio_function_* on QCA955X + +Signed-off-by: Sven Eckelmann + +Backport of r49074 + +Forwarded: https://patchwork.ozlabs.org/patch/624183/ + +diff --git a/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch b/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch +index e71b6e2..0e87357 100644 +--- a/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch ++++ b/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch +@@ -1,6 +1,16 @@ + --- a/arch/mips/ath79/gpio.c + +++ b/arch/mips/ath79/gpio.c +-@@ -187,15 +187,30 @@ void __init ath79_gpio_output_select(uns ++@@ -146,7 +146,8 @@ static void __iomem *ath79_gpio_get_func ++ if (soc_is_ar71xx() || ++ soc_is_ar724x() || ++ soc_is_ar913x() || ++- soc_is_ar933x()) +++ soc_is_ar933x() || +++ soc_is_qca955x()) ++ reg = AR71XX_GPIO_REG_FUNC; ++ else if (soc_is_ar934x() || ++ soc_is_qca953x() || ++@@ -187,15 +188,30 @@ void __init ath79_gpio_output_select(uns + { + void __iomem *base = ath79_gpio_base; + unsigned long flags; diff --git a/patches/openwrt/0058-ar71xx-Add-QCA955X-GPIO-mux-and-function-definitions.patch b/patches/openwrt/0058-ar71xx-Add-QCA955X-GPIO-mux-and-function-definitions.patch new file mode 100644 index 00000000..ee3c3674 --- /dev/null +++ b/patches/openwrt/0058-ar71xx-Add-QCA955X-GPIO-mux-and-function-definitions.patch @@ -0,0 +1,159 @@ +From: Sven Eckelmann +Date: Wed, 23 Mar 2016 12:52:31 +0000 +Subject: ar71xx: Add QCA955X GPIO mux and function definitions + +Signed-off-by: Sven Eckelmann + +Backport of r49075 + +Forwarded: https://patchwork.ozlabs.org/patch/624184/ + +diff --git a/target/linux/ar71xx/patches-3.18/601-MIPS-ath79-add-more-register-defines.patch b/target/linux/ar71xx/patches-3.18/601-MIPS-ath79-add-more-register-defines.patch +index 797977f..0126f6a 100644 +--- a/target/linux/ar71xx/patches-3.18/601-MIPS-ath79-add-more-register-defines.patch ++++ b/target/linux/ar71xx/patches-3.18/601-MIPS-ath79-add-more-register-defines.patch +@@ -194,7 +194,7 @@ + #define AR933X_BOOTSTRAP_REF_CLK_40 BIT(0) + + #define AR934X_BOOTSTRAP_SW_OPTION8 BIT(23) +-@@ -529,6 +626,12 @@ ++@@ -529,8 +626,22 @@ + #define AR71XX_GPIO_REG_INT_ENABLE 0x24 + #define AR71XX_GPIO_REG_FUNC 0x28 + +@@ -206,8 +206,18 @@ + +#define AR934X_GPIO_REG_OUT_FUNC5 0x40 + #define AR934X_GPIO_REG_FUNC 0x6c + +++#define QCA955X_GPIO_REG_OUT_FUNC0 0x2c +++#define QCA955X_GPIO_REG_OUT_FUNC1 0x30 +++#define QCA955X_GPIO_REG_OUT_FUNC2 0x34 +++#define QCA955X_GPIO_REG_OUT_FUNC3 0x38 +++#define QCA955X_GPIO_REG_OUT_FUNC4 0x3c +++#define QCA955X_GPIO_REG_OUT_FUNC5 0x40 +++#define QCA955X_GPIO_REG_FUNC 0x6c +++ + #define AR71XX_GPIO_COUNT 16 +-@@ -560,4 +663,170 @@ ++ #define AR7240_GPIO_COUNT 18 ++ #define AR7241_GPIO_COUNT 20 ++@@ -560,4 +671,235 @@ + #define AR934X_SRIF_DPLL2_OUTDIV_SHIFT 13 + #define AR934X_SRIF_DPLL2_OUTDIV_MASK 0x7 + +@@ -288,6 +298,71 @@ + +#define AR934X_GPIO_OUT_EXT_LNA0 46 + +#define AR934X_GPIO_OUT_EXT_LNA1 47 + + +++#define QCA955X_GPIO_FUNC_CLK_OBS7_EN BIT(9) +++#define QCA955X_GPIO_FUNC_CLK_OBS6_EN BIT(8) +++#define QCA955X_GPIO_FUNC_CLK_OBS5_EN BIT(7) +++#define QCA955X_GPIO_FUNC_CLK_OBS4_EN BIT(6) +++#define QCA955X_GPIO_FUNC_CLK_OBS3_EN BIT(5) +++#define QCA955X_GPIO_FUNC_CLK_OBS2_EN BIT(4) +++#define QCA955X_GPIO_FUNC_CLK_OBS1_EN BIT(3) +++#define QCA955X_GPIO_FUNC_JTAG_DISABLE BIT(1) +++ +++#define QCA955X_GPIO_OUT_GPIO 0 +++#define QCA955X_MII_EXT_MDI 1 +++#define QCA955X_SLIC_DATA_OUT 3 +++#define QCA955X_SLIC_PCM_FS 4 +++#define QCA955X_SLIC_PCM_CLK 5 +++#define QCA955X_SPI_CLK 8 +++#define QCA955X_SPI_CS_0 9 +++#define QCA955X_SPI_CS_1 10 +++#define QCA955X_SPI_CS_2 11 +++#define QCA955X_SPI_MISO 12 +++#define QCA955X_I2S_CLK 13 +++#define QCA955X_I2S_WS 14 +++#define QCA955X_I2S_SD 15 +++#define QCA955X_I2S_MCK 16 +++#define QCA955X_SPDIF_OUT 17 +++#define QCA955X_UART1_TD 18 +++#define QCA955X_UART1_RTS 19 +++#define QCA955X_UART1_RD 20 +++#define QCA955X_UART1_CTS 21 +++#define QCA955X_UART0_SOUT 22 +++#define QCA955X_SPDIF2_OUT 23 +++#define QCA955X_LED_SGMII_SPEED0 24 +++#define QCA955X_LED_SGMII_SPEED1 25 +++#define QCA955X_LED_SGMII_DUPLEX 26 +++#define QCA955X_LED_SGMII_LINK_UP 27 +++#define QCA955X_SGMII_SPEED0_INVERT 28 +++#define QCA955X_SGMII_SPEED1_INVERT 29 +++#define QCA955X_SGMII_DUPLEX_INVERT 30 +++#define QCA955X_SGMII_LINK_UP_INVERT 31 +++#define QCA955X_GE1_MII_MDO 32 +++#define QCA955X_GE1_MII_MDC 33 +++#define QCA955X_SWCOM2 38 +++#define QCA955X_SWCOM3 39 +++#define QCA955X_MAC2_GPIO 40 +++#define QCA955X_MAC3_GPIO 41 +++#define QCA955X_ATT_LED 42 +++#define QCA955X_PWR_LED 43 +++#define QCA955X_TX_FRAME 44 +++#define QCA955X_RX_CLEAR_EXTERNAL 45 +++#define QCA955X_LED_NETWORK_EN 46 +++#define QCA955X_LED_POWER_EN 47 +++#define QCA955X_WMAC_GLUE_WOW 68 +++#define QCA955X_RX_CLEAR_EXTENSION 70 +++#define QCA955X_CP_NAND_CS1 73 +++#define QCA955X_USB_SUSPEND 74 +++#define QCA955X_ETH_TX_ERR 75 +++#define QCA955X_DDR_DQ_OE 76 +++#define QCA955X_CLKREQ_N_EP 77 +++#define QCA955X_CLKREQ_N_RC 78 +++#define QCA955X_CLK_OBS0 79 +++#define QCA955X_CLK_OBS1 80 +++#define QCA955X_CLK_OBS2 81 +++#define QCA955X_CLK_OBS3 82 +++#define QCA955X_CLK_OBS4 83 +++#define QCA955X_CLK_OBS5 84 +++ + +/* + + * MII_CTRL block + + */ +diff --git a/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch b/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch +index 0e87357..8a54859 100644 +--- a/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch ++++ b/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch +@@ -37,37 +37,12 @@ + + } + + - if (gpio >= AR934X_GPIO_COUNT) ++- return; + + if (gpio >= gpio_count) +- return; +++ return; + + - reg = AR934X_GPIO_REG_OUT_FUNC0 + 4 * (gpio / 4); + + reg = reg_base + 4 * (gpio / 4); + s = 8 * (gpio % 4); + + spin_lock_irqsave(&ath79_gpio_lock, flags); +---- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h +-+++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h +-@@ -875,6 +875,14 @@ +- #define QCA953X_GPIO_OUT_MUX_LED_LINK4 44 +- #define QCA953X_GPIO_OUT_MUX_LED_LINK5 45 +- +-+#define QCA955X_GPIO_REG_OUT_FUNC0 0x2c +-+#define QCA955X_GPIO_REG_OUT_FUNC1 0x30 +-+#define QCA955X_GPIO_REG_OUT_FUNC2 0x34 +-+#define QCA955X_GPIO_REG_OUT_FUNC3 0x38 +-+#define QCA955X_GPIO_REG_OUT_FUNC4 0x3c +-+#define QCA955X_GPIO_REG_OUT_FUNC5 0x40 +-+#define QCA955X_GPIO_REG_FUNC 0x6c +-+ +- #define QCA956X_GPIO_REG_OUT_FUNC0 0x2c +- #define QCA956X_GPIO_REG_OUT_FUNC1 0x30 +- #define QCA956X_GPIO_REG_OUT_FUNC2 0x34 +-@@ -1014,6 +1022,8 @@ +- #define AR934X_GPIO_OUT_EXT_LNA0 46 +- #define AR934X_GPIO_OUT_EXT_LNA1 47 +- +-+#define QCA955X_GPIO_OUT_GPIO 0 +-+ +- /* +- * MII_CTRL block +- */ diff --git a/patches/openwrt/0059-ar71xx-Use-PHY-fixups-for-Open-Mesh-MR900.patch b/patches/openwrt/0059-ar71xx-Use-PHY-fixups-for-Open-Mesh-MR900.patch new file mode 100644 index 00000000..6a32c80b --- /dev/null +++ b/patches/openwrt/0059-ar71xx-Use-PHY-fixups-for-Open-Mesh-MR900.patch @@ -0,0 +1,78 @@ +From: Sven Eckelmann +Date: Wed, 16 Mar 2016 09:27:11 +0000 +Subject: ar71xx: Use PHY fixups for Open Mesh MR900 + +The delays of PHY/MAC on the MR900 are done by u-boot and OpenWrt in +different ways. u-boot only modifies the ETH_CFG of the QCA955x based on +the link speed. But OpenWrt can only modify the PHY delays based on the +link speed. + +This can lead to communication problems when u-boot initializes the ETH_CFG +for a specific link speed (e.g. 10BASE-T) but then OpenWrt the sets the PHY +delays to an incompatible value. + +Instead reset the ETH_CFG delay bits of the QCA955x to a specific value and +only rely on the AT803x PHY settings. + +Signed-off-by: Sven Eckelmann + +Backport of r49030 + +Forwarded: https://patchwork.ozlabs.org/patch/624185/ + +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr900.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr900.c +index 9c3164d..3634bf0 100644 +--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr900.c ++++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr900.c +@@ -23,6 +23,7 @@ + #include + + #include ++#include + + #include "common.h" + #include "dev-ap9x-pci.h" +@@ -94,15 +95,30 @@ static struct gpio_keys_button mr900_gpio_keys[] __initdata = { + }, + }; + ++static struct at803x_platform_data mr900_at803x_data = { ++ .disable_smarteee = 1, ++ .enable_rgmii_rx_delay = 1, ++ .enable_rgmii_tx_delay = 0, ++ .fixup_rgmii_tx_delay = 1, ++}; ++ ++static struct mdio_board_info mr900_mdio0_info[] = { ++ { ++ .bus_id = "ag71xx-mdio.0", ++ .phy_addr = 5, ++ .platform_data = &mr900_at803x_data, ++ }, ++}; ++ + static void __init mr900_setup(void) + { + u8 *art = (u8 *)KSEG1ADDR(0x1fff0000); + u8 mac[6], pcie_mac[6]; + struct ath9k_platform_data *pdata; + +- ath79_eth0_pll_data.pll_1000 = 0xbe000101; +- ath79_eth0_pll_data.pll_100 = 0x80000101; +- ath79_eth0_pll_data.pll_10 = 0x80001313; ++ ath79_eth0_pll_data.pll_1000 = 0xae000000; ++ ath79_eth0_pll_data.pll_100 = 0xa0000101; ++ ath79_eth0_pll_data.pll_10 = 0xa0001313; + + ath79_register_m25p80(NULL); + +@@ -126,6 +142,9 @@ static void __init mr900_setup(void) + ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN); + ath79_register_mdio(0, 0x0); + ++ mdiobus_register_board_info(mr900_mdio0_info, ++ ARRAY_SIZE(mr900_mdio0_info)); ++ + ath79_init_mac(ath79_eth0_data.mac_addr, art + MR900_MAC0_OFFSET, 0); + + /* GMAC0 is connected to the RMGII interface */ diff --git a/patches/openwrt/0060-ar71xx-Use-PHY-fixups-for-Open-Mesh-MR1750.patch b/patches/openwrt/0060-ar71xx-Use-PHY-fixups-for-Open-Mesh-MR1750.patch new file mode 100644 index 00000000..50ff879c --- /dev/null +++ b/patches/openwrt/0060-ar71xx-Use-PHY-fixups-for-Open-Mesh-MR1750.patch @@ -0,0 +1,77 @@ +From: Sven Eckelmann +Date: Wed, 16 Mar 2016 09:27:14 +0000 +Subject: ar71xx: Use PHY fixups for Open Mesh MR1750 + +The delays of PHY/MAC on the MR1750 are done by u-boot and OpenWrt in +different ways. u-boot only modifies the ETH_CFG of the QCA955x based on +the link speed. But OpenWrt can only modify the PHY delays based on the +link speed. + +This can lead to communication problems when u-boot initializes the ETH_CFG +for a specific link speed (e.g. 10BASE-T) but then OpenWrt the sets the PHY +delays to an incompatible value. + +Instead reset the ETH_CFG delay bits of the QCA955x to a specific value and +only rely on the AT803x PHY settings. + +Signed-off-by: Sven Eckelmann + +Backport of r49031 + +Forwarded: https://patchwork.ozlabs.org/patch/624186/ + +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c +index 8ace02f..f9e45bd 100644 +--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c ++++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c +@@ -22,6 +22,7 @@ + #include + + #include ++#include + + #include "common.h" + #include "dev-ap9x-pci.h" +@@ -92,14 +93,29 @@ static struct gpio_keys_button mr1750_gpio_keys[] __initdata = { + }, + }; + ++static struct at803x_platform_data mr1750_at803x_data = { ++ .disable_smarteee = 1, ++ .enable_rgmii_rx_delay = 1, ++ .enable_rgmii_tx_delay = 0, ++ .fixup_rgmii_tx_delay = 1, ++}; ++ ++static struct mdio_board_info mr1750_mdio0_info[] = { ++ { ++ .bus_id = "ag71xx-mdio.0", ++ .phy_addr = 5, ++ .platform_data = &mr1750_at803x_data, ++ }, ++}; ++ + static void __init mr1750_setup(void) + { + u8 *art = (u8 *)KSEG1ADDR(0x1fff0000); + u8 mac[6]; + +- ath79_eth0_pll_data.pll_1000 = 0xbe000101; +- ath79_eth0_pll_data.pll_100 = 0x80000101; +- ath79_eth0_pll_data.pll_10 = 0x80001313; ++ ath79_eth0_pll_data.pll_1000 = 0xae000000; ++ ath79_eth0_pll_data.pll_100 = 0xa0000101; ++ ath79_eth0_pll_data.pll_10 = 0xa0001313; + + ath79_register_m25p80(NULL); + +@@ -116,6 +132,9 @@ static void __init mr1750_setup(void) + ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN); + ath79_register_mdio(0, 0x0); + ++ mdiobus_register_board_info(mr1750_mdio0_info, ++ ARRAY_SIZE(mr1750_mdio0_info)); ++ + ath79_init_mac(ath79_eth0_data.mac_addr, art + MR1750_MAC0_OFFSET, 0); + + /* GMAC0 is connected to the RMGII interface */ diff --git a/patches/openwrt/0061-ar71xx-Use-private-version-of-ath79_setup_qca955x_et.patch b/patches/openwrt/0061-ar71xx-Use-private-version-of-ath79_setup_qca955x_et.patch new file mode 100644 index 00000000..3567a32f --- /dev/null +++ b/patches/openwrt/0061-ar71xx-Use-private-version-of-ath79_setup_qca955x_et.patch @@ -0,0 +1,58 @@ +From: Sven Eckelmann +Date: Wed, 23 Mar 2016 12:52:09 +0000 +Subject: ar71xx: Use private version of ath79_setup_qca955x_eth_cfg for MR900 + +The MR900 must unset some bits in ETH_CFG which were set by u-boot to work +correctly under OpenWrt. But the global function +ath79_setup_qca955x_eth_cfg will not unset all of them to increase the +backward compatiblity with older mach-* files. A private (simplified) +version for MR900 can be used instead. + +Signed-off-by: Sven Eckelmann + +Backport of r49069 + +Forwarded: https://patchwork.ozlabs.org/patch/624187/ + +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr900.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr900.c +index 3634bf0..b439f58 100644 +--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr900.c ++++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr900.c +@@ -110,6 +110,28 @@ static struct mdio_board_info mr900_mdio0_info[] = { + }, + }; + ++static void __init mr900_setup_qca955x_eth_cfg(u32 mask, ++ unsigned int rxd, ++ unsigned int rxdv, ++ unsigned int txd, ++ unsigned int txe) ++{ ++ void __iomem *base; ++ u32 t; ++ ++ base = ioremap(QCA955X_GMAC_BASE, QCA955X_GMAC_SIZE); ++ ++ t = mask; ++ t |= rxd << QCA955X_ETH_CFG_RXD_DELAY_SHIFT; ++ t |= rxdv << QCA955X_ETH_CFG_RDV_DELAY_SHIFT; ++ t |= txd << QCA955X_ETH_CFG_TXD_DELAY_SHIFT; ++ t |= txe << QCA955X_ETH_CFG_TXE_DELAY_SHIFT; ++ ++ __raw_writel(t, base + QCA955X_GMAC_REG_ETH_CFG); ++ ++ iounmap(base); ++} ++ + static void __init mr900_setup(void) + { + u8 *art = (u8 *)KSEG1ADDR(0x1fff0000); +@@ -139,7 +161,7 @@ static void __init mr900_setup(void) + } + pdata->use_eeprom = true; + +- ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN); ++ mr900_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN, 3, 3, 0, 0); + ath79_register_mdio(0, 0x0); + + mdiobus_register_board_info(mr900_mdio0_info, diff --git a/patches/openwrt/0062-ar71xx-Use-private-version-of-ath79_setup_qca955x_et.patch b/patches/openwrt/0062-ar71xx-Use-private-version-of-ath79_setup_qca955x_et.patch new file mode 100644 index 00000000..8ea16499 --- /dev/null +++ b/patches/openwrt/0062-ar71xx-Use-private-version-of-ath79_setup_qca955x_et.patch @@ -0,0 +1,58 @@ +From: Sven Eckelmann +Date: Wed, 23 Mar 2016 12:52:12 +0000 +Subject: ar71xx: Use private version of ath79_setup_qca955x_eth_cfg for MR1750 + +The MR1750 must unset some bits in ETH_CFG which were set by u-boot to work +correctly under OpenWrt. But the global function +ath79_setup_qca955x_eth_cfg will not unset all of them to increase the +backward compatiblity with older mach-* files. A private (simplified) +version for MR1750 can be used instead. + +Signed-off-by: Sven Eckelmann + +Backport of r49070 + +Forwarded: https://patchwork.ozlabs.org/patch/624188/ + +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c +index f9e45bd..e3c04e7 100644 +--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c ++++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c +@@ -108,6 +108,28 @@ static struct mdio_board_info mr1750_mdio0_info[] = { + }, + }; + ++static void __init mr1750_setup_qca955x_eth_cfg(u32 mask, ++ unsigned int rxd, ++ unsigned int rxdv, ++ unsigned int txd, ++ unsigned int txe) ++{ ++ void __iomem *base; ++ u32 t; ++ ++ base = ioremap(QCA955X_GMAC_BASE, QCA955X_GMAC_SIZE); ++ ++ t = mask; ++ t |= rxd << QCA955X_ETH_CFG_RXD_DELAY_SHIFT; ++ t |= rxdv << QCA955X_ETH_CFG_RDV_DELAY_SHIFT; ++ t |= txd << QCA955X_ETH_CFG_TXD_DELAY_SHIFT; ++ t |= txe << QCA955X_ETH_CFG_TXE_DELAY_SHIFT; ++ ++ __raw_writel(t, base + QCA955X_GMAC_REG_ETH_CFG); ++ ++ iounmap(base); ++} ++ + static void __init mr1750_setup(void) + { + u8 *art = (u8 *)KSEG1ADDR(0x1fff0000); +@@ -129,7 +151,7 @@ static void __init mr1750_setup(void) + ath79_register_wmac(art + MR1750_WMAC_CALDATA_OFFSET, mac); + ath79_register_pci(); + +- ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN); ++ mr1750_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN, 3, 3, 0, 0); + ath79_register_mdio(0, 0x0); + + mdiobus_register_board_info(mr1750_mdio0_info, diff --git a/patches/openwrt/0063-scripts-om-fwupgradecfg-gen.sh-Fix-u-boot-image-md5s.patch b/patches/openwrt/0063-scripts-om-fwupgradecfg-gen.sh-Fix-u-boot-image-md5s.patch new file mode 100644 index 00000000..30658cdb --- /dev/null +++ b/patches/openwrt/0063-scripts-om-fwupgradecfg-gen.sh-Fix-u-boot-image-md5s.patch @@ -0,0 +1,43 @@ +From: Sven Eckelmann +Date: Mon, 14 Sep 2015 20:10:10 +0000 +Subject: scripts/om-fwupgradecfg-gen.sh: Fix u-boot image md5sum check + +The u-boot on Open Mesh devices checks the whole transfered image against a +md5sum. This is stored inside the option filemd5sum inside the +fwupgrade.cfg. The bootloader will not check it when this setting is +missing and could therefore write invalid images to the flash. + +Signed-off-by: Sven Eckelmann + +Backport of r46925 + +Forwarded: https://patchwork.ozlabs.org/patch/624189/ + +diff --git a/scripts/om-fwupgradecfg-gen.sh b/scripts/om-fwupgradecfg-gen.sh +index c790214..fab1582 100644 +--- a/scripts/om-fwupgradecfg-gen.sh ++++ b/scripts/om-fwupgradecfg-gen.sh +@@ -48,6 +48,7 @@ ROOTFS_FLASH_ADDR=$(addr=$(($KERNEL_FLASH_ADDR + ($KERNEL_PART_SIZE * 1024))); p + ROOTFS_SIZE=$(stat -c%s "$ROOTFS_PATH") + ROOTFS_CHECK_BLOCKS=$((($ROOTFS_SIZE / $CHECK_BS) - $MD5_SKIP_BLOCKS)) + ROOTFS_MD5=$(md5=$(dd if=$ROOTFS_PATH bs=$CHECK_BS count=$ROOTFS_CHECK_BLOCKS 2>&- | md5sum); echo ${md5%% *}) ++ROOTFS_MD5_FULL=$(md5=$(md5sum $ROOTFS_PATH); echo ${md5%% *}) + ROOTFS_CHECK_SIZE=$(printf '0x%x' $(($ROOTFS_CHECK_BLOCKS * $CHECK_BS))) + ROOTFS_PART_SIZE=$(($MAX_PART_SIZE - $KERNEL_PART_SIZE)) + +@@ -55,6 +56,7 @@ cat << EOF > $CFG_OUT + [vmlinux] + filename=kernel + md5sum=$KERNEL_MD5 ++filemd5sum=$KERNEL_MD5 + flashaddr=$KERNEL_FLASH_ADDR + checksize=0x0 + cmd_success=setenv bootseq 1,2; setenv kernel_size_1 $KERNEL_PART_SIZE; saveenv +@@ -63,6 +65,7 @@ cmd_fail=reset + [rootfs] + filename=rootfs + md5sum=$ROOTFS_MD5 ++filemd5sum=$ROOTFS_MD5_FULL + flashaddr=$ROOTFS_FLASH_ADDR + checksize=$ROOTFS_CHECK_SIZE + cmd_success=setenv bootseq 1,2; setenv kernel_size_1 $KERNEL_PART_SIZE; setenv rootfs_size_1 $ROOTFS_PART_SIZE; saveenv diff --git a/patches/openwrt/0064-scripts-om-fwupgradecfg-gen.sh-Generate-sha256sum-fo.patch b/patches/openwrt/0064-scripts-om-fwupgradecfg-gen.sh-Generate-sha256sum-fo.patch new file mode 100644 index 00000000..01bb37b5 --- /dev/null +++ b/patches/openwrt/0064-scripts-om-fwupgradecfg-gen.sh-Generate-sha256sum-fo.patch @@ -0,0 +1,50 @@ +From: Sven Eckelmann +Date: Sat, 9 Apr 2016 10:25:42 +0000 +Subject: scripts/om-fwupgradecfg-gen.sh: Generate sha256sum for uboot verification + +Future Open Mesh u-boot versions are changing the check of the image files +(vmlinux, rootfs) from md5 to sha256. Having both in them should be enough +to ensure backward and forward compatibility. + +Signed-off-by: Sven Eckelmann + +Backport of r49140 + +Forwarded: https://patchwork.ozlabs.org/patch/624190/ + +diff --git a/scripts/om-fwupgradecfg-gen.sh b/scripts/om-fwupgradecfg-gen.sh +index fab1582..e208e6d 100644 +--- a/scripts/om-fwupgradecfg-gen.sh ++++ b/scripts/om-fwupgradecfg-gen.sh +@@ -42,6 +42,7 @@ CHECK_BS=65536 + + KERNEL_SIZE=$(stat -c%s "$KERNEL_PATH") + KERNEL_MD5=$(md5=$(md5sum $KERNEL_PATH); echo ${md5%% *}) ++KERNEL_SHA256=$(openssl dgst -sha256 $KERNEL_PATH | awk '{print $2}') + KERNEL_PART_SIZE=$(size=$(($KERNEL_SIZE / $FLASH_BS)); [ $(($size * $FLASH_BS)) -lt $KERNEL_SIZE ] && size=$(($size + 1)); echo $(($size * $FLASH_BS / 1024))) + + ROOTFS_FLASH_ADDR=$(addr=$(($KERNEL_FLASH_ADDR + ($KERNEL_PART_SIZE * 1024))); printf "0x%x" $addr) +@@ -49,6 +50,7 @@ ROOTFS_SIZE=$(stat -c%s "$ROOTFS_PATH") + ROOTFS_CHECK_BLOCKS=$((($ROOTFS_SIZE / $CHECK_BS) - $MD5_SKIP_BLOCKS)) + ROOTFS_MD5=$(md5=$(dd if=$ROOTFS_PATH bs=$CHECK_BS count=$ROOTFS_CHECK_BLOCKS 2>&- | md5sum); echo ${md5%% *}) + ROOTFS_MD5_FULL=$(md5=$(md5sum $ROOTFS_PATH); echo ${md5%% *}) ++ROOTFS_SHA256_FULL=$(openssl dgst -sha256 $ROOTFS_PATH | awk '{print $2}') + ROOTFS_CHECK_SIZE=$(printf '0x%x' $(($ROOTFS_CHECK_BLOCKS * $CHECK_BS))) + ROOTFS_PART_SIZE=$(($MAX_PART_SIZE - $KERNEL_PART_SIZE)) + +@@ -57,6 +59,7 @@ cat << EOF > $CFG_OUT + filename=kernel + md5sum=$KERNEL_MD5 + filemd5sum=$KERNEL_MD5 ++filesha256sum=$KERNEL_SHA256 + flashaddr=$KERNEL_FLASH_ADDR + checksize=0x0 + cmd_success=setenv bootseq 1,2; setenv kernel_size_1 $KERNEL_PART_SIZE; saveenv +@@ -66,6 +69,7 @@ cmd_fail=reset + filename=rootfs + md5sum=$ROOTFS_MD5 + filemd5sum=$ROOTFS_MD5_FULL ++filesha256sum=$ROOTFS_SHA256_FULL + flashaddr=$ROOTFS_FLASH_ADDR + checksize=$ROOTFS_CHECK_SIZE + cmd_success=setenv bootseq 1,2; setenv kernel_size_1 $KERNEL_PART_SIZE; setenv rootfs_size_1 $ROOTFS_PART_SIZE; saveenv diff --git a/patches/openwrt/0065-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-AC-b.patch b/patches/openwrt/0065-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-AC-b.patch new file mode 100644 index 00000000..f3f8b253 --- /dev/null +++ b/patches/openwrt/0065-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-AC-b.patch @@ -0,0 +1,265 @@ +From: Sven Eckelmann +Date: Sat, 9 Apr 2016 10:25:47 +0000 +Subject: ar71xx: add kernel support for the OpenMesh OM5P-AC board + +Signed-off-by: Sven Eckelmann + +Backport of r49141 + +Forwarded: https://patchwork.ozlabs.org/patch/624191/ + +diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18 +index c5a3c9a..dd89357 100644 +--- a/target/linux/ar71xx/config-3.18 ++++ b/target/linux/ar71xx/config-3.18 +@@ -91,6 +91,7 @@ CONFIG_ATH79_MACH_NBG460N=y + CONFIG_ATH79_MACH_NBG6716=y + CONFIG_ATH79_MACH_OM2P=y + CONFIG_ATH79_MACH_OM5P=y ++CONFIG_ATH79_MACH_OM5P_AC=y + CONFIG_ATH79_MACH_ONION_OMEGA=y + CONFIG_ATH79_MACH_PB42=y + CONFIG_ATH79_MACH_PB44=y +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-om5pac.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-om5pac.c +new file mode 100644 +index 0000000..f6974af +--- /dev/null ++++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-om5pac.c +@@ -0,0 +1,193 @@ ++/* ++ * OpenMesh OM5P-AC support ++ * ++ * Copyright (C) 2013 Marek Lindner ++ * Copyright (C) 2014 Sven Eckelmann ++ * ++ * 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 ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include "common.h" ++#include "dev-ap9x-pci.h" ++#include "dev-eth.h" ++#include "dev-leds-gpio.h" ++#include "dev-m25p80.h" ++#include "dev-wmac.h" ++#include "machtypes.h" ++#include "pci.h" ++ ++#define OM5PAC_GPIO_LED_POWER 18 ++#define OM5PAC_GPIO_LED_GREEN 21 ++#define OM5PAC_GPIO_LED_RED 23 ++#define OM5PAC_GPIO_LED_YELLOW 22 ++#define OM5PAC_GPIO_LED_LAN 20 ++#define OM5PAC_GPIO_LED_WAN 19 ++#define OM5PAC_GPIO_I2C_SCL 12 ++#define OM5PAC_GPIO_I2C_SDA 11 ++ ++#define OM5PAC_KEYS_POLL_INTERVAL 20 /* msecs */ ++#define OM5PAC_KEYS_DEBOUNCE_INTERVAL (3 * OM5PAC_KEYS_POLL_INTERVAL) ++ ++#define OM5PAC_WMAC_CALDATA_OFFSET 0x1000 ++ ++static struct gpio_led om5pac_leds_gpio[] __initdata = { ++ { ++ .name = "om5pac:blue:power", ++ .gpio = OM5PAC_GPIO_LED_POWER, ++ .active_low = 1, ++ }, { ++ .name = "om5pac:red:wifi", ++ .gpio = OM5PAC_GPIO_LED_RED, ++ .active_low = 1, ++ }, { ++ .name = "om5pac:yellow:wifi", ++ .gpio = OM5PAC_GPIO_LED_YELLOW, ++ .active_low = 1, ++ }, { ++ .name = "om5pac:green:wifi", ++ .gpio = OM5PAC_GPIO_LED_GREEN, ++ .active_low = 1, ++ }, { ++ .name = "om5pac:blue:lan", ++ .gpio = OM5PAC_GPIO_LED_LAN, ++ .active_low = 1, ++ }, { ++ .name = "om5pac:blue:wan", ++ .gpio = OM5PAC_GPIO_LED_WAN, ++ .active_low = 1, ++ } ++}; ++ ++static struct flash_platform_data om5pac_flash_data = { ++ .type = "mx25l12805d", ++}; ++ ++static struct i2c_gpio_platform_data om5pac_i2c_device_platdata = { ++ .sda_pin = OM5PAC_GPIO_I2C_SDA, ++ .scl_pin = OM5PAC_GPIO_I2C_SCL, ++ .udelay = 10, ++ .sda_is_open_drain = 1, ++ .scl_is_open_drain = 1, ++}; ++ ++static struct platform_device om5pac_i2c_device = { ++ .name = "i2c-gpio", ++ .id = 0, ++ .dev = { ++ .platform_data = &om5pac_i2c_device_platdata, ++ }, ++}; ++ ++static struct i2c_board_info om5pac_i2c_devs[] __initdata = { ++ { ++ I2C_BOARD_INFO("tmp423", 0x4c), ++ }, ++}; ++ ++static struct at803x_platform_data om5pac_at803x_data = { ++ .disable_smarteee = 1, ++ .enable_rgmii_rx_delay = 1, ++ .enable_rgmii_tx_delay = 1, ++}; ++ ++static struct mdio_board_info om5pac_mdio0_info[] = { ++ { ++ .bus_id = "ag71xx-mdio.0", ++ .phy_addr = 1, ++ .platform_data = &om5pac_at803x_data, ++ }, ++ { ++ .bus_id = "ag71xx-mdio.0", ++ .phy_addr = 2, ++ .platform_data = &om5pac_at803x_data, ++ }, ++}; ++ ++static void __init om5p_ac_setup_qca955x_eth_cfg(u32 mask, ++ unsigned int rxd, ++ unsigned int rxdv, ++ unsigned int txd, ++ unsigned int txe) ++{ ++ void __iomem *base; ++ u32 t; ++ ++ base = ioremap(QCA955X_GMAC_BASE, QCA955X_GMAC_SIZE); ++ ++ t = mask; ++ t |= rxd << QCA955X_ETH_CFG_RXD_DELAY_SHIFT; ++ t |= rxdv << QCA955X_ETH_CFG_RDV_DELAY_SHIFT; ++ t |= txd << QCA955X_ETH_CFG_TXD_DELAY_SHIFT; ++ t |= txe << QCA955X_ETH_CFG_TXE_DELAY_SHIFT; ++ ++ __raw_writel(t, base + QCA955X_GMAC_REG_ETH_CFG); ++ ++ iounmap(base); ++} ++ ++static void __init om5p_ac_setup(void) ++{ ++ u8 *art = (u8 *)KSEG1ADDR(0x1fff0000); ++ u8 mac[6]; ++ ++ /* temperature sensor */ ++ platform_device_register(&om5pac_i2c_device); ++ i2c_register_board_info(0, om5pac_i2c_devs, ++ ARRAY_SIZE(om5pac_i2c_devs)); ++ ++ ath79_gpio_output_select(OM5PAC_GPIO_LED_WAN, QCA955X_GPIO_OUT_GPIO); ++ ++ ath79_register_m25p80(&om5pac_flash_data); ++ ath79_register_leds_gpio(-1, ARRAY_SIZE(om5pac_leds_gpio), ++ om5pac_leds_gpio); ++ ++ ath79_init_mac(mac, art, 0x02); ++ ath79_register_wmac(art + OM5PAC_WMAC_CALDATA_OFFSET, mac); ++ ++ om5p_ac_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN, 3, 3, 0, 0); ++ ath79_register_mdio(0, 0x0); ++ ++ mdiobus_register_board_info(om5pac_mdio0_info, ++ ARRAY_SIZE(om5pac_mdio0_info)); ++ ++ ath79_init_mac(ath79_eth0_data.mac_addr, art, 0x00); ++ ath79_init_mac(ath79_eth1_data.mac_addr, art, 0x01); ++ ++ /* GMAC0 is connected to the PHY1 */ ++ ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII; ++ ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; ++ ath79_eth0_data.phy_mask = BIT(1); ++ ath79_eth0_pll_data.pll_1000 = 0x82000101; ++ ath79_eth0_pll_data.pll_100 = 0x80000101; ++ ath79_eth0_pll_data.pll_10 = 0x80001313; ++ ath79_register_eth(0); ++ ++ /* GMAC1 is connected to MDIO1 in SGMII mode */ ++ ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_SGMII; ++ ath79_eth1_data.mii_bus_dev = &ath79_mdio0_device.dev; ++ ath79_eth1_data.phy_mask = BIT(2); ++ ath79_eth1_pll_data.pll_1000 = 0x03000101; ++ ath79_eth1_pll_data.pll_100 = 0x80000101; ++ ath79_eth1_pll_data.pll_10 = 0x80001313; ++ ath79_eth1_data.speed = SPEED_1000; ++ ath79_eth1_data.duplex = DUPLEX_FULL; ++ ath79_register_eth(1); ++ ++ ath79_register_pci(); ++} ++ ++MIPS_MACHINE(ATH79_MACH_OM5P_AC, "OM5P-AC", "OpenMesh OM5P AC", om5p_ac_setup); +diff --git a/target/linux/ar71xx/patches-3.18/815-MIPS-ath79-add-om5pac-support.patch b/target/linux/ar71xx/patches-3.18/815-MIPS-ath79-add-om5pac-support.patch +new file mode 100644 +index 0000000..4accd03 +--- /dev/null ++++ b/target/linux/ar71xx/patches-3.18/815-MIPS-ath79-add-om5pac-support.patch +@@ -0,0 +1,38 @@ ++--- a/arch/mips/ath79/Kconfig +++++ b/arch/mips/ath79/Kconfig ++@@ -799,6 +799,15 @@ config ATH79_MACH_OM5P ++ select ATH79_DEV_M25P80 ++ select ATH79_DEV_WMAC ++ +++config ATH79_MACH_OM5P_AC +++ bool "OpenMesh OM5P-AC board support" +++ select SOC_QCA955X +++ select ATH79_DEV_AP9X_PCI if PCI +++ select ATH79_DEV_ETH +++ select ATH79_DEV_LEDS_GPIO +++ select ATH79_DEV_M25P80 +++ select ATH79_DEV_WMAC +++ ++ config ATH79_MACH_ONION_OMEGA ++ bool "ONION OMEGA support" ++ select SOC_AR933X ++--- a/arch/mips/ath79/Makefile +++++ b/arch/mips/ath79/Makefile ++@@ -100,6 +100,7 @@ obj-$(CONFIG_ATH79_MACH_MZK_W300NH) += m ++ obj-$(CONFIG_ATH79_MACH_NBG460N) += mach-nbg460n.o ++ obj-$(CONFIG_ATH79_MACH_OM2P) += mach-om2p.o ++ obj-$(CONFIG_ATH79_MACH_OM5P) += mach-om5p.o +++obj-$(CONFIG_ATH79_MACH_OM5P_AC) += mach-om5pac.o ++ obj-$(CONFIG_ATH79_MACH_ONION_OMEGA) += mach-onion-omega.o ++ obj-$(CONFIG_ATH79_MACH_PB42) += mach-pb42.o ++ obj-$(CONFIG_ATH79_MACH_PB44) += mach-pb44.o ++--- a/arch/mips/ath79/machtypes.h +++++ b/arch/mips/ath79/machtypes.h ++@@ -95,6 +95,7 @@ enum ath79_mach_type { ++ ATH79_MACH_OM2P_LC, /* OpenMesh OM2P-LC */ ++ ATH79_MACH_OM2Pv2, /* OpenMesh OM2Pv2 */ ++ ATH79_MACH_OM2P, /* OpenMesh OM2P */ +++ ATH79_MACH_OM5P_AC, /* OpenMesh OM5P-AC */ ++ ATH79_MACH_OM5P_AN, /* OpenMesh OM5P-AN */ ++ ATH79_MACH_OM5P, /* OpenMesh OM5P */ ++ ATH79_MACH_ONION_OMEGA, /* ONION OMEGA */ diff --git a/patches/openwrt/0066-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-.patch b/patches/openwrt/0066-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-.patch new file mode 100644 index 00000000..7161fdca --- /dev/null +++ b/patches/openwrt/0066-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-.patch @@ -0,0 +1,54 @@ +From: Sven Eckelmann +Date: Sat, 9 Apr 2016 10:25:51 +0000 +Subject: ar71xx: add user-space support for the OpenMesh OM5P-AC + +Signed-off-by: Sven Eckelmann + +Backport of r49142 + +Forwarded: https://patchwork.ozlabs.org/patch/624192/ + +diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh +index 44d2ddf..a4051f2 100644 +--- a/target/linux/ar71xx/base-files/etc/diag.sh ++++ b/target/linux/ar71xx/base-files/etc/diag.sh +@@ -178,6 +178,9 @@ get_status_led() { + om5p-an) + status_led="om5p:blue:power" + ;; ++ om5p-ac) ++ status_led="om5pac:blue:power" ++ ;; + onion-omega) + status_led="onion:amber:system" + ;; +diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds +index c451124..9a768cd 100644 +--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds ++++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds +@@ -304,6 +304,11 @@ om5p-an) + ucidef_set_led_netdev "port2" "port2" "om5p:blue:lan" "eth1" + ;; + ++om5p-ac) ++ ucidef_set_led_netdev "port1" "port1" "om5pac:blue:lan" "eth0" ++ ucidef_set_led_netdev "port2" "port2" "om5pac:blue:wan" "eth1" ++ ;; ++ + qihoo-c301) + ucidef_set_led_wlan "wlan2g" "WLAN2G" "qihoo:red:status" "phy1tpt" + ;; +diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh +index 587d029..10b8048 100755 +--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh ++++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh +@@ -616,6 +616,9 @@ ar71xx_board_detect() { + *"OM5P AN") + name="om5p-an" + ;; ++ *"OM5P AC") ++ name="om5p-ac" ++ ;; + *"Onion Omega") + name="onion-omega" + ;; diff --git a/patches/openwrt/0067-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-O.patch b/patches/openwrt/0067-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-O.patch new file mode 100644 index 00000000..4b6311e2 --- /dev/null +++ b/patches/openwrt/0067-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-O.patch @@ -0,0 +1,32 @@ +From: Sven Eckelmann +Date: Sat, 9 Apr 2016 10:25:54 +0000 +Subject: scripts/om-fwupgradecfg-gen.sh: add support for the OM5P-AC + +Signed-off-by: Sven Eckelmann + +Backport of r49143 + +Forwarded: https://patchwork.ozlabs.org/patch/624193/ + +diff --git a/scripts/om-fwupgradecfg-gen.sh b/scripts/om-fwupgradecfg-gen.sh +index e208e6d..6c3b74c 100644 +--- a/scripts/om-fwupgradecfg-gen.sh ++++ b/scripts/om-fwupgradecfg-gen.sh +@@ -7,7 +7,7 @@ + # + + usage() { +- echo "Usage: $0 " ++ echo "Usage: $0 " + rm -f $CFG_OUT + exit 1 + } +@@ -26,7 +26,7 @@ case $CE_TYPE in + FLASH_BS=262144 + MD5_SKIP_BLOCKS=1 + ;; +- OM5P|MR600|MR900|MR1750) ++ OM5P|OM5PAC|MR600|MR900|MR1750) + MAX_PART_SIZE=7808 + KERNEL_FLASH_ADDR=0xb0000 + FLASH_BS=65536 diff --git a/patches/openwrt/0068-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM5P-AC.patch b/patches/openwrt/0068-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM5P-AC.patch new file mode 100644 index 00000000..ae08198a --- /dev/null +++ b/patches/openwrt/0068-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM5P-AC.patch @@ -0,0 +1,59 @@ +From: Sven Eckelmann +Date: Sat, 9 Apr 2016 10:25:57 +0000 +Subject: ar71xx: enable sysupgrade for the OpenMesh OM5P-AC + +Signed-off-by: Sven Eckelmann + +Backport of r49144 + +Forwarded: https://patchwork.ozlabs.org/patch/624194/ + +diff --git a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh +index 9ca0f5b..1cfead9 100644 +--- a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh ++++ b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh +@@ -72,6 +72,11 @@ platform_check_image_openmesh() + echo "Invalid image board target ($img_board_target) for this platform: $board. Use the correct image for this platform" + return 1 + ;; ++ OM5PAC) ++ [ "$board" = "om5p-ac" ] && break ++ echo "Invalid image board target ($img_board_target) for this platform: $board. Use the correct image for this platform" ++ return 1 ++ ;; + MR1750) + [ "$board" = "mr1750" ] && break + echo "Invalid image board target ($img_board_target) for this platform: $board. Use the correct image for this platform" +@@ -162,7 +167,7 @@ platform_do_upgrade_openmesh() + kernel_start_addr1=0x9f1c0000 + kernel_start_addr2=0x9f8c0000 + ;; +- OM5P|MR600|MR900|MR1750) ++ OM5P|OM5PAC|MR600|MR900|MR1750) + block_size=$((64 * 1024)) + total_size=7995392 + kernel_start_addr1=0x9f0b0000 +diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +index ac060ea..67c0661 100755 +--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh ++++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +@@ -307,7 +307,8 @@ platform_check_image() { + om2p-hsv2 | \ + om2p-lc | \ + om5p | \ +- om5p-an) ++ om5p-an | \ ++ om5p-ac) + platform_check_image_openmesh "$magic_long" "$1" && return 0 + return 1 + ;; +@@ -540,7 +541,8 @@ platform_do_upgrade() { + om2p-hsv2 | \ + om2p-lc | \ + om5p | \ +- om5p-an) ++ om5p-an | \ ++ om5p-ac) + platform_do_upgrade_openmesh "$ARGV" + ;; + unifi-outdoor-plus | \ diff --git a/patches/openwrt/0069-om-watchdog-add-OpenMesh-OM5P-AC-support.patch b/patches/openwrt/0069-om-watchdog-add-OpenMesh-OM5P-AC-support.patch new file mode 100644 index 00000000..c2d2e225 --- /dev/null +++ b/patches/openwrt/0069-om-watchdog-add-OpenMesh-OM5P-AC-support.patch @@ -0,0 +1,24 @@ +From: Sven Eckelmann +Date: Sat, 9 Apr 2016 10:26:01 +0000 +Subject: om-watchdog: add OpenMesh OM5P-AC support + +Signed-off-by: Sven Eckelmann + +Backport of r49145 + +Forwarded: https://patchwork.ozlabs.org/patch/624195/ + +diff --git a/package/kernel/om-watchdog/files/om-watchdog.init b/package/kernel/om-watchdog/files/om-watchdog.init +index c792968..8cec13b 100644 +--- a/package/kernel/om-watchdog/files/om-watchdog.init ++++ b/package/kernel/om-watchdog/files/om-watchdog.init +@@ -22,6 +22,9 @@ boot() { + "om5p"|"om5p-an") + service_start /sbin/om-watchdog 11 + ;; ++ "om5p-ac") ++ service_start /sbin/om-watchdog 17 ++ ;; + "mr600v2") + service_start /sbin/om-watchdog 15 + ;; diff --git a/patches/openwrt/0070-uboot-envtools-add-OpenMesh-OM5P-AC-support.patch b/patches/openwrt/0070-uboot-envtools-add-OpenMesh-OM5P-AC-support.patch new file mode 100644 index 00000000..0d7b312e --- /dev/null +++ b/patches/openwrt/0070-uboot-envtools-add-OpenMesh-OM5P-AC-support.patch @@ -0,0 +1,22 @@ +From: Sven Eckelmann +Date: Sat, 9 Apr 2016 10:26:04 +0000 +Subject: uboot-envtools: add OpenMesh OM5P-AC support + +Signed-off-by: Sven Eckelmann + +Backport of r49146 + +Forwarded: https://patchwork.ozlabs.org/patch/624196/ + +diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx +index ef00f17..657b25f 100644 +--- a/package/boot/uboot-envtools/files/ar71xx ++++ b/package/boot/uboot-envtools/files/ar71xx +@@ -28,6 +28,7 @@ mr900 | \ + mr900v2 | \ + nbg6716 | \ + om5p-an | \ ++om5p-ac | \ + om5p | \ + tube2h | \ + wndr3700) diff --git a/patches/openwrt/0071-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMes.patch b/patches/openwrt/0071-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMes.patch new file mode 100644 index 00000000..0cd9fec5 --- /dev/null +++ b/patches/openwrt/0071-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMes.patch @@ -0,0 +1,25 @@ +From: Sven Eckelmann +Date: Sat, 9 Apr 2016 10:26:08 +0000 +Subject: ar71xx: extract ath10k wifi board.bin for the OpenMesh OM5P-AC board + +Signed-off-by: Sven Eckelmann + +Backport of r49147 + +Forwarded: https://patchwork.ozlabs.org/patch/624197/ + +diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +index cde7aaf..c1f4b85 100644 +--- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata ++++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +@@ -96,6 +96,10 @@ case "$FIRMWARE" in + rb-911g-5hpacd) + ath10kcal_from_file "/sys/firmware/routerboot/ext_wlan_data" 20480 2116 + ;; ++ om5p-ac) ++ ath10kcal_extract "ART" 20480 2116 ++ ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16) ++ ;; + esac + ;; + *) diff --git a/patches/openwrt/0072-ar71xx-create-profile-and-build-image-for-the-OpenMe.patch b/patches/openwrt/0072-ar71xx-create-profile-and-build-image-for-the-OpenMe.patch new file mode 100644 index 00000000..ce03a85f --- /dev/null +++ b/patches/openwrt/0072-ar71xx-create-profile-and-build-image-for-the-OpenMe.patch @@ -0,0 +1,53 @@ +From: Sven Eckelmann +Date: Sat, 9 Apr 2016 10:26:11 +0000 +Subject: ar71xx: create profile and build image for the OpenMesh OM5P-AC board + +Signed-off-by: Sven Eckelmann + +Backport of r49148 + +Forwarded: https://patchwork.ozlabs.org/patch/624198/ + +diff --git a/target/linux/ar71xx/generic/profiles/openmesh.mk b/target/linux/ar71xx/generic/profiles/openmesh.mk +index 06cf135..64aaa24 100644 +--- a/target/linux/ar71xx/generic/profiles/openmesh.mk ++++ b/target/linux/ar71xx/generic/profiles/openmesh.mk +@@ -27,6 +27,17 @@ endef + + $(eval $(call Profile,OM5P)) + ++define Profile/OM5PAC ++ NAME:=OpenMesh OM5P-AC ++ PACKAGES:=kmod-ath9k kmod-ath10k om-watchdog ath10k-firmware-qca988x ++endef ++ ++define Profile/OM5PAC/Description ++ Package set optimized for the OpenMesh OM5P-AC. ++endef ++ ++$(eval $(call Profile,OM5PAC)) ++ + define Profile/MR600 + NAME:=OpenMesh MR600 + PACKAGES:=kmod-ath9k om-watchdog +diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile +index b74aa45..06dbb77 100644 +--- a/target/linux/ar71xx/image/Makefile ++++ b/target/linux/ar71xx/image/Makefile +@@ -2043,6 +2043,7 @@ $(eval $(call SingleProfile,Netgear,64kraw,WPN824N,wpn824n,WPN824N,ttyS0,115200, + + $(eval $(call SingleProfile,OpenMesh,squashfs-only,OM2P,om2p,,,,OM2P)) + $(eval $(call SingleProfile,OpenMesh,squashfs-only,OM5P,om5p,,,,OM5P)) ++$(eval $(call SingleProfile,OpenMesh,squashfs-only,OM5PAC,om5pac,,,,OM5PAC)) + $(eval $(call SingleProfile,OpenMesh,squashfs-only,MR600,mr600,,,,MR600)) + $(eval $(call SingleProfile,OpenMesh,squashfs-only,MR900,mr900,,,,MR900)) + $(eval $(call SingleProfile,OpenMesh,squashfs-only,MR1750,mr1750,,,,MR1750)) +@@ -2139,7 +2140,7 @@ $(eval $(call MultiProfile,AP121,AP121_2M AP121_4M)) + $(eval $(call MultiProfile,DIR615IX,DIR615I1 DIR615I3)) + $(eval $(call MultiProfile,AP136,AP136_010 AP136_020)) + $(eval $(call MultiProfile,EWDORIN, EWDORINAP EWDORINRT EWDORIN16M)) +-$(eval $(call MultiProfile,OPENMESH,OM2P OM5P MR600 MR900 MR1750)) ++$(eval $(call MultiProfile,OPENMESH,OM2P OM5P OM5PAC MR600 MR900 MR1750)) + $(eval $(call MultiProfile,TEW652BRP,TEW652BRP_FW TEW652BRP_RECOVERY)) + $(eval $(call MultiProfile,TLMR3220,TLMR3220V1)) + $(eval $(call MultiProfile,TLMR3420,TLMR3420V1)) diff --git a/patches/openwrt/0073-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-ACv2.patch b/patches/openwrt/0073-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-ACv2.patch new file mode 100644 index 00000000..d2e2cd60 --- /dev/null +++ b/patches/openwrt/0073-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-ACv2.patch @@ -0,0 +1,289 @@ +From: Sven Eckelmann +Date: Sat, 9 Apr 2016 10:26:15 +0000 +Subject: ar71xx: add kernel support for the OpenMesh OM5P-ACv2 board + +Signed-off-by: Sven Eckelmann + +Backport of r49149 + +Forwarded: https://patchwork.ozlabs.org/patch/624199/ + +diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18 +index dd89357..514f7d5 100644 +--- a/target/linux/ar71xx/config-3.18 ++++ b/target/linux/ar71xx/config-3.18 +@@ -92,6 +92,7 @@ CONFIG_ATH79_MACH_NBG6716=y + CONFIG_ATH79_MACH_OM2P=y + CONFIG_ATH79_MACH_OM5P=y + CONFIG_ATH79_MACH_OM5P_AC=y ++CONFIG_ATH79_MACH_OM5P_ACv2=y + CONFIG_ATH79_MACH_ONION_OMEGA=y + CONFIG_ATH79_MACH_PB42=y + CONFIG_ATH79_MACH_PB44=y +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-om5pacv2.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-om5pacv2.c +new file mode 100644 +index 0000000..587ca32 +--- /dev/null ++++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-om5pacv2.c +@@ -0,0 +1,216 @@ ++/* ++ * OpenMesh OM5P-ACv2 support ++ * ++ * Copyright (C) 2013 Marek Lindner ++ * Copyright (C) 2014-2016 Sven Eckelmann ++ * Copyright (C) 2015 Open-Mesh - Jim Collar ++ * ++ * 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 ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include "common.h" ++#include "dev-ap9x-pci.h" ++#include "dev-eth.h" ++#include "dev-gpio-buttons.h" ++#include "dev-leds-gpio.h" ++#include "dev-m25p80.h" ++#include "dev-wmac.h" ++#include "machtypes.h" ++#include "pci.h" ++ ++#define OM5PACV2_GPIO_LED_POWER 14 ++#define OM5PACV2_GPIO_LED_GREEN 13 ++#define OM5PACV2_GPIO_LED_RED 23 ++#define OM5PACV2_GPIO_LED_YELLOW 15 ++#define OM5PACV2_GPIO_BTN_RESET 1 ++#define OM5PACV2_GPIO_I2C_SCL 18 ++#define OM5PACV2_GPIO_I2C_SDA 19 ++#define OM5PACV2_GPIO_PA_DCDC 2 ++#define OM5PACV2_GPIO_PA_HIGH 16 ++ ++#define OM5PACV2_KEYS_POLL_INTERVAL 20 /* msecs */ ++#define OM5PACV2_KEYS_DEBOUNCE_INTERVAL (3 * OM5PACV2_KEYS_POLL_INTERVAL) ++ ++#define OM5PACV2_WMAC_CALDATA_OFFSET 0x1000 ++ ++static struct gpio_led om5pacv2_leds_gpio[] __initdata = { ++ { ++ .name = "om5pac:blue:power", ++ .gpio = OM5PACV2_GPIO_LED_POWER, ++ .active_low = 1, ++ }, { ++ .name = "om5pac:red:wifi", ++ .gpio = OM5PACV2_GPIO_LED_RED, ++ .active_low = 1, ++ }, { ++ .name = "om5pac:yellow:wifi", ++ .gpio = OM5PACV2_GPIO_LED_YELLOW, ++ .active_low = 1, ++ }, { ++ .name = "om5pac:green:wifi", ++ .gpio = OM5PACV2_GPIO_LED_GREEN, ++ .active_low = 1, ++ } ++}; ++ ++static struct gpio_keys_button om5pacv2_gpio_keys[] __initdata = { ++ { ++ .desc = "reset", ++ .type = EV_KEY, ++ .code = KEY_RESTART, ++ .debounce_interval = OM5PACV2_KEYS_DEBOUNCE_INTERVAL, ++ .gpio = OM5PACV2_GPIO_BTN_RESET, ++ .active_low = 1, ++ } ++}; ++ ++static struct i2c_gpio_platform_data om5pacv2_i2c_device_platdata = { ++ .sda_pin = OM5PACV2_GPIO_I2C_SDA, ++ .scl_pin = OM5PACV2_GPIO_I2C_SCL, ++ .udelay = 10, ++ .sda_is_open_drain = 1, ++ .scl_is_open_drain = 1, ++}; ++ ++static struct platform_device om5pacv2_i2c_device = { ++ .name = "i2c-gpio", ++ .id = 0, ++ .dev = { ++ .platform_data = &om5pacv2_i2c_device_platdata, ++ }, ++}; ++ ++static struct i2c_board_info om5pacv2_i2c_devs[] __initdata = { ++ { ++ I2C_BOARD_INFO("tmp423", 0x4e), ++ }, ++}; ++ ++static struct flash_platform_data om5pacv2_flash_data = { ++ .type = "mx25l12805d", ++}; ++ ++static struct at803x_platform_data om5pacv2_an_at803x_data = { ++ .disable_smarteee = 1, ++ .enable_rgmii_rx_delay = 1, ++ .enable_rgmii_tx_delay = 1, ++}; ++ ++static struct at803x_platform_data om5pacv2_an_at8031_data = { ++ .disable_smarteee = 1, ++ .enable_rgmii_rx_delay = 1, ++ .enable_rgmii_tx_delay = 1, ++}; ++ ++static struct mdio_board_info om5pacv2_an_mdio0_info[] = { ++ { ++ .bus_id = "ag71xx-mdio.0", ++ .phy_addr = 4, ++ .platform_data = &om5pacv2_an_at803x_data, ++ }, ++ { ++ .bus_id = "ag71xx-mdio.1", ++ .phy_addr = 1, ++ .platform_data = &om5pacv2_an_at8031_data, ++ }, ++}; ++ ++static void __init om5p_acv2_setup_qca955x_eth_cfg(u32 mask, ++ unsigned int rxd, ++ unsigned int rxdv, ++ unsigned int txd, ++ unsigned int txe) ++{ ++ void __iomem *base; ++ u32 t; ++ ++ base = ioremap(QCA955X_GMAC_BASE, QCA955X_GMAC_SIZE); ++ ++ t = mask; ++ t |= rxd << QCA955X_ETH_CFG_RXD_DELAY_SHIFT; ++ t |= rxdv << QCA955X_ETH_CFG_RDV_DELAY_SHIFT; ++ t |= txd << QCA955X_ETH_CFG_TXD_DELAY_SHIFT; ++ t |= txe << QCA955X_ETH_CFG_TXE_DELAY_SHIFT; ++ ++ __raw_writel(t, base + QCA955X_GMAC_REG_ETH_CFG); ++ ++ iounmap(base); ++} ++ ++static void __init om5p_acv2_setup(void) ++{ ++ u8 *art = (u8 *)KSEG1ADDR(0x1fff0000); ++ u8 mac[6]; ++ ++ /* power amplifier high power, 4.2V at RFFM4203/4503 instead of 3.3 */ ++ ath79_gpio_function_enable(QCA955X_GPIO_FUNC_JTAG_DISABLE); ++ ath79_gpio_output_select(OM5PACV2_GPIO_PA_DCDC, QCA955X_GPIO_OUT_GPIO); ++ ath79_gpio_output_select(OM5PACV2_GPIO_PA_HIGH, QCA955X_GPIO_OUT_GPIO); ++ gpio_request_one(OM5PACV2_GPIO_PA_DCDC, GPIOF_OUT_INIT_HIGH, ++ "PA DC/DC"); ++ gpio_request_one(OM5PACV2_GPIO_PA_HIGH, GPIOF_OUT_INIT_HIGH, "PA HIGH"); ++ ++ /* temperature sensor */ ++ platform_device_register(&om5pacv2_i2c_device); ++ i2c_register_board_info(0, om5pacv2_i2c_devs, ++ ARRAY_SIZE(om5pacv2_i2c_devs)); ++ ++ ath79_register_m25p80(&om5pacv2_flash_data); ++ ath79_register_leds_gpio(-1, ARRAY_SIZE(om5pacv2_leds_gpio), ++ om5pacv2_leds_gpio); ++ ath79_register_gpio_keys_polled(-1, OM5PACV2_KEYS_POLL_INTERVAL, ++ ARRAY_SIZE(om5pacv2_gpio_keys), ++ om5pacv2_gpio_keys); ++ ++ ath79_init_mac(mac, art, 0x02); ++ ath79_register_wmac(art + OM5PACV2_WMAC_CALDATA_OFFSET, mac); ++ ++ om5p_acv2_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN, 2, 2, 0, 0); ++ ath79_register_mdio(0, 0x0); ++ ath79_register_mdio(1, 0x0); ++ ++ mdiobus_register_board_info(om5pacv2_an_mdio0_info, ++ ARRAY_SIZE(om5pacv2_an_mdio0_info)); ++ ++ ath79_init_mac(ath79_eth0_data.mac_addr, art, 0x00); ++ ath79_init_mac(ath79_eth1_data.mac_addr, art, 0x01); ++ ++ /* GMAC0 is connected to the PHY4 */ ++ ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII; ++ ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; ++ ath79_eth0_data.phy_mask = BIT(4); ++ ath79_eth0_pll_data.pll_1000 = 0x82000101; ++ ath79_eth0_pll_data.pll_100 = 0x80000101; ++ ath79_eth0_pll_data.pll_10 = 0x80001313; ++ ath79_register_eth(0); ++ ++ /* GMAC1 is connected to MDIO1 in SGMII mode */ ++ ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_SGMII; ++ ath79_eth1_data.mii_bus_dev = &ath79_mdio1_device.dev; ++ ath79_eth1_data.phy_mask = BIT(1); ++ ath79_eth1_pll_data.pll_1000 = 0x03000101; ++ ath79_eth1_pll_data.pll_100 = 0x80000101; ++ ath79_eth1_pll_data.pll_10 = 0x80001313; ++ ath79_eth1_data.speed = SPEED_1000; ++ ath79_eth1_data.duplex = DUPLEX_FULL; ++ ath79_register_eth(1); ++ ++ ath79_register_pci(); ++} ++ ++MIPS_MACHINE(ATH79_MACH_OM5P_ACv2, "OM5P-ACv2", "OpenMesh OM5P ACv2", om5p_acv2_setup); +diff --git a/target/linux/ar71xx/patches-3.18/816-MIPS-ath79-add-om5pacv-support.patch b/target/linux/ar71xx/patches-3.18/816-MIPS-ath79-add-om5pacv-support.patch +new file mode 100644 +index 0000000..fbbf171 +--- /dev/null ++++ b/target/linux/ar71xx/patches-3.18/816-MIPS-ath79-add-om5pacv-support.patch +@@ -0,0 +1,39 @@ ++--- a/arch/mips/ath79/Kconfig +++++ b/arch/mips/ath79/Kconfig ++@@ -808,6 +808,16 @@ config ATH79_MACH_OM5P_AC ++ select ATH79_DEV_M25P80 ++ select ATH79_DEV_WMAC ++ +++config ATH79_MACH_OM5P_ACv2 +++ bool "OpenMesh OM5P-ACv2 board support" +++ select SOC_QCA955X +++ select ATH79_DEV_AP9X_PCI if PCI +++ select ATH79_DEV_ETH +++ select ATH79_DEV_GPIO_BUTTONS +++ select ATH79_DEV_LEDS_GPIO +++ select ATH79_DEV_M25P80 +++ select ATH79_DEV_WMAC +++ ++ config ATH79_MACH_ONION_OMEGA ++ bool "ONION OMEGA support" ++ select SOC_AR933X ++--- a/arch/mips/ath79/Makefile +++++ b/arch/mips/ath79/Makefile ++@@ -101,6 +101,7 @@ obj-$(CONFIG_ATH79_MACH_NBG460N) += mach ++ obj-$(CONFIG_ATH79_MACH_OM2P) += mach-om2p.o ++ obj-$(CONFIG_ATH79_MACH_OM5P) += mach-om5p.o ++ obj-$(CONFIG_ATH79_MACH_OM5P_AC) += mach-om5pac.o +++obj-$(CONFIG_ATH79_MACH_OM5P_ACv2) += mach-om5pacv2.o ++ obj-$(CONFIG_ATH79_MACH_ONION_OMEGA) += mach-onion-omega.o ++ obj-$(CONFIG_ATH79_MACH_PB42) += mach-pb42.o ++ obj-$(CONFIG_ATH79_MACH_PB44) += mach-pb44.o ++--- a/arch/mips/ath79/machtypes.h +++++ b/arch/mips/ath79/machtypes.h ++@@ -96,6 +96,7 @@ enum ath79_mach_type { ++ ATH79_MACH_OM2Pv2, /* OpenMesh OM2Pv2 */ ++ ATH79_MACH_OM2P, /* OpenMesh OM2P */ ++ ATH79_MACH_OM5P_AC, /* OpenMesh OM5P-AC */ +++ ATH79_MACH_OM5P_ACv2, /* OpenMesh OM5P-ACv2 */ ++ ATH79_MACH_OM5P_AN, /* OpenMesh OM5P-AN */ ++ ATH79_MACH_OM5P, /* OpenMesh OM5P */ ++ ATH79_MACH_ONION_OMEGA, /* ONION OMEGA */ diff --git a/patches/openwrt/0074-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-.patch b/patches/openwrt/0074-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-.patch new file mode 100644 index 00000000..2ea0cb6a --- /dev/null +++ b/patches/openwrt/0074-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-.patch @@ -0,0 +1,38 @@ +From: Sven Eckelmann +Date: Sat, 9 Apr 2016 10:26:18 +0000 +Subject: ar71xx: add user-space support for the OpenMesh OM5P-ACv2 + +Signed-off-by: Sven Eckelmann + +Backport of r49150 + +Forwarded: https://patchwork.ozlabs.org/patch/624200/ + +diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh +index a4051f2..d4d8b4e 100644 +--- a/target/linux/ar71xx/base-files/etc/diag.sh ++++ b/target/linux/ar71xx/base-files/etc/diag.sh +@@ -178,7 +178,8 @@ get_status_led() { + om5p-an) + status_led="om5p:blue:power" + ;; +- om5p-ac) ++ om5p-ac | \ ++ om5p-acv2) + status_led="om5pac:blue:power" + ;; + onion-omega) +diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh +index 10b8048..fbf76c8 100755 +--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh ++++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh +@@ -619,6 +619,9 @@ ar71xx_board_detect() { + *"OM5P AC") + name="om5p-ac" + ;; ++ *"OM5P ACv2") ++ name="om5p-acv2" ++ ;; + *"Onion Omega") + name="onion-omega" + ;; diff --git a/patches/openwrt/0075-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM5P-ACv2.patch b/patches/openwrt/0075-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM5P-ACv2.patch new file mode 100644 index 00000000..0c4cf031 --- /dev/null +++ b/patches/openwrt/0075-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM5P-ACv2.patch @@ -0,0 +1,46 @@ +From: Sven Eckelmann +Date: Sat, 9 Apr 2016 10:26:22 +0000 +Subject: ar71xx: enable sysupgrade for the OpenMesh OM5P-ACv2 + +Signed-off-by: Sven Eckelmann + +Backport of r49151 + +Forwarded: https://patchwork.ozlabs.org/patch/624201/ + +diff --git a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh +index 1cfead9..209cdaa 100644 +--- a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh ++++ b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh +@@ -74,6 +74,7 @@ platform_check_image_openmesh() + ;; + OM5PAC) + [ "$board" = "om5p-ac" ] && break ++ [ "$board" = "om5p-acv2" ] && break + echo "Invalid image board target ($img_board_target) for this platform: $board. Use the correct image for this platform" + return 1 + ;; +diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +index 67c0661..4a4c476 100755 +--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh ++++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +@@ -308,7 +308,8 @@ platform_check_image() { + om2p-lc | \ + om5p | \ + om5p-an | \ +- om5p-ac) ++ om5p-ac | \ ++ om5p-acv2) + platform_check_image_openmesh "$magic_long" "$1" && return 0 + return 1 + ;; +@@ -542,7 +543,8 @@ platform_do_upgrade() { + om2p-lc | \ + om5p | \ + om5p-an | \ +- om5p-ac) ++ om5p-ac | \ ++ om5p-acv2) + platform_do_upgrade_openmesh "$ARGV" + ;; + unifi-outdoor-plus | \ diff --git a/patches/openwrt/0076-om-watchdog-add-OpenMesh-OM5P-ACv2-support.patch b/patches/openwrt/0076-om-watchdog-add-OpenMesh-OM5P-ACv2-support.patch new file mode 100644 index 00000000..b3c8c8fc --- /dev/null +++ b/patches/openwrt/0076-om-watchdog-add-OpenMesh-OM5P-ACv2-support.patch @@ -0,0 +1,23 @@ +From: Sven Eckelmann +Date: Sat, 9 Apr 2016 10:26:25 +0000 +Subject: om-watchdog: add OpenMesh OM5P-ACv2 support + +Signed-off-by: Sven Eckelmann + +Backport of r49152 + +Forwarded: https://patchwork.ozlabs.org/patch/624202/ + +diff --git a/package/kernel/om-watchdog/files/om-watchdog.init b/package/kernel/om-watchdog/files/om-watchdog.init +index 8cec13b..6b96966 100644 +--- a/package/kernel/om-watchdog/files/om-watchdog.init ++++ b/package/kernel/om-watchdog/files/om-watchdog.init +@@ -13,7 +13,7 @@ boot() { + local board=$(ar71xx_board_name) + + case "$board" in +- "om2p"|"om2p-hs"|"om2p-hsv2") ++ "om2p"|"om2p-hs"|"om2p-hsv2"|"om5p-acv2") + service_start /sbin/om-watchdog 12 + ;; + "om2pv2"|"om2p-lc") diff --git a/patches/openwrt/0077-uboot-envtools-add-OpenMesh-OM5P-ACv2-support.patch b/patches/openwrt/0077-uboot-envtools-add-OpenMesh-OM5P-ACv2-support.patch new file mode 100644 index 00000000..dd61c6fb --- /dev/null +++ b/patches/openwrt/0077-uboot-envtools-add-OpenMesh-OM5P-ACv2-support.patch @@ -0,0 +1,22 @@ +From: Sven Eckelmann +Date: Sat, 9 Apr 2016 10:26:28 +0000 +Subject: uboot-envtools: add OpenMesh OM5P-ACv2 support + +Signed-off-by: Sven Eckelmann + +Backport of r49153 + +Forwarded: https://patchwork.ozlabs.org/patch/624203/ + +diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx +index 657b25f..9071c11 100644 +--- a/package/boot/uboot-envtools/files/ar71xx ++++ b/package/boot/uboot-envtools/files/ar71xx +@@ -29,6 +29,7 @@ mr900v2 | \ + nbg6716 | \ + om5p-an | \ + om5p-ac | \ ++om5p-acv2 | \ + om5p | \ + tube2h | \ + wndr3700) diff --git a/patches/openwrt/0078-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMes.patch b/patches/openwrt/0078-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMes.patch new file mode 100644 index 00000000..90b634ce --- /dev/null +++ b/patches/openwrt/0078-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMes.patch @@ -0,0 +1,24 @@ +From: Sven Eckelmann +Date: Sat, 9 Apr 2016 10:26:31 +0000 +Subject: ar71xx: extract ath10k wifi board.bin for the OpenMesh OM5P-ACv2 board + +Signed-off-by: Sven Eckelmann + +Backport of r49154 + +Forwarded: https://patchwork.ozlabs.org/patch/624204/ + +diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +index c1f4b85..d925a85 100644 +--- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata ++++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +@@ -71,7 +71,8 @@ case "$FIRMWARE" in + ath10kcal_extract "caldata" 20480 2116 + ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1) + ;; +- mr1750) ++ mr1750 | \ ++ om5p-acv2) + ath10kcal_extract "ART" 20480 2116 + ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16) + ;; diff --git a/patches/openwrt/0079-ar71xx-add-OM5P-ACv2-to-the-OM5P-AC-profile.patch b/patches/openwrt/0079-ar71xx-add-OM5P-ACv2-to-the-OM5P-AC-profile.patch new file mode 100644 index 00000000..d98a115f --- /dev/null +++ b/patches/openwrt/0079-ar71xx-add-OM5P-ACv2-to-the-OM5P-AC-profile.patch @@ -0,0 +1,29 @@ +From: Sven Eckelmann +Date: Sat, 9 Apr 2016 10:26:34 +0000 +Subject: ar71xx: add OM5P-ACv2 to the OM5P-AC profile + +Signed-off-by: Sven Eckelmann + +Backport of r49155 + +Forwarded: https://patchwork.ozlabs.org/patch/624205/ + +diff --git a/target/linux/ar71xx/generic/profiles/openmesh.mk b/target/linux/ar71xx/generic/profiles/openmesh.mk +index 64aaa24..c0919ed 100644 +--- a/target/linux/ar71xx/generic/profiles/openmesh.mk ++++ b/target/linux/ar71xx/generic/profiles/openmesh.mk +@@ -28,12 +28,12 @@ endef + $(eval $(call Profile,OM5P)) + + define Profile/OM5PAC +- NAME:=OpenMesh OM5P-AC ++ NAME:=OpenMesh OM5P-AC/OM5P-ACv2 + PACKAGES:=kmod-ath9k kmod-ath10k om-watchdog ath10k-firmware-qca988x + endef + + define Profile/OM5PAC/Description +- Package set optimized for the OpenMesh OM5P-AC. ++ Package set optimized for the OpenMesh OM5P-AC/OM5P-ACv2. + endef + + $(eval $(call Profile,OM5PAC)) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index f5a57da7..9c322365 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -297,6 +297,10 @@ $(eval $(call GluonModel,OMEGA,onion-omega,onion-omega)) ## OpenMesh +# MR1750 +$(eval $(call GluonProfile,MR1750,om-watchdog uboot-envtools kmod-ath10k ath10k-firmware-qca988x-ct)) +$(eval $(call GluonModel,MR1750,mr1750,openmesh-mr1750)) + # MR600 $(eval $(call GluonProfile,MR600,om-watchdog uboot-envtools)) $(eval $(call GluonModel,MR600,mr600,openmesh-mr600)) @@ -320,6 +324,11 @@ $(eval $(call GluonProfile,OM5P,om-watchdog uboot-envtools)) $(eval $(call GluonModel,OM5P,om5p,openmesh-om5p)) $(eval $(call GluonModelAlias,OM5P,openmesh-om5p,openmesh-om5p-an)) +# OM5P-AC +$(eval $(call GluonProfile,OM5PAC,om-watchdog uboot-envtools kmod-ath10k ath10k-firmware-qca988x-ct)) +$(eval $(call GluonModel,OM5PAC,om5pac,openmesh-om5p-ac)) +$(eval $(call GluonModelAlias,OM5PAC,openmesh-om5p-ac,openmesh-om5p-acv2)) + ## ALFA # Hornet-UB From 101595ead8173bafa8d32a638f308f6876806cee Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Mon, 23 May 2016 17:13:51 +0200 Subject: [PATCH 416/867] ar71xx-generic: Remove extra dash between v2 and OpenMesh device name (#781) The returned name for OpenMesh devices with a an extra vX when calling lua -e 'print(require("platform_info").get_image_name())' doesn't contain a dash between the vX and the device name. Thus the image should also not contain a dash. Signed-off-by: Sven Eckelmann --- targets/ar71xx-generic/profiles.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 1b04068c..07a711bf 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -301,21 +301,21 @@ $(eval $(call GluonModel,OMEGA,onion-omega,onion-omega)) $(eval $(call GluonProfile,MR600,om-watchdog uboot-envtools)) $(eval $(call GluonProfileSysupgradeSuffix,MR600,-squashfs-factory,.bin)) $(eval $(call GluonModel,MR600,mr600,openmesh-mr600)) -$(eval $(call GluonModelAlias,MR600,openmesh-mr600,openmesh-mr600-v2)) +$(eval $(call GluonModelAlias,MR600,openmesh-mr600,openmesh-mr600v2)) # MR900 $(eval $(call GluonProfile,MR900,om-watchdog uboot-envtools)) $(eval $(call GluonProfileSysupgradeSuffix,MR900,-squashfs-factory,.bin)) $(eval $(call GluonModel,MR900,mr900,openmesh-mr900)) -$(eval $(call GluonModelAlias,MR900,openmesh-mr900,openmesh-mr900-v2)) +$(eval $(call GluonModelAlias,MR900,openmesh-mr900,openmesh-mr900v2)) # OM2P $(eval $(call GluonProfile,OM2P,om-watchdog uboot-envtools)) $(eval $(call GluonProfileSysupgradeSuffix,OM2P,-squashfs-factory,.bin)) $(eval $(call GluonModel,OM2P,om2p,openmesh-om2p)) -$(eval $(call GluonModelAlias,OM2P,openmesh-om2p,openmesh-om2p-v2)) +$(eval $(call GluonModelAlias,OM2P,openmesh-om2p,openmesh-om2pv2)) $(eval $(call GluonModelAlias,OM2P,openmesh-om2p,openmesh-om2p-hs)) -$(eval $(call GluonModelAlias,OM2P,openmesh-om2p,openmesh-om2p-hs-v2)) +$(eval $(call GluonModelAlias,OM2P,openmesh-om2p,openmesh-om2p-hsv2)) $(eval $(call GluonModelAlias,OM2P,openmesh-om2p,openmesh-om2p-lc)) # OM5P From 3039ba15a04bc6948dfb20c31af46c639f4b7baa Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Mon, 23 May 2016 21:02:05 +0200 Subject: [PATCH 417/867] docs: Fix path to script detecting the primary mac address (#782) Signed-off-by: Sven Eckelmann --- docs/dev/hardware.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/dev/hardware.rst b/docs/dev/hardware.rst index 3bd62a3d..7f04d93d 100644 --- a/docs/dev/hardware.rst +++ b/docs/dev/hardware.rst @@ -51,7 +51,7 @@ may be defined arbitrarily. On devices with multiple WLAN adapters, care must also be taken that the primary MAC address is configured correctly. ``/lib/gluon/core/sysconfig/primary_mac`` should contain the MAC address which -can be found on a label on most hardware; if it does not, ``/lib/gluon/upgrade/core/initial/001-sysconfig`` +can be found on a label on most hardware; if it does not, ``/lib/gluon/upgrade/010-primary-mac`` in ``gluon-core`` might need a fix. (There have also been cases in which the address was incorrect even on devices with only one WLAN adapter, in these cases an OpenWrt bug was the cause). From 780f7cad2aa04373d42544f55d0905555e63c509 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Mon, 23 May 2016 12:27:12 +0200 Subject: [PATCH 418/867] ar71xx-generic: Use eth0 as OpenMesh primary mac address The OpenMesh devices have a sticker with the eth0 mac address on the bottom. Also all other mac addresses are calculated based on this address. Therefore, it is better to use this as primary mac address instead of the WiFi mac address. Signed-off-by: Sven Eckelmann --- .../gluon-core/files/lib/gluon/upgrade/010-primary-mac | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac b/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac index a913db90..144ee700 100755 --- a/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac +++ b/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac @@ -24,7 +24,15 @@ end if platform.match('ar71xx', 'generic', {'tl-wdr3600', 'tl-wdr4300'}) then table.insert(try_files, 1, '/sys/class/ieee80211/phy1/macaddress') -elseif platform.match('ar71xx', 'generic', {'unifi-outdoor-plus', 'carambola2'}) then +elseif platform.match('ar71xx', 'generic', {'unifi-outdoor-plus', 'carambola2', + 'mr600', 'mr600v2', + 'mr900', 'mr900v2', + 'mr1750', + 'om2p', 'om2pv2', + 'om2p-hs', 'om2p-hsv2', + 'om2p-lc', + 'om5p', 'om5p-an', + 'om5p-ac', 'om5p-acv2'}) then table.insert(try_files, 1, '/sys/class/net/eth0/address') elseif platform.match('ar71xx', 'generic', {'archer-c5', 'archer-c7'}) then table.insert(try_files, 1, '/sys/class/net/eth1/address') From cbb1f804f0780b1c6a6ce2ac57e8f0a7dbba974e Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 19 May 2016 01:07:20 +0200 Subject: [PATCH 419/867] docs, README: Gluon v2016.1.5 --- README.md | 2 +- docs/index.rst | 1 + docs/releases/v2016.1.5.rst | 66 +++++++++++++++++++++++++++++++++++ docs/user/getting_started.rst | 4 +-- 4 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 docs/releases/v2016.1.5.rst diff --git a/README.md b/README.md index 321817b6..3ef1f420 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ the future development of Gluon. 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 v2016.1.4 && make update`. +and switch to one by running `git checkout v2016.1.5 && 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/index.rst b/docs/index.rst index 6123a1e7..242e96bc 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -61,6 +61,7 @@ Releases .. toctree:: :maxdepth: 1 + releases/v2016.1.5 releases/v2016.1.4 releases/v2016.1.3 releases/v2016.1.2 diff --git a/docs/releases/v2016.1.5.rst b/docs/releases/v2016.1.5.rst new file mode 100644 index 00000000..e5ee1a00 --- /dev/null +++ b/docs/releases/v2016.1.5.rst @@ -0,0 +1,66 @@ +Gluon 2016.1.5 +============== + +Added hardware support +~~~~~~~~~~~~~~~~~~~~~~ + +ar71xx-generic +^^^^^^^^^^^^^^ + +* OpenMesh + + - MR600 (v1, v2) + - MR900 (v1, v2) + - OM2P (v1, v2) + - OM2P-HS (v1, v2) + - OM2P-LC + - OM5P + - OM5P-AN + +* Ubiquiti + + - Rocket M XW + +* TP-LINK + + - TL-WR841N/ND v11 + +Bugfixes +~~~~~~~~ + +* build: fix race condition caused by using certain make targets (like *clean*, *images* or *package/\**) + with parallel build options without doing a full build before +* build: fix package dependency issue causing "recursive dependency" warning + + This dependency issue could lead to broken configurations and reportedly caused failed builds in some cases + when additional (site-specific) packages were used. +* build: Gluon will now build correctly with GCC 6 as host compiler +* Fix configuration of batman-adv when VLANs are used on top of IBSS interfaces (regression due to netifd update in :doc:`v2016.1.4`) +* Add back missing ath10k firmware (regression due to mac80211 update in :doc:`v2016.1.4`) +* Gluon can now be used on all supported Ubiquiti AirMAX devices without downgrading to AirOS 5.5.x before + + :doc:`v2016.1.1` added support for most Ubiquiti AirMAX devices with AirOS 5.6.x without downgrading AirOS, + but left some devices (at least some PicoStations and Bullets) with unwritable flash. This issue has been + resolved (`#687 `_). +* Add upgrade script to automatically remove whitespace from configured geolocation + + The new respondd implementation included in :doc:`v2016.1` is stricter about the number format than the + old one and doesn't accept trailing whitespace (so one or both coordinates are missing from the output). + + The Config Mode has been fixed to strip whitespace from numeric fields in new configurations since :doc:`v2016.1.1`. + This still left old configurations, which are now fixed by this script. + +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. + +* 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 API (`#522 `_) + + The current API is inconsistent and will be replaced eventually. The old API will still be supported for a while. diff --git a/docs/user/getting_started.rst b/docs/user/getting_started.rst index abb8f8ba..c7519cf0 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. *v2016.1.4*. Always get Gluon using git and don't try to download it +e.g. *v2016.1.5*. 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. *v2016.1.4*. +version you'd like to checkout, e.g. *v2016.1.5*. :: From 4c09783723ccf7fa7a9d519ebc6ec574a69e065a Mon Sep 17 00:00:00 2001 From: Johannes Rudolph Date: Thu, 26 May 2016 16:46:32 +0200 Subject: [PATCH 420/867] docs: autoupdater's fallback option (#786) --- docs/features/autoupdater.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/features/autoupdater.rst b/docs/features/autoupdater.rst index 873f6097..8c4ca73f 100644 --- a/docs/features/autoupdater.rst +++ b/docs/features/autoupdater.rst @@ -70,5 +70,11 @@ These commands can be used on a node: # Force update check, even when the updater is disabled autoupdater -f + +:: + + # If fallback is true the updater will perform an update only if + # the timespan given by the priority and another 24h have passed + autoupdater --fallback From f7eda9381febd1e1a4f6ab3d0643773878b8fe10 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Litza Date: Fri, 6 May 2016 16:49:00 +0200 Subject: [PATCH 421/867] respondd modules: Use proper formatting of doubles Most doubles that are delivered via respondd have limited input precision, but are converted with up to 17 digits of precision. That can cause ugly blowups like 0.2800000000000001 in the output, which is avoided by specifying better format strings (like "%.2f" in most cases). --- .../gluon-mesh-batman-adv-core/src/respondd.c | 4 +- package/gluon-mesh-vpn-fastd/src/respondd.c | 4 +- package/gluon-node-info/src/respondd.c | 4 +- package/gluon-respondd/src/respondd.c | 17 ++- ...or-custom-format-strings-for-doubles.patch | 108 ++++++++++++++++++ 5 files changed, 130 insertions(+), 7 deletions(-) create mode 100644 patches/openwrt/0080-libjson-c-Add-support-for-custom-format-strings-for-doubles.patch diff --git a/package/gluon-mesh-batman-adv-core/src/respondd.c b/package/gluon-mesh-batman-adv-core/src/respondd.c index f0085457..7c2ac6c7 100644 --- a/package/gluon-mesh-batman-adv-core/src/respondd.c +++ b/package/gluon-mesh-batman-adv-core/src/respondd.c @@ -501,7 +501,9 @@ static struct json_object * get_batadv(void) { 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)); + struct json_object *jso = json_object_new_double(lastseen); + json_object_set_serializer(jso, json_object_double_to_json_string, "%.3f", NULL); + json_object_object_add(obj, "lastseen", jso); json_object_object_add(interface, mac1, obj); } diff --git a/package/gluon-mesh-vpn-fastd/src/respondd.c b/package/gluon-mesh-vpn-fastd/src/respondd.c index 3045c77a..7354783a 100644 --- a/package/gluon-mesh-vpn-fastd/src/respondd.c +++ b/package/gluon-mesh-vpn-fastd/src/respondd.c @@ -192,7 +192,9 @@ static bool get_peer_connection(struct json_object **ret, struct json_object *co 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)); + struct json_object *jso = json_object_new_double(established_time/1000.0); + json_object_set_serializer(jso, json_object_double_to_json_string, "%.3f", NULL); + json_object_object_add(*ret, "established", jso); } else { *ret = NULL; diff --git a/package/gluon-node-info/src/respondd.c b/package/gluon-node-info/src/respondd.c index dfbfd3f8..d74c69e6 100644 --- a/package/gluon-node-info/src/respondd.c +++ b/package/gluon-node-info/src/respondd.c @@ -64,7 +64,9 @@ static struct json_object * get_number(struct uci_context *ctx, struct uci_secti if (*end) return NULL; - return json_object_new_double(d); + struct json_object *jso = json_object_new_double(d); + json_object_set_serializer(jso, json_object_double_to_json_string, "%.8f", NULL); + return jso; } static struct json_object * get_location(struct uci_context *ctx, struct uci_package *p) { diff --git a/package/gluon-respondd/src/respondd.c b/package/gluon-respondd/src/respondd.c index 85006d6f..be3c9a7a 100644 --- a/package/gluon-respondd/src/respondd.c +++ b/package/gluon-respondd/src/respondd.c @@ -107,13 +107,18 @@ static struct json_object * respondd_provider_nodeinfo(void) { static void add_uptime(struct json_object *obj) { FILE *f = fopen("/proc/uptime", "r"); + struct json_object* jso; 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)); + jso = json_object_new_double(uptime); + json_object_set_serializer(jso, json_object_double_to_json_string, "%.2f", NULL); + json_object_object_add(obj, "uptime", jso); + jso = json_object_new_double(idletime); + json_object_set_serializer(jso, json_object_double_to_json_string, "%.2f", NULL); + json_object_object_add(obj, "idletime", jso); } fclose(f); @@ -127,7 +132,9 @@ static void add_loadavg(struct json_object *obj) { 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 *jso = json_object_new_double(loadavg); + json_object_set_serializer(jso, json_object_double_to_json_string, "%.2f", NULL); + json_object_object_add(obj, "loadavg", jso); struct json_object *processes = json_object_new_object(); json_object_object_add(processes, "running", json_object_new_int(proc_running)); @@ -176,7 +183,9 @@ static struct json_object * get_rootfs_usage(void) { if (statfs("/", &s)) return NULL; - return json_object_new_double(1 - (double)s.f_bfree / s.f_blocks); + struct json_object *jso = json_object_new_double(1 - (double)s.f_bfree / s.f_blocks); + json_object_set_serializer(jso, json_object_double_to_json_string, "%.4f", NULL); + return jso; } static struct json_object * respondd_provider_statistics(void) { diff --git a/patches/openwrt/0080-libjson-c-Add-support-for-custom-format-strings-for-doubles.patch b/patches/openwrt/0080-libjson-c-Add-support-for-custom-format-strings-for-doubles.patch new file mode 100644 index 00000000..690d3ebb --- /dev/null +++ b/patches/openwrt/0080-libjson-c-Add-support-for-custom-format-strings-for-doubles.patch @@ -0,0 +1,108 @@ +From: Jan-Philipp Litza +Date: Fri, 6 May 2016 16:44:29 +0200 +Subject: libjson-c: Add support for custom format strings for doubles + +diff --git a/package/libs/libjson-c/patches/002-custom-format-string.patch b/package/libs/libjson-c/patches/002-custom-format-string.patch +new file mode 100644 +index 0000000..2f454c5 +--- /dev/null ++++ b/package/libs/libjson-c/patches/002-custom-format-string.patch +@@ -0,0 +1,98 @@ ++From 21dc5dc92bd56f5f4dc2c90b9ea6bf1e1407714e Mon Sep 17 00:00:00 2001 ++From: Jan-Philipp Litza ++Date: Fri, 6 May 2016 16:12:44 +0200 ++Subject: [PATCH] Export json_object_double_to_json_string() and use custom ++ format string ++BCC: janphilipp@litza.de ++ ++--- ++ json_object.c | 12 ++++++------ ++ json_object.h | 28 ++++++++++++++++++++++++++++ ++ 2 files changed, 34 insertions(+), 6 deletions(-) ++ ++diff --git a/json_object.c b/json_object.c ++index 7d60884..46701e7 100644 ++--- a/json_object.c +++++ b/json_object.c ++@@ -55,7 +55,6 @@ static struct json_object* json_object_new(enum json_type o_type); ++ static json_object_to_json_string_fn json_object_object_to_json_string; ++ static json_object_to_json_string_fn json_object_boolean_to_json_string; ++ static json_object_to_json_string_fn json_object_int_to_json_string; ++-static json_object_to_json_string_fn json_object_double_to_json_string; ++ static json_object_to_json_string_fn json_object_string_to_json_string; ++ static json_object_to_json_string_fn json_object_array_to_json_string; ++ ++@@ -644,10 +643,10 @@ int64_t json_object_get_int64(const struct json_object *jso) ++ ++ /* json_object_double */ ++ ++-static int json_object_double_to_json_string(struct json_object* jso, ++- struct printbuf *pb, ++- int level, ++- int flags) +++int json_object_double_to_json_string(struct json_object* jso, +++ struct printbuf *pb, +++ int level, +++ int flags) ++ { ++ char buf[128], *p, *q; ++ int size; ++@@ -663,7 +662,8 @@ static int json_object_double_to_json_string(struct json_object* jso, ++ else ++ size = snprintf(buf, sizeof(buf), "-Infinity"); ++ else ++- size = snprintf(buf, sizeof(buf), "%.17g", jso->o.c_double); +++ size = snprintf(buf, sizeof(buf), +++ jso->_userdata ? (const char*) jso->_userdata : "%.17g", jso->o.c_double); ++ ++ p = strchr(buf, ','); ++ if (p) { ++diff --git a/json_object.h b/json_object.h ++index 2bce454..a89de44 100644 ++--- a/json_object.h +++++ b/json_object.h ++@@ -614,6 +614,9 @@ extern int64_t json_object_get_int64(const struct json_object *obj); ++ /* double type methods */ ++ ++ /** Create a new empty json_object of type json_type_double +++ * +++ * @see json_object_double_to_json_string() for how to set a custom format string. +++ * ++ * @param d the double ++ * @returns a json_object of type json_type_double ++ */ ++@@ -642,6 +645,31 @@ extern struct json_object* json_object_new_double(double d); ++ */ ++ extern struct json_object* json_object_new_double_s(double d, const char *ds); ++ +++ +++/** Serialize a json_object of type json_type_double to a string. +++ * +++ * This function isn't meant to be called directly. Instead, you can set a +++ * custom format string for the serialization of this double using the +++ * following call (where "%.17g" actually is the default): +++ * +++ * @code +++ * jso = json_object_new_double(d); +++ * json_object_set_serializer(jso, json_object_double_to_json_string, +++ * "%.17g", NULL); +++ * @endcode +++ * +++ * @see printf(3) man page for format strings +++ * +++ * @param jso The json_type_double object that is serialized. +++ * @param pb The destination buffer. +++ * @param level Ignored. +++ * @param flags Ignored. +++ */ +++extern int json_object_double_to_json_string(struct json_object* jso, +++ struct printbuf *pb, +++ int level, +++ int flags); +++ ++ /** Get the double floating point value of a json_object ++ * ++ * The type is coerced to a double if the passed object is not a double. ++-- ++2.7.4 ++ From 22ec5f1c83cd9d920b5a2fe2f97713c019d8754b Mon Sep 17 00:00:00 2001 From: Jan-Tarek Butt Date: Fri, 27 May 2016 00:13:37 +0200 Subject: [PATCH 422/867] docs: fix 404 error for nordwest site repo 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 7f56150d..4a702b3e 100644 --- a/docs/user/site.rst +++ b/docs/user/site.rst @@ -408,7 +408,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-ffka `_ (Karlsruhe) * `site-ffrl `_ (Rheinland) * `site-ffrg `_ (Ruhrgebiet) From 76c3456787e9b7b75e48e19347c19a51333936dd Mon Sep 17 00:00:00 2001 From: Jan-Philipp Litza Date: Fri, 27 May 2016 22:40:17 +0200 Subject: [PATCH 423/867] gluon-node-info: simplify respondd module code a bit --- package/gluon-node-info/src/respondd.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/package/gluon-node-info/src/respondd.c b/package/gluon-node-info/src/respondd.c index d74c69e6..3b0e07dc 100644 --- a/package/gluon-node-info/src/respondd.c +++ b/package/gluon-node-info/src/respondd.c @@ -69,6 +69,12 @@ static struct json_object * get_number(struct uci_context *ctx, struct uci_secti return jso; } +static void maybe_add_number(struct uci_context *ctx, struct uci_section *s, const char *name, struct json_object *parent) { + struct json_object *jso = get_number(ctx, s, name); + if (jso) + json_object_object_add(parent, name, jso); +} + 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) @@ -80,17 +86,9 @@ static struct json_object * get_location(struct uci_context *ctx, struct uci_pac 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); + maybe_add_number(ctx, s, "latitude", ret); + maybe_add_number(ctx, s, "longitude", ret); + maybe_add_number(ctx, s, "altitude", ret); return ret; } From efc004abf2d423983ce5a8b7cae1775c98c8a6b4 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 28 May 2016 16:04:40 +0200 Subject: [PATCH 424/867] scripts/patch: never GPG-sign automated commits, regardless of the default configuration --- scripts/patch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/patch.sh b/scripts/patch.sh index 6b0fa23f..90d2de7b 100755 --- a/scripts/patch.sh +++ b/scripts/patch.sh @@ -12,7 +12,7 @@ for module in $GLUON_MODULES; do git checkout -B patching base for patch in "$GLUONDIR"/patches/$module/*.patch; do - if ! git -c user.name='Gluon Patch Manager' -c user.email='gluon@void.example.com' am --whitespace=nowarn --committer-date-is-author-date "$patch"; then + if ! git -c user.name='Gluon Patch Manager' -c user.email='gluon@void.example.com' -c commit.gpgsign=false am --whitespace=nowarn --committer-date-is-author-date "$patch"; then git am --abort git checkout patched git branch -D patching From 13465e93651859777fb2346c698a7a1d3f34740b Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 28 May 2016 16:06:43 +0200 Subject: [PATCH 425/867] node: downgrade to v0.12.14 Allow to build Gluon with GCC 4.7 (e.g. on Debian Wheezy) as host compiler again. --- .../0005-node-update-to-v0.12.14.patch | 36 ++++++ .../openwrt/0005-node-update-to-v4.4.4.patch | 110 ------------------ ...ur-leading-to-broken-code-with-GCC-6.patch | 20 ++-- 3 files changed, 46 insertions(+), 120 deletions(-) create mode 100644 patches/packages/openwrt/0005-node-update-to-v0.12.14.patch delete mode 100644 patches/packages/openwrt/0005-node-update-to-v4.4.4.patch diff --git a/patches/packages/openwrt/0005-node-update-to-v0.12.14.patch b/patches/packages/openwrt/0005-node-update-to-v0.12.14.patch new file mode 100644 index 00000000..9b03cee4 --- /dev/null +++ b/patches/packages/openwrt/0005-node-update-to-v0.12.14.patch @@ -0,0 +1,36 @@ +From: Matthias Schiffer +Date: Mon, 9 May 2016 15:57:18 +0200 +Subject: node: update to v0.12.14 + +While we're at it, also enable parallel builds. + +Signed-off-by: Matthias Schiffer + +diff --git a/lang/node/Makefile b/lang/node/Makefile +index 243c8a5..e6fe843 100644 +--- a/lang/node/Makefile ++++ b/lang/node/Makefile +@@ -8,17 +8,21 @@ + include $(TOPDIR)/rules.mk + + PKG_NAME:=node +-PKG_VERSION:=v0.12.7 ++PKG_VERSION:=v0.12.14 + PKG_RELEASE:=1 + +-PKG_SOURCE:=node-$(PKG_VERSION).tar.gz ++PKG_SOURCE:=node-$(PKG_VERSION).tar.xz + PKG_SOURCE_URL:=http://nodejs.org/dist/${PKG_VERSION} ++PKG_MD5SUM:=27f1a2cf00af32cbfe9401ca4b1a805f + + HOST_BUILD_DEPENDS:=python/host + PKG_BUILD_DEPENDS:=python/host + PKG_INSTALL:=1 + PKG_USE_MIPS16:=0 + ++HOST_BUILD_PARALLEL:=1 ++PKG_BUILD_PARALLEL:=1 ++ + PKG_MAINTAINER:=John Crispin + PKG_LICENSE:= + diff --git a/patches/packages/openwrt/0005-node-update-to-v4.4.4.patch b/patches/packages/openwrt/0005-node-update-to-v4.4.4.patch deleted file mode 100644 index 8c431944..00000000 --- a/patches/packages/openwrt/0005-node-update-to-v4.4.4.patch +++ /dev/null @@ -1,110 +0,0 @@ -From: Matthias Schiffer -Date: Mon, 9 May 2016 15:57:18 +0200 -Subject: node: update to v4.4.4 - -While we're at it, also enable parallel builds. - -Signed-off-by: Matthias Schiffer - -diff --git a/lang/node/Makefile b/lang/node/Makefile -index 243c8a5..71cf55b 100644 ---- a/lang/node/Makefile -+++ b/lang/node/Makefile -@@ -8,17 +8,21 @@ - include $(TOPDIR)/rules.mk - - PKG_NAME:=node --PKG_VERSION:=v0.12.7 -+PKG_VERSION:=v4.4.4 - PKG_RELEASE:=1 - --PKG_SOURCE:=node-$(PKG_VERSION).tar.gz -+PKG_SOURCE:=node-$(PKG_VERSION).tar.xz - PKG_SOURCE_URL:=http://nodejs.org/dist/${PKG_VERSION} -+PKG_MD5SUM:=1ad7915688df85f62a57f43860dc54c6 - - HOST_BUILD_DEPENDS:=python/host - PKG_BUILD_DEPENDS:=python/host - PKG_INSTALL:=1 - PKG_USE_MIPS16:=0 - -+HOST_BUILD_PARALLEL:=1 -+PKG_BUILD_PARALLEL:=1 -+ - PKG_MAINTAINER:=John Crispin - PKG_LICENSE:= - -@@ -31,7 +35,7 @@ define Package/node - SUBMENU:=Node.js - TITLE:=Node.js is a platform built on Chrome's JavaScript runtime - URL:=http://nodejs.org/ -- DEPENDS:=+libpthread +librt +libstdcpp +libopenssl +libuv -+ DEPENDS:=+libpthread +librt +libstdcpp +libopenssl +libuv +zlib - endef - - define Package/node/description -diff --git a/lang/node/patches/001-hardfloat.patch b/lang/node/patches/001-hardfloat.patch -new file mode 100644 -index 0000000..1bb2493 ---- /dev/null -+++ b/lang/node/patches/001-hardfloat.patch -@@ -0,0 +1,12 @@ -+diff --git a/deps/v8/src/base/cpu.cc b/deps/v8/src/base/cpu.cc -+index 4f58720..1f3071e 100644 -+--- a/deps/v8/src/base/cpu.cc -++++ b/deps/v8/src/base/cpu.cc -+@@ -143,6 +143,7 @@ int __detect_fp64_mode(void) { -+ ".set push\n\t" -+ ".set noreorder\n\t" -+ ".set oddspreg\n\t" -++ ".set hardfloat\n\t" -+ "lui $t0, 0x3FF0\n\t" -+ "ldc1 $f0, %0\n\t" -+ "mtc1 $t0, $f1\n\t" -diff --git a/lang/node/patches/001-mips-no-fpu.patch b/lang/node/patches/001-mips-no-fpu.patch -deleted file mode 100644 -index 5bf8142..0000000 ---- a/lang/node/patches/001-mips-no-fpu.patch -+++ /dev/null -@@ -1,15 +0,0 @@ ----- a/deps/v8/build/toolchain.gypi --+++ b/deps/v8/build/toolchain.gypi --@@ -50,10 +50,10 @@ -- 'arm_test_noprobe%': 'off', -- -- # Similar to vfp but on MIPS. --- 'v8_can_use_fpu_instructions%': 'true', --+ 'v8_can_use_fpu_instructions%': 'false', -- -- # Similar to the ARM hard float ABI but on MIPS. --- 'v8_use_mips_abi_hardfloat%': 'true', --+ 'v8_use_mips_abi_hardfloat%': 'false', -- -- # Default arch variant for MIPS. -- 'mips_arch_variant%': 'r2', -diff --git a/lang/node/patches/002-addr_info.patch b/lang/node/patches/002-addr_info.patch -index 78225db..0aa02da 100644 ---- a/lang/node/patches/002-addr_info.patch -+++ b/lang/node/patches/002-addr_info.patch -@@ -1,6 +1,6 @@ - --- a/deps/uv/src/unix/getaddrinfo.c - +++ b/deps/uv/src/unix/getaddrinfo.c --@@ -99,6 +99,7 @@ -+@@ -99,6 +99,7 @@ static void uv__getaddrinfo_work(struct - int err; - - req = container_of(w, uv_getaddrinfo_t, work_req); -diff --git a/lang/node/patches/003-path.patch b/lang/node/patches/003-path.patch -index 723fe9d..01a71c6 100644 ---- a/lang/node/patches/003-path.patch -+++ b/lang/node/patches/003-path.patch -@@ -1,7 +1,7 @@ - --- a/lib/module.js - +++ b/lib/module.js --@@ -512,7 +512,8 @@ -- var homeDir = process.env.HOME; -+@@ -453,7 +453,8 @@ Module._initPaths = function() { -+ homeDir = process.env.HOME; - } - - - var paths = [path.resolve(process.execPath, '..', '..', 'lib', 'node')]; diff --git a/patches/packages/openwrt/0006-node-fix-undefined-behaviour-leading-to-broken-code-with-GCC-6.patch b/patches/packages/openwrt/0006-node-fix-undefined-behaviour-leading-to-broken-code-with-GCC-6.patch index 12d6bcd2..ae5162e2 100644 --- a/patches/packages/openwrt/0006-node-fix-undefined-behaviour-leading-to-broken-code-with-GCC-6.patch +++ b/patches/packages/openwrt/0006-node-fix-undefined-behaviour-leading-to-broken-code-with-GCC-6.patch @@ -10,15 +10,15 @@ Signed-off-by: Matthias Schiffer diff --git a/lang/node/patches/004-gcc6-undefined-behaviour.patch b/lang/node/patches/004-gcc6-undefined-behaviour.patch new file mode 100644 -index 0000000..11b0132 +index 0000000..dbbbcf0 --- /dev/null +++ b/lang/node/patches/004-gcc6-undefined-behaviour.patch @@ -0,0 +1,64 @@ +diff --git a/deps/v8/src/heap/incremental-marking.cc b/deps/v8/src/heap/incremental-marking.cc -+index 58eb0aa..b2b796f 100644 ++index c922e83..2ead8be 100644 +--- a/deps/v8/src/heap/incremental-marking.cc ++++ b/deps/v8/src/heap/incremental-marking.cc -+@@ -364,7 +364,7 @@ void IncrementalMarking::DeactivateIncrementalWriteBarrier() { ++@@ -379,7 +379,7 @@ void IncrementalMarking::DeactivateIncrementalWriteBarrier() { + DeactivateIncrementalWriteBarrierForSpace(heap_->new_space()); + + LargePage* lop = heap_->lo_space()->first_page(); @@ -27,7 +27,7 @@ index 0000000..11b0132 + SetOldSpacePageFlags(lop, false, false); + lop = lop->next_page(); + } -+@@ -396,7 +396,7 @@ void IncrementalMarking::ActivateIncrementalWriteBarrier() { ++@@ -414,7 +414,7 @@ void IncrementalMarking::ActivateIncrementalWriteBarrier() { + ActivateIncrementalWriteBarrier(heap_->new_space()); + + LargePage* lop = heap_->lo_space()->first_page(); @@ -37,10 +37,10 @@ index 0000000..11b0132 + lop = lop->next_page(); + } +diff --git a/deps/v8/src/heap/spaces-inl.h b/deps/v8/src/heap/spaces-inl.h -+index c2c4d12..d63ee63 100644 ++index 56c2bad..1a45096 100644 +--- a/deps/v8/src/heap/spaces-inl.h ++++ b/deps/v8/src/heap/spaces-inl.h -+@@ -155,7 +155,7 @@ Page* Page::Initialize(Heap* heap, MemoryChunk* chunk, Executability executable, ++@@ -148,7 +148,7 @@ Page* Page::Initialize(Heap* heap, MemoryChunk* chunk, Executability executable, + + bool PagedSpace::Contains(Address addr) { + Page* p = Page::FromAddress(addr); @@ -50,10 +50,10 @@ index 0000000..11b0132 + } + +diff --git a/deps/v8/src/heap/spaces.cc b/deps/v8/src/heap/spaces.cc -+index 0806b25..c0e109b 100644 ++index e197f5a..2fe10eb 100644 +--- a/deps/v8/src/heap/spaces.cc ++++ b/deps/v8/src/heap/spaces.cc -+@@ -2953,7 +2953,7 @@ LargePage* LargeObjectSpace::FindPage(Address a) { ++@@ -2918,7 +2918,7 @@ LargePage* LargeObjectSpace::FindPage(Address a) { + if (e != NULL) { + DCHECK(e->value != NULL); + LargePage* page = reinterpret_cast(e->value); @@ -63,10 +63,10 @@ index 0000000..11b0132 + return page; + } +diff --git a/deps/v8/src/heap/spaces.h b/deps/v8/src/heap/spaces.h -+index 3461de3..e35c057 100644 ++index 312d75f..1054672 100644 +--- a/deps/v8/src/heap/spaces.h ++++ b/deps/v8/src/heap/spaces.h -+@@ -278,9 +278,9 @@ class MemoryChunk { ++@@ -283,9 +283,9 @@ class MemoryChunk { + // Only works for addresses in pointer spaces, not data or code spaces. + static inline MemoryChunk* FromAnyPointerAddress(Heap* heap, Address addr); + From 5c67b4909dea30f2a2232365ededacbe69d54678 Mon Sep 17 00:00:00 2001 From: Metatron321 Date: Fri, 27 May 2016 00:42:34 +0200 Subject: [PATCH 426/867] docs: added site for Regio Aachen --- docs/user/site.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/user/site.rst b/docs/user/site.rst index 4a702b3e..5b439646 100644 --- a/docs/user/site.rst +++ b/docs/user/site.rst @@ -394,6 +394,7 @@ site-repos in the wild This is a non-exhaustive list of site-repos from various communities: * `site-ffa `_ (Altdorf, Landshut & Umgebung) +* `site-ffac `_ (Regio Aachen) * `site-ffbs `_ (Braunschweig) * `site-ffhb `_ (Bremen) * `site-ffda `_ (Darmstadt) From 59d4b3056f87d0a6ae9806f297dc3f945c2d9444 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 29 May 2016 11:59:12 +0200 Subject: [PATCH 427/867] Update patches For some reason, the filenames of the OpenMesh support patches were truncated. --- ...-ar71xx-Generate-sysupgrade-images-for-OpenMesh-devices.patch} | 0 ...ar71xx-add-kernel-support-for-the-OpenMesh-MR1750-board.patch} | 0 ...xx-add-user-space-support-for-the-OpenMesh-MR1750-board.patch} | 0 ...ripts-om-fwupgradecfg-gen.sh-add-support-for-the-MR1750.patch} | 0 ...e-profile-and-build-image-for-the-OpenMesh-MR1750-board.patch} | 0 ...1xx-Extend-the-list-of-bits-in-QCA955X_GMAC_REG_ETH_CFG.patch} | 0 ...5-ar71xx-Use-_eth_cfg-helper-for-Open-Mesh-MR900-boards.patch} | 0 ...ar71xx-Allow-to-use-ath79_gpio_output_select-on-QCA955x.patch} | 0 ...-ar71xx-Add-support-for-ath79_gpio_function_-on-QCA955X.patch} | 0 ...rivate-version-of-ath79_setup_qca955x_eth_cfg-for-MR900.patch} | 0 ...ivate-version-of-ath79_setup_qca955x_eth_cfg-for-MR1750.patch} | 0 ...ts-om-fwupgradecfg-gen.sh-Fix-u-boot-image-md5sum-check.patch} | 0 ...adecfg-gen.sh-Generate-sha256sum-for-uboot-verification.patch} | 0 ...r71xx-add-kernel-support-for-the-OpenMesh-OM5P-AC-board.patch} | 0 ...-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-AC.patch} | 0 ...ipts-om-fwupgradecfg-gen.sh-add-support-for-the-OM5P-AC.patch} | 0 ...ct-ath10k-wifi-board.bin-for-the-OpenMesh-OM5P-AC-board.patch} | 0 ...-profile-and-build-image-for-the-OpenMesh-OM5P-AC-board.patch} | 0 ...1xx-add-kernel-support-for-the-OpenMesh-OM5P-ACv2-board.patch} | 0 ...r71xx-add-user-space-support-for-the-OpenMesh-OM5P-ACv2.patch} | 0 ...-ath10k-wifi-board.bin-for-the-OpenMesh-OM5P-ACv2-board.patch} | 0 21 files changed, 0 insertions(+), 0 deletions(-) rename patches/openwrt/{0046-ar71xx-Generate-sysupgrade-images-for-OpenMesh-devic.patch => 0046-ar71xx-Generate-sysupgrade-images-for-OpenMesh-devices.patch} (100%) rename patches/openwrt/{0047-ar71xx-add-kernel-support-for-the-OpenMesh-MR1750-bo.patch => 0047-ar71xx-add-kernel-support-for-the-OpenMesh-MR1750-board.patch} (100%) rename patches/openwrt/{0048-ar71xx-add-user-space-support-for-the-OpenMesh-MR175.patch => 0048-ar71xx-add-user-space-support-for-the-OpenMesh-MR1750-board.patch} (100%) rename patches/openwrt/{0049-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-M.patch => 0049-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-MR1750.patch} (100%) rename patches/openwrt/{0053-ar71xx-create-profile-and-build-image-for-the-OpenMe.patch => 0053-ar71xx-create-profile-and-build-image-for-the-OpenMesh-MR1750-board.patch} (100%) rename patches/openwrt/{0054-ar71xx-Extend-the-list-of-bits-in-QCA955X_GMAC_REG_E.patch => 0054-ar71xx-Extend-the-list-of-bits-in-QCA955X_GMAC_REG_ETH_CFG.patch} (100%) rename patches/openwrt/{0055-ar71xx-Use-_eth_cfg-helper-for-Open-Mesh-MR900-board.patch => 0055-ar71xx-Use-_eth_cfg-helper-for-Open-Mesh-MR900-boards.patch} (100%) rename patches/openwrt/{0056-ar71xx-Allow-to-use-ath79_gpio_output_select-on-QCA9.patch => 0056-ar71xx-Allow-to-use-ath79_gpio_output_select-on-QCA955x.patch} (100%) rename patches/openwrt/{0057-ar71xx-Add-support-for-ath79_gpio_function_-on-QCA95.patch => 0057-ar71xx-Add-support-for-ath79_gpio_function_-on-QCA955X.patch} (100%) rename patches/openwrt/{0061-ar71xx-Use-private-version-of-ath79_setup_qca955x_et.patch => 0061-ar71xx-Use-private-version-of-ath79_setup_qca955x_eth_cfg-for-MR900.patch} (100%) rename patches/openwrt/{0062-ar71xx-Use-private-version-of-ath79_setup_qca955x_et.patch => 0062-ar71xx-Use-private-version-of-ath79_setup_qca955x_eth_cfg-for-MR1750.patch} (100%) rename patches/openwrt/{0063-scripts-om-fwupgradecfg-gen.sh-Fix-u-boot-image-md5s.patch => 0063-scripts-om-fwupgradecfg-gen.sh-Fix-u-boot-image-md5sum-check.patch} (100%) rename patches/openwrt/{0064-scripts-om-fwupgradecfg-gen.sh-Generate-sha256sum-fo.patch => 0064-scripts-om-fwupgradecfg-gen.sh-Generate-sha256sum-for-uboot-verification.patch} (100%) rename patches/openwrt/{0065-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-AC-b.patch => 0065-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-AC-board.patch} (100%) rename patches/openwrt/{0066-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-.patch => 0066-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-AC.patch} (100%) rename patches/openwrt/{0067-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-O.patch => 0067-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-OM5P-AC.patch} (100%) rename patches/openwrt/{0071-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMes.patch => 0071-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-OM5P-AC-board.patch} (100%) rename patches/openwrt/{0072-ar71xx-create-profile-and-build-image-for-the-OpenMe.patch => 0072-ar71xx-create-profile-and-build-image-for-the-OpenMesh-OM5P-AC-board.patch} (100%) rename patches/openwrt/{0073-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-ACv2.patch => 0073-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-ACv2-board.patch} (100%) rename patches/openwrt/{0074-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-.patch => 0074-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-ACv2.patch} (100%) rename patches/openwrt/{0078-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMes.patch => 0078-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-OM5P-ACv2-board.patch} (100%) diff --git a/patches/openwrt/0046-ar71xx-Generate-sysupgrade-images-for-OpenMesh-devic.patch b/patches/openwrt/0046-ar71xx-Generate-sysupgrade-images-for-OpenMesh-devices.patch similarity index 100% rename from patches/openwrt/0046-ar71xx-Generate-sysupgrade-images-for-OpenMesh-devic.patch rename to patches/openwrt/0046-ar71xx-Generate-sysupgrade-images-for-OpenMesh-devices.patch diff --git a/patches/openwrt/0047-ar71xx-add-kernel-support-for-the-OpenMesh-MR1750-bo.patch b/patches/openwrt/0047-ar71xx-add-kernel-support-for-the-OpenMesh-MR1750-board.patch similarity index 100% rename from patches/openwrt/0047-ar71xx-add-kernel-support-for-the-OpenMesh-MR1750-bo.patch rename to patches/openwrt/0047-ar71xx-add-kernel-support-for-the-OpenMesh-MR1750-board.patch diff --git a/patches/openwrt/0048-ar71xx-add-user-space-support-for-the-OpenMesh-MR175.patch b/patches/openwrt/0048-ar71xx-add-user-space-support-for-the-OpenMesh-MR1750-board.patch similarity index 100% rename from patches/openwrt/0048-ar71xx-add-user-space-support-for-the-OpenMesh-MR175.patch rename to patches/openwrt/0048-ar71xx-add-user-space-support-for-the-OpenMesh-MR1750-board.patch diff --git a/patches/openwrt/0049-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-M.patch b/patches/openwrt/0049-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-MR1750.patch similarity index 100% rename from patches/openwrt/0049-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-M.patch rename to patches/openwrt/0049-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-MR1750.patch diff --git a/patches/openwrt/0053-ar71xx-create-profile-and-build-image-for-the-OpenMe.patch b/patches/openwrt/0053-ar71xx-create-profile-and-build-image-for-the-OpenMesh-MR1750-board.patch similarity index 100% rename from patches/openwrt/0053-ar71xx-create-profile-and-build-image-for-the-OpenMe.patch rename to patches/openwrt/0053-ar71xx-create-profile-and-build-image-for-the-OpenMesh-MR1750-board.patch diff --git a/patches/openwrt/0054-ar71xx-Extend-the-list-of-bits-in-QCA955X_GMAC_REG_E.patch b/patches/openwrt/0054-ar71xx-Extend-the-list-of-bits-in-QCA955X_GMAC_REG_ETH_CFG.patch similarity index 100% rename from patches/openwrt/0054-ar71xx-Extend-the-list-of-bits-in-QCA955X_GMAC_REG_E.patch rename to patches/openwrt/0054-ar71xx-Extend-the-list-of-bits-in-QCA955X_GMAC_REG_ETH_CFG.patch diff --git a/patches/openwrt/0055-ar71xx-Use-_eth_cfg-helper-for-Open-Mesh-MR900-board.patch b/patches/openwrt/0055-ar71xx-Use-_eth_cfg-helper-for-Open-Mesh-MR900-boards.patch similarity index 100% rename from patches/openwrt/0055-ar71xx-Use-_eth_cfg-helper-for-Open-Mesh-MR900-board.patch rename to patches/openwrt/0055-ar71xx-Use-_eth_cfg-helper-for-Open-Mesh-MR900-boards.patch diff --git a/patches/openwrt/0056-ar71xx-Allow-to-use-ath79_gpio_output_select-on-QCA9.patch b/patches/openwrt/0056-ar71xx-Allow-to-use-ath79_gpio_output_select-on-QCA955x.patch similarity index 100% rename from patches/openwrt/0056-ar71xx-Allow-to-use-ath79_gpio_output_select-on-QCA9.patch rename to patches/openwrt/0056-ar71xx-Allow-to-use-ath79_gpio_output_select-on-QCA955x.patch diff --git a/patches/openwrt/0057-ar71xx-Add-support-for-ath79_gpio_function_-on-QCA95.patch b/patches/openwrt/0057-ar71xx-Add-support-for-ath79_gpio_function_-on-QCA955X.patch similarity index 100% rename from patches/openwrt/0057-ar71xx-Add-support-for-ath79_gpio_function_-on-QCA95.patch rename to patches/openwrt/0057-ar71xx-Add-support-for-ath79_gpio_function_-on-QCA955X.patch diff --git a/patches/openwrt/0061-ar71xx-Use-private-version-of-ath79_setup_qca955x_et.patch b/patches/openwrt/0061-ar71xx-Use-private-version-of-ath79_setup_qca955x_eth_cfg-for-MR900.patch similarity index 100% rename from patches/openwrt/0061-ar71xx-Use-private-version-of-ath79_setup_qca955x_et.patch rename to patches/openwrt/0061-ar71xx-Use-private-version-of-ath79_setup_qca955x_eth_cfg-for-MR900.patch diff --git a/patches/openwrt/0062-ar71xx-Use-private-version-of-ath79_setup_qca955x_et.patch b/patches/openwrt/0062-ar71xx-Use-private-version-of-ath79_setup_qca955x_eth_cfg-for-MR1750.patch similarity index 100% rename from patches/openwrt/0062-ar71xx-Use-private-version-of-ath79_setup_qca955x_et.patch rename to patches/openwrt/0062-ar71xx-Use-private-version-of-ath79_setup_qca955x_eth_cfg-for-MR1750.patch diff --git a/patches/openwrt/0063-scripts-om-fwupgradecfg-gen.sh-Fix-u-boot-image-md5s.patch b/patches/openwrt/0063-scripts-om-fwupgradecfg-gen.sh-Fix-u-boot-image-md5sum-check.patch similarity index 100% rename from patches/openwrt/0063-scripts-om-fwupgradecfg-gen.sh-Fix-u-boot-image-md5s.patch rename to patches/openwrt/0063-scripts-om-fwupgradecfg-gen.sh-Fix-u-boot-image-md5sum-check.patch diff --git a/patches/openwrt/0064-scripts-om-fwupgradecfg-gen.sh-Generate-sha256sum-fo.patch b/patches/openwrt/0064-scripts-om-fwupgradecfg-gen.sh-Generate-sha256sum-for-uboot-verification.patch similarity index 100% rename from patches/openwrt/0064-scripts-om-fwupgradecfg-gen.sh-Generate-sha256sum-fo.patch rename to patches/openwrt/0064-scripts-om-fwupgradecfg-gen.sh-Generate-sha256sum-for-uboot-verification.patch diff --git a/patches/openwrt/0065-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-AC-b.patch b/patches/openwrt/0065-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-AC-board.patch similarity index 100% rename from patches/openwrt/0065-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-AC-b.patch rename to patches/openwrt/0065-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-AC-board.patch diff --git a/patches/openwrt/0066-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-.patch b/patches/openwrt/0066-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-AC.patch similarity index 100% rename from patches/openwrt/0066-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-.patch rename to patches/openwrt/0066-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-AC.patch diff --git a/patches/openwrt/0067-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-O.patch b/patches/openwrt/0067-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-OM5P-AC.patch similarity index 100% rename from patches/openwrt/0067-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-O.patch rename to patches/openwrt/0067-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-OM5P-AC.patch diff --git a/patches/openwrt/0071-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMes.patch b/patches/openwrt/0071-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-OM5P-AC-board.patch similarity index 100% rename from patches/openwrt/0071-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMes.patch rename to patches/openwrt/0071-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-OM5P-AC-board.patch diff --git a/patches/openwrt/0072-ar71xx-create-profile-and-build-image-for-the-OpenMe.patch b/patches/openwrt/0072-ar71xx-create-profile-and-build-image-for-the-OpenMesh-OM5P-AC-board.patch similarity index 100% rename from patches/openwrt/0072-ar71xx-create-profile-and-build-image-for-the-OpenMe.patch rename to patches/openwrt/0072-ar71xx-create-profile-and-build-image-for-the-OpenMesh-OM5P-AC-board.patch diff --git a/patches/openwrt/0073-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-ACv2.patch b/patches/openwrt/0073-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-ACv2-board.patch similarity index 100% rename from patches/openwrt/0073-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-ACv2.patch rename to patches/openwrt/0073-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-ACv2-board.patch diff --git a/patches/openwrt/0074-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-.patch b/patches/openwrt/0074-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-ACv2.patch similarity index 100% rename from patches/openwrt/0074-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-.patch rename to patches/openwrt/0074-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-ACv2.patch diff --git a/patches/openwrt/0078-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMes.patch b/patches/openwrt/0078-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-OM5P-ACv2-board.patch similarity index 100% rename from patches/openwrt/0078-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMes.patch rename to patches/openwrt/0078-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-OM5P-ACv2-board.patch From b56b6640e6aab7d35e670acafbcc6e03f7a07bd8 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 29 May 2016 11:58:33 +0200 Subject: [PATCH 428/867] mac80211: backport ath9k GPIO support --- ...s-with-prohibited-blackholed-source.patch} | 0 ...tallation-of-headers-for-host-build.patch} | 0 ...alloc-instead-of-oom-kill-processes.patch} | 0 ...=> 0013-fix-UBNT-XM-model-detection.patch} | 0 ...iles-implemented-basic-GPIO-control.patch} | 0 ...pin-for-Ubiquiti-Nanostation-models.patch} | 0 ...-netifd-update-to-latest-git-master.patch} | 0 ...port_bootpart-for-Xen-virtual-disks.patch} | 0 ...ort-LibreSSL-as-provider-of-openssl.patch} | 0 ...WREV-on-upgrades-of-TP-LINK-devices.patch} | 0 ...-space-on-some-TP-LINK-like-devices.patch} | 0 ...X_MODEL-to-match-labels-image-names.patch} | 0 ...71xx-build-image-for-TL-WR710N-v2.1.patch} | 0 ...gure-compatiblity-with-POSIX-shells.patch} | 0 ...as-only-added-in-the-latest-version.patch} | 0 ...ompile-flock-before-everything-else.patch} | 0 ...fall-back-to-unlocked-shell-command.patch} | 0 ...e-conditions-with-multiple-variants.patch} | 0 ...x-packed-checkout-mirroring-support.patch} | 0 ...-backport-spi-nor-driver-from-4.4.9.patch} | 0 ...il-status-register-writes-are-ready.patch} | 0 ...l-mtd-spi-nor-unlock-Winbond-flashs.patch} | 0 ...ols-pkg-config-fix-build-with-GCC-6.patch} | 0 ...inux-compiler-.h-with-u-boot-master.patch} | 0 ...-toolchain-gcc-fix-build-with-GCC-6.patch} | 0 ...561-set-phy-interface-mode-and-mask.patch} | 0 ...on-register-bitmask-for-QCA956x-SoC.patch} | 0 ... 0037-ar71xx-update-QCA956x-support.patch} | 0 ...r-QCA956x-ethernet.patch-into-files.patch} | 0 ...r71xx-fix-MDIO-bus-probe-on-QCA956x.patch} | 0 ...fix-qca956x-ethernet-initialization.patch} | 0 ...pport-for-Ubiquiti-UniFi-AP-AC-LITE.patch} | 0 ...h0-support-for-Ubiquiti-UniFi-AP-AC.patch} | 0 ...71xx-Rename-unifiac-to-unifiac-lite.patch} | 0 ...upport-for-Ubiquiti-UniFi-AP-AC-PRO.patch} | 0 ...upgrade-images-for-OpenMesh-devices.patch} | 0 ...pport-for-the-OpenMesh-MR1750-board.patch} | 0 ...pport-for-the-OpenMesh-MR1750-board.patch} | 0 ...g-gen.sh-add-support-for-the-MR1750.patch} | 0 ...-sysupgrade-for-the-OpenMesh-MR1750.patch} | 0 ...atchdog-add-OpenMesh-MR1750-support.patch} | 0 ...nvtools-add-OpenMesh-MR1750-support.patch} | 0 ...image-for-the-OpenMesh-MR1750-board.patch} | 0 ...of-bits-in-QCA955X_GMAC_REG_ETH_CFG.patch} | 0 ...g-helper-for-Open-Mesh-MR900-boards.patch} | 0 ...ath79_gpio_output_select-on-QCA955x.patch} | 0 ...for-ath79_gpio_function_-on-QCA955X.patch} | 0 ...X-GPIO-mux-and-function-definitions.patch} | 0 ...-Use-PHY-fixups-for-Open-Mesh-MR900.patch} | 0 ...Use-PHY-fixups-for-Open-Mesh-MR1750.patch} | 0 ...h79_setup_qca955x_eth_cfg-for-MR900.patch} | 0 ...79_setup_qca955x_eth_cfg-for-MR1750.patch} | 0 ...en.sh-Fix-u-boot-image-md5sum-check.patch} | 0 ...te-sha256sum-for-uboot-verification.patch} | 0 ...port-for-the-OpenMesh-OM5P-AC-board.patch} | 0 ...ce-support-for-the-OpenMesh-OM5P-AC.patch} | 0 ...-gen.sh-add-support-for-the-OM5P-AC.patch} | 0 ...sysupgrade-for-the-OpenMesh-OM5P-AC.patch} | 0 ...tchdog-add-OpenMesh-OM5P-AC-support.patch} | 0 ...vtools-add-OpenMesh-OM5P-AC-support.patch} | 0 ....bin-for-the-OpenMesh-OM5P-AC-board.patch} | 0 ...mage-for-the-OpenMesh-OM5P-AC-board.patch} | 0 ...rt-for-the-OpenMesh-OM5P-ACv2-board.patch} | 0 ...-support-for-the-OpenMesh-OM5P-ACv2.patch} | 0 ...supgrade-for-the-OpenMesh-OM5P-ACv2.patch} | 0 ...hdog-add-OpenMesh-OM5P-ACv2-support.patch} | 0 ...ools-add-OpenMesh-OM5P-ACv2-support.patch} | 0 ...in-for-the-OpenMesh-OM5P-ACv2-board.patch} | 0 ...dd-OM5P-ACv2-to-the-OM5P-AC-profile.patch} | 0 ...r-custom-format-strings-for-doubles.patch} | 0 ...-ath9k-enable-platform-WLAN-LED-name.patch | 121 +++ ...-set-default-state-for-platform-LEDs.patch | 47 + ...mac80211-ath9k-enable-access-to-GPIO.patch | 261 ++++++ .../openwrt/0083-mac80211-refresh-patch.patch | 30 + ...4-mac80211-ath9k-enable-GPIO-buttons.patch | 259 ++++++ ...-on-platforms-without-CONFIG_GPIOLIB.patch | 827 ++++++++++++++++++ ...uner-support-for-UniFi-Outdoor-Plus.patch} | 43 +- 77 files changed, 1562 insertions(+), 26 deletions(-) rename patches/openwrt/{0011-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch => 0010-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch} (100%) rename patches/openwrt/{0012-lua-fix-installation-of-headers-for-host-build.patch => 0011-lua-fix-installation-of-headers-for-host-build.patch} (100%) rename patches/openwrt/{0013-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch => 0012-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch} (100%) rename patches/openwrt/{0014-fix-UBNT-XM-model-detection.patch => 0013-fix-UBNT-XM-model-detection.patch} (100%) rename patches/openwrt/{0015-base-files-implemented-basic-GPIO-control.patch => 0014-base-files-implemented-basic-GPIO-control.patch} (100%) rename patches/openwrt/{0016-ar71xx-assign-proper-GPIO-pin-for-Ubiquiti-Nanostation-models.patch => 0015-ar71xx-assign-proper-GPIO-pin-for-Ubiquiti-Nanostation-models.patch} (100%) rename patches/openwrt/{0017-netifd-update-to-latest-git-master.patch => 0016-netifd-update-to-latest-git-master.patch} (100%) rename patches/openwrt/{0018-x86-fix-platform_export_bootpart-for-Xen-virtual-disks.patch => 0017-x86-fix-platform_export_bootpart-for-Xen-virtual-disks.patch} (100%) rename patches/openwrt/{0019-Support-LibreSSL-as-provider-of-openssl.patch => 0018-Support-LibreSSL-as-provider-of-openssl.patch} (100%) rename patches/openwrt/{0020-ar71xx-check-both-HWID-and-HWREV-on-upgrades-of-TP-LINK-devices.patch => 0019-ar71xx-check-both-HWID-and-HWREV-on-upgrades-of-TP-LINK-devices.patch} (100%) rename patches/openwrt/{0021-ar71xx-avoid-AR71XX_MODEL-ending-with-a-space-on-some-TP-LINK-like-devices.patch => 0020-ar71xx-avoid-AR71XX_MODEL-ending-with-a-space-on-some-TP-LINK-like-devices.patch} (100%) rename patches/openwrt/{0022-ar71xx-fix-the-revision-of-a-few-TP-LINK-devices-in-AR71XX_MODEL-to-match-labels-image-names.patch => 0021-ar71xx-fix-the-revision-of-a-few-TP-LINK-devices-in-AR71XX_MODEL-to-match-labels-image-names.patch} (100%) rename patches/openwrt/{0023-ar71xx-build-image-for-TL-WR710N-v2.1.patch => 0022-ar71xx-build-image-for-TL-WR710N-v2.1.patch} (100%) rename patches/openwrt/{0024-xtables-addons-build-fix-configure-compatiblity-with-POSIX-shells.patch => 0023-xtables-addons-build-fix-configure-compatiblity-with-POSIX-shells.patch} (100%) rename patches/openwrt/{0025-tools-add-tar-host-build-required-for-sort-name-which-was-only-added-in-the-latest-version.patch => 0024-tools-add-tar-host-build-required-for-sort-name-which-was-only-added-in-the-latest-version.patch} (100%) rename patches/openwrt/{0026-tools-compile-flock-before-everything-else.patch => 0025-tools-compile-flock-before-everything-else.patch} (100%) rename patches/openwrt/{0027-rules.mk-make-the-locked-template-available-even-if-flock-has-not-been-built-yet-fall-back-to-unlocked-shell-command.patch => 0026-rules.mk-make-the-locked-template-available-even-if-flock-has-not-been-built-yet-fall-back-to-unlocked-shell-command.patch} (100%) rename patches/openwrt/{0028-build-add-locking-for-downloads-fixes-race-conditions-with-multiple-variants.patch => 0027-build-add-locking-for-downloads-fixes-race-conditions-with-multiple-variants.patch} (100%) rename patches/openwrt/{0029-download.mk-fix-packed-checkout-mirroring-support.patch => 0028-download.mk-fix-packed-checkout-mirroring-support.patch} (100%) rename patches/openwrt/{0030-kernel-backport-spi-nor-driver-from-4.4.9.patch => 0029-kernel-backport-spi-nor-driver-from-4.4.9.patch} (100%) rename patches/openwrt/{0031-kernel-mtd-spi-nor-wait-until-status-register-writes-are-ready.patch => 0030-kernel-mtd-spi-nor-wait-until-status-register-writes-are-ready.patch} (100%) rename patches/openwrt/{0032-kernel-mtd-spi-nor-unlock-Winbond-flashs.patch => 0031-kernel-mtd-spi-nor-unlock-Winbond-flashs.patch} (100%) rename patches/openwrt/{0033-tools-pkg-config-fix-build-with-GCC-6.patch => 0032-tools-pkg-config-fix-build-with-GCC-6.patch} (100%) rename patches/openwrt/{0034-tools-mkimage-sync-include-linux-compiler-.h-with-u-boot-master.patch => 0033-tools-mkimage-sync-include-linux-compiler-.h-with-u-boot-master.patch} (100%) rename patches/openwrt/{0035-toolchain-gcc-fix-build-with-GCC-6.patch => 0034-toolchain-gcc-fix-build-with-GCC-6.patch} (100%) rename patches/openwrt/{0036-ath79-dev-eth-fix-QCA9561-set-phy-interface-mode-and-mask.patch => 0035-ath79-dev-eth-fix-QCA9561-set-phy-interface-mode-and-mask.patch} (100%) rename patches/openwrt/{0037-ar71xx-use-correct-PLL-configuration-register-bitmask-for-QCA956x-SoC.patch => 0036-ar71xx-use-correct-PLL-configuration-register-bitmask-for-QCA956x-SoC.patch} (100%) rename patches/openwrt/{0038-ar71xx-update-QCA956x-support.patch => 0037-ar71xx-update-QCA956x-support.patch} (100%) rename patches/openwrt/{0039-ar71xx-fold-patch-622-MIPS-ath79-add-support-for-QCA956x-ethernet.patch-into-files.patch => 0038-ar71xx-fold-patch-622-MIPS-ath79-add-support-for-QCA956x-ethernet.patch-into-files.patch} (100%) rename patches/openwrt/{0040-ar71xx-fix-MDIO-bus-probe-on-QCA956x.patch => 0039-ar71xx-fix-MDIO-bus-probe-on-QCA956x.patch} (100%) rename patches/openwrt/{0041-ar71xx-fix-qca956x-ethernet-initialization.patch => 0040-ar71xx-fix-qca956x-ethernet-initialization.patch} (100%) rename patches/openwrt/{0042-ar71xx-Support-for-Ubiquiti-UniFi-AP-AC-LITE.patch => 0041-ar71xx-Support-for-Ubiquiti-UniFi-AP-AC-LITE.patch} (100%) rename patches/openwrt/{0043-ar71xx-Fix-eth0-support-for-Ubiquiti-UniFi-AP-AC.patch => 0042-ar71xx-Fix-eth0-support-for-Ubiquiti-UniFi-AP-AC.patch} (100%) rename patches/openwrt/{0044-ar71xx-Rename-unifiac-to-unifiac-lite.patch => 0043-ar71xx-Rename-unifiac-to-unifiac-lite.patch} (100%) rename patches/openwrt/{0045-ar71xx-Add-support-for-Ubiquiti-UniFi-AP-AC-PRO.patch => 0044-ar71xx-Add-support-for-Ubiquiti-UniFi-AP-AC-PRO.patch} (100%) rename patches/openwrt/{0046-ar71xx-Generate-sysupgrade-images-for-OpenMesh-devices.patch => 0045-ar71xx-Generate-sysupgrade-images-for-OpenMesh-devices.patch} (100%) rename patches/openwrt/{0047-ar71xx-add-kernel-support-for-the-OpenMesh-MR1750-board.patch => 0046-ar71xx-add-kernel-support-for-the-OpenMesh-MR1750-board.patch} (100%) rename patches/openwrt/{0048-ar71xx-add-user-space-support-for-the-OpenMesh-MR1750-board.patch => 0047-ar71xx-add-user-space-support-for-the-OpenMesh-MR1750-board.patch} (100%) rename patches/openwrt/{0049-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-MR1750.patch => 0048-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-MR1750.patch} (100%) rename patches/openwrt/{0050-ar71xx-enable-sysupgrade-for-the-OpenMesh-MR1750.patch => 0049-ar71xx-enable-sysupgrade-for-the-OpenMesh-MR1750.patch} (100%) rename patches/openwrt/{0051-package-om-watchdog-add-OpenMesh-MR1750-support.patch => 0050-package-om-watchdog-add-OpenMesh-MR1750-support.patch} (100%) rename patches/openwrt/{0052-package-uboot-envtools-add-OpenMesh-MR1750-support.patch => 0051-package-uboot-envtools-add-OpenMesh-MR1750-support.patch} (100%) rename patches/openwrt/{0053-ar71xx-create-profile-and-build-image-for-the-OpenMesh-MR1750-board.patch => 0052-ar71xx-create-profile-and-build-image-for-the-OpenMesh-MR1750-board.patch} (100%) rename patches/openwrt/{0054-ar71xx-Extend-the-list-of-bits-in-QCA955X_GMAC_REG_ETH_CFG.patch => 0053-ar71xx-Extend-the-list-of-bits-in-QCA955X_GMAC_REG_ETH_CFG.patch} (100%) rename patches/openwrt/{0055-ar71xx-Use-_eth_cfg-helper-for-Open-Mesh-MR900-boards.patch => 0054-ar71xx-Use-_eth_cfg-helper-for-Open-Mesh-MR900-boards.patch} (100%) rename patches/openwrt/{0056-ar71xx-Allow-to-use-ath79_gpio_output_select-on-QCA955x.patch => 0055-ar71xx-Allow-to-use-ath79_gpio_output_select-on-QCA955x.patch} (100%) rename patches/openwrt/{0057-ar71xx-Add-support-for-ath79_gpio_function_-on-QCA955X.patch => 0056-ar71xx-Add-support-for-ath79_gpio_function_-on-QCA955X.patch} (100%) rename patches/openwrt/{0058-ar71xx-Add-QCA955X-GPIO-mux-and-function-definitions.patch => 0057-ar71xx-Add-QCA955X-GPIO-mux-and-function-definitions.patch} (100%) rename patches/openwrt/{0059-ar71xx-Use-PHY-fixups-for-Open-Mesh-MR900.patch => 0058-ar71xx-Use-PHY-fixups-for-Open-Mesh-MR900.patch} (100%) rename patches/openwrt/{0060-ar71xx-Use-PHY-fixups-for-Open-Mesh-MR1750.patch => 0059-ar71xx-Use-PHY-fixups-for-Open-Mesh-MR1750.patch} (100%) rename patches/openwrt/{0061-ar71xx-Use-private-version-of-ath79_setup_qca955x_eth_cfg-for-MR900.patch => 0060-ar71xx-Use-private-version-of-ath79_setup_qca955x_eth_cfg-for-MR900.patch} (100%) rename patches/openwrt/{0062-ar71xx-Use-private-version-of-ath79_setup_qca955x_eth_cfg-for-MR1750.patch => 0061-ar71xx-Use-private-version-of-ath79_setup_qca955x_eth_cfg-for-MR1750.patch} (100%) rename patches/openwrt/{0063-scripts-om-fwupgradecfg-gen.sh-Fix-u-boot-image-md5sum-check.patch => 0062-scripts-om-fwupgradecfg-gen.sh-Fix-u-boot-image-md5sum-check.patch} (100%) rename patches/openwrt/{0064-scripts-om-fwupgradecfg-gen.sh-Generate-sha256sum-for-uboot-verification.patch => 0063-scripts-om-fwupgradecfg-gen.sh-Generate-sha256sum-for-uboot-verification.patch} (100%) rename patches/openwrt/{0065-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-AC-board.patch => 0064-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-AC-board.patch} (100%) rename patches/openwrt/{0066-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-AC.patch => 0065-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-AC.patch} (100%) rename patches/openwrt/{0067-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-OM5P-AC.patch => 0066-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-OM5P-AC.patch} (100%) rename patches/openwrt/{0068-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM5P-AC.patch => 0067-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM5P-AC.patch} (100%) rename patches/openwrt/{0069-om-watchdog-add-OpenMesh-OM5P-AC-support.patch => 0068-om-watchdog-add-OpenMesh-OM5P-AC-support.patch} (100%) rename patches/openwrt/{0070-uboot-envtools-add-OpenMesh-OM5P-AC-support.patch => 0069-uboot-envtools-add-OpenMesh-OM5P-AC-support.patch} (100%) rename patches/openwrt/{0071-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-OM5P-AC-board.patch => 0070-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-OM5P-AC-board.patch} (100%) rename patches/openwrt/{0072-ar71xx-create-profile-and-build-image-for-the-OpenMesh-OM5P-AC-board.patch => 0071-ar71xx-create-profile-and-build-image-for-the-OpenMesh-OM5P-AC-board.patch} (100%) rename patches/openwrt/{0073-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-ACv2-board.patch => 0072-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-ACv2-board.patch} (100%) rename patches/openwrt/{0074-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-ACv2.patch => 0073-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-ACv2.patch} (100%) rename patches/openwrt/{0075-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM5P-ACv2.patch => 0074-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM5P-ACv2.patch} (100%) rename patches/openwrt/{0076-om-watchdog-add-OpenMesh-OM5P-ACv2-support.patch => 0075-om-watchdog-add-OpenMesh-OM5P-ACv2-support.patch} (100%) rename patches/openwrt/{0077-uboot-envtools-add-OpenMesh-OM5P-ACv2-support.patch => 0076-uboot-envtools-add-OpenMesh-OM5P-ACv2-support.patch} (100%) rename patches/openwrt/{0078-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-OM5P-ACv2-board.patch => 0077-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-OM5P-ACv2-board.patch} (100%) rename patches/openwrt/{0079-ar71xx-add-OM5P-ACv2-to-the-OM5P-AC-profile.patch => 0078-ar71xx-add-OM5P-ACv2-to-the-OM5P-AC-profile.patch} (100%) rename patches/openwrt/{0080-libjson-c-Add-support-for-custom-format-strings-for-doubles.patch => 0079-libjson-c-Add-support-for-custom-format-strings-for-doubles.patch} (100%) create mode 100644 patches/openwrt/0080-mac80211-ath9k-enable-platform-WLAN-LED-name.patch create mode 100644 patches/openwrt/0081-mac80211-ath9k-set-default-state-for-platform-LEDs.patch create mode 100644 patches/openwrt/0082-mac80211-ath9k-enable-access-to-GPIO.patch create mode 100644 patches/openwrt/0083-mac80211-refresh-patch.patch create mode 100644 patches/openwrt/0084-mac80211-ath9k-enable-GPIO-buttons.patch create mode 100644 patches/openwrt/0085-mac80211-rework-gpio-chip-button-support-to-build-on-platforms-without-CONFIG_GPIOLIB.patch rename patches/openwrt/{0010-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch => 0086-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch} (93%) diff --git a/patches/openwrt/0011-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch b/patches/openwrt/0010-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch similarity index 100% rename from patches/openwrt/0011-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch rename to patches/openwrt/0010-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch diff --git a/patches/openwrt/0012-lua-fix-installation-of-headers-for-host-build.patch b/patches/openwrt/0011-lua-fix-installation-of-headers-for-host-build.patch similarity index 100% rename from patches/openwrt/0012-lua-fix-installation-of-headers-for-host-build.patch rename to patches/openwrt/0011-lua-fix-installation-of-headers-for-host-build.patch diff --git a/patches/openwrt/0013-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch b/patches/openwrt/0012-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch similarity index 100% rename from patches/openwrt/0013-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch rename to patches/openwrt/0012-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch diff --git a/patches/openwrt/0014-fix-UBNT-XM-model-detection.patch b/patches/openwrt/0013-fix-UBNT-XM-model-detection.patch similarity index 100% rename from patches/openwrt/0014-fix-UBNT-XM-model-detection.patch rename to patches/openwrt/0013-fix-UBNT-XM-model-detection.patch diff --git a/patches/openwrt/0015-base-files-implemented-basic-GPIO-control.patch b/patches/openwrt/0014-base-files-implemented-basic-GPIO-control.patch similarity index 100% rename from patches/openwrt/0015-base-files-implemented-basic-GPIO-control.patch rename to patches/openwrt/0014-base-files-implemented-basic-GPIO-control.patch diff --git a/patches/openwrt/0016-ar71xx-assign-proper-GPIO-pin-for-Ubiquiti-Nanostation-models.patch b/patches/openwrt/0015-ar71xx-assign-proper-GPIO-pin-for-Ubiquiti-Nanostation-models.patch similarity index 100% rename from patches/openwrt/0016-ar71xx-assign-proper-GPIO-pin-for-Ubiquiti-Nanostation-models.patch rename to patches/openwrt/0015-ar71xx-assign-proper-GPIO-pin-for-Ubiquiti-Nanostation-models.patch diff --git a/patches/openwrt/0017-netifd-update-to-latest-git-master.patch b/patches/openwrt/0016-netifd-update-to-latest-git-master.patch similarity index 100% rename from patches/openwrt/0017-netifd-update-to-latest-git-master.patch rename to patches/openwrt/0016-netifd-update-to-latest-git-master.patch diff --git a/patches/openwrt/0018-x86-fix-platform_export_bootpart-for-Xen-virtual-disks.patch b/patches/openwrt/0017-x86-fix-platform_export_bootpart-for-Xen-virtual-disks.patch similarity index 100% rename from patches/openwrt/0018-x86-fix-platform_export_bootpart-for-Xen-virtual-disks.patch rename to patches/openwrt/0017-x86-fix-platform_export_bootpart-for-Xen-virtual-disks.patch diff --git a/patches/openwrt/0019-Support-LibreSSL-as-provider-of-openssl.patch b/patches/openwrt/0018-Support-LibreSSL-as-provider-of-openssl.patch similarity index 100% rename from patches/openwrt/0019-Support-LibreSSL-as-provider-of-openssl.patch rename to patches/openwrt/0018-Support-LibreSSL-as-provider-of-openssl.patch diff --git a/patches/openwrt/0020-ar71xx-check-both-HWID-and-HWREV-on-upgrades-of-TP-LINK-devices.patch b/patches/openwrt/0019-ar71xx-check-both-HWID-and-HWREV-on-upgrades-of-TP-LINK-devices.patch similarity index 100% rename from patches/openwrt/0020-ar71xx-check-both-HWID-and-HWREV-on-upgrades-of-TP-LINK-devices.patch rename to patches/openwrt/0019-ar71xx-check-both-HWID-and-HWREV-on-upgrades-of-TP-LINK-devices.patch diff --git a/patches/openwrt/0021-ar71xx-avoid-AR71XX_MODEL-ending-with-a-space-on-some-TP-LINK-like-devices.patch b/patches/openwrt/0020-ar71xx-avoid-AR71XX_MODEL-ending-with-a-space-on-some-TP-LINK-like-devices.patch similarity index 100% rename from patches/openwrt/0021-ar71xx-avoid-AR71XX_MODEL-ending-with-a-space-on-some-TP-LINK-like-devices.patch rename to patches/openwrt/0020-ar71xx-avoid-AR71XX_MODEL-ending-with-a-space-on-some-TP-LINK-like-devices.patch diff --git a/patches/openwrt/0022-ar71xx-fix-the-revision-of-a-few-TP-LINK-devices-in-AR71XX_MODEL-to-match-labels-image-names.patch b/patches/openwrt/0021-ar71xx-fix-the-revision-of-a-few-TP-LINK-devices-in-AR71XX_MODEL-to-match-labels-image-names.patch similarity index 100% rename from patches/openwrt/0022-ar71xx-fix-the-revision-of-a-few-TP-LINK-devices-in-AR71XX_MODEL-to-match-labels-image-names.patch rename to patches/openwrt/0021-ar71xx-fix-the-revision-of-a-few-TP-LINK-devices-in-AR71XX_MODEL-to-match-labels-image-names.patch diff --git a/patches/openwrt/0023-ar71xx-build-image-for-TL-WR710N-v2.1.patch b/patches/openwrt/0022-ar71xx-build-image-for-TL-WR710N-v2.1.patch similarity index 100% rename from patches/openwrt/0023-ar71xx-build-image-for-TL-WR710N-v2.1.patch rename to patches/openwrt/0022-ar71xx-build-image-for-TL-WR710N-v2.1.patch diff --git a/patches/openwrt/0024-xtables-addons-build-fix-configure-compatiblity-with-POSIX-shells.patch b/patches/openwrt/0023-xtables-addons-build-fix-configure-compatiblity-with-POSIX-shells.patch similarity index 100% rename from patches/openwrt/0024-xtables-addons-build-fix-configure-compatiblity-with-POSIX-shells.patch rename to patches/openwrt/0023-xtables-addons-build-fix-configure-compatiblity-with-POSIX-shells.patch diff --git a/patches/openwrt/0025-tools-add-tar-host-build-required-for-sort-name-which-was-only-added-in-the-latest-version.patch b/patches/openwrt/0024-tools-add-tar-host-build-required-for-sort-name-which-was-only-added-in-the-latest-version.patch similarity index 100% rename from patches/openwrt/0025-tools-add-tar-host-build-required-for-sort-name-which-was-only-added-in-the-latest-version.patch rename to patches/openwrt/0024-tools-add-tar-host-build-required-for-sort-name-which-was-only-added-in-the-latest-version.patch diff --git a/patches/openwrt/0026-tools-compile-flock-before-everything-else.patch b/patches/openwrt/0025-tools-compile-flock-before-everything-else.patch similarity index 100% rename from patches/openwrt/0026-tools-compile-flock-before-everything-else.patch rename to patches/openwrt/0025-tools-compile-flock-before-everything-else.patch diff --git a/patches/openwrt/0027-rules.mk-make-the-locked-template-available-even-if-flock-has-not-been-built-yet-fall-back-to-unlocked-shell-command.patch b/patches/openwrt/0026-rules.mk-make-the-locked-template-available-even-if-flock-has-not-been-built-yet-fall-back-to-unlocked-shell-command.patch similarity index 100% rename from patches/openwrt/0027-rules.mk-make-the-locked-template-available-even-if-flock-has-not-been-built-yet-fall-back-to-unlocked-shell-command.patch rename to patches/openwrt/0026-rules.mk-make-the-locked-template-available-even-if-flock-has-not-been-built-yet-fall-back-to-unlocked-shell-command.patch diff --git a/patches/openwrt/0028-build-add-locking-for-downloads-fixes-race-conditions-with-multiple-variants.patch b/patches/openwrt/0027-build-add-locking-for-downloads-fixes-race-conditions-with-multiple-variants.patch similarity index 100% rename from patches/openwrt/0028-build-add-locking-for-downloads-fixes-race-conditions-with-multiple-variants.patch rename to patches/openwrt/0027-build-add-locking-for-downloads-fixes-race-conditions-with-multiple-variants.patch diff --git a/patches/openwrt/0029-download.mk-fix-packed-checkout-mirroring-support.patch b/patches/openwrt/0028-download.mk-fix-packed-checkout-mirroring-support.patch similarity index 100% rename from patches/openwrt/0029-download.mk-fix-packed-checkout-mirroring-support.patch rename to patches/openwrt/0028-download.mk-fix-packed-checkout-mirroring-support.patch diff --git a/patches/openwrt/0030-kernel-backport-spi-nor-driver-from-4.4.9.patch b/patches/openwrt/0029-kernel-backport-spi-nor-driver-from-4.4.9.patch similarity index 100% rename from patches/openwrt/0030-kernel-backport-spi-nor-driver-from-4.4.9.patch rename to patches/openwrt/0029-kernel-backport-spi-nor-driver-from-4.4.9.patch diff --git a/patches/openwrt/0031-kernel-mtd-spi-nor-wait-until-status-register-writes-are-ready.patch b/patches/openwrt/0030-kernel-mtd-spi-nor-wait-until-status-register-writes-are-ready.patch similarity index 100% rename from patches/openwrt/0031-kernel-mtd-spi-nor-wait-until-status-register-writes-are-ready.patch rename to patches/openwrt/0030-kernel-mtd-spi-nor-wait-until-status-register-writes-are-ready.patch diff --git a/patches/openwrt/0032-kernel-mtd-spi-nor-unlock-Winbond-flashs.patch b/patches/openwrt/0031-kernel-mtd-spi-nor-unlock-Winbond-flashs.patch similarity index 100% rename from patches/openwrt/0032-kernel-mtd-spi-nor-unlock-Winbond-flashs.patch rename to patches/openwrt/0031-kernel-mtd-spi-nor-unlock-Winbond-flashs.patch diff --git a/patches/openwrt/0033-tools-pkg-config-fix-build-with-GCC-6.patch b/patches/openwrt/0032-tools-pkg-config-fix-build-with-GCC-6.patch similarity index 100% rename from patches/openwrt/0033-tools-pkg-config-fix-build-with-GCC-6.patch rename to patches/openwrt/0032-tools-pkg-config-fix-build-with-GCC-6.patch diff --git a/patches/openwrt/0034-tools-mkimage-sync-include-linux-compiler-.h-with-u-boot-master.patch b/patches/openwrt/0033-tools-mkimage-sync-include-linux-compiler-.h-with-u-boot-master.patch similarity index 100% rename from patches/openwrt/0034-tools-mkimage-sync-include-linux-compiler-.h-with-u-boot-master.patch rename to patches/openwrt/0033-tools-mkimage-sync-include-linux-compiler-.h-with-u-boot-master.patch diff --git a/patches/openwrt/0035-toolchain-gcc-fix-build-with-GCC-6.patch b/patches/openwrt/0034-toolchain-gcc-fix-build-with-GCC-6.patch similarity index 100% rename from patches/openwrt/0035-toolchain-gcc-fix-build-with-GCC-6.patch rename to patches/openwrt/0034-toolchain-gcc-fix-build-with-GCC-6.patch diff --git a/patches/openwrt/0036-ath79-dev-eth-fix-QCA9561-set-phy-interface-mode-and-mask.patch b/patches/openwrt/0035-ath79-dev-eth-fix-QCA9561-set-phy-interface-mode-and-mask.patch similarity index 100% rename from patches/openwrt/0036-ath79-dev-eth-fix-QCA9561-set-phy-interface-mode-and-mask.patch rename to patches/openwrt/0035-ath79-dev-eth-fix-QCA9561-set-phy-interface-mode-and-mask.patch diff --git a/patches/openwrt/0037-ar71xx-use-correct-PLL-configuration-register-bitmask-for-QCA956x-SoC.patch b/patches/openwrt/0036-ar71xx-use-correct-PLL-configuration-register-bitmask-for-QCA956x-SoC.patch similarity index 100% rename from patches/openwrt/0037-ar71xx-use-correct-PLL-configuration-register-bitmask-for-QCA956x-SoC.patch rename to patches/openwrt/0036-ar71xx-use-correct-PLL-configuration-register-bitmask-for-QCA956x-SoC.patch diff --git a/patches/openwrt/0038-ar71xx-update-QCA956x-support.patch b/patches/openwrt/0037-ar71xx-update-QCA956x-support.patch similarity index 100% rename from patches/openwrt/0038-ar71xx-update-QCA956x-support.patch rename to patches/openwrt/0037-ar71xx-update-QCA956x-support.patch diff --git a/patches/openwrt/0039-ar71xx-fold-patch-622-MIPS-ath79-add-support-for-QCA956x-ethernet.patch-into-files.patch b/patches/openwrt/0038-ar71xx-fold-patch-622-MIPS-ath79-add-support-for-QCA956x-ethernet.patch-into-files.patch similarity index 100% rename from patches/openwrt/0039-ar71xx-fold-patch-622-MIPS-ath79-add-support-for-QCA956x-ethernet.patch-into-files.patch rename to patches/openwrt/0038-ar71xx-fold-patch-622-MIPS-ath79-add-support-for-QCA956x-ethernet.patch-into-files.patch diff --git a/patches/openwrt/0040-ar71xx-fix-MDIO-bus-probe-on-QCA956x.patch b/patches/openwrt/0039-ar71xx-fix-MDIO-bus-probe-on-QCA956x.patch similarity index 100% rename from patches/openwrt/0040-ar71xx-fix-MDIO-bus-probe-on-QCA956x.patch rename to patches/openwrt/0039-ar71xx-fix-MDIO-bus-probe-on-QCA956x.patch diff --git a/patches/openwrt/0041-ar71xx-fix-qca956x-ethernet-initialization.patch b/patches/openwrt/0040-ar71xx-fix-qca956x-ethernet-initialization.patch similarity index 100% rename from patches/openwrt/0041-ar71xx-fix-qca956x-ethernet-initialization.patch rename to patches/openwrt/0040-ar71xx-fix-qca956x-ethernet-initialization.patch diff --git a/patches/openwrt/0042-ar71xx-Support-for-Ubiquiti-UniFi-AP-AC-LITE.patch b/patches/openwrt/0041-ar71xx-Support-for-Ubiquiti-UniFi-AP-AC-LITE.patch similarity index 100% rename from patches/openwrt/0042-ar71xx-Support-for-Ubiquiti-UniFi-AP-AC-LITE.patch rename to patches/openwrt/0041-ar71xx-Support-for-Ubiquiti-UniFi-AP-AC-LITE.patch diff --git a/patches/openwrt/0043-ar71xx-Fix-eth0-support-for-Ubiquiti-UniFi-AP-AC.patch b/patches/openwrt/0042-ar71xx-Fix-eth0-support-for-Ubiquiti-UniFi-AP-AC.patch similarity index 100% rename from patches/openwrt/0043-ar71xx-Fix-eth0-support-for-Ubiquiti-UniFi-AP-AC.patch rename to patches/openwrt/0042-ar71xx-Fix-eth0-support-for-Ubiquiti-UniFi-AP-AC.patch diff --git a/patches/openwrt/0044-ar71xx-Rename-unifiac-to-unifiac-lite.patch b/patches/openwrt/0043-ar71xx-Rename-unifiac-to-unifiac-lite.patch similarity index 100% rename from patches/openwrt/0044-ar71xx-Rename-unifiac-to-unifiac-lite.patch rename to patches/openwrt/0043-ar71xx-Rename-unifiac-to-unifiac-lite.patch diff --git a/patches/openwrt/0045-ar71xx-Add-support-for-Ubiquiti-UniFi-AP-AC-PRO.patch b/patches/openwrt/0044-ar71xx-Add-support-for-Ubiquiti-UniFi-AP-AC-PRO.patch similarity index 100% rename from patches/openwrt/0045-ar71xx-Add-support-for-Ubiquiti-UniFi-AP-AC-PRO.patch rename to patches/openwrt/0044-ar71xx-Add-support-for-Ubiquiti-UniFi-AP-AC-PRO.patch diff --git a/patches/openwrt/0046-ar71xx-Generate-sysupgrade-images-for-OpenMesh-devices.patch b/patches/openwrt/0045-ar71xx-Generate-sysupgrade-images-for-OpenMesh-devices.patch similarity index 100% rename from patches/openwrt/0046-ar71xx-Generate-sysupgrade-images-for-OpenMesh-devices.patch rename to patches/openwrt/0045-ar71xx-Generate-sysupgrade-images-for-OpenMesh-devices.patch diff --git a/patches/openwrt/0047-ar71xx-add-kernel-support-for-the-OpenMesh-MR1750-board.patch b/patches/openwrt/0046-ar71xx-add-kernel-support-for-the-OpenMesh-MR1750-board.patch similarity index 100% rename from patches/openwrt/0047-ar71xx-add-kernel-support-for-the-OpenMesh-MR1750-board.patch rename to patches/openwrt/0046-ar71xx-add-kernel-support-for-the-OpenMesh-MR1750-board.patch diff --git a/patches/openwrt/0048-ar71xx-add-user-space-support-for-the-OpenMesh-MR1750-board.patch b/patches/openwrt/0047-ar71xx-add-user-space-support-for-the-OpenMesh-MR1750-board.patch similarity index 100% rename from patches/openwrt/0048-ar71xx-add-user-space-support-for-the-OpenMesh-MR1750-board.patch rename to patches/openwrt/0047-ar71xx-add-user-space-support-for-the-OpenMesh-MR1750-board.patch diff --git a/patches/openwrt/0049-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-MR1750.patch b/patches/openwrt/0048-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-MR1750.patch similarity index 100% rename from patches/openwrt/0049-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-MR1750.patch rename to patches/openwrt/0048-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-MR1750.patch diff --git a/patches/openwrt/0050-ar71xx-enable-sysupgrade-for-the-OpenMesh-MR1750.patch b/patches/openwrt/0049-ar71xx-enable-sysupgrade-for-the-OpenMesh-MR1750.patch similarity index 100% rename from patches/openwrt/0050-ar71xx-enable-sysupgrade-for-the-OpenMesh-MR1750.patch rename to patches/openwrt/0049-ar71xx-enable-sysupgrade-for-the-OpenMesh-MR1750.patch diff --git a/patches/openwrt/0051-package-om-watchdog-add-OpenMesh-MR1750-support.patch b/patches/openwrt/0050-package-om-watchdog-add-OpenMesh-MR1750-support.patch similarity index 100% rename from patches/openwrt/0051-package-om-watchdog-add-OpenMesh-MR1750-support.patch rename to patches/openwrt/0050-package-om-watchdog-add-OpenMesh-MR1750-support.patch diff --git a/patches/openwrt/0052-package-uboot-envtools-add-OpenMesh-MR1750-support.patch b/patches/openwrt/0051-package-uboot-envtools-add-OpenMesh-MR1750-support.patch similarity index 100% rename from patches/openwrt/0052-package-uboot-envtools-add-OpenMesh-MR1750-support.patch rename to patches/openwrt/0051-package-uboot-envtools-add-OpenMesh-MR1750-support.patch diff --git a/patches/openwrt/0053-ar71xx-create-profile-and-build-image-for-the-OpenMesh-MR1750-board.patch b/patches/openwrt/0052-ar71xx-create-profile-and-build-image-for-the-OpenMesh-MR1750-board.patch similarity index 100% rename from patches/openwrt/0053-ar71xx-create-profile-and-build-image-for-the-OpenMesh-MR1750-board.patch rename to patches/openwrt/0052-ar71xx-create-profile-and-build-image-for-the-OpenMesh-MR1750-board.patch diff --git a/patches/openwrt/0054-ar71xx-Extend-the-list-of-bits-in-QCA955X_GMAC_REG_ETH_CFG.patch b/patches/openwrt/0053-ar71xx-Extend-the-list-of-bits-in-QCA955X_GMAC_REG_ETH_CFG.patch similarity index 100% rename from patches/openwrt/0054-ar71xx-Extend-the-list-of-bits-in-QCA955X_GMAC_REG_ETH_CFG.patch rename to patches/openwrt/0053-ar71xx-Extend-the-list-of-bits-in-QCA955X_GMAC_REG_ETH_CFG.patch diff --git a/patches/openwrt/0055-ar71xx-Use-_eth_cfg-helper-for-Open-Mesh-MR900-boards.patch b/patches/openwrt/0054-ar71xx-Use-_eth_cfg-helper-for-Open-Mesh-MR900-boards.patch similarity index 100% rename from patches/openwrt/0055-ar71xx-Use-_eth_cfg-helper-for-Open-Mesh-MR900-boards.patch rename to patches/openwrt/0054-ar71xx-Use-_eth_cfg-helper-for-Open-Mesh-MR900-boards.patch diff --git a/patches/openwrt/0056-ar71xx-Allow-to-use-ath79_gpio_output_select-on-QCA955x.patch b/patches/openwrt/0055-ar71xx-Allow-to-use-ath79_gpio_output_select-on-QCA955x.patch similarity index 100% rename from patches/openwrt/0056-ar71xx-Allow-to-use-ath79_gpio_output_select-on-QCA955x.patch rename to patches/openwrt/0055-ar71xx-Allow-to-use-ath79_gpio_output_select-on-QCA955x.patch diff --git a/patches/openwrt/0057-ar71xx-Add-support-for-ath79_gpio_function_-on-QCA955X.patch b/patches/openwrt/0056-ar71xx-Add-support-for-ath79_gpio_function_-on-QCA955X.patch similarity index 100% rename from patches/openwrt/0057-ar71xx-Add-support-for-ath79_gpio_function_-on-QCA955X.patch rename to patches/openwrt/0056-ar71xx-Add-support-for-ath79_gpio_function_-on-QCA955X.patch diff --git a/patches/openwrt/0058-ar71xx-Add-QCA955X-GPIO-mux-and-function-definitions.patch b/patches/openwrt/0057-ar71xx-Add-QCA955X-GPIO-mux-and-function-definitions.patch similarity index 100% rename from patches/openwrt/0058-ar71xx-Add-QCA955X-GPIO-mux-and-function-definitions.patch rename to patches/openwrt/0057-ar71xx-Add-QCA955X-GPIO-mux-and-function-definitions.patch diff --git a/patches/openwrt/0059-ar71xx-Use-PHY-fixups-for-Open-Mesh-MR900.patch b/patches/openwrt/0058-ar71xx-Use-PHY-fixups-for-Open-Mesh-MR900.patch similarity index 100% rename from patches/openwrt/0059-ar71xx-Use-PHY-fixups-for-Open-Mesh-MR900.patch rename to patches/openwrt/0058-ar71xx-Use-PHY-fixups-for-Open-Mesh-MR900.patch diff --git a/patches/openwrt/0060-ar71xx-Use-PHY-fixups-for-Open-Mesh-MR1750.patch b/patches/openwrt/0059-ar71xx-Use-PHY-fixups-for-Open-Mesh-MR1750.patch similarity index 100% rename from patches/openwrt/0060-ar71xx-Use-PHY-fixups-for-Open-Mesh-MR1750.patch rename to patches/openwrt/0059-ar71xx-Use-PHY-fixups-for-Open-Mesh-MR1750.patch diff --git a/patches/openwrt/0061-ar71xx-Use-private-version-of-ath79_setup_qca955x_eth_cfg-for-MR900.patch b/patches/openwrt/0060-ar71xx-Use-private-version-of-ath79_setup_qca955x_eth_cfg-for-MR900.patch similarity index 100% rename from patches/openwrt/0061-ar71xx-Use-private-version-of-ath79_setup_qca955x_eth_cfg-for-MR900.patch rename to patches/openwrt/0060-ar71xx-Use-private-version-of-ath79_setup_qca955x_eth_cfg-for-MR900.patch diff --git a/patches/openwrt/0062-ar71xx-Use-private-version-of-ath79_setup_qca955x_eth_cfg-for-MR1750.patch b/patches/openwrt/0061-ar71xx-Use-private-version-of-ath79_setup_qca955x_eth_cfg-for-MR1750.patch similarity index 100% rename from patches/openwrt/0062-ar71xx-Use-private-version-of-ath79_setup_qca955x_eth_cfg-for-MR1750.patch rename to patches/openwrt/0061-ar71xx-Use-private-version-of-ath79_setup_qca955x_eth_cfg-for-MR1750.patch diff --git a/patches/openwrt/0063-scripts-om-fwupgradecfg-gen.sh-Fix-u-boot-image-md5sum-check.patch b/patches/openwrt/0062-scripts-om-fwupgradecfg-gen.sh-Fix-u-boot-image-md5sum-check.patch similarity index 100% rename from patches/openwrt/0063-scripts-om-fwupgradecfg-gen.sh-Fix-u-boot-image-md5sum-check.patch rename to patches/openwrt/0062-scripts-om-fwupgradecfg-gen.sh-Fix-u-boot-image-md5sum-check.patch diff --git a/patches/openwrt/0064-scripts-om-fwupgradecfg-gen.sh-Generate-sha256sum-for-uboot-verification.patch b/patches/openwrt/0063-scripts-om-fwupgradecfg-gen.sh-Generate-sha256sum-for-uboot-verification.patch similarity index 100% rename from patches/openwrt/0064-scripts-om-fwupgradecfg-gen.sh-Generate-sha256sum-for-uboot-verification.patch rename to patches/openwrt/0063-scripts-om-fwupgradecfg-gen.sh-Generate-sha256sum-for-uboot-verification.patch diff --git a/patches/openwrt/0065-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-AC-board.patch b/patches/openwrt/0064-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-AC-board.patch similarity index 100% rename from patches/openwrt/0065-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-AC-board.patch rename to patches/openwrt/0064-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-AC-board.patch diff --git a/patches/openwrt/0066-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-AC.patch b/patches/openwrt/0065-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-AC.patch similarity index 100% rename from patches/openwrt/0066-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-AC.patch rename to patches/openwrt/0065-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-AC.patch diff --git a/patches/openwrt/0067-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-OM5P-AC.patch b/patches/openwrt/0066-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-OM5P-AC.patch similarity index 100% rename from patches/openwrt/0067-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-OM5P-AC.patch rename to patches/openwrt/0066-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-OM5P-AC.patch diff --git a/patches/openwrt/0068-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM5P-AC.patch b/patches/openwrt/0067-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM5P-AC.patch similarity index 100% rename from patches/openwrt/0068-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM5P-AC.patch rename to patches/openwrt/0067-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM5P-AC.patch diff --git a/patches/openwrt/0069-om-watchdog-add-OpenMesh-OM5P-AC-support.patch b/patches/openwrt/0068-om-watchdog-add-OpenMesh-OM5P-AC-support.patch similarity index 100% rename from patches/openwrt/0069-om-watchdog-add-OpenMesh-OM5P-AC-support.patch rename to patches/openwrt/0068-om-watchdog-add-OpenMesh-OM5P-AC-support.patch diff --git a/patches/openwrt/0070-uboot-envtools-add-OpenMesh-OM5P-AC-support.patch b/patches/openwrt/0069-uboot-envtools-add-OpenMesh-OM5P-AC-support.patch similarity index 100% rename from patches/openwrt/0070-uboot-envtools-add-OpenMesh-OM5P-AC-support.patch rename to patches/openwrt/0069-uboot-envtools-add-OpenMesh-OM5P-AC-support.patch diff --git a/patches/openwrt/0071-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-OM5P-AC-board.patch b/patches/openwrt/0070-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-OM5P-AC-board.patch similarity index 100% rename from patches/openwrt/0071-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-OM5P-AC-board.patch rename to patches/openwrt/0070-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-OM5P-AC-board.patch diff --git a/patches/openwrt/0072-ar71xx-create-profile-and-build-image-for-the-OpenMesh-OM5P-AC-board.patch b/patches/openwrt/0071-ar71xx-create-profile-and-build-image-for-the-OpenMesh-OM5P-AC-board.patch similarity index 100% rename from patches/openwrt/0072-ar71xx-create-profile-and-build-image-for-the-OpenMesh-OM5P-AC-board.patch rename to patches/openwrt/0071-ar71xx-create-profile-and-build-image-for-the-OpenMesh-OM5P-AC-board.patch diff --git a/patches/openwrt/0073-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-ACv2-board.patch b/patches/openwrt/0072-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-ACv2-board.patch similarity index 100% rename from patches/openwrt/0073-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-ACv2-board.patch rename to patches/openwrt/0072-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-ACv2-board.patch diff --git a/patches/openwrt/0074-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-ACv2.patch b/patches/openwrt/0073-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-ACv2.patch similarity index 100% rename from patches/openwrt/0074-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-ACv2.patch rename to patches/openwrt/0073-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-ACv2.patch diff --git a/patches/openwrt/0075-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM5P-ACv2.patch b/patches/openwrt/0074-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM5P-ACv2.patch similarity index 100% rename from patches/openwrt/0075-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM5P-ACv2.patch rename to patches/openwrt/0074-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM5P-ACv2.patch diff --git a/patches/openwrt/0076-om-watchdog-add-OpenMesh-OM5P-ACv2-support.patch b/patches/openwrt/0075-om-watchdog-add-OpenMesh-OM5P-ACv2-support.patch similarity index 100% rename from patches/openwrt/0076-om-watchdog-add-OpenMesh-OM5P-ACv2-support.patch rename to patches/openwrt/0075-om-watchdog-add-OpenMesh-OM5P-ACv2-support.patch diff --git a/patches/openwrt/0077-uboot-envtools-add-OpenMesh-OM5P-ACv2-support.patch b/patches/openwrt/0076-uboot-envtools-add-OpenMesh-OM5P-ACv2-support.patch similarity index 100% rename from patches/openwrt/0077-uboot-envtools-add-OpenMesh-OM5P-ACv2-support.patch rename to patches/openwrt/0076-uboot-envtools-add-OpenMesh-OM5P-ACv2-support.patch diff --git a/patches/openwrt/0078-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-OM5P-ACv2-board.patch b/patches/openwrt/0077-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-OM5P-ACv2-board.patch similarity index 100% rename from patches/openwrt/0078-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-OM5P-ACv2-board.patch rename to patches/openwrt/0077-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-OM5P-ACv2-board.patch diff --git a/patches/openwrt/0079-ar71xx-add-OM5P-ACv2-to-the-OM5P-AC-profile.patch b/patches/openwrt/0078-ar71xx-add-OM5P-ACv2-to-the-OM5P-AC-profile.patch similarity index 100% rename from patches/openwrt/0079-ar71xx-add-OM5P-ACv2-to-the-OM5P-AC-profile.patch rename to patches/openwrt/0078-ar71xx-add-OM5P-ACv2-to-the-OM5P-AC-profile.patch diff --git a/patches/openwrt/0080-libjson-c-Add-support-for-custom-format-strings-for-doubles.patch b/patches/openwrt/0079-libjson-c-Add-support-for-custom-format-strings-for-doubles.patch similarity index 100% rename from patches/openwrt/0080-libjson-c-Add-support-for-custom-format-strings-for-doubles.patch rename to patches/openwrt/0079-libjson-c-Add-support-for-custom-format-strings-for-doubles.patch diff --git a/patches/openwrt/0080-mac80211-ath9k-enable-platform-WLAN-LED-name.patch b/patches/openwrt/0080-mac80211-ath9k-enable-platform-WLAN-LED-name.patch new file mode 100644 index 00000000..e3604a4a --- /dev/null +++ b/patches/openwrt/0080-mac80211-ath9k-enable-platform-WLAN-LED-name.patch @@ -0,0 +1,121 @@ +From: Matthias Schiffer +Date: Sun, 29 May 2016 12:56:43 +0200 +Subject: mac80211: ath9k: enable platform WLAN LED name + +Enable platform-supplied WLAN LED name for ath9k device. + +Signed-off-by: Michal Cieslakiewicz +Acked-by: Hartmut Knaack + +Backport of r48879 + +diff --git a/package/kernel/mac80211/patches/546-ath9k_platform_led_name.patch b/package/kernel/mac80211/patches/546-ath9k_platform_led_name.patch +new file mode 100644 +index 0000000..8d2d899 +--- /dev/null ++++ b/package/kernel/mac80211/patches/546-ath9k_platform_led_name.patch +@@ -0,0 +1,48 @@ ++From: Michal Cieslakiewicz ++Date: Sun, 31 Jan 2016 20:45:57 +0100 ++Subject: [PATCH v4 1/8] mac80211: ath9k: enable platform WLAN LED name ++ ++Enable platform-supplied WLAN LED name for ath9k device. It replaces generic ++'ath9k-phy*' label with string set during platform initialization. ++ ++Signed-off-by: Michal Cieslakiewicz ++--- ++ drivers/net/wireless/ath/ath9k/gpio.c | 10 +++++++--- ++ include/linux/ath9k_platform.h | 1 + ++ 2 files changed, 8 insertions(+), 3 deletions(-) ++ ++--- a/drivers/net/wireless/ath/ath9k/gpio.c +++++ b/drivers/net/wireless/ath/ath9k/gpio.c ++@@ -132,15 +132,19 @@ void ath_init_leds(struct ath_softc *sc) ++ if (AR_SREV_9100(sc->sc_ah)) ++ return; ++ ++- snprintf(led_name, sizeof(led_name), "ath9k-%s", ++- wiphy_name(sc->hw->wiphy)); +++ if (pdata && pdata->led_name) +++ strncpy(led_name, pdata->led_name, sizeof(led_name)); +++ else +++ snprintf(led_name, sizeof(led_name), "ath9k-%s", +++ wiphy_name(sc->hw->wiphy)); ++ ++ if (ath9k_led_blink) ++ trigger = sc->led_default_trigger; ++ else ++ trigger = ieee80211_get_radio_led_name(sc->hw); ++ ++- ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger, !sc->sc_ah->config.led_active_high); +++ ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger, +++ !sc->sc_ah->config.led_active_high); ++ ++ if (!pdata) ++ return; ++--- a/include/linux/ath9k_platform.h +++++ b/include/linux/ath9k_platform.h ++@@ -45,6 +45,7 @@ struct ath9k_platform_data { ++ ++ int num_leds; ++ const struct gpio_led *leds; +++ const char *led_name; ++ }; ++ ++ #endif /* _LINUX_ATH9K_PLATFORM_H */ +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.c b/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.c +index d382453..bf80d4d 100644 +--- a/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.c ++++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.c +@@ -39,6 +39,18 @@ __init void ap9x_pci_setup_wmac_led_pin(unsigned wmac, int pin) + } + } + ++__init void ap9x_pci_setup_wmac_led_name(unsigned wmac, const char *led_name) ++{ ++ switch (wmac) { ++ case 0: ++ ap9x_wmac0_data.led_name = led_name; ++ break; ++ case 1: ++ ap9x_wmac1_data.led_name = led_name; ++ break; ++ } ++} ++ + __init struct ath9k_platform_data *ap9x_pci_get_wmac_data(unsigned wmac) + { + switch (wmac) { +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.h b/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.h +index ad288cb..dcfe541 100644 +--- a/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.h ++++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.h +@@ -19,6 +19,7 @@ void ap9x_pci_setup_wmac_led_pin(unsigned wmac, int pin); + void ap9x_pci_setup_wmac_gpio(unsigned wmac, u32 mask, u32 val); + void ap9x_pci_setup_wmac_leds(unsigned wmac, struct gpio_led *leds, + int num_leds); ++void ap9x_pci_setup_wmac_led_name(unsigned wmac, const char *led_name); + struct ath9k_platform_data *ap9x_pci_get_wmac_data(unsigned wmac); + + void ap91_pci_init(u8 *cal_data, u8 *mac_addr); +@@ -33,6 +34,8 @@ static inline void ap9x_pci_setup_wmac_gpio(unsigned wmac, + static inline void ap9x_pci_setup_wmac_leds(unsigned wmac, + struct gpio_led *leds, + int num_leds) {} ++static inline void ap9x_pci_setup_wmac_led_name(unsigned wmac, ++ const char *led_name) {} + static inline struct ath9k_platform_data *ap9x_pci_get_wmac_data(unsigned wmac) + { + return NULL; +diff --git a/target/linux/generic/files/include/linux/ath9k_platform.h b/target/linux/generic/files/include/linux/ath9k_platform.h +index 30ce216..823e5ac 100644 +--- a/target/linux/generic/files/include/linux/ath9k_platform.h ++++ b/target/linux/generic/files/include/linux/ath9k_platform.h +@@ -45,6 +45,7 @@ struct ath9k_platform_data { + + int num_leds; + const struct gpio_led *leds; ++ const char *led_name; + }; + + #endif /* _LINUX_ATH9K_PLATFORM_H */ diff --git a/patches/openwrt/0081-mac80211-ath9k-set-default-state-for-platform-LEDs.patch b/patches/openwrt/0081-mac80211-ath9k-set-default-state-for-platform-LEDs.patch new file mode 100644 index 00000000..0c49ef87 --- /dev/null +++ b/patches/openwrt/0081-mac80211-ath9k-set-default-state-for-platform-LEDs.patch @@ -0,0 +1,47 @@ +From: Matthias Schiffer +Date: Sun, 29 May 2016 13:37:28 +0200 +Subject: mac80211: ath9k: set default state for platform LEDs + +Support default state for platform LEDs connected to ath9k device. +Now LEDs are correctly set on or off at ath9k module initialization. + +Signed-off-by: Michal Cieslakiewicz +Acked-by: Hartmut Knaack + +Backport of r48880 + +diff --git a/package/kernel/mac80211/patches/547-ath9k_led_defstate_fix.patch b/package/kernel/mac80211/patches/547-ath9k_led_defstate_fix.patch +new file mode 100644 +index 0000000..db0b619 +--- /dev/null ++++ b/package/kernel/mac80211/patches/547-ath9k_led_defstate_fix.patch +@@ -0,0 +1,29 @@ ++From: Michal Cieslakiewicz ++Date: Sun, 31 Jan 2016 20:48:49 +0100 ++Subject: [PATCH v4 2/8] mac80211: ath9k: set default state for platform LEDs ++ ++Support default state for platform LEDs connected to ath9k device. ++Now LEDs are correctly set on or off at ath9k module initialization. ++Very useful if power LED is connected to wireless chip. ++ ++Signed-off-by: Michal Cieslakiewicz ++--- ++ gpio.c | 7 +++++-- ++ 1 file changed, 5 insertions(+), 2 deletions(-) ++ ++--- a/drivers/net/wireless/ath/ath9k/gpio.c +++++ b/drivers/net/wireless/ath/ath9k/gpio.c ++@@ -54,8 +54,11 @@ static int ath_add_led(struct ath_softc ++ ath9k_hw_cfg_output(sc->sc_ah, gpio->gpio, ++ AR_GPIO_OUTPUT_MUX_AS_OUTPUT); ++ ++- /* LED off */ ++- ath9k_hw_set_gpio(sc->sc_ah, gpio->gpio, gpio->active_low); +++ /* Set default LED state */ +++ if (gpio->default_state == LEDS_GPIO_DEFSTATE_ON) +++ ath9k_hw_set_gpio(sc->sc_ah, gpio->gpio, !gpio->active_low); +++ else +++ ath9k_hw_set_gpio(sc->sc_ah, gpio->gpio, gpio->active_low); ++ ++ return 0; ++ } diff --git a/patches/openwrt/0082-mac80211-ath9k-enable-access-to-GPIO.patch b/patches/openwrt/0082-mac80211-ath9k-enable-access-to-GPIO.patch new file mode 100644 index 00000000..dddcadd6 --- /dev/null +++ b/patches/openwrt/0082-mac80211-ath9k-enable-access-to-GPIO.patch @@ -0,0 +1,261 @@ +From: Matthias Schiffer +Date: Sun, 29 May 2016 13:37:59 +0200 +Subject: mac80211: ath9k: enable access to GPIO + +Enable access to GPIO chip and its pins for Atheros AR92xx +wireless devices. For now AR9285 and AR9287 are supported. + +Signed-off-by: Michal Cieslakiewicz +Acked-by: Hartmut Knaack + +Backport of r48881 + +diff --git a/package/kernel/mac80211/patches/549-ath9k_enable_gpio_chip.patch b/package/kernel/mac80211/patches/549-ath9k_enable_gpio_chip.patch +new file mode 100644 +index 0000000..beee169 +--- /dev/null ++++ b/package/kernel/mac80211/patches/549-ath9k_enable_gpio_chip.patch +@@ -0,0 +1,243 @@ ++From: Michal Cieslakiewicz ++Date: Sun, 31 Jan 2016 21:01:31 +0100 ++Subject: [PATCH v4 4/8] mac80211: ath9k: enable access to GPIO ++ ++Enable access to GPIO chip and its pins for Atheros AR92xx ++wireless devices. For now AR9285 and AR9287 are supported. ++ ++Signed-off-by: Michal Cieslakiewicz ++--- ++ ath9k.h | 23 ++++++++++++ ++ gpio.c | 121 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++ init.c | 2 + ++ 3 files changed, 146 insertions(+) ++ ++--- a/drivers/net/wireless/ath/ath9k/ath9k.h +++++ b/drivers/net/wireless/ath/ath9k/ath9k.h ++@@ -24,6 +24,7 @@ ++ #include ++ #include ++ #include +++#include ++ ++ #include "common.h" ++ #include "debug.h" ++@@ -817,6 +818,13 @@ void ath_fill_led_pin(struct ath_softc * ++ int ath_create_gpio_led(struct ath_softc *sc, int gpio, const char *name, ++ const char *trigger, bool active_low); ++ +++/***************/ +++/* GPIO Chip */ +++/***************/ +++ +++void ath9k_register_gpio_chip(struct ath_softc *sc); +++void ath9k_unregister_gpio_chip(struct ath_softc *sc); +++ ++ #else ++ static inline void ath_init_leds(struct ath_softc *sc) ++ { ++@@ -828,6 +836,14 @@ static inline void ath_deinit_leds(struc ++ static inline void ath_fill_led_pin(struct ath_softc *sc) ++ { ++ } +++ +++static inline void ath9k_register_gpio_chip(struct ath_softc *sc) +++{ +++} +++ +++static inline void ath9k_unregister_gpio_chip(struct ath_softc *sc) +++{ +++} ++ #endif ++ ++ /************************/ ++@@ -963,6 +979,12 @@ struct ath_led { ++ struct led_classdev cdev; ++ }; ++ +++struct ath9k_gpio_chip { +++ struct ath_softc *sc; +++ char label[32]; +++ struct gpio_chip gchip; +++}; +++ ++ struct ath_softc { ++ struct ieee80211_hw *hw; ++ struct device *dev; ++@@ -1017,6 +1039,7 @@ struct ath_softc { ++ #ifdef CPTCFG_MAC80211_LEDS ++ const char *led_default_trigger; ++ struct list_head leds; +++ struct ath9k_gpio_chip *gpiochip; ++ #endif ++ ++ #ifdef CPTCFG_ATH9K_DEBUGFS ++--- a/drivers/net/wireless/ath/ath9k/gpio.c +++++ b/drivers/net/wireless/ath/ath9k/gpio.c ++@@ -22,6 +22,9 @@ ++ /********************************/ ++ ++ #ifdef CPTCFG_MAC80211_LEDS +++ +++#include +++ ++ static void ath_led_brightness(struct led_classdev *led_cdev, ++ enum led_brightness brightness) ++ { ++@@ -60,6 +63,10 @@ static int ath_add_led(struct ath_softc ++ else ++ ath9k_hw_set_gpio(sc->sc_ah, gpio->gpio, gpio->active_low); ++ +++ /* If there is GPIO chip configured, reserve LED pin */ +++ if (sc->gpiochip) +++ gpio_request(sc->gpiochip->gchip.base + gpio->gpio, gpio->name); +++ ++ return 0; ++ } ++ ++@@ -116,6 +123,9 @@ void ath_deinit_leds(struct ath_softc *s ++ ++ while (!list_empty(&sc->leds)) { ++ led = list_first_entry(&sc->leds, struct ath_led, list); +++ /* If there is GPIO chip configured, free LED pin */ +++ if (sc->gpiochip) +++ gpio_free(sc->gpiochip->gchip.base + led->gpio->gpio); ++ list_del(&led->list); ++ ath_led_brightness(&led->cdev, LED_OFF); ++ led_classdev_unregister(&led->cdev); ++@@ -186,6 +196,117 @@ void ath_fill_led_pin(struct ath_softc * ++ /* LED off, active low */ ++ ath9k_hw_set_gpio(ah, ah->led_pin, (ah->config.led_active_high) ? 0 : 1); ++ } +++ +++/***************/ +++/* GPIO Chip */ +++/***************/ +++ +++/* gpio_chip handler : set GPIO to input */ +++static int ath9k_gpio_pin_cfg_input(struct gpio_chip *chip, unsigned offset) +++{ +++ struct ath9k_gpio_chip *gc = container_of(chip, struct ath9k_gpio_chip, +++ gchip); +++ +++ ath9k_hw_cfg_gpio_input(gc->sc->sc_ah, offset); +++ +++ return 0; +++} +++ +++/* gpio_chip handler : set GPIO to output */ +++static int ath9k_gpio_pin_cfg_output(struct gpio_chip *chip, unsigned offset, +++ int value) +++{ +++ struct ath9k_gpio_chip *gc = container_of(chip, struct ath9k_gpio_chip, +++ gchip); +++ +++ ath9k_hw_cfg_output(gc->sc->sc_ah, offset, +++ AR_GPIO_OUTPUT_MUX_AS_OUTPUT); +++ ath9k_hw_set_gpio(gc->sc->sc_ah, offset, value); +++ +++ return 0; +++} +++ +++/* gpio_chip handler : query GPIO direction (0=out, 1=in) */ +++static int ath9k_gpio_pin_get_dir(struct gpio_chip *chip, unsigned offset) +++{ +++ struct ath9k_gpio_chip *gc = container_of(chip, struct ath9k_gpio_chip, +++ gchip); +++ struct ath_hw *ah = gc->sc->sc_ah; +++ +++ return !((REG_READ(ah, AR_GPIO_OE_OUT) >> (offset * 2)) & 3); +++} +++ +++/* gpio_chip handler : get GPIO pin value */ +++static int ath9k_gpio_pin_get(struct gpio_chip *chip, unsigned offset) +++{ +++ struct ath9k_gpio_chip *gc = container_of(chip, struct ath9k_gpio_chip, +++ gchip); +++ +++ return ath9k_hw_gpio_get(gc->sc->sc_ah, offset); +++} +++ +++/* gpio_chip handler : set GPIO pin to value */ +++static void ath9k_gpio_pin_set(struct gpio_chip *chip, unsigned offset, +++ int value) +++{ +++ struct ath9k_gpio_chip *gc = container_of(chip, struct ath9k_gpio_chip, +++ gchip); +++ +++ ath9k_hw_set_gpio(gc->sc->sc_ah, offset, value); +++} +++ +++/* register GPIO chip */ +++void ath9k_register_gpio_chip(struct ath_softc *sc) +++{ +++ struct ath9k_gpio_chip *gc; +++ u16 ng; +++ +++ /* for now only AR9285 and AR9287 are recognized */ +++ if (AR_SREV_9287(sc->sc_ah)) +++ ng = AR9287_NUM_GPIO; +++ else if (AR_SREV_9285(sc->sc_ah)) +++ ng = AR9285_NUM_GPIO; +++ else +++ return; +++ +++ gc = kzalloc(sizeof(struct ath9k_gpio_chip), GFP_KERNEL); +++ if (!gc) +++ return; +++ +++ snprintf(gc->label, sizeof(gc->label), "ath9k-%s", +++ wiphy_name(sc->hw->wiphy)); +++ gc->gchip.label = gc->label; +++ gc->gchip.base = -1; /* determine base automatically */ +++ gc->gchip.ngpio = ng; +++ gc->gchip.direction_input = ath9k_gpio_pin_cfg_input; +++ gc->gchip.direction_output = ath9k_gpio_pin_cfg_output; +++ gc->gchip.get_direction = ath9k_gpio_pin_get_dir; +++ gc->gchip.get = ath9k_gpio_pin_get; +++ gc->gchip.set = ath9k_gpio_pin_set; +++ gc->gchip.owner = THIS_MODULE; +++ +++ if (gpiochip_add(&gc->gchip)) { +++ kfree(gc); +++ return; +++ } +++ +++ sc->gpiochip = gc; +++ gc->sc = sc; +++} +++ +++/* remove GPIO chip */ +++void ath9k_unregister_gpio_chip(struct ath_softc *sc) +++{ +++ struct ath9k_gpio_chip *gc = sc->gpiochip; +++ +++ if (!gc) +++ return; +++ +++ gpiochip_remove(&gc->gchip); +++ kfree(gc); +++ sc->gpiochip = NULL; +++} +++ ++ #endif ++ ++ /*******************/ ++--- a/drivers/net/wireless/ath/ath9k/init.c +++++ b/drivers/net/wireless/ath/ath9k/init.c ++@@ -979,6 +979,7 @@ int ath9k_init_device(u16 devid, struct ++ goto debug_cleanup; ++ } ++ +++ ath9k_register_gpio_chip(sc); ++ ath_init_leds(sc); ++ ath_start_rfkill_poll(sc); ++ ++@@ -1026,6 +1027,7 @@ void ath9k_deinit_device(struct ath_soft ++ ++ wiphy_rfkill_stop_polling(sc->hw->wiphy); ++ ath_deinit_leds(sc); +++ ath9k_unregister_gpio_chip(sc); ++ ++ ath9k_ps_restore(sc); ++ diff --git a/patches/openwrt/0083-mac80211-refresh-patch.patch b/patches/openwrt/0083-mac80211-refresh-patch.patch new file mode 100644 index 00000000..79e409c9 --- /dev/null +++ b/patches/openwrt/0083-mac80211-refresh-patch.patch @@ -0,0 +1,30 @@ +From: Matthias Schiffer +Date: Sun, 29 May 2016 13:38:19 +0200 +Subject: mac80211: refresh patch + +Signed-off-by: Felix Fietkau + +Backport of r48882 + +diff --git a/package/kernel/mac80211/patches/549-ath9k_enable_gpio_chip.patch b/package/kernel/mac80211/patches/549-ath9k_enable_gpio_chip.patch +index beee169..55bb991 100644 +--- a/package/kernel/mac80211/patches/549-ath9k_enable_gpio_chip.patch ++++ b/package/kernel/mac80211/patches/549-ath9k_enable_gpio_chip.patch +@@ -225,7 +225,7 @@ Signed-off-by: Michal Cieslakiewicz + /*******************/ + --- a/drivers/net/wireless/ath/ath9k/init.c + +++ b/drivers/net/wireless/ath/ath9k/init.c +-@@ -979,6 +979,7 @@ int ath9k_init_device(u16 devid, struct ++@@ -975,6 +975,7 @@ int ath9k_init_device(u16 devid, struct + goto debug_cleanup; + } + +@@ -233,7 +233,7 @@ Signed-off-by: Michal Cieslakiewicz + ath_init_leds(sc); + ath_start_rfkill_poll(sc); + +-@@ -1026,6 +1027,7 @@ void ath9k_deinit_device(struct ath_soft ++@@ -1022,6 +1023,7 @@ void ath9k_deinit_device(struct ath_soft + + wiphy_rfkill_stop_polling(sc->hw->wiphy); + ath_deinit_leds(sc); diff --git a/patches/openwrt/0084-mac80211-ath9k-enable-GPIO-buttons.patch b/patches/openwrt/0084-mac80211-ath9k-enable-GPIO-buttons.patch new file mode 100644 index 00000000..f2eb5bc6 --- /dev/null +++ b/patches/openwrt/0084-mac80211-ath9k-enable-GPIO-buttons.patch @@ -0,0 +1,259 @@ +From: Matthias Schiffer +Date: Sun, 29 May 2016 13:38:45 +0200 +Subject: mac80211: ath9k: enable GPIO buttons + +Enable platform-defined GPIO button support for ath9k device. +Key poller is activated for attached platform buttons. +Requires ath9k GPIO chip access. + +Signed-off-by: Michal Cieslakiewicz + +Backport of r48921 + +diff --git a/package/kernel/mac80211/patches/550-ath9k_enable_gpio_buttons.patch b/package/kernel/mac80211/patches/550-ath9k_enable_gpio_buttons.patch +new file mode 100644 +index 0000000..e3a8cec +--- /dev/null ++++ b/package/kernel/mac80211/patches/550-ath9k_enable_gpio_buttons.patch +@@ -0,0 +1,169 @@ ++From: Michal Cieslakiewicz ++Subject: [PATCH v5 5/8] mac80211: ath9k: enable GPIO buttons ++ ++Enable platform-defined GPIO button support for ath9k device. ++Key poller is activated for attached platform buttons. ++Requires ath9k GPIO chip access. ++ ++Signed-off-by: Michal Cieslakiewicz ++--- ++ drivers/net/wireless/ath/ath9k/ath9k.h | 16 ++++++ ++ drivers/net/wireless/ath/ath9k/gpio.c | 77 +++++++++++++++++++++++++++++++++ ++ drivers/net/wireless/ath/ath9k/init.c | 2 ++ include/linux/ath9k_platform.h | 4 + ++ 4 files changed, 99 insertions(+) ++ ++--- a/drivers/net/wireless/ath/ath9k/ath9k.h +++++ b/drivers/net/wireless/ath/ath9k/ath9k.h ++@@ -825,6 +825,13 @@ int ath_create_gpio_led(struct ath_softc ++ void ath9k_register_gpio_chip(struct ath_softc *sc); ++ void ath9k_unregister_gpio_chip(struct ath_softc *sc); ++ +++/******************/ +++/* GPIO Buttons */ +++/******************/ +++ +++void ath9k_init_buttons(struct ath_softc *sc); +++void ath9k_deinit_buttons(struct ath_softc *sc); +++ ++ #else ++ static inline void ath_init_leds(struct ath_softc *sc) ++ { ++@@ -844,6 +851,14 @@ static inline void ath9k_register_gpio_c ++ static inline void ath9k_unregister_gpio_chip(struct ath_softc *sc) ++ { ++ } +++ +++static inline void ath9k_init_buttons(struct ath_softc *sc) +++{ +++} +++ +++static inline void ath9k_deinit_buttons(struct ath_softc *sc) +++{ +++} ++ #endif ++ ++ /************************/ ++@@ -1040,6 +1055,7 @@ struct ath_softc { ++ const char *led_default_trigger; ++ struct list_head leds; ++ struct ath9k_gpio_chip *gpiochip; +++ struct platform_device *btnpdev; /* gpio-keys-polled */ ++ #endif ++ ++ #ifdef CPTCFG_ATH9K_DEBUGFS ++--- a/drivers/net/wireless/ath/ath9k/gpio.c +++++ b/drivers/net/wireless/ath/ath9k/gpio.c ++@@ -24,6 +24,8 @@ ++ #ifdef CPTCFG_MAC80211_LEDS ++ ++ #include +++#include +++#include ++ ++ static void ath_led_brightness(struct led_classdev *led_cdev, ++ enum led_brightness brightness) ++@@ -159,7 +161,7 @@ void ath_init_leds(struct ath_softc *sc) ++ ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger, ++ !sc->sc_ah->config.led_active_high); ++ ++- if (!pdata) +++ if (!pdata || !pdata->leds || !pdata->num_leds) ++ return; ++ ++ for (i = 0; i < pdata->num_leds; i++) ++@@ -307,6 +309,63 @@ void ath9k_unregister_gpio_chip(struct a ++ sc->gpiochip = NULL; ++ } ++ +++/******************/ +++/* GPIO Buttons */ +++/******************/ +++ +++/* add GPIO buttons */ +++void ath9k_init_buttons(struct ath_softc *sc) +++{ +++ struct ath9k_platform_data *pdata = sc->dev->platform_data; +++ struct platform_device *pdev; +++ struct gpio_keys_platform_data gkpdata; +++ struct gpio_keys_button *bt; +++ int i; +++ +++ if (!sc->gpiochip) +++ return; +++ +++ if (!pdata || !pdata->btns || !pdata->num_btns) +++ return; +++ +++ bt = devm_kmemdup(sc->dev, pdata->btns, +++ pdata->num_btns * sizeof(struct gpio_keys_button), +++ GFP_KERNEL); +++ if (!bt) +++ return; +++ +++ for (i = 0; i < pdata->num_btns; i++) { +++ ath9k_hw_cfg_gpio_input(sc->sc_ah, pdata->btns[i].gpio); +++ bt[i].gpio = sc->gpiochip->gchip.base + pdata->btns[i].gpio; +++ } +++ +++ memset(&gkpdata, 0, sizeof(struct gpio_keys_platform_data)); +++ gkpdata.buttons = bt; +++ gkpdata.nbuttons = pdata->num_btns; +++ gkpdata.poll_interval = pdata->btn_poll_interval; +++ +++ pdev = platform_device_register_data(sc->dev, "gpio-keys-polled", +++ PLATFORM_DEVID_AUTO, &gkpdata, +++ sizeof(gkpdata)); +++ if (!IS_ERR_OR_NULL(pdev)) +++ sc->btnpdev = pdev; +++ else { +++ sc->btnpdev = NULL; +++ devm_kfree(sc->dev, bt); +++ } +++} +++ +++/* remove GPIO buttons */ +++void ath9k_deinit_buttons(struct ath_softc *sc) +++{ +++ if (!sc->gpiochip || !sc->btnpdev) +++ return; +++ +++ platform_device_unregister(sc->btnpdev); +++ +++ sc->btnpdev = NULL; +++} +++ ++ #endif ++ ++ /*******************/ ++--- a/drivers/net/wireless/ath/ath9k/init.c +++++ b/drivers/net/wireless/ath/ath9k/init.c ++@@ -977,6 +977,7 @@ int ath9k_init_device(u16 devid, struct ++ ++ ath9k_register_gpio_chip(sc); ++ ath_init_leds(sc); +++ ath9k_init_buttons(sc); ++ ath_start_rfkill_poll(sc); ++ ++ return 0; ++@@ -1022,6 +1023,7 @@ void ath9k_deinit_device(struct ath_soft ++ ath9k_ps_wakeup(sc); ++ ++ wiphy_rfkill_stop_polling(sc->hw->wiphy); +++ ath9k_deinit_buttons(sc); ++ ath_deinit_leds(sc); ++ ath9k_unregister_gpio_chip(sc); ++ ++--- a/include/linux/ath9k_platform.h +++++ b/include/linux/ath9k_platform.h ++@@ -46,6 +46,10 @@ struct ath9k_platform_data { ++ int num_leds; ++ const struct gpio_led *leds; ++ const char *led_name; +++ +++ unsigned num_btns; +++ const struct gpio_keys_button *btns; +++ unsigned btn_poll_interval; ++ }; ++ ++ #endif /* _LINUX_ATH9K_PLATFORM_H */ +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.c b/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.c +index bf80d4d..20bb06e 100644 +--- a/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.c ++++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.c +@@ -93,6 +93,20 @@ __init void ap9x_pci_setup_wmac_leds(unsigned wmac, struct gpio_led *leds, + } + } + ++__init void ap9x_pci_setup_wmac_btns(unsigned wmac, ++ struct gpio_keys_button *btns, ++ unsigned num_btns, unsigned poll_interval) ++{ ++ struct ath9k_platform_data *ap9x_wmac_data; ++ ++ if (!(ap9x_wmac_data = ap9x_pci_get_wmac_data(wmac))) ++ return; ++ ++ ap9x_wmac_data->btns = btns; ++ ap9x_wmac_data->num_btns = num_btns; ++ ap9x_wmac_data->btn_poll_interval = poll_interval; ++} ++ + static int ap91_pci_plat_dev_init(struct pci_dev *dev) + { + switch (PCI_SLOT(dev->devfn)) { +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.h b/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.h +index dcfe541..d7c0185 100644 +--- a/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.h ++++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.h +@@ -12,6 +12,7 @@ + #define _ATH79_DEV_AP9X_PCI_H + + struct gpio_led; ++struct gpio_keys_button; + struct ath9k_platform_data; + + #if defined(CONFIG_ATH79_DEV_AP9X_PCI) +@@ -20,6 +21,8 @@ void ap9x_pci_setup_wmac_gpio(unsigned wmac, u32 mask, u32 val); + void ap9x_pci_setup_wmac_leds(unsigned wmac, struct gpio_led *leds, + int num_leds); + void ap9x_pci_setup_wmac_led_name(unsigned wmac, const char *led_name); ++void ap9x_pci_setup_wmac_btns(unsigned wmac, struct gpio_keys_button *btns, ++ unsigned num_btns, unsigned poll_interval); + struct ath9k_platform_data *ap9x_pci_get_wmac_data(unsigned wmac); + + void ap91_pci_init(u8 *cal_data, u8 *mac_addr); +@@ -36,6 +39,10 @@ static inline void ap9x_pci_setup_wmac_leds(unsigned wmac, + int num_leds) {} + static inline void ap9x_pci_setup_wmac_led_name(unsigned wmac, + const char *led_name) {} ++static inline void ap9x_pci_setup_wmac_btns(unsigned wmac, ++ struct gpio_keys_button *btns, ++ unsigned num_btns, ++ unsigned poll_interval) {} + static inline struct ath9k_platform_data *ap9x_pci_get_wmac_data(unsigned wmac) + { + return NULL; +diff --git a/target/linux/generic/files/include/linux/ath9k_platform.h b/target/linux/generic/files/include/linux/ath9k_platform.h +index 823e5ac..e543a64 100644 +--- a/target/linux/generic/files/include/linux/ath9k_platform.h ++++ b/target/linux/generic/files/include/linux/ath9k_platform.h +@@ -46,6 +46,10 @@ struct ath9k_platform_data { + int num_leds; + const struct gpio_led *leds; + const char *led_name; ++ ++ unsigned num_btns; ++ const struct gpio_keys_button *btns; ++ unsigned btn_poll_interval; + }; + + #endif /* _LINUX_ATH9K_PLATFORM_H */ diff --git a/patches/openwrt/0085-mac80211-rework-gpio-chip-button-support-to-build-on-platforms-without-CONFIG_GPIOLIB.patch b/patches/openwrt/0085-mac80211-rework-gpio-chip-button-support-to-build-on-platforms-without-CONFIG_GPIOLIB.patch new file mode 100644 index 00000000..24cd5638 --- /dev/null +++ b/patches/openwrt/0085-mac80211-rework-gpio-chip-button-support-to-build-on-platforms-without-CONFIG_GPIOLIB.patch @@ -0,0 +1,827 @@ +From: Matthias Schiffer +Date: Sun, 29 May 2016 13:39:10 +0200 +Subject: mac80211: rework gpio chip/button support to build on platforms without CONFIG_GPIOLIB + +Signed-off-by: Felix Fietkau + +Backport of r48938 + +diff --git a/package/kernel/mac80211/patches/548-ath9k_enable_gpio_chip.patch b/package/kernel/mac80211/patches/548-ath9k_enable_gpio_chip.patch +new file mode 100644 +index 0000000..f91d85c +--- /dev/null ++++ b/package/kernel/mac80211/patches/548-ath9k_enable_gpio_chip.patch +@@ -0,0 +1,235 @@ ++From: Michal Cieslakiewicz ++Date: Sun, 31 Jan 2016 21:01:31 +0100 ++Subject: [PATCH v4 4/8] mac80211: ath9k: enable access to GPIO ++ ++Enable access to GPIO chip and its pins for Atheros AR92xx ++wireless devices. For now AR9285 and AR9287 are supported. ++ ++Signed-off-by: Michal Cieslakiewicz ++Signed-off-by: Felix Fietkau ++--- ++--- a/drivers/net/wireless/ath/ath9k/ath9k.h +++++ b/drivers/net/wireless/ath/ath9k/ath9k.h ++@@ -24,6 +24,7 @@ ++ #include ++ #include ++ #include +++#include ++ ++ #include "common.h" ++ #include "debug.h" ++@@ -963,6 +964,14 @@ struct ath_led { ++ struct led_classdev cdev; ++ }; ++ +++#ifdef CONFIG_GPIOLIB +++struct ath9k_gpio_chip { +++ struct ath_softc *sc; +++ char label[32]; +++ struct gpio_chip gchip; +++}; +++#endif +++ ++ struct ath_softc { ++ struct ieee80211_hw *hw; ++ struct device *dev; ++@@ -1017,6 +1026,9 @@ struct ath_softc { ++ #ifdef CPTCFG_MAC80211_LEDS ++ const char *led_default_trigger; ++ struct list_head leds; +++#ifdef CONFIG_GPIOLIB +++ struct ath9k_gpio_chip *gpiochip; +++#endif ++ #endif ++ ++ #ifdef CPTCFG_ATH9K_DEBUGFS ++--- a/drivers/net/wireless/ath/ath9k/gpio.c +++++ b/drivers/net/wireless/ath/ath9k/gpio.c ++@@ -16,12 +16,138 @@ ++ ++ #include "ath9k.h" ++ #include +++#include +++ +++#ifdef CPTCFG_MAC80211_LEDS +++ +++#ifdef CONFIG_GPIOLIB +++ +++/***************/ +++/* GPIO Chip */ +++/***************/ +++ +++/* gpio_chip handler : set GPIO to input */ +++static int ath9k_gpio_pin_cfg_input(struct gpio_chip *chip, unsigned offset) +++{ +++ struct ath9k_gpio_chip *gc = container_of(chip, struct ath9k_gpio_chip, +++ gchip); +++ +++ ath9k_hw_cfg_gpio_input(gc->sc->sc_ah, offset); +++ +++ return 0; +++} +++ +++/* gpio_chip handler : set GPIO to output */ +++static int ath9k_gpio_pin_cfg_output(struct gpio_chip *chip, unsigned offset, +++ int value) +++{ +++ struct ath9k_gpio_chip *gc = container_of(chip, struct ath9k_gpio_chip, +++ gchip); +++ +++ ath9k_hw_cfg_output(gc->sc->sc_ah, offset, +++ AR_GPIO_OUTPUT_MUX_AS_OUTPUT); +++ ath9k_hw_set_gpio(gc->sc->sc_ah, offset, value); +++ +++ return 0; +++} +++ +++/* gpio_chip handler : query GPIO direction (0=out, 1=in) */ +++static int ath9k_gpio_pin_get_dir(struct gpio_chip *chip, unsigned offset) +++{ +++ struct ath9k_gpio_chip *gc = container_of(chip, struct ath9k_gpio_chip, +++ gchip); +++ struct ath_hw *ah = gc->sc->sc_ah; +++ +++ return !((REG_READ(ah, AR_GPIO_OE_OUT) >> (offset * 2)) & 3); +++} +++ +++/* gpio_chip handler : get GPIO pin value */ +++static int ath9k_gpio_pin_get(struct gpio_chip *chip, unsigned offset) +++{ +++ struct ath9k_gpio_chip *gc = container_of(chip, struct ath9k_gpio_chip, +++ gchip); +++ +++ return ath9k_hw_gpio_get(gc->sc->sc_ah, offset); +++} +++ +++/* gpio_chip handler : set GPIO pin to value */ +++static void ath9k_gpio_pin_set(struct gpio_chip *chip, unsigned offset, +++ int value) +++{ +++ struct ath9k_gpio_chip *gc = container_of(chip, struct ath9k_gpio_chip, +++ gchip); +++ +++ ath9k_hw_set_gpio(gc->sc->sc_ah, offset, value); +++} +++ +++/* register GPIO chip */ +++static void ath9k_register_gpio_chip(struct ath_softc *sc) +++{ +++ struct ath9k_gpio_chip *gc; +++ u16 ng; +++ +++ /* for now only AR9285 and AR9287 are recognized */ +++ if (AR_SREV_9287(sc->sc_ah)) +++ ng = AR9287_NUM_GPIO; +++ else if (AR_SREV_9285(sc->sc_ah)) +++ ng = AR9285_NUM_GPIO; +++ else +++ return; +++ +++ gc = kzalloc(sizeof(struct ath9k_gpio_chip), GFP_KERNEL); +++ if (!gc) +++ return; +++ +++ snprintf(gc->label, sizeof(gc->label), "ath9k-%s", +++ wiphy_name(sc->hw->wiphy)); +++ gc->gchip.label = gc->label; +++ gc->gchip.base = -1; /* determine base automatically */ +++ gc->gchip.ngpio = ng; +++ gc->gchip.direction_input = ath9k_gpio_pin_cfg_input; +++ gc->gchip.direction_output = ath9k_gpio_pin_cfg_output; +++ gc->gchip.get_direction = ath9k_gpio_pin_get_dir; +++ gc->gchip.get = ath9k_gpio_pin_get; +++ gc->gchip.set = ath9k_gpio_pin_set; +++ gc->gchip.owner = THIS_MODULE; +++ +++ if (gpiochip_add(&gc->gchip)) { +++ kfree(gc); +++ return; +++ } +++ +++ sc->gpiochip = gc; +++ gc->sc = sc; +++} +++ +++/* remove GPIO chip */ +++static void ath9k_unregister_gpio_chip(struct ath_softc *sc) +++{ +++ struct ath9k_gpio_chip *gc = sc->gpiochip; +++ +++ if (!gc) +++ return; +++ +++ gpiochip_remove(&gc->gchip); +++ kfree(gc); +++ sc->gpiochip = NULL; +++} +++ +++#else /* CONFIG_GPIOLIB */ +++ +++static inline void ath9k_register_gpio_chip(struct ath_softc *sc) +++{ +++} +++ +++static inline void ath9k_unregister_gpio_chip(struct ath_softc *sc) +++{ +++} +++ +++#endif /* CONFIG_GPIOLIB */ ++ ++ /********************************/ ++ /* LED functions */ ++ /********************************/ ++ ++-#ifdef CPTCFG_MAC80211_LEDS ++ static void ath_led_brightness(struct led_classdev *led_cdev, ++ enum led_brightness brightness) ++ { ++@@ -60,6 +186,12 @@ static int ath_add_led(struct ath_softc ++ else ++ ath9k_hw_set_gpio(sc->sc_ah, gpio->gpio, gpio->active_low); ++ +++#ifdef CONFIG_GPIOLIB +++ /* If there is GPIO chip configured, reserve LED pin */ +++ if (sc->gpiochip) +++ gpio_request(sc->gpiochip->gchip.base + gpio->gpio, gpio->name); +++#endif +++ ++ return 0; ++ } ++ ++@@ -116,11 +248,17 @@ void ath_deinit_leds(struct ath_softc *s ++ ++ while (!list_empty(&sc->leds)) { ++ led = list_first_entry(&sc->leds, struct ath_led, list); +++#ifdef CONFIG_GPIOLIB +++ /* If there is GPIO chip configured, free LED pin */ +++ if (sc->gpiochip) +++ gpio_free(sc->gpiochip->gchip.base + led->gpio->gpio); +++#endif ++ list_del(&led->list); ++ ath_led_brightness(&led->cdev, LED_OFF); ++ led_classdev_unregister(&led->cdev); ++ kfree(led); ++ } +++ ath9k_unregister_gpio_chip(sc); ++ } ++ ++ void ath_init_leds(struct ath_softc *sc) ++@@ -135,6 +273,8 @@ void ath_init_leds(struct ath_softc *sc) ++ if (AR_SREV_9100(sc->sc_ah)) ++ return; ++ +++ ath9k_register_gpio_chip(sc); +++ ++ if (pdata && pdata->led_name) ++ strncpy(led_name, pdata->led_name, sizeof(led_name)); ++ else ++@@ -186,6 +326,7 @@ void ath_fill_led_pin(struct ath_softc * ++ /* LED off, active low */ ++ ath9k_hw_set_gpio(ah, ah->led_pin, (ah->config.led_active_high) ? 0 : 1); ++ } +++ ++ #endif ++ ++ /*******************/ +diff --git a/package/kernel/mac80211/patches/549-ath9k_enable_gpio_buttons.patch b/package/kernel/mac80211/patches/549-ath9k_enable_gpio_buttons.patch +new file mode 100644 +index 0000000..0527406 +--- /dev/null ++++ b/package/kernel/mac80211/patches/549-ath9k_enable_gpio_buttons.patch +@@ -0,0 +1,148 @@ ++From: Michal Cieslakiewicz ++Subject: [PATCH v5 5/8] mac80211: ath9k: enable GPIO buttons ++ ++Enable platform-defined GPIO button support for ath9k device. ++Key poller is activated for attached platform buttons. ++Requires ath9k GPIO chip access. ++ ++Signed-off-by: Michal Cieslakiewicz ++Signed-off-by: Felix Fietkau ++--- ++--- a/drivers/net/wireless/ath/ath9k/ath9k.h +++++ b/drivers/net/wireless/ath/ath9k/ath9k.h ++@@ -1028,6 +1028,7 @@ struct ath_softc { ++ struct list_head leds; ++ #ifdef CONFIG_GPIOLIB ++ struct ath9k_gpio_chip *gpiochip; +++ struct platform_device *btnpdev; /* gpio-keys-polled */ ++ #endif ++ #endif ++ ++--- a/drivers/net/wireless/ath/ath9k/gpio.c +++++ b/drivers/net/wireless/ath/ath9k/gpio.c ++@@ -17,6 +17,8 @@ ++ #include "ath9k.h" ++ #include ++ #include +++#include +++#include ++ ++ #ifdef CPTCFG_MAC80211_LEDS ++ ++@@ -132,6 +134,63 @@ static void ath9k_unregister_gpio_chip(s ++ sc->gpiochip = NULL; ++ } ++ +++/******************/ +++/* GPIO Buttons */ +++/******************/ +++ +++/* add GPIO buttons */ +++static void ath9k_init_buttons(struct ath_softc *sc) +++{ +++ struct ath9k_platform_data *pdata = sc->dev->platform_data; +++ struct platform_device *pdev; +++ struct gpio_keys_platform_data gkpdata; +++ struct gpio_keys_button *bt; +++ int i; +++ +++ if (!sc->gpiochip) +++ return; +++ +++ if (!pdata || !pdata->btns || !pdata->num_btns) +++ return; +++ +++ bt = devm_kmemdup(sc->dev, pdata->btns, +++ pdata->num_btns * sizeof(struct gpio_keys_button), +++ GFP_KERNEL); +++ if (!bt) +++ return; +++ +++ for (i = 0; i < pdata->num_btns; i++) { +++ ath9k_hw_cfg_gpio_input(sc->sc_ah, pdata->btns[i].gpio); +++ bt[i].gpio = sc->gpiochip->gchip.base + pdata->btns[i].gpio; +++ } +++ +++ memset(&gkpdata, 0, sizeof(struct gpio_keys_platform_data)); +++ gkpdata.buttons = bt; +++ gkpdata.nbuttons = pdata->num_btns; +++ gkpdata.poll_interval = pdata->btn_poll_interval; +++ +++ pdev = platform_device_register_data(sc->dev, "gpio-keys-polled", +++ PLATFORM_DEVID_AUTO, &gkpdata, +++ sizeof(gkpdata)); +++ if (!IS_ERR_OR_NULL(pdev)) +++ sc->btnpdev = pdev; +++ else { +++ sc->btnpdev = NULL; +++ devm_kfree(sc->dev, bt); +++ } +++} +++ +++/* remove GPIO buttons */ +++static void ath9k_deinit_buttons(struct ath_softc *sc) +++{ +++ if (!sc->gpiochip || !sc->btnpdev) +++ return; +++ +++ platform_device_unregister(sc->btnpdev); +++ +++ sc->btnpdev = NULL; +++} +++ ++ #else /* CONFIG_GPIOLIB */ ++ ++ static inline void ath9k_register_gpio_chip(struct ath_softc *sc) ++@@ -142,6 +201,14 @@ static inline void ath9k_unregister_gpio ++ { ++ } ++ +++static inline void ath9k_init_buttons(struct ath_softc *sc) +++{ +++} +++ +++static inline void ath9k_deinit_buttons(struct ath_softc *sc) +++{ +++} +++ ++ #endif /* CONFIG_GPIOLIB */ ++ ++ /********************************/ ++@@ -246,6 +313,7 @@ void ath_deinit_leds(struct ath_softc *s ++ { ++ struct ath_led *led; ++ +++ ath9k_deinit_buttons(sc); ++ while (!list_empty(&sc->leds)) { ++ led = list_first_entry(&sc->leds, struct ath_led, list); ++ #ifdef CONFIG_GPIOLIB ++@@ -274,6 +342,7 @@ void ath_init_leds(struct ath_softc *sc) ++ return; ++ ++ ath9k_register_gpio_chip(sc); +++ ath9k_init_buttons(sc); ++ ++ if (pdata && pdata->led_name) ++ strncpy(led_name, pdata->led_name, sizeof(led_name)); ++@@ -289,7 +358,7 @@ void ath_init_leds(struct ath_softc *sc) ++ ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger, ++ !sc->sc_ah->config.led_active_high); ++ ++- if (!pdata) +++ if (!pdata || !pdata->leds || !pdata->num_leds) ++ return; ++ ++ for (i = 0; i < pdata->num_leds; i++) ++--- a/include/linux/ath9k_platform.h +++++ b/include/linux/ath9k_platform.h ++@@ -46,6 +46,10 @@ struct ath9k_platform_data { ++ int num_leds; ++ const struct gpio_led *leds; ++ const char *led_name; +++ +++ unsigned num_btns; +++ const struct gpio_keys_button *btns; +++ unsigned btn_poll_interval; ++ }; ++ ++ #endif /* _LINUX_ATH9K_PLATFORM_H */ +diff --git a/package/kernel/mac80211/patches/549-ath9k_enable_gpio_chip.patch b/package/kernel/mac80211/patches/549-ath9k_enable_gpio_chip.patch +deleted file mode 100644 +index 55bb991..0000000 +--- a/package/kernel/mac80211/patches/549-ath9k_enable_gpio_chip.patch ++++ /dev/null +@@ -1,243 +0,0 @@ +-From: Michal Cieslakiewicz +-Date: Sun, 31 Jan 2016 21:01:31 +0100 +-Subject: [PATCH v4 4/8] mac80211: ath9k: enable access to GPIO +- +-Enable access to GPIO chip and its pins for Atheros AR92xx +-wireless devices. For now AR9285 and AR9287 are supported. +- +-Signed-off-by: Michal Cieslakiewicz +---- +- ath9k.h | 23 ++++++++++++ +- gpio.c | 121 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +- init.c | 2 + +- 3 files changed, 146 insertions(+) +- +---- a/drivers/net/wireless/ath/ath9k/ath9k.h +-+++ b/drivers/net/wireless/ath/ath9k/ath9k.h +-@@ -24,6 +24,7 @@ +- #include +- #include +- #include +-+#include +- +- #include "common.h" +- #include "debug.h" +-@@ -817,6 +818,13 @@ void ath_fill_led_pin(struct ath_softc * +- int ath_create_gpio_led(struct ath_softc *sc, int gpio, const char *name, +- const char *trigger, bool active_low); +- +-+/***************/ +-+/* GPIO Chip */ +-+/***************/ +-+ +-+void ath9k_register_gpio_chip(struct ath_softc *sc); +-+void ath9k_unregister_gpio_chip(struct ath_softc *sc); +-+ +- #else +- static inline void ath_init_leds(struct ath_softc *sc) +- { +-@@ -828,6 +836,14 @@ static inline void ath_deinit_leds(struc +- static inline void ath_fill_led_pin(struct ath_softc *sc) +- { +- } +-+ +-+static inline void ath9k_register_gpio_chip(struct ath_softc *sc) +-+{ +-+} +-+ +-+static inline void ath9k_unregister_gpio_chip(struct ath_softc *sc) +-+{ +-+} +- #endif +- +- /************************/ +-@@ -963,6 +979,12 @@ struct ath_led { +- struct led_classdev cdev; +- }; +- +-+struct ath9k_gpio_chip { +-+ struct ath_softc *sc; +-+ char label[32]; +-+ struct gpio_chip gchip; +-+}; +-+ +- struct ath_softc { +- struct ieee80211_hw *hw; +- struct device *dev; +-@@ -1017,6 +1039,7 @@ struct ath_softc { +- #ifdef CPTCFG_MAC80211_LEDS +- const char *led_default_trigger; +- struct list_head leds; +-+ struct ath9k_gpio_chip *gpiochip; +- #endif +- +- #ifdef CPTCFG_ATH9K_DEBUGFS +---- a/drivers/net/wireless/ath/ath9k/gpio.c +-+++ b/drivers/net/wireless/ath/ath9k/gpio.c +-@@ -22,6 +22,9 @@ +- /********************************/ +- +- #ifdef CPTCFG_MAC80211_LEDS +-+ +-+#include +-+ +- static void ath_led_brightness(struct led_classdev *led_cdev, +- enum led_brightness brightness) +- { +-@@ -60,6 +63,10 @@ static int ath_add_led(struct ath_softc +- else +- ath9k_hw_set_gpio(sc->sc_ah, gpio->gpio, gpio->active_low); +- +-+ /* If there is GPIO chip configured, reserve LED pin */ +-+ if (sc->gpiochip) +-+ gpio_request(sc->gpiochip->gchip.base + gpio->gpio, gpio->name); +-+ +- return 0; +- } +- +-@@ -116,6 +123,9 @@ void ath_deinit_leds(struct ath_softc *s +- +- while (!list_empty(&sc->leds)) { +- led = list_first_entry(&sc->leds, struct ath_led, list); +-+ /* If there is GPIO chip configured, free LED pin */ +-+ if (sc->gpiochip) +-+ gpio_free(sc->gpiochip->gchip.base + led->gpio->gpio); +- list_del(&led->list); +- ath_led_brightness(&led->cdev, LED_OFF); +- led_classdev_unregister(&led->cdev); +-@@ -186,6 +196,117 @@ void ath_fill_led_pin(struct ath_softc * +- /* LED off, active low */ +- ath9k_hw_set_gpio(ah, ah->led_pin, (ah->config.led_active_high) ? 0 : 1); +- } +-+ +-+/***************/ +-+/* GPIO Chip */ +-+/***************/ +-+ +-+/* gpio_chip handler : set GPIO to input */ +-+static int ath9k_gpio_pin_cfg_input(struct gpio_chip *chip, unsigned offset) +-+{ +-+ struct ath9k_gpio_chip *gc = container_of(chip, struct ath9k_gpio_chip, +-+ gchip); +-+ +-+ ath9k_hw_cfg_gpio_input(gc->sc->sc_ah, offset); +-+ +-+ return 0; +-+} +-+ +-+/* gpio_chip handler : set GPIO to output */ +-+static int ath9k_gpio_pin_cfg_output(struct gpio_chip *chip, unsigned offset, +-+ int value) +-+{ +-+ struct ath9k_gpio_chip *gc = container_of(chip, struct ath9k_gpio_chip, +-+ gchip); +-+ +-+ ath9k_hw_cfg_output(gc->sc->sc_ah, offset, +-+ AR_GPIO_OUTPUT_MUX_AS_OUTPUT); +-+ ath9k_hw_set_gpio(gc->sc->sc_ah, offset, value); +-+ +-+ return 0; +-+} +-+ +-+/* gpio_chip handler : query GPIO direction (0=out, 1=in) */ +-+static int ath9k_gpio_pin_get_dir(struct gpio_chip *chip, unsigned offset) +-+{ +-+ struct ath9k_gpio_chip *gc = container_of(chip, struct ath9k_gpio_chip, +-+ gchip); +-+ struct ath_hw *ah = gc->sc->sc_ah; +-+ +-+ return !((REG_READ(ah, AR_GPIO_OE_OUT) >> (offset * 2)) & 3); +-+} +-+ +-+/* gpio_chip handler : get GPIO pin value */ +-+static int ath9k_gpio_pin_get(struct gpio_chip *chip, unsigned offset) +-+{ +-+ struct ath9k_gpio_chip *gc = container_of(chip, struct ath9k_gpio_chip, +-+ gchip); +-+ +-+ return ath9k_hw_gpio_get(gc->sc->sc_ah, offset); +-+} +-+ +-+/* gpio_chip handler : set GPIO pin to value */ +-+static void ath9k_gpio_pin_set(struct gpio_chip *chip, unsigned offset, +-+ int value) +-+{ +-+ struct ath9k_gpio_chip *gc = container_of(chip, struct ath9k_gpio_chip, +-+ gchip); +-+ +-+ ath9k_hw_set_gpio(gc->sc->sc_ah, offset, value); +-+} +-+ +-+/* register GPIO chip */ +-+void ath9k_register_gpio_chip(struct ath_softc *sc) +-+{ +-+ struct ath9k_gpio_chip *gc; +-+ u16 ng; +-+ +-+ /* for now only AR9285 and AR9287 are recognized */ +-+ if (AR_SREV_9287(sc->sc_ah)) +-+ ng = AR9287_NUM_GPIO; +-+ else if (AR_SREV_9285(sc->sc_ah)) +-+ ng = AR9285_NUM_GPIO; +-+ else +-+ return; +-+ +-+ gc = kzalloc(sizeof(struct ath9k_gpio_chip), GFP_KERNEL); +-+ if (!gc) +-+ return; +-+ +-+ snprintf(gc->label, sizeof(gc->label), "ath9k-%s", +-+ wiphy_name(sc->hw->wiphy)); +-+ gc->gchip.label = gc->label; +-+ gc->gchip.base = -1; /* determine base automatically */ +-+ gc->gchip.ngpio = ng; +-+ gc->gchip.direction_input = ath9k_gpio_pin_cfg_input; +-+ gc->gchip.direction_output = ath9k_gpio_pin_cfg_output; +-+ gc->gchip.get_direction = ath9k_gpio_pin_get_dir; +-+ gc->gchip.get = ath9k_gpio_pin_get; +-+ gc->gchip.set = ath9k_gpio_pin_set; +-+ gc->gchip.owner = THIS_MODULE; +-+ +-+ if (gpiochip_add(&gc->gchip)) { +-+ kfree(gc); +-+ return; +-+ } +-+ +-+ sc->gpiochip = gc; +-+ gc->sc = sc; +-+} +-+ +-+/* remove GPIO chip */ +-+void ath9k_unregister_gpio_chip(struct ath_softc *sc) +-+{ +-+ struct ath9k_gpio_chip *gc = sc->gpiochip; +-+ +-+ if (!gc) +-+ return; +-+ +-+ gpiochip_remove(&gc->gchip); +-+ kfree(gc); +-+ sc->gpiochip = NULL; +-+} +-+ +- #endif +- +- /*******************/ +---- a/drivers/net/wireless/ath/ath9k/init.c +-+++ b/drivers/net/wireless/ath/ath9k/init.c +-@@ -975,6 +975,7 @@ int ath9k_init_device(u16 devid, struct +- goto debug_cleanup; +- } +- +-+ ath9k_register_gpio_chip(sc); +- ath_init_leds(sc); +- ath_start_rfkill_poll(sc); +- +-@@ -1022,6 +1023,7 @@ void ath9k_deinit_device(struct ath_soft +- +- wiphy_rfkill_stop_polling(sc->hw->wiphy); +- ath_deinit_leds(sc); +-+ ath9k_unregister_gpio_chip(sc); +- +- ath9k_ps_restore(sc); +- +diff --git a/package/kernel/mac80211/patches/550-ath9k_enable_gpio_buttons.patch b/package/kernel/mac80211/patches/550-ath9k_enable_gpio_buttons.patch +deleted file mode 100644 +index e3a8cec..0000000 +--- a/package/kernel/mac80211/patches/550-ath9k_enable_gpio_buttons.patch ++++ /dev/null +@@ -1,169 +0,0 @@ +-From: Michal Cieslakiewicz +-Subject: [PATCH v5 5/8] mac80211: ath9k: enable GPIO buttons +- +-Enable platform-defined GPIO button support for ath9k device. +-Key poller is activated for attached platform buttons. +-Requires ath9k GPIO chip access. +- +-Signed-off-by: Michal Cieslakiewicz +---- +- drivers/net/wireless/ath/ath9k/ath9k.h | 16 ++++++ +- drivers/net/wireless/ath/ath9k/gpio.c | 77 +++++++++++++++++++++++++++++++++ +- drivers/net/wireless/ath/ath9k/init.c | 2 +- include/linux/ath9k_platform.h | 4 + +- 4 files changed, 99 insertions(+) +- +---- a/drivers/net/wireless/ath/ath9k/ath9k.h +-+++ b/drivers/net/wireless/ath/ath9k/ath9k.h +-@@ -825,6 +825,13 @@ int ath_create_gpio_led(struct ath_softc +- void ath9k_register_gpio_chip(struct ath_softc *sc); +- void ath9k_unregister_gpio_chip(struct ath_softc *sc); +- +-+/******************/ +-+/* GPIO Buttons */ +-+/******************/ +-+ +-+void ath9k_init_buttons(struct ath_softc *sc); +-+void ath9k_deinit_buttons(struct ath_softc *sc); +-+ +- #else +- static inline void ath_init_leds(struct ath_softc *sc) +- { +-@@ -844,6 +851,14 @@ static inline void ath9k_register_gpio_c +- static inline void ath9k_unregister_gpio_chip(struct ath_softc *sc) +- { +- } +-+ +-+static inline void ath9k_init_buttons(struct ath_softc *sc) +-+{ +-+} +-+ +-+static inline void ath9k_deinit_buttons(struct ath_softc *sc) +-+{ +-+} +- #endif +- +- /************************/ +-@@ -1040,6 +1055,7 @@ struct ath_softc { +- const char *led_default_trigger; +- struct list_head leds; +- struct ath9k_gpio_chip *gpiochip; +-+ struct platform_device *btnpdev; /* gpio-keys-polled */ +- #endif +- +- #ifdef CPTCFG_ATH9K_DEBUGFS +---- a/drivers/net/wireless/ath/ath9k/gpio.c +-+++ b/drivers/net/wireless/ath/ath9k/gpio.c +-@@ -24,6 +24,8 @@ +- #ifdef CPTCFG_MAC80211_LEDS +- +- #include +-+#include +-+#include +- +- static void ath_led_brightness(struct led_classdev *led_cdev, +- enum led_brightness brightness) +-@@ -159,7 +161,7 @@ void ath_init_leds(struct ath_softc *sc) +- ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger, +- !sc->sc_ah->config.led_active_high); +- +-- if (!pdata) +-+ if (!pdata || !pdata->leds || !pdata->num_leds) +- return; +- +- for (i = 0; i < pdata->num_leds; i++) +-@@ -307,6 +309,63 @@ void ath9k_unregister_gpio_chip(struct a +- sc->gpiochip = NULL; +- } +- +-+/******************/ +-+/* GPIO Buttons */ +-+/******************/ +-+ +-+/* add GPIO buttons */ +-+void ath9k_init_buttons(struct ath_softc *sc) +-+{ +-+ struct ath9k_platform_data *pdata = sc->dev->platform_data; +-+ struct platform_device *pdev; +-+ struct gpio_keys_platform_data gkpdata; +-+ struct gpio_keys_button *bt; +-+ int i; +-+ +-+ if (!sc->gpiochip) +-+ return; +-+ +-+ if (!pdata || !pdata->btns || !pdata->num_btns) +-+ return; +-+ +-+ bt = devm_kmemdup(sc->dev, pdata->btns, +-+ pdata->num_btns * sizeof(struct gpio_keys_button), +-+ GFP_KERNEL); +-+ if (!bt) +-+ return; +-+ +-+ for (i = 0; i < pdata->num_btns; i++) { +-+ ath9k_hw_cfg_gpio_input(sc->sc_ah, pdata->btns[i].gpio); +-+ bt[i].gpio = sc->gpiochip->gchip.base + pdata->btns[i].gpio; +-+ } +-+ +-+ memset(&gkpdata, 0, sizeof(struct gpio_keys_platform_data)); +-+ gkpdata.buttons = bt; +-+ gkpdata.nbuttons = pdata->num_btns; +-+ gkpdata.poll_interval = pdata->btn_poll_interval; +-+ +-+ pdev = platform_device_register_data(sc->dev, "gpio-keys-polled", +-+ PLATFORM_DEVID_AUTO, &gkpdata, +-+ sizeof(gkpdata)); +-+ if (!IS_ERR_OR_NULL(pdev)) +-+ sc->btnpdev = pdev; +-+ else { +-+ sc->btnpdev = NULL; +-+ devm_kfree(sc->dev, bt); +-+ } +-+} +-+ +-+/* remove GPIO buttons */ +-+void ath9k_deinit_buttons(struct ath_softc *sc) +-+{ +-+ if (!sc->gpiochip || !sc->btnpdev) +-+ return; +-+ +-+ platform_device_unregister(sc->btnpdev); +-+ +-+ sc->btnpdev = NULL; +-+} +-+ +- #endif +- +- /*******************/ +---- a/drivers/net/wireless/ath/ath9k/init.c +-+++ b/drivers/net/wireless/ath/ath9k/init.c +-@@ -977,6 +977,7 @@ int ath9k_init_device(u16 devid, struct +- +- ath9k_register_gpio_chip(sc); +- ath_init_leds(sc); +-+ ath9k_init_buttons(sc); +- ath_start_rfkill_poll(sc); +- +- return 0; +-@@ -1022,6 +1023,7 @@ void ath9k_deinit_device(struct ath_soft +- ath9k_ps_wakeup(sc); +- +- wiphy_rfkill_stop_polling(sc->hw->wiphy); +-+ ath9k_deinit_buttons(sc); +- ath_deinit_leds(sc); +- ath9k_unregister_gpio_chip(sc); +- +---- a/include/linux/ath9k_platform.h +-+++ b/include/linux/ath9k_platform.h +-@@ -46,6 +46,10 @@ struct ath9k_platform_data { +- int num_leds; +- const struct gpio_led *leds; +- const char *led_name; +-+ +-+ unsigned num_btns; +-+ const struct gpio_keys_button *btns; +-+ unsigned btn_poll_interval; +- }; +- +- #endif /* _LINUX_ATH9K_PLATFORM_H */ diff --git a/patches/openwrt/0010-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch b/patches/openwrt/0086-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch similarity index 93% rename from patches/openwrt/0010-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch rename to patches/openwrt/0086-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch index 3b74d88d..ba7ef419 100644 --- a/patches/openwrt/0010-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch +++ b/patches/openwrt/0086-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch @@ -6,7 +6,7 @@ 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..4533335 +index 0000000..14d63f1 --- /dev/null +++ b/package/kernel/mac80211/patches/931-ubnt-uap-plus-hsr.patch @@ -0,0 +1,346 @@ @@ -347,10 +347,10 @@ index 0000000..4533335 + ath9k-$(CPTCFG_ATH9K_PCI) += pci.o +--- a/include/linux/ath9k_platform.h ++++ b/include/linux/ath9k_platform.h -+@@ -44,6 +44,8 @@ struct ath9k_platform_data { -+ -+ int num_leds; -+ const struct gpio_led *leds; ++@@ -50,6 +50,8 @@ struct ath9k_platform_data { ++ unsigned num_btns; ++ const struct gpio_keys_button *btns; ++ unsigned btn_poll_interval; ++ ++ bool ubnt_hsr; + }; @@ -368,25 +368,16 @@ index 7803513..d865ed2 100644 + ap91_pci_init(ee, NULL); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_unifi_outdoor_plus_leds_gpio), -diff --git a/target/linux/generic/patches-3.18/150-ath9k_ubnt_hsr_filter.patch b/target/linux/generic/patches-3.18/150-ath9k_ubnt_hsr_filter.patch -new file mode 100644 -index 0000000..a0ebbc7 ---- /dev/null -+++ b/target/linux/generic/patches-3.18/150-ath9k_ubnt_hsr_filter.patch -@@ -0,0 +1,16 @@ -+Flag that this platform is an Ubiquiti UniFi Outdoor Plus -+containing a RF filter in ath9k's receive path. +diff --git a/target/linux/generic/files/include/linux/ath9k_platform.h b/target/linux/generic/files/include/linux/ath9k_platform.h +index e543a64..2cb0288 100644 +--- a/target/linux/generic/files/include/linux/ath9k_platform.h ++++ b/target/linux/generic/files/include/linux/ath9k_platform.h +@@ -50,6 +50,8 @@ struct ath9k_platform_data { + unsigned num_btns; + const struct gpio_keys_button *btns; + unsigned btn_poll_interval; + -+Signed-off-by: Stefan Rompf -+ -+--- a/include/linux/ath9k_platform.h -++++ b/include/linux/ath9k_platform.h -+@@ -44,6 +44,8 @@ struct ath9k_platform_data { -+ -+ int num_leds; -+ const struct gpio_led *leds; -++ -++ bool ubnt_hsr; -+ }; -+ -+ #endif /* _LINUX_ATH9K_PLATFORM_H */ ++ bool ubnt_hsr; + }; + + #endif /* _LINUX_ATH9K_PLATFORM_H */ From 4becc7dbbd3e8543d4b4f55f033197c4bdda1152 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 29 May 2016 14:28:16 +0200 Subject: [PATCH 429/867] Backport fixes for the WNR2200 --- ...xx-Send-power-to-USB-port-on-WNR2200.patch | 41 +++ ...71xx-WNR2200-fix-for-random-WLAN-MAC.patch | 86 ++++++ ...able-control-of-all-LEDs-and-buttons.patch | 251 ++++++++++++++++++ 3 files changed, 378 insertions(+) create mode 100644 patches/openwrt/0087-ar71xx-Send-power-to-USB-port-on-WNR2200.patch create mode 100644 patches/openwrt/0088-ar71xx-WNR2200-fix-for-random-WLAN-MAC.patch create mode 100644 patches/openwrt/0089-ar71xx-WNR2200-enable-control-of-all-LEDs-and-buttons.patch diff --git a/patches/openwrt/0087-ar71xx-Send-power-to-USB-port-on-WNR2200.patch b/patches/openwrt/0087-ar71xx-Send-power-to-USB-port-on-WNR2200.patch new file mode 100644 index 00000000..42906fc8 --- /dev/null +++ b/patches/openwrt/0087-ar71xx-Send-power-to-USB-port-on-WNR2200.patch @@ -0,0 +1,41 @@ +From: Matthias Schiffer +Date: Sun, 29 May 2016 11:37:08 +0200 +Subject: ar71xx: Send power to USB port on WNR2200 + +This patch fixes ticket #15267 by enabling power on the +WNR2200's USB port. At present, the USB port on the WNR2200 +is non-functional due to it not receiving power. + +This patch defines an additional GPIO pin, but none of the +current GPIO definitions have been modified. + +Signed-off-by: Riley Baird + +Backport of r47236 + +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2200.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2200.c +index 0087cac..5d23f21 100644 +--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2200.c ++++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2200.c +@@ -36,7 +36,7 @@ + #define WNR2200_GPIO_LED_LAN4_GREEN 16 + #define WNR2200_GPIO_LED_PWR_AMBER 21 + #define WNR2200_GPIO_LED_PWR_GREEN 22 +- ++#define WNR2200_GPIO_USB_5V 4 + #define WNR2200_GPIO_USB_POWER 24 + + #define WNR2200_KEYS_POLL_INTERVAL 20 /* msecs */ +@@ -128,9 +128,9 @@ static void __init wnr2200_setup(void) + wnr2200_leds_gpio); + + /* enable power for the USB port */ +- gpio_request_one(WNR2200_GPIO_USB_POWER, +- GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED, +- "USB power"); ++ ap9x_pci_setup_wmac_gpio(0, ++ BIT(WNR2200_GPIO_USB_5V), ++ BIT(WNR2200_GPIO_USB_5V)); + + ath79_register_usb(); + } diff --git a/patches/openwrt/0088-ar71xx-WNR2200-fix-for-random-WLAN-MAC.patch b/patches/openwrt/0088-ar71xx-WNR2200-fix-for-random-WLAN-MAC.patch new file mode 100644 index 00000000..b2fb55c1 --- /dev/null +++ b/patches/openwrt/0088-ar71xx-WNR2200-fix-for-random-WLAN-MAC.patch @@ -0,0 +1,86 @@ +From: Matthias Schiffer +Date: Sun, 29 May 2016 11:45:14 +0200 +Subject: ar71xx: WNR2200: fix for random WLAN MAC + +Fix for invalid/random/duplicate WLAN MAC address in WNR2200. +Permanent platform MAC is calculated and assigned during system startup. +WLAN MAC follows wired Ethernet interface addresses. + +Signed-off-by: Michal Cieslakiewicz + +Backport of r49100 + +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2200.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2200.c +index 5d23f21..37ffc4c 100644 +--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2200.c ++++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2200.c +@@ -12,6 +12,7 @@ + + #include + #include ++#include /* for max() macro */ + + #include + +@@ -45,6 +46,7 @@ + #define WNR2200_MAC0_OFFSET 0 + #define WNR2200_MAC1_OFFSET 6 + #define WNR2200_PCIE_CALDATA_OFFSET 0x1000 ++#define WNR2200_WMAC_OFFSET 0x108c /* wireless MAC is inside ART */ + + static struct gpio_led wnr2200_leds_gpio[] __initdata = { + { +@@ -102,9 +104,40 @@ static struct gpio_led wnr2200_leds_gpio[] __initdata = { + } + }; + ++/* ++ * For WNR2200 ART flash area used for WLAN MAC is usually empty (0xff) ++ * so ath9k driver uses random MAC instead each time module is loaded. ++ * OpenWrt's original fix was to copy eth1 address to WLAN interface. ++ * New solution does not duplicate hardware addresses and is taken from ++ * WNR2000v3 code. It assigns permanent WLAN MAC equal to ethN's MAC ++ * plus 1, so network interfaces get sequential addresses. ++ * If ART wireless MAC address field has been filled by user, use it. ++ */ ++static void __init wnr2200_get_wmac(u8 *wmac_gen_addr, int mac0_art_offset, ++ int mac1_art_offset, int wmac_art_offset) ++{ ++ u8 *art = (u8 *) KSEG1ADDR(0x1fff0000); ++ u8 *eth0_mac_addr = (u8 *) (art + mac0_art_offset); ++ u8 *eth1_mac_addr = (u8 *) (art + mac1_art_offset); ++ u8 *wlan_mac_addr = (u8 *) (art + wmac_art_offset); ++ ++ /* only 0xff if all bits are set - address is invalid, empty area */ ++ if ((wlan_mac_addr[0] & wlan_mac_addr[1] & wlan_mac_addr[2] & ++ wlan_mac_addr[3] & wlan_mac_addr[4] & wlan_mac_addr[5]) == 0xff) { ++ memcpy(wmac_gen_addr, eth0_mac_addr, 5); ++ wmac_gen_addr[5] = max(eth0_mac_addr[5], eth1_mac_addr[5]) + 1; ++ ++ /* Avoid potential conflict in case max(0xff,0x00)+1==0x00 */ ++ if (!wmac_gen_addr[5]) ++ wmac_gen_addr[5] = 1; ++ } else ++ memcpy(wmac_gen_addr, wlan_mac_addr, 6); ++} ++ + static void __init wnr2200_setup(void) + { + u8 *art = (u8 *) KSEG1ADDR(0x1fff0000); ++ u8 wlan_mac_addr[6]; + + ath79_register_mdio(0, 0x0); + +@@ -121,8 +154,10 @@ static void __init wnr2200_setup(void) + ath79_register_eth(1); + + ath79_register_m25p80(NULL); +- ap91_pci_init(art + WNR2200_PCIE_CALDATA_OFFSET, +- art + WNR2200_MAC1_OFFSET); ++ ++ wnr2200_get_wmac(wlan_mac_addr, WNR2200_MAC0_OFFSET, ++ WNR2200_MAC1_OFFSET, WNR2200_WMAC_OFFSET); ++ ap91_pci_init(art + WNR2200_PCIE_CALDATA_OFFSET, wlan_mac_addr); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(wnr2200_leds_gpio), + wnr2200_leds_gpio); diff --git a/patches/openwrt/0089-ar71xx-WNR2200-enable-control-of-all-LEDs-and-buttons.patch b/patches/openwrt/0089-ar71xx-WNR2200-enable-control-of-all-LEDs-and-buttons.patch new file mode 100644 index 00000000..853104ce --- /dev/null +++ b/patches/openwrt/0089-ar71xx-WNR2200-enable-control-of-all-LEDs-and-buttons.patch @@ -0,0 +1,251 @@ +From: Matthias Schiffer +Date: Sun, 29 May 2016 11:50:03 +0200 +Subject: ar71xx: WNR2200: enable control of all LEDs and buttons + +This patch provides full GPIO support for WNR2200 (LEDs and buttons). +It exposes all LEDs to operating system, including Ethernet ones. + +Signed-off-by: Michal Cieslakiewicz + +Backport of r49101 + +diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds +index 9a768cd..ae17853 100644 +--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds ++++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds +@@ -590,6 +590,21 @@ wnr2000-v4) + ucidef_set_led_usbdev "usb" "USB" "netgear:amber:status" "1-1" + ;; + ++wnr2200) ++ ucidef_set_led_netdev "wan-amber" "WAN (amber)" "netgear:amber:wan" "eth0" ++ ucidef_set_led_default "wan-green" "WAN (green)" "netgear:green:wan" "0" ++ ucidef_set_led_netdev "wlan" "WLAN" "netgear:blue:wlan" "wlan0" ++ ucidef_set_led_switch "lan1green" "LAN1 (green)" "netgear:green:lan1" "switch0" "0x02" "0x04" ++ ucidef_set_led_switch "lan2green" "LAN2 (green)" "netgear:green:lan2" "switch0" "0x04" "0x04" ++ ucidef_set_led_switch "lan3green" "LAN3 (green)" "netgear:green:lan3" "switch0" "0x08" "0x04" ++ ucidef_set_led_switch "lan4green" "LAN4 (green)" "netgear:green:lan4" "switch0" "0x10" "0x04" ++ ucidef_set_led_switch "lan1amber" "LAN1 (amber)" "netgear:amber:lan1" "switch0" "0x02" "0x02" ++ ucidef_set_led_switch "lan2amber" "LAN2 (amber)" "netgear:amber:lan2" "switch0" "0x04" "0x02" ++ ucidef_set_led_switch "lan3amber" "LAN3 (amber)" "netgear:amber:lan3" "switch0" "0x08" "0x02" ++ ucidef_set_led_switch "lan4amber" "LAN4 (amber)" "netgear:amber:lan4" "switch0" "0x10" "0x02" ++ ucidef_set_led_usbdev "usb" "USB" "netgear:green:usb" "1-1" ++ ;; ++ + wpn824n) + ucidef_set_led_netdev "wan-amber" "WAN (amber)" "netgear:amber:wan" "eth0" + ucidef_set_led_wlan "wlan" "WLAN" "netgear:blue:wlan" "phy0tpt" +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2200.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2200.c +index 37ffc4c..258d254 100644 +--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2200.c ++++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2200.c +@@ -15,6 +15,8 @@ + #include /* for max() macro */ + + #include ++#include /* needed to disable switch LEDs */ ++#include "common.h" /* needed to disable switch LEDs */ + + #include "dev-ap9x-pci.h" + #include "dev-eth.h" +@@ -24,21 +26,28 @@ + #include "dev-usb.h" + #include "machtypes.h" + ++/* WNR2200 - connected through AR7241 */ + #define WNR2200_GPIO_LED_LAN2_AMBER 0 + #define WNR2200_GPIO_LED_LAN4_AMBER 1 +-#define WNR2200_GPIO_LED_WPS 5 +-#define WNR2200_GPIO_LED_WAN_GREEN 7 +-#define WNR2200_GPIO_LED_USB 8 ++#define WNR2200_GPIO_LED_LAN1_AMBER 6 /* AR724X_GPIO_FUNC_JTAG_DISABLE */ ++#define WNR2200_GPIO_LED_WPS_GREEN 7 /* AR724X_GPIO_FUNC_JTAG_DISABLE */ ++#define WNR2200_GPIO_LED_USB_GREEN 8 /* AR724X_GPIO_FUNC_JTAG_DISABLE */ + #define WNR2200_GPIO_LED_LAN3_AMBER 11 + #define WNR2200_GPIO_LED_WAN_AMBER 12 +-#define WNR2200_GPIO_LED_LAN1_GREEN 13 +-#define WNR2200_GPIO_LED_LAN2_GREEN 14 +-#define WNR2200_GPIO_LED_LAN3_GREEN 15 +-#define WNR2200_GPIO_LED_LAN4_GREEN 16 +-#define WNR2200_GPIO_LED_PWR_AMBER 21 +-#define WNR2200_GPIO_LED_PWR_GREEN 22 +-#define WNR2200_GPIO_USB_5V 4 +-#define WNR2200_GPIO_USB_POWER 24 ++#define WNR2200_GPIO_LED_LAN1_GREEN 13 /* AR724X_..._ETH_SWITCH_LED0 */ ++#define WNR2200_GPIO_LED_LAN2_GREEN 14 /* AR724X_..._ETH_SWITCH_LED1 */ ++#define WNR2200_GPIO_LED_LAN3_GREEN 15 /* AR724X_..._ETH_SWITCH_LED2 */ ++#define WNR2200_GPIO_LED_LAN4_GREEN 16 /* AR724X_..._ETH_SWITCH_LED3 */ ++#define WNR2200_GPIO_LED_WAN_GREEN 17 /* AR724X_..._ETH_SWITCH_LED4 */ ++ ++/* WNR2200 - connected through AR9287 */ ++#define WNR2200_GPIO_WMAC_LED_WLAN_BLUE 0 ++#define WNR2200_GPIO_WMAC_LED_TEST_AMBER 1 ++#define WNR2200_GPIO_WMAC_LED_POWER_GREEN 2 ++#define WNR2200_GPIO_WMAC_BTN_RFKILL 3 ++#define WNR2200_GPIO_WMAC_USB_5V 4 ++#define WNR2200_GPIO_WMAC_BTN_WPS 5 ++#define WNR2200_GPIO_WMAC_BTN_RESET 6 + + #define WNR2200_KEYS_POLL_INTERVAL 20 /* msecs */ + #define WNR2200_KEYS_DEBOUNCE_INTERVAL (3 * WNR2200_KEYS_POLL_INTERVAL) +@@ -50,30 +59,22 @@ + + static struct gpio_led wnr2200_leds_gpio[] __initdata = { + { +- .name = "netgear:amber:lan2", +- .gpio = WNR2200_GPIO_LED_LAN2_AMBER, +- .active_low = 1, +- }, { +- .name = "netgear:amber:lan4", +- .gpio = WNR2200_GPIO_LED_LAN4_AMBER, +- .active_low = 1, +- }, { +- .name = "netgear:green:wps", +- .gpio = WNR2200_GPIO_LED_WPS, +- .active_low = 1, +- }, { +- .name = "netgear:green:wan", +- .gpio = WNR2200_GPIO_LED_WAN_GREEN, ++ .name = "netgear:amber:lan1", ++ .gpio = WNR2200_GPIO_LED_LAN1_AMBER, + .active_low = 1, + }, { +- .name = "netgear:green:usb", +- .gpio = WNR2200_GPIO_LED_USB, ++ .name = "netgear:amber:lan2", ++ .gpio = WNR2200_GPIO_LED_LAN2_AMBER, + .active_low = 1, + }, { + .name = "netgear:amber:lan3", + .gpio = WNR2200_GPIO_LED_LAN3_AMBER, + .active_low = 1, + }, { ++ .name = "netgear:amber:lan4", ++ .gpio = WNR2200_GPIO_LED_LAN4_AMBER, ++ .active_low = 1, ++ }, { + .name = "netgear:amber:wan", + .gpio = WNR2200_GPIO_LED_WAN_AMBER, + .active_low = 1, +@@ -94,12 +95,56 @@ static struct gpio_led wnr2200_leds_gpio[] __initdata = { + .gpio = WNR2200_GPIO_LED_LAN4_GREEN, + .active_low = 1, + }, { +- .name = "netgear:amber:power", +- .gpio = WNR2200_GPIO_LED_PWR_AMBER, ++ .name = "netgear:green:usb", ++ .gpio = WNR2200_GPIO_LED_USB_GREEN, ++ .active_low = 1, ++ }, { ++ .name = "netgear:green:wan", ++ .gpio = WNR2200_GPIO_LED_WAN_GREEN, ++ .active_low = 1, ++ }, { ++ .name = "netgear:green:wps", ++ .gpio = WNR2200_GPIO_LED_WPS_GREEN, ++ .active_low = 1, ++ } ++}; ++ ++static const char *wnr2200_wmac_led_name = "netgear:blue:wlan"; ++ ++static struct gpio_led wnr2200_wmac_leds_gpio[] = { ++ { ++ .name = "netgear:amber:test", ++ .gpio = WNR2200_GPIO_WMAC_LED_TEST_AMBER, + .active_low = 1, + }, { + .name = "netgear:green:power", +- .gpio = WNR2200_GPIO_LED_PWR_GREEN, ++ .gpio = WNR2200_GPIO_WMAC_LED_POWER_GREEN, ++ .active_low = 1, ++ .default_state = LEDS_GPIO_DEFSTATE_ON, ++ } ++}; ++ ++static struct gpio_keys_button wnr2200_wmac_keys_gpio[] = { ++ { ++ .desc = "reset", ++ .type = EV_KEY, ++ .code = KEY_RESTART, ++ .debounce_interval = WNR2200_KEYS_DEBOUNCE_INTERVAL, ++ .gpio = WNR2200_GPIO_WMAC_BTN_RESET, ++ .active_low = 1, ++ }, { ++ .desc = "rfkill", ++ .type = EV_KEY, ++ .code = KEY_RFKILL, ++ .debounce_interval = WNR2200_KEYS_DEBOUNCE_INTERVAL, ++ .gpio = WNR2200_GPIO_WMAC_BTN_RFKILL, ++ .active_low = 1, ++ }, { ++ .desc = "wps", ++ .type = EV_KEY, ++ .code = KEY_WPS_BUTTON, ++ .debounce_interval = WNR2200_KEYS_DEBOUNCE_INTERVAL, ++ .gpio = WNR2200_GPIO_WMAC_BTN_WPS, + .active_low = 1, + } + }; +@@ -139,14 +184,32 @@ static void __init wnr2200_setup(void) + u8 *art = (u8 *) KSEG1ADDR(0x1fff0000); + u8 wlan_mac_addr[6]; + ++ /* ++ * Disable JTAG to use all AR724X GPIO LEDs. Disable CLKs. ++ * Allow OS to control all link LEDs. ++ */ ++ ath79_gpio_function_setup(AR724X_GPIO_FUNC_JTAG_DISABLE | ++ AR724X_GPIO_FUNC_UART_EN, ++ AR724X_GPIO_FUNC_CLK_OBS1_EN | ++ AR724X_GPIO_FUNC_CLK_OBS2_EN | ++ AR724X_GPIO_FUNC_CLK_OBS3_EN | ++ AR724X_GPIO_FUNC_CLK_OBS4_EN | ++ AR724X_GPIO_FUNC_CLK_OBS5_EN | ++ AR724X_GPIO_FUNC_GE0_MII_CLK_EN | ++ AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN | ++ AR724X_GPIO_FUNC_ETH_SWITCH_LED1_EN | ++ AR724X_GPIO_FUNC_ETH_SWITCH_LED2_EN | ++ AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN | ++ AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN); ++ + ath79_register_mdio(0, 0x0); + +- ath79_init_mac(ath79_eth0_data.mac_addr, art+WNR2200_MAC0_OFFSET, 0); ++ ath79_init_mac(ath79_eth0_data.mac_addr, art + WNR2200_MAC0_OFFSET, 0); + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII; + ath79_eth0_data.speed = SPEED_100; + ath79_eth0_data.duplex = DUPLEX_FULL; + +- ath79_init_mac(ath79_eth1_data.mac_addr, art+WNR2200_MAC1_OFFSET, 0); ++ ath79_init_mac(ath79_eth1_data.mac_addr, art + WNR2200_MAC1_OFFSET, 0); + ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII; + ath79_eth1_data.phy_mask = 0x10; + +@@ -160,12 +223,22 @@ static void __init wnr2200_setup(void) + ap91_pci_init(art + WNR2200_PCIE_CALDATA_OFFSET, wlan_mac_addr); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(wnr2200_leds_gpio), +- wnr2200_leds_gpio); ++ wnr2200_leds_gpio); ++ ++ ap9x_pci_setup_wmac_led_pin(0, WNR2200_GPIO_WMAC_LED_WLAN_BLUE); ++ ap9x_pci_setup_wmac_led_name(0, wnr2200_wmac_led_name); ++ ++ ap9x_pci_setup_wmac_leds(0, wnr2200_wmac_leds_gpio, ++ ARRAY_SIZE(wnr2200_wmac_leds_gpio)); ++ ++ /* All 3 buttons are connected to wireless chip */ ++ ap9x_pci_setup_wmac_btns(0, wnr2200_wmac_keys_gpio, ++ ARRAY_SIZE(wnr2200_wmac_keys_gpio), ++ WNR2200_KEYS_POLL_INTERVAL); + + /* enable power for the USB port */ +- ap9x_pci_setup_wmac_gpio(0, +- BIT(WNR2200_GPIO_USB_5V), +- BIT(WNR2200_GPIO_USB_5V)); ++ ap9x_pci_setup_wmac_gpio(0, BIT(WNR2200_GPIO_WMAC_USB_5V), ++ BIT(WNR2200_GPIO_WMAC_USB_5V)); + + ath79_register_usb(); + } From 60aaa426e6dbe2764949e48727bd72cb3d847085 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 29 May 2016 15:04:46 +0200 Subject: [PATCH 430/867] ar71xx-generic: add support for NETGEAR WNR2200 --- targets/ar71xx-generic/profiles.mk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 55d4b1b0..b72f0778 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -265,6 +265,14 @@ $(eval $(call GluonModel,WNDR3700,wndrmac,netgear-wndrmac)) # BROKEN: untested endif $(eval $(call GluonModel,WNDR3700,wndrmacv2,netgear-wndrmacv2)) +ifneq ($(BROKEN),) +# WNR2200 +$(eval $(call GluonProfile,WNR2200)) # BROKEN: untested +$(eval $(call GluonModel,WNR2200,wnr2200,netgear-wnr2200)) +$(eval $(call GluonProfileFactorySuffix,WNR2200,.img)) +endif + + ## Allnet # ALL0315N From 8342294b47ef3f8d5b62e9dff1f6d68ac2c7c939 Mon Sep 17 00:00:00 2001 From: Stefan Tabbert Date: Tue, 10 Nov 2015 17:57:18 +0100 Subject: [PATCH 431/867] sunxi: add Lamobo-R1 No sysupgrade support yet. --- targets/sunxi/profiles.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/targets/sunxi/profiles.mk b/targets/sunxi/profiles.mk index b54eea7b..55416c2a 100644 --- a/targets/sunxi/profiles.mk +++ b/targets/sunxi/profiles.mk @@ -1,4 +1,11 @@ +#Banana Pi/M1 $(eval $(call GluonProfile,Bananapi,uboot-sunxi-Bananapi kmod-rtc-sunxi)) $(eval $(call GluonProfileFactorySuffix,Bananapi,-sdcard-vfat-ext4,.img.gz)) $(eval $(call GluonProfileSysupgradeSuffix,Bananapi)) $(eval $(call GluonModel,Bananapi,Bananapi,lemaker-banana-pi)) + +#BananaPi R1 / Lamobo R1 +$(eval $(call GluonProfile,Lamobo_R1,uboot-sunxi-Lamobo_R1 kmod-ata-sunxi kmod-rtl8192cu kmod-rtc-sunxi swconfig)) +$(eval $(call GluonProfileFactorySuffix,Lamobo_R1,-sdcard-vfat-ext4,.img.gz)) +$(eval $(call GluonProfileSysupgradeSuffix,Lamobo_R1)) +$(eval $(call GluonModel,Lamobo_R1,Lamobo_R1,lemaker-lamobo-r1)) From 3f24aa248af5c616fc997c227a3c2807106c6429 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 29 May 2016 16:40:33 +0200 Subject: [PATCH 432/867] docs: add documentation about site modules --- docs/user/site.rst | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/docs/user/site.rst b/docs/user/site.rst index 5b439646..15cb8afb 100644 --- a/docs/user/site.rst +++ b/docs/user/site.rst @@ -355,6 +355,41 @@ utilities are installed. Depending on the context, you might be able to use comments like ```` as translations to effectively hide the text. +Site modules +------------ + +The file ``modules`` in the site repository is completely optional and can be used +to supply additional package feeds from which packages are built. The git repositories +specified here are retrieved in addition to the default feeds when ``make update`` +it called. + +This file's format is very similar to the toplevel ``modules`` file of the Gluon +tree, with the important different that the list of feeds must be assigned to +the variable ``GLUON_SITE_FEEDS``. Multiple feed names must be separated by spaces, +for example:: + + GLUON_SITE_FEEDS='foo bar' + +The feed names may only contain alphanumerical characters, underscores and slashes. +For each of the feeds, the following variables are used to specify how to update +the feed: + +PACKAGES_${feed}_REPO + The URL of the git repository to clone (usually ``git://`` or ``http(s)://``) + +PACKAGES_${feed}_COMMIT + The commit ID of the repository to use + +PACKAGES_${feed}_BRANCH + Optional: The branch of the repository the given commit ID can be found in. + Defaults to the default branch of the repository (usually ``master``) + +These variables are always all uppercase, so for an entry ``foo`` in GLUON_SITE_FEEDS, +the corresponding configuration variables would be ``PACKAGES_FOO_REPO``, +``PACKAGES_FOO_COMMIT`` and ``PACKAGES_FOO_BRANCH``. Slashes in feed names are +replaced by underscores to get valid shell variable identifiers. + + Examples -------- From 0c8f637daa64e3c72ac13cf05419caa0533f5622 Mon Sep 17 00:00:00 2001 From: copyrights Date: Sun, 8 May 2016 14:28:28 +0200 Subject: [PATCH 433/867] ar71xx-generic: add D-Link DIR-505 rev. A2 as alias of D-Link DIR-505 rev. A1 --- docs/index.rst | 2 +- targets/ar71xx-generic/profiles.mk | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 242e96bc..a3c730a9 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -108,7 +108,7 @@ ar71xx-generic * D-Link - - DIR-505 (A1) + - DIR-505 (A1, A2) - DIR-615 (C1) - DIR-825 (B1) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index b72f0778..400967e8 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -203,10 +203,11 @@ endif ## D-Link -# D-Link DIR-505 rev. A1 +# D-Link DIR-505 rev. A1/A2 $(eval $(call GluonProfile,DIR505A1)) $(eval $(call GluonModel,DIR505A1,dir-505-a1,d-link-dir-505-rev-a1)) +$(eval $(call GluonModelAlias,DIR505A1,d-link-dir-505-rev-a1,d-link-dir-505-rev-a2)) # D-Link DIR-615 rev. C1 $(eval $(call GluonProfile,DIR615C1)) From ca7c71a52b88ade4f901d4f400f511f669843aad Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 29 May 2016 20:19:21 +0200 Subject: [PATCH 434/867] node: fix build on Debian Jessie --- .../openwrt/0005-node-update-to-v0.12.14.patch | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/patches/packages/openwrt/0005-node-update-to-v0.12.14.patch b/patches/packages/openwrt/0005-node-update-to-v0.12.14.patch index 9b03cee4..b748b636 100644 --- a/patches/packages/openwrt/0005-node-update-to-v0.12.14.patch +++ b/patches/packages/openwrt/0005-node-update-to-v0.12.14.patch @@ -7,7 +7,7 @@ While we're at it, also enable parallel builds. Signed-off-by: Matthias Schiffer diff --git a/lang/node/Makefile b/lang/node/Makefile -index 243c8a5..e6fe843 100644 +index 243c8a5..bde7906 100644 --- a/lang/node/Makefile +++ b/lang/node/Makefile @@ -8,17 +8,21 @@ @@ -34,3 +34,12 @@ index 243c8a5..e6fe843 100644 PKG_MAINTAINER:=John Crispin PKG_LICENSE:= +@@ -56,6 +60,8 @@ HOST_CONFIGURE_ARGS:= \ + + HOST_CONFIGURE_CMD:=python ./configure + ++HOST_MAKE_FLAGS += CXXFLAGS='-std=c++11' ++ + define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/ From 5ea9c0833a032e07a1bef91251a109289f6e0d56 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 30 May 2016 01:00:00 +0200 Subject: [PATCH 435/867] node: fix CXXFLAGS on host install Now really fixes the build on Debian Jessie... --- .../packages/openwrt/0005-node-update-to-v0.12.14.patch | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/patches/packages/openwrt/0005-node-update-to-v0.12.14.patch b/patches/packages/openwrt/0005-node-update-to-v0.12.14.patch index b748b636..be6b8a15 100644 --- a/patches/packages/openwrt/0005-node-update-to-v0.12.14.patch +++ b/patches/packages/openwrt/0005-node-update-to-v0.12.14.patch @@ -7,7 +7,7 @@ While we're at it, also enable parallel builds. Signed-off-by: Matthias Schiffer diff --git a/lang/node/Makefile b/lang/node/Makefile -index 243c8a5..bde7906 100644 +index 243c8a5..ed35e17 100644 --- a/lang/node/Makefile +++ b/lang/node/Makefile @@ -8,17 +8,21 @@ @@ -34,11 +34,15 @@ index 243c8a5..bde7906 100644 PKG_MAINTAINER:=John Crispin PKG_LICENSE:= -@@ -56,6 +60,8 @@ HOST_CONFIGURE_ARGS:= \ +@@ -56,6 +60,12 @@ HOST_CONFIGURE_ARGS:= \ HOST_CONFIGURE_CMD:=python ./configure +HOST_MAKE_FLAGS += CXXFLAGS='-std=c++11' ++ ++define Host/Install ++ $(MAKE) -C $(HOST_BUILD_DIR) $(HOST_MAKE_FLAGS) install ++endef + define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include From a852056c37bbc06ac8c7cedd6d821ea7e9f5bf69 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 31 May 2016 17:33:51 +0200 Subject: [PATCH 436/867] Update Gluon packages --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 1336e245..f014b82b 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=63376e23c81e53c21d3c5250c3fb7444a90dc019 +PACKAGES_GLUON_COMMIT=37c7cebf10d79f83151bb41cf6014a1d379ed3fe PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_COMMIT=2a8338559de5c4b077cde7a83f43f4700a17d5cc From 0a936e4de533d8fc2332a0292cad3a1cdff3e345 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Date: Thu, 2 Jun 2016 14:14:13 +0000 Subject: [PATCH 437/867] gluon-batman-adv-core: respondd: add gateway_nexthop field --- package/gluon-mesh-batman-adv-core/src/respondd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package/gluon-mesh-batman-adv-core/src/respondd.c b/package/gluon-mesh-batman-adv-core/src/respondd.c index 7c2ac6c7..f21eb62e 100644 --- a/package/gluon-mesh-batman-adv-core/src/respondd.c +++ b/package/gluon-mesh-batman-adv-core/src/respondd.c @@ -212,11 +212,13 @@ static void add_gateway(struct json_object *obj) { while (getline(&line, &len, f) >= 0) { char addr[18]; + char nexthop[18]; - if (sscanf(line, "=> %17[0-9a-fA-F:]", addr) != 1) + if (sscanf(line, "=> %17[0-9a-fA-F:] ( %*u) %17[0-9a-fA-F:]", addr, nexthop) != 2) continue; json_object_object_add(obj, "gateway", json_object_new_string(addr)); + json_object_object_add(obj, "gateway_nexthop", json_object_new_string(nexthop)); break; } From ffd1f0b3a5b2950d8c626a2de26fb1dc8e384408 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 9 Jun 2016 05:53:57 +0200 Subject: [PATCH 438/867] ar71xx: backport fixes for better CPE210/510 support This patchset enables the RX LNA for the CPE210/510, improving RX by about 20dB. The profiles for CPE210 and CPE510 is split into two images, so the CPE510 can use the correct ART offset, improving the TX power by 10dB. Fixes #796 --- ...10-enable-LNA-for-CPE210-220-510-520.patch | 35 ++++ ...le-into-2-profiles-cpe210-and-cpe510.patch | 169 ++++++++++++++++ ...10-use-second-wifi-calibration-table.patch | 24 +++ ...oader.c-Add-support-for-Archer-C2600.patch | 188 ++++++++++++++++++ ...der-split-CPE210-from-CPE510-profile.patch | 102 ++++++++++ targets/ar71xx-generic/profiles.mk | 13 +- 6 files changed, 525 insertions(+), 6 deletions(-) create mode 100644 patches/openwrt/0090-ar71xx-cpe510-enable-LNA-for-CPE210-220-510-520.patch create mode 100644 patches/openwrt/0091-ar71xx-cpe510-split-profile-into-2-profiles-cpe210-and-cpe510.patch create mode 100644 patches/openwrt/0092-ar71xx-cpe510-use-second-wifi-calibration-table.patch create mode 100644 patches/openwrt/0093-fw-utils-tplink-safeloader.c-Add-support-for-Archer-C2600.patch create mode 100644 patches/openwrt/0094-tools-tplink-safeloader-split-CPE210-from-CPE510-profile.patch diff --git a/patches/openwrt/0090-ar71xx-cpe510-enable-LNA-for-CPE210-220-510-520.patch b/patches/openwrt/0090-ar71xx-cpe510-enable-LNA-for-CPE210-220-510-520.patch new file mode 100644 index 00000000..c5c278bc --- /dev/null +++ b/patches/openwrt/0090-ar71xx-cpe510-enable-LNA-for-CPE210-220-510-520.patch @@ -0,0 +1,35 @@ +From: Matthias Schiffer +Date: Thu, 9 Jun 2016 04:39:08 +0200 +Subject: ar71xx/cpe510: enable LNA for CPE210/220/510/520 + +The LNA improves the rx path. Within a simple test setup +it improved the signal from -60dbm to -40dbm. + +Signed-off-by: Alexander Couzens + +Backport of LEDE 94e23bf7409d6cc4c9efb55ed32aba8e5a497966 + +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c +index 8bf5c0f..5cb052a 100644 +--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c ++++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c +@@ -30,6 +30,9 @@ + #define CPE510_GPIO_LED_L3 15 + #define CPE510_GPIO_LED_L4 16 + ++#define CPE510_GPIO_EXTERNAL_LNA0 18 ++#define CPE510_GPIO_EXTERNAL_LNA1 19 ++ + #define CPE510_GPIO_BTN_RESET 4 + + #define CPE510_KEYS_POLL_INTERVAL 20 /* msecs */ +@@ -93,6 +96,9 @@ static void __init cpe510_setup(void) + ARRAY_SIZE(cpe510_gpio_keys), + cpe510_gpio_keys); + ++ ath79_wmac_set_ext_lna_gpio(0, CPE510_GPIO_EXTERNAL_LNA0); ++ ath79_wmac_set_ext_lna_gpio(1, CPE510_GPIO_EXTERNAL_LNA1); ++ + ath79_register_m25p80(NULL); + + ath79_register_mdio(1, 0); diff --git a/patches/openwrt/0091-ar71xx-cpe510-split-profile-into-2-profiles-cpe210-and-cpe510.patch b/patches/openwrt/0091-ar71xx-cpe510-split-profile-into-2-profiles-cpe210-and-cpe510.patch new file mode 100644 index 00000000..98f4c273 --- /dev/null +++ b/patches/openwrt/0091-ar71xx-cpe510-split-profile-into-2-profiles-cpe210-and-cpe510.patch @@ -0,0 +1,169 @@ +From: Matthias Schiffer +Date: Thu, 9 Jun 2016 04:55:37 +0200 +Subject: ar71xx/cpe510: split profile into 2 profiles cpe210 and cpe510 + +Split profile into 2GHz and 5GHz. The 5GHz devices are +quite "special". The 2 GHz works perfect. + +Signed-off-by: Alexander Couzens + +Backport of LEDE c5ff273d85f69981e5b126eeaed3dee5b4061fb4 + +diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_gpio-switches b/target/linux/ar71xx/base-files/etc/uci-defaults/01_gpio-switches +index b41f275..0f7a415 100644 +--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_gpio-switches ++++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_gpio-switches +@@ -15,6 +15,7 @@ nanostation-m) + nanostation-m-xw) + ucidef_set_gpio_switch "poe_passthrough" "PoE Passthrough" "2" + ;; ++cpe210|\ + cpe510) + ucidef_set_gpio_switch "poe_passthrough" "PoE Passthrough" "20" + ;; +diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds +index ae17853..129f6b7 100644 +--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds ++++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds +@@ -78,6 +78,7 @@ carambola2) + ucidef_set_led_wlan "wlan" "WLAN" "carambola2:green:wlan" "phy0tpt" + ;; + ++cpe210|\ + cpe510) + ucidef_set_led_switch "lan0" "LAN0" "tp-link:green:lan0" "switch0" "0x20" + ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10" +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 4066506..1d0142f 100755 +--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network ++++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network +@@ -71,6 +71,7 @@ bsb) + ucidef_set_interface_wlan + ;; + ++cpe210|\ + cpe510) + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" + ucidef_add_switch "switch0" "1" "1" +diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh +index fbf76c8..4000b5b 100755 +--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh ++++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh +@@ -438,7 +438,11 @@ ar71xx_board_detect() { + *CAP4200AG) + name="cap4200ag" + ;; +- *"CPE210/220/510/520") ++ *"CPE210/220") ++ name="cpe210" ++ tplink_pharos_board_detect ++ ;; ++ *"CPE510/520") + name="cpe510" + tplink_pharos_board_detect + ;; +diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +index 4a4c476..eded91e 100755 +--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh ++++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +@@ -263,6 +263,7 @@ platform_check_image() { + return 0 + ;; + ++ cpe210|\ + cpe510) + tplink_pharos_check_image "$1" && return 0 + return 1 +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c +index 5cb052a..74daf43 100644 +--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c ++++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c +@@ -78,12 +78,8 @@ static struct gpio_keys_button cpe510_gpio_keys[] __initdata = { + } + }; + +- +-static void __init cpe510_setup(void) ++static void __init cpe_setup(u8 *mac) + { +- u8 *mac = (u8 *) KSEG1ADDR(0x1f830008); +- u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000); +- + /* Disable JTAG, enabling GPIOs 0-3 */ + /* Configure OBS4 line, for GPIO 4*/ + ath79_gpio_function_setup(AR934X_GPIO_FUNC_JTAG_DISABLE, +@@ -105,9 +101,31 @@ static void __init cpe510_setup(void) + ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0); + ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; + ath79_register_eth(1); ++} ++ ++ ++static void __init cpe210_setup(void) ++{ ++ u8 *mac = (u8 *) KSEG1ADDR(0x1f830008); ++ u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000); ++ ++ cpe_setup(mac); + + ath79_register_wmac(ee, mac); + } + +-MIPS_MACHINE(ATH79_MACH_CPE510, "CPE510", "TP-LINK CPE210/220/510/520", ++static void __init cpe510_setup(void) ++{ ++ u8 *mac = (u8 *) KSEG1ADDR(0x1f830008); ++ u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000); ++ ++ cpe_setup(mac); ++ ++ ath79_register_wmac(ee, mac); ++} ++ ++MIPS_MACHINE(ATH79_MACH_CPE210, "CPE210", "TP-LINK CPE210/220", ++ cpe210_setup); ++ ++MIPS_MACHINE(ATH79_MACH_CPE510, "CPE510", "TP-LINK CPE510/520", + cpe510_setup); +diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile +index 06dbb77..272abe0 100644 +--- a/target/linux/ar71xx/image/Makefile ++++ b/target/linux/ar71xx/image/Makefile +@@ -2094,7 +2094,8 @@ $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR1043V2,tl-wr1043nd-v2,TL-WR10 + $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR1043V3,tl-wr1043nd-v3,TL-WR1043ND-v2,ttyS0,115200,0x10430003,1,8M)) + $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR2543,tl-wr2543-v1,TL-WR2543N,ttyS0,115200,0x25430001,1,8Mlzma,-v 3.13.99)) + +-$(eval $(call SingleProfile,TPLINK-SAFELOADER,64kraw,CPE510,cpe210-220-510-520,CPE510,ttyS0,115200,$$(cpe510_mtdlayout),CPE510)) ++$(eval $(call SingleProfile,TPLINK-SAFELOADER,64kraw,CPE210_220,cpe210-220,CPE210,ttyS0,115200,$$(cpe510_mtdlayout),CPE510)) ++$(eval $(call SingleProfile,TPLINK-SAFELOADER,64kraw,CPE510_520,cpe510-520,CPE510,ttyS0,115200,$$(cpe510_mtdlayout),CPE510)) + + $(eval $(call SingleProfile,UAPPRO,64k,UAPPRO,ubnt-uap-pro,UAP-PRO,ttyS0,115200,BZ,BZ,ar934x)) + $(eval $(call SingleProfile,UAPPRO,64k,UBNTUNIFIOUTDOORPLUS,ubnt-unifi-outdoor-plus,UBNT-UOP,ttyS0,115200,BZ,BZ,ar7240)) +@@ -2158,6 +2159,7 @@ $(eval $(call MultiProfile,TLWR842,TLWR842V1)) + $(eval $(call MultiProfile,TLWR941,TLWR941NV2 TLWR941NV3 TLWR941NV4)) + $(eval $(call MultiProfile,TLWR1043,TLWR1043V1 TLWR1043V2 TLWR1043V3)) + $(eval $(call MultiProfile,TLWDR4300,TLWDR3500V1 TLWDR3600V1 TLWDR4300V1 TLWDR4300V1IL TLWDR4310V1 MW4530RV1)) ++$(eval $(call MultiProfile,CPE510,CPE210_220 CPE510_520)) + $(eval $(call MultiProfile,TUBE2H,TUBE2H8M TUBE2H16M)) + $(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTROCKETMXW UBNTNANOM UBNTNANOMXW UBNTLOCOXW UBNTUNIFI UBNTUNIFIOUTDOOR UBNTUNIFIOUTDOORPLUS UAPPRO UBNTAIRGW)) + $(eval $(call MultiProfile,WNR612V2,REALWNR612V2 N150R)) +diff --git a/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch b/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch +index dbd3fca..b2f5366 100644 +--- a/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch ++++ b/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch +@@ -1,6 +1,6 @@ + --- a/arch/mips/ath79/machtypes.h + +++ b/arch/mips/ath79/machtypes.h +-@@ -16,22 +16,201 @@ ++@@ -16,22 +16,202 @@ + + enum ath79_mach_type { + ATH79_MACH_GENERIC = 0, +@@ -26,6 +26,7 @@ + + ATH79_MACH_BHU_BXU2000N2_A1, /* BHU BXU2000n-2 A1 */ + + ATH79_MACH_CAP4200AG, /* Senao CAP4200AG */ + + ATH79_MACH_CARAMBOLA2, /* 8devices Carambola2 */ +++ ATH79_MACH_CPE210, /* TP-LINK CPE210 */ + + ATH79_MACH_CPE510, /* TP-LINK CPE510 */ + ATH79_MACH_DB120, /* Atheros DB120 reference board */ + ATH79_MACH_PB44, /* Atheros PB44 reference board */ diff --git a/patches/openwrt/0092-ar71xx-cpe510-use-second-wifi-calibration-table.patch b/patches/openwrt/0092-ar71xx-cpe510-use-second-wifi-calibration-table.patch new file mode 100644 index 00000000..7a5cd5d4 --- /dev/null +++ b/patches/openwrt/0092-ar71xx-cpe510-use-second-wifi-calibration-table.patch @@ -0,0 +1,24 @@ +From: Matthias Schiffer +Date: Thu, 9 Jun 2016 04:57:24 +0200 +Subject: ar71xx/cpe510: use second wifi calibration table + +The cpe510 has two calibration tables. The first calibration +table requires to modify ath9k driver to work (patched tx gain table). + +Signed-off-by: Alexander Couzens + +Backport of LEDE bf27ac019c137e7baf90ca6ef0e40945ae871797 + +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c +index 74daf43..875589d 100644 +--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c ++++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c +@@ -117,7 +117,7 @@ static void __init cpe210_setup(void) + static void __init cpe510_setup(void) + { + u8 *mac = (u8 *) KSEG1ADDR(0x1f830008); +- u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000); ++ u8 *ee = (u8 *) KSEG1ADDR(0x1fff5000); + + cpe_setup(mac); + diff --git a/patches/openwrt/0093-fw-utils-tplink-safeloader.c-Add-support-for-Archer-C2600.patch b/patches/openwrt/0093-fw-utils-tplink-safeloader.c-Add-support-for-Archer-C2600.patch new file mode 100644 index 00000000..0c33a4d3 --- /dev/null +++ b/patches/openwrt/0093-fw-utils-tplink-safeloader.c-Add-support-for-Archer-C2600.patch @@ -0,0 +1,188 @@ +From: Matthias Schiffer +Date: Thu, 9 Jun 2016 05:02:18 +0200 +Subject: fw-utils/tplink-safeloader.c: Add support for Archer C2600 + +Signed-off-by: Ash Benz + +Backport of LEDE 955c341d3bec0eb4971a03924e99156367255d7b + +diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c +index 77a894b..2e204aa 100644 +--- a/tools/firmware-utils/src/tplink-safeloader.c ++++ b/tools/firmware-utils/src/tplink-safeloader.c +@@ -105,6 +105,8 @@ static const uint8_t md5_salt[16] = { + /** Vendor information for CPE210/220/510/520 */ + static const char cpe510_vendor[] = "CPE510(TP-LINK|UN|N300-5):1.0\r\n"; + ++/** Vendor information for C2600 */ ++static const char c2600_vendor[] = ""; + + /** + The flash partition table for CPE210/220/510/520; +@@ -128,6 +130,39 @@ static const struct flash_partition_entry cpe510_partitions[] = { + }; + + /** ++ The flash partition table for C2600; ++ it is the same as the one used by the stock images. ++*/ ++static const struct flash_partition_entry c2600_partitions[] = { ++ {"SBL1", 0x00000, 0x20000}, ++ {"MIBIB", 0x20000, 0x20000}, ++ {"SBL2", 0x40000, 0x20000}, ++ {"SBL3", 0x60000, 0x30000}, ++ {"DDRCONFIG", 0x90000, 0x10000}, ++ {"SSD", 0xa0000, 0x10000}, ++ {"TZ", 0xb0000, 0x30000}, ++ {"RPM", 0xe0000, 0x20000}, ++ {"fs-uboot", 0x100000, 0x70000}, ++ {"uboot-env", 0x170000, 0x40000}, ++ {"radio", 0x1b0000, 0x40000}, ++ {"os-image", 0x1f0000, 0x200000}, ++ {"file-system", 0x3f0000, 0x1b00000}, ++ {"default-mac", 0x1ef0000, 0x00200}, ++ {"pin", 0x1ef0200, 0x00200}, ++ {"product-info", 0x1ef0400, 0x0fc00}, ++ {"partition-table", 0x1f00000, 0x10000}, ++ {"soft-version", 0x1f10000, 0x10000}, ++ {"support-list", 0x1f20000, 0x10000}, ++ {"profile", 0x1f30000, 0x10000}, ++ {"default-config", 0x1f40000, 0x10000}, ++ {"user-config", 0x1f50000, 0x40000}, ++ {"qos-db", 0x1f90000, 0x40000}, ++ {"usb-config", 0x1fd0000, 0x10000}, ++ {"log", 0x1fe0000, 0x20000}, ++ {NULL, 0, 0} ++}; ++ ++/** + The support list for CPE210/220/510/520 + */ + static const char cpe510_support_list[] = +@@ -141,6 +176,13 @@ static const char cpe510_support_list[] = + "CPE220(TP-LINK|UN|N300-2):1.0\r\n" + "CPE220(TP-LINK|UN|N300-2):1.1\r\n"; + ++/** ++ The support list for C2600 ++*/ ++static const char c2600_support_list[] = ++ "SupportList:\r\n" ++ "{product_name:Archer C2600,product_ver:1.0.0,special_id:00000000}\r\n"; ++ + #define error(_ret, _errno, _str, ...) \ + do { \ + fprintf(stderr, _str ": %s\n", ## __VA_ARGS__, \ +@@ -240,14 +282,14 @@ static struct image_partition_entry make_soft_version(uint32_t rev) { + } + + /** Generates the support-list partition */ +-static struct image_partition_entry make_support_list(const char *support_list) { ++static struct image_partition_entry make_support_list(const char *support_list, bool trailzero) { + size_t len = strlen(support_list); + struct image_partition_entry entry = alloc_image_partition("support-list", len + 9); + + put32(entry.data, len); + memset(entry.data+4, 0, 4); + memcpy(entry.data+8, support_list, len); +- entry.data[len+8] = '\xff'; ++ entry.data[len+8] = trailzero ? '\x00' : '\xff'; + + return entry; + } +@@ -436,6 +478,37 @@ static void * generate_sysupgrade_image(const struct flash_partition_entry *flas + return image; + } + ++static void * generate_sysupgrade_image_c2600(const struct flash_partition_entry *flash_parts, const struct image_partition_entry *image_parts, size_t *len) { ++ const struct flash_partition_entry *flash_os_image = &flash_parts[11]; ++ const struct flash_partition_entry *flash_file_system = &flash_parts[12]; ++ ++ const struct image_partition_entry *image_os_image = &image_parts[3]; ++ const struct image_partition_entry *image_file_system = &image_parts[4]; ++ ++ assert(strcmp(flash_os_image->name, "os-image") == 0); ++ assert(strcmp(flash_file_system->name, "file-system") == 0); ++ ++ assert(strcmp(image_os_image->name, "os-image") == 0); ++ assert(strcmp(image_file_system->name, "file-system") == 0); ++ ++ if (image_os_image->size > flash_os_image->size) ++ error(1, 0, "kernel image too big (more than %u bytes)", (unsigned)flash_os_image->size); ++ if (image_file_system->size > flash_file_system->size) ++ error(1, 0, "rootfs image too big (more than %u bytes)", (unsigned)flash_file_system->size); ++ ++ *len = flash_file_system->base - flash_os_image->base + image_file_system->size; ++ ++ uint8_t *image = malloc(*len); ++ if (!image) ++ error(1, errno, "malloc"); ++ ++ memset(image, 0xff, *len); ++ ++ memcpy(image, image_os_image->data, image_os_image->size); ++ memcpy(image + flash_file_system->base - flash_os_image->base, image_file_system->data, image_file_system->size); ++ ++ return image; ++} + + /** Generates an image for CPE210/220/510/520 and writes it to a file */ + static void do_cpe510(const char *output, const char *kernel_image, const char *rootfs_image, uint32_t rev, bool add_jffs2_eof, bool sysupgrade) { +@@ -443,7 +516,7 @@ static void do_cpe510(const char *output, const char *kernel_image, const char * + + parts[0] = make_partition_table(cpe510_partitions); + parts[1] = make_soft_version(rev); +- parts[2] = make_support_list(cpe510_support_list); ++ parts[2] = make_support_list(cpe510_support_list,false); + parts[3] = read_file("os-image", kernel_image, false); + parts[4] = read_file("file-system", rootfs_image, add_jffs2_eof); + +@@ -470,6 +543,39 @@ static void do_cpe510(const char *output, const char *kernel_image, const char * + free_image_partition(parts[i]); + } + ++/** Generates an image for C2600 and writes it to a file */ ++static void do_c2600(const char *output, const char *kernel_image, const char *rootfs_image, uint32_t rev, bool add_jffs2_eof, bool sysupgrade) { ++ struct image_partition_entry parts[6] = {}; ++ ++ parts[0] = make_partition_table(c2600_partitions); ++ parts[1] = make_soft_version(rev); ++ parts[2] = make_support_list(c2600_support_list,true); ++ parts[3] = read_file("os-image", kernel_image, false); ++ parts[4] = read_file("file-system", rootfs_image, add_jffs2_eof); ++ ++ size_t len; ++ void *image; ++ if (sysupgrade) ++ image = generate_sysupgrade_image_c2600(c2600_partitions, parts, &len); ++ else ++ image = generate_factory_image(c2600_vendor, parts, &len); ++ ++ FILE *file = fopen(output, "wb"); ++ if (!file) ++ error(1, errno, "unable to open output file"); ++ ++ if (fwrite(image, len, 1, file) != 1) ++ error(1, 0, "unable to write output file"); ++ ++ fclose(file); ++ ++ free(image); ++ ++ size_t i; ++ for (i = 0; parts[i].name; i++) ++ free_image_partition(parts[i]); ++} ++ + + /** Usage output */ + static void usage(const char *argv0) { +@@ -552,6 +658,8 @@ int main(int argc, char *argv[]) { + + if (strcmp(board, "CPE510") == 0) + do_cpe510(output, kernel_image, rootfs_image, rev, add_jffs2_eof, sysupgrade); ++ else if (strcmp(board, "C2600") == 0) ++ do_c2600(output, kernel_image, rootfs_image, rev, add_jffs2_eof, sysupgrade); + else + error(1, 0, "unsupported board %s", board); + diff --git a/patches/openwrt/0094-tools-tplink-safeloader-split-CPE210-from-CPE510-profile.patch b/patches/openwrt/0094-tools-tplink-safeloader-split-CPE210-from-CPE510-profile.patch new file mode 100644 index 00000000..a6c13128 --- /dev/null +++ b/patches/openwrt/0094-tools-tplink-safeloader-split-CPE210-from-CPE510-profile.patch @@ -0,0 +1,102 @@ +From: Matthias Schiffer +Date: Thu, 9 Jun 2016 05:03:35 +0200 +Subject: tools/tplink-safeloader: split CPE210 from CPE510 profile + +The CPE210 was still described for the OEM upgrade as compatible, +even the wireless configuration isn't compatible anymore between +both series (2ghz and 5ghz). +Update the CPE210 image profile to use the new profile. + +Signed-off-by: Alexander Couzens + +Backport of LEDE 824147960569f2c1cd22140c9074c62c3df911a5 + +diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile +index 272abe0..57f38a5 100644 +--- a/target/linux/ar71xx/image/Makefile ++++ b/target/linux/ar71xx/image/Makefile +@@ -2094,7 +2094,7 @@ $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR1043V2,tl-wr1043nd-v2,TL-WR10 + $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR1043V3,tl-wr1043nd-v3,TL-WR1043ND-v2,ttyS0,115200,0x10430003,1,8M)) + $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR2543,tl-wr2543-v1,TL-WR2543N,ttyS0,115200,0x25430001,1,8Mlzma,-v 3.13.99)) + +-$(eval $(call SingleProfile,TPLINK-SAFELOADER,64kraw,CPE210_220,cpe210-220,CPE210,ttyS0,115200,$$(cpe510_mtdlayout),CPE510)) ++$(eval $(call SingleProfile,TPLINK-SAFELOADER,64kraw,CPE210_220,cpe210-220,CPE210,ttyS0,115200,$$(cpe510_mtdlayout),CPE210)) + $(eval $(call SingleProfile,TPLINK-SAFELOADER,64kraw,CPE510_520,cpe510-520,CPE510,ttyS0,115200,$$(cpe510_mtdlayout),CPE510)) + + $(eval $(call SingleProfile,UAPPRO,64k,UAPPRO,ubnt-uap-pro,UAP-PRO,ttyS0,115200,BZ,BZ,ar934x)) +diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c +index 2e204aa..4938f74 100644 +--- a/tools/firmware-utils/src/tplink-safeloader.c ++++ b/tools/firmware-utils/src/tplink-safeloader.c +@@ -163,6 +163,15 @@ static const struct flash_partition_entry c2600_partitions[] = { + }; + + /** ++ The support list for CPE210/220 ++*/ ++static const char cpe210_support_list[] = ++ "SupportList:\r\n" ++ "CPE210(TP-LINK|UN|N300-2):1.0\r\n" ++ "CPE210(TP-LINK|UN|N300-2):1.1\r\n" ++ "CPE220(TP-LINK|UN|N300-2):1.0\r\n" ++ "CPE220(TP-LINK|UN|N300-2):1.1\r\n"; ++/** + The support list for CPE210/220/510/520 + */ + static const char cpe510_support_list[] = +@@ -170,11 +179,7 @@ static const char cpe510_support_list[] = + "CPE510(TP-LINK|UN|N300-5):1.0\r\n" + "CPE510(TP-LINK|UN|N300-5):1.1\r\n" + "CPE520(TP-LINK|UN|N300-5):1.0\r\n" +- "CPE520(TP-LINK|UN|N300-5):1.1\r\n" +- "CPE210(TP-LINK|UN|N300-2):1.0\r\n" +- "CPE210(TP-LINK|UN|N300-2):1.1\r\n" +- "CPE220(TP-LINK|UN|N300-2):1.0\r\n" +- "CPE220(TP-LINK|UN|N300-2):1.1\r\n"; ++ "CPE520(TP-LINK|UN|N300-5):1.1\r\n"; + + /** + The support list for C2600 +@@ -511,12 +516,18 @@ static void * generate_sysupgrade_image_c2600(const struct flash_partition_entry + } + + /** Generates an image for CPE210/220/510/520 and writes it to a file */ +-static void do_cpe510(const char *output, const char *kernel_image, const char *rootfs_image, uint32_t rev, bool add_jffs2_eof, bool sysupgrade) { ++static void do_cpe(const char *output, ++ const char *kernel_image, ++ const char *rootfs_image, ++ uint32_t rev, ++ bool add_jffs2_eof, ++ bool sysupgrade, ++ const char *support_list) { + struct image_partition_entry parts[6] = {}; + + parts[0] = make_partition_table(cpe510_partitions); + parts[1] = make_soft_version(rev); +- parts[2] = make_support_list(cpe510_support_list,false); ++ parts[2] = make_support_list(support_list, false); + parts[3] = read_file("os-image", kernel_image, false); + parts[4] = read_file("file-system", rootfs_image, add_jffs2_eof); + +@@ -549,7 +560,7 @@ static void do_c2600(const char *output, const char *kernel_image, const char *r + + parts[0] = make_partition_table(c2600_partitions); + parts[1] = make_soft_version(rev); +- parts[2] = make_support_list(c2600_support_list,true); ++ parts[2] = make_support_list(c2600_support_list, true); + parts[3] = read_file("os-image", kernel_image, false); + parts[4] = read_file("file-system", rootfs_image, add_jffs2_eof); + +@@ -656,8 +667,10 @@ int main(int argc, char *argv[]) { + if (!output) + error(1, 0, "no output filename has been specified"); + +- if (strcmp(board, "CPE510") == 0) +- do_cpe510(output, kernel_image, rootfs_image, rev, add_jffs2_eof, sysupgrade); ++ if (strcmp(board, "CPE210") == 0) ++ do_cpe(output, kernel_image, rootfs_image, rev, add_jffs2_eof, sysupgrade, cpe210_support_list); ++ else if (strcmp(board, "CPE510") == 0) ++ do_cpe(output, kernel_image, rootfs_image, rev, add_jffs2_eof, sysupgrade, cpe510_support_list); + else if (strcmp(board, "C2600") == 0) + do_c2600(output, kernel_image, rootfs_image, rev, add_jffs2_eof, sysupgrade); + else diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 400967e8..d66fbee1 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -4,14 +4,15 @@ # CPE210/220/510/520 $(eval $(call GluonProfile,CPE510,rssileds)) -$(eval $(call GluonModel,CPE510,cpe210-220-510-520,tp-link-cpe510-v1.0)) -$(eval $(call GluonModelAlias,CPE510,tp-link-cpe510-v1.0,tp-link-cpe210-v1.0)) -$(eval $(call GluonModelAlias,CPE510,tp-link-cpe510-v1.0,tp-link-cpe220-v1.0)) -$(eval $(call GluonModelAlias,CPE510,tp-link-cpe510-v1.0,tp-link-cpe520-v1.0)) -$(eval $(call GluonModelAlias,CPE510,tp-link-cpe510-v1.0,tp-link-cpe210-v1.1)) -$(eval $(call GluonModelAlias,CPE510,tp-link-cpe510-v1.0,tp-link-cpe220-v1.1)) +$(eval $(call GluonModel,CPE510,cpe210-220,tp-link-cpe210-v1.0)) +$(eval $(call GluonModelAlias,CPE510,tp-link-cpe210-v1.0,tp-link-cpe210-v1.1)) +$(eval $(call GluonModelAlias,CPE510,tp-link-cpe210-v1.0,tp-link-cpe220-v1.0)) +$(eval $(call GluonModelAlias,CPE510,tp-link-cpe210-v1.0,tp-link-cpe220-v1.1)) + +$(eval $(call GluonModel,CPE510,cpe510-520,tp-link-cpe510-v1.0)) $(eval $(call GluonModelAlias,CPE510,tp-link-cpe510-v1.0,tp-link-cpe510-v1.1)) +$(eval $(call GluonModelAlias,CPE510,tp-link-cpe510-v1.0,tp-link-cpe520-v1.0)) $(eval $(call GluonModelAlias,CPE510,tp-link-cpe510-v1.0,tp-link-cpe520-v1.1)) # TL-WA701N/ND v1, v2 From 1059a798ef495ce04ab5dbc1a94f0a79ff2a8c6f Mon Sep 17 00:00:00 2001 From: Jan Niehusmann Date: Wed, 15 Jun 2016 15:04:04 +0200 Subject: [PATCH 439/867] ar71xx: add GL-AR150 support Mainly applying a vendor patch from https://github.com/domino-team/OpenWrt-patches (https://raw.githubusercontent.com/domino-team/OpenWrt-patches/master/AR150%2C%20AR300%2C%20Domino%20-%20CC1505/000-gl-ar150-cc.patch) --- .../0095-ar71xx-add-GL-AR150-support.patch | 326 ++++++++++++++++++ targets/ar71xx-generic/profiles.mk | 4 + 2 files changed, 330 insertions(+) create mode 100644 patches/openwrt/0095-ar71xx-add-GL-AR150-support.patch diff --git a/patches/openwrt/0095-ar71xx-add-GL-AR150-support.patch b/patches/openwrt/0095-ar71xx-add-GL-AR150-support.patch new file mode 100644 index 00000000..ca4b803a --- /dev/null +++ b/patches/openwrt/0095-ar71xx-add-GL-AR150-support.patch @@ -0,0 +1,326 @@ +From: Jan Niehusmann +Date: Wed, 15 Jun 2016 14:57:47 +0200 +Subject: ar71xx: add GL-AR150 support + +patch from https://github.com/domino-team/OpenWrt-patches + +https://raw.githubusercontent.com/domino-team/OpenWrt-patches/master/AR150%2C%20AR300%2C%20Domino%20-%20CC1505/000-gl-ar150-cc.patch + +(and fixed indentation in target/linux/ar71xx/base-files/lib/ar71xx.sh) + +diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds +index 129f6b7..e29c1b5 100644 +--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds ++++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds +@@ -182,6 +182,10 @@ dlan-pro-1200-ac) + ucidef_set_led_trigger_gpio "plcr" "dLAN" "devolo:error:dlan" "16" "0" + ;; + ++gl-ar150) ++ ucidef_set_led_wlan "wlan" "WLAN" "gl_ar150:wlan" "phy0tpt" ++ ;; ++ + gl-inet) + ucidef_set_led_netdev "lan" "LAN" "gl-connect:green:lan" "eth1" + ucidef_set_led_wlan "wlan" "WLAN" "gl-connect:red: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 1d0142f..3895394 100755 +--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network ++++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network +@@ -382,6 +382,7 @@ dir-505-a1) + alfa-ap96 |\ + alfa-nx |\ + ap83 |\ ++gl-ar150 |\ + gl-inet |\ + jwap003 |\ + pb42 |\ +diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh +index 4000b5b..2cb884b 100755 +--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh ++++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh +@@ -504,6 +504,9 @@ ar71xx_board_detect() { + name="gl-inet" + gl_inet_board_detect + ;; ++ *"GL AR150") ++ name="gl-ar150" ++ ;; + *"EnGenius EPG5000") + name="epg5000" + ;; +diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +index eded91e..5bd4c2b 100755 +--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh ++++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +@@ -215,6 +215,7 @@ platform_check_image() { + dlan-pro-500-wp | \ + dlan-pro-1200-ac | \ + dragino2 | \ ++ gl-ar150 | \ + epg5000 | \ + esr1750 | \ + esr900 | \ +diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18 +index 514f7d5..0903ee9 100644 +--- a/target/linux/ar71xx/config-3.18 ++++ b/target/linux/ar71xx/config-3.18 +@@ -69,6 +69,7 @@ CONFIG_ATH79_MACH_ESR1750=y + CONFIG_ATH79_MACH_ESR900=y + CONFIG_ATH79_MACH_EW_DORIN=y + CONFIG_ATH79_MACH_F9K1115V2=y ++CONFIG_ATH79_MACH_GL_AR150=y + CONFIG_ATH79_MACH_GL_INET=y + CONFIG_ATH79_MACH_GS_MINIBOX_V1=y + CONFIG_ATH79_MACH_GS_OOLITE=y +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c +new file mode 100644 +index 0000000..310182c +--- /dev/null ++++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c +@@ -0,0 +1,125 @@ ++/* ++ * GL_ar150 board support ++ * ++ * Copyright (C) 2011 dongyuqi <729650915@qq.com> ++ * Copyright (C) 2011-2012 Gabor Juhos ++ * Copyright (C) 2013 alzhao ++ * Copyright (C) 2014 Michel Stempin ++ * ++ * 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 ++ ++#include "dev-eth.h" ++#include "dev-gpio-buttons.h" ++#include "dev-leds-gpio.h" ++#include "dev-m25p80.h" ++#include "dev-usb.h" ++#include "dev-wmac.h" ++#include "machtypes.h" ++ ++#define GL_AR150_GPIO_LED_WLAN 0 ++#define GL_AR150_GPIO_LED_LAN 13 ++#define GL_AR150_GPIO_LED_WAN 15 ++ ++#define GL_AR150_GPIO_BIN_USB 6 ++#define GL_AR150_GPIO_BTN_MANUAL 7 ++#define GL_AR150_GPIO_BTN_AUTO 8 ++#define GL_AR150_GPIO_BTN_RESET 11 ++ ++#define GL_AR150_KEYS_POLL_INTERVAL 20 /* msecs */ ++#define GL_AR150_KEYS_DEBOUNCE_INTERVAL (3 * GL_AR150_KEYS_POLL_INTERVAL) ++ ++#define GL_AR150_MAC0_OFFSET 0x0000 ++#define GL_AR150_MAC1_OFFSET 0x0000 ++#define GL_AR150_CALDATA_OFFSET 0x1000 ++#define GL_AR150_WMAC_MAC_OFFSET 0x0000 ++ ++static struct gpio_led gl_ar150_leds_gpio[] __initdata = { ++ { ++ .name = "gl_ar150:wlan", ++ .gpio = GL_AR150_GPIO_LED_WLAN, ++ .active_low = 0, ++ }, ++ { ++ .name = "gl_ar150:lan", ++ .gpio = GL_AR150_GPIO_LED_LAN, ++ .active_low = 0, ++ }, ++ { ++ .name = "gl_ar150:wan", ++ .gpio = GL_AR150_GPIO_LED_WAN, ++ .active_low = 0, ++ .default_state = 1, ++ }, ++}; ++ ++static struct gpio_keys_button gl_ar150_gpio_keys[] __initdata = { ++ { ++ .desc = "BTN_7", ++ .type = EV_KEY, ++ .code = BTN_7, ++ .debounce_interval = GL_AR150_KEYS_DEBOUNCE_INTERVAL, ++ .gpio = GL_AR150_GPIO_BTN_MANUAL, ++ .active_low = 0, ++ }, ++ { ++ .desc = "BTN_8", ++ .type = EV_KEY, ++ .code = BTN_8, ++ .debounce_interval = GL_AR150_KEYS_DEBOUNCE_INTERVAL, ++ .gpio = GL_AR150_GPIO_BTN_AUTO, ++ .active_low = 0, ++ }, ++ { ++ .desc = "reset", ++ .type = EV_KEY, ++ .code = KEY_RESTART, ++ .debounce_interval = GL_AR150_KEYS_DEBOUNCE_INTERVAL, ++ .gpio = GL_AR150_GPIO_BTN_RESET, ++ .active_low = 0, ++ }, ++}; ++ ++static void __init gl_ar150_setup(void) ++{ ++ ++ /* ART base address */ ++ u8 *art = (u8 *) KSEG1ADDR(0x1fff0000); ++ ++ /* disable PHY_SWAP and PHY_ADDR_SWAP bits */ ++ ath79_setup_ar933x_phy4_switch(false, false); ++ ++ /* register flash. */ ++ ath79_register_m25p80(NULL); ++ ++ /* register gpio LEDs and keys */ ++ ath79_register_leds_gpio(-1, ARRAY_SIZE(gl_ar150_leds_gpio), ++ gl_ar150_leds_gpio); ++ ath79_register_gpio_keys_polled(-1, GL_AR150_KEYS_POLL_INTERVAL, ++ ARRAY_SIZE(gl_ar150_gpio_keys), ++ gl_ar150_gpio_keys); ++ ++ /* enable usb */ ++ gpio_request_one(GL_AR150_GPIO_BIN_USB, ++ GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED, ++ "USB power"); ++ ath79_register_usb(); ++ ++ /* register eth0 as WAN, eth1 as LAN */ ++ ath79_init_mac(ath79_eth0_data.mac_addr, art+GL_AR150_MAC0_OFFSET, 0); ++ ath79_init_mac(ath79_eth1_data.mac_addr, art+GL_AR150_MAC1_OFFSET, 0); ++ ath79_register_mdio(0, 0x0); ++ ath79_register_eth(0); ++ ath79_register_eth(1); ++ ++ /* register wireless mac with cal data */ ++ ath79_register_wmac(art + GL_AR150_CALDATA_OFFSET, art + GL_AR150_WMAC_MAC_OFFSET); ++} ++ ++MIPS_MACHINE(ATH79_MACH_GL_AR150, "GL-AR150", "GL AR150",gl_ar150_setup); +diff --git a/target/linux/ar71xx/generic/profiles/gl-connect.mk b/target/linux/ar71xx/generic/profiles/gl-connect.mk +deleted file mode 100644 +index e9377db..0000000 +--- a/target/linux/ar71xx/generic/profiles/gl-connect.mk ++++ /dev/null +@@ -1,17 +0,0 @@ +-# +-# Copyright (C) 2014 OpenWrt.org +-# +-# This is free software, licensed under the GNU General Public License v2. +-# See /LICENSE for more information. +-# +- +-define Profile/GLINET +- NAME:=GL.iNet +- PACKAGES:=kmod-usb-core kmod-usb2 +-endef +- +-define Profile/GLINET/Description +- Package set optimized for the GL-Connect GL.iNet v1. +-endef +- +-$(eval $(call Profile,GLINET)) +diff --git a/target/linux/ar71xx/generic/profiles/gli.mk b/target/linux/ar71xx/generic/profiles/gli.mk +new file mode 100644 +index 0000000..a6ad661 +--- /dev/null ++++ b/target/linux/ar71xx/generic/profiles/gli.mk +@@ -0,0 +1,27 @@ ++# ++# Copyright (C) 2013 OpenWrt.org ++# ++# This is free software, licensed under the GNU General Public License v2. ++# See /LICENSE for more information. ++# ++define Profile/GLINET ++ NAME:=GL.iNet 6416 ++ PACKAGES:=kmod-usb-core kmod-usb2 ++endef ++ ++define Profile/GLINET/Description ++ Package set optimized for the GL-Connect GL.iNet v1. ++endef ++ ++$(eval $(call Profile,GLINET)) ++ ++define Profile/GL-AR150 ++ NAME:=GL AR150 ++ PACKAGES:=kmod-usb-core kmod-usb2 ++endef ++ ++define Profile/GL-AR150/Description ++ Configuration of GL AR150. ++endef ++ ++$(eval $(call Profile,GL-AR150)) +diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile +index 57f38a5..3ce1809 100644 +--- a/target/linux/ar71xx/image/Makefile ++++ b/target/linux/ar71xx/image/Makefile +@@ -144,6 +144,14 @@ define Device/weio + endef + TARGET_DEVICES += weio + ++define Device/gl-ar150 ++ BOARDNAME = GL-AR150 ++ IMAGE_SIZE = 16000k ++ CONSOLE = ttyATH0,115200 ++ MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro ++endef ++TARGET_DEVICES += gl-ar150 ++ + define Device/wndr3700 + BOARDNAME = WNDR3700 + NETGEAR_KERNEL_MAGIC = 0x33373030 +diff --git a/target/linux/ar71xx/patches-3.18/911-MIPS-ath79-add-gl_ar150.patch b/target/linux/ar71xx/patches-3.18/911-MIPS-ath79-add-gl_ar150.patch +new file mode 100644 +index 0000000..31db581 +--- /dev/null ++++ b/target/linux/ar71xx/patches-3.18/911-MIPS-ath79-add-gl_ar150.patch +@@ -0,0 +1,39 @@ ++--- a/arch/mips/ath79/Kconfig +++++ b/arch/mips/ath79/Kconfig ++@@ -533,6 +533,16 @@ config ATH79_MACH_GL_INET ++ select ATH79_DEV_USB ++ select ATH79_DEV_WMAC ++ +++config ATH79_MACH_GL_AR150 +++ bool "GL AR150 support" +++ select SOC_AR933X +++ select ATH79_DEV_ETH +++ select ATH79_DEV_GPIO_BUTTONS +++ select ATH79_DEV_LEDS_GPIO +++ select ATH79_DEV_M25P80 +++ select ATH79_DEV_USB +++ select ATH79_DEV_WMAC +++ ++ config ATH79_MACH_EAP300V2 ++ bool "EnGenius EAP300 v2 support" ++ select SOC_AR934X ++--- a/arch/mips/ath79/Makefile +++++ b/arch/mips/ath79/Makefile ++@@ -78,6 +78,7 @@ obj-$(CONFIG_ATH79_MACH_EL_MINI) += mach ++ obj-$(CONFIG_ATH79_MACH_EPG5000) += mach-epg5000.o ++ obj-$(CONFIG_ATH79_MACH_ESR1750) += mach-esr1750.o ++ obj-$(CONFIG_ATH79_MACH_F9K1115V2) += mach-f9k1115v2.o +++obj-$(CONFIG_ATH79_MACH_GL_AR150) += mach-gl-ar150.o ++ obj-$(CONFIG_ATH79_MACH_GL_INET) += mach-gl-inet.o ++ obj-$(CONFIG_ATH79_MACH_GS_MINIBOX_V1) += mach-gs-minibox-v1.o ++ obj-$(CONFIG_ATH79_MACH_GS_OOLITE) += mach-gs-oolite.o ++--- a/arch/mips/ath79/machtypes.h +++++ b/arch/mips/ath79/machtypes.h ++@@ -67,6 +67,7 @@ enum ath79_mach_type { ++ ATH79_MACH_ESR1750, /* EnGenius ESR1750 */ ++ ATH79_MACH_EPG5000, /* EnGenius EPG5000 */ ++ ATH79_MACH_F9K1115V2, /* Belkin AC1750DB */ +++ ATH79_MACH_GL_AR150, /* GL-AR150 support */ ++ ATH79_MACH_GL_INET, /* GL-CONNECT GL-INET */ ++ ATH79_MACH_GS_MINIBOX_V1, /* Gainstrong MiniBox V1.0 */ ++ ATH79_MACH_GS_OOLITE, /* GS OOLITE V1.0 */ diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index d66fbee1..587ea6d6 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -289,6 +289,10 @@ $(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)) +$(eval $(call GluonProfile,GL-AR150)) +$(eval $(call GluonModel,GL-AR150,gl-ar150,gl-ar150)) +$(eval $(call GluonProfileFactorySuffix,GL-AR150)) + ## Western Digital # WD MyNet N600 From 20e57a1c7112b02302ca251d30e7df4411536681 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 15 Jun 2016 19:32:15 +0200 Subject: [PATCH 440/867] build: backport a few patches for better Make 4.2+ support --- ...fix-version-detection-for-Make-4.2.1.patch | 24 ++++++++++ ...-j-for-parallel-builds-with-Make-4.2.patch | 48 +++++++++++++++++++ ...ake-fix-parallel-build-with-Make-4.2.patch | 30 ++++++++++++ 3 files changed, 102 insertions(+) create mode 100644 patches/openwrt/0096-scripts-feeds-fix-version-detection-for-Make-4.2.1.patch create mode 100644 patches/openwrt/0097-build-don-t-add-j-for-parallel-builds-with-Make-4.2.patch create mode 100644 patches/openwrt/0098-tools-cmake-fix-parallel-build-with-Make-4.2.patch diff --git a/patches/openwrt/0096-scripts-feeds-fix-version-detection-for-Make-4.2.1.patch b/patches/openwrt/0096-scripts-feeds-fix-version-detection-for-Make-4.2.1.patch new file mode 100644 index 00000000..94b0e4e3 --- /dev/null +++ b/patches/openwrt/0096-scripts-feeds-fix-version-detection-for-Make-4.2.1.patch @@ -0,0 +1,24 @@ +From: Matthias Schiffer +Date: Wed, 15 Jun 2016 19:31:08 +0200 +Subject: scripts: feeds: fix version detection for Make >= 4.2.1 + +Signed-off-by: Jo-Philipp Wich + +Backport of LEDE df18b3756fef6a28d9194368d3156f0cd85fae19 + +diff --git a/scripts/feeds b/scripts/feeds +index f8f29cd..908e56c 100755 +--- a/scripts/feeds ++++ b/scripts/feeds +@@ -22,7 +22,10 @@ my @mkver = split /\s+/, `$mk -v`, 4; + my $valid_mk = 1; + $mkver[0] =~ /^GNU/ or $valid_mk = 0; + $mkver[1] =~ /^Make/ or $valid_mk = 0; +-$mkver[2] >= "3.81" or $valid_mk = 0; ++ ++my ($mkv1, $mkv2) = split /\./, $mkver[2]; ++($mkv1 >= 4 || ($mkv1 == 3 && $mkv2 >= 81)) or $valid_mk = 0; ++ + $valid_mk or die "Unsupported version of make found: $mk\n"; + + my @feeds; diff --git a/patches/openwrt/0097-build-don-t-add-j-for-parallel-builds-with-Make-4.2.patch b/patches/openwrt/0097-build-don-t-add-j-for-parallel-builds-with-Make-4.2.patch new file mode 100644 index 00000000..6cdf13ab --- /dev/null +++ b/patches/openwrt/0097-build-don-t-add-j-for-parallel-builds-with-Make-4.2.patch @@ -0,0 +1,48 @@ +From: Matthias Schiffer +Date: Wed, 15 Jun 2016 19:31:34 +0200 +Subject: build: don't add -j for parallel builds with Make 4.2+ + +Make usually passes -j and jobserver arguments as part of MAKEFLAGS. LEDE +removes MAKEFLAGS to have better control of the build, and re-adds the +jobserver arguments with -j to the Make commandline where desired. + +Make 4.2+ behave differently with these arguments passed on the commandline +than in MAKEFLAGS: -j will override the jobserver argument and the job +count will be unlimited. + +Moving the flags to MAKEFLAGS will need many packages to be changed and +tested; therefore, we opt for a less invasive change for now and just +remove -j for Make 4.2+, as the jobserver argument alone is enough to +enable parallel builds for these Make versions. + +Signed-off-by: Jo-Philipp Wich +Signed-off-by: Matthias Schiffer + +Backport of LEDE 6fb212f2933bbbdf2935124205717c9d0ca72b32 + +diff --git a/include/host-build.mk b/include/host-build.mk +index e2b5f2f..44401b8 100644 +--- a/include/host-build.mk ++++ b/include/host-build.mk +@@ -10,7 +10,7 @@ HOST_INSTALL_DIR ?= $(HOST_BUILD_DIR)/host-install + HOST_BUILD_PARALLEL ?= + + ifneq ($(CONFIG_PKG_BUILD_USE_JOBSERVER),) +- HOST_MAKE_J:=$(if $(MAKE_JOBSERVER),$(MAKE_JOBSERVER) -j) ++ HOST_MAKE_J:=$(if $(MAKE_JOBSERVER),$(MAKE_JOBSERVER) $(if $(filter 3.% 4.0 4.1,$(MAKE_VERSION)),-j)) + else + HOST_MAKE_J:=-j$(CONFIG_PKG_BUILD_JOBS) + endif +diff --git a/include/package.mk b/include/package.mk +index c69d928..a99cdc6 100644 +--- a/include/package.mk ++++ b/include/package.mk +@@ -23,7 +23,7 @@ PKG_RELRO_PARTIAL ?= 1 + PKG_RELRO_FULL ?= 1 + + ifneq ($(CONFIG_PKG_BUILD_USE_JOBSERVER),) +- MAKE_J:=$(if $(MAKE_JOBSERVER),$(MAKE_JOBSERVER) -j) ++ MAKE_J:=$(if $(MAKE_JOBSERVER),$(MAKE_JOBSERVER) $(if $(filter 3.% 4.0 4.1,$(MAKE_VERSION)),-j)) + else + MAKE_J:=-j$(CONFIG_PKG_BUILD_JOBS) + endif diff --git a/patches/openwrt/0098-tools-cmake-fix-parallel-build-with-Make-4.2.patch b/patches/openwrt/0098-tools-cmake-fix-parallel-build-with-Make-4.2.patch new file mode 100644 index 00000000..16709ae6 --- /dev/null +++ b/patches/openwrt/0098-tools-cmake-fix-parallel-build-with-Make-4.2.patch @@ -0,0 +1,30 @@ +From: Matthias Schiffer +Date: Wed, 15 Jun 2016 19:31:49 +0200 +Subject: tools/cmake: fix parallel build with Make 4.2+ + +Avoid using the --parallel argument to the CMake bootstrap, as that doesn't +allow us to remove the -j argument. Instead, pass the HOST_JOBS arguments +in MAKEFLAGS. + +Signed-off-by: Matthias Schiffer + +Backport of LEDE 96db10752483cb07f822686482b44be6c21fbb5f + +diff --git a/tools/cmake/Makefile b/tools/cmake/Makefile +index 08e2b02..6c211de 100644 +--- a/tools/cmake/Makefile ++++ b/tools/cmake/Makefile +@@ -18,10 +18,11 @@ HOST_CONFIGURE_PARALLEL:=1 + + include $(INCLUDE_DIR)/host-build.mk + ++HOST_CONFIGURE_CMD := MAKEFLAGS="$(HOST_JOBS)" $(BASH) ./configure ++ + HOST_CONFIGURE_VARS := + + HOST_CONFIGURE_ARGS := \ +- --prefix=$(STAGING_DIR_HOST) \ +- $(if $(MAKE_JOBSERVER),--parallel="$(MAKE_JOBSERVER)") ++ --prefix=$(STAGING_DIR_HOST) + + $(eval $(call HostBuild)) From d7c1c7fffe76512e16b41a9a8a04d5f024b4bb30 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 16 Jun 2016 01:23:00 +0200 Subject: [PATCH 441/867] kernel: make IPv6 builtin Packages in the openwrt-routing master have adjusted to this upstream change, so we follow. Also saves a bit of space. --- include/gluon.mk | 2 +- ...-IPv6-builtin-if-selected-saves-30KB.patch | 143 ++++++++++++++++++ 2 files changed, 144 insertions(+), 1 deletion(-) create mode 100644 patches/openwrt/0099-linux-make-IPv6-builtin-if-selected-saves-30KB.patch diff --git a/include/gluon.mk b/include/gluon.mk index d49dc13f..ef0f5311 100644 --- a/include/gluon.mk +++ b/include/gluon.mk @@ -75,7 +75,7 @@ GLUON_TARGET_$$(gluon_target)_BOARD := $(1) GLUON_TARGET_$$(gluon_target)_SUBTARGET := $(2) endef -GLUON_DEFAULT_PACKAGES := gluon-core kmod-ipv6 firewall ip6tables -uboot-envtools -wpad-mini hostapd-mini +GLUON_DEFAULT_PACKAGES := gluon-core firewall ip6tables -uboot-envtools -wpad-mini hostapd-mini override DEFAULT_PACKAGES.router := diff --git a/patches/openwrt/0099-linux-make-IPv6-builtin-if-selected-saves-30KB.patch b/patches/openwrt/0099-linux-make-IPv6-builtin-if-selected-saves-30KB.patch new file mode 100644 index 00000000..63a5ddb6 --- /dev/null +++ b/patches/openwrt/0099-linux-make-IPv6-builtin-if-selected-saves-30KB.patch @@ -0,0 +1,143 @@ +From: Matthias Schiffer +Date: Thu, 16 Jun 2016 00:51:07 +0200 +Subject: linux: make IPv6 builtin if selected (saves >30KB) + +Signed-off-by: Steven Barth + +Backport of OpenWrt r46834 + +kmod-ipv6 is added to the PROVIDES of the kernel package, so we don't have +to adjust all packages depending on kmod-ipv6. + +diff --git a/config/Config-build.in b/config/Config-build.in +index 4674d84..cd50290 100644 +--- a/config/Config-build.in ++++ b/config/Config-build.in +@@ -83,7 +83,7 @@ menu "Global build settings" + prompt "Enable IPv6 support in packages" + default y + help +- Enable IPv6 support in packages (passes --enable-ipv6 to configure scripts). ++ Enables IPv6 support in kernel (builtin) and packages. + + config PKG_BUILD_PARALLEL + bool +diff --git a/package/kernel/linux/Makefile b/package/kernel/linux/Makefile +index 45ca9fa..b06c49a 100644 +--- a/package/kernel/linux/Makefile ++++ b/package/kernel/linux/Makefile +@@ -49,6 +49,7 @@ define Package/kernel + TITLE:=Virtual kernel package + VERSION:=$(LINUX_VERSION)-$(LINUX_RELEASE)-$(LINUX_VERMAGIC) + URL:=http://www.kernel.org/ ++ PROVIDES:=$(if $(CONFIG_IPV6),kmod-ipv6) + endef + + define Package/kernel/install +diff --git a/package/kernel/linux/modules/netsupport.mk b/package/kernel/linux/modules/netsupport.mk +index cea8e47..8a2760d 100644 +--- a/package/kernel/linux/modules/netsupport.mk ++++ b/package/kernel/linux/modules/netsupport.mk +@@ -439,7 +439,7 @@ $(eval $(call KernelPackage,iptunnel4)) + define KernelPackage/iptunnel6 + SUBMENU:=$(NETWORK_SUPPORT_MENU) + TITLE:=IPv6 tunneling +- DEPENDS:= +kmod-ipv6 ++ DEPENDS:=@IPV6 + KCONFIG:= \ + CONFIG_INET6_TUNNEL + FILES:=$(LINUX_DIR)/net/ipv6/tunnel6.ko +@@ -456,15 +456,16 @@ $(eval $(call KernelPackage,iptunnel6)) + define KernelPackage/ipv6 + SUBMENU:=$(NETWORK_SUPPORT_MENU) + TITLE:=IPv6 support ++ DEPENDS:=@IPV6 ++ HIDDEN:=1 ++ DEFAULT:=y + KCONFIG:= \ +- CONFIG_IPV6 \ ++ CONFIG_IPV6=y \ + CONFIG_IPV6_PRIVACY=y \ + CONFIG_IPV6_MULTIPLE_TABLES=y \ + CONFIG_IPV6_MROUTE=y \ + CONFIG_IPV6_PIMSM_V2=n \ + CONFIG_IPV6_SUBTREES=y +- FILES:=$(LINUX_DIR)/net/ipv6/ipv6.ko +- AUTOLOAD:=$(call AutoLoad,20,ipv6) + endef + + define KernelPackage/ipv6/description +@@ -476,7 +477,7 @@ $(eval $(call KernelPackage,ipv6)) + + define KernelPackage/sit + SUBMENU:=$(NETWORK_SUPPORT_MENU) +- DEPENDS:=+kmod-ipv6 +kmod-iptunnel +kmod-iptunnel4 ++ DEPENDS:=@IPV6 +kmod-iptunnel +kmod-iptunnel4 + TITLE:=IPv6-in-IPv4 tunnel + KCONFIG:=CONFIG_IPV6_SIT \ + CONFIG_IPV6_SIT_6RD=y +@@ -494,7 +495,7 @@ $(eval $(call KernelPackage,sit)) + define KernelPackage/ip6-tunnel + SUBMENU:=$(NETWORK_SUPPORT_MENU) + TITLE:=IP-in-IPv6 tunnelling +- DEPENDS:= +kmod-ipv6 +kmod-iptunnel6 ++ DEPENDS:=@IPV6 +kmod-iptunnel6 + KCONFIG:= CONFIG_IPV6_TUNNEL + FILES:=$(LINUX_DIR)/net/ipv6/ip6_tunnel.ko + AUTOLOAD:=$(call AutoLoad,32,ip6_tunnel) +@@ -510,7 +511,7 @@ $(eval $(call KernelPackage,ip6-tunnel)) + define KernelPackage/gre + SUBMENU:=$(NETWORK_SUPPORT_MENU) + TITLE:=GRE support +- DEPENDS:=+PACKAGE_kmod-ipv6:kmod-ipv6 +kmod-iptunnel ++ DEPENDS:=+kmod-iptunnel + KCONFIG:=CONFIG_NET_IPGRE CONFIG_NET_IPGRE_DEMUX + FILES:=$(LINUX_DIR)/net/ipv4/ip_gre.ko $(LINUX_DIR)/net/ipv4/gre.ko + AUTOLOAD:=$(call AutoLoad,39,gre ip_gre) +@@ -526,7 +527,7 @@ $(eval $(call KernelPackage,gre)) + define KernelPackage/gre6 + SUBMENU:=$(NETWORK_SUPPORT_MENU) + TITLE:=GRE support over IPV6 +- DEPENDS:=+kmod-ipv6 +kmod-iptunnel +kmod-ip6-tunnel ++ DEPENDS:=@IPV6 +kmod-iptunnel +kmod-ip6-tunnel + KCONFIG:=CONFIG_IPV6_GRE + FILES:=$(LINUX_DIR)/net/ipv6/ip6_gre.ko + AUTOLOAD:=$(call AutoLoad,39,ip6_gre) +@@ -862,7 +863,6 @@ define KernelPackage/l2tp + SUBMENU:=$(NETWORK_SUPPORT_MENU) + TITLE:=Layer Two Tunneling Protocol (L2TP) + DEPENDS:= \ +- +IPV6:kmod-ipv6 \ + +kmod-udptunnel4 \ + +IPV6:kmod-udptunnel6 + KCONFIG:=CONFIG_L2TP \ +@@ -898,7 +898,7 @@ $(eval $(call KernelPackage,l2tp-eth)) + define KernelPackage/l2tp-ip + SUBMENU:=$(NETWORK_SUPPORT_MENU) + TITLE:=L2TP IP encapsulation for L2TPv3 +- DEPENDS:=+kmod-l2tp +IPV6:kmod-ipv6 ++ DEPENDS:=+kmod-l2tp + KCONFIG:=CONFIG_L2TP_IP + FILES:= \ + $(LINUX_DIR)/net/l2tp/l2tp_ip.ko \ +@@ -930,7 +930,7 @@ define KernelPackage/sctp + CONFIG_SCTP_DEFAULT_COOKIE_HMAC_MD5=y + FILES:= $(LINUX_DIR)/net/sctp/sctp.ko + AUTOLOAD:= $(call AutoLoad,32,sctp) +- DEPENDS:=+kmod-lib-crc32c +kmod-crypto-md5 +kmod-crypto-hmac +IPV6:kmod-ipv6 ++ DEPENDS:=+kmod-lib-crc32c +kmod-crypto-md5 +kmod-crypto-hmac + endef + + define KernelPackage/sctp/description +diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile +index 19a8df9..8fd51fe 100644 +--- a/package/network/services/dnsmasq/Makefile ++++ b/package/network/services/dnsmasq/Makefile +@@ -52,7 +52,6 @@ define Package/dnsmasq-full + $(call Package/dnsmasq/Default) + TITLE += (with DNSSEC, DHCPv6, Auth DNS, IPset enabled by default) + DEPENDS:=+PACKAGE_dnsmasq_full_dnssec:libnettle \ +- +PACKAGE_dnsmasq_full_dhcpv6:kmod-ipv6 \ + +PACKAGE_dnsmasq_full_ipset:kmod-ipt-ipset + VARIANT:=full + endef From 80751d9b6d7507d3b9aa4acace98084a3911b60e Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 16 Jun 2016 04:12:40 +0200 Subject: [PATCH 442/867] kernel: change kmod-crypto-{core,arc4} to builtin Another backported upstream change. --- ...kages-with-multiple-PROVIDES-entries.patch | 21 +++ ...mod-crypto-core-and-kmod-crypto-arc4.patch | 167 ++++++++++++++++++ 2 files changed, 188 insertions(+) create mode 100644 patches/openwrt/0100-package-ipkg.mk-fix-Provides-for-packages-with-multiple-PROVIDES-entries.patch create mode 100644 patches/openwrt/0101-kernel-remove-packaging-of-kmod-crypto-core-and-kmod-crypto-arc4.patch diff --git a/patches/openwrt/0100-package-ipkg.mk-fix-Provides-for-packages-with-multiple-PROVIDES-entries.patch b/patches/openwrt/0100-package-ipkg.mk-fix-Provides-for-packages-with-multiple-PROVIDES-entries.patch new file mode 100644 index 00000000..4fc1edd5 --- /dev/null +++ b/patches/openwrt/0100-package-ipkg.mk-fix-Provides-for-packages-with-multiple-PROVIDES-entries.patch @@ -0,0 +1,21 @@ +From: Matthias Schiffer +Date: Thu, 16 Jun 2016 04:28:44 +0200 +Subject: package-ipkg.mk: fix Provides for packages with multiple PROVIDES entries + +Signed-off-by: Matthias Schiffer + +Backport of LEDE 3ee6c17cd14ec1fed0b0491542c499c03fc6d211 + +diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk +index eb4c874..1830d64 100644 +--- a/include/package-ipkg.mk ++++ b/include/package-ipkg.mk +@@ -154,7 +154,7 @@ Package: $(1) + Version: $(VERSION) + $$(call addfield,Depends,$$(Package/$(1)/DEPENDS) + )$$(call addfield,Conflicts,$$(call mergelist,$(CONFLICTS)) +-)$$(call addfield,Provides,$(PROVIDES) ++)$$(call addfield,Provides,$$(call mergelist,$(PROVIDES)) + )$$(call addfield,Source,$(SOURCE) + )$$(call addfield,License,$$(PKG_LICENSE) + )$$(call addfield,LicenseFiles,$$(PKG_LICENSE_FILES) diff --git a/patches/openwrt/0101-kernel-remove-packaging-of-kmod-crypto-core-and-kmod-crypto-arc4.patch b/patches/openwrt/0101-kernel-remove-packaging-of-kmod-crypto-core-and-kmod-crypto-arc4.patch new file mode 100644 index 00000000..594c4724 --- /dev/null +++ b/patches/openwrt/0101-kernel-remove-packaging-of-kmod-crypto-core-and-kmod-crypto-arc4.patch @@ -0,0 +1,167 @@ +From: Matthias Schiffer +Date: Thu, 16 Jun 2016 03:42:03 +0200 +Subject: kernel: remove packaging of kmod-crypto-core and kmod-crypto-arc4 + +Everything except for blkcipher was already built-in, so make blkcipher +built-in as well. + +Signed-off-by: Felix Fietkau + +Backport of OpenWrt r46820 + +The packages kmod-crypto-{core,arc4} are added to kernel PROVIDES to +satisfy dependencies of CC packages. + +diff --git a/package/kernel/linux/Makefile b/package/kernel/linux/Makefile +index b06c49a..19bcbd5 100644 +--- a/package/kernel/linux/Makefile ++++ b/package/kernel/linux/Makefile +@@ -49,7 +49,7 @@ define Package/kernel + TITLE:=Virtual kernel package + VERSION:=$(LINUX_VERSION)-$(LINUX_RELEASE)-$(LINUX_VERMAGIC) + URL:=http://www.kernel.org/ +- PROVIDES:=$(if $(CONFIG_IPV6),kmod-ipv6) ++ PROVIDES:=kmod-crypto-core kmod-crypto-arc4 $(if $(CONFIG_IPV6),kmod-ipv6) + endef + + define Package/kernel/install +diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk +index c8e0fbb..926dab0 100644 +--- a/package/kernel/linux/modules/crypto.mk ++++ b/package/kernel/linux/modules/crypto.mk +@@ -15,24 +15,9 @@ crypto_confvar=CONFIG_CRYPTO_$(word 1,$(subst =,$(space),$(1))) + crypto_file=$(LINUX_DIR)/crypto/$(word 2,$(subst =,$(space),$(1))).ko + crypto_name=$(if $(findstring y,$($(call crypto_confvar,$(1)))),,$(word 2,$(subst =,$(space),$(1)))) + +-define KernelPackage/crypto-core +- SUBMENU:=$(CRYPTO_MENU) +- TITLE:=Core CryptoAPI modules +- KCONFIG:= \ +- CONFIG_CRYPTO=y \ +- CONFIG_CRYPTO_HW=y \ +- CONFIG_CRYPTO_BLKCIPHER \ +- CONFIG_CRYPTO_ALGAPI \ +- $(foreach mod,$(CRYPTO_MODULES),$(call crypto_confvar,$(mod))) +- FILES:=$(foreach mod,$(CRYPTO_MODULES),$(call crypto_file,$(mod))) +-endef +- +-$(eval $(call KernelPackage,crypto-core)) +- +- + define AddDepends/crypto + SUBMENU:=$(CRYPTO_MENU) +- DEPENDS+=+kmod-crypto-core $(1) ++ DEPENDS+= $(1) + endef + + define KernelPackage/crypto-aead +@@ -272,17 +257,6 @@ endif + $(eval $(call KernelPackage,crypto-aes)) + + +-define KernelPackage/crypto-arc4 +- TITLE:=ARC4 (RC4) cipher CryptoAPI module +- KCONFIG:=CONFIG_CRYPTO_ARC4 +- FILES:=$(LINUX_DIR)/crypto/arc4.ko +- AUTOLOAD:=$(call AutoLoad,09,arc4) +- $(call AddDepends/crypto) +-endef +- +-$(eval $(call KernelPackage,crypto-arc4)) +- +- + define KernelPackage/crypto-authenc + TITLE:=Combined mode wrapper for IPsec + DEPENDS:=+kmod-crypto-manager +diff --git a/package/kernel/linux/modules/fs.mk b/package/kernel/linux/modules/fs.mk +index fa18237..cc87a45 100644 +--- a/package/kernel/linux/modules/fs.mk ++++ b/package/kernel/linux/modules/fs.mk +@@ -91,7 +91,6 @@ define KernelPackage/fs-cifs + AUTOLOAD:=$(call AutoLoad,30,cifs) + $(call AddDepends/nls) + DEPENDS+= \ +- +kmod-crypto-arc4 \ + +kmod-crypto-hmac \ + +kmod-crypto-md5 \ + +kmod-crypto-md4 \ +diff --git a/package/kernel/linux/modules/netsupport.mk b/package/kernel/linux/modules/netsupport.mk +index 8a2760d..ab76946 100644 +--- a/package/kernel/linux/modules/netsupport.mk ++++ b/package/kernel/linux/modules/netsupport.mk +@@ -714,7 +714,7 @@ $(eval $(call KernelPackage,ipoa)) + define KernelPackage/mppe + SUBMENU:=$(NETWORK_SUPPORT_MENU) + TITLE:=Microsoft PPP compression/encryption +- DEPENDS:=kmod-ppp +kmod-crypto-core +kmod-crypto-arc4 +kmod-crypto-sha1 +kmod-crypto-ecb ++ DEPENDS:=kmod-ppp +kmod-crypto-sha1 +kmod-crypto-ecb + KCONFIG:= \ + CONFIG_PPP_MPPE_MPPC \ + CONFIG_PPP_MPPE +@@ -998,7 +998,7 @@ define KernelPackage/rxrpc + $(LINUX_DIR)/net/rxrpc/af-rxrpc.ko \ + $(LINUX_DIR)/net/rxrpc/rxkad.ko + AUTOLOAD:=$(call AutoLoad,30,rxkad af-rxrpc) +- DEPENDS:=+kmod-crypto-core +kmod-crypto-manager +kmod-crypto-pcbc +kmod-crypto-fcrypt ++ DEPENDS:= +kmod-crypto-manager +kmod-crypto-pcbc +kmod-crypto-fcrypt + endef + + define KernelPackage/rxrpc/description +diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile +index cd8d670..e82bdb0 100644 +--- a/package/kernel/mac80211/Makefile ++++ b/package/kernel/mac80211/Makefile +@@ -92,7 +92,7 @@ endef + define KernelPackage/mac80211 + $(call KernelPackage/mac80211/Default) + TITLE:=Linux 802.11 Wireless Networking Stack +- DEPENDS+= +kmod-cfg80211 +hostapd-common +kmod-crypto-core +kmod-crypto-arc4 ++ DEPENDS+= +kmod-cfg80211 +hostapd-common + KCONFIG:=\ + CONFIG_AVERAGE=y + FILES:= $(PKG_BUILD_DIR)/net/mac80211/mac80211.ko +diff --git a/target/linux/generic/config-3.18 b/target/linux/generic/config-3.18 +index 6038692..a0dc3c9 100644 +--- a/target/linux/generic/config-3.18 ++++ b/target/linux/generic/config-3.18 +@@ -700,9 +700,10 @@ CONFIG_CRYPTO_ALGAPI=y + CONFIG_CRYPTO_ALGAPI2=y + # CONFIG_CRYPTO_ANSI_CPRNG is not set + # CONFIG_CRYPTO_ANUBIS is not set +-# CONFIG_CRYPTO_ARC4 is not set ++CONFIG_CRYPTO_ARC4=y + # CONFIG_CRYPTO_AUTHENC is not set +-# CONFIG_CRYPTO_BLKCIPHER is not set ++CONFIG_CRYPTO_BLKCIPHER=y ++CONFIG_CRYPTO_BLKCIPHER2=y + # CONFIG_CRYPTO_BLOWFISH is not set + # CONFIG_CRYPTO_CAMELLIA is not set + # CONFIG_CRYPTO_CAST5 is not set +diff --git a/target/linux/omap/config-3.18 b/target/linux/omap/config-3.18 +index a06a350..d5003c2 100644 +--- a/target/linux/omap/config-3.18 ++++ b/target/linux/omap/config-3.18 +@@ -114,9 +114,6 @@ CONFIG_CPU_V7=y + CONFIG_CRC16=y + CONFIG_CRYPTO_AEAD=m + CONFIG_CRYPTO_AEAD2=m +-CONFIG_CRYPTO_ARC4=m +-CONFIG_CRYPTO_BLKCIPHER=m +-CONFIG_CRYPTO_BLKCIPHER2=m + CONFIG_CRYPTO_CCM=m + CONFIG_CRYPTO_CRC32C=y + CONFIG_CRYPTO_CTR=m +diff --git a/target/linux/sunxi/config-3.18 b/target/linux/sunxi/config-3.18 +index ddc3f7a..57651bb 100644 +--- a/target/linux/sunxi/config-3.18 ++++ b/target/linux/sunxi/config-3.18 +@@ -110,9 +110,6 @@ CONFIG_CPU_TLB_V7=y + CONFIG_CPU_V7=y + CONFIG_CRC16=y + CONFIG_CRC_T10DIF=y +-CONFIG_CRYPTO_ARC4=y +-CONFIG_CRYPTO_BLKCIPHER=y +-CONFIG_CRYPTO_BLKCIPHER2=y + CONFIG_CRYPTO_CRC32C=y + CONFIG_CRYPTO_CRCT10DIF=y + CONFIG_CRYPTO_DES=y From 2b5bf4c2a28e2bda92f294d379720a9ca4cf8e7c Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 16 Jun 2016 04:40:45 +0200 Subject: [PATCH 443/867] Update OpenWrt and LuCI packages --- modules | 4 ++-- ...ult-language-if-none-provided-by-the-browser-matches.patch | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules b/modules index f014b82b..6123d0a6 100644 --- a/modules +++ b/modules @@ -4,7 +4,7 @@ OPENWRT_REPO=git://git.openwrt.org/15.05/openwrt.git OPENWRT_COMMIT=eadf19c0b43d2f75f196ea8d875a08c7c348530c PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git -PACKAGES_OPENWRT_COMMIT=9622fe984bba3a4547f48bc507ebaba7637eb2b0 +PACKAGES_OPENWRT_COMMIT=73776792f7d58e982be9e5819450d4875b273159 PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git @@ -14,5 +14,5 @@ PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_COMMIT=2a8338559de5c4b077cde7a83f43f4700a17d5cc PACKAGES_LUCI_REPO=git://github.com/openwrt/luci.git -PACKAGES_LUCI_COMMIT=cdcdfd2594634804ab09dc8105e46116edce0cd6 +PACKAGES_LUCI_COMMIT=70a4d43cc895b7d728b4fc201f2b6fd9f4b8aaec PACKAGES_LUCI_BRANCH=for-15.05 diff --git a/patches/packages/luci/0002-modules-base-dispatcher-set-default-language-if-none-provided-by-the-browser-matches.patch b/patches/packages/luci/0002-modules-base-dispatcher-set-default-language-if-none-provided-by-the-browser-matches.patch index 745e6cef..2a64ef95 100644 --- a/patches/packages/luci/0002-modules-base-dispatcher-set-default-language-if-none-provided-by-the-browser-matches.patch +++ b/patches/packages/luci/0002-modules-base-dispatcher-set-default-language-if-none-provided-by-the-browser-matches.patch @@ -3,7 +3,7 @@ Date: Thu, 19 Mar 2015 18:44:52 +0100 Subject: modules/base: dispatcher: set default language if none provided by the browser matches diff --git a/modules/luci-base/luasrc/dispatcher.lua b/modules/luci-base/luasrc/dispatcher.lua -index 8b8d1fa..27f9a15 100644 +index 2526950..be2fc34 100644 --- a/modules/luci-base/luasrc/dispatcher.lua +++ b/modules/luci-base/luasrc/dispatcher.lua @@ -182,6 +182,7 @@ function dispatch(request) From 04106989bb333d6b8a1cdc54bea35362747f135b Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 16 Jun 2016 06:03:09 +0200 Subject: [PATCH 444/867] Update routing packages batman-adv & alfred 2016.2. --- modules | 2 +- .../0001-alfred-adjust-intervals.patch | 4 +- ...-adv-introduce-no_rebroadcast-option.patch | 87 ++++++++++--------- ...n-adv-decrease-maximum-fragment-size.patch | 16 ++-- 4 files changed, 58 insertions(+), 51 deletions(-) diff --git a/modules b/modules index 6123d0a6..7cefc617 100644 --- a/modules +++ b/modules @@ -11,7 +11,7 @@ PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git PACKAGES_GLUON_COMMIT=37c7cebf10d79f83151bb41cf6014a1d379ed3fe PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git -PACKAGES_ROUTING_COMMIT=2a8338559de5c4b077cde7a83f43f4700a17d5cc +PACKAGES_ROUTING_COMMIT=85e771d2f1ca1981983238073ffc602981acbb40 PACKAGES_LUCI_REPO=git://github.com/openwrt/luci.git PACKAGES_LUCI_COMMIT=70a4d43cc895b7d728b4fc201f2b6fd9f4b8aaec diff --git a/patches/packages/routing/0001-alfred-adjust-intervals.patch b/patches/packages/routing/0001-alfred-adjust-intervals.patch index aabb1659..d44b32a7 100644 --- a/patches/packages/routing/0001-alfred-adjust-intervals.patch +++ b/patches/packages/routing/0001-alfred-adjust-intervals.patch @@ -4,13 +4,13 @@ Subject: alfred: adjust intervals diff --git a/alfred/patches/0001-alfred-adjust-intervals.patch b/alfred/patches/0001-alfred-adjust-intervals.patch new file mode 100644 -index 0000000..df70eea +index 0000000..a5860db --- /dev/null +++ b/alfred/patches/0001-alfred-adjust-intervals.patch @@ -0,0 +1,15 @@ +--- a/alfred.h ++++ b/alfred.h -+@@ -33,10 +33,10 @@ ++@@ -34,10 +34,10 @@ + #include "list.h" + #include "packet.h" + 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 f6d1646a..f564a011 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 @@ -3,13 +3,13 @@ Date: Thu, 2 Apr 2015 20:24:14 +0200 Subject: batman-adv: introduce 'no_rebroadcast' option diff --git a/batman-adv/files/lib/netifd/proto/batadv.sh b/batman-adv/files/lib/netifd/proto/batadv.sh -index 632a209..01f567f 100644 +index 1e0c9d0..d0ab238 100644 --- a/batman-adv/files/lib/netifd/proto/batadv.sh +++ b/batman-adv/files/lib/netifd/proto/batadv.sh -@@ -6,16 +6,19 @@ init_proto "$@" - +@@ -7,19 +7,22 @@ init_proto "$@" proto_batadv_init_config() { proto_config_add_string "mesh" + proto_config_add_string "routing_algo" + proto_config_add_string "mesh_no_rebroadcast" } @@ -17,10 +17,13 @@ index 632a209..01f567f 100644 local config="$1" local iface="$2" -- local mesh -- json_get_vars mesh -+ local mesh mesh_no_rebroadcast -+ json_get_vars mesh mesh_no_rebroadcast +- local mesh routing_algo +- json_get_vars mesh routing_algo ++ local mesh routing_algo mesh_no_rebroadcast ++ json_get_vars mesh routing_algo mesh_no_rebroadcast + + [ -n "$routing_algo" ] || routing_algo="BATMAN_IV" + echo "$routing_algo" > "/sys/module/batman_adv/parameters/routing_algo" echo "$mesh" > "/sys/class/net/$iface/batman_adv/mesh_iface" + [ -n "$mesh_no_rebroadcast" ] && echo "$mesh_no_rebroadcast" > "/sys/class/net/$iface/batman_adv/no_rebroadcast" @@ -30,12 +33,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..3324102 +index 0000000..e9f5ffb --- /dev/null +++ b/batman-adv/patches/1001-batman-adv-introduce-no_rebroadcast-option.patch -@@ -0,0 +1,185 @@ -+From bb9feeed3b49a55034cce90be996b11cd095b1ce Mon Sep 17 00:00:00 2001 -+Message-Id: +@@ -0,0 +1,189 @@ ++From bb66988dc6972d5400b4ff4f0b49ed090007d635 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 @@ -63,21 +66,22 @@ index 0000000..3324102 + +Signed-off-by: Linus Lüssing +--- -+ .../ABI/testing/sysfs-class-net-batman-adv | 10 ++++ ++ .../ABI/testing/sysfs-class-net-batman-adv | 11 ++++ + net/batman-adv/hard-interface.c | 2 + + net/batman-adv/send.c | 4 ++ + net/batman-adv/sysfs.c | 59 ++++++++++++++++++++++ + net/batman-adv/types.h | 1 + -+ 5 files changed, 76 insertions(+) ++ 5 files changed, 77 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 ++index 518f6a1..896c480 100644 +--- a/Documentation/ABI/testing/sysfs-class-net-batman-adv ++++ b/Documentation/ABI/testing/sysfs-class-net-batman-adv -+@@ -13,3 +13,13 @@ Description: ++@@ -28,3 +28,14 @@ Description: ++ The /sys/class/net//batman-adv/mesh_iface file + displays the batman mesh interface this + currently is associated with. -+ +++ ++What: /sys/class/net//batman-adv/no_rebroadcast ++Date: Sep 2013 ++Contact: Linus Lüssing @@ -89,12 +93,12 @@ index 0000000..3324102 ++ 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 ++index 8c2f399..48e53d0 100644 +--- a/net/batman-adv/hard-interface.c ++++ b/net/batman-adv/hard-interface.c -+@@ -657,6 +657,8 @@ batadv_hardif_add_interface(struct net_device *net_dev) -+ /* extra reference for return */ -+ atomic_set(&hard_iface->refcount, 2); ++@@ -690,6 +690,8 @@ batadv_hardif_add_interface(struct net_device *net_dev) ++ kref_init(&hard_iface->refcount); ++ kref_get(&hard_iface->refcount); + ++ atomic_set(&hard_iface->no_rebroadcast, 0); ++ @@ -102,10 +106,10 @@ index 0000000..3324102 + 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 ++index f2f1256..3736d75 100644 +--- a/net/batman-adv/send.c ++++ b/net/batman-adv/send.c -+@@ -535,6 +535,10 @@ static void batadv_send_outstanding_bcast_packet(struct work_struct *work) ++@@ -578,6 +578,10 @@ static void batadv_send_outstanding_bcast_packet(struct work_struct *work) + if (forw_packet->num_packets >= hard_iface->num_bcasts) + continue; + @@ -113,14 +117,14 @@ index 0000000..3324102 ++ forw_packet->skb->dev == hard_iface->net_dev) ++ continue; ++ -+ /* send a copy of the saved skb */ -+ skb1 = skb_clone(forw_packet->skb, GFP_ATOMIC); -+ if (skb1) ++ if (!kref_get_unless_zero(&hard_iface->refcount)) ++ continue; ++ +diff --git a/net/batman-adv/sysfs.c b/net/batman-adv/sysfs.c -+index f38d7b7..600633c 100644 ++index 414b207..9aa043f 100644 +--- a/net/batman-adv/sysfs.c ++++ b/net/batman-adv/sysfs.c -+@@ -131,6 +131,17 @@ struct batadv_attribute batadv_attr_vlan_##_name = { \ ++@@ -134,6 +134,17 @@ struct batadv_attribute batadv_attr_vlan_##_name = { \ + .store = _store, \ + } + @@ -138,9 +142,9 @@ index 0000000..3324102 + /* Use this, if you have customized show and store functions */ + #define BATADV_ATTR(_name, _mode, _show, _store) \ + struct batadv_attribute batadv_attr_##_name = { \ -+@@ -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) ++@@ -293,6 +304,52 @@ ssize_t batadv_show_##_name(struct kobject *kobj, \ ++ static BATADV_ATTR(_name, _mode, batadv_show_##_name, \ ++ batadv_store_##_name) + ++#define BATADV_ATTR_HIF_STORE_BOOL(_name, _post_func) \ ++ssize_t batadv_store_hif_##_name(struct kobject *kobj, \ @@ -158,7 +162,7 @@ index 0000000..3324102 ++ res = __batadv_store_bool_attr(buff, count, _post_func, \ ++ attr, &hard_iface->_name, \ ++ hard_iface->soft_iface); \ -++ batadv_hardif_free_ref(hard_iface); \ +++ batadv_hardif_put(hard_iface); \ ++ return res; \ ++} ++ @@ -177,7 +181,7 @@ index 0000000..3324102 ++ res = sprintf(buff, "%s\n", \ ++ atomic_read(&hard_iface->_name) == 0 ? \ ++ "disabled" : "enabled"); \ -++ batadv_hardif_free_ref(hard_iface); \ +++ batadv_hardif_put(hard_iface); \ ++ return res; \ ++} ++ @@ -191,24 +195,27 @@ index 0000000..3324102 + static int batadv_store_bool_attr(char *buff, size_t count, + struct net_device *net_dev, + const char *attr_name, atomic_t *attr, -+@@ -870,10 +927,12 @@ static ssize_t batadv_show_iface_status(struct kobject *kobj, ++@@ -993,6 +1050,7 @@ static ssize_t batadv_show_throughput_override(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); ++BATADV_ATTR_HIF_BOOL(no_rebroadcast, S_IRUGO | S_IWUSR, NULL); -+ ++ #ifdef CONFIG_BATMAN_ADV_BATMAN_V ++ BATADV_ATTR_HIF_UINT(elp_interval, bat_v.elp_interval, S_IRUGO | S_IWUSR, ++ 2 * BATADV_JITTER, INT_MAX, NULL); ++@@ -1004,6 +1062,7 @@ static BATADV_ATTR(throughput_override, S_IRUGO | S_IWUSR, + static struct batadv_attribute *batadv_batman_attrs[] = { + &batadv_attr_mesh_iface, + &batadv_attr_iface_status, ++ &batadv_attr_hif_no_rebroadcast, -+ NULL, -+ }; -+ ++ #ifdef CONFIG_BATMAN_ADV_BATMAN_V ++ &batadv_attr_elp_interval, ++ &batadv_attr_throughput_override, +diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h -+index 5e8c8df..913f104 100644 ++index ba846b0..1a596c5 100644 +--- a/net/batman-adv/types.h ++++ b/net/batman-adv/types.h -+@@ -120,6 +120,7 @@ struct batadv_hard_iface { ++@@ -156,6 +156,7 @@ struct batadv_hard_iface { + struct hlist_head neigh_list; + /* neigh_list_lock protects: neigh_list */ + spinlock_t neigh_list_lock; @@ -217,5 +224,5 @@ index 0000000..3324102 + + /** +-- -+2.7.0 ++2.8.3 + 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 a53bef28..ede150b3 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..56311ea +index 0000000..a97146b --- /dev/null +++ b/batman-adv/patches/1002-batman-adv-decrease-maximum-fragment-size.patch @@ -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 9e7384fde3c5a71f733221a137fdc4593a9638be Mon Sep 17 00:00:00 2001 ++Message-Id: <9e7384fde3c5a71f733221a137fdc4593a9638be.1466048916.git.mschiffer@universe-factory.net> ++In-Reply-To: <8e4c2084bbf2a65ad663a2b1ba27144e5dadfd5f.1466048916.git.mschiffer@universe-factory.net> ++References: <8e4c2084bbf2a65ad663a2b1ba27144e5dadfd5f.1466048916.git.mschiffer@universe-factory.net> +From: Matthias Schiffer +Date: Thu, 6 Aug 2015 22:27:01 +0200 +Subject: [PATCH 2/2] batman-adv: decrease maximum fragment size @@ -21,10 +21,10 @@ index 0000000..56311ea + 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 ++index 7692526..d314e6c 100644 +--- a/net/batman-adv/main.h ++++ b/net/batman-adv/main.h -+@@ -147,7 +147,7 @@ enum batadv_uev_type { ++@@ -159,7 +159,7 @@ enum batadv_uev_type { + /* Maximum number of fragments for one packet */ + #define BATADV_FRAG_MAX_FRAGMENTS 16 + /* Maxumim size of each fragment */ @@ -34,5 +34,5 @@ index 0000000..56311ea + #define BATADV_FRAG_TIMEOUT 10000 + +-- -+2.7.0 ++2.8.3 + From 7a2dd8b3e4c1c9f988c6b6ba681f394e29bd8c73 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 17 Jun 2016 11:20:08 +0200 Subject: [PATCH 445/867] Revert "ar71xx: backport fixes for better CPE210/510 support" This reverts commit ffd1f0b3a5b2950d8c626a2de26fb1dc8e384408. --- ...=> 0090-ar71xx-add-GL-AR150-support.patch} | 16 +- ...10-enable-LNA-for-CPE210-220-510-520.patch | 35 ---- ...le-into-2-profiles-cpe210-and-cpe510.patch | 169 ---------------- ...ix-version-detection-for-Make-4.2.1.patch} | 0 ...10-use-second-wifi-calibration-table.patch | 24 --- ...j-for-parallel-builds-with-Make-4.2.patch} | 0 ...oader.c-Add-support-for-Archer-C2600.patch | 188 ------------------ ...ke-fix-parallel-build-with-Make-4.2.patch} | 0 ...IPv6-builtin-if-selected-saves-30KB.patch} | 0 ...der-split-CPE210-from-CPE510-profile.patch | 102 ---------- ...ages-with-multiple-PROVIDES-entries.patch} | 0 ...od-crypto-core-and-kmod-crypto-arc4.patch} | 0 targets/ar71xx-generic/profiles.mk | 13 +- 13 files changed, 14 insertions(+), 533 deletions(-) rename patches/openwrt/{0095-ar71xx-add-GL-AR150-support.patch => 0090-ar71xx-add-GL-AR150-support.patch} (97%) delete mode 100644 patches/openwrt/0090-ar71xx-cpe510-enable-LNA-for-CPE210-220-510-520.patch delete mode 100644 patches/openwrt/0091-ar71xx-cpe510-split-profile-into-2-profiles-cpe210-and-cpe510.patch rename patches/openwrt/{0096-scripts-feeds-fix-version-detection-for-Make-4.2.1.patch => 0091-scripts-feeds-fix-version-detection-for-Make-4.2.1.patch} (100%) delete mode 100644 patches/openwrt/0092-ar71xx-cpe510-use-second-wifi-calibration-table.patch rename patches/openwrt/{0097-build-don-t-add-j-for-parallel-builds-with-Make-4.2.patch => 0092-build-don-t-add-j-for-parallel-builds-with-Make-4.2.patch} (100%) delete mode 100644 patches/openwrt/0093-fw-utils-tplink-safeloader.c-Add-support-for-Archer-C2600.patch rename patches/openwrt/{0098-tools-cmake-fix-parallel-build-with-Make-4.2.patch => 0093-tools-cmake-fix-parallel-build-with-Make-4.2.patch} (100%) rename patches/openwrt/{0099-linux-make-IPv6-builtin-if-selected-saves-30KB.patch => 0094-linux-make-IPv6-builtin-if-selected-saves-30KB.patch} (100%) delete mode 100644 patches/openwrt/0094-tools-tplink-safeloader-split-CPE210-from-CPE510-profile.patch rename patches/openwrt/{0100-package-ipkg.mk-fix-Provides-for-packages-with-multiple-PROVIDES-entries.patch => 0095-package-ipkg.mk-fix-Provides-for-packages-with-multiple-PROVIDES-entries.patch} (100%) rename patches/openwrt/{0101-kernel-remove-packaging-of-kmod-crypto-core-and-kmod-crypto-arc4.patch => 0096-kernel-remove-packaging-of-kmod-crypto-core-and-kmod-crypto-arc4.patch} (100%) diff --git a/patches/openwrt/0095-ar71xx-add-GL-AR150-support.patch b/patches/openwrt/0090-ar71xx-add-GL-AR150-support.patch similarity index 97% rename from patches/openwrt/0095-ar71xx-add-GL-AR150-support.patch rename to patches/openwrt/0090-ar71xx-add-GL-AR150-support.patch index ca4b803a..d8787a52 100644 --- a/patches/openwrt/0095-ar71xx-add-GL-AR150-support.patch +++ b/patches/openwrt/0090-ar71xx-add-GL-AR150-support.patch @@ -9,10 +9,10 @@ https://raw.githubusercontent.com/domino-team/OpenWrt-patches/master/AR150%2C%20 (and fixed indentation in target/linux/ar71xx/base-files/lib/ar71xx.sh) diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds -index 129f6b7..e29c1b5 100644 +index ae17853..dc8b8d6 100644 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds -@@ -182,6 +182,10 @@ dlan-pro-1200-ac) +@@ -181,6 +181,10 @@ dlan-pro-1200-ac) ucidef_set_led_trigger_gpio "plcr" "dLAN" "devolo:error:dlan" "16" "0" ;; @@ -24,10 +24,10 @@ index 129f6b7..e29c1b5 100644 ucidef_set_led_netdev "lan" "LAN" "gl-connect:green:lan" "eth1" ucidef_set_led_wlan "wlan" "WLAN" "gl-connect:red: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 1d0142f..3895394 100755 +index 4066506..89a2184 100755 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network -@@ -382,6 +382,7 @@ dir-505-a1) +@@ -381,6 +381,7 @@ dir-505-a1) alfa-ap96 |\ alfa-nx |\ ap83 |\ @@ -36,10 +36,10 @@ index 1d0142f..3895394 100755 jwap003 |\ pb42 |\ diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh -index 4000b5b..2cb884b 100755 +index fbf76c8..db908f9 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh -@@ -504,6 +504,9 @@ ar71xx_board_detect() { +@@ -500,6 +500,9 @@ ar71xx_board_detect() { name="gl-inet" gl_inet_board_detect ;; @@ -50,7 +50,7 @@ index 4000b5b..2cb884b 100755 name="epg5000" ;; diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh -index eded91e..5bd4c2b 100755 +index 4a4c476..aeb4577 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -215,6 +215,7 @@ platform_check_image() { @@ -261,7 +261,7 @@ index 0000000..a6ad661 + +$(eval $(call Profile,GL-AR150)) diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile -index 57f38a5..3ce1809 100644 +index 06dbb77..a35ded9 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile @@ -144,6 +144,14 @@ define Device/weio diff --git a/patches/openwrt/0090-ar71xx-cpe510-enable-LNA-for-CPE210-220-510-520.patch b/patches/openwrt/0090-ar71xx-cpe510-enable-LNA-for-CPE210-220-510-520.patch deleted file mode 100644 index c5c278bc..00000000 --- a/patches/openwrt/0090-ar71xx-cpe510-enable-LNA-for-CPE210-220-510-520.patch +++ /dev/null @@ -1,35 +0,0 @@ -From: Matthias Schiffer -Date: Thu, 9 Jun 2016 04:39:08 +0200 -Subject: ar71xx/cpe510: enable LNA for CPE210/220/510/520 - -The LNA improves the rx path. Within a simple test setup -it improved the signal from -60dbm to -40dbm. - -Signed-off-by: Alexander Couzens - -Backport of LEDE 94e23bf7409d6cc4c9efb55ed32aba8e5a497966 - -diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c -index 8bf5c0f..5cb052a 100644 ---- a/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c -+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c -@@ -30,6 +30,9 @@ - #define CPE510_GPIO_LED_L3 15 - #define CPE510_GPIO_LED_L4 16 - -+#define CPE510_GPIO_EXTERNAL_LNA0 18 -+#define CPE510_GPIO_EXTERNAL_LNA1 19 -+ - #define CPE510_GPIO_BTN_RESET 4 - - #define CPE510_KEYS_POLL_INTERVAL 20 /* msecs */ -@@ -93,6 +96,9 @@ static void __init cpe510_setup(void) - ARRAY_SIZE(cpe510_gpio_keys), - cpe510_gpio_keys); - -+ ath79_wmac_set_ext_lna_gpio(0, CPE510_GPIO_EXTERNAL_LNA0); -+ ath79_wmac_set_ext_lna_gpio(1, CPE510_GPIO_EXTERNAL_LNA1); -+ - ath79_register_m25p80(NULL); - - ath79_register_mdio(1, 0); diff --git a/patches/openwrt/0091-ar71xx-cpe510-split-profile-into-2-profiles-cpe210-and-cpe510.patch b/patches/openwrt/0091-ar71xx-cpe510-split-profile-into-2-profiles-cpe210-and-cpe510.patch deleted file mode 100644 index 98f4c273..00000000 --- a/patches/openwrt/0091-ar71xx-cpe510-split-profile-into-2-profiles-cpe210-and-cpe510.patch +++ /dev/null @@ -1,169 +0,0 @@ -From: Matthias Schiffer -Date: Thu, 9 Jun 2016 04:55:37 +0200 -Subject: ar71xx/cpe510: split profile into 2 profiles cpe210 and cpe510 - -Split profile into 2GHz and 5GHz. The 5GHz devices are -quite "special". The 2 GHz works perfect. - -Signed-off-by: Alexander Couzens - -Backport of LEDE c5ff273d85f69981e5b126eeaed3dee5b4061fb4 - -diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_gpio-switches b/target/linux/ar71xx/base-files/etc/uci-defaults/01_gpio-switches -index b41f275..0f7a415 100644 ---- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_gpio-switches -+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_gpio-switches -@@ -15,6 +15,7 @@ nanostation-m) - nanostation-m-xw) - ucidef_set_gpio_switch "poe_passthrough" "PoE Passthrough" "2" - ;; -+cpe210|\ - cpe510) - ucidef_set_gpio_switch "poe_passthrough" "PoE Passthrough" "20" - ;; -diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds -index ae17853..129f6b7 100644 ---- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds -+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds -@@ -78,6 +78,7 @@ carambola2) - ucidef_set_led_wlan "wlan" "WLAN" "carambola2:green:wlan" "phy0tpt" - ;; - -+cpe210|\ - cpe510) - ucidef_set_led_switch "lan0" "LAN0" "tp-link:green:lan0" "switch0" "0x20" - ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10" -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 4066506..1d0142f 100755 ---- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network -+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network -@@ -71,6 +71,7 @@ bsb) - ucidef_set_interface_wlan - ;; - -+cpe210|\ - cpe510) - ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" - ucidef_add_switch "switch0" "1" "1" -diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh -index fbf76c8..4000b5b 100755 ---- a/target/linux/ar71xx/base-files/lib/ar71xx.sh -+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh -@@ -438,7 +438,11 @@ ar71xx_board_detect() { - *CAP4200AG) - name="cap4200ag" - ;; -- *"CPE210/220/510/520") -+ *"CPE210/220") -+ name="cpe210" -+ tplink_pharos_board_detect -+ ;; -+ *"CPE510/520") - name="cpe510" - tplink_pharos_board_detect - ;; -diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh -index 4a4c476..eded91e 100755 ---- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh -+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh -@@ -263,6 +263,7 @@ platform_check_image() { - return 0 - ;; - -+ cpe210|\ - cpe510) - tplink_pharos_check_image "$1" && return 0 - return 1 -diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c -index 5cb052a..74daf43 100644 ---- a/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c -+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c -@@ -78,12 +78,8 @@ static struct gpio_keys_button cpe510_gpio_keys[] __initdata = { - } - }; - -- --static void __init cpe510_setup(void) -+static void __init cpe_setup(u8 *mac) - { -- u8 *mac = (u8 *) KSEG1ADDR(0x1f830008); -- u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000); -- - /* Disable JTAG, enabling GPIOs 0-3 */ - /* Configure OBS4 line, for GPIO 4*/ - ath79_gpio_function_setup(AR934X_GPIO_FUNC_JTAG_DISABLE, -@@ -105,9 +101,31 @@ static void __init cpe510_setup(void) - ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0); - ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; - ath79_register_eth(1); -+} -+ -+ -+static void __init cpe210_setup(void) -+{ -+ u8 *mac = (u8 *) KSEG1ADDR(0x1f830008); -+ u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000); -+ -+ cpe_setup(mac); - - ath79_register_wmac(ee, mac); - } - --MIPS_MACHINE(ATH79_MACH_CPE510, "CPE510", "TP-LINK CPE210/220/510/520", -+static void __init cpe510_setup(void) -+{ -+ u8 *mac = (u8 *) KSEG1ADDR(0x1f830008); -+ u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000); -+ -+ cpe_setup(mac); -+ -+ ath79_register_wmac(ee, mac); -+} -+ -+MIPS_MACHINE(ATH79_MACH_CPE210, "CPE210", "TP-LINK CPE210/220", -+ cpe210_setup); -+ -+MIPS_MACHINE(ATH79_MACH_CPE510, "CPE510", "TP-LINK CPE510/520", - cpe510_setup); -diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile -index 06dbb77..272abe0 100644 ---- a/target/linux/ar71xx/image/Makefile -+++ b/target/linux/ar71xx/image/Makefile -@@ -2094,7 +2094,8 @@ $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR1043V2,tl-wr1043nd-v2,TL-WR10 - $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR1043V3,tl-wr1043nd-v3,TL-WR1043ND-v2,ttyS0,115200,0x10430003,1,8M)) - $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR2543,tl-wr2543-v1,TL-WR2543N,ttyS0,115200,0x25430001,1,8Mlzma,-v 3.13.99)) - --$(eval $(call SingleProfile,TPLINK-SAFELOADER,64kraw,CPE510,cpe210-220-510-520,CPE510,ttyS0,115200,$$(cpe510_mtdlayout),CPE510)) -+$(eval $(call SingleProfile,TPLINK-SAFELOADER,64kraw,CPE210_220,cpe210-220,CPE210,ttyS0,115200,$$(cpe510_mtdlayout),CPE510)) -+$(eval $(call SingleProfile,TPLINK-SAFELOADER,64kraw,CPE510_520,cpe510-520,CPE510,ttyS0,115200,$$(cpe510_mtdlayout),CPE510)) - - $(eval $(call SingleProfile,UAPPRO,64k,UAPPRO,ubnt-uap-pro,UAP-PRO,ttyS0,115200,BZ,BZ,ar934x)) - $(eval $(call SingleProfile,UAPPRO,64k,UBNTUNIFIOUTDOORPLUS,ubnt-unifi-outdoor-plus,UBNT-UOP,ttyS0,115200,BZ,BZ,ar7240)) -@@ -2158,6 +2159,7 @@ $(eval $(call MultiProfile,TLWR842,TLWR842V1)) - $(eval $(call MultiProfile,TLWR941,TLWR941NV2 TLWR941NV3 TLWR941NV4)) - $(eval $(call MultiProfile,TLWR1043,TLWR1043V1 TLWR1043V2 TLWR1043V3)) - $(eval $(call MultiProfile,TLWDR4300,TLWDR3500V1 TLWDR3600V1 TLWDR4300V1 TLWDR4300V1IL TLWDR4310V1 MW4530RV1)) -+$(eval $(call MultiProfile,CPE510,CPE210_220 CPE510_520)) - $(eval $(call MultiProfile,TUBE2H,TUBE2H8M TUBE2H16M)) - $(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTROCKETMXW UBNTNANOM UBNTNANOMXW UBNTLOCOXW UBNTUNIFI UBNTUNIFIOUTDOOR UBNTUNIFIOUTDOORPLUS UAPPRO UBNTAIRGW)) - $(eval $(call MultiProfile,WNR612V2,REALWNR612V2 N150R)) -diff --git a/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch b/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch -index dbd3fca..b2f5366 100644 ---- a/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch -+++ b/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch -@@ -1,6 +1,6 @@ - --- a/arch/mips/ath79/machtypes.h - +++ b/arch/mips/ath79/machtypes.h --@@ -16,22 +16,201 @@ -+@@ -16,22 +16,202 @@ - - enum ath79_mach_type { - ATH79_MACH_GENERIC = 0, -@@ -26,6 +26,7 @@ - + ATH79_MACH_BHU_BXU2000N2_A1, /* BHU BXU2000n-2 A1 */ - + ATH79_MACH_CAP4200AG, /* Senao CAP4200AG */ - + ATH79_MACH_CARAMBOLA2, /* 8devices Carambola2 */ -++ ATH79_MACH_CPE210, /* TP-LINK CPE210 */ - + ATH79_MACH_CPE510, /* TP-LINK CPE510 */ - ATH79_MACH_DB120, /* Atheros DB120 reference board */ - ATH79_MACH_PB44, /* Atheros PB44 reference board */ diff --git a/patches/openwrt/0096-scripts-feeds-fix-version-detection-for-Make-4.2.1.patch b/patches/openwrt/0091-scripts-feeds-fix-version-detection-for-Make-4.2.1.patch similarity index 100% rename from patches/openwrt/0096-scripts-feeds-fix-version-detection-for-Make-4.2.1.patch rename to patches/openwrt/0091-scripts-feeds-fix-version-detection-for-Make-4.2.1.patch diff --git a/patches/openwrt/0092-ar71xx-cpe510-use-second-wifi-calibration-table.patch b/patches/openwrt/0092-ar71xx-cpe510-use-second-wifi-calibration-table.patch deleted file mode 100644 index 7a5cd5d4..00000000 --- a/patches/openwrt/0092-ar71xx-cpe510-use-second-wifi-calibration-table.patch +++ /dev/null @@ -1,24 +0,0 @@ -From: Matthias Schiffer -Date: Thu, 9 Jun 2016 04:57:24 +0200 -Subject: ar71xx/cpe510: use second wifi calibration table - -The cpe510 has two calibration tables. The first calibration -table requires to modify ath9k driver to work (patched tx gain table). - -Signed-off-by: Alexander Couzens - -Backport of LEDE bf27ac019c137e7baf90ca6ef0e40945ae871797 - -diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c -index 74daf43..875589d 100644 ---- a/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c -+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c -@@ -117,7 +117,7 @@ static void __init cpe210_setup(void) - static void __init cpe510_setup(void) - { - u8 *mac = (u8 *) KSEG1ADDR(0x1f830008); -- u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000); -+ u8 *ee = (u8 *) KSEG1ADDR(0x1fff5000); - - cpe_setup(mac); - diff --git a/patches/openwrt/0097-build-don-t-add-j-for-parallel-builds-with-Make-4.2.patch b/patches/openwrt/0092-build-don-t-add-j-for-parallel-builds-with-Make-4.2.patch similarity index 100% rename from patches/openwrt/0097-build-don-t-add-j-for-parallel-builds-with-Make-4.2.patch rename to patches/openwrt/0092-build-don-t-add-j-for-parallel-builds-with-Make-4.2.patch diff --git a/patches/openwrt/0093-fw-utils-tplink-safeloader.c-Add-support-for-Archer-C2600.patch b/patches/openwrt/0093-fw-utils-tplink-safeloader.c-Add-support-for-Archer-C2600.patch deleted file mode 100644 index 0c33a4d3..00000000 --- a/patches/openwrt/0093-fw-utils-tplink-safeloader.c-Add-support-for-Archer-C2600.patch +++ /dev/null @@ -1,188 +0,0 @@ -From: Matthias Schiffer -Date: Thu, 9 Jun 2016 05:02:18 +0200 -Subject: fw-utils/tplink-safeloader.c: Add support for Archer C2600 - -Signed-off-by: Ash Benz - -Backport of LEDE 955c341d3bec0eb4971a03924e99156367255d7b - -diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c -index 77a894b..2e204aa 100644 ---- a/tools/firmware-utils/src/tplink-safeloader.c -+++ b/tools/firmware-utils/src/tplink-safeloader.c -@@ -105,6 +105,8 @@ static const uint8_t md5_salt[16] = { - /** Vendor information for CPE210/220/510/520 */ - static const char cpe510_vendor[] = "CPE510(TP-LINK|UN|N300-5):1.0\r\n"; - -+/** Vendor information for C2600 */ -+static const char c2600_vendor[] = ""; - - /** - The flash partition table for CPE210/220/510/520; -@@ -128,6 +130,39 @@ static const struct flash_partition_entry cpe510_partitions[] = { - }; - - /** -+ The flash partition table for C2600; -+ it is the same as the one used by the stock images. -+*/ -+static const struct flash_partition_entry c2600_partitions[] = { -+ {"SBL1", 0x00000, 0x20000}, -+ {"MIBIB", 0x20000, 0x20000}, -+ {"SBL2", 0x40000, 0x20000}, -+ {"SBL3", 0x60000, 0x30000}, -+ {"DDRCONFIG", 0x90000, 0x10000}, -+ {"SSD", 0xa0000, 0x10000}, -+ {"TZ", 0xb0000, 0x30000}, -+ {"RPM", 0xe0000, 0x20000}, -+ {"fs-uboot", 0x100000, 0x70000}, -+ {"uboot-env", 0x170000, 0x40000}, -+ {"radio", 0x1b0000, 0x40000}, -+ {"os-image", 0x1f0000, 0x200000}, -+ {"file-system", 0x3f0000, 0x1b00000}, -+ {"default-mac", 0x1ef0000, 0x00200}, -+ {"pin", 0x1ef0200, 0x00200}, -+ {"product-info", 0x1ef0400, 0x0fc00}, -+ {"partition-table", 0x1f00000, 0x10000}, -+ {"soft-version", 0x1f10000, 0x10000}, -+ {"support-list", 0x1f20000, 0x10000}, -+ {"profile", 0x1f30000, 0x10000}, -+ {"default-config", 0x1f40000, 0x10000}, -+ {"user-config", 0x1f50000, 0x40000}, -+ {"qos-db", 0x1f90000, 0x40000}, -+ {"usb-config", 0x1fd0000, 0x10000}, -+ {"log", 0x1fe0000, 0x20000}, -+ {NULL, 0, 0} -+}; -+ -+/** - The support list for CPE210/220/510/520 - */ - static const char cpe510_support_list[] = -@@ -141,6 +176,13 @@ static const char cpe510_support_list[] = - "CPE220(TP-LINK|UN|N300-2):1.0\r\n" - "CPE220(TP-LINK|UN|N300-2):1.1\r\n"; - -+/** -+ The support list for C2600 -+*/ -+static const char c2600_support_list[] = -+ "SupportList:\r\n" -+ "{product_name:Archer C2600,product_ver:1.0.0,special_id:00000000}\r\n"; -+ - #define error(_ret, _errno, _str, ...) \ - do { \ - fprintf(stderr, _str ": %s\n", ## __VA_ARGS__, \ -@@ -240,14 +282,14 @@ static struct image_partition_entry make_soft_version(uint32_t rev) { - } - - /** Generates the support-list partition */ --static struct image_partition_entry make_support_list(const char *support_list) { -+static struct image_partition_entry make_support_list(const char *support_list, bool trailzero) { - size_t len = strlen(support_list); - struct image_partition_entry entry = alloc_image_partition("support-list", len + 9); - - put32(entry.data, len); - memset(entry.data+4, 0, 4); - memcpy(entry.data+8, support_list, len); -- entry.data[len+8] = '\xff'; -+ entry.data[len+8] = trailzero ? '\x00' : '\xff'; - - return entry; - } -@@ -436,6 +478,37 @@ static void * generate_sysupgrade_image(const struct flash_partition_entry *flas - return image; - } - -+static void * generate_sysupgrade_image_c2600(const struct flash_partition_entry *flash_parts, const struct image_partition_entry *image_parts, size_t *len) { -+ const struct flash_partition_entry *flash_os_image = &flash_parts[11]; -+ const struct flash_partition_entry *flash_file_system = &flash_parts[12]; -+ -+ const struct image_partition_entry *image_os_image = &image_parts[3]; -+ const struct image_partition_entry *image_file_system = &image_parts[4]; -+ -+ assert(strcmp(flash_os_image->name, "os-image") == 0); -+ assert(strcmp(flash_file_system->name, "file-system") == 0); -+ -+ assert(strcmp(image_os_image->name, "os-image") == 0); -+ assert(strcmp(image_file_system->name, "file-system") == 0); -+ -+ if (image_os_image->size > flash_os_image->size) -+ error(1, 0, "kernel image too big (more than %u bytes)", (unsigned)flash_os_image->size); -+ if (image_file_system->size > flash_file_system->size) -+ error(1, 0, "rootfs image too big (more than %u bytes)", (unsigned)flash_file_system->size); -+ -+ *len = flash_file_system->base - flash_os_image->base + image_file_system->size; -+ -+ uint8_t *image = malloc(*len); -+ if (!image) -+ error(1, errno, "malloc"); -+ -+ memset(image, 0xff, *len); -+ -+ memcpy(image, image_os_image->data, image_os_image->size); -+ memcpy(image + flash_file_system->base - flash_os_image->base, image_file_system->data, image_file_system->size); -+ -+ return image; -+} - - /** Generates an image for CPE210/220/510/520 and writes it to a file */ - static void do_cpe510(const char *output, const char *kernel_image, const char *rootfs_image, uint32_t rev, bool add_jffs2_eof, bool sysupgrade) { -@@ -443,7 +516,7 @@ static void do_cpe510(const char *output, const char *kernel_image, const char * - - parts[0] = make_partition_table(cpe510_partitions); - parts[1] = make_soft_version(rev); -- parts[2] = make_support_list(cpe510_support_list); -+ parts[2] = make_support_list(cpe510_support_list,false); - parts[3] = read_file("os-image", kernel_image, false); - parts[4] = read_file("file-system", rootfs_image, add_jffs2_eof); - -@@ -470,6 +543,39 @@ static void do_cpe510(const char *output, const char *kernel_image, const char * - free_image_partition(parts[i]); - } - -+/** Generates an image for C2600 and writes it to a file */ -+static void do_c2600(const char *output, const char *kernel_image, const char *rootfs_image, uint32_t rev, bool add_jffs2_eof, bool sysupgrade) { -+ struct image_partition_entry parts[6] = {}; -+ -+ parts[0] = make_partition_table(c2600_partitions); -+ parts[1] = make_soft_version(rev); -+ parts[2] = make_support_list(c2600_support_list,true); -+ parts[3] = read_file("os-image", kernel_image, false); -+ parts[4] = read_file("file-system", rootfs_image, add_jffs2_eof); -+ -+ size_t len; -+ void *image; -+ if (sysupgrade) -+ image = generate_sysupgrade_image_c2600(c2600_partitions, parts, &len); -+ else -+ image = generate_factory_image(c2600_vendor, parts, &len); -+ -+ FILE *file = fopen(output, "wb"); -+ if (!file) -+ error(1, errno, "unable to open output file"); -+ -+ if (fwrite(image, len, 1, file) != 1) -+ error(1, 0, "unable to write output file"); -+ -+ fclose(file); -+ -+ free(image); -+ -+ size_t i; -+ for (i = 0; parts[i].name; i++) -+ free_image_partition(parts[i]); -+} -+ - - /** Usage output */ - static void usage(const char *argv0) { -@@ -552,6 +658,8 @@ int main(int argc, char *argv[]) { - - if (strcmp(board, "CPE510") == 0) - do_cpe510(output, kernel_image, rootfs_image, rev, add_jffs2_eof, sysupgrade); -+ else if (strcmp(board, "C2600") == 0) -+ do_c2600(output, kernel_image, rootfs_image, rev, add_jffs2_eof, sysupgrade); - else - error(1, 0, "unsupported board %s", board); - diff --git a/patches/openwrt/0098-tools-cmake-fix-parallel-build-with-Make-4.2.patch b/patches/openwrt/0093-tools-cmake-fix-parallel-build-with-Make-4.2.patch similarity index 100% rename from patches/openwrt/0098-tools-cmake-fix-parallel-build-with-Make-4.2.patch rename to patches/openwrt/0093-tools-cmake-fix-parallel-build-with-Make-4.2.patch diff --git a/patches/openwrt/0099-linux-make-IPv6-builtin-if-selected-saves-30KB.patch b/patches/openwrt/0094-linux-make-IPv6-builtin-if-selected-saves-30KB.patch similarity index 100% rename from patches/openwrt/0099-linux-make-IPv6-builtin-if-selected-saves-30KB.patch rename to patches/openwrt/0094-linux-make-IPv6-builtin-if-selected-saves-30KB.patch diff --git a/patches/openwrt/0094-tools-tplink-safeloader-split-CPE210-from-CPE510-profile.patch b/patches/openwrt/0094-tools-tplink-safeloader-split-CPE210-from-CPE510-profile.patch deleted file mode 100644 index a6c13128..00000000 --- a/patches/openwrt/0094-tools-tplink-safeloader-split-CPE210-from-CPE510-profile.patch +++ /dev/null @@ -1,102 +0,0 @@ -From: Matthias Schiffer -Date: Thu, 9 Jun 2016 05:03:35 +0200 -Subject: tools/tplink-safeloader: split CPE210 from CPE510 profile - -The CPE210 was still described for the OEM upgrade as compatible, -even the wireless configuration isn't compatible anymore between -both series (2ghz and 5ghz). -Update the CPE210 image profile to use the new profile. - -Signed-off-by: Alexander Couzens - -Backport of LEDE 824147960569f2c1cd22140c9074c62c3df911a5 - -diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile -index 272abe0..57f38a5 100644 ---- a/target/linux/ar71xx/image/Makefile -+++ b/target/linux/ar71xx/image/Makefile -@@ -2094,7 +2094,7 @@ $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR1043V2,tl-wr1043nd-v2,TL-WR10 - $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR1043V3,tl-wr1043nd-v3,TL-WR1043ND-v2,ttyS0,115200,0x10430003,1,8M)) - $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR2543,tl-wr2543-v1,TL-WR2543N,ttyS0,115200,0x25430001,1,8Mlzma,-v 3.13.99)) - --$(eval $(call SingleProfile,TPLINK-SAFELOADER,64kraw,CPE210_220,cpe210-220,CPE210,ttyS0,115200,$$(cpe510_mtdlayout),CPE510)) -+$(eval $(call SingleProfile,TPLINK-SAFELOADER,64kraw,CPE210_220,cpe210-220,CPE210,ttyS0,115200,$$(cpe510_mtdlayout),CPE210)) - $(eval $(call SingleProfile,TPLINK-SAFELOADER,64kraw,CPE510_520,cpe510-520,CPE510,ttyS0,115200,$$(cpe510_mtdlayout),CPE510)) - - $(eval $(call SingleProfile,UAPPRO,64k,UAPPRO,ubnt-uap-pro,UAP-PRO,ttyS0,115200,BZ,BZ,ar934x)) -diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c -index 2e204aa..4938f74 100644 ---- a/tools/firmware-utils/src/tplink-safeloader.c -+++ b/tools/firmware-utils/src/tplink-safeloader.c -@@ -163,6 +163,15 @@ static const struct flash_partition_entry c2600_partitions[] = { - }; - - /** -+ The support list for CPE210/220 -+*/ -+static const char cpe210_support_list[] = -+ "SupportList:\r\n" -+ "CPE210(TP-LINK|UN|N300-2):1.0\r\n" -+ "CPE210(TP-LINK|UN|N300-2):1.1\r\n" -+ "CPE220(TP-LINK|UN|N300-2):1.0\r\n" -+ "CPE220(TP-LINK|UN|N300-2):1.1\r\n"; -+/** - The support list for CPE210/220/510/520 - */ - static const char cpe510_support_list[] = -@@ -170,11 +179,7 @@ static const char cpe510_support_list[] = - "CPE510(TP-LINK|UN|N300-5):1.0\r\n" - "CPE510(TP-LINK|UN|N300-5):1.1\r\n" - "CPE520(TP-LINK|UN|N300-5):1.0\r\n" -- "CPE520(TP-LINK|UN|N300-5):1.1\r\n" -- "CPE210(TP-LINK|UN|N300-2):1.0\r\n" -- "CPE210(TP-LINK|UN|N300-2):1.1\r\n" -- "CPE220(TP-LINK|UN|N300-2):1.0\r\n" -- "CPE220(TP-LINK|UN|N300-2):1.1\r\n"; -+ "CPE520(TP-LINK|UN|N300-5):1.1\r\n"; - - /** - The support list for C2600 -@@ -511,12 +516,18 @@ static void * generate_sysupgrade_image_c2600(const struct flash_partition_entry - } - - /** Generates an image for CPE210/220/510/520 and writes it to a file */ --static void do_cpe510(const char *output, const char *kernel_image, const char *rootfs_image, uint32_t rev, bool add_jffs2_eof, bool sysupgrade) { -+static void do_cpe(const char *output, -+ const char *kernel_image, -+ const char *rootfs_image, -+ uint32_t rev, -+ bool add_jffs2_eof, -+ bool sysupgrade, -+ const char *support_list) { - struct image_partition_entry parts[6] = {}; - - parts[0] = make_partition_table(cpe510_partitions); - parts[1] = make_soft_version(rev); -- parts[2] = make_support_list(cpe510_support_list,false); -+ parts[2] = make_support_list(support_list, false); - parts[3] = read_file("os-image", kernel_image, false); - parts[4] = read_file("file-system", rootfs_image, add_jffs2_eof); - -@@ -549,7 +560,7 @@ static void do_c2600(const char *output, const char *kernel_image, const char *r - - parts[0] = make_partition_table(c2600_partitions); - parts[1] = make_soft_version(rev); -- parts[2] = make_support_list(c2600_support_list,true); -+ parts[2] = make_support_list(c2600_support_list, true); - parts[3] = read_file("os-image", kernel_image, false); - parts[4] = read_file("file-system", rootfs_image, add_jffs2_eof); - -@@ -656,8 +667,10 @@ int main(int argc, char *argv[]) { - if (!output) - error(1, 0, "no output filename has been specified"); - -- if (strcmp(board, "CPE510") == 0) -- do_cpe510(output, kernel_image, rootfs_image, rev, add_jffs2_eof, sysupgrade); -+ if (strcmp(board, "CPE210") == 0) -+ do_cpe(output, kernel_image, rootfs_image, rev, add_jffs2_eof, sysupgrade, cpe210_support_list); -+ else if (strcmp(board, "CPE510") == 0) -+ do_cpe(output, kernel_image, rootfs_image, rev, add_jffs2_eof, sysupgrade, cpe510_support_list); - else if (strcmp(board, "C2600") == 0) - do_c2600(output, kernel_image, rootfs_image, rev, add_jffs2_eof, sysupgrade); - else diff --git a/patches/openwrt/0100-package-ipkg.mk-fix-Provides-for-packages-with-multiple-PROVIDES-entries.patch b/patches/openwrt/0095-package-ipkg.mk-fix-Provides-for-packages-with-multiple-PROVIDES-entries.patch similarity index 100% rename from patches/openwrt/0100-package-ipkg.mk-fix-Provides-for-packages-with-multiple-PROVIDES-entries.patch rename to patches/openwrt/0095-package-ipkg.mk-fix-Provides-for-packages-with-multiple-PROVIDES-entries.patch diff --git a/patches/openwrt/0101-kernel-remove-packaging-of-kmod-crypto-core-and-kmod-crypto-arc4.patch b/patches/openwrt/0096-kernel-remove-packaging-of-kmod-crypto-core-and-kmod-crypto-arc4.patch similarity index 100% rename from patches/openwrt/0101-kernel-remove-packaging-of-kmod-crypto-core-and-kmod-crypto-arc4.patch rename to patches/openwrt/0096-kernel-remove-packaging-of-kmod-crypto-core-and-kmod-crypto-arc4.patch diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 587ea6d6..9d78c949 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -4,15 +4,14 @@ # CPE210/220/510/520 $(eval $(call GluonProfile,CPE510,rssileds)) +$(eval $(call GluonModel,CPE510,cpe210-220-510-520,tp-link-cpe510-v1.0)) -$(eval $(call GluonModel,CPE510,cpe210-220,tp-link-cpe210-v1.0)) -$(eval $(call GluonModelAlias,CPE510,tp-link-cpe210-v1.0,tp-link-cpe210-v1.1)) -$(eval $(call GluonModelAlias,CPE510,tp-link-cpe210-v1.0,tp-link-cpe220-v1.0)) -$(eval $(call GluonModelAlias,CPE510,tp-link-cpe210-v1.0,tp-link-cpe220-v1.1)) - -$(eval $(call GluonModel,CPE510,cpe510-520,tp-link-cpe510-v1.0)) -$(eval $(call GluonModelAlias,CPE510,tp-link-cpe510-v1.0,tp-link-cpe510-v1.1)) +$(eval $(call GluonModelAlias,CPE510,tp-link-cpe510-v1.0,tp-link-cpe210-v1.0)) +$(eval $(call GluonModelAlias,CPE510,tp-link-cpe510-v1.0,tp-link-cpe220-v1.0)) $(eval $(call GluonModelAlias,CPE510,tp-link-cpe510-v1.0,tp-link-cpe520-v1.0)) +$(eval $(call GluonModelAlias,CPE510,tp-link-cpe510-v1.0,tp-link-cpe210-v1.1)) +$(eval $(call GluonModelAlias,CPE510,tp-link-cpe510-v1.0,tp-link-cpe220-v1.1)) +$(eval $(call GluonModelAlias,CPE510,tp-link-cpe510-v1.0,tp-link-cpe510-v1.1)) $(eval $(call GluonModelAlias,CPE510,tp-link-cpe510-v1.0,tp-link-cpe520-v1.1)) # TL-WA701N/ND v1, v2 From f640573b5dcb9293664378c3a866cadc845d60de Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Fri, 17 Jun 2016 13:15:25 +0200 Subject: [PATCH 446/867] docs: Fix list alignment of OpenMesh devices Signed-off-by: Sven Eckelmann --- docs/index.rst | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index a3c730a9..26ff87a6 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -133,15 +133,15 @@ ar71xx-generic * OpenMesh - - MR1750 - - MR600 (v1, v2) - - MR900 (v1, v2) - - OM2P (v1, v2) - - OM2P-HS (v1, v2) - - OM2P-LC - - OM5P - - OM5P-AC (v1, v2) - - OM5P-AN + - MR1750 + - MR600 (v1, v2) + - MR900 (v1, v2) + - OM2P (v1, v2) + - OM2P-HS (v1, v2) + - OM2P-LC + - OM5P + - OM5P-AC (v1, v2) + - OM5P-AN * TP-Link From 3ccd5169715edaecb52aa650911f862d9dff96cc Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Fri, 17 Jun 2016 15:34:28 +0200 Subject: [PATCH 447/867] ar71xx-generic: Add support for OpenMesh OM2P-HSv3 The new OM2P-HSv3 device support is only available in LEDE master. The relevant patches have to backported to add support for them in Gluon Signed-off-by: Sven Eckelmann --- docs/index.rst | 2 +- .../files/lib/gluon/upgrade/010-primary-mac | 2 +- ...l-support-for-the-OpenMesh-OM2P-HSv3.patch | 33 +++++++++++++ ...e-support-for-the-OpenMesh-OM2P-HSv3.patch | 46 +++++++++++++++++++ ...ysupgrade-for-the-OpenMesh-OM2P-HSv3.patch | 40 ++++++++++++++++ ...chdog-add-OpenMesh-OM2P-HSv3-support.patch | 21 +++++++++ ...tools-add-OpenMesh-OM2P-HSv3-support.patch | 20 ++++++++ ...xx-add-OM2P-HSv3-to-the-OM2P-profile.patch | 27 +++++++++++ targets/ar71xx-generic/profiles.mk | 1 + 9 files changed, 190 insertions(+), 2 deletions(-) create mode 100644 patches/openwrt/0097-ar71xx-add-kernel-support-for-the-OpenMesh-OM2P-HSv3.patch create mode 100644 patches/openwrt/0098-ar71xx-add-user-space-support-for-the-OpenMesh-OM2P-HSv3.patch create mode 100644 patches/openwrt/0099-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM2P-HSv3.patch create mode 100644 patches/openwrt/0100-package-om-watchdog-add-OpenMesh-OM2P-HSv3-support.patch create mode 100644 patches/openwrt/0101-package-uboot-envtools-add-OpenMesh-OM2P-HSv3-support.patch create mode 100644 patches/openwrt/0102-ar71xx-add-OM2P-HSv3-to-the-OM2P-profile.patch diff --git a/docs/index.rst b/docs/index.rst index 26ff87a6..c25ce8f8 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -137,7 +137,7 @@ ar71xx-generic - MR600 (v1, v2) - MR900 (v1, v2) - OM2P (v1, v2) - - OM2P-HS (v1, v2) + - OM2P-HS (v1, v2, v3) - OM2P-LC - OM5P - OM5P-AC (v1, v2) diff --git a/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac b/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac index 144ee700..849b7a34 100755 --- a/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac +++ b/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac @@ -29,7 +29,7 @@ elseif platform.match('ar71xx', 'generic', {'unifi-outdoor-plus', 'carambola2', 'mr900', 'mr900v2', 'mr1750', 'om2p', 'om2pv2', - 'om2p-hs', 'om2p-hsv2', + 'om2p-hs', 'om2p-hsv2', 'om2p-hsv3', 'om2p-lc', 'om5p', 'om5p-an', 'om5p-ac', 'om5p-acv2'}) then diff --git a/patches/openwrt/0097-ar71xx-add-kernel-support-for-the-OpenMesh-OM2P-HSv3.patch b/patches/openwrt/0097-ar71xx-add-kernel-support-for-the-OpenMesh-OM2P-HSv3.patch new file mode 100644 index 00000000..1bfdc8e3 --- /dev/null +++ b/patches/openwrt/0097-ar71xx-add-kernel-support-for-the-OpenMesh-OM2P-HSv3.patch @@ -0,0 +1,33 @@ +From: Sven Eckelmann +Date: Fri, 20 May 2016 18:03:48 +0200 +Subject: ar71xx: add kernel support for the OpenMesh OM2P-HSv3 + +Signed-off-by: Sven Eckelmann + +Forwarded: https://patchwork.ozlabs.org/patch/637052/ + +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-om2p.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-om2p.c +index 6b0bdc3..3b282a3 100644 +--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-om2p.c ++++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-om2p.c +@@ -223,3 +223,4 @@ static void __init om2p_hs_setup(void) + + MIPS_MACHINE(ATH79_MACH_OM2P_HS, "OM2P-HS", "OpenMesh OM2P HS", om2p_hs_setup); + MIPS_MACHINE(ATH79_MACH_OM2P_HSv2, "OM2P-HSv2", "OpenMesh OM2P HSv2", om2p_hs_setup); ++MIPS_MACHINE(ATH79_MACH_OM2P_HSv3, "OM2P-HSv3", "OpenMesh OM2P HSv3", om2p_hs_setup); +diff --git a/target/linux/ar71xx/patches-3.18/817-MIPS-ath79-add-om2phsv3-support.patch b/target/linux/ar71xx/patches-3.18/817-MIPS-ath79-add-om2phsv3-support.patch +new file mode 100644 +index 0000000..7305b2e +--- /dev/null ++++ b/target/linux/ar71xx/patches-3.18/817-MIPS-ath79-add-om2phsv3-support.patch +@@ -0,0 +1,10 @@ ++--- a/arch/mips/ath79/machtypes.h +++++ b/arch/mips/ath79/machtypes.h ++@@ -88,6 +88,7 @@ enum ath79_mach_type { ++ ATH79_MACH_NBG460N, /* Zyxel NBG460N/550N/550NH */ ++ ATH79_MACH_NBG6716, /* Zyxel NBG6716 */ ++ ATH79_MACH_OM2P_HSv2, /* OpenMesh OM2P-HSv2 */ +++ ATH79_MACH_OM2P_HSv3, /* OpenMesh OM2P-HSv3 */ ++ ATH79_MACH_OM2P_HS, /* OpenMesh OM2P-HS */ ++ ATH79_MACH_OM2P_LC, /* OpenMesh OM2P-LC */ ++ ATH79_MACH_OM2Pv2, /* OpenMesh OM2Pv2 */ diff --git a/patches/openwrt/0098-ar71xx-add-user-space-support-for-the-OpenMesh-OM2P-HSv3.patch b/patches/openwrt/0098-ar71xx-add-user-space-support-for-the-OpenMesh-OM2P-HSv3.patch new file mode 100644 index 00000000..ab3273a2 --- /dev/null +++ b/patches/openwrt/0098-ar71xx-add-user-space-support-for-the-OpenMesh-OM2P-HSv3.patch @@ -0,0 +1,46 @@ +From: Sven Eckelmann +Date: Fri, 20 May 2016 18:03:49 +0200 +Subject: ar71xx: add user-space support for the OpenMesh OM2P-HSv3 + +Signed-off-by: Sven Eckelmann + +Forwarded: https://patchwork.ozlabs.org/patch/637053/ + +diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh +index d4d8b4e..aa02212 100644 +--- a/target/linux/ar71xx/base-files/etc/diag.sh ++++ b/target/linux/ar71xx/base-files/etc/diag.sh +@@ -171,6 +171,7 @@ get_status_led() { + om2pv2 | \ + om2p-hs | \ + om2p-hsv2 | \ ++ om2p-hsv3 | \ + om2p-lc) + status_led="om2p:blue:power" + ;; +diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds +index dc8b8d6..5767f48 100644 +--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds ++++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds +@@ -297,6 +297,7 @@ om2p | \ + om2pv2 | \ + om2p-hs | \ + om2p-hsv2 | \ ++om2p-hsv3 | \ + om2p-lc) + ucidef_set_led_netdev "port1" "port1" "om2p:blue:wan" "eth0" + ucidef_set_led_netdev "port2" "port2" "om2p:blue:lan" "eth1" +diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh +index db908f9..dc51b03 100755 +--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh ++++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh +@@ -610,6 +610,9 @@ ar71xx_board_detect() { + *"OM2P HSv2") + name="om2p-hsv2" + ;; ++ *"OM2P HSv3") ++ name="om2p-hsv3" ++ ;; + *"OM2P LC") + name="om2p-lc" + ;; diff --git a/patches/openwrt/0099-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM2P-HSv3.patch b/patches/openwrt/0099-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM2P-HSv3.patch new file mode 100644 index 00000000..ad60c151 --- /dev/null +++ b/patches/openwrt/0099-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM2P-HSv3.patch @@ -0,0 +1,40 @@ +From: Sven Eckelmann +Date: Fri, 20 May 2016 18:03:50 +0200 +Subject: ar71xx: enable sysupgrade for the OpenMesh OM2P-HSv3 + +Signed-off-by: Sven Eckelmann + +Forwarded: https://patchwork.ozlabs.org/patch/637054/ + +diff --git a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh +index 209cdaa..0e8ea27 100644 +--- a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh ++++ b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh +@@ -63,6 +63,7 @@ platform_check_image_openmesh() + [ "$board" = "om2p-lc" ] && break + [ "$board" = "om2p-hs" ] && break + [ "$board" = "om2p-hsv2" ] && break ++ [ "$board" = "om2p-hsv3" ] && break + echo "Invalid image board target ($img_board_target) for this platform: $board. Use the correct image for this platform" + return 1 + ;; +diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +index aeb4577..9b26e73 100755 +--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh ++++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +@@ -306,6 +306,7 @@ platform_check_image() { + om2pv2 | \ + om2p-hs | \ + om2p-hsv2 | \ ++ om2p-hsv3 | \ + om2p-lc | \ + om5p | \ + om5p-an | \ +@@ -541,6 +542,7 @@ platform_do_upgrade() { + om2pv2 | \ + om2p-hs | \ + om2p-hsv2 | \ ++ om2p-hsv3 | \ + om2p-lc | \ + om5p | \ + om5p-an | \ diff --git a/patches/openwrt/0100-package-om-watchdog-add-OpenMesh-OM2P-HSv3-support.patch b/patches/openwrt/0100-package-om-watchdog-add-OpenMesh-OM2P-HSv3-support.patch new file mode 100644 index 00000000..95433670 --- /dev/null +++ b/patches/openwrt/0100-package-om-watchdog-add-OpenMesh-OM2P-HSv3-support.patch @@ -0,0 +1,21 @@ +From: Sven Eckelmann +Date: Fri, 20 May 2016 18:03:51 +0200 +Subject: package/om-watchdog: add OpenMesh OM2P-HSv3 support + +Signed-off-by: Sven Eckelmann + +Forwarded: https://patchwork.ozlabs.org/patch/637055/ + +diff --git a/package/kernel/om-watchdog/files/om-watchdog.init b/package/kernel/om-watchdog/files/om-watchdog.init +index 6b96966..bf8a124 100644 +--- a/package/kernel/om-watchdog/files/om-watchdog.init ++++ b/package/kernel/om-watchdog/files/om-watchdog.init +@@ -13,7 +13,7 @@ boot() { + local board=$(ar71xx_board_name) + + case "$board" in +- "om2p"|"om2p-hs"|"om2p-hsv2"|"om5p-acv2") ++ "om2p"|"om2p-hs"|"om2p-hsv2"|"om2p-hsv3"|"om5p-acv2") + service_start /sbin/om-watchdog 12 + ;; + "om2pv2"|"om2p-lc") diff --git a/patches/openwrt/0101-package-uboot-envtools-add-OpenMesh-OM2P-HSv3-support.patch b/patches/openwrt/0101-package-uboot-envtools-add-OpenMesh-OM2P-HSv3-support.patch new file mode 100644 index 00000000..1fee2332 --- /dev/null +++ b/patches/openwrt/0101-package-uboot-envtools-add-OpenMesh-OM2P-HSv3-support.patch @@ -0,0 +1,20 @@ +From: Sven Eckelmann +Date: Fri, 20 May 2016 18:03:52 +0200 +Subject: package/uboot-envtools: add OpenMesh OM2P-HSv3 support + +Signed-off-by: Sven Eckelmann + +Forwarded: https://patchwork.ozlabs.org/patch/637056/ + +diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx +index 9071c11..81c6481 100644 +--- a/package/boot/uboot-envtools/files/ar71xx ++++ b/package/boot/uboot-envtools/files/ar71xx +@@ -41,6 +41,7 @@ om2p | \ + om2pv2 | \ + om2p-hs | \ + om2p-hsv2 | \ ++om2p-hsv3 | \ + om2p-lc) + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x40000" + ;; diff --git a/patches/openwrt/0102-ar71xx-add-OM2P-HSv3-to-the-OM2P-profile.patch b/patches/openwrt/0102-ar71xx-add-OM2P-HSv3-to-the-OM2P-profile.patch new file mode 100644 index 00000000..0ad77fc4 --- /dev/null +++ b/patches/openwrt/0102-ar71xx-add-OM2P-HSv3-to-the-OM2P-profile.patch @@ -0,0 +1,27 @@ +From: Sven Eckelmann +Date: Fri, 20 May 2016 18:03:53 +0200 +Subject: ar71xx: add OM2P-HSv3 to the OM2P profile + +Signed-off-by: Sven Eckelmann + +Forwarded: https://patchwork.ozlabs.org/patch/637057/ + +diff --git a/target/linux/ar71xx/generic/profiles/openmesh.mk b/target/linux/ar71xx/generic/profiles/openmesh.mk +index c0919ed..ddd3f8d 100644 +--- a/target/linux/ar71xx/generic/profiles/openmesh.mk ++++ b/target/linux/ar71xx/generic/profiles/openmesh.mk +@@ -6,12 +6,12 @@ + # + + define Profile/OM2P +- NAME:=OpenMesh OM2P/OM2Pv2/OM2P-HS/OM2P-HSv2/OM2P-LC ++ NAME:=OpenMesh OM2P/OM2Pv2/OM2P-HS/OM2P-HSv2/OM2P-HSv3/OM2P-LC + PACKAGES:=kmod-ath9k om-watchdog + endef + + define Profile/OM2P/Description +- Package set optimized for the OpenMesh OM2P/OM2Pv2/OM2P-HS/OM2P-HSv2/OM2P-LC. ++ Package set optimized for the OpenMesh OM2P/OM2Pv2/OM2P-HS/OM2P-HSv2/OM2P-HSv3/OM2P-LC. + endef + + $(eval $(call Profile,OM2P)) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 9d78c949..88c6fc92 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -330,6 +330,7 @@ $(eval $(call GluonModel,OM2P,om2p,openmesh-om2p)) $(eval $(call GluonModelAlias,OM2P,openmesh-om2p,openmesh-om2pv2)) $(eval $(call GluonModelAlias,OM2P,openmesh-om2p,openmesh-om2p-hs)) $(eval $(call GluonModelAlias,OM2P,openmesh-om2p,openmesh-om2p-hsv2)) +$(eval $(call GluonModelAlias,OM2P,openmesh-om2p,openmesh-om2p-hsv3)) $(eval $(call GluonModelAlias,OM2P,openmesh-om2p,openmesh-om2p-lc)) # OM5P From fa04fff88d5111cc727beae285bc52e0e2fc712d Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Fri, 17 Jun 2016 15:35:49 +0200 Subject: [PATCH 448/867] ar71xx-generic: Add support for OpenMesh MR1750v2 The new MR1750v2 device support is only available in LEDE master. The relevant patches have to backported to add support for them in Gluon Signed-off-by: Sven Eckelmann --- docs/index.rst | 2 +- .../files/lib/gluon/upgrade/010-primary-mac | 2 +- ...el-support-for-the-OpenMesh-MR1750v2.patch | 33 ++++++++++ ...ce-support-for-the-OpenMesh-MR1750v2.patch | 62 +++++++++++++++++++ ...sysupgrade-for-the-OpenMesh-MR1750v2.patch | 40 ++++++++++++ ...tchdog-add-OpenMesh-MR1750v2-support.patch | 21 +++++++ ...vtools-add-OpenMesh-MR1750v2-support.patch | 20 ++++++ ....bin-for-the-OpenMesh-MR1750v2-board.patch | 20 ++++++ ...x-add-MR1750v2-to-the-MR1750-profile.patch | 27 ++++++++ targets/ar71xx-generic/profiles.mk | 1 + 10 files changed, 226 insertions(+), 2 deletions(-) create mode 100644 patches/openwrt/0103-ar71xx-add-kernel-support-for-the-OpenMesh-MR1750v2.patch create mode 100644 patches/openwrt/0104-ar71xx-add-user-space-support-for-the-OpenMesh-MR1750v2.patch create mode 100644 patches/openwrt/0105-ar71xx-enable-sysupgrade-for-the-OpenMesh-MR1750v2.patch create mode 100644 patches/openwrt/0106-package-om-watchdog-add-OpenMesh-MR1750v2-support.patch create mode 100644 patches/openwrt/0107-package-uboot-envtools-add-OpenMesh-MR1750v2-support.patch create mode 100644 patches/openwrt/0108-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-MR1750v2-board.patch create mode 100644 patches/openwrt/0109-ar71xx-add-MR1750v2-to-the-MR1750-profile.patch diff --git a/docs/index.rst b/docs/index.rst index c25ce8f8..42079ee5 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -133,7 +133,7 @@ ar71xx-generic * OpenMesh - - MR1750 + - MR1750 (v1, v2) - MR600 (v1, v2) - MR900 (v1, v2) - OM2P (v1, v2) diff --git a/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac b/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac index 849b7a34..75d60d16 100755 --- a/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac +++ b/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac @@ -27,7 +27,7 @@ if platform.match('ar71xx', 'generic', {'tl-wdr3600', 'tl-wdr4300'}) then elseif platform.match('ar71xx', 'generic', {'unifi-outdoor-plus', 'carambola2', 'mr600', 'mr600v2', 'mr900', 'mr900v2', - 'mr1750', + 'mr1750', 'mr1750v2', 'om2p', 'om2pv2', 'om2p-hs', 'om2p-hsv2', 'om2p-hsv3', 'om2p-lc', diff --git a/patches/openwrt/0103-ar71xx-add-kernel-support-for-the-OpenMesh-MR1750v2.patch b/patches/openwrt/0103-ar71xx-add-kernel-support-for-the-OpenMesh-MR1750v2.patch new file mode 100644 index 00000000..1122b7b9 --- /dev/null +++ b/patches/openwrt/0103-ar71xx-add-kernel-support-for-the-OpenMesh-MR1750v2.patch @@ -0,0 +1,33 @@ +From: Sven Eckelmann +Date: Fri, 20 May 2016 18:03:54 +0200 +Subject: ar71xx: add kernel support for the OpenMesh MR1750v2 + +Signed-off-by: Sven Eckelmann + +Forwarded: https://patchwork.ozlabs.org/patch/637058/ + +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c +index e3c04e7..18101ce 100644 +--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c ++++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c +@@ -168,3 +168,4 @@ static void __init mr1750_setup(void) + } + + MIPS_MACHINE(ATH79_MACH_MR1750, "MR1750", "OpenMesh MR1750", mr1750_setup); ++MIPS_MACHINE(ATH79_MACH_MR1750V2, "MR1750v2", "OpenMesh MR1750v2", mr1750_setup); +diff --git a/target/linux/ar71xx/patches-3.18/818-MIPS-ath79-add-mr1750v2-support.patch b/target/linux/ar71xx/patches-3.18/818-MIPS-ath79-add-mr1750v2-support.patch +new file mode 100644 +index 0000000..de732ec +--- /dev/null ++++ b/target/linux/ar71xx/patches-3.18/818-MIPS-ath79-add-mr1750v2-support.patch +@@ -0,0 +1,10 @@ ++--- a/arch/mips/ath79/machtypes.h +++++ b/arch/mips/ath79/machtypes.h ++@@ -76,6 +76,7 @@ enum ath79_mach_type { ++ ATH79_MACH_MR12, /* Cisco Meraki MR12 */ ++ ATH79_MACH_MR16, /* Cisco Meraki MR16 */ ++ ATH79_MACH_MR1750, /* OpenMesh MR1750 */ +++ ATH79_MACH_MR1750V2, /* OpenMesh MR1750v2 */ ++ ATH79_MACH_MR600V2, /* OpenMesh MR600v2 */ ++ ATH79_MACH_MR600, /* OpenMesh MR600 */ ++ ATH79_MACH_MR900, /* OpenMesh MR900 */ diff --git a/patches/openwrt/0104-ar71xx-add-user-space-support-for-the-OpenMesh-MR1750v2.patch b/patches/openwrt/0104-ar71xx-add-user-space-support-for-the-OpenMesh-MR1750v2.patch new file mode 100644 index 00000000..3c99224d --- /dev/null +++ b/patches/openwrt/0104-ar71xx-add-user-space-support-for-the-OpenMesh-MR1750v2.patch @@ -0,0 +1,62 @@ +From: Sven Eckelmann +Date: Fri, 20 May 2016 18:03:55 +0200 +Subject: ar71xx: add user-space support for the OpenMesh MR1750v2 + +Signed-off-by: Sven Eckelmann + +Forwarded: https://patchwork.ozlabs.org/patch/637059/ + +diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh +index aa02212..f182d60 100644 +--- a/target/linux/ar71xx/base-files/etc/diag.sh ++++ b/target/linux/ar71xx/base-files/etc/diag.sh +@@ -143,7 +143,8 @@ get_status_led() { + mr600v2) + status_led="mr600:blue:power" + ;; +- mr1750) ++ mr1750 | \ ++ mr1750v2) + status_led="mr1750:blue:power" + ;; + mr900 | \ +diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds +index 5767f48..032acc9 100644 +--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds ++++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds +@@ -243,7 +243,8 @@ mr600) + ucidef_set_led_wlan "wlan58" "WLAN58" "mr600:green:wlan58" "phy0tpt" + ;; + +-mr1750) ++mr1750 | \ ++mr1750v2) + ucidef_set_led_netdev "lan" "LAN" "mr1750:blue:wan" "eth0" + ucidef_set_led_wlan "wlan58" "WLAN58" "mr1750:blue:wlan58" "phy0tpt" + ucidef_set_led_wlan "wlan24" "WLAN24" "mr1750:blue:wlan24" "phy1tpt" +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 89a2184..b8ae576 100755 +--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network ++++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network +@@ -335,6 +335,7 @@ eap7660d |\ + el-mini |\ + loco-m-xw |\ + mr1750 |\ ++mr1750v2 |\ + mr600 |\ + mr600v2 |\ + mr900 |\ +diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh +index dc51b03..5119b36 100755 +--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh ++++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh +@@ -568,6 +568,9 @@ ar71xx_board_detect() { + *MR1750) + name="mr1750" + ;; ++ *MR1750v2) ++ name="mr1750v2" ++ ;; + *MR600) + name="mr600" + ;; diff --git a/patches/openwrt/0105-ar71xx-enable-sysupgrade-for-the-OpenMesh-MR1750v2.patch b/patches/openwrt/0105-ar71xx-enable-sysupgrade-for-the-OpenMesh-MR1750v2.patch new file mode 100644 index 00000000..51ba8566 --- /dev/null +++ b/patches/openwrt/0105-ar71xx-enable-sysupgrade-for-the-OpenMesh-MR1750v2.patch @@ -0,0 +1,40 @@ +From: Sven Eckelmann +Date: Fri, 20 May 2016 18:03:56 +0200 +Subject: ar71xx: enable sysupgrade for the OpenMesh MR1750v2 + +Signed-off-by: Sven Eckelmann + +Forwarded: https://patchwork.ozlabs.org/patch/637060/ + +diff --git a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh +index 0e8ea27..95d39bf 100644 +--- a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh ++++ b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh +@@ -81,6 +81,7 @@ platform_check_image_openmesh() + ;; + MR1750) + [ "$board" = "mr1750" ] && break ++ [ "$board" = "mr1750v2" ] && break + echo "Invalid image board target ($img_board_target) for this platform: $board. Use the correct image for this platform" + return 1 + ;; +diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +index 9b26e73..f33419f 100755 +--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh ++++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +@@ -298,6 +298,7 @@ platform_check_image() { + return 0; + ;; + mr1750 | \ ++ mr1750v2 | \ + mr600 | \ + mr600v2 | \ + mr900 | \ +@@ -534,6 +535,7 @@ platform_do_upgrade() { + platform_do_upgrade_dir825b "$ARGV" + ;; + mr1750 | \ ++ mr1750v2 | \ + mr600 | \ + mr600v2 | \ + mr900 | \ diff --git a/patches/openwrt/0106-package-om-watchdog-add-OpenMesh-MR1750v2-support.patch b/patches/openwrt/0106-package-om-watchdog-add-OpenMesh-MR1750v2-support.patch new file mode 100644 index 00000000..c5ee90df --- /dev/null +++ b/patches/openwrt/0106-package-om-watchdog-add-OpenMesh-MR1750v2-support.patch @@ -0,0 +1,21 @@ +From: Sven Eckelmann +Date: Fri, 20 May 2016 18:03:57 +0200 +Subject: package/om-watchdog: add OpenMesh MR1750v2 support + +Signed-off-by: Sven Eckelmann + +Forwarded: https://patchwork.ozlabs.org/patch/637062/ + +diff --git a/package/kernel/om-watchdog/files/om-watchdog.init b/package/kernel/om-watchdog/files/om-watchdog.init +index bf8a124..8a1b66e 100644 +--- a/package/kernel/om-watchdog/files/om-watchdog.init ++++ b/package/kernel/om-watchdog/files/om-watchdog.init +@@ -28,7 +28,7 @@ boot() { + "mr600v2") + service_start /sbin/om-watchdog 15 + ;; +- "mr900"|"mr900v2"|"mr1750") ++ "mr900"|"mr900v2"|"mr1750"|"mr1750v2") + service_start /sbin/om-watchdog 16 + ;; + esac diff --git a/patches/openwrt/0107-package-uboot-envtools-add-OpenMesh-MR1750v2-support.patch b/patches/openwrt/0107-package-uboot-envtools-add-OpenMesh-MR1750v2-support.patch new file mode 100644 index 00000000..5b51bfda --- /dev/null +++ b/patches/openwrt/0107-package-uboot-envtools-add-OpenMesh-MR1750v2-support.patch @@ -0,0 +1,20 @@ +From: Sven Eckelmann +Date: Fri, 20 May 2016 18:03:58 +0200 +Subject: package/uboot-envtools: add OpenMesh MR1750v2 support + +Signed-off-by: Sven Eckelmann + +Forwarded: https://patchwork.ozlabs.org/patch/637064/ + +diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx +index 81c6481..459e73d 100644 +--- a/package/boot/uboot-envtools/files/ar71xx ++++ b/package/boot/uboot-envtools/files/ar71xx +@@ -22,6 +22,7 @@ eap300v2 | \ + hornet-ub | \ + hornet-ub-x2 | \ + mr1750 | \ ++mr1750v2 | \ + mr600 | \ + mr600v2 | \ + mr900 | \ diff --git a/patches/openwrt/0108-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-MR1750v2-board.patch b/patches/openwrt/0108-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-MR1750v2-board.patch new file mode 100644 index 00000000..ad8aaca9 --- /dev/null +++ b/patches/openwrt/0108-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-MR1750v2-board.patch @@ -0,0 +1,20 @@ +From: Sven Eckelmann +Date: Fri, 20 May 2016 18:03:59 +0200 +Subject: ar71xx: extract ath10k wifi board.bin for the OpenMesh MR1750v2 board + +Signed-off-by: Sven Eckelmann + +Forwarded: https://patchwork.ozlabs.org/patch/637063/ + +diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +index d925a85..0e93feb 100644 +--- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata ++++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +@@ -72,6 +72,7 @@ case "$FIRMWARE" in + ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1) + ;; + mr1750 | \ ++ mr1750v2 | \ + om5p-acv2) + ath10kcal_extract "ART" 20480 2116 + ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16) diff --git a/patches/openwrt/0109-ar71xx-add-MR1750v2-to-the-MR1750-profile.patch b/patches/openwrt/0109-ar71xx-add-MR1750v2-to-the-MR1750-profile.patch new file mode 100644 index 00000000..dfcb7b43 --- /dev/null +++ b/patches/openwrt/0109-ar71xx-add-MR1750v2-to-the-MR1750-profile.patch @@ -0,0 +1,27 @@ +From: Sven Eckelmann +Date: Fri, 20 May 2016 18:04:00 +0200 +Subject: ar71xx: add MR1750v2 to the MR1750 profile + +Signed-off-by: Sven Eckelmann + +Forwarded: https://patchwork.ozlabs.org/patch/637065/ + +diff --git a/target/linux/ar71xx/generic/profiles/openmesh.mk b/target/linux/ar71xx/generic/profiles/openmesh.mk +index ddd3f8d..e245e6c 100644 +--- a/target/linux/ar71xx/generic/profiles/openmesh.mk ++++ b/target/linux/ar71xx/generic/profiles/openmesh.mk +@@ -61,12 +61,12 @@ endef + $(eval $(call Profile,MR900)) + + define Profile/MR1750 +- NAME:=OpenMesh MR1750 ++ NAME:=OpenMesh MR1750/MR1750v2 + PACKAGES:=kmod-ath9k kmod-ath10k ath10k-firmware-qca988x + endef + + define Profile/MR1750/Description +- Package set optimized for the OpenMesh MR1750. ++ Package set optimized for the OpenMesh MR1750/MR1750v2. + endef + + $(eval $(call Profile,MR1750)) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 88c6fc92..bf1d0114 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -313,6 +313,7 @@ $(eval $(call GluonModel,OMEGA,onion-omega,onion-omega)) # MR1750 $(eval $(call GluonProfile,MR1750,om-watchdog uboot-envtools kmod-ath10k ath10k-firmware-qca988x-ct)) $(eval $(call GluonModel,MR1750,mr1750,openmesh-mr1750)) +$(eval $(call GluonModelAlias,MR1750,openmesh-mr1750,openmesh-mr1750v2)) # MR600 $(eval $(call GluonProfile,MR600,om-watchdog uboot-envtools)) From 93fe275000b65a4148d6a9713a030b0d30e6a9f1 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Tue, 21 Jun 2016 12:26:46 +0200 Subject: [PATCH 449/867] batman-adv: Fix speedy join in gateway client mode Speedy join only works when the received packet is either broadcast or an 4addr unicast packet. Thus packets converted from broadcast to unicast via the gateway handling code have to be converted to 4addr packets to allow the receiving gateway server to add the sender address as temporary entry to the translation table. Not doing it will make the batman-adv gateway server drop the DHCP response in many situations because it doesn't yet have the TT entry for the destination of the DHCP response. Signed-off-by: Sven Eckelmann --- ...x-speedy-join-in-gateway-client-mode.patch | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 patches/packages/routing/0004-batman-adv-Fix-speedy-join-in-gateway-client-mode.patch diff --git a/patches/packages/routing/0004-batman-adv-Fix-speedy-join-in-gateway-client-mode.patch b/patches/packages/routing/0004-batman-adv-Fix-speedy-join-in-gateway-client-mode.patch new file mode 100644 index 00000000..0ce45b9e --- /dev/null +++ b/patches/packages/routing/0004-batman-adv-Fix-speedy-join-in-gateway-client-mode.patch @@ -0,0 +1,57 @@ +From: Sven Eckelmann +Date: Fri, 17 Jun 2016 15:54:03 +0200 +Subject: batman-adv: Fix speedy join in gateway client mode + +Speedy join only works when the received packet is either broadcast or an +4addr unicast packet. Thus packets converted from broadcast to unicast via +the gateway handling code have to be converted to 4addr packets to allow +the receiving gateway server to add the sender address as temporary entry +to the translation table. + +Not doing it will make the batman-adv gateway server drop the DHCP response +in many situations because it doesn't yet have the TT entry for the +destination of the DHCP response. + +Signed-off-by: Sven Eckelmann + +diff --git a/batman-adv/patches/0001-batman-adv-Fix-speedy-join-in-gateway-client-mode.patch b/batman-adv/patches/0001-batman-adv-Fix-speedy-join-in-gateway-client-mode.patch +new file mode 100644 +index 0000000..e63b782 +--- /dev/null ++++ b/batman-adv/patches/0001-batman-adv-Fix-speedy-join-in-gateway-client-mode.patch +@@ -0,0 +1,35 @@ ++From: Sven Eckelmann ++Date: Sun, 12 Jun 2016 10:43:19 +0200 ++Subject: [PATCH] batman-adv: Fix speedy join in gateway client mode ++ ++Speedy join only works when the received packet is either broadcast or an ++4addr unicast packet. Thus packets converted from broadcast to unicast via ++the gateway handling code have to be converted to 4addr packets to allow ++the receiving gateway server to add the sender address as temporary entry ++to the translation table. ++ ++Not doing it will make the batman-adv gateway server drop the DHCP response ++in many situations because it doesn't yet have the TT entry for the ++destination of the DHCP response. ++ ++Fixes: 9cbc67d9da47 ("batman-adv: change interface_rx to get orig node") ++Signed-off-by: Sven Eckelmann ++--- ++ net/batman-adv/send.c | 4 ++-- ++ 1 file changed, 2 insertions(+), 2 deletions(-) ++ ++diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c ++index f2f1256..0103976 100644 ++--- a/net/batman-adv/send.c +++++ b/net/batman-adv/send.c ++@@ -424,8 +424,8 @@ int batadv_send_skb_via_gw(struct batadv_priv *bat_priv, struct sk_buff *skb, ++ struct batadv_orig_node *orig_node; ++ ++ orig_node = batadv_gw_get_selected_orig(bat_priv); ++- return batadv_send_skb_unicast(bat_priv, skb, BATADV_UNICAST, 0, ++- orig_node, vid); +++ return batadv_send_skb_unicast(bat_priv, skb, BATADV_UNICAST_4ADDR, +++ BATADV_P_DATA, orig_node, vid); ++ } ++ ++ void batadv_schedule_bat_ogm(struct batadv_hard_iface *hard_iface) From 4251b4d4f55a8b0ca4db7f3de99b9e1d6cd8cd89 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 22 Jun 2016 23:11:20 +0200 Subject: [PATCH 450/867] Update Gluon packages --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 7cefc617..b5a96e92 100644 --- a/modules +++ b/modules @@ -8,7 +8,7 @@ PACKAGES_OPENWRT_COMMIT=73776792f7d58e982be9e5819450d4875b273159 PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git -PACKAGES_GLUON_COMMIT=37c7cebf10d79f83151bb41cf6014a1d379ed3fe +PACKAGES_GLUON_COMMIT=0e391753d32be91bb457a0f75c7ced0670e97aea PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_COMMIT=85e771d2f1ca1981983238073ffc602981acbb40 From dc485f73569c0b66130a38f4abee14ed2bbdf58e Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 23 Jun 2016 00:06:18 +0200 Subject: [PATCH 451/867] gluon-core: make gluon.platform.match() match all boards when no boards are given --- package/gluon-core/files/usr/lib/lua/gluon/platform.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/gluon-core/files/usr/lib/lua/gluon/platform.lua b/package/gluon-core/files/usr/lib/lua/gluon/platform.lua index 3d56f081..6483ad2e 100644 --- a/package/gluon-core/files/usr/lib/lua/gluon/platform.lua +++ b/package/gluon-core/files/usr/lib/lua/gluon/platform.lua @@ -21,7 +21,7 @@ function match(target, subtarget, boards) return false end - if not util.contains(boards, get_board_name()) then + if boards and not util.contains(boards, get_board_name()) then return false end From acd5cc903ec70253dd3aa968f837104c5c0f3ef3 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 23 Jun 2016 00:24:00 +0200 Subject: [PATCH 452/867] build: allow profiles to supply an additional file to be copied to the image directory --- Makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Makefile b/Makefile index 90ea36f3..5c02c752 100644 --- a/Makefile +++ b/Makefile @@ -152,17 +152,21 @@ GLUON_$(1)_FACTORY_SUFFIX := -squashfs-factory GLUON_$(1)_SYSUPGRADE_SUFFIX := -squashfs-sysupgrade GLUON_$(1)_FACTORY_EXT := .bin GLUON_$(1)_SYSUPGRADE_EXT := .bin +GLUON_$(1)_FACTORY_EXTRA := +GLUON_$(1)_SYSUPGRADE_EXTRA := GLUON_$(1)_MODELS := endef define GluonProfileFactorySuffix GLUON_$(1)_FACTORY_SUFFIX := $(2) GLUON_$(1)_FACTORY_EXT := $(3) +GLUON_$(1)_FACTORY_EXTRA := $(4) endef define GluonProfileSysupgradeSuffix GLUON_$(1)_SYSUPGRADE_SUFFIX := $(2) GLUON_$(1)_SYSUPGRADE_EXT := $(3) +GLUON_$(1)_SYSUPGRADE_EXTRA := $(4) endef define GluonModel @@ -447,6 +451,15 @@ image: FORCE cp $(BIN_DIR)/gluon-$(GLUON_$(PROFILE)_MODEL_$(model))$(GLUON_$(PROFILE)_FACTORY_SUFFIX)$(GLUON_$(PROFILE)_FACTORY_EXT) $(GLUON_IMAGEDIR)/factory/$(IMAGE_PREFIX)-$(model)$(GLUON_$(PROFILE)_FACTORY_EXT) && \ ) \ \ + $(if $(GLUON_$(PROFILE)_SYSUPGRADE_EXTRA), \ + rm -f $(GLUON_IMAGEDIR)/sysupgrade/gluon-*-$(model)-sysupgrade$(GLUON_$(PROFILE)_SYSUPGRADE_EXTRA) && \ + cp $(BIN_DIR)/gluon$(GLUON_$(PROFILE)_SYSUPGRADE_EXTRA) $(GLUON_IMAGEDIR)/sysupgrade/$(IMAGE_PREFIX)-$(model)-sysupgrade$(GLUON_$(PROFILE)_SYSUPGRADE_EXTRA) && \ + ) \ + $(if $(GLUON_$(PROFILE)_FACTORY_EXTRA), \ + rm -f $(GLUON_IMAGEDIR)/factory/gluon-*-$(model)$(GLUON_$(PROFILE)_FACTORY_EXTRA) && \ + cp $(BIN_DIR)/gluon$(GLUON_$(PROFILE)_FACTORY_EXTRA) $(GLUON_IMAGEDIR)/factory/$(IMAGE_PREFIX)-$(model)$(GLUON_$(PROFILE)_FACTORY_EXTRA) && \ + ) \ + \ $(foreach alias,$(GLUON_$(PROFILE)_MODEL_$(model)_ALIASES), \ $(if $(GLUON_$(PROFILE)_SYSUPGRADE_EXT), \ rm -f $(GLUON_IMAGEDIR)/sysupgrade/gluon-*-$(alias)-sysupgrade$(GLUON_$(PROFILE)_SYSUPGRADE_EXT) && \ From bae721a9bb5c9e1be095e6740a1738ac0e219b6e Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 22 Jun 2016 23:22:19 +0200 Subject: [PATCH 453/867] Add target ar71xx-mikrotik Fixes #121 Based-on-patch-by: Tobias Hachmer --- .../files/lib/gluon/upgrade/010-primary-mac | 5 ++++- .../files/lib/gluon/upgrade/320-setup-ifname | 11 +++++++---- targets/ar71xx-mikrotik/profiles.mk | 10 ++++++++++ targets/targets.mk | 1 + 4 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 targets/ar71xx-mikrotik/profiles.mk diff --git a/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac b/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac index 75d60d16..231bb861 100755 --- a/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac +++ b/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac @@ -18,7 +18,10 @@ local try_files = { '/sys/class/net/eth0/address' } -if not util.contains({'x86', 'brcm2708'}, platform.get_target()) then +if not ( + util.contains({'x86', 'brcm2708'}, platform.get_target()) or + platform.match('ar71xx', 'mikrotik') +) then table.insert(try_files, 1, '/sys/class/ieee80211/phy0/macaddress') end diff --git a/package/gluon-setup-mode/files/lib/gluon/upgrade/320-setup-ifname b/package/gluon-setup-mode/files/lib/gluon/upgrade/320-setup-ifname index a2b4f796..3dba79a9 100755 --- a/package/gluon-setup-mode/files/lib/gluon/upgrade/320-setup-ifname +++ b/package/gluon-setup-mode/files/lib/gluon/upgrade/320-setup-ifname @@ -5,13 +5,16 @@ local sysconfig = require 'gluon.sysconfig' if sysconfig.setup_ifname then - os.exit(0) + os.exit(0) end -if platform.match('ar71xx', 'generic', {'cpe510', 'nanostation-m', 'nanostation-m-xw', 'unifi-outdoor-plus', 'uap-pro', 'unifiac-pro'}) then - sysconfig.setup_ifname = sysconfig.config_ifname or sysconfig.wan_ifname or sysconfig.lan_ifname +if + platform.match('ar71xx', 'generic', {'cpe510', 'nanostation-m', 'nanostation-m-xw', 'unifi-outdoor-plus', 'uap-pro', 'unifiac-pro'}) or + platform.match('ar71xx', 'mikrotik') +then + sysconfig.setup_ifname = sysconfig.config_ifname or sysconfig.wan_ifname or sysconfig.lan_ifname else - sysconfig.setup_ifname = sysconfig.config_ifname or sysconfig.lan_ifname or sysconfig.wan_ifname + sysconfig.setup_ifname = sysconfig.config_ifname or sysconfig.lan_ifname or sysconfig.wan_ifname end -- Remove the old sysconfig setting diff --git a/targets/ar71xx-mikrotik/profiles.mk b/targets/ar71xx-mikrotik/profiles.mk new file mode 100644 index 00000000..2dcc65fd --- /dev/null +++ b/targets/ar71xx-mikrotik/profiles.mk @@ -0,0 +1,10 @@ +# List of hardware profiles + +## Mikrotik + +# Will contain both ath5k and ath9k +# ath5k cards are commonly used with Mikrotik hardware +$(eval $(call GluonProfile,DefaultNoWifi,kmod-ath5k)) +$(eval $(call GluonProfileFactorySuffix,DefaultNoWifi,,-rootfs.tar.gz,-vmlinux-lzma.elf)) +$(eval $(call GluonProfileSysupgradeSuffix,DefaultNoWifi)) +$(eval $(call GluonModel,DefaultNoWifi,DefaultNoWifi,mikrotik)) diff --git a/targets/targets.mk b/targets/targets.mk index 95b868be..0e0f05a2 100644 --- a/targets/targets.mk +++ b/targets/targets.mk @@ -7,6 +7,7 @@ $(eval $(call GluonTarget,x86,64)) $(eval $(call GluonTarget,x86,xen_domu)) ifneq ($(BROKEN),) +$(eval $(call GluonTarget,ar71xx,mikrotik)) # BROKEN: no sysupgrade support $(eval $(call GluonTarget,ramips,rt305x)) # BROKEN: No AP+IBSS support $(eval $(call GluonTarget,brcm2708,bcm2708)) # BROKEN: Needs more testing $(eval $(call GluonTarget,brcm2708,bcm2709)) # BROKEN: Needs more testing From fb8c7a8bafe1bfff9415f4c94cbec73a2c211b5f Mon Sep 17 00:00:00 2001 From: Christian Tramnitz Date: Thu, 23 Jun 2016 01:05:54 +0200 Subject: [PATCH 454/867] sunxi: add Banana Pro (#802) build-tested with 2016.1.4, boots but packet loss on eth0 omitted ata due to build errors --- targets/sunxi/profiles.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/targets/sunxi/profiles.mk b/targets/sunxi/profiles.mk index 55416c2a..c1cb4515 100644 --- a/targets/sunxi/profiles.mk +++ b/targets/sunxi/profiles.mk @@ -9,3 +9,9 @@ $(eval $(call GluonProfile,Lamobo_R1,uboot-sunxi-Lamobo_R1 kmod-ata-sunxi kmod-r $(eval $(call GluonProfileFactorySuffix,Lamobo_R1,-sdcard-vfat-ext4,.img.gz)) $(eval $(call GluonProfileSysupgradeSuffix,Lamobo_R1)) $(eval $(call GluonModel,Lamobo_R1,Lamobo_R1,lemaker-lamobo-r1)) + +# Banana Pro +$(eval $(call GluonProfile,Bananapro,uboot-sunxi-Bananapro kmod-rtc-sunxi kmod-brcmfmac)) +$(eval $(call GluonProfileFactorySuffix,Bananapro,-sdcard-vfat-ext4,.img.gz)) +$(eval $(call GluonProfileSysupgradeSuffix,Bananapro)) +$(eval $(call GluonModel,Bananapro,Bananapro,lemaker-banana-pro)) From 6b644df4aeaa87104926698c7f8d7967eabd782e Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 29 Jun 2016 16:50:54 +0200 Subject: [PATCH 455/867] brcm2708-*: remove BROKEN --- targets/targets.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/targets/targets.mk b/targets/targets.mk index 0e0f05a2..4924db92 100644 --- a/targets/targets.mk +++ b/targets/targets.mk @@ -1,5 +1,7 @@ $(eval $(call GluonTarget,ar71xx,generic)) $(eval $(call GluonTarget,ar71xx,nand)) +$(eval $(call GluonTarget,brcm2708,bcm2708)) +$(eval $(call GluonTarget,brcm2708,bcm2709)) $(eval $(call GluonTarget,mpc85xx,generic)) $(eval $(call GluonTarget,x86,generic)) $(eval $(call GluonTarget,x86,kvm_guest)) @@ -9,7 +11,5 @@ $(eval $(call GluonTarget,x86,xen_domu)) ifneq ($(BROKEN),) $(eval $(call GluonTarget,ar71xx,mikrotik)) # BROKEN: no sysupgrade support $(eval $(call GluonTarget,ramips,rt305x)) # BROKEN: No AP+IBSS support -$(eval $(call GluonTarget,brcm2708,bcm2708)) # BROKEN: Needs more testing -$(eval $(call GluonTarget,brcm2708,bcm2709)) # BROKEN: Needs more testing $(eval $(call GluonTarget,sunxi)) # BROKEN: Untested, no sysupgrade support endif From e678ab140e51bac3360449b3d10d2a55cae2f6ab Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 1 Jul 2016 13:22:09 +0200 Subject: [PATCH 456/867] scripts/update-patches: disable rename detection git 2.9 enables rename detection by default, changing the content of some of our patch files. Explicitly disable it. --- scripts/update-patches.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/update-patches.sh b/scripts/update-patches.sh index cfdeb58e..f8b92025 100755 --- a/scripts/update-patches.sh +++ b/scripts/update-patches.sh @@ -16,6 +16,6 @@ for module in $GLUON_MODULES; do n=0 for commit in $(git rev-list --reverse --no-merges base..patched); do let n=n+1 - git show --pretty=format:'From: %an <%ae>%nDate: %aD%nSubject: %B' $commit > "$GLUONDIR"/patches/$module/"$(printf '%04u' $n)-$(git show -s --pretty=format:%f $commit).patch" + git show --pretty=format:'From: %an <%ae>%nDate: %aD%nSubject: %B' --no-renames $commit > "$GLUONDIR"/patches/$module/"$(printf '%04u' $n)-$(git show -s --pretty=format:%f $commit).patch" done done From f1570cacb0f61c564505fa32124a8fe6aec4ae3a Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 1 Jul 2016 13:23:31 +0200 Subject: [PATCH 457/867] ramips: add missing patch to spi-nor backport to fix mt7621 support --- ...l-backport-spi-nor-driver-from-4.4.9.patch | 173 ++++++++++++------ 1 file changed, 122 insertions(+), 51 deletions(-) diff --git a/patches/openwrt/0029-kernel-backport-spi-nor-driver-from-4.4.9.patch b/patches/openwrt/0029-kernel-backport-spi-nor-driver-from-4.4.9.patch index 7e3ca845..c15073e9 100644 --- a/patches/openwrt/0029-kernel-backport-spi-nor-driver-from-4.4.9.patch +++ b/patches/openwrt/0029-kernel-backport-spi-nor-driver-from-4.4.9.patch @@ -1915,11 +1915,10 @@ index 2beb39c..21f823d 100644 spi-max-frequency = <25000000>; diff --git a/target/linux/ramips/patches-3.18/0044-mtd-add-chunked-read-io-to-m25p80.patch b/target/linux/ramips/patches-3.18/0044-mtd-add-chunked-read-io-to-m25p80.patch -deleted file mode 100644 -index 1716e1c..0000000 +index 1716e1c..8dc181a 100644 --- a/target/linux/ramips/patches-3.18/0044-mtd-add-chunked-read-io-to-m25p80.patch -+++ /dev/null -@@ -1,103 +0,0 @@ ++++ b/target/linux/ramips/patches-3.18/0044-mtd-add-chunked-read-io-to-m25p80.patch +@@ -1,33 +1,18 @@ ---- a/drivers/mtd/devices/m25p80.c -+++ b/drivers/mtd/devices/m25p80.c -@@ -19,6 +19,7 @@ @@ -1940,65 +1939,86 @@ index 1716e1c..0000000 - -@@ -157,6 +159,61 @@ static int m25p80_read(struct spi_nor *n - return 0; -- } -- ++--- a/drivers/mtd/spi-nor/spi-nor.c +++++ b/drivers/mtd/spi-nor/spi-nor.c ++@@ -1016,6 +1016,66 @@ write_err: ++ return ret; + } + -+static void m25p80_chunked_write(struct spi_nor *nor, loff_t _from, size_t _len, -+ size_t *_retlen, const u_char *_buf) --+{ +++static int spi_nor_chunked_write(struct mtd_info *mtd, loff_t _to, size_t _len, +++ size_t *_retlen, const u_char *_buf) + +{ -+ struct m25p *flash = nor->priv; --+ int chunk_size; --+ int retlen = 0; --+ +++ struct spi_nor *nor = mtd_to_spi_nor(mtd); + + int chunk_size; + + int retlen = 0; +++ int ret; + + -+ chunk_size = flash->chunk_size; --+ if (!chunk_size) --+ chunk_size = _len; --+ --+ if (nor->addr_width > 3) --+ chunk_size -= nor->addr_width - 3; --+ --+ while (retlen < _len) { --+ size_t len = min_t(int, chunk_size, _len - retlen); --+ const u_char *buf = _buf + retlen; +++ chunk_size = nor->chunk_size; + + if (!chunk_size) + + chunk_size = _len; + + +@@ -37,35 +22,39 @@ + + while (retlen < _len) { + + size_t len = min_t(int, chunk_size, _len - retlen); + + const u_char *buf = _buf + retlen; -+ loff_t from = _from + retlen; -+ -+ nor->wait_till_ready(nor); -+ nor->write_reg(nor, SPINOR_OP_WREN, NULL, 0, 0); --+ +++ loff_t to = _to + retlen; + + -+ m25p80_write(nor, from, len, &retlen, buf); --+ } --+ *_retlen += retlen; --+} --+ +++ if (nor->flags & SNOR_F_SST) +++ ret = sst_write(mtd, to, len, &retlen, buf); +++ else +++ ret = spi_nor_write(mtd, to, len, &retlen, buf); +++ if (ret) +++ return ret; + + } +++ + + *_retlen += retlen; +++ return 0; + +} + + -+static int m25p80_chunked_read(struct spi_nor *nor, loff_t _from, size_t _len, -+ size_t *_retlen, u_char *_buf) --+{ +++static int spi_nor_chunked_read(struct mtd_info *mtd, loff_t _from, size_t _len, +++ size_t *_retlen, u_char *_buf) + +{ -+ struct m25p *flash = nor->priv; --+ int chunk_size; --+ +++ struct spi_nor *nor = mtd_to_spi_nor(mtd); + + int chunk_size; +++ int ret; + + -+ chunk_size = flash->chunk_size; --+ if (!chunk_size) --+ chunk_size = _len; +++ chunk_size = nor->chunk_size; + + if (!chunk_size) + + chunk_size = _len; + + + + *_retlen = 0; -+ --+ *_retlen = 0; --+ --+ while (*_retlen < _len) { --+ size_t len = min_t(int, chunk_size, _len - *_retlen); --+ u_char *buf = _buf + *_retlen; --+ loff_t from = _from + *_retlen; --+ int retlen = 0; + + while (*_retlen < _len) { + + size_t len = min_t(int, chunk_size, _len - *_retlen); + + u_char *buf = _buf + *_retlen; + + loff_t from = _from + *_retlen; + + int retlen = 0; -+ int ret = m25p80_read(nor, from, len, &retlen, buf); --+ --+ if (ret) --+ return ret; --+ --+ *_retlen += retlen; --+ } --+ --+ return 0; --+} --+ + + +++ ret = spi_nor_read(mtd, from, len, &retlen, buf); + + if (ret) + + return ret; + + +@@ -75,29 +64,60 @@ + + return 0; + +} + + - static int m25p80_erase(struct spi_nor *nor, loff_t offset) -- { ++ static int macronix_quad_enable(struct spi_nor *nor) + { - struct m25p *flash = nor->priv; -@@ -197,6 +254,7 @@ static int m25p_probe(struct spi_device - struct spi_nor *nor; @@ -2011,15 +2031,66 @@ index 1716e1c..0000000 -@@ -244,6 +302,14 @@ static int m25p_probe(struct spi_device - if (ret) - return ret; -- ++ int ret, val; ++@@ -1197,10 +1257,12 @@ int spi_nor_scan(struct spi_nor *nor, co ++ } + -+ if (spi->dev.of_node && -+ !of_property_read_u32(spi->dev.of_node, "m25p,chunked-io", &val)) { -+ dev_warn(&spi->dev, "using chunked io\n"); -+ nor->read = m25p80_chunked_read; -+ nor->write = m25p80_chunked_write; -+ flash->chunk_size = val; --+ } --+ ++ /* sst nor chips use AAI word program */ ++- if (info->flags & SST_WRITE) +++ if (info->flags & SST_WRITE) { ++ mtd->_write = sst_write; ++- else +++ nor->flags |= SNOR_F_SST; +++ } else { ++ mtd->_write = spi_nor_write; + + } ++ ++ if (info->flags & USE_FSR) ++ nor->flags |= SNOR_F_USE_FSR; ++@@ -1228,11 +1290,20 @@ int spi_nor_scan(struct spi_nor *nor, co ++ mtd->writebufsize = nor->page_size; ++ ++ if (np) { +++ u32 val; + + - ppdata.of_node = spi->dev.of_node; -- ++ /* If we were instantiated by DT, use it */ ++ if (of_property_read_bool(np, "m25p,fast-read")) ++ nor->flash_read = SPI_NOR_FAST; ++ else ++ nor->flash_read = SPI_NOR_NORMAL; +++ +++ if (!of_property_read_u32(np, "m25p,chunked-io", &val)) { +++ dev_info(dev, "using chunked io (size=%d)\n", val); +++ mtd->_read = spi_nor_chunked_read; +++ mtd->_write = spi_nor_chunked_write; +++ nor->chunk_size = val; +++ } ++ } else { ++ /* If we weren't instantiated by DT, default to fast-read */ ++ nor->flash_read = SPI_NOR_FAST; ++--- a/include/linux/mtd/spi-nor.h +++++ b/include/linux/mtd/spi-nor.h ++@@ -115,6 +115,7 @@ enum spi_nor_ops { ++ ++ enum spi_nor_option_flags { ++ SNOR_F_USE_FSR = BIT(0), +++ SNOR_F_SST = BIT(1), ++ }; + - return mtd_device_parse_register(&flash->mtd, NULL, &ppdata, ++ struct mtd_info; ++@@ -157,6 +158,7 @@ struct spi_nor { ++ struct device *dev; ++ struct device_node *flash_node; ++ u32 page_size; +++ u16 chunk_size; ++ u8 addr_width; ++ u8 erase_opcode; ++ u8 read_opcode; From b4829fad6b3f027852970f5678e22c6664fa4821 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 1 Jul 2016 14:28:52 +0200 Subject: [PATCH 458/867] Update gluon packages --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index b5a96e92..ca4e2800 100644 --- a/modules +++ b/modules @@ -8,7 +8,7 @@ PACKAGES_OPENWRT_COMMIT=73776792f7d58e982be9e5819450d4875b273159 PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git -PACKAGES_GLUON_COMMIT=0e391753d32be91bb457a0f75c7ced0670e97aea +PACKAGES_GLUON_COMMIT=390b221b51a490f41081a8a610dd161037547c48 PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_COMMIT=85e771d2f1ca1981983238073ffc602981acbb40 From 0676f5f3948d46dca0a52ab8f3da2bbfaac58da2 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 3 Jul 2016 19:16:30 +0200 Subject: [PATCH 459/867] x86: stop relying on hexdump for image build signature Fixes #811 --- ...on-hexdump-for-image-build-signature.patch | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 patches/openwrt/0110-x86-stop-relying-on-hexdump-for-image-build-signature.patch diff --git a/patches/openwrt/0110-x86-stop-relying-on-hexdump-for-image-build-signature.patch b/patches/openwrt/0110-x86-stop-relying-on-hexdump-for-image-build-signature.patch new file mode 100644 index 00000000..e2972eb2 --- /dev/null +++ b/patches/openwrt/0110-x86-stop-relying-on-hexdump-for-image-build-signature.patch @@ -0,0 +1,24 @@ +From: Matthias Schiffer +Date: Sun, 3 Jul 2016 19:15:49 +0200 +Subject: x86: stop relying on hexdump for image build signature + +Use perl to generate random number instead. +See https://github.com/freifunk-gluon/gluon/issues/811 + +Signed-off-by: Felix Fietkau + +Backport of LEDE d5ee23ee275fcd6550b0051de59706cc928cdac8 + +diff --git a/target/linux/x86/image/Makefile b/target/linux/x86/image/Makefile +index e7e02f1..6f64eba 100644 +--- a/target/linux/x86/image/Makefile ++++ b/target/linux/x86/image/Makefile +@@ -40,7 +40,7 @@ ifneq ($(GRUB_TERMINALS),) + GRUB_TERMINAL_CONFIG := terminal_input $(GRUB_TERMINALS); terminal_output $(GRUB_TERMINALS) + endif + +-SIGNATURE:=$(shell dd if=/dev/urandom bs=4 count=1 2>/dev/null | hexdump -v -e '"%08x"') ++SIGNATURE:=$(shell perl -e 'printf("%08x", rand(0xFFFFFFFF))') + ROOTPART:=$(call qstrip,$(CONFIG_TARGET_ROOTFS_PARTNAME)) + ROOTPART:=$(if $(ROOTPART),$(ROOTPART),PARTUUID=$(SIGNATURE)-02) + From fd237f6f43d4ad36e1987bf7461a16647287db18 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 30 Jun 2016 21:07:25 +0200 Subject: [PATCH 460/867] mac80211: update to LEDE 0a0caa2656c8db73518a1783743ede772e3ac40f --- ...la-Technologies-firmware-for-QCA988X.patch | 72 - ...aa2656c8db73518a1783743ede772e3ac40f.patch | 9585 +++++++++++++++++ ...11-ath10k-allow-simultaneous-AP-IBSS.patch | 20 +- ...uner-support-for-UniFi-Outdoor-Plus.patch} | 56 +- ...-ath9k-enable-platform-WLAN-LED-name.patch | 121 - ...x-Send-power-to-USB-port-on-WNR2200.patch} | 0 ...-set-default-state-for-platform-LEDs.patch | 47 - ...1xx-WNR2200-fix-for-random-WLAN-MAC.patch} | 0 ...mac80211-ath9k-enable-access-to-GPIO.patch | 261 - ...ble-control-of-all-LEDs-and-buttons.patch} | 0 .../openwrt/0083-mac80211-refresh-patch.patch | 30 - ...=> 0084-ar71xx-add-GL-AR150-support.patch} | 0 ...4-mac80211-ath9k-enable-GPIO-buttons.patch | 259 - ...-on-platforms-without-CONFIG_GPIOLIB.patch | 827 -- ...ix-version-detection-for-Make-4.2.1.patch} | 0 ...j-for-parallel-builds-with-Make-4.2.patch} | 0 ...ke-fix-parallel-build-with-Make-4.2.patch} | 0 ...IPv6-builtin-if-selected-saves-30KB.patch} | 0 ...ages-with-multiple-PROVIDES-entries.patch} | 0 ...od-crypto-core-and-kmod-crypto-arc4.patch} | 13 - ...-support-for-the-OpenMesh-OM2P-HSv3.patch} | 0 ...-support-for-the-OpenMesh-OM2P-HSv3.patch} | 0 ...supgrade-for-the-OpenMesh-OM2P-HSv3.patch} | 0 ...hdog-add-OpenMesh-OM2P-HSv3-support.patch} | 0 ...ools-add-OpenMesh-OM2P-HSv3-support.patch} | 0 ...x-add-OM2P-HSv3-to-the-OM2P-profile.patch} | 0 ...l-support-for-the-OpenMesh-MR1750v2.patch} | 0 ...e-support-for-the-OpenMesh-MR1750v2.patch} | 0 ...ysupgrade-for-the-OpenMesh-MR1750v2.patch} | 0 ...chdog-add-OpenMesh-MR1750v2-support.patch} | 0 ...tools-add-OpenMesh-MR1750v2-support.patch} | 0 ...bin-for-the-OpenMesh-MR1750v2-board.patch} | 0 ...-add-MR1750v2-to-the-MR1750-profile.patch} | 0 ...n-hexdump-for-image-build-signature.patch} | 0 ...0105-mt76-fix-build-with-kernel-3.18.patch | 34 + 35 files changed, 9663 insertions(+), 1662 deletions(-) delete mode 100644 patches/openwrt/0006-ath10k-firmware-add-Candela-Technologies-firmware-for-QCA988X.patch create mode 100644 patches/openwrt/0006-mac80211-update-to-LEDE-0a0caa2656c8db73518a1783743ede772e3ac40f.patch rename patches/openwrt/{0086-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch => 0080-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch} (89%) delete mode 100644 patches/openwrt/0080-mac80211-ath9k-enable-platform-WLAN-LED-name.patch rename patches/openwrt/{0087-ar71xx-Send-power-to-USB-port-on-WNR2200.patch => 0081-ar71xx-Send-power-to-USB-port-on-WNR2200.patch} (100%) delete mode 100644 patches/openwrt/0081-mac80211-ath9k-set-default-state-for-platform-LEDs.patch rename patches/openwrt/{0088-ar71xx-WNR2200-fix-for-random-WLAN-MAC.patch => 0082-ar71xx-WNR2200-fix-for-random-WLAN-MAC.patch} (100%) delete mode 100644 patches/openwrt/0082-mac80211-ath9k-enable-access-to-GPIO.patch rename patches/openwrt/{0089-ar71xx-WNR2200-enable-control-of-all-LEDs-and-buttons.patch => 0083-ar71xx-WNR2200-enable-control-of-all-LEDs-and-buttons.patch} (100%) delete mode 100644 patches/openwrt/0083-mac80211-refresh-patch.patch rename patches/openwrt/{0090-ar71xx-add-GL-AR150-support.patch => 0084-ar71xx-add-GL-AR150-support.patch} (100%) delete mode 100644 patches/openwrt/0084-mac80211-ath9k-enable-GPIO-buttons.patch delete mode 100644 patches/openwrt/0085-mac80211-rework-gpio-chip-button-support-to-build-on-platforms-without-CONFIG_GPIOLIB.patch rename patches/openwrt/{0091-scripts-feeds-fix-version-detection-for-Make-4.2.1.patch => 0085-scripts-feeds-fix-version-detection-for-Make-4.2.1.patch} (100%) rename patches/openwrt/{0092-build-don-t-add-j-for-parallel-builds-with-Make-4.2.patch => 0086-build-don-t-add-j-for-parallel-builds-with-Make-4.2.patch} (100%) rename patches/openwrt/{0093-tools-cmake-fix-parallel-build-with-Make-4.2.patch => 0087-tools-cmake-fix-parallel-build-with-Make-4.2.patch} (100%) rename patches/openwrt/{0094-linux-make-IPv6-builtin-if-selected-saves-30KB.patch => 0088-linux-make-IPv6-builtin-if-selected-saves-30KB.patch} (100%) rename patches/openwrt/{0095-package-ipkg.mk-fix-Provides-for-packages-with-multiple-PROVIDES-entries.patch => 0089-package-ipkg.mk-fix-Provides-for-packages-with-multiple-PROVIDES-entries.patch} (100%) rename patches/openwrt/{0096-kernel-remove-packaging-of-kmod-crypto-core-and-kmod-crypto-arc4.patch => 0090-kernel-remove-packaging-of-kmod-crypto-core-and-kmod-crypto-arc4.patch} (90%) rename patches/openwrt/{0097-ar71xx-add-kernel-support-for-the-OpenMesh-OM2P-HSv3.patch => 0091-ar71xx-add-kernel-support-for-the-OpenMesh-OM2P-HSv3.patch} (100%) rename patches/openwrt/{0098-ar71xx-add-user-space-support-for-the-OpenMesh-OM2P-HSv3.patch => 0092-ar71xx-add-user-space-support-for-the-OpenMesh-OM2P-HSv3.patch} (100%) rename patches/openwrt/{0099-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM2P-HSv3.patch => 0093-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM2P-HSv3.patch} (100%) rename patches/openwrt/{0100-package-om-watchdog-add-OpenMesh-OM2P-HSv3-support.patch => 0094-package-om-watchdog-add-OpenMesh-OM2P-HSv3-support.patch} (100%) rename patches/openwrt/{0101-package-uboot-envtools-add-OpenMesh-OM2P-HSv3-support.patch => 0095-package-uboot-envtools-add-OpenMesh-OM2P-HSv3-support.patch} (100%) rename patches/openwrt/{0102-ar71xx-add-OM2P-HSv3-to-the-OM2P-profile.patch => 0096-ar71xx-add-OM2P-HSv3-to-the-OM2P-profile.patch} (100%) rename patches/openwrt/{0103-ar71xx-add-kernel-support-for-the-OpenMesh-MR1750v2.patch => 0097-ar71xx-add-kernel-support-for-the-OpenMesh-MR1750v2.patch} (100%) rename patches/openwrt/{0104-ar71xx-add-user-space-support-for-the-OpenMesh-MR1750v2.patch => 0098-ar71xx-add-user-space-support-for-the-OpenMesh-MR1750v2.patch} (100%) rename patches/openwrt/{0105-ar71xx-enable-sysupgrade-for-the-OpenMesh-MR1750v2.patch => 0099-ar71xx-enable-sysupgrade-for-the-OpenMesh-MR1750v2.patch} (100%) rename patches/openwrt/{0106-package-om-watchdog-add-OpenMesh-MR1750v2-support.patch => 0100-package-om-watchdog-add-OpenMesh-MR1750v2-support.patch} (100%) rename patches/openwrt/{0107-package-uboot-envtools-add-OpenMesh-MR1750v2-support.patch => 0101-package-uboot-envtools-add-OpenMesh-MR1750v2-support.patch} (100%) rename patches/openwrt/{0108-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-MR1750v2-board.patch => 0102-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-MR1750v2-board.patch} (100%) rename patches/openwrt/{0109-ar71xx-add-MR1750v2-to-the-MR1750-profile.patch => 0103-ar71xx-add-MR1750v2-to-the-MR1750-profile.patch} (100%) rename patches/openwrt/{0110-x86-stop-relying-on-hexdump-for-image-build-signature.patch => 0104-x86-stop-relying-on-hexdump-for-image-build-signature.patch} (100%) create mode 100644 patches/openwrt/0105-mt76-fix-build-with-kernel-3.18.patch diff --git a/patches/openwrt/0006-ath10k-firmware-add-Candela-Technologies-firmware-for-QCA988X.patch b/patches/openwrt/0006-ath10k-firmware-add-Candela-Technologies-firmware-for-QCA988X.patch deleted file mode 100644 index 5baf2712..00000000 --- a/patches/openwrt/0006-ath10k-firmware-add-Candela-Technologies-firmware-for-QCA988X.patch +++ /dev/null @@ -1,72 +0,0 @@ -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 b03d644..7d4d449 100644 ---- a/package/firmware/ath10k-firmware/Makefile -+++ b/package/firmware/ath10k-firmware/Makefile -@@ -44,6 +44,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 -@@ -79,6 +99,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/ -@@ -98,5 +128,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/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile -index 30da1cf..cd8d670 100644 ---- a/package/kernel/mac80211/Makefile -+++ b/package/kernel/mac80211/Makefile -@@ -247,7 +247,7 @@ 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 +@KERNEL_RELAY +ath10k-firmware-qca988x -+ 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 diff --git a/patches/openwrt/0006-mac80211-update-to-LEDE-0a0caa2656c8db73518a1783743ede772e3ac40f.patch b/patches/openwrt/0006-mac80211-update-to-LEDE-0a0caa2656c8db73518a1783743ede772e3ac40f.patch new file mode 100644 index 00000000..26bd0609 --- /dev/null +++ b/patches/openwrt/0006-mac80211-update-to-LEDE-0a0caa2656c8db73518a1783743ede772e3ac40f.patch @@ -0,0 +1,9585 @@ +From: Matthias Schiffer +Date: Tue, 7 Jun 2016 14:06:23 +0200 +Subject: mac80211: update to LEDE 0a0caa2656c8db73518a1783743ede772e3ac40f + +diff --git a/package/firmware/ath10k-firmware/Makefile b/package/firmware/ath10k-firmware/Makefile +index b03d644..4f63cdd 100644 +--- a/package/firmware/ath10k-firmware/Makefile ++++ b/package/firmware/ath10k-firmware/Makefile +@@ -8,7 +8,7 @@ + include $(TOPDIR)/rules.mk + + PKG_NAME:=ath10k-firmware +-PKG_SOURCE_VERSION:=77f72b5f7dd940386d9e619a17904987759b7186 ++PKG_SOURCE_VERSION:=b00eb8d30fbebb6a5047ccacefa8c37e072fca9c + PKG_VERSION:=2014-11-13-$(PKG_SOURCE_VERSION) + PKG_RELEASE:=1 + +@@ -17,7 +17,7 @@ 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 ++PKG_MAINTAINER:=Felix Fietkau + + include $(INCLUDE_DIR)/package.mk + +@@ -28,14 +28,18 @@ define Package/ath10k-firmware-default + 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 ++QCA988X_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-16.bin-lede ++QCA99X0_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-7.bin-lede.001 + + define Download/ath10k-firmware-qca988x + URL:=https://www.codeaurora.org/cgit/quic/qsdk/oss/firmware/ath10k-firmware/plain/10.2.4/ +@@ -44,11 +48,63 @@ define Download/ath10k-firmware-qca988x + endef + $(eval $(call Download,ath10k-firmware-qca988x)) + ++define Download/ath10k-firmware-qca988x-ct ++ URL:=https://www.candelatech.com/downloads/ ++ FILE:=$(QCA988X_FIRMWARE_FILE_CT) ++ MD5SUM:=5b651c0458bcf5c20701308b5e519976 ++endef ++$(eval $(call Download,ath10k-firmware-qca988x-ct)) ++ ++define Download/ath10k-firmware-qca99x0-ct ++ URL:=https://www.candelatech.com/downloads/ath10k-10-4/ ++ FILE:=$(QCA99X0_FIRMWARE_FILE_CT) ++ MD5SUM:=eb710949ff79142954aadae24616169c ++endef ++$(eval $(call Download,ath10k-firmware-qca99x0-ct)) ++ + define Package/ath10k-firmware-qca99x0 + $(Package/ath10k-firmware-default) + TITLE:=ath10k firmware for QCA99x0 devices + endef + ++define Package/ath10k-firmware-qca988x-ct ++$(Package/ath10k-firmware-default) ++ TITLE:=ath10k CT 10.1 firmware for QCA988x devices ++endef ++ ++define Package/ath10k-firmware-qca988x-ct/description ++Alternative ath10k firmware for QCA988X from Candela Technologies. ++Enables IBSS and other features. See: ++http://www.candelatech.com/ath10k-10.1.php ++This firmware will NOT be used unless the standard ath10k-firmware-qca988x ++is un-selected since the driver will try to load firmware-5.bin before ++firmware-2.bin ++endef ++ ++define Package/ath10k-firmware-qca99x0-ct/description ++Alternative ath10k firmware for QCA99x0 from Candela Technologies. ++Enables IBSS and other features. See: ++http://www.candelatech.com/ath10k-10.4.php ++This firmware conflicts with the standard 99x0 firmware, so select only ++one. ++endef ++ ++define Package/ath10k-firmware-qca99x0/description ++Standard ath10k firmware for QCA99x0 from QCA ++This firmware conflicts with the CT 99x0 firmware, so select only ++one. ++endef ++ ++define Package/ath10k-firmware-qca99x0-ct ++$(Package/ath10k-firmware-default) ++ TITLE:=ath10k CT 10.4.3 firmware for QCA99x0 devices ++endef ++ ++define Package/ath10k-firmware-qca9984 ++$(Package/ath10k-firmware-default) ++ TITLE:=ath10k firmware for QCA9984 devices ++endef ++ + define Package/ath10k-firmware-qca6174 + $(Package/ath10k-firmware-default) + TITLE:=ath10k firmware for QCA6174 devices +@@ -58,8 +114,8 @@ 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 ++ URL:=https://source.codeaurora.org/quic/qsdk/oss/firmware/ath10k-firmware/plain/ath10k/QCA99X0/hw2.0 ++ URL_FILE:=board-2.bin?id=$(QCA99X0_BOARD_REV) + FILE:=$(QCA99X0_BOARD_FILE) + MD5SUM:=a2b3c653c2363a5641200051d6333d0a + endef +@@ -79,6 +135,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_FIRMWARE_FILE_CT) \ ++ $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin ++endef ++ + define Package/ath10k-firmware-qca6174/install + $(INSTALL_DIR) $(1)/lib/firmware/ath10k + $(CP) $(PKG_BUILD_DIR)/QCA6174 $(1)/lib/firmware/ath10k/ +@@ -97,6 +163,33 @@ define Package/ath10k-firmware-qca99x0/install + $(1)/lib/firmware/ath10k/QCA99X0/hw2.0/firmware-5.bin + endef + ++define Package/ath10k-firmware-qca99x0-ct/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) \ ++ $(DL_DIR)/$(QCA99X0_FIRMWARE_FILE_CT) \ ++ $(1)/lib/firmware/ath10k/QCA99X0/hw2.0/firmware-5.bin ++endef ++ ++define Package/ath10k-firmware-qca9984/install ++ $(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9984/hw1.0 ++ $(INSTALL_DATA) \ ++ $(PKG_BUILD_DIR)/QCA9984/hw1.0/board-2.bin \ ++ $(1)/lib/firmware/ath10k/QCA9984/hw1.0/board-2.bin ++ $(INSTALL_DATA) \ ++ $(PKG_BUILD_DIR)/QCA9984/hw1.0/firmware-5.bin_10.4-3.2-00072 \ ++ $(1)/lib/firmware/ath10k/QCA9984/hw1.0/firmware-5.bin ++endef ++ + $(eval $(call BuildPackage,ath10k-firmware-qca988x)) + $(eval $(call BuildPackage,ath10k-firmware-qca99x0)) + $(eval $(call BuildPackage,ath10k-firmware-qca6174)) ++$(eval $(call BuildPackage,ath10k-firmware-qca9984)) ++ ++$(eval $(call BuildPackage,ath10k-firmware-qca988x-ct)) ++$(eval $(call BuildPackage,ath10k-firmware-qca99x0-ct)) +diff --git a/package/firmware/linux-firmware/Makefile b/package/firmware/linux-firmware/Makefile +index 2fcd93b..7a2e977 100644 +--- a/package/firmware/linux-firmware/Makefile ++++ b/package/firmware/linux-firmware/Makefile +@@ -16,10 +16,10 @@ PKG_SOURCE_PROTO:=git + PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz + 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_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git ++PKG_MIRROR_MD5SUM:=8d44332359de89b1936b4ff608a72614 + +-PKG_MAINTAINER:=Felix Fietkau ++PKG_MAINTAINER:=Felix Fietkau + + SCAN_DEPS = *.mk + +diff --git a/package/firmware/linux-firmware/realtek.mk b/package/firmware/linux-firmware/realtek.mk +index 0f8b1ce..4229ca0 100644 +--- a/package/firmware/linux-firmware/realtek.mk ++++ b/package/firmware/linux-firmware/realtek.mk +@@ -43,8 +43,15 @@ endef + $(eval $(call BuildPackage,rtl8192de-firmware)) + + Package/rtl8192se-firmware = $(call Package/firmware-default,RealTek RTL8192SE firmware) +-define KernelPackage/rtl8192se/install ++define Package/rtl8192se-firmware/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)) ++ ++Package/rtl8192su-firmware = $(call Package/firmware-default,RealTek RTL8192SU firmware) ++define Package/rtl8192su-firmware/install ++ $(INSTALL_DIR) $(1)/lib/firmware/rtlwifi ++ $(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8712u.bin $(1)/lib/firmware/rtlwifi ++endef ++$(eval $(call BuildPackage,rtl8192su-firmware)) +diff --git a/package/kernel/acx-mac80211/Makefile b/package/kernel/acx-mac80211/Makefile +index 1820e7a..8fce374 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:=http://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-api_sync.patch b/package/kernel/acx-mac80211/patches/300-api_sync.patch +new file mode 100644 +index 0000000..94d6135 +--- /dev/null ++++ b/package/kernel/acx-mac80211/patches/300-api_sync.patch +@@ -0,0 +1,83 @@ ++--- a/main.c +++++ b/main.c ++@@ -497,7 +497,7 @@ int acx_free_mechanics(acx_device_t *ade ++ ++ 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,14 +525,14 @@ int acx_init_ieee80211(acx_device_t *ade ++ /* 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)) { ++- adev->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = +++ adev->hw->wiphy->bands[NL80211_BAND_2GHZ] = ++ &acx100_band_2GHz; ++ } else if (IS_ACX111(adev)) ++- adev->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = +++ adev->hw->wiphy->bands[NL80211_BAND_2GHZ] = ++ &acx111_band_2GHz; ++ else { ++ log(L_ANY, "Error: Unknown device"); ++@@ -945,8 +945,8 @@ void acx_op_configure_filter(struct ieee ++ 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, ++ } ++ ++ 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 * ++ 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; ++--- a/main.h +++++ b/main.h ++@@ -62,7 +62,7 @@ void acx_op_tx(struct ieee80211_hw *hw, ++ #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); ++ ++--- a/cardsetting.c +++++ b/cardsetting.c ++@@ -159,7 +159,7 @@ int acx_set_channel(acx_device_t *adev, ++ int res = 0; ++ ++ adev->rx_status.freq = freq; ++- adev->rx_status.band = IEEE80211_BAND_2GHZ; +++ adev->rx_status.band = NL80211_BAND_2GHZ; ++ ++ adev->channel = channel; ++ +diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile +index 30da1cf..bee0723 100644 +--- a/package/kernel/mac80211/Makefile ++++ b/package/kernel/mac80211/Makefile +@@ -10,20 +10,21 @@ include $(INCLUDE_DIR)/kernel.mk + + PKG_NAME:=mac80211 + +-PKG_VERSION:=2016-01-10 ++PKG_VERSION:=2016-05-12 + PKG_RELEASE:=1 + PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources + PKG_BACKPORT_VERSION:= +-PKG_MD5SUM:=be5fae2e8d6f7490f9b073374fb895ba ++PKG_MD5SUM:=2142cf38509896dca108624e7c193611 + + PKG_SOURCE:=compat-wireless-$(PKG_VERSION)$(PKG_BACKPORT_VERSION).tar.bz2 + PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/compat-wireless-$(PKG_VERSION) + PKG_BUILD_PARALLEL:=1 + +-PKG_MAINTAINER:=Felix Fietkau ++PKG_MAINTAINER:=Felix Fietkau + + PKG_DRIVERS = \ + adm8211 \ ++ airo \ + ath ath5k ath9k ath9k-common ath9k-htc ath10k \ + b43 b43legacy \ + carl9170 \ +@@ -52,6 +53,7 @@ PKG_CONFIG_DEPENDS:= \ + $(patsubst %,CONFIG_PACKAGE_kmod-%,$(PKG_DRIVERS)) \ + CONFIG_PACKAGE_MAC80211_DEBUGFS \ + CONFIG_PACKAGE_MAC80211_MESH \ ++ CONFIG_PACKAGE_MAC80211_TRACING \ + CONFIG_PACKAGE_ATH_DEBUG \ + CONFIG_PACKAGE_ATH_DFS \ + CONFIG_PACKAGE_B43_DEBUG \ +@@ -63,7 +65,12 @@ PKG_CONFIG_DEPENDS:= \ + CONFIG_PACKAGE_B43_BUSES_BCMA_AND_SSB \ + CONFIG_PACKAGE_B43_BUSES_BCMA \ + CONFIG_PACKAGE_B43_BUSES_SSB \ ++ CONFIG_PACKAGE_BRCM80211_DEBUG \ ++ CONFIG_PACKAGE_IWLWIFI_DEBUG \ ++ CONFIG_PACKAGE_IWLWIFI_DEBUGFS \ + CONFIG_PACKAGE_RTLWIFI_DEBUG \ ++ CONFIG_ATH9K_SUPPORT_PCOEM \ ++ CONFIG_ATH9K_TX99 \ + CONFIG_ATH_USER_REGD \ + + include $(INCLUDE_DIR)/package.mk +@@ -73,7 +80,7 @@ WMENU:=Wireless Drivers + define KernelPackage/mac80211/Default + SUBMENU:=$(WMENU) + URL:=https://wireless.wiki.kernel.org/ +- MAINTAINER:=Felix Fietkau ++ MAINTAINER:=Felix Fietkau + endef + + define KernelPackage/cfg80211 +@@ -92,7 +99,7 @@ endef + define KernelPackage/mac80211 + $(call KernelPackage/mac80211/Default) + TITLE:=Linux 802.11 Wireless Networking Stack +- DEPENDS+= +kmod-cfg80211 +hostapd-common +kmod-crypto-core +kmod-crypto-arc4 ++ DEPENDS+= +kmod-cfg80211 +hostapd-common + KCONFIG:=\ + CONFIG_AVERAGE=y + FILES:= $(PKG_BUILD_DIR)/net/mac80211/mac80211.ko +@@ -138,10 +145,23 @@ define KernelPackage/adm8211 + AUTOLOAD:=$(call AutoProbe,adm8211) + endef + ++define KernelPackage/airo ++ $(call KernelPackage/mac80211/Default) ++ TITLE:=Cisco Aironet driver ++ DEPENDS+=@PCI_SUPPORT +@DRIVER_WEXT_SUPPORT +kmod-cfg80211 @TARGET_x86 ++ FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/cisco/airo.ko ++ AUTOLOAD:=$(call AutoProbe,airo) ++endef ++ ++define KernelPackage/airo/description ++ Kernel support for Cisco Aironet cards ++endef ++ + define KernelPackage/ath/config + if PACKAGE_kmod-ath + config ATH_USER_REGD + bool "Force Atheros drivers to respect the user's regdomain settings" ++ 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 +@@ -226,6 +246,10 @@ define KernelPackage/ath9k/config + bool "Support chips used in PC OEM cards" + depends on PACKAGE_kmod-ath9k + ++ config ATH9K_TX99 ++ bool "Enable TX99 support" ++ depends on PACKAGE_kmod-ath9k ++ + endef + + define KernelPackage/ath9k-htc +@@ -247,7 +271,7 @@ 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 +@KERNEL_RELAY +ath10k-firmware-qca988x ++ 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 +@@ -673,6 +697,7 @@ define KernelPackage/brcmfmac/config + + config BRCMFMAC_SDIO + bool "Enable SDIO bus interface support" ++ default y if TARGET_brcm2708 + default n + help + Enable support for cards attached to an SDIO bus. +@@ -761,7 +786,7 @@ endef + + define KernelPackage/iwlwifi + $(call KernelPackage/mac80211/Default) +- DEPENDS:= +kmod-mac80211 @PCI_SUPPORT +@DRIVER_11N_SUPPORT +iwlwifi-firmware ++ DEPENDS:= +kmod-mac80211 @PCI_SUPPORT +@DRIVER_11N_SUPPORT +iwlwifi-firmware @!LINUX_3_18 + TITLE:=Intel AGN Wireless support + FILES:= \ + $(PKG_BUILD_DIR)/drivers/net/wireless/intel/iwlwifi/iwlwifi.ko \ +@@ -870,7 +895,7 @@ endef + define KernelPackage/lib80211 + $(call KernelPackage/mac80211/Default) + TITLE:=802.11 Networking stack +- DEPENDS:=+kmod-cfg80211 ++ DEPENDS:=+kmod-cfg80211 +kmod-crypto-hash + FILES:= \ + $(PKG_BUILD_DIR)/net/wireless/lib80211.ko \ + $(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_wep.ko \ +@@ -897,7 +922,7 @@ endef + define KernelPackage/libipw + $(call KernelPackage/mac80211/Default) + TITLE:=libipw for ipw2100 and ipw2200 +- DEPENDS:=@PCI_SUPPORT +kmod-crypto-michael-mic +kmod-crypto-core +kmod-crypto-arc4 +kmod-lib80211 +kmod-cfg80211 +@DRIVER_WEXT_SUPPORT @!BIG_ENDIAN ++ 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 +@@ -978,7 +1003,7 @@ endef + define KernelPackage/libertas-spi + $(call KernelPackage/mac80211/Default) + SUBMENU:=Wireless Drivers +- DEPENDS+= +kmod-cfg80211 +kmod-lib80211 +@DRIVER_WEXT_SUPPORT +libertas-spi-firmware ++ DEPENDS+= +kmod-cfg80211 +kmod-lib80211 +@DRIVER_WEXT_SUPPORT @!TARGET_uml +libertas-spi-firmware + KCONFIG := \ + CONFIG_SPI=y \ + CONFIG_SPI_MASTER=y +@@ -1453,6 +1478,7 @@ config-y:= \ + WLAN_VENDOR_ATH \ + WLAN_VENDOR_ATMEL \ + WLAN_VENDOR_BROADCOM \ ++ WLAN_VENDOR_CISCO \ + WLAN_VENDOR_INTEL \ + WLAN_VENDOR_INTERSIL \ + WLAN_VENDOR_MARVELL \ +@@ -1491,6 +1517,8 @@ endif + + config-$(call config_package,lib80211) += LIB80211 LIB80211_CRYPT_WEP LIB80211_CRYPT_CCMP LIB80211_CRYPT_TKIP + ++config-$(call config_package,airo) += AIRO ++ + config-$(call config_package,ath) += ATH_CARDS ATH_COMMON + config-$(CONFIG_PACKAGE_ATH_DEBUG) += ATH_DEBUG ATH10K_DEBUG + config-$(CONFIG_PACKAGE_ATH_DFS) += ATH9K_DFS_CERTIFIED ATH10K_DFS_CERTIFIED +@@ -1501,6 +1529,7 @@ config-$(CONFIG_TARGET_ar71xx) += ATH9K_AHB + config-$(CONFIG_PCI) += ATH9K_PCI + config-$(CONFIG_ATH_USER_REGD) += ATH_USER_REGD + config-$(CONFIG_ATH9K_SUPPORT_PCOEM) += ATH9K_PCOEM ++config-$(CONFIG_ATH9K_TX99) += ATH9K_TX99 + + config-$(call config_package,ath9k-htc) += ATH9K_HTC + config-$(call config_package,ath10k) += ATH10K ATH10K_PCI +@@ -1764,6 +1793,7 @@ endef + + + $(eval $(call KernelPackage,adm8211)) ++$(eval $(call KernelPackage,airo)) + $(eval $(call KernelPackage,ath)) + $(eval $(call KernelPackage,ath10k)) + $(eval $(call KernelPackage,ath5k)) +diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +index fb2f928..e3d612e 100644 +--- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh ++++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +@@ -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 +@@ -218,7 +220,6 @@ mac80211_hostapd_setup_base() { + vht_max_a_mpdu_len_exp:7 \ + vht_max_mpdu:11454 \ + rx_stbc:4 \ +- tx_stbc:4 \ + vht_link_adapt:3 \ + vht160:2 + +@@ -230,13 +231,13 @@ mac80211_hostapd_setup_base() { + + cap_rx_stbc=$((($vht_cap >> 8) & 7)) + [ "$rx_stbc" -lt "$cap_rx_stbc" ] && cap_rx_stbc="$rx_stbc" +- ht_cap_mask="$(( ($vht_cap & ~(0x700)) | ($cap_rx_stbc << 8) ))" ++ vht_cap="$(( ($vht_cap & ~(0x700)) | ($cap_rx_stbc << 8) ))" + + mac80211_add_capabilities vht_capab $vht_cap \ + RXLDPC:0x10::$rxldpc \ + SHORT-GI-80:0x20::$short_gi_80 \ + SHORT-GI-160:0x40::$short_gi_160 \ +- TX-STBC-2BY1:0x80::$tx_stbc \ ++ TX-STBC-2BY1:0x80::$tx_stbc_2by1 \ + SU-BEAMFORMER:0x800::$su_beamformer \ + SU-BEAMFORMEE:0x1000::$su_beamformee \ + MU-BEAMFORMER:0x80000::$mu_beamformer \ +@@ -245,10 +246,10 @@ mac80211_hostapd_setup_base() { + HTC-VHT:0x400000::$htc_vht \ + RX-ANTENNA-PATTERN:0x10000000::$rx_antenna_pattern \ + TX-ANTENNA-PATTERN:0x20000000::$tx_antenna_pattern \ +- RX-STBC1:0x700:0x100:1 \ +- RX-STBC12:0x700:0x200:1 \ +- RX-STBC123:0x700:0x300:1 \ +- RX-STBC1234:0x700:0x400:1 \ ++ RX-STBC-1:0x700:0x100:1 \ ++ RX-STBC-12:0x700:0x200:1 \ ++ RX-STBC-123:0x700:0x300:1 \ ++ RX-STBC-1234:0x700:0x400:1 \ + + # supported Channel widths + vht160_hw=0 +@@ -301,6 +302,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" ] && { +@@ -481,7 +482,7 @@ mac80211_prepare_vif() { + # All interfaces must have unique mac addresses + # which can either be explicitly set in the device + # section, or automatically generated +- ifconfig "$ifname" hw ether "$macaddr" ++ ip link set dev "$ifname" address "$macaddr" + fi + + json_select .. +@@ -496,7 +497,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 +@@ -520,6 +521,9 @@ mac80211_setup_adhoc_htmode() { + esac + [ "$auto_channel" -gt 0 ] && ibss_htmode="HT40+" + ;; ++ VHT80) ++ ibss_htmode="80MHZ" ++ ;; + NONE|NOHT) + ibss_htmode="NOHT" + ;; +@@ -580,7 +584,7 @@ mac80211_setup_vif() { + json_get_vars mode + json_get_var vif_txpower txpower + +- ifconfig "$ifname" up || { ++ ip link set dev "$ifname" up || { + wireless_setup_vif_failed IFUP_ERROR + json_select .. + return +@@ -643,7 +647,7 @@ mac80211_interface_cleanup() { + local phy="$1" + + for wdev in $(list_phy_interfaces "$phy"); do +- ifconfig "$wdev" down 2>/dev/null ++ ip link set dev "$wdev" down 2>/dev/null + iw dev "$wdev" del + done + } +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 + } + +@@ -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/004-backports-add-skb_free_frag.patch b/package/kernel/mac80211/patches/004-backports-add-skb_free_frag.patch +deleted file mode 100644 +index 9adfd8f..0000000 +--- a/package/kernel/mac80211/patches/004-backports-add-skb_free_frag.patch ++++ /dev/null +@@ -1,21 +0,0 @@ +-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-header-backport-GENL_UNS_ADMIN_PERM.patch b/package/kernel/mac80211/patches/004-header-backport-GENL_UNS_ADMIN_PERM.patch +new file mode 100644 +index 0000000..38d655f +--- /dev/null ++++ b/package/kernel/mac80211/patches/004-header-backport-GENL_UNS_ADMIN_PERM.patch +@@ -0,0 +1,21 @@ ++From: Felix Fietkau ++Date: Sat, 14 May 2016 16:39:35 +0200 ++Subject: [PATCH] header: backport GENL_UNS_ADMIN_PERM ++ ++Signed-off-by: Felix Fietkau ++--- ++ create mode 100644 backport-include/uapi/linux/genetlink.h ++ ++--- /dev/null +++++ b/backport-include/uapi/linux/genetlink.h ++@@ -0,0 +1,10 @@ +++#ifndef __COMPAT_UAPI_LINUX_GENETLINK_H +++#define __COMPAT_UAPI_LINUX_GENETLINK_H +++ +++#include_next +++ +++#ifndef GENL_UNS_ADMIN_PERM +++#define GENL_UNS_ADMIN_PERM GENL_ADMIN_PERM +++#endif +++ +++#endif +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 +deleted file mode 100644 +index 9b672a8..0000000 +--- a/package/kernel/mac80211/patches/005-backports-add-napi_alloc_frag.patch ++++ /dev/null +@@ -1,20 +0,0 @@ +-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/005-header-backport-nla_put_u64_64bit-and-nla_put_64bit.patch b/package/kernel/mac80211/patches/005-header-backport-nla_put_u64_64bit-and-nla_put_64bit.patch +new file mode 100644 +index 0000000..e20d87a +--- /dev/null ++++ b/package/kernel/mac80211/patches/005-header-backport-nla_put_u64_64bit-and-nla_put_64bit.patch +@@ -0,0 +1,158 @@ ++From: Felix Fietkau ++Date: Sat, 14 May 2016 16:40:16 +0200 ++Subject: [PATCH] header: backport nla_put_u64_64bit and nla_put_64bit ++ ++Signed-off-by: Felix Fietkau ++--- ++ ++--- a/backport-include/net/netlink.h +++++ b/backport-include/net/netlink.h ++@@ -189,4 +189,148 @@ static inline __le64 nla_get_le64(const ++ } ++ #endif /* < 4.4 */ ++ +++ +++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,7,0) +++ +++/** +++ * nla_need_padding_for_64bit - test 64-bit alignment of the next attribute +++ * @skb: socket buffer the message is stored in +++ * +++ * Return true if padding is needed to align the next attribute (nla_data()) to +++ * a 64-bit aligned area. +++ */ +++static inline bool nla_need_padding_for_64bit(struct sk_buff *skb) +++{ +++#ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS +++ /* The nlattr header is 4 bytes in size, that's why we test +++ * if the skb->data _is_ aligned. A NOP attribute, plus +++ * nlattr header for next attribute, will make nla_data() +++ * 8-byte aligned. +++ */ +++ if (IS_ALIGNED((unsigned long)skb_tail_pointer(skb), 8)) +++ return true; +++#endif +++ return false; +++} +++ +++/** +++ * nla_align_64bit - 64-bit align the nla_data() of next attribute +++ * @skb: socket buffer the message is stored in +++ * @padattr: attribute type for the padding +++ * +++ * Conditionally emit a padding netlink attribute in order to make +++ * the next attribute we emit have a 64-bit aligned nla_data() area. +++ * This will only be done in architectures which do not have +++ * CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS defined. +++ * +++ * Returns zero on success or a negative error code. +++ */ +++static inline int nla_align_64bit(struct sk_buff *skb, int padattr) +++{ +++ if (nla_need_padding_for_64bit(skb) && +++ !nla_reserve(skb, padattr, 0)) +++ return -EMSGSIZE; +++ +++ return 0; +++} +++ +++/** +++ * __nla_reserve_64bit - reserve room for attribute on the skb and align it +++ * @skb: socket buffer to reserve room on +++ * @attrtype: attribute type +++ * @attrlen: length of attribute payload +++ * @padattr: attribute type for the padding +++ * +++ * Adds a netlink attribute header to a socket buffer and reserves +++ * room for the payload but does not copy it. It also ensure that this +++ * attribute will have a 64-bit aligned nla_data() area. +++ * +++ * The caller is responsible to ensure that the skb provides enough +++ * tailroom for the attribute header and payload. +++ */ +++static inline struct nlattr *__nla_reserve_64bit(struct sk_buff *skb, int attrtype, +++ int attrlen, int padattr) +++{ +++ if (nla_need_padding_for_64bit(skb)) +++ nla_align_64bit(skb, padattr); +++ +++ return __nla_reserve(skb, attrtype, attrlen); +++} +++ +++/** +++ * __nla_put_64bit - Add a netlink attribute to a socket buffer and align it +++ * @skb: socket buffer to add attribute to +++ * @attrtype: attribute type +++ * @attrlen: length of attribute payload +++ * @data: head of attribute payload +++ * @padattr: attribute type for the padding +++ * +++ * The caller is responsible to ensure that the skb provides enough +++ * tailroom for the attribute header and payload. +++ */ +++static inline void __nla_put_64bit(struct sk_buff *skb, int attrtype, int attrlen, +++ const void *data, int padattr) +++{ +++ struct nlattr *nla; +++ +++ nla = __nla_reserve_64bit(skb, attrtype, attrlen, padattr); +++ memcpy(nla_data(nla), data, attrlen); +++} +++ +++/** +++ * nla_total_size_64bit - total length of attribute including padding +++ * @payload: length of payload +++ */ +++static inline int nla_total_size_64bit(int payload) +++{ +++ return NLA_ALIGN(nla_attr_size(payload)) +++#ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS +++ + NLA_ALIGN(nla_attr_size(0)) +++#endif +++ ; +++} +++ +++/** +++ * nla_put_64bit - Add a netlink attribute to a socket buffer and align it +++ * @skb: socket buffer to add attribute to +++ * @attrtype: attribute type +++ * @attrlen: length of attribute payload +++ * @data: head of attribute payload +++ * @padattr: attribute type for the padding +++ * +++ * Returns -EMSGSIZE if the tailroom of the skb is insufficient to store +++ * the attribute header and payload. +++ */ +++static inline int nla_put_64bit(struct sk_buff *skb, int attrtype, int attrlen, +++ const void *data, int padattr) +++{ +++ size_t len; +++ +++ if (nla_need_padding_for_64bit(skb)) +++ len = nla_total_size_64bit(attrlen); +++ else +++ len = nla_total_size(attrlen); +++ if (unlikely(skb_tailroom(skb) < len)) +++ return -EMSGSIZE; +++ +++ __nla_put_64bit(skb, attrtype, attrlen, data, padattr); +++ return 0; +++} +++ +++/** +++ * nla_put_u64_64bit - Add a u64 netlink attribute to a skb and align it +++ * @skb: socket buffer to add attribute to +++ * @attrtype: attribute type +++ * @value: numeric value +++ * @padattr: attribute type for the padding +++ */ +++static inline int nla_put_u64_64bit(struct sk_buff *skb, int attrtype, +++ u64 value, int padattr) +++{ +++ return nla_put_64bit(skb, attrtype, sizeof(u64), &value, padattr); +++} +++ +++ +++#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4,7,0) */ +++ ++ #endif /* __BACKPORT_NET_NETLINK_H */ +diff --git a/package/kernel/mac80211/patches/006-compat-bump-rhashtable-backport-version-due-to-API-c.patch b/package/kernel/mac80211/patches/006-compat-bump-rhashtable-backport-version-due-to-API-c.patch +new file mode 100644 +index 0000000..1fdad3c +--- /dev/null ++++ b/package/kernel/mac80211/patches/006-compat-bump-rhashtable-backport-version-due-to-API-c.patch +@@ -0,0 +1,18 @@ ++From: Felix Fietkau ++Date: Sat, 14 May 2016 16:44:57 +0200 ++Subject: [PATCH] compat: bump rhashtable backport version due to API changes ++ ++Signed-off-by: Felix Fietkau ++--- ++ ++--- a/compat/Kconfig +++++ b/compat/Kconfig ++@@ -139,7 +139,7 @@ config BPAUTO_BUILD_WANT_DEV_COREDUMP ++ config BPAUTO_RHASHTABLE ++ bool ++ # current API of rhashtable was introduced in version 4.1 ++- depends on KERNEL_4_1 +++ depends on KERNEL_4_7 ++ # not very nice - but better than always having it ++ default y if MAC80211 ++ #h-file linux/rhashtable.h +diff --git a/package/kernel/mac80211/patches/007-fix_duplicate_skcipher_backport.patch b/package/kernel/mac80211/patches/007-fix_duplicate_skcipher_backport.patch +new file mode 100644 +index 0000000..38b3179 +--- /dev/null ++++ b/package/kernel/mac80211/patches/007-fix_duplicate_skcipher_backport.patch +@@ -0,0 +1,11 @@ ++--- a/compat/Makefile +++++ b/compat/Makefile ++@@ -35,8 +35,6 @@ compat-$(CPTCFG_KERNEL_4_6) += backport- ++ ++ compat-$(CPTCFG_BPAUTO_BUILD_CRYPTO_CCM) += crypto-ccm.o ++ compat-$(CPTCFG_BPAUTO_CRYPTO_SKCIPHER) += crypto-skcipher.o ++-skcipher-objs += crypto-skcipher.o ++-obj-$(CPTCFG_BPAUTO_CRYPTO_SKCIPHER) += skcipher.o ++ compat-$(CPTCFG_BPAUTO_BUILD_WANT_DEV_COREDUMP) += drivers-base-devcoredump.o ++ compat-$(CPTCFG_BPAUTO_RHASHTABLE) += lib-rhashtable.o ++ cordic-objs += lib-cordic.o +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 fd1e1cf..e9a140c 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 @@ + --- a/.local-symbols + +++ b/.local-symbols +-@@ -476,44 +476,6 @@ USB_IPHETH= ++@@ -481,45 +481,6 @@ USB_IPHETH= + USB_SIERRA_NET= + USB_VL600= + USB_NET_CH9200= +@@ -37,6 +37,7 @@ + -BCMA_DRIVER_PCI= + -BCMA_DRIVER_PCI_HOSTMODE= + -BCMA_DRIVER_MIPS= ++-BCMA_PFLASH= + -BCMA_SFLASH= + -BCMA_NFLASH= + -BCMA_DRIVER_GMAC_CMN= +@@ -56,7 +57,7 @@ + return (bus->chipco.dev ? bus->chipco.dev : bus->pcicore.dev); + #else + return bus->chipco.dev; +-@@ -4903,7 +4903,7 @@ static int b43_wireless_core_init(struct ++@@ -4901,7 +4901,7 @@ static int b43_wireless_core_init(struct + } + if (sprom->boardflags_lo & B43_BFL_XTAL_NOSLOW) + hf |= B43_HF_DSCRQ; /* Disable slowclock requests from ucode. */ +diff --git a/package/kernel/mac80211/patches/080-disable_clk_backport.patch b/package/kernel/mac80211/patches/080-disable_clk_backport.patch +deleted file mode 100644 +index 3765591..0000000 +--- a/package/kernel/mac80211/patches/080-disable_clk_backport.patch ++++ /dev/null +@@ -1,20 +0,0 @@ +---- a/compat/compat-3.6.c +-+++ b/compat/compat-3.6.c +-@@ -147,17 +147,3 @@ int sg_alloc_table_from_pages(struct sg_ +- return 0; +- } +- EXPORT_SYMBOL_GPL(sg_alloc_table_from_pages); +-- +--/* whoopsie ! */ +--#ifndef CONFIG_COMMON_CLK +--int clk_enable(struct clk *clk) +--{ +-- return 0; +--} +--EXPORT_SYMBOL_GPL(clk_enable); +-- +--void clk_disable(struct clk *clk) +--{ +--} +--EXPORT_SYMBOL_GPL(clk_disable); +--#endif +diff --git a/package/kernel/mac80211/patches/100-remove-cryptoapi-dependencies.patch b/package/kernel/mac80211/patches/100-remove-cryptoapi-dependencies.patch +index 02f46c7..b65b0bd 100644 +--- a/package/kernel/mac80211/patches/100-remove-cryptoapi-dependencies.patch ++++ b/package/kernel/mac80211/patches/100-remove-cryptoapi-dependencies.patch +@@ -34,12 +34,9 @@ + #include "aes_ccm.h" + + -void ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, +-- u8 *data, size_t data_len, u8 *mic, +-- size_t mic_len) + +static void aes_ccm_prepare(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, u8 *s_0, + + u8 *a, u8 *b) +- { +-- struct scatterlist sg[3]; +++{ + + int i; + + + + crypto_cipher_encrypt_one(tfm, b, b_0); +@@ -54,55 +51,56 @@ + + for (i = 0; i < AES_BLOCK_SIZE; i++) + + aad[i] ^= b[i]; + + crypto_cipher_encrypt_one(tfm, a, aad); +- +-- char aead_req_data[sizeof(struct aead_request) + +-- crypto_aead_reqsize(tfm)] +-- __aligned(__alignof__(struct aead_request)); +-- struct aead_request *aead_req = (void *) aead_req_data; +++ + + /* Mask out bits from auth-only-b_0 */ + + b_0[0] &= 0x07; +- +-- memset(aead_req, 0, sizeof(aead_req_data)); +++ + + /* S_0 is used to encrypt T (= MIC) */ + + b_0[14] = 0; + + b_0[15] = 0; + + crypto_cipher_encrypt_one(tfm, s_0, b_0); + +} +- +-- sg_init_table(sg, 3); +-- sg_set_buf(&sg[0], &aad[2], be16_to_cpup((__be16 *)aad)); +-- sg_set_buf(&sg[1], data, data_len); +-- sg_set_buf(&sg[2], mic, mic_len); +- +-- aead_request_set_tfm(aead_req, tfm); +-- aead_request_set_crypt(aead_req, sg, sg, data_len, b_0); +-- aead_request_set_ad(aead_req, sg[0].length); +++ +++ + +void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, +-+ u8 *data, size_t data_len, u8 *mic, +-+ size_t mic_len) +-+{ ++ u8 *data, size_t data_len, u8 *mic, ++ size_t mic_len) ++ { ++- struct scatterlist sg[3]; + + int i, j, last_len, num_blocks; + + u8 b[AES_BLOCK_SIZE]; + + u8 s_0[AES_BLOCK_SIZE]; + + u8 e[AES_BLOCK_SIZE]; + + u8 *pos, *cpos; +-+ ++ ++- char aead_req_data[sizeof(struct aead_request) + ++- crypto_aead_reqsize(tfm)] ++- __aligned(__alignof__(struct aead_request)); ++- struct aead_request *aead_req = (void *) aead_req_data; + + num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_SIZE); + + last_len = data_len % AES_BLOCK_SIZE; + + aes_ccm_prepare(tfm, b_0, aad, s_0, b, b); +-+ ++ ++- memset(aead_req, 0, sizeof(aead_req_data)); + + /* Process payload blocks */ + + pos = data; + + cpos = data; + + for (j = 1; j <= num_blocks; j++) { + + int blen = (j == num_blocks && last_len) ? + + last_len : AES_BLOCK_SIZE; +-+ ++ ++- sg_init_table(sg, 3); ++- sg_set_buf(&sg[0], &aad[2], be16_to_cpup((__be16 *)aad)); ++- sg_set_buf(&sg[1], data, data_len); ++- sg_set_buf(&sg[2], mic, mic_len); + + /* Authentication followed by encryption */ + + for (i = 0; i < blen; i++) + + b[i] ^= pos[i]; + + crypto_cipher_encrypt_one(tfm, b, b); +-+ ++ ++- aead_request_set_tfm(aead_req, tfm); ++- aead_request_set_crypt(aead_req, sg, sg, data_len, b_0); ++- aead_request_set_ad(aead_req, sg[0].length); + + b_0[14] = (j >> 8) & 0xff; + + b_0[15] = j & 0xff; + + crypto_cipher_encrypt_one(tfm, e, b_0); +@@ -125,37 +123,30 @@ + - crypto_aead_reqsize(tfm)] + - __aligned(__alignof__(struct aead_request)); + - struct aead_request *aead_req = (void *) aead_req_data; +-- +-- if (data_len == 0) +-- return -EINVAL; +-- +-- memset(aead_req, 0, sizeof(aead_req_data)); +-- +-- sg_init_table(sg, 3); +-- sg_set_buf(&sg[0], &aad[2], be16_to_cpup((__be16 *)aad)); +-- sg_set_buf(&sg[1], data, data_len); +-- sg_set_buf(&sg[2], mic, mic_len); +-- +-- aead_request_set_tfm(aead_req, tfm); +-- aead_request_set_crypt(aead_req, sg, sg, data_len + mic_len, b_0); +-- aead_request_set_ad(aead_req, sg[0].length); + + int i, j, last_len, num_blocks; + + u8 *pos, *cpos; + + u8 a[AES_BLOCK_SIZE]; + + u8 b[AES_BLOCK_SIZE]; + + u8 s_0[AES_BLOCK_SIZE]; +-+ ++ ++- if (data_len == 0) ++- return -EINVAL; + + num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_SIZE); + + last_len = data_len % AES_BLOCK_SIZE; + + aes_ccm_prepare(tfm, b_0, aad, s_0, a, b); +-+ ++ ++- memset(aead_req, 0, sizeof(aead_req_data)); + + /* Process payload blocks */ + + cpos = data; + + pos = data; + + for (j = 1; j <= num_blocks; j++) { + + int blen = (j == num_blocks && last_len) ? + + last_len : AES_BLOCK_SIZE; +-+ ++ ++- sg_init_table(sg, 3); ++- sg_set_buf(&sg[0], &aad[2], be16_to_cpup((__be16 *)aad)); ++- sg_set_buf(&sg[1], data, data_len); ++- sg_set_buf(&sg[2], mic, mic_len); + + /* Decryption followed by authentication */ + + b_0[14] = (j >> 8) & 0xff; + + b_0[15] = j & 0xff; +@@ -166,7 +157,10 @@ + + } + + crypto_cipher_encrypt_one(tfm, a, a); + + } +-+ ++ ++- aead_request_set_tfm(aead_req, tfm); ++- aead_request_set_crypt(aead_req, sg, sg, data_len + mic_len, b_0); ++- aead_request_set_ad(aead_req, sg[0].length); + + for (i = 0; i < mic_len; i++) { + + if ((mic[i] ^ s_0[i]) != a[i]) + + return -1; +@@ -185,12 +179,12 @@ + { + - struct crypto_aead *tfm; + - int err; +-+ struct crypto_cipher *tfm; +- ++- + - tfm = crypto_alloc_aead("ccm(aes)", 0, CRYPTO_ALG_ASYNC); + - if (IS_ERR(tfm)) + - return tfm; +-- +++ struct crypto_cipher *tfm; ++ + - err = crypto_aead_setkey(tfm, key, key_len); + - if (err) + - goto free_aead; +@@ -309,7 +303,7 @@ + #endif /* AES_GMAC_H */ + --- a/net/mac80211/key.h + +++ b/net/mac80211/key.h +-@@ -84,7 +84,7 @@ struct ieee80211_key { ++@@ -88,7 +88,7 @@ struct ieee80211_key { + * Management frames. + */ + u8 rx_pn[IEEE80211_NUM_TIDS + 1][IEEE80211_CCMP_PN_LEN]; +@@ -320,7 +314,7 @@ + struct { + --- a/net/mac80211/wpa.c + +++ b/net/mac80211/wpa.c +-@@ -307,7 +307,8 @@ ieee80211_crypto_tkip_decrypt(struct iee ++@@ -304,7 +304,8 @@ ieee80211_crypto_tkip_decrypt(struct iee + } + + +@@ -330,7 +324,7 @@ + { + __le16 mask_fc; + int a4_included, mgmt; +-@@ -337,14 +338,8 @@ static void ccmp_special_blocks(struct s ++@@ -334,14 +335,8 @@ static void ccmp_special_blocks(struct s + else + qos_tid = 0; + +@@ -347,7 +341,7 @@ + + /* Nonce: Nonce Flags | A2 | PN + * Nonce Flags: Priority (b0..b3) | Management (b4) | Reserved (b5..b7) +-@@ -352,6 +347,8 @@ static void ccmp_special_blocks(struct s ++@@ -349,6 +344,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); +@@ -356,7 +350,7 @@ + + /* AAD (extra authenticate-only data) / masked 802.11 header + * FC | A1 | A2 | A3 | SC | [A4] | [QC] */ +-@@ -463,7 +460,7 @@ static int ccmp_encrypt_skb(struct ieee8 ++@@ -460,7 +457,7 @@ static int ccmp_encrypt_skb(struct ieee8 + return 0; + + pos += IEEE80211_CCMP_HDR_LEN; +@@ -365,7 +359,7 @@ + ieee80211_aes_ccm_encrypt(key->u.ccmp.tfm, b_0, aad, pos, len, + skb_put(skb, mic_len), mic_len); + +-@@ -534,7 +531,7 @@ ieee80211_crypto_ccmp_decrypt(struct iee ++@@ -537,7 +534,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 */ +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 d1d9fbd..3ca166f 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 + + --- a/net/mac80211/cfg.c + +++ b/net/mac80211/cfg.c +-@@ -846,7 +846,6 @@ static int ieee80211_stop_ap(struct wiph ++@@ -850,7 +850,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 2855a88..3029598 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 @@ + static int ieee80211_ifa6_changed(struct notifier_block *nb, + unsigned long data, void *arg) + { +-@@ -1087,14 +1087,14 @@ int ieee80211_register_hw(struct ieee802 ++@@ -1089,14 +1089,14 @@ int ieee80211_register_hw(struct ieee802 + + rtnl_unlock(); + +@@ -35,7 +35,7 @@ + local->ifa6_notifier.notifier_call = ieee80211_ifa6_changed; + result = register_inet6addr_notifier(&local->ifa6_notifier); + if (result) +-@@ -1103,13 +1103,13 @@ int ieee80211_register_hw(struct ieee802 ++@@ -1105,13 +1105,13 @@ int ieee80211_register_hw(struct ieee802 + + return 0; + +@@ -52,7 +52,7 @@ + fail_ifa: + #endif + rtnl_lock(); +-@@ -1137,10 +1137,10 @@ void ieee80211_unregister_hw(struct ieee ++@@ -1139,10 +1139,10 @@ void ieee80211_unregister_hw(struct ieee + tasklet_kill(&local->tx_pending_tasklet); + tasklet_kill(&local->tasklet); + +diff --git a/package/kernel/mac80211/patches/210-ap_scan.patch b/package/kernel/mac80211/patches/210-ap_scan.patch +index a99cbd2..29f05c4 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 +-@@ -1999,7 +1999,7 @@ static int ieee80211_scan(struct wiphy * ++@@ -2008,7 +2008,7 @@ static int ieee80211_scan(struct wiphy * + * the frames sent while scanning on other channel will be + * lost) + */ +diff --git a/package/kernel/mac80211/patches/300-ath9k-force-rx_clear-when-disabling-rx.patch b/package/kernel/mac80211/patches/300-ath9k-force-rx_clear-when-disabling-rx.patch +index bddb15a..8f7e893 100644 +--- a/package/kernel/mac80211/patches/300-ath9k-force-rx_clear-when-disabling-rx.patch ++++ b/package/kernel/mac80211/patches/300-ath9k-force-rx_clear-when-disabling-rx.patch +@@ -1,17 +1,18 @@ +-From: Felix Fietkau ++From: Felix Fietkau + Date: Sun, 7 Jun 2015 13:53:35 +0200 + Subject: [PATCH] ath9k: force rx_clear when disabling rx + + This makes stopping Rx more reliable and should reduce the frequency of +-Rx related DMA stop warnings ++Rx related DMA stop warnings. Don't use rx_clear in TX99 mode. + + Cc: stable@vger.kernel.org +-Signed-off-by: Felix Fietkau ++Signed-off-by: Felix Fietkau ++Signed-off-by: Helmut Schaa + --- + + --- a/drivers/net/wireless/ath/ath9k/mac.c + +++ b/drivers/net/wireless/ath/ath9k/mac.c +-@@ -677,13 +677,15 @@ void ath9k_hw_startpcureceive(struct ath ++@@ -677,13 +677,18 @@ void ath9k_hw_startpcureceive(struct ath + + ath9k_ani_reset(ah, is_scanning); + +@@ -24,8 +25,11 @@ Signed-off-by: Felix Fietkau + void ath9k_hw_abortpcurecv(struct ath_hw *ah) + { + - REG_SET_BIT(ah, AR_DIAG_SW, AR_DIAG_RX_ABORT | AR_DIAG_RX_DIS); +-+ REG_SET_BIT(ah, AR_DIAG_SW, +-+ AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT | AR_DIAG_FORCE_RX_CLEAR); +++ u32 reg = AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT; +++ +++ if (!config_enabled(CPTCFG_ATH9K_TX99)) +++ reg |= AR_DIAG_FORCE_RX_CLEAR; +++ REG_SET_BIT(ah, AR_DIAG_SW, reg); + + ath9k_hw_disable_mib_counters(ah); + } +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 +index a160dc4..358d028 100644 +--- 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 +@@ -1,4 +1,4 @@ +-From: Felix Fietkau ++From: Felix Fietkau + Date: Thu, 2 Jul 2015 15:20:56 +0200 + Subject: [PATCH] ath9k: limit retries for powersave response frames + +@@ -8,7 +8,7 @@ gone to sleep. To avoid wasting too much airtime on this, limit the + number of retries on such frames and ensure that no sample rate gets + used. + +-Signed-off-by: Felix Fietkau ++Signed-off-by: Felix Fietkau + --- + + --- a/drivers/net/wireless/ath/ath9k/xmit.c +diff --git a/package/kernel/mac80211/patches/302-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch b/package/kernel/mac80211/patches/302-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch +new file mode 100644 +index 0000000..7caa9be +--- /dev/null ++++ b/package/kernel/mac80211/patches/302-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch +@@ -0,0 +1,37 @@ ++From: Felix Fietkau ++Date: Sat, 14 May 2016 14:51:02 +0200 ++Subject: [PATCH] Revert "ath9k: interpret requested txpower in EIRP ++ domain" ++ ++This reverts commit 71f5137bf010c6faffab50c0ec15374c59c4a411. ++--- ++ ++--- a/drivers/net/wireless/ath/ath9k/hw.c +++++ b/drivers/net/wireless/ath/ath9k/hw.c ++@@ -2914,7 +2914,8 @@ void ath9k_hw_apply_txpower(struct ath_h ++ { ++ struct ath_regulatory *reg = ath9k_hw_regulatory(ah); ++ struct ieee80211_channel *channel; ++- int chan_pwr, new_pwr; +++ int chan_pwr, new_pwr, max_gain; +++ int ant_gain, ant_reduction = 0; ++ ++ if (!chan) ++ return; ++@@ -2922,10 +2923,15 @@ void ath9k_hw_apply_txpower(struct ath_h ++ channel = chan->chan; ++ chan_pwr = min_t(int, channel->max_power * 2, MAX_RATE_POWER); ++ new_pwr = min_t(int, chan_pwr, reg->power_limit); +++ max_gain = chan_pwr - new_pwr + channel->max_antenna_gain * 2; +++ +++ ant_gain = get_antenna_gain(ah, chan); +++ if (ant_gain > max_gain) +++ ant_reduction = ant_gain - max_gain; ++ ++ ah->eep_ops->set_txpower(ah, chan, ++ ath9k_regd_get_ctl(reg, chan), ++- get_antenna_gain(ah, chan), new_pwr, test); +++ ant_reduction, new_pwr, test); ++ } ++ ++ void ath9k_hw_set_txpowerlimit(struct ath_hw *ah, u32 limit, bool test) +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 +deleted file mode 100644 +index 22b987a..0000000 +--- a/package/kernel/mac80211/patches/302-ath9k_hw-add-low-power-tx-gain-table-for-AR953x.patch ++++ /dev/null +@@ -1,95 +0,0 @@ +-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-mac80211-mesh-flush-mesh-paths-unconditionally.patch b/package/kernel/mac80211/patches/303-mac80211-mesh-flush-mesh-paths-unconditionally.patch +new file mode 100644 +index 0000000..518d0a3 +--- /dev/null ++++ b/package/kernel/mac80211/patches/303-mac80211-mesh-flush-mesh-paths-unconditionally.patch +@@ -0,0 +1,146 @@ ++From: Bob Copeland ++Date: Sun, 15 May 2016 13:19:16 -0400 ++Subject: [PATCH] mac80211: mesh: flush mesh paths unconditionally ++ ++Currently, the mesh paths associated with a nexthop station are cleaned ++up in the following code path: ++ ++ __sta_info_destroy_part1 ++ synchronize_net() ++ __sta_info_destroy_part2 ++ -> cleanup_single_sta ++ -> mesh_sta_cleanup ++ -> mesh_plink_deactivate ++ -> mesh_path_flush_by_nexthop ++ ++However, there are a couple of problems here: ++ ++1) the paths aren't flushed at all if the MPM is running in userspace ++ (e.g. when using wpa_supplicant or authsae) ++ ++2) there is no synchronize_rcu between removing the path and readers ++ accessing the nexthop, which means the following race is possible: ++ ++CPU0 CPU1 ++~~~~ ~~~~ ++ sta_info_destroy_part1() ++ synchronize_net() ++rcu_read_lock() ++mesh_nexthop_resolve() ++ mpath = mesh_path_lookup() ++ [...] -> mesh_path_flush_by_nexthop() ++ sta = rcu_dereference( ++ mpath->next_hop) ++ kfree(sta) ++ access sta <-- CRASH ++ ++Fix both of these by unconditionally flushing paths before destroying ++the sta, and by adding a synchronize_net() after path flush to ensure ++no active readers can still dereference the sta. ++ ++Fixes this crash: ++ ++[ 348.529295] BUG: unable to handle kernel paging request at 00020040 ++[ 348.530014] IP: [] ieee80211_mps_set_frame_flags+0x40/0xaa [mac80211] ++[ 348.530014] *pde = 00000000 ++[ 348.530014] Oops: 0000 [#1] PREEMPT ++[ 348.530014] Modules linked in: drbg ansi_cprng ctr ccm ppp_generic slhc ipt_MASQUERADE nf_nat_masquerade_ipv4 8021q ] ++[ 348.530014] CPU: 0 PID: 20597 Comm: wget Tainted: G O 4.6.0-rc5-wt=V1 #1 ++[ 348.530014] Hardware name: To Be Filled By O.E.M./To be filled by O.E.M., BIOS 080016 11/07/2014 ++[ 348.530014] task: f64fa280 ti: f4f9c000 task.ti: f4f9c000 ++[ 348.530014] EIP: 0060:[] EFLAGS: 00010246 CPU: 0 ++[ 348.530014] EIP is at ieee80211_mps_set_frame_flags+0x40/0xaa [mac80211] ++[ 348.530014] EAX: f4ce63e0 EBX: 00000088 ECX: f3788416 EDX: 00020008 ++[ 348.530014] ESI: 00000000 EDI: 00000088 EBP: f6409a4c ESP: f6409a40 ++[ 348.530014] DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 0068 ++[ 348.530014] CR0: 80050033 CR2: 00020040 CR3: 33190000 CR4: 00000690 ++[ 348.530014] Stack: ++[ 348.530014] 00000000 f4ce63e0 f5f9bd80 f6409a64 f9291d80 0000ce67 f5d51e00 f4ce63e0 ++[ 348.530014] f3788416 f6409a80 f9291dc1 f4ce8320 f4ce63e0 f5d51e00 f4ce63e0 f4ce8320 ++[ 348.530014] f6409a98 f9277f6f 00000000 00000000 0000007c 00000000 f6409b2c f9278dd1 ++[ 348.530014] Call Trace: ++[ 348.530014] [] mesh_nexthop_lookup+0xbb/0xc8 [mac80211] ++[ 348.530014] [] mesh_nexthop_resolve+0x34/0xd8 [mac80211] ++[ 348.530014] [] ieee80211_xmit+0x92/0xc1 [mac80211] ++[ 348.530014] [] __ieee80211_subif_start_xmit+0x807/0x83c [mac80211] ++[ 348.530014] [] ? sch_direct_xmit+0xd7/0x1b3 ++[ 348.530014] [] ? __local_bh_enable_ip+0x5d/0x7b ++[ 348.530014] [] ? nf_nat_ipv4_out+0x4c/0xd0 [nf_nat_ipv4] ++[ 348.530014] [] ? iptable_nat_ipv4_fn+0xf/0xf [iptable_nat] ++[ 348.530014] [] ? netif_skb_features+0x14d/0x30a ++[ 348.530014] [] ieee80211_subif_start_xmit+0xa/0xe [mac80211] ++[ 348.530014] [] dev_hard_start_xmit+0x1f8/0x267 ++[ 348.530014] [] ? validate_xmit_skb.isra.120.part.121+0x10/0x253 ++[ 348.530014] [] sch_direct_xmit+0x8b/0x1b3 ++[ 348.530014] [] __dev_queue_xmit+0x2c8/0x513 ++[ 348.530014] [] dev_queue_xmit+0xa/0xc ++[ 348.530014] [] batadv_send_skb_packet+0xd6/0xec [batman_adv] ++[ 348.530014] [] batadv_send_unicast_skb+0x15/0x4a [batman_adv] ++[ 348.530014] [] batadv_dat_send_data+0x27e/0x310 [batman_adv] ++[ 348.530014] [] ? batadv_tt_global_hash_find.isra.11+0x8/0xa [batman_adv] ++[ 348.530014] [] batadv_dat_snoop_outgoing_arp_request+0x208/0x23d [batman_adv] ++[ 348.530014] [] batadv_interface_tx+0x206/0x385 [batman_adv] ++[ 348.530014] [] dev_hard_start_xmit+0x1f8/0x267 ++[ 348.530014] [] ? validate_xmit_skb.isra.120.part.121+0x10/0x253 ++[ 348.530014] [] sch_direct_xmit+0x8b/0x1b3 ++[ 348.530014] [] __dev_queue_xmit+0x2c8/0x513 ++[ 348.530014] [] ? igb_xmit_frame+0x57/0x72 [igb] ++[ 348.530014] [] dev_queue_xmit+0xa/0xc ++[ 348.530014] [] br_dev_queue_push_xmit+0xeb/0xfb [bridge] ++[ 348.530014] [] br_forward_finish+0x29/0x74 [bridge] ++[ 348.530014] [] ? deliver_clone+0x3b/0x3b [bridge] ++[ 348.530014] [] __br_forward+0x89/0xe7 [bridge] ++[ 348.530014] [] ? br_dev_queue_push_xmit+0xfb/0xfb [bridge] ++[ 348.530014] [] deliver_clone+0x34/0x3b [bridge] ++[ 348.530014] [] ? br_flood+0x95/0x95 [bridge] ++[ 348.530014] [] br_flood+0x77/0x95 [bridge] ++[ 348.530014] [] br_flood_forward+0x13/0x1a [bridge] ++[ 348.530014] [] ? br_flood+0x95/0x95 [bridge] ++[ 348.530014] [] br_handle_frame_finish+0x392/0x3db [bridge] ++[ 348.530014] [] ? nf_iterate+0x2b/0x6b ++[ 348.530014] [] br_handle_frame+0x1e6/0x240 [bridge] ++[ 348.530014] [] ? br_handle_local_finish+0x6a/0x6a [bridge] ++[ 348.530014] [] __netif_receive_skb_core+0x43a/0x66b ++[ 348.530014] [] ? br_handle_frame_finish+0x3db/0x3db [bridge] ++[ 348.530014] [] ? resched_curr+0x19/0x37 ++[ 348.530014] [] ? check_preempt_wakeup+0xbf/0xfe ++[ 348.530014] [] ? ktime_get_with_offset+0x5c/0xfc ++[ 348.530014] [] __netif_receive_skb+0x47/0x55 ++[ 348.530014] [] netif_receive_skb_internal+0x40/0x5a ++[ 348.530014] [] napi_gro_receive+0x3a/0x94 ++[ 348.530014] [] igb_poll+0x6fd/0x9ad [igb] ++[ 348.530014] [] ? swake_up_locked+0x14/0x26 ++[ 348.530014] [] net_rx_action+0xde/0x250 ++[ 348.530014] [] __do_softirq+0x8a/0x163 ++[ 348.530014] [] ? __hrtimer_tasklet_trampoline+0x19/0x19 ++[ 348.530014] [] do_softirq_own_stack+0x26/0x2c ++[ 348.530014] ++[ 348.530014] [] irq_exit+0x31/0x6f ++[ 348.530014] [] do_IRQ+0x8d/0xa0 ++[ 348.530014] [] common_interrupt+0x2c/0x40 ++[ 348.530014] Code: e7 8c 00 66 81 ff 88 00 75 12 85 d2 75 0e b2 c3 b8 83 e9 29 f9 e8 a7 5f f9 c6 eb 74 66 81 e3 8c 005 ++[ 348.530014] EIP: [] ieee80211_mps_set_frame_flags+0x40/0xaa [mac80211] SS:ESP 0068:f6409a40 ++[ 348.530014] CR2: 0000000000020040 ++[ 348.530014] ---[ end trace 48556ac26779732e ]--- ++[ 348.530014] Kernel panic - not syncing: Fatal exception in interrupt ++[ 348.530014] Kernel Offset: disabled ++ ++Cc: stable@vger.kernel.org ++Reported-by: Fred Veldini ++Tested-by: Fred Veldini ++Signed-off-by: Bob Copeland ++--- ++ ++--- a/net/mac80211/mesh.c +++++ b/net/mac80211/mesh.c ++@@ -161,6 +161,10 @@ void mesh_sta_cleanup(struct sta_info *s ++ del_timer_sync(&sta->mesh->plink_timer); ++ } ++ +++ /* make sure no readers can access nexthop sta from here on */ +++ mesh_path_flush_by_nexthop(sta); +++ synchronize_net(); +++ ++ if (changed) ++ ieee80211_mbss_info_change_notify(sdata, changed); ++ } +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 +deleted file mode 100644 +index 7bb7435..0000000 +--- a/package/kernel/mac80211/patches/303-rt2x00-fix-monitor-mode-regression.patch ++++ /dev/null +@@ -1,156 +0,0 @@ +-From: Eli Cooper +-Date: Thu, 14 Jan 2016 00:07:12 +0800 +-Subject: [PATCH] rt2x00: fix monitor mode regression +- +-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/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; +- +- /* +- * 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-avoid-ANI-restart-if-no-trigger.patch b/package/kernel/mac80211/patches/304-ath9k-avoid-ANI-restart-if-no-trigger.patch +deleted file mode 100644 +index 049059a..0000000 +--- a/package/kernel/mac80211/patches/304-ath9k-avoid-ANI-restart-if-no-trigger.patch ++++ /dev/null +@@ -1,32 +0,0 @@ +-From: Miaoqing Pan +-Date: Fri, 15 Jan 2016 18:17:17 +0800 +-Subject: [PATCH] ath9k: avoid ANI restart if no trigger +- +-Fixes commit 54da20d83f0e ("ath9k_hw: improve ANI processing and rx desensitizing parameters") +- +-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/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); +- } +-- ath9k_ani_restart(ah); +- } +- } +- EXPORT_SYMBOL(ath9k_hw_ani_monitor); +diff --git a/package/kernel/mac80211/patches/304-mac80211-fix-fast_tx-header-alignment.patch b/package/kernel/mac80211/patches/304-mac80211-fix-fast_tx-header-alignment.patch +new file mode 100644 +index 0000000..6316d81 +--- /dev/null ++++ b/package/kernel/mac80211/patches/304-mac80211-fix-fast_tx-header-alignment.patch +@@ -0,0 +1,25 @@ ++From: Felix Fietkau ++Date: Thu, 19 May 2016 17:32:13 +0200 ++Subject: [PATCH] mac80211: fix fast_tx header alignment ++ ++The header field is defined as u8[] but also accessed as struct ++ieee80211_hdr. Enforce an alignment of 2 to prevent unnecessary ++unaligned accesses, which can be very harmful for performance on many ++platforms. ++ ++Fixes: e495c24731a2 ("mac80211: extend fast-xmit for more ciphers") ++Cc: stable@vger.kernel.org ++Signed-off-by: Felix Fietkau ++--- ++ ++--- a/net/mac80211/sta_info.h +++++ b/net/mac80211/sta_info.h ++@@ -280,7 +280,7 @@ struct ieee80211_fast_tx { ++ u8 sa_offs, da_offs, pn_offs; ++ u8 band; ++ u8 hdr[30 + 2 + IEEE80211_FAST_XMIT_MAX_IV + ++- sizeof(rfc1042_header)]; +++ sizeof(rfc1042_header)] __aligned(2); ++ ++ struct rcu_head rcu_head; ++ }; +diff --git a/package/kernel/mac80211/patches/305-ath10k-Ensure-txrx-compl-task-is-stopped-when-cleani.patch b/package/kernel/mac80211/patches/305-ath10k-Ensure-txrx-compl-task-is-stopped-when-cleani.patch +new file mode 100644 +index 0000000..73accd8 +--- /dev/null ++++ b/package/kernel/mac80211/patches/305-ath10k-Ensure-txrx-compl-task-is-stopped-when-cleani.patch +@@ -0,0 +1,21 @@ ++From: Ben Greear ++Date: Fri, 1 Apr 2016 14:12:08 -0700 ++Subject: [PATCH] ath10k: Ensure txrx-compl-task is stopped when cleaning ++ htt-tx. ++ ++Otherwise, the txrx-compl-task may access some bad memory? ++ ++Signed-off-by: Ben Greear ++--- ++ ++--- a/drivers/net/wireless/ath/ath10k/htt_tx.c +++++ b/drivers/net/wireless/ath/ath10k/htt_tx.c ++@@ -388,6 +388,8 @@ void ath10k_htt_tx_free(struct ath10k_ht ++ { ++ int size; ++ +++ tasklet_kill(&htt->txrx_compl_task); +++ ++ idr_for_each(&htt->pending_tx, ath10k_htt_tx_clean_up_pending, htt->ar); ++ idr_destroy(&htt->pending_tx); ++ +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 +deleted file mode 100644 +index a1ac67c..0000000 +--- a/package/kernel/mac80211/patches/305-ath9k-clean-up-ANI-per-channel-pointer-checking.patch ++++ /dev/null +@@ -1,91 +0,0 @@ +-From: Miaoqing Pan +-Date: Fri, 15 Jan 2016 18:17:18 +0800 +-Subject: [PATCH] ath9k: clean up ANI per-channel pointer checking +- +-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: Miaoqing Pan +---- +- +---- 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 +- +- static void ath9k_ani_restart(struct ath_hw *ah) +- { +-- struct ar5416AniState *aniState; +-- +-- if (!ah->curchan) +-- return; +-+ struct ar5416AniState *aniState = &ah->ani; +- +-- 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; +-- +-- aniState = &ah->ani; +-+ struct ar5416AniState *aniState = &ah->ani; +- +- 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 +- +- 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 (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; +- +- /* 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; +- +-- if (!ah->curchan) +-+ if (!chan) +- return; +- +- BUG_ON(aniState == NULL); +-@@ -416,14 +400,10 @@ static bool ath9k_hw_ani_read_counters(s +- +- 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; +- +-- if (!ah->curchan) +-- return; +-- +-- aniState = &ah->ani; +- if (!ath9k_hw_ani_read_counters(ah)) +- return; +- +diff --git a/package/kernel/mac80211/patches/306-ath10k-Ensure-peer_map-references-are-cleaned-up.patch b/package/kernel/mac80211/patches/306-ath10k-Ensure-peer_map-references-are-cleaned-up.patch +new file mode 100644 +index 0000000..2979b4b +--- /dev/null ++++ b/package/kernel/mac80211/patches/306-ath10k-Ensure-peer_map-references-are-cleaned-up.patch +@@ -0,0 +1,60 @@ ++From: Ben Greear ++Date: Fri, 1 Apr 2016 14:12:09 -0700 ++Subject: [PATCH] ath10k: Ensure peer_map references are cleaned up. ++ ++While debugging OS crashes due to firmware crashes, I enabled ++kasan, and it noticed that peer objects were being used-after-freed. ++ ++Looks like there are two places we could be leaving stale references ++in the peer-map, so clean that up. ++ ++Signed-off-by: Ben Greear ++--- ++ ++--- a/drivers/net/wireless/ath/ath10k/mac.c +++++ b/drivers/net/wireless/ath/ath10k/mac.c ++@@ -773,6 +773,7 @@ static void ath10k_peer_cleanup(struct a ++ { ++ struct ath10k_peer *peer, *tmp; ++ int peer_id; +++ int i; ++ ++ lockdep_assert_held(&ar->conf_mutex); ++ ++@@ -789,6 +790,17 @@ static void ath10k_peer_cleanup(struct a ++ ar->peer_map[peer_id] = NULL; ++ } ++ +++ /* Double check that peer is properly un-referenced from +++ * the peer_map +++ */ +++ for (i = 0; i < ARRAY_SIZE(ar->peer_map); i++) { +++ if (ar->peer_map[i] == peer) { +++ ath10k_warn(ar, "removing stale peer_map entry for %pM (ptr %p idx %d)\n", +++ peer->addr, peer, i); +++ ar->peer_map[i] = NULL; +++ } +++ } +++ ++ list_del(&peer->list); ++ kfree(peer); ++ ar->num_peers--; ++@@ -799,6 +811,7 @@ static void ath10k_peer_cleanup(struct a ++ static void ath10k_peer_cleanup_all(struct ath10k *ar) ++ { ++ struct ath10k_peer *peer, *tmp; +++ int i; ++ ++ lockdep_assert_held(&ar->conf_mutex); ++ ++@@ -807,6 +820,10 @@ static void ath10k_peer_cleanup_all(stru ++ list_del(&peer->list); ++ kfree(peer); ++ } +++ +++ for (i = 0; i < ARRAY_SIZE(ar->peer_map); i++) +++ ar->peer_map[i] = NULL; +++ ++ spin_unlock_bh(&ar->data_lock); ++ ++ ar->num_peers = 0; +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 +deleted file mode 100644 +index cf8194a..0000000 +--- a/package/kernel/mac80211/patches/306-ath9k-do-not-reset-while-BB-panic-0x4000409-on-ar956.patch ++++ /dev/null +@@ -1,31 +0,0 @@ +-From: Miaoqing Pan +-Date: Fri, 15 Jan 2016 18:17:19 +0800 +-Subject: [PATCH] ath9k: do not reset while BB panic(0x4000409) on ar9561 +- +-BB panic(0x4000409) observed while AP enabling/disabling +-bursting. +- +-Signed-off-by: Miaoqing Pan +---- +- +---- 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. +- */ +- +- /* +-@@ -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-ath10k-Clean-up-peer-when-sta-goes-away.patch b/package/kernel/mac80211/patches/307-ath10k-Clean-up-peer-when-sta-goes-away.patch +new file mode 100644 +index 0000000..f814ae7 +--- /dev/null ++++ b/package/kernel/mac80211/patches/307-ath10k-Clean-up-peer-when-sta-goes-away.patch +@@ -0,0 +1,32 @@ ++From: Ben Greear ++Date: Fri, 1 Apr 2016 14:12:11 -0700 ++Subject: [PATCH] ath10k: Clean up peer when sta goes away. ++ ++If WMI and/or firmware has issues removing the peer object, ++then we still need to clean up the peer object in the driver. ++ ++Signed-off-by: Ben Greear ++--- ++ ++--- a/drivers/net/wireless/ath/ath10k/mac.c +++++ b/drivers/net/wireless/ath/ath10k/mac.c ++@@ -5949,9 +5949,17 @@ static int ath10k_sta_state(struct ieee8 ++ continue; ++ ++ if (peer->sta == sta) { ++- ath10k_warn(ar, "found sta peer %pM entry on vdev %i after it was supposedly removed\n", ++- sta->addr, arvif->vdev_id); +++ ath10k_warn(ar, "found sta peer %pM (ptr %p id %d) entry on vdev %i after it was supposedly removed\n", +++ sta->addr, peer, i, arvif->vdev_id); ++ peer->sta = NULL; +++ +++ /* Clean up the peer object as well since we +++ * must have failed to do this above. +++ */ +++ list_del(&peer->list); +++ ar->peer_map[i] = NULL; +++ kfree(peer); +++ ar->num_peers--; ++ } ++ } ++ spin_unlock_bh(&ar->data_lock); +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 +deleted file mode 100644 +index 80b781c..0000000 +--- a/package/kernel/mac80211/patches/307-ath9k-fix-inconsistent-use-of-tab-and-space-in-inden.patch ++++ /dev/null +@@ -1,27 +0,0 @@ +-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/308-ath10k-remove-duplicate-and-unused-rx-rate-flags.patch b/package/kernel/mac80211/patches/308-ath10k-remove-duplicate-and-unused-rx-rate-flags.patch +new file mode 100644 +index 0000000..7c5c5be +--- /dev/null ++++ b/package/kernel/mac80211/patches/308-ath10k-remove-duplicate-and-unused-rx-rate-flags.patch +@@ -0,0 +1,66 @@ ++From: Mohammed Shafi Shajakhan ++Date: Thu, 2 Jun 2016 19:54:41 +0530 ++Subject: [PATCH] ath10k: remove duplicate and unused rx rate flags ++ ++All these flags are not used and their use is completely ++covered by 'ath10k_hw_rate_ofdm', 'ath10k_hw_rate_cck', ++and RX_PPDU_START_RATE_FLAG ++ ++Signed-off-by: Mohammed Shafi Shajakhan ++--- ++ ++--- a/drivers/net/wireless/ath/ath10k/rx_desc.h +++++ b/drivers/net/wireless/ath/ath10k/rx_desc.h ++@@ -656,26 +656,6 @@ struct rx_msdu_end { ++ * Reserved: HW should fill with zero. FW should ignore. ++ */ ++ ++-#define RX_PPDU_START_SIG_RATE_SELECT_OFDM 0 ++-#define RX_PPDU_START_SIG_RATE_SELECT_CCK 1 ++- ++-#define RX_PPDU_START_SIG_RATE_OFDM_48 0 ++-#define RX_PPDU_START_SIG_RATE_OFDM_24 1 ++-#define RX_PPDU_START_SIG_RATE_OFDM_12 2 ++-#define RX_PPDU_START_SIG_RATE_OFDM_6 3 ++-#define RX_PPDU_START_SIG_RATE_OFDM_54 4 ++-#define RX_PPDU_START_SIG_RATE_OFDM_36 5 ++-#define RX_PPDU_START_SIG_RATE_OFDM_18 6 ++-#define RX_PPDU_START_SIG_RATE_OFDM_9 7 ++- ++-#define RX_PPDU_START_SIG_RATE_CCK_LP_11 0 ++-#define RX_PPDU_START_SIG_RATE_CCK_LP_5_5 1 ++-#define RX_PPDU_START_SIG_RATE_CCK_LP_2 2 ++-#define RX_PPDU_START_SIG_RATE_CCK_LP_1 3 ++-#define RX_PPDU_START_SIG_RATE_CCK_SP_11 4 ++-#define RX_PPDU_START_SIG_RATE_CCK_SP_5_5 5 ++-#define RX_PPDU_START_SIG_RATE_CCK_SP_2 6 ++- ++ #define HTT_RX_PPDU_START_PREAMBLE_LEGACY 0x04 ++ #define HTT_RX_PPDU_START_PREAMBLE_HT 0x08 ++ #define HTT_RX_PPDU_START_PREAMBLE_HT_WITH_TXBF 0x09 ++@@ -711,25 +691,6 @@ struct rx_msdu_end { ++ /* No idea what this flag means. It seems to be always set in rate. */ ++ #define RX_PPDU_START_RATE_FLAG BIT(3) ++ ++-enum rx_ppdu_start_rate { ++- RX_PPDU_START_RATE_OFDM_48M = RX_PPDU_START_RATE_FLAG | ATH10K_HW_RATE_OFDM_48M, ++- RX_PPDU_START_RATE_OFDM_24M = RX_PPDU_START_RATE_FLAG | ATH10K_HW_RATE_OFDM_24M, ++- RX_PPDU_START_RATE_OFDM_12M = RX_PPDU_START_RATE_FLAG | ATH10K_HW_RATE_OFDM_12M, ++- RX_PPDU_START_RATE_OFDM_6M = RX_PPDU_START_RATE_FLAG | ATH10K_HW_RATE_OFDM_6M, ++- RX_PPDU_START_RATE_OFDM_54M = RX_PPDU_START_RATE_FLAG | ATH10K_HW_RATE_OFDM_54M, ++- RX_PPDU_START_RATE_OFDM_36M = RX_PPDU_START_RATE_FLAG | ATH10K_HW_RATE_OFDM_36M, ++- RX_PPDU_START_RATE_OFDM_18M = RX_PPDU_START_RATE_FLAG | ATH10K_HW_RATE_OFDM_18M, ++- RX_PPDU_START_RATE_OFDM_9M = RX_PPDU_START_RATE_FLAG | ATH10K_HW_RATE_OFDM_9M, ++- ++- RX_PPDU_START_RATE_CCK_LP_11M = RX_PPDU_START_RATE_FLAG | ATH10K_HW_RATE_CCK_LP_11M, ++- RX_PPDU_START_RATE_CCK_LP_5_5M = RX_PPDU_START_RATE_FLAG | ATH10K_HW_RATE_CCK_LP_5_5M, ++- RX_PPDU_START_RATE_CCK_LP_2M = RX_PPDU_START_RATE_FLAG | ATH10K_HW_RATE_CCK_LP_2M, ++- RX_PPDU_START_RATE_CCK_LP_1M = RX_PPDU_START_RATE_FLAG | ATH10K_HW_RATE_CCK_LP_1M, ++- RX_PPDU_START_RATE_CCK_SP_11M = RX_PPDU_START_RATE_FLAG | ATH10K_HW_RATE_CCK_SP_11M, ++- RX_PPDU_START_RATE_CCK_SP_5_5M = RX_PPDU_START_RATE_FLAG | ATH10K_HW_RATE_CCK_SP_5_5M, ++- RX_PPDU_START_RATE_CCK_SP_2M = RX_PPDU_START_RATE_FLAG | ATH10K_HW_RATE_CCK_SP_2M, ++-}; ++- ++ struct rx_ppdu_start { ++ struct { ++ u8 pri20_mhz; +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 +deleted file mode 100644 +index d408866..0000000 +--- a/package/kernel/mac80211/patches/308-ath9k-fix-data-bus-error-on-ar9300-and-ar9580.patch ++++ /dev/null +@@ -1,65 +0,0 @@ +-From: Miaoqing Pan +-Date: Fri, 15 Jan 2016 18:17:21 +0800 +-Subject: [PATCH] ath9k: fix data bus error on ar9300 and ar9580 +- +-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. +- +-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. +- +-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 +---- +- +---- 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); +-+ } +-+ +- REG_WRITE(ah, AR_RTC_RC, rst_flags); +- +- 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 +- +diff --git a/package/kernel/mac80211/patches/309-01-brcmfmac-add-missing-include.patch b/package/kernel/mac80211/patches/309-01-brcmfmac-add-missing-include.patch +deleted file mode 100644 +index d9511c8..0000000 +--- a/package/kernel/mac80211/patches/309-01-brcmfmac-add-missing-include.patch ++++ /dev/null +@@ -1,19 +0,0 @@ +-From: Felix Fietkau +-Date: Fri, 15 Jan 2016 15:59:45 +0100 +-Subject: [PATCH] brcmfmac: add missing include +- +-linux/module.h is required for defining module parameters +- +-Signed-off-by: Felix Fietkau +---- +- +---- 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/309-02-brcmfmac-fix-sdio-sg-table-alloc-crash.patch b/package/kernel/mac80211/patches/309-02-brcmfmac-fix-sdio-sg-table-alloc-crash.patch +deleted file mode 100644 +index 711e019..0000000 +--- a/package/kernel/mac80211/patches/309-02-brcmfmac-fix-sdio-sg-table-alloc-crash.patch ++++ /dev/null +@@ -1,118 +0,0 @@ +-From: Hante Meuleman +-Date: Tue, 19 Jan 2016 12:39:24 +0100 +-Subject: [PATCH] brcmfmac: fix sdio sg table alloc crash +- +-With commit 7d34b0560567 ("brcmfmac: Move all module parameters to +-one place") a bug was introduced causing a null pointer exception. +-This patch fixes the bug by initializing the sg table till after +-the settings have been initialized. +- +-Fixes: 7d34b0560567 ("brcmfmac: Move all module parameters to one place") +-Reported-by: Marc Zyngier +-Tested-by: Marc Zyngier +-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/broadcom/brcm80211/brcmfmac/bcmsdh.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +-@@ -879,11 +879,24 @@ int brcmf_sdiod_abort(struct brcmf_sdio_ +- return 0; +- } +- +--static void brcmf_sdiod_sgtable_alloc(struct brcmf_sdio_dev *sdiodev) +-+void brcmf_sdiod_sgtable_alloc(struct brcmf_sdio_dev *sdiodev) +- { +-+ struct sdio_func *func; +-+ struct mmc_host *host; +-+ uint max_blocks; +- uint nents; +- int err; +- +-+ func = sdiodev->func[2]; +-+ host = func->card->host; +-+ sdiodev->sg_support = host->max_segs > 1; +-+ max_blocks = min_t(uint, host->max_blk_count, 511u); +-+ sdiodev->max_request_size = min_t(uint, host->max_req_size, +-+ max_blocks * func->cur_blksize); +-+ sdiodev->max_segment_count = min_t(uint, host->max_segs, +-+ SG_MAX_SINGLE_ALLOC); +-+ sdiodev->max_segment_size = host->max_seg_size; +-+ +- if (!sdiodev->sg_support) +- return; +- +-@@ -1021,9 +1034,6 @@ static void brcmf_sdiod_host_fixup(struc +- +- static int brcmf_sdiod_probe(struct brcmf_sdio_dev *sdiodev) +- { +-- struct sdio_func *func; +-- struct mmc_host *host; +-- uint max_blocks; +- int ret = 0; +- +- sdiodev->num_funcs = 2; +-@@ -1054,26 +1064,6 @@ static int brcmf_sdiod_probe(struct brcm +- goto out; +- } +- +-- /* +-- * determine host related variables after brcmf_sdiod_probe() +-- * as func->cur_blksize is properly set and F2 init has been +-- * completed successfully. +-- */ +-- func = sdiodev->func[2]; +-- host = func->card->host; +-- sdiodev->sg_support = host->max_segs > 1; +-- max_blocks = min_t(uint, host->max_blk_count, 511u); +-- sdiodev->max_request_size = min_t(uint, host->max_req_size, +-- max_blocks * func->cur_blksize); +-- sdiodev->max_segment_count = min_t(uint, host->max_segs, +-- SG_MAX_SINGLE_ALLOC); +-- sdiodev->max_segment_size = host->max_seg_size; +-- +-- /* allocate scatter-gather table. sg support +-- * will be disabled upon allocation failure. +-- */ +-- brcmf_sdiod_sgtable_alloc(sdiodev); +-- +- ret = brcmf_sdiod_freezer_attach(sdiodev); +- if (ret) +- goto out; +-@@ -1084,7 +1074,7 @@ static int brcmf_sdiod_probe(struct brcm +- ret = -ENODEV; +- goto out; +- } +-- brcmf_sdiod_host_fixup(host); +-+ brcmf_sdiod_host_fixup(sdiodev->func[2]->card->host); +- out: +- if (ret) +- brcmf_sdiod_remove(sdiodev); +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +-@@ -4114,6 +4114,11 @@ struct brcmf_sdio *brcmf_sdio_probe(stru +- goto fail; +- } +- +-+ /* allocate scatter-gather table. sg support +-+ * will be disabled upon allocation failure. +-+ */ +-+ brcmf_sdiod_sgtable_alloc(bus->sdiodev); +-+ +- /* Query the F2 block size, set roundup accordingly */ +- bus->blocksize = bus->sdiodev->func[2]->cur_blksize; +- bus->roundup = min(max_roundup, bus->blocksize); +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h +-@@ -342,6 +342,7 @@ int brcmf_sdiod_ramrw(struct brcmf_sdio_ +- +- /* Issue an abort to the specified function */ +- int brcmf_sdiod_abort(struct brcmf_sdio_dev *sdiodev, uint fn); +-+void brcmf_sdiod_sgtable_alloc(struct brcmf_sdio_dev *sdiodev); +- void brcmf_sdiod_change_state(struct brcmf_sdio_dev *sdiodev, +- enum brcmf_sdiod_state state); +- #ifdef CONFIG_PM_SLEEP +diff --git a/package/kernel/mac80211/patches/309-ath10k-fix-CCK-h-w-rates-for-QCA99X0-and-newer-chips.patch b/package/kernel/mac80211/patches/309-ath10k-fix-CCK-h-w-rates-for-QCA99X0-and-newer-chips.patch +new file mode 100644 +index 0000000..50ebfce +--- /dev/null ++++ b/package/kernel/mac80211/patches/309-ath10k-fix-CCK-h-w-rates-for-QCA99X0-and-newer-chips.patch +@@ -0,0 +1,141 @@ ++From: Mohammed Shafi Shajakhan ++Date: Thu, 2 Jun 2016 19:54:42 +0530 ++Subject: [PATCH] ath10k: fix CCK h/w rates for QCA99X0 and newer chipsets ++ ++CCK hardware table mapping from QCA99X0 onwards got revised. ++The CCK hardware rate values are in a proper order wrt. to ++rate and preamble as below ++ ++ATH10K_HW_RATE_REV2_CCK_LP_1M = 1, ++ATH10K_HW_RATE_REV2_CCK_LP_2M = 2, ++ATH10K_HW_RATE_REV2_CCK_LP_5_5M = 3, ++ATH10K_HW_RATE_REV2_CCK_LP_11M = 4, ++ATH10K_HW_RATE_REV2_CCK_SP_2M = 5, ++ATH10K_HW_RATE_REV2_CCK_SP_5_5M = 6, ++ATH10K_HW_RATE_REV2_CCK_SP_11M = 7, ++ ++This results in reporting of rx frames (with CCK rates) ++totally wrong for QCA99X0, QCA4019. Fix this by having ++separate CCK rate table for these chipsets with rev2 suffix ++and registering the correct rate mapping to mac80211 based on ++the new hw_param (introduced) 'cck_rate_map_rev2' which shall ++be true for any newchipsets from QCA99X0 onwards ++ ++Signed-off-by: Mohammed Shafi Shajakhan ++--- ++ ++--- a/drivers/net/wireless/ath/ath10k/core.c +++++ b/drivers/net/wireless/ath/ath10k/core.c ++@@ -148,6 +148,8 @@ static const struct ath10k_hw_params ath ++ .uart_pin = 7, ++ .otp_exe_param = 0x00000700, ++ .continuous_frag_desc = true, +++ .cck_rate_map_rev2 = true, +++ .cck_rate_map_rev2 = true, ++ .channel_counters_freq_hz = 150000, ++ .max_probe_resp_desc_thres = 24, ++ .hw_4addr_pad = ATH10K_HW_4ADDR_PAD_BEFORE, ++@@ -205,6 +207,7 @@ static const struct ath10k_hw_params ath ++ .has_shifted_cc_wraparound = true, ++ .otp_exe_param = 0x0010000, ++ .continuous_frag_desc = true, +++ .cck_rate_map_rev2 = true, ++ .channel_counters_freq_hz = 125000, ++ .max_probe_resp_desc_thres = 24, ++ .hw_4addr_pad = ATH10K_HW_4ADDR_PAD_BEFORE, ++--- a/drivers/net/wireless/ath/ath10k/core.h +++++ b/drivers/net/wireless/ath/ath10k/core.h ++@@ -716,6 +716,12 @@ struct ath10k { ++ */ ++ bool continuous_frag_desc; ++ +++ /* CCK hardware rate table mapping for the newer chipsets +++ * like QCA99X0, QCA4019 got revised. The CCK h/w rate values +++ * are in a proper order with respect to the rate/preamble +++ */ +++ bool cck_rate_map_rev2; +++ ++ u32 channel_counters_freq_hz; ++ ++ /* Mgmt tx descriptors threshold for limiting probe response ++--- a/drivers/net/wireless/ath/ath10k/hw.h +++++ b/drivers/net/wireless/ath/ath10k/hw.h ++@@ -315,6 +315,16 @@ enum ath10k_hw_rate_cck { ++ ATH10K_HW_RATE_CCK_SP_2M, ++ }; ++ +++enum ath10k_hw_rate_rev2_cck { +++ ATH10K_HW_RATE_REV2_CCK_LP_1M = 1, +++ ATH10K_HW_RATE_REV2_CCK_LP_2M, +++ ATH10K_HW_RATE_REV2_CCK_LP_5_5M, +++ ATH10K_HW_RATE_REV2_CCK_LP_11M, +++ ATH10K_HW_RATE_REV2_CCK_SP_2M, +++ ATH10K_HW_RATE_REV2_CCK_SP_5_5M, +++ ATH10K_HW_RATE_REV2_CCK_SP_11M, +++}; +++ ++ enum ath10k_hw_4addr_pad { ++ ATH10K_HW_4ADDR_PAD_AFTER, ++ ATH10K_HW_4ADDR_PAD_BEFORE, ++--- a/drivers/net/wireless/ath/ath10k/mac.c +++++ b/drivers/net/wireless/ath/ath10k/mac.c ++@@ -62,6 +62,32 @@ static struct ieee80211_rate ath10k_rate ++ { .bitrate = 540, .hw_value = ATH10K_HW_RATE_OFDM_54M }, ++ }; ++ +++static struct ieee80211_rate ath10k_rates_rev2[] = { +++ { .bitrate = 10, +++ .hw_value = ATH10K_HW_RATE_REV2_CCK_LP_1M }, +++ { .bitrate = 20, +++ .hw_value = ATH10K_HW_RATE_REV2_CCK_LP_2M, +++ .hw_value_short = ATH10K_HW_RATE_REV2_CCK_SP_2M, +++ .flags = IEEE80211_RATE_SHORT_PREAMBLE }, +++ { .bitrate = 55, +++ .hw_value = ATH10K_HW_RATE_REV2_CCK_LP_5_5M, +++ .hw_value_short = ATH10K_HW_RATE_REV2_CCK_SP_5_5M, +++ .flags = IEEE80211_RATE_SHORT_PREAMBLE }, +++ { .bitrate = 110, +++ .hw_value = ATH10K_HW_RATE_REV2_CCK_LP_11M, +++ .hw_value_short = ATH10K_HW_RATE_REV2_CCK_SP_11M, +++ .flags = IEEE80211_RATE_SHORT_PREAMBLE }, +++ +++ { .bitrate = 60, .hw_value = ATH10K_HW_RATE_OFDM_6M }, +++ { .bitrate = 90, .hw_value = ATH10K_HW_RATE_OFDM_9M }, +++ { .bitrate = 120, .hw_value = ATH10K_HW_RATE_OFDM_12M }, +++ { .bitrate = 180, .hw_value = ATH10K_HW_RATE_OFDM_18M }, +++ { .bitrate = 240, .hw_value = ATH10K_HW_RATE_OFDM_24M }, +++ { .bitrate = 360, .hw_value = ATH10K_HW_RATE_OFDM_36M }, +++ { .bitrate = 480, .hw_value = ATH10K_HW_RATE_OFDM_48M }, +++ { .bitrate = 540, .hw_value = ATH10K_HW_RATE_OFDM_54M }, +++}; +++ ++ #define ATH10K_MAC_FIRST_OFDM_RATE_IDX 4 ++ ++ #define ath10k_a_rates (ath10k_rates + ATH10K_MAC_FIRST_OFDM_RATE_IDX) ++@@ -70,6 +96,9 @@ static struct ieee80211_rate ath10k_rate ++ #define ath10k_g_rates (ath10k_rates + 0) ++ #define ath10k_g_rates_size (ARRAY_SIZE(ath10k_rates)) ++ +++#define ath10k_g_rates_rev2 (ath10k_rates_rev2 + 0) +++#define ath10k_g_rates_rev2_size (ARRAY_SIZE(ath10k_rates_rev2)) +++ ++ static bool ath10k_mac_bitrate_is_cck(int bitrate) ++ { ++ switch (bitrate) { ++@@ -7720,8 +7749,14 @@ int ath10k_mac_register(struct ath10k *a ++ band = &ar->mac.sbands[NL80211_BAND_2GHZ]; ++ band->n_channels = ARRAY_SIZE(ath10k_2ghz_channels); ++ band->channels = channels; ++- band->n_bitrates = ath10k_g_rates_size; ++- band->bitrates = ath10k_g_rates; +++ +++ if (ar->hw_params.cck_rate_map_rev2) { +++ band->n_bitrates = ath10k_g_rates_rev2_size; +++ band->bitrates = ath10k_g_rates_rev2; +++ } else { +++ band->n_bitrates = ath10k_g_rates_size; +++ band->bitrates = ath10k_g_rates; +++ } ++ ++ ar->hw->wiphy->bands[NL80211_BAND_2GHZ] = band; ++ } +diff --git a/package/kernel/mac80211/patches/310-ath10k-improve-tx-scheduling.patch b/package/kernel/mac80211/patches/310-ath10k-improve-tx-scheduling.patch +new file mode 100644 +index 0000000..81ac2db +--- /dev/null ++++ b/package/kernel/mac80211/patches/310-ath10k-improve-tx-scheduling.patch +@@ -0,0 +1,67 @@ ++From: Michal Kazior ++Date: Mon, 23 May 2016 23:12:45 +0300 ++Subject: [PATCH] ath10k: improve tx scheduling ++ ++Recent changes revolving around implementing ++wake_tx_queue support introduced a significant ++performance regressions on some (slower, uni-proc) ++systems. ++ ++Signed-off-by: Michal Kazior ++Signed-off-by: Kalle Valo ++--- ++ ++--- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++++ b/drivers/net/wireless/ath/ath10k/htt_rx.c ++@@ -2291,7 +2291,6 @@ bool ath10k_htt_t2h_msg_handler(struct a ++ ath10k_htt_tx_mgmt_dec_pending(htt); ++ spin_unlock_bh(&htt->tx_lock); ++ } ++- ath10k_mac_tx_push_pending(ar); ++ break; ++ } ++ case HTT_T2H_MSG_TYPE_TX_COMPL_IND: ++@@ -2442,8 +2441,6 @@ static void ath10k_htt_txrx_compl_task(u ++ dev_kfree_skb_any(skb); ++ } ++ ++- ath10k_mac_tx_push_pending(ar); ++- ++ num_mpdus = atomic_read(&htt->num_mpdus_ready); ++ ++ while (num_mpdus) { ++--- a/drivers/net/wireless/ath/ath10k/mac.c +++++ b/drivers/net/wireless/ath/ath10k/mac.c ++@@ -3827,6 +3827,9 @@ void ath10k_mac_tx_push_pending(struct a ++ int ret; ++ int max; ++ +++ if (ar->htt.num_pending_tx >= (ar->htt.max_num_pending_tx / 2)) +++ return; +++ ++ spin_lock_bh(&ar->txqs_lock); ++ rcu_read_lock(); ++ ++@@ -4097,9 +4100,7 @@ static void ath10k_mac_op_wake_tx_queue( ++ list_add_tail(&artxq->list, &ar->txqs); ++ spin_unlock_bh(&ar->txqs_lock); ++ ++- if (ath10k_mac_tx_can_push(hw, txq)) ++- tasklet_schedule(&ar->htt.txrx_compl_task); ++- +++ ath10k_mac_tx_push_pending(ar); ++ ath10k_htt_tx_txq_update(hw, txq); ++ } ++ ++--- a/drivers/net/wireless/ath/ath10k/txrx.c +++++ b/drivers/net/wireless/ath/ath10k/txrx.c ++@@ -117,6 +117,9 @@ int ath10k_txrx_tx_unref(struct ath10k_h ++ ++ ieee80211_tx_status(htt->ar->hw, msdu); ++ /* we do not own the msdu anymore */ +++ +++ ath10k_mac_tx_push_pending(ar); +++ ++ return 0; ++ } ++ +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 +deleted file mode 100644 +index 287d6e1..0000000 +--- a/package/kernel/mac80211/patches/310-ath9k_hw-ignore-eeprom-magic-mismatch-on-flash-based.patch ++++ /dev/null +@@ -1,38 +0,0 @@ +-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/311-ath10k-fix-deadlock-while-processing-rx_in_ord_ind.patch b/package/kernel/mac80211/patches/311-ath10k-fix-deadlock-while-processing-rx_in_ord_ind.patch +new file mode 100644 +index 0000000..3664d70 +--- /dev/null ++++ b/package/kernel/mac80211/patches/311-ath10k-fix-deadlock-while-processing-rx_in_ord_ind.patch +@@ -0,0 +1,59 @@ ++From: Rajkumar Manoharan ++Date: Thu, 9 Jun 2016 11:33:55 +0530 ++Subject: [PATCH] ath10k: fix deadlock while processing rx_in_ord_ind ++ ++commit 5c86d97bcc1d ("ath10k: combine txrx and replenish task") ++introduced deadlock while processing rx in order indication message ++for qca6174 based devices. While merging replenish and txrx tasklets, ++replenish task should be called out of htt rx ring locking since it ++is also try to acquire the same lock. ++ ++Unfortunately this issue is not exposed by other solutions (qca988x, ++qca99x0 & qca4019), as rx_in_ord_ind message is specific to qca6174 ++based devices. This patch fixes ++ ++============================================= ++[ INFO: possible recursive locking detected ] ++4.7.0-rc2-wt-ath+ #1353 Tainted: G E ++--------------------------------------------- ++swapper/3/0 is trying to acquire lock: ++ (&(&htt->rx_ring.lock)->rlock){+.-...}, at: [] ++ath10k_htt_rx_msdu_buff_replenish+0x29/0x90 [ath10k_core] ++ ++but task is already holding lock: ++ (&(&htt->rx_ring.lock)->rlock){+.-...}, at: [] ++ath10k_htt_txrx_compl_task+0x21b/0x250 [ath10k_core] ++ ++other info that might help us debug this: ++ Possible unsafe locking scenario: ++ ++ CPU0 ++ ---- ++ lock(&(&htt->rx_ring.lock)->rlock); ++ lock(&(&htt->rx_ring.lock)->rlock); ++ ++ *** DEADLOCK *** ++ ++ May be due to missing lock nesting notation ++ ++1 lock held by swapper/3/0: ++ #0: (&(&htt->rx_ring.lock)->rlock){+.-...}, at: [] ++ath10k_htt_txrx_compl_task+0x21b/0x250 [ath10k_core] ++ ++Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=119151 ++Fixes: 5c86d97bcc1d ("ath10k: combine txrx and replenish task") ++Reported-by: Mike Lothian ++Signed-off-by: Rajkumar Manoharan ++Signed-off-by: Kalle Valo ++--- ++ ++--- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++++ b/drivers/net/wireless/ath/ath10k/htt_rx.c ++@@ -1904,7 +1904,6 @@ static void ath10k_htt_rx_in_ord_ind(str ++ return; ++ } ++ } ++- ath10k_htt_rx_msdu_buff_replenish(htt); ++ } ++ ++ static void ath10k_htt_rx_tx_fetch_resp_id_confirm(struct ath10k *ar, +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 +deleted file mode 100644 +index 070efa9..0000000 +--- a/package/kernel/mac80211/patches/311-ath9k-do-not-limit-the-number-of-DFS-interfaces-to-1.patch ++++ /dev/null +@@ -1,55 +0,0 @@ +-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 +- +-Signed-off-by: Felix Fietkau +---- +- +---- 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 +- +- #endif /* CPTCFG_ATH9K_CHANNEL_CONTEXT */ +- +--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) }, +--}; +-- +- 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/312-mac80211-fix-txq-queue-related-crashes.patch b/package/kernel/mac80211/patches/312-mac80211-fix-txq-queue-related-crashes.patch +deleted file mode 100644 +index 61cafc7..0000000 +--- a/package/kernel/mac80211/patches/312-mac80211-fix-txq-queue-related-crashes.patch ++++ /dev/null +@@ -1,27 +0,0 @@ +-From: Michal Kazior +-Date: Thu, 21 Jan 2016 14:23:07 +0100 +-Subject: [PATCH] mac80211: fix txq queue related crashes +- +-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. +- +-Fixes: ba8c3d6f16a1 ("mac80211: add an intermediate software queue implementation") +-Signed-off-by: Michal Kazior +---- +- +---- 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); +- } +- +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 +deleted file mode 100644 +index 844d43b..0000000 +--- a/package/kernel/mac80211/patches/313-mac80211-fix-unnecessary-frame-drops-in-mesh-fwding.patch ++++ /dev/null +@@ -1,57 +0,0 @@ +-From: Michal Kazior +-Date: Mon, 25 Jan 2016 14:43:24 +0100 +-Subject: [PATCH] mac80211: fix unnecessary frame drops in mesh fwding +- +-The ieee80211_queue_stopped() expects hw queue +-number but it was given raw WMM AC number instead. +- +-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/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 +deleted file mode 100644 +index 5b3efbd..0000000 +--- a/package/kernel/mac80211/patches/314-mac80211-Requeue-work-after-scan-complete-for-all-VI.patch ++++ /dev/null +@@ -1,103 +0,0 @@ +-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); +- } +- } +- +---- 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); +-+ +-+ /* 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); +-+ } +-+ +- if (was_scanning) +- ieee80211_start_next_roc(local); +- } +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 +deleted file mode 100644 +index 52fecb9..0000000 +--- a/package/kernel/mac80211/patches/315-mac80211-fix-ibss-scan-parameters.patch ++++ /dev/null +@@ -1,57 +0,0 @@ +-From: Sara Sharon +-Date: Mon, 25 Jan 2016 15:46:35 +0200 +-Subject: [PATCH] mac80211: fix ibss scan parameters +- +-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. +- +-Fixes: 76bed0f43b27 ("mac80211: IBSS fix scan request") +-Signed-off-by: Sara Sharon +-Signed-off-by: Emmanuel Grumbach +---- +- +---- 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 +- +- 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; +- +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 +deleted file mode 100644 +index e78df36..0000000 +--- a/package/kernel/mac80211/patches/316-net-mac80211-agg-rx.c-fix-use-of-uninitialised-value.patch ++++ /dev/null +@@ -1,50 +0,0 @@ +-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-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 +deleted file mode 100644 +index 5bf53b9..0000000 +--- a/package/kernel/mac80211/patches/317-mac80211-minstrel_ht-fix-out-of-bound-in-minstrel_ht.patch ++++ /dev/null +@@ -1,45 +0,0 @@ +-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 +- +-Patch fixes this splat +- +-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/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; +- +-+ 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-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 +deleted file mode 100644 +index 655dc4b..0000000 +--- a/package/kernel/mac80211/patches/318-mac80211-move-A-MSDU-skb_linearize-call-to-ieee80211.patch ++++ /dev/null +@@ -1,35 +0,0 @@ +-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-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 +deleted file mode 100644 +index b646ab3..0000000 +--- a/package/kernel/mac80211/patches/319-cfg80211-add-function-for-802.3-conversion-with-sepa.patch ++++ /dev/null +@@ -1,186 +0,0 @@ +-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 +- +-Use skb_copy_bits in preparation for allowing fragmented skbs +- +-Signed-off-by: Felix Fietkau +-Signed-off-by: Johannes Berg +---- +- +---- 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) +- { +-- 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; +- } +- } +-+ +-+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)); +-+ +- return 0; +- } +-+ +-+int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr, +-+ enum nl80211_iftype iftype) +-+{ +-+ return __ieee80211_data_to_8023(skb, NULL, addr, iftype); +-+} +- EXPORT_SYMBOL(ieee80211_data_to_8023); +- +- int ieee80211_data_from_8023(struct sk_buff *skb, const u8 *addr, +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 +deleted file mode 100644 +index 2eeed22..0000000 +--- a/package/kernel/mac80211/patches/320-cfg80211-add-support-for-non-linear-skbs-in-ieee8021.patch ++++ /dev/null +@@ -1,159 +0,0 @@ +-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 +- +-Signed-off-by: Felix Fietkau +-Signed-off-by: Johannes Berg +---- +- +---- 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 struct sk_buff * +-+__ieee80211_amsdu_copy(struct sk_buff *skb, unsigned int hlen, +-+ int offset, int len) +-+{ +-+ struct sk_buff *frame; +-+ +-+ if (skb->len - offset < len) +-+ return NULL; +-+ +-+ /* +-+ * 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); +-+ +-+ 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-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 +deleted file mode 100644 +index c4155a1..0000000 +--- a/package/kernel/mac80211/patches/321-mac80211-Parse-legacy-and-HT-rate-in-injected-frames.patch ++++ /dev/null +@@ -1,155 +0,0 @@ +-From: Sven Eckelmann +-Date: Tue, 26 Jan 2016 17:11:13 +0100 +-Subject: [PATCH] mac80211: Parse legacy and HT rate in injected frames +- +-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"). +- +-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/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/net/mac80211/tx.c +-+++ b/net/mac80211/tx.c +-@@ -710,6 +710,10 @@ ieee80211_tx_h_rate_ctrl(struct ieee8021 +- +- 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; +-+ +- 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); +- } +- +--static bool ieee80211_parse_tx_radiotap(struct sk_buff *skb) +-+static bool ieee80211_parse_tx_radiotap(struct ieee80211_local *local, +-+ struct sk_buff *skb) +- { +- 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-mac80211-add-A-MSDU-tx-support.patch b/package/kernel/mac80211/patches/322-mac80211-add-A-MSDU-tx-support.patch +deleted file mode 100644 +index e7bfb9c..0000000 +--- a/package/kernel/mac80211/patches/322-mac80211-add-A-MSDU-tx-support.patch ++++ /dev/null +@@ -1,317 +0,0 @@ +-From: Felix Fietkau +-Date: Fri, 5 Feb 2016 01:38:51 +0100 +-Subject: [PATCH] mac80211: add A-MSDU tx support +- +-Requires software tx queueing support. frag_list support (for zero-copy) +-is optional. +- +-Signed-off-by: Felix Fietkau +---- +- +---- 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), +- }; +- +- /* +-@@ -1728,6 +1730,7 @@ struct ieee80211_sta_rates { +- * size is min(max_amsdu_len, 7935) bytes. +- * Both additional HT limits must be enforced by the low level driver. +- * This is defined by the spec (IEEE 802.11-2012 section 8.3.2.2 NOTE 2). +-+ * @max_rc_amsdu_len: Maximum A-MSDU size in bytes recommended by rate control. +- * @txq: per-TID data TX queues (if driver uses the TXQ abstraction) +- */ +- struct ieee80211_sta { +-@@ -1748,6 +1751,7 @@ struct ieee80211_sta { +- bool mfp; +- u8 max_amsdu_subframes; +- u16 max_amsdu_len; +-+ u16 max_rc_amsdu_len; +- +- struct ieee80211_txq *txq[IEEE80211_NUM_TIDS]; +- +-@@ -1961,6 +1965,15 @@ 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 and fast-xmit support. +-+ * When not using minstrel/minstrel_ht rate control, the driver should +-+ * limit the maximum A-MSDU size based on the current tx rate by setting +-+ * max_rc_amsdu_len in struct ieee80211_sta. +-+ * +-+ * @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 +2011,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 +2085,9 @@ 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 number of tx buffers per (A)-MSDU, sum +-+ * of 1 + skb_shinfo(skb)->nr_frags for each skb in the frag_list. +-+ * +- * @offchannel_tx_hw_queue: HW queue ID to use for offchannel TX +- * (if %IEEE80211_HW_QUEUE_CONTROL is set) +- * +-@@ -2124,6 +2142,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,163 @@ void ieee80211_clear_fast_xmit(struct st +- kfree_rcu(fast_tx, rcu_head); +- } +- +-+static bool ieee80211_amsdu_realloc_pad(struct ieee80211_local *local, +-+ struct sk_buff *skb, int headroom, +-+ int *subframe_len) +-+{ +-+ int amsdu_len = *subframe_len + sizeof(struct ethhdr); +-+ int padding = (4 - amsdu_len) & 3; +-+ +-+ if (skb_headroom(skb) < headroom || skb_tailroom(skb) < padding) { +-+ I802_DEBUG_INC(local->tx_expand_skb_head); +-+ +-+ if (pskb_expand_head(skb, headroom, padding, GFP_ATOMIC)) { +-+ wiphy_debug(local->hw.wiphy, +-+ "failed to reallocate TX buffer\n"); +-+ return false; +-+ } +-+ } +-+ +-+ if (padding) { +-+ *subframe_len += padding; +-+ memset(skb_put(skb, padding), 0, padding); +-+ } +-+ +-+ return true; +-+} +-+ +-+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->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE) +-+ return false; +-+ +-+ if (info->control.flags & IEEE80211_TX_CTRL_AMSDU) +-+ return true; +-+ +-+ if (!ieee80211_amsdu_realloc_pad(local, skb, sizeof(amsdu_hdr), +-+ &subframe_len)) +-+ return false; +-+ +-+ 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 = sta->sta.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; +-+ +-+ if (sta->sta.max_rc_amsdu_len) +-+ max_amsdu_len = min_t(int, max_amsdu_len, +-+ sta->sta.max_rc_amsdu_len); +-+ +-+ 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 (!ieee80211_amsdu_realloc_pad(local, skb, sizeof(rfc1042_header) + 2, +-+ &subframe_len)) +-+ return false; +-+ +-+ 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, sizeof(rfc1042_header)); +-+ +-+ 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 +2972,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-0000-brcmfmac-fix-setting-primary-channel-for-80-MHz-widt.patch b/package/kernel/mac80211/patches/323-0000-brcmfmac-fix-setting-primary-channel-for-80-MHz-widt.patch +deleted file mode 100644 +index 9277b2c..0000000 +--- a/package/kernel/mac80211/patches/323-0000-brcmfmac-fix-setting-primary-channel-for-80-MHz-widt.patch ++++ /dev/null +@@ -1,64 +0,0 @@ +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Wed, 20 Jan 2016 16:46:04 +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 +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-@@ -247,7 +247,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: +-@@ -256,24 +256,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/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 +deleted file mode 100644 +index d7018da..0000000 +--- a/package/kernel/mac80211/patches/323-0001-brcmfmac-analyze-descriptors-of-current-component-on.patch ++++ /dev/null +@@ -1,51 +0,0 @@ +-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 +deleted file mode 100644 +index 045ab49..0000000 +--- a/package/kernel/mac80211/patches/323-0002-brcmfmac-allow-storing-PMU-core-without-wrapper-addr.patch ++++ /dev/null +@@ -1,28 +0,0 @@ +-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 +deleted file mode 100644 +index 7b7ba4f..0000000 +--- a/package/kernel/mac80211/patches/323-0003-brcmfmac-read-extended-capabilities-of-ChipCommon-co.patch ++++ /dev/null +@@ -1,43 +0,0 @@ +-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 +deleted file mode 100644 +index 2af6fd9..0000000 +--- a/package/kernel/mac80211/patches/323-0004-brcmfmac-access-PMU-registers-using-standalone-PMU-c.patch ++++ /dev/null +@@ -1,148 +0,0 @@ +-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 +deleted file mode 100644 +index 35887fc..0000000 +--- a/package/kernel/mac80211/patches/323-0005-brcmfmac-add-support-for-14e4-4365-PCI-ID-with-BCM43.patch ++++ /dev/null +@@ -1,38 +0,0 @@ +-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/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 +deleted file mode 100644 +index 6ce60f1..0000000 +--- a/package/kernel/mac80211/patches/324-brcmfmac-treat-NULL-character-in-NVRAM-as-separator.patch ++++ /dev/null +@@ -1,32 +0,0 @@ +-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 +- +-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. +- +-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/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-brcmfmac-sdio-Increase-the-default-timeouts-a-bit.patch b/package/kernel/mac80211/patches/325-brcmfmac-sdio-Increase-the-default-timeouts-a-bit.patch +deleted file mode 100644 +index 012dea1..0000000 +--- a/package/kernel/mac80211/patches/325-brcmfmac-sdio-Increase-the-default-timeouts-a-bit.patch ++++ /dev/null +@@ -1,41 +0,0 @@ +-From: Sjoerd Simons +-Date: Mon, 25 Jan 2016 11:47:29 +0100 +-Subject: [PATCH] brcmfmac: sdio: Increase the default timeouts a bit +- +-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. +- +-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/broadcom/brcm80211/brcmfmac/sdio.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +-@@ -45,8 +45,8 @@ +- #include "chip.h" +- #include "firmware.h" +- +--#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) +- +- #ifdef DEBUG +- +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 +deleted file mode 100644 +index 71f7a40..0000000 +--- a/package/kernel/mac80211/patches/326-ath9k-make-NF-load-complete-quickly-and-reliably.patch ++++ /dev/null +@@ -1,87 +0,0 @@ +-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 (ah->caldata) +- h = ah->caldata->nfCalHist; +-@@ -264,6 +265,16 @@ int ath9k_hw_loadnf(struct ath_hw *ah, s +- } +- +- /* +-+ * stop NF cal if ongoing to ensure NF load completes immediately +-+ * (or after end rx/tx frame if ongoing) +-+ */ +-+ 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/327-mac80211-Remove-MPP-table-entries-with-MPath.patch b/package/kernel/mac80211/patches/327-mac80211-Remove-MPP-table-entries-with-MPath.patch +deleted file mode 100644 +index f7f9df9..0000000 +--- a/package/kernel/mac80211/patches/327-mac80211-Remove-MPP-table-entries-with-MPath.patch ++++ /dev/null +@@ -1,54 +0,0 @@ +-From: Henning Rogge +-Date: Wed, 3 Feb 2016 13:58:36 +0100 +-Subject: [PATCH] mac80211: Remove MPP table entries with MPath +- +-Make the mesh_path_del() function remove all mpp table entries +-that are proxied by the removed mesh path. +- +-Acked-by: Bob Copeland +-Signed-off-by: Henning Rogge +-Signed-off-by: Johannes Berg +---- +- +---- 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(); +- } +- +-+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; +-+ +-+ 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(); +-+} +-+ +- 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-mac80211-let-unused-MPP-table-entries-timeout.patch b/package/kernel/mac80211/patches/328-mac80211-let-unused-MPP-table-entries-timeout.patch +deleted file mode 100644 +index 740993c..0000000 +--- a/package/kernel/mac80211/patches/328-mac80211-let-unused-MPP-table-entries-timeout.patch ++++ /dev/null +@@ -1,104 +0,0 @@ +-From: Henning Rogge +-Date: Wed, 3 Feb 2016 13:58:37 +0100 +-Subject: [PATCH] mac80211: let unused MPP table entries timeout +- +-Remember the last time when a mpp table entry is used for +-rx or tx and remove them after MESH_PATH_EXPIRE time. +- +-Acked-by: Bob Copeland +-Signed-off-by: Henning Rogge +-Signed-off-by: Johannes Berg +---- +- +---- a/net/mac80211/mesh_pathtbl.c +-+++ b/net/mac80211/mesh_pathtbl.c +-@@ -942,6 +942,46 @@ enddel: +- } +- +- /** +-+ * 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); +- } +-+ +-+ 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-mac80211-Unify-mesh-and-mpp-path-removal-function.patch b/package/kernel/mac80211/patches/329-mac80211-Unify-mesh-and-mpp-path-removal-function.patch +deleted file mode 100644 +index 0c36b1d..0000000 +--- a/package/kernel/mac80211/patches/329-mac80211-Unify-mesh-and-mpp-path-removal-function.patch ++++ /dev/null +@@ -1,143 +0,0 @@ +-From: Henning Rogge +-Date: Wed, 3 Feb 2016 13:58:38 +0100 +-Subject: [PATCH] mac80211: Unify mesh and mpp path removal function +- +-mpp_path_del() and mesh_path_del() are mostly the same function. +-Move common code into a new static function. +- +-Acked-by: Bob Copeland +-Signed-off-by: Henning Rogge +-Signed-off-by: Johannes Berg +---- +- +---- 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); +- +- +-+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) +- { +-- return rcu_dereference_protected(mesh_paths, +-- lockdep_is_held(&pathtbl_resize_lock)); +-+ return resize_dereference_paths(mesh_paths); +- } +- +- 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; +- } +- +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 +deleted file mode 100644 +index 4dc6d66..0000000 +--- a/package/kernel/mac80211/patches/330-mac80211-minstrel-Change-expected-throughput-unit-ba.patch ++++ /dev/null +@@ -1,51 +0,0 @@ +-From: Sven Eckelmann +-Date: Tue, 2 Feb 2016 08:12:26 +0100 +-Subject: [PATCH] mac80211: minstrel: Change expected throughput unit back to +- Kbps +- +-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: +- +- 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/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; +- +- 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; +- } +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 +deleted file mode 100644 +index 1fd016f..0000000 +--- a/package/kernel/mac80211/patches/331-brcmfmac-Increase-nr-of-supported-flowrings.patch ++++ /dev/null +@@ -1,307 +0,0 @@ +-From: Hante Meuleman +-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 +- +-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 +- +-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/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 +- +--#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 +- } +- 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 +- } +- +- +--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 +- } +- +- +--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; +- }; +- +- 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 void brcmf_msgbuf_txflow(struct brcmf_msgbuf *msgbuf, u8 flowid) +-+static void brcmf_msgbuf_txflow(struct brcmf_msgbuf *msgbuf, u16 flowid) +- { +- struct brcmf_flowring *flow = msgbuf->flow; +- struct brcmf_commonring *commonring; +-@@ -1310,7 +1310,7 @@ int brcmf_proto_msgbuf_rx_trigger(struct +- } +- +- +--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; +- +- 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 @@ +- +- +- 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-cfg80211-fix-faulty-variable-initialization-in-ieee8.patch b/package/kernel/mac80211/patches/332-cfg80211-fix-faulty-variable-initialization-in-ieee8.patch +deleted file mode 100644 +index e414f23..0000000 +--- a/package/kernel/mac80211/patches/332-cfg80211-fix-faulty-variable-initialization-in-ieee8.patch ++++ /dev/null +@@ -1,22 +0,0 @@ +-From: Felix Fietkau +-Date: Mon, 8 Feb 2016 14:24:36 +0100 +-Subject: [PATCH] cfg80211: fix faulty variable initialization in +- ieee80211_amsdu_to_8023s +- +-reuse_skb is set to true if the code decides to use the last segment. +-Fixes a memory leak +- +-Signed-off-by: Felix Fietkau +---- +- +---- 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 (has_80211_header) { +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 +deleted file mode 100644 +index 6e2d0cf..0000000 +--- a/package/kernel/mac80211/patches/333-cfg80211-reuse-existing-page-fragments-in-A-MSDU-rx.patch ++++ /dev/null +@@ -1,132 +0,0 @@ +-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-mac80211-fix-wiphy-supported_band-access.patch b/package/kernel/mac80211/patches/334-mac80211-fix-wiphy-supported_band-access.patch +deleted file mode 100644 +index f8f4f09..0000000 +--- a/package/kernel/mac80211/patches/334-mac80211-fix-wiphy-supported_band-access.patch ++++ /dev/null +@@ -1,36 +0,0 @@ +-From: Lorenzo Bianconi +-Date: Wed, 10 Feb 2016 16:08:17 +0100 +-Subject: [PATCH] mac80211: fix wiphy supported_band access +- +-Fix wiphy supported_band access in tx radiotap parsing. In particular, +-info->band is always set to 0 (IEEE80211_BAND_2GHZ) since it has not +-assigned yet. This cause a kernel crash on 5GHz only devices. +-Move ieee80211_parse_tx_radiotap() after info->band assignment +- +-Signed-off-by: Lorenzo Bianconi +---- +- +---- a/net/mac80211/tx.c +-+++ b/net/mac80211/tx.c +-@@ -1890,10 +1890,6 @@ netdev_tx_t ieee80211_monitor_start_xmit +- info->flags = IEEE80211_TX_CTL_REQ_TX_STATUS | +- IEEE80211_TX_CTL_INJECTED; +- +-- /* process and remove the injection radiotap header */ +-- if (!ieee80211_parse_tx_radiotap(local, skb)) +-- goto fail; +-- +- rcu_read_lock(); +- +- /* +-@@ -1955,6 +1951,10 @@ netdev_tx_t ieee80211_monitor_start_xmit +- goto fail_rcu; +- +- info->band = chandef->chan->band; +-+ /* process and remove the injection radiotap header */ +-+ if (!ieee80211_parse_tx_radiotap(local, skb)) +-+ goto fail_rcu; +-+ +- ieee80211_xmit(sdata, NULL, skb); +- rcu_read_unlock(); +- +diff --git a/package/kernel/mac80211/patches/335-mac80211-minstrel_ht-set-A-MSDU-tx-limits-based-on-s.patch b/package/kernel/mac80211/patches/335-mac80211-minstrel_ht-set-A-MSDU-tx-limits-based-on-s.patch +deleted file mode 100644 +index acaacf7..0000000 +--- a/package/kernel/mac80211/patches/335-mac80211-minstrel_ht-set-A-MSDU-tx-limits-based-on-s.patch ++++ /dev/null +@@ -1,61 +0,0 @@ +-From: Felix Fietkau +-Date: Thu, 18 Feb 2016 19:30:05 +0100 +-Subject: [PATCH] mac80211: minstrel_ht: set A-MSDU tx limits based on selected +- max_prob_rate +- +-Prevents excessive A-MSDU aggregation at low data rates or bad +-conditions. +- +-Signed-off-by: Felix Fietkau +---- +- +---- a/net/mac80211/rc80211_minstrel_ht.c +-+++ b/net/mac80211/rc80211_minstrel_ht.c +-@@ -883,6 +883,39 @@ minstrel_ht_set_rate(struct minstrel_pri +- ratetbl->rate[offset].flags = flags; +- } +- +-+static int +-+minstrel_ht_get_max_amsdu_len(struct minstrel_ht_sta *mi) +-+{ +-+ int group = mi->max_prob_rate / MCS_GROUP_RATES; +-+ const struct mcs_group *g = &minstrel_mcs_groups[group]; +-+ int rate = mi->max_prob_rate % MCS_GROUP_RATES; +-+ +-+ /* Disable A-MSDU if max_prob_rate is bad */ +-+ if (mi->groups[group].rates[rate].prob_ewma < MINSTREL_FRAC(50, 100)) +-+ return 1; +-+ +-+ /* If the rate is slower than single-stream MCS1, make A-MSDU limit small */ +-+ if (g->duration[rate] > MCS_DURATION(1, 0, 52)) +-+ return 500; +-+ +-+ /* +-+ * If the rate is slower than single-stream MCS4, limit A-MSDU to usual +-+ * data packet size +-+ */ +-+ if (g->duration[rate] > MCS_DURATION(1, 0, 104)) +-+ return 1500; +-+ +-+ /* +-+ * If the rate is slower than single-stream MCS7, limit A-MSDU to twice +-+ * the usual data packet size +-+ */ +-+ if (g->duration[rate] > MCS_DURATION(1, 0, 260)) +-+ return 3000; +-+ +-+ /* unlimited */ +-+ return 0; +-+} +-+ +- static void +- minstrel_ht_update_rates(struct minstrel_priv *mp, struct minstrel_ht_sta *mi) +- { +-@@ -907,6 +940,7 @@ minstrel_ht_update_rates(struct minstrel +- minstrel_ht_set_rate(mp, mi, rates, i++, mi->max_prob_rate); +- } +- +-+ mi->sta->max_rc_amsdu_len = minstrel_ht_get_max_amsdu_len(mi); +- rates->rate[i].idx = -1; +- rate_control_set_rates(mp->hw, mi->sta, rates); +- } +diff --git a/package/kernel/mac80211/patches/336-mac80211-minstrel_ht-set-default-tx-aggregation-time.patch b/package/kernel/mac80211/patches/336-mac80211-minstrel_ht-set-default-tx-aggregation-time.patch +deleted file mode 100644 +index 32a2ad6..0000000 +--- a/package/kernel/mac80211/patches/336-mac80211-minstrel_ht-set-default-tx-aggregation-time.patch ++++ /dev/null +@@ -1,31 +0,0 @@ +-From: Felix Fietkau +-Date: Thu, 18 Feb 2016 19:45:33 +0100 +-Subject: [PATCH] mac80211: minstrel_ht: set default tx aggregation timeout to +- 0 +- +-The value 5000 was put here with the addition of the timeout field to +-ieee80211_start_tx_ba_session. It was originally added in mac80211 to +-save resources for drivers like iwlwifi, which only supports a limited +-number of concurrent aggregation sessions. +- +-Since iwlwifi does not use minstrel_ht and other drivers don't need +-this, 0 is a better default - especially since there have been +-recent reports of aggregation setup related issues reproduced with +-ath9k. This should improve stability without causing any adverse +-effects. +- +-Cc: stable@vger.kernel.org +-Signed-off-by: Felix Fietkau +---- +- +---- a/net/mac80211/rc80211_minstrel_ht.c +-+++ b/net/mac80211/rc80211_minstrel_ht.c +-@@ -692,7 +692,7 @@ minstrel_aggr_check(struct ieee80211_sta +- if (likely(sta->ampdu_mlme.tid_tx[tid])) +- return; +- +-- ieee80211_start_tx_ba_session(pubsta, tid, 5000); +-+ ieee80211_start_tx_ba_session(pubsta, tid, 0); +- } +- +- static void +diff --git a/package/kernel/mac80211/patches/337-mac80211-minstrel_ht-fix-a-logic-error-in-RTS-CTS-ha.patch b/package/kernel/mac80211/patches/337-mac80211-minstrel_ht-fix-a-logic-error-in-RTS-CTS-ha.patch +deleted file mode 100644 +index 229351b..0000000 +--- a/package/kernel/mac80211/patches/337-mac80211-minstrel_ht-fix-a-logic-error-in-RTS-CTS-ha.patch ++++ /dev/null +@@ -1,26 +0,0 @@ +-From: Felix Fietkau +-Date: Wed, 24 Feb 2016 12:03:13 +0100 +-Subject: [PATCH] mac80211: minstrel_ht: fix a logic error in RTS/CTS handling +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-RTS/CTS needs to be enabled if the rate is a fallback rate *or* if it's +-a dual-stream rate and the sta is in dynamic SMPS mode. +- +-Fixes: a3ebb4e1b763 ("mac80211: minstrel_ht: handle peers in dynamic SMPS") +-Reported-by: Matías Richart +-Signed-off-by: Felix Fietkau +---- +- +---- a/net/mac80211/rc80211_minstrel_ht.c +-+++ b/net/mac80211/rc80211_minstrel_ht.c +-@@ -872,7 +872,7 @@ minstrel_ht_set_rate(struct minstrel_pri +- * - if station is in dynamic SMPS (and streams > 1) +- * - for fallback rates, to increase chances of getting through +- */ +-- if (offset > 0 && +-+ if (offset > 0 || +- (mi->sta->smps_mode == IEEE80211_SMPS_DYNAMIC && +- group->streams > 1)) { +- ratetbl->rate[offset].count = ratetbl->rate[offset].count_rts; +diff --git a/package/kernel/mac80211/patches/338-mac80211-Fix-Public-Action-frame-RX-in-AP-mode.patch b/package/kernel/mac80211/patches/338-mac80211-Fix-Public-Action-frame-RX-in-AP-mode.patch +deleted file mode 100644 +index 56cd94a..0000000 +--- a/package/kernel/mac80211/patches/338-mac80211-Fix-Public-Action-frame-RX-in-AP-mode.patch ++++ /dev/null +@@ -1,35 +0,0 @@ +-From: Jouni Malinen +-Date: Tue, 1 Mar 2016 00:29:00 +0200 +-Subject: [PATCH] mac80211: Fix Public Action frame RX in AP mode +- +-Public Action frames use special rules for how the BSSID field (Address +-3) is set. A wildcard BSSID is used in cases where the transmitter and +-recipient are not members of the same BSS. As such, we need to accept +-Public Action frames with wildcard BSSID. +- +-Commit db8e17324553 ("mac80211: ignore frames between TDLS peers when +-operating as AP") added a rule that drops Action frames to TDLS-peers +-based on an Action frame having different DA (Address 1) and BSSID +-(Address 3) values. This is not correct since it misses the possibility +-of BSSID being a wildcard BSSID in which case the Address 1 would not +-necessarily match. +- +-Fix this by allowing mac80211 to accept wildcard BSSID in an Action +-frame when in AP mode. +- +-Fixes: db8e17324553 ("mac80211: ignore frames between TDLS peers when operating as AP") +-Cc: stable@vger.kernel.org +-Signed-off-by: Jouni Malinen +-Signed-off-by: Johannes Berg +---- +- +---- a/net/mac80211/rx.c +-+++ b/net/mac80211/rx.c +-@@ -3374,6 +3374,7 @@ static bool ieee80211_accept_frame(struc +- return false; +- /* ignore action frames to TDLS-peers */ +- if (ieee80211_is_action(hdr->frame_control) && +-+ !is_broadcast_ether_addr(bssid) && +- !ether_addr_equal(bssid, hdr->addr1)) +- return false; +- } +diff --git a/package/kernel/mac80211/patches/339-cfg80211-add-radiotap-VHT-info-to-rtap_namespace_siz.patch b/package/kernel/mac80211/patches/339-cfg80211-add-radiotap-VHT-info-to-rtap_namespace_siz.patch +deleted file mode 100644 +index 15d6cd0..0000000 +--- a/package/kernel/mac80211/patches/339-cfg80211-add-radiotap-VHT-info-to-rtap_namespace_siz.patch ++++ /dev/null +@@ -1,21 +0,0 @@ +-From: Lorenzo Bianconi +-Date: Fri, 19 Feb 2016 11:43:04 +0100 +-Subject: [PATCH] cfg80211: add radiotap VHT info to rtap_namespace_sizes +- +-Add IEEE80211_RADIOTAP_VHT entry to rtap_namespace_sizes array in order to +-define alignment and size of VHT info in tx radiotap +- +-Signed-off-by: Lorenzo Bianconi +-Signed-off-by: Johannes Berg +---- +- +---- a/net/wireless/radiotap.c +-+++ b/net/wireless/radiotap.c +-@@ -43,6 +43,7 @@ static const struct radiotap_align_size +- [IEEE80211_RADIOTAP_DATA_RETRIES] = { .align = 1, .size = 1, }, +- [IEEE80211_RADIOTAP_MCS] = { .align = 1, .size = 3, }, +- [IEEE80211_RADIOTAP_AMPDU_STATUS] = { .align = 4, .size = 8, }, +-+ [IEEE80211_RADIOTAP_VHT] = { .align = 2, .size = 12, }, +- /* +- * add more here as they are defined in radiotap.h +- */ +diff --git a/package/kernel/mac80211/patches/340-mac80211-fix-parsing-of-40Mhz-in-injected-radiotap-h.patch b/package/kernel/mac80211/patches/340-mac80211-fix-parsing-of-40Mhz-in-injected-radiotap-h.patch +deleted file mode 100644 +index de1b386..0000000 +--- a/package/kernel/mac80211/patches/340-mac80211-fix-parsing-of-40Mhz-in-injected-radiotap-h.patch ++++ /dev/null +@@ -1,36 +0,0 @@ +-From: Sven Eckelmann +-Date: Wed, 24 Feb 2016 16:25:49 +0100 +-Subject: [PATCH] mac80211: fix parsing of 40Mhz in injected radiotap +- header +- +-The MCS bandwidth part of the radiotap header is 2 bits wide. The full 2 +-bit have to compared against IEEE80211_RADIOTAP_MCS_BW_40 and not only if +-the first bit is set. Otherwise IEEE80211_RADIOTAP_MCS_BW_40 can be +-confused with IEEE80211_RADIOTAP_MCS_BW_20U. +- +-Fixes: 5ec3aed9ba4c ("mac80211: Parse legacy and HT rate in injected frames") +-Signed-off-by: Sven Eckelmann +---- +- +---- a/net/mac80211/tx.c +-+++ b/net/mac80211/tx.c +-@@ -1689,7 +1689,7 @@ static bool ieee80211_parse_tx_radiotap( +- bool rate_found = false; +- u8 rate_retries = 0; +- u16 rate_flags = 0; +-- u8 mcs_known, mcs_flags; +-+ u8 mcs_known, mcs_flags, mcs_bw; +- int i; +- +- info->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT | +-@@ -1765,8 +1765,9 @@ static bool ieee80211_parse_tx_radiotap( +- mcs_flags & IEEE80211_RADIOTAP_MCS_SGI) +- rate_flags |= IEEE80211_TX_RC_SHORT_GI; +- +-+ mcs_bw = mcs_flags & IEEE80211_RADIOTAP_MCS_BW_MASK; +- if (mcs_known & IEEE80211_RADIOTAP_MCS_HAVE_BW && +-- mcs_flags & IEEE80211_RADIOTAP_MCS_BW_40) +-+ mcs_bw == IEEE80211_RADIOTAP_MCS_BW_40) +- rate_flags |= IEEE80211_TX_RC_40_MHZ_WIDTH; +- break; +- +diff --git a/package/kernel/mac80211/patches/341-mac80211-parse-VHT-info-in-injected-frames.patch b/package/kernel/mac80211/patches/341-mac80211-parse-VHT-info-in-injected-frames.patch +deleted file mode 100644 +index ac1f251..0000000 +--- a/package/kernel/mac80211/patches/341-mac80211-parse-VHT-info-in-injected-frames.patch ++++ /dev/null +@@ -1,65 +0,0 @@ +-From: Lorenzo Bianconi +-Date: Tue, 23 Feb 2016 15:43:35 +0100 +-Subject: [PATCH] mac80211: parse VHT info in injected frames +- +-Add VHT radiotap parsing support to ieee80211_parse_tx_radiotap(). +-That capability has been tested using a d-link dir-860l rev b1 running +-OpenWrt trunk and mt76 driver +- +-Signed-off-by: Lorenzo Bianconi +---- +- +---- a/net/mac80211/tx.c +-+++ b/net/mac80211/tx.c +-@@ -1690,6 +1690,8 @@ static bool ieee80211_parse_tx_radiotap( +- u8 rate_retries = 0; +- u16 rate_flags = 0; +- u8 mcs_known, mcs_flags, mcs_bw; +-+ u16 vht_known; +-+ u8 vht_mcs = 0, vht_nss = 0; +- int i; +- +- info->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT | +-@@ -1771,6 +1773,32 @@ static bool ieee80211_parse_tx_radiotap( +- rate_flags |= IEEE80211_TX_RC_40_MHZ_WIDTH; +- break; +- +-+ case IEEE80211_RADIOTAP_VHT: +-+ vht_known = get_unaligned_le16(iterator.this_arg); +-+ rate_found = true; +-+ +-+ rate_flags = IEEE80211_TX_RC_VHT_MCS; +-+ if ((vht_known & IEEE80211_RADIOTAP_VHT_KNOWN_GI) && +-+ (iterator.this_arg[2] & +-+ IEEE80211_RADIOTAP_VHT_FLAG_SGI)) +-+ rate_flags |= IEEE80211_TX_RC_SHORT_GI; +-+ if (vht_known & +-+ IEEE80211_RADIOTAP_VHT_KNOWN_BANDWIDTH) { +-+ if (iterator.this_arg[3] == 1) +-+ rate_flags |= +-+ IEEE80211_TX_RC_40_MHZ_WIDTH; +-+ else if (iterator.this_arg[3] == 4) +-+ rate_flags |= +-+ IEEE80211_TX_RC_80_MHZ_WIDTH; +-+ else if (iterator.this_arg[3] == 11) +-+ rate_flags |= +-+ IEEE80211_TX_RC_160_MHZ_WIDTH; +-+ } +-+ +-+ vht_mcs = iterator.this_arg[4] >> 4; +-+ vht_nss = iterator.this_arg[4] & 0xF; +-+ break; +-+ +- /* +- * Please update the file +- * Documentation/networking/mac80211-injection.txt +-@@ -1796,6 +1824,9 @@ static bool ieee80211_parse_tx_radiotap( +- +- if (rate_flags & IEEE80211_TX_RC_MCS) { +- info->control.rates[0].idx = rate; +-+ } else if (rate_flags & IEEE80211_TX_RC_VHT_MCS) { +-+ ieee80211_rate_set_vht(info->control.rates, vht_mcs, +-+ vht_nss); +- } else { +- for (i = 0; i < sband->n_bitrates; i++) { +- if (rate * 5 != sband->bitrates[i].bitrate) +diff --git a/package/kernel/mac80211/patches/342-mac80211-do-not-pass-injected-frames-without-a-valid.patch b/package/kernel/mac80211/patches/342-mac80211-do-not-pass-injected-frames-without-a-valid.patch +deleted file mode 100644 +index d7452c2..0000000 +--- a/package/kernel/mac80211/patches/342-mac80211-do-not-pass-injected-frames-without-a-valid.patch ++++ /dev/null +@@ -1,23 +0,0 @@ +-From: Felix Fietkau +-Date: Wed, 2 Mar 2016 15:51:40 +0100 +-Subject: [PATCH] mac80211: do not pass injected frames without a valid rate to +- the driver +- +-Fall back to rate control if the requested bitrate was not found. +- +-Fixes: dfdfc2beb0dd ("mac80211: Parse legacy and HT rate in injected frames") +-Signed-off-by: Felix Fietkau +---- +- +---- a/net/mac80211/tx.c +-+++ b/net/mac80211/tx.c +-@@ -1837,6 +1837,9 @@ static bool ieee80211_parse_tx_radiotap( +- } +- } +- +-+ if (info->control.rates[0].idx < 0) +-+ info->control.flags &= ~IEEE80211_TX_CTRL_RATE_INJECT; +-+ +- info->control.rates[0].flags = rate_flags; +- info->control.rates[0].count = min_t(u8, rate_retries + 1, +- local->hw.max_rate_tries); +diff --git a/package/kernel/mac80211/patches/343-mac80211-minstrel_ht-improve-sample-rate-skip-logic.patch b/package/kernel/mac80211/patches/343-mac80211-minstrel_ht-improve-sample-rate-skip-logic.patch +deleted file mode 100644 +index 55ff817..0000000 +--- a/package/kernel/mac80211/patches/343-mac80211-minstrel_ht-improve-sample-rate-skip-logic.patch ++++ /dev/null +@@ -1,77 +0,0 @@ +-From: Felix Fietkau +-Date: Thu, 3 Mar 2016 23:20:06 +0100 +-Subject: [PATCH] mac80211: minstrel_ht: improve sample rate skip logic +- +-There were a few issues that were slowing down the process of finding +-the optimal rate, especially on devices with multi-rate retry +-limitations: +- +-When max_tp_rate[0] was slower than max_tp_rate[1], the code did not +-sample max_tp_rate[1], which would often allow it to switch places with +-max_tp_rate[0] (e.g. if only the first sampling attempts were bad, but the +-rate is otherwise good). +- +-Also, sample attempts of rates between max_tp_rate[0] and [1] were being +-ignored in this case, because the code only checked if the rate was +-slower than [1]. +- +-Fix this by checking against the fastest / second fastest max_tp_rate +-instead of assuming a specific order between the two. +- +-In my tests this patch significantly reduces the time until minstrel_ht +-finds the optimal rate right after assoc +- +-Signed-off-by: Felix Fietkau +---- +- +---- a/net/mac80211/rc80211_minstrel_ht.c +-+++ b/net/mac80211/rc80211_minstrel_ht.c +-@@ -958,6 +958,7 @@ minstrel_get_sample_rate(struct minstrel +- struct minstrel_rate_stats *mrs; +- struct minstrel_mcs_group_data *mg; +- unsigned int sample_dur, sample_group, cur_max_tp_streams; +-+ int tp_rate1, tp_rate2; +- int sample_idx = 0; +- +- if (mi->sample_wait > 0) { +-@@ -979,14 +980,22 @@ minstrel_get_sample_rate(struct minstrel +- mrs = &mg->rates[sample_idx]; +- sample_idx += sample_group * MCS_GROUP_RATES; +- +-+ /* Set tp_rate1, tp_rate2 to the highest / second highest max_tp_rate */ +-+ if (minstrel_get_duration(mi->max_tp_rate[0]) > +-+ minstrel_get_duration(mi->max_tp_rate[1])) { +-+ tp_rate1 = mi->max_tp_rate[1]; +-+ tp_rate2 = mi->max_tp_rate[0]; +-+ } else { +-+ tp_rate1 = mi->max_tp_rate[0]; +-+ tp_rate2 = mi->max_tp_rate[1]; +-+ } +-+ +- /* +- * Sampling might add some overhead (RTS, no aggregation) +-- * to the frame. Hence, don't use sampling for the currently +-- * used rates. +-+ * to the frame. Hence, don't use sampling for the highest currently +-+ * used highest throughput or probability rate. +- */ +-- if (sample_idx == mi->max_tp_rate[0] || +-- sample_idx == mi->max_tp_rate[1] || +-- sample_idx == mi->max_prob_rate) +-+ if (sample_idx == mi->max_tp_rate[0] || sample_idx == mi->max_prob_rate) +- return -1; +- +- /* +-@@ -1001,10 +1010,10 @@ minstrel_get_sample_rate(struct minstrel +- * if the link is working perfectly. +- */ +- +-- cur_max_tp_streams = minstrel_mcs_groups[mi->max_tp_rate[0] / +-+ cur_max_tp_streams = minstrel_mcs_groups[tp_rate1 / +- MCS_GROUP_RATES].streams; +- sample_dur = minstrel_get_duration(sample_idx); +-- if (sample_dur >= minstrel_get_duration(mi->max_tp_rate[1]) && +-+ if (sample_dur >= minstrel_get_duration(tp_rate2) && +- (cur_max_tp_streams - 1 < +- minstrel_mcs_groups[sample_group].streams || +- sample_dur >= minstrel_get_duration(mi->max_prob_rate))) { +diff --git a/package/kernel/mac80211/patches/344-0008-brcmfmac-use-device-memsize-config-from-fw-if-define.patch b/package/kernel/mac80211/patches/344-0008-brcmfmac-use-device-memsize-config-from-fw-if-define.patch +deleted file mode 100644 +index 3de0f64..0000000 +--- a/package/kernel/mac80211/patches/344-0008-brcmfmac-use-device-memsize-config-from-fw-if-define.patch ++++ /dev/null +@@ -1,73 +0,0 @@ +-From: Hante Meuleman +-Date: Wed, 17 Feb 2016 11:26:57 +0100 +-Subject: [PATCH] brcmfmac: use device memsize config from fw if defined +- +-Newer type pcie devices have memory which get shared between fw and +-hw. The division of this memory is done firmware compile time. As a +-result the ramsize as used by driver needs to be adjusted for this. +-This is done by reading the memory size from the firmware. +- +-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/broadcom/brcm80211/brcmfmac/pcie.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +-@@ -207,6 +207,10 @@ static struct brcmf_firmware_mapping brc +- #define BRCMF_PCIE_CFGREG_REG_BAR3_CONFIG 0x4F4 +- #define BRCMF_PCIE_LINK_STATUS_CTRL_ASPM_ENAB 3 +- +-+/* Magic number at a magic location to find RAM size */ +-+#define BRCMF_RAMSIZE_MAGIC 0x534d4152 /* SMAR */ +-+#define BRCMF_RAMSIZE_OFFSET 0x6c +-+ +- +- struct brcmf_pcie_console { +- u32 base_addr; +-@@ -1412,6 +1416,28 @@ static const struct brcmf_bus_ops brcmf_ +- }; +- +- +-+static void +-+brcmf_pcie_adjust_ramsize(struct brcmf_pciedev_info *devinfo, u8 *data, +-+ u32 data_len) +-+{ +-+ __le32 *field; +-+ u32 newsize; +-+ +-+ if (data_len < BRCMF_RAMSIZE_OFFSET + 8) +-+ return; +-+ +-+ field = (__le32 *)&data[BRCMF_RAMSIZE_OFFSET]; +-+ if (le32_to_cpup(field) != BRCMF_RAMSIZE_MAGIC) +-+ return; +-+ field++; +-+ newsize = le32_to_cpup(field); +-+ +-+ brcmf_dbg(PCIE, "Found ramsize info in FW, adjusting to 0x%x\n", +-+ newsize); +-+ devinfo->ci->ramsize = newsize; +-+} +-+ +-+ +- static int +- brcmf_pcie_init_share_ram_info(struct brcmf_pciedev_info *devinfo, +- u32 sharedram_addr) +-@@ -1694,6 +1720,13 @@ static void brcmf_pcie_setup(struct devi +- +- brcmf_pcie_attach(devinfo); +- +-+ /* Some of the firmwares have the size of the memory of the device +-+ * defined inside the firmware. This is because part of the memory in +-+ * the device is shared and the devision is determined by FW. Parse +-+ * the firmware and adjust the chip memory size now. +-+ */ +-+ brcmf_pcie_adjust_ramsize(devinfo, (u8 *)fw->data, fw->size); +-+ +- ret = brcmf_pcie_download_fw_nvram(devinfo, fw, nvram, nvram_len); +- if (ret) +- goto fail; +diff --git a/package/kernel/mac80211/patches/344-0009-brcmfmac-use-bar1-window-size-as-provided-by-pci-sub.patch b/package/kernel/mac80211/patches/344-0009-brcmfmac-use-bar1-window-size-as-provided-by-pci-sub.patch +deleted file mode 100644 +index ca03ffe..0000000 +--- a/package/kernel/mac80211/patches/344-0009-brcmfmac-use-bar1-window-size-as-provided-by-pci-sub.patch ++++ /dev/null +@@ -1,58 +0,0 @@ +-From: Hante Meuleman +-Date: Wed, 17 Feb 2016 11:26:58 +0100 +-Subject: [PATCH] brcmfmac: use bar1 window size as provided by pci subsystem +- +-The PCIE bar1 window size is specified by chip. Currently the +-ioremap of bar1 was using a define which always matched the size +-of bar1, but newer chips can have a different bar1 sizes. With +-this patch the ioremap will be called with the by chip provided +-window size. +- +-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/broadcom/brcm80211/brcmfmac/pcie.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +-@@ -72,7 +72,6 @@ static struct brcmf_firmware_mapping brc +- +- #define BRCMF_PCIE_FW_UP_TIMEOUT 2000 /* msec */ +- +--#define BRCMF_PCIE_TCM_MAP_SIZE (4096 * 1024) +- #define BRCMF_PCIE_REG_MAP_SIZE (32 * 1024) +- +- /* backplane addres space accessed by BAR0 */ +-@@ -252,7 +251,6 @@ struct brcmf_pciedev_info { +- char nvram_name[BRCMF_FW_NAME_LEN]; +- void __iomem *regs; +- void __iomem *tcm; +-- u32 tcm_size; +- u32 ram_base; +- u32 ram_size; +- struct brcmf_chip *ci; +-@@ -1592,8 +1590,7 @@ static int brcmf_pcie_get_resource(struc +- } +- +- devinfo->regs = ioremap_nocache(bar0_addr, BRCMF_PCIE_REG_MAP_SIZE); +-- devinfo->tcm = ioremap_nocache(bar1_addr, BRCMF_PCIE_TCM_MAP_SIZE); +-- devinfo->tcm_size = BRCMF_PCIE_TCM_MAP_SIZE; +-+ devinfo->tcm = ioremap_nocache(bar1_addr, bar1_size); +- +- if (!devinfo->regs || !devinfo->tcm) { +- brcmf_err("ioremap() failed (%p,%p)\n", devinfo->regs, +-@@ -1602,8 +1599,9 @@ static int brcmf_pcie_get_resource(struc +- } +- brcmf_dbg(PCIE, "Phys addr : reg space = %p base addr %#016llx\n", +- devinfo->regs, (unsigned long long)bar0_addr); +-- brcmf_dbg(PCIE, "Phys addr : mem space = %p base addr %#016llx\n", +-- devinfo->tcm, (unsigned long long)bar1_addr); +-+ brcmf_dbg(PCIE, "Phys addr : mem space = %p base addr %#016llx size 0x%x\n", +-+ devinfo->tcm, (unsigned long long)bar1_addr, +-+ (unsigned int)bar1_size); +- +- return 0; +- } +diff --git a/package/kernel/mac80211/patches/344-0010-brcmfmac-add-support-for-the-PCIE-4366c0-chip.patch b/package/kernel/mac80211/patches/344-0010-brcmfmac-add-support-for-the-PCIE-4366c0-chip.patch +deleted file mode 100644 +index e4a8f30..0000000 +--- a/package/kernel/mac80211/patches/344-0010-brcmfmac-add-support-for-the-PCIE-4366c0-chip.patch ++++ /dev/null +@@ -1,34 +0,0 @@ +-From: Hante Meuleman +-Date: Wed, 17 Feb 2016 11:26:59 +0100 +-Subject: [PATCH] brcmfmac: add support for the PCIE 4366c0 chip +- +-A newer version of the 4366 PCIE chip has been released. Add +-support for this version of the chip. +- +-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/broadcom/brcm80211/brcmfmac/pcie.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +-@@ -53,6 +53,7 @@ BRCMF_FW_NVRAM_DEF(4358, "brcmfmac4358-p +- 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(4366C, "brcmfmac4366c-pcie.bin", "brcmfmac4366c-pcie.txt"); +- BRCMF_FW_NVRAM_DEF(4371, "brcmfmac4371-pcie.bin", "brcmfmac4371-pcie.txt"); +- +- static struct brcmf_firmware_mapping brcmf_pcie_fwnames[] = { +-@@ -66,7 +67,8 @@ static struct brcmf_firmware_mapping brc +- 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_4366_CHIP_ID, 0x0000000F, 4366B), +-+ BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4366_CHIP_ID, 0xFFFFFFF0, 4366C), +- BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4371_CHIP_ID, 0xFFFFFFFF, 4371), +- }; +- +diff --git a/package/kernel/mac80211/patches/344-0012-brcmfmac-increase-timeout-for-tx-eapol.patch b/package/kernel/mac80211/patches/344-0012-brcmfmac-increase-timeout-for-tx-eapol.patch +deleted file mode 100644 +index c529ff2..0000000 +--- a/package/kernel/mac80211/patches/344-0012-brcmfmac-increase-timeout-for-tx-eapol.patch ++++ /dev/null +@@ -1,30 +0,0 @@ +-From: Hante Meuleman +-Date: Wed, 17 Feb 2016 11:27:01 +0100 +-Subject: [PATCH] brcmfmac: increase timeout for tx eapol +- +-When keys get set and updated this has to happen after eapol got +-transmitted (without key or old key) before the key can be updated. +-To make sure the order of sending eapol and configuring key is done +-correctly a timeout for tx of eapol is applied. This timeout is set +-to 50 msec, which is not always enough. Especially in AP mode and +-key updates the timeout may need to be much longer because client(s) +-can be in powersave. Increase the timeout from 50 to 950 msec. +- +-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/broadcom/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-@@ -40,7 +40,7 @@ MODULE_AUTHOR("Broadcom Corporation"); +- MODULE_DESCRIPTION("Broadcom 802.11 wireless LAN fullmac driver."); +- MODULE_LICENSE("Dual BSD/GPL"); +- +--#define MAX_WAIT_FOR_8021X_TX msecs_to_jiffies(50) +-+#define MAX_WAIT_FOR_8021X_TX msecs_to_jiffies(950) +- +- /* AMPDU rx reordering definitions */ +- #define BRCMF_RXREORDER_FLOWID_OFFSET 0 +diff --git a/package/kernel/mac80211/patches/345-brcmfmac-insert-default-boardrev-in-nvram-data-if-mi.patch b/package/kernel/mac80211/patches/345-brcmfmac-insert-default-boardrev-in-nvram-data-if-mi.patch +deleted file mode 100644 +index f293401..0000000 +--- a/package/kernel/mac80211/patches/345-brcmfmac-insert-default-boardrev-in-nvram-data-if-mi.patch ++++ /dev/null +@@ -1,114 +0,0 @@ +-From: Hante Meuleman +-Date: Mon, 11 Apr 2016 11:35:23 +0200 +-Subject: [PATCH] brcmfmac: insert default boardrev in nvram data if +- missing +- +-Some nvram files/stores come without the boardrev information, +-but firmware requires this to be set. When not found in nvram then +-add a default boardrev string to the nvram data. +- +-Reported-by: Rafal Milecki +-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/broadcom/brcm80211/brcmfmac/firmware.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c +-@@ -29,6 +29,7 @@ +- #define BRCMF_FW_MAX_NVRAM_SIZE 64000 +- #define BRCMF_FW_NVRAM_DEVPATH_LEN 19 /* devpath0=pcie/1/4/ */ +- #define BRCMF_FW_NVRAM_PCIEDEV_LEN 10 /* pcie/1/4/ + \0 */ +-+#define BRCMF_FW_DEFAULT_BOARDREV "boardrev=0xff" +- +- enum nvram_parser_state { +- IDLE, +-@@ -51,6 +52,7 @@ enum nvram_parser_state { +- * @entry: start position of key,value entry. +- * @multi_dev_v1: detect pcie multi device v1 (compressed). +- * @multi_dev_v2: detect pcie multi device v2. +-+ * @boardrev_found: nvram contains boardrev information. +- */ +- struct nvram_parser { +- enum nvram_parser_state state; +-@@ -63,6 +65,7 @@ struct nvram_parser { +- u32 entry; +- bool multi_dev_v1; +- bool multi_dev_v2; +-+ bool boardrev_found; +- }; +- +- /** +-@@ -125,6 +128,8 @@ static enum nvram_parser_state brcmf_nvr +- nvp->multi_dev_v1 = true; +- if (strncmp(&nvp->data[nvp->entry], "pcie/", 5) == 0) +- nvp->multi_dev_v2 = true; +-+ if (strncmp(&nvp->data[nvp->entry], "boardrev", 8) == 0) +-+ nvp->boardrev_found = true; +- } else if (!is_nvram_char(c) || c == ' ') { +- brcmf_dbg(INFO, "warning: ln=%d:col=%d: '=' expected, skip invalid key entry\n", +- nvp->line, nvp->column); +-@@ -284,6 +289,8 @@ static void brcmf_fw_strip_multi_v1(stru +- while (i < nvp->nvram_len) { +- if ((nvp->nvram[i] - '0' == id) && (nvp->nvram[i + 1] == ':')) { +- i += 2; +-+ if (strncmp(&nvp->nvram[i], "boardrev", 8) == 0) +-+ nvp->boardrev_found = true; +- while (nvp->nvram[i] != 0) { +- nvram[j] = nvp->nvram[i]; +- i++; +-@@ -335,6 +342,8 @@ static void brcmf_fw_strip_multi_v2(stru +- while (i < nvp->nvram_len - len) { +- if (strncmp(&nvp->nvram[i], prefix, len) == 0) { +- i += len; +-+ if (strncmp(&nvp->nvram[i], "boardrev", 8) == 0) +-+ nvp->boardrev_found = true; +- while (nvp->nvram[i] != 0) { +- nvram[j] = nvp->nvram[i]; +- i++; +-@@ -356,6 +365,18 @@ fail: +- nvp->nvram_len = 0; +- } +- +-+static void brcmf_fw_add_defaults(struct nvram_parser *nvp) +-+{ +-+ if (nvp->boardrev_found) +-+ return; +-+ +-+ memcpy(&nvp->nvram[nvp->nvram_len], &BRCMF_FW_DEFAULT_BOARDREV, +-+ strlen(BRCMF_FW_DEFAULT_BOARDREV)); +-+ nvp->nvram_len += strlen(BRCMF_FW_DEFAULT_BOARDREV); +-+ nvp->nvram[nvp->nvram_len] = '\0'; +-+ nvp->nvram_len++; +-+} +-+ +- /* brcmf_nvram_strip :Takes a buffer of "=\n" lines read from a fil +- * and ending in a NUL. Removes carriage returns, empty lines, comment lines, +- * and converts newlines to NULs. Shortens buffer as needed and pads with NULs. +-@@ -377,16 +398,21 @@ static void *brcmf_fw_nvram_strip(const +- if (nvp.state == END) +- break; +- } +-- if (nvp.multi_dev_v1) +-+ if (nvp.multi_dev_v1) { +-+ nvp.boardrev_found = false; +- brcmf_fw_strip_multi_v1(&nvp, domain_nr, bus_nr); +-- else if (nvp.multi_dev_v2) +-+ } else if (nvp.multi_dev_v2) { +-+ nvp.boardrev_found = false; +- brcmf_fw_strip_multi_v2(&nvp, domain_nr, bus_nr); +-+ } +- +- if (nvp.nvram_len == 0) { +- kfree(nvp.nvram); +- return NULL; +- } +- +-+ brcmf_fw_add_defaults(&nvp); +-+ +- pad = nvp.nvram_len; +- *new_length = roundup(nvp.nvram_len + 1, 4); +- while (pad != *new_length) { +diff --git a/package/kernel/mac80211/patches/402-ath_regd_optional.patch b/package/kernel/mac80211/patches/402-ath_regd_optional.patch +index 7351353..4634283 100644 +--- a/package/kernel/mac80211/patches/402-ath_regd_optional.patch ++++ b/package/kernel/mac80211/patches/402-ath_regd_optional.patch +@@ -8,7 +8,7 @@ + + return; + +#endif + + +- for (band = 0; band < IEEE80211_NUM_BANDS; band++) { ++ for (band = 0; band < NUM_NL80211_BANDS; band++) { + if (!wiphy->bands[band]) + continue; + @@ -374,6 +378,10 @@ ath_reg_apply_ir_flags(struct wiphy *wip +@@ -19,7 +19,7 @@ + + return; + +#endif + + +- sband = wiphy->bands[IEEE80211_BAND_2GHZ]; ++ sband = wiphy->bands[NL80211_BAND_2GHZ]; + if (!sband) + return; + @@ -402,6 +410,10 @@ static void ath_reg_apply_radar_flags(st +@@ -30,7 +30,7 @@ + + return; + +#endif + + +- if (!wiphy->bands[IEEE80211_BAND_5GHZ]) ++ if (!wiphy->bands[NL80211_BAND_5GHZ]) + return; + + @@ -633,6 +645,11 @@ ath_regd_init_wiphy(struct ath_regulator +@@ -59,7 +59,7 @@ + ---help--- + --- a/.local-symbols + +++ b/.local-symbols +-@@ -125,6 +125,7 @@ ADM8211= ++@@ -127,6 +127,7 @@ ADM8211= + ATH_COMMON= + WLAN_VENDOR_ATH= + ATH_DEBUG= +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 1a62484..819e64f 100644 +--- a/package/kernel/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch ++++ b/package/kernel/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch +@@ -1,6 +1,6 @@ + --- a/drivers/net/wireless/ath/ath9k/init.c + +++ b/drivers/net/wireless/ath/ath9k/init.c +-@@ -722,6 +722,7 @@ static const struct ieee80211_iface_limi ++@@ -728,6 +728,7 @@ static const struct ieee80211_iface_limi + BIT(NL80211_IFTYPE_AP) }, + { .max = 1, .types = BIT(NL80211_IFTYPE_P2P_CLIENT) | + BIT(NL80211_IFTYPE_P2P_GO) }, +diff --git a/package/kernel/mac80211/patches/500-ath9k_eeprom_debugfs.patch b/package/kernel/mac80211/patches/500-ath9k_eeprom_debugfs.patch +index a7f9d9f..4b6da97 100644 +--- a/package/kernel/mac80211/patches/500-ath9k_eeprom_debugfs.patch ++++ b/package/kernel/mac80211/patches/500-ath9k_eeprom_debugfs.patch +@@ -1,6 +1,6 @@ + --- a/drivers/net/wireless/ath/ath9k/debug.c + +++ b/drivers/net/wireless/ath/ath9k/debug.c +-@@ -1301,6 +1301,53 @@ void ath9k_deinit_debug(struct ath_softc ++@@ -1319,6 +1319,53 @@ void ath9k_deinit_debug(struct ath_softc + ath9k_cmn_spectral_deinit_debug(&sc->spec_priv); + } + +@@ -54,7 +54,7 @@ + int ath9k_init_debug(struct ath_hw *ah) + { + struct ath_common *common = ath9k_hw_common(ah); +-@@ -1320,6 +1367,8 @@ int ath9k_init_debug(struct ath_hw *ah) ++@@ -1338,6 +1385,8 @@ int ath9k_init_debug(struct ath_hw *ah) + ath9k_tx99_init_debug(sc); + ath9k_cmn_spectral_init_debug(&sc->spec_priv, sc->debug.debugfs_phy); + +diff --git a/package/kernel/mac80211/patches/501-ath9k_ahb_init.patch b/package/kernel/mac80211/patches/501-ath9k_ahb_init.patch +index 5892c3e..1825d77 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) ++@@ -1030,23 +1030,23 @@ static int __init ath9k_init(void) + { + int error; + +diff --git a/package/kernel/mac80211/patches/512-ath9k_channelbw_debugfs.patch b/package/kernel/mac80211/patches/512-ath9k_channelbw_debugfs.patch +index 5ecf528..a105d40 100644 +--- a/package/kernel/mac80211/patches/512-ath9k_channelbw_debugfs.patch ++++ b/package/kernel/mac80211/patches/512-ath9k_channelbw_debugfs.patch +@@ -1,6 +1,6 @@ + --- a/drivers/net/wireless/ath/ath9k/debug.c + +++ b/drivers/net/wireless/ath/ath9k/debug.c +-@@ -1348,6 +1348,52 @@ static const struct file_operations fops ++@@ -1366,6 +1366,52 @@ static const struct file_operations fops + .owner = THIS_MODULE + }; + +@@ -53,7 +53,7 @@ + int ath9k_init_debug(struct ath_hw *ah) + { + struct ath_common *common = ath9k_hw_common(ah); +-@@ -1369,6 +1415,8 @@ int ath9k_init_debug(struct ath_hw *ah) ++@@ -1387,6 +1433,8 @@ int ath9k_init_debug(struct ath_hw *ah) + + debugfs_create_file("eeprom", S_IRUSR, sc->debug.debugfs_phy, sc, + &fops_eeprom); +@@ -90,7 +90,7 @@ + ichan->channel = chan->center_freq; + ichan->chan = chan; + @@ -308,7 +310,19 @@ static void ath9k_cmn_update_ichannel(st +- if (chan->band == IEEE80211_BAND_5GHZ) ++ if (chan->band == NL80211_BAND_5GHZ) + flags |= CHANNEL_5GHZ; + + - switch (chandef->width) { +diff --git a/package/kernel/mac80211/patches/513-ath9k_add_pci_ids.patch b/package/kernel/mac80211/patches/513-ath9k_add_pci_ids.patch +index c84d1bc..167eeff 100644 +--- a/package/kernel/mac80211/patches/513-ath9k_add_pci_ids.patch ++++ b/package/kernel/mac80211/patches/513-ath9k_add_pci_ids.patch +@@ -20,7 +20,7 @@ + #define AR9160_DEVID_PCI 0x0027 + --- a/drivers/net/wireless/ath/ath9k/pci.c + +++ b/drivers/net/wireless/ath/ath9k/pci.c +-@@ -751,6 +751,7 @@ static const struct pci_device_id ath_pc ++@@ -761,6 +761,7 @@ static const struct pci_device_id ath_pc + .driver_data = ATH9K_PCI_BT_ANT_DIV }, + #endif + +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 e151a12..28f5dcc 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 +-@@ -2363,6 +2363,7 @@ struct cfg80211_qos_map { ++@@ -2406,6 +2406,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 + * +-@@ -2624,6 +2625,7 @@ struct cfg80211_ops { ++@@ -2667,6 +2668,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 +-@@ -1286,6 +1286,7 @@ enum ieee80211_smps_mode { ++@@ -1305,6 +1305,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 @@ + * + * @chandef: the channel definition to tune to + * @radar_enabled: whether radar detection is enabled +-@@ -1306,6 +1307,7 @@ enum ieee80211_smps_mode { ++@@ -1325,6 +1326,7 @@ enum ieee80211_smps_mode { + struct ieee80211_conf { + u32 flags; + int power_level, dynamic_ps_timeout; +@@ -36,9 +36,9 @@ + u8 ps_dtim_period; + --- a/include/uapi/linux/nl80211.h + +++ b/include/uapi/linux/nl80211.h +-@@ -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. ++@@ -1819,6 +1819,9 @@ enum nl80211_commands { ++ * ++ * @NL80211_ATTR_PAD: attribute used for padding for 64-bit alignment + * + + * @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 +-@@ -2164,6 +2167,8 @@ enum nl80211_attrs { +- NL80211_ATTR_MAX_SCAN_PLAN_ITERATIONS, +- NL80211_ATTR_SCHED_SCAN_PLANS, ++@@ -2201,6 +2204,8 @@ enum nl80211_attrs { ++ ++ NL80211_ATTR_PAD, + + + NL80211_ATTR_WIPHY_ANTENNA_GAIN, + + +@@ -57,7 +57,7 @@ + __NL80211_ATTR_AFTER_LAST, + --- a/net/mac80211/cfg.c + +++ b/net/mac80211/cfg.c +-@@ -2229,6 +2229,19 @@ static int ieee80211_get_tx_power(struct ++@@ -2238,6 +2238,19 @@ static int ieee80211_get_tx_power(struct + return 0; + } + +@@ -77,7 +77,7 @@ + static int ieee80211_set_wds_peer(struct wiphy *wiphy, struct net_device *dev, + const u8 *addr) + { +-@@ -3403,6 +3416,7 @@ const struct cfg80211_ops mac80211_confi ++@@ -3412,6 +3425,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, +@@ -87,7 +87,7 @@ + CFG80211_TESTMODE_CMD(ieee80211_testmode_cmd) + --- a/net/mac80211/ieee80211_i.h + +++ b/net/mac80211/ieee80211_i.h +-@@ -1318,6 +1318,7 @@ struct ieee80211_local { ++@@ -1322,6 +1322,7 @@ struct ieee80211_local { + int dynamic_ps_forced_timeout; + + int user_power_level; /* in dBm, for all interfaces */ +@@ -119,7 +119,7 @@ + if (local->hw.conf.power_level != power) { + changed |= IEEE80211_CONF_CHANGE_POWER; + local->hw.conf.power_level = power; +-@@ -586,6 +592,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_ ++@@ -588,6 +594,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; +@@ -129,15 +129,15 @@ + local->user_power_level = IEEE80211_UNSET_POWER_LEVEL; + --- a/net/wireless/nl80211.c + +++ b/net/wireless/nl80211.c +-@@ -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 }, ++@@ -406,6 +406,7 @@ static const struct nla_policy nl80211_p ++ [NL80211_ATTR_PBSS] = { .type = NLA_FLAG }, ++ [NL80211_ATTR_BSS_SELECT] = { .type = NLA_NESTED }, ++ [NL80211_ATTR_STA_SUPPORT_P2P_PS] = { .type = NLA_U8 }, + + [NL80211_ATTR_WIPHY_ANTENNA_GAIN] = { .type = NLA_U32 }, + }; + + /* policy for the key attributes */ +-@@ -2220,6 +2221,20 @@ static int nl80211_set_wiphy(struct sk_b ++@@ -2251,6 +2252,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 5a5e464..6001266 100644 +--- a/package/kernel/mac80211/patches/530-ath9k_extra_leds.patch ++++ b/package/kernel/mac80211/patches/530-ath9k_extra_leds.patch +@@ -1,16 +1,16 @@ + --- 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 ++@@ -813,6 +813,9 @@ static inline int ath9k_dump_btcoex(stru ++ #ifdef CPTCFG_MAC80211_LEDS + 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); + +int ath_create_gpio_led(struct ath_softc *sc, int gpio, const char *name, +-+ const char *trigger, bool active_low); +++ const char *trigger, bool active_low); + + + #else + static inline void ath_init_leds(struct ath_softc *sc) + { +-@@ -953,6 +956,13 @@ void ath_ant_comb_scan(struct ath_softc ++@@ -949,6 +952,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; +-@@ -1005,9 +1015,8 @@ struct ath_softc { ++@@ -1001,9 +1011,8 @@ struct ath_softc { + spinlock_t chan_lock; + + #ifdef CPTCFG_MAC80211_LEDS +@@ -38,24 +38,33 @@ + #ifdef CPTCFG_ATH9K_DEBUGFS + --- a/drivers/net/wireless/ath/ath9k/gpio.c + +++ b/drivers/net/wireless/ath/ath9k/gpio.c +-@@ -24,45 +24,102 @@ +- static void ath_led_brightness(struct led_classdev *led_cdev, +- enum led_brightness brightness) ++@@ -22,7 +22,7 @@ ++ ++ #ifdef CPTCFG_MAC80211_LEDS ++ ++-void ath_fill_led_pin(struct ath_softc *sc) +++static void ath_fill_led_pin(struct ath_softc *sc) + { +-- struct ath_softc *sc = container_of(led_cdev, struct ath_softc, led_cdev); +-- u32 val = (brightness == LED_OFF); ++ struct ath_hw *ah = sc->sc_ah; ++ ++@@ -39,61 +39,111 @@ void ath_fill_led_pin(struct ath_softc * ++ else ++ ah->led_pin = ATH_LED_PIN_DEF; ++ } +++} +++ +++static void ath_led_brightness(struct led_classdev *led_cdev, +++ enum led_brightness brightness) +++{ + + struct ath_led *led = container_of(led_cdev, struct ath_led, cdev); + + struct ath_softc *sc = led->sc; +- +-- if (sc->sc_ah->config.led_active_high) +-- val = !val; +++ + + ath9k_ps_wakeup(sc); + + ath9k_hw_set_gpio(sc->sc_ah, led->gpio->gpio, + + (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; +@@ -71,30 +80,40 @@ + + + + led->sc = sc; + + list_add(&led->list, &sc->leds); +-+ +-+ /* Configure gpio for output */ +-+ ath9k_hw_cfg_output(sc->sc_ah, gpio->gpio, +-+ AR_GPIO_OUTPUT_MUX_AS_OUTPUT); +-+ ++ ++ /* Configure gpio for output */ ++- ath9k_hw_gpio_request_out(ah, ah->led_pin, "ath9k-led", +++ ath9k_hw_gpio_request_out(sc->sc_ah, gpio->gpio, gpio->name, ++ AR_GPIO_OUTPUT_MUX_AS_OUTPUT); ++ ++- /* LED off, active low */ ++- ath9k_hw_set_gpio(ah, ah->led_pin, ah->config.led_active_high ? 0 : 1); + + /* LED off */ + + ath9k_hw_set_gpio(sc->sc_ah, gpio->gpio, gpio->active_low); + + + + return 0; +-+} +-+ ++ } ++ ++-static void ath_led_brightness(struct led_classdev *led_cdev, ++- enum led_brightness brightness) + +int ath_create_gpio_led(struct ath_softc *sc, int gpio_num, const char *name, + + const char *trigger, bool active_low) +-+{ ++ { ++- struct ath_softc *sc = container_of(led_cdev, struct ath_softc, led_cdev); ++- u32 val = (brightness == LED_OFF); + + struct ath_led *led; + + struct gpio_led *gpio; + + char *_name; + + int ret; +-+ ++ ++- if (sc->sc_ah->config.led_active_high) ++- val = !val; + + led = kzalloc(sizeof(*led) + sizeof(*gpio) + strlen(name) + 1, + + GFP_KERNEL); + + if (!led) + + return -ENOMEM; +-+ ++ ++- ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, val); + + led->gpio = gpio = (struct gpio_led *) (led + 1); + + _name = (char *) (led->gpio + 1); + + +@@ -115,15 +134,18 @@ + { + - if (!sc->led_registered) + - return; +-+ struct ath_led *led; +- ++- + - ath_led_brightness(&sc->led_cdev, LED_OFF); + - led_classdev_unregister(&sc->led_cdev); +++ struct ath_led *led; ++ ++- ath9k_hw_gpio_free(sc->sc_ah, sc->sc_ah->led_pin); + + while (!list_empty(&sc->leds)) { + + led = list_first_entry(&sc->leds, struct ath_led, list); + + list_del(&led->list); + + ath_led_brightness(&led->cdev, LED_OFF); + + led_classdev_unregister(&led->cdev); +++ ath9k_hw_gpio_free(sc->sc_ah, led->gpio->gpio); + + kfree(led); + + } + } +@@ -139,6 +161,8 @@ + if (AR_SREV_9100(sc->sc_ah)) + return; + ++ ath_fill_led_pin(sc); ++ + - if (!ath9k_led_blink) + - sc->led_cdev.default_trigger = + - ieee80211_get_radio_led_name(sc->hw); +@@ -159,13 +183,14 @@ + + trigger = ieee80211_get_radio_led_name(sc->hw); + + - sc->led_registered = true; +-+ ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger, !sc->sc_ah->config.led_active_high); +++ ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger, +++ !sc->sc_ah->config.led_active_high); + } ++ #endif + +- 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 ++@@ -942,7 +942,7 @@ int ath9k_init_device(u16 devid, struct + + #ifdef CPTCFG_MAC80211_LEDS + /* must be initialized before ieee80211_register_hw */ +@@ -176,7 +201,7 @@ + #endif + --- a/drivers/net/wireless/ath/ath9k/debug.c + +++ b/drivers/net/wireless/ath/ath9k/debug.c +-@@ -1393,6 +1393,61 @@ static const struct file_operations fops ++@@ -1411,6 +1411,61 @@ static const struct file_operations fops + .llseek = default_llseek, + }; + +@@ -238,7 +263,7 @@ + + int ath9k_init_debug(struct ath_hw *ah) + { +-@@ -1417,6 +1472,10 @@ int ath9k_init_debug(struct ath_hw *ah) ++@@ -1435,6 +1490,10 @@ int ath9k_init_debug(struct ath_hw *ah) + &fops_eeprom); + debugfs_create_file("chanbw", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, + sc, &fops_chanbw); +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 7c10ea6..f656697 100644 +--- a/package/kernel/mac80211/patches/531-ath9k_extra_platform_leds.patch ++++ b/package/kernel/mac80211/patches/531-ath9k_extra_platform_leds.patch +@@ -1,6 +1,6 @@ + --- a/include/linux/ath9k_platform.h + +++ b/include/linux/ath9k_platform.h +-@@ -41,6 +41,9 @@ struct ath9k_platform_data { ++@@ -45,6 +45,9 @@ struct ath9k_platform_data { + int (*external_reset)(void); + + bool use_eeprom; +@@ -20,7 +20,7 @@ + + /********************************/ + /* LED functions */ +-@@ -88,6 +89,24 @@ int ath_create_gpio_led(struct ath_softc ++@@ -108,6 +109,24 @@ int ath_create_gpio_led(struct ath_softc + return ret; + } + +@@ -45,7 +45,7 @@ + void ath_deinit_leds(struct ath_softc *sc) + { + struct ath_led *led; +-@@ -103,8 +122,10 @@ void ath_deinit_leds(struct ath_softc *s ++@@ -124,8 +143,10 @@ void ath_deinit_leds(struct ath_softc *s + + void ath_init_leds(struct ath_softc *sc) + { +@@ -56,10 +56,10 @@ + + INIT_LIST_HEAD(&sc->leds); + +-@@ -120,6 +141,12 @@ void ath_init_leds(struct ath_softc *sc) +- trigger = ieee80211_get_radio_led_name(sc->hw); ++@@ -144,6 +165,12 @@ void ath_init_leds(struct ath_softc *sc) + +- ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger, !sc->sc_ah->config.led_active_high); ++ ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger, ++ !sc->sc_ah->config.led_active_high); + + + + if (!pdata) + + return; +@@ -67,5 +67,5 @@ + + for (i = 0; i < pdata->num_leds; i++) + + ath_create_platform_led(sc, &pdata->leds[i]); + } ++ #endif + +- void ath_fill_led_pin(struct ath_softc *sc) +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 +index 6d62a2b..986f155 100644 +--- 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 +@@ -1,6 +1,6 @@ + --- a/include/linux/ath9k_platform.h + +++ b/include/linux/ath9k_platform.h +-@@ -36,6 +36,7 @@ struct ath9k_platform_data { ++@@ -40,6 +40,7 @@ struct ath9k_platform_data { + bool tx_gain_buffalo; + bool disable_2ghz; + bool disable_5ghz; +@@ -10,7 +10,7 @@ + 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 ++@@ -581,6 +581,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; +diff --git a/package/kernel/mac80211/patches/533-mac80211_correct_4addr_skbsize.patch b/package/kernel/mac80211/patches/533-mac80211_correct_4addr_skbsize.patch +new file mode 100644 +index 0000000..afd8cca +--- /dev/null ++++ b/package/kernel/mac80211/patches/533-mac80211_correct_4addr_skbsize.patch +@@ -0,0 +1,11 @@ ++--- a/net/wireless/util.c +++++ b/net/wireless/util.c ++@@ -509,7 +509,7 @@ static int __ieee80211_data_to_8023(stru ++ * replace EtherType */ ++ hdrlen += ETH_ALEN + 2; ++ else ++- tmp.h_proto = htons(skb->len); +++ tmp.h_proto = htons(skb->len - hdrlen); ++ ++ pskb_pull(skb, hdrlen); ++ +diff --git a/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch b/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch +index e83c6bf..f4bb0f2 100644 +--- a/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch ++++ b/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch +@@ -1,6 +1,6 @@ + --- a/drivers/net/wireless/ath/ath9k/debug.c + +++ b/drivers/net/wireless/ath/ath9k/debug.c +-@@ -1449,6 +1449,50 @@ static const struct file_operations fops ++@@ -1467,6 +1467,50 @@ static const struct file_operations fops + #endif + + +@@ -51,7 +51,7 @@ + int ath9k_init_debug(struct ath_hw *ah) + { + struct ath_common *common = ath9k_hw_common(ah); +-@@ -1476,6 +1520,8 @@ int ath9k_init_debug(struct ath_hw *ah) ++@@ -1494,6 +1538,8 @@ int ath9k_init_debug(struct ath_hw *ah) + debugfs_create_file("gpio_led", S_IWUSR, + sc->debug.debugfs_phy, sc, &fops_gpio_led); + #endif +@@ -62,7 +62,7 @@ + debugfs_create_devm_seqfile(sc->dev, "interrupt", sc->debug.debugfs_phy, + --- a/drivers/net/wireless/ath/ath9k/hw.h + +++ b/drivers/net/wireless/ath/ath9k/hw.h +-@@ -519,6 +519,12 @@ enum { ++@@ -520,6 +520,12 @@ enum { + ATH9K_RESET_COLD, + }; + +@@ -75,7 +75,7 @@ + struct ath9k_hw_version { + u32 magic; + u16 devid; +-@@ -804,6 +810,8 @@ struct ath_hw { ++@@ -805,6 +811,8 @@ struct ath_hw { + u32 rfkill_polarity; + u32 ah_flags; + +@@ -84,7 +84,7 @@ + bool reset_power_on; + bool htc_reset_init; + +-@@ -1066,6 +1074,7 @@ void ath9k_hw_check_nav(struct ath_hw *a ++@@ -1067,6 +1075,7 @@ void ath9k_hw_check_nav(struct ath_hw *a + bool ath9k_hw_check_alive(struct ath_hw *ah); + + bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode); +@@ -94,7 +94,7 @@ + struct ath_gen_timer *ath_gen_timer_alloc(struct ath_hw *ah, + --- a/drivers/net/wireless/ath/ath9k/hw.c + +++ b/drivers/net/wireless/ath/ath9k/hw.c +-@@ -1819,6 +1819,20 @@ u32 ath9k_hw_get_tsf_offset(struct times ++@@ -1821,6 +1821,20 @@ u32 ath9k_hw_get_tsf_offset(struct times + } + EXPORT_SYMBOL(ath9k_hw_get_tsf_offset); + +@@ -115,7 +115,7 @@ + int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, + struct ath9k_hw_cal_data *caldata, bool fastcc) + { +-@@ -2027,6 +2041,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st ++@@ -2029,6 +2043,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 d7bb5a1..7da7165 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 @@ + --- a/drivers/net/wireless/ath/ath9k/hw.h + +++ b/drivers/net/wireless/ath/ath9k/hw.h +-@@ -720,6 +720,7 @@ struct ath_spec_scan { ++@@ -721,6 +721,7 @@ struct ath_spec_scan { + * @config_pci_powersave: + * @calibrate: periodic calibration for NF, ANI, IQ, ADC gain, ADC-DC + * +@@ -8,7 +8,7 @@ + * @spectral_scan_config: set parameters for spectral scan and enable/disable it + * @spectral_scan_trigger: trigger a spectral scan run + * @spectral_scan_wait: wait for a spectral scan run to finish +-@@ -742,6 +743,7 @@ struct ath_hw_ops { ++@@ -743,6 +744,7 @@ struct ath_hw_ops { + 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 +-@@ -1998,6 +1998,26 @@ void ar9003_hw_init_rate_txpower(struct ++@@ -1945,6 +1945,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); +-@@ -2034,6 +2054,7 @@ void ar9003_hw_attach_phy_ops(struct ath ++@@ -1981,6 +2001,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,9 +55,9 @@ + 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 +-@@ -711,7 +711,8 @@ static void ath9k_init_txpower_limits(st ++@@ -717,7 +717,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); ++ ath9k_init_band_txpower(sc, NL80211_BAND_5GHZ); + + - ah->curchan = curchan; + + if (curchan) +@@ -65,7 +65,7 @@ + } + + static const struct ieee80211_iface_limit if_limits[] = { +-@@ -897,6 +898,18 @@ static void ath9k_set_hw_capab(struct at ++@@ -903,6 +904,18 @@ static void ath9k_set_hw_capab(struct at + SET_IEEE80211_PERM_ADDR(hw, common->macaddr); + } + +@@ -84,7 +84,7 @@ + int ath9k_init_device(u16 devid, struct ath_softc *sc, + const struct ath_bus_ops *bus_ops) + { +-@@ -942,6 +955,8 @@ int ath9k_init_device(u16 devid, struct ++@@ -948,6 +961,8 @@ int ath9k_init_device(u16 devid, struct + ARRAY_SIZE(ath9k_tpt_blink)); + #endif + +@@ -110,7 +110,7 @@ + static inline void ath9k_hw_set_bt_ant_diversity(struct ath_hw *ah, bool enable) + --- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c + +++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c +-@@ -1327,9 +1327,30 @@ void ar5008_hw_init_rate_txpower(struct ++@@ -1325,9 +1325,30 @@ void ar5008_hw_init_rate_txpower(struct + } + } + +@@ -141,7 +141,7 @@ + static const u32 ar5416_cca_regs[6] = { + AR_PHY_CCA, + AR_PHY_CH1_CCA, +-@@ -1344,6 +1365,8 @@ int ar5008_hw_attach_phy_ops(struct ath_ ++@@ -1342,6 +1363,8 @@ int ar5008_hw_attach_phy_ops(struct ath_ + if (ret) + 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 8768c5d..9462fca 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 +@@ -40,7 +40,7 @@ + return true; + } + +-@@ -1797,8 +1816,14 @@ static int ath9k_hw_do_fastcc(struct ath ++@@ -1799,8 +1818,14 @@ static int ath9k_hw_do_fastcc(struct ath + if (AR_SREV_9271(ah)) + ar9002_hw_load_ani_reg(ah, chan); + +@@ -55,7 +55,7 @@ + return -EINVAL; + } + +-@@ -2052,6 +2077,9 @@ int ath9k_hw_reset(struct ath_hw *ah, st ++@@ -2054,6 +2079,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 3d24ccd..b639f97 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 @@ + --- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c + +++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c +-@@ -956,55 +956,6 @@ static bool ar5008_hw_ani_control_new(st ++@@ -954,55 +954,6 @@ static bool ar5008_hw_ani_control_new(st + * on == 0 means more noise imm + */ + u32 on = param ? 1 : 0; +@@ -58,7 +58,7 @@ + REG_SET_BIT(ah, AR_PHY_SFCORR_LOW, + --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c + +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c +-@@ -41,20 +41,6 @@ static const int cycpwrThr1_table[] = ++@@ -42,20 +42,6 @@ static const int cycpwrThr1_table[] = + /* level: 0 1 2 3 4 5 6 7 8 */ + { -6, -4, -2, 0, 2, 4, 6, 8 }; /* lvl 0-7, default 3 */ + +@@ -79,7 +79,7 @@ + static const u8 ofdm2pwr[] = { + ALL_TARGET_LEGACY_6_24, + ALL_TARGET_LEGACY_6_24, +-@@ -1089,11 +1075,6 @@ static bool ar9003_hw_ani_control(struct ++@@ -1095,11 +1081,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) { +-@@ -1107,61 +1088,6 @@ static bool ar9003_hw_ani_control(struct ++@@ -1113,61 +1094,6 @@ static bool ar9003_hw_ani_control(struct + */ + u32 on = param ? 1 : 0; + +diff --git a/package/kernel/mac80211/patches/546-ath9k_platform_led_name.patch b/package/kernel/mac80211/patches/546-ath9k_platform_led_name.patch +new file mode 100644 +index 0000000..ced72c6 +--- /dev/null ++++ b/package/kernel/mac80211/patches/546-ath9k_platform_led_name.patch +@@ -0,0 +1,39 @@ ++From: Michal Cieslakiewicz ++Date: Sun, 31 Jan 2016 20:45:57 +0100 ++Subject: [PATCH v4 1/8] mac80211: ath9k: enable platform WLAN LED name ++ ++Enable platform-supplied WLAN LED name for ath9k device. It replaces generic ++'ath9k-phy*' label with string set during platform initialization. ++ ++Signed-off-by: Michal Cieslakiewicz ++--- ++ drivers/net/wireless/ath/ath9k/gpio.c | 10 +++++++--- ++ include/linux/ath9k_platform.h | 1 + ++ 2 files changed, 8 insertions(+), 3 deletions(-) ++ ++--- a/drivers/net/wireless/ath/ath9k/gpio.c +++++ b/drivers/net/wireless/ath/ath9k/gpio.c ++@@ -155,8 +155,11 @@ void ath_init_leds(struct ath_softc *sc) ++ ++ ath_fill_led_pin(sc); ++ ++- snprintf(led_name, sizeof(led_name), "ath9k-%s", ++- wiphy_name(sc->hw->wiphy)); +++ if (pdata && pdata->led_name) +++ strncpy(led_name, pdata->led_name, sizeof(led_name)); +++ else +++ snprintf(led_name, sizeof(led_name), "ath9k-%s", +++ wiphy_name(sc->hw->wiphy)); ++ ++ if (ath9k_led_blink) ++ trigger = sc->led_default_trigger; ++--- a/include/linux/ath9k_platform.h +++++ b/include/linux/ath9k_platform.h ++@@ -49,6 +49,7 @@ struct ath9k_platform_data { ++ ++ int num_leds; ++ const struct gpio_led *leds; +++ const char *led_name; ++ }; ++ ++ #endif /* _LINUX_ATH9K_PLATFORM_H */ +diff --git a/package/kernel/mac80211/patches/547-ath9k_led_defstate_fix.patch b/package/kernel/mac80211/patches/547-ath9k_led_defstate_fix.patch +new file mode 100644 +index 0000000..5d84cf0 +--- /dev/null ++++ b/package/kernel/mac80211/patches/547-ath9k_led_defstate_fix.patch +@@ -0,0 +1,29 @@ ++From: Michal Cieslakiewicz ++Date: Sun, 31 Jan 2016 20:48:49 +0100 ++Subject: [PATCH v4 2/8] mac80211: ath9k: set default state for platform LEDs ++ ++Support default state for platform LEDs connected to ath9k device. ++Now LEDs are correctly set on or off at ath9k module initialization. ++Very useful if power LED is connected to wireless chip. ++ ++Signed-off-by: Michal Cieslakiewicz ++--- ++ gpio.c | 7 +++++-- ++ 1 file changed, 5 insertions(+), 2 deletions(-) ++ ++--- a/drivers/net/wireless/ath/ath9k/gpio.c +++++ b/drivers/net/wireless/ath/ath9k/gpio.c ++@@ -74,8 +74,11 @@ static int ath_add_led(struct ath_softc ++ ath9k_hw_gpio_request_out(sc->sc_ah, gpio->gpio, gpio->name, ++ AR_GPIO_OUTPUT_MUX_AS_OUTPUT); ++ ++- /* LED off */ ++- ath9k_hw_set_gpio(sc->sc_ah, gpio->gpio, gpio->active_low); +++ /* Set default LED state */ +++ if (gpio->default_state == LEDS_GPIO_DEFSTATE_ON) +++ ath9k_hw_set_gpio(sc->sc_ah, gpio->gpio, !gpio->active_low); +++ else +++ ath9k_hw_set_gpio(sc->sc_ah, gpio->gpio, gpio->active_low); ++ ++ return 0; ++ } +diff --git a/package/kernel/mac80211/patches/548-ath9k_enable_gpio_chip.patch b/package/kernel/mac80211/patches/548-ath9k_enable_gpio_chip.patch +new file mode 100644 +index 0000000..1c89e42 +--- /dev/null ++++ b/package/kernel/mac80211/patches/548-ath9k_enable_gpio_chip.patch +@@ -0,0 +1,237 @@ ++From: Michal Cieslakiewicz ++Date: Sun, 31 Jan 2016 21:01:31 +0100 ++Subject: [PATCH v4 4/8] mac80211: ath9k: enable access to GPIO ++ ++Enable access to GPIO chip and its pins for Atheros AR92xx ++wireless devices. For now AR9285 and AR9287 are supported. ++ ++Signed-off-by: Michal Cieslakiewicz ++Signed-off-by: Felix Fietkau ++--- ++--- a/drivers/net/wireless/ath/ath9k/ath9k.h +++++ b/drivers/net/wireless/ath/ath9k/ath9k.h ++@@ -24,6 +24,7 @@ ++ #include ++ #include ++ #include +++#include ++ ++ #include "common.h" ++ #include "debug.h" ++@@ -959,6 +960,14 @@ struct ath_led { ++ struct led_classdev cdev; ++ }; ++ +++#ifdef CONFIG_GPIOLIB +++struct ath9k_gpio_chip { +++ struct ath_softc *sc; +++ char label[32]; +++ struct gpio_chip gchip; +++}; +++#endif +++ ++ struct ath_softc { ++ struct ieee80211_hw *hw; ++ struct device *dev; ++@@ -1013,6 +1022,9 @@ struct ath_softc { ++ #ifdef CPTCFG_MAC80211_LEDS ++ const char *led_default_trigger; ++ struct list_head leds; +++#ifdef CONFIG_GPIOLIB +++ struct ath9k_gpio_chip *gpiochip; +++#endif ++ #endif ++ ++ #ifdef CPTCFG_ATH9K_DEBUGFS ++--- a/drivers/net/wireless/ath/ath9k/gpio.c +++++ b/drivers/net/wireless/ath/ath9k/gpio.c ++@@ -16,13 +16,138 @@ ++ ++ #include "ath9k.h" ++ #include +++#include +++ +++#ifdef CPTCFG_MAC80211_LEDS +++ +++#ifdef CONFIG_GPIOLIB +++ +++/***************/ +++/* GPIO Chip */ +++/***************/ +++ +++/* gpio_chip handler : set GPIO to input */ +++static int ath9k_gpio_pin_cfg_input(struct gpio_chip *chip, unsigned offset) +++{ +++ struct ath9k_gpio_chip *gc = container_of(chip, struct ath9k_gpio_chip, +++ gchip); +++ +++ ath9k_hw_gpio_request_in(gc->sc->sc_ah, offset, "ath9k-gpio"); +++ +++ return 0; +++} +++ +++/* gpio_chip handler : set GPIO to output */ +++static int ath9k_gpio_pin_cfg_output(struct gpio_chip *chip, unsigned offset, +++ int value) +++{ +++ struct ath9k_gpio_chip *gc = container_of(chip, struct ath9k_gpio_chip, +++ gchip); +++ +++ ath9k_hw_gpio_request_out(gc->sc->sc_ah, offset, "ath9k-gpio", +++ AR_GPIO_OUTPUT_MUX_AS_OUTPUT); +++ ath9k_hw_set_gpio(gc->sc->sc_ah, offset, value); +++ +++ return 0; +++} +++ +++/* gpio_chip handler : query GPIO direction (0=out, 1=in) */ +++static int ath9k_gpio_pin_get_dir(struct gpio_chip *chip, unsigned offset) +++{ +++ struct ath9k_gpio_chip *gc = container_of(chip, struct ath9k_gpio_chip, +++ gchip); +++ struct ath_hw *ah = gc->sc->sc_ah; +++ +++ return !((REG_READ(ah, AR_GPIO_OE_OUT) >> (offset * 2)) & 3); +++} +++ +++/* gpio_chip handler : get GPIO pin value */ +++static int ath9k_gpio_pin_get(struct gpio_chip *chip, unsigned offset) +++{ +++ struct ath9k_gpio_chip *gc = container_of(chip, struct ath9k_gpio_chip, +++ gchip); +++ +++ return ath9k_hw_gpio_get(gc->sc->sc_ah, offset); +++} +++ +++/* gpio_chip handler : set GPIO pin to value */ +++static void ath9k_gpio_pin_set(struct gpio_chip *chip, unsigned offset, +++ int value) +++{ +++ struct ath9k_gpio_chip *gc = container_of(chip, struct ath9k_gpio_chip, +++ gchip); +++ +++ ath9k_hw_set_gpio(gc->sc->sc_ah, offset, value); +++} +++ +++/* register GPIO chip */ +++static void ath9k_register_gpio_chip(struct ath_softc *sc) +++{ +++ struct ath9k_gpio_chip *gc; +++ u16 ng; +++ +++ /* for now only AR9285 and AR9287 are recognized */ +++ if (AR_SREV_9287(sc->sc_ah)) +++ ng = AR9287_NUM_GPIO; +++ else if (AR_SREV_9285(sc->sc_ah)) +++ ng = AR9285_NUM_GPIO; +++ else +++ return; +++ +++ gc = kzalloc(sizeof(struct ath9k_gpio_chip), GFP_KERNEL); +++ if (!gc) +++ return; +++ +++ snprintf(gc->label, sizeof(gc->label), "ath9k-%s", +++ wiphy_name(sc->hw->wiphy)); +++ gc->gchip.label = gc->label; +++ gc->gchip.base = -1; /* determine base automatically */ +++ gc->gchip.ngpio = ng; +++ gc->gchip.direction_input = ath9k_gpio_pin_cfg_input; +++ gc->gchip.direction_output = ath9k_gpio_pin_cfg_output; +++ gc->gchip.get_direction = ath9k_gpio_pin_get_dir; +++ gc->gchip.get = ath9k_gpio_pin_get; +++ gc->gchip.set = ath9k_gpio_pin_set; +++ gc->gchip.owner = THIS_MODULE; +++ +++ if (gpiochip_add(&gc->gchip)) { +++ kfree(gc); +++ return; +++ } +++ +++ sc->gpiochip = gc; +++ gc->sc = sc; +++} +++ +++/* remove GPIO chip */ +++static void ath9k_unregister_gpio_chip(struct ath_softc *sc) +++{ +++ struct ath9k_gpio_chip *gc = sc->gpiochip; +++ +++ if (!gc) +++ return; +++ +++ gpiochip_remove(&gc->gchip); +++ kfree(gc); +++ sc->gpiochip = NULL; +++} +++ +++#else /* CONFIG_GPIOLIB */ +++ +++static inline void ath9k_register_gpio_chip(struct ath_softc *sc) +++{ +++} +++ +++static inline void ath9k_unregister_gpio_chip(struct ath_softc *sc) +++{ +++} +++ +++#endif /* CONFIG_GPIOLIB */ ++ ++ /********************************/ ++ /* LED functions */ ++ /********************************/ ++ ++-#ifdef CPTCFG_MAC80211_LEDS ++- ++ static void ath_fill_led_pin(struct ath_softc *sc) ++ { ++ struct ath_hw *ah = sc->sc_ah; ++@@ -80,6 +205,12 @@ static int ath_add_led(struct ath_softc ++ else ++ ath9k_hw_set_gpio(sc->sc_ah, gpio->gpio, gpio->active_low); ++ +++#ifdef CONFIG_GPIOLIB +++ /* If there is GPIO chip configured, reserve LED pin */ +++ if (sc->gpiochip) +++ gpio_request(sc->gpiochip->gchip.base + gpio->gpio, gpio->name); +++#endif +++ ++ return 0; ++ } ++ ++@@ -136,12 +267,18 @@ void ath_deinit_leds(struct ath_softc *s ++ ++ while (!list_empty(&sc->leds)) { ++ led = list_first_entry(&sc->leds, struct ath_led, list); +++#ifdef CONFIG_GPIOLIB +++ /* If there is GPIO chip configured, free LED pin */ +++ if (sc->gpiochip) +++ gpio_free(sc->gpiochip->gchip.base + led->gpio->gpio); +++#endif ++ list_del(&led->list); ++ ath_led_brightness(&led->cdev, LED_OFF); ++ led_classdev_unregister(&led->cdev); ++ ath9k_hw_gpio_free(sc->sc_ah, led->gpio->gpio); ++ kfree(led); ++ } +++ ath9k_unregister_gpio_chip(sc); ++ } ++ ++ void ath_init_leds(struct ath_softc *sc) ++@@ -158,6 +295,8 @@ void ath_init_leds(struct ath_softc *sc) ++ ++ ath_fill_led_pin(sc); ++ +++ ath9k_register_gpio_chip(sc); +++ ++ if (pdata && pdata->led_name) ++ strncpy(led_name, pdata->led_name, sizeof(led_name)); ++ else ++@@ -178,6 +317,7 @@ void ath_init_leds(struct ath_softc *sc) ++ for (i = 0; i < pdata->num_leds; i++) ++ ath_create_platform_led(sc, &pdata->leds[i]); ++ } +++ ++ #endif ++ ++ /*******************/ +diff --git a/package/kernel/mac80211/patches/549-ath9k_enable_gpio_buttons.patch b/package/kernel/mac80211/patches/549-ath9k_enable_gpio_buttons.patch +new file mode 100644 +index 0000000..c7973bb +--- /dev/null ++++ b/package/kernel/mac80211/patches/549-ath9k_enable_gpio_buttons.patch +@@ -0,0 +1,149 @@ ++From: Michal Cieslakiewicz ++Subject: [PATCH v5 5/8] mac80211: ath9k: enable GPIO buttons ++ ++Enable platform-defined GPIO button support for ath9k device. ++Key poller is activated for attached platform buttons. ++Requires ath9k GPIO chip access. ++ ++Signed-off-by: Michal Cieslakiewicz ++Signed-off-by: Felix Fietkau ++--- ++--- a/drivers/net/wireless/ath/ath9k/ath9k.h +++++ b/drivers/net/wireless/ath/ath9k/ath9k.h ++@@ -1024,6 +1024,7 @@ struct ath_softc { ++ struct list_head leds; ++ #ifdef CONFIG_GPIOLIB ++ struct ath9k_gpio_chip *gpiochip; +++ struct platform_device *btnpdev; /* gpio-keys-polled */ ++ #endif ++ #endif ++ ++--- a/drivers/net/wireless/ath/ath9k/gpio.c +++++ b/drivers/net/wireless/ath/ath9k/gpio.c ++@@ -17,6 +17,8 @@ ++ #include "ath9k.h" ++ #include ++ #include +++#include +++#include ++ ++ #ifdef CPTCFG_MAC80211_LEDS ++ ++@@ -132,6 +134,64 @@ static void ath9k_unregister_gpio_chip(s ++ sc->gpiochip = NULL; ++ } ++ +++/******************/ +++/* GPIO Buttons */ +++/******************/ +++ +++/* add GPIO buttons */ +++static void ath9k_init_buttons(struct ath_softc *sc) +++{ +++ struct ath9k_platform_data *pdata = sc->dev->platform_data; +++ struct platform_device *pdev; +++ struct gpio_keys_platform_data gkpdata; +++ struct gpio_keys_button *bt; +++ int i; +++ +++ if (!sc->gpiochip) +++ return; +++ +++ if (!pdata || !pdata->btns || !pdata->num_btns) +++ return; +++ +++ bt = devm_kmemdup(sc->dev, pdata->btns, +++ pdata->num_btns * sizeof(struct gpio_keys_button), +++ GFP_KERNEL); +++ if (!bt) +++ return; +++ +++ for (i = 0; i < pdata->num_btns; i++) { +++ ath9k_hw_gpio_request_in(sc->sc_ah, pdata->btns[i].gpio, +++ "ath9k-gpio"); +++ bt[i].gpio = sc->gpiochip->gchip.base + pdata->btns[i].gpio; +++ } +++ +++ memset(&gkpdata, 0, sizeof(struct gpio_keys_platform_data)); +++ gkpdata.buttons = bt; +++ gkpdata.nbuttons = pdata->num_btns; +++ gkpdata.poll_interval = pdata->btn_poll_interval; +++ +++ pdev = platform_device_register_data(sc->dev, "gpio-keys-polled", +++ PLATFORM_DEVID_AUTO, &gkpdata, +++ sizeof(gkpdata)); +++ if (!IS_ERR_OR_NULL(pdev)) +++ sc->btnpdev = pdev; +++ else { +++ sc->btnpdev = NULL; +++ devm_kfree(sc->dev, bt); +++ } +++} +++ +++/* remove GPIO buttons */ +++static void ath9k_deinit_buttons(struct ath_softc *sc) +++{ +++ if (!sc->gpiochip || !sc->btnpdev) +++ return; +++ +++ platform_device_unregister(sc->btnpdev); +++ +++ sc->btnpdev = NULL; +++} +++ ++ #else /* CONFIG_GPIOLIB */ ++ ++ static inline void ath9k_register_gpio_chip(struct ath_softc *sc) ++@@ -142,6 +202,14 @@ static inline void ath9k_unregister_gpio ++ { ++ } ++ +++static inline void ath9k_init_buttons(struct ath_softc *sc) +++{ +++} +++ +++static inline void ath9k_deinit_buttons(struct ath_softc *sc) +++{ +++} +++ ++ #endif /* CONFIG_GPIOLIB */ ++ ++ /********************************/ ++@@ -265,6 +333,7 @@ void ath_deinit_leds(struct ath_softc *s ++ { ++ struct ath_led *led; ++ +++ ath9k_deinit_buttons(sc); ++ while (!list_empty(&sc->leds)) { ++ led = list_first_entry(&sc->leds, struct ath_led, list); ++ #ifdef CONFIG_GPIOLIB ++@@ -296,6 +365,7 @@ void ath_init_leds(struct ath_softc *sc) ++ ath_fill_led_pin(sc); ++ ++ ath9k_register_gpio_chip(sc); +++ ath9k_init_buttons(sc); ++ ++ if (pdata && pdata->led_name) ++ strncpy(led_name, pdata->led_name, sizeof(led_name)); ++@@ -311,7 +381,7 @@ void ath_init_leds(struct ath_softc *sc) ++ ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger, ++ !sc->sc_ah->config.led_active_high); ++ ++- if (!pdata) +++ if (!pdata || !pdata->leds || !pdata->num_leds) ++ return; ++ ++ for (i = 0; i < pdata->num_leds; i++) ++--- a/include/linux/ath9k_platform.h +++++ b/include/linux/ath9k_platform.h ++@@ -50,6 +50,10 @@ struct ath9k_platform_data { ++ int num_leds; ++ const struct gpio_led *leds; ++ const char *led_name; +++ +++ unsigned num_btns; +++ const struct gpio_keys_button *btns; +++ unsigned btn_poll_interval; ++ }; ++ ++ #endif /* _LINUX_ATH9K_PLATFORM_H */ +diff --git a/package/kernel/mac80211/patches/550-ath9k_add_ar9280_gpio_chip.patch b/package/kernel/mac80211/patches/550-ath9k_add_ar9280_gpio_chip.patch +new file mode 100644 +index 0000000..22e2c66 +--- /dev/null ++++ b/package/kernel/mac80211/patches/550-ath9k_add_ar9280_gpio_chip.patch +@@ -0,0 +1,27 @@ ++From: Michal Cieslakiewicz ++Date: Thu, 21 Apr 2016 23:00:54 +0200 ++Subject: [PATCH] mac80211: ath9k: add GPIO support for AR9280 chip ++ ++Enable access to GPIO on Atheros wireless chip AR9280. ++Support for 9280 is added to existing 9285/9287 subsystem ++because these 3 chips differ only in number of GPIO pins. ++ ++Signed-off-by: Michal Cieslakiewicz ++--- ++--- a/drivers/net/wireless/ath/ath9k/gpio.c +++++ b/drivers/net/wireless/ath/ath9k/gpio.c ++@@ -88,11 +88,13 @@ static void ath9k_register_gpio_chip(str ++ struct ath9k_gpio_chip *gc; ++ u16 ng; ++ ++- /* for now only AR9285 and AR9287 are recognized */ +++ /* supported chips are AR9280, AR9285 and AR9287 */ ++ if (AR_SREV_9287(sc->sc_ah)) ++ ng = AR9287_NUM_GPIO; ++ else if (AR_SREV_9285(sc->sc_ah)) ++ ng = AR9285_NUM_GPIO; +++ else if (AR_SREV_9280(sc->sc_ah)) +++ ng = AR9280_NUM_GPIO; ++ else ++ return; ++ +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 8245909..db70a33 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: + + --- 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 ++@@ -7726,6 +7726,7 @@ static int rt2800_probe_rt(struct rt2x00 + + int rt2800_probe_hw(struct rt2x00_dev *rt2x00dev) + { +@@ -32,7 +32,7 @@ Changes since v1: + int retval; + u32 reg; + +-@@ -7729,6 +7730,9 @@ int rt2800_probe_hw(struct rt2x00_dev *r ++@@ -7733,6 +7734,9 @@ int rt2800_probe_hw(struct rt2x00_dev *r + if (retval) + return retval; + +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 7abfcd1..a3b62bc 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 +@@ -239,7 +239,7 @@ Changes since v1: --- + msleep(1); + + /* +-@@ -7726,6 +7774,8 @@ int rt2800_probe_hw(struct rt2x00_dev *r ++@@ -7730,6 +7778,8 @@ int rt2800_probe_hw(struct rt2x00_dev *r + int retval; + u32 reg; + +@@ -248,7 +248,7 @@ Changes since v1: --- + retval = rt2800_probe_rt(rt2x00dev); + if (retval) + return retval; +-@@ -7809,8 +7859,11 @@ void rt2800_get_key_seq(struct ieee80211 ++@@ -7813,8 +7863,11 @@ void rt2800_get_key_seq(struct ieee80211 + return; + + offset = MAC_IVEIV_ENTRY(key->hw_key_idx); +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 02b2acf..f41a160 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 +@@ -41,7 +41,7 @@ Signed-off-by: Gabor Juhos + rt2800_clear_beacon_register(rt2x00dev, i); + + if (rt2x00_is_usb(rt2x00dev)) { +-@@ -7827,6 +7828,8 @@ int rt2800_probe_hw(struct rt2x00_dev *r ++@@ -7831,6 +7832,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-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 e909272..5099c64 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 + + --- 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 ++@@ -7856,7 +7856,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-0009-rt2x00-rt2800lib-enable-support-for-RT3883.patch b/package/kernel/mac80211/patches/600-0009-rt2x00-rt2800lib-enable-support-for-RT3883.patch +index 7fe38e0..a2e7015 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 + + --- 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 ++@@ -7826,6 +7826,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 253a0c0..89bd0ac 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 +@@ -98,7 +98,7 @@ Signed-off-by: Gabor Juhos + static const struct rf_channel rf_vals_5592_xtal20[] = { + /* Channel, N, K, mod, R */ + {1, 482, 4, 10, 3}, +-@@ -7669,6 +7729,11 @@ static int rt2800_probe_hw_mode(struct r ++@@ -7673,6 +7733,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 f15c22b..b7efc9f 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 +@@ -18,7 +18,7 @@ Signed-off-by: Gabor Juhos + case RF5360: + case RF5362: + case RF5370: +-@@ -7848,6 +7849,7 @@ static int rt2800_probe_hw_mode(struct r ++@@ -7852,6 +7853,7 @@ static int rt2800_probe_hw_mode(struct r + case RF3053: + case RF3070: + case RF3290: +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 6ce224a..220e35f 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 + + --- 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 ++@@ -8407,7 +8407,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-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 25753af..2ffa5a4 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 + + --- 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 ++@@ -8420,7 +8420,8 @@ int rt2800_probe_hw(struct rt2x00_dev *r + if (retval) + return retval; + +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 7a183a4..daa5dc6 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 +@@ -22,10 +22,10 @@ + +#endif /* _RT2X00_PLATFORM_H */ + --- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h + +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h +-@@ -38,6 +38,7 @@ +- #include ++@@ -39,6 +39,7 @@ + #include + #include ++ #include + +#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 bc056cd..8ae5da3 100644 +--- a/package/kernel/mac80211/patches/603-rt2x00-introduce-rt2x00eeprom.patch ++++ b/package/kernel/mac80211/patches/603-rt2x00-introduce-rt2x00eeprom.patch +@@ -1,6 +1,6 @@ + --- a/.local-symbols + +++ b/.local-symbols +-@@ -329,6 +329,7 @@ RT2X00_LIB_FIRMWARE= ++@@ -331,6 +331,7 @@ RT2X00_LIB_FIRMWARE= + RT2X00_LIB_CRYPTO= + RT2X00_LIB_LEDS= + RT2X00_LIB_DEBUGFS= +@@ -105,7 +105,7 @@ + .drv_init_registers = rt2800mmio_init_registers, + --- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h + +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h +-@@ -697,6 +697,7 @@ enum rt2x00_capability_flags { ++@@ -699,6 +699,7 @@ enum rt2x00_capability_flags { + REQUIRE_HT_TX_DESC, + REQUIRE_PS_AUTOWAKE, + REQUIRE_DELAYED_RFKILL, +@@ -127,7 +127,7 @@ + DECLARE_KFIFO_PTR(txstatus_fifo, u32); + --- 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 ++@@ -1334,6 +1334,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. + */ +-@@ -1475,6 +1479,11 @@ void rt2x00lib_remove_dev(struct rt2x00_ ++@@ -1477,6 +1481,11 @@ void rt2x00lib_remove_dev(struct rt2x00_ + * Free the driver data. + */ + kfree(rt2x00dev->drv_data); +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 d923e05..a2e1faf 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 +@@ -37,7 +37,7 @@ + num_rates += 4; + --- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h + +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h +-@@ -405,6 +405,7 @@ struct hw_mode_spec { ++@@ -406,6 +406,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 a645ba1..6704ff8 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 +@@ -31,7 +31,7 @@ + { + --- 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 ++@@ -1416,6 +1416,7 @@ static inline void rt2x00debug_dump_fram + */ + u32 rt2x00lib_get_bssidx(struct rt2x00_dev *rt2x00dev, + struct ieee80211_vif *vif); +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 c69d330..9f10fe3 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 +@@ -200,7 +200,7 @@ + * EEPROM frequency + --- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h + +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h +-@@ -717,6 +717,8 @@ enum rt2x00_capability_flags { ++@@ -719,6 +719,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 b44fe90..860fdc0 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 +@@ -28,7 +28,7 @@ + static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev) + { + struct hw_mode_spec *spec = &rt2x00dev->spec; +-@@ -8272,7 +8293,10 @@ static int rt2800_probe_hw_mode(struct r ++@@ -8276,7 +8297,10 @@ static int rt2800_probe_hw_mode(struct r + case RF5390: + case RF5392: + spec->num_channels = 14; +@@ -40,7 +40,7 @@ + break; + + case RF3052: +-@@ -8456,6 +8480,19 @@ static int rt2800_probe_rt(struct rt2x00 ++@@ -8460,6 +8484,19 @@ static int rt2800_probe_rt(struct rt2x00 + return 0; + } + +@@ -60,7 +60,7 @@ + int rt2800_probe_hw(struct rt2x00_dev *rt2x00dev) + { + struct rt2800_drv_data *drv_data = rt2x00dev->drv_data; +-@@ -8498,6 +8535,15 @@ int rt2800_probe_hw(struct rt2x00_dev *r ++@@ -8502,6 +8539,15 @@ int rt2800_probe_hw(struct rt2x00_dev *r + rt2800_register_write(rt2x00dev, GPIO_CTRL, reg); + + /* +@@ -78,7 +78,7 @@ + retval = rt2800_probe_hw_mode(rt2x00dev); + --- 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 ++@@ -401,6 +401,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; +-@@ -416,6 +417,7 @@ struct hw_mode_spec { ++@@ -417,6 +418,7 @@ struct hw_mode_spec { + const struct channel_info *channels_info; + + struct ieee80211_sta_ht_cap ht; +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 8e3bd2a..e7b2a8c 100644 +--- a/package/kernel/mac80211/patches/615-rt2x00-fix_20mhz_clk.patch ++++ b/package/kernel/mac80211/patches/615-rt2x00-fix_20mhz_clk.patch +@@ -8,7 +8,7 @@ + + #include "rt2x00.h" + #include "rt2800lib.h" +-@@ -8482,13 +8483,14 @@ static int rt2800_probe_rt(struct rt2x00 ++@@ -8486,13 +8487,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 faa5879..44bd8a1 100644 +--- a/package/kernel/mac80211/patches/616-rt2x00-support-rt5350.patch ++++ b/package/kernel/mac80211/patches/616-rt2x00-support-rt5350.patch +@@ -240,7 +240,7 @@ + case RF5360: + case RF5362: + case RF5370: +-@@ -8287,6 +8398,7 @@ static int rt2800_probe_hw_mode(struct r ++@@ -8291,6 +8402,7 @@ static int rt2800_probe_hw_mode(struct r + case RF3290: + case RF3320: + case RF3322: +@@ -248,7 +248,7 @@ + case RF5360: + case RF5362: + case RF5370: +-@@ -8426,6 +8538,7 @@ static int rt2800_probe_hw_mode(struct r ++@@ -8430,6 +8542,7 @@ static int rt2800_probe_hw_mode(struct r + case RF3070: + case RF3290: + case RF3853: +@@ -256,7 +256,7 @@ + case RF5360: + case RF5362: + case RF5370: +-@@ -8466,6 +8579,7 @@ static int rt2800_probe_rt(struct rt2x00 ++@@ -8470,6 +8583,7 @@ static int rt2800_probe_rt(struct rt2x00 + case RT3572: + case RT3593: + case RT3883: +@@ -266,7 +266,7 @@ + case RT5592: + --- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h + +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h +-@@ -169,6 +169,7 @@ struct rt2x00_chip { ++@@ -170,6 +170,7 @@ struct rt2x00_chip { + #define RT3572 0x3572 + #define RT3593 0x3593 + #define RT3883 0x3883 /* WSOC */ +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 55452b9..dba6033 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/ralink/rt2x00/rt2x00dev.c + +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +-@@ -1284,7 +1284,7 @@ static inline void rt2x00lib_set_if_comb ++@@ -1283,7 +1283,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/801-libertas-configure-sysfs-links.patch b/package/kernel/mac80211/patches/801-libertas-configure-sysfs-links.patch +index fd885cc..02f3053 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/marvell/libertas/cfg.c + +++ b/drivers/net/wireless/marvell/libertas/cfg.c +-@@ -2084,6 +2084,8 @@ struct wireless_dev *lbs_cfg_alloc(struc ++@@ -2122,6 +2122,8 @@ struct wireless_dev *lbs_cfg_alloc(struc + goto err_wiphy_new; + } + +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 b67a95f..ad30608 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/marvell/libertas/cfg.c + +++ b/drivers/net/wireless/marvell/libertas/cfg.c +-@@ -2174,6 +2174,8 @@ int lbs_cfg_register(struct lbs_private ++@@ -2212,6 +2212,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 +deleted file mode 100644 +index 74cd448..0000000 +--- a/package/kernel/mac80211/patches/804-b43-sync-with-bcma.patch ++++ /dev/null +@@ -1,17 +0,0 @@ +---- 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/820-b43-add-antenna-control.patch b/package/kernel/mac80211/patches/820-b43-add-antenna-control.patch +index 06c731f..b60ef76 100644 +--- a/package/kernel/mac80211/patches/820-b43-add-antenna-control.patch ++++ b/package/kernel/mac80211/patches/820-b43-add-antenna-control.patch +@@ -42,7 +42,7 @@ + + if (wl->radio_enabled != phy->radio_on) { + if (wl->radio_enabled) { +-@@ -5209,6 +5206,47 @@ static int b43_op_get_survey(struct ieee ++@@ -5207,6 +5204,47 @@ static int b43_op_get_survey(struct ieee + return 0; + } + +@@ -90,7 +90,7 @@ + static const struct ieee80211_ops b43_hw_ops = { + .tx = b43_op_tx, + .conf_tx = b43_op_conf_tx, +-@@ -5230,6 +5268,8 @@ static const struct ieee80211_ops b43_hw ++@@ -5228,6 +5266,8 @@ static const struct ieee80211_ops b43_hw + .sw_scan_complete = b43_op_sw_scan_complete_notifier, + .get_survey = b43_op_get_survey, + .rfkill_poll = b43_rfkill_poll, +@@ -99,7 +99,7 @@ + }; + + /* Hard-reset the chip. Do not call this directly. +-@@ -5538,6 +5578,8 @@ static int b43_one_core_attach(struct b4 ++@@ -5536,6 +5576,8 @@ static int b43_one_core_attach(struct b4 + if (!wldev) + goto out; + +@@ -108,7 +108,7 @@ + wldev->use_pio = b43_modparam_pio; + wldev->dev = dev; + wldev->wl = wl; +-@@ -5628,6 +5670,9 @@ static struct b43_wl *b43_wireless_init( ++@@ -5626,6 +5668,9 @@ static struct b43_wl *b43_wireless_init( + + hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN; + +diff --git a/package/kernel/mac80211/patches/860-brcmfmac-add-missing-eth_type_trans-call.patch b/package/kernel/mac80211/patches/860-brcmfmac-add-missing-eth_type_trans-call.patch +new file mode 100644 +index 0000000..46227c4 +--- /dev/null ++++ b/package/kernel/mac80211/patches/860-brcmfmac-add-missing-eth_type_trans-call.patch +@@ -0,0 +1,26 @@ ++From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= ++Subject: [PATCH] brcmfmac: add missing eth_type_trans call ++MIME-Version: 1.0 ++Content-Type: text/plain; charset=UTF-8 ++Content-Transfer-Encoding: 8bit ++ ++There are 2 protocols supported by brcmfmac and msgbuf one was missing a ++proper skb setup before passing it to the netif. This was triggering ++"NULL pointer dereference". ++ ++Fixes: 9c349892ccc9 ("brcmfmac: revise handling events in receive path") ++Signed-off-by: Rafał Miłecki ++--- ++ ++--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c +++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c ++@@ -1157,6 +1157,9 @@ brcmf_msgbuf_process_rx_complete(struct ++ brcmu_pkt_buf_free_skb(skb); ++ return; ++ } +++ +++ skb->protocol = eth_type_trans(skb, ifp->ndev); +++ ++ brcmf_netif_rx(ifp, skb); ++ } ++ +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 00181f6..8cf9ea2 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,8 +13,8 @@ Signed-off-by: Rafał Miłecki + + --- 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 ++@@ -1232,6 +1232,7 @@ int __init brcmf_core_init(void) ++ { + if (!schedule_work(&brcmf_driver_work)) + return -EBUSY; + + flush_work(&brcmf_driver_work); +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 4295b4b..4f22a4e 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/broadcom/brcm80211/brcmfmac/cfg80211.c + +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-@@ -615,9 +615,37 @@ static struct wireless_dev *brcmf_cfg802 ++@@ -650,9 +650,37 @@ static struct wireless_dev *brcmf_cfg802 + u32 *flags, + struct vif_params *params) + { +@@ -42,7 +42,7 @@ Signed-off-by: Rafał Miłecki + + dev = dev_get_by_name(&init_net, name); + + if (dev) { + + dev_put(dev); +-+ return ERR_PTR(-EEXIST); +++ return ERR_PTR(-ENFILE); + + } + + + brcmf_dbg(TRACE, "enter: %s type %d\n", name, type); +diff --git a/package/kernel/mac80211/patches/863-brcmfmac-Disable-power-management.patch b/package/kernel/mac80211/patches/863-brcmfmac-Disable-power-management.patch +new file mode 100644 +index 0000000..f971bb7 +--- /dev/null ++++ b/package/kernel/mac80211/patches/863-brcmfmac-Disable-power-management.patch +@@ -0,0 +1,27 @@ ++From 66ae1b1750720a33e29792a177b1e696f4f005fb Mon Sep 17 00:00:00 2001 ++From: Phil Elwell ++Date: Wed, 9 Mar 2016 17:25:59 +0000 ++Subject: [PATCH] brcmfmac: Disable power management ++ ++Disable wireless power saving in the brcmfmac WLAN driver. This is a ++temporary measure until the connectivity loss resulting from power ++saving is resolved. ++ ++Signed-off-by: Phil Elwell ++--- ++ drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c | 2 ++ ++ 1 file changed, 2 insertions(+) ++ ++--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c ++@@ -2711,6 +2711,10 @@ brcmf_cfg80211_set_power_mgmt(struct wip ++ * preference in cfg struct to apply this to ++ * FW later while initializing the dongle ++ */ +++#if defined(CONFIG_BCM2708) || defined(CONFIG_BCM2709) +++ pr_info("power management disabled\n"); +++ enabled = false; +++#endif ++ cfg->pwr_save = enabled; ++ if (!check_vif_up(ifp->vif)) { ++ +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 f2e21ea..be210f2 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 +@@ -1184,7 +1184,7 @@ + break; + default: + rt2x00_err(rt2x00dev, "Invalid RF chipset 0x%04x detected\n", +-@@ -8423,6 +9363,7 @@ static int rt2800_probe_hw_mode(struct r ++@@ -8427,6 +9367,7 @@ static int rt2800_probe_hw_mode(struct r + case RF5372: + case RF5390: + case RF5392: +@@ -1192,7 +1192,7 @@ + spec->num_channels = 14; + if (spec->clk_is_20mhz) + spec->channels = rf_vals_xtal20mhz_3x; +-@@ -8563,6 +9504,7 @@ static int rt2800_probe_hw_mode(struct r ++@@ -8567,6 +9508,7 @@ static int rt2800_probe_hw_mode(struct r + case RF5372: + case RF5390: + case RF5392: +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 8c6d720..9322b45 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 + + --- a/drivers/net/wireless/ath/ath10k/core.c + +++ b/drivers/net/wireless/ath/ath10k/core.c +-@@ -1914,6 +1914,16 @@ int ath10k_core_register(struct ath10k * ++@@ -2012,6 +2012,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 281b447..1bfded0 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 +-@@ -7141,6 +7141,21 @@ struct ath10k_vif *ath10k_get_arvif(stru ++@@ -7717,6 +7717,21 @@ struct ath10k_vif *ath10k_get_arvif(stru + return arvif_iter.arvif; + } + +@@ -22,7 +22,7 @@ + int ath10k_mac_register(struct ath10k *ar) + { + static const u32 cipher_suites[] = { +-@@ -7357,6 +7372,12 @@ int ath10k_mac_register(struct ath10k *a ++@@ -7941,6 +7956,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/936-ath10k_skip_otp_check.patch b/package/kernel/mac80211/patches/936-ath10k_skip_otp_check.patch +new file mode 100644 +index 0000000..7f51dd2 +--- /dev/null ++++ b/package/kernel/mac80211/patches/936-ath10k_skip_otp_check.patch +@@ -0,0 +1,42 @@ ++--- a/drivers/net/wireless/ath/ath10k/core.c +++++ b/drivers/net/wireless/ath/ath10k/core.c ++@@ -1168,9 +1168,6 @@ static int ath10k_core_fetch_firmware_fi ++ { ++ int ret; ++ ++- /* calibration file is optional, don't check for any errors */ ++- ath10k_fetch_cal_file(ar); ++- ++ ar->fw_api = 5; ++ ath10k_dbg(ar, ATH10K_DBG_BOOT, "trying fw api %d\n", ar->fw_api); ++ ++@@ -1873,6 +1870,9 @@ static int ath10k_core_probe_fw(struct a ++ goto err_power_down; ++ } ++ +++ /* calibration file is optional, don't check for any errors */ +++ int calret = ath10k_fetch_cal_file(ar); +++ ++ ret = ath10k_core_fetch_firmware_files(ar); ++ if (ret) { ++ ath10k_err(ar, "could not fetch firmware files (%d)\n", ret); ++@@ -1895,11 +1895,14 @@ static int ath10k_core_probe_fw(struct a ++ "could not load pre cal data: %d\n", ret); ++ } ++ ++- ret = ath10k_core_get_board_id_from_otp(ar); ++- if (ret && ret != -EOPNOTSUPP) { ++- ath10k_err(ar, "failed to get board id from otp: %d\n", ++- ret); ++- goto err_free_firmware_files; +++ /* otp and board file not needed if calibration data is present */ +++ if (calret) { +++ ret = ath10k_core_get_board_id_from_otp(ar); +++ if (ret && ret != -EOPNOTSUPP) { +++ ath10k_err(ar, "failed to get board id from otp: %d\n", +++ ret); +++ goto err_free_firmware_files; +++ } ++ } ++ ++ ret = ath10k_core_fetch_board_file(ar); +diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile +index e49dd48..0f832e4 100644 +--- a/package/kernel/mt76/Makefile ++++ b/package/kernel/mt76/Makefile +@@ -1,7 +1,7 @@ + include $(TOPDIR)/rules.mk + + PKG_NAME:=mt76 +-PKG_VERSION:=2016-03-03 ++PKG_VERSION:=2016-06-17 + PKG_RELEASE=1 + + PKG_LICENSE:=GPLv2 +@@ -10,23 +10,26 @@ 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:=310d420178c86e253a172413da30ecf479b64251 ++PKG_SOURCE_VERSION:=f06ed811cda67ab2ed9932c3e87ba03229e75f4e + PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz + +-PKG_MAINTAINER:=Felix Fietkau ++PKG_MAINTAINER:=Felix Fietkau + PKG_BUILD_PARALLEL:=1 + ++STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backport/autoconf.h ++ + include $(INCLUDE_DIR)/kernel.mk + include $(INCLUDE_DIR)/package.mk + + define KernelPackage/mt76 + SUBMENU:=Wireless Drivers +- TITLE:=MediaTek MT76x2 wireless driver +- DEPENDS:=+kmod-mac80211 +@DRIVER_11N_SUPPORT @PCI_SUPPORT ++ TITLE:=MediaTek MT76x2/MT7603 wireless driver ++ DEPENDS:=+kmod-mac80211 +@DRIVER_11N_SUPPORT @PCI_SUPPORT @!LINUX_3_18 + FILES:=\ + $(PKG_BUILD_DIR)/mt76.ko \ +- $(PKG_BUILD_DIR)/mt76x2e.ko +- AUTOLOAD:=$(call AutoLoad,50,mac80211 mt76 mt76x2e) ++ $(PKG_BUILD_DIR)/mt76x2e.ko \ ++ $(PKG_BUILD_DIR)/mt7603e.ko ++ AUTOLOAD:=$(call AutoLoad,50,mac80211 mt76 mt76x2e mt7603e) + endef + + NOSTDINC_FLAGS = \ +@@ -54,6 +57,12 @@ endef + define KernelPackage/mt76/install + $(INSTALL_DIR) $(1)/lib/firmware + cp \ ++ $(if $(CONFIG_TARGET_ramips_mt7628) || $(CONFIG_TARGET_ramips_mt7688), \ ++ $(PKG_BUILD_DIR)/firmware/mt7628_e1.bin \ ++ $(PKG_BUILD_DIR)/firmware/mt7628_e2.bin \ ++ ) \ ++ $(PKG_BUILD_DIR)/firmware/mt7603_e1.bin \ ++ $(PKG_BUILD_DIR)/firmware/mt7603_e2.bin \ + $(PKG_BUILD_DIR)/firmware/mt7662_rom_patch.bin \ + $(PKG_BUILD_DIR)/firmware/mt7662.bin \ + $(1)/lib/firmware +diff --git a/package/kernel/mwlwifi/Makefile b/package/kernel/mwlwifi/Makefile +index 091928d..6a59a02 100644 +--- a/package/kernel/mwlwifi/Makefile ++++ b/package/kernel/mwlwifi/Makefile +@@ -8,7 +8,7 @@ + include $(TOPDIR)/rules.mk + + PKG_NAME:=mwlwifi +-PKG_VERSION:=10.3.0.16-20160105 ++PKG_VERSION:=10.3.0.17-20160520-1 + PKG_RELEASE=1 + + PKG_LICENSE:=ISC +@@ -17,7 +17,7 @@ PKG_LICENSE_FILES:= + PKG_SOURCE_URL:=https://github.com/kaloz/mwlwifi + PKG_SOURCE_PROTO:=git + PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +-PKG_SOURCE_VERSION:=99d3879cc72f2a25d44fb4bee96fd84eca028b04 ++PKG_SOURCE_VERSION:=7d49296d12b44025278a52c5a26fb1b4236f320f + PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz + + PKG_MAINTAINER:=Imre Kaloz +diff --git a/package/kernel/mwlwifi/patches/100-drop_old_api.patch b/package/kernel/mwlwifi/patches/100-drop_old_api.patch +index d2e149e..086edeb 100644 +--- a/package/kernel/mwlwifi/patches/100-drop_old_api.patch ++++ b/package/kernel/mwlwifi/patches/100-drop_old_api.patch +@@ -1,6 +1,6 @@ + --- a/main.c + +++ b/main.c +-@@ -418,11 +418,7 @@ static void mwl_set_ht_caps(struct mwl_p ++@@ -423,11 +423,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; + +@@ -12,7 +12,7 @@ + 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 * ++@@ -563,29 +559,16 @@ static int mwl_wl_init(struct mwl_priv * + hw->queues = SYSADPT_TX_WMM_QUEUES; + + /* Set rssi values to dBm */ +@@ -41,10 +41,10 @@ + -#endif + + hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN; +- ++ hw->wiphy->flags |= WIPHY_FLAG_HAS_CHANNEL_SWITCH; + --- a/dev.h + +++ b/dev.h +-@@ -484,10 +484,6 @@ static inline struct mwl_sta *mwl_dev_ge ++@@ -506,10 +506,6 @@ static inline struct mwl_sta *mwl_dev_ge + return (struct mwl_sta *)&sta->drv_priv; + } + +@@ -57,7 +57,7 @@ + + --- a/mac80211.c + +++ b/mac80211.c +-@@ -572,19 +572,11 @@ static int mwl_mac80211_get_survey(struc ++@@ -598,19 +598,11 @@ static int mwl_mac80211_get_survey(struc + return 0; + } + +diff --git a/package/kernel/mwlwifi/patches/110-api_sync.patch b/package/kernel/mwlwifi/patches/110-api_sync.patch +index ed3e06a..920cb8c 100644 +--- a/package/kernel/mwlwifi/patches/110-api_sync.patch ++++ b/package/kernel/mwlwifi/patches/110-api_sync.patch +@@ -1,6 +1,30 @@ + --- a/mac80211.c + +++ b/mac80211.c +-@@ -597,10 +597,13 @@ static int mwl_mac80211_get_survey(struc ++@@ -260,12 +260,12 @@ static int mwl_mac80211_config(struct ie ++ if (changed & IEEE80211_CONF_CHANGE_CHANNEL) { ++ int rate = 0; ++ ++- if (conf->chandef.chan->band == IEEE80211_BAND_2GHZ) { +++ if (conf->chandef.chan->band == NL80211_BAND_2GHZ) { ++ mwl_fwcmd_set_apmode(hw, AP_MODE_2_4GHZ_11AC_MIXED); ++ mwl_fwcmd_set_linkadapt_cs_mode(hw, ++ LINK_CS_STATE_CONSERV); ++ rate = mwl_rates_24[0].hw_value; ++- } else if (conf->chandef.chan->band == IEEE80211_BAND_5GHZ) { +++ } else if (conf->chandef.chan->band == NL80211_BAND_5GHZ) { ++ mwl_fwcmd_set_apmode(hw, AP_MODE_11AC); ++ mwl_fwcmd_set_linkadapt_cs_mode(hw, ++ LINK_CS_STATE_AUTO); ++@@ -333,7 +333,7 @@ static void mwl_mac80211_bss_info_change ++ if (idx) ++ idx--; ++ ++- if (hw->conf.chandef.chan->band == IEEE80211_BAND_2GHZ) +++ if (hw->conf.chandef.chan->band == NL80211_BAND_2GHZ) ++ rate = mwl_rates_24[idx].hw_value; ++ else ++ rate = mwl_rates_50[idx].hw_value; ++@@ -600,10 +600,13 @@ static int mwl_mac80211_get_survey(struc + + static int mwl_mac80211_ampdu_action(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, +@@ -17,3 +41,227 @@ + int rc = 0; + struct mwl_priv *priv = hw->priv; + struct mwl_ampdu_stream *stream; ++--- a/fwcmd.c +++++ b/fwcmd.c ++@@ -730,9 +730,9 @@ static int mwl_fwcmd_set_country_code(st ++ bool enable = false; ++ ++ if (b_inf->ie_country_ptr) { ++- if (bss_conf->chandef.chan->band == IEEE80211_BAND_2GHZ) +++ if (bss_conf->chandef.chan->band == NL80211_BAND_2GHZ) ++ a_band = false; ++- else if (bss_conf->chandef.chan->band == IEEE80211_BAND_5GHZ) +++ else if (bss_conf->chandef.chan->band == NL80211_BAND_5GHZ) ++ a_band = true; ++ else ++ return -EINVAL; ++@@ -1075,9 +1075,9 @@ int mwl_fwcmd_max_tx_power(struct ieee80 ++ break; ++ } ++ ++- if (channel->band == IEEE80211_BAND_2GHZ) +++ if (channel->band == NL80211_BAND_2GHZ) ++ band = FREQ_BAND_2DOT4GHZ; ++- else if (channel->band == IEEE80211_BAND_5GHZ) +++ else if (channel->band == NL80211_BAND_5GHZ) ++ band = FREQ_BAND_5GHZ; ++ ++ switch (conf->chandef.width) { ++@@ -1161,9 +1161,9 @@ int mwl_fwcmd_tx_power(struct ieee80211_ ++ break; ++ } ++ ++- if (channel->band == IEEE80211_BAND_2GHZ) +++ if (channel->band == NL80211_BAND_2GHZ) ++ band = FREQ_BAND_2DOT4GHZ; ++- else if (channel->band == IEEE80211_BAND_5GHZ) +++ else if (channel->band == NL80211_BAND_5GHZ) ++ band = FREQ_BAND_5GHZ; ++ ++ switch (conf->chandef.width) { ++@@ -1354,9 +1354,9 @@ int mwl_fwcmd_set_rf_channel(struct ieee ++ pcmd->action = cpu_to_le16(WL_SET); ++ pcmd->curr_chnl = channel->hw_value; ++ ++- if (channel->band == IEEE80211_BAND_2GHZ) { +++ if (channel->band == NL80211_BAND_2GHZ) { ++ freq_band = FREQ_BAND_2DOT4GHZ; ++- } else if (channel->band == IEEE80211_BAND_5GHZ) { +++ } else if (channel->band == NL80211_BAND_5GHZ) { ++ freq_band = FREQ_BAND_5GHZ; ++ } else { ++ mutex_unlock(&priv->fwcmd_mutex); ++@@ -1923,10 +1923,10 @@ int mwl_fwcmd_set_new_stn_add(struct iee ++ } ++ ether_addr_copy(pcmd->mac_addr, sta->addr); ++ ++- if (hw->conf.chandef.chan->band == IEEE80211_BAND_2GHZ) ++- rates = sta->supp_rates[IEEE80211_BAND_2GHZ]; +++ if (hw->conf.chandef.chan->band == NL80211_BAND_2GHZ) +++ rates = sta->supp_rates[NL80211_BAND_2GHZ]; ++ else ++- rates = sta->supp_rates[IEEE80211_BAND_5GHZ] << 5; +++ rates = sta->supp_rates[NL80211_BAND_5GHZ] << 5; ++ pcmd->peer_info.legacy_rate_bitmap = cpu_to_le32(rates); ++ ++ if (sta->ht_cap.ht_supported) { ++@@ -2097,9 +2097,9 @@ int mwl_fwcmd_set_switch_channel(struct ++ if (priv->csa_active) ++ return 0; ++ ++- if (channel->band == IEEE80211_BAND_2GHZ) +++ if (channel->band == NL80211_BAND_2GHZ) ++ freq_band = FREQ_BAND_2DOT4GHZ; ++- else if (channel->band == IEEE80211_BAND_5GHZ) +++ else if (channel->band == NL80211_BAND_5GHZ) ++ freq_band = FREQ_BAND_5GHZ; ++ else ++ return -EINVAL; ++--- a/main.c +++++ b/main.c ++@@ -63,20 +63,20 @@ static struct mwl_chip_info mwl_chip_tbl ++ }; ++ ++ static const struct ieee80211_channel mwl_channels_24[] = { ++- { .band = IEEE80211_BAND_2GHZ, .center_freq = 2412, .hw_value = 1, }, ++- { .band = IEEE80211_BAND_2GHZ, .center_freq = 2417, .hw_value = 2, }, ++- { .band = IEEE80211_BAND_2GHZ, .center_freq = 2422, .hw_value = 3, }, ++- { .band = IEEE80211_BAND_2GHZ, .center_freq = 2427, .hw_value = 4, }, ++- { .band = IEEE80211_BAND_2GHZ, .center_freq = 2432, .hw_value = 5, }, ++- { .band = IEEE80211_BAND_2GHZ, .center_freq = 2437, .hw_value = 6, }, ++- { .band = IEEE80211_BAND_2GHZ, .center_freq = 2442, .hw_value = 7, }, ++- { .band = IEEE80211_BAND_2GHZ, .center_freq = 2447, .hw_value = 8, }, ++- { .band = IEEE80211_BAND_2GHZ, .center_freq = 2452, .hw_value = 9, }, ++- { .band = IEEE80211_BAND_2GHZ, .center_freq = 2457, .hw_value = 10, }, ++- { .band = IEEE80211_BAND_2GHZ, .center_freq = 2462, .hw_value = 11, }, ++- { .band = IEEE80211_BAND_2GHZ, .center_freq = 2467, .hw_value = 12, }, ++- { .band = IEEE80211_BAND_2GHZ, .center_freq = 2472, .hw_value = 13, }, ++- { .band = IEEE80211_BAND_2GHZ, .center_freq = 2484, .hw_value = 14, }, +++ { .band = NL80211_BAND_2GHZ, .center_freq = 2412, .hw_value = 1, }, +++ { .band = NL80211_BAND_2GHZ, .center_freq = 2417, .hw_value = 2, }, +++ { .band = NL80211_BAND_2GHZ, .center_freq = 2422, .hw_value = 3, }, +++ { .band = NL80211_BAND_2GHZ, .center_freq = 2427, .hw_value = 4, }, +++ { .band = NL80211_BAND_2GHZ, .center_freq = 2432, .hw_value = 5, }, +++ { .band = NL80211_BAND_2GHZ, .center_freq = 2437, .hw_value = 6, }, +++ { .band = NL80211_BAND_2GHZ, .center_freq = 2442, .hw_value = 7, }, +++ { .band = NL80211_BAND_2GHZ, .center_freq = 2447, .hw_value = 8, }, +++ { .band = NL80211_BAND_2GHZ, .center_freq = 2452, .hw_value = 9, }, +++ { .band = NL80211_BAND_2GHZ, .center_freq = 2457, .hw_value = 10, }, +++ { .band = NL80211_BAND_2GHZ, .center_freq = 2462, .hw_value = 11, }, +++ { .band = NL80211_BAND_2GHZ, .center_freq = 2467, .hw_value = 12, }, +++ { .band = NL80211_BAND_2GHZ, .center_freq = 2472, .hw_value = 13, }, +++ { .band = NL80211_BAND_2GHZ, .center_freq = 2484, .hw_value = 14, }, ++ }; ++ ++ static const struct ieee80211_rate mwl_rates_24[] = { ++@@ -96,30 +96,30 @@ static const struct ieee80211_rate mwl_r ++ }; ++ ++ static const struct ieee80211_channel mwl_channels_50[] = { ++- { .band = IEEE80211_BAND_5GHZ, .center_freq = 5180, .hw_value = 36, }, ++- { .band = IEEE80211_BAND_5GHZ, .center_freq = 5200, .hw_value = 40, }, ++- { .band = IEEE80211_BAND_5GHZ, .center_freq = 5220, .hw_value = 44, }, ++- { .band = IEEE80211_BAND_5GHZ, .center_freq = 5240, .hw_value = 48, }, ++- { .band = IEEE80211_BAND_5GHZ, .center_freq = 5260, .hw_value = 52, }, ++- { .band = IEEE80211_BAND_5GHZ, .center_freq = 5280, .hw_value = 56, }, ++- { .band = IEEE80211_BAND_5GHZ, .center_freq = 5300, .hw_value = 60, }, ++- { .band = IEEE80211_BAND_5GHZ, .center_freq = 5320, .hw_value = 64, }, ++- { .band = IEEE80211_BAND_5GHZ, .center_freq = 5500, .hw_value = 100, }, ++- { .band = IEEE80211_BAND_5GHZ, .center_freq = 5520, .hw_value = 104, }, ++- { .band = IEEE80211_BAND_5GHZ, .center_freq = 5540, .hw_value = 108, }, ++- { .band = IEEE80211_BAND_5GHZ, .center_freq = 5560, .hw_value = 112, }, ++- { .band = IEEE80211_BAND_5GHZ, .center_freq = 5580, .hw_value = 116, }, ++- { .band = IEEE80211_BAND_5GHZ, .center_freq = 5600, .hw_value = 120, }, ++- { .band = IEEE80211_BAND_5GHZ, .center_freq = 5620, .hw_value = 124, }, ++- { .band = IEEE80211_BAND_5GHZ, .center_freq = 5640, .hw_value = 128, }, ++- { .band = IEEE80211_BAND_5GHZ, .center_freq = 5660, .hw_value = 132, }, ++- { .band = IEEE80211_BAND_5GHZ, .center_freq = 5680, .hw_value = 136, }, ++- { .band = IEEE80211_BAND_5GHZ, .center_freq = 5700, .hw_value = 140, }, ++- { .band = IEEE80211_BAND_5GHZ, .center_freq = 5720, .hw_value = 144, }, ++- { .band = IEEE80211_BAND_5GHZ, .center_freq = 5745, .hw_value = 149, }, ++- { .band = IEEE80211_BAND_5GHZ, .center_freq = 5765, .hw_value = 153, }, ++- { .band = IEEE80211_BAND_5GHZ, .center_freq = 5785, .hw_value = 157, }, ++- { .band = IEEE80211_BAND_5GHZ, .center_freq = 5805, .hw_value = 161, }, +++ { .band = NL80211_BAND_5GHZ, .center_freq = 5180, .hw_value = 36, }, +++ { .band = NL80211_BAND_5GHZ, .center_freq = 5200, .hw_value = 40, }, +++ { .band = NL80211_BAND_5GHZ, .center_freq = 5220, .hw_value = 44, }, +++ { .band = NL80211_BAND_5GHZ, .center_freq = 5240, .hw_value = 48, }, +++ { .band = NL80211_BAND_5GHZ, .center_freq = 5260, .hw_value = 52, }, +++ { .band = NL80211_BAND_5GHZ, .center_freq = 5280, .hw_value = 56, }, +++ { .band = NL80211_BAND_5GHZ, .center_freq = 5300, .hw_value = 60, }, +++ { .band = NL80211_BAND_5GHZ, .center_freq = 5320, .hw_value = 64, }, +++ { .band = NL80211_BAND_5GHZ, .center_freq = 5500, .hw_value = 100, }, +++ { .band = NL80211_BAND_5GHZ, .center_freq = 5520, .hw_value = 104, }, +++ { .band = NL80211_BAND_5GHZ, .center_freq = 5540, .hw_value = 108, }, +++ { .band = NL80211_BAND_5GHZ, .center_freq = 5560, .hw_value = 112, }, +++ { .band = NL80211_BAND_5GHZ, .center_freq = 5580, .hw_value = 116, }, +++ { .band = NL80211_BAND_5GHZ, .center_freq = 5600, .hw_value = 120, }, +++ { .band = NL80211_BAND_5GHZ, .center_freq = 5620, .hw_value = 124, }, +++ { .band = NL80211_BAND_5GHZ, .center_freq = 5640, .hw_value = 128, }, +++ { .band = NL80211_BAND_5GHZ, .center_freq = 5660, .hw_value = 132, }, +++ { .band = NL80211_BAND_5GHZ, .center_freq = 5680, .hw_value = 136, }, +++ { .band = NL80211_BAND_5GHZ, .center_freq = 5700, .hw_value = 140, }, +++ { .band = NL80211_BAND_5GHZ, .center_freq = 5720, .hw_value = 144, }, +++ { .band = NL80211_BAND_5GHZ, .center_freq = 5745, .hw_value = 149, }, +++ { .band = NL80211_BAND_5GHZ, .center_freq = 5765, .hw_value = 153, }, +++ { .band = NL80211_BAND_5GHZ, .center_freq = 5785, .hw_value = 157, }, +++ { .band = NL80211_BAND_5GHZ, .center_freq = 5805, .hw_value = 161, }, ++ }; ++ ++ static const struct ieee80211_rate mwl_rates_50[] = { ++@@ -478,7 +478,7 @@ static void mwl_set_caps(struct mwl_priv ++ BUILD_BUG_ON(sizeof(priv->rates_24) != sizeof(mwl_rates_24)); ++ memcpy(priv->rates_24, mwl_rates_24, sizeof(mwl_rates_24)); ++ ++- priv->band_24.band = IEEE80211_BAND_2GHZ; +++ priv->band_24.band = NL80211_BAND_2GHZ; ++ priv->band_24.channels = priv->channels_24; ++ priv->band_24.n_channels = ARRAY_SIZE(mwl_channels_24); ++ priv->band_24.bitrates = priv->rates_24; ++@@ -487,7 +487,7 @@ static void mwl_set_caps(struct mwl_priv ++ mwl_set_ht_caps(priv, &priv->band_24); ++ mwl_set_vht_caps(priv, &priv->band_24); ++ ++- hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &priv->band_24; +++ hw->wiphy->bands[NL80211_BAND_2GHZ] = &priv->band_24; ++ } ++ ++ /* set up band information for 5G */ ++@@ -500,7 +500,7 @@ static void mwl_set_caps(struct mwl_priv ++ BUILD_BUG_ON(sizeof(priv->rates_50) != sizeof(mwl_rates_50)); ++ memcpy(priv->rates_50, mwl_rates_50, sizeof(mwl_rates_50)); ++ ++- priv->band_50.band = IEEE80211_BAND_5GHZ; +++ priv->band_50.band = NL80211_BAND_5GHZ; ++ priv->band_50.channels = priv->channels_50; ++ priv->band_50.n_channels = ARRAY_SIZE(mwl_channels_50); ++ priv->band_50.bitrates = priv->rates_50; ++@@ -509,7 +509,7 @@ static void mwl_set_caps(struct mwl_priv ++ mwl_set_ht_caps(priv, &priv->band_50); ++ mwl_set_vht_caps(priv, &priv->band_50); ++ ++- hw->wiphy->bands[IEEE80211_BAND_5GHZ] = &priv->band_50; +++ hw->wiphy->bands[NL80211_BAND_5GHZ] = &priv->band_50; ++ } ++ } ++ ++--- a/rx.c +++++ b/rx.c ++@@ -243,7 +243,7 @@ static inline void mwl_rx_prepare_status ++ status->rate_idx = rt; ++ ++ if (pdesc->channel > BAND_24_CHANNEL_NUM) { ++- status->band = IEEE80211_BAND_5GHZ; +++ status->band = NL80211_BAND_5GHZ; ++ if ((!(status->flag & RX_FLAG_HT)) && ++ (!(status->flag & RX_FLAG_VHT))) { ++ status->rate_idx -= 5; ++@@ -251,7 +251,7 @@ static inline void mwl_rx_prepare_status ++ status->rate_idx = BAND_50_RATE_NUM - 1; ++ } ++ } else { ++- status->band = IEEE80211_BAND_2GHZ; +++ status->band = NL80211_BAND_2GHZ; ++ if ((!(status->flag & RX_FLAG_HT)) && ++ (!(status->flag & RX_FLAG_VHT))) { ++ if (status->rate_idx >= BAND_24_RATE_NUM) +diff --git a/package/kernel/mwlwifi/patches/200-fix_excessive_delays.patch b/package/kernel/mwlwifi/patches/200-fix_excessive_delays.patch +new file mode 100644 +index 0000000..43523ed +--- /dev/null ++++ b/package/kernel/mwlwifi/patches/200-fix_excessive_delays.patch +@@ -0,0 +1,73 @@ ++--- a/fwcmd.c +++++ b/fwcmd.c ++@@ -132,7 +132,7 @@ static int mwl_fwcmd_wait_complete(struc ++ int_code = le16_to_cpu(*((__le16 *)&priv->pcmd_buf[2])); ++ else ++ int_code = le16_to_cpu(*((__le16 *)&priv->pcmd_buf[0])); ++- mdelay(1); +++ usleep_range(1000, 2000); ++ } while ((int_code != cmd) && (--curr_iteration)); ++ ++ if (curr_iteration == 0) { ++@@ -142,7 +142,7 @@ static int mwl_fwcmd_wait_complete(struc ++ return -EIO; ++ } ++ ++- mdelay(3); +++ usleep_range(3000, 5000); ++ ++ return 0; ++ } ++--- a/fwdl.c +++++ b/fwdl.c ++@@ -74,7 +74,7 @@ int mwl_fwdl_download_firmware(struct ie ++ /* FW before jumping to boot rom, it will enable PCIe transaction retry, ++ * wait for boot code to stop it. ++ */ ++- mdelay(FW_CHECK_MSECS); +++ usleep_range(FW_CHECK_MSECS * 1000, FW_CHECK_MSECS * 2000); ++ ++ writel(MACREG_A2HRIC_BIT_MASK, ++ priv->iobase1 + MACREG_REG_A2H_INTERRUPT_CLEAR_SEL); ++@@ -95,7 +95,7 @@ int mwl_fwdl_download_firmware(struct ie ++ ++ /* make sure SCRATCH2 C40 is clear, in case we are too quick */ ++ while (readl(priv->iobase1 + 0xc40) == 0) ++- ; +++ cond_resched(); ++ ++ while (size_fw_downloaded < fw->size) { ++ len = readl(priv->iobase1 + 0xc40); ++@@ -125,6 +125,7 @@ int mwl_fwdl_download_firmware(struct ie ++ int_code = readl(priv->iobase1 + 0xc1c); ++ if (int_code != 0) ++ break; +++ cond_resched(); ++ curr_iteration--; ++ } while (curr_iteration); ++ ++@@ -133,6 +134,7 @@ int mwl_fwdl_download_firmware(struct ie ++ if ((int_code & MACREG_H2ARIC_BIT_DOOR_BELL) != ++ MACREG_H2ARIC_BIT_DOOR_BELL) ++ break; +++ cond_resched(); ++ curr_iteration--; ++ } while (curr_iteration); ++ ++@@ -167,12 +169,14 @@ int mwl_fwdl_download_firmware(struct ie ++ do { ++ curr_iteration--; ++ if (priv->mfg_mode && priv->chip_type == MWL8897) { ++- mdelay(FW_CHECK_MSECS); +++ usleep_range(FW_CHECK_MSECS * 1000, +++ FW_CHECK_MSECS * 2000); ++ int_code = readl(priv->iobase1 + 0xc44); ++ } else { ++ writel(HOSTCMD_SOFTAP_MODE, ++ priv->iobase1 + MACREG_REG_GEN_PTR); ++- mdelay(FW_CHECK_MSECS); +++ usleep_range(FW_CHECK_MSECS * 1000, +++ FW_CHECK_MSECS * 2000); ++ int_code = readl(priv->iobase1 + MACREG_REG_INT_CODE); ++ } ++ if (!(curr_iteration % 0xff) && (int_code != 0)) +diff --git a/package/kernel/mwlwifi/patches/210-fix_logspam.patch b/package/kernel/mwlwifi/patches/210-fix_logspam.patch +new file mode 100644 +index 0000000..99b247f +--- /dev/null ++++ b/package/kernel/mwlwifi/patches/210-fix_logspam.patch +@@ -0,0 +1,22 @@ ++--- a/fwcmd.c +++++ b/fwcmd.c ++@@ -2393,8 +2393,6 @@ int mwl_fwcmd_check_ba(struct ieee80211_ ++ ++ if (pcmd->cmd_hdr.result != 0) { ++ mutex_unlock(&priv->fwcmd_mutex); ++- wiphy_err(hw->wiphy, "check ba result error %d\n", ++- le16_to_cpu(pcmd->cmd_hdr.result)); ++ return -EINVAL; ++ } ++ ++--- a/mac80211.c +++++ b/mac80211.c ++@@ -644,8 +644,6 @@ static int mwl_mac80211_ampdu_action(str ++ spin_lock_bh(&priv->stream_lock); ++ if (rc) { ++ mwl_fwcmd_remove_stream(hw, stream); ++- wiphy_err(hw->wiphy, ++- "ampdu start error code: %d\n", rc); ++ rc = -EPERM; ++ break; ++ } +diff --git a/package/network/utils/iw/Makefile b/package/network/utils/iw/Makefile +index ad82081..d17cbca 100644 +--- a/package/network/utils/iw/Makefile ++++ b/package/network/utils/iw/Makefile +@@ -12,10 +12,10 @@ PKG_VERSION:=4.3 + PKG_RELEASE:=1 + + PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +-PKG_SOURCE_URL:=https://www.kernel.org/pub/software/network/iw ++PKG_SOURCE_URL:=@KERNEL/software/network/iw + PKG_MD5SUM:=7adec72e91ebdd9c55429fa34a23a6f5 + +-PKG_MAINTAINER:=Felix Fietkau ++PKG_MAINTAINER:=Felix Fietkau + PKG_LICENSE:=GPL-2.0 + + include $(INCLUDE_DIR)/package.mk +diff --git a/package/network/utils/iw/patches/001-nl80211_h_sync.patch b/package/network/utils/iw/patches/001-nl80211_h_sync.patch +index 7de2258..e5ea8f7 100644 +--- a/package/network/utils/iw/patches/001-nl80211_h_sync.patch ++++ b/package/network/utils/iw/patches/001-nl80211_h_sync.patch +@@ -8,7 +8,17 @@ + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above +-@@ -328,7 +329,15 @@ ++@@ -321,14 +322,24 @@ ++ * @NL80211_CMD_GET_SCAN: get scan results ++ * @NL80211_CMD_TRIGGER_SCAN: trigger a new scan with the given parameters ++ * %NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the ++- * probe requests at CCK rate or not. +++ * probe requests at CCK rate or not. %NL80211_ATTR_MAC can be used to +++ * specify a BSSID to scan for; if not included, the wildcard BSSID will +++ * be used. ++ * @NL80211_CMD_NEW_SCAN_RESULTS: scan notification (as a reply to ++ * NL80211_CMD_GET_SCAN and on the "scan" multicast group) ++ * @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons, + * partial scan results may be available + * + * @NL80211_CMD_START_SCHED_SCAN: start a scheduled scan at certain +@@ -25,7 +35,82 @@ + * Like with normal scans, if SSIDs (%NL80211_ATTR_SCAN_SSIDS) + * are passed, they are used in the probe requests. For + * broadcast, a broadcast SSID must be passed (ie. an empty +-@@ -1761,6 +1770,22 @@ enum nl80211_commands { ++@@ -418,7 +429,11 @@ ++ * @NL80211_CMD_ASSOCIATE: association request and notification; like ++ * NL80211_CMD_AUTHENTICATE but for Association and Reassociation ++ * (similar to MLME-ASSOCIATE.request, MLME-REASSOCIATE.request, ++- * MLME-ASSOCIATE.confirm or MLME-REASSOCIATE.confirm primitives). +++ * MLME-ASSOCIATE.confirm or MLME-REASSOCIATE.confirm primitives). The +++ * %NL80211_ATTR_PREV_BSSID attribute is used to specify whether the +++ * request is for the initial association to an ESS (that attribute not +++ * included) or for reassociation within the ESS (that attribute is +++ * included). ++ * @NL80211_CMD_DEAUTHENTICATE: deauthentication request and notification; like ++ * NL80211_CMD_AUTHENTICATE but for Deauthentication frames (similar to ++ * MLME-DEAUTHENTICATION.request and MLME-DEAUTHENTICATE.indication ++@@ -468,6 +483,9 @@ ++ * set of BSSID,frequency parameters is used (i.e., either the enforcing ++ * %NL80211_ATTR_MAC,%NL80211_ATTR_WIPHY_FREQ or the less strict ++ * %NL80211_ATTR_MAC_HINT and %NL80211_ATTR_WIPHY_FREQ_HINT). +++ * %NL80211_ATTR_PREV_BSSID can be used to request a reassociation within +++ * the ESS in case the device is already associated and an association with +++ * a different BSS is desired. ++ * Background scan period can optionally be ++ * specified in %NL80211_ATTR_BG_SCAN_PERIOD, ++ * if not specified default background scan configuration ++@@ -811,6 +829,10 @@ ++ * as an event to indicate changes for devices with wiphy-specific regdom ++ * management. ++ * +++ * @NL80211_CMD_ABORT_SCAN: Stop an ongoing scan. Returns -ENOENT if a scan is +++ * not running. The driver indicates the status of the scan through +++ * cfg80211_scan_done(). +++ * ++ * @NL80211_CMD_MAX: highest used command number ++ * @__NL80211_CMD_AFTER_LAST: internal use ++ */ ++@@ -997,6 +1019,8 @@ enum nl80211_commands { ++ ++ NL80211_CMD_WIPHY_REG_CHANGE, ++ +++ NL80211_CMD_ABORT_SCAN, +++ ++ /* add new commands above here */ ++ ++ /* used to define NL80211_CMD_MAX below */ ++@@ -1270,8 +1294,11 @@ enum nl80211_commands { ++ * @NL80211_ATTR_RESP_IE: (Re)association response information elements as ++ * sent by peer, for ROAM and successful CONNECT events. ++ * ++- * @NL80211_ATTR_PREV_BSSID: previous BSSID, to be used by in ASSOCIATE ++- * commands to specify using a reassociate frame +++ * @NL80211_ATTR_PREV_BSSID: previous BSSID, to be used in ASSOCIATE and CONNECT +++ * commands to specify a request to reassociate within an ESS, i.e., to use +++ * Reassociate Request frame (with the value of this attribute in the +++ * Current AP address field) instead of Association Request frame which is +++ * used for the initial association to an ESS. ++ * ++ * @NL80211_ATTR_KEY: key information in a nested attribute with ++ * %NL80211_KEY_* sub-attributes ++@@ -1712,6 +1739,8 @@ enum nl80211_commands { ++ * underlying device supports these minimal RRM features: ++ * %NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES, ++ * %NL80211_FEATURE_QUIET, +++ * Or, if global RRM is supported, see: +++ * %NL80211_EXT_FEATURE_RRM ++ * If this flag is used, driver must add the Power Capabilities IE to the ++ * association request. In addition, it must also set the RRM capability ++ * flag in the association request's Capability Info field. ++@@ -1755,12 +1784,44 @@ enum nl80211_commands { ++ * over all channels. ++ * ++ * @NL80211_ATTR_SCHED_SCAN_DELAY: delay before the first cycle of a ++- * scheduled scan (or a WoWLAN net-detect scan) is started, u32 ++- * in seconds. +++ * scheduled scan is started. Or the delay before a WoWLAN +++ * net-detect scan is started, counting from the moment the +++ * system is suspended. This value is a u32, in seconds. ++ + * @NL80211_ATTR_REG_INDOOR: flag attribute, if set indicates that the device + * is operating in an indoor environment. + * +@@ -41,6 +126,21 @@ + + * thus it must not specify the number of iterations, only the interval + + * between scans. The scan plans are executed sequentially. + + * Each scan plan is a nested attribute of &enum nl80211_sched_scan_plan. +++ * @NL80211_ATTR_PBSS: flag attribute. If set it means operate +++ * in a PBSS. Specified in %NL80211_CMD_CONNECT to request +++ * connecting to a PCP, and in %NL80211_CMD_START_AP to start +++ * a PCP instead of AP. Relevant for DMG networks only. +++ * @NL80211_ATTR_BSS_SELECT: nested attribute for driver supporting the +++ * BSS selection feature. When used with %NL80211_CMD_GET_WIPHY it contains +++ * attributes according &enum nl80211_bss_select_attr to indicate what +++ * BSS selection behaviours are supported. When used with %NL80211_CMD_CONNECT +++ * it contains the behaviour-specific attribute containing the parameters for +++ * BSS selection to be done by driver and/or firmware. +++ * +++ * @NL80211_ATTR_STA_SUPPORT_P2P_PS: whether P2P PS mechanism supported +++ * or not. u8, one of the values of &enum nl80211_sta_p2p_ps_status +++ * +++ * @NL80211_ATTR_PAD: attribute used for padding for 64-bit alignment + + * + + * @NL80211_ATTR_WIPHY_ANTENNA_GAIN: Configured antenna gain. Used to reduce + + * transmit power to stay within regulatory limits. u32, dBi. +@@ -48,7 +148,7 @@ + * @NUM_NL80211_ATTR: total number of nl80211_attrs available + * @NL80211_ATTR_MAX: highest attribute number currently defined + * @__NL80211_ATTR_AFTER_LAST: internal use +-@@ -2130,6 +2155,13 @@ enum nl80211_attrs { ++@@ -2130,6 +2191,21 @@ enum nl80211_attrs { + + NL80211_ATTR_REG_INDOOR, + +@@ -57,30 +157,147 @@ + + NL80211_ATTR_MAX_SCAN_PLAN_ITERATIONS, + + NL80211_ATTR_SCHED_SCAN_PLANS, + + +++ NL80211_ATTR_PBSS, +++ +++ NL80211_ATTR_BSS_SELECT, +++ +++ NL80211_ATTR_STA_SUPPORT_P2P_PS, +++ +++ NL80211_ATTR_PAD, +++ + + NL80211_ATTR_WIPHY_ANTENNA_GAIN, + + + /* add attributes here, update the policy in nl80211.c */ + + __NL80211_ATTR_AFTER_LAST, +-@@ -3364,6 +3396,9 @@ enum nl80211_bss_scan_width { ++@@ -2273,6 +2349,20 @@ enum nl80211_sta_flags { ++ NL80211_STA_FLAG_MAX = __NL80211_STA_FLAG_AFTER_LAST - 1 ++ }; ++ +++/** +++ * enum nl80211_sta_p2p_ps_status - station support of P2P PS +++ * +++ * @NL80211_P2P_PS_UNSUPPORTED: station doesn't support P2P PS mechanism +++ * @@NL80211_P2P_PS_SUPPORTED: station supports P2P PS mechanism +++ * @NUM_NL80211_P2P_PS_STATUS: number of values +++ */ +++enum nl80211_sta_p2p_ps_status { +++ NL80211_P2P_PS_UNSUPPORTED = 0, +++ NL80211_P2P_PS_SUPPORTED, +++ +++ NUM_NL80211_P2P_PS_STATUS, +++}; +++ ++ #define NL80211_STA_FLAG_MAX_OLD_API NL80211_STA_FLAG_TDLS_PEER ++ ++ /** ++@@ -2430,6 +2520,9 @@ enum nl80211_sta_bss_param { ++ * TID+1 and the special TID 16 (i.e. value 17) is used for non-QoS frames; ++ * each one of those is again nested with &enum nl80211_tid_stats ++ * attributes carrying the actual values. +++ * @NL80211_STA_INFO_RX_DURATION: aggregate PPDU duration for all frames +++ * received from the station (u64, usec) +++ * @NL80211_STA_INFO_PAD: attribute used for padding for 64-bit alignment ++ * @__NL80211_STA_INFO_AFTER_LAST: internal ++ * @NL80211_STA_INFO_MAX: highest possible station info attribute ++ */ ++@@ -2466,6 +2559,8 @@ enum nl80211_sta_info { ++ NL80211_STA_INFO_BEACON_RX, ++ NL80211_STA_INFO_BEACON_SIGNAL_AVG, ++ NL80211_STA_INFO_TID_STATS, +++ NL80211_STA_INFO_RX_DURATION, +++ NL80211_STA_INFO_PAD, ++ ++ /* keep last */ ++ __NL80211_STA_INFO_AFTER_LAST, ++@@ -2482,6 +2577,7 @@ enum nl80211_sta_info { ++ * transmitted MSDUs (not counting the first attempt; u64) ++ * @NL80211_TID_STATS_TX_MSDU_FAILED: number of failed transmitted ++ * MSDUs (u64) +++ * @NL80211_TID_STATS_PAD: attribute used for padding for 64-bit alignment ++ * @NUM_NL80211_TID_STATS: number of attributes here ++ * @NL80211_TID_STATS_MAX: highest numbered attribute here ++ */ ++@@ -2491,6 +2587,7 @@ enum nl80211_tid_stats { ++ NL80211_TID_STATS_TX_MSDU, ++ NL80211_TID_STATS_TX_MSDU_RETRIES, ++ NL80211_TID_STATS_TX_MSDU_FAILED, +++ NL80211_TID_STATS_PAD, ++ ++ /* keep last */ ++ NUM_NL80211_TID_STATS, ++@@ -2927,6 +3024,7 @@ enum nl80211_user_reg_hint_type { ++ * transmitting data (on channel or globally) ++ * @NL80211_SURVEY_INFO_TIME_SCAN: time the radio spent for scan ++ * (on this channel or globally) +++ * @NL80211_SURVEY_INFO_PAD: attribute used for padding for 64-bit alignment ++ * @NL80211_SURVEY_INFO_MAX: highest survey info attribute number ++ * currently defined ++ * @__NL80211_SURVEY_INFO_AFTER_LAST: internal use ++@@ -2942,6 +3040,7 @@ enum nl80211_survey_info { ++ NL80211_SURVEY_INFO_TIME_RX, ++ NL80211_SURVEY_INFO_TIME_TX, ++ NL80211_SURVEY_INFO_TIME_SCAN, +++ NL80211_SURVEY_INFO_PAD, ++ ++ /* keep last */ ++ __NL80211_SURVEY_INFO_AFTER_LAST, ++@@ -3364,6 +3463,10 @@ enum nl80211_bss_scan_width { + * (not present if no beacon frame has been received yet) + * @NL80211_BSS_PRESP_DATA: the data in @NL80211_BSS_INFORMATION_ELEMENTS and + * @NL80211_BSS_TSF is known to be from a probe response (flag attribute) + + * @NL80211_BSS_LAST_SEEN_BOOTTIME: CLOCK_BOOTTIME timestamp when this entry + + * was last updated by a received frame. The value is expected to be + + * accurate to about 10ms. (u64, nanoseconds) +++ * @NL80211_BSS_PAD: attribute used for padding for 64-bit alignment + * @__NL80211_BSS_AFTER_LAST: internal + * @NL80211_BSS_MAX: highest BSS attribute + */ +-@@ -3383,6 +3418,7 @@ enum nl80211_bss { ++@@ -3383,6 +3486,8 @@ enum nl80211_bss { + NL80211_BSS_CHAN_WIDTH, + NL80211_BSS_BEACON_TSF, + NL80211_BSS_PRESP_DATA, + + NL80211_BSS_LAST_SEEN_BOOTTIME, +++ NL80211_BSS_PAD, + + /* keep last */ + __NL80211_BSS_AFTER_LAST, +-@@ -4589,4 +4625,28 @@ enum nl80211_tdls_peer_capability { ++@@ -3568,11 +3673,15 @@ enum nl80211_txrate_gi { ++ * @NL80211_BAND_2GHZ: 2.4 GHz ISM band ++ * @NL80211_BAND_5GHZ: around 5 GHz band (4.9 - 5.7 GHz) ++ * @NL80211_BAND_60GHZ: around 60 GHz band (58.32 - 64.80 GHz) +++ * @NUM_NL80211_BANDS: number of bands, avoid using this in userspace +++ * since newer kernel versions may support more bands ++ */ ++ enum nl80211_band { ++ NL80211_BAND_2GHZ, ++ NL80211_BAND_5GHZ, ++ NL80211_BAND_60GHZ, +++ +++ NUM_NL80211_BANDS, ++ }; ++ ++ /** ++@@ -4358,12 +4467,18 @@ enum nl80211_feature_flags { ++ /** ++ * enum nl80211_ext_feature_index - bit index of extended features. ++ * @NL80211_EXT_FEATURE_VHT_IBSS: This driver supports IBSS with VHT datarates. +++ * @NL80211_EXT_FEATURE_RRM: This driver supports RRM. When featured, user can +++ * can request to use RRM (see %NL80211_ATTR_USE_RRM) with +++ * %NL80211_CMD_ASSOCIATE and %NL80211_CMD_CONNECT requests, which will set +++ * the ASSOC_REQ_USE_RRM flag in the association request even if +++ * NL80211_FEATURE_QUIET is not advertized. ++ * ++ * @NUM_NL80211_EXT_FEATURES: number of extended features. ++ * @MAX_NL80211_EXT_FEATURES: highest extended feature index. ++ */ ++ enum nl80211_ext_feature_index { ++ NL80211_EXT_FEATURE_VHT_IBSS, +++ NL80211_EXT_FEATURE_RRM, ++ ++ /* add new features before the definition below */ ++ NUM_NL80211_EXT_FEATURES, ++@@ -4589,4 +4704,72 @@ enum nl80211_tdls_peer_capability { + NL80211_TDLS_PEER_WMM = 1<<2, + }; + +@@ -108,4 +325,48 @@ + + __NL80211_SCHED_SCAN_PLAN_AFTER_LAST - 1 + +}; + + +++/** +++ * struct nl80211_bss_select_rssi_adjust - RSSI adjustment parameters. +++ * +++ * @band: band of BSS that must match for RSSI value adjustment. +++ * @delta: value used to adjust the RSSI value of matching BSS. +++ */ +++struct nl80211_bss_select_rssi_adjust { +++ __u8 band; +++ __s8 delta; +++} __attribute__((packed)); +++ +++/** +++ * enum nl80211_bss_select_attr - attributes for bss selection. +++ * +++ * @__NL80211_BSS_SELECT_ATTR_INVALID: reserved. +++ * @NL80211_BSS_SELECT_ATTR_RSSI: Flag indicating only RSSI-based BSS selection +++ * is requested. +++ * @NL80211_BSS_SELECT_ATTR_BAND_PREF: attribute indicating BSS +++ * selection should be done such that the specified band is preferred. +++ * When there are multiple BSS-es in the preferred band, the driver +++ * shall use RSSI-based BSS selection as a second step. The value of +++ * this attribute is according to &enum nl80211_band (u32). +++ * @NL80211_BSS_SELECT_ATTR_RSSI_ADJUST: When present the RSSI level for +++ * BSS-es in the specified band is to be adjusted before doing +++ * RSSI-based BSS selection. The attribute value is a packed structure +++ * value as specified by &struct nl80211_bss_select_rssi_adjust. +++ * @NL80211_BSS_SELECT_ATTR_MAX: highest bss select attribute number. +++ * @__NL80211_BSS_SELECT_ATTR_AFTER_LAST: internal use. +++ * +++ * One and only one of these attributes are found within %NL80211_ATTR_BSS_SELECT +++ * for %NL80211_CMD_CONNECT. It specifies the required BSS selection behaviour +++ * which the driver shall use. +++ */ +++enum nl80211_bss_select_attr { +++ __NL80211_BSS_SELECT_ATTR_INVALID, +++ NL80211_BSS_SELECT_ATTR_RSSI, +++ NL80211_BSS_SELECT_ATTR_BAND_PREF, +++ NL80211_BSS_SELECT_ATTR_RSSI_ADJUST, +++ +++ /* keep last */ +++ __NL80211_BSS_SELECT_ATTR_AFTER_LAST, +++ NL80211_BSS_SELECT_ATTR_MAX = __NL80211_BSS_SELECT_ATTR_AFTER_LAST - 1 +++}; +++ + #endif /* __LINUX_NL80211_H */ +diff --git a/package/network/utils/iw/patches/300-display_interface_TX_power.patch b/package/network/utils/iw/patches/300-display_interface_TX_power.patch +index 574c490..2cdf360 100644 +--- a/package/network/utils/iw/patches/300-display_interface_TX_power.patch ++++ b/package/network/utils/iw/patches/300-display_interface_TX_power.patch +@@ -12,11 +12,9 @@ Signed-off-by: Johannes Berg + interface.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +-diff --git a/interface.c b/interface.c +-index 73ccecd..4f0821d 100644 + --- a/interface.c + +++ b/interface.c +-@@ -368,6 +368,13 @@ static int print_iface_handler(struct nl_msg *msg, void *arg) ++@@ -368,6 +368,13 @@ static int print_iface_handler(struct nl + printf("\n"); + } + +diff --git a/package/network/utils/iw/patches/301-ibss_add_VHT80.patch b/package/network/utils/iw/patches/301-ibss_add_VHT80.patch +index 709fbb2..0627bcc 100644 +--- a/package/network/utils/iw/patches/301-ibss_add_VHT80.patch ++++ b/package/network/utils/iw/patches/301-ibss_add_VHT80.patch +@@ -14,8 +14,6 @@ Signed-off-by: Johannes Berg + ibss.c | 49 +++++++++++++++++++++++++++++++++++++++++-------- + 1 file changed, 41 insertions(+), 8 deletions(-) + +-diff --git a/ibss.c b/ibss.c +-index 7a0b707..a99a262 100644 + --- a/ibss.c + +++ b/ibss.c + @@ -16,6 +16,39 @@ +@@ -58,7 +56,7 @@ index 7a0b707..a99a262 100644 + static int join_ibss(struct nl80211_state *state, + struct nl_msg *msg, + int argc, char **argv, +-@@ -30,12 +63,8 @@ static int join_ibss(struct nl80211_state *state, ++@@ -30,12 +63,8 @@ static int join_ibss(struct nl80211_stat + int bintval; + int i; + unsigned long freq; +@@ -73,7 +71,7 @@ index 7a0b707..a99a262 100644 + { .name = "HT20", + .width = NL80211_CHAN_WIDTH_20, + .freq1_diff = 0, +-@@ -60,6 +89,10 @@ static int join_ibss(struct nl80211_state *state, ++@@ -60,6 +89,10 @@ static int join_ibss(struct nl80211_stat + .width = NL80211_CHAN_WIDTH_10, + .freq1_diff = 0, + .chantype = -1 }, +@@ -84,7 +82,7 @@ index 7a0b707..a99a262 100644 + }; + + if (argc < 2) +-@@ -90,7 +123,7 @@ static int join_ibss(struct nl80211_state *state, ++@@ -90,7 +123,7 @@ static int join_ibss(struct nl80211_stat + NLA_PUT_U32(msg, NL80211_ATTR_CHANNEL_WIDTH, + chanmode_selected->width); + NLA_PUT_U32(msg, NL80211_ATTR_CENTER_FREQ1, +diff --git a/package/network/utils/iw/patches/302-ibss_use_MHz_instead_MHZ.patch b/package/network/utils/iw/patches/302-ibss_use_MHz_instead_MHZ.patch +index fc44427..f96d5ea 100644 +--- a/package/network/utils/iw/patches/302-ibss_use_MHz_instead_MHZ.patch ++++ b/package/network/utils/iw/patches/302-ibss_use_MHz_instead_MHZ.patch +@@ -7,11 +7,9 @@ Signed-off-by: Johannes Berg + ibss.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +-diff --git a/ibss.c b/ibss.c +-index a99a262..23bda70 100644 + --- a/ibss.c + +++ b/ibss.c +-@@ -81,15 +81,15 @@ static int join_ibss(struct nl80211_state *state, ++@@ -81,15 +81,15 @@ static int join_ibss(struct nl80211_stat + .width = NL80211_CHAN_WIDTH_20_NOHT, + .freq1_diff = 0, + .chantype = NL80211_CHAN_NO_HT }, +diff --git a/package/network/utils/iw/patches/303-mesh_add_VHT80.patch b/package/network/utils/iw/patches/303-mesh_add_VHT80.patch +index fe8dc21..956b050 100644 +--- a/package/network/utils/iw/patches/303-mesh_add_VHT80.patch ++++ b/package/network/utils/iw/patches/303-mesh_add_VHT80.patch +@@ -15,8 +15,6 @@ Signed-off-by: Sven Eckelmann + util.c | 26 ++++++++++++++++++++++++++ + 4 files changed, 43 insertions(+), 41 deletions(-) + +-diff --git a/ibss.c b/ibss.c +-index 23bda70..ac06fc5 100644 + --- a/ibss.c + +++ b/ibss.c + @@ -16,39 +16,6 @@ +@@ -59,8 +57,6 @@ index 23bda70..ac06fc5 100644 + static int join_ibss(struct nl80211_state *state, + struct nl_msg *msg, + int argc, char **argv, +-diff --git a/iw.h b/iw.h +-index cef9da8..8e1a37a 100644 + --- a/iw.h + +++ b/iw.h + @@ -59,6 +59,13 @@ struct cmd { +@@ -77,7 +73,7 @@ index cef9da8..8e1a37a 100644 + #define ARRAY_SIZE(ar) (sizeof(ar)/sizeof(ar[0])) + #define DIV_ROUND_UP(x, y) (((x) + (y - 1)) / (y)) + +-@@ -174,6 +181,8 @@ void print_ies(unsigned char *ie, int ielen, bool unknown, ++@@ -174,6 +181,8 @@ void print_ies(unsigned char *ie, int ie + void parse_bitrate(struct nlattr *bitrate_attr, char *buf, int buflen); + void iw_hexdump(const char *prefix, const __u8 *data, size_t len); + +@@ -86,11 +82,9 @@ index cef9da8..8e1a37a 100644 + #define SCHED_SCAN_OPTIONS "interval [delay ] " \ + "[freqs +] [matches [ssid ]+]] [active [ssid ]+|passive] [randomise[=/]]" + int parse_sched_scan(struct nl_msg *msg, int *argc, char ***argv); +-diff --git a/mesh.c b/mesh.c +-index 0090530..930d58f 100644 + --- a/mesh.c + +++ b/mesh.c +-@@ -439,12 +439,8 @@ static int join_mesh(struct nl80211_state *state, ++@@ -439,12 +439,8 @@ static int join_mesh(struct nl80211_stat + int bintval, dtim_period, i, n_rates = 0; + char *end, *value = NULL, *sptr = NULL; + unsigned long freq = 0; +@@ -105,7 +99,7 @@ index 0090530..930d58f 100644 + { .name = "HT20", + .width = NL80211_CHAN_WIDTH_20, + .freq1_diff = 0, +-@@ -461,6 +457,10 @@ static int join_mesh(struct nl80211_state *state, ++@@ -461,6 +457,10 @@ static int join_mesh(struct nl80211_stat + .width = NL80211_CHAN_WIDTH_20_NOHT, + .freq1_diff = 0, + .chantype = NL80211_CHAN_NO_HT }, +@@ -116,7 +110,7 @@ index 0090530..930d58f 100644 + }; + + if (argc < 1) +-@@ -497,7 +497,7 @@ static int join_mesh(struct nl80211_state *state, ++@@ -497,7 +497,7 @@ static int join_mesh(struct nl80211_stat + NLA_PUT_U32(msg, NL80211_ATTR_CHANNEL_WIDTH, + chanmode_selected->width); + NLA_PUT_U32(msg, NL80211_ATTR_CENTER_FREQ1, +@@ -125,7 +119,7 @@ index 0090530..930d58f 100644 + if (chanmode_selected->chantype != -1) + NLA_PUT_U32(msg, + NL80211_ATTR_WIPHY_CHANNEL_TYPE, +-@@ -599,7 +599,7 @@ static int join_mesh(struct nl80211_state *state, ++@@ -599,7 +599,7 @@ static int join_mesh(struct nl80211_stat + nla_put_failure: + return -ENOBUFS; + } +@@ -134,11 +128,9 @@ index 0090530..930d58f 100644 + " [basic-rates ]], [mcast-rate ]" + " [beacon-interval