3.3.5 Using Busmaster DMA

NT drivers of busmaster DMA devices can use the following kinds of system-supplied DMA support:

·Packet-based DMA if the busmaster adapter is such that the driver can determine when a DMA transfer operation is done and/or when to begin another transfer operation for a given IRP

·Common-buffer DMA (also called continuous DMA) if the busmaster adapter is such that the driver cannot determine readily when a transfer operation will begin or when a transfer is complete, or if a single buffer area is used continuously or repeatedly for DMA transfers

Depending on the nature of the busmaster adapter, some NT drivers use packet-based DMA exclusively, some use common-buffer DMA exclusively, and some use both. For example, the driver of a busmaster adapter that uses a mailbox scheme to communicate status information and commands might use a common buffer for the mailboxes shared between the driver and its adapter, together with packet-based DMA for data transfers.

Setting up a common buffer can tie up some (or all, depending on the size of the requested buffer) of the map registers associated with the adapter object that represents the busmaster adapter, so consider the following a design guideline:

Use common-buffer DMA economically.

Setting up common-buffer area(s) economically, such as in PAGE_SIZE chunks or in a single allocation, leaves more map registers available for such a driver's packet-based DMA operations, if any. It also leaves more system memory free for other purposes, which yields better overall driver and system performance.

The following subsections explain each kind of busmaster DMA separately.