This function informs the NDIS library about significant features of the caller’s NIC or virtual NIC during initialization.
Header file: | Ndis.h |
Windows CE versions: | 2.0 and later |
VOID NdisMSetAttributesEx( IN NDIS_HANDLE MiniportAdapterHandle, IN NDIS_HANDLE MiniportAdapterContext,
IN UINT CheckForHangTimeInSeconds,
OPTIONAL, IN ULONG AttributeFlags,
IN NDIS_INTERFACE_TYPE AdapterType );
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.
This parameter is irrelevant for intermediate drivers, which should pass 0 for this parameter to this function.
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:
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.
NdisAllocateMemory, NdisMMapIoSpace, NdisMPciAssignResources, NdisMRegisterInterrupt, NdisMRegisterIoPortRange, NdisMRegisterMiniport, NdisOpenConfiguration