2 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 * Purpose: MAC Data structure
32 #include <linux/module.h>
33 #include <linux/types.h>
34 #include <linux/init.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>
53 //#include <linux/config.h>
54 #include <linux/uaccess.h>
55 #include <linux/proc_fs.h>
56 #include <linux/inetdevice.h>
57 #include <linux/reboot.h>
59 #define DEVICE_ETHTOOL_IOCTL_SUPPORT
60 #include <linux/ethtool.h>
62 #undef DEVICE_ETHTOOL_IOCTL_SUPPORT
64 /* Include Wireless Extension definition and check version - Jean II */
65 #include <linux/wireless.h>
66 #include <net/iw_handler.h> // New driver API
68 //2008-0409-07, <Add> by Einsn Liu
69 #ifndef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
70 #define WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
77 #include "device_cfg.h"
91 /*--------------------- Export Definitions -------------------------*/
93 #define MAC_MAX_CONTEXT_REG (256+128)
95 #define MAX_MULTICAST_ADDRESS_NUM 32
96 #define MULTICAST_ADDRESS_LIST_SIZE (MAX_MULTICAST_ADDRESS_NUM * ETH_ALEN)
98 #define DUPLICATE_RX_CACHE_LENGTH 5
100 #define NUM_KEY_ENTRY 11
102 #define TX_WEP_NONE 0
105 #define TX_WEP_SWOTP 3
106 #define TX_WEP_OTPSW 4
107 #define TX_WEP_SW232 5
109 #define KEYSEL_WEP40 0
110 #define KEYSEL_WEP104 1
111 #define KEYSEL_TKIP 2
112 #define KEYSEL_CCMP 3
116 #define AUTO_FB_NONE 0
126 #define ANT_DIVERSITY 2
127 #define ANT_RXD_TXA 3
128 #define ANT_RXD_TXB 4
129 #define ANT_UNKNOWN 0xFF
131 #define MAXCHECKHANGCNT 4
133 #define BB_VGA_LEVEL 4
134 #define BB_VGA_CHANGE_THRESHOLD 16
139 #define RUN_AT(x) (jiffies+(x))
143 #define RESERV_AC0DMA 4
149 #define AVAIL_TD(p,q) ((p)->sOpts.nTxDescs[(q)]-((p)->iTDUsed[(q)]))
157 #define PRIVATE_Message 0
159 /*--------------------- Export Types ------------------------------*/
162 #define DBG_PRT(l, p, args...) {if (l<=msglevel) printk( p ,##args);}
163 #define PRINT_K(p, args...) {if (PRIVATE_Message) printk( p ,##args);}
166 typedef enum _VIA_BB_TYPE
171 } VIA_BB_TYPE, *PVIA_BB_TYPE;
173 //0:11a,1:11b,2:11gb(only CCK in BasicRate),3:11ga(OFDM in Basic Rate)
174 typedef enum _VIA_PKT_TYPE
180 } VIA_PKT_TYPE, *PVIA_PKT_TYPE;
183 typedef enum __device_msg_level {
184 MSG_LEVEL_ERR=0, //Errors that will cause abnormal operation.
185 MSG_LEVEL_NOTICE=1, //Some errors need users to be notified.
186 MSG_LEVEL_INFO=2, //Normal message.
187 MSG_LEVEL_VERBOSE=3, //Will report all trival errors.
188 MSG_LEVEL_DEBUG=4 //Only for debug purpose.
189 } DEVICE_MSG_LEVEL, *PDEVICE_MSG_LEVEL;
191 typedef enum __device_init_type {
192 DEVICE_INIT_COLD=0, // cold init
193 DEVICE_INIT_RESET, // reset init or Dx to D0 power remain init
194 DEVICE_INIT_DXPL // Dx to D0 power lost init
195 } DEVICE_INIT_TYPE, *PDEVICE_INIT_TYPE;
200 #define MAX_BSSIDINFO_4_PMKID 16
201 #define MAX_PMKIDLIST 5
202 //Flags for PMKID Candidate list structure
203 #define NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED 0x01
206 typedef unsigned char NDIS_802_11_PMKID_VALUE[16];
209 typedef enum _NDIS_802_11_WEP_STATUS
211 Ndis802_11WEPEnabled,
212 Ndis802_11Encryption1Enabled = Ndis802_11WEPEnabled,
213 Ndis802_11WEPDisabled,
214 Ndis802_11EncryptionDisabled = Ndis802_11WEPDisabled,
215 Ndis802_11WEPKeyAbsent,
216 Ndis802_11Encryption1KeyAbsent = Ndis802_11WEPKeyAbsent,
217 Ndis802_11WEPNotSupported,
218 Ndis802_11EncryptionNotSupported = Ndis802_11WEPNotSupported,
219 Ndis802_11Encryption2Enabled,
220 Ndis802_11Encryption2KeyAbsent,
221 Ndis802_11Encryption3Enabled,
222 Ndis802_11Encryption3KeyAbsent
223 } NDIS_802_11_WEP_STATUS, *PNDIS_802_11_WEP_STATUS,
224 NDIS_802_11_ENCRYPTION_STATUS, *PNDIS_802_11_ENCRYPTION_STATUS;
227 typedef enum _NDIS_802_11_STATUS_TYPE
229 Ndis802_11StatusType_Authentication,
230 Ndis802_11StatusType_MediaStreamMode,
231 Ndis802_11StatusType_PMKID_CandidateList,
232 Ndis802_11StatusTypeMax // not a real type, defined as an upper bound
233 } NDIS_802_11_STATUS_TYPE, *PNDIS_802_11_STATUS_TYPE;
235 //Added new types for PMKID Candidate lists.
236 typedef struct _PMKID_CANDIDATE {
237 NDIS_802_11_MAC_ADDRESS BSSID;
239 } PMKID_CANDIDATE, *PPMKID_CANDIDATE;
242 typedef struct _BSSID_INFO
244 NDIS_802_11_MAC_ADDRESS BSSID;
245 NDIS_802_11_PMKID_VALUE PMKID;
246 } BSSID_INFO, *PBSSID_INFO;
248 typedef struct tagSPMKID {
249 unsigned long Length;
250 unsigned long BSSIDInfoCount;
251 BSSID_INFO BSSIDInfo[MAX_BSSIDINFO_4_PMKID];
254 typedef struct tagSPMKIDCandidateEvent {
255 NDIS_802_11_STATUS_TYPE StatusType;
256 unsigned long Version; // Version of the structure
257 unsigned long NumCandidates; // No. of pmkid candidates
258 PMKID_CANDIDATE CandidateList[MAX_PMKIDLIST];
259 } SPMKIDCandidateEvent, *PSPMKIDCandidateEvent;
264 #define MAX_QUIET_COUNT 8
266 typedef struct tagSQuietControl {
268 unsigned long dwStartTime;
269 unsigned char byPeriod;
270 unsigned short wDuration;
271 } SQuietControl, *PSQuietControl;
274 typedef struct __chip_info_tbl{
280 } CHIP_INFO, *PCHIP_INFO;
286 } DEVICE_OWNER_TYPE, *PDEVICE_OWNER_TYPE;
289 // The receive duplicate detection cache entry
290 typedef struct tagSCacheEntry{
291 unsigned short wFmSequence;
292 unsigned char abyAddr2[ETH_ALEN];
293 } SCacheEntry, *PSCacheEntry;
295 typedef struct tagSCache{
296 /* The receive cache is updated circularly. The next entry to be written is
297 * indexed by the "InPtr".
299 unsigned int uInPtr; // Place to use next
300 SCacheEntry asCacheEntry[DUPLICATE_RX_CACHE_LENGTH];
303 #define CB_MAX_RX_FRAG 64
304 // DeFragment Control Block, used for collecting fragments prior to reassembly
305 typedef struct tagSDeFragControlBlock
307 unsigned short wSequence;
308 unsigned short wFragNum;
309 unsigned char abyAddr2[ETH_ALEN];
310 unsigned int uLifetime;
312 unsigned char *pbyRxBuffer;
313 unsigned int cbFrameLength;
315 } SDeFragControlBlock, *PSDeFragControlBlock;
320 #define DEVICE_FLAGS_IP_ALIGN 0x00000001UL
321 #define DEVICE_FLAGS_PREAMBLE_TYPE 0x00000002UL
322 #define DEVICE_FLAGS_OP_MODE 0x00000004UL
323 #define DEVICE_FLAGS_PS_MODE 0x00000008UL
324 #define DEVICE_FLAGS_80211h_MODE 0x00000010UL
325 #define DEVICE_FLAGS_DiversityANT 0x00000020UL
327 //flags for driver status
328 #define DEVICE_FLAGS_OPENED 0x00010000UL
329 #define DEVICE_FLAGS_WOL_ENABLED 0x00080000UL
330 //flags for capbilities
331 #define DEVICE_FLAGS_TX_ALIGN 0x01000000UL
332 #define DEVICE_FLAGS_HAVE_CAM 0x02000000UL
333 #define DEVICE_FLAGS_FLOW_CTRL 0x04000000UL
335 //flags for MII status
336 #define DEVICE_LINK_FAIL 0x00000001UL
337 #define DEVICE_SPEED_10 0x00000002UL
338 #define DEVICE_SPEED_100 0x00000004UL
339 #define DEVICE_SPEED_1000 0x00000008UL
340 #define DEVICE_DUPLEX_FULL 0x00000010UL
341 #define DEVICE_AUTONEG_ENABLE 0x00000020UL
342 #define DEVICE_FORCED_BY_EEPROM 0x00000040UL
343 //for device_set_media_duplex
344 #define DEVICE_LINK_CHANGE 0x00000001UL
350 typedef struct _RxManagementQueue
354 PSRxMgmtPacket Q[NUM];
355 } RxManagementQueue,*PSRxManagementQueue;
362 typedef struct __device_opt {
363 int nRxDescs0; //Number of RX descriptors0
364 int nRxDescs1; //Number of RX descriptors1
365 int nTxDescs[2]; //Number of TX descriptors 0, 1
366 int int_works; //interrupt limits
367 int rts_thresh; //rts threshold
375 } OPTIONS, *POPTIONS;
378 typedef struct __device_info {
379 struct __device_info* next;
380 struct __device_info* prev;
382 struct pci_dev* pcid;
389 struct net_device* dev;
390 struct net_device* next_module;
391 struct net_device_stats stats;
393 //dma addr, rx/tx pool
395 dma_addr_t rd0_pool_dma;
396 dma_addr_t rd1_pool_dma;
398 dma_addr_t td0_pool_dma;
399 dma_addr_t td1_pool_dma;
401 dma_addr_t tx_bufs_dma0;
402 dma_addr_t tx_bufs_dma1;
403 dma_addr_t tx_beacon_dma;
405 unsigned char *tx0_bufs;
406 unsigned char *tx1_bufs;
407 unsigned char *tx_beacon_bufs;
411 unsigned long PortOffset;
417 unsigned char byRevId;
418 unsigned short SubSystemID;
419 unsigned short SubVendorID;
422 volatile int iTDUsed[TYPE_MAXTD];
424 volatile PSTxDesc apCurrTD[TYPE_MAXTD];
425 volatile PSTxDesc apTailTD[TYPE_MAXTD];
427 volatile PSTxDesc apTD0Rings;
428 volatile PSTxDesc apTD1Rings;
430 volatile PSRxDesc aRD0Ring;
431 volatile PSRxDesc aRD1Ring;
432 volatile PSRxDesc pCurrRD[TYPE_MAXRD];
435 SDeFragControlBlock sRxDFCB[CB_MAX_RX_FRAG];
437 unsigned int cbFreeDFCB;
438 unsigned int uCurrentDFCBIdx;
446 unsigned char byRxMode;
450 struct tasklet_struct RxMngWorkItem;
451 RxManagementQueue rxManeQueue;
455 struct completion notify;
456 struct semaphore mlme_semaphore;
463 unsigned char byLocalID;
464 unsigned char byRFType;
466 unsigned char byMaxPwrLevel;
467 unsigned char byZoneType;
469 unsigned char byOriginalZonetype;
470 unsigned char abyMacContext[MAC_MAX_CONTEXT_REG];
471 bool bLinkPass; // link status: OK or fail
472 unsigned char abyCurrentNetAddr[ETH_ALEN];
474 // Adapter statistics
475 SStatCounter scStatistic;
477 SDot11Counters s802_11Counter;
482 SMgmtObject sMgmtObj;
484 // 802.11 MAC specific
485 unsigned int uCurrRSSI;
486 unsigned char byCurrSQ;
488 unsigned long dwTxAntennaSel;
489 unsigned long dwRxAntennaSel;
490 unsigned char byAntennaCount;
491 unsigned char byRxAntennaMode;
492 unsigned char byTxAntennaMode;
495 unsigned char *pbyTmpBuff;
496 unsigned int uSIFS; //Current SIFS
497 unsigned int uDIFS; //Current DIFS
498 unsigned int uEIFS; //Current EIFS
499 unsigned int uSlot; //Current SlotTime
500 unsigned int uCwMin; //Current CwMin
501 unsigned int uCwMax; //CwMax is fixed on 1023.
503 unsigned char bySIFS;
504 unsigned char byDIFS;
505 unsigned char byEIFS;
506 unsigned char bySlot;
507 unsigned char byCWMaxMin;
508 CARD_PHY_TYPE eCurrentPHYType;
511 VIA_BB_TYPE byBBType; //0: 11A, 1:11B, 2:11G
512 VIA_PKT_TYPE byPacketType; //0:11a,1:11b,2:11gb(only CCK in BasicRate),3:11ga(OFDM in Basic Rate)
513 unsigned short wBasicRate;
514 unsigned char byACKRate;
515 unsigned char byTopOFDMBasicRate;
516 unsigned char byTopCCKBasicRate;
518 unsigned char byMinChannel;
519 unsigned char byMaxChannel;
520 unsigned int uConnectionRate;
522 unsigned char byPreambleType;
523 unsigned char byShortPreamble;
525 unsigned short wCurrentRate;
526 unsigned short wRTSThreshold;
527 unsigned short wFragmentationThreshold;
528 unsigned char byShortRetryLimit;
529 unsigned char byLongRetryLimit;
530 CARD_OP_MODE eOPMode;
531 unsigned char byOpMode;
533 unsigned short wMaxTransmitMSDULifetime;
534 unsigned char abyBSSID[ETH_ALEN];
535 unsigned char abyDesireBSSID[ETH_ALEN];
536 unsigned short wCTSDuration; // update while speed change
537 unsigned short wACKDuration; // update while speed change
538 unsigned short wRTSTransmitLen; // update while speed change
539 unsigned char byRTSServiceField; // update while speed change
540 unsigned char byRTSSignalField; // update while speed change
542 unsigned long dwMaxReceiveLifetime; // dot11MaxReceiveLifetime
545 bool bEncryptionEnable;
550 bool bBarkerPreambleMd;
552 unsigned char byERPFlag;
553 unsigned short wUseProtectCntDown;
555 bool bRadioControlOff;
558 unsigned short wListenInterval;
560 WMAC_POWER_MODE ePSMode;
563 // GPIO Radio Control
564 unsigned char byRadioCtl;
565 unsigned char byGPIO;
567 bool bPrvActive4RadioOFF;
571 unsigned short wSeqCounter;
572 unsigned short wBCNBufLen;
573 bool bBeaconBufReady;
575 bool bIsBeaconBufReadySet;
576 unsigned int cbBeaconBufReadySetCnt;
578 unsigned char byCurrentCh;
579 unsigned int uScanTime;
581 CMD_STATE eCommandState;
589 unsigned int uAutoReConnectTime;
593 CMD_ITEM eCmdQueue[CMD_Q_SIZE];
594 unsigned int uCmdDequeueIdx;
595 unsigned int uCmdEnqueueIdx;
596 unsigned int cbFreeCmdQueue;
604 unsigned char abyIPAddr[4];
606 unsigned long ulTxPower;
607 NDIS_802_11_WEP_STATUS eEncryptionStatus;
609 //2007-0925-01<Add>by MikeLiu
610 //mike add :save old Encryption
611 NDIS_802_11_WEP_STATUS eOldEncryptionStatus;
614 unsigned long dwIVCounter;
616 QWORD qwPacketNumber; //For CCMP and TKIP as TSC(6 bytes)
617 unsigned int uCurrentWEPMode;
620 unsigned char abyPRNG[WLAN_WEPMAX_KEYLEN+3];
621 unsigned char byKeyIndex;
622 unsigned int uKeyLength;
623 unsigned char abyKey[WLAN_WEP232_KEYLEN];
626 unsigned char byCntMeasure;
629 unsigned int uAssocCount;
635 // for OID_802_11_ASSOCIATION_INFORMATION
639 unsigned char byAutoFBCtrl;
645 unsigned int uRATEIdx;
648 // For Update BaseBand VGA Gain Offset
650 unsigned int uBBVGADiffCount;
651 unsigned char byBBVGANew;
652 unsigned char byBBVGACurrent;
653 unsigned char abyBBVGA[BB_VGA_LEVEL];
654 long ldBmThreshold[BB_VGA_LEVEL];
656 unsigned char byBBPreEDRSSI;
657 unsigned char byBBPreEDIndex;
661 unsigned long dwDiagRefCount;
664 unsigned char byFOETuning;
666 // For Auto Power Tunning
668 unsigned char byAutoPwrTunning;
670 short sPSetPointOFDMG;
671 short sPSetPointOFDMA;
672 long lPFormulaOffset;
677 // For RF Power table
678 unsigned char byCCKPwr;
679 unsigned char byOFDMPwrG;
680 unsigned char byCurPwr;
682 unsigned char abyCCKPwrTbl[CB_MAX_CHANNEL_24G+1];
683 unsigned char abyOFDMPwrTbl[CB_MAX_CHANNEL+1];
684 char abyCCKDefaultPwr[CB_MAX_CHANNEL_24G+1];
685 char abyOFDMDefaultPwr[CB_MAX_CHANNEL+1];
686 char abyRegPwr[CB_MAX_CHANNEL+1];
687 char abyLocalPwr[CB_MAX_CHANNEL+1];
690 // BaseBand Loopback Use
691 unsigned char byBBCR4d;
692 unsigned char byBBCRc9;
693 unsigned char byBBCR88;
694 unsigned char byBBCR09;
697 struct timer_list sTimerCommand;
699 struct timer_list sTimerTxData;
700 unsigned long nTxDataTimeCout;
702 bool IsTxDataTrigger;
705 #ifdef WPA_SM_Transtatus
706 bool fWPA_Authened; //is WPA/WPA-PSK or WPA2/WPA2-PSK authen??
708 unsigned char byReAssocCount; //mike add:re-association retry times!
709 unsigned char byLinkWaitCount;
712 unsigned char abyNodeName[17];
714 bool bDiversityRegCtlON;
715 bool bDiversityEnable;
716 unsigned long ulDiversityNValue;
717 unsigned long ulDiversityMValue;
718 unsigned char byTMax;
719 unsigned char byTMax2;
720 unsigned char byTMax3;
721 unsigned long ulSQ3TH;
724 unsigned long uDiversityCnt;
725 unsigned char byAntennaState;
726 unsigned long ulRatio_State0;
727 unsigned long ulRatio_State1;
729 //SQ3 functions for antenna diversity
730 struct timer_list TimerSQ3Tmax1;
731 struct timer_list TimerSQ3Tmax2;
732 struct timer_list TimerSQ3Tmax3;
735 unsigned long uNumSQ3[MAX_RATE];
736 unsigned short wAntDiversityMaxRate;
739 SEthernetHeader sTxEthHeader;
740 SEthernetHeader sRxEthHeader;
741 unsigned char abyBroadcastAddr[ETH_ALEN];
742 unsigned char abySNAP_RFC1042[ETH_ALEN];
743 unsigned char abySNAP_Bridgetunnel[ETH_ALEN];
744 unsigned char abyEEPROM[EEP_MAX_CONTEXT_SIZE]; //unsigned long alignment
745 // Pre-Authentication & PMK cache
747 SPMKIDCandidateEvent gsPMKIDCandidate;
752 unsigned char abyCountryCode[3];
754 unsigned int uNumOfMeasureEIDs;
755 PWLAN_IE_MEASURE_REQ pCurrMeasureEID;
756 bool bMeasureInProgress;
757 unsigned char byOrgChannel;
758 unsigned char byOrgRCR;
759 unsigned long dwOrgMAR0;
760 unsigned long dwOrgMAR4;
761 unsigned char byBasicMap;
762 unsigned char byCCAFraction;
763 unsigned char abyRPIs[8];
764 unsigned long dwRPIs[8];
766 unsigned char byNewChannel;
767 unsigned char byChannelSwitchCount;
769 bool bEnableFirstQuiet;
770 unsigned char byQuietStartCount;
771 unsigned int uQuietEnqueue;
772 unsigned long dwCurrentQuietEndTime;
773 SQuietControl sQuiet[MAX_QUIET_COUNT];
776 bool bCountryInfo24G;
778 unsigned short wBeaconInterval;
780 //WPA supplicant deamon
781 struct net_device *wpadev;
784 #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
791 unsigned int bwextcount;
792 bool bWPASuppWextEnabled;
797 // user space daemon: hostapd, is used for HOSTAP
801 struct net_device *apdev;
802 int (*tx_80211)(struct sk_buff *skb, struct net_device *dev);
804 unsigned int uChannel;
807 struct iw_statistics wstats; // wireless stats
810 } DEVICE_INFO, *PSDevice;
816 inline static void EnQueue (PSDevice pDevice,PSRxMgmtPacket pRxMgmtPacket)
818 //printk("Enter EnQueue:tail is %d\n",pDevice->rxManeQueue.tail);
819 if ((pDevice->rxManeQueue.tail+1) % NUM == pDevice->rxManeQueue.head)
821 //printk("Queue is Full,tail is %d\n",pDevice->rxManeQueue.tail);
826 pDevice->rxManeQueue.tail = (pDevice->rxManeQueue.tail+1)% NUM;
827 pDevice->rxManeQueue.Q[pDevice->rxManeQueue.tail] = pRxMgmtPacket;
828 pDevice->rxManeQueue.packet_num++;
829 //printk("packet num is %d\n",pDevice->rxManeQueue.packet_num);
836 inline static PSRxMgmtPacket DeQueue (PSDevice pDevice)
838 PSRxMgmtPacket pRxMgmtPacket;
839 if (pDevice->rxManeQueue.tail == pDevice->rxManeQueue.head)
841 printk("Queue is Empty\n");
847 //x=pDevice->rxManeQueue.head = (pDevice->rxManeQueue.head+1)%NUM;
848 pDevice->rxManeQueue.head = (pDevice->rxManeQueue.head+1)%NUM;
849 x = pDevice->rxManeQueue.head;
850 //printk("Enter DeQueue:head is %d\n",x);
851 pRxMgmtPacket = pDevice->rxManeQueue.Q[x];
852 pDevice->rxManeQueue.packet_num--;
853 return pRxMgmtPacket;
857 void InitRxManagementQueue(PSDevice pDevice);
868 inline static bool device_get_ip(PSDevice pInfo) {
869 struct in_device* in_dev=(struct in_device*) pInfo->dev->ip_ptr;
870 struct in_ifaddr* ifa;
873 ifa=(struct in_ifaddr*) in_dev->ifa_list;
875 memcpy(pInfo->abyIPAddr,&ifa->ifa_address,4);
884 static inline PDEVICE_RD_INFO alloc_rd_info(void) {
886 ptr = (PDEVICE_RD_INFO)kmalloc((int)sizeof(DEVICE_RD_INFO), (int)GFP_ATOMIC);
890 memset(ptr,0,sizeof(DEVICE_RD_INFO));
895 static inline PDEVICE_TD_INFO alloc_td_info(void) {
897 ptr = (PDEVICE_TD_INFO)kmalloc((int)sizeof(DEVICE_TD_INFO), (int)GFP_ATOMIC);
901 memset(ptr,0,sizeof(DEVICE_TD_INFO));
906 /*--------------------- Export Functions --------------------------*/
908 bool device_dma0_xmit(PSDevice pDevice, struct sk_buff *skb, unsigned int uNodeIndex);
909 bool device_alloc_frag_buf(PSDevice pDevice, PSDeFragControlBlock pDeF);
910 int Config_FileOperation(PSDevice pDevice, bool fwrite, unsigned char *Parameter);