Compartilhar via


NdisMSetAttributes

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

VOID NdisMSetAttributes(
IN NDIS_HANDLE MiniportAdapterHandle, 
IN NDIS_HANDLE MiniportAdapterContext, 
IN BOOLEAN BusMaster, 
IN NDIS_INTERFACE_TYPE AdapterType );

Parameters

  • MiniportAdapterHandle
    Handle input to the MiniportInitialize function.
  • MiniportAdapterContext
    Handle to a resident context area allocated by MiniportInitialize.
  • BusMaster
    Specifies TRUE if the caller's NIC is a busmaster DMA device.
  • 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.

Remarks

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:

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

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.

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

NdisMMapIoSpace, NdisMPciAssignResources, NdisMRegisterInterrupt, NdisMRegisterIoPortRange, NdisMRegisterMiniport, NdisMSetAttributesEx, NdisOpenConfiguration, NdisReadPciSlotInformation, NdisWritePciSlotInformation

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.