This function informs the NDIS library about significant features of the caller’s NIC during initialization.
Header file: | Ndis.h |
Windows CE versions: | 2.0 and later |
VOID NdisMSetAttributes( IN NDIS_HANDLE MiniportAdapterHandle,
IN NDIS_HANDLE MiniportAdapterContext, IN BOOLEAN BusMaster,
IN NDIS_INTERFACE_TYPE AdapterType );
A MiniportInitialize function must call this function or NdisMSetAttributesEx before calling any other NdisMRegisterXXX or NdisXXX function that depends on the information supplied to this function or NdisMSetAttributesEx. For example, a call to the NdisMAllocateMapRegisters function fails if MiniportInitialize has not yet called this function with BusMaster set to TRUE or NdisMSetAttributesEx with NDIS_ATTRIBUTE_BUS_MASTER set in the AttributeFlags.
In general, an NIC driver must call this function or NdisMSetAttributesEx before it calls any NdisXXX function that claims hardware resources in the registry for its NIC because NDIS must have the BusMaster or AttributeFlags value, respectively, 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 or NdisMSetAttributesEx:
However, before calling this function or NdisMSetAttributesEx, an NIC driver can call the NDIS configuration functions to retrieve configuration information installed in the registry and 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 or NdisMSetAttributesEx becomes an input parameter to all MiniportXXX functions that were registered, along with MiniportInitialize, in the call to NdisMRegisterMiniport. Usually, this handle is a pointer to resident memory, allocated by MiniportInitialize, in which the driver maintains NIC-specific run-time state.
Intermediate drivers must call NdisMSetAttributesEx, rather than this function. NIC drivers can call either of these functions, but NdisMSetAttributesEx allows a miniport to adjust the intervals at which its MiniportCheckForHang and MiniportReset functions are called.
A driver that calls this function runs at IRQL PASSIVE_LEVEL.
NdisMMapIoSpace, NdisMPciAssignResources, NdisMRegisterInterrupt, NdisMRegisterIoPortRange, NdisMRegisterMiniport, NdisMSetAttributesEx, NdisOpenConfiguration, NdisReadPciSlotInformation, NdisWritePciSlotInformation