1ddi_dma_nextseg(9F) Kernel Functions for Drivers ddi_dma_nextseg(9F)
2
3
4
6 ddi_dma_nextseg - get next DMA segment
7
9 #include <sys/ddi.h>
10 #include <sys/sunddi.h>
11
12
13
14 int ddi_dma_nextseg(ddi_dma_win_t win, ddi_dma_seg_t seg,
15 ddi_dma_seg_t *nseg);
16
17
19 This interface is obsolete. ddi_dma_nextcookie(9F) should be used
20 instead.
21
23 win A DMA window.
24
25
26 seg The current DMA segment or NULL.
27
28
29 nseg A pointer to the next DMA segment to be filled in. If seg is
30 NULL, a pointer to the first segment within the specified win‐
31 dow is returned.
32
33
35 The ddi_dma_nextseg() function gets the next DMA segment within the
36 specified window win. If the current segment is NULL, the first DMA
37 segment within the window is returned.
38
39
40 A DMA segment is always required for a DMA window. A DMA segment is a
41 contiguous portion of a DMA window (see ddi_dma_nextwin(9F)) which is
42 entirely addressable by the device for a data transfer operation.
43
44
45 An example where multiple DMA segments are allocated is where the sys‐
46 tem does not contain DVMA capabilities and the object may be non-con‐
47 tiguous. In this example the object will be broken into smaller con‐
48 tiguous DMA segments. Another example is where the device has an upper
49 limit on its transfer size (for example an 8-bit address register) and
50 has expressed this in the DMA limit structure (see
51 ddi_dma_lim_sparc(9S) or ddi_dma_lim_x86(9S)). In this example the
52 object will be broken into smaller addressable DMA segments.
53
55 The ddi_dma_nextseg() function returns:
56
57 DDI_SUCCESS Successfully filled in the next segment pointer.
58
59
60 DDI_DMA_DONE There is no next segment. The current segment is the
61 final segment within the specified window.
62
63
64 DDI_DMA_STALE win does not refer to the currently active window.
65
66
68 The ddi_dma_nextseg() function can be called from user, interrupt, or
69 kernel context.
70
72 For an example, see ddi_dma_segtocookie(9F).
73
75 See attributes(5) for a description of the following attributes:
76
77
78
79
80 ┌─────────────────────────────┬─────────────────────────────┐
81 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
82 ├─────────────────────────────┼─────────────────────────────┤
83 │Stability Level │Obsolete │
84 └─────────────────────────────┴─────────────────────────────┘
85
87 attributes(5), ddi_dma_addr_setup(9F), ddi_dma_buf_setup(9F),
88 ddi_dma_nextcookie(9F), ddi_dma_nextwin(9F), ddi_dma_segtocookie(9F),
89 ddi_dma_sync(9F), ddi_dma_lim_sparc(9S), ddi_dma_lim_x86(9S),
90 ddi_dma_req(9S)
91
92
93 Writing Device Drivers
94
95
96
97SunOS 5.11 04 Apr 2006 ddi_dma_nextseg(9F)