]> git.pld-linux.org Git - packages/wl.git/blame - broadcom-sta-6.30.223.141-kernel-3.10.patch
add dkms support
[packages/wl.git] / broadcom-sta-6.30.223.141-kernel-3.10.patch
CommitLineData
283219f0
ER
1diff -Naur bcmwl-6.30.223.30+bdcom.orig/src/src/wl/sys/wl_linux.c bcmwl-6.30.223.30+bdcom/src/src/wl/sys/wl_linux.c
2--- bcmwl-6.30.223.30+bdcom.orig/src/src/wl/sys/wl_linux.c 2013-04-23 12:31:31.011588881 +0200
3+++ bcmwl-6.30.223.30+bdcom/src/src/wl/sys/wl_linux.c 2013-05-20 18:27:18.830187333 +0200
4@@ -3229,7 +3229,12 @@
5 wl_tkip_printstats(wl_info_t *wl, bool group_key)
6 {
7 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14)
8+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
9+ struct seq_file sfile;
10+ struct seq_file *debug_buf = &sfile;
11+#else
12 char debug_buf[512];
13+#endif
14 int idx;
15 if (wl->tkipmodops) {
16 if (group_key) {
17@@ -3242,7 +3247,11 @@
18 wl->tkipmodops->print_stats(debug_buf, wl->tkip_ucast_data);
19 else
20 return;
21+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
22+ printk("%s: TKIP stats from module: %s\n", debug_buf->buf, group_key?"Bcast":"Ucast");
23+#else
24 printk("%s: TKIP stats from module: %s\n", debug_buf, group_key?"Bcast":"Ucast");
25+#endif
26 }
27 #endif
28 }
29@@ -3401,17 +3410,24 @@
30 return 0;
31 }
32
33+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
34 static int
35 wl_proc_read(char *buffer, char **start, off_t offset, int length, int *eof, void *data)
36+#else
37+static ssize_t
38+wl_proc_read (struct file *filp, char __user *buffer, size_t length, loff_t *data)
39+#endif
40 {
41 wl_info_t * wl = (wl_info_t *)data;
42 int bcmerror, to_user;
43 int len;
44
45+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
46 if (offset > 0) {
47 *eof = 1;
48 return 0;
49 }
50+#endif
51
52 if (!length) {
53 WL_ERROR(("%s: Not enough return buf space\n", __FUNCTION__));
54@@ -3424,8 +3440,13 @@
55 return len;
56 }
57
58+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
59 static int
60 wl_proc_write(struct file *filp, const char *buff, unsigned long length, void *data)
61+#else
62+static ssize_t
63+wl_proc_write (struct file *filp, const char __user *buff, size_t length, loff_t *data)
64+#endif
65 {
66 wl_info_t * wl = (wl_info_t *)data;
67 int from_user = 0;
68@@ -3455,19 +3476,34 @@
69 return length;
70 }
71
72+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
73+static const struct file_operations wl_fops = {
74+ .owner = THIS_MODULE,
75+ .read = wl_proc_read,
76+ .write = wl_proc_write,
77+};
78+#endif
79+
80 static int
81 wl_reg_proc_entry(wl_info_t *wl)
82 {
83 char tmp[32];
84 sprintf(tmp, "%s%d", HYBRID_PROC, wl->pub->unit);
85+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
86 if ((wl->proc_entry = create_proc_entry(tmp, 0644, NULL)) == NULL) {
87 WL_ERROR(("%s: create_proc_entry %s failed\n", __FUNCTION__, tmp));
88+#else
89+ if ((wl->proc_entry = proc_create(tmp, 0644, NULL, &wl_fops)) == NULL) {
90+ WL_ERROR(("%s: proc_create %s failed\n", __FUNCTION__, tmp));
91+#endif
92 ASSERT(0);
93 return -1;
94 }
95+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
96 wl->proc_entry->read_proc = wl_proc_read;
97 wl->proc_entry->write_proc = wl_proc_write;
98 wl->proc_entry->data = wl;
99+#endif
100 return 0;
101 }
102 #ifdef WLOFFLD
This page took 0.031879 seconds and 4 git commands to generate.