VOID
NdisAllocateDmaChannel(
OUT PNDIS_STATUS Status,
OUT PNDIS_HANDLE NdisDmaHandle,
IN NDIS_HANDLE NdisAdapterHandle,
IN PNDIS_DMA_DESCRIPTION DmaDescription,
IN ULONG MaximumLength
);
NdisAllocateDmaChannel is called by the NIC driver to set up a DMA channel for future DMA operations.
Parameters
Status
Points to the caller-supplied variable in which this function returns the status of the channel allocation. Possible values are:
NDIS_STATUS_FAILURE
NDIS_STATUS_RESOURCE_CONFLICT
NDIS_STATUS_RESOURCES
NDIS_STATUS_SUCCESS
NdisDmaHandle
Points to a caller-supplied variable in which this function returns the handle that the NDIS interface library associates with the DMA channel.
NdisAdapterHandle
Specifies the handle that the NDIS interface library associates with the network interface card.
DmaDescription
Points to the description of the DMA transfer, defined as follows:
The NDIS_DMA_DESCRIPTION structure is defined as follows:
typedef struct _NDIS_DMA_DESCRIPTION {
BOOLEAN DemandMode;
DMA_WIDTH DmaWidth;
DMA_SPEED DmaSpeed;
ULONG DmaPort;
} NDIS_DMA_DESCRIPTION, *PNDIS_DMA_DESCRIPTION;
Member | Value |
DemandMode | TRUE if an ISA device operates in demand mode rather than single-byte mode. |
DmaWidth | The transfer width of the DMA operation, one of: Width8Bits, Width16Bits, or Width32Bits. |
DmaSpeed | The transfer speed of the DMA operation, one of: Compatible, TypeA, TypeB, or TypeC. |
DmaPort | For a NIC on an I/O bus with the interface type MicroChannel, the I/O port used. Otherwise, this member must be zero. |
MaximumLength
Specifies the maximum length, in bytes, of the DMA transfer using the channel.
Comments
The NIC driver specifies the DMA channel in an NDIS_ADAPTER_INFORMATION structure that it passes to NdisRegisterAdapter.
The NIC driver should call NdisAllocateDmaChannel only during NIC driver initialization from its DriverEntry or MacAddAdapter function.
Slave DMA network interface cards that initiate their own DMA operations use this function. The driver of a busmaster card does not need to allocate a DMA channel.
Callers of NdisAllocateDmaChannel run at IRQL PASSIVE_LEVEL.
See Also
MacAddAdapter, NdisFreeDmaChannel, NdisReadDmaCounter, NdisRegisterAdapter