1ddi_dma_cookie(9S)        Data Structures for Drivers       ddi_dma_cookie(9S)
2
3
4

NAME

6       ddi_dma_cookie - DMA address cookie
7

SYNOPSIS

9       #include <sys/sunddi.h>
10
11

INTERFACE LEVEL

13       Solaris DDI specific (Solaris DDI).
14

DESCRIPTION

16       The   ddi_dma_cookie_t   structure  contains  DMA  address  information
17       required to program a DMA engine. The structure is filled in by a  call
18       to       ddi_dma_getwin(9F),      ddi_dma_addr_bind_handle(9F),      or
19       ddi_dma_buf_bind_handle(9F), to get device-specific DMA transfer infor‐
20       mation for a DMA request or a DMA window.
21

STRUCTURE MEMBERS

23         typedef struct {
24             union {
25                     uint64_t        _dmac_ll;    /* 64 bit DMA add. */
26                     uint32_t        _dmac_la[2]; /* 2 x 32 bit add. */
27             } _dmu;
28             size_t          dmac_size;   /* DMA cookie size */
29             uint_t          dmac_type;   /* bus spec. type bits */
30         } ddi_dma_cookie_t;
31
32
33
34       You  can  access the DMA address through the #defines: dmac_address for
35       32-bit addresses and dmac_laddress for 64-bit addresses.  These  macros
36       are defined as follows:
37
38         #define dmac_laddress   _dmu._dmac_ll
39         #ifdef _LONG_LONG_HTOL
40         #define dmac_notused    _dmu._dmac_la[0]
41         #define dmac_address    _dmu._dmac_la[1]
42         #else
43         #define dmac_address    _dmu._dmac_la[0]
44         #define dmac_notused    _dmu._dmac_la[1]
45         #endif
46
47
48
49       dmac_laddress  specifies  a 64-bit I/O address appropriate for program‐
50       ming the device's DMA engine. If a device has a 64-bit DMA address reg‐
51       ister  a  driver  should  use  this  field  to  program the DMA engine.
52       dmac_address specifies a 32-bit I/O address.  It  should  be  used  for
53       devices  that have a 32-bit DMA address register. The I/O address range
54       that the device can address and other DMA attributes have to be  speci‐
55       fied in a ddi_dma_attr(9S) structure.
56
57
58       dmac_size describes the length of the transfer in bytes.
59
60
61       dmac_type contains bus-specific type bits, if appropriate. For example,
62       a device on a PCI bus has PCI address modifier bits placed here.
63

SEE ALSO

65       pci(4),     sbus(4),      sysbus(4),      ddi_dma_addr_bind_handle(9F),
66       ddi_dma_buf_bind_handle(9F),                        ddi_dma_getwin(9F),
67       ddi_dma_nextcookie(9F), ddi_dma_attr(9S)
68
69
70       Writing Device Drivers
71
72
73
74SunOS 5.11                        30 Sep 1996               ddi_dma_cookie(9S)
Impressum