pandora-libpnd: Bump SRCREV to include the keymapper daemon and start to rejig init...
[openpandora.oe.git] / recipes / pandora-system / pandora-wifi / 0003-Merge-in-latest-wireless-ext.-hacks.patch
1 From 290a8f3391b8aec1ffe9e15b12f6534b8288dc1f Mon Sep 17 00:00:00 2001
2 From: David-John Willis <John.Willis@Distant-earth.com>
3 Date: Thu, 23 Apr 2009 20:12:37 +0100
4 Subject: [PATCH 3/5] Merge in latest wireless ext. hacks.
5  e      CUDK/CLI/console.d
6
7 ---
8  sta_dk_4_0_4_32/pform/common/inc/osUtil.h  |    3 +
9  sta_dk_4_0_4_32/pform/common/src/osUtil.c  |   50 ++++++++
10  sta_dk_4_0_4_32/pform/linux/src/iw_ioctl.c |  188 +++++++++++++++-------------
11  3 files changed, 155 insertions(+), 86 deletions(-)
12  mode change 100644 => 100755 sta_dk_4_0_4_32/pform/common/inc/osUtil.h
13  mode change 100644 => 100755 sta_dk_4_0_4_32/pform/common/src/osUtil.c
14
15 diff --git a/sta_dk_4_0_4_32/pform/common/inc/osUtil.h b/sta_dk_4_0_4_32/pform/common/inc/osUtil.h
16 old mode 100644
17 new mode 100755
18 index e7a0de8..a78fb3a
19 --- a/sta_dk_4_0_4_32/pform/common/inc/osUtil.h
20 +++ b/sta_dk_4_0_4_32/pform/common/inc/osUtil.h
21 @@ -335,4 +335,7 @@ VOID UtilPltRxTxCalCB(TI_HANDLE hAdapter,TI_STATUS status,PUINT8 pReadBuff);
22  ULONG UtilPltRxCal(PTIWLN_ADAPTER_T pAdapter, PUCHAR pData, PULONG pOutLength, ULONG InLength);
23  ULONG utilRxCalibrationStatus(PTIWLN_ADAPTER_T pAdapter, PUCHAR pData, PULONG pOutLength, ULONG InLength);
24   
25 +ULONG UtilWepKeyGet (PTIWLN_ADAPTER_T pAdapter, PUCHAR pData, ULONG Length);\r
26 +ULONG UtilDesiredRatesSet (PTIWLN_ADAPTER_T pAdapter, PUCHAR pData, ULONG Length);\r
27 +
28  #endif         /*__OSUTIL_H_*/
29 diff --git a/sta_dk_4_0_4_32/pform/common/src/osUtil.c b/sta_dk_4_0_4_32/pform/common/src/osUtil.c
30 old mode 100644
31 new mode 100755
32 index 757c443..6e836e6
33 --- a/sta_dk_4_0_4_32/pform/common/src/osUtil.c
34 +++ b/sta_dk_4_0_4_32/pform/common/src/osUtil.c
35 @@ -5588,3 +5588,53 @@ ULONG utilRxCalibrationStatus(
36  
37      return status;
38  }
39 +\r
40 +ULONG\r
41 +UtilWepKeyGet (\r
42 +   PTIWLN_ADAPTER_T pAdapter,\r
43 +   PUCHAR pData,\r
44 +   ULONG Length)\r
45 +{\r
46 +    securityKeys_t       rsnkey;\r
47 +    securityKeys_t       *wkey;\r
48 +    paramInfo_t          Param;\r
49 +    TI_STATUS            status;\r
50 +\r
51 +    wkey  = (securityKeys_t *)pData;\r
52 +\r
53 +    /* Fill Param fields and get the 802_11 capability information */\r
54 +    Param.paramType   = RSN_KEY_PARAM;\r
55 +    Param.paramLength = Length;\r
56 +    rsnkey.keyIndex = wkey->keyIndex;\r
57 +    Param.content.pRsnKey = &rsnkey;\r
58 +\r
59 +    status = configMgr_getParam(pAdapter->CoreHalCtx, &Param);\r
60 +\r
61 +    if(status != OK)\r
62 +        return NOK;\r
63 +\r
64 +        printk("UtilWepKeyGet 1 KeyIndex  %x , keyLength=%d\n",\r
65 +             Param.content.pRsnKey->keyIndex, Param.content.pRsnKey->encLen);\r
66 +        NdisMoveMemory(wkey, Param.content.pRsnKey, sizeof(securityKeys_t));\r
67 +        printk("UtilWepKeyGet 2 KeyIndex  %x , keyLength=%d\n",\r
68 +             wkey->keyIndex, wkey->encLen);\r
69 +    return status;\r
70 +}\r
71 +\r
72 +ULONG\r
73 +UtilDesiredRatesSet(\r
74 +        PTIWLN_ADAPTER_T pAdapter,\r
75 +        PUCHAR pData,\r
76 +        ULONG Length\r
77 +        )\r
78 +{\r
79 +        UCHAR rate;\r
80 +    ULONG retValue;\r
81 +\r
82 +        rate = (UCHAR) *(PULONG)pData;\r
83 +\r
84 +        retValue = UtilSetParam(pAdapter, SITE_MGR_DESIRED_TX_RATE_PARAM, (PUCHAR)&rate, sizeof(UCHAR));\r
85 +\r
86 +        return retValue;\r
87 +\r
88 +}\r
89 diff --git a/sta_dk_4_0_4_32/pform/linux/src/iw_ioctl.c b/sta_dk_4_0_4_32/pform/linux/src/iw_ioctl.c
90 index 3b02424..a38efc9 100755
91 --- a/sta_dk_4_0_4_32/pform/linux/src/iw_ioctl.c
92 +++ b/sta_dk_4_0_4_32/pform/linux/src/iw_ioctl.c
93 @@ -1,9 +1,33 @@
94 -/* ioctl() (mostly Linux Wireless Extensions) routines for TI 1251 driver */
95 -
96 +/*
97 + *  Copyright (C) 2009 John Willis
98 + *  Copyright (C) 2008 Texas Instruments/Jorjin Technologies inc.
99 + *
100 + *  This program is free software; you can redistribute it and/or modify
101 + *  it under the terms of the GNU General Public License as published by
102 + *  the Free Software Foundation; either version 2 of the License, or
103 + *  (at your option) any later version.
104 + *
105 + *  This program is distributed in the hope that it will be useful,
106 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
107 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
108 + *  GNU General Public License for more details.
109 + *
110 + *
111 + * This file implements support for Linux Wireless Extensions for TI 1251 driver.
112 + *
113 + */
114 +
115 +#include <linux/ctype.h>
116 +#include <linux/delay.h>
117 +#include <linux/if.h>
118  #include <linux/if_arp.h>
119  #include <linux/wireless.h>
120 +#include <linux/bitops.h>
121 +
122  #include <net/iw_handler.h>
123  #include <net/ieee80211.h>
124 +
125 +#include "iw_ioctl.h"
126  #include "osAdapter.h"
127  #include "tiioctl.h"
128  #include "paramOut.h"
129 @@ -102,7 +126,7 @@ static int iw_get_name(struct net_device *dev,
130  #if IOCTL_DBG
131         printk("%s Call\n", __FUNCTION__);
132  #endif
133 -/*     
134 +/*
135         u8 rates[10];
136         int len, i, over2 = 0;
137  
138 @@ -127,7 +151,7 @@ static int iw_ioctl_siwencode(struct net_device *dev,
139         PTIWLN_ADAPTER_T pAdapter = &(((tiwlan_net_dev_t *)(dev->priv))->adapter);
140         cipherSuite_e   cipher;
141         int i;
142 -       ULONG len; 
143 +       ULONG len;
144  
145  #if IOCTL_DBG
146         printk("%s Call\n", __FUNCTION__);
147 @@ -146,7 +170,7 @@ static int iw_ioctl_siwencode(struct net_device *dev,
148                 return -EINVAL;
149  
150         UtilWepStatusGet(pAdapter, (UINT8 *)&cipher, &len);
151 -       
152 +
153         if (erq->flags & IW_ENCODE_DISABLED) {
154                 cipherSuite_e val=RSN_CIPHER_NONE;
155                 UtilWepStatusSet(pAdapter, (UINT8 *)&val, sizeof(val));
156 @@ -157,10 +181,10 @@ static int iw_ioctl_siwencode(struct net_device *dev,
157                 if (erq->length > 0) {
158                         OS_802_11_WEP wep;
159                         int len = erq->length <= 5 ? 5 : 13;
160 -                       
161 +
162                         cipherSuite_e val=RSN_CIPHER_WEP;
163                         UtilWepStatusSet(pAdapter, (UINT8 *)&val, sizeof(val));
164 -                       
165 +
166                         if (len > erq->length)
167                                 memset(keybuf + erq->length, 0, len - erq->length);
168                         memcpy(wep.KeyMaterial, keybuf, len);
169 @@ -172,7 +196,7 @@ static int iw_ioctl_siwencode(struct net_device *dev,
170                         /* No key data - just set the default TX key index */
171                         securityKeys_t key;
172                         UINT8 data[5];
173 -                       
174 +
175                         memset(&key, 0, sizeof(securityKeys_t));
176                         key.keyIndex = i;
177                         if (!UtilWepKeyGet(pAdapter, (UINT8 *)&key, sizeof(securityKeys_t)))
178 @@ -189,13 +213,13 @@ static int iw_ioctl_siwencode(struct net_device *dev,
179                                         }
180                                 }
181                                 else
182 -                                       return -EINVAL;                         
183 +                                       return -EINVAL;
184                         }
185                         else
186                                 return -EINVAL;
187                 }
188         }
189 -done:  
190 +done:
191         if (erq->flags & IW_ENCODE_OPEN)
192         {
193                 UINT8 MixedMode = true;
194 @@ -255,7 +279,7 @@ static int iw_ioctl_giwencode(struct net_device *dev,
195                 wkey.keyIndex = i;
196                 if (!UtilWepKeyGet(pAdapter, (PUCHAR)&wkey, sizeof(securityKeys_t)))
197                 {
198 -               printk("iw_ioctl_giwencode KeyIndex  %x , keyLength=%d\n", 
199 +               printk("iw_ioctl_giwencode KeyIndex  %x , keyLength=%d\n",
200                        wkey.keyIndex, wkey.encLen);
201                         if (wkey.encLen > 0)
202                         {
203 @@ -286,8 +310,8 @@ static int iw_ioctl_giwencode(struct net_device *dev,
204                 erq->flags |= IW_ENCODE_OPEN;
205         else
206                 erq->flags |= IW_ENCODE_RESTRICTED;
207 -               
208 -       
209 +
210 +
211         return 0;
212  }
213  
214 @@ -297,7 +321,7 @@ static int iw_ioctl_siwrate(struct net_device *dev,
215  {
216         PTIWLN_ADAPTER_T pAdapter = &(((tiwlan_net_dev_t *)(dev->priv))->adapter);
217         u32 val;
218 -       
219 +
220  #if IOCTL_DBG
221         printk("%s Call\n", __FUNCTION__);
222  #endif
223 @@ -305,7 +329,7 @@ static int iw_ioctl_siwrate(struct net_device *dev,
224                 val = 0;
225         else
226                 val = (rrq->value*2/1000000);
227 -       
228 +
229         return UtilDesiredRatesSet(pAdapter, (UINT8 *)&val, 4);
230  }
231  
232 @@ -343,7 +367,7 @@ static int iw_ioctl_giwaplist(struct net_device *dev,
233                                   struct iw_request_info *info,
234                                   struct iw_point *data, char *extra)
235  {
236 -       
237 +
238  #if 1
239         PTIWLN_ADAPTER_T pAdapter = &(((tiwlan_net_dev_t *)(dev->priv))->adapter);
240         struct sockaddr addr[IW_MAX_AP];
241 @@ -353,7 +377,7 @@ static int iw_ioctl_giwaplist(struct net_device *dev,
242         OS_802_11_BSSID_EX *bssid;
243         OS_802_11_BSSID_LIST_EX *list;
244         int i;
245 -       
246 +
247  #if IOCTL_DBG
248         printk("%s Call\n", __FUNCTION__);
249  #endif
250 @@ -366,9 +390,9 @@ static int iw_ioctl_giwaplist(struct net_device *dev,
251      printk("bssid 0x%x\n",bssid);
252      number_items = list->NumberOfItems;
253      printk("number_items 0x%x\n",number_items);
254 -    
255 +
256         data->length = number_items;
257 -       
258 +
259         for (i=0;i<number_items;i++)
260         {
261                 addr[i].sa_family = ARPHRD_ETHER;
262 @@ -380,7 +404,7 @@ static int iw_ioctl_giwaplist(struct net_device *dev,
263                 qual[i].updated = 7;
264          bssid = (OS_802_11_BSSID_EX *) (((char *) bssid) + bssid->Length);
265         }
266 -       
267 +
268         memcpy(extra, &addr, sizeof(addr[0]) * data->length);
269         data->flags = 1; /* has quality information */
270         memcpy(extra + sizeof(addr[0]) * data->length, &qual,
271 @@ -409,7 +433,7 @@ static int iw_ioctl_siwrts(struct net_device *dev,
272                 val = rts->value;
273  
274         UtilRtsThresholdSet(pAdapter, (UINT8 *)&val, 4);
275 -       
276 +
277         return 0;
278  }
279  
280 @@ -530,7 +554,7 @@ static int iw_ioctl_siwfreq(struct net_device *dev,
281  #endif
282         if (freq->m == -1)
283                 return -EOPNOTSUPP;
284 -               
285 +
286         /* freq => chan. */
287         if (freq->e == 1 &&
288             freq->m / 100000 >= freq_list[0] &&
289 @@ -578,7 +602,7 @@ static int iw_ioctl_giwfreq(struct net_device *dev,
290  static int iw_ioctl_siwessid(struct net_device *dev,
291                                  struct iw_request_info *info,
292                                  struct iw_point *data, char *ssid)
293 -{      
294 +{
295         PTIWLN_ADAPTER_T pAdapter = &(((tiwlan_net_dev_t *)(dev->priv))->adapter);
296         OS_802_11_SSID essid;
297         OS_802_11_MAC_ADDRESS bssid = { 0xff,0xff,0xff,0xff,0xff,0xff };
298 @@ -616,7 +640,7 @@ static int iw_ioctl_giwessid(struct net_device *dev,
299         UtilGetSSID(pAdapter, (UINT8 *)&ssid, &len);
300         data->length = ssid.SsidLength;
301         memcpy(essid, ssid.Ssid, ssid.SsidLength);
302 -       
303 +
304         return 0;
305  }
306  
307 @@ -647,9 +671,9 @@ static int iw_ioctl_siwmode(struct net_device *dev,
308         default:
309                 val = 1;
310         }
311 -       
312 +
313      UtilInfrastructureModeSet(pAdapter, (UINT8 *)&val, 4);
314 -    
315 +
316         return 0;
317  }
318  
319 @@ -816,7 +840,7 @@ static int iw_ioctl_siwpower(struct net_device *dev,
320  {
321         PTIWLN_ADAPTER_T pAdapter = &(((tiwlan_net_dev_t *)(dev->priv))->adapter);
322         UINT32 val=POWER_MODE_ACTIVE;
323 -       
324 +
325  #if IOCTL_DBG
326         printk("%s Call\n", __FUNCTION__);
327  #endif
328 @@ -855,12 +879,12 @@ static int iw_ioctl_giwpower(struct net_device *dev,
329  {
330         PTIWLN_ADAPTER_T pAdapter = &(((tiwlan_net_dev_t *)(dev->priv))->adapter);
331         UINT32 val=POWER_MODE_ACTIVE, len;
332 -       
333 +
334  #if IOCTL_DBG
335         printk("%s Call\n", __FUNCTION__);
336  #endif
337         UtilPowerModeGet(pAdapter, (UINT8 *)&val, &len);
338 -       
339 +
340         if (val==POWER_MODE_ACTIVE) {
341                 rrq->disabled = 1;
342                 return 0;
343 @@ -877,7 +901,7 @@ static int iw_ioctl_siwretry(struct net_device *dev,
344                                  struct iw_param *rrq, char *extra)
345  {
346         PTIWLN_ADAPTER_T pAdapter = &(((tiwlan_net_dev_t *)(dev->priv))->adapter);
347 -       
348 +
349  #if IOCTL_DBG
350         printk("%s Call\n", __FUNCTION__);
351  #endif
352 @@ -906,11 +930,11 @@ static int iw_ioctl_giwretry(struct net_device *dev,
353         PTIWLN_ADAPTER_T pAdapter = &(((tiwlan_net_dev_t *)(dev->priv))->adapter);
354         u16 shortretry, longretry;
355         ULONG len;
356 -       
357 +
358  #if IOCTL_DBG
359         printk("%s Call\n", __FUNCTION__);
360  #endif
361 -       if (UtilShortRetryGet(pAdapter, (UINT8 *)&shortretry, &len)!=0 || 
362 +       if (UtilShortRetryGet(pAdapter, (UINT8 *)&shortretry, &len)!=0 ||
363                 UtilLongRetryGet(pAdapter, (UINT8 *)&longretry, &len)!=0)
364                 return -EINVAL;
365  
366 @@ -972,12 +996,12 @@ static int iw_ioctl_siwscan(struct net_device *dev,
367  #endif
368         PTIWLN_ADAPTER_T pAdapter = &(((tiwlan_net_dev_t *)(dev->priv))->adapter);
369         int ret;
370 -       
371 +
372         scan_TimeStamp = jiffies;
373         init_scan_params();
374 -       
375 +
376         ret = UtilStartAppScanSet(pAdapter, (PCHAR)&iw_appScanParams, sizeof(iw_appScanParams));
377 -       
378 +
379         return ret;
380  }
381  
382 @@ -1002,7 +1026,7 @@ static inline int iw_scan_list(struct net_device *dev,
383         int chan;
384         u8 *pos;
385         spinlock_t lock;
386 -       
387 +
388  #if IOCTL_DBG
389         printk("%s Call\n", __FUNCTION__);
390  #endif
391 @@ -1012,7 +1036,7 @@ static inline int iw_scan_list(struct net_device *dev,
392      list = (OS_802_11_BSSID_LIST_EX *) list_buf;
393      bssid = &list->Bssid[0];
394      number_items = list->NumberOfItems;
395 -    
396 +
397         spin_lock_bh(&lock);
398         for (i=0;i<number_items;i++)
399         {
400 @@ -1021,31 +1045,31 @@ static inline int iw_scan_list(struct net_device *dev,
401                 iwe.u.ap_addr.sa_family = ARPHRD_ETHER;
402                 memcpy(iwe.u.ap_addr.sa_data, bssid->MacAddress, ETH_ALEN);
403                 iwe.len = IW_EV_ADDR_LEN;
404 -               current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe,
405 +               current_ev = iwe_stream_add_event(info, current_ev, end_buf, &iwe,
406                                                   IW_EV_ADDR_LEN);
407 -                                                 
408 +
409                 memset(&iwe, 0, sizeof(iwe));
410                 iwe.cmd = SIOCGIWESSID;
411                 iwe.u.data.length = bssid->Ssid.SsidLength;
412                 iwe.u.data.flags = 1;
413                 iwe.len = IW_EV_POINT_LEN + iwe.u.data.length;
414  //             printk("essid=%s len=%d\n", bssid->Ssid.Ssid, bssid->Ssid.SsidLength);
415 -               current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, (char *)bssid->Ssid.Ssid);
416 -                                                         
417 +               current_ev = iwe_stream_add_point(info, current_ev, end_buf, &iwe, (char *)bssid->Ssid.Ssid);
418 +
419                 memset(&iwe, 0, sizeof(iwe));
420                 iwe.cmd = SIOCGIWMODE;
421                 capabilities = bssid->Union.Capabilities;
422 -               if (capabilities & (WLAN_CAPABILITY_BSS |
423 +               if (capabilities & (WLAN_CAPABILITY_ESS |
424                                     WLAN_CAPABILITY_IBSS)) {
425 -                       if (capabilities & WLAN_CAPABILITY_BSS)
426 +                       if (capabilities & WLAN_CAPABILITY_ESS)
427                                 iwe.u.mode = IW_MODE_MASTER;
428                         else
429                                 iwe.u.mode = IW_MODE_ADHOC;
430                         iwe.len = IW_EV_UINT_LEN;
431 -                       current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe,
432 +                       current_ev = iwe_stream_add_event(info, current_ev, end_buf, &iwe,
433                                                           IW_EV_UINT_LEN);
434                 }
435 -               
436 +
437                 memset(&iwe, 0, sizeof(iwe));
438                 iwe.cmd = SIOCGIWFREQ;
439                 chan = bssid->Configuration.Union.channel;
440 @@ -1053,10 +1077,10 @@ static inline int iw_scan_list(struct net_device *dev,
441                         iwe.u.freq.m = chan;
442                         iwe.u.freq.e = 1;
443                         iwe.len = IW_EV_FREQ_LEN;
444 -                       current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe,
445 +                       current_ev = iwe_stream_add_event(info, current_ev, end_buf, &iwe,
446                                                           IW_EV_FREQ_LEN);
447                 }
448 -               
449 +
450                 memset(&iwe, 0, sizeof(iwe));
451                 iwe.cmd = IWEVQUAL;
452                 iwe.u.qual.qual = bssid->Rssi;
453 @@ -1066,7 +1090,7 @@ static inline int iw_scan_list(struct net_device *dev,
454                                 | IW_QUAL_NOISE_UPDATED
455                                 | IW_QUAL_QUAL_INVALID;
456                 iwe.len = IW_EV_QUAL_LEN;
457 -               current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe,
458 +               current_ev = iwe_stream_add_event(info, current_ev, end_buf, &iwe,
459                                                   IW_EV_QUAL_LEN);
460  
461                 memset(&iwe, 0, sizeof(iwe));
462 @@ -1077,8 +1101,8 @@ static inline int iw_scan_list(struct net_device *dev,
463                         iwe.u.data.flags = IW_ENCODE_DISABLED;
464                 iwe.u.data.length = 0;
465                 iwe.len = IW_EV_POINT_LEN + iwe.u.data.length;
466 -               current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, "");
467 -               
468 +               current_ev = iwe_stream_add_point(info, current_ev, end_buf, &iwe, "");
469 +
470                 /* TODO: add SuppRates into BSS table */
471                 memset(&iwe, 0, sizeof(iwe));
472                 iwe.cmd = SIOCGIWRATE;
473 @@ -1090,20 +1114,20 @@ static inline int iw_scan_list(struct net_device *dev,
474                         /* Bit rate given in 500 kb/s units (+ 0x80) */
475                         iwe.u.bitrate.value = ((pos[j] & 0x7f) * 500000);
476                         current_val = iwe_stream_add_value(
477 -                               current_ev, current_val, end_buf, &iwe,
478 +                               info, current_ev, current_val, end_buf, &iwe,
479                                 IW_EV_PARAM_LEN);
480                 }
481                 /* Check if we added any event */
482                 if ((current_val - current_ev) > IW_EV_LCP_LEN)
483                         current_ev = current_val;
484 -       
485 +
486                 /* TODO: add BeaconInt,resp_rate,atim into BSS table */
487                 memset(&iwe, 0, sizeof(iwe));
488                 iwe.cmd = IWEVCUSTOM;
489                 sprintf(buf, "bcn_int=%d",
490                         bssid->Configuration.BeaconPeriod);
491                 iwe.u.data.length = strlen(buf);
492 -               current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe,
493 +               current_ev = iwe_stream_add_point(info, current_ev, end_buf, &iwe,
494                                                   buf);
495  
496                 if (capabilities & WLAN_CAPABILITY_IBSS) {
497 @@ -1111,29 +1135,29 @@ static inline int iw_scan_list(struct net_device *dev,
498                         iwe.cmd = IWEVCUSTOM;
499                         sprintf(buf, "atim=%d", bssid->Configuration.ATIMWindow);
500                         iwe.u.data.length = strlen(buf);
501 -                       current_ev = iwe_stream_add_point(current_ev, end_buf,
502 +                       current_ev = iwe_stream_add_point(info, current_ev, end_buf,
503                                                           &iwe, buf);
504                 }
505 -               
506 +
507  #if 1
508                 IELen = 0;
509          IELen += sizeof(OS_802_11_FIXED_IEs);
510          pVarIes = (OS_802_11_VARIABLE_IEs*)&bssid->IEs[IELen];
511                 while (IELen < bssid->IELength)
512                 {
513 -//                     printk("IELen=%d pVarIes->ElementID=%d\n", IELen, pVarIes->ElementID);                
514 +//                     printk("IELen=%d pVarIes->ElementID=%d\n", IELen, pVarIes->ElementID);
515                         if (pVarIes->ElementID == MFIE_TYPE_RSN || pVarIes->ElementID == MFIE_TYPE_GENERIC) {
516                                 memset(&iwe, 0, sizeof(iwe));
517                                 iwe.cmd = IWEVGENIE;
518                                 iwe.u.data.length = pVarIes->Length;
519                                 current_ev = iwe_stream_add_point(
520 -                                       current_ev, end_buf, &iwe, (char *)pVarIes);
521 +                                       info, current_ev, end_buf, &iwe, (char *)pVarIes);
522                         }
523 -               
524 -            IELen += (pVarIes->Length + 2);            
525 +
526 +            IELen += (pVarIes->Length + 2);
527                 pVarIes = (OS_802_11_VARIABLE_IEs*)&bssid->IEs[IELen];
528                 }
529 -#endif        
530 +#endif
531                 if ((end_buf - current_ev) <= IW_EV_ADDR_LEN) {
532                         /* Ask user space to try again with a bigger buffer */
533                         spin_unlock_bh(&lock);
534 @@ -1142,7 +1166,7 @@ static inline int iw_scan_list(struct net_device *dev,
535  //             printk("current_ev=%x\n", current_ev);
536          bssid = (OS_802_11_BSSID_EX *) (((char *) bssid) + bssid->Length);
537         }
538 -       
539 +
540         spin_unlock_bh(&lock);
541         return current_ev - extra;
542  }
543 @@ -1462,7 +1486,7 @@ static int iw_ioctl_siwauth(struct net_device *dev,
544         }
545         return 0;
546  #endif
547 -       return -EOPNOTSUPP;     
548 +       return -EOPNOTSUPP;
549  }
550  
551  
552 @@ -1505,7 +1529,7 @@ static int iw_ioctl_giwauth(struct net_device *dev,
553         }
554         return 0;
555  #endif
556 -       return -EOPNOTSUPP;     
557 +       return -EOPNOTSUPP;
558  }
559  
560  
561 @@ -1517,7 +1541,7 @@ static int iw_ioctl_siwencodeext(struct net_device *dev,
562  #if IOCTL_DBG
563         printk("%s Call\n", __FUNCTION__);
564  #endif
565 -#if 0  
566 +#if 0
567         struct hostap_interface *iface = dev->priv;
568         local_info_t *local = iface->local;
569         struct iw_encode_ext *ext = (struct iw_encode_ext *) extra;
570 @@ -1683,7 +1707,7 @@ static int iw_ioctl_siwencodeext(struct net_device *dev,
571  
572         return ret;
573  #endif
574 -       return -EOPNOTSUPP;     
575 +       return -EOPNOTSUPP;
576  }
577  
578  
579 @@ -1694,7 +1718,7 @@ static int iw_ioctl_giwencodeext(struct net_device *dev,
580  #if IOCTL_DBG
581         printk("%s Call\n", __FUNCTION__);
582  #endif
583 -#if 0  
584 +#if 0
585         struct hostap_interface *iface = dev->priv;
586         local_info_t *local = iface->local;
587         struct prism2_crypt_data **crypt;
588 @@ -1759,7 +1783,7 @@ static int iw_ioctl_giwencodeext(struct net_device *dev,
589  
590         return 0;
591  #endif
592 -       return -EOPNOTSUPP;             
593 +       return -EOPNOTSUPP;
594  }
595  #endif /* WIRELESS_EXT > 17 */
596  
597 @@ -1813,31 +1837,25 @@ static const iw_handler ti_handler[] =
598         (iw_handler) iw_ioctl_giwmode,                  /* SIOCGIWMODE */
599         (iw_handler) iw_ioctl_siwsens,                  /* SIOCSIWSENS */
600         (iw_handler) iw_ioctl_giwsens,                  /* SIOCGIWSENS */
601 -       (iw_handler) NULL /* not used */,               /* SIOCSIWRANGE */
602 +       (iw_handler) NULL,                                              /* SIOCSIWRANGE */
603         (iw_handler) iw_ioctl_giwrange,                 /* SIOCGIWRANGE */
604 -       (iw_handler) NULL /* not used */,               /* SIOCSIWPRIV */
605 -       (iw_handler) NULL /* kernel code */,    /* SIOCGIWPRIV */
606 -       (iw_handler) NULL /* not used */,               /* SIOCSIWSTATS */
607 -       (iw_handler) NULL /* kernel code */,    /* SIOCGIWSTATS */
608 -#if WIRELESS_EXT > 15
609 -       (iw_handler) NULL,                                              /* SIOCSIWSPY */
610 -       (iw_handler) NULL,                                              /* SIOCGIWSPY */
611 -       (iw_handler) NULL,                                              /* SIOCSIWTHRSPY */
612 -       (iw_handler) NULL,                                              /* SIOCGIWTHRSPY */
613 -#else /* WIRELESS_EXT > 15 */
614 +       (iw_handler) NULL,                                              /* SIOCSIWPRIV */
615 +       (iw_handler) NULL,                                              /* SIOCGIWPRIV */
616 +       (iw_handler) NULL,                                              /* SIOCSIWSTATS */
617 +       (iw_handler) NULL,                                              /* SIOCGIWSTATS */
618         (iw_handler) NULL,                                              /* SIOCSIWSPY */
619         (iw_handler) NULL,                                              /* SIOCGIWSPY */
620 +       iw_handler_set_thrspy,                                  /* SIOCSIWTHRSPY */
621 +       iw_handler_get_thrspy,                                  /* SIOCGIWTHRSPY */
622 +       iw_handler_set_spy,                                             /* SIOCSIWSPY */
623 +       iw_handler_get_spy,                                             /* SIOCGIWSPY */
624         (iw_handler) NULL,                                              /* -- hole -- */
625         (iw_handler) NULL,                                              /* -- hole -- */
626 -#endif /* WIRELESS_EXT > 15 */
627         (iw_handler) iw_ioctl_siwap,                    /* SIOCSIWAP */
628         (iw_handler) iw_ioctl_giwap,                    /* SIOCGIWAP */
629 -#if WIRELESS_EXT > 17
630         (iw_handler) iw_ioctl_siwmlme,                  /* SIOCSIWMLME */
631 -#else /* WIRELESS_EXT > 17 */
632         (iw_handler) NULL,                              /* -- hole -- */
633 -#endif /* WIRELESS_EXT > 17 */
634 -       (iw_handler) iw_ioctl_giwaplist,                /* SIOCGIWAPLIST */
635 +       (iw_handler) iw_ioctl_giwaplist,                /* SIOCGIWAPLIST - Deprecated */
636         (iw_handler) iw_ioctl_siwscan,                  /* SIOCSIWSCAN */
637         (iw_handler) iw_ioctl_giwscan,                  /* SIOCGIWSCAN */
638         (iw_handler) iw_ioctl_siwessid,                 /* SIOCSIWESSID */
639 @@ -1860,7 +1878,6 @@ static const iw_handler ti_handler[] =
640         (iw_handler) iw_ioctl_giwencode,                /* SIOCGIWENCODE */
641         (iw_handler) iw_ioctl_siwpower,                 /* SIOCSIWPOWER */
642         (iw_handler) iw_ioctl_giwpower,                 /* SIOCGIWPOWER */
643 -#if WIRELESS_EXT > 17
644         (iw_handler) NULL,                                              /* -- hole -- */
645         (iw_handler) NULL,                                              /* -- hole -- */
646         (iw_handler) iw_ioctl_siwgenie,                 /* SIOCSIWGENIE */
647 @@ -1871,7 +1888,6 @@ static const iw_handler ti_handler[] =
648         (iw_handler) iw_ioctl_giwencodeext,             /* SIOCGIWENCODEEXT */
649         (iw_handler) NULL,                                              /* SIOCSIWPMKSA */
650         (iw_handler) NULL,                                              /* -- hole -- */
651 -#endif /* WIRELESS_EXT > 17 */
652  };
653  
654  #if 0
655 @@ -1902,5 +1918,5 @@ static const struct iw_handler_def ti_iw_handler_def =
656  
657  void tiwlan_iwhandler_init(struct net_device *dev)
658  {
659 -   dev->wireless_handlers = (struct iw_handler_def *) &ti_iw_handler_def;      
660 +   dev->wireless_handlers = (struct iw_handler_def *) &ti_iw_handler_def;
661  }
662 -- 
663 1.6.3.1
664