1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29#ifndef __DEVICE_H__
30#define __DEVICE_H__
31
32#include <linux/module.h>
33#include <linux/types.h>
34#include <linux/init.h>
35#include <linux/mm.h>
36#include <linux/errno.h>
37#include <linux/ioport.h>
38#include <linux/pci.h>
39#include <linux/kernel.h>
40#include <linux/netdevice.h>
41#include <linux/etherdevice.h>
42#include <linux/skbuff.h>
43#include <linux/delay.h>
44#include <linux/timer.h>
45#include <linux/slab.h>
46#include <linux/interrupt.h>
47#include <linux/string.h>
48#include <linux/wait.h>
49#include <linux/if_arp.h>
50#include <linux/sched.h>
51#include <linux/if.h>
52#include <linux/rtnetlink.h>
53#include <linux/proc_fs.h>
54#include <linux/inetdevice.h>
55#include <linux/reboot.h>
56#include <linux/usb.h>
57#include <linux/signal.h>
58#include <linux/firmware.h>
59#include <asm/io.h>
60#include <asm/uaccess.h>
61#ifdef SIOCETHTOOL
62#define DEVICE_ETHTOOL_IOCTL_SUPPORT
63#include <linux/ethtool.h>
64#else
65#undef DEVICE_ETHTOOL_IOCTL_SUPPORT
66#endif
67
68#include <linux/wireless.h>
69#include <net/iw_handler.h>
70
71#ifndef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
72#define WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
73#endif
74
75
76#define RT_INSMOD_EVENT_FLAG 0x0101
77#define RT_UPDEV_EVENT_FLAG 0x0102
78#define RT_DISCONNECTED_EVENT_FLAG 0x0103
79#define RT_WPACONNECTED_EVENT_FLAG 0x0104
80#define RT_DOWNDEV_EVENT_FLAG 0x0105
81#define RT_RMMOD_EVENT_FLAG 0x0106
82
83
84
85
86
87#include "device_cfg.h"
88#include "ttype.h"
89#include "80211hdr.h"
90#include "tether.h"
91#include "wmgr.h"
92#include "wcmd.h"
93#include "mib.h"
94#include "srom.h"
95#include "rc4.h"
96#include "desc.h"
97#include "key.h"
98#include "card.h"
99
100
101#define VNT_USB_VENDOR_ID 0x160a
102#define VNT_USB_PRODUCT_ID 0x3184
103
104#define MAC_MAX_CONTEXT_REG (256+128)
105
106#define MAX_MULTICAST_ADDRESS_NUM 32
107#define MULTICAST_ADDRESS_LIST_SIZE (MAX_MULTICAST_ADDRESS_NUM * ETH_ALEN)
108
109
110
111
112
113#define DUPLICATE_RX_CACHE_LENGTH 5
114
115#define NUM_KEY_ENTRY 11
116
117#define TX_WEP_NONE 0
118#define TX_WEP_OTF 1
119#define TX_WEP_SW 2
120#define TX_WEP_SWOTP 3
121#define TX_WEP_OTPSW 4
122#define TX_WEP_SW232 5
123
124#define KEYSEL_WEP40 0
125#define KEYSEL_WEP104 1
126#define KEYSEL_TKIP 2
127#define KEYSEL_CCMP 3
128
129#define AUTO_FB_NONE 0
130#define AUTO_FB_0 1
131#define AUTO_FB_1 2
132
133#define FB_RATE0 0
134#define FB_RATE1 1
135
136
137#define ANT_A 0
138#define ANT_B 1
139#define ANT_DIVERSITY 2
140#define ANT_RXD_TXA 3
141#define ANT_RXD_TXB 4
142#define ANT_UNKNOWN 0xFF
143#define ANT_TXA 0
144#define ANT_TXB 1
145#define ANT_RXA 2
146#define ANT_RXB 3
147
148
149#define MAXCHECKHANGCNT 4
150
151
152#define TX_PKT_UNI 0x00
153#define TX_PKT_MULTI 0x01
154#define TX_PKT_BROAD 0x02
155
156#define BB_VGA_LEVEL 4
157#define BB_VGA_CHANGE_THRESHOLD 3
158
159#ifndef RUN_AT
160#define RUN_AT(x) (jiffies+(x))
161#endif
162
163
164#define RESERV_AC0DMA 4
165
166#define PRIVATE_Message 0
167
168
169
170#define DBG_PRT(l, p, args...) { if (l <= msglevel) printk(p, ##args); }
171#define PRINT_K(p, args...) { if (PRIVATE_Message) printk(p, ##args); }
172
173typedef enum __device_msg_level {
174 MSG_LEVEL_ERR = 0,
175 MSG_LEVEL_NOTICE = 1,
176 MSG_LEVEL_INFO = 2,
177 MSG_LEVEL_VERBOSE = 3,
178 MSG_LEVEL_DEBUG = 4
179} DEVICE_MSG_LEVEL, *PDEVICE_MSG_LEVEL;
180
181typedef enum __device_init_type {
182 DEVICE_INIT_COLD = 0,
183 DEVICE_INIT_RESET,
184 DEVICE_INIT_DXPL
185} DEVICE_INIT_TYPE, *PDEVICE_INIT_TYPE;
186
187
188
189
190
191
192typedef enum _CONTEXT_TYPE {
193 CONTEXT_DATA_PACKET = 1,
194 CONTEXT_MGMT_PACKET
195} CONTEXT_TYPE;
196
197
198typedef struct _RCB
199{
200 void *Next;
201 signed long Ref;
202 void *pDevice;
203 struct urb *pUrb;
204 SRxMgmtPacket sMngPacket;
205 struct sk_buff* skb;
206 BOOL bBoolInUse;
207
208} RCB, *PRCB;
209
210
211typedef struct _USB_SEND_CONTEXT {
212 void *pDevice;
213 struct sk_buff *pPacket;
214 struct urb *pUrb;
215 unsigned int uBufLen;
216 CONTEXT_TYPE Type;
217 SEthernetHeader sEthHeader;
218 void *Next;
219 BOOL bBoolInUse;
220 unsigned char Data[MAX_TOTAL_SIZE_WITH_ALL_HEADERS];
221} USB_SEND_CONTEXT, *PUSB_SEND_CONTEXT;
222
223
224typedef struct _DEFAULT_CONFIG {
225 signed int ZoneType;
226 signed int eConfigMode;
227 signed int eAuthenMode;
228 signed int bShareKeyAlgorithm;
229 signed int keyidx;
230 signed int eEncryptionStatus;
231} DEFAULT_CONFIG, *PDEFAULT_CONFIG;
232
233
234
235
236typedef struct {
237 unsigned int uDataLen;
238 PBYTE pDataBuf;
239
240 BOOL bInUse;
241} INT_BUFFER, *PINT_BUFFER;
242
243
244typedef enum _VIA_BB_TYPE
245{
246 BB_TYPE_11A = 0,
247 BB_TYPE_11B,
248 BB_TYPE_11G
249} VIA_BB_TYPE, *PVIA_BB_TYPE;
250
251
252typedef enum _VIA_PKT_TYPE
253{
254 PK_TYPE_11A = 0,
255 PK_TYPE_11B,
256 PK_TYPE_11GB,
257 PK_TYPE_11GA
258} VIA_PKT_TYPE, *PVIA_PKT_TYPE;
259
260
261
262typedef enum __DEVICE_NDIS_STATUS {
263 STATUS_SUCCESS = 0,
264 STATUS_FAILURE,
265 STATUS_RESOURCES,
266 STATUS_PENDING,
267} DEVICE_NDIS_STATUS, *PDEVICE_NDIS_STATUS;
268
269#define MAX_BSSIDINFO_4_PMKID 16
270#define MAX_PMKIDLIST 5
271
272#define NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED 0x01
273
274
275typedef unsigned char NDIS_802_11_PMKID_VALUE[16];
276
277
278typedef enum _NDIS_802_11_WEP_STATUS
279{
280 Ndis802_11WEPEnabled,
281 Ndis802_11Encryption1Enabled = Ndis802_11WEPEnabled,
282 Ndis802_11WEPDisabled,
283 Ndis802_11EncryptionDisabled = Ndis802_11WEPDisabled,
284 Ndis802_11WEPKeyAbsent,
285 Ndis802_11Encryption1KeyAbsent = Ndis802_11WEPKeyAbsent,
286 Ndis802_11WEPNotSupported,
287 Ndis802_11EncryptionNotSupported = Ndis802_11WEPNotSupported,
288 Ndis802_11Encryption2Enabled,
289 Ndis802_11Encryption2KeyAbsent,
290 Ndis802_11Encryption3Enabled,
291 Ndis802_11Encryption3KeyAbsent
292} NDIS_802_11_WEP_STATUS, *PNDIS_802_11_WEP_STATUS,
293 NDIS_802_11_ENCRYPTION_STATUS, *PNDIS_802_11_ENCRYPTION_STATUS;
294
295
296typedef enum _NDIS_802_11_STATUS_TYPE
297{
298 Ndis802_11StatusType_Authentication,
299 Ndis802_11StatusType_MediaStreamMode,
300 Ndis802_11StatusType_PMKID_CandidateList,
301 Ndis802_11StatusTypeMax
302} NDIS_802_11_STATUS_TYPE, *PNDIS_802_11_STATUS_TYPE;
303
304
305typedef struct _PMKID_CANDIDATE {
306 NDIS_802_11_MAC_ADDRESS BSSID;
307 unsigned long Flags;
308} PMKID_CANDIDATE, *PPMKID_CANDIDATE;
309
310
311typedef struct _BSSID_INFO
312{
313 NDIS_802_11_MAC_ADDRESS BSSID;
314 NDIS_802_11_PMKID_VALUE PMKID;
315} BSSID_INFO, *PBSSID_INFO;
316
317typedef struct tagSPMKID {
318 unsigned long Length;
319 unsigned long BSSIDInfoCount;
320 BSSID_INFO BSSIDInfo[MAX_BSSIDINFO_4_PMKID];
321} SPMKID, *PSPMKID;
322
323typedef struct tagSPMKIDCandidateEvent {
324 NDIS_802_11_STATUS_TYPE StatusType;
325 unsigned long Version;
326 unsigned long NumCandidates;
327 PMKID_CANDIDATE CandidateList[MAX_PMKIDLIST];
328} SPMKIDCandidateEvent, *PSPMKIDCandidateEvent;
329
330
331
332
333#define MAX_QUIET_COUNT 8
334
335typedef struct tagSQuietControl {
336 BOOL bEnable;
337 DWORD dwStartTime;
338 BYTE byPeriod;
339 WORD wDuration;
340} SQuietControl, *PSQuietControl;
341
342
343
344
345
346typedef struct tagSCacheEntry{
347 WORD wFmSequence;
348 BYTE abyAddr2[ETH_ALEN];
349 WORD wFrameCtl;
350} SCacheEntry, *PSCacheEntry;
351
352typedef struct tagSCache{
353
354
355
356 unsigned int uInPtr;
357 SCacheEntry asCacheEntry[DUPLICATE_RX_CACHE_LENGTH];
358} SCache, *PSCache;
359
360#define CB_MAX_RX_FRAG 64
361
362typedef struct tagSDeFragControlBlock
363{
364 WORD wSequence;
365 WORD wFragNum;
366 BYTE abyAddr2[ETH_ALEN];
367 unsigned int uLifetime;
368 struct sk_buff* skb;
369 PBYTE pbyRxBuffer;
370 unsigned int cbFrameLength;
371 BOOL bInUse;
372} SDeFragControlBlock, *PSDeFragControlBlock;
373
374
375
376
377#define DEVICE_FLAGS_UNPLUG 0x00000001UL
378#define DEVICE_FLAGS_PREAMBLE_TYPE 0x00000002UL
379#define DEVICE_FLAGS_OP_MODE 0x00000004UL
380#define DEVICE_FLAGS_PS_MODE 0x00000008UL
381#define DEVICE_FLAGS_80211h_MODE 0x00000010UL
382
383
384#define DEVICE_FLAGS_OPENED 0x00010000UL
385#define DEVICE_FLAGS_WOL_ENABLED 0x00080000UL
386
387#define DEVICE_FLAGS_TX_ALIGN 0x01000000UL
388#define DEVICE_FLAGS_HAVE_CAM 0x02000000UL
389#define DEVICE_FLAGS_FLOW_CTRL 0x04000000UL
390
391
392#define DEVICE_LINK_FAIL 0x00000001UL
393#define DEVICE_SPEED_10 0x00000002UL
394#define DEVICE_SPEED_100 0x00000004UL
395#define DEVICE_SPEED_1000 0x00000008UL
396#define DEVICE_DUPLEX_FULL 0x00000010UL
397#define DEVICE_AUTONEG_ENABLE 0x00000020UL
398#define DEVICE_FORCED_BY_EEPROM 0x00000040UL
399
400#define DEVICE_LINK_CHANGE 0x00000001UL
401
402
403typedef struct __device_opt {
404 int nRxDescs0;
405 int nTxDescs0;
406 int rts_thresh;
407 int frag_thresh;
408 int OpMode;
409 int data_rate;
410 int channel_num;
411 int short_retry;
412 int long_retry;
413 int bbp_type;
414 u32 flags;
415} OPTIONS, *POPTIONS;
416
417
418typedef struct __device_info {
419
420
421 struct usb_device* usb;
422 struct net_device* dev;
423 struct net_device_stats stats;
424
425 const struct firmware *firmware;
426
427 OPTIONS sOpts;
428
429 struct tasklet_struct CmdWorkItem;
430 struct tasklet_struct EventWorkItem;
431 struct tasklet_struct ReadWorkItem;
432 struct tasklet_struct RxMngWorkItem;
433
434 u32 rx_buf_sz;
435 int multicast_limit;
436 BYTE byRxMode;
437
438 spinlock_t lock;
439
440 u32 rx_bytes;
441
442 BYTE byRevId;
443
444 u32 flags;
445 unsigned long Flags;
446
447 SCache sDupRxCache;
448
449 SDeFragControlBlock sRxDFCB[CB_MAX_RX_FRAG];
450 unsigned int cbDFCB;
451 unsigned int cbFreeDFCB;
452 unsigned int uCurrentDFCBIdx;
453
454
455
456 struct urb *pControlURB;
457 struct urb *pInterruptURB;
458 struct usb_ctrlrequest sUsbCtlRequest;
459
460 unsigned int int_interval;
461
462
463
464 PRCB pRCBMem;
465 PRCB apRCB[CB_MAX_RX_DESC];
466 unsigned int cbRD;
467 PRCB FirstRecvFreeList;
468 PRCB LastRecvFreeList;
469 unsigned int NumRecvFreeList;
470 PRCB FirstRecvMngList;
471 PRCB LastRecvMngList;
472 unsigned int NumRecvMngList;
473 BOOL bIsRxWorkItemQueued;
474 BOOL bIsRxMngWorkItemQueued;
475 unsigned long ulRcvRefCount;
476
477
478
479
480
481 PUSB_SEND_CONTEXT apTD[CB_MAX_TX_DESC];
482 unsigned int cbTD;
483
484
485
486
487 INT_BUFFER intBuf;
488 BOOL fKillEventPollingThread;
489 BOOL bEventAvailable;
490
491
492
493 DEFAULT_CONFIG config_file;
494
495
496
497
498
499 unsigned long ulBulkInPosted;
500 unsigned long ulBulkInError;
501 unsigned long ulBulkInContCRCError;
502 unsigned long ulBulkInBytesRead;
503
504 unsigned long ulBulkOutPosted;
505 unsigned long ulBulkOutError;
506 unsigned long ulBulkOutContCRCError;
507 unsigned long ulBulkOutBytesWrite;
508
509 unsigned long ulIntInPosted;
510 unsigned long ulIntInError;
511 unsigned long ulIntInContCRCError;
512 unsigned long ulIntInBytesRead;
513
514
515
516 WORD wFirmwareVersion;
517 BYTE byLocalID;
518 BYTE byRFType;
519 BYTE byBBRxConf;
520
521
522 BYTE byZoneType;
523 BOOL bZoneRegExist;
524
525 BYTE byOriginalZonetype;
526
527 BOOL bLinkPass;
528 BYTE abyCurrentNetAddr[ETH_ALEN];
529 BYTE abyPermanentNetAddr[ETH_ALEN];
530
531
532 BOOL bExistSWNetAddr;
533
534
535 SStatCounter scStatistic;
536
537 SDot11Counters s802_11Counter;
538
539
540
541
542 unsigned long packetsReceived;
543 unsigned long packetsReceivedDropped;
544 unsigned long packetsReceivedOverflow;
545 unsigned long packetsSent;
546 unsigned long packetsSentDropped;
547 unsigned long SendContextsInUse;
548 unsigned long RcvBuffersInUse;
549
550
551
552 SMgmtObject sMgmtObj;
553
554 QWORD qwCurrTSF;
555 unsigned int cbBulkInMax;
556 BOOL bPSRxBeacon;
557
558
559 unsigned int uCurrRSSI;
560 BYTE byCurrSQ;
561
562
563
564 BOOL bTxRxAntInv;
565 DWORD dwRxAntennaSel;
566 DWORD dwTxAntennaSel;
567 BYTE byAntennaCount;
568 BYTE byRxAntennaMode;
569 BYTE byTxAntennaMode;
570 BYTE byRadioCtl;
571 BYTE bHWRadioOff;
572
573
574 struct timer_list TimerSQ3Tmax1;
575 struct timer_list TimerSQ3Tmax2;
576 struct timer_list TimerSQ3Tmax3;
577
578 BOOL bDiversityRegCtlON;
579 BOOL bDiversityEnable;
580 unsigned long ulDiversityNValue;
581 unsigned long ulDiversityMValue;
582 BYTE byTMax;
583 BYTE byTMax2;
584 BYTE byTMax3;
585 unsigned long ulSQ3TH;
586
587 unsigned long uDiversityCnt;
588 BYTE byAntennaState;
589 unsigned long ulRatio_State0;
590 unsigned long ulRatio_State1;
591 unsigned long ulSQ3_State0;
592 unsigned long ulSQ3_State1;
593
594 unsigned long aulSQ3Val[MAX_RATE];
595 unsigned long aulPktNum[MAX_RATE];
596
597
598 unsigned int uSIFS;
599 unsigned int uDIFS;
600 unsigned int uEIFS;
601 unsigned int uSlot;
602 unsigned int uCwMin;
603 unsigned int uCwMax;
604
605
606 BYTE bySIFS;
607 BYTE byDIFS;
608 BYTE byEIFS;
609 BYTE bySlot;
610 BYTE byCWMaxMin;
611
612
613 VIA_BB_TYPE byBBType;
614 VIA_PKT_TYPE byPacketType;
615 WORD wBasicRate;
616 BYTE byACKRate;
617 BYTE byTopOFDMBasicRate;
618 BYTE byTopCCKBasicRate;
619
620
621 DWORD dwAotoRateTxOkCnt;
622 DWORD dwAotoRateTxFailCnt;
623 DWORD dwErrorRateThreshold[13];
624 DWORD dwTPTable[MAX_RATE];
625 BYTE abyEEPROM[EEP_MAX_CONTEXT_SIZE];
626
627 BYTE byMinChannel;
628 BYTE byMaxChannel;
629 unsigned int uConnectionRate;
630
631 BYTE byPreambleType;
632 BYTE byShortPreamble;
633
634 BYTE eConfigPHYMode;
635
636
637 BYTE byCCKPwr;
638 BYTE byOFDMPwrG;
639 BYTE byOFDMPwrA;
640 BYTE byCurPwr;
641 BYTE abyCCKPwrTbl[14];
642 BYTE abyOFDMPwrTbl[14];
643 BYTE abyOFDMAPwrTbl[42];
644
645 WORD wCurrentRate;
646 WORD wRTSThreshold;
647 WORD wFragmentationThreshold;
648 BYTE byShortRetryLimit;
649 BYTE byLongRetryLimit;
650 CARD_OP_MODE eOPMode;
651 BOOL bBSSIDFilter;
652 WORD wMaxTransmitMSDULifetime;
653 BYTE abyBSSID[ETH_ALEN];
654 BYTE abyDesireBSSID[ETH_ALEN];
655 WORD wCTSDuration;
656 WORD wACKDuration;
657 WORD wRTSTransmitLen;
658 BYTE byRTSServiceField;
659 BYTE byRTSSignalField;
660
661 DWORD dwMaxReceiveLifetime;
662
663 BOOL bCCK;
664 BOOL bEncryptionEnable;
665 BOOL bLongHeader;
666 BOOL bSoftwareGenCrcErr;
667 BOOL bShortSlotTime;
668 BOOL bProtectMode;
669 BOOL bNonERPPresent;
670 BOOL bBarkerPreambleMd;
671
672 BYTE byERPFlag;
673 WORD wUseProtectCntDown;
674
675 BOOL bRadioControlOff;
676 BOOL bRadioOff;
677
678
679 BOOL bEnablePSMode;
680 WORD wListenInterval;
681 BOOL bPWBitOn;
682 WMAC_POWER_MODE ePSMode;
683 unsigned long ulPSModeWaitTx;
684 BOOL bPSModeTxBurst;
685
686
687 WORD wSeqCounter;
688 BOOL bBeaconBufReady;
689 BOOL bBeaconSent;
690 BOOL bFixRate;
691 BYTE byCurrentCh;
692 unsigned int uScanTime;
693
694 CMD_STATE eCommandState;
695
696 CMD_CODE eCommand;
697 BOOL bBeaconTx;
698 BYTE byScanBBType;
699
700 BOOL bStopBeacon;
701 BOOL bStopDataPkt;
702 BOOL bStopTx0Pkt;
703 unsigned int uAutoReConnectTime;
704 unsigned int uIsroamingTime;
705
706
707
708 CMD_ITEM eCmdQueue[CMD_Q_SIZE];
709 unsigned int uCmdDequeueIdx;
710 unsigned int uCmdEnqueueIdx;
711 unsigned int cbFreeCmdQueue;
712 BOOL bCmdRunning;
713 BOOL bCmdClear;
714 BOOL bNeedRadioOFF;
715
716 BOOL bEnableRoaming;
717 BOOL bIsRoaming;
718 BOOL bFastRoaming;
719 BYTE bSameBSSMaxNum;
720 BYTE bSameBSSCurNum;
721 BOOL bRoaming;
722 BOOL b11hEable;
723 unsigned long ulTxPower;
724
725
726 NDIS_802_11_WEP_STATUS eEncryptionStatus;
727 BOOL bTransmitKey;
728
729
730 NDIS_802_11_WEP_STATUS eOldEncryptionStatus;
731
732 SKeyManagement sKey;
733 DWORD dwIVCounter;
734
735
736 RC4Ext SBox;
737 BYTE abyPRNG[WLAN_WEPMAX_KEYLEN+3];
738 BYTE byKeyIndex;
739
740 BOOL bAES;
741 BYTE byCntMeasure;
742
743 unsigned int uKeyLength;
744 BYTE abyKey[WLAN_WEP232_KEYLEN];
745
746
747 unsigned int uAssocCount;
748 BOOL bMoreData;
749
750
751 BOOL bGrpAckPolicy;
752
753
754 BYTE byAutoFBCtrl;
755
756 BOOL bTxMICFail;
757 BOOL bRxMICFail;
758
759
760
761 BOOL bUpdateBBVGA;
762 unsigned int uBBVGADiffCount;
763 BYTE byBBVGANew;
764 BYTE byBBVGACurrent;
765 BYTE abyBBVGA[BB_VGA_LEVEL];
766 signed long ldBmThreshold[BB_VGA_LEVEL];
767
768 BYTE byBBPreEDRSSI;
769 BYTE byBBPreEDIndex;
770
771
772 BOOL bRadioCmd;
773 DWORD dwDiagRefCount;
774
775
776 BYTE byFOETuning;
777
778
779
780 BYTE byAutoPwrTunning;
781
782
783 BYTE byBBCR4d;
784 BYTE byBBCRc9;
785 BYTE byBBCR88;
786 BYTE byBBCR09;
787
788
789 struct timer_list sTimerCommand;
790
791 struct timer_list sTimerTxData;
792 unsigned long nTxDataTimeCout;
793 BOOL fTxDataInSleep;
794 BOOL IsTxDataTrigger;
795
796 BOOL fWPA_Authened;
797 BYTE byReAssocCount;
798 BYTE byLinkWaitCount;
799
800 SEthernetHeader sTxEthHeader;
801 SEthernetHeader sRxEthHeader;
802 BYTE abyBroadcastAddr[ETH_ALEN];
803 BYTE abySNAP_RFC1042[ETH_ALEN];
804 BYTE abySNAP_Bridgetunnel[ETH_ALEN];
805
806
807 SPMKID gsPMKID;
808 SPMKIDCandidateEvent gsPMKIDCandidate;
809
810
811
812 BOOL b11hEnable;
813
814 BOOL bChannelSwitch;
815 BYTE byNewChannel;
816 BYTE byChannelSwitchCount;
817
818
819 struct net_device *wpadev;
820 BOOL bWPADEVUp;
821 struct sk_buff *skb;
822
823
824#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
825 BOOL bwextstep0;
826 BOOL bwextstep1;
827 BOOL bwextstep2;
828 BOOL bwextstep3;
829 BOOL bWPASuppWextEnabled;
830#endif
831
832#ifdef HOSTAP
833
834 BOOL bEnableHostapd;
835 BOOL bEnable8021x;
836 BOOL bEnableHostWEP;
837 struct net_device *apdev;
838 int (*tx_80211)(struct sk_buff *skb, struct net_device *dev);
839#endif
840 unsigned int uChannel;
841
842 struct iw_statistics wstats;
843 BOOL bCommit;
844
845} DEVICE_INFO, *PSDevice;
846
847
848
849
850#define EnqueueRCB(_Head, _Tail, _RCB) \
851{ \
852 if (!_Head) { \
853 _Head = _RCB; \
854 } \
855 else { \
856 _Tail->Next = _RCB; \
857 } \
858 _RCB->Next = NULL; \
859 _Tail = _RCB; \
860}
861
862#define DequeueRCB(Head, Tail) \
863{ \
864 PRCB RCB = Head; \
865 if (!RCB->Next) { \
866 Tail = NULL; \
867 } \
868 Head = RCB->Next; \
869}
870
871
872#define ADD_ONE_WITH_WRAP_AROUND(uVar, uModulo) { \
873 if ((uVar) >= ((uModulo) - 1)) \
874 (uVar) = 0; \
875 else \
876 (uVar)++; \
877}
878
879
880#define fMP_RESET_IN_PROGRESS 0x00000001
881#define fMP_DISCONNECTED 0x00000002
882#define fMP_HALT_IN_PROGRESS 0x00000004
883#define fMP_SURPRISE_REMOVED 0x00000008
884#define fMP_RECV_LOOKASIDE 0x00000010
885#define fMP_INIT_IN_PROGRESS 0x00000020
886#define fMP_SEND_SIDE_RESOURCE_ALLOCATED 0x00000040
887#define fMP_RECV_SIDE_RESOURCE_ALLOCATED 0x00000080
888#define fMP_POST_READS 0x00000100
889#define fMP_POST_WRITES 0x00000200
890#define fMP_CONTROL_READS 0x00000400
891#define fMP_CONTROL_WRITES 0x00000800
892
893#define MP_SET_FLAG(_M, _F) ((_M)->Flags |= (_F))
894#define MP_CLEAR_FLAG(_M, _F) ((_M)->Flags &= ~(_F))
895#define MP_TEST_FLAGS(_M, _F) (((_M)->Flags & (_F)) == (_F))
896
897#define MP_IS_READY(_M) (((_M)->Flags & \
898 (fMP_DISCONNECTED | fMP_RESET_IN_PROGRESS | fMP_HALT_IN_PROGRESS | fMP_INIT_IN_PROGRESS | fMP_SURPRISE_REMOVED)) == 0)
899
900
901
902
903
904
905BOOL device_alloc_frag_buf(PSDevice pDevice, PSDeFragControlBlock pDeF);
906
907#endif
908