ReactOS 0.4.15-dev-7934-g1dc8d80
pcnet.h
Go to the documentation of this file.
1/*
2 * ReactOS AMD PCNet Driver
3 *
4 * Copyright (C) 2003 Vizzini <vizzini@plasmic.com>
5 * Copyright (C) 2004 Filip Navara <navaraf@reactos.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * REVISIONS:
22 * 01-Sep-2003 vizzini - Created
23 * NOTES:
24 * - this assumes a 32-bit machine, where sizeof(PVOID) = 32 and sizeof(USHORT) = 16
25 * - this assumes 32-bit physical addresses
26 */
27
28#ifndef _PCNET_PCH_
29#define _PCNET_PCH_
30
31#include <ndis.h>
32
33#include "pci.h"
34#include "pcnethw.h"
35
36/* statistics struct */
37typedef struct _ADAPTER_STATS
38{
55
56/* adapter struct */
57typedef struct _ADAPTER
58{
60
74
75 /* circular indexes to transmit descriptors */
78
79 /* initialization block */
83
84 /* transmit descriptor ring */
88
89 /* transmit buffers */
93
94 /* receive descriptor ring */
98
99 /* receive buffers */
103
104 /* buffer count */
107
110
111/* forward declarations */
113NTAPI
115 IN NDIS_HANDLE MiniportAdapterContext,
116 IN NDIS_OID Oid,
117 IN PVOID InformationBuffer,
118 IN ULONG InformationBufferLength,
120 OUT PULONG BytesNeeded);
121
123NTAPI
125 IN NDIS_HANDLE MiniportAdapterContext,
126 IN NDIS_OID Oid,
127 IN PVOID InformationBuffer,
128 IN ULONG InformationBufferLength,
130 OUT PULONG BytesNeeded);
131
133NTAPI
135 PADAPTER Adapter,
136 UCHAR *Addresses,
137 UINT AddressCount);
138
140NTAPI
142
143UINT
144NTAPI
146
148NTAPI
150
151/* operational constants */
152#define NUMBER_OF_BUFFERS 0x20
153#define LOG_NUMBER_OF_BUFFERS 5 /* log2(NUMBER_OF_BUFFERS) */
154#define BUFFER_SIZE 0x600
155#define MAX_MULTICAST_ADDRESSES 32
156#define MEDIA_DETECTION_INTERVAL 5000
157
158/* flags */
159#define RESET_IN_PROGRESS 0x1
160
161/* Maximum number of interrupts handled per call to MiniportHandleInterrupt */
162#define INTERRUPT_LIMIT 10
163
164/* memory pool tag */
165#define PCNET_TAG 'tNcP'
166
167#endif /* _PCNET_PCH_ */
unsigned char BOOLEAN
unsigned int UINT
Definition: ndis.h:50
enum _NDIS_MEDIA_STATE NDIS_MEDIA_STATE
int NDIS_STATUS
Definition: ntddndis.h:475
ULONG NDIS_OID
Definition: ntddndis.h:230
struct _ADAPTER_STATS ADAPTER_STATS
NDIS_MEDIA_STATE NTAPI MiGetMediaState(PADAPTER Adapter)
Definition: pcnet.c:1309
struct _ADAPTER * PADAPTER
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
NDIS_STATUS NTAPI MiSetMulticast(PADAPTER Adapter, UCHAR *Addresses, UINT AddressCount)
Definition: pcnet.c:1262
BOOLEAN NTAPI MiGetMediaDuplex(PADAPTER Adapter)
Definition: pcnet.c:1285
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
struct _ADAPTER_STATS * PADAPTER_STATS
struct _ADAPTER ADAPTER
UINT NTAPI MiGetMediaSpeed(PADAPTER Adapter)
Definition: pcnet.c:1297
ULONG XmtCollisions
Definition: pcnet.h:42
ULONG XmtOneRetry
Definition: pcnet.h:47
ULONG RcvCrcErrors
Definition: pcnet.h:51
ULONG XmtLossesOfCarrier
Definition: pcnet.h:41
ULONG RcvBufferErrors
Definition: pcnet.h:50
ULONG XmtGoodFrames
Definition: pcnet.h:39
ULONG RcvFramingErrors
Definition: pcnet.h:53
ULONG XmtBufferUnderflows
Definition: pcnet.h:45
ULONG RcvOverflowErrors
Definition: pcnet.h:52
ULONG RcvGoodFrames
Definition: pcnet.h:49
ULONG XmtLateCollisions
Definition: pcnet.h:43
ULONG XmtMoreThanOneRetry
Definition: pcnet.h:48
ULONG XmtBufferErrors
Definition: pcnet.h:46
ULONG XmtExcessiveDeferrals
Definition: pcnet.h:44
ULONG XmtRetryErrors
Definition: pcnet.h:40
Definition: pcnet.h:58
PHYSICAL_ADDRESS ReceiveDescriptorRingPhys
Definition: pcnet.h:97
BOOLEAN FullDuplex
Definition: pcnet.h:69
PHYSICAL_ADDRESS TransmitDescriptorRingPhys
Definition: pcnet.h:87
NDIS_SPIN_LOCK Lock
Definition: pcnet.h:59
UINT MediaSpeed
Definition: pcnet.h:68
ULONG InitializationBlockLength
Definition: pcnet.h:80
ULONG IoBaseAddress
Definition: pcnet.h:64
ULONG InterruptVector
Definition: pcnet.h:63
ULONG CurrentReceiveDescriptorIndex
Definition: pcnet.h:71
ADAPTER_STATS Statistics
Definition: pcnet.h:108
NDIS_MINIPORT_TIMER MediaDetectionTimer
Definition: pcnet.h:70
ULONG TransmitBufferLength
Definition: pcnet.h:90
ULONG ReceiveDescriptorRingLength
Definition: pcnet.h:95
ULONG LogBufferCount
Definition: pcnet.h:106
ULONG ReceiveBufferLength
Definition: pcnet.h:100
ULONG Flags
Definition: pcnet.h:62
ULONG CurrentLookaheadSize
Definition: pcnet.h:73
PRECEIVE_DESCRIPTOR ReceiveDescriptorRingVirt
Definition: pcnet.h:96
NDIS_MINIPORT_INTERRUPT InterruptObject
Definition: pcnet.h:66
PHYSICAL_ADDRESS InitializationBlockPhys
Definition: pcnet.h:82
NDIS_MEDIA_STATE MediaState
Definition: pcnet.h:67
PHYSICAL_ADDRESS ReceiveBufferPtrPhys
Definition: pcnet.h:102
ULONG CurrentTransmitStartIndex
Definition: pcnet.h:76
NDIS_HANDLE MiniportAdapterHandle
Definition: pcnet.h:61
PHYSICAL_ADDRESS TransmitBufferPtrPhys
Definition: pcnet.h:92
ULONG CurrentPacketFilter
Definition: pcnet.h:72
PINITIALIZATION_BLOCK InitializationBlockVirt
Definition: pcnet.h:81
ULONG TransmitDescriptorRingLength
Definition: pcnet.h:85
ULONG_PTR PortOffset
Definition: pcnet.h:65
PTRANSMIT_DESCRIPTOR TransmitDescriptorRingVirt
Definition: pcnet.h:86
ULONG CurrentTransmitEndIndex
Definition: pcnet.h:77
PCHAR ReceiveBufferPtrVirt
Definition: pcnet.h:101
ULONG BufferCount
Definition: pcnet.h:105
PCHAR TransmitBufferPtrVirt
Definition: pcnet.h:91
uint32_t * PULONG
Definition: typedefs.h:59
#define NTAPI
Definition: typedefs.h:36
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
char * PCHAR
Definition: typedefs.h:51
_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
unsigned char UCHAR
Definition: xmlstorage.h:181