ReactOS 0.4.15-dev-7889-g76290a6
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
36typedef struct _RTL_ADAPTER {
39
42
47
51
54 struct {
57
62
66
68
71
77
87
89
93 IN PRTL_ADAPTER Adapter
94 );
95
99 IN PRTL_ADAPTER Adapter
100 );
101
103NTAPI
105 IN PRTL_ADAPTER Adapter
106 );
107
109NTAPI
111 IN PRTL_ADAPTER Adapter
112 );
113
115NTAPI
117 IN PRTL_ADAPTER Adapter
118 );
119
121NTAPI
123 IN PRTL_ADAPTER Adapter,
124 OUT PUCHAR MacAddress
125 );
126
128NTAPI
130 IN PRTL_ADAPTER Adapter
131 );
132
134NTAPI
136 IN PRTL_ADAPTER Adapter
137 );
138
140NTAPI
142 IN PRTL_ADAPTER Adapter
143 );
144
145USHORT
146NTAPI
148 IN PRTL_ADAPTER Adapter,
149 OUT PBOOLEAN InterruptRecognized
150 );
151
152VOID
153NTAPI
155 IN PRTL_ADAPTER Adapter
156 );
157
158VOID
159NTAPI
161 IN PRTL_ADAPTER Adapter
162 );
163
165NTAPI
167 IN PRTL_ADAPTER Adapter,
168 IN UCHAR TxDesc,
171 );
172
174NTAPI
176 IN NDIS_HANDLE MiniportAdapterContext,
177 IN NDIS_OID Oid,
178 IN PVOID InformationBuffer,
179 IN ULONG InformationBufferLength,
181 OUT PULONG BytesNeeded
182 );
183
185NTAPI
187 IN NDIS_HANDLE MiniportAdapterContext,
188 IN NDIS_OID Oid,
189 IN PVOID InformationBuffer,
190 IN ULONG InformationBufferLength,
192 OUT PULONG BytesNeeded
193 );
194
195VOID
196NTAPI
198 OUT PBOOLEAN InterruptRecognized,
199 OUT PBOOLEAN QueueMiniportHandleInterrupt,
200 IN NDIS_HANDLE MiniportAdapterContext
201 );
202
203VOID
204NTAPI
206 IN NDIS_HANDLE MiniportAdapterContext
207 );
208
209#endif /* _RTL8139_PCH_ */
#define NICDisableInterrupts(Adapter)
Definition: 8390.h:159
unsigned char BOOLEAN
NDIS_STATUS NTAPI NICPowerOn(IN PE1000_ADAPTER Adapter)
Definition: hardware.c:509
NDIS_STATUS NTAPI NICEnableTxRx(IN PE1000_ADAPTER Adapter)
Definition: hardware.c:574
NDIS_STATUS NTAPI NICSoftReset(IN PE1000_ADAPTER Adapter)
Definition: hardware.c:531
NDIS_STATUS NTAPI NICGetPermanentMacAddress(IN PE1000_ADAPTER Adapter, OUT PUCHAR MacAddress)
Definition: hardware.c:661
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:276
VOID NTAPI MiniportISR(OUT PBOOLEAN InterruptRecognized, OUT PBOOLEAN QueueMiniportHandleInterrupt, IN NDIS_HANDLE MiniportAdapterContext)
Definition: interrupt.c:16
NDIS_STATUS NTAPI NICApplyPacketFilter(IN PE1000_ADAPTER Adapter)
Definition: hardware.c:724
VOID NTAPI NICUpdateLinkStatus(IN PE1000_ADAPTER Adapter)
Definition: hardware.c:740
VOID NTAPI MiniportHandleInterrupt(IN NDIS_HANDLE MiniportAdapterContext)
Definition: interrupt.c:46
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:73
FORCEINLINE VOID NICApplyInterruptMask(_In_ PE1000_ADAPTER Adapter)
Definition: nic.h:243
#define MAXIMUM_MULTICAST_ADDRESSES
Definition: e1000hw.h:23
#define IEEE_802_ADDR_LENGTH
Definition: e1000hw.h:11
int NDIS_STATUS
Definition: ntddndis.h:475
ULONG NDIS_OID
Definition: ntddndis.h:230
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
unsigned short USHORT
Definition: pedump.c:61
NDIS_STATUS NTAPI NICTransmitPacket(IN PRTL_ADAPTER Adapter, IN UCHAR TxDesc, IN ULONG PhysicalAddress, IN ULONG Length)
Definition: hardware.c:225
NDIS_STATUS NTAPI NICRemoveReceiveBuffer(IN PRTL_ADAPTER Adapter)
Definition: hardware.c:88
NDIS_STATUS NTAPI NICRegisterReceiveBuffer(IN PRTL_ADAPTER Adapter)
Definition: hardware.c:75
struct _RTL_ADAPTER RTL_ADAPTER
VOID NTAPI NICAcknowledgeInterrupts(IN PRTL_ADAPTER Adapter)
Definition: hardware.c:167
struct _RTL_ADAPTER * PRTL_ADAPTER
USHORT NTAPI NICInterruptRecognized(IN PRTL_ADAPTER Adapter, OUT PBOOLEAN InterruptRecognized)
Definition: hardware.c:151
BOOLEAN LinkChange
Definition: nic.h:65
ULONG TransmitOneCollision
Definition: nic.h:85
PUCHAR ReceiveBuffer
Definition: nic.h:59
NDIS_MINIPORT_INTERRUPT Interrupt
Definition: nic.h:49
ULONG InterruptLevel
Definition: nic.h:44
ULONG InterruptVector
Definition: nic.h:43
ULONG IoRangeStart
Definition: nic.h:40
ULONG ReceiveOk
Definition: nic.h:78
ULONG ReceiveError
Definition: nic.h:80
BOOLEAN InterruptRegistered
Definition: nic.h:50
UCHAR CurrentMacAddress[IEEE_802_ADDR_LENGTH]
Definition: nic.h:53
ULONG MediaState
Definition: nic.h:64
ULONG ReceiveNoBufferSpace
Definition: nic.h:82
USHORT InterruptPending
Definition: nic.h:70
ULONG PacketFilter
Definition: nic.h:67
UCHAR CurrentTxDesc
Definition: nic.h:73
UCHAR DirtyTxDesc
Definition: nic.h:72
ULONG TransmitError
Definition: nic.h:81
ULONG LinkSpeedMbps
Definition: nic.h:63
NDIS_HANDLE MiniportAdapterHandle
Definition: nic.h:37
NDIS_PHYSICAL_ADDRESS RuntTxBuffersPa
Definition: nic.h:76
ULONG IoRangeLength
Definition: nic.h:41
NDIS_PHYSICAL_ADDRESS ReceiveBufferPa
Definition: nic.h:60
ULONG InterruptFlags
Definition: nic.h:46
PUCHAR IoBase
Definition: nic.h:48
USHORT ReceiveOffset
Definition: nic.h:61
UCHAR MacAddress[IEEE_802_ADDR_LENGTH]
Definition: nic.h:55
BOOLEAN TxFull
Definition: nic.h:74
PUCHAR RuntTxBuffers
Definition: nic.h:75
struct _RTL_ADAPTER::@1003 MulticastList[MAXIMUM_MULTICAST_ADDRESSES]
UCHAR PermanentMacAddress[IEEE_802_ADDR_LENGTH]
Definition: nic.h:52
BOOLEAN InterruptShared
Definition: nic.h:45
ULONG TransmitOk
Definition: nic.h:79
ULONG TransmitMoreCollisions
Definition: nic.h:86
ULONG ReceiveAlignmentError
Definition: nic.h:84
ULONG ReceiveCrcError
Definition: nic.h:83
ULONG ReceiveBufferLength
Definition: nic.h:58
USHORT InterruptMask
Definition: nic.h:69
NDIS_SPIN_LOCK Lock
Definition: nic.h:38
uint32_t * PULONG
Definition: typedefs.h:59
unsigned char * PBOOLEAN
Definition: typedefs.h:53
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesWritten
Definition: wdfiotarget.h:960
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesRead
Definition: wdfiotarget.h:870
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS PhysicalAddress
Definition: iotypes.h:1098
unsigned char UCHAR
Definition: xmlstorage.h:181