88 static ULONG PredefSizes[4] = {
252 switch (ResourceDescriptor->
Type)
255 ASSERT(Adapter->IoPortAddress == 0);
256 ASSERT(ResourceDescriptor->
u.
Port.Start.HighPart == 0);
258 Adapter->IoPortAddress = ResourceDescriptor->
u.
Port.Start.LowPart;
259 Adapter->IoPortLength = ResourceDescriptor->
u.
Port.Length;
262 Adapter->IoPortAddress,
263 Adapter->IoPortAddress + Adapter->IoPortLength));
266 ASSERT(Adapter->InterruptVector == 0);
267 ASSERT(Adapter->InterruptLevel == 0);
269 Adapter->InterruptVector = ResourceDescriptor->
u.
Interrupt.Vector;
270 Adapter->InterruptLevel = ResourceDescriptor->
u.
Interrupt.Level;
272 Adapter->InterruptFlags = ResourceDescriptor->
Flags;
278 if (ResourceDescriptor->
u.
Memory.Length == (128 * 1024))
280 ASSERT(Adapter->IoAddress.LowPart == 0);
281 ASSERT(ResourceDescriptor->
u.
Port.Start.HighPart == 0);
284 Adapter->IoAddress.QuadPart = ResourceDescriptor->
u.
Memory.Start.QuadPart;
285 Adapter->IoLength = ResourceDescriptor->
u.
Memory.Length;
287 Adapter->IoAddress.QuadPart,
288 Adapter->IoAddress.QuadPart + Adapter->IoLength));
298 if (Adapter->IoAddress.QuadPart == 0 || Adapter->IoPortAddress == 0 || Adapter->InterruptVector == 0)
319 Adapter->AdapterHandle,
320 Adapter->IoPortAddress,
321 Adapter->IoPortLength);
329 Adapter->AdapterHandle,
337 (
PVOID*)&Adapter->TransmitDescriptors,
338 &Adapter->TransmitDescriptorsPa);
339 if (Adapter->TransmitDescriptors ==
NULL)
355 (
PVOID*)&Adapter->ReceiveDescriptors,
356 &Adapter->ReceiveDescriptorsPa);
357 if (Adapter->ReceiveDescriptors ==
NULL)
364 ASSERT(Adapter->ReceiveBufferEntrySize == 0 || Adapter->ReceiveBufferEntrySize ==
AllocationSize);
370 (
PVOID*)&Adapter->ReceiveBuffer,
371 &Adapter->ReceiveBufferPa);
373 if (Adapter->ReceiveBuffer ==
NULL)
384 Descriptor->Address = Adapter->ReceiveBufferPa.QuadPart +
n * Adapter->ReceiveBufferEntrySize;
399 Adapter->AdapterHandle,
400 Adapter->InterruptVector,
401 Adapter->InterruptLevel,
403 Adapter->InterruptShared,
409 Adapter->InterruptRegistered =
TRUE;
422 if (Adapter->InterruptRegistered)
425 Adapter->InterruptRegistered =
FALSE;
438 if (Adapter->ReceiveDescriptors !=
NULL)
450 Adapter->ReceiveDescriptors,
451 Adapter->ReceiveDescriptorsPa);
453 Adapter->ReceiveDescriptors =
NULL;
456 if (Adapter->ReceiveBuffer !=
NULL)
461 Adapter->ReceiveBuffer,
462 Adapter->ReceiveBufferPa);
464 Adapter->ReceiveBuffer =
NULL;
465 Adapter->ReceiveBufferEntrySize = 0;
469 if (Adapter->TransmitDescriptors !=
NULL)
481 Adapter->TransmitDescriptors,
482 Adapter->TransmitDescriptorsPa);
484 Adapter->TransmitDescriptors =
NULL;
492 Adapter->IoPortAddress,
493 Adapter->IoPortLength,
595 Adapter->CurrentTxDesc = 0;
649 Value &= ~E1000_TCTL_EN;
653 Value &= ~E1000_RCTL_EN;
675 Adapter->PermanentMacAddress[
n * 2 + 0] = AddrWord & 0xff;
676 Adapter->PermanentMacAddress[
n * 2 + 1] = (AddrWord >> 8) & 0xff;
681 Adapter->PermanentMacAddress[0],
682 Adapter->PermanentMacAddress[1],
683 Adapter->PermanentMacAddress[2],
684 Adapter->PermanentMacAddress[3],
685 Adapter->PermanentMacAddress[4],
686 Adapter->PermanentMacAddress[5]));
702 ULONG Ral = *(
ULONG *)Adapter->MulticastList[
n].MacAddress;
703 ULONG Rah = *(
USHORT *)&Adapter->MulticastList[
n].MacAddress[4];
731 FilterMask &= ~E1000_RCTL_FILTER_BITS;
745 static ULONG SpeedValues[] = { 10, 100, 1000, 1000 };
752 Adapter->LinkSpeedMbps = SpeedValues[SpeedIndex];
#define NICDisableInterrupts(Adapter)
#define NDIS_DbgPrint(_t_, _x_)
NDIS_STATUS NTAPI NICRegisterInterrupts(IN PE1000_ADAPTER Adapter)
NDIS_STATUS NTAPI NICPowerOn(IN PE1000_ADAPTER Adapter)
NDIS_STATUS NTAPI NICEnableTxRx(IN PE1000_ADAPTER Adapter)
static ULONG RcvBufRegisterMask(E1000_RCVBUF_SIZE BufSize)
NDIS_STATUS NTAPI NICSoftReset(IN PE1000_ADAPTER Adapter)
BOOLEAN NTAPI NICRecognizeHardware(IN PE1000_ADAPTER Adapter)
NDIS_STATUS NTAPI NICGetPermanentMacAddress(IN PE1000_ADAPTER Adapter, OUT PUCHAR MacAddress)
NDIS_STATUS NTAPI NICAllocateIoResources(IN PE1000_ADAPTER Adapter)
NDIS_STATUS NTAPI NICApplyPacketFilter(IN PE1000_ADAPTER Adapter)
VOID NTAPI NICUpdateLinkStatus(IN PE1000_ADAPTER Adapter)
static BOOLEAN E1000ReadEeprom(IN PE1000_ADAPTER Adapter, IN UCHAR Address, USHORT *Result)
static USHORT SupportedDevices[]
NDIS_STATUS NTAPI NICReleaseIoResources(IN PE1000_ADAPTER Adapter)
BOOLEAN E1000ValidateNvmChecksum(IN PE1000_ADAPTER Adapter)
static ULONG RcvBufAllocationSize(E1000_RCVBUF_SIZE BufSize)
NDIS_STATUS NTAPI NICDisableTxRx(IN PE1000_ADAPTER Adapter)
NDIS_STATUS NTAPI NICUpdateMulticastList(IN PE1000_ADAPTER Adapter)
NDIS_STATUS NTAPI NICUnregisterInterrupts(IN PE1000_ADAPTER Adapter)
NDIS_STATUS NTAPI NICInitializeAdapterResources(IN PE1000_ADAPTER Adapter, IN PNDIS_RESOURCE_LIST ResourceList)
static ULONG PacketFilterToMask(ULONG PacketFilter)
NDIS_STATUS EXPORT NdisMMapIoSpace(OUT PVOID *VirtualAddress, IN NDIS_HANDLE MiniportAdapterHandle, IN NDIS_PHYSICAL_ADDRESS PhysicalAddress, IN UINT Length)
VOID EXPORT NdisMDeregisterInterrupt(IN PNDIS_MINIPORT_INTERRUPT Interrupt)
VOID EXPORT NdisMDeregisterIoPortRange(IN NDIS_HANDLE MiniportAdapterHandle, IN UINT InitialPort, IN UINT NumberOfPorts, IN PVOID PortOffset)
NDIS_STATUS EXPORT NdisMRegisterIoPortRange(OUT PVOID *PortOffset, IN NDIS_HANDLE MiniportAdapterHandle, IN UINT InitialPort, IN UINT NumberOfPorts)
VOID EXPORT NdisMUnmapIoSpace(IN NDIS_HANDLE MiniportAdapterHandle, IN PVOID VirtualAddress, IN UINT Length)
NDIS_STATUS EXPORT NdisMRegisterInterrupt(OUT PNDIS_MINIPORT_INTERRUPT Interrupt, IN NDIS_HANDLE MiniportAdapterHandle, IN UINT InterruptVector, IN UINT InterruptLevel, IN BOOLEAN RequestIsr, IN BOOLEAN SharedInterrupt, IN NDIS_INTERRUPT_MODE InterruptMode)
VOID EXPORT NdisMAllocateSharedMemory(IN NDIS_HANDLE MiniportAdapterHandle, IN ULONG Length, IN BOOLEAN Cached, OUT PVOID *VirtualAddress, OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress)
VOID EXPORT NdisMFreeSharedMemory(IN NDIS_HANDLE MiniportAdapterHandle, IN ULONG Length, IN BOOLEAN Cached, IN PVOID VirtualAddress, IN NDIS_PHYSICAL_ADDRESS PhysicalAddress)
FORCEINLINE VOID E1000WriteIoUlong(_In_ PE1000_ADAPTER Adapter, _In_ ULONG Address, _In_ ULONG Value)
FORCEINLINE VOID E1000ReadUlong(_In_ PE1000_ADAPTER Adapter, _In_ ULONG Address, _Out_ PULONG Value)
FORCEINLINE VOID E1000WriteUlong(_In_ PE1000_ADAPTER Adapter, _In_ ULONG Address, _In_ ULONG Value)
#define E1000_TIPG_IPGT_DEF
#define MAX_EEPROM_READ_ATTEMPTS
#define MAXIMUM_MULTICAST_ADDRESSES
#define E1000_MDIC_PHYADD_GIGABIT
#define E1000_MDIC_REGADD_SHIFT
#define MAX_PHY_REG_ADDRESS
#define E1000_NVM_REG_CHECKSUM
#define E1000_STATUS_SPEEDSHIFT
#define MAX_PHY_READ_ATTEMPTS
#define E1000_STATUS_SPEEDMASK
#define E1000_MDIC_OP_READ
#define E1000_TIPG_IPGR2_DEF
#define MAX_RESET_ATTEMPTS
#define E1000_MDIC_PHYADD_SHIFT
#define E1000_EERD_DATA_SHIFT
#define NUM_RECEIVE_DESCRIPTORS
#define IEEE_802_ADDR_LENGTH
#define NUM_TRANSMIT_DESCRIPTORS
enum _E1000_RCVBUF_SIZE E1000_RCVBUF_SIZE
#define E1000_TIPG_IPGR1_DEF
#define E1000_EERD_ADDR_SHIFT
#define E1000_RCTL_BSIZE_SHIFT
IN PFCB IN PFILE_OBJECT FileObject IN ULONG AllocationSize
#define CmResourceTypeMemory
#define CmResourceTypePort
#define CmResourceTypeInterrupt
#define NDIS_PACKET_TYPE_PROMISCUOUS
#define NdisInterruptLatched
#define NDIS_STATUS_INVALID_DATA
#define NDIS_PACKET_TYPE_MAC_FRAME
#define NdisInterruptLevelSensitive
#define NDIS_STATUS_FAILURE
#define NDIS_PACKET_TYPE_BROADCAST
#define NdisStallExecution
#define NDIS_STATUS_SUCCESS
#define NDIS_PACKET_TYPE_ALL_MULTICAST
#define NDIS_STATUS_RESOURCES
#define CM_RESOURCE_INTERRUPT_LATCHED
@ NdisMediaStateConnected
@ NdisMediaStateDisconnected
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@392 u
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@392::@394 Port
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@392::@397 Memory
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@392::@395 Interrupt
#define RtlZeroMemory(Destination, Length)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO