Compartir a través de


Updating the NDIS 6.0 Miniport Driver Characteristics Structure

Many entry points in the NDIS 5.x NDIS_MINIPORT_CHARACTERISTICS structure have been removed from the NDIS 6.0 version of the structure. The NDIS 6.0 version of the structure is named NDIS_MINIPORT_DRIVER_CHARACTERISTICS.

Most NDIS 6.0 data structures contain structure version information in the object header member, which is the first member of the structure. The version information is specified in the NDIS_OBJECT_HEADER structure.

The object header has three members: Type, Size, and Revision. Calls to NDIS 6.0 functions will succeed only if the header information is correct. The following example illustrates correct header initialization:

MPChar.Header.Type     = NDIS_OBJECT_TYPE_MINIPORT_DRIVER_CHARACTERISTICS,
MPChar.Header.Size     = sizeof(NDIS_MINIPORT_DRIVER_CHARACTERISTICS);
MPChar.Header.Revision = NDIS_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_1;

In the following examples, MPChar is a structure of type NDIS_MINIPORT_DRIVER_CHARACTERISTICS. The lines marked 5.x show NDIS 5.x initialization for comparison with the unmarked lines that illustrate replacement NDIS 6.0 initialization.

5.x MPChar.MajorNdisVersion             = 5;
5.x MPChar.MinorNdisVersion             = 1;

    MPChar.MajorNdisVersion             = 6;
    MPChar.MinorNdisVersion             = 0;

NDIS 6.0 miniport drivers can specify a driver version. The driver version is independent of the NDIS major and minor version shown above.

    MPChar.MajorDriverVersion = NIC_MAJOR_DRIVER_VERSION;
    MPChar.MinorDriverVersion = NIC_MINOR_DRIVER_VERSION;

Replace the MiniportInitialize function with the MiniportInitializeEx function as follows:

5.x MPChar.InitializeHandler           = MiniportInitialize;

    MPChar.InitializeHandlerEx         = MiniportInitializeEx;

Replace the MiniportHalt function with the MiniportHaltEx function as follows:

5.x MPChar.HaltHandler                  = MiniportHalt;

    MPChar.HaltHandlerEx                = MiniportHaltEx;

Replace the MiniportPnPEventNotify function with the MiniportDevicePnPEventNotify function as follows:

5.x MPChar.PnPEventNotifyHandler            = MiniportPnPEventNotify;

    MPChar.DevicePnPEventNotifyHandler      = MiniportDevicePnPEventNotify;

Replace the MiniportShutdown function with the MiniportShutdownEx function as follows:

5.x MPChar.AdapterShutdownHandler       = MiniportShutdown;

    MPChar.ShutdownHandlerEx            = MiniportShutdownEx;

Replace the MiniportCheckForHang function with the MiniportCheckForHangEx function as follows:

5.x MPChar.CheckForHangHandler          = MiniportCheckForHang;

    MPChar.CheckForHangHandlerEx        = MiniportCheckForHangEx;

Replace the MiniportReset function with the MiniportResetEx function as follows:

5.x MPChar.ResetHandler                 = MiniportReset;

    MPChar.ResetHandlerEx               = MiniportResetEx;

Remove the MiniportQueryInformation and MiniportSetInformation functions and replace them with the MiniportOidRequest function as follows:

5.x MPChar.QueryInformationHandler      = MiniportQueryInformation;
5.x MPChar.SetInformationHandler        = MiniportSetInformation;

    MPChar.OidRequestHandler            = MiniportOidRequest;

To register optional services, provide an entry point for the MiniportSetOptions function as follows:

    MPChar.SetOptionsHandler = MiniportSetOptions;

Interrupt functions are not specified in the NDIS 6.0 driver characteristics structure. Remove the interrupt function entry points from the driver characteristics as follows:

5.x MPChar.HandleInterruptHandler       = MiniportHandleInterrupt;
5.x MPChar.ISRHandler                   = MiniportISR;

(Removed in NDIS 6.0)

To register interrupt entry points with NDIS 6.0, call the NdisMRegisterInterruptEx function. The interrupt functions are specified in the NDIS_MINIPORT_INTERRUPT_CHARACTERISTICS structure. For more information about interrupts, see Porting Miniport Driver Interrupt Operations to NDIS 6.0.

Send and receive functions that use the NET_BUFFER and NET_BUFFER_LIST structures replace functions that use NDIS_PACKET structures as follows:

5.x MPChar.ReturnPacketHandler          = MiniportReturnPacket;
5.x MPChar.SendPacketsHandler           = MiniportSendPackets;
5.x MPChar.CancelSendPacketsHandler     = MiniportCancelSendPackets;

    MPChar.SendNetBufferListsHandler    = MiniportSendNetBufferLists;
    MPChar.CancelSendHandler            = MiniportCancelSendNetBufferLists;
    MPChar.ReturnNetBufferListsHandler  = MiniportReturnNetBufferLists;

For more information about the NET_BUFFER and NET_BUFFER_LIST structures, see NET_BUFFER Architecture.

To support unloading, pausing, and restarting the miniport driver, add the MiniportDriverUnload, MiniportPause, and MiniportRestart functions as follows:

    MPChar.UnloadHandler                = MiniportDriverUnload;
    MPChar.PauseHandler                 = MiniportPause;
    MPChar.RestartHandler               = MiniportRestart;

For more information about pause and restart operations, see Driver Stack Management.