ReactOS  0.4.15-dev-494-g1d8c567
nic.h
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS Realtek 8139 driver
4  * FILE: rtl8139.h
5  * PURPOSE: RTL8139 driver definitions
6  */
7 
8 #ifndef _RTL8139_PCH_
9 #define _RTL8139_PCH_
10 
11 #include <ndis.h>
12 
13 #include "rtlhw.h"
14 
15 #define ADAPTER_TAG 'Altr'
16 #define RESOURCE_LIST_TAG 'Rltr'
17 
18 #define MAX_RESET_ATTEMPTS 25
19 #define RECEIVE_BUFFER_SIZE (32768)
20 // The full receive window requires 16 bytes of padding
21 // plus 2048 for receive overflows (because of WRAP)
22 #define FULL_RECEIVE_BUFFER_SIZE (32768 + 16 + 2048)
23 #define RECV_CRC_LENGTH 4
24 
25 #define MINIMUM_FRAME_SIZE 60
26 #define MAXIMUM_FRAME_SIZE 1514
27 
28 #define DRIVER_VERSION 1
29 
30 // 1/2 packet early RX, 512 byte FIFO threshold, 32K RX buffer, unlimited DMA bursts, WRAP
31 #define RC_VAL (0x800B780)
32 
33 // 2048 byte DMA bursts
34 #define TC_VAL (0x700)
35 
36 typedef struct _RTL_ADAPTER {
39 
42 
47 
51 
54  struct {
57 
62 
66 
68 
71 
77 
87 
89 
91 NTAPI
92 NICPowerOn (
93  IN PRTL_ADAPTER Adapter
94  );
95 
97 NTAPI
99  IN PRTL_ADAPTER Adapter
100  );
101 
103 NTAPI
105  IN PRTL_ADAPTER Adapter
106  );
107 
109 NTAPI
111  IN PRTL_ADAPTER Adapter
112  );
113 
115 NTAPI
117  IN PRTL_ADAPTER Adapter
118  );
119 
121 NTAPI
123  IN PRTL_ADAPTER Adapter,
124  OUT PUCHAR MacAddress
125  );
126 
128 NTAPI
130  IN PRTL_ADAPTER Adapter
131  );
132 
134 NTAPI
136  IN PRTL_ADAPTER Adapter
137  );
138 
140 NTAPI
142  IN PRTL_ADAPTER Adapter
143  );
144 
145 USHORT
146 NTAPI
148  IN PRTL_ADAPTER Adapter,
149  OUT PBOOLEAN InterruptRecognized
150  );
151 
152 VOID
153 NTAPI
155  IN PRTL_ADAPTER Adapter
156  );
157 
158 VOID
159 NTAPI
161  IN PRTL_ADAPTER Adapter
162  );
163 
165 NTAPI
167  IN PRTL_ADAPTER Adapter,
168  IN UCHAR TxDesc,
170  IN ULONG Length
171  );
172 
174 NTAPI
176  IN NDIS_HANDLE MiniportAdapterContext,
177  IN NDIS_OID Oid,
178  IN PVOID InformationBuffer,
179  IN ULONG InformationBufferLength,
181  OUT PULONG BytesNeeded
182  );
183 
185 NTAPI
187  IN NDIS_HANDLE MiniportAdapterContext,
188  IN NDIS_OID Oid,
189  IN PVOID InformationBuffer,
190  IN ULONG InformationBufferLength,
192  OUT PULONG BytesNeeded
193  );
194 
195 VOID
196 NTAPI
197 MiniportISR (
198  OUT PBOOLEAN InterruptRecognized,
199  OUT PBOOLEAN QueueMiniportHandleInterrupt,
200  IN NDIS_HANDLE MiniportAdapterContext
201  );
202 
203 VOID
204 NTAPI
206  IN NDIS_HANDLE MiniportAdapterContext
207  );
208 
209 #endif /* _RTL8139_PCH_ */
#define IN
Definition: typedefs.h:39
#define MAXIMUM_MULTICAST_ADDRESSES
Definition: e1000hw.h:23
NDIS_STATUS NTAPI NICRegisterReceiveBuffer(IN PRTL_ADAPTER Adapter)
Definition: hardware.c:75
ULONG MediaState
Definition: nic.h:64
_Must_inspect_result_ _In_ PFILE_OBJECT _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ FLT_IO_OPERATION_FLAGS _Out_opt_ PULONG BytesWritten
Definition: fltkernel.h:1293
ULONG TransmitMoreCollisions
Definition: nic.h:86
NDIS_STATUS NTAPI NICSoftReset(IN PE1000_ADAPTER Adapter)
Definition: hardware.c:562
ULONG IoRangeStart
Definition: nic.h:40
ULONG TransmitError
Definition: nic.h:81
VOID NTAPI MiniportISR(OUT PBOOLEAN InterruptRecognized, OUT PBOOLEAN QueueMiniportHandleInterrupt, IN NDIS_HANDLE MiniportAdapterContext)
Definition: interrupt.c:16
unsigned char * PUCHAR
Definition: retypes.h:3
ULONG NDIS_OID
Definition: ntddndis.h:230
NDIS_PHYSICAL_ADDRESS ReceiveBufferPa
Definition: nic.h:60
ULONG ReceiveError
Definition: nic.h:80
BOOLEAN InterruptRegistered
Definition: nic.h:50
USHORT ReceiveOffset
Definition: nic.h:61
ULONG LinkSpeedMbps
Definition: nic.h:63
ULONG InterruptFlags
Definition: nic.h:46
int NDIS_STATUS
Definition: ntddndis.h:471
ULONG InterruptLevel
Definition: nic.h:44
NDIS_MINIPORT_INTERRUPT Interrupt
Definition: nic.h:49
BOOLEAN InterruptShared
Definition: nic.h:45
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
ULONG TransmitOk
Definition: nic.h:79
USHORT InterruptPending
Definition: nic.h:70
NDIS_STATUS NTAPI NICTransmitPacket(IN PE1000_ADAPTER Adapter, IN PHYSICAL_ADDRESS PhysicalAddress, IN ULONG Length)
Definition: hardware.c:825
unsigned char BOOLEAN
ULONG InterruptVector
Definition: nic.h:43
UCHAR DirtyTxDesc
Definition: nic.h:72
struct _RTL_ADAPTER::@1002 MulticastList[MAXIMUM_MULTICAST_ADDRESSES]
ULONG IoRangeLength
Definition: nic.h:41
ULONG ReceiveNoBufferSpace
Definition: nic.h:82
USHORT InterruptMask
Definition: nic.h:69
VOID NTAPI MiniportHandleInterrupt(IN NDIS_HANDLE MiniportAdapterContext)
Definition: interrupt.c:40
UCHAR CurrentTxDesc
Definition: nic.h:73
NDIS_STATUS NTAPI MiniportQueryInformation(IN NDIS_HANDLE MiniportAdapterContext, IN NDIS_OID Oid, IN PVOID InformationBuffer, IN ULONG InformationBufferLength, OUT PULONG BytesWritten, OUT PULONG BytesNeeded)
Definition: info.c:51
BOOLEAN LinkChange
Definition: nic.h:65
BOOLEAN TxFull
Definition: nic.h:74
ULONG ReceiveOk
Definition: nic.h:78
#define IEEE_802_ADDR_LENGTH
Definition: e1000hw.h:11
VOID NTAPI NICUpdateLinkStatus(IN PE1000_ADAPTER Adapter)
Definition: hardware.c:808
ULONG ReceiveCrcError
Definition: nic.h:83
NDIS_SPIN_LOCK Lock
Definition: nic.h:38
NDIS_STATUS NTAPI NICEnableTxRx(IN PE1000_ADAPTER Adapter)
Definition: hardware.c:605
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS PhysicalAddress
Definition: iotypes.h:1063
unsigned char UCHAR
Definition: xmlstorage.h:181
char * PBOOLEAN
Definition: retypes.h:11
NDIS_PHYSICAL_ADDRESS RuntTxBuffersPa
Definition: nic.h:76
PUCHAR IoBase
Definition: nic.h:48
NDIS_STATUS NTAPI NICDisableInterrupts(IN PE1000_ADAPTER Adapter)
Definition: hardware.c:779
NDIS_STATUS NTAPI NICApplyInterruptMask(IN PE1000_ADAPTER Adapter)
Definition: hardware.c:768
struct _RTL_ADAPTER RTL_ADAPTER
NDIS_HANDLE MiniportAdapterHandle
Definition: nic.h:37
ULONG ReceiveBufferLength
Definition: nic.h:58
NDIS_STATUS NTAPI NICPowerOn(IN PE1000_ADAPTER Adapter)
Definition: hardware.c:540
struct _RTL_ADAPTER * PRTL_ADAPTER
ULONG ReceiveAlignmentError
Definition: nic.h:84
unsigned short USHORT
Definition: pedump.c:61
ULONG NTAPI NICInterruptRecognized(IN PE1000_ADAPTER Adapter, OUT PBOOLEAN InterruptRecognized)
Definition: hardware.c:790
unsigned int * PULONG
Definition: retypes.h:1
UCHAR CurrentMacAddress[IEEE_802_ADDR_LENGTH]
Definition: nic.h:53
#define OUT
Definition: typedefs.h:40
NDIS_STATUS NTAPI NICRemoveReceiveBuffer(IN PRTL_ADAPTER Adapter)
Definition: hardware.c:88
unsigned int ULONG
Definition: retypes.h:1
ULONG PacketFilter
Definition: nic.h:67
UCHAR PermanentMacAddress[IEEE_802_ADDR_LENGTH]
Definition: nic.h:52
NDIS_STATUS NTAPI NICGetPermanentMacAddress(IN PE1000_ADAPTER Adapter, OUT PUCHAR MacAddress)
Definition: hardware.c:692
VOID NTAPI NICAcknowledgeInterrupts(IN PRTL_ADAPTER Adapter)
Definition: hardware.c:167
NDIS_STATUS NTAPI MiniportSetInformation(IN NDIS_HANDLE MiniportAdapterContext, IN NDIS_OID Oid, IN PVOID InformationBuffer, IN ULONG InformationBufferLength, OUT PULONG BytesRead, OUT PULONG BytesNeeded)
Definition: info.c:232
ULONG TransmitOneCollision
Definition: nic.h:85
_Must_inspect_result_ _In_ PFILE_OBJECT _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ FLT_IO_OPERATION_FLAGS _Out_opt_ PULONG BytesRead
Definition: fltkernel.h:1255
NDIS_STATUS NTAPI NICApplyPacketFilter(IN PE1000_ADAPTER Adapter)
Definition: hardware.c:752
PUCHAR ReceiveBuffer
Definition: nic.h:59
UCHAR MacAddress[IEEE_802_ADDR_LENGTH]
Definition: nic.h:55
PUCHAR RuntTxBuffers
Definition: nic.h:75