broadcom-wl: fix crash when starting multiple virtual interfaces
[openwrt/svn-archive/archive.git] / package / kernel / broadcom-wl / patches / 012-compat-3.10.patch
1 --- a/driver/wl_linux.c
2 +++ b/driver/wl_linux.c
3 @@ -349,7 +349,7 @@ static void wl_mic_error(wl_info_t *wl,
4 defined(WL_MONITOR)
5 static int wl_schedule_task(wl_info_t *wl, void (*fn)(struct wl_task *), void *context);
6 #endif
7 -#if defined(CONFIG_PROC_FS)
8 +#if defined(CONFIG_PROC_FS) && (LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0))
9 static int wl_read_proc(char *buffer, char **start, off_t offset, int length, int *eof, void *data);
10 #endif /* defined(CONFIG_PROC_FS) */
11 #ifdef BCMDBG
12 @@ -517,7 +517,7 @@ wl_attach(uint16 vendor, uint16 device,
13 struct net_device *dev;
14 wl_if_t *wlif;
15 wl_info_t *wl;
16 -#if defined(CONFIG_PROC_FS)
17 +#if defined(CONFIG_PROC_FS) && (LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0))
18 char tmp[128];
19 #endif
20 osl_t *osh;
21 @@ -664,7 +664,7 @@ wl_attach(uint16 vendor, uint16 device,
22 WL_ERROR(("wl%d: Error setting MPC variable to 0\n", unit));
23 }
24 }
25 -#if defined(CONFIG_PROC_FS)
26 +#if defined(CONFIG_PROC_FS) && (LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0))
27 /* create /proc/net/wl<unit> */
28 sprintf(tmp, "net/wl%d", wl->pub->unit);
29 create_proc_read_entry(tmp, 0, 0, wl_read_proc, (void*)wl);
30 @@ -810,7 +810,7 @@ wl_dbus_disconnect_cb(void *arg)
31 }
32 #endif /* BCMDBUS */
33
34 -#if defined(CONFIG_PROC_FS)
35 +#if defined(CONFIG_PROC_FS) && (LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0))
36 static int
37 wl_read_proc(char *buffer, char **start, off_t offset, int length, int *eof, void *data)
38 {
39 @@ -1149,7 +1149,7 @@ wl_free(wl_info_t *wl)
40
41 /* free common resources */
42 if (wl->wlc) {
43 -#if defined(CONFIG_PROC_FS)
44 +#if defined(CONFIG_PROC_FS) && (LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0))
45 char tmp[128];
46 /* remove /proc/net/wl<unit> */
47 sprintf(tmp, "net/wl%d", wl->pub->unit);