📄 desc.h
字号:
/* * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc. * All rights reserved. * * This software is copyrighted by and is the sole property of * VIA Networking Technologies, Inc. This software may only be used * in accordance with the corresponding license agreement. Any unauthorized * use, duplication, transmission, distribution, or disclosure of this * software is expressly forbidden. * * This software is provided by VIA Networking Technologies, Inc. "as is" * and any express or implied warranties, including, but not limited to, the * implied warranties of merchantability and fitness for a particular purpose * are disclaimed. In no event shall VIA Networking Technologies, Inc. * be liable for any direct, indirect, incidental, special, exemplary, or * consequential damages. * * File: desc.h * * Purpose:The header file of descriptor * * Revision History: * * Author: Tevin Chen * * Date: May 21, 1996 * */ #ifndef __DESC_H__#define __DESC_H__#include <linux/types.h>#include <linux/mm.h>#if !defined(__TTYPE_H__)#include "ttype.h"#endif#if !defined(__TETHER_H__)#include "tether.h"#endif/*--------------------- Export Definitions -------------------------*/// max transmit or receive buffer size#define CB_MAX_BUF_SIZE 2900U // max buffer size // NOTE: must be multiple of 4 #define CB_MAX_TX_BUF_SIZE CB_MAX_BUF_SIZE // max Tx buffer size#define CB_MAX_RX_BUF_SIZE_NORMAL CB_MAX_BUF_SIZE // max Rx buffer size when not use Multi-RD#define CB_BEACON_BUF_SIZE 512U // default beacon buffer size#define MAX_TOTAL_SIZE_WITH_ALL_HEADERS CB_MAX_BUF_SIZE#define MAX_INTERRUPT_SIZE 32#define RX_BLOCKS 64 // form 0x60 to 0xA0#define TX_BLOCKS 32 // from 0xA0 to 0xC0#define CB_MAX_RX_DESC 128 // max # of descriptor#define CB_MIN_RX_DESC 16 // min # of rx descriptor#define CB_MAX_TX_DESC 128 // max # of descriptor#define CB_MIN_TX_DESC 16 // min # of tx descriptor#define CB_RD_NUM 64 // default # of RD#define CB_TD_NUM 64 // default # of TD//// Bits in the RSR register//#define RSR_ADDRBROAD 0x80 // 1000 0000#define RSR_ADDRMULTI 0x40 // 0100 0000#define RSR_ADDRUNI 0x00 // 0000 0000#define RSR_IVLDTYP 0x20 // 0010 0000 , invalid packet type#define RSR_IVLDLEN 0x10 // 0001 0000 , invalid len (> 2312 byte)#define RSR_BSSIDOK 0x08 // 0000 1000#define RSR_CRCOK 0x04 // 0000 0100#define RSR_BCNSSIDOK 0x02 // 0000 0010#define RSR_ADDROK 0x01 // 0000 0001//// Bits in the new RSR register//#define NEWRSR_DECRYPTOK 0x10 // 0001 0000#define NEWRSR_CFPIND 0x08 // 0000 1000#define NEWRSR_HWUTSF 0x04 // 0000 0100#define NEWRSR_BCNHITAID 0x02 // 0000 0010#define NEWRSR_BCNHITAID0 0x01 // 0000 0001//// Bits in the TSR register//#define TSR_RETRYTMO 0x08 // 0000 1000#define TSR_TMO 0x04 // 0000 0100#define TSR_ACKDATA 0x02 // 0000 0010#define TSR_VALID 0x01 // 0000 0001#define CB_PROTOCOL_RESERVED_SECTION 16// if retrys excess 15 times , tx will abort, and// if tx fifo underflow, tx will fail// we should try to resend it#define CB_MAX_TX_ABORT_RETRY 3#define FIFOCTL_AUTO_FB_1 0x1000 // 0001 0000 0000 0000#define FIFOCTL_AUTO_FB_0 0x0800 // 0000 1000 0000 0000#define FIFOCTL_GRPACK 0x0400 // 0000 0100 0000 0000#define FIFOCTL_11GA 0x0300 // 0000 0011 0000 0000#define FIFOCTL_11GB 0x0200 // 0000 0010 0000 0000#define FIFOCTL_11B 0x0100 // 0000 0001 0000 0000#define FIFOCTL_11A 0x0000 // 0000 0000 0000 0000#define FIFOCTL_RTS 0x0080 // 0000 0000 1000 0000#define FIFOCTL_ISDMA0 0x0040 // 0000 0000 0100 0000#define FIFOCTL_GENINT 0x0020 // 0000 0000 0010 0000#define FIFOCTL_TMOEN 0x0010 // 0000 0000 0001 0000#define FIFOCTL_LRETRY 0x0008 // 0000 0000 0000 1000#define FIFOCTL_CRCDIS 0x0004 // 0000 0000 0000 0100#define FIFOCTL_NEEDACK 0x0002 // 0000 0000 0000 0010#define FIFOCTL_LHEAD 0x0001 // 0000 0000 0000 0001//WMAC definition Frag Control#define FRAGCTL_AES 0x0300 // 0000 0011 0000 0000#define FRAGCTL_TKIP 0x0200 // 0000 0010 0000 0000#define FRAGCTL_LEGACY 0x0100 // 0000 0001 0000 0000#define FRAGCTL_NONENCRYPT 0x0000 // 0000 0000 0000 0000//#define FRAGCTL_AC3 0x000C // 0000 0000 0000 1100//#define FRAGCTL_AC2 0x0008 // 0000 0000 0000 1000//#define FRAGCTL_AC1 0x0004 // 0000 0000 0000 0100//#define FRAGCTL_AC0 0x0000 // 0000 0000 0000 0000#define FRAGCTL_ENDFRAG 0x0003 // 0000 0000 0000 0011#define FRAGCTL_MIDFRAG 0x0002 // 0000 0000 0000 0010#define FRAGCTL_STAFRAG 0x0001 // 0000 0000 0000 0001#define FRAGCTL_NONFRAG 0x0000 // 0000 0000 0000 0000//#define TYPE_AC0DMA 0//#define TYPE_TXDMA0 1#define TYPE_TXDMA0 0#define TYPE_AC0DMA 1#define TYPE_ATIMDMA 2#define TYPE_SYNCDMA 3#define TYPE_MAXTD 2#define TYPE_BEACONDMA 4#define TYPE_RXDMA0 0#define TYPE_RXDMA1 1#define TYPE_MAXRD 2// TD_INFO flags control bit#define TD_FLAGS_NETIF_SKB 0x01 // check if need release skb#define TD_FLAGS_PRIV_SKB 0x02 // check if called from private skb(hostap)#define TD_FLAGS_PS_RETRY 0x04 // check if PS STA frame re-transmit//#define TD_FLAGS_NETIF_SKB 0x04/*--------------------- Export Types ------------------------------*///// RsvTime buffer header//typedef struct tagSRrvTime_gRTS { WORD wRTSTxRrvTime_ba; WORD wRTSTxRrvTime_aa; WORD wRTSTxRrvTime_bb; WORD wReserved; WORD wTxRrvTime_b; WORD wTxRrvTime_a;}__attribute__ ((__packed__)) SRrvTime_gRTS, DEF* PSRrvTime_gRTS;typedef const SRrvTime_gRTS DEF* PCSRrvTime_gRTS;typedef struct tagSRrvTime_gCTS { WORD wCTSTxRrvTime_ba; WORD wReserved; WORD wTxRrvTime_b; WORD wTxRrvTime_a;}__attribute__ ((__packed__)) SRrvTime_gCTS, DEF* PSRrvTime_gCTS;typedef const SRrvTime_gCTS DEF* PCSRrvTime_gCTS;typedef struct tagSRrvTime_ab { WORD wRTSTxRrvTime; WORD wTxRrvTime;}__attribute__ ((__packed__)) SRrvTime_ab, DEF* PSRrvTime_ab;typedef const SRrvTime_ab DEF* PCSRrvTime_ab;typedef struct tagSRrvTime_atim { WORD wCTSTxRrvTime_ba; WORD wTxRrvTime_a;}__attribute__ ((__packed__)) SRrvTime_atim, DEF* PSRrvTime_atim;typedef const SRrvTime_atim DEF* PCSRrvTime_atim;//// RTS buffer header//typedef struct tagSRTSData { WORD wFrameControl; WORD wDurationID; BYTE abyRA[U_ETHER_ADDR_LEN]; BYTE abyTA[U_ETHER_ADDR_LEN];}__attribute__ ((__packed__)) SRTSData, DEF* PSRTSData;typedef const SRTSData DEF* PCSRTSData;typedef struct tagSRTS_g { BYTE bySignalField_b; BYTE byServiceField_b; WORD wTransmitLength_b; BYTE bySignalField_a; BYTE byServiceField_a; WORD wTransmitLength_a; WORD wDuration_ba; WORD wDuration_aa; WORD wDuration_bb; WORD wReserved; SRTSData Data;}__attribute__ ((__packed__)) SRTS_g, DEF* PSRTS_g;typedef const SRTS_g DEF* PCSRTS_g;typedef struct tagSRTS_g_FB { BYTE bySignalField_b; BYTE byServiceField_b; WORD wTransmitLength_b; BYTE bySignalField_a; BYTE byServiceField_a; WORD wTransmitLength_a; WORD wDuration_ba; WORD wDuration_aa; WORD wDuration_bb; WORD wReserved; WORD wRTSDuration_ba_f0; WORD wRTSDuration_aa_f0; WORD wRTSDuration_ba_f1; WORD wRTSDuration_aa_f1; SRTSData Data;}__attribute__ ((__packed__)) SRTS_g_FB, DEF* PSRTS_g_FB;typedef const SRTS_g_FB DEF* PCSRTS_g_FB;typedef struct tagSRTS_ab { BYTE bySignalField; BYTE byServiceField; WORD wTransmitLength; WORD wDuration; WORD wReserved; SRTSData Data;}__attribute__ ((__packed__))SRTS_ab, DEF* PSRTS_ab;typedef const SRTS_ab DEF* PCSRTS_ab;typedef struct tagSRTS_a_FB { BYTE bySignalField; BYTE byServiceField; WORD wTransmitLength; WORD wDuration; WORD wReserved; WORD wRTSDuration_f0; WORD wRTSDuration_f1; SRTSData Data;}__attribute__ ((__packed__)) SRTS_a_FB, DEF* PSRTS_a_FB;typedef const SRTS_a_FB DEF* PCSRTS_a_FB;//// CTS buffer header//typedef struct tagSCTSData { WORD wFrameControl; WORD wDurationID; BYTE abyRA[U_ETHER_ADDR_LEN]; WORD wReserved;}__attribute__ ((__packed__)) SCTSData, DEF* PSCTSData;typedef struct tagSCTS { BYTE bySignalField_b; BYTE byServiceField_b; WORD wTransmitLength_b; WORD wDuration_ba; WORD wReserved; SCTSData Data;}__attribute__ ((__packed__)) SCTS, DEF* PSCTS;typedef const SCTS DEF* PCSCTS;typedef struct tagSCTS_FB { BYTE bySignalField_b; BYTE byServiceField_b; WORD wTransmitLength_b; WORD wDuration_ba; WORD wReserved; WORD wCTSDuration_ba_f0; WORD wCTSDuration_ba_f1; SCTSData Data;}__attribute__ ((__packed__)) SCTS_FB, DEF* PSCTS_FB;typedef const SCTS_FB DEF* PCSCTS_FB;//// Tx FIFO header//typedef struct tagSTxBufHead { DWORD adwTxKey[4]; WORD wFIFOCtl; WORD wTimeStamp; WORD wFragCtl; WORD wReserved;}__attribute__ ((__packed__)) STxBufHead, DEF* PSTxBufHead;typedef const STxBufHead DEF* PCSTxBufHead;typedef struct tagSTxShortBufHead { WORD wFIFOCtl; WORD wTimeStamp;}__attribute__ ((__packed__)) STxShortBufHead, DEF* PSTxShortBufHead;typedef const STxShortBufHead DEF* PCSTxShortBufHead;//// Tx data header//typedef struct tagSTxDataHead_g { BYTE bySignalField_b; BYTE byServiceField_b; WORD wTransmitLength_b; BYTE bySignalField_a; BYTE byServiceField_a; WORD wTransmitLength_a; WORD wDuration_b; WORD wDuration_a; WORD wTimeStampOff_b; WORD wTimeStampOff_a;}__attribute__ ((__packed__)) STxDataHead_g, DEF* PSTxDataHead_g;typedef const STxDataHead_g DEF* PCSTxDataHead_g;typedef struct tagSTxDataHead_g_FB { BYTE bySignalField_b; BYTE byServiceField_b; WORD wTransmitLength_b; BYTE bySignalField_a; BYTE byServiceField_a; WORD wTransmitLength_a; WORD wDuration_b; WORD wDuration_a; WORD wDuration_a_f0; WORD wDuration_a_f1; WORD wTimeStampOff_b; WORD wTimeStampOff_a;}__attribute__ ((__packed__)) STxDataHead_g_FB, DEF* PSTxDataHead_g_FB;typedef const STxDataHead_g_FB DEF* PCSTxDataHead_g_FB;typedef struct tagSTxDataHead_ab { BYTE bySignalField; BYTE byServiceField; WORD wTransmitLength; WORD wDuration; WORD wTimeStampOff;}__attribute__ ((__packed__))STxDataHead_ab, DEF* PSTxDataHead_ab;typedef const STxDataHead_ab DEF* PCSTxDataHead_ab;typedef struct tagSTxDataHead_a_FB { BYTE bySignalField; BYTE byServiceField; WORD wTransmitLength; WORD wDuration; WORD wTimeStampOff; WORD wDuration_f0; WORD wDuration_f1;}__attribute__ ((__packed__)) STxDataHead_a_FB, DEF* PSTxDataHead_a_FB;typedef const STxDataHead_a_FB DEF* PCSTxDataHead_a_FB;//// MICHDR data header//typedef struct tagSMICHDRHead { DWORD adwHDR0[4]; DWORD adwHDR1[4]; DWORD adwHDR2[4];}__attribute__ ((__packed__))SMICHDRHead, DEF* PSMICHDRHead;typedef const SMICHDRHead DEF* PCSMICHDRHead;typedef struct tagSBEACONCtl { DWORD BufReady : 1; DWORD TSF : 15; DWORD BufLen : 11; DWORD Reserved : 5;}__attribute__ ((__packed__))SBEACONCtl;typedef struct tagSSecretKey { DWORD dwLowDword; BYTE byHighByte;}__attribute__ ((__packed__)) SSecretKey;typedef struct tagSKeyEntry { BYTE abyAddrHi[2]; WORD wKCTL; BYTE abyAddrLo[4]; DWORD dwKey0[4]; DWORD dwKey1[4]; DWORD dwKey2[4]; DWORD dwKey3[4]; DWORD dwKey4[4];}__attribute__ ((__packed__)) SKeyEntry;/*--------------------- Export Macros ------------------------------*//*--------------------- Export Classes ----------------------------*//*--------------------- Export Variables --------------------------*//*--------------------- Export Functions --------------------------*/#endif // __DESC_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -