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