Microsoft Windows CE 3.0  

NdisMSetAttributesEx

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

This function informs the NDIS library about significant features of the caller's network adapter or virtual network adapter 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 MiniportInitializefunction.
MiniportAdapterContext
Handle to a resident context area allocated by MiniportInitialize.
CheckForHangTimeInSeconds
Specifies the interval, in seconds, at which NDIS should call the MiniportCheckForHangfunction, if any. Specifying 0 for this parameter indicates that NDIS should call MiniportCheckForHangat NDIS's default two-second interval and that NDIS should call the MiniportResetfunction 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 network adapter 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 network adapter 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 network adapter 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 network adapter driver's MiniportResetfunction if token ring errors are indicated.
AdapterType
Specifies the I/O bus interface type of the caller's network adapter, which usually is the type of I/O bus on which the network adapter 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

MiniportInitializemust call this function or NdisMSetAttributesbefore calling any other NdisMRegister XXXor Ndis XXX function that depends on the information supplied to this function. For example, a network adapter driver's call to NdisMAllocateMapRegistersfails if MiniportInitializehas not yet called this function with the AttributeFlagsset 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.

network adapter drivers can call either of these functions from MiniportInitialize, but NdisMSetAttributesdoes not allow its caller to adjust the interval at which a network adapter driver's MiniportCheckForHangand/or MiniportResetfunction(s) are called.

The value of CheckForHangTimeInSecondsdetermines 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 MiniportResetfunction, unless the driver sets AttributeFlagswith 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.

network adapter drivers should not set the NDIS_ATTRIBUTE_IGNORE_PACKET_TIMEOUT and NDIS_ATTRIBUTE_IGNORE_REQUEST_TIMEOUT flags, although NDIS honors such a specification by a network adapter driver. However, network adapter drivers can adjust the time-out interval at which their MiniportResetfunctions are called by specifying an explicit CheckForHangTimeInSeconds. For example, a network adapter 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 a network adapter, NDIS assumes that the network adapter is no longer operating correctly and calls the driver's MiniportResetfunction. For the driver of such a network adapter, calling this function with a CheckForHangTimeInSecondsset to something greater than 2 both prevents unnecessary resets and extends the interval at which its MiniportCheckForHangfunction, if any, is called to test the operational state of the network adapter.

In general, a network adapter driver must call this function before it calls any Ndis XXXfunction that claims hardware resources in the registry for its network adapter, because NDIS must have the AttributeFlagsvalue before such a call is made and because the driver usually needs the memory at MiniportAdapterContextto store information for these calls. This restriction implies that a network adapter driver's MiniportInitializefunction cannot call the following Ndis XXXfunctions before it calls this function: