# HG changeset patch # User Pascal Bellard # Date 1529921404 -7200 # Node ID cda065bfc44930837c4d553f11f7a8603d7005fe # Parent 34360d1221d9608ed329b56b1fc36c7786c32ee7 Add broadcom-wl64 diff -r 34360d1221d9 -r cda065bfc449 broadcom-wl64/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/broadcom-wl64/receipt Mon Jun 25 12:10:04 2018 +0200 @@ -0,0 +1,52 @@ +# SliTaz package receipt. + +PACKAGE="broadcom-wl64" +VERSION="5_100_82_112" +CATEGORY="network" +MAINTAINER="jozee@slitaz.org" +LICENSE="other" +SHORT_DESC="Broadcom 802.11abg Linux STA Networking Drivers" +WEB_SITE="http://www.broadcom.com/support/802.11/linux_sta.php" +TARBALL="hybrid-portsrc_x86_64-v${VERSION}.tar.gz" +WGET_URL="http://www.broadcom.com/docs/linux_sta/$TARBALL" +TAGS="wireless wifi driver" +PROVIDE="broadcom-wl:linux64" + +DEPENDS="linux" +BUILD_DEPENDS="linux64-module-headers xz uclibc-cross-compiler-x86_64" + +AUFS_NOT_RAMFS="uclibc-cross-compiler-x86_64 is not compatible with aufs+tmpfs 8(" + +# Rules to configure and make the package. +compile_rules() +{ + sed -i 's|ndo_set_multicast_list|ndo_set_rx_mode|' src/wl/sys/wl_linux.c + sed -i 's|linux/autoconf.h|generated/autoconf.h|' src/include/linuxver.h + for i in semaphore 3.4.0 3.6.0 3.8.0 3.9.0 3.14.0 ; do + echo "patch $i ..." + patch -Np2 -i $stuff/$i.patch + done + KBUILD_NOPEDANTIC=1 make -C /usr/src/linux M=`pwd` + xz wl.ko +} + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + EXTRAVERSION=_${kvers} + mkdir -p $fs/lib/modules/${kvers}-slitaz64/kernel/drivers/net/wireless + # Compress and install module + install -o root -m 0644 $src/wl.ko.xz \ + $fs/lib/modules/${kvers}-slitaz64/kernel/drivers/net/wireless/wl.ko.xz +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a ${EXTRAVERSION#_}-slitaz64 +} + +post_remove() +{ + chroot "$1/" depmod -a ${EXTRAVERSION#_}-slitaz64 +} diff -r 34360d1221d9 -r cda065bfc449 broadcom-wl64/stuff/3.14.0.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/broadcom-wl64/stuff/3.14.0.patch Mon Jun 25 12:10:04 2018 +0200 @@ -0,0 +1,103 @@ +--- a/amd64/src/wl/sys/wl_linux.c ++++ a/amd64/src/wl/sys/wl_linux.c +@@ -1192,7 +1192,11 @@ + #else + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)) + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)) + dev = alloc_netdev(sizeof(wl_if_t), name, ether_setup); ++#else ++ dev = alloc_netdev(sizeof(wl_if_t), name, NET_NAME_UNKNOWN, ether_setup); ++#endif + wlif = netdev_priv(dev); + if (!dev) { + #else +@@ -3180,6 +3184,7 @@ + { + char tmp[32]; + sprintf(tmp, "%s%d", HYBRID_PROC, wl->pub->unit); ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0) + if ((wl->proc_entry = create_proc_entry(tmp, 0644, NULL)) == NULL) { + WL_ERROR(("%s: create_proc_entry %s failed\n", __FUNCTION__, tmp)); + ASSERT(0); +@@ -3188,5 +3193,17 @@ + wl->proc_entry->read_proc = wl_proc_read; + wl->proc_entry->write_proc = wl_proc_write; + wl->proc_entry->data = wl; ++#else ++ static const struct file_operations wl_proc_fops = { ++ .owner = THIS_MODULE, ++ .read = wl_proc_read, ++ .write = wl_proc_write, ++ }; ++ if ((wl->proc_entry = proc_create(tmp, 0644, NULL,&wl_proc_fops)) == NULL) { ++ WL_ERROR(("%s: create_proc_entry %s failed\n", __FUNCTION__, tmp)); ++ ASSERT(0); ++ return -1; ++ } ++#endif + return 0; + } +--- a/amd64/src/wl/sys/wl_cfg80211.c ++++ a/amd64/src/wl/sys/wl_cfg80211.c +@@ -1838,8 +1838,13 @@ + mgmt->u.beacon.capab_info, &bi->BSSID)); + + signal = notif_bss_info->rssi * 100; ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) + if (!cfg80211_inform_bss_frame(wiphy, channel, mgmt, + le16_to_cpu(notif_bss_info->frame_len), signal, GFP_KERNEL)) { ++#else ++ if (!cfg80211_inform_bss_frame(wiphy, channel, CFG80211_BSS_FTYPE_UNKNOWN, mgmt, ++ le16_to_cpu(notif_bss_info->frame_len), signal, GFP_KERNEL)) { ++#endif + WL_ERR(("cfg80211_inform_bss_frame error\n")); + kfree(notif_bss_info); + return -EINVAL; +@@ -1857,6 +1862,12 @@ + u32 event = EVENT_TYPE(e); + u16 flags = EVENT_FLAGS(e); + u32 status = EVENT_STATUS(e); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0) ++ struct ieee80211_channel *channel = NULL; ++ struct wiphy *wiphy; ++ u32 chanspec, chan; ++ u32 freq, band; ++#endif + + WL_DBG(("\n")); + +@@ -1868,7 +1879,11 @@ + } + else if ((event == WLC_E_LINK && ~(flags & WLC_EVENT_MSG_LINK)) || + event == WLC_E_DEAUTH_IND || event == WLC_E_DISASSOC_IND) { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0) + cfg80211_disconnected(ndev, 0, NULL, 0, GFP_KERNEL); ++#else ++ cfg80211_disconnected(ndev, 0, NULL, 0, false, GFP_KERNEL); ++#endif + clear_bit(WL_STATUS_CONNECTED, &wl->status); + wl_link_down(wl); + wl_init_prof(wl->profile); +@@ -1892,7 +1907,21 @@ + wl_get_assoc_ies(wl); + memcpy(&wl->bssid, &e->addr, ETHER_ADDR_LEN); + wl_update_bss_info(wl); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0) ++ wiphy = wl_to_wiphy(wl); ++ err = wl_dev_intvar_get(ndev, "chanspec", &chanspec); ++ if (err) { ++ WL_ERR(("Could not get chanspec, err %d\n", err)); ++ return err; ++ } ++ chan = wf_chspec_ctlchan(chanspec); ++ band = (chan <= CH_MAX_2G_CHANNEL) ? IEEE80211_BAND_2GHZ : IEEE80211_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); ++#else + cfg80211_ibss_joined(ndev, (u8 *)&wl->bssid, GFP_KERNEL); ++#endif + set_bit(WL_STATUS_CONNECTED, &wl->status); + wl->profile->active = true; + } diff -r 34360d1221d9 -r cda065bfc449 broadcom-wl64/stuff/3.4.0.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/broadcom-wl64/stuff/3.4.0.patch Mon Jun 25 12:10:04 2018 +0200 @@ -0,0 +1,17 @@ +Description: Enable compilation with 3.4 kernels +Author: Eugene San (eugenesan) +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/bcmwl/+bug/994255 +Last-Update: 2012-05-07 + +--- a/amd64/src/wl/sys/wl_linux.c ++++ b/amd64/src/wl/sys/wl_linux.c +@@ -40,7 +40,9 @@ + #include + #define WLC_MAXBSSCFG 1 + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0) + #include ++#endif + #include + #include + #include diff -r 34360d1221d9 -r cda065bfc449 broadcom-wl64/stuff/3.6.0.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/broadcom-wl64/stuff/3.6.0.patch Mon Jun 25 12:10:04 2018 +0200 @@ -0,0 +1,39 @@ +Description: Fix kernel oops with 3.6 and newer kernels +Author: Cyril Lacoux +Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=698216 +Last-Update: 2013-24-01 + +--- a/amd64/src/wl/sys/wl_cfg80211.c ++++ b/amd64/src/wl/sys/wl_cfg80211.c +@@ -42,8 +42,12 @@ + enum nl80211_iftype type, u32 *flags, struct vif_params *params); + static s32 __wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev, + struct cfg80211_scan_request *request, struct cfg80211_ssid *this_ssid); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) ++static s32 wl_cfg80211_scan(struct wiphy *wiphy, struct cfg80211_scan_request *request); ++#else + static s32 wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev, + struct cfg80211_scan_request *request); ++#endif + static s32 wl_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed); + static s32 wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev, + struct cfg80211_ibss_params *params); +@@ -570,10 +574,18 @@ + } + + static s32 ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) ++wl_cfg80211_scan(struct wiphy *wiphy, struct cfg80211_scan_request *request) ++#else + wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev, + struct cfg80211_scan_request *request) ++#endif + { + s32 err = 0; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) ++ struct wl_priv *wl = wiphy_to_wl(wiphy); ++ struct net_device *ndev = wl_to_ndev(wl); ++#endif + + CHECK_SYS_UP(); + err = __wl_cfg80211_scan(wiphy, ndev, request, NULL); diff -r 34360d1221d9 -r cda065bfc449 broadcom-wl64/stuff/3.8.0.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/broadcom-wl64/stuff/3.8.0.patch Mon Jun 25 12:10:04 2018 +0200 @@ -0,0 +1,75 @@ +Description: Kernel 3.8 compatibility +Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=702788 +Last-Update: 2013-03-08 + +--- a/amd64/src/include/bcmutils.h ++++ b/amd64/src/include/bcmutils.h +@@ -555,7 +555,11 @@ + extern void prhex(const char *msg, uchar *buf, uint len); + + extern bcm_tlv_t *BCMROMFN(bcm_next_tlv)(bcm_tlv_t *elt, int *buflen); ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0) + extern bcm_tlv_t *BCMROMFN(bcm_parse_tlvs)(void *buf, int buflen, uint key); ++#else ++extern bcm_tlv_t *BCMROMFN(bcm_parse_tlvs)(const void *buf, int buflen, uint key); ++#endif + extern bcm_tlv_t *BCMROMFN(bcm_parse_ordered_tlvs)(void *buf, int buflen, uint key); + + extern const char *bcmerrorstr(int bcmerror); +--- a/amd64/src/wl/sys/wl_cfg80211.c ++++ b/amd64/src/wl/sys/wl_cfg80211.c +@@ -754,7 +754,11 @@ + else + memset(&join_params.params.bssid, 0, ETHER_ADDR_LEN); + +- wl_ch_to_chanspec(params->channel, &join_params, &join_params_size); ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0) ++ wl_ch_to_chanspec(params->channel, &join_params, &join_params_size); ++#else ++ wl_ch_to_chanspec(params->chandef.chan, &join_params, &join_params_size); ++#endif + + err = wl_dev_ioctl(dev, WLC_SET_SSID, &join_params, join_params_size); + if (err) { +@@ -2054,9 +2058,14 @@ + struct bcm_tlv *tim; + u16 beacon_interval; + s32 dtim_period; +- size_t ie_len; +- u8 *ie; + s32 err = 0; ++ size_t ie_len; ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0) ++ u8 *ie; ++#else ++ const u8 *ie; ++ const struct cfg80211_bss_ies *ies; ++#endif + + ssid = &wl->profile->ssid; + bss = cfg80211_get_bss(wl_to_wiphy(wl), NULL, (s8 *)&wl->bssid, +@@ -2086,8 +2095,22 @@ + beacon_interval = cpu_to_le16(bi->beacon_period); + } else { + WL_DBG(("Found the AP in the list - BSSID %pM\n", bss->bssid)); +- ie = bss->information_elements; +- ie_len = bss->len_information_elements; ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0) ++ ie = bss->information_elements; ++ ie_len = bss->len_information_elements; ++#else ++ rcu_read_lock(); ++ ies = (const struct cfg80211_bss_ies*)rcu_dereference(bss->ies); ++ if (!ies) { ++ /* This should never happen */ ++ rcu_read_unlock(); ++ err = -EIO; ++ goto update_bss_info_out; ++ } ++ ie = ies->data; ++ ie_len = (size_t)(ies->len); ++ rcu_read_unlock(); ++#endif + beacon_interval = bss->beacon_interval; + cfg80211_put_bss(bss); + } diff -r 34360d1221d9 -r cda065bfc449 broadcom-wl64/stuff/3.9.0.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/broadcom-wl64/stuff/3.9.0.patch Mon Jun 25 12:10:04 2018 +0200 @@ -0,0 +1,17 @@ +Description: Kernel 3.9 compatibility +Last-Update: 2013-05-07 + +--- a/amd64/src/wl/sys/wl_cfg80211.c ++++ b/amd64/src/wl/sys/wl_cfg80211.c +@@ -2112,7 +2112,11 @@ + rcu_read_unlock(); + #endif + beacon_interval = bss->beacon_interval; ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0) + cfg80211_put_bss(bss); ++#else ++ cfg80211_put_bss(wl_to_wiphy(wl), bss); ++#endif + } + + tim = bcm_parse_tlvs(ie, ie_len, WLAN_EID_TIM); diff -r 34360d1221d9 -r cda065bfc449 broadcom-wl64/stuff/semaphore.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/broadcom-wl64/stuff/semaphore.patch Mon Jun 25 12:10:04 2018 +0200 @@ -0,0 +1,11 @@ +diff -aur bla/src/wl/sys/wl_iw.h bla.new/src/wl/sys/wl_iw.h +--- a/amd64/src/wl/sys/wl_iw.h 2010-02-06 02:59:15.000000000 +0100 ++++ b/amd64/src/wl/sys/wl_iw.h 2010-08-07 23:17:35.368641722 +0200 +@@ -15,6 +15,7 @@ + #ifndef _wl_iw_h_ + #define _wl_iw_h_ + ++#include + #include + + #include