summaryrefslogtreecommitdiff
path: root/net-wireless/broadcom-sta
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /net-wireless/broadcom-sta
reinit the tree, so we can have metadata
Diffstat (limited to 'net-wireless/broadcom-sta')
-rw-r--r--net-wireless/broadcom-sta/Manifest17
-rw-r--r--net-wireless/broadcom-sta/broadcom-sta-6.30.223.271-r4.ebuild93
-rw-r--r--net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.141-eth-to-wlan.patch12
-rw-r--r--net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.141-gcc.patch11
-rw-r--r--net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.141-makefile.patch14
-rw-r--r--net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.248-r3-Wno-date-time.patch11
-rw-r--r--net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.271-r1-linux-3.18.patch12
-rw-r--r--net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.271-r2-linux-4.3-v2.patch16
-rw-r--r--net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.271-r4-linux-4.11.patch52
-rw-r--r--net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.271-r4-linux-4.12.patch64
-rw-r--r--net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.271-r4-linux-4.7.patch109
-rw-r--r--net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.271-r4-linux-4.8.patch64
-rw-r--r--net-wireless/broadcom-sta/metadata.xml11
13 files changed, 486 insertions, 0 deletions
diff --git a/net-wireless/broadcom-sta/Manifest b/net-wireless/broadcom-sta/Manifest
new file mode 100644
index 000000000000..e9910114308b
--- /dev/null
+++ b/net-wireless/broadcom-sta/Manifest
@@ -0,0 +1,17 @@
+AUX broadcom-sta-6.30.223.141-eth-to-wlan.patch 395 SHA256 20f9caf3a5da17c4421c5734e2dbf67575b59603176cb215e5f92f2293f1ad7f SHA512 1b340746e47edcc63cacf454fc44cd40ac34e526dacb026602e629b16030eeab0919456cadad7f93662291c1a0bea461c25471a7b71b7e9a1103f88e7d92be5d WHIRLPOOL 5f581bb2db2feccb00a7fff2877a902e5e02323f17341afd912d04e1b7c4002d8858c146391d2812d23d12a694526f90293fcdb4fe62ba0502140453f2bc1a24
+AUX broadcom-sta-6.30.223.141-gcc.patch 316 SHA256 cf5cb1abb87acfe0dd1d645479773cba0d66e5fe881148f29996553c06abe7f9 SHA512 a298ff51359da6fd5f47ca63e99babc778a95622687c205cca4244d16552fc697f46f90cadc93fc8e8d6674965b3641a0d22d35c5f14d6d86cf3215a71db6172 WHIRLPOOL ce0a52c88479d3d39fc6d07690ac5fbbcb0d9e7d06c6ec1756a1257b25639739e9a0d2f28bdbc8cdf0df25e1b6414e9e31c7bf6cfe959a8e5845f9501b859feb
+AUX broadcom-sta-6.30.223.141-makefile.patch 497 SHA256 3f1332be115991f21b03cf50de0af212faa8083017bf8ba724f110c602005060 SHA512 f403669dede71f3c9f2886bfa535518a9e89a4398d1da7789ff955f15c493dd5ede1f304b0980c300c580ac1ae2464a4e395fb40b72dffa98a5a015c3e7d74c5 WHIRLPOOL 9bad191388f78608d1cc7f13488dcf9dbcfe626a6522af3bf477aa46a2e7736921d48ab78750fa2e3b3aff10cd353a12a7a331b159988d263e5fd3fdb4b2a77f
+AUX broadcom-sta-6.30.223.248-r3-Wno-date-time.patch 380 SHA256 b07ce80f2e079cce08c8ec006dda091f6f73f158c8a62df5bac2fbabb6989849 SHA512 f1f96ac2b51be18bfdc4c3d627801cb14d024def92416434c3c0a9adb986e846f9ceb6087b5ab343d78ed87a3dda277818cb060534b44be62bf8f123bc6594fd WHIRLPOOL e88dd2f0f08be2d0e61009f387c34bf9e1ba8d9a26817aa8697c4a2f89b4cbe8411d6960917953d2549c37590cbc5ceafda45780bece818854420bbc4984d11f
+AUX broadcom-sta-6.30.223.271-r1-linux-3.18.patch 326 SHA256 2900883056df92b6a51a1f5385c8fdcebb93cebd9fbaa4c3f04c92b9ec5c739e SHA512 bdc7f810bf01446e9752e664030e570396127a674b397ecd0001a0ff79103a891e5011975a819d3decfb8cc4dc90e7655621753c76ccc07bde99a2610f188587 WHIRLPOOL 8aa3c2b97092815a9ac4583387e85f849613320edc7dd46c056528aa3d53a16d776ee889b4d2e5342db9ccca1f0e330979f35bf3598dacc92a3797ed9c953442
+AUX broadcom-sta-6.30.223.271-r2-linux-4.3-v2.patch 408 SHA256 073a923a8efb15ca4491efb54114db49ec0cf251d79343992859591d12d5aa09 SHA512 d419d776bb8a0071250eb26d1e878639df35272dc47a8eb459f426356fadb0ab25779a90dd1317711c94549ec45f80b70fca9677c93c37cac829913120cc80d4 WHIRLPOOL 82b48251ca51f450f31b4bfc67105b8ca653683303f2cf24fe0b5a89eac5c7ad8bb85920b98de8f6b8b3574980f615897e94e38f96b14d97944434961ad4f93f
+AUX broadcom-sta-6.30.223.271-r4-linux-4.11.patch 1588 SHA256 977b1663ce055860b0b60e7cf882658f507d81909f935d1a8b785896f64176e8 SHA512 c134b34dcb4221f59de6cc9afcfb47c459ee840189c4b317f9440df3dab0c3fdf5a8798850c7335fbc05c904c9b224e6bc0457f2d33b04bef550c2d92a92cf20 WHIRLPOOL fdd24f7927efefa0ebc4fd5e4d321f99b9707e14ed90898303bb97b6fe834ee73d2c282460f2a97156415fbe7fe79ef4eb0edc55ae7bd7d6bdfcf47486d7ceed
+AUX broadcom-sta-6.30.223.271-r4-linux-4.12.patch 2320 SHA256 604255e6d9b1b9735b736b4b12326590da2c9e96a37a888a9f1098ea62a12beb SHA512 4eecf21bf95943150db8f7bc0a3bd4634050095cc6b2a91164590e3d0887fd37d4425b27537cb63e2ece26596b85eb1f0aef52624a390015a61868d7d807dd2b WHIRLPOOL d0cc64f9d18740e3a689e0c5aa23500a30cd074e355435722739aaa85db89c0a04b283153370e87e68f490d138fc0eff0c0bb5b1c461f58398b56bc740d30c73
+AUX broadcom-sta-6.30.223.271-r4-linux-4.7.patch 3897 SHA256 30ce1d5e8bf78aee487d0f3ac76756e1060777f70ed1a9cf95215c3a52cfbe2e SHA512 f61ecfb6b8c5a377c7a4da7549c9ec75677782fa2f97e64de0df1259e0ec3b993cfa3eaa4ff50331703ee18ef28f2af0d09839dd3b63ed994e6b29cbfe8ed73f WHIRLPOOL efacb9ae16e40bab2ec2188d3658d691d634c4646f95c5e309f75e4c2ef53a7f1e9d300d3add476d3f94cd65a117a80c74960738b60032ceb97d6703523ad139
+AUX broadcom-sta-6.30.223.271-r4-linux-4.8.patch 1835 SHA256 09d709df0c764118ca43117f5c096163d9669a28170da8476d4b8211bd225d2e SHA512 e5959921b6f0cd5d61d7ed568f549b0920f394458c28257c05064b89d7067ce11c8e44ed0e5a48a65bd041c6193d9ae2d02fca2f5efbfb787d3f9001786a4578 WHIRLPOOL f69e6807e96e631e315378258b3006bc89ad02557ecfb0e8f372618fa1943e2a658662a39af5941f1c3cd34198d4e8d1ed3c460f9a2f0a3cf96ceea4ae4d6f00
+DIST README-broadcom-sta-6.30.223.271.txt 17216 SHA256 6d6ae53d4829651e340a40b5c9515755efa81def099dac0730967178808a503c SHA512 672ecc5afcd8535a9f8beb4baea5a40c584b7682844e9ff0e4f66b7406b42118a99dce1fcd580118187fdc506781334b8243082def2b78dce916d90c55ab3663 WHIRLPOOL e6905a6d2a6a912a467e6b3d38f7e5e955f558f95a6e5d1b03350eed79e2c094101566668b547109a63f5aa9796ad0119133b3513c4fb123d45d36f3ba775f55
+DIST hybrid-v35-nodebug-pcoem-6_30_223_271.tar.gz 2869247 SHA256 4f8b70b293ac8cc5c70e571ad5d1878d0f29d133a46fe7869868d9c19b5058cd SHA512 0361ba30d97bcb1dedf46c11ef1b9a16f09cde3faa6be87b3ccc28679f34183c2fdf511e7c3b5c26b304f6961da454ccf71844b92bbb2f25aa876249496a2f1b WHIRLPOOL c96c21e4d497136c4ac5a8f3f1d3e84a7b5f5478ca7c1276262481d66b919639f475b99783ad993c01c94e380275fdd6eb39dd53f224b43912f7a395cada575c
+DIST hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz 2928541 SHA256 5f79774d5beec8f7636b59c0fb07a03108eef1e3fd3245638b20858c714144be SHA512 6855781f7c69a9aecb9461932423688964879d5a4df571f01ae7adaa7bf21a410bef839605d555afb6c8f4eec92fe8510af6cb120930095617ff6cdcccedaf17 WHIRLPOOL 8a905a35581f5c4a1177a3da7356731a360ba5c72e2897d363682afc49b73c46b031776012bba983842b894505d71e6f20f9404120b676e0b79b9ef003342e56
+EBUILD broadcom-sta-6.30.223.271-r4.ebuild 3587 SHA256 9906a606215b4432d46a73d41870b4c9ebcd6272e028d532e951571c05c2a354 SHA512 2e2753189b95190742c2a27ae0ac2e08518619d436400451299fdd4e062fbb6305aa1741d808ff8d5f2290d59ce910f16b7c1bb03aa757ca14d9fb19d756b05f WHIRLPOOL f26b804e0a3ea7b0de072b63b49b21efeadaded342f918fbb5f1740b8ea2160f3d238d17a0d4b2d8029c1132efc4c8e24ad37bc0af7697ef604dbb3cbdb6e258
+MISC ChangeLog 9644 SHA256 b4a8b5081fc4636e444ecb2e2af9ae4a0d4aa09f36fde54a490818f745ccf1d2 SHA512 0bef59f4470f3f014cc4f08c130aa07ec01316b4c047d3e0a32381f63180a31894370487baa70e021a2ab2dcdcb1931fe44bf957f43e20f95d98ac730172ca1a WHIRLPOOL b465cf10fd283c167f52295aa8bd10acf7ac49ea51892618c3c650344cd7b7a4736ecaec68b91059be61da8b278576b40f5edc19f2dfacbc646189df4fa182b4
+MISC ChangeLog-2015 16002 SHA256 0ffe7d26e3c35548f734abc10ebb39b0283a0b37c443e52fae7882e8d12821ce SHA512 3b4b7de338ab80586632bf897cb9e5c97bb0fe88840fba61ec302f724552fd1571c865fd62d978dc44bfc620cf14959562d73dd4806b64368dac1031ee907453 WHIRLPOOL 6da37b0839fc87b275bd61890de3bc51af5058dccaabbc14b8d95a9b9f5b0e2aaca6d5c0a6a28265fa18f7919cddc39316975da9bc1ab5aff3a73c08992bcca6
+MISC metadata.xml 318 SHA256 0b50041e19935cf37163d886ab7bdd37aa10ad04bf7a2816f91b4947f4b1ee74 SHA512 adcf2e6634f5191a961818253a45ca8bd1ff9ae5bdccf77c56b12eed4c1fd75aa0a4f7b4d6e8119ecc2f5f60268e11a3903ab1ed5d965079a8c1f164c7465794 WHIRLPOOL 3a670650fa471d24d69b78fddeb5c9f8ddc2eaeb61eb96f2dc688b758491236d09c3011cde1c783cf1aecc54a7664c5ccf661e6928ca6be0def8e78bb27e6c82
diff --git a/net-wireless/broadcom-sta/broadcom-sta-6.30.223.271-r4.ebuild b/net-wireless/broadcom-sta/broadcom-sta-6.30.223.271-r4.ebuild
new file mode 100644
index 000000000000..34b37eceeaf8
--- /dev/null
+++ b/net-wireless/broadcom-sta/broadcom-sta-6.30.223.271-r4.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils linux-info linux-mod
+
+DESCRIPTION="Broadcom's IEEE 802.11a/b/g/n hybrid Linux device driver"
+HOMEPAGE="https://www.broadcom.com/support/802.11"
+SRC_BASE="https://docs.broadcom.com/docs-and-downloads/docs/linux_sta/hybrid-v35"
+SRC_URI="x86? ( ${SRC_BASE}-nodebug-pcoem-${PV//\./_}.tar.gz )
+ amd64? ( ${SRC_BASE}_64-nodebug-pcoem-${PV//\./_}.tar.gz )
+ https://docs.broadcom.com/docs-and-downloads/docs/linux_sta/README_${PV}.txt -> README-${P}.txt"
+
+LICENSE="Broadcom"
+KEYWORDS="-* ~amd64 ~x86"
+
+RESTRICT="mirror"
+
+DEPEND="virtual/linux-sources"
+RDEPEND=""
+
+S="${WORKDIR}"
+
+MODULE_NAMES="wl(net/wireless)"
+MODULESD_WL_ALIASES=("wlan0 wl")
+
+pkg_pretend() {
+ ewarn
+ ewarn "If you are stuck using this unmaintained driver (likely in a MacBook),"
+ ewarn "you may be interested to know that a newer compatible wireless card"
+ ewarn "is supported by the in-tree brcmfmac driver. It has a model number "
+ ewarn "BCM943602CS and is for sale on the second hand market for less than "
+ ewarn "20 USD."
+ ewarn
+ ewarn "See https://wikidevi.com/wiki/Broadcom_Wireless_Adapters and"
+ ewarn " https://wikidevi.com/wiki/Broadcom_BCM943602CS"
+ ewarn "for more information."
+ ewarn
+}
+
+pkg_setup() {
+ # bug #300570
+ # NOTE<lxnay>: module builds correctly anyway with b43 and SSB enabled
+ # make checks non-fatal. The correct fix is blackisting ssb and, perhaps
+ # b43 via udev rules. Moreover, previous fix broke binpkgs support.
+ CONFIG_CHECK="~!B43 ~!BCMA ~!SSB"
+ CONFIG_CHECK2="LIB80211 ~!MAC80211 ~LIB80211_CRYPT_TKIP"
+ ERROR_B43="B43: If you insist on building this, you must blacklist it!"
+ ERROR_BCMA="BCMA: If you insist on building this, you must blacklist it!"
+ ERROR_SSB="SSB: If you insist on building this, you must blacklist it!"
+ ERROR_LIB80211="LIB80211: Please enable it. If you can't find it: enabling the driver for \"Intel PRO/Wireless 2100\" or \"Intel PRO/Wireless 2200BG\" (IPW2100 or IPW2200) should suffice."
+ ERROR_MAC80211="MAC80211: If you insist on building this, you must blacklist it!"
+ ERROR_PREEMPT_RCU="PREEMPT_RCU: Please do not set the Preemption Model to \"Preemptible Kernel\"; choose something else."
+ ERROR_LIB80211_CRYPT_TKIP="LIB80211_CRYPT_TKIP: You will need this for WPA."
+ if kernel_is ge 3 8 8; then
+ CONFIG_CHECK="${CONFIG_CHECK} ${CONFIG_CHECK2} CFG80211 ~!PREEMPT_RCU ~!PREEMPT"
+ elif kernel_is ge 2 6 32; then
+ CONFIG_CHECK="${CONFIG_CHECK} ${CONFIG_CHECK2} CFG80211"
+ elif kernel_is ge 2 6 31; then
+ CONFIG_CHECK="${CONFIG_CHECK} ${CONFIG_CHECK2} WIRELESS_EXT ~!MAC80211"
+ elif kernel_is ge 2 6 29; then
+ CONFIG_CHECK="${CONFIG_CHECK} ${CONFIG_CHECK2} WIRELESS_EXT COMPAT_NET_DEV_OPS"
+ else
+ CONFIG_CHECK="${CONFIG_CHECK} IEEE80211 IEEE80211_CRYPT_TKIP"
+ fi
+
+ linux-mod_pkg_setup
+
+ BUILD_PARAMS="-C ${KV_DIR} M=${S}"
+ BUILD_TARGETS="wl.ko"
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}/${PN}-6.30.223.141-makefile.patch" \
+ "${FILESDIR}/${PN}-6.30.223.141-eth-to-wlan.patch" \
+ "${FILESDIR}/${PN}-6.30.223.141-gcc.patch" \
+ "${FILESDIR}/${PN}-6.30.223.248-r3-Wno-date-time.patch" \
+ "${FILESDIR}/${PN}-6.30.223.271-r1-linux-3.18.patch" \
+ "${FILESDIR}/${PN}-6.30.223.271-r2-linux-4.3-v2.patch" \
+ "${FILESDIR}/${PN}-6.30.223.271-r4-linux-4.7.patch" \
+ "${FILESDIR}/${PN}-6.30.223.271-r4-linux-4.8.patch" \
+ "${FILESDIR}/${PN}-6.30.223.271-r4-linux-4.11.patch" \
+ "${FILESDIR}/${PN}-6.30.223.271-r4-linux-4.12.patch"
+
+ epatch_user
+}
+
+src_install() {
+ linux-mod_src_install
+
+ dodoc "${DISTDIR}/README-${P}.txt"
+}
diff --git a/net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.141-eth-to-wlan.patch b/net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.141-eth-to-wlan.patch
new file mode 100644
index 000000000000..b23914a0b3d6
--- /dev/null
+++ b/net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.141-eth-to-wlan.patch
@@ -0,0 +1,12 @@
+diff -urN a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c
+--- a/src/wl/sys/wl_linux.c 2013-08-01 09:52:22.000000000 +0300
++++ b/src/wl/sys/wl_linux.c 2013-09-27 09:20:11.495023471 +0300
+@@ -235,7 +235,7 @@
+ #define to_str(s) #s
+ #define quote_str(s) to_str(s)
+
+-#define BRCM_WLAN_IFNAME eth%d
++#define BRCM_WLAN_IFNAME wlan%d
+
+ static char intf_name[IFNAMSIZ] = quote_str(BRCM_WLAN_IFNAME);
+
diff --git a/net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.141-gcc.patch b/net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.141-gcc.patch
new file mode 100644
index 000000000000..b5d7e858d78f
--- /dev/null
+++ b/net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.141-gcc.patch
@@ -0,0 +1,11 @@
+diff -urN a/src/wl/sys/wl_iw.h b/src/wl/sys/wl_iw.h
+--- a/src/wl/sys/wl_iw.h 2013-08-01 09:52:22.000000000 +0300
++++ b/src/wl/sys/wl_iw.h 2013-09-27 09:36:07.808067913 +0300
+@@ -21,6 +21,7 @@
+ #ifndef _wl_iw_h_
+ #define _wl_iw_h_
+
++#include <linux/semaphore.h>
+ #include <linux/wireless.h>
+
+ #include <typedefs.h>
diff --git a/net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.141-makefile.patch b/net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.141-makefile.patch
new file mode 100644
index 000000000000..09c495d2a10f
--- /dev/null
+++ b/net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.141-makefile.patch
@@ -0,0 +1,14 @@
+--- Makefile.old 2013-04-28 22:42:59.000000000 +0200
++++ Makefile 2013-04-28 22:45:53.000000000 +0200
+@@ -128,9 +128,9 @@
+
+ EXTRA_LDFLAGS := $(src)/lib/wlc_hybrid.o_shipped
+
+-KBASE ?= /lib/modules/`uname -r`
++KBASE ?= /lib/modules/${KV_FULL}
+ KBUILD_DIR ?= $(KBASE)/build
+-MDEST_DIR ?= $(KBASE)/kernel/drivers/net/wireless
++MDEST_DIR ?= ${D}$(KBASE)/kernel/drivers/net/wireless
+
+ all:
+ KBUILD_NOPEDANTIC=1 make -C $(KBUILD_DIR) M=`pwd`
diff --git a/net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.248-r3-Wno-date-time.patch b/net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.248-r3-Wno-date-time.patch
new file mode 100644
index 000000000000..f93e3f1d3a3f
--- /dev/null
+++ b/net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.248-r3-Wno-date-time.patch
@@ -0,0 +1,11 @@
+--- a/Makefile 2014-06-26 10:42:08.000000000 +0000
++++ b/Makefile 2014-07-17 22:44:01.662297228 +0000
+@@ -126,6 +126,8 @@
+ EXTRA_CFLAGS += -I$(src)/src/shared/bcmwifi/include
+ #EXTRA_CFLAGS += -DBCMDBG_ASSERT -DBCMDBG_ERR
+
++EXTRA_CFLAGS += -Wno-date-time
++
+ EXTRA_LDFLAGS := $(src)/lib/wlc_hybrid.o_shipped
+
+ KBASE ?= /lib/modules/`uname -r`
diff --git a/net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.271-r1-linux-3.18.patch b/net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.271-r1-linux-3.18.patch
new file mode 100644
index 000000000000..9a0e7136c53b
--- /dev/null
+++ b/net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.271-r1-linux-3.18.patch
@@ -0,0 +1,12 @@
+--- a/src/wl/sys/wl_linux.c 2014-06-26 12:42:08.000000000 +0200
++++ b/src/wl/sys/wl_linux.c 2015-01-22 01:44:58.580453805 +0100
+@@ -2157,8 +2159,8 @@
+ wlif = WL_DEV_IF(dev);
+ wl = WL_INFO(dev);
+
++ skb->prev = NULL;
+ if (WL_ALL_PASSIVE_ENAB(wl) || (WL_RTR() && WL_CONFIG_SMP())) {
+- skb->prev = NULL;
+
+ TXQ_LOCK(wl);
+
diff --git a/net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.271-r2-linux-4.3-v2.patch b/net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.271-r2-linux-4.3-v2.patch
new file mode 100644
index 000000000000..588f77ad16f2
--- /dev/null
+++ b/net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.271-r2-linux-4.3-v2.patch
@@ -0,0 +1,16 @@
+diff -ruN a/src/shared/linux_osl.c b/src/shared/linux_osl.c
+--- a/src/shared/linux_osl.c 2015-11-26 12:16:23.343091098 -0800
++++ b/src/shared/linux_osl.c 2015-11-26 12:17:08.657092739 -0800
+@@ -932,7 +932,11 @@
+ uint cycles;
+
+ #if defined(__i386__)
+- rdtscl(cycles);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
++ cycles = (u32)rdtsc();
++#else
++ rdtscl(cycles);
++#endif
+ #else
+ cycles = 0;
+ #endif
diff --git a/net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.271-r4-linux-4.11.patch b/net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.271-r4-linux-4.11.patch
new file mode 100644
index 000000000000..a779f8c84cfd
--- /dev/null
+++ b/net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.271-r4-linux-4.11.patch
@@ -0,0 +1,52 @@
+diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c
+index a9671e2..da36405 100644
+--- a/src/wl/sys/wl_cfg80211_hybrid.c
++++ b/src/wl/sys/wl_cfg80211_hybrid.c
+@@ -30,6 +30,9 @@
+ #include <linux/kthread.h>
+ #include <linux/netdevice.h>
+ #include <linux/ieee80211.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
++#include <linux/sched/signal.h>
++#endif
+ #include <net/cfg80211.h>
+ #include <linux/nl80211.h>
+ #include <net/rtnetlink.h>
+diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c
+index 489c9f5..f8278ad 100644
+--- a/src/wl/sys/wl_linux.c
++++ b/src/wl/sys/wl_linux.c
+@@ -117,6 +117,9 @@ int wl_found = 0;
+
+ typedef struct priv_link {
+ wl_if_t *wlif;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
++ unsigned long last_rx;
++#endif
+ } priv_link_t;
+
+ #define WL_DEV_IF(dev) ((wl_if_t*)((priv_link_t*)DEV_PRIV(dev))->wlif)
+@@ -2450,6 +2453,9 @@ wl_monitor(wl_info_t *wl, wl_rxsts_t *rxsts, void *p)
+ {
+ struct sk_buff *oskb = (struct sk_buff *)p;
+ struct sk_buff *skb;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
++ priv_link_t *priv_link;
++#endif
+ uchar *pdata;
+ uint len;
+
+@@ -2916,7 +2922,13 @@ wl_monitor(wl_info_t *wl, wl_rxsts_t *rxsts, void *p)
+ if (skb == NULL) return;
+
+ skb->dev = wl->monitor_dev;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
++ priv_link = MALLOC(wl->osh, sizeof(priv_link_t));
++ priv_link = netdev_priv(skb->dev);
++ priv_link->last_rx = jiffies;
++#else
+ skb->dev->last_rx = jiffies;
++#endif
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22)
+ skb_reset_mac_header(skb);
+ #else
diff --git a/net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.271-r4-linux-4.12.patch b/net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.271-r4-linux-4.12.patch
new file mode 100644
index 000000000000..94c6253f803e
--- /dev/null
+++ b/net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.271-r4-linux-4.12.patch
@@ -0,0 +1,64 @@
+diff -ru work.orig/src/wl/sys/wl_cfg80211_hybrid.c work.patched/src/wl/sys/wl_cfg80211_hybrid.c
+--- work.orig/src/wl/sys/wl_cfg80211_hybrid.c 2017-06-10 15:50:27.328823384 -0700
++++ work.patched/src/wl/sys/wl_cfg80211_hybrid.c 2017-06-10 15:52:40.540809187 -0700
+@@ -52,8 +52,13 @@
+ u32 wl_dbg_level = WL_DBG_ERR;
+ #endif
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
++static s32 wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
++ enum nl80211_iftype type, struct vif_params *params);
++#else
+ static s32 wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
+ enum nl80211_iftype type, u32 *flags, struct vif_params *params);
++#endif
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
+ static s32
+ wl_cfg80211_scan(struct wiphy *wiphy,
+@@ -466,7 +471,11 @@
+
+ static s32
+ wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
++ enum nl80211_iftype type,
++#else
+ enum nl80211_iftype type, u32 *flags,
++#endif
+ struct vif_params *params)
+ {
+ struct wl_cfg80211_priv *wl = wiphy_to_wl(wiphy);
+@@ -2361,12 +2370,26 @@
+ const wl_event_msg_t *e, void *data)
+ {
+ struct wl_cfg80211_connect_info *conn_info = wl_to_conn(wl);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
++ struct cfg80211_roam_info roam_info = {};
++#endif
+ s32 err = 0;
+
+ wl_get_assoc_ies(wl);
+ memcpy(wl->profile->bssid, &e->addr, ETHER_ADDR_LEN);
+ memcpy(&wl->bssid, &e->addr, ETHER_ADDR_LEN);
+ wl_update_bss_info(wl);
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
++ roam_info.channel = &wl->conf->channel,
++ roam_info.bssid = (u8 *)&wl->bssid,
++ roam_info.req_ie = conn_info->req_ie,
++ roam_info.req_ie_len = conn_info->req_ie_len,
++ roam_info.resp_ie = conn_info->resp_ie,
++ roam_info.resp_ie_len = conn_info->resp_ie_len,
++
++ cfg80211_roamed(ndev, &roam_info, GFP_KERNEL);
++#else
+ cfg80211_roamed(ndev,
+ #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39)
+ &wl->conf->channel,
+@@ -2374,6 +2397,7 @@
+ (u8 *)&wl->bssid,
+ conn_info->req_ie, conn_info->req_ie_len,
+ conn_info->resp_ie, conn_info->resp_ie_len, GFP_KERNEL);
++#endif
+ WL_DBG(("Report roaming result\n"));
+
+ set_bit(WL_STATUS_CONNECTED, &wl->status);
diff --git a/net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.271-r4-linux-4.7.patch b/net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.271-r4-linux-4.7.patch
new file mode 100644
index 000000000000..566680a09140
--- /dev/null
+++ b/net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.271-r4-linux-4.7.patch
@@ -0,0 +1,109 @@
+Since Linux 4.7, the enum ieee80211_band is no longer used
+
+This shall cause no problem's since both enums ieee80211_band
+and nl80211_band were added in the same commit:
+https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=13ae75b103e07304a34ab40c9136e9f53e06475c
+
+This patch refactors the references of IEEE80211_BAND_* to NL80211_BAND_*
+
+Reference:
+https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=57fbcce37be7c1d2622b56587c10ade00e96afa3
+
+--- a/src/wl/sys/wl_cfg80211_hybrid.c 2016-06-13 11:57:36.159340297 -0500
++++ b/src/wl/sys/wl_cfg80211_hybrid.c 2016-06-13 11:58:18.442323435 -0500
+@@ -236,7 +236,7 @@
+ #endif
+
+ #define CHAN2G(_channel, _freq, _flags) { \
+- .band = IEEE80211_BAND_2GHZ, \
++ .band = NL80211_BAND_2GHZ, \
+ .center_freq = (_freq), \
+ .hw_value = (_channel), \
+ .flags = (_flags), \
+@@ -245,7 +245,7 @@
+ }
+
+ #define CHAN5G(_channel, _flags) { \
+- .band = IEEE80211_BAND_5GHZ, \
++ .band = NL80211_BAND_5GHZ, \
+ .center_freq = 5000 + (5 * (_channel)), \
+ .hw_value = (_channel), \
+ .flags = (_flags), \
+@@ -379,7 +379,7 @@
+ };
+
+ static struct ieee80211_supported_band __wl_band_2ghz = {
+- .band = IEEE80211_BAND_2GHZ,
++ .band = NL80211_BAND_2GHZ,
+ .channels = __wl_2ghz_channels,
+ .n_channels = ARRAY_SIZE(__wl_2ghz_channels),
+ .bitrates = wl_g_rates,
+@@ -387,7 +387,7 @@
+ };
+
+ static struct ieee80211_supported_band __wl_band_5ghz_a = {
+- .band = IEEE80211_BAND_5GHZ,
++ .band = NL80211_BAND_5GHZ,
+ .channels = __wl_5ghz_a_channels,
+ .n_channels = ARRAY_SIZE(__wl_5ghz_a_channels),
+ .bitrates = wl_a_rates,
+@@ -395,7 +395,7 @@
+ };
+
+ static struct ieee80211_supported_band __wl_band_5ghz_n = {
+- .band = IEEE80211_BAND_5GHZ,
++ .band = NL80211_BAND_5GHZ,
+ .channels = __wl_5ghz_n_channels,
+ .n_channels = ARRAY_SIZE(__wl_5ghz_n_channels),
+ .bitrates = wl_a_rates,
+@@ -1876,8 +1876,8 @@
+ wdev->wiphy->max_num_pmkids = WL_NUM_PMKIDS_MAX;
+ #endif
+ wdev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC);
+- wdev->wiphy->bands[IEEE80211_BAND_2GHZ] = &__wl_band_2ghz;
+- wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = &__wl_band_5ghz_a;
++ wdev->wiphy->bands[NL80211_BAND_2GHZ] = &__wl_band_2ghz;
++ wdev->wiphy->bands[NL80211_BAND_5GHZ] = &__wl_band_5ghz_a;
+ wdev->wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM;
+ wdev->wiphy->cipher_suites = __wl_cipher_suites;
+ wdev->wiphy->n_cipher_suites = ARRAY_SIZE(__wl_cipher_suites);
+@@ -2000,7 +2000,7 @@
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)
+ freq = ieee80211_channel_to_frequency(notif_bss_info->channel,
+ (notif_bss_info->channel <= CH_MAX_2G_CHANNEL) ?
+- IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ);
++ NL80211_BAND_2GHZ : NL80211_BAND_5GHZ);
+ #else
+ freq = ieee80211_channel_to_frequency(notif_bss_info->channel);
+ #endif
+@@ -2116,7 +2116,7 @@
+ return err;
+ }
+ chan = wf_chspec_ctlchan(chanspec);
+- band = (chan <= CH_MAX_2G_CHANNEL) ? IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ;
++ band = (chan <= CH_MAX_2G_CHANNEL) ? NL80211_BAND_2GHZ : NL80211_BAND_5GHZ;
+ freq = ieee80211_channel_to_frequency(chan, band);
+ channel = ieee80211_get_channel(wiphy, freq);
+ cfg80211_ibss_joined(ndev, (u8 *)&wl->bssid, channel, GFP_KERNEL);
+@@ -2250,10 +2250,10 @@
+ join_params->params.chanspec_list[0] =
+ ieee80211_frequency_to_channel(chan->center_freq);
+
+- if (chan->band == IEEE80211_BAND_2GHZ) {
++ if (chan->band == NL80211_BAND_2GHZ) {
+ chanspec |= WL_CHANSPEC_BAND_2G;
+ }
+- else if (chan->band == IEEE80211_BAND_5GHZ) {
++ else if (chan->band == NL80211_BAND_5GHZ) {
+ chanspec |= WL_CHANSPEC_BAND_5G;
+ }
+ else {
+@@ -2885,7 +2885,7 @@
+
+ if (phy == 'n' || phy == 'a' || phy == 'v') {
+ wiphy = wl_to_wiphy(wl);
+- wiphy->bands[IEEE80211_BAND_5GHZ] = &__wl_band_5ghz_n;
++ wiphy->bands[NL80211_BAND_5GHZ] = &__wl_band_5ghz_n;
+ }
+
+ return err;
diff --git a/net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.271-r4-linux-4.8.patch b/net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.271-r4-linux-4.8.patch
new file mode 100644
index 000000000000..20e8a9ae49d2
--- /dev/null
+++ b/net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.271-r4-linux-4.8.patch
@@ -0,0 +1,64 @@
+From d3f93542326a06d920c6eb89b703384290d37b8b Mon Sep 17 00:00:00 2001
+From: Alberto Milone <alberto.milone@canonical.com>
+Date: Fri, 2 Sep 2016 17:35:34 +0200
+Subject: [PATCH 1/1] Add support for Linux 4.8
+
+Orginal author: Krzysztof Kolasa
+---
+ src/wl/sys/wl_cfg80211_hybrid.c | 22 ++++++++++++++++++++++
+ 1 file changed, 22 insertions(+)
+
+diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c
+index 2fc71fe..ec5e472 100644
+--- a/src/wl/sys/wl_cfg80211_hybrid.c
++++ b/src/wl/sys/wl_cfg80211_hybrid.c
+@@ -2388,8 +2388,16 @@ wl_bss_connect_done(struct wl_cfg80211_priv *wl, struct net_device *ndev,
+ s32 err = 0;
+
+ if (wl->scan_request) {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++ struct cfg80211_scan_info info = {
++ .aborted = true,
++ };
++ WL_DBG(("%s: Aborting scan\n", __FUNCTION__));
++ cfg80211_scan_done(wl->scan_request, &info);
++#else
+ WL_DBG(("%s: Aborting scan\n", __FUNCTION__));
+ cfg80211_scan_done(wl->scan_request, true);
++#endif
+ wl->scan_request = NULL;
+ }
+
+@@ -2490,7 +2498,14 @@ wl_notify_scan_status(struct wl_cfg80211_priv *wl, struct net_device *ndev,
+
+ scan_done_out:
+ if (wl->scan_request) {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++ struct cfg80211_scan_info info = {
++ .aborted = false,
++ };
++ cfg80211_scan_done(wl->scan_request, &info);
++#else
+ cfg80211_scan_done(wl->scan_request, false);
++#endif
+ wl->scan_request = NULL;
+ }
+ rtnl_unlock();
+@@ -2909,7 +2924,14 @@ s32 wl_cfg80211_down(struct net_device *ndev)
+ s32 err = 0;
+
+ if (wl->scan_request) {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++ struct cfg80211_scan_info info = {
++ .aborted = true,
++ };
++ cfg80211_scan_done(wl->scan_request, &info);
++#else
+ cfg80211_scan_done(wl->scan_request, true);
++#endif
+ wl->scan_request = NULL;
+ }
+
+--
+2.7.4
+
diff --git a/net-wireless/broadcom-sta/metadata.xml b/net-wireless/broadcom-sta/metadata.xml
new file mode 100644
index 000000000000..29b7c78b10d7
--- /dev/null
+++ b/net-wireless/broadcom-sta/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>tomboy64@sina.cn</email>
+ <name>M.B.</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="launchpad">~albertomilone</remote-id>
+ </upstream>
+</pkgmetadata>