ReactOS 0.4.16-dev-1946-g52006dd
ne2000.h
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Novell Eagle 2000 driver
4 * FILE: include/ne2000.h
5 * PURPOSE: NE2000 driver definitions
6 */
7
8#ifndef _NE2000_PCH_
9#define _NE2000_PCH_
10
11#include <ndis.h>
12#include <8390.h>
13
14#include "debug.h"
15
16/* Define NOCARD to test NDIS without a card */
17//#define NOCARD
18
19/* NE2000 specific constants */
20#define NIC_DATA 0x10 /* Data register */
21#define NIC_RESET 0x1F /* Reset register */
22
23
24/* Global constants */
25
26#define DRIVER_NDIS_MAJOR_VERSION 3
27#define DRIVER_NDIS_MINOR_VERSION 0
28
29#define DRIVER_DEFAULT_IO_BASE_ADDRESS 0x280 /* bochs default */
30#define DRIVER_DEFAULT_INTERRUPT_NUMBER 9 /* bochs default */
31#define DRIVER_DEFAULT_INTERRUPT_SHARED FALSE
32#define DRIVER_DEFAULT_INTERRUPT_MODE NdisInterruptLatched
33
34#define DRIVER_MAX_MULTICAST_LIST_SIZE 8
35
36#define DRIVER_VENDOR_DESCRIPTION "Novell Eagle 2000 Adapter."
37#define DRIVER_VENDOR_DRIVER_VERSION 0x0100 /* 1.0 */
38
39#define DRIVER_FRAME_SIZE 1514 /* Size of an ethernet frame */
40#define DRIVER_HEADER_SIZE 14 /* Size of an ethernet header */
41#define DRIVER_LENGTH_OF_ADDRESS 6 /* Size of an ethernet address */
42
43/* Maximum lookahead buffer size */
44#define DRIVER_MAXIMUM_LOOKAHEAD (252 - DRIVER_HEADER_SIZE)
45
46/* Size of a block in a buffer ring */
47#define DRIVER_BLOCK_SIZE 256
48
49
50/* Default number of transmit buffers */
51#define DRIVER_DEFAULT_TX_BUFFER_COUNT 12
52#define BUFFERS_PER_TX_BUF 1
53
54/* Interrupt Mask Register value */
55#define DRIVER_INTERRUPT_MASK IMR_ALLE - IMR_RDCE
56
57/* Maximum number of interrupts handled per call to MiniportHandleInterrupt */
58#define INTERRUPT_LIMIT 10
59
60/* Global structures */
61
62typedef struct _MINIPORT_RESERVED
63{
66
67#define RESERVED(Packet) ((PMINIPORT_RESERVED)((Packet)->MiniportReserved))
68
70
71/* Information about an adapter */
72typedef struct _NIC_ADAPTER
73{
74 /* Entry on global adapter list */
76 /* Adapter handle */
78 /* NDIS interrupt object */
80
81 /* I/O base address and interrupt number of adapter */
87
88 /* Mapped address of the I/O base port */
90
91 /* TRUE if the NIC can transfer in word mode */
93
94 /* Base address and size of the onboard memory window */
97
98 /* Station Address PROM (SAPROM) */
100
101 /* Onboard ethernet address from the manufacturer */
103
104 /* Ethernet address currently in use */
106
107 /* Maximum number of multicast addresses this adapter supports */
109
110 /* List of multicast addresses in use */
112
113 /* Current multicast address mask */
115
116 /* Masked interrupts (IMR value) */
118
119 /* Interrupts that have occurred */
121
122 /* Current packet filter */
124
125 /* Lookahead buffer */
128
129 /* Receive buffer ring */
134
135 /* TRUE if there was a buffer overflow */
137
138 /* TRUE if an error occurred during reception of a packet */
140
141 /* TRUE if an error occurred during transmission of a packet */
143
144 /* TRUE if a transmit interrupt is pending */
146
147 /* Received packet header */
149
150 /* Offset in onboard RAM of received packet */
152
153 /* TRUE if receive indications are done and should be completed */
155
156 /* Transmit buffers */
157 UINT TXStart; /* Start block of transmit buffer ring */
158 UINT TXCount; /* Number of blocks in transmit buffer ring */
159 UINT TXFree; /* Number of free transmit buffers */
160 UINT TXNext; /* Next buffer to use */
161 /* Length of packet. 0 means buffer is unused */
163 INT TXCurrent; /* Current buffer beeing transmitted. -1 means none */
164
165 /* Head of transmit queue */
167 /* Tail of transmit queue */
169
170 /* Statistics */
174
175 /* Flags used for driver cleanup */
180
181/* Global driver information */
183{
184 NDIS_HANDLE NdisWrapperHandle; /* Returned from NdisInitializeWrapper */
185 NDIS_HANDLE NdisMacHandle; /* Returned from NdisRegisterMac */
186 LIST_ENTRY AdapterListHead; /* Adapters this driver control */
188
189
190
191/* Global variable */
192
195
196
197
198/* Prototypes */
199
201 PNIC_ADAPTER Adapter);
202
204 PNIC_ADAPTER Adapter);
205
207 PNIC_ADAPTER Adapter);
208
210 PNIC_ADAPTER Adapter);
211
213 PNIC_ADAPTER Adapter);
214
216 PNIC_ADAPTER Adapter);
217
219 PNIC_ADAPTER Adapter);
220
222 PNIC_ADAPTER Adapter,
225 USHORT Length);
226
228 PNIC_ADAPTER Adapter,
231 USHORT Length);
232
234 PNIC_ADAPTER Adapter,
237 USHORT Length);
238
240 PNIC_ADAPTER Adapter,
243 USHORT Length);
244
246 PNIC_ADAPTER Adapter);
247
248#endif /* _NE2000_PCH_ */
unsigned char BOOLEAN
unsigned int UINT
Definition: ndis.h:50
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3169
struct _DRIVER_INFORMATION DRIVER_INFORMATION
struct _MINIPORT_RESERVED MINIPORT_RESERVED
UCHAR DRIVER_HARDWARE_ADDRESS[DRIVER_LENGTH_OF_ADDRESS]
Definition: ne2000.h:69
VOID NICReadDataAlign(PNIC_ADAPTER Adapter, PUSHORT Target, ULONG_PTR Source, USHORT Length)
Definition: 8390.c:642
#define DRIVER_HEADER_SIZE
Definition: ne2000.h:40
struct _NIC_ADAPTER * PNIC_ADAPTER
#define DRIVER_MAXIMUM_LOOKAHEAD
Definition: ne2000.h:44
struct _NIC_ADAPTER NIC_ADAPTER
#define DRIVER_MAX_MULTICAST_LIST_SIZE
Definition: ne2000.h:34
BOOLEAN NICCheck(PNIC_ADAPTER Adapter)
Definition: 8390.c:53
VOID NICTransmit(PNIC_ADAPTER Adapter)
Definition: 8390.c:1124
struct _MINIPORT_RESERVED * PMINIPORT_RESERVED
#define DRIVER_DEFAULT_TX_BUFFER_COUNT
Definition: ne2000.h:51
NDIS_STATUS NICStop(PNIC_ADAPTER Adapter)
Definition: 8390.c:451
struct _DRIVER_INFORMATION * PDRIVER_INFORMATION
VOID NICReadData(PNIC_ADAPTER Adapter, PUCHAR Target, ULONG_PTR Source, USHORT Length)
Definition: 8390.c:791
#define DRIVER_LENGTH_OF_ADDRESS
Definition: ne2000.h:41
NDIS_STATUS NICSetup(PNIC_ADAPTER Adapter)
Definition: 8390.c:352
NDIS_STATUS NICReset(PNIC_ADAPTER Adapter)
Definition: 8390.c:500
VOID NICUpdateCounters(PNIC_ADAPTER Adapter)
Definition: 8390.c:619
VOID NICWriteDataAlign(PNIC_ADAPTER Adapter, ULONG_PTR Target, PUSHORT Source, USHORT Length)
Definition: 8390.c:699
DRIVER_INFORMATION DriverInfo
Definition: main.c:60
NDIS_PHYSICAL_ADDRESS HighestAcceptableMax
Definition: main.c:61
NDIS_STATUS NICStart(PNIC_ADAPTER Adapter)
Definition: 8390.c:429
NDIS_STATUS NICInitialize(PNIC_ADAPTER Adapter)
Definition: 8390.c:289
VOID NICWriteData(PNIC_ADAPTER Adapter, ULONG_PTR Target, PUCHAR Source, USHORT Length)
Definition: 8390.c:833
int NDIS_STATUS
Definition: ntddndis.h:496
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
unsigned short USHORT
Definition: pedump.c:61
enum _KINTERRUPT_MODE KINTERRUPT_MODE
NDIS_HANDLE NdisMacHandle
Definition: ne2000.h:185
LIST_ENTRY AdapterListHead
Definition: ne2000.h:186
NDIS_HANDLE NdisWrapperHandle
Definition: ne2000.h:184
Definition: typedefs.h:120
PNDIS_PACKET Next
Definition: ne2000.h:64
BOOLEAN BufferOverflow
Definition: ne2000.h:136
ULONG InterruptLevel
Definition: ne2000.h:83
ULONG PacketFilter
Definition: ne2000.h:123
UINT TXFree
Definition: ne2000.h:159
UINT CurrentPage
Definition: ne2000.h:132
PACKET_HEADER PacketHeader
Definition: ne2000.h:148
ULONG InterruptMask
Definition: ne2000.h:117
UINT PageStart
Definition: ne2000.h:130
UINT PageStop
Definition: ne2000.h:131
UINT RamSize
Definition: ne2000.h:96
BOOLEAN ReceiveError
Definition: ne2000.h:139
BOOLEAN WordMode
Definition: ne2000.h:92
BOOLEAN InterruptRegistered
Definition: ne2000.h:177
PUCHAR IOBase
Definition: ne2000.h:89
BOOLEAN InterruptShared
Definition: ne2000.h:85
UCHAR MulticastAddressMask[8]
Definition: ne2000.h:114
BOOLEAN IOPortRangeRegistered
Definition: ne2000.h:176
UCHAR InterruptStatus
Definition: ne2000.h:120
BOOLEAN TransmitError
Definition: ne2000.h:142
PNDIS_PACKET TXQueueTail
Definition: ne2000.h:168
UINT TXCount
Definition: ne2000.h:158
DRIVER_HARDWARE_ADDRESS Addresses[DRIVER_MAX_MULTICAST_LIST_SIZE]
Definition: ne2000.h:111
UINT TXStart
Definition: ne2000.h:157
NDIS_MINIPORT_INTERRUPT Interrupt
Definition: ne2000.h:79
UCHAR Lookahead[DRIVER_MAXIMUM_LOOKAHEAD+DRIVER_HEADER_SIZE]
Definition: ne2000.h:127
UINT NextPacket
Definition: ne2000.h:133
BOOLEAN DoneIndicating
Definition: ne2000.h:154
ULONG InterruptVector
Definition: ne2000.h:84
PUCHAR RamBase
Definition: ne2000.h:95
BOOLEAN TransmitPending
Definition: ne2000.h:145
UCHAR SAPROM[16]
Definition: ne2000.h:99
UINT TXSize[DRIVER_DEFAULT_TX_BUFFER_COUNT]
Definition: ne2000.h:162
ULONG FrameAlignmentErrors
Definition: ne2000.h:171
ULONG PacketOffset
Definition: ne2000.h:151
INT TXCurrent
Definition: ne2000.h:163
DRIVER_HARDWARE_ADDRESS PermanentAddress
Definition: ne2000.h:102
ULONG_PTR IoBaseAddress
Definition: ne2000.h:82
KINTERRUPT_MODE InterruptMode
Definition: ne2000.h:86
NDIS_HANDLE MiniportAdapterHandle
Definition: ne2000.h:77
UINT LookaheadSize
Definition: ne2000.h:126
PNDIS_PACKET TXQueueHead
Definition: ne2000.h:166
LIST_ENTRY ListEntry
Definition: ne2000.h:75
ULONG MaxMulticastListSize
Definition: ne2000.h:108
ULONG MissedPackets
Definition: ne2000.h:173
BOOLEAN ShutdownHandlerRegistered
Definition: ne2000.h:178
DRIVER_HARDWARE_ADDRESS StationAddress
Definition: ne2000.h:105
ULONG CrcErrors
Definition: ne2000.h:172
UINT TXNext
Definition: ne2000.h:160
int32_t INT
Definition: typedefs.h:58
uint16_t * PUSHORT
Definition: typedefs.h:56
uint32_t ULONG_PTR
Definition: typedefs.h:65
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306
unsigned char UCHAR
Definition: xmlstorage.h:181