/* FIXME: Support other medias */
return NDIS_STATUS_NOT_ACCEPTED;
}
-
+
TI_DbgPrint(DEBUG_DATALINK, ("EtherType (0x%X).\n", *PacketType));
-
+
return NDIS_STATUS_SUCCESS;
}
PVOID HeaderBuffer;
ULONG BytesCopied;
NDIS_STATUS Status;
-
+
HeaderBuffer = ExAllocatePoolWithTag(NonPagedPool,
Adapter->HeaderSize,
HEADER_TAG);
if (!HeaderBuffer)
return NDIS_STATUS_RESOURCES;
-
+
/* Copy the media header */
BytesCopied = CopyPacketToBuffer(HeaderBuffer,
NdisPacket,
HeaderBuffer,
BytesCopied,
PacketType);
-
+
ExFreePoolWithTag(HeaderBuffer, HEADER_TAG);
-
+
return Status;
}
ULONG Unused;
NTSTATUS Status;
IP_ADDRESS DefaultMask, Router;
-
+
AddrInitIPv4(&DefaultMask, 0);
TcpipRegistryPath.MaximumLength = sizeof(WCHAR) * 150;
TcpipRegistryPath.Length = 0;
TcpipRegistryPath.Buffer = Buffer;
-
+
/* Build the registry path */
RtlAppendUnicodeStringToString(&TcpipRegistryPath, &Prefix);
RtlAppendUnicodeStringToString(&TcpipRegistryPath, &Interface->Name);
-
+
InitializeObjectAttributes(&ObjectAttributes,
&TcpipRegistryPath,
OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
0,
NULL);
-
+
/* Open a handle to the adapter parameters */
Status = ZwOpenKey(&ParameterHandle, KEY_READ, &ObjectAttributes);
-
+
if (!NT_SUCCESS(Status))
{
return FALSE;
if (!AddrIsUnspecified(&Interface->Unicast) &&
!AddrIsUnspecified(&Interface->Netmask))
IPAddInterfaceRoute(Interface);
-
+
/* Read default gateway info */
Status = ZwQueryValueKey(ParameterHandle,
&Gateway,
Interface->Unicast = DefaultMask;
Interface->Netmask = DefaultMask;
Interface->Broadcast = DefaultMask;
-
+
/* Remove all interface routes */
RouterRemoveRoutesForInterface(Interface);
-
+
/* Destroy all cached neighbors */
NBDestroyNeighborsForInterface(Interface);
}
-
+
Context->Adapter->CompletingReset = FALSE;
/* Update the IP and link status information cached in TCP */
Adapter->State = Context->State;
return TRUE;
}
-
+
/* NDIS Bug! */
#if 0
/* Get maximum link speed */
OID_GEN_LINK_SPEED,
&Interface->Speed,
sizeof(UINT));
-
+
if (!NT_SUCCESS(NdisStatus))
Interface->Speed = IP_DEFAULT_LINK_SPEED;
Adapter->Speed = Interface->Speed * 100L;
-
+
/* Get maximum frame size */
NdisStatus = NDISCall(Adapter,
NdisRequestQueryInformation,
sizeof(UINT));
if (NdisStatus != NDIS_STATUS_SUCCESS)
return FALSE;
-
+
Interface->MTU = Adapter->MTU;
-
+
/* Get maximum packet size */
NdisStatus = NDISCall(Adapter,
NdisRequestQueryInformation,
#endif
Adapter->State = Context->State;
-
+
return TRUE;
}
VOID ReconfigureAdapterWorker(PVOID Context)
{
PRECONFIGURE_CONTEXT ReconfigureContext = Context;
-
+
/* Complete the reconfiguration asynchronously */
ReconfigureAdapter(ReconfigureContext);
-
+
/* Free the context */
ExFreePool(ReconfigureContext);
}
/* Ignore the status indication if we have no context yet. We'll get another later */
if (!Adapter->Context)
return;
-
+
Context = ExAllocatePoolWithTag(NonPagedPool, sizeof(RECONFIGURE_CONTEXT), CONTEXT_TAG);
if (!Context)
return;
-
+
Context->Adapter = Adapter;
switch(GeneralStatus)
Context->State = LAN_STATE_STARTED;
break;
-
+
case NDIS_STATUS_MEDIA_DISCONNECT:
DbgPrint("NDIS_STATUS_MEDIA_DISCONNECT\n");
-
+
if (Adapter->State == LAN_STATE_STOPPED)
{
ExFreePoolWithTag(Context, CONTEXT_TAG);
return;
}
-
+
Context->State = LAN_STATE_STOPPED;
break;
* SystemSpecific1: Pointer to a registry path with protocol-specific configuration information
* SystemSpecific2: Unused & must not be touched
*/
-{
+{
TI_DbgPrint(DEBUG_DATALINK, ("Called with registry path %wZ for %wZ\n", SystemSpecific1, DeviceName));
*Status = LANRegisterAdapter(DeviceName, SystemSpecific1);
}
TI_DbgPrint(DEBUG_DATALINK,("Adapter Description: %wZ\n",
&IF->Description));
-
+
/* Get maximum link speed */
NdisStatus = NDISCall(Adapter,
NdisRequestQueryInformation,
OID_GEN_LINK_SPEED,
&IF->Speed,
sizeof(UINT));
-
+
if (!NT_SUCCESS(NdisStatus))
IF->Speed = IP_DEFAULT_LINK_SPEED;
-
+
Adapter->Speed = IF->Speed * 100L;
-
+
/* Get maximum frame size */
NdisStatus = NDISCall(Adapter,
NdisRequestQueryInformation,
sizeof(UINT));
if (NdisStatus != NDIS_STATUS_SUCCESS)
return FALSE;
-
+
IF->MTU = Adapter->MTU;
-
+
/* Get maximum packet size */
NdisStatus = NDISCall(Adapter,
NdisRequestQueryInformation,
return NdisStatus;
}
-VOID
+VOID
NTAPI
LANUnregisterProtocol(VOID)
/*