update libertas driver
[openwrt/svn-archive/archive.git] / package / libertas / patches / 100-wext.patch
1 Index: kmod-libertas/scan.c
2 ===================================================================
3 --- kmod-libertas.orig/scan.c 2008-11-30 17:44:39.000000000 +0100
4 +++ kmod-libertas/scan.c 2008-11-30 17:46:08.000000000 +0100
5 @@ -13,6 +13,13 @@
6 #include "scan.h"
7 #include "cmd.h"
8
9 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
10 +#define IWE(func, ...) func(&iweinfo, __VA_ARGS__)
11 +static struct iw_request_info iweinfo = { 0, 0 };
12 +#else
13 +#define IWE(func, ...) func(__VA_ARGS__)
14 +#endif
15 +
16 //! Approximate amount of data needed to pass a scan result back to iwlist
17 #define MAX_SCAN_CELL_SIZE (IW_EV_ADDR_LEN \
18 + IW_ESSID_MAX_SIZE \
19 @@ -807,7 +814,7 @@
20 iwe.cmd = SIOCGIWESSID;
21 iwe.u.data.flags = 1;
22 iwe.u.data.length = min((uint32_t) bss->ssid_len, (uint32_t) IW_ESSID_MAX_SIZE);
23 - start = iwe_stream_add_point(start, stop, &iwe, bss->ssid);
24 + start = IWE(iwe_stream_add_point, start, stop, &iwe, bss->ssid);
25
26 /* Mode */
27 iwe.cmd = SIOCGIWMODE;
28 @@ -862,7 +869,7 @@
29 iwe.u.data.flags = IW_ENCODE_DISABLED;
30 }
31 iwe.u.data.length = 0;
32 - start = iwe_stream_add_point(start, stop, &iwe, bss->ssid);
33 + start = IWE(iwe_stream_add_point, start, stop, &iwe, bss->ssid);
34
35 current_val = start + IW_EV_LCP_LEN;
36
37 @@ -874,7 +881,7 @@
38 for (j = 0; bss->rates[j] && (j < sizeof(bss->rates)); j++) {
39 /* Bit rate given in 500 kb/s units */
40 iwe.u.bitrate.value = bss->rates[j] * 500000;
41 - current_val = iwe_stream_add_value(start, current_val,
42 + current_val = IWE(iwe_stream_add_value, start, current_val,
43 stop, &iwe, IW_EV_PARAM_LEN);
44 }
45 if ((bss->mode == IW_MODE_ADHOC) && priv->adhoccreate
46 @@ -882,7 +889,7 @@
47 priv->curbssparams.ssid_len,
48 bss->ssid, bss->ssid_len)) {
49 iwe.u.bitrate.value = 22 * 500000;
50 - current_val = iwe_stream_add_value(start, current_val,
51 + current_val = IWE(iwe_stream_add_value, start, current_val,
52 stop, &iwe, IW_EV_PARAM_LEN);
53 }
54 /* Check if we added any event */
55 @@ -895,7 +902,7 @@
56 memcpy(buf, bss->wpa_ie, bss->wpa_ie_len);
57 iwe.cmd = IWEVGENIE;
58 iwe.u.data.length = bss->wpa_ie_len;
59 - start = iwe_stream_add_point(start, stop, &iwe, buf);
60 + start = IWE(iwe_stream_add_point, start, stop, &iwe, buf);
61 }
62
63 memset(&iwe, 0, sizeof(iwe));
64 @@ -904,7 +911,7 @@
65 memcpy(buf, bss->rsn_ie, bss->rsn_ie_len);
66 iwe.cmd = IWEVGENIE;
67 iwe.u.data.length = bss->rsn_ie_len;
68 - start = iwe_stream_add_point(start, stop, &iwe, buf);
69 + start = IWE(iwe_stream_add_point, start, stop, &iwe, buf);
70 }
71
72 if (bss->mesh) {
73 @@ -915,7 +922,7 @@
74 p += snprintf(p, MAX_CUSTOM_LEN, "mesh-type: olpc");
75 iwe.u.data.length = p - custom;
76 if (iwe.u.data.length)
77 - start = iwe_stream_add_point(start, stop, &iwe, custom);
78 + start = IWE(iwe_stream_add_point, start, stop, &iwe, custom);
79 }
80
81 out: