33#ifdef WPP_EVENT_TRACING
34#include "ParaNdis5-Oid.tmh"
37#define OIDENTRY(oid, el, xfl, xokl, flags) \
38{ oid, el, xfl, xokl, flags, NULL }
39#define OIDENTRYPROC(oid, el, xfl, xokl, flags, setproc) \
40{ oid, el, xfl, xokl, flags, setproc }
223 ULONG ulLinkSpeed = 0;
229 bFreeInfo = pInfo !=
NULL;
235 pInfo = &ulLinkSpeed;
236 ulSize =
sizeof(ulLinkSpeed);
264 IN ULONG InformationBufferLength,
280 InformationBufferLength));
293 (
"[%s] , id 0x%X(%s) (%X), written %d, needed %d",
314 IN ULONG InformationBufferLength,
330 InformationBufferLength));
351 (
"[%s] , id 0x%X(%s) (%X), read %d, needed %d",
__FUNCTION__,
391 pwi->
state = newState;
413 bInvalid |= pcs->
V4Receive.IpChecksum && !
f.fRxIPChecksum;
414 bInvalid |= pcs->
V4Receive.IpOptionsSupported && !
f.fRxIPOptions;
415 bInvalid |= pcs->
V4Receive.TcpChecksum && !
f.fRxTCPChecksum;
416 bInvalid |= pcs->
V4Receive.TcpOptionsSupported && !
f.fRxTCPOptions;
417 bInvalid |= pcs->
V4Receive.UdpChecksum && !
f.fRxUDPChecksum;
419 bInvalid |= pcs->
V4Transmit.IpChecksum && !
f.fTxIPChecksum;
420 bInvalid |= pcs->
V4Transmit.IpOptionsSupported && !
f.fTxIPOptions;
421 bInvalid |= pcs->
V4Transmit.TcpChecksum && !
f.fTxTCPChecksum;
422 bInvalid |= pcs->
V4Transmit.TcpOptionsSupported && !
f.fTxTCPOptions;
423 bInvalid |= pcs->
V4Transmit.UdpChecksum && !
f.fTxUDPChecksum;
456 ULONG TaskBufferSize = 0, tailOffset = 0;
461 TaskBufferSize =
sizeof(*pcs);
462 sName =
"TcpIpChecksumNdisTask";
466 TaskBufferSize =
sizeof(*pls);
467 sName =
"TcpLargeSendNdisTask";
471 TaskBufferSize =
sizeof(*pips);
472 sName =
"IpSecNdisTask";
482 else if (tailOffset > maxSize)
495 DPrintf(0, (
"Rx4: checksum IP(%d),TCP(%d),UDP(%d), options IP(%d),TCP(%d)",
499 DPrintf(0, (
"Tx4: checksum IP(%d),TCP(%d),UDP(%d), options IP(%d),TCP(%d)",
526 DPrintf(0, (
"options IP(%d),TCP(%d),MaxOffload %d, MinSegments %d",
553 pth->
Size ==
sizeof(*pth);
566 ULONG ulNoCapabilities = 0;
574 DPrintf(0, (
"[%s], header version %d, ip header at %d, fixed %d, first at %d",
__FUNCTION__,
592 DPrintf(0, (
"[%s], unexpected TO version %d at %d",
621 pcs->
V4Transmit.IpOptionsSupported = !!
f.fTxIPOptions;
622 pcs->
V4Transmit.TcpOptionsSupported = !!
f.fTxTCPOptions;
623 pcs->
V4Receive.IpChecksum = !!
f.fRxIPChecksum;
624 pcs->
V4Receive.IpOptionsSupported = !!
f.fRxIPOptions;
625 pcs->
V4Receive.TcpChecksum = !!
f.fRxTCPChecksum;
626 pcs->
V4Receive.TcpOptionsSupported = !!
f.fRxTCPOptions;
627 pcs->
V4Receive.UdpChecksum = !!
f.fRxUDPChecksum;
653 return f.fTxLso != 0;
702 pto->
Size =
sizeof(*pto);
NDIS_STATUS ParaNdis_OidQueryCopy(tOidDesc *pOid, PVOID pInfo, ULONG ulSize, BOOLEAN bFreeInfo)
NDIS_STATUS ParaNdis_OidQueryCommon(PARANDIS_ADAPTER *pContext, tOidDesc *pOid)
NDIS_STATUS ParaNdis_OnAddWakeupPattern(PARANDIS_ADAPTER *pContext, tOidDesc *pOid)
NDIS_STATUS ParaNdis_OnSetPacketFilter(PARANDIS_ADAPTER *pContext, tOidDesc *pOid)
NDIS_STATUS ParaNdis_OidSetCopy(tOidDesc *pOid, PVOID pDest, ULONG ulSize)
NDIS_STATUS ParaNdis_OnOidSetMulticastList(PARANDIS_ADAPTER *pContext, tOidDesc *pOid)
NDIS_STATUS ParaNdis_OnEnableWakeup(PARANDIS_ADAPTER *pContext, tOidDesc *pOid)
NDIS_STATUS ParaNdis_OnRemoveWakeupPattern(PARANDIS_ADAPTER *pContext, tOidDesc *pOid)
NDIS_STATUS ParaNdis_OnSetLookahead(PARANDIS_ADAPTER *pContext, tOidDesc *pOid)
void ParaNdis_GetOidSupportRules(NDIS_OID oid, tOidWhatToDo *pRule, const tOidWhatToDo *Table)
NDIS_STATUS ParaNdis_OnSetVlanId(PARANDIS_ADAPTER *pContext, tOidDesc *pOid)
static BOOLEAN GetLargeSendCapabilities(PARANDIS_ADAPTER *pContext, NDIS_TASK_TCP_LARGE_SEND *pls)
void ParaNdis_GetSupportedOid(PVOID *pOidsArray, PULONG pLength)
static BOOLEAN IsValidPcs(PARANDIS_ADAPTER *pContext, NDIS_TASK_TCP_IP_CHECKSUM *pcs)
static BOOLEAN IsValidPls(PARANDIS_ADAPTER *pContext, NDIS_TASK_TCP_LARGE_SEND *pls)
static NDIS_TASK_OFFLOAD_HEADER ReservedHeader
NDIS_STATUS NTAPI ParaNdis5_SetOID(IN NDIS_HANDLE MiniportAdapterContext, IN NDIS_OID Oid, IN PVOID InformationBuffer, IN ULONG InformationBufferLength, OUT PULONG BytesRead, OUT PULONG BytesNeeded)
static FORCEINLINE BOOLEAN ValidateOffloadHeader(NDIS_TASK_OFFLOAD_HEADER *pth)
static BOOLEAN GetTcpIpCheckSumCapabilities(PARANDIS_ADAPTER *pContext, NDIS_TASK_TCP_IP_CHECKSUM *pcs)
static const tOidWhatToDo OidsDB[]
static NDIS_STATUS ParseOffloadTask(PARANDIS_ADAPTER *pContext, BOOLEAN bApply, NDIS_TASK_OFFLOAD *pto, ULONG offset, ULONG maxSize)
static NDIS_STATUS CreateOffloadInfo5Internal(PARANDIS_ADAPTER *pContext, PVOID *ppInfo, PULONG pulSize, PCCHAR reason, NDIS_TASK_OFFLOAD_HEADER *pHeader)
static NDIS_STATUS CreateOffloadInfo5ForQuery(PARANDIS_ADAPTER *pContext, tOidDesc *pOid, PVOID *ppInfo, PULONG pulSize)
#define OIDENTRY(oid, el, xfl, xokl, flags)
static void NTAPI OnSetPowerWorkItem(NDIS_WORK_ITEM *pWorkItem, PVOID Context)
#define OIDENTRYPROC(oid, el, xfl, xokl, flags, setproc)
static NDIS_STATUS ParseOffload(PARANDIS_ADAPTER *pContext, NDIS_TASK_OFFLOAD_HEADER *pth, ULONG size, BOOLEAN bApply, PCCHAR reason, BOOLEAN headerOnly)
static NDIS_OID SupportedOids[]
NDIS_STATUS ParaNdis_OnSetPower(PARANDIS_ADAPTER *pContext, tOidDesc *pOid)
static NDIS_STATUS ParaNdis_OidQuery(PARANDIS_ADAPTER *pContext, tOidDesc *pOid)
NDIS_STATUS NTAPI ParaNdis5_QueryOID(IN NDIS_HANDLE MiniportAdapterContext, IN NDIS_OID Oid, IN PVOID InformationBuffer, IN ULONG InformationBufferLength, OUT PULONG BytesWritten, OUT PULONG BytesNeeded)
static NDIS_STATUS OnOidSetNdis5Offload(PARANDIS_ADAPTER *pContext, tOidDesc *pOid)
#define STATUS_NOT_SUPPORTED
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
#define DEBUG_ENTRY(level)
#define DPrintf(Level, Fmt)
VOID EXPORT NdisFreeMemory(IN PVOID VirtualAddress, IN UINT Length, IN UINT MemoryFlags)
NDIS_STATUS EXPORT NdisScheduleWorkItem(IN PNDIS_WORK_ITEM pWorkItem)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
FxContextHeader * pHeader
#define PARANDIS_FORMAL_LINK_SPEED
NDIS_STATUS ParaNdis_PowerOn(PARANDIS_ADAPTER *pContext)
PVOID ParaNdis_AllocateMemory(PARANDIS_ADAPTER *pContext, ULONG ulRequiredSize)
void ParaNdis_ResetOffloadSettings(PARANDIS_ADAPTER *pContext, tOffloadSettingsFlags *pDest, PULONG from)
#define PARANDIS_MIN_LSO_SEGMENTS
VOID ParaNdis_PowerOff(PARANDIS_ADAPTER *pContext)
#define RtlPointerToOffset(Base, Pointer)
static void FORCEINLINE ParaNdis_DebugHistory(PARANDIS_ADAPTER *pContext, eHistoryLogOperation op, PVOID pParam1, ULONG lParam2, ULONG lParam3, ULONG lParam4)
#define NdisMSetInformationComplete(MiniportAdapterHandle, Status)
#define NDIS_STATUS_PENDING
#define NdisZeroMemory(Destination, Length)
#define NdisInitializeWorkItem(_WI_, _R_, _C_)
@ IEEE_802_3_Encapsulation
#define NDIS_STATUS_INVALID_DATA
#define NDIS_STATUS_NOT_SUPPORTED
#define NDIS_TASK_OFFLOAD_VERSION
struct _NDIS_TASK_TCP_IP_CHECKSUM NDIS_TASK_TCP_IP_CHECKSUM
#define NDIS_STATUS_FAILURE
#define NDIS_STATUS_INVALID_OID
#define NDIS_STATUS_SUCCESS
struct _NDIS_TASK_OFFLOAD_HEADER NDIS_TASK_OFFLOAD_HEADER
#define NDIS_STATUS_BUFFER_TOO_SHORT
struct _NDIS_TASK_TCP_LARGE_SEND NDIS_TASK_TCP_LARGE_SEND
#define NDIS_STATUS_NOT_ACCEPTED
#define NDIS_TASK_TCP_LARGE_SEND_V0
#define NdisMoveMemory(Destination, Source, Length)
#define NDIS_STATUS_RESOURCES
#define OID_GEN_MULTICAST_FRAMES_XMIT
#define OID_IP4_OFFLOAD_STATS
#define OID_GEN_TRANSMIT_BLOCK_SIZE
#define OID_GEN_DIRECTED_BYTES_RCV
#define OID_GEN_PROTOCOL_OPTIONS
#define OID_GEN_DIRECTED_FRAMES_XMIT
#define OID_GEN_MAXIMUM_TOTAL_SIZE
#define OID_GEN_BROADCAST_BYTES_XMIT
#define OID_GEN_XMIT_ERROR
#define OID_GEN_VENDOR_DRIVER_VERSION
#define OID_802_3_PERMANENT_ADDRESS
#define OID_GEN_LINK_SPEED
#define OID_GEN_VENDOR_ID
#define OID_802_3_RCV_OVERRUN
#define OID_GEN_CURRENT_PACKET_FILTER
#define OID_GEN_RCV_NO_BUFFER
#define OID_PNP_SET_POWER
#define OID_802_3_XMIT_HEARTBEAT_FAILURE
#define OID_GEN_PHYSICAL_MEDIUM
#define OID_802_11_CAPABILITY
enum _NDIS_DEVICE_POWER_STATE NDIS_DEVICE_POWER_STATE
#define OID_802_3_XMIT_ONE_COLLISION
#define OID_802_3_XMIT_MORE_COLLISIONS
#define OID_GEN_NETCARD_LOAD
#define OID_802_3_XMIT_MAX_COLLISIONS
#define OID_GEN_RECEIVE_BUFFER_SPACE
#define OID_802_3_XMIT_TIMES_CRS_LOST
#define OID_802_3_MAXIMUM_LIST_SIZE
#define OID_GEN_TRANSPORT_HEADER_OFFSET
#define OID_GEN_INIT_TIME_MS
#define OID_GEN_DRIVER_VERSION
#define OID_GEN_DEVICE_PROFILE
#define OID_802_3_XMIT_UNDERRUN
#define OID_802_3_XMIT_LATE_COLLISIONS
#define OID_802_3_MAC_OPTIONS
#define OID_802_3_CURRENT_ADDRESS
#define OID_GEN_RESET_COUNTS
#define OID_GEN_GET_TIME_CAPS
#define OID_802_3_MULTICAST_LIST
#define OID_GEN_SUPPORTED_GUIDS
#define OID_GEN_DIRECTED_FRAMES_RCV
#define OID_PNP_ENABLE_WAKE_UP
#define OID_GEN_TRANSMIT_BUFFER_SPACE
#define OID_GEN_MEDIA_SUPPORTED
#define OID_GEN_BROADCAST_FRAMES_XMIT
#define OID_GEN_BROADCAST_FRAMES_RCV
#define OID_PNP_ADD_WAKE_UP_PATTERN
#define OID_GEN_MAXIMUM_FRAME_SIZE
#define OID_GEN_MEDIA_CAPABILITIES
#define OID_GEN_RCV_CRC_ERROR
#define OID_GEN_MEDIA_IN_USE
#define OID_GEN_MEDIA_CONNECT_STATUS
#define OID_GEN_DIRECTED_BYTES_XMIT
#define OID_GEN_MAXIMUM_LOOKAHEAD
#define OID_GEN_BROADCAST_BYTES_RCV
#define OID_802_3_RCV_ERROR_ALIGNMENT
#define OID_PNP_QUERY_POWER
#define OID_GEN_RCV_ERROR
#define OID_PNP_REMOVE_WAKE_UP_PATTERN
#define OID_PNP_CAPABILITIES
#define OID_TCP_TASK_OFFLOAD
#define OID_GEN_CURRENT_LOOKAHEAD
#define OID_GEN_MAC_OPTIONS
#define OID_GEN_VENDOR_DESCRIPTION
#define OID_IP6_OFFLOAD_STATS
#define OID_GEN_SUPPORTED_LIST
#define OID_GEN_MULTICAST_BYTES_XMIT
#define OID_GEN_MULTICAST_BYTES_RCV
#define OID_GEN_GET_NETCARD_TIME
#define OID_802_3_XMIT_DEFERRED
#define OID_GEN_RECEIVE_BLOCK_SIZE
#define OID_GEN_MAXIMUM_SEND_PACKETS
#define OID_GEN_TRANSMIT_QUEUE_LENGTH
#define OID_GEN_HARDWARE_STATUS
#define OID_GEN_MACHINE_NAME
#define OID_GEN_MEDIA_SENSE_COUNTS
#define OID_GEN_MULTICAST_FRAMES_RCV
struct _NDIS_TASK_TCP_IP_CHECKSUM::@2114 V4Transmit
struct _NDIS_TASK_TCP_IP_CHECKSUM::@2115 V4Receive
tOffloadSettingsFlags flags
UINT InformationBufferLength
OIDHANDLERPROC OidSetProc
NDIS_HANDLE MiniportHandle
PPARANDIS_ADAPTER pContext
NDIS_DEVICE_POWER_STATE state
_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
_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
_Check_return_ _Out_ PULONG pulSize