|DDI_DMAE_REQ(9S)||Data Structures for Drivers||DDI_DMAE_REQ(9S)|
uchar_t der_command; /* Read / Write * / uchar_t der_bufprocess; /* Standard / Chain */ uchar_t der_path; /* 8 / 16 / 32 */ uchar_t der_cycles; /* Compat / Type A / Type B / Burst */ uchar_t der_trans; /* Single / Demand / Block */ ddi_dma_cookie_t *(*proc)(); /* address of nextcookie routine */ void *procparms; /* parameter for nextcookie call */
A driver can specify the DMAE_BUF_CHAIN flag only if the particular bus architecture supports the use of multiple DMA cookies in a single I/O transfer. A bus DMA engine can support this feature either with a fixed-length scatter/gather list, or by an interrupt chaining feature. A driver must determine whether its parent bus nexus supports this feature by examining the scatter/gather list size returned in the dma_attr_sgllen member of the DMA attributes structure returned by the driver's call to ddi_dmae_getattr(). (See ddi_dma_attr(9S).) If the size of the scatter/gather list is 1, then no chaining is available. The driver must not specify the DMAE_BUF_CHAIN flag in the ddi_dmae_req structure it passes to ddi_dmae_prog(), and the driver need not provide a nextcookie routine.
If the size of the scatter/gather list is greater than 1, then DMA chaining is available, and the driver has two options. Under the first option, the driver chooses not to use the chaining feature. In this case (a) the driver must set the size of the scatter/gather list to 1 before passing it to the DMA setup routine, and (b) the driver must not set the DMAE_BUF_CHAIN flag.
Under the second option, the driver chooses to use the chaining feature, in which case, (a) it should leave the size of the scatter/gather list alone, and (b) it must set the DMAE_BUF_CHAIN flag in the ddi_dmae_req structure. Before calling ddi_dmae_prog(), the driver must prefetch cookies until either (1) the end of the DMA window is reached, or (2) the size of the scatter/gather list is reached, whichever occurs first. These cookies must be saved by the driver until they are requested by the nexus driver calling the driver's nextcookie routine. The driver's nextcookie routine must return the prefetched cookies in order, one cookie for each call to the nextcookie routine, until the list of prefetched cookies is exhausted. After the end of the list of cookies is reached, the nextcookie routine must return the NULL pointer.
The size of the scatter/gather list determines how many discontiguous segments of physical memory can participate in a single DMA transfer. ISA bus DMA engines have no scatter/gather capability, so their scatter/gather list sizes are 1. Other finite scatter/gather list sizes would also be possible. For performance reasons, drivers should use the chaining capability if it is available on their parent bus.
As described above, a driver making use of DMA chaining must prefetch DMA cookies before calling ddi_dmae_prog(). The reasons for this are:
If the scatter/gather list size is 1 (either because no chaining is available or because the driver does not want to use the chaining feature), then the total I/O count for a single DMA operation is the size of DMA segment denoted by the single DMA cookie that is passed in the call to ddi_dmae_prog(). In this case, the system arranges for each DMA segment to be a multiple of the device-granularity size.
|ATTRIBUTE TYPE||ATTRIBUTE VALUE|
|May 24, 2014||OmniOS|