summary refs log tree commit diff
path: root/pkgs/os-specific/linux/broadcom-sta
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2014-10-13 13:37:56 -0400
committerShea Levy <shea@shealevy.com>2014-10-13 13:37:56 -0400
commit1a7c1615bf580c247f1ae1202d0705187e6d18bb (patch)
treed4cce9d23342c9fc8e205619191f57a6e7231277 /pkgs/os-specific/linux/broadcom-sta
parentf0ef22b1b7ddc0081ed13ecc42b88f89911a9483 (diff)
downloadnixpkgs-1a7c1615bf580c247f1ae1202d0705187e6d18bb.tar
nixpkgs-1a7c1615bf580c247f1ae1202d0705187e6d18bb.tar.gz
nixpkgs-1a7c1615bf580c247f1ae1202d0705187e6d18bb.tar.bz2
nixpkgs-1a7c1615bf580c247f1ae1202d0705187e6d18bb.tar.lz
nixpkgs-1a7c1615bf580c247f1ae1202d0705187e6d18bb.tar.xz
nixpkgs-1a7c1615bf580c247f1ae1202d0705187e6d18bb.tar.zst
nixpkgs-1a7c1615bf580c247f1ae1202d0705187e6d18bb.zip
Update broadcom-sta and fix for new kernels
Diffstat (limited to 'pkgs/os-specific/linux/broadcom-sta')
-rw-r--r--pkgs/os-specific/linux/broadcom-sta/default.nix12
-rw-r--r--pkgs/os-specific/linux/broadcom-sta/linux-recent.patch126
-rw-r--r--pkgs/os-specific/linux/broadcom-sta/netdev-3.17.patch15
3 files changed, 21 insertions, 132 deletions
diff --git a/pkgs/os-specific/linux/broadcom-sta/default.nix b/pkgs/os-specific/linux/broadcom-sta/default.nix
index 1ed13c2e450..1f0674c9bca 100644
--- a/pkgs/os-specific/linux/broadcom-sta/default.nix
+++ b/pkgs/os-specific/linux/broadcom-sta/default.nix
@@ -1,25 +1,25 @@
 { stdenv, fetchurl, kernel }:
 let
