summaryrefslogtreecommitdiffstats
path: root/broadcom-sta/build
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2017-11-21 00:32:02 +0000
committer Eric Hameleers <alien@slackware.com>2017-11-21 00:32:02 +0000
commit0645e43773d30baedaa25f61b8f0158c48902cea (patch)
treeca4d114180d085166aec3f315caffe340cb37868 /broadcom-sta/build
parentde1d662b41c073526a18bdaeaef78aeb49bba5ba (diff)
downloadasb-0645e43773d30baedaa25f61b8f0158c48902cea.tar.gz
asb-0645e43773d30baedaa25f61b8f0158c48902cea.tar.xz
Initial revision
Diffstat (limited to 'broadcom-sta/build')
-rw-r--r--broadcom-sta/build/README24
-rw-r--r--broadcom-sta/build/README_6.30.223.271.txt461
-rw-r--r--broadcom-sta/build/b43_blacklist.conf.new9
-rwxr-xr-xbroadcom-sta/build/broadcom-sta.SlackBuild115
-rw-r--r--broadcom-sta/build/broadcom-sta.info14
-rw-r--r--broadcom-sta/build/patches/001-null-pointer-fix.patch27
-rw-r--r--broadcom-sta/build/patches/002-rdtscl.patch18
-rw-r--r--broadcom-sta/build/patches/linux411.patch27
-rw-r--r--broadcom-sta/build/patches/linux412.patch68
-rw-r--r--broadcom-sta/build/patches/linux47.patch109
-rw-r--r--broadcom-sta/build/patches/linux48.patch64
-rw-r--r--broadcom-sta/build/slack-desc19
12 files changed, 955 insertions, 0 deletions
diff --git a/broadcom-sta/build/README b/broadcom-sta/build/README
new file mode 100644
index 00000000..d3331e0d
--- /dev/null
+++ b/broadcom-sta/build/README
@@ -0,0 +1,24 @@
+The broadcom-sta package includes the kernel module 'wl', which contains
+the Broadcom-provided proprietary kernel driver that supports a number of
+their cards. Known supported model numbers include the listed chipsets.
+
+BCM4311 (PCI IDs 14e4:4311, 14e4:4312, 14e4:4313)
+BCM4312 (PCI ID 14e4:4315)
+BCM4313 (PCI ID 14e4:4727)
+BCM4321 (PCI IDs 14e4:4328, 14e4:4329, 14e4:432a)
+BCM4322 (PCI IDs 14e4:432b, 14e4:432c, 14e4:432d)
+BCM43142 (PCI ID 14e4:4365)
+BCM43224 (PCI ID 14e4:4353)
+BCM43225 (PCI ID 14e4:4357)
+BCM43227 (PCI ID 14e4:4358)
+BCM43228 (PCI ID 14e4:4359)
+BCM4331 (PCI ID 14e4:4331)
+BCM4360 (PCI ID 14e4:43a0)
+BCM4352 (PCI ID 14e4:43b1)
+
+Some of these devices are also supported by the free b43 and brcm80211
+drivers. In order to avoid conflicts /etc/modprobe.d/b43_blacklist.conf
+disables these drivers.
+
+Read the included LICENSE.txt file (placed in /usr/doc) before using the
+proprietary driver.
diff --git a/broadcom-sta/build/README_6.30.223.271.txt b/broadcom-sta/build/README_6.30.223.271.txt
new file mode 100644
index 00000000..1068371b
--- /dev/null
+++ b/broadcom-sta/build/README_6.30.223.271.txt
@@ -0,0 +1,461 @@
+
+Broadcom Linux hybrid wireless driver
+Release Version: 6.30.223.271
+Release Date: Fri Sep 18 15:41:45 2015
+
+DISCLAIMER
+----------
+This is an Official Release of Broadcom's hybrid Linux driver for use with
+Broadcom based hardware.
+
+WHERE TO GET THE RELEASE
+------------------------
+For General Web releases: http://www.broadcom.com/support/802.11/linux_sta.php
+
+IMPORTANT NOTE AND DISCUSSION OF HYBRID DRIVER
+----------------------------------------------
+There are separate tarballs for 32 bit and 64 bit x86 CPU architectures.
+Make sure you use the appropriate tarball for your machine.
+
+Other than 32 vs 64 bit, the hybrid binary is agnostic to the specific
+versions (3.5.X) and distributions (Fedora, Ubuntu, SuSE, etc). It performs
+all interactions with the OS through OS specific files (wl_linux.c, wl_iw.c,
+osl_linux.c) that are shipped in source form. You compile this source on
+your system and link with a precompiled binary file (wlc_hybrid.o_shipped)
+which contains the rest of the driver.
+
+PRECOMPILED DRIVER
+-------------------
+Some distros (Ubuntu and Fedora at the least) already have a version of
+this driver in their repositories precompiled, tested and ready to go.
+You just use the package manager to install the proper package. If
+its available for your distro, this is usually an easier solution. See
+the end of this document for further discussion.
+
+ABOUT THIS RELEASE
+-------------------
+This is a rollup release. It includes and deprecates all previous releases
+and patches. At the time of release there are no existing patches for this
+release from Broadcom.
+
+SUPPORTED DEVICES
+-----------------
+The cards with the following PCI Device IDs are supported with this driver.
+Both Broadcom and and Dell product names are described. Cards not listed
+here may also work.
+
+ BRCM PCI PCI Dell
+ Product Name Vendor ID Device ID Product ID
+ ------------- ---------- --------- -----------
+ 4311 2.4 Ghz 0x14e4 0x4311 Dell 1390
+ 4311 Dualband 0x14e4 0x4312 Dell 1490
+ 4311 5 Ghz 0x14e4 0x4313
+ 4312 2.4 Ghz 0x14e4 0x4315 Dell 1395
+ 4313 2.4 Ghz 0x14e4 0x4727 Dell 1501/1504
+ 4321 Dualband 0x14e4 0x4328 Dell 1505
+ 4321 Dualband 0x14e4 0x4328 Dell 1500
+ 4321 2.4 Ghz 0x14e4 0x4329
+ 4321 5 Ghz 0x14e4 0x432a
+ 4322 Dualband 0x14e4 0x432b Dell 1510
+ 4322 2.4 Ghz 0x14e4 0x432c
+ 4322 5 Ghz 0x14e4 0x432d
+ 43142 2.4 Ghz 0x14e4 0x4365
+ 43224 Dualband 0x14e4 0x4353 Dell 1520
+ 43225 2.4 Ghz 0x14e4 0x4357
+ 43227 2.4 Ghz 0x14e4 0x4358
+ 43228 Dualband 0x14e4 0x4359 Dell 1530/1540
+ 4331 Dualband 0x14e4 0x4331
+ 4360 Dualband 0x14e4 0x43a0
+ 4352 Dualband 0x14e4 0x43a0
+
+To find the Device ID's of Broadcom cards on your machines do:
+# lspci -n | grep 14e4
+
+NOTABLE CHANGES
+---------------
+ Upgraded to support 3.19 kernel APIs.
+
+REQUIREMENTS
+------------
+Building this driver requires that your machine have the proper tools,
+packages, header files and libraries to build a standard kernel module.
+This usually is done by installing the kernel developer or kernel source
+package and varies from distro to distro. Consult the documentation for
+your specific OS.
+
+If you cannot successfully build a module that comes with your distro's
+kernel developer or kernel source package, you will not be able to build
+this module either.
+
+If you try to build this module but get an error message that looks like
+this:
+
+make: *** /lib/modules/"release"/build: No such file or directory. Stop.
+
+Then you do not have the proper packages installed, since installing the
+proper packages will create /lib/modules/"release"/build on your system.
+
+On Fedora install 'kernel-devel' from
+Package Manager (System-> Administration-> Add/Remove Software)
+or
+yum install kernel-devel
+or
+yum install kernel-PAE-devel
+
+On Ubuntu, you will need headers and tools. Try these commands:
+# apt-get install build-essential linux-headers-generic
+# apt-get build-dep linux
+
+To check to see if you have this directory do this:
+
+# ls /lib/modules/`uname -r`/build
+
+BUILD INSTRUCTIONS
+------------------
+1. Setup the directory by untarring the proper tarball:
+
+For 32 bit: hybrid-v35-nodebug-pcoem-portsrc.tar.gz
+For 64 bit: hybrid-v35_64-nodebug-pcoem-portsrc.tar.gz
+
+Example:
+# mkdir hybrid_wl
+# cd hybrid_wl
+# tar xzf <path>/hybrid-v35-nodebug-pcoem-portsrc.tar.gz or
+ <path>/hybrid-v35_64-nodebug-pcoem-portsrc.tar.gz
+
+2. Build the driver as a Linux loadable kernel module (LKM):
+
+# make clean (optional)
+# make
+
+When the build completes, it will produce a wl.ko file in the top level
+directory.
+
+If your driver does not build, check to make sure you have installed the
+kernel package described in the requirements above.
+
+This driver uses cfg80211 API. Code for Wext API is present and can be built
+but we have dropped support for it.
+As before, the Makefile will still build the matching version for your system.
+
+# make API=CFG80211
+ or
+# make API=WEXT (deprecated)
+
+INSTALL INSTRUCTIONS
+--------------------
+
+Upgrading from a previous version:
+---------------------------------
+
+If you were already running a previous version of wl, you'll want to provide
+a clean transition from the older driver. (The path to previous driver is
+usually /lib/modules/<kernel-version>/kernel/net/wireless)
+
+# rmmod wl
+# mv <path-to-prev-driver>/wl.ko <path-to-prev-driver>/wl.ko.orig
+# cp wl.ko <path-to-prev-driver>/wl.ko
+# depmod
+# modprobe wl
+
+The new wl driver should now be operational and your all done.
+
+Fresh installation:
+------------------
+1: Remove any other drivers for the Broadcom wireless device.
+
+There are several other drivers (besides this one) that can drive
+Broadcom 802.11 chips. These include b43, brcmsmac, bcma and ssb. They will
+conflict with this driver and need to be uninstalled before this driver
+can be installed. Any previous revisions of the wl driver also need to
+be removed.
+
+Note: On some systems such as Ubuntu 9.10, the ssb module may load during
+boot even though it is blacklisted (see note under Common Issues on how to
+resolve this. Nevertheless, ssb still must be removed
+(by hand or script) before wl is loaded. The wl driver will not function
+properly if ssb the module is loaded.
+
+# lsmod | grep "brcmsmac\|b43\|ssb\|bcma\|wl"
+
+If any of these are installed, remove them:
+# rmmod b43
+# rmmod brcmsmac
+# rmmod ssb
+# rmmod bcma
+# rmmod wl
+
+To blacklist these drivers and prevent them from loading in the future:
+# echo "blacklist ssb" >> /etc/modprobe.d/blacklist.conf
+# echo "blacklist bcma" >> /etc/modprobe.d/blacklist.conf
+# echo "blacklist b43" >> /etc/modprobe.d/blacklist.conf
+# echo "blacklist brcmsmac" >> /etc/modprobe.d/blacklist.conf
+
+2: Insmod the driver.
+
+Otherwise, if you have not previously installed a wl driver, you'll need
+to add a security module before using the wl module. Most newer systems
+use lib80211 while others use ieee80211_crypt_tkip. See which one works for
+your system.
+
+# modprobe lib80211
+ or
+# modprobe ieee80211_crypt_tkip
+
+If your using the cfg80211 version of the driver, then cfg80211 needs to be
+loaded:
+
+# modprobe cfg80211
+
+Then:
+# insmod wl.ko
+
+wl.ko is now operational. It may take several seconds for the Network
+Manager to notice a new network driver has been installed and show the
+surrounding wireless networks.
+
+If there was an error, see Common issues below.
+
+Common issues:
+----------------
+* After the insmod you may see this message:
+ WARNING: modpost: missing MODULE_LICENSE()
+ It is expected, not harmful and can be ignored.
+
+* If you see this message:
+
+ "insmod: error inserting 'wl.ko': -1 Unknown symbol in module"
+
+ Usually this means that one of the required modules (as mentioned above) is
+ not loaded. Try this:
+ # modprobe lib80211 or ieee80211_crypt_tkip (depending on your os)
+ # modprobe cfg80211
+
+ Now re-try to insmod the wl driver:
+ # insmod wl.ko
+
+* If the wl driver loads but doesn't seem to do anything:
+ the ssb module may be the cause. Sometimes blacklisting ssb may not
+ be enough to prevent it from loading and it loads anyway. (This is mostly
+ seen on Ubuntu/Debian systems).
+
+ Check to see if ssb, bcma, wl or b43 is loaded:
+ # lsmod | grep "brcmsmac\|ssb\|wl\|b43\|bcma"
+
+ If any of these are installed, remove them:
+ # rmmod brcmsmac
+ # rmmod ssb
+ # rmmod bcma
+ # rmmod wl
+ # insmod wl
+
+ Back up the current boot ramfs and generate a new one:
+ # cp /boot/initrd.img-`uname -r` somewheresafe
+ # update-initramfs -u
+ # reboot
+
+3: Setup to always load at boot time.
+
+The procedure to make a module load at boot time varies from distro to
+distro. Consult the docs for your specific distro to see how. The
+following seems to work for my setup on Fedora and Ubuntu. Check your
+docs to see the procedure for your distro.
+
+Follow these steps to have the driver load as part of the boot process:
+
+# load driver as described above
+# cp wl.ko /lib/modules/`uname -r`/kernel/drivers/net/wireless
+# depmod -a
+
+# echo modeprobe wl >> /etc/rc.local (Fedora/SUSE)
+
+Ubuntu ships a version of wl.ko, so those need to be disabled. On my
+system the were several versions, so I searched and renamed the .ko's
+like this:
+
+# sh: for i in `find /lib /var -name wl\.ko`; do mv $i ${i}.orig; done
+
+
+TX POWER EXPLAINED
+------------------
+'iwconfig eth1 txpower' & 'iwlist eth1 txpower' set and get the drivers
+user-requested transmit power level. This can go up to 32 dbm and allows
+the user to lower the tx power to levels below the regulatory limit.
+Internally, the actual tx power is always kept within regulatory limits
+no matter what the user request is set to.
+
+WHAT'S NEW IN RELEASE 6.30.223.23X
+---------------------------------
++ Upgraded to Support 3.11 kernels
++ Added cfg80211 wowlan support for Magic Packets and Disconnect
+
+WHAT'S NEW IN RELEASE 6.30.223.126
+----------------------------------
++ Upgraded to Support 3.8.x
++ Added 43142 support
++ Added 4352 support
++ Dropped WEXT support
+
+WHAT'S NEW IN RELEASE 5.100.82.116
+----------------------------------
++ Support for Linux kernels > 3.0
+
+WHAT'S NEW IN RELEASE 5.100.82.115
+----------------------------------
++ Added cfg80211 API support. The choice of API is done at compile time. If
+kernel version >= 2.6.32, cfg80211 is used, otherwise wireless extension
+is used. (End users should notice little difference.)
++ Supports Linux kernel 2.6.38
++ Fix for problem with rebooting while wireless disabled via airline switch.
++ Fix for PR102197 STA does not connect to hidden SSID
++ Fix for PR102214: Could not get rssi (-22)" print comes in 'dmesg' output
++ Supports monitor mode
++ Supports hidden networks
++ Supports rfkill
+
+WHAT'S NEW IN RELEASE 5.100.82.38
+---------------------------------
++ Support for bcm43227 and bcm43228
++ Fix for issue where iwconfig was sometime reporting rate incorrectly
++ Supports rfkill in kernels 2.6.31 to 2.6.36
++ Supports scan complete event (SIOCGIWSCAN)
++ Adds EAGAIN (busy signal) to query of scan results
+
+WHAT'S NEW IN RELEASE 5.100.57.15
+---------------------------------
++ Following fixes (issues introduced in 5.100.57.13)
+ Issue #87477 - 4313: DUT is not able to associate in WPA2-PSK TKIP/AES
+ Issue #87533 - NetworkManager: 4313: Unable to associate to APs with WPA2-PSK
+
+WHAT'S NEW IN RELEASE 5.100.57.13
+---------------------------------
++ 4313 PHY fixes to improve throughput stability at different ranges
++ Fix for interop issues with different APs
++ Fix for hangs seen during Fn-F2 sequence
+- Support for rfkill in kernels 2.6.31 to 2.6.36
+
+WHAT'S NEW IN RELEASE 5.60.246.6
+--------------------------------
++ Supports rfkill in kernels 2.6.31 to 2.6.36
++ Fix for compile error with multicast list in kernel 2.6.34
++ Fix for #76743 - Ubuntu9.04: Network manager displays n/w's with radio disabled
+
+WHAT'S NEW IN RELEASE 5.60.246.2
+--------------------------------
++ Supports up to linux kernel 2.6.36 (from 2.6.32)
++ Fix for #86668: [Canonical] Bug #611575/617369: System will hang if
+ you use the F2 hot key to enable/disable wireless quickly while
+ wireless is still in the process of re-association with AP
+
+WHAT'S NEW IN RELEASE 5.60.48.36
+--------------------------------
++ Supports up to linux kernel 2.6.32
++ Supports hidden networks
++ Supports rfkill in kernels < 2.6.31
++ Setting power level via 'iwconfig eth1 txpower X' now operational
++ Support for bcm4313
++ Additional channels in both 2.4 and 5 Ghz bands
++ Fixed issue with tkip group keys that caused this message to repeat often:
+ TKIP: RX tkey->key_idx=2 frame keyidx=1 priv=ffff8800cf80e840
++ Following fixes
+ Issue #72216 - Ubuntu 8.04: standby/resume with WPA2 and wpa_supplicant causes
+ a continuous assoc/disassoc loop (issue in 2.6.24 kernel)
+ Issue #72324 - Ubuntu 8.04: cannot ping when Linux STA is IBSS creator with WEP
+ Issue #76739 - Ubuntu 9.04: unable to connect to hidden network after stdby/resume
+ Issue #80392 - S4 resume hang with SuSE SLED 11 and 43225
+ Issue #80792 - LSTA is not able to associate to AP with transit
+
+
+ISSUES FIXED AND WHAT'S NEW IN RECENT RELEASES
+-------------------------------------------
++ Supports monitor mode
++ Supports cfg80211
++ Supports hidden networks
++ Supports rfkill
+
+
+KNOWN ISSUES AND LIMITATIONS
+----------------------------
+#72238 - 20% lower throughput on channels 149, 153, 157, and 161
+#72324 - Ubuntu 8.04: cannot ping when Linux STA is IBSS creator with WEP
+enabled
+#72216 - Ubuntu 8.04: standby/resume with WPA2 and wpa_supplicant causes
+a continuous assoc/disassoc loop (issue with wpa_supplicant, restarting
+wpa_supplicant fixes the issue)
+#76739 Ubuntu9.04: unable to connect to hidden network after stdby/resume
+#76793 Ubuntu9.04: STA fails to create IBSS network in 5 Ghz band
+
+
+KNOWN ISSUES AND LIMITATIONS IN EXTERNAL COMPONENTS
+---------------------------------------------------
+
+wpa_supplicant 0.6.3 + nl80211 + WEP - (Note: This would only affect you if
+you are using wpa_supplicant directly from the command line and specify
+nl80211 interface, e.g. "wpa_supplicant -Dnl80211 -ieth1 ..". If you are using
+network manager GUI to connect it should work file.)
+wpa_supplicant 0.6.3 might have a bug that affect WEP connections created
+through nl80211. Upgrade to wpa_supplicant to 0.7.3 would solve this problem.
+
+Ubuntu 10.10 kernel + nl80211 + WPA/WPA2 - (Note: This would only affect you if
+you are using wpa_supplicant directly from the command line and specify
+nl80211 interface, e.g. "wpa_supplicant -Dnl80211 -ieth1 ..". If you are using
+network manager GUI to connect it should work file.)
+Some kernel versions of Ubuntu such as 2.6.35-22 (released with Ubuntu
+10.10) may have problems that affect WPA/WPA2 connections created through
+nl80211. Upgrade to 2.6.35-25 or later should solve this problem.
+
+HOW TO USE MONITOR MODE
+-----------------------
+To enable monitor mode:
+$ echo 1 > /proc/brcm_monitor0 => Creates a 'prism0' network interface for use by Wireshark and others.
+$ ifconfig prism0 up => Enable the interface
+
+To disable monitor mode:
+$ echo 0 > /proc/brcm_monitor0
+
+HOW TO ENABLE WOWL
+-----------------
+$ iw phyX wowlan enable magic-packet disconnect
+$ iw phyX wowlan show
+
+
+HOW TO INSTALL A PRE-COMPILED DRIVER
+-----------------------------------
+Some of the major linux distros already supply a version of this driver, so
+you don't have to compile your own. Most of the distros keep this driver
+along with other proprietary or non-GPL drivers in a separate repository.
+
+For further information see the documentation for your specific distro.
+
+Fedora:
+------
+su -c 'rpm -Uvh
+http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
+http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm'
+
+su -
+yum update
+yum install kmod-wl
+
+Ubuntu:
+------
+Go to System->Administration->Hardware Drivers
+Choose the Broadcom STA wireless driver
+Activate
+
+Sometimes the driver does not show up in the Hardware Drivers choices. In
+this case, try reintalling the driver from the GUI or shell like this:
+
+From the GUI:
+Package Manager (System>Administration>Synaptic Package Manager). Click the
+Reload button in the upper left corner of Synaptic to refresh your index then
+search for and reinstall the package named bcmwl-kernel-source.
+
+From the shell:
+sudo apt-get update
+sudo apt-get --reinstall install bcmwl-kernel-source
+
+In either GUI or text case, after reinstalling, reboot your machine.
+
+Now go back to System->Administration->Hardware Drivers
+and you should see the driver enabled and working.
diff --git a/broadcom-sta/build/b43_blacklist.conf.new b/broadcom-sta/build/b43_blacklist.conf.new
new file mode 100644
index 00000000..76c457bc
--- /dev/null
+++ b/broadcom-sta/build/b43_blacklist.conf.new
@@ -0,0 +1,9 @@
+# wl module from Broadcom conflicts with the following modules:
+blacklist b43
+blacklist b43legacy
+blacklist b44
+blacklist bcma
+blacklist brcm80211
+blacklist brcmfmac
+blacklist brcmsmac
+blacklist ssb
diff --git a/broadcom-sta/build/broadcom-sta.SlackBuild b/broadcom-sta/build/broadcom-sta.SlackBuild
new file mode 100755
index 00000000..9170632a
--- /dev/null
+++ b/broadcom-sta/build/broadcom-sta.SlackBuild
@@ -0,0 +1,115 @@
+#!/bin/sh
+
+# Slackware build script for broadcom-sta
+
+# Copyright 2015 Andreas Voegele <andreas@andreasvoegele.com>
+#
+# Permission to use, copy, modify, and 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.
+
+PRGNAM=broadcom-sta
+VERSION=${VERSION:-6.30.223.271}
+BUILD=${BUILD:-1}
+TAG=${TAG:-alien}
+
+KERNEL=${KERNEL:-$( uname -r )}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i486 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+case "$ARCH" in
+ i?86)
+ SRCNAM=hybrid-v35-nodebug-pcoem
+ ;;
+ x86_64)
+ SRCNAM=hybrid-v35_64-nodebug-pcoem
+ ;;
+ *)
+ echo "$ARCH is not supported..."
+ exit 1
+ ;;
+esac
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+mkdir $PRGNAM-$VERSION
+cd $PRGNAM-$VERSION
+tar xvf $CWD/$SRCNAM-$( echo $VERSION | tr . _ ).tar.gz
+
+# Add support for newer kernels:
+for KMINOR in 7 8 11 12; do
+ cat $CWD/patches/linux4${KMINOR}.patch | patch -p1 --verbose || exit 1
+done
+
+chown -R root:root .
+find -L . \
+ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
+ -o -perm 511 \) -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+
+patch -p1 < $CWD/001-null-pointer-fix.patch
+patch -p1 < $CWD/002-rdtscl.patch
+
+make -C /lib/modules/$KERNEL/build M=$(pwd) clean
+make -C /lib/modules/$KERNEL/build M=$(pwd)
+
+mkdir -p $PKG/lib/modules/$KERNEL/kernel/extra
+cp wl.ko $PKG/lib/modules/$KERNEL/kernel/extra
+
+mkdir -p $PKG/etc/modprobe.d
+cat $CWD/b43_blacklist.conf.new > $PKG/etc/modprobe.d/b43_blacklist.conf.new
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a lib/LICENSE.txt $CWD/README_$VERSION.txt $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+cat << EOF > $PKG/install/doinst.sh
+config() {
+ NEW="\$1"
+ OLD="\$(dirname \$NEW)/\$(basename \$NEW .new)"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r \$OLD ]; then
+ mv \$NEW \$OLD
+ elif [ "\$(cat \$OLD | md5sum)" = "\$(cat \$NEW | md5sum)" ]; then
+ # toss the redundant copy
+ rm \$NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+config etc/modprobe.d/b43_blacklist.conf.new
+
+# A good idea whenever kernel modules are added or changed:
+if [ -x sbin/depmod ]; then
+ chroot . /sbin/depmod -a $KERNEL 1> /dev/null 2> /dev/null
+fi
+EOF
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-${VERSION}_$( echo $KERNEL | tr - _ )-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/broadcom-sta/build/broadcom-sta.info b/broadcom-sta/build/broadcom-sta.info
new file mode 100644
index 00000000..8120752d
--- /dev/null
+++ b/broadcom-sta/build/broadcom-sta.info
@@ -0,0 +1,14 @@
+PRGNAM="broadcom-sta"
+VERSION="6.30.223.271"
+HOMEPAGE="https://www.broadcom.com/support/802.11"
+DOWNLOAD="https://www.broadcom.com/docs/linux_sta/hybrid-v35-nodebug-pcoem-6_30_223_271.tar.gz \
+ https://www.broadcom.com/docs/linux_sta/README_6.30.223.271.txt"
+MD5SUM="4e75f4cb7d87f690f9659ffc478495f0 \
+ 458ea8d99c83769d4acf98137f0d46bb"
+DOWNLOAD_x86_64="https://www.broadcom.com/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz \
+ https://www.broadcom.com/docs/linux_sta/README_6.30.223.271.txt"
+MD5SUM_x86_64="115903050c41d466161784d4c843f4f9 \
+ 458ea8d99c83769d4acf98137f0d46bb"
+REQUIRES=""
+MAINTAINER="Andreas Voegele"
+EMAIL="andreas@andreasvoegele.com"
diff --git a/broadcom-sta/build/patches/001-null-pointer-fix.patch b/broadcom-sta/build/patches/001-null-pointer-fix.patch
new file mode 100644
index 00000000..adef19f3
--- /dev/null
+++ b/broadcom-sta/build/patches/001-null-pointer-fix.patch
@@ -0,0 +1,27 @@
+Description: Fixing null pointer crash
+
+Origin: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=773713
+Bug-Ubuntu: https://launchpad.net/bugs/1415880
+Last-Update: 2015-08-18
+
+---
+ src/wl/sys/wl_linux.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c
+index 860b935..295156f 100644
+--- a/src/wl/sys/wl_linux.c
++++ b/src/wl/sys/wl_linux.c
+@@ -2157,8 +2157,8 @@ wl_start(struct sk_buff *skb, struct net_device *dev)
+ 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);
+
+--
+1.9.1
+
diff --git a/broadcom-sta/build/patches/002-rdtscl.patch b/broadcom-sta/build/patches/002-rdtscl.patch
new file mode 100644
index 00000000..cfa16075
--- /dev/null
+++ b/broadcom-sta/build/patches/002-rdtscl.patch
@@ -0,0 +1,18 @@
+https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=fe47ae6e1a5005b2e82f7eab57b5c3820453293a
+https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=4ea1636b04dbd66536fa387bae2eea463efc705b
+
+diff -ru a/src/shared/linux_osl.c b/src/shared/linux_osl.c
+--- a/src/shared/linux_osl.c 2015-09-19 01:47:15.000000000 +0300
++++ b/src/shared/linux_osl.c 2015-11-21 15:20:30.585902518 +0200
+@@ -932,7 +932,11 @@
+ uint cycles;
+
+ #if defined(__i386__)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
++ cycles = (u32)rdtsc();
++#else
+ rdtscl(cycles);
++#endif
+ #else
+ cycles = 0;
+ #endif
diff --git a/broadcom-sta/build/patches/linux411.patch b/broadcom-sta/build/patches/linux411.patch
new file mode 100644
index 00000000..7a2e8c0c
--- /dev/null
+++ b/broadcom-sta/build/patches/linux411.patch
@@ -0,0 +1,27 @@
+diff -u sys0/wl_cfg80211_hybrid.c sys/wl_cfg80211_hybrid.c
+--- a/src/wl/sys/wl_cfg80211_hybrid.c
++++ b/src/wl/sys/wl_cfg80211_hybrid.c
+@@ -39,6 +39,10 @@
+ #include <proto/802.11.h>
+ #include <wl_cfg80211_hybrid.h>
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
++#include <linux/sched/signal.h>
++#endif
++
+ #define EVENT_TYPE(e) dtoh32((e)->event_type)
+ #define EVENT_FLAGS(e) dtoh16((e)->flags)
+ #define EVENT_STATUS(e) dtoh32((e)->status)
+diff -u sys0/wl_linux.c sys/wl_linux.c
+--- a/src/wl/sys/wl_linux.c
++++ b/src/wl/sys/wl_linux.c
+@@ -2915,7 +2915,9 @@
+ if (skb == NULL) return;
+
+ skb->dev = wl->monitor_dev;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
+ skb->dev->last_rx = jiffies;
++#endif
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22)
+ skb_reset_mac_header(skb);
+ #else
diff --git a/broadcom-sta/build/patches/linux412.patch b/broadcom-sta/build/patches/linux412.patch
new file mode 100644
index 00000000..8abc73db
--- /dev/null
+++ b/broadcom-sta/build/patches/linux412.patch
@@ -0,0 +1,68 @@
+diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c
+index da36405..d3741eb 100644
+--- a/src/wl/sys/wl_cfg80211_hybrid.c
++++ b/src/wl/sys/wl_cfg80211_hybrid.c
+@@ -53,7 +53,11 @@ u32 wl_dbg_level = WL_DBG_ERR;
+ #endif
+
+ 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, struct vif_params *params);
++#else
+ 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 +470,11 @@ wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len)
+
+ 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,6 +2369,20 @@ wl_bss_roaming_done(struct wl_cfg80211_priv *wl, struct net_device *ndev,
+ 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_bss *bss;
++ struct wlc_ssid *ssid;
++ ssid = &wl->profile->ssid;
++ bss = cfg80211_get_bss(wl_to_wiphy(wl), NULL, (s8 *)&wl->bssid,
++ ssid->SSID, ssid->SSID_len, WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
++ struct cfg80211_roam_info roam_info = {
++ .bss = bss,
++ .req_ie = conn_info->req_ie,
++ .req_ie_len = conn_info->req_ie_len,
++ .resp_ie = conn_info->resp_ie,
++ .resp_ie_len = conn_info->resp_ie_len,
++ };
++#endif
+ s32 err = 0;
+
+ wl_get_assoc_ies(wl);
+@@ -2368,12 +2390,17 @@ wl_bss_roaming_done(struct wl_cfg80211_priv *wl, struct net_device *ndev,
+ memcpy(&wl->bssid, &e->addr, ETHER_ADDR_LEN);
+ wl_update_bss_info(wl);
+ cfg80211_roamed(ndev,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
++ &roam_info,
++#else
+ #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39)
+ &wl->conf->channel,
+ #endif
+ (u8 *)&wl->bssid,
+ conn_info->req_ie, conn_info->req_ie_len,
+- conn_info->resp_ie, conn_info->resp_ie_len, GFP_KERNEL);
++ conn_info->resp_ie, conn_info->resp_ie_len,
++#endif
++ GFP_KERNEL);
+ WL_DBG(("Report roaming result\n"));
+
+ set_bit(WL_STATUS_CONNECTED, &wl->status);
diff --git a/broadcom-sta/build/patches/linux47.patch b/broadcom-sta/build/patches/linux47.patch
new file mode 100644
index 00000000..566680a0
--- /dev/null
+++ b/broadcom-sta/build/patches/linux47.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/broadcom-sta/build/patches/linux48.patch b/broadcom-sta/build/patches/linux48.patch
new file mode 100644
index 00000000..20e8a9ae
--- /dev/null
+++ b/broadcom-sta/build/patches/linux48.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/broadcom-sta/build/slack-desc b/broadcom-sta/build/slack-desc
new file mode 100644
index 00000000..02000f4c
--- /dev/null
+++ b/broadcom-sta/build/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+broadcom-sta: broadcom-sta (Broadcom wireless drivers)
+broadcom-sta:
+broadcom-sta: Proprietary driver for Broadcom's BCM4311, BCM4312, BCM4313, BCM4321,
+broadcom-sta: BCM4322, BCM43142, BCM43224, BCM43225, BCM43227, BCM43228, BCM4331,
+broadcom-sta: BCM4360 and BCM4352 wireless network cards. Includes a kernel module
+broadcom-sta: named 'wl'.
+broadcom-sta:
+broadcom-sta: For more information, see:
+broadcom-sta: https://www.broadcom.com/support/802.11
+broadcom-sta:
+broadcom-sta: