diff --git a/drivers/network/tcpip/datalink/lan.c b/drivers/network/tcpip/datalink/lan.c index 0440c098f49..ccd0f555ef5 100644 --- a/drivers/network/tcpip/datalink/lan.c +++ b/drivers/network/tcpip/datalink/lan.c @@ -718,7 +718,7 @@ BOOLEAN ReconfigureAdapter(PRECONFIGURE_CONTEXT Context) { PLAN_ADAPTER Adapter = Context->Adapter; PIP_INTERFACE Interface = Adapter->Context; - //NDIS_STATUS NdisStatus; + NDIS_STATUS NdisStatus; IP_ADDRESS DefaultMask; /* Initialize the default unspecified address (0.0.0.0) */ @@ -754,48 +754,41 @@ BOOLEAN ReconfigureAdapter(PRECONFIGURE_CONTEXT Context) TCPUpdateInterfaceIPInformation(Interface); TCPUpdateInterfaceLinkStatus(Interface); - /* We're done here if the adapter isn't connected */ - if (Context->State != LAN_STATE_STARTED) + if (Context->State == LAN_STATE_STARTED) { - Adapter->State = Context->State; - return TRUE; + /* Get maximum link speed */ + NdisStatus = NDISCall(Adapter, + NdisRequestQueryInformation, + OID_GEN_LINK_SPEED, + &Interface->Speed, + sizeof(Interface->Speed)); + + if (!NT_SUCCESS(NdisStatus)) + Interface->Speed = IP_DEFAULT_LINK_SPEED; + + Adapter->Speed = Interface->Speed * 100L; + + /* Get maximum frame size */ + NdisStatus = NDISCall(Adapter, + NdisRequestQueryInformation, + OID_GEN_MAXIMUM_FRAME_SIZE, + &Adapter->MTU, + sizeof(Adapter->MTU)); + if (NdisStatus != NDIS_STATUS_SUCCESS) + return FALSE; + + Interface->MTU = Adapter->MTU; + + /* Get maximum packet size */ + NdisStatus = NDISCall(Adapter, + NdisRequestQueryInformation, + OID_GEN_MAXIMUM_TOTAL_SIZE, + &Adapter->MaxPacketSize, + sizeof(Adapter->MaxPacketSize)); + if (NdisStatus != NDIS_STATUS_SUCCESS) + return FALSE; } - /* NDIS Bug! */ -#if 0 - /* Get maximum link speed */ - NdisStatus = NDISCall(Adapter, - NdisRequestQueryInformation, - 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, - OID_GEN_MAXIMUM_FRAME_SIZE, - &Adapter->MTU, - sizeof(UINT)); - if (NdisStatus != NDIS_STATUS_SUCCESS) - return FALSE; - - Interface->MTU = Adapter->MTU; - - /* Get maximum packet size */ - NdisStatus = NDISCall(Adapter, - NdisRequestQueryInformation, - OID_GEN_MAXIMUM_TOTAL_SIZE, - &Adapter->MaxPacketSize, - sizeof(UINT)); - if (NdisStatus != NDIS_STATUS_SUCCESS) - return FALSE; -#endif - Adapter->State = Context->State; return TRUE; diff --git a/drivers/network/tcpip/include/lan.h b/drivers/network/tcpip/include/lan.h index ab8f4bc5ba6..f99f588188e 100644 --- a/drivers/network/tcpip/include/lan.h +++ b/drivers/network/tcpip/include/lan.h @@ -52,7 +52,7 @@ typedef struct LAN_ADAPTER { UCHAR BCastCheck; /* Value to check against */ UCHAR BCastOffset; /* Offset in frame to check against */ UCHAR HeaderSize; /* Size of link-level header */ - USHORT MTU; /* Maximum Transfer Unit */ + UINT MTU; /* Maximum Transfer Unit */ UINT MinFrameSize; /* Minimum frame size in bytes */ UINT MaxPacketSize; /* Maximum packet size when sending */ UINT MaxSendPackets; /* Maximum number of packets per send */