diff --git a/srcpkgs/broadcom-wl-dkms b/srcpkgs/broadcom-wl-dkms new file mode 120000 index 00000000000..bdb57e70ea3 --- /dev/null +++ b/srcpkgs/broadcom-wl-dkms @@ -0,0 +1 @@ +broadcom-wl \ No newline at end of file diff --git a/srcpkgs/broadcom-wl/broadcom-dkms.INSTALL b/srcpkgs/broadcom-wl/broadcom-dkms.INSTALL new file mode 100644 index 00000000000..51795d79e05 --- /dev/null +++ b/srcpkgs/broadcom-wl/broadcom-dkms.INSTALL @@ -0,0 +1,7 @@ +# Regenerate initramfs. +case ${ACTION} in +post) + echo "Regenerating initramfs, please wait..." + dracut -f -q + ;; +esac diff --git a/srcpkgs/broadcom-wl/broadcom-dkms.REMOVE b/srcpkgs/broadcom-wl/broadcom-dkms.REMOVE new file mode 100644 index 00000000000..c975fe02286 --- /dev/null +++ b/srcpkgs/broadcom-wl/broadcom-dkms.REMOVE @@ -0,0 +1,7 @@ +# Regenerate initramfs. +case ${ACTION} in +purge) + echo "Regenerating initramfs, please wait..." + dracut -f -q + ;; +esac diff --git a/srcpkgs/broadcom-wl/files/dkms.conf b/srcpkgs/broadcom-wl/files/dkms.conf new file mode 100644 index 00000000000..a6219f4c89b --- /dev/null +++ b/srcpkgs/broadcom-wl/files/dkms.conf @@ -0,0 +1,6 @@ +PACKAGE_NAME="broadcom-wl" +PACKAGE_VERSION="@VERSION@" +BUILT_MODULE_NAME[0]="wl" +DEST_MODULE_LOCATION[0]="/kernel/drivers/net/wireless" +AUTOINSTALL="yes" +REMAKE_INITRD="yes" diff --git a/srcpkgs/broadcom-wl/patches/linux-recent.patch b/srcpkgs/broadcom-wl/patches/linux-recent.patch new file mode 100644 index 00000000000..380abf913db --- /dev/null +++ b/srcpkgs/broadcom-wl/patches/linux-recent.patch @@ -0,0 +1,143 @@ +diff -Naur a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c +--- src/wl/sys/wl_linux.c 2013-08-01 06:52:22.000000000 +0000 ++++ src/wl/sys/wl_linux.c 2014-01-03 17:24:56.196678108 +0000 +@@ -3236,7 +3236,12 @@ + wl_tkip_printstats(wl_info_t *wl, bool group_key) + { + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) ++ struct seq_file sfile; ++ struct seq_file *debug_buf = &sfile; ++#else + char debug_buf[512]; ++#endif + int idx; + if (wl->tkipmodops) { + if (group_key) { +@@ -3249,7 +3254,11 @@ + wl->tkipmodops->print_stats(debug_buf, wl->tkip_ucast_data); + else + return; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) ++ printk("%s: TKIP stats from module: %s\n", debug_buf->buf, group_key?"Bcast":"Ucast"); ++#else + printk("%s: TKIP stats from module: %s\n", debug_buf, group_key?"Bcast":"Ucast"); ++#endif + } + #endif + } +@@ -3408,11 +3417,19 @@ + return 0; + } + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0) + static int + wl_proc_read(char *buffer, char **start, off_t offset, int length, int *eof, void *data) + { + wl_info_t * wl = (wl_info_t *)data; ++#else ++static int ++wl_proc_read(struct seq_file *seq, void *offset) ++{ ++ wl_info_t * wl = (wl_info_t *)seq->private; ++#endif + int bcmerror, to_user; ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0) + int len; + + if (offset > 0) { +@@ -3424,17 +3441,33 @@ + WL_ERROR(("%s: Not enough return buf space\n", __FUNCTION__)); + return 0; + } ++#endif + WL_LOCK(wl); + bcmerror = wlc_ioctl(wl->wlc, WLC_GET_MONITOR, &to_user, sizeof(int), NULL); ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0) + len = sprintf(buffer, "%d\n", to_user); ++#endif + WL_UNLOCK(wl); ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0) + return len; ++#else ++ seq_printf(seq, "%d\n", to_user); ++ return bcmerror; ++#endif + } + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0) + static int + wl_proc_write(struct file *filp, const char *buff, unsigned long length, void *data) + { + wl_info_t * wl = (wl_info_t *)data; ++#else ++static ssize_t ++wl_proc_write(struct file *filp, const char __user *buff, size_t length, loff_t *ppos) ++{ ++ struct seq_file *seq = filp->private_data; ++ wl_info_t * wl = (wl_info_t *)seq->private; ++#endif + int from_user = 0; + int bcmerror; + +@@ -3445,7 +3478,11 @@ + } + if (copy_from_user(&from_user, buff, 1)) { + WL_ERROR(("%s: copy from user failed\n", __FUNCTION__)); ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0) + return -EIO; ++#else ++ return -EFAULT; ++#endif + } + + if (from_user >= 0x30) +@@ -3459,22 +3496,48 @@ + WL_ERROR(("%s: SET_MONITOR failed with %d\n", __FUNCTION__, bcmerror)); + return -EIO; + } ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) ++ *ppos += length; ++#endif + return length; + } + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) ++static int wl_proc_open(struct inode *inode, struct file *file) ++{ ++ return single_open(file, wl_proc_read, PDE_DATA(inode)); ++} ++ ++static const struct file_operations wl_fops = { ++ .owner = THIS_MODULE, ++ .open = wl_proc_open, ++ .read = seq_read, ++ .write = wl_proc_write, ++ .llseek = seq_lseek, ++ .release = single_release, ++}; ++#endif ++ + static int + wl_reg_proc_entry(wl_info_t *wl) + { + 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)); ++#else ++ if ((wl->proc_entry = proc_create_data(tmp, 0644, NULL, &wl_fops, wl)) == NULL) { ++ WL_ERROR(("%s: proc_create_data %s failed\n", __FUNCTION__, tmp)); ++#endif + ASSERT(0); + return -1; + } ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0) + wl->proc_entry->read_proc = wl_proc_read; + wl->proc_entry->write_proc = wl_proc_write; + wl->proc_entry->data = wl; ++#endif + return 0; + } + #ifdef WLOFFLD diff --git a/srcpkgs/broadcom-wl/template b/srcpkgs/broadcom-wl/template new file mode 100644 index 00000000000..a77dd623b52 --- /dev/null +++ b/srcpkgs/broadcom-wl/template @@ -0,0 +1,67 @@ +# Template file for 'broadcom-wl' + +pkgname=broadcom-wl +version=6.30.223.141 +revision=1 +maintainer="ojab " +license="Proprietary Broadcom license" +homepage="http://broadcom.com" + +only_for_archs="i686 x86_64" +nonfree=yes +create_wrksrc=yes + +short_desc="Broadcom proprietary wireless drivers for Linux" +depends="broadcom-wl-dkms-${version}_${revision}" + +if [ "$XBPS_TARGET_MACHINE" = "i686" ]; then + distfiles="http://www.broadcom.com/docs/linux_sta/hybrid-v35-nodebug-pcoem-${version//./_}.tar.gz" + checksum=d57c33f6bf4ebe68cac67ffe39c2260b8990bb0f07413dfd021dd4db845199a7 +else + distfiles="http://www.broadcom.com/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-${version//./_}.tar.gz" + checksum=5f37b2b879e29b220dc64ce2e93d922dc231d4241da03bcbab15ced10e649b4a +fi + +do_install() { + # dkms pkg + vmkdir usr/src/wl-${version}/src + vcopy "src/*" usr/src/wl-${version}/src + vmkdir usr/src/wl-${version}/lib + vcopy "lib/*" usr/src/wl-${version}/lib + vcopy "Makefile" usr/src/wl-${version} + + vinstall ${FILESDIR}/dkms.conf 644 usr/src/wl-${version} + sed -i -e "s/@VERSION@/${version}-${revision}/" ${PKGDESTDIR}/usr/src/wl-${version}/dkms.conf + + # systemd modules-load.d(5) file. + vmkdir usr/lib/modules-load.d + echo "wl" > ${DESTDIR}/usr/lib/modules-load.d/wl.conf + chmod 644 ${DESTDIR}/usr/lib/modules-load.d/wl.conf + + # Blacklist OSS broadcom modules. + vmkdir usr/lib/modprobe.d + echo "blacklist b43" > ${DESTDIR}/usr/lib/modprobe.d/wl.conf + echo "blacklist b43legacy" >> ${DESTDIR}/usr/lib/modprobe.d/wl.conf + echo "blacklist ssb" >> ${DESTDIR}/usr/lib/modprobe.d/wl.conf + echo "blacklist bcm43xx" >> ${DESTDIR}/usr/lib/modprobe.d/wl.conf + echo "blacklist brcm80211" >> ${DESTDIR}/usr/lib/modprobe.d/wl.conf + echo "blacklist brcmfmac" >> ${DESTDIR}/usr/lib/modprobe.d/wl.conf + echo "blacklist brcmsmac" >> ${DESTDIR}/usr/lib/modprobe.d/wl.conf + echo "blacklist bcma" >> ${DESTDIR}/usr/lib/modprobe.d/wl.conf + + chmod 644 ${DESTDIR}/usr/lib/modprobe.d/wl.conf + +} + +broadcom-wl-dkms_package() { + short_desc="Broadcom proprietary wireless drivers for Linux - DKMS kernel module" + triggers="dkms" + dkms_modules="wl ${version}" + depends="dkms" + nonfree=yes + pkg_install() { + vmove usr/src + vmove usr/lib/modules-load.d + vmove usr/lib/modprobe.d + } +}