git.iko.soy/typeable/nixpkgs
on master help sign in
Update broadcom-sta and fix for new kernels
commit1a7c1615bf580c247f1ae1202d0705187e6d18bb authorShea Levy <shea@shealevy.com> dateMon 13 Oct 2014, 13:37 (12 years ago) parentf0ef22b
3 files changed+21−132
pkgs/os-specific/linux/broadcom-sta/default.nix+6−6 pkgs/os-specific/linux/broadcom-sta/linux-recent.patch−126 pkgs/os-specific/linux/broadcom-sta/netdev-3.17.patch+15
pkgs/os-specific/linux/broadcom-sta/default.nix+6−6
@@ -1,25 +1,25 @@
11{ stdenv, fetchurl, kernel }:
22let
3− version = "6_30_223_141";
3+ version = "6.30.223.248";
44in
55stdenv.mkDerivation {
66 name = "broadcom-sta-${version}-${kernel.version}";
77
88 src = if stdenv.system == "i686-linux" then (
99 fetchurl {
10− url = "http://www.broadcom.com/docs/linux_sta/hybrid-v35-nodebug-pcoem-${version}.tar.gz";
11− sha256 = "19wra62dpm0x0byksh871yxr128b4v13kzkzqv56igjfpzv36z6m";
10+ url = http://www.broadcom.com/docs/linux_sta/hybrid-v35-nodebug-pcoem-6_30_223_248.tar.gz;
11+ sha256 = "1bd13pq5hj4yzp32rx71sg1i5wkzdsg1s32xsywb48lw88x595mi";
1212 } ) else (
1313 fetchurl {
14− url = "http://www.broadcom.com/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-${version}.tar.gz";
15− sha256 = "0jlvch7d3khmmg5kp80x4ka33hidj8yykqjcqq6j56z2g6wb4dsz";
14+ url = http://www.broadcom.com/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-6_30_223_248.tar.gz;
15+ sha256 = "08ihbhwnqpnazskw9rlrk0alanp4x70kl8bsy2vg962iq334r69x";
1616 }
1717 );
1818
1919 patches = [
20− ./linux-recent.patch
2120 ./license.patch
2221 ./cfg80211_ibss_joined-channel-parameter.patch
22+ ./netdev-3.17.patch
2323 ];
2424
2525 makeFlags = "KBASE=${kernel.dev}/lib/modules/${kernel.modDirVersion}";
pkgs/os-specific/linux/broadcom-sta/linux-recent.patchdeleted−126
@@ -1,126 +0,0 @@
1−--- a/src/wl/sys/wl_linux.c 2013-08-01 08:52:22.000000000 +0200
2−+++ b/src/wl/sys/wl_linux.c 2013-09-13 14:25:36.463020788 +0200
3−@@ -910,7 +910,11 @@
4− pci_set_drvdata(pdev, NULL);
5− }
6−
7−+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0)
8− static struct pci_driver wl_pci_driver = {
9−+#else
10−+static struct pci_driver wl_pci_driver __refdata = {
11−+#endif
12− name: "wl",
13− probe: wl_pci_probe,
14− suspend: wl_suspend,
15−@@ -3235,7 +3239,7 @@
16− void
17− wl_tkip_printstats(wl_info_t *wl, bool group_key)
18− {
19−-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14)
20−+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
21− char debug_buf[512];
22− int idx;
23− if (wl->tkipmodops) {
24−@@ -3408,6 +3412,7 @@
25− return 0;
26− }
27−
28−+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
29− static int
30− wl_proc_read(char *buffer, char **start, off_t offset, int length, int *eof, void *data)
31− {
32−@@ -3462,19 +3467,90 @@
33− return length;
34− }
35−
36−+#else
37−+
38−+static int
39−+wl_proc_read(struct seq_file *seq, void *offset)
40−+{
41−+ wl_info_t * wl = (wl_info_t *)seq->private;
42−+ int bcmerror, to_user;
43−+
44−+ WL_LOCK(wl);
45−+ bcmerror = wlc_ioctl(wl->wlc, WLC_GET_MONITOR, &to_user, sizeof(int), NULL);
46−+ WL_UNLOCK(wl);
47−+
48−+ seq_printf(seq, "%d\n", to_user);
49−+ return bcmerror;
50−+}
51−+
52−+static ssize_t wl_proc_write(struct file *file, const char __user *buff,
53−+ size_t length, loff_t *ppos)
54−+{
55−+ struct seq_file *seq = file->private_data;
56−+ wl_info_t * wl = (wl_info_t *)seq->private;
57−+ int bcmerror, from_user = 0;
58−+
59−+ if (length != 1) {
60−+ WL_ERROR(("%s: Invalid data length\n", __FUNCTION__));
61−+ return -EIO;
62−+ }
63−+
64−+ if (copy_from_user(&from_user, buff, 1)) {
65−+ WL_ERROR(("%s: copy from user failed\n", __FUNCTION__));
66−+ return -EFAULT;
67−+ }
68−+
69−+ if (from_user >= 0x30)
70−+ from_user -= 0x30;
71−+
72−+ WL_LOCK(wl);
73−+ bcmerror = wlc_ioctl(wl->wlc, WLC_SET_MONITOR, &from_user, sizeof(int), NULL);
74−+ WL_UNLOCK(wl);
75−+
76−+ if (bcmerror < 0) {
77−+ WL_ERROR(("%s: SET_MONITOR failed with %d\n", __FUNCTION__, bcmerror));
78−+ return -EIO;
79−+ }
80−+ *ppos += length;
81−+ return length;
82−+}
83−+
84−+static int wl_proc_open(struct inode *inode, struct file *file)
85−+{
86−+ return single_open(file, wl_proc_read, PDE_DATA(inode));
87−+}
88−+
89−+static const struct file_operations wl_proc_fops = {
90−+ .owner = THIS_MODULE,
91−+ .open = wl_proc_open,
92−+ .read = seq_read,
93−+ .write = wl_proc_write,
94−+ .llseek = seq_lseek,
95−+ .release = single_release,
96−+};
97−+#endif
98−+
99− static int
100− wl_reg_proc_entry(wl_info_t *wl)
101− {
102− char tmp[32];
103− sprintf(tmp, "%s%d", HYBRID_PROC, wl->pub->unit);
104−- if ((wl->proc_entry = create_proc_entry(tmp, 0644, NULL)) == NULL) {
105−+
106−+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
107−+ wl->proc_entry = create_proc_entry(tmp, 0644, NULL);
108−+ if (wl->proc_entry) {
109−+ wl->proc_entry->read_proc = wl_proc_read;
110−+ wl->proc_entry->write_proc = wl_proc_write;
111−+ wl->proc_entry->data = wl;
112−+ }
113−+#else
114−+ wl->proc_entry = proc_create_data(tmp, 0644, NULL, &wl_proc_fops, wl);
115−+#endif
116−+ if (!wl->proc_entry) {
117− WL_ERROR(("%s: create_proc_entry %s failed\n", __FUNCTION__, tmp));
118− ASSERT(0);
119− return -1;
120− }
121−- wl->proc_entry->read_proc = wl_proc_read;
122−- wl->proc_entry->write_proc = wl_proc_write;
123−- wl->proc_entry->data = wl;
124− return 0;
125− }
126− #ifdef WLOFFLD
pkgs/os-specific/linux/broadcom-sta/netdev-3.17.patchnew file+15
@@ -0,0 +1,15 @@
1+diff -Naur a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c
2+--- a/src/wl/sys/wl_linux.c 2014-06-26 06:42:08.000000000 -0400
3++++ b/src/wl/sys/wl_linux.c 2014-10-13 12:00:04.446122588 -0400
4+@@ -1307,7 +1307,11 @@
5+ dev->priv = priv_link;
6+ #else
7+
8++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0)
9++ dev = alloc_netdev(sizeof(priv_link_t), intf_name, NET_NAME_UNKNOWN, ether_setup);
10++#else
11+ dev = alloc_netdev(sizeof(priv_link_t), intf_name, ether_setup);
12++#endif
13+ if (!dev) {
14+ WL_ERROR(("wl%d: %s: alloc_netdev failed\n",
15+ (wl->pub)?wl->pub->unit:wlif->subunit, __FUNCTION__));