wok rev 20286

broadcom-wl: add some kernel compatibility patches from debian
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Apr 02 11:19:24 2018 +0200 (2018-04-02)
parents 608d4b90020d
children 786a896d2360
files broadcom-wl/receipt broadcom-wl/stuff/3.4.0.patch broadcom-wl/stuff/3.6.0.patch broadcom-wl/stuff/3.8.0.patch broadcom-wl/stuff/3.9.0.patch
line diff
     1.1 --- a/broadcom-wl/receipt	Mon Apr 02 10:26:51 2018 +0200
     1.2 +++ b/broadcom-wl/receipt	Mon Apr 02 11:19:24 2018 +0200
     1.3 @@ -19,7 +19,9 @@
     1.4  {
     1.5  	sed -i 's|ndo_set_multicast_list|ndo_set_rx_mode|' src/wl/sys/wl_linux.c
     1.6  	sed -i 's|linux/autoconf.h|generated/autoconf.h|' src/include/linuxver.h
     1.7 -	patch -Np1 -i $stuff/semaphore.patch
     1.8 +	for i in semaphore 3.4.0 3.6.0 3.8.0 3.9.0 ; do
     1.9 +		patch -Np1 -i $stuff/$i.patch
    1.10 +	done
    1.11  	KBUILD_NOPEDANTIC=1 make -C /usr/src/linux M=`pwd`
    1.12  	xz wl.ko
    1.13  }
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/broadcom-wl/stuff/3.4.0.patch	Mon Apr 02 11:19:24 2018 +0200
     2.3 @@ -0,0 +1,17 @@
     2.4 +Description: Enable compilation with 3.4 kernels
     2.5 +Author: Eugene San (eugenesan) <eugenesan@gmail.com>
     2.6 +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/bcmwl/+bug/994255
     2.7 +Last-Update: 2012-05-07
     2.8 +
     2.9 +--- a/amd64/src/wl/sys/wl_linux.c
    2.10 ++++ b/amd64/src/wl/sys/wl_linux.c
    2.11 +@@ -40,7 +40,9 @@
    2.12 + #include <linux/pci_ids.h>
    2.13 + #define WLC_MAXBSSCFG		1	
    2.14 + 
    2.15 ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)
    2.16 + #include <asm/system.h>
    2.17 ++#endif
    2.18 + #include <asm/io.h>
    2.19 + #include <asm/irq.h>
    2.20 + #include <asm/pgtable.h>
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/broadcom-wl/stuff/3.6.0.patch	Mon Apr 02 11:19:24 2018 +0200
     3.3 @@ -0,0 +1,39 @@
     3.4 +Description: Fix kernel oops with 3.6 and newer kernels
     3.5 +Author: Cyril Lacoux <clacoux@easter-eggs.com>
     3.6 +Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=698216
     3.7 +Last-Update: 2013-24-01
     3.8 +
     3.9 +--- a/amd64/src/wl/sys/wl_cfg80211.c
    3.10 ++++ b/amd64/src/wl/sys/wl_cfg80211.c
    3.11 +@@ -42,8 +42,12 @@
    3.12 +            enum nl80211_iftype type, u32 *flags, struct vif_params *params);
    3.13 + static s32 __wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
    3.14 +            struct cfg80211_scan_request *request, struct cfg80211_ssid *this_ssid);
    3.15 ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
    3.16 ++static s32 wl_cfg80211_scan(struct wiphy *wiphy, struct cfg80211_scan_request *request);
    3.17 ++#else
    3.18 + static s32 wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
    3.19 +            struct cfg80211_scan_request *request);
    3.20 ++#endif
    3.21 + static s32 wl_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed);
    3.22 + static s32 wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
    3.23 +            struct cfg80211_ibss_params *params);
    3.24 +@@ -570,10 +574,18 @@
    3.25 + }
    3.26 + 
    3.27 + static s32
    3.28 ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
    3.29 ++wl_cfg80211_scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
    3.30 ++#else
    3.31 + wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
    3.32 +                  struct cfg80211_scan_request *request)
    3.33 ++#endif
    3.34 + {
    3.35 + 	s32 err = 0;
    3.36 ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
    3.37 ++    struct wl_priv *wl = wiphy_to_wl(wiphy);
    3.38 ++    struct net_device *ndev = wl_to_ndev(wl);
    3.39 ++#endif
    3.40 + 
    3.41 + 	CHECK_SYS_UP();
    3.42 + 	err = __wl_cfg80211_scan(wiphy, ndev, request, NULL);
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/broadcom-wl/stuff/3.8.0.patch	Mon Apr 02 11:19:24 2018 +0200
     4.3 @@ -0,0 +1,75 @@
     4.4 +Description: Kernel 3.8 compatibility
     4.5 +Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=702788
     4.6 +Last-Update: 2013-03-08
     4.7 +
     4.8 +--- a/amd64/src/include/bcmutils.h
     4.9 ++++ b/amd64/src/include/bcmutils.h
    4.10 +@@ -555,7 +555,11 @@
    4.11 + extern void prhex(const char *msg, uchar *buf, uint len);
    4.12 + 
    4.13 + extern bcm_tlv_t *BCMROMFN(bcm_next_tlv)(bcm_tlv_t *elt, int *buflen);
    4.14 ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0)
    4.15 + extern bcm_tlv_t *BCMROMFN(bcm_parse_tlvs)(void *buf, int buflen, uint key);
    4.16 ++#else
    4.17 ++extern bcm_tlv_t *BCMROMFN(bcm_parse_tlvs)(const void *buf, int buflen, uint key);
    4.18 ++#endif
    4.19 + extern bcm_tlv_t *BCMROMFN(bcm_parse_ordered_tlvs)(void *buf, int buflen, uint key);
    4.20 + 
    4.21 + extern const char *bcmerrorstr(int bcmerror);
    4.22 +--- a/amd64/src/wl/sys/wl_cfg80211.c
    4.23 ++++ b/amd64/src/wl/sys/wl_cfg80211.c
    4.24 +@@ -754,7 +754,11 @@
    4.25 + 	else
    4.26 + 		memset(&join_params.params.bssid, 0, ETHER_ADDR_LEN);
    4.27 + 
    4.28 +-	wl_ch_to_chanspec(params->channel, &join_params, &join_params_size);
    4.29 ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0)
    4.30 ++ 	wl_ch_to_chanspec(params->channel, &join_params, &join_params_size);
    4.31 ++#else
    4.32 ++	wl_ch_to_chanspec(params->chandef.chan, &join_params, &join_params_size);
    4.33 ++#endif
    4.34 + 
    4.35 + 	err = wl_dev_ioctl(dev, WLC_SET_SSID, &join_params, join_params_size);
    4.36 + 	if (err) {
    4.37 +@@ -2057,9 +2061,14 @@
    4.38 + 	struct bcm_tlv *tim;
    4.39 + 	u16 beacon_interval;
    4.40 + 	s32 dtim_period;
    4.41 +-	size_t ie_len;
    4.42 +-	u8 *ie;
    4.43 + 	s32 err = 0;
    4.44 ++ 	size_t ie_len;
    4.45 ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0)
    4.46 ++ 	u8 *ie;
    4.47 ++#else
    4.48 ++	const u8 *ie;
    4.49 ++	const struct cfg80211_bss_ies *ies;
    4.50 ++#endif
    4.51 + 
    4.52 + 	ssid = &wl->profile->ssid;
    4.53 + 	bss = cfg80211_get_bss(wl_to_wiphy(wl), NULL, (s8 *)&wl->bssid,
    4.54 +@@ -2089,8 +2098,22 @@
    4.55 + 		beacon_interval = cpu_to_le16(bi->beacon_period);
    4.56 + 	} else {
    4.57 + 		WL_DBG(("Found the AP in the list - BSSID %pM\n", bss->bssid));
    4.58 +-		ie = bss->information_elements;
    4.59 +-		ie_len = bss->len_information_elements;
    4.60 ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0)
    4.61 ++ 		ie = bss->information_elements;
    4.62 ++ 		ie_len = bss->len_information_elements;
    4.63 ++#else
    4.64 ++		rcu_read_lock();
    4.65 ++		ies = (const struct cfg80211_bss_ies*)rcu_dereference(bss->ies);
    4.66 ++		if (!ies) {
    4.67 ++			/* This should never happen */
    4.68 ++			rcu_read_unlock();
    4.69 ++			err = -EIO;
    4.70 ++			goto update_bss_info_out;
    4.71 ++		}
    4.72 ++		ie = ies->data;
    4.73 ++		ie_len = (size_t)(ies->len);
    4.74 ++		rcu_read_unlock();
    4.75 ++#endif
    4.76 + 		beacon_interval = bss->beacon_interval;
    4.77 + 		cfg80211_put_bss(bss);
    4.78 + 	}
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/broadcom-wl/stuff/3.9.0.patch	Mon Apr 02 11:19:24 2018 +0200
     5.3 @@ -0,0 +1,17 @@
     5.4 +Description: Kernel 3.9 compatibility
     5.5 +Last-Update: 2013-05-07
     5.6 +
     5.7 +--- a/amd64/src/wl/sys/wl_cfg80211.c
     5.8 ++++ b/amd64/src/wl/sys/wl_cfg80211.c
     5.9 +@@ -2115,7 +2115,11 @@
    5.10 + 		rcu_read_unlock();
    5.11 + #endif
    5.12 + 		beacon_interval = bss->beacon_interval;
    5.13 ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0)
    5.14 + 		cfg80211_put_bss(bss);
    5.15 ++#else
    5.16 ++		cfg80211_put_bss(wl_to_wiphy(wl), bss);
    5.17 ++#endif
    5.18 + 	}
    5.19 + 
    5.20 + 	tim = bcm_parse_tlvs(ie, ie_len, WLAN_EID_TIM);