-  version = "6_30_223_141";
+  version = "6.30.223.248";
 in
 stdenv.mkDerivation {
   name = "broadcom-sta-${version}-${kernel.version}";
 
   src = if stdenv.system == "i686-linux" then (
     fetchurl {
-      url = "http://www.broadcom.com/docs/linux_sta/hybrid-v35-nodebug-pcoem-${version}.tar.gz";
-      sha256 = "19wra62dpm0x0byksh871yxr128b4v13kzkzqv56igjfpzv36z6m";
+      url = http://www.broadcom.com/docs/linux_sta/hybrid-v35-nodebug-pcoem-6_30_223_248.tar.gz;
+      sha256 = "1bd13pq5hj4yzp32rx71sg1i5wkzdsg1s32xsywb48lw88x595mi";
     } ) else (
     fetchurl {
-      url = "http://www.broadcom.com/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-${version}.tar.gz";
-      sha256 = "0jlvch7d3khmmg5kp80x4ka33hidj8yykqjcqq6j56z2g6wb4dsz";
+      url = http://www.broadcom.com/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-6_30_223_248.tar.gz;
+      sha256 = "08ihbhwnqpnazskw9rlrk0alanp4x70kl8bsy2vg962iq334r69x";
     }
   );
 
   patches = [
-    ./linux-recent.patch
     ./license.patch
     ./cfg80211_ibss_joined-channel-parameter.patch
+    ./netdev-3.17.patch
   ];
 
   makeFlags = "KBASE=${kernel.dev}/lib/modules/${kernel.modDirVersion}";
diff --git a/pkgs/os-specific/linux/broadcom-sta/linux-recent.patch b/pkgs/os-specific/linux/broadcom-sta/linux-recent.patch
deleted file mode 100644
index 97a331a2bd7..00000000000
--- a/pkgs/os-specific/linux/broadcom-sta/linux-recent.patch
+++ /dev/null
@@ -1,126 +0,0 @@
---- a/src/wl/sys/wl_linux.c	2013-08-01 08:52:22.000000000 +0200
-+++ b/src/wl/sys/wl_linux.c	2013-09-13 14:25:36.463020788 +0200
-@@ -910,7 +910,11 @@
- 	pci_set_drvdata(pdev, NULL);
- }
- 
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0)
- static struct pci_driver wl_pci_driver = {
-+#else
-+static struct pci_driver wl_pci_driver __refdata = {
-+#endif
- 	name:		"wl",
- 	probe:		wl_pci_probe,
- 	suspend:	wl_suspend,
-@@ -3235,7 +3239,7 @@
- void
- 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(2, 6, 14) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
- 	char debug_buf[512];
- 	int idx;
- 	if (wl->tkipmodops) {
-@@ -3408,6 +3412,7 @@
- 	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)
- {
-@@ -3462,19 +3467,90 @@
- 	return length;
- }
- 
-+#else
-+
-+static int
-+wl_proc_read(struct seq_file *seq, void *offset)
-+{
-+	wl_info_t * wl = (wl_info_t *)seq->private;
-+	int bcmerror, to_user;
-+
-+	WL_LOCK(wl);
-+	bcmerror = wlc_ioctl(wl->wlc, WLC_GET_MONITOR, &to_user, sizeof(int), NULL);
-+	WL_UNLOCK(wl);
-+
-+	seq_printf(seq, "%d\n", to_user);
-+	return bcmerror;
-+}
-+
-+static ssize_t wl_proc_write(struct file *file, const char __user *buff,
-+			     size_t length, loff_t *ppos)
-+{
-+	struct seq_file *seq = file->private_data;
-+	wl_info_t * wl = (wl_info_t *)seq->private;
-+	int bcmerror, from_user = 0;
-+
-+	if (length != 1) {
-+		WL_ERROR(("%s: Invalid data length\n", __FUNCTION__));
-+		return -EIO;
-+	}
-+
-+	if (copy_from_user(&from_user, buff, 1)) {
-+		WL_ERROR(("%s: copy from user failed\n", __FUNCTION__));
-+		return -EFAULT;
-+	}
-+
-+	if (from_user >= 0x30)
-+		from_user -= 0x30;
-+
-+	WL_LOCK(wl);
-+	bcmerror = wlc_ioctl(wl->wlc, WLC_SET_MONITOR, &from_user, sizeof(int), NULL);
-+	WL_UNLOCK(wl);
-+
-+	if (bcmerror < 0) {
-+		WL_ERROR(("%s: SET_MONITOR failed with %d\n", __FUNCTION__, bcmerror));
-+		return -EIO;
-+	}
-+	*ppos += length;
-+	return length;
-+}
-+
-+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_proc_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 ((wl->proc_entry = create_proc_entry(tmp, 0644, NULL)) == NULL) {
-+
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
-+	wl->proc_entry = create_proc_entry(tmp, 0644, NULL);
-+	if (wl->proc_entry) {
-+		wl->proc_entry->read_proc = wl_proc_read;
-+		wl->proc_entry->write_proc = wl_proc_write;
-+		wl->proc_entry->data = wl;
-+	} 
-+#else
-+	wl->proc_entry = proc_create_data(tmp, 0644, NULL, &wl_proc_fops, wl);
-+#endif
-+	if (!wl->proc_entry) {
- 		WL_ERROR(("%s: create_proc_entry %s failed\n", __FUNCTION__, tmp));
- 		ASSERT(0);
- 		return -1;
- 	}
--	wl->proc_entry->read_proc = wl_proc_read;
--	wl->proc_entry->write_proc = wl_proc_write;
--	wl->proc_entry->data = wl;
- 	return 0;
- }
- #ifdef WLOFFLD
diff --git a/pkgs/os-specific/linux/broadcom-sta/netdev-3.17.patch b/pkgs/os-specific/linux/broadcom-sta/netdev-3.17.patch
new file mode 100644
index 00000000000..5a33cef7370
--- /dev/null
+++ b/pkgs/os-specific/linux/broadcom-sta/netdev-3.17.patch
@@ -0,0 +1,15 @@
+diff -Naur a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c
+--- a/src/wl/sys/wl_linux.c	2014-06-26 06:42:08.000000000 -0400
++++ b/src/wl/sys/wl_linux.c	2014-10-13 12:00:04.446122588 -0400
+@@ -1307,7 +1307,11 @@
+ 	dev->priv = priv_link;
+ #else
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0)
++	dev = alloc_netdev(sizeof(priv_link_t), intf_name, NET_NAME_UNKNOWN, ether_setup);
++#else
+ 	dev = alloc_netdev(sizeof(priv_link_t), intf_name, ether_setup);
++#endif
+ 	if (!dev) {
+ 		WL_ERROR(("wl%d: %s: alloc_netdev failed\n",
+ 			(wl->pub)?wl->pub->unit:wlif->subunit, __FUNCTION__));