wok rev 20393

Add broadcom-wl64
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Jun 25 12:10:04 2018 +0200 (2018-06-25)
parents 34360d1221d9
children 36685884d4f6
files broadcom-wl64/receipt broadcom-wl64/stuff/3.14.0.patch broadcom-wl64/stuff/3.4.0.patch broadcom-wl64/stuff/3.6.0.patch broadcom-wl64/stuff/3.8.0.patch broadcom-wl64/stuff/3.9.0.patch broadcom-wl64/stuff/semaphore.patch
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/broadcom-wl64/receipt	Mon Jun 25 12:10:04 2018 +0200
     1.3 @@ -0,0 +1,52 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="broadcom-wl64"
     1.7 +VERSION="5_100_82_112"
     1.8 +CATEGORY="network"
     1.9 +MAINTAINER="jozee@slitaz.org"
    1.10 +LICENSE="other"
    1.11 +SHORT_DESC="Broadcom 802.11abg Linux STA Networking Drivers"
    1.12 +WEB_SITE="http://www.broadcom.com/support/802.11/linux_sta.php"
    1.13 +TARBALL="hybrid-portsrc_x86_64-v${VERSION}.tar.gz"
    1.14 +WGET_URL="http://www.broadcom.com/docs/linux_sta/$TARBALL"
    1.15 +TAGS="wireless wifi driver"
    1.16 +PROVIDE="broadcom-wl:linux64"
    1.17 +
    1.18 +DEPENDS="linux"
    1.19 +BUILD_DEPENDS="linux64-module-headers xz uclibc-cross-compiler-x86_64"
    1.20 +
    1.21 +AUFS_NOT_RAMFS="uclibc-cross-compiler-x86_64 is not compatible with aufs+tmpfs 8("
    1.22 +
    1.23 +# Rules to configure and make the package.
    1.24 +compile_rules()
    1.25 +{
    1.26 +	sed -i 's|ndo_set_multicast_list|ndo_set_rx_mode|' src/wl/sys/wl_linux.c
    1.27 +	sed -i 's|linux/autoconf.h|generated/autoconf.h|' src/include/linuxver.h
    1.28 +	for i in semaphore 3.4.0 3.6.0 3.8.0 3.9.0 3.14.0 ; do
    1.29 +		echo "patch $i ..."
    1.30 +		patch -Np2 -i $stuff/$i.patch
    1.31 +	done
    1.32 +	KBUILD_NOPEDANTIC=1 make -C /usr/src/linux M=`pwd`
    1.33 +	xz wl.ko
    1.34 +}
    1.35 +
    1.36 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.37 +genpkg_rules()
    1.38 +{
    1.39 +	EXTRAVERSION=_${kvers}
    1.40 +	mkdir -p $fs/lib/modules/${kvers}-slitaz64/kernel/drivers/net/wireless
    1.41 +	# Compress and install module
    1.42 +	install -o root -m 0644 $src/wl.ko.xz \
    1.43 +		$fs/lib/modules/${kvers}-slitaz64/kernel/drivers/net/wireless/wl.ko.xz
    1.44 +}
    1.45 +
    1.46 +# Post install/remove commands for Tazpkg.
    1.47 +post_install()
    1.48 +{
    1.49 +	chroot "$1/" depmod -a ${EXTRAVERSION#_}-slitaz64
    1.50 +}
    1.51 +
    1.52 +post_remove()
    1.53 +{
    1.54 +	chroot "$1/" depmod -a ${EXTRAVERSION#_}-slitaz64
    1.55 +}
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/broadcom-wl64/stuff/3.14.0.patch	Mon Jun 25 12:10:04 2018 +0200
     2.3 @@ -0,0 +1,103 @@
     2.4 +--- a/amd64/src/wl/sys/wl_linux.c
     2.5 ++++ a/amd64/src/wl/sys/wl_linux.c
     2.6 +@@ -1192,7 +1192,11 @@
     2.7 + #else
     2.8 + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29))
     2.9 + 
    2.10 ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0))
    2.11 + 	dev = alloc_netdev(sizeof(wl_if_t), name, ether_setup);
    2.12 ++#else
    2.13 ++	dev = alloc_netdev(sizeof(wl_if_t), name, NET_NAME_UNKNOWN, ether_setup);
    2.14 ++#endif
    2.15 + 	wlif = netdev_priv(dev);
    2.16 + 	if (!dev) {
    2.17 + #else
    2.18 +@@ -3180,6 +3184,7 @@
    2.19 + {
    2.20 + 	char tmp[32];
    2.21 + 	sprintf(tmp, "%s%d", HYBRID_PROC, wl->pub->unit);
    2.22 ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
    2.23 + 	if ((wl->proc_entry = create_proc_entry(tmp, 0644, NULL)) == NULL) {
    2.24 + 		WL_ERROR(("%s: create_proc_entry %s failed\n", __FUNCTION__, tmp));
    2.25 + 		ASSERT(0);
    2.26 +@@ -3188,5 +3193,17 @@
    2.27 + 	wl->proc_entry->read_proc = wl_proc_read;
    2.28 + 	wl->proc_entry->write_proc = wl_proc_write;
    2.29 + 	wl->proc_entry->data = wl;
    2.30 ++#else
    2.31 ++	static const struct file_operations wl_proc_fops = {
    2.32 ++		.owner = THIS_MODULE,
    2.33 ++		.read = wl_proc_read,
    2.34 ++		.write = wl_proc_write,
    2.35 ++	};
    2.36 ++	if ((wl->proc_entry = proc_create(tmp, 0644, NULL,&wl_proc_fops)) == NULL) {
    2.37 ++		WL_ERROR(("%s: create_proc_entry %s failed\n", __FUNCTION__, tmp));
    2.38 ++		ASSERT(0);
    2.39 ++		return -1;
    2.40 ++	}
    2.41 ++#endif
    2.42 + 	return 0;
    2.43 + }
    2.44 +--- a/amd64/src/wl/sys/wl_cfg80211.c
    2.45 ++++ a/amd64/src/wl/sys/wl_cfg80211.c
    2.46 +@@ -1838,8 +1838,13 @@
    2.47 + 		mgmt->u.beacon.capab_info, &bi->BSSID));
    2.48 + 
    2.49 + 	signal = notif_bss_info->rssi * 100;
    2.50 ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)
    2.51 + 	if (!cfg80211_inform_bss_frame(wiphy, channel, mgmt,
    2.52 + 	    le16_to_cpu(notif_bss_info->frame_len), signal, GFP_KERNEL)) {
    2.53 ++#else
    2.54 ++	if (!cfg80211_inform_bss_frame(wiphy, channel, CFG80211_BSS_FTYPE_UNKNOWN, mgmt,
    2.55 ++	    le16_to_cpu(notif_bss_info->frame_len), signal, GFP_KERNEL)) {
    2.56 ++#endif
    2.57 + 		WL_ERR(("cfg80211_inform_bss_frame error\n"));
    2.58 + 		kfree(notif_bss_info);
    2.59 + 		return -EINVAL;
    2.60 +@@ -1857,6 +1862,12 @@
    2.61 + 	u32 event = EVENT_TYPE(e);
    2.62 + 	u16 flags = EVENT_FLAGS(e);
    2.63 + 	u32 status = EVENT_STATUS(e);
    2.64 ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)
    2.65 ++	struct ieee80211_channel *channel = NULL;
    2.66 ++	struct wiphy *wiphy;
    2.67 ++	u32 chanspec, chan;
    2.68 ++	u32 freq, band;
    2.69 ++#endif
    2.70 + 
    2.71 + 	WL_DBG(("\n"));
    2.72 + 
    2.73 +@@ -1868,7 +1879,11 @@
    2.74 + 		}
    2.75 + 		else if ((event == WLC_E_LINK && ~(flags & WLC_EVENT_MSG_LINK)) ||
    2.76 + 			event == WLC_E_DEAUTH_IND || event == WLC_E_DISASSOC_IND) {
    2.77 ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
    2.78 + 			cfg80211_disconnected(ndev, 0, NULL, 0, GFP_KERNEL);
    2.79 ++#else
    2.80 ++			cfg80211_disconnected(ndev, 0, NULL, 0, false, GFP_KERNEL);
    2.81 ++#endif
    2.82 + 			clear_bit(WL_STATUS_CONNECTED, &wl->status);
    2.83 + 			wl_link_down(wl);
    2.84 + 			wl_init_prof(wl->profile);
    2.85 +@@ -1892,7 +1907,21 @@
    2.86 + 			wl_get_assoc_ies(wl);
    2.87 + 			memcpy(&wl->bssid, &e->addr, ETHER_ADDR_LEN);
    2.88 + 			wl_update_bss_info(wl);
    2.89 ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)
    2.90 ++			wiphy = wl_to_wiphy(wl);
    2.91 ++			err = wl_dev_intvar_get(ndev, "chanspec", &chanspec);
    2.92 ++			if (err) {
    2.93 ++				WL_ERR(("Could not get chanspec, err %d\n", err));
    2.94 ++				return err;
    2.95 ++			}
    2.96 ++			chan = wf_chspec_ctlchan(chanspec);
    2.97 ++			band = (chan <= CH_MAX_2G_CHANNEL) ? IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ;
    2.98 ++			freq = ieee80211_channel_to_frequency(chan, band);
    2.99 ++			channel = ieee80211_get_channel(wiphy, freq);
   2.100 ++			cfg80211_ibss_joined(ndev, (u8 *)&wl->bssid, channel, GFP_KERNEL);
   2.101 ++#else
   2.102 + 			cfg80211_ibss_joined(ndev, (u8 *)&wl->bssid, GFP_KERNEL);
   2.103 ++#endif
   2.104 + 			set_bit(WL_STATUS_CONNECTED, &wl->status);
   2.105 + 			wl->profile->active = true;
   2.106 + 		}
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/broadcom-wl64/stuff/3.4.0.patch	Mon Jun 25 12:10:04 2018 +0200
     3.3 @@ -0,0 +1,17 @@
     3.4 +Description: Enable compilation with 3.4 kernels
     3.5 +Author: Eugene San (eugenesan) <eugenesan@gmail.com>
     3.6 +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/bcmwl/+bug/994255
     3.7 +Last-Update: 2012-05-07
     3.8 +
     3.9 +--- a/amd64/src/wl/sys/wl_linux.c
    3.10 ++++ b/amd64/src/wl/sys/wl_linux.c
    3.11 +@@ -40,7 +40,9 @@
    3.12 + #include <linux/pci_ids.h>
    3.13 + #define WLC_MAXBSSCFG		1	
    3.14 + 
    3.15 ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)
    3.16 + #include <asm/system.h>
    3.17 ++#endif
    3.18 + #include <asm/io.h>
    3.19 + #include <asm/irq.h>
    3.20 + #include <asm/pgtable.h>
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/broadcom-wl64/stuff/3.6.0.patch	Mon Jun 25 12:10:04 2018 +0200
     4.3 @@ -0,0 +1,39 @@
     4.4 +Description: Fix kernel oops with 3.6 and newer kernels
     4.5 +Author: Cyril Lacoux <clacoux@easter-eggs.com>
     4.6 +Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=698216
     4.7 +Last-Update: 2013-24-01
     4.8 +
     4.9 +--- a/amd64/src/wl/sys/wl_cfg80211.c
    4.10 ++++ b/amd64/src/wl/sys/wl_cfg80211.c
    4.11 +@@ -42,8 +42,12 @@
    4.12 +            enum nl80211_iftype type, u32 *flags, struct vif_params *params);
    4.13 + static s32 __wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
    4.14 +            struct cfg80211_scan_request *request, struct cfg80211_ssid *this_ssid);
    4.15 ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
    4.16 ++static s32 wl_cfg80211_scan(struct wiphy *wiphy, struct cfg80211_scan_request *request);
    4.17 ++#else
    4.18 + static s32 wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
    4.19 +            struct cfg80211_scan_request *request);
    4.20 ++#endif
    4.21 + static s32 wl_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed);
    4.22 + static s32 wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
    4.23 +            struct cfg80211_ibss_params *params);
    4.24 +@@ -570,10 +574,18 @@
    4.25 + }
    4.26 + 
    4.27 + static s32
    4.28 ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
    4.29 ++wl_cfg80211_scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
    4.30 ++#else
    4.31 + wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
    4.32 +                  struct cfg80211_scan_request *request)
    4.33 ++#endif
    4.34 + {
    4.35 + 	s32 err = 0;
    4.36 ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
    4.37 ++    struct wl_priv *wl = wiphy_to_wl(wiphy);
    4.38 ++    struct net_device *ndev = wl_to_ndev(wl);
    4.39 ++#endif
    4.40 + 
    4.41 + 	CHECK_SYS_UP();
    4.42 + 	err = __wl_cfg80211_scan(wiphy, ndev, request, NULL);
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/broadcom-wl64/stuff/3.8.0.patch	Mon Jun 25 12:10:04 2018 +0200
     5.3 @@ -0,0 +1,75 @@
     5.4 +Description: Kernel 3.8 compatibility
     5.5 +Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=702788
     5.6 +Last-Update: 2013-03-08
     5.7 +
     5.8 +--- a/amd64/src/include/bcmutils.h
     5.9 ++++ b/amd64/src/include/bcmutils.h
    5.10 +@@ -555,7 +555,11 @@
    5.11 + extern void prhex(const char *msg, uchar *buf, uint len);
    5.12 + 
    5.13 + extern bcm_tlv_t *BCMROMFN(bcm_next_tlv)(bcm_tlv_t *elt, int *buflen);
    5.14 ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0)
    5.15 + extern bcm_tlv_t *BCMROMFN(bcm_parse_tlvs)(void *buf, int buflen, uint key);
    5.16 ++#else
    5.17 ++extern bcm_tlv_t *BCMROMFN(bcm_parse_tlvs)(const void *buf, int buflen, uint key);
    5.18 ++#endif
    5.19 + extern bcm_tlv_t *BCMROMFN(bcm_parse_ordered_tlvs)(void *buf, int buflen, uint key);
    5.20 + 
    5.21 + extern const char *bcmerrorstr(int bcmerror);
    5.22 +--- a/amd64/src/wl/sys/wl_cfg80211.c
    5.23 ++++ b/amd64/src/wl/sys/wl_cfg80211.c
    5.24 +@@ -754,7 +754,11 @@
    5.25 + 	else
    5.26 + 		memset(&join_params.params.bssid, 0, ETHER_ADDR_LEN);
    5.27 + 
    5.28 +-	wl_ch_to_chanspec(params->channel, &join_params, &join_params_size);
    5.29 ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0)
    5.30 ++ 	wl_ch_to_chanspec(params->channel, &join_params, &join_params_size);
    5.31 ++#else
    5.32 ++	wl_ch_to_chanspec(params->chandef.chan, &join_params, &join_params_size);
    5.33 ++#endif
    5.34 + 
    5.35 + 	err = wl_dev_ioctl(dev, WLC_SET_SSID, &join_params, join_params_size);
    5.36 + 	if (err) {
    5.37 +@@ -2054,9 +2058,14 @@
    5.38 + 	struct bcm_tlv *tim;
    5.39 + 	u16 beacon_interval;
    5.40 + 	s32 dtim_period;
    5.41 +-	size_t ie_len;
    5.42 +-	u8 *ie;
    5.43 + 	s32 err = 0;
    5.44 ++ 	size_t ie_len;
    5.45 ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0)
    5.46 ++ 	u8 *ie;
    5.47 ++#else
    5.48 ++	const u8 *ie;
    5.49 ++	const struct cfg80211_bss_ies *ies;
    5.50 ++#endif
    5.51 + 
    5.52 + 	ssid = &wl->profile->ssid;
    5.53 + 	bss = cfg80211_get_bss(wl_to_wiphy(wl), NULL, (s8 *)&wl->bssid,
    5.54 +@@ -2086,8 +2095,22 @@
    5.55 + 		beacon_interval = cpu_to_le16(bi->beacon_period);
    5.56 + 	} else {
    5.57 + 		WL_DBG(("Found the AP in the list - BSSID %pM\n", bss->bssid));
    5.58 +-		ie = bss->information_elements;
    5.59 +-		ie_len = bss->len_information_elements;
    5.60 ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0)
    5.61 ++ 		ie = bss->information_elements;
    5.62 ++ 		ie_len = bss->len_information_elements;
    5.63 ++#else
    5.64 ++		rcu_read_lock();
    5.65 ++		ies = (const struct cfg80211_bss_ies*)rcu_dereference(bss->ies);
    5.66 ++		if (!ies) {
    5.67 ++			/* This should never happen */
    5.68 ++			rcu_read_unlock();
    5.69 ++			err = -EIO;
    5.70 ++			goto update_bss_info_out;
    5.71 ++		}
    5.72 ++		ie = ies->data;
    5.73 ++		ie_len = (size_t)(ies->len);
    5.74 ++		rcu_read_unlock();
    5.75 ++#endif
    5.76 + 		beacon_interval = bss->beacon_interval;
    5.77 + 		cfg80211_put_bss(bss);
    5.78 + 	}
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/broadcom-wl64/stuff/3.9.0.patch	Mon Jun 25 12:10:04 2018 +0200
     6.3 @@ -0,0 +1,17 @@
     6.4 +Description: Kernel 3.9 compatibility
     6.5 +Last-Update: 2013-05-07
     6.6 +
     6.7 +--- a/amd64/src/wl/sys/wl_cfg80211.c
     6.8 ++++ b/amd64/src/wl/sys/wl_cfg80211.c
     6.9 +@@ -2112,7 +2112,11 @@
    6.10 + 		rcu_read_unlock();
    6.11 + #endif
    6.12 + 		beacon_interval = bss->beacon_interval;
    6.13 ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0)
    6.14 + 		cfg80211_put_bss(bss);
    6.15 ++#else
    6.16 ++		cfg80211_put_bss(wl_to_wiphy(wl), bss);
    6.17 ++#endif
    6.18 + 	}
    6.19 + 
    6.20 + 	tim = bcm_parse_tlvs(ie, ie_len, WLAN_EID_TIM);
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/broadcom-wl64/stuff/semaphore.patch	Mon Jun 25 12:10:04 2018 +0200
     7.3 @@ -0,0 +1,11 @@
     7.4 +diff -aur bla/src/wl/sys/wl_iw.h bla.new/src/wl/sys/wl_iw.h
     7.5 +--- a/amd64/src/wl/sys/wl_iw.h	2010-02-06 02:59:15.000000000 +0100
     7.6 ++++ b/amd64/src/wl/sys/wl_iw.h	2010-08-07 23:17:35.368641722 +0200
     7.7 +@@ -15,6 +15,7 @@
     7.8 + #ifndef _wl_iw_h_
     7.9 + #define _wl_iw_h_
    7.10 + 
    7.11 ++#include <linux/semaphore.h>
    7.12 + #include <linux/wireless.h>
    7.13 + 
    7.14 + #include <typedefs.h>