1
--- bcmwl-6.30.223.271+bdcom.orig/debian/patches/0009-add-support-for-linux-3.10.0.patch
2
+++ bcmwl-6.30.223.271+bdcom/debian/patches/0009-add-support-for-linux-3.10.0.patch
4
+From 53c81dd6a3ad5919aef8c25f0589d8a538ddb532 Mon Sep 17 00:00:00 2001
5
+From: Alberto Milone <alberto.milone@canonical.com>
6
+Date: Wed, 9 Oct 2013 12:46:52 +0200
7
+Subject: [PATCH 1/1] Add support for Linux 3.10
9
+Thanks to Maarten Lankhorst for the patch.
11
+ src/wl/sys/wl_linux.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++---
12
+ 1 file changed, 77 insertions(+), 5 deletions(-)
14
+diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c
15
+index 521f02e..3ead3c3 100644
16
+--- a/src/wl/sys/wl_linux.c
17
++++ b/src/wl/sys/wl_linux.c
18
+@@ -3235,7 +3235,7 @@ wl_tkip_keyset(wl_info_t *wl, wsec_key_t *key)
20
+ wl_tkip_printstats(wl_info_t *wl, bool group_key)
22
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14)
23
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
24
+ char debug_buf[512];
26
+ if (wl->tkipmodops) {
27
+@@ -3408,6 +3408,7 @@ wl_linux_watchdog(void *ctx)
31
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
33
+ wl_proc_read(char *buffer, char **start, off_t offset, int length, int *eof, void *data)
35
+@@ -3462,19 +3463,90 @@ wl_proc_write(struct file *filp, const char *buff, unsigned long length, void *d
42
++wl_proc_read(struct seq_file *seq, void *offset)
44
++ wl_info_t * wl = (wl_info_t *)seq->private;
45
++ int bcmerror, to_user;
48
++ bcmerror = wlc_ioctl(wl->wlc, WLC_GET_MONITOR, &to_user, sizeof(int), NULL);
51
++ seq_printf(seq, "%d\n", to_user);
55
++static ssize_t wl_proc_write(struct file *file, const char __user *buff,
56
++ size_t length, loff_t *ppos)
58
++ struct seq_file *seq = file->private_data;
59
++ wl_info_t * wl = (wl_info_t *)seq->private;
60
++ int bcmerror, from_user = 0;
63
++ WL_ERROR(("%s: Invalid data length\n", __FUNCTION__));
67
++ if (copy_from_user(&from_user, buff, 1)) {
68
++ WL_ERROR(("%s: copy from user failed\n", __FUNCTION__));
72
++ if (from_user >= 0x30)
76
++ bcmerror = wlc_ioctl(wl->wlc, WLC_SET_MONITOR, &from_user, sizeof(int), NULL);
79
++ if (bcmerror < 0) {
80
++ WL_ERROR(("%s: SET_MONITOR failed with %d\n", __FUNCTION__, bcmerror));
87
++static int wl_proc_open(struct inode *inode, struct file *file)
89
++ return single_open(file, wl_proc_read, PDE_DATA(inode));
92
++static const struct file_operations wl_proc_fops = {
93
++ .owner = THIS_MODULE,
94
++ .open = wl_proc_open,
96
++ .write = wl_proc_write,
97
++ .llseek = seq_lseek,
98
++ .release = single_release,
103
+ wl_reg_proc_entry(wl_info_t *wl)
106
+ sprintf(tmp, "%s%d", HYBRID_PROC, wl->pub->unit);
107
+- if ((wl->proc_entry = create_proc_entry(tmp, 0644, NULL)) == NULL) {
109
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
110
++ wl->proc_entry = create_proc_entry(tmp, 0644, NULL);
111
++ if (wl->proc_entry) {
112
++ wl->proc_entry->read_proc = wl_proc_read;
113
++ wl->proc_entry->write_proc = wl_proc_write;
114
++ wl->proc_entry->data = wl;
117
++ wl->proc_entry = proc_create_data(tmp, 0644, NULL, &wl_proc_fops, wl);
119
++ if (!wl->proc_entry) {
120
+ WL_ERROR(("%s: create_proc_entry %s failed\n", __FUNCTION__, tmp));
124
+- wl->proc_entry->read_proc = wl_proc_read;
125
+- wl->proc_entry->write_proc = wl_proc_write;
126
+- wl->proc_entry->data = wl;