NDIS Miniport driver (NDIS 6.60): After my InitializeHandlerEx returns NDIS_STATUS_SUCCESS HaltHandlerEx is called directly. Why?

Carsten Buchloh 106 Reputation points
2021-05-06T16:43:53.813+00:00

Hi from Germany,

I am currently porting our NDIS 6.20 miniport driver (which runs without any problems since many years) to NDIS Version 6.60.

The miniport driver runs on a PCIx network card.

When starting my miniport driver with the NDIS 6.60 version, the InitializeHandlerEx handler is called and returns NDIS_STATUS_SUCCESS.

The error or problem is, that NDIS calls my HaltHandlerEx directly after the successful InitializeHandlerEx handler call.
I have no idea why or where to search.

In between InitializeHandlerEx and HaltHandlerEx no other NDIS callback function is called except one interrupt and DPC call from the firmware, telling me, that the link is down, which I report to NDIS with NdisMIndicateStatusEx and a NDIS_STATUS_INDICATION.

This is my NdisMRegisterMiniportDriver function:

MP162XChar.Header.Type = NDIS_OBJECT_TYPE_MINIPORT_DRIVER_CHARACTERISTICS;
MP162XChar.Header.Revision = NDIS_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_2;
MP162XChar.Header.Size = NDIS_SIZEOF_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_2;
MP162XChar.MajorNdisVersion = 6;
MP162XChar.MinorNdisVersion = 60;
MP162XChar.MajorDriverVersion = 0;
MP162XChar.MinorDriverVersion = 0;
MP162XChar.Flags = 0;
MP162XChar.SetOptionsHandler = NULL;
MP162XChar.InitializeHandlerEx = MP162XInitializeEx;
MP162XChar.HaltHandlerEx = MP162XHaltEx;
MP162XChar.UnloadHandler = DriverUnload;
MP162XChar.PauseHandler = MP162XPause;
MP162XChar.RestartHandler = MP162XRestart;
MP162XChar.OidRequestHandler = MP162XOidRequest;
MP162XChar.SendNetBufferListsHandler = MP162XSendNetBufferLists;
MP162XChar.ReturnNetBufferListsHandler = MP162XReturnNetBufferLists;
MP162XChar.CheckForHangHandlerEx = NULL;
MP162XChar.ResetHandlerEx = NULL;
MP162XChar.ShutdownHandlerEx = MP162XShutdownEx;
MP162XChar.DevicePnPEventNotifyHandler = MP162XDevicePnPEventNotify;
MP162XChar.CancelSendHandler = MP162XCancelSend;
MP162XChar.CancelOidRequestHandler = MP162XCancelOidRequest;
MP162XChar.DirectOidRequestHandler = NULL;
MP162XChar.CancelDirectOidRequestHandler= NULL;

status = NdisMRegisterMiniportDriver(DriverObject, RegistryPath, (PNDIS_HANDLE)gMiniportDriverContext, &MP162XChar, &NdisMiniportDriverHandle);

Any idea, where to look or why NDIS calls my HaltHandlerEx?

Thanks a lot.

Carsten

Windows Hardware Performance
Windows Hardware Performance
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.Hardware Performance: Delivering / providing hardware or hardware systems or adjusting / adapting hardware or hardware systems.
1,245 questions
No comments
1 vote

Accepted answer
  1. Carsten Buchloh 106 Reputation points
    2021-05-10T11:17:23.777+00:00

    The problem is solved.

    I managed to enable NDIS tracing and had the followong output:

    Fail to start Miniport FFFF9001A406B1A0 because miniport claims PhysicalMediumType 14 in NDIS_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES, but miniport's INF claimed *PhysicalMediaType 0. Fix one or the other to match.

    After fixing the PhysicalMediumType in the INF file, the miniport does not get stopped anymore.

    Interesting - the PhysicalMediumType was set to 0 (=NdisPhysicalMediumUnspecified) in the INF file since roundabout 15 years.

    Up to NDIS 6.50 this was not a problem. Only from version NDIS 6.60 it was a problem or detected by NDIS.

    No comments

0 additional answers

Sort by: Most helpful