Microsoft Windows CE 3.0  

NdisMSetAttributes

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 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 MiniportInitializefunction.
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 MiniportInitializefunction must call this function or NdisMSetAttributesExbefore calling any other NdisMRegister XXXor Ndis XXXfunction that depends on the information supplied to this function or NdisMSetAttributesEx. For example, a call to the NdisMAllocateMapRegistersfunction fails if MiniportInitializehas not yet called this function with BusMasterset to TRUE or NdisMSetAttributesExwith NDIS_ATTRIBUTE_BUS_MASTER set in the AttributeFlags.

In general, an NIC driver must call this function or NdisMSetAttributesExbefore it calls any Ndis XXXfunction that claims hardware resources in the registry for its NIC because NDIS must have the BusMasteror AttributeFlagsvalue, respectively, 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 an NIC driver's MiniportInitializefunction cannot call the following Ndis XXXfunctions before it calls this function or NdisMSetAttributesEx:

  • NdisMPciAssignResources
  • NdisMAllocateMapRegistersand NdisMAllocateSharedMemory
  • NdisMMapIoSpace
  • NdisMRegisterDmaChannel
  • NdisMRegisterInterrupt
  • NdisMRegisterIoPortRangeand, consequently, the NdisRaw XXX Port XXXfunctions

    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 NdisImmediate XXX, such as NdisImmediateReadPciSlotInformationor NdisImmediateReadSharedMemory, as well as the NdisImmediate XXX Port XXXfunctions. MiniportInitializecan also call the bus-type-specific NdisRead XXXfunctions, such as NdisReadPciSlotInformation, as long as the installed registry entry for the driver's interface type matches the bus-type-specific NdisRead XXX MiniportInitializecalls.

    The MiniportAdapterContexthandle supplied to this function or NdisMSetAttributesExbecomes an input parameter to all Miniport XXXfunctions 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 NdisMSetAttributesExallows a miniport to adjust the intervals at which its MiniportCheckForHangand MiniportResetfunctions 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

    © 2004 Microsoft Corporation. All rights reserved.