1ddi_dma_nextwin(9F)      Kernel Functions for Drivers      ddi_dma_nextwin(9F)
2
3
4

NAME

6       ddi_dma_nextwin - get next DMA window
7

SYNOPSIS

9       #include <sys/ddi.h>
10       #include <sys/sunddi.h>
11
12
13
14       int ddi_dma_nextwin(ddi_dma_handle_t handle, ddi_dma_win_t win,
15            ddi_dma_win_t *nwin);
16
17

INTERFACE LEVEL

19       This interface is obsolete. ddi_dma_getwin(9F) should be used instead.
20

PARAMETERS

22       handle    A DMA handle.
23
24
25       win       The current DMA window or NULL.
26
27
28       nwin      A  pointer  to the next DMA window to be filled in. If win is
29                 NULL, a pointer to the first  window  within  the  object  is
30                 returned.
31
32

DESCRIPTION

34       The ddi_dma_nextwin() function shifts the current DMA window win within
35       the object referred to by handle to the next DMA window  nwin.  If  the
36       current window is NULL, the first window within the object is returned.
37       A DMA window is a portion of a  DMA  object  or  might  be  the  entire
38       object.  A  DMA window has system resources allocated to it and is pre‐
39       pared to accept data transfers. Examples of system resources  are  DVMA
40       mapping resources and intermediate transfer buffer resources.
41
42
43       All  DMA  objects  require  a  window. If the DMA window represents the
44       whole DMA object it has system resources allocated for the entire  data
45       transfer.  However,  if  the  system  is unable to setup the entire DMA
46       object due to system resource limitations, the driver writer may  allow
47       the  system  to  allocate system resources for less than the entire DMA
48       object. This can be accomplished by specifying the DDI_DMA_PARTIAL flag
49       as a parameter to ddi_dma_buf_setup(9F) or ddi_dma_addr_setup(9F) or as
50       part of a ddi_dma_req(9S) structure in a call to ddi_dma_setup(9F).
51
52
53       Only the window that has resources allocated is valid per object at any
54       one  time. The currently valid window is the one that was most recently
55       returned  from  ddi_dma_nextwin().  Furthermore,  because  a  call   to
56       ddi_dma_nextwin()  will  reallocate system resources to the new window,
57       the previous window will become invalid. It is a severe error  to  call
58       ddi_dma_nextwin() before any transfers into the current window are com‐
59       plete.
60
61
62       The ddi_dma_nextwin() function takes care of underlying memory synchro‐
63       nizations  required to shift the window. However, if you want to access
64       the data before or after moving the  window,  further  synchronizations
65       using ddi_dma_sync(9F) are required.
66

RETURN VALUES

68       The ddi_dma_nextwin() function returns:
69
70       DDI_SUCCESS      Successfully filled in the next window pointer.
71
72
73       DDI_DMA_DONE     There  is  no  next  window. The current window is the
74                        final window within the specified object.
75
76
77       DDI_DMA_STALE    win does not refer to the currently active window.
78
79

CONTEXT

81       The ddi_dma_nextwin() function can be called from user,  interrupt,  or
82       kernel context.
83

EXAMPLES

85       For an example see ddi_dma_segtocookie(9F).
86

ATTRIBUTES

88       See attributes(5) for a description of the following attributes:
89
90
91
92
93       ┌─────────────────────────────┬─────────────────────────────┐
94ATTRIBUTE TYPE         ATTRIBUTE VALUE        
95       ├─────────────────────────────┼─────────────────────────────┤
96       │Stability Level              │Obsolete                     │
97       └─────────────────────────────┴─────────────────────────────┘
98

SEE ALSO

100       attributes(5),      ddi_dma_addr_setup(9F),      ddi_dma_buf_setup(9F),
101       ddi_dma_getwin(9F),    ddi_dma_nextseg(9F),    ddi_dma_segtocookie(9F),
102       ddi_dma_sync(9F), ddi_dma_req(9S)
103
104
105       Writing Device Drivers
106
107
108
109SunOS 5.11                        16 Jan 2006              ddi_dma_nextwin(9F)
Impressum