ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

pcnet.h
Go to the documentation of this file.
00001 /*
00002  * ReactOS AMD PCNet Driver
00003  *
00004  * Copyright (C) 2003 Vizzini <vizzini@plasmic.com>
00005  * Copyright (C) 2004 Filip Navara <navaraf@reactos.com>
00006  *
00007  * This program is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 2 of the License, or
00010  * (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License along
00018  * with this program; if not, write to the Free Software Foundation, Inc.,
00019  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00020  *
00021  * REVISIONS:
00022  *     01-Sep-2003 vizzini - Created
00023  * NOTES:
00024  *     - this assumes a 32-bit machine, where sizeof(PVOID) = 32 and sizeof(USHORT) = 16
00025  *     - this assumes 32-bit physical addresses
00026  */
00027 
00028 #include <ndis.h>
00029 #include "pci.h"
00030 #include "pcnethw.h"
00031 
00032 /* statistics struct */
00033 typedef struct _ADAPTER_STATS
00034 {
00035   ULONG XmtGoodFrames;
00036   ULONG XmtRetryErrors;
00037   ULONG XmtLossesOfCarrier;
00038   ULONG XmtCollisions;
00039   ULONG XmtLateCollisions;
00040   ULONG XmtExcessiveDefferals;
00041   ULONG XmtBufferUnderflows;
00042   ULONG XmtBufferErrors;
00043   ULONG XmtOneRetry;
00044   ULONG XmtMoreThanOneRetry;
00045   ULONG RcvGoodFrames;
00046   ULONG RcvBufferErrors;
00047   ULONG RcvCrcErrors;
00048   ULONG RcvOverflowErrors;
00049   ULONG RcvFramingErrors;
00050 } ADAPTER_STATS, *PADAPTER_STATS;
00051 
00052 /* adapter struct */
00053 typedef struct _ADAPTER
00054 {
00055   NDIS_SPIN_LOCK Lock;
00056 
00057   NDIS_HANDLE MiniportAdapterHandle;
00058   ULONG Flags;
00059   ULONG InterruptVector;
00060   ULONG IoBaseAddress;
00061   ULONG_PTR PortOffset;
00062   NDIS_MINIPORT_INTERRUPT InterruptObject;
00063   NDIS_MEDIA_STATE MediaState;
00064   UINT MediaSpeed;
00065   BOOLEAN FullDuplex;
00066   NDIS_MINIPORT_TIMER MediaDetectionTimer;
00067   ULONG CurrentReceiveDescriptorIndex;
00068   ULONG CurrentPacketFilter;
00069   ULONG CurrentLookaheadSize;
00070 
00071   /* circular indexes to transmit descriptors */
00072   ULONG CurrentTransmitStartIndex;
00073   ULONG CurrentTransmitEndIndex;
00074 
00075   /* initialization block */
00076   ULONG InitializationBlockLength;
00077   PINITIALIZATION_BLOCK InitializationBlockVirt;
00078   PINITIALIZATION_BLOCK InitializationBlockPhys;
00079 
00080   /* transmit descriptor ring */
00081   ULONG TransmitDescriptorRingLength;
00082   PTRANSMIT_DESCRIPTOR TransmitDescriptorRingVirt;
00083   PTRANSMIT_DESCRIPTOR TransmitDescriptorRingPhys;
00084 
00085   /* transmit buffers */
00086   ULONG TransmitBufferLength;
00087   PCHAR TransmitBufferPtrVirt;
00088   PCHAR TransmitBufferPtrPhys;
00089 
00090   /* receive descriptor ring */
00091   ULONG ReceiveDescriptorRingLength;
00092   PRECEIVE_DESCRIPTOR ReceiveDescriptorRingVirt;
00093   PRECEIVE_DESCRIPTOR ReceiveDescriptorRingPhys;
00094 
00095   /* receive buffers */
00096   ULONG ReceiveBufferLength;
00097   PCHAR ReceiveBufferPtrVirt;
00098   PCHAR ReceiveBufferPtrPhys;
00099 
00100   /* buffer count */
00101   ULONG BufferCount;
00102   ULONG LogBufferCount;
00103 
00104   ADAPTER_STATS Statistics;
00105 } ADAPTER, *PADAPTER;
00106 
00107 /* forward declarations */
00108 NDIS_STATUS
00109 NTAPI
00110 MiniportQueryInformation(
00111     IN NDIS_HANDLE MiniportAdapterContext,
00112     IN NDIS_OID Oid,
00113     IN PVOID InformationBuffer,
00114     IN ULONG InformationBufferLength,
00115     OUT PULONG BytesWritten,
00116     OUT PULONG BytesNeeded);
00117 
00118 NDIS_STATUS
00119 NTAPI
00120 MiniportSetInformation(
00121     IN NDIS_HANDLE MiniportAdapterContext,
00122     IN NDIS_OID Oid,
00123     IN PVOID InformationBuffer,
00124     IN ULONG InformationBufferLength,
00125     OUT PULONG BytesRead,
00126     OUT PULONG BytesNeeded);
00127 
00128 NDIS_STATUS
00129 NTAPI
00130 MiSetMulticast(
00131     PADAPTER Adapter,
00132     UCHAR *Addresses,
00133     UINT AddressCount);
00134 
00135 NDIS_MEDIA_STATE
00136 NTAPI
00137 MiGetMediaState(PADAPTER Adapter);
00138 
00139 UINT
00140 NTAPI
00141 MiGetMediaSpeed(PADAPTER Adapter);
00142 
00143 BOOLEAN
00144 NTAPI
00145 MiGetMediaDuplex(PADAPTER Adapter);
00146 
00147 /* operational constants */
00148 #define NUMBER_OF_BUFFERS     0x20
00149 #define LOG_NUMBER_OF_BUFFERS 5         /* log2(NUMBER_OF_BUFFERS) */
00150 #define BUFFER_SIZE           0x600
00151 #define MAX_MULTICAST_ADDRESSES 32
00152 #define MEDIA_DETECTION_INTERVAL 5000
00153 
00154 /* flags */
00155 #define RESET_IN_PROGRESS 0x1
00156 
00157 /* Maximum number of interrupts handled per call to MiniportHandleInterrupt */
00158 #define INTERRUPT_LIMIT 10
00159 
00160 /* memory pool tag */
00161 #define PCNET_TAG 'tNcP'

Generated on Sat May 26 2012 04:26:37 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.