📄 nicdata.h
字号:
/*******************************************************************************
*** Note: Copy rights resevered to Beijing Pacific Linkair Communications Co.
***
*** File Name: NICData.h
*** Purpose : NIC Data Type Definitions
***
*** Author : Guangzhao Tian
*** Modified : By Guangzhao Tian at 2000/9/7
***
**/
/* the maximum nodes number of dpd/upd lists ,default value is 16=0x10*/
#define MAXIMUM_SCATTER_GATHER_LIST 0x10
/* the frame size of Ethernet Packet @ (60 , 1514)*/
#define ETHERNET_MAXIMUM_FRAME_SIZE 1514
#define ETHERNET_MINIMUM_FRAME_SIZE 60
/* Software limits defined here.*/
#define NIC_DEFAULT_SEND_COUNT 0x10
#define NIC_DEFAULT_RECEIVE_COUNT 0x10
#define NIC_MINIMUM_SEND_COUNT 0x2
#define NIC_MAXIMUM_SEND_COUNT 0x20
#define NIC_MINIMUM_RECEIVE_COUNT 0x2
#define NIC_MAXIMUM_RECEIVE_COUNT 0x20
#define ETHERNET_MULTICAST_BIT 1
/*** Storeage of Ethernet Address**/
#define ETHERNET_ADDRESS_SIZE 6
typedef struct _ETHNET_ADDRESS_INFORMATION
{
BYTE EthernetAddress[ETHERNET_ADDRESS_SIZE];
} ETHNET_ADDRESS_INFORMATION, *PETHNET_ADDRESS_INFORMATION;
/*** the structure to hold the PCI System Information from the BSP**/
typedef struct _NIC_PCI_INFORMATION
{
BOOLEAN bPCIIntilized;
DWORD BusNo;
DWORD SlotNo;
DWORD FunctionNo;
WORD VerdorID;
WORD DeviceID;
DWORD ClassCode;
BYTE CacheLineSize;
DWORD IoBaseAddress;
DWORD MemBaseAddress;
BYTE InterruptVector;
BYTE InterruptPin;
} NIC_PCI_INFORMATION, * pNIC_PCI_INFORMATION;
/**** this struct hold the EEPROM Information in NIC information***/
typedef struct _NIC_EEPROM_INFORMATION
{
WORD wDeviceID;
WORD wOEMNodeAddress[3];
WORD wCapabilitiesWord;
WORD wMediaOptions;
WORD wInternalConfigWord[2];
WORD wPCIParam;
WORD wSoftwareInfo1;
WORD wCompatibilityWord;
WORD wSoftwareInfo2;
WORD wAnalogDiagnostic;
WORD wSoftWareInfo3;
WORD wLANWorksData;
WORD wSubSysVendorID;
WORD wSubSystemID;
} NIC_EEPROM_INFORMATION, * PNIC_EEPROM_INFORMATION;
/****-- this structure hold the setting of Receive mode in the NIC information ---***/
#define RxINDIVIDUAL 0x01 /*receive only the packes matching the station address*/
#define RxMULTICAST 0x02 /*receive all multicast packets , including Broadcast*/
#define RxBROADCAST 0x04 /*receive Broad cast Packets*/
#define RxPROMISCUOUS 0x08 /*receive all packets , promiscuous mode*/
#define RxMULTICASTHASH 0x10 /*receive multicast packets according to hash filter*/
typedef struct _NIC_RxMode_INFORMATION
{
DWORD lReceiveMode;
WORD wStationAddr[3];
} NIC_RxMode_INFORMATION , * PNIC_RxMode_INFORMATION ;
/****--- this structure hold the NIC Statistics information ---------***/
typedef struct _NIC_STATISTICS
{
/* Transmit statistics.*/
DWORD TxFramesOk;
DWORD TxBytesOk;
DWORD TxFramesDeferred;
DWORD TxSingleCollisions;
DWORD TxMultipleCollisions;
DWORD TxLateCollisions;
DWORD TxCarrierLost;
DWORD TxReclaimError;
DWORD TxStackOverFlow;
DWORD TxMaximumCollisions;
DWORD TxSQEErrors;
DWORD TxHWErrors;
DWORD TxJabberError;
DWORD TxUnknownError;
DWORD TxLastPackets;
DWORD TxLastCollisions;
DWORD TxLastDeferred;
/* Receive statistics. */
DWORD RxFramesOk;
DWORD RxBytesOk;
DWORD RxOverruns;
DWORD RxBadSSD;
DWORD RxAlignmentError;
DWORD RxBadCRCError;
DWORD RxOversizeError;
DWORD RxNoBuffer;
DWORD RxLastPackets;
DWORD UpdateInterval;
/* Multicasts statistics*/
DWORD Rx_MulticastPkts;
} NIC_STATISTICS, *PNIC_STATISTICS;
/********--- Below are Media Information Data Structure ----------************/
/**** NIC Connector Type structure *****/
typedef enum _CONNECTOR_TYPE
{
CONNECTOR_10BASET = 0,
CONNECTOR_10AUI = 1,
CONNECTOR_10BASE2 = 3,
CONNECTOR_100BASETX = 4,
CONNECTOR_100BASEFX = 5,
CONNECTOR_MII = 6,
CONNECTOR_AUTONEGOTIATION = 8,
CONNECTOR_EXTERNAL_MII = 9,
CONNECTOR_UNKNOWN = 0xFF
} CONNECTOR_TYPE, *PCONNECTOR_TYPE;
/***** NIC Link State ******/
typedef enum _LINK_STATE
{
LINK_UP = 0, /* Link established */
LINK_DOWN = 1, /* Link lost */
LINK_DOWN_AT_INIT = 2 /* Link lost and needs notification to NDIS */
} LINK_STATE;
#define LINK_SPEED_100 100000000L
#define LINK_SPEED_10 10000000L
typedef struct _NIC_LINK_INFORMATION
{
LINK_STATE LinkState;
DWORD MediaOptions;
CONNECTOR_TYPE ConfigConnector;
BOOLEAN AutoSelect;
BOOLEAN FlowControlSupported;
CONNECTOR_TYPE Connector;
DWORD LinkSpeed;
BOOLEAN FullDuplexEnable;
BOOLEAN FlowControlEnable;
WORD MIIPhyUsed;
/* BOOLEAN SQEDisable;
BOOLEAN LightTen;
BOOLEAN LinkBeatDisable;
BOOLEAN BroadcastErrDone;
BOOLEAN UDPChecksumErrDone;
BOOLEAN MWIErrDone; */
} NIC_LINK_INFORMATION , * PNIC_LINK_INFORMATION;
/************------ End of Link Information Structures -------*************/
/****NIC hardware infromation hoder structure*/
#define HARDWARE_STATUS_WORKING 0x0
#define HARDWARE_STATUS_HUNG 0x1
#define HARDWARE_STATUS_FAILURE 0x2
typedef struct _NIC_HARDWARE_INFORMATION
{
BYTE CacheLineSize;
BYTE RevisionId;
WORD DeviceId;
BYTE Status;
/*
BOOLEAN WOLConnectorPresent;
BOOLEAN AutoResetToD0;
*/
} NIC_HARDWARE_INFORMATION , *PNIC_HARDWARE_INFORMATION;
/* Nodes defination for UPD/DPD lists,including Address and length of data fragments */
typedef struct _DATA_FRAGMENT_NODE
{
PPCIADDR nFragAddrPCI; /*must be PCI Mem Address*/
DWORD nFragLength;
} DATA_FRAGMENT_NODE , * PDATA_FRAGMENT_NODE;
/* Dpd list node defination */
typedef struct _DPD_LIST_ENTRY
{
PPCIADDR DownNextPointerPCI; /*must be PCI Mem Address*/
DWORD FrameStartHeader;
DATA_FRAGMENT_NODE DPDFragNode[MAXIMUM_SCATTER_GATHER_LIST];
struct _DPD_LIST_ENTRY * pNext;
struct _DPD_LIST_ENTRY * pPrevious;
PPCIADDR ThisDPDAddrPCI; /*to hold the PCI Memory Addres of this DPD*/
/* PVOID ThisDPDTxBuffer;
DWORD PacketLength; */
} DPD_LIST_ENTRY, *PDPD_LIST_ENTRY;
/* Upd list node defination */
typedef struct _UPD_LIST_ENTRY
{
PPCIADDR UpNextPointerPCI; /*must be PCI Mem Address*/
DWORD UpPacketStatus;
DATA_FRAGMENT_NODE UPDFragNode[1]; /*we need only one memory fragment per UPD, which is big
enough to hold the data upload*/
struct _UPD_LIST_ENTRY * pNext;
struct _UPD_LIST_ENTRY * pPrevious;
PPCIADDR ThisUPDAddrPCI;
void * pThisUPDRxBuffer;
/* DWORD PacketLength; */
} UPD_LIST_ENTRY , *PUPD_LIST_ENTRY;
/**** Storeage of NIC Resources***/
typedef struct _NIC_RESOURCES_INFORMATIPON
{
DWORD nUPDNodeCount;
DWORD nDPDNodeCount;
DWORD lUPDMemOneSize;
DWORD lUPDMemTotalSize;
DWORD lDPDMemOneSize;
DWORD lDPDMemTotalSize;
DWORD lRxDataBufferOneSize;
DWORD lSharedMemorySize;
DWORD lSharedMemoryBase;
DWORD lSharedMemUPDBase;
DWORD lSharedMemDPDBase;
PPCIADDR pSharedMemoryBasePCI;
PPCIADDR pSharedMemUPDBasePCI;
PPCIADDR pSharedMemDPDBasePCI;
UPD_LIST_ENTRY * pHeadUPD;
DPD_LIST_ENTRY * pHeadDPD;
DPD_LIST_ENTRY * pTailDPD;
BOOLEAN DPDRingFull;
DWORD dwHostResourcesReserved;
DWORD InterruptNumber;
/* TIMER Timer;
DWORD BytesInDPDQueue;
TASKQ hostErr_task;
DWORD TimerInterval;
DWORD DownPollRate; */
} NIC_RESOURCES_INFORMATIPON , *PNIC_RESOURCES_INFORMATIPON ;
/* the global NIC Information holder structure ,which should be acssible all the time */
typedef struct _NIC_INFORMATION
{
DWORD IoBaseAddress;
DWORD MemBaseAddress;
INT InterruptVector;
BYTE DeviceName[8];
/* BYTE StationAddress[6];
BYTE PermanentAddress[6]; */
NIC_PCI_INFORMATION PCIInfo;
NIC_EEPROM_INFORMATION EEPROMInfo;
NIC_RxMode_INFORMATION RxMode;
NIC_STATISTICS Statistics;
/* ENET_STATISTICS EnetStatistics; */
NIC_LINK_INFORMATION LinkInfo;
NIC_HARDWARE_INFORMATION Hardware;
NIC_RESOURCES_INFORMATIPON Resources;
/*
BOOLEAN InTimer;
BOOLEAN DelayStart;
INT Index;
PACKET_PENDING_QUEUE PendingQueue;
DWORD TxPendingQueueCount;
BOOLEAN DeviceGivenByOS;
DWORD keepForGlobalReset;
NIC_WAIT_CASES WaitCases; */
} NIC_INFORMATION, *PNIC_INFORMATION;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -