Share via


NdisMSetAttributesEx

This function informs the NDIS library about significant features of the caller's NIC or virtual NIC during initialization.

VOID NdisMSetAttributesEx(
IN NDIS_HANDLE MiniportAdapterHandle, 
IN NDIS_HANDLE MiniportAdapterContext, 
IN UINT CheckForHangTimeInSeconds, 
OPTIONAL, IN ULONG AttributeFlags, 
IN NDIS_INTERFACE_TYPE AdapterType );

Parameters

  • MiniportAdapterHandle
    Handle input to the MiniportInitialize function.

  • MiniportAdapterContext
    Handle to a resident context area allocated by MiniportInitialize.

  • CheckForHangTimeInSeconds
    Specifies the interval, in seconds, at which NDIS should call the MiniportCheckForHang function, if any. Specifying 0 for this parameter indicates that NDIS should call MiniportCheckForHang at NDIS's default two-second interval and that NDIS should call the MiniportReset function at the default four-second time-out interval for pending sends and requests that NDIS subsequently holds queued to the caller.

    Specifying a value greater than 2 extends both the check-for-hang and time-out intervals. NDIS uses double the specified check-for-hang interval as its time-out interval for the caller.

  • AttributeFlags
    Specifies a bitmask that can be set with one or more of the following flags:

    Value Description
    NDIS_ATTRIBUTE_BUS_MASTER Set if the caller's NIC is a busmaster DMA device.
    NDIS_ATTRIBUTE_IGNORE_PACKET_TIMEOUT Set if NDIS should not attempt to time-out pending send packets that it holds queued to the caller. Intermediate drivers should set this flag, but NIC drivers should not.
    NDIS_ATTRIBUTE_IGNORE_REQUEST_TIMEOUT Set if NDIS should not attempt to time-out pending query and set requests that it holds queued to the caller. Intermediate drivers should set this flag, but NIC drivers should not.
    NDIS_ATTRIBUTE_INTERMEDIATE_DRIVER Set if the caller is an intermediate driver.
    NDIS_ATTRIBUTE_IGNORE_TOKEN_RING_ERRORS Set if NDIS should not call a token ring NIC driver's MiniportReset function if token ring errors are indicated.
  • AdapterType
    Specifies the I/O bus interface type of the caller's NIC, which usually is the type of I/O bus on which the NIC is connected, as one of the following:

    Value Description
    NdisInterfaceInternal Specifies a host-specific internal interface.
    NdisInterfaceIsa Specifies the ISA interface.
    NdisInterfaceEisa Specifies the extended ISA (EISA) interface.
    NdisInterfacePci Specifies the Peripheral Component Interconnect (PCI) interface.
    NdisInterfacePCMcia Specifies the Personal Computer Memory Card International Association (PCMCIA) interface.

    This parameter is irrelevant for intermediate drivers, which should pass 0 for this parameter to this function.

Remarks

MiniportInitialize must call this function or NdisMSetAttributes before calling any other NdisMRegisterXXX or NdisXXX ** function that depends on the information supplied to this function. For example, an NIC driver's call to NdisMAllocateMapRegisters fails if MiniportInitialize has not yet called this function with the AttributeFlags set with NDIS_ATTRIBUTE_BUS_MASTER.

Intermediate drivers must call this function, rather than NdisMSetAttributes, and they must set the NDIS_ATTRIBUTE_INTERMEDIATE_DRIVER in the AttributeFlags. Setting this flag causes NDIS to treat an intermediate driver as a full-duplex miniport, which prevents rare but intermittent deadlocks from occurring in the intermediate driver. Consequently, every intermediate driver must be capable of handling concurrent sends and indications.

NIC drivers can call either of these functions from MiniportInitialize, but NdisMSetAttributes does not allow its caller to adjust the interval at which an NIC driver's MiniportCheckForHang and/or MiniportReset function(s) are called.

The value of CheckForHangTimeInSeconds determines the NDIS library's time-out interval on sends and requests that it holds queued to the caller. By default, NDIS times out queued sends and requests at twice the check-for-hang interval, after which it calls the MiniportReset function, unless the driver sets AttributeFlags with NDIS_ATTRIBUTE_IGNORE_PACKET_TIMEOUT and NDIS_ATTRIBUTE_IGNORE_REQUEST_TIMEOUT when it calls this function. Intermediate drivers should set these flags when calling this function because such a driver cannot determine or control when the underlying device driver processes sends and requests.

NIC drivers should not set the NDIS_ATTRIBUTE_IGNORE_PACKET_TIMEOUT and NDIS_ATTRIBUTE_IGNORE_REQUEST_TIMEOUT flags, although NDIS honors such a specification by an NIC driver. However, NIC drivers can adjust the time-out interval at which their MiniportReset functions are called by specifying an explicit CheckForHangTimeInSeconds. For example, an NIC driver that emulates Ethernet over a modem might not complete every packet within the default time-out interval of the NDIS library. Whenever a packet appears to time out on such an NIC, NDIS assumes that the NIC is no longer operating correctly and calls the driver's MiniportReset function. For the driver of such an NIC, calling this function with a CheckForHangTimeInSeconds set to something greater than 2 both prevents unnecessary resets and extends the interval at which its MiniportCheckForHang function, if any, is called to test the operational state of the NIC.

In general, an NIC driver must call this function before it calls any NdisXXX function that claims hardware resources in the registry for its NIC, because NDIS must have the AttributeFlags value before such a call is made and because the driver usually needs the memory at MiniportAdapterContext to store information for these calls. This restriction implies that an NIC driver's MiniportInitialize function cannot call the following NdisXXX functions before it calls this function:

  • NdisMPciAssignResources
  • NdisMAllocateMapRegisters and NdisMAllocateSharedMemory
  • NdisMMapIoSpace
  • NdisMRegisterDmaChannel
  • NdisMRegisterInterrupt
  • NdisMRegisterIoPortRange and, consequently, the NdisRawXXXPortXXX functions

However, before calling this function, any driver's MiniportInitialize function can call the NDIS configuration functions to retrieve configuration information installed in the registry. Before calling this function, an NIC driver can call the NdisImmediateXXX, such as NdisImmediateReadPciSlotInformation or NdisImmediateReadSharedMemory, as well as the NdisImmediateXXXPortXXX functions. MiniportInitialize can also call the bus-type-specific NdisReadXXX functions, such as NdisReadPciSlotInformation, as long as the installed registry entry for the driver's interface type matches the bus-type-specific NdisReadXXX MiniportInitialize calls.

The MiniportAdapterContext handle supplied to this function becomes an input parameter to all MiniportXXX functions that were registered, along with MiniportInitialize, in the call to NdisMRegisterMiniport or NdisIMRegisterLayeredMiniport. Usually, this handle is a pointer to resident memory allocated by MiniportInitialize, in which the driver maintains NIC-specific run-time state.

A driver that calls this function runs at IRQL PASSIVE_LEVEL.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 2.0 and later Ndis.h    

Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

NdisAllocateMemory, NdisMMapIoSpace, NdisMPciAssignResources, NdisMRegisterInterrupt, NdisMRegisterIoPortRange, NdisMRegisterMiniport, NdisOpenConfiguration

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